@v-tilt/browser 1.12.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.chat.js +2 -0
- package/dist/array.chat.js.map +1 -0
- package/dist/array.chat.no-external.js +2 -0
- package/dist/array.chat.no-external.js.map +1 -0
- package/dist/array.full.chat.js +2 -0
- package/dist/array.full.chat.js.map +1 -0
- package/dist/array.full.chat.no-external.js +2 -0
- package/dist/array.full.chat.no-external.js.map +1 -0
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +2 -0
- package/dist/array.full.no-external.js.map +1 -0
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/entrypoints/all-external-dependencies.d.ts +10 -3
- package/dist/entrypoints/array.chat.d.ts +10 -0
- package/dist/entrypoints/array.chat.no-external.d.ts +6 -0
- package/dist/entrypoints/array.full.chat.d.ts +13 -0
- package/dist/entrypoints/array.full.chat.no-external.d.ts +7 -0
- package/dist/entrypoints/array.full.d.ts +5 -9
- package/dist/entrypoints/array.full.no-external.d.ts +12 -0
- package/dist/entrypoints/module.chat.es.d.ts +7 -0
- package/dist/entrypoints/module.full.chat.es.d.ts +12 -0
- package/dist/entrypoints/module.full.es.d.ts +12 -0
- package/dist/entrypoints/module.no-external.es.d.ts +1 -0
- package/dist/extensions/chat/bubble-drag.d.ts +20 -5
- package/dist/extensions/chat/chat-wrapper.d.ts +8 -2
- package/dist/extensions/chat/chat.d.ts +21 -221
- package/dist/extensions/chat/controller/__tests__/fakes/ably-realtime-fake.d.ts +84 -0
- package/dist/extensions/chat/controller/ably-client.d.ts +160 -0
- package/dist/extensions/chat/controller/ably-handlers.d.ts +95 -0
- package/dist/extensions/chat/controller/ably-token.d.ts +67 -0
- package/dist/extensions/chat/controller/chat-controller.d.ts +194 -0
- package/dist/extensions/chat/controller/message-delivery-status.d.ts +6 -0
- package/dist/extensions/chat/controller/message-order.d.ts +12 -0
- package/dist/extensions/chat/controller/message-stream.d.ts +49 -0
- package/dist/extensions/chat/lib/bubble-offset.d.ts +18 -0
- package/dist/extensions/chat/lib/merge-chat-config.d.ts +3 -0
- package/dist/extensions/chat/normalize-send-content.d.ts +2 -0
- package/dist/extensions/chat/outbox/message-delivery.d.ts +17 -0
- package/dist/extensions/chat/outbox/message-outbox.d.ts +57 -0
- package/dist/extensions/chat/store/chat-store.d.ts +122 -0
- package/dist/extensions/chat/types.d.ts +1 -19
- package/dist/extensions/chat/ui/ChannelItem.d.ts +12 -0
- package/dist/extensions/chat/ui/ChannelListView.d.ts +14 -0
- package/dist/extensions/chat/ui/ChatBubble.d.ts +14 -0
- package/dist/extensions/chat/ui/ChatHeader.d.ts +13 -0
- package/dist/extensions/chat/ui/ChatPanel.d.ts +14 -0
- package/dist/extensions/chat/ui/ChatRoot.d.ts +31 -0
- package/dist/extensions/chat/ui/ClosedBanner.d.ts +7 -0
- package/dist/extensions/chat/ui/ConnectionBanner.d.ts +32 -0
- package/dist/extensions/chat/ui/ConversationView.d.ts +14 -0
- package/dist/extensions/chat/ui/MessageBubble.d.ts +25 -0
- package/dist/extensions/chat/ui/MessageInput.d.ts +14 -0
- package/dist/extensions/chat/ui/MessageList.d.ts +19 -0
- package/dist/extensions/chat/ui/NewMessagesPill.d.ts +13 -0
- package/dist/extensions/chat/ui/Skeletons.d.ts +14 -0
- package/dist/extensions/chat/ui/TypingBubble.d.ts +23 -0
- package/dist/extensions/chat/ui/TypingIndicator.d.ts +12 -0
- package/dist/extensions/chat/ui/WidgetSlot.d.ts +20 -0
- package/dist/extensions/chat/ui/hooks/use-auto-mark-read.d.ts +18 -0
- package/dist/extensions/chat/ui/hooks/use-scroll-preservation.d.ts +33 -0
- package/dist/extensions/chat/ui/icons.d.ts +18 -0
- package/dist/extensions/chat/ui/message-render.d.ts +18 -0
- package/dist/extensions/chat/ui/shadow-styles.d.ts +13 -0
- package/dist/extensions/chat/ui/utils/mobile-body-scroll-lock.d.ts +14 -0
- package/dist/extensions/chat/widget-registry.d.ts +21 -5
- package/dist/extensions/chat/widgets/collect-email.d.ts +4 -2
- package/dist/extensions/chat/widgets/escalate-to-human.d.ts +2 -1
- package/dist/external-scripts-loader.js +1 -1
- package/dist/external-scripts-loader.js.map +1 -1
- package/dist/feature.d.ts +1 -0
- package/dist/lib/merge-vtilt-config.d.ts +9 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.chat.d.ts +1788 -0
- package/dist/module.chat.js +2 -0
- package/dist/module.chat.js.map +1 -0
- package/dist/module.d.ts +48 -3
- package/dist/module.full.chat.d.ts +1792 -0
- package/dist/module.full.chat.js +2 -0
- package/dist/module.full.chat.js.map +1 -0
- package/dist/module.full.d.ts +1793 -0
- package/dist/module.full.js +2 -0
- package/dist/module.full.js.map +1 -0
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +48 -3
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/recorder.js.map +1 -1
- package/dist/snippet-stub-methods.d.ts +14 -0
- package/dist/utils/globals.d.ts +53 -27
- package/dist/utils/index.d.ts +8 -0
- package/dist/vtilt.d.ts +6 -1
- package/dist/web-vitals.js.map +1 -1
- package/package.json +4 -1
- package/dist/extensions/chat/chat-styles.d.ts +0 -27
- package/dist/extensions/chat/message-content-styles.d.ts +0 -1
- package/dist/extensions/chat/message-html.d.ts +0 -6
- package/dist/extensions/chat/message-markdown.d.ts +0 -8
- package/dist/extensions/ga4-proxy.d.ts +0 -59
- package/dist/utils/type-utils.d.ts +0 -4
- package/dist/web-vitals.d.ts +0 -81
package/dist/main.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function t(t,i,e,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void e(t)}a.done?i(l):Promise.resolve(l).then(r,n)}function i(i){return function(){var e=this,r=arguments;return new Promise(function(n,s){var o=i.apply(e,r);function a(i){t(o,n,s,a,l,"next",i)}function l(i){t(o,n,s,a,l,"throw",i)}a(void 0)})}}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},e.apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0});var r="1.12.0",n="__vt_session",s="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",l="__vt_device_id",u="__vt_anonymous_id",h="__vt_remote_config",d="__vt_distinct_id",v="__vt_user_properties",c="localStorage",f="localStorage+cookie",p="sessionStorage",g="memory",m="$initial_person_info",b="$pageview",y="$pageleave",_="$identify",w="$alias",x="$set",k="$performance_event",S="$autocapture",C="$scroll_depth",M="$snapshot",A="$snapshot_items",E="$$client_ingestion_warning",R="$current_url",T="$pathname",I="$prev_pageview_duration",P="$prev_pageview_pathname",O="$prev_pageview_url",L="$scroll_depth_pct",U="$scroll_depth_max_pct",D="$prev_pageview_scroll_depth_pct",B="undefined"!=typeof window?window:void 0,j="undefined"!=typeof globalThis?globalThis:B,z=null==j?void 0:j.navigator,N=null==j?void 0:j.document,F=null==j?void 0:j.location,q=null==j?void 0:j.fetch;B&&N&&N.createElement,null==j||j.XMLHttpRequest,null==j||j.AbortController;var H=null==z?void 0:z.userAgent,W=null!=B?B:{};class V{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!(null==N?void 0:N.currentScript))return e({token:t.token||""},t);var i=N.currentScript,r=e({token:""},t);r.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,r.script_host=i.getAttribute("data-script-host")||t.script_host,r.token=i.getAttribute("data-token")||t.token||"",r.domain=i.getAttribute("data-domain")||t.domain,r.storage=i.getAttribute("data-storage")||t.storage,r.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var n="true"===i.getAttribute("data-capture-performance");for(var s of(r.capture_performance=!!n||t.capture_performance,r.globalAttributes=e({},t.globalAttributes),Array.from(i.attributes)))s.name.startsWith("data-vt-")&&(r.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return r}getConfig(){return e({},this.config)}updateConfig(t){this.config=e({},this.config,t)}}function G(t){return"string"==typeof t}function K(t){return void 0===t}function J(t){return null==t}function X(t){return Array.isArray(t)}function Z(t){return"function"==typeof t}var Q={none:0,error:1,warn:2,info:3,debug:4},Y="[vTilt]",tt=new Set(["none","error","warn","info","debug"]);function it(){return"undefined"!=typeof console}function et(t){var i=t.length>0&&"string"==typeof t[0]?t[0]:"",e=i?t.slice(1):t;return[i?Y+":"+i:Y,...e]}var rt="warn",nt=!1;var st=null;function ot(){return st||(st={setLevel(t,i){void 0===i&&(i=!1),rt=t,i&&(nt=!0)},setLevelFromRemote(t){nt||t&&tt.has(t)&&(rt=t)},getLevel:()=>rt,isLockedByInit:()=>nt,debug(){if(!(Q[rt]<Q.debug)&&it()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.log(...et(i))}},info(){if(!(Q[rt]<Q.info)&&it()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.log(...et(i))}},warn(){if(!(Q[rt]<Q.warn)&&it()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.warn(...et(i))}},error(){if(!(Q[rt]<Q.error)&&it()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.error(...et(i))}}}),st}function at(t,i){void 0===i&&(i=!0);var e=void 0!==t.log_level||!!t.debug,r=function(t){return t.log_level&&tt.has(t.log_level)?t.log_level:t.debug?"debug":"warn"}(t);return ot().setLevel(r,i&&e),r}function lt(t,i){try{return t()}catch(t){return i}}var ut="x-api-key";function ht(t,i,e){void 0===e&&(e={});var{api_host:r,token:n}=t,s=""+(r?r.replace(/\/+$/gm,""):"")+i;if(e.includeTokenQuery&&n){var o=s.includes("?")?"&":"?";s=""+s+o+"token="+n}return s}function dt(t){return t.token?{[ut]:t.token}:{}}class vt{constructor(){this.o=new Map,this.m=new Map}on(t,i){return this.o.has(t)||this.o.set(t,new Set),this.o.get(t).add(i),()=>{var e;null===(e=this.o.get(t))||void 0===e||e.delete(i)}}once(t,i){return this.m.has(t)||this.m.set(t,new Set),this.m.get(t).add(i),()=>{var e;null===(e=this.m.get(t))||void 0===e||e.delete(i)}}emit(t,i){var e,r;null===(e=this.o.get(t))||void 0===e||e.forEach(e=>{try{e(i)}catch(i){ot().error("emitter",'error in event listener for "'+t+'":',i)}});var n=this.m.get(t);n&&(n.forEach(e=>{try{e(i)}catch(i){ot().error("emitter",'error in once listener for "'+t+'":',i)}}),this.m.delete(t)),null===(r=this.o.get("*"))||void 0===r||r.forEach(e=>{try{e({event:t,payload:i})}catch(t){ot().error("emitter","error in wildcard listener:",t)}})}off(t){t?(this.o.delete(t),this.m.delete(t)):(this.o.clear(),this.m.clear())}listenerCount(t){var i,e,r,n;return(null!==(e=null===(i=this.o.get(t))||void 0===i?void 0:i.size)&&void 0!==e?e:0)+(null!==(n=null===(r=this.m.get(t))||void 0===r?void 0:r.size)&&void 0!==n?n:0)}hasListeners(t){return this.listenerCount(t)>0}}var ct="sdk:initialized",ft="sdk:config_updated",pt="sdk:remote_config_loaded",gt="consent:updated",mt="event:captured",bt="recording:started",yt="recording:stopped",_t=0,wt=!1,xt=!1;function kt(t){(_t+=1)<2||(wt=!0,xt||(xt=!0,ot().warn(t,"vTilt network requests are being cancelled before reaching the server (likely an ad blocker, privacy extension, or DNS-level filter). Further retries and snapshots have been suspended for this page. Route SDK traffic through your own domain to avoid this — see https://www.vtilt.com/docs/browser/reverse-proxy.")))}function St(){_t=0}function Ct(){return wt}var Mt="23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function At(t){for(var i=(2<<31-Math.clz32(57))-1,e=Math.ceil(1.6*i*t/57),r="";r.length<t;)for(var n=crypto.getRandomValues(new Uint8Array(e)),s=0;s<e&&r.length<t;s++){var o=n[s]&i;o<57&&(r+=Mt[o])}return r}var $t=1048576;function Et(t,i,e){if(t)if(Array.isArray(t))t.forEach((t,r)=>{i.call(e,t,r)});else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&i.call(e,t[r],r)}function Rt(t,i,e,r){var{capture:n=!1,passive:s=!0}=null!=r?r:{};null==t||t.addEventListener(i,e,{capture:n,passive:s})}function Tt(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function It(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];for(var n of e)for(var s of n)t.push(s);return t}function Pt(t){var i={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];null!=r&&""!==r&&(i[e]=r)}return i}var Ot=[u,l,d,a],Lt=31536e3,Ut=["herokuapp.com","vercel.app","netlify.app"];function Dt(t){var i;if(!t||"undefined"==typeof document)return"";var e=null===(i=document.location)||void 0===i?void 0:i.hostname;if(!e)return"";var r=e.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return r?"."+r[0]:""}class Bt{constructor(t){var i,e,r;this.memoryStorage=new Map,this.k=null,this.method=t.method,this.cross_subdomain=null!==(i=t.cross_subdomain)&&void 0!==i?i:function(){var t;if("undefined"==typeof document)return!1;var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return!1;var e=i.split(".").slice(-2).join(".");return!Ut.includes(e)}(),this.sameSite=null!==(e=t.sameSite)&&void 0!==e?e:"Lax",this.secure=null!==(r=t.secure)&&void 0!==r?r:"undefined"!=typeof location&&"https:"===location.protocol}isLocalStorageSupported(){if(null!==this.k)return this.k;if(void 0===B||!B.localStorage)return this.k=!1,!1;try{var t="__vt_ls_test__";B.localStorage.setItem(t,"1");var i="1"===B.localStorage.getItem(t);return B.localStorage.removeItem(t),this.k=i,i||ot().warn("storage","localStorage unavailable, using cookies"),i}catch(t){return this.k=!1,ot().warn("storage","localStorage unavailable, using cookies"),!1}}isCriticalProperty(t){return Ot.includes(t)}get(t){var i;try{switch(this.method){case g:return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;case f:return this.getLocalStoragePlusCookie(t);case c:return this.getLocalStorage(t);case p:return this.readFromSessionStorage(t);default:return this.getCookie(t)}}catch(i){return ot().warn("storage",'get error for "'+t+'":',i),null}}set(t,i,e){try{switch(this.method){case g:this.memoryStorage.set(t,i);break;case f:this.setLocalStoragePlusCookie(t,i,e);break;case c:this.setLocalStorage(t,i);break;case p:this.writeToSessionStorage(t,i);break;default:this.setCookie(t,i,null!=e?e:Lt)}}catch(i){ot().warn("storage",'set error for "'+t+'":',i)}}remove(t){try{switch(this.method){case g:this.memoryStorage.delete(t);break;case f:this.removeLocalStoragePlusCookie(t);break;case c:this.removeLocalStorage(t);break;case p:this.removeFromSessionStorage(t);break;default:this.removeCookie(t)}}catch(i){ot().warn("storage",'remove error for "'+t+'":',i)}}getLocalStoragePlusCookie(t){if(this.isCriticalProperty(t)){var i=this.getCookie(t),e=this.getLocalStorage(t);if(null!==i){if(e!==i&&this.isLocalStorageSupported())try{null==B||B.localStorage.setItem(t,i)}catch(t){}return i}return null!==e?e:this.readFromSessionStorage(t)}return this.getLocalStorage(t)}setLocalStoragePlusCookie(t,i,e){this.setLocalStorage(t,i),this.isCriticalProperty(t)&&(this.setCookie(t,i,null!=e?e:Lt),this.writeToSessionStorage(t,i))}removeLocalStoragePlusCookie(t){this.removeLocalStorage(t),this.isCriticalProperty(t)&&(this.removeCookie(t),this.removeFromSessionStorage(t))}getLocalStorage(t){var i;if(!this.isLocalStorageSupported())return null;try{return null!==(i=null==B?void 0:B.localStorage.getItem(t))&&void 0!==i?i:null}catch(t){return null}}setLocalStorage(t,i){if(this.isLocalStorageSupported())try{null==B||B.localStorage.setItem(t,i)}catch(t){ot().warn("storage","localStorage write error:",t)}}removeLocalStorage(t){if(this.isLocalStorageSupported())try{null==B||B.localStorage.removeItem(t)}catch(t){}}readFromSessionStorage(t){var i;try{return null!==(i=null==B?void 0:B.sessionStorage.getItem(t))&&void 0!==i?i:null}catch(t){return null}}writeToSessionStorage(t,i){try{null==B||B.sessionStorage.setItem(t,i)}catch(t){ot().warn("storage","sessionStorage write error:",t)}}removeFromSessionStorage(t){try{null==B||B.sessionStorage.removeItem(t)}catch(t){}}getCookie(t){if("undefined"==typeof document)return null;var i=t+"=";for(var e of document.cookie.split(";")){var r=e.trim();if(r.startsWith(i))try{return decodeURIComponent(r.slice(i.length))}catch(t){return r.slice(i.length)}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var r=Dt(this.cross_subdomain),n=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite="+this.sameSite;this.secure&&(n+="; Secure"),r&&(n+="; domain="+r),document.cookie=n}}removeCookie(t){if("undefined"!=typeof document){var i=Dt(this.cross_subdomain);document.cookie=t+"=; Max-Age=0; path=/"+(i?"; domain="+i:""),document.cookie=t+"=; Max-Age=0; path=/"}}getWithExpiry(t){var i=this.get(t);if(!i)return null;try{var e=JSON.parse(i);return e.expiry&&Date.now()>e.expiry?(this.remove(t),null):e.value}catch(t){return null}}setWithExpiry(t,i,r){var n=e({value:i},r?{expiry:Date.now()+r}:{});this.set(t,JSON.stringify(n))}getJSON(t){var i=this.get(t);if(!i)return null;try{return JSON.parse(i)}catch(t){return null}}setJSON(t,i,e){this.set(t,JSON.stringify(i),e)}canUseSessionStorage(){if(void 0===B||!(null==B?void 0:B.sessionStorage))return!1;try{var t="__vt_ss_test__";return B.sessionStorage.setItem(t,"1"),B.sessionStorage.removeItem(t),!0}catch(t){return!1}}getSessionStorage(){var t;return this.canUseSessionStorage()&&null!==(t=null==B?void 0:B.sessionStorage)&&void 0!==t?t:null}setMethod(t){this.method=t}getMethod(){return this.method}}class jt{constructor(t,i){void 0===t&&(t="cookie"),this.S=!1,this.storage=new Bt({method:t,cross_subdomain:i,sameSite:"Lax"}),this.C=void 0,ot().debug("session","ctor")}hydrateFromStorage(){ot().debug("session","hydrate"),this.M()}getSessionId(){var t=this.A();return t||(t=At(16),this.$(t),this.S=!0),t}setSessionId(){var t=this.A(),i=t||At(16);return t||(this.S=!0),this.$(i),i}resetSessionId(){this.R(),this.S=!0,this.setSessionId(),this.T(At(16))}consumeSessionStart(){return!!this.S&&(this.S=!1,!0)}A(){return this.storage.get(n)}$(t){this.storage.set(n,t,1800)}R(){this.storage.remove(n)}getWindowId(){if(this.C)return this.C;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(s);if(i)return this.C=i,i}var e=At(16);return this.T(e),e}T(t){if(t!==this.C){this.C=t;var i=this.storage.getSessionStorage();i&&i.setItem(s,t)}}M(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(o),e=t.getItem(s);e&&!i?this.C=e:(e&&t.removeItem(s),this.T(At(16))),t.setItem(o,"true"),this.I()}else this.C=At(16)}I(){var t=this.storage.getSessionStorage();B&&t&&Rt(B,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(o)},{capture:!1})}updateStorageMethod(t,i){this.storage=new Bt({method:t,cross_subdomain:i,sameSite:"Lax"})}}function zt(t){if(!N)return null;var i=N.createElement("a");return i.href=t,i}function Nt(t){try{return decodeURIComponent(t).replace(/\+/g," ")}catch(i){return t.replace(/\+/g," ")}}function Ft(t){for(var i={},e=function(t){return((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"")}(t).split("&"),r=0;r<e.length;r++){var n=e[r];if(n){var s=n.indexOf("="),o=-1===s?n:n.slice(0,s);if(o){var a=Nt(o),l=-1===s?"":n.slice(s+1);i[a]=Nt(l)}}}return i}function qt(t,i){var e;return null!==(e=Ft(t)[i])&&void 0!==e?e:""}function Ht(t,i,e){if(!t||!i||!i.length)return t;for(var r=t.split("#"),n=r[0]||"",s=r[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),h=[],d=0;d<u.length;d++){var v=u[d].split("="),c=v[0],f=v.slice(1).join("=");-1!==i.indexOf(c)?h.push(c+"="+e):c&&h.push(c+(f?"="+f:""))}var p=h.join("&");return l+(p?"?"+p:"")+(s?"#"+s:"")}var Wt="_fbp",Vt="_fbc",Gt=15552e3,Kt=7776e3;function Jt(){void 0!==N&&(function(){if(Xt(Wt))return;var t=Date.now(),i=Math.floor(1e9+9e9*Math.random());Zt(Wt,"fb.1."+t+"."+i,Gt)}(),function(){if(!(null==F?void 0:F.search))return;try{var t=new URL(F.href).searchParams.get("fbclid");if(!(null==t?void 0:t.trim()))return;var i="fb.1."+Date.now()+"."+t.trim();Zt(Vt,i,Kt)}catch(t){}}())}function Xt(t){if(void 0===N||!(null==N?void 0:N.cookie))return null;var i=t+"=";for(var e of N.cookie.split(";")){var r=e.trim();if(r.startsWith(i))try{return decodeURIComponent(r.slice(i.length))}catch(t){return r.slice(i.length)}}return null}function Zt(t,i,e){if(void 0!==N){var r=void 0!==F&&"https:"===F.protocol?"; Secure":"";N.cookie=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite=Lax"+r}}var Qt="Mobile",Yt="iOS",ti="Android",ii="Tablet",ei=ti+" "+ii,ri="iPad",ni="Apple",si=ni+" Watch",oi="Safari",ai="BlackBerry",li="Samsung",ui=li+"Browser",hi=li+" Internet",di="Chrome",vi=di+" OS",ci=di+" "+Yt,fi="Internet Explorer",pi=fi+" "+Qt,gi="Opera",mi=gi+" Mini",bi="Edge",yi="Microsoft "+bi,_i="Firefox",wi=_i+" "+Yt,xi="Nintendo",ki="PlayStation",Si="Xbox",Ci=ti+" "+Qt,Mi=Qt+" "+oi,Ai="Windows",$i=Ai+" Phone",Ei="Nokia",Ri="Ouya",Ti="Generic",Ii=Ti+" "+Qt.toLowerCase(),Pi=Ti+" "+ii.toLowerCase(),Oi="Konqueror",Li="(\\d+(\\.\\d+)?)",Ui=new RegExp("Version/"+Li),Di=new RegExp(Si,"i"),Bi=new RegExp(ki+" \\w+","i"),ji=new RegExp(xi+" \\w+","i"),zi=new RegExp(ai+"|PlayBook|BB10","i"),Ni={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};function Fi(t,i){return t.toLowerCase().includes(i.toLowerCase())}var qi=(t,i)=>i&&Fi(i,ni)||function(t){return Fi(t,oi)&&!Fi(t,di)&&!Fi(t,ti)}(t),Hi=function(t,i){return i=i||"",Fi(t," OPR/")&&Fi(t,"Mini")?mi:Fi(t," OPR/")?gi:zi.test(t)?ai:Fi(t,"IE"+Qt)||Fi(t,"WPDesktop")?pi:Fi(t,ui)?hi:Fi(t,bi)||Fi(t,"Edg/")?yi:Fi(t,"FBIOS")?"Facebook "+Qt:Fi(t,"UCWEB")||Fi(t,"UCBrowser")?"UC Browser":Fi(t,"CriOS")?ci:Fi(t,"CrMo")||Fi(t,di)?di:Fi(t,ti)&&Fi(t,oi)?Ci:Fi(t,"FxiOS")?wi:Fi(t.toLowerCase(),Oi.toLowerCase())?Oi:qi(t,i)?Fi(t,Qt)?Mi:oi:Fi(t,_i)?_i:Fi(t,"MSIE")||Fi(t,"Trident/")?fi:Fi(t,"Gecko")?_i:""},Wi={[pi]:[new RegExp("rv:"+Li)],[yi]:[new RegExp(bi+"?\\/"+Li)],[di]:[new RegExp("("+di+"|CrMo)\\/"+Li)],[ci]:[new RegExp("CriOS\\/"+Li)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Li)],[oi]:[Ui],[Mi]:[Ui],[gi]:[new RegExp("(Opera|OPR)\\/"+Li)],[_i]:[new RegExp(_i+"\\/"+Li)],[wi]:[new RegExp("FxiOS\\/"+Li)],[Oi]:[new RegExp("Konqueror[:/]?"+Li,"i")],[ai]:[new RegExp(ai+" "+Li),Ui],[Ci]:[new RegExp("android\\s"+Li,"i")],[hi]:[new RegExp(ui+"\\/"+Li)],[fi]:[new RegExp("(rv:|MSIE )"+Li)],Mozilla:[new RegExp("rv:"+Li)]},Vi=function(t,i){var e=Hi(t,i),r=Wi[e];if(void 0===r)return null;for(var n=0;n<r.length;n++){var s=r[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},Gi=[[new RegExp(Si+"; "+Si+" (.*?)[);]","i"),t=>[Si,t&&t[1]||""]],[new RegExp(xi,"i"),[xi,""]],[new RegExp(ki,"i"),[ki,""]],[zi,[ai,""]],[new RegExp(Ai,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[$i,""];if(new RegExp(Qt).test(i)&&!/IEMobile\b/.test(i))return[Ai+" "+Qt,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var r=e[1],n=Ni[r]||"";return/arm/i.test(i)&&(n="RT"),[Ai,n]}return[Ai,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[Yt,i.join(".")]}return[Yt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var i="";return t&&t.length>=3&&(i=void 0===t[2]?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+ti+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ti+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[ti,i.join(".")]}return[ti,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var i=["Mac OS X",""];if(t&&t[1]){var e=[t[1],t[2],t[3]||"0"];i[1]=e.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[vi,""]],[/Linux|debian/i,["Linux",""]]],Ki=function(t){return ji.test(t)?xi:Bi.test(t)?ki:Di.test(t)?Si:new RegExp(Ri,"i").test(t)?Ri:new RegExp("("+$i+"|WPDesktop)","i").test(t)?$i:/iPad/.test(t)?ri:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?si:zi.test(t)?ai:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ei,"i").test(t)?Ei:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Qt).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?ti:ei:ti:new RegExp("(pda|"+Qt+")","i").test(t)?Ii:new RegExp(ii,"i").test(t)&&!new RegExp(ii+" pc","i").test(t)?Pi:""},Ji="https?://(.*)",Xi=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Zi=It(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Xi),Qi="<masked>";function Yi(t,i){var e=Zi.concat([]),r=Tt({},function(t){var i={};return Et(Ft(t),function(t,e){"string"==typeof e&&e.startsWith("utm_")&&t&&(i[e]=t)}),i}(t));return Et(e,function(i){if(i.startsWith("utm_")){if(!(i in r)){var e=qt(t,i);r[i]=e||null}}else{var n=qt(t,i);r[i]=n||null}}),r}function te(t){var i=function(t){return t?0===t.search(Ji+"google.([^/?]*)")?"google":0===t.search(Ji+"bing.com")?"bing":0===t.search(Ji+"yahoo.com")?"yahoo":0===t.search(Ji+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",r={};if(!function(t){return null===t}(i)){r.$search_engine=i;var n=N?qt(N.referrer,e):"";n.length&&(r.ph_keyword=n)}return r}function ie(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function ee(){return(null==N?void 0:N.referrer)||"$direct"}function re(){var t;return(null==N?void 0:N.referrer)&&(null===(t=zt(N.referrer))||void 0===t?void 0:t.host)||"$direct"}function ne(t){var i=function(t){var i,{r:e,u:r}=t,n={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=zt(e))||void 0===i?void 0:i.host};if(r){n.$current_url=r;var s=zt(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname,Tt(n,Yi(r))}return e&&Tt(n,te(e)),n}(t),e={};return Et(i,function(t,i){var r;e["$initial_"+(r=String(i),r.startsWith("$")?r.substring(1):r)]=t}),e}function se(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function oe(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function ae(t,i){if(!H)return{};var e,n,s,o=t?It([],Xi,i||[]):[],[a,l]=function(t){for(var i=0;i<Gi.length;i++){var[e,r]=Gi[i],n=e.exec(t);if(n){var s="function"==typeof r?r(n,t):r;if(s)return s}}return["",""]}(H),u=Xt(Wt)||void 0,h=Xt(Vt)||void 0;return Tt(Pt({$os:a,$os_version:l,$browser:Hi(H,navigator.vendor),$device:Ki(H),$device_type:(n=H,s=Ki(n),s===ri||s===ei||"Kobo"===s||"Kindle Fire"===s||s===Pi?ii:s===xi||s===Si||s===ki||s===Ri?"Console":s===si?"Wearable":s?Qt:"Desktop"),$timezone:se(),$timezone_offset:oe(),$fb_browser_id:u,$fb_click_id:h}),{$current_url:Ht(null==F?void 0:F.href,o,Qi),$host:null==F?void 0:F.host,$pathname:null==F?void 0:F.pathname,$raw_user_agent:H.length>1e3?H.substring(0,997)+"...":H,$browser_version:Vi(H,navigator.vendor),$browser_language:ie(),$browser_language_prefix:(e=ie(),"string"==typeof e?e.split("-")[0]:void 0),$screen_height:null==B?void 0:B.screen.height,$screen_width:null==B?void 0:B.screen.width,$viewport_height:null==B?void 0:B.innerHeight,$viewport_width:null==B?void 0:B.innerWidth,$lib:"web",$lib_version:r,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10)})}class le{constructor(t,i){void 0===t&&(t="localStorage"),this.P=!1,this.storage=new Bt({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.generateEphemeralIdentity(),ot().debug("user","ctor","ephemeral identity only")}hydrateFromStorage(){ot().debug("user","hydrate start"),this.userIdentity=this.loadUserIdentity();var t=this.userIdentity.anonymous_id,i=this.userIdentity.distinct_id;ot().debug("user","hydrate done","anonymous_id",t?t.slice(0,12)+"...":"n/a","distinct_id",i?i.slice(0,12)+"...":"null")}generateEphemeralIdentity(){return{distinct_id:null,anonymous_id:this.generateAnonymousId(),device_id:this.generateDeviceId(),properties:{},user_state:"anonymous"}}getUserIdentity(){return e({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){var t=this.userIdentity.anonymous_id;return t||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(u,this.userIdentity.anonymous_id,Lt),ot().debug("user","getAnonymousId generated (was missing)",this.userIdentity.anonymous_id.slice(0,12)+"..."),this.userIdentity.anonymous_id)}getUserProperties(){return e({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}consumeFirstVisit(){return!!this.P&&(this.P=!1,!0)}applyUpdate(t){if(void 0!==t.distinct_id&&(this.userIdentity.distinct_id=t.distinct_id),void 0!==t.user_state&&(this.userIdentity.user_state=t.user_state),void 0!==t.device_id&&(this.userIdentity.device_id=t.device_id),t.properties_set&&(this.userIdentity.properties=e({},this.userIdentity.properties,t.properties_set)),t.properties_set_once)for(var i of Object.keys(t.properties_set_once))i in this.userIdentity.properties||(this.userIdentity.properties[i]=t.properties_set_once[i]);this.saveUserIdentity()}reset(t){this.userIdentity={distinct_id:null,anonymous_id:this.generateAnonymousId(),device_id:t?this.generateDeviceId():this.userIdentity.device_id,properties:{$last_vtilt_reset:(new Date).toISOString()},user_state:"anonymous"},this.saveUserIdentity()}set_initial_person_info(t,i){if(!this.getStoredUserProperties()[m]){var e=function(t,i){var e=t?It([],Xi,i||[]):[],r=null==F?void 0:F.href.substring(0,1e3);return{r:ee().substring(0,1e3),u:r?Ht(r,e,Qi):void 0}}(t,i);this.register_once({[m]:e},void 0)}}get_initial_props(){var t=this.getStoredUserProperties()[m];return t?ne(t):{}}update_referrer_info(){var t={$referrer:ee(),$referring_domain:re()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(u),i=this.storage.get(l),e=this.storage.get(d),r=this.storage.get(a),n=this.getStoredUserProperties(),s=t||this.generateAnonymousId(),o=i||this.generateDeviceId(),h=e||null,v=r||"anonymous";t?ot().debug("user","hydrate","loaded from storage",t.slice(0,12)+"..."):(this.P=!0,ot().debug("user","hydrate","generated new anonymous_id"));var c=s||this.generateAnonymousId();return t||this.storage.set(u,c,Lt),i||this.storage.set(l,o,Lt),r||this.storage.set(a,v,Lt),{distinct_id:h,anonymous_id:c,device_id:o,properties:n,user_state:v}}saveUserIdentity(){this.storage.set(u,this.userIdentity.anonymous_id,Lt),this.storage.set(l,this.userIdentity.device_id,Lt),this.storage.set(a,this.userIdentity.user_state,Lt),this.userIdentity.distinct_id?this.storage.set(d,this.userIdentity.distinct_id,Lt):this.storage.remove(d),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(v)||{}}setStoredUserProperties(t){this.storage.setJSON(v,t,Lt)}register_once(t,i){var e=this.getStoredUserProperties(),r=!1;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(n in e||(e[n]=t[n],r=!0));if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(s in e||(e[s]=i[s],r=!0));r&&this.setStoredUserProperties(e)}generateAnonymousId(){return"anon_"+At(16)}generateDeviceId(){return"device_"+At(16)}updateStorageMethod(t,i){this.storage=new Bt({method:t,cross_subdomain:i,sameSite:"Lax"})}}var ue=["LCP","CLS","FCP","INP"];class he{constructor(t,i){this.O=!1,this.L=!1,this.U=!1,this.D=[],this._instance=t,this.B=i}get isEnabled(){return!1!==this.B.enabled}get isStarted(){return this.O}get isLoaded(){return!!this.j}N(t){var i;if(this.j)t(this.j);else if(!this.L){this.L=!0;var e=null===(i=W.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return ot().error("feature",this.name,"loadExternalDependency not available"),void(this.L=!1);e(this._instance,this.scriptName,i=>{this.L=!1,i?ot().error("feature",this.name,"could not load "+this.scriptName+":",i):(this.j||(this.j=this.F()),t(this.j))})}}startIfEnabled(){this.isEnabled&&!this.O&&(this.O=!0,this.N(t=>this.q(t)))}q(t){}stop(){this.O=!1}updateConfig(t){this.B=e({},this.B,t)}H(t){this.U?t():this.D.push(t)}W(){if(!this.U){this.U=!0;var t=this.D;for(var i of(this.D=[],t))try{i()}catch(t){ot().error("feature",this.name,"deferred call error:",t)}}}V(){this.U=!1,this.D=[]}}class de extends he{startIfEnabledOrStop(t){if(this.isEnabled){if(this.O&&this.j)return;this.O=!0,this.N(t=>this.q(t))}else this.stop()}}var ve=9e5,ce="web-vitals";class fe extends he{static extractConfig(t){var i=t.capture_performance;return"boolean"==typeof i?{web_vitals:i}:"object"==typeof i&&null!==i?i:{web_vitals:!1}}constructor(t,i){super(t,null!=i?i:fe.extractConfig(t.getConfig())),this.name="WebVitals",this.scriptName="web-vitals",this.G=this.K()}get isEnabled(){var t=null==F?void 0:F.protocol;return("http:"===t||"https:"===t)&&!0===this.B.web_vitals}startIfEnabled(){if(this.isEnabled&&!this.O&&B){var t=this.J();t?(this.O=!0,this.j=t,this.X(t)):(this.O=!0,this.N(t=>this.q(t)))}}stop(){this.O&&(this.Z(),this.Y&&(clearTimeout(this.Y),this.Y=void 0),this.O=!1)}onConfigUpdate(t){var i=fe.extractConfig(t),e=this.isEnabled;this.B=i,e||!this.isEnabled||this.O?e&&!this.isEnabled&&this.O&&this.stop():this.startIfEnabled()}F(){var t=this.J();if(!t)throw new Error("[vTilt:web-vitals] web-vitals loaded but callbacks not registered");return t}q(t){this.X(t)}get allowedMetrics(){return this.B.web_vitals_allowed_metrics||ue}get flushTimeoutMs(){return this.B.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.B.__web_vitals_max_value;return void 0===t?ve:0===t?0:t<6e4?ve:t}K(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}J(){var t;return null===(t=W.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}X(t){var i=this.allowedMetrics,e=this.tt.bind(this);i.includes("LCP")&&t.onLCP&&t.onLCP(e),i.includes("CLS")&&t.onCLS&&t.onCLS(e,{reportAllChanges:!0}),i.includes("FCP")&&t.onFCP&&t.onFCP(e),i.includes("INP")&&t.onINP&&t.onINP(e),i.includes("TTFB")&&t.onTTFB&&t.onTTFB(e)}it(){var t;return null===(t=null==B?void 0:B.location)||void 0===t?void 0:t.href}et(){return null==F?void 0:F.pathname}tt(t){var i,r,n;try{if(!B||!N||!F)return;if(!(null==t?void 0:t.name)||void 0===(null==t?void 0:t.value))return void ot().warn(ce,"invalid metric received",t);if(this.maxAllowedValue>0&&t.value>=this.maxAllowedValue&&"CLS"!==t.name)return void ot().warn(ce,"ignoring "+t.name+" with value >= "+this.maxAllowedValue+"ms");var s=this.it(),o=this.et();if(!s)return void ot().warn(ce,"could not determine current URL");this.G.url&&this.G.url!==s&&this.Z(),this.G.url||(this.G.url=s,this.G.pathname=o),this.G.firstMetricTimestamp||(this.G.firstMetricTimestamp=Date.now());var a=this.rt(t.attribution),l=null!==(n=null===(r=(i=this._instance).getSessionId)||void 0===r?void 0:r.call(i))&&void 0!==n?n:null,u=this.nt(),h=e({},t,{attribution:a,timestamp:Date.now(),$current_url:s,$session_id:l,$window_id:u}),d=this.G.metrics.findIndex(i=>i.name===t.name);d>=0?this.G.metrics[d]=h:this.G.metrics.push(h),this.st(),this.G.metrics.length>=this.allowedMetrics.length&&this.Z()}catch(t){ot().error(ce,"error adding metric to buffer:",t)}}rt(t){if(t){var i=e({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}nt(){var t;try{return(null===(t=this._instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}st(){this.Y&&clearTimeout(this.Y),this.Y=setTimeout(()=>{this.Z()},this.flushTimeoutMs)}Z(){if(this.Y&&(clearTimeout(this.Y),this.Y=void 0),0!==this.G.metrics.length){try{var t={$pathname:this.G.pathname,$current_url:this.G.url};for(var i of this.G.metrics)t["$web_vitals_"+i.name+"_value"]=i.value,t["$web_vitals_"+i.name+"_event"]={name:i.name,value:i.value,delta:i.delta,rating:i.rating,id:i.id,navigationType:i.navigationType,attribution:i.attribution,$session_id:i.$session_id,$window_id:i.$window_id};this._instance.capture("$web_vitals",t)}catch(t){ot().error(ce,"error flushing metrics:",t)}this.G=this.K()}}}function pe(t,i,e){try{if(!(i in t))return()=>{};var r=t[i],n=e(r);return Z(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=n,()=>{t[i]=r}}catch(t){return()=>{}}}class ge{constructor(t,i){var e;this.name="HistoryAutocapture",this.O=!1,this._instance=t,this.B=i||ge.extractConfig(t.getConfig()),this.ot=(null===(e=null==B?void 0:B.location)||void 0===e?void 0:e.pathname)||""}static extractConfig(t){return{enabled:!1!==t.capture_pageview}}get isEnabled(){return!1!==this.B.enabled&&!1!==this._instance.getConfig().capture_pageview}get isStarted(){return this.O}startIfEnabled(){this.isEnabled&&!this.O&&this.lt()}stop(){this.O&&(this.ut&&(this.ut(),this.ut=void 0),this.O=!1)}onConfigUpdate(t){this.B=ge.extractConfig(t),this.isEnabled&&!this.O?this.lt():!this.isEnabled&&this.O&&this.stop()}lt(){B&&F&&(this.ot=F.pathname||"",this.ht(),this.dt(),this.O=!0,ot().info("history-autocapture","started"))}ht(){var t,i;if(null==B?void 0:B.history){var e=this;(null===(t=B.history.pushState)||void 0===t?void 0:t.__vtilt_wrapped__)||pe(B.history,"pushState",t=>function(i,r,n){e.ct(n),t.call(this,i,r,n),e.ft("pushState")}),(null===(i=B.history.replaceState)||void 0===i?void 0:i.__vtilt_wrapped__)||pe(B.history,"replaceState",t=>function(i,r,n){e.ct(n),t.call(this,i,r,n),e.ft("replaceState")})}}ct(t){var i;if(F){var e=F.pathname||"",r=null!==(i=function(t){if(!F)return null;if(null==t||""===t)return F.pathname||null;try{return new URL(String(t),F.href).pathname}catch(t){return null}}(t))&&void 0!==i?i:e;r!==e&&this._instance.tryCapturePageleave("spa_transition")}}dt(){if(!this.ut&&B){var t=()=>{this.ft("popstate")};Rt(B,"popstate",t),this.ut=()=>{null==B||B.removeEventListener("popstate",t)}}}ft(t){this.isEnabled&&this.O&<(()=>{var i,e=null===(i=null==B?void 0:B.location)||void 0===i?void 0:i.pathname;if(e&&F&&N)if(e!==this.ot){ot().debug("history-autocapture",t,e),this.ot=e;var r={navigation_type:t};this._instance.capture(b,r)}else this.ot=e})}}var me=["a","button","form","input","select","textarea","label"],be="$copy_autocapture",ye=['[id*="cookie" i]','[class*="cookie" i]','[id*="consent" i]','[class*="consent" i]','[id*="gdpr" i]','[class*="gdpr" i]','[id*="privacy-banner" i]','[class*="privacy-banner" i]','[id*="cookie-banner" i]','[class*="cookie-banner" i]','[id*="cookie-notice" i]','[class*="cookie-notice" i]',"#CybotCookiebotDialog",'[class^="CybotCookiebotDialog"]','[id^="onetrust"]','[class^="onetrust"]','[id^="cc-"]',".cc-banner",".cc-window",".cc-revoke",'[id^="cookieconsent"]','[class^="cookieconsent"]','[id^="gdpr-cookie"]','[id^="qc-cmp"]',"#termly-code-snippet-support",'[id^="iubenda"]','[id^="truste"]','[class^="truste"]',"#consent_blackbar",'[id^="didomi"]','[id^="usercentrics"]',"#uc-center-container",".klaro","#klaro","#cookiescript_injected",".cky-consent-container","#cky-consent","#cmplz-cookiebanner-container","#gdpr-cookie-message",'[class*="fs-cc"]','[class*="fc-cc"]',"[fs-cc]","[fs-cc-checkbox]",'[class*="cookie-preferences"]',"#cookie-preferences",'[role="dialog"][aria-label*="cookie" i]','[role="dialog"][aria-label*="consent" i]','[aria-describedby*="cookie" i]','[aria-label*="Cookie Preferences" i]'];function _e(t){return t.replace(/^\s+|\s+$/g,"")}function we(t,i){return t.indexOf(i)>-1}function xe(t){return 1===(null==t?void 0:t.nodeType)}function ke(t){return 3===(null==t?void 0:t.nodeType)}function Se(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Ce(t){return 11===(null==t?void 0:t.nodeType)}function Me(t){return t?_e(t).split(/\s+/):[]}function Ae(t){var i="";switch(typeof t.className){case"string":i=t.className;break;case"object":i=(t.className&&"baseVal"in t.className&&"string"==typeof t.className.baseVal?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return Me(i)}function $e(t){return J(t)?null:_e(t).split(/(\s+)/).filter(t=>Ne(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ee(t){var i,e="";if(qe(t)&&!He(t)&&t.childNodes&&t.childNodes.length)for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];ke(n)&&n.textContent&&(e+=null!==(i=$e(n.textContent))&&void 0!==i?i:"")}return _e(e)}function Re(t){var i,e="";if(t&&t.childNodes&&t.childNodes.length)for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];if(n&&"span"===(null===(i=n.tagName)||void 0===i?void 0:i.toLowerCase()))try{e=(e+" "+Ee(n)).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+Re(n)).trim())}catch(t){}}return e}function Te(t){var i=Ee(t);return Ne(i=(i+" "+Re(t)).trim())?i:""}function Ie(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!xe(i));return i}function Pe(t){var i=t.parentNode;return!(!i||!xe(i))&&i}function Oe(t){var i=null==B?void 0:B.location.href;return!!(i&&t&&t.some(t=>i.match(t)))}var Le="(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})",Ue=new RegExp("^(?:"+Le+")$"),De=new RegExp(Le),Be="\\d{3}-?\\d{2}-?\\d{4}",je=new RegExp("^("+Be+")$"),ze=new RegExp("("+Be+")");function Ne(t,i){if(void 0===i&&(i=!0),J(t))return!1;if(G(t)){if(t=_e(t),(i?Ue:De).test((t||"").replace(/[- ]/g,"")))return!1;if((i?je:ze).test(t))return!1}return!0}function Fe(t){return!!G(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function qe(t){for(var i=t;i&&i.parentNode&&!Se(i,"body");i=i.parentNode){var e=Ae(i);if(we(e,"vt-sensitive")||we(e,"vt-no-capture"))return!1}if(we(Ae(t),"vt-include"))return!0;var r=t.type||"";if(G(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(G(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function He(t){return!!(Se(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||Se(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function We(t){if(!qe(t))return null;if(Se(t,"input")){var i=t,e=(i.type||"text").toLowerCase();if("password"===e||"hidden"===e)return null;if("checkbox"===e||"radio"===e){var r={$el_value:i.checked?"true":"false"},n=function(t){var i=t.closest("label");if(i){var e=_e(i.textContent||"");if(e&&Ne(e))return $e(e)||null}if(t.id)try{var r=null===document||void 0===document?void 0:document.querySelector('label[for="'+t.id+'"]');if(r){var n=_e(r.textContent||"");if(n&&Ne(n))return $e(n)||null}}catch(t){}return null}(i);return n?r.$selected_text=n:i.value&&Ne(i.value)&&(r.$selected_text=i.value),r}var s=i.value;if(s&&Ne(s)){var o=$e(s);if(o)return{$el_value:o}}return null}if(Se(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var u=a.options[l],h={};u.value&&Ne(u.value)&&(h.$el_value=u.value);var d=u.text;if(d&&Ne(d)){var v=$e(d);v&&(h.$selected_text=v)}if(h.$el_value||h.$selected_text)return h}return null}return Se(t,"textarea"),null}function Ve(t,i,e,r,n){if(void 0===e&&(e=void 0),!B)return{capture:!1,reason:"no_window"};if(!t)return{capture:!1,reason:"no_element"};if(Se(t,"html")||!xe(t))return{capture:!1,reason:"html_element"};if((null==e?void 0:e.url_allowlist)&&!Oe(e.url_allowlist))return{capture:!1,reason:"url_allowlist_miss"};if((null==e?void 0:e.url_ignorelist)&&Oe(e.url_ignorelist))return{capture:!1,reason:"url_ignorelist_hit"};if(null==e?void 0:e.dom_event_allowlist){var s=e.dom_event_allowlist;if(s&&!s.some(t=>i.type===t))return{capture:!1,reason:"dom_event_not_allowed"}}for(var o=!1,a=[t],l=!0,u=t;u.parentNode&&!Se(u,"body");)if(Ce(u.parentNode))a.push(u.parentNode.host),u=u.parentNode.host;else{if(!(l=Pe(u)))break;if(r||me.indexOf(l.tagName.toLowerCase())>-1)o=!0;else{var h=B.getComputedStyle(l);h&&"pointer"===h.getPropertyValue("cursor")&&(o=!0)}a.push(l),u=l}if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(K(e))return!0;var r,n=function(t){if(e.some(i=>t.tagName.toLowerCase()===i))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(a,e))return{capture:!1,reason:"element_allowlist_miss"};if(!function(t,i){var e=null==i?void 0:i.css_selector_allowlist;if(K(e))return!0;var r,n=function(t){if(e.some(i=>t.matches(i)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(a,e))return{capture:!1,reason:"css_selector_allowlist_miss"};if(function(t,i){var e=null==i?void 0:i.css_selector_ignorelist,r=void 0===e?ye:e;if(0===r.length)return!1;for(var n of t)for(var s of r)try{if(n.matches(s))return!0}catch(t){}return!1}(a,e))return{capture:!1,reason:"css_selector_ignorelist_hit"};var d=B.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===i.type)return{capture:!0};var v=t.tagName.toLowerCase();switch(v){case"html":return{capture:!1,reason:"tag_html"};case"form":return(n||["submit"]).indexOf(i.type)>=0?{capture:!0}:{capture:!1,reason:"form_event_not_allowed"};case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(i.type)>=0?{capture:!0}:{capture:!1,reason:"input_event_not_allowed"};default:return o?(n||["click"]).indexOf(i.type)>=0?{capture:!0}:{capture:!1,reason:"dom_event_not_allowed"}:(n||["click"]).indexOf(i.type)>=0&&(me.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))?{capture:!0}:{capture:!1,reason:"tag_not_capturable"}}}function Ge(t,i){return i.length>t?i.slice(0,t)+"...":i}function Ke(t,i,e,r){var n=t.tagName.toLowerCase(),s={tag_name:n};me.indexOf(n)>-1&&!e&&(s.$el_text=Ge(1024,"a"===n||"button"===n?Te(t):Ee(t)));var o=Ae(t);o.length>0&&(s.classes=o.filter(t=>""!==t));for(var a=0;a<t.attributes.length;a++){var l=t.attributes[a];if((!He(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==r?void 0:r.includes(l.name))&&!i&&Ne(l.value)&&!Fe(l.name))){var u=l.value;"class"===l.name&&(u=Me(u).join(" ")),s["attr__"+l.name]=Ge(1024,u)}}for(var h=1,d=1,v=t;v=Ie(v);)h++,v.tagName===t.tagName&&d++;return s.nth_child=h,s.nth_of_type=d,s}function Je(t){if(!qe(t))return{};for(var i={},e=0;e<t.attributes.length;e++){var r=t.attributes[e];if(r.name&&0===r.name.indexOf("data-vt-capture-attribute")){var n=r.name.replace("data-vt-capture-attribute-",""),s=r.value;n&&s&&Ne(s)&&(i[n]=s)}}return i}function Xe(t){return t.replace(/"|\\"/g,'\\"')}function Ze(t){var i=t.attr__class;return i?X(i)?i:Me(i):void 0}function Qe(t){return function(t){var i=t.map(t=>{var i,r,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=e({},t.text?{text:t.text}:{},{"nth-child":null!==(i=t.nth_child)&&void 0!==i?i:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Object.entries(o).sort((t,i)=>{var[e]=t,[r]=i;return e.localeCompare(r)}).forEach(t=>{var[i,e]=t;return a[Xe(i.toString())]=Xe(String(e))}),(n+=":")+Object.entries(a).map(t=>{var[i,e]=t;return i+'="'+e+'"'}).join("")});return i.join(";")}(function(t){return t.map(t=>{var i,e,r={text:null===(i=t.$el_text)||void 0===i?void 0:i.slice(0,400),tag_name:t.tag_name,href:null===(e=t.attr__href)||void 0===e?void 0:e.slice(0,2048),attr_class:Ze(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Object.entries(t).filter(t=>{var[i]=t;return 0===i.indexOf("attr__")}).forEach(t=>{var[i,e]=t;return r.attributes[i]=e}),r})}(t))}var Ye=[25,50,75,100];function tr(t){var i;if(!t)return null;var e=t.milestones,r=!0===e||"object"==typeof e&&null!==e,n="object"==typeof e&&null!==e&&(null===(i=e.thresholds)||void 0===i?void 0:i.length)?[...e.thresholds].sort((t,i)=>t-i):[...Ye],s=!0===t.pageleave;return r||s?{milestones:r,thresholds:n,pageleave:s,scroll_root_selector:t.scroll_root_selector}:null}class ir{constructor(t){this.gt=t,this.bt=0,this.yt=new Set,this._t=null,this.wt=null,this.xt=null,this.kt=null}start(){this.stop(),this.wt=function(t){if(!B)return null;if(t){var i=Array.isArray(t)?t:[t];for(var e of i){var r=null==N?void 0:N.querySelector(e);if(r instanceof Element)return r}}return B}(this.gt.scroll_root_selector),this.wt&&(this._t=()=>this.St(),Rt(this.wt,"scroll",this._t,{passive:!0}),this.Ct(),this.kt=this.gt.onPageview(()=>this.reset()))}stop(){this.kt&&(this.kt(),this.kt=null),null!=this.xt&&B&&(B.cancelAnimationFrame(this.xt),this.xt=null),this._t&&this.wt&&(this.wt.removeEventListener("scroll",this._t,{passive:!0}),this._t=null,this.wt=null)}reset(){this.bt=0,this.yt.clear(),this.Ct()}getMaxPct(){return this.bt}St(){B&&null==this.xt&&(this.xt=B.requestAnimationFrame(()=>{this.xt=null,this.Ct()}))}Ct(){if(this.wt){var t=function(t){var i,e,r,n,s,o;if(!t)return 0;if(t===B){var a=null!==(i=B.scrollY)&&void 0!==i?i:0,l=null!==(e=B.innerHeight)&&void 0!==e?e:0,u=null==N?void 0:N.documentElement,h=null==N?void 0:N.body,d=Math.max(null!==(r=null==u?void 0:u.scrollHeight)&&void 0!==r?r:0,null!==(n=null==h?void 0:h.scrollHeight)&&void 0!==n?n:0,null!==(s=null==u?void 0:u.offsetHeight)&&void 0!==s?s:0,null!==(o=null==h?void 0:h.offsetHeight)&&void 0!==o?o:0)-l;return d<=0?100:Math.round(Math.min(100,a/d*100))}var v=t,c=v.scrollHeight-v.clientHeight;return c<=0?100:Math.round(Math.min(100,v.scrollTop/c*100))}(this.wt);if(t>this.bt&&(this.bt=t),this.gt.milestones&&this.gt.isUrlAllowed())for(var i of this.gt.thresholds)this.bt>=i&&!this.yt.has(i)&&(this.yt.add(i),this.gt.capture(C,{[L]:i,[U]:this.bt}))}}}function er(t,i){return t.indexOf(i)>-1}class rr{constructor(){this.clicks=[],this.RAGE_CLICK_THRESHOLD_PX=30,this.RAGE_CLICK_TIMEOUT_MS=1e3,this.RAGE_CLICK_CLICK_COUNT=3}isRageClick(t,i,e){if(this.clicks=this.clicks.filter(t=>e-t.timestamp<this.RAGE_CLICK_TIMEOUT_MS),this.clicks.length>0){var r=this.clicks[this.clicks.length-1];Math.sqrt(Math.pow(t-r.x,2)+Math.pow(i-r.y,2))>this.RAGE_CLICK_THRESHOLD_PX&&(this.clicks=[])}return this.clicks.push({x:t,y:i,timestamp:e}),this.clicks.length>=this.RAGE_CLICK_CLICK_COUNT}}function nr(t,i){for(var e,r,n,s,{e:o,maskAllElementAttributes:a,maskAllText:l,elementAttributeIgnoreList:u,elementsChainAsString:h,captureElementValues:d}=i,v=[t],c=t;c.parentNode&&!Se(c,"body");)Ce(c.parentNode)?(v.push(c.parentNode.host),c=c.parentNode.host):(v.push(c.parentNode),c=c.parentNode);var f,p=[],g={},m=!1,b=!1;for(var y of v){var _=qe(y);if("a"===y.tagName.toLowerCase()){var w=y.getAttribute("href");m=!!(_&&w&&Ne(w))&&w}er(Ae(y),"vt-no-capture")&&(b=!0),p.push(Ke(y,a,l,u));var x=Je(y);Object.assign(g,x)}if(b)return{props:{},explicitNoCapture:b};if(l||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?p[0].$el_text=Te(t):p[0].$el_text=Ee(t)),"change"===o.type&&d){var k=We(t);k&&(k.$el_value&&(p[0].$el_value=k.$el_value),k.$selected_text&&(p[0].$selected_text=k.$selected_text))}if(m){p[0].attr__href=m;var S=null===(e=zt(m))||void 0===e?void 0:e.host,C=null===(r=null==B?void 0:B.location)||void 0===r?void 0:r.host;S&&C&&S!==C&&(f=m)}var M=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return Object.assign({},...i)}({$event_type:o.type,$ce_version:1},h?{}:{$elements:p},{$elements_chain:Qe(p)},(null===(n=p[0])||void 0===n?void 0:n.$el_text)?{$el_text:null===(s=p[0])||void 0===s?void 0:s.$el_text}:{},f&&"click"===o.type?{$external_click_url:f}:{},g);return{props:M}}var sr=["copy","cut"];class or{static extractConfig(t){return{enabled:!1!==t.autocapture}}constructor(t,i){this.name="Autocapture",this.Mt=!1,this.At=null,this.$t=null,this.Et=null,this.Rt=new rr,this.Tt=!0,this.It=null,this.Pt=null,this.Ot=null,this.Lt=null,this.Ut=!1,this.Dt=null,this.Bt=null,this._instance=t}get B(){var t=this._instance.getConfig().autocapture;if(t===this.Pt&&this.It)return this.It;this.Pt=t;var i=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}(t)?t:{};return i.url_allowlist&&(i.url_allowlist=i.url_allowlist.map(t=>"string"==typeof t?new RegExp(t):t)),i.url_ignorelist&&(i.url_ignorelist=i.url_ignorelist.map(t=>"string"==typeof t?new RegExp(t):t)),this.It=i,i}get isEnabled(){return this.jt().enabled}get isStarted(){return this.Mt}startIfEnabled(){var{enabled:t,reason:i}=this.jt();t?this.Mt?(this.zt(),this.Nt()):(this.Ft(),this.Mt=!0,ot().info("autocapture","started; listening for click/change/submit events")):this.Mt?(ot().info("autocapture","stopping; reason:",null!=i?i:"unknown"),this.qt(),this.Mt=!1):(ot().debug("autocapture","not started; reason:",null!=i?i:"unknown"),this.Ht())}stop(){this.Mt&&(this.qt(),this.Mt=!1,ot().info("autocapture","stopped (DOM listeners detached)")),this.Ht()}getMaxScrollDepthPctForPageleave(){var t=tr(this.B.scroll_depth);return(null==t?void 0:t.pageleave)&&this.Dt?this.Dt.getMaxPct():null}onConfigUpdate(t){var i=t;"boolean"==typeof i.elementsChainAsString&&(this.Tt=i.elementsChainAsString),void 0!==i.autocapture_opt_out&&(this.At=!!i.autocapture_opt_out),this.startIfEnabled()}updateConfig(t){void 0!==t.enabled&&(this.$t=t.enabled,t.enabled&&(this.At=!1),this.startIfEnabled())}getDiagnostics(){var t,i,e,{enabled:r,reason:n}=this.jt(),s=tr(this.B.scroll_depth);return{isEnabled:r,isStarted:this.Mt,disabledReason:r?null:n,inputs:{configAutocapture:this._instance.getConfig().autocapture,isDisabledServerSide:null!==(t=this.At)&&void 0!==t&&t,userOverride:this.$t,elementsChainAsString:this.Tt,captureCopiedText:!!this.B.capture_copied_text,scrollDepthMilestones:null!==(i=null==s?void 0:s.milestones)&&void 0!==i&&i,scrollDepthPageleave:null!==(e=null==s?void 0:s.pageleave)&&void 0!==e&&e,scrollDepthListenerAttached:null!==this.Dt}}}setElementSelectors(t){this.Et=t}getElementSelectors(t){var i,e=[];return null===(i=this.Et)||void 0===i||i.forEach(i=>{var r=null==N?void 0:N.querySelectorAll(i);null==r||r.forEach(r=>{t===r&&e.push(i)})}),e}jt(){if(!1===this.$t)return{enabled:!1,reason:"user_stop_called"};if(this.At)return{enabled:!1,reason:"server_opt_out"};if(!0===this.$t)return{enabled:!0,reason:null};var t=this._instance.getConfig().autocapture;return!1===t?{enabled:!1,reason:"config_autocapture_false"}:null==t?{enabled:!1,reason:"config_autocapture_undefined"}:{enabled:!0,reason:null}}Ft(){this.Wt()?B&&N&&(this.Ot=t=>{var i=t||(null==B?void 0:B.event);if(i)try{this.Vt(i)}catch(t){ot().error("autocapture","capture handler threw",t)}},Rt(N,"submit",this.Ot,{capture:!0}),Rt(N,"change",this.Ot,{capture:!0}),Rt(N,"click",this.Ot,{capture:!0}),this.zt(),this.Nt()):ot().warn("autocapture","browser unsupported (no querySelectorAll)")}qt(){N&&(this.Ot&&(N.removeEventListener("submit",this.Ot,!0),N.removeEventListener("change",this.Ot,!0),N.removeEventListener("click",this.Ot,!0),this.Ot=null),this.Lt&&this.Ut&&(N.removeEventListener("copy",this.Lt,!0),N.removeEventListener("cut",this.Lt,!0),this.Ut=!1,this.Lt=null),this.Ht())}Nt(){var t,i=tr(this.B.scroll_depth),e=this.isEnabled&&null!==i&&null!==tr(null==(t=this.B)?void 0:t.scroll_depth);e&&!this.Dt?(this.Dt=new ir({milestones:i.milestones,pageleave:i.pageleave,thresholds:i.thresholds,scroll_root_selector:i.scroll_root_selector,capture:(t,i)=>this._instance.capture(t,i),isUrlAllowed:()=>{return t=this.B,!(!B||(null==t?void 0:t.url_allowlist)&&!Oe(t.url_allowlist)||(null==t?void 0:t.url_ignorelist)&&Oe(t.url_ignorelist));var t},onPageview:t=>(this.Bt&&this.Bt(),this.Bt=this._instance.on(mt,i=>{(null==i?void 0:i.event)===b&&t()}),()=>{var t;null===(t=this.Bt)||void 0===t||t.call(this),this.Bt=null})}),this.Dt.start(),ot().info("autocapture","scroll depth tracking started",{milestones:i.milestones,pageleave:i.pageleave})):e||this.Ht()}Ht(){this.Dt&&(this.Dt.stop(),this.Dt=null,ot().info("autocapture","scroll depth tracking stopped")),this.Bt&&(this.Bt(),this.Bt=null)}zt(){if(N){var t=!!this.B.capture_copied_text;t&&!this.Ut?(this.Lt=t=>{var i=t||(null==B?void 0:B.event);if(i)try{this.Vt(i,be)}catch(t){ot().error("autocapture","copy handler threw",t)}},Rt(N,"copy",this.Lt,{capture:!0}),Rt(N,"cut",this.Lt,{capture:!0}),this.Ut=!0):!t&&this.Ut&&this.Lt&&(N.removeEventListener("copy",this.Lt,!0),N.removeEventListener("cut",this.Lt,!0),this.Ut=!1,this.Lt=null)}}Vt(t,i){var e,r,n,s,o,a,l,u;if(void 0===i&&(i="$autocapture"),this.isEnabled)if(t.isTrusted){var h=function(t){var i;return K(t.target)?t.srcElement||null:(null===(i=t.target)||void 0===i?void 0:i.shadowRoot)?t.composedPath()[0]||null:t.target||null}(t);if(ke(h)&&(h=h.parentNode||null),"$autocapture"===i&&"click"===t.type&&t instanceof MouseEvent)this._instance.getConfig().rageclick&&(null===(e=this.Rt)||void 0===e?void 0:e.isRageClick(t.clientX,t.clientY,(new Date).getTime()))&&(ot().info("autocapture","$rageclick detected"),this.Vt(t,"$rageclick"));var d=i===be;if(h){var v=Ve(h,t,this.B,d,d?[...sr]:void 0);if(v.capture){var c=this._instance.getConfig(),{props:f,explicitNoCapture:p}=nr(h,{e:t,maskAllElementAttributes:null!==(s=c.mask_all_element_attributes)&&void 0!==s&&s,maskAllText:null!==(o=c.mask_all_text)&&void 0!==o&&o,elementAttributeIgnoreList:this.B.element_attribute_ignorelist,elementsChainAsString:this.Tt,captureElementValues:null!==(a=this.B.capture_element_values)&&void 0!==a&&a});if(p)return ot().debug("autocapture","skip: vt-no-capture class on element chain",{tag:null===(l=h.tagName)||void 0===l?void 0:l.toLowerCase()}),!1;var g=this.getElementSelectors(h);if(g&&g.length>0&&(f.$element_selectors=g),i===be){var m=$e(null===(u=null==B?void 0:B.getSelection())||void 0===u?void 0:u.toString()),b=t.type||"clipboard";if(!m)return ot().debug("autocapture","skip copy: empty selection"),!1;f.$selected_content=m,f.$copy_type=b}return this._instance.capture(i,f),!0}ot().debug("autocapture","skip:",null!==(r=v.reason)&&void 0!==r?r:"unknown",{type:t.type,tag:null===(n=h.tagName)||void 0===n?void 0:n.toLowerCase()})}else ot().debug("autocapture","skip: no event target",{type:t.type})}else ot().debug("autocapture","skip: synthetic event (isTrusted=false)",{type:t.type})}Wt(){return Z(null==N?void 0:N.querySelectorAll)}}var ar="replay";class lr extends de{constructor(t,i){super(t,i||lr.extractConfig(t.getConfig())),this.name="SessionRecording",this.scriptName="recorder"}static extractConfig(t){var i,e,r,n=t.session_recording||{};return{enabled:null!==(i=n.enabled)&&void 0!==i&&i,sampleRate:n.sampleRate,minimumDurationMs:n.minimumDurationMs,sessionIdleThresholdMs:n.sessionIdleThresholdMs,fullSnapshotIntervalMs:n.fullSnapshotIntervalMs,captureConsole:null!==(e=n.captureConsole)&&void 0!==e&&e,captureNetwork:null!==(r=n.captureNetwork)&&void 0!==r&&r,captureCanvas:n.captureCanvas,blockClass:n.blockClass,blockSelector:n.blockSelector,skipDefaultInvisibleBlocking:n.skipDefaultInvisibleBlocking,ignoreClass:n.ignoreClass,maskTextClass:n.maskTextClass,maskTextSelector:n.maskTextSelector,maskAllInputs:n.maskAllInputs,maskInputOptions:n.maskInputOptions,masking:n.masking,recordHeaders:n.recordHeaders,recordBody:n.recordBody,compressEvents:n.compressEvents,__mutationThrottlerRefillRate:n.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:n.__mutationThrottlerBucketSize}}get isEnabled(){var t,i=this._instance.getConfig(),e=null!==(t=this.B.enabled)&&void 0!==t&&t,r=!i.disable_session_recording;return!!B&&e&&r}get isStarted(){var t;return this.O&&!!(null===(t=this.j)||void 0===t?void 0:t.isStarted)}startIfEnabled(){this.startIfEnabledOrStop("recording_initialized")}startIfEnabledOrStop(t){var i;if(!this.isEnabled||!(null===(i=this.j)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.isEnabled&&e?(this.O=!0,this.N(i=>this.q(i,t)),ot().info(ar,"starting")):this.stop()}}stop(){lt(()=>{var t;null===(t=this.j)||void 0===t||t.stop(),this.O=!1})}onConfigUpdate(t){var i;this.B=lr.extractConfig(t),null===(i=this.j)||void 0===i||i.updateConfig(this.B),this.startIfEnabledOrStop("config_updated")}F(){var t,i=null===(t=W.__VTiltExtensions__)||void 0===t?void 0:t.initSessionRecording;if(!i)throw new Error("[vTilt:replay] initSessionRecording not available after script load");return i(this._instance,this.B)}q(t,i){t.start(i)}get started(){return this.isStarted}get status(){var t;return(null===(t=this.j)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.j)||void 0===t?void 0:t.sessionId)||""}stopRecording(){this.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.j)||void 0===e?void 0:e.log)?this.j.log(t,i):ot().warn(ar,"log called before recorder was ready")}updateConfig(t){var i;this.B=e({},this.B,t),null===(i=this.j)||void 0===i||i.updateConfig(this.B)}}var ur=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ur||{});ur.MouseMove,ur.MouseInteraction,ur.Scroll,ur.ViewportResize,ur.Input,ur.TouchMove,ur.MediaInteraction,ur.Drag;var hr=Uint8Array,dr=Uint16Array,vr=Int32Array,cr=new hr([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]),fr=new hr([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]),pr=new hr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gr=function(t,i){for(var e=new dr(31),r=0;r<31;++r)e[r]=i+=1<<t[r-1];var n=new vr(e[30]);for(r=1;r<30;++r)for(var s=e[r];s<e[r+1];++s)n[s]=s-e[r]<<5|r;return{b:e,r:n}},mr=gr(cr,2),br=mr.b,yr=mr.r;br[28]=258,yr[258]=28;for(var _r=gr(fr,0).r,wr=new dr(32768),xr=0;xr<32768;++xr){var kr=(43690&xr)>>1|(21845&xr)<<1;kr=(61680&(kr=(52428&kr)>>2|(13107&kr)<<2))>>4|(3855&kr)<<4,wr[xr]=((65280&kr)>>8|(255&kr)<<8)>>1}var Sr=function(t,i,e){for(var r=t.length,n=0,s=new dr(i);n<r;++n)t[n]&&++s[t[n]-1];var o,a=new dr(i);for(n=1;n<i;++n)a[n]=a[n-1]+s[n-1]<<1;if(e){o=new dr(1<<i);var l=15-i;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],h=i-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;d<=v;++d)o[wr[d]>>l]=u}else for(o=new dr(r),n=0;n<r;++n)t[n]&&(o[n]=wr[a[t[n]-1]++]>>15-t[n]);return o},Cr=new hr(288);for(xr=0;xr<144;++xr)Cr[xr]=8;for(xr=144;xr<256;++xr)Cr[xr]=9;for(xr=256;xr<280;++xr)Cr[xr]=7;for(xr=280;xr<288;++xr)Cr[xr]=8;var Mr=new hr(32);for(xr=0;xr<32;++xr)Mr[xr]=5;var Ar=Sr(Cr,9,0),$r=Sr(Mr,5,0),Er=function(t){return(t+7)/8|0},Rr=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new hr(t.subarray(i,e))},Tr=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8},Ir=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8,t[r+2]|=e>>16},Pr=function(t,i){for(var e=[],r=0;r<t.length;++r)t[r]&&e.push({s:r,f:t[r]});var n=e.length,s=e.slice();if(!n)return{t:zr,l:0};if(1==n){var o=new hr(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(t,i){return t.f-i.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],u=0,h=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=e[e[u].f<e[d].f?u++:d++],l=e[u!=h&&e[u].f<e[d].f?u++:d++],e[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;r<n;++r)s[r].s>v&&(v=s[r].s);var c=new dr(v+1),f=Or(e[h-1],c,0);if(f>i){r=0;var p=0,g=f-i,m=1<<g;for(s.sort(function(t,i){return c[i.s]-c[t.s]||t.f-i.f});r<n;++r){var b=s[r].s;if(!(c[b]>i))break;p+=m-(1<<f-c[b]),c[b]=i}for(p>>=g;p>0;){var y=s[r].s;c[y]<i?p-=1<<i-c[y]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==i&&(--c[_],++p)}f=i}return{t:new hr(c),l:f}},Or=function(t,i,e){return-1==t.s?Math.max(Or(t.l,i,e+1),Or(t.r,i,e+1)):i[t.s]=e},Lr=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new dr(++i),r=0,n=t[0],s=1,o=function(t){e[r++]=t},a=1;a<=i;++a)if(t[a]==n&&a!=i)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return{c:e.subarray(0,r),n:i}},Ur=function(t,i){for(var e=0,r=0;r<i.length;++r)e+=t[r]*i[r];return e},Dr=function(t,i,e){var r=e.length,n=Er(i+2);t[n]=255&r,t[n+1]=r>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<r;++s)t[n+s+4]=e[s];return 8*(n+4+r)},Br=function(t,i,e,r,n,s,o,a,l,u,h){Tr(i,h++,e),++n[256];for(var d=Pr(n,15),v=d.t,c=d.l,f=Pr(s,15),p=f.t,g=f.l,m=Lr(v),b=m.c,y=m.n,_=Lr(p),w=_.c,x=_.n,k=new dr(19),S=0;S<b.length;++S)++k[31&b[S]];for(S=0;S<w.length;++S)++k[31&w[S]];for(var C=Pr(k,7),M=C.t,A=C.l,E=19;E>4&&!M[pr[E-1]];--E);var R,T,I,P,O=u+5<<3,L=Ur(n,Cr)+Ur(s,Mr)+o,U=Ur(n,v)+Ur(s,p)+o+14+3*E+Ur(k,M)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&O<=L&&O<=U)return Dr(i,h,t.subarray(l,l+u));if(Tr(i,h,1+(U<L)),h+=2,U<L){R=Sr(v,c,0),T=v,I=Sr(p,g,0),P=p;var D=Sr(M,A,0);Tr(i,h,y-257),Tr(i,h+5,x-1),Tr(i,h+10,E-4),h+=14;for(S=0;S<E;++S)Tr(i,h+3*S,M[pr[S]]);h+=3*E;for(var B=[b,w],j=0;j<2;++j){var z=B[j];for(S=0;S<z.length;++S){var N=31&z[S];Tr(i,h,D[N]),h+=M[N],N>15&&(Tr(i,h,z[S]>>5&127),h+=z[S]>>12)}}}else R=Ar,T=Cr,I=$r,P=Mr;for(S=0;S<a;++S){var F=r[S];if(F>255){Ir(i,h,R[(N=F>>18&31)+257]),h+=T[N+257],N>7&&(Tr(i,h,F>>23&31),h+=cr[N]);var q=31&F;Ir(i,h,I[q]),h+=P[q],q>3&&(Ir(i,h,F>>5&8191),h+=fr[q])}else Ir(i,h,R[F]),h+=T[F]}return Ir(i,h,R[256]),h+T[256]},jr=new vr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),zr=new hr(0),Nr=function(){for(var t=new Int32Array(256),i=0;i<256;++i){for(var e=i,r=9;--r;)e=(1&e&&-306674912)^e>>>1;t[i]=e}return t}(),Fr=function(t,i,e,r,n){if(!n&&(n={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new hr(s.length+t.length);o.set(s),o.set(t,s.length),t=o,n.w=s.length}return function(t,i,e,r,n,s){var o=s.z||t.length,a=new hr(r+o+5*(1+Math.ceil(o/7e3))+n),l=a.subarray(r,a.length-n),u=s.l,h=7&(s.r||0);if(i){h&&(l[0]=s.r>>3);for(var d=jr[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new dr(32768),g=s.h||new dr(f+1),m=Math.ceil(e/3),b=2*m,y=function(i){return(t[i]^t[i+1]<<m^t[i+2]<<b)&f},_=new vr(25e3),w=new dr(288),x=new dr(32),k=0,S=0,C=s.i||0,M=0,A=s.w||0,E=0;C+2<o;++C){var R=y(C),T=32767&C,I=g[R];if(p[T]=I,g[R]=T,A<=C){var P=o-C;if((k>7e3||M>24576)&&(P>423||!u)){h=Br(t,l,0,_,w,x,S,M,E,C-E,h),M=k=S=0,E=C;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)x[O]=0}var L=2,U=0,D=c,B=T-I&32767;if(P>2&&R==y(C-B))for(var j=Math.min(v,P)-1,z=Math.min(32767,C),N=Math.min(258,P);B<=z&&--D&&T!=I;){if(t[C+L]==t[C+L-B]){for(var F=0;F<N&&t[C+F]==t[C+F-B];++F);if(F>L){if(L=F,U=B,F>j)break;var q=Math.min(B,F-2),H=0;for(O=0;O<q;++O){var W=C-B+O&32767,V=W-p[W]&32767;V>H&&(H=V,I=W)}}}B+=(T=I)-(I=p[T])&32767}if(U){_[M++]=268435456|yr[L]<<18|_r[U];var G=31&yr[L],K=31&_r[U];S+=cr[G]+fr[K],++w[257+G],++x[K],A=C+L,++k}else _[M++]=t[C],++w[t[C]]}}for(C=Math.max(C,A);C<o;++C)_[M++]=t[C],++w[t[C]];h=Br(t,l,u,_,w,x,S,M,E,C-E,h),u||(s.r=7&h|l[h/8|0]<<3,h-=7,s.h=g,s.p=p,s.i=C,s.w=A)}else{for(C=s.w||0;C<o+u;C+=65535){var J=C+65535;J>=o&&(l[h/8|0]=u,J=o),h=Dr(l,h+1,t.subarray(C,J))}s.i=o}return Rr(a,0,r+Er(h)+n)}(t,null==i.level?6:i.level,null==i.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+i.mem,e,r,n)},qr=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function Hr(t,i){i||(i={});var e=function(){var t=-1;return{p:function(i){for(var e=t,r=0;r<i.length;++r)e=Nr[255&e^i[r]]^e>>>8;t=e},d:function(){return~t}}}(),r=t.length;e.p(t);var n,s=Fr(t,i,10+((n=i).filename?n.filename.length+1:0),8),o=s.length;return function(t,i){var e=i.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=i.level<2?4:9==i.level?2:0,t[9]=3,0!=i.mtime&&qr(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var r=0;r<=e.length;++r)t[r+10]=e.charCodeAt(r)}}(s,i),qr(s,o-8,e.d()),qr(s,o-4,r),s}var Wr="undefined"!=typeof TextEncoder&&new TextEncoder,Vr="undefined"!=typeof TextDecoder&&new TextDecoder;try{Vr.decode(zr,{stream:!0})}catch(t){}var Gr="vtilt-bubble-pos";function Kr(t,i,e){var r=t.getBoundingClientRect(),n=r.left-i,s=r.top-e,o=window.innerWidth-t.offsetWidth-n,a=-n,l=window.innerHeight-t.offsetHeight-s,u=-s;return{x:Math.min(Math.max(i,a),o),y:Math.min(Math.max(e,u),l)}}function Jr(t,i,e){t.style.transform="translate3d("+i+"px, "+e+"px, 0)"}function Xr(t,i){var e=t,r=0,n=0,s=0,o=0,a=0,l=0,u=!1,h=!1,d=function(){try{var t=localStorage.getItem(Gr);if(!t)return null;var i=JSON.parse(t);if("number"==typeof i.x&&"number"==typeof i.y)return i}catch(t){}return null}();if(d){r=d.x,n=d.y;var v=t.style.transition;t.style.transition="none",Jr(t,r,n);var c=Kr(t,r,n);r=c.x,n=c.y,Jr(t,r,n),t.offsetHeight,t.style.transition=v}e.style.cursor="grab",e.style.touchAction="none";var f=i=>{0===i.button&&(u=!0,h=!1,s=i.clientX,o=i.clientY,a=r,l=n,e.setPointerCapture(i.pointerId),e.style.cursor="grabbing",t.style.transition="none")},p=i=>{if(u){var e=i.clientX-s,d=i.clientY-o;if(!(!h&&Math.abs(e)<5&&Math.abs(d)<5)){h=!0;var v={x:a+e,y:l+d},c=Kr(t,v.x,v.y);r=c.x,n=c.y,Jr(t,r,n)}}},g=()=>{u&&(u=!1,e.style.cursor="grab",t.style.transition="",h&&function(t){try{localStorage.setItem(Gr,JSON.stringify(t))}catch(t){}}({x:r,y:n}))},m=t=>{h&&(t.stopPropagation(),t.preventDefault(),h=!1)},b=()=>{var i=Kr(t,r,n);r=i.x,n=i.y,Jr(t,r,n)};return e.addEventListener("pointerdown",f),e.addEventListener("pointermove",p),e.addEventListener("pointerup",g),e.addEventListener("pointercancel",g),e.addEventListener("click",m,!0),window.addEventListener("resize",b),{destroy(){e.removeEventListener("pointerdown",f),e.removeEventListener("pointermove",p),e.removeEventListener("pointerup",g),e.removeEventListener("pointercancel",g),e.removeEventListener("click",m,!0),window.removeEventListener("resize",b)}}}var Zr="chat";class Qr extends he{constructor(t,i){super(t,i||Qr.extractConfig(t.getConfig())),this.name="Chat",this.scriptName="chat",this.Gt=null,this.Kt=!1,this.Jt=null,this.Xt=null,this.Zt=[],this.Qt=[],this.Yt=[],this.ti=[],this.ii=[],this.ei=!1,this.ri=()=>{"visible"===document.visibilityState&&this.ni()}}static extractConfig(t){var i,e=t.chat||{};return{enabled:e.enabled,autoConfig:null===(i=e.autoConfig)||void 0===i||i,position:e.position,greeting:e.greeting,color:e.color,aiMode:e.aiMode,aiGreeting:e.aiGreeting,preload:e.preload,offlineMessage:e.offlineMessage,collectEmailOffline:e.collectEmailOffline,bubble:e.bubble}}get isEnabled(){var t;return!1!==this.B.enabled&&(!0===this.B.enabled||!this._instance.getConfig().disable_chat&&!0===(null===(t=this.Gt)||void 0===t?void 0:t.enabled))}startIfEnabled(){ot().debug(Zr,"startIfEnabled"),this.si().catch(t=>{ot().error(Zr,"error starting:",t)})}stop(){this.destroy(),this.O=!1}onConfigUpdate(t){var i,e;this.B=Qr.extractConfig(t),this.j&&(null===(e=(i=this.j).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}F(){var t,i,e,r=null===(t=W.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!r)throw new Error("[vTilt:chat] initChat not available after script load");var n=this.getMergedConfig(),s=r(this._instance,n);this.ei&&s.show(),this.Yt.forEach(t=>s.onMessage(t)),this.ti.forEach(t=>s.onTyping(t)),this.ii.forEach(t=>s.onConnectionChange(t)),null===(i=this.Xt)||void 0===i||i.destroy(),this.Xt=null;var o=null===(e=null==B?void 0:B.document)||void 0===e?void 0:e.getElementById("vtilt-chat-bubble");return o&&!o.closest("#vtilt-chat-container")&&o.remove(),s}q(t){this.Qt.forEach(t=>t()),this.Qt=[],ot().info(Zr,"loaded and ready")}si(){var t=this;return i(function*(){var i,e,r,n,s;try{if(!1===t.B.enabled)return void ot().info(Zr,"disabled by code config");if(t._instance.getConfig().disable_chat)return void ot().info(Zr,"disabled by disable_chat config");if(!1!==t.B.autoConfig&&(yield t.oi()),!t.isEnabled)return void ot().info(Zr,"not enabled (check dashboard settings)");ot().debug(Zr,"startIfEnabled enabled"),t.O=!0,null!==(r=null!==(i=t.B.preload)&&void 0!==i?i:null===(e=t.Gt)||void 0===e?void 0:e.enabled)&&void 0!==r&&r&&t.ai();var o=t.getMergedConfig();(null===(n=t.Gt)||void 0===n?void 0:n.enabled)&&!1!==(null===(s=o.bubble)||void 0===s?void 0:s.visible)&&t.li(),ot().info(Zr,"ready (lazy-load on demand)")}finally{t.W()}})()}get isOpen(){var t,i;return null!==(i=null===(t=this.j)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.j)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.L||null!==(i=null===(t=this.j)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.j)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.j)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.j)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.j)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.H(()=>{this.ui(()=>{var t;return null===(t=this.j)||void 0===t?void 0:t.open()})})}close(){this.H(()=>{this.j?this.j.close():this.ui(()=>{var t;return null===(t=this.j)||void 0===t?void 0:t.close()})})}toggle(){this.H(()=>{this.j?this.j.toggle():this.open()})}show(){this.H(()=>{this.ei=!0,this.j?this.j.show():this.O&&this.li()})}hide(){this.H(()=>{var t;if(this.ei=!1,this.j)this.j.hide();else{var i=null===(t=null==B?void 0:B.document)||void 0===t?void 0:t.getElementById("vtilt-chat-bubble");i&&(i.style.display="none")}})}getChannels(){this.H(()=>{this.ui(()=>{var t;return null===(t=this.j)||void 0===t?void 0:t.getChannels()})})}selectChannel(t){this.H(()=>{this.ui(()=>{var i;return null===(i=this.j)||void 0===i?void 0:i.selectChannel(t)})})}createChannel(){this.H(()=>{this.ui(()=>{var t;return null===(t=this.j)||void 0===t?void 0:t.createChannel()})})}goToChannelList(){this.H(()=>{this.j?this.j.goToChannelList():this.ui(()=>{var t;return null===(t=this.j)||void 0===t?void 0:t.goToChannelList()})})}sendMessage(t,i){this.H(()=>{this.j?this.j.sendMessage(t,i):(this.Zt.push({content:t,options:i}),this.ui(()=>{this.Zt.forEach(t=>{var i,{content:e,options:r}=t;null===(i=this.j)||void 0===i||i.sendMessage(e,r)}),this.Zt=[]}))})}markAsRead(){this.H(()=>{this.j?this.j.markAsRead():this.ui(()=>{var t;return null===(t=this.j)||void 0===t?void 0:t.markAsRead()})})}registerWidget(t){this.H(()=>{var i,e;this.j?null===(e=(i=this.j).registerWidget)||void 0===e||e.call(i,t):this.ui(()=>{var i,e;null===(e=null===(i=this.j)||void 0===i?void 0:i.registerWidget)||void 0===e||e.call(i,t)})})}onMessage(t){return this.Yt.push(t),this.j?this.j.onMessage(t):()=>{var i=this.Yt.indexOf(t);i>-1&&this.Yt.splice(i,1)}}onTyping(t){return this.ti.push(t),this.j?this.j.onTyping(t):()=>{var i=this.ti.indexOf(t);i>-1&&this.ti.splice(i,1)}}onConnectionChange(t){return this.ii.push(t),this.j?this.j.onConnectionChange(t):()=>{var i=this.ii.indexOf(t);i>-1&&this.ii.splice(i,1)}}updateConfig(t){var i,r;this.B=e({},this.B,t),this.j&&(null===(r=(i=this.j).updateConfig)||void 0===r||r.call(i,this.getMergedConfig()))}getMergedConfig(){var t,i,e,r,n,s,o,a,l,u,h,d,v,c,f,p,g,m,b,y,_,w,x,k,S=this.Gt,C=this.B;return{enabled:null!==(i=null!==(t=C.enabled)&&void 0!==t?t:null==S?void 0:S.enabled)&&void 0!==i&&i,autoConfig:null===(e=C.autoConfig)||void 0===e||e,position:null!==(n=null!==(r=C.position)&&void 0!==r?r:null==S?void 0:S.position)&&void 0!==n?n:"bottom-right",greeting:null!==(s=C.greeting)&&void 0!==s?s:null==S?void 0:S.greeting,color:null!==(a=null!==(o=C.color)&&void 0!==o?o:null==S?void 0:S.color)&&void 0!==a?a:"#6366f1",aiMode:null===(u=null!==(l=C.aiMode)&&void 0!==l?l:null==S?void 0:S.ai_enabled)||void 0===u||u,aiGreeting:null!==(h=C.aiGreeting)&&void 0!==h?h:null==S?void 0:S.ai_greeting,preload:null!==(d=C.preload)&&void 0!==d&&d,theme:null!==(v=C.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=C.color)&&void 0!==c?c:null==S?void 0:S.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=C.offlineMessage)&&void 0!==p?p:null==S?void 0:S.offline_message,collectEmailOffline:null===(m=null!==(g=C.collectEmailOffline)&&void 0!==g?g:null==S?void 0:S.collect_email_offline)||void 0===m||m,bubble:{draggable:null!==(_=null!==(y=null===(b=C.bubble)||void 0===b?void 0:b.draggable)&&void 0!==y?y:null==S?void 0:S.bubble_draggable)&&void 0!==_&&_,visible:null===(k=null!==(x=null===(w=C.bubble)||void 0===w?void 0:w.visible)&&void 0!==x?x:null==S?void 0:S.bubble_visible)||void 0===k||k}}}destroy(){lt(()=>{var t,i,e;document.removeEventListener("visibilitychange",this.ri),null===(t=this.j)||void 0===t||t.destroy(),this.j=void 0,this.ei=!1,this.Zt=[],this.Qt=[],this.Yt=[],this.ti=[],this.ii=[],this.V(),null===(i=this.Xt)||void 0===i||i.destroy(),this.Xt=null;var r=null===(e=null==B?void 0:B.document)||void 0===e?void 0:e.getElementById("vtilt-chat-bubble");r&&r.remove()})}oi(){var t=this;return i(function*(){if(!t.Kt){var i=t._instance.getConfig();if(!i.token)return ot().warn(Zr,"cannot fetch settings: missing token"),void(t.Kt=!0);try{var e=ht(i,"/api/chat/settings"),r=yield fetch(e,{headers:dt(i)});if(!r.ok)return ot().warn(Zr,"failed to fetch settings: "+r.status),void(t.Kt=!0);t.Gt=yield r.json(),t.Kt=!0,ot().info(Zr,"loaded settings from dashboard")}catch(i){ot().warn(Zr,"error fetching settings:",i),t.Kt=!0}}})()}ni(){var t=this;return i(function*(){var i,e,r,n,s=t._instance.getConfig(),o=s.token,a=null!==(r=null===(e=(i=t._instance).getDistinctId)||void 0===e?void 0:e.call(i))&&void 0!==r?r:"";if(ot().debug("chat","fetchUnread","distinctId",a?a.slice(0,12)+"...":"empty"),o&&a)try{var l=ht(s,"/api/chat/widget/unread"),u=l.includes("?")?"&":"?",h=""+l+u+"distinct_id="+encodeURIComponent(a),d=yield fetch(h,{headers:dt(s)});if(!d.ok)return;var v=yield d.json(),c=Number(null!==(n=v.unread_count)&&void 0!==n?n:0),f=document.getElementById("vtilt-chat-bubble");if(!f)return;var p=f.querySelector(".vtilt-chat-bubble-badge");if(!p)return;c>0?(p.style.display="flex",p.textContent=c>99?"99+":String(c)):p.style.display="none"}catch(t){}else{var g=o?"missing distinctId":"missing token";ot().debug("chat","fetchUnread skip","reason",g)}})()}li(){var t,i;if(null==B?void 0:B.document){var e=document.getElementById("vtilt-chat-bubble");if(e)e.style.display="flex";else{var r=this.getMergedConfig(),n=r.position||"bottom-right",s=r.color||"#6366f1",o=document.createElement("div");o.id="vtilt-chat-bubble",o.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===n?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+s+";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n transition: transform 0.2s, box-shadow 0.2s;\n z-index: 999999;\n ").trim()),o.innerHTML='\n <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">\n <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>\n </svg>\n <div class="vtilt-chat-bubble-badge" style="\n display: none;\n position: absolute;\n top: -4px;\n right: -4px;\n background: #E53935;\n color: white;\n font-size: 11px;\n font-weight: 700;\n min-width: 20px;\n height: 20px;\n border-radius: 10px;\n align-items: center;\n justify-content: center;\n padding: 0 6px;\n box-sizing: border-box;\n border: 2px solid white;\n ">0</div>\n ';var a=!0===(null===(t=r.bubble)||void 0===t?void 0:t.draggable);a||(o.addEventListener("mouseenter",()=>{o.style.transform="scale(1.05)",o.style.boxShadow="0 6px 16px rgba(0, 0, 0, 0.2)"}),o.addEventListener("mouseleave",()=>{o.style.transform="scale(1)",o.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"})),o.addEventListener("click",()=>{this.open()}),document.body.appendChild(o),a&&(null===(i=this.Xt)||void 0===i||i.destroy(),this.Xt=Xr(o)),this.ni(),document.addEventListener("visibilitychange",this.ri)}}}ai(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.N(()=>{}),{timeout:5e3}):setTimeout(()=>this.N(()=>{}),3e3)}ui(t){this.j?t():(this.Qt.push(t),this.N(t=>this.q(t)))}}function Yr(t,i){t("js",new Date);var{tagIds:r,configParams:n,sendPageView:s,debugMode:o,conversionLinker:a,linkerDomains:l}=i,u=e({},n||{});for(var h of(!1===s&&(u.send_page_view=!1),o&&(u.debug_mode=!0),!1===a&&(u.conversion_linker=!1),l&&l.length>0&&(u.linker={domains:l,decorate_forms:!0}),r))h&&t("config",h,u)}function tn(t,i){var e,r=(t.tagIds||[]).filter(t=>!!t);if(0===r.length)return null;var n,s,o,a=null!==(e=t.proxyMode)&&void 0!==e?e:"proxied";if("direct"===a)n=rn,s=rn,o="";else{var l=function(t){var i,e=void 0!==B&&(null===(i=null==B?void 0:B.location)||void 0===i?void 0:i.origin)?B.location.origin:"";if(!t)return e?{base:e,absoluteBase:e}:null;var r=t.replace(/\/+$/g,"");if(!r)return e?{base:e,absoluteBase:e}:null;try{var n=new URL(r),s=n.pathname.replace(/\/$/,""),o=""+n.origin+s;return{base:o,absoluteBase:o}}catch(t){}if(r.startsWith("/"))return{base:r,absoluteBase:e?""+e+r:r};return e?{base:e,absoluteBase:e}:null}(i);if(!l)return null;n=l.base,s=l.absoluteBase,o=en}var u={};if("direct"!==a){var h=function(t){if(!t)return"";var i=t.startsWith("/")?t:"/"+t;return i.replace(/\/$/,"")}(o);u.transport_url=""+s.replace(/\/$/,"")+h}return{origin:n,gatewayPath:o,primaryTagId:r.find(t=>t.startsWith("G-"))||r[0]||"",tagIds:r,configParams:u,sendPageView:!1!==t.capturePageview,debugMode:!!t.debugMode,conversionLinker:!1!==t.conversionLinker,linkerDomains:t.linkerDomains}}var en="/gt",rn="https://www.googletagmanager.com";function nn(t,i){var r=!0===t.advertising,n={ad_storage:r?"granted":"denied",ad_user_data:r?"granted":"denied",ad_personalization:r?"granted":"denied",analytics_storage:!0===t.analytics?"granted":"denied"};if(!i)return n;var s=e({},n);return Object.keys(n).forEach(e=>{var r=i[e];void 0!==r&&(s[e]=function(t,i){return"granted"===i?"granted":"denied"===i?"denied":"follow_advertising"===i?!0===t.advertising?"granted":"denied":"follow_analytics"===i&&!0===t.analytics?"granted":"denied"}(t,r))}),s}function sn(t){if(null==t)return null;var i=String(t).trim().toLowerCase();return i||null}function on(t,i){if(t&&i){var e=i.split("."),r=t;for(var n of e){if(null==r||"object"!=typeof r)return;r=r[n]}return r}}function an(t){if("number"==typeof t&&Number.isFinite(t))return t;if("string"==typeof t&&""!==t.trim()){var i=Number(t);if(Number.isFinite(i))return i}}function ln(t){if(null!=t)return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?String(t):void 0}function un(t){var{mapping:i,payload:e}=t,r={send_to:i.send_to},n=i.value_param_path||"value",s=i.currency_param_path||"currency",o=an(on(e,n));void 0!==o&&(r.value=o);var a=ln(on(e,s))||i.default_currency||void 0;if(a&&(r.currency=a),!1!==i.send_transaction_id){var l=ln(on(e,i.transaction_id_param_path||"transaction_id"));l&&(r.transaction_id=l)}return{send_to:i.send_to,params:r}}var hn=[{source:"$pageview",destination:"page_view",buildParams:t=>{var i,e={},r=ln(t.$current_url);r&&(e.page_location=r);var n=ln(t.$pathname);n&&(e.page_path=n);var s=null!==(i=ln(t.title))&&void 0!==i?i:ln(t.$title);s&&(e.page_title=s);var o=ln(t.$referrer);return o&&(e.page_referrer=o),e}},{source:"$pageleave",destination:"user_engagement",buildParams:t=>{var i,e,r={},n=an(null!==(e=null!==(i=t.$dwell_time_ms)&&void 0!==i?i:t.engagement_time_msec)&&void 0!==e?e:t.$time_on_page_ms);return void 0!==n&&(r.engagement_time_msec=Math.round(n)),r}}];function dn(t,i,e){var r=i.split(".").filter(Boolean);if(0!==r.length)if(1!==r.length){for(var n=t,s=0;s<r.length-1;s++){var o=r[s],a=r[s+1];if(null==n||"object"!=typeof n||Array.isArray(n))return;var l=n;if(/^\d+$/.test(a)){var u=Array.isArray(l[o])?l[o]:[];Array.isArray(l[o])||(l[o]=u);for(var h=parseInt(a,10);u.length<=h;)u.push({});if(s+1===r.length-1)return void(u[h]=e);var d=u[h];d&&"object"==typeof d&&!Array.isArray(d)||(d={},u[h]=d),n=d,s++}else{var v=l[o];v&&"object"==typeof v&&!Array.isArray(v)||(v={},l[o]=v),n=v}}var c=r[r.length-1];n&&"object"==typeof n&&!Array.isArray(n)&&(n[c]=e)}else t[r[0]]=e}var vn=new Set(["client_id","user_id","first_visit","session_start"]);function cn(t,i,e,r){if(!function(t,i){return!(i&&(Array.isArray(i.exclude)&&i.exclude.includes(t)||Array.isArray(i.include)&&i.include.length>0&&!i.include.includes(t)))}(i,r.eventFilter))return{fired:!1};var n=(r.eventMappings||[]).find(t=>(null==t?void 0:t.source)===i);if(n&&n.destination){var{name:s,params:o}=function(t,i){var e={},r=Array.isArray(t.param_mappings)?t.param_mappings:[];for(var n of r){var s=null==n?void 0:n.source,o=null==n?void 0:n.destination;if(s&&o){var a=on(i,s);void 0!==a&&(o.includes(".")?dn(e,o,a):e[o]=a)}}return{name:t.destination,params:e}}(n,e);return t("event",s,o),{fired:!0,eventName:s,params:o,source:"mapping"}}if(!1===r.autoForward)return{fired:!1};var a=hn.find(t=>t.source===i);if(a){var l=a.buildParams(e);return t("event",a.destination,l),{fired:!0,eventName:a.destination,params:l,source:"preset"}}if(i.startsWith("$"))return{fired:!1};var u=function(t){var i={};for(var[e,r]of Object.entries(t))e.startsWith("$")||vn.has(e)||void 0!==r&&(i[e]=r);return i}(e);return t("event",i,u),{fired:!0,eventName:i,params:u,source:"auto"}}function fn(){var t=null,i=[],e=[];return{call:function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];if((t=>{e.push(t),e.length>50&&e.shift()})(n),t)try{t(...n)}catch(t){}else i.push(n)},flush(e){for(t=e;i.length;){var r=i.shift();try{e(...r)}catch(t){}}},getRecentCalls:()=>e.slice()}}function pn(t){return gn.apply(this,arguments)}function gn(){return(gn=i(function*(t){try{var i="undefined"!=typeof crypto&&crypto.subtle?crypto.subtle:null;if(!i)return null;var e=(new TextEncoder).encode(t),r=yield i.digest("SHA-256",e);return Array.from(new Uint8Array(r)).map(t=>t.toString(16).padStart(2,"0")).join("")}catch(t){return null}})).apply(this,arguments)}function mn(){return(mn=i(function*(t){var i={},e=function(t){if(!t)return null;var i=String(t).trim().toLowerCase();if(!i)return null;if(!i.includes("@"))return null;var[e,r]=i.split("@");if(!e||!r)return null;if("gmail.com"===r||"googlemail.com"===r){var n=e.split("+")[0].replace(/\./g,"");return n?n+"@"+r:null}return e+"@"+r}(t.email),r=function(t){if(!t)return null;var i=String(t).trim();if(!i)return null;if(i.startsWith("+")){var e=i.slice(1).replace(/\D/g,"");return e?"+"+e:null}return null}(t.phone),n=sn(t.first_name),s=sn(t.last_name),o=sn(t.street),a=sn(t.city),l=sn(t.region),u=function(t){if(!t)return null;var i=String(t).trim().toUpperCase().replace(/\s+/g,"");return i||null}(t.postal_code),h=sn(t.country);if(e){var d=yield pn(e);d&&(i.sha256_email_address=d)}if(r){var v=yield pn(r);v&&(i.sha256_phone_number=v)}var c={};if(n){var f=yield pn(n);f&&(c.sha256_first_name=f)}if(s){var p=yield pn(s);p&&(c.sha256_last_name=p)}if(o){var g=yield pn(o);g&&(c.sha256_street=g)}return a&&(c.city=a),l&&(c.region=l),u&&(c.postal_code=u),h&&(c.country=h),Object.keys(c).length>0&&(i.address=c),0===Object.keys(i).length?null:i})).apply(this,arguments)}class bn{constructor(t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.hi=t,this.di=[]}get length(){return this.di.length}enqueue(t){return!(this.di.length>=this.hi)&&(this.di.push(t),!0)}takeAll(){if(0===this.di.length)return[];var t=this.di;return this.di=[],t}clear(){this.di=[]}}var yn="google-tag";class _n{constructor(t,i){this.name="GoogleTagGateway",this.O=!1,this.ci=!1,this.fi=!1,this.pi=!1,this.gi=null,this.mi=null,this.bi=null,this.yi=null,this.wi=[],this.xi=100,this.ki=new bn(100),this._instance=t,this.B=i||_n.extractConfig(t.getConfig()),this.Si=fn(),this.Ci()}static extractConfig(t){if(t.disable_google_tag)return{enabled:!1};var i=t.google_tag;return i?{enabled:(i.tagIds||[]).some(t=>!!t),remote:i}:{enabled:!1}}get isEnabled(){return!1!==this.B.enabled&&!!this.B.remote}get isStarted(){return this.O}get gtag(){return this.Si.call}get deliveryLog(){return this.wi.slice()}startIfEnabled(){this.O||this.isEnabled&&this._instance.getConfig().__remote_config_loaded&&this.lt()}stop(){var t;this.O&&(null===(t=this.yi)||void 0===t||t.call(this),this.yi=null,this.O=!1)}onConfigUpdate(t){var i=_n.extractConfig(t),e=this.isEnabled;this.B=i;var r=!0===t.__remote_config_loaded;if(e&&!this.isEnabled)this.stop();else if(this.O&&i.remote&&this.mi){var n=tn(i.remote,this._instance.getConfig().api_host);n&&(this.mi=n,Yr(this.gi,n))}r&&!this.isEnabled&&this.ki.clear(),r&&this.isEnabled&&!this.O&&this.startIfEnabled()}setUserData(t){var e=this;return i(function*(){var i=e.B.remote;if(i&&i.enhancedConversions){var r=yield function(t){return mn.apply(this,arguments)}(t);r&&e.Si.call("set","user_data",r)}})()}getRecentPublicCalls(){return this.Si.getRecentCalls()}lt(){var t=this.B.remote;if(t){var i=tn(t,this._instance.getConfig().api_host);if(i){this.mi=i;var{gtag:e}=function(){var t,i,e=W,r=null!==(t=(i=e).dataLayer)&&void 0!==t?t:i.dataLayer=[],n=e.gtag;if(n)return{gtag:n,dataLayer:r};var s=function(){r.push(arguments)};return e.gtag=s,{gtag:s,dataLayer:r}}();this.gi=e,this.Si.flush(e),this.Mi(),Yr(e,i),this.ci||(this.ci=!0,function(t,i,e){var r=null==B?void 0:B.document;if(!r)return null;var{origin:n,gatewayPath:s,primaryTagId:o}=t;if(!n||!o)return null;var a=""+n.replace(/\/$/,"")+(s?s.startsWith("/")?s.replace(/\/$/,""):"/"+s.replace(/\/$/,""):"")+"/gtag/js?id="+encodeURIComponent(o)+"&l=dataLayer",l=r.querySelector('script[data-vtilt-gtag-loader="'+o+'"]');if(l)return l;var u=r.createElement("script");u.async=!0,u.src=a,u.setAttribute("data-vtilt-gtag-loader",o),u.onload=()=>null==i?void 0:i(),u.onerror=()=>{var t=new Error("[GoogleTagGateway] failed to load "+a);null==e||e(t)},(r.head||r.body||r.documentElement).appendChild(u)}(i,()=>{this.fi=!0},t=>{ot().warn(yn,t.message)})),this.Ai(),this.O=!0,this.$i()}else ot().warn(yn,"skipped — missing tag_ids or resolvable origin")}}$i(){for(var t of this.ki.takeAll())this.Ei(t.event,t.payload)}Mi(){var t;if(!this.pi&&this.gi){var i=lt(()=>this._instance.consentManager.getConsent());!function(t,i,r){t("consent","default",e({},nn(i,r),{wait_for_update:500}))}(this.gi,i||{},null===(t=this.B.remote)||void 0===t?void 0:t.consentOverride),this.pi=!0}}Ci(){if(!this.bi){this.bi=this._instance.Ri.on(mt,t=>{var i=t;i&&"string"==typeof i.event&&this.Ei(i.event,i.payload||{})})}}Ei(t,i){var e=this._instance.getConfig();if(!e.disable_google_tag)if(e.__remote_config_loaded){if(this.isEnabled&&(this.O||this.startIfEnabled(),this.gi&&this.B.remote&&this.O)){var r=this.B.remote,n=r.tagIds||[],s=cn(this.gi,t,i,r);if(s.fired&&s.eventName&&this.Ti({ts:Date.now(),tag_ids:n,event_name:t,send_to:"ga4:"+s.eventName,status:"fired",reason:s.source}),!1!==r.sendAdsConversions){var o=function(t,i,e,r){var n=(r.conversions||[]).filter(t=>t.event_name===i);if(0===n.length)return[];var s=[];for(var o of n){var a=un({mapping:o,payload:e});t("event","conversion",a.params),s.push(a)}return s}(this.gi,t,i,r);for(var a of o)this.Ti({ts:Date.now(),tag_ids:n,event_name:t,send_to:a.send_to,status:"fired"})}}}else this.ki.enqueue({event:t,payload:i})}Ai(){if(!this.yi){this.yi=this._instance.Ri.on(gt,t=>{var i;if(this.gi){var e,r,n,s=t;e=this.gi,r=s.consent||{},n=null===(i=this.B.remote)||void 0===i?void 0:i.consentOverride,e("consent","update",nn(r,n))}})}}Ti(t){this.wi.push(t),this.wi.length>this.xi&&this.wi.shift()}}var wn="vtd-overlay";class xn{constructor(t,i){this.name="VtdOverlay",this.O=!1,this.Ii=null,this.Pi=null,this.L=!0,this.Oi=null,this.Li=null,this.Ui=null,this._instance=t,this.B=i||xn.extractConfig(t.getConfig())}static extractConfig(t){return{enabled:!1!==t.vtd_overlay}}get isEnabled(){return!1!==this.B.enabled}get isStarted(){return this.O}startIfEnabled(){}stop(){this.O&<(()=>{this.Di(),this.O=!1})}onConfigUpdate(t){this.B=xn.extractConfig(t),!this.isEnabled&&this.O&&this.stop()}setDestinationUrl(t){var i;if(this.isEnabled)if(null==t?void 0:t.trim()){var e=t;try{e=decodeURIComponent(t)}catch(i){e=t}if(this.Bi(e)){var r=this.ji(e);this.Pi=e,this.Ii=r,this.L=!0,this.zi(),this.O=!0,this._instance.capture("$vtd_view",{$vtd_url:e,$vtd_embed_url:r!==e?r:void 0,$current_url:null===(i=null==B?void 0:B.location)||void 0===i?void 0:i.href})}else ot().warn(wn,"invalid URL: "+e)}else ot().warn(wn,"empty URL provided");else ot().warn(wn,"feature is disabled")}getDestinationUrl(){return this.Ii}close(){this._instance.capture("$vtd_close",{$vtd_url:this.Pi}),this.Oi?(this.Oi.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.Di(),this.O=!1,this.Ii=null,this.Pi=null},200)):(this.Di(),this.O=!1,this.Ii=null,this.Pi=null)}Bi(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}ji(t){try{var i=new URL(t),e=i.hostname.toLowerCase();if("youtube.com"===e||"www.youtube.com"===e||"m.youtube.com"===e){var r=i.searchParams.get("v");if(r){var n=i.searchParams.get("t"),s="https://www.youtube.com/embed/"+r+"?autoplay=1";return n&&(s+="&start="+n.replace("s","")),s}}if("youtu.be"===e){var o=i.pathname.slice(1);if(o){var a=i.searchParams.get("t"),l="https://www.youtube.com/embed/"+o+"?autoplay=1";return a&&(l+="&start="+a.replace("s","")),l}}if("vimeo.com"===e||"www.vimeo.com"===e){var u=i.pathname.match(/^\/(\d+)/);if(u)return"https://player.vimeo.com/video/"+u[1]+"?autoplay=1"}if("loom.com"===e||"www.loom.com"===e){var h=i.pathname.match(/^\/share\/([a-zA-Z0-9]+)/);if(h)return"https://www.loom.com/embed/"+h[1]+"?autoplay=1"}if(e.endsWith("wistia.com")){var d=i.pathname.match(/^\/medias\/([a-zA-Z0-9]+)/);if(d)return"https://fast.wistia.net/embed/iframe/"+d[1]+"?autoplay=1"}if("dailymotion.com"===e||"www.dailymotion.com"===e){var v=i.pathname.match(/^\/video\/([a-zA-Z0-9]+)/);if(v)return"https://www.dailymotion.com/embed/video/"+v[1]+"?autoplay=1"}if("open.spotify.com"===e){var c=i.pathname.match(/^\/(track|album|playlist|episode|show)\/([a-zA-Z0-9]+)/);if(c)return"https://open.spotify.com/embed/"+c[1]+"/"+c[2]}return"drive.google.com"===e&&i.pathname.includes("/view")?t.replace("/view","/preview"):t}catch(i){return t}}Ni(t){try{return new URL(t).hostname}catch(i){return t}}Fi(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}zi(){if(N&&this.Ii){this.Di(),this.Oi=N.createElement("div"),this.Oi.id="vtilt-vtd-overlay",this.Oi.className="vtilt-vtd-opening",this.Oi.setAttribute("style",this.qi());var t=N.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.Hi());var i=N.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Wi()),i.innerHTML=this.Vi(),t.appendChild(i);var e=N.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Gi()),this.Ui=N.createElement("div"),this.Ui.className="vtilt-vtd-loading",this.Ui.setAttribute("style",this.Ki()),this.Ui.innerHTML=this.Ji(),e.appendChild(this.Ui),this.Li=N.createElement("iframe"),this.Li.id="vtilt-vtd-iframe",this.Li.className="vtilt-vtd-iframe",this.Li.setAttribute("style",this.Xi()),this.Li.setAttribute("frameborder","0"),this.Li.setAttribute("allowfullscreen","true"),this.Li.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var r=()=>{this.L=!1,this.Ui&&(this.Ui.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.Ui)||void 0===t?void 0:t.parentNode)&&(this.Ui.style.display="none")},300)),this.Li&&(this.Li.style.opacity="1")};this.Li.onload=r,this.Li.onerror=r,setTimeout(()=>{this.L&&r()},5e3),e.appendChild(this.Li),this.Li.src=this.Ii,t.appendChild(e),this.Oi.appendChild(t);var n=N.createElement("style");n.id="vtilt-vtd-styles",n.textContent=this.Zi(),N.head.appendChild(n),N.body.appendChild(this.Oi),this.Qi(),N.body.style.overflow="hidden"}}Di(){var t;(null===(t=this.Oi)||void 0===t?void 0:t.parentNode)&&(this.Oi.parentNode.removeChild(this.Oi),this.Oi=null,this.Li=null,this.Ui=null);var i=null==N?void 0:N.getElementById("vtilt-vtd-styles");(null==i?void 0:i.parentNode)&&i.parentNode.removeChild(i),(null==N?void 0:N.body)&&(N.body.style.overflow="")}Qi(){var t,i,e,r=null===(t=this.Oi)||void 0===t?void 0:t.querySelector(".vtilt-vtd-close");null==r||r.addEventListener("click",()=>this.close());var n=null===(i=this.Oi)||void 0===i?void 0:i.querySelector(".vtilt-vtd-open");null==n||n.addEventListener("click",()=>{this.Pi&&(null==B||B.open(this.Pi,"_blank"))}),null===(e=this.Oi)||void 0===e||e.addEventListener("click",t=>{t.target===this.Oi&&this.close()});var s=t=>{"Escape"===t.key&&(this.close(),null==N||N.removeEventListener("keydown",s))};null==N||N.addEventListener("keydown",s)}qi(){return'\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n '}Hi(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Wi(){return"\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n height: 56px;\n background: linear-gradient(180deg, rgba(20, 20, 20, 1) 0%, rgba(15, 15, 15, 1) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n flex-shrink: 0;\n gap: 16px;\n "}Vi(){var t=this.Pi||this.Ii,i=t?this.Ni(t):"";return'\n <div style="display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;">\n <img \n src="'+(t?this.Fi(t):"")+'" \n alt="" \n style="width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;"\n onerror="this.style.display=\'none\'"\n />\n <div style="\n display: flex;\n flex-direction: column;\n min-width: 0;\n gap: 2px;\n ">\n <div style="\n color: rgba(255, 255, 255, 0.95);\n font-size: 14px;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.Yi(i)+'</div>\n <div style="\n color: rgba(255, 255, 255, 0.45);\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.Yi(this.te(t||"",50))+'</div>\n </div>\n </div>\n <div style="display: flex; align-items: center; gap: 8px; flex-shrink: 0;">\n <button class="vtilt-vtd-open vtilt-vtd-btn" title="Open in new tab">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>\n <polyline points="15 3 21 3 21 9"></polyline>\n <line x1="10" y1="14" x2="21" y2="3"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Open</span>\n </button>\n <button class="vtilt-vtd-close vtilt-vtd-btn vtilt-vtd-btn-primary" title="Close (Esc)">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Close</span>\n </button>\n </div>\n '}Gi(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}Ki(){return"\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #0a0a0a;\n z-index: 1;\n transition: opacity 0.3s ease;\n "}Ji(){var t=this.Pi||this.Ii,i=t?this.Ni(t):"";return'\n <div class="vtilt-vtd-spinner"></div>\n <div style="\n margin-top: 20px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 14px;\n font-weight: 500;\n ">Loading '+this.Yi(i)+'...</div>\n <div style="\n margin-top: 8px;\n color: rgba(255, 255, 255, 0.35);\n font-size: 12px;\n ">Press <kbd style="\n display: inline-block;\n padding: 2px 6px;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n font-family: inherit;\n font-size: 11px;\n ">Esc</kbd> to close</div>\n '}Xi(){return"\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n background: white;\n opacity: 0;\n transition: opacity 0.3s ease;\n "}Zi(){return"\n /* Animations */\n @keyframes vtilt-vtd-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes vtilt-vtd-fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n \n @keyframes vtilt-vtd-scale-in {\n from { opacity: 0; transform: scale(0.96); }\n to { opacity: 1; transform: scale(1); }\n }\n \n @keyframes vtilt-vtd-spin {\n to { transform: rotate(360deg); }\n }\n \n /* Container animations */\n #vtilt-vtd-overlay.vtilt-vtd-opening {\n animation: vtilt-vtd-fade-in 0.2s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-opening .vtilt-vtd-modal {\n animation: vtilt-vtd-scale-in 0.25s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-closing {\n animation: vtilt-vtd-fade-out 0.2s ease-in forwards;\n }\n \n /* Loading spinner */\n .vtilt-vtd-spinner {\n width: 40px;\n height: 40px;\n border: 3px solid rgba(255, 255, 255, 0.1);\n border-top-color: rgba(255, 255, 255, 0.8);\n border-radius: 50%;\n animation: vtilt-vtd-spin 0.8s linear infinite;\n }\n \n /* Button base styles */\n .vtilt-vtd-btn {\n background: rgba(255, 255, 255, 0.08);\n border: 1px solid rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.9);\n padding: 8px 14px;\n border-radius: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.15s ease;\n -webkit-tap-highlight-color: transparent;\n outline: none;\n }\n \n .vtilt-vtd-btn:hover {\n background: rgba(255, 255, 255, 0.14);\n border-color: rgba(255, 255, 255, 0.18);\n }\n \n .vtilt-vtd-btn:active {\n background: rgba(255, 255, 255, 0.18);\n transform: scale(0.98);\n }\n \n .vtilt-vtd-btn:focus-visible {\n box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);\n }\n \n /* Primary button variant */\n .vtilt-vtd-btn-primary {\n background: rgba(255, 255, 255, 0.95);\n border-color: transparent;\n color: #0a0a0a;\n }\n \n .vtilt-vtd-btn-primary:hover {\n background: rgba(255, 255, 255, 1);\n border-color: transparent;\n }\n \n .vtilt-vtd-btn-primary:active {\n background: rgba(255, 255, 255, 0.85);\n }\n \n /* Desktop responsive - modal with margin */\n @media (min-width: 768px) {\n #vtilt-vtd-overlay {\n padding: 32px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1200px;\n max-height: 90vh;\n width: 100%;\n height: auto;\n min-height: 500px;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);\n }\n \n .vtilt-vtd-header {\n border-radius: 16px 16px 0 0;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 0 16px 16px;\n min-height: 400px;\n }\n }\n \n /* Large desktop - bigger modal */\n @media (min-width: 1400px) {\n #vtilt-vtd-overlay {\n padding: 48px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1400px;\n max-height: 85vh;\n }\n }\n \n /* Tablet */\n @media (min-width: 768px) and (max-width: 1024px) {\n #vtilt-vtd-overlay {\n padding: 24px;\n }\n \n .vtilt-vtd-modal {\n max-width: 95%;\n max-height: 90vh;\n }\n }\n \n /* Mobile - fullscreen */\n @media (max-width: 767px) {\n #vtilt-vtd-overlay {\n padding: 0 !important;\n background: #0a0a0a !important;\n }\n \n .vtilt-vtd-modal {\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n border-radius: 0 !important;\n }\n \n .vtilt-vtd-header {\n border-radius: 0 !important;\n padding: 0 12px !important;\n height: 52px !important;\n }\n \n .vtilt-vtd-btn {\n padding: 8px 10px !important;\n }\n \n .vtilt-vtd-btn-text {\n display: none !important;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 !important;\n }\n }\n \n /* Reduced motion */\n @media (prefers-reduced-motion: reduce) {\n #vtilt-vtd-overlay,\n #vtilt-vtd-overlay *,\n .vtilt-vtd-spinner {\n animation-duration: 0.01ms !important;\n transition-duration: 0.01ms !important;\n }\n }\n "}te(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}Yi(t){if(void 0===N)return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");var i=N.createElement("div");return i.textContent=t,i.innerHTML}}var kn,Sn="text/plain",Cn=61440;!function(t){t.GZipJS="gzip-js",t.Base64="base64",t.None="none"}(kn||(kn={}));var Mn=function(t,i){void 0===i&&(i="binary");var{data:e,compression:r}=t;if(e){var n=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(e),s=new Blob([n]).size;if(r===kn.GZipJS&&s>=1024)try{var o=Hr(function(t,i){if(Wr)return Wr.encode(t);for(var e=t.length,r=new hr(t.length+(t.length>>1)),n=0,s=function(t){r[n++]=t},o=0;o<e;++o){if(n+5>r.length){var a=new hr(n+8+(e-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);l<128||i?s(l):l<2048?(s(192|l>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|63&l)):(s(224|l>>12),s(128|l>>6&63),s(128|63&l))}return Rr(r,0,n)}(n),{mtime:0});if("text-base64"===i){var a=function(t){if("undefined"==typeof btoa)throw new Error("btoa is not available in this environment");for(var i="",e=0;e<t.length;e+=32768){var r=Math.min(e+32768,t.length),n=t.subarray(e,r);i+=String.fromCharCode.apply(null,n)}return btoa(i)}(o);if(a.length>0&&a.length<.95*s)return{contentType:Sn,body:a,estimatedSize:a.length,compressionApplied:kn.Base64}}else{var l=new Blob([o],{type:Sn});if(l.size>0&&l.size<.95*s)return{contentType:Sn,body:l,estimatedSize:l.size,compressionApplied:kn.GZipJS}}}catch(t){}return{contentType:"application/json",body:n,estimatedSize:s,compressionApplied:null}}};function An(t,i){return i.compressionApplied?(e=t.url,r=i.compressionApplied,n=e.includes("?")?"&":"?",""+e+n+"compression="+r):t.url;var e,r,n}function $n(t,i){var e={};return i&&(e["Content-Type"]=i),t.headers&&Object.assign(e,t.headers),t.projectToken&&(e[ut]=t.projectToken),e}var En=[{name:"fetch",isAvailable:()=>"undefined"!=typeof fetch,method:t=>{var e=Mn(t,"binary");if(e){var{contentType:r,body:n,estimatedSize:s}=e,o=An(t,e),a=$n(t,r),l=new AbortController,u=t.timeout?setTimeout(()=>l.abort(),t.timeout):null;fetch(o,{method:t.method||"POST",headers:a,body:n,keepalive:s<Cn,signal:l.signal}).then(function(){var e=i(function*(i){var e,r=yield i.text(),n={statusCode:i.status,text:r};if(200===i.status){St();try{n.json=JSON.parse(r)}catch(t){}}null===(e=t.callback)||void 0===e||e.call(t,n)});return function(t){return e.apply(this,arguments)}}()).catch(()=>{var i;kt("capture"),null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{u&&clearTimeout(u)})}}},{name:"XHR",isAvailable:()=>"undefined"!=typeof XMLHttpRequest,method:t=>{var i=Mn(t,"binary");if(i){var{contentType:e,body:r}=i,n=An(t,i),s=$n(t,e),o=new XMLHttpRequest;for(var[a,l]of(o.open(t.method||"POST",n,!0),Object.entries(s)))o.setRequestHeader(a,l);t.timeout&&(o.timeout=t.timeout),o.onreadystatechange=()=>{var i;if(4===o.readyState){var e={statusCode:o.status,text:o.responseText};if(200===o.status){St();try{e.json=JSON.parse(o.responseText)}catch(t){}}null===(i=t.callback)||void 0===i||i.call(t,e)}},o.onerror=()=>{var i;kt("capture"),null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})},o.send(r)}}},{name:"sendBeacon",isAvailable:()=>"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=Mn(t,"text-base64");if(i){var{contentType:r,body:n,estimatedSize:s}=i;if(0!==s){var o=An(t,i),a=t.projectToken?function(t,i){if(!i||/[?&]token=/.test(t))return t;var e=t.includes("?")?"&":"?";return""+t+e+"token="+i}(o,t.projectToken):o;if(s<=Cn)try{var l="string"==typeof n?new Blob([n],{type:r}):n;if("undefined"!=typeof navigator&&navigator.sendBeacon)if(navigator.sendBeacon(a,l))return}catch(t){}try{var u="string"==typeof n?new Blob([n],{type:r}):n,h=e({"Content-Type":r},t.headers||{});fetch(a,{method:t.method||"POST",headers:h,body:u,keepalive:s<Cn}).catch(()=>{})}catch(t){}}}}}],Rn=t=>{var i,e;if(Ct())null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0});else{var r=t.transport||"fetch",n=En.find(t=>t.name===r&&t.isAvailable())||En.find(t=>t.isAvailable());if(!n)return ot().error("request","no available transport method"),void(null===(e=t.callback)||void 0===e||e.call(t,{statusCode:0}));n.method(t)}};class Tn{constructor(t,i){var e,r,n,s;this.ie=!0,this.ee=[],this.re=(e=(null==i?void 0:i.flush_interval_ms)||3e3,r=250,n=5e3,s=3e3,"number"!=typeof e||isNaN(e)?s:Math.min(Math.max(e,r),n)),this.ne=t}get length(){return this.ee.length}enqueue(t){this.ee.push(t),this.se||this.oe()}unload(){if(this.ae(),0!==this.ee.length){var t=this.le();for(var i in t){var r=t[i];this.ne(e({},r,{transport:"sendBeacon"}))}}}enable(){this.ie=!1,this.oe()}pause(){this.ie=!0,this.ae()}flush(){this.ae(),this.ue(),this.oe()}oe(){this.ie||(this.se=setTimeout(()=>{this.ae(),this.ue(),this.ee.length>0&&this.oe()},this.re))}ae(){this.se&&(clearTimeout(this.se),this.se=void 0)}ue(){if(0!==this.ee.length){var t=this.le(),i=Date.now();for(var e in t){var r=t[e];r.events.forEach(t=>{var e=new Date(t.timestamp).getTime();t.$offset=Math.abs(e-i)}),this.ne(r)}}}le(){var t={};return this.ee.forEach(i=>{var e=i.batchKey||i.url;t[e]||(t[e]={url:i.url,events:[],batchKey:i.batchKey}),t[e].events.push(i.event)}),this.ee=[],t}}class In{constructor(t){this.he=!1,this.de=3e3,this.ee=[],this.ve=!0,this.ne=t.sendRequest,this.ce=t.sendBeacon,B&&void 0!==z&&"onLine"in z&&(this.ve=z.onLine,Rt(B,"online",()=>{this.ve=!0,this.Z()}),Rt(B,"offline",()=>{this.ve=!1}))}get length(){return this.ee.length}enqueue(t,i){if(void 0===i&&(i=0),i>=10)ot().error("retry","request failed after 10 retries, giving up");else if(!Ct()){var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,r=Math.min(18e5,i),n=(Math.random()-.5)*(r-e);return Math.ceil(r+n)}(i),r=Date.now()+e;this.ee.push({retryAt:r,request:t,retriesPerformedSoFar:i+1});var n="enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.ve||(n+=" (browser is offline)"),ot().warn("retry",n),this.he||(this.he=!0,this.fe())}}retriableRequest(t){var e=this;return i(function*(){try{var i=yield e.ne(t);200!==i.statusCode&&(i.statusCode<400||i.statusCode>=500)&&e.enqueue(t,0)}catch(i){e.enqueue(t,0)}})()}fe(){this.pe&&clearTimeout(this.pe),this.pe=setTimeout(()=>{this.ve&&this.ee.length>0&&this.Z(),this.ee.length>0?this.fe():this.he=!1},this.de)}Z(){var t=this,e=Date.now(),r=[],n=[];this.ee.forEach(t=>{t.retryAt<e?n.push(t):r.push(t)}),this.ee=r,n.forEach(function(){var e=i(function*(i){var{request:e,retriesPerformedSoFar:r}=i;try{var n=yield t.ne(e);200!==n.statusCode&&(n.statusCode<400||n.statusCode>=500)&&t.enqueue(e,r)}catch(i){t.enqueue(e,r)}});return function(t){return e.apply(this,arguments)}}())}unload(){this.pe&&(clearTimeout(this.pe),this.pe=void 0),this.ee.forEach(t=>{var{request:i}=t;try{this.ce(i)}catch(t){ot().error("retry","failed to send beacon on unload",t)}}),this.ee=[]}}var Pn="vt_rate_limit";class On{constructor(t){var i,e;void 0===t&&(t={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(i=t.eventsPerSecond)&&void 0!==i?i:10,this.eventsBurstLimit=Math.max(null!==(e=t.eventsBurstLimit)&&void 0!==e?e:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=t.persistence,this.captureWarning=t.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(t){var i,e,r,n;void 0===t&&(t=!1);var s=Date.now(),o=null!==(e=null===(i=this.persistence)||void 0===i?void 0:i.get(Pn))&&void 0!==e?e:{tokens:this.eventsBurstLimit,last:s},a=(s-o.last)/1e3;o.tokens+=a*this.eventsPerSecond,o.last=s,o.tokens>this.eventsBurstLimit&&(o.tokens=this.eventsBurstLimit);var l=o.tokens<1;return l||t||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||t||null===(r=this.captureWarning)||void 0===r||r.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=l,null===(n=this.persistence)||void 0===n||n.set(Pn,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class Ln{constructor(t){this.ge=null,this.me=null,this.be=t}get config(){return this.ge}onApply(t){this.ye=t}onLoad(t){this._e=t}load(){var t,i=this.be.getConfig();if(i.token){if(this.me||(this.me=e({},i)),null===(t=i.bootstrap)||void 0===t?void 0:t.remoteConfig)return this.ge=i.bootstrap.remoteConfig,this.we(this.ge),void this.xe();var r=lt(()=>B.__VTILT_BOOTSTRAP__);if(null==r?void 0:r.remoteConfig)return this.ge=r.remoteConfig,this.we(this.ge),void this.xe();lt(()=>{var t=localStorage.getItem(h+"_"+i.token);t&&(this.ge=JSON.parse(t),this.we(this.ge,!0))}),this.xe()}}xe(){var t=this.be.getConfig();if(t.token)if(Ct())this.be.updateConfig({__remote_config_loaded:!0});else{var i=this.be.buildEndpointUrl("/api/d"),r=new AbortController,n=setTimeout(()=>r.abort(),3e3);(q||fetch)(i,{method:"GET",signal:r.signal,headers:e({Accept:"application/json"},dt(t))}).then(t=>t.json()).then(i=>{var e;clearTimeout(n),St(),this.ge=i,lt(()=>{localStorage.setItem(h+"_"+t.token,JSON.stringify(i))}),this.we(i),null===(e=this._e)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(n),kt("config"),this.be.updateConfig({__remote_config_loaded:!0})})}}we(t,i){var r,n,s,o;void 0===i&&(i=!1);var a=this.me||this.be.getConfig(),l={};for(var[,u]of this.be.featureManager.getDescriptors())if(u.remoteConfig&&u.configKey){var h=t[u.remoteConfig.key];h&&void 0===a[u.configKey]&&(l[u.configKey]=u.remoteConfig.map(h))}if(t.analytics&&!i&&(void 0!==t.analytics.capturePageview&&void 0===a.capture_pageview&&(l.capture_pageview=t.analytics.capturePageview),void 0!==t.analytics.capturePageleave&&void 0===a.capture_pageleave&&(l.capture_pageleave=!!t.analytics.capturePageleave),void 0!==t.analytics.capturePerformance&&void 0===a.capture_performance&&(l.capture_performance=t.analytics.capturePerformance),void 0===a.autocapture)){var d=t.analytics.autocapture,v=t.analytics.scrollDepthMilestones,c=t.analytics.scrollDepthPageleave;void 0!==d&&(l.autocapture=d&&(v||c)?{scroll_depth:e({},v?{milestones:!0}:{},c?{pageleave:!0}:{})}:d)}i||(l.__remote_config_loaded=!0),void 0!==(null===(r=t.privacy)||void 0===r?void 0:r.respectDnt)&&void 0===a.respect_dnt&&(l.respect_dnt=t.privacy.respectDnt),void 0!==(null===(n=t.privacy)||void 0===n?void 0:n.requireConsent)&&void 0===a.require_consent&&(l.require_consent=t.privacy.requireConsent),void 0!==t.autocapture_opt_out&&(l.autocapture_opt_out=t.autocapture_opt_out),void 0!==t.elementsChainAsString&&(l.elementsChainAsString=t.elementsChainAsString),(null===(s=t.diagnostics)||void 0===s?void 0:s.defaultLogLevel)&&ot().setLevelFromRemote(t.diagnostics.defaultLogLevel),Object.keys(l).length>0&&this.be.updateConfig(l),null===(o=this.ye)||void 0===o||o.call(this,t)}}var Un=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"];function Dn(t,i){if(void 0===i&&(i=[]),!t)return!1;var e=t.toLowerCase();return[...Un,...i].some(t=>-1!==e.indexOf(t.toLowerCase()))}function Bn(t,i){var e;if(void 0===i&&(i=[]),!t)return!1;var r=t.userAgent;if(r&&Dn(r,i))return!0;try{var n=t.userAgentData;if(null===(e=null==n?void 0:n.brands)||void 0===e?void 0:e.some(t=>Dn(null==t?void 0:t.brand,i)))return!0}catch(t){}return!!t.webdriver}var jn=36e5;function zn(){var t,i,e;return null!==(e=null===(i=null===(t=null==B?void 0:B.performance)||void 0===t?void 0:t.now)||void 0===i?void 0:i.call(t))&&void 0!==e?e:Date.now()}class Nn{constructor(){this.ke=zn(),this.Se=null,this.Ce=zn(),this.Me="",this.Ae="",this.$e="",this.Ee=""}onAfterPageview(){var t=zn();this.ke=t,this.Se=t,this.Ee="",F&&(this.Me=F.href||"",this.Ae=F.pathname||""),N&&(this.$e=N.title||"")}peekEngagementSinceLastCaptureMs(){var t,i=zn(),e=null!==(t=this.Se)&&void 0!==t?t:this.Ce,r=Math.round(i-e);return r<1&&(r=1),r>jn&&(r=jn),r}commitCaptureClock(){this.Se=zn()}Re(){return this.Me+"\0"+this.Ae}clearLeaveDedupe(){this.Ee=""}tryCapturePageleave(t,i,e,r){if(function(t){var i=t.capture_pageleave;return!1!==i&&(!0===i||!1!==t.capture_pageview)}(t)){var n=this.Re();if((this.Me||this.Ae)&&n&&this.Ee!==n){this.Ee=n;var s=zn(),o=Math.round(s-this.ke);o<1&&(o=1),o>jn&&(o=jn);var a={navigation_type:e,engagement_time_msec:o,[R]:this.Me,[T]:this.Ae,[I]:Math.round(o/1e3),[P]:this.Ae,[O]:this.Me},l=this.Me?function(t){try{return new URL(t).host}catch(t){return""}}(this.Me):"";l&&(a.$host=l),this.$e&&(a.title=this.$e),r&&Object.assign(a,r),i(y,a,{skip_engagement:!0})}}}}var Fn=[_,w,x,y,M,A,k,E],qn=new Set([_,w,x]),Hn=new Set([y,E,M,A,k]);class Wn{constructor(t){this.Te=!1,this.Ie=!1,this.Pe=null,this.Oe=null,this.Le=new Nn,this.be=t}setVtPersonId(t){this.Oe=t}capture(t,i,r){var n,s,o;this.be.sessionManager.setSessionId();var a=this.be.getConfig();if(a.opt_out_useragent_filter||!Bn(z,null!==(n=a.custom_blocked_useragents)&&void 0!==n?n:[]))if((null==z?void 0:z.userAgent)&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(z.userAgent))if((null==r?void 0:r.skip_client_rate_limiting)||Fn.includes(t)||this.be.rateLimiter.shouldAllowEvent())if(!this.be.getConfig().require_consent||qn.has(t)||(null===(s=this.be.consentManager)||void 0===s?void 0:s.hasConsent())){var l=this.be.buildUrl(),u=!0===(null==r?void 0:r.skip_engagement)||Hn.has(t),h=e({},i);u||"number"==typeof h.engagement_time_msec||(h=e({},h,{engagement_time_msec:this.Le.peekEngagementSinceLastCaptureMs()}));var d=e({},this.Ue(t,h),a.globalAttributes),v=JSON.stringify(d);if(!(c=v)||"string"!=typeof c||c.length<2||c.length>$t)ot().debug("capture","dropped",t,{reason:"payload_invalid_size",bytes:v.length,limitBytes:$t,hint:t===S?"Trim global / event properties; $elements is already off by default in compact mode.":"Trim event properties; payload exceeded the runaway-guard cap."});else{var c,f=t===_?this.be.userManager.getAnonymousId():null!==(o=this.be.userManager.getDistinctId())&&void 0!==o?o:this.be.userManager.getAnonymousId(),p={timestamp:(new Date).toISOString(),event:t,payload:d,distinct_id:f,anonymous_id:this.be.userManager.getAnonymousId()};this.be.bufferEvent(t,l,p),ot().debug("capture","enqueued",t,e({distinct_id:f,$current_url:d.$current_url,$session_id:d.$session_id,$debug:d.$debug},t===S&&"object"==typeof d&&null!==d?{$event_type:d.$event_type}:{})),this.Oe&&(this.Oe=null),t===b?this.Le.onAfterPageview():this.Le.commitCaptureClock()}}else ot().debug("capture","dropped",t,{reason:"require_consent_and_no_consent"});else ot().debug("capture","dropped",t,{reason:"client_rate_limited",hint:"Token bucket (~10/s, burst ~100). $autocapture counts toward the same limit as custom events."});else ot().debug("capture","dropped",t,{reason:"invalid_or_missing_user_agent"});else ot().debug("capture","dropped",t,{reason:"bot"})}captureInternal(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}captureInitialPageview(){N&&("visible"===N.visibilityState?this.Ie||(this.Ie=!0,setTimeout(()=>{N&&F&&!1!==this.be.getConfig().capture_pageview&&this.capture(b,{navigation_type:"initial_load"})},300),this.Pe&&(N.removeEventListener("visibilitychange",this.Pe),this.Pe=null)):this.Pe||(this.Pe=()=>this.captureInitialPageview(),Rt(N,"visibilitychange",this.Pe)))}tryCapturePageleave(t,i){this.Le.tryCapturePageleave(this.be.getConfig(),(t,i,e)=>this.capture(t,i,e),t,i)}resetPageleaveDedupe(){this.Le.clearLeaveDedupe()}De(){if(this.be.getConfig().debug)return!0;try{if(null==F?void 0:F.search)if("1"===new URLSearchParams(F.search).get("vtilt_debug"))return!0}catch(t){}return!1}Ue(t,i){var r,n,s=this.be.getConfig(),o=s.mask_personal_data_properties,a=s.custom_personal_data_properties,l=ae(o,a),u=Pt(function(t,i,e){if(!N)return{};var r=i?It([],Xi,e||[]):[];return Tt({},Yi(Ht(N.URL,r,Qi)))}(0,o,a)),h=this.be.userManager.getUserProperties(),d=this.be.userManager.get_initial_props(),v=this.be.sessionManager.getSessionId(),c=this.be.sessionManager.getWindowId(),f={};!this.Te&&Object.keys(d).length>0&&Object.assign(f,d),i.$set_once&&Object.assign(f,i.$set_once);var p=e({},l,u,h,null!==(n=null===(r=this.be.consentManager)||void 0===r?void 0:r.getConsentProperties())&&void 0!==n?n:{},{$session_id:v,$window_id:c},this.Oe?{$vt:this.Oe}:{},Object.keys(f).length>0?{$set_once:f}:{},i.$set?{$set:i.$set}:{},i);!this.Te&&Object.keys(d).length>0&&(this.Te=!0),t===b&&N&&(p.title=N.title),this.De()&&(p.$debug=!0);var g=this.be.sessionManager.consumeSessionStart(),m=this.be.userManager.consumeFirstVisit();return g&&(p.$session_start=!0),m&&(p.$first_visit=!0),p}}var Vn=["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"];function Gn(t){return!(!t||"string"!=typeof t)&&Vn.includes(t.toLowerCase().trim())}class Kn{constructor(t){this.Be=null,this.je=null,this.be=t}identify(t,i,r){var n;if("number"==typeof t&&(t=String(t),ot().warn("identify","first argument should be a string, not a number")),t)if(Gn(t))ot().error("identify",'"'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var s=JSON.stringify([t,i,r]);if(this.Be!==s){var o=this.be.userManager,a=o.getDistinctId(),l=o.getAnonymousId(),u=o.getDeviceId();if(!("identified"===o.getUserState())&&l!==t||t!==a){this.be.capture(_,{distinct_id:t,$set:i||{},$set_once:r||{}});var h={user_state:"identified",distinct_id:t,properties_set:i,properties_set_once:r};if(!u){var d=a||l;h.device_id=d,h.properties_set=e({$had_persisted_distinct_id:!0,$device_id:d},h.properties_set||{})}o.applyUpdate(h),null===(n=this.be.Ri)||void 0===n||n.emit("user:identified",{distinctId:t})}else(i||r)&&this.setUserProperties(i,r);this.Be=s}}else ot().error("identify","cannot use sentinel value as distinct_id");else ot().error("identify","unique user id is required")}setUserProperties(t,i){var e,r;if(t||i){var n=this.be.userManager,s=JSON.stringify([null!==(e=n.getDistinctId())&&void 0!==e?e:n.getAnonymousId(),t,i]);this.je!==s&&(n.applyUpdate({properties_set:t,properties_set_once:i}),this.be.capture(x,{$set:t||{},$set_once:i||{}}),null===(r=this.be.Ri)||void 0===r||r.emit("user:properties_set",{properties:t}),this.je=s)}}resetUser(t){var i;this.be.sessionManager.resetSessionId(),this.be.userManager.reset(t),this.Be=null,this.je=null,null===(i=this.be.Ri)||void 0===i||i.emit("user:reset")}alias(t,i){var e;if(t&&!Gn(t)){var r=this.be.userManager,n=null!==(e=null!=i?i:r.getDistinctId())&&void 0!==e?e:r.getAnonymousId();n&&!Gn(n)?t!==n?this.be.capture(w,{$original_id:n,$alias_id:t}):this.identify(t):ot().warn("alias","invalid original distinct ID")}else ot().warn("alias","invalid alias")}getUserIdentity(){return this.be.userManager.getUserIdentity()}getDeviceId(){return this.be.userManager.getDeviceId()}getUserState(){return this.be.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.be.userManager.getDistinctId())&&void 0!==t?t:this.be.userManager.getAnonymousId()}getAnonymousId(){return this.be.userManager.getAnonymousId()}}var Jn="_vtilt_consent";class Xn{constructor(t){this.ze={},this.Ne=!1,this.be=t,this.Fe()}setConsent(t){var i;this.ze=e({},this.ze,t),this.Ne=!0,this.qe(),null===(i=this.be.Ri)||void 0===i||i.emit("consent:updated",{consent:this.ze})}getConsent(){return e({},this.ze)}hasConsent(){return this.Ne}setDefaultGranted(){this.Ne||(this.ze={analytics:!0,marketing:!0,advertising:!0},this.Ne=!0)}getConsentProperties(){var t={};return void 0!==this.ze.analytics&&(t.$consent_analytics=this.ze.analytics),void 0!==this.ze.marketing&&(t.$consent_marketing=this.ze.marketing),void 0!==this.ze.advertising&&(t.$consent_advertising=this.ze.advertising),t}reset(){this.ze={},this.Ne=!1,this.He()}Fe(){if(void 0!==N&&(null==N?void 0:N.cookie)){var t=Jn+"=";for(var i of N.cookie.split(";")){var e=i.trim();if(e.startsWith(t)){try{var r=decodeURIComponent(e.slice(15)),n=JSON.parse(r);n&&"object"==typeof n&&(this.ze=n,this.Ne=!0)}catch(t){}return}}}}qe(){if(void 0!==N){var t=encodeURIComponent(JSON.stringify(this.ze)),i="undefined"!=typeof location&&"https:"===location.protocol?"; Secure":"";N.cookie=Jn+"="+t+"; Max-Age=31536000; path=/; SameSite=Lax"+i}}He(){void 0!==N&&(N.cookie=Jn+"=; Max-Age=0; path=/")}}class Zn{constructor(t){this.We=new Map,this.Ve=new Map,this.be=t}register(t){this.We.set(t.name,t)}createInstances(){var t=this,i=this.be.getConfig(),e=function(e,r){return t.Ve.has(e)||t.Ge(i,r)?0:void lt(()=>{var n=r.FeatureClass.extractConfig(i),s=new r.FeatureClass(t.be,n);t.Ve.set(e,s)})};for(var[r,n]of this.We)e(r,n)}initAll(){this.createInstances();var t=function(t){lt(()=>{t.isStarted||t.startIfEnabled()})};for(var[,i]of this.Ve)t(i)}notifyAll(t){var i=function(i){i.onConfigUpdate&<(()=>i.onConfigUpdate(t))};for(var[,e]of this.Ve)i(e)}get(t){return this.Ve.get(t)}set(t,i){this.Ve.set(t,i)}getDescriptors(){return this.We}Ge(t,i){if(i.disableKey&&!0===t[i.disableKey])return!0;if(i.configKey){var e=t[i.configKey];if(e&&"object"==typeof e&&!1===e.enabled)return!0}return!1}}class Qn{constructor(t){this.ee=new bn,this.Ke=!1,this.Je=!1,this.be=t,this.Xe(),this.Ke||(this.Ze=setTimeout(()=>this.forceFlush(),5e3))}push(t){this.Ke?this.Qe(t):this.ee.enqueue(t)}markConfigReady(){this.Je||(this.Je=!0,this.Ye())}forceFlush(){this.tr(),this.Z(),this.Ke=!0}Xe(){this.Ke=this.Je}Ye(){this.Xe(),this.Ke&&(this.tr(),this.Z())}Z(){var t=this.ee.takeAll();for(var i of t)this.Qe(i);t.length>0&&this.be.requestQueue.flush()}Qe(t){if(this.Je){if(this.ir(t.name))return}else this.er(t.event);this.be.sendRequest(t.url,t.event)}ir(t){var i=this.be.getConfig();switch(t){case b:return!1===i.capture_pageview;case y:return!1===i.capture_pageleave;case k:return!1===i.capture_performance;case S:case C:return!1===i.autocapture;default:return!1}}er(t){"object"==typeof t.payload&&null!==t.payload&&(t.payload.$config_pending=!0)}tr(){void 0!==this.Ze&&(clearTimeout(this.Ze),this.Ze=void 0)}}var Yn="vt";class ts{constructor(t){void 0===t&&(t={}),this.version=r,this.__loaded=!1,this.rr=!1,this.nr=!1,this.sr=[],this.ar=!1,ot().debug("ctor","start"),this.Ri=new vt,this.configManager=new V(t);var i=this.configManager.getConfig();at(i),this.sessionManager=new jt(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new le(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.rateLimiter=new On({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.lr.captureInternal(E,{$$client_ingestion_warning_message:t})}}),this.retryQueue=new In({sendRequest:t=>this.ur(t),sendBeacon:t=>this.hr(t)}),this.requestQueue=new Tn(t=>this.dr(t),{flush_interval_ms:3e3}),this.consentManager=new Xn(this),this.lr=new Wn(this),this.vr=new Kn(this),this.cr=new Zn(this),this.pr=new Ln(this),this.gr(),this.pr.onLoad(t=>{this.Ri.emit(pt,{config:t})}),this.mr(),ot().debug("ctor","boot gate installed")}gr(){this.cr.register({name:"HistoryAutocapture",configKey:"capture_pageview",FeatureClass:ge}),this.cr.register({name:"Autocapture",configKey:"autocapture",FeatureClass:or}),this.cr.register({name:"WebVitals",configKey:"capture_performance",FeatureClass:fe}),this.cr.register({name:"SessionRecording",configKey:"session_recording",disableKey:"disable_session_recording",remoteConfig:{key:"sessionRecording",map:t=>({enabled:t.enabled,sampleRate:t.sampleRate,minimumDurationMs:t.minimumDurationMs,fullSnapshotIntervalMs:t.fullSnapshotIntervalMs,maskAllInputs:t.maskAllInputs,captureConsole:t.captureConsole,captureCanvas:t.captureCanvas})},FeatureClass:lr}),this.cr.register({name:"Chat",configKey:"chat",disableKey:"disable_chat",remoteConfig:{key:"chat",map:t=>({enabled:t.enabled,position:t.widgetPosition,color:t.widgetColor})},FeatureClass:Qr}),this.cr.register({name:"GoogleTagGateway",configKey:"google_tag",disableKey:"disable_google_tag",remoteConfig:{key:"googleTag",map:t=>t},FeatureClass:_n})}mr(){var t=this,i=function(i){var e=t[i];t[i]=function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];if(t.nr)return e.apply(t,n);t.sr.push([i,...n])}};for(var e of ts.BOOT_GATED_METHODS)i(e)}br(){if(!this.nr){for(var t of(this.nr=!0,ot().debug("boot","start"),ts.BOOT_GATED_METHODS))delete this[t];ot().debug("boot","gate removed"),this.__loaded&&!this.ar?(ot().debug("boot","running _runPostBootInit"),this.yr()):ot().debug("boot","skipping _runPostBootInit","loaded?",this.__loaded,"postBootDone?",this.ar),ot().debug("boot","flush pendingCalls",this.sr.length),this._execute_array(this.sr),this.sr=[]}}init(t,i,e){var r;if(e&&e!==Yn){var n=null!==(r=rs[e])&&void 0!==r?r:new ts;return n._init(t,i,e),rs[e]=n,rs[Yn][e]=n,n}return this._init(t,i,e)}_init(t,i,r){if(void 0===i&&(i={}),this.__loaded)return ot().warn("init","already initialized; re-initializing is a no-op"),this;this.configManager.updateConfig(e({},i,{token:t||i.token,name:r}));var n=this.configManager.getConfig();return at(n),this.__loaded=!0,ot().debug("init","start","token present?",!!n.token,"name",null!=r?r:"vt"),this.cr.createInstances(),this.nr||void 0===N||"interactive"!==N.readyState&&"complete"!==N.readyState||(ot().debug("init","self-boot?",N.readyState),this.br()),this.nr&&!this.ar&&this.yr(),ot().debug("init","postBootInitDone",this.ar),this}yr(){if(!this.ar){this.ar=!0,ot().debug("postBoot","start");var t=this.configManager.getConfig();this.sessionManager=new jt(t.storage||"cookie",t.cross_subdomain_cookie),this.sessionManager.hydrateFromStorage(),ot().debug("postBoot","sessionManager hydrated");var i=t.persistence||"localStorage+cookie";this.userManager.updateStorageMethod(i,t.cross_subdomain_cookie),this.userManager.hydrateFromStorage(),ot().debug("postBoot","userManager hydrated"),t.require_consent||this.consentManager.hasConsent()||this.consentManager.setDefaultGranted(),!0===this.consentManager.getConsent().advertising&&Jt(),this.Ri.on("consent:updated",t=>{var i=t.consent;!0===i.advertising?Jt():!1===i.advertising&&void 0!==N&&(N.cookie=Wt+"=; Max-Age=0; path=/",N.cookie=Vt+"=; Max-Age=0; path=/")}),this._r(),this.userManager.set_initial_person_info(t.mask_personal_data_properties,t.custom_personal_data_properties),this.wr=new Qn({sendRequest:(t,i)=>this.sendRequest(t,i),requestQueue:this.requestQueue,getConfig:()=>this.configManager.getConfig()}),this.cr.initAll(),ot().debug("postBoot","features inited"),this.pr.load(),this.kr(),this.Sr();var e=this.configManager.getConfig();!1!==e.capture_pageview&&this.lr.captureInitialPageview(),this.cr.notifyAll(e),this.Ri.emit(ct,{config:e}),ot().debug("postBoot","done"),ot().info("init","SDK ready")}}startAutocapture(){var t=this.cr.get("Autocapture");if(!t){var i=or.extractConfig(this.configManager.getConfig());t=new or(this,i),this.cr.set("Autocapture",t)}t.updateConfig({enabled:!0})}stopAutocapture(){var t=this.cr.get("Autocapture");t&&t.updateConfig({enabled:!1})}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this.cr.get("Autocapture"))||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}getAutocaptureDiagnostics(){var t,i;return null!==(i=null===(t=this.cr.get("Autocapture"))||void 0===t?void 0:t.getDiagnostics())&&void 0!==i?i:null}startSessionRecording(){var t=this.cr.get("SessionRecording");t||(t=new lr(this),this.cr.set("SessionRecording",t)),t.updateConfig({enabled:!0}),t.startIfEnabledOrStop("recording_initialized"),this.Ri.emit(bt)}stopSessionRecording(){var t;null===(t=this.cr.get("SessionRecording"))||void 0===t||t.stop(),this.Ri.emit(yt)}isRecordingActive(){var t;return"active"===(null===(t=this.cr.get("SessionRecording"))||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this.cr.get("SessionRecording"))||void 0===t?void 0:t.sessionId)||null}openChat(){var t=this.cr.get("Chat");t?t.open():ot().warn("chat","openChat: feature not available")}closeChat(){var t=this.cr.get("Chat");t?t.close():ot().warn("chat","closeChat: feature not available")}toggleChat(){var t=this.cr.get("Chat");t?t.toggle():ot().warn("chat","toggleChat: feature not available")}showChat(){var t=this.cr.get("Chat");t?t.show():ot().warn("chat","showChat: feature not available")}hideChat(){var t=this.cr.get("Chat");t?t.hide():ot().warn("chat","hideChat: feature not available")}sendChatMessage(t,i){var e=this.cr.get("Chat");e?e.sendMessage(t,i):ot().warn("chat","sendChatMessage: feature not available")}gtag(){for(var t=this.cr.get("GoogleTagGateway"),i=arguments.length,e=new Array(i),r=0;r<i;r++)e[r]=arguments[r];t?t.gtag(...e):this.sr.push(["gtag",...e])}setGoogleUserData(t){var i=this.cr.get("GoogleTagGateway");return i?i.setUserData(t):Promise.resolve()}get featureManager(){return this.cr}on(t,i){return this.Ri.on(t,i)}once(t,i){return this.Ri.once(t,i)}off(t){this.Ri.off(t)}_is_bot(){var t,i=this.getConfig();return!i.opt_out_useragent_filter&&Bn(z,null!==(t=i.custom_blocked_useragents)&&void 0!==t?t:[])}capture(t,i,e){this.lr.capture(t,i,e),this.Ri.emit(mt,{event:t,payload:i})}tryCapturePageleave(t){var i,e=null===(i=this.cr.get("Autocapture"))||void 0===i?void 0:i.getMaxScrollDepthPctForPageleave(),r=null!=e?{[D]:e}:void 0;this.lr.tryCapturePageleave(t,r)}identify(t,i,e){this.vr.identify(t,i,e)}setUserProperties(t,i){this.vr.setUserProperties(t,i)}resetUser(t){this.vr.resetUser(t)}alias(t,i){this.vr.alias(t,i)}setConsent(t){this.consentManager.setConsent(t)}getConsent(){return this.consentManager.getConsent()}getUserIdentity(){return this.vr.getUserIdentity()}getDeviceId(){return this.vr.getDeviceId()}getUserState(){return this.vr.getUserState()}getConfig(){return this.configManager.getConfig()}getRemoteConfig(){return this.pr.config}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.vr.getDistinctId()}getAnonymousId(){return this.vr.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:Yn;return i!==Yn&&(i="vt."+i),i}updateConfig(t){var i,e=this.configManager.getConfig();this.configManager.updateConfig(t);var r=this.configManager.getConfig();!e.__remote_config_loaded&&r.__remote_config_loaded&&(null===(i=this.wr)||void 0===i||i.markConfigReady()),this.cr.notifyAll(r),this.Ri.emit(ft,{config:r})}buildUrl(){return this.buildEndpointUrl("/api/e")}buildEndpointUrl(t){return ht(this.configManager.getConfig(),t)}sendRequest(t,i){this.Cr()&&this.requestQueue.enqueue({url:t,event:i})}bufferEvent(t,i,e){t!==M&&t!==A?this.wr.push({name:t,url:i,event:e}):this.sendRequest(i,e)}Cr(){return!!this.configManager.getConfig().token||(this.rr||(ot().warn("config","token is required for tracking"),this.rr=!0),!1)}dr(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.hr(t)}ur(t){return new Promise(i=>{var{url:e,events:r}=t,n=this.configManager.getConfig(),s=1===r.length?r[0]:{events:r},o=n.disable_compression?kn.None:kn.GZipJS;Rn({url:e,data:s,method:"POST",transport:"XHR",compression:o,projectToken:n.token,callback:t=>i({statusCode:t.statusCode})})})}hr(t){var{url:i,events:e}=t,r=this.configManager.getConfig(),n=1===e.length?e[0]:{events:e},s=r.disable_compression?kn.None:kn.GZipJS;Rn({url:i,data:n,method:"POST",transport:"sendBeacon",compression:s,projectToken:r.token})}Mr(t){this.sendRequest(t.url,t.event)}kr(){if(B){var t=()=>{this.wr.forceFlush(),this.requestQueue.unload(),this.retryQueue.unload()};Rt(B,"beforeunload",t),Rt(B,"pagehide",()=>{this.lr.tryCapturePageleave("pagehide"),t()}),N&&Rt(N,"visibilitychange",()=>{N&&("hidden"===N.visibilityState?this.lr.tryCapturePageleave("visibility_hidden"):"visible"===N.visibilityState&&this.lr.resetPageleaveDedupe())})}}Sr(){this.requestQueue.enable()}_r(){lt(()=>{var t,i;if(void 0!==F&&F.search){var e=new URL(F.href),r=e.searchParams.get("vt"),n=e.searchParams.get("vtd");if((null==r?void 0:r.trim())&&(this.lr.setVtPersonId(r.trim()),e.searchParams.delete("vt")),(null==n?void 0:n.trim())&&(this.Ar(n.trim()),e.searchParams.delete("vtd")),(null==r?void 0:r.trim())||(null==n?void 0:n.trim())){var s=e.pathname+(e.search||"")+e.hash;null===(i=null===(t=null==B?void 0:B.history)||void 0===t?void 0:t.replaceState)||void 0===i||i.call(t,{},"",s)}}})}Ar(t){this.vtdOverlay||(this.vtdOverlay=new xn(this),this.vtdOverlay.setDestinationUrl(t))}_execute_array(t){X(t)&&t.forEach(t=>{if(t&&X(t)&&t.length>0){var i=t[0],e=t.slice(1);"function"==typeof this[i]&<(()=>this[i](...e))}})}_dom_loaded(){this.Sr()}}ts.BOOT_GATED_METHODS=["capture","identify","setUserProperties","resetUser","alias","setConsent","startAutocapture","stopAutocapture","startSessionRecording","stopSessionRecording","openChat","closeChat","toggleChat","showChat","hideChat","sendChatMessage"];var is,es,rs={},ns=function(){function t(){if(!t.done){t.done=!0,ot().debug("dom","handler fired");var i=Object.keys(rs);ot().debug("boot","instance count",i.length),Et(rs,(t,i)=>{ot().debug("boot","instance",i),t.br(),t._dom_loaded()})}}if(N&&"function"==typeof N.addEventListener)return ot().debug("dom","readyState",N.readyState),void("complete"===N.readyState||"interactive"===N.readyState?(ot().debug("dom","running handler sync"),t()):(ot().debug("dom","registered DOMContentLoaded listener"),Rt(N,"DOMContentLoaded",t,{capture:!1})));B&&ot().error("dom","browser doesn't support document.addEventListener")};"undefined"!=typeof window&&window.vt&&Array.isArray(window.vt)&&(is=rs[Yn]=new ts,(es=W.vt)&&Et(es._i,function(t){if(t&&X(t)){var i=is.init(t[0],t[1],t[2]),e=es[t[2]||"vt"]||es;i&&i._execute_array(e)}}),W.vt=is,ns());var ss=function(){var t=rs[Yn]=new ts;return ns(),t}();exports.ALL_WEB_VITALS_METRICS=["LCP","CLS","FCP","INP","TTFB"],exports.DEFAULT_WEB_VITALS_METRICS=ue,exports.VTilt=ts,exports.default=ss,exports.vt=ss;
|
|
1
|
+
"use strict";function t(t,i,e,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void e(t)}a.done?i(l):Promise.resolve(l).then(r,n)}function i(i){return function(){var e=this,r=arguments;return new Promise(function(n,s){var o=i.apply(e,r);function a(i){t(o,n,s,a,l,"next",i)}function l(i){t(o,n,s,a,l,"throw",i)}a(void 0)})}}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},e.apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0});var r="1.13.1",n="__vt_session",s="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",l="__vt_device_id",u="__vt_anonymous_id",h="__vt_remote_config",d="__vt_distinct_id",v="__vt_user_properties",c="localStorage",f="localStorage+cookie",p="sessionStorage",g="memory",b="$initial_person_info",m="$pageview",y="$pageleave",_="$identify",w="$alias",x="$set",k="$performance_event",S="$autocapture",C="$scroll_depth",M="$snapshot",A="$snapshot_items",E="$$client_ingestion_warning",R="$current_url",T="$pathname",I="$prev_pageview_duration",P="$prev_pageview_pathname",O="$prev_pageview_url",L="$scroll_depth_pct",U="$scroll_depth_max_pct",D="$prev_pageview_scroll_depth_pct";function B(t,i){var r,n,s=i.bubble,o=null==t?void 0:t.bubble;if(s){var a=null===s.offset?void 0:void 0!==s.offset?e({},null===(r=null==t?void 0:t.bubble)||void 0===r?void 0:r.offset,s.offset):null===(n=null==t?void 0:t.bubble)||void 0===n?void 0:n.offset;o=e({},null==t?void 0:t.bubble,s,{offset:a})}return e({},t,i,{bubble:o})}var j="undefined"!=typeof window?window:void 0,z="undefined"!=typeof globalThis?globalThis:j,N=null==z?void 0:z.navigator,F=null==z?void 0:z.document,q=null==z?void 0:z.location,H=null==z?void 0:z.fetch;j&&F&&F.createElement,null==z||z.XMLHttpRequest,null==z||z.AbortController;var W=null==N?void 0:N.userAgent,V=null!=j?j:{};class G{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!(null==F?void 0:F.currentScript))return e({token:t.token||""},t);var i=F.currentScript,r=e({token:""},t);r.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,r.script_host=i.getAttribute("data-script-host")||t.script_host,r.token=i.getAttribute("data-token")||t.token||"",r.domain=i.getAttribute("data-domain")||t.domain,r.storage=i.getAttribute("data-storage")||t.storage,r.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var n="true"===i.getAttribute("data-capture-performance");for(var s of(r.capture_performance=!!n||t.capture_performance,r.globalAttributes=e({},t.globalAttributes),Array.from(i.attributes)))s.name.startsWith("data-vt-")&&(r.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return r}getConfig(){return e({},this.config)}updateConfig(t){var i=function(t,i){return void 0===i.chat?i:e({},i,{chat:B(t.chat,i.chat)})}(this.config,t);this.config=e({},this.config,i)}}function K(t){return"string"==typeof t}function J(t){return void 0===t}function X(t){return null==t}function Z(t){return Array.isArray(t)}function Q(t){return"function"==typeof t}var Y={none:0,error:1,warn:2,info:3,debug:4},tt="[vTilt]",it=new Set(["none","error","warn","info","debug"]);function et(){return"undefined"!=typeof console}function rt(t){var i=t.length>0&&"string"==typeof t[0]?t[0]:"",e=i?t.slice(1):t;return[i?tt+":"+i:tt,...e]}var nt="warn",st=!1;var ot=null;function at(){return ot||(ot={setLevel(t,i){void 0===i&&(i=!1),nt=t,i&&(st=!0)},setLevelFromRemote(t){st||t&&it.has(t)&&(nt=t)},getLevel:()=>nt,isLockedByInit:()=>st,debug(){if(!(Y[nt]<Y.debug)&&et()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.log(...rt(i))}},info(){if(!(Y[nt]<Y.info)&&et()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.log(...rt(i))}},warn(){if(!(Y[nt]<Y.warn)&&et()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.warn(...rt(i))}},error(){if(!(Y[nt]<Y.error)&&et()){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];console.error(...rt(i))}}}),ot}function lt(t,i){void 0===i&&(i=!0);var e=void 0!==t.log_level||!!t.debug,r=function(t){return t.log_level&&it.has(t.log_level)?t.log_level:t.debug?"debug":"warn"}(t);return at().setLevel(r,i&&e),r}function ut(t,i){try{return t()}catch(t){return i}}var ht="x-api-key";function dt(t,i,e){void 0===e&&(e={});var{api_host:r,token:n}=t,s=""+(r?r.replace(/\/+$/gm,""):"")+i;if(e.includeTokenQuery&&n){var o=s.includes("?")?"&":"?";s=""+s+o+"token="+n}return s}function vt(t){return t.token?{[ht]:t.token}:{}}class ct{constructor(){this.o=new Map,this.m=new Map}on(t,i){return this.o.has(t)||this.o.set(t,new Set),this.o.get(t).add(i),()=>{var e;null===(e=this.o.get(t))||void 0===e||e.delete(i)}}once(t,i){return this.m.has(t)||this.m.set(t,new Set),this.m.get(t).add(i),()=>{var e;null===(e=this.m.get(t))||void 0===e||e.delete(i)}}emit(t,i){var e,r;null===(e=this.o.get(t))||void 0===e||e.forEach(e=>{try{e(i)}catch(i){at().error("emitter",'error in event listener for "'+t+'":',i)}});var n=this.m.get(t);n&&(n.forEach(e=>{try{e(i)}catch(i){at().error("emitter",'error in once listener for "'+t+'":',i)}}),this.m.delete(t)),null===(r=this.o.get("*"))||void 0===r||r.forEach(e=>{try{e({event:t,payload:i})}catch(t){at().error("emitter","error in wildcard listener:",t)}})}off(t){t?(this.o.delete(t),this.m.delete(t)):(this.o.clear(),this.m.clear())}listenerCount(t){var i,e,r,n;return(null!==(e=null===(i=this.o.get(t))||void 0===i?void 0:i.size)&&void 0!==e?e:0)+(null!==(n=null===(r=this.m.get(t))||void 0===r?void 0:r.size)&&void 0!==n?n:0)}hasListeners(t){return this.listenerCount(t)>0}}var ft="sdk:initialized",pt="sdk:config_updated",gt="sdk:remote_config_loaded",bt="consent:updated",mt="event:captured",yt="recording:started",_t="recording:stopped",wt=0,xt=!1,kt=!1;function St(t){(wt+=1)<2||(xt=!0,kt||(kt=!0,at().warn(t,"vTilt network requests are being cancelled before reaching the server (likely an ad blocker, privacy extension, or DNS-level filter). Further retries and snapshots have been suspended for this page. Route SDK traffic through your own domain to avoid this — see https://www.vtilt.com/docs/browser/reverse-proxy.")))}function Ct(){wt=0}function Mt(){return xt}var At="23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function $t(t){for(var i=(2<<31-Math.clz32(57))-1,e=Math.ceil(1.6*i*t/57),r="";r.length<t;)for(var n=crypto.getRandomValues(new Uint8Array(e)),s=0;s<e&&r.length<t;s++){var o=n[s]&i;o<57&&(r+=At[o])}return r}var Et=1048576;function Rt(t,i,e){if(t)if(Array.isArray(t))t.forEach((t,r)=>{i.call(e,t,r)});else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&i.call(e,t[r],r)}function Tt(t,i,e,r){var{capture:n=!1,passive:s=!0}=null!=r?r:{};null==t||t.addEventListener(i,e,{capture:n,passive:s})}function It(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function Pt(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),r=1;r<i;r++)e[r-1]=arguments[r];for(var n of e)for(var s of n)t.push(s);return t}function Ot(t){var i={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];null!=r&&""!==r&&(i[e]=r)}return i}var Lt=[u,l,d,a],Ut=31536e3,Dt=["herokuapp.com","vercel.app","netlify.app"];function Bt(t){var i;if(!t||"undefined"==typeof document)return"";var e=null===(i=document.location)||void 0===i?void 0:i.hostname;if(!e)return"";var r=e.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return r?"."+r[0]:""}class jt{constructor(t){var i,e,r;this.memoryStorage=new Map,this.k=null,this.method=t.method,this.cross_subdomain=null!==(i=t.cross_subdomain)&&void 0!==i?i:function(){var t;if("undefined"==typeof document)return!1;var i=null===(t=document.location)||void 0===t?void 0:t.hostname;if(!i)return!1;var e=i.split(".").slice(-2).join(".");return!Dt.includes(e)}(),this.sameSite=null!==(e=t.sameSite)&&void 0!==e?e:"Lax",this.secure=null!==(r=t.secure)&&void 0!==r?r:"undefined"!=typeof location&&"https:"===location.protocol}isLocalStorageSupported(){if(null!==this.k)return this.k;if(void 0===j||!j.localStorage)return this.k=!1,!1;try{var t="__vt_ls_test__";j.localStorage.setItem(t,"1");var i="1"===j.localStorage.getItem(t);return j.localStorage.removeItem(t),this.k=i,i||at().warn("storage","localStorage unavailable, using cookies"),i}catch(t){return this.k=!1,at().warn("storage","localStorage unavailable, using cookies"),!1}}isCriticalProperty(t){return Lt.includes(t)}get(t){var i;try{switch(this.method){case g:return null!==(i=this.memoryStorage.get(t))&&void 0!==i?i:null;case f:return this.getLocalStoragePlusCookie(t);case c:return this.getLocalStorage(t);case p:return this.readFromSessionStorage(t);default:return this.getCookie(t)}}catch(i){return at().warn("storage",'get error for "'+t+'":',i),null}}set(t,i,e){try{switch(this.method){case g:this.memoryStorage.set(t,i);break;case f:this.setLocalStoragePlusCookie(t,i,e);break;case c:this.setLocalStorage(t,i);break;case p:this.writeToSessionStorage(t,i);break;default:this.setCookie(t,i,null!=e?e:Ut)}}catch(i){at().warn("storage",'set error for "'+t+'":',i)}}remove(t){try{switch(this.method){case g:this.memoryStorage.delete(t);break;case f:this.removeLocalStoragePlusCookie(t);break;case c:this.removeLocalStorage(t);break;case p:this.removeFromSessionStorage(t);break;default:this.removeCookie(t)}}catch(i){at().warn("storage",'remove error for "'+t+'":',i)}}getLocalStoragePlusCookie(t){if(this.isCriticalProperty(t)){var i=this.getCookie(t),e=this.getLocalStorage(t);if(null!==i){if(e!==i&&this.isLocalStorageSupported())try{null==j||j.localStorage.setItem(t,i)}catch(t){}return i}return null!==e?e:this.readFromSessionStorage(t)}return this.getLocalStorage(t)}setLocalStoragePlusCookie(t,i,e){this.setLocalStorage(t,i),this.isCriticalProperty(t)&&(this.setCookie(t,i,null!=e?e:Ut),this.writeToSessionStorage(t,i))}removeLocalStoragePlusCookie(t){this.removeLocalStorage(t),this.isCriticalProperty(t)&&(this.removeCookie(t),this.removeFromSessionStorage(t))}getLocalStorage(t){var i;if(!this.isLocalStorageSupported())return null;try{return null!==(i=null==j?void 0:j.localStorage.getItem(t))&&void 0!==i?i:null}catch(t){return null}}setLocalStorage(t,i){if(this.isLocalStorageSupported())try{null==j||j.localStorage.setItem(t,i)}catch(t){at().warn("storage","localStorage write error:",t)}}removeLocalStorage(t){if(this.isLocalStorageSupported())try{null==j||j.localStorage.removeItem(t)}catch(t){}}readFromSessionStorage(t){var i;try{return null!==(i=null==j?void 0:j.sessionStorage.getItem(t))&&void 0!==i?i:null}catch(t){return null}}writeToSessionStorage(t,i){try{null==j||j.sessionStorage.setItem(t,i)}catch(t){at().warn("storage","sessionStorage write error:",t)}}removeFromSessionStorage(t){try{null==j||j.sessionStorage.removeItem(t)}catch(t){}}getCookie(t){if("undefined"==typeof document)return null;var i=t+"=";for(var e of document.cookie.split(";")){var r=e.trim();if(r.startsWith(i))try{return decodeURIComponent(r.slice(i.length))}catch(t){return r.slice(i.length)}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var r=Bt(this.cross_subdomain),n=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite="+this.sameSite;this.secure&&(n+="; Secure"),r&&(n+="; domain="+r),document.cookie=n}}removeCookie(t){if("undefined"!=typeof document){var i=Bt(this.cross_subdomain);document.cookie=t+"=; Max-Age=0; path=/"+(i?"; domain="+i:""),document.cookie=t+"=; Max-Age=0; path=/"}}getWithExpiry(t){var i=this.get(t);if(!i)return null;try{var e=JSON.parse(i);return e.expiry&&Date.now()>e.expiry?(this.remove(t),null):e.value}catch(t){return null}}setWithExpiry(t,i,r){var n=e({value:i},r?{expiry:Date.now()+r}:{});this.set(t,JSON.stringify(n))}getJSON(t){var i=this.get(t);if(!i)return null;try{return JSON.parse(i)}catch(t){return null}}setJSON(t,i,e){this.set(t,JSON.stringify(i),e)}canUseSessionStorage(){if(void 0===j||!(null==j?void 0:j.sessionStorage))return!1;try{var t="__vt_ss_test__";return j.sessionStorage.setItem(t,"1"),j.sessionStorage.removeItem(t),!0}catch(t){return!1}}getSessionStorage(){var t;return this.canUseSessionStorage()&&null!==(t=null==j?void 0:j.sessionStorage)&&void 0!==t?t:null}setMethod(t){this.method=t}getMethod(){return this.method}}class zt{constructor(t,i){void 0===t&&(t="cookie"),this.S=!1,this.storage=new jt({method:t,cross_subdomain:i,sameSite:"Lax"}),this.C=void 0,at().debug("session","ctor")}hydrateFromStorage(){at().debug("session","hydrate"),this.M()}getSessionId(){var t=this.A();return t||(t=$t(16),this.$(t),this.S=!0),t}setSessionId(){var t=this.A(),i=t||$t(16);return t||(this.S=!0),this.$(i),i}resetSessionId(){this.R(),this.S=!0,this.setSessionId(),this.T($t(16))}consumeSessionStart(){return!!this.S&&(this.S=!1,!0)}A(){return this.storage.get(n)}$(t){this.storage.set(n,t,1800)}R(){this.storage.remove(n)}getWindowId(){if(this.C)return this.C;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(s);if(i)return this.C=i,i}var e=$t(16);return this.T(e),e}T(t){if(t!==this.C){this.C=t;var i=this.storage.getSessionStorage();i&&i.setItem(s,t)}}M(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(o),e=t.getItem(s);e&&!i?this.C=e:(e&&t.removeItem(s),this.T($t(16))),t.setItem(o,"true"),this.I()}else this.C=$t(16)}I(){var t=this.storage.getSessionStorage();j&&t&&Tt(j,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(o)},{capture:!1})}updateStorageMethod(t,i){this.storage=new jt({method:t,cross_subdomain:i,sameSite:"Lax"})}}function Nt(t){if(!F)return null;var i=F.createElement("a");return i.href=t,i}function Ft(t){try{return decodeURIComponent(t).replace(/\+/g," ")}catch(i){return t.replace(/\+/g," ")}}function qt(t){for(var i={},e=function(t){return((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"")}(t).split("&"),r=0;r<e.length;r++){var n=e[r];if(n){var s=n.indexOf("="),o=-1===s?n:n.slice(0,s);if(o){var a=Ft(o),l=-1===s?"":n.slice(s+1);i[a]=Ft(l)}}}return i}function Ht(t,i){var e;return null!==(e=qt(t)[i])&&void 0!==e?e:""}function Wt(t,i,e){if(!t||!i||!i.length)return t;for(var r=t.split("#"),n=r[0]||"",s=r[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),h=[],d=0;d<u.length;d++){var v=u[d].split("="),c=v[0],f=v.slice(1).join("=");-1!==i.indexOf(c)?h.push(c+"="+e):c&&h.push(c+(f?"="+f:""))}var p=h.join("&");return l+(p?"?"+p:"")+(s?"#"+s:"")}var Vt="_fbp",Gt="_fbc",Kt=15552e3,Jt=7776e3;function Xt(){void 0!==F&&(function(){if(Zt(Vt))return;var t=Date.now(),i=Math.floor(1e9+9e9*Math.random());Qt(Vt,"fb.1."+t+"."+i,Kt)}(),function(){if(!(null==q?void 0:q.search))return;try{var t=new URL(q.href).searchParams.get("fbclid");if(!(null==t?void 0:t.trim()))return;var i="fb.1."+Date.now()+"."+t.trim();Qt(Gt,i,Jt)}catch(t){}}())}function Zt(t){if(void 0===F||!(null==F?void 0:F.cookie))return null;var i=t+"=";for(var e of F.cookie.split(";")){var r=e.trim();if(r.startsWith(i))try{return decodeURIComponent(r.slice(i.length))}catch(t){return r.slice(i.length)}}return null}function Qt(t,i,e){if(void 0!==F){var r=void 0!==q&&"https:"===q.protocol?"; Secure":"";F.cookie=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite=Lax"+r}}var Yt="Mobile",ti="iOS",ii="Android",ei="Tablet",ri=ii+" "+ei,ni="iPad",si="Apple",oi=si+" Watch",ai="Safari",li="BlackBerry",ui="Samsung",hi=ui+"Browser",di=ui+" Internet",vi="Chrome",ci=vi+" OS",fi=vi+" "+ti,pi="Internet Explorer",gi=pi+" "+Yt,bi="Opera",mi=bi+" Mini",yi="Edge",_i="Microsoft "+yi,wi="Firefox",xi=wi+" "+ti,ki="Nintendo",Si="PlayStation",Ci="Xbox",Mi=ii+" "+Yt,Ai=Yt+" "+ai,$i="Windows",Ei=$i+" Phone",Ri="Nokia",Ti="Ouya",Ii="Generic",Pi=Ii+" "+Yt.toLowerCase(),Oi=Ii+" "+ei.toLowerCase(),Li="Konqueror",Ui="(\\d+(\\.\\d+)?)",Di=new RegExp("Version/"+Ui),Bi=new RegExp(Ci,"i"),ji=new RegExp(Si+" \\w+","i"),zi=new RegExp(ki+" \\w+","i"),Ni=new RegExp(li+"|PlayBook|BB10","i"),Fi={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};function qi(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Hi=(t,i)=>i&&qi(i,si)||function(t){return qi(t,ai)&&!qi(t,vi)&&!qi(t,ii)}(t),Wi=function(t,i){return i=i||"",qi(t," OPR/")&&qi(t,"Mini")?mi:qi(t," OPR/")?bi:Ni.test(t)?li:qi(t,"IE"+Yt)||qi(t,"WPDesktop")?gi:qi(t,hi)?di:qi(t,yi)||qi(t,"Edg/")?_i:qi(t,"FBIOS")?"Facebook "+Yt:qi(t,"UCWEB")||qi(t,"UCBrowser")?"UC Browser":qi(t,"CriOS")?fi:qi(t,"CrMo")||qi(t,vi)?vi:qi(t,ii)&&qi(t,ai)?Mi:qi(t,"FxiOS")?xi:qi(t.toLowerCase(),Li.toLowerCase())?Li:Hi(t,i)?qi(t,Yt)?Ai:ai:qi(t,wi)?wi:qi(t,"MSIE")||qi(t,"Trident/")?pi:qi(t,"Gecko")?wi:""},Vi={[gi]:[new RegExp("rv:"+Ui)],[_i]:[new RegExp(yi+"?\\/"+Ui)],[vi]:[new RegExp("("+vi+"|CrMo)\\/"+Ui)],[fi]:[new RegExp("CriOS\\/"+Ui)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ui)],[ai]:[Di],[Ai]:[Di],[bi]:[new RegExp("(Opera|OPR)\\/"+Ui)],[wi]:[new RegExp(wi+"\\/"+Ui)],[xi]:[new RegExp("FxiOS\\/"+Ui)],[Li]:[new RegExp("Konqueror[:/]?"+Ui,"i")],[li]:[new RegExp(li+" "+Ui),Di],[Mi]:[new RegExp("android\\s"+Ui,"i")],[di]:[new RegExp(hi+"\\/"+Ui)],[pi]:[new RegExp("(rv:|MSIE )"+Ui)],Mozilla:[new RegExp("rv:"+Ui)]},Gi=function(t,i){var e=Wi(t,i),r=Vi[e];if(void 0===r)return null;for(var n=0;n<r.length;n++){var s=r[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},Ki=[[new RegExp(Ci+"; "+Ci+" (.*?)[);]","i"),t=>[Ci,t&&t[1]||""]],[new RegExp(ki,"i"),[ki,""]],[new RegExp(Si,"i"),[Si,""]],[Ni,[li,""]],[new RegExp($i,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[Ei,""];if(new RegExp(Yt).test(i)&&!/IEMobile\b/.test(i))return[$i+" "+Yt,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var r=e[1],n=Fi[r]||"";return/arm/i.test(i)&&(n="RT"),[$i,n]}return[$i,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[ti,i.join(".")]}return[ti,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var i="";return t&&t.length>=3&&(i=void 0===t[2]?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+ii+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ii+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[ii,i.join(".")]}return[ii,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var i=["Mac OS X",""];if(t&&t[1]){var e=[t[1],t[2],t[3]||"0"];i[1]=e.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ci,""]],[/Linux|debian/i,["Linux",""]]],Ji=function(t){return zi.test(t)?ki:ji.test(t)?Si:Bi.test(t)?Ci:new RegExp(Ti,"i").test(t)?Ti:new RegExp("("+Ei+"|WPDesktop)","i").test(t)?Ei:/iPad/.test(t)?ni:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?oi:Ni.test(t)?li:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ri,"i").test(t)?Ri:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Yt).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?ii:ri:ii:new RegExp("(pda|"+Yt+")","i").test(t)?Pi:new RegExp(ei,"i").test(t)&&!new RegExp(ei+" pc","i").test(t)?Oi:""},Xi="https?://(.*)",Zi=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Qi=Pt(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Zi),Yi="<masked>";function te(t,i){var e=Qi.concat([]),r=It({},function(t){var i={};return Rt(qt(t),function(t,e){"string"==typeof e&&e.startsWith("utm_")&&t&&(i[e]=t)}),i}(t));return Rt(e,function(i){if(i.startsWith("utm_")){if(!(i in r)){var e=Ht(t,i);r[i]=e||null}}else{var n=Ht(t,i);r[i]=n||null}}),r}function ie(t){var i=function(t){return t?0===t.search(Xi+"google.([^/?]*)")?"google":0===t.search(Xi+"bing.com")?"bing":0===t.search(Xi+"yahoo.com")?"yahoo":0===t.search(Xi+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",r={};if(!function(t){return null===t}(i)){r.$search_engine=i;var n=F?Ht(F.referrer,e):"";n.length&&(r.ph_keyword=n)}return r}function ee(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function re(){return(null==F?void 0:F.referrer)||"$direct"}function ne(){var t;return(null==F?void 0:F.referrer)&&(null===(t=Nt(F.referrer))||void 0===t?void 0:t.host)||"$direct"}function se(t){var i=function(t){var i,{r:e,u:r}=t,n={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=Nt(e))||void 0===i?void 0:i.host};if(r){n.$current_url=r;var s=Nt(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname,It(n,te(r))}return e&&It(n,ie(e)),n}(t),e={};return Rt(i,function(t,i){var r;e["$initial_"+(r=String(i),r.startsWith("$")?r.substring(1):r)]=t}),e}function oe(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ae(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function le(t,i){if(!W)return{};var e,n,s,o=t?Pt([],Zi,i||[]):[],[a,l]=function(t){for(var i=0;i<Ki.length;i++){var[e,r]=Ki[i],n=e.exec(t);if(n){var s="function"==typeof r?r(n,t):r;if(s)return s}}return["",""]}(W),u=Zt(Vt)||void 0,h=Zt(Gt)||void 0;return It(Ot({$os:a,$os_version:l,$browser:Wi(W,navigator.vendor),$device:Ji(W),$device_type:(n=W,s=Ji(n),s===ni||s===ri||"Kobo"===s||"Kindle Fire"===s||s===Oi?ei:s===ki||s===Ci||s===Si||s===Ti?"Console":s===oi?"Wearable":s?Yt:"Desktop"),$timezone:oe(),$timezone_offset:ae(),$fb_browser_id:u,$fb_click_id:h}),{$current_url:Wt(null==q?void 0:q.href,o,Yi),$host:null==q?void 0:q.host,$pathname:null==q?void 0:q.pathname,$raw_user_agent:W.length>1e3?W.substring(0,997)+"...":W,$browser_version:Gi(W,navigator.vendor),$browser_language:ee(),$browser_language_prefix:(e=ee(),"string"==typeof e?e.split("-")[0]:void 0),$screen_height:null==j?void 0:j.screen.height,$screen_width:null==j?void 0:j.screen.width,$viewport_height:null==j?void 0:j.innerHeight,$viewport_width:null==j?void 0:j.innerWidth,$lib:"web",$lib_version:r,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10)})}class ue{constructor(t,i){void 0===t&&(t="localStorage"),this.P=!1,this.storage=new jt({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.generateEphemeralIdentity(),at().debug("user","ctor","ephemeral identity only")}hydrateFromStorage(){at().debug("user","hydrate start"),this.userIdentity=this.loadUserIdentity();var t=this.userIdentity.anonymous_id,i=this.userIdentity.distinct_id;at().debug("user","hydrate done","anonymous_id",t?t.slice(0,12)+"...":"n/a","distinct_id",i?i.slice(0,12)+"...":"null")}generateEphemeralIdentity(){return{distinct_id:null,anonymous_id:this.generateAnonymousId(),device_id:this.generateDeviceId(),properties:{},user_state:"anonymous"}}getUserIdentity(){return e({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){var t=this.userIdentity.anonymous_id;return t||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(u,this.userIdentity.anonymous_id,Ut),at().debug("user","getAnonymousId generated (was missing)",this.userIdentity.anonymous_id.slice(0,12)+"..."),this.userIdentity.anonymous_id)}getUserProperties(){return e({},this.userIdentity.properties)}getEffectiveId(){return this.userIdentity.distinct_id||this.getAnonymousId()}getDeviceId(){return this.userIdentity.device_id}getUserState(){return this.userIdentity.user_state}consumeFirstVisit(){return!!this.P&&(this.P=!1,!0)}applyUpdate(t){if(void 0!==t.distinct_id&&(this.userIdentity.distinct_id=t.distinct_id),void 0!==t.user_state&&(this.userIdentity.user_state=t.user_state),void 0!==t.device_id&&(this.userIdentity.device_id=t.device_id),t.properties_set&&(this.userIdentity.properties=e({},this.userIdentity.properties,t.properties_set)),t.properties_set_once)for(var i of Object.keys(t.properties_set_once))i in this.userIdentity.properties||(this.userIdentity.properties[i]=t.properties_set_once[i]);this.saveUserIdentity()}reset(t){this.userIdentity={distinct_id:null,anonymous_id:this.generateAnonymousId(),device_id:t?this.generateDeviceId():this.userIdentity.device_id,properties:{$last_vtilt_reset:(new Date).toISOString()},user_state:"anonymous"},this.saveUserIdentity()}set_initial_person_info(t,i){if(!this.getStoredUserProperties()[b]){var e=function(t,i){var e=t?Pt([],Zi,i||[]):[],r=null==q?void 0:q.href.substring(0,1e3);return{r:re().substring(0,1e3),u:r?Wt(r,e,Yi):void 0}}(t,i);this.register_once({[b]:e},void 0)}}get_initial_props(){var t=this.getStoredUserProperties()[b];return t?se(t):{}}update_referrer_info(){var t={$referrer:re(),$referring_domain:ne()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(u),i=this.storage.get(l),e=this.storage.get(d),r=this.storage.get(a),n=this.getStoredUserProperties(),s=t||this.generateAnonymousId(),o=i||this.generateDeviceId(),h=e||null,v=r||"anonymous";t?at().debug("user","hydrate","loaded from storage",t.slice(0,12)+"..."):(this.P=!0,at().debug("user","hydrate","generated new anonymous_id"));var c=s||this.generateAnonymousId();return t||this.storage.set(u,c,Ut),i||this.storage.set(l,o,Ut),r||this.storage.set(a,v,Ut),{distinct_id:h,anonymous_id:c,device_id:o,properties:n,user_state:v}}saveUserIdentity(){this.storage.set(u,this.userIdentity.anonymous_id,Ut),this.storage.set(l,this.userIdentity.device_id,Ut),this.storage.set(a,this.userIdentity.user_state,Ut),this.userIdentity.distinct_id?this.storage.set(d,this.userIdentity.distinct_id,Ut):this.storage.remove(d),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(v)||{}}setStoredUserProperties(t){this.storage.setJSON(v,t,Ut)}register_once(t,i){var e=this.getStoredUserProperties(),r=!1;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(n in e||(e[n]=t[n],r=!0));if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(s in e||(e[s]=i[s],r=!0));r&&this.setStoredUserProperties(e)}generateAnonymousId(){return"anon_"+$t(16)}generateDeviceId(){return"device_"+$t(16)}updateStorageMethod(t,i){this.storage=new jt({method:t,cross_subdomain:i,sameSite:"Lax"})}}var he=["LCP","CLS","FCP","INP"];class de{constructor(t,i){this.O=!1,this.L=!1,this.U=[],this.D=!1,this.B=[],this._instance=t,this.j=i}get isEnabled(){return!1!==this.j.enabled}get isStarted(){return this.O}get isLoaded(){return!!this.N}F(t){var i;if(this.N)t(this.N);else if(this.U.push(t),!this.L){this.L=!0;var e=null===(i=V.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return at().error("feature",this.name,"loadExternalDependency not available"),this.L=!1,void(this.U=[]);e(this._instance,this.scriptName,t=>{if(this.L=!1,t)return at().error("feature",this.name,"could not load "+this.scriptName+":",t),void(this.U=[]);this.N||(this.N=this.q());var i=this.N,e=this.U;for(var r of(this.U=[],e))try{r(i)}catch(t){at().error("feature",this.name,"load callback error:",t)}})}}startIfEnabled(){this.isEnabled&&!this.O&&(this.O=!0,this.F(t=>this.H(t)))}H(t){}stop(){this.O=!1}updateConfig(t){this.j=e({},this.j,t)}W(t){this.D?t():this.B.push(t)}V(){if(!this.D){this.D=!0;var t=this.B;for(var i of(this.B=[],t))try{i()}catch(t){at().error("feature",this.name,"deferred call error:",t)}}}G(){this.D=!1,this.B=[]}}class ve extends de{startIfEnabledOrStop(t){if(this.isEnabled){if(this.O&&this.N)return;this.O=!0,this.F(t=>this.H(t))}else this.stop()}}var ce=9e5,fe="web-vitals";class pe extends de{static extractConfig(t){var i=t.capture_performance;return"boolean"==typeof i?{web_vitals:i}:"object"==typeof i&&null!==i?i:{web_vitals:!1}}constructor(t,i){super(t,null!=i?i:pe.extractConfig(t.getConfig())),this.name="WebVitals",this.scriptName="web-vitals",this.K=this.J()}get isEnabled(){var t=null==q?void 0:q.protocol;return("http:"===t||"https:"===t)&&!0===this.j.web_vitals}startIfEnabled(){if(this.isEnabled&&!this.O&&j){var t=this.X();t?(this.O=!0,this.N=t,this.Z(t)):(this.O=!0,this.F(t=>this.H(t)))}}stop(){this.O&&(this.Y(),this.tt&&(clearTimeout(this.tt),this.tt=void 0),this.O=!1)}onConfigUpdate(t){var i=pe.extractConfig(t),e=this.isEnabled;this.j=i,e||!this.isEnabled||this.O?e&&!this.isEnabled&&this.O&&this.stop():this.startIfEnabled()}q(){var t=this.X();if(!t)throw new Error("[vTilt:web-vitals] web-vitals loaded but callbacks not registered");return t}H(t){this.Z(t)}get allowedMetrics(){return this.j.web_vitals_allowed_metrics||he}get flushTimeoutMs(){return this.j.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.j.__web_vitals_max_value;return void 0===t?ce:0===t?0:t<6e4?ce:t}J(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}X(){var t;return null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}Z(t){var i=this.allowedMetrics,e=this.it.bind(this);i.includes("LCP")&&t.onLCP&&t.onLCP(e),i.includes("CLS")&&t.onCLS&&t.onCLS(e,{reportAllChanges:!0}),i.includes("FCP")&&t.onFCP&&t.onFCP(e),i.includes("INP")&&t.onINP&&t.onINP(e),i.includes("TTFB")&&t.onTTFB&&t.onTTFB(e)}et(){var t;return null===(t=null==j?void 0:j.location)||void 0===t?void 0:t.href}rt(){return null==q?void 0:q.pathname}it(t){var i,r,n;try{if(!j||!F||!q)return;if(!(null==t?void 0:t.name)||void 0===(null==t?void 0:t.value))return void at().warn(fe,"invalid metric received",t);if(this.maxAllowedValue>0&&t.value>=this.maxAllowedValue&&"CLS"!==t.name)return void at().warn(fe,"ignoring "+t.name+" with value >= "+this.maxAllowedValue+"ms");var s=this.et(),o=this.rt();if(!s)return void at().warn(fe,"could not determine current URL");this.K.url&&this.K.url!==s&&this.Y(),this.K.url||(this.K.url=s,this.K.pathname=o),this.K.firstMetricTimestamp||(this.K.firstMetricTimestamp=Date.now());var a=this.nt(t.attribution),l=null!==(n=null===(r=(i=this._instance).getSessionId)||void 0===r?void 0:r.call(i))&&void 0!==n?n:null,u=this.st(),h=e({},t,{attribution:a,timestamp:Date.now(),$current_url:s,$session_id:l,$window_id:u}),d=this.K.metrics.findIndex(i=>i.name===t.name);d>=0?this.K.metrics[d]=h:this.K.metrics.push(h),this.ot(),this.K.metrics.length>=this.allowedMetrics.length&&this.Y()}catch(t){at().error(fe,"error adding metric to buffer:",t)}}nt(t){if(t){var i=e({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}st(){var t;try{return(null===(t=this._instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}ot(){this.tt&&clearTimeout(this.tt),this.tt=setTimeout(()=>{this.Y()},this.flushTimeoutMs)}Y(){if(this.tt&&(clearTimeout(this.tt),this.tt=void 0),0!==this.K.metrics.length){try{var t={$pathname:this.K.pathname,$current_url:this.K.url};for(var i of this.K.metrics)t["$web_vitals_"+i.name+"_value"]=i.value,t["$web_vitals_"+i.name+"_event"]={name:i.name,value:i.value,delta:i.delta,rating:i.rating,id:i.id,navigationType:i.navigationType,attribution:i.attribution,$session_id:i.$session_id,$window_id:i.$window_id};this._instance.capture("$web_vitals",t)}catch(t){at().error(fe,"error flushing metrics:",t)}this.K=this.J()}}}function ge(t,i,e){try{if(!(i in t))return()=>{};var r=t[i],n=e(r);return Q(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=n,()=>{t[i]=r}}catch(t){return()=>{}}}class be{constructor(t,i){var e;this.name="HistoryAutocapture",this.O=!1,this._instance=t,this.j=i||be.extractConfig(t.getConfig()),this.lt=(null===(e=null==j?void 0:j.location)||void 0===e?void 0:e.pathname)||""}static extractConfig(t){return{enabled:!1!==t.capture_pageview}}get isEnabled(){return!1!==this.j.enabled&&!1!==this._instance.getConfig().capture_pageview}get isStarted(){return this.O}startIfEnabled(){this.isEnabled&&!this.O&&this.ut()}stop(){this.O&&(this.ht&&(this.ht(),this.ht=void 0),this.O=!1)}onConfigUpdate(t){this.j=be.extractConfig(t),this.isEnabled&&!this.O?this.ut():!this.isEnabled&&this.O&&this.stop()}ut(){j&&q&&(this.lt=q.pathname||"",this.dt(),this.ct(),this.O=!0,at().info("history-autocapture","started"))}dt(){var t,i;if(null==j?void 0:j.history){var e=this;(null===(t=j.history.pushState)||void 0===t?void 0:t.__vtilt_wrapped__)||ge(j.history,"pushState",t=>function(i,r,n){e.ft(n),t.call(this,i,r,n),e.gt("pushState")}),(null===(i=j.history.replaceState)||void 0===i?void 0:i.__vtilt_wrapped__)||ge(j.history,"replaceState",t=>function(i,r,n){e.ft(n),t.call(this,i,r,n),e.gt("replaceState")})}}ft(t){var i;if(q){var e=q.pathname||"",r=null!==(i=function(t){if(!q)return null;if(null==t||""===t)return q.pathname||null;try{return new URL(String(t),q.href).pathname}catch(t){return null}}(t))&&void 0!==i?i:e;r!==e&&this._instance.tryCapturePageleave("spa_transition")}}ct(){if(!this.ht&&j){var t=()=>{this.gt("popstate")};Tt(j,"popstate",t),this.ht=()=>{null==j||j.removeEventListener("popstate",t)}}}gt(t){this.isEnabled&&this.O&&ut(()=>{var i,e=null===(i=null==j?void 0:j.location)||void 0===i?void 0:i.pathname;if(e&&q&&F)if(e!==this.lt){at().debug("history-autocapture",t,e),this.lt=e;var r={navigation_type:t};this._instance.capture(m,r)}else this.lt=e})}}var me=["a","button","form","input","select","textarea","label"],ye="$copy_autocapture",_e=['[id*="cookie" i]','[class*="cookie" i]','[id*="consent" i]','[class*="consent" i]','[id*="gdpr" i]','[class*="gdpr" i]','[id*="privacy-banner" i]','[class*="privacy-banner" i]','[id*="cookie-banner" i]','[class*="cookie-banner" i]','[id*="cookie-notice" i]','[class*="cookie-notice" i]',"#CybotCookiebotDialog",'[class^="CybotCookiebotDialog"]','[id^="onetrust"]','[class^="onetrust"]','[id^="cc-"]',".cc-banner",".cc-window",".cc-revoke",'[id^="cookieconsent"]','[class^="cookieconsent"]','[id^="gdpr-cookie"]','[id^="qc-cmp"]',"#termly-code-snippet-support",'[id^="iubenda"]','[id^="truste"]','[class^="truste"]',"#consent_blackbar",'[id^="didomi"]','[id^="usercentrics"]',"#uc-center-container",".klaro","#klaro","#cookiescript_injected",".cky-consent-container","#cky-consent","#cmplz-cookiebanner-container","#gdpr-cookie-message",'[class*="fs-cc"]','[class*="fc-cc"]',"[fs-cc]","[fs-cc-checkbox]",'[class*="cookie-preferences"]',"#cookie-preferences",'[role="dialog"][aria-label*="cookie" i]','[role="dialog"][aria-label*="consent" i]','[aria-describedby*="cookie" i]','[aria-label*="Cookie Preferences" i]'];function we(t){return t.replace(/^\s+|\s+$/g,"")}function xe(t,i){return t.indexOf(i)>-1}function ke(t){return 1===(null==t?void 0:t.nodeType)}function Se(t){return 3===(null==t?void 0:t.nodeType)}function Ce(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Me(t){return 11===(null==t?void 0:t.nodeType)}function Ae(t){return t?we(t).split(/\s+/):[]}function $e(t){var i="";switch(typeof t.className){case"string":i=t.className;break;case"object":i=(t.className&&"baseVal"in t.className&&"string"==typeof t.className.baseVal?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return Ae(i)}function Ee(t){return X(t)?null:we(t).split(/(\s+)/).filter(t=>Fe(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Re(t){var i,e="";if(He(t)&&!We(t)&&t.childNodes&&t.childNodes.length)for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];Se(n)&&n.textContent&&(e+=null!==(i=Ee(n.textContent))&&void 0!==i?i:"")}return we(e)}function Te(t){var i,e="";if(t&&t.childNodes&&t.childNodes.length)for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];if(n&&"span"===(null===(i=n.tagName)||void 0===i?void 0:i.toLowerCase()))try{e=(e+" "+Re(n)).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+Te(n)).trim())}catch(t){}}return e}function Ie(t){var i=Re(t);return Fe(i=(i+" "+Te(t)).trim())?i:""}function Pe(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!ke(i));return i}function Oe(t){var i=t.parentNode;return!(!i||!ke(i))&&i}function Le(t){var i=null==j?void 0:j.location.href;return!!(i&&t&&t.some(t=>i.match(t)))}var Ue="(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})",De=new RegExp("^(?:"+Ue+")$"),Be=new RegExp(Ue),je="\\d{3}-?\\d{2}-?\\d{4}",ze=new RegExp("^("+je+")$"),Ne=new RegExp("("+je+")");function Fe(t,i){if(void 0===i&&(i=!0),X(t))return!1;if(K(t)){if(t=we(t),(i?De:Be).test((t||"").replace(/[- ]/g,"")))return!1;if((i?ze:Ne).test(t))return!1}return!0}function qe(t){return!!K(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function He(t){for(var i=t;i&&i.parentNode&&!Ce(i,"body");i=i.parentNode){var e=$e(i);if(xe(e,"vt-sensitive")||xe(e,"vt-no-capture"))return!1}if(xe($e(t),"vt-include"))return!0;var r=t.type||"";if(K(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(K(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function We(t){return!!(Ce(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||Ce(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function Ve(t){if(!He(t))return null;if(Ce(t,"input")){var i=t,e=(i.type||"text").toLowerCase();if("password"===e||"hidden"===e)return null;if("checkbox"===e||"radio"===e){var r={$el_value:i.checked?"true":"false"},n=function(t){var i=t.closest("label");if(i){var e=we(i.textContent||"");if(e&&Fe(e))return Ee(e)||null}if(t.id)try{var r=null===document||void 0===document?void 0:document.querySelector('label[for="'+t.id+'"]');if(r){var n=we(r.textContent||"");if(n&&Fe(n))return Ee(n)||null}}catch(t){}return null}(i);return n?r.$selected_text=n:i.value&&Fe(i.value)&&(r.$selected_text=i.value),r}var s=i.value;if(s&&Fe(s)){var o=Ee(s);if(o)return{$el_value:o}}return null}if(Ce(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var u=a.options[l],h={};u.value&&Fe(u.value)&&(h.$el_value=u.value);var d=u.text;if(d&&Fe(d)){var v=Ee(d);v&&(h.$selected_text=v)}if(h.$el_value||h.$selected_text)return h}return null}return Ce(t,"textarea"),null}function Ge(t,i,e,r,n){if(void 0===e&&(e=void 0),!j)return{capture:!1,reason:"no_window"};if(!t)return{capture:!1,reason:"no_element"};if(Ce(t,"html")||!ke(t))return{capture:!1,reason:"html_element"};if((null==e?void 0:e.url_allowlist)&&!Le(e.url_allowlist))return{capture:!1,reason:"url_allowlist_miss"};if((null==e?void 0:e.url_ignorelist)&&Le(e.url_ignorelist))return{capture:!1,reason:"url_ignorelist_hit"};if(null==e?void 0:e.dom_event_allowlist){var s=e.dom_event_allowlist;if(s&&!s.some(t=>i.type===t))return{capture:!1,reason:"dom_event_not_allowed"}}for(var o=!1,a=[t],l=!0,u=t;u.parentNode&&!Ce(u,"body");)if(Me(u.parentNode))a.push(u.parentNode.host),u=u.parentNode.host;else{if(!(l=Oe(u)))break;if(r||me.indexOf(l.tagName.toLowerCase())>-1)o=!0;else{var h=j.getComputedStyle(l);h&&"pointer"===h.getPropertyValue("cursor")&&(o=!0)}a.push(l),u=l}if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(J(e))return!0;var r,n=function(t){if(e.some(i=>t.tagName.toLowerCase()===i))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(a,e))return{capture:!1,reason:"element_allowlist_miss"};if(!function(t,i){var e=null==i?void 0:i.css_selector_allowlist;if(J(e))return!0;var r,n=function(t){if(e.some(i=>t.matches(i)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(a,e))return{capture:!1,reason:"css_selector_allowlist_miss"};if(function(t,i){var e=null==i?void 0:i.css_selector_ignorelist,r=void 0===e?_e:e;if(0===r.length)return!1;for(var n of t)for(var s of r)try{if(n.matches(s))return!0}catch(t){}return!1}(a,e))return{capture:!1,reason:"css_selector_ignorelist_hit"};var d=j.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===i.type)return{capture:!0};var v=t.tagName.toLowerCase();switch(v){case"html":return{capture:!1,reason:"tag_html"};case"form":return(n||["submit"]).indexOf(i.type)>=0?{capture:!0}:{capture:!1,reason:"form_event_not_allowed"};case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(i.type)>=0?{capture:!0}:{capture:!1,reason:"input_event_not_allowed"};default:return o?(n||["click"]).indexOf(i.type)>=0?{capture:!0}:{capture:!1,reason:"dom_event_not_allowed"}:(n||["click"]).indexOf(i.type)>=0&&(me.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))?{capture:!0}:{capture:!1,reason:"tag_not_capturable"}}}function Ke(t,i){return i.length>t?i.slice(0,t)+"...":i}function Je(t,i,e,r){var n=t.tagName.toLowerCase(),s={tag_name:n};me.indexOf(n)>-1&&!e&&(s.$el_text=Ke(1024,"a"===n||"button"===n?Ie(t):Re(t)));var o=$e(t);o.length>0&&(s.classes=o.filter(t=>""!==t));for(var a=0;a<t.attributes.length;a++){var l=t.attributes[a];if((!We(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==r?void 0:r.includes(l.name))&&!i&&Fe(l.value)&&!qe(l.name))){var u=l.value;"class"===l.name&&(u=Ae(u).join(" ")),s["attr__"+l.name]=Ke(1024,u)}}for(var h=1,d=1,v=t;v=Pe(v);)h++,v.tagName===t.tagName&&d++;return s.nth_child=h,s.nth_of_type=d,s}function Xe(t){if(!He(t))return{};for(var i={},e=0;e<t.attributes.length;e++){var r=t.attributes[e];if(r.name&&0===r.name.indexOf("data-vt-capture-attribute")){var n=r.name.replace("data-vt-capture-attribute-",""),s=r.value;n&&s&&Fe(s)&&(i[n]=s)}}return i}function Ze(t){return t.replace(/"|\\"/g,'\\"')}function Qe(t){var i=t.attr__class;return i?Z(i)?i:Ae(i):void 0}function Ye(t){return function(t){var i=t.map(t=>{var i,r,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=e({},t.text?{text:t.text}:{},{"nth-child":null!==(i=t.nth_child)&&void 0!==i?i:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Object.entries(o).sort((t,i)=>{var[e]=t,[r]=i;return e.localeCompare(r)}).forEach(t=>{var[i,e]=t;return a[Ze(i.toString())]=Ze(String(e))}),(n+=":")+Object.entries(a).map(t=>{var[i,e]=t;return i+'="'+e+'"'}).join("")});return i.join(";")}(function(t){return t.map(t=>{var i,e,r={text:null===(i=t.$el_text)||void 0===i?void 0:i.slice(0,400),tag_name:t.tag_name,href:null===(e=t.attr__href)||void 0===e?void 0:e.slice(0,2048),attr_class:Qe(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Object.entries(t).filter(t=>{var[i]=t;return 0===i.indexOf("attr__")}).forEach(t=>{var[i,e]=t;return r.attributes[i]=e}),r})}(t))}var tr=[25,50,75,100];function ir(t){var i;if(!t)return null;var e=t.milestones,r=!0===e||"object"==typeof e&&null!==e,n="object"==typeof e&&null!==e&&(null===(i=e.thresholds)||void 0===i?void 0:i.length)?[...e.thresholds].sort((t,i)=>t-i):[...tr],s=!0===t.pageleave;return r||s?{milestones:r,thresholds:n,pageleave:s,scroll_root_selector:t.scroll_root_selector}:null}class er{constructor(t){this.bt=t,this.yt=0,this._t=new Set,this.wt=null,this.xt=null,this.kt=null,this.St=null}start(){this.stop(),this.xt=function(t){if(!j)return null;if(t){var i=Array.isArray(t)?t:[t];for(var e of i){var r=null==F?void 0:F.querySelector(e);if(r instanceof Element)return r}}return j}(this.bt.scroll_root_selector),this.xt&&(this.wt=()=>this.Ct(),Tt(this.xt,"scroll",this.wt,{passive:!0}),this.Mt(),this.St=this.bt.onPageview(()=>this.reset()))}stop(){this.St&&(this.St(),this.St=null),null!=this.kt&&j&&(j.cancelAnimationFrame(this.kt),this.kt=null),this.wt&&this.xt&&(this.xt.removeEventListener("scroll",this.wt,{passive:!0}),this.wt=null,this.xt=null)}reset(){this.yt=0,this._t.clear(),this.Mt()}getMaxPct(){return this.yt}Ct(){j&&null==this.kt&&(this.kt=j.requestAnimationFrame(()=>{this.kt=null,this.Mt()}))}Mt(){if(this.xt){var t=function(t){var i,e,r,n,s,o;if(!t)return 0;if(t===j){var a=null!==(i=j.scrollY)&&void 0!==i?i:0,l=null!==(e=j.innerHeight)&&void 0!==e?e:0,u=null==F?void 0:F.documentElement,h=null==F?void 0:F.body,d=Math.max(null!==(r=null==u?void 0:u.scrollHeight)&&void 0!==r?r:0,null!==(n=null==h?void 0:h.scrollHeight)&&void 0!==n?n:0,null!==(s=null==u?void 0:u.offsetHeight)&&void 0!==s?s:0,null!==(o=null==h?void 0:h.offsetHeight)&&void 0!==o?o:0)-l;return d<=0?100:Math.round(Math.min(100,a/d*100))}var v=t,c=v.scrollHeight-v.clientHeight;return c<=0?100:Math.round(Math.min(100,v.scrollTop/c*100))}(this.xt);if(t>this.yt&&(this.yt=t),this.bt.milestones&&this.bt.isUrlAllowed())for(var i of this.bt.thresholds)this.yt>=i&&!this._t.has(i)&&(this._t.add(i),this.bt.capture(C,{[L]:i,[U]:this.yt}))}}}function rr(t,i){return t.indexOf(i)>-1}class nr{constructor(){this.clicks=[],this.RAGE_CLICK_THRESHOLD_PX=30,this.RAGE_CLICK_TIMEOUT_MS=1e3,this.RAGE_CLICK_CLICK_COUNT=3}isRageClick(t,i,e){if(this.clicks=this.clicks.filter(t=>e-t.timestamp<this.RAGE_CLICK_TIMEOUT_MS),this.clicks.length>0){var r=this.clicks[this.clicks.length-1];Math.sqrt(Math.pow(t-r.x,2)+Math.pow(i-r.y,2))>this.RAGE_CLICK_THRESHOLD_PX&&(this.clicks=[])}return this.clicks.push({x:t,y:i,timestamp:e}),this.clicks.length>=this.RAGE_CLICK_CLICK_COUNT}}function sr(t,i){for(var e,r,n,s,{e:o,maskAllElementAttributes:a,maskAllText:l,elementAttributeIgnoreList:u,elementsChainAsString:h,captureElementValues:d}=i,v=[t],c=t;c.parentNode&&!Ce(c,"body");)Me(c.parentNode)?(v.push(c.parentNode.host),c=c.parentNode.host):(v.push(c.parentNode),c=c.parentNode);var f,p=[],g={},b=!1,m=!1;for(var y of v){var _=He(y);if("a"===y.tagName.toLowerCase()){var w=y.getAttribute("href");b=!!(_&&w&&Fe(w))&&w}rr($e(y),"vt-no-capture")&&(m=!0),p.push(Je(y,a,l,u));var x=Xe(y);Object.assign(g,x)}if(m)return{props:{},explicitNoCapture:m};if(l||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?p[0].$el_text=Ie(t):p[0].$el_text=Re(t)),"change"===o.type&&d){var k=Ve(t);k&&(k.$el_value&&(p[0].$el_value=k.$el_value),k.$selected_text&&(p[0].$selected_text=k.$selected_text))}if(b){p[0].attr__href=b;var S=null===(e=Nt(b))||void 0===e?void 0:e.host,C=null===(r=null==j?void 0:j.location)||void 0===r?void 0:r.host;S&&C&&S!==C&&(f=b)}var M=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];return Object.assign({},...i)}({$event_type:o.type,$ce_version:1},h?{}:{$elements:p},{$elements_chain:Ye(p)},(null===(n=p[0])||void 0===n?void 0:n.$el_text)?{$el_text:null===(s=p[0])||void 0===s?void 0:s.$el_text}:{},f&&"click"===o.type?{$external_click_url:f}:{},g);return{props:M}}var or=["copy","cut"];class ar{static extractConfig(t){return{enabled:!1!==t.autocapture}}constructor(t,i){this.name="Autocapture",this.At=!1,this.$t=null,this.Et=null,this.Rt=null,this.Tt=new nr,this.It=!0,this.Pt=null,this.Ot=null,this.Lt=null,this.Ut=null,this.Dt=!1,this.Bt=null,this.jt=null,this._instance=t}get j(){var t=this._instance.getConfig().autocapture;if(t===this.Ot&&this.Pt)return this.Pt;this.Ot=t;var i=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}(t)?t:{};return i.url_allowlist&&(i.url_allowlist=i.url_allowlist.map(t=>"string"==typeof t?new RegExp(t):t)),i.url_ignorelist&&(i.url_ignorelist=i.url_ignorelist.map(t=>"string"==typeof t?new RegExp(t):t)),this.Pt=i,i}get isEnabled(){return this.zt().enabled}get isStarted(){return this.At}startIfEnabled(){var{enabled:t,reason:i}=this.zt();t?this.At?(this.Nt(),this.Ft()):(this.qt(),this.At=!0,at().info("autocapture","started; listening for click/change/submit events")):this.At?(at().info("autocapture","stopping; reason:",null!=i?i:"unknown"),this.Ht(),this.At=!1):(at().debug("autocapture","not started; reason:",null!=i?i:"unknown"),this.Wt())}stop(){this.At&&(this.Ht(),this.At=!1,at().info("autocapture","stopped (DOM listeners detached)")),this.Wt()}getMaxScrollDepthPctForPageleave(){var t=ir(this.j.scroll_depth);return(null==t?void 0:t.pageleave)&&this.Bt?this.Bt.getMaxPct():null}onConfigUpdate(t){var i=t;"boolean"==typeof i.elementsChainAsString&&(this.It=i.elementsChainAsString),void 0!==i.autocapture_opt_out&&(this.$t=!!i.autocapture_opt_out),this.startIfEnabled()}updateConfig(t){void 0!==t.enabled&&(this.Et=t.enabled,t.enabled&&(this.$t=!1),this.startIfEnabled())}getDiagnostics(){var t,i,e,{enabled:r,reason:n}=this.zt(),s=ir(this.j.scroll_depth);return{isEnabled:r,isStarted:this.At,disabledReason:r?null:n,inputs:{configAutocapture:this._instance.getConfig().autocapture,isDisabledServerSide:null!==(t=this.$t)&&void 0!==t&&t,userOverride:this.Et,elementsChainAsString:this.It,captureCopiedText:!!this.j.capture_copied_text,scrollDepthMilestones:null!==(i=null==s?void 0:s.milestones)&&void 0!==i&&i,scrollDepthPageleave:null!==(e=null==s?void 0:s.pageleave)&&void 0!==e&&e,scrollDepthListenerAttached:null!==this.Bt}}}setElementSelectors(t){this.Rt=t}getElementSelectors(t){var i,e=[];return null===(i=this.Rt)||void 0===i||i.forEach(i=>{var r=null==F?void 0:F.querySelectorAll(i);null==r||r.forEach(r=>{t===r&&e.push(i)})}),e}zt(){if(!1===this.Et)return{enabled:!1,reason:"user_stop_called"};if(this.$t)return{enabled:!1,reason:"server_opt_out"};if(!0===this.Et)return{enabled:!0,reason:null};var t=this._instance.getConfig().autocapture;return!1===t?{enabled:!1,reason:"config_autocapture_false"}:null==t?{enabled:!1,reason:"config_autocapture_undefined"}:{enabled:!0,reason:null}}qt(){this.Vt()?j&&F&&(this.Lt=t=>{var i=t||(null==j?void 0:j.event);if(i)try{this.Gt(i)}catch(t){at().error("autocapture","capture handler threw",t)}},Tt(F,"submit",this.Lt,{capture:!0}),Tt(F,"change",this.Lt,{capture:!0}),Tt(F,"click",this.Lt,{capture:!0}),this.Nt(),this.Ft()):at().warn("autocapture","browser unsupported (no querySelectorAll)")}Ht(){F&&(this.Lt&&(F.removeEventListener("submit",this.Lt,!0),F.removeEventListener("change",this.Lt,!0),F.removeEventListener("click",this.Lt,!0),this.Lt=null),this.Ut&&this.Dt&&(F.removeEventListener("copy",this.Ut,!0),F.removeEventListener("cut",this.Ut,!0),this.Dt=!1,this.Ut=null),this.Wt())}Ft(){var t,i=ir(this.j.scroll_depth),e=this.isEnabled&&null!==i&&null!==ir(null==(t=this.j)?void 0:t.scroll_depth);e&&!this.Bt?(this.Bt=new er({milestones:i.milestones,pageleave:i.pageleave,thresholds:i.thresholds,scroll_root_selector:i.scroll_root_selector,capture:(t,i)=>this._instance.capture(t,i),isUrlAllowed:()=>{return t=this.j,!(!j||(null==t?void 0:t.url_allowlist)&&!Le(t.url_allowlist)||(null==t?void 0:t.url_ignorelist)&&Le(t.url_ignorelist));var t},onPageview:t=>(this.jt&&this.jt(),this.jt=this._instance.on(mt,i=>{(null==i?void 0:i.event)===m&&t()}),()=>{var t;null===(t=this.jt)||void 0===t||t.call(this),this.jt=null})}),this.Bt.start(),at().info("autocapture","scroll depth tracking started",{milestones:i.milestones,pageleave:i.pageleave})):e||this.Wt()}Wt(){this.Bt&&(this.Bt.stop(),this.Bt=null,at().info("autocapture","scroll depth tracking stopped")),this.jt&&(this.jt(),this.jt=null)}Nt(){if(F){var t=!!this.j.capture_copied_text;t&&!this.Dt?(this.Ut=t=>{var i=t||(null==j?void 0:j.event);if(i)try{this.Gt(i,ye)}catch(t){at().error("autocapture","copy handler threw",t)}},Tt(F,"copy",this.Ut,{capture:!0}),Tt(F,"cut",this.Ut,{capture:!0}),this.Dt=!0):!t&&this.Dt&&this.Ut&&(F.removeEventListener("copy",this.Ut,!0),F.removeEventListener("cut",this.Ut,!0),this.Dt=!1,this.Ut=null)}}Gt(t,i){var e,r,n,s,o,a,l,u;if(void 0===i&&(i="$autocapture"),this.isEnabled)if(t.isTrusted){var h=function(t){var i;return J(t.target)?t.srcElement||null:(null===(i=t.target)||void 0===i?void 0:i.shadowRoot)?t.composedPath()[0]||null:t.target||null}(t);if(Se(h)&&(h=h.parentNode||null),"$autocapture"===i&&"click"===t.type&&t instanceof MouseEvent)this._instance.getConfig().rageclick&&(null===(e=this.Tt)||void 0===e?void 0:e.isRageClick(t.clientX,t.clientY,(new Date).getTime()))&&(at().info("autocapture","$rageclick detected"),this.Gt(t,"$rageclick"));var d=i===ye;if(h){var v=Ge(h,t,this.j,d,d?[...or]:void 0);if(v.capture){var c=this._instance.getConfig(),{props:f,explicitNoCapture:p}=sr(h,{e:t,maskAllElementAttributes:null!==(s=c.mask_all_element_attributes)&&void 0!==s&&s,maskAllText:null!==(o=c.mask_all_text)&&void 0!==o&&o,elementAttributeIgnoreList:this.j.element_attribute_ignorelist,elementsChainAsString:this.It,captureElementValues:null!==(a=this.j.capture_element_values)&&void 0!==a&&a});if(p)return at().debug("autocapture","skip: vt-no-capture class on element chain",{tag:null===(l=h.tagName)||void 0===l?void 0:l.toLowerCase()}),!1;var g=this.getElementSelectors(h);if(g&&g.length>0&&(f.$element_selectors=g),i===ye){var b=Ee(null===(u=null==j?void 0:j.getSelection())||void 0===u?void 0:u.toString()),m=t.type||"clipboard";if(!b)return at().debug("autocapture","skip copy: empty selection"),!1;f.$selected_content=b,f.$copy_type=m}return this._instance.capture(i,f),!0}at().debug("autocapture","skip:",null!==(r=v.reason)&&void 0!==r?r:"unknown",{type:t.type,tag:null===(n=h.tagName)||void 0===n?void 0:n.toLowerCase()})}else at().debug("autocapture","skip: no event target",{type:t.type})}else at().debug("autocapture","skip: synthetic event (isTrusted=false)",{type:t.type})}Vt(){return Q(null==F?void 0:F.querySelectorAll)}}var lr="replay";class ur extends ve{constructor(t,i){super(t,i||ur.extractConfig(t.getConfig())),this.name="SessionRecording",this.scriptName="recorder"}static extractConfig(t){var i,e,r,n=t.session_recording||{};return{enabled:null!==(i=n.enabled)&&void 0!==i&&i,sampleRate:n.sampleRate,minimumDurationMs:n.minimumDurationMs,sessionIdleThresholdMs:n.sessionIdleThresholdMs,fullSnapshotIntervalMs:n.fullSnapshotIntervalMs,captureConsole:null!==(e=n.captureConsole)&&void 0!==e&&e,captureNetwork:null!==(r=n.captureNetwork)&&void 0!==r&&r,captureCanvas:n.captureCanvas,blockClass:n.blockClass,blockSelector:n.blockSelector,skipDefaultInvisibleBlocking:n.skipDefaultInvisibleBlocking,ignoreClass:n.ignoreClass,maskTextClass:n.maskTextClass,maskTextSelector:n.maskTextSelector,maskAllInputs:n.maskAllInputs,maskInputOptions:n.maskInputOptions,masking:n.masking,recordHeaders:n.recordHeaders,recordBody:n.recordBody,compressEvents:n.compressEvents,__mutationThrottlerRefillRate:n.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:n.__mutationThrottlerBucketSize}}get isEnabled(){var t,i=this._instance.getConfig(),e=null!==(t=this.j.enabled)&&void 0!==t&&t,r=!i.disable_session_recording;return!!j&&e&&r}get isStarted(){var t;return this.O&&!!(null===(t=this.N)||void 0===t?void 0:t.isStarted)}startIfEnabled(){this.startIfEnabledOrStop("recording_initialized")}startIfEnabledOrStop(t){var i;if(!this.isEnabled||!(null===(i=this.N)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.isEnabled&&e?(this.O=!0,this.F(i=>this.H(i,t)),at().info(lr,"starting")):this.stop()}}stop(){ut(()=>{var t;null===(t=this.N)||void 0===t||t.stop(),this.O=!1})}onConfigUpdate(t){var i;this.j=ur.extractConfig(t),null===(i=this.N)||void 0===i||i.updateConfig(this.j),this.startIfEnabledOrStop("config_updated")}q(){var t,i=null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.initSessionRecording;if(!i)throw new Error("[vTilt:replay] initSessionRecording not available after script load");return i(this._instance,this.j)}H(t,i){t.start(i)}get started(){return this.isStarted}get status(){var t;return(null===(t=this.N)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.N)||void 0===t?void 0:t.sessionId)||""}stopRecording(){this.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.N)||void 0===e?void 0:e.log)?this.N.log(t,i):at().warn(lr,"log called before recorder was ready")}updateConfig(t){var i;this.j=e({},this.j,t),null===(i=this.N)||void 0===i||i.updateConfig(this.j)}}var hr=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(hr||{});hr.MouseMove,hr.MouseInteraction,hr.Scroll,hr.ViewportResize,hr.Input,hr.TouchMove,hr.MediaInteraction,hr.Drag;var dr=Uint8Array,vr=Uint16Array,cr=Int32Array,fr=new dr([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]),pr=new dr([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]),gr=new dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),br=function(t,i){for(var e=new vr(31),r=0;r<31;++r)e[r]=i+=1<<t[r-1];var n=new cr(e[30]);for(r=1;r<30;++r)for(var s=e[r];s<e[r+1];++s)n[s]=s-e[r]<<5|r;return{b:e,r:n}},mr=br(fr,2),yr=mr.b,_r=mr.r;yr[28]=258,_r[258]=28;for(var wr=br(pr,0).r,xr=new vr(32768),kr=0;kr<32768;++kr){var Sr=(43690&kr)>>1|(21845&kr)<<1;Sr=(61680&(Sr=(52428&Sr)>>2|(13107&Sr)<<2))>>4|(3855&Sr)<<4,xr[kr]=((65280&Sr)>>8|(255&Sr)<<8)>>1}var Cr=function(t,i,e){for(var r=t.length,n=0,s=new vr(i);n<r;++n)t[n]&&++s[t[n]-1];var o,a=new vr(i);for(n=1;n<i;++n)a[n]=a[n-1]+s[n-1]<<1;if(e){o=new vr(1<<i);var l=15-i;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],h=i-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;d<=v;++d)o[xr[d]>>l]=u}else for(o=new vr(r),n=0;n<r;++n)t[n]&&(o[n]=xr[a[t[n]-1]++]>>15-t[n]);return o},Mr=new dr(288);for(kr=0;kr<144;++kr)Mr[kr]=8;for(kr=144;kr<256;++kr)Mr[kr]=9;for(kr=256;kr<280;++kr)Mr[kr]=7;for(kr=280;kr<288;++kr)Mr[kr]=8;var Ar=new dr(32);for(kr=0;kr<32;++kr)Ar[kr]=5;var $r=Cr(Mr,9,0),Er=Cr(Ar,5,0),Rr=function(t){return(t+7)/8|0},Tr=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new dr(t.subarray(i,e))},Ir=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8},Pr=function(t,i,e){e<<=7&i;var r=i/8|0;t[r]|=e,t[r+1]|=e>>8,t[r+2]|=e>>16},Or=function(t,i){for(var e=[],r=0;r<t.length;++r)t[r]&&e.push({s:r,f:t[r]});var n=e.length,s=e.slice();if(!n)return{t:Nr,l:0};if(1==n){var o=new dr(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(t,i){return t.f-i.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],u=0,h=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=e[e[u].f<e[d].f?u++:d++],l=e[u!=h&&e[u].f<e[d].f?u++:d++],e[h++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;r<n;++r)s[r].s>v&&(v=s[r].s);var c=new vr(v+1),f=Lr(e[h-1],c,0);if(f>i){r=0;var p=0,g=f-i,b=1<<g;for(s.sort(function(t,i){return c[i.s]-c[t.s]||t.f-i.f});r<n;++r){var m=s[r].s;if(!(c[m]>i))break;p+=b-(1<<f-c[m]),c[m]=i}for(p>>=g;p>0;){var y=s[r].s;c[y]<i?p-=1<<i-c[y]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==i&&(--c[_],++p)}f=i}return{t:new dr(c),l:f}},Lr=function(t,i,e){return-1==t.s?Math.max(Lr(t.l,i,e+1),Lr(t.r,i,e+1)):i[t.s]=e},Ur=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new vr(++i),r=0,n=t[0],s=1,o=function(t){e[r++]=t},a=1;a<=i;++a)if(t[a]==n&&a!=i)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return{c:e.subarray(0,r),n:i}},Dr=function(t,i){for(var e=0,r=0;r<i.length;++r)e+=t[r]*i[r];return e},Br=function(t,i,e){var r=e.length,n=Rr(i+2);t[n]=255&r,t[n+1]=r>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<r;++s)t[n+s+4]=e[s];return 8*(n+4+r)},jr=function(t,i,e,r,n,s,o,a,l,u,h){Ir(i,h++,e),++n[256];for(var d=Or(n,15),v=d.t,c=d.l,f=Or(s,15),p=f.t,g=f.l,b=Ur(v),m=b.c,y=b.n,_=Ur(p),w=_.c,x=_.n,k=new vr(19),S=0;S<m.length;++S)++k[31&m[S]];for(S=0;S<w.length;++S)++k[31&w[S]];for(var C=Or(k,7),M=C.t,A=C.l,E=19;E>4&&!M[gr[E-1]];--E);var R,T,I,P,O=u+5<<3,L=Dr(n,Mr)+Dr(s,Ar)+o,U=Dr(n,v)+Dr(s,p)+o+14+3*E+Dr(k,M)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&O<=L&&O<=U)return Br(i,h,t.subarray(l,l+u));if(Ir(i,h,1+(U<L)),h+=2,U<L){R=Cr(v,c,0),T=v,I=Cr(p,g,0),P=p;var D=Cr(M,A,0);Ir(i,h,y-257),Ir(i,h+5,x-1),Ir(i,h+10,E-4),h+=14;for(S=0;S<E;++S)Ir(i,h+3*S,M[gr[S]]);h+=3*E;for(var B=[m,w],j=0;j<2;++j){var z=B[j];for(S=0;S<z.length;++S){var N=31&z[S];Ir(i,h,D[N]),h+=M[N],N>15&&(Ir(i,h,z[S]>>5&127),h+=z[S]>>12)}}}else R=$r,T=Mr,I=Er,P=Ar;for(S=0;S<a;++S){var F=r[S];if(F>255){Pr(i,h,R[(N=F>>18&31)+257]),h+=T[N+257],N>7&&(Ir(i,h,F>>23&31),h+=fr[N]);var q=31&F;Pr(i,h,I[q]),h+=P[q],q>3&&(Pr(i,h,F>>5&8191),h+=pr[q])}else Pr(i,h,R[F]),h+=T[F]}return Pr(i,h,R[256]),h+T[256]},zr=new cr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Nr=new dr(0),Fr=function(){for(var t=new Int32Array(256),i=0;i<256;++i){for(var e=i,r=9;--r;)e=(1&e&&-306674912)^e>>>1;t[i]=e}return t}(),qr=function(t,i,e,r,n){if(!n&&(n={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new dr(s.length+t.length);o.set(s),o.set(t,s.length),t=o,n.w=s.length}return function(t,i,e,r,n,s){var o=s.z||t.length,a=new dr(r+o+5*(1+Math.ceil(o/7e3))+n),l=a.subarray(r,a.length-n),u=s.l,h=7&(s.r||0);if(i){h&&(l[0]=s.r>>3);for(var d=zr[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new vr(32768),g=s.h||new vr(f+1),b=Math.ceil(e/3),m=2*b,y=function(i){return(t[i]^t[i+1]<<b^t[i+2]<<m)&f},_=new cr(25e3),w=new vr(288),x=new vr(32),k=0,S=0,C=s.i||0,M=0,A=s.w||0,E=0;C+2<o;++C){var R=y(C),T=32767&C,I=g[R];if(p[T]=I,g[R]=T,A<=C){var P=o-C;if((k>7e3||M>24576)&&(P>423||!u)){h=jr(t,l,0,_,w,x,S,M,E,C-E,h),M=k=S=0,E=C;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)x[O]=0}var L=2,U=0,D=c,B=T-I&32767;if(P>2&&R==y(C-B))for(var j=Math.min(v,P)-1,z=Math.min(32767,C),N=Math.min(258,P);B<=z&&--D&&T!=I;){if(t[C+L]==t[C+L-B]){for(var F=0;F<N&&t[C+F]==t[C+F-B];++F);if(F>L){if(L=F,U=B,F>j)break;var q=Math.min(B,F-2),H=0;for(O=0;O<q;++O){var W=C-B+O&32767,V=W-p[W]&32767;V>H&&(H=V,I=W)}}}B+=(T=I)-(I=p[T])&32767}if(U){_[M++]=268435456|_r[L]<<18|wr[U];var G=31&_r[L],K=31&wr[U];S+=fr[G]+pr[K],++w[257+G],++x[K],A=C+L,++k}else _[M++]=t[C],++w[t[C]]}}for(C=Math.max(C,A);C<o;++C)_[M++]=t[C],++w[t[C]];h=jr(t,l,u,_,w,x,S,M,E,C-E,h),u||(s.r=7&h|l[h/8|0]<<3,h-=7,s.h=g,s.p=p,s.i=C,s.w=A)}else{for(C=s.w||0;C<o+u;C+=65535){var J=C+65535;J>=o&&(l[h/8|0]=u,J=o),h=Br(l,h+1,t.subarray(C,J))}s.i=o}return Tr(a,0,r+Rr(h)+n)}(t,null==i.level?6:i.level,null==i.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+i.mem,e,r,n)},Hr=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function Wr(t,i){i||(i={});var e=function(){var t=-1;return{p:function(i){for(var e=t,r=0;r<i.length;++r)e=Fr[255&e^i[r]]^e>>>8;t=e},d:function(){return~t}}}(),r=t.length;e.p(t);var n,s=qr(t,i,10+((n=i).filename?n.filename.length+1:0),8),o=s.length;return function(t,i){var e=i.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=i.level<2?4:9==i.level?2:0,t[9]=3,0!=i.mtime&&Hr(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var r=0;r<=e.length;++r)t[r+10]=e.charCodeAt(r)}}(s,i),Hr(s,o-8,e.d()),Hr(s,o-4,r),s}var Vr="undefined"!=typeof TextEncoder&&new TextEncoder,Gr="undefined"!=typeof TextDecoder&&new TextDecoder;try{Gr.decode(Nr,{stream:!0})}catch(t){}var Kr="vtilt-bubble-pos";function Jr(t){try{localStorage.setItem(Kr,JSON.stringify(t))}catch(t){}}function Xr(t,i,e){var r=t.getBoundingClientRect(),n=r.left-i,s=r.top-e,o=window.innerWidth-t.offsetWidth-n,a=-n,l=window.innerHeight-t.offsetHeight-s,u=-s;return{x:Math.min(Math.max(i,a),o),y:Math.min(Math.max(e,u),l)}}function Zr(t,i,e){t.style.transform="translate3d("+i+"px, "+e+"px, 0)"}function Qr(t,i){var e=t,r=0,n=0,s=0,o=0,a=0,l=0,u=!1,h=!1,d=function(){try{var t=localStorage.getItem(Kr);if(!t)return null;var i=JSON.parse(t);if("number"==typeof i.x&&"number"==typeof i.y)return i}catch(t){}return null}();if(d){r=d.x,n=d.y;var v=t.style.transition;t.style.transition="none",Zr(t,r,n);var c=Xr(t,r,n);r=c.x,n=c.y,Zr(t,r,n),t.offsetHeight,t.style.transition=v}e.style.cursor="grab",e.style.touchAction="none";var f=i=>{0===i.button&&(u=!0,h=!1,s=i.clientX,o=i.clientY,a=r,l=n,e.setPointerCapture(i.pointerId),e.style.cursor="grabbing",t.style.transition="none")},p=i=>{if(u){var e=i.clientX-s,d=i.clientY-o;if(!(!h&&Math.abs(e)<5&&Math.abs(d)<5)){h=!0;var v={x:a+e,y:l+d},c=Xr(t,v.x,v.y);r=c.x,n=c.y,Zr(t,r,n)}}},g=()=>{u&&(u=!1,e.style.cursor="grab",t.style.transition="",h&&Jr({x:r,y:n}))},b=t=>{h&&(t.stopPropagation(),t.preventDefault(),h=!1)},m=()=>{var i=r,e=n,s=Xr(t,r,n);r=s.x,n=s.y,Zr(t,r,n),i===r&&e===n||Jr({x:r,y:n})};return e.addEventListener("pointerdown",f),e.addEventListener("pointermove",p),e.addEventListener("pointerup",g),e.addEventListener("pointercancel",g),e.addEventListener("click",b,!0),window.addEventListener("resize",m),{destroy(){e.removeEventListener("pointerdown",f),e.removeEventListener("pointermove",p),e.removeEventListener("pointerup",g),e.removeEventListener("pointercancel",g),e.removeEventListener("click",b,!0),window.removeEventListener("resize",m)}}}var Yr={bottom:20,right:20,left:20};function tn(t,i){return void 0!==t&&Number.isFinite(t)?Math.max(0,t):i}function en(t){return null===t?e({},Yr):{bottom:tn(null==t?void 0:t.bottom,Yr.bottom),right:tn(null==t?void 0:t.right,Yr.right),left:tn(null==t?void 0:t.left,Yr.left)}}function rn(t,i,e){t.style.bottom=e.bottom+"px","bottom-right"===i?(t.style.right=e.right+"px",t.style.left=""):(t.style.left=e.left+"px",t.style.right="")}var nn="chat";class sn extends de{constructor(t,i){super(t,i||sn.extractConfig(t.getConfig())),this.name="Chat",this.scriptName="chat",this.Kt=null,this.Jt=!1,this.Xt=null,this.Zt=null,this.Qt=[],this.Yt=[],this.ti=[],this.ii=[],this.ei=[],this.ri=!1,this.ni=null,this.si=()=>{if("visible"===document.visibilityState)return this.oi(),void this.ai();this.li()}}static extractConfig(t){var i,e=t.chat||{};return{enabled:e.enabled,autoConfig:null===(i=e.autoConfig)||void 0===i||i,position:e.position,greeting:e.greeting,color:e.color,aiMode:e.aiMode,aiGreeting:e.aiGreeting,preload:e.preload,offlineMessage:e.offlineMessage,collectEmailOffline:e.collectEmailOffline,bubble:e.bubble}}get isEnabled(){var t;return!1!==this.j.enabled&&(!0===this.j.enabled||!this._instance.getConfig().disable_chat&&!0===(null===(t=this.Kt)||void 0===t?void 0:t.enabled))}startIfEnabled(){at().debug(nn,"startIfEnabled"),this.ui().catch(t=>{at().error(nn,"error starting:",t)})}stop(){this.destroy(),this.O=!1}onConfigUpdate(t){var i,e;this.j=sn.extractConfig(t),this.hi()||this.di(),this.N&&(null===(e=(i=this.N).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}q(){var t,i,e,r=null===(t=V.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!r)throw new Error("[vTilt:chat] initChat not available after script load");var n=this.getMergedConfig(),s=r(this._instance,n);this.ri&&s.show(),this.ti.forEach(t=>s.onMessage(t)),this.ii.forEach(t=>s.onTyping(t)),this.ei.forEach(t=>s.onConnectionChange(t)),null===(i=this.Zt)||void 0===i||i.destroy(),this.Zt=null;var o=null===(e=null==j?void 0:j.document)||void 0===e?void 0:e.getElementById("vtilt-chat-bubble");return o&&!o.closest("#vtilt-chat-container")&&o.remove(),s}H(t){this.Yt.forEach(t=>t()),this.Yt=[],t.isOpen||(this.oi(),this.ai()),at().info(nn,"loaded and ready")}ui(){var t=this;return i(function*(){var i,e;try{if(!1===t.j.enabled)return void at().info(nn,"disabled by code config");if(t._instance.getConfig().disable_chat)return void at().info(nn,"disabled by disable_chat config");if(!1!==t.j.autoConfig&&(yield t.ci()),!t.isEnabled)return void at().info(nn,"not enabled (check dashboard settings)");at().debug(nn,"startIfEnabled enabled"),t.O=!0,!0===t.j.preload&&t.fi();var r=t.getMergedConfig();(null===(i=t.Kt)||void 0===i?void 0:i.enabled)&&!1!==(null===(e=r.bubble)||void 0===e?void 0:e.visible)&&t.pi(),at().info(nn,"ready (lazy-load on demand)")}finally{t.V()}})()}get isOpen(){var t,i;return null!==(i=null===(t=this.N)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.N)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.L||null!==(i=null===(t=this.N)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.N)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.N)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.N)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.N)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.W(()=>{this.li(),this.gi(()=>{var t;return null===(t=this.N)||void 0===t?void 0:t.open()})})}close(){this.W(()=>{this.N?(this.N.close(),this.oi(),this.ai()):this.gi(()=>{var t;null===(t=this.N)||void 0===t||t.close(),this.oi(),this.ai()})})}toggle(){this.W(()=>{this.N?this.N.toggle():this.open()})}show(){this.W(()=>{this.ri=!0,this.N?this.N.show():this.O&&this.pi()})}hide(){this.W(()=>{var t;if(this.ri=!1,this.N)this.N.hide();else{var i=null===(t=null==j?void 0:j.document)||void 0===t?void 0:t.getElementById("vtilt-chat-bubble");i&&(i.style.display="none")}})}getChannels(){this.W(()=>{this.gi(()=>{var t;return null===(t=this.N)||void 0===t?void 0:t.getChannels()})})}selectChannel(t){this.W(()=>{this.gi(()=>{var i;return null===(i=this.N)||void 0===i?void 0:i.selectChannel(t)})})}createChannel(){this.W(()=>{this.gi(()=>{var t;return null===(t=this.N)||void 0===t?void 0:t.createChannel()})})}goToChannelList(){this.W(()=>{this.N?this.N.goToChannelList():this.gi(()=>{var t;return null===(t=this.N)||void 0===t?void 0:t.goToChannelList()})})}sendMessage(t,i){return this.N?this.N.sendMessage(t,i):new Promise((e,r)=>{this.W(()=>{this.N?this.N.sendMessage(t,i).then(e).catch(r):(this.Qt.push({content:t,options:i,resolve:e,reject:r}),this.gi(()=>{var t,i=this.Qt;for(var e of(this.Qt=[],i))null===(t=this.N)||void 0===t||t.sendMessage(e.content,e.options).then(e.resolve).catch(e.reject)}))})})}markAsRead(){this.W(()=>{this.N?this.N.markAsRead():this.gi(()=>{var t;return null===(t=this.N)||void 0===t?void 0:t.markAsRead()})})}registerWidget(t){this.W(()=>{var i,e;this.N?null===(e=(i=this.N).registerWidget)||void 0===e||e.call(i,t):this.gi(()=>{var i,e;null===(e=null===(i=this.N)||void 0===i?void 0:i.registerWidget)||void 0===e||e.call(i,t)})})}onMessage(t){return this.ti.push(t),this.N?this.N.onMessage(t):()=>{var i=this.ti.indexOf(t);i>-1&&this.ti.splice(i,1)}}onTyping(t){return this.ii.push(t),this.N?this.N.onTyping(t):()=>{var i=this.ii.indexOf(t);i>-1&&this.ii.splice(i,1)}}onConnectionChange(t){return this.ei.push(t),this.N?this.N.onConnectionChange(t):()=>{var i=this.ei.indexOf(t);i>-1&&this.ei.splice(i,1)}}hi(){var t;return!0===(null===(t=this.getMergedConfig().bubble)||void 0===t?void 0:t.draggable)}getMergedConfig(){var t,i,e,r,n,s,o,a,l,u,h,d,v,c,f,p,g,b,m,y,_,w,x,k,S,C=this.Kt,M=this.j;return{enabled:null!==(i=null!==(t=M.enabled)&&void 0!==t?t:null==C?void 0:C.enabled)&&void 0!==i&&i,autoConfig:null===(e=M.autoConfig)||void 0===e||e,position:null!==(n=null!==(r=M.position)&&void 0!==r?r:null==C?void 0:C.position)&&void 0!==n?n:"bottom-right",greeting:null!==(s=M.greeting)&&void 0!==s?s:null==C?void 0:C.greeting,color:null!==(a=null!==(o=M.color)&&void 0!==o?o:null==C?void 0:C.color)&&void 0!==a?a:"#6366f1",aiMode:null===(u=null!==(l=M.aiMode)&&void 0!==l?l:null==C?void 0:C.ai_enabled)||void 0===u||u,aiGreeting:null!==(h=M.aiGreeting)&&void 0!==h?h:null==C?void 0:C.ai_greeting,preload:null!==(d=M.preload)&&void 0!==d&&d,theme:null!==(v=M.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=M.color)&&void 0!==c?c:null==C?void 0:C.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=M.offlineMessage)&&void 0!==p?p:null==C?void 0:C.offline_message,collectEmailOffline:null===(b=null!==(g=M.collectEmailOffline)&&void 0!==g?g:null==C?void 0:C.collect_email_offline)||void 0===b||b,bubble:{draggable:null!==(_=null!==(y=null===(m=M.bubble)||void 0===m?void 0:m.draggable)&&void 0!==y?y:null==C?void 0:C.bubble_draggable)&&void 0!==_&&_,visible:null===(k=null!==(x=null===(w=M.bubble)||void 0===w?void 0:w.visible)&&void 0!==x?x:null==C?void 0:C.bubble_visible)||void 0===k||k,offset:null===(S=M.bubble)||void 0===S?void 0:S.offset}}}di(){var t,i,e=this.getMergedConfig(),r=null!==(t=e.position)&&void 0!==t?t:"bottom-right",n=en(null===(i=e.bubble)||void 0===i?void 0:i.offset),s=document.getElementById("vtilt-chat-bubble");s&&rn(s,r,n)}destroy(){ut(()=>{var t,i,e;this.li(),document.removeEventListener("visibilitychange",this.si),null===(t=this.N)||void 0===t||t.destroy(),this.N=void 0,this.ri=!1,this.Qt=[],this.Yt=[],this.ti=[],this.ii=[],this.ei=[],this.G(),null===(i=this.Zt)||void 0===i||i.destroy(),this.Zt=null;var r=null===(e=null==j?void 0:j.document)||void 0===e?void 0:e.getElementById("vtilt-chat-bubble");r&&r.remove()})}ci(){var t=this;return i(function*(){if(!t.Jt){var i=t._instance.getConfig();if(!i.token)return at().warn(nn,"cannot fetch settings: missing token"),void(t.Jt=!0);try{var e=dt(i,"/api/chat/settings"),r=yield fetch(e,{headers:vt(i)});if(!r.ok)return at().warn(nn,"failed to fetch settings: "+r.status),void(t.Jt=!0);t.Kt=yield r.json(),t.Jt=!0,at().info(nn,"loaded settings from dashboard")}catch(i){at().warn(nn,"error fetching settings:",i),t.Jt=!0}}})()}oi(){var t=this;return i(function*(){var i,e,r,n,s,o,a=t._instance.getConfig(),l=a.token,u=null!==(r=null===(e=(i=t._instance).getDistinctId)||void 0===e?void 0:e.call(i))&&void 0!==r?r:"";if(at().debug("chat","fetchUnread","distinctId",u?u.slice(0,12)+"...":"empty"),l&&u)try{var h=dt(a,"/api/chat/widget/unread"),d=h.includes("?")?"&":"?",v=""+h+d+"distinct_id="+encodeURIComponent(u),c=yield fetch(v,{headers:vt(a)});if(!c.ok)return;var f=yield c.json(),p=Number(null!==(n=f.unread_count)&&void 0!==n?n:0);null===(o=null===(s=t.N)||void 0===s?void 0:s.applyPolledUnreadCount)||void 0===o||o.call(s,p);var g=document.getElementById("vtilt-chat-bubble");if(!g)return;var b=g.querySelector(".vtilt-chat-bubble-badge");if(!b)return;p>0?(b.style.display="flex",b.textContent=p>99?"99+":String(p)):b.style.display="none"}catch(t){}else{var m=l?"missing distinctId":"missing token";at().debug("chat","fetchUnread skip","reason",m)}})()}pi(){var t,i,e,r;if(null==j?void 0:j.document){var n=document.getElementById("vtilt-chat-bubble");if(n)return n.style.display="flex",void this.di();var s=this.getMergedConfig(),o=null!==(t=s.position)&&void 0!==t?t:"bottom-right",a=en(null===(i=s.bubble)||void 0===i?void 0:i.offset),l=s.color||"#6366f1",u=document.createElement("div");u.id="vtilt-chat-bubble",u.setAttribute("style",("\n position: fixed;\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+l+";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n transition: transform 0.2s, box-shadow 0.2s;\n z-index: 999999;\n ").trim()),rn(u,o,a),u.innerHTML='\n <svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">\n <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>\n </svg>\n <div class="vtilt-chat-bubble-badge" style="\n display: none;\n position: absolute;\n top: -4px;\n right: -4px;\n background: #E53935;\n color: white;\n font-size: 11px;\n font-weight: 700;\n min-width: 20px;\n height: 20px;\n border-radius: 10px;\n align-items: center;\n justify-content: center;\n padding: 0 6px;\n box-sizing: border-box;\n border: 2px solid white;\n ">0</div>\n ';var h=!0===(null===(e=s.bubble)||void 0===e?void 0:e.draggable);h||(u.addEventListener("mouseenter",()=>{u.style.transform="scale(1.05)",u.style.boxShadow="0 6px 16px rgba(0, 0, 0, 0.2)"}),u.addEventListener("mouseleave",()=>{u.style.transform="scale(1)",u.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"})),u.addEventListener("click",()=>{this.open()}),document.body.appendChild(u),h&&(null===(r=this.Zt)||void 0===r||r.destroy(),this.Zt=Qr(u)),this.oi(),this.ai(),document.addEventListener("visibilitychange",this.si)}}bi(){return"undefined"!=typeof document&&("visible"===document.visibilityState&&(!!document.getElementById("vtilt-chat-bubble")||!(!this.N||this.N.isOpen)))}ai(){this.bi()&&null===this.ni&&(this.ni=setInterval(()=>{this.oi()},3e4))}li(){null!==this.ni&&(clearInterval(this.ni),this.ni=null)}fi(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.F(()=>{}),{timeout:5e3}):setTimeout(()=>this.F(()=>{}),3e3)}gi(t){this.N?t():(this.Yt.push(t),this.F(t=>this.H(t)))}}function on(t,i){t("js",new Date);var{tagIds:r,configParams:n,sendPageView:s,debugMode:o,conversionLinker:a,linkerDomains:l}=i,u=e({},n||{});for(var h of(!1===s&&(u.send_page_view=!1),o&&(u.debug_mode=!0),!1===a&&(u.conversion_linker=!1),l&&l.length>0&&(u.linker={domains:l,decorate_forms:!0}),r))h&&t("config",h,u)}function an(t,i){var e,r=(t.tagIds||[]).filter(t=>!!t);if(0===r.length)return null;var n,s,o,a=null!==(e=t.proxyMode)&&void 0!==e?e:"proxied";if("direct"===a)n=un,s=un,o="";else{var l=function(t){var i,e=void 0!==j&&(null===(i=null==j?void 0:j.location)||void 0===i?void 0:i.origin)?j.location.origin:"";if(!t)return e?{base:e,absoluteBase:e}:null;var r=t.replace(/\/+$/g,"");if(!r)return e?{base:e,absoluteBase:e}:null;try{var n=new URL(r),s=n.pathname.replace(/\/$/,""),o=""+n.origin+s;return{base:o,absoluteBase:o}}catch(t){}if(r.startsWith("/"))return{base:r,absoluteBase:e?""+e+r:r};return e?{base:e,absoluteBase:e}:null}(i);if(!l)return null;n=l.base,s=l.absoluteBase,o=ln}var u={};if("direct"!==a){var h=function(t){if(!t)return"";var i=t.startsWith("/")?t:"/"+t;return i.replace(/\/$/,"")}(o);u.transport_url=""+s.replace(/\/$/,"")+h}return{origin:n,gatewayPath:o,primaryTagId:r.find(t=>t.startsWith("G-"))||r[0]||"",tagIds:r,configParams:u,sendPageView:!1!==t.capturePageview,debugMode:!!t.debugMode,conversionLinker:!1!==t.conversionLinker,linkerDomains:t.linkerDomains}}var ln="/gt",un="https://www.googletagmanager.com";function hn(t,i){var r=!0===t.advertising,n={ad_storage:r?"granted":"denied",ad_user_data:r?"granted":"denied",ad_personalization:r?"granted":"denied",analytics_storage:!0===t.analytics?"granted":"denied"};if(!i)return n;var s=e({},n);return Object.keys(n).forEach(e=>{var r=i[e];void 0!==r&&(s[e]=function(t,i){return"granted"===i?"granted":"denied"===i?"denied":"follow_advertising"===i?!0===t.advertising?"granted":"denied":"follow_analytics"===i&&!0===t.analytics?"granted":"denied"}(t,r))}),s}function dn(t){if(null==t)return null;var i=String(t).trim().toLowerCase();return i||null}function vn(t,i){if(t&&i){var e=i.split("."),r=t;for(var n of e){if(null==r||"object"!=typeof r)return;r=r[n]}return r}}function cn(t){if("number"==typeof t&&Number.isFinite(t))return t;if("string"==typeof t&&""!==t.trim()){var i=Number(t);if(Number.isFinite(i))return i}}function fn(t){if(null!=t)return"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?String(t):void 0}function pn(t){var{mapping:i,payload:e}=t,r={send_to:i.send_to},n=i.value_param_path||"value",s=i.currency_param_path||"currency",o=cn(vn(e,n));void 0!==o&&(r.value=o);var a=fn(vn(e,s))||i.default_currency||void 0;if(a&&(r.currency=a),!1!==i.send_transaction_id){var l=fn(vn(e,i.transaction_id_param_path||"transaction_id"));l&&(r.transaction_id=l)}return{send_to:i.send_to,params:r}}var gn=[{source:"$pageview",destination:"page_view",buildParams:t=>{var i,e={},r=fn(t.$current_url);r&&(e.page_location=r);var n=fn(t.$pathname);n&&(e.page_path=n);var s=null!==(i=fn(t.title))&&void 0!==i?i:fn(t.$title);s&&(e.page_title=s);var o=fn(t.$referrer);return o&&(e.page_referrer=o),e}},{source:"$pageleave",destination:"user_engagement",buildParams:t=>{var i,e,r={},n=cn(null!==(e=null!==(i=t.$dwell_time_ms)&&void 0!==i?i:t.engagement_time_msec)&&void 0!==e?e:t.$time_on_page_ms);return void 0!==n&&(r.engagement_time_msec=Math.round(n)),r}}];function bn(t,i,e){var r=i.split(".").filter(Boolean);if(0!==r.length)if(1!==r.length){for(var n=t,s=0;s<r.length-1;s++){var o=r[s],a=r[s+1];if(null==n||"object"!=typeof n||Array.isArray(n))return;var l=n;if(/^\d+$/.test(a)){var u=Array.isArray(l[o])?l[o]:[];Array.isArray(l[o])||(l[o]=u);for(var h=parseInt(a,10);u.length<=h;)u.push({});if(s+1===r.length-1)return void(u[h]=e);var d=u[h];d&&"object"==typeof d&&!Array.isArray(d)||(d={},u[h]=d),n=d,s++}else{var v=l[o];v&&"object"==typeof v&&!Array.isArray(v)||(v={},l[o]=v),n=v}}var c=r[r.length-1];n&&"object"==typeof n&&!Array.isArray(n)&&(n[c]=e)}else t[r[0]]=e}var mn=new Set(["client_id","user_id","first_visit","session_start"]);function yn(t,i,e,r){if(!function(t,i){return!(i&&(Array.isArray(i.exclude)&&i.exclude.includes(t)||Array.isArray(i.include)&&i.include.length>0&&!i.include.includes(t)))}(i,r.eventFilter))return{fired:!1};var n=(r.eventMappings||[]).find(t=>(null==t?void 0:t.source)===i);if(n&&n.destination){var{name:s,params:o}=function(t,i){var e={},r=Array.isArray(t.param_mappings)?t.param_mappings:[];for(var n of r){var s=null==n?void 0:n.source,o=null==n?void 0:n.destination;if(s&&o){var a=vn(i,s);void 0!==a&&(o.includes(".")?bn(e,o,a):e[o]=a)}}return{name:t.destination,params:e}}(n,e);return t("event",s,o),{fired:!0,eventName:s,params:o,source:"mapping"}}if(!1===r.autoForward)return{fired:!1};var a=gn.find(t=>t.source===i);if(a){var l=a.buildParams(e);return t("event",a.destination,l),{fired:!0,eventName:a.destination,params:l,source:"preset"}}if(i.startsWith("$"))return{fired:!1};var u=function(t){var i={};for(var[e,r]of Object.entries(t))e.startsWith("$")||mn.has(e)||void 0!==r&&(i[e]=r);return i}(e);return t("event",i,u),{fired:!0,eventName:i,params:u,source:"auto"}}function _n(){var t=null,i=[],e=[];return{call:function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];if((t=>{e.push(t),e.length>50&&e.shift()})(n),t)try{t(...n)}catch(t){}else i.push(n)},flush(e){for(t=e;i.length;){var r=i.shift();try{e(...r)}catch(t){}}},getRecentCalls:()=>e.slice()}}function wn(t){return xn.apply(this,arguments)}function xn(){return(xn=i(function*(t){try{var i="undefined"!=typeof crypto&&crypto.subtle?crypto.subtle:null;if(!i)return null;var e=(new TextEncoder).encode(t),r=yield i.digest("SHA-256",e);return Array.from(new Uint8Array(r)).map(t=>t.toString(16).padStart(2,"0")).join("")}catch(t){return null}})).apply(this,arguments)}function kn(){return(kn=i(function*(t){var i={},e=function(t){if(!t)return null;var i=String(t).trim().toLowerCase();if(!i)return null;if(!i.includes("@"))return null;var[e,r]=i.split("@");if(!e||!r)return null;if("gmail.com"===r||"googlemail.com"===r){var n=e.split("+")[0].replace(/\./g,"");return n?n+"@"+r:null}return e+"@"+r}(t.email),r=function(t){if(!t)return null;var i=String(t).trim();if(!i)return null;if(i.startsWith("+")){var e=i.slice(1).replace(/\D/g,"");return e?"+"+e:null}return null}(t.phone),n=dn(t.first_name),s=dn(t.last_name),o=dn(t.street),a=dn(t.city),l=dn(t.region),u=function(t){if(!t)return null;var i=String(t).trim().toUpperCase().replace(/\s+/g,"");return i||null}(t.postal_code),h=dn(t.country);if(e){var d=yield wn(e);d&&(i.sha256_email_address=d)}if(r){var v=yield wn(r);v&&(i.sha256_phone_number=v)}var c={};if(n){var f=yield wn(n);f&&(c.sha256_first_name=f)}if(s){var p=yield wn(s);p&&(c.sha256_last_name=p)}if(o){var g=yield wn(o);g&&(c.sha256_street=g)}return a&&(c.city=a),l&&(c.region=l),u&&(c.postal_code=u),h&&(c.country=h),Object.keys(c).length>0&&(i.address=c),0===Object.keys(i).length?null:i})).apply(this,arguments)}class Sn{constructor(t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.mi=t,this.yi=[]}get length(){return this.yi.length}enqueue(t){return!(this.yi.length>=this.mi)&&(this.yi.push(t),!0)}takeAll(){if(0===this.yi.length)return[];var t=this.yi;return this.yi=[],t}clear(){this.yi=[]}}var Cn="google-tag";class Mn{constructor(t,i){this.name="GoogleTagGateway",this.O=!1,this.wi=!1,this.xi=!1,this.ki=!1,this.Si=null,this.Ci=null,this.Mi=null,this.Ai=null,this.$i=[],this.Ei=100,this.Ri=new Sn(100),this._instance=t,this.j=i||Mn.extractConfig(t.getConfig()),this.Ti=_n(),this.Ii()}static extractConfig(t){if(t.disable_google_tag)return{enabled:!1};var i=t.google_tag;return i?{enabled:(i.tagIds||[]).some(t=>!!t),remote:i}:{enabled:!1}}get isEnabled(){return!1!==this.j.enabled&&!!this.j.remote}get isStarted(){return this.O}get gtag(){return this.Ti.call}get deliveryLog(){return this.$i.slice()}startIfEnabled(){this.O||this.isEnabled&&this._instance.getConfig().__remote_config_loaded&&this.ut()}stop(){var t;this.O&&(null===(t=this.Ai)||void 0===t||t.call(this),this.Ai=null,this.O=!1)}onConfigUpdate(t){var i=Mn.extractConfig(t),e=this.isEnabled;this.j=i;var r=!0===t.__remote_config_loaded;if(e&&!this.isEnabled)this.stop();else if(this.O&&i.remote&&this.Ci){var n=an(i.remote,this._instance.getConfig().api_host);n&&(this.Ci=n,on(this.Si,n))}r&&!this.isEnabled&&this.Ri.clear(),r&&this.isEnabled&&!this.O&&this.startIfEnabled()}setUserData(t){var e=this;return i(function*(){var i=e.j.remote;if(i&&i.enhancedConversions){var r=yield function(t){return kn.apply(this,arguments)}(t);r&&e.Ti.call("set","user_data",r)}})()}getRecentPublicCalls(){return this.Ti.getRecentCalls()}ut(){var t=this.j.remote;if(t){var i=an(t,this._instance.getConfig().api_host);if(i){this.Ci=i;var{gtag:e}=function(){var t,i,e=V,r=null!==(t=(i=e).dataLayer)&&void 0!==t?t:i.dataLayer=[],n=e.gtag;if(n)return{gtag:n,dataLayer:r};var s=function(){r.push(arguments)};return e.gtag=s,{gtag:s,dataLayer:r}}();this.Si=e,this.Ti.flush(e),this.Pi(),on(e,i),this.wi||(this.wi=!0,function(t,i,e){var r=null==j?void 0:j.document;if(!r)return null;var{origin:n,gatewayPath:s,primaryTagId:o}=t;if(!n||!o)return null;var a=""+n.replace(/\/$/,"")+(s?s.startsWith("/")?s.replace(/\/$/,""):"/"+s.replace(/\/$/,""):"")+"/gtag/js?id="+encodeURIComponent(o)+"&l=dataLayer",l=r.querySelector('script[data-vtilt-gtag-loader="'+o+'"]');if(l)return l;var u=r.createElement("script");u.async=!0,u.src=a,u.setAttribute("data-vtilt-gtag-loader",o),u.onload=()=>null==i?void 0:i(),u.onerror=()=>{var t=new Error("[GoogleTagGateway] failed to load "+a);null==e||e(t)},(r.head||r.body||r.documentElement).appendChild(u)}(i,()=>{this.xi=!0},t=>{at().warn(Cn,t.message)})),this.Oi(),this.O=!0,this.Li()}else at().warn(Cn,"skipped — missing tag_ids or resolvable origin")}}Li(){for(var t of this.Ri.takeAll())this.Ui(t.event,t.payload)}Pi(){var t;if(!this.ki&&this.Si){var i=ut(()=>this._instance.consentManager.getConsent());!function(t,i,r){t("consent","default",e({},hn(i,r),{wait_for_update:500}))}(this.Si,i||{},null===(t=this.j.remote)||void 0===t?void 0:t.consentOverride),this.ki=!0}}Ii(){if(!this.Mi){this.Mi=this._instance._emitter.on(mt,t=>{var i=t;i&&"string"==typeof i.event&&this.Ui(i.event,i.payload||{})})}}Ui(t,i){var e=this._instance.getConfig();if(!e.disable_google_tag)if(e.__remote_config_loaded){if(this.isEnabled&&(this.O||this.startIfEnabled(),this.Si&&this.j.remote&&this.O)){var r=this.j.remote,n=r.tagIds||[],s=yn(this.Si,t,i,r);if(s.fired&&s.eventName&&this.Di({ts:Date.now(),tag_ids:n,event_name:t,send_to:"ga4:"+s.eventName,status:"fired",reason:s.source}),!1!==r.sendAdsConversions){var o=function(t,i,e,r){var n=(r.conversions||[]).filter(t=>t.event_name===i);if(0===n.length)return[];var s=[];for(var o of n){var a=pn({mapping:o,payload:e});t("event","conversion",a.params),s.push(a)}return s}(this.Si,t,i,r);for(var a of o)this.Di({ts:Date.now(),tag_ids:n,event_name:t,send_to:a.send_to,status:"fired"})}}}else this.Ri.enqueue({event:t,payload:i})}Oi(){if(!this.Ai){this.Ai=this._instance._emitter.on(bt,t=>{var i;if(this.Si){var e,r,n,s=t;e=this.Si,r=s.consent||{},n=null===(i=this.j.remote)||void 0===i?void 0:i.consentOverride,e("consent","update",hn(r,n))}})}}Di(t){this.$i.push(t),this.$i.length>this.Ei&&this.$i.shift()}}var An="vtd-overlay";class $n{constructor(t,i){this.name="VtdOverlay",this.O=!1,this.Bi=null,this.ji=null,this.L=!0,this.zi=null,this.Ni=null,this.Fi=null,this._instance=t,this.j=i||$n.extractConfig(t.getConfig())}static extractConfig(t){return{enabled:!1!==t.vtd_overlay}}get isEnabled(){return!1!==this.j.enabled}get isStarted(){return this.O}startIfEnabled(){}stop(){this.O&&ut(()=>{this.qi(),this.O=!1})}onConfigUpdate(t){this.j=$n.extractConfig(t),!this.isEnabled&&this.O&&this.stop()}setDestinationUrl(t){var i;if(this.isEnabled)if(null==t?void 0:t.trim()){var e=t;try{e=decodeURIComponent(t)}catch(i){e=t}if(this.Hi(e)){var r=this.Wi(e);this.ji=e,this.Bi=r,this.L=!0,this.Vi(),this.O=!0,this._instance.capture("$vtd_view",{$vtd_url:e,$vtd_embed_url:r!==e?r:void 0,$current_url:null===(i=null==j?void 0:j.location)||void 0===i?void 0:i.href})}else at().warn(An,"invalid URL: "+e)}else at().warn(An,"empty URL provided");else at().warn(An,"feature is disabled")}getDestinationUrl(){return this.Bi}close(){this._instance.capture("$vtd_close",{$vtd_url:this.ji}),this.zi?(this.zi.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.qi(),this.O=!1,this.Bi=null,this.ji=null},200)):(this.qi(),this.O=!1,this.Bi=null,this.ji=null)}Hi(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}Wi(t){try{var i=new URL(t),e=i.hostname.toLowerCase();if("youtube.com"===e||"www.youtube.com"===e||"m.youtube.com"===e){var r=i.searchParams.get("v");if(r){var n=i.searchParams.get("t"),s="https://www.youtube.com/embed/"+r+"?autoplay=1";return n&&(s+="&start="+n.replace("s","")),s}}if("youtu.be"===e){var o=i.pathname.slice(1);if(o){var a=i.searchParams.get("t"),l="https://www.youtube.com/embed/"+o+"?autoplay=1";return a&&(l+="&start="+a.replace("s","")),l}}if("vimeo.com"===e||"www.vimeo.com"===e){var u=i.pathname.match(/^\/(\d+)/);if(u)return"https://player.vimeo.com/video/"+u[1]+"?autoplay=1"}if("loom.com"===e||"www.loom.com"===e){var h=i.pathname.match(/^\/share\/([a-zA-Z0-9]+)/);if(h)return"https://www.loom.com/embed/"+h[1]+"?autoplay=1"}if(e.endsWith("wistia.com")){var d=i.pathname.match(/^\/medias\/([a-zA-Z0-9]+)/);if(d)return"https://fast.wistia.net/embed/iframe/"+d[1]+"?autoplay=1"}if("dailymotion.com"===e||"www.dailymotion.com"===e){var v=i.pathname.match(/^\/video\/([a-zA-Z0-9]+)/);if(v)return"https://www.dailymotion.com/embed/video/"+v[1]+"?autoplay=1"}if("open.spotify.com"===e){var c=i.pathname.match(/^\/(track|album|playlist|episode|show)\/([a-zA-Z0-9]+)/);if(c)return"https://open.spotify.com/embed/"+c[1]+"/"+c[2]}return"drive.google.com"===e&&i.pathname.includes("/view")?t.replace("/view","/preview"):t}catch(i){return t}}Gi(t){try{return new URL(t).hostname}catch(i){return t}}Ki(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}Vi(){if(F&&this.Bi){this.qi(),this.zi=F.createElement("div"),this.zi.id="vtilt-vtd-overlay",this.zi.className="vtilt-vtd-opening",this.zi.setAttribute("style",this.Ji());var t=F.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.Xi());var i=F.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Zi()),i.innerHTML=this.Qi(),t.appendChild(i);var e=F.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Yi()),this.Fi=F.createElement("div"),this.Fi.className="vtilt-vtd-loading",this.Fi.setAttribute("style",this.te()),this.Fi.innerHTML=this.ie(),e.appendChild(this.Fi),this.Ni=F.createElement("iframe"),this.Ni.id="vtilt-vtd-iframe",this.Ni.className="vtilt-vtd-iframe",this.Ni.setAttribute("style",this.ee()),this.Ni.setAttribute("frameborder","0"),this.Ni.setAttribute("allowfullscreen","true"),this.Ni.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var r=()=>{this.L=!1,this.Fi&&(this.Fi.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.Fi)||void 0===t?void 0:t.parentNode)&&(this.Fi.style.display="none")},300)),this.Ni&&(this.Ni.style.opacity="1")};this.Ni.onload=r,this.Ni.onerror=r,setTimeout(()=>{this.L&&r()},5e3),e.appendChild(this.Ni),this.Ni.src=this.Bi,t.appendChild(e),this.zi.appendChild(t);var n=F.createElement("style");n.id="vtilt-vtd-styles",n.textContent=this.re(),F.head.appendChild(n),F.body.appendChild(this.zi),this.ne(),F.body.style.overflow="hidden"}}qi(){var t;(null===(t=this.zi)||void 0===t?void 0:t.parentNode)&&(this.zi.parentNode.removeChild(this.zi),this.zi=null,this.Ni=null,this.Fi=null);var i=null==F?void 0:F.getElementById("vtilt-vtd-styles");(null==i?void 0:i.parentNode)&&i.parentNode.removeChild(i),(null==F?void 0:F.body)&&(F.body.style.overflow="")}ne(){var t,i,e,r=null===(t=this.zi)||void 0===t?void 0:t.querySelector(".vtilt-vtd-close");null==r||r.addEventListener("click",()=>this.close());var n=null===(i=this.zi)||void 0===i?void 0:i.querySelector(".vtilt-vtd-open");null==n||n.addEventListener("click",()=>{this.ji&&(null==j||j.open(this.ji,"_blank"))}),null===(e=this.zi)||void 0===e||e.addEventListener("click",t=>{t.target===this.zi&&this.close()});var s=t=>{"Escape"===t.key&&(this.close(),null==F||F.removeEventListener("keydown",s))};null==F||F.addEventListener("keydown",s)}Ji(){return'\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n '}Xi(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Zi(){return"\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 16px;\n height: 56px;\n background: linear-gradient(180deg, rgba(20, 20, 20, 1) 0%, rgba(15, 15, 15, 1) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n flex-shrink: 0;\n gap: 16px;\n "}Qi(){var t=this.ji||this.Bi,i=t?this.Gi(t):"";return'\n <div style="display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;">\n <img \n src="'+(t?this.Ki(t):"")+'" \n alt="" \n style="width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;"\n onerror="this.style.display=\'none\'"\n />\n <div style="\n display: flex;\n flex-direction: column;\n min-width: 0;\n gap: 2px;\n ">\n <div style="\n color: rgba(255, 255, 255, 0.95);\n font-size: 14px;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.se(i)+'</div>\n <div style="\n color: rgba(255, 255, 255, 0.45);\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: 1.2;\n ">'+this.se(this.oe(t||"",50))+'</div>\n </div>\n </div>\n <div style="display: flex; align-items: center; gap: 8px; flex-shrink: 0;">\n <button class="vtilt-vtd-open vtilt-vtd-btn" title="Open in new tab">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>\n <polyline points="15 3 21 3 21 9"></polyline>\n <line x1="10" y1="14" x2="21" y2="3"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Open</span>\n </button>\n <button class="vtilt-vtd-close vtilt-vtd-btn vtilt-vtd-btn-primary" title="Close (Esc)">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n <span class="vtilt-vtd-btn-text">Close</span>\n </button>\n </div>\n '}Yi(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}te(){return"\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #0a0a0a;\n z-index: 1;\n transition: opacity 0.3s ease;\n "}ie(){var t=this.ji||this.Bi,i=t?this.Gi(t):"";return'\n <div class="vtilt-vtd-spinner"></div>\n <div style="\n margin-top: 20px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 14px;\n font-weight: 500;\n ">Loading '+this.se(i)+'...</div>\n <div style="\n margin-top: 8px;\n color: rgba(255, 255, 255, 0.35);\n font-size: 12px;\n ">Press <kbd style="\n display: inline-block;\n padding: 2px 6px;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n font-family: inherit;\n font-size: 11px;\n ">Esc</kbd> to close</div>\n '}ee(){return"\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n background: white;\n opacity: 0;\n transition: opacity 0.3s ease;\n "}re(){return"\n /* Animations */\n @keyframes vtilt-vtd-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes vtilt-vtd-fade-out {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n \n @keyframes vtilt-vtd-scale-in {\n from { opacity: 0; transform: scale(0.96); }\n to { opacity: 1; transform: scale(1); }\n }\n \n @keyframes vtilt-vtd-spin {\n to { transform: rotate(360deg); }\n }\n \n /* Container animations */\n #vtilt-vtd-overlay.vtilt-vtd-opening {\n animation: vtilt-vtd-fade-in 0.2s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-opening .vtilt-vtd-modal {\n animation: vtilt-vtd-scale-in 0.25s ease-out forwards;\n }\n \n #vtilt-vtd-overlay.vtilt-vtd-closing {\n animation: vtilt-vtd-fade-out 0.2s ease-in forwards;\n }\n \n /* Loading spinner */\n .vtilt-vtd-spinner {\n width: 40px;\n height: 40px;\n border: 3px solid rgba(255, 255, 255, 0.1);\n border-top-color: rgba(255, 255, 255, 0.8);\n border-radius: 50%;\n animation: vtilt-vtd-spin 0.8s linear infinite;\n }\n \n /* Button base styles */\n .vtilt-vtd-btn {\n background: rgba(255, 255, 255, 0.08);\n border: 1px solid rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.9);\n padding: 8px 14px;\n border-radius: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.15s ease;\n -webkit-tap-highlight-color: transparent;\n outline: none;\n }\n \n .vtilt-vtd-btn:hover {\n background: rgba(255, 255, 255, 0.14);\n border-color: rgba(255, 255, 255, 0.18);\n }\n \n .vtilt-vtd-btn:active {\n background: rgba(255, 255, 255, 0.18);\n transform: scale(0.98);\n }\n \n .vtilt-vtd-btn:focus-visible {\n box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);\n }\n \n /* Primary button variant */\n .vtilt-vtd-btn-primary {\n background: rgba(255, 255, 255, 0.95);\n border-color: transparent;\n color: #0a0a0a;\n }\n \n .vtilt-vtd-btn-primary:hover {\n background: rgba(255, 255, 255, 1);\n border-color: transparent;\n }\n \n .vtilt-vtd-btn-primary:active {\n background: rgba(255, 255, 255, 0.85);\n }\n \n /* Desktop responsive - modal with margin */\n @media (min-width: 768px) {\n #vtilt-vtd-overlay {\n padding: 32px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1200px;\n max-height: 90vh;\n width: 100%;\n height: auto;\n min-height: 500px;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);\n }\n \n .vtilt-vtd-header {\n border-radius: 16px 16px 0 0;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 0 16px 16px;\n min-height: 400px;\n }\n }\n \n /* Large desktop - bigger modal */\n @media (min-width: 1400px) {\n #vtilt-vtd-overlay {\n padding: 48px;\n }\n \n .vtilt-vtd-modal {\n max-width: 1400px;\n max-height: 85vh;\n }\n }\n \n /* Tablet */\n @media (min-width: 768px) and (max-width: 1024px) {\n #vtilt-vtd-overlay {\n padding: 24px;\n }\n \n .vtilt-vtd-modal {\n max-width: 95%;\n max-height: 90vh;\n }\n }\n \n /* Mobile - fullscreen */\n @media (max-width: 767px) {\n #vtilt-vtd-overlay {\n padding: 0 !important;\n background: #0a0a0a !important;\n }\n \n .vtilt-vtd-modal {\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n border-radius: 0 !important;\n }\n \n .vtilt-vtd-header {\n border-radius: 0 !important;\n padding: 0 12px !important;\n height: 52px !important;\n }\n \n .vtilt-vtd-btn {\n padding: 8px 10px !important;\n }\n \n .vtilt-vtd-btn-text {\n display: none !important;\n }\n \n .vtilt-vtd-iframe-wrapper {\n border-radius: 0 !important;\n }\n }\n \n /* Reduced motion */\n @media (prefers-reduced-motion: reduce) {\n #vtilt-vtd-overlay,\n #vtilt-vtd-overlay *,\n .vtilt-vtd-spinner {\n animation-duration: 0.01ms !important;\n transition-duration: 0.01ms !important;\n }\n }\n "}oe(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}se(t){if(void 0===F)return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");var i=F.createElement("div");return i.textContent=t,i.innerHTML}}var En,Rn="text/plain",Tn=61440;!function(t){t.GZipJS="gzip-js",t.Base64="base64",t.None="none"}(En||(En={}));var In=function(t,i){void 0===i&&(i="binary");var{data:e,compression:r}=t;if(e){var n=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(e),s=new Blob([n]).size;if(r===En.GZipJS&&s>=1024)try{var o=Wr(function(t,i){if(Vr)return Vr.encode(t);for(var e=t.length,r=new dr(t.length+(t.length>>1)),n=0,s=function(t){r[n++]=t},o=0;o<e;++o){if(n+5>r.length){var a=new dr(n+8+(e-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);l<128||i?s(l):l<2048?(s(192|l>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>18),s(128|l>>12&63),s(128|l>>6&63),s(128|63&l)):(s(224|l>>12),s(128|l>>6&63),s(128|63&l))}return Tr(r,0,n)}(n),{mtime:0});if("text-base64"===i){var a=function(t){if("undefined"==typeof btoa)throw new Error("btoa is not available in this environment");for(var i="",e=0;e<t.length;e+=32768){var r=Math.min(e+32768,t.length),n=t.subarray(e,r);i+=String.fromCharCode.apply(null,n)}return btoa(i)}(o);if(a.length>0&&a.length<.95*s)return{contentType:Rn,body:a,estimatedSize:a.length,compressionApplied:En.Base64}}else{var l=new Blob([o],{type:Rn});if(l.size>0&&l.size<.95*s)return{contentType:Rn,body:l,estimatedSize:l.size,compressionApplied:En.GZipJS}}}catch(t){}return{contentType:"application/json",body:n,estimatedSize:s,compressionApplied:null}}};function Pn(t,i){return i.compressionApplied?(e=t.url,r=i.compressionApplied,n=e.includes("?")?"&":"?",""+e+n+"compression="+r):t.url;var e,r,n}function On(t,i){var e={};return i&&(e["Content-Type"]=i),t.headers&&Object.assign(e,t.headers),t.projectToken&&(e[ht]=t.projectToken),e}var Ln=[{name:"fetch",isAvailable:()=>"undefined"!=typeof fetch,method:t=>{var e=In(t,"binary");if(e){var{contentType:r,body:n,estimatedSize:s}=e,o=Pn(t,e),a=On(t,r),l=new AbortController,u=t.timeout?setTimeout(()=>l.abort(),t.timeout):null;fetch(o,{method:t.method||"POST",headers:a,body:n,keepalive:s<Tn,signal:l.signal}).then(function(){var e=i(function*(i){var e,r=yield i.text(),n={statusCode:i.status,text:r};if(200===i.status){Ct();try{n.json=JSON.parse(r)}catch(t){}}null===(e=t.callback)||void 0===e||e.call(t,n)});return function(t){return e.apply(this,arguments)}}()).catch(()=>{var i;St("capture"),null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{u&&clearTimeout(u)})}}},{name:"XHR",isAvailable:()=>"undefined"!=typeof XMLHttpRequest,method:t=>{var i=In(t,"binary");if(i){var{contentType:e,body:r}=i,n=Pn(t,i),s=On(t,e),o=new XMLHttpRequest;for(var[a,l]of(o.open(t.method||"POST",n,!0),Object.entries(s)))o.setRequestHeader(a,l);t.timeout&&(o.timeout=t.timeout),o.onreadystatechange=()=>{var i;if(4===o.readyState){var e={statusCode:o.status,text:o.responseText};if(200===o.status){Ct();try{e.json=JSON.parse(o.responseText)}catch(t){}}null===(i=t.callback)||void 0===i||i.call(t,e)}},o.onerror=()=>{var i;St("capture"),null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})},o.send(r)}}},{name:"sendBeacon",isAvailable:()=>"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=In(t,"text-base64");if(i){var{contentType:r,body:n,estimatedSize:s}=i;if(0!==s){var o=Pn(t,i),a=t.projectToken?function(t,i){if(!i||/[?&]token=/.test(t))return t;var e=t.includes("?")?"&":"?";return""+t+e+"token="+i}(o,t.projectToken):o;if(s<=Tn)try{var l="string"==typeof n?new Blob([n],{type:r}):n;if("undefined"!=typeof navigator&&navigator.sendBeacon)if(navigator.sendBeacon(a,l))return}catch(t){}try{var u="string"==typeof n?new Blob([n],{type:r}):n,h=e({"Content-Type":r},t.headers||{});fetch(a,{method:t.method||"POST",headers:h,body:u,keepalive:s<Tn}).catch(()=>{})}catch(t){}}}}}],Un=t=>{var i,e;if(Mt())null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0});else{var r=t.transport||"fetch",n=Ln.find(t=>t.name===r&&t.isAvailable())||Ln.find(t=>t.isAvailable());if(!n)return at().error("request","no available transport method"),void(null===(e=t.callback)||void 0===e||e.call(t,{statusCode:0}));n.method(t)}};class Dn{constructor(t,i){var e,r,n,s;this.ae=!0,this.le=[],this.ue=(e=(null==i?void 0:i.flush_interval_ms)||3e3,r=250,n=5e3,s=3e3,"number"!=typeof e||isNaN(e)?s:Math.min(Math.max(e,r),n)),this.he=t}get length(){return this.le.length}enqueue(t){this.le.push(t),this.de||this.ve()}unload(){if(this.ce(),0!==this.le.length){var t=this.fe();for(var i in t){var r=t[i];this.he(e({},r,{transport:"sendBeacon"}))}}}enable(){this.ae=!1,this.ve()}pause(){this.ae=!0,this.ce()}flush(){this.ce(),this.pe(),this.ve()}ve(){this.ae||(this.de=setTimeout(()=>{this.ce(),this.pe(),this.le.length>0&&this.ve()},this.ue))}ce(){this.de&&(clearTimeout(this.de),this.de=void 0)}pe(){if(0!==this.le.length){var t=this.fe(),i=Date.now();for(var e in t){var r=t[e];r.events.forEach(t=>{var e=new Date(t.timestamp).getTime();t.$offset=Math.abs(e-i)}),this.he(r)}}}fe(){var t={};return this.le.forEach(i=>{var e=i.batchKey||i.url;t[e]||(t[e]={url:i.url,events:[],batchKey:i.batchKey}),t[e].events.push(i.event)}),this.le=[],t}}class Bn{constructor(t){this.ge=!1,this.be=3e3,this.le=[],this.me=!0,this.he=t.sendRequest,this.ye=t.sendBeacon,j&&void 0!==N&&"onLine"in N&&(this.me=N.onLine,Tt(j,"online",()=>{this.me=!0,this.Y()}),Tt(j,"offline",()=>{this.me=!1}))}get length(){return this.le.length}enqueue(t,i){if(void 0===i&&(i=0),i>=10)at().error("retry","request failed after 10 retries, giving up");else if(!Mt()){var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,r=Math.min(18e5,i),n=(Math.random()-.5)*(r-e);return Math.ceil(r+n)}(i),r=Date.now()+e;this.le.push({retryAt:r,request:t,retriesPerformedSoFar:i+1});var n="enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.me||(n+=" (browser is offline)"),at().warn("retry",n),this.ge||(this.ge=!0,this._e())}}retriableRequest(t){var e=this;return i(function*(){try{var i=yield e.he(t);200!==i.statusCode&&(i.statusCode<400||i.statusCode>=500)&&e.enqueue(t,0)}catch(i){e.enqueue(t,0)}})()}_e(){this.we&&clearTimeout(this.we),this.we=setTimeout(()=>{this.me&&this.le.length>0&&this.Y(),this.le.length>0?this._e():this.ge=!1},this.be)}Y(){var t=this,e=Date.now(),r=[],n=[];this.le.forEach(t=>{t.retryAt<e?n.push(t):r.push(t)}),this.le=r,n.forEach(function(){var e=i(function*(i){var{request:e,retriesPerformedSoFar:r}=i;try{var n=yield t.he(e);200!==n.statusCode&&(n.statusCode<400||n.statusCode>=500)&&t.enqueue(e,r)}catch(i){t.enqueue(e,r)}});return function(t){return e.apply(this,arguments)}}())}unload(){this.we&&(clearTimeout(this.we),this.we=void 0),this.le.forEach(t=>{var{request:i}=t;try{this.ye(i)}catch(t){at().error("retry","failed to send beacon on unload",t)}}),this.le=[]}}var jn="vt_rate_limit";class zn{constructor(t){var i,e;void 0===t&&(t={}),this.lastEventRateLimited=!1,this.eventsPerSecond=null!==(i=t.eventsPerSecond)&&void 0!==i?i:10,this.eventsBurstLimit=Math.max(null!==(e=t.eventsBurstLimit)&&void 0!==e?e:10*this.eventsPerSecond,this.eventsPerSecond),this.persistence=t.persistence,this.captureWarning=t.captureWarning,this.lastEventRateLimited=this.checkRateLimit(!0).isRateLimited}checkRateLimit(t){var i,e,r,n;void 0===t&&(t=!1);var s=Date.now(),o=null!==(e=null===(i=this.persistence)||void 0===i?void 0:i.get(jn))&&void 0!==e?e:{tokens:this.eventsBurstLimit,last:s},a=(s-o.last)/1e3;o.tokens+=a*this.eventsPerSecond,o.last=s,o.tokens>this.eventsBurstLimit&&(o.tokens=this.eventsBurstLimit);var l=o.tokens<1;return l||t||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||t||null===(r=this.captureWarning)||void 0===r||r.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=l,null===(n=this.persistence)||void 0===n||n.set(jn,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class Nn{constructor(t){this.xe=null,this.ke=null,this.Se=t}get config(){return this.xe}onApply(t){this.Ce=t}onLoad(t){this.Me=t}load(){var t,i=this.Se.getConfig();if(i.token){if(this.ke||(this.ke=e({},i)),null===(t=i.bootstrap)||void 0===t?void 0:t.remoteConfig)return this.xe=i.bootstrap.remoteConfig,this.Ae(this.xe),void this.$e();var r=ut(()=>j.__VTILT_BOOTSTRAP__);if(null==r?void 0:r.remoteConfig)return this.xe=r.remoteConfig,this.Ae(this.xe),void this.$e();ut(()=>{var t=localStorage.getItem(h+"_"+i.token);t&&(this.xe=JSON.parse(t),this.Ae(this.xe,!0))}),this.$e()}}$e(){var t=this.Se.getConfig();if(t.token)if(Mt())this.Se.updateConfig({__remote_config_loaded:!0});else{var i=this.Se.buildEndpointUrl("/api/d"),r=new AbortController,n=setTimeout(()=>r.abort(),3e3);(H||fetch)(i,{method:"GET",signal:r.signal,headers:e({Accept:"application/json"},vt(t))}).then(t=>t.json()).then(i=>{var e;clearTimeout(n),Ct(),this.xe=i,ut(()=>{localStorage.setItem(h+"_"+t.token,JSON.stringify(i))}),this.Ae(i),null===(e=this.Me)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(n),St("config"),this.Se.updateConfig({__remote_config_loaded:!0})})}}Ae(t,i){var r,n,s,o;void 0===i&&(i=!1);var a=this.ke||this.Se.getConfig(),l={};for(var[,u]of this.Se.featureManager.getDescriptors())if(u.remoteConfig&&u.configKey){var h=t[u.remoteConfig.key];h&&void 0===a[u.configKey]&&(l[u.configKey]=u.remoteConfig.map(h))}if(t.analytics&&!i&&(void 0!==t.analytics.capturePageview&&void 0===a.capture_pageview&&(l.capture_pageview=t.analytics.capturePageview),void 0!==t.analytics.capturePageleave&&void 0===a.capture_pageleave&&(l.capture_pageleave=!!t.analytics.capturePageleave),void 0!==t.analytics.capturePerformance&&void 0===a.capture_performance&&(l.capture_performance=t.analytics.capturePerformance),void 0===a.autocapture)){var d=t.analytics.autocapture,v=t.analytics.scrollDepthMilestones,c=t.analytics.scrollDepthPageleave;void 0!==d&&(l.autocapture=d&&(v||c)?{scroll_depth:e({},v?{milestones:!0}:{},c?{pageleave:!0}:{})}:d)}i||(l.__remote_config_loaded=!0),void 0!==(null===(r=t.privacy)||void 0===r?void 0:r.respectDnt)&&void 0===a.respect_dnt&&(l.respect_dnt=t.privacy.respectDnt),void 0!==(null===(n=t.privacy)||void 0===n?void 0:n.requireConsent)&&void 0===a.require_consent&&(l.require_consent=t.privacy.requireConsent),void 0!==t.autocapture_opt_out&&(l.autocapture_opt_out=t.autocapture_opt_out),void 0!==t.elementsChainAsString&&(l.elementsChainAsString=t.elementsChainAsString),(null===(s=t.diagnostics)||void 0===s?void 0:s.defaultLogLevel)&&at().setLevelFromRemote(t.diagnostics.defaultLogLevel),Object.keys(l).length>0&&this.Se.updateConfig(l),null===(o=this.Ce)||void 0===o||o.call(this,t)}}var Fn=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"];function qn(t,i){if(void 0===i&&(i=[]),!t)return!1;var e=t.toLowerCase();return[...Fn,...i].some(t=>-1!==e.indexOf(t.toLowerCase()))}function Hn(t,i){var e;if(void 0===i&&(i=[]),!t)return!1;var r=t.userAgent;if(r&&qn(r,i))return!0;try{var n=t.userAgentData;if(null===(e=null==n?void 0:n.brands)||void 0===e?void 0:e.some(t=>qn(null==t?void 0:t.brand,i)))return!0}catch(t){}return!!t.webdriver}var Wn=36e5;function Vn(){var t,i,e;return null!==(e=null===(i=null===(t=null==j?void 0:j.performance)||void 0===t?void 0:t.now)||void 0===i?void 0:i.call(t))&&void 0!==e?e:Date.now()}class Gn{constructor(){this.Ee=Vn(),this.Re=null,this.Te=Vn(),this.Ie="",this.Pe="",this.Oe="",this.Le=""}onAfterPageview(){var t=Vn();this.Ee=t,this.Re=t,this.Le="",q&&(this.Ie=q.href||"",this.Pe=q.pathname||""),F&&(this.Oe=F.title||"")}peekEngagementSinceLastCaptureMs(){var t,i=Vn(),e=null!==(t=this.Re)&&void 0!==t?t:this.Te,r=Math.round(i-e);return r<1&&(r=1),r>Wn&&(r=Wn),r}commitCaptureClock(){this.Re=Vn()}Ue(){return this.Ie+"\0"+this.Pe}clearLeaveDedupe(){this.Le=""}tryCapturePageleave(t,i,e,r){if(function(t){var i=t.capture_pageleave;return!1!==i&&(!0===i||!1!==t.capture_pageview)}(t)){var n=this.Ue();if((this.Ie||this.Pe)&&n&&this.Le!==n){this.Le=n;var s=Vn(),o=Math.round(s-this.Ee);o<1&&(o=1),o>Wn&&(o=Wn);var a={navigation_type:e,engagement_time_msec:o,[R]:this.Ie,[T]:this.Pe,[I]:Math.round(o/1e3),[P]:this.Pe,[O]:this.Ie},l=this.Ie?function(t){try{return new URL(t).host}catch(t){return""}}(this.Ie):"";l&&(a.$host=l),this.Oe&&(a.title=this.Oe),r&&Object.assign(a,r),i(y,a,{skip_engagement:!0})}}}}var Kn=[_,w,x,y,M,A,k,E],Jn=new Set([_,w,x]),Xn=new Set([y,E,M,A,k]);class Zn{constructor(t){this.De=!1,this.Be=!1,this.je=null,this.ze=null,this.Ne=new Gn,this.Se=t}setVtPersonId(t){this.ze=t}capture(t,i,r){var n,s,o;this.Se.sessionManager.setSessionId();var a=this.Se.getConfig();if(a.opt_out_useragent_filter||!Hn(N,null!==(n=a.custom_blocked_useragents)&&void 0!==n?n:[]))if((null==N?void 0:N.userAgent)&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(N.userAgent))if((null==r?void 0:r.skip_client_rate_limiting)||Kn.includes(t)||this.Se.rateLimiter.shouldAllowEvent())if(!this.Se.getConfig().require_consent||Jn.has(t)||(null===(s=this.Se.consentManager)||void 0===s?void 0:s.hasConsent())){var l=this.Se.buildUrl(),u=!0===(null==r?void 0:r.skip_engagement)||Xn.has(t),h=e({},i);u||"number"==typeof h.engagement_time_msec||(h=e({},h,{engagement_time_msec:this.Ne.peekEngagementSinceLastCaptureMs()}));var d=e({},this.Fe(t,h),a.globalAttributes),v=JSON.stringify(d);if(!(c=v)||"string"!=typeof c||c.length<2||c.length>Et)at().debug("capture","dropped",t,{reason:"payload_invalid_size",bytes:v.length,limitBytes:Et,hint:t===S?"Trim global / event properties; $elements is already off by default in compact mode.":"Trim event properties; payload exceeded the runaway-guard cap."});else{var c,f=t===_?this.Se.userManager.getAnonymousId():null!==(o=this.Se.userManager.getDistinctId())&&void 0!==o?o:this.Se.userManager.getAnonymousId(),p={timestamp:(new Date).toISOString(),event:t,payload:d,distinct_id:f,anonymous_id:this.Se.userManager.getAnonymousId()};this.Se.bufferEvent(t,l,p),at().debug("capture","enqueued",t,e({distinct_id:f,$current_url:d.$current_url,$session_id:d.$session_id,$debug:d.$debug},t===S&&"object"==typeof d&&null!==d?{$event_type:d.$event_type}:{})),this.ze&&(this.ze=null),t===m?this.Ne.onAfterPageview():this.Ne.commitCaptureClock()}}else at().debug("capture","dropped",t,{reason:"require_consent_and_no_consent"});else at().debug("capture","dropped",t,{reason:"client_rate_limited",hint:"Token bucket (~10/s, burst ~100). $autocapture counts toward the same limit as custom events."});else at().debug("capture","dropped",t,{reason:"invalid_or_missing_user_agent"});else at().debug("capture","dropped",t,{reason:"bot"})}captureInternal(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}captureInitialPageview(){F&&("visible"===F.visibilityState?this.Be||(this.Be=!0,setTimeout(()=>{F&&q&&!1!==this.Se.getConfig().capture_pageview&&this.capture(m,{navigation_type:"initial_load"})},300),this.je&&(F.removeEventListener("visibilitychange",this.je),this.je=null)):this.je||(this.je=()=>this.captureInitialPageview(),Tt(F,"visibilitychange",this.je)))}tryCapturePageleave(t,i){this.Ne.tryCapturePageleave(this.Se.getConfig(),(t,i,e)=>this.capture(t,i,e),t,i)}resetPageleaveDedupe(){this.Ne.clearLeaveDedupe()}qe(){if(this.Se.getConfig().debug)return!0;try{if(null==q?void 0:q.search)if("1"===new URLSearchParams(q.search).get("vtilt_debug"))return!0}catch(t){}return!1}Fe(t,i){var r,n,s=this.Se.getConfig(),o=s.mask_personal_data_properties,a=s.custom_personal_data_properties,l=le(o,a),u=Ot(function(t,i,e){if(!F)return{};var r=i?Pt([],Zi,e||[]):[];return It({},te(Wt(F.URL,r,Yi)))}(0,o,a)),h=this.Se.userManager.getUserProperties(),d=this.Se.userManager.get_initial_props(),v=this.Se.sessionManager.getSessionId(),c=this.Se.sessionManager.getWindowId(),f={};!this.De&&Object.keys(d).length>0&&Object.assign(f,d),i.$set_once&&Object.assign(f,i.$set_once);var p=e({},l,u,h,null!==(n=null===(r=this.Se.consentManager)||void 0===r?void 0:r.getConsentProperties())&&void 0!==n?n:{},{$session_id:v,$window_id:c},this.ze?{$vt:this.ze}:{},Object.keys(f).length>0?{$set_once:f}:{},i.$set?{$set:i.$set}:{},i);!this.De&&Object.keys(d).length>0&&(this.De=!0),t===m&&F&&(p.title=F.title),this.qe()&&(p.$debug=!0);var g=this.Se.sessionManager.consumeSessionStart(),b=this.Se.userManager.consumeFirstVisit();return g&&(p.$session_start=!0),b&&(p.$first_visit=!0),p}}var Qn=["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"];function Yn(t){return!(!t||"string"!=typeof t)&&Qn.includes(t.toLowerCase().trim())}class ts{constructor(t){this.He=null,this.We=null,this.Se=t}identify(t,i,r){var n;if("number"==typeof t&&(t=String(t),at().warn("identify","first argument should be a string, not a number")),t)if(Yn(t))at().error("identify",'"'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var s=JSON.stringify([t,i,r]);if(this.He!==s){var o=this.Se.userManager,a=o.getDistinctId(),l=o.getAnonymousId(),u=o.getDeviceId();if(!("identified"===o.getUserState())&&l!==t||t!==a){this.Se.capture(_,{distinct_id:t,$set:i||{},$set_once:r||{}});var h={user_state:"identified",distinct_id:t,properties_set:i,properties_set_once:r};if(!u){var d=a||l;h.device_id=d,h.properties_set=e({$had_persisted_distinct_id:!0,$device_id:d},h.properties_set||{})}o.applyUpdate(h),null===(n=this.Se._emitter)||void 0===n||n.emit("user:identified",{distinctId:t})}else(i||r)&&this.setUserProperties(i,r);this.He=s}}else at().error("identify","cannot use sentinel value as distinct_id");else at().error("identify","unique user id is required")}setUserProperties(t,i){var e,r;if(t||i){var n=this.Se.userManager,s=JSON.stringify([null!==(e=n.getDistinctId())&&void 0!==e?e:n.getAnonymousId(),t,i]);this.We!==s&&(n.applyUpdate({properties_set:t,properties_set_once:i}),this.Se.capture(x,{$set:t||{},$set_once:i||{}}),null===(r=this.Se._emitter)||void 0===r||r.emit("user:properties_set",{properties:t}),this.We=s)}}resetUser(t){var i;this.Se.sessionManager.resetSessionId(),this.Se.userManager.reset(t),this.He=null,this.We=null,null===(i=this.Se._emitter)||void 0===i||i.emit("user:reset")}alias(t,i){var e;if(t&&!Yn(t)){var r=this.Se.userManager,n=null!==(e=null!=i?i:r.getDistinctId())&&void 0!==e?e:r.getAnonymousId();n&&!Yn(n)?t!==n?this.Se.capture(w,{$original_id:n,$alias_id:t}):this.identify(t):at().warn("alias","invalid original distinct ID")}else at().warn("alias","invalid alias")}getUserIdentity(){return this.Se.userManager.getUserIdentity()}getDeviceId(){return this.Se.userManager.getDeviceId()}getUserState(){return this.Se.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.Se.userManager.getDistinctId())&&void 0!==t?t:this.Se.userManager.getAnonymousId()}getAnonymousId(){return this.Se.userManager.getAnonymousId()}}var is="_vtilt_consent";class es{constructor(t){this.Ve={},this.Ge=!1,this.Se=t,this.Ke()}setConsent(t){var i;this.Ve=e({},this.Ve,t),this.Ge=!0,this.Je(),null===(i=this.Se._emitter)||void 0===i||i.emit("consent:updated",{consent:this.Ve})}getConsent(){return e({},this.Ve)}hasConsent(){return this.Ge}setDefaultGranted(){this.Ge||(this.Ve={analytics:!0,marketing:!0,advertising:!0},this.Ge=!0)}getConsentProperties(){var t={};return void 0!==this.Ve.analytics&&(t.$consent_analytics=this.Ve.analytics),void 0!==this.Ve.marketing&&(t.$consent_marketing=this.Ve.marketing),void 0!==this.Ve.advertising&&(t.$consent_advertising=this.Ve.advertising),t}reset(){this.Ve={},this.Ge=!1,this.Xe()}Ke(){if(void 0!==F&&(null==F?void 0:F.cookie)){var t=is+"=";for(var i of F.cookie.split(";")){var e=i.trim();if(e.startsWith(t)){try{var r=decodeURIComponent(e.slice(15)),n=JSON.parse(r);n&&"object"==typeof n&&(this.Ve=n,this.Ge=!0)}catch(t){}return}}}}Je(){if(void 0!==F){var t=encodeURIComponent(JSON.stringify(this.Ve)),i="undefined"!=typeof location&&"https:"===location.protocol?"; Secure":"";F.cookie=is+"="+t+"; Max-Age=31536000; path=/; SameSite=Lax"+i}}Xe(){void 0!==F&&(F.cookie=is+"=; Max-Age=0; path=/")}}class rs{constructor(t){this.Ze=new Map,this.Qe=new Map,this.Se=t}register(t){this.Ze.set(t.name,t)}createInstances(){var t=this,i=this.Se.getConfig(),e=function(e,r){return t.Qe.has(e)||t.Ye(i,r)?0:void ut(()=>{var n=r.FeatureClass.extractConfig(i),s=new r.FeatureClass(t.Se,n);t.Qe.set(e,s)})};for(var[r,n]of this.Ze)e(r,n)}initAll(){this.createInstances();var t=function(t){ut(()=>{t.isStarted||t.startIfEnabled()})};for(var[,i]of this.Qe)t(i)}notifyAll(t){var i=function(i){i.onConfigUpdate&&ut(()=>i.onConfigUpdate(t))};for(var[,e]of this.Qe)i(e)}get(t){return this.Qe.get(t)}set(t,i){this.Qe.set(t,i)}getDescriptors(){return this.Ze}Ye(t,i){if(i.disableKey&&!0===t[i.disableKey])return!0;if(i.configKey){var e=t[i.configKey];if(e&&"object"==typeof e&&!1===e.enabled)return!0}return!1}}class ns{constructor(t){this.le=new Sn,this.tr=!1,this.ir=!1,this.Se=t,this.er(),this.tr||(this.rr=setTimeout(()=>this.forceFlush(),5e3))}push(t){this.tr?this.nr(t):this.le.enqueue(t)}markConfigReady(){this.ir||(this.ir=!0,this.sr())}forceFlush(){this.ar(),this.Y(),this.tr=!0}er(){this.tr=this.ir}sr(){this.er(),this.tr&&(this.ar(),this.Y())}Y(){var t=this.le.takeAll();for(var i of t)this.nr(i);t.length>0&&this.Se.requestQueue.flush()}nr(t){if(this.ir){if(this.lr(t.name))return}else this.ur(t.event);this.Se.sendRequest(t.url,t.event)}lr(t){var i=this.Se.getConfig();switch(t){case m:return!1===i.capture_pageview;case y:return!1===i.capture_pageleave;case k:return!1===i.capture_performance;case S:case C:return!1===i.autocapture;default:return!1}}ur(t){"object"==typeof t.payload&&null!==t.payload&&(t.payload.$config_pending=!0)}ar(){void 0!==this.rr&&(clearTimeout(this.rr),this.rr=void 0)}}var ss="vt";class os{constructor(t){void 0===t&&(t={}),this.version=r,this.__loaded=!1,this.hr=!1,this.dr=!1,this.vr=[],this.cr=!1,at().debug("ctor","start"),this._emitter=new ct,this.configManager=new G(t);var i=this.configManager.getConfig();lt(i),this.sessionManager=new zt(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new ue(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.rateLimiter=new zn({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.pr.captureInternal(E,{$$client_ingestion_warning_message:t})}}),this.retryQueue=new Bn({sendRequest:t=>this.gr(t),sendBeacon:t=>this.br(t)}),this.requestQueue=new Dn(t=>this.mr(t),{flush_interval_ms:3e3}),this.consentManager=new es(this),this.pr=new Zn(this),this.yr=new ts(this),this._r=new rs(this),this.wr=new Nn(this),this.kr(),this.wr.onLoad(t=>{this._emitter.emit(gt,{config:t})}),this.Sr(),at().debug("ctor","boot gate installed")}kr(){this._r.register({name:"HistoryAutocapture",configKey:"capture_pageview",FeatureClass:be}),this._r.register({name:"Autocapture",configKey:"autocapture",FeatureClass:ar}),this._r.register({name:"WebVitals",configKey:"capture_performance",FeatureClass:pe}),this._r.register({name:"SessionRecording",configKey:"session_recording",disableKey:"disable_session_recording",remoteConfig:{key:"sessionRecording",map:t=>({enabled:t.enabled,sampleRate:t.sampleRate,minimumDurationMs:t.minimumDurationMs,fullSnapshotIntervalMs:t.fullSnapshotIntervalMs,maskAllInputs:t.maskAllInputs,captureConsole:t.captureConsole,captureCanvas:t.captureCanvas})},FeatureClass:ur}),this._r.register({name:"Chat",configKey:"chat",disableKey:"disable_chat",remoteConfig:{key:"chat",map:t=>({enabled:t.enabled,position:t.widgetPosition,color:t.widgetColor})},FeatureClass:sn}),this._r.register({name:"GoogleTagGateway",configKey:"google_tag",disableKey:"disable_google_tag",remoteConfig:{key:"googleTag",map:t=>t},FeatureClass:Mn})}Sr(){var t=this,i=function(i){var e=t[i];t[i]=function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];if(t.dr)return e.apply(t,n);t.vr.push([i,...n])}};for(var e of os.BOOT_GATED_METHODS)i(e)}Cr(){if(!this.dr){for(var t of(this.dr=!0,at().debug("boot","start"),os.BOOT_GATED_METHODS))delete this[t];at().debug("boot","gate removed"),this.__loaded&&!this.cr?(at().debug("boot","running _runPostBootInit"),this.Mr()):at().debug("boot","skipping _runPostBootInit","loaded?",this.__loaded,"postBootDone?",this.cr),at().debug("boot","flush pendingCalls",this.vr.length),this._execute_array(this.vr),this.vr=[]}}init(t,i,e){var r;if(e&&e!==ss){var n=null!==(r=us[e])&&void 0!==r?r:new os;return n._init(t,i,e),us[e]=n,us[ss][e]=n,n}return this._init(t,i,e)}_init(t,i,r){if(void 0===i&&(i={}),this.__loaded)return at().warn("init","already initialized; re-initializing is a no-op"),this;this.configManager.updateConfig(e({},i,{token:t||i.token,name:r}));var n=this.configManager.getConfig();return lt(n),this.__loaded=!0,at().debug("init","start","token present?",!!n.token,"name",null!=r?r:"vt"),this._r.createInstances(),this.dr||void 0===F||"interactive"!==F.readyState&&"complete"!==F.readyState||(at().debug("init","self-boot?",F.readyState),this.Cr()),this.dr&&!this.cr&&this.Mr(),at().debug("init","postBootInitDone",this.cr),this}Mr(){if(!this.cr){this.cr=!0,at().debug("postBoot","start");var t=this.configManager.getConfig();this.sessionManager=new zt(t.storage||"cookie",t.cross_subdomain_cookie),this.sessionManager.hydrateFromStorage(),at().debug("postBoot","sessionManager hydrated");var i=t.persistence||"localStorage+cookie";this.userManager.updateStorageMethod(i,t.cross_subdomain_cookie),this.userManager.hydrateFromStorage(),at().debug("postBoot","userManager hydrated"),t.require_consent||this.consentManager.hasConsent()||this.consentManager.setDefaultGranted(),!0===this.consentManager.getConsent().advertising&&Xt(),this._emitter.on("consent:updated",t=>{var i=t.consent;!0===i.advertising?Xt():!1===i.advertising&&void 0!==F&&(F.cookie=Vt+"=; Max-Age=0; path=/",F.cookie=Gt+"=; Max-Age=0; path=/")}),this.Ar(),this.userManager.set_initial_person_info(t.mask_personal_data_properties,t.custom_personal_data_properties),this.$r=new ns({sendRequest:(t,i)=>this.sendRequest(t,i),requestQueue:this.requestQueue,getConfig:()=>this.configManager.getConfig()}),this._r.initAll(),at().debug("postBoot","features inited"),this.wr.load(),this.Er(),this.Rr();var e=this.configManager.getConfig();!1!==e.capture_pageview&&this.pr.captureInitialPageview(),this._r.notifyAll(e),this._emitter.emit(ft,{config:e}),at().debug("postBoot","done"),at().info("init","SDK ready")}}startAutocapture(){var t=this._r.get("Autocapture");if(!t){var i=ar.extractConfig(this.configManager.getConfig());t=new ar(this,i),this._r.set("Autocapture",t)}t.updateConfig({enabled:!0})}stopAutocapture(){var t=this._r.get("Autocapture");t&&t.updateConfig({enabled:!1})}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this._r.get("Autocapture"))||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}getAutocaptureDiagnostics(){var t,i;return null!==(i=null===(t=this._r.get("Autocapture"))||void 0===t?void 0:t.getDiagnostics())&&void 0!==i?i:null}startSessionRecording(){var t=this._r.get("SessionRecording");t||(t=new ur(this),this._r.set("SessionRecording",t)),t.updateConfig({enabled:!0}),t.startIfEnabledOrStop("recording_initialized"),this._emitter.emit(yt)}stopSessionRecording(){var t;null===(t=this._r.get("SessionRecording"))||void 0===t||t.stop(),this._emitter.emit(_t)}isRecordingActive(){var t;return"active"===(null===(t=this._r.get("SessionRecording"))||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this._r.get("SessionRecording"))||void 0===t?void 0:t.sessionId)||null}openChat(){var t=this._r.get("Chat");t?t.open():at().warn("chat","openChat: feature not available")}closeChat(){var t=this._r.get("Chat");t?t.close():at().warn("chat","closeChat: feature not available")}toggleChat(){var t=this._r.get("Chat");t?t.toggle():at().warn("chat","toggleChat: feature not available")}showChat(){var t=this._r.get("Chat");t?t.show():at().warn("chat","showChat: feature not available")}hideChat(){var t=this._r.get("Chat");t?t.hide():at().warn("chat","hideChat: feature not available")}sendChatMessage(t,i){var e=this._r.get("Chat");return e?e.sendMessage(t,i):(at().warn("chat","sendChatMessage: feature not available"),Promise.resolve())}gtag(){for(var t=this._r.get("GoogleTagGateway"),i=arguments.length,e=new Array(i),r=0;r<i;r++)e[r]=arguments[r];t?t.gtag(...e):this.vr.push(["gtag",...e])}setGoogleUserData(t){var i=this._r.get("GoogleTagGateway");return i?i.setUserData(t):Promise.resolve()}get featureManager(){return this._r}on(t,i){return this._emitter.on(t,i)}once(t,i){return this._emitter.once(t,i)}off(t){this._emitter.off(t)}_is_bot(){var t,i=this.getConfig();return!i.opt_out_useragent_filter&&Hn(N,null!==(t=i.custom_blocked_useragents)&&void 0!==t?t:[])}capture(t,i,e){this.pr.capture(t,i,e),this._emitter.emit(mt,{event:t,payload:i})}tryCapturePageleave(t){var i,e=null===(i=this._r.get("Autocapture"))||void 0===i?void 0:i.getMaxScrollDepthPctForPageleave(),r=null!=e?{[D]:e}:void 0;this.pr.tryCapturePageleave(t,r)}identify(t,i,e){this.yr.identify(t,i,e)}setUserProperties(t,i){this.yr.setUserProperties(t,i)}resetUser(t){this.yr.resetUser(t)}alias(t,i){this.yr.alias(t,i)}setConsent(t){this.consentManager.setConsent(t)}getConsent(){return this.consentManager.getConsent()}getUserIdentity(){return this.yr.getUserIdentity()}getDeviceId(){return this.yr.getDeviceId()}getUserState(){return this.yr.getUserState()}getConfig(){return this.configManager.getConfig()}getRemoteConfig(){return this.wr.config}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.yr.getDistinctId()}getAnonymousId(){return this.yr.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:ss;return i!==ss&&(i="vt."+i),i}updateConfig(t){var i,e=this.configManager.getConfig();this.configManager.updateConfig(t);var r=this.configManager.getConfig();!e.__remote_config_loaded&&r.__remote_config_loaded&&(null===(i=this.$r)||void 0===i||i.markConfigReady()),this._r.notifyAll(r),this._emitter.emit(pt,{config:r})}buildUrl(){return this.buildEndpointUrl("/api/e")}buildEndpointUrl(t){return dt(this.configManager.getConfig(),t)}sendRequest(t,i){this.Tr()&&this.requestQueue.enqueue({url:t,event:i})}bufferEvent(t,i,e){t!==M&&t!==A?this.$r.push({name:t,url:i,event:e}):this.sendRequest(i,e)}Tr(){return!!this.configManager.getConfig().token||(this.hr||(at().warn("config","token is required for tracking"),this.hr=!0),!1)}mr(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.br(t)}gr(t){return new Promise(i=>{var{url:e,events:r}=t,n=this.configManager.getConfig(),s=1===r.length?r[0]:{events:r},o=n.disable_compression?En.None:En.GZipJS;Un({url:e,data:s,method:"POST",transport:"XHR",compression:o,projectToken:n.token,callback:t=>i({statusCode:t.statusCode})})})}br(t){var{url:i,events:e}=t,r=this.configManager.getConfig(),n=1===e.length?e[0]:{events:e},s=r.disable_compression?En.None:En.GZipJS;Un({url:i,data:n,method:"POST",transport:"sendBeacon",compression:s,projectToken:r.token})}Ir(t){this.sendRequest(t.url,t.event)}Er(){if(j){var t=()=>{this.$r.forceFlush(),this.requestQueue.unload(),this.retryQueue.unload()};Tt(j,"beforeunload",t),Tt(j,"pagehide",()=>{this.pr.tryCapturePageleave("pagehide"),t()}),F&&Tt(F,"visibilitychange",()=>{F&&("hidden"===F.visibilityState?this.pr.tryCapturePageleave("visibility_hidden"):"visible"===F.visibilityState&&this.pr.resetPageleaveDedupe())})}}Rr(){this.requestQueue.enable()}Ar(){ut(()=>{var t,i;if(void 0!==q&&q.search){var e=new URL(q.href),r=e.searchParams.get("vt"),n=e.searchParams.get("vtd");if((null==r?void 0:r.trim())&&(this.pr.setVtPersonId(r.trim()),e.searchParams.delete("vt")),(null==n?void 0:n.trim())&&(this.Pr(n.trim()),e.searchParams.delete("vtd")),(null==r?void 0:r.trim())||(null==n?void 0:n.trim())){var s=e.pathname+(e.search||"")+e.hash;null===(i=null===(t=null==j?void 0:j.history)||void 0===t?void 0:t.replaceState)||void 0===i||i.call(t,{},"",s)}}})}Pr(t){this.vtdOverlay||(this.vtdOverlay=new $n(this),this.vtdOverlay.setDestinationUrl(t))}_execute_array(t){Z(t)&&t.forEach(t=>{if(t&&Z(t)&&t.length>0){var i=t[0],e=t.slice(1);"function"==typeof this[i]&&ut(()=>this[i](...e))}})}_dom_loaded(){this.Rr()}}os.BOOT_GATED_METHODS=["capture","identify","setUserProperties","resetUser","alias","setConsent","startAutocapture","stopAutocapture","startSessionRecording","stopSessionRecording","openChat","closeChat","toggleChat","showChat","hideChat","sendChatMessage"];var as,ls,us={},hs=function(){function t(){if(!t.done){t.done=!0,at().debug("dom","handler fired");var i=Object.keys(us);at().debug("boot","instance count",i.length),Rt(us,(t,i)=>{at().debug("boot","instance",i),t.Cr(),t._dom_loaded()})}}if(F&&"function"==typeof F.addEventListener)return at().debug("dom","readyState",F.readyState),void("complete"===F.readyState||"interactive"===F.readyState?(at().debug("dom","running handler sync"),t()):(at().debug("dom","registered DOMContentLoaded listener"),Tt(F,"DOMContentLoaded",t,{capture:!1})));j&&at().error("dom","browser doesn't support document.addEventListener")};"undefined"!=typeof window&&window.vt&&Array.isArray(window.vt)&&(as=us[ss]=new os,(ls=V.vt)&&Rt(ls._i,function(t){if(t&&Z(t)){var i=as.init(t[0],t[1],t[2]),e=ls[t[2]||"vt"]||ls;i&&i._execute_array(e)}}),V.vt=as,hs());var ds=function(){var t=us[ss]=new os;return hs(),t}();exports.ALL_WEB_VITALS_METRICS=["LCP","CLS","FCP","INP","TTFB"],exports.DEFAULT_WEB_VITALS_METRICS=he,exports.VTilt=os,exports.default=ds,exports.vt=ds;
|
|
2
2
|
//# sourceMappingURL=main.js.map
|