posthog-js 1.419.0 → 1.419.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var e="undefined"!=typeof window?window:void 0,t="undefined"!=typeof globalThis?globalThis:e,r=null==t?void 0:t.navigator,i=null==t?void 0:t.document,n=null==t?void 0:t.location;null!=t&&t.XMLHttpRequest&&new t.XMLHttpRequest;var a=null==r?void 0:r.userAgent,o="undefined"!=typeof globalThis?globalThis:e;o&&"undefined"==typeof self&&(o.self=o),o&&"undefined"==typeof File&&(o.File=function(){});var s=null!=e?e:{};function u(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(i,n)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var a=e.apply(t,r);function o(e){u(a,i,n,o,s,"next",e)}function s(e){u(a,i,n,o,s,"throw",e)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},h.apply(null,arguments)}var c,d={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},v={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},f="min_length",p="max_length",m="NativeGzipValidationError",g=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=m,t},y=function(){var e=l((function*(e,t){18>e.size&&g("too-short");var r,i=new Uint8Array(yield e.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&g("invalid-header");var n=new DataView(yield e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(c)return c;c=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;c[e]=t>>>0}return c})(),r=4294967295,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(4294967295^r)>>>0})(t)&&g("invalid-crc");var a=t.length>>>0;n.getUint32(4,!0)!==a&&g("invalid-size")}));return function(t,r){return e.apply(this,arguments)}}();function b(){return b=l((function*(e,t,r){void 0===t&&(t=!0);try{var i=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(i).then((()=>a.close())).catch(function(){var e=l((function*(e){try{yield a.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(n.readable).blob(),u=(yield Promise.all([s,o]))[0];return yield y(u,i),u}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})),b.apply(this,arguments)}function w(e,t){return-1!==e.indexOf(t)}var k=function(e){return e.trim()},_=Object.prototype,S=_.hasOwnProperty,x=_.toString,C=Array.isArray||function(e){return"[object Array]"===x.call(e)},M=e=>"function"==typeof e,T=e=>e===Object(e)&&!C(e),I=e=>void 0===e,E=e=>"[object String]"==x.call(e),R=e=>E(e)&&0===e.trim().length,A=e=>null===e,L=e=>I(e)||A(e),O=e=>"[object Number]"==x.call(e)&&e==e,F=e=>"[object Boolean]"===x.call(e),N=e=>e instanceof FormData;function D(e){return null===e||"object"!=typeof e}function P(e,t){return{}.toString.call(e)==="[object "+t+"]"}function q(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return B(e,Error)}}function j(e){return"undefined"!=typeof Event&&B(e,Event)}function B(e,t){try{return e instanceof t}catch(e){return!1}}function H(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),O(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),H(n||r,t,r,i))}class U{constructor(e){this.k={},this.S=e.S,this.C=H(e.bucketSize,0,100,e.I),this.R=H(e.refillRate,0,this.C,e.I),this.A=H(e.refillInterval,0,864e5,e.I)}O(e,t){var r=Math.floor((t-e.lastAccess)/this.A);r>0&&(e.tokens=Math.min(e.tokens+r*this.R,this.C),e.lastAccess=e.lastAccess+r*this.A)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.k[i];return n?this.O(n,r):this.k[i]=n={tokens:this.C,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.S)||t.call(this,e)),0===n.tokens)}stop(){this.k={}}}var W,z,V,Z="Mobile",Q="Android",G="Tablet",Y=Q+" "+G,J="iPad",K="Apple Watch",X="BlackBerry",ee="Nintendo",te="PlayStation",re="Xbox",ie="Windows Phone",ne="Nokia",ae="Ouya",oe="Generic",se=oe+" "+Z.toLowerCase(),ue=oe+" "+G.toLowerCase(),le=new RegExp(re,"i"),he=new RegExp(te+" \\w+","i"),ce=new RegExp(ee+" \\w+","i"),de=new RegExp(X+"|PlayBook|BB10","i");function ve(e){return e?e.split("#")[0]:e}function fe(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function pe(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return V&&r.length===z||(z=r.length,V=r.reduce(((r,i)=>{W||(W={});var n=W[i];if(n)r[n[0]]=n[1];else for(var a=e(i),o=a.length-1;o>=0;o--){var s=a[o],u=null==s?void 0:s.filename,l=t[i];if(u&&l){r[u]=l,W[i]=[u,l];break}}return r}),{})),V}}var me="?";function ge(e,t,r,i,n){var a={platform:e,filename:t,function:"<anonymous>"===r?me:r,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return I(i)||(a.lineno=i),I(n)||(a.colno=n),a}var ye=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:me,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},be=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,we=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ke=/\((\S*)(?::(\d+))(?::(\d+))\)/,_e=(e,t)=>{var r=be.exec(e);if(r)return ge(t,r[1],me,+r[2],+r[3]);var i=we.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=ke.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var a=ye(i[1]||me,i[2]);return ge(t,a[1],a[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Se=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ce=(e,t)=>{var r=Se.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=xe.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],a=r[1]||me,o=ye(a,n);return ge(t,n=o[1],a=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Me=/\(error: (.*)\)/;var Te=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var Ie=["fatal","error","warning","log","info","debug"];function Ee(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}var Re={DEBUG:!1,LIB_VERSION:"0.5.2",LIB_NAME:"browser-common"},Ae=function(t,r){var i=(void 0===r?{}:r).debugEnabled,n={F(r){if(e&&(Re.DEBUG||e.POSTHOG_DEBUG||i)&&!I(e.console)&&e.console){for(var n=("__rrweb_original__"in e.console[r]?e.console[r].__rrweb_original__:e.console[r]),a=arguments.length,o=new Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];n(t,...o)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.F("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.F("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.F("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.F("error",...t)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(e,r)=>Ae(t+" "+e,r)};return n},Le=Ae("[PostHog.js]"),Oe=Le.createLogger;function Fe(e,t){if(!L(e))if(C(e))e.forEach(t);else if(N(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)S.call(e,r)&&t(e[r],r)}var Ne=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var a in n)void 0!==n[a]&&(e[a]=n[a]);return e};function De(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}function Pe(e,t,r,i){var n=null!=i?i:{},a=n.capture,o=n.passive;null==e||e.addEventListener(t,r,{capture:void 0!==a&&a,passive:void 0===o||o})}var qe=["localhost","127.0.0.1"],je=e=>{var t=null==i?void 0:i.createElement("a");return I(t)?null:(t.href=e,t)},Be=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return Fe(e,(function(e,t){I(e)||I(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)};function He(t){var r,i=null==e||null==(r=e.location)?void 0:r.href;return I(i)?void 0:function(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!M(i))return t;try{var n=i(t);return E(n)&&n?n:t}catch(e){return Le.error("Error in get_current_url, falling back to window.location.href",e),t}}(t,i)}var $e=1,Ue=3,We=11;function ze(e){return!!e&&e.nodeType===$e}function Ve(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ze(e){return!!e&&e.nodeType===We&&ze(e.host)}var Qe=1e3;function Ge(e){return e?k(e).split(/\s+/):[]}function Ye(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Ge(t)}function Je(e){var t="";return it(e)&&!nt(e)&&e.childNodes&&e.childNodes.length&&Fe(e.childNodes,(function(e){var r;(function(e){return!!e&&e.nodeType===Ue})(e)&&e.textContent&&(t+=null!==(r=function(e){return L(e)?null:k(e).split(/(\s+)/).filter((e=>dt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),k(t)}var Ke=["a","button","form","input","select","textarea","label"];function Xe(e){var t=e.parentNode;return!(!t||!ze(t))&&t}var et=[".ph-no-deadclick",".ph-no-capture"];var tt=e=>!e||Ve(e,"html")||!ze(e),rt=(t,r)=>{if(!e||tt(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],a=t;a.parentNode&&!Ve(a,"body");)if(Ze(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var o=Xe(a);if(!o)break;if(Ke.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var s=e.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(i=!0)}catch(e){}n.push(o),a=o}return{parentIsUsefulElement:i,targetElementList:n}};function it(e){for(var t=new Set,r=0,i=e;i.parentNode&&!Ve(i,"body");i=i.parentNode){if(r++>=Qe||t.has(i))return!1;t.add(i);var n=Ye(i);if(w(n,"ph-sensitive")||w(n,"ph-no-capture"))return!1}if(w(Ye(e),"ph-include"))return!0;var a=e.type||"";if(E(a))switch(a.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!E(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function nt(e){return!!(Ve(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ve(e,"select")||Ve(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var at=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),ot=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,st=[16,15,14,13],ut=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),lt=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ht=/[0-9A-Za-z_]/;function ct(e){for(var t=0,r=!1,i=e.length-1;i>=0;i--){var n=e.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),t+=n,r=!r}return t%10==0}function dt(e,t){if(void 0===t&&(t=!0),L(e))return!1;if(E(e)){e=k(e);var r=t?at.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(ot.lastIndex=0;t=ot.exec(e);){var r=t[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var a of st){var o=n+a;if(i.length>=o){var s=i.slice(n,o);if(at.test(s)&&ct(s))return!0}}}return!1}(e);if(r)return!1;var i=t?ut.test(e):function(e){var t;for(lt.lastIndex=0;t=lt.exec(e);){var r=t[1],i=t[3];if(!(r&&i&&ht.test(r)&&ht.test(i)))return!0}return!1}(e);if(i)return!1}return!0}function vt(e){var t=Je(e);return dt(t=(t+" "+ft(e)).trim())?t:""}function ft(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Fe(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Je(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ft(e)).trim())}catch(e){Le.error("[AutoCapture]",e)}})),t}function pt(e){return e.replace(/"|\\"/g,'\\"')}function mt(e){var t=e.attr__class;if(t)return C(t)?t:Ge(t)}var gt="[SessionRecording]",yt="redacted",bt=1e6;function wt(e){var t;return Math.min(bt,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:bt)}var kt={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:bt,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},_t=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],St=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],xt=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Ct=e=>{L(e)||Fe(Object.keys(e),(t=>{(e=>{var t=e.toLowerCase();return _t.includes(t)||xt.some((e=>t.includes(e)))})(t)&&(e[t]=yt)}))},Mt=["/s/","/e/","/i/"];function Tt(e,t,r,i){if(L(e))return e;var n=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return E(n)&&(n=parseInt(n)),n>r?gt+" "+i+" body too large to record ("+n+" bytes)":e}function It(e,t){if(L(e))return e;var r=e;return dt(r,!1)||(r=gt+" "+t+" body "+yt),Fe(St,(e=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(e))&&(r=gt+" "+t+" body "+yt+" as might contain: "+e)})),r}var Et=new WeakSet,Rt="$session_recording_remote_config",At="$replay_sample_rate",Lt="$replay_override_sampling",Ot="$replay_override_linked_flag",Ft="$replay_override_url_trigger",Nt="$replay_override_event_trigger",Dt="$session_is_sampled",Pt="$session_past_minimum_duration",qt="$session_recording_url_trigger_activated_session",jt="$session_recording_event_trigger_activated_session",Bt="$posthog_sr_group_event_trigger_",Ht="$posthog_sr_group_url_trigger_",$t="$posthog_sr_group_sampling_",Ut="$debug_first_full_snapshot_timestamp",Wt="$sess_rec_flush_size",zt="$stored_person_properties",Vt="$sdk_debug_replay_pending_trigger_conditions",Zt="$sdk_debug_replay_remote_trigger_matching_config",Qt="disabled",Gt="sampled",Yt="active",Jt="buffering",Kt="paused",Xt="rrweb_error",er="trigger",tr=er+"_activated",rr=er+"_pending",ir=er+"_"+Qt;function nr(e,t,r,i,n,a){return 0===t?ir:(null==e?void 0:e.get_property(r?i+r:n))===a?tr:rr}function ar(e,t,r){return t.some((t=>{var i;return"regex"===t.matching&&(null!==(i=null==r?void 0:r.get(t.url))&&void 0!==i?i:new RegExp(t.url)).test(e)}))}function or(e){return e.includes(tr)?tr:e.includes(rr)?rr:ir}function sr(e){var t=new Set(e);switch(t.delete(ir),t.size){case 0:return ir;case 1:return Array.from(t)[0];default:return rr}}class ur{constructor(e){this.N=e}triggerStatus(e){return or(this.N.map((t=>t.triggerStatus(e))))}triggerStatusNoSideEffects(e){return or(this.N.map((t=>t.triggerStatusNoSideEffects(e))))}stop(){this.N.forEach((e=>e.stop()))}}class lr{constructor(e){this.N=e}triggerStatus(e){return sr(this.N.map((t=>t.triggerStatus(e))))}triggerStatusNoSideEffects(e){return sr(this.N.map((t=>t.triggerStatusNoSideEffects(e))))}stop(){this.N.forEach((e=>e.stop()))}}class hr{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return tr}stop(){}}var cr=e=>"sessionRecording"in e;class dr{constructor(e,t){this.P=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=e,this.$=t}onConfig(e){var t,r;this.P=(cr(e)?T(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.urlTriggers:[]:null==e?void 0:e.urlTriggers)||[],this.q=(cr(e)?T(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.urlBlocklist:[]:null==e?void 0:e.urlBlocklist)||[],this.U()}U(){for(var e of(this.j.clear(),this.B.clear(),this.P))if("regex"===e.matching&&!this.j.has(e.url))try{this.j.set(e.url,new RegExp(e.url))}catch(t){Le.error("Invalid URL trigger regex pattern:",e.url,t)}for(var t of this.q)if("regex"===t.matching&&!this.B.has(t.url))try{this.B.set(t.url,new RegExp(t.url))}catch(e){Le.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(e){this.onConfig(e)}W(e){return nr(this._instance,this.P.length,this.$,Ht,qt,e)}triggerStatus(e){var t=this.triggerStatusNoSideEffects(e);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:t}),t}triggerStatusNoSideEffects(e){return this.W(e)}checkUrlBlocklist(e,t){var r=He(this._instance);if(r&&r!==this.H){this.H=r;var i=this.urlBlocked,n=ar(r,this.q,this.B);i&&n||(n&&!i?e():!n&&i&&t())}}checkUrlTriggerConditions(e,t,r,i){var n=He(this._instance);if(n&&n!==this.H){this.H=n;var a=this.urlBlocked,o=ar(n,this.q,this.B);o&&!a?e():!o&&a&&t();var s=this.W(i)===tr,u=ar(n,this.P,this.j);!s&&u&&r("url",n)}}stop(){this.H=""}}class vr{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=e}triggerStatus(){var e=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}triggerStatusNoSideEffects(){var e=rr;return L(this.linkedFlag)&&(e=ir),this.linkedFlagSeen&&(e=tr),e}onConfig(e,t){var r;if(this.linkedFlag=(cr(e)?T(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.linkedFlag:null:null==e?void 0:e.linkedFlag)||null,!L(this.linkedFlag)&&!this.linkedFlagSeen){var i=E(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=E(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((e,r)=>{var a=!1;if(T(r)&&i in r){var o=r[i];a=F(o)?!0===o:n?o===n:!!o}var s=a&&!this.linkedFlagSeen;this.linkedFlagSeen=a,s&&t(i,n)}))}}onRemoteConfig(e,t){this.onConfig(e,t)}stop(){this.V()}}class fr{constructor(e,t){this.Z=[],this._instance=e,this.$=t}onConfig(e){var t;this.Z=(cr(e)?T(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.eventTriggers:[]:null==e?void 0:e.eventTriggers)||[]}onRemoteConfig(e){this.onConfig(e)}G(e){return nr(this._instance,this.Z.length,this.$,Bt,jt,e)}triggerStatus(e){var t=this.triggerStatusNoSideEffects(e);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:t}),t}triggerStatusNoSideEffects(e){return this.G(e)}checkEventTriggerConditions(e,t,r){if(0!==this.Z.length){var i=this.G(r)===tr,n=this.Z.includes(e);!i&&n&&t("event",e)}}stop(){}}class pr{constructor(e,t,r){if(this._instance=e,this.group=t,this.Y=new dr(e,t.id),this.J=new fr(e,t.id),this.K=new vr(e),t.conditions.events&&t.conditions.events.length>0||t.conditions.urls&&t.conditions.urls.length>0||t.conditions.flag){var i=(t.conditions.events||[]).map((e=>e.name)),n={urlTriggers:t.conditions.urls||[],eventTriggers:i,linkedFlag:t.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.J.onConfig(n),this.K.onConfig(n,r);var a=[this.J,this.Y,this.K];this.X="any"===t.conditions.matchType?new ur(a):new lr(a)}else this.X=new hr}triggerStatus(e){return this.X.triggerStatus(e)}triggerStatusNoSideEffects(e){return this.X.triggerStatusNoSideEffects(e)}getPendingTriggerConditions(e){return this.triggerStatusNoSideEffects(e)!==rr?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(e)},{label:"event condition not matched",status:this.J.triggerStatusNoSideEffects(e)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((e=>e.status===rr)).map((e=>e.label))}checkEventTriggerConditions(e,t,r){this.J.checkEventTriggerConditions(e,t,r)}checkUrlTriggerConditions(e,t,r,i){this.Y.checkUrlTriggerConditions(e,t,r,i)}activateTrigger(e,t){var r;null==(r=this._instance.persistence)||r.register({["url"===e?Ht+this.group.id:Bt+this.group.id]:t})}stop(){this.Y.stop(),this.J.stop(),this.K.stop()}}function mr(e){if(e.rrwebError)return Xt;if(!e.receivedFlags)return Jt;if(!e.isRecordingEnabled)return Qt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=!0===e.isSampled,r=new ur([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Gt:r===tr?Yt:r===rr?Jt:!1===e.isSampled?Qt:Yt}function gr(e){if(e.rrwebError)return Xt;if(!e.receivedFlags)return Jt;if(!e.isRecordingEnabled)return Qt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=new lr([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),r=t!==ir,i=F(e.isSampled);return r&&t===rr?Jt:r&&t===ir||i&&!e.isSampled?Qt:!0===e.isSampled?Gt:Yt}function yr(){var e=[];return function(t,r){if(T(r)||C(r)){for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(r)?"[Circular]":(e.push(r),r)}return r}}function br(e){var t=JSON.stringify(e,yr());return t?new Blob([t]).size:0}function wr(e){if(A(e))return 4;if(I(e))return 0;switch(typeof e){case"string":return e.length+2;case"number":return String(e).length;case"boolean":return e?4:5;case"object":if(C(e)){for(var t=2,r=0;e.length>r;r++){r>0&&(t+=1);var i=e[r];t+=I(i)||A(i)?4:wr(i)}return t}var n=e,a=2,o=!0;for(var s in n)if({}.hasOwnProperty.call(n,s)){var u=n[s];I(u)||(o||(a+=1),o=!1,a+=s.length+3+wr(u))}return a;default:return 0}}function kr(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var r=Math.floor(e.data.length/2),i=e.sizes.slice(0,r),n=e.sizes.slice(r);return[kr({size:i.reduce(((e,t)=>e+t),0),data:e.data.slice(0,r),sizes:i,sessionId:e.sessionId,windowId:e.windowId}),kr({size:n.reduce(((e,t)=>e+t),0),data:e.data.slice(r),sizes:n,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var _r=Uint8Array,Sr=Uint16Array,xr=Uint32Array,Cr=new _r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Mr=new _r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Tr=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ir=function(e,t){for(var r=new Sr(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new xr(r[30]);for(i=1;30>i;++i)for(var a=r[i];r[i+1]>a;++a)n[a]=a-r[i]<<5|i;return[r,n]},Er=Ir(Cr,2),Rr=Er[1];Er[0][28]=258,Rr[258]=28;for(var Ar=Ir(Mr,0)[1],Lr=new Sr(32768),Or=0;32768>Or;++Or){var Fr=(43690&Or)>>>1|(21845&Or)<<1;Lr[Or]=((65280&(Fr=(61680&(Fr=(52428&Fr)>>>2|(13107&Fr)<<2))>>>4|(3855&Fr)<<4))>>>8|(255&Fr)<<8)>>>1}var Nr=function(e,t,r){for(var i=e.length,n=0,a=new Sr(t);i>n;++n)++a[e[n]-1];var o,s=new Sr(t);for(n=0;t>n;++n)s[n]=s[n-1]+a[n-1]<<1;if(r){o=new Sr(1<<t);var u=15-t;for(n=0;i>n;++n)if(e[n])for(var l=n<<4|e[n],h=t-e[n],c=s[e[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Lr[c]>>>u]=l}else for(o=new Sr(i),n=0;i>n;++n)o[n]=Lr[s[e[n]-1]++]>>>15-e[n];return o},Dr=new _r(288);for(Or=0;144>Or;++Or)Dr[Or]=8;for(Or=144;256>Or;++Or)Dr[Or]=9;for(Or=256;280>Or;++Or)Dr[Or]=7;for(Or=280;288>Or;++Or)Dr[Or]=8;var Pr=new _r(32);for(Or=0;32>Or;++Or)Pr[Or]=5;var qr=Nr(Dr,9,0),jr=Nr(Pr,5,0),Br=function(e){return(e/8>>0)+(7&e&&1)},Hr=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Sr?Sr:e instanceof xr?xr:_r)(r-t);return i.set(e.subarray(t,r)),i},$r=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},Ur=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},Wr=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,a=r.slice();if(!n)return[new _r(0),0];if(1==n){var o=new _r(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=n-1;)s=r[r[c].f>r[l].f?l++:c++],u=r[l!=h&&r[c].f>r[l].f?l++:c++],r[h++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(i=1;n>i;++i)a[i].s>d&&(d=a[i].s);var v=new Sr(d+1),f=zr(r[h-1],v,0);if(f>t){i=0;var p=0,m=f-t,g=1<<m;for(a.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=a[i].s;if(t>=v[y])break;p+=g-(1<<f-v[y]),v[y]=t}for(p>>>=m;p>0;){var b=a[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var w=a[i].s;v[w]==t&&(--v[w],++p)}f=t}return[new _r(v),f]},zr=function(e,t,r){return-1==e.s?Math.max(zr(e.l,t,r+1),zr(e.r,t,r+1)):t[e.s]=r},Vr=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Sr(++t),i=0,n=e[0],a=1,o=function(e){r[i++]=e},s=1;t>=s;++s)if(e[s]==n&&s!=t)++a;else{if(!n&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(n),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(n);a=1,n=e[s]}return[r.subarray(0,i),t]},Zr=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},Qr=function(e,t,r){var i=r.length,n=Br(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var a=0;i>a;++a)e[n+a+4]=r[a];return 8*(n+4+i)},Gr=function(e,t,r,i,n,a,o,s,u,l,h){$r(t,h++,r),++n[256];for(var c=Wr(n,15),d=c[0],v=c[1],f=Wr(a,15),p=f[0],m=f[1],g=Vr(d),y=g[0],b=g[1],w=Vr(p),k=w[0],_=w[1],S=new Sr(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;k.length>x;++x)S[31&k[x]]++;for(var C=Wr(S,7),M=C[0],T=C[1],I=19;I>4&&!M[Tr[I-1]];--I);var E,R,A,L,O=l+5<<3,F=Zr(n,Dr)+Zr(a,Pr)+o,N=Zr(n,d)+Zr(a,p)+o+14+3*I+Zr(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(F>=O&&N>=O)return Qr(t,h,e.subarray(u,u+l));if($r(t,h,1+(F>N)),h+=2,F>N){E=Nr(d,v,0),R=d,A=Nr(p,m,0),L=p;var D=Nr(M,T,0);for($r(t,h,b-257),$r(t,h+5,_-1),$r(t,h+10,I-4),h+=14,x=0;I>x;++x)$r(t,h+3*x,M[Tr[x]]);h+=3*I;for(var P=[y,k],q=0;2>q;++q){var j=P[q];for(x=0;j.length>x;++x)$r(t,h,D[B=31&j[x]]),h+=M[B],B>15&&($r(t,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=qr,R=Dr,A=jr,L=Pr;for(x=0;s>x;++x)if(i[x]>255){var B;Ur(t,h,E[257+(B=i[x]>>>18&31)]),h+=R[B+257],B>7&&($r(t,h,i[x]>>>23&31),h+=Cr[B]);var H=31&i[x];Ur(t,h,A[H]),h+=L[H],H>3&&(Ur(t,h,i[x]>>>5&8191),h+=Mr[H])}else Ur(t,h,E[i[x]]),h+=R[i[x]];return Ur(t,h,E[256]),h+R[256]},Yr=new xr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jr=function(){for(var e=new xr(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Kr=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Jr[255&r^t[i]]^r>>>8;e=r},d:()=>4294967295^e}},Xr=function(e,t,r,i,n){return function(e,t,r,i,n,a){var o=e.length,s=new _r(i+o+5*(1+Math.floor(o/7e3))+n),u=s.subarray(i,s.length-n),l=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?l=Qr(u,l,e.subarray(h,c)):(u[h]=true,l=Qr(u,l,e.subarray(h,o)))}else{for(var d=Yr[t-1],v=d>>>13,f=8191&d,p=(1<<r)-1,m=new Sr(32768),g=new Sr(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},k=new xr(25e3),_=new Sr(288),S=new Sr(32),x=0,C=0,M=(h=0,0),T=0,I=0;o>h;++h){var E=w(h),R=32767&h,A=g[E];if(m[R]=A,g[E]=R,h>=T){var L=o-h;if((x>7e3||M>24576)&&L>423){l=Gr(e,u,0,k,_,S,C,M,I,h-I,l),M=x=C=0,I=h;for(var O=0;286>O;++O)_[O]=0;for(O=0;30>O;++O)S[O]=0}var F=2,N=0,D=f,P=R-A&32767;if(L>2&&E==w(h-P))for(var q=Math.min(v,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=P&&--D&&R!=A;){if(e[h+F]==e[h+F-P]){for(var H=0;B>H&&e[h+H]==e[h+H-P];++H);if(H>F){if(F=H,N=P,H>q)break;var U=Math.min(P,H-2),W=0;for(O=0;U>O;++O){var z=h-P+O+32768&32767,V=z-m[z]+32768&32767;V>W&&(W=V,A=z)}}}P+=(R=A)-(A=m[R])+32768&32767}if(N){k[M++]=268435456|Rr[F]<<18|Ar[N];var Z=31&Rr[F],Q=31&Ar[N];C+=Cr[Z]+Mr[Q],++_[257+Z],++S[Q],T=h+F,++x}else k[M++]=e[h],++_[e[h]]}}l=Gr(e,u,true,k,_,S,C,M,I,h-I,l)}return Hr(s,0,i+Br(l)+n)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i)},ei=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},ti=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&ei(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}},ri=function(e){return 10+(e.filename&&e.filename.length+1||0)};function ii(e,t){for(var r="",i=0;e.length>i;){var n=e[i++];r+=String.fromCharCode(n)}return r}class ni{constructor(e,t){var r,i;void 0===t&&(t={}),this.ee={},this.te=e=>{if(!this.ee[e]){var t,r;this.ee[e]=!0;var i=this.re(e);null==(t=(r=this.ie).onBlockedNode)||t.call(r,e,i)}},this.ne=e=>{var t=this.re(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var r=t.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[e,t]},this.re=e=>this._rrweb.mirror.getNode(e),this.ae=e=>{var t,r,i,n,a,o,s,u;return(null!==(t=null==(r=e.removes)?void 0:r.length)&&void 0!==t?t:0)+(null!==(i=null==(n=e.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(a=null==(o=e.texts)?void 0:o.length)&&void 0!==a?a:0)+(null!==(s=null==(u=e.adds)?void 0:u.length)&&void 0!==s?s:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,r=this.ae(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t=this.ne(e.id);return!this.oe.consumeRateLimit(t[0])&&e})));var i=this.ae(t);return 0!==i||r===i?e:void 0},this._rrweb=e,this.ie=t,this.oe=new U({bucketSize:null!==(r=this.ie.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.ie.refillRate)&&void 0!==i?i:10,refillInterval:1e3,S:this.te,I:Le})}reset(){this.ee={}}stop(){this.oe.stop(),this.reset()}}Re.DEBUG=!1,Re.LIB_VERSION="1.419.0",Re.LIB_NAME="web";class ai{constructor(e){if(!e.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.se=e.get_property.bind(e),this.ue=e.persistence.set_property.bind(e.persistence)}trackSize(e,t){this.ue(Wt,{sessionId:e,size:this.currentTrackedSize(e)+t})}currentTrackedSize(e){var t,r=this.se(Wt);return T(t=r)&&E(t.sessionId)&&O(t.size)&&r.sessionId===e?r.size:0}}function oi(e,t){return function(e){for(var t=0,r=0;e.length>r;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(e)%100<H(100*t,0,100,Le)}function si(e){return"$survey_response_"+e}function ui(e,t){if(!t)return null;var r=e[si(t)];return C(r)?[...r]:r}function li(e,t){void 0===e&&(e={});var r={};return t.questions.forEach((t=>{if(!I(t.originalQuestionIndex)){var i,n=0===(i=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,a=ui(e,t.id);I(a)||(r[n]=a)}})),h({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:ui(e,t.id)})))},e,r)}function hi(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function ci(e){return"string"==typeof e&&e.trim()?e.trim():null}function di(e){return e.toLowerCase()}function vi(e,t,r){if(!e||!t)return null;var i=di(t),n=Object.keys(e).find((e=>di(e)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var a=i.split("-")[0],o=Object.keys(e).find((e=>di(e)===a));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}var fi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function pi(e,t,r){var i,n=vi(e.translations,t,r),a=h({},e),o=!1;if(n){var s,u=null==(s=e.translations)?void 0:s[n];if(u)if(null==r||r.info("Applying survey-level translation for language: "+n),I(u.name)||(a.name=u.name,o=!0),a.appearance){var l=h({},a.appearance);for(var c of fi){var d=u[c];I(d)||(l[c]=d,o=!0)}a.appearance=l}else(function(e){return fi.some((t=>!I(e[t])))})(u)&&(o=!0)}var v=e.questions.map((e=>function(e,t,r){var i,n=vi(e.translations,t,r);if(!n)return{question:e,matchedKey:null,hasChanges:!1};var a=null==(i=e.translations)?void 0:i[n];if(!a)return{question:e,matchedKey:null,hasChanges:!1};var o=h({},e),s=!1;return I(a.question)||(o.question=a.question,s=!0),I(a.description)||(o.description=a.description,s=!0),I(a.buttonText)||(o.buttonText=a.buttonText,s=!0),"link"in o&&!I(a.link)&&(o.link=a.link,s=!0),"lowerBoundLabel"in o&&!I(a.lowerBoundLabel)&&(o.lowerBoundLabel=a.lowerBoundLabel,s=!0),"upperBoundLabel"in o&&!I(a.upperBoundLabel)&&(o.upperBoundLabel=a.upperBoundLabel,s=!0),"choices"in o&&function(e){return C(e.choices)}(a)&&(o.choices=a.choices,s=!0),{question:s?o:e,matchedKey:s?n:null,hasChanges:s}}(e,t,r))),f=v.map((e=>e.question)),p=v.some((e=>e.hasChanges)),m=null;return n||(m=(null==(i=v.find((e=>e.matchedKey)))?void 0:i.matchedKey)||null),p&&(a.questions=f,o=!0,null==r||r.info("Applied question-level translations for language: "+t)),{survey:a,matchedKey:o?n||m:null}}function mi(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var gi=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},yi=e=>e.toLowerCase(),bi={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>gi(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!gi(t,e))))),icontains:(e,t)=>t.map(yi).some((t=>e.map(yi).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(yi).every((t=>e.map(yi).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},wi=new Set(["is_not","not_icontains","not_regex"]);function ki(e,t,r){return!e||0===e.length||e.every((e=>{var i="person"===e.type?r:t,n=null==i?void 0:i[e.key],a=e.operator||"exact";if(I(n)||A(n))return wi.has(a);var o=bi[a];return!!o&&!I(e.value)&&!A(e.value)&&o(C(e.value)?e.value.map(String):[String(e.value)],C(n)?n.map(String):[String(n)])}))}var _i=Oe("[SessionRecording]");function Si(e,t){return t?e:"!"+e}function xi(e,t){return e===t||e!=="!"+t&&null}class Ci{constructor(e,t,r,i,n,a,o){this.le=null,this.he=gr,this._instance=e,this.Y=t,this.J=r,this.K=i,this.ce=n,this.de=a,this.ve=o}onRemoteConfig(e){this.le=O(e.sampleRate)?e.sampleRate:null,"any"===e.triggerMatchType?(this.fe=new ur([this.J,this.Y]),this.he=mr):(this.fe=new lr([this.J,this.Y]),this.he=gr),this._instance.register_for_session({[Zt]:e.triggerMatchType}),this.Y.onConfig(e),this.J.onConfig(e),this.K.onConfig(e,((e,t)=>{this.ce("linked_flag_matched",{flag:e,variant:t}),this.ve()}))}getStatus(e){return this.he({receivedFlags:!0,isRecordingEnabled:!0,isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId})}getMinimumDuration(e){var t=this._instance.get_property("$session_recording_remote_config"),r=null==t?void 0:t.minimumDurationMilliseconds;return O(r)?r:null}checkUrlTriggers(e,t,r,i){this.Y.checkUrlTriggerConditions(t,r,i,e)}setupEventTriggerListeners(e,t,r){if(0!==this.J.Z.length&&L(this.pe))return this.pe=e((e=>{try{this.J.checkEventTriggerConditions(e.event,r,t)}catch(e){_i.error("Could not activate event trigger",e)}})),this.pe}makeSamplingDecisions(e){var t,r,i,n=this.le;if(!O(n))return null==(r=this._instance.persistence)||r.unregister(Dt),void(null==(i=this._instance.persistence)||i.unregister(At));var a=this._instance.get_property(Dt),o=this._instance.get_property(At),s=xi(a,e),u=O(o)&&o!==n,l=I(o)&&a===e,h=u||l||!F(s),c=h?oi(e,n):s;h&&(c?this.ce("sampled"):_i.warn("Sample rate ("+n+") has determined that this sessionId ("+e+") will not be sent to the server.")),null==(t=this._instance.persistence)||t.register({[Dt]:Si(e,c),[At]:A(o)&&a===e?null:n})}ensureSamplingDecision(e){if(O(this.le)){var t=this._instance.get_property(Dt);F(xi(t,e))||this.makeSamplingDecisions(e)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var e,t,r,i,n;null==(e=this._instance.persistence)||e.unregister(jt),null==(t=this._instance.persistence)||t.unregister(qt),null==(r=this._instance.persistence)||r.unregister(Dt),null==(i=this._instance.persistence)||i.unregister(At),null==(n=this._instance.persistence)||n.unregister(Pt)}updateActiveTriggers(e){}hasPendingTriggers(e){var t;return(null==(t=this.fe)?void 0:t.triggerStatus(e))===rr}getPendingTriggerConditions(e){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(e)},{label:"event condition not matched",status:this.J.triggerStatusNoSideEffects(e)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((e=>e.status===rr)).map((e=>e.label))}stop(){var e;null==(e=this.pe)||e.call(this),this.pe=void 0,this.J.stop(),this.Y.stop(),this.K.stop()}}class Mi{constructor(e,t,r,i,n){this.me=[],this.ge=new Map,this.ye=!1,this._instance=e,this.Y=t,this.ce=r,this.be=i,this.ve=n}onRemoteConfig(e){e.triggerGroups&&0!==e.triggerGroups.length?(this.we(e.triggerGroups),this._instance.register_for_session({[Zt]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:e.triggerGroups.length}),this.Y.onConfig(e)):_i.warn("[V2Strategy] No trigger groups configured")}getStatus(e){return function(e){if(e.rrwebError)return Xt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=e.triggerGroupMatchers,r=e.triggerGroupSamplingResults;if(0===t.length)return Qt;var i=!1,n=!1;for(var a of t){var o=a.triggerStatus(e.sessionId);if(o===tr){var s=a.group.id,u=r.get(s);I(u)?Le.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:s}):!0===u&&(n=!0)}else o===rr&&(i=!0)}return n?Gt:i?Jt:Qt}({isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId,triggerGroupMatchers:this.me,triggerGroupSamplingResults:this.ge,minimumDuration:this.getMinimumDuration(e.sessionId)})}getMinimumDuration(e){var t=null;for(var r of this.me)if("trigger_activated"===r.triggerStatus(e)){var i=r.group.minDurationMs;O(i)&&(A(t)||t>i)&&(t=i)}return t}checkUrlTriggers(e,t,r,i){var n=this;this.Y.checkUrlBlocklist(t,r);var a=function(i){i.checkUrlTriggerConditions(t,r,(t=>{n.ke(i,void 0)&&(i.activateTrigger(t,e),n.updateActiveTriggers(e),n.ve(t))}),e)};for(var o of this.me)a(o)}setupEventTriggerListeners(e,t,r){var i=this;return this.pe=e((e=>{var r;if(this.ye)return _i.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.pe)||r.call(this),void(this.pe=void 0);try{var n=function(r){r.checkEventTriggerConditions(e.event,(n=>{if(i.ke(r,e.properties)){var a=(r.group.conditions.events||[]).filter((t=>t.name===e.event)),o=i._instance.get_property(zt),s=a.some((t=>!t.properties||0===t.properties.length||ki(t.properties,e.properties,o)));s&&(r.activateTrigger(n,t),i.updateActiveTriggers(t),i.ve(n))}}),t)};for(var a of this.me)n(a)}catch(e){_i.error("Could not activate event trigger for trigger groups",e)}})),this.pe}makeSamplingDecisions(e){for(var t of this.me){var r,i=t.group,n=i.id,a=i.sampleRate,o=$t+n,s=this._instance.get_property(o),u=null,l=!1,h=!1,c=!1;if(T(s)){var d=s.sessionId,v=s.sampleRate,f=s.sampled;l="string"==typeof d&&d!==e,h=O(v)&&v!==a,u=d===e&&O(v)&&v===a&&F(f)?f:null}else u=s===e||null,l="string"==typeof s&&s!==e,c=s===e;var p=l||h||c||!F(u),m=p?oi(e+n,a):u;p&&this.be("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:a,isSampled:m}),this.ge.set(n,m),null==(r=this._instance.persistence)||r.register({[o]:{sessionId:e,sampleRate:a,sampled:m}})}this.updateActiveTriggers(e)}ensureSamplingDecision(e){}onFlushComplete(){this.ye=!0}clearConditionalRecordingPersistence(){var e,t,r;for(var i of(null==(e=this._instance.persistence)||e.unregister(Dt),null==(t=this._instance.persistence)||t.unregister(At),null==(r=this._instance.persistence)||r.unregister(Pt),this.me)){var n,a,o,s=i.group.id;null==(n=this._instance.persistence)||n.unregister(Bt+s),null==(a=this._instance.persistence)||a.unregister(Ht+s),null==(o=this._instance.persistence)||o.unregister($t+s)}}updateActiveTriggers(e){var t=[];for(var r of this.me){var i=r.group,n=i.id,a="trigger_activated"===r.triggerStatus(e),o=!0===this.ge.get(n);a&&t.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:t})}hasPendingTriggers(e){for(var t of this.me)if(t.triggerStatus(e)===rr)return!0;return!1}getPendingTriggerConditions(e){return this.me.flatMap((t=>t.triggerStatusNoSideEffects(e)!==rr?[]:t.getPendingTriggerConditions(e).map((e=>'trigger group "'+t.group.name+'": '+e))))}stop(){var e;null==(e=this.pe)||e.call(this),this.pe=void 0,this.me.forEach((e=>e.stop())),this.me=[],this.ge.clear(),this.Y.stop()}ke(e,t){var r=e.group.conditions.properties;return!r||0===r.length||ki(r,t,this._instance.get_property(zt))}we(e){var t=this;this.me.forEach((e=>e.stop())),this.me=[],this.ge.clear();var r=function(e){var r=new pr(t._instance,e,((r,i)=>{t.ce("linked_flag_matched",{flag:r,variant:i,group_id:e.id,group_name:e.name}),t.ve()}));t.me.push(r)};for(var i of e)r(i)}}var Ti=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"];function Ii(e){return I(e)?void 0:Math.round(e)}function Ei(e){return T(e)?e.network_timing:e}var Ri,Ai,Li=943718.4,Oi="[SessionRecording]",Fi=Oe(Oi),Ni=[v.MouseMove,v.MouseInteraction,v.Scroll,v.ViewportResize,v.Input,v.TouchMove,v.MediaInteraction,v.Drag],Di=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Pi(){var e;return null==s||null==(e=s.__PosthogExtensions__)?void 0:e.rrweb}function qi(){var e;return null==(e=Pi())?void 0:e.record}function ji(e){try{return JSON.stringify(e)}catch(t){return JSON.stringify(e,yr())}}function Bi(e){return ii(function(e,t){void 0===t&&(t={});var r=Kr(),i=e.length;r.p(e);var n=Xr(e,t,ri(t),8),a=n.length;return ti(n,t),ei(n,a-8,r.d()),ei(n,a-4,i),n}(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new _r(e.length+(e.length>>>1)),n=0,a=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var s=new _r(n+8+(r-o<<1));s.set(i),i=s}var u=e.charCodeAt(o);128>u?a(u):2048>u?(a(192|u>>>6),a(128|63&u)):u>55295&&57344>u?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return Hr(i,0,n)}(ji(e))))}function Hi(e){return $i.apply(this,arguments)}function $i(){return $i=l((function*(e){var t=ji(e),r=yield function(e,t,r){return b.apply(this,arguments)}(t,Re.DEBUG,{rethrow:!0});return ii(new Uint8Array(yield r.arrayBuffer()))})),$i.apply(this,arguments)}var Ui="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Wi=!1;function zi(e){return C(e)&&0===e.length?Ri=null!=Ri?Ri:Bi([]):Bi(e)}function Vi(e){return Zi.apply(this,arguments)}function Zi(){return(Zi=l((function*(e){return C(e)&&0===e.length?Ri||(Ai=null!=Ai?Ai:Hi([]).then((e=>(Ri=e,e))).catch((e=>{throw Ri=void 0,Ai=void 0,e}))):Hi(e)}))).apply(this,arguments)}function Qi(e){return Ui&&!Wi&&function(e){return e.type===d.FullSnapshot||e.type===d.IncrementalSnapshot&&(e.data.source===v.Mutation||e.data.source===v.StyleSheetRule)}(e)}function Gi(e){return{event:e,size:wr(e)}}function Yi(e,t){return h({},e,{data:t,cv:"2024-10"})}function Ji(e,t){return h({},e,{cv:"2024-10",data:h({},e.data,t)})}function Ki(e){try{if(e.type===d.FullSnapshot)return Gi(Yi(e,Bi(e.data)));if(e.type===d.IncrementalSnapshot&&e.data.source===v.Mutation)return Gi(Ji(e,{texts:zi(e.data.texts),attributes:zi(e.data.attributes),removes:zi(e.data.removes),adds:zi(e.data.adds)}));if(e.type===d.IncrementalSnapshot&&e.data.source===v.StyleSheetRule)return Gi(Ji(e,{adds:e.data.adds?Bi(e.data.adds):void 0,removes:e.data.removes?Bi(e.data.removes):void 0}))}catch(e){Fi.error("could not compress event - will use uncompressed event",e)}return{event:e,size:br(e)}}function Xi(){return Xi=l((function*(e){try{if(e.type===d.FullSnapshot)return Gi(Yi(e,yield Hi(e.data)));if(e.type===d.IncrementalSnapshot&&e.data.source===v.Mutation){var t=yield Promise.all([Vi(e.data.texts),Vi(e.data.attributes),Vi(e.data.removes),Vi(e.data.adds)]);return Gi(Ji(e,{texts:t[0],attributes:t[1],removes:t[2],adds:t[3]}))}if(e.type===d.IncrementalSnapshot&&e.data.source===v.StyleSheetRule){var r=yield Promise.all([e.data.adds?Hi(e.data.adds):void 0,e.data.removes?Hi(e.data.removes):void 0]);return Gi(Ji(e,{adds:r[0],removes:r[1]}))}}catch(t){return(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return(e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""))(e)||t===m})(t)&&(Wi=!0),Fi.error("could not compress event asynchronously - trying synchronous compression",t),Ki(e)}return{event:e,size:br(e)}})),Xi.apply(this,arguments)}function en(e,t){return e.type===d.Custom&&e.data.tag===t}function tn(e){return en(e,"sessionIdle")}function rn(e){return en(e,"$session_ending")}function nn(e){return en(e,"$session_starting")}class an{get sessionId(){return this._e}get Se(){if(!this._instance.sessionManager)throw new Error(Oi+" must be started with a valid sessionManager.");return this._instance.sessionManager}get xe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ce(){return xi(this._instance.get_property(Dt),this.sessionId)}get le(){var e,t=null==(e=this.Me)?void 0:e.sampleRate;return O(t)?t:null}get Te(){var e,t;return null!==(e=null==(t=this.Ie)?void 0:t.getMinimumDuration(this.sessionId))&&void 0!==e?e:null}constructor(e,t){this.Ee="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Re=void 0,this.Ae=Date.now(),this.Le=!1,this.Oe=[],this.Fe="unknown",this.Ne=0,this.De=!1,this.Pe=!1,this.qe=!1,this.je=!1,this.Be=!1,this.He=!1,this.$e=!1,this.Ue=!1,this.We=!1,this.ze=!1,this.Ve=!1,this.Ze=!1,this.Qe=[],this.Ge=void 0,this.Ye=void 0,this.Je=[],this.Ke=0,this.Xe=0,this.et=!1,this.tt=void 0,this.pe=void 0,this.rt=void 0,this.it=void 0,this.nt=void 0,this.ot=(e,t,r)=>{var i,n,a;if(r&&(e!==this._e||t!==this.st)){var o,s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this._e,l=this.st;if(s&&this.be("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this.Ae,flushed_size:null==(o=this.ut)?void 0:o.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(Ut),this.$e=!1,null==(n=Pi())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.be("$session_id_change",{sessionId:e,windowId:t,changeReason:r}),this.ht(),!(!1===this.Fe&&this.isStarted||this._e===e&&this.st===t)){var h=this._e!==e&&!1!==this.Fe;this.Fe="unknown",this.ct(h)}s&&this.be("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this.Ae}),null==(a=this.Ie)||a.makeSamplingDecisions(e)}},this.dt=()=>{var e;return(null==(e=this._instance.persistence)?void 0:e.props[Pt])===this._e},this.vt=()=>{var e,t;if(0===this.ft.data.length)return null;var r=null==(e=this.ft.data[0])?void 0:e.timestamp,i=null==(t=this.ft.data[this.ft.data.length-1])?void 0:t.timestamp;return O(r)&&O(i)?i-r:null},this.yt=()=>{var e,t,r=this.Te;if(!O(r))return!1;if(null===(e=null==(t=this._instance.config.session_recording)?void 0:t.strictMinimumDuration)||void 0===e||!e){var i=this.bt;return O(i)&&i>=0&&r>i}if(this.dt())return!1;var n,a=this.vt();return!!A(a)||r>a||(null==(n=this._instance.persistence)||n.register({[Pt]:this._e}),!1)},this.wt=()=>{this.status!==Jt?(this.De&&this.Pe&&this.kt&&!this.qe&&(this.De=!1),this._t(),this.St()):this.xt()},this.Ct=()=>{this.wt()},this.Mt=()=>{this.be("browser offline",{})},this.Tt=()=>{this.be("browser online",{})},this.It=()=>{null!=i&&i.visibilityState&&("visible"===i.visibilityState&&(this.kt=!0),this.be("window "+i.visibilityState,{}))},this._instance=e,this.kt=null==t||t;var r=this.Se.checkAndGetSessionAndWindowId(),n=r.windowId;this._e=r.sessionId,this.st=n,this.K=new vr(this._instance),this.Y=new dr(this._instance),this.J=new fr(this._instance),this.ft=this.xt(),this.Se.sessionTimeoutMs>this.xe||Fi.warn("session_idle_threshold_ms ("+this.xe+") is greater than the session timeout ("+this.Se.sessionTimeoutMs+"). Session will never be detected as idle"),this.ut=new ai(this._instance)}setDocumentWasEverVisible(e){e&&(this.kt=!0)}get Et(){var e,t,r,i,n,a,o,s,u,l=null==(e=this.Me)?void 0:e.masking,h={maskAllInputs:null==(t=this._instance.config.session_recording)?void 0:t.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},c=null!==(a=null==h?void 0:h.maskAllInputs)&&void 0!==a?a:null==l?void 0:l.maskAllInputs,d=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==l?void 0:l.maskTextSelector,v=null!==(s=null==h?void 0:h.blockSelector)&&void 0!==s?s:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return I(c)&&I(d)&&I(v)&&I(f)?void 0:{maskAllInputs:null==c||c,maskTextSelector:d,blockSelector:v,maskAllElementAttributes:f}}Rt(){var e;if(!this.We){var t=null==(e=this.Me)?void 0:e.masking;if(!L(t)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((e=>{var i=null==r?void 0:r[e],n=t[e];return!I(i)&&i!==n}));0!==i.length&&(this.We=!0,Fi.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:t}))}}}get At(){var e;return H(null==(e=this._instance.config.session_recording.canvasCapture)?void 0:e.resolutionScale,.1,1,Oe("canvas recording resolution scale"),1)}get Lt(){var e,t,r,i,n,a,o,s=this._instance.config.session_recording.captureCanvas,u=null==(e=this.Me)?void 0:e.canvasRecording,l=null!==(t=null!==(r=null==s?void 0:s.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==t&&t,h=null!==(i=null!==(n=null==s?void 0:s.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,c=null!==(a=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==u?void 0:u.quality)&&void 0!==a?a:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:l,fps:H(h,0,12,Oe("canvas recording fps"),4),quality:H(c,0,1,Oe("canvas recording quality"),.4)}}get Ot(){var e,t=!(null==(e=this.Me)||!e.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:t}get Ft(){var e,t,r,i=null==(e=this.Me)?void 0:e.networkPayloadCapture,n={recordHeaders:null==(t=this._instance.config.session_recording)?void 0:t.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},a=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),s=Ei(this._instance.config.capture_performance),u=Ei(null==i?void 0:i.capturePerformance),l=!!(F(s)?s:u);return a||o||l?{recordHeaders:a,recordBody:o,recordPerformance:l}:void 0}Nt(){var e,t,r=[],i=null==(e=s.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;i&&this.Ot&&r.push(i());var a=null==(t=s.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;if(this.Ft&&M(a))if(!qe.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var o=M(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(a(((e,t,r)=>{var i,n={payloadSizeLimitBytes:kt.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...kt.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...kt.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,u=(i=wt(n),e=>(null!=e&&e.requestBody&&(e.requestBody=Tt(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Tt(e.responseBody,e.responseHeaders,i,"Response")),e)),l=t=>{return u(((e,t,r)=>{var i;if(null==r||!r(e.name)){var n=je(e.name),a=0===t.indexOf("http")?null==(i=je(t))?void 0:i.pathname:t;"/"===a&&(a="");var o=null==n?void 0:n.pathname.replace(a||"","");if(!(n&&o&&Mt.some((e=>0===o.indexOf(e)))))return e}})((Ct((i=t).requestHeaders),Ct(i.responseHeaders),i),e.api_host,r));var i},c=M(e.session_recording.maskNetworkRequestFn);return c&&M(e.session_recording.maskCapturedNetworkRequestFn)&&Le.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var r=e.session_recording.maskNetworkRequestFn({url:t.name});return!r&&t.isInitial?r:h({},t,{name:null==r?void 0:r.url})}),n.maskRequestFn=M(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var r=l(t);if(r){var i=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,n=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(r);return L(n)&&i?(Et.add(i),i):null!=n?n:void 0}}:e=>function(e){if(!I(e))return e.requestBody=It(e.requestBody,"Request"),e.responseBody=It(e.responseBody,"Response"),e}(l(e)),h({},kt,n,{recordHeaders:a,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===e.session_recording.streamNetworkBody})})(this._instance.config,this.Ft,o)))}else Fi.info("NetworkCapture not started because we are on localhost.");return r}Dt(e){return this._instance.config.disable_capture_url_hashes?ve(e):e}Pt(e,t){void 0===t&&(t=!1);var r=t?ve(e):this.Dt(e),i=this._instance.config.mask_personal_data_properties?[...Ti,...this._instance.config.custom_personal_data_properties||[]]:[];return this.qt(function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],a=(i[0]||"").split("?"),o=a[1],s=a[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var c=u[h].split("=");C(c)&&(t.includes(c[0])?l.push(c[0]+"=<masked>"):l.push(u[h]))}var d=s;return null!=o&&(d+="?"+l.join("&")),null!=n&&(d+="#"+n),d}(r,i))}qt(e){var t=this._instance.config.session_recording;if(t.maskCapturedNetworkRequestFn){var r,i=t.maskCapturedNetworkRequestFn({name:e});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(t.maskNetworkRequestFn){var n=t.maskNetworkRequestFn({url:e});return null==n?void 0:n.url}return e}jt(e){try{return e.rrwebMethod(),!0}catch(t){return 10>this.Oe.length?this.Oe.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt+1,rrwebMethod:e.rrwebMethod}):Fi.warn("could not emit queued rrweb event.",t,e),!1}}be(e,t){return this.jt(Di((()=>qi().addCustomEvent(e,t))))}Bt(){try{if(this._instance.config.capture_pageview||!e)return;var t=new URL(e.location.href),r=this.Pt(t.origin+t.pathname+t.search);this.Ht!==r&&(this.Ht=r,this.be("$url_changed",{href:r}))}catch(e){}}$t(){if(this.Oe.length){var e=[...this.Oe];this.Oe=[],e.forEach((e=>{Date.now()-e.enqueuedAt>2e3||this.jt(e)}))}}de(){return this.jt(Di((()=>qi().takeFullSnapshot())))}get Ut(){var e,t,r;if(null!=(e=this.Ie)&&e.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return O(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(t=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==t?t:3e5}Wt(){if(this.zt&&clearInterval(this.zt),!0!==this.Fe){var e=this.Ut;e&&(this.zt=setInterval((()=>{this.de()}),e))}}ve(e){"event"===e&&this.Vt(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Wt()}Zt(){this.Y.urlBlocked||(this.Y.urlBlocked=!0,clearInterval(this.zt),Fi.info("recording paused due to URL blocker"),this.be("recording paused",{reason:"url blocker"}))}Qt(){this.Y.urlBlocked&&(this.Y.urlBlocked=!1,this.de(),this.Wt(),this.be("recording resumed",{reason:"left blocked url"}),Fi.info("recording resumed"))}Gt(e,t){var r;if("event"===e&&this.Vt(),!this.Le&&null!=(r=this.Ie)&&r.hasPendingTriggers(this.sessionId)){this.Le=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===e?qt:jt]:this.sessionId}),null==(n=this.Ie)||n.updateActiveTriggers(this.sessionId),this.ve(),this.St(),this.ce(e+"_trigger_matched",{["url"===e?"matchedUrl":"matchedEvent"]:t})}finally{this.Le=!1}}}get isStarted(){return!!this.Re}get Me(){var e=this._instance.get_property(Rt);if(e){var t;try{t=T(e)?e:JSON.parse(e)}catch(e){return void Fi.warn("persisted remote config for session recording is invalid and will be ignored",e)}if(!this.isStarted){var r,i,n=null!==(r=t.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Fi.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:e}),void(null==(i=this._instance.persistence)||i.unregister(Rt))}return t}}Yt(e,t,r){this._instance.get_property(e)&&(t(),r())}start(t){var r,n,a=this.Me;if(a){this.isStarted||(this.De=!1!==this.Fe&&!this.je,this.je=!1,this.Pe=this.De,this.qe=!1),this.et&&(this.Jt(),this.xt());var o=this.Se.checkAndGetSessionAndWindowId(),s=o.windowId;this._e=o.sessionId,this.st=s,null==(r=this._instance.persistence)||r.unregister(Ut),null!=a&&a.endpoint&&(this.Ee=null==a?void 0:a.endpoint),this.Ie=2===(null==a?void 0:a.version)&&(null==a?void 0:a.triggerGroups)&&a.triggerGroups.length>0?new Mi(this._instance,this.Y,this.ce.bind(this),this.be.bind(this),this.ve.bind(this)):new Ci(this._instance,this.Y,this.J,this.K,this.ce.bind(this),this.de.bind(this),this.ve.bind(this)),this.Ie.onRemoteConfig(a),null==(n=this.pe)||n.call(this),this.pe=this.Ie.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((e,t)=>this.Gt(e,t))),this.Yt(Lt,(()=>{this.overrideSampling()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Lt)})),this.Yt(Ot,(()=>{this.overrideLinkedFlag()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Ot)})),this.Yt(Nt,(()=>{this.overrideTrigger("event")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Nt)})),this.Yt(Ft,(()=>{this.overrideTrigger("url")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Ft)})),this.Ie.makeSamplingDecisions(this.sessionId),this.Kt(),this.Be||(Pe(e,"beforeunload",this.wt),Pe(e,"pagehide",this.Ct),Pe(e,"offline",this.Mt),Pe(e,"online",this.Tt),Pe(i,"visibilitychange",this.It),!this.rt&&M(this.Se.onSessionId)&&(this.rt=this.Se.onSessionId(this.ot)),!this.it&&M(this.Se.on)?this.it=this.Se.on("forcedIdleReset",(()=>{this.ht(),this.Fe="unknown",this.stop(),this.nt=this.Se.onSessionId(((e,t,r)=>{var i;null==(i=this.nt)||i.call(this),this.nt=void 0,this.ot(e,t,r)}))})):M(this.Se.on)||Fi.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),L(this.tt)&&(this.tt=this._instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.Pt(e.properties.$current_url):"";if(!t)return;this.be("$pageview",{href:t})}}catch(e){Fi.error("Could not add $pageview to rrweb session",e)}}))),this.status===Yt&&this.ce(t||"recording_initialized"))}else Fi.info("remote config must be stored in persistence before recording can start")}Xt(){var t,r,n,a,o,s;null==e||e.removeEventListener("beforeunload",this.wt),null==e||e.removeEventListener("pagehide",this.Ct),null==e||e.removeEventListener("offline",this.Mt),null==e||e.removeEventListener("online",this.Tt),null==i||i.removeEventListener("visibilitychange",this.It),clearInterval(this.zt),this.er(),null==(t=this.tt)||t.call(this),this.tt=void 0,null==(r=this.pe)||r.call(this),this.pe=void 0,null==(n=this.rt)||n.call(this),this.rt=void 0,null==(a=this.it)||a.call(this),this.it=void 0,null==(o=this.nt)||o.call(this),this.nt=void 0,null==(s=this.Ie)||s.stop(),this.tr(),this.Jt()}Jt(){this.Xe+=1,this.Je=[],this.Ke=0,this.rr=void 0,this.et=!1}tr(){var e,t;null==(e=this.ir)||e.stop(),this.Oe=[],null==(t=this.Re)||t.call(this),this.Re=void 0}nr(){if(!this.rr||0===this.Ke)return!1;if(this.et)return!0;this.et=!0;var e=this.Xe;return this.er(),this.tr(),this.rr.catch((()=>{})).then((()=>{e===this.Xe&&(this.et=!1,this.St(),this.xt(),this.Xt(),Fi.info("stopped"))})).catch((()=>{this.et=!1,this.Xt(),Fi.info("stopped")})),!0}stop(){this.tr(),this.nr()||(this.St(),this.xt(),this.Xt(),Fi.info("stopped"))}ct(e){var t;this.stop(),this.ar=void 0,this.sr=void 0,null==(t=Pi())||null==t.resetSnapshotCostState||t.resetSnapshotCostState(),this.start("session_id_changed"),this.De=e,this.Pe=!1}Vt(){this.isStarted||(this.je=!0),this.De&&(this.De=!1,this.Pe=!1,this.qe&&(this.qe=!1,this.de()),this.ur())}discard(){this.xt(),this.Xt(),Fi.info("discarded")}lr(e,t,r,i,n){var a={$snapshot_bytes:r,$snapshot_data:t,$session_id:i,$window_id:n};this.status!==Qt?(this.hr(e,i),this.cr(a)):this.xt()}dr(){try{this.vr()}catch(e){this.Ue||(this.Ue=!0,Fi.error("could not track full snapshot cost",e))}}vr(){var e,t=null==(e=Pi())||null==e.getLastSnapshotCost?void 0:e.getLastSnapshotCost();t&&t!==this.sr&&(this.sr=t,this.ar&&this.ar.durationMs>=t.durationMs||(this.ar=t),500>t.durationMs||Fi.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(t.durationMs),stylesheetMs:Math.round(t.stylesheetMs),nodeCount:t.nodeCount,cssRuleCount:t.cssRuleCount,nonDeferrableCssRuleCount:t.nonDeferrableCssRuleCount,deferredStylesheetCount:t.deferredStylesheetCount}))}hr(e,t){e.type!==d.FullSnapshot?e.type===d.IncrementalSnapshot&&(I(this.Ge)||this.Ge===t||this.Ye===t||(this.Ye=t,Fi.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:t}),this.de())):this.Ge=t}pr(e){e.counted&&e.generation===this.Xe&&(this.Ke=Math.max(0,this.Ke-1)),e.counted=!1,this.Je=this.Je.filter((t=>t!==e))}mr(e,t,r){e.processed||e.generation!==this.Xe||(e.processed=!0,this.lr(e.event,t,r,e.targetSessionId,e.targetWindowId))}gr(e){try{var t=e.compressionEnabled?Ki(e.event):{event:e.event,size:br(e.event)};this.mr(e,t.event,t.size)}finally{this.pr(e)}}_t(){[...this.Je].forEach((e=>{this.gr(e)}))}yr(e,t,r,i){var n=this,a={event:e,compressionEnabled:t,targetSessionId:r,targetWindowId:i,generation:this.Xe,processed:!1,counted:!0};this.Je.push(a),this.Ke+=1;var o=function(){var r=l((function*(){try{if(a.processed)return;var r,i;try{var o=t?Qi(e)?yield function(e){return Xi.apply(this,arguments)}(e):Ki(e):{event:e,size:br(e)};r=o.event,i=o.size}catch(t){Fi.error("could not process queued compression event - will use uncompressed event",t),r=e,i=br(e)}n.mr(a,r,i)}finally{n.pr(a)}}));return function(){return r.apply(this,arguments)}}();this.rr=this.rr?this.rr.catch((()=>{})).then(o):o()}onRRwebEmit(e){var t,r,i,n,a,o,s,u,l;if(this._instance.sessionManager&&(this.$t(),e&&T(e))){if(e.type===d.Meta){var h=this.Pt(e.data.href);if(this.Ht=h,!h)return;e.data.href=h}else this.Bt();if(null==(t=this.Ie)||t.checkUrlTriggers(this.sessionId,(()=>this.Zt()),(()=>this.Qt()),((e,t)=>this.Gt(e,t))),!this.Y.urlBlocked||function(e){return e.type===d.Custom&&"recording paused"===e.data.tag}(e)){var c,f,p;e.type===d.FullSnapshot&&(null!=(c=Pi())&&null!=c.wasMaxDepthReached&&c.wasMaxDepthReached()&&(this.$e=!0),this.dr(),Promise.resolve().then((()=>this.dr())),this.Wt(),null==(f=this.ir)||f.reset(),null==(p=this._instance.persistence)||p.register_once({[Ut]:e.timestamp},void 0)),e.type===d.FullSnapshot&&null!=(r=this.Ie)&&r.hasPendingTriggers(this.sessionId)&&this.br();var m=this.ir?this.ir.throttleMutations(e):e;if(m){var g=function(e){var t=e;if(t&&T(t)&&6===t.type&&T(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;t.data.payload.payload.length>i;i++)r.push(t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?t.data.payload.payload[i].slice(0,2e3)+"...[truncated]":t.data.payload.payload[i]);return t.data.payload.payload=r,e}return e}(m),y=function(e){return rn(e)?e.data.payload:null}(g),b=function(e){return nn(e)?e.data.payload:null}(g),w=function(e){return tn(e)?e.data.payload:null}(g);y||b?null!=y&&y.lastActivityTimestamp&&(g.timestamp=y.lastActivityTimestamp):null!=w&&w.sessionId||this.wr(g),e.type===d.FullSnapshot&&(this.Qe.push([this._e,e.timestamp]),this.Qe.length>6&&(this.Qe=this.Qe.slice(-6)));var k=null!==(i=null!==(n=null!==(a=null==y?void 0:y.currentSessionId)&&void 0!==a?a:null==b?void 0:b.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==i?i:this._e,_=null!==(o=null!==(s=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==s?s:null==w?void 0:w.windowId)&&void 0!==o?o:this.st;if(!0!==this.Fe||function(e){return tn(e)||rn(e)||nn(e)}(g)){g.type===d.FullSnapshot&&(this.Ne=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var S=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.Ke>0||S&&Qi(g))this.yr(g,S,k,_);else{var x=S?Ki(g):{event:g,size:br(g)};this.lr(g,x.event,x.size,k,_)}}else(function(e){return e.type===d.FullSnapshot||e.type===d.Meta||e.type===d.IncrementalSnapshot&&e.data.source!==v.CanvasMutation})(g)&&this.Ne++}else!0===this.Fe&&this.Ne++}}}get status(){return this.Ie?this.Ie.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ce,rrwebError:this.Be,urlTriggerMatching:this.Y,eventTriggerMatching:this.J,linkedFlagMatching:this.K,remoteConfig:this.Me}):Qt}log(e,t){var r;void 0===t&&(t="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.K.linkedFlagSeen=!0,this.de(),this.Vt(),this.ce("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[Dt]:this.sessionId,[At]:null}),this.de(),this.Vt(),this.ce("sampling_overridden")}overrideTrigger(e){this.Gt(e),this.Vt()}kr(){try{var t,r=null==e||null==(t=e.location)?void 0:t.href;if(!r)return;var i=this.Pt(r);if(!i)return;return new URL(i).hostname||void 0}catch(e){return}}er(){this._r&&(clearTimeout(this._r),this._r=void 0)}ur(){this._r||(this._r=setTimeout((()=>{this.St()}),2e3))}Sr(){return this.Ge!==this.ft.sessionId&&0!==this.ft.data.length&&this.ft.data.every((e=>(null==e?void 0:e.type)===d.Custom&&!rn(e)&&!nn(e)))}Cr(){var e,t;return null!==(e=null==(t=this.Ie)?void 0:t.getPendingTriggerConditions(this.sessionId))&&void 0!==e?e:[]}Mr(e){if(e!==Jt)return I(this.Tr)||this._instance.register_for_session({[Vt]:[]}),void(this.Tr=void 0);var t=this.Cr();if(0===t.length)return I(this.Tr)||this._instance.register_for_session({[Vt]:[]}),void(this.Tr=void 0);var r=t.join(", "),i=this.sessionId+":"+r;i!==this.Tr&&(this.Tr=i,this._instance.register_for_session({[Vt]:t}),Fi.info("buffering: "+r))}St(){var e;if(this.er(),this.De)return this.ft;if(this.Sr())return this.ft.size>Li?this.xt():this.ft;var t=this.ft;null==(e=this.Ie)||e.ensureSamplingDecision(this.sessionId);var r=this.yt(),i=this.status;if(this.Mr(i),i===Jt||i===Kt||i===Qt||r)return this.ur(),this.ft;if(this.ft!==t)return this.ft;if(t.data.length>0){var n,a=this.kr();kr(t).forEach((e=>{var t;null==(t=this.ut)||t.trackSize(e.sessionId,e.size),this.Ir({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Re.LIB_NAME,$lib_version:Re.LIB_VERSION,$snapshot_host:a})})),null==(n=this.Ie)||n.onFlushComplete()}return this.xt()}cr(e){var t,r=2+((null==(t=this.ft)?void 0:t.data.length)||0),i=e.$session_id,n=this.ft.sessionId!==i;if(n||!0!==this.Fe&&!this.De&&this.ft.size+e.$snapshot_bytes+r>Li){var a=this._e;if(this.ft=this.St(),this._e!==a)return;n&&this.ft.data.length>0&&(this.ft=this.xt()),this.ft.sessionId=i,this.ft.windowId=e.$window_id}this.De&&(this.qe||this.ft.size+e.$snapshot_bytes+r>Li)?this.qe||(this.qe=!0,this.ft=this.xt()):(this.ft.size+=e.$snapshot_bytes,this.ft.data.push(e.$snapshot_data),this.ft.sizes.push(e.$snapshot_bytes),!0===this.Fe||this.De||this.ur())}Ir(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.Ee),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get bt(){var e,t,r=null==(e=this.ft)?void 0:e.data[(null==(t=this.ft)?void 0:t.data.length)-1],i=this.Se.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}br(){if(!this.ft||0===this.ft.data.length)return this.xt();for(var e=-1,t=this.ft.data.length-1;t>=0;t--)if(this.ft.data[t].type===d.Meta){e=t;break}return 0>e?this.xt():(this.ft.data=this.ft.data.slice(e),this.ft.sizes=this.ft.sizes.slice(e),this.ft.size=this.ft.sizes.reduce(((e,t)=>e+t),0),this.ft)}xt(){return this.ft={size:0,data:[],sizes:[],sessionId:this._e,windowId:this.st},this.ft}ce(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),Fi.info(e.replace("_"," "),t),"session_id_changed"!==e&&this.be("$recording_started",h({reason:e},t))}Er(e){var t;return 3===e.type&&-1!==Ni.indexOf(null==(t=e.data)?void 0:t.source)}wr(e){var t=this.Er(e);t||!0===this.Fe||e.timestamp-this.Ae>this.xe&&(this.Fe=!0,clearInterval(this.zt),this.be("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.Ae,threshold:this.xe,bufferLength:this.ft.data.length,bufferSize:this.ft.size,sessionId:this._e,windowId:this.st}),this.St());var r=!1;if(t&&(this.Ae=e.timestamp,this.Fe)){var i="unknown"===this.Fe;this.Fe=!1,i||(this.be("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}var n=this.Se.checkAndGetSessionAndWindowId(!t,e.timestamp),a=n.windowId,o=n.sessionId,s=this._e!==o,u=this.st!==a;if(this.st=a,this._e=o,s||u){var l=s&&!1!==this.Fe;l&&(this.Fe="unknown"),this.ct(l)}else if(t&&this.Vt(),r){var h,c=["sampled","active"].includes(this.status)||(null==(h=this.Ie)?void 0:h.hasPendingTriggers(this.sessionId));this.Ne>0&&c&&this.de(),this.Wt()}}ht(){var e;null==(e=this.Ie)||e.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var e,t,r,i,n,a,o,s,u,l=this.Se.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(e=Pi())||null==e.getDeferredStylesheetStats?void 0:e.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.ft.data.length,$sdk_debug_replay_internal_buffer_size:this.ft.size,$sdk_debug_current_session_duration:this.bt,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(t=this.ut)?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Qe,$snapshot_max_depth_exceeded:this.$e,$sdk_debug_replay_slowest_full_snapshot_ms:Ii(null==(r=this.ar)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Ii(null==(i=this.ar)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(a=this.ar)?void 0:a.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.ar)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Ii(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Ii(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Ii(null==(s=Pi())||null==s.getMutationCost||null==(s=s.getMutationCost())?void 0:s.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=Pi())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_rrweb_error:this.Be,$sdk_debug_rrweb_attached:!!this.Re,$sdk_debug_rrweb_start_attempted:this.He}}Kt(){var e;if(!this.Re){this.He=!0;var t,r,i,n,a={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},o=this._instance.config.session_recording;for(var s of Object.entries(o||{})){var u=s[0],l=s[1];if(u in a)if("maskInputOptions"===u)a.maskInputOptions=h({password:!0},l);else if("sampling"===u){var c=null!=l?l:{},d={};I(c.mousemove)||(d.mousemove=c.mousemove),I(c.mouseInteraction)||(d.mouseInteraction=c.mouseInteraction),a.sampling=d}else a[u]=l}this.Lt&&this.Lt.enabled&&(a.recordCanvas=!0,a.sampling=h({},a.sampling,{canvas:this.Lt.fps}),a.dataURLOptions={type:"image/webp",quality:this.Lt.quality},a.canvasResolutionScale=this.At,a.canvasMasking={configured:()=>{var e;return M(null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn)},regionsFn:e=>{var t,r=null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn;if(M(r))try{var i;return null!==(i=r(e))&&void 0!==i?i:null}catch(e){return this.Ve||(this.Ve=!0,Fi.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",e)),null}}}),this.Et&&(a.maskAllInputs=null===(t=this.Et.maskAllInputs)||void 0===t||t,a.maskTextSelector=null!==(r=this.Et.maskTextSelector)&&void 0!==r?r:void 0,a.blockSelector=null!==(i=this.Et.blockSelector)&&void 0!==i?i:void 0,a.maskAllElementAttributes=null!==(n=this.Et.maskAllElementAttributes)&&void 0!==n&&n),a.maskAllElementAttributes&&a.maskAttributeFn&&(a.maskAttributeFn=void 0,this.ze||(this.ze=!0,Fi.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.Rt();var v=qi();if(v){this.ir=null!==(e=this.ir)&&void 0!==e?e:new ni(v,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var r="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";Fi.info(r,{node:t}),this.log(Oi+" "+r,"warn")}});var f=this.Nt();if(this.Re=v(h({emit:e=>{this.onRRwebEmit(e)},plugins:f,errorHandler:(e,t)=>"rrweb"===t&&(this.Ze||(this.Ze=!0,Fi.error("rrweb internal error - recording will continue but may be incomplete",e)),!0)},a)),!this.Re)return this.Be=!0,void Fi.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Be=!1,this.Ae=Date.now(),this.Fe=F(this.Fe)?this.Fe:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Me),this.be("$session_options",{sessionRecordingOptions:a,activePlugins:f.map((e=>null==e?void 0:e.name))}),this.be("$posthog_config",{config:this._instance.config})}else Fi.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(e,t){return this.be(e,t)}}var on,sn=["type"],un=Object.defineProperty,ln=(e,t,r)=>((e,t,r)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),hn=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(hn||{}),cn=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(cn||{}),dn=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(dn||{}),vn=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(vn||{}),fn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fn||{}),pn=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(pn||{}),mn=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(mn||{});function gn(e,t){return-1!==e.indexOf(t)}var yn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},bn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},wn={};function kn(e){if(wn[e])return wn[e];var t=function(e){var t,r,i=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return i&&globalThis[i]?globalThis[i]:void 0}(e)||globalThis[e],r=t.prototype,i=e in yn?yn[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),a=e in bn?bn[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return wn[e]=t.prototype,t.prototype;var s=document.createElement("iframe");s.style.display="none";var u=!1;try{document.body.appendChild(s);var l=s.contentWindow;if(!l)return t.prototype;var h=l[e].prototype;return h?(function(e){return gn(e,"AppleWebKit")&&!gn(e,"Chrome")}(navigator.userAgent)&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",e),u=!0),wn[e]=h):r}catch(e){return r}finally{!u&&s.parentNode&&document.body.removeChild(s)}}var _n={};function Sn(e,t,r){var i,n=e+"."+String(r);if(_n[n])return _n[n].call(t);var a=kn(e),o=null==(i=Object.getOwnPropertyDescriptor(a,r))?void 0:i.get;return o?(_n[n]=o,o.call(t)):t[r]}var xn={};function Cn(e,t,r){var i=e+"."+String(r);if(xn[i])return xn[i].bind(t);var n=kn(e)[r];return"function"!=typeof n?t[r]:(xn[i]=n,n.bind(t))}function Mn(){return kn("MutationObserver").constructor}function Tn(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n={next:i},a=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),e[t]=a,()=>{if(e[t]!==a)for(var r=e[t];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===a)return void(i.next=n.next);r=i.next}else e[t]=n.next}}catch(e){return()=>{}}}var In={childNodes:e=>Sn("Node",e,"childNodes"),parentNode:e=>Sn("Node",e,"parentNode"),parentElement:e=>Sn("Node",e,"parentElement"),textContent:e=>Sn("Node",e,"textContent"),contains:(e,t)=>Cn("Node",e,"contains")(t),getRootNode:e=>Cn("Node",e,"getRootNode")(),host:e=>e&&"host"in e?Sn("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?Sn("Element",e,"shadowRoot"):null,querySelector:(e,t)=>Cn("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>Cn("Element",e,"querySelectorAll")(t),mutationObserver:Mn,patch:Tn},En=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Rn(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(e){}return Date.now()}var An=0,Ln=6e4;function On(){An+=1}function Fn(){return An}function Nn(e,t){return t!==An||e>Ln}var Dn=0,Pn=0,qn=0,jn=En(),Bn=null,Hn=null,$n=[],Un=0,Wn=0,zn={slowestBatchMs:0},Vn={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Zn=e=>e&&e>0?e:null;function Qn(e){(Dn+=1)>1||(jn=En(),$n=[],Un=0,Hn=Zn(e),Pn=Rn(),qn=An)}function Gn(){return 0===Dn?Bn||En():(Dn-=1)>0?jn:(jn.durationMs=Rn()-Pn,jn.deferredStylesheetCount=Un,Vn.deferredCount+=Un,Hn=null,Nn(jn.durationMs,qn)?jn:Bn=jn)}var Yn=32;function Jn(e,t,r){var i=e.length;if(r>=Yn)return i;for(var n=0;e.length>n;n++){var a=e[n];try{var o=a.cssRules;if(o&&o.length)i+=Jn(o,t,r+1);else if(t&&a.styleSheet){var s=a.styleSheet;if(!t.has(s)){t.add(s);var u=s.rules||s.cssRules;u&&(i+=Jn(u,t,r+1))}}}catch(e){}}return i}function Kn(e){if(0!==Dn){var t=Jn(e,null,0);jn.cssRuleCount+=t,Wn>0&&(jn.nonDeferrableCssRuleCount+=t)}}function Xn(e){Wn+=1;try{return e()}finally{Wn-=1}}function ea(e){Dn>0&&(jn.stylesheetMs+=e)}function ta(e){if(0===Dn||null===Hn)return!1;var t=jn.cssRuleCount-jn.nonDeferrableCssRuleCount;return t>=Hn||t+function(e){try{var t=e&&(e.rules||e.cssRules);if(!t)return 0;var r=new WeakSet;return r.add(e),Jn(t,r,0)}catch(e){return 0}}(e)>Hn}function ra(){Vn.failedCount+=1}function ia(e){e>0&&(Vn.abandonedCount+=e)}function na(e){return e.nodeType===e.ELEMENT_NODE}function aa(e){var t=e&&"host"in e&&"mode"in e&&In.host(e)||null;return Boolean(t&&"shadowRoot"in t&&In.shadowRoot(t)===e)}function oa(e){return"[object ShadowRoot]"==={}.toString.call(e)}function sa(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function ua(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}var la=0;function ha(e){var t=0===la,r=t?Rn():0;la+=1;try{var i=e.rules||e.cssRules;if(!i)return null;Kn(i);var n=e.href;return!n&&e.ownerNode&&(n=e.ownerNode.baseURI),sa(Array.from(i,(e=>ca(e,n))).join(""))}catch(e){return null}finally{la-=1,t&&ea(Rn()-r)}}function ca(e,t){var r;if(va(e)){var i;try{i=ha(e.styleSheet)||ua(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return Ea(i,e.styleSheet.href)}catch(e){}return i}var n=e.cssText;return fa(e)&&e.selectorText.includes(":")&&(n=da(n)),t?Ea(n,t):n}function da(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function va(e){return"styleSheet"in e}function fa(e){return"selectorText"in e}var pa=/^-?[A-Za-z_][\w-]*$/,ma=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ga(e){var t=[],r=!1,i=null,n=new Map;function a(e){var n=t.pop();if("group"===n.kind){if(null===e){for(;t.length>0&&"group"===t[t.length-1].kind;)t.pop();return void a(null)}var s=t[t.length-1];return s.parts.push(e),void(s.index+=1)}if(!n.importRule)return r=!0,void(i=e);o(t[t.length-1],n.importRule,e)}function o(e,t,r){var i;try{var n;try{n=r||ua(t)}catch(e){n=t.cssText}try{n&&(null==(i=t.styleSheet)?void 0:i.href)&&(n=Ea(n,t.styleSheet.href))}catch(e){}n&&e.parts.push(n),e.index+=1}catch(e){a(null)}}function s(e){var r=e.rules[e.index];if("sheet"===e.kind&&va(r)){var i=n.get(r);return null===i?(e.parts.push(r.cssText),void(e.index+=1)):i?void t.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void o(e,r,null)}if(!function(e,r){try{var i=function(e){var t,r=e;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(fa(e)){if("number"==typeof r.type&&1!==r.type)return null;var i=r.style?r.style.cssText:"";return e.selectorText+" {"+(i?" "+i:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!pa.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var n="";try{n=(null==(t=e.constructor)?void 0:t.name)||""}catch(e){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?pa.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":ma.test(r.name)?"@layer "+r.name+" {":null:null}(e);if(null===i)return!1;var n=r.sheetHref;return t.push({kind:"group",rules:Array.from(e.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Ea(i,n):i,fixColons:"sheet"===r.kind&&fa(e)&&e.selectorText.includes(":")}),!0}catch(e){return!1}}(r,e)){var a=r.cssText;"sheet"===e.kind&&fa(r)&&r.selectorText.includes(":")&&(a=da(a)),e.parts.push(e.sheetHref?Ea(a,e.sheetHref):a),e.index+=1}}return function(e){try{var r=e.rules||e.cssRules;if(!r)return!1;Kn(r);var i=e.href;!i&&e.ownerNode&&(i=e.ownerNode.baseURI);var a=Array.from(r);return t.push({kind:"sheet",sheet:e,rules:a,sheetHref:i,index:0,parts:[],importRule:null}),function(e,t){for(var r=[{sheet:t,rules:e,index:0}],i=function(){var e=r[r.length-1];if(e.index>=e.rules.length)return r.pop(),0;var t=e.rules[e.index];if(e.index+=1,!va(t)||n.has(t))return 0;var i=null;try{i=t.styleSheet}catch(e){return n.set(t,null),0}if(!i||r.some((e=>e.sheet===i)))return 0;try{var a=i.rules||i.cssRules;if(!a)return 0;Kn(a);var o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);var s=Array.from(a);n.set(t,{sheet:i,rules:s,sheetHref:o}),r.push({sheet:i,rules:s,index:0})}catch(e){}};r.length>0;)i()}(a,e),!0}catch(e){return!1}}(e)||(r=!0),{advance(e){if(r)return!0;var n=Rn(),o=e>0?e:1;try{for(;!r&&o>0;){var u=t[t.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(e){a(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?da(h):h}else l=sa(u.parts.join(""))}catch(e){}a(l)}}}catch(e){r=!0,i=null}finally{ea(Rn()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var e=0;for(var i of t)e+=i.rules.length-i.index;return e}}}class ya{constructor(){ln(this,"idNodeMap",new Map),ln(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),na(e)){var r=In.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ba(e){var t=e.element,r=e.maskInputOptions,i=e.tagName,n=e.type,a=e.maskInputFn,o=e.value||"",s=n&&wa(n);return(r[i.toLowerCase()]||s&&r[s])&&(o=a?a(o,t):"*".repeat(o.length)),o}function wa(e){return e.toLowerCase()}var ka=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function _a(e){var t=e.element,r=e.name,i=e.value,n=e.maskAttributeFn,a=e.isGenerated;return i?e.maskAllElementAttributes?void 0!==a&&a&&ka.has(wa(r))?i:"*".repeat(i.length):n?n(r,i,t):i:i}var Sa="__rrweb_original__";function xa(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?wa(t):null}catch(e){return null}}var Ca=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ma=/^(?:[a-z+]+:)?\/\//i,Ta=/^www\..*/i,Ia=/^(data:)([^,]*),(.*)/i;function Ea(e,t){return(e||"").replace(Ca,((e,r,i,n,a,o)=>{var s,u=i||a||o,l=r||n||"";if(!u)return e;if(Ma.test(u)||Ta.test(u))return"url("+l+u+l+")";if(Ia.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var h=t.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var Ra,Aa,La="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Oa=4096,Fa=1e5,Na=10,Da=new Map,Pa=1,qa=new RegExp("[^a-z0-9-_:]"),ja=-2;function Ba(){return Pa++}var Ha=/^[^ \t\n\r\u000c]+/,$a=/^[, \t\n\r\u000c]+/,Ua=new WeakMap;function Wa(e,t){return t&&""!==t.trim()?za(e,t):t}function za(e,t){var r=Ua.get(e);if(r||(r=e.createElement("a"),Ua.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Va(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?La:e}(e,t.maxBase64ImageLength):e}function Za(e,t,r,i,n,a){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&n){var s=null==(o=n.sheet)?void 0:o.href;if(s)return s}var u=Wa(e,i);if(u.startsWith("data:")){if("img"===t&&n){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,i){if(Fa>t.length)return t;if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>Oa||e.naturalHeight>Oa)return t;var n=Da.get(t);if(n&&n.type===r&&n.quality===i)return n.result;try{var a=document.createElement("canvas");a.width=e.naturalWidth,a.height=e.naturalHeight;var o=a.getContext("2d");if(!o)return t;o.drawImage(e,0,0);var s=a.toDataURL(r||"image/webp",null!=i?i:.4),u=t.length>s.length?s:t;if(Da.size>=Na){var l=Da.keys().next().value;void 0!==l&&Da.delete(l)}return Da.set(t,{type:r,quality:i,result:u}),u}catch(e){return t}}(n,u,a.type,a.quality)),Va(l,a)}if("image"===t)return Va(u,a)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Wa(e,i);return"image"===t&&h.startsWith("data:")?Va(h,a):h}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i($a),t.length>r;){var a=i(Ha);if(","===a.slice(-1))a=Wa(e,a.substring(0,a.length-1)),n.push(a);else{var o="";a=Wa(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){n.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,n.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return n.join(", ")}(e,i):"style"===r?Ea(i,za(e)):"object"===t&&"data"===r?Wa(e,i):i:Wa(e,i)}function Qa(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Ga(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ga(In.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&Ga(In.parentNode(e),t,r)}function Ya(e,t,r,i){var n;if(na(e)){if(!In.childNodes(n=e).length)return!1}else{if(null===In.parentElement(e))return!1;n=In.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(Ga(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function Ja(e,t,r){var i=e.removeEventListener;"function"==typeof i&&i.call(e,t,r)}var Ka=new Map;function Xa(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function eo(e){return null==e?"":e.toLowerCase()}var to=50,ro=!1,io=!1;function no(e,t){var r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,h=t.inlineStylesheet,c=void 0===h||h,d=t.maskInputOptions,v=void 0===d?{}:d,f=t.maskTextFn,p=t.maskInputFn,m=t.maskAllElementAttributes,g=void 0!==m&&m,y=t.maskAttributeFn,b=t.slimDOMOptions,w=t.dataURLOptions,k=void 0===w?{}:w,_=t.inlineImages,S=void 0!==_&&_,x=t.recordCanvas,C=void 0!==x&&x,M=t.canvasMaskingConfigured,T=t.onSerialize,I=t.onIframeLoad,E=t.iframeLoadTimeout,R=void 0===E?5e3:E,A=t.onIframeListenerRegistered,L=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,F=void 0===O?5e3:O,N=t.keepIframeSrcFn,D=void 0===N?()=>!1:N,P=t.newlyAddedElement,q=void 0!==P&&P,j=t.depth,B=void 0===j?0:j,H=t.maxDepth,U=void 0===H?to:H,W=t.needsMask,z=t.preserveWhiteSpace,V=void 0===z||z;if(B>=U)return io=!0,ro||(ro=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;W||(W=Ya(e,o,s,void 0===W)),Dn>0&&(jn.nodeCount+=1);var Z,Q=function(e,t){var r=t.doc,i=t.blockClass,n=t.blockSelector,a=t.needsMask,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskTextFn,h=t.maskInputFn,c=t.maskAllElementAttributes,d=void 0!==c&&c,v=t.maskAttributeFn,f=t.dataURLOptions,p=void 0===f?{}:f,m=t.inlineImages,g=t.recordCanvas,y=t.canvasMaskingConfigured,b=t.keepIframeSrcFn,w=t.newlyAddedElement,k=void 0!==w&&w,_=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:mn.Document,childNodes:[],compatMode:e.compatMode}:{type:mn.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:mn.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var r,i,n,a=t.doc,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,h=t.maskAllElementAttributes,c=void 0!==h&&h,d=t.maskAttributeFn,v=t.dataURLOptions,f=void 0===v?{}:v,p=t.inlineImages,m=t.recordCanvas,g=t.canvasMaskingConfigured,y=t.keepIframeSrcFn,b=t.newlyAddedElement,w=void 0!==b&&b,k=t.rootId,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),S=function(e){if(e instanceof HTMLFormElement)return"form";var t=wa(e.tagName);return qa.test(t)?"div":t}(e),x=new Set,C={},M=e.attributes.length,T=0;M>T;T++){var I=e.attributes[T];Qa(S,I.name)||(C[I.name]=Za(a,S,wa(I.name),I.value,e,f))}if("link"===S&&o&&!_){var E=e.sheet;if(!E){var R=function(e){return e.href}(e);R&&!(E=Xa(a,R))&&R.includes(".css")&&(E=Xa(a,window.location.origin+"/"+R.replace(window.location.href,"")))}var A=null;E&&(ta(E)?Dn>0&&($n.push(e),Un+=1):A=ha(E)),A&&(delete C.rel,delete C.href,C._cssText=A)}if("style"===S&&e.sheet&&!(e.innerText||In.textContent(e)||"").trim().length){var L=Xn((()=>ha(e.sheet)));L&&(C._cssText=L)}if("input"===S||"textarea"===S||"select"===S){var O=e.value,F=e.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&O?C.value=ba({element:e,type:xa(e),tagName:S,value:O,maskInputOptions:u,maskInputFn:l}):F&&(C.checked=F)}if("option"===S&&(e.selected&&!u.select?C.selected=!0:delete C.selected),"dialog"===S&&e.open){try{C.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&m&&!(null==g?void 0:g()))if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((Sa in n?n[Sa]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(C.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){var N=e.toDataURL(f.type,f.quality),D=a.createElement("canvas");D.width=e.width,D.height=e.height,N!==D.toDataURL(f.type,f.quality)&&(C.rr_dataURL=N)}var P,q,j=!1;if("img"===S&&p){Ra||(Ra=a.createElement("canvas"),Aa=Ra.getContext("2d"));var B=e,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",U=B.crossOrigin,W=(t,r)=>j?_a({element:e,name:t,value:r,maskAllElementAttributes:c,maskAttributeFn:d}):r,z=()=>{Ja(B,"load",z);try{Ra.width=B.naturalWidth,Ra.height=B.naturalHeight,Aa.drawImage(B,0,0);var e=Ra.toDataURL(f.type,f.quality);C.rr_dataURL=W("rr_dataURL",e)}catch(e){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z));console.warn("Cannot inline img src="+H+"! Error: "+e)}"anonymous"===B.crossOrigin&&(U?C.crossOrigin=W("crossOrigin",U):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=e.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=e.currentTime,V.rr_mediaPlaybackRate=e.playbackRate,V.rr_mediaMuted=e.muted,V.rr_mediaLoop=e.loop,V.rr_mediaVolume=e.volume}if(w||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),_){var Z=e.getBoundingClientRect(),Q=Z.width,G=Z.height,Y=Z.left,J=Z.top,K=null==(r=a.defaultView)?void 0:r.getComputedStyle(e);C={class:C.class,rr_width:Q+"px",rr_height:G+"px",rr_left:Math.floor(Y+((null==(i=a.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(J+((null==(n=a.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),K&&(C.rr_position=K.position||"static",x.add("rr_position"),K.transform&&"none"!==K.transform&&(C.rr_transform=K.transform,x.add("rr_transform")),K.display&&K.display.startsWith("inline")&&(C.rr_display=K.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(e.contentDocument||(C.rr_src=C.src),delete C.src),c||d)for(var X of Object.entries(C)){var ee=X[0],te=X[1];"string"!=typeof te&&null!==te||(C[ee]=_a({element:e,name:ee,value:te,maskAllElementAttributes:c,maskAttributeFn:d,isGenerated:x.has(ee)}))}j=!0;try{customElements.get(S)&&(P=!0)}catch(e){}return{type:mn.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=e,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:_,rootId:k,isCustom:P}}(e,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:k,rootId:_});case e.TEXT_NODE:return function(e,t){var r,i=t.needsMask,n=t.maskTextFn,a=t.rootId,o=In.parentNode(e),s=o&&o.tagName,u=In.textContent(e),l="STYLE"===s||void 0,h="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(ta(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var c=ha(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(u=c)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=Ea(u,za(t.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,In.parentElement(e)):u.replace(/[\S]/g,"*")),{type:mn.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:a,maskTextFn:l,rootId:_});case e.CDATA_SECTION_NODE:return{type:mn.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:mn.Comment,textContent:In.textContent(e)||"",rootId:_};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:y,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,keepIframeSrcFn:D,newlyAddedElement:q});if(!Q)return console.warn(e,"not serialized"),null;Z=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===mn.Comment)return!0;if(e.type===mn.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,i;try{i=new URL(e,window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(eo(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===eo(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(eo(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&eo(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(eo(e.attributes.property).match(/^(og|twitter|fb):/)||eo(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===eo(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(eo(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(eo(e.attributes.name))||eo(e.attributes.property).match(/^article:/)||eo(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(eo(e.attributes.name)))return!0}}return!1}(Q,b)||!V&&Q.type===mn.Text&&!Q.isStyle&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?ja:Ba();var G=Object.assign(Q,{id:Z});if(i.add(e,G),Z===ja)return null;T&&T(e);var Y=!l;if(G.type===mn.Element){Y=Y&&!G.needBlock,delete G.needBlock;var J=In.shadowRoot(e);J&&oa(J)&&(G.isShadowHost=!0)}if((G.type===mn.Document||G.type===mn.Element)&&Y){b.headWhitespace&&G.type===mn.Element&&"head"===G.tagName&&(V=!1);var K={doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B+1,maxDepth:U};if(G.type===mn.Element&&"textarea"===G.tagName&&void 0!==G.attributes.value);else for(var X of Array.from(In.childNodes(e))){var ee=no(X,K);ee&&G.childNodes.push(ee)}var te=null;if(na(e)&&(te=In.shadowRoot(e)))for(var re of Array.from(In.childNodes(te))){var ie=no(re,K);ie&&(oa(te)&&(ie.isShadow=!0),G.childNodes.push(ie))}}var ne=In.parentNode(e);if(ne&&aa(ne)&&oa(ne)&&(G.isShadow=!0),G.type===mn.Element&&"iframe"===G.tagName){var ae=function(e,t,r){var i,n=()=>{},a=e.contentWindow;if(!a)return n;try{i=a.document.readyState}catch(e){return n}var o=()=>t();if("complete"!==i){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),Ja(e,"load",h),e.addEventListener("load",o),t())},h=()=>l();return u=setTimeout(l,r),e.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),s?Ja(e,"load",o):(s=!0,Ja(e,"load",h))}}var c,d="about:blank";try{c=a.location.href}catch(e){return n}if(c!==d||e.src===d||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),Ja(e,"load",o)}}return e.addEventListener("load",o),()=>{Ja(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&I){var r=no(t,{doc:t,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B+1,maxDepth:U});r&&I(e,r)}}),R);null==A||A(e,ae)}return G.type===mn.Element&&"link"===G.tagName&&"stylesheet"===G.attributes.rel&&function(t,u,l){if(!Ka.has(t)){var h;try{h=t.sheet}catch(e){return}if(!h){var d=new AbortController,m=!1,w=()=>{if(!m){m=!0;try{(()=>{if(L){var t=no(e,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B,maxDepth:U});t&&L(e,t)}})()}finally{Ka.delete(t),d.abort()}}},_=setTimeout(w,l);d.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),t.addEventListener("load",w,{signal:d.signal,once:!0}),Ka.set(t,d)}}}(e,0,F),G}function ao(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class oo{constructor(){ln(this,"parentElement",null),ln(this,"parentNode",null),ln(this,"ownerDocument"),ln(this,"firstChild",null),ln(this,"lastChild",null),ln(this,"previousSibling",null),ln(this,"nextSibling",null),ln(this,"ELEMENT_NODE",1),ln(this,"TEXT_NODE",3),ln(this,"nodeType"),ln(this,"nodeName"),ln(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof oo))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function so(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>uo(r,e,t,i)}function uo(e,t,r,i){lo((()=>{var n=e.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(e,t,r,i):n.call(e,t,r))}))}function lo(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var ho="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",co={map:{},getId(){return console.error(ho),-1},getNode(){return console.error(ho),null},removeNodeFromMap(){console.error(ho)},has(){return console.error(ho),!1},reset(){console.error(ho)}};function vo(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();n||!1!==r.leading||(n=u);var l=t-(u-n),h=this;0>=l||l>t?(i&&(clearTimeout(i),i=null),n=u,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),l))}}function fo(e,t,r,i,n){void 0===n&&(n=window);var a=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(e){return}a.set.call(this,e)}}}),()=>fo(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(co=new Proxy(co,{get(e,t,r){return"map"===t&&console.error(ho),Reflect.get(e,t,r)}}));var po=Date.now;function mo(e){var t,r,i,n,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=In.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(i=In.parentElement(a.body))?void 0:i.scrollTop)||(null==(n=null==a?void 0:a.body)?void 0:n.scrollTop)||0}}function go(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function yo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function bo(e){return e?e.nodeType===e.ELEMENT_NODE?e:In.parentElement(e):null}function wo(e,t,r,i){if(!e)return!1;var n=bo(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(Ga(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function ko(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===ja}function _o(e,t){if(aa(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=In.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||_o(i,t))}function So(e){return Boolean(e.changedTouches)}function xo(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Co(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Mo(e){return!!e&&(e instanceof oo&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(In.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(po=()=>(new Date).getTime());class To{constructor(){ln(this,"id",1),ln(this,"styleIDMap",new WeakMap),ln(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Io(e){var t,r=null;return"getRootNode"in e&&(null==(t=In.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&In.host(In.getRootNode(e))&&(r=In.host(In.getRootNode(e))),r}function Eo(e){var t=e.ownerDocument;return!!t&&(In.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Io(r);)r=t;return r}(e);return In.contains(t,r)}(e))}function Ro(e){return"__ln"in e}class Ao{constructor(){ln(this,"length",0),ln(this,"head",null),ln(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ro(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ro(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Lo,Oo=(e,t)=>e+"@"+t;class Fo{constructor(){ln(this,"frozen",!1),ln(this,"locked",!1),ln(this,"texts",[]),ln(this,"attributes",[]),ln(this,"attributeMap",new WeakMap),ln(this,"generatedAttributes",new WeakMap),ln(this,"removes",[]),ln(this,"mapRemoves",[]),ln(this,"movedMap",{}),ln(this,"addedSet",new Set),ln(this,"movedSet",new Set),ln(this,"droppedSet",new Set),ln(this,"removesSubTreeCache",new Set),ln(this,"mutationCb"),ln(this,"blockClass"),ln(this,"blockSelector"),ln(this,"maskTextClass"),ln(this,"maskTextSelector"),ln(this,"inlineStylesheet"),ln(this,"maskInputOptions"),ln(this,"maskTextFn"),ln(this,"maskInputFn"),ln(this,"maskAllElementAttributes"),ln(this,"maskAttributeFn"),ln(this,"keepIframeSrcFn"),ln(this,"recordCanvas"),ln(this,"canvasMaskingConfigured"),ln(this,"inlineImages"),ln(this,"slimDOMOptions"),ln(this,"dataURLOptions"),ln(this,"doc"),ln(this,"mirror"),ln(this,"iframeManager"),ln(this,"stylesheetManager"),ln(this,"shadowDomManager"),ln(this,"canvasManager"),ln(this,"processedNodeManager"),ln(this,"unattachedDoc"),ln(this,"canvasManagerReleased",!1),ln(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),ln(this,"emit",(()=>{if(!this.frozen&&!this.locked){var e,t,r=Rn(),i=Fn();try{this.processBufferedMutations()}finally{e=Rn()-r,t=i,Dn>0||Nn(e,null!=t?t:An)||e>zn.slowestBatchMs&&(zn.slowestBatchMs=e)}}})),ln(this,"processBufferedMutations",(()=>{for(var e=[],t=new Set,r=new Ao,i=e=>{for(var t=e,r=ja;r===ja;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var a=In.parentNode(n);if(a&&Eo(n)&&"TEXTAREA"!==a.tagName){var o=aa(a)?this.mirror.getId(Io(n)):this.mirror.getId(a),s=i(n);if(-1===o||-1===s)return r.addNode(n);var u=no(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:e=>{xo(e,this.mirror)&&this.iframeManager.addIframe(e),Co(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Mo(e)&&!wo(e,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(In.shadowRoot(e),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)Do(this.removesSubTreeCache,a)&&!this.movedSet.has(In.parentNode(a))||n(a);for(var o of this.addedSet)Po(this.droppedSet,o)||Do(this.removesSubTreeCache,o)?Po(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(In.parentNode(s.value)),h=i(s.value);-1!==l&&-1!==h&&(u=s)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(In.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=In.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=In.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=In.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t,r=e.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var i=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.style.length>i.length&&(i+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var a of Object.entries(r)){var o=a[0],s=a[1];"string"!=typeof s&&null!==s||(r[o]=_a({element:e.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(t=this.generatedAttributes.get(e.node))?void 0:t.has(o)}))}return{id:this.mirror.getId(e.node),attributes:r}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(m))})),ln(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),ln(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(In.childNodes(e),(e=>In.textContent(e)||"")).join("");t.attributes.value=ba({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:xa(e),value:r,maskInputFn:this.maskInputFn})})),ln(this,"processMutation",(e=>{var t;if(!ko(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var r=In.textContent(e.target);wo(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue||this.texts.push({value:Ya(e.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,bo(e.target)):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var i,n=e.target,a=e.attributeName,o=null!==(i=e.attributeNamespace)&&void 0!==i?i:null,s=function(e,t,r){if(!r)return t;var i=e.getAttributeNodeNS(r,t);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+t;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+t;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===t?t:"xmlns:"+t;var n=e.lookupPrefix(r);return n?n+":"+t:t}(n,a,o),u=o?n.getAttributeNS(o,a):e.target.getAttribute(a);if("value"===s){var l=n,h=xa(l);u=ba({element:l,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:u,maskInputFn:this.maskInputFn})}if(wo(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;var c=this.attributeMap.get(e.target),d="IFRAME"===n.tagName&&"src"===s;if(d&&!this.keepIframeSrcFn(u)&&n.contentDocument)return;if(c||(this.attributes.push(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,c)),"type"===s&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Qa(n.tagName,s)){var v=Za(this.doc,wa(n.tagName),wa(s),u,n,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(u)&&(s="rr_src"),c.attributes[s]=v,null==(t=this.generatedAttributes.get(e.target))||t.delete(s),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var m of(e.oldValue&&(f.style.cssText=e.oldValue),Array.from(p))){var g=p.getPropertyValue(m),y=p.getPropertyPriority(m);g!==f.style.getPropertyValue(m)||y!==f.style.getPropertyPriority(m)?c.styleDiff[m]=""===y?g:[g,y]:c._unchangedStyles[m]=[g,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(c.styleDiff[b]=!1)}else if("open"===s&&"DIALOG"===n.tagName){c.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(e.target);w||this.generatedAttributes.set(e.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(wo(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=aa(e.target)?this.mirror.getId(In.host(e.target)):this.mirror.getId(e.target);wo(e.target,this.blockClass,this.blockSelector,!1)||ko(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(No(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||_o(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Oo(r,i)]?No(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!aa(e.target)||!oa(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),In.childNodes(i).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),ln(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ko(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Oo(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);wo(e,this.blockClass,this.blockSelector,!1)||(In.childNodes(e).forEach((e=>this.genAdds(e))),Mo(e)&&In.childNodes(In.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function No(e,t){for(var r=[t];r.length;){var i=r.pop();e.delete(i),In.childNodes(i).forEach((e=>r.push(e)))}}function Do(e,t,r){return 0!==e.size&&function(e,t,r){var i=In.parentNode(t);return!!i&&e.has(i)}(e,t)}function Po(e,t){if(0===e.size)return!1;for(var r=In.parentNode(t);r;){if(e.has(r))return!0;r=In.parentNode(r)}return!1}var qo=function(e,t){return void 0===t&&(t="rrweb"),Lo?function(){try{return e(...arguments)}catch(e){if(Lo&&!0===Lo(e,t))return;throw e}}:e},jo=[];function Bo(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Ho(e,t){var r,i=new Fo;i.init(e);try{r=new(Mn())(qo(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(n.attributeFilter=e.attributeFilter),r.observe(t,n),jo.push(i),{observer:r,buffer:i}}catch(e){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(e){}throw e}}function $o(e){var t=e.scrollCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.sampling,s=new Map,u=e=>{var o=Bo(e);if(o&&!wo(o,n,a,!0)){var u,l,h=i.getId(o);if(o===r&&r.defaultView){var c=mo(r.defaultView);u=c.left,l=c.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(h)!==d&&(s.set(h,d),t({id:h,x:u,y:l}))}},l=[so("scroll",qo(vo(qo((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(so("scrollend",qo(u),r)),()=>l.forEach((e=>e()))}function Uo(e,t){for(var r=jo.length-1;r>=0;r--){var i=jo[r];if(i){var n=i.bufferBelongsToIframe(e);!n&&t&&t.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),jo.splice(r,1))}}}var Wo=["INPUT","TEXTAREA","SELECT"],zo=new WeakMap;function Vo(e){return function e(t,r){if(Jo("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Jo("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Jo("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Jo("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function Zo(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}var Qo=5e3;function Go(e,t){var r,i,n,a,o=e.stylesheetManager;a=e.mirror.getId("#document"===t.nodeName?t:In.host(t));var s="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=u.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),qo((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Yo(e,t){void 0===t&&(t={});var r,i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var r=e.mutationCb,i=e.mousemoveCb,n=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,h=e.styleDeclarationCb,c=e.canvasMutationCb,d=e.fontCb,v=e.selectionCb,f=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),c(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t);var a,o,s,u,l,c,d,v,f=[],p=qo((()=>{if(i){i.destroy(),i.reset();var t=jo.indexOf(i);-1!==t&&jo.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==r||r.disconnect(),f.forEach((e=>e()))}));try{if(e.recordDOM){var m=Ho(e,e.doc);r=m.observer,i=m.buffer}if(f.push(function(e){var t=e.mousemoveCb,r=e.sampling,i=e.doc,n=e.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=vo(qo((e=>{var r=Date.now()-a;t(u.map((e=>(e.timeOffset-=r,e))),e),u=[],a=null})),s),h=qo(vo(qo((e=>{var t=Bo(e),r=So(e)?e.changedTouches[0]:e,i=r.clientX,o=r.clientY;a||(a=po()),u.push({x:i,y:o,id:n.getId(t),timeOffset:po()-a}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?cn.Drag:e instanceof MouseEvent?cn.MouseMove:cn.TouchMove)})),o,{trailing:!1})),c=[so("mousemove",h,i),so("touchmove",h,i),so("drag",h,i)];return qo((()=>{c.forEach((e=>e()))}))}(e)),f.push(function(e){var t=e.mouseInteractionCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.sampling;if(!1===o.mouseInteraction)return()=>{};var s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,u=[],l=null;return Object.keys(dn).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((e=>{var o=wa(e),s=(e=>r=>{var o=Bo(r);if(!wo(o,n,a,!0)){var s=null,u=e;if("pointerType"in r){switch(r.pointerType){case"mouse":s=vn.Mouse;break;case"touch":s=vn.Touch;break;case"pen":s=vn.Pen}s===vn.Touch&&(dn[e]===dn.MouseDown?u="TouchStart":dn[e]===dn.MouseUp&&(u="TouchEnd"))}else So(r)&&(s=vn.Touch);null!==s?(l=s,(u.startsWith("Touch")&&s===vn.Touch||u.startsWith("Mouse")&&s===vn.Mouse)&&(s=null)):dn[e]===dn.Click&&(s=l,l=null);var c=So(r)?r.changedTouches[0]:r;if(c){var d=i.getId(o),v=c.clientX,f=c.clientY;qo(t)(h({type:dn[u],id:d,x:v,y:f},null!==s&&{pointerType:s}))}}})(e);if(window.PointerEvent)switch(dn[e]){case dn.MouseDown:case dn.MouseUp:o=o.replace("mouse","pointer");break;case dn.TouchStart:case dn.TouchEnd:return}u.push(so(o,s,r))})),qo((()=>{u.forEach((e=>e()))}))}(e)),f.push($o(e)),f.push(function(e,t){var r=e.viewportResizeCb,i=t.win,n=-1,a=-1;return so("resize",qo(vo(qo((()=>{var e=go(),t=yo();n===e&&a===t||(r({width:Number(t),height:Number(e)}),n=e,a=t)})),200)),i)}(e,{win:n})),f.push(function(e){var t=e.inputCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,l=e.maskInputFn,c=e.userTriggeredOnInput;function d(e){var t=Bo(e),i=e.isTrusted,h=r.defaultView;if(!t||!h||t instanceof h.HTMLElement){var d=t&&t.tagName;if(t&&"OPTION"===d&&(t=In.parentElement(t)),t&&d&&Wo.indexOf(d)>=0&&!wo(t,n,a,!0)&&!(t.classList.contains(o)||s&&t.matches(s))){var f=t.value,p=!1,m=xa(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(u[d.toLowerCase()]||u[m])&&(f=ba({element:t,maskInputOptions:u,tagName:d,type:m,value:f,maskInputFn:l})),v(t,c?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var g=t.name;"radio"===m&&g&&p&&r.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,c?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(e,r){var n=zo.get(e);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){zo.set(e,r);var a=i.getId(e);qo(t)(h({},r,{id:a}))}}var f=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>so(e,qo(d),r))),p=r.defaultView;if(!p)return()=>{f.forEach((e=>e()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>fo(e[0],e[1],{set(){qo(d)({target:this,isTrusted:!1})}},!1,p)))),qo((()=>{f.forEach((e=>e()))}))}(e)),f.push(function(e){var t=e.mediaInteractionCb,r=e.blockClass,i=e.blockSelector,n=e.mirror,a=e.sampling,o=e.doc,s=qo((e=>vo(qo((a=>{var o=Bo(a);if(o&&!wo(o,r,i,!0)){var s=o.currentTime,u=o.volume,l=o.muted,h=o.playbackRate,c=o.loop;t({type:e,id:n.getId(o),currentTime:s,volume:u,muted:l,playbackRate:h,loop:c})}})),a.media||500))),u=[so("play",s(pn.Play),o),so("pause",s(pn.Pause),o),so("seeked",s(pn.Seeked),o),so("volumechange",s(pn.VolumeChange),o),so("ratechange",s(pn.RateChange),o)];return qo((()=>{u.forEach((e=>e()))}))}(e)),e.recordDOM){var g=function(e){var t=new Map,r=new Set,i=!0,n=e=>{if(i)try{e()}catch(e){}},a=e=>{var r,i=t.get(e);if(i){for(;null==(r=i[0])?void 0:r.ready;){var a=i.shift();(null==a?void 0:a.emit)&&n(a.emit)}0===i.length&&t.delete(e)}};return{queueMutation(e,r){if(e){var i=t.get(e);i?(i.push({emit:r,ready:!0}),a(e)):n(r)}else n(r)},queuePendingMutation(o,s,u){if(!i)return()=>{};var l=t.get(o);l||t.set(o,l=[]);var h={emit:s,ready:!1};l.push(h);var c,d=!1,v=!1,f=()=>{d||v||(d=!0,void 0!==c&&r.delete(c),h.ready=!0,h.emit=void 0,a(o))};try{c=e.setTimeout(f,Qo),d||v?e.clearTimeout(c):r.add(c)}catch(e){f()}return t=>{!v&&i&&(v=!0,void 0!==c&&(e.clearTimeout(c),r.delete(c)),d?t&&n(u):(h.ready=!0,t||(h.emit=void 0),a(o)))}},reset(){i=!1,r.forEach((t=>e.clearTimeout(t))),r.clear(),t.clear()}}}(n);f.push(g.reset),f.push(function(e,t){var r=e.styleSheetRuleCb,i=e.mirror,n=e.stylesheetManager,a=t.win,o=t.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=Zo(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var u,l,h=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=Zo(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);try{var l=null==u?void 0:u.then;if(t.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(t);var h=Zo(t,i,n.styleMirror),c=h.id,d=h.styleId;if(!(c&&-1!==c||d&&-1!==d))return u;var v=o.queuePendingMutation(t,(()=>r({id:c,styleId:d,replace:s})),(()=>{var e=ha(t);null!==e&&r({id:c,styleId:d,replace:e})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(e){v(!1)}}catch(e){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=Zo(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,replaceSync:s}))),u}),"host")}));var c={};Ko("CSSGroupingRule")?c.CSSGroupingRule=a.CSSGroupingRule:(Ko("CSSMediaRule")&&(c.CSSMediaRule=a.CSSMediaRule),Ko("CSSConditionRule")&&(c.CSSConditionRule=a.CSSConditionRule),Ko("CSSSupportsRule")&&(c.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var t=e[0],a=e[1];d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t.parentStyleSheet);var l=Zo(t.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(t.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...Vo(t),u];o.queueMutation(t.parentStyleSheet,(()=>r({id:h,styleId:c,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t.parentStyleSheet);var l=Zo(t.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(t.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...Vo(t),s];o.queueMutation(t.parentStyleSheet,(()=>r({id:h,styleId:c,removes:[{index:d}]})))}return u}),"host")})})),qo((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=h,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n,mutationQueue:g})),f.push(Go(e,e.doc)),f.push(function(e,t){var r=e.styleDeclarationCb,i=e.mirror,n=e.ignoreCSSAttributes,a=e.stylesheetManager,o=t.win,s=t.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:qo(((e,t,o)=>{var u,l=o[0],h=o[1],c=o[2],d=e.apply(t,o);if(n.has(l))return d;var v=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(v);var f=Zo(v,i,a.styleMirror),p=f.id,m=f.styleId;if(p&&-1!==p||m&&-1!==m){var g=Vo(t.parentRule);s.queueMutation(v,(()=>r({id:p,styleId:m,set:{property:l,value:h,priority:c},index:g})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:qo(((e,t,o)=>{var u,l=o[0],h=e.apply(t,o);if(n.has(l))return h;var c=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(c);var d=Zo(c,i,a.styleMirror),v=d.id,f=d.styleId;if(v&&-1!==v||f&&-1!==f){var p=Vo(t.parentRule);s.queueMutation(c,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),qo((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n,mutationQueue:g})),e.collectFonts&&f.push(function(e){var t=e.fontCb,r=e.doc,i=r.defaultView;if(!i)return()=>{};var n=[],a=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return a.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var s=Tn(r.fonts,"add",(function(e){return function(r){return setTimeout(qo((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(s),qo((()=>{n.forEach((e=>e()))}))}(e))}for(var y of(f.push((o=(a=e).doc,s=a.mirror,u=a.blockClass,l=a.blockSelector,c=a.selectionCb,d=!0,(v=qo((()=>{var e=o.getSelection();if(!(!e||d&&(null==e?void 0:e.isCollapsed))){d=e.isCollapsed||!1;for(var t=[],r=e.rangeCount||0,i=0;r>i;i++){var n=e.getRangeAt(i),a=n.startContainer,h=n.startOffset,v=n.endContainer,f=n.endOffset;wo(a,u,l,!0)||wo(v,u,l,!0)||t.push({start:s.getId(a),startOffset:h,end:s.getId(v),endOffset:f})}c({ranges:t})}})))(),so("selectionchange",v))),f.push(function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?Tn(r.customElements,"define",(function(e){return function(r,i,n){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,i,n])}})):()=>{}}(e)),e.plugins))f.push(y.observer(y.callback,n,y.options))}catch(e){try{p()}catch(e){}throw e}return p}function Jo(e){return void 0!==window[e]}function Ko(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Xo{constructor(e){ln(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ln(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){if(0>t)return t;var n=r||this.getRemoteIdToLocalIdMap(e),a=i||this.getLocalIdToRemoteIdMap(e),o=n.get(t);return void 0===o&&(o=this.generateIdFn(),n.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getRemoteIdToLocalIdMap(e),i=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i;return"number"!=typeof t||0>t?t:null!==(i=(r||this.getLocalIdToRemoteIdMap(e)).get(t))&&void 0!==i?i:-1}getRemoteIds(e,t){var r=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(e),this.iframeLocalIdToRemoteIdMap.delete(e)}getRemoteIdToLocalIdMap(e){var t=this.iframeRemoteIdToLocalIdMap.get(e);return t||this.iframeRemoteIdToLocalIdMap.set(e,t=new Map),t}getLocalIdToRemoteIdMap(e){var t=this.iframeLocalIdToRemoteIdMap.get(e);return t||this.iframeLocalIdToRemoteIdMap.set(e,t=new Map),t}}class es{constructor(e){ln(this,"iframes",new WeakMap),ln(this,"crossOriginIframeMap",new WeakMap),ln(this,"crossOriginIframeMirror",new Xo(Ba)),ln(this,"crossOriginIframeStyleMirror"),ln(this,"crossOriginIframeRootIdMap",new WeakMap),ln(this,"mirror"),ln(this,"mutationCb"),ln(this,"wrappedEmit"),ln(this,"loadListener"),ln(this,"pageHideListener"),ln(this,"stylesheetManager"),ln(this,"recordCrossOriginIframes"),ln(this,"messageHandler"),ln(this,"nestedIframeListeners",new Map),ln(this,"attachedWindows",new WeakMap),ln(this,"attachedDocuments",new WeakMap),ln(this,"attachedIframes",new Map),ln(this,"loadListenerDisposers",new WeakMap),ln(this,"iframeElementsById",new Map),ln(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!==(t=null!==(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>lo(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{uo(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var n=this.attachedDocuments.get(e);n||this.attachedDocuments.set(e,n=new Set),n.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);lo((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}lo((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var i of r)if(i.win===t)return;var n=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",n),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:n})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case hn.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:hn.IncrementalSnapshot,data:{source:cn.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case hn.Meta:case hn.Load:case hn.DomContentLoaded:return!1;case hn.Plugin:return t;case hn.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case hn.IncrementalSnapshot:switch(t.data.source){case cn.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case cn.Drag:case cn.TouchMove:case cn.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case cn.ViewportResize:return!1;case cn.MediaInteraction:case cn.MouseInteraction:case cn.Scroll:case cn.CanvasMutation:case cn.Input:return this.replaceIds(t.data,e,["id"]),t;case cn.StyleSheetRule:case cn.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case cn.Font:return t;case cn.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case cn.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===mn.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(uo(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(uo(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((e=>{lo((()=>this.mirror.removeNodeFromMap(e)))})),lo((()=>Uo(r,a))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&uo(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{uo(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class ts{constructor(e){ln(this,"shadowDoms",new WeakSet),ln(this,"mutationCb"),ln(this,"scrollCb"),ln(this,"bypassOptions"),ln(this,"mirror"),ln(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var r,i;if(oa(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=null!==(r=null==(i=In.host(e))?void 0:i.ownerDocument)&&void 0!==r?r:t,a=Ho(h({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),o=a.observer,s=a.buffer;this.restoreHandlers.push({doc:n,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();var e=jo.indexOf(s);-1!==e&&jo.splice(e,1)}}),this.restoreHandlers.push({doc:n,handler:$o(h({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(In.host(e))),this.restoreHandlers.push({doc:n,handler:Go({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)})}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push({doc:t,handler:Tn(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),a=In.shadowRoot(this);return a&&Eo(this)&&r.addShadowRoot(a,t),n}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}var rs="skip-frame";function is(e){if("object"!=typeof e||null===e)return!1;var t=e.y,r=e.width,i=e.height;return Number.isFinite(e.x)&&Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",as="undefined"==typeof Uint8Array?[]:new Uint8Array(256),os=0;64>os;os++)as[ns.charCodeAt(os)]=os;var ss=new Map,us=(e,t,r)=>{if(e&&(cs(e,t)||"object"==typeof e)){var i=function(e,t){var r=ss.get(e);return r||ss.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function ls(e,t,r,i){if(e instanceof Array)return e.map((e=>ls(e,t,r,i)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var n=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;i>t;t+=3)n+=ns[r[t]>>2],n+=ns[(3&r[t])<<4|r[t+1]>>4],n+=ns[(15&r[t+1])<<2|r[t+2]>>6],n+=ns[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e);return{rr_type:n,base64:a}}return e instanceof DataView?{rr_type:e.constructor.name,args:[ls(e.buffer,t,r,i),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(i.type,i.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[ls(e.data,t,r,i),e.width,e.height]}:cs(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:us(e,t,r)}:e}var hs=(e,t,r,i)=>e.map((e=>ls(e,t,r,i))),cs=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},ds=["webgl","webgl2"];function vs(e){return"nodeType"in e}function fs(e,t,r,i){var n=[];try{if(i){var a=function(e,t,r){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return Tn(i.prototype,"configure",(function(i){return function(n){var a=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!a||vs(a)&&wo(a,t,r,!0))return i.call(this,n);vs(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==o&&n?h({},n,{usage:"number"==typeof n.usage?n.usage|o:o}):n)}}))}(e,t,r);a&&n.push(a)}var o=Tn(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(n),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!wo(this,t,r,!0)&&("__context"in this||(this.__context=a),i&&ds.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[n,...s])}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function ps(e,t,r,i,n,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=Tn(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),h=0;s>h;h++)l[h]=arguments[h];var c=e.apply(this,l);if(us(c,a,this),this.canvas&&"tagName"in this.canvas&&!wo(this.canvas,i,n,!0)){var d=hs(l,a,this,o);r(this.canvas,{type:t,property:u,args:d})}return c}}));s.push(l)}catch(a){var h=fo(e,u,{set(e){this.canvas&&"tagName"in this.canvas&&!wo(this.canvas,i,n,!0)&&r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(h)}};for(var h of u)l(h);return s}var ms,gs,ys,bs='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',ws="undefined"!=typeof self&&self.Blob&&new Blob([bs],{type:"text/javascript;charset=utf-8"});function ks(e){var t;try{if(!(t=ws&&(self.URL||self.webkitURL).createObjectURL(ws)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(bs),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class _s{constructor(e){ln(this,"pendingCanvasMutations",new Map),ln(this,"rafStamps",{latestId:0,invokeId:null}),ln(this,"mirror"),ln(this,"mutationCb"),ln(this,"resetObservers"),ln(this,"frozen",!1),ln(this,"locked",!1),ln(this,"rafIdTimestamp",null),ln(this,"rafIdFlush",null),ln(this,"refCount",0),ln(this,"torndown",!1),ln(this,"resetFrameDedup",null),ln(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,i=e.win,n=e.blockClass,a=e.blockSelector,o=e.recordCanvas,s=e.dataURLOptions,u=e.resolutionScale,l=e.canvasMasking;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,a,s),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,a,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}onFullSnapshot(){var e;null==(e=this.resetFrameDedup)||e.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){var a=this;if("OffscreenCanvas"in t){var o,s="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=fs(t,r,i,!0),h=new Map;try{o=new ks}catch(e){return}var c=!1;o.onerror=()=>{var e;c=!0,cancelAnimationFrame(d),null==(e=o.terminate)||e.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=e=>{var t=e.data.id;if(h.set(t,!1),"base64"in e.data){var r=e.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:t,type:fn["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var d,v=1e3/e,f=0,p=e=>{var u,m;c||(f&&v>e-f||(f=e,(u=[],m=e=>{try{e.querySelectorAll("canvas").forEach((e=>{wo(e,r,i,!0)||u.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&m(e.shadowRoot)}))}catch(e){}},m(t.document),u).forEach(function(){var e=l((function*(e){var t,r,i=a.mirror.getId(e);if(!h.get(i)&&0!==e.width&&0!==e.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var u=e.getContext(e.__context);if(null==(t=null==u?void 0:u.isContextLost)?void 0:t.call(u))return void h.set(i,!1);!1===(null==(r=null==u?void 0:u.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&u.clear(u.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,c=e.clientHeight||e.height,d=Math.max(1,Math.round(l*s)),v=Math.max(1,Math.round(c*s)),f=function(e,t,r,i,n,a){if(e&&"function"==typeof e.regionsFn){var o;try{o=e.regionsFn(t)}catch(e){return rs}if(void 0!==o){if(!Array.isArray(o)||!o.every(is))return rs;var s=r/n,u=i/a;return o.filter((e=>e.width>0&&e.height>0)).map((e=>{var t=Math.floor(e.x*s),r=Math.floor(e.y*u);return{x:t,y:r,width:Math.ceil((e.x+e.width)*s)-t,height:Math.ceil((e.y+e.height)*u)-r}}))}}}(n.canvasMasking,e,d,v,l,c);if(f===rs)return void h.set(i,!1);var p=yield createImageBitmap(e,1>s?{resizeWidth:d,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:v});o.postMessage({id:i,bitmap:p,width:d,height:v,displayWidth:l,displayHeight:c,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(e){h.set(i,!1)}}}));return function(t){return e.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var e;u(),cancelAnimationFrame(d),null==(e=o.terminate)||e.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=fs(e,t,r,!1),a=function(e,t,r,i,n){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=Tn(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return wo(this.canvas,r,i,!0)||setTimeout((()=>{var r=hs(u,t,this,n);e(this.canvas,{type:fn["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(n){var u=fo(t.CanvasRenderingContext2D.prototype,o,{set(t){wo(this.canvas,r,i,!0)||e(this.canvas,{type:fn["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i),o=function(e,t,r,i,n){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...ps(t.WebGLRenderingContext.prototype,fn.WebGL,e,r,i,t,n)),void 0!==t.WebGL2RenderingContext&&a.push(...ps(t.WebGL2RenderingContext.prototype,fn.WebGL2,e,r,i,t,n)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i);this.resetObservers=()=>{n(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var i=r.map((e=>{var t=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,sn);return t}));this.mutationCb({id:t,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(e)}}}}class Ss{constructor(e){var t;ln(this,"trackedLinkElements",new WeakSet),ln(this,"pendingDeferredSheets",new Set),ln(this,"mutationCb"),ln(this,"adoptedStyleSheetCb"),ln(this,"maskAllElementAttributes"),ln(this,"maskAttributeFn"),ln(this,"styleMirror",new To),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(t=e.maskAllElementAttributes)&&void 0!==t&&t,this.maskAttributeFn=e.maskAttributeFn}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}beginDeferredLinkInlining(e,t){if(-1===t||!e.isConnected)return null;var r=null,i=null;try{(i=e.sheet)&&(r=ga(i))}catch(e){}if(!r||!i)return ra(),null;var n=r,a=!1,o={sheet:i,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,h=Rn(),c=Fn(),d=!0;try{if(a)return s=!0,ra(),!0;if(!n.advance(r))return d=!1,!1;s=!0;var v=n.text();if(!e.isConnected)return!0;var f=null;try{f=e.sheet}catch(e){}return f!==i?(ra(),!0):v?(this.emitCssTextMutation(e,t,v),!0):(ra(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),Nn(u=Rn()-h,null!=(l=c)?l:An)||(Vn.totalMs+=u,u>Vn.slowestSliceMs&&(Vn.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(e){if(e&&0!==this.pendingDeferredSheets.size)for(var t of this.pendingDeferredSheets)t.sheet===e&&(this.pendingDeferredSheets.delete(t),t.invalidate())}inlineDeferredLinkElement(e,t){var r;null==(r=this.beginDeferredLinkInlining(e,t))||r.advance(1/0)}emitCssTextMutation(e,t,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t,attributes:{_cssText:_a({element:e,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],a=function(e){var t;if(r.styleMirror.has(e))t=r.styleMirror.getId(e);else{var a=r.styleMirror.add(e);t=a;var o=Rn();try{Xn((()=>{try{var t=e.rules||e.cssRules;t&&Kn(t)}catch(e){}n.push({styleId:a,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:ca(t,e.href),index:r})))})}))}finally{ea(Rn()-o)}}i.styleIds.push(t)};for(var o of e)a(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Ka.forEach((e=>e.abort())),Ka.clear()}trackStylesheetInLinkElement(e){}}class xs{constructor(){ln(this,"nodeMap",new WeakMap),ln(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Cs=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Ms=document.createElement("iframe");document.body.appendChild(Ms),Array.from=(null==(on=Ms.contentWindow)?void 0:on.Array.from)||Array.from,document.body.removeChild(Ms)}}catch(e){console.debug("Unable to override Array.from",e)}var Ts=new ya,Is=new Set([cn.Mutation,cn.MediaInteraction,cn.StyleSheetRule,cn.CanvasMutation,cn.Font,cn.Log,cn.StyleDeclaration,cn.AdoptedStyleSheet]);function Es(e){var t=window;if("function"==typeof t.requestIdleCallback){var r=t.requestIdleCallback(e,{timeout:2e3});return{cancel(){var e;return null==(e=t.cancelIdleCallback)?void 0:e.call(t,r)}}}var i=setTimeout(e,250);return{cancel:()=>clearTimeout(i)}}function Rs(e){var t;void 0===e&&(e={});var r=e,i=r.emit,n=r.checkoutEveryNms,a=r.checkoutEveryNth,o=r.blockClass,s=void 0===o?"rr-block":o,u=r.blockSelector,l=void 0===u?null:u,c=r.ignoreClass,d=void 0===c?"rr-ignore":c,v=r.ignoreSelector,f=void 0===v?null:v,p=r.maskTextClass,m=void 0===p?"rr-mask":p,g=r.maskTextSelector,y=void 0===g?null:g,b=r.inlineStylesheet,w=void 0===b||b,k=r.inlineStylesheetBudgetRules,_=r.maskAllInputs,S=r.maskInputOptions,x=r.slimDOMOptions,C=r.maskInputFn,M=r.maskTextFn,T=r.maskAllElementAttributes,I=void 0!==T&&T,E=r.maskAttributeFn,R=r.hooks,A=r.packFn,L=r.sampling,O=void 0===L?{}:L,F=r.dataURLOptions,N=void 0===F?{}:F,D=r.canvasResolutionScale,P=r.canvasMasking,q=r.mousemoveWait,j=r.recordDOM,B=void 0===j||j,H=r.recordCanvas,U=void 0!==H&&H,W=r.recordCrossOriginIframes,z=void 0!==W&&W,V=r.recordAfter,Z=void 0===V?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":V,Q=r.userTriggeredOnInput,G=void 0!==Q&&Q,Y=r.collectFonts,J=void 0!==Y&&Y,K=r.inlineImages,X=void 0!==K&&K,ee=r.plugins,te=r.keepIframeSrcFn,re=void 0===te?()=>!1:te,ie=r.ignoreCSSAttributes,ne=void 0===ie?new Set([]):ie,ae=r.attributeFilter;Lo=r.errorHandler;var oe=h({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},N),se=!z||window.parent===window,ue=!1;if(!se)try{window.parent.document&&(ue=!1)}catch(e){ue=!0}if(se&&!i)throw new Error("emit function is required");if(!se&&!ue)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Ts.reset();var le,he=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},ce=ao(void 0!==x&&x);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var de,ve,fe=0,pe=new Map,me=e=>{for(var t of ee||[])t.eventProcessor&&(e=t.eventProcessor(e));return A&&!ue&&(e=A(e)),e};ms=(e,t)=>{var r,o=e;if(o.timestamp=po(),!(null==(r=jo[0])?void 0:r.isFrozen())||o.type===hn.FullSnapshot||o.type===hn.IncrementalSnapshot&&Is.has(o.data.source)||jo.forEach((e=>e.unfreeze())),se)null==i||i(me(o),t);else if(ue){var s={type:"rrweb",event:me(o),origin:window.location.origin,isCheckout:t};window.parent.postMessage(s,"*")}if(o.type===hn.FullSnapshot)le=o,fe=0;else if(o.type===hn.IncrementalSnapshot){if(o.data.source===cn.Mutation&&o.data.isAttachIframe)return;fe++,(a&&fe>=a||n&&o.timestamp-le.timestamp>n)&&gs(!0)}};var ge=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,r=new Set;if(e.adds.length>0)for(var i of e.adds){var n=Ts.getNode(i.node.id);n&&"IFRAME"===n.nodeName&&r.add(n)}e.removes.forEach((e=>{var i=e.id;if(!t||!t.has(i)){var n=ke.getIframeElementById(i);n&&r.has(n)?ke.forgetIframeId(i):(null==de||de(i),ke.removeIframeById(i))}})),null==ve||ve(),ke.cleanupDetachedIframes()}ms({type:hn.IncrementalSnapshot,data:h({source:cn.Mutation},e)})},ye=e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.Scroll},e)}),be=e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.CanvasMutation},e)}),we=new Ss({mutationCb:ge,adoptedStyleSheetCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.AdoptedStyleSheet},e)}),maskAllElementAttributes:I,maskAttributeFn:E}),ke=new es({mirror:Ts,mutationCb:ge,stylesheetManager:we,recordCrossOriginIframes:z,wrappedEmit:ms});for(var _e of ee||[])_e.getMirror&&_e.getMirror({nodeMirror:Ts,crossOriginIframeMirror:ke.crossOriginIframeMirror,crossOriginIframeStyleMirror:ke.crossOriginIframeStyleMirror});var Se=new xs,xe=null==P?void 0:P.configured;ys=new _s({recordCanvas:U,mutationCb:be,win:window,blockClass:s,blockSelector:l,mirror:Ts,sampling:O.canvas,dataURLOptions:oe,resolutionScale:D,canvasMasking:P});var Ce=new ts({mutationCb:ge,scrollCb:ye,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:w,maskInputOptions:he,dataURLOptions:oe,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,sampling:O,slimDOMOptions:ce,iframeManager:ke,stylesheetManager:we,canvasManager:ys,keepIframeSrcFn:re,processedNodeManager:Se,attributeFilter:ae},mirror:Ts});gs=function(e){if(void 0===e&&(e=!1),B){Qn(k);try{ms({type:hn.Meta,data:{href:window.location.href,width:yo(),height:go()}},e),null==t||t.cancel(),t=void 0,we.reset(),Ce.init(),jo.forEach((e=>e.lock()));var r,i=null;try{i=function(e,t){var r=t||{},i=r.mirror,n=void 0===i?new ya:i,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,h=void 0===l?"rr-mask":l,c=r.maskTextSelector,d=void 0===c?null:c,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,m=void 0!==p&&p,g=r.recordCanvas,y=void 0!==g&&g,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,_=r.maskTextFn,S=r.maskInputFn,x=r.maskAllElementAttributes,C=void 0!==x&&x,M=r.maskAttributeFn,T=r.slimDOM,I=r.dataURLOptions,E=r.preserveWhiteSpace,R=r.onSerialize,A=r.onIframeLoad,L=r.iframeLoadTimeout,O=r.onIframeListenerRegistered,F=r.onStylesheetLoad,N=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,P=void 0===D?()=>!1:D,q=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===k?{password:!0}:k,H=ao(void 0!==T&&T);Qn(j);try{return no(e,{doc:e,mirror:n,blockClass:o,blockSelector:u,maskTextClass:h,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:M,slimDOMOptions:H,dataURLOptions:I,inlineImages:m,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:L,onIframeListenerRegistered:O,onStylesheetLoad:F,stylesheetLoadTimeout:N,keepIframeSrcFn:P,newlyAddedElement:!1,maxDepth:q})}finally{Gn()}}(document,{mirror:Ts,blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:w,maskAllInputs:he,inlineStylesheetBudgetRules:k,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:ce,dataURLOptions:oe,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,onSerialize(e){xo(e,Ts)&&ke.addIframe(e),Co(e,Ts)&&we.trackLinkElement(e),Mo(e)&&Ce.addShadowRoot(In.shadowRoot(e),document)},onIframeLoad(e,t){ke.attachIframe(e,t),Ce.observeAttachShadow(e)},onIframeListenerRegistered(e,t){ke.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){we.attachLinkElement(e,t)},keepIframeSrcFn:re})}finally{a=$n,$n=[],r=a}if(!i)return console.warn("Failed to snapshot the document");if(ms({type:hn.FullSnapshot,data:{node:i,initialOffset:mo(window)}},e),jo.forEach((e=>e.unlock())),ys.onFullSnapshot(),r.length){var n=function(e,t,r){var i=!1,n=null,a=0,o=null,s=()=>null!==o||e.length>a,u=()=>{var r=e[a];e[a]=null,a+=1,r&&lo((()=>{o=t.beginDeferredLinkInlining(r,Ts.getId(r))}))},l=()=>{if(o){var e=o,t=!0;lo((()=>{t=e.advance(200)})),t&&(o=null)}},h=e=>{if(n=null,!i){var t=0;do{try{o||u(),l()}catch(e){null==o||o.discard(),o=null,ia(1)}t+=1}while(!i&&s()&&(e?!e.didTimeout&&e.timeRemaining()>5:10>t));i||(s()?n=Es(h):r())}};return n=Es(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var t=0,h=0;s()&&50>t;){o||u();var c=o;if(c)if(Math.floor(c.remainingRules()/200)+1>50-t)c.discard(),o=null,h+=1;else{try{l()}catch(e){null==o||o.discard(),o=null,h+=1}t+=1}}if(s()||h>0){for(var d=h+(null!==o?1:0),v=a;e.length>v;v++)null!==e[v]&&(d+=1);ia(d),null==o||o.discard(),o=null}r()}}}}(r,we,(()=>{t===n&&(t=void 0)}));t=n}z&&ke.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&we.adoptStyleSheets(document.adoptedStyleSheets,Ts.getId(document))}finally{Gn()}var a}};try{var Me=[];for(var Te of(Me.push(so("pagehide",(()=>{try{null==t||t.flush()}catch(e){}t=void 0}),window)),["visibilitychange","freeze","resume"]))Me.push(so(Te,On,document));de=e=>{var t=pe.get(e);t&&(t.forEach((e=>{lo(e);var t=Me.indexOf(e);-1!==t&&Me.splice(t,1)})),pe.delete(e))},ve=()=>{for(var e of pe){var t=e[0],r=Ts.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==de||de(t)}catch(e){null==de||de(t)}else null==de||de(t)}};var Ie=e=>{var t;return qo(Yo)({mutationCb:ge,mousemoveCb:(e,t)=>ms({type:hn.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.MouseInteraction},e)}),scrollCb:ye,viewportResizeCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.ViewportResize},e)}),inputCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.Input},e)}),mediaInteractionCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.MediaInteraction},e)}),styleSheetRuleCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.StyleSheetRule},e)}),styleDeclarationCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.StyleDeclaration},e)}),canvasMutationCb:be,fontCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.Font},e)}),selectionCb(e){ms({type:hn.IncrementalSnapshot,data:h({source:cn.Selection},e)})},customElementCb(e){ms({type:hn.IncrementalSnapshot,data:h({source:cn.CustomElement},e)})},blockClass:s,ignoreClass:d,ignoreSelector:f,maskTextClass:m,maskTextSelector:y,maskInputOptions:he,inlineStylesheet:w,sampling:O,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,userTriggeredOnInput:G,collectFonts:J,doc:e,maskInputFn:C,maskTextFn:M,maskAllElementAttributes:I,maskAttributeFn:E,keepIframeSrcFn:re,blockSelector:l,slimDOMOptions:ce,dataURLOptions:oe,mirror:Ts,iframeManager:ke,stylesheetManager:we,shadowDomManager:Ce,processedNodeManager:Se,canvasManager:ys,ignoreCSSAttributes:ne,attributeFilter:ae,plugins:(null==(t=null==ee?void 0:ee.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>ms({type:hn.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},R)};ke.addLoadListener((e=>{try{var t=Ts.getId(e),r=Ie(e.contentDocument);if("function"==typeof r&&(Me.push(r),-1!==t)){var i=pe.get(t);i||pe.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}})),ke.addPageHideListener((e=>{var t=Ts.getId(e);null==de||de(t),Uo(e)}));var Ee=-1,Re=e=>ms({type:hn.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),Ae=()=>{var e,t,r,i,n=document,a=null!==(e=null!==(t=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==t?t:n.msFullscreenElement)&&void 0!==e?e:null,o=a?Ts.getId(a):-1;o!==Ee&&(-1!==Ee&&Re({id:Ee,enter:!1}),Ee=o,-1!==o&&Re({id:o,enter:!0}))},Le=()=>{gs();var e=Ie(document);"function"==typeof e&&Me.push(e),Me.push(so("fullscreenchange",Ae)),Me.push(so("webkitfullscreenchange",Ae)),Me.push(so("mozfullscreenchange",Ae)),Me.push(so("MSFullscreenChange",Ae)),Cs=!0};return["interactive","complete"].includes(document.readyState)?Le():(Me.push(so("DOMContentLoaded",(()=>{ms({type:hn.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&Le()}))),Me.push(so("load",(()=>{ms({type:hn.Load,data:{}}),"load"===Z&&Le()}),window))),()=>{try{null==t||t.flush()}catch(e){}t=void 0,Me.forEach((e=>lo(e))),Se.destroy(),ke.removeLoadListener(),ke.destroy(),pe.clear(),Ce.reset(),Ts.reset(),Cs=!1,Lo=void 0}}catch(e){console.warn(e)}}Rs.addCustomEvent=(e,t)=>{if(!Cs)throw new Error("please add custom event after start recording");ms({type:hn.Custom,data:{tag:e,payload:t}})},Rs.freezePage=()=>{jo.forEach((e=>e.freeze()))},Rs.takeFullSnapshot=e=>{if(!Cs)throw new Error("please take full snapshot after start recording");gs(e)},Rs.mirror=Ts;var As=Object.defineProperty,Ls=(e,t,r)=>((e,t,r)=>t in e?As(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Os{constructor(e){Ls(this,"fileName"),Ls(this,"functionName"),Ls(this,"lineNumber"),Ls(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Fs=/(^|@)\S+:\d+/,Ns=/^\s*at .*(\S+:\d+|\(native\))/m,Ds=/^(eval@)?(\[native code])?$/,Ps={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ns)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ns)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),a=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Os({functionName:a,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Ds)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Os({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new Os({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,a=r.length;a>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Os({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,a=r.length;a>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Os({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Fs)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Os({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function qs(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var a=0;i.children.length>a;a++){var o=i.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function js(e){return Array.isArray(e)}function Bs(e){return"object"==typeof e&&null!==e&&!js(e)}function Hs(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Bs(e[i])&&Hs(e[i],t-1))return!0;return!1}function $s(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var a=i.indexOf(this);~a?i.splice(a+1):i.push(this),~a?n.splice(a,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Bs(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Bs(o)&&Hs(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=js(l)?qs(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Us={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Ws(e,t,r){var i,n=r?Object.assign({},Us,r):Us,a=n.logger;if(!a)return()=>{};i="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(n.level.includes("error")){var l=t=>{var r=t.message,i=Ps.parse(t.error).map((e=>e.toString())),a=[$s(r,n.stringifyOptions)];e({level:"error",trace:i,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var h=t=>{var r,i;t.reason instanceof Error?i=[$s("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[$s("Uncaught (in promise)",n.stringifyOptions),$s(t.reason,n.stringifyOptions)]);var a=Ps.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:i})};t.addEventListener("unhandledrejection",h),u.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((e=>e()))};function d(t,r){var i=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],h={next:l},c=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(i,u),!("assert"===r&&u[0]||s)){s=!0;try{var h=Ps.parse(new Error).map((e=>e.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((e=>$s(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:c}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[$s("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return h.next.apply(this,t)}));return"function"==typeof c&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),t[a]=c,()=>{if(t[a]!==c)for(var e=t[a];"function"==typeof e&&e.__rrweb_layer__;){var r=e.__rrweb_layer__;if(r.next===c)return void(r.next=h.next);e=r.next}else t[a]=h.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var zs=e=>({name:"rrweb/console@1",observer:Ws,options:e}),Vs=e=>"undefined"!=typeof Document&&e instanceof Document,Zs=()=>{};function Qs(e,t,r){try{if(!(t in e))return Zs;var i={next:e[t]},n=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return M(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=n,()=>{if(e[t]!==n)for(var r=e[t];M(r)&&r.__posthog_layer__;){var a=r.__posthog_layer__;if(a.next===n)return void(a.next=i.next);r=a.next}else e[t]=i.next}}catch(e){return Zs}}function Gs(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var a of t.payloadHostDenyList)if(i.endsWith(a))return{hostname:i,isHostDenied:!0};return n}var Ys=Oe("[Recorder]"),Js=e=>"navigation"===e.entryType,Ks=e=>"resource"===e.entryType;function Xs(e,t){return!!t&&(F(t)||t[e])}function eu(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var tu=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function ru(e){var t=e.type,r=e.recordBody,i=e.headers;function n(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!eu(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(n(tu))return!1;if(F(r))return!0;if(C(r))return n(r);var a=r[t];return F(a)?a:n(a)}function iu(e,t,r,i,n,a){return nu.apply(this,arguments)}function nu(){return nu=l((function*(e,t,r,i,n,a){if(void 0===a&&(a=0),a>10)return Ys.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if(Ks(o=e[a])&&o.initiatorType===t&&(I(i)||o.startTime>=i)&&(I(n)||n>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),iu(e,t,r,i,n,a+1))})),nu.apply(this,arguments)}function au(e){var t=e.body,r=e.options,i=e.url;if(L(t))return null;var n=Gs(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(E(t))return t;if(Vs(t))return t.textContent;if(N(t))return Be(t);if(T(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var ou=e=>!A(e)&&("navigation"===e.entryType||"resource"===e.entryType);function su(e){var t=e.entry,r=e.method,i=e.status,n=e.networkRequest,a=e.isInitial,o=e.start,s=e.end,u=e.url,l=e.initiatorType;o=t?t.startTime:o,s=t?t.responseEnd:s;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(o||0)),v=[h({},t?t.toJSON():{name:u},{startTime:I(o)?void 0:Math.round(o),endTime:I(s)?void 0:Math.round(s),timeOrigin:c,timestamp:d,method:r,initiatorType:l||(t?t.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:a})];if(ou(t))for(var f of t.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var uu=["video/","audio/"];function lu(e){return T(e)&&M(e.getReader)&&M(e.tee)}var hu=500,cu="[SessionReplay] Timeout while trying to read body",du="[SessionReplay] Failed to read body";function vu(e){return du+": "+e}function fu(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function pu(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(cu)),hu);try{e.clone().text().then((e=>t(e)),(e=>t(vu(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(du)}}))}(e);var r=wt(t);return function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>t}catch(e){return!1}}(e,r)?Promise.resolve(fu(r)):function(e,t){return new Promise((r=>{var i,n=!1;function a(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){n||(n=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(cu)),hu);try{s=e.clone()}catch(e){return void o(du)}var l=s.body;if(lu(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(e){return void o(du)}var h=[],c=0;!function e(){i.read().then((r=>{var i=r.done,s=r.value;if(n)a();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var n of e)r.set(n,i),i+=n.byteLength;return r}(h,c)));else{if(s){if(c+s.byteLength>t)return void o(fu(t));c+=s.byteLength,h.push(s)}e()}}),(e=>o(vu(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(vu(e))))}catch(e){o(du)}}))}(e,r)}function mu(){return mu=l((function*(e){var t=e.r,r=e.options,i=Gs(e.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):pu(t,r)})),mu.apply(this,arguments)}function gu(){return gu=l((function*(e){var t=e.r,r=e.options,i=function(e){var t,r=e.r,i=e.options,n=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=uu.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var s=Gs(n,i);return s.isHostDenied?s.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return A(i)?pu(t,r):Promise.resolve(i)})),gu.apply(this,arguments)}var yu=null;function bu(e,t,r){if(!("performance"in t))return()=>{};if(yu)return Ys.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},kt,r):kt,n=t=>{var r=[],n=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!n){var a=i.maskRequestFn(e);t||(n=!a||(e=>!!e&&Et.has(e))(a)),a&&r.push(a)}})),r.length>0&&e(h({},t,{requests:r}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Js(e)||Ks(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>su({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>Js(e)||Ks(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>su({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:a}),()=>{n.disconnect()}}(n,t,i),o=()=>{},s=()=>{};return(i.recordHeaders||i.recordBody)&&(o=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Xs("request",r.recordHeaders),n=Xs("response",r.recordHeaders),a=Qs(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,h){void 0===u&&(u=!0);var c=this;try{var d,v,f=new Request(s),p={},m={},g=c.setRequestHeader.bind(c);c.setRequestHeader=(e,t)=>(m[e]=t,g(e,t)),i&&(p.requestHeaders=m);var y=c.send.bind(c);c.send=e=>(ru({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=au({body:e,options:r,url:s})),d=t.performance.now(),y(e));var b=()=>{c.removeEventListener("readystatechange",w),c.removeEventListener("error",b),c.removeEventListener("abort",b),c.removeEventListener("timeout",b)},w=()=>{if(c.readyState===c.DONE){b(),v=t.performance.now();var i={};c.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),ru({type:"response",headers:i,url:s,recordBody:r.recordBody})&&(p.responseBody=au({body:c.response,options:r,url:s})),iu(t,"xmlhttprequest",f.url,d,v).then((t=>{var r=su({entry:t,method:o,status:null==c?void 0:c.status,networkRequest:p,start:d,end:v,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};c.addEventListener("readystatechange",w),c.addEventListener("error",b),c.addEventListener("abort",b),c.addEventListener("timeout",b)}catch(e){Ys.error("Failed to instrument XHR for network capture",e)}a.call(c,o,s.toString(),u,l,h)}));return()=>{a()}}(n,t,i),s=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=Xs("request",r.recordHeaders),n=Xs("response",r.recordHeaders),a=Qs(t,"fetch",(a=>function(){var o=l((function*(o,s){var u,l;try{u=new Request(o,s)}catch(e){return Ys.error("Failed to instrument fetch for network capture",e),a(o,s)}var h,c,d={};try{try{var v={};u.headers.forEach(((e,t)=>{v[t]=e})),i&&(d.requestHeaders=v),!lu(null==s?void 0:s.body)&&ru({type:"request",headers:v,url:o,recordBody:r.recordBody})&&(d.requestBody=yield function(e){return mu.apply(this,arguments)}({r:u,options:r,url:o}))}catch(e){Ys.error("Failed to record fetch request for network capture",e)}h=t.performance.now(),l=eu(o)?yield a(u):yield a(o,s),c=t.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),n&&(d.responseHeaders=f),ru({type:"response",headers:f,url:o,recordBody:r.recordBody})&&(d.responseBody=yield function(e){return gu.apply(this,arguments)}({r:l,options:r,url:o})),l}finally{iu(t,"fetch",u.url,h,c).then((t=>{var r,i=su({entry:t,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:h,end:c,url:u.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return o.apply(this,arguments)}}()));return()=>{a()}}(n,t,i)),yu=()=>{a(),o(),s(),yu=null}}var wu=e=>({name:"rrweb/network@1",observer:bu,options:e});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:zs,getRecordNetworkPlugin:wu},s.__PosthogExtensions__.rrweb={record:Rs,version:"v2",wasMaxDepthReached:()=>io,resetMaxDepthState(){io=!1,ro=!1},getLastSnapshotCost:()=>Bn,getMutationCost:()=>h({},zn),resetSnapshotCostState(){Dn=0,Pn=0,qn=0,An=0,jn=En(),Bn=null,Hn=null,$n=[],Un=0,Wn=0,zn={slowestBatchMs:0},Vn={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:Rs,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:zs},s.getRecordNetworkPlugin=wu,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(e,t)=>new an(e,t);var ku,_u,Su,xu,Cu,Mu,Tu,Iu,Eu,Ru,Au,Lu,Ou,Fu,Nu,Du={},Pu=[],qu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ju=Array.isArray;function Bu(e,t){for(var r in t)e[r]=t[r];return e}function Hu(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function $u(e,t,r){var i,n,a,o={};for(a in t)"key"==a?i=t[a]:"ref"==a?n=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?ku.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return Uu(e,o,i,n,null)}function Uu(e,t,r,i,n){var a={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Su:n,__i:-1,__u:0};return null==n&&null!=_u.vnode&&_u.vnode(a),a}function Wu(e){return e.children}function zu(e,t){this.props=e,this.context=t}function Vu(e,t){if(null==t)return e.__?Vu(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Vu(e):null}function Zu(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],a=Bu({},t);a.__v=t.__v+1,_u.vnode&&_u.vnode(a),il(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?Vu(t):r,!!(32&t.__u),n),a.__v=t.__v,a.__.__k[a.__i]=a,al(i,a,n),t.__e=t.__=null,a.__e!=r&&Qu(a)}}function Qu(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),Qu(e)}function Gu(e){(!e.__d&&(e.__d=!0)&&xu.push(e)&&!Yu.__r++||Cu!=_u.debounceRendering)&&((Cu=_u.debounceRendering)||Mu)(Yu)}function Yu(){try{for(var e,t=1;xu.length;)xu.length>t&&xu.sort(Tu),e=xu.shift(),t=xu.length,Zu(e)}finally{xu.length=Yu.__r=0}}function Ju(e,t,r,i,n,a,o,s,u,l,h){var c,d,v,f,p,m,g,y=i&&i.__k||Pu,b=t.length;for(u=function(e,t,r,i,n){var a,o,s,u,l,h=r.length,c=h,d=0;for(e.__k=new Array(n),a=0;n>a;a++)null!=(o=t[a])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[a]=Uu(null,o,null,null,null):ju(o)?o=e.__k[a]=Uu(Wu,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[a]=Uu(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,u=a+d,o.__=e,o.__b=e.__b+1,s=null,-1!=(l=o.__i=Xu(o,r,u,c))&&(c--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):e.__k[a]=null;if(c)for(a=0;h>a;a++)null!=(s=r[a])&&0==(2&s.__u)&&(s.__e==i&&(i=Vu(s)),ul(s,s));return i}(r,t,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1!=v.__i&&y[v.__i]||Du,v.__i=c,m=il(e,v,d,n,a,o,s,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&sl(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(g=!!(4&v.__u))||d.__k===v.__k?(u=Ku(v,u,e,g),g&&d.__e&&(d.__e=null)):"function"==typeof v.type&&void 0!==m?u=m:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Ku(e,t,r,i){var n,a;if("function"==typeof e.type){for(n=e.__k,a=0;n&&n.length>a;a++)n[a]&&(n[a].__=e,t=Ku(n[a],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=Vu(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Xu(e,t,r,i){var n,a,o,s=e.key,u=e.type,l=t[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==s||h&&s==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,a=r+1;n>=0||t.length>a;)if(null!=(l=t[o=0>n?a++:n--])&&0==(2&l.__u)&&s==l.key&&u==l.type)return o;return-1}function el(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||qu.test(t)?r:r+"px"}function tl(e,t,r,i,n){var a,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||el(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||el(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(Au,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?i?r[Ru]=i[Ru]:(r[Ru]=Lu,e.addEventListener(t,a?Fu:Ou,a)):e.removeEventListener(t,a?Fu:Ou,a);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function rl(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[Eu])t[Eu]=Lu++;else if(r[Ru]>t[Eu])return;return r(_u.event?_u.event(t):t)}}}function il(e,t,r,i,n,a,o,s,u,l){var h,c,d,v,f,p,m,g,y,b,$,w,k,_,S,x,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),a=[s=t.__e=r.__e]),(h=_u.__b)&&h(t);e:if("function"==typeof C){c=o.length;try{if(y=t.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],w=h?$?$.props.value:h.__:i,r.__c?g=(d=t.__c=r.__c).__=d.__E:(b?t.__c=d=new C(y,w):(t.__c=d=new zu(y,w),d.constructor=C,d.render=ll),$&&$.sub(d),d.state||(d.state={}),d.__n=i,v=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Bu({},d.__s)),Bu(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=t,v)b&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),Pu.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),b&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,p,m)}))}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,k=_u.__r,_=0,b)d.state=d.__s,d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),Pu.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++_);d.state=d.__s,null!=d.getChildContext&&(i=Bu(Bu({},i),d.getChildContext())),b&&!v&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Wu&&null==h.key?ol(h.props.children):h,s=Ju(e,ju(S)?S:[S],t,r,i,n,a,o,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){if(o.length=c,t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=a&&(a[a.indexOf(s)]=null),t.__e=s}else{if(null!=a)for(x=a.length;x--;)Hu(a[x]);nl(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),e.then||nl(t);_u.__e(e,t,r)}}else null==a&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=function(e,t,r,i,n,a,o,s,u){var l,h,c,d,v,f,p,m=r.props||Du,g=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;a.length>l;l++)if((v=a[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,a[l]=null;break}if(null==e){if(null==y)return document.createTextNode(g);e=document.createElementNS(n,y,g.is&&g),s&&(_u.__m&&_u.__m(t,a),s=!1),a=null}if(null==y)m===g||s&&e.data==g||(e.data=g);else{if(a="textarea"==y&&null!=g.defaultValue?null:a&&ku.call(e.childNodes),!s&&null!=a)for(m={},l=0;e.attributes.length>l;l++)m[(v=e.attributes[l]).name]=v.value;for(l in m)v=m[l],"dangerouslySetInnerHTML"==l?c=v:"children"==l||l in g||"value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g||tl(e,l,null,v,n);for(l in g)v=g[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||m[l]===v||tl(e,l,v,m[l],n);if(h)s||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Ju("template"==t.type?e.content:e,ju(d)?d:[d],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,a,o,a?a[0]:r.__k&&Vu(r,0),s,u),null!=a)for(l=a.length;l--;)Hu(a[l]);s&&"textarea"!=y||(l="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==y&&!f||"option"==y&&f!=m[l])&&tl(e,l,f,m[l],n),l="checked",null!=p&&p!=e[l]&&tl(e,l,p,m[l],n))}return e}(r.__e,t,r,i,n,a,o,u,l);return(h=_u.diffed)&&h(t),128&t.__u?void 0:s}function nl(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(nl))}function al(e,t,r){for(var i=0;r.length>i;i++)sl(r[i],r[++i],r[++i]);_u.__c&&_u.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){_u.__e(e,t.__v)}}))}function ol(e){return"object"!=typeof e||null==e||e.__b>0?e:ju(e)?e.map(ol):void 0!==e.constructor?null:Bu({},e)}function sl(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){_u.__e(e,r)}}function ul(e,t,r){var i,n;if(_u.unmount&&_u.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||sl(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){_u.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&ul(i[n],t,r||"function"!=typeof e.type);r||Hu(e.__e),e.__c=e.__=e.__e=void 0}function ll(e,t,r){return this.constructor(e,r)}function hl(e,t,r){var i,n,a;t==document&&(t=document.documentElement),_u.__&&_u.__(e,t),i=t.__k,n=[],a=[],il(t,e=t.__k=$u(Wu,null,[e]),i||Du,Du,t.namespaceURI,i?null:t.firstChild?ku.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,a),al(n,e,a),e.props.children=null}ku=Pu.slice,_u={__e(e,t,r,i){for(var n,a,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&null!=a.getDerivedStateFromError&&(n.setState(a.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},Su=0,zu.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Bu({},this.state),"function"==typeof e&&(e=e(Bu({},r),this.props)),e&&Bu(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Gu(this))},zu.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Gu(this))},zu.prototype.render=Wu,xu=[],Mu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Tu=function(e,t){return e.__v.__b-t.__v.__b},Yu.__r=0,Iu=Math.random().toString(8),Eu="__d"+Iu,Ru="__a"+Iu,Au=/(PointerCapture)$|Capture$/i,Lu=0,Ou=rl(!1),Fu=rl(!0),Nu=0;var cl,dl,vl,fl,pl=0,ml=[],gl=_u,yl=gl.__b,bl=gl.__r,wl=gl.diffed,kl=gl.__c,_l=gl.unmount,Sl=gl.__;function xl(e,t){gl.__h&&gl.__h(dl,e,pl||t),pl=0;var r=dl.__H||(dl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Cl(e){return pl=1,function(e,t,r){var i=xl(cl++,2);if(i.t=e,!i.__c&&(i.__=[Dl(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=dl,!dl.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==e;if(i.__c.__H.__.some((function(e){if(e.__N){n=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),a){var s=a.call(this,e,t,r);return n?s||o:s}return!n||o};dl.__f=!0;var a=dl.shouldComponentUpdate,o=dl.componentWillUpdate;dl.componentWillUpdate=function(e,t,r){if(this.__e){var i=a;a=void 0,n(e,t,r),a=i}o&&o.call(this,e,t,r)},dl.shouldComponentUpdate=n}return i.__N||i.__}(Dl,e)}function Ml(e,t){var r=xl(cl++,3);!gl.__s&&Nl(r.__H,t)&&(r.__=e,r.u=t,dl.__H.__h.push(r))}function Tl(e){return pl=5,Il((function(){return{current:e}}),[])}function Il(e,t){var r=xl(cl++,7);return Nl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function El(e){var t=dl.context[e.__c],r=xl(cl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(dl)),t.props.value):e.__}function Rl(){for(var e;e=ml.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ol),t.__h.some(Fl),t.__h=[]}catch(r){t.__h=[],gl.__e(r,e.__v)}}}gl.__b=function(e){dl=null,yl&&yl(e)},gl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Sl&&Sl(e,t)},gl.__r=function(e){bl&&bl(e),cl=0;var t=(dl=e.__c).__H;t&&(vl===dl?(t.__h=[],dl.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.length&&Rl(),cl=0)),vl=dl},gl.diffed=function(e){wl&&wl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ml.push(t)&&fl===gl.requestAnimationFrame||((fl=gl.requestAnimationFrame)||Ll)(Rl)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),vl=dl=null},gl.__c=function(e,t){t.some((function(e){try{e.__h.some(Ol),e.__h=e.__h.filter((function(e){return!e.__||Fl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],gl.__e(r,e.__v)}})),kl&&kl(e,t)},gl.unmount=function(e){_l&&_l(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{Ol(e)}catch(e){t=e}})),r.__H=void 0,t&&gl.__e(t,r.__v))};var Al="function"==typeof requestAnimationFrame;function Ll(e){var t,r=function(){clearTimeout(i),Al&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);Al&&(t=requestAnimationFrame(r))}function Ol(e){var t=dl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),dl=t}function Fl(e){var t=dl;e.__c=e.__(),dl=t}function Nl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Dl(e,t){return"function"==typeof t?t(e):t}var Pl={Tab:"tab",Selector:"selector"},ql={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},jl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Bl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Hl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},$l={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Ul="always",Wl={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},zl={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LANGUAGE:"$survey_language"},Vl=Oe("[Surveys]"),Zl=(e,t)=>""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t),Ql=e=>Zl("seenSurvey_",e),Gl=e=>{try{var t=Ql(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Vl.error("Failed to persist survey seen state",e)}},Yl=[Bl.Popover,Bl.Widget,Bl.API];Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return O(e)&&isFinite(e)&&Math.floor(e)===e});class Jl{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Jl(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Jl(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Kl{generate(){var e=this.generateOrAbort();if(!I(e))return e;this.Rr=0;var t=this.generateOrAbort();if(I(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Rr)this.Rr=e,this.Ar();else{if(this.Rr>=e+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return Jl.fromFieldsV7(this.Rr,Math.trunc(this.Lr/Math.pow(2,30)),this.Lr&Math.pow(2,30)-1,this.Or.nextUint32())}Ar(){this.Lr=1024*this.Or.nextUint32()+(1023&this.Or.nextUint32())}constructor(){this.Rr=0,this.Lr=0,this.Or=new th}}var Xl,eh=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!I(e.crypto)&&crypto.getRandomValues&&(eh=e=>crypto.getRandomValues(e));class th{nextUint32(){return this.ft.length>this.Fr||(eh(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var rh=()=>ih().toString(),ih=()=>(Xl||(Xl=new Kl)).generate(),nh=null,ah={Nr(){if(!A(nh))return nh;var t=!0;if(I(e))t=!1;else try{var r="__mplssupport__";ah.Dr(r,"xyz"),'"xyz"'!==ah.Pr(r)&&(t=!1),ah.qr(r)}catch(e){t=!1}return t||Le.error("localStorage unsupported; falling back to cookie store"),nh=t,t},jr(e){Le.error("localStorage error: "+e)},Pr(t){try{return null==e?void 0:e.localStorage.getItem(t)}catch(e){ah.jr(e)}return null},Br(e){try{return JSON.parse(ah.Pr(e))||{}}catch(e){}return null},Dr(t,r){try{return null==e||e.localStorage.setItem(t,JSON.stringify(r)),!0}catch(e){ah.jr(e)}return!1},qr(t){try{null==e||e.localStorage.removeItem(t)}catch(e){ah.jr(e)}}},oh=Oe("[Stylesheet Loader]"),sh=e,uh=i,lh="#020617",hh={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:ql.Right,widgetType:Pl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:lh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},ch=[ql.Center,ql.Left,ql.Right];function dh(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function vh(e){var t;void 0===e&&(e=hh.backgroundColor),"#"===e[0]&&(t=dh(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=dh(r)),!t)return lh;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),a=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+a*a*.587+o*o*.114)>127.5?lh:"white"}return lh}var fh=(e,t,r)=>{var i=Oh(e),n=uh.querySelector("."+i);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var a=uh.createElement("div");((e,t,r)=>{var i=h({},hh,r),n=e.style,a=!ch.includes(i.position)||t===Bl.Widget&&(null==r?void 0:r.widgetType)===Pl.Tab;n.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),n.setProperty("--ph-survey-box-padding",i.boxPadding),n.setProperty("--ph-survey-max-width",i.maxWidth),n.setProperty("--ph-survey-z-index",i.zIndex),n.setProperty("--ph-survey-border-color",i.borderColor),a?(n.setProperty("--ph-survey-border-radius",i.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",i.backgroundColor),n.setProperty("--ph-survey-box-shadow",i.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||vh(i.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",vh(i.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||vh(i.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),n.setProperty("--ph-widget-color",i.widgetColor),n.setProperty("--ph-widget-text-color",vh(i.widgetColor)),n.setProperty("--ph-widget-z-index",i.zIndex);var o=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),s=o||i.inputBackground;o||"white"!==i.backgroundColor||(s="#f8f8f8"),n.setProperty("--ph-survey-input-background",s);var u=(null==r?void 0:r.inputTextColor)||vh(s);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),n.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",i.outlineColor)})(a,e.type,e.appearance),a.className=i;var o=a.attachShadow({mode:"open"}),s=function(e){var t=((e,t,r)=>{var i=e.createElement("style");i.innerText=t;var n=(e=>{var t;return M(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(oh.error("prepare_external_dependency_stylesheet returned null"),null)})(uh,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(s){var u=o.querySelector("style");u&&o.removeChild(u),o.appendChild(s)}return uh.body.appendChild(a),{shadow:o,isNewlyCreated:!0}},ph=e=>{var t=e.responses,r=e.survey,i=e.surveySubmissionId,n=e.posthog,a=e.isSurveyCompleted,o=e.properties,s=e.surveyLanguage;n?(Gl(r),n.capture(Wl.SENT,h({[zl.SURVEY_NAME]:r.name,[zl.SURVEY_ID]:r.id,[zl.SURVEY_ITERATION]:r.current_iteration,[zl.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[zl.SURVEY_SUBMISSION_ID]:i,[zl.SURVEY_COMPLETED]:a},s&&{[zl.SURVEY_LANGUAGE]:s},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},li(t,r),o,{$set:{[hi(r,"responded")]:!0}})),a&&(sh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),Lh(r),n.reloadFeatureFlags())):Vl.error("[survey sent] event not captured, PostHog instance not found.")},mh=(e,t,r)=>{return h({[zl.SURVEY_NAME]:e.name,[zl.SURVEY_ID]:e.id,[zl.SURVEY_ITERATION]:e.current_iteration,[zl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[zl.SURVEY_PARTIALLY_COMPLETED]:(i=null==t?void 0:t.responses,void 0===i&&(i={}),Object.values(i).some((e=>!L(e))))},(null==t?void 0:t.surveyLanguage)&&{[zl.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[zl.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},li(null==t?void 0:t.responses,e));var i},gh=(e,t,r,i)=>{if(t){if(!r){var n=Rh(e);t.capture(Wl.DISMISSED,h({},mh(e,n,t),i&&{[zl.SURVEY_LANGUAGE]:i},{$set:{[hi(e,"dismissed")]:!0}})),Lh(e),Gl(e),sh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Vl.error("[survey dismissed] event not captured, PostHog instance not found.")},yh=(e,t)=>{if(t){var r=(e=>Zl("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=Rh(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Wl.ABANDONED,mh(e,i,t),{transport:"sendBeacon"})}}else Vl.error("[survey abandoned] event not captured, PostHog instance not found.")},bh=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),wh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,kh=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?wh(e.questions,bh(e.questions)):e.questions,_h=e=>function(e){var t;return mi(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}(e)||Ah(e),Sh=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Gu(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Nu++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),xh=()=>El(Sh),Ch=e=>{var t=e.children,r=e.style;return function(e,t,r){var i,n,a,o,s=Bu({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?i=t[a]:"ref"==a?n=t[a]:s[a]=void 0===t[a]&&null!=o?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?ku.call(arguments,2):r),Uu(e.type,s,i||e.key,n||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:r}:{children:t,style:r})};function Mh(e,t){var r,i;if(null==(r=e.conditions)||!r.url)return!0;var n=He(t);if(!n)return!1;var a=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return bi[o](a,[n])}function Th(t){var i,n;return function(t,i){var n,o,s;if(!t||0===t.length)return!0;if(!a)return!1;var u,l,h,c,d,v,f=(u={userAgentDataPlatform:null==r||null==(n=r.userAgentData)?void 0:n.platform,maxTouchPoints:null==r?void 0:r.maxTouchPoints,screenWidth:null==e||null==(o=e.screen)?void 0:o.width,screenHeight:null==e||null==(s=e.screen)?void 0:s.height,devicePixelRatio:null==e?void 0:e.devicePixelRatio},(v=function(e){return ce.test(e)?ee:he.test(e)?te:le.test(e)?re:new RegExp(ae,"i").test(e)?ae:new RegExp("("+ie+"|WPDesktop)","i").test(e)?ie:/iPad/.test(e)?J:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?K:de.test(e)?X:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ne,"i").test(e)?ne:/(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(Z).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)?Q:Y:new RegExp("(pda|"+Z+")","i").test(e)?se:new RegExp(G,"i").test(e)&&!new RegExp(G+" pc","i").test(e)?ue:""}(a))===J||v===Y||"Kobo"===v||"Kindle Fire"===v||v===ue?G:v===ee||v===re||v===te||v===ae?"Console":v===K?"Wearable":v?Z:"Android"===(null==u?void 0:u.userAgentDataPlatform)&&(null!==(l=null==u?void 0:u.maxTouchPoints)&&void 0!==l?l:0)>0?600>Math.min(null!==(h=null==u?void 0:u.screenWidth)&&void 0!==h?h:0,null!==(c=null==u?void 0:u.screenHeight)&&void 0!==c?c:0)/(null!==(d=null==u?void 0:u.devicePixelRatio)&&void 0!==d?d:1)?Z:G:"Desktop");return bi[null!=i?i:"icontains"](t,[f])}(null==(i=t.conditions)?void 0:i.deviceTypes,null==(n=t.conditions)?void 0:n.deviceTypesMatchType)}var Ih=e=>Zl("inProgressSurvey_",e),Eh=(e,t)=>{try{localStorage.setItem(Ih(e),JSON.stringify(t))}catch(e){Vl.error("Error setting in-progress survey state in localStorage",e)}},Rh=e=>{try{var t=localStorage.getItem(Ih(e));if(t)return JSON.parse(t)}catch(e){Vl.error("Error getting in-progress survey state from localStorage",e)}return null},Ah=e=>{var t=Rh(e);return!L(null==t?void 0:t.surveySubmissionId)},Lh=e=>{try{localStorage.removeItem(Ih(e))}catch(e){Vl.error("Error clearing in-progress survey state from localStorage",e)}};function Oh(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Fh(e,t,r){if(void 0===t&&(t=ql.Right),e===Bl.ExternalSurvey)return{};switch(t){case ql.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case ql.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case ql.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case ql.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case ql.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case ql.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case ql.Left:return{left:"30px"};case ql.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Bl.Widget&&r===Pl.Tab?"60px":"30px"}}}var Nh=0;function Dh(e,t,r,i,n,a){t||(t={});var o,s,u=t;if("ref"in u)for(s in u={},t)"ref"==s?o=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nh,__i:-1,__u:0,__source:n,__self:a};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return _u.vnode&&_u.vnode(l),l}var Ph=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),qh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),jh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Bh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Hh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),$h=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Dh("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Uh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Dh("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Wh=function(e){var t=(void 0===e?{}:e).fill,r=void 0===t?"currentColor":t;return Dh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Dh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Dh("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]})},zh=Dh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Dh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Dh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Dh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Dh("g",{mask:"url(#mask0_2415_6911)",children:[Dh("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Dh("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Dh("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Dh("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Dh("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Dh("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Dh("defs",{children:Dh("clipPath",{id:"clip0_2415_6911",children:Dh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Vh(e){var t=e.urlParams,r=t?Object.entries(t).map((e=>{var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)})).join("&"):"";return Dh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",zh]})}function Zh(t){var r=t.text,i=t.submitDisabled,n=t.appearance,a=t.onSubmit,o=t.link,s=t.onPreviewSubmit,u=t.skipSubmitButton,l=t.canGoBack,h=t.onBack,c=El(Sh).isPreviewMode,d=!!l&&!!h,v=!u&&Dh("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==e||e.open(o)),c?null==s||s():a()},children:r});return Dh("div",{className:"bottom-section",children:[d?Dh("div",{className:"form-buttons form-buttons-with-back",children:[Dh("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),v]}):v,!n.whiteLabel&&Dh(Vh,{urlParams:{utm_source:"survey-footer"}})]})}function Qh(e){var t=e.question,r=e.forceDisableHtml;return Dh("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Dh(t.type===Hl.Open?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&Ch({component:$u("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Gh(e){return Dh("button",{className:"form-cancel",onClick:e.onClick,disabled:El(Sh).isPreviewMode,"aria-label":"Close survey",type:"button",children:Wh({fill:"black"})})}Dh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Dh("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Yh=e;function Jh(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,a=e.appearance,o=e.onClose,s=El(Sh).isPopup;return Ml((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Pe(Yh,"keydown",e),()=>{Yh.removeEventListener("keydown",e)}}),[o]),Dh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==a.hideCancelButton&&Dh(Gh,{onClick:()=>o()}),Dh("h3",{className:"thank-you-message-header",children:t}),r&&Ch({component:$u("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),s&&Dh(Zh,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:()=>o()})]})}function Kh(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,a=e.appearance,o=e.onStart,s=El(Sh),u=s.onPreviewSubmit,l=s.onPopupSurveyDismissed;return Dh("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s.isPopup&&!0!==a.hideCancelButton&&Dh(Gh,{onClick:()=>l()}),t&&Dh("h3",{className:"intro-screen-header",children:t}),r&&Ch({component:$u("p",{className:"intro-screen-body"}),children:r,renderAsHtml:!n&&"text"!==i}),Dh(Zh,{text:a.introScreenButtonText||"Get started",submitDisabled:!1,appearance:a,onSubmit:o,onPreviewSubmit:()=>u(null)})]})}var Xh=e=>C(e)&&e.every((e=>E(e)));function ec(e){var t=e.question,r=e.forceDisableHtml,i=e.appearance,n=e.onSubmit,a=e.onPreviewSubmit,o=e.displayQuestionIndex,s=e.initialValue,u=e.canGoBack,l=e.onBack,h=xh().isPreviewMode,c=Tl(null),d=Cl((()=>E(s)?s:"")),v=d[0],m=d[1],g=null==i?void 0:i.disableAutofocus;Ml((()=>{g||setTimeout((()=>{var e;h||null==(e=c.current)||e.focus()}),100)}),[h,g]);var y="surveyQuestion"+o,b=Il((()=>function(e,t,r){var i,n,a=e.trim();if(!r&&""===a)return"This field is required";if(""===a)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case f:if(void 0!==o.value&&o.value>a.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case p:if(void 0!==o.value&&a.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,t.validation,t.optional)),[v,t.validation,t.optional]),w=fe(t.validation,f),k=fe(t.validation,p),_=Il((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(w,k)),[w,k]),S=()=>{b||n(v.trim())},x=()=>{b||a(v.trim())};return Dh(Wu,{children:[Dh("div",{className:"question-container",children:[Dh(Qh,{question:t,forceDisableHtml:r,htmlFor:y}),Dh("textarea",{ref:c,id:y,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:w,maxLength:k,onInput(e){m(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||b||(e.preventDefault(),h?x():S())},value:v}),_&&Dh("div",{className:"validation-hint",children:_})]}),Dh(Zh,{text:t.buttonText||"Submit",submitDisabled:!!b,appearance:i,onSubmit:S,onPreviewSubmit:x,canGoBack:u,onBack:l})]})}function tc(e){var t=e.question,r=e.appearance,i=e.onSubmit,n=e.onPreviewSubmit,a=e.canGoBack,o=e.onBack;return Dh(Wu,{children:[Dh("div",{className:"question-container",children:Dh(Qh,{question:t,forceDisableHtml:e.forceDisableHtml})}),Dh(Zh,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:a,onBack:o})]})}function rc(e){var t,r=e.question,i=e.forceDisableHtml,n=e.displayQuestionIndex,a=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,u=e.initialValue,l=e.canGoBack,h=e.onBack,c=r.scale,d=10===r.scale?0:1,v=Cl((()=>O(u)?u:C(u)&&u.length>0&&O(parseInt(u[0]))?parseInt(u[0]):E(u)&&O(parseInt(u))?parseInt(u):null)),f=v[0],p=v[1],m="emoji"===r.display&&2===r.scale,g=xh().isPreviewMode,y=e=>g?s(e):o(e);return Dh(Wu,{children:[Dh("div",{className:"question-container",children:[Dh(Qh,{question:r,forceDisableHtml:i}),Dh("div",{className:"rating-section",children:[Dh("div",{className:"rating-options",children:["emoji"===r.display&&Dh("div",{className:"rating-options-emoji"+(m?" rating-options-emoji-2":""),children:null==(t=uc[r.scale])?void 0:t.map(((e,t)=>Dh("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===f?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;p(e),r.skipSubmitButton&&y(e)},children:e},t)))}),"number"===r.display&&Dh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(c-d+1)+", minmax(0, 1fr))"},children:lc(r.scale).map(((e,t)=>Dh(ic,{displayQuestionIndex:n,active:f===e,appearance:a,num:e,setActiveNumber(e){p(e),r.skipSubmitButton&&y(e)}},t)))})]}),!m&&Dh("div",{className:"rating-text",children:[Dh("div",{children:r.lowerBoundLabel}),Dh("div",{children:r.upperBoundLabel})]})]})]}),Dh(Zh,{text:r.buttonText||(null==a?void 0:a.submitButtonText)||"Submit",submitDisabled:A(f)&&!r.optional,appearance:a,onSubmit:()=>o(f),onPreviewSubmit:()=>s(f),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:h})]})}function ic(e){var t=e.num,r=e.setActiveNumber;return Dh("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick(){r(t)},children:t})}function nc(e){var t=e.question,r=e.forceDisableHtml,i=e.displayQuestionIndex,n=e.appearance,a=e.onSubmit,o=e.onPreviewSubmit,s=e.initialValue,u=e.canGoBack,l=e.onBack,c=Tl(null),d=Il((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=wh(t,bh(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),v=Cl((()=>((e,t)=>E(e)||Xh(e)?e:t===Hl.SingleChoice?null:[])(s,t.type))),f=v[0],p=v[1],m=Cl((()=>((e,t)=>{if(E(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Xh(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(s,d))),g=m[0],y=m[1],b=xh().isPreviewMode,w=t.type===Hl.SingleChoice,k=t.type===Hl.MultipleChoice,_=t.skipSubmitButton&&w&&!t.hasOpenChoice,S=(e,t)=>{if(t){var r=!g.isSelected;return y((e=>h({},e,{isSelected:r,inputValue:r?e.inputValue:""}))),w&&p(""),void(r&&setTimeout((()=>{var e;return null==(e=c.current)?void 0:e.focus()}),75))}if(w)return p(e),y((e=>h({},e,{isSelected:!1,inputValue:""}))),void(_&&(a(e),b&&o(e)));k&&C(f)&&(f.includes(e)?p(f.filter((t=>t!==e))):p([...f,e]))},x=e=>{e.stopPropagation();var t=e.currentTarget.value;y((e=>h({},e,{inputValue:t}))),w&&p(t)},M=e=>{e.stopPropagation(),"Enter"!==e.key||T()||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),y((e=>h({},e,{isSelected:!1,inputValue:""}))),w&&p(null))},T=()=>!(t.optional||!A(f)&&(!C(f)||g.isSelected||0!==f.length)&&(!g.isSelected||""!==g.inputValue.trim())),I=()=>{g.isSelected&&k?C(f)&&(b?o([...f,g.inputValue]):a([...f,g.inputValue])):b?o(f):a(f)};return Dh(Wu,{children:[Dh("div",{className:"question-container",children:[Dh(Qh,{question:t,forceDisableHtml:r}),Dh("fieldset",{className:"multiple-choice-options limit-height",children:[Dh("legend",{className:"sr-only",children:k?" Select all that apply":" Select one"}),d.map(((e,r)=>{var n=!!t.hasOpenChoice&&r===t.choices.length-1,a="surveyQuestion"+i+"Choice"+r,o=a+"Open",s=n?g.isSelected:w?f===e:C(f)&&f.includes(e);return Dh("label",{className:n?"choice-option-open":"",children:[Dh("div",{className:"response-choice",children:[Dh("input",{type:w?"radio":"checkbox",name:a,checked:s,onChange:()=>S(e,n),id:a,"aria-controls":o}),Dh("span",{children:n?e+":":e})]}),n&&Dh("input",{type:"text",ref:c,id:o,name:"question"+i+"Open",value:g.inputValue,onKeyDown:M,onInput:x,onClick(t){g.isSelected||S(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Dh(Zh,{text:t.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:_,canGoBack:u,onBack:l})]})}var ac=[1,2,3,4,5],oc=[1,2,3,4,5,6,7],sc=[0,1,2,3,4,5,6,7,8,9,10],uc={2:[$h,Uh],3:[jh,qh,Ph],5:[Bh,jh,qh,Ph,Hh]};function lc(e){switch(e){case 5:default:return ac;case 7:return oc;case 10:return sc}}var hc=Oe("[Surveys]");function cc(e,t,r){var i,n=e.questions[t],a=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?$l.End:a;if(n.branching.type===$l.End)return $l.End;if(n.branching.type===$l.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===$l.ResponseBased){if(n.type===Hl.SingleChoice){var o,s=n.choices.indexOf(""+r);if(-1===s&&n.hasOpenChoice&&(s=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(s)){var u=n.branching.responseValues[s];return Number.isInteger(u)?u:u===$l.End?$l.End:a}}else if(n.type===Hl.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===$l.End?$l.End:a}}return a}return hc.warn("Falling back to next question index due to unexpected branching type"),a}var dc=Oe("[SurveyTranslations]");function vc(e,t){var r=function(e){return function(e,t){var r=e.storedPersonProperties,i=e.locale,n=ci(e.overrideLanguage);if(n)return null==t||t.info("Using override display language: "+n),n;var a=function(e){return e&&"object"==typeof e&&"language"in e?ci(e.language):null}(r);if(a)return null==t||t.info("Using person property language: "+a),a;var o=ci(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:M(e.get_property)?e.get_property(zt):void 0,locale:navigator.language||navigator.userLanguage},dc)}(t);if(!r)return dc.info("No user language detected"),{survey:e,language:null};var i=pi(e,r,dc);return{survey:i.survey,language:i.matchedKey}}var fc=-1,pc=e,mc=i,gc="ph:show_survey_widget",yc="PHWidgetSurveyClickListener";function bc(e,t){try{var r=e.getBoundingClientRect(),i=pc.innerHeight,n=pc.innerWidth,a=r.left+r.width/2-t/2;a+t>n-20&&(a=n-t-20),20>a&&(a=20);var o=i-r.bottom,s=250>o&&r.top>o;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:a+"px",right:"auto",bottom:s?i-r.top+12+"px":"auto",zIndex:hh.zIndex}}catch(e){return Vl.warn("Failed to calculate trigger position:",e),null}}class wc{constructor(e){var t=this;this.Hr=new Map,this.$r=new Map,this.Ur=new Map,this.Wr=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property("$surveys");if(e)for(var t of e)Ah(t)&&yh(t,this._posthog)},this.handlePopoverSurvey=function(e,r,i){var n,a,o,s,u,l=(void 0===i?{}:i).resumeDelayFromActivation,c=void 0!==l&&l,d=t.zr(e),v=d.survey,f=d.language,p=null!=r&&r.position||null!=r&&r.selector?h({},v,{appearance:h({},v.appearance,r.position&&{position:r.position},r.selector&&{widgetSelector:r.selector})}):v;t.Vr(p.id);var m=null!=r?r:{},g=m.properties,y=m.initialResponses,b=!(!y||0>=Object.keys(y).length)&&t.Zr(p,y,g,f);if(!b||null!=(n=p.appearance)&&n.displayThankYouMessage){t.Qr(p);var w={};if((null==(a=p.appearance)?void 0:a.position)===ql.NextToTrigger&&null!=(o=p.appearance)&&o.widgetSelector){var k,_=mc.querySelector(p.appearance.widgetSelector);_&&(w=bc(_,parseInt((null==(k=p.appearance)?void 0:k.maxWidth)||hh.maxWidth))||{})}var S=(null==(s=p.appearance)?void 0:s.surveyPopupDelaySeconds)||0,x=fh(p,t._posthog).shadow;t.Ur.set(x,x.host);var C={posthog:t._posthog,survey:p,removeSurveyFromFocus:t.Gr,properties:g,style:w,isSurveyCompleted:b,skipShownEvent:null==r?void 0:r.skipShownEvent,surveyLanguage:f};if(0>=S)return hl(Dh(Cc,h({},C)),x);var M=()=>{if(!t.Yr(p))return Vl.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),t.Gr(p);hl(Dh(Cc,h({},C,{survey:h({},p,{appearance:h({},p.appearance,{surveyPopupDelaySeconds:0})})})),x)},T=c?null==(u=t._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,I=O(T)?Math.max(0,Date.now()-T):0,E=Math.max(0,1e3*S-I);if(0>=E)return M();var R=pc.setTimeout((()=>{t.Hr.delete(p.id),M()}),E);t.Hr.set(p.id,R)}},this.Jr=e=>{var t=this.zr(e),r=t.survey,i=t.language,n=fh(r,this._posthog),a=n.shadow,o=n.isNewlyCreated;this.Ur.set(a,a.host),o&&hl(Dh(Tc,{posthog:this._posthog,survey:r,surveyLanguage:i},e.id),a)},this.Kr=e=>{var t=this.$r.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(yc),this.$r.delete(e),Vl.info("Removed click listener for survey "+e))},this.Xr=e=>{this.ei(e)||(this.ti(e),this.Kr(e.id))},this.ei=e=>{try{var t,r=mc.querySelector(Oh(e,!0));return!(null==r||null==(t=r.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this.ri=(e,t)=>{var r=mc.querySelector(t),i=this.$r.get(e.id);if(r){if(this.Jr(e),i){if(r===i.element)return;Vl.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.Kr(e.id)}if(!r.hasAttribute(yc)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===ql.NextToTrigger?bc(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||hh.maxWidth)):{};pc.dispatchEvent(new CustomEvent(gc,{detail:{surveyId:e.id,position:n}}))};Pe(r,"click",n),r.setAttribute(yc,"true"),this.$r.set(e.id,{element:r,listener:n,survey:e}),Vl.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.Xr(e)},this.renderPopover=e=>{var t=this.zr(e),r=t.survey,i=t.language,n=fh(r,this._posthog).shadow;this.Ur.set(n,n.host),hl(Dh(Cc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Gr,surveyLanguage:i}),n)},this.renderSurvey=(e,t,r)=>{var i,n=this.zr(e),a=n.survey,o=n.language,s=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(s=this.ii(a,o,r)),hl(Dh(Cc,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Gr,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:o}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.Yr(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Bl.Popover||e.type===Bl.Widget)),i=new Set(r.map((e=>e.id)));for(var n of Array.from(t.Hr.keys()))i.has(n)||t.cancelSurvey(n);var a=t.ni(r),o=new Set;a.forEach((e=>{if(e.type===Bl.Widget){var r,i,n,a;if((null==(r=e.appearance)?void 0:r.widgetType)===Pl.Tab)return void t.Jr(e);(null==(i=e.appearance)?void 0:i.widgetType)===Pl.Selector&&null!=(n=e.appearance)&&n.widgetSelector&&(o.add(e.id),t.ri(e,null==(a=e.appearance)?void 0:a.widgetSelector))}A(t.ai)&&e.type===Bl.Popover&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})})),t.$r.forEach((e=>{var r=e.survey;o.has(r.id)||t.Xr(r)}))}),e)},this.Qr=e=>{A(this.ai)||Vl.error("Survey "+this.ai+" already in focus. Cannot add survey "+e.id+"."),this.ai=e.id},this.Gr=e=>{this.ai!==e.id&&Vl.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.Vr(e.id),this.ai=null,this.ti(e)},this._posthog=e,this.ai=null}Vr(e){var t=this.Hr.get(e);t&&(clearTimeout(t),this.Hr.delete(e))}cancelSurvey(e){this.Hr.has(e)&&(Vl.info("Cancelled pending survey "+e),this.Vr(e),this.ai===e&&(this.ai=null))}setAutomaticDisplayDispose(e){this.oi=e}dispose(){var e;null==(e=this.oi)||e.call(this),this.oi=void 0,this.Hr.forEach(((e,t)=>this.Vr(t))),this.$r.forEach(((e,t)=>this.Kr(t))),this.Ur.forEach(((e,t)=>{hl(null,t),null==e||e.remove()})),this.Ur.clear(),this.ai=null}ni(e){return e.sort(((e,t)=>{var r,i,n=Ah(e),a=Ah(t);if(n&&!a)return-1;if(!n&&a)return 1;var o=e.schedule===Ul,s=t.schedule===Ul;return o&&!s?1:!o&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}zr(e){return vc(e,this._posthog)}ii(e,t,r){if(this.Wr.has(e.id))return!1;var i=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var a of n){var o=a.split("="),s=o[0],u=o[1];if(s&&!I(u)){var l=decodeURIComponent(s),h=decodeURIComponent(u);if("auto_submit"!==l||"true"!==h){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(h)}}else r=!0}}return{params:t,autoSubmit:r}}(pc.location.search),n=i.params;if(0===Object.keys(n).length)return!1;Vl.info("[Survey Prefill] Detected URL prefill parameters");var a=this.si(e,n,t);if(!a)return!1;var o=a.responses,s=a.submissionId,u=a.isSurveyCompleted,l=a.skippedResponses;return(Object.keys(l).length>0&&e.enable_partial_responses||u)&&ph({responses:u?o:l,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:u,properties:r,surveyLanguage:t}),this.Wr.add(e.id),u}Zr(e,t,r,i){var n={};for(var a of Object.entries(t)){var o=a[1];n[parseInt(a[0])]=C(o)?o.map(String):[String(o)]}Vl.info("[Survey] Processing initial responses");var s=this.si(e,n,i);if(!s)return!1;var u=s.isSurveyCompleted;return ph({responses:s.responses,survey:e,surveySubmissionId:s.submissionId,posthog:this._posthog,isSurveyCompleted:u,properties:r,surveyLanguage:i}),u}si(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],a=si(e.id);try{switch(e.type){case Hl.SingleChoice:if(!e.choices||0===e.choices.length)return void Le.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void Le.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[a]=e.choices[o];break;case Hl.MultipleChoice:if(!e.choices||0===e.choices.length)return void Le.warn("[Survey Prefill] Question "+i+" has no choices");var s=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===s.length)return void Le.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(s.map((t=>e.choices[t])))];s.length>u.length&&Le.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[a]=u;break;case Hl.Rating:var l=parseInt(n[0],10),h=e.scale||10;if(isNaN(l)||0>l||l>h)return void Le.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[a]=l;break;default:Le.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){Le.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return Vl.warn("[Survey Prefill] No valid responses after conversion"),null;var n=rh(),a=Object.keys(t).map((e=>parseInt(e,10))),o=function(e,t,r){for(var i=0,n={},a=[],o=e.questions.length+1,s=0;e.questions.length>i&&o>s&&(s++,t.includes(i));){var u=e.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=si(u.id);I(r[l])||(n[l]=r[l])}a.push(i);var h=cc(e,i,u.id?r[si(u.id)]:null);if(h===$l.End)return{startQuestionIndex:e.questions.length,skippedResponses:n,skippedIndices:a};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:a}}(e,a,i),s=o.startQuestionIndex,u=o.skippedResponses,l=s>=e.questions.length;return Eh(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:s,visitedIndices:o.skippedIndices,surveyLanguage:r}),Vl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:s,isSurveyCompleted:l,skippedResponses:u}}catch(e){return Vl.error("[Survey Prefill] Error handling prefill:",e),null}}ui(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),a=!0;return t&&(a=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&a}li(e){return!e.conditions||Mh(e,this._posthog)&&Th(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==uh||!uh.querySelector(e.conditions.selector))}(e)}hi(e){var t;return _h(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this._posthog.featureFlags)&&t.hasLoadedFlags?{satisfied:this.ui(e.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Yl.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this.ui(e.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.ui(e.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var a,o=this.hi(e);return o.satisfied?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,ah.Pr("lastSeenSurveyDate"))?(e=>!!ah.Pr(Ql(e))&&!_h(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(a=o.reason)&&void 0!==a?a:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(e){var t=this.checkSurveyEligibility(e);return t.eligible&&!this.ci(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}ci(e){var t;if(!mi(e)&&!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}di(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var t=e.value;return!e.key||!t||this.ui(t)}))}Yr(e){return this.checkSurveyEligibility(e).eligible&&this.li(e)&&this.ci(e)&&this.di(e)}ti(e){try{var t=mc.querySelector(Oh(e,!0));null!=t&&t.shadowRoot&&(hl(null,t.shadowRoot),this.Ur.delete(t.shadowRoot)),null==t||t.remove()}catch(t){Vl.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.Qr,removeSurveyFromFocus:this.Gr,surveyInFocus:this.ai,surveyTimeouts:this.Hr,handleWidget:this.Jr,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ri,sortSurveysByAppearanceDelay:this.ni,checkFlags:this.di.bind(this),isSurveyFeatureFlagEnabled:this.ui.bind(this)}}}function kc(e,t){if(mc&&pc){var r,i=new wc(e);if(e.config.disable_surveys_automatic_display)return Vl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Vl.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{I(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},a=()=>{I(r)||(clearInterval(r),r=void 0)};n();var o=()=>{mc.hidden?a():(i.callSurveysAndEvaluateDisplayLogic(!1),n())};return Pe(mc,"visibilitychange",o),i.setAutomaticDisplayDispose((()=>{a(),mc.removeEventListener("visibilitychange",o)})),i}}function _c(e){var t=e.survey,r=e.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=e.setSurveyVisible,a=e.isPreviewMode,o=void 0!==a&&a,s=e.posthog;Ml((()=>{var e;if(!o&&null!=(e=t.conditions)&&e.url){var r=()=>{var e,r=t.type===Bl.Widget,a=Mh(t,s),o=(null==(e=t.appearance)?void 0:e.widgetType)===Pl.Tab&&r;if(!a)return Vl.info("Hiding survey "+t.id+" because URL does not match"),n(!1),i(t);o&&(Vl.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};Pe(pc,"popstate",r),Pe(pc,"hashchange",r);var a=pc.history.pushState,u=pc.history.replaceState;return pc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];a.apply(this,t),r()},pc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];u.apply(this,t),r()},()=>{pc.removeEventListener("popstate",r),pc.removeEventListener("hashchange",r),pc.history.pushState=a,pc.history.replaceState=u}}}),[o,t,i,n,s])}var Sc=200;function xc(e){switch(void 0===e&&(e=jl.Right),e){case jl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case jl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case jl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Cc(e){var t,r,i,n,a,o,s,u,l,c,d,v,f=e.survey,p=e.forceDisableHtml,m=e.posthog,g=e.style,y=void 0===g?{}:g,b=e.previewPageIndex,w=e.removeSurveyFromFocus,k=void 0===w?()=>{}:w,_=e.isPopup,S=void 0===_||_,x=e.onPreviewSubmit,C=void 0===x?()=>{}:x,M=e.onPreviewBack,T=void 0===M?()=>{}:M,E=e.onPopupSurveyDismissed,R=void 0===E?()=>{}:E,A=e.onCloseConfirmationMessage,L=void 0===A?()=>{}:A,O=e.properties,F=e.isSurveyCompleted,N=e.skipShownEvent,D=e.surveyLanguage,P=Tl(null),q=Number.isInteger(b),j=null!=(t=f.appearance)&&t.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,B=function(e,t,r,i,n,a,o,s,u){var l=Cl(i||0===r||e.type===Bl.ExternalSurvey),c=l[0],d=l[1],v=Cl(!1),f=v[0],p=v[1],m=Tl(!1),g=()=>{var t=()=>{a&&n(e),d(!1)};if(!m.current){var r=null==o?void 0:o.current;r?(m.current=!0,r.style.transition="opacity "+Sc+"ms ease-out",r.style.opacity="0",setTimeout((()=>{m.current=!1,t()}),Sc+50)):t()}},y=t=>{t.detail.surveyId===e.id&&g()};return Ml((()=>{if(t){if(!i){var n,a=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=e.appearance)&&i.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(g,5e3))}},o=()=>{if(Mh(e,t)){d(!0),pc.dispatchEvent(new Event("PHSurveyShown")),s||t.capture(Wl.SHOWN,h({[zl.SURVEY_NAME]:e.name,[zl.SURVEY_ID]:e.id,[zl.SURVEY_ITERATION]:e.current_iteration,[zl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[zl.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};Pe(pc,"PHSurveyClosed",y),Pe(pc,"PHSurveySent",a);var l=r>0?setTimeout(o,r):void 0;return I(l)&&o(),()=>{I(l)||clearTimeout(l),I(n)||clearTimeout(n),pc.removeEventListener("PHSurveyClosed",y),pc.removeEventListener("PHSurveySent",a)}}}else Vl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),_c({survey:e,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:i,posthog:t}),{isPopupVisible:c,isSurveySent:f,setIsPopupVisible:d,hidePopupWithAnimation:g}}(f,m,j,q,k,S,P,N,D),H=B.isPopupVisible,U=B.hidePopupWithAnimation,W=B.isSurveySent||b===f.questions.length||!0===F,z=Cl(!1),V=z[0],Z=z[1],Q=Il((()=>!!Rh(f)),[f]),G=!!(null!=(r=f.appearance)&&r.introScreenHeader||null!=(i=f.appearance)&&i.introScreenDescription),Y=q?b===fc:!(null==(n=f.appearance)||!n.displayIntroScreen)&&G&&!V&&!Q,J=Il((()=>{var e=Rh(f),t=(null==e?void 0:e.surveySubmissionId)||rh();return{isPreviewMode:q,previewPageIndex:b,onPopupSurveyDismissed(){D?gh(f,m,q,D):gh(f,m,q),R()},isPopup:S||!1,surveySubmissionId:t,onPreviewSubmit:C,onPreviewBack:T,posthog:m,properties:O,surveyLanguage:D}}),[q,b,S,m,f,R,C,T,O,D]);return H?Dh(Sh.Provider,{value:J,children:Dh("div",{className:"ph-survey",style:h({},Fh(f.type,null==(a=f.appearance)?void 0:a.position,null==(o=f.appearance)?void 0:o.widgetType),y),ref:P,children:W?Dh(Jh,{header:(null==(s=f.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(l=f.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:f.appearance||hh,onClose(){U(),L()}}):Y?Dh(Kh,{header:(null==(c=f.appearance)?void 0:c.introScreenHeader)||"",description:(null==(d=f.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(v=f.appearance)?void 0:v.introScreenDescriptionContentType,appearance:f.appearance||hh,onStart:()=>Z(!0)}):Dh(Mc,{survey:f,forceDisableHtml:!!p,posthog:m})})}):null}function Mc(e){var t,r,i=e.survey,n=e.forceDisableHtml,a=e.posthog,o=Il((()=>{var e=Rh(i);if(!e)return null;var t=O(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&i.questions.length>e.lastQuestionIndex?e:(Lh(i),null)}),[i]),s=Cl((()=>(null!=o&&o.responses&&Vl.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),u=s[0],l=s[1],c=El(Sh),d=c.previewPageIndex,v=c.onPopupSurveyDismissed,f=c.isPopup,p=c.onPreviewSubmit,m=c.onPreviewBack,g=c.surveySubmissionId,y=c.isPreviewMode,b=c.properties,w=c.surveyLanguage,k=Cl((()=>{var e=null==o?void 0:o.lastQuestionIndex,t=O(e)&&e>=0&&i.questions.length>e?e:0;return O(d)&&d>=0?d:t})),_=k[0],S=k[1],x=Cl((()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter((e=>e>=0&&i.questions.length>e))})),C=x[0],M=x[1],T=Il((()=>kh(i)),[i]);Ml((()=>{!y||I(d)||0>d||S(d)}),[d,y]);var E=!(null==(t=i.appearance)||!t.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),R=T.at(_);return R?Dh("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(r=i.appearance)?void 0:r.hideCancelButton)&&Dh(Gh,{onClick(){v()}}),Dh("div",{className:"survey-box","data-question-index":_,children:Ic({question:R,forceDisableHtml:n,displayQuestionIndex:_,appearance:i.appearance||hh,onSubmit:e=>(e=>{var t=e.res,r=e.displayQuestionIndex,n=e.questionId;if(a)if(n){var o=si(n),s=h({},u,{[o]:t});l(s);var c=cc(i,r,t),d=c===$l.End,v=[...C,r];if(d||(M(v),S(c),Eh(i,{surveySubmissionId:g,responses:s,lastQuestionIndex:c,visitedIndices:v,surveyLanguage:w})),i.enable_partial_responses||d){var f=new Set(v.map((e=>{var t;return null==(t=T[e])?void 0:t.id})).filter((e=>!!e)).map((e=>si(e)))),p=Object.fromEntries(Object.entries(s).filter((e=>f.has(e[0]))));ph({responses:p,survey:i,surveySubmissionId:g,isSurveyCompleted:d,posthog:a,properties:b,surveyLanguage:w})}}else Vl.error("onNextButtonClick called without a questionId.");else Vl.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:_,questionId:R.id}),onPreviewSubmit:p,initialValue:R.id?u[si(R.id)]:void 0,canGoBack:E,onBack(){if(y)m();else if(0!==C.length){var e=C[C.length-1],t=C.slice(0,-1);M(t),S(e),Eh(i,{surveySubmissionId:g,responses:u,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:w})}}})})]}):null}function Tc(e){var t,r,i,n,a,o,s,u=e.survey,l=e.forceDisableHtml,h=e.posthog,c=e.readOnly,d=e.surveyLanguage,v=Cl(!0),f=v[0],p=v[1],m=Cl(!1),g=m[0],y=m[1],b=Cl({}),w=b[0],k=b[1],_=Tl(void 0),S=()=>{y(!g)};if(Ml((()=>{var e;if(h){if(!c){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&k({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===u.id&&(Vl.info("Received show event for feedback button survey "+u.id),k(r.detail.position||{}),S())};return Pe(pc,gc,t),()=>{I(_.current)||(clearTimeout(_.current),_.current=void 0),pc.removeEventListener(gc,t)}}}else Vl.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),_c({survey:u,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{u.schedule!==Ul&&p(!1),I(_.current)||clearTimeout(_.current),_.current=setTimeout((()=>{_.current=void 0,y(!1)}),200)};return Dh(Wu,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Dh("button",{className:"ph-survey-widget-tab "+((null==(a=u.appearance)?void 0:a.tabPosition)===jl.Top?"widget-tab-top":""),onClick:S,disabled:c,style:xc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),g&&Dh(Cc,{posthog:h,survey:u,forceDisableHtml:l,style:w,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:d})]})}var Ic=e=>{var t=e.question,r=e.onSubmit,i=e.onPreviewSubmit,n={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit(e){i(e)},onSubmit(e){r(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case Hl.Open:return $u(ec,h({},n,{question:t,key:t.id}));case Hl.Link:return $u(tc,h({},n,{question:t,key:t.id}));case Hl.Rating:return $u(rc,h({},n,{question:t,key:t.id}));case Hl.SingleChoice:case Hl.MultipleChoice:return $u(nc,h({},n,{question:t,key:t.id}));default:return Vl.error("Unsupported question type: "+t.type),null}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.generateSurveys=kc,s.extendPostHogWithSurveys=kc;var Ec=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),Rc=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return Ec(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,a=Math.min(e.length,r.remaining-2);a>n;){var o=Math.ceil((n+a)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?a=o-1:n=o}return Ec(t,JSON.stringify(e.slice(0,n)),r)},Ac=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,Lc=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},Oc=(e,t,r)=>{if(!r.truncated)if(T(e)){if(r.seen.has(e))return void Lc(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!{}.hasOwnProperty.call(e,i))continue;if(Oc(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else Lc(t,e,r)},Fc=function(e,t,r,i,n,a){if(void 0===n&&(n=!1),!Ac(e))return!n||Ec(t,"null",r);if(A(e)||(e=>{try{return O(e)||F(e)}catch(e){return!1}})(e))return Ec(t,JSON.stringify(e),r);if("string"==typeof e)return Rc(e,t,r);if(!T(e)&&!C(e))return Ec(t,JSON.stringify(e),r);if(i.has(e))return Rc("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(M(o))return Fc(o.call(e),t,r,i,n)}catch(e){}try{var s={}.toString.call(e);if("[object String]"===s)return Rc(String(e.valueOf()),t,r);if("[object Number]"===s||"[object Boolean]"===s)return Ec(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var u={};try{for(var l in e)({}).hasOwnProperty.call(e,l)&&(u[l]=e[l])}catch(e){}try{u.name=e.name}catch(e){}try{u.message=e.message}catch(e){}try{u.stack=e.stack}catch(e){}return Fc(u,t,r,i,n,a)}if(C(e)){if(!Ec(t,"[",r))return!1;for(var h=0;e.length>h;h++){if(h>0&&!Ec(t,",",r))return!1;var c=void 0;try{c=e[h]}catch(e){c=void 0}if(!Fc(c,t,r,i,!0))return!1}return Ec(t,"]",r)}if(!Ec(t,"{",r))return!1;var d=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(a)try{Oc(f,v,a)}catch(e){}if(Ac(f)){var p=(d?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var m=t.length,g=r.remaining,y=r.truncated;if(!Ec(t,p,r))return!1;var b=t.length,w=Fc(f,t,r,i,!1),k=r.truncated;if(t.length!==b){if(d=!1,!w)return!1}else if(t.length=m,r.remaining=g,r.truncated=w?y:k,!w)return!1}}}catch(e){}return Ec(t,"}",r)},Nc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.logs={initializeLogs(e){var t={host:s.location.host},r=!1,i=function(i){var n=s.console[i],a=(n=>function(){for(var a=!1,o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];try{if(u.length>0&&!r&&e.is_capturing()){var c;r=!0,a=!0;var d=((e,t)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=T(e[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([e[0]])}:void 0,a=0;e.length>a&&(0>=a||Ec(r," ",i))&&Fc(e[a],r,i,new WeakSet,!1,0===a?n:void 0);a++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(u),v=d.body,f=d.attributes,p=h({},t,d.truncated?{body_truncated:"true"}:{});null==(c=e.logs)||c.vi({level:Nc[i],body:v,attributes:h({"log.source":"console."+i},p,f)})}}catch(e){}finally{a&&(r=!1),n.apply(s.console,u)}})(n);a.__rrweb_original__=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(n),s.console[i]=a};for(var n of Object.keys(Nc))i(n)}},Oe("[Error tracking]");var Dc=Oe("[ExceptionAutocapture]"),Pc=new class{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),a=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var t=this;return l((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&C(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r,i;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),h({},e,{cause:r,stack:i})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return l((function*(){var r=e;for(var i of t.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,t){var r,i,n,a={type:e.type,value:e.value,mechanism:{type:null!==(r=t.type)&&void 0!==r?r:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(n=e.synthetic)&&void 0!==n&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,h({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:pe(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,r){void 0===r&&(r=0);var i=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return h({},t,{syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,r),next:e=>i(e,r+1)})}}([new class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=E(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return P(e,"DOMException")}isDOMError(e){return P(e,"DOMError")}},new class{match(e){return P(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!j(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return D(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}},new class{constructor(){}match(e){return!!P(e,"ErrorEvent")&&(null!=e.error||this.fi(e))}coerce(e,t){var r;if(null!=e.error)return t.apply(e.error);var i=t.apply(e.message);return h({},i,{stack:null!==(r=this.pi(e))&&void 0!==r?r:i.stack,synthetic:!0})}fi(e){return E(e.message)&&e.message.length>0}pi(e){var t,r,i=e,n=null!==(t=i.lineno)&&void 0!==t?t:0,a=null!==(r=i.colno)&&void 0!==r?r:0;if(E(i.filename)&&0!==i.filename.length&&0!==n)return"Error\n at "+i.filename+":"+n+":"+a}},new class{match(e){return q(e)}coerce(e,t){var r,i=this.getStack(e),n=void 0===i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=i?i:null==(r=t.syntheticException)?void 0:r.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:n}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}},new class{match(e){return j(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Ee(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null!==(r=this.getStack(e))&&void 0!==r?r:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(j(e))return e.constructor.name;var t="name"in e?e.name:void 0;return E(t)&&!R(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Ee(e)}isSeverityLevel(e){return E(e)&&!R(e)&&Ie.indexOf(e)>=0}getStack(e){try{return E(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:E(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(q(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},new class{match(e){return"string"==typeof e}coerce(e,t){var r,i=this.getInfos(e),n=i[0],a=i[1];return{type:null!=n?n:"Error",value:null!=a?a:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Te);return i&&(t=i[1],r=i[2]),[t,r]}},new class{match(e){return D(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var n=[],a=t.split("\n"),o=i;a.length>o;o++){var s=a[o];if(1024>=s.length){var u=Me.test(s)?s.replace(Me,"$1"):s;if(!u.match(/\S*Error: /)){for(var l of r){var c=l(u,e);if(c){n.push(c);break}}if(n.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return h({},e,{filename:e.filename||(r=t,r[r.length-1]||{}).filename,function:e.function||me});var r}))}(n)}}("web:javascript",_e,Ce)),qc=t=>{var r=e;r||Dc.info("window not available, cannot wrap onerror");var i=r.onerror;return r.onerror=function(){for(var e,r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];var o=Pc.buildFromUnknown((e=>{var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4];if(null!=a)return a;if(E(t)&&E(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:r,lineno:i,colno:n})}catch(e){return t}return t})(n),{mechanism:{handled:!1}});return t(o),!!M(i)&&null!==(e=i(...n))&&void 0!==e&&e},r.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=r.onerror)||delete e.__POSTHOG_INSTRUMENTED__,r.onerror=i}},jc=function(t,r){void 0===r&&(r=!1);var i=e;i||Dc.info("window not available, cannot wrap onUnhandledRejection");var n=i.onunhandledrejection;return i.onunhandledrejection=function(e){var i,a=Pc.buildFromUnknown(e,{mechanism:{handled:!1}});return t(a),M(n)?null!==(i=n(e))&&void 0!==i&&i:r},i.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=i.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,i.onunhandledrejection=n}},Bc={wrapOnError:qc,wrapUnhandledRejection:jc,wrapConsoleError(e){var t=console;t||Dc.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),s=Pc.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});e(s),M(r)&&r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.errorWrappingFunctions=Bc,s.posthogErrorWrappingFunctions=Bc;var Hc=(e,t)=>{if(M(null==e?void 0:e.capture)){var r=null==t?void 0:t.autocaptureExceptions,i=!A(r)&&"object"==typeof r&&C(r.errors_to_ignore)?r.errors_to_ignore.reduce(((e,t)=>{try{e.push(new RegExp(t))}catch(e){Dc.error("Ignoring invalid legacy exception exclusion rule",t,e)}return e}),[]):[],n=t=>{try{null==e.capture||e.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(e){Dc.error("Failed to capture exception for a legacy client",e)}};qc((e=>{i.some((t=>e.$exception_list.some((e=>t.test(e.value||"")))))||n(e)})),jc(n,!0)}};s.extendPostHogWithExceptionAutoCapture=Hc,s.extendPostHogWithExceptionAutocapture=Hc;var $c="X-POSTHOG-SESSION-ID",Uc="X-POSTHOG-WINDOW-ID",Wc="X-POSTHOG-DISTINCT-ID",zc=[$c,Uc,Wc],Vc=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Zc=(e,t)=>({}.hasOwnProperty.call(e,t)),Qc=e=>"object"==typeof e&&!A(e)||M(e),Gc=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),Yc=t=>{try{var r;return Gc(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==e||null==(r=e.location)?void 0:r.href).toString()}catch(e){return}},Jc=(e,t,r,i,n)=>{var a;try{a=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(C(e)&&!e.includes(a))return!1;var o=!1;if(r){var s=r.checkAndGetSessionAndWindowId(!0),u=s.windowId;n.set($c,s.sessionId),n.set(Uc,u),o=!0}var l=(e=>M(e)?e():e)(t);return l&&"$posthog_cookieless"!==l&&(n.set(Wc,l),o=!0),o};s.__PosthogExtensions__=s.__PosthogExtensions__||{};var Kc={_patchFetch:(t,r,i)=>Qs(e,"fetch",(e=>function(n,a){var o=arguments.length>1?[n,a]:[n],s=o;try{var u=Yc(n);if(u)if(Gc(n)){var l=new Request(n,a);Jc(t,r,i,l.url,l.headers),s=[l]}else{var c=new Headers(Qc(a)?a.headers:void 0);if(Jc(t,r,i,u,c)){var d=((e,t)=>{if(I(e)||A(e))return{headers:t};if(Qc(e)){var r=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(r);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),i}return new Proxy({headers:t},{get:(e,t)=>Zc(e,t)?Reflect.get(e,t):Reflect.get(r,t,r),has:(e,t)=>Zc(e,t)||t in r,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(r).forEach((e=>t.add(e))),Vc.forEach((e=>{e in r&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i)return i;if("string"==typeof t&&Vc.includes(t)&&t in r)return{configurable:!0,enumerable:!0,get(){return Reflect.get(r,t,r)}};var n=Reflect.getOwnPropertyDescriptor(r,t);return n?h({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(r)})}})(a,c);d&&(s=[n,d])}}}catch(e){s=o}return e.apply(this,s)})),_patchXHR:(t,r,i)=>Qs(e.XMLHttpRequest.prototype,"open",(e=>function(n,a,o,s,u){void 0===o&&(o=!0);var l=this,h=new Headers,c=Yc(a);c&&Jc(t,r,i,c,h);var d=e.call(l,n,a,o,s,u);return zc.forEach((e=>{var t=h.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}})),d}))};s.__PosthogExtensions__.tracingHeadersPatchFns=Kc,s.postHogTracingHeadersPatchFns=Kc,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(e){var t=this.length,r=Math.trunc(e)||0;return 0>r&&(r+=t),0>r||r>=t?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});let Xc=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(e){var t;if(!e.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}};var ed=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},td=e=>{if("loading"===document.readyState)return"loading";var t=ed();if(t){if(t.domInteractive>e)return"loading";if(0===t.domContentLoadedEventStart||t.domContentLoadedEventStart>e)return"dom-interactive";if(0===t.domComplete||t.domComplete>e)return"dom-content-loaded"}return"complete"},rd=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},id=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,i,n=e,a=n.id?"#"+n.id:[rd(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(t.length+a.length>99)return t||a;if(t=t?a+">"+t:a,n.id)break;e=n.parentNode}}catch(e){}return t},nd=new WeakMap;function ad(e,t){var r=nd.get(t);return r||(r=new WeakMap,nd.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var od=-1,sd=()=>od,ud=e=>{addEventListener("pageshow",(t=>{t.persisted&&(od=t.timeStamp,e(t))}),!0)},ld=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},hd=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},cd=()=>{var e,t;return null!==(e=null==(t=ed())?void 0:t.activationStart)&&void 0!==e?e:0},dd=-1,vd=new Set,fd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,pd=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of vd)t();isFinite(dd)||(dd="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",pd,!0))}},md=function(e){if(void 0===e&&(e=!1),e&&(dd=1/0),0>dd){var t,r=cd(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=r)))?void 0:t.startTime;dd=null!=i?i:fd(),addEventListener("visibilitychange",pd,!0),addEventListener("prerenderingchange",pd,!0),ud((()=>{setTimeout((()=>{dd=fd()}))}))}return{get firstHiddenTime(){return dd},onHidden(e){vd.add(e)}}},gd=function(e,t,r,i,n,a,o){void 0===t&&(t=-1),void 0===i&&(i=0);var s=ed(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>sd()?s&&(document.prerendering||cd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},yd=function(e,t,r){void 0===r&&(r={});try{var i=e.filter((e=>PerformanceObserver.supportedEntryTypes.includes(e)));if(i.length>0){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{var r=e.getEntries();i.length>1&&r.sort(((e,t)=>e.startTime+e.duration-(t.startTime+t.duration))),t(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(e){}},bd=e=>{var t;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(t=globalThis.PerformanceSoftNavigation)||null==(t=t.prototype)?void 0:t.getLargestInteractionContentfulPaint)&&e&&e.reportSoftNavs},wd=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){var r=e.keys().next().value;void 0!==r&&e.delete(r)}},kd=e=>{var t=!1;return()=>{t||(e(),t=!0)}};let _d=class{constructor(){this.u=void 0}};var Sd,xd=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Cd=[1800,3e3],Md=function(e,t){void 0===t&&(t={});var r=bd(t);xd((()=>{var i,n=ad(t,_d),a=md(),o=gd("FCP"),s=yd(["paint"],(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),a.firstHiddenTime>t.startTime&&(o.value=Math.max(t.startTime-cd(),0),o.entries.push(t),o.navigationId=t.navigationId||o.navigationId,i(!0)))}));s&&(i=ld(e,o,Cd,t.reportAllChanges),ud((r=>{o=gd("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,sd()),i=ld(e,o,Cd,t.reportAllChanges),hd((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&yd(["soft-navigation"],(r=>{r.forEach((r=>{n.u&&r.navigationId&&wd(n.u,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=gd("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=ld(e,o,Cd,t.reportAllChanges))(!0)}))}),t)}))},Td=[.1,.25],Id=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],Ed=0,Rd=1/0,Ad=0,Ld=e=>{for(var t of e)t.interactionId&&(Rd=Math.min(Rd,t.interactionId),Ad=Math.max(Ad,t.interactionId),Ed=Ad?(Ad-Rd)/7+1:0)},Od=()=>{var e;return Sd?Ed:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Fd=0;let Nd=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){Fd=Od(),this.h.length=0,this.v.clear()}T(e){var t=Od()-Fd,r=Math.min(this.h.length-1,Math.floor(t/50));return!t||-1!==r||"soft-navigation"!==e&&"back-forward-cache"!==e?this.h[r]:{D:8,id:-1,entries:[]}}l(e){var t;if(null!=(t=this.p)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.h.at(-1),i=this.v.get(e.interactionId);if(i||10>this.h.length||e.duration>r.D){var n;if(i?e.duration>i.D?(i.entries=[e],i.D=e.duration):e.duration===i.D&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.v.set((i={id:e.interactionId,entries:[e],D:e.duration}).id,i),this.h.push(i)),this.h.sort(((e,t)=>t.D-e.D)),this.h.length>10){var a=this.h.splice(10);for(var o of a)this.v.delete(o.id)}null==(n=this.m)||n.call(this,i)}}}};var Dd=e=>{var t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=kd(e),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:t})}},Pd=[200,500];let qd=class{constructor(){this.p=void 0,this.u=void 0}l(e){var t;null==(t=this.p)||t.call(this,e)}};var jd=[2500,4e3],Bd=-1,Hd=()=>Bd,$d=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Bd=t.timeStamp,e(t))}),!0)},Ud=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},Wd=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},zd=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Vd=()=>{var e,t;return null!==(e=null==(t=zd())?void 0:t.activationStart)&&void 0!==e?e:0},Zd=-1,Qd=new Set,Gd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Yd=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Qd)t();isFinite(Zd)||(Zd="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Yd,!0))}},Jd=function(e){if(void 0===e&&(e=!1),e&&(Zd=1/0),0>Zd){var t,r=Vd(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=r)))?void 0:t.startTime;Zd=null!=i?i:Gd(),addEventListener("visibilitychange",Yd,!0),addEventListener("prerenderingchange",Yd,!0),$d((()=>{setTimeout((()=>{Zd=Gd()}))}))}return{get firstHiddenTime(){return Zd},onHidden(e){Qd.add(e)}}},Kd=function(e,t,r,i,n,a,o){void 0===t&&(t=-1),void 0===i&&(i=0);var s=zd(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>Hd()?s&&(document.prerendering||Vd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},Xd=new WeakMap;function ev(e,t){var r=Xd.get(t);return r||(r=new WeakMap,Xd.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}let tv=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}};var rv=function(e,t,r){void 0===r&&(r={});try{var i=e.filter((e=>PerformanceObserver.supportedEntryTypes.includes(e)));if(i.length>0){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{var r=e.getEntries();i.length>1&&r.sort(((e,t)=>e.startTime+e.duration-(t.startTime+t.duration))),t(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(e){}},iv=e=>{var t;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(t=globalThis.PerformanceSoftNavigation)||null==(t=t.prototype)?void 0:t.getLargestInteractionContentfulPaint)&&e&&e.reportSoftNavs},nv=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){var r=e.keys().next().value;void 0!==r&&e.delete(r)}},av=e=>{var t=!1;return()=>{t||(e(),t=!0)}};let ov=class{constructor(){this.l=void 0}};var sv,uv=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},lv=[1800,3e3],hv=function(e,t){void 0===t&&(t={});var r=iv(t);uv((()=>{var i,n=ev(t,ov),a=Jd(),o=Kd("FCP"),s=rv(["paint"],(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),a.firstHiddenTime>t.startTime&&(o.value=Math.max(t.startTime-Vd(),0),o.entries.push(t),o.navigationId=t.navigationId||o.navigationId,i(!0)))}));s&&(i=Ud(e,o,lv,t.reportAllChanges),$d((r=>{o=Kd("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Hd()),i=Ud(e,o,lv,t.reportAllChanges),Wd((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&rv(["soft-navigation"],(r=>{r.forEach((r=>{n.l&&r.navigationId&&nv(n.l,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Kd("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Ud(e,o,lv,t.reportAllChanges))(!0)}))}),t)}))},cv=[.1,.25],dv=function(e,t){void 0===t&&(t={});var r=Jd();hv(av((()=>{var i,n=Kd("CLS",0),a=ev(t,tv),o=(r,o,s,u,l)=>{n=Kd("CLS",0,r,o,s,u,l),a.i=0,i=Ud(e,n,cv,t.reportAllChanges)},s=function(e){void 0===e&&(e=!1),a.i>n.value&&(n.value=a.i,n.entries=a.o),i(e)},u=e=>{s(!0),o("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(var t of e)"soft-navigation"!==t.entryType?a.h(t):u(t);s()},h=["layout-shift"];iv(t)&&h.push("soft-navigation");var c=rv(h,l);c&&(i=Ud(e,n,cv,t.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),$d((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Hd()),Wd(i)})),setTimeout(i))})))},vv=0,fv=1/0,pv=0,mv=e=>{for(var t of e)t.interactionId&&(fv=Math.min(fv,t.interactionId),pv=Math.max(pv,t.interactionId),vv=pv?(pv-fv)/7+1:0)},gv=()=>{var e;return sv?vv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},yv=0;let bv=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){yv=gv(),this.u.length=0,this.v.clear()}M(e){var t=gv()-yv,r=Math.min(this.u.length-1,Math.floor(t/50));return!t||-1!==r||"soft-navigation"!==e&&"back-forward-cache"!==e?this.u[r]:{_:8,id:-1,entries:[]}}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.v.get(e.interactionId);if(i||10>this.u.length||e.duration>r._){var n;if(i?e.duration>i._?(i.entries=[e],i._=e.duration):e.duration===i._&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.v.set((i={id:e.interactionId,entries:[e],_:e.duration}).id,i),this.u.push(i)),this.u.sort(((e,t)=>t._-e._)),this.u.length>10){var a=this.u.splice(10);for(var o of a)this.v.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var wv=e=>{var t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=av(e),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:t})}},kv=[200,500],_v=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Jd();uv((()=>{var i;"interactionCount"in performance||sv||(sv=rv(["event"],mv,{durationThreshold:0}));var n,a=Kd("INP"),o=ev(t,bv),s=(r,i,s,u,l)=>{o.T(),a=Kd("INP",-1,r,i,s,u,l),n=Ud(e,a,kv,t.reportAllChanges)},u=()=>{var e=o.M(a.navigationType);e&&e._!==a.value&&(a.value=e._,a.entries=e.entries,n())},l=e=>{u(),n(!0),s("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},c=function(e,t){void 0===t&&(t=!1),wv((()=>{for(var r of e)"soft-navigation"!==r.entryType?o.h(r):l(r);u(),t&&n(!0)}))},d=["event","first-input"];iv(t)&&d.push("soft-navigation");var v=rv(d,c,h({},t,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40}));n=Ud(e,a,kv,t.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),$d((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Hd())})))}))}};let Sv=class{constructor(){this.m=void 0,this.l=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}};var xv=[2500,4e3],Cv=function(e,t){void 0===t&&(t={});var r=!1,i=iv(t);uv((()=>{var n,a=Jd(),o=Kd("LCP"),s=ev(t,Sv),u=(i,s,u,l,h)=>{o=Kd("LCP",-1,i,s,u,l,h),n=Ud(e,o,xv,t.reportAllChanges),r=!1,"soft-navigation"===i&&(a=Jd(!0))},l=e=>{s.l&&e.navigationId&&nv(s.l,e),r||n(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);var t=null==e.getLargestInteractionContentfulPaint?void 0:e.getLargestInteractionContentfulPaint();t&&h([t])},h=e=>{for(var r of(t.reportAllChanges||i||(e=e.slice(-1)),e))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-Vd(),0),s.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.h(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=rv(c,h);if(d){n=Ud(e,o,xv,t.reportAllChanges);var v=["keydown","click","visibilitychange"],f=e=>{if(e.isTrusted&&!r){var t=o.id;wv((()=>{if(!r){if(!i)for(var e of(d.disconnect(),v))removeEventListener(e,f,{capture:!0});t===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});$d((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Hd()),n=Ud(e,o,xv,t.reportAllChanges),Wd((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))},Mv={onLCP(e,t){void 0===t&&(t={});var r=ad(t=Object.assign({},t),qd),i=new WeakMap;bd(t)&&(r.u=new Map),r.p=e=>{var r=e.element;if(r){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:id(r);i.set(e,a)}else e.id&&i.set(e,"#"+e.id)},function(e,t){void 0===t&&(t={});var r=!1,i=bd(t);xd((()=>{var n,a=md(),o=gd("LCP"),s=ad(t,qd),u=(i,s,u,l,h)=>{o=gd("LCP",-1,i,s,u,l,h),n=ld(e,o,jd,t.reportAllChanges),r=!1,"soft-navigation"===i&&(a=md(!0))},l=e=>{s.u&&e.navigationId&&wd(s.u,e),r||n(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);var t=null==e.getLargestInteractionContentfulPaint?void 0:e.getLargestInteractionContentfulPaint();t&&h([t])},h=e=>{for(var r of(t.reportAllChanges||i||(e=e.slice(-1)),e))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-cd(),0),s.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.l(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=yd(c,h);if(d){n=ld(e,o,jd,t.reportAllChanges);var v=["keydown","click","visibilitychange"],f=e=>{if(e.isTrusted&&!r){var t=o.id;Dd((()=>{if(!r){if(!i)for(var e of(d.disconnect(),v))removeEventListener(e,f,{capture:!0});t===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});ud((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,sd()),n=ld(e,o,jd,t.reportAllChanges),hd((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))}((t=>{e((e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n,a,o,s,u,l,c=e.entries.at(-1),d=c.url&&performance.getEntriesByType("resource").find((e=>e.name===c.url));t.target=i.get(c),t.lcpEntry=c,c.url&&(t.url=c.url),d&&(t.lcpResourceEntry=d);var v=0,f=0;if("soft-navigation"!==e.navigationType?(v=null!==(n=null==(a=l=ed())?void 0:a.activationStart)&&void 0!==n?n:0,f=null!==(o=null==(s=l)?void 0:s.responseStart)&&void 0!==o?o:0):(v=e.navigationStartTime||0,l=null==(u=r.u)?void 0:u.get(e.navigationId)),l){var p=Math.max(0,f-v),m=Math.max(p,d?(d.requestStart||d.startTime)-v:0),g=Math.min(e.value,Math.max(m,d?d.responseEnd-v:0));t=h({},t,{timeToFirstByte:p,resourceLoadDelay:m-p,resourceLoadDuration:g-m,elementRenderDelay:e.value-g,navigationEntry:l})}}return Object.assign(e,{attribution:t})})(t))}),t)},onCLS(e,t){void 0===t&&(t={});var r=ad(t=Object.assign({},t),Xc),i=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var n=Id(e.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==t.generateTarget?void 0:t.generateTarget(a))&&void 0!==o?o:id(a);i.set(n,s)}}},function(e,t){void 0===t&&(t={});var r=md();Md(kd((()=>{var i,n=gd("CLS",0),a=ad(t,Xc),o=(r,o,s,u,l)=>{n=gd("CLS",0,r,o,s,u,l),a.o=0,i=ld(e,n,Td,t.reportAllChanges)},s=function(e){void 0===e&&(e=!1),a.o>n.value&&(n.value=a.o,n.entries=a.i),i(e)},u=e=>{s(!0),o("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(var t of e)"soft-navigation"!==t.entryType?a.l(t):u(t);s()},h=["layout-shift"];bd(t)&&h.push("soft-navigation");var c=yd(h,l);c&&(i=ld(e,n,Td,t.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),ud((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,sd()),hd(i)})),setTimeout(i))})))}((t=>{e((e=>{var t={};if(e.entries.length){var r,n=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=n&&null!=(r=n.sources)&&r.length){var a=Id(n.sources);a&&(t={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:td(n.startTime)})}}return Object.assign(e,{attribution:t})})(t))}),t)},onFCP(e,t){void 0===t&&(t={});var r=ad(t=Object.assign({},t),_d);bd(t)&&(r.u=new Map),Md((t=>{e((e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:td(sd())};if("soft-navigation"!==e.navigationType){if(e.entries.length){var i=ed(),n=e.entries.at(-1);if(i){var a=Math.max(0,i.responseStart-(i.activationStart||0));t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:td(e.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var o,s=null==(o=r.u)?void 0:o.get(e.navigationId);s&&(t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:"complete",navigationEntry:s})}return Object.assign(e,{attribution:t})})(t))}),t)},onINP(e,t){void 0===t&&(t={});var r=ad(t=Object.assign({},t),Nd),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(Dd(c),u=!0)},c=()=>{var e=new Set(r.h.map((e=>o.get(e.entries[0])))),t=n.length-10;n=n.filter(((r,i)=>i>=t||e.has(r)));var s=new Set;for(var l of n){var h=d(l.startTime,l.processingEnd);for(var c of h)s.add(c)}i=i.filter((e=>e.startTime>a||s.has(e))),u=!1};r.p=e=>{var r,i=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),t.includeProcessedEventEntries&&r.entries.push(e);break}}r||n.push(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:i,entries:t.includeProcessedEventEntries?[e]:[]}),(e.interactionId||"first-input"===e.entryType)&&o.set(e,r),l()},r.m=e=>{if(!s.get(e)){var r,i=null==(r=e.entries.find((e=>e.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(i))&&void 0!==n?n:id(i);s.set(e,a)}else{var o,u=null==(o=e.entries.find((e=>e.targetSelector)))?void 0:o.targetSelector;u&&s.set(e,u)}}};var d=(e,t)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=e){if(n.startTime>t)break;r.push(n)}return r};yd(["long-animation-frame"],(e=>{i=i.concat(e),l()}),t),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=md();xd((()=>{var i;"interactionCount"in performance||Sd||(Sd=yd(["event"],Ld,{durationThreshold:0}));var n,a=gd("INP"),o=ad(t,Nd),s=(r,i,s,u,l)=>{o.M(),a=gd("INP",-1,r,i,s,u,l),n=ld(e,a,Pd,t.reportAllChanges)},u=()=>{var e=o.T(a.navigationType);e&&e.D!==a.value&&(a.value=e.D,a.entries=e.entries,n())},l=e=>{u(),n(!0),s("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},c=function(e,t){void 0===t&&(t=!1),Dd((()=>{for(var r of e)"soft-navigation"!==r.entryType?o.l(r):l(r);u(),t&&n(!0)}))},d=["event","first-input"];bd(t)&&d.push("soft-navigation");var v=yd(d,c,h({},t,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40}));n=ld(e,a,Pd,t.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),ud((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,sd())})))}))}}((t=>{e((e=>{if(0===e.entries.length){var t={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:e.value,loadState:td(e.navigationStartTime||0)};return Object.assign(e,{attribution:t})}var i=e.entries[0],n=o.get(i),a=n.processingStart,u=Math.max(i.startTime+i.duration,a),l=Math.min(n.processingEnd,u),h=n.entries.sort(((e,t)=>e.processingStart-t.processingStart)),c=d(i.startTime,l),v=r.v.get(i.interactionId),f={interactionTarget:s.get(v),interactionType:i.name.startsWith("key")?"keyboard":"pointer",interactionTime:i.startTime,nextPaintTime:u,processedEventEntries:h,longAnimationFrameEntries:c,inputDelay:a-i.startTime,processingDuration:l-a,presentationDelay:u-l,loadState:td(i.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{var r=e.interactionTime,i=e.nextPaintTime;if(null!=(t=e.longAnimationFrameEntries)&&t.length&&r&&i){var n,a,o=e.inputDelay,s=e.processingDuration,u=0,l=0,h=0,c=0;for(var d of e.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var f=v.startTime+v.duration;if(f>=r){var p=f-Math.max(r,v.startTime),m=v.duration?p/v.duration*v.forcedStyleAndLayoutDuration:0;u+=p-m,l+=m,p>c&&(a=r+o>v.startTime?"input-delay":r+o+s>v.startTime?"processing-duration":"presentation-delay",n=v,c=p)}}var g=e.longAnimationFrameEntries.at(-1),y=g?g.startTime+g.duration:0;y>=r+o+s&&(h=i-y),n&&a&&(e.longestScript={entry:n,subpart:a,intersectingDuration:c}),e.totalScriptDuration=u,e.totalStyleAndLayoutDuration=l,e.totalPaintDuration=h,e.totalUnattributedDuration=i-r-u-l-h}})(f),Object.assign(e,{attribution:f})})(t))}),t)},withoutAttribution:{onLCP:Cv,onCLS:dv,onFCP:hv,onINP:_v}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Mv,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Mv,s.postHogWebVitalsCallbacks=Mv;var Tv={onLCP:Cv,onCLS:dv,onFCP:hv,onINP:_v};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Tv,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Tv,s.postHogWebVitalsCallbacks=Tv,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Tv;let Iv=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(e){var t;if(!e.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}};var Ev=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Rv=e=>{if("loading"===document.readyState)return"loading";var t=Ev();if(t){if(t.domInteractive>e)return"loading";if(0===t.domContentLoadedEventStart||t.domContentLoadedEventStart>e)return"dom-interactive";if(0===t.domComplete||t.domComplete>e)return"dom-content-loaded"}return"complete"},Av=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Lv=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,i=e,n=i.id?"#"+i.id:[Av(i),...Array.from(i.classList).sort()].join(".");if(t.length+n.length>99)return t||n;if(t=t?n+">"+t:n,i.id)break;e=i.parentNode}}catch(e){}return t},Ov=new WeakMap;function Fv(e,t){var r=Ov.get(t);return r||(r=new WeakMap,Ov.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var Nv,Dv=-1,Pv=()=>Dv,qv=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Dv=t.timeStamp,e(t))}),!0)},jv=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},Bv=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},Hv=()=>{var e,t;return null!==(e=null==(t=Ev())?void 0:t.activationStart)&&void 0!==e?e:0},$v=function(e,t){void 0===t&&(t=-1);var r=Ev(),i="navigate";return 0>Pv()?r&&(document.prerendering||Hv()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Uv=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(h({type:e,buffered:!0},r)),i}}catch(e){}},Wv=e=>{var t=!1;return()=>{t||(e(),t=!0)}},zv=-1,Vv=new Set,Zv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Qv=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Vv)t();isFinite(zv)||(zv="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Qv,!0))}},Gv=()=>{if(0>zv){var e,t=Hv(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;zv=null!=r?r:Zv(),addEventListener("visibilitychange",Qv,!0),addEventListener("prerenderingchange",Qv,!0),qv((()=>{setTimeout((()=>{zv=Zv()}))}))}return{get firstHiddenTime(){return zv},onHidden(e){Vv.add(e)}}},Yv=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Jv=[1800,3e3],Kv=function(e,t){void 0===t&&(t={}),Yv((()=>{var r,i=Gv(),n=$v("FCP"),a=Uv("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-Hv(),0),n.entries.push(t),r(!0)))}));a&&(r=jv(e,n,Jv,t.reportAllChanges),qv((i=>{n=$v("FCP"),r=jv(e,n,Jv,t.reportAllChanges),Bv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Xv=[.1,.25],ef=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],tf=0,rf=1/0,nf=0,af=e=>{for(var t of e)t.interactionId&&(rf=Math.min(rf,t.interactionId),nf=Math.max(nf,t.interactionId),tf=nf?(nf-rf)/7+1:0)},of=()=>{var e;return Nv?tf:null!==(e=performance.interactionCount)&&void 0!==e?e:0},sf=0;let uf=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){sf=of(),this.l.length=0,this.h.clear()}M(){var e=Math.min(this.l.length-1,Math.floor((of()-sf)/50));return this.l[e]}u(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.h.get(e.interactionId);if(i||10>this.l.length||e.duration>r.T){var n;if(i?e.duration>i.T?(i.entries=[e],i.T=e.duration):e.duration===i.T&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.h.set((i={id:e.interactionId,entries:[e],T:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.T-e.T)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.h.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var lf=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=Wv(e),n=-1,a=()=>{r(n),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()}))}},hf=[200,500];let cf=class{constructor(){this.m=void 0}u(e){var t;null==(t=this.m)||t.call(this,e)}};var $=[2500,4e3],df=-1,vf=e=>{addEventListener("pageshow",(t=>{t.persisted&&(df=t.timeStamp,e(t))}),!0)},ff=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},pf=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},mf=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},gf=()=>{var e,t;return null!==(e=null==(t=mf())?void 0:t.activationStart)&&void 0!==e?e:0},yf=function(e,t){void 0===t&&(t=-1);var r=mf(),i="navigate";return 0>df?r&&(document.prerendering||gf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},bf=new WeakMap;function wf(e,t){var r=bf.get(t);return r||(r=new WeakMap,bf.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class kf{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var _f,Sf=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(h({type:e,buffered:!0},r)),i}}catch(e){}},xf=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Cf=-1,Mf=new Set,Tf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,If=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Mf)t();isFinite(Cf)||(Cf="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",If,!0))}},Ef=()=>{if(0>Cf){var e,t=gf(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;Cf=null!=r?r:Tf(),addEventListener("visibilitychange",If,!0),addEventListener("prerenderingchange",If,!0),vf((()=>{setTimeout((()=>{Cf=Tf()}))}))}return{get firstHiddenTime(){return Cf},onHidden(e){Mf.add(e)}}},Rf=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Af=[1800,3e3],Lf=function(e,t){void 0===t&&(t={}),Rf((()=>{var r,i=Ef(),n=yf("FCP"),a=Sf("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-gf(),0),n.entries.push(t),r(!0)))}));a&&(r=ff(e,n,Af,t.reportAllChanges),vf((i=>{n=yf("FCP"),r=ff(e,n,Af,t.reportAllChanges),pf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Of=[.1,.25],Ff=function(e,t){void 0===t&&(t={});var r=Ef();Lf(xf((()=>{var i,n=yf("CLS",0),a=wf(t,kf),o=e=>{for(var t of e)a.h(t);a.i>n.value&&(n.value=a.i,n.entries=a.o,i())},s=Sf("layout-shift",o);s&&(i=ff(e,n,Of,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),i(!0)})),vf((()=>{a.i=0,n=yf("CLS",0),i=ff(e,n,Of,t.reportAllChanges),pf(i)})),setTimeout(i))})))},Nf=0,Df=1/0,Pf=0,qf=e=>{for(var t of e)t.interactionId&&(Df=Math.min(Df,t.interactionId),Pf=Math.max(Pf,t.interactionId),Nf=Pf?(Pf-Df)/7+1:0)},jf=()=>{var e;return _f?Nf:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Bf=0;class Hf{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Bf=jf(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((jf()-Bf)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.u.get(e.interactionId);if(i||10>this.l.length||e.duration>r.L){var n;if(i?e.duration>i.L?(i.entries=[e],i.L=e.duration):e.duration===i.L&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.u.set((i={id:e.interactionId,entries:[e],L:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var $f=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=xf(e),n=-1,a=()=>{r(n),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()}))}},Uf=[200,500],Wf=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Ef();Rf((()=>{var i;"interactionCount"in performance||_f||(_f=Sf("event",qf,{durationThreshold:0}));var n,a=yf("INP"),o=wf(t,Hf),s=e=>{$f((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==a.value&&(a.value=r.L,a.entries=r.entries,n())}))},u=Sf("event",s,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=ff(e,a,Uf,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),n(!0)})),vf((()=>{o.v(),a=yf("INP"),n=ff(e,a,Uf,t.reportAllChanges)})))}))}};class zf{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var Vf=[2500,4e3],Zf=function(e,t){void 0===t&&(t={}),Rf((()=>{var r,i=Ef(),n=yf("LCP"),a=wf(t,zf),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-gf(),0),n.entries=[o],r())},s=Sf("largest-contentful-paint",o);if(s){r=ff(e,n,Vf,t.reportAllChanges);var u=xf((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&($f(u),removeEventListener(e.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});vf((i=>{n=yf("LCP"),r=ff(e,n,Vf,t.reportAllChanges),pf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},Qf={onLCP(e,t){void 0===t&&(t={});var r=Fv(t=Object.assign({},t),cf),i=new WeakMap;r.m=e=>{var r=e.element;if(r){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:Lv(r);i.set(e,a)}else e.id&&i.set(e,"#"+e.id)},function(e,t){void 0===t&&(t={}),Yv((()=>{var r,i=Gv(),n=$v("LCP"),a=Fv(t,cf),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.u(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Hv(),0),n.entries=[o],r())},s=Uv("largest-contentful-paint",o);if(s){r=jv(e,n,$,t.reportAllChanges);var u=Wv((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(lf(u),removeEventListener(e.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});qv((i=>{n=$v("LCP"),r=jv(e,n,$,t.reportAllChanges),Bv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))}((t=>{e((e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=e.entries.at(-1),n=r.url&&performance.getEntriesByType("resource").find((e=>e.name===r.url));t.target=i.get(r),t.lcpEntry=r,r.url&&(t.url=r.url),n&&(t.lcpResourceEntry=n);var a=Ev();if(a){var o=a.activationStart||0,s=Math.max(0,a.responseStart-o),u=Math.max(s,n?(n.requestStart||n.startTime)-o:0),l=Math.min(e.value,Math.max(u,n?n.responseEnd-o:0));t=h({},t,{timeToFirstByte:s,resourceLoadDelay:u-s,resourceLoadDuration:l-u,elementRenderDelay:e.value-l,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))}),t)},onCLS(e,t){void 0===t&&(t={});var r=Fv(t=Object.assign({},t),Iv),i=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var n=ef(e.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==t.generateTarget?void 0:t.generateTarget(a))&&void 0!==o?o:Lv(a);i.set(n,s)}}},function(e,t){void 0===t&&(t={});var r=Gv();Kv(Wv((()=>{var i,n=$v("CLS",0),a=Fv(t,Iv),o=e=>{for(var t of e)a.u(t);a.o>n.value&&(n.value=a.o,n.entries=a.i,i())},s=Uv("layout-shift",o);s&&(i=jv(e,n,Xv,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),i(!0)})),qv((()=>{a.o=0,n=$v("CLS",0),i=jv(e,n,Xv,t.reportAllChanges),Bv(i)})),setTimeout(i))})))}((t=>{e((e=>{var t={};if(e.entries.length){var r,n=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=n&&null!=(r=n.sources)&&r.length){var a=ef(n.sources);a&&(t={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:Rv(n.startTime)})}}return Object.assign(e,{attribution:t})})(t))}),t)},onFCP(e,t){void 0===t&&(t={}),Kv((t=>{e((e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Rv(Pv())};if(e.entries.length){var r=Ev(),i=e.entries.at(-1);if(r){var n=Math.max(0,r.responseStart-(r.activationStart||0));t={timeToFirstByte:n,firstByteToFCP:e.value-n,loadState:Rv(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})})(t))}),t)},onINP(e,t){void 0===t&&(t={});var r=Fv(t=Object.assign({},t),uf),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(lf(h),u=!0)},h=()=>{var e=new Set(r.l.map((e=>o.get(e.entries[0])))),t=n.length-10;n=n.filter(((r,i)=>i>=t||e.has(r)));var s=new Set;for(var l of n){var h=c(l.startTime,l.processingEnd);for(var d of h)s.add(d)}i=i.filter((e=>e.startTime>a||s.has(e))),u=!1};r.m=e=>{var r,i=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||n.push(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:i,entries:!1!==t.includeProcessedEventEntries?[e]:[]}),(e.interactionId||"first-input"===e.entryType)&&o.set(e,r),l()},r.p=e=>{if(!s.get(e)){var r,i=null==(r=e.entries.find((e=>e.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(i))&&void 0!==n?n:Lv(i);s.set(e,a)}else{var o,u=null==(o=e.entries.find((e=>e.targetSelector)))?void 0:o.targetSelector;u&&s.set(e,u)}}};var c=(e,t)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=e){if(n.startTime>t)break;r.push(n)}return r};Uv("long-animation-frame",(e=>{i=i.concat(e),l()})),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Gv();Yv((()=>{var i;"interactionCount"in performance||Nv||(Nv=Uv("event",af,{durationThreshold:0}));var n,a=$v("INP"),o=Fv(t,uf),s=e=>{lf((()=>{for(var t of e)o.u(t);var r=o.M();r&&r.T!==a.value&&(a.value=r.T,a.entries=r.entries,n())}))},u=Uv("event",s,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=jv(e,a,hf,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),n(!0)})),qv((()=>{o.v(),a=$v("INP"),n=jv(e,a,hf,t.reportAllChanges)})))}))}}((t=>{e((e=>{var t=e.entries[0],i=o.get(t),n=t.processingStart,a=Math.max(t.startTime+t.duration,n),u=Math.min(i.processingEnd,a),l=i.entries.sort(((e,t)=>e.processingStart-t.processingStart)),h=c(t.startTime,u),d=r.h.get(t.interactionId),v={interactionTarget:s.get(d),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:h,inputDelay:n-t.startTime,processingDuration:u-n,presentationDelay:a-u,loadState:Rv(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{if(null!=(t=e.longAnimationFrameEntries)&&t.length){var r,i,n=e.interactionTime,a=e.inputDelay,o=e.processingDuration,s=0,u=0,l=0,h=0;for(var c of e.longAnimationFrameEntries)for(var d of(u=u+c.startTime+c.duration-c.styleAndLayoutStart,c.scripts)){var v=d.startTime+d.duration;if(v>=n){var f=v-Math.max(n,d.startTime),p=d.duration?f/d.duration*d.forcedStyleAndLayoutDuration:0;s+=f-p,u+=p,f>h&&(i=n+a>d.startTime?"input-delay":n+a+o>d.startTime?"processing-duration":"presentation-delay",r=d,h=f)}}var m=e.longAnimationFrameEntries.at(-1),g=m?m.startTime+m.duration:0;g>=n+a+o&&(l=e.nextPaintTime-g),r&&i&&(e.longestScript={entry:r,subpart:i,intersectingDuration:h}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=u,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-u-l}})(v),Object.assign(e,{attribution:v})})(t))}),t)},withoutAttribution:{onLCP:Zf,onCLS:Ff,onFCP:Lf,onINP:Wf}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=Qf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Qf,s.postHogWebVitalsCallbacks=Qf;var Gf={onLCP:Zf,onCLS:Ff,onFCP:Lf,onINP:Wf};function Yf(e,t){return t.length>e?t.slice(0,e)+"...":t}function Jf(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!ze(t));return t}function Kf(t,r){var i,n,a=r.e,o=r.maskAllElementAttributes,s=r.maskAllText,u=r.elementAttributeIgnoreList,l=r.disableCaptureUrlHashes;if(!ze(t))return{props:{}};for(var c=[t],d=new Set([t]),v=t;v.parentNode&&!Ve(v,"body")&&Qe>c.length;)if(Ze(v.parentNode)){var f=v.parentNode.host;if(d.has(f))break;d.add(f),c.push(f),v=f}else{if(!ze(v.parentNode))break;if(d.has(v.parentNode))break;d.add(v.parentNode),c.push(v.parentNode),v=v.parentNode}var p,m,g=[],y={},b=!1,k=!1;if(Fe(c,(e=>{var t=it(e);if(Ve(e,"a")){var r=e.getAttribute("href");b=!!(t&&r&&dt(r))&&(l?ve(r):r)}w(Ye(e),"ph-no-capture")&&(k=!0),g.push(function(e,t,r,i,n){void 0===n&&(n=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};Ke.indexOf(a)>-1&&!r&&(o.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?Yf(1024,vt(e)):Yf(1024,Je(e)));var s=Ye(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Fe(e.attributes,(function(r){var a;if((!nt(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&dt(r.value)&&(!E(a=r.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var s=r.value;"class"===r.name&&(s=Ge(s).join(" ")),o["attr__"+r.name]=Yf(1024,"href"===r.name&&n?ve(s):s)}}));for(var u=1,l=1,h=e;h=Jf(h);)u++,h.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,o,s,u,l));var i=function(e){if(!it(e))return{};var t={};return Fe(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&dt(i)&&(t[r]=i)}})),t}(e);Ne(y,i)})),k)return{props:{},explicitNoCapture:k};if(s||(g[0].$el_text=Ve(t,"a")||Ve(t,"button")?vt(t):Je(t)),b){var _,S;g[0].attr__href=b;var x=null==(_=je(b))?void 0:_.host,C=null==e||null==(S=e.location)?void 0:S.host;x&&C&&x!==C&&(p=b)}return{props:Ne({$event_type:a.type,$ce_version:1},{$elements:g},{$elements_chain:(m=g,function(e){return e.map((e=>{var t,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))i+="."+n.replace(/"/g,"");var a=h({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return De(a).sort(((e,t)=>e[0].localeCompare(t[0]))).forEach((e=>{var t=e[1];return o[pt(e[0].toString())]=pt(t.toString())})),(i+=":")+De(o).map((e=>e[0]+'="'+e[1]+'"')).join("")})).join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:mt(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return De(e).filter((e=>0===e[0].indexOf("attr__"))).forEach((e=>i.attributes[e[0]]=e[1])),i}))}(m)))},null!=(i=g[0])&&i.$el_text?{$el_text:null==(n=g[0])?void 0:n.$el_text}:{},p&&"click"===a.type?{$external_click_url:p}:{},y)}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Gf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Gf,s.postHogWebVitalsCallbacks=Gf,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Gf,Oe("[AutoCapture]");var Xf={};function ep(t,r){var i=Xf[t];if(i)return i;var n=r[t];if((e=>M(e)&&-1!==e.toString().indexOf("[native code]"))(n)&&(null==e||!e.Zone))return Xf[t]=n.bind(r);var a=r.document;if(a&&M(a.createElement)){var o,s=!1;try{(o=a.createElement("iframe")).hidden=!0,a.head.appendChild(o);var u,l,h=o.contentWindow;h&&h[t]&&(n=h[t],"MutationObserver"===t&&function(e){return w(e,"AppleWebKit")&&!w(e,"Chrome")}(null!==(u=null==(l=r.navigator)?void 0:l.userAgent)&&void 0!==u?u:"")&&(o.classList.add("rr-block","ph-no-capture"),s=!0))}catch(e){Le.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var c;!s&&null!=(c=o)&&c.parentNode&&o.parentNode.removeChild(o)}}return n&&M(n)?Xf[t]=n.bind(r):n}function tp(e,t){var r=function(e){var t;return I(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}(e);return r?h({node:r,originalEvent:e,timestamp:Date.now()},t):null}function rp(e,t){return Math.abs(e)<Math.abs(t)?0>t?"up":"down":0>e?"left":"right"}function ip(e){return"swipe"===e.type?"$dead_swipe":"$dead_click"}var np="canvas,video,audio,embed,object",ap=1e3;function op(e,t){return O(e)&&e>=t}function sp(e){return e>=0&&ap>e?e:void 0}function up(e,t){return t?sp(e-t):void 0}class lp{mi(e){var t,r,i,n,a,o,s,u,l=this.gi((null==e?void 0:e.__onCapture)||this.yi.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==a?a:l.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==e?void 0:e.capture_dead_swipes)&&void 0!==o?o:l.capture_dead_swipes,swipe_threshold_px:null!==(s=null==e?void 0:e.swipe_threshold_px)&&void 0!==s?s:l.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(u=null==e?void 0:e.max_dead_swipes_per_page_load)&&void 0!==u?u:l.max_dead_swipes_per_page_load,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(e,t){this.bi=[],this.wi=0,this.gi=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:e}),this.ki=e=>{var t=tp(e,{type:"click"});A(t)||this.Si(t)||this.xi(t),this.Ci()},this.Mi=()=>{var e=Date.now();this.Ti=e,e%50==0&&this.bi.forEach((t=>{I(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Ii=()=>{this.Ei=Date.now()},this.It=()=>{var e=Date.now();this.Ri=e,this.Ai("visibilityChangedDelayMs",e)},this.Li=()=>{var e=Date.now();this.Oi=e,this.Ai("focusChangedDelayMs",e)},this.Fi=e=>{var t=e.touches,r=1===(null==t?void 0:t.length)?t[0]:void 0;this.Ni=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.Di=()=>{this.Ni=void 0},this.Pi=e=>{var t,r=this.Ni;if(this.Ni=void 0,!I(r)&&this.qi.max_dead_swipes_per_page_load>this.wi){var n=e,a=null==(t=n.changedTouches)?void 0:t[0];if(a){var o=a.clientX-r.x,s=a.clientY-r.y,u=o*o+s*s,l=this.qi.swipe_threshold_px;if(u>=l*l&&![this.Ti,this.ji,this.Ei].some((e=>O(e)&&e>=r.timestamp))){var h;if(this.Bi()&&(null!==(h=null==i||null==i.elementsFromPoint?void 0:i.elementsFromPoint(r.x,r.y))&&void 0!==h?h:[]).some((e=>null==e.matches?void 0:e.matches(np))))return;var c=tp(n,{type:"swipe",swipeDirection:rp(o,s),swipeDistancePx:Math.round(Math.sqrt(u))});A(c)||this.Si(c)||this.xi(c),this.Ci()}}}},this.instance=e,this.qi=this.mi(t),this._onCapture=this.qi.__onCapture}start(e){this.Hi(),this.$i(),this.Ui(),this.Wi(),this.zi(),this.Vi(e),this.qi.capture_dead_swipes&&this.Zi()}Vi(e){if(!this.Qi){var t=function(e){return ep("MutationObserver",e)}(s);this.Qi=new t((e=>{this.Gi(e)})),this.Qi.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Qi)||e.disconnect(),this.Qi=void 0,s.removeEventListener("click",this.ki),s.removeEventListener("scroll",this.Mi,{capture:!0}),s.removeEventListener("selectionchange",this.Ii),s.removeEventListener("touchstart",this.Fi,{capture:!0}),s.removeEventListener("touchend",this.Pi,{capture:!0}),s.removeEventListener("touchcancel",this.Di,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.It),s.removeEventListener("blur",this.Li),s.removeEventListener("focus",this.Li),this.Ni=void 0}Gi(e){this.ji=Date.now()}Hi(){Pe(s,"click",this.ki)}xi(e){e.visibilityChangedDelayMs=up(e.timestamp,this.Ri),e.focusChangedDelayMs=up(e.timestamp,this.Oi),this.bi.push(e)}Ci(){this.bi.length&&I(this.Yi)&&(this.Yi=s.setTimeout((()=>{this.Ji()}),1e3))}$i(){Pe(s,"scroll",this.Mi,{capture:!0})}Ui(){Pe(s,"selectionchange",this.Ii)}Wi(){Pe(i,"visibilitychange",this.It)}zi(){Pe(s,"blur",this.Li),Pe(s,"focus",this.Li)}Ai(e,t){this.bi.forEach((r=>{var i=sp(t-r.timestamp);O(i)&&(I(r[e])||r[e]>i)&&(r[e]=i)}))}Zi(){Pe(s,"touchstart",this.Fi,{capture:!0,passive:!0}),Pe(s,"touchend",this.Pi,{capture:!0,passive:!0}),Pe(s,"touchcancel",this.Di,{capture:!0,passive:!0})}Bi(){var e=I(this.Ki)||O(this.ji)&&this.ji>this.Ki;return(I(this.Xi)||e)&&(this.Ki=Date.now(),this.Xi=!(null==i||!i.querySelector(np))),!!this.Xi}Si(e){return!e||("swipe"===e.type?this.en(e):this.tn(e))}en(t){if((r=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var r,i=this.bi.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!i&&!Ve(t.node,"html")&&ze(t.node)&&function(t,r){var i;if(!e||tt(t))return!1;var n=F(r)?et:null!==(i=null==r?void 0:r.css_selector_ignorelist)&&void 0!==i?i:et;return!function(e,t){if(I(t))return!0;var r,i=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}(rt(t).targetElementList,n)}(t.node,{css_selector_ignorelist:this.qi.css_selector_ignorelist}))}tn(t){return!(this.qi.capture_clicks_with_modifier_keys||(r=t.originalEvent,!(r.ctrlKey||r.metaKey||r.altKey||r.shiftKey)))||!!this.en(t)||(i=t.node,!(!e||tt(i))&&rt(i).targetElementList.some((e=>Ve(e,"a"))));var r,i}Ji(){if(this.bi.length){clearTimeout(this.Yi),this.Yi=void 0;var e=this.bi;for(var t of(this.bi=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.ji&&this.ji>=t.timestamp?this.ji-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Ei&&this.Ei>=t.timestamp?this.Ei-t.timestamp:void 0;var i=op(t.scrollDelayMs,this.qi.scroll_threshold_ms),n=op(t.selectionChangedDelayMs,this.qi.selection_change_threshold_ms),a=op(t.mutationDelayMs,this.qi.mutation_threshold_ms),o=op(t.absoluteDelayMs,1.1*this.qi.mutation_threshold_ms),s=O(t.scrollDelayMs)&&this.qi.scroll_threshold_ms>t.scrollDelayMs,u=O(t.mutationDelayMs)&&this.qi.mutation_threshold_ms>t.mutationDelayMs,l=O(t.selectionChangedDelayMs)&&this.qi.selection_change_threshold_ms>t.selectionChangedDelayMs,h=O(t.visibilityChangedDelayMs),c=O(t.focusChangedDelayMs);if(!(s||u||l||h||c))if(i||a||o||n){var d=ip(t);if("$dead_swipe"===d){if(this.wi>=this.qi.max_dead_swipes_per_page_load)continue;this.wi++}this._onCapture(t,{[d+"_last_mutation_timestamp"]:this.ji,[d+"_event_timestamp"]:t.timestamp,[d+"_scroll_timeout"]:i,[d+"_mutation_timeout"]:a,[d+"_absolute_timeout"]:o,[d+"_selection_changed_timeout"]:n,[d+"_visibility_changed_timeout"]:!1})}else this.qi.mutation_threshold_ms>t.absoluteDelayMs&&this.bi.push(t)}this.Ci()}}yi(e,t){var r=ip(e);this.instance.capture(r,h({},t,Kf(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qi.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:e.scrollDelayMs,[r+"_mutation_delay_ms"]:e.mutationDelayMs,[r+"_absolute_delay_ms"]:e.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:e.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:e.visibilityChangedDelayMs,[r+"_focus_changed_delay_ms"]:e.focusChangedDelayMs,$dead_swipe_direction:e.swipeDirection,$dead_swipe_distance_px:e.swipeDistancePx}),{timestamp:new Date(e.timestamp)})}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new lp(e,t)}();
1
+ !function(){"use strict";var e="undefined"!=typeof window?window:void 0,t="undefined"!=typeof globalThis?globalThis:e,r=null==t?void 0:t.navigator,i=null==t?void 0:t.document,n=null==t?void 0:t.location;null!=t&&t.XMLHttpRequest&&new t.XMLHttpRequest;var a=null==r?void 0:r.userAgent,o="undefined"!=typeof globalThis?globalThis:e;o&&"undefined"==typeof self&&(o.self=o),o&&"undefined"==typeof File&&(o.File=function(){});var s=null!=e?e:{};function u(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(i,n)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var a=e.apply(t,r);function o(e){u(a,i,n,o,s,"next",e)}function s(e){u(a,i,n,o,s,"throw",e)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},h.apply(null,arguments)}var c,d={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},v={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},f="min_length",p="max_length",m="NativeGzipValidationError",g=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=m,t},y=function(){var e=l((function*(e,t){18>e.size&&g("too-short");var r,i=new Uint8Array(yield e.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&g("invalid-header");var n=new DataView(yield e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(c)return c;c=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;c[e]=t>>>0}return c})(),r=4294967295,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(4294967295^r)>>>0})(t)&&g("invalid-crc");var a=t.length>>>0;n.getUint32(4,!0)!==a&&g("invalid-size")}));return function(t,r){return e.apply(this,arguments)}}();function b(){return b=l((function*(e,t,r){void 0===t&&(t=!0);try{var i=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(i).then((()=>a.close())).catch(function(){var e=l((function*(e){try{yield a.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(n.readable).blob(),u=(yield Promise.all([s,o]))[0];return yield y(u,i),u}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})),b.apply(this,arguments)}function w(e,t){return-1!==e.indexOf(t)}var k=function(e){return e.trim()},_=Object.prototype,S=_.hasOwnProperty,x=_.toString,C=Array.isArray||function(e){return"[object Array]"===x.call(e)},M=e=>"function"==typeof e,T=e=>e===Object(e)&&!C(e),I=e=>void 0===e,E=e=>"[object String]"==x.call(e),R=e=>E(e)&&0===e.trim().length,A=e=>null===e,L=e=>I(e)||A(e),O=e=>"[object Number]"==x.call(e)&&e==e,F=e=>"[object Boolean]"===x.call(e),N=e=>e instanceof FormData;function D(e){return null===e||"object"!=typeof e}function P(e,t){return{}.toString.call(e)==="[object "+t+"]"}function q(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return B(e,Error)}}function j(e){return"undefined"!=typeof Event&&B(e,Event)}function B(e,t){try{return e instanceof t}catch(e){return!1}}function H(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),O(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),H(n||r,t,r,i))}class U{constructor(e){this.k={},this.S=e.S,this.C=H(e.bucketSize,0,100,e.I),this.R=H(e.refillRate,0,this.C,e.I),this.A=H(e.refillInterval,0,864e5,e.I)}O(e,t){var r=Math.floor((t-e.lastAccess)/this.A);r>0&&(e.tokens=Math.min(e.tokens+r*this.R,this.C),e.lastAccess=e.lastAccess+r*this.A)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.k[i];return n?this.O(n,r):this.k[i]=n={tokens:this.C,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.S)||t.call(this,e)),0===n.tokens)}stop(){this.k={}}}var W,z,V,Z="Mobile",Q="Android",G="Tablet",Y=Q+" "+G,J="iPad",K="Apple Watch",X="BlackBerry",ee="Nintendo",te="PlayStation",re="Xbox",ie="Windows Phone",ne="Nokia",ae="Ouya",oe="Generic",se=oe+" "+Z.toLowerCase(),ue=oe+" "+G.toLowerCase(),le=new RegExp(re,"i"),he=new RegExp(te+" \\w+","i"),ce=new RegExp(ee+" \\w+","i"),de=new RegExp(X+"|PlayBook|BB10","i");function ve(e){return e?e.split("#")[0]:e}function fe(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function pe(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return V&&r.length===z||(z=r.length,V=r.reduce(((r,i)=>{W||(W={});var n=W[i];if(n)r[n[0]]=n[1];else for(var a=e(i),o=a.length-1;o>=0;o--){var s=a[o],u=null==s?void 0:s.filename,l=t[i];if(u&&l){r[u]=l,W[i]=[u,l];break}}return r}),{})),V}}var me="?";function ge(e,t,r,i,n){var a={platform:e,filename:t,function:"<anonymous>"===r?me:r,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return I(i)||(a.lineno=i),I(n)||(a.colno=n),a}var ye=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:me,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},be=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,we=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ke=/\((\S*)(?::(\d+))(?::(\d+))\)/,_e=(e,t)=>{var r=be.exec(e);if(r)return ge(t,r[1],me,+r[2],+r[3]);var i=we.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=ke.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var a=ye(i[1]||me,i[2]);return ge(t,a[1],a[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Se=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ce=(e,t)=>{var r=Se.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=xe.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],a=r[1]||me,o=ye(a,n);return ge(t,n=o[1],a=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Me=/\(error: (.*)\)/;var Te=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var Ie=["fatal","error","warning","log","info","debug"];function Ee(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}var Re={DEBUG:!1,LIB_VERSION:"0.5.2",LIB_NAME:"browser-common"},Ae=function(t,r){var i=(void 0===r?{}:r).debugEnabled,n={F(r){if(e&&(Re.DEBUG||e.POSTHOG_DEBUG||i)&&!I(e.console)&&e.console){for(var n=("__rrweb_original__"in e.console[r]?e.console[r].__rrweb_original__:e.console[r]),a=arguments.length,o=new Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];n(t,...o)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.F("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.F("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.F("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.F("error",...t)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(e,r)=>Ae(t+" "+e,r)};return n},Le=Ae("[PostHog.js]"),Oe=Le.createLogger;function Fe(e,t){if(!L(e))if(C(e))e.forEach(t);else if(N(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)S.call(e,r)&&t(e[r],r)}var Ne=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var a in n)void 0!==n[a]&&(e[a]=n[a]);return e};function De(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}function Pe(e,t,r,i){var n=null!=i?i:{},a=n.capture,o=n.passive;null==e||e.addEventListener(t,r,{capture:void 0!==a&&a,passive:void 0===o||o})}var qe=["localhost","127.0.0.1"],je=e=>{var t=null==i?void 0:i.createElement("a");return I(t)?null:(t.href=e,t)},Be=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return Fe(e,(function(e,t){I(e)||I(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)};function He(t){var r,i=null==e||null==(r=e.location)?void 0:r.href;return I(i)?void 0:function(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!M(i))return t;try{var n=i(t);return E(n)&&n?n:t}catch(e){return Le.error("Error in get_current_url, falling back to window.location.href",e),t}}(t,i)}var $e=1,Ue=3,We=11;function ze(e){return!!e&&e.nodeType===$e}function Ve(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ze(e){return!!e&&e.nodeType===We&&ze(e.host)}var Qe=1e3;function Ge(e){return e?k(e).split(/\s+/):[]}function Ye(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Ge(t)}function Je(e){var t="";return it(e)&&!nt(e)&&e.childNodes&&e.childNodes.length&&Fe(e.childNodes,(function(e){var r;(function(e){return!!e&&e.nodeType===Ue})(e)&&e.textContent&&(t+=null!==(r=function(e){return L(e)?null:k(e).split(/(\s+)/).filter((e=>dt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(e.textContent))&&void 0!==r?r:"")})),k(t)}var Ke=["a","button","form","input","select","textarea","label"];function Xe(e){var t=e.parentNode;return!(!t||!ze(t))&&t}var et=[".ph-no-deadclick",".ph-no-capture"];var tt=e=>!e||Ve(e,"html")||!ze(e),rt=(t,r)=>{if(!e||tt(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],a=t;a.parentNode&&!Ve(a,"body");)if(Ze(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{var o=Xe(a);if(!o)break;if(Ke.indexOf(o.tagName.toLowerCase())>-1)i=!0;else try{var s=e.getComputedStyle(o);s&&"pointer"===s.getPropertyValue("cursor")&&(i=!0)}catch(e){}n.push(o),a=o}return{parentIsUsefulElement:i,targetElementList:n}};function it(e){for(var t=new Set,r=0,i=e;i.parentNode&&!Ve(i,"body");i=i.parentNode){if(r++>=Qe||t.has(i))return!1;t.add(i);var n=Ye(i);if(w(n,"ph-sensitive")||w(n,"ph-no-capture"))return!1}if(w(Ye(e),"ph-include"))return!0;var a=e.type||"";if(E(a))switch(a.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!E(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function nt(e){return!!(Ve(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ve(e,"select")||Ve(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var at=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),ot=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,st=[16,15,14,13],ut=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),lt=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ht=/[0-9A-Za-z_]/;function ct(e){for(var t=0,r=!1,i=e.length-1;i>=0;i--){var n=e.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),t+=n,r=!r}return t%10==0}function dt(e,t){if(void 0===t&&(t=!0),L(e))return!1;if(E(e)){e=k(e);var r=t?at.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(ot.lastIndex=0;t=ot.exec(e);){var r=t[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var a of st){var o=n+a;if(i.length>=o){var s=i.slice(n,o);if(at.test(s)&&ct(s))return!0}}}return!1}(e);if(r)return!1;var i=t?ut.test(e):function(e){var t;for(lt.lastIndex=0;t=lt.exec(e);){var r=t[1],i=t[3];if(!(r&&i&&ht.test(r)&&ht.test(i)))return!0}return!1}(e);if(i)return!1}return!0}function vt(e){var t=Je(e);return dt(t=(t+" "+ft(e)).trim())?t:""}function ft(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Fe(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Je(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ft(e)).trim())}catch(e){Le.error("[AutoCapture]",e)}})),t}function pt(e){return e.replace(/"|\\"/g,'\\"')}function mt(e){var t=e.attr__class;if(t)return C(t)?t:Ge(t)}var gt="[SessionRecording]",yt="redacted",bt=1e6;function wt(e){var t;return Math.min(bt,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:bt)}var kt={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:bt,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},_t=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],St=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],xt=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Ct=e=>{L(e)||Fe(Object.keys(e),(t=>{(e=>{var t=e.toLowerCase();return _t.includes(t)||xt.some((e=>t.includes(e)))})(t)&&(e[t]=yt)}))},Mt=["/s/","/e/","/i/"];function Tt(e,t,r,i){if(L(e))return e;var n=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return E(n)&&(n=parseInt(n)),n>r?gt+" "+i+" body too large to record ("+n+" bytes)":e}function It(e,t){if(L(e))return e;var r=e;return dt(r,!1)||(r=gt+" "+t+" body "+yt),Fe(St,(e=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(e))&&(r=gt+" "+t+" body "+yt+" as might contain: "+e)})),r}var Et=new WeakSet,Rt="$session_recording_remote_config",At="$replay_sample_rate",Lt="$replay_override_sampling",Ot="$replay_override_linked_flag",Ft="$replay_override_url_trigger",Nt="$replay_override_event_trigger",Dt="$session_is_sampled",Pt="$session_past_minimum_duration",qt="$session_recording_url_trigger_activated_session",jt="$session_recording_event_trigger_activated_session",Bt="$posthog_sr_group_event_trigger_",Ht="$posthog_sr_group_url_trigger_",$t="$posthog_sr_group_sampling_",Ut="$debug_first_full_snapshot_timestamp",Wt="$sess_rec_flush_size",zt="$stored_person_properties",Vt="$sdk_debug_replay_pending_trigger_conditions",Zt="$sdk_debug_replay_remote_trigger_matching_config",Qt="disabled",Gt="sampled",Yt="active",Jt="buffering",Kt="paused",Xt="rrweb_error",er="trigger",tr=er+"_activated",rr=er+"_pending",ir=er+"_"+Qt;function nr(e,t,r,i,n,a){return 0===t?ir:(null==e?void 0:e.get_property(r?i+r:n))===a?tr:rr}function ar(e,t,r){return t.some((t=>{var i;return"regex"===t.matching&&(null!==(i=null==r?void 0:r.get(t.url))&&void 0!==i?i:new RegExp(t.url)).test(e)}))}function or(e){return e.includes(tr)?tr:e.includes(rr)?rr:ir}function sr(e){var t=new Set(e);switch(t.delete(ir),t.size){case 0:return ir;case 1:return Array.from(t)[0];default:return rr}}class ur{constructor(e){this.N=e}triggerStatus(e){return or(this.N.map((t=>t.triggerStatus(e))))}triggerStatusNoSideEffects(e){return or(this.N.map((t=>t.triggerStatusNoSideEffects(e))))}stop(){this.N.forEach((e=>e.stop()))}}class lr{constructor(e){this.N=e}triggerStatus(e){return sr(this.N.map((t=>t.triggerStatus(e))))}triggerStatusNoSideEffects(e){return sr(this.N.map((t=>t.triggerStatusNoSideEffects(e))))}stop(){this.N.forEach((e=>e.stop()))}}class hr{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return tr}stop(){}}var cr=e=>"sessionRecording"in e;class dr{constructor(e,t){this.P=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=e,this.$=t}onConfig(e){var t,r;this.P=(cr(e)?T(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.urlTriggers:[]:null==e?void 0:e.urlTriggers)||[],this.q=(cr(e)?T(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.urlBlocklist:[]:null==e?void 0:e.urlBlocklist)||[],this.U()}U(){for(var e of(this.j.clear(),this.B.clear(),this.P))if("regex"===e.matching&&!this.j.has(e.url))try{this.j.set(e.url,new RegExp(e.url))}catch(t){Le.error("Invalid URL trigger regex pattern:",e.url,t)}for(var t of this.q)if("regex"===t.matching&&!this.B.has(t.url))try{this.B.set(t.url,new RegExp(t.url))}catch(e){Le.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(e){this.onConfig(e)}W(e){return nr(this._instance,this.P.length,this.$,Ht,qt,e)}triggerStatus(e){var t=this.triggerStatusNoSideEffects(e);return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:t}),t}triggerStatusNoSideEffects(e){return this.W(e)}checkUrlBlocklist(e,t){var r=He(this._instance);if(r&&r!==this.H){this.H=r;var i=this.urlBlocked,n=ar(r,this.q,this.B);i&&n||(n&&!i?e():!n&&i&&t())}}checkUrlTriggerConditions(e,t,r,i){var n=He(this._instance);if(n&&n!==this.H){this.H=n;var a=this.urlBlocked,o=ar(n,this.q,this.B);o&&!a?e():!o&&a&&t();var s=this.W(i)===tr,u=ar(n,this.P,this.j);!s&&u&&r("url",n)}}stop(){this.H=""}}class vr{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=e}triggerStatus(){var e=this.triggerStatusNoSideEffects();return this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}triggerStatusNoSideEffects(){var e=rr;return L(this.linkedFlag)&&(e=ir),this.linkedFlagSeen&&(e=tr),e}onConfig(e,t){var r;if(this.linkedFlag=(cr(e)?T(e.sessionRecording)?null==(r=e.sessionRecording)?void 0:r.linkedFlag:null:null==e?void 0:e.linkedFlag)||null,!L(this.linkedFlag)&&!this.linkedFlagSeen){var i=E(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=E(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((e,r)=>{var a=!1;if(T(r)&&i in r){var o=r[i];a=F(o)?!0===o:n?o===n:!!o}var s=a&&!this.linkedFlagSeen;this.linkedFlagSeen=a,s&&t(i,n)}))}}onRemoteConfig(e,t){this.onConfig(e,t)}stop(){this.V()}}class fr{constructor(e,t){this.Z=[],this._instance=e,this.$=t}onConfig(e){var t;this.Z=(cr(e)?T(e.sessionRecording)?null==(t=e.sessionRecording)?void 0:t.eventTriggers:[]:null==e?void 0:e.eventTriggers)||[]}onRemoteConfig(e){this.onConfig(e)}G(e){return nr(this._instance,this.Z.length,this.$,Bt,jt,e)}triggerStatus(e){var t=this.triggerStatusNoSideEffects(e);return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:t}),t}triggerStatusNoSideEffects(e){return this.G(e)}checkEventTriggerConditions(e,t,r){if(0!==this.Z.length){var i=this.G(r)===tr,n=this.Z.includes(e);!i&&n&&t("event",e)}}stop(){}}class pr{constructor(e,t,r){if(this._instance=e,this.group=t,this.Y=new dr(e,t.id),this.J=new fr(e,t.id),this.K=new vr(e),t.conditions.events&&t.conditions.events.length>0||t.conditions.urls&&t.conditions.urls.length>0||t.conditions.flag){var i=(t.conditions.events||[]).map((e=>e.name)),n={urlTriggers:t.conditions.urls||[],eventTriggers:i,linkedFlag:t.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.J.onConfig(n),this.K.onConfig(n,r);var a=[this.J,this.Y,this.K];this.X="any"===t.conditions.matchType?new ur(a):new lr(a)}else this.X=new hr}triggerStatus(e){return this.X.triggerStatus(e)}triggerStatusNoSideEffects(e){return this.X.triggerStatusNoSideEffects(e)}getPendingTriggerConditions(e){return this.triggerStatusNoSideEffects(e)!==rr?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(e)},{label:"event condition not matched",status:this.J.triggerStatusNoSideEffects(e)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((e=>e.status===rr)).map((e=>e.label))}checkEventTriggerConditions(e,t,r){this.J.checkEventTriggerConditions(e,t,r)}checkUrlTriggerConditions(e,t,r,i){this.Y.checkUrlTriggerConditions(e,t,r,i)}activateTrigger(e,t){var r;null==(r=this._instance.persistence)||r.register({["url"===e?Ht+this.group.id:Bt+this.group.id]:t})}stop(){this.Y.stop(),this.J.stop(),this.K.stop()}}function mr(e){if(e.rrwebError)return Xt;if(!e.receivedFlags)return Jt;if(!e.isRecordingEnabled)return Qt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=!0===e.isSampled,r=new ur([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Gt:r===tr?Yt:r===rr?Jt:!1===e.isSampled?Qt:Yt}function gr(e){if(e.rrwebError)return Xt;if(!e.receivedFlags)return Jt;if(!e.isRecordingEnabled)return Qt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=new lr([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),r=t!==ir,i=F(e.isSampled);return r&&t===rr?Jt:r&&t===ir||i&&!e.isSampled?Qt:!0===e.isSampled?Gt:Yt}function yr(){var e=[];return function(t,r){if(T(r)||C(r)){for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(r)?"[Circular]":(e.push(r),r)}return r}}function br(e){var t=JSON.stringify(e,yr());return t?new Blob([t]).size:0}function wr(e){if(A(e))return 4;if(I(e))return 0;switch(typeof e){case"string":return e.length+2;case"number":return String(e).length;case"boolean":return e?4:5;case"object":if(C(e)){for(var t=2,r=0;e.length>r;r++){r>0&&(t+=1);var i=e[r];t+=I(i)||A(i)?4:wr(i)}return t}var n=e,a=2,o=!0;for(var s in n)if({}.hasOwnProperty.call(n,s)){var u=n[s];I(u)||(o||(a+=1),o=!1,a+=s.length+3+wr(u))}return a;default:return 0}}function kr(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var r=Math.floor(e.data.length/2),i=e.sizes.slice(0,r),n=e.sizes.slice(r);return[kr({size:i.reduce(((e,t)=>e+t),0),data:e.data.slice(0,r),sizes:i,sessionId:e.sessionId,windowId:e.windowId}),kr({size:n.reduce(((e,t)=>e+t),0),data:e.data.slice(r),sizes:n,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var _r=Uint8Array,Sr=Uint16Array,xr=Uint32Array,Cr=new _r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Mr=new _r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Tr=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ir=function(e,t){for(var r=new Sr(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new xr(r[30]);for(i=1;30>i;++i)for(var a=r[i];r[i+1]>a;++a)n[a]=a-r[i]<<5|i;return[r,n]},Er=Ir(Cr,2),Rr=Er[1];Er[0][28]=258,Rr[258]=28;for(var Ar=Ir(Mr,0)[1],Lr=new Sr(32768),Or=0;32768>Or;++Or){var Fr=(43690&Or)>>>1|(21845&Or)<<1;Lr[Or]=((65280&(Fr=(61680&(Fr=(52428&Fr)>>>2|(13107&Fr)<<2))>>>4|(3855&Fr)<<4))>>>8|(255&Fr)<<8)>>>1}var Nr=function(e,t,r){for(var i=e.length,n=0,a=new Sr(t);i>n;++n)++a[e[n]-1];var o,s=new Sr(t);for(n=0;t>n;++n)s[n]=s[n-1]+a[n-1]<<1;if(r){o=new Sr(1<<t);var u=15-t;for(n=0;i>n;++n)if(e[n])for(var l=n<<4|e[n],h=t-e[n],c=s[e[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Lr[c]>>>u]=l}else for(o=new Sr(i),n=0;i>n;++n)o[n]=Lr[s[e[n]-1]++]>>>15-e[n];return o},Dr=new _r(288);for(Or=0;144>Or;++Or)Dr[Or]=8;for(Or=144;256>Or;++Or)Dr[Or]=9;for(Or=256;280>Or;++Or)Dr[Or]=7;for(Or=280;288>Or;++Or)Dr[Or]=8;var Pr=new _r(32);for(Or=0;32>Or;++Or)Pr[Or]=5;var qr=Nr(Dr,9,0),jr=Nr(Pr,5,0),Br=function(e){return(e/8>>0)+(7&e&&1)},Hr=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Sr?Sr:e instanceof xr?xr:_r)(r-t);return i.set(e.subarray(t,r)),i},$r=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},Ur=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},Wr=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,a=r.slice();if(!n)return[new _r(0),0];if(1==n){var o=new _r(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=n-1;)s=r[r[c].f>r[l].f?l++:c++],u=r[l!=h&&r[c].f>r[l].f?l++:c++],r[h++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(i=1;n>i;++i)a[i].s>d&&(d=a[i].s);var v=new Sr(d+1),f=zr(r[h-1],v,0);if(f>t){i=0;var p=0,m=f-t,g=1<<m;for(a.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=a[i].s;if(t>=v[y])break;p+=g-(1<<f-v[y]),v[y]=t}for(p>>>=m;p>0;){var b=a[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var w=a[i].s;v[w]==t&&(--v[w],++p)}f=t}return[new _r(v),f]},zr=function(e,t,r){return-1==e.s?Math.max(zr(e.l,t,r+1),zr(e.r,t,r+1)):t[e.s]=r},Vr=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Sr(++t),i=0,n=e[0],a=1,o=function(e){r[i++]=e},s=1;t>=s;++s)if(e[s]==n&&s!=t)++a;else{if(!n&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(n),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(n);a=1,n=e[s]}return[r.subarray(0,i),t]},Zr=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},Qr=function(e,t,r){var i=r.length,n=Br(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var a=0;i>a;++a)e[n+a+4]=r[a];return 8*(n+4+i)},Gr=function(e,t,r,i,n,a,o,s,u,l,h){$r(t,h++,r),++n[256];for(var c=Wr(n,15),d=c[0],v=c[1],f=Wr(a,15),p=f[0],m=f[1],g=Vr(d),y=g[0],b=g[1],w=Vr(p),k=w[0],_=w[1],S=new Sr(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;k.length>x;++x)S[31&k[x]]++;for(var C=Wr(S,7),M=C[0],T=C[1],I=19;I>4&&!M[Tr[I-1]];--I);var E,R,A,L,O=l+5<<3,F=Zr(n,Dr)+Zr(a,Pr)+o,N=Zr(n,d)+Zr(a,p)+o+14+3*I+Zr(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(F>=O&&N>=O)return Qr(t,h,e.subarray(u,u+l));if($r(t,h,1+(F>N)),h+=2,F>N){E=Nr(d,v,0),R=d,A=Nr(p,m,0),L=p;var D=Nr(M,T,0);for($r(t,h,b-257),$r(t,h+5,_-1),$r(t,h+10,I-4),h+=14,x=0;I>x;++x)$r(t,h+3*x,M[Tr[x]]);h+=3*I;for(var P=[y,k],q=0;2>q;++q){var j=P[q];for(x=0;j.length>x;++x)$r(t,h,D[B=31&j[x]]),h+=M[B],B>15&&($r(t,h,j[x]>>>5&127),h+=j[x]>>>12)}}else E=qr,R=Dr,A=jr,L=Pr;for(x=0;s>x;++x)if(i[x]>255){var B;Ur(t,h,E[257+(B=i[x]>>>18&31)]),h+=R[B+257],B>7&&($r(t,h,i[x]>>>23&31),h+=Cr[B]);var H=31&i[x];Ur(t,h,A[H]),h+=L[H],H>3&&(Ur(t,h,i[x]>>>5&8191),h+=Mr[H])}else Ur(t,h,E[i[x]]),h+=R[i[x]];return Ur(t,h,E[256]),h+R[256]},Yr=new xr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jr=function(){for(var e=new xr(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Kr=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Jr[255&r^t[i]]^r>>>8;e=r},d:()=>4294967295^e}},Xr=function(e,t,r,i,n){return function(e,t,r,i,n,a){var o=e.length,s=new _r(i+o+5*(1+Math.floor(o/7e3))+n),u=s.subarray(i,s.length-n),l=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?l=Qr(u,l,e.subarray(h,c)):(u[h]=true,l=Qr(u,l,e.subarray(h,o)))}else{for(var d=Yr[t-1],v=d>>>13,f=8191&d,p=(1<<r)-1,m=new Sr(32768),g=new Sr(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},k=new xr(25e3),_=new Sr(288),S=new Sr(32),x=0,C=0,M=(h=0,0),T=0,I=0;o>h;++h){var E=w(h),R=32767&h,A=g[E];if(m[R]=A,g[E]=R,h>=T){var L=o-h;if((x>7e3||M>24576)&&L>423){l=Gr(e,u,0,k,_,S,C,M,I,h-I,l),M=x=C=0,I=h;for(var O=0;286>O;++O)_[O]=0;for(O=0;30>O;++O)S[O]=0}var F=2,N=0,D=f,P=R-A&32767;if(L>2&&E==w(h-P))for(var q=Math.min(v,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=P&&--D&&R!=A;){if(e[h+F]==e[h+F-P]){for(var H=0;B>H&&e[h+H]==e[h+H-P];++H);if(H>F){if(F=H,N=P,H>q)break;var U=Math.min(P,H-2),W=0;for(O=0;U>O;++O){var z=h-P+O+32768&32767,V=z-m[z]+32768&32767;V>W&&(W=V,A=z)}}}P+=(R=A)-(A=m[R])+32768&32767}if(N){k[M++]=268435456|Rr[F]<<18|Ar[N];var Z=31&Rr[F],Q=31&Ar[N];C+=Cr[Z]+Mr[Q],++_[257+Z],++S[Q],T=h+F,++x}else k[M++]=e[h],++_[e[h]]}}l=Gr(e,u,true,k,_,S,C,M,I,h-I,l)}return Hr(s,0,i+Br(l)+n)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i)},ei=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},ti=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&ei(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}},ri=function(e){return 10+(e.filename&&e.filename.length+1||0)};function ii(e,t){for(var r="",i=0;e.length>i;){var n=e[i++];r+=String.fromCharCode(n)}return r}class ni{constructor(e,t){var r,i;void 0===t&&(t={}),this.ee={},this.te=e=>{if(!this.ee[e]){var t,r;this.ee[e]=!0;var i=this.re(e);null==(t=(r=this.ie).onBlockedNode)||t.call(r,e,i)}},this.ne=e=>{var t=this.re(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var r=t.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[e,t]},this.re=e=>this._rrweb.mirror.getNode(e),this.ae=e=>{var t,r,i,n,a,o,s,u;return(null!==(t=null==(r=e.removes)?void 0:r.length)&&void 0!==t?t:0)+(null!==(i=null==(n=e.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(a=null==(o=e.texts)?void 0:o.length)&&void 0!==a?a:0)+(null!==(s=null==(u=e.adds)?void 0:u.length)&&void 0!==s?s:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,r=this.ae(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t=this.ne(e.id);return!this.oe.consumeRateLimit(t[0])&&e})));var i=this.ae(t);return 0!==i||r===i?e:void 0},this._rrweb=e,this.ie=t,this.oe=new U({bucketSize:null!==(r=this.ie.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.ie.refillRate)&&void 0!==i?i:10,refillInterval:1e3,S:this.te,I:Le})}reset(){this.ee={}}stop(){this.oe.stop(),this.reset()}}Re.DEBUG=!1,Re.LIB_VERSION="1.419.2",Re.LIB_NAME="web";class ai{constructor(e){if(!e.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.se=e.get_property.bind(e),this.ue=e.persistence.set_property.bind(e.persistence)}trackSize(e,t){this.ue(Wt,{sessionId:e,size:this.currentTrackedSize(e)+t})}currentTrackedSize(e){var t,r=this.se(Wt);return T(t=r)&&E(t.sessionId)&&O(t.size)&&r.sessionId===e?r.size:0}}function oi(e,t){return function(e){for(var t=0,r=0;e.length>r;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(e)%100<H(100*t,0,100,Le)}function si(e){return"$survey_response_"+e}function ui(e,t){if(!t)return null;var r=e[si(t)];return C(r)?[...r]:r}function li(e,t){void 0===e&&(e={});var r={};return t.questions.forEach((t=>{if(!I(t.originalQuestionIndex)){var i,n=0===(i=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,a=ui(e,t.id);I(a)||(r[n]=a)}})),h({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:ui(e,t.id)})))},e,r)}function hi(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function ci(e){return"string"==typeof e&&e.trim()?e.trim():null}function di(e){return e.toLowerCase()}function vi(e,t,r){if(!e||!t)return null;var i=di(t),n=Object.keys(e).find((e=>di(e)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var a=i.split("-")[0],o=Object.keys(e).find((e=>di(e)===a));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}var fi=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function pi(e,t,r){var i,n=vi(e.translations,t,r),a=h({},e),o=!1;if(n){var s,u=null==(s=e.translations)?void 0:s[n];if(u)if(null==r||r.info("Applying survey-level translation for language: "+n),I(u.name)||(a.name=u.name,o=!0),a.appearance){var l=h({},a.appearance);for(var c of fi){var d=u[c];I(d)||(l[c]=d,o=!0)}a.appearance=l}else(function(e){return fi.some((t=>!I(e[t])))})(u)&&(o=!0)}var v=e.questions.map((e=>function(e,t,r){var i,n=vi(e.translations,t,r);if(!n)return{question:e,matchedKey:null,hasChanges:!1};var a=null==(i=e.translations)?void 0:i[n];if(!a)return{question:e,matchedKey:null,hasChanges:!1};var o=h({},e),s=!1;return I(a.question)||(o.question=a.question,s=!0),I(a.description)||(o.description=a.description,s=!0),I(a.buttonText)||(o.buttonText=a.buttonText,s=!0),"link"in o&&!I(a.link)&&(o.link=a.link,s=!0),"lowerBoundLabel"in o&&!I(a.lowerBoundLabel)&&(o.lowerBoundLabel=a.lowerBoundLabel,s=!0),"upperBoundLabel"in o&&!I(a.upperBoundLabel)&&(o.upperBoundLabel=a.upperBoundLabel,s=!0),"choices"in o&&function(e){return C(e.choices)}(a)&&(o.choices=a.choices,s=!0),{question:s?o:e,matchedKey:s?n:null,hasChanges:s}}(e,t,r))),f=v.map((e=>e.question)),p=v.some((e=>e.hasChanges)),m=null;return n||(m=(null==(i=v.find((e=>e.matchedKey)))?void 0:i.matchedKey)||null),p&&(a.questions=f,o=!0,null==r||r.info("Applied question-level translations for language: "+t)),{survey:a,matchedKey:o?n||m:null}}function mi(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var gi=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},yi=e=>e.toLowerCase(),bi={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>gi(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!gi(t,e))))),icontains:(e,t)=>t.map(yi).some((t=>e.map(yi).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(yi).every((t=>e.map(yi).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},wi=new Set(["is_not","not_icontains","not_regex"]);function ki(e,t,r){return!e||0===e.length||e.every((e=>{var i="person"===e.type?r:t,n=null==i?void 0:i[e.key],a=e.operator||"exact";if(I(n)||A(n))return wi.has(a);var o=bi[a];return!!o&&!I(e.value)&&!A(e.value)&&o(C(e.value)?e.value.map(String):[String(e.value)],C(n)?n.map(String):[String(n)])}))}var _i=Oe("[SessionRecording]");function Si(e,t){return t?e:"!"+e}function xi(e,t){return e===t||e!=="!"+t&&null}class Ci{constructor(e,t,r,i,n,a,o){this.le=null,this.he=gr,this._instance=e,this.Y=t,this.J=r,this.K=i,this.ce=n,this.de=a,this.ve=o}onRemoteConfig(e){this.le=O(e.sampleRate)?e.sampleRate:null,"any"===e.triggerMatchType?(this.fe=new ur([this.J,this.Y]),this.he=mr):(this.fe=new lr([this.J,this.Y]),this.he=gr),this._instance.register_for_session({[Zt]:e.triggerMatchType}),this.Y.onConfig(e),this.J.onConfig(e),this.K.onConfig(e,((e,t)=>{this.ce("linked_flag_matched",{flag:e,variant:t}),this.ve()}))}getStatus(e){return this.he({receivedFlags:!0,isRecordingEnabled:!0,isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId})}getMinimumDuration(e){var t=this._instance.get_property("$session_recording_remote_config"),r=null==t?void 0:t.minimumDurationMilliseconds;return O(r)?r:null}checkUrlTriggers(e,t,r,i){this.Y.checkUrlTriggerConditions(t,r,i,e)}setupEventTriggerListeners(e,t,r){if(0!==this.J.Z.length&&L(this.pe))return this.pe=e((e=>{try{this.J.checkEventTriggerConditions(e.event,r,t)}catch(e){_i.error("Could not activate event trigger",e)}})),this.pe}makeSamplingDecisions(e){var t,r,i,n=this.le;if(!O(n))return null==(r=this._instance.persistence)||r.unregister(Dt),void(null==(i=this._instance.persistence)||i.unregister(At));var a=this._instance.get_property(Dt),o=this._instance.get_property(At),s=xi(a,e),u=O(o)&&o!==n,l=I(o)&&a===e,h=u||l||!F(s),c=h?oi(e,n):s;h&&(c?this.ce("sampled"):_i.warn("Sample rate ("+n+") has determined that this sessionId ("+e+") will not be sent to the server.")),null==(t=this._instance.persistence)||t.register({[Dt]:Si(e,c),[At]:A(o)&&a===e?null:n})}ensureSamplingDecision(e){if(O(this.le)){var t=this._instance.get_property(Dt);F(xi(t,e))||this.makeSamplingDecisions(e)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var e,t,r,i,n;null==(e=this._instance.persistence)||e.unregister(jt),null==(t=this._instance.persistence)||t.unregister(qt),null==(r=this._instance.persistence)||r.unregister(Dt),null==(i=this._instance.persistence)||i.unregister(At),null==(n=this._instance.persistence)||n.unregister(Pt)}updateActiveTriggers(e){}hasPendingTriggers(e){var t;return(null==(t=this.fe)?void 0:t.triggerStatus(e))===rr}getPendingTriggerConditions(e){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(e)},{label:"event condition not matched",status:this.J.triggerStatusNoSideEffects(e)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((e=>e.status===rr)).map((e=>e.label))}stop(){var e;null==(e=this.pe)||e.call(this),this.pe=void 0,this.J.stop(),this.Y.stop(),this.K.stop()}}class Mi{constructor(e,t,r,i,n){this.me=[],this.ge=new Map,this.ye=!1,this._instance=e,this.Y=t,this.ce=r,this.be=i,this.ve=n}onRemoteConfig(e){e.triggerGroups&&0!==e.triggerGroups.length?(this.we(e.triggerGroups),this._instance.register_for_session({[Zt]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:e.triggerGroups.length}),this.Y.onConfig(e)):_i.warn("[V2Strategy] No trigger groups configured")}getStatus(e){return function(e){if(e.rrwebError)return Xt;if(e.urlTriggerMatching.urlBlocked)return Kt;var t=e.triggerGroupMatchers,r=e.triggerGroupSamplingResults;if(0===t.length)return Qt;var i=!1,n=!1;for(var a of t){var o=a.triggerStatus(e.sessionId);if(o===tr){var s=a.group.id,u=r.get(s);I(u)?Le.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:s}):!0===u&&(n=!0)}else o===rr&&(i=!0)}return n?Gt:i?Jt:Qt}({isSampled:e.isSampled,rrwebError:e.rrwebError,urlTriggerMatching:e.urlTriggerMatching,eventTriggerMatching:e.eventTriggerMatching,linkedFlagMatching:e.linkedFlagMatching,sessionId:e.sessionId,triggerGroupMatchers:this.me,triggerGroupSamplingResults:this.ge,minimumDuration:this.getMinimumDuration(e.sessionId)})}getMinimumDuration(e){var t=null;for(var r of this.me)if("trigger_activated"===r.triggerStatus(e)){var i=r.group.minDurationMs;O(i)&&(A(t)||t>i)&&(t=i)}return t}checkUrlTriggers(e,t,r,i){var n=this;this.Y.checkUrlBlocklist(t,r);var a=function(i){i.checkUrlTriggerConditions(t,r,(t=>{n.ke(i,void 0)&&(i.activateTrigger(t,e),n.updateActiveTriggers(e),n.ve(t))}),e)};for(var o of this.me)a(o)}setupEventTriggerListeners(e,t,r){var i=this;return this.pe=e((e=>{var r;if(this.ye)return _i.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.pe)||r.call(this),void(this.pe=void 0);try{var n=function(r){r.checkEventTriggerConditions(e.event,(n=>{if(i.ke(r,e.properties)){var a=(r.group.conditions.events||[]).filter((t=>t.name===e.event)),o=i._instance.get_property(zt),s=a.some((t=>!t.properties||0===t.properties.length||ki(t.properties,e.properties,o)));s&&(r.activateTrigger(n,t),i.updateActiveTriggers(t),i.ve(n))}}),t)};for(var a of this.me)n(a)}catch(e){_i.error("Could not activate event trigger for trigger groups",e)}})),this.pe}makeSamplingDecisions(e){for(var t of this.me){var r,i=t.group,n=i.id,a=i.sampleRate,o=$t+n,s=this._instance.get_property(o),u=null,l=!1,h=!1,c=!1;if(T(s)){var d=s.sessionId,v=s.sampleRate,f=s.sampled;l="string"==typeof d&&d!==e,h=O(v)&&v!==a,u=d===e&&O(v)&&v===a&&F(f)?f:null}else u=s===e||null,l="string"==typeof s&&s!==e,c=s===e;var p=l||h||c||!F(u),m=p?oi(e+n,a):u;p&&this.be("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:a,isSampled:m}),this.ge.set(n,m),null==(r=this._instance.persistence)||r.register({[o]:{sessionId:e,sampleRate:a,sampled:m}})}this.updateActiveTriggers(e)}ensureSamplingDecision(e){}onFlushComplete(){this.ye=!0}clearConditionalRecordingPersistence(){var e,t,r;for(var i of(null==(e=this._instance.persistence)||e.unregister(Dt),null==(t=this._instance.persistence)||t.unregister(At),null==(r=this._instance.persistence)||r.unregister(Pt),this.me)){var n,a,o,s=i.group.id;null==(n=this._instance.persistence)||n.unregister(Bt+s),null==(a=this._instance.persistence)||a.unregister(Ht+s),null==(o=this._instance.persistence)||o.unregister($t+s)}}updateActiveTriggers(e){var t=[];for(var r of this.me){var i=r.group,n=i.id,a="trigger_activated"===r.triggerStatus(e),o=!0===this.ge.get(n);a&&t.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:t})}hasPendingTriggers(e){for(var t of this.me)if(t.triggerStatus(e)===rr)return!0;return!1}getPendingTriggerConditions(e){return this.me.flatMap((t=>t.triggerStatusNoSideEffects(e)!==rr?[]:t.getPendingTriggerConditions(e).map((e=>'trigger group "'+t.group.name+'": '+e))))}stop(){var e;null==(e=this.pe)||e.call(this),this.pe=void 0,this.me.forEach((e=>e.stop())),this.me=[],this.ge.clear(),this.Y.stop()}ke(e,t){var r=e.group.conditions.properties;return!r||0===r.length||ki(r,t,this._instance.get_property(zt))}we(e){var t=this;this.me.forEach((e=>e.stop())),this.me=[],this.ge.clear();var r=function(e){var r=new pr(t._instance,e,((r,i)=>{t.ce("linked_flag_matched",{flag:r,variant:i,group_id:e.id,group_name:e.name}),t.ve()}));t.me.push(r)};for(var i of e)r(i)}}var Ti=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"];function Ii(e){return I(e)?void 0:Math.round(e)}function Ei(e){return T(e)?e.network_timing:e}var Ri,Ai,Li=943718.4,Oi="[SessionRecording]",Fi=Oe(Oi),Ni=[v.MouseMove,v.MouseInteraction,v.Scroll,v.ViewportResize,v.Input,v.TouchMove,v.MediaInteraction,v.Drag],Di=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Pi(){var e;return null==s||null==(e=s.__PosthogExtensions__)?void 0:e.rrweb}function qi(){var e;return null==(e=Pi())?void 0:e.record}function ji(e){try{return JSON.stringify(e)}catch(t){return JSON.stringify(e,yr())}}function Bi(e){return ii(function(e,t){void 0===t&&(t={});var r=Kr(),i=e.length;r.p(e);var n=Xr(e,t,ri(t),8),a=n.length;return ti(n,t),ei(n,a-8,r.d()),ei(n,a-4,i),n}(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new _r(e.length+(e.length>>>1)),n=0,a=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var s=new _r(n+8+(r-o<<1));s.set(i),i=s}var u=e.charCodeAt(o);128>u?a(u):2048>u?(a(192|u>>>6),a(128|63&u)):u>55295&&57344>u?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return Hr(i,0,n)}(ji(e))))}function Hi(e){return $i.apply(this,arguments)}function $i(){return $i=l((function*(e){var t=ji(e),r=yield function(e,t,r){return b.apply(this,arguments)}(t,Re.DEBUG,{rethrow:!0});return ii(new Uint8Array(yield r.arrayBuffer()))})),$i.apply(this,arguments)}var Ui="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Wi=!1;function zi(e){return C(e)&&0===e.length?Ri=null!=Ri?Ri:Bi([]):Bi(e)}function Vi(e){return Zi.apply(this,arguments)}function Zi(){return(Zi=l((function*(e){return C(e)&&0===e.length?Ri||(Ai=null!=Ai?Ai:Hi([]).then((e=>(Ri=e,e))).catch((e=>{throw Ri=void 0,Ai=void 0,e}))):Hi(e)}))).apply(this,arguments)}function Qi(e){return Ui&&!Wi&&function(e){return e.type===d.FullSnapshot||e.type===d.IncrementalSnapshot&&(e.data.source===v.Mutation||e.data.source===v.StyleSheetRule)}(e)}function Gi(e){return{event:e,size:wr(e)}}function Yi(e,t){return h({},e,{data:t,cv:"2024-10"})}function Ji(e,t){return h({},e,{cv:"2024-10",data:h({},e.data,t)})}function Ki(e){try{if(e.type===d.FullSnapshot)return Gi(Yi(e,Bi(e.data)));if(e.type===d.IncrementalSnapshot&&e.data.source===v.Mutation)return Gi(Ji(e,{texts:zi(e.data.texts),attributes:zi(e.data.attributes),removes:zi(e.data.removes),adds:zi(e.data.adds)}));if(e.type===d.IncrementalSnapshot&&e.data.source===v.StyleSheetRule)return Gi(Ji(e,{adds:e.data.adds?Bi(e.data.adds):void 0,removes:e.data.removes?Bi(e.data.removes):void 0}))}catch(e){Fi.error("could not compress event - will use uncompressed event",e)}return{event:e,size:br(e)}}function Xi(){return Xi=l((function*(e){try{if(e.type===d.FullSnapshot)return Gi(Yi(e,yield Hi(e.data)));if(e.type===d.IncrementalSnapshot&&e.data.source===v.Mutation){var t=yield Promise.all([Vi(e.data.texts),Vi(e.data.attributes),Vi(e.data.removes),Vi(e.data.adds)]);return Gi(Ji(e,{texts:t[0],attributes:t[1],removes:t[2],adds:t[3]}))}if(e.type===d.IncrementalSnapshot&&e.data.source===v.StyleSheetRule){var r=yield Promise.all([e.data.adds?Hi(e.data.adds):void 0,e.data.removes?Hi(e.data.removes):void 0]);return Gi(Ji(e,{adds:r[0],removes:r[1]}))}}catch(t){return(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return(e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""))(e)||t===m})(t)&&(Wi=!0),Fi.error("could not compress event asynchronously - trying synchronous compression",t),Ki(e)}return{event:e,size:br(e)}})),Xi.apply(this,arguments)}function en(e,t){return e.type===d.Custom&&e.data.tag===t}function tn(e){return en(e,"sessionIdle")}function rn(e){return en(e,"$session_ending")}function nn(e){return en(e,"$session_starting")}class an{get sessionId(){return this._e}get Se(){if(!this._instance.sessionManager)throw new Error(Oi+" must be started with a valid sessionManager.");return this._instance.sessionManager}get xe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ce(){return xi(this._instance.get_property(Dt),this.sessionId)}get le(){var e,t=null==(e=this.Me)?void 0:e.sampleRate;return O(t)?t:null}get Te(){var e,t;return null!==(e=null==(t=this.Ie)?void 0:t.getMinimumDuration(this.sessionId))&&void 0!==e?e:null}constructor(e,t){this.Ee="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Re=void 0,this.Ae=Date.now(),this.Le=!1,this.Oe=[],this.Fe="unknown",this.Ne=0,this.De=!1,this.Pe=!1,this.qe=!1,this.je=!1,this.Be=!1,this.He=!1,this.$e=!1,this.Ue=!1,this.We=!1,this.ze=!1,this.Ve=!1,this.Ze=!1,this.Qe=[],this.Ge=void 0,this.Ye=void 0,this.Je=[],this.Ke=0,this.Xe=0,this.et=!1,this.tt=void 0,this.pe=void 0,this.rt=void 0,this.it=void 0,this.nt=void 0,this.ot=(e,t,r)=>{var i,n,a;if(r&&(e!==this._e||t!==this.st)){var o,s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this._e,l=this.st;if(s&&this.be("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this.Ae,flushed_size:null==(o=this.ut)?void 0:o.currentTrackedSize(u)}),null==(i=this._instance.persistence)||i.unregister(Ut),this.$e=!1,null==(n=Pi())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.be("$session_id_change",{sessionId:e,windowId:t,changeReason:r}),this.ht(),!(!1===this.Fe&&this.isStarted||this._e===e&&this.st===t)){var h=this._e!==e&&!1!==this.Fe;this.Fe="unknown",this.ct(h)}s&&this.be("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:e,nextWindowId:t,changeReason:r,lastActivityTimestamp:this.Ae}),null==(a=this.Ie)||a.makeSamplingDecisions(e)}},this.dt=()=>{var e;return(null==(e=this._instance.persistence)?void 0:e.props[Pt])===this._e},this.vt=()=>{var e,t;if(0===this.ft.data.length)return null;var r=null==(e=this.ft.data[0])?void 0:e.timestamp,i=null==(t=this.ft.data[this.ft.data.length-1])?void 0:t.timestamp;return O(r)&&O(i)?i-r:null},this.yt=()=>{var e,t,r=this.Te;if(!O(r))return!1;if(null===(e=null==(t=this._instance.config.session_recording)?void 0:t.strictMinimumDuration)||void 0===e||!e){var i=this.bt;return O(i)&&i>=0&&r>i}if(this.dt())return!1;var n,a=this.vt();return!!A(a)||r>a||(null==(n=this._instance.persistence)||n.register({[Pt]:this._e}),!1)},this.wt=()=>{this.status!==Jt?(this.De&&this.Pe&&this.kt&&!this.qe&&(this.De=!1),this._t(),this.St()):this.xt()},this.Ct=()=>{this.wt()},this.Mt=()=>{this.be("browser offline",{})},this.Tt=()=>{this.be("browser online",{})},this.It=()=>{null!=i&&i.visibilityState&&("visible"===i.visibilityState&&(this.kt=!0),this.be("window "+i.visibilityState,{}))},this._instance=e,this.kt=null==t||t;var r=this.Se.checkAndGetSessionAndWindowId(),n=r.windowId;this._e=r.sessionId,this.st=n,this.K=new vr(this._instance),this.Y=new dr(this._instance),this.J=new fr(this._instance),this.ft=this.xt(),this.Se.sessionTimeoutMs>this.xe||Fi.warn("session_idle_threshold_ms ("+this.xe+") is greater than the session timeout ("+this.Se.sessionTimeoutMs+"). Session will never be detected as idle"),this.ut=new ai(this._instance)}setDocumentWasEverVisible(e){e&&(this.kt=!0)}get Et(){var e,t,r,i,n,a,o,s,u,l=null==(e=this.Me)?void 0:e.masking,h={maskAllInputs:null==(t=this._instance.config.session_recording)?void 0:t.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},c=null!==(a=null==h?void 0:h.maskAllInputs)&&void 0!==a?a:null==l?void 0:l.maskAllInputs,d=null!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==l?void 0:l.maskTextSelector,v=null!==(s=null==h?void 0:h.blockSelector)&&void 0!==s?s:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return I(c)&&I(d)&&I(v)&&I(f)?void 0:{maskAllInputs:null==c||c,maskTextSelector:d,blockSelector:v,maskAllElementAttributes:f}}Rt(){var e;if(!this.We){var t=null==(e=this.Me)?void 0:e.masking;if(!L(t)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((e=>{var i=null==r?void 0:r[e],n=t[e];return!I(i)&&i!==n}));0!==i.length&&(this.We=!0,Fi.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:t}))}}}get At(){var e;return H(null==(e=this._instance.config.session_recording.canvasCapture)?void 0:e.resolutionScale,.1,1,Oe("canvas recording resolution scale"),1)}get Lt(){var e,t,r,i,n,a,o,s=this._instance.config.session_recording.captureCanvas,u=null==(e=this.Me)?void 0:e.canvasRecording,l=null!==(t=null!==(r=null==s?void 0:s.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==t&&t,h=null!==(i=null!==(n=null==s?void 0:s.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,c=null!==(a=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==u?void 0:u.quality)&&void 0!==a?a:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:l,fps:H(h,0,12,Oe("canvas recording fps"),4),quality:H(c,0,1,Oe("canvas recording quality"),.4)}}get Ot(){var e,t=!(null==(e=this.Me)||!e.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:t}get Ft(){var e,t,r,i=null==(e=this.Me)?void 0:e.networkPayloadCapture,n={recordHeaders:null==(t=this._instance.config.session_recording)?void 0:t.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},a=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),s=Ei(this._instance.config.capture_performance),u=Ei(null==i?void 0:i.capturePerformance),l=!!(F(s)?s:u);return a||o||l?{recordHeaders:a,recordBody:o,recordPerformance:l}:void 0}Nt(){var e,t,r=[],i=null==(e=s.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;i&&this.Ot&&r.push(i());var a=null==(t=s.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;if(this.Ft&&M(a))if(!qe.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var o=M(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(a(((e,t,r)=>{var i,n={payloadSizeLimitBytes:kt.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...kt.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...kt.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,u=(i=wt(n),e=>(null!=e&&e.requestBody&&(e.requestBody=Tt(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Tt(e.responseBody,e.responseHeaders,i,"Response")),e)),l=t=>{return u(((e,t,r)=>{var i;if(null==r||!r(e.name)){var n=je(e.name),a=0===t.indexOf("http")?null==(i=je(t))?void 0:i.pathname:t;"/"===a&&(a="");var o=null==n?void 0:n.pathname.replace(a||"","");if(!(n&&o&&Mt.some((e=>0===o.indexOf(e)))))return e}})((Ct((i=t).requestHeaders),Ct(i.responseHeaders),i),e.api_host,r));var i},c=M(e.session_recording.maskNetworkRequestFn);return c&&M(e.session_recording.maskCapturedNetworkRequestFn)&&Le.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var r=e.session_recording.maskNetworkRequestFn({url:t.name});return!r&&t.isInitial?r:h({},t,{name:null==r?void 0:r.url})}),n.maskRequestFn=M(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var r=l(t);if(r){var i=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,n=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(r);return L(n)&&i?(Et.add(i),i):null!=n?n:void 0}}:e=>function(e){if(!I(e))return e.requestBody=It(e.requestBody,"Request"),e.responseBody=It(e.responseBody,"Response"),e}(l(e)),h({},kt,n,{recordHeaders:a,recordBody:o,recordPerformance:s,recordInitialRequests:s,streamNetworkBody:!0===e.session_recording.streamNetworkBody})})(this._instance.config,this.Ft,o)))}else Fi.info("NetworkCapture not started because we are on localhost.");return r}Dt(e){return this._instance.config.disable_capture_url_hashes?ve(e):e}Pt(e,t){void 0===t&&(t=!1);var r=t?ve(e):this.Dt(e),i=this._instance.config.mask_personal_data_properties?[...Ti,...this._instance.config.custom_personal_data_properties||[]]:[];return this.qt(function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],a=(i[0]||"").split("?"),o=a[1],s=a[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var c=u[h].split("=");C(c)&&(t.includes(c[0])?l.push(c[0]+"=<masked>"):l.push(u[h]))}var d=s;return null!=o&&(d+="?"+l.join("&")),null!=n&&(d+="#"+n),d}(r,i))}qt(e){var t=this._instance.config.session_recording;if(t.maskCapturedNetworkRequestFn){var r,i=t.maskCapturedNetworkRequestFn({name:e});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(t.maskNetworkRequestFn){var n=t.maskNetworkRequestFn({url:e});return null==n?void 0:n.url}return e}jt(e){try{return e.rrwebMethod(),!0}catch(t){return 10>this.Oe.length?this.Oe.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt+1,rrwebMethod:e.rrwebMethod}):Fi.warn("could not emit queued rrweb event.",t,e),!1}}be(e,t){return this.jt(Di((()=>qi().addCustomEvent(e,t))))}Bt(){try{if(this._instance.config.capture_pageview||!e)return;var t=new URL(e.location.href),r=this.Pt(t.origin+t.pathname+t.search);this.Ht!==r&&(this.Ht=r,this.be("$url_changed",{href:r}))}catch(e){}}$t(){if(this.Oe.length){var e=[...this.Oe];this.Oe=[],e.forEach((e=>{Date.now()-e.enqueuedAt>2e3||this.jt(e)}))}}de(){return this.jt(Di((()=>qi().takeFullSnapshot())))}get Ut(){var e,t,r;if(null!=(e=this.Ie)&&e.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return O(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(t=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==t?t:3e5}Wt(){if(this.zt&&clearInterval(this.zt),!0!==this.Fe){var e=this.Ut;e&&(this.zt=setInterval((()=>{this.de()}),e))}}ve(e){"event"===e&&this.Vt(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Wt()}Zt(){this.Y.urlBlocked||(this.Y.urlBlocked=!0,clearInterval(this.zt),Fi.info("recording paused due to URL blocker"),this.be("recording paused",{reason:"url blocker"}))}Qt(){this.Y.urlBlocked&&(this.Y.urlBlocked=!1,this.de(),this.Wt(),this.be("recording resumed",{reason:"left blocked url"}),Fi.info("recording resumed"))}Gt(e,t){var r;if("event"===e&&this.Vt(),!this.Le&&null!=(r=this.Ie)&&r.hasPendingTriggers(this.sessionId)){this.Le=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===e?qt:jt]:this.sessionId}),null==(n=this.Ie)||n.updateActiveTriggers(this.sessionId),this.ve(),this.St(),this.ce(e+"_trigger_matched",{["url"===e?"matchedUrl":"matchedEvent"]:t})}finally{this.Le=!1}}}get isStarted(){return!!this.Re}get Me(){var e=this._instance.get_property(Rt);if(e){var t;try{t=T(e)?e:JSON.parse(e)}catch(e){return void Fi.warn("persisted remote config for session recording is invalid and will be ignored",e)}if(!this.isStarted){var r,i,n=null!==(r=t.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Fi.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:e}),void(null==(i=this._instance.persistence)||i.unregister(Rt))}return t}}Yt(e,t,r){this._instance.get_property(e)&&(t(),r())}start(t){var r,n,a=this.Me;if(a){this.isStarted||(this.De=!1!==this.Fe&&!this.je,this.je=!1,this.Pe=this.De,this.qe=!1),this.et&&(this.Jt(),this.xt());var o=this.Se.checkAndGetSessionAndWindowId(),s=o.windowId;this._e=o.sessionId,this.st=s,null==(r=this._instance.persistence)||r.unregister(Ut),null!=a&&a.endpoint&&(this.Ee=null==a?void 0:a.endpoint),this.Ie=2===(null==a?void 0:a.version)&&(null==a?void 0:a.triggerGroups)&&a.triggerGroups.length>0?new Mi(this._instance,this.Y,this.ce.bind(this),this.be.bind(this),this.ve.bind(this)):new Ci(this._instance,this.Y,this.J,this.K,this.ce.bind(this),this.de.bind(this),this.ve.bind(this)),this.Ie.onRemoteConfig(a),null==(n=this.pe)||n.call(this),this.pe=this.Ie.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((e,t)=>this.Gt(e,t))),this.Yt(Lt,(()=>{this.overrideSampling()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Lt)})),this.Yt(Ot,(()=>{this.overrideLinkedFlag()}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Ot)})),this.Yt(Nt,(()=>{this.overrideTrigger("event")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Nt)})),this.Yt(Ft,(()=>{this.overrideTrigger("url")}),(()=>{var e;return null==(e=this._instance.persistence)?void 0:e.unregister(Ft)})),this.Ie.makeSamplingDecisions(this.sessionId),this.Kt(),this.Be||(Pe(e,"beforeunload",this.wt),Pe(e,"pagehide",this.Ct),Pe(e,"offline",this.Mt),Pe(e,"online",this.Tt),Pe(i,"visibilitychange",this.It),!this.rt&&M(this.Se.onSessionId)&&(this.rt=this.Se.onSessionId(this.ot)),!this.it&&M(this.Se.on)?this.it=this.Se.on("forcedIdleReset",(()=>{this.ht(),this.Fe="unknown",this.stop(),this.nt=this.Se.onSessionId(((e,t,r)=>{var i;null==(i=this.nt)||i.call(this),this.nt=void 0,this.ot(e,t,r)}))})):M(this.Se.on)||Fi.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),L(this.tt)&&(this.tt=this._instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.Pt(e.properties.$current_url):"";if(!t)return;this.be("$pageview",{href:t})}}catch(e){Fi.error("Could not add $pageview to rrweb session",e)}}))),this.status===Yt&&this.ce(t||"recording_initialized"))}else Fi.info("remote config must be stored in persistence before recording can start")}Xt(){var t,r,n,a,o,s;null==e||e.removeEventListener("beforeunload",this.wt),null==e||e.removeEventListener("pagehide",this.Ct),null==e||e.removeEventListener("offline",this.Mt),null==e||e.removeEventListener("online",this.Tt),null==i||i.removeEventListener("visibilitychange",this.It),clearInterval(this.zt),this.er(),null==(t=this.tt)||t.call(this),this.tt=void 0,null==(r=this.pe)||r.call(this),this.pe=void 0,null==(n=this.rt)||n.call(this),this.rt=void 0,null==(a=this.it)||a.call(this),this.it=void 0,null==(o=this.nt)||o.call(this),this.nt=void 0,null==(s=this.Ie)||s.stop(),this.tr(),this.Jt()}Jt(){this.Xe+=1,this.Je=[],this.Ke=0,this.rr=void 0,this.et=!1}tr(){var e,t;null==(e=this.ir)||e.stop(),this.Oe=[],null==(t=this.Re)||t.call(this),this.Re=void 0}nr(){if(!this.rr||0===this.Ke)return!1;if(this.et)return!0;this.et=!0;var e=this.Xe;return this.er(),this.tr(),this.rr.catch((()=>{})).then((()=>{e===this.Xe&&(this.et=!1,this.St(),this.xt(),this.Xt(),Fi.info("stopped"))})).catch((()=>{this.et=!1,this.Xt(),Fi.info("stopped")})),!0}stop(){this.tr(),this.nr()||(this.St(),this.xt(),this.Xt(),Fi.info("stopped"))}ct(e){var t;this.stop(),this.ar=void 0,this.sr=void 0,null==(t=Pi())||null==t.resetSnapshotCostState||t.resetSnapshotCostState(),this.start("session_id_changed"),this.De=e,this.Pe=!1}Vt(){this.isStarted||(this.je=!0),this.De&&(this.De=!1,this.Pe=!1,this.qe&&(this.qe=!1,this.de()),this.ur())}discard(){this.xt(),this.Xt(),Fi.info("discarded")}lr(e,t,r,i,n){var a={$snapshot_bytes:r,$snapshot_data:t,$session_id:i,$window_id:n};this.status!==Qt?(this.hr(e,i),this.cr(a)):this.xt()}dr(){try{this.vr()}catch(e){this.Ue||(this.Ue=!0,Fi.error("could not track full snapshot cost",e))}}vr(){var e,t=null==(e=Pi())||null==e.getLastSnapshotCost?void 0:e.getLastSnapshotCost();t&&t!==this.sr&&(this.sr=t,this.ar&&this.ar.durationMs>=t.durationMs||(this.ar=t),500>t.durationMs||Fi.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(t.durationMs),stylesheetMs:Math.round(t.stylesheetMs),nodeCount:t.nodeCount,cssRuleCount:t.cssRuleCount,nonDeferrableCssRuleCount:t.nonDeferrableCssRuleCount,deferredStylesheetCount:t.deferredStylesheetCount}))}hr(e,t){e.type!==d.FullSnapshot?e.type===d.IncrementalSnapshot&&(I(this.Ge)||this.Ge===t||this.Ye===t||(this.Ye=t,Fi.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:t}),this.de())):this.Ge=t}pr(e){e.counted&&e.generation===this.Xe&&(this.Ke=Math.max(0,this.Ke-1)),e.counted=!1,this.Je=this.Je.filter((t=>t!==e))}mr(e,t,r){e.processed||e.generation!==this.Xe||(e.processed=!0,this.lr(e.event,t,r,e.targetSessionId,e.targetWindowId))}gr(e){try{var t=e.compressionEnabled?Ki(e.event):{event:e.event,size:br(e.event)};this.mr(e,t.event,t.size)}finally{this.pr(e)}}_t(){[...this.Je].forEach((e=>{this.gr(e)}))}yr(e,t,r,i){var n=this,a={event:e,compressionEnabled:t,targetSessionId:r,targetWindowId:i,generation:this.Xe,processed:!1,counted:!0};this.Je.push(a),this.Ke+=1;var o=function(){var r=l((function*(){try{if(a.processed)return;var r,i;try{var o=t?Qi(e)?yield function(e){return Xi.apply(this,arguments)}(e):Ki(e):{event:e,size:br(e)};r=o.event,i=o.size}catch(t){Fi.error("could not process queued compression event - will use uncompressed event",t),r=e,i=br(e)}n.mr(a,r,i)}finally{n.pr(a)}}));return function(){return r.apply(this,arguments)}}();this.rr=this.rr?this.rr.catch((()=>{})).then(o):o()}onRRwebEmit(e){var t,r,i,n,a,o,s,u,l;if(this._instance.sessionManager&&(this.$t(),e&&T(e))){if(e.type===d.Meta){var h=this.Pt(e.data.href);if(this.Ht=h,!h)return;e.data.href=h}else this.Bt();if(null==(t=this.Ie)||t.checkUrlTriggers(this.sessionId,(()=>this.Zt()),(()=>this.Qt()),((e,t)=>this.Gt(e,t))),!this.Y.urlBlocked||function(e){return e.type===d.Custom&&"recording paused"===e.data.tag}(e)){var c,f,p;e.type===d.FullSnapshot&&(null!=(c=Pi())&&null!=c.wasMaxDepthReached&&c.wasMaxDepthReached()&&(this.$e=!0),this.dr(),Promise.resolve().then((()=>this.dr())),this.Wt(),null==(f=this.ir)||f.reset(),null==(p=this._instance.persistence)||p.register_once({[Ut]:e.timestamp},void 0)),e.type===d.FullSnapshot&&null!=(r=this.Ie)&&r.hasPendingTriggers(this.sessionId)&&this.br();var m=this.ir?this.ir.throttleMutations(e):e;if(m){var g=function(e){var t=e;if(t&&T(t)&&6===t.type&&T(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;t.data.payload.payload.length>i;i++)r.push(t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?t.data.payload.payload[i].slice(0,2e3)+"...[truncated]":t.data.payload.payload[i]);return t.data.payload.payload=r,e}return e}(m),y=function(e){return rn(e)?e.data.payload:null}(g),b=function(e){return nn(e)?e.data.payload:null}(g),w=function(e){return tn(e)?e.data.payload:null}(g);y||b?null!=y&&y.lastActivityTimestamp&&(g.timestamp=y.lastActivityTimestamp):null!=w&&w.sessionId||this.wr(g),e.type===d.FullSnapshot&&(this.Qe.push([this._e,e.timestamp]),this.Qe.length>6&&(this.Qe=this.Qe.slice(-6)));var k=null!==(i=null!==(n=null!==(a=null==y?void 0:y.currentSessionId)&&void 0!==a?a:null==b?void 0:b.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==i?i:this._e,_=null!==(o=null!==(s=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==s?s:null==w?void 0:w.windowId)&&void 0!==o?o:this.st;if(!0!==this.Fe||function(e){return tn(e)||rn(e)||nn(e)}(g)){g.type===d.FullSnapshot&&(this.Ne=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var S=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.Ke>0||S&&Qi(g))this.yr(g,S,k,_);else{var x=S?Ki(g):{event:g,size:br(g)};this.lr(g,x.event,x.size,k,_)}}else(function(e){return e.type===d.FullSnapshot||e.type===d.Meta||e.type===d.IncrementalSnapshot&&e.data.source!==v.CanvasMutation})(g)&&this.Ne++}else!0===this.Fe&&this.Ne++}}}get status(){return this.Ie?this.Ie.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ce,rrwebError:this.Be,urlTriggerMatching:this.Y,eventTriggerMatching:this.J,linkedFlagMatching:this.K,remoteConfig:this.Me}):Qt}log(e,t){var r;void 0===t&&(t="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.K.linkedFlagSeen=!0,this.de(),this.Vt(),this.ce("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[Dt]:this.sessionId,[At]:null}),this.de(),this.Vt(),this.ce("sampling_overridden")}overrideTrigger(e){this.Gt(e),this.Vt()}kr(){try{var t,r=null==e||null==(t=e.location)?void 0:t.href;if(!r)return;var i=this.Pt(r);if(!i)return;return new URL(i).hostname||void 0}catch(e){return}}er(){this._r&&(clearTimeout(this._r),this._r=void 0)}ur(){this._r||(this._r=setTimeout((()=>{this.St()}),2e3))}Sr(){return this.Ge!==this.ft.sessionId&&0!==this.ft.data.length&&this.ft.data.every((e=>(null==e?void 0:e.type)===d.Custom&&!rn(e)&&!nn(e)))}Cr(){var e,t;return null!==(e=null==(t=this.Ie)?void 0:t.getPendingTriggerConditions(this.sessionId))&&void 0!==e?e:[]}Mr(e){if(e!==Jt)return I(this.Tr)||this._instance.register_for_session({[Vt]:[]}),void(this.Tr=void 0);var t=this.Cr();if(0===t.length)return I(this.Tr)||this._instance.register_for_session({[Vt]:[]}),void(this.Tr=void 0);var r=t.join(", "),i=this.sessionId+":"+r;i!==this.Tr&&(this.Tr=i,this._instance.register_for_session({[Vt]:t}),Fi.info("buffering: "+r))}St(){var e;if(this.er(),this.De)return this.ft;if(this.Sr())return this.ft.size>Li?this.xt():this.ft;var t=this.ft;null==(e=this.Ie)||e.ensureSamplingDecision(this.sessionId);var r=this.yt(),i=this.status;if(this.Mr(i),i===Jt||i===Kt||i===Qt||r)return this.ur(),this.ft;if(this.ft!==t)return this.ft;if(t.data.length>0){var n,a=this.kr();kr(t).forEach((e=>{var t;null==(t=this.ut)||t.trackSize(e.sessionId,e.size),this.Ir({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Re.LIB_NAME,$lib_version:Re.LIB_VERSION,$snapshot_host:a})})),null==(n=this.Ie)||n.onFlushComplete()}return this.xt()}cr(e){var t,r=2+((null==(t=this.ft)?void 0:t.data.length)||0),i=e.$session_id,n=this.ft.sessionId!==i;if(n||!0!==this.Fe&&!this.De&&this.ft.size+e.$snapshot_bytes+r>Li){var a=this._e;if(this.ft=this.St(),this._e!==a)return;n&&this.ft.data.length>0&&(this.ft=this.xt()),this.ft.sessionId=i,this.ft.windowId=e.$window_id}this.De&&(this.qe||this.ft.size+e.$snapshot_bytes+r>Li)?this.qe||(this.qe=!0,this.ft=this.xt()):(this.ft.size+=e.$snapshot_bytes,this.ft.data.push(e.$snapshot_data),this.ft.sizes.push(e.$snapshot_bytes),!0===this.Fe||this.De||this.ur())}Ir(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.Ee),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get bt(){var e,t,r=null==(e=this.ft)?void 0:e.data[(null==(t=this.ft)?void 0:t.data.length)-1],i=this.Se.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}br(){if(!this.ft||0===this.ft.data.length)return this.xt();for(var e=-1,t=this.ft.data.length-1;t>=0;t--)if(this.ft.data[t].type===d.Meta){e=t;break}return 0>e?this.xt():(this.ft.data=this.ft.data.slice(e),this.ft.sizes=this.ft.sizes.slice(e),this.ft.size=this.ft.sizes.reduce(((e,t)=>e+t),0),this.ft)}xt(){return this.ft={size:0,data:[],sizes:[],sessionId:this._e,windowId:this.st},this.ft}ce(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),Fi.info(e.replace("_"," "),t),"session_id_changed"!==e&&this.be("$recording_started",h({reason:e},t))}Er(e){var t;return 3===e.type&&-1!==Ni.indexOf(null==(t=e.data)?void 0:t.source)}wr(e){var t=this.Er(e);t||!0===this.Fe||e.timestamp-this.Ae>this.xe&&(this.Fe=!0,clearInterval(this.zt),this.be("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.Ae,threshold:this.xe,bufferLength:this.ft.data.length,bufferSize:this.ft.size,sessionId:this._e,windowId:this.st}),this.St());var r=!1;if(t&&(this.Ae=e.timestamp,this.Fe)){var i="unknown"===this.Fe;this.Fe=!1,i||(this.be("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}var n=this.Se.checkAndGetSessionAndWindowId(!t,e.timestamp),a=n.windowId,o=n.sessionId,s=this._e!==o,u=this.st!==a;if(this.st=a,this._e=o,s||u){var l=s&&!1!==this.Fe;l&&(this.Fe="unknown"),this.ct(l)}else if(t&&this.Vt(),r){var h,c=["sampled","active"].includes(this.status)||(null==(h=this.Ie)?void 0:h.hasPendingTriggers(this.sessionId));this.Ne>0&&c&&this.de(),this.Wt()}}ht(){var e;null==(e=this.Ie)||e.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var e,t,r,i,n,a,o,s,u,l=this.Se.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(e=Pi())||null==e.getDeferredStylesheetStats?void 0:e.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.ft.data.length,$sdk_debug_replay_internal_buffer_size:this.ft.size,$sdk_debug_current_session_duration:this.bt,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(t=this.ut)?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Qe,$snapshot_max_depth_exceeded:this.$e,$sdk_debug_replay_slowest_full_snapshot_ms:Ii(null==(r=this.ar)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Ii(null==(i=this.ar)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.ar)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(a=this.ar)?void 0:a.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.ar)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Ii(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Ii(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Ii(null==(s=Pi())||null==s.getMutationCost||null==(s=s.getMutationCost())?void 0:s.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=Pi())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_rrweb_error:this.Be,$sdk_debug_rrweb_attached:!!this.Re,$sdk_debug_rrweb_start_attempted:this.He}}Kt(){var e;if(!this.Re){this.He=!0;var t,r,i,n,a={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},o=this._instance.config.session_recording;for(var s of Object.entries(o||{})){var u=s[0],l=s[1];if(u in a)if("maskInputOptions"===u)a.maskInputOptions=h({password:!0},l);else if("sampling"===u){var c=null!=l?l:{},d={};I(c.mousemove)||(d.mousemove=c.mousemove),I(c.mouseInteraction)||(d.mouseInteraction=c.mouseInteraction),a.sampling=d}else a[u]=l}this.Lt&&this.Lt.enabled&&(a.recordCanvas=!0,a.sampling=h({},a.sampling,{canvas:this.Lt.fps}),a.dataURLOptions={type:"image/webp",quality:this.Lt.quality},a.canvasResolutionScale=this.At,a.canvasMasking={configured:()=>{var e;return M(null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn)},regionsFn:e=>{var t,r=null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn;if(M(r))try{var i;return null!==(i=r(e))&&void 0!==i?i:null}catch(e){return this.Ve||(this.Ve=!0,Fi.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",e)),null}}}),this.Et&&(a.maskAllInputs=null===(t=this.Et.maskAllInputs)||void 0===t||t,a.maskTextSelector=null!==(r=this.Et.maskTextSelector)&&void 0!==r?r:void 0,a.blockSelector=null!==(i=this.Et.blockSelector)&&void 0!==i?i:void 0,a.maskAllElementAttributes=null!==(n=this.Et.maskAllElementAttributes)&&void 0!==n&&n),a.maskAllElementAttributes&&a.maskAttributeFn&&(a.maskAttributeFn=void 0,this.ze||(this.ze=!0,Fi.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.Rt();var v=qi();if(v){this.ir=null!==(e=this.ir)&&void 0!==e?e:new ni(v,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var r="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";Fi.info(r,{node:t}),this.log(Oi+" "+r,"warn")}});var f=this.Nt();if(this.Re=v(h({emit:e=>{this.onRRwebEmit(e)},plugins:f,errorHandler:(e,t)=>"rrweb"===t&&(this.Ze||(this.Ze=!0,Fi.error("rrweb internal error - recording will continue but may be incomplete",e)),!0)},a)),!this.Re)return this.Be=!0,void Fi.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Be=!1,this.Ae=Date.now(),this.Fe=F(this.Fe)?this.Fe:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Me),this.be("$session_options",{sessionRecordingOptions:a,activePlugins:f.map((e=>null==e?void 0:e.name))}),this.be("$posthog_config",{config:this._instance.config})}else Fi.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(e,t){return this.be(e,t)}}var on,sn=["type"],un=Object.defineProperty,ln=(e,t,r)=>((e,t,r)=>t in e?un(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),hn=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(hn||{}),cn=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(cn||{}),dn=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(dn||{}),vn=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(vn||{}),fn=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fn||{}),pn=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(pn||{}),mn=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(mn||{});function gn(e,t){return-1!==e.indexOf(t)}var yn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},bn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},wn={};function kn(e){if(wn[e])return wn[e];var t=function(e){var t,r,i=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return i&&globalThis[i]?globalThis[i]:void 0}(e)||globalThis[e],r=t.prototype,i=e in yn?yn[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),a=e in bn?bn[e]:void 0,o=Boolean(a&&a.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return wn[e]=t.prototype,t.prototype;var s=document.createElement("iframe");s.style.display="none";var u=!1;try{document.body.appendChild(s);var l=s.contentWindow;if(!l)return t.prototype;var h=l[e].prototype;return h?(function(e){return gn(e,"AppleWebKit")&&!gn(e,"Chrome")}(navigator.userAgent)&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",e),u=!0),wn[e]=h):r}catch(e){return r}finally{!u&&s.parentNode&&document.body.removeChild(s)}}var _n={};function Sn(e,t,r){var i,n=e+"."+String(r);if(_n[n])return _n[n].call(t);var a=kn(e),o=null==(i=Object.getOwnPropertyDescriptor(a,r))?void 0:i.get;return o?(_n[n]=o,o.call(t)):t[r]}var xn={};function Cn(e,t,r){var i=e+"."+String(r);if(xn[i])return xn[i].bind(t);var n=kn(e)[r];return"function"!=typeof n?t[r]:(xn[i]=n,n.bind(t))}function Mn(){return kn("MutationObserver").constructor}function Tn(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n={next:i},a=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),e[t]=a,()=>{if(e[t]!==a)for(var r=e[t];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===a)return void(i.next=n.next);r=i.next}else e[t]=n.next}}catch(e){return()=>{}}}var In={childNodes:e=>Sn("Node",e,"childNodes"),parentNode:e=>Sn("Node",e,"parentNode"),parentElement:e=>Sn("Node",e,"parentElement"),textContent:e=>Sn("Node",e,"textContent"),contains:(e,t)=>Cn("Node",e,"contains")(t),getRootNode:e=>Cn("Node",e,"getRootNode")(),host:e=>e&&"host"in e?Sn("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?Sn("Element",e,"shadowRoot"):null,querySelector:(e,t)=>Cn("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>Cn("Element",e,"querySelectorAll")(t),mutationObserver:Mn,patch:Tn},En=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function Rn(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(e){}return Date.now()}var An=0,Ln=6e4;function On(){An+=1}function Fn(){return An}function Nn(e,t){return t!==An||e>Ln}var Dn=0,Pn=0,qn=0,jn=En(),Bn=null,Hn=null,$n=[],Un=0,Wn=0,zn={slowestBatchMs:0},Vn={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Zn=e=>e&&e>0?e:null;function Qn(e){(Dn+=1)>1||(jn=En(),$n=[],Un=0,Hn=Zn(e),Pn=Rn(),qn=An)}function Gn(){return 0===Dn?Bn||En():(Dn-=1)>0?jn:(jn.durationMs=Rn()-Pn,jn.deferredStylesheetCount=Un,Vn.deferredCount+=Un,Hn=null,Nn(jn.durationMs,qn)?jn:Bn=jn)}var Yn=32;function Jn(e,t,r){var i=e.length;if(r>=Yn)return i;for(var n=0;e.length>n;n++){var a=e[n];try{var o=a.cssRules;if(o&&o.length)i+=Jn(o,t,r+1);else if(t&&a.styleSheet){var s=a.styleSheet;if(!t.has(s)){t.add(s);var u=s.rules||s.cssRules;u&&(i+=Jn(u,t,r+1))}}}catch(e){}}return i}function Kn(e){if(0!==Dn){var t=Jn(e,null,0);jn.cssRuleCount+=t,Wn>0&&(jn.nonDeferrableCssRuleCount+=t)}}function Xn(e){Wn+=1;try{return e()}finally{Wn-=1}}function ea(e){Dn>0&&(jn.stylesheetMs+=e)}function ta(e){if(0===Dn||null===Hn)return!1;var t=jn.cssRuleCount-jn.nonDeferrableCssRuleCount;return t>=Hn||t+function(e){try{var t=e&&(e.rules||e.cssRules);if(!t)return 0;var r=new WeakSet;return r.add(e),Jn(t,r,0)}catch(e){return 0}}(e)>Hn}function ra(){Vn.failedCount+=1}function ia(e){e>0&&(Vn.abandonedCount+=e)}function na(e){return e.nodeType===e.ELEMENT_NODE}function aa(e){var t=e&&"host"in e&&"mode"in e&&In.host(e)||null;return Boolean(t&&"shadowRoot"in t&&In.shadowRoot(t)===e)}function oa(e){return"[object ShadowRoot]"==={}.toString.call(e)}function sa(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function ua(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}var la=0;function ha(e){var t=0===la,r=t?Rn():0;la+=1;try{var i=e.rules||e.cssRules;if(!i)return null;Kn(i);var n=e.href;return!n&&e.ownerNode&&(n=e.ownerNode.baseURI),sa(Array.from(i,(e=>ca(e,n))).join(""))}catch(e){return null}finally{la-=1,t&&ea(Rn()-r)}}function ca(e,t){var r;if(va(e)){var i;try{i=ha(e.styleSheet)||ua(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return Ea(i,e.styleSheet.href)}catch(e){}return i}var n=e.cssText;return fa(e)&&e.selectorText.includes(":")&&(n=da(n)),t?Ea(n,t):n}function da(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function va(e){return"styleSheet"in e}function fa(e){return"selectorText"in e}var pa=/^-?[A-Za-z_][\w-]*$/,ma=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function ga(e){var t=[],r=!1,i=null,n=new Map;function a(e){var n=t.pop();if("group"===n.kind){if(null===e){for(;t.length>0&&"group"===t[t.length-1].kind;)t.pop();return void a(null)}var s=t[t.length-1];return s.parts.push(e),void(s.index+=1)}if(!n.importRule)return r=!0,void(i=e);o(t[t.length-1],n.importRule,e)}function o(e,t,r){var i;try{var n;try{n=r||ua(t)}catch(e){n=t.cssText}try{n&&(null==(i=t.styleSheet)?void 0:i.href)&&(n=Ea(n,t.styleSheet.href))}catch(e){}n&&e.parts.push(n),e.index+=1}catch(e){a(null)}}function s(e){var r=e.rules[e.index];if("sheet"===e.kind&&va(r)){var i=n.get(r);return null===i?(e.parts.push(r.cssText),void(e.index+=1)):i?void t.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void o(e,r,null)}if(!function(e,r){try{var i=function(e){var t,r=e;if(!r.cssRules||0===r.cssRules.length)return null;if(r.media&&"string"==typeof r.media.mediaText)return"@media "+r.media.mediaText+" {";if(fa(e)){if("number"==typeof r.type&&1!==r.type)return null;var i=r.style?r.style.cssText:"";return e.selectorText+" {"+(i?" "+i:"")}if("containerName"in r)return"string"!=typeof r.containerQuery||r.containerName&&!pa.test(r.containerName)?null:"@container "+(r.containerName?r.containerName+" ":"")+r.containerQuery+" {";if("string"==typeof r.conditionText){var n="";try{n=(null==(t=e.constructor)?void 0:t.name)||""}catch(e){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+r.conditionText+" {":null}return"string"==typeof r.name?"keyText"in r.cssRules[0]?pa.test(r.name)?"@keyframes "+r.name+" {":null:""===r.name?"@layer {":ma.test(r.name)?"@layer "+r.name+" {":null:null}(e);if(null===i)return!1;var n=r.sheetHref;return t.push({kind:"group",rules:Array.from(e.cssRules),sheetHref:n,index:0,parts:[],prelude:n?Ea(i,n):i,fixColons:"sheet"===r.kind&&fa(e)&&e.selectorText.includes(":")}),!0}catch(e){return!1}}(r,e)){var a=r.cssText;"sheet"===e.kind&&fa(r)&&r.selectorText.includes(":")&&(a=da(a)),e.parts.push(e.sheetHref?Ea(a,e.sheetHref):a),e.index+=1}}return function(e){try{var r=e.rules||e.cssRules;if(!r)return!1;Kn(r);var i=e.href;!i&&e.ownerNode&&(i=e.ownerNode.baseURI);var a=Array.from(r);return t.push({kind:"sheet",sheet:e,rules:a,sheetHref:i,index:0,parts:[],importRule:null}),function(e,t){for(var r=[{sheet:t,rules:e,index:0}],i=function(){var e=r[r.length-1];if(e.index>=e.rules.length)return r.pop(),0;var t=e.rules[e.index];if(e.index+=1,!va(t)||n.has(t))return 0;var i=null;try{i=t.styleSheet}catch(e){return n.set(t,null),0}if(!i||r.some((e=>e.sheet===i)))return 0;try{var a=i.rules||i.cssRules;if(!a)return 0;Kn(a);var o=i.href;!o&&i.ownerNode&&(o=i.ownerNode.baseURI);var s=Array.from(a);n.set(t,{sheet:i,rules:s,sheetHref:o}),r.push({sheet:i,rules:s,index:0})}catch(e){}};r.length>0;)i()}(a,e),!0}catch(e){return!1}}(e)||(r=!0),{advance(e){if(r)return!0;var n=Rn(),o=e>0?e:1;try{for(;!r&&o>0;){var u=t[t.length-1];if(u.rules.length>u.index){o-=1;try{s(u)}catch(e){a(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?da(h):h}else l=sa(u.parts.join(""))}catch(e){}a(l)}}}catch(e){r=!0,i=null}finally{ea(Rn()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var e=0;for(var i of t)e+=i.rules.length-i.index;return e}}}class ya{constructor(){ln(this,"idNodeMap",new Map),ln(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),na(e)){var r=In.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ba(e){var t=e.element,r=e.maskInputOptions,i=e.tagName,n=e.type,a=e.maskInputFn,o=e.value||"",s=n&&wa(n);return(r[i.toLowerCase()]||s&&r[s])&&(o=a?a(o,t):"*".repeat(o.length)),o}function wa(e){return e.toLowerCase()}var ka=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function _a(e){var t=e.element,r=e.name,i=e.value,n=e.maskAttributeFn,a=e.isGenerated;return i?e.maskAllElementAttributes?void 0!==a&&a&&ka.has(wa(r))?i:"*".repeat(i.length):n?n(r,i,t):i:i}var Sa="__rrweb_original__";function xa(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?wa(t):null}catch(e){return null}}var Ca=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ma=/^(?:[a-z+]+:)?\/\//i,Ta=/^www\..*/i,Ia=/^(data:)([^,]*),(.*)/i;function Ea(e,t){return(e||"").replace(Ca,((e,r,i,n,a,o)=>{var s,u=i||a||o,l=r||n||"";if(!u)return e;if(Ma.test(u)||Ta.test(u))return"url("+l+u+l+")";if(Ia.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var h=t.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var Ra,Aa,La="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",Oa=4096,Fa=1e5,Na=10,Da=new Map,Pa=1,qa=new RegExp("[^a-z0-9-_:]"),ja=-2;function Ba(){return Pa++}var Ha=/^[^ \t\n\r\u000c]+/,$a=/^[, \t\n\r\u000c]+/,Ua=new WeakMap;function Wa(e,t){return t&&""!==t.trim()?za(e,t):t}function za(e,t){var r=Ua.get(e);if(r||(r=e.createElement("a"),Ua.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Va(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?La:e}(e,t.maxBase64ImageLength):e}function Za(e,t,r,i,n,a){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&n){var s=null==(o=n.sheet)?void 0:o.href;if(s)return s}var u=Wa(e,i);if(u.startsWith("data:")){if("img"===t&&n){var l=u;return((null==a?void 0:a.type)||void 0!==(null==a?void 0:a.quality))&&(l=function(e,t,r,i){if(Fa>t.length)return t;if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>Oa||e.naturalHeight>Oa)return t;var n=Da.get(t);if(n&&n.type===r&&n.quality===i)return n.result;try{var a=document.createElement("canvas");a.width=e.naturalWidth,a.height=e.naturalHeight;var o=a.getContext("2d");if(!o)return t;o.drawImage(e,0,0);var s=a.toDataURL(r||"image/webp",null!=i?i:.4),u=t.length>s.length?s:t;if(Da.size>=Na){var l=Da.keys().next().value;void 0!==l&&Da.delete(l)}return Da.set(t,{type:r,quality:i,result:u}),u}catch(e){return t}}(n,u,a.type,a.quality)),Va(l,a)}if("image"===t)return Va(u,a)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Wa(e,i);return"image"===t&&h.startsWith("data:")?Va(h,a):h}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i($a),t.length>r;){var a=i(Ha);if(","===a.slice(-1))a=Wa(e,a.substring(0,a.length-1)),n.push(a);else{var o="";a=Wa(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){n.push((a+o).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,n.push((a+o).trim());break}"("===u&&(s=!0)}o+=u,r+=1}}}return n.join(", ")}(e,i):"style"===r?Ea(i,za(e)):"object"===t&&"data"===r?Wa(e,i):i:Wa(e,i)}function Qa(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Ga(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Ga(In.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&Ga(In.parentNode(e),t,r)}function Ya(e,t,r,i){var n;if(na(e)){if(!In.childNodes(n=e).length)return!1}else{if(null===In.parentElement(e))return!1;n=In.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(Ga(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function Ja(e,t,r){var i=e.removeEventListener;"function"==typeof i&&i.call(e,t,r)}var Ka=new Map;function Xa(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function eo(e){return null==e?"":e.toLowerCase()}var to=50,ro=!1,io=!1;function no(e,t){var r=t.doc,i=t.mirror,n=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,h=t.inlineStylesheet,c=void 0===h||h,d=t.maskInputOptions,v=void 0===d?{}:d,f=t.maskTextFn,p=t.maskInputFn,m=t.maskAllElementAttributes,g=void 0!==m&&m,y=t.maskAttributeFn,b=t.slimDOMOptions,w=t.dataURLOptions,k=void 0===w?{}:w,_=t.inlineImages,S=void 0!==_&&_,x=t.recordCanvas,C=void 0!==x&&x,M=t.canvasMaskingConfigured,T=t.onSerialize,I=t.onIframeLoad,E=t.iframeLoadTimeout,R=void 0===E?5e3:E,A=t.onIframeListenerRegistered,L=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,F=void 0===O?5e3:O,N=t.keepIframeSrcFn,D=void 0===N?()=>!1:N,P=t.newlyAddedElement,q=void 0!==P&&P,j=t.depth,B=void 0===j?0:j,H=t.maxDepth,U=void 0===H?to:H,W=t.needsMask,z=t.preserveWhiteSpace,V=void 0===z||z;if(B>=U)return io=!0,ro||(ro=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;W||(W=Ya(e,o,s,void 0===W)),Dn>0&&(jn.nodeCount+=1);var Z,Q=function(e,t){var r=t.doc,i=t.blockClass,n=t.blockSelector,a=t.needsMask,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskTextFn,h=t.maskInputFn,c=t.maskAllElementAttributes,d=void 0!==c&&c,v=t.maskAttributeFn,f=t.dataURLOptions,p=void 0===f?{}:f,m=t.inlineImages,g=t.recordCanvas,y=t.canvasMaskingConfigured,b=t.keepIframeSrcFn,w=t.newlyAddedElement,k=void 0!==w&&w,_=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:mn.Document,childNodes:[],compatMode:e.compatMode}:{type:mn.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:mn.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var r,i,n,a=t.doc,o=t.inlineStylesheet,s=t.maskInputOptions,u=void 0===s?{}:s,l=t.maskInputFn,h=t.maskAllElementAttributes,c=void 0!==h&&h,d=t.maskAttributeFn,v=t.dataURLOptions,f=void 0===v?{}:v,p=t.inlineImages,m=t.recordCanvas,g=t.canvasMaskingConfigured,y=t.keepIframeSrcFn,b=t.newlyAddedElement,w=void 0!==b&&b,k=t.rootId,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),S=function(e){if(e instanceof HTMLFormElement)return"form";var t=wa(e.tagName);return qa.test(t)?"div":t}(e),x=new Set,C={},M=e.attributes.length,T=0;M>T;T++){var I=e.attributes[T];Qa(S,I.name)||(C[I.name]=Za(a,S,wa(I.name),I.value,e,f))}if("link"===S&&o&&!_){var E=e.sheet;if(!E){var R=function(e){return e.href}(e);R&&!(E=Xa(a,R))&&R.includes(".css")&&(E=Xa(a,window.location.origin+"/"+R.replace(window.location.href,"")))}var A=null;E&&(ta(E)?Dn>0&&($n.push(e),Un+=1):A=ha(E)),A&&(delete C.rel,delete C.href,C._cssText=A)}if("style"===S&&e.sheet&&!(e.innerText||In.textContent(e)||"").trim().length){var L=Xn((()=>ha(e.sheet)));L&&(C._cssText=L)}if("input"===S||"textarea"===S||"select"===S){var O=e.value,F=e.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&O?C.value=ba({element:e,type:xa(e),tagName:S,value:O,maskInputOptions:u,maskInputFn:l}):F&&(C.checked=F)}if("option"===S&&(e.selected&&!u.select?C.selected=!0:delete C.selected),"dialog"===S&&e.open){try{C.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&m&&!(null==g?void 0:g()))if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((Sa in n?n[Sa]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(C.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){var N=e.toDataURL(f.type,f.quality),D=a.createElement("canvas");D.width=e.width,D.height=e.height,N!==D.toDataURL(f.type,f.quality)&&(C.rr_dataURL=N)}var P,q,j=!1;if("img"===S&&p){Ra||(Ra=a.createElement("canvas"),Aa=Ra.getContext("2d"));var B=e,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",U=B.crossOrigin,W=(t,r)=>j?_a({element:e,name:t,value:r,maskAllElementAttributes:c,maskAttributeFn:d}):r,z=()=>{Ja(B,"load",z);try{Ra.width=B.naturalWidth,Ra.height=B.naturalHeight,Aa.drawImage(B,0,0);var e=Ra.toDataURL(f.type,f.quality);C.rr_dataURL=W("rr_dataURL",e)}catch(e){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z));console.warn("Cannot inline img src="+H+"! Error: "+e)}"anonymous"===B.crossOrigin&&(U?C.crossOrigin=W("crossOrigin",U):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=e.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=e.currentTime,V.rr_mediaPlaybackRate=e.playbackRate,V.rr_mediaMuted=e.muted,V.rr_mediaLoop=e.loop,V.rr_mediaVolume=e.volume}if(w||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),_){var Z=e.getBoundingClientRect(),Q=Z.width,G=Z.height,Y=Z.left,J=Z.top,K=null==(r=a.defaultView)?void 0:r.getComputedStyle(e);C={class:C.class,rr_width:Q+"px",rr_height:G+"px",rr_left:Math.floor(Y+((null==(i=a.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(J+((null==(n=a.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),K&&(C.rr_position=K.position||"static",x.add("rr_position"),K.transform&&"none"!==K.transform&&(C.rr_transform=K.transform,x.add("rr_transform")),K.display&&K.display.startsWith("inline")&&(C.rr_display=K.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(e.contentDocument||(C.rr_src=C.src),delete C.src),c||d)for(var X of Object.entries(C)){var ee=X[0],te=X[1];"string"!=typeof te&&null!==te||(C[ee]=_a({element:e,name:ee,value:te,maskAllElementAttributes:c,maskAttributeFn:d,isGenerated:x.has(ee)}))}j=!0;try{customElements.get(S)&&(P=!0)}catch(e){}return{type:mn.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=e,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:_,rootId:k,isCustom:P}}(e,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:k,rootId:_});case e.TEXT_NODE:return function(e,t){var r,i=t.needsMask,n=t.maskTextFn,a=t.rootId,o=In.parentNode(e),s=o&&o.tagName,u=In.textContent(e),l="STYLE"===s||void 0,h="SCRIPT"===s||void 0;if(l&&u){try{if(e.nextSibling||e.previousSibling);else if(ta(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var c=ha(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(u=c)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}u=Ea(u,za(t.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,In.parentElement(e)):u.replace(/[\S]/g,"*")),{type:mn.Text,textContent:u||"",isStyle:l,rootId:a}}(e,{doc:r,needsMask:a,maskTextFn:l,rootId:_});case e.CDATA_SECTION_NODE:return{type:mn.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:mn.Comment,textContent:In.textContent(e)||"",rootId:_};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:y,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,keepIframeSrcFn:D,newlyAddedElement:q});if(!Q)return console.warn(e,"not serialized"),null;Z=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===mn.Comment)return!0;if(e.type===mn.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,i;try{i=new URL(e,window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(eo(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===eo(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(eo(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&eo(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(eo(e.attributes.property).match(/^(og|twitter|fb):/)||eo(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===eo(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(eo(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(eo(e.attributes.name))||eo(e.attributes.property).match(/^article:/)||eo(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(eo(e.attributes.name)))return!0}}return!1}(Q,b)||!V&&Q.type===mn.Text&&!Q.isStyle&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?ja:Ba();var G=Object.assign(Q,{id:Z});if(i.add(e,G),Z===ja)return null;T&&T(e);var Y=!l;if(G.type===mn.Element){Y=Y&&!G.needBlock,delete G.needBlock;var J=In.shadowRoot(e);J&&oa(J)&&(G.isShadowHost=!0)}if((G.type===mn.Document||G.type===mn.Element)&&Y){b.headWhitespace&&G.type===mn.Element&&"head"===G.tagName&&(V=!1);var K={doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B+1,maxDepth:U};if(G.type===mn.Element&&"textarea"===G.tagName&&void 0!==G.attributes.value);else for(var X of Array.from(In.childNodes(e))){var ee=no(X,K);ee&&G.childNodes.push(ee)}var te=null;if(na(e)&&(te=In.shadowRoot(e)))for(var re of Array.from(In.childNodes(te))){var ie=no(re,K);ie&&(oa(te)&&(ie.isShadow=!0),G.childNodes.push(ie))}}var ne=In.parentNode(e);if(ne&&aa(ne)&&oa(ne)&&(G.isShadow=!0),G.type===mn.Element&&"iframe"===G.tagName){var ae=function(e,t,r){var i,n=()=>{},a=e.contentWindow;if(!a)return n;try{i=a.document.readyState}catch(e){return n}var o=()=>t();if("complete"!==i){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),Ja(e,"load",h),e.addEventListener("load",o),t())},h=()=>l();return u=setTimeout(l,r),e.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),s?Ja(e,"load",o):(s=!0,Ja(e,"load",h))}}var c,d="about:blank";try{c=a.location.href}catch(e){return n}if(c!==d||e.src===d||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),Ja(e,"load",o)}}return e.addEventListener("load",o),()=>{Ja(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&I){var r=no(t,{doc:t,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B+1,maxDepth:U});r&&I(e,r)}}),R);null==A||A(e,ae)}return G.type===mn.Element&&"link"===G.tagName&&"stylesheet"===G.attributes.rel&&function(t,u,l){if(!Ka.has(t)){var h;try{h=t.sheet}catch(e){return}if(!h){var d=new AbortController,m=!1,w=()=>{if(!m){m=!0;try{(()=>{if(L){var t=no(e,{doc:r,mirror:i,blockClass:n,blockSelector:a,needsMask:W,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:g,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:k,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:M,preserveWhiteSpace:V,onSerialize:T,onIframeLoad:I,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:D,depth:B,maxDepth:U});t&&L(e,t)}})()}finally{Ka.delete(t),d.abort()}}},_=setTimeout(w,l);d.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),t.addEventListener("load",w,{signal:d.signal,once:!0}),Ka.set(t,d)}}}(e,0,F),G}function ao(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class oo{constructor(){ln(this,"parentElement",null),ln(this,"parentNode",null),ln(this,"ownerDocument"),ln(this,"firstChild",null),ln(this,"lastChild",null),ln(this,"previousSibling",null),ln(this,"nextSibling",null),ln(this,"ELEMENT_NODE",1),ln(this,"TEXT_NODE",3),ln(this,"nodeType"),ln(this,"nodeName"),ln(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof oo))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function so(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>uo(r,e,t,i)}function uo(e,t,r,i){lo((()=>{var n=e.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(e,t,r,i):n.call(e,t,r))}))}function lo(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var ho="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",co={map:{},getId(){return console.error(ho),-1},getNode(){return console.error(ho),null},removeNodeFromMap(){console.error(ho)},has(){return console.error(ho),!1},reset(){console.error(ho)}};function vo(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var a=arguments.length,o=new Array(a),s=0;a>s;s++)o[s]=arguments[s];var u=Date.now();n||!1!==r.leading||(n=u);var l=t-(u-n),h=this;0>=l||l>t?(i&&(clearTimeout(i),i=null),n=u,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),l))}}function fo(e,t,r,i,n){void 0===n&&(n=window);var a=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),a&&a.set){if(a.get)try{a.get.call(this)}catch(e){return}a.set.call(this,e)}}}),()=>fo(e,t,a||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(co=new Proxy(co,{get(e,t,r){return"map"===t&&console.error(ho),Reflect.get(e,t,r)}}));var po=Date.now;function mo(e){var t,r,i,n,a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:a.documentElement.scrollLeft||(null==a?void 0:a.body)&&(null==(t=In.parentElement(a.body))?void 0:t.scrollLeft)||(null==(r=null==a?void 0:a.body)?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null==a?void 0:a.body)&&(null==(i=In.parentElement(a.body))?void 0:i.scrollTop)||(null==(n=null==a?void 0:a.body)?void 0:n.scrollTop)||0}}function go(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function yo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function bo(e){return e?e.nodeType===e.ELEMENT_NODE?e:In.parentElement(e):null}function wo(e,t,r,i){if(!e)return!1;var n=bo(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(Ga(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function ko(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===ja}function _o(e,t){if(aa(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=In.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||_o(i,t))}function So(e){return Boolean(e.changedTouches)}function xo(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Co(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Mo(e){return!!e&&(e instanceof oo&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(In.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(po=()=>(new Date).getTime());class To{constructor(){ln(this,"id",1),ln(this,"styleIDMap",new WeakMap),ln(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Io(e){var t,r=null;return"getRootNode"in e&&(null==(t=In.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&In.host(In.getRootNode(e))&&(r=In.host(In.getRootNode(e))),r}function Eo(e){var t=e.ownerDocument;return!!t&&(In.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Io(r);)r=t;return r}(e);return In.contains(t,r)}(e))}function Ro(e){return"__ln"in e}class Ao{constructor(){ln(this,"length",0),ln(this,"head",null),ln(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ro(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ro(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Lo,Oo=(e,t)=>e+"@"+t;class Fo{constructor(){ln(this,"frozen",!1),ln(this,"locked",!1),ln(this,"texts",[]),ln(this,"attributes",[]),ln(this,"attributeMap",new WeakMap),ln(this,"generatedAttributes",new WeakMap),ln(this,"removes",[]),ln(this,"mapRemoves",[]),ln(this,"movedMap",{}),ln(this,"addedSet",new Set),ln(this,"movedSet",new Set),ln(this,"droppedSet",new Set),ln(this,"removesSubTreeCache",new Set),ln(this,"mutationCb"),ln(this,"blockClass"),ln(this,"blockSelector"),ln(this,"maskTextClass"),ln(this,"maskTextSelector"),ln(this,"inlineStylesheet"),ln(this,"maskInputOptions"),ln(this,"maskTextFn"),ln(this,"maskInputFn"),ln(this,"maskAllElementAttributes"),ln(this,"maskAttributeFn"),ln(this,"keepIframeSrcFn"),ln(this,"recordCanvas"),ln(this,"canvasMaskingConfigured"),ln(this,"inlineImages"),ln(this,"slimDOMOptions"),ln(this,"dataURLOptions"),ln(this,"doc"),ln(this,"mirror"),ln(this,"iframeManager"),ln(this,"stylesheetManager"),ln(this,"shadowDomManager"),ln(this,"canvasManager"),ln(this,"processedNodeManager"),ln(this,"unattachedDoc"),ln(this,"canvasManagerReleased",!1),ln(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),ln(this,"emit",(()=>{if(!this.frozen&&!this.locked){var e,t,r=Rn(),i=Fn();try{this.processBufferedMutations()}finally{e=Rn()-r,t=i,Dn>0||Nn(e,null!=t?t:An)||e>zn.slowestBatchMs&&(zn.slowestBatchMs=e)}}})),ln(this,"processBufferedMutations",(()=>{for(var e=[],t=new Set,r=new Ao,i=e=>{for(var t=e,r=ja;r===ja;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var a=In.parentNode(n);if(a&&Eo(n)&&"TEXTAREA"!==a.tagName){var o=aa(a)?this.mirror.getId(Io(n)):this.mirror.getId(a),s=i(n);if(-1===o||-1===s)return r.addNode(n);var u=no(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:e=>{xo(e,this.mirror)&&this.iframeManager.addIframe(e),Co(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Mo(e)&&!wo(e,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(In.shadowRoot(e),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});u&&(e.push({parentId:o,nextId:s,node:u}),t.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var a of this.movedSet)Do(this.removesSubTreeCache,a)&&!this.movedSet.has(In.parentNode(a))||n(a);for(var o of this.addedSet)Po(this.droppedSet,o)||Do(this.removesSubTreeCache,o)?Po(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(In.parentNode(s.value)),h=i(s.value);-1!==l&&-1!==h&&(u=s)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(In.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=In.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=In.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}s=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=In.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t,r=e.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof r.style){var i=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.style.length>i.length&&(i+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var a of Object.entries(r)){var o=a[0],s=a[1];"string"!=typeof s&&null!==s||(r[o]=_a({element:e.node,name:o,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(t=this.generatedAttributes.get(e.node))?void 0:t.has(o)}))}return{id:this.mirror.getId(e.node),attributes:r}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(m))})),ln(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),ln(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(In.childNodes(e),(e=>In.textContent(e)||"")).join("");t.attributes.value=ba({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:xa(e),value:r,maskInputFn:this.maskInputFn})})),ln(this,"processMutation",(e=>{var t;if(!ko(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var r=In.textContent(e.target);wo(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue||this.texts.push({value:Ya(e.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,bo(e.target)):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var i,n=e.target,a=e.attributeName,o=null!==(i=e.attributeNamespace)&&void 0!==i?i:null,s=function(e,t,r){if(!r)return t;var i=e.getAttributeNodeNS(r,t);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+t;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+t;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===t?t:"xmlns:"+t;var n=e.lookupPrefix(r);return n?n+":"+t:t}(n,a,o),u=o?n.getAttributeNS(o,a):e.target.getAttribute(a);if("value"===s){var l=n,h=xa(l);u=ba({element:l,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:u,maskInputFn:this.maskInputFn})}if(wo(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;var c=this.attributeMap.get(e.target),d="IFRAME"===n.tagName&&"src"===s;if(d&&!this.keepIframeSrcFn(u)&&n.contentDocument)return;if(c||(this.attributes.push(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,c)),"type"===s&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Qa(n.tagName,s)){var v=Za(this.doc,wa(n.tagName),wa(s),u,n,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(u)&&(s="rr_src"),c.attributes[s]=v,null==(t=this.generatedAttributes.get(e.target))||t.delete(s),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var m of(e.oldValue&&(f.style.cssText=e.oldValue),Array.from(p))){var g=p.getPropertyValue(m),y=p.getPropertyPriority(m);g!==f.style.getPropertyValue(m)||y!==f.style.getPropertyPriority(m)?c.styleDiff[m]=""===y?g:[g,y]:c._unchangedStyles[m]=[g,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(c.styleDiff[b]=!1)}else if("open"===s&&"DIALOG"===n.tagName){c.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(e.target);w||this.generatedAttributes.set(e.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(wo(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=aa(e.target)?this.mirror.getId(In.host(e.target)):this.mirror.getId(e.target);wo(e.target,this.blockClass,this.blockSelector,!1)||ko(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(No(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||_o(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Oo(r,i)]?No(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!aa(e.target)||!oa(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),In.childNodes(i).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),ln(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ko(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Oo(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);wo(e,this.blockClass,this.blockSelector,!1)||(In.childNodes(e).forEach((e=>this.genAdds(e))),Mo(e)&&In.childNodes(In.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function No(e,t){for(var r=[t];r.length;){var i=r.pop();e.delete(i),In.childNodes(i).forEach((e=>r.push(e)))}}function Do(e,t,r){return 0!==e.size&&function(e,t,r){var i=In.parentNode(t);return!!i&&e.has(i)}(e,t)}function Po(e,t){if(0===e.size)return!1;for(var r=In.parentNode(t);r;){if(e.has(r))return!0;r=In.parentNode(r)}return!1}var qo=function(e,t){return void 0===t&&(t="rrweb"),Lo?function(){try{return e(...arguments)}catch(e){if(Lo&&!0===Lo(e,t))return;throw e}}:e},jo=[];function Bo(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Ho(e,t){var r,i=new Fo;i.init(e);try{r=new(Mn())(qo(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(n.attributeFilter=e.attributeFilter),r.observe(t,n),jo.push(i),{observer:r,buffer:i}}catch(e){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(e){}throw e}}function $o(e){var t=e.scrollCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.sampling,s=new Map,u=e=>{var o=Bo(e);if(o&&!wo(o,n,a,!0)){var u,l,h=i.getId(o);if(o===r&&r.defaultView){var c=mo(r.defaultView);u=c.left,l=c.top}else u=o.scrollLeft,l=o.scrollTop;var d=u+","+l;s.get(h)!==d&&(s.set(h,d),t({id:h,x:u,y:l}))}},l=[so("scroll",qo(vo(qo((e=>u(e))),o.scroll||100)),r)];return"onscrollend"in r&&l.push(so("scrollend",qo(u),r)),()=>l.forEach((e=>e()))}function Uo(e,t){for(var r=jo.length-1;r>=0;r--){var i=jo[r];if(i){var n=i.bufferBelongsToIframe(e);!n&&t&&t.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),jo.splice(r,1))}}}var Wo=["INPUT","TEXTAREA","SELECT"],zo=new WeakMap;function Vo(e){return function e(t,r){if(Jo("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Jo("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Jo("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Jo("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function Zo(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}var Qo=5e3;function Go(e,t){var r,i,n,a,o=e.stylesheetManager;a=e.mirror.getId("#document"===t.nodeName?t:In.host(t));var s="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=u.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),qo((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Yo(e,t){void 0===t&&(t={});var r,i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var r=e.mutationCb,i=e.mousemoveCb,n=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,l=e.styleSheetRuleCb,h=e.styleDeclarationCb,c=e.canvasMutationCb,d=e.fontCb,v=e.selectionCb,f=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),a(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),s(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),u(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),l(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),c(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t);var a,o,s,u,l,c,d,v,f=[],p=qo((()=>{if(i){i.destroy(),i.reset();var t=jo.indexOf(i);-1!==t&&jo.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==r||r.disconnect(),f.forEach((e=>e()))}));try{if(e.recordDOM){var m=Ho(e,e.doc);r=m.observer,i=m.buffer}if(f.push(function(e){var t=e.mousemoveCb,r=e.sampling,i=e.doc,n=e.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=vo(qo((e=>{var r=Date.now()-a;t(u.map((e=>(e.timeOffset-=r,e))),e),u=[],a=null})),s),h=qo(vo(qo((e=>{var t=Bo(e),r=So(e)?e.changedTouches[0]:e,i=r.clientX,o=r.clientY;a||(a=po()),u.push({x:i,y:o,id:n.getId(t),timeOffset:po()-a}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?cn.Drag:e instanceof MouseEvent?cn.MouseMove:cn.TouchMove)})),o,{trailing:!1})),c=[so("mousemove",h,i),so("touchmove",h,i),so("drag",h,i)];return qo((()=>{c.forEach((e=>e()))}))}(e)),f.push(function(e){var t=e.mouseInteractionCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.sampling;if(!1===o.mouseInteraction)return()=>{};var s=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,u=[],l=null;return Object.keys(dn).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((e=>{var o=wa(e),s=(e=>r=>{var o=Bo(r);if(!wo(o,n,a,!0)){var s=null,u=e;if("pointerType"in r){switch(r.pointerType){case"mouse":s=vn.Mouse;break;case"touch":s=vn.Touch;break;case"pen":s=vn.Pen}s===vn.Touch&&(dn[e]===dn.MouseDown?u="TouchStart":dn[e]===dn.MouseUp&&(u="TouchEnd"))}else So(r)&&(s=vn.Touch);null!==s?(l=s,(u.startsWith("Touch")&&s===vn.Touch||u.startsWith("Mouse")&&s===vn.Mouse)&&(s=null)):dn[e]===dn.Click&&(s=l,l=null);var c=So(r)?r.changedTouches[0]:r;if(c){var d=i.getId(o),v=c.clientX,f=c.clientY;qo(t)(h({type:dn[u],id:d,x:v,y:f},null!==s&&{pointerType:s}))}}})(e);if(window.PointerEvent)switch(dn[e]){case dn.MouseDown:case dn.MouseUp:o=o.replace("mouse","pointer");break;case dn.TouchStart:case dn.TouchEnd:return}u.push(so(o,s,r))})),qo((()=>{u.forEach((e=>e()))}))}(e)),f.push($o(e)),f.push(function(e,t){var r=e.viewportResizeCb,i=t.win,n=-1,a=-1;return so("resize",qo(vo(qo((()=>{var e=go(),t=yo();n===e&&a===t||(r({width:Number(t),height:Number(e)}),n=e,a=t)})),200)),i)}(e,{win:n})),f.push(function(e){var t=e.inputCb,r=e.doc,i=e.mirror,n=e.blockClass,a=e.blockSelector,o=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,l=e.maskInputFn,c=e.userTriggeredOnInput;function d(e){var t=Bo(e),i=e.isTrusted,h=r.defaultView;if(!t||!h||t instanceof h.HTMLElement){var d=t&&t.tagName;if(t&&"OPTION"===d&&(t=In.parentElement(t)),t&&d&&Wo.indexOf(d)>=0&&!wo(t,n,a,!0)&&!(t.classList.contains(o)||s&&t.matches(s))){var f=t.value,p=!1,m=xa(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(u[d.toLowerCase()]||u[m])&&(f=ba({element:t,maskInputOptions:u,tagName:d,type:m,value:f,maskInputFn:l})),v(t,c?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var g=t.name;"radio"===m&&g&&p&&r.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,c?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(e,r){var n=zo.get(e);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){zo.set(e,r);var a=i.getId(e);qo(t)(h({},r,{id:a}))}}var f=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>so(e,qo(d),r))),p=r.defaultView;if(!p)return()=>{f.forEach((e=>e()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>fo(e[0],e[1],{set(){qo(d)({target:this,isTrusted:!1})}},!1,p)))),qo((()=>{f.forEach((e=>e()))}))}(e)),f.push(function(e){var t=e.mediaInteractionCb,r=e.blockClass,i=e.blockSelector,n=e.mirror,a=e.sampling,o=e.doc,s=qo((e=>vo(qo((a=>{var o=Bo(a);if(o&&!wo(o,r,i,!0)){var s=o.currentTime,u=o.volume,l=o.muted,h=o.playbackRate,c=o.loop;t({type:e,id:n.getId(o),currentTime:s,volume:u,muted:l,playbackRate:h,loop:c})}})),a.media||500))),u=[so("play",s(pn.Play),o),so("pause",s(pn.Pause),o),so("seeked",s(pn.Seeked),o),so("volumechange",s(pn.VolumeChange),o),so("ratechange",s(pn.RateChange),o)];return qo((()=>{u.forEach((e=>e()))}))}(e)),e.recordDOM){var g=function(e){var t=new Map,r=new Set,i=!0,n=e=>{if(i)try{e()}catch(e){}},a=e=>{var r,i=t.get(e);if(i){for(;null==(r=i[0])?void 0:r.ready;){var a=i.shift();(null==a?void 0:a.emit)&&n(a.emit)}0===i.length&&t.delete(e)}};return{queueMutation(e,r){if(e){var i=t.get(e);i?(i.push({emit:r,ready:!0}),a(e)):n(r)}else n(r)},queuePendingMutation(o,s,u){if(!i)return()=>{};var l=t.get(o);l||t.set(o,l=[]);var h={emit:s,ready:!1};l.push(h);var c,d=!1,v=!1,f=()=>{d||v||(d=!0,void 0!==c&&r.delete(c),h.ready=!0,h.emit=void 0,a(o))};try{c=e.setTimeout(f,Qo),d||v?e.clearTimeout(c):r.add(c)}catch(e){f()}return t=>{!v&&i&&(v=!0,void 0!==c&&(e.clearTimeout(c),r.delete(c)),d?t&&n(u):(h.ready=!0,t||(h.emit=void 0),a(o)))}},reset(){i=!1,r.forEach((t=>e.clearTimeout(t))),r.clear(),t.clear()}}}(n);f.push(g.reset),f.push(function(e,t){var r=e.styleSheetRuleCb,i=e.mirror,n=e.stylesheetManager,a=t.win,o=t.mutationQueue;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};var s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=Zo(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,adds:[{rule:s,index:u}]}))),u}),"host")}),a.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),a.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var u,l,h=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=Zo(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,removes:[{index:s}]}))),u}),"host")}),a.CSSStyleSheet.prototype.removeRule=function(e){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(u=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);try{var l=null==u?void 0:u.then;if(t.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(t);var h=Zo(t,i,n.styleMirror),c=h.id,d=h.styleId;if(!(c&&-1!==c||d&&-1!==d))return u;var v=o.queuePendingMutation(t,(()=>r({id:c,styleId:d,replace:s})),(()=>{var e=ha(t);null!==e&&r({id:c,styleId:d,replace:e})}));try{l.call(u,(()=>v(!0)),(()=>v(!1)))}catch(e){v(!1)}}catch(e){}return u}),"host")})),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t);var l=Zo(t,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&o.queueMutation(t,(()=>r({id:h,styleId:c,replaceSync:s}))),u}),"host")}));var c={};Ko("CSSGroupingRule")?c.CSSGroupingRule=a.CSSGroupingRule:(Ko("CSSMediaRule")&&(c.CSSMediaRule=a.CSSMediaRule),Ko("CSSConditionRule")&&(c.CSSConditionRule=a.CSSConditionRule),Ko("CSSSupportsRule")&&(c.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var t=e[0],a=e[1];d[t]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[t].insertRule,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t.parentStyleSheet);var l=Zo(t.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(t.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...Vo(t),u];o.queueMutation(t.parentStyleSheet,(()=>r({id:h,styleId:c,adds:[{rule:s,index:d}]})))}return u}),"host")}),a.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:qo(((e,t,a)=>{var s=a[0],u=e.apply(t,a);n.onCssomSheetMutation(t.parentStyleSheet);var l=Zo(t.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(t.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...Vo(t),s];o.queueMutation(t.parentStyleSheet,(()=>r({id:h,styleId:c,removes:[{index:d}]})))}return u}),"host")})})),qo((()=>{a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=h,u&&(a.CSSStyleSheet.prototype.replace=u),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n,mutationQueue:g})),f.push(Go(e,e.doc)),f.push(function(e,t){var r=e.styleDeclarationCb,i=e.mirror,n=e.ignoreCSSAttributes,a=e.stylesheetManager,o=t.win,s=t.mutationQueue,u=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:qo(((e,t,o)=>{var u,l=o[0],h=o[1],c=o[2],d=e.apply(t,o);if(n.has(l))return d;var v=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(v);var f=Zo(v,i,a.styleMirror),p=f.id,m=f.styleId;if(p&&-1!==p||m&&-1!==m){var g=Vo(t.parentRule);s.queueMutation(v,(()=>r({id:p,styleId:m,set:{property:l,value:h,priority:c},index:g})))}return d}),"host")});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:qo(((e,t,o)=>{var u,l=o[0],h=e.apply(t,o);if(n.has(l))return h;var c=null==(u=t.parentRule)?void 0:u.parentStyleSheet;a.onCssomSheetMutation(c);var d=Zo(c,i,a.styleMirror),v=d.id,f=d.styleId;if(v&&-1!==v||f&&-1!==f){var p=Vo(t.parentRule);s.queueMutation(c,(()=>r({id:v,styleId:f,remove:{property:l},index:p})))}return h}),"host")}),qo((()=>{o.CSSStyleDeclaration.prototype.setProperty=u,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n,mutationQueue:g})),e.collectFonts&&f.push(function(e){var t=e.fontCb,r=e.doc,i=r.defaultView;if(!i)return()=>{};var n=[],a=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return a.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var s=Tn(r.fonts,"add",(function(e){return function(r){return setTimeout(qo((()=>{var e=a.get(r);e&&(t(e),a.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(s),qo((()=>{n.forEach((e=>e()))}))}(e))}for(var y of(f.push((o=(a=e).doc,s=a.mirror,u=a.blockClass,l=a.blockSelector,c=a.selectionCb,d=!0,(v=qo((()=>{var e=o.getSelection();if(!(!e||d&&(null==e?void 0:e.isCollapsed))){d=e.isCollapsed||!1;for(var t=[],r=e.rangeCount||0,i=0;r>i;i++){var n=e.getRangeAt(i),a=n.startContainer,h=n.startOffset,v=n.endContainer,f=n.endOffset;wo(a,u,l,!0)||wo(v,u,l,!0)||t.push({start:s.getId(a),startOffset:h,end:s.getId(v),endOffset:f})}c({ranges:t})}})))(),so("selectionchange",v))),f.push(function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?Tn(r.customElements,"define",(function(e){return function(r,i,n){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,i,n])}})):()=>{}}(e)),e.plugins))f.push(y.observer(y.callback,n,y.options))}catch(e){try{p()}catch(e){}throw e}return p}function Jo(e){return void 0!==window[e]}function Ko(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Xo{constructor(e){ln(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ln(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){if(0>t)return t;var n=r||this.getRemoteIdToLocalIdMap(e),a=i||this.getLocalIdToRemoteIdMap(e),o=n.get(t);return void 0===o&&(o=this.generateIdFn(),n.set(t,o),a.set(o,t)),o}getIds(e,t){var r=this.getRemoteIdToLocalIdMap(e),i=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i;return"number"!=typeof t||0>t?t:null!==(i=(r||this.getLocalIdToRemoteIdMap(e)).get(t))&&void 0!==i?i:-1}getRemoteIds(e,t){var r=this.getLocalIdToRemoteIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(e),this.iframeLocalIdToRemoteIdMap.delete(e)}getRemoteIdToLocalIdMap(e){var t=this.iframeRemoteIdToLocalIdMap.get(e);return t||this.iframeRemoteIdToLocalIdMap.set(e,t=new Map),t}getLocalIdToRemoteIdMap(e){var t=this.iframeLocalIdToRemoteIdMap.get(e);return t||this.iframeLocalIdToRemoteIdMap.set(e,t=new Map),t}}class es{constructor(e){ln(this,"iframes",new WeakMap),ln(this,"crossOriginIframeMap",new WeakMap),ln(this,"crossOriginIframeMirror",new Xo(Ba)),ln(this,"crossOriginIframeStyleMirror"),ln(this,"crossOriginIframeRootIdMap",new WeakMap),ln(this,"mirror"),ln(this,"mutationCb"),ln(this,"wrappedEmit"),ln(this,"loadListener"),ln(this,"pageHideListener"),ln(this,"stylesheetManager"),ln(this,"recordCrossOriginIframes"),ln(this,"messageHandler"),ln(this,"nestedIframeListeners",new Map),ln(this,"attachedWindows",new WeakMap),ln(this,"attachedDocuments",new WeakMap),ln(this,"attachedIframes",new Map),ln(this,"loadListenerDisposers",new WeakMap),ln(this,"iframeElementsById",new Map),ln(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!==(t=null!==(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>lo(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{uo(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var n=this.attachedDocuments.get(e);n||this.attachedDocuments.set(e,n=new Set),n.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var a=e.contentWindow;if(this.recordCrossOriginIframes&&a&&!this.nestedIframeListeners.has(a)){var o=this.handleMessage.bind(this);lo((()=>{a.addEventListener("message",o),this.nestedIframeListeners.set(a,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(a)}))}lo((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var i of r)if(i.win===t)return;var n=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",n),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:n})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case hn.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:hn.IncrementalSnapshot,data:{source:cn.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case hn.Meta:case hn.Load:case hn.DomContentLoaded:return!1;case hn.Plugin:return t;case hn.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case hn.IncrementalSnapshot:switch(t.data.source){case cn.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case cn.Drag:case cn.TouchMove:case cn.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case cn.ViewportResize:return!1;case cn.MediaInteraction:case cn.MouseInteraction:case cn.Scroll:case cn.CanvasMutation:case cn.Input:return this.replaceIds(t.data,e,["id"]),t;case cn.StyleSheetRule:case cn.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case cn.Font:return t;case cn.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case cn.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===mn.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(uo(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(uo(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var a=this.attachedDocuments.get(r);a&&(a.forEach((e=>{lo((()=>this.mirror.removeNodeFromMap(e)))})),lo((()=>Uo(r,a))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&uo(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{uo(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class ts{constructor(e){ln(this,"shadowDoms",new WeakSet),ln(this,"mutationCb"),ln(this,"scrollCb"),ln(this,"bypassOptions"),ln(this,"mirror"),ln(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var r,i;if(oa(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=null!==(r=null==(i=In.host(e))?void 0:i.ownerDocument)&&void 0!==r?r:t,a=Ho(h({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),o=a.observer,s=a.buffer;this.restoreHandlers.push({doc:n,handler(){o.disconnect(),s.destroy(),s.releaseCanvasManager();var e=jo.indexOf(s);-1!==e&&jo.splice(e,1)}}),this.restoreHandlers.push({doc:n,handler:$o(h({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(In.host(e))),this.restoreHandlers.push({doc:n,handler:Go({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)})}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push({doc:t,handler:Tn(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),a=In.shadowRoot(this);return a&&Eo(this)&&r.addShadowRoot(a,t),n}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}var rs="skip-frame";function is(e){if("object"!=typeof e||null===e)return!1;var t=e.y,r=e.width,i=e.height;return Number.isFinite(e.x)&&Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",as="undefined"==typeof Uint8Array?[]:new Uint8Array(256),os=0;64>os;os++)as[ns.charCodeAt(os)]=os;var ss=new Map,us=(e,t,r)=>{if(e&&(cs(e,t)||"object"==typeof e)){var i=function(e,t){var r=ss.get(e);return r||ss.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function ls(e,t,r,i){if(e instanceof Array)return e.map((e=>ls(e,t,r,i)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var n=e.constructor.name,a=function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;i>t;t+=3)n+=ns[r[t]>>2],n+=ns[(3&r[t])<<4|r[t+1]>>4],n+=ns[(15&r[t+1])<<2|r[t+2]>>6],n+=ns[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e);return{rr_type:n,base64:a}}return e instanceof DataView?{rr_type:e.constructor.name,args:[ls(e.buffer,t,r,i),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(i.type,i.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[ls(e.data,t,r,i),e.width,e.height]}:cs(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:us(e,t,r)}:e}var hs=(e,t,r,i)=>e.map((e=>ls(e,t,r,i))),cs=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},ds=["webgl","webgl2"];function vs(e){return"nodeType"in e}function fs(e,t,r,i){var n=[];try{if(i){var a=function(e,t,r){var i=e.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return Tn(i.prototype,"configure",(function(i){return function(n){var a=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!a||vs(a)&&wo(a,t,r,!0))return i.call(this,n);vs(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return i.call(this,null!==o&&n?h({},n,{usage:"number"==typeof n.usage?n.usage|o:o}):n)}}))}(e,t,r);a&&n.push(a)}var o=Tn(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var a=function(e){return"experimental-webgl"===e?"webgl":e}(n),o=arguments.length,s=new Array(o>1?o-1:0),u=1;o>u;u++)s[u-1]=arguments[u];if(!wo(this,t,r,!0)&&("__context"in this||(this.__context=a),i&&ds.includes(a)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[n,...s])}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function ps(e,t,r,i,n,a,o){var s=[],u=Object.getOwnPropertyNames(e),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof e[u])return 0;var l=Tn(e,u,(function(e){return function(){for(var s=arguments.length,l=new Array(s),h=0;s>h;h++)l[h]=arguments[h];var c=e.apply(this,l);if(us(c,a,this),this.canvas&&"tagName"in this.canvas&&!wo(this.canvas,i,n,!0)){var d=hs(l,a,this,o);r(this.canvas,{type:t,property:u,args:d})}return c}}));s.push(l)}catch(a){var h=fo(e,u,{set(e){this.canvas&&"tagName"in this.canvas&&!wo(this.canvas,i,n,!0)&&r(this.canvas,{type:t,property:u,args:[e],setter:!0})}});s.push(h)}};for(var h of u)l(h);return s}var ms,gs,ys,bs='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',ws="undefined"!=typeof self&&self.Blob&&new Blob([bs],{type:"text/javascript;charset=utf-8"});function ks(e){var t;try{if(!(t=ws&&(self.URL||self.webkitURL).createObjectURL(ws)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(bs),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class _s{constructor(e){ln(this,"pendingCanvasMutations",new Map),ln(this,"rafStamps",{latestId:0,invokeId:null}),ln(this,"mirror"),ln(this,"mutationCb"),ln(this,"resetObservers"),ln(this,"frozen",!1),ln(this,"locked",!1),ln(this,"rafIdTimestamp",null),ln(this,"rafIdFlush",null),ln(this,"refCount",0),ln(this,"torndown",!1),ln(this,"resetFrameDedup",null),ln(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,i=e.win,n=e.blockClass,a=e.blockSelector,o=e.recordCanvas,s=e.dataURLOptions,u=e.resolutionScale,l=e.canvasMasking;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,a,s),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,a,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}onFullSnapshot(){var e;null==(e=this.resetFrameDedup)||e.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){var a=this;if("OffscreenCanvas"in t){var o,s="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=fs(t,r,i,!0),h=new Map;try{o=new ks}catch(e){return}var c=!1;o.onerror=()=>{var e;c=!0,cancelAnimationFrame(d),null==(e=o.terminate)||e.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=e=>{var t=e.data.id;if(h.set(t,!1),"base64"in e.data){var r=e.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:t,type:fn["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var d,v=1e3/e,f=0,p=e=>{var u,m;c||(f&&v>e-f||(f=e,(u=[],m=e=>{try{e.querySelectorAll("canvas").forEach((e=>{wo(e,r,i,!0)||u.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&m(e.shadowRoot)}))}catch(e){}},m(t.document),u).forEach(function(){var e=l((function*(e){var t,r,i=a.mirror.getId(e);if(!h.get(i)&&0!==e.width&&0!==e.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var u=e.getContext(e.__context);if(null==(t=null==u?void 0:u.isContextLost)?void 0:t.call(u))return void h.set(i,!1);!1===(null==(r=null==u?void 0:u.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&u.clear(u.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,c=e.clientHeight||e.height,d=Math.max(1,Math.round(l*s)),v=Math.max(1,Math.round(c*s)),f=function(e,t,r,i,n,a){if(e&&"function"==typeof e.regionsFn){var o;try{o=e.regionsFn(t)}catch(e){return rs}if(void 0!==o){if(!Array.isArray(o)||!o.every(is))return rs;var s=r/n,u=i/a;return o.filter((e=>e.width>0&&e.height>0)).map((e=>{var t=Math.floor(e.x*s),r=Math.floor(e.y*u);return{x:t,y:r,width:Math.ceil((e.x+e.width)*s)-t,height:Math.ceil((e.y+e.height)*u)-r}}))}}}(n.canvasMasking,e,d,v,l,c);if(f===rs)return void h.set(i,!1);var p=yield createImageBitmap(e,1>s?{resizeWidth:d,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:v});o.postMessage({id:i,bitmap:p,width:d,height:v,displayWidth:l,displayHeight:c,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(e){h.set(i,!1)}}}));return function(t){return e.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var e;u(),cancelAnimationFrame(d),null==(e=o.terminate)||e.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=fs(e,t,r,!1),a=function(e,t,r,i,n){var a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var s=Tn(t.CanvasRenderingContext2D.prototype,o,(function(a){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return wo(this.canvas,r,i,!0)||setTimeout((()=>{var r=hs(u,t,this,n);e(this.canvas,{type:fn["2D"],property:o,args:r})}),0),a.apply(this,u)}}));a.push(s)}catch(n){var u=fo(t.CanvasRenderingContext2D.prototype,o,{set(t){wo(this.canvas,r,i,!0)||e(this.canvas,{type:fn["2D"],property:o,args:[t],setter:!0})}});a.push(u)}};for(var u of o)s(u);return()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i),o=function(e,t,r,i,n){var a=[];return void 0!==t.WebGLRenderingContext&&a.push(...ps(t.WebGLRenderingContext.prototype,fn.WebGL,e,r,i,t,n)),void 0!==t.WebGL2RenderingContext&&a.push(...ps(t.WebGL2RenderingContext.prototype,fn.WebGL2,e,r,i,t,n)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i);this.resetObservers=()=>{n(),a(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var i=r.map((e=>{var t=function(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}(e,sn);return t}));this.mutationCb({id:t,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(e)}}}}class Ss{constructor(e){var t;ln(this,"trackedLinkElements",new WeakSet),ln(this,"pendingDeferredSheets",new Set),ln(this,"mutationCb"),ln(this,"adoptedStyleSheetCb"),ln(this,"maskAllElementAttributes"),ln(this,"maskAttributeFn"),ln(this,"styleMirror",new To),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(t=e.maskAllElementAttributes)&&void 0!==t&&t,this.maskAttributeFn=e.maskAttributeFn}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}beginDeferredLinkInlining(e,t){if(-1===t||!e.isConnected)return null;var r=null,i=null;try{(i=e.sheet)&&(r=ga(i))}catch(e){}if(!r||!i)return ra(),null;var n=r,a=!1,o={sheet:i,invalidate(){a=!0}};this.pendingDeferredSheets.add(o);var s=!1;return{advance:r=>{if(s)return!0;var u,l,h=Rn(),c=Fn(),d=!0;try{if(a)return s=!0,ra(),!0;if(!n.advance(r))return d=!1,!1;s=!0;var v=n.text();if(!e.isConnected)return!0;var f=null;try{f=e.sheet}catch(e){}return f!==i?(ra(),!0):v?(this.emitCssTextMutation(e,t,v),!0):(ra(),!0)}finally{d&&this.pendingDeferredSheets.delete(o),Nn(u=Rn()-h,null!=(l=c)?l:An)||(Vn.totalMs+=u,u>Vn.slowestSliceMs&&(Vn.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(e){if(e&&0!==this.pendingDeferredSheets.size)for(var t of this.pendingDeferredSheets)t.sheet===e&&(this.pendingDeferredSheets.delete(t),t.invalidate())}inlineDeferredLinkElement(e,t){var r;null==(r=this.beginDeferredLinkInlining(e,t))||r.advance(1/0)}emitCssTextMutation(e,t,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t,attributes:{_cssText:_a({element:e,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],a=function(e){var t;if(r.styleMirror.has(e))t=r.styleMirror.getId(e);else{var a=r.styleMirror.add(e);t=a;var o=Rn();try{Xn((()=>{try{var t=e.rules||e.cssRules;t&&Kn(t)}catch(e){}n.push({styleId:a,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:ca(t,e.href),index:r})))})}))}finally{ea(Rn()-o)}}i.styleIds.push(t)};for(var o of e)a(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Ka.forEach((e=>e.abort())),Ka.clear()}trackStylesheetInLinkElement(e){}}class xs{constructor(){ln(this,"nodeMap",new WeakMap),ln(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Cs=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Ms=document.createElement("iframe");document.body.appendChild(Ms),Array.from=(null==(on=Ms.contentWindow)?void 0:on.Array.from)||Array.from,document.body.removeChild(Ms)}}catch(e){console.debug("Unable to override Array.from",e)}var Ts=new ya,Is=new Set([cn.Mutation,cn.MediaInteraction,cn.StyleSheetRule,cn.CanvasMutation,cn.Font,cn.Log,cn.StyleDeclaration,cn.AdoptedStyleSheet]);function Es(e){var t=window;if("function"==typeof t.requestIdleCallback){var r=t.requestIdleCallback(e,{timeout:2e3});return{cancel(){var e;return null==(e=t.cancelIdleCallback)?void 0:e.call(t,r)}}}var i=setTimeout(e,250);return{cancel:()=>clearTimeout(i)}}function Rs(e){var t;void 0===e&&(e={});var r=e,i=r.emit,n=r.checkoutEveryNms,a=r.checkoutEveryNth,o=r.blockClass,s=void 0===o?"rr-block":o,u=r.blockSelector,l=void 0===u?null:u,c=r.ignoreClass,d=void 0===c?"rr-ignore":c,v=r.ignoreSelector,f=void 0===v?null:v,p=r.maskTextClass,m=void 0===p?"rr-mask":p,g=r.maskTextSelector,y=void 0===g?null:g,b=r.inlineStylesheet,w=void 0===b||b,k=r.inlineStylesheetBudgetRules,_=r.maskAllInputs,S=r.maskInputOptions,x=r.slimDOMOptions,C=r.maskInputFn,M=r.maskTextFn,T=r.maskAllElementAttributes,I=void 0!==T&&T,E=r.maskAttributeFn,R=r.hooks,A=r.packFn,L=r.sampling,O=void 0===L?{}:L,F=r.dataURLOptions,N=void 0===F?{}:F,D=r.canvasResolutionScale,P=r.canvasMasking,q=r.mousemoveWait,j=r.recordDOM,B=void 0===j||j,H=r.recordCanvas,U=void 0!==H&&H,W=r.recordCrossOriginIframes,z=void 0!==W&&W,V=r.recordAfter,Z=void 0===V?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":V,Q=r.userTriggeredOnInput,G=void 0!==Q&&Q,Y=r.collectFonts,J=void 0!==Y&&Y,K=r.inlineImages,X=void 0!==K&&K,ee=r.plugins,te=r.keepIframeSrcFn,re=void 0===te?()=>!1:te,ie=r.ignoreCSSAttributes,ne=void 0===ie?new Set([]):ie,ae=r.attributeFilter;Lo=r.errorHandler;var oe=h({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},N),se=!z||window.parent===window,ue=!1;if(!se)try{window.parent.document&&(ue=!1)}catch(e){ue=!0}if(se&&!i)throw new Error("emit function is required");if(!se&&!ue)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Ts.reset();var le,he=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},ce=ao(void 0!==x&&x);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var de,ve,fe=0,pe=new Map,me=e=>{for(var t of ee||[])t.eventProcessor&&(e=t.eventProcessor(e));return A&&!ue&&(e=A(e)),e};ms=(e,t)=>{var r,o=e;if(o.timestamp=po(),!(null==(r=jo[0])?void 0:r.isFrozen())||o.type===hn.FullSnapshot||o.type===hn.IncrementalSnapshot&&Is.has(o.data.source)||jo.forEach((e=>e.unfreeze())),se)null==i||i(me(o),t);else if(ue){var s={type:"rrweb",event:me(o),origin:window.location.origin,isCheckout:t};window.parent.postMessage(s,"*")}if(o.type===hn.FullSnapshot)le=o,fe=0;else if(o.type===hn.IncrementalSnapshot){if(o.data.source===cn.Mutation&&o.data.isAttachIframe)return;fe++,(a&&fe>=a||n&&o.timestamp-le.timestamp>n)&&gs(!0)}};var ge=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,r=new Set;if(e.adds.length>0)for(var i of e.adds){var n=Ts.getNode(i.node.id);n&&"IFRAME"===n.nodeName&&r.add(n)}e.removes.forEach((e=>{var i=e.id;if(!t||!t.has(i)){var n=ke.getIframeElementById(i);n&&r.has(n)?ke.forgetIframeId(i):(null==de||de(i),ke.removeIframeById(i))}})),null==ve||ve(),ke.cleanupDetachedIframes()}ms({type:hn.IncrementalSnapshot,data:h({source:cn.Mutation},e)})},ye=e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.Scroll},e)}),be=e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.CanvasMutation},e)}),we=new Ss({mutationCb:ge,adoptedStyleSheetCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.AdoptedStyleSheet},e)}),maskAllElementAttributes:I,maskAttributeFn:E}),ke=new es({mirror:Ts,mutationCb:ge,stylesheetManager:we,recordCrossOriginIframes:z,wrappedEmit:ms});for(var _e of ee||[])_e.getMirror&&_e.getMirror({nodeMirror:Ts,crossOriginIframeMirror:ke.crossOriginIframeMirror,crossOriginIframeStyleMirror:ke.crossOriginIframeStyleMirror});var Se=new xs,xe=null==P?void 0:P.configured;ys=new _s({recordCanvas:U,mutationCb:be,win:window,blockClass:s,blockSelector:l,mirror:Ts,sampling:O.canvas,dataURLOptions:oe,resolutionScale:D,canvasMasking:P});var Ce=new ts({mutationCb:ge,scrollCb:ye,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:w,maskInputOptions:he,dataURLOptions:oe,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,sampling:O,slimDOMOptions:ce,iframeManager:ke,stylesheetManager:we,canvasManager:ys,keepIframeSrcFn:re,processedNodeManager:Se,attributeFilter:ae},mirror:Ts});gs=function(e){if(void 0===e&&(e=!1),B){Qn(k);try{ms({type:hn.Meta,data:{href:window.location.href,width:yo(),height:go()}},e),null==t||t.cancel(),t=void 0,we.reset(),Ce.init(),jo.forEach((e=>e.lock()));var r,i=null;try{i=function(e,t){var r=t||{},i=r.mirror,n=void 0===i?new ya:i,a=r.blockClass,o=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,l=r.maskTextClass,h=void 0===l?"rr-mask":l,c=r.maskTextSelector,d=void 0===c?null:c,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,m=void 0!==p&&p,g=r.recordCanvas,y=void 0!==g&&g,b=r.canvasMaskingConfigured,w=r.maskAllInputs,k=void 0!==w&&w,_=r.maskTextFn,S=r.maskInputFn,x=r.maskAllElementAttributes,C=void 0!==x&&x,M=r.maskAttributeFn,T=r.slimDOM,I=r.dataURLOptions,E=r.preserveWhiteSpace,R=r.onSerialize,A=r.onIframeLoad,L=r.iframeLoadTimeout,O=r.onIframeListenerRegistered,F=r.onStylesheetLoad,N=r.stylesheetLoadTimeout,D=r.keepIframeSrcFn,P=void 0===D?()=>!1:D,q=r.maxDepth,j=r.inlineStylesheetBudgetRules,B=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===k?{password:!0}:k,H=ao(void 0!==T&&T);Qn(j);try{return no(e,{doc:e,mirror:n,blockClass:o,blockSelector:u,maskTextClass:h,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:_,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:M,slimDOMOptions:H,dataURLOptions:I,inlineImages:m,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:L,onIframeListenerRegistered:O,onStylesheetLoad:F,stylesheetLoadTimeout:N,keepIframeSrcFn:P,newlyAddedElement:!1,maxDepth:q})}finally{Gn()}}(document,{mirror:Ts,blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:y,inlineStylesheet:w,maskAllInputs:he,inlineStylesheetBudgetRules:k,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:E,slimDOM:ce,dataURLOptions:oe,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,onSerialize(e){xo(e,Ts)&&ke.addIframe(e),Co(e,Ts)&&we.trackLinkElement(e),Mo(e)&&Ce.addShadowRoot(In.shadowRoot(e),document)},onIframeLoad(e,t){ke.attachIframe(e,t),Ce.observeAttachShadow(e)},onIframeListenerRegistered(e,t){ke.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){we.attachLinkElement(e,t)},keepIframeSrcFn:re})}finally{a=$n,$n=[],r=a}if(!i)return console.warn("Failed to snapshot the document");if(ms({type:hn.FullSnapshot,data:{node:i,initialOffset:mo(window)}},e),jo.forEach((e=>e.unlock())),ys.onFullSnapshot(),r.length){var n=function(e,t,r){var i=!1,n=null,a=0,o=null,s=()=>null!==o||e.length>a,u=()=>{var r=e[a];e[a]=null,a+=1,r&&lo((()=>{o=t.beginDeferredLinkInlining(r,Ts.getId(r))}))},l=()=>{if(o){var e=o,t=!0;lo((()=>{t=e.advance(200)})),t&&(o=null)}},h=e=>{if(n=null,!i){var t=0;do{try{o||u(),l()}catch(e){null==o||o.discard(),o=null,ia(1)}t+=1}while(!i&&s()&&(e?!e.didTimeout&&e.timeRemaining()>5:10>t));i||(s()?n=Es(h):r())}};return n=Es(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var t=0,h=0;s()&&50>t;){o||u();var c=o;if(c)if(Math.floor(c.remainingRules()/200)+1>50-t)c.discard(),o=null,h+=1;else{try{l()}catch(e){null==o||o.discard(),o=null,h+=1}t+=1}}if(s()||h>0){for(var d=h+(null!==o?1:0),v=a;e.length>v;v++)null!==e[v]&&(d+=1);ia(d),null==o||o.discard(),o=null}r()}}}}(r,we,(()=>{t===n&&(t=void 0)}));t=n}z&&ke.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&we.adoptStyleSheets(document.adoptedStyleSheets,Ts.getId(document))}finally{Gn()}var a}};try{var Me=[];for(var Te of(Me.push(so("pagehide",(()=>{try{null==t||t.flush()}catch(e){}t=void 0}),window)),["visibilitychange","freeze","resume"]))Me.push(so(Te,On,document));de=e=>{var t=pe.get(e);t&&(t.forEach((e=>{lo(e);var t=Me.indexOf(e);-1!==t&&Me.splice(t,1)})),pe.delete(e))},ve=()=>{for(var e of pe){var t=e[0],r=Ts.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==de||de(t)}catch(e){null==de||de(t)}else null==de||de(t)}};var Ie=e=>{var t;return qo(Yo)({mutationCb:ge,mousemoveCb:(e,t)=>ms({type:hn.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.MouseInteraction},e)}),scrollCb:ye,viewportResizeCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.ViewportResize},e)}),inputCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.Input},e)}),mediaInteractionCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.MediaInteraction},e)}),styleSheetRuleCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.StyleSheetRule},e)}),styleDeclarationCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.StyleDeclaration},e)}),canvasMutationCb:be,fontCb:e=>ms({type:hn.IncrementalSnapshot,data:h({source:cn.Font},e)}),selectionCb(e){ms({type:hn.IncrementalSnapshot,data:h({source:cn.Selection},e)})},customElementCb(e){ms({type:hn.IncrementalSnapshot,data:h({source:cn.CustomElement},e)})},blockClass:s,ignoreClass:d,ignoreSelector:f,maskTextClass:m,maskTextSelector:y,maskInputOptions:he,inlineStylesheet:w,sampling:O,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xe,inlineImages:X,userTriggeredOnInput:G,collectFonts:J,doc:e,maskInputFn:C,maskTextFn:M,maskAllElementAttributes:I,maskAttributeFn:E,keepIframeSrcFn:re,blockSelector:l,slimDOMOptions:ce,dataURLOptions:oe,mirror:Ts,iframeManager:ke,stylesheetManager:we,shadowDomManager:Ce,processedNodeManager:Se,canvasManager:ys,ignoreCSSAttributes:ne,attributeFilter:ae,plugins:(null==(t=null==ee?void 0:ee.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>ms({type:hn.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},R)};ke.addLoadListener((e=>{try{var t=Ts.getId(e),r=Ie(e.contentDocument);if("function"==typeof r&&(Me.push(r),-1!==t)){var i=pe.get(t);i||pe.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}})),ke.addPageHideListener((e=>{var t=Ts.getId(e);null==de||de(t),Uo(e)}));var Ee=-1,Re=e=>ms({type:hn.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),Ae=()=>{var e,t,r,i,n=document,a=null!==(e=null!==(t=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==t?t:n.msFullscreenElement)&&void 0!==e?e:null,o=a?Ts.getId(a):-1;o!==Ee&&(-1!==Ee&&Re({id:Ee,enter:!1}),Ee=o,-1!==o&&Re({id:o,enter:!0}))},Le=()=>{gs();var e=Ie(document);"function"==typeof e&&Me.push(e),Me.push(so("fullscreenchange",Ae)),Me.push(so("webkitfullscreenchange",Ae)),Me.push(so("mozfullscreenchange",Ae)),Me.push(so("MSFullscreenChange",Ae)),Cs=!0};return["interactive","complete"].includes(document.readyState)?Le():(Me.push(so("DOMContentLoaded",(()=>{ms({type:hn.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&Le()}))),Me.push(so("load",(()=>{ms({type:hn.Load,data:{}}),"load"===Z&&Le()}),window))),()=>{try{null==t||t.flush()}catch(e){}t=void 0,Me.forEach((e=>lo(e))),Se.destroy(),ke.removeLoadListener(),ke.destroy(),pe.clear(),Ce.reset(),Ts.reset(),Cs=!1,Lo=void 0}}catch(e){console.warn(e)}}Rs.addCustomEvent=(e,t)=>{if(!Cs)throw new Error("please add custom event after start recording");ms({type:hn.Custom,data:{tag:e,payload:t}})},Rs.freezePage=()=>{jo.forEach((e=>e.freeze()))},Rs.takeFullSnapshot=e=>{if(!Cs)throw new Error("please take full snapshot after start recording");gs(e)},Rs.mirror=Ts;var As=Object.defineProperty,Ls=(e,t,r)=>((e,t,r)=>t in e?As(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Os{constructor(e){Ls(this,"fileName"),Ls(this,"functionName"),Ls(this,"lineNumber"),Ls(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Fs=/(^|@)\S+:\d+/,Ns=/^\s*at .*(\S+:\d+|\(native\))/m,Ds=/^(eval@)?(\[native code])?$/,Ps={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ns)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ns)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),a=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Os({functionName:a,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Ds)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Os({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new Os({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,a=r.length;a>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Os({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,a=r.length;a>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Os({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Fs)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Os({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function qs(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var a=0;i.children.length>a;a++){var o=i.children[a];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function js(e){return Array.isArray(e)}function Bs(e){return"object"==typeof e&&null!==e&&!js(e)}function Hs(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Bs(e[i])&&Hs(e[i],t-1))return!0;return!1}function $s(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var a=i.indexOf(this);~a?i.splice(a+1):i.push(this),~a?n.splice(a,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Bs(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Bs(o)&&Hs(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var u in t){var l=t[u];s[u]=js(l)?qs(l.length?l[0]:null):l}return s}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Us={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Ws(e,t,r){var i,n=r?Object.assign({},Us,r):Us,a=n.logger;if(!a)return()=>{};i="string"==typeof a?t[a]:a;var o=0,s=!1,u=[];if(n.level.includes("error")){var l=t=>{var r=t.message,i=Ps.parse(t.error).map((e=>e.toString())),a=[$s(r,n.stringifyOptions)];e({level:"error",trace:i,payload:a})};t.addEventListener("error",l),u.push((()=>{t.removeEventListener("error",l)}));var h=t=>{var r,i;t.reason instanceof Error?i=[$s("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[$s("Uncaught (in promise)",n.stringifyOptions),$s(t.reason,n.stringifyOptions)]);var a=Ps.parse(r).map((e=>e.toString()));e({level:"error",trace:a,payload:i})};t.addEventListener("unhandledrejection",h),u.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((e=>e()))};function d(t,r){var i=this;return t[r]?function(t,a,u){try{if(!(a in t))return()=>{};var l=t[a],h={next:l},c=(t=>function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];if(t.apply(i,u),!("assert"===r&&u[0]||s)){s=!0;try{var h=Ps.parse(new Error).map((e=>e.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((e=>$s(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:c}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[$s("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...u)}finally{s=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return h.next.apply(this,t)}));return"function"==typeof c&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),t[a]=c,()=>{if(t[a]!==c)for(var e=t[a];"function"==typeof e&&e.__rrweb_layer__;){var r=e.__rrweb_layer__;if(r.next===c)return void(r.next=h.next);e=r.next}else t[a]=h.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var zs=e=>({name:"rrweb/console@1",observer:Ws,options:e}),Vs=e=>"undefined"!=typeof Document&&e instanceof Document,Zs=()=>{};function Qs(e,t,r){try{if(!(t in e))return Zs;var i={next:e[t]},n=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return M(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=n,()=>{if(e[t]!==n)for(var r=e[t];M(r)&&r.__posthog_layer__;){var a=r.__posthog_layer__;if(a.next===n)return void(a.next=i.next);r=a.next}else e[t]=i.next}}catch(e){return Zs}}function Gs(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var a of t.payloadHostDenyList)if(i.endsWith(a))return{hostname:i,isHostDenied:!0};return n}var Ys=Oe("[Recorder]"),Js=e=>"navigation"===e.entryType,Ks=e=>"resource"===e.entryType;function Xs(e,t){return!!t&&(F(t)||t[e])}function eu(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var tu=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function ru(e){var t=e.type,r=e.recordBody,i=e.headers;function n(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!eu(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(n(tu))return!1;if(F(r))return!0;if(C(r))return n(r);var a=r[t];return F(a)?a:n(a)}function iu(e,t,r,i,n,a){return nu.apply(this,arguments)}function nu(){return nu=l((function*(e,t,r,i,n,a){if(void 0===a&&(a=0),a>10)return Ys.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var a=e.length-1;a>=0;a-=1)if(Ks(o=e[a])&&o.initiatorType===t&&(I(i)||o.startTime>=i)&&(I(n)||n>=o.startTime))return e[a];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*a))),iu(e,t,r,i,n,a+1))})),nu.apply(this,arguments)}function au(e){var t=e.body,r=e.options,i=e.url;if(L(t))return null;var n=Gs(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(E(t))return t;if(Vs(t))return t.textContent;if(N(t))return Be(t);if(T(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var ou=e=>!A(e)&&("navigation"===e.entryType||"resource"===e.entryType);function su(e){var t=e.entry,r=e.method,i=e.status,n=e.networkRequest,a=e.isInitial,o=e.start,s=e.end,u=e.url,l=e.initiatorType;o=t?t.startTime:o,s=t?t.responseEnd:s;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(o||0)),v=[h({},t?t.toJSON():{name:u},{startTime:I(o)?void 0:Math.round(o),endTime:I(s)?void 0:Math.round(s),timeOrigin:c,timestamp:d,method:r,initiatorType:l||(t?t.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:a})];if(ou(t))for(var f of t.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var uu=["video/","audio/"];function lu(e){return T(e)&&M(e.getReader)&&M(e.tee)}var hu=500,cu="[SessionReplay] Timeout while trying to read body",du="[SessionReplay] Failed to read body";function vu(e){return du+": "+e}function fu(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function pu(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(cu)),hu);try{e.clone().text().then((e=>t(e)),(e=>t(vu(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(du)}}))}(e);var r=wt(t);return function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>t}catch(e){return!1}}(e,r)?Promise.resolve(fu(r)):function(e,t){return new Promise((r=>{var i,n=!1;function a(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){n||(n=!0,clearTimeout(u),a(),r(e))}var s,u=setTimeout((()=>o(cu)),hu);try{s=e.clone()}catch(e){return void o(du)}var l=s.body;if(lu(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(e){return void o(du)}var h=[],c=0;!function e(){i.read().then((r=>{var i=r.done,s=r.value;if(n)a();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var n of e)r.set(n,i),i+=n.byteLength;return r}(h,c)));else{if(s){if(c+s.byteLength>t)return void o(fu(t));c+=s.byteLength,h.push(s)}e()}}),(e=>o(vu(e))))}()}else try{s.text().then((e=>o(e)),(e=>o(vu(e))))}catch(e){o(du)}}))}(e,r)}function mu(){return mu=l((function*(e){var t=e.r,r=e.options,i=Gs(e.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):pu(t,r)})),mu.apply(this,arguments)}function gu(){return gu=l((function*(e){var t=e.r,r=e.options,i=function(e){var t,r=e.r,i=e.options,n=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var a=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=uu.some((e=>null==a?void 0:a.startsWith(e)));if(a&&o)return"Content-Type "+a+" is not supported";var s=Gs(n,i);return s.isHostDenied?s.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return A(i)?pu(t,r):Promise.resolve(i)})),gu.apply(this,arguments)}var yu=null;function bu(e,t,r){if(!("performance"in t))return()=>{};if(yu)return Ys.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},kt,r):kt,n=t=>{var r=[],n=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!n){var a=i.maskRequestFn(e);t||(n=!a||(e=>!!e&&Et.has(e))(a)),a&&r.push(a)}})),r.length>0&&e(h({},t,{requests:r}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Js(e)||Ks(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>su({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>Js(e)||Ks(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>su({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),a=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:a}),()=>{n.disconnect()}}(n,t,i),o=()=>{},s=()=>{};return(i.recordHeaders||i.recordBody)&&(o=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Xs("request",r.recordHeaders),n=Xs("response",r.recordHeaders),a=Qs(t.XMLHttpRequest.prototype,"open",(a=>function(o,s,u,l,h){void 0===u&&(u=!0);var c=this;try{var d,v,f=new Request(s),p={},m={},g=c.setRequestHeader.bind(c);c.setRequestHeader=(e,t)=>(m[e]=t,g(e,t)),i&&(p.requestHeaders=m);var y=c.send.bind(c);c.send=e=>(ru({type:"request",headers:m,url:s,recordBody:r.recordBody})&&(p.requestBody=au({body:e,options:r,url:s})),d=t.performance.now(),y(e));var b=()=>{c.removeEventListener("readystatechange",w),c.removeEventListener("error",b),c.removeEventListener("abort",b),c.removeEventListener("timeout",b)},w=()=>{if(c.readyState===c.DONE){b(),v=t.performance.now();var i={};c.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),ru({type:"response",headers:i,url:s,recordBody:r.recordBody})&&(p.responseBody=au({body:c.response,options:r,url:s})),iu(t,"xmlhttprequest",f.url,d,v).then((t=>{var r=su({entry:t,method:o,status:null==c?void 0:c.status,networkRequest:p,start:d,end:v,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};c.addEventListener("readystatechange",w),c.addEventListener("error",b),c.addEventListener("abort",b),c.addEventListener("timeout",b)}catch(e){Ys.error("Failed to instrument XHR for network capture",e)}a.call(c,o,s.toString(),u,l,h)}));return()=>{a()}}(n,t,i),s=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=Xs("request",r.recordHeaders),n=Xs("response",r.recordHeaders),a=Qs(t,"fetch",(a=>function(){var o=l((function*(o,s){var u,l;try{u=new Request(o,s)}catch(e){return Ys.error("Failed to instrument fetch for network capture",e),a(o,s)}var h,c,d={};try{try{var v={};u.headers.forEach(((e,t)=>{v[t]=e})),i&&(d.requestHeaders=v),!lu(null==s?void 0:s.body)&&ru({type:"request",headers:v,url:o,recordBody:r.recordBody})&&(d.requestBody=yield function(e){return mu.apply(this,arguments)}({r:u,options:r,url:o}))}catch(e){Ys.error("Failed to record fetch request for network capture",e)}h=t.performance.now(),l=eu(o)?yield a(u):yield a(o,s),c=t.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),n&&(d.responseHeaders=f),ru({type:"response",headers:f,url:o,recordBody:r.recordBody})&&(d.responseBody=yield function(e){return gu.apply(this,arguments)}({r:l,options:r,url:o})),l}finally{iu(t,"fetch",u.url,h,c).then((t=>{var r,i=su({entry:t,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:h,end:c,url:u.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return o.apply(this,arguments)}}()));return()=>{a()}}(n,t,i)),yu=()=>{a(),o(),s(),yu=null}}var wu=e=>({name:"rrweb/network@1",observer:bu,options:e});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:zs,getRecordNetworkPlugin:wu},s.__PosthogExtensions__.rrweb={record:Rs,version:"v2",wasMaxDepthReached:()=>io,resetMaxDepthState(){io=!1,ro=!1},getLastSnapshotCost:()=>Bn,getMutationCost:()=>h({},zn),resetSnapshotCostState(){Dn=0,Pn=0,qn=0,An=0,jn=En(),Bn=null,Hn=null,$n=[],Un=0,Wn=0,zn={slowestBatchMs:0},Vn={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:Rs,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:zs},s.getRecordNetworkPlugin=wu,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(e,t)=>new an(e,t);var ku,_u,Su,xu,Cu,Mu,Tu,Iu,Eu,Ru,Au,Lu,Ou,Fu,Nu,Du={},Pu=[],qu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ju=Array.isArray;function Bu(e,t){for(var r in t)e[r]=t[r];return e}function Hu(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function $u(e,t,r){var i,n,a,o={};for(a in t)"key"==a?i=t[a]:"ref"==a?n=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?ku.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return Uu(e,o,i,n,null)}function Uu(e,t,r,i,n){var a={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Su:n,__i:-1,__u:0};return null==n&&null!=_u.vnode&&_u.vnode(a),a}function Wu(e){return e.children}function zu(e,t){this.props=e,this.context=t}function Vu(e,t){if(null==t)return e.__?Vu(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Vu(e):null}function Zu(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],a=Bu({},t);a.__v=t.__v+1,_u.vnode&&_u.vnode(a),il(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?Vu(t):r,!!(32&t.__u),n),a.__v=t.__v,a.__.__k[a.__i]=a,al(i,a,n),t.__e=t.__=null,a.__e!=r&&Qu(a)}}function Qu(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),Qu(e)}function Gu(e){(!e.__d&&(e.__d=!0)&&xu.push(e)&&!Yu.__r++||Cu!=_u.debounceRendering)&&((Cu=_u.debounceRendering)||Mu)(Yu)}function Yu(){try{for(var e,t=1;xu.length;)xu.length>t&&xu.sort(Tu),e=xu.shift(),t=xu.length,Zu(e)}finally{xu.length=Yu.__r=0}}function Ju(e,t,r,i,n,a,o,s,u,l,h){var c,d,v,f,p,m,g,y=i&&i.__k||Pu,b=t.length;for(u=function(e,t,r,i,n){var a,o,s,u,l,h=r.length,c=h,d=0;for(e.__k=new Array(n),a=0;n>a;a++)null!=(o=t[a])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[a]=Uu(null,o,null,null,null):ju(o)?o=e.__k[a]=Uu(Wu,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[a]=Uu(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,u=a+d,o.__=e,o.__b=e.__b+1,s=null,-1!=(l=o.__i=Xu(o,r,u,c))&&(c--,(s=r[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):e.__k[a]=null;if(c)for(a=0;h>a;a++)null!=(s=r[a])&&0==(2&s.__u)&&(s.__e==i&&(i=Vu(s)),ul(s,s));return i}(r,t,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1!=v.__i&&y[v.__i]||Du,v.__i=c,m=il(e,v,d,n,a,o,s,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&sl(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(g=!!(4&v.__u))||d.__k===v.__k?(u=Ku(v,u,e,g),g&&d.__e&&(d.__e=null)):"function"==typeof v.type&&void 0!==m?u=m:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Ku(e,t,r,i){var n,a;if("function"==typeof e.type){for(n=e.__k,a=0;n&&n.length>a;a++)n[a]&&(n[a].__=e,t=Ku(n[a],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=Vu(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Xu(e,t,r,i){var n,a,o,s=e.key,u=e.type,l=t[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==s||h&&s==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,a=r+1;n>=0||t.length>a;)if(null!=(l=t[o=0>n?a++:n--])&&0==(2&l.__u)&&s==l.key&&u==l.type)return o;return-1}function el(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||qu.test(t)?r:r+"px"}function tl(e,t,r,i,n){var a,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||el(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||el(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(Au,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?i?r[Ru]=i[Ru]:(r[Ru]=Lu,e.addEventListener(t,a?Fu:Ou,a)):e.removeEventListener(t,a?Fu:Ou,a);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function rl(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[Eu])t[Eu]=Lu++;else if(r[Ru]>t[Eu])return;return r(_u.event?_u.event(t):t)}}}function il(e,t,r,i,n,a,o,s,u,l){var h,c,d,v,f,p,m,g,y,b,$,w,k,_,S,x,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(u=!!(32&r.__u),a=[s=t.__e=r.__e]),(h=_u.__b)&&h(t);e:if("function"==typeof C){c=o.length;try{if(y=t.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],w=h?$?$.props.value:h.__:i,r.__c?g=(d=t.__c=r.__c).__=d.__E:(b?t.__c=d=new C(y,w):(t.__c=d=new zu(y,w),d.constructor=C,d.render=ll),$&&$.sub(d),d.state||(d.state={}),d.__n=i,v=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Bu({},d.__s)),Bu(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=t,v)b&&null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){t.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),Pu.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),b&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,p,m)}))}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,k=_u.__r,_=0,b)d.state=d.__s,d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),Pu.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++_);d.state=d.__s,null!=d.getChildContext&&(i=Bu(Bu({},i),d.getChildContext())),b&&!v&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Wu&&null==h.key?ol(h.props.children):h,s=Ju(e,ju(S)?S:[S],t,r,i,n,a,o,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){if(o.length=c,t.__v=null,u||null!=a)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=a&&(a[a.indexOf(s)]=null),t.__e=s}else{if(null!=a)for(x=a.length;x--;)Hu(a[x]);nl(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),e.then||nl(t);_u.__e(e,t,r)}}else null==a&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=function(e,t,r,i,n,a,o,s,u){var l,h,c,d,v,f,p,m=r.props||Du,g=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=a)for(l=0;a.length>l;l++)if((v=a[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,a[l]=null;break}if(null==e){if(null==y)return document.createTextNode(g);e=document.createElementNS(n,y,g.is&&g),s&&(_u.__m&&_u.__m(t,a),s=!1),a=null}if(null==y)m===g||s&&e.data==g||(e.data=g);else{if(a="textarea"==y&&null!=g.defaultValue?null:a&&ku.call(e.childNodes),!s&&null!=a)for(m={},l=0;e.attributes.length>l;l++)m[(v=e.attributes[l]).name]=v.value;for(l in m)v=m[l],"dangerouslySetInnerHTML"==l?c=v:"children"==l||l in g||"value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g||tl(e,l,null,v,n);for(l in g)v=g[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:s&&"function"!=typeof v||m[l]===v||tl(e,l,v,m[l],n);if(h)s||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),Ju("template"==t.type?e.content:e,ju(d)?d:[d],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,a,o,a?a[0]:r.__k&&Vu(r,0),s,u),null!=a)for(l=a.length;l--;)Hu(a[l]);s&&"textarea"!=y||(l="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==y&&!f||"option"==y&&f!=m[l])&&tl(e,l,f,m[l],n),l="checked",null!=p&&p!=e[l]&&tl(e,l,p,m[l],n))}return e}(r.__e,t,r,i,n,a,o,u,l);return(h=_u.diffed)&&h(t),128&t.__u?void 0:s}function nl(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(nl))}function al(e,t,r){for(var i=0;r.length>i;i++)sl(r[i],r[++i],r[++i]);_u.__c&&_u.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){_u.__e(e,t.__v)}}))}function ol(e){return"object"!=typeof e||null==e||e.__b>0?e:ju(e)?e.map(ol):void 0!==e.constructor?null:Bu({},e)}function sl(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){_u.__e(e,r)}}function ul(e,t,r){var i,n;if(_u.unmount&&_u.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||sl(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){_u.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&ul(i[n],t,r||"function"!=typeof e.type);r||Hu(e.__e),e.__c=e.__=e.__e=void 0}function ll(e,t,r){return this.constructor(e,r)}function hl(e,t,r){var i,n,a;t==document&&(t=document.documentElement),_u.__&&_u.__(e,t),i=t.__k,n=[],a=[],il(t,e=t.__k=$u(Wu,null,[e]),i||Du,Du,t.namespaceURI,i?null:t.firstChild?ku.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,a),al(n,e,a),e.props.children=null}ku=Pu.slice,_u={__e(e,t,r,i){for(var n,a,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&null!=a.getDerivedStateFromError&&(n.setState(a.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},Su=0,zu.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Bu({},this.state),"function"==typeof e&&(e=e(Bu({},r),this.props)),e&&Bu(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Gu(this))},zu.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Gu(this))},zu.prototype.render=Wu,xu=[],Mu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Tu=function(e,t){return e.__v.__b-t.__v.__b},Yu.__r=0,Iu=Math.random().toString(8),Eu="__d"+Iu,Ru="__a"+Iu,Au=/(PointerCapture)$|Capture$/i,Lu=0,Ou=rl(!1),Fu=rl(!0),Nu=0;var cl,dl,vl,fl,pl=0,ml=[],gl=_u,yl=gl.__b,bl=gl.__r,wl=gl.diffed,kl=gl.__c,_l=gl.unmount,Sl=gl.__;function xl(e,t){gl.__h&&gl.__h(dl,e,pl||t),pl=0;var r=dl.__H||(dl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Cl(e){return pl=1,function(e,t,r){var i=xl(cl++,2);if(i.t=e,!i.__c&&(i.__=[Dl(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=dl,!dl.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==e;if(i.__c.__H.__.some((function(e){if(e.__N){n=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),a){var s=a.call(this,e,t,r);return n?s||o:s}return!n||o};dl.__f=!0;var a=dl.shouldComponentUpdate,o=dl.componentWillUpdate;dl.componentWillUpdate=function(e,t,r){if(this.__e){var i=a;a=void 0,n(e,t,r),a=i}o&&o.call(this,e,t,r)},dl.shouldComponentUpdate=n}return i.__N||i.__}(Dl,e)}function Ml(e,t){var r=xl(cl++,3);!gl.__s&&Nl(r.__H,t)&&(r.__=e,r.u=t,dl.__H.__h.push(r))}function Tl(e){return pl=5,Il((function(){return{current:e}}),[])}function Il(e,t){var r=xl(cl++,7);return Nl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function El(e){var t=dl.context[e.__c],r=xl(cl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(dl)),t.props.value):e.__}function Rl(){for(var e;e=ml.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ol),t.__h.some(Fl),t.__h=[]}catch(r){t.__h=[],gl.__e(r,e.__v)}}}gl.__b=function(e){dl=null,yl&&yl(e)},gl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Sl&&Sl(e,t)},gl.__r=function(e){bl&&bl(e),cl=0;var t=(dl=e.__c).__H;t&&(vl===dl?(t.__h=[],dl.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.length&&Rl(),cl=0)),vl=dl},gl.diffed=function(e){wl&&wl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ml.push(t)&&fl===gl.requestAnimationFrame||((fl=gl.requestAnimationFrame)||Ll)(Rl)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),vl=dl=null},gl.__c=function(e,t){t.some((function(e){try{e.__h.some(Ol),e.__h=e.__h.filter((function(e){return!e.__||Fl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],gl.__e(r,e.__v)}})),kl&&kl(e,t)},gl.unmount=function(e){_l&&_l(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{Ol(e)}catch(e){t=e}})),r.__H=void 0,t&&gl.__e(t,r.__v))};var Al="function"==typeof requestAnimationFrame;function Ll(e){var t,r=function(){clearTimeout(i),Al&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);Al&&(t=requestAnimationFrame(r))}function Ol(e){var t=dl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),dl=t}function Fl(e){var t=dl;e.__c=e.__(),dl=t}function Nl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Dl(e,t){return"function"==typeof t?t(e):t}var Pl={Tab:"tab",Selector:"selector"},ql={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},jl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Bl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Hl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},$l={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Ul="always",Wl={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},zl={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LANGUAGE:"$survey_language"},Vl=Oe("[Surveys]"),Zl=(e,t)=>""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t),Ql=e=>Zl("seenSurvey_",e),Gl=e=>{try{var t=Ql(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Vl.error("Failed to persist survey seen state",e)}},Yl=[Bl.Popover,Bl.Widget,Bl.API];Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return O(e)&&isFinite(e)&&Math.floor(e)===e});class Jl{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Jl(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Jl(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Kl{generate(){var e=this.generateOrAbort();if(!I(e))return e;this.Rr=0;var t=this.generateOrAbort();if(I(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Rr)this.Rr=e,this.Ar();else{if(this.Rr>=e+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return Jl.fromFieldsV7(this.Rr,Math.trunc(this.Lr/Math.pow(2,30)),this.Lr&Math.pow(2,30)-1,this.Or.nextUint32())}Ar(){this.Lr=1024*this.Or.nextUint32()+(1023&this.Or.nextUint32())}constructor(){this.Rr=0,this.Lr=0,this.Or=new th}}var Xl,eh=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!I(e.crypto)&&crypto.getRandomValues&&(eh=e=>crypto.getRandomValues(e));class th{nextUint32(){return this.ft.length>this.Fr||(eh(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var rh=()=>ih().toString(),ih=()=>(Xl||(Xl=new Kl)).generate(),nh=null,ah={Nr(){if(!A(nh))return nh;var t=!0;if(I(e))t=!1;else try{var r="__mplssupport__";ah.Dr(r,"xyz"),'"xyz"'!==ah.Pr(r)&&(t=!1),ah.qr(r)}catch(e){t=!1}return t||Le.error("localStorage unsupported; falling back to cookie store"),nh=t,t},jr(e){Le.error("localStorage error: "+e)},Pr(t){try{return null==e?void 0:e.localStorage.getItem(t)}catch(e){ah.jr(e)}return null},Br(e){try{return JSON.parse(ah.Pr(e))||{}}catch(e){}return null},Dr(t,r){try{return null==e||e.localStorage.setItem(t,JSON.stringify(r)),!0}catch(e){ah.jr(e)}return!1},qr(t){try{null==e||e.localStorage.removeItem(t)}catch(e){ah.jr(e)}}},oh=Oe("[Stylesheet Loader]"),sh=e,uh=i,lh="#020617",hh={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:ql.Right,widgetType:Pl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:lh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},ch=[ql.Center,ql.Left,ql.Right];function dh(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function vh(e){var t;void 0===e&&(e=hh.backgroundColor),"#"===e[0]&&(t=dh(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=dh(r)),!t)return lh;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),a=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+a*a*.587+o*o*.114)>127.5?lh:"white"}return lh}var fh=(e,t,r)=>{var i=Oh(e),n=uh.querySelector("."+i);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var a=uh.createElement("div");((e,t,r)=>{var i=h({},hh,r),n=e.style,a=!ch.includes(i.position)||t===Bl.Widget&&(null==r?void 0:r.widgetType)===Pl.Tab;n.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(i.fontFamily)),n.setProperty("--ph-survey-box-padding",i.boxPadding),n.setProperty("--ph-survey-max-width",i.maxWidth),n.setProperty("--ph-survey-z-index",i.zIndex),n.setProperty("--ph-survey-border-color",i.borderColor),a?(n.setProperty("--ph-survey-border-radius",i.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",i.backgroundColor),n.setProperty("--ph-survey-box-shadow",i.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||vh(i.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",vh(i.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||vh(i.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),n.setProperty("--ph-widget-color",i.widgetColor),n.setProperty("--ph-widget-text-color",vh(i.widgetColor)),n.setProperty("--ph-widget-z-index",i.zIndex);var o=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),s=o||i.inputBackground;o||"white"!==i.backgroundColor||(s="#f8f8f8"),n.setProperty("--ph-survey-input-background",s);var u=(null==r?void 0:r.inputTextColor)||vh(s);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),n.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",i.outlineColor)})(a,e.type,e.appearance),a.className=i;var o=a.attachShadow({mode:"open"}),s=function(e){var t=((e,t,r)=>{var i=e.createElement("style");i.innerText=t;var n=(e=>{var t;return M(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(oh.error("prepare_external_dependency_stylesheet returned null"),null)})(uh,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(s){var u=o.querySelector("style");u&&o.removeChild(u),o.appendChild(s)}return uh.body.appendChild(a),{shadow:o,isNewlyCreated:!0}},ph=e=>{var t=e.responses,r=e.survey,i=e.surveySubmissionId,n=e.posthog,a=e.isSurveyCompleted,o=e.properties,s=e.surveyLanguage;n?(Gl(r),n.capture(Wl.SENT,h({[zl.SURVEY_NAME]:r.name,[zl.SURVEY_ID]:r.id,[zl.SURVEY_ITERATION]:r.current_iteration,[zl.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[zl.SURVEY_SUBMISSION_ID]:i,[zl.SURVEY_COMPLETED]:a},s&&{[zl.SURVEY_LANGUAGE]:s},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},li(t,r),o,{$set:{[hi(r,"responded")]:!0}})),a&&(sh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),Lh(r),n.reloadFeatureFlags())):Vl.error("[survey sent] event not captured, PostHog instance not found.")},mh=(e,t,r)=>{return h({[zl.SURVEY_NAME]:e.name,[zl.SURVEY_ID]:e.id,[zl.SURVEY_ITERATION]:e.current_iteration,[zl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[zl.SURVEY_PARTIALLY_COMPLETED]:(i=null==t?void 0:t.responses,void 0===i&&(i={}),Object.values(i).some((e=>!L(e))))},(null==t?void 0:t.surveyLanguage)&&{[zl.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[zl.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},li(null==t?void 0:t.responses,e));var i},gh=(e,t,r,i)=>{if(t){if(!r){var n=Rh(e);t.capture(Wl.DISMISSED,h({},mh(e,n,t),i&&{[zl.SURVEY_LANGUAGE]:i},{$set:{[hi(e,"dismissed")]:!0}})),Lh(e),Gl(e),sh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Vl.error("[survey dismissed] event not captured, PostHog instance not found.")},yh=(e,t)=>{if(t){var r=(e=>Zl("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=Rh(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Wl.ABANDONED,mh(e,i,t),{transport:"sendBeacon"})}}else Vl.error("[survey abandoned] event not captured, PostHog instance not found.")},bh=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),wh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,kh=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?wh(e.questions,bh(e.questions)):e.questions,_h=e=>function(e){var t;return mi(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}(e)||Ah(e),Sh=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Gu(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Nu++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),xh=()=>El(Sh),Ch=e=>{var t=e.children,r=e.style;return function(e,t,r){var i,n,a,o,s=Bu({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?i=t[a]:"ref"==a?n=t[a]:s[a]=void 0===t[a]&&null!=o?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?ku.call(arguments,2):r),Uu(e.type,s,i||e.key,n||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:r}:{children:t,style:r})};function Mh(e,t){var r,i;if(null==(r=e.conditions)||!r.url)return!0;var n=He(t);if(!n)return!1;var a=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return bi[o](a,[n])}function Th(t){var i,n;return function(t,i){var n,o,s;if(!t||0===t.length)return!0;if(!a)return!1;var u,l,h,c,d,v,f=(u={userAgentDataPlatform:null==r||null==(n=r.userAgentData)?void 0:n.platform,maxTouchPoints:null==r?void 0:r.maxTouchPoints,screenWidth:null==e||null==(o=e.screen)?void 0:o.width,screenHeight:null==e||null==(s=e.screen)?void 0:s.height,devicePixelRatio:null==e?void 0:e.devicePixelRatio},(v=function(e){return ce.test(e)?ee:he.test(e)?te:le.test(e)?re:new RegExp(ae,"i").test(e)?ae:new RegExp("("+ie+"|WPDesktop)","i").test(e)?ie:/iPad/.test(e)?J:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?K:de.test(e)?X:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ne,"i").test(e)?ne:/(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(Z).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)?Q:Y:new RegExp("(pda|"+Z+")","i").test(e)?se:new RegExp(G,"i").test(e)&&!new RegExp(G+" pc","i").test(e)?ue:""}(a))===J||v===Y||"Kobo"===v||"Kindle Fire"===v||v===ue?G:v===ee||v===re||v===te||v===ae?"Console":v===K?"Wearable":v?Z:"Android"===(null==u?void 0:u.userAgentDataPlatform)&&(null!==(l=null==u?void 0:u.maxTouchPoints)&&void 0!==l?l:0)>0?600>Math.min(null!==(h=null==u?void 0:u.screenWidth)&&void 0!==h?h:0,null!==(c=null==u?void 0:u.screenHeight)&&void 0!==c?c:0)/(null!==(d=null==u?void 0:u.devicePixelRatio)&&void 0!==d?d:1)?Z:G:"Desktop");return bi[null!=i?i:"icontains"](t,[f])}(null==(i=t.conditions)?void 0:i.deviceTypes,null==(n=t.conditions)?void 0:n.deviceTypesMatchType)}var Ih=e=>Zl("inProgressSurvey_",e),Eh=(e,t)=>{try{localStorage.setItem(Ih(e),JSON.stringify(t))}catch(e){Vl.error("Error setting in-progress survey state in localStorage",e)}},Rh=e=>{try{var t=localStorage.getItem(Ih(e));if(t)return JSON.parse(t)}catch(e){Vl.error("Error getting in-progress survey state from localStorage",e)}return null},Ah=e=>{var t=Rh(e);return!L(null==t?void 0:t.surveySubmissionId)},Lh=e=>{try{localStorage.removeItem(Ih(e))}catch(e){Vl.error("Error clearing in-progress survey state from localStorage",e)}};function Oh(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Fh(e,t,r){if(void 0===t&&(t=ql.Right),e===Bl.ExternalSurvey)return{};switch(t){case ql.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case ql.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case ql.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case ql.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case ql.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case ql.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case ql.Left:return{left:"30px"};case ql.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Bl.Widget&&r===Pl.Tab?"60px":"30px"}}}var Nh=0;function Dh(e,t,r,i,n,a){t||(t={});var o,s,u=t;if("ref"in u)for(s in u={},t)"ref"==s?o=t[s]:u[s]=t[s];var l={type:e,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nh,__i:-1,__u:0,__source:n,__self:a};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===u[s]&&(u[s]=o[s]);return _u.vnode&&_u.vnode(l),l}var Ph=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),qh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),jh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Bh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Hh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Dh("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),$h=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Dh("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),Uh=Dh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Dh("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Wh=function(e){var t=(void 0===e?{}:e).fill,r=void 0===t?"currentColor":t;return Dh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Dh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Dh("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]})},zh=Dh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Dh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Dh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Dh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Dh("g",{mask:"url(#mask0_2415_6911)",children:[Dh("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Dh("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Dh("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Dh("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Dh("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Dh("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Dh("defs",{children:Dh("clipPath",{id:"clip0_2415_6911",children:Dh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Vh(e){var t=e.urlParams,r=t?Object.entries(t).map((e=>{var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)})).join("&"):"";return Dh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",zh]})}function Zh(t){var r=t.text,i=t.submitDisabled,n=t.appearance,a=t.onSubmit,o=t.link,s=t.onPreviewSubmit,u=t.skipSubmitButton,l=t.canGoBack,h=t.onBack,c=El(Sh).isPreviewMode,d=!!l&&!!h,v=!u&&Dh("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){o&&(null==e||e.open(o)),c?null==s||s():a()},children:r});return Dh("div",{className:"bottom-section",children:[d?Dh("div",{className:"form-buttons form-buttons-with-back",children:[Dh("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),v]}):v,!n.whiteLabel&&Dh(Vh,{urlParams:{utm_source:"survey-footer"}})]})}function Qh(e){var t=e.question,r=e.forceDisableHtml;return Dh("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Dh(t.type===Hl.Open?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&Ch({component:$u("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Gh(e){return Dh("button",{className:"form-cancel",onClick:e.onClick,disabled:El(Sh).isPreviewMode,"aria-label":"Close survey",type:"button",children:Wh({fill:"black"})})}Dh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Dh("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Yh=e;function Jh(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,a=e.appearance,o=e.onClose,s=El(Sh).isPopup;return Ml((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Pe(Yh,"keydown",e),()=>{Yh.removeEventListener("keydown",e)}}),[o]),Dh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==a.hideCancelButton&&Dh(Gh,{onClick:()=>o()}),Dh("h3",{className:"thank-you-message-header",children:t}),r&&Ch({component:$u("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),s&&Dh(Zh,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:()=>o()})]})}function Kh(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,a=e.appearance,o=e.onStart,s=El(Sh),u=s.onPreviewSubmit,l=s.onPopupSurveyDismissed;return Dh("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s.isPopup&&!0!==a.hideCancelButton&&Dh(Gh,{onClick:()=>l()}),t&&Dh("h3",{className:"intro-screen-header",children:t}),r&&Ch({component:$u("p",{className:"intro-screen-body"}),children:r,renderAsHtml:!n&&"text"!==i}),Dh(Zh,{text:a.introScreenButtonText||"Get started",submitDisabled:!1,appearance:a,onSubmit:o,onPreviewSubmit:()=>u(null)})]})}var Xh=e=>C(e)&&e.every((e=>E(e)));function ec(e){var t=e.question,r=e.forceDisableHtml,i=e.appearance,n=e.onSubmit,a=e.onPreviewSubmit,o=e.displayQuestionIndex,s=e.initialValue,u=e.canGoBack,l=e.onBack,h=xh().isPreviewMode,c=Tl(null),d=Cl((()=>E(s)?s:"")),v=d[0],m=d[1],g=null==i?void 0:i.disableAutofocus;Ml((()=>{g||setTimeout((()=>{var e;h||null==(e=c.current)||e.focus()}),100)}),[h,g]);var y="surveyQuestion"+o,b=Il((()=>function(e,t,r){var i,n,a=e.trim();if(!r&&""===a)return"This field is required";if(""===a)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case f:if(void 0!==o.value&&o.value>a.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case p:if(void 0!==o.value&&a.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,t.validation,t.optional)),[v,t.validation,t.optional]),w=fe(t.validation,f),k=fe(t.validation,p),_=Il((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(w,k)),[w,k]),S=()=>{b||n(v.trim())},x=()=>{b||a(v.trim())};return Dh(Wu,{children:[Dh("div",{className:"question-container",children:[Dh(Qh,{question:t,forceDisableHtml:r,htmlFor:y}),Dh("textarea",{ref:c,id:y,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:w,maxLength:k,onInput(e){m(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||b||(e.preventDefault(),h?x():S())},value:v}),_&&Dh("div",{className:"validation-hint",children:_})]}),Dh(Zh,{text:t.buttonText||"Submit",submitDisabled:!!b,appearance:i,onSubmit:S,onPreviewSubmit:x,canGoBack:u,onBack:l})]})}function tc(e){var t=e.question,r=e.appearance,i=e.onSubmit,n=e.onPreviewSubmit,a=e.canGoBack,o=e.onBack;return Dh(Wu,{children:[Dh("div",{className:"question-container",children:Dh(Qh,{question:t,forceDisableHtml:e.forceDisableHtml})}),Dh(Zh,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:a,onBack:o})]})}function rc(e){var t,r=e.question,i=e.forceDisableHtml,n=e.displayQuestionIndex,a=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,u=e.initialValue,l=e.canGoBack,h=e.onBack,c=r.scale,d=10===r.scale?0:1,v=Cl((()=>O(u)?u:C(u)&&u.length>0&&O(parseInt(u[0]))?parseInt(u[0]):E(u)&&O(parseInt(u))?parseInt(u):null)),f=v[0],p=v[1],m="emoji"===r.display&&2===r.scale,g=xh().isPreviewMode,y=e=>g?s(e):o(e);return Dh(Wu,{children:[Dh("div",{className:"question-container",children:[Dh(Qh,{question:r,forceDisableHtml:i}),Dh("div",{className:"rating-section",children:[Dh("div",{className:"rating-options",children:["emoji"===r.display&&Dh("div",{className:"rating-options-emoji"+(m?" rating-options-emoji-2":""),children:null==(t=uc[r.scale])?void 0:t.map(((e,t)=>Dh("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===f?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;p(e),r.skipSubmitButton&&y(e)},children:e},t)))}),"number"===r.display&&Dh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(c-d+1)+", minmax(0, 1fr))"},children:lc(r.scale).map(((e,t)=>Dh(ic,{displayQuestionIndex:n,active:f===e,appearance:a,num:e,setActiveNumber(e){p(e),r.skipSubmitButton&&y(e)}},t)))})]}),!m&&Dh("div",{className:"rating-text",children:[Dh("div",{children:r.lowerBoundLabel}),Dh("div",{children:r.upperBoundLabel})]})]})]}),Dh(Zh,{text:r.buttonText||(null==a?void 0:a.submitButtonText)||"Submit",submitDisabled:A(f)&&!r.optional,appearance:a,onSubmit:()=>o(f),onPreviewSubmit:()=>s(f),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:h})]})}function ic(e){var t=e.num,r=e.setActiveNumber;return Dh("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick(){r(t)},children:t})}function nc(e){var t=e.question,r=e.forceDisableHtml,i=e.displayQuestionIndex,n=e.appearance,a=e.onSubmit,o=e.onPreviewSubmit,s=e.initialValue,u=e.canGoBack,l=e.onBack,c=Tl(null),d=Il((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=wh(t,bh(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),v=Cl((()=>((e,t)=>E(e)||Xh(e)?e:t===Hl.SingleChoice?null:[])(s,t.type))),f=v[0],p=v[1],m=Cl((()=>((e,t)=>{if(E(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Xh(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(s,d))),g=m[0],y=m[1],b=xh().isPreviewMode,w=t.type===Hl.SingleChoice,k=t.type===Hl.MultipleChoice,_=t.skipSubmitButton&&w&&!t.hasOpenChoice,S=(e,t)=>{if(t){var r=!g.isSelected;return y((e=>h({},e,{isSelected:r,inputValue:r?e.inputValue:""}))),w&&p(""),void(r&&setTimeout((()=>{var e;return null==(e=c.current)?void 0:e.focus()}),75))}if(w)return p(e),y((e=>h({},e,{isSelected:!1,inputValue:""}))),void(_&&(a(e),b&&o(e)));k&&C(f)&&(f.includes(e)?p(f.filter((t=>t!==e))):p([...f,e]))},x=e=>{e.stopPropagation();var t=e.currentTarget.value;y((e=>h({},e,{inputValue:t}))),w&&p(t)},M=e=>{e.stopPropagation(),"Enter"!==e.key||T()||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),y((e=>h({},e,{isSelected:!1,inputValue:""}))),w&&p(null))},T=()=>!(t.optional||!A(f)&&(!C(f)||g.isSelected||0!==f.length)&&(!g.isSelected||""!==g.inputValue.trim())),I=()=>{g.isSelected&&k?C(f)&&(b?o([...f,g.inputValue]):a([...f,g.inputValue])):b?o(f):a(f)};return Dh(Wu,{children:[Dh("div",{className:"question-container",children:[Dh(Qh,{question:t,forceDisableHtml:r}),Dh("fieldset",{className:"multiple-choice-options limit-height",children:[Dh("legend",{className:"sr-only",children:k?" Select all that apply":" Select one"}),d.map(((e,r)=>{var n=!!t.hasOpenChoice&&r===t.choices.length-1,a="surveyQuestion"+i+"Choice"+r,o=a+"Open",s=n?g.isSelected:w?f===e:C(f)&&f.includes(e);return Dh("label",{className:n?"choice-option-open":"",children:[Dh("div",{className:"response-choice",children:[Dh("input",{type:w?"radio":"checkbox",name:a,checked:s,onChange:()=>S(e,n),id:a,"aria-controls":o}),Dh("span",{children:n?e+":":e})]}),n&&Dh("input",{type:"text",ref:c,id:o,name:"question"+i+"Open",value:g.inputValue,onKeyDown:M,onInput:x,onClick(t){g.isSelected||S(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Dh(Zh,{text:t.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:_,canGoBack:u,onBack:l})]})}var ac=[1,2,3,4,5],oc=[1,2,3,4,5,6,7],sc=[0,1,2,3,4,5,6,7,8,9,10],uc={2:[$h,Uh],3:[jh,qh,Ph],5:[Bh,jh,qh,Ph,Hh]};function lc(e){switch(e){case 5:default:return ac;case 7:return oc;case 10:return sc}}var hc=Oe("[Surveys]");function cc(e,t,r){var i,n=e.questions[t],a=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?$l.End:a;if(n.branching.type===$l.End)return $l.End;if(n.branching.type===$l.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===$l.ResponseBased){if(n.type===Hl.SingleChoice){var o,s=n.choices.indexOf(""+r);if(-1===s&&n.hasOpenChoice&&(s=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(s)){var u=n.branching.responseValues[s];return Number.isInteger(u)?u:u===$l.End?$l.End:a}}else if(n.type===Hl.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===$l.End?$l.End:a}}return a}return hc.warn("Falling back to next question index due to unexpected branching type"),a}var dc=Oe("[SurveyTranslations]");function vc(e,t){var r=function(e){return function(e,t){var r=e.storedPersonProperties,i=e.locale,n=ci(e.overrideLanguage);if(n)return null==t||t.info("Using override display language: "+n),n;var a=function(e){return e&&"object"==typeof e&&"language"in e?ci(e.language):null}(r);if(a)return null==t||t.info("Using person property language: "+a),a;var o=ci(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:M(e.get_property)?e.get_property(zt):void 0,locale:navigator.language||navigator.userLanguage},dc)}(t);if(!r)return dc.info("No user language detected"),{survey:e,language:null};var i=pi(e,r,dc);return{survey:i.survey,language:i.matchedKey}}var fc=-1,pc=e,mc=i,gc="ph:show_survey_widget",yc="PHWidgetSurveyClickListener";function bc(e,t){try{var r=e.getBoundingClientRect(),i=pc.innerHeight,n=pc.innerWidth,a=r.left+r.width/2-t/2;a+t>n-20&&(a=n-t-20),20>a&&(a=20);var o=i-r.bottom,s=250>o&&r.top>o;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:a+"px",right:"auto",bottom:s?i-r.top+12+"px":"auto",zIndex:hh.zIndex}}catch(e){return Vl.warn("Failed to calculate trigger position:",e),null}}class wc{constructor(e){var t=this;this.Hr=new Map,this.$r=new Map,this.Ur=new Map,this.Wr=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property("$surveys");if(e)for(var t of e)Ah(t)&&yh(t,this._posthog)},this.handlePopoverSurvey=function(e,r,i){var n,a,o,s,u,l=(void 0===i?{}:i).resumeDelayFromActivation,c=void 0!==l&&l,d=t.zr(e),v=d.survey,f=d.language,p=null!=r&&r.position||null!=r&&r.selector?h({},v,{appearance:h({},v.appearance,r.position&&{position:r.position},r.selector&&{widgetSelector:r.selector})}):v;t.Vr(p.id);var m=null!=r?r:{},g=m.properties,y=m.initialResponses,b=!(!y||0>=Object.keys(y).length)&&t.Zr(p,y,g,f);if(!b||null!=(n=p.appearance)&&n.displayThankYouMessage){t.Qr(p);var w={};if((null==(a=p.appearance)?void 0:a.position)===ql.NextToTrigger&&null!=(o=p.appearance)&&o.widgetSelector){var k,_=mc.querySelector(p.appearance.widgetSelector);_&&(w=bc(_,parseInt((null==(k=p.appearance)?void 0:k.maxWidth)||hh.maxWidth))||{})}var S=(null==(s=p.appearance)?void 0:s.surveyPopupDelaySeconds)||0,x=fh(p,t._posthog).shadow;t.Ur.set(x,x.host);var C={posthog:t._posthog,survey:p,removeSurveyFromFocus:t.Gr,properties:g,style:w,isSurveyCompleted:b,skipShownEvent:null==r?void 0:r.skipShownEvent,surveyLanguage:f};if(0>=S)return hl(Dh(Cc,h({},C)),x);var M=()=>{if(!t.Yr(p))return Vl.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),t.Gr(p);hl(Dh(Cc,h({},C,{survey:h({},p,{appearance:h({},p.appearance,{surveyPopupDelaySeconds:0})})})),x)},T=c?null==(u=t._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,I=O(T)?Math.max(0,Date.now()-T):0,E=Math.max(0,1e3*S-I);if(0>=E)return M();var R=pc.setTimeout((()=>{t.Hr.delete(p.id),M()}),E);t.Hr.set(p.id,R)}},this.Jr=e=>{var t=this.zr(e),r=t.survey,i=t.language,n=fh(r,this._posthog),a=n.shadow,o=n.isNewlyCreated;this.Ur.set(a,a.host),o&&hl(Dh(Tc,{posthog:this._posthog,survey:r,surveyLanguage:i},e.id),a)},this.Kr=e=>{var t=this.$r.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(yc),this.$r.delete(e),Vl.info("Removed click listener for survey "+e))},this.Xr=e=>{this.ei(e)||(this.ti(e),this.Kr(e.id))},this.ei=e=>{try{var t,r=mc.querySelector(Oh(e,!0));return!(null==r||null==(t=r.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this.ri=(e,t)=>{var r=mc.querySelector(t),i=this.$r.get(e.id);if(r){if(this.Jr(e),i){if(r===i.element)return;Vl.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.Kr(e.id)}if(!r.hasAttribute(yc)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===ql.NextToTrigger?bc(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||hh.maxWidth)):{};pc.dispatchEvent(new CustomEvent(gc,{detail:{surveyId:e.id,position:n}}))};Pe(r,"click",n),r.setAttribute(yc,"true"),this.$r.set(e.id,{element:r,listener:n,survey:e}),Vl.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.Xr(e)},this.renderPopover=e=>{var t=this.zr(e),r=t.survey,i=t.language,n=fh(r,this._posthog).shadow;this.Ur.set(n,n.host),hl(Dh(Cc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Gr,surveyLanguage:i}),n)},this.renderSurvey=(e,t,r)=>{var i,n=this.zr(e),a=n.survey,o=n.language,s=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(s=this.ii(a,o,r)),hl(Dh(Cc,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Gr,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:o}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.Yr(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Bl.Popover||e.type===Bl.Widget)),i=new Set(r.map((e=>e.id)));for(var n of Array.from(t.Hr.keys()))i.has(n)||t.cancelSurvey(n);var a=t.ni(r),o=new Set;a.forEach((e=>{if(e.type===Bl.Widget){var r,i,n,a;if((null==(r=e.appearance)?void 0:r.widgetType)===Pl.Tab)return void t.Jr(e);(null==(i=e.appearance)?void 0:i.widgetType)===Pl.Selector&&null!=(n=e.appearance)&&n.widgetSelector&&(o.add(e.id),t.ri(e,null==(a=e.appearance)?void 0:a.widgetSelector))}A(t.ai)&&e.type===Bl.Popover&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})})),t.$r.forEach((e=>{var r=e.survey;o.has(r.id)||t.Xr(r)}))}),e)},this.Qr=e=>{A(this.ai)||Vl.error("Survey "+this.ai+" already in focus. Cannot add survey "+e.id+"."),this.ai=e.id},this.Gr=e=>{this.ai!==e.id&&Vl.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.Vr(e.id),this.ai=null,this.ti(e)},this._posthog=e,this.ai=null}Vr(e){var t=this.Hr.get(e);t&&(clearTimeout(t),this.Hr.delete(e))}cancelSurvey(e){this.Hr.has(e)&&(Vl.info("Cancelled pending survey "+e),this.Vr(e),this.ai===e&&(this.ai=null))}setAutomaticDisplayDispose(e){this.oi=e}dispose(){var e;null==(e=this.oi)||e.call(this),this.oi=void 0,this.Hr.forEach(((e,t)=>this.Vr(t))),this.$r.forEach(((e,t)=>this.Kr(t))),this.Ur.forEach(((e,t)=>{hl(null,t),null==e||e.remove()})),this.Ur.clear(),this.ai=null}ni(e){return e.sort(((e,t)=>{var r,i,n=Ah(e),a=Ah(t);if(n&&!a)return-1;if(!n&&a)return 1;var o=e.schedule===Ul,s=t.schedule===Ul;return o&&!s?1:!o&&s?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}zr(e){return vc(e,this._posthog)}ii(e,t,r){if(this.Wr.has(e.id))return!1;var i=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var a of n){var o=a.split("="),s=o[0],u=o[1];if(s&&!I(u)){var l=decodeURIComponent(s),h=decodeURIComponent(u);if("auto_submit"!==l||"true"!==h){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(h)}}else r=!0}}return{params:t,autoSubmit:r}}(pc.location.search),n=i.params;if(0===Object.keys(n).length)return!1;Vl.info("[Survey Prefill] Detected URL prefill parameters");var a=this.si(e,n,t);if(!a)return!1;var o=a.responses,s=a.submissionId,u=a.isSurveyCompleted,l=a.skippedResponses;return(Object.keys(l).length>0&&e.enable_partial_responses||u)&&ph({responses:u?o:l,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:u,properties:r,surveyLanguage:t}),this.Wr.add(e.id),u}Zr(e,t,r,i){var n={};for(var a of Object.entries(t)){var o=a[1];n[parseInt(a[0])]=C(o)?o.map(String):[String(o)]}Vl.info("[Survey] Processing initial responses");var s=this.si(e,n,i);if(!s)return!1;var u=s.isSurveyCompleted;return ph({responses:s.responses,survey:e,surveySubmissionId:s.submissionId,posthog:this._posthog,isSurveyCompleted:u,properties:r,surveyLanguage:i}),u}si(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],a=si(e.id);try{switch(e.type){case Hl.SingleChoice:if(!e.choices||0===e.choices.length)return void Le.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void Le.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[a]=e.choices[o];break;case Hl.MultipleChoice:if(!e.choices||0===e.choices.length)return void Le.warn("[Survey Prefill] Question "+i+" has no choices");var s=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===s.length)return void Le.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(s.map((t=>e.choices[t])))];s.length>u.length&&Le.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[a]=u;break;case Hl.Rating:var l=parseInt(n[0],10),h=e.scale||10;if(isNaN(l)||0>l||l>h)return void Le.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[a]=l;break;default:Le.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){Le.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return Vl.warn("[Survey Prefill] No valid responses after conversion"),null;var n=rh(),a=Object.keys(t).map((e=>parseInt(e,10))),o=function(e,t,r){for(var i=0,n={},a=[],o=e.questions.length+1,s=0;e.questions.length>i&&o>s&&(s++,t.includes(i));){var u=e.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=si(u.id);I(r[l])||(n[l]=r[l])}a.push(i);var h=cc(e,i,u.id?r[si(u.id)]:null);if(h===$l.End)return{startQuestionIndex:e.questions.length,skippedResponses:n,skippedIndices:a};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:a}}(e,a,i),s=o.startQuestionIndex,u=o.skippedResponses,l=s>=e.questions.length;return Eh(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:s,visitedIndices:o.skippedIndices,surveyLanguage:r}),Vl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:s,isSurveyCompleted:l,skippedResponses:u}}catch(e){return Vl.error("[Survey Prefill] Error handling prefill:",e),null}}ui(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),a=!0;return t&&(a=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&a}li(e){return!e.conditions||Mh(e,this._posthog)&&Th(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==uh||!uh.querySelector(e.conditions.selector))}(e)}hi(e){var t;return _h(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this._posthog.featureFlags)&&t.hasLoadedFlags?{satisfied:this.ui(e.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!function(e){return!(!e.start_date||e.end_date)}(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Yl.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this.ui(e.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.ui(e.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var a,o=this.hi(e);return o.satisfied?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,ah.Pr("lastSeenSurveyDate"))?(e=>!!ah.Pr(Ql(e))&&!_h(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(a=o.reason)&&void 0!==a?a:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(e){var t=this.checkSurveyEligibility(e);return t.eligible&&!this.ci(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}ci(e){var t;if(!mi(e)&&!function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}di(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var t=e.value;return!e.key||!t||this.ui(t)}))}Yr(e){return this.checkSurveyEligibility(e).eligible&&this.li(e)&&this.ci(e)&&this.di(e)}ti(e){try{var t=mc.querySelector(Oh(e,!0));null!=t&&t.shadowRoot&&(hl(null,t.shadowRoot),this.Ur.delete(t.shadowRoot)),null==t||t.remove()}catch(t){Vl.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.Qr,removeSurveyFromFocus:this.Gr,surveyInFocus:this.ai,surveyTimeouts:this.Hr,handleWidget:this.Jr,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ri,sortSurveysByAppearanceDelay:this.ni,checkFlags:this.di.bind(this),isSurveyFeatureFlagEnabled:this.ui.bind(this)}}}function kc(e,t){if(mc&&pc){var r,i=new wc(e);if(e.config.disable_surveys_automatic_display)return Vl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Vl.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{I(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},a=()=>{I(r)||(clearInterval(r),r=void 0)};n();var o=()=>{mc.hidden?a():(i.callSurveysAndEvaluateDisplayLogic(!1),n())};return Pe(mc,"visibilitychange",o),i.setAutomaticDisplayDispose((()=>{a(),mc.removeEventListener("visibilitychange",o)})),i}}function _c(e){var t=e.survey,r=e.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=e.setSurveyVisible,a=e.isPreviewMode,o=void 0!==a&&a,s=e.posthog;Ml((()=>{var e;if(!o&&null!=(e=t.conditions)&&e.url){var r=()=>{var e,r=t.type===Bl.Widget,a=Mh(t,s),o=(null==(e=t.appearance)?void 0:e.widgetType)===Pl.Tab&&r;if(!a)return Vl.info("Hiding survey "+t.id+" because URL does not match"),n(!1),i(t);o&&(Vl.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};Pe(pc,"popstate",r),Pe(pc,"hashchange",r);var a=pc.history.pushState,u=pc.history.replaceState;return pc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];a.apply(this,t),r()},pc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];u.apply(this,t),r()},()=>{pc.removeEventListener("popstate",r),pc.removeEventListener("hashchange",r),pc.history.pushState=a,pc.history.replaceState=u}}}),[o,t,i,n,s])}var Sc=200;function xc(e){switch(void 0===e&&(e=jl.Right),e){case jl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case jl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case jl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Cc(e){var t,r,i,n,a,o,s,u,l,c,d,v,f=e.survey,p=e.forceDisableHtml,m=e.posthog,g=e.style,y=void 0===g?{}:g,b=e.previewPageIndex,w=e.removeSurveyFromFocus,k=void 0===w?()=>{}:w,_=e.isPopup,S=void 0===_||_,x=e.onPreviewSubmit,C=void 0===x?()=>{}:x,M=e.onPreviewBack,T=void 0===M?()=>{}:M,E=e.onPopupSurveyDismissed,R=void 0===E?()=>{}:E,A=e.onCloseConfirmationMessage,L=void 0===A?()=>{}:A,O=e.properties,F=e.isSurveyCompleted,N=e.skipShownEvent,D=e.surveyLanguage,P=Tl(null),q=Number.isInteger(b),j=null!=(t=f.appearance)&&t.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,B=function(e,t,r,i,n,a,o,s,u){var l=Cl(i||0===r||e.type===Bl.ExternalSurvey),c=l[0],d=l[1],v=Cl(!1),f=v[0],p=v[1],m=Tl(!1),g=()=>{var t=()=>{a&&n(e),d(!1)};if(!m.current){var r=null==o?void 0:o.current;r?(m.current=!0,r.style.transition="opacity "+Sc+"ms ease-out",r.style.opacity="0",setTimeout((()=>{m.current=!1,t()}),Sc+50)):t()}},y=t=>{t.detail.surveyId===e.id&&g()};return Ml((()=>{if(t){if(!i){var n,a=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=e.appearance)&&i.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(g,5e3))}},o=()=>{if(Mh(e,t)){d(!0),pc.dispatchEvent(new Event("PHSurveyShown")),s||t.capture(Wl.SHOWN,h({[zl.SURVEY_NAME]:e.name,[zl.SURVEY_ID]:e.id,[zl.SURVEY_ITERATION]:e.current_iteration,[zl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[zl.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};Pe(pc,"PHSurveyClosed",y),Pe(pc,"PHSurveySent",a);var l=r>0?setTimeout(o,r):void 0;return I(l)&&o(),()=>{I(l)||clearTimeout(l),I(n)||clearTimeout(n),pc.removeEventListener("PHSurveyClosed",y),pc.removeEventListener("PHSurveySent",a)}}}else Vl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),_c({survey:e,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:i,posthog:t}),{isPopupVisible:c,isSurveySent:f,setIsPopupVisible:d,hidePopupWithAnimation:g}}(f,m,j,q,k,S,P,N,D),H=B.isPopupVisible,U=B.hidePopupWithAnimation,W=B.isSurveySent||b===f.questions.length||!0===F,z=Cl(!1),V=z[0],Z=z[1],Q=Il((()=>!!Rh(f)),[f]),G=!!(null!=(r=f.appearance)&&r.introScreenHeader||null!=(i=f.appearance)&&i.introScreenDescription),Y=q?b===fc:!(null==(n=f.appearance)||!n.displayIntroScreen)&&G&&!V&&!Q,J=Il((()=>{var e=Rh(f),t=(null==e?void 0:e.surveySubmissionId)||rh();return{isPreviewMode:q,previewPageIndex:b,onPopupSurveyDismissed(){D?gh(f,m,q,D):gh(f,m,q),R()},isPopup:S||!1,surveySubmissionId:t,onPreviewSubmit:C,onPreviewBack:T,posthog:m,properties:O,surveyLanguage:D}}),[q,b,S,m,f,R,C,T,O,D]);return H?Dh(Sh.Provider,{value:J,children:Dh("div",{className:"ph-survey",style:h({},Fh(f.type,null==(a=f.appearance)?void 0:a.position,null==(o=f.appearance)?void 0:o.widgetType),y),ref:P,children:W?Dh(Jh,{header:(null==(s=f.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(l=f.appearance)?void 0:l.thankYouMessageDescriptionContentType,appearance:f.appearance||hh,onClose(){U(),L()}}):Y?Dh(Kh,{header:(null==(c=f.appearance)?void 0:c.introScreenHeader)||"",description:(null==(d=f.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(v=f.appearance)?void 0:v.introScreenDescriptionContentType,appearance:f.appearance||hh,onStart:()=>Z(!0)}):Dh(Mc,{survey:f,forceDisableHtml:!!p,posthog:m})})}):null}function Mc(e){var t,r,i=e.survey,n=e.forceDisableHtml,a=e.posthog,o=Il((()=>{var e=Rh(i);if(!e)return null;var t=O(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&i.questions.length>e.lastQuestionIndex?e:(Lh(i),null)}),[i]),s=Cl((()=>(null!=o&&o.responses&&Vl.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),u=s[0],l=s[1],c=El(Sh),d=c.previewPageIndex,v=c.onPopupSurveyDismissed,f=c.isPopup,p=c.onPreviewSubmit,m=c.onPreviewBack,g=c.surveySubmissionId,y=c.isPreviewMode,b=c.properties,w=c.surveyLanguage,k=Cl((()=>{var e=null==o?void 0:o.lastQuestionIndex,t=O(e)&&e>=0&&i.questions.length>e?e:0;return O(d)&&d>=0?d:t})),_=k[0],S=k[1],x=Cl((()=>{var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter((e=>e>=0&&i.questions.length>e))})),C=x[0],M=x[1],T=Il((()=>kh(i)),[i]);Ml((()=>{!y||I(d)||0>d||S(d)}),[d,y]);var E=!(null==(t=i.appearance)||!t.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),R=T.at(_);return R?Dh("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(r=i.appearance)?void 0:r.hideCancelButton)&&Dh(Gh,{onClick(){v()}}),Dh("div",{className:"survey-box","data-question-index":_,children:Ic({question:R,forceDisableHtml:n,displayQuestionIndex:_,appearance:i.appearance||hh,onSubmit:e=>(e=>{var t=e.res,r=e.displayQuestionIndex,n=e.questionId;if(a)if(n){var o=si(n),s=h({},u,{[o]:t});l(s);var c=cc(i,r,t),d=c===$l.End,v=[...C,r];if(d||(M(v),S(c),Eh(i,{surveySubmissionId:g,responses:s,lastQuestionIndex:c,visitedIndices:v,surveyLanguage:w})),i.enable_partial_responses||d){var f=new Set(v.map((e=>{var t;return null==(t=T[e])?void 0:t.id})).filter((e=>!!e)).map((e=>si(e)))),p=Object.fromEntries(Object.entries(s).filter((e=>f.has(e[0]))));ph({responses:p,survey:i,surveySubmissionId:g,isSurveyCompleted:d,posthog:a,properties:b,surveyLanguage:w})}}else Vl.error("onNextButtonClick called without a questionId.");else Vl.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:_,questionId:R.id}),onPreviewSubmit:p,initialValue:R.id?u[si(R.id)]:void 0,canGoBack:E,onBack(){if(y)m();else if(0!==C.length){var e=C[C.length-1],t=C.slice(0,-1);M(t),S(e),Eh(i,{surveySubmissionId:g,responses:u,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:w})}}})})]}):null}function Tc(e){var t,r,i,n,a,o,s,u=e.survey,l=e.forceDisableHtml,h=e.posthog,c=e.readOnly,d=e.surveyLanguage,v=Cl(!0),f=v[0],p=v[1],m=Cl(!1),g=m[0],y=m[1],b=Cl({}),w=b[0],k=b[1],_=Tl(void 0),S=()=>{y(!g)};if(Ml((()=>{var e;if(h){if(!c){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&k({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===u.id&&(Vl.info("Received show event for feedback button survey "+u.id),k(r.detail.position||{}),S())};return Pe(pc,gc,t),()=>{I(_.current)||(clearTimeout(_.current),_.current=void 0),pc.removeEventListener(gc,t)}}}else Vl.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),_c({survey:u,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{u.schedule!==Ul&&p(!1),I(_.current)||clearTimeout(_.current),_.current=setTimeout((()=>{_.current=void 0,y(!1)}),200)};return Dh(Wu,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Dh("button",{className:"ph-survey-widget-tab "+((null==(a=u.appearance)?void 0:a.tabPosition)===jl.Top?"widget-tab-top":""),onClick:S,disabled:c,style:xc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),g&&Dh(Cc,{posthog:h,survey:u,forceDisableHtml:l,style:w,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:d})]})}var Ic=e=>{var t=e.question,r=e.onSubmit,i=e.onPreviewSubmit,n={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit(e){i(e)},onSubmit(e){r(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case Hl.Open:return $u(ec,h({},n,{question:t,key:t.id}));case Hl.Link:return $u(tc,h({},n,{question:t,key:t.id}));case Hl.Rating:return $u(rc,h({},n,{question:t,key:t.id}));case Hl.SingleChoice:case Hl.MultipleChoice:return $u(nc,h({},n,{question:t,key:t.id}));default:return Vl.error("Unsupported question type: "+t.type),null}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.generateSurveys=kc,s.extendPostHogWithSurveys=kc;var Ec=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),Rc=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return Ec(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,a=Math.min(e.length,r.remaining-2);a>n;){var o=Math.ceil((n+a)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?a=o-1:n=o}return Ec(t,JSON.stringify(e.slice(0,n)),r)},Ac=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,Lc=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},Oc=(e,t,r)=>{if(!r.truncated)if(T(e)){if(r.seen.has(e))return void Lc(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!{}.hasOwnProperty.call(e,i))continue;if(Oc(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else Lc(t,e,r)},Fc=function(e,t,r,i,n,a){if(void 0===n&&(n=!1),!Ac(e))return!n||Ec(t,"null",r);if(A(e)||(e=>{try{return O(e)||F(e)}catch(e){return!1}})(e))return Ec(t,JSON.stringify(e),r);if("string"==typeof e)return Rc(e,t,r);if(!T(e)&&!C(e))return Ec(t,JSON.stringify(e),r);if(i.has(e))return Rc("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(M(o))return Fc(o.call(e),t,r,i,n)}catch(e){}try{var s={}.toString.call(e);if("[object String]"===s)return Rc(String(e.valueOf()),t,r);if("[object Number]"===s||"[object Boolean]"===s)return Ec(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var u={};try{for(var l in e)({}).hasOwnProperty.call(e,l)&&(u[l]=e[l])}catch(e){}try{u.name=e.name}catch(e){}try{u.message=e.message}catch(e){}try{u.stack=e.stack}catch(e){}return Fc(u,t,r,i,n,a)}if(C(e)){if(!Ec(t,"[",r))return!1;for(var h=0;e.length>h;h++){if(h>0&&!Ec(t,",",r))return!1;var c=void 0;try{c=e[h]}catch(e){c=void 0}if(!Fc(c,t,r,i,!0))return!1}return Ec(t,"]",r)}if(!Ec(t,"{",r))return!1;var d=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(a)try{Oc(f,v,a)}catch(e){}if(Ac(f)){var p=(d?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var m=t.length,g=r.remaining,y=r.truncated;if(!Ec(t,p,r))return!1;var b=t.length,w=Fc(f,t,r,i,!1),k=r.truncated;if(t.length!==b){if(d=!1,!w)return!1}else if(t.length=m,r.remaining=g,r.truncated=w?y:k,!w)return!1}}}catch(e){}return Ec(t,"}",r)},Nc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.logs={initializeLogs(e){var t={host:s.location.host},r=!1,i=function(i){var n=s.console[i],a=(n=>function(){for(var a=!1,o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];try{if(u.length>0&&!r&&e.is_capturing()){var c;r=!0,a=!0;var d=((e,t)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=T(e[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([e[0]])}:void 0,a=0;e.length>a&&(0>=a||Ec(r," ",i))&&Fc(e[a],r,i,new WeakSet,!1,0===a?n:void 0);a++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(u),v=d.body,f=d.attributes,p=h({},t,d.truncated?{body_truncated:"true"}:{});null==(c=e.logs)||c.vi({level:Nc[i],body:v,attributes:h({"log.source":"console."+i},p,f)})}}catch(e){}finally{a&&(r=!1),n.apply(s.console,u)}})(n);a.__rrweb_original__=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(n),s.console[i]=a};for(var n of Object.keys(Nc))i(n)}},Oe("[Error tracking]");var Dc=Oe("[ExceptionAutocapture]"),Pc=new class{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),a=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var t=this;return l((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&C(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r,i;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),h({},e,{cause:r,stack:i})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return l((function*(){var r=e;for(var i of t.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,t){var r,i,n,a={type:e.type,value:e.value,mechanism:{type:null!==(r=t.type)&&void 0!==r?r:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(n=e.synthetic)&&void 0!==n&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,h({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:pe(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,r){void 0===r&&(r=0);var i=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return h({},t,{syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,r),next:e=>i(e,r+1)})}}([new class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=E(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return P(e,"DOMException")}isDOMError(e){return P(e,"DOMError")}},new class{match(e){return P(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!j(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return D(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}},new class{constructor(){}match(e){return!!P(e,"ErrorEvent")&&(null!=e.error||this.fi(e))}coerce(e,t){var r;if(null!=e.error)return t.apply(e.error);var i=t.apply(e.message);return h({},i,{stack:null!==(r=this.pi(e))&&void 0!==r?r:i.stack,synthetic:!0})}fi(e){return E(e.message)&&e.message.length>0}pi(e){var t,r,i=e,n=null!==(t=i.lineno)&&void 0!==t?t:0,a=null!==(r=i.colno)&&void 0!==r?r:0;if(E(i.filename)&&0!==i.filename.length&&0!==n)return"Error\n at "+i.filename+":"+n+":"+a}},new class{match(e){return q(e)}coerce(e,t){var r,i=this.getStack(e),n=void 0===i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=i?i:null==(r=t.syntheticException)?void 0:r.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:n}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}},new class{match(e){return j(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Ee(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null!==(r=this.getStack(e))&&void 0!==r?r:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(j(e))return e.constructor.name;var t="name"in e?e.name:void 0;return E(t)&&!R(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Ee(e)}isSeverityLevel(e){return E(e)&&!R(e)&&Ie.indexOf(e)>=0}getStack(e){try{return E(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:E(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(q(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},new class{match(e){return"string"==typeof e}coerce(e,t){var r,i=this.getInfos(e),n=i[0],a=i[1];return{type:null!=n?n:"Error",value:null!=a?a:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Te);return i&&(t=i[1],r=i[2]),[t,r]}},new class{match(e){return D(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var n=[],a=t.split("\n"),o=i;a.length>o;o++){var s=a[o];if(1024>=s.length){var u=Me.test(s)?s.replace(Me,"$1"):s;if(!u.match(/\S*Error: /)){for(var l of r){var c=l(u,e);if(c){n.push(c);break}}if(n.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return h({},e,{filename:e.filename||(r=t,r[r.length-1]||{}).filename,function:e.function||me});var r}))}(n)}}("web:javascript",_e,Ce)),qc=t=>{var r=e;r||Dc.info("window not available, cannot wrap onerror");var i=r.onerror;return r.onerror=function(){for(var e,r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];var o=Pc.buildFromUnknown((e=>{var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4];if(null!=a)return a;if(E(t)&&E(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:r,lineno:i,colno:n})}catch(e){return t}return t})(n),{mechanism:{handled:!1}});return t(o),!!M(i)&&null!==(e=i(...n))&&void 0!==e&&e},r.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=r.onerror)||delete e.__POSTHOG_INSTRUMENTED__,r.onerror=i}},jc=function(t,r){void 0===r&&(r=!1);var i=e;i||Dc.info("window not available, cannot wrap onUnhandledRejection");var n=i.onunhandledrejection;return i.onunhandledrejection=function(e){var i,a=Pc.buildFromUnknown(e,{mechanism:{handled:!1}});return t(a),M(n)?null!==(i=n(e))&&void 0!==i&&i:r},i.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=i.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,i.onunhandledrejection=n}},Bc={wrapOnError:qc,wrapUnhandledRejection:jc,wrapConsoleError(e){var t=console;t||Dc.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),a=0;i>a;a++)n[a]=arguments[a];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),s=Pc.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});e(s),M(r)&&r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.errorWrappingFunctions=Bc,s.posthogErrorWrappingFunctions=Bc;var Hc=(e,t)=>{if(M(null==e?void 0:e.capture)){var r=null==t?void 0:t.autocaptureExceptions,i=!A(r)&&"object"==typeof r&&C(r.errors_to_ignore)?r.errors_to_ignore.reduce(((e,t)=>{try{e.push(new RegExp(t))}catch(e){Dc.error("Ignoring invalid legacy exception exclusion rule",t,e)}return e}),[]):[],n=t=>{try{null==e.capture||e.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(e){Dc.error("Failed to capture exception for a legacy client",e)}};qc((e=>{i.some((t=>e.$exception_list.some((e=>t.test(e.value||"")))))||n(e)})),jc(n,!0)}};s.extendPostHogWithExceptionAutoCapture=Hc,s.extendPostHogWithExceptionAutocapture=Hc;var $c="X-POSTHOG-SESSION-ID",Uc="X-POSTHOG-WINDOW-ID",Wc="X-POSTHOG-DISTINCT-ID",zc=[$c,Uc,Wc],Vc=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Zc=(e,t)=>({}.hasOwnProperty.call(e,t)),Qc=e=>"object"==typeof e&&!A(e)||M(e),Gc=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),Yc=t=>{try{var r;return Gc(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==e||null==(r=e.location)?void 0:r.href).toString()}catch(e){return}},Jc=(e,t,r,i,n)=>{var a;try{a=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(C(e)&&!e.includes(a))return!1;var o=!1;if(r){var s=r.checkAndGetSessionAndWindowId(!0),u=s.windowId;n.set($c,s.sessionId),n.set(Uc,u),o=!0}var l=(e=>M(e)?e():e)(t);return l&&"$posthog_cookieless"!==l&&(n.set(Wc,l),o=!0),o};s.__PosthogExtensions__=s.__PosthogExtensions__||{};var Kc={_patchFetch:(t,r,i)=>Qs(e,"fetch",(e=>function(n,a){var o=arguments.length>1?[n,a]:[n],s=o;try{var u=Yc(n);if(u)if(Gc(n)){var l=new Request(n,a);Jc(t,r,i,l.url,l.headers),s=[l]}else{var c=new Headers(Qc(a)?a.headers:void 0);if(Jc(t,r,i,u,c)){var d=((e,t)=>{if(I(e)||A(e))return{headers:t};if(Qc(e)){var r=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(r);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),i}return new Proxy({headers:t},{get:(e,t)=>Zc(e,t)?Reflect.get(e,t):Reflect.get(r,t,r),has:(e,t)=>Zc(e,t)||t in r,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(r).forEach((e=>t.add(e))),Vc.forEach((e=>{e in r&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i)return i;if("string"==typeof t&&Vc.includes(t)&&t in r)return{configurable:!0,enumerable:!0,get(){return Reflect.get(r,t,r)}};var n=Reflect.getOwnPropertyDescriptor(r,t);return n?h({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(r)})}})(a,c);d&&(s=[n,d])}}}catch(e){s=o}return e.apply(this,s)})),_patchXHR:(t,r,i)=>Qs(e.XMLHttpRequest.prototype,"open",(e=>function(n,a,o,s,u){void 0===o&&(o=!0);var l=this,h=new Headers,c=Yc(a);c&&Jc(t,r,i,c,h);var d=e.call(l,n,a,o,s,u);return zc.forEach((e=>{var t=h.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}})),d}))};s.__PosthogExtensions__.tracingHeadersPatchFns=Kc,s.postHogTracingHeadersPatchFns=Kc,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(e){var t=this.length,r=Math.trunc(e)||0;return 0>r&&(r+=t),0>r||r>=t?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});let Xc=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(e){var t;if(!e.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}};var ed=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},td=e=>{if("loading"===document.readyState)return"loading";var t=ed();if(t){if(t.domInteractive>e)return"loading";if(0===t.domContentLoadedEventStart||t.domContentLoadedEventStart>e)return"dom-interactive";if(0===t.domComplete||t.domComplete>e)return"dom-content-loaded"}return"complete"},rd=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},id=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,i,n=e,a=n.id?"#"+n.id:[rd(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(t.length+a.length>99)return t||a;if(t=t?a+">"+t:a,n.id)break;e=n.parentNode}}catch(e){}return t},nd=new WeakMap;function ad(e,t){var r=nd.get(t);return r||(r=new WeakMap,nd.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var od=-1,sd=()=>od,ud=e=>{addEventListener("pageshow",(t=>{t.persisted&&(od=t.timeStamp,e(t))}),!0)},ld=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},hd=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},cd=()=>{var e,t;return null!==(e=null==(t=ed())?void 0:t.activationStart)&&void 0!==e?e:0},dd=-1,vd=new Set,fd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,pd=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of vd)t();isFinite(dd)||(dd="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",pd,!0))}},md=function(e){if(void 0===e&&(e=!1),e&&(dd=1/0),0>dd){var t,r=cd(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=r)))?void 0:t.startTime;dd=null!=i?i:fd(),addEventListener("visibilitychange",pd,!0),addEventListener("prerenderingchange",pd,!0),ud((()=>{setTimeout((()=>{dd=fd()}))}))}return{get firstHiddenTime(){return dd},onHidden(e){vd.add(e)}}},gd=function(e,t,r,i,n,a,o){void 0===t&&(t=-1),void 0===i&&(i=0);var s=ed(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>sd()?s&&(document.prerendering||cd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},yd=function(e,t,r){void 0===r&&(r={});try{var i=e.filter((e=>PerformanceObserver.supportedEntryTypes.includes(e)));if(i.length>0){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{var r=e.getEntries();i.length>1&&r.sort(((e,t)=>e.startTime+e.duration-(t.startTime+t.duration))),t(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(e){}},bd=e=>{var t;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(t=globalThis.PerformanceSoftNavigation)||null==(t=t.prototype)?void 0:t.getLargestInteractionContentfulPaint)&&e&&e.reportSoftNavs},wd=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){var r=e.keys().next().value;void 0!==r&&e.delete(r)}},kd=e=>{var t=!1;return()=>{t||(e(),t=!0)}};let _d=class{constructor(){this.u=void 0}};var Sd,xd=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Cd=[1800,3e3],Md=function(e,t){void 0===t&&(t={});var r=bd(t);xd((()=>{var i,n=ad(t,_d),a=md(),o=gd("FCP"),s=yd(["paint"],(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),a.firstHiddenTime>t.startTime&&(o.value=Math.max(t.startTime-cd(),0),o.entries.push(t),o.navigationId=t.navigationId||o.navigationId,i(!0)))}));s&&(i=ld(e,o,Cd,t.reportAllChanges),ud((r=>{o=gd("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,sd()),i=ld(e,o,Cd,t.reportAllChanges),hd((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&yd(["soft-navigation"],(r=>{r.forEach((r=>{n.u&&r.navigationId&&wd(n.u,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=gd("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=ld(e,o,Cd,t.reportAllChanges))(!0)}))}),t)}))},Td=[.1,.25],Id=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],Ed=0,Rd=1/0,Ad=0,Ld=e=>{for(var t of e)t.interactionId&&(Rd=Math.min(Rd,t.interactionId),Ad=Math.max(Ad,t.interactionId),Ed=Ad?(Ad-Rd)/7+1:0)},Od=()=>{var e;return Sd?Ed:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Fd=0;let Nd=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){Fd=Od(),this.h.length=0,this.v.clear()}T(e){var t=Od()-Fd,r=Math.min(this.h.length-1,Math.floor(t/50));return!t||-1!==r||"soft-navigation"!==e&&"back-forward-cache"!==e?this.h[r]:{D:8,id:-1,entries:[]}}l(e){var t;if(null!=(t=this.p)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.h.at(-1),i=this.v.get(e.interactionId);if(i||10>this.h.length||e.duration>r.D){var n;if(i?e.duration>i.D?(i.entries=[e],i.D=e.duration):e.duration===i.D&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.v.set((i={id:e.interactionId,entries:[e],D:e.duration}).id,i),this.h.push(i)),this.h.sort(((e,t)=>t.D-e.D)),this.h.length>10){var a=this.h.splice(10);for(var o of a)this.v.delete(o.id)}null==(n=this.m)||n.call(this,i)}}}};var Dd=e=>{var t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=kd(e),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:t})}},Pd=[200,500];let qd=class{constructor(){this.p=void 0,this.u=void 0}l(e){var t;null==(t=this.p)||t.call(this,e)}};var jd=[2500,4e3],Bd=-1,Hd=()=>Bd,$d=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Bd=t.timeStamp,e(t))}),!0)},Ud=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},Wd=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},zd=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Vd=()=>{var e,t;return null!==(e=null==(t=zd())?void 0:t.activationStart)&&void 0!==e?e:0},Zd=-1,Qd=new Set,Gd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Yd=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Qd)t();isFinite(Zd)||(Zd="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Yd,!0))}},Jd=function(e){if(void 0===e&&(e=!1),e&&(Zd=1/0),0>Zd){var t,r=Vd(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=r)))?void 0:t.startTime;Zd=null!=i?i:Gd(),addEventListener("visibilitychange",Yd,!0),addEventListener("prerenderingchange",Yd,!0),$d((()=>{setTimeout((()=>{Zd=Gd()}))}))}return{get firstHiddenTime(){return Zd},onHidden(e){Qd.add(e)}}},Kd=function(e,t,r,i,n,a,o){void 0===t&&(t=-1),void 0===i&&(i=0);var s=zd(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>Hd()?s&&(document.prerendering||Vd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:a||(null==s?void 0:s.name),navigationStartTime:o||0}},Xd=new WeakMap;function ev(e,t){var r=Xd.get(t);return r||(r=new WeakMap,Xd.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}let tv=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}};var rv=function(e,t,r){void 0===r&&(r={});try{var i=e.filter((e=>PerformanceObserver.supportedEntryTypes.includes(e)));if(i.length>0){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{var r=e.getEntries();i.length>1&&r.sort(((e,t)=>e.startTime+e.duration-(t.startTime+t.duration))),t(r)}))}));for(var a of i)n.observe(h({type:a,buffered:!0},r));return n}}catch(e){}},iv=e=>{var t;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(t=globalThis.PerformanceSoftNavigation)||null==(t=t.prototype)?void 0:t.getLargestInteractionContentfulPaint)&&e&&e.reportSoftNavs},nv=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){var r=e.keys().next().value;void 0!==r&&e.delete(r)}},av=e=>{var t=!1;return()=>{t||(e(),t=!0)}};let ov=class{constructor(){this.l=void 0}};var sv,uv=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},lv=[1800,3e3],hv=function(e,t){void 0===t&&(t={});var r=iv(t);uv((()=>{var i,n=ev(t,ov),a=Jd(),o=Kd("FCP"),s=rv(["paint"],(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),a.firstHiddenTime>t.startTime&&(o.value=Math.max(t.startTime-Vd(),0),o.entries.push(t),o.navigationId=t.navigationId||o.navigationId,i(!0)))}));s&&(i=Ud(e,o,lv,t.reportAllChanges),$d((r=>{o=Kd("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Hd()),i=Ud(e,o,lv,t.reportAllChanges),Wd((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&rv(["soft-navigation"],(r=>{r.forEach((r=>{n.l&&r.navigationId&&nv(n.l,r);var a=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Kd("FCP",a,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Ud(e,o,lv,t.reportAllChanges))(!0)}))}),t)}))},cv=[.1,.25],dv=function(e,t){void 0===t&&(t={});var r=Jd();hv(av((()=>{var i,n=Kd("CLS",0),a=ev(t,tv),o=(r,o,s,u,l)=>{n=Kd("CLS",0,r,o,s,u,l),a.i=0,i=Ud(e,n,cv,t.reportAllChanges)},s=function(e){void 0===e&&(e=!1),a.i>n.value&&(n.value=a.i,n.entries=a.o),i(e)},u=e=>{s(!0),o("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(var t of e)"soft-navigation"!==t.entryType?a.h(t):u(t);s()},h=["layout-shift"];iv(t)&&h.push("soft-navigation");var c=rv(h,l);c&&(i=Ud(e,n,cv,t.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),$d((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Hd()),Wd(i)})),setTimeout(i))})))},vv=0,fv=1/0,pv=0,mv=e=>{for(var t of e)t.interactionId&&(fv=Math.min(fv,t.interactionId),pv=Math.max(pv,t.interactionId),vv=pv?(pv-fv)/7+1:0)},gv=()=>{var e;return sv?vv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},yv=0;let bv=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){yv=gv(),this.u.length=0,this.v.clear()}M(e){var t=gv()-yv,r=Math.min(this.u.length-1,Math.floor(t/50));return!t||-1!==r||"soft-navigation"!==e&&"back-forward-cache"!==e?this.u[r]:{_:8,id:-1,entries:[]}}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.v.get(e.interactionId);if(i||10>this.u.length||e.duration>r._){var n;if(i?e.duration>i._?(i.entries=[e],i._=e.duration):e.duration===i._&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.v.set((i={id:e.interactionId,entries:[e],_:e.duration}).id,i),this.u.push(i)),this.u.sort(((e,t)=>t._-e._)),this.u.length>10){var a=this.u.splice(10);for(var o of a)this.v.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var wv=e=>{var t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var n=av(e),a=-1,o=()=>{i(a),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),a=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:t})}},kv=[200,500],_v=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Jd();uv((()=>{var i;"interactionCount"in performance||sv||(sv=rv(["event"],mv,{durationThreshold:0}));var n,a=Kd("INP"),o=ev(t,bv),s=(r,i,s,u,l)=>{o.T(),a=Kd("INP",-1,r,i,s,u,l),n=Ud(e,a,kv,t.reportAllChanges)},u=()=>{var e=o.M(a.navigationType);e&&e._!==a.value&&(a.value=e._,a.entries=e.entries,n())},l=e=>{u(),n(!0),s("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},c=function(e,t){void 0===t&&(t=!1),wv((()=>{for(var r of e)"soft-navigation"!==r.entryType?o.h(r):l(r);u(),t&&n(!0)}))},d=["event","first-input"];iv(t)&&d.push("soft-navigation");var v=rv(d,c,h({},t,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40}));n=Ud(e,a,kv,t.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),$d((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Hd())})))}))}};let Sv=class{constructor(){this.m=void 0,this.l=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}};var xv=[2500,4e3],Cv=function(e,t){void 0===t&&(t={});var r=!1,i=iv(t);uv((()=>{var n,a=Jd(),o=Kd("LCP"),s=ev(t,Sv),u=(i,s,u,l,h)=>{o=Kd("LCP",-1,i,s,u,l,h),n=Ud(e,o,xv,t.reportAllChanges),r=!1,"soft-navigation"===i&&(a=Jd(!0))},l=e=>{s.l&&e.navigationId&&nv(s.l,e),r||n(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);var t=null==e.getLargestInteractionContentfulPaint?void 0:e.getLargestInteractionContentfulPaint();t&&h([t])},h=e=>{for(var r of(t.reportAllChanges||i||(e=e.slice(-1)),e))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-Vd(),0),s.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.h(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=rv(c,h);if(d){n=Ud(e,o,xv,t.reportAllChanges);var v=["keydown","click","visibilitychange"],f=e=>{if(e.isTrusted&&!r){var t=o.id;wv((()=>{if(!r){if(!i)for(var e of(d.disconnect(),v))removeEventListener(e,f,{capture:!0});t===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});$d((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Hd()),n=Ud(e,o,xv,t.reportAllChanges),Wd((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))},Mv={onLCP(e,t){void 0===t&&(t={});var r=ad(t=Object.assign({},t),qd),i=new WeakMap;bd(t)&&(r.u=new Map),r.p=e=>{var r=e.element;if(r){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:id(r);i.set(e,a)}else e.id&&i.set(e,"#"+e.id)},function(e,t){void 0===t&&(t={});var r=!1,i=bd(t);xd((()=>{var n,a=md(),o=gd("LCP"),s=ad(t,qd),u=(i,s,u,l,h)=>{o=gd("LCP",-1,i,s,u,l,h),n=ld(e,o,jd,t.reportAllChanges),r=!1,"soft-navigation"===i&&(a=md(!0))},l=e=>{s.u&&e.navigationId&&wd(s.u,e),r||n(!0),u("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);var t=null==e.getLargestInteractionContentfulPaint?void 0:e.getLargestInteractionContentfulPaint();t&&h([t])},h=e=>{for(var r of(t.reportAllChanges||i||(e=e.slice(-1)),e))if(r)if("soft-navigation"!==r.entryType){var u=0,h=[],c=r.startTime;if("largest-contentful-paint"===r.entryType)u=Math.max(r.startTime-cd(),0),s.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;c=(null==(d=v.largestContentfulPaint)?void 0:d.renderTime)||0,u=Math.max(c-r.startTime,0),v.largestContentfulPaint&&(s.l(v.largestContentfulPaint),h=[v.largestContentfulPaint])}a.firstHiddenTime>c&&(o.value=u,o.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=yd(c,h);if(d){n=ld(e,o,jd,t.reportAllChanges);var v=["keydown","click","visibilitychange"],f=e=>{if(e.isTrusted&&!r){var t=o.id;Dd((()=>{if(!r){if(!i)for(var e of(d.disconnect(),v))removeEventListener(e,f,{capture:!0});t===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});ud((i=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,sd()),n=ld(e,o,jd,t.reportAllChanges),hd((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))}((t=>{e((e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n,a,o,s,u,l,c=e.entries.at(-1),d=c.url&&performance.getEntriesByType("resource").find((e=>e.name===c.url));t.target=i.get(c),t.lcpEntry=c,c.url&&(t.url=c.url),d&&(t.lcpResourceEntry=d);var v=0,f=0;if("soft-navigation"!==e.navigationType?(v=null!==(n=null==(a=l=ed())?void 0:a.activationStart)&&void 0!==n?n:0,f=null!==(o=null==(s=l)?void 0:s.responseStart)&&void 0!==o?o:0):(v=e.navigationStartTime||0,l=null==(u=r.u)?void 0:u.get(e.navigationId)),l){var p=Math.max(0,f-v),m=Math.max(p,d?(d.requestStart||d.startTime)-v:0),g=Math.min(e.value,Math.max(m,d?d.responseEnd-v:0));t=h({},t,{timeToFirstByte:p,resourceLoadDelay:m-p,resourceLoadDuration:g-m,elementRenderDelay:e.value-g,navigationEntry:l})}}return Object.assign(e,{attribution:t})})(t))}),t)},onCLS(e,t){void 0===t&&(t={});var r=ad(t=Object.assign({},t),Xc),i=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var n=Id(e.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==t.generateTarget?void 0:t.generateTarget(a))&&void 0!==o?o:id(a);i.set(n,s)}}},function(e,t){void 0===t&&(t={});var r=md();Md(kd((()=>{var i,n=gd("CLS",0),a=ad(t,Xc),o=(r,o,s,u,l)=>{n=gd("CLS",0,r,o,s,u,l),a.o=0,i=ld(e,n,Td,t.reportAllChanges)},s=function(e){void 0===e&&(e=!1),a.o>n.value&&(n.value=a.o,n.entries=a.i),i(e)},u=e=>{s(!0),o("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},l=e=>{for(var t of e)"soft-navigation"!==t.entryType?a.l(t):u(t);s()},h=["layout-shift"];bd(t)&&h.push("soft-navigation");var c=yd(h,l);c&&(i=ld(e,n,Td,t.reportAllChanges),r.onHidden((()=>{l(c.takeRecords()),i(!0)})),ud((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,sd()),hd(i)})),setTimeout(i))})))}((t=>{e((e=>{var t={};if(e.entries.length){var r,n=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=n&&null!=(r=n.sources)&&r.length){var a=Id(n.sources);a&&(t={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:td(n.startTime)})}}return Object.assign(e,{attribution:t})})(t))}),t)},onFCP(e,t){void 0===t&&(t={});var r=ad(t=Object.assign({},t),_d);bd(t)&&(r.u=new Map),Md((t=>{e((e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:td(sd())};if("soft-navigation"!==e.navigationType){if(e.entries.length){var i=ed(),n=e.entries.at(-1);if(i){var a=Math.max(0,i.responseStart-(i.activationStart||0));t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:td(e.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var o,s=null==(o=r.u)?void 0:o.get(e.navigationId);s&&(t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:"complete",navigationEntry:s})}return Object.assign(e,{attribution:t})})(t))}),t)},onINP(e,t){void 0===t&&(t={});var r=ad(t=Object.assign({},t),Nd),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(Dd(c),u=!0)},c=()=>{var e=new Set(r.h.map((e=>o.get(e.entries[0])))),t=n.length-10;n=n.filter(((r,i)=>i>=t||e.has(r)));var s=new Set;for(var l of n){var h=d(l.startTime,l.processingEnd);for(var c of h)s.add(c)}i=i.filter((e=>e.startTime>a||s.has(e))),u=!1};r.p=e=>{var r,i=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),t.includeProcessedEventEntries&&r.entries.push(e);break}}r||n.push(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:i,entries:t.includeProcessedEventEntries?[e]:[]}),(e.interactionId||"first-input"===e.entryType)&&o.set(e,r),l()},r.m=e=>{if(!s.get(e)){var r,i=null==(r=e.entries.find((e=>e.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(i))&&void 0!==n?n:id(i);s.set(e,a)}else{var o,u=null==(o=e.entries.find((e=>e.targetSelector)))?void 0:o.targetSelector;u&&s.set(e,u)}}};var d=(e,t)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=e){if(n.startTime>t)break;r.push(n)}return r};yd(["long-animation-frame"],(e=>{i=i.concat(e),l()}),t),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=md();xd((()=>{var i;"interactionCount"in performance||Sd||(Sd=yd(["event"],Ld,{durationThreshold:0}));var n,a=gd("INP"),o=ad(t,Nd),s=(r,i,s,u,l)=>{o.M(),a=gd("INP",-1,r,i,s,u,l),n=ld(e,a,Pd,t.reportAllChanges)},u=()=>{var e=o.T(a.navigationType);e&&e.D!==a.value&&(a.value=e.D,a.entries=e.entries,n())},l=e=>{u(),n(!0),s("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},c=function(e,t){void 0===t&&(t=!1),Dd((()=>{for(var r of e)"soft-navigation"!==r.entryType?o.l(r):l(r);u(),t&&n(!0)}))},d=["event","first-input"];bd(t)&&d.push("soft-navigation");var v=yd(d,c,h({},t,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40}));n=ld(e,a,Pd,t.reportAllChanges),v&&(r.onHidden((()=>{c(v.takeRecords(),!0)})),ud((()=>{s("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,sd())})))}))}}((t=>{e((e=>{if(0===e.entries.length){var t={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:e.value,loadState:td(e.navigationStartTime||0)};return Object.assign(e,{attribution:t})}var i=e.entries[0],n=o.get(i),a=n.processingStart,u=Math.max(i.startTime+i.duration,a),l=Math.min(n.processingEnd,u),h=n.entries.sort(((e,t)=>e.processingStart-t.processingStart)),c=d(i.startTime,l),v=r.v.get(i.interactionId),f={interactionTarget:s.get(v),interactionType:i.name.startsWith("key")?"keyboard":"pointer",interactionTime:i.startTime,nextPaintTime:u,processedEventEntries:h,longAnimationFrameEntries:c,inputDelay:a-i.startTime,processingDuration:l-a,presentationDelay:u-l,loadState:td(i.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{var r=e.interactionTime,i=e.nextPaintTime;if(null!=(t=e.longAnimationFrameEntries)&&t.length&&r&&i){var n,a,o=e.inputDelay,s=e.processingDuration,u=0,l=0,h=0,c=0;for(var d of e.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var f=v.startTime+v.duration;if(f>=r){var p=f-Math.max(r,v.startTime),m=v.duration?p/v.duration*v.forcedStyleAndLayoutDuration:0;u+=p-m,l+=m,p>c&&(a=r+o>v.startTime?"input-delay":r+o+s>v.startTime?"processing-duration":"presentation-delay",n=v,c=p)}}var g=e.longAnimationFrameEntries.at(-1),y=g?g.startTime+g.duration:0;y>=r+o+s&&(h=i-y),n&&a&&(e.longestScript={entry:n,subpart:a,intersectingDuration:c}),e.totalScriptDuration=u,e.totalStyleAndLayoutDuration=l,e.totalPaintDuration=h,e.totalUnattributedDuration=i-r-u-l-h}})(f),Object.assign(e,{attribution:f})})(t))}),t)},withoutAttribution:{onLCP:Cv,onCLS:dv,onFCP:hv,onINP:_v}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Mv,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Mv,s.postHogWebVitalsCallbacks=Mv;var Tv={onLCP:Cv,onCLS:dv,onFCP:hv,onINP:_v};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Tv,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Tv,s.postHogWebVitalsCallbacks=Tv,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Tv;let Iv=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(e){var t;if(!e.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),null==(t=this.t)||t.call(this,e)}}};var Ev=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Rv=e=>{if("loading"===document.readyState)return"loading";var t=Ev();if(t){if(t.domInteractive>e)return"loading";if(0===t.domContentLoadedEventStart||t.domContentLoadedEventStart>e)return"dom-interactive";if(0===t.domComplete||t.domComplete>e)return"dom-content-loaded"}return"complete"},Av=e=>{var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Lv=e=>{var t="";try{for(;9!==(null==(r=e)?void 0:r.nodeType);){var r,i=e,n=i.id?"#"+i.id:[Av(i),...Array.from(i.classList).sort()].join(".");if(t.length+n.length>99)return t||n;if(t=t?n+">"+t:n,i.id)break;e=i.parentNode}}catch(e){}return t},Ov=new WeakMap;function Fv(e,t){var r=Ov.get(t);return r||(r=new WeakMap,Ov.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var Nv,Dv=-1,Pv=()=>Dv,qv=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Dv=t.timeStamp,e(t))}),!0)},jv=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},Bv=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},Hv=()=>{var e,t;return null!==(e=null==(t=Ev())?void 0:t.activationStart)&&void 0!==e?e:0},$v=function(e,t){void 0===t&&(t=-1);var r=Ev(),i="navigate";return 0>Pv()?r&&(document.prerendering||Hv()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Uv=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(h({type:e,buffered:!0},r)),i}}catch(e){}},Wv=e=>{var t=!1;return()=>{t||(e(),t=!0)}},zv=-1,Vv=new Set,Zv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Qv=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Vv)t();isFinite(zv)||(zv="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Qv,!0))}},Gv=()=>{if(0>zv){var e,t=Hv(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;zv=null!=r?r:Zv(),addEventListener("visibilitychange",Qv,!0),addEventListener("prerenderingchange",Qv,!0),qv((()=>{setTimeout((()=>{zv=Zv()}))}))}return{get firstHiddenTime(){return zv},onHidden(e){Vv.add(e)}}},Yv=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Jv=[1800,3e3],Kv=function(e,t){void 0===t&&(t={}),Yv((()=>{var r,i=Gv(),n=$v("FCP"),a=Uv("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-Hv(),0),n.entries.push(t),r(!0)))}));a&&(r=jv(e,n,Jv,t.reportAllChanges),qv((i=>{n=$v("FCP"),r=jv(e,n,Jv,t.reportAllChanges),Bv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Xv=[.1,.25],ef=e=>e.find((e=>{var t;return 1===(null==(t=e.node)?void 0:t.nodeType)}))||e[0],tf=0,rf=1/0,nf=0,af=e=>{for(var t of e)t.interactionId&&(rf=Math.min(rf,t.interactionId),nf=Math.max(nf,t.interactionId),tf=nf?(nf-rf)/7+1:0)},of=()=>{var e;return Nv?tf:null!==(e=performance.interactionCount)&&void 0!==e?e:0},sf=0;let uf=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){sf=of(),this.l.length=0,this.h.clear()}M(){var e=Math.min(this.l.length-1,Math.floor((of()-sf)/50));return this.l[e]}u(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.h.get(e.interactionId);if(i||10>this.l.length||e.duration>r.T){var n;if(i?e.duration>i.T?(i.entries=[e],i.T=e.duration):e.duration===i.T&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.h.set((i={id:e.interactionId,entries:[e],T:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.T-e.T)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.h.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var lf=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=Wv(e),n=-1,a=()=>{r(n),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()}))}},hf=[200,500];let cf=class{constructor(){this.m=void 0}u(e){var t;null==(t=this.m)||t.call(this,e)}};var $=[2500,4e3],df=-1,vf=e=>{addEventListener("pageshow",(t=>{t.persisted&&(df=t.timeStamp,e(t))}),!0)},ff=(e,t,r,i)=>{var n,a;return o=>{t.value>=0&&(o||i)&&((a=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},pf=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},mf=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},gf=()=>{var e,t;return null!==(e=null==(t=mf())?void 0:t.activationStart)&&void 0!==e?e:0},yf=function(e,t){void 0===t&&(t=-1);var r=mf(),i="navigate";return 0>df?r&&(document.prerendering||gf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},bf=new WeakMap;function wf(e,t){var r=bf.get(t);return r||(r=new WeakMap,bf.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class kf{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var _f,Sf=function(e,t,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return i.observe(h({type:e,buffered:!0},r)),i}}catch(e){}},xf=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Cf=-1,Mf=new Set,Tf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,If=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Mf)t();isFinite(Cf)||(Cf="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",If,!0))}},Ef=()=>{if(0>Cf){var e,t=gf(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;Cf=null!=r?r:Tf(),addEventListener("visibilitychange",If,!0),addEventListener("prerenderingchange",If,!0),vf((()=>{setTimeout((()=>{Cf=Tf()}))}))}return{get firstHiddenTime(){return Cf},onHidden(e){Mf.add(e)}}},Rf=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Af=[1800,3e3],Lf=function(e,t){void 0===t&&(t={}),Rf((()=>{var r,i=Ef(),n=yf("FCP"),a=Sf("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(a.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-gf(),0),n.entries.push(t),r(!0)))}));a&&(r=ff(e,n,Af,t.reportAllChanges),vf((i=>{n=yf("FCP"),r=ff(e,n,Af,t.reportAllChanges),pf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Of=[.1,.25],Ff=function(e,t){void 0===t&&(t={});var r=Ef();Lf(xf((()=>{var i,n=yf("CLS",0),a=wf(t,kf),o=e=>{for(var t of e)a.h(t);a.i>n.value&&(n.value=a.i,n.entries=a.o,i())},s=Sf("layout-shift",o);s&&(i=ff(e,n,Of,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),i(!0)})),vf((()=>{a.i=0,n=yf("CLS",0),i=ff(e,n,Of,t.reportAllChanges),pf(i)})),setTimeout(i))})))},Nf=0,Df=1/0,Pf=0,qf=e=>{for(var t of e)t.interactionId&&(Df=Math.min(Df,t.interactionId),Pf=Math.max(Pf,t.interactionId),Nf=Pf?(Pf-Df)/7+1:0)},jf=()=>{var e;return _f?Nf:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Bf=0;class Hf{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Bf=jf(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((jf()-Bf)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.u.get(e.interactionId);if(i||10>this.l.length||e.duration>r.L){var n;if(i?e.duration>i.L?(i.entries=[e],i.L=e.duration):e.duration===i.L&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.u.set((i={id:e.interactionId,entries:[e],L:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var a=this.l.splice(10);for(var o of a)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var $f=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=xf(e),n=-1,a=()=>{r(n),i()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",a,{capture:!0}),i()}))}},Uf=[200,500],Wf=function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Ef();Rf((()=>{var i;"interactionCount"in performance||_f||(_f=Sf("event",qf,{durationThreshold:0}));var n,a=yf("INP"),o=wf(t,Hf),s=e=>{$f((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==a.value&&(a.value=r.L,a.entries=r.entries,n())}))},u=Sf("event",s,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=ff(e,a,Uf,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),n(!0)})),vf((()=>{o.v(),a=yf("INP"),n=ff(e,a,Uf,t.reportAllChanges)})))}))}};class zf{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var Vf=[2500,4e3],Zf=function(e,t){void 0===t&&(t={}),Rf((()=>{var r,i=Ef(),n=yf("LCP"),a=wf(t,zf),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-gf(),0),n.entries=[o],r())},s=Sf("largest-contentful-paint",o);if(s){r=ff(e,n,Vf,t.reportAllChanges);var u=xf((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&($f(u),removeEventListener(e.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});vf((i=>{n=yf("LCP"),r=ff(e,n,Vf,t.reportAllChanges),pf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},Qf={onLCP(e,t){void 0===t&&(t={});var r=Fv(t=Object.assign({},t),cf),i=new WeakMap;r.m=e=>{var r=e.element;if(r){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(r))&&void 0!==n?n:Lv(r);i.set(e,a)}else e.id&&i.set(e,"#"+e.id)},function(e,t){void 0===t&&(t={}),Yv((()=>{var r,i=Gv(),n=$v("LCP"),a=Fv(t,cf),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))a.u(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Hv(),0),n.entries=[o],r())},s=Uv("largest-contentful-paint",o);if(s){r=jv(e,n,$,t.reportAllChanges);var u=Wv((()=>{o(s.takeRecords()),s.disconnect(),r(!0)})),l=e=>{e.isTrusted&&(lf(u),removeEventListener(e.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});qv((i=>{n=$v("LCP"),r=jv(e,n,$,t.reportAllChanges),Bv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))}((t=>{e((e=>{var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=e.entries.at(-1),n=r.url&&performance.getEntriesByType("resource").find((e=>e.name===r.url));t.target=i.get(r),t.lcpEntry=r,r.url&&(t.url=r.url),n&&(t.lcpResourceEntry=n);var a=Ev();if(a){var o=a.activationStart||0,s=Math.max(0,a.responseStart-o),u=Math.max(s,n?(n.requestStart||n.startTime)-o:0),l=Math.min(e.value,Math.max(u,n?n.responseEnd-o:0));t=h({},t,{timeToFirstByte:s,resourceLoadDelay:u-s,resourceLoadDuration:l-u,elementRenderDelay:e.value-l,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))}),t)},onCLS(e,t){void 0===t&&(t={});var r=Fv(t=Object.assign({},t),Iv),i=new WeakMap;r.t=e=>{var r;if(null!=e&&null!=(r=e.sources)&&r.length){var n=ef(e.sources),a=null==n?void 0:n.node;if(a){var o,s=null!==(o=null==t.generateTarget?void 0:t.generateTarget(a))&&void 0!==o?o:Lv(a);i.set(n,s)}}},function(e,t){void 0===t&&(t={});var r=Gv();Kv(Wv((()=>{var i,n=$v("CLS",0),a=Fv(t,Iv),o=e=>{for(var t of e)a.u(t);a.o>n.value&&(n.value=a.o,n.entries=a.i,i())},s=Uv("layout-shift",o);s&&(i=jv(e,n,Xv,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),i(!0)})),qv((()=>{a.o=0,n=$v("CLS",0),i=jv(e,n,Xv,t.reportAllChanges),Bv(i)})),setTimeout(i))})))}((t=>{e((e=>{var t={};if(e.entries.length){var r,n=e.entries.reduce(((e,t)=>e.value>t.value?e:t));if(null!=n&&null!=(r=n.sources)&&r.length){var a=ef(n.sources);a&&(t={largestShiftTarget:i.get(a),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:a,largestShiftEntry:n,loadState:Rv(n.startTime)})}}return Object.assign(e,{attribution:t})})(t))}),t)},onFCP(e,t){void 0===t&&(t={}),Kv((t=>{e((e=>{var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Rv(Pv())};if(e.entries.length){var r=Ev(),i=e.entries.at(-1);if(r){var n=Math.max(0,r.responseStart-(r.activationStart||0));t={timeToFirstByte:n,firstByteToFCP:e.value-n,loadState:Rv(e.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(e,{attribution:t})})(t))}),t)},onINP(e,t){void 0===t&&(t={});var r=Fv(t=Object.assign({},t),uf),i=[],n=[],a=0,o=new WeakMap,s=new WeakMap,u=!1,l=()=>{u||(lf(h),u=!0)},h=()=>{var e=new Set(r.l.map((e=>o.get(e.entries[0])))),t=n.length-10;n=n.filter(((r,i)=>i>=t||e.has(r)));var s=new Set;for(var l of n){var h=c(l.startTime,l.processingEnd);for(var d of h)s.add(d)}i=i.filter((e=>e.startTime>a||s.has(e))),u=!1};r.m=e=>{var r,i=e.startTime+e.duration;a=Math.max(a,e.processingEnd);for(var s=n.length-1;s>=0;s--){var u=n[s];if(8>=Math.abs(i-u.renderTime)){(r=u).startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||n.push(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:i,entries:!1!==t.includeProcessedEventEntries?[e]:[]}),(e.interactionId||"first-input"===e.entryType)&&o.set(e,r),l()},r.p=e=>{if(!s.get(e)){var r,i=null==(r=e.entries.find((e=>e.target)))?void 0:r.target;if(i){var n,a=null!==(n=null==t.generateTarget?void 0:t.generateTarget(i))&&void 0!==n?n:Lv(i);s.set(e,a)}else{var o,u=null==(o=e.entries.find((e=>e.targetSelector)))?void 0:o.targetSelector;u&&s.set(e,u)}}};var c=(e,t)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=e){if(n.startTime>t)break;r.push(n)}return r};Uv("long-animation-frame",(e=>{i=i.concat(e),l()})),function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Gv();Yv((()=>{var i;"interactionCount"in performance||Nv||(Nv=Uv("event",af,{durationThreshold:0}));var n,a=$v("INP"),o=Fv(t,uf),s=e=>{lf((()=>{for(var t of e)o.u(t);var r=o.M();r&&r.T!==a.value&&(a.value=r.T,a.entries=r.entries,n())}))},u=Uv("event",s,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=jv(e,a,hf,t.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{s(u.takeRecords()),n(!0)})),qv((()=>{o.v(),a=$v("INP"),n=jv(e,a,hf,t.reportAllChanges)})))}))}}((t=>{e((e=>{var t=e.entries[0],i=o.get(t),n=t.processingStart,a=Math.max(t.startTime+t.duration,n),u=Math.min(i.processingEnd,a),l=i.entries.sort(((e,t)=>e.processingStart-t.processingStart)),h=c(t.startTime,u),d=r.h.get(t.interactionId),v={interactionTarget:s.get(d),interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:h,inputDelay:n-t.startTime,processingDuration:u-n,presentationDelay:a-u,loadState:Rv(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((e,t)=>{if(null!=(t=e.longAnimationFrameEntries)&&t.length){var r,i,n=e.interactionTime,a=e.inputDelay,o=e.processingDuration,s=0,u=0,l=0,h=0;for(var c of e.longAnimationFrameEntries)for(var d of(u=u+c.startTime+c.duration-c.styleAndLayoutStart,c.scripts)){var v=d.startTime+d.duration;if(v>=n){var f=v-Math.max(n,d.startTime),p=d.duration?f/d.duration*d.forcedStyleAndLayoutDuration:0;s+=f-p,u+=p,f>h&&(i=n+a>d.startTime?"input-delay":n+a+o>d.startTime?"processing-duration":"presentation-delay",r=d,h=f)}}var m=e.longAnimationFrameEntries.at(-1),g=m?m.startTime+m.duration:0;g>=n+a+o&&(l=e.nextPaintTime-g),r&&i&&(e.longestScript={entry:r,subpart:i,intersectingDuration:h}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=u,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-u-l}})(v),Object.assign(e,{attribution:v})})(t))}),t)},withoutAttribution:{onLCP:Zf,onCLS:Ff,onFCP:Lf,onINP:Wf}};s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=Qf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Qf,s.postHogWebVitalsCallbacks=Qf;var Gf={onLCP:Zf,onCLS:Ff,onFCP:Lf,onINP:Wf};function Yf(e,t){return t.length>e?t.slice(0,e)+"...":t}function Jf(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!ze(t));return t}function Kf(t,r){var i,n,a=r.e,o=r.maskAllElementAttributes,s=r.maskAllText,u=r.elementAttributeIgnoreList,l=r.disableCaptureUrlHashes;if(!ze(t))return{props:{}};for(var c=[t],d=new Set([t]),v=t;v.parentNode&&!Ve(v,"body")&&Qe>c.length;)if(Ze(v.parentNode)){var f=v.parentNode.host;if(d.has(f))break;d.add(f),c.push(f),v=f}else{if(!ze(v.parentNode))break;if(d.has(v.parentNode))break;d.add(v.parentNode),c.push(v.parentNode),v=v.parentNode}var p,m,g=[],y={},b=!1,k=!1;if(Fe(c,(e=>{var t=it(e);if(Ve(e,"a")){var r=e.getAttribute("href");b=!!(t&&r&&dt(r))&&(l?ve(r):r)}w(Ye(e),"ph-no-capture")&&(k=!0),g.push(function(e,t,r,i,n){void 0===n&&(n=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};Ke.indexOf(a)>-1&&!r&&(o.$el_text="a"===a.toLowerCase()||"button"===a.toLowerCase()?Yf(1024,vt(e)):Yf(1024,Je(e)));var s=Ye(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Fe(e.attributes,(function(r){var a;if((!nt(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&dt(r.value)&&(!E(a=r.name)||"_ngcontent"!==a.substring(0,10)&&"_nghost"!==a.substring(0,7))){var s=r.value;"class"===r.name&&(s=Ge(s).join(" ")),o["attr__"+r.name]=Yf(1024,"href"===r.name&&n?ve(s):s)}}));for(var u=1,l=1,h=e;h=Jf(h);)u++,h.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,o,s,u,l));var i=function(e){if(!it(e))return{};var t={};return Fe(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&dt(i)&&(t[r]=i)}})),t}(e);Ne(y,i)})),k)return{props:{},explicitNoCapture:k};if(s||(g[0].$el_text=Ve(t,"a")||Ve(t,"button")?vt(t):Je(t)),b){var _,S;g[0].attr__href=b;var x=null==(_=je(b))?void 0:_.host,C=null==e||null==(S=e.location)?void 0:S.host;x&&C&&x!==C&&(p=b)}return{props:Ne({$event_type:a.type,$ce_version:1},{$elements:g},{$elements_chain:(m=g,function(e){return e.map((e=>{var t,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))i+="."+n.replace(/"/g,"");var a=h({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return De(a).sort(((e,t)=>e[0].localeCompare(t[0]))).forEach((e=>{var t=e[1];return o[pt(e[0].toString())]=pt(t.toString())})),(i+=":")+De(o).map((e=>e[0]+'="'+e[1]+'"')).join("")})).join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:mt(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return De(e).filter((e=>0===e[0].indexOf("attr__"))).forEach((e=>i.attributes[e[0]]=e[1])),i}))}(m)))},null!=(i=g[0])&&i.$el_text?{$el_text:null==(n=g[0])?void 0:n.$el_text}:{},p&&"click"===a.type?{$external_click_url:p}:{},y)}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},s.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Gf,s.__PosthogExtensions__.postHogWebVitalsCallbacks=Gf,s.postHogWebVitalsCallbacks=Gf,s.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Gf,Oe("[AutoCapture]");var Xf={};function ep(t,r){var i=Xf[t];if(i)return i;var n=r[t];if((e=>M(e)&&-1!==e.toString().indexOf("[native code]"))(n)&&(null==e||!e.Zone))return Xf[t]=n.bind(r);var a=r.document;if(a&&M(a.createElement)){var o,s=!1;try{(o=a.createElement("iframe")).hidden=!0,a.head.appendChild(o);var u,l,h=o.contentWindow;h&&h[t]&&(n=h[t],"MutationObserver"===t&&function(e){return w(e,"AppleWebKit")&&!w(e,"Chrome")}(null!==(u=null==(l=r.navigator)?void 0:l.userAgent)&&void 0!==u?u:"")&&(o.classList.add("rr-block","ph-no-capture"),s=!0))}catch(e){Le.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var c;!s&&null!=(c=o)&&c.parentNode&&o.parentNode.removeChild(o)}}return n&&M(n)?Xf[t]=n.bind(r):n}function tp(e,t){var r=function(e){var t;return I(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}(e);return r?h({node:r,originalEvent:e,timestamp:Date.now()},t):null}function rp(e,t){return Math.abs(e)<Math.abs(t)?0>t?"up":"down":0>e?"left":"right"}function ip(e){return"swipe"===e.type?"$dead_swipe":"$dead_click"}var np="canvas,video,audio,embed,object",ap=1e3;function op(e,t){return O(e)&&e>=t}function sp(e){return e>=0&&ap>e?e:void 0}function up(e,t){return t?sp(e-t):void 0}class lp{mi(e){var t,r,i,n,a,o,s,u,l=this.gi((null==e?void 0:e.__onCapture)||this.yi.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(a=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==a?a:l.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==e?void 0:e.capture_dead_swipes)&&void 0!==o?o:l.capture_dead_swipes,swipe_threshold_px:null!==(s=null==e?void 0:e.swipe_threshold_px)&&void 0!==s?s:l.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(u=null==e?void 0:e.max_dead_swipes_per_page_load)&&void 0!==u?u:l.max_dead_swipes_per_page_load,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(e,t){this.bi=[],this.wi=0,this.gi=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:e}),this.ki=e=>{var t=tp(e,{type:"click"});A(t)||this.Si(t)||this.xi(t),this.Ci()},this.Mi=()=>{var e=Date.now();this.Ti=e,e%50==0&&this.bi.forEach((t=>{I(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Ii=()=>{this.Ei=Date.now()},this.It=()=>{var e=Date.now();this.Ri=e,this.Ai("visibilityChangedDelayMs",e)},this.Li=()=>{var e=Date.now();this.Oi=e,this.Ai("focusChangedDelayMs",e)},this.Fi=e=>{var t=e.touches,r=1===(null==t?void 0:t.length)?t[0]:void 0;this.Ni=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.Di=()=>{this.Ni=void 0},this.Pi=e=>{var t,r=this.Ni;if(this.Ni=void 0,!I(r)&&this.qi.max_dead_swipes_per_page_load>this.wi){var n=e,a=null==(t=n.changedTouches)?void 0:t[0];if(a){var o=a.clientX-r.x,s=a.clientY-r.y,u=o*o+s*s,l=this.qi.swipe_threshold_px;if(u>=l*l&&![this.Ti,this.ji,this.Ei].some((e=>O(e)&&e>=r.timestamp))){var h;if(this.Bi()&&(null!==(h=null==i||null==i.elementsFromPoint?void 0:i.elementsFromPoint(r.x,r.y))&&void 0!==h?h:[]).some((e=>null==e.matches?void 0:e.matches(np))))return;var c=tp(n,{type:"swipe",swipeDirection:rp(o,s),swipeDistancePx:Math.round(Math.sqrt(u))});A(c)||this.Si(c)||this.xi(c),this.Ci()}}}},this.instance=e,this.qi=this.mi(t),this._onCapture=this.qi.__onCapture}start(e){this.Hi(),this.$i(),this.Ui(),this.Wi(),this.zi(),this.Vi(e),this.qi.capture_dead_swipes&&this.Zi()}Vi(e){if(!this.Qi){var t=function(e){return ep("MutationObserver",e)}(s);this.Qi=new t((e=>{this.Gi(e)})),this.Qi.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Qi)||e.disconnect(),this.Qi=void 0,s.removeEventListener("click",this.ki),s.removeEventListener("scroll",this.Mi,{capture:!0}),s.removeEventListener("selectionchange",this.Ii),s.removeEventListener("touchstart",this.Fi,{capture:!0}),s.removeEventListener("touchend",this.Pi,{capture:!0}),s.removeEventListener("touchcancel",this.Di,{capture:!0}),null==i||i.removeEventListener("visibilitychange",this.It),s.removeEventListener("blur",this.Li),s.removeEventListener("focus",this.Li),this.Ni=void 0}Gi(e){this.ji=Date.now()}Hi(){Pe(s,"click",this.ki)}xi(e){e.visibilityChangedDelayMs=up(e.timestamp,this.Ri),e.focusChangedDelayMs=up(e.timestamp,this.Oi),this.bi.push(e)}Ci(){this.bi.length&&I(this.Yi)&&(this.Yi=s.setTimeout((()=>{this.Ji()}),1e3))}$i(){Pe(s,"scroll",this.Mi,{capture:!0})}Ui(){Pe(s,"selectionchange",this.Ii)}Wi(){Pe(i,"visibilitychange",this.It)}zi(){Pe(s,"blur",this.Li),Pe(s,"focus",this.Li)}Ai(e,t){this.bi.forEach((r=>{var i=sp(t-r.timestamp);O(i)&&(I(r[e])||r[e]>i)&&(r[e]=i)}))}Zi(){Pe(s,"touchstart",this.Fi,{capture:!0,passive:!0}),Pe(s,"touchend",this.Pi,{capture:!0,passive:!0}),Pe(s,"touchcancel",this.Di,{capture:!0,passive:!0})}Bi(){var e=I(this.Ki)||O(this.ji)&&this.ji>this.Ki;return(I(this.Xi)||e)&&(this.Ki=Date.now(),this.Xi=!(null==i||!i.querySelector(np))),!!this.Xi}Si(e){return!e||("swipe"===e.type?this.en(e):this.tn(e))}en(t){if((r=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===r.id||null!=r.closest&&r.closest(".toolbar-global-fade-container")))return!0;var r,i=this.bi.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!i&&!Ve(t.node,"html")&&ze(t.node)&&function(t,r){var i;if(!e||tt(t))return!1;var n=F(r)?et:null!==(i=null==r?void 0:r.css_selector_ignorelist)&&void 0!==i?i:et;return!function(e,t){if(I(t))return!0;var r,i=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}(rt(t).targetElementList,n)}(t.node,{css_selector_ignorelist:this.qi.css_selector_ignorelist}))}tn(t){return!(this.qi.capture_clicks_with_modifier_keys||(r=t.originalEvent,!(r.ctrlKey||r.metaKey||r.altKey||r.shiftKey)))||!!this.en(t)||(i=t.node,!(!e||tt(i))&&rt(i).targetElementList.some((e=>Ve(e,"a"))));var r,i}Ji(){if(this.bi.length){clearTimeout(this.Yi),this.Yi=void 0;var e=this.bi;for(var t of(this.bi=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.ji&&this.ji>=t.timestamp?this.ji-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Ei&&this.Ei>=t.timestamp?this.Ei-t.timestamp:void 0;var i=op(t.scrollDelayMs,this.qi.scroll_threshold_ms),n=op(t.selectionChangedDelayMs,this.qi.selection_change_threshold_ms),a=op(t.mutationDelayMs,this.qi.mutation_threshold_ms),o=op(t.absoluteDelayMs,1.1*this.qi.mutation_threshold_ms),s=O(t.scrollDelayMs)&&this.qi.scroll_threshold_ms>t.scrollDelayMs,u=O(t.mutationDelayMs)&&this.qi.mutation_threshold_ms>t.mutationDelayMs,l=O(t.selectionChangedDelayMs)&&this.qi.selection_change_threshold_ms>t.selectionChangedDelayMs,h=O(t.visibilityChangedDelayMs),c=O(t.focusChangedDelayMs);if(!(s||u||l||h||c))if(i||a||o||n){var d=ip(t);if("$dead_swipe"===d){if(this.wi>=this.qi.max_dead_swipes_per_page_load)continue;this.wi++}this._onCapture(t,{[d+"_last_mutation_timestamp"]:this.ji,[d+"_event_timestamp"]:t.timestamp,[d+"_scroll_timeout"]:i,[d+"_mutation_timeout"]:a,[d+"_absolute_timeout"]:o,[d+"_selection_changed_timeout"]:n,[d+"_visibility_changed_timeout"]:!1})}else this.qi.mutation_threshold_ms>t.absoluteDelayMs&&this.bi.push(t)}this.Ci()}}yi(e,t){var r=ip(e);this.instance.capture(r,h({},t,Kf(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qi.element_attribute_ignorelist,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:e.scrollDelayMs,[r+"_mutation_delay_ms"]:e.mutationDelayMs,[r+"_absolute_delay_ms"]:e.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:e.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:e.visibilityChangedDelayMs,[r+"_focus_changed_delay_ms"]:e.focusChangedDelayMs,$dead_swipe_direction:e.swipeDirection,$dead_swipe_distance_px:e.swipeDistancePx}),{timestamp:new Date(e.timestamp)})}}s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new lp(e,t)}();
2
2
  //# sourceMappingURL=all-external-dependencies.js.map