@v-tilt/browser 1.11.0 → 1.13.0

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.
Files changed (90) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.js +1 -1
  4. package/dist/array.full.js.map +1 -1
  5. package/dist/array.js +1 -1
  6. package/dist/array.js.map +1 -1
  7. package/dist/array.no-external.js +1 -1
  8. package/dist/array.no-external.js.map +1 -1
  9. package/dist/autocapture-types.d.ts +17 -0
  10. package/dist/autocapture-utils.d.ts +24 -1
  11. package/dist/autocapture.d.ts +94 -5
  12. package/dist/chat.js +1 -1
  13. package/dist/chat.js.map +1 -1
  14. package/dist/config.d.ts +8 -1
  15. package/dist/constants.d.ts +19 -13
  16. package/dist/core/capture.d.ts +15 -5
  17. package/dist/core/config-utils.d.ts +15 -0
  18. package/dist/core/consent.d.ts +62 -0
  19. package/dist/core/event-buffer.d.ts +60 -0
  20. package/dist/core/fb-cookies.d.ts +32 -0
  21. package/dist/core/feature-manager.d.ts +61 -69
  22. package/dist/core/fifo-queue.d.ts +23 -0
  23. package/dist/core/identity.d.ts +23 -33
  24. package/dist/core/index.d.ts +7 -1
  25. package/dist/core/page-lifecycle.d.ts +41 -0
  26. package/dist/core/remote-config.d.ts +14 -17
  27. package/dist/extensions/chat/bubble-drag.d.ts +30 -0
  28. package/dist/extensions/chat/chat-api.d.ts +15 -0
  29. package/dist/extensions/chat/chat-styles.d.ts +27 -0
  30. package/dist/extensions/chat/chat-wrapper.d.ts +20 -145
  31. package/dist/extensions/chat/chat.d.ts +261 -14
  32. package/dist/extensions/chat/message-content-styles.d.ts +1 -0
  33. package/dist/extensions/chat/message-html.d.ts +6 -0
  34. package/dist/extensions/chat/message-markdown.d.ts +8 -0
  35. package/dist/extensions/chat/normalize-send-content.d.ts +24 -0
  36. package/dist/extensions/chat/types.d.ts +19 -57
  37. package/dist/extensions/chat/widget-registry.d.ts +53 -0
  38. package/dist/extensions/chat/widgets/collect-email.d.ts +6 -0
  39. package/dist/extensions/chat/widgets/escalate-to-human.d.ts +6 -0
  40. package/dist/extensions/ga4-proxy.d.ts +59 -0
  41. package/dist/extensions/google-tag-gateway/consent-bridge.d.ts +27 -0
  42. package/dist/extensions/google-tag-gateway/enhanced-conversions.d.ts +35 -0
  43. package/dist/extensions/google-tag-gateway/event-bridge.d.ts +74 -0
  44. package/dist/extensions/google-tag-gateway/google-tag-gateway.d.ts +95 -0
  45. package/dist/extensions/google-tag-gateway/gtag-loader.d.ts +85 -0
  46. package/dist/extensions/google-tag-gateway/index.d.ts +7 -0
  47. package/dist/extensions/google-tag-gateway/normalize.d.ts +28 -0
  48. package/dist/extensions/google-tag-gateway/public-api.d.ts +23 -0
  49. package/dist/extensions/history-autocapture.d.ts +2 -2
  50. package/dist/extensions/replay/index.d.ts +1 -1
  51. package/dist/extensions/replay/session-recording-utils.d.ts +13 -43
  52. package/dist/extensions/replay/session-recording-wrapper.d.ts +10 -66
  53. package/dist/extensions/replay/session-recording.d.ts +53 -1
  54. package/dist/extensions/replay/types.d.ts +6 -1
  55. package/dist/extensions/web-vitals/web-vitals-manager.d.ts +14 -43
  56. package/dist/external-scripts-loader.js +1 -1
  57. package/dist/external-scripts-loader.js.map +1 -1
  58. package/dist/feature.d.ts +54 -172
  59. package/dist/main.js +1 -1
  60. package/dist/main.js.map +1 -1
  61. package/dist/module.d.ts +728 -753
  62. package/dist/module.js +1 -1
  63. package/dist/module.js.map +1 -1
  64. package/dist/module.no-external.d.ts +728 -753
  65. package/dist/module.no-external.js +1 -1
  66. package/dist/module.no-external.js.map +1 -1
  67. package/dist/rate-limiter.d.ts +0 -1
  68. package/dist/recorder.js +1 -1
  69. package/dist/recorder.js.map +1 -1
  70. package/dist/request.d.ts +34 -20
  71. package/dist/scroll-depth-tracker.d.ts +42 -0
  72. package/dist/server.d.ts +114 -0
  73. package/dist/server.js +1 -1
  74. package/dist/server.js.map +1 -1
  75. package/dist/session.d.ts +12 -0
  76. package/dist/types.d.ts +204 -9
  77. package/dist/user-manager.d.ts +26 -52
  78. package/dist/utils/base64.d.ts +30 -0
  79. package/dist/utils/bot-detection.d.ts +28 -0
  80. package/dist/utils/endpoint-url.d.ts +36 -0
  81. package/dist/utils/event-emitter.d.ts +1 -0
  82. package/dist/utils/globals.d.ts +71 -2
  83. package/dist/utils/index.d.ts +20 -5
  84. package/dist/utils/logger.d.ts +66 -0
  85. package/dist/utils/request-utils.d.ts +5 -0
  86. package/dist/utils/safewrap.d.ts +6 -1
  87. package/dist/utils/transport-health.d.ts +55 -0
  88. package/dist/vtilt.d.ts +85 -25
  89. package/dist/web-vitals.js.map +1 -1
  90. package/package.json +71 -66
package/dist/main.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";function t(t,i,e,n,r,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(n,r)}function i(i){return function(){var e=this,n=arguments;return new Promise(function(r,s){var o=i.apply(e,n);function a(i){t(o,r,s,a,l,"next",i)}function l(i){t(o,r,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 n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},e.apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0});var n="1.11.0",r="__vt_session",s="__vt_window_id",o="__vt_primary_window",a="__vt_user_state",l="__vt_device_id",h="__vt_anonymous_id",u="__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="undefined"!=typeof window?window:void 0,y="undefined"!=typeof globalThis?globalThis:b,w=null==y?void 0:y.navigator,_=null==y?void 0:y.document,x=null==y?void 0:y.location,k=null==y?void 0:y.fetch;b&&_&&_.createElement;var S=null==y?void 0:y.XMLHttpRequest;null==y||y.AbortController;var C=null==w?void 0:w.userAgent,E=null!=b?b:{};class T{constructor(t){void 0===t&&(t={}),this.config=this.parseConfigFromScript(t)}parseConfigFromScript(t){if(!(null==_?void 0:_.currentScript))return e({token:t.token||""},t);var i=_.currentScript,n=e({token:""},t);n.api_host=i.getAttribute("data-api-host")||i.getAttribute("data-host")||t.api_host,n.script_host=i.getAttribute("data-script-host")||t.script_host,n.proxy=i.getAttribute("data-proxy")||t.proxy,n.proxyUrl=i.getAttribute("data-proxy-url")||t.proxyUrl,n.token=i.getAttribute("data-token")||t.token||"",n.domain=i.getAttribute("data-domain")||t.domain,n.storage=i.getAttribute("data-storage")||t.storage,n.stringifyPayload="false"!==i.getAttribute("data-stringify-payload");var r="true"===i.getAttribute("data-capture-performance");if(n.capture_performance=!!r||t.capture_performance,n.proxy&&n.proxyUrl)throw console.error("Error: Both data-proxy and data-proxy-url are specified. Please use only one of them."),new Error("Both data-proxy and data-proxy-url are specified. Please use only one of them.");for(var s of(n.globalAttributes=e({},t.globalAttributes),Array.from(i.attributes)))s.name.startsWith("data-vt-")&&(n.globalAttributes[s.name.slice(8).replace(/-/g,"_")]=s.value);return n}getConfig(){return e({},this.config)}updateConfig(t){this.config=e({},this.config,t)}}function I(t,i){try{return t()}catch(t){return i}}class M{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,n;null===(e=this.o.get(t))||void 0===e||e.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in event listener for "'+t+'":',i)}});var r=this.m.get(t);r&&(r.forEach(e=>{try{e(i)}catch(i){console.error('[vTilt] Error in once listener for "'+t+'":',i)}}),this.m.delete(t)),null===(n=this.o.get("*"))||void 0===n||n.forEach(e=>{try{e({event:t,payload:i})}catch(t){console.error("[vTilt] 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,n,r;return(null!==(e=null===(i=this.o.get(t))||void 0===i?void 0:i.size)&&void 0!==e?e:0)+(null!==(r=null===(n=this.m.get(t))||void 0===n?void 0:n.size)&&void 0!==r?r:0)}hasListeners(t){return this.listenerCount(t)>0}}var R="sdk:initialized",A="sdk:config_updated",O="sdk:remote_config_loaded",P="feature:started",L="feature:stopped",U="event:captured",D="recording:started",z="recording:stopped",B="23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function j(t){for(var i=(2<<31-Math.clz32(57))-1,e=Math.ceil(1.6*i*t/57),n="";n.length<t;)for(var r=crypto.getRandomValues(new Uint8Array(e)),s=0;s<e&&n.length<t;s++){var o=r[s]&i;o<57&&(n+=B[o])}return n}function N(t){return!(!t||"string"!=typeof t)&&!(t.length<2||t.length>10240)}function F(t,i,e){if(t)if(Array.isArray(t))t.forEach((t,n)=>{i.call(e,t,n)});else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&i.call(e,t[n],n)}function q(t,i,e,n){var{capture:r=!1,passive:s=!0}=null!=n?n:{};null==t||t.addEventListener(i,e,{capture:r,passive:s})}function V(t,i){if(!i)return t;for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}function W(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];for(var r of e)for(var s of r)t.push(s);return t}var H=[h,l,d,a],J=31536e3,X=["herokuapp.com","vercel.app","netlify.app"];function K(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 n=e.match(/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i);return n?"."+n[0]:""}class G{constructor(t){var i,e,n;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!X.includes(e)}(),this.sameSite=null!==(e=t.sameSite)&&void 0!==e?e:"Lax",this.secure=null!==(n=t.secure)&&void 0!==n?n:"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||console.warn("[vTilt] localStorage unavailable, using cookies"),i}catch(t){return this.k=!1,console.warn("[vTilt] localStorage unavailable, using cookies"),!1}}isCriticalProperty(t){return H.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 console.warn('[vTilt] 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:J)}}catch(i){console.warn('[vTilt] 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){console.warn('[vTilt] 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 e}return this.getLocalStorage(t)}setLocalStoragePlusCookie(t,i,e){this.setLocalStorage(t,i),this.isCriticalProperty(t)&&this.setCookie(t,i,null!=e?e:J)}removeLocalStoragePlusCookie(t){this.removeLocalStorage(t),this.isCriticalProperty(t)&&this.removeCookie(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){console.warn("[vTilt] 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){console.warn("[vTilt] 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 n=e.trim();if(n.startsWith(i))try{return decodeURIComponent(n.slice(i.length))}catch(t){return n.slice(i.length)}}return null}setCookie(t,i,e){if("undefined"!=typeof document){var n=K(this.cross_subdomain),r=t+"="+encodeURIComponent(i)+"; Max-Age="+e+"; path=/; SameSite="+this.sameSite;this.secure&&(r+="; Secure"),n&&(r+="; domain="+n),document.cookie=r}}removeCookie(t){if("undefined"!=typeof document){var i=K(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,n){var r=e({value:i},n?{expiry:Date.now()+n}:{});this.set(t,JSON.stringify(r))}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 Z{constructor(t,i){void 0===t&&(t="cookie"),this.storage=new G({method:t,cross_subdomain:i,sameSite:"Lax"}),this.S=void 0,this.C()}getSessionId(){var t=this.T();return t||(t=j(16),this.$(t)),t}setSessionId(){var t=this.T()||j(16);return this.$(t),t}resetSessionId(){this.I(),this.setSessionId(),this.M(j(16))}T(){return this.storage.get(r)}$(t){this.storage.set(r,t,1800)}I(){this.storage.remove(r)}getWindowId(){if(this.S)return this.S;var t=this.storage.getSessionStorage();if(t){var i=t.getItem(s);if(i)return this.S=i,i}var e=j(16);return this.M(e),e}M(t){if(t!==this.S){this.S=t;var i=this.storage.getSessionStorage();i&&i.setItem(s,t)}}C(){var t=this.storage.getSessionStorage();if(t){var i=t.getItem(o),e=t.getItem(s);e&&!i?this.S=e:(e&&t.removeItem(s),this.M(j(16))),t.setItem(o,"true"),this.R()}else this.S=j(16)}R(){var t=this.storage.getSessionStorage();b&&t&&q(b,"beforeunload",()=>{var t=this.storage.getSessionStorage();t&&t.removeItem(o)},{capture:!1})}updateStorageMethod(t,i){this.storage=new G({method:t,cross_subdomain:i,sameSite:"Lax"})}}function Q(t){if(!_)return null;var i=_.createElement("a");return i.href=t,i}function Y(t,i){for(var e=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<e.length;n++){var r=e[n].split("=");if(r[0]===i){if(r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(t){}return s.replace(/\+/g," ")}}return""}function tt(t,i,e){if(!t||!i||!i.length)return t;for(var n=t.split("#"),r=n[0]||"",s=n[1],o=r.split("?"),a=o[1],l=o[0],h=(a||"").split("&"),u=[],d=0;d<h.length;d++){var v=h[d].split("="),c=v[0],f=v.slice(1).join("=");-1!==i.indexOf(c)?u.push(c+"="+e):c&&u.push(c+(f?"="+f:""))}var p=u.join("&");return l+(p?"?"+p:"")+(s?"#"+s:"")}function it(t){return"function"==typeof t}var et="Mobile",nt="iOS",rt="Android",st="Tablet",ot=rt+" "+st,at="iPad",lt="Apple",ht=lt+" Watch",ut="Safari",dt="BlackBerry",vt="Samsung",ct=vt+"Browser",ft=vt+" Internet",pt="Chrome",gt=pt+" OS",mt=pt+" "+nt,bt="Internet Explorer",yt=bt+" "+et,wt="Opera",_t=wt+" Mini",xt="Edge",kt="Microsoft "+xt,St="Firefox",Ct=St+" "+nt,Et="Nintendo",Tt="PlayStation",$t="Xbox",It=rt+" "+et,Mt=et+" "+ut,Rt="Windows",At=Rt+" Phone",Ot="Nokia",Pt="Ouya",Lt="Generic",Ut=Lt+" "+et.toLowerCase(),Dt=Lt+" "+st.toLowerCase(),zt="Konqueror",Bt="(\\d+(\\.\\d+)?)",jt=new RegExp("Version/"+Bt),Nt=new RegExp($t,"i"),Ft=new RegExp(Tt+" \\w+","i"),qt=new RegExp(Et+" \\w+","i"),Vt=new RegExp(dt+"|PlayBook|BB10","i"),Wt={"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 Ht(t,i){return t.toLowerCase().includes(i.toLowerCase())}var Jt=(t,i)=>i&&Ht(i,lt)||function(t){return Ht(t,ut)&&!Ht(t,pt)&&!Ht(t,rt)}(t),Xt=function(t,i){return i=i||"",Ht(t," OPR/")&&Ht(t,"Mini")?_t:Ht(t," OPR/")?wt:Vt.test(t)?dt:Ht(t,"IE"+et)||Ht(t,"WPDesktop")?yt:Ht(t,ct)?ft:Ht(t,xt)||Ht(t,"Edg/")?kt:Ht(t,"FBIOS")?"Facebook "+et:Ht(t,"UCWEB")||Ht(t,"UCBrowser")?"UC Browser":Ht(t,"CriOS")?mt:Ht(t,"CrMo")||Ht(t,pt)?pt:Ht(t,rt)&&Ht(t,ut)?It:Ht(t,"FxiOS")?Ct:Ht(t.toLowerCase(),zt.toLowerCase())?zt:Jt(t,i)?Ht(t,et)?Mt:ut:Ht(t,St)?St:Ht(t,"MSIE")||Ht(t,"Trident/")?bt:Ht(t,"Gecko")?St:""},Kt={[yt]:[new RegExp("rv:"+Bt)],[kt]:[new RegExp(xt+"?\\/"+Bt)],[pt]:[new RegExp("("+pt+"|CrMo)\\/"+Bt)],[mt]:[new RegExp("CriOS\\/"+Bt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Bt)],[ut]:[jt],[Mt]:[jt],[wt]:[new RegExp("(Opera|OPR)\\/"+Bt)],[St]:[new RegExp(St+"\\/"+Bt)],[Ct]:[new RegExp("FxiOS\\/"+Bt)],[zt]:[new RegExp("Konqueror[:/]?"+Bt,"i")],[dt]:[new RegExp(dt+" "+Bt),jt],[It]:[new RegExp("android\\s"+Bt,"i")],[ft]:[new RegExp(ct+"\\/"+Bt)],[bt]:[new RegExp("(rv:|MSIE )"+Bt)],Mozilla:[new RegExp("rv:"+Bt)]},Gt=function(t,i){var e=Xt(t,i),n=Kt[e];if(void 0===n)return null;for(var r=0;r<n.length;r++){var s=n[r],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},Zt=[[new RegExp($t+"; "+$t+" (.*?)[);]","i"),t=>[$t,t&&t[1]||""]],[new RegExp(Et,"i"),[Et,""]],[new RegExp(Tt,"i"),[Tt,""]],[Vt,[dt,""]],[new RegExp(Rt,"i"),(t,i)=>{if(/Phone/.test(i)||/WPDesktop/.test(i))return[At,""];if(new RegExp(et).test(i)&&!/IEMobile\b/.test(i))return[Rt+" "+et,""];var e=/Windows NT ([0-9.]+)/i.exec(i);if(e&&e[1]){var n=e[1],r=Wt[n]||"";return/arm/i.test(i)&&(r="RT"),[Rt,r]}return[Rt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[nt,i.join(".")]}return[nt,""]}],[/(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("("+rt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+rt+")","i"),t=>{if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[rt,i.join(".")]}return[rt,""]}],[/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/,[gt,""]],[/Linux|debian/i,["Linux",""]]],Qt=function(t){return qt.test(t)?Et:Ft.test(t)?Tt:Nt.test(t)?$t:new RegExp(Pt,"i").test(t)?Pt:new RegExp("("+At+"|WPDesktop)","i").test(t)?At:/iPad/.test(t)?at:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ht:Vt.test(t)?dt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ot,"i").test(t)?Ot:/(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(et).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)?rt:ot:rt:new RegExp("(pda|"+et+")","i").test(t)?Ut:new RegExp(st,"i").test(t)&&!new RegExp(st+" pc","i").test(t)?Dt:""},Yt="https?://(.*)",ti=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ii=W(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ti),ei="<masked>";function ni(t){var i=function(t){return t?0===t.search(Yt+"google.([^/?]*)")?"google":0===t.search(Yt+"bing.com")?"bing":0===t.search(Yt+"yahoo.com")?"yahoo":0===t.search(Yt+"duckduckgo.com")?"duckduckgo":null:null}(t),e="yahoo"!==i?"q":"p",n={};if(null!==i){n.$search_engine=i;var r=_?Y(_.referrer,e):"";r.length&&(n.ph_keyword=r)}return n}function ri(){if("undefined"!=typeof navigator)return navigator.language||navigator.userLanguage}function si(){return(null==_?void 0:_.referrer)||"$direct"}function oi(){var t;return(null==_?void 0:_.referrer)&&(null===(t=Q(_.referrer))||void 0===t?void 0:t.host)||"$direct"}function ai(t){var i,{r:e,u:n}=t,r={$referrer:e,$referring_domain:null==e?void 0:"$direct"===e?"$direct":null===(i=Q(e))||void 0===i?void 0:i.host};if(n){r.$current_url=n;var s=Q(n);r.$host=null==s?void 0:s.host,r.$pathname=null==s?void 0:s.pathname;var o=function(t){var i=ii.concat([]),e={};return F(i,function(i){var n=Y(t,i);e[i]=n||null}),e}(n);V(r,o)}e&&V(r,ni(e));return r}function li(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function hi(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function ui(t,i){if(!C)return{};var e,r,s,[o,a]=function(t){for(var i=0;i<Zt.length;i++){var[e,n]=Zt[i],r=e.exec(t),s=r&&(it(n)?n(r,t):n);if(s)return s}return["",""]}(C);return V(function(t){var i={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e];null!=n&&""!==n&&(i[e]=n)}return i}({$os:o,$os_version:a,$browser:Xt(C,navigator.vendor),$device:Qt(C),$device_type:(r=C,s=Qt(r),s===at||s===ot||"Kobo"===s||"Kindle Fire"===s||s===Dt?st:s===Et||s===$t||s===Tt||s===Pt?"Console":s===ht?"Wearable":s?et:"Desktop"),$timezone:li(),$timezone_offset:hi()}),{$current_url:tt(null==x?void 0:x.href,[],ei),$host:null==x?void 0:x.host,$pathname:null==x?void 0:x.pathname,$raw_user_agent:C.length>1e3?C.substring(0,997)+"...":C,$browser_version:Gt(C,navigator.vendor),$browser_language:ri(),$browser_language_prefix:(e=ri(),"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:n,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}class di{constructor(t,i){void 0===t&&(t="localStorage"),this.A=null,this.storage=new G({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}getUserIdentity(){return e({},this.userIdentity)}getDistinctId(){return this.userIdentity.distinct_id}getAnonymousId(){return this.userIdentity.anonymous_id||(this.userIdentity.anonymous_id=this.generateAnonymousId(),this.storage.set(h,this.userIdentity.anonymous_id,J)),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}identify(t,i,n){if("number"==typeof t&&(t=t.toString(),console.warn("The first argument to vTilt.identify was a number, but it should be a string. It has been converted to a string.")),t)if(this.isDistinctIdStringLike(t))console.error('The string "'+t+'" was set in vTilt.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if("COOKIELESS_SENTINEL_VALUE"!==t){var r=this.userIdentity.distinct_id;if(this.userIdentity.distinct_id=t,!this.userIdentity.device_id){var s=r||this.userIdentity.anonymous_id;this.userIdentity.device_id=s,this.userIdentity.properties=e({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:s})}t!==r&&(this.userIdentity.distinct_id=t);var o="anonymous"===this.userIdentity.user_state;t!==r&&o?(this.userIdentity.user_state="identified",i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),n&&Object.keys(n).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=n[t])}),this.saveUserIdentity()):i||n?("anonymous"===this.userIdentity.user_state&&(this.userIdentity.user_state="identified"),i&&(this.userIdentity.properties=e({},this.userIdentity.properties,i)),n&&Object.keys(n).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=n[t])}),this.saveUserIdentity()):t!==r&&(this.userIdentity.user_state="identified",this.saveUserIdentity())}else console.error('The string "'+t+'" was set in vTilt.identify which indicates an error. This ID is only used as a sentinel value.');else console.error("Unique user id has not been set in vTilt.identify")}setUserProperties(t,i){if(!t&&!i)return!1;var n=this.userIdentity.distinct_id||this.userIdentity.anonymous_id,r=this.getPersonPropertiesHash(n,t,i);return this.A===r?(console.info("VTilt: A duplicate setUserProperties call was made with the same properties. It has been ignored."),!1):(t&&(this.userIdentity.properties=e({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity(),this.A=r,!0)}reset(t){var i=this.generateAnonymousId(),n=this.userIdentity.device_id,r=t?this.generateDeviceId():n;this.userIdentity={distinct_id:null,anonymous_id:i,device_id:r,properties:{},user_state:"anonymous"},this.A=null,this.saveUserIdentity(),this.userIdentity.properties=e({},this.userIdentity.properties,{$last_vtilt_reset:(new Date).toISOString()}),this.saveUserIdentity()}setDistinctId(t){this.userIdentity.distinct_id=t,this.saveUserIdentity()}setUserState(t){this.userIdentity.user_state=t,this.saveUserIdentity()}updateUserProperties(t,i){t&&(this.userIdentity.properties=e({},this.userIdentity.properties,t)),i&&Object.keys(i).forEach(t=>{t in this.userIdentity.properties||(this.userIdentity.properties[t]=i[t])}),this.saveUserIdentity()}ensureDeviceId(t){this.userIdentity.device_id||(this.userIdentity.device_id=t,this.userIdentity.properties=e({},this.userIdentity.properties,{$had_persisted_distinct_id:!0,$device_id:t}),this.saveUserIdentity())}createAlias(t,i){return this.isValidDistinctId(t)?(void 0===i&&(i=this.getDistinctId()||this.getAnonymousId()),this.isValidDistinctId(i)?t===i?(console.warn("alias matches current distinct_id - should use identify instead"),null):{distinct_id:t,original:i}:(console.warn("Invalid original distinct ID"),null)):(console.warn("Invalid alias provided"),null)}isDistinctIdStringLikePublic(t){return this.isDistinctIdStringLike(t)}set_initial_person_info(t,i){if(!this.getStoredUserProperties()[m]){var e=function(t,i){var e=t?W([],ti,i||[]):[],n=null==x?void 0:x.href.substring(0,1e3);return{r:si().substring(0,1e3),u:n?tt(n,e,ei):void 0}}(t,i);this.register_once({[m]:e},void 0)}}get_initial_props(){var t,i,e=this.getStoredUserProperties()[m];return e?(t=ai(e),i={},F(t,function(t,e){var n;i["$initial_"+(n=String(e),n.startsWith("$")?n.substring(1):n)]=t}),i):{}}update_referrer_info(){var t={$referrer:si(),$referring_domain:oi()};this.register_once(t,void 0)}loadUserIdentity(){var t=this.storage.get(h),i=this.storage.get(l),e=this.storage.get(d),n=this.storage.get(a),r=this.getStoredUserProperties(),s=t||this.generateAnonymousId(),o=i||this.generateDeviceId(),u=e||null,v=n||"anonymous",c=s||this.generateAnonymousId();return t||this.storage.set(h,c,J),i||this.storage.set(l,o,J),n||this.storage.set(a,v,J),{distinct_id:u,anonymous_id:c,device_id:o,properties:r,user_state:v}}saveUserIdentity(){this.storage.set(h,this.userIdentity.anonymous_id,J),this.storage.set(l,this.userIdentity.device_id,J),this.storage.set(a,this.userIdentity.user_state,J),this.userIdentity.distinct_id?this.storage.set(d,this.userIdentity.distinct_id,J):this.storage.remove(d),this.setStoredUserProperties(this.userIdentity.properties)}getStoredUserProperties(){return this.storage.getJSON(v)||{}}setStoredUserProperties(t){this.storage.setJSON(v,t,J)}register_once(t,i){var e=this.getStoredUserProperties(),n=!1;for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(r in e||(e[r]=t[r],n=!0));if(i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(s in e||(e[s]=i[s],n=!0));n&&this.setStoredUserProperties(e)}generateAnonymousId(){return"anon_"+j(16)}generateDeviceId(){return"device_"+j(16)}getPersonPropertiesHash(t,i,e){return JSON.stringify({distinct_id:t,userPropertiesToSet:i,userPropertiesToSetOnce:e})}isValidDistinctId(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return!["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none"].includes(i)&&0!==t.trim().length}isDistinctIdStringLike(t){if(!t||"string"!=typeof t)return!1;var i=t.toLowerCase().trim();return["null","undefined","false","true","anonymous","anon","user","test","guest","visitor","unknown","none","demo","example","sample","placeholder"].includes(i)}updateStorageMethod(t,i){this.storage=new G({method:t,cross_subdomain:i,sameSite:"Lax"}),this.userIdentity=this.loadUserIdentity()}}var vi=["LCP","CLS","FCP","INP"],ci=9e5,fi="[WebVitals]";class pi{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){this.name="WebVitals",this.O=!1,this._instance=t,this.P=this.L(),this.U=pi.extractConfig(t.getConfig())}get isEnabled(){var t=null==x?void 0:x.protocol;return("http:"===t||"https:"===t)&&!0===this.U.web_vitals}get isStarted(){return this.O}startIfEnabled(){if(this.isEnabled&&!this.O&&b){var t=this.D();t?this.B(t):this.j()}}stop(){this.O&&(this.N(),this.F&&(clearTimeout(this.F),this.F=void 0),this.O=!1)}onConfigUpdate(t){var i=pi.extractConfig(t),e=this.isEnabled;this.U=i,e||!this.isEnabled||this.O?e&&!this.isEnabled&&this.O&&this.stop():this.startIfEnabled()}get allowedMetrics(){return this.U.web_vitals_allowed_metrics||vi}get flushTimeoutMs(){return this.U.web_vitals_delayed_flush_ms||5e3}get maxAllowedValue(){var t=this.U.__web_vitals_max_value;return void 0===t?ci:0===t?0:t<6e4?ci:t}L(){return{url:void 0,pathname:void 0,metrics:[],firstMetricTimestamp:void 0}}D(){var t;return null===(t=E.__VTiltExtensions__)||void 0===t?void 0:t.webVitalsCallbacks}j(){var t,i=null===(t=E.__VTiltExtensions__)||void 0===t?void 0:t.loadExternalDependency;i?i(this._instance,"web-vitals",t=>{if(t)console.error(fi+" Failed to load web-vitals:",t);else{var i=this.D();i?this.B(i):console.error(fi+" web-vitals loaded but callbacks not registered")}}):console.warn(fi+" External dependency loader not available. Include web-vitals.ts entrypoint or use array.full.js bundle.")}B(t){if(!this.O){var i=this.allowedMetrics,e=this.q.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),this.O=!0}}V(){var t;return null===(t=null==b?void 0:b.location)||void 0===t?void 0:t.href}W(){return null==x?void 0:x.pathname}q(t){try{if(!b||!_||!x)return;if(!(null==t?void 0:t.name)||void 0===(null==t?void 0:t.value))return void console.warn(fi+" Invalid metric received",t);if(this.maxAllowedValue>0&&t.value>=this.maxAllowedValue&&"CLS"!==t.name)return void console.warn(fi+" Ignoring "+t.name+" with value >= "+this.maxAllowedValue+"ms");var i=this.V(),n=this.W();if(!i)return void console.warn(fi+" Could not determine current URL");this.P.url&&this.P.url!==i&&this.N(),this.P.url||(this.P.url=i,this.P.pathname=n),this.P.firstMetricTimestamp||(this.P.firstMetricTimestamp=Date.now());var r=this.H(t.attribution),s=this._instance.getSessionId(),o=this.J(),a=e({},t,{attribution:r,timestamp:Date.now(),$current_url:i,$session_id:s,$window_id:o}),l=this.P.metrics.findIndex(i=>i.name===t.name);l>=0?this.P.metrics[l]=a:this.P.metrics.push(a),this.X(),this.P.metrics.length>=this.allowedMetrics.length&&this.N()}catch(t){console.error(fi+" Error adding metric to buffer:",t)}}H(t){if(t){var i=e({},t);return"interactionTargetElement"in i&&delete i.interactionTargetElement,i}}J(){var t;try{return(null===(t=this._instance.sessionManager)||void 0===t?void 0:t.getWindowId())||null}catch(t){return null}}X(){this.F&&clearTimeout(this.F),this.F=setTimeout(()=>{this.N()},this.flushTimeoutMs)}N(){if(this.F&&(clearTimeout(this.F),this.F=void 0),0!==this.P.metrics.length){try{var t={$pathname:this.P.pathname,$current_url:this.P.url};for(var i of this.P.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){console.error(fi+" Error flushing metrics:",t)}this.P=this.L()}}}function gi(t,i,e){try{if(!(i in t))return()=>{};var n=t[i],r=e(n);return it(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__vtilt_wrapped__:{enumerable:!1,value:!0}})),t[i]=r,()=>{t[i]=n}}catch(t){return()=>{}}}class mi{constructor(t,i){var e;this.name="HistoryAutocapture",this.O=!1,this._instance=t,this.U=i||mi.extractConfig(t.getConfig()),this.K=(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.U.enabled&&!1!==this._instance.getConfig().capture_pageview}get isStarted(){return this.O}startIfEnabled(){this.isEnabled&&!this.O&&this.G()}stop(){this.O&&(this.Z&&(this.Z(),this.Z=void 0),this.O=!1)}onConfigUpdate(t){this.U=mi.extractConfig(t),this.isEnabled&&!this.O?this.G():!this.isEnabled&&this.O&&this.stop()}G(){b&&x&&(this.K=x.pathname||"",this.Y(),this.tt(),this.O=!0)}Y(){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__)||gi(b.history,"pushState",t=>function(i,n,r){t.call(this,i,n,r),e.it("pushState")}),(null===(i=b.history.replaceState)||void 0===i?void 0:i.__vtilt_wrapped__)||gi(b.history,"replaceState",t=>function(i,n,r){t.call(this,i,n,r),e.it("replaceState")})}}tt(){if(!this.Z&&b){var t=()=>{this.it("popstate")};q(b,"popstate",t),this.Z=()=>{null==b||b.removeEventListener("popstate",t)}}}it(t){this.isEnabled&&this.O&&I(()=>{var i,e=null===(i=null==b?void 0:b.location)||void 0===i?void 0:i.pathname;if(e&&x&&_){if(e!==this.K){var n={navigation_type:t};this._instance.capture("$pageview",n)}this.K=e}})}}var bi=["a","button","form","input","select","textarea","label"],yi="$copy_autocapture",wi=['[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 _i(t){return null==t}function xi(t){return"string"==typeof t}function ki(t){return void 0===t}function Si(t){return t.replace(/^\s+|\s+$/g,"")}function Ci(t,i){return t.indexOf(i)>-1}function Ei(t){return 1===(null==t?void 0:t.nodeType)}function Ti(t){return 3===(null==t?void 0:t.nodeType)}function $i(t,i){var e;return(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())===i}function Ii(t){return 11===(null==t?void 0:t.nodeType)}function Mi(t){return t?Si(t).split(/\s+/):[]}function Ri(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 Mi(i)}function Ai(t){return _i(t)?null:Si(t).split(/(\s+)/).filter(t=>Wi(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Oi(t){var i,e="";if(Ji(t)&&!Xi(t)&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];Ti(r)&&r.textContent&&(e+=null!==(i=Ai(r.textContent))&&void 0!==i?i:"")}return Si(e)}function Pi(t){var i,e="";if(t&&t.childNodes&&t.childNodes.length)for(var n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(r&&"span"===(null===(i=r.tagName)||void 0===i?void 0:i.toLowerCase()))try{e=(e+" "+Oi(r)).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+Pi(r)).trim())}catch(t){}}return e}function Li(t){var i=Oi(t);return Wi(i=(i+" "+Pi(t)).trim())?i:""}function Ui(t){if(t.previousElementSibling)return t.previousElementSibling;var i=t;do{i=i.previousSibling}while(i&&!Ei(i));return i}function Di(t){var i=t.parentNode;return!(!i||!Ei(i))&&i}function zi(t){var i=null==b?void 0:b.location.href;return!!(i&&t&&t.some(t=>i.match(t)))}var Bi="(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})",ji=new RegExp("^(?:"+Bi+")$"),Ni=new RegExp(Bi),Fi="\\d{3}-?\\d{2}-?\\d{4}",qi=new RegExp("^("+Fi+")$"),Vi=new RegExp("("+Fi+")");function Wi(t,i){if(void 0===i&&(i=!0),_i(t))return!1;if(xi(t)){if(t=Si(t),(i?ji:Ni).test((t||"").replace(/[- ]/g,"")))return!1;if((i?qi:Vi).test(t))return!1}return!0}function Hi(t){return!!xi(t)&&("_ngcontent"===t.substring(0,10)||"_nghost"===t.substring(0,7))}function Ji(t){for(var i=t;i&&i.parentNode&&!$i(i,"body");i=i.parentNode){var e=Ri(i);if(Ci(e,"vt-sensitive")||Ci(e,"vt-no-capture"))return!1}if(Ci(Ri(t),"vt-include"))return!0;var n=t.type||"";if(xi(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";if(xi(r)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Xi(t){return!!($i(t,"input")&&!["button","checkbox","submit","reset","radio"].includes(t.type)||$i(t,"textarea")||"true"===t.getAttribute("contenteditable"))}function Ki(t){if(!Ji(t))return null;if($i(t,"input")){var i=t,e=(i.type||"text").toLowerCase();if("password"===e||"hidden"===e)return null;if("checkbox"===e||"radio"===e){var n={$el_value:i.checked?"true":"false"},r=function(t){var i=t.closest("label");if(i){var e=Si(i.textContent||"");if(e&&Wi(e))return Ai(e)||null}if(t.id)try{var n=null===document||void 0===document?void 0:document.querySelector('label[for="'+t.id+'"]');if(n){var r=Si(n.textContent||"");if(r&&Wi(r))return Ai(r)||null}}catch(t){}return null}(i);return r?n.$selected_text=r:i.value&&Wi(i.value)&&(n.$selected_text=i.value),n}var s=i.value;if(s&&Wi(s)){var o=Ai(s);if(o)return{$el_value:o}}return null}if($i(t,"select")){var a=t,l=a.selectedIndex;if(l>=0&&a.options[l]){var h=a.options[l],u={};h.value&&Wi(h.value)&&(u.$el_value=h.value);var d=h.text;if(d&&Wi(d)){var v=Ai(d);v&&(u.$selected_text=v)}if(u.$el_value||u.$selected_text)return u}return null}return $i(t,"textarea"),null}function Gi(t,i,e,n,r){if(void 0===e&&(e=void 0),!b||!t||$i(t,"html")||!Ei(t))return!1;if((null==e?void 0:e.url_allowlist)&&!zi(e.url_allowlist))return!1;if((null==e?void 0:e.url_ignorelist)&&zi(e.url_ignorelist))return!1;if(null==e?void 0:e.dom_event_allowlist){var s=e.dom_event_allowlist;if(s&&!s.some(t=>i.type===t))return!1}for(var o=!1,a=[t],l=!0,h=t;h.parentNode&&!$i(h,"body");)if(Ii(h.parentNode))a.push(h.parentNode.host),h=h.parentNode.host;else{if(!(l=Di(h)))break;if(n||bi.indexOf(l.tagName.toLowerCase())>-1)o=!0;else{var u=b.getComputedStyle(l);u&&"pointer"===u.getPropertyValue("cursor")&&(o=!0)}a.push(l),h=l}if(!function(t,i){var e=null==i?void 0:i.element_allowlist;if(ki(e))return!0;var n,r=function(t){if(e.some(i=>t.tagName.toLowerCase()===i))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}(a,e))return!1;if(!function(t,i){var e=null==i?void 0:i.css_selector_allowlist;if(ki(e))return!0;var n,r=function(t){if(e.some(i=>t.matches(i)))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}(a,e))return!1;if(function(t,i){var e=null==i?void 0:i.css_selector_ignorelist,n=void 0===e?wi:e;if(0===n.length)return!1;for(var r of t)for(var s of n)try{if(r.matches(s))return!0}catch(t){}return!1}(a,e))return!1;var d=b.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===i.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(r||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(i.type)>=0;default:return o?(r||["click"]).indexOf(i.type)>=0:(r||["click"]).indexOf(i.type)>=0&&(bi.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function Zi(t,i){return i.length>t?i.slice(0,t)+"...":i}function Qi(t,i,e,n){var r=t.tagName.toLowerCase(),s={tag_name:r};bi.indexOf(r)>-1&&!e&&(s.$el_text=Zi(1024,"a"===r||"button"===r?Li(t):Oi(t)));var o=Ri(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((!Xi(t)||-1!==["name","id","class","aria-label"].indexOf(l.name))&&(!(null==n?void 0:n.includes(l.name))&&!i&&Wi(l.value)&&!Hi(l.name))){var h=l.value;"class"===l.name&&(h=Mi(h).join(" ")),s["attr__"+l.name]=Zi(1024,h)}}for(var u=1,d=1,v=t;v=Ui(v);)u++,v.tagName===t.tagName&&d++;return s.nth_child=u,s.nth_of_type=d,s}function Yi(t){if(!Ji(t))return{};for(var i={},e=0;e<t.attributes.length;e++){var n=t.attributes[e];if(n.name&&0===n.name.indexOf("data-vt-capture-attribute")){var r=n.name.replace("data-vt-capture-attribute-",""),s=n.value;r&&s&&Wi(s)&&(i[r]=s)}}return i}function te(t){return t.replace(/"|\\"/g,'\\"')}function ie(t){var i,e=t.attr__class;return e?(i=e,Array.isArray(i)?e:Mi(e)):void 0}function ee(t){return function(t){var i=t.map(t=>{var i,n,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))r+="."+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!==(n=t.nth_of_type)&&void 0!==n?n: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,[n]=i;return e.localeCompare(n)}).forEach(t=>{var[i,e]=t;return a[te(i.toString())]=te(String(e))}),(r+=":")+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,n={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:ie(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 n.attributes[i]=e}),n})}(t))}function ne(t,i){return t.indexOf(i)>-1}class re{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 n=this.clicks[this.clicks.length-1];Math.sqrt(Math.pow(t-n.x,2)+Math.pow(i-n.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 se(t,i){for(var e,n,r,s,{e:o,maskAllElementAttributes:a,maskAllText:l,elementAttributeIgnoreList:h,elementsChainAsString:u,captureElementValues:d}=i,v=[t],c=t;c.parentNode&&!$i(c,"body");)Ii(c.parentNode)?(v.push(c.parentNode.host),c=c.parentNode.host):(v.push(c.parentNode),c=c.parentNode);var f,p=[],g={},m=!1,y=!1;for(var w of v){var _=Ji(w);if("a"===w.tagName.toLowerCase()){var x=w.getAttribute("href");m=!!(_&&x&&Wi(x))&&x}ne(Ri(w),"vt-no-capture")&&(y=!0),p.push(Qi(w,a,l,h));var k=Yi(w);Object.assign(g,k)}if(y)return{props:{},explicitNoCapture:y};if(l||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?p[0].$el_text=Li(t):p[0].$el_text=Oi(t)),"change"===o.type&&d){var S=Ki(t);S&&(S.$el_value&&(p[0].$el_value=S.$el_value),S.$selected_text&&(p[0].$selected_text=S.$selected_text))}if(m){p[0].attr__href=m;var C=null===(e=Q(m))||void 0===e?void 0:e.host,E=null===(n=null==b?void 0:b.location)||void 0===n?void 0:n.host;C&&E&&C!==E&&(f=m)}var T=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},u?{}:{$elements:p},{$elements_chain:ee(p)},(null===(r=p[0])||void 0===r?void 0:r.$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:T}}class oe{constructor(t){this.name="Autocapture",this.et=!1,this.nt=null,this.rt=null,this.st=new re,this.ot=!1,this._instance=t}get U(){var t,i=this._instance.getConfig(),e="object"!=typeof(t=i.autocapture)||null===t||Array.isArray(t)?{}:i.autocapture;return e.url_allowlist&&(e.url_allowlist=e.url_allowlist.map(t=>"string"==typeof t?new RegExp(t):t)),e.url_ignorelist&&(e.url_ignorelist=e.url_ignorelist.map(t=>"string"==typeof t?new RegExp(t):t)),e}get isEnabled(){var t,i=null!==(t=this.nt)&&void 0!==t&&t;return!!this._instance.getConfig().autocapture&&!i}get isStarted(){return this.et}startIfEnabled(){this.isEnabled&&!this.et&&(this.lt(),this.et=!0)}stop(){this.et=!1}onConfigUpdate(t){this.isEnabled&&!this.et&&this.startIfEnabled()}onRemoteConfig(t){t.elementsChainAsString&&(this.ot=t.elementsChainAsString),this.nt=!!t.autocapture_opt_out,this.startIfEnabled()}updateConfig(t){void 0!==t.enabled&&t.enabled&&(this.nt=!1)}setElementSelectors(t){this.rt=t}getElementSelectors(t){var i,e=[];return null===(i=this.rt)||void 0===i||i.forEach(i=>{var n=null==_?void 0:_.querySelectorAll(i);null==n||n.forEach(n=>{t===n&&e.push(i)})}),e}lt(){if(this.ht()&&b&&_){var t=t=>{t=t||(null==b?void 0:b.event);try{this.ut(t)}catch(t){}};if(q(_,"submit",t,{capture:!0}),q(_,"change",t,{capture:!0}),q(_,"click",t,{capture:!0}),this.U.capture_copied_text){var i=t=>{t=t||(null==b?void 0:b.event),this.ut(t,yi)};q(_,"copy",i,{capture:!0}),q(_,"cut",i,{capture:!0})}}}ut(t,i){var e,n,r,s,o;if(void 0===i&&(i="$autocapture"),this.isEnabled&&t.isTrusted){var a=function(t){var i;return ki(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(Ti(a)&&(a=a.parentNode||null),"$autocapture"===i&&"click"===t.type&&t instanceof MouseEvent)this._instance.getConfig().rageclick&&(null===(e=this.st)||void 0===e?void 0:e.isRageClick(t.clientX,t.clientY,(new Date).getTime()))&&this.ut(t,"$rageclick");var l=i===yi;if(a&&Gi(a,t,this.U,l,l?["copy","cut"]:void 0)){var h=this._instance.getConfig(),{props:u,explicitNoCapture:d}=se(a,{e:t,maskAllElementAttributes:null!==(n=h.mask_all_element_attributes)&&void 0!==n&&n,maskAllText:null!==(r=h.mask_all_text)&&void 0!==r&&r,elementAttributeIgnoreList:this.U.element_attribute_ignorelist,elementsChainAsString:this.ot,captureElementValues:null!==(s=this.U.capture_element_values)&&void 0!==s&&s});if(d)return!1;var v=this.getElementSelectors(a);if(v&&v.length>0&&(u.$element_selectors=v),i===yi){var c=Ai(null===(o=null==b?void 0:b.getSelection())||void 0===o?void 0:o.toString()),f=t.type||"clipboard";if(!c)return!1;u.$selected_content=c,u.$copy_type=f}return this._instance.capture(i,u),!0}}}ht(){return"function"==typeof(null==_?void 0:_.querySelectorAll)}}var ae="[SessionRecording]";class le{constructor(t,i){this._instance=t,this.name="SessionRecording",this.O=!1,this.U=i||le.extractConfig(t.getConfig())}static extractConfig(t){var i,e,n,r=t.session_recording||{};return{enabled:null!==(i=r.enabled)&&void 0!==i&&i,sampleRate:r.sampleRate,minimumDurationMs:r.minimumDurationMs,sessionIdleThresholdMs:r.sessionIdleThresholdMs,fullSnapshotIntervalMs:r.fullSnapshotIntervalMs,captureConsole:null!==(e=r.captureConsole)&&void 0!==e&&e,captureNetwork:null!==(n=r.captureNetwork)&&void 0!==n&&n,captureCanvas:r.captureCanvas,blockClass:r.blockClass,blockSelector:r.blockSelector,ignoreClass:r.ignoreClass,maskTextClass:r.maskTextClass,maskTextSelector:r.maskTextSelector,maskAllInputs:r.maskAllInputs,maskInputOptions:r.maskInputOptions,masking:r.masking,recordHeaders:r.recordHeaders,recordBody:r.recordBody,compressEvents:r.compressEvents,__mutationThrottlerRefillRate:r.__mutationThrottlerRefillRate,__mutationThrottlerBucketSize:r.__mutationThrottlerBucketSize}}get isEnabled(){var t,i=this._instance.getConfig(),e=null!==(t=this.U.enabled)&&void 0!==t&&t,n=!i.disable_session_recording;return!!b&&e&&n}get isStarted(){var t;return this.O&&!!(null===(t=this.dt)||void 0===t?void 0:t.isStarted)}startIfEnabled(){this.startIfEnabledOrStop("recording_initialized")}startIfEnabledOrStop(t){var i;if(!this.isEnabled||!(null===(i=this.dt)||void 0===i?void 0:i.isStarted)){var e=void 0!==Object.assign&&void 0!==Array.from;this.isEnabled&&e?(this.ct(t),this.O=!0,console.info(ae+" starting")):this.stop()}}stop(){I(()=>{var t;null===(t=this.dt)||void 0===t||t.stop(),this.O=!1})}onConfigUpdate(t){var i;this.U=le.extractConfig(t),null===(i=this.dt)||void 0===i||i.updateConfig(this.U),this.startIfEnabledOrStop("config_updated")}onRemoteConfig(t){var i,n,r,s,o,a,l;if(t.sessionRecording){var h=t.sessionRecording;this.U=e({},this.U,{enabled:null!==(i=this.U.enabled)&&void 0!==i?i:h.enabled,sampleRate:null!==(n=this.U.sampleRate)&&void 0!==n?n:h.sampleRate,minimumDurationMs:null!==(r=this.U.minimumDurationMs)&&void 0!==r?r:h.minimumDurationMs,fullSnapshotIntervalMs:null!==(s=this.U.fullSnapshotIntervalMs)&&void 0!==s?s:h.fullSnapshotIntervalMs,maskAllInputs:null!==(o=this.U.maskAllInputs)&&void 0!==o?o:h.maskAllInputs,captureConsole:null!==(a=this.U.captureConsole)&&void 0!==a?a:h.captureConsole,captureCanvas:null!==(l=this.U.captureCanvas)&&void 0!==l?l:h.captureCanvas}),this.startIfEnabledOrStop("remote_config")}}get started(){return this.isStarted}get status(){var t;return(null===(t=this.dt)||void 0===t?void 0:t.status)||"lazy_loading"}get sessionId(){var t;return(null===(t=this.dt)||void 0===t?void 0:t.sessionId)||""}stopRecording(){this.stop()}log(t,i){var e;void 0===i&&(i="log"),(null===(e=this.dt)||void 0===e?void 0:e.log)?this.dt.log(t,i):console.warn(ae+" log called before recorder was ready")}updateConfig(t){var i;this.U=e({},this.U,t),null===(i=this.dt)||void 0===i||i.updateConfig(this.U)}get ft(){return"recorder"}ct(t){var i,e,n,r;if(this.isEnabled)if((null===(e=null===(i=null==E?void 0:E.__VTiltExtensions__)||void 0===i?void 0:i.rrweb)||void 0===e?void 0:e.record)&&(null===(n=E.__VTiltExtensions__)||void 0===n?void 0:n.initSessionRecording))this.gt(t);else{var s=null===(r=E.__VTiltExtensions__)||void 0===r?void 0:r.loadExternalDependency;s?s(this._instance,this.ft,i=>{i?console.error(ae+" could not load recorder:",i):this.gt(t)}):console.error(ae+" loadExternalDependency not available. Session recording cannot start.")}}gt(t){var i,e=null===(i=E.__VTiltExtensions__)||void 0===i?void 0:i.initSessionRecording;e?(this.dt||(this.dt=e(this._instance,this.U)),this.dt.start(t)):console.error(ae+" initSessionRecording not available after script load")}}var he=(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))(he||{}),ue=Uint8Array,de=Uint16Array,ve=Int32Array,ce=new ue([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]),fe=new ue([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]),pe=new ue([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ge=function(t,i){for(var e=new de(31),n=0;n<31;++n)e[n]=i+=1<<t[n-1];var r=new ve(e[30]);for(n=1;n<30;++n)for(var s=e[n];s<e[n+1];++s)r[s]=s-e[n]<<5|n;return{b:e,r:r}},me=ge(ce,2),be=me.b,ye=me.r;be[28]=258,ye[258]=28;for(var we=ge(fe,0).r,_e=new de(32768),xe=0;xe<32768;++xe){var ke=(43690&xe)>>1|(21845&xe)<<1;ke=(61680&(ke=(52428&ke)>>2|(13107&ke)<<2))>>4|(3855&ke)<<4,_e[xe]=((65280&ke)>>8|(255&ke)<<8)>>1}var Se=function(t,i,e){for(var n=t.length,r=0,s=new de(i);r<n;++r)t[r]&&++s[t[r]-1];var o,a=new de(i);for(r=1;r<i;++r)a[r]=a[r-1]+s[r-1]<<1;if(e){o=new de(1<<i);var l=15-i;for(r=0;r<n;++r)if(t[r])for(var h=r<<4|t[r],u=i-t[r],d=a[t[r]-1]++<<u,v=d|(1<<u)-1;d<=v;++d)o[_e[d]>>l]=h}else for(o=new de(n),r=0;r<n;++r)t[r]&&(o[r]=_e[a[t[r]-1]++]>>15-t[r]);return o},Ce=new ue(288);for(xe=0;xe<144;++xe)Ce[xe]=8;for(xe=144;xe<256;++xe)Ce[xe]=9;for(xe=256;xe<280;++xe)Ce[xe]=7;for(xe=280;xe<288;++xe)Ce[xe]=8;var Ee=new ue(32);for(xe=0;xe<32;++xe)Ee[xe]=5;var Te=Se(Ce,9,0),$e=Se(Ee,5,0),Ie=function(t){return(t+7)/8|0},Me=function(t,i,e){return(null==e||e>t.length)&&(e=t.length),new ue(t.subarray(i,e))},Re=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8},Ae=function(t,i,e){e<<=7&i;var n=i/8|0;t[n]|=e,t[n+1]|=e>>8,t[n+2]|=e>>16},Oe=function(t,i){for(var e=[],n=0;n<t.length;++n)t[n]&&e.push({s:n,f:t[n]});var r=e.length,s=e.slice();if(!r)return{t:je,l:0};if(1==r){var o=new ue(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],h=0,u=1,d=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=e[e[h].f<e[d].f?h++:d++],l=e[h!=u&&e[h].f<e[d].f?h++:d++],e[u++]={s:-1,f:a.f+l.f,l:a,r:l};var v=s[0].s;for(n=1;n<r;++n)s[n].s>v&&(v=s[n].s);var c=new de(v+1),f=Pe(e[u-1],c,0);if(f>i){n=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});n<r;++n){var b=s[n].s;if(!(c[b]>i))break;p+=m-(1<<f-c[b]),c[b]=i}for(p>>=g;p>0;){var y=s[n].s;c[y]<i?p-=1<<i-c[y]++-1:++n}for(;n>=0&&p;--n){var w=s[n].s;c[w]==i&&(--c[w],++p)}f=i}return{t:new ue(c),l:f}},Pe=function(t,i,e){return-1==t.s?Math.max(Pe(t.l,i,e+1),Pe(t.r,i,e+1)):i[t.s]=e},Le=function(t){for(var i=t.length;i&&!t[--i];);for(var e=new de(++i),n=0,r=t[0],s=1,o=function(t){e[n++]=t},a=1;a<=i;++a)if(t[a]==r&&a!=i)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return{c:e.subarray(0,n),n:i}},Ue=function(t,i){for(var e=0,n=0;n<i.length;++n)e+=t[n]*i[n];return e},De=function(t,i,e){var n=e.length,r=Ie(i+2);t[r]=255&n,t[r+1]=n>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<n;++s)t[r+s+4]=e[s];return 8*(r+4+n)},ze=function(t,i,e,n,r,s,o,a,l,h,u){Re(i,u++,e),++r[256];for(var d=Oe(r,15),v=d.t,c=d.l,f=Oe(s,15),p=f.t,g=f.l,m=Le(v),b=m.c,y=m.n,w=Le(p),_=w.c,x=w.n,k=new de(19),S=0;S<b.length;++S)++k[31&b[S]];for(S=0;S<_.length;++S)++k[31&_[S]];for(var C=Oe(k,7),E=C.t,T=C.l,I=19;I>4&&!E[pe[I-1]];--I);var M,R,A,O,P=h+5<<3,L=Ue(r,Ce)+Ue(s,Ee)+o,U=Ue(r,v)+Ue(s,p)+o+14+3*I+Ue(k,E)+2*k[16]+3*k[17]+7*k[18];if(l>=0&&P<=L&&P<=U)return De(i,u,t.subarray(l,l+h));if(Re(i,u,1+(U<L)),u+=2,U<L){M=Se(v,c,0),R=v,A=Se(p,g,0),O=p;var D=Se(E,T,0);Re(i,u,y-257),Re(i,u+5,x-1),Re(i,u+10,I-4),u+=14;for(S=0;S<I;++S)Re(i,u+3*S,E[pe[S]]);u+=3*I;for(var z=[b,_],B=0;B<2;++B){var j=z[B];for(S=0;S<j.length;++S){var N=31&j[S];Re(i,u,D[N]),u+=E[N],N>15&&(Re(i,u,j[S]>>5&127),u+=j[S]>>12)}}}else M=Te,R=Ce,A=$e,O=Ee;for(S=0;S<a;++S){var F=n[S];if(F>255){Ae(i,u,M[(N=F>>18&31)+257]),u+=R[N+257],N>7&&(Re(i,u,F>>23&31),u+=ce[N]);var q=31&F;Ae(i,u,A[q]),u+=O[q],q>3&&(Ae(i,u,F>>5&8191),u+=fe[q])}else Ae(i,u,M[F]),u+=R[F]}return Ae(i,u,M[256]),u+R[256]},Be=new ve([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),je=new ue(0),Ne=function(){for(var t=new Int32Array(256),i=0;i<256;++i){for(var e=i,n=9;--n;)e=(1&e&&-306674912)^e>>>1;t[i]=e}return t}(),Fe=function(t,i,e,n,r){if(!r&&(r={l:1},i.dictionary)){var s=i.dictionary.subarray(-32768),o=new ue(s.length+t.length);o.set(s),o.set(t,s.length),t=o,r.w=s.length}return function(t,i,e,n,r,s){var o=s.z||t.length,a=new ue(n+o+5*(1+Math.ceil(o/7e3))+r),l=a.subarray(n,a.length-r),h=s.l,u=7&(s.r||0);if(i){u&&(l[0]=s.r>>3);for(var d=Be[i-1],v=d>>13,c=8191&d,f=(1<<e)-1,p=s.p||new de(32768),g=s.h||new de(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},w=new ve(25e3),_=new de(288),x=new de(32),k=0,S=0,C=s.i||0,E=0,T=s.w||0,I=0;C+2<o;++C){var M=y(C),R=32767&C,A=g[M];if(p[R]=A,g[M]=R,T<=C){var O=o-C;if((k>7e3||E>24576)&&(O>423||!h)){u=ze(t,l,0,w,_,x,S,E,I,C-I,u),E=k=S=0,I=C;for(var P=0;P<286;++P)_[P]=0;for(P=0;P<30;++P)x[P]=0}var L=2,U=0,D=c,z=R-A&32767;if(O>2&&M==y(C-z))for(var B=Math.min(v,O)-1,j=Math.min(32767,C),N=Math.min(258,O);z<=j&&--D&&R!=A;){if(t[C+L]==t[C+L-z]){for(var F=0;F<N&&t[C+F]==t[C+F-z];++F);if(F>L){if(L=F,U=z,F>B)break;var q=Math.min(z,F-2),V=0;for(P=0;P<q;++P){var W=C-z+P&32767,H=W-p[W]&32767;H>V&&(V=H,A=W)}}}z+=(R=A)-(A=p[R])&32767}if(U){w[E++]=268435456|ye[L]<<18|we[U];var J=31&ye[L],X=31&we[U];S+=ce[J]+fe[X],++_[257+J],++x[X],T=C+L,++k}else w[E++]=t[C],++_[t[C]]}}for(C=Math.max(C,T);C<o;++C)w[E++]=t[C],++_[t[C]];u=ze(t,l,h,w,_,x,S,E,I,C-I,u),h||(s.r=7&u|l[u/8|0]<<3,u-=7,s.h=g,s.p=p,s.i=C,s.w=T)}else{for(C=s.w||0;C<o+h;C+=65535){var K=C+65535;K>=o&&(l[u/8|0]=h,K=o),u=De(l,u+1,t.subarray(C,K))}s.i=o}return Me(a,0,n+Ie(u)+r)}(t,null==i.level?6:i.level,null==i.mem?r.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+i.mem,e,n,r)},qe=function(t,i,e){for(;e;++i)t[i]=e,e>>>=8};function Ve(t,i){i||(i={});var e=function(){var t=-1;return{p:function(i){for(var e=t,n=0;n<i.length;++n)e=Ne[255&e^i[n]]^e>>>8;t=e},d:function(){return~t}}}(),n=t.length;e.p(t);var r,s=Fe(t,i,10+((r=i).filename?r.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&&qe(t,4,Math.floor(new Date(i.mtime||Date.now())/1e3)),e){t[3]=8;for(var n=0;n<=e.length;++n)t[n+10]=e.charCodeAt(n)}}(s,i),qe(s,o-8,e.d()),qe(s,o-4,n),s}var We="undefined"!=typeof TextEncoder&&new TextEncoder,He="undefined"!=typeof TextDecoder&&new TextDecoder;try{He.decode(je,{stream:!0})}catch(t){}he.MouseMove,he.MouseInteraction,he.Scroll,he.ViewportResize,he.Input,he.TouchMove,he.MediaInteraction,he.Drag;var Je="[Chat]";class Xe{constructor(t,i){this._instance=t,this.name="Chat",this.bt=null,this.yt=!1,this.wt=!1,this.O=!1,this._t=null,this.xt=[],this.kt=[],this.St=[],this.Ct=[],this.Et=[],this.U=i||Xe.extractConfig(t.getConfig())}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}}get isEnabled(){var t;return!1!==this.U.enabled&&(!0===this.U.enabled||!this._instance.getConfig().disable_chat&&!0===(null===(t=this.bt)||void 0===t?void 0:t.enabled))}get isStarted(){return this.O}startIfEnabled(){this.Tt().catch(t=>{console.error(Je+" Error starting:",t)})}stop(){this.destroy(),this.O=!1}onConfigUpdate(t){var i,e;this.U=Xe.extractConfig(t),this.$t&&(null===(e=(i=this.$t).updateConfig)||void 0===e||e.call(i,this.getMergedConfig()))}onRemoteConfig(t){var i,n,r,s,o,a,l,h,u;t.chat&&(this.bt=e({},this.bt,{enabled:null!==(r=null!==(i=t.chat.enabled)&&void 0!==i?i:null===(n=this.bt)||void 0===n?void 0:n.enabled)&&void 0!==r&&r,position:null!==(a=null!==(s=t.chat.widgetPosition)&&void 0!==s?s:null===(o=this.bt)||void 0===o?void 0:o.position)&&void 0!==a?a:"bottom-right",color:null!==(u=null!==(l=t.chat.widgetColor)&&void 0!==l?l:null===(h=this.bt)||void 0===h?void 0:h.color)&&void 0!==u?u:"#6366f1"}),this.isEnabled&&!this.O&&this.startIfEnabled())}Tt(){var t=this;return i(function*(){var i,e,n,r;!1!==t.U.enabled?t._instance.getConfig().disable_chat?console.info(Je+" disabled by disable_chat config"):(!1!==t.U.autoConfig&&(yield t.It()),t.isEnabled?(t.O=!0,null!==(n=null!==(i=t.U.preload)&&void 0!==i?i:null===(e=t.bt)||void 0===e?void 0:e.enabled)&&void 0!==n&&n&&t.Mt(),(null===(r=t.bt)||void 0===r?void 0:r.enabled)&&t.Rt(),console.info(Je+" ready (lazy-load on demand)")):console.info(Je+" not enabled (check dashboard settings)")):console.info(Je+" disabled by code config")})()}get isOpen(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.isOpen)&&void 0!==i&&i}get isConnected(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.isConnected)&&void 0!==i&&i}get isLoading(){var t,i;return this.wt||null!==(i=null===(t=this.$t)||void 0===t?void 0:t.isLoading)&&void 0!==i&&i}get unreadCount(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.unreadCount)&&void 0!==i?i:0}get channel(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.channel)&&void 0!==i?i:null}get channels(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.channels)&&void 0!==i?i:[]}get currentView(){var t,i;return null!==(i=null===(t=this.$t)||void 0===t?void 0:t.currentView)&&void 0!==i?i:"list"}open(){this.At(()=>{var t;return null===(t=this.$t)||void 0===t?void 0:t.open()})}close(){var t;null===(t=this.$t)||void 0===t||t.close()}toggle(){this.$t?this.$t.toggle():this.open()}show(){this.At(()=>{var t;return null===(t=this.$t)||void 0===t?void 0:t.show()})}hide(){var t;null===(t=this.$t)||void 0===t||t.hide()}getChannels(){this.At(()=>{var t;return null===(t=this.$t)||void 0===t?void 0:t.getChannels()})}selectChannel(t){this.At(()=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.selectChannel(t)})}createChannel(){this.At(()=>{var t;return null===(t=this.$t)||void 0===t?void 0:t.createChannel()})}goToChannelList(){var t;null===(t=this.$t)||void 0===t||t.goToChannelList()}sendMessage(t){this.$t?this.$t.sendMessage(t):(this.xt.push(t),this.At(()=>{this.xt.forEach(t=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.sendMessage(t)}),this.xt=[]}))}markAsRead(){var t;null===(t=this.$t)||void 0===t||t.markAsRead()}onMessage(t){return this.St.push(t),this.$t?this.$t.onMessage(t):()=>{var i=this.St.indexOf(t);i>-1&&this.St.splice(i,1)}}onTyping(t){return this.Ct.push(t),this.$t?this.$t.onTyping(t):()=>{var i=this.Ct.indexOf(t);i>-1&&this.Ct.splice(i,1)}}onConnectionChange(t){return this.Et.push(t),this.$t?this.$t.onConnectionChange(t):()=>{var i=this.Et.indexOf(t);i>-1&&this.Et.splice(i,1)}}updateConfig(t){this.U=e({},this.U,t)}getMergedConfig(){var t,i,e,n,r,s,o,a,l,h,u,d,v,c,f,p,g,m,b=this.bt,y=this.U;return{enabled:null!==(i=null!==(t=y.enabled)&&void 0!==t?t:null==b?void 0:b.enabled)&&void 0!==i&&i,autoConfig:null===(e=y.autoConfig)||void 0===e||e,position:null!==(r=null!==(n=y.position)&&void 0!==n?n:null==b?void 0:b.position)&&void 0!==r?r:"bottom-right",greeting:null!==(s=y.greeting)&&void 0!==s?s:null==b?void 0:b.greeting,color:null!==(a=null!==(o=y.color)&&void 0!==o?o:null==b?void 0:b.color)&&void 0!==a?a:"#6366f1",aiMode:null===(h=null!==(l=y.aiMode)&&void 0!==l?l:null==b?void 0:b.ai_enabled)||void 0===h||h,aiGreeting:null!==(u=y.aiGreeting)&&void 0!==u?u:null==b?void 0:b.ai_greeting,preload:null!==(d=y.preload)&&void 0!==d&&d,theme:null!==(v=y.theme)&&void 0!==v?v:{primaryColor:null!==(f=null!==(c=y.color)&&void 0!==c?c:null==b?void 0:b.color)&&void 0!==f?f:"#6366f1"},offlineMessage:null!==(p=y.offlineMessage)&&void 0!==p?p:null==b?void 0:b.offline_message,collectEmailOffline:null===(m=null!==(g=y.collectEmailOffline)&&void 0!==g?g:null==b?void 0:b.collect_email_offline)||void 0===m||m}}destroy(){I(()=>{var t,i;null===(t=this.$t)||void 0===t||t.destroy(),this.$t=void 0,this.xt=[],this.kt=[],this.St=[],this.Ct=[],this.Et=[];var e=null===(i=null==b?void 0:b.document)||void 0===i?void 0:i.getElementById("vtilt-chat-bubble");e&&e.remove()})}It(){var t=this;return i(function*(){if(!t.yt){var i=t._instance.getConfig(),e=i.token,n=i.api_host;if(!e||!n)return console.warn(Je+" Cannot fetch settings: missing token or api_host"),void(t.yt=!0);try{var r=n+"/api/chat/settings?token="+encodeURIComponent(e),s=yield fetch(r);if(!s.ok)return console.warn(Je+" Failed to fetch settings: "+s.status),void(t.yt=!0);t.bt=yield s.json(),t.yt=!0,console.info(Je+" Loaded settings from dashboard")}catch(i){console.warn(Je+" Error fetching settings:",i),t.yt=!0}}})()}Rt(){if((null==b?void 0:b.document)&&!document.getElementById("vtilt-chat-bubble")){var t=this.getMergedConfig(),i=t.position||"bottom-right",e=t.color||"#6366f1",n=document.createElement("div");n.id="vtilt-chat-bubble",n.setAttribute("style",("\n position: fixed;\n bottom: 20px;\n "+("bottom-right"===i?"right: 20px;":"left: 20px;")+"\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background: "+e+";\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()),n.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 ',n.addEventListener("mouseenter",()=>{n.style.transform="scale(1.05)",n.style.boxShadow="0 6px 16px rgba(0, 0, 0, 0.2)"}),n.addEventListener("mouseleave",()=>{n.style.transform="scale(1)",n.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"}),n.addEventListener("click",()=>{this.open()}),document.body.appendChild(n)}}get ft(){return"chat"}Mt(){"undefined"!=typeof requestIdleCallback?requestIdleCallback(()=>this.Ot(),{timeout:5e3}):setTimeout(()=>this.Ot(),3e3)}At(t){this.$t?t():(this.kt.push(t),this.Ot())}Ot(){var t,i;if(!(this.wt||this.$t||this._t))if(null===(t=E.__VTiltExtensions__)||void 0===t?void 0:t.initChat)this.gt();else{this.wt=!0;var e=null===(i=E.__VTiltExtensions__)||void 0===i?void 0:i.loadExternalDependency;if(!e)return console.error(Je+" loadExternalDependency not available. Chat cannot start."),this.wt=!1,void(this._t="loadExternalDependency not available");e(this._instance,this.ft,t=>{if(this.wt=!1,t)return console.error(Je+" Failed to load:",t),void(this._t=String(t));this.gt()})}}gt(){var t,i=null===(t=E.__VTiltExtensions__)||void 0===t?void 0:t.initChat;if(!i)return console.error(Je+" initChat not available after script load"),void(this._t="initChat not available");if(!this.$t){var e=this.getMergedConfig();this.$t=i(this._instance,e),this.St.forEach(t=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.onMessage(t)}),this.Ct.forEach(t=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.onTyping(t)}),this.Et.forEach(t=>{var i;return null===(i=this.$t)||void 0===i?void 0:i.onConnectionChange(t)});var n=null===document||void 0===document?void 0:document.getElementById("vtilt-chat-bubble");n&&n.remove()}this.kt.forEach(t=>t()),this.kt=[],console.info(Je+" loaded and ready")}}var Ke="[VtdOverlay]";class Ge{constructor(t,i){this.name="VtdOverlay",this.O=!1,this.Pt=null,this.Lt=null,this.wt=!0,this.Ut=null,this.Dt=null,this.zt=null,this._instance=t,this.U=i||Ge.extractConfig(t.getConfig())}static extractConfig(t){return{enabled:!1!==t.vtd_overlay}}get isEnabled(){return!1!==this.U.enabled}get isStarted(){return this.O}startIfEnabled(){}stop(){this.O&&I(()=>{this.Bt(),this.O=!1})}onConfigUpdate(t){this.U=Ge.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.jt(e)){var n=this.Nt(e);this.Lt=e,this.Pt=n,this.wt=!0,this.Ft(),this.O=!0,this._instance.capture("$vtd_view",{$vtd_url:e,$vtd_embed_url:n!==e?n:void 0,$current_url:null===(i=null==b?void 0:b.location)||void 0===i?void 0:i.href})}else console.warn(Ke+" Invalid URL: "+e)}else console.warn(Ke+" Empty URL provided");else console.warn(Ke+" Feature is disabled")}getDestinationUrl(){return this.Pt}close(){this._instance.capture("$vtd_close",{$vtd_url:this.Lt}),this.Ut?(this.Ut.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.Bt(),this.O=!1,this.Pt=null,this.Lt=null},200)):(this.Bt(),this.O=!1,this.Pt=null,this.Lt=null)}jt(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}Nt(t){try{var i=new URL(t),e=i.hostname.toLowerCase();if("youtube.com"===e||"www.youtube.com"===e||"m.youtube.com"===e){var n=i.searchParams.get("v");if(n){var r=i.searchParams.get("t"),s="https://www.youtube.com/embed/"+n+"?autoplay=1";return r&&(s+="&start="+r.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 h=i.pathname.match(/^\/(\d+)/);if(h)return"https://player.vimeo.com/video/"+h[1]+"?autoplay=1"}if("loom.com"===e||"www.loom.com"===e){var u=i.pathname.match(/^\/share\/([a-zA-Z0-9]+)/);if(u)return"https://www.loom.com/embed/"+u[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}}qt(t){try{return new URL(t).hostname}catch(i){return t}}Vt(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}Ft(){if(_&&this.Pt){this.Bt(),this.Ut=_.createElement("div"),this.Ut.id="vtilt-vtd-overlay",this.Ut.className="vtilt-vtd-opening",this.Ut.setAttribute("style",this.Wt());var t=_.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.Ht());var i=_.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Jt()),i.innerHTML=this.Xt(),t.appendChild(i);var e=_.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Kt()),this.zt=_.createElement("div"),this.zt.className="vtilt-vtd-loading",this.zt.setAttribute("style",this.Gt()),this.zt.innerHTML=this.Zt(),e.appendChild(this.zt),this.Dt=_.createElement("iframe"),this.Dt.id="vtilt-vtd-iframe",this.Dt.className="vtilt-vtd-iframe",this.Dt.setAttribute("style",this.Qt()),this.Dt.setAttribute("frameborder","0"),this.Dt.setAttribute("allowfullscreen","true"),this.Dt.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var n=()=>{this.wt=!1,this.zt&&(this.zt.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.zt)||void 0===t?void 0:t.parentNode)&&(this.zt.style.display="none")},300)),this.Dt&&(this.Dt.style.opacity="1")};this.Dt.onload=n,this.Dt.onerror=n,setTimeout(()=>{this.wt&&n()},5e3),e.appendChild(this.Dt),this.Dt.src=this.Pt,t.appendChild(e),this.Ut.appendChild(t);var r=_.createElement("style");r.id="vtilt-vtd-styles",r.textContent=this.Yt(),_.head.appendChild(r),_.body.appendChild(this.Ut),this.ti(),_.body.style.overflow="hidden"}}Bt(){var t;(null===(t=this.Ut)||void 0===t?void 0:t.parentNode)&&(this.Ut.parentNode.removeChild(this.Ut),this.Ut=null,this.Dt=null,this.zt=null);var i=null==_?void 0:_.getElementById("vtilt-vtd-styles");(null==i?void 0:i.parentNode)&&i.parentNode.removeChild(i),(null==_?void 0:_.body)&&(_.body.style.overflow="")}ti(){var t,i,e,n=null===(t=this.Ut)||void 0===t?void 0:t.querySelector(".vtilt-vtd-close");null==n||n.addEventListener("click",()=>this.close());var r=null===(i=this.Ut)||void 0===i?void 0:i.querySelector(".vtilt-vtd-open");null==r||r.addEventListener("click",()=>{this.Lt&&(null==b||b.open(this.Lt,"_blank"))}),null===(e=this.Ut)||void 0===e||e.addEventListener("click",t=>{t.target===this.Ut&&this.close()});var s=t=>{"Escape"===t.key&&(this.close(),null==_||_.removeEventListener("keydown",s))};null==_||_.addEventListener("keydown",s)}Wt(){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 '}Ht(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Jt(){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 "}Xt(){var t=this.Lt||this.Pt,i=t?this.qt(t):"";return'\n <div style="display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;">\n <img \n src="'+(t?this.Vt(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.ii(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.ii(this.ei(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 '}Kt(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}Gt(){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 "}Zt(){var t=this.Lt||this.Pt,i=t?this.qt(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.ii(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 '}Qt(){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 "}Yt(){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 "}ei(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}ii(t){if(void 0===_)return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");var i=_.createElement("div");return i.textContent=t,i.innerHTML}}var Ze,Qe="text/plain";!function(t){t.GZipJS="gzip-js",t.None="none"}(Ze||(Ze={}));var Ye=t=>{var{data:i,compression:e}=t;if(i){var n=(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString():i))(i),r=new Blob([n]).size;if(e===Ze.GZipJS&&r>=1024)try{var s=Ve(function(t,i){if(We)return We.encode(t);for(var e=t.length,n=new ue(t.length+(t.length>>1)),r=0,s=function(t){n[r++]=t},o=0;o<e;++o){if(r+5>n.length){var a=new ue(r+8+(e-o<<1));a.set(n),n=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 Me(n,0,r)}(n),{mtime:0}),o=new Blob([s],{type:Qe});if(o.size<.95*r)return{contentType:Qe,body:o,estimatedSize:o.size}}catch(t){}return{contentType:"application/json",body:n,estimatedSize:r}}},tn=[{name:"fetch",available:"undefined"!=typeof fetch,method:t=>{var n=Ye(t);if(n){var{contentType:r,body:s,estimatedSize:o}=n,a=t.compression===Ze.GZipJS&&r===Qe?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,l=e({"Content-Type":r},t.headers||{}),h=new AbortController,u=t.timeout?setTimeout(()=>h.abort(),t.timeout):null;fetch(a,{method:t.method||"POST",headers:l,body:s,keepalive:o<52428.8,signal:h.signal}).then(function(){var e=i(function*(i){var e,n=yield i.text(),r={statusCode:i.status,text:n};if(200===i.status)try{r.json=JSON.parse(n)}catch(t){}null===(e=t.callback)||void 0===e||e.call(t,r)});return function(t){return e.apply(this,arguments)}}()).catch(()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})}).finally(()=>{u&&clearTimeout(u)})}}},{name:"XHR",available:"undefined"!=typeof XMLHttpRequest,method:t=>{var i=Ye(t);if(i){var{contentType:e,body:n}=i,r=t.compression===Ze.GZipJS&&e===Qe?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url,s=new XMLHttpRequest;s.open(t.method||"POST",r,!0),t.headers&&Object.entries(t.headers).forEach(t=>{var[i,e]=t;s.setRequestHeader(i,e)}),s.setRequestHeader("Content-Type",e),t.timeout&&(s.timeout=t.timeout),s.onreadystatechange=()=>{var i;if(4===s.readyState){var e={statusCode:s.status,text:s.responseText};if(200===s.status)try{e.json=JSON.parse(s.responseText)}catch(t){}null===(i=t.callback)||void 0===i||i.call(t,e)}},s.onerror=()=>{var i;null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0})},s.send(n)}}},{name:"sendBeacon",available:"undefined"!=typeof navigator&&!!navigator.sendBeacon,method:t=>{var i=Ye(t);if(i){var{contentType:e,body:n}=i;try{var r="string"==typeof n?new Blob([n],{type:e}):n,s=t.compression===Ze.GZipJS&&e===Qe?t.url+(t.url.includes("?")?"&":"?")+"compression=gzip-js":t.url;navigator.sendBeacon(s,r)}catch(t){}}}}],en=t=>{var i,e=t.transport||"fetch",n=tn.find(t=>t.name===e&&t.available)||tn.find(t=>t.available);if(!n)return console.error("vTilt: No available transport method"),void(null===(i=t.callback)||void 0===i||i.call(t,{statusCode:0}));n.method(t)};class nn{constructor(t,i){var e,n,r,s;this.ni=!0,this.ri=[],this.si=(e=(null==i?void 0:i.flush_interval_ms)||3e3,n=250,r=5e3,s=3e3,"number"!=typeof e||isNaN(e)?s:Math.min(Math.max(e,n),r)),this.oi=t}get length(){return this.ri.length}enqueue(t){this.ri.push(t),this.ai||this.li()}unload(){if(this.hi(),0!==this.ri.length){var t=this.ui();for(var i in t){var n=t[i];this.oi(e({},n,{transport:"sendBeacon"}))}}}enable(){this.ni=!1,this.li()}pause(){this.ni=!0,this.hi()}flush(){this.hi(),this.di(),this.li()}li(){this.ni||(this.ai=setTimeout(()=>{this.hi(),this.di(),this.ri.length>0&&this.li()},this.si))}hi(){this.ai&&(clearTimeout(this.ai),this.ai=void 0)}di(){if(0!==this.ri.length){var t=this.ui(),i=Date.now();for(var e in t){var n=t[e];n.events.forEach(t=>{var e=new Date(t.timestamp).getTime();t.$offset=Math.abs(e-i)}),this.oi(n)}}}ui(){var t={};return this.ri.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.ri=[],t}}class rn{constructor(t){this.ci=!1,this.fi=3e3,this.ri=[],this.pi=!0,this.oi=t.sendRequest,this.gi=t.sendBeacon,b&&void 0!==w&&"onLine"in w&&(this.pi=w.onLine,q(b,"online",()=>{this.pi=!0,this.N()}),q(b,"offline",()=>{this.pi=!1}))}get length(){return this.ri.length}enqueue(t,i){if(void 0===i&&(i=0),i>=10)console.warn("VTilt: Request failed after 10 retries, giving up");else{var e=function(t){var i=3e3*Math.pow(2,t),e=i/2,n=Math.min(18e5,i),r=(Math.random()-.5)*(n-e);return Math.ceil(n+r)}(i),n=Date.now()+e;this.ri.push({retryAt:n,request:t,retriesPerformedSoFar:i+1});var r="VTilt: Enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.pi||(r+=" (Browser is offline)"),console.warn(r),this.ci||(this.ci=!0,this.mi())}}retriableRequest(t){var e=this;return i(function*(){try{var i=yield e.oi(t);200!==i.statusCode&&(i.statusCode<400||i.statusCode>=500)&&e.enqueue(t,0)}catch(i){e.enqueue(t,0)}})()}mi(){this.bi&&clearTimeout(this.bi),this.bi=setTimeout(()=>{this.pi&&this.ri.length>0&&this.N(),this.ri.length>0?this.mi():this.ci=!1},this.fi)}N(){var t=this,e=Date.now(),n=[],r=[];this.ri.forEach(t=>{t.retryAt<e?r.push(t):n.push(t)}),this.ri=n,r.forEach(function(){var e=i(function*(i){var{request:e,retriesPerformedSoFar:n}=i;try{var r=yield t.oi(e);200!==r.statusCode&&(r.statusCode<400||r.statusCode>=500)&&t.enqueue(e,n)}catch(i){t.enqueue(e,n)}});return function(t){return e.apply(this,arguments)}}())}unload(){this.bi&&(clearTimeout(this.bi),this.bi=void 0),this.ri.forEach(t=>{var{request:i}=t;try{this.gi(i)}catch(t){console.error("VTilt: Failed to send beacon on unload",t)}}),this.ri=[]}}var sn="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,n,r;void 0===t&&(t=!1);var s=Date.now(),o=null!==(e=null===(i=this.persistence)||void 0===i?void 0:i.get(sn))&&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===(n=this.captureWarning)||void 0===n||n.call(this,"vTilt client rate limited. Config: "+this.eventsPerSecond+" events/second, "+this.eventsBurstLimit+" burst limit."),this.lastEventRateLimited=l,null===(r=this.persistence)||void 0===r||r.set(sn,o),{isRateLimited:l,remainingTokens:o.tokens}}shouldAllowEvent(){return!this.checkRateLimit(!1).isRateLimited}getRemainingTokens(){return this.checkRateLimit(!0).remainingTokens}}class an{constructor(t){this.yi=null,this.wi=t}get config(){return this.yi}onApply(t){this.xi=t}onLoad(t){this.ki=t}load(){var t,i=this.wi.getConfig();if(i.token){if(null===(t=i.bootstrap)||void 0===t?void 0:t.remoteConfig)return this.yi=i.bootstrap.remoteConfig,this.Si(this.yi),void this.Ci();var e=I(()=>b.__VTILT_BOOTSTRAP__);if(null==e?void 0:e.remoteConfig)return this.yi=e.remoteConfig,this.Si(this.yi),void this.Ci();I(()=>{var t=localStorage.getItem(u+"_"+i.token);t&&(this.yi=JSON.parse(t),this.Si(this.yi))}),this.Ci()}}Ci(){var t=this.wi.getConfig();if(t.token&&t.api_host){var i=t.api_host+"/api/decide?token="+t.token,e=new AbortController,n=setTimeout(()=>e.abort(),3e3);(k||fetch)(i,{method:"GET",signal:e.signal,headers:{Accept:"application/json"}}).then(t=>t.json()).then(i=>{var e;clearTimeout(n),this.yi=i,I(()=>{localStorage.setItem(u+"_"+t.token,JSON.stringify(i))}),this.Si(i),null===(e=this.ki)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(n)})}}Si(t){var i,e,n,r,s,o,a,l,h,u=this.wi.getConfig(),d={},v=!1,c=!1,f=!1;t.sessionRecording&&void 0===u.session_recording&&(d.session_recording={enabled:t.sessionRecording.enabled,sampleRate:t.sessionRecording.sampleRate,minimumDurationMs:t.sessionRecording.minimumDurationMs,fullSnapshotIntervalMs:t.sessionRecording.fullSnapshotIntervalMs,maskAllInputs:t.sessionRecording.maskAllInputs,captureConsole:t.sessionRecording.captureConsole,captureCanvas:t.sessionRecording.captureCanvas},t.sessionRecording.enabled&&(v=!0)),(null===(i=t.chat)||void 0===i?void 0:i.enabled)&&void 0===u.chat&&(d.chat={enabled:t.chat.enabled,position:t.chat.widgetPosition,color:t.chat.widgetColor},c=!0),t.analytics&&(void 0!==t.analytics.capturePageview&&void 0===u.capture_pageview&&(d.capture_pageview=t.analytics.capturePageview),void 0!==t.analytics.capturePageleave&&void 0===u.capture_pageleave&&(d.capture_pageleave=!!t.analytics.capturePageleave),void 0!==t.analytics.capturePerformance&&void 0===u.capture_performance&&(d.capture_performance=t.analytics.capturePerformance),void 0!==t.analytics.autocapture&&void 0===u.autocapture&&(d.autocapture=t.analytics.autocapture,t.analytics.autocapture&&(f=!0))),void 0!==(null===(e=t.privacy)||void 0===e?void 0:e.respectDnt)&&void 0===u.respect_dnt&&(d.respect_dnt=t.privacy.respectDnt),Object.keys(d).length>0&&this.wi.updateConfig(d),null===(n=this.xi)||void 0===n||n.call(this,t),this.wi.__loaded&&(v&&(null===(s=(r=this.wi).startSessionRecording)||void 0===s||s.call(r)),c&&(null===(a=(o=this.wi).Ei)||void 0===a||a.call(o)),f&&(null===(h=(l=this.wi).startAutocapture)||void 0===h||h.call(l)))}}class ln{constructor(t){this.Ti=!1,this.$i=!1,this.Ii=null,this.Mi=null,this.wi=t}setVtPersonId(t){this.Mi=t}capture(t,i,n){var r;if(this.wi.sessionManager.setSessionId(),(null==w?void 0:w.userAgent)&&function(t){return!(t&&"string"==typeof t&&t.length>500)}(w.userAgent)&&((null==n?void 0:n.skip_client_rate_limiting)||this.wi.rateLimiter.shouldAllowEvent())){var s,o=this.wi.buildUrl(),a=this.wi.getConfig(),l=this.Ri(t,i);if(!1!==a.stringifyPayload){if(!N(s=JSON.stringify(e({},l,a.globalAttributes))))return}else if(s=e({},l,a.globalAttributes),!N(JSON.stringify(s)))return;var h="$identify"===t?this.wi.userManager.getAnonymousId():null!==(r=this.wi.userManager.getDistinctId())&&void 0!==r?r:this.wi.userManager.getAnonymousId(),u={timestamp:(new Date).toISOString(),event:t,payload:s,distinct_id:h,anonymous_id:this.wi.userManager.getAnonymousId()};this.wi.sendRequest(o,u,!0)}}captureInternal(t,i){this.capture(t,i,{skip_client_rate_limiting:!0})}trackEvent(t,i){void 0===i&&(i={}),this.capture(t,i)}captureInitialPageview(){_&&("visible"===_.visibilityState?this.$i||(this.$i=!0,setTimeout(()=>{_&&x&&this.capture("$pageview",{navigation_type:"initial_load"})},300),this.Ii&&(_.removeEventListener("visibilitychange",this.Ii),this.Ii=null)):this.Ii||(this.Ii=()=>this.captureInitialPageview(),q(_,"visibilitychange",this.Ii)))}Ri(t,i){var n=ui(),r=this.wi.userManager.getUserProperties(),s=this.wi.userManager.get_initial_props(),o=this.wi.sessionManager.getSessionId(),a=this.wi.sessionManager.getWindowId(),l=this.wi.userManager.getAnonymousId(),h={};!this.Ti&&Object.keys(s).length>0&&Object.assign(h,s),i.$set_once&&Object.assign(h,i.$set_once);var u=e({},n,r,{$session_id:o,$window_id:a},l?{$anon_distinct_id:l}:{},this.Mi?{$vt:this.Mi}:{},Object.keys(h).length>0?{$set_once:h}:{},i.$set?{$set:i.$set}:{},i);return!this.Ti&&Object.keys(s).length>0&&(this.Ti=!0),"$pageview"===t&&_&&(u.title=_.title),u}}class hn{constructor(t){this.wi=t}identify(t,i,e){var n,r;if("number"==typeof t&&(t=String(t),console.warn("identify: first argument should be a string, not a number")),t)if(this.wi.userManager.isDistinctIdStringLikePublic(t))console.error('identify: "'+t+'" appears to be a hardcoded string');else if("COOKIELESS_SENTINEL_VALUE"!==t){var s=this.wi.userManager.getDistinctId(),o=this.wi.userManager.getAnonymousId(),a=this.wi.userManager.getDeviceId(),l="anonymous"===this.wi.userManager.getUserState();a||this.wi.userManager.ensureDeviceId(s||o),t!==s&&l?(this.wi.userManager.setUserState("identified"),this.wi.userManager.updateUserProperties(i,e),this.wi.capture("$identify",{distinct_id:t,$anon_distinct_id:o,$set:i||{},$set_once:e||{}}),this.wi.userManager.setDistinctId(t),null===(n=this.wi.Ai)||void 0===n||n.emit("user:identified",{distinctId:t})):t!==s?(this.wi.userManager.setUserState("identified"),this.wi.userManager.setDistinctId(t),this.wi.userManager.updateUserProperties(i,e),this.wi.capture("$identify",{distinct_id:t,$anon_distinct_id:o,$set:i||{},$set_once:e||{}}),null===(r=this.wi.Ai)||void 0===r||r.emit("user:identified",{distinctId:t})):(i||e)&&(l&&this.wi.userManager.setUserState("identified"),this.wi.userManager.updateUserProperties(i,e),this.wi.capture("$set",{$set:i||{},$set_once:e||{}}))}else console.error("identify: cannot use sentinel value as distinct_id");else console.error("identify: unique user id is required")}setUserProperties(t,i){var e;this.wi.userManager.setUserProperties(t,i)&&(this.wi.capture("$set",{$set:t||{},$set_once:i||{}}),null===(e=this.wi.Ai)||void 0===e||e.emit("user:properties_set",{properties:t}))}resetUser(t){var i;this.wi.sessionManager.resetSessionId(),this.wi.userManager.reset(t),null===(i=this.wi.Ai)||void 0===i||i.emit("user:reset")}createAlias(t,i){var e=this.wi.userManager.createAlias(t,i);e?this.wi.capture("$alias",{$original_id:e.original,$alias_id:e.distinct_id}):t===(i||this.wi.userManager.getDistinctId()||this.wi.userManager.getAnonymousId())&&this.identify(t)}getUserIdentity(){return this.wi.userManager.getUserIdentity()}getDeviceId(){return this.wi.userManager.getDeviceId()}getUserState(){return this.wi.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.wi.userManager.getDistinctId())&&void 0!==t?t:this.wi.userManager.getAnonymousId()}getAnonymousId(){return this.wi.userManager.getAnonymousId()}}class un{constructor(t){this.Oi=new Map,this.wi=t}onFeatureStarted(t){this.Pi=t}onFeatureStopped(t){this.Li=t}register(t){this.Oi.set(t.name,t)}get(t){var i;return null===(i=this.Oi.get(t))||void 0===i?void 0:i.instance}initAll(){this.Oi.forEach(t=>{this.Ui(t)})}init(t){var i=this.Oi.get(t);if(i)return this.Ui(i),i.instance}start(t){var i,e=this.Oi.get(t);if(e&&(e.instance||this.Ui(e),e.instance)){if(e.instance.onConfigUpdate){var n=this.wi.getConfig();e.instance.onConfigUpdate(n)}e.instance.startIfEnabled(),null===(i=this.Pi)||void 0===i||i.call(this,t)}}stop(t){var i,e=this.Oi.get(t);(null==e?void 0:e.instance)&&(e.instance.stop(),null===(i=this.Li)||void 0===i||i.call(this,t))}isActive(t){var i,e,n;return null!==(n=null===(e=null===(i=this.Oi.get(t))||void 0===i?void 0:i.instance)||void 0===e?void 0:e.isStarted)&&void 0!==n&&n}notifyConfigUpdate(t){this.Oi.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onConfigUpdate)&&I(()=>i.instance.onConfigUpdate(t))})}notifyRemoteConfig(t){this.Oi.forEach(i=>{var e;(null===(e=i.instance)||void 0===e?void 0:e.onRemoteConfig)&&I(()=>i.instance.onRemoteConfig(t))})}getAll(){var t=[];return this.Oi.forEach(i=>{i.instance&&t.push(i.instance)}),t}Ui(t){if(!t.instance){var i=this.wi.getConfig();t.disableKey&&i[t.disableKey]||t.enableKey&&!1===i[t.enableKey]||I(()=>{var i;t.instance=new t.FeatureClass(this.wi),t.instance.startIfEnabled(),t.instance.isStarted&&(null===(i=this.Pi)||void 0===i||i.call(this,t.name))})}}}var dn="vt",vn=Array.isArray;class cn{constructor(t){void 0===t&&(t={}),this.version=n,this.__loaded=!1,this.__request_queue=[],this.Di=!1,this.Ai=new M,this.configManager=new T(t);var i=this.configManager.getConfig();this.sessionManager=new Z(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new di(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.rateLimiter=new on({eventsPerSecond:10,eventsBurstLimit:100,captureWarning:t=>{this.zi.captureInternal("$$client_ingestion_warning",{$$client_ingestion_warning_message:t})}}),this.retryQueue=new rn({sendRequest:t=>this.Bi(t),sendBeacon:t=>this.ji(t)}),this.requestQueue=new nn(t=>this.Ni(t),{flush_interval_ms:3e3}),this.zi=new ln(this),this.Fi=new hn(this),this.qi=new an(this),this.Vi=new un(this),this.qi.onApply(t=>{this.Vi.notifyRemoteConfig(t)}),this.qi.onLoad(t=>{this.Ai.emit(O,{config:t})}),this.Vi.onFeatureStarted(t=>{this.Ai.emit(P,{feature:t})}),this.Vi.onFeatureStopped(t=>{this.Ai.emit(L,{feature:t})})}init(t,i,e){var n;if(e&&e!==dn){var r=null!==(n=fn[e])&&void 0!==n?n:new cn;return r._init(t,i,e),fn[e]=r,fn[dn][e]=r,r}return this._init(t,i,e)}_init(t,i,n){if(void 0===i&&(i={}),this.__loaded)return console.warn("vTilt: Already initialized! Re-initializing is a no-op"),this;this.updateConfig(e({},i,{token:t||i.token,name:n})),this.__loaded=!0,this.Wi(),this.qi.load();var r=this.configManager.getConfig();return this.userManager.set_initial_person_info(r.mask_personal_data_properties,r.custom_personal_data_properties),this.Hi(),this.Ji(),this.Xi(),!1!==r.capture_pageview&&this.zi.captureInitialPageview(),this.Ai.emit(R,{config:r}),this}Hi(){this.Ki(),this.Gi(),this.Zi(),this.Qi(),this.Ei()}Ki(){this.historyAutocapture||(this.historyAutocapture=new mi(this),this.historyAutocapture.startIfEnabled())}Gi(){this.autocapture||!1!==this.configManager.getConfig().autocapture&&(this.autocapture=new oe(this),this.autocapture.startIfEnabled())}Zi(){this.webVitals||(this.webVitals=new pi(this),this.webVitals.startIfEnabled())}Qi(){this.sessionRecording||(this.configManager.getConfig().disable_session_recording||(this.sessionRecording=new le(this),this.sessionRecording.isEnabled&&(this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ai.emit(D))))}Ei(){this.chat||(this.configManager.getConfig().disable_chat||(this.chat=new Xe(this),this.chat.startIfEnabled()))}startAutocapture(){this.autocapture||(this.autocapture=new oe(this)),this.autocapture.updateConfig({enabled:!0}),this.autocapture.startIfEnabled()}stopAutocapture(){var t;null===(t=this.autocapture)||void 0===t||t.stop()}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this.autocapture)||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}startSessionRecording(){this.sessionRecording||(this.sessionRecording=new le(this)),this.sessionRecording.updateConfig({enabled:!0}),this.sessionRecording.startIfEnabledOrStop("recording_initialized"),this.Ai.emit(D)}stopSessionRecording(){var t;null===(t=this.sessionRecording)||void 0===t||t.stop(),this.Ai.emit(z)}isRecordingActive(){var t;return"active"===(null===(t=this.sessionRecording)||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this.sessionRecording)||void 0===t?void 0:t.sessionId)||null}capture(t,i,e){this.zi.capture(t,i,e),this.Ai.emit(U,{event:t,payload:i})}trackEvent(t,i){void 0===i&&(i={}),this.zi.trackEvent(t,i)}identify(t,i,e){this.Fi.identify(t,i,e)}setUserProperties(t,i){this.Fi.setUserProperties(t,i)}resetUser(t){this.Fi.resetUser(t)}createAlias(t,i){this.Fi.createAlias(t,i)}getUserIdentity(){return this.Fi.getUserIdentity()}getDeviceId(){return this.Fi.getDeviceId()}getUserState(){return this.Fi.getUserState()}getConfig(){return this.configManager.getConfig()}getRemoteConfig(){return this.qi.config}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.Fi.getDistinctId()}getAnonymousId(){return this.Fi.getAnonymousId()}toString(){var t,i=null!==(t=this.configManager.getConfig().name)&&void 0!==t?t:dn;return i!==dn&&(i="vt."+i),i}updateConfig(t){this.configManager.updateConfig(t);var i=this.configManager.getConfig();this.sessionManager=new Z(i.storage||"cookie",i.cross_subdomain_cookie),this.userManager=new di(i.persistence||"localStorage+cookie",i.cross_subdomain_cookie),this.Yi(i),this.Ai.emit(A,{config:i})}Yi(t){[this.historyAutocapture,this.autocapture,this.webVitals,this.sessionRecording,this.chat,this.vtdOverlay].forEach(i=>{(null==i?void 0:i.onConfigUpdate)&&I(()=>i.onConfigUpdate(t))})}buildUrl(){var t=this.configManager.getConfig(),{proxyUrl:i,proxy:e,api_host:n,token:r}=t;return i||(e?e+"/api/tracking?token="+r:n?n.replace(/\/+$/gm,"")+"/api/tracking?token="+r:"/api/tracking?token="+r)}sendRequest(t,i,e){if(this.te()){if(e&&void 0!==b)if(b.__VTILT_ENQUEUE_REQUESTS)return void this.__request_queue.push({url:t,event:i});this.requestQueue.enqueue({url:t,event:i})}}te(){return!!this.configManager.getConfig().token||(this.Di||(console.warn("VTilt: token is required for tracking"),this.Di=!0),!1)}Ni(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.ji(t)}Bi(t){return new Promise(i=>{var{url:e,events:n}=t,r=1===n.length?n[0]:{events:n},s=this.configManager.getConfig().disable_compression?Ze.None:Ze.GZipJS;en({url:e,data:r,method:"POST",transport:"XHR",compression:s,callback:t=>i({statusCode:t.statusCode})})})}ji(t){var{url:i,events:e}=t,n=1===e.length?e[0]:{events:e},r=this.configManager.getConfig().disable_compression?Ze.None:Ze.GZipJS;en({url:i,data:n,method:"POST",transport:"sendBeacon",compression:r})}ie(t){this.sendRequest(t.url,t.event,!1)}Ji(){if(b){var t=()=>{this.requestQueue.unload(),this.retryQueue.unload()};q(b,"beforeunload",t),q(b,"pagehide",t)}}Xi(){this.requestQueue.enable()}Wi(){I(()=>{var t,i;if(void 0!==x&&x.search){var e=new URL(x.href),n=e.searchParams.get("vt"),r=e.searchParams.get("vtd");if((null==n?void 0:n.trim())&&(this.zi.setVtPersonId(n.trim()),e.searchParams.delete("vt")),(null==r?void 0:r.trim())&&(this.ee(r.trim()),e.searchParams.delete("vtd")),(null==n?void 0:n.trim())||(null==r?void 0:r.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)}}})}ee(t){this.vtdOverlay||(this.vtdOverlay=new Ge(this),this.vtdOverlay.setDestinationUrl(t))}_execute_array(t){Array.isArray(t)&&t.forEach(t=>{if(t&&Array.isArray(t)&&t.length>0){var i=t[0],e=t.slice(1);"function"==typeof this[i]&&I(()=>this[i](...e))}})}_dom_loaded(){this.__request_queue.forEach(t=>this.ie(t)),this.__request_queue=[],this.Xi()}}var fn={},pn=!(void 0!==S||void 0!==k)&&-1===(null==C?void 0:C.indexOf("MSIE"))&&-1===(null==C?void 0:C.indexOf("Mozilla"));null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=pn);var gn,mn,bn=function(){function t(){t.done||(t.done=!0,pn=!1,null!=b&&(b.__VTILT_ENQUEUE_REQUESTS=!1),F(fn,t=>t._dom_loaded()))}_&&"function"==typeof _.addEventListener?"complete"===_.readyState?t():q(_,"DOMContentLoaded",t,{capture:!1}):b&&console.error("Browser doesn't support document.addEventListener")};"undefined"!=typeof window&&window.vt&&Array.isArray(window.vt)&&(gn=fn[dn]=new cn,(mn=E.vt)&&F(mn._i,function(t){if(t&&vn(t)){var i=gn.init(t[0],t[1],t[2]),e=mn[t[2]||"vt"]||mn;i&&i._execute_array(e)}}),E.vt=gn,bn());var yn=function(){var t=fn[dn]=new cn;return bn(),t}();exports.ALL_WEB_VITALS_METRICS=["LCP","CLS","FCP","INP","TTFB"],exports.DEFAULT_WEB_VITALS_METRICS=vi,exports.VTilt=cn,exports.default=yn,exports.vt=yn;
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.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&&lt(()=>{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._emitter.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.Ri({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.Ri({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._emitter.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))}})}}Ri(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.Ti=null,this.Ii=null,this.L=!0,this.Pi=null,this.Oi=null,this.Li=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&&lt(()=>{this.Ui(),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.Di(e)){var r=this.Bi(e);this.Ii=e,this.Ti=r,this.L=!0,this.ji(),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.Ti}close(){this._instance.capture("$vtd_close",{$vtd_url:this.Ii}),this.Pi?(this.Pi.classList.add("vtilt-vtd-closing"),setTimeout(()=>{this.Ui(),this.O=!1,this.Ti=null,this.Ii=null},200)):(this.Ui(),this.O=!1,this.Ti=null,this.Ii=null)}Di(t){try{var i=new URL(t);return"http:"===i.protocol||"https:"===i.protocol}catch(t){return!1}}Bi(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}}zi(t){try{return new URL(t).hostname}catch(i){return t}}Ni(t){try{return"https://www.google.com/s2/favicons?domain="+new URL(t).hostname+"&sz=32"}catch(t){return""}}ji(){if(N&&this.Ti){this.Ui(),this.Pi=N.createElement("div"),this.Pi.id="vtilt-vtd-overlay",this.Pi.className="vtilt-vtd-opening",this.Pi.setAttribute("style",this.Fi());var t=N.createElement("div");t.className="vtilt-vtd-modal",t.setAttribute("style",this.qi());var i=N.createElement("div");i.className="vtilt-vtd-header",i.setAttribute("style",this.Hi()),i.innerHTML=this.Wi(),t.appendChild(i);var e=N.createElement("div");e.className="vtilt-vtd-iframe-wrapper",e.setAttribute("style",this.Vi()),this.Li=N.createElement("div"),this.Li.className="vtilt-vtd-loading",this.Li.setAttribute("style",this.Gi()),this.Li.innerHTML=this.Ki(),e.appendChild(this.Li),this.Oi=N.createElement("iframe"),this.Oi.id="vtilt-vtd-iframe",this.Oi.className="vtilt-vtd-iframe",this.Oi.setAttribute("style",this.Ji()),this.Oi.setAttribute("frameborder","0"),this.Oi.setAttribute("allowfullscreen","true"),this.Oi.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share");var r=()=>{this.L=!1,this.Li&&(this.Li.style.opacity="0",setTimeout(()=>{var t;(null===(t=this.Li)||void 0===t?void 0:t.parentNode)&&(this.Li.style.display="none")},300)),this.Oi&&(this.Oi.style.opacity="1")};this.Oi.onload=r,this.Oi.onerror=r,setTimeout(()=>{this.L&&r()},5e3),e.appendChild(this.Oi),this.Oi.src=this.Ti,t.appendChild(e),this.Pi.appendChild(t);var n=N.createElement("style");n.id="vtilt-vtd-styles",n.textContent=this.Xi(),N.head.appendChild(n),N.body.appendChild(this.Pi),this.Zi(),N.body.style.overflow="hidden"}}Ui(){var t;(null===(t=this.Pi)||void 0===t?void 0:t.parentNode)&&(this.Pi.parentNode.removeChild(this.Pi),this.Pi=null,this.Oi=null,this.Li=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="")}Zi(){var t,i,e,r=null===(t=this.Pi)||void 0===t?void 0:t.querySelector(".vtilt-vtd-close");null==r||r.addEventListener("click",()=>this.close());var n=null===(i=this.Pi)||void 0===i?void 0:i.querySelector(".vtilt-vtd-open");null==n||n.addEventListener("click",()=>{this.Ii&&(null==B||B.open(this.Ii,"_blank"))}),null===(e=this.Pi)||void 0===e||e.addEventListener("click",t=>{t.target===this.Pi&&this.close()});var s=t=>{"Escape"===t.key&&(this.close(),null==N||N.removeEventListener("keydown",s))};null==N||N.addEventListener("keydown",s)}Fi(){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 '}qi(){return"\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: #0a0a0a;\n overflow: hidden;\n "}Hi(){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 "}Wi(){var t=this.Ii||this.Ti,i=t?this.zi(t):"";return'\n <div style="display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;">\n <img \n src="'+(t?this.Ni(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.Qi(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.Qi(this.Yi(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 '}Vi(){return"\n flex: 1;\n position: relative;\n background: #000;\n overflow: hidden;\n "}Gi(){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 "}Ki(){var t=this.Ii||this.Ti,i=t?this.zi(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.Qi(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 '}Ji(){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 "}Xi(){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 "}Yi(t,i){return t.length<=i?t:t.substring(0,i-3)+"..."}Qi(t){if(void 0===N)return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");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.te=!0,this.ie=[],this.ee=(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.re=t}get length(){return this.ie.length}enqueue(t){this.ie.push(t),this.ne||this.se()}unload(){if(this.oe(),0!==this.ie.length){var t=this.ae();for(var i in t){var r=t[i];this.re(e({},r,{transport:"sendBeacon"}))}}}enable(){this.te=!1,this.se()}pause(){this.te=!0,this.oe()}flush(){this.oe(),this.le(),this.se()}se(){this.te||(this.ne=setTimeout(()=>{this.oe(),this.le(),this.ie.length>0&&this.se()},this.ee))}oe(){this.ne&&(clearTimeout(this.ne),this.ne=void 0)}le(){if(0!==this.ie.length){var t=this.ae(),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.re(r)}}}ae(){var t={};return this.ie.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.ie=[],t}}class In{constructor(t){this.ue=!1,this.he=3e3,this.ie=[],this.de=!0,this.re=t.sendRequest,this.ve=t.sendBeacon,B&&void 0!==z&&"onLine"in z&&(this.de=z.onLine,Rt(B,"online",()=>{this.de=!0,this.Z()}),Rt(B,"offline",()=>{this.de=!1}))}get length(){return this.ie.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.ie.push({retryAt:r,request:t,retriesPerformedSoFar:i+1});var n="enqueued failed request for retry in "+Math.round(e/1e3)+"s";this.de||(n+=" (browser is offline)"),ot().warn("retry",n),this.ue||(this.ue=!0,this.ce())}}retriableRequest(t){var e=this;return i(function*(){try{var i=yield e.re(t);200!==i.statusCode&&(i.statusCode<400||i.statusCode>=500)&&e.enqueue(t,0)}catch(i){e.enqueue(t,0)}})()}ce(){this.fe&&clearTimeout(this.fe),this.fe=setTimeout(()=>{this.de&&this.ie.length>0&&this.Z(),this.ie.length>0?this.ce():this.ue=!1},this.he)}Z(){var t=this,e=Date.now(),r=[],n=[];this.ie.forEach(t=>{t.retryAt<e?n.push(t):r.push(t)}),this.ie=r,n.forEach(function(){var e=i(function*(i){var{request:e,retriesPerformedSoFar:r}=i;try{var n=yield t.re(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.fe&&(clearTimeout(this.fe),this.fe=void 0),this.ie.forEach(t=>{var{request:i}=t;try{this.ve(i)}catch(t){ot().error("retry","failed to send beacon on unload",t)}}),this.ie=[]}}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.pe=null,this.ge=null,this.me=t}get config(){return this.pe}onApply(t){this.be=t}onLoad(t){this.ye=t}load(){var t,i=this.me.getConfig();if(i.token){if(this.ge||(this.ge=e({},i)),null===(t=i.bootstrap)||void 0===t?void 0:t.remoteConfig)return this.pe=i.bootstrap.remoteConfig,this._e(this.pe),void this.we();var r=lt(()=>B.__VTILT_BOOTSTRAP__);if(null==r?void 0:r.remoteConfig)return this.pe=r.remoteConfig,this._e(this.pe),void this.we();lt(()=>{var t=localStorage.getItem(h+"_"+i.token);t&&(this.pe=JSON.parse(t),this._e(this.pe,!0))}),this.we()}}we(){var t=this.me.getConfig();if(t.token)if(Ct())this.me.updateConfig({__remote_config_loaded:!0});else{var i=this.me.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.pe=i,lt(()=>{localStorage.setItem(h+"_"+t.token,JSON.stringify(i))}),this._e(i),null===(e=this.ye)||void 0===e||e.call(this,i)}).catch(()=>{clearTimeout(n),kt("config"),this.me.updateConfig({__remote_config_loaded:!0})})}}_e(t,i){var r,n,s,o;void 0===i&&(i=!1);var a=this.ge||this.me.getConfig(),l={};for(var[,u]of this.me.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.me.updateConfig(l),null===(o=this.be)||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.xe=zn(),this.ke=null,this.Se=zn(),this.Ce="",this.Me="",this.Ae="",this.$e=""}onAfterPageview(){var t=zn();this.xe=t,this.ke=t,this.$e="",F&&(this.Ce=F.href||"",this.Me=F.pathname||""),N&&(this.Ae=N.title||"")}peekEngagementSinceLastCaptureMs(){var t,i=zn(),e=null!==(t=this.ke)&&void 0!==t?t:this.Se,r=Math.round(i-e);return r<1&&(r=1),r>jn&&(r=jn),r}commitCaptureClock(){this.ke=zn()}Ee(){return this.Ce+"\0"+this.Me}clearLeaveDedupe(){this.$e=""}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.Ee();if((this.Ce||this.Me)&&n&&this.$e!==n){this.$e=n;var s=zn(),o=Math.round(s-this.xe);o<1&&(o=1),o>jn&&(o=jn);var a={navigation_type:e,engagement_time_msec:o,[R]:this.Ce,[T]:this.Me,[I]:Math.round(o/1e3),[P]:this.Me,[O]:this.Ce},l=this.Ce?function(t){try{return new URL(t).host}catch(t){return""}}(this.Ce):"";l&&(a.$host=l),this.Ae&&(a.title=this.Ae),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.Re=!1,this.Te=!1,this.Ie=null,this.Pe=null,this.Oe=new Nn,this.me=t}setVtPersonId(t){this.Pe=t}capture(t,i,r){var n,s,o;this.me.sessionManager.setSessionId();var a=this.me.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.me.rateLimiter.shouldAllowEvent())if(!this.me.getConfig().require_consent||qn.has(t)||(null===(s=this.me.consentManager)||void 0===s?void 0:s.hasConsent())){var l=this.me.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.Oe.peekEngagementSinceLastCaptureMs()}));var d=e({},this.Le(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.me.userManager.getAnonymousId():null!==(o=this.me.userManager.getDistinctId())&&void 0!==o?o:this.me.userManager.getAnonymousId(),p={timestamp:(new Date).toISOString(),event:t,payload:d,distinct_id:f,anonymous_id:this.me.userManager.getAnonymousId()};this.me.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.Pe&&(this.Pe=null),t===b?this.Oe.onAfterPageview():this.Oe.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.Te||(this.Te=!0,setTimeout(()=>{N&&F&&!1!==this.me.getConfig().capture_pageview&&this.capture(b,{navigation_type:"initial_load"})},300),this.Ie&&(N.removeEventListener("visibilitychange",this.Ie),this.Ie=null)):this.Ie||(this.Ie=()=>this.captureInitialPageview(),Rt(N,"visibilitychange",this.Ie)))}tryCapturePageleave(t,i){this.Oe.tryCapturePageleave(this.me.getConfig(),(t,i,e)=>this.capture(t,i,e),t,i)}resetPageleaveDedupe(){this.Oe.clearLeaveDedupe()}Ue(){if(this.me.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}Le(t,i){var r,n,s=this.me.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.me.userManager.getUserProperties(),d=this.me.userManager.get_initial_props(),v=this.me.sessionManager.getSessionId(),c=this.me.sessionManager.getWindowId(),f={};!this.Re&&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.me.consentManager)||void 0===r?void 0:r.getConsentProperties())&&void 0!==n?n:{},{$session_id:v,$window_id:c},this.Pe?{$vt:this.Pe}:{},Object.keys(f).length>0?{$set_once:f}:{},i.$set?{$set:i.$set}:{},i);!this.Re&&Object.keys(d).length>0&&(this.Re=!0),t===b&&N&&(p.title=N.title),this.Ue()&&(p.$debug=!0);var g=this.me.sessionManager.consumeSessionStart(),m=this.me.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.De=null,this.Be=null,this.me=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.De!==s){var o=this.me.userManager,a=o.getDistinctId(),l=o.getAnonymousId(),u=o.getDeviceId();if(!("identified"===o.getUserState())&&l!==t||t!==a){this.me.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.me._emitter)||void 0===n||n.emit("user:identified",{distinctId:t})}else(i||r)&&this.setUserProperties(i,r);this.De=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.me.userManager,s=JSON.stringify([null!==(e=n.getDistinctId())&&void 0!==e?e:n.getAnonymousId(),t,i]);this.Be!==s&&(n.applyUpdate({properties_set:t,properties_set_once:i}),this.me.capture(x,{$set:t||{},$set_once:i||{}}),null===(r=this.me._emitter)||void 0===r||r.emit("user:properties_set",{properties:t}),this.Be=s)}}resetUser(t){var i;this.me.sessionManager.resetSessionId(),this.me.userManager.reset(t),this.De=null,this.Be=null,null===(i=this.me._emitter)||void 0===i||i.emit("user:reset")}alias(t,i){var e;if(t&&!Gn(t)){var r=this.me.userManager,n=null!==(e=null!=i?i:r.getDistinctId())&&void 0!==e?e:r.getAnonymousId();n&&!Gn(n)?t!==n?this.me.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.me.userManager.getUserIdentity()}getDeviceId(){return this.me.userManager.getDeviceId()}getUserState(){return this.me.userManager.getUserState()}getDistinctId(){var t;return null!==(t=this.me.userManager.getDistinctId())&&void 0!==t?t:this.me.userManager.getAnonymousId()}getAnonymousId(){return this.me.userManager.getAnonymousId()}}var Jn="_vtilt_consent";class Xn{constructor(t){this.je={},this.ze=!1,this.me=t,this.Ne()}setConsent(t){var i;this.je=e({},this.je,t),this.ze=!0,this.Fe(),null===(i=this.me._emitter)||void 0===i||i.emit("consent:updated",{consent:this.je})}getConsent(){return e({},this.je)}hasConsent(){return this.ze}setDefaultGranted(){this.ze||(this.je={analytics:!0,marketing:!0,advertising:!0},this.ze=!0)}getConsentProperties(){var t={};return void 0!==this.je.analytics&&(t.$consent_analytics=this.je.analytics),void 0!==this.je.marketing&&(t.$consent_marketing=this.je.marketing),void 0!==this.je.advertising&&(t.$consent_advertising=this.je.advertising),t}reset(){this.je={},this.ze=!1,this.qe()}Ne(){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.je=n,this.ze=!0)}catch(t){}return}}}}Fe(){if(void 0!==N){var t=encodeURIComponent(JSON.stringify(this.je)),i="undefined"!=typeof location&&"https:"===location.protocol?"; Secure":"";N.cookie=Jn+"="+t+"; Max-Age=31536000; path=/; SameSite=Lax"+i}}qe(){void 0!==N&&(N.cookie=Jn+"=; Max-Age=0; path=/")}}class Zn{constructor(t){this.He=new Map,this.We=new Map,this.me=t}register(t){this.He.set(t.name,t)}createInstances(){var t=this,i=this.me.getConfig(),e=function(e,r){return t.We.has(e)||t.Ve(i,r)?0:void lt(()=>{var n=r.FeatureClass.extractConfig(i),s=new r.FeatureClass(t.me,n);t.We.set(e,s)})};for(var[r,n]of this.He)e(r,n)}initAll(){this.createInstances();var t=function(t){lt(()=>{t.isStarted||t.startIfEnabled()})};for(var[,i]of this.We)t(i)}notifyAll(t){var i=function(i){i.onConfigUpdate&&lt(()=>i.onConfigUpdate(t))};for(var[,e]of this.We)i(e)}get(t){return this.We.get(t)}set(t,i){this.We.set(t,i)}getDescriptors(){return this.He}Ve(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.ie=new bn,this.Ge=!1,this.Ke=!1,this.me=t,this.Je(),this.Ge||(this.Xe=setTimeout(()=>this.forceFlush(),5e3))}push(t){this.Ge?this.Ze(t):this.ie.enqueue(t)}markConfigReady(){this.Ke||(this.Ke=!0,this.Qe())}forceFlush(){this.Ye(),this.Z(),this.Ge=!0}Je(){this.Ge=this.Ke}Qe(){this.Je(),this.Ge&&(this.Ye(),this.Z())}Z(){var t=this.ie.takeAll();for(var i of t)this.Ze(i);t.length>0&&this.me.requestQueue.flush()}Ze(t){if(this.Ke){if(this.tr(t.name))return}else this.ir(t.event);this.me.sendRequest(t.url,t.event)}tr(t){var i=this.me.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}}ir(t){"object"==typeof t.payload&&null!==t.payload&&(t.payload.$config_pending=!0)}Ye(){void 0!==this.Xe&&(clearTimeout(this.Xe),this.Xe=void 0)}}var Yn="vt";class ts{constructor(t){void 0===t&&(t={}),this.version=r,this.__loaded=!1,this.er=!1,this.rr=!1,this.nr=[],this.sr=!1,ot().debug("ctor","start"),this._emitter=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.ar.captureInternal(E,{$$client_ingestion_warning_message:t})}}),this.retryQueue=new In({sendRequest:t=>this.lr(t),sendBeacon:t=>this.ur(t)}),this.requestQueue=new Tn(t=>this.hr(t),{flush_interval_ms:3e3}),this.consentManager=new Xn(this),this.ar=new Wn(this),this.dr=new Kn(this),this.vr=new Zn(this),this.cr=new Ln(this),this.pr(),this.cr.onLoad(t=>{this._emitter.emit(pt,{config:t})}),this.gr(),ot().debug("ctor","boot gate installed")}pr(){this.vr.register({name:"HistoryAutocapture",configKey:"capture_pageview",FeatureClass:ge}),this.vr.register({name:"Autocapture",configKey:"autocapture",FeatureClass:or}),this.vr.register({name:"WebVitals",configKey:"capture_performance",FeatureClass:fe}),this.vr.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.vr.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.vr.register({name:"GoogleTagGateway",configKey:"google_tag",disableKey:"disable_google_tag",remoteConfig:{key:"googleTag",map:t=>t},FeatureClass:_n})}gr(){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.rr)return e.apply(t,n);t.nr.push([i,...n])}};for(var e of ts.BOOT_GATED_METHODS)i(e)}mr(){if(!this.rr){for(var t of(this.rr=!0,ot().debug("boot","start"),ts.BOOT_GATED_METHODS))delete this[t];ot().debug("boot","gate removed"),this.__loaded&&!this.sr?(ot().debug("boot","running _runPostBootInit"),this.br()):ot().debug("boot","skipping _runPostBootInit","loaded?",this.__loaded,"postBootDone?",this.sr),ot().debug("boot","flush pendingCalls",this.nr.length),this._execute_array(this.nr),this.nr=[]}}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.vr.createInstances(),this.rr||void 0===N||"interactive"!==N.readyState&&"complete"!==N.readyState||(ot().debug("init","self-boot?",N.readyState),this.mr()),this.rr&&!this.sr&&this.br(),ot().debug("init","postBootInitDone",this.sr),this}br(){if(!this.sr){this.sr=!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._emitter.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.yr(),this.userManager.set_initial_person_info(t.mask_personal_data_properties,t.custom_personal_data_properties),this._r=new Qn({sendRequest:(t,i)=>this.sendRequest(t,i),requestQueue:this.requestQueue,getConfig:()=>this.configManager.getConfig()}),this.vr.initAll(),ot().debug("postBoot","features inited"),this.cr.load(),this.wr(),this.kr();var e=this.configManager.getConfig();!1!==e.capture_pageview&&this.ar.captureInitialPageview(),this.vr.notifyAll(e),this._emitter.emit(ct,{config:e}),ot().debug("postBoot","done"),ot().info("init","SDK ready")}}startAutocapture(){var t=this.vr.get("Autocapture");if(!t){var i=or.extractConfig(this.configManager.getConfig());t=new or(this,i),this.vr.set("Autocapture",t)}t.updateConfig({enabled:!0})}stopAutocapture(){var t=this.vr.get("Autocapture");t&&t.updateConfig({enabled:!1})}isAutocaptureActive(){var t,i;return null!==(i=null===(t=this.vr.get("Autocapture"))||void 0===t?void 0:t.isStarted)&&void 0!==i&&i}getAutocaptureDiagnostics(){var t,i;return null!==(i=null===(t=this.vr.get("Autocapture"))||void 0===t?void 0:t.getDiagnostics())&&void 0!==i?i:null}startSessionRecording(){var t=this.vr.get("SessionRecording");t||(t=new lr(this),this.vr.set("SessionRecording",t)),t.updateConfig({enabled:!0}),t.startIfEnabledOrStop("recording_initialized"),this._emitter.emit(bt)}stopSessionRecording(){var t;null===(t=this.vr.get("SessionRecording"))||void 0===t||t.stop(),this._emitter.emit(yt)}isRecordingActive(){var t;return"active"===(null===(t=this.vr.get("SessionRecording"))||void 0===t?void 0:t.status)}getSessionRecordingId(){var t;return(null===(t=this.vr.get("SessionRecording"))||void 0===t?void 0:t.sessionId)||null}openChat(){var t=this.vr.get("Chat");t?t.open():ot().warn("chat","openChat: feature not available")}closeChat(){var t=this.vr.get("Chat");t?t.close():ot().warn("chat","closeChat: feature not available")}toggleChat(){var t=this.vr.get("Chat");t?t.toggle():ot().warn("chat","toggleChat: feature not available")}showChat(){var t=this.vr.get("Chat");t?t.show():ot().warn("chat","showChat: feature not available")}hideChat(){var t=this.vr.get("Chat");t?t.hide():ot().warn("chat","hideChat: feature not available")}sendChatMessage(t,i){var e=this.vr.get("Chat");e?e.sendMessage(t,i):ot().warn("chat","sendChatMessage: feature not available")}gtag(){for(var t=this.vr.get("GoogleTagGateway"),i=arguments.length,e=new Array(i),r=0;r<i;r++)e[r]=arguments[r];t?t.gtag(...e):this.nr.push(["gtag",...e])}setGoogleUserData(t){var i=this.vr.get("GoogleTagGateway");return i?i.setUserData(t):Promise.resolve()}get featureManager(){return this.vr}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&&Bn(z,null!==(t=i.custom_blocked_useragents)&&void 0!==t?t:[])}capture(t,i,e){this.ar.capture(t,i,e),this._emitter.emit(mt,{event:t,payload:i})}tryCapturePageleave(t){var i,e=null===(i=this.vr.get("Autocapture"))||void 0===i?void 0:i.getMaxScrollDepthPctForPageleave(),r=null!=e?{[D]:e}:void 0;this.ar.tryCapturePageleave(t,r)}identify(t,i,e){this.dr.identify(t,i,e)}setUserProperties(t,i){this.dr.setUserProperties(t,i)}resetUser(t){this.dr.resetUser(t)}alias(t,i){this.dr.alias(t,i)}setConsent(t){this.consentManager.setConsent(t)}getConsent(){return this.consentManager.getConsent()}getUserIdentity(){return this.dr.getUserIdentity()}getDeviceId(){return this.dr.getDeviceId()}getUserState(){return this.dr.getUserState()}getConfig(){return this.configManager.getConfig()}getRemoteConfig(){return this.cr.config}getSessionId(){return this.sessionManager.getSessionId()}getDistinctId(){return this.dr.getDistinctId()}getAnonymousId(){return this.dr.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._r)||void 0===i||i.markConfigReady()),this.vr.notifyAll(r),this._emitter.emit(ft,{config:r})}buildUrl(){return this.buildEndpointUrl("/api/e")}buildEndpointUrl(t){return ht(this.configManager.getConfig(),t)}sendRequest(t,i){this.Sr()&&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)}Sr(){return!!this.configManager.getConfig().token||(this.er||(ot().warn("config","token is required for tracking"),this.er=!0),!1)}hr(t){"sendBeacon"!==t.transport?this.retryQueue.retriableRequest(t):this.ur(t)}lr(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})})})}ur(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})}Cr(t){this.sendRequest(t.url,t.event)}wr(){if(B){var t=()=>{this._r.forceFlush(),this.requestQueue.unload(),this.retryQueue.unload()};Rt(B,"beforeunload",t),Rt(B,"pagehide",()=>{this.ar.tryCapturePageleave("pagehide"),t()}),N&&Rt(N,"visibilitychange",()=>{N&&("hidden"===N.visibilityState?this.ar.tryCapturePageleave("visibility_hidden"):"visible"===N.visibilityState&&this.ar.resetPageleaveDedupe())})}}kr(){this.requestQueue.enable()}yr(){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.ar.setVtPersonId(r.trim()),e.searchParams.delete("vt")),(null==n?void 0:n.trim())&&(this.Mr(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)}}})}Mr(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]&&lt(()=>this[i](...e))}})}_dom_loaded(){this.kr()}}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.mr(),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;
2
2
  //# sourceMappingURL=main.js.map