diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d4f2eac..bef0d993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 19.9.2 + +### Breaking changes +- None. + +### Fixed +- In product tours, a sender photo that is not square is centered in its round frame instead of cropped to the top left. ([#242](https://github.com/GleapSDK/JavaScript-SDK/pull/242)) + ## 19.9.1 ### Breaking changes diff --git a/build/browser/index.js b/build/browser/index.js index 061bf63d..400f5ffb 100644 --- a/build/browser/index.js +++ b/build/browser/index.js @@ -1,2 +1,2 @@ -(()=>{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};(()=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){r=function(){return t};var e,t={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new O(r||[]);return a(i,"_invoke",{value:A(e,n,s)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var f="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};d(x,l,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(M([])));C&&C!==o&&i.call(C,l)&&(x=C);var E=k.prototype=b.prototype=Object.create(x);function I(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function r(o,a,s,l){var c=h(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==n(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,l)}),(function(e){r("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return r("throw",e,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function A(t,n,r){var o=f;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=T(s,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=h(t,n,r);if("normal"===c.type){if(o=r.done?v:g,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=v,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=h(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),F(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;F(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nJb});var s=function(e,t,n){var r,o,i,a,s,l,c;switch(e){case"meta":null===(r=n.onMeta)||void 0===r||r.call(n,t);break;case"token":null===(o=n.onToken)||void 0===o||o.call(n,t);break;case"tool_start":null===(i=n.onToolStart)||void 0===i||i.call(n,t);break;case"tool_end":null===(a=n.onToolEnd)||void 0===a||a.call(n,t);break;case"done":null===(s=n.onDone)||void 0===s||s.call(n,t);break;case"error":null===(l=n.onError)||void 0===l||l.call(n,t);break;case"handoff":null===(c=n.onHandoff)||void 0===c||c.call(n,t)}},l=function(){var e,t=(e=r().mark((function e(t,n){var i,a,l,c,u,d,p,h,f,g,m,v,y,b,w,k,x,S;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.body){e.next=3;break}return null===(i=n.onError)||void 0===i||i.call(n,{message:"No response body."}),e.abrupt("return");case 3:a=t.body.getReader(),l=new TextDecoder,c="",u="",d="",e.prev=8;case 9:return e.next=12,a.read();case 12:if(h=e.sent,f=h.done,g=h.value,!f){e.next=17;break}return e.abrupt("break",24);case 17:c+=l.decode(g,{stream:!0}),m=c.split("\n"),c=null!==(p=m.pop())&&void 0!==p?p:"",v=o(m);try{for(v.s();!(y=v.n()).done;)if(b=y.value,(w=b.replace(/\r$/,"")).startsWith("event: "))u=w.slice(7).trim();else if(w.startsWith("data: "))d+=(d?"\n":"")+w.slice(6);else if(""===w){if(u&&d)try{k=JSON.parse(d),s(u,k,n)}catch(r){}u="",d=""}}catch(C){v.e(C)}finally{v.f()}e.next=9;break;case 24:if(u&&d)try{x=JSON.parse(d),s(u,x,n)}catch(E){}e.next=30;break;case 27:e.prev=27,e.t0=e.catch(8),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&(null===(S=n.onError)||void 0===S||S.call(n,{message:"Stream interrupted."}));case 30:case"end":return e.stop()}}),e,null,[[8,27]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,l,"next",e)}function l(e){a(i,r,o,s,l,"throw",e)}s(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),F(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;F(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t=200&&i.status<300)try{r(i.responseText?JSON.parse(i.responseText):null)}catch(e){o({status:i.status,statusText:"JSON Parse Error",error:e})}else o({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){return o({status:0,statusText:"Network Error"})},i.send(n?JSON.stringify(n):null)}))}},{key:"streamAgent",value:(o=p().mark((function e(t,n,r,o){var i,a,s,c,u,d,h;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.executeInFlight.get(t)){e.next=2;break}return e.abrupt("return");case 2:if(this.executeInFlight.set(t,!0),i=this._getApiUrl()){e.next=8;break}return this.executeInFlight.delete(t),null===(a=r.onError)||void 0===a||a.call(r,{message:"Gleap API URL not configured."}),e.abrupt("return");case 8:return s="".concat(i,"/v3/shared/agents/").concat(t,"/stream"),c=f(f({},this._getHeaders()),{},{Accept:"text/event-stream"}),e.prev=10,e.next=13,fetch(s,{method:"POST",headers:c,body:JSON.stringify(n),signal:o});case 13:u=e.sent,e.next=23;break;case 16:if(e.prev=16,e.t0=e.catch(10),this.executeInFlight.delete(t),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)){e.next=21;break}return e.abrupt("return");case 21:return null===(d=r.onError)||void 0===d||d.call(r,{message:"Failed to connect to agent."}),e.abrupt("return");case 23:if(u.ok){e.next=27;break}return this.executeInFlight.delete(t),null===(h=r.onError)||void 0===h||h.call(r,{message:"Server error: ".concat(u.status)}),e.abrupt("return");case 27:return e.next=29,l(u,r);case 29:n.conversationId&&this._invalidateMessagesCache(n.conversationId),this.executeInFlight.delete(t);case 31:case"end":return e.stop()}}),e,this,[[10,16]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){g(i,n,r,a,s,"next",e)}function s(e){g(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e,t,n,r){return i.apply(this,arguments)})},{key:"executeAgent",value:function(e,t){var n=this;if(this.executeInFlight.get(e))return Promise.reject(new Error("Agent execution already in progress."));var r=this._getApiUrl();if(!r)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));this.executeInFlight.set(e,!0);var o="".concat(r,"/v3/shared/agents/").concat(e,"/execute");return this._makeRequest("POST",o,t).then((function(e){return t.conversationId&&n._invalidateMessagesCache(t.conversationId),null!=e&&e.conversationId&&n._invalidateMessagesCache(e.conversationId),e})).finally((function(){n.executeInFlight.delete(e)}))}},{key:"getConversationMessages",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("kai"===e)return Promise.resolve({messages:[]});var i="".concat(t,":").concat(r,":").concat(o),a=this.messagesCache.get(i);if(a)return a.status===b?Promise.resolve(JSON.parse(JSON.stringify(a.data))):Promise.reject(a.error);if(this.messagesRequests.has(i))return this.messagesRequests.get(i).then((function(e){return JSON.parse(JSON.stringify(e))}));var s=this._getApiUrl();if(!s)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));var l="".concat(s,"/v3/shared/agents/").concat(e,"/conversations/").concat(t,"/messages?limit=").concat(r,"&skip=").concat(o),c=this._makeRequest("GET",l,null).then((function(e){return n.messagesCache.set(i,{status:b,data:e}),JSON.parse(JSON.stringify(e))})).catch((function(e){throw n.messagesCache.set(i,{status:w,error:e}),e})).finally((function(){n.messagesRequests.delete(i)}));return this.messagesRequests.set(i,c),c.then((function(e){return JSON.parse(JSON.stringify(e))}))}},{key:"getConversations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("kai"===e)return Promise.resolve({conversations:[]});var r=this._getApiUrl();return r?this._makeRequest("GET","".concat(r,"/v3/shared/agents/").concat(e,"/conversations?limit=").concat(t,"&skip=").concat(n),null):Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."))}},{key:"_invalidateMessagesCache",value:function(e){var t,n=u(this.messagesCache.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value;r.startsWith(e+":")&&this.messagesCache.delete(r)}}catch(s){n.e(s)}finally{n.f()}var o,i=u(this.messagesRequests.keys());try{for(i.s();!(o=i.n()).done;){var a=o.value;a.startsWith(e+":")&&this.messagesRequests.delete(a)}}catch(s){i.e(s)}finally{i.f()}}}],r=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],n&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();v(k,"instance",null);const x=k;function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function C(e,t){for(var n=0;n=200&&i.status<300)try{var e=i.responseText?JSON.parse(i.responseText):null;r(e)}catch(t){o({status:i.status,statusText:"JSON Parse Error",responseText:i.responseText,error:t})}else o({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){o({status:0,statusText:"Network Error",responseText:null})},i.send(n?JSON.stringify(n):null)}))}},{key:"_createCacheKey",value:function(e,t){return t?"".concat(e,"::").concat(t):e}},{key:"validateChecklist",value:function(e,t){var n=this,r=this._createCacheKey(e,t),o=this.validationCache.get(r);if(o)return o.status===D?Promise.resolve(o.internalId):Promise.reject(o.error);if(this.validationRequests.has(r))return this.validationRequests.get(r);var i=this._getApiUrl();if(!i){var a=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.validationCache.set(r,{status:A,error:a}),Promise.reject(a)}var s="".concat(i,"/outbound/checklists?").concat(this._getQueryParams()),l=this._makeRequest("POST",s,{outboundId:e,sharedKey:t}).then((function(e){if(e&&e.id)return n.validationCache.set(r,{status:D,internalId:e.id}),e.id;var t=new Error("Validation response missing checklist ID.");throw n.validationCache.set(r,{status:A,error:e||t}),t})).catch((function(e){throw n.validationCache.set(r,{status:A,error:e}),e})).finally((function(){n.validationRequests.delete(r)}));return this.validationRequests.set(r,l),l}},{key:"fetchChecklist",value:function(e){var t=this,n=this.fetchCache.get(e);if(n)return n.status===D?Promise.resolve(JSON.parse(JSON.stringify(n.data))):Promise.reject(n.error);if(this.fetchRequests.has(e))return this.fetchRequests.get(e).then((function(e){return JSON.parse(JSON.stringify(e))}));var r=this._getApiUrl();if(!r){var o=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.fetchCache.set(e,{status:A,error:o}),Promise.reject(o)}var i="".concat(r,"/outbound/checklists/").concat(e,"?convertTipTap=true&").concat(this._getQueryParams()),a=this._makeRequest("GET",i,null).then((function(n){if(n)return t.fetchCache.set(e,{status:D,data:n}),JSON.parse(JSON.stringify(n));var r=new Error("Empty response received for checklist fetch.");throw t.fetchCache.set(e,{status:A,error:n||r}),r})).catch((function(n){throw t.fetchCache.set(e,{status:A,error:n}),n})).finally((function(){t.fetchRequests.delete(e)}));return this.fetchRequests.set(e,a),a.then((function(e){return JSON.parse(JSON.stringify(e))}))}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();E(T,"instance",null);const L=T;function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function O(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],t=wv.getInstance();t.isOpened()?(t.hideWidget(),this.updateRedDot(this.showingRedDot)):(t.setAppMode("widget"),t.showWidget(),this.updateRedDot(!1),e&&t.focusFrame())}},{key:"restoreFocus",value:function(){if(this.feedbackButton&&this.feedbackButton.isConnected)try{this.feedbackButton.focus({preventScroll:!0})}catch(e){}}},{key:"injectFeedbackButton",value:function(){var e=this;if(!this.injectedFeedbackButton){this.injectedFeedbackButton=!0;var t=document.createElement("div");t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.addEventListener("click",(function(){e.feedbackButtonPressed()})),t.addEventListener("keydown",(function(t){"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),e.feedbackButtonPressed(!0))})),this.attachPressAnimation(t),document.body.appendChild(t),this.feedbackButton=t,this.updateFeedbackButtonState()}}},{key:"attachPressAnimation",value:function(e){var t="bb-feedback-button--pressed",n="bb-feedback-button--springing",r=null,o=function(){clearTimeout(r),e.classList.remove(n),e.classList.add(t)},i=function(){e.classList.contains(t)&&(e.classList.remove(t),e.classList.add(n),r=setTimeout((function(){e.classList.remove(n)}),550))};window.PointerEvent?(e.addEventListener("pointerdown",o),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",i),this.removePressListeners=function(){document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i)}):(e.addEventListener("mousedown",o),e.addEventListener("touchstart",o,{passive:!0}),document.addEventListener("mouseup",i),document.addEventListener("touchend",i),document.addEventListener("touchcancel",i),this.removePressListeners=function(){document.removeEventListener("mouseup",i),document.removeEventListener("touchend",i),document.removeEventListener("touchcancel",i)})}},{key:"updateNotificationBadge",value:function(e){var t=document.querySelector(".bb-notification-bubble");if(t){var n="bb-notification-bubble--hidden";e>0&&!wv.getInstance().isOpened()?(t.classList.remove(n),t.innerText=e):t.classList.add(n)}}},{key:"refresh",value:function(){document.querySelector(".bb-feedback-button")?(this.updateFeedbackButtonText(),this.updateFeedbackButtonState()):(this.injectedFeedbackButton=!1,this.feedbackButton=null,this.buttonHidden=null,this.lastButtonIcon=null,this.injectFeedbackButton())}},{key:"updateFeedbackButtonText",value:function(){var t=Rd.getInstance().getFlowConfig();if(t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT){var n=document.querySelector(".bb-feedback-button-classic");n&&(n.innerText=t.widgetButtonText)}}},{key:"updateFeedbackButtonState",value:function(){var t=this;if(or.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=Rd.getInstance().getFlowConfig(),r="";r=n.buttonLogo?''):ve("button","#fff");var o=["bb-feedback-button--pressed","bb-feedback-button--springing"].filter((function(e){return t.feedbackButton.classList.contains(e)}));this.feedbackButton.className="bb-feedback-button gleap-font rr-block",o.forEach((function(e){return t.feedbackButton.classList.add(e)})),this.feedbackButton.setAttribute("dir",ub.getInstance().isRTLLayout?"rtl":"ltr");var i=wv.getInstance().isOpened();this.feedbackButton.setAttribute("aria-expanded",i?"true":"false"),this.feedbackButton.setAttribute("aria-label",n.widgetButtonText&&"".concat(n.widgetButtonText).trim()||"Open support chat"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT?(this.feedbackButton.classList.add("bb-feedback-button--classic-button-style"),this.feedbackButton.innerHTML='
').concat(n.widgetButtonText,"
")):r!==this.lastButtonIcon&&(this.feedbackButton.innerHTML='
'.concat(r).concat(ve("arrowdown","#fff"),'
')),this.lastButtonIcon=r;var a=!1;null===e.getInstance().buttonHidden?n.feedbackButtonPosition===e.FEEDBACK_BUTTON_NONE&&(a=!0):e.getInstance().buttonHidden&&(a=!0),a&&this.feedbackButton.classList.add("bb-feedback-button--disabled"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_BOTTOM_LEFT&&this.feedbackButton.classList.add("bb-feedback-button--bottomleft");var s=wv.getInstance().appMode;wv.getInstance().isOpened()&&"survey_page"!==s&&this.feedbackButton.classList.add("bb-feedback-button--open"),"survey"!==s&&"survey_full"!==s&&"survey_web"!==s||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||Bm.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&O(t.prototype,n),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e,t,n){return t=function(e){var t=function(e,t){if("object"!=B(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==B(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}M(R,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),M(R,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),M(R,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),M(R,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),M(R,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),M(R,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),M(R,"instance",void 0);var _=/^[A-Za-z0-9+/=_-]{1,256}$/,U=function(e){if("string"!=typeof e)return null;var t=e.trim();return _.test(t)?t:null},H=function(){try{if("undefined"==typeof document)return null;var e=document.currentScript;if(e){var t=U(e.nonce||e.getAttribute("nonce"));if(t)return t}var n=document.querySelector('script[src*="sdk.gleap.io"]');if(n)return U(n.nonce||n.getAttribute("nonce"))}catch(r){}return null}(),q=null,z=function(){return q||H},W=function(e){var t=z();if(!t||!e)return e;try{e.setAttribute("nonce",t),e.nonce=t}catch(n){}return e},G="https://docs.gleap.ai/documentation/javascript/content-security-policy",V=new Set,$="gleap-frame-route-failed",J=function(e){return"string"==typeof e&&(0===e.indexOf("script-src")||0===e.indexOf("style-src"))},K=function(e,t){if(e&&t){var n,r=!1,o=function(){if(!r){r=!0;try{e.src=t}catch(n){}}};if(!function(){try{var e,t=null===(e=window.location)||void 0===e?void 0:e.protocol;return"http:"===t||"https:"===t}catch(n){return!1}}())return o();try{if(!e.contentDocument)return o()}catch(a){return o()}try{var i=new URL(t);n=i.origin+"/"}catch(a){return o()}fetch(t,{mode:"cors",credentials:"omit"}).then((function(e){if(!e.ok)throw new Error("Bootstrap fetch failed: "+e.status);return e.text()})).then((function(r){var i=r.replace(/(\s(?:href|src)\s*=\s*["'])\/([^"'/][^"']*)/g,"$1"+n+"$2"),s=z(),l=function(e,t){return t?e.replace(/<(script|style)\b(?![^>]*\snonce\s*=)/gi,'<$1 nonce="'+t+'"'):e}(i,s),c=s?' nonce="'+s+'"':"",u="/",d="/";try{var p=new URL(t);u=(d=p.pathname)+p.search+p.hash}catch(a){}var h,f,g="try{history.replaceState(null,"",'+JSON.stringify(u)+");}catch(e){}try{if(location.pathname!=="+JSON.stringify(d)+"&&window.frameElement){window.frameElement.dispatchEvent(new Event("+JSON.stringify($)+"));}}catch(e){}<\/script>";h=//i.test(l)?l.replace(/<\/head>/i,g+""):l;try{f=e.contentDocument}catch(a){return o()}if(!f)return o();try{e.addEventListener($,o,{once:!0})}catch(a){}try{f.open(),function(e,t){var n=!1;try{e.addEventListener("securitypolicyviolation",(function(e){if(e&&"report"!==e.disposition){var r=e.blockedURI||"a resource",o=e.effectiveDirective||e.violatedDirective||"unknown directive",i=r+"|"+o;V.has(i)||(V.add(i),console.warn("Gleap: Your page's Content-Security-Policy blocked "+r+" ("+o+"). Gleap may not appear or work correctly until your policy allows it \u2014 see "+G)),t&&!n&&J(o)&&"string"==typeof r&&0===r.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(f,{baseHref:n,onBlocked:o}),f.write(h),f.close()}catch(a){o()}})).catch((function(e){V.has(t)||(V.add(t),console.warn("Gleap: Loading "+t+" failed ("+(e&&e.message?e.message:"network error")+") \u2014 falling back to loading the frame directly. If Gleap does not appear, your Content-Security-Policy may be blocking it (most often a missing connect-src entry) \u2014 see "+G)),o()}))}},X=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400;return new Promise((function(r,o){var i=0===e.indexOf("data:image/jpeg"),a=new Image;a.src=e,a.onerror=function(){o()},a.onload=function(){var e=document.createElement("canvas"),o=t,s=n;t>a.width/1.5&&(o=a.width/1.5),n>a.height/1.5&&(s=a.height/1.5);var l=a.width,c=a.height;l>c?l>o&&(c*=o/l,l=o):c>s&&(l*=s/c,c=s),e.width=l,e.height=c,e.getContext("2d").drawImage(a,0,0,l,c),r(i?e.toDataURL("image/jpeg",.7):e.toDataURL())}}))},Y=/(android|iphone|ipod|ipad|blackberry|iemobile|opera mini|webos)/i,Z=function(){return Q()?"mobile":"desktop"},Q=function(){if("undefined"==typeof window)return!1;try{var e="undefined"!=typeof navigator?navigator:void 0;if(null!=e&&e.userAgentData&&"boolean"==typeof e.userAgentData.mobile&&null!==e.userAgentData.mobile)return e.userAgentData.mobile;if(e&&Y.test(e.userAgent||e.vendor||""))return!0;if((null==e?void 0:e.maxTouchPoints)>1&&window.matchMedia){var t=window.matchMedia("(hover: none) and (pointer: coarse)");if(null!=t&&t.matches)return!0}}catch(n){}return!1},ee=function(e){if(!e)return{};if("string"==typeof e||e instanceof String)try{return JSON.parse(e)}catch(t){return{}}return e},te=function(e){if("string"==typeof e){var t=e.trim();return t.length>0?t:null}return"number"==typeof e?Number.isFinite(e)?String(e):null:"bigint"==typeof e?String(e):null},ne=function(e){try{if(!e||"object"!==B(e)||!("company"in e))return e;var t=e.company,n=function(e){for(var t=1;t3&&void 0!==arguments[3]&&arguments[3];try{var o="";if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),o="; expires="+i.toUTCString()}var a="";r&&(a="; SameSite=Lax"+("https:"===window.location.protocol?"; Secure":"")),document.cookie=e+"="+(t||"")+o+"; path=/"+ie("domain")+a}catch(s){}},ce=function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n=160?"#000000":"#ffffff"},ve=function(e,t){return"button"===e?'':"drag"===e?'\x3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--\x3e':"unmute"===e?'':"mute"===e?'':"replay"===e?'\n \n ':"dismiss"===e?'':"blur"===e?'\n \n':"pen"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n':"rect"===e?'\n \n \n \n \n \n \n \n \n \n \n':"pointer"===e?'\n \n ':"clip"===e?'\n \n \n \n \n \n':"mic"===e?'\n \n \n \n \n ':"camera"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n':"recorderon"===e?'\n \n \n \n \n \n \n \n \n \n \n \n':"recorderoff"===e?'\n \n \n \n \n \n \n \n \n ':"arrowdown"===e?'\n \n '):"arrowleft"===e?'\n \n '):"close"===e?'\n \n '):"undo"===e?'\n \n \n \n \n \n \n \n \n \n ':"circle-dot"===e?''):"circle-question"===e?''):"circle-info"===e?''):"circle-exclamation"===e?''):"circle-up"===e?''):"circle-right"===e?''):""};function ye(e){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ye(e)}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function we(e,t){for(var n=0;n=a-i;++s)n[i]=t[s],Te(e,t,n,s+1,o,i+1,a);else e.push(n.slice(0,i).join(""))}function Le(e){return function(e){if(Array.isArray(e))return Fe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:["id","class","length"];return Le(e.attributes).reduce((function(e,n){return t.indexOf(n.nodeName)>-1||e.push("[".concat(n.nodeName,'="').concat(n.value,'"]')),e}),[])}(e,n)},Class:Ae,ID:De};return t.reduce((function(t,n){return t[n]=r[n](e),t}),{})}function Ue(e,t){try{var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}catch(r){return!1}}function He(e,t){return t.find(Ue.bind(null,e))}function qe(e,t,n){var r=function(e,t){for(var n=[],r=e.length,o=[],i=1;i<=t;++i)Te(n,e,o,0,r-1,0,i);return n}(t,3),o=He(e,r);return Boolean(o)||Boolean(n)&&(o=He(e,r=r.map((function(e){return n+e}))),Boolean(o))?o:null}function ze(e,t,n,r){var o,i=_e(e,t,n);r&&r instanceof RegExp&&(i.ID=r.test(i.ID)?null:i.ID,i.Class=i.Class.filter((function(e){return!r.test(e)})));var a,s=je(t);try{for(s.s();!(a=s.n()).done;){var l=a.value,c=i.ID,u=i.Tag,d=i.Class,p=i.Attributes,h=i.NthChild;switch(l){case"ID":if(Boolean(c)&&Ue(e,c))return c;break;case"Tag":if(Boolean(u)&&Ue(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(o=qe(e,d,u)))return o;break;case"Attributes":if(Boolean(p)&&p.length&&(o=qe(e,p,u)))return o;break;case"NthChild":if(Boolean(h))return h}}}catch(f){s.e(f)}finally{s.f()}return"*"}function We(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.selectorTypes,o=void 0===r?["ID","Class","Tag","NthChild"]:r,i=n.attributesToIgnore,a=void 0===i?["id","class","length"]:i,s=n.excludeRegex,l=void 0===s?null:s,c=[],u=function(e){for(var t=[],n=e;Me(n);)t.push(n),n=n.parentNode;return t}(e),d=je(u);try{for(d.s();!(t=d.n()).done;){var p=ze(t.value,o,a,l);Boolean(p)&&c.push(p)}}catch(y){d.e(y)}finally{d.f()}for(var h=[],f=0,g=c;f ");if(Ne(e,v))return v}return null}var Ge=/^[A-Za-z_][\w-]*\s*[~|^$*]?=\s*(?:"[^"]*"|'[^']*'|[^\s"'\]]+)$/,Ve={},$e=function(e,t){if("string"!=typeof e||!e.trim())return null;for(var n=function(e){var t=e.trim(),n=[t];return Ge.test(t)&&n.push("[".concat(t,"]")),n.push(t.replace(/(#[^#\s]+)/g,(function(e){return e.replace(/:/g,"\\:")}))),n}(e),r=0;r=0},Xe=function(e,t){var n=$e(e,(function(e){return t.querySelectorAll(e)}));return n?n.result:[]},Ye=function(e,t){for(var n=e.split(Je),r=[t],o=0;o1&&void 0!==arguments[1]?arguments[1]:document;if(Ke(e))return Ye(e,t)[0]||null;var n=$e(e,(function(e){return t.querySelector(e)}));return n?n.result:null},Qe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Ke(e)?Ye(e,t):Xe(e,t)},et=function e(t,n){if(Ke(n)){for(var r=n.split(Je),o=t,i=r.length-1;i>=0;i--){if(!o||!e(o,r[i]))return!1;var a="function"==typeof o.getRootNode?o.getRootNode():null;o=a&&a.host?a.host:null}return!0}var s=$e(n,(function(e){return t.matches(e)}));return!!s&&s.result},tt=function(e){return'(?:[^"]*[^a-zA-Z0-9])?(?:'.concat(e.join("|"),")")},nt=new RegExp(['^(?:#|\\[id=")'.concat(tt(["v-\\d+",":r[0-9a-z]+:","\xabr[0-9a-z]+\xbb","_r_[0-9a-z]+_","(?:radix|headlessui|reach|floating-ui|mantine)-","mui-\\d+","(?:mat|cdk)-[a-z-]+-?\\d+","(?:downshift|react-select|tippy|uid|uuid)-\\d+","ember\\d+","BVID__\\d+","ext-gen\\d+","yui_\\d","[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"])),"^\\.".concat(tt(["css-[a-z0-9]*\\d[a-z0-9]*","sc-(?=[a-zA-Z0-9]*[A-Z])[a-zA-Z0-9]{5,}","jsx-\\d+","mantine-[a-z0-9]*\\d[a-z0-9]*","m_[0-9a-f]{8}$","__m__-","_r_[0-9a-z]+_"])),"^\\.[^.]*".concat("__(?=[A-Za-z0-9]{4,}$)(?=[A-Za-z0-9]*[0-9])(?=[A-Za-z0-9]*[A-Z])[A-Za-z0-9]+$")].join("|")),rt=function(e){var t=e&&"function"==typeof e.getRootNode?e.getRootNode():null;return t&&"function"==typeof t.querySelectorAll?t:document},ot=function(e,t){if(!e||"*"===e)return!1;try{var n=rt(t).querySelectorAll(e);return 1===n.length&&n[0]===t}catch(r){return!1}},it=/\d{2,}/,at=function(e){return e.replace(/\d+/g,"#")},st=function(e){return e.match(/(?:^\d|:)/)?'[id="'.concat(e,'"]'):"#".concat(e)},lt=["data-testid","data-test-id","data-test","data-cy","data-qa","name"],ct=function(e,t){var n=t(e),r=[];try{var o=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t={},n=e.querySelectorAll("[id]"),r=0;r1?e.concat(t[n]):e}),[])}(rt(e)),i="function"==typeof e.getAttribute?e.getAttribute("id"):null;i&&o.indexOf(i)<0&&!nt.test(st(i))&&r.push(st(i)),r.push.apply(r,function(e){var t=(e.tagName||"").toLowerCase();return lt.reduce((function(n,r){var o="function"==typeof e.getAttribute?e.getAttribute(r):null;if(!o||nt.test("#".concat(o)))return n;var i=o.replace(/["\\]/g,"\\$&");return n.concat(["".concat(t,"[").concat(r,'="').concat(i,'"]'),"[".concat(r,'="').concat(i,'"]')])}),[])}(e));var a=o.map((function(e){return st(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})),s=a.length?new RegExp("".concat(nt.source,"|^(?:").concat(a.join("|"),")$")):nt;r.push(t(e,{excludeRegex:s}))}catch(c){}for(var l=0;l2&&void 0!==arguments[2]?arguments[2]:We,r=rt(e);return r!==document&&r.host?"".concat(dt(r.host,n)," ").concat(Je," ").concat(t):t},dt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;return ut(e,ct(e,t),t)};function pt(e){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(e)}function ht(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0])||r(t.gleapCollapseUI,e)&&r(t.gleapFrameContainer,n))&&(t.gleapCollapseUI&&t.gleapCollapseUI.classList.toggle(e),t.gleapFrameContainer&&t.gleapFrameContainer.classList.toggle(n))})),It(this,"injectCollapseUI",(function(){if(!t.injectedCollapseUI){t.injectedCollapseUI=!0;var e=document.createElement("div");e.className="gleap-admin-collapse-ui",e.innerHTML='
\n '.concat(ve("arrowdown"),"\n
"),document.body.appendChild(e),t.gleapCollapseUI=e,e.addEventListener("click",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t.toggleCollapseUI()}))}})),It(this,"injectFrame",(function(){var e;if(!t.injectedFrame){t.injectedFrame=!0;var n=document.createElement("div");n.className="gleap-admin-frame-container",n.innerHTML=''),document.body.appendChild(n),t.gleapFrameContainer=n,t.gleapFrame=document.querySelector(".gleap-admin-frame")}}))}var t,n,r;return t=e,n=[{key:"logCurrentPage",value:function(){var e=window.location.href;e&&e!==this.lastUrl&&(this.lastUrl=e,this.sendMessageToTourBuilder({name:"page-changed",data:{page:e}}))}},{key:"startPageListener",value:function(){var e=this;setInterval((function(){e.logCurrentPage()}),1e3)}},{key:"initAdminHelper",value:function(){var e=this;this.initialized=!0,Ry.getInstance().disable(),Pr.getInstance().disable(),$v.getInstance().disable(),$b.close(),$b.showFeedbackButton(!1),e.adminHelper=new yt;try{e.adminHelper.onElementPicked=function(t){e.toggleCollapseUI(!0),e.sendMessageToTourBuilder({name:"element-picked",data:{selector:t}})}}catch(t){console.log(t)}e.injectFrame(),e.injectCollapseUI(),e.setFrameHeight("loading")}},{key:"setFrameHeight",value:function(e){if(this.gleapFrameContainer){var t="";t="picker"===e||"navigate"===e?"65px":"editor"===e?"100vh":"0px",this.gleapFrameContainer.style.height=t}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!window.gleapAdminDisabled){var t=this;window.addEventListener("message",(function(n){if(wt(n.origin))try{var r=JSON.parse(n.data);if("admin"===r.type&&("load"===r.name&&(t.adminOrigin||(t.adminOrigin=kt(n.origin)),t.configData=r.data,t.initAdminHelper()),"smartlink-search-result"===r.name&&e.sendMessageToTourBuilder({name:"smartlink-search-result",data:r.data}),"translate-complete"===r.name&&e.sendMessageToTourBuilder({name:"translate-complete",data:r.data})),"tourbuilder"===r.type){var o;if("loaddata"===r.name&&e.sendMessageToTourBuilder({name:"data",data:Ct(Ct({},t.configData),{},{currentPage:window.location.href})}),"highlight-element"===r.name&&(document.querySelectorAll(".gleap-admin-highlight").forEach((function(e){e.classList.remove("gleap-admin-highlight")})),t.shadowHighlight&&(t.shadowHighlight.style.removeProperty("box-shadow"),t.shadowHighlight=null),null!=r&&null!==(o=r.data)&&void 0!==o&&o.selector)){var i,a=Ze(null==r||null===(i=r.data)||void 0===i?void 0:i.selector);if(a){a.classList.add("gleap-admin-highlight");var s=a.getRootNode();s!==document&&s.host&&(a.style.setProperty("box-shadow","0px 0px 0px 4px red"),t.shadowHighlight=a)}}if("smartlink-search"===r.name&&e.sendMessage({name:"smartlink-search",data:r.data}),"product-tour-started"===r.name&&e.sendMessage({name:"product-tour-started",data:r.data}),"translate"===r.name&&e.sendMessage({name:"translate",data:r.data}),"save"===r.name&&e.sendMessage({name:"save",data:r.data}),"update-steps"===r.name&&e.sendMessage({name:"update-steps",data:r.data}),"click"===r.name)try{var l;null===(l=Ze(r.data.selector))||void 0===l||l.click()}catch(c){console.log(c)}"status-changed"===r.name&&(t.status=r.data,e.setFrameHeight(t.status),t.adminHelper.stopPicker(),"picker"===t.status&&t.adminHelper.startPicker())}}catch(u){}})),this.sendMessage({name:"init"}),this.startPageListener()}}},{key:"sendMessage",value:function(e){try{window&&window.opener&&window.opener.postMessage(JSON.stringify(Ct(Ct({},e),{},{type:"admin"})),this.adminOrigin||"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(Ct(Ct({},e),{},{type:"tourbuilder"})),kt(this.adminOrigin))}catch(t){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Et(t.prototype,n),r&&Et(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Tt(e){return Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(e)}function Lt(){Lt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new L(r||[]);return o(a,"_invoke",{value:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(F([])));x&&x!==n&&r.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(o,i,a,s){var l=d(e[o],e,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Tt(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=f;var c=d(t,n,r);if("normal"===c.type){if(o=r.done?g:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function D(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,D(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function F(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Ft(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._agentId=t.agentId||"kai",this._context=t.context||null,this._onChange=t.onChange||null,this._onError=t.onError||null,this._onReplyReceived=t.onReplyReceived||null,this._onConversationCreated=t.onConversationCreated||null,this._onToken=t.onToken||null,this._messages=[],this._conversationId=t.conversationId||null,this._isExecuting=!1,this._error=null,this._destroyed=!1,this._abortController=null;try{this._networkManager=x.getInstance()}catch(n){this._networkManager=null}}var t,n,r,o,i;return t=e,n=[{key:"sendMessage",value:(o=Lt().mark((function e(t){var n,r,o,i,a,s,l,c=this;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=(t||"").trim())&&!this._isExecuting&&!this._destroyed){e.next=3;break}return e.abrupt("return");case 3:return this._messages=[].concat(Pt(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),r="stream-".concat(Date.now()),this._messages=[].concat(Pt(this._messages),[{id:r,role:"assistant",content:"",createdAt:(new Date).toISOString(),isStreaming:!0}]),this._isExecuting=!0,this._error=null,this._notify(),o="kai"===this._agentId,i=o?this._messages.filter((function(e){return!e.isStreaming&&e.content})).map((function(e){return{role:e.role,content:e.content}})):[{role:"user",content:n}],a={messages:i},this._conversationId&&(a.conversationId=this._conversationId),this._context&&(a.additionalContext=this._context),this._abortController=new AbortController,s=!this._conversationId,l=this._messages.length-1,e.next=19,this._networkManager.streamAgent(this._agentId,a,{onMeta:function(e){c._destroyed||(e.conversationId&&(c._conversationId=e.conversationId,c._networkManager._invalidateMessagesCache(e.conversationId),s&&c._onConversationCreated&&c._onConversationCreated(e.conversationId)),e.runId&&c._messages[l]&&(c._messages[l]=Ot(Ot({},c._messages[l]),{},{id:e.runId})))},onToken:function(e){if(!c._destroyed){var t=c._messages[l];t&&(t.content+=e.content||""),c._notify(),c._onToken&&c._onToken(e)}},onDone:function(e){if(!c._destroyed){var t=c._messages[l];t&&(t.isStreaming=!1,e.response&&!t.content&&(t.content=e.response)),c._isExecuting=!1,c._abortController=null,c._notify(),c._onReplyReceived&&c._onReplyReceived(e)}},onError:function(e){if(!c._destroyed){var t=c._messages[l];t&&!t.content?c._messages.splice(l,1):t&&(t.isStreaming=!1),c._isExecuting=!1,c._error=e,c._abortController=null,c._notify(),c._onError&&c._onError(e)}},onToolStart:function(){},onToolEnd:function(){}},this._abortController.signal);case 19:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){Nt(i,n,r,a,s,"next",e)}function s(e){Nt(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"cancelStream",value:function(){this._abortController&&(this._abortController.abort(),this._abortController=null),this._messages=this._messages.map((function(e){return e.isStreaming?Ot(Ot({},e),{},{isStreaming:!1}):e})),this._messages=this._messages.filter((function(e){return e.content||"user"===e.role})),this._isExecuting=!1,this._notify()}},{key:"clearMessages",value:function(){this._messages=[],this._conversationId=null,this._isExecuting=!1,this._error=null,this.cancelStream(),x.getInstance().clearCache(),this._notify()}},{key:"setContext",value:function(e){this._context=e}},{key:"getState",value:function(){return{messages:this._messages,isExecuting:this._isExecuting,error:this._error,conversationId:this._conversationId}}},{key:"destroy",value:function(){this.cancelStream(),this._destroyed=!0,this._onChange=null,this._onError=null,this._onReplyReceived=null,this._onConversationCreated=null,this._onToken=null}},{key:"_notify",value:function(){this._onChange&&!this._destroyed&&this._onChange(this.getState())}}],n&&jt(t.prototype,n),r&&jt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const Ut=_t;var Ht=["http:","https:","mailto:","tel:"],qt=["javascript:","vbscript:","data:"],zt=function(e){if("string"!=typeof e||!e.trim())return null;try{return new URL(e,"https://relative.invalid/").protocol.toLowerCase()}catch(t){return null}},Wt=function(e,t){if("string"!=typeof e||!e||"null"===e||"string"!=typeof t)return!1;try{return new URL(t).origin===e}catch(n){return!1}},Gt=function(e,t){try{var n=e.contentWindow,r=n.origin||n.location.origin;return r&&"null"!==r?r:"*"}catch(i){}try{var o=new URL(t).origin;return o&&"null"!==o?o:"*"}catch(i){return"*"}},Vt={eu:{apiUrl:"https://api.gleap.io",wsApiUrl:"wss://ws.gleap.io",realtimeHost:"sockets.gleap.io"},us:{apiUrl:"https://api.us.gleap.ai",wsApiUrl:"wss://ws.us.gleap.ai",realtimeHost:"sockets.us.gleap.ai"}},$t="eu";function Jt(e){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(e)}function Kt(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("flow-started"===e){var n=$b.getInstance();n.setGlobalDataItem("webReplay",null),n.setGlobalDataItem("screenRecordingData",null),n.setGlobalDataItem("screenshotImage",null),n.takeCurrentReplay()}var r=this.getInstance().eventListeners[e];if(r)for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function mn(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function vn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};this.colorScheme=function(e){return e===Fn||e===On?e:Ln}(e),this.lightBackgroundColor=Un(null==t?void 0:t.lightBackgroundColor),this.darkBackgroundColor=Un(null==t?void 0:t.darkBackgroundColor),this.updateWatching(),this.notifyChange()}},{key:"getDashboardConfig",value:function(){try{return Rd.getInstance().rawFlowConfig||null}catch(e){return null}}},{key:"getColorScheme",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig(),n=(e=null==t?void 0:t.colorScheme,-1!==Mn.indexOf(e)?e:Tn);return n===Tn?Tn:this.colorScheme||n}},{key:"hasDarkPalette",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig();return!!this.darkBackgroundColor||!!e&&Pn.some((function(t){var n=Dn(t,2)[1];return null!==Un(e[n])}))}},{key:"getActiveColorScheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig(),t=this.getColorScheme(e),n=null;return t===Ln?n=this.detectedScheme||$n():t!==Fn&&t!==On||(n=t),n!==On||this.hasDarkPalette(e)?n:null}},{key:"applyToFlowConfig",value:function(e){var t=this.getActiveColorScheme(e);if(!e||!t)return e;if(t===Fn)return this.lightBackgroundColor?Sn(Sn({},e),{},{backgroundColor:this.lightBackgroundColor}):e;var n=Sn({},e);return Pn.forEach((function(t){var r=Dn(t,2),o=r[0],i=r[1],a=Un(e[i]);a&&(n[o]=a)})),this.darkBackgroundColor&&(n.backgroundColor=this.darkBackgroundColor),Rn.forEach((function(t){var r=Dn(t,2),o=r[0],i=r[1],a=e[i];null!=a&&(n[o]=a)})),n}},{key:"applyToChatbarStyle",value:function(e){var t=this.getActiveColorScheme();if(!t)return e;var n=!e||"light-glow"===e||"dark-glow"===e;return t===On?n?"dark-glow":"dark":n?"light-glow":"light"}},{key:"applyToChecklist",value:function(e){e&&(this.getActiveColorScheme()===On?e.setAttribute(Hn,""):e.removeAttribute(Hn))}},{key:"applyToChecklists",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("undefined"!=typeof document)for(var t=document.querySelectorAll("gleap-checklist"),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Xn(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function Yn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xn(i,r,o,a,s,"next",e)}function s(e){Xn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Zn(e){return Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zn(e)}function Qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function er(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];if(this._postMessageRaw({name:"chatbar-notification-clear"}),!e)try{var t;eb.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=Bm.getInstance().session)||void 0===t?void 0:t.gleapId})}catch(n){}}},{key:"_resizeFrame",value:function(e){var t=e.width,n=e.height;if(this.chatbarContainer){if(Number.isFinite(t)&&window.innerWidth>=600){var r=window.innerWidth-20;this.chatbarContainer.style.width=Math.min(Math.ceil(t),r)+"px"}Number.isFinite(n)&&(this.chatbarContainer.style.height=Math.ceil(n)+"px"),this.isHidden||(this.chatbarContainer.style.display="block")}}},{key:"_updateBlurBackdrop",value:function(e){var t=e.visible,n=e.top,r=e.bottom,o=e.left,i=e.right,a=e.radius,s=e.dark;if(this.blurBackdrop)if(this.chatbarFrame&&(this.chatbarFrame.style.backdropFilter="",this.chatbarFrame.style.webkitBackdropFilter=""),t){var l=this.blurBackdrop.style;l.top=(null!=n?n:0)+"px",l.bottom=(null!=r?r:0)+"px",l.left=(null!=o?o:0)+"px",l.right=(null!=i?i:0)+"px",l.height="auto",l.borderRadius=(null!=a?a:20)+"px",s?(l.background="rgba(40, 40, 40, 0.55)",l.backdropFilter="blur(20px) saturate(140%) brightness(0.75)",l.webkitBackdropFilter="blur(20px) saturate(140%) brightness(0.75)"):(l.background="rgba(255, 255, 255, 0.45)",l.backdropFilter="blur(20px) saturate(150%) brightness(1.04)",l.webkitBackdropFilter="blur(20px) saturate(150%) brightness(1.04)"),l.opacity="1"}else this.blurBackdrop.style.opacity="0"}},{key:"setConfig",value:function(e){this.config=e,e.enabled?this.show():this.manuallyShown||this.hide(),this.comReady&&this._sendConfigUpdate()}},{key:"setPlaceholder",value:function(e){this.config||(this.config={}),this.config.placeholder=e,this.comReady&&this._sendConfigUpdate()}},{key:"setQuickActions",value:function(e){this.config||(this.config={}),this.config.quickActions=e,this.comReady&&this._sendConfigUpdate()}},{key:"sendAgentToolsUpdate",value:function(){this._postMessageRaw({name:"config-update",data:{config:this._withChatbarConfig(Rd.getInstance().getFlowConfig()),aiTools:wn.getInstance().getAgentTools(),agentTools:wn.getInstance().getAgentTools(),overrideLanguage:ub.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===Zn(e)?"context"in e||"initialQuestion"in e||"initialMessage"in e?e:{context:e}:{}}},{key:"_getDefaultAgentId",value:function(){try{var e,t;if(null!==(e=this.config)&&void 0!==e&&e.workflowId)return this.config.workflowId;var n=Rd.getInstance().getFlowConfig()||{};return(null==n||null===(t=n.aiBar)||void 0===t?void 0:t.workflowId)||null}catch(r){return null}}},{key:"_validateAgent",value:(i=Yn(Kn().mark((function e(t){var n,r,o,i,a,s,l;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=Bm.getInstance(),i=o.apiUrl||Vt[$t].apiUrl,a={},o.sdkKey&&(a["Api-Token"]=o.sdkKey),null!==(n=o.session)&&void 0!==n&&n.gleapId&&(a["Gleap-Id"]=o.session.gleapId),null!==(r=o.session)&&void 0!==r&&r.gleapHash&&(a["Gleap-Hash"]=o.session.gleapHash),o.addGrantHeader(a),e.next=10,fetch("".concat(i,"/v3/shared/agents/").concat(encodeURIComponent(t)),{headers:a});case 10:if((s=e.sent).ok){e.next=13;break}return e.abrupt("return",null);case 13:return e.next=15,s.json();case 15:if((l=e.sent)&&!l.error){e.next=18;break}return e.abrupt("return",null);case 18:return this.agentId=t,this.agentName=l.name||"AI Agent",e.abrupt("return",l);case 23:return e.prev=23,e.t0=e.catch(0),e.abrupt("return",null);case 26:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return i.apply(this,arguments)})},{key:"showWithAgent",value:(o=Yn(Kn().mark((function e(t,n){var r,o,i=this;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._normalizeAgentOptions(n),this._suppressOutsideClick=!0,clearTimeout(this._suppressOutsideClickTimeout),this._suppressOutsideClickTimeout=setTimeout((function(){i._suppressOutsideClick=!1}),600),(o=t)&&"default"!==o||(o=this._getDefaultAgentId()||"kai"),!o||"kai"===o){e.next=13;break}return this.agentId=o,this.agentName=null,e.next=11,this._validateAgent(o);case 11:e.next=15;break;case 13:this.agentId="kai",this.agentName=null;case 15:r.context&&(this.agentContext=r.context),this.manuallyHidden=!1,this.manuallyShown=!0,this.show(),this.setPanelOpen(!0),this._postMessageRaw({name:"chatbar-start-agent",data:{agentId:this.agentId,agentName:this.agentName,context:this.agentContext,initialQuestion:r.initialQuestion||void 0,initialMessage:r.initialMessage||void 0}});case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateUIVisibility",value:function(){var e;wv.getInstance().isOpened()?this.hide():null!==(e=this.config)&&void 0!==e&&e.enabled||this.manuallyShown?this.show():this.hide()}},{key:"show",value:function(){this.manuallyHidden||(this.isHidden=!1,this._preloadIframe(),this.chatbarContainer&&(this.chatbarContainer.style.display="block"))}},{key:"hide",value:function(){this.isHidden=!0,this._removeUI()}},{key:"_removeUI",value:function(){this.chatbarContainer&&(document.body&&document.body.contains(this.chatbarContainer)&&document.body.removeChild(this.chatbarContainer),this.chatbarContainer=null,this.chatbarFrame=null,this.blurBackdrop=null,this.comReady=!1,this._panelOpen=!1,this.pendingMessages=[])}},{key:"_preloadIframe",value:function(){var e=this;this.chatbarContainer||de((function(){return e._injectUI()}))}},{key:"_injectUI",value:function(){if(document.body&&!this.chatbarContainer){var e={};try{e=Rd.getInstance().getFlowConfig()||{}}catch(s){}if(!document.getElementById("gleap-chatbar-styles")){var t=e.feedbackButtonPosition,n="";n="BOTTOM_RIGHT"===t?"right: 60px !important;":"BOTTOM_LEFT"===t?"left: 60px !important;":"right: 0 !important;";var r=document.createElement("style");W(r),r.id="gleap-chatbar-styles",r.innerHTML="\n @media (max-width: 460px) {\n .gleap-chatbar {\n width: auto !important;\n max-width: 100% !important;\n ".concat(n,"\n }\n }\n "),document.head.appendChild(r)}var o=document.createElement("div");o.className="gleap-chatbar",o.style.cssText="\n position: fixed;\n bottom: 10px;\n z-index: 2147483000;\n border: 0;\n width: 280px;\n max-width: calc(100vw - 20px);\n overflow: visible;\n height: 80px;\n display: none;\n transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1), height 0.32s cubic-bezier(0.22, 1, 0.36, 1);\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n ";var i=document.createElement("iframe");i.className="gleap-chatbar-frame",i.title="Gleap AI Chatbar",i.setAttribute("role","dialog"),i.setAttribute("frameborder","0"),i.setAttribute("allow","autoplay; encrypted-media; microphone *;"),i.style.cssText="\n position: relative;\n width: 100%;\n height: 100%;\n border: 0;\n background: transparent;\n z-index: 1;\n ";var a=document.createElement("div");a.style.cssText="\n position: absolute;\n opacity: 0;\n transition: opacity 0.24s ease;\n background: rgba(255, 255, 255, 0.45);\n backdrop-filter: blur(20px) saturate(150%) brightness(1.04);\n -webkit-backdrop-filter: blur(20px) saturate(150%) brightness(1.04);\n transform: translateZ(0);\n will-change: backdrop-filter, transform;\n backface-visibility: hidden;\n border-radius: 20px;\n pointer-events: none;\n z-index: 0;\n ",o.appendChild(a),o.appendChild(i),document.body.appendChild(o),this.chatbarContainer=o,this.chatbarFrame=i,this.blurBackdrop=a,K(this.chatbarFrame,this.chatbarUrl)}}},{key:"destroy",value:function(){this._removeUI(),this.config=null,this.isHidden=!0,this.comReady=!1,this._panelOpen=!1,this.pendingMessages=[],this.agentId=null,this.agentName=null,this.agentContext=null,e.instance=null}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&tr(t.prototype,n),r&&tr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ir(e){return ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ir(e)}function ar(e,t){for(var n=0;nhr,gr=["start-conversation","start-custom-action","start-product-tour","open-url","show-form","show-survey","show-news-article","show-help-article","show-checklist"],mr=e=>{try{return-1!==gr.indexOf(e)&&wv.getInstance().isCaptureHidden()}catch(t){return!1}},vr=()=>{try{return"19.9.1"}catch(e){return""}},yr=()=>{try{const e=Rd.getInstance().getFlowConfig();if(e&&e.capture&&"object"==typeof e.capture)return e.capture}catch(e){}return{}},br=()=>{try{return"undefined"!=typeof MediaRecorder&&"function"==typeof MediaRecorder.prototype.pause}catch(e){return!1}},wr=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}catch(e){return!1}},kr=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia}catch(e){return!1}},xr=()=>{try{const e=navigator,t=e.userAgentData;if(t&&Array.isArray(t.brands))return!t.mobile&&t.brands.some((e=>e&&/Chromium/i.test(e.brand)));const n=e.userAgent||"";return/\bChrome\/\d+/.test(n)&&!/Android|Mobile|CriOS|EdgiOS|FxiOS/i.test(n)}catch(e){return!1}},Sr=()=>"dom-only"!==yr().webScreenshotMethod&&xr()&&wr()&&(()=>{try{return window.top===window.self}catch(e){return!1}})(),Cr=()=>wr()&&"undefined"!=typeof window&&"function"==typeof window.MediaRecorder?"display":"rrweb",Er=()=>{if(!pr)return!1;try{return"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof HTMLCanvasElement&&"undefined"!=typeof Element&&"function"==typeof Element.prototype.attachShadow}catch(e){return!1}},Ir=()=>{const e={version:1,platform:dr,sdkType:ur,sdkVersion:vr(),screenshot:!1,recording:!1,annotate:!1,highlight:!0};if(!Er())return e;const t=Cr();return e.screenshot=!0,e.recording=!0,e.annotate=!0,e.recordingMethod=t,e.maxRecordingSec=180,e.microphone="display"===t&&!0===yr().allowMicrophone&&kr(),e.pause="display"===t&&br(),e.flyIn=!0,e};function Dr(e){return Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dr(e)}function Ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tr(e){for(var t=1;t',document.body.appendChild(t),this.bannerContainer=t;var n=t.querySelector(".gleap-b-frame");n&&K(n,this.bannerUrl)}},{key:"sendMessage",value:function(e){try{var t=document.querySelector(".gleap-b-frame");t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(Tr(Tr({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){var t=null!=e&&e.untilDismissed?null==e?void 0:e.outbound:null;if(t){var n,r;if(this.loadClosedBanners().includes(t))return void(this.closedReportedThisPage.has(t)||(this.closedReportedThisPage.add(t),this.reportBannerClosed(t)));if(this.bannerContainer&&null!==(n=this.bannerData)&&void 0!==n&&n.untilDismissed&&(null===(r=this.bannerData)||void 0===r?void 0:r.outbound)===t)return}this.injectBannerUI(e)}},{key:"bannerWasClosed",value:function(e){var t=null!=e&&e.untilDismissed?null==e?void 0:e.outbound:null;t&&(this.rememberClosedBanner(t),this.closedReportedThisPage.add(t),this.reportBannerClosed(t))}},{key:"reportBannerClosed",value:function(e){try{var t=Ky.getInstance();t.logEvent(function(e){return"outbound-".concat(e,"-closed")}(e)),t.streamEvents()}catch(n){}}},{key:"closedBannersKey",value:function(){try{var e,t=null===(e=Bm.getInstance())||void 0===e||null===(e=e.session)||void 0===e?void 0:e.gleapId;return t?"gleap-closed-banners-".concat(t):null}catch(n){return null}}},{key:"loadClosedBanners",value:function(){try{var e=this.closedBannersKey();if(!e)return[];var t=JSON.parse(localStorage.getItem(e));return Array.isArray(t)?t:[]}catch(n){return[]}}},{key:"rememberClosedBanner",value:function(e){try{var t=this.closedBannersKey();if(!t)return;var n=this.loadClosedBanners().filter((function(t){return t!==e}));n.push(e),localStorage.setItem(t,JSON.stringify(n.slice(-50)))}catch(r){}}}])&&Lr(t.prototype,n),r&&Lr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Fr(Pr,"instance",void 0);var Rr,Nr=Object.defineProperty,jr=(e,t,n)=>((e,t,n)=>t in e?Nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Br=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(Br||{}),_r=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(_r||{}),Ur=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ur||{}),Hr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Hr||{}),qr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(qr||{}),zr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(zr||{}),Wr=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Wr||{});const Gr={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Vr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},$r={},Jr={},Kr=()=>!!globalThis.Zone;function Xr(e){if($r[e])return $r[e];const t=globalThis[e],n=t.prototype,r=e in Gr?Gr[e]:void 0,o=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),i=e in Vr?Vr[e]:void 0,a=Boolean(i&&i.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(o&&a&&!Kr())return $r[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const i=o[e].prototype;if(!i)return r.remove(),n;const a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(r.classList.add("rr-block"),r.setAttribute("__rrwebUntaintedMutationObserver",""),Jr[e]=()=>r.remove()):r.remove(),$r[e]=i}catch{return n}}const Yr={};function Zr(e,t,n){var r;const o=`${e}.${String(n)}`;if(Yr[o])return Yr[o].call(t);const i=Xr(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(Yr[o]=a,a.call(t)):t[n]}const Qr={};function eo(e,t,n){const r=`${e}.${String(n)}`;if(Qr[r])return Qr[r].bind(t);const o=Xr(e)[n];return"function"!=typeof o?t[n]:(Qr[r]=o,o.bind(t))}function to(){return[Xr("MutationObserver").constructor,Jr.MutationObserver??(()=>{})]}let no=Date.now;function ro(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString())||(no=()=>(new Date).getTime());const oo={ownerDocument:function(e){return Zr("Node",e,"ownerDocument")},childNodes:function(e){return Zr("Node",e,"childNodes")},parentNode:function(e){return Zr("Node",e,"parentNode")},parentElement:function(e){return Zr("Node",e,"parentElement")},textContent:function(e){return Zr("Node",e,"textContent")},contains:function(e,t){return eo("Node",e,"contains")(t)},getRootNode:function(e){return eo("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Zr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Zr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Zr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Zr("Element",e,"querySelectorAll")(t)},nowTimestamp:no,mutationObserverCtor:to,patch:ro};function io(e){return e.nodeType===e.ELEMENT_NODE}function ao(e){const t=e&&"host"in e&&"mode"in e&&oo.host(e)||null;return Boolean(t&&"shadowRoot"in t&&oo.shadowRoot(t)===e)}function so(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function lo(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const o=Array.from(n,(e=>co(e,r))).join("");return(t=o).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(n){return null}var t}function co(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=lo(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?ko(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?ko(n,t):n}}class uo{constructor(){jr(this,"idNodeMap",new Map),jr(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function po({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let a=o||"";const s=r&&ho(r);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function ho(e){return e.toLowerCase()}const fo="__rrweb_original__";function go(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ho(t):null}function mo(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(o){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const vo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,yo=/^(?:[a-z+]+:)?\/\//i,bo=/^www\..*/i,wo=/^(data:)([^,]*),(.*)/i;function ko(e,t){return(e||"").replace(vo,((e,n,r,o,i,a)=>{const s=r||i||a,l=n||o||"";if(!s)return e;if(yo.test(s)||bo.test(s))return`url(${l}${s}${l})`;if(wo.test(s))return`url(${l}${s}${l})`;if("/"===s[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+s}${l})`;const c=s.split("#")[0],u=s.substring(c.length),d=t.split("#")[0].split("/"),p=c.split("/");d.pop();for(const t of p)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${l}${d.join("/")}${u}${l})`}))}function xo(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function So(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),o=[];let i=0;if(r.length>1&&e&&"string"==typeof e){let t=xo(e,n);const a=t.length/e.length;for(let s=1;s2&&""===p[0]&&""!==r[s-1].textContent)h=t.indexOf(d,1);else if(1===p.length){if(d=d.substring(0,d.length-1),p=t.split(d),p.length<=1)return o.push(e),o;u=c+1}else u===l.length-1&&(h=t.indexOf(d));if(p.length>=2&&u>c){const e=r[s-1].textContent;if(e&&"string"==typeof e){const n=xo(e).length;h=t.indexOf(d,n)}-1===h&&(h=p[0].length)}if(-1!==h){let s=Math.floor(h/a);for(;s>0&&s50*r.length)return o.push(e),o;const l=xo(e.substring(0,s),n);if(l.length===h){o.push(e.substring(0,s)),e=e.substring(s),t=t.substring(h);break}l.length=t.length);){let i=r(Lo);if(","===i.slice(-1))i=Mo(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=Mo(e,i);let a=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?ko(r,Ro(e)):"object"===t&&"data"===n?Mo(e,r):r:r}function jo(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function Bo(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Bo(oo.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&Bo(oo.parentNode(e),t,n)}function _o(e,t,n,r){let o;if(io(e)){if(o=e,!oo.childNodes(o).length)return!1}else{if(null===oo.parentElement(e))return!1;o=oo.parentElement(e)}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(Bo(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(i){}return!1}function Uo(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:a,inlineStylesheet:s,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Wr.Document,childNodes:[],compatMode:e.compatMode}:{type:Wr.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Wr.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:a={},maskInputFn:s,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:h}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,o),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=ho(e.tagName);return Eo.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let w=0;wt.href===e.href));let r=null;t&&(r=lo(t)),r&&(delete m.rel,delete m.href,m._cssText=r)}if("style"===g&&e.sheet){let t=lo(e.sheet);t&&(e.childNodes.length>1&&(t=So(t,e)),m._cssText=t)}if(["input","textarea","select"].includes(g)){const t=e.value,n=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&t?m.value=po({element:e,type:go(e),tagName:g,value:t,maskInputOptions:a,maskInputFn:s}):n&&(m.checked=n)}"option"===g&&(e.selected&&!a.select?m.selected=!0:delete m.selected);"dialog"===g&&e.open&&(m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(l.type,l.quality)&&(m.rr_dataURL=t)}if("img"===g&&c){Ao||(Ao=n.createElement("canvas"),To=Ao.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Ao.width=t.naturalWidth,Ao.height=t.naturalHeight,To.drawImage(t,0,0),m.rr_dataURL=Ao.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?m.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if(["audio","video"].includes(g)){const t=m;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:n}=e.getBoundingClientRect();m={class:m.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==g||d(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);let y;try{customElements.get(g)&&(y=!0)}catch(b){}return{type:Wr.Element,tagName:g,attributes:m,childNodes:[],isSVG:Po(e)||void 0,needBlock:f,rootId:h,isCustom:y}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,a=oo.parentNode(e),s=a&&a.tagName;let l="";const c="STYLE"===s||void 0,u="SCRIPT"===s||void 0;u?l="SCRIPT_PLACEHOLDER":i||(l=oo.textContent(e),c&&l&&(l=ko(l,Ro(t.doc))));!c&&!u&&l&&n&&(l=r?r(l,oo.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Wr.Text,textContent:l||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:c,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Wr.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:Wr.Comment,textContent:oo.textContent(e)||"",rootId:v};default:return!1}}function Ho(e){return null==e?"":e.toLowerCase()}function qo(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function zo(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:S=!1,cssCaptured:C=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:I=!0}=t;if(!E){E=_o(e,a,s,void 0===E)}const D=Uo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:S,cssCaptured:C});if(!D)return console.warn(e,"not serialized"),null;let A;A=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===Wr.Comment)return!0;if(e.type===Wr.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===mo(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ho(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ho(e.attributes.name)||"icon"===Ho(e.attributes.rel)||"apple-touch-icon"===Ho(e.attributes.rel)||"shortcut icon"===Ho(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ho(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ho(e.attributes.property).match(/^(og|twitter|fb):/)||Ho(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ho(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ho(e.attributes.name)||"googlebot"===Ho(e.attributes.name)||"bingbot"===Ho(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ho(e.attributes.name)||"generator"===Ho(e.attributes.name)||"framework"===Ho(e.attributes.name)||"publisher"===Ho(e.attributes.name)||"progid"===Ho(e.attributes.name)||Ho(e.attributes.property).match(/^article:/)||Ho(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ho(e.attributes.name)||"yandex-verification"===Ho(e.attributes.name)||"csrf-token"===Ho(e.attributes.name)||"p:domain_verify"===Ho(e.attributes.name)||"verify-v1"===Ho(e.attributes.name)||"verification"===Ho(e.attributes.name)||"shopify-checkout-api-token"===Ho(e.attributes.name)))return!0}}return!1}(D,h)||!I&&D.type===Wr.Text&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?Io:Do();const T=Object.assign(D,{id:A});if(r.add(e,T),A===Io)return null;v&&v(e);let L=!l;if(T.type===Wr.Element){L=L&&!T.needBlock,delete T.needBlock;const t=oo.shadowRoot(e);t&&so(t)&&(T.isShadowHost=!0)}if((T.type===Wr.Document||T.type===Wr.Element)&&L){h.headWhitespace&&T.type===Wr.Element&&"head"===T.tagName&&(I=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(T.type===Wr.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else{T.type===Wr.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(oo.childNodes(e))){const e=zo(n,t);e&&T.childNodes.push(e)}}let S=null;if(io(e)&&(S=oo.shadowRoot(e)))for(const e of Array.from(oo.childNodes(S))){const n=zo(e,t);n&&(so(S)&&(n.isShadow=!0),T.childNodes.push(n))}}const F=oo.parentNode(e);return F&&ao(F)&&so(F)&&(T.isShadow=!0),T.type===Wr.Element&&"iframe"===T.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(s){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&y){const n=zo(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),T.type===Wr.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===mo(T.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(a){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(w){const t=zo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),T}class Wo{constructor(...e){jr(this,"parentElement",null),jr(this,"parentNode",null),jr(this,"ownerDocument"),jr(this,"firstChild",null),jr(this,"lastChild",null),jr(this,"previousSibling",null),jr(this,"nextSibling",null),jr(this,"ELEMENT_NODE",1),jr(this,"TEXT_NODE",3),jr(this,"nodeType"),jr(this,"nodeName"),jr(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Wo))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Go(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Vo="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let $o={map:{},getId:()=>(console.error(Vo),-1),getNode:()=>(console.error(Vo),null),removeNodeFromMap(){console.error(Vo)},has:()=>(console.error(Vo),!1),reset(){console.error(Vo)}};function Jo(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();o||!1!==n.leading||(o=a);const s=t-(a-o),l=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(l,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(l,i)}),s))}}function Ko(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>Ko(e,t,i||{},!0)}function Xo(e){var t,n,r,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=oo.parentElement(i.body))?void 0:t.scrollLeft)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(r=oo.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function Yo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Zo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Qo(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:oo.parentElement(e)}function ei(e,t,n,r){if(!e)return!1;const o=Qo(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(Bo(o,t,r))return!0}catch(i){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ti(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===Io}function ni(e,t){if(ao(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=oo.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||ni(r,t))}function ri(e){return Boolean(e.changedTouches)}function oi(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ii(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ai(e){return!!e&&(e instanceof Wo&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(oo.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&($o=new Proxy($o,{get:(e,t,n)=>("map"===t&&console.error(Vo),Reflect.get(e,t,n))}));class si{constructor(){jr(this,"id",1),jr(this,"styleIDMap",new WeakMap),jr(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function li(e){var t;let n=null;return"getRootNode"in e&&(null==(t=oo.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&oo.host(oo.getRootNode(e))&&(n=oo.host(oo.getRootNode(e))),n}function ci(e){const t=oo.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=li(n);)n=t;return n}(e);return oo.contains(t,n)}function ui(e){const t=oo.ownerDocument(e);return!!t&&(oo.contains(t,e)||ci(e))}function di(e){return"__ln"in e}class pi{constructor(){jr(this,"length",0),jr(this,"head",null),jr(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n`${e}@${t}`;class fi{constructor(){jr(this,"frozen",!1),jr(this,"locked",!1),jr(this,"texts",[]),jr(this,"attributes",[]),jr(this,"attributeMap",new WeakMap),jr(this,"removes",[]),jr(this,"mapRemoves",[]),jr(this,"movedMap",{}),jr(this,"addedSet",new Set),jr(this,"movedSet",new Set),jr(this,"droppedSet",new Set),jr(this,"removesSubTreeCache",new Set),jr(this,"mutationCb"),jr(this,"blockClass"),jr(this,"blockSelector"),jr(this,"maskTextClass"),jr(this,"maskTextSelector"),jr(this,"inlineStylesheet"),jr(this,"maskInputOptions"),jr(this,"maskTextFn"),jr(this,"maskInputFn"),jr(this,"keepIframeSrcFn"),jr(this,"recordCanvas"),jr(this,"inlineImages"),jr(this,"slimDOMOptions"),jr(this,"dataURLOptions"),jr(this,"doc"),jr(this,"mirror"),jr(this,"iframeManager"),jr(this,"stylesheetManager"),jr(this,"shadowDomManager"),jr(this,"canvasManager"),jr(this,"processedNodeManager"),jr(this,"unattachedDoc"),jr(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),jr(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new pi,r=e=>{let t=e,n=Io;for(;n===Io;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=oo.parentNode(o);if(!i||!ui(o))return;let a=!1;if(o.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(a=!0)}const s=ao(i)?this.mirror.getId(li(o)):this.mirror.getId(i),l=r(o);if(-1===s||-1===l)return n.addNode(o);const c=zo(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{oi(e,this.mirror)&&this.iframeManager.addIframe(e),ii(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ai(o)&&this.shadowDomManager.addShadowRoot(oo.shadowRoot(o),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:a});c&&(e.push({parentId:s,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)mi(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(oo.parentNode(s))||o(s);for(const s of this.addedSet)vi(this.droppedSet,s)||mi(this.removesSubTreeCache,s,this.mirror)?vi(this.movedSet,s)?o(s):this.droppedSet.add(s):o(s);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(oo.parentNode(i.value)),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(oo.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=oo.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=oo.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const a={texts:this.texts.map((e=>{const t=e.node,n=oo.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))})),jr(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(oo.childNodes(e),(e=>oo.textContent(e)||"")).join("");t.attributes.value=po({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:go(e),value:n,maskInputFn:this.maskInputFn})})),jr(this,"processMutation",(e=>{if(!ti(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=oo.textContent(e.target);ei(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:_o(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Qo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,o=e.target.getAttribute(r);if("value"===r){const e=go(n);o=po({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(ei(e.target,this.blockClass,this.blockSelector,!1)||o===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(o)){if(n.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!jo(n.tagName,r))if(i.attributes[r]=No(this.doc,ho(n.tagName),ho(r),o),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),o=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?t:[t,o]:i._unchangedStyles[e]=[t,o]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(ei(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=ao(e.target)?this.mirror.getId(oo.host(e.target)):this.mirror.getId(e.target);ei(e.target,this.blockClass,this.blockSelector,!1)||ti(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(gi(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||ni(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[hi(n,r)]?gi(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!ao(e.target)||!so(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),oo.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),jr(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ti(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[hi(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ei(e,this.blockClass,this.blockSelector,!1)||(oo.childNodes(e).forEach((e=>this.genAdds(e))),ai(e)&&oo.childNodes(oo.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function gi(e,t){e.delete(t),oo.childNodes(t).forEach((t=>gi(e,t)))}function mi(e,t,n){return 0!==e.size&&function(e,t,n){const r=oo.parentNode(t);return!!r&&e.has(r)}(e,t)}function vi(e,t){return 0!==e.size&&yi(e,t)}function yi(e,t){const n=oo.parentNode(t);return!!n&&(!!e.has(n)||yi(e,n))}let bi;const wi=e=>{if(!bi)return e;return(...t)=>{try{return e(...t)}catch(n){if(bi&&!0===bi(n))return;throw n}}},ki=[];function xi(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Si(e,t){const n=new fi;ki.push(n),n.init(e);const[r,o]=to(),i=new r(wi(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Ci({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];let l=null;return Object.keys(Ur).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=ho(i);const c=(t=>i=>{const a=xi(i);if(ei(a,r,o,!0))return;let s=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=Hr.Mouse;break;case"touch":s=Hr.Touch;break;case"pen":s=Hr.Pen}s===Hr.Touch?Ur[t]===Ur.MouseDown?c="TouchStart":Ur[t]===Ur.MouseUp&&(c="TouchEnd"):Hr.Pen}else ri(i)&&(s=Hr.Touch);null!==s?(l=s,(c.startsWith("Touch")&&s===Hr.Touch||c.startsWith("Mouse")&&s===Hr.Mouse)&&(s=null)):Ur[t]===Ur.Click&&(s=l,l=null);const u=ri(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:h}=u;wi(e)({type:Ur[c],id:d,x:p,y:h,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(Ur[i]){case Ur.MouseDown:case Ur.MouseUp:a=a.replace("mouse","pointer");break;case Ur.TouchStart:case Ur.TouchEnd:return}s.push(Go(a,c,t))})),wi((()=>{s.forEach((e=>e()))}))}function Ei({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return Go("scroll",wi(Jo(wi((i=>{const a=xi(i);if(!a||ei(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=Xo(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:a.scrollLeft,y:a.scrollTop})})),i.scroll||100)),t)}const Ii=["INPUT","TEXTAREA","SELECT"],Di=new WeakMap;function Ai(e){return function e(t,n){if(Oi("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Oi("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Oi("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Oi("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const r=Array.from(t.parentRule.cssRules).indexOf(t);return n.unshift(r),e(t.parentRule,n)}if(t.parentStyleSheet){const e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);n.unshift(e)}return n}(e,[])}function Ti(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Li({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(oo.host(n));const s="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(i=null==(o=n.ownerDocument)?void 0:o.defaultView)?void 0:i.ShadowRoot,l=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=l.set)?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(o){}return r}}),wi((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Fi(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Si(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,s=[];const l=Jo(wi((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),c=wi(Jo(wi((e=>{const t=xi(e),{clientX:n,clientY:o}=ri(e)?e.changedTouches[0]:e;a||(a=no()),s.push({x:n,y:o,id:r.getId(t),timeOffset:no()-a}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?_r.Drag:e instanceof MouseEvent?_r.MouseMove:_r.TouchMove)})),o,{trailing:!1})),u=[Go("mousemove",c,n),Go("touchmove",c,n),Go("drag",c,n)];return wi((()=>{u.forEach((e=>e()))}))}(e),a=Ci(e),s=Ei(e),l=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return Go("resize",wi(Jo(wi((()=>{const t=Yo(),o=Zo();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)})),200)),t)}(e,{win:n}),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:a,maskInputOptions:s,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function d(e){let n=xi(e);const c=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=oo.parentElement(n)),!n||!d||Ii.indexOf(d)<0||ei(n,r,o,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let h=n.value,f=!1;const g=go(n)||"";"radio"===g||"checkbox"===g?f=n.checked:(s[d.toLowerCase()]||s[g])&&(h=po({element:n,maskInputOptions:s,tagName:d,type:g,value:h,maskInputFn:l})),p(n,u?{text:h,isChecked:f,userTriggered:c}:{text:h,isChecked:f});const m=n.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function p(t,r){const o=Di.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Di.set(t,r);const o=n.getId(t);wi(e)({...r,id:o})}}const h=("last"===c.input?["change"]:["input","change"]).map((e=>Go(e,wi(d),t))),f=t.defaultView;if(!f)return()=>{h.forEach((e=>e()))};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push(...m.map((e=>Ko(e[0],e[1],{set(){wi(d)({target:this,isTrusted:!1})}},!1,f)))),wi((()=>{h.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const a=wi((i=>Jo(wi((o=>{const a=xi(o);if(!a||ei(a,t,n,!0))return;const{currentTime:s,volume:l,muted:c,playbackRate:u,loop:d}=a;e({type:i,id:r.getId(a),currentTime:s,volume:l,muted:c,playbackRate:u,loop:d})})),o.media||500))),s=[Go("play",a(zr.Play),i),Go("pause",a(zr.Pause),i),Go("seeked",a(zr.Seeked),i),Go("volumechange",a(zr.VolumeChange),i),Go("ratechange",a(zr.RateChange),i)];return wi((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:wi(((r,o,i)=>{const[a,s]=i,{id:l,styleId:c}=Ti(o,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:a,index:s}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const o=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[o,n])};const i=r.CSSStyleSheet.prototype.deleteRule;let a,s;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:wi(((r,o,i)=>{const[a]=i,{id:s,styleId:l}=Ti(o,t,n.styleMirror);return(s&&-1!==s||l&&-1!==l)&&e({id:s,styleId:l,removes:[{index:a}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:wi(((r,o,i)=>{const[a]=i,{id:s,styleId:l}=Ti(o,t,n.styleMirror);return(s&&-1!==s||l&&-1!==l)&&e({id:s,styleId:l,replace:a}),r.apply(o,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:wi(((r,o,i)=>{const[a]=i,{id:s,styleId:l}=Ti(o,t,n.styleMirror);return(s&&-1!==s||l&&-1!==l)&&e({id:s,styleId:l,replaceSync:a}),r.apply(o,i)}))}));const l={};Mi("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Mi("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Mi("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Mi("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach((([r,o])=>{c[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[r].insertRule,{apply:wi(((r,o,i)=>{const[a,s]=i,{id:l,styleId:c}=Ti(o.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:a,index:[...Ai(o),s||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:wi(((r,o,i)=>{const[a]=i,{id:s,styleId:l}=Ti(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||l&&-1!==l)&&e({id:s,styleId:l,removes:[{index:[...Ai(o),a]}]}),r.apply(o,i)}))})})),wi((()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule}))}))}(e,{win:n}),p=Li(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:wi(((o,a,s)=>{var l;const[c,u,d]=s;if(n.has(c))return i.apply(a,[c,u,d]);const{id:p,styleId:h}=Ti(null==(l=a.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:c,value:u,priority:d},index:Ai(a.parentRule)}),o.apply(a,s)}))});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:wi(((o,i,s)=>{var l;const[c]=s;if(n.has(c))return a.apply(i,[c]);const{id:u,styleId:d}=Ti(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:c},index:Ai(i.parentRule)}),o.apply(i,s)}))}),wi((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(f=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=ro(t.fonts,"add",(function(t){return function(n){return setTimeout(wi((()=>{const t=o.get(n);t&&(e(t),o.delete(n))})),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(a),wi((()=>{r.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let a=!0;const s=wi((()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],l=e.rangeCount||0;for(let t=0;t{}}(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,n,y.options));return wi((()=>{ki.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),a(),s(),l(),c(),u(),d(),p(),h(),f(),g(),m(),v.forEach((e=>e()))}))}function Oi(e){return void 0!==window[e]}function Mi(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Pi{constructor(e){jr(this,"iframeIdToRemoteIdMap",new WeakMap),jr(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Ri{constructor(e){jr(this,"iframes",new WeakMap),jr(this,"crossOriginIframeMap",new WeakMap),jr(this,"crossOriginIframeMirror",new Pi(Do)),jr(this,"crossOriginIframeStyleMirror"),jr(this,"crossOriginIframeRootIdMap",new WeakMap),jr(this,"mirror"),jr(this,"mutationCb"),jr(this,"wrappedEmit"),jr(this,"loadListener"),jr(this,"stylesheetManager"),jr(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Pi(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Br.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Br.IncrementalSnapshot,data:{source:_r.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Br.Meta:case Br.Load:case Br.DomContentLoaded:return!1;case Br.Plugin:return t;case Br.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Br.IncrementalSnapshot:switch(t.data.source){case _r.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case _r.Drag:case _r.TouchMove:case _r.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case _r.ViewportResize:return!1;case _r.MediaInteraction:case _r.MouseInteraction:case _r.Scroll:case _r.CanvasMutation:case _r.Input:return this.replaceIds(t.data,e,["id"]),t;case _r.StyleSheetRule:case _r.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case _r.Font:return t;case _r.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case _r.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===Wr.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Ni{constructor(e){jr(this,"shadowDoms",new WeakSet),jr(this,"mutationCb"),jr(this,"scrollCb"),jr(this,"bypassOptions"),jr(this,"mirror"),jr(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!so(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Si({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Ei({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(oo.host(e))),this.restoreHandlers.push(Li({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(ro(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r),i=oo.shadowRoot(this);return i&&ui(this)&&n.addShadowRoot(i,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ji="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_i=0;_i<64;_i++)Bi[ji.charCodeAt(_i)]=_i;const Ui=new Map;const Hi=(e,t,n)=>{if(!e||!Wi(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Ui.get(e);return n||(n=new Map,Ui.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function qi(e,t,n){if(e instanceof Array)return e.map((e=>qi(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t>2],o+=ji[(3&n[t])<<4|n[t+1]>>4],o+=ji[(15&n[t+1])<<2|n[t+2]>>6],o+=ji[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[qi(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[qi(e.data,t,n),e.width,e.height]}}if(Wi(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Hi(e,t,n)}}return e}const zi=(e,t,n)=>e.map((e=>qi(e,t,n))),Wi=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Gi(e,t,n,r){const o=[];try{const i=ro(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!ei(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function Vi(e,t,n,r,o,i){const a=[],s=Object.getOwnPropertyNames(e);for(const l of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const s=ro(e,l,(function(e){return function(...a){const s=e.apply(this,a);if(Hi(s,i,this),"tagName"in this.canvas&&!ei(this.canvas,r,o,!0)){const e=zi(a,i,this),r={type:t,property:l,args:e};n(this.canvas,r)}return s}}));a.push(s)}catch{const r=Ko(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});a.push(r)}return a}const $i='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',Ji="undefined"!=typeof self&&self.Blob&&new Blob([$i],{type:"text/javascript;charset=utf-8"});function Ki(e){let t;try{if(t=Ji&&(self.URL||self.webkitURL).createObjectURL(Ji),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent($i),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Xi{constructor(e){jr(this,"pendingCanvasMutations",new Map),jr(this,"rafStamps",{latestId:0,invokeId:null}),jr(this,"mirror"),jr(this,"mutationCb"),jr(this,"resetObservers"),jr(this,"frozen",!1),jr(this,"locked",!1),jr(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=Gi(t,n,r,!0),a=new Map,s=new Ki;s.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:qr["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{ei(t,n,r,!0)||e.push(t)})),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(a.get(n))return;if(0===e.width||0===e.height)return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);s.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Gi(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=ro(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return ei(this.canvas,n,r,!0)||setTimeout((()=>{const n=zi(i,t,this);e(this.canvas,{type:qr["2D"],property:a,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch{const n=Ko(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:qr["2D"],property:a,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return void 0!==t.WebGLRenderingContext&&o.push(...Vi(t.WebGLRenderingContext.prototype,qr.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Vi(t.WebGL2RenderingContext.prototype,qr.WebGL2,e,n,r,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class Yi{constructor(e){jr(this,"trackedLinkElements",new WeakSet),jr(this,"mutationCb"),jr(this,"adoptedStyleSheetCb"),jr(this,"styleMirror",new si),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const o of e){let e;this.styleMirror.has(o)?e=this.styleMirror.getId(o):(e=this.styleMirror.add(o),r.push({styleId:e,rules:Array.from(o.rules||CSSRule,((e,t)=>({rule:co(e,o.href),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Zi{constructor(){jr(this,"nodeMap",new WeakMap),jr(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let Qi,ea,ta,na=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Rr=e.contentWindow)?void 0:Rr.Array.from)||Array.from,document.body.removeChild(e)}}catch(Kb){console.debug("Unable to override Array.from",Kb)}const ra=new uo;function oa(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:s=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:h,maskInputFn:f,maskTextFn:g,hooks:m,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:k=!0,recordCanvas:x=!1,recordCrossOriginIframes:S=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:I=!1,inlineImages:D=!1,plugins:A,keepIframeSrcFn:T=(()=>!1),ignoreCSSAttributes:L=new Set([]),errorHandler:F}=e;bi=F;const O=!S||window.parent===window;let M=!1;if(!O)try{window.parent.document&&(M=!1)}catch(V){M=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!M)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),ra.reset();const P=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},R=qo(h);let N;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let j=0;const B=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!M&&(e=v(e)),e};Qi=(e,o)=>{var i;const a=e;if(a.timestamp=no(),!(null==(i=ki[0])?void 0:i.isFrozen())||a.type===Br.FullSnapshot||a.type===Br.IncrementalSnapshot&&a.data.source===_r.Mutation||ki.forEach((e=>e.unfreeze())),O)null==t||t(B(a),o);else if(M){const e={type:"rrweb",event:B(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(a.type===Br.FullSnapshot)N=a,j=0;else if(a.type===Br.IncrementalSnapshot){if(a.data.source===_r.Mutation&&a.data.isAttachIframe)return;j++;const e=r&&j>=r,t=n&&a.timestamp-N.timestamp>n;(e||t)&&ea(!0)}};const _=e=>{Qi({type:Br.IncrementalSnapshot,data:{source:_r.Mutation,...e}})},U=e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.Scroll,...e}}),H=e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.CanvasMutation,...e}}),q=new Yi({mutationCb:_,adoptedStyleSheetCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.AdoptedStyleSheet,...e}})}),z=new Ri({mirror:ra,mutationCb:_,stylesheetManager:q,recordCrossOriginIframes:S,wrappedEmit:Qi});for(const J of A||[])J.getMirror&&J.getMirror({nodeMirror:ra,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});const W=new Zi;ta=new Xi({recordCanvas:x,mutationCb:H,win:window,blockClass:o,blockSelector:i,mirror:ra,sampling:y.canvas,dataURLOptions:b});const G=new Ni({mutationCb:_,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:P,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:x,inlineImages:D,sampling:y,slimDOMOptions:R,iframeManager:z,stylesheetManager:q,canvasManager:ta,keepIframeSrcFn:T,processedNodeManager:W},mirror:ra});ea=(e=!1)=>{if(!k)return;Qi({type:Br.Meta,data:{href:window.location.href,width:Zo(),height:Yo()}},e),q.reset(),G.init(),ki.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new uo,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:p,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return zo(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:qo(h),dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:ra,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:P,maskTextFn:g,maskInputFn:f,slimDOM:R,dataURLOptions:b,recordCanvas:x,inlineImages:D,onSerialize:e=>{oi(e,ra)&&z.addIframe(e),ii(e,ra)&&q.trackLinkElement(e),ai(e)&&G.addShadowRoot(oo.shadowRoot(e),document)},onIframeLoad:(e,t)=>{z.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");Qi({type:Br.FullSnapshot,data:{node:t,initialOffset:Xo(window)}},e),ki.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,ra.getId(document))};try{const e=[],t=e=>{var t;return wi(Fi)({mutationCb:_,mousemoveCb:(e,t)=>Qi({type:Br.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.ViewportResize,...e}}),inputCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.Input,...e}}),mediaInteractionCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.MediaInteraction,...e}}),styleSheetRuleCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.StyleSheetRule,...e}}),styleDeclarationCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.StyleDeclaration,...e}}),canvasMutationCb:H,fontCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.Font,...e}}),selectionCb:e=>{Qi({type:Br.IncrementalSnapshot,data:{source:_r.Selection,...e}})},customElementCb:e=>{Qi({type:Br.IncrementalSnapshot,data:{source:_r.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:s,maskTextClass:l,maskTextSelector:c,maskInputOptions:P,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:D,userTriggeredOnInput:E,collectFonts:I,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:R,dataURLOptions:b,mirror:ra,iframeManager:z,stylesheetManager:q,shadowDomManager:G,processedNodeManager:W,canvasManager:ta,ignoreCSSAttributes:L,plugins:(null==(t=null==A?void 0:A.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Qi({type:Br.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{ea(),e.push(t(document)),na=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(Go("DOMContentLoaded",(()=>{Qi({type:Br.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(Go("load",(()=>{Qi({type:Br.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),na=!1,bi=void 0}}catch($){console.warn($)}}oa.addCustomEvent=(e,t)=>{if(!na)throw new Error("please add custom event after start recording");Qi({type:Br.Custom,data:{tag:e,payload:t}})},oa.freezePage=()=>{ki.forEach((e=>e.freeze()))},oa.takeFullSnapshot=e=>{if(!na)throw new Error("please take full snapshot after start recording");ea(e)},oa.mirror=ra;var ia=Uint8Array,aa=Uint16Array,sa=Uint32Array,la=new ia([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]),ca=new ia([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]),ua=new ia([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),da=function(e,t){for(var n=new aa(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&ya)<<1;ba=(61680&(ba=(52428&ba)>>>2|(13107&ba)<<2))>>>4|(3855&ba)<<4,va[ya]=((65280&ba)>>>8|(255&ba)<<8)>>>1}var wa=function(e,t,n){for(var r=e.length,o=0,i=new aa(t);o>>l]=c}else for(a=new aa(r),o=0;o>>15-e[o];return a},ka=new ia(288);for(ya=0;ya<144;++ya)ka[ya]=8;for(ya=144;ya<256;++ya)ka[ya]=9;for(ya=256;ya<280;++ya)ka[ya]=7;for(ya=280;ya<288;++ya)ka[ya]=8;var xa=new ia(32);for(ya=0;ya<32;++ya)xa[ya]=5;var Sa=wa(ka,9,0),Ca=wa(xa,5,0),Ea=function(e){return(e/8>>0)+(7&e&&1)},Ia=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof aa?aa:e instanceof sa?sa:ia)(n-t);return r.set(e.subarray(t,n)),r},Da=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Aa=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Ta=function(e,t){for(var n=[],r=0;rp&&(p=i[r].s);var h=new aa(p+1),f=La(n[u-1],h,0);if(f>t){r=0;var g=0,m=f-t,v=1<t))break;g+=v-(1<>>=m;g>0;){var b=i[r].s;h[b]=0&&g;--r){var w=i[r].s;h[w]==t&&(--h[w],++g)}f=t}return[new ia(h),f]},La=function(e,t,n){return-1==e.s?Math.max(La(e.l,t,n+1),La(e.r,t,n+1)):t[e.s]=n},Fa=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new aa(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},Oa=function(e,t){for(var n=0,r=0;r>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i4&&!I[ua[A-1]];--A);var T,L,F,O,M=c+5<<3,P=Oa(o,ka)+Oa(i,xa)+a,R=Oa(o,p)+Oa(i,g)+a+14+3*A+Oa(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(M<=P&&M<=R)return Ma(t,u,e.subarray(l,l+c));if(Da(t,u,1+(R15&&(Da(t,u,_[C]>>>5&127),u+=_[C]>>>12)}}}else T=Sa,L=ka,F=Ca,O=xa;for(C=0;C255){U=r[C]>>>18&31;Aa(t,u,T[U+257]),u+=L[U+257],U>7&&(Da(t,u,r[C]>>>23&31),u+=la[U]);var H=31&r[C];Aa(t,u,F[H]),u+=O[H],H>3&&(Aa(t,u,r[C]>>>5&8191),u+=ca[H])}else Aa(t,u,T[r[C]]),u+=L[r[C]];return Aa(t,u,T[256]),u+L[256]},Ra=new sa([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Na=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new ia(r+a+5*(1+Math.floor(a/7e3))+o),l=s.subarray(r,s.length-o),c=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d>>13,f=8191&p,g=(1<7e3||I>24576)&&O>423){c=Pa(e,l,0,k,x,S,E,I,A,u-A,c),I=C=E=0,A=u;for(var M=0;M<286;++M)x[M]=0;for(M=0;M<30;++M)S[M]=0}var P=2,R=0,N=f,j=L-F&32767;if(O>2&&T==w(u-j))for(var B=Math.min(h,O)-1,_=Math.min(32767,u),U=Math.min(258,O);j<=_&&--N&&L!=F;){if(e[u+P]==e[u+P-j]){for(var H=0;HP){if(P=H,R=j,H>B)break;var q=Math.min(j,H-2),z=0;for(M=0;Mz&&(z=G,F=W)}}}j+=(L=F)-(F=m[L])+32768&32767}if(R){k[I++]=268435456|fa[P]<<18|ma[R];var V=31&fa[P],$=31&ma[R];E+=la[V]+ca[$],++x[257+V],++S[$],D=u+P,++C}else k[I++]=e[u],++x[e[u]]}}c=Pa(e,l,i,k,x,S,E,I,A,u-A,c)}return Ia(s,0,r+Ea(c)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)};function ja(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,a=0;a!=i;){for(var s=Math.min(a+5552,i);a>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r,o,i,a=Na(e,t,2,4);return r=a,o=t.level,i=0==o?0:o<6?1:9==o?3:2,r[0]=120,r[1]=i<<6|(i?32-2*i:1),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(a,a.length-4,n.d()),a}const Ba=e=>{const t={...e,v:"v1"};return function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r>10,56320|1023&o))}return n}(ja(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new ia(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;ar.length){var s=new ia(o+8+(n-a<<1));s.set(r),r=s}var l=e.charCodeAt(a);l<128||t?i(l):l<2048?(i(192|l>>>6),i(128|63&l)):l>55295&&l<57344?(i(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),i(128|l>>>12&63),i(128|l>>>6&63),i(128|63&l)):(i(224|l>>>12),i(128|l>>>6&63),i(128|63&l))}return Ia(r,0,o)}(JSON.stringify(t))),!0)};function _a(e){return _a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_a(e)}function Ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ha(e){for(var t=1;t=0)return null;if(function(e){if("password"===Ya(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return za.indexOf(e)>=0}))}(e)||function(e,t){return function(e,t){for(var n=e;n;){if(1===n.nodeType&&t(n))return!0;n=n.parentElement||n.parentNode&&n.parentNode.host||null}return!1}(e,(function(e){return es(e,t)||Za(e,Wa)}))}(e,t))return Xa;if(!function(e,t){var n=ns(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[Ya(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?Xa:function(t){try{return n(t,e)}catch(r){return Xa(t)}}},os=Ga.map((function(e){return':not([type="'+e+'" i])'})).join(""),is=function(e){return String(e).replace(/[\S]/g,"*")},as=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?is:function(e,n){try{var r=t(e,n);return"string"==typeof r?r:is(e)}catch(o){return is(e)}}};function ss(e){return function(e){if(Array.isArray(e))return ls(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ls(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ls(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ls(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]&&arguments[0];if(this.clearIdleStart(),t&&this.startDate){if(this.stopFunction){try{this.stopFunction()}catch(r){}this.stopFunction=void 0}if(this.segments[this.segments.length-1].length>0)for(this.segments.push([]),this.segmentSizes.push(0),this.incrementalSize=0;this.segments.length>3;)this.dropOldestSegment()}else this.stop(),this.startDate=Date.now(),this.resetBuffer();var n={inlineStylesheet:!0,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0},dataURLOptions:{quality:.7},recordCanvas:!1,checkoutEveryNms:3e5,sampling:{scroll:150,mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!0,TouchEnd:!1}},collectFonts:!1,recordCrossOriginIframes:!1};try{this.stopFunction=oa(us(us(us(us({},n),this.customOptions),function(e){var t=function(t,n){var r=rs(n,e);return r?r(t):t};return!0===(e=e||{}).maskAllInputs?{maskInputFn:t}:{maskInputFn:t,maskInputOptions:Ha(Ha({},ns(e)),Ka)}}(this.customOptions)),{},{emit:function(t,n){if(n&&t&&4===t.type)for(e.segments.push([]),e.segmentSizes.push(0),e.incrementalSize=0;e.segments.length>3;)e.dropOldestSegment();var r=ms(t);e.segments[e.segments.length-1].push(t),e.segmentSizes[e.segmentSizes.length-1]+=r,t&&4!==t.type&&2!==t.type&&(e.incrementalSize+=r),e.enforceBufferSize()}}))}catch(r){console.error(r)}}},{key:"startIfNotRunning",value:function(){var e=this;this.stopFunction||this.pausedForCapture||this.cancelIdleStart||(this.cancelIdleStart=function(e,t){if("undefined"!=typeof window&&"function"==typeof window.requestIdleCallback){var n=window.requestIdleCallback(e,{timeout:t});return function(){"function"==typeof window.cancelIdleCallback&&window.cancelIdleCallback(n)}}var r=!1,o=null,i="undefined"!=typeof window&&"function"==typeof window.addEventListener,a=function(){r=!0,clearTimeout(o),i&&window.removeEventListener("load",l)},s=function(){r||(a(),e())},l=function(){clearTimeout(o),o=setTimeout(s,0)};return"undefined"!=typeof document&&"complete"!==document.readyState&&i?(window.addEventListener("load",l),o=setTimeout(s,t)):o=setTimeout(s,0),a}((function(){e.cancelIdleStart=void 0,e.stopFunction||e.pausedForCapture||e.start()}),2e3))}},{key:"clearIdleStart",value:function(){this.cancelIdleStart&&(this.cancelIdleStart(),this.cancelIdleStart=void 0)}},{key:"stop",value:function(){this.clearIdleStart(),this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.pausedForCapture=!1,this.startDate=void 0,this.resetBuffer()}},{key:"pauseForCapture",value:function(){if(!this.stopFunction)return!!this.cancelIdleStart&&(this.clearIdleStart(),this.pausedForCapture=!0,!0);try{this.stopFunction()}catch(e){}return this.stopFunction=void 0,clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.pausedForCapture=!0,!0}},{key:"resumeAfterCapture",value:function(){this.pausedForCapture&&(this.pausedForCapture=!1,this.start(!0))}},{key:"resetBuffer",value:function(){clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.segments=[[]],this.segmentSizes=[0],this.incrementalSize=0}},{key:"dropOldestSegment",value:function(){this.segments.shift(),this.segmentSizes.shift()}},{key:"getBufferSize",value:function(){for(var e=0,t=0;t1&&this.getBufferSize()>gs;)this.dropOldestSegment();this.getBufferSize()>gs&&this.incrementalSize>5242880&&this.scheduleForcedCheckout()}},{key:"scheduleForcedCheckout",value:function(){var e=this;if(!this.forcedCheckoutTimeout){var t=Math.max(0,this.lastForcedCheckout+3e4-Date.now());this.forcedCheckoutTimeout=setTimeout((function(){e.forcedCheckoutTimeout=void 0,e.lastForcedCheckout=Date.now();try{oa.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplaySnapshot",value:function(){var e;return{startDate:this.startDate,events:(e=[]).concat.apply(e,ss(this.segments)),packed:!1,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,ss(this.segments)),n=t,r=!1;try{n=t.map((function(e){return Ba(e)})),r=!0}catch(o){n=t,r=!1}return{startDate:this.startDate,events:n,packed:r,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&ds(t.prototype,n),r&&ds(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();ps(vs,"instance",void 0);const ys=475249515,bs=(e,t,n)=>{const r=e[t];if(!r)return null;let o=1,i=128;for(;!(r&i);)i>>=1,o+=1;if(o>(n?4:8)||t+o>e.length)return null;let a=n?r:r&i-1,s=(r&i-1)==i-1;for(let l=1;l{const n=bs(e,t,!0),r=n&&bs(e,t+n.length,!1);return r?{id:n.value,start:t,idLength:n.length,size:r.value,unknown:r.unknown,dataStart:t+n.length+r.length}:null},ks=(e,t)=>{for(let n=t;n<=8;n++)if(e=0;e--)t[e]=r%256,r=Math.floor(r/256);return t[0]|=128>>n-1,t}return null},xs=(e,t,n)=>{let r=0;for(let o=0;o{let o=r;for(let i=n-1;i>=0;i--)e[t+i]=o%256,o=Math.floor(o/256);return 0===o},Cs=(e,t)=>{const n=[];for(let r=t.dataStart;r8)return null;const o=xs(e,t.dataStart,t.size);if(21419===t.id&&o===ys)return null;21420===t.id&&n.push({pos:t.dataStart,size:t.size,value:o}),r=t.dataStart+t.size}r=t.dataStart+t.size}return n},Es=(e,t)=>{try{if(!(e&&t>0&&"function"==typeof e.slice))return Promise.resolve(e);const n=e.slice(0,Math.min(e.size,65536));return"function"!=typeof n.arrayBuffer?Promise.resolve(e):n.arrayBuffer().then((n=>{try{return((e,t,n)=>{const r=ws(t,0);if(!r||440786851!==r.id||r.unknown)return null;const o=ws(t,r.dataStart+r.size);if(!o||408125543!==o.id)return null;const i=[];let a=null;for(let v=o.dataStart;vt.length)return null;let l=1e6,c=null;for(let v=a.dataStart;vs)return null;2807729===e.id&&e.size>0&&e.size<=6&&(l=xs(t,e.dataStart,e.size)||l),17545===e.id&&(c=e),v=e.dataStart+e.size}const u=1e6*n/l,d=t.slice(),p=e.slice(t.length);if(c){const t=new DataView(d.buffer);if(8===c.size)t.setFloat64(c.dataStart,u);else{if(4!==c.size)return null;t.setFloat32(c.dataStart,u)}return new Blob([d,p],{type:e.type})}const h=new Uint8Array(11);h.set([68,137,136]),new DataView(h.buffer).setFloat64(3,u);const f=ks(a.size+h.length,a.dataStart-a.start-a.idLength);if(!f)return null;const g=new Uint8Array(a.idLength+f.length);g.set(d.subarray(a.start,a.start+a.idLength)),g.set(f,a.idLength);const m=g.length-(a.dataStart-a.start)+h.length;for(let v=0;va.start)return null;for(let t=0;ta.start&&!Ss(d,n.pos,n.size,n.value+m))return null}}if(!o.unknown){const e=o.dataStart-o.start-o.idLength,t=ks(o.size+m,e);if(!t||t.length!==e)return null;d.set(t,o.start+o.idLength)}return new Blob([d.subarray(0,a.start),g,d.subarray(a.dataStart,s),h,d.subarray(s),p],{type:e.type})})(e,new Uint8Array(n),t)||e}catch(r){return e}}),(()=>e))}catch(n){return Promise.resolve(e)}},Is=()=>"undefined"!=typeof performance&&performance.now?performance.now():Date.now(),Ds=()=>new Promise((e=>{try{if("function"==typeof MessageChannel){const t=new MessageChannel;return t.port1.onmessage=()=>{t.port1.onmessage=null;try{t.port1.close(),t.port2.close()}catch(n){}e()},void t.port2.postMessage(0)}}catch(t){}setTimeout(e,0)})),As=e=>{const t=JSON.stringify(e);return void 0===t?null:t},Ts=(e,t)=>{const n=["{"];let r=!0;const o=Object.keys(e),i=o=>{const i=e[o],a=(r?"":",")+JSON.stringify(o)+":";if(Array.isArray(i)&&i.length>50)return r=!1,n.push(a+"["),((e,t,n)=>new Promise(((r,o)=>{let i=0;const a=()=>{try{if(n&&n())return void o(new Error("cancelled"));const s=Is();for(;i25&&i{let r=null;try{r=As(e)}catch(o){}n.push((t?",":"")+(r||"null"))}),t).then((()=>{n.push("]")}));if((e=>!!e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).some((t=>Array.isArray(e[t])&&e[t].length>50)))(i))return r=!1,n.push(a),Ts(i,t).then((e=>{e.forEach((e=>n.push(e)))}));let s=null;try{s=As(i)}catch(l){s=null}return null!==s&&(r=!1,n.push(a+s)),Ds()};return o.reduce(((e,t)=>e.then((()=>i(t)))),Promise.resolve()).then((()=>(n.push("}"),n)))};function Ls(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fs=["video/mp4;codecs=avc3","video/mp4;codecs=avc1","video/mp4","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"],Os=["video/mp4;codecs=avc3,mp4a.40.2","video/mp4;codecs=avc1,mp4a.40.2","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"],Ms=e=>{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}},Ps=e=>{const t={frameRate:{ideal:15,max:30}},n={video:t,audio:!1};let r;e&&(t.displaySurface="browser",n.preferCurrentTab=!0,n.selfBrowserSurface="include",n.surfaceSwitching="include");try{r=navigator.mediaDevices.getDisplayMedia(n)}catch(o){r=Promise.reject(o)}return r.catch((()=>{})),r};class Rs{constructor(e){Ls(this,"stream",null),Ls(this,"micStream",null),Ls(this,"videoTrack",null),Ls(this,"recorder",null),Ls(this,"chunks",[]),Ls(this,"mimeType",""),Ls(this,"timer",null),Ls(this,"startedAt",0),Ls(this,"endedAt",0),Ls(this,"settings",{}),Ls(this,"finished",!1),Ls(this,"recorderStopped",!1),Ls(this,"stopTimeout",null),Ls(this,"onEndedBound",null),Ls(this,"recorderError",null),Ls(this,"pausedAt",0),Ls(this,"pausedMs",0),this.options=e}start(e,t){if(this.stream=e,this.videoTrack=e.getVideoTracks()[0]||null,!this.videoTrack)return Promise.reject(new Error("no-video-track"));try{this.settings=this.videoTrack.getSettings?this.videoTrack.getSettings():{}}catch(n){this.settings={}}return(t?navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}).catch((()=>null)):Promise.resolve(null)).then((e=>{this.micStream=e;const t=e&&e.getAudioTracks()[0]||null;if(this.finished||!this.videoTrack||"ended"===this.videoTrack.readyState)throw this.cleanup(),new Error("stopped-before-start");const r=[this.videoTrack];t&&r.push(t),this.mimeType=(e=>{const t=e?Os.concat(Fs):Fs;try{if("undefined"!=typeof MediaRecorder&&"function"==typeof MediaRecorder.isTypeSupported)for(let e=0;e{try{e.data&&e.data.size>0&&this.chunks.push(e.data)}catch(n){}},this.recorder.onstop=()=>{try{this.recorderStopped=!0,this.finish()}catch(n){}},this.recorder.onerror=e=>{try{this.onRecorderError(e&&e.error||new Error("recorder-error"))}catch(n){}},this.onEndedBound=()=>{try{this.stop()}catch(n){}},this.videoTrack.addEventListener("ended",this.onEndedBound);try{this.recorder.start(1e3)}catch(a){throw this.cleanup(),a}this.startedAt=Date.now();const i=1e3*this.options.maxDurationSec;return this.timer=setInterval((()=>{try{const e=this.activeMs();try{this.options.onTick(Math.floor(e/1e3))}catch(n){}e>=i&&this.stop()}catch(n){}}),250),{hasMicrophone:!!t}}))}activeMs(e){const t=e||Date.now(),n=this.pausedAt?t-this.pausedAt:0;return Math.max(0,t-this.startedAt-this.pausedMs-n)}isPaused(){return!!this.pausedAt}pause(){if(this.finished||this.pausedAt||!this.recorder||"recording"!==this.recorder.state)return!1;try{this.recorder.pause()}catch(e){return!1}return this.pausedAt=Date.now(),!0}resume(){if(this.finished||!this.pausedAt||!this.recorder)return!1;try{"paused"===this.recorder.state&&this.recorder.resume()}catch(e){return!1}return this.pausedMs+=Date.now()-this.pausedAt,this.pausedAt=0,!0}setMicrophoneEnabled(e){try{this.micStream&&this.micStream.getAudioTracks().forEach((t=>{t.enabled=!!e}))}catch(t){}}stop(){if(!this.finished&&!this.stopTimeout)if(this.endedAt=this.endedAt||Date.now(),this.pausedAt&&(this.pausedMs+=this.endedAt-this.pausedAt,this.pausedAt=0),this.clearTimer(),this.recorder&&!this.recorderStopped){try{"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.releaseTracks(),this.stopTimeout=setTimeout((()=>{try{this.finish()}catch(e){}}),3e3)}else this.finish()}onRecorderError(e){this.finished||(this.recorderError=e,this.stop())}finish(){if(this.finished)return;this.finished=!0,this.endedAt=this.endedAt||Date.now();const e=-1!==(this.recorder&&this.recorder.mimeType||this.mimeType||"video/webm").indexOf("mp4")?"video/mp4":"video/webm",t=new Blob(this.chunks,{type:e});this.chunks=[],this.cleanup();const n={blob:t,type:e,fileName:"screen-recording."+("video/mp4"===e?"mp4":"webm"),startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt-this.pausedMs),width:this.settings.width,height:this.settings.height,method:"browser"===this.settings.displaySurface?"tab":"display"};if(0===t.size)return void this.options.onError(this.recorderError||new Error("empty-recording"));const r=e=>{n.blob=e;try{this.options.onStop(n)}catch(t){try{this.options.onError(t)}catch(r){}}};"video/webm"===e?Es(t,n.durationMs).then(r):r(t)}fail(e){if(!this.finished){this.finished=!0,this.chunks=[],this.cleanup();try{this.options.onError(e)}catch(t){}}}cancel(){this.finished=!0,this.chunks=[];try{this.recorder&&"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.cleanup()}clearTimer(){this.timer&&(clearInterval(this.timer),this.timer=null),this.stopTimeout&&(clearTimeout(this.stopTimeout),this.stopTimeout=null)}releaseTracks(){if(this.videoTrack&&this.onEndedBound)try{this.videoTrack.removeEventListener("ended",this.onEndedBound)}catch(e){}if(this.onEndedBound=null,Ms(this.stream),Ms(this.micStream),this.options.onReleased)try{this.options.onReleased()}catch(e){}}cleanup(){this.clearTimer(),this.releaseTracks(),this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null,this.stream=null,this.micStream=null,this.videoTrack=null}}const Ns=e=>e.filter((e=>{if("string"!=typeof e||!e.trim())return!1;try{return document.createDocumentFragment().querySelector(e),!0}catch(t){return!1}})).join(", ")||null,js=e=>{if("function"==typeof CompressionStream&&"function"==typeof Response){const t=JSON.stringify(Object.assign({},e,{v:"v1"}));if(t.length>204800)return new Response(new Blob([t]).stream().pipeThrough(new CompressionStream("deflate"))).arrayBuffer().then((e=>(e=>{let t="";for(let n=0;nnew Promise(((n,r)=>{const o=new Array(e.length);let i=0;const a=()=>{try{if(t&&t())return void r(new Error("cancelled"));const s=Is();for(;i{o[r]=e,a()}),(()=>n(null)));if(o[r]=t,Is()-s>25&&i{try{if(this.finished)return;this.events.push(e),this.size+=ms(e),this.size>26214400&&setTimeout((()=>{try{this.stop()}catch(e){}}),0)}catch(t){}},maskAllInputs:!0,blockClass:e.blockClass||"rr-block",blockSelector:Ns([".rr-block",".gl-block",e.blockSelector].concat(this.options.maskSelectors||[])),maskTextClass:e.maskTextClass||"rr-mask",maskTextSelector:Ns([".rr-mask",".gl-mask",e.maskTextSelector]),inlineStylesheet:!0,recordCanvas:!1,collectFonts:!1,recordCrossOriginIframes:!1,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0},dataURLOptions:{quality:.7},sampling:{scroll:150,input:"last",mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!0,TouchEnd:!1}}})}catch(n){throw this.cleanup(),n}if(!this.stopFunction)throw this.cleanup(),new Error("page-recording-unavailable");const t=1e3*this.options.maxDurationSec;this.timer=setInterval((()=>{try{const n=Date.now()-this.startedAt;try{this.options.onTick(Math.floor(n/1e3))}catch(e){}n>=t&&this.stop()}catch(e){}}),250)}stop(){if(this.finished)return;this.finished=!0,this.endedAt=Date.now(),this.cleanup();const e=this.events;this.events=[];const t=()=>this.cancelled;Bs(e,t).then((n=>Ts({startDate:this.startedAt,events:n||e,packed:!!n,baseUrl:window.location.origin,width:this.width,height:this.height,isMobile:Q(),type:"rrweb"},t))).then((e=>{this.cancelled||this.options.onStop({blob:new Blob(e,{type:"application/json"}),type:"application/json",fileName:"page-recording.json",startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt),width:this.width,height:this.height,method:"rrweb"})})).catch((e=>{if(!this.cancelled)try{this.options.onError(e)}catch(t){}}))}cancel(){this.finished=!0,this.cancelled=!0,this.events=[],this.cleanup()}cleanup(){if(this.timer&&(clearInterval(this.timer),this.timer=null),this.stopFunction){try{this.stopFunction()}catch(e){}this.stopFunction=null}if(this.resumeReplay){this.resumeReplay=!1;try{vs.getInstance().resumeAfterCapture()}catch(e){}}}}const Us=(e,t)=>{const n=String(e||"").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"\u2026":n},Hs=(e,t,n)=>{if(!e||1!==e.nodeType)return"element";const r=e.tagName.toLowerCase(),o=e.getAttribute("role")||("a"===r?"link":r),i=((e,t,n)=>{let r=e;for(;r;){if(1===r.nodeType)try{if(ts(r,t)||es(r,t)||n&&r.matches(n))return!0}catch(o){}r=r.parentElement||r.parentNode&&r.parentNode.host||null}return!1})(e,t,Ns(Array.isArray(n)?n:[]));if("input"===r||"select"===r||"textarea"===r){const t="checkbox"===e.type||"radio"===e.type?e.type:"field";return i?t:t+' "'+(Us((a=e).getAttribute("aria-label")||a.labels&&a.labels[0]&&a.labels[0].textContent||a.getAttribute("placeholder")||a.getAttribute("name")||a.id||a.type||a.tagName.toLowerCase(),60)+'"')}var a;if(i)return o;const s=Us(e.getAttribute("aria-label")||e.getAttribute("title")||e.getAttribute("alt")||e.textContent,60);return s?o+' "'+s+'"':o},qs=e=>{try{const t=new URL(e);return Us(t.pathname+t.search+t.hash,150)}catch(t){return Us(e,150)}};class zs{constructor(e){let{privacyOptions:t,maskSelectors:n,isOwnElement:r}=e;Ls(this,"entries",[]),Ls(this,"startedAt",0),Ls(this,"listeners",[]),Ls(this,"urlTimer",null),Ls(this,"lastUrl",""),Ls(this,"lastInputField",null),Ls(this,"lastInputAt",0),Ls(this,"pauses",[]),this.privacyOptions=t||{},this.maskSelectors=Array.isArray(n)?n:[],this.isOwnElement=r||(()=>!1)}add(e,t,n){if(this.entries.length>=200)return;const r=this.videoTime(n||Date.now());null!==r&&this.entries.push({t:r,type:e,label:Us(t,200)})}pause(e){const t=this.pauses[this.pauses.length-1];t&&!t[1]||this.pauses.push([e||Date.now(),0])}resume(e){const t=this.pauses[this.pauses.length-1];t&&!t[1]&&(t[1]=e||Date.now())}videoTime(e){let t=0;for(let n=0;n=r&&e=o&&(t+=o-r)}return Math.max(0,e-this.startedAt-t)}target(e){try{const t=e.composedPath?e.composedPath():[e.target];for(let e=0;e{e.addEventListener(t,n,{capture:!0,passive:!0}),this.listeners.push((()=>e.removeEventListener(t,n,{capture:!0,passive:!0})))};t(document,"click",(e=>{try{if(this.isOwnElement(e.target))return;const t=this.target(e),n=t?Hs(t,this.privacyOptions,this.maskSelectors):e.target&&e.target.tagName?e.target.tagName.toLowerCase():"page";this.add("click","Clicked "+n)}catch(t){}}));const n=e=>{try{const t=this.target(e);if(!t||this.isOwnElement(e.target))return;const n=Date.now();if(t===this.lastInputField&&n-this.lastInputAt<5e3)return void(this.lastInputAt=n);this.lastInputField=t,this.lastInputAt=n,this.add("input",("change"===e.type?"Changed ":"Typed in ")+Hs(t,this.privacyOptions,this.maskSelectors))}catch(t){}};t(document,"input",n),t(document,"change",n);const r=()=>{try{const e=window.location.href;e!==this.lastUrl&&(this.lastUrl=e,this.add("navigation","Navigated to "+qs(e)))}catch(e){}};t(window,"popstate",r),t(window,"hashchange",r),this.urlTimer=setInterval(r,500)}stop(e){const t=e||Date.now();this.listeners.forEach((e=>{try{e()}catch(t){}})),this.listeners=[],this.urlTimer&&(clearInterval(this.urlTimer),this.urlTimer=null);const n=e=>{const n=new Date(e).getTime();return n>=this.startedAt&&n<=t?n:null};try{up.getInstance().getLogs().forEach((e=>{const t=e&&"ERROR"===e.priority?n(e.date):null;null!==t&&this.add("error",String(e.log||"").split("\n")[0],t)}))}catch(r){}try{kh.getInstance().getRequests().forEach((e=>{if(!e||"RESOURCE"===e.type)return;const t=e.response&&e.response.status,r=!1===e.success||"number"==typeof t&&t>=400?n(e.date):null;null!==r&&this.add("network-error",(e.type||"GET")+" "+qs(e.url)+" \u2192 "+(t||"failed"),r)}))}catch(r){}return this.entries.sort(((e,t)=>e.t-t.t))}get interactions(){return this.entries.filter((e=>"click"===e.type||"input"===e.type)).length}}const Ws=19922944,Gs={consoleLog:!0,networkLogs:!0,customData:!0,metaData:!0,customEventLog:!0,replays:!1},Vs=(e,t)=>"/v3/shared/capture-requests/"+encodeURIComponent(String(e))+"/"+t,$s=e=>{try{return e?JSON.parse(e):null}catch(t){return null}},Js=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((o=>{let i=!1;const a=(e,t)=>{i||(i=!0,o({status:e,data:t}))};try{const o=Bm.getInstance(),i=new XMLHttpRequest;i.open(e,o.apiUrl+t),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.gzip&&i.setRequestHeader("Content-Encoding","gzip"),o.injectSession(i),i.timeout=r.timeoutMs||3e4,i.onreadystatechange=()=>{4===i.readyState&&a(i.status,$s(i.responseText))},i.onerror=()=>a(0,null),i.ontimeout=()=>a(0,null),i.send(void 0===n?null:n)}catch(s){a(0,null)}}))},Ks=(e,t,n)=>Js("POST",Vs(e,t),JSON.stringify(n||{})),Xs=(e,t,n)=>{const r={type:t};return n&&(r.reason=String(n).slice(0,200)),Ks(e,"event",r)},Ys=e=>Ts(e).then((e=>{const t=new Blob(e,{type:"application/json"});return(e=>{try{if("function"==typeof CompressionStream&&"function"==typeof Response&&"function"==typeof e.stream)return new Response(e.stream().pipeThrough(new CompressionStream("gzip"))).blob().catch((()=>null))}catch(t){}return Promise.resolve(null)})(t).then((e=>e?{body:e,gzip:!0,size:e.size}:{body:t,gzip:!1,size:t.size}))})),Zs=e=>(e=>{const t=e.webReplay;return t&&!t.packed&&Array.isArray(t.events)?Bs(t.events).then((n=>n?Object.assign({},e,{webReplay:Object.assign({},t,{events:n,packed:!0})}):e)):Promise.resolve(e)})(e).then((e=>Ys(e))).then((t=>{if(t.size<=Ws)return t;if(!e.webReplay)return null;const n=Object.assign({},e);return delete n.webReplay,Ys(n).then((e=>e.size<=Ws?e:null))})),Qs=(e,t)=>Zs(t).then((t=>{return t?Js("POST",Vs(e,"logs"),t.body,{gzip:t.gzip,timeoutMs:(n=t.size,3e4+1e3*Math.ceil((n||0)/65536))}):{status:413,data:null};var n})),el=e=>{const t=Object.assign({},Gs);return e&&"object"==typeof e&&Object.keys(Gs).forEach((n=>{"boolean"==typeof e[n]&&(t[n]=e[n])})),t},tl=(e,t,n,r)=>{if(!Array.isArray(e))return[];if(!t)return e.slice();const o=Array.isArray(r)?r:[];return e.filter((e=>{const r=(e=>{if(!e)return NaN;const t=e.date;return t instanceof Date?t.getTime():"string"==typeof t||"number"==typeof t?new Date(t).getTime():NaN})(e);return isNaN(r)||r>=t&&r<=n&&!((e,t)=>t.some((t=>Array.isArray(t)&&e>=t[0]&&(!t[1]||e0&&void 0!==arguments[0]?arguments[0]:{};const t=el(e.include),n=Date.now(),r=e.windowEnd||n,o=e.windowStart?e.windowStart-1e4:0,i={},a=(e,t)=>{try{i[e]=t()}catch(n){}};if(t.consoleLog&&a("consoleLog",(()=>tl(up.getInstance().getLogs(),o,r,e.pauses))),t.networkLogs&&a("networkLogs",(()=>tl(kh.getInstance().getRequests(),o,r,e.pauses))),t.customData&&a("customData",(()=>xp.getInstance().getCustomData())),t.metaData&&a("metaData",(()=>Uv.getInstance().getMetaData())),t.customEventLog&&a("customEventLog",(()=>tl(Ky.getInstance().getEventArray(),o,r,e.pauses))),t.replays&&(()=>{try{const e=Rd.getInstance().getFlowConfig();return!(!e||!e.enableWebReplays)}catch(e){return!1}})())try{const e=vs.getInstance().getReplaySnapshot();e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0&&(i.webReplay=e)}catch(l){}let s=e.windowStart;if(!s)try{s=Uv.getInstance().sessionStart.getTime()}catch(l){s=n}return i.capturedAt=new Date(n).toISOString(),i.windowStart=new Date(s).toISOString(),i.windowEnd=new Date(r).toISOString(),i.platform=dr,i.sdkType=ur,i.sdkVersion=vr(),e.deviceId&&(i.deviceId=e.deviceId),i};"p".charCodeAt(0),"H".charCodeAt(0),"Y".charCodeAt(0),"s".charCodeAt(0);const rl="[modern-screenshot]",ol="undefined"!=typeof window,il=ol&&"Worker"in window,al=(ol&&window,ol&&window,ol?window.navigator?.userAgent:""),sl=al.includes("Chrome"),ll=al.includes("AppleWebKit")&&!sl,cl=al.includes("Firefox"),ul=e=>e&&"__CONTEXT__"in e,dl=e=>"CSSFontFaceRule"===e.constructor.name,pl=e=>"CSSImportRule"===e.constructor.name,hl=e=>"CSSLayerBlockRule"===e.constructor.name,fl=e=>1===e.nodeType,gl=e=>"object"==typeof e.className,ml=e=>"image"===e.tagName,vl=e=>"use"===e.tagName,yl=e=>fl(e)&&void 0!==e.style&&!gl(e),bl=e=>8===e.nodeType,wl=e=>3===e.nodeType,kl=e=>"IMG"===e.tagName,xl=e=>"VIDEO"===e.tagName,Sl=e=>"CANVAS"===e.tagName,Cl=e=>"TEXTAREA"===e.tagName,El=e=>"INPUT"===e.tagName,Il=e=>"STYLE"===e.tagName,Dl=e=>"SCRIPT"===e.tagName,Al=e=>"SELECT"===e.tagName,Tl=e=>"SLOT"===e.tagName,Ll=e=>"IFRAME"===e.tagName,Fl=(...e)=>console.warn(rl,...e);function Ol(e){const t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),Boolean(t)&&"toDataURL"in t&&Boolean(t.toDataURL("image/webp").includes("image/webp"))}const Ml=e=>e.startsWith("data:");function Pl(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(ol&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;if(!ol)return e;const n=Rl().implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}function Rl(e){return(e&&fl(e)?e?.ownerDocument:e)??window.document}const Nl="http://www.w3.org/2000/svg";function jl(e,t,n){const r=Rl(n).createElementNS(Nl,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function Bl(e,t){let n=(new XMLSerializer).serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function _l(e,t){return new Promise(((n,r)=>{const o=new FileReader;o.onload=()=>n(o.result),o.onerror=()=>r(o.error),o.onabort=()=>r(new Error(`Failed read blob to ${t}`)),"dataUrl"===t?o.readAsDataURL(e):"arrayBuffer"===t&&o.readAsArrayBuffer(e)}))}const Ul=e=>_l(e,"dataUrl");function Hl(e,t){const n=Rl(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function ql(e,t){return new Promise((n=>{const{timeout:r,ownerDocument:o,onError:i,onWarn:a}=t??{},s="string"==typeof e?Hl(e,Rl(o)):e;let l=null,c=null;function u(){n(s),l&&clearTimeout(l),c?.()}if(r&&(l=setTimeout(u,r)),xl(s)){const e=s.currentSrc||s.src;if(!e)return s.poster?ql(s.poster,t).then(n):u();if(s.readyState>=2)return u();const r=u,o=t=>{a?.("Failed video load",e,t),i?.(t),u()};c=()=>{s.removeEventListener("loadeddata",r),s.removeEventListener("error",o)},s.addEventListener("loadeddata",r,{once:!0}),s.addEventListener("error",o,{once:!0})}else{const e=ml(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();const t=async()=>{if(kl(s)&&"decode"in s)try{await s.decode()}catch(t){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||e,t)}u()},n=t=>{a?.("Failed image load",s.dataset.originalSrc||e,t),u()};if(kl(s)&&s.complete)return t();c=()=>{s.removeEventListener("load",t),s.removeEventListener("error",n)},s.addEventListener("load",t,{once:!0}),s.addEventListener("error",n,{once:!0})}}))}const zl=function(){let e=0;return()=>(e+=1,`u${`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4)}${e}`)}();function Wl(e){return e?.split(",").map((e=>e.trim().replace(/"|'/g,"").toLowerCase())).filter(Boolean)}let Gl=0;function Vl(e){const t=`${rl}[#${Gl}]`;return Gl++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&Fl(...t)}}async function $l(e,t){return ul(e)?e:Jl(e,{...t,autoDestruct:!0})}async function Jl(e,t){const{scale:n=1,workerUrl:r,workerNumber:o=1}=t||{},i=Boolean(t?.debug),a=t?.features??!0,s=e.ownerDocument??(ol?window.document:void 0),l=e.ownerDocument?.defaultView??(ol?window:void 0),c=new Map,u={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:(d=t?.fetch?.bypassingCache,{cache:d?"no-cache":"force-cache"}),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:o,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Vl(i),node:e,ownerDocument:s,ownerWindow:l,dpi:1===n?null:96*n,svgStyleElement:Kl(s),svgDefsElement:s?.createElementNS(Nl,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:il&&r&&o?o:0})].map((()=>{try{const e=new Worker(r);return e.onmessage=async e=>{const{url:t,result:n}=e.data;n?c.get(t)?.resolve?.(n):c.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{const{url:t}=e.data;c.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn("Failed to new Worker",e),null}})).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Ol(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:c,drawImageCount:0,tasks:[],features:a,isEnable:e=>"restoreScrollPosition"===e?"boolean"!=typeof a&&(a[e]??!1):"boolean"==typeof a?a:a[e]??!0,shadowRoots:[]};var d;u.log.time("wait until load"),await async function(e,t){yl(e)&&(kl(e)||xl(e)?await ql(e,t):await Promise.all(["img","video"].flatMap((n=>Array.from(e.querySelectorAll(n)).map((e=>ql(e,t)))))))}(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd("wait until load");const{width:p,height:h}=function(e,t){let{width:n,height:r}=t;if(fl(e)&&(!n||!r)){const t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute("width"))||0,r=r||t.height||Number(e.getAttribute("height"))||0}return{width:n,height:r}}(e,u);return u.width=p,u.height=h,u}function Kl(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode("\n.______background-clip--text {\n background-clip: text;\n -webkit-background-clip: text;\n}\n");return t.appendChild(n),t}async function Xl(e,t){const{log:n,timeout:r,drawImageCount:o,drawImageInterval:i}=t;n.time("image to canvas");const a=await ql(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:l}=function(e,t){const{width:n,height:r,scale:o,backgroundColor:i,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*o),s.height=Math.floor(r*o),s.style.width=`${n}px`,s.style.height=`${r}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));const l=s.getContext("2d");l&&i&&(l.fillStyle=i,l.fillRect(0,0,s.width,s.height));return{canvas:s,context2d:l}}(e.ownerDocument,t),c=()=>{try{l?.drawImage(a,0,0,s.width,s.height)}catch(e){t.log.warn("Failed to drawImage",e)}};if(c(),t.isEnable("fixSvgXmlDecode"))for(let u=0;u{setTimeout((()=>{l?.clearRect(0,0,s.width,s.height),c(),e()}),u+i)}));return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Yl(e,t){if(e.ownerDocument)try{const t=e.toDataURL();if("data:,"!==t)return Hl(t,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}const n=e.cloneNode(!1),r=e.getContext("2d"),o=n.getContext("2d");try{return r&&o&&o.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function Zl(e,t){return Sl(e)?Yl(e,t):Ll(e)?function(e,t){try{if(e?.contentDocument?.documentElement)return cc(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}(e,t):kl(e)?function(e){const t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager"),t}(e):xl(e)?async function(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Hl(e.poster,e.ownerDocument);const n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);const r=n.ownerDocument;if(r){let i=!0;if(await ql(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?Hl(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise((e=>{n.addEventListener("seeked",e,{once:!0})}));const a=r.createElement("canvas");a.width=e.offsetWidth,a.height=e.offsetHeight;try{const e=a.getContext("2d");e&&e.drawImage(n,0,0,a.width,a.height)}catch(o){return t.log.warn("Failed to clone video",o),e.poster?Hl(e.poster,e.ownerDocument):n}return Yl(a,t)}return n}(e,t):e.cloneNode(!1)}const Ql=["width","height","-webkit-text-fill-color"],ec=["stroke","fill"];function tc(e,t,n){const{defaultComputedStyles:r}=n,o=e.nodeName.toLowerCase(),i=gl(e)&&"svg"!==o,a=i?ec.map((t=>[t,e.getAttribute(t)])).filter((([,e])=>null!==e)):[],s=[i&&"svg",o,a.map(((e,t)=>`${e}=${t}`)).join(","),t].filter(Boolean).join(":");if(r.has(s))return r.get(s);const l=function(e){let t=e.sandbox;if(!t){const{ownerDocument:r}=e;try{r&&(t=r.createElement("iframe"),t.id=`__SANDBOX__${zl()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",r.body.appendChild(t),t.srcdoc='',e.sandbox=t)}catch(n){e.log.warn("Failed to getSandBox",n)}}return t}(n),c=l?.contentWindow;if(!c)return new Map;const u=c?.document;let d,p;i?(d=u.createElementNS(Nl,"svg"),p=d.ownerDocument.createElementNS(d.namespaceURI,o),a.forEach((([e,t])=>{p.setAttributeNS(null,e,t)})),d.appendChild(p)):d=p=u.createElement(o),p.textContent=" ",u.body.appendChild(d);const h=c.getComputedStyle(p,t),f=new Map;for(let g=h.length,m=0;mr.set(t,e)));function a(n){const a=e.getPropertyValue(n),s=e.getPropertyPriority(n),l=n.lastIndexOf("-"),c=l>-1?n.substring(0,l):void 0;if(c){let e=i.get(c);e||(e=new Map,i.set(c,e)),e.set(n,[a,s])}(t.get(n)!==a||s)&&(c?o.push(c):r.set(n,[a,s]))}return r}const rc=["::before","::after"],oc=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];const ic=new Set(["symbol"]);async function ac(e,t,n,r,o){if(fl(n)&&(Il(n)||Dl(n)))return;if(r.filter&&!r.filter(n))return;ic.has(t.nodeName)||ic.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;const i=await cc(n,r,!1,o);r.isEnable("restoreScrollPosition")&&function(e,t){if(!yl(e)||!yl(t))return;const{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;const{transform:o}=t.style,i=new DOMMatrix(o),{a,b:s,c:l,d:c}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-r,-n),i.a=a,i.b=s,i.c=l,i.d=c,t.style.transform=i.toString()}(e,i),t.appendChild(i)}async function sc(e,t,n,r){let o=e.firstChild;fl(e)&&e.shadowRoot&&(o=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=o;i;i=i.nextSibling)if(!bl(i))if(fl(i)&&Tl(i)&&"function"==typeof i.assignedNodes){const o=i.assignedNodes();for(let i=0;i{c.delete(t)}));const u=nc(l,c,i);u.delete("transition-property"),u.delete("all"),u.delete("d"),u.delete("content"),n&&(u.delete("position"),u.delete("margin-top"),u.delete("margin-right"),u.delete("margin-bottom"),u.delete("margin-left"),u.delete("margin-block-start"),u.delete("margin-block-end"),u.delete("margin-inline-start"),u.delete("margin-inline-end"),u.set("box-sizing",["border-box",""])),"text"===u.get("background-clip")?.[0]&&t.classList.add("______background-clip--text"),sl&&(u.has("font-kerning")||u.set("font-kerning",["normal",""]),"hidden"!==u.get("overflow-x")?.[0]&&"hidden"!==u.get("overflow-y")?.[0]||"ellipsis"!==u.get("text-overflow")?.[0]||e.scrollWidth!==e.clientWidth||u.set("text-overflow",["clip",""]));for(let d=s.length,p=0;p{s.setProperty(n,e,t)})),u}(e,r,n,t);n&&function(e,t){const{backgroundColor:n,width:r,height:o,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),r&&a.setProperty("width",`${r}px`,"important"),o&&a.setProperty("height",`${o}px`,"important"),i)for(const s in i)a[s]=i[s]}(r,t);let i=!1;if(t.isEnable("copyScrollbar")){const t=[o.get("overflow-x")?.[0],o.get("overflow-y")?.[0]];i=t.includes("scroll")||(t.includes("auto")||t.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const l=o.get("text-transform")?.[0],c=Wl(o.get("font-family")?.[0]),u=c?e=>{"uppercase"===l?e=e.toUpperCase():"lowercase"===l?e=e.toLowerCase():"capitalize"===l&&(e=e[0].toUpperCase()+e.substring(1)),c.forEach((t=>{let n=a.get(t);n||a.set(t,n=new Set),e.split("").forEach((e=>n.add(e)))}))}:void 0;return function(e,t,n,r,o){const{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:l}=r;function c(n){const a=i.getComputedStyle(e,n);let c=a.getPropertyValue("content");if(!c||"none"===c)return;o?.(c),c=c.replace(/(')|(")|(counter\(.+\))/g,"");const u=[zl()],d=tc(e,n,r);l?.forEach(((e,t)=>{d.delete(t)}));const p=nc(a,d,r.includeStyleProperties);p.delete("content"),p.delete("-webkit-locale"),"text"===p.get("background-clip")?.[0]&&t.classList.add("______background-clip--text");const h=[`content: '${c}';`];if(p.forEach((([e,t],n)=>{h.push(`${n}: ${e}${t?" !important":""};`)})),1===h.length)return;try{t.className=[t.className,...u].join(" ")}catch(Kb){return void r.log.warn("Failed to copyPseudoClass",Kb)}const f=h.join("\n ");let g=s.get(f);g||(g=[],s.set(f,g)),g.push(`.${u[0]}${n}`)}a&&i&&(rc.forEach(c),n&&oc.forEach(c))}(e,r,i,t,u),function(e,t){(Cl(e)||El(e)||Al(e))&&t.setAttribute("value",e.value)}(e,r),xl(e)||await sc(e,r,t,u),await(s?.(r)),r}const l=e.cloneNode(!1);return await sc(e,l,t),await(s?.(l)),l}function uc(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(Kb){e.log.warn("Failed to destroyContext",Kb)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function dc(e,t){const{url:n,requestType:r="text",responseType:o="text",imageDom:i}=t;let a=n;const{timeout:s,acceptOfImage:l,requests:c,fetchFn:u,fetch:{requestInit:d,bypassingCache:p,placeholderImage:h},font:f,workers:g,fontFamilies:m}=e;"image"===r&&(ll||cl)&&e.drawImageCount++;let v=c.get(n);if(!v){p&&p instanceof RegExp&&p.test(a)&&(a+=(/\?/.test(a)?"&":"?")+(new Date).getTime());const t=r.startsWith("font")&&f&&f.minify,y=new Set;if(t){r.split(";")[1].split(",").forEach((e=>{m.has(e)&&m.get(e).forEach((e=>y.add(e)))}))}const b=t&&y.size,w={url:a,timeout:s,responseType:b?"arrayBuffer":o,headers:"image"===r?{accept:l}:void 0,...d};v={type:r,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(u&&"image"===r){const e=await u(n);if(e)return e}return!ll&&n.startsWith("http")&&g.length?new Promise(((e,t)=>{g[c.size&g.length-1].postMessage({rawUrl:n,...w}),v.resolve=e,v.reject=t})):function(e){const{url:t,timeout:n,responseType:r,...o}=e,i=new AbortController,a=n?setTimeout((()=>i.abort()),n):void 0;return fetch(t,{signal:i.signal,...o}).then((e=>{if(!e.ok)throw new Error("Failed fetch, not 2xx response",{cause:e});switch(r){case"arrayBuffer":return e.arrayBuffer();case"dataUrl":return e.blob().then(Ul);default:return e.text()}})).finally((()=>clearTimeout(a)))}(w)})().catch((t=>{if(c.delete(n),"image"===r&&h)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),"string"==typeof h?h:h(i);throw t})),c.set(n,v)}return v.response}async function pc(e,t,n,r){if(!hc(e))return e;for(const[i,a]of function(e,t){const n=[];return e.replace(fc,((e,r,o)=>(n.push([o,Pl(o,t)]),e))),n.filter((([e])=>!Ml(e)))}(e,t))try{const t=await dc(n,{url:a,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(gc(i),`$1${t}$3`)}catch(o){n.log.warn("Failed to fetch css data url",i,o)}return e}function hc(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}const fc=/url\((['"]?)([^'"]+?)\1\)/g;function gc(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}const mc=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function vc(e,t){const{tasks:n}=t;fl(e)&&((kl(e)||ml(e))&&n.push(...function(e,t){if(kl(e)){const n=e.currentSrc||e.src;if(!Ml(n))return[dc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.srcset="",e.dataset.originalSrc=n,e.src=t||"")}))];(ll||cl)&&t.drawImageCount++}else if(gl(e)&&!Ml(e.href.baseVal)){const n=e.href.baseVal;return[dc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||"")}))]}return[]}(e,t)),vl(e)&&n.push(...function(e,t){const{ownerDocument:n,svgDefsElement:r}=t,o=e.getAttribute("href")??e.getAttribute("xlink:href");if(!o)return[];const[i,a]=o.split("#");if(a){const o=`#${a}`,s=t.shadowRoots.reduce(((e,t)=>e??t.querySelector(`svg ${o}`)),n?.querySelector(`svg ${o}`));if(i&&e.setAttribute("href",o),r?.querySelector(o))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(i)return[dc(t,{url:i,responseType:"text"}).then((e=>{r?.insertAdjacentHTML("beforeend",e)}))]}return[]}(e,t))),yl(e)&&n.push(...function(e,t){return mc.map((n=>{const r=e.getPropertyValue(n);return r&&"none"!==r?((ll||cl)&&t.drawImageCount++,pc(r,null,t,!0).then((t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))):null})).filter(Boolean)}(e.style,t)),e.childNodes.forEach((e=>{vc(e,t)}))}async function yc(e,t){const{ownerDocument:n,svgStyleElement:r,fontFamilies:o,fontCssTexts:i,tasks:a,font:s}=t;if(n&&r&&o.size)if(s&&s.cssText){const e=Sc(s.cssText,t);r.appendChild(n.createTextNode(`${e}\n`))}else{const e=Array.from(n.styleSheets).filter((e=>{try{return"cssRules"in e&&Boolean(e.cssRules.length)}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}})),s=n.implementation.createHTMLDocument(""),l=s.createElement("style");s.head.appendChild(l);const c=l.sheet;await Promise.all(e.flatMap((e=>Array.from(e.cssRules).map((async e=>{if(pl(e)){const r=e.href;let o="";try{o=await dc(t,{url:r,requestType:"text",responseType:"text"})}catch(n){t.log.warn(`Error fetch remote css import from ${r}`,n)}const i=o.replace(fc,((e,t,n)=>e.replace(n,Pl(n,r))));for(const e of function(e){if(null==e)return[];const t=[];let n=e.replace(bc,"");for(;;){const e=wc.exec(n);if(!e)break;t.push(e[0])}n=n.replace(wc,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let e=r.exec(n);if(e)o.lastIndex=r.lastIndex;else{if(e=o.exec(n),!e)break;r.lastIndex=o.lastIndex}t.push(e[0])}return t}(i))try{c.insertRule(e,c.cssRules.length)}catch(n){t.log.warn("Error inserting rule from remote css import",{rule:e,error:n})}}}))))),c.cssRules.length&&e.push(c);const u=[];e.forEach((e=>{Cc(e.cssRules,u)})),u.filter((e=>dl(e)&&hc(e.style.getPropertyValue("src"))&&Wl(e.style.getPropertyValue("font-family"))?.some((e=>o.has(e))))).forEach((e=>{const o=e,s=i.get(o.cssText);s?r.appendChild(n.createTextNode(`${s}\n`)):a.push(pc(o.cssText,o.parentStyleSheet?o.parentStyleSheet.href:null,t).then((e=>{e=Sc(e,t),i.set(o.cssText,e),r.appendChild(n.createTextNode(`${e}\n`))})))}))}}const bc=/(\/\*[\s\S]*?\*\/)/g,wc=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;const kc=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,xc=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Sc(e,t){const{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(xc,(e=>{for(;;){const[t,,n]=kc.exec(e)||[];if(!n)return"";if(n===r)return`src: ${t};`}})):e}function Cc(e,t=[]){for(const n of Array.from(e))hl(n)?t.push(...Cc(n.cssRules)):"cssRules"in n?Cc(n.cssRules,t):t.push(n);return t}const Ec=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;async function Ic(e,t){const n=await $l(e,t);if(fl(n.node)&&gl(n.node)&&!function(e){return Ec.test(e.innerHTML)}(n.node))return n.node;const{ownerDocument:r,log:o,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:l,font:c,progress:u,autoDestruct:d,onCloneNode:p,onEmbedNode:h,onCreateForeignObjectSvg:f}=n;o.time("clone node");const g=await cc(n.node,n,!0);if(a&&r){let e="";l.forEach(((t,n)=>{e+=`${t.join(",\n")} {\n ${n}\n}\n`})),a.appendChild(r.createTextNode(e))}o.timeEnd("clone node"),await(p?.(g)),!1!==c&&fl(g)&&(o.time("embed web font"),await yc(0,n),o.timeEnd("embed web font")),o.time("embed node"),vc(g,n);const m=i.length;let v=0;u?.(v,m),await Promise.all([...Array.from({length:4})].map((async()=>{for(;;){const t=i.pop();if(!t)break;try{await t}catch(e){n.log.warn("Failed to run task",e)}u?.(++v,m)}}))),o.timeEnd("embed node"),await(h?.(g));const y=function(e,t){const{width:n,height:r}=t,o=jl(n,r,e.ownerDocument),i=o.ownerDocument.createElementNS(o.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),o.appendChild(i),o}(g,n);return s&&y.insertBefore(s,y.children[0]),a&&y.insertBefore(a,y.children[0]),d&&uc(n),await(f?.(y)),y}async function Dc(e,t){const n=await $l(e,t),r=await Ic(n),o=Bl(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=Kl(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Nl,"defs"),n.svgStyles.clear());const i=Hl(o,r.ownerDocument);return await Xl(i,n)}const Ac=2560,Tc="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Lc="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(''),Fc=e=>e?Lc:Tc,Oc=[".gleap-frame-container",".bb-feedback-button",".gleap-notification-container",".gleap-chatbar",".gleap-capture-root",".gleap-image-view",".bb-capture-editor",".gleap-b",".gleap-modal-wrapper",".gleap-tooltip",".gleap-tour-popover",".gleap-tour-overlay","#copilot-pointer-container","#copilot-joined-container",".gleap-audio-unmute-modal-overlay",".gleap-admin-frame-container",".gleap-admin-collapse-ui",".click-wave"].join(", "),Mc=["stripe.com","stripe.network","braintreegateway.com","braintree-api.com","paypal.com","adyen.com","adyenpayments.com","checkout.com","squareup.com","squareupsandbox.com","recurly.com","chargebee.com","paddle.com","mollie.com","klarna.com","worldpay.com","authorize.net","razorpay.com","2checkout.com","cybersource.com","spreedly.com","gocardless.com","payu.com","mercadopago.com","paystack.co","flutterwave.com"],Pc=new RegExp("(^|\\.)("+Mc.map((e=>e.replace(/\./g,"\\."))).join("|")+")$","i"),Rc=["card","payment","cvc","cvv","security code","expir","iban"],Nc=new RegExp(Rc.join("|"),"i"),jc=()=>{const e=['iframe[allow*="payment" i]'];return Rc.forEach((t=>{e.push('iframe[title*="'+t+'" i]','iframe[name*="'+t+'" i]')})),Mc.forEach((t=>{e.push('iframe[src*="//'+t+'" i]','iframe[src*=".'+t+'" i]')})),e.join(", ")},Bc=e=>new Promise((t=>setTimeout(t,e))),_c=(e,t,n)=>new Promise(((r,o)=>{const i=setTimeout((()=>o(new Error(n||"timeout"))),t);e.then((e=>{clearTimeout(i),r(e)}),(e=>{clearTimeout(i),o(e)}))})),Uc=e=>{try{if("undefined"!=typeof CSS&&"function"==typeof CSS.escape)return CSS.escape(e)}catch(t){}return String(e).replace(/[^a-zA-Z0-9_-]/g,(e=>"\\"+e))},Hc=e=>{if("string"!=typeof e||0===e.trim().length)return null;try{return document.createDocumentFragment().querySelector(e),e.trim()}catch(t){return null}},qc=(e,t)=>{const n=e||{},r=[".rr-block, .gl-block, .rr-mask, .gl-mask"];return[n.blockSelector,n.maskTextSelector].concat(Array.isArray(t)?t:[]).forEach((e=>{const t=Hc(e);t&&r.push(t)})),[n.blockClass,n.maskTextClass].forEach((e=>{if("string"==typeof e&&e.length>0){const t=Hc("."+Uc(e));t&&r.push(t)}})),r},zc=e=>{const t=e||{};return[t.blockClass,t.maskTextClass].filter((e=>e&&"function"==typeof e.test))},Wc=(e,t)=>{if(!t.length||!e.classList)return!1;for(let n=0;n{try{return!!(e&&e.matches&&e.matches(Oc))}catch(t){return!1}},Vc=e=>{try{return!!(e&&e.closest&&e.closest(Oc))}catch(t){return!1}},$c=e=>{try{if(-1!==(e.getAttribute("allow")||"").toLowerCase().indexOf("payment"))return!0;const t=(e.getAttribute("title")||"")+" "+(e.getAttribute("name")||"");if(Nc.test(t))return!0;const n=e.getAttribute("src");if(n)return Pc.test(new URL(n,window.location.href).hostname)}catch(t){}return!1},Jc=e=>{let t=null;try{t=e.getBoundingClientRect()}catch(n){}try{const n=(e.ownerDocument||document).createRange();n.selectNodeContents(e),t=((e,t)=>{if(!e||e.width<=0||e.height<=0)return t;if(!t||t.width<=0||t.height<=0)return e;const n=Math.min(e.left,t.left),r=Math.min(e.top,t.top);return{left:n,top:r,width:Math.max(e.left+e.width,t.left+t.width)-n,height:Math.max(e.top+e.height,t.top+t.height)-r}})(t,n.getBoundingClientRect())}catch(n){}return t},Kc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[],n={},r=e.privacyOptions||{},o=((e,t)=>qc(e,t).join(", "))(r,e.maskSelectors),i=zc(r),a=(e,r)=>{if(!(e&&e.width>0&&e.height>0))return;let o=e.left+r.x,i=e.top+r.y,a=o+e.width,s=i+e.height;r.clip&&(o=Math.max(o,r.clip.left),i=Math.max(i,r.clip.top),a=Math.min(a,r.clip.right),s=Math.min(s,r.clip.bottom));const l=[o,i,a,s].join(",");a>o&&s>i&&!n[l]&&(n[l]=!0,t.push({x:o,y:i,width:a-o,height:s-i}))},s=(e,t,n)=>{if(!e||n>8)return;const l=(t,n)=>{let r=[];try{r=e.querySelectorAll(t)}catch(o){}for(let e=0;ea(Jc(e),t))),l("input, textarea, select",(e=>{((e,t)=>{try{return!!rs(e,t)}catch(n){return!0}})(e,r)&&a(e.getBoundingClientRect(),t)})),l("iframe, frame",(e=>{const r=e.getBoundingClientRect();if($c(e))return void a(r,t);let o=null;try{o=e.contentDocument}catch(i){}if(o&&o.documentElement&&r.width>0&&r.height>0){const i=t.x+r.left+(e.clientLeft||0),a=t.y+r.top+(e.clientTop||0);let l={left:t.x+r.left,top:t.y+r.top,right:t.x+r.right,bottom:t.y+r.bottom};t.clip&&(l={left:Math.max(l.left,t.clip.left),top:Math.max(l.top,t.clip.top),right:Math.min(l.right,t.clip.right),bottom:Math.min(l.bottom,t.clip.bottom)}),s(o,{x:i,y:a,clip:l},n+1)}}));try{const r=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>Gc(e)?2:1});let o=r.nextNode();for(;o;)o.shadowRoot&&s(o.shadowRoot,t,n+1),i.length&&Wc(o,i)&&a(Jc(o),t),o=r.nextNode()}catch(c){}};return s(document,{x:0,y:0,clip:null},0),t},Xc=(e,t)=>{const n=document.createElement("canvas");return n.width=Math.max(1,Math.round(e)),n.height=Math.max(1,Math.round(t)),n},Yc=e=>{try{e&&(e.width=0,e.height=0)}catch(t){}},Zc=e=>{try{const t=48,n=Xc(t,t),r=n.getContext("2d");r.drawImage(e,0,0,t,t);const o=r.getImageData(0,0,t,t).data;Yc(n);let i=!0,a=!0;for(let e=0;e0&&(i=!1,(o[e]>12||o[e+1]>12||o[e+2]>12)&&(a=!1));return i?"transparent":a?"black":"content"}catch(t){return"content"}},Qc=e=>{let{canvas:t,scaleX:n,scaleY:r,rects:o,background:i}=e;const a=Math.max(t.width,t.height),s=a>Ac?Ac/a:1,l=Xc(t.width*s,t.height*s),c=l.getContext("2d");c.fillStyle=i||"#ffffff",c.fillRect(0,0,l.width,l.height),c.imageSmoothingEnabled=!0;try{c.imageSmoothingQuality="high"}catch(d){}c.drawImage(t,0,0,l.width,l.height),((e,t,n,r)=>{e.save(),e.fillStyle="#000000";for(let o=0;o{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}},tu=()=>{let e;try{e=navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude",monitorTypeSurfaces:"exclude"})}catch(t){e=Promise.reject(t)}return e.catch((()=>{})),e},nu=(e,t)=>("function"!=typeof ImageCapture?Promise.resolve(null):_c(new ImageCapture(e).grabFrame(),3e3,"grab-timeout").then((e=>e&&e.width>0?{source:e,width:e.width,height:e.height,release:()=>e.close&&e.close()}:null),(()=>null))).then((t=>t||(()=>{if("function"!=typeof MediaStreamTrackProcessor)return Promise.resolve(null);let t=null;const n=()=>{try{t&&t.cancel()}catch(e){}};try{t=new MediaStreamTrackProcessor({track:e}).readable.getReader()}catch(r){return Promise.resolve(null)}return _c(t.read(),3e3,"read-timeout").then((e=>{n();const t=e&&e.value;return t?{source:t,width:t.displayWidth||t.codedWidth,height:t.displayHeight||t.codedHeight,release:()=>t.close()}:null}),(()=>(n(),null)))})())).then((e=>e||(()=>{const e=document.createElement("video");e.muted=!0,e.playsInline=!0,e.srcObject=t;const n=()=>{try{e.pause(),e.srcObject=null}catch(t){}},r=new Promise((t=>{"function"==typeof e.requestVideoFrameCallback?e.requestVideoFrameCallback((()=>t())):e.addEventListener("loadeddata",(()=>setTimeout(t,60)),{once:!0})}));return _c(Promise.resolve(e.play()),3e3,"play-timeout").then((()=>_c(r,3e3,"frame-timeout"))).then((()=>({source:e,width:e.videoWidth,height:e.videoHeight,release:n})),(e=>{throw n(),e}))})())),ru=(e,t)=>{let{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=t;const a=e&&e.getVideoTracks?e.getVideoTracks()[0]:null;let s=!1;const l=()=>{s=!0,eu(e),n(!1)};if(!a)return l(),Promise.reject(new Error("no-video-track"));let c={};try{c=a.getSettings?a.getSettings():{}}catch(d){}if(c.displaySurface&&"browser"!==c.displaySurface)return l(),Promise.reject(new Error("not-this-tab"));const u=t=>{if(s)throw new Error("tab-timeout");if(t>=3)throw new Error("no-usable-frame");if("ended"===a.readyState)throw new Error("track-ended");const n=Kc({privacyOptions:r,maskSelectors:o});return nu(a,e).then((e=>{const i=window.innerWidth,a=window.innerHeight,l=(e=>{const t=window.visualViewport,n=t&&t.scale?t.scale:1;return t&&(1!==n||t.offsetLeft||t.offsetTop)?e.map((e=>({x:(e.x-t.offsetLeft)*n,y:(e.y-t.offsetTop)*n,width:e.width*n,height:e.height*n}))):e})(n.concat(Kc({privacyOptions:r,maskSelectors:o})));let c=null;try{if(!s&&e&&e.width>0&&e.height>0){const n=i/a;Math.abs(e.width/e.height-n)/n<=.04&&(c=Xc(e.width,e.height),c.getContext("2d").drawImage(e.source,0,0,e.width,e.height),t<2&&"content"!==Zc(c)&&(Yc(c),c=null))}}finally{try{e&&e.release()}catch(d){}}if(s)throw Yc(c),new Error("tab-timeout");return c?{canvas:c,scaleX:c.width/i,scaleY:c.height/a,rects:l,background:"#000000",method:"tab"}:Bc(150).then((()=>u(t+1)))}))};return n(!0),new Promise(((e,t)=>{let n=null;const r=(r,o)=>{s?o&&Yc(o.canvas):(clearInterval(n),l(),r?t(r):e(o))};n=setInterval((()=>{try{i&&!i()&&r(new Error("aborted"))}catch(d){}}),200),_c(new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(d){n()}})).then((()=>Bc(120))).then((()=>u(0))),15e3,"tab-timeout").then((e=>r(null,e)),(e=>r(e)))}))},ou=200,iu=["background-image","border-image-source","mask-image","-webkit-mask-image","list-style-image"],au=(e,t)=>(e.width>0||e.height>0)&&e.bottom>t.top&&e.topt.left&&e.left{const t=[],n=e=>{for(let n=0;nnew Promise(((t,n)=>{const r=new Set,o={top:-200,left:-200,bottom:window.innerHeight+ou,right:window.innerWidth+ou},i=document.documentElement,a=[{element:i,children:su(i),index:0,visible:!0,sized:!1}],s=()=>{try{if(e())return void n(new Error("aborted"));const l=Is();for(;a.length;){const e=a[a.length-1];if(e.index0&&n.height>0})}else a.pop(),a.length&&(e.visible?a[a.length-1].visible=!0:e.sized&&r.add(e.element));if(a.length&&Is()-l>25)return void Ds().then(s)}t(r)}catch(l){n(l)}};s()})),cu={block:!0,"flow-root":!0,"list-item":!0,flex:!0,grid:!0,table:!0},uu={flex:!0,"inline-flex":!0,grid:!0,"inline-grid":!0},du=(e,t)=>{let{offscreen:n,masked:r}=t,o=null;if(!n&&!r){try{const t=e.videoWidth,n=e.videoHeight;if(e.readyState>=2&&t>0&&n>0){const r=Math.min(1,1280/Math.max(t,n)),i=Xc(t*r,n*r);try{i.getContext("2d").drawImage(e,0,0,i.width,i.height),o=i.toDataURL("image/jpeg",.85)}finally{Yc(i)}}}catch(a){o=null}if(!o)try{o=e.poster||null}catch(a){}}const i=document.createElement(o?"img":"div");try{const t=window.getComputedStyle(e);for(let e=0;e{const i=[e],a=(Array.isArray(n)?n:[]).map(Hc).filter(Boolean).join(", "),s=document.scrollingElement||document.documentElement,l={broken:!1,offsetX:0,offsetY:0,lastYield:Is(),canYield:!1,elements:0,offscreen:null},c=new Map,u=new Map,d=new Set,p=e=>{try{return ts(e,t)||es(e,t)||!!a&&e.matches(a)}catch(n){return!1}},h=e=>c.set(e,(c.get(e)||0)+1),f=e=>e.style&&e.style.setProperty("visibility","hidden","important"),g=(e,t)=>{if(e===document.documentElement||e===s)return;const n=e.scrollTop||0,r=e.scrollLeft||0;if(!n&&!r)return;let o=null;try{o=e.getBoundingClientRect()}catch(a){}if(o&&(e=>Math.abs(e.left)<=2&&Math.abs(e.top)<=2&&Math.abs(e.right-window.innerWidth)<=20&&Math.abs(e.bottom-window.innerHeight)<=20)(o))return l.offsetX+=r,l.offsetY+=n,void t.style.setProperty("overflow","visible","important");const i=t.children||[];for(let s=0;s{o();const t=i[i.length-1];if(d.has(t))return!1;if(!e||1!==e.nodeType)return h(t),!0;const n=String(e.tagName).toUpperCase();if("NOSCRIPT"===n||"TEMPLATE"===n)return!1;if(Gc(e)||"string"==typeof e.id&&0===e.id.indexOf("__SANDBOX__"))return!1;if("VIDEO"===n){const n=u.get(t)||[];return n.push({index:c.get(t)||0,placeholder:du(e,{offscreen:!!l.offscreen&&l.offscreen.has(e),masked:p(e)})}),u.set(t,n),!1}if(l.elements+=1,l.elements>1e4)throw new Error("render-budget");return h(t),i.push(e),"IFRAME"!==n&&"FRAME"!==n||!(e=>{try{return!(!e.contentDocument||!e.contentDocument.documentElement)}catch(t){return!1}})(e)||i.push(e),l.offscreen&&l.offscreen.has(e)&&(e=>{try{if(e.ownerDocument!==document||e===document.body)return!1;const t=window.getComputedStyle(e);if(!cu[t.display])return!1;if("block"!==t.display&&"list-item"!==t.display)return!0;const n=e=>"hidden"===e||"scroll"===e||"auto"===e;if(n(t.overflowX)||n(t.overflowY)||"none"!==t.float||"absolute"===t.position||"fixed"===t.position)return!0;const r=e.parentElement;if(r&&uu[window.getComputedStyle(r).display])return!0;const o=e=>parseFloat(t["padding"+e])>0||parseFloat(t["border"+e+"Width"])>0;return o("Top")&&o("Bottom")}catch(t){return!1}})(e)&&d.add(e),!0},onCloneEachNode:e=>{if(o(),!e||1!==e.nodeType)return;const n=i.pop();if(n&&((e,t)=>{const n=String(e.nodeName).toUpperCase(),r=String(t.nodeName).toUpperCase();return n===r||("IFRAME"===n||"FRAME"===n?"HTML"===r:!("VIDEO"!==n&&"CANVAS"!==n||"IMG"!==r&&"CANVAS"!==r&&"VIDEO"!==r))})(n,e)||(l.broken=!0),!l.broken)try{((e,t)=>{const n=u.get(e);n&&(u.delete(e),n.forEach(((e,n)=>{t.insertBefore(e.placeholder,t.childNodes[e.index+n]||null)})))})(n,e),((e,n)=>{const r=String(e.tagName).toUpperCase();if("INPUT"===r||"TEXTAREA"===r||"SELECT"===r){let o=null;try{o=rs(e,t)}catch(a){o=()=>""}if(o){const t=o(e.value);if(n.setAttribute("value","string"==typeof t?t:""),"TEXTAREA"===r&&(n.textContent="string"==typeof t?t:""),"SELECT"===r){const e=n.querySelectorAll("option[selected]");for(let t=0;t{e.style&&iu.forEach((t=>e.style.setProperty(t,"none","important"))),"IMG"===String(e.nodeName).toUpperCase()&&(e.removeAttribute("srcset"),e.setAttribute("src",Tc))})(e)}catch(r){}return c.delete(n),l.canYield&&Is()-l.lastYield>40?(l.lastYield=Is(),Ds()):void 0},onCloneNode:e=>{!l.broken&&(l.offsetX||l.offsetY)&&e&&e.style&&(e.style.top=-(r.y+l.offsetY)+"px",e.style.left=-(r.x+l.offsetX)+"px")},state:l}},hu={contentWindow:null,remove:()=>{}},fu=()=>{try{const e=window.innerHeight,t=document.images;for(let n=0;n0&&o.height>0&&o.bottom>0&&o.top{try{"string"==typeof e&&0!==e.indexOf("data:")&&0!==e.indexOf("blob:")&&kh.getInstance().ignoreInternalRequest(e,null,t)}catch(n){}},mu=e=>{const t=(()=>{try{const e=-200,t=window.innerHeight+ou,n=new Set,r=new Set,o=document.images;for(let a=0;at||s.bottomt||n.bottomn.delete(e))),0===n.size?null:e=>Promise.resolve(!!n.has(e)&&Tc)}catch(e){return null}})();return n=>(gu(n,e),t?t(n):Promise.resolve(!1))};let vu=0,yu=!1;const bu=e=>{let{privacyOptions:t,maskSelectors:n,isActive:r}=e;return new Promise(((e,o)=>{const i=document.documentElement,a=Math.max(1,i.clientWidth||window.innerWidth),s=Math.max(1,i.clientHeight||window.innerHeight),l=Math.min(Math.max(window.devicePixelRatio||1,1),Ac/Math.max(a,s)),c={x:window.scrollX||0,y:window.scrollY||0},u=Kc({privacyOptions:t,maskSelectors:n}),d=(()=>{const e=e=>e&&"transparent"!==e&&!/rgba\(\s*0,\s*0,\s*0,\s*0\s*\)/.test(e);try{const t=window.getComputedStyle(document.documentElement).backgroundColor;if(e(t))return t;const n=document.body?window.getComputedStyle(document.body).backgroundColor:null;if(e(n))return n}catch(t){}return"#ffffff"})();let p=null;const h=()=>(p||!r||r()||(p="aborted"),!!p),f=()=>{if(h())throw new Error(p)},g=pu(i,t,n,c,f),m=(()=>{let e=null;try{e=kh.getInstance(),0===vu&&(yu=!!e.stopped,e.setStopped(!0)),vu+=1}catch(n){return()=>{}}let t=!1;return()=>{if(!t&&(t=!0,vu=Math.max(0,vu-1),0===vu))try{e.setStopped(yu)}catch(n){}}})(),v=Is();let y=null,b=null,w=!1,k=null,x=null;const S=(t,n)=>{w?n&&Yc(n.canvas):(w=!0,(()=>{if(clearTimeout(k),clearInterval(x),y){try{y.requests&&"function"==typeof y.requests.forEach&&y.requests.forEach(((e,t)=>gu(t,v)))}catch(e){}try{uc(y)}catch(e){}y=null}if(b){try{b.remove()}catch(e){}b=null}m()})(),t?o(t):e(n))};k=setTimeout((()=>{try{p=p||"render-timeout",S(new Error("render-timeout"))}catch(e){}}),1e4),x=setInterval((()=>{try{h()&&S(new Error(p))}catch(e){}}),200),Promise.all([lu(h),new Promise((e=>{const t=document.createElement("iframe");t.id="__SANDBOX__gleap",t.width="0",t.height="0",t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.style.visibility="hidden",t.style.position="fixed";let n=!1;try{t.srcdoc='',n=!0}catch(l){}const r=()=>{try{const e=t.contentDocument;return!(!e||!e.body||"complete"!==e.readyState||n&&"about:srcdoc"!==t.contentWindow.location.href)}catch(l){return!1}};let o=!1,i=null;const a=n=>{if(!o){if(o=!0,clearTimeout(i),t.removeEventListener("load",s),!n)try{t.remove()}catch(l){}e(n?t:null)}},s=()=>{r()&&a(!0)};t.addEventListener("load",s),i=setTimeout((()=>a(r())),1500);try{(document.body||document.documentElement).appendChild(t)}catch(l){return void a(!1)}n||a(r())}))]).then((e=>{let[t,n]=e;return w?(n&&n.remove(),null):(b=n,f(),g.state.offscreen=t,Jl(i,{width:a,height:s,scale:l,backgroundColor:null,filter:g.filter,onCloneEachNode:g.onCloneEachNode,onCloneNode:g.onCloneNode,onCreateForeignObjectSvg:()=>{y&&(y.drawImageCount=Math.min(y.drawImageCount||0,2))},style:{position:"relative",top:-c.y+"px",left:-c.x+"px",overflow:"visible"},features:{restoreScrollPosition:!1},fetchFn:mu(v),fetch:{requestInit:{cache:"force-cache"},bypassingCache:!1,placeholderImage:Fc},timeout:fu()?3e3:50}))})).then((e=>{if(!e)return null;if(w){try{uc(e)}catch(t){}return null}return y=e,y.timeout=8e3,y.sandbox=b||hu,b=null,g.state.canYield=!0,f(),Dc(y)})).then((e=>{if(e){if(!w)return"transparent"===Zc(e)?(Yc(e),void S(new Error("render-empty"))):void S(null,{canvas:e,scaleX:e.width/a,scaleY:e.height/s,rects:u,background:d,method:"dom"});Yc(e)}})).catch((e=>S(e)))}))},wu=e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,active:i}=e;return t?t.then((e=>i()?ru(e,{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}).catch((()=>null)):(eu(e),null)),(()=>(n(!1),null))):Promise.resolve(null)},ku=e=>{try{const t=Qc(e);return t.method=e.method,t}finally{Yc(e.canvas)}};function xu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Su={barScreenshotHint:"Go to the screen, then capture",barCapture:"Capture",barCancel:"Cancel",barRecordHint:"Go to where it happens, then start",barStart:"Start recording",barStop:"Stop",barRecording:"Recording",barDragHint:"Drag to move",barCaptureKeys:"{enter} to capture \xb7 {esc} to cancel",barStartKeys:"{enter} to start \xb7 {esc} to cancel",barPause:"Pause",barResume:"Resume",barPaused:"Paused",microphone:"Microphone",previewTitle:"Send this recording?",previewSend:"Send",previewRetake:"Retake",previewDiscard:"Discard",previewPlay:"Play",previewWithAudio:"with audio",previewNoAudio:"no audio",uploading:"Uploading\u2026",recordingInterrupted:"Recording stopped because the page changed.",recordAgain:"Record again",permissionDenied:"Screen capture was blocked. You can upload a file instead.",notSupported:"Screen capture isn't available here. You can upload a file instead.",failed:"That didn't work. Please try again or upload a file.",recordPage:"Record this page",recordPageHint:"Screen sharing didn't start. You can record this page instead."},Cu=e=>{const t=Object.assign({},Su);return e&&"object"==typeof e&&Object.keys(Su).forEach((n=>{const r=e[n];"string"==typeof r&&r.trim().length>0&&(t[n]=r.slice(0,300))})),t},Eu=e=>{const t=Math.max(0,Math.floor(e||0)),n=t%60;return Math.floor(t/60)+":"+(n<10?"0":"")+n},Iu=e=>{const t=/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?/i.exec(e||"");if(!t)return null;if(void 0!==t[4]){if((-1!==t[4].indexOf("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null}const n=e=>{const t=parseFloat(e)/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)};return.2126*n(t[1])+.7152*n(t[2])+.0722*n(t[3])},Du=2*Math.PI*21.75,Au=':host{all:initial}.root{--ink:#0b0b0f;--ink-2:#3c4048;--muted:#6b7280;--surface:#fff;--recess:#f3f4f6;--recess-2:#e9ebef;--line:rgba(15,17,22,.08);--hover:rgba(15,17,22,.06);--glass:rgba(255,255,255,.72);--glass-ring:rgba(15,17,22,.1);--glass-shadow:0 14px 36px -10px rgba(15,17,22,.28),0 2px 6px rgba(15,17,22,.06);--rec:#e5484d;--error:#c4262e}.root.dark{--ink:#ededf0;--ink-2:#c5c7ce;--muted:#9a9ca6;--surface:#17181c;--recess:#212227;--recess-2:#2a2b31;--line:rgba(255,255,255,.08);--hover:rgba(255,255,255,.08);--glass:rgba(32,33,38,.66);--glass-ring:rgba(255,255,255,.12);--glass-shadow:0 16px 40px -10px rgba(0,0,0,.7),0 2px 6px rgba(0,0,0,.3);--error:#ff9a9d}.pill,.sheet{font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:var(--ink);letter-spacing:normal;text-align:start;-webkit-font-smoothing:antialiased;box-sizing:border-box;pointer-events:auto}.pill *,.sheet *{box-sizing:border-box}.glass{background:var(--glass);-webkit-backdrop-filter:blur(20px) saturate(1.7);backdrop-filter:blur(20px) saturate(1.7);box-shadow:0 0 0 1px var(--glass-ring),var(--glass-shadow)}.pill{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);display:flex;align-items:center;gap:6px;padding:6px 6px 6px 18px;border-radius:999px;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;animation:pill-in .32s cubic-bezier(.2,.8,.2,1) both}.pill.dragging{cursor:grabbing}.pill.moved{transform:none;animation:none}.pill.rec{padding-left:16px}.txt{display:flex;flex-direction:column;gap:3px;min-width:0;padding-right:8px}.h{font-size:14px;font-weight:500;letter-spacing:-.005em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:min(440px,calc(100vw - 200px))}.k{font-size:11.5px;color:var(--muted);white-space:nowrap;display:flex;align-items:center;gap:4px}kbd{font:500 10.5px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;padding:2px 5px;border-radius:5px;background:var(--hover);box-shadow:inset 0 0 0 1px var(--line);color:var(--ink-2)}.sep{flex:none;width:1px;height:22px;margin:0 2px;background:var(--line)}button{-webkit-appearance:none;appearance:none;margin:0;border:0;padding:0;font:inherit;color:inherit;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}button[disabled]{opacity:.45;cursor:default}svg{display:block;flex:none;width:18px;height:18px}.ic{flex:none;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;color:var(--ink)}.ic:hover:not([disabled]){background:var(--hover)}.ic[aria-pressed=false]{color:var(--muted)}.ic.x{color:var(--muted)}.ic.x:hover{color:var(--ink)}.text-btn{flex:none;height:36px;padding:0 14px;border-radius:999px;font-size:13px;font-weight:600;white-space:nowrap;background:var(--accent);color:var(--on-accent)}.shutter{position:relative;flex:none;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--ink) 80%,transparent)}@supports not (color:color-mix(in srgb,red 50%,blue)){.shutter{box-shadow:inset 0 0 0 2px var(--ink)}}.core{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--on-accent);transition:transform .14s ease}.shutter:hover:not([aria-disabled=true]) .core{transform:scale(.92)}.shutter:active:not([aria-disabled=true]) .core{transform:scale(.84)}.shutter.start .core{width:30px;height:30px;background:var(--rec);color:#fff}.shutter.stop .core{width:16px;height:16px;border-radius:4px;background:var(--rec)}.shutter[aria-busy=true] .core{transform:none}.ring{position:absolute;top:0;left:0;width:46px;height:46px;transform:rotate(-90deg)}.ring circle{fill:none;stroke:var(--rec);stroke-width:2.5;stroke-linecap:round;transition:stroke-dashoffset .25s linear}.spin{flex:none;width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}.rec-state{display:flex;align-items:center;gap:10px;padding-right:6px;white-space:nowrap}.dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--rec);box-shadow:0 0 0 4px rgba(229,72,77,.22);animation:pulse 1.4s ease-in-out infinite}.dot.paused{animation:none;background:var(--muted);box-shadow:0 0 0 4px var(--hover)}.time{font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}.time span{color:var(--muted);font-weight:400}.label{font-size:12.5px;color:var(--muted)}.sheet{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);width:min(380px,calc(100vw - 24px));max-height:calc(100vh - 40px);display:flex;flex-direction:column;padding:8px;border-radius:24px;animation:pill-in .3s cubic-bezier(.2,.8,.2,1) both}.sheet-head{display:flex;align-items:center;gap:8px;padding:6px 4px 10px 10px}.sheet-head .txt{flex:1;padding:0}.sheet-title{font-size:15px;font-weight:600}.sheet-sub{font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums}.media{position:relative;flex:none;aspect-ratio:16/10;border-radius:16px;overflow:hidden;background:#0b0b0f;box-shadow:0 0 0 1px var(--line)}.media video{display:block;width:100%;height:100%;object-fit:contain;background:#0b0b0f}.media.summary{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:var(--recess);color:var(--ink-2)}.media.summary>svg{width:36px;height:36px;opacity:.8}.facts{display:flex;gap:14px;font-variant-numeric:tabular-nums;font-size:13px}.facts span{display:inline-flex;align-items:center;gap:6px}.facts svg{width:15px;height:15px}.play{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;width:100%;height:100%;border-radius:0;background:linear-gradient(to top,rgba(11,11,15,.35),rgba(11,11,15,.05))}.play span{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.92);color:#0b0b0f;box-shadow:0 6px 16px -6px rgba(0,0,0,.5)}.chip{position:absolute;left:8px;bottom:8px;display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:999px;background:rgba(11,11,15,.72);color:#fff;font-size:11.5px;font-weight:600;font-variant-numeric:tabular-nums;pointer-events:none}.chip svg{width:11px;height:11px}.meter{height:4px;margin:8px 4px 0;border-radius:99px;background:var(--recess);overflow:hidden}.meter div{height:100%;width:0;border-radius:99px;background:var(--accent);transition:width .2s}.status{padding:8px 6px 0;font-size:12.5px;color:var(--muted)}.status.error{color:var(--error)}.actions{display:flex;gap:8px;padding:8px 0 0}.btn{flex:1;height:42px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:14px;font-size:14px;font-weight:600;white-space:nowrap}.btn.p{background:var(--accent);color:var(--on-accent)}.btn.p:hover:not([disabled]){filter:brightness(1.08)}.btn.g{background:var(--hover);color:var(--ink)}.btn.g:hover:not([disabled]){background:var(--recess-2)}.btn svg{width:16px;height:16px}.btn[aria-busy=true]{opacity:1;cursor:default}.flash{position:fixed;top:0;right:0;bottom:0;left:0;background:#fff;pointer-events:none;opacity:0;animation:flash .34s ease-out both}.flyer{position:fixed;left:0;top:0;overflow:hidden;pointer-events:none;transform-origin:0 0;box-shadow:0 24px 50px -18px rgba(15,17,22,.55),0 0 0 1px rgba(15,17,22,.07)}.flyer img{display:block;width:100%;height:100%;object-fit:cover;object-position:top center}@keyframes pill-in{from{opacity:0;transform:translateX(-50%) translateY(14px) scale(.96)}}@keyframes pill-in-m{from{opacity:0;transform:translateY(14px)}}@keyframes pulse{50%{box-shadow:0 0 0 7px rgba(229,72,77,0);opacity:.75}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes flash{12%{opacity:.9}100%{opacity:0}}@media (hover:none){.k{display:none}}@media (max-width:600px){.pill,.pill.moved{left:12px!important;right:12px;top:auto!important;bottom:calc(14px + env(safe-area-inset-bottom,0px));width:auto;max-width:none;transform:none;padding-left:16px;cursor:default;animation-name:pill-in-m}.pill.moved{animation:none}.txt{flex:1}.h{max-width:none}.k{display:none}.pill.rec .rec-state{flex:1}.sheet{left:12px;right:12px;bottom:calc(14px + env(safe-area-inset-bottom,0px));width:auto;transform:none;animation-name:pill-in-m}}@media (prefers-reduced-motion:reduce){.pill,.sheet,.dot{animation:none}.core,.ring circle,.meter div{transition:none}.spin{animation-duration:2.4s}.flash{animation-duration:.2s;opacity:0}}',Tu={camera:["M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3zM12 16.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4Z"],x:["M18 6 6 18M6 6l12 12"],mic:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21"],micOff:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M4 4l16 16"],pause:["M8 5h2.2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1ZM13.8 5H16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1h-2.2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z","fill"],play:["M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z","fill"],arrowUp:["M12 19V5M5 12l7-7 7 7"],record:["M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"],page:["M6.5 3h11A2.5 2.5 0 0 1 20 5.5v13a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 18.5v-13A2.5 2.5 0 0 1 6.5 3ZM8 8h8M8 12h8M8 16h5"],clock:["M12 20.5a8.5 8.5 0 1 0 0-17 8.5 8.5 0 0 0 0 17ZM12 7.5V12l3 2"],pointer:["M6 3.5 18.5 12l-5.6 1.3-2.7 5.2Z"]},Lu="http://www.w3.org/2000/svg",Fu=e=>{const[t,n]=Tu[e],r=document.createElementNS(Lu,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true");const o=document.createElementNS(Lu,"path");return o.setAttribute("d",t),"fill"===n?o.setAttribute("fill","currentColor"):(o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),r.appendChild(o),r},Ou=(e,t,n)=>{const r=document.createElement(e);return t&&(r.className=t),(n||[]).forEach((e=>{null!=e&&r.appendChild("string"==typeof e?document.createTextNode(e):e)})),r},Mu={position:"fixed",top:"0",left:"0",width:"0",height:"0",overflow:"visible","z-index":"2147483647",display:"block",margin:"0",padding:"0",border:"0",transform:"none",filter:"none","pointer-events":"none"},Pu=(e,t)=>{const n=document.createElement("div");n.className="gleap-capture-root rr-block gl-block",Object.keys(Mu).forEach((e=>n.style.setProperty(e,Mu[e],"important")));const r=n.attachShadow({mode:"open"});let o=!1;try{if("function"==typeof CSSStyleSheet&&"adoptedStyleSheets"in r){const e=new CSSStyleSheet;e.replaceSync(Au),r.adoptedStyleSheets=[e],o=!0}}catch(a){}if(!o){const e=document.createElement("style");W(e),e.textContent=Au,r.appendChild(e)}const i=Ou("div","root");return i.setAttribute("dir",t?"rtl":"ltr"),Ru(i,e),r.appendChild(i),{host:n,root:i}},Ru=(e,t)=>{const n=(()=>{try{const e=[document.body,document.documentElement];for(let n=0;nIu("rgb("+parseInt(e.substr(1,2),16)+","+parseInt(e.substr(3,2),16)+","+parseInt(e.substr(5,2),16)+")"))(r)||0;n&&o<.03?(e.style.setProperty("--accent","#f2f2f4"),e.style.setProperty("--on-accent","#0b0b0f")):(e.style.setProperty("--accent",r),e.style.setProperty("--on-accent",o>.45?"#0b0b0f":"#ffffff"))},Nu=e=>{try{e&&!e.isConnected&&(document.body||document.documentElement).appendChild(e)}catch(t){}},ju=e=>{let{src:t,from:n,to:r,radius:o,done:i}=e;const a=()=>{try{i()}catch(e){}},s=e=>e&&e.width>0&&e.height>0&&isFinite(e.x)&&isFinite(e.y);if((()=>{try{return!(!window.matchMedia||!window.matchMedia("(prefers-reduced-motion: reduce)").matches)}catch(e){return!1}})()||!t||!s(n)||!s(r)||"function"!=typeof Element.prototype.animate)return void a();let l=null;try{const e=Pu(null,!1);l=e.host;const i=Ou("div","flyer"),s=document.createElement("img");s.alt="",s.src=t,i.appendChild(s),i.style.width=n.width+"px",i.style.height=n.height+"px",i.style.borderRadius="14px",e.root.appendChild(i),Nu(l);const c=r.width/n.width,u=r.height/n.height,d=(o||16)*n.width/Math.max(1,r.width),p=i.animate([{transform:"translate("+n.x+"px,"+n.y+"px) scale(1)",borderRadius:"14px"},{transform:"translate("+(n.x+.55*(r.x-n.x))+"px,"+(Math.min(n.y,r.y)-30)+"px) scale("+(.5+.5*c)+")",borderRadius:"16px",offset:.55},{transform:"translate("+r.x+"px,"+r.y+"px) scale("+c+","+u+")",borderRadius:d+"px"}],{duration:620,easing:"cubic-bezier(0.3, 0.7, 0.2, 1)",fill:"forwards"});let h=!1;const f=()=>{if(!h){h=!0,a();try{i.animate([{opacity:1},{opacity:0}],{duration:120,fill:"forwards"}).onfinish=()=>{try{l.remove()}catch(e){}}}catch(e){l.remove()}}};p.onfinish=f,setTimeout(f,1200)}catch(c){try{l&&l.remove()}catch(u){}a()}};class Bu{constructor(e){let{labels:t,primaryColor:n,rtl:r,onAction:o}=e;xu(this,"host",null),xu(this,"root",null),xu(this,"pill",null),xu(this,"timer",null),xu(this,"ring",null),xu(this,"dot",null),xu(this,"pausedLabel",null),xu(this,"pauseButton",null),xu(this,"maxSec",0),xu(this,"micButton",null),xu(this,"progress",null),xu(this,"status",null),xu(this,"previewButtons",null),xu(this,"previewMedia",null),xu(this,"previewVideo",null),xu(this,"previewUrl",null),xu(this,"meter",null),xu(this,"position",null),xu(this,"cleanupDrag",null),xu(this,"cleanupKeys",null),xu(this,"autoFocus",!0),this.labels=Cu(t),this.onAction=o,this.rtl=!!r,this.primaryColor=/^#[0-9a-f]{6}$/i.test(n||"")?n:"#485BFF"}mount(){if(this.host)Ru(this.root,this.primaryColor);else{const e=Pu(this.primaryColor,this.rtl);this.host=e.host,this.root=e.root}this.ensureAttached()}ensureAttached(){Nu(this.host)}isOwnElement(e){return!(!this.host||!e||e!==this.host&&!this.host.contains(e))}setVisible(e){this.host&&this.host.style.setProperty("visibility",e?"visible":"hidden","important")}action(e){try{this.onAction&&this.onAction(e)}catch(t){}}button(e,t,n,r){const o=Ou("button",e,n);return o.type="button",r&&(o.setAttribute("aria-label",r),o.title=r),o.addEventListener("click",(e=>{e.stopPropagation(),o.disabled||"true"===o.getAttribute("aria-disabled")||this.action(t)})),o}closeButton(e){return this.button("ic x","cancel",[Fu("x")],e)}micToggle(e,t){if(!e||!e.available)return null;const n=this.button("ic","mic",[Fu(e.on?"mic":"micOff")],this.labels.microphone);return n.setAttribute("aria-pressed",e.on?"true":"false"),n.disabled=!!t,this.micButton=n,n}shutter(e,t,n,r){const o=[Ou("span","core",[r?Ou("span","spin"):"camera"===e?Fu("camera"):null])];if("stop"===e){const e=document.createElementNS(Lu,"svg");e.setAttribute("class","ring"),e.setAttribute("viewBox","0 0 46 46"),e.setAttribute("aria-hidden","true");const t=document.createElementNS(Lu,"circle");t.setAttribute("cx","23"),t.setAttribute("cy","23"),t.setAttribute("r",String(21.75)),t.setAttribute("stroke-dasharray",String(Du)),t.setAttribute("stroke-dashoffset",String(Du)),e.appendChild(t),o.unshift(e),this.ring=t}const i=this.button("shutter"+("camera"===e?"":" "+e),t,o,n);return r&&(i.setAttribute("aria-busy","true"),i.setAttribute("aria-disabled","true")),i}focus(e){try{this.autoFocus&&e&&e.focus({preventScroll:!0})}catch(t){}}reset(){if(this.cleanupDrag&&(this.cleanupDrag(),this.cleanupDrag=null),this.cleanupKeys&&(this.cleanupKeys(),this.cleanupKeys=null),this.previewUrl){try{URL.revokeObjectURL(this.previewUrl)}catch(e){}this.previewUrl=null}for(this.pill=this.timer=this.ring=this.dot=this.pausedLabel=this.pauseButton=null,this.micButton=this.progress=this.status=this.previewButtons=this.previewMedia=this.previewVideo=null,this.meter=null;this.root&&this.root.firstChild;)this.root.removeChild(this.root.firstChild)}listenForKeys(e){const t=t=>{try{if(t.defaultPrevented||t.isComposing||t.metaKey||t.ctrlKey||t.altKey)return;const n=document.activeElement;if(!(!n||n===document.body||n===document.documentElement||n===this.host))return;const r=t.composedPath?t.composedPath():[],o=r[0]&&"BUTTON"===r[0].tagName;"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this.action("cancel")):"Enter"===t.key&&e&&!o&&(t.preventDefault(),t.stopPropagation(),this.action(e))}catch(n){}};document.addEventListener("keydown",t,!0),this.cleanupKeys=()=>document.removeEventListener("keydown",t,!0)}showPill(e){let{label:t,content:n,buttons:r,focusIndex:o,recording:i,keys:a}=e;this.mount(),this.reset();const s=Ou("div","pill glass"+(i?" rec":""),n.concat(r));s.setAttribute("role","region"),s.setAttribute("aria-label",t),s.title="",this.place(s),this.enableDragging(s),this.root.appendChild(s),this.pill=s,null!==a&&this.listenForKeys(a),this.focus(r[o])}hint(e,t){const n=[Ou("span","h",[e])];t&&n.push((e=>{const t=Ou("span","k");return String(e).split(/(\{enter\}|\{esc\})/).forEach((e=>{"{enter}"===e?t.appendChild(Ou("kbd",null,["Enter"])):"{esc}"===e?t.appendChild(Ou("kbd",null,["Esc"])):e&&t.appendChild(document.createTextNode(e))})),t.setAttribute("aria-hidden","true"),t})(t));const r=Ou("div","txt",n);return r.firstChild.title=e,r}place(e){this.position&&(e.classList.add("moved"),e.style.left=this.position.left+"px",e.style.top=this.position.top+"px",e.style.bottom="auto")}enableDragging(e){let t=null;const n=n=>{try{t&&(this.position={left:Math.max(8,Math.min(window.innerWidth-e.offsetWidth-8,t.left+n.clientX-t.x)),top:Math.max(8,Math.min(window.innerHeight-e.offsetHeight-8,t.top+n.clientY-t.y))},this.place(e))}catch(r){}},r=()=>{t=null,e.classList.remove("dragging"),window.removeEventListener("pointermove",n,!0),window.removeEventListener("pointerup",r,!0),window.removeEventListener("pointercancel",r,!0)};e.addEventListener("pointerdown",(o=>{try{const i=(o.composedPath?o.composedPath():[]).some((e=>e&&"BUTTON"===e.tagName));if(o.button||i||window.innerWidth<=600)return;o.preventDefault();const a=e.getBoundingClientRect();t={x:o.clientX,y:o.clientY,left:a.left,top:a.top},e.classList.add("dragging"),window.addEventListener("pointermove",n,!0),window.addEventListener("pointerup",r,!0),window.addEventListener("pointercancel",r,!0)}catch(i){}})),e.title=this.labels.barDragHint,this.cleanupDrag=r}showScreenshotBar(e){const t=this.labels,n=this.shutter("camera","capture",t.barCapture,e);this.showPill({label:t.barCapture,content:[this.hint(t.barScreenshotHint,t.barCaptureKeys)],buttons:[n,this.closeButton(t.barCancel)],focusIndex:0,keys:e?null:"capture"})}showRecordBar(e){let{busy:t,mic:n,interrupted:r}=e;const o=this.labels,i=r?o.recordAgain:o.barStart,a=this.shutter("start","start",i,t),s=[this.micToggle(n,t),a,this.closeButton(o.barCancel)].filter(Boolean);this.showPill({label:i,content:[this.hint(r?o.recordingInterrupted:o.barRecordHint,o.barStartKeys)],buttons:s,focusIndex:s.indexOf(a),keys:t?null:"start"})}showPageRecordingOffer(){const e=this.labels,t=this.button("text-btn","record-page",[e.recordPage]);this.showPill({label:e.recordPage,content:[this.hint(e.recordPageHint)],buttons:[t,this.closeButton(e.barCancel)],focusIndex:0,keys:"record-page"})}showRecordingBar(e){let{mic:t,maxSec:n,canPause:r}=e;const o=this.labels;this.maxSec=n;const i=Ou("span","dot");i.setAttribute("aria-hidden","true");const a=Ou("b",null,[Eu(0)]),s=Ou("span","time",[a," ",Ou("span",null,["/ "+Eu(n)])]);s.setAttribute("role","timer");const l=Ou("span","label",[o.barPaused]);l.style.display="none";const c=Ou("div","rec-state",[i,l,s]),u=r?this.button("ic","pause",[Fu("pause")],o.barPause):null,d=this.shutter("stop","stop",o.barStop,!1),p=[this.micToggle(t),u,d].filter(Boolean);this.showPill({label:o.barRecording,content:[c,Ou("span","sep")],buttons:p,focusIndex:p.length-1,recording:!0,keys:null}),this.timer=a,this.dot=i,this.pausedLabel=l,this.pauseButton=u}updateTimer(e){if(this.timer&&(this.timer.textContent=Eu(e)),this.ring&&this.maxSec>0){const t=Math.max(0,Math.min(1,e/this.maxSec));this.ring.setAttribute("stroke-dashoffset",String(Du*(1-t)))}}setPaused(e){if(this.dot&&this.dot.classList.toggle("paused",!!e),this.pausedLabel){const t=this.pillRight();this.pausedLabel.style.display=e?"":"none",this.keepPillRight(t)}const t=this.pauseButton;if(t){const n=e?this.labels.barResume:this.labels.barPause;t.setAttribute("aria-label",n),t.title=n,t.replaceChild(Fu(e?"play":"pause"),t.firstChild)}}pillRight(){try{return this.pill?this.pill.getBoundingClientRect().right:null}catch(e){return null}}keepPillRight(e){const t=this.pill,n=this.pillRight();if(!t||null===e||null===n||window.innerWidth<=600)return;const r=n-e;if(!(Math.abs(r)<.5))if(this.position)this.position={left:this.position.left-r,top:this.position.top},this.place(t);else{const e=(parseFloat(t.style.marginLeft)||0)-r;t.style.marginLeft=Math.abs(e)<.5?"":e+"px"}}setMicOn(e){const t=this.micButton;t&&(t.setAttribute("aria-pressed",e?"true":"false"),t.replaceChild(Fu(e?"mic":"micOff"),t.firstChild))}showPreview(e){this.mount(),this.reset();const t=this.labels,n=Eu((e.durationMs||0)/1e3);let r;if(e.video){const o=document.createElement("video");o.playsInline=!0,o.preload="auto",o.muted=!1,o.addEventListener("loadedmetadata",(()=>{try{if(o.duration===1/0){const e=()=>{o.removeEventListener("timeupdate",e),o.currentTime=.05};o.addEventListener("timeupdate",e),o.currentTime=1e7}else o.currentTime=.05}catch(e){}}),{once:!0}),this.previewUrl=URL.createObjectURL(e.video),o.src=this.previewUrl;const i=Ou("span","chip",[Fu("play"),n]),a=Ou("button","play",[Ou("span",null,[Fu("play")])]);a.type="button",a.setAttribute("aria-label",t.previewPlay),a.addEventListener("click",(e=>{e.stopPropagation();try{a.remove(),i.remove(),o.controls=!0;const e=o.play();e&&e.catch&&e.catch((()=>{}))}catch(t){}})),r=Ou("div","media",[o,a,i]),this.previewVideo=o}else{const t=Ou("div","facts",[Ou("span",null,[Fu("clock"),n])]);"number"==typeof e.interactions&&t.appendChild(Ou("span",null,[Fu("pointer"),String(e.interactions)])),r=Ou("div","media summary",[Fu("page"),t])}this.previewMedia=r;const o=n+("boolean"==typeof e.audio?" \xb7 "+(e.audio?t.previewWithAudio:t.previewNoAudio):""),i=Ou("span","sheet-title",[t.previewTitle]);i.id="gl-title";const a=Ou("div","sheet-head",[Ou("div","txt",[i,Ou("span","sheet-sub",[o])]),this.closeButton(t.previewDiscard)]);this.status=Ou("div","status"),this.status.setAttribute("aria-live","polite"),this.status.style.display="none";const s={retake:this.button("btn g","retake",[t.previewRetake]),send:this.button("btn p","send",[t.previewSend,Fu("arrowUp")])};this.previewButtons=s;const l=Ou("div","sheet glass",[a,r,this.status,Ou("div","actions",[s.retake,s.send])]);l.setAttribute("role","dialog"),l.setAttribute("aria-labelledby",i.id),this.root.appendChild(l),this.listenForKeys(null),this.focus(s.send)}getPreviewRect(){try{if(!this.previewMedia)return null;const e=this.previewMedia.getBoundingClientRect();return e.width>0?{x:e.left,y:e.top,width:e.width,height:e.height}:null}catch(e){return null}}getPosterDataUrl(){try{const e=this.previewVideo;if(!e||e.readyState<2||!e.videoWidth)return null;const t=Math.min(1,480/Math.max(e.videoWidth,e.videoHeight)),n=document.createElement("canvas");return n.width=Math.max(1,Math.round(e.videoWidth*t)),n.height=Math.max(1,Math.round(e.videoHeight*t)),n.getContext("2d").drawImage(e,0,0,n.width,n.height),n.toDataURL("image/jpeg",.75)}catch(e){return null}}setUploading(e){if(!this.status)return;const t=this.previewButtons;t.retake.disabled=!0,t.send.setAttribute("aria-disabled","true"),t.send.setAttribute("aria-busy","true");const n=Math.round(100*Math.max(0,Math.min(1,e||0)));for(;t.send.firstChild;)t.send.removeChild(t.send.firstChild);if(t.send.appendChild(Ou("span","spin")),t.send.appendChild(document.createTextNode(n+"%")),!this.progress){this.status.className="status",this.status.style.display="none",this.progress=Ou("div");const e=Ou("div","meter",[this.progress]);e.setAttribute("role","progressbar"),e.setAttribute("aria-label",this.labels.uploading),this.previewMedia.parentNode.insertBefore(e,this.status),this.meter=e}this.progress.style.width=n+"%"}setPreviewError(e){if(!this.status)return;const t=this.previewButtons;if(this.meter){try{this.meter.remove()}catch(n){}this.meter=null}for(this.progress=null,this.status.className="status error",this.status.style.display="",this.status.textContent=e||this.labels.failed,t.retake.disabled=!1,t.send.removeAttribute("aria-disabled"),t.send.removeAttribute("aria-busy");t.send.firstChild;)t.send.removeChild(t.send.firstChild);t.send.appendChild(document.createTextNode(this.labels.previewSend)),t.send.appendChild(Fu("arrowUp"))}destroy(){this.reset();try{this.host&&this.host.remove()}catch(e){}this.host=this.root=this.onAction=null}}const _u="filter: blur(12px) !important;",Uu=_u+" -webkit-text-security: disc !important;",Hu=Oc.split(",").map((e=>":not("+e.trim()+")")).join(""),qu=e=>{try{return!(!e.matches||!e.matches(Oc))}catch(t){return!1}},zu=e=>{const t=":is("+e+"):not(html):not(body)"+Hu,n=["html:is("+e+") > body > *","body:is("+e+") > *"].map((e=>e+Hu)).join(", ");return{rules:[t+":not("+t+" *) { "+_u+" }",n+" { "+_u+" }"],fallback:e+" { "+_u+" }"}},Wu=(e,t)=>{const n=qc(e,t).map(zu);return n.push({rules:[jc()+" { "+_u+" }"],fallback:null}),function(e){e=e||{};var t=['input[type="password" i]',"input[data-rr-is-password]"];za.forEach((function(e){t.push('input[autocomplete~="'+e+'" i]','textarea[autocomplete~="'+e+'" i]')})),["input"+os,"textarea","select"].forEach((function(e){t.push(e+Wa,Wa+" "+e)}));var n=ns(e);return Object.keys(n).forEach((function(e){!n[e]||Ga.indexOf(e)>=0||!/^[a-z-]+$/.test(e)||("textarea"!==e&&"select"!==e?(t.push('input[type="'+e+'" i]'),"text"===e&&t.push("input:not([type])")):t.push(e))})),t}(e).forEach((e=>{n.push({rules:[e+" { "+Uu+" }"],fallback:null})})),n},Gu=(e,t)=>{let n=!1;if(t.rules.forEach((t=>{try{e.insertRule(t,e.cssRules.length),n=!0}catch(r){}})),!n&&t.fallback)try{e.insertRule(t.fallback,e.cssRules.length)}catch(r){}},Vu=()=>new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(r){n()}})),$u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.privacyOptions||{},n=Wu(t,e.maskSelectors),r=zc(t),o=Object.create(null),i=[],a=new WeakSet,s=[];let l=null,c=!1;const u=e=>{const t=(e=>{for(let n=0;nGu(t.sheet,e))),Object.keys(o).forEach((e=>Gu(t.sheet,zu("."+Uc(e))))),i.push(t)),t})(9===e.nodeType?e:e.ownerDocument);if(t&&!t.style)try{e.adoptedStyleSheets=Array.prototype.slice.call(e.adoptedStyleSheets||[]).concat([t.sheet]),t.roots.push(e)}catch(r){}},d=e=>{const t=e.classList;if(r.length&&t)for(let n=0;n(t.lastIndex=0,t.test(e))))){o[e]=!0;const t=zu("."+Uc(e));i.forEach((e=>Gu(e.sheet,t)))}}};let p=null;const h=(e,t)=>{!e||a.has(e)||t>8||(a.add(e),u(e),(e=>{if(l)try{l.observe(e,r.length?{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}:{childList:!0,subtree:!0})}catch(t){}})(e),p(e,t))},f=(e,t)=>{let n=null;try{n=e.contentDocument}catch(r){}n&&n.documentElement&&h(n,t)},g=(e,t)=>{d(e),e.shadowRoot&&h(e.shadowRoot,t+1),"IFRAME"!==e.tagName&&"FRAME"!==e.tagName||((e,t)=>{for(let o=0;o{c||f(e,t)};try{e.addEventListener("load",n),s.push({frame:e,onLoad:n})}catch(r){}f(e,t)})(e,t+1)};p=(e,t)=>{if(!c&&e)try{if(1===e.nodeType){if(qu(e))return;g(e,t)}const n=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>qu(e)?2:1});let r=n.nextNode();for(;r;)g(r,t),r=n.nextNode()}catch(n){}};const m=()=>{if(!c){c=!0;try{l&&l.disconnect()}catch(e){}l=null,s.forEach((t=>{try{t.frame.removeEventListener("load",t.onLoad)}catch(e){}})),s.length=0,i.forEach((t=>{t.roots.forEach((n=>{try{n.adoptedStyleSheets=Array.prototype.filter.call(n.adoptedStyleSheets||[],(e=>e!==t.sheet))}catch(e){}}));try{t.style&&t.style.parentNode&&t.style.parentNode.removeChild(t.style)}catch(e){}})),i.length=0;try{window.removeEventListener("pagehide",m)}catch(e){}}};try{window.addEventListener("pagehide",m),"function"==typeof MutationObserver&&(l=new MutationObserver((e=>{if(!c)try{e.forEach((e=>{if("attributes"!==e.type)for(let t=0;t{try{return window.sessionStorage.getItem(e)}catch(t){return null}},ed=(e,t)=>{try{null===t?window.sessionStorage.removeItem(e):window.sessionStorage.setItem(e,t)}catch(n){}},td=e=>{const t=parseInt(e,10);return isNaN(t)?120:Math.max(5,Math.min(180,t))},nd=e=>{if(!e)return"unknown";const t=e.name&&"Error"!==e.name?e.name:"",n=e.message?String(e.message):t?"":String(e);return(t&&n?t+": "+n:t||n).slice(0,120)},rd=e=>e>=200&&e<300,od=e=>{if(!e||"object"!=typeof e)return null;const t={x:Number(e.x),y:Number(e.y),width:Number(e.width),height:Number(e.height)};return isFinite(t.x)&&isFinite(t.y)&&t.width>0&&t.height>0?t:null};let id=0;class ad{constructor(){Ju(this,"session",null),Ju(this,"ui",null),Ju(this,"watchdog",null),Ju(this,"hiddenElements",[]),Ju(this,"hiddenEscape",null),Ju(this,"handledLogRequests",[]),Ju(this,"logsPostedFor",[]),Ju(this,"deviceId",null),Ju(this,"flight",null)}static getInstance(){return this.instance||(this.instance=new ad),this.instance}setCaptureEnabled(e){(e=>{pr=!!e})(e),e||(ed(Ku,null),this.session&&this.cancelSession(this.session,"disabled"));try{wv.instance&&wv.instance.sendCaptureCapabilities()}catch(t){}}setRemoteLogCollectionEnabled(e){(e=>{hr=!!e})(e)}getDeviceId(){if(this.deviceId)return this.deviceId;let e=Qu(Xu);return e&&/^web-[0-9a-f]{32}$/.test(e)||(e="web-"+(e=>{try{const t=new Uint8Array(e);return window.crypto.getRandomValues(t),Array.prototype.map.call(t,(e=>(e<16?"0":"")+e.toString(16))).join("")}catch(t){let n="";for(let r=0;r<2*e;r++)n+=Math.floor(16*Math.random()).toString(16);return n}})(16),ed(Xu,e)),this.deviceId=e,e}privacyOptions(){try{return vs.getInstance().customOptions||{}}catch(e){return{}}}maskSelectors(){const e=yr().maskSelectors;return Array.isArray(e)?e.filter((e=>"string"==typeof e)):[]}attachesLogs(e){return!!(e&&e.options&&e.options.attachLogs)&&fr()}applyVeil(e){this.liftVeil(e);try{e.veil=$u({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors()})}catch(t){e.veil=null}}liftVeil(e,t){const n=t||e.veil;if(n){e.veil===n&&(e.veil=null);try{n.remove()}catch(r){}}}handleMessengerMessage(e){try{const t=e&&e.data&&"object"==typeof e.data?e.data:{};switch(e&&e.name){case"capture-start":this.onCaptureStart(t);break;case"capture-cancel":this.onCaptureCancel(t);break;case"capture-editor":this.setEditorOpen(!!t.open);break;case"capture-done":this.onCaptureDone(t);break;case"capture-fly":this.onCaptureFly(t)}}catch(t){}}sendState(e,t,n){try{wv.getInstance().sendMessage({name:"capture-state",data:Object.assign({requestId:e,state:t},n)})}catch(r){}}setEditorOpen(e){try{wv.getInstance().setCaptureEditorOpen(e)}catch(t){}}onCaptureStart(e){const t="string"==typeof e.requestId?e.requestId:null,n="screenshot"===e.kind||"recording"===e.kind?e.kind:null;if(!t||!n)return;if(!Er())return this.sendState(t,"unsupported",{error:"capture-disabled"}),void Xs(t,"unsupported","capture-disabled");const r=this.session;if(r){if("uploading"===r.phase)return;r.requestId!==t?this.cancelSession(r,"replaced",!0):this.endSession(r,{restore:!1})}this.setEditorOpen(!1),this.startSession({requestId:t,kind:n,ticketShareToken:"string"==typeof e.ticketShareToken?e.ticketShareToken:null,options:e.options,labels:e.labels,resumed:!1,phase:"bar"})}onCaptureCancel(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||(this.endSession(t,{restore:!0}),this.sendState(t.requestId,"cancelled")),this.setEditorOpen(!1)}onCaptureDone(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||(t.pendingLogs&&!1!==e.sent&&this.postLogs(t.requestId,t.pendingLogs),t.pendingLogs=null,this.endSession(t,{restore:!0})),this.setEditorOpen(!1)}onCaptureFly(e){const t="string"==typeof e.requestId?e.requestId:null;if(!t)return;const n=this.flight&&this.flight.requestId===t&&Date.now()-this.flight.at<15e3?this.flight:null;this.flight=null;let r=od(e.to);try{const e=wv.getInstance().gleapFrame,t=e?e.getBoundingClientRect():null;r=r&&t&&t.width>0?{x:t.left+r.x,y:t.top+r.y,width:r.width,height:r.height}:null}catch(i){r=null}var o;ju({src:(o=e.src,"string"==typeof o&&o.length<=1048576&&/^data:image\/(jpeg|jpg|png|webp);base64,/i.test(o)?e.src:n?n.src:null),from:od(e.from)||(n?n.from:null),to:r,radius:"number"==typeof e.radius?e.radius:16,done:()=>{try{wv.getInstance().sendMessage({name:"capture-fly-done",data:{requestId:t}})}catch(i){}}})}onWidgetDestroyed(){const e=this.session;e&&("editor"!==e.phase?e.resumed=!0:this.endSession(e,{restore:!1}))}destroy(){this.session&&this.endSession(this.session,{restore:!1}),this.setEditorOpen(!1)}normalizeOptions(e){const t=e&&"object"==typeof e?e:{};return{annotate:!1!==t.annotate,maxDurationSec:td(t.maxDurationSec),audio:!0===t.audio,attachLogs:!1!==t.attachLogs,include:el(t.include)}}startSession(e){let t={};try{t=Rd.getInstance().getFlowConfig()||{}}catch(r){}const n={key:++id,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken||null,options:this.normalizeOptions(e.options),labels:Cu(e.labels),rawLabels:e.labels&&"object"==typeof e.labels?e.labels:null,resumed:!!e.resumed,phase:e.phase,interrupted:"interrupted"===e.phase,pageRecording:!0===e.pageRecording,micOn:!1,createdAt:"number"==typeof e.createdAt?e.createdAt:Date.now(),startedAt:Date.now(),lastTick:-1,lastProgressSent:0,lastStateAt:0,paused:!1};this.session=n;try{let o=!1;try{o=!!ub.getInstance().isRTLLayout}catch(r){}this.ui=new Bu({labels:e.labels,primaryColor:t.color,rtl:o,onAction:e=>this.onUiAction(n,e)}),this.ui.autoFocus=!n.resumed,this.renderBar(n)}catch(o){return void this.failSession(n,"failed",nd(o))}if(!n.resumed)try{wv.getInstance().setCaptureHidden(!0)}catch(r){}this.hideGleapUi(),this.startWatchdog(),this.persist(n),this.sendState(n.requestId,"bar")}renderBar(e){this.ui&&("screenshot"===e.kind?this.ui.showScreenshotBar(!1):this.ui.showRecordBar({busy:!1,mic:this.micState(e),interrupted:e.interrupted}))}micState(e){return!0===e.options.audio&&!0===yr().allowMicrophone&&this.usesScreenRecording(e)&&kr()?{available:!0,on:e.micOn}:null}usesScreenRecording(e){return"display"===Cr()&&!e.pageRecording}endSession(e,t){let{restore:n}=t;if(e&&this.session===e){this.session=null;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e);try{e.timeline&&e.timeline.stop()}catch(r){}try{e.upload&&e.upload.abort()}catch(r){}if(e.recording=null,e.timeline=null,e.upload=null,e.result=null,this.stopWatchdog(),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),this.ui){try{this.ui.destroy()}catch(r){}this.ui=null}if(this.showGleapUi(),ed(Ku,null),n)this.restoreWidget(e);else if(!e.resumed)try{wv.getInstance().setCaptureHidden(!1,!1)}catch(r){}}}restoreWidget(e){try{e.resumed?this.openConversation(e.ticketShareToken):wv.getInstance().setCaptureHidden(!1,!0)}catch(t){}}openConversation(e){e?$b.openConversation(e,!0):$b.open()}cancelSession(e,t,n){const r="editor"===e.phase;this.endSession(e,{restore:!n}),r||(this.sendState(e.requestId,"cancelled"),Xs(e.requestId,"released",t))}failSession(e,t,n){e&&this.session===e&&(this.endSession(e,{restore:!0}),this.sendState(e.requestId,t,{error:n}),Xs(e.requestId,"declined"===t||"unsupported"===t?t:"failed",n))}onUiAction(e,t){if(this.session===e)try{switch(t){case"capture":this.takeScreenshot(e);break;case"start":this.startRecording(e);break;case"record-page":e.pageRecording=!0,this.startRecording(e);break;case"stop":e.recording&&e.recording.stop();break;case"mic":this.toggleMicrophone(e);break;case"pause":this.togglePause(e);break;case"send":this.sendRecording(e);break;case"retake":this.retakeRecording(e);break;case"cancel":"fallback"===e.phase?this.failSession(e,e.fallbackState,e.fallbackReason):this.cancelSession(e,"cancelled")}}catch(n){this.failSession(e,"failed",nd(n))}}takeScreenshot(e){if("screenshot"!==e.kind||"bar"!==e.phase)return;const t=Sr(),n=t?tu():null;e.phase="capturing",this.ui.showScreenshotBar(!0),this.sendState(e.requestId,"capturing"),t&&this.setCaptureUiHidden(!0);let r=null;if(this.attachesLogs(e)&&-1===this.logsPostedFor.indexOf(e.requestId))try{r=nl({include:e.options.include,deviceId:this.getDeviceId()})}catch(i){}const o=()=>this.session===e;(e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=e;const a=()=>!i||i();return wu({streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,active:a}).then((e=>{if(!a())throw e&&Yc(e.canvas),new Error("aborted");return e||bu({privacyOptions:r,maskSelectors:o,isActive:a})})).then(ku)})({streamPromise:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isActive:o,setUiHidden:e=>{o()&&this.setCaptureUiHidden(e)}}).then((t=>{o()&&this.onScreenshotReady(e,t,r)})).catch((t=>{o()&&this.failSession(e,"failed",nd(t))}))}onScreenshotReady(e,t,n){const r=wv.getInstance(),o={name:"capture-image",data:{requestId:e.requestId,dataUrl:t.dataUrl,width:t.width,height:t.height,method:t.method,platform:dr,sdkType:ur,sdkVersion:vr()}};(()=>{try{const{host:e,root:t}=Pu(null,!1);t.appendChild(Ou("div","flash")),Nu(e),setTimeout((()=>{try{e.remove()}catch(t){}}),420)}catch(e){}})(),e.phase="editor",ed(Ku,null),this.stopWatchdog(),this.ui&&(this.ui.destroy(),this.ui=null),this.showGleapUi(),e.resumed?(this.openConversation(e.ticketShareToken),r.sendMessage(o,!0)):(r.sendMessage(o,!0),r.setCaptureHidden(!1,!0)),e.pendingLogs=n||null}postLogs(e,t){fr()&&-1===this.logsPostedFor.indexOf(e)&&(this.logsPostedFor.push(e),this.logsPostedFor.length>100&&this.logsPostedFor.shift(),Qs(e,t).catch((()=>{})))}setCaptureUiHidden(e){if(this.ui&&this.ui.setVisible(!e),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),e){this.hideGleapUi();const e=this.session;this.hiddenEscape=t=>{try{"Escape"===t.key&&e&&this.session===e&&this.cancelSession(e,"cancelled")}catch(n){}},document.addEventListener("keydown",this.hiddenEscape,!0)}}startRecording(e){if("recording"!==e.kind||-1===["bar","interrupted","fallback"].indexOf(e.phase))return;const t=()=>this.session===e,n=e.options.maxDurationSec,r=n=>{t()&&(n!==e.lastTick?(e.lastTick=n,this.ui&&this.ui.updateTimer(n),this.sendRecordingState(e)):e.paused&&Date.now()-e.lastStateAt>=1e3&&this.sendRecordingState(e))},o=n=>{t()&&this.onRecordingStopped(e,n)},i=n=>{t()&&this.failSession(e,"failed",nd(n))};if(this.usesScreenRecording(e)){const a=Ps(xr());this.applyVeil(e);const s=e.veil;return e.phase="starting",this.ui.showRecordBar({busy:!0,mic:this.micState(e),interrupted:e.interrupted}),void a.then((e=>(s?s.ready():Promise.resolve()).then((()=>e)))).then((a=>{if(!t())return eu(a),null;const l=new Rs({maxDurationSec:n,onTick:r,onStop:o,onError:i,onReleased:()=>{s&&this.liftVeil(e,s)}});return e.recording=l,l.start(a,!!this.micState(e)&&e.micOn).then((n=>{t()?this.onRecordingStarted(e,l.startedAt,n.hasMicrophone):l.cancel()}))})).catch((n=>{t()&&this.offerPageRecording(e,n)}))}const a=new _s({maxDurationSec:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),onTick:r,onStop:o,onError:i});e.recording=a,a.start(),this.onRecordingStarted(e,a.startedAt,!1)}offerPageRecording(e,t){const n=t&&t.name;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e),e.phase="fallback",e.recording=null,e.fallbackState="NotAllowedError"===n||"SecurityError"===n?"declined":"failed",e.fallbackReason=nd(t),this.ui.showPageRecordingOffer(),this.persist(e),this.sendState(e.requestId,"bar")}sendRecordingState(e){e.lastStateAt=Date.now();const t={elapsedSec:Math.max(0,e.lastTick)};e.paused&&(t.paused=!0),this.sendState(e.requestId,"recording",t)}togglePause(e){const t=e.recording;if("recording"!==e.phase||!t||"function"!=typeof t.pause)return;const n=Date.now();if(e.paused){if(!t.resume())return;e.paused=!1,e.timeline&&e.timeline.resume(n)}else{if(!t.pause())return;e.paused=!0,e.timeline&&e.timeline.pause(n)}this.ui&&this.ui.setPaused(e.paused),this.sendRecordingState(e)}onRecordingStarted(e,t,n){e.phase="recording",e.interrupted=!1,e.paused=!1,e.hasMicrophone=!!n,e.lastTick=0,e.timeline=new zs({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isOwnElement:e=>!(!this.ui||!this.ui.isOwnElement(e))}),e.timeline.start(t),this.ui.showRecordingBar({mic:e.hasMicrophone?{available:!0,on:e.micOn}:null,maxSec:e.options.maxDurationSec,canPause:this.usesScreenRecording(e)&&br()&&!!e.recording&&!!e.recording.pause}),this.persist(e),this.sendRecordingState(e)}toggleMicrophone(e){"recording"!==e.phase&&"bar"!==e.phase&&"interrupted"!==e.phase||(e.micOn=!e.micOn,"recording"===e.phase&&e.recording&&e.recording.setMicrophoneEnabled&&e.recording.setMicrophoneEnabled(e.micOn),this.ui.setMicOn(e.micOn))}onRecordingStopped(e,t){this.liftVeil(e),e.recording=null,e.result=t,e.pauses=e.timeline?e.timeline.pauses.map((e=>[e[0],e[1]||t.endedAt])):[],e.timelineEntries=e.timeline?e.timeline.stop(t.endedAt):[];const n=e.timeline?e.timeline.interactions:0;e.timeline=null,e.phase="preview",e.paused=!1;const r=0===t.type.indexOf("video/");this.ui.showPreview({video:r?t.blob:null,durationMs:t.durationMs,interactions:n,audio:r?!!e.hasMicrophone:void 0}),this.persist(e),this.sendState(e.requestId,"preview")}retakeRecording(e){"preview"===e.phase&&(e.result=null,e.uploadedUrl=null,e.timelineEntries=null,e.pauses=null,e.phase="bar",e.interrupted=!1,this.renderBar(e),this.persist(e),this.sendState(e.requestId,"bar"))}sendRecording(e){const t=e.result;if("preview"!==e.phase||!t)return;const n=()=>this.session===e;e.phase="uploading",this.ui.setUploading(0),this.sendState(e.requestId,"uploading",{progress:0});let r=null;if(this.attachesLogs(e))try{r=nl({include:e.options.include,windowStart:t.startedAt,windowEnd:t.endedAt,pauses:e.pauses||[],deviceId:this.getDeviceId()})}catch(a){}const o=t=>{if(!n())return;this.ui&&this.ui.setUploading(t);const r=Date.now();(r-e.lastProgressSent>250||t>=1)&&(e.lastProgressSent=r,this.sendState(e.requestId,"uploading",{progress:Math.round(100*t)/100}))};let i;e.uploadedUrl?i=Promise.resolve(e.uploadedUrl):(e.upload=((e,t,n)=>{let r=null;return{promise:new Promise(((o,i)=>{try{const a=Bm.getInstance(),s=new FormData;s.append("file",e,t),r=new XMLHttpRequest,r.open("POST",a.apiUrl+"/uploads/attachments"),a.injectSession(r),r.upload&&n&&(r.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&n(Math.min(1,e.loaded/e.total))}),r.onreadystatechange=()=>{if(4!==r.readyState)return;const e=$s(r.responseText);200===r.status&&e&&Array.isArray(e.fileUrls)&&"string"==typeof e.fileUrls[0]?o(e.fileUrls[0]):i(new Error(413===r.status?"file-too-large":"upload-failed-"+r.status))},r.onerror=()=>i(new Error("upload-failed")),r.onabort=()=>i(new Error("upload-aborted")),r.send(s)}catch(a){i(a)}})),abort:()=>{try{r&&r.abort()}catch(a){}}}})(t.blob,t.fileName,o),i=e.upload.promise),i.then((o=>{if(!n())return null;e.upload=null,e.uploadedUrl=o;const i={url:o,name:t.fileName,type:t.type,size:t.blob.size,durationMs:t.durationMs};return t.width>0&&t.height>0&&(i.width=t.width,i.height=t.height),(a=e.requestId,s={files:[i],method:t.method,platform:dr,sdkType:ur,sdkVersion:vr(),deviceId:this.getDeviceId(),annotations:[],timeline:e.timelineEntries||[],recordingStartedAt:new Date(t.startedAt).toISOString(),recordingEndedAt:new Date(t.endedAt).toISOString()},Ks(a,"complete",s)).then((o=>{if(n())if(rd(o.status)){r&&this.postLogs(e.requestId,r);const n=this.ui?this.ui.getPosterDataUrl():null,o=this.ui?this.ui.getPreviewRect():null;this.flight=n&&o?{requestId:e.requestId,src:n,from:o,at:Date.now()}:null;const i=0===t.type.indexOf("video/");this.endSession(e,{restore:!0});const a={durationSec:Math.floor((t.durationMs||0)/1e3)};n&&(a.thumbnail=n),i&&(a.audio=!!e.hasMicrophone),this.sendState(e.requestId,"done",a)}else 409===o.status||410===o.status?(this.endSession(e,{restore:!0}),this.sendState(e.requestId,"failed",{error:409===o.status?"already-completed":"request-closed"})):this.onUploadFailed(e,"complete-"+o.status)}));var a,s})).catch((t=>{n()&&this.onUploadFailed(e,nd(t))}))}onUploadFailed(e,t){e.upload=null,e.phase="preview",this.ui&&this.ui.setPreviewError(e.labels.failed),this.sendState(e.requestId,"preview",{error:t})}hideGleapUi(){try{const e=document.querySelectorAll(Zu);for(let t=0;t{try{e.style.removeProperty("visibility")}catch(t){}})),this.hiddenElements=[]}startWatchdog(){this.stopWatchdog(),this.watchdog=setInterval((()=>{try{this.ui&&this.ui.ensureAttached(),this.hideGleapUi()}catch(e){}}),1e3)}stopWatchdog(){this.watchdog&&(clearInterval(this.watchdog),this.watchdog=null)}persist(e){if(this.session!==e)return;let t=null;if(-1!==["bar","capturing","starting","fallback"].indexOf(e.phase)?t=e.interrupted?"recording":"bar":"recording"===e.kind&&-1!==["recording","preview","uploading","interrupted"].indexOf(e.phase)&&(t="recording"),!t)return void ed(Ku,null);let n=null,r=null;try{const e=Bm.getInstance();n=e.session?e.session.gleapId:null,r=e.sdkKey}catch(o){}try{ed(Ku,JSON.stringify({v:1,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken,options:e.options,labels:e.rawLabels,phase:t,pageRecording:!0===e.pageRecording,gleapId:n,sdkKey:r,at:e.createdAt}))}catch(o){}}resumeFromStorage(){try{if(this.session)return;const n=Qu(Ku);if(!n)return;let r=null;try{r=JSON.parse(n)}catch(t){}const o=Bm.getInstance();if(!(r&&1===r.v&&"string"==typeof r.requestId&&("screenshot"===r.kind||"recording"===r.kind)&&"number"==typeof r.at&&Date.now()-r.at<18e5&&o.session&&r.gleapId===o.session.gleapId&&r.sdkKey===o.sdkKey)||!Er())return void ed(Ku,null);(e=r.requestId,Js("GET","/v3/shared/capture-requests/"+encodeURIComponent(String(e)))).then((e=>{try{const t=e.data;if(e.status>=400&&e.status<500||t&&-1!==Yu.indexOf(t.status)||t&&t.expiresAt&&Date.parse(t.expiresAt)100&&this.handledLogRequests.shift(),e.expiresAt&&Date.parse(e.expiresAt){this.collectLogs(t,n).catch((()=>{}))}))}catch(t){}}collectLogs(e,t){if(!fr())return Xs(e,"unsupported","disabled-by-app");if(!1===yr().backgroundLogs)return Xs(e,"unsupported","disabled-by-project");const n=this.getDeviceId();return((e,t)=>Ks(e,"claim",t))(e,{deviceId:n,platform:dr,sdkType:ur,sdkVersion:vr()}).then((r=>!rd(r.status)||r.data&&r.data.claimedElsewhere?null:Promise.resolve().then((()=>Qs(e,nl({include:t.include,deviceId:n})))).then((t=>rd(t.status)?null:Xs(e,"failed","logs-"+t.status)),(t=>Xs(e,"failed",nd(t))))))}}function sd(e){return sd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sd(e)}function ld(e){return function(e){if(Array.isArray(e))return cd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return cd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1])||arguments[1],o=(t=e.innerText||"",n=40,t.length>n?t.slice(0,n)+"...":t).replace(/(\r\n|\n|\r)/gm,"").replace(/ +(?= )/g,""),i="",a="";if(void 0!==e.getAttribute){var s=e.getAttribute("id");s&&(i=' id="'.concat(s,'"'));var l=e.getAttribute("class");l&&(a=' class="'.concat(l,'"'))}var c=(e.tagName||"").toLowerCase(),u="<",d=">";return r||(u="[",d="]"),"".concat(u).concat(c).concat(i).concat(a).concat(d).concat(o).concat(u,"/").concat(c).concat(d)}(e.target),"CLICK")}}))}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&wd(t.prototype,n),r&&wd(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Id(e){return Id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Id(e)}function Dd(e,t){for(var n=0;n0)for(var e=0;e0&&(t+="#"+e.id);var n="";"string"==typeof e.className?n=e.className:"function"==typeof e.getAttribute&&(n=e.getAttribute("class")||"");for(var r=n.trim().split(/\s+/).filter(Boolean).slice(0,5),o=0;o"}if(3===e.nodeType){var i=String(e.nodeValue||"").trim();return'#text "'+(i.length>40?i.slice(0,40)+"\u2026":i)+'"'}return String(e.nodeName).toLowerCase()},zd=function e(t,n){try{var r="Error",o="",i="";try{r=t.name?String(t.name):"Error",o=void 0!==t.message&&null!==t.message?String(t.message):"",i="string"==typeof t.stack?t.stack.trim():""}catch(u){}var a=o.length>0?r+": "+o:r,s=a;if(i.length>0)s=(o.length>0?-1!==i.indexOf(o):0===i.indexOf(r))?i:a+"\n"+i;var l,c=n||0;try{l=t.cause}catch(u){}return null!=l&&c<3&&(s+="\nCaused by: "+(_d(l)?e(l,c+1):Xd(l,1e3))),s}catch(u){return"Error"}},Wd=function(e,t){var n=e.maxLength-e.length;if(t.length>n)throw e.parts.push(t.slice(0,Math.max(0,n))),e.length=e.maxLength,e.truncated=!0,jd;e.parts.push(t),e.length+=t.length},Gd=function(e,t){var n=e.maxLength-e.length;Wd(e,JSON.stringify(t.length>n?t.slice(0,n):t))},Vd=function(e,t){try{return{value:e[t]}}catch(n){return{failed:!0}}},$d=function(e,t,n,r,o,i){Wd(e,t);for(var a=Math.min(r,100),s=0;s0&&Wd(e,","),o(s,i+1);r>a&&Wd(e,",\u2026 "+(r-a)+" more"),Wd(e,n)},Jd=function e(t,n,r){var o=Nd(n);if(null!==n)if("string"!==o)if("number"!==o&&"boolean"!==o&&"undefined"!==o)if("bigint"!==o)if("symbol"!==o)if("function"!==o)if(-1===t.seen.indexOf(n))if(_d(n)){var i="Error",a="";try{i=String(n.name||"Error"),a=String(n.message||"")}catch(f){}Gd(t,a?i+": "+a:i)}else if(Ud(n))Wd(t,qd(n));else if(function(e){return!!e&&"object"===Nd(e)&&e.window===e&&!!e.document}(n))Wd(t,"[Window]");else{var s=Bd(n);if("[object Date]"!==s)if("[object RegExp]"!==s)if("[object Promise]"!==s&&"[object WeakMap]"!==s&&"[object WeakSet]"!==s)if("[object ArrayBuffer]"!==s&&"[object SharedArrayBuffer]"!==s)if("undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(n))Wd(t,s.slice(8,-1)+"("+("number"==typeof n.length?n.length:n.byteLength)+")");else if(r>=t.maxDepth)Wd(t,Array.isArray(n)?"[Array]":"[Object]");else{t.seen.push(n);try{if(Array.isArray(n))return void $d(t,"[","]",n.length,(function(r,o){var i=Vd(n,r);i.failed?Wd(t,'"[unreadable]"'):e(t,i.value,o)}),r);if("[object Map]"===s){var l=[];return n.forEach((function(e,t){l.length<100&&l.push([t,e])})),void $d(t,"Map("+n.size+"){","}",n.size,(function(n,r){e(t,l[n][0],r),Wd(t," => "),e(t,l[n][1],r)}),r)}if("[object Set]"===s){var c=[];return n.forEach((function(e){c.length<100&&c.push(e)})),void $d(t,"Set("+n.size+")[","]",n.size,(function(n,r){return e(t,c[n],r)}),r)}if("function"==typeof n.toJSON){var u;try{u=n.toJSON()}catch(f){u=n}if(u!==n)return void e(t,u,r)}var d=Object.keys(n),p=function(e){try{var t=Object.getPrototypeOf(e);if(!t||t===Object.prototype)return"";var n=t.constructor;return n&&"string"==typeof n.name&&"Object"!==n.name?n.name:""}catch(f){return""}}(n);$d(t,(p?p+" ":"")+"{","}",d.length,(function(r,o){Gd(t,d[r]),Wd(t,":");var i=Vd(n,d[r]);i.failed?Wd(t,'"[unreadable]"'):e(t,i.value,o)}),r)}finally{t.seen.pop()}}else Wd(t,s.slice(8,-1)+"("+n.byteLength+")");else Wd(t,s.slice(8,-1));else Wd(t,String(n));else{var h=n.getTime();Gd(t,isNaN(h)?"Invalid Date":n.toISOString())}}else Wd(t,'"[Circular]"');else Wd(t,Hd(n));else Wd(t,n.toString());else Wd(t,n.toString()+"n");else Wd(t,String(n));else Gd(t,n);else Wd(t,"null")},Kd=function(e,t,n){var r=function(e,t){return{parts:[],length:0,maxLength:e,maxDepth:t,seen:[],truncated:!1}}(t,"number"==typeof n?n:1/0);try{Jd(r,e,0)}catch(o){if(o!==jd)return{text:r.parts.join("")+"[unserializable]",truncated:!1}}return{text:r.parts.join(""),truncated:r.truncated}},Xd=function(e,t){var n="number"==typeof t&&t>0?t:5e3;try{if("string"==typeof e)return e.length>n?e.slice(0,n):e;if(null==e||"number"==typeof e||"boolean"==typeof e)return String(e);if("bigint"==typeof e)return e.toString()+"n";if("symbol"===Nd(e))return e.toString();if("function"==typeof e)return Hd(e);if(_d(e)){var r=zd(e);return r.length>n?r.slice(0,n):r}if(Ud(e))return qd(e);if("[object Date]"===Bd(e)){var o=e.getTime();return isNaN(o)?"Invalid Date":e.toISOString()}return Kd(e,n,4).text}catch(i){try{return Bd(e)}catch(a){return"[unserializable]"}}},Yd=function(e){try{return"bigint"==typeof e?e:"symbol"===Nd(e)?NaN:Number(e)}catch(t){return NaN}},Zd=function(e){var t=Yd(e);return"bigint"==typeof t?t.toString()+"n":isNaN(t)?"NaN":String(t<0?Math.ceil(t):Math.floor(t))},Qd=function(e){var t=Yd(e);return String("bigint"==typeof t?Number(t):t)},ep=function(e,t){var n="number"==typeof t&&t>0?t:5e3;try{if(!e||0===e.length)return"";var r="",o=0,i=e[0];if("string"==typeof i&&e.length>1&&-1!==i.indexOf("%")){o=1;for(var a=0;a=e.length)r+=s;else{var c=e[o++];a++;var u=Math.max(1,n-r.length);"s"===l?r+=Xd(c,u):"d"===l||"i"===l?r+=Zd(c):"f"===l?r+=Qd(c):"c"!==l&&(r+="string"==typeof c?JSON.stringify(c.slice(0,u)):Xd(c,u))}else r+="%",a++}else r+=s}}for(;o0&&(r+=" "),r+=Xd(e[o],Math.max(1,n-r.length));return r.length>n?r.slice(0,n):r}catch(d){return"[unserializable console arguments]"}};function tp(e){return tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tp(e)}function np(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"INFO";if(null!=e&&("string"!=typeof e&&(e=Xd(e,sp)),!(e.length<=0)))for(this.logArray.push({log:lp(e,t),date:(new Date).toISOString(),priority:t});this.logArray.length>this.logMaxLength;)this.logArray.shift()}},{key:"addLogWithArgs",value:function(e,t){!e||e.length<=0||this.addLog(ep(e,sp),t)}},{key:"capture",value:function(e){if(!this.disabled&&!this.capturing){this.capturing=!0;try{e()}catch(t){}finally{this.capturing=!1}}}},{key:"wrapConsoleMethod",value:function(e,t,n){var r=e[t];if("function"==typeof r&&!r.__gleapConsoleWrapper){var o=function(){return n(arguments),r.apply(e,arguments)};o.__gleapConsoleWrapper=!0,this.originalConsoleMethods[t]=r,this.consoleWrappers[t]=o,e[t]=o}}},{key:"start",value:function(){var e=this;if(!this.disabled&&!this.started&&"undefined"!=typeof window){this.started=!0;var t=this,n=window.console;if(n){for(var r=Object.keys(ip),o=function(){var o=r[i];e.wrapConsoleMethod(n,o,(function(e){t.capture((function(){return t.addLogWithArgs(e,ip[o])}))}))},i=0;i0&&e[0]||t.capture((function(){var n=ep(Array.prototype.slice.call(e,1),sp);t.addLog("Assertion failed"+(n?": "+n:""),"ERROR")}))}))}try{this.errorListener=function(e){t.capture((function(){return t.addUncaughtError(e)}))},this.rejectionListener=function(e){t.capture((function(){var n=e?e.reason:void 0;t.addLog("Unhandled promise rejection: "+Xd(n,sp),"ERROR")}))},window.addEventListener("error",this.errorListener),window.addEventListener("unhandledrejection",this.rejectionListener)}catch(a){}}}},{key:"addUncaughtError",value:function(e){if(e&&("undefined"==typeof ErrorEvent||e instanceof ErrorEvent)){var t,n=e.error;t=n&&"object"===tp(n)&&"string"==typeof n.stack&&n.stack.length>0?zd(n):null!=n?Xd(n,sp)+cp(e):String(e.message||"Script error.").replace(/^Uncaught\s+/,"")+cp(e),this.addLog("Uncaught "+t,"ERROR")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&np(t.prototype,n),r&&np(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function dp(e){return dp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dp(e)}function pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hp(e){for(var t=1;t0&&-1===t.indexOf(r)&&t.push(r)}return t},Lp=function(e,t){if("string"!=typeof e||!Array.isArray(t))return!1;for(var n=0;n0&&-1!==e.indexOf(r))return!0}return!1},Fp=function(e,t){return"string"==typeof t&&-1!==e.props.indexOf(t.toLowerCase())},Op=function(e,t){for(var n={},r=!1,o=Object.keys(e),i=0;i0&&Fp(t,l)?o=!0:r.push(a)}return o?r.join("&"):e},jp=function(e){if(e>500)throw new Error("Network log body is nested too deeply to redact.")},Bp=function e(t,n,r){jp(r);var o=!1;if(Array.isArray(t)){for(var i=0;i0&&-1===n.indexOf(i)&&n.push(i)}for(var a=Hp.exec(e),s=a?e.slice(0,a.index):e,l=s,c=0;c0?"?"+a:"")+(-1===n?"":e.slice(n))}(n.url,t)),n.request&&"object"===Sp(n.request)&&!Array.isArray(n.request)){var r=Object.assign({},n.request),o=Pp(r.headers,"content-type");void 0!==r.headers&&(r.headers=Mp(r.headers,t)),void 0!==r.payload&&(r.payload=zp(r.payload,o,t)),n.request=r}if(n.response&&"object"===Sp(n.response)&&!Array.isArray(n.response)){var i=Object.assign({},n.response),a=Pp(i.headers,"content-type");void 0!==i.headers&&(i.headers=Mp(i.headers,t)),void 0!==i.responseText&&(i.responseText=zp(i.responseText,a,t)),n.response=i}return n},Gp=function(e,t){var n=[];if(!Array.isArray(e))return n;for(var r=function(e){for(var t=Tp(e).map((function(e){return e.toLowerCase()})),n=[],r=0;r0}))&&n.push(o)}return{props:t,paths:n}}(t&&t.propsToIgnore),o=Tp(Cp.concat(t&&t.blacklist||[])),i=0;i=55296&&n<=56319&&(t-=1),e.slice(0,t)+ih(e.length<=1e6?function(e){for(var t=0,n=0;n=55296&&r<=56319&&n+1=56320&&o<=57343?(t+=4,n++):t+=3}else t+=3}return t}(e):void 0)},sh=function(e,t){for(var n=t.toLowerCase(),r=Object.keys(e),o=0;o=2&&lh(t,String(e[n][0]),String(e[n][1]));else for(var r=Object.keys(e),o=0;o0&&lh(t,n[r].slice(0,o).trim(),n[r].slice(o+1).trim())}return t},ph=function(e){var t=String(e);try{var n="undefined"!=typeof document&&document.baseURI?document.baseURI:"undefined"!=typeof window&&window.location?window.location.href:void 0;return new URL(t,n).href}catch(r){return t}},hh=function(e,t,n,r){var o,i=e.byteLength>Xp||"number"==typeof r&&r>Xp,a=e.byteLength>Xp?e.subarray(0,Xp):e;try{if(n){if(-1!==(o=new TextDecoder("utf-8",{fatal:!0}).decode(a,{stream:i})).indexOf("\0"))return Zp}else o=function(e){var t=/charset\s*=\s*"?([^";\s]+)/i.exec(e||"");if(t)try{return new TextDecoder(t[1])}catch(n){}return new TextDecoder("utf-8")}(t).decode(a,{stream:i})}catch(s){return n?Zp:Ip}return i?o+ih("number"==typeof r?r:void 0):o},fh=function(e,t,n){var r=e.getReader(),o=[],i=0,a=function(e){for(var r=new Uint8Array(i),a=0,s=0;s0&&(o.push(n instanceof Uint8Array?n:new Uint8Array(n)),i+=n.byteLength),i>Xp){try{r.cancel().catch((function(){}))}catch(s){}return a(!1)}return e()}))}()},gh=function(e,t,n){var r=e.size>Xp?e.slice(0,150001):e;return("function"==typeof r.arrayBuffer?r.arrayBuffer():new Promise((function(e,t){var n=new FileReader;n.onload=function(){return e(n.result)},n.onerror=function(){return t(n.error)},n.readAsArrayBuffer(r)}))).then((function(r){return hh(new Uint8Array(r),t,n,e.size)}))},mh=function(e,t){if(null==e)return{text:""};try{var n=nh(t);if("stream"===n)return{text:Qp};if("string"==typeof e)return{text:"binary"===n?Zp:ah(e)};var r=function(e){return Object.prototype.toString.call(e)}(e);if("[object URLSearchParams]"===r)return{text:ah(e.toString())};if("[object FormData]"===r)return{text:(s=e,l={},s.forEach((function(e,t){var n;n="string"==typeof e?e.length>1e4?e.slice(0,1e4)+"\u2026 [truncated]":e:"[file "+(e&&e.name?e.name:"blob")+", "+(e&&"number"==typeof e.size?e.size:0)+" bytes"+(e&&e.type?", "+e.type:"")+"]",Object.prototype.hasOwnProperty.call(l,t)?l[t]=[].concat(l[t],n):Object.defineProperty(l,t,{value:n,enumerable:!0,writable:!0,configurable:!0})})),ah(JSON.stringify(l)))};if("[object ReadableStream]"===r)return{text:Qp};if("[object Blob]"===r||"[object File]"===r){var o=t||e.type||"",i=nh(o);return"stream"===i?{text:Qp}:"binary"===i?{text:Zp}:{text:Yp,promise:gh(e,o,"unknown"===i)}}if("[object ArrayBuffer]"===r||"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)){if("binary"===n)return{text:Zp};var a="[object ArrayBuffer]"===r?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{text:hh(a,t,"unknown"===n,a.byteLength)}}return"[object Document]"===r||"[object HTMLDocument]"===r||"[object XMLDocument]"===r?{text:Ip}:{text:"binary"===n?Zp:ah(String(e))}}catch(c){return{text:Ip}}var s,l},vh=function(e,t,n){e[t]=n.text,n.promise&&n.promise.then((function(n){e[t]=n}),(function(){e[t]=Ip}))},yh=function(e){try{if(e&&"object"===Kp(e)){var t=e.name?String(e.name):"Error",n=e.message?String(e.message):"";return n?t+": "+n:t}return String(e)}catch(r){return"Error"}},bh=function(e,t){return"abort"===e?"AbortError: The request was aborted.":"timeout"===e?"TimeoutError: The request timed out"+(t.timeout?" after "+t.timeout+" ms.":"."):"string"==typeof e&&-1!==e.indexOf(":")?e:"NetworkError: The request failed."},wh=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),$p(this,"requestId",0),$p(this,"requests",{}),$p(this,"externalRequests",[]),$p(this,"maxRequests",30),$p(this,"localFilters",[]),$p(this,"remoteFilters",[]),$p(this,"localBlacklist",[]),$p(this,"sdkApiUrlEntry",null),$p(this,"remoteBlacklist",[]),$p(this,"initialized",!1),$p(this,"stopped",!1),$p(this,"loadAllResources",!1),$p(this,"internalXhrs","undefined"!=typeof WeakSet?new WeakSet:null),$p(this,"internalUrls",new Map)}var t,n,r;return t=e,n=[{key:"ignoreInternalRequest",value:function(e,t,n){try{if(t&&this.internalXhrs&&this.internalXhrs.add(t),!e)return;var r=ph(e),o="number"==typeof n&&isFinite(n)?n:rh(),i=this.internalUrls.get(r);for(this.internalUrls.delete(r),this.internalUrls.set(r,"number"==typeof i?Math.min(i,o):o);this.internalUrls.size>300;)this.internalUrls.delete(this.internalUrls.keys().next().value)}catch(a){}}},{key:"isInternalResource",value:function(e){var t=this.internalUrls.get(e.name);return"number"==typeof t&&e.startTime>=t-5}},{key:"setLoadAllResources",value:function(e){this.loadAllResources=e}},{key:"setExternalRequests",value:function(e){var t=[];if(Array.isArray(e))for(var n=0;n0?e.timeOrigin:e.timing&&e.timing.navigationStart>0?e.timing.navigationStart:Date.now()-e.now()}(window.performance),s=window.performance.getEntriesByType("resource"),l=0;lthis.maxRequests?t.slice(t.length-this.maxRequests):t}},{key:"setMaxRequests",value:function(e){e>70&&(e=70),this.maxRequests=e}},{key:"setStopped",value:function(e){this.stopped=e}},{key:"setFilters",value:function(e){this.localFilters=Tp(e)}},{key:"setRemoteFilters",value:function(e){this.remoteFilters=Tp(e)}},{key:"setBlacklist",value:function(e){this.localBlacklist=Tp(e)}},{key:"setRemoteBlacklist",value:function(e){this.remoteBlacklist=Tp(e)}},{key:"getFilters",value:function(){return Tp(this.remoteFilters.concat(this.localFilters))}},{key:"setSdkApiUrl",value:function(e){this.sdkApiUrlEntry=function(e){if("string"!=typeof e)return null;var t=e.trim().replace(/\/+$/,"");return/^https?:\/\/[^/\s]+/i.test(t)?t:null}(e)}},{key:"getBlacklist",value:function(){return Tp(Cp.concat(this.sdkApiUrlEntry?[this.sdkApiUrlEntry]:[],this.remoteBlacklist,this.localBlacklist))}},{key:"isCapturing",value:function(){return this.initialized&&!this.stopped}},{key:"cleanRequests",value:function(){var e=Object.keys(this.requests);if(e.length>this.maxRequests)for(var t=e.slice(0,e.length-this.maxRequests),n=0;n=0&&c<=Xp)return void l.text().then((function(e){return i(ah(e))}),(function(){return i(Ip)}));i(Ip)}catch(u){i(Ip)}}},{key:"failFetch",value:function(e,t){var n=e.request;n.duration=oh(e.start),n.success=!1,n.response={errorText:yh(t)}}},{key:"interceptXhr",value:function(){if("undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof WeakMap){var e=this,t=new WeakMap,n=XMLHttpRequest.prototype,r=n.open,o=n.send,i=n.setRequestHeader;n.open=function(n,o){try{e.onXhrOpen(t,this,n,o)}catch(i){}return r.apply(this,arguments)},n.setRequestHeader=function(e,n){try{var r=t.get(this);r&&r.capture&&!r.request&&lh(r.headers,String(e),String(n))}catch(o){}return i.apply(this,arguments)},n.send=function(n){var r=!1;try{r=e.onXhrSend(t,this,n)}catch(i){}try{return o.apply(this,arguments)}catch(a){if(r)try{e.finishXhr(this,t.get(this),yh(a))}catch(i){}throw a}}}}},{key:"onXhrOpen",value:function(e,t,n,r){var o=e.get(t);if(o||(o={listening:!1},e.set(t,o)),o.request&&!o.finished){var i=4===t.readyState?void 0:"AbortError: The request was replaced by a new one.";this.finishXhr(t,o,i)}o.request=null,o.finished=!1,o.failure=null,o.headersAt=null,o.method=String(n||"GET").toUpperCase(),o.url=ph(r),o.headers={},o.capture=this.isCapturing()&&!(this.internalXhrs&&this.internalXhrs.has(t))&&!Lp(o.url,this.getBlacklist()),o.capture&&!o.listening&&(o.listening=!0,this.listenToXhr(t,o))}},{key:"listenToXhr",value:function(e,t){var n=this,r=function(n){return function(){4===e.readyState&&(t.failure=n)}};e.addEventListener("readystatechange",(function(){try{2===e.readyState&&t.request&&!t.finished&&n.recordXhrHeaders(e,t)}catch(r){}})),e.addEventListener("error",r("error")),e.addEventListener("abort",r("abort")),e.addEventListener("timeout",r("timeout")),e.addEventListener("loadend",(function(){try{4===e.readyState&&n.finishXhr(e,t)}catch(r){}}))}},{key:"onXhrSend",value:function(e,t,n){var r=e.get(t);if(!r||!r.capture||r.request||!this.isCapturing())return!1;var o=rh(),i=this.createRequest(r.method,r.url);if(!i)return r.capture=!1,!1;i.request.headers=Object.assign({},r.headers);var a="GET"!==r.method&&"HEAD"!==r.method;return vh(i.request,"payload",a?mh(n,ch(r.headers,"content-type")):{text:""}),r.request=i,r.start=o,!0}},{key:"recordXhrHeaders",value:function(e,t){t.headersAt=rh();var n=t.request;n.duration=Math.max(0,Math.round(t.headersAt-t.start)),n.success=!0,n.response={status:e.status,statusText:e.statusText||"",headers:dh(e.getAllResponseHeaders()),responseText:Yp}}},{key:"finishXhr",value:function(e,t,n){if(t&&t.request&&!t.finished){t.finished=!0;var r=t.request,o=n||t.failure||(0===e.status?"error":null);if(o)return r.duration=oh(t.start),r.success=!1,void(r.response={errorText:bh(o,e)});r.duration=t.headersAt?Math.max(0,Math.round(t.headersAt-t.start)):oh(t.start),r.success=!0;var i,a=dh(e.getAllResponseHeaders());try{i=function(e,t){var n=nh(ch(t,"content-type"));if("stream"===n)return Qp;var r=e.responseType;if(""===r||"text"===r){if("binary"===n)return Zp;var o=e.responseText;return"string"!=typeof o?"":"unknown"===n&&-1!==o.slice(0,Xp).indexOf("\0")?Zp:ah(o)}if("json"===r){if(null===e.response||void 0===e.response)return"";var i=Kd(e.response,Xp);return i.truncated?i.text+ih():i.text}return"document"===r?Ip:Zp}(e,a)}catch(s){i=Ip}r.response={status:e.status,statusText:e.statusText||"",headers:a,responseText:i}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Vp(t.prototype,n),r&&Vp(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();$p(wh,"instance",void 0);const kh=wh;function xh(e){return xh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xh(e)}function Sh(){Sh=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new L(r||[]);return o(a,"_invoke",{value:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(F([])));x&&x!==n&&r.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(o,i,a,s){var l=d(e[o],e,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==xh(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=f;var c=d(t,n,r);if("normal"===c.type){if(o=r.done?g:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function D(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,D(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function F(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Ch(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function Eh(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ch(i,r,o,a,s,"next",e)}function s(e){Ch(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ih(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"),e&&e.childNodes&&e.childNodes.length>0)for(var o=0;o1?t-1:0),o=1;o0&&(n--,t+=e[r]):t+=e[r];return t}(n)},Rh=function(e,t,n){for(var r,o=[],i=function(){var e=n.styleSheets[a];if(e.media&&"print"===e.media.mediaText)return 1;var i=Ph(e);if(e&&e.ownerNode)if(""!=i){var s=n.getElementsByTagName("base");r=s.length?s[0].href.substr(n.location.origin.length,999):n.location.href.split(/[?#]/)[0],e.href&&(r=e.href);var l=r.substring(0,r.lastIndexOf("/"));o.push(Lh(i,l,t).then((function(t){return{styletext:t,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}})))}else o.push(Promise.resolve({styletext:i,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}))},a=0;a0&&t>0&&Math.abs(e-t)>1?e/t:1};return{x:n(e.width,t.width),y:n(e.height,t.height)}},nf=function(e){for(var t=Zh(e);t;t=Zh(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return tf(t.getBoundingClientRect(),ef(t,n))}return{x:1,y:1}},rf=function(e,t){return{left:e.left/t.x,right:e.right/t.x,top:e.top/t.y,bottom:e.bottom/t.y,width:e.width/t.x,height:e.height/t.y}},of=function(e){var t=e.createElement("span");return Gh(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return Gh(t.style,e,"0")})),t},af=function e(t,n,r){return Yh(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(t);if("none"!==o.display&&!Kh(o))if("contents"===o.display||Jh(o))e(t,n,r);else{var i=rf(t.getBoundingClientRect(),n),a={left:i.left-Vh(o,"margin-left"),right:i.right+Vh(o,"margin-right"),top:i.top-Vh(o,"margin-top"),bottom:i.bottom+Vh(o,"margin-bottom"),verticalAlign:o.verticalAlign};0===o.display.indexOf("inline")?("baseline"!==a.verticalAlign||zh.test(t.localName)||(a.verticalAlign="middle"),r.atomicInlines.push(a)):r.blocks.push(a)}}})),r},sf=function(e,t,n){var r=function(e){return(e.top+e.bottom)/2},o=[];n.forEach((function(e){for(var n=0,i=1;ia.bottom-a.top)&&(o[n]=e)}));for(var i=0;i=a.top+a.height/2&&e.appendChild(e.ownerDocument.createElement("br"));var s=o[i],l=of(e.ownerDocument);Gh(l.style,"vertical-align",s?s.verticalAlign:"baseline"),$h(l.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(l)}},lf=function e(t,n,r){Yh(n).forEach((function(n){if(n.nodeType!==Node.TEXT_NODE){if(n.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(n).display;"contents"===o?e(t,n,r):"none"!==o&&t.appendChild(xf(n,t.ownerDocument,!0,r))}}else!function(e,t){var n=Qh(t);if(n.length){var r=nf(t),o=e.ownerDocument.createElement("span");Gh(o.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return Gh(o.style,e,"0")})),sf(o,n.map((function(e){return rf(e,r)})),[]),e.appendChild(o)}}(t,n)}))},cf=function(e){return!("block"!==e.display&&"list-item"!==e.display||Kh(e)||Xh(e)||/layout|paint|strict|content/.test(e.contain))},uf=function(e,t,n,r){if(!(t instanceof HTMLElement))return!1;var o=e.offsetTop,i=e.offsetTop+e.offsetHeight;if(t.offsetParent===e)o=0,i=e.clientHeight;else if(t.offsetParent!==e.offsetParent)return!1;var a=t.offsetTop-("relative"===n.position?Vh(n,"top"):0),s="top"===r?a-o:a+t.offsetHeight-i;return Math.abs(s)<=1},df=function(e,t,n,r){return r.push(Vh(t,"margin-"+n)),!cf(t)||Vh(t,"padding-"+n)||Vh(t,"border-"+n+"-width")||pf(e,Yh(e),n,r),r},pf=function e(t,n,r,o){"bottom"===r&&n.reverse();for(var i=0;i0))return!1;if(a.nodeType===Node.ELEMENT_NODE){var s=window.getComputedStyle(a);if("none"!==s.display&&!Kh(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!uf(t,a,s,r))return!1;if(df(a,s,r,o),0!==a.getBoundingClientRect().height||!cf(s))return!1;df(a,s,"top"===r?"bottom":"top",o)}else if(!e(t,Yh(a),r,o))return!1}}var l;return!0},hf=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},ff=null,gf=new Map,mf=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return gf.has(n)||((ff=ff||document.createElement("canvas").getContext("2d")).font=n,gf.set(n,ff.measureText("").fontBoundingBoxAscent)),gf.get(n)},vf=function e(t,n,r){var o=Yh(t);n&&o.reverse();for(var i=0;i0||t.scrollLeft>0)&&(m.setAttribute("bb-scrollpos",!0),m.setAttribute("bb-scrolltop",t.scrollTop),m.setAttribute("bb-scrollleft",t.scrollLeft)),"SELECT"!==v&&"TEXTAREA"!==v&&"INPUT"!==v||(y=rs(t,r),m.setAttribute("bb-data-value",y?y(t.value):t.value),y&&m.hasAttribute("value")&&m.setAttribute("value",y(m.getAttribute("value"))),"checkbox"!==t.type&&"radio"!==t.type||!t.checked||m.setAttribute("bb-data-checked",!0));case 42:if(o.appendChild(m),!t.shadowRoot){e.next=51;break}return C=i,i++,Bh(a,t.shadowRoot),e.next=49,g(t.shadowRoot.firstChild,m,C);case 49:jh(t.shadowRoot,m,C),void 0!==m.setAttribute&&m.setAttribute("bb-shadow-parent",C);case 51:if(y&&"TEXTAREA"===v){e.next=54;break}return e.next=54,g(t.firstChild,m);case 54:if(y&&"SELECT"===v)for(E=m.querySelectorAll("option[selected]"),I=0;I0){for(u=c.childNodes;u.length>0;)c.parentNode.insertBefore(u[0],c);c.remove()}for(d=s.querySelectorAll("script, noscript"),a=0;a({x:e,y:e}),Mf={left:"right",right:"left",bottom:"top",top:"bottom"},Pf={start:"end",end:"start"};function Rf(e,t,n){return Tf(e,Af(t,n))}function Nf(e,t){return"function"==typeof e?e(t):e}function jf(e){return e.split("-")[0]}function Bf(e){return e.split("-")[1]}function _f(e){return"x"===e?"y":"x"}function Uf(e){return"y"===e?"height":"width"}const Hf=new Set(["top","bottom"]);function qf(e){return Hf.has(jf(e))?"y":"x"}function zf(e){return _f(qf(e))}function Wf(e){return e.replace(/start|end/g,(e=>Pf[e]))}const Gf=["left","right"],Vf=["right","left"],$f=["top","bottom"],Jf=["bottom","top"];function Kf(e,t,n,r){const o=Bf(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Vf:Gf:t?Gf:Vf;case"left":case"right":return t?$f:Jf;default:return[]}}(jf(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Wf)))),i}function Xf(e){return e.replace(/left|right|bottom|top/g,(e=>Mf[e]))}function Yf(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Zf(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Qf(e,t,n){let{reference:r,floating:o}=e;const i=qf(t),a=zf(t),s=Uf(a),l=jf(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Bf(t)){case"start":h[a]-=p*(n&&c?-1:1);break;case"end":h[a]+=p*(n&&c?-1:1)}return h}async function eg(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Nf(t,e),f=Yf(h),g=s[p?"floating"===d?"reference":"floating":d],m=Zf(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=Zf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+f.top)/b.y,bottom:(w.bottom-m.bottom+f.bottom)/b.y,left:(m.left-w.left+f.left)/b.x,right:(w.right-m.right+f.right)/b.x}}const tg=new Set(["left","top"]);function ng(){return"undefined"!=typeof window}function rg(e){return ag(e)?(e.nodeName||"").toLowerCase():"#document"}function og(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ig(e){var t;return null==(t=(ag(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ag(e){return!!ng()&&(e instanceof Node||e instanceof og(e).Node)}function sg(e){return!!ng()&&(e instanceof Element||e instanceof og(e).Element)}function lg(e){return!!ng()&&(e instanceof HTMLElement||e instanceof og(e).HTMLElement)}function cg(e){return!(!ng()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof og(e).ShadowRoot)}const ug=new Set(["inline","contents"]);function dg(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Sg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ug.has(o)}const pg=new Set(["table","td","th"]);function hg(e){return pg.has(rg(e))}const fg=[":popover-open",":modal"];function gg(e){return fg.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const mg=["transform","translate","scale","rotate","perspective"],vg=["transform","translate","scale","rotate","perspective","filter"],yg=["paint","layout","strict","content"];function bg(e){const t=wg(),n=sg(e)?Sg(e):e;return mg.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||vg.some((e=>(n.willChange||"").includes(e)))||yg.some((e=>(n.contain||"").includes(e)))}function wg(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const kg=new Set(["html","body","#document"]);function xg(e){return kg.has(rg(e))}function Sg(e){return og(e).getComputedStyle(e)}function Cg(e){return sg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Eg(e){if("html"===rg(e))return e;const t=e.assignedSlot||e.parentNode||cg(e)&&e.host||ig(e);return cg(t)?t.host:t}function Ig(e){const t=Eg(e);return xg(t)?e.ownerDocument?e.ownerDocument.body:e.body:lg(t)&&dg(t)?t:Ig(t)}function Dg(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ig(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=og(o);if(i){const e=Ag(a);return t.concat(a,a.visualViewport||[],dg(o)?o:[],e&&n?Dg(e):[])}return t.concat(o,Dg(o,[],n))}function Ag(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tg(e){const t=Sg(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=lg(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Lf(n)!==i||Lf(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Lg(e){return sg(e)?e:e.contextElement}function Fg(e){const t=Lg(e);if(!lg(t))return Of(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Tg(t);let a=(i?Lf(n.width):n.width)/r,s=(i?Lf(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Og=Of(0);function Mg(e){const t=og(e);return wg()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Og}function Pg(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Lg(e);let a=Of(1);t&&(r?sg(r)&&(a=Fg(r)):a=Fg(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==og(e))&&t}(i,n,r)?Mg(i):Of(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=og(i),t=r&&sg(r)?og(r):r;let n=e,o=Ag(n);for(;o&&r&&t!==n;){const e=Fg(o),t=o.getBoundingClientRect(),r=Sg(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=og(o),o=Ag(n)}}return Zf({width:u,height:d,x:l,y:c})}function Rg(e,t){const n=Cg(e).scrollLeft;return t?t.left+n:Pg(ig(e)).left+n}function Ng(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Rg(e,n),y:n.top+t.scrollTop}}const jg=25;const Bg=new Set(["absolute","fixed"]);function _g(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=og(e),r=ig(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=wg();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=Rg(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=jg&&(i-=a)}else c<=jg&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=ig(e),n=Cg(e),r=e.ownerDocument.body,o=Tf(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Tf(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Rg(e);const s=-n.scrollTop;return"rtl"===Sg(r).direction&&(a+=Tf(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(ig(e));else if(sg(t))r=function(e,t){const n=Pg(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=lg(e)?Fg(e):Of(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Mg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Zf(r)}function Ug(e,t){const n=Eg(e);return!(n===t||!sg(n)||xg(n))&&("fixed"===Sg(n).position||Ug(n,t))}function Hg(e,t,n){const r=lg(t),o=ig(t),i="fixed"===n,a=Pg(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Of(0);function c(){l.x=Rg(o)}if(r||!r&&!i)if(("body"!==rg(t)||dg(o))&&(s=Cg(t)),r){const e=Pg(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?Of(0):Ng(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function qg(e){return"static"===Sg(e).position}function zg(e,t){if(!lg(e)||"fixed"===Sg(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ig(e)===n&&(n=n.ownerDocument.body),n}function Wg(e,t){const n=og(e);if(gg(e))return n;if(!lg(e)){let t=Eg(e);for(;t&&!xg(t);){if(sg(t)&&!qg(t))return t;t=Eg(t)}return n}let r=zg(e,t);for(;r&&hg(r)&&qg(r);)r=zg(r,t);return r&&xg(r)&&qg(r)&&!bg(r)?n:r||function(e){let t=Eg(e);for(;lg(t)&&!xg(t);){if(bg(t))return t;if(gg(t))return null;t=Eg(t)}return null}(e)||n}const Gg={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=ig(r),s=!!t&&gg(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Of(1);const u=Of(0),d=lg(r);if((d||!d&&!i)&&(("body"!==rg(r)||dg(a))&&(l=Cg(r)),lg(r))){const e=Pg(r);c=Fg(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?Of(0):Ng(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:ig,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?gg(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Dg(e,[],!1).filter((e=>sg(e)&&"body"!==rg(e))),o=null;const i="fixed"===Sg(e).position;let a=i?Eg(e):e;for(;sg(a)&&!xg(a);){const t=Sg(a),n=bg(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Bg.has(o.position)||dg(a)&&!n&&Ug(e,a))?r=r.filter((e=>e!==a)):o=t,a=Eg(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce(((e,n)=>{const r=_g(t,n,o);return e.top=Tf(r.top,e.top),e.right=Af(r.right,e.right),e.bottom=Af(r.bottom,e.bottom),e.left=Tf(r.left,e.left),e}),_g(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Wg,getElementRects:async function(e){const t=this.getOffsetParent||Wg,n=this.getDimensions,r=await n(e.floating);return{reference:Hg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Tg(e);return{width:t,height:n}},getScale:Fg,isElement:sg,isRTL:function(e){return"rtl"===Sg(e).direction}};function Vg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $g(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Lg(e),u=o||i?[...c?Dg(c):[],...Dg(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=ig(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-Ff(d)+"px "+-Ff(o.clientWidth-(u+p))+"px "+-Ff(o.clientHeight-(d+h))+"px "+-Ff(u)+"px",threshold:Tf(0,Af(1,l))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==l){if(!g)return a();r?a(!1,r):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==r||Vg(c,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let g=l?Pg(e):null;return l&&function t(){const r=Pg(e);g&&!Vg(g,r)&&n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Jg=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=jf(n),s=Bf(n),l="y"===qf(n),c=tg.has(a)?-1:1,u=i&&l?-1:1,d=Nf(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Kg=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Nf(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),p=qf(jf(o)),h=_f(p);let f=u[h],g=u[p];if(a){const e="y"===h?"bottom":"right";f=Rf(f+d["y"===h?"top":"left"],f,f-d[e])}if(s){const e="y"===p?"bottom":"right";g=Rf(g+d["y"===p?"top":"left"],g,g-d[e])}const m=l.fn({...t,[h]:f,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:s}}}}}},Xg=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=Nf(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=jf(o),y=qf(s),b=jf(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),k=p||(b||!g?[Xf(s)]:function(e){const t=Xf(e);return[Wf(e),t,Wf(t)]}(s)),x="none"!==f;!p&&x&&k.push(...Kf(s,g,f,w));const S=[s,...k],C=await l.detectOverflow(t,m),E=[];let I=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Bf(e),o=zf(e),i=Uf(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Xf(a)),[a,Xf(a)]}(o,a,w);E.push(C[e[0]],C[e[1]])}if(I=[...I,{placement:o,overflows:E}],!E.every((e=>e<=0))){var D,A;const e=((null==(D=i.flip)?void 0:D.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&y!==qf(t))||I.every((e=>qf(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}}}let n=null==(A=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(h){case"bestFit":{var T;const e=null==(T=I.filter((e=>{if(x){const t=qf(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Yg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Nf(e,t)||{};if(null==c)return{};const d=Yf(u),p={x:n,y:r},h=zf(o),f=Uf(h),g=await a.getDimensions(c),m="y"===h,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[h]-p[h]-i.floating[f],k=p[h]-i.reference[h],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let S=x?x[b]:0;S&&await(null==a.isElement?void 0:a.isElement(x))||(S=s.floating[b]||i.floating[f]);const C=w/2-k/2,E=S/2-g[f]/2-1,I=Af(d[v],E),D=Af(d[y],E),A=I,T=S-g[f]-D,L=S/2-g[f]/2+C,F=Rf(A,L,T),O=!l.arrow&&null!=Bf(o)&&L!==F&&i.reference[f]/2-(L{const r=new Map,o={platform:Gg,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Qf(c,r,l),p=r,h={},f=0;for(let m=0;m0)},nm=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(tm);if(0===n.length)return!0;var r=n.filter((function(e){return!em.includes(e.pageFilterType)})),o=n.filter((function(e){return em.includes(e.pageFilterType)})),i=0===r.length||r.some((function(t){return Qg(e,t.pageFilter,t.pageFilterType)})),a=0===o.length||o.every((function(t){return Qg(e,t.pageFilter,t.pageFilterType)}));return i&&a};function rm(e){return rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rm(e)}function om(e){return function(e){if(Array.isArray(e))return im(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return im(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return im(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function im(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n'):""),i.appendChild(c),o=c,t.elementToTooltipMap.set(e,n),t.anchorToElementMap.set(i,e)}else o=e;var u=t.createTooltip(o,n.html,n);t.elementToFloatingUIMap.set(e,sm(sm({},u),{},{anchor:i,positionedHost:a,data:n})),i&&t.repositionHotspot(e,n)}})),cm(this,"updateFilteredTooltips",(function(){t.lastUrl=window.location.href,t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),cm(this,"getFilteredTooltips",(function(){if(!t.tooltips)return[];var e=window.location.href;return t.tooltips.filter((function(t){return t.pageRules&&t.pageRules.length>0?nm(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!Qg(e,t.page,t.pageType)}))})),cm(this,"checkForTooltips",(function(){for(var e=0;e0&&this.filteredTooltips.forEach((function(n){n.selector&&et(e,n.selector)&&t.linkTooltip(e,n)}))}},{key:"start",value:function(){var e,t,n,r=this;"undefined"==typeof window||this.started||(this.started=!0,this.resizeListener=(e=r.updateHotspotPositions.bind(r),t=250,n=null,function(){if(!n){var r=this,o=arguments;n=setTimeout((function(){e.call.apply(e,[r].concat(om(o))),n=null}),t)}}),window.addEventListener("resize",this.resizeListener),this.urlCheckInterval=setInterval((function(){r.checkUrlChange()}),1e3),!this.observer&&"undefined"!=typeof MutationObserver&&document.documentElement&&(this.observer=new MutationObserver((function(e){r.checkUrlChange(),e.forEach((function(e){if("attributes"===e.type){var t=e.target;t.nodeType===Node.ELEMENT_NODE&&(t.querySelector("[data-gleap-tooltip-hotspot]")||t.hasAttribute("data-gleap-tooltip-mode")||t.hasAttribute("data-gleap-tooltip"))&&r.updateHotspotPositions()}e.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&r.processNodeInsertion(e)})),e.removedNodes.forEach((function(e){e.nodeType!==Node.ELEMENT_NODE||e.isConnected||r.processNodeRemoval(e)}))}))})),this.observer.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})))}},{key:"checkUrlChange",value:function(){var e=this;this.lastUrl!==window.location.href&&(this.lastUrl=window.location.href,this.filteredTooltips=this.getFilteredTooltips(),document.querySelectorAll("[data-gleap-tooltip]").forEach((function(t){var n=e.elementToFloatingUIMap.get(t);n&&-1===e.filteredTooltips.indexOf(n.data)&&e.unlinkElement(t)})),this.checkForTooltips())}},{key:"processNodeRemoval",value:function(e){var t=this,n=Array.from(e.querySelectorAll("[data-gleap-tooltip]"));e.hasAttribute("data-gleap-tooltip")&&n.push(e),n.forEach((function(e){t.elementToFloatingUIMap.has(e)&&t.unlinkElement(e)}));var r=Array.from(e.querySelectorAll("[data-gleap-tooltip-anchor]"));e.hasAttribute("data-gleap-tooltip-anchor")&&r.push(e),r.forEach((function(e){var n=t.anchorToElementMap.get(e),r=n?t.elementToFloatingUIMap.get(n):null;if(n&&n.isConnected&&r&&r.anchor===e){var o=r.data;t.unlinkElement(n),-1!==t.filteredTooltips.indexOf(o)&&t.linkTooltip(n,o)}}))}},{key:"isLinked",value:function(e){var t=this.elementToFloatingUIMap.get(e);return!(!t||t.anchor&&!t.anchor.isConnected||!t.tooltip||!t.tooltip.isConnected)}},{key:"unlinkElement",value:function(e){var t=this.elementToFloatingUIMap.get(e);if(t){try{t.cleanup()}catch(o){}t.tooltip&&t.tooltip.remove(),t.anchor&&t.anchor.remove(),this.restoreHost(t.positionedHost),this.elementToFloatingUIMap.delete(e)}var n=e.getAttribute("data-gleap-tooltip");if(null!==n){Array.from(e.children).forEach((function(e){e.getAttribute("data-gleap-tooltip-anchor")===n&&e.remove()}));var r=e.nextElementSibling;r&&r.getAttribute("data-gleap-tooltip-anchor")===n&&r.remove()}e.removeAttribute("data-gleap-tooltip"),e.removeAttribute("data-gleap-tooltip-mode"),this.elementToTooltipMap.delete(e)}},{key:"updateHotspotPositions",value:function(){var e=this;document.querySelectorAll("[data-gleap-tooltip-mode='hotspot']").forEach((function(t){var n=e.elementToTooltipMap.get(t);n&&e.repositionHotspot(t,n)}))}},{key:"createTooltip",value:function(e,t,n){var r=document.createElement("div");r.className="gleap-tooltip",r.innerHTML='
\n '.concat(t,'\n
\n \n \n \n
\n
'),document.body.appendChild(r),this.livePopups.add(r);var o,i=r.querySelector(".gleap-tooltip-arrow"),a=$g(e,r,(function(){Zg(e,r,{placement:"left"===n.posX?"left":"right",middleware:[Jg(10),Xg(),Kg(),Yg({element:i})]}).then((function(e){var t=e.x,n=e.y,o=e.middlewareData,a=e.placement;try{if(Object.assign(r.style,{left:"".concat(t,"px"),top:"".concat(n,"px")}),o.arrow){var s={left:"",top:"",transform:""};null!=o.arrow.x&&(s.left="".concat(o.arrow.x,"px"),"bottom"===a?(s.transform="translateY(-7px) rotate(180deg)",s.top="".concat(-20,"px")):"top"===a&&(s.transform="translateY(7px) rotate(0deg)",s.top="100%")),null!=o.arrow.y&&(s.top="".concat(o.arrow.y,"px"),"right"===a?(s.transform="translateX(-7px) rotate(90deg)",s.left="".concat(-20,"px")):"left"===a&&(s.transform="translateX(7px) rotate(270deg)",s.left="100%")),Object.assign(i.style,s)}}catch(l){}}))}));function s(){clearTimeout(o),r.style.visibility="visible",r.style.opacity="1",r.style.pointerEvents="auto"}function l(){o=setTimeout((function(){r.style.opacity="0",setTimeout((function(){r.style.visibility="hidden",r.style.pointerEvents="none"}),200)}),500)}return e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",l),r.addEventListener("mouseenter",s),r.addEventListener("mouseleave",l),e.addEventListener("click",l),r.addEventListener("click",l),{cleanup:function(){a(),clearTimeout(o),e.removeEventListener("mouseenter",s),e.removeEventListener("mouseleave",l),e.removeEventListener("click",l)},tooltip:r}}},{key:"canEmbed",value:function(e){var t=new Set(["area","base","br","embed","hr","img","input","source","track","wbr","canvas"]);return e&&!t.has(e.tagName.toLowerCase())}},{key:"destroy",value:function(){var e=this;this.observer&&(this.observer.disconnect(),this.observer=null),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.urlCheckInterval&&(clearInterval(this.urlCheckInterval),this.urlCheckInterval=null),document.querySelectorAll("[data-gleap-tooltip]").forEach((function(t){var n=e.elementToFloatingUIMap.get(t);if(n){try{n.cleanup()}catch(r){}e.restoreHost(n.positionedHost)}})),document.querySelectorAll(".gleap-tooltip").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip-anchor]").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip-hotspot]").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip]").forEach((function(e){return e.removeAttribute("data-gleap-tooltip")})),document.querySelectorAll("[data-gleap-tooltip-mode]").forEach((function(e){return e.removeAttribute("data-gleap-tooltip-mode")})),this.elementToFloatingUIMap=new WeakMap,this.elementToTooltipMap=new WeakMap,this.anchorToElementMap=new WeakMap,this.livePopups=new WeakSet,this.tooltips=[],this.filteredTooltips=[],this.lastUrl=null,this.started=!1}},{key:"repositionHotspot",value:function(e,t){if(e&&t){var n=this.elementToFloatingUIMap.get(e),r=n?n.anchor:null;if(r){var o=r.querySelector("[data-gleap-tooltip-hotspot]");if(o){if(n.positionedHost&&n.positionedHost.host){var i=n.positionedHost.host;try{var a=window.getComputedStyle(i).position;a&&"static"!==a||(i.style.position="relative")}catch(v){}}t.posX||(t.posX="right"),t.posY||(t.posY="center"),t.offsetX=this.toOffset(t.offsetX,4),t.offsetY=this.toOffset(t.offsetY,0);var s=e.getBoundingClientRect(),l={left:s.left,top:s.top,width:s.width,height:s.height};try{if(r.parentNode===e){var c=document.createRange();c.setStart(e,0),c.setEndBefore(r);var u=c.getBoundingClientRect();if(u&&u.width>0){var d=u.right-l.left;d>0&&de.length)&&(t=e.length);for(var n=0,r=new Array(t);n4096)return!1;var t=e.split(".");return 3===t.length&&t.every((function(e){return vm.test(e)}))},wm=function(e){if(!bm(e))return null;try{var t,n=JSON.parse(ym(e.split(".")[1]));if(!n||"object"!==mm(n))return null;var r=null!==(t=n.userId)&&void 0!==t?t:n.user_id;return"string"==typeof r&&r.length>0||"number"==typeof r&&isFinite(r)?{userId:String(r),exp:"number"==typeof n.exp?n.exp:null}:null}catch(o){return null}},km=function(e){if(!bm(e))return null;try{var t=JSON.parse(ym(e.split(".")[1]));return t&&"object"===mm(t)?{sid:"string"==typeof t.sid?t.sid:null,uid:"string"==typeof t.uid?t.uid:null,iat:"number"==typeof t.iat?t.iat:null,exp:"number"==typeof t.exp?t.exp:null}:null}catch(n){return null}},xm=function(e){for(var t=5381,n=0;n>>0).toString(36)},Sm=["iat","exp","nbf","jti"],Cm=function e(t){return Array.isArray(t)?"["+t.map(e).join(",")+"]":t&&"object"===mm(t)?"{"+Object.keys(t).sort().map((function(n){return JSON.stringify(n)+":"+e(t[n])})).join(",")+"}":JSON.stringify(t)},Em=function(e){if(!bm(e))return null;try{var t=fm(e.split(".").slice(0,2).map((function(e){return JSON.parse(ym(e))})),2),n=t[0],r=t[1],o=function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Lm(e){return Lm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lm(e)}function Fm(e,t){for(var n=0;n0)){var e=t.contactSettledListeners;t.contactSettledListeners=[];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:5e3;if(0!==t.pendingContactUpdates){var r=!1,o=null,i=function(){r||(r=!0,clearTimeout(o),e())};o=setTimeout(i,n),t.contactSettledListeners.push(i)}else e()})),Om(this,"injectSession",(function(e){e&&t.session&&(e.setRequestHeader("Api-Token",t.sdkKey),e.setRequestHeader("Gleap-Id",t.session.gleapId),e.setRequestHeader("Gleap-Hash",t.session.gleapHash),t.injectGrant(e))})),Om(this,"injectGrant",(function(e){if(e&&t.grant)try{e.setRequestHeader("Gleap-Grant",t.grant)}catch(n){}})),Om(this,"addGrantHeader",(function(e){return e&&t.grant&&(e["Gleap-Grant"]=t.grant),e})),Om(this,"grantCookieName",(function(){return"gleap-grant-".concat(t.sdkKey)})),Om(this,"setGrant",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="string"==typeof e&&e.length>0?e:null;if(r!==t.grant){if(t.grant=r,r&&t.rememberSignedSession(km(r)),t.useCookies)try{if(r){var o=km(r),i=o&&null!==o.exp?(1e3*o.exp-Date.now())/864e5:7;i>0?le(t.grantCookieName(),encodeURIComponent(r),i,!0):ue(t.grantCookieName())}else ue(t.grantCookieName())}catch(a){}t.scheduleGrantRefresh(r?Date.now():null),n&&t.pushSessionUpdate()}})),Om(this,"hasLiveGrant",(function(){if(!t.grant)return!1;var e=km(t.grant);return!!e&&(null===e.exp||1e3*e.exp>Date.now())})),Om(this,"grantRefreshTime",(function(e,t){if(!e||null===e.exp)return null;var n=Date.now(),r=t&&null!==e.iat&&e.exp>e.iat?1e3*(e.exp-e.iat)-(n-t):1e3*e.exp-n;return n+Math.max(3e4,r-6e4)})),Om(this,"scheduleGrantRefresh",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;clearTimeout(t.grantRefreshTimeout),t.grantRefreshTimeout=null,t.grantRefreshAt=t.grantRefreshTime(t.grant?km(t.grant):null,e),null!==t.grantRefreshAt&&t.armGrantRefresh(t.grant,t.grantRefreshAt)})),Om(this,"armGrantRefresh",(function(e,n){clearTimeout(t.grantRefreshTimeout);var r=Math.min(Math.max(0,n-Date.now()),2147483647);t.grantRefreshTimeout=setTimeout((function(){if(t.grantRefreshTimeout=null,t.grant===e){var r=Date.now();if(n-r>1e3)t.armGrantRefresh(e,n);else if(t.grantRefreshInFlight||t.identifyInFlight)t.armGrantRefresh(e,r+6e4);else if(r-t.lastGrantRefreshAt0&&void 0!==arguments[0]?arguments[0]:null;clearTimeout(t.signedSessionExpiryTimeout),t.signedSessionExpiryTimeout=null;var n=t.currentSignedSession();if(n&&null!==n.exp&&!(null===e&&1e3*n.exp<=Date.now())){var r=null!==e?e:1e3*n.exp,o=Math.min(Math.max(0,r-Date.now()),2147483647);t.signedSessionExpiryTimeout=setTimeout((function(){t.signedSessionExpiryTimeout=null,t.onSignedSessionExpiryDue(r)}),o)}})),Om(this,"onSignedSessionExpiryDue",(function(e){if(Date.now()Date.now())){if(t.useCookies)try{var r=ce(t.grantCookieName()),o=r?decodeURIComponent(r):null,i=o?km(o):null;if(i&&i.sid===t.session.gleapId&&null!==i.exp&&1e3*i.exp>Date.now())return void t.setGrant(o)}catch(a){}t.hasLiveGrant()||(t.messengerOpen()&&Date.now()<1e3*n.exp+36e5?t.armSignedSessionExpiry(Date.now()+6e4):t.startSession())}}})),Om(this,"messengerOpen",(function(){try{var e=wv.getInstance();return!(!e||"function"!=typeof e.isOpened||!e.isOpened())}catch(t){return!1}})),Om(this,"renewOrEndExpiredSignedSession",(function(){if(!t.signedSessionExpiryRunning){t.signedSessionExpiryRunning=!0;var e=t.logoutGeneration,n=null;try{n=t.renewExpiredSignedSession()}catch(i){}var r=function(){t.logoutGeneration===e&&(t.identifyInFlight||t.pendingContactUpdates>0)?o():(t.signedSessionExpiryRunning=!1,t.logoutGeneration===e&&t.signedSessionExpired()&&!t.identifyFailedTransiently&&t.endExpiredSignedSession())},o=function(){return t.onContactSettled(r,1e4)};Promise.resolve(n).then(o,o)}})),Om(this,"renewExpiredSignedSession",(function(){if(t.identifyInFlight)return null;var e=t.lastIdentify,n=t.logoutGeneration;if(e&&e.userHash&&t.refusedIdentity!==t.refusedIdentityOf(e.userId,e.userHash)){var r=wm(e.userHash);if(!(r&&null!==r.exp&&1e3*r.exp<=Date.now())||t.jwtProvider)return t.markSignedModeIdentify(),Promise.resolve(t.withFreshIdentify((function(e){var n=e.userId,r=e.userData,o=e.userHash,i=wm(o);if(!(i&&null!==i.exp&&1e3*i.exp<=Date.now()))return t.trackContactUpdate(t.sendIdentify(n,r,o,!0))}))).catch((function(){}))}return t.jwtProvider?(t.signedModeProviderAsked=!0,t.requestUserJwt().then((function(e){if(e&&t.logoutGeneration===n&&!t.identifyInFlight)return t.setUserJwt(e)}))):null})),Om(this,"endExpiredSignedSession",(function(){console.info("Gleap: the signed session expired and no fresh identity token arrived, so the user continues as a visitor. Call Gleap.setUserJwt (or set Gleap.setUserJwtProvider) to sign them in again; their visitor activity on this device is merged into their contact."),t.clearSession(0,!0)})),Om(this,"extractGrant",(function(e){if(!e||!e.identity||"object"!==Lm(e.identity)||!("grant"in e.identity))return{session:e,grant:void 0};var t=e.identity,n=t.grant,r=Tm(t,Im);return{session:Am(Am({},e),{},{identity:r}),grant:n||null}})),Om(this,"clearSession",(function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(clearTimeout(t.fileRefreshTimeout),t.openingProtectedFile=null,null!==(e=t.session)&&void 0!==e&&e.fileAccessToken)try{var o=new XMLHttpRequest;o.open("POST",t.apiUrl+"/files/session/revoke"),o.setRequestHeader("X-File-Session",t.session.fileAccessToken),o.send()}catch(i){}t.session&&t.session.gleapHash&&dn.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash));try{se("session-".concat(t.sdkKey),null)}catch(a){}if(t.useCookies)try{ue("session-".concat(t.sdkKey))}catch(a){}t.ready=!1,t.session={gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0},t.lastIdentify=null,t.identifyInFlight=!1,t.forgetSignedIdentity(),t.authTokens={},t.authTokensSentFor=null,t.setGrant(null,!1),t.forgetSignedSession(),t.signedSessionExpiryRunning=!1,t.contactVersion++,t.logoutGeneration++,t.signedModeIdentifySent=!1,t.signedModeProviderAsked=!1,t.identifyFailedTransiently=!1,wv.getInstance().sendMessage({name:"session-cleared"},!0),Zv.getInstance().clearAllNotifications(!1),Zv.getInstance().setNotificationCount(0),Pr.getInstance().removeBannerUI(),$v.getInstance().hideModal(),r&&t.scheduleSessionRetry(n)})),Om(this,"scheduleSessionRetry",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!isNaN(e)){var n=10*Math.pow(e,2);setTimeout((function(){t.startSession(e+1)}),1e3*n)}})),Om(this,"openRequestedProtectedFile",(function(){var e,n=new URLSearchParams((null===(e=window.location)||void 0===e?void 0:e.search)||"").get("gleapFile");if(/^[a-f0-9]{24}$/.test(n||"")&&t.openingProtectedFile!==n){t.openingProtectedFile=n;var r=t.session.fileAccessToken,o=new XMLHttpRequest;o.open("GET","".concat(t.apiUrl,"/files/").concat(n,"/location")),o.setRequestHeader("X-File-Session",t.session.fileAccessToken),o.onload=function(){var e;if((null===(e=t.session)||void 0===e?void 0:e.fileAccessToken)===r)if(200===o.status)try{var n=JSON.parse(o.responseText).shareToken,i=wv.getInstance();i.setAppMode("widget"),i.sendMessage({name:"open-conversation",data:{shareToken:n}},!0),i.showWidget()}catch(a){t.openingProtectedFile=null}else t.openingProtectedFile=null},o.onerror=function(){t.openingProtectedFile=null},o.send()}})),Om(this,"validateSession",(function(e){var n,r,o,i,a,s;if(e&&e.gleapId){var l=t.extractGrant(e);e=l.session,void 0!==l.grant&&t.setGrant(l.grant,!1);var c=e.identity;if(t.grant&&c&&"object"===Lm(c)&&"signed"===c.mode&&!1===c.signed&&t.setGrant(null,!1),t.grant){var u=km(t.grant);u&&u.sid===e.gleapId||t.setGrant(null,!1)}!e.fileAccessToken&&e.gleapId===(null===(n=t.session)||void 0===n?void 0:n.gleapId)&&e.userId===(null===(r=t.session)||void 0===r?void 0:r.userId)&&Date.parse(t.session.fileAccessExpiresAt)>Date.now()&&(e=Am(Am({},e),{},{fileAccessToken:t.session.fileAccessToken,fileAccessExpiresAt:t.session.fileAccessExpiresAt}));var d=!1;(null===(o=t.session)||void 0===o?void 0:o.gleapId)!==(null===(i=e)||void 0===i?void 0:i.gleapId)&&(d=!0),t.session&&t.session.gleapHash&&dn.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),t.localStorageDisabled||se("session-".concat(t.sdkKey),e),t.useCookies&&le("session-".concat(t.sdkKey),encodeURIComponent(JSON.stringify(e)),365),t.session=e,t.ready=!0,t.restoreGrant(),t.armSignedSessionExpiry(),e.fileAccessToken&&t.openRequestedProtectedFile(),clearTimeout(t.fileRefreshTimeout),e.fileAccessToken&&null!==(a=t.lastIdentify)&&void 0!==a&&a.userHash&&(t.fileRefreshTimeout=setTimeout((function(){t.withFreshIdentify((function(e){var n,r,o=e.userId,i=e.userData,a=e.userHash;null===(n=t.identifySession(o,i,a,!0))||void 0===n||null===(r=n.catch)||void 0===r||r.call(n,(function(){}))}))}),Math.max(0,Date.parse(e.fileAccessExpiresAt)-Date.now()-3e5))),t.session&&t.session.gleapHash&&dn.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),d&&(setTimeout((function(){L.getInstance().clearCache(),x.getInstance().clearCache(),Ky.getInstance().restart();var e=dm.getInstance();if(e){try{e.destroy()}catch(t){}e.load()}}),0),"function"==typeof window.dispatchEvent&&window.dispatchEvent(new CustomEvent("session-updated"))),t.notifySessionReady(),d&&t.replayIdentifyIfNeeded(),e.authenticatedFilesRequired&&!e.fileAccessToken&&null!==(s=t.lastIdentify)&&void 0!==s&&s.userHash&&!t.identifyInFlight&&t.withFreshIdentify((function(e){var n,r,o=e.userId,i=e.userData,a=e.userHash;null===(n=t.identifySession(o,i,a,!0))||void 0===n||null===(r=n.catch)||void 0===r||r.call(n,(function(){}))}))}})),Om(this,"replayIdentifyIfNeeded",(function(){try{if(!t.lastIdentify||!t.lastIdentify.userId)return;if(t.identifyInFlight)return;if(t.session&&t.session.userId)return;t.withFreshIdentify((function(e){var n,r,o=e.userId,i=e.userData,a=e.userHash;t.identifyInFlight||t.session&&t.session.userId||null===(n=t.identifySession(o,i,a))||void 0===n||null===(r=n.catch)||void 0===r||r.call(n,(function(){}))}))}catch(e){}})),Om(this,"listenForOnline",(function(){if(!t.onlineListenerAdded)try{"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("online",t.handleOnline),t.onlineListenerAdded=!0)}catch(e){}})),Om(this,"handleOnline",(function(){if(t.identifyFailedTransiently&&!t.identifyInFlight&&t.lastIdentify){t.identifyFailedTransiently=!1;try{Promise.resolve(t.withFreshIdentify((function(e){var n=e.userId,r=e.userData,o=e.userHash;if(!t.identifyInFlight)return t.trackContactUpdate(t.sendIdentify(n,r,o,!0))}))).catch((function(){}))}catch(e){}}})),Om(this,"needsSignedModeIdentify",(function(){if(t.signedModeIdentifySent||t.identifyInFlight)return!1;var e=t.session&&t.session.identity;return!!(t.session&&t.session.userId&&e&&"signed"===e.mode)&&(!(!t.lastIdentify||!t.lastIdentify.userHash||t.hasLiveGrant())&&Date.now()-t.lastSignedModeIdentifyAt>=Rm)})),Om(this,"markSignedModeIdentify",(function(){t.signedModeIdentifySent=!0,t.lastSignedModeIdentifyAt=Date.now()})),Om(this,"identifyForSignedModeIfNeeded",(function(){if(t.needsSignedModeIdentify()){t.markSignedModeIdentify();try{Promise.resolve(t.withFreshIdentify((function(e){var n=e.userId,r=e.userData,o=e.userHash;return t.trackContactUpdate(t.sendIdentify(n,r,o,!0))}))).catch((function(){}))}catch(e){}}else t.identifyWithProviderForSignedModeIfNeeded()})),Om(this,"needsSignedModeProviderIdentify",(function(){if(t.signedModeProviderAsked||t.signedModeIdentifySent||t.identifyInFlight||!t.jwtProvider)return!1;var e=t.session&&t.session.identity;return!!(t.session&&t.session.userId&&e&&"signed"===e.mode)&&(!(t.lastIdentify&&t.lastIdentify.userHash||t.hasLiveGrant())&&Date.now()-t.lastSignedModeIdentifyAt>=Rm)})),Om(this,"identifyWithProviderForSignedModeIfNeeded",(function(){if(t.needsSignedModeProviderIdentify()){t.signedModeProviderAsked=!0;var e=t.logoutGeneration;return t.requestUserJwt().then((function(n){if(n&&t.logoutGeneration===e&&!t.identifyInFlight){var r=t.session&&t.session.identity;if(!(t.lastIdentify&&t.lastIdentify.userHash||!t.session)&&t.session.userId&&r&&"signed"===r.mode&&!t.hasLiveGrant())return t.setUserJwt(n)}})).catch((function(){}))}})),Om(this,"refusedIdentityOf",(function(e,t){return"".concat(e,":").concat(t?xm(t):"")})),Om(this,"withFreshIdentify",(function(e){var n=t.lastIdentify;if(n){var r=wm(n.userHash);return r&&null!==r.exp&&1e3*r.exp-Date.now()<3e5&&t.jwtProvider?t.requestUserJwt().then((function(r){if(t.lastIdentify===n)return e(r?Am(Am({},n),{},{userId:wm(r).userId,userHash:r}):n)})):e(n)}})),Om(this,"setUserJwtProvider",(function(e){if(null===e||"function"==typeof e){if(t.jwtProvider=e,t.jwtProviderFailedAt=0,t.ready)try{t.identifyWithProviderForSignedModeIfNeeded()}catch(n){}}else console.warn("Gleap: setUserJwtProvider expects a function returning a token (or a Promise of one).")})),Om(this,"requestUserJwt",(function(){if(!t.jwtProvider)return Promise.resolve(null);if(t.jwtProviderRequest)return t.jwtProviderRequest;if(t.jwtProviderFailedAt&&Date.now()-t.jwtProviderFailedAt<3e4)return Promise.resolve(null);var e=t.jwtProvider,n=null,r=new Promise((function(e,t){n=setTimeout((function(){return t(new Error("timed out after 10 s"))}),1e4)})),o=Promise.race([Promise.resolve().then((function(){return e()})),r]).then((function(e){if(null==e)return t.jwtProviderFailedAt=Date.now(),null;var n=wm(e);if(!n)throw new Error("it did not return a JWT with a userId");if(null!==n.exp&&1e3*n.exp<=Date.now())throw new Error("it returned an expired token");return t.jwtProviderFailedAt=0,e})).catch((function(e){return t.jwtProviderFailedAt=Date.now(),console.warn("Gleap: the JWT provider failed (".concat(e&&e.message?e.message:e,"). Asking again in 30 s at the earliest.")),null})).finally((function(){clearTimeout(n),t.jwtProviderRequest=null}));return t.jwtProviderRequest=o,o})),Om(this,"startSession",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;t.listenForOnline();try{if(t.useCookies){var n=ce("session-".concat(t.sdkKey));if(n){var r=JSON.parse(decodeURIComponent(n));t.validateSession(r)}}}catch(l){}if(!(t.localStorageDisabled||t.session&&t.session.gleapId&&t.session.gleapId.length>0)){var o=ae("session-".concat(t.sdkKey));o&&t.validateSession(o)}t.restoreGrant(),t.armSignedSessionExpiry();var i=t,a=t.contactVersion,s=new XMLHttpRequest;s.open("POST",i.apiUrl+"/sessions"),s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.setRequestHeader("Api-Token",i.sdkKey);try{t.session&&t.session.gleapId&&t.session.gleapHash&&(s.setRequestHeader("Gleap-Id",t.session.gleapId),s.setRequestHeader("Gleap-Hash",t.session.gleapHash),t.injectGrant(s))}catch(l){}s.onreadystatechange=function(t){if(4===s.readyState){if(i.contactVersion!==a)return;if(200===s.status||201===s.status)try{var n=JSON.parse(s.responseText);i.validateSession(n);var r=n&&n.identity;r&&"object"===Lm(r)&&"signed"===r.mode&&!1===r.signed&&i.signedSessionExpired()?i.renewOrEndExpiredSignedSession():i.identifyForSignedModeIfNeeded()}catch(l){}else if(429!==s.status)!(s.status>=400&&s.status<500)&&i.session&&i.session.gleapId?i.scheduleSessionRetry(e):i.clearSession(e,!0)}},s.send(JSON.stringify({lang:ub.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))})),Om(this,"adoptSession",(function(e){if(e&&"string"==typeof e.gleapId&&"string"==typeof e.gleapHash&&!(t.lastIdentify&&t.lastIdentify.userId||t.session&&t.session.gleapId===e.gleapId)){var n=t,r=new XMLHttpRequest;r.open("POST",n.apiUrl+"/sessions"),r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.setRequestHeader("Api-Token",n.sdkKey),r.setRequestHeader("Gleap-Id",e.gleapId),r.setRequestHeader("Gleap-Hash",e.gleapHash),r.onreadystatechange=function(){if(4===r.readyState&&(200===r.status||201===r.status))try{var t=JSON.parse(r.responseText);t&&t.gleapId===e.gleapId&&(n.contactVersion++,n.validateSession(t))}catch(o){}},r.send(JSON.stringify({lang:ub.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))}})),Om(this,"checkIfSessionNeedsUpdate",(function(e,n){if(!t.session||!t.session.userId||!e)return!0;try{if(t.session.userId.toString()!==e.toString())return!0}catch(r){}return t.checkIfSessionDataNeedsUpdate(n)})),Om(this,"checkIfSessionDataNeedsUpdate",(function(e){if(t.session&&t.session.lang&&t.session.lang!==ub.getInstance().getActiveLanguage())return!0;if(e)for(var n=Object.keys(e),r=0;r3&&void 0!==arguments[3]&&arguments[3];if(e&&e.gleapId&&null!=n&&(t.signedIdentity=t.signedIdentityOf(e.gleapId,n,r)+(o?"#grant":""),!t.localStorageDisabled))try{se(t.signedIdentityKey(),t.signedIdentity)}catch(i){}})),Om(this,"forgetSignedIdentity",(function(){t.signedIdentity=null;try{se(t.signedIdentityKey(),null)}catch(e){}})),Om(this,"needsSignedIdentify",(function(e,n){if(!n||null==e||!t.session||!t.session.gleapId)return!1;if(!t.signedIdentity&&!t.localStorageDisabled)try{t.signedIdentity=ae(t.signedIdentityKey())}catch(o){}var r=t.signedIdentityOf(t.session.gleapId,e,n);return t.signedIdentity===r+"#grant"?!t.hasLiveGrant():t.signedIdentity!==r})),Om(this,"identifySession",(function(e,n,r){var o,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s={userId:e,userData:n,userHash:r};if(t.lastIdentify=s,!(t.ready||t.session&&t.session.gleapId))return t.trackContactUpdate(new Promise((function(o,i){t.setOnSessionReady((function(){if(t.lastIdentify!==s)return o();Promise.resolve(t.identifySession(e,n,r,a)).then(o,i)}))})));if(null===t.refusedIdentity||t.refusedIdentity!==t.refusedIdentityOf(e,r)){var l=t.checkIfSessionNeedsUpdate(e,n),c=!!r&&(null===(o=t.session)||void 0===o?void 0:o.authenticatedFilesRequired)&&(!(null!==(i=t.session)&&void 0!==i&&i.fileAccessToken)||Date.parse(t.session.fileAccessExpiresAt)<=Date.now()),u=t.needsSignedModeIdentify();if(l||a||c||u||t.needsSignedIdentify(e,r))return u&&t.markSignedModeIdentify(),t.trackContactUpdate(t.sendIdentify(e,n,r,!0))}})),Om(this,"sendIdentify",(function(e,n,r,o){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=t;return new Promise((function(s,l){t.setOnSessionReady((function(){if(!a.session.gleapId||!a.session.gleapHash)return l(Nm("identify","session not ready"));var t=new XMLHttpRequest;t.open("POST",a.apiUrl+"/sessions/identify"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",a.sdkKey);try{t.setRequestHeader("Gleap-Id",a.session.gleapId),t.setRequestHeader("Gleap-Hash",a.session.gleapHash),a.injectGrant(t)}catch(p){}a.identifyInFlight=!0,a.lastIdentifyFailure=null;var c=a.logoutGeneration,u=function(){return a.logoutGeneration!==c&&(a.lastIdentifyFailure="superseded",!0)};t.onerror=function(){if(u())return s();a.identifyInFlight=!1,a.lastIdentifyFailure="network error",a.identifyFailedTransiently=!0,l(Nm("identify","network error"))},t.onreadystatechange=function(c){if(4===t.readyState){if(u())return s();if(a.identifyInFlight=!1,200===t.status||201===t.status){a.identifyFailedTransiently=!1;try{var d=JSON.parse(t.responseText);a.contactVersion++,r&&a.rememberSignedIdentity(d,e,r,!!(d&&d.identity&&d.identity.grant)),a.validateSession(d),r&&a.resendAuthTokensIfNeeded(),s(d)}catch(p){l(p)}}else{var h=(f=t.status,"string"!=typeof(g=t.responseText)?null:400===f?-1!==g.indexOf("identity_mismatch")?"identity_mismatch":null:401!==f?null:-1!==g.indexOf("token_expired")?"token_expired":-1!==g.indexOf("token_invalid")?"token_invalid":-1!==g.indexOf("signature_required")?"signature_required":null);if("token_expired"===h&&o&&a.jwtProvider)return void s(a.requestUserJwt().then((function(e){if(!e||!a.lastIdentify||a.lastIdentify.userHash!==r)return e||console.warn("Gleap: the identity token has expired and the JWT provider returned no fresh one."),a.lastIdentifyFailure="refused",Promise.reject(Nm("identify","identity token expired"));var t=wm(e).userId;return a.lastIdentify={userId:t,userData:n,userHash:e},a.sendIdentify(t,n,e,!1,i)})));if("identity_mismatch"===h&&i&&a.lastIdentify&&a.lastIdentify.userHash===r)return void s(a.restartAsVisitorAndIdentify(e,n,r,o));"identity_mismatch"===h&&console.warn("Gleap: the identity token names another user than this session, and a fresh session was refused too (identity_mismatch)."),"token_expired"===h?console.warn("Gleap: the identity token has expired. Pass a fresh one to Gleap.setUserJwt, or set Gleap.setUserJwtProvider."):"token_invalid"===h?console.warn("Gleap: the identity token was refused (token_invalid): check the signing key and the userId claim."):"signature_required"===h&&console.warn("Gleap: this project enforces identity verification and the identify had no valid signature (signature_required). Pass a token from your backend to setUserJwt."),"token_expired"!==h&&"token_invalid"!==h&&"signature_required"!==h||(a.refusedIdentity=a.refusedIdentityOf(e,r)),"signature_required"===h&&a.session&&a.session.userId&&String(a.session.userId)!==String(e)&&a.clearSession(0,!0),!h&&(0===t.status||t.status>=500)&&(a.identifyFailedTransiently=!0),a.lastIdentifyFailure=h?"refused":jm(t.status),l(Nm("identify",h?"refused (".concat(h,")"):a.lastIdentifyFailure))}}var f,g};var d=Am({},n);n.customData&&(delete d.customData,d=Am(Am({},d),n.customData)),t.send(JSON.stringify(Am(Am(Am({},d),{},{userId:e,userHash:r},a.sessionDuration?{sessionDuration:a.sessionDuration}:{}),{},{lang:ub.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"})))}))}))})),Om(this,"restartAsVisitorAndIdentify",(function(e,n,r,o){var i=t.lastIdentify,a=Am({},t.authTokens);t.clearSession(0,!1),t.lastIdentify=i,t.authTokens=a;var s=t.sendIdentify(e,n,r,o,!1);return t.startSession(),s})),Om(this,"setSessionDuration",(function(e){null!=e?"number"!=typeof e||!isFinite(e)||e<=0?console.warn("Gleap: sessionDuration expects a positive number of milliseconds. Ignored."):t.sessionDuration=Math.round(e):t.sessionDuration=null})),Om(this,"setUserJwt",(function(e){var n,r=wm(e);if(!r)return console.warn("Gleap: setUserJwt expects a JWT (three base64url parts, at most 4096 characters) whose payload has a userId (or user_id). Nothing was sent."),Promise.resolve();try{n=Promise.resolve(t.identifySession(r.userId,{},e))}catch(o){n=Promise.reject(o)}return n.then((function(){}),(function(e){if("refused"!==t.lastIdentifyFailure&&"superseded"!==t.lastIdentifyFailure){var n=e&&(e.gleapReason||e.message||e)||t.lastIdentifyFailure||"unknown error";console.warn("Gleap: setUserJwt could not identify the user (".concat(n,"). Nothing changed; call it again later."))}}))})),Om(this,"setAuthTokens",(function(e){if(!e||"object"!==Lm(e)||Array.isArray(e))return console.warn("Gleap: setAuthTokens expects an object of { name: token }."),Promise.resolve();var n={};return Object.keys(e).forEach((function(r){var o=e[r];Pm.test(r)?null===o||"string"==typeof o?(n[r]=o,null===o?delete t.authTokens[r]:t.authTokens[r]=o):console.warn('Gleap: auth token "'.concat(r,'" skipped: the value must be a string, or null to remove it.')):console.warn('Gleap: auth token name "'.concat(r,'" skipped: use a letter followed by up to 39 letters, digits, _ or -.'))})),0===Object.keys(n).length?Promise.resolve():t.postAuthTokens(n)})),Om(this,"resendAuthTokensIfNeeded",(function(){Object.keys(t.authTokens).length>0&&t.authTokensSentFor!==t.session.gleapId&&t.postAuthTokens(Am({},t.authTokens))})),Om(this,"postAuthTokens",(function(e){var n=t;return new Promise((function(r){t.setOnSessionReady((function(){t.onContactSettled((function(){if(!n.session.gleapId||!n.session.gleapHash)return r();var t=n.session.gleapId,o=new XMLHttpRequest;o.open("POST",n.apiUrl+"/sessions/auth-tokens"),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.injectSession(o),o.onerror=function(){return r()},o.onreadystatechange=function(){4===o.readyState&&(200===o.status||201===o.status?n.authTokensSentFor=t:401===o.status&&console.warn("Gleap: auth tokens need a signed identity: call Gleap.setUserJwt first. They are kept and sent after the next signed identify."),r())},o.send(JSON.stringify({tokens:e}))}))}))}))})),Om(this,"startProductTourConfig",(function(e){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){if(!n.session.gleapId||!n.session.gleapHash)return o(Nm("product tour","session not ready"));var t=new XMLHttpRequest;t.open("POST",n.apiUrl+"/outbound/producttours"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",n.sdkKey);try{t.setRequestHeader("Gleap-Id",n.session.gleapId),t.setRequestHeader("Gleap-Hash",n.session.gleapHash),n.injectGrant(t)}catch(i){}t.onerror=function(){o(Nm("product tour","network error"))},t.onreadystatechange=function(e){if(4===t.readyState)if(200===t.status||201===t.status)try{var n=JSON.parse(t.responseText);n&&n.config&&r(n.config)}catch(i){o(i)}else o(Nm("product tour",jm(t.status)))},t.send(JSON.stringify({outboundId:e}))}))}))})),Om(this,"validateProductTour",(function(e){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){var t;if(!n.session.gleapId||!n.session.gleapHash)return o(Nm("product tour","session not ready"));var i=new XMLHttpRequest;i.open("POST",n.apiUrl+"/outbound/producttourvalidation"),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.setRequestHeader("Api-Token",n.sdkKey);try{i.setRequestHeader("Gleap-Id",n.session.gleapId),i.setRequestHeader("Gleap-Hash",n.session.gleapHash),n.injectGrant(i)}catch(a){}i.onerror=function(){o(Nm("product tour","network error"))},i.onreadystatechange=function(e){if(4===i.readyState)if(200===i.status||201===i.status)try{var t=JSON.parse(i.responseText);t&&"live"===t.status&&t.passedPageFilter?r(t.config):o(Nm("product tour","not live on this page"))}catch(a){o(a)}else o(Nm("product tour",jm(i.status)))},i.send(JSON.stringify({outboundId:e,currentUrl:null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.href}))}))}))}))}var t,n,r;return t=e,n=[{key:"setRegion",value:function(e){var t=function(e){if("string"!=typeof e)return null;var t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(Vt,t)?t:null}(e);if(!t)return console.warn('Gleap: Unknown region "'.concat(e,'". Supported regions: ').concat(Object.keys(Vt).join(", "),". Region not changed.")),!1;var n=Vt[t];return this.region=t,this.apiUrl=n.apiUrl,this.wsApiUrl=n.wsApiUrl,this.realtimeHost=n.realtimeHost,!0}},{key:"getRegion",value:function(){return this.region}},{key:"getName",value:function(){try{return this.session.name?this.session.name.split(" ")[0].split("@")[0].split(".")[0].split("+")[0]:""}catch(e){return this.session.name}}},{key:"getSession",value:function(){return this.session}},{key:"getGleapId",value:function(){return this.session&&this.session.gleapId?this.session.gleapId:null}},{key:"isUser",value:function(){return!(!this.session||!this.session.userId)}},{key:"notifySessionReady",value:function(){if(this.onSessionReadyListener.length>0)for(var e=0;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Vm(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function $m(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(e.tags=t),this.excludeData)for(var n=Object.keys(this.excludeData),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,i=parseInt(r.v,10),a=i>=1&&i<=4?i:1,s=4!==a,l=null===(t=r.bgBlur)||void 0===t||t?'
':"";if(!s){var c,u=r.welcomeText?String(r.welcomeText).replace(/&/g,"&").replace(//g,">"):"",d='
\n
\n
\n
 
'.concat(u?'\n
'.concat(u,"
"):"","\n
\n
");if(o){var p=String(r.bgImage).replace(/"/g,""");return'
\n
\n
\n
\n ').concat(d,'\n
\n
\n
')}var h=null===(c=r.fadebg)||void 0===c||c;return'
\n
\n '.concat(d).concat(h?'\n
':"","\n
\n
")}if(o){var f=String(r.bgImage).replace(/"/g,"""),g=r.hideNews&&r.hideFeatureRequests&&r.hideAllConversations&&r.hideKnowledgeBase;return'
\n
\n ').concat(l,"
\n
")}if("classic"===r.bgType){var m,v=null===(m=r.fadebg)||void 0===m||m;return'
'.concat(v?'\n \n \n \n \n \n \n \n \n \n \n \n \n ':'\n \n \n \n \n \n \n \n ').concat(l,"
")}var y=null===(n=r.animateBG)||void 0===n||n;return'
\n \n \n \n \n \n \n \n \n \n \n \n \n ').concat(l,"
")}(Rd.getInstance().getFlowConfig()),''),(t.frameHost&&document.body.contains(t.frameHost)?t.frameHost:document.body).appendChild(e);var r=e.querySelector(".gleap-frame-loader-image");if(r){var o=function(){var t=e.querySelector(".gleap-frame-loader-image-wrap");t&&t.classList.add("gleap-frame-loader-image-wrap--loaded")};r.complete&&r.naturalWidth>0?o():r.addEventListener("load",o)}t.gleapFrameContainer=e,t.gleapFrame=document.querySelector(".gleap-frame"),K(t.gleapFrame,t.frameUrl),t.armFrameLoadWatchdog(t.gleapFrame),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),yv(this,"showImage",(function(e){de((function(){var t=document.createElement("div");t.className="gleap-image-view",t.setAttribute("tabindex","-1"),t.innerHTML='
\n \n
'),document.body.appendChild(t);var n=function(){document.removeEventListener("keydown",r,!0),t.remove()},r=function(e){"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),n())};document.addEventListener("keydown",r,!0),t.querySelector(".gleap-image-view-close").addEventListener("click",(function(){n()})),t.addEventListener("click",(function(e){e.target===t&&n()}));try{t.focus({preventScroll:!0})}catch(o){t.focus()}}))})),yv(this,"updateFrameStyle",(function(){if(t.gleapFrameContainer){for(var e="gleap-frame-container--survey",n="gleap-frame-container--extended",r="gleap-frame-container--survey-full",o="gleap-frame-container--survey-page",i="gleap-frame-container--survey-legacy",a="gleap-frame-container--corners-sharp",s="gleap-frame-container--corners-pill",l="gleap-frame-container--classic",c="gleap-frame-container--classic-left",u="gleap-frame-container--modern-left",d="gleap-frame-container--no-button",p="gleap-frame-container--expanded",h=[l,c,p,n,u,d,e,r,o,i,a,s],f=0;f0?"".concat(this.frameHeight,"px"):"");e.style.height="","survey"===this.appMode||this.isLegacyFullSurvey()?e.style.maxHeight=this.frameHeight>0?"".concat(this.frameHeight,"px"):"":this.isFullSurvey()?e.style.maxHeight="none":e.style.maxHeight="".concat(700,"px")}}},{key:"getSafeAreaInsets",value:function(){var e={top:0,right:0,bottom:0,left:0};try{if("undefined"==typeof document||!document.body||"function"!=typeof window.getComputedStyle)return e;var t=document.createElement("div");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="0",t.style.height="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.paddingTop="env(safe-area-inset-top, 0px)",t.style.paddingRight="env(safe-area-inset-right, 0px)",t.style.paddingBottom="env(safe-area-inset-bottom, 0px)",t.style.paddingLeft="env(safe-area-inset-left, 0px)",document.body.appendChild(t);var n=window.getComputedStyle(t);e.top=parseFloat(n.paddingTop)||0,e.right=parseFloat(n.paddingRight)||0,e.bottom=parseFloat(n.paddingBottom)||0,e.left=parseFloat(n.paddingLeft)||0,t.remove()}catch(r){}return e}},{key:"forwardSurveyKey",value:function(e){try{if(!this.surveyKeyboard||"survey_page"!==this.appMode||!this.comReady)return;if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)return;var t=e.target,n=t&&t.tagName;if("INPUT"===n||"TEXTAREA"===n||"SELECT"===n||t&&t.isContentEditable)return;var r=e.key;if(!/^[a-z0-9]$/i.test(r)&&"Enter"!==r&&"ArrowUp"!==r&&"ArrowDown"!==r)return;if("Enter"===r&&("BUTTON"===n||"A"===n))return;e.preventDefault(),this.sendMessage({name:"survey-key",data:{key:r,shiftKey:e.shiftKey}})}catch(o){}}},{key:"updateSurveyKeyboardInset",value:function(){try{var e=this.gleapFrameContainer;if(!e)return;var t=window.visualViewport,n="survey"===this.appMode&&!this.surveyLegacy&&window.innerWidth<=450,r=t?Math.max(0,window.innerHeight-(t.height+t.offsetTop)):0;if(!n||!t||r<80){if(!this.surveySheetLifted)return;this.surveySheetLifted=!1;var o=e.querySelector(".gleap-frame-container-inner");return e.style.removeProperty("bottom"),e.style.removeProperty("max-height"),o&&o.style.removeProperty("max-height"),void this.sendSheetViewport(0,!1)}var i=e.querySelector(".gleap-frame-container-inner"),a=Math.max(160,t.height-24);this.surveySheetLifted=!0,e.style.setProperty("bottom",r+8+"px","important"),e.style.setProperty("max-height",a+"px","important"),i&&i.style.setProperty("max-height",a-15+"px","important"),this.sendSheetViewport(a-15,!0)}catch(s){}}},{key:"sendSheetViewport",value:function(e,t){var n={maxHeight:Math.max(0,Math.floor(e)),keyboard:!!t},r=this.lastSheetViewport;this.comReady&&(r?r.maxHeight!==n.maxHeight||r.keyboard!==n.keyboard:n.keyboard)&&(this.lastSheetViewport=n,this.sendMessage({name:"sheet-viewport",data:n}))}},{key:"sendSafeAreaInsets",value:function(){this.comReady&&this.sendMessage({name:"survey-safe-area",data:this.getSafeAreaInsets()})}},{key:"revealSurvey",value:function(){this.surveyAwaitingHeight=!1,this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null);var e=this.gleapFrameContainer;e&&e.classList.remove("gleap-frame-container--measuring")}},{key:"scrollSurveyPageIntoView",value:function(e){try{var t=this.gleapFrameContainer;if("survey_page"!==this.appMode||!t||"undefined"==typeof window)return;var n=t.getBoundingClientRect().top;if(n>=0)return;window.scrollTo({top:Math.max(0,window.scrollY+n-16),behavior:e?"smooth":"auto"})}catch(r){}}},{key:"setSurveyLegacy",value:function(){this.isSurvey()&&!this.surveyLegacy&&(this.surveyLegacy=!0,this.updateFrameStyle(),this.applyInnerSize())}},{key:"setSurveyCorners",value:function(e){var t="sharp"===e||"pill"===e?e:null;t!==this.surveyCorners&&(this.surveyCorners=t,this.updateFrameStyle())}},{key:"setSurveyTheme",value:function(e){var t=e&&"string"==typeof e.surface&&/^#[0-9a-f]{3,8}$/i.test(e.surface)?e.surface:null,n=e&&"boolean"==typeof e.dark?e.dark:null,r=t!==this.surveySurface||n!==this.surveyDark;this.surveySurface=t,this.surveyDark=n;var o=e?e.corners:null;("sharp"===o||"pill"===o?o:null)!==this.surveyCorners?this.setSurveyCorners(o):r&&this.updateFrameStyle()}},{key:"hasRoomToExpand",value:function(){try{return"function"!=typeof window.matchMedia||window.matchMedia("(min-width: ".concat(768,"px)")).matches}catch(e){return!0}}},{key:"canExpandWidget",value:function(){var e=Rd.getInstance().getFlowConfig();return(!e||!e.hideExpandButton)&&!this.isSurvey()&&this.hasRoomToExpand()}},{key:"getWidgetExpandedPreference",value:function(){return void 0===this.widgetExpanded&&(this.widgetExpanded=!0===ae("widget-expanded")),this.widgetExpanded}},{key:"isWidgetExpanded",value:function(){return this.getWidgetExpandedPreference()&&this.canExpandWidget()}},{key:"setWidgetExpanded",value:function(e){this.widgetExpanded=!!e;try{se("widget-expanded",!!this.widgetExpanded||null)}catch(t){}this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0)}},{key:"sendWidgetSizeUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.comReady){var t={expandable:this.canExpandWidget(),expanded:this.isWidgetExpanded()},n=this.lastWidgetSizeUpdate;!e&&n&&n.expandable===t.expandable&&n.expanded===t.expanded||(this.lastWidgetSizeUpdate=t,this.sendMessage({name:"widget-size-update",data:t}))}}},{key:"handleViewportResize",value:function(){this.isWidgetExpanded()!==this.appliedWidgetExpanded&&this.updateFrameStyle(),this.sendWidgetSizeUpdate(),this.widgetOpened&&this.isFullSurvey()&&this.sendSafeAreaInsets()}},{key:"registerEscListener",value:function(){var e=this;this.escListener||this.captureHidden||"survey_page"===this.appMode||(this.escListener=function(t){if("Escape"===(t=t||window.event).key){var n=document.querySelectorAll(".gleap-image-view");if(n.length>0)return void n[n.length-1].remove();e.hideWidget()}},document.addEventListener("keydown",this.escListener))}},{key:"unregisterEscListener",value:function(){this.escListener&&(document.removeEventListener("keydown",this.escListener),this.escListener=null)}},{key:"destroy",value:function(){this.gleapFrame&&this.gleapFrame.remove(),this.gleapFrameContainer&&this.gleapFrameContainer.remove(),this.injectedFrame=!1,this.widgetOpened=!1,this.comReady=!1,this.clearFrameLoadWatchdog(),this.markerManager=void 0,this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null),clearTimeout(this.openAfterPingTimeout),this.openAfterPingTimeout=null,this.gleapFrameContainer=null,this.gleapFrame=null,this.captureHidden=!1;try{ad&&ad.getInstance().onWidgetDestroyed()}catch(e){}}},{key:"setCaptureHidden",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.captureHidden=!!e;var n=this.gleapFrameContainer;if(n&&n.classList.toggle("gleap-frame-container--capture-hidden",this.captureHidden),this.captureHidden)return this.unregisterEscListener(),void this.setCaptureEditorOpen(!1);n&&(this.widgetOpened?this.registerEscListener():t&&this.showWidget())}},{key:"isCaptureHidden",value:function(){return this.captureHidden}},{key:"setCaptureEditorOpen",value:function(e){this.gleapFrameContainer&&this.gleapFrameContainer.classList.toggle("gleap-frame-container--capture-editor",!!e)}},{key:"sendCaptureCapabilities",value:function(){if(this.comReady)try{this.sendMessage({name:"capture-capabilities",data:Ir()})}catch(e){}}},{key:"isOpened",value:function(){return this.widgetOpened||null!=this.markerManager}},{key:"armFrameLoadWatchdog",value:function(e){var t=this;this.clearFrameLoadWatchdog(),e&&(this.frameLoadTimeout=setTimeout((function(){if(t.frameLoadTimeout=null,!t.comReady&&t.gleapFrame===e){try{e.getAttribute("src")!==t.frameUrl&&(e.src=t.frameUrl)}catch(n){}t.frameLoadTimeout=setTimeout((function(){if(t.frameLoadTimeout=null,!t.comReady&&t.gleapFrame===e){try{console.warn("Gleap: the messenger ("+t.frameUrl+") did not load and was closed. If this keeps happening, check that your Content-Security-Policy allows frame-src, script-src and style-src for https://*.gleap.io.")}catch(n){}t.resetUnloadedFrame(!1)}}),1e4)}}),1e4))}},{key:"clearFrameLoadWatchdog",value:function(){this.frameLoadTimeout&&(clearTimeout(this.frameLoadTimeout),this.frameLoadTimeout=null)}},{key:"resetUnloadedFrame",value:function(e){var t=this.widgetOpened;this.unregisterEscListener(),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.destroy();try{R.getInstance().updateFeedbackButtonState()}catch(n){}e&&t&&this.showWidget()}},{key:"handlePageShow",value:function(e){if(e&&e.persisted)try{if(this.injectedFrame&&this.gleapFrameContainer&&!this.comReady)return void this.resetUnloadedFrame(!0);var t=this.gleapFrameContainer;t&&(this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),t.classList.remove("gleap-frame-container--closing"),this.widgetOpened?(t.classList.remove("gleap-frame-container--hidden"),t.classList.add("gleap-frame-container--animate")):t.classList.contains("gleap-frame-container--measuring")||(t.classList.add("gleap-frame-container--hidden"),t.classList.remove("gleap-frame-container--animate")),this.updateWidgetStatus()),R.getInstance().updateFeedbackButtonState()}catch(n){}}},{key:"showFrameContainer",value:function(e){var t,n=this;if(this.gleapFrameContainer){var r="gleap-frame-container--loading";null!==(t=this.gleapFrameContainer)&&void 0!==t&&t.classList&&(this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.gleapFrameContainer.classList.remove("gleap-frame-container--closing"),this.isAutoHeightSurvey()&&this.surveyAwaitingHeight?(this.gleapFrameContainer.classList.add("gleap-frame-container--measuring"),this.surveyRevealTimeout||(this.surveyRevealTimeout=setTimeout((function(){n.surveyRevealTimeout=null,n.revealSurvey()}),1200))):this.gleapFrameContainer.classList.remove("gleap-frame-container--measuring"),this.gleapFrameContainer.classList.remove("gleap-frame-container--hidden"),e?this.gleapFrameContainer.classList.add(r):this.gleapFrameContainer.classList.remove(r),setTimeout((function(){var e;null===(e=n.gleapFrameContainer)||void 0===e||e.classList.add("gleap-frame-container--animate")}),500)),this.widgetOpened=!0,this.updateUI()}}},{key:"runWidgetShouldOpenCallback",value:function(){if(this.gleapFrameContainer&&(this.workThroughQueue(),$b.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),dn.notifyEvent("open"),this.registerEscListener(),this.isFullSurvey()&&!this.isLegacyFullSurvey()))try{var e=this.gleapFrameContainer.querySelector(".gleap-frame");e&&e.focus({preventScroll:!0})}catch(t){}}},{key:"updateUI",value:function(){Zv.getInstance().clearAllNotifications(this.isSurvey()),R.getInstance().updateNotificationBadge(0),R.getInstance().updateFeedbackButtonState()}},{key:"showWidget",value:function(){var t=this;setTimeout((function(){t.gleapFrameContainer&&!t.comReady?"widget"===t.appMode&&t.showFrameContainer(!0):t.gleapFrameContainer?t.runWidgetShouldOpenCallback():e.getInstance().injectFrame(),t.updateUI()}),0)}},{key:"updateWidgetStatus",value:function(){this.sendMessage({name:"widget-status-update",data:{isWidgetOpen:this.widgetOpened}})}},{key:"hideMarkerManager",value:function(){this.markerManager&&(this.markerManager.clear(),this.markerManager=null)}},{key:"focusFrame",value:function(){var e=this;setTimeout((function(){try{var t=e.gleapFrameContainer&&e.gleapFrameContainer.querySelector(".gleap-frame");t&&t.focus({preventScroll:!0})}catch(n){}}),0)}},{key:"hideWidget",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("survey_web"!==this.appMode&&"survey_page"!==this.appMode){var n=!1;try{n=!!this.gleapFrameContainer&&this.gleapFrameContainer.contains(document.activeElement)}catch(a){}var r=this.widgetOpened,o=this.isOpened();if(this.openAfterPingTimeout&&(clearTimeout(this.openAfterPingTimeout),this.openAfterPingTimeout=null),this.hideMarkerManager(),this.setCaptureEditorOpen(!1),this.gleapFrameContainer){var i=this.gleapFrameContainer;i.classList.remove("gleap-frame-container--animate"),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null),!r||i.classList.contains("gleap-frame-container--measuring")?(i.classList.remove("gleap-frame-container--measuring"),i.classList.add("gleap-frame-container--hidden")):(i.classList.add("gleap-frame-container--closing"),this.closeTimeout=setTimeout((function(){i.classList.add("gleap-frame-container--hidden"),i.classList.remove("gleap-frame-container--closing"),e.closeTimeout=null}),260))}t&&this.sendMessage({name:"reset-routes",data:{}}),this.widgetOpened=!1,this.updateWidgetStatus(),R.getInstance().updateFeedbackButtonState(),o&&dn.notifyEvent("close"),Zv.getInstance().reloadNotificationsFromCache(),this.unregisterEscListener(),"undefined"!=typeof window&&void 0!==window.focus&&window.focus(),n&&R.getInstance().restoreFocus()}}},{key:"sendMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{this.gleapFrame=document.querySelector(".gleap-frame"),this.comReady&&this.gleapFrame&&this.gleapFrame.contentWindow?this.gleapFrame.contentWindow.postMessage(JSON.stringify(e),Gt(this.gleapFrame,this.frameUrl)):t&&this.queue.push(e)}catch(n){}}},{key:"sendSessionUpdate",value:function(){this.sendMessage({name:"session-update",data:{sessionData:Bm.getInstance().getSession(),grant:Bm.getInstance().grant,apiUrl:Bm.getInstance().apiUrl,realtimeHost:Bm.getInstance().realtimeHost,sdkKey:Bm.getInstance().sdkKey,capabilities:{adoptSession:!0}}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:Rd.getInstance().getFlowConfig(),aiTools:wn.getInstance().getAgentTools(),agentTools:wn.getInstance().getAgentTools(),overrideLanguage:ub.getInstance().getOverrideLanguage()}}),this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0))}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new Rv(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=gv(this.queue);this.queue=[];for(var t=0;t0&&(e.frameHeight=n,e.isAutoHeightSurvey()&&(e.applyInnerSize(),e.revealSurvey()))}if("survey-legacy"===t.name&&e.setSurveyLegacy(),"survey-theme"===t.name&&t.data&&e.setSurveyTheme(t.data),"survey-scroll-into-view"===t.name&&e.scrollSurveyPageIntoView(t.data&&!1!==t.data.smooth),"survey-shown"!==t.name&&"survey-step-viewed"!==t.name&&"survey-answered"!==t.name&&"survey-completed"!==t.name&&"survey-closed"!==t.name||(dn.notifyEvent(t.name,t.data||{}),pv(t.name,t.data||{})),"notify-event"===t.name){dn.notifyEvent(t.data.type,t.data.data);var r=t.data&&"outbound-sent"===t.data.type?t.data.data:null;if(r&&r.outboundId&&r.responseId){var o=Object.assign({},r.formData||{});delete o.reportedBy,$b.trackEvent("outbound-".concat(r.outboundId,"-submitted"),o)}}if("cleanup-drawings"===t.name&&e.hideMarkerManager(),"open-url"===t.name){var i=t.data,a=!!t.newTab;e.urlHandler(i,a)}var s;if("start-product-tour"===t.name&&$b.startProductTour(null===(s=t.data)||void 0===s?void 0:s.tourId,!0),"run-custom-action"===t.name&&vp.triggerCustomAction(t.data,function(e){for(var t=1;t0){dn.notifyEvent("outbound-sent",{outboundId:b,outbound:y,formData:v});try{delete v.reportedBy}catch(n){}$b.trackEvent("outbound-".concat(b,"-submitted"),v)}})).catch((function(t){setTimeout((function(){e.sendingFeedback=!1,e.sendMessage({name:"feedback-sending-failed",data:"Something went wrong, please try again."}),dn.notifyEvent("error-while-sending")}),1e3)}))}"start-screen-drawing"===t.name&&e.showDrawingScreen(t.data),!ad||"capture-start"!==t.name&&"capture-cancel"!==t.name&&"capture-editor"!==t.name&&"capture-done"!==t.name&&"capture-fly"!==t.name||ad.getInstance().handleMessengerMessage(t)})),window.addEventListener("message",(function(t){var n=Pr.getInstance(),r=n.bannerContainer?n.bannerContainer.querySelector(".gleap-b-frame"):null,o=e.gleapFrame&&t.source===e.gleapFrame.contentWindow,i=r&&t.source===r.contentWindow,a=t.origin===e.frameUrl,s=t.origin===n.bannerUrl;if(o||i||a||s)try{var l=JSON.parse(t.data);if("MODAL"===(null==l?void 0:l.type)||"BANNER"===(null==l?void 0:l.type)||"CHATBAR"===(null==l?void 0:l.type)||"AGENT_CONVERSATION"===(null==l?void 0:l.type))return;if("adopt-session"===(null==l?void 0:l.name)&&!o&&!a)return;for(var c=0;c0&&(n.tags=r);try{e&&e.contentWindow&&e.contentWindow.postMessage(JSON.stringify({name:"collect-ticket-data",data:n}),Gt(e,this.frameUrl))}catch(o){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&vv(t.prototype,n),r&&vv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function kv(e){return kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kv(e)}function xv(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Sv(this,"rerender",void 0),Sv(this,"svgElement",null),Sv(this,"path",null),Sv(this,"strPath",void 0),Sv(this,"strokeWidth",12),Sv(this,"strokeWidthRect",6),Sv(this,"bufferSize",4),Sv(this,"buffer",[]),Sv(this,"startPoint",null),Sv(this,"tool","rect"),Sv(this,"color","#EB144C"),Sv(this,"mouseDown",null),Sv(this,"mouseMove",null),Sv(this,"mouseUp",null),Sv(this,"resizeListener",null),Sv(this,"pathBuffer",[]);var o=this;this.rerender=t,this.svgElement=document.querySelector(".bb-capture-svg"),this.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px"),this.trackScroll=!!r,this.scrollListener=null,this.trackScroll&&(this.scrollListener=function(){o.svgElement.style.transform="translate(".concat(-window.scrollX,"px, ").concat(-window.scrollY,"px)"),o.svgElement.style.minWidth="".concat(document.documentElement.scrollWidth,"px")},this.scrollListener(),window.addEventListener("scroll",this.scrollListener,{passive:!0})),this.resizeListener=function(e){o.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px")},window.addEventListener("resize",this.resizeListener,!0),this.mouseDown=function(e){e.preventDefault();var t=document.querySelector(".bb-capture-toolbar-item-colorpicker");t&&(t.style.display="none"),o.fadeOutToolbar(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseDownPen(e),"rect"===o.tool&&o.mouseDownRect(e)},this.mouseMove=function(e){e.preventDefault(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseMovePen(e),"rect"===o.tool&&o.mouseMoveRect(e)},this.mouseUp=function(e){e.preventDefault(),o.fadeInToolbar(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseUpPen(e),"rect"===o.tool&&o.mouseUpRect(e)},this.svgElement.addEventListener("mousedown",this.mouseDown),this.svgElement.addEventListener("mousemove",this.mouseMove),this.svgElement.addEventListener("mouseup",this.mouseUp),this.svgElement.addEventListener("touchstart",this.mouseDown,!1),this.svgElement.addEventListener("touchmove",this.mouseMove,!1),this.svgElement.addEventListener("touchend",this.mouseUp,!1),setTimeout((function(){n.rerender()}),100)}var t,n,r;return t=e,n=[{key:"clear",value:function(){if(this.svgElement)for(;this.svgElement.firstChild;)this.svgElement.firstChild.remove()}},{key:"destroy",value:function(){this.svgElement.removeEventListener("mousedown",this.mouseDown),this.svgElement.removeEventListener("mousemove",this.mouseMove),this.svgElement.removeEventListener("mouseup",this.mouseUp),this.svgElement.removeEventListener("touchstart",this.mouseDown),this.svgElement.removeEventListener("touchmove",this.mouseMove),this.svgElement.removeEventListener("touchend",this.mouseUp),window.removeEventListener("resize",this.resizeListener)}},{key:"destroyScrollTracker",value:function(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null)}},{key:"mouseUpPen",value:function(){this.path&&(this.path=null)}},{key:"mouseUpRect",value:function(){this.path&&(this.path=null)}},{key:"mouseMovePen",value:function(e){this.path&&(this.appendToBuffer(this.getMousePosition(e)),this.updateSvgPath())}},{key:"mouseMoveRect",value:function(e){if(this.path){var t=this.getMousePosition(e),n=Math.abs(t.x-this.startPoint.x),r=Math.abs(t.y-this.startPoint.y),o=t.x,i=t.y;t.x>this.startPoint.x&&(o=this.startPoint.x),t.y>this.startPoint.y&&(i=this.startPoint.y),this.path.setAttributeNS(null,"x",o),this.path.setAttributeNS(null,"y",i),this.path.setAttributeNS(null,"width",n),this.path.setAttributeNS(null,"height",r)}}},{key:"mouseDownRect",value:function(e){this.path=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",this.color),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",this.strokeWidthRect),this.startPoint=this.getMousePosition(e),this.appendPathToSvg(this.path)}},{key:"mouseDownPen",value:function(e){var t=this.color+"AA",n=this.strokeWidth;"blur"===this.tool&&(t="#000000",n=40),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",t),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",n),this.buffer=[];var r=this.getMousePosition(e);this.appendToBuffer(r),this.strPath="M"+r.x+" "+r.y,this.path.setAttribute("d",this.strPath),this.appendPathToSvg(this.path)}},{key:"setTool",value:function(e){this.tool=e}},{key:"setColor",value:function(e){this.color=e}},{key:"getMousePosition",value:function(e){var t=this.trackScroll?window.scrollX:0,n=this.trackScroll?window.scrollY:0;return e.touches&&e.touches.length>0?{x:e.touches[0].clientX+t,y:e.touches[0].clientY+n}:{x:e.clientX+t,y:e.clientY+n}}},{key:"getAveragePoint",value:function(e){var t=this.buffer.length;if(t%2==1||t>=this.bufferSize){var n,r,o=0,i=0,a=0;for(r=e;rthis.bufferSize;)this.buffer.shift()}},{key:"appendPathToSvg",value:function(e){this.svgElement.appendChild(e),this.pathBuffer.push(e),this.rerender()}},{key:"removeLastAddedPathFromSvg",value:function(){this.pathBuffer.length<=0||!this.svgElement||(this.svgElement.removeChild(this.pathBuffer[this.pathBuffer.length-1]),this.pathBuffer.pop(),this.rerender())}},{key:"fadeOutToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=0,e.style.pointerEvents="none")}},{key:"fadeInToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=1,e.style.pointerEvents="auto")}}],n&&xv(t.prototype,n),r&&xv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Iv(e){return Iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Iv(e)}function Dv(e,t){for(var n=0;n\n \n
'.concat(ve("dismiss"),"
\n
").concat(ve("rect"),'
\n
\n
\n ').concat(ve("drag"),"\n
\n ").concat("capture"===this.type?'
\n '.concat(ve("recorderon"),"\n ").concat(ve("recorderoff"),'\n \n
\n
\n ').concat(ve("mic"),'\n \n
\n
2:00
\n
\n
\n ').concat(ve("pointer"),"\n
"):"",'\n
\n ').concat(ve("rect"),'\n
\n
\n ').concat(ve("pen"),'\n
\n
\n ').concat(ve("blur"),'\n
\n
\n
\n ').concat(ub.translateText("pickAColor"),'\n
\n
\n ').concat(ve("undo"),'\n ').concat(ub.translateText("undo"),"\n
\n ").concat("capture"!==this.type?'
'.concat(ub.translateText("next"),"
"):"",'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
').concat(ub.translateText("retry"),'
\n
').concat(ub.translateText("next"),"
\n
\n
\n
\n "),document.body.appendChild(e),e.setAttribute("dir",ub.getInstance().isRTLLayout?"rtl":"ltr")}},{key:"captureTabScreenshot",value:function(){var e=this;this.capturingTab=!0;var t=tu(),n=document.querySelector(".bb-capture-editor"),r=function(e){n&&n.classList.toggle("bb-capture-editor--capturing",e)};r(!0);var o=ad.getInstance();(e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=e;const a=()=>!i||i();return wu({streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,active:a}).then((e=>e?a()?ku(e):(Yc(e.canvas),null):null))})({streamPromise:t,setUiHidden:r,privacyOptions:o.privacyOptions(),maskSelectors:o.maskSelectors(),isActive:function(){return e.capturingTab}}).catch((function(){return null})).then((function(t){e.capturingTab&&(e.capturingTab=!1,$b.getInstance().setGlobalDataItem("screenshotImage",t),e.finishNextStep())}))}},{key:"finishNextStep",value:function(){this.showWidgetUI(),this.callback&&(wv.getInstance().sendMessage({name:"set-form-data",data:{formKey:"capture",data:{value:this.type,dirty:!0}}}),this.callback(!0))}},{key:"unregisterListeners",value:function(){this.escListener&&document.removeEventListener("keydown",this.escListener),this.pageLeaveListener&&window.removeEventListener("beforeunload",this.pageLeaveListener)}},{key:"registerListeners",value:function(){var e=this;this.escListener=function(t){var n=!1,r=!1;"key"in(t=t||window.event)&&(n="Escape"===t.key,r="Enter"===t.key),n&&e.dismiss(),"screenshot"===e.type&&r&&e.showNextStep()},document.addEventListener("keydown",this.escListener),this.pageLeaveListener=function(e){e.preventDefault(),e.returnValue=""},window.addEventListener("beforeunload",this.pageLeaveListener)}},{key:"show",value:function(e){this.callback=e,this.registerListeners(),this.hideWidgetUI(),this.createEditorUI(),this.setupMousePointer(),"screenshot"===this.type?($b.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),Lv.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new Ev(this.captureScreenDrawerRerender.bind(this),"screenshot"===this.type),this.setupColorPicker(),this.setupToolbar()}},{key:"setupColorPicker",value:function(){for(var t=this,n=document.querySelector(".bb-capture-toolbar-item-selectedcolor"),r=document.querySelectorAll(".bb-capture-toolbar-item-color"),o=document.querySelector(".bb-capture-toolbar-item-colorpicker"),i=function(){var i=r[a],s=i.getAttribute("data-color");i.style.backgroundColor=s,i.onclick=function(){i&&(t.screenDrawer.setColor(s),o&&(o.style.display="none"),n.style.backgroundColor=i.style.backgroundColor,e.setPenColor(s))}},a=0;a0?r.classList.remove(e):r.classList.add(e))}}},{key:"captureRenderer",value:function(){if(this.screenRecorder){this.screenRecorder.file&&$b.getInstance().setGlobalDataItem("screenRecordingData",this.screenRecorder.file);var e="bb-capture-editor-item-inactive",t=document.querySelector(".bb-capture-toolbar-item-timer"),n=document.querySelectorAll(".bb-capture-toolbar-item"),r=document.querySelector(".bb-tooltip-screen-recording"),o=document.querySelector(".bb-tooltip-audio-recording"),i=document.querySelector(".bb-capture-editor"),a="bb-capture-editor-recording",s="bb-capture-editor-notrecording";this.screenRecorder.isRecording?(i.classList.add(a),i.classList.remove(s)):(i.classList.add(s),i.classList.remove(a));var l=document.querySelector(".bb-capture-toolbar");document.querySelector(".bb-capture-preview").style.display=this.screenRecorder.file?"flex":"none",l.style.display=this.screenRecorder.file?"none":"flex";for(var c=0;c0){var t,n=null===(t=Bm.getInstance().session)||void 0===t?void 0:t.gleapId,r=e.filter((function(e){var t;return n&&(null==e?void 0:e.cachedForGleapId)===n&&"chatbar"!==(null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource)&&new Date(e.createdAt)>new Date(Date.now()-36e5)}));this.notifications=r.slice(-4),this.renderNotifications()}}catch(o){}}},{key:"notificationPassesPageRules",value:function(e){try{var t="undefined"!=typeof window&&window.location?window.location.href:void 0;return!t||nm(t,e)}catch(n){return!0}}},{key:"getVisibleNotifications",value:function(){var e=this;return $b.getInstance().disableInAppNotifications?[]:this.notifications.filter((function(t){return e.notificationPassesPageRules(t)}))}},{key:"checkPageRulesForUrl",value:function(e){e&&e!==this.lastPageRulesUrl&&(this.lastPageRulesUrl=e,this.notifications.some((function(e){var t;return(null==e||null===(t=e.pageRules)||void 0===t?void 0:t.length)>0||(null==e?void 0:e.pageFilter)}))&&this.renderNotifications())}},{key:"setNotificationCount",value:function(e){this.unreadCount=e,this.updateTabBarNotificationCount(),R.getInstance().updateNotificationBadge(this.unreadCount)}},{key:"showNotification",value:function(e){if(this.notificationContainer&&e&&e.data){try{var t,n,r=null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource,o=or.getInstance(),i=(null==o||null===(n=o.config)||void 0===n?void 0:n.enabled)||(null==o?void 0:o.manuallyShown)||o&&!o.isHidden;if("chatbar"===r&&i)return void o.showChatbarNotification(e.data)}catch(s){}var a;for(this.notifications.find((function(t){return e.outbound===t.outbound}))||(e.cachedForGleapId=null===(a=Bm.getInstance().session)||void 0===a?void 0:a.gleapId,this.notifications.push(e),e.sound&&!$b.getInstance().disableInAppNotifications&&this.notificationPassesPageRules(e)&&cr.ping());this.notifications.length>4;)this.notifications.shift();se(this.unreadNotificationsKey,this.notifications),this.renderNotifications()}}},{key:"renderNotifications",value:function(){var e=this;if(this.notificationContainer){this.clearAllNotifications(!0);var t=document.createElement("div");t.onclick=function(){e.clearAllNotifications(),e.currentNewsIndex=0},t.className="gleap-notification-close",t.innerHTML=ve("dismiss"),this.notificationContainer.appendChild(t);var n=this.getVisibleNotifications(),r=n.filter((function(e){return e.data.news})).sort((function(e,t){return new Date(e.createdAt)-new Date(t.createdAt)})),o=n.filter((function(e){return!e.data.news}));if(r.length>0){var i=this.currentNewsIndex1){var g=document.createElement("div");g.className="gleap-news-pagination";var m=document.createElement("span");m.className="gleap-news-page-indicator",m.innerText="".concat(i+1," / ").concat(r.length),g.appendChild(m);var v=document.createElement("button");v.className="gleap-news-next-button",i\n
\n
\n
\n
\n \n \n \n ').concat(t.data.nextStepTitle,"\n
\n \n ")}else r.className="gleap-notification-item gleap-notification-card",r.innerHTML='\n
\n '.concat(e.renderAvatar(t.data.sender,"gleap-notification-item-avatar"),'\n
\n
').concat(n,"
\n ").concat(e.renderMeta(t),"\n
\n
");e.notificationContainer.appendChild(r)},b=0;b0||o.length>0||this.clearAllNotifications(!0);var w=(r.length>0?1:0)+o.length;this.notificationContainer.classList&&(this.notificationContainer.classList.toggle("gleap-notification-container--stack",w>1),this.notificationContainer.classList.remove("gleap-notification-container--expanded")),this.updateStackLayout()}}},{key:"updateStackLayout",value:function(){try{this.stackResizeObserver&&(this.stackResizeObserver.disconnect(),this.stackResizeObserver=null);var e=this.notificationContainer;if(!e||!e.classList||!e.classList.contains("gleap-notification-container--stack")||"function"!=typeof e.querySelectorAll)return;var t=Array.prototype.slice.call(e.querySelectorAll(".gleap-notification-card"));if(t.length<2)return;var n=function(){try{for(var n=t.map((function(e){return e.offsetHeight||0})),r=n[n.length-1],o=0,i=0,a=t.length-1;a>=0;a--){var s=t.length-1-a,l=0===s?0:1===s?9:17;t[a].style.setProperty("--gleap-nstack-collapse","".concat(n[a]-r-l,"px")),t[a].style.setProperty("--gleap-nstack-expand","".concat(-i,"px"));var c=n[a]-(r-12);t[a].style.setProperty("--gleap-nstack-clip",s>0&&c>0?"".concat(c,"px"):"-40px"),i+=n[a],o+=n[a]}e.style.setProperty("--gleap-nstack-h-collapsed","".concat(r+17,"px")),e.style.setProperty("--gleap-nstack-h-expanded","".concat(o,"px"))}catch(u){}};if(n(),"undefined"!=typeof ResizeObserver){this.stackResizeObserver=new ResizeObserver(n);for(var r=0;r')}},{key:"renderMeta",value:function(e){var t=e.data.sender,n=[];t&&t.name&&n.push(''.concat(t.name,""));var r=function(e,t){try{if(!e||"undefined"==typeof Intl||"function"!=typeof Intl.RelativeTimeFormat)return"";var n,r=new Date(e).getTime();if(isNaN(r))return"";try{n=new Intl.RelativeTimeFormat(t||void 0,{numeric:"auto"})}catch(l){n=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"})}var o=Math.min(0,(r-Date.now())/1e3);if(o>-60)return n.format(0,"second");for(var i=o/60,a=0;a'.concat(r,"")),0===n.length?"":'
'.concat(n.join('\u2022'),"
")}},{key:"renderDescription",value:function(e){var t=e.data,n=t.previewText,r=t.sender;return n&&n.length>0?n:r?'\n
\n '.concat(this.renderAvatar(r,"gleap-notification-item-news-sender-avatar"),"\n ").concat(r.name,"\n
\n "):""}},{key:"clearNotificationsForConversation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)try{var n=function(t){var n;return(null==t||null===(n=t.data)||void 0===n||null===(n=n.conversation)||void 0===n?void 0:n.shareToken)===e},r=ae(this.unreadNotificationsKey);r&&r.length>0&&se(this.unreadNotificationsKey,r.filter((function(e){return!n(e)})));var o,i=this.notifications.length;this.notifications=this.notifications.filter((function(e){return!n(e)})),this.notifications.length!==i&&this.renderNotifications(),t||eb.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(o=Bm.getInstance().session)||void 0===o?void 0:o.gleapId})}catch(a){}}},{key:"clearAllNotifications",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e||(this.notifications=[],this.currentNewsIndex=0,se(this.unreadNotificationsKey,this.notifications)),this.notificationContainer){for(;this.notificationContainer.firstChild;)this.notificationContainer.removeChild(this.notificationContainer.firstChild);if(!e&&!t)try{var n;eb.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=Bm.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(r){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=Rd.getInstance().getFlowConfig(),t="gleap-notification-container--left",n="gleap-notification-container--no-button";this.notificationContainer.classList.remove(t),this.notificationContainer.classList.remove(n),e.feedbackButtonPosition!==R.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==R.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===R.getInstance().buttonHidden?e.feedbackButtonPosition===R.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):R.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",ub.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Kv(t.prototype,n),r&&Kv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Qv(e){return Qv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qv(e)}function ey(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{})}function n(t){return t?e[t]:e}function r(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}function o(e){var t='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap((function(e){var n=e.matches(t),r=Array.from(e.querySelectorAll(t));return[].concat(iy(n?[e]:[]),r)})).filter((function(e){return"none"!==getComputedStyle(e).pointerEvents&&s(e)}))}function i(e){if(e&&!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(e)){var t=n("smoothScroll");e.scrollIntoView({behavior:!t||a(e)?"auto":"smooth",inline:"center",block:"center"})}}function a(e){if(e&&e.parentElement){var t=e.parentElement;return t.scrollHeight>t.clientHeight}}function s(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function l(e){for(var t=Qe(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:5e3,o=e.element,a=o;if("string"==typeof a&&(a=l(o)),o&&!a&&t>=0)setTimeout((function(){L(),C(e,t-100)}),100);else{if(!a){if(e.element){try{console.warn("[Gleap] Product tour selector did not match:",e.element)}catch(s){}return n("onElementNotFound")(e)}a=function(){var e=document.getElementById("gleap-tour-dummy-element");if(e)return e;var t=document.createElement("div");return t.id="gleap-tour-dummy-element",t.style.width="0",t.style.height="0",t.style.pointerEvents="none",t.style.opacity="0",t.style.position="fixed",t.style.top="50%",t.style.left="50%",document.body.appendChild(t),t}()}!function(e,t){var o,a,s=400,l=Date.now(),c=g("__activeStep"),u=g("__activeElement")||e,p=!u||u===e,h="gleap-tour-dummy-element"===e.id,m="gleap-tour-dummy-element"===u.id,v=n("animate"),y=t.onHighlightStarted||n("onHighlightStarted"),b=(null==t?void 0:t.onHighlighted)||n("onHighlighted"),k=(null==c?void 0:c.onDeselected)||n("onDeselected"),S=n(),C=g();!p&&k&&k(m?void 0:u,c,{config:S,state:C});y&&y(h?void 0:e,t,{config:S,state:C});var E=!p&&v,I=!1;L(),f("previousStep",c),f("previousElement",u),f("activeStep",t),f("activeElement",e);var D=function o(){if(g("__transitionCallback")===o){var i=Date.now()-l,a=s-i<=s/2;t.popover&&a&&!I&&E&&(F(e,t),I=!0),n("animate")&&i0&&O[0].focus()}function O(){var e=g("popover");if(null==e?void 0:e.wrapper){var t=e.wrapper.getBoundingClientRect(),r=n("stagePadding")||0,o=n("popoverOffset")||0;return{width:t.width+r+o,height:t.height+r+o,realWidth:t.width,realHeight:t.height}}}function M(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.top-o,window.innerHeight-r.realHeight-i.width),i.width):"end"===e?Math.max(Math.min(n.top-(null==r?void 0:r.realHeight)+n.height+o,window.innerHeight-(null==r?void 0:r.realHeight)-i.width),i.width):"center"===e?Math.max(Math.min(n.top+n.height/2-(null==r?void 0:r.realHeight)/2,window.innerHeight-(null==r?void 0:r.realHeight)-i.width),i.width):0}function P(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.left-o,window.innerWidth-r.realWidth-i.width),i.width):"end"===e?Math.max(Math.min(n.left-(null==r?void 0:r.realWidth)+n.width+o,window.innerWidth-(null==r?void 0:r.realWidth)-i.width),i.width):"center"===e?Math.max(Math.min(n.left+n.width/2-(null==r?void 0:r.realWidth)/2,window.innerWidth-(null==r?void 0:r.realWidth)-i.width),i.width):0}function R(e,t){var r=g("popover");if(r){var o=(null==t?void 0:t.popover)||{},i=o.align,a=void 0===i?"start":i,s=o.side,l=void 0===s?"left":s,c=a,u="gleap-tour-dummy-element"===e.id?"over":l,d=n("stagePadding")||0,p=O(),h=r.arrow.getBoundingClientRect(),f=e.getBoundingClientRect(),m=f.top-p.height,v=m>=0,y=window.innerHeight-(f.bottom+p.height),b=y>=0,w=f.left-p.width,k=w>=0,x=window.innerWidth-(f.right+p.width),S=x>=0,C=!(v||b||k||S),E=u;if("top"===u&&v?S=k=b=!1:"bottom"===u&&b?S=k=v=!1:"left"===u&&k?S=v=b=!1:"right"===u&&S&&(k=v=b=!1),"over"===u){var I=window.innerWidth/2-p.realWidth/2,D=window.innerHeight/2-p.realHeight/2;r.wrapper.style.left="".concat(I,"px"),r.wrapper.style.right="auto",r.wrapper.style.top="".concat(D,"px"),r.wrapper.style.bottom="auto"}else if(C){var A=window.innerWidth/2-(null==p?void 0:p.realWidth)/2;r.wrapper.style.left="".concat(A,"px"),r.wrapper.style.right="auto",r.wrapper.style.bottom="".concat(10,"px"),r.wrapper.style.top="auto"}else if(k){var T=Math.min(w,window.innerWidth-(null==p?void 0:p.realWidth)-h.width),L=M(c,{elementDimensions:f,popoverDimensions:p,popoverPadding:d,popoverArrowDimensions:h});r.wrapper.style.left="".concat(T,"px"),r.wrapper.style.top="".concat(L,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="left"}else if(S){var F=Math.min(x,window.innerWidth-(null==p?void 0:p.realWidth)-h.width),R=M(c,{elementDimensions:f,popoverDimensions:p,popoverPadding:d,popoverArrowDimensions:h});r.wrapper.style.right="".concat(F,"px"),r.wrapper.style.top="".concat(R,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",E="right"}else if(v){var N=Math.min(m,window.innerHeight-p.realHeight-h.width),j=P(c,{elementDimensions:f,popoverDimensions:p,popoverPadding:d,popoverArrowDimensions:h});r.wrapper.style.top="".concat(N,"px"),r.wrapper.style.left="".concat(j,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="top"}else if(b){var B=Math.min(y,window.innerHeight-(null==p?void 0:p.realHeight)-h.width),_=P(c,{elementDimensions:f,popoverDimensions:p,popoverPadding:d,popoverArrowDimensions:h});r.wrapper.style.left="".concat(_,"px"),r.wrapper.style.bottom="".concat(B,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",E="bottom"}C?r.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var r=g("popover");if(!r)return;var o=n.getBoundingClientRect(),i=O(),a=r.arrow,s=i.width,l=window.innerWidth,c=o.width,u=o.left,d=i.height,p=window.innerHeight,h=o.top,f=o.height;a.className="gleap-tour-popover-arrow";var m=t,v=e;"top"===t?(u+c<=0?(m="right",v="end"):u+c-s<=0&&(m="top",v="start"),u>=l?(m="left",v="end"):u+s>=l&&(m="top",v="end")):"bottom"===t?(u+c<=0?(m="right",v="start"):u+c-s<=0&&(m="bottom",v="start"),u>=l?(m="left",v="start"):u+s>=l&&(m="bottom",v="end")):"left"===t?(h+f<=0?(m="bottom",v="end"):h+f-d<=0&&(m="left",v="start"),h>=p?(m="top",v="end"):h+d>=p&&(m="left",v="end")):"right"===t&&(h+f<=0?(m="bottom",v="start"):h+f-d<=0&&(m="right",v="start"),h>=p?(m="top",v="start"):h+d>=p&&(m="right",v="end"));m?(a.classList.add("gleap-tour-popover-arrow-side-".concat(m)),a.classList.add("gleap-tour-popover-arrow-align-".concat(v))):a.classList.add("gleap-tour-popover-arrow-none")}(c,E,e)}}return function(){function e(){n("allowClose")&&d()}function r(){var e=g("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?l(r):d()}}function o(){var e=g("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?l(r):d()}}function i(){var e;if(!g("__transitionCallback")){var t=g("activeIndex"),r=g("__activeStep"),i=g("__activeElement");if("CLICK"!==r.mode)if(void 0!==t&&void 0!==r)if(void 0!==g("activeIndex")){var a=(null==(e=r.popover)?void 0:e.onPrevClick)||n("onPrevClick");if(a)return a(i,r,{config:n(),state:g()});o()}}}function a(){var e;if(!g("__transitionCallback")){var t=g("activeIndex"),o=g("__activeStep"),i=g("__activeElement");if("CLICK"!==o.mode&&void 0!==t&&void 0!==o){var a=(null==(e=o.popover)?void 0:e.onNextClick)||n("onNextClick");if(a)return a(i,o,{config:n(),state:g()});r()}}}function s(){g("isInitialized")||(f("isInitialized",!0),document.body.classList.add("gleap-tour-active",n("animate")?"gleap-tour-fade":"gleap-tour-simple"),window.addEventListener("keyup",A,!1),window.addEventListener("keydown",D,!1),window.addEventListener("resize",I),window.addEventListener("scroll",I),f("__positionInterval",setInterval((function(){g("isInitialized")&&I()}),1e3)),y("overlayClick",e),y("escapePress",e),y("arrowLeftPress",i),y("arrowRightPress",a))}function l(){var e,t,r,o,i,a,s,c,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,p=n("steps");if(!p)return console.error("No steps to drive through"),void d();if(p[u]){f("__activeOnDestroyed",document.activeElement),f("activeIndex",u);var h=p[u],g=p[u+1],m=p[u-1],v=(null==(e=h.popover)?void 0:e.doneBtnText)||n("doneBtnText")||"Done",y=n("allowClose"),b=void 0!==(null==(t=h.popover)?void 0:t.showProgress)?null==(r=h.popover)?void 0:r.showProgress:n("showProgress"),w=((null==(o=h.popover)?void 0:o.progressText)||n("progressText")||"{{current}} of {{total}}").replace("{{current}}","".concat(u+1)).replace("{{total}}","".concat(p.length)),k=(null==(i=h.popover)?void 0:i.showButtons)||n("showButtons"),x=["next","previous"].concat(iy(y?["close"]:[])).filter((function(e){return!(null==k?void 0:k.length)||k.includes(e)})),S=(null==(a=h.popover)?void 0:a.onNextClick)||n("onNextClick"),E=(null==(s=h.popover)?void 0:s.onPrevClick)||n("onPrevClick"),I=(null==(c=h.popover)?void 0:c.onCloseClick)||n("onCloseClick");C(ly(ly({},h),{},{popover:ly({showButtons:x,nextBtnText:g?void 0:v,disableButtons:iy(m?[]:["previous"]),showProgress:b,progressText:w,onNextClick:S||function(){g?l(u+1):d()},onPrevClick:E||function(){l(u-1)},onCloseClick:I||function(){d()}},(null==h?void 0:h.popover)||{})}))}else d()}function d(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=g("__activeElement"),r=g("__activeStep"),o=g("__activeOnDestroyed"),i=n("onDestroyStarted");if(e&&i){i(!t||"gleap-tour-dummy-element"===(null==t?void 0:t.id)?void 0:t,r,{config:n(),state:g()})}else{var a,s=(null==r?void 0:r.onDeselected)||n("onDeselected"),l=n("onDestroyed");if(document.body.classList.remove("gleap-tour-active","gleap-tour-fade","gleap-tour-simple"),function(){window.removeEventListener("keyup",A),window.removeEventListener("resize",I),window.removeEventListener("scroll",I);var e=g("__positionInterval");e&&clearInterval(e)}(),function(){var e,t=g("popover");t&&(null==(e=t.wrapper.parentElement)||e.removeChild(t.wrapper))}(),function(){var e;null==(e=document.getElementById("gleap-tour-dummy-element"))||e.remove(),document.querySelectorAll(".gleap-tour-active-element").forEach(p),c&&(p(c.element),u())}(),(a=g("__overlaySvg"))&&a.remove(),v={},m(),t&&r){var d="gleap-tour-dummy-element"===t.id;s&&s(d?void 0:t,r,{config:n(),state:g()}),l&&l(d?void 0:t,r,{config:n(),state:g()})}o&&o.focus()}}return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{isActive:function(){return g("isInitialized")||!1},refresh:I,drive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;s(),l(e)},setConfig:t,setSteps:function(e){m(),t(ly(ly({},n()),{},{steps:e}))},getConfig:n,getState:g,getActiveIndex:function(){return g("activeIndex")},isFirstStep:function(){return 0===g("activeIndex")},isLastStep:function(){var e=n("steps")||[],t=g("activeIndex");return void 0!==t&&t===e.length-1},getActiveStep:function(){return g("activeStep")},getActiveElement:function(){return g("activeElement")},getPreviousElement:function(){return g("previousElement")},getPreviousStep:function(){return g("previousStep")},moveNext:r,movePrevious:o,moveTo:function(e){(n("steps")||[])[e]?l(e):d()},hasNextStep:function(){var e=n("steps")||[],t=g("activeIndex");return void 0!==t&&e[t+1]},hasPreviousStep:function(){var e=n("steps")||[],t=g("activeIndex");return void 0!==t&&e[t-1]},highlight:function(e){s(),C(ly(ly({},e),{},{popover:e.popover?ly({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){d(!1)}}}}();const dy=uy;var py=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],hy="".concat(py.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),fy=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?py.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},gy=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},my=function(e,t){if(e){var n=(e.tagName||"").toLowerCase();if("input"===n||"textarea"===n){var r=function(e){var t,n;if("undefined"==typeof window)return null;var r=window.HTMLTextAreaElement&&e instanceof window.HTMLTextAreaElement?window.HTMLTextAreaElement.prototype:window.HTMLInputElement&&e instanceof window.HTMLInputElement?window.HTMLInputElement.prototype:null;return r&&null!==(t=null===(n=Object.getOwnPropertyDescriptor(r,"value"))||void 0===n?void 0:n.set)&&void 0!==t?t:null}(e);r?r.call(e,t):e.value=t}else e.textContent=t;gy(e,"input")}},vy=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.charDelay,o=void 0===r?100:r,i=n.onDone,a=function(e){if(!e)return null;if(fy(e))return e;var t="function"==typeof e.querySelector?e.querySelector(hy):null;return t&&fy(t)?t:null}(e),s=null!=t?t:"";if(a){var l=0,c=function(){gy(a,"change"),i&&i()};!function e(){try{l=0&&t.productTourData&&t.productTourData.steps){var e=t.productTourData.steps[t.currentActiveIndex];e&&e.selector&&""!==e.selector&&t.updatePointerPosition(Ze(e.selector),e)}})))}var t,n,r;return t=e,n=[{key:"disable",value:function(){this.disabled=!0,this.cleanup()}},{key:"startWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;"undefined"!=typeof window&&(this.productTourId||this.disabled||(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,this.onCompleteCallback=n,this.start()))}},{key:"storeUncompletedTour",value:function(){if("undefined"!=typeof window)if(this.productTourId&&this.productTourData)try{var e=JSON.parse(JSON.stringify({tourData:this.productTourData,tourId:this.productTourId}));e.tourData.steps=e.tourData.steps.slice(this.currentActiveIndex||0,e.tourData.steps.length),e.audioMuted=this.audioMuted,localStorage.setItem(xy,JSON.stringify(e))}catch(t){}else localStorage.removeItem(xy)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(xy));if(e&&e.tourId===this.productTourId&&"boolean"==typeof e.audioMuted)return e.audioMuted}catch(t){}}},{key:"attachScrollListeners",value:function(e,t){var n=this;if("undefined"!=typeof window&&e){var r=function(e){if("undefined"!=typeof window){for(var t=[],n=e.parentElement;n;){var r=window.getComputedStyle(n);("auto"===r.overflowY||"scroll"===r.overflowY)&&n.scrollHeight>n.clientHeight&&t.push(n),n=n.parentElement}return t}}(e);r.push(window),r.forEach((function(r){var o=function(){clearTimeout(n._scrollDebounceTimer),n._scrollDebounceTimer=setTimeout((function(){n.updatePointerPosition(e,t)}),150)};r.addEventListener("scroll",o,{passive:!0}),n._scrollListeners.push({el:r,handler:o})}))}}},{key:"removeScrollListeners",value:function(){"undefined"!=typeof window&&(this._scrollListeners&&this._scrollListeners.length>0&&(this._scrollListeners.forEach((function(e){var t=e.el,n=e.handler;t.removeEventListener("scroll",n)})),this._scrollListeners=[]),this._scrollDebounceTimer&&(clearTimeout(this._scrollDebounceTimer),this._scrollDebounceTimer=null))}},{key:"updatePointerPosition",value:function(e,t){var n,r=this;if("undefined"!=typeof window)try{var o=this._pointerContainer||document.getElementById(Sy);if(!o)return;if(!e)return o.style.position="fixed",o.style.left="50%",o.style.top="50%",o.style.transform="translate(-50%, -50%)",function(e){if("undefined"!=typeof window){var t=e-window.innerHeight/2;window.scrollTo({top:t,behavior:"smooth"})}}(window.innerHeight/2),this.removeScrollListeners(),this._currentAnchor=null,void(this._currentStep=null);n=e,"undefined"!=typeof window&&n&&n.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});var i=0;!function n(){if(function(e){if("undefined"!=typeof window){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}}(e)||i>=20){var a=e.getBoundingClientRect(),s=a.left+a.width/2,l=a.top+a.height/2+10;o.style.position="fixed",o.style.left="".concat(s,"px"),o.style.top="".concat(l,"px"),o.style.transform="translate(-50%, -50%)";var c=350;c>window.innerWidth-40&&(c=window.innerWidth-40),s+c>window.innerWidth-20?o.classList.add("copilot-pointer-container-right"):o.classList.remove("copilot-pointer-container-right"),r._currentAnchor===e&&r._currentStep===t||(r.removeScrollListeners(),r._currentAnchor=e,r._currentStep=t,r.attachScrollListeners(e,t))}else i++,setTimeout(n,100)}()}catch(a){}}},{key:"cleanup",value:function(){var e=this;"undefined"!=typeof window&&(document.body.classList.add("gl-copilot-fade-out"),this.currentAudio&&this.currentAudio.pause(),setTimeout((function(){if(e._pointerContainer)e._pointerContainer.remove(),e._pointerContainer=null;else{var t=document.getElementById(Sy);t&&t.remove()}var n=document.getElementById(Ey);n&&n.remove();var r=document.getElementById(Cy);r&&r.remove(),document.body.classList.remove("gl-copilot-fade-out")}),800),this.productTourId=void 0,this.productTourData=void 0,this.removeScrollListeners())}},{key:"toggleAudio",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.audioMuted=e,this.currentAudio&&(this.currentAudio.muted=this.audioMuted);var t=document.querySelector(".".concat(Ey,"-mute"));t&&(t.innerHTML=ve(this.audioMuted?"unmute":"mute")),this.productTourId&&this.productTourData&&this.storeUncompletedTour()}},{key:"setupCopilotTour",value:function(){var e,t,n,r,o,i,a,s=this;if("undefined"!=typeof window){var l,c,u=null!==(e=null===(t=Rd.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=me(u),p=document.getElementById(Cy);p||(p=document.createElement("style"),W(p),p.id=Cy,p.type="text/css",p.textContent="\n #".concat(Sy," {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n align-items: flex-start;\n pointer-events: none;\n z-index: 2147483610;\n transition: all 0.5s ease;\n }\n .").concat(Sy,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(Sy,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(Sy,"-clickmode svg {\n display: none !important;\n }\n #").concat(Sy," svg {\n width: 20px;\n height: auto;\n fill: none;\n }\n #copilot-info-bubble {\n position: relative;\n }\n #copilot-info-bubble-content-container {\n position: absolute;\n top: 0px;\n left: 0px;\n min-width: min(300px, 80vw);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n .").concat(Sy,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(Sy,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(Sy,"-right svg {\n transform: scaleX(-1);\n }\n #copilot-info-bubble-content svg {\n width: 16px;\n height: 16px;\n display: inline-block !important;\n margin-left: 5px;\n }\n #copilot-info-bubble-content {\n margin-top: 18px;\n margin-left: 5px;\n padding: 10px 15px;\n border-radius: 20px;\n background-color: black;\n color: white;\n font-family: Arial, sans-serif;\n font-size: 14px;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);\n max-width: 100%;\n white-space: pre-line;\n overflow-wrap: break-word;\n word-break: normal;\n hyphens: none;\n }\n .").concat(Sy,"-right #copilot-info-bubble-content {\n margin-top: 30px;\n margin-left: 0px;\n margin-right: 5px;\n }\n .click-wave {\n position: absolute;\n width: 34px;\n height: 34px;\n border-radius: 50%;\n background-color: rgba(0, 0, 0, 0.5);\n pointer-events: none;\n z-index: 2147483611;\n animation: click-wave-animation 0.8s ease forwards;\n }\n @keyframes click-wave-animation {\n 0% {\n transform: scale(0.2);\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n }\n @keyframes slideInFromTop {\n 0% {\n transform: translateY(-100%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n }\n @keyframes slideInFromBottom {\n 0% {\n transform: translateY(100%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n }\n .").concat(Ey," {\n position: fixed;\n z-index: 2147483610;\n background: #fff;\n padding: 6px;\n border-radius: 10px;\n box-shadow: 0 0 20px 0 #C294F2;\n display: flex;\n align-items: center;\n gap: 8px;\n border: 1px solid rgba(192, 146, 242, 0.5);\n }\n .").concat(Ey,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Ey,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Ey,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Ey,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Ey," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(Ey,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(Ey,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(Ey,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(Ey,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(Ey,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(Ey,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(Ey,"-dismiss svg:hover {\n opacity: 0.8;\n }\n @keyframes pulsate {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 50% {\n transform: scale(1.1);\n opacity: 0.8;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n }\n @keyframes glCoFadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n @keyframes glCoFadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n .gleap-audio-unmute-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 2147483620;\n }\n\n .gleap-audio-unmute-modal {\n background-color: #fff;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);\n text-align: center;\n max-width: 90%;\n width: 400px;\n }\n\n .gleap-audio-unmute-modal p {\n margin-bottom: 20px;\n font-size: 16px;\n line-height: 22px;\n font-weight: normal;\n }\n\n .gleap-audio-unmute-button {\n background: ").concat(u,";\n color: ").concat(d,";\n outline: none;\n border: none;\n padding: 10px 14px;\n border-radius: 12px;\n font-size: 14px;\n font-weight: bold;\n cursor: pointer;\n }\n\n .gleap-audio-unmute-button:hover {\n opacity: 0.8;\n }\n\n .gleap-tour-continue-button {\n color: ").concat(u,";\n text-decoration: none;\n cursor: pointer;\n font-size: 14px;\n font-weight: bold;\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n margin-left: 20px;\n }\n\n .gleap-tour-continue-button:hover {\n opacity: 0.8;\n }\n\n body.gl-copilot-fade-out::before,\n body.gl-copilot-fade-out::after,\n body.gl-copilot-fade-out #").concat(Ey," {\n animation: glCoFadeOut 0.8s ease-out forwards;\n }\n ").concat(null===(l=null===(c=this.productTourData)||void 0===c?void 0:c.playVoice)||void 0===l||l?"":"\n .".concat(Ey,"-mute {\n display: none;\n }\n "),"\n ").concat(this.productTourData.gradient?'body::before {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n box-sizing: border-box;\n border: 18px solid transparent;\n filter: blur(25px);\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }\n \n body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0.5;\n box-sizing: border-box;\n border: 3px solid transparent;\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }':'body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0;\n }',"\n "),document.head.appendChild(p));var h=document.createElement("div");h.id=Sy,h.style.opacity=0,this._pointerContainer=h;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("viewBox","0 0 380 476"),f.innerHTML='';var g=document.createElement("div");g.id="copilot-info-bubble",g.innerHTML="
";var m,v,y=document.createElement("div");y.id=Ey,y.classList.add(Ey,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=Iy[m])&&void 0!==v?v:Iy.TOP_RIGHT)),y.innerHTML='\n \n ').concat(null===(o=this.productTourData)||void 0===o?void 0:o.kaiSlug,'\n
\n ').concat(ve(this.audioMuted?"unmute":"mute"),"\n
\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'
\n ').concat(ve("dismiss"),"\n
"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(Ey,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(Ey,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),h.appendChild(f),h.appendChild(g),document.body.appendChild(h)}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this.productTourData;if(t){var n=function(n,r){e.audioMuted=n,e.setupCopilotTour(),e.audioMuted&&r&&null!=t&&t.showUnmuteModal?e.showAudioUnmuteModal():setTimeout((function(){e.renderNextStep()}),1500)},r=this.loadStoredAudioMuted();"boolean"!=typeof r?("undefined"==typeof window?Promise.resolve(!1):new Promise((function(e){var t=setTimeout((function(){return e(!0)}),500),n=function(n){clearTimeout(t),e(n)};try{new Audio("data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEARKwAABCxAgAEABAAZGF0YQAAAAA=").play().then((function(){return n(!0)})).catch((function(){return n(!1)}))}catch(r){n(!1)}}))).then((function(e){n(!e,!0)})):n(r,!1)}}}},{key:"showAudioUnmuteModal",value:function(){var e,t,n,r=this,o=document.createElement("div");o.classList.add("gleap-audio-unmute-modal-overlay");var i=document.createElement("div");i.classList.add("gleap-audio-unmute-modal");var a=document.createElement("p");a.textContent=null===(e=this.productTourData)||void 0===e?void 0:e.unmuteModalTitle,i.appendChild(a);var s=document.createElement("button");s.classList.add("gleap-audio-unmute-button"),s.textContent=null===(t=this.productTourData)||void 0===t?void 0:t.unmuteModalButton,s.addEventListener("click",(function(){r.toggleAudio(!1),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(s);var l=document.createElement("button");l.classList.add("gleap-tour-continue-button"),l.textContent=null===(n=this.productTourData)||void 0===n?void 0:n.unmuteModalContinue,l.addEventListener("click",(function(){r.toggleAudio(!0),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(l),o.appendChild(i),document.body.appendChild(o)}},{key:"completeTour",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];"undefined"!=typeof window&&(this.cleanup(),this.onCompleteCallback&&this.onCompleteCallback(e))}},{key:"renderNextStep",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this,n=this.productTourData.steps;if(this.currentActiveIndex>=n.length)setTimeout((function(){e.completeTour()}),500);else{var r=n[this.currentActiveIndex],o=function(n){var o,i;if(e._pointerContainer.style.display="flex",r.selector&&r.selector.length>0&&!n)e.completeTour(!1);else{var a=function(){if("INPUT"===r.mode&&n){var e,o=function(){document.querySelector("#".concat(Sy)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(Sy).style.display="none",t.currentActiveIndex++,t.storeUncompletedTour(),t.renderNextStep()};if("default"===(null!==(e=r.inputType)&&void 0!==e?e:"default")){var i=function e(t){var r;if(0!==(null==t||null===(r=t.target)||void 0===r||null===(r=r.value)||void 0===r?void 0:r.length)){var i=document.getElementById("copilot-info-bubble-content");i&&(i.innerHTML="".concat(ub.translateText("next"),' \n \n'),i.addEventListener("click",o,{once:!0}),n.classList.add("gleap-input-highlight"),document.querySelector("#".concat(Sy)).classList.add("copilot-pointer-container-clickmode"),n.removeEventListener("input",e))}};n.addEventListener("input",i,{once:!1}),n.hasAttribute("contenteditable")&&n.addEventListener("keyup",i,{once:!1}),n.addEventListener("blur",(function(){n.focus()}),{once:!0}),n.focus()}else{var a;vy(n,null!==(a=r.inputValue)&&void 0!==a?a:"",{charDelay:100,onDone:function(){setTimeout((function(){o()}),1200)}})}}else{if(t.currentActiveIndex++,t.storeUncompletedTour(),"CLICK"===r.mode&&n){var s=n.getBoundingClientRect(),l=window.scrollX||0,c=window.scrollY||0;!function(e,t){if("undefined"!=typeof window){var n=document.createElement("div");n.className="click-wave",n.style.left="".concat(e-17,"px"),n.style.top="".concat(t-17,"px"),document.body.appendChild(n),setTimeout((function(){n.remove()}),800)}}(s.left+s.width/2+l,s.top+s.height/2+c),n.click()}t.renderNextStep()}};e.updatePointerPosition(n,r);var s=null!=r&&r.message?function(e){if("undefined"!=typeof window){var t=document.createElement("div");return t.innerHTML=e,t.querySelectorAll("address, article, blockquote, br, div, footer, h1, h2, h3, h4, h5, h6, header, hr, li, p, pre, section, table, tr").forEach((function(e){e.insertAdjacentText("afterend","\n")})),(t.textContent||"").replace(/[^\S\n]+/g," ").replace(/ *\n */g,"\n").replace(/\n{3,}/g,"\n\n").trim()}}(r.message):"\ud83e\udd14";document.getElementById("copilot-info-bubble-content").textContent=s,e._pointerContainer.style.opacity=1;var l=function(e){if("undefined"!=typeof window){var t=e.split(/\s+/).filter((function(e){return e.length>0})).length;return Math.ceil(t/3.6)+1}}(s),c=function(){e.currentAudio=void 0,setTimeout((function(){a()}),1e3*l)};(null===(o=null===(i=e.productTourData)||void 0===i?void 0:i.playVoice)||void 0===o||o)&&r.voice&&r.voice.length>0?(e.currentAudio=new Audio(r.voice),e.audioMuted&&(e.currentAudio.muted=!0),e.currentAudio.addEventListener("ended",(function(){setTimeout((function(){a()}),1e3)})),e.currentAudio.play().then((function(){})).catch((function(e){c()}))):c()}},i=r.selector?function(e){if("undefined"!=typeof window){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3)/100,n=0;return new Promise((function(r,o){var i=setInterval((function(){var a=Ze(e);a?(clearInterval(i),r(a)):n>=t&&(clearInterval(i),o(new Error("Element not found for selector: ".concat(e)))),n++}),100)}))}}(r.selector):Promise.resolve(null);i.then(o).catch((function(){return o(null)}))}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&by(t.prototype,n),r&&by(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ay(e){return Ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ay(e)}function Ty(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ly(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!this.productTourId&&!this.disabled)if(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,o)this.start();else{var i=this;Bm.getInstance().validateProductTour(e).then((function(){return r>0?setTimeout((function(){i.start()}),r):n.start()})).catch((function(e){e&&e.gleapReason||console.error(e),i.onComplete(!1)}))}}},{key:"onComplete",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={tourId:this.productTourId};e?(dn.notifyEvent("productTourCompleted",t),$b.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(dn.notifyEvent("productTourQuit",t),$b.trackEvent("tour-".concat(this.productTourId,"-quit"),t)),this.gleapTourObj&&this.gleapTourObj.destroy(),this.gleapTourObj=void 0,this.productTourData=void 0,this.productTourId=void 0,this.currentActiveIndex=void 0,this.clearUncompletedTour()}},{key:"loadUncompletedTour",value:function(){try{var e=JSON.parse(localStorage.getItem(Py));if(null!=e&&e.tourData&&null!=e&&e.tourId)return e}catch(t){}return null}},{key:"storeUncompletedTour",value:function(){if(this.productTourId&&this.productTourData)try{var e=JSON.parse(JSON.stringify({tourData:this.productTourData,tourId:this.productTourId}));e.tourData.steps=e.tourData.steps.slice(this.currentActiveIndex||0,e.tourData.steps.length),localStorage.setItem(Py,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(Py)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return Dy.getInstance().startWithConfig(this.productTourId,t,(function(t){e.onComplete(t)}));this.unmuted=!1;for(var n=t.steps,r=this,o=[],i=0;i\n \n
').concat(ve("unmute"),"
\n ");else{var p="";t.sender&&t.sender.firstName&&(d=!0,p='
\n
\n
').concat(t.sender.firstName,"
\n
")),u="".concat(p,'
').concat(a.message,"
")}var h={disableActiveInteraction:!s&&!l&&!c,mode:a.mode,popover:Ly({description:u,popoverClass:"gleap-tour-popover-".concat(a.type," ").concat(!d&&"gleap-tour-popover-no-sender"," ").concat(t.allowClose&&"gleap-tour-popover-can-close")},s?{showButtons:[]}:{})};a.selector&&a.selector.length>0&&(h.element=a.selector),o.push(h)}var f=["next","close"];t.backButton&&f.push("previous"),this.gleapTourObj=dy(Oy(Oy(Oy(Oy(Oy(Oy(Oy(Oy(Oy(Oy({showProgress:!0,allowKeyboardControl:!1,steps:o},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",f),"onHighlightStarted",(function(t,n,r){var o;e.currentActiveIndex=null==r||null===(o=r.state)||void 0===o?void 0:o.activeIndex,e.storeUncompletedTour()})),"onElementNotFound",(function(t){document.removeEventListener("click",g,!0),e.onComplete(!1)})),"onDestroyStarted",(function(){e.gleapTourObj.hasNextStep()?e.onComplete(!1):e.onComplete(!0),document.removeEventListener("click",g,!0)})),"onPopoverRender",(function(t){if(t)for(var n=document.querySelectorAll(".gleap-tour-popover-description img, .gleap-tour-popover-description video"),o=function(){setTimeout((function(){e.gleapTourObj.refresh()}),500),setTimeout((function(){e.gleapTourObj.refresh()}),750)},i=0;i{const e=[];return Er()&&e.push("capture.screenshot","capture.recording"),hr&&e.push("capture.logs"),e})();n.length>0&&(t="&caps="+n.join(","))}catch(r){}this.socket=new WebSocket("".concat(Bm.getInstance().wsApiUrl,"?gleapId=").concat(Bm.getInstance().session.gleapId,"&gleapHash=").concat(Bm.getInstance().session.gleapHash,"&apiKey=").concat(Bm.getInstance().sdkKey,"&sdkVersion=").concat("19.9.1").concat(t)),this.socket.addEventListener("open",this.handleOpenBound),this.socket.addEventListener("message",this.handleMessageBound),this.socket.addEventListener("error",this.handleErrorBound),this.socket.addEventListener("close",this.handleCloseBound),this.addNetworkListeners()}}},{key:"clearReconnectTimeout",value:function(){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null)}},{key:"scheduleReconnect",value:function(){var t=this;if(this.clearReconnectTimeout(),!Vy()){var n=e.reconnectDelay(this.reconnectAttempts,Math.random());this.reconnectAttempts+=1,this.reconnectTimeout=setTimeout((function(){t.reconnectTimeout=null,Vy()||t.initWebSocket()}),n)}}},{key:"addNetworkListeners",value:function(){!this.networkListenersAdded&&"undefined"!=typeof window&&window&&"function"==typeof window.addEventListener&&(window.addEventListener("online",this.handleOnlineBound),this.networkListenersAdded=!0)}},{key:"removeNetworkListeners",value:function(){if(this.networkListenersAdded){try{window.removeEventListener("online",this.handleOnlineBound)}catch(e){}this.networkListenersAdded=!1}}},{key:"handleOnline",value:function(){(!this.socket||1!==this.socket.readyState&&0!==this.socket.readyState)&&(this.reconnectAttempts=0,this.initWebSocket())}},{key:"handleOpen",value:function(e){var t=this;this.socketOpenedAt=Date.now(),this.pingWS&&clearInterval(this.pingWS),this.pingWS=setInterval((function(){t.socket&&1===t.socket.readyState&&t.socket.send("PING")}),25e3),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null)}},{key:"handleMessage",value:function(e){this.reconnectAttempts=0,this.processMessage(JSON.parse(e.data))}},{key:"handleError",value:function(e){}},{key:"handleClose",value:function(e){this.socketOpenedAt&&Date.now()-this.socketOpenedAt>=1e4&&(this.reconnectAttempts=0),this.cleanupWebSocket(),this.scheduleReconnect()}},{key:"processMessage",value:function(e){try{if(At.getInstance().initialized)return;if("update"===e.name){var t,n,r=e.data,o=r.a,i=r.u,a=r.ai,s=r.rc,l=wv.getInstance().isOpened();if(s&&Zv.getInstance().clearNotificationsForConversation(s),a&&or.getInstance().setConfig({enabled:null!==(t=a.e)&&void 0!==t&&t,placeholder:a.p,quickActions:a.a,style:a.s,workflowId:null!==(n=a.w)&&void 0!==n?n:null}),o){var c=["banner","modal"],u=o.filter((function(e){var t;return!l||c.includes(null==e||null===(t=e.actionType)||void 0===t?void 0:t.toLowerCase())}));$b.getInstance().performActions(u)}null!=i&&Zv.getInstance().setNotificationCount(i)}if("capture-request"===e.name&&ad&&ad.getInstance().handleServerRequest(e.data),"checklist"===e.name&&null!=e&&e.data&&window){var d,p,h=e.data,f=null!==(d=h.completedSteps)&&void 0!==d?d:[],g=null!==(p=h.completedStepsBefore)&&void 0!==p?p:[];if(f.length>g.length)for(var m=function(e){var t,n=null==h||null===(t=h.steps)||void 0===t?void 0:t.find((function(t){return t.id===f[e]}));if(!n)return 1;var r=e;g.includes(n)||dn.notifyEvent("checklist-step-completed",{checklistId:h.id,outboundId:h.outboundId,stepId:n.id,stepIndex:r,step:n,completedSteps:h.completedSteps,status:h.status,data:h})},v=0;vthis.eventMaxLength&&this.eventArray.shift(),this.trimStreamedEvents()}},{key:"trimStreamedEvents",value:function(){for(;this.streamedEventArray.length>500;){var e=this.streamedEventArray.findIndex((function(e){return!e||"sessionStarted"!==e.name}));this.streamedEventArray.splice(-1!==e?e:0,1)}}},{key:"pingDidFinish",value:function(t,n,r,o){if(this.pingInFlight===t){this.pingInFlight=0;var i=o.status;if(i>=200&&i<300)return this.pingFailures=0,this.pingRetryAt=0,this.removeSentEvents(n),void(r&&this.streamEvents());e.isRetryablePingStatus(i)||this.removeSentEvents(n);var a=-1;try{a=e.parseRetryAfter(o.getResponseHeader("Retry-After"))}catch(l){}this.pingFailures+=1;var s=e.pingBackoffDelay(this.pingFailures,Math.random());a>0&&(s=Math.max(s,Math.min(a,3e5))),this.pingRetryAt=Date.now()+s}}},{key:"nextPingBatch",value:function(){for(var e=[],t=[],n=2,r=0;r0&&n+i>262144)break;e.push(o),n+=i}return t.length>0&&(this.streamedEventArray=this.streamedEventArray.filter((function(e){return-1===t.indexOf(e)}))),{events:e,hasMore:e.length=500}},{key:"parseRetryAfter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n="string"==typeof e?e.trim():"";if(!n)return-1;if(/^\d+$/.test(n))return 1e3*parseInt(n,10);var r=Date.parse(n);return isNaN(r)?-1:Math.max(0,r-t)}}],n&&qy(t.prototype,n),r&&qy(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Xy(e){return Xy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xy(e)}function Yy(e,t){for(var n=0;n100||("string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i||(t[o]=String(i).slice(0,1e3)))}return t},mb=function(e){var t=e&&"object"===db(e)?e:{format:e},n="string"==typeof t.format?t.format:"",r=hb[n]||"card",o={format:r,appMode:"survey_web"===n?"survey_web":pb[r],fields:gb(t.fields),resume:!0===t.resume,container:"page"===r?fb(t.container):null};return!0===t.keyboard&&(o.keyboard=!0),"string"==typeof t.personalToken&&t.personalToken.length>0&&(o.personalToken=t.personalToken),"string"==typeof t.outboundAction&&t.outboundAction.length>0&&(o.outboundAction=t.outboundAction),t.resumeData&&"object"===db(t.resumeData)&&!Array.isArray(t.resumeData)&&(o.resumeData=t.resumeData),o};function vb(e){return function(e){if(Array.isArray(e))return yb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return yb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yb(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.root,r=t.isVisible,o=void 0===r?Db:r,i=n||("undefined"!=typeof document?document:null);if(!i||!Eb(e))return null;var a=i.body||i,s=new Set;try{for(var l=(i.ownerDocument||i).createTreeWalker(a,4),c=l.nextNode();c;){if(c.nodeValue&&c.nodeValue.trim())for(var u=c.parentElement,d=0;u&&d<3&&(u!==a&&!Cb.has(u.tagName.toUpperCase()))&&!((u.textContent||"").length>320);d+=1)s.add(u),u=u.parentElement;c=l.nextNode()}a.querySelectorAll('[aria-label], [title], [placeholder], input[type="button"], input[type="submit"], img[alt]').forEach((function(e){return s.add(e)}))}catch(h){return null}var p=null;return s.forEach((function(t){if(!function(e){try{return!!e.closest('.gleap-frame-container, .bb-feedback-button, [id^="gleap"], [class^="gleap"], #copilot-pointer-container')}catch(h){return!1}}(t)){var n=Math.max.apply(Math,[0].concat(vb(function(e){var t=[];["aria-label","title","placeholder","alt"].forEach((function(n){var r=e.getAttribute&&e.getAttribute(n);r&&t.push(r)})),"INPUT"===e.tagName&&["button","submit","reset"].includes("".concat(e.type).toLowerCase())&&e.value&&t.push(e.value);var n=e.textContent;return n&&n.length<=320&&t.push(n),t}(t).map((function(t){return function(e,t){var n=Eb(e),r=Eb(t);if(!n||!r||n.length>160)return 0;if(n===r)return 100;if(" ".concat(n," ").includes(" ".concat(r," ")))return 60+Math.round(r.length/n.length*30);var o=Ib(r),i=Ib(n);if(0===o.length||0===i.length)return 0;var a=new Set(i),s=o.filter((function(e){return a.has(e)})).length,l=s/o.length,c=s/i.length;return 0===s||l<.5||c<.5?0:Math.round(50*Math.min(l,c))}(t,e)})))));if(0!==n){var r=!1;try{r=t.matches(Sb)||!!t.closest(Sb)}catch(h){}var i=(t.textContent||"").length;(!p||n>p.score||n===p.score&&r&&!p.interactive||n===p.score&&r===p.interactive&&i1&&void 0!==arguments[1]?arguments[1]:{}).color;if(e&&"undefined"!=typeof document){Lb(),function(e){if(!document.getElementById(kb)){var t=document.createElement("style");t.id=kb,t.textContent="\n#".concat(wb," {\n position: fixed;\n pointer-events: none;\n z-index: 2147483600;\n border: 3px solid ").concat(e,";\n border-radius: 10px;\n box-shadow: 0 0 0 4px ").concat(e,"33, 0 0 24px ").concat(e,"66;\n transition: opacity 0.3s ease;\n animation: gleap-highlight-pulse 1.2s ease-in-out 3;\n}\n@keyframes gleap-highlight-pulse {\n 0%, 100% { box-shadow: 0 0 0 4px ").concat(e,"33, 0 0 24px ").concat(e,"66; }\n 50% { box-shadow: 0 0 0 10px ").concat(e,"22, 0 0 32px ").concat(e,"88; }\n}\n@media (prefers-reduced-motion: reduce) {\n #").concat(wb," { animation: none; }\n}"),document.head.appendChild(t)}}(/^#[0-9a-f]{6}$/i.test(t||"")?t:"#485BFF");try{e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}catch(l){}var n=window.setTimeout((function(){try{var t=e.getBoundingClientRect();(t.bottom<0||t.top>window.innerHeight)&&e.scrollIntoView({block:"center",inline:"nearest"})}catch(l){}}),800),r=document.createElement("div");r.id=wb,r.setAttribute("aria-hidden","true"),document.body.appendChild(r);var o=null,i=function(){var t=e.getBoundingClientRect();r.style.top="".concat(t.top-6,"px"),r.style.left="".concat(t.left-6,"px"),r.style.width="".concat(t.width+12,"px"),r.style.height="".concat(t.height+12,"px"),r.style.opacity=e.isConnected?"1":"0"};!function e(){i(),o=window.requestAnimationFrame(e)}(),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i);var a=function(){return Lb()},s=window.setTimeout((function(){r.style.opacity="0",window.setTimeout(a,300)}),6e3);window.addEventListener("pointerdown",a,!0),window.addEventListener("keydown",a,!0),Tb=function(){window.clearTimeout(s),window.clearTimeout(n),o&&window.cancelAnimationFrame(o),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i),window.removeEventListener("pointerdown",a,!0),window.removeEventListener("keydown",a,!0),r.parentNode&&r.parentNode.removeChild(r)}}},Ob=null,Mb=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).color;if("undefined"==typeof window)return!1;var t=function(e){try{var t=new URLSearchParams(e||"").get(bb),n="".concat(null!=t?t:"").trim();return n?n.slice(0,120):null}catch(r){return null}}(window.location.search);return!!t&&(function(){try{var e=new URL(window.location.href);if(!e.searchParams.has(bb))return;e.searchParams.delete(bb),window.history.replaceState(window.history.state,"",e.toString())}catch(t){}}(),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.color,r=t.timeoutMs,o=void 0===r?1e4:r,i=t.intervalMs,a=void 0===i?300:i,s=t.isVisible;Ob&&Ob();var l=Date.now(),c=null,u=!1,d=function(){u=!0,c&&window.clearTimeout(c),Ob=null};Ob=d,function t(){if(!u){var r=Ab(e,{isVisible:s});if(r)return d(),void Fb(r,{color:n});Date.now()-l>=o?d():c=window.setTimeout(t,a)}}()}(t,{color:e}),!0)};function Pb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"";return ub.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return ub.translateTextWithVars(e,t)||n}},{key:"getCheckIcon",value:function(){return'\n \n '}},{key:"loadChecklist",value:function(){if(this._isSessionReady&&this._networkManager){var e=this.getAttribute("checklistId");e?(this.activeStep=-1,this._initialActiveSet=!1,this.validateChecklist(e)):(this.renderResponse(),this.checklistData=null,this._hasLoaded=!1)}}},{key:"getQueryParams",value:function(){var e=this._getGleapSessionInstance();if(null==e||!e.session)return"";var t=e.session,n="en";try{void 0!==ub&&(n=ub.getInstance().getActiveLanguage()||"en")}catch(r){}return"gleapId=".concat(t.gleapId||"","&gleapHash=").concat(t.gleapHash||"","&lang=").concat(n)}},{key:"makeRequest",value:function(e,t,n,r){var o=this._getGleapSessionInstance();if(null!=o&&o.session){var i=new XMLHttpRequest;i.open(e,t);try{o.injectSession(i)}catch(a){}n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){4===i.readyState&&r(i)},i.onerror=function(){r(i)},i.send(n?JSON.stringify(n):null)}else r({readyState:4,status:0,responseText:"Session unavailable",_isMock:!0})}},{key:"validateChecklist",value:function(e){var t=this;if(this._isSessionReady&&this._networkManager){this.checklistData=null,this._hasLoaded=!1,this.renderResponse();var n=this.getAttribute("sharedKey");this._networkManager.validateChecklist(e,n).then((function(e){t.isConnected&&t._isSessionReady&&e&&t.fetchChecklist(e)})).catch((function(e){t.renderResponse(),t.checklistData=null,t._hasLoaded=!1}))}}},{key:"fetchChecklist",value:function(e){var t=this;this._isSessionReady&&this._networkManager&&(this._isInitialLoad=!this._hasLoaded,this._networkManager.fetchChecklist(e).then((function(e){var n;if(!t.isConnected||!t._isSessionReady||!e)return t._hasLoaded=!1,t.checklistData=null,void t._checkSessionAndLoad();if(t.checklistData=e,t._hasLoaded=!0,"done"!==e.status){if(t._isInitialLoad&&!t._initialActiveSet){var r,o=(null===(r=e.outbound)||void 0===r||null===(r=r.config)||void 0===r?void 0:r.steps)||[],i=e.completedSteps||[],a=o.findIndex((function(e){return!i.includes(e.id)}));t.activeStep=a>=0?a:-1,-1!==t.activeStep&&(t._initialActiveSet=!0)}t.renderChecklist(t.checklistData),dn.notifyEvent("checklist-loaded",{checklistId:t.checklistData.id,outboundId:null===(n=t.checklistData.outbound)||void 0===n?void 0:n.id,completedSteps:t.checklistData.completedSteps,status:t.checklistData.status,data:t.checklistData})}else t.renderResponse()})).catch((function(e){t.renderResponse(),t.checklistData=null,t._hasLoaded=!1})))}},{key:"updateChecklist",value:function(e,t){var n,r,o=this._getGleapSessionInstance();if(null!=o&&o.session){var i=o.apiUrl;if(i){var a=o.session,s=null!==(n=null==a?void 0:a.gleapId)&&void 0!==n?n:"",l=null!==(r=null==a?void 0:a.gleapHash)&&void 0!==r?r:"",c="en";try{void 0!==ub&&(c=ub.getInstance().getActiveLanguage()||"en")}catch(d){}var u="".concat(i,"/outbound/checklists/").concat(e);t.checkedStep&&(u+="/increment/".concat(t.checkedStep)),u+="?gleapId=".concat(s,"&gleapHash=").concat(l,"&lang=").concat(c),this.makeRequest("PUT",u,t,(function(e){e._isMock||200!==e.status&&e.status}))}}}},{key:"handleChecklistUpdate",value:function(e){if(this._hasLoaded&&this.checklistData){var t=e.detail;if(t&&t.id===this.checklistData.id){var n,r=ld(this.checklistData.completedSteps||[]),o=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(r)&&(this.checklistData.completedSteps=ld(t.completedSteps),o=!0,-1!==a)){var s,l=null===(s=this.checklistData.outbound)||void 0===s||null===(s=s.config)||void 0===s||null===(s=s.steps)||void 0===s||null===(s=s[a])||void 0===s?void 0:s.id;l&&this.checklistData.completedSteps.includes(l)&&!r.includes(l)&&(i=!0)}if(t.status&&t.status!==this.checklistData.status&&(this.checklistData.status=t.status,o=!0),i){for(var c,u=(null===(c=this.checklistData.outbound)||void 0===c||null===(c=c.config)||void 0===c?void 0:c.steps)||[],d=-1,p=a+1;p1&&void 0!==arguments[1]?arguments[1]:"checklist-floating",o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=(null===(t=e.config)||void 0===t?void 0:t.steps)||[],a=(null===(n=this.checklistData)||void 0===n?void 0:n.completedSteps)||[],s=0;if(this.progressbarEnabled&&i.length>0){var l=i.length,c=a.length;s=l>0?c/l*100:0}var u,d,p=i.find((function(e){return!a.includes(e.id)})),h=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",f=i.length>0?p&&p.description||"":e.message||"";o&&(h=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",f=(null===(d=e.config)||void 0===d?void 0:d.successMessage)||"",s=100);var g=2*Math.PI*7,m=g-s/100*g,v="checklist-floating-header"===r,y=v?'\n \n \n ':'\n \n ';return'\n
\n
\n
\n \n \n \n \n
\n
').concat(h,"
\n ").concat(o?"":''.concat(y,""),'\n
\n
').concat(f,"
\n
\n ")}},{key:"renderInfoSection",value:function(e){var t;if(!this.infoEnabled||!e)return"";var n=e.subject||this._translate("checklistDefaultTitle","Checklist"),r=e.message||"",o="";return null!==(t=e.sender)&&void 0!==t&&t.profileImageUrl&&(o='\n
\n ').concat(e.sender.firstName||\n ').concat(e.sender.firstName||"","\n
")),'\n
\n '.concat(n?'
'.concat(n,"
"):"","\n ").concat(r?'
'.concat(r,"
"):"","\n ").concat(o,"\n
")}},{key:"renderProgressSection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!this.progressbarEnabled||!e.length)return"";var n=e.length,r=t.length,o=n>0?r/n*100:0,i=0;e.forEach((function(e){!t.includes(e.id)&&e.duration>0&&(i+=e.duration)}));var a=this._translateWithVars("taskProgress",{a:r,b:n},"".concat(r," of ").concat(n," done")),s=i>0?this._translateWithVars("aboutMinutes",{a:i},"About ".concat(i," min left")):"";return'\n
\n
'.concat(a,"
\n ").concat(s?'
'.concat(s,"
"):"",'\n
\n
\n
\n
')}},{key:"renderTasks",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t&&0!==t.length?t.map((function(t,r){var o=n.includes(t.id),i=e.activeStep===r,a=o?''.concat(e.getCheckIcon(),""):''.concat(r+1,""),s=t.title||e._translateWithVars("stepDefaultTitle",{index:r+1},"Step ".concat(r+1)),l=t.description||"",c=t.actionTitle||e._translate("actionDefaultTitle","Action"),u=t.action&&"none"!==t.action?'
\n \n
"):"",d=e._translate("markAsDone","Mark as done"),p=t.allowMarkDone&&!o?'
\n ').concat(e.getCheckIcon(),'\n
').concat(d,"
\n
"):"",h=["checklist-task",o?"checklist-task--done":"",i?"checklist-task--active":""].filter(Boolean).join(" ");return'\n
\n
\n ').concat(a,'\n
').concat(s,'
\n \n \n \n \n \n
\n
\n
\n ').concat(l?'
'.concat(l,"
"):"","\n ").concat(u,"\n ").concat(p,"\n
\n
\n
")})).join(""):"

".concat(this._translate("noStepsDefined","No steps defined."),"

")}},{key:"renderChecklist",value:function(e){var t;if(this._hasLoaded&&e&&e.outbound){var n=e.outbound,r=(null===(t=n.config)||void 0===t?void 0:t.steps)||[],o=e.completedSteps||[],i="";if("done"===e.status||r.length>0&&o.length>=r.length){var a,s,l=(null===(a=n.config)||void 0===a?void 0:a.successTitle)||"",c=(null===(s=n.config)||void 0===s?void 0:s.successMessage)||"";i=this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-launcher",!0):'\n
\n
\n '.concat(this.getCheckIcon(),'\n
\n
').concat(l,'
\n
').concat(c,"
\n
"),-1!==this.activeStep&&(this.activeStep=-1)}else i='\n
\n '.concat(this.floatingEnabled?"":this.renderInfoSection(n),"\n ").concat(this.floatingEnabled?"":this.renderProgressSection(r,o),"\n ").concat(this.floatingEnabled?this.renderFloatingLauncher(n):"",'\n
\n ').concat(this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-header"):"","\n ").concat(this.renderTasks(r,o),"\n
\n
");var u=Rd.getInstance().getFlowConfig(),d=u.color?u.color:"#485BFF";Jn.getInstance().applyToChecklist(this);var p="\n \n ');this.shadowRoot.innerHTML=p+i,this.addTaskEventListeners(),this.floatingEnabled&&this.addFloatingClickListeners(),-1!==this.activeStep&&this.toggleTask(this.activeStep,!0)}else this._checkSessionAndLoad()}},{key:"updateActiveTaskMaxHeight",value:function(){if(-1!==this.activeStep){var e=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(this.activeStep,'"] .checklist-task-body-inner')),t=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(this.activeStep,'"] .checklist-task-body'));if(e&&t){var n=e.offsetHeight;t.style.setProperty("--task-body-active-height","".concat(n,"px"))}}}},{key:"addTaskEventListeners",value:function(){var e=this;this.shadowRoot.querySelectorAll(".checklist-task").forEach((function(t){var n=t.querySelector(".checklist-task-header"),r=parseInt(t.getAttribute("data-task-index"),10);n&&n.addEventListener("click",(function(){var t=e.activeStep===r?-1:r;e.setActiveStep(t)}));var o=t.querySelector(".checklist-task-body-markdone");o&&o.addEventListener("click",(function(t){var n;if(t.stopPropagation(),null!==(n=e.checklistData)&&void 0!==n&&null!==(n=n.outbound)&&void 0!==n&&null!==(n=n.config)&&void 0!==n&&n.steps){var o=e.checklistData.outbound.config.steps[r];if(o){var i=e.activeStep;if(e.checklistData.completedSteps||(e.checklistData.completedSteps=[]),!e.checklistData.completedSteps.includes(o.id)){e.checklistData.completedSteps.push(o.id);var a=e.checklistData.outbound.config.steps,s=-1;if(i===r){for(var l=r+1;l0&&e.checklistData.completedSteps.length>=a.length&&(e.checklistData.status="done",c.status="done"),e.updateChecklist(e.checklistData.id,c)}}}}));var i=t.querySelector(".checklist-task-body-action .action-button");i&&i.addEventListener("click",(function(t){var n;if(t.stopPropagation(),null!==(n=e.checklistData)&&void 0!==n&&null!==(n=n.outbound)&&void 0!==n&&null!==(n=n.config)&&void 0!==n&&n.steps&&void 0!==$b){var o=e.checklistData.outbound.config.steps[r];if(o&&o.action&&"none"!==o.action&&!mr("start-custom-action"))try{"BOT"===o.action?$b.startBot(o.botId):"CUSTOM_ACTION"===o.action?$b.triggerCustomAction(o.actionBody):"REDIRECT_URL"===o.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),$b.openURL(o.actionBody,!!o.actionOpenInNewTab)):"FEEDBACK_FLOW"===o.action?$b.startFeedbackFlow(o.formId):"NEWS_ARTICLE"===o.action?$b.openNewsArticle(o.articleId):"HELP_ARTICLE"===o.action?$b.openHelpCenterArticle(o.articleId):"CHECKLIST"===o.action?$b.startChecklist(o.outboundId,!0,null==o?void 0:o.sharedKey):"PRODUCT_TOUR"===o.action&&$b.startProductTour(o.productTourId,!0)}catch(i){}}}))}))}},{key:"setActiveStep",value:function(e){var t=this,n=this.activeStep;this.activeStep=e;var r=[];-1!==n&&n!==this.activeStep&&r.push({index:n,open:!1}),-1!==this.activeStep&&this.activeStep!==n&&r.push({index:this.activeStep,open:!0}),r.forEach((function(e){var n=e.index,r=e.open;t.toggleTask(n,r)}))}},{key:"toggleTask",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(e,'"]'));if(r){var o=r.querySelector(".checklist-task-header");if(o){var i=r.classList.contains("checklist-task--active"),a=null!==n?n:!i;if(a){i||(r.classList.add("checklist-task--active"),o.setAttribute("aria-expanded","true"));var s=r.querySelector(".checklist-task-body-inner");if(s){var l=s.offsetHeight,c=r.querySelector(".checklist-task-body");c&&c.style.setProperty("--task-body-active-height","".concat(l,"px"))}r.querySelectorAll("iframe").forEach((function(n){n._heightListenerAdded||(n._heightListenerAdded=!0,n.addEventListener("load",(function(){t.activeStep===e&&t.updateActiveTaskMaxHeight()})))}))}else!a&&i&&(r.classList.remove("checklist-task--active"),o.setAttribute("aria-expanded","false"))}}}}],o=[{key:"observedAttributes",get:function(){return["checklistId","info","progressbar","dark","floating","sharedKey"]}}],r&&ud(n.prototype,r),o&&ud(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(hd(HTMLElement));"undefined"==typeof customElements||customElements.get("gleap-checklist")||customElements.define("gleap-checklist",e)}}(),function(){if("undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&"undefined"!=typeof window&&!customElements.get("gleap-agent-conversation")){var e=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=new Array(n),o=0;o0||r.pageFilter)&&window&&window.location&&!nm(window.location.href,r))continue;if("notification"===r.actionType)"widget"===(null==r||null===(a=r.data)||void 0===a||null===(a=a.checklist)||void 0===a?void 0:a.popupType)?e.openChecklist(r.data.checklist.id,!0):this.disableInAppNotifications||e.showNotification(r);else if("banner"===r.actionType)e.showBanner(r);else if("modal"===r.actionType)e.showModal(r);else if("tour"===r.actionType)e.startProductTourWithConfig(r.outbound,r.data,!1);else{if("survey_page"===wv.getInstance().appMode)continue;e.showSurvey(r.actionType,{format:r.format,resume:!0===r.resume,resumeData:!0===r.resume?r.data:void 0,outboundAction:r._id||r.id})}}}}},{key:"setGlobalDataItem",value:function(e,t){this.globalData[e]=t}},{key:"getGlobalDataItem",value:function(e){return this.globalData[e]}},{key:"takeCurrentReplay",value:function(){var e=vs.getInstance().getReplayData(),t=e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0;this.setGlobalDataItem("webReplay",t?e:null)}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"setEnvironment",value:function(e){Uv.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){Uv.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){Uv.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){q=U(e)}(e)}},{key:"setTags",value:function(e){ib.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){wv.getInstance().setUrlHandler(e)}},{key:"setOfflineMode",value:function(e){this.getInstance().offlineMode=e}},{key:"setDisableInAppNotifications",value:function(e){var t=this.getInstance();t.disableInAppNotifications!==e&&(t.disableInAppNotifications=e,Zv.getInstance().renderNotifications())}},{key:"setDisablePageTracking",value:function(e){this.getInstance().disablePageTracking=e}},{key:"disableConsoleLogOverwrite",value:function(){up.getInstance().stop()}},{key:"setAiTools",value:function(e){wn.getInstance().setAgentTools(e),or.getInstance().sendAgentToolsUpdate(),wv.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){kh.getInstance().setExternalRequests(ee(e))}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";up.getInstance().addLog(e,t)}},{key:"initialize",value:function(t,n){var r=this.getInstance();if(r.initialized)console.warn("Gleap already initialized.");else{t&&"object"===Nb(t)?t=(n=t).projectId:!t&&n&&"object"===Nb(n)&&n.projectId&&(t=n.projectId),n&&"object"===Nb(n)&&"sessionDuration"in n&&Bm.getInstance().setSessionDuration(n.sessionDuration),r.initialized=!0;try{vs.getInstance().startIfNotRunning()}catch(i){}try{!function(){try{var e=function(){try{var e=document.querySelector(".gleap-frame-container-inner iframe");if(!e)return;r(e);var t=window.visualViewport,n=l(window.innerHeight)-l(t.height);!d&&n>=a?(e.style.setProperty("max-height",t.height+"px","important"),e.style.setProperty("transform","translateY("+t.offsetTop+"px)","important")):(e.style.removeProperty("max-height"),e.style.removeProperty("transform"))}catch(i){}},t=function(){try{window.setTimeout((function(){try{var e=p&&p.activeElement;if(e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable))return;d=!0;var t=document.querySelector(".gleap-frame-container-inner iframe");t&&(t.style.removeProperty("max-height"),t.style.removeProperty("transform")),o()}catch(n){}}),100)}catch(i){}},n=function(){d=!1,o()},r=function(e){try{var r=e.contentDocument;if(!r||r===p)return;p=r,r.addEventListener("focusout",t,!0),r.addEventListener("focusin",n,!0)}catch(i){}},o=function(){try{u||(u=!0,window.requestAnimationFrame((function(){u=!1,e()}))),c&&clearTimeout(c),c=setTimeout(e,s)}catch(i){}};if(!("visualViewport"in window)||!window.visualViewport||!/iPad|iPhone|iPod/.test(navigator.userAgent))return;if(pe)return;pe=!0;var a=150,s=350,l=function(e){return Math.round(e)},c=null,u=!1,d=!1,p=null,h=window.visualViewport;h.addEventListener("resize",o),h.addEventListener("scroll",o),window.addEventListener("orientationchange",(function(){try{o()}catch(i){}})),e()}catch(i){}}()}catch(i){}var o=Bm.getInstance();o.sdkKey=t,o.setOnSessionReady((function(){setTimeout((function(){Rd.getInstance().start().then((function(){Ky.getInstance().start(),de((function(){R.getInstance().injectFeedbackButton(),Zv.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams();try{ad.getInstance().resumeFromStorage()}catch(t){}dn.notifyEvent("initialized")}))})).catch((function(e){console.warn("Failed to initialize Gleap.")}))}),0)})),o.startSession()}}},{key:"openURL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];wv.getInstance().urlHandler(e,t)}},{key:"disableQueryParams",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.getInstance().disableQueryParams=e}},{key:"checkForUrlParams",value:function(){if(this.getInstance().disableQueryParams)console.log("Query params are disabled.");else if("undefined"!=typeof window&&window.location.search)try{var t=new URLSearchParams(window.location.search),n=t.get("gleap_widget");n&&n.length>0&&e.open();var r=t.get("gleap_conversation");r&&r.length>0&&("true"===r?e.startConversation(!0):e.startBot(r,!0));var o=t.get("gleap_feedback");o&&o.length>0&&e.startFeedbackFlow(o);var i,a=t.get("gleap_survey"),s=t.get("gleap_survey_format");if(a&&a.length>0){var l="survey_full"===s||"full"===s;e.showSurvey(a,l?"survey_full":"survey")}t.get(bb)&&Mb({color:null===(i=Rd.getInstance().getFlowConfig())||void 0===i?void 0:i.color});var c=t.get("gleap_tour");if(c&&c.length>0){var u=parseInt(t.get("gleap_tour_delay"));isNaN(u)&&(u=2),setTimeout((function(){e.startProductTour(c)}),1e3*u)}}catch(d){}}},{key:"destroy",value:function(){try{ad.getInstance().destroy()}catch(e){}vs.getInstance().stop(),Ky.getInstance().stop(),wv.getInstance().destroy(),R.getInstance().destroy(),Zv.getInstance().clearAllNotifications(!0),eb.getInstance().stop(),or.getInstance().destroy(),Bm.getInstance().clearSession(0,!1),Pr.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){Pr.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){$v.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=or.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=or.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{or.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){or.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){or.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){Bm.getInstance().setUseCookies(e)}},{key:"disableLocalStorage",value:function(){Bm.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return Bm.getInstance().identifySession(e,ne(ee(t)),n)}},{key:"setUserJwt",value:function(e){return Bm.getInstance().setUserJwt(e)}},{key:"setSessionDuration",value:function(e){Bm.getInstance().setSessionDuration(e)}},{key:"setUserJwtProvider",value:function(e){Bm.getInstance().setUserJwtProvider(e)}},{key:"setAuthTokens",value:function(e){return Bm.getInstance().setAuthTokens(e)}},{key:"updateContact",value:function(e){return Bm.getInstance().updateSession(ne(ee(e)))}},{key:"clearIdentity",value:function(){Bm.getInstance().clearSession()}},{key:"getIdentity",value:function(){return _b(_b({},Bm.getInstance().getSession()),{},{grant:Bm.getInstance().grant||null})}},{key:"isUserIdentified",value:function(){var e=Bm.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return wv.getInstance().isOpened()}},{key:"hide",value:function(){wv.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){kh.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){kh.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){kh.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){kh.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){vs.getInstance().setOptions(e)}},{key:"setCaptureEnabled",value:function(e){ad.getInstance().setCaptureEnabled(e)}},{key:"setRemoteLogCollectionEnabled",value:function(e){ad.getInstance().setRemoteLogCollectionEnabled(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];wv.getInstance().hideWidget(e)}},{key:"open",value:function(){wv.getInstance().setAppMode("widget"),wv.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Ky.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Ky.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=ee(e);ry.getInstance().formPreFill=t,wv.getInstance().sendMessage({name:"prefill-form-data",data:t},!0)}},{key:"on",value:function(e,t){dn.on(e,t)}},{key:"enableShortcuts",value:function(e){e?Uy.getInstance().start():Uy.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){R.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){Uv.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){Uv.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){Bm.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return Bm.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){Bm.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){Bm.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){Bm.getInstance().apiUrl=e,kh.getInstance().setSdkApiUrl(e)}},{key:"setBannerUrl",value:function(e){Pr.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){$v.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){an(e)}},{key:"setFrameUrl",value:function(e){wv.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){xp.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){xp.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){xp.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){xp.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){xp.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){xp.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){xp.getInstance().clearCustomData()}},{key:"playSound",value:function(e){cr.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=Zv.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){ub.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){var n,r;e.getInstance().softReInitialize(),null===(n=e.updateContact({lang:t}))||void 0===n||null===(r=n.catch)||void 0===r||r.call(n,(function(){}))}),1e3)}},{key:"registerAgentToolAction",value:function(e){wn.getInstance().registerAgentToolAction(e)}},{key:"registerAgentTool",value:function(e,t){wn.getInstance().registerAgentTool(e,t)}},{key:"registerCustomAction",value:function(e){vp.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){vp.triggerCustomAction(e)}},{key:"setColorScheme",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Jn.getInstance().setColorScheme(e,t)}},{key:"setStyles",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#ffffff",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:20,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:20,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:R.FEEDBACK_BUTTON_BOTTOM_LEFT,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:void 0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0;de((function(){!function(e,t,n,r,o,i,a,s,l,c){var u=me(e),d=me(n),p=me(o),h="#ffffff"===p,f=l||t,g=c||t,m=ge(o,h?100:-120),v=ge(o,h?30:-12),y=ge(o,h?80:-30),b=h?o:"#fff",w=h?p:"#2d2d2d",k=(r=parseInt(r,10),Math.round(1.05*r)),x=Math.round(.8*r),S=Math.round(.4*r),C=Math.round(.25*r),E=Math.max(2,Math.round(.55*r)),I=Math.max(2,Math.round(20*E/32)),D=57+a;s===R.FEEDBACK_BUTTON_CLASSIC_BOTTOM?D=a+15:(s&&s.includes("CLASSIC")||s===R.FEEDBACK_BUTTON_NONE)&&(D=a);var A='\n .gleap-font, .gleap-font * {\n font-style: normal;\n font-variant-caps: normal;\n font-variant-ligatures: normal;\n font-variant-numeric: normal;\n font-variant-east-asian: normal;\n font-weight: normal;\n font-stretch: normal;\n font-size: 100%;\n line-height: 1;\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n }\n .gleap-ai-ui-widget {\n display: none;\n }\n .gleap-input-highlight {\n box-shadow: 0 0 0 3px '.concat(e," !important;\n }\n .gleap-frame-container {\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n width: calc(100% - 40px);\n max-width: 410px;\n position: fixed;\n z-index: ").concat(2147483631,";\n visibility: visible;\n box-shadow: 0px 5px 40px 0px rgba(9, 14, 21, 0.16);\n border-radius: ").concat(1.5*x,"px;\n overflow: hidden;\n transform-origin: right bottom;\n animation: gleapWidgetScale 0.3s cubic-bezier(0, 1.2, 1, 1) both, gleapWidgetFade 0.12s ease-out both;\n user-select: none;\n pointer-events: none;\n transition: max-width 0.3s ease-out;\n }\n\n .gleap-admin-highlight {\n box-shadow: 0px 0px 0px 4px red;\n }\n\n :root {\n --gleap-margin-top: 50px;\n }\n\n .gleap-tooltip-anchor {\n position: absolute;\n display: block;\n width: 0px;\n height: 0px;\n margin: 0px;\n padding: 0px;\n overflow: visible;\n }\n\n .gleap-tooltip-hotspot {\n position: absolute;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n }\n\n @keyframes gleap-pulse {\n 0% {\n transform: scale(0);\n opacity: 0.25;\n }\n 45% {\n transform: scale(2.5);\n opacity: 0;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n }\n\n .gleap-tooltip-hotspot-animation {\n position: absolute;\n border-radius: 17px;\n opacity: 0.25;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n animation: gleap-pulse 5s infinite;\n }\n\n .gleap-tooltip-hotspot svg {\n width: 17px;\n height: 17px;\n object-fit: contain;\n display: block;\n }\n\n .gleap-tooltip-inner {\n position: relative;\n overflow: visible;\n font-size: 14px;\n font-weight: normal;\n color: #000;\n line-height: 1.3;\n }\n\n .gleap-tooltip {\n position: absolute;\n background-color: #fff;\n color: #000;\n font-size: 15px;\n line-height: 18px;\n padding: 16px;\n padding-top: 8px;\n padding-bottom: 8px;\n border-radius: 4px;\n max-width: min(350px, 80vw);\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s, visibility 0.2s;\n z-index: ").concat(2147483700,";\n }\n\n .gleap-tooltip a {\n color: ").concat(e,";\n text-decoration: underline;\n display: inline !important;\n margin: 0px !important;\n padding: 0px !important;\n word-break: break-word;\n }\n\n .gleap-tooltip ul {\n padding-left: 16px;\n }\n\n .gleap-tooltip b {\n font-weight: 600;\n }\n\n .gleap-tooltip h2 {\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip h3 {\n font-size: 16px;\n line-height: 18px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip p {\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip img {\n max-width: 100%;\n max-height: 300px;\n width: 100%;\n height: auto;\n object-fit: cover;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip iframe,\n .gleap-tooltip video {\n max-width: 100%;\n width: 100%;\n height: auto;\n min-height: 200px;\n display: block;\n border: none;\n outline: none;\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip-arrow {\n position: absolute;\n width: 20px;\n height: 20px;\n }\n\n .gleap-tooltip-arrow svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n\n .gleap-b-frame {\n width: 100%;\n height: 100%;\n border: none;\n pointer-events: auto;\n padding: 0px;\n margin: 0px;\n }\n\n .gleap-b-shown {\n transition: margin 0.3s ease-out;\n margin-top: var(--gleap-margin-top);\n position: relative;\n z-index: 10000;\n }\n\n .gleap-b-f {\n margin-top: 0px;\n }\n\n .gleap-b-shown.gleap-b-clip {\n transition: padding 0.3s ease-out;\n margin-top: 0px;\n padding-top: calc(var(--gleap-margin-top) + var(--gleap-b-body-padding-top, 0px));\n }\n\n .gleap-b-clip .gleap-b {\n top: 0px;\n }\n\n .gleap-b {\n display: none;\n position: absolute;\n top: calc(-1 * var(--gleap-margin-top));\n left: 0px;\n width: 100vw;\n height: var(--gleap-margin-top);\n z-index: ").concat(2147483699,";\n }\n\n @keyframes gleapSlideIn {\n from {\n top: calc(-1 * var(--gleap-margin-top));\n }\n to {\n top: 10px;\n }\n }\n\n .gleap-b-f .gleap-b {\n position: fixed;\n top: 10px;\n animation: gleapSlideIn .25s ease-out forwards;\n max-width: 800px;\n width: calc(100% - 20px);\n left: 50%;\n z-index: ").concat(2147483699,";\n transform: translateX(-50%);\n border-radius: ").concat(S,"px;\n overflow: hidden;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.15), 0px 5px 5px rgba(0, 0, 0, 0.05);\n }\n\n .gleap-b-shown .gleap-b {\n display: block;\n }\n\n .gleap-image-view {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n z-index: ").concat(2147483699,";\n background-color: ").concat(p,"cc;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-image-view-image {\n width: 90%;\n height: auto;\n max-width: 90%;\n max-height: 90%;\n object-fit: contain;\n }\n\n .gleap-image-view-close {\n position: fixed;\n top: 20px;\n right: 20px;\n width: 32px;\n height: 32px;\n opacity: 0.8;\n z-index: ").concat(2147483740,";\n box-shadow: 0px 5px 18px rgba(0, 0, 0, 0.16);\n cursor: pointer;\n }\n\n .gleap-image-view-close:hover {\n opacity: 1;\n }\n\n .gleap-image-view-close svg path {\n fill: ").concat(o,";\n }\n\n [dir=rtl].gleap-frame-container {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container iframe {\n transition: opacity 0.3s ease;\n }\n\n .gleap-frame-container--loading iframe {\n opacity: 0;\n transition: none;\n }\n\n .gleap-frame-loader {\n visibility: hidden;\n opacity: 0;\n transition: opacity 0.3s ease, visibility 0s linear 0.35s;\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n overflow: hidden;\n background-color: ").concat(o,";\n pointer-events: none;\n }\n\n .gleap-frame-container--loading .gleap-frame-loader {\n visibility: visible;\n opacity: 1;\n transition: none;\n }\n\n .gleap-frame-loader svg {\n display: block;\n width: 100%;\n height: auto;\n }\n\n .gleap-frame-loader .gleap-bg-base {\n fill: ").concat(o,";\n }\n\n .gleap-frame-loader .gleap-bg-c1 {\n fill: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-c2 {\n fill: ").concat(f,";\n }\n\n .gleap-frame-loader .gleap-bg-c3 {\n fill: ").concat(g,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-1 {\n stop-color: ").concat(f,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-2 {\n stop-color: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-fade {\n stop-color: ").concat(o,";\n }\n\n @keyframes gleapBgGrowShrink2 {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.35);\n }\n }\n\n @keyframes gleapBgGrowShrink3 {\n 0%, 100% {\n transform: scale(1) rotate(0deg);\n }\n 50% {\n transform: scale(1.3) rotate(20deg);\n }\n }\n\n .gleap-frame-loader--animate .gleap-bg-c2 {\n animation: gleapBgGrowShrink2 7s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader--animate .gleap-bg-c3 {\n animation: gleapBgGrowShrink3 6s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader-blur {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n -webkit-backdrop-filter: blur(30px);\n backdrop-filter: blur(30px);\n }\n\n .gleap-frame-loader--image {\n background-color: #ffffff;\n }\n\n .gleap-frame-loader-image-wrap {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0;\n transition: opacity 0.25s ease-in;\n }\n\n .gleap-frame-loader--dockedbar .gleap-frame-loader-image-wrap {\n bottom: 80px;\n }\n\n /* v4 header block: top-anchored, height driven by the strut child + the\n header's 150px padding-bottom \u2014 mirrors .agent-home-v4-header so the\n brand surface is exactly as tall as the app's, at any width/wrap. */\n .gleap-frame-loader-header {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n padding-bottom: 150px;\n overflow: hidden;\n }\n\n .gleap-frame-loader-header--colour {\n background: linear-gradient(\n 180deg,\n ").concat(t," 0%,\n ").concat(f,' 100%\n );\n }\n\n /* Strut: invisible height driver replicating the header\'s content box. */\n .gleap-frame-loader-strut {\n position: relative;\n z-index: 1;\n visibility: hidden;\n /* Match the messenger\'s font stack EXACTLY (and reset any inherited host\n font metrics), so the title wraps to the same number of lines the app\n will \u2014 the whole point of the strut is a 1:1 height, and a different\n host font would wrap differently and break it. */\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n font-style: normal;\n letter-spacing: normal;\n text-transform: none;\n box-sizing: border-box;\n }\n\n .gleap-frame-loader-strut-bar {\n height: 96px;\n }\n\n .gleap-frame-loader-strut-greeting {\n padding: 54px 38px 0px;\n box-sizing: border-box;\n }\n\n .gleap-frame-loader-strut-kicker {\n font-size: 25px;\n line-height: 25px;\n font-weight: normal;\n margin: 0px 0px 4px;\n }\n\n .gleap-frame-loader-strut-title {\n font-size: 25px;\n line-height: 29.5px;\n font-weight: 600;\n margin: 0px;\n }\n\n .gleap-frame-loader-ramp {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n /* 1px overlap past the block\'s bottom edge so fractional-DPR rounding\n can\'t let the image/gradient shimmer through as a hairline \u2014 same\n trick as the Messenger-App\'s header overlay. */\n bottom: -1px;\n background: linear-gradient(\n 180deg,\n transparent calc(100% - 120px),\n ').concat(o,"38 calc(100% - 101px),\n ").concat(o,"73 calc(100% - 82px),\n ").concat(o,"A6 calc(100% - 65px),\n ").concat(o,"D6 calc(100% - 49px),\n ").concat(o," calc(100% - 35px)\n );\n }\n\n .gleap-frame-loader-ramp--image {\n /* Smootherstep whitening ramp \u2014 must stay stop-for-stop identical to the\n Messenger-App's image header overlay (AgentHomeV4.scss), or the fade\n visibly shifts during the loader\u2192app cross-fade. */\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0.2) 0px,\n rgba(0, 0, 0, 0) 60px,\n transparent calc(100% - 90px),\n ").concat(o,"03 calc(100% - 83px),\n ").concat(o,"0F calc(100% - 76px),\n ").concat(o,"29 calc(100% - 69px),\n ").concat(o,"52 calc(100% - 62px),\n ").concat(o,"80 calc(100% - 55px),\n ").concat(o,"AD calc(100% - 48px),\n ").concat(o,"D6 calc(100% - 41px),\n ").concat(o,"F0 calc(100% - 34px),\n ").concat(o,"FC calc(100% - 27px),\n ").concat(o," calc(100% - 20px)\n );\n }\n\n .gleap-frame-loader-image-wrap--loaded {\n opacity: 1;\n }\n\n .gleap-frame-loader-image {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n /* Surveys 2.0 \u2014 card: a compact popover in the launcher's corner. */\n .gleap-frame-container--survey {\n bottom: ").concat(a,"px !important;\n bottom: calc(").concat(a,"px + env(safe-area-inset-bottom, 0px)) !important;\n max-width: 348px;\n border-radius: 24px;\n box-shadow: 0 14px 44px rgba(16, 24, 40, 0.18), 0 0 0 1px rgba(16, 24, 40, 0.06);\n animation: gleapSurveyCardIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both, gleapWidgetFade 0.18s ease-out both;\n transition: none;\n }\n\n /* The survey's corners (survey-theme from the messenger); rounded is the 24px above. */\n .gleap-frame-container--survey.gleap-frame-container--corners-sharp {\n border-radius: 10px;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-pill {\n border-radius: 32px;\n }\n\n /* Card and page surveys stay invisible until the messenger reports their height. */\n .gleap-frame-container--measuring {\n visibility: hidden !important;\n animation: none !important;\n pointer-events: none !important;\n }\n\n .gleap-frame-container--extended {\n max-width: 690px !important;\n }\n\n /* Expanded by the end user (expand/collapse button in the messenger header).\n Only on viewports with room for it (see widgetExpandMinWidth). The inner\n max-height must beat the inline 700px set by GleapFrameManager.setAppMode. */\n @media only screen and (min-width: ").concat(768,"px) {\n .gleap-frame-container--expanded {\n max-width: 690px !important;\n }\n\n .gleap-frame-container--expanded .gleap-frame-container-inner {\n max-height: none !important;\n }\n }\n\n /* Surveys 2.0 \u2014 full screen: the frame covers the viewport and the messenger draws the\n brand-tinted, Typeform-style background and the close button itself. */\n .gleap-frame-container--survey-full,\n [dir=rtl].gleap-frame-container--survey-full {\n position: fixed;\n top: 0 !important;\n left: 0 !important;\n bottom: 0 !important;\n right: 0 !important;\n width: 100% !important;\n max-width: none !important;\n height: 100vh;\n height: 100dvh !important;\n min-height: 0 !important;\n max-height: none !important;\n background-color: transparent;\n border-radius: 0 !important;\n box-shadow: none !important;\n transform: none;\n animation: gleapWidgetFade 0.28s ease-out both !important;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner {\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n border-radius: 0;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner:before {\n display: none;\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--closing {\n animation: gleapWidgetFadeOut 0.22s ease-in both !important;\n }\n\n /* Legacy surveys (the messenger fell back to the pre-2.0 flow): the old survey chrome. */\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy {\n max-width: 410px;\n border-radius: ").concat(1.5*x,"px;\n box-shadow: 0px 5px 40px 0px rgba(9, 14, 21, 0.16);\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy .gleap-frame-container-inner {\n width: calc(100% - 24px) !important;\n max-width: 640px !important;\n height: calc(100% - 40px) !important;\n border-radius: ").concat(x,"px;\n overflow: hidden;\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy .gleap-frame-container-inner:before {\n display: block;\n }\n\n /* Surveys 2.0 \u2014 page: an inline frame in the host's container, as tall as the survey. */\n .gleap-frame-container.gleap-frame-container--survey-page,\n [dir=rtl].gleap-frame-container.gleap-frame-container--survey-page {\n position: relative !important;\n top: auto !important;\n right: auto !important;\n bottom: auto !important;\n left: auto !important;\n width: 100% !important;\n max-width: none !important;\n height: auto !important;\n min-height: 0 !important;\n max-height: none !important;\n z-index: auto;\n box-shadow: none !important;\n border-radius: 0 !important;\n background-color: transparent;\n transform: none !important;\n animation: gleapWidgetFade 0.3s ease-out both !important;\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n width: 100% !important;\n height: 360px;\n max-height: none !important;\n }\n\n .gleap-frame-container--survey-page.gleap-frame-container--animate .gleap-frame-container-inner {\n transition: height 0.28s cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner:before,\n .gleap-frame-container--survey-page .gleap-frame-loader {\n display: none;\n }\n\n .gleap-frame-container--classic {\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--classic-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--modern-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n [dir=rtl].gleap-frame-container--modern-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container--animate {\n pointer-events: auto !important;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetOut 0.2s cubic-bezier(0.4, 0, 1, 1) both !important;\n pointer-events: none !important;\n }\n\n .gleap-frame-container--modern-left,\n .gleap-frame-container--classic-left {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container--modern-left,\n [dir=rtl].gleap-frame-container--classic-left {\n transform-origin: right bottom;\n }\n\n @keyframes gleapWidgetScale {\n from { transform: scale(0.9); }\n to { transform: scale(1); }\n }\n\n @keyframes gleapWidgetFade {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes gleapWidgetOut {\n from { opacity: 1; transform: scale(1); }\n to { opacity: 0; transform: scale(0.96); }\n }\n\n @keyframes gleapWidgetFadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n\n @keyframes gleapSurveyCardIn {\n from { transform: translateY(14px) scale(0.98); }\n to { transform: translateY(0) scale(1); }\n }\n\n @keyframes gleapWidgetSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n\n @keyframes gleapWidgetSlideDown {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(100%); }\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes gleapFadeInUpMobile {\n from {\n opacity: 0;\n transform: translate3d(0, 10%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .gleap-notification-container {\n position: fixed;\n bottom: ").concat(D,"px;\n right: ").concat(i,"px;\n z-index: ").concat(2147483630,";\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n width: 100%;\n max-width: min(340px, 80vw);\n }\n\n .gleap-notification-container--left {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container--left {\n left: initial !important;\n right: ").concat(i,"px !important;\n align-items: flex-start !important;\n }\n\n .gleap-notification-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n /* Every notification card shares one chrome: full container width, the same\n radius, the same soft shadow, and a lift on hover. */\n .gleap-notification-item,\n .gleap-notification-item-news,\n .gleap-notification-item-checklist {\n width: 100%;\n animation-duration: 0.45s;\n animation-fill-mode: both;\n animation-name: gleapNotificationIn;\n }\n\n .gleap-notification-item-container,\n .gleap-notification-item-news-container,\n .gleap-notification-item-checklist-container {\n width: 100%;\n box-sizing: border-box;\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n /* A drop shadow alone cannot separate a dark card from a dark page, so\n the card also carries a hairline in the direction the theme needs. */\n border: 1px solid ").concat(h?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.04)",";\n /* A barely-there contact shadow + a large, soft ambient throw. */\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 10px 30px rgba(0, 0, 0, 0.1);\n margin-bottom: 12px;\n cursor: pointer;\n transition: box-shadow 0.15s ease-out;\n }\n\n .gleap-notification-item-container:hover,\n .gleap-notification-item-news-container:hover,\n .gleap-notification-item-checklist-container:hover {\n box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.05), 0px 14px 38px rgba(0, 0, 0, 0.14);\n }\n\n @keyframes gleapNotificationIn {\n from {\n opacity: 0;\n transform: translate3d(0, 12px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n /* More than one notification collapses into a stack: the newest card in\n front, older ones peeking out behind its top edge like a deck. Hovering\n the stack (or tapping it on touch devices, which adds --expanded)\n spreads it back into the full list.\n\n Every stacked card is bottom-anchored and placed purely via translateY\n offsets that updateStackLayout() measures and writes as CSS vars, so\n collapsing and expanding is one smooth transform + height transition\n rather than a layout jump. */\n .gleap-notification-card {\n position: relative;\n }\n\n .gleap-notification-container--stack {\n height: var(--gleap-nstack-h-collapsed, auto);\n transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n .gleap-notification-container--stack:hover,\n .gleap-notification-container--stack.gleap-notification-container--expanded {\n height: var(--gleap-nstack-h-expanded, auto);\n }\n\n .gleap-notification-container--stack .gleap-notification-card {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n transform: translateY(var(--gleap-nstack-expand, 0px));\n transform-origin: top center;\n /* The negative inset keeps the box-shadow outside the clip region. */\n clip-path: inset(-40px);\n transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), clip-path 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-out;\n }\n\n /* The entrance animation's fill pins transform at translate3d(0,0,0),\n which would defeat the stack offsets \u2014 so only the front card animates\n in (its stack offsets are 0 anyway). */\n .gleap-notification-container--stack .gleap-notification-card:not(:last-child) {\n animation-name: none;\n }\n\n /* How far back a card scales at each peek depth when collapsed. */\n .gleap-notification-container--stack .gleap-notification-card:nth-last-child(2) {\n --gleap-nstack-scale: 0.955;\n }\n\n .gleap-notification-container--stack .gleap-notification-card:nth-last-child(n+3) {\n --gleap-nstack-scale: 0.91;\n }\n\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card {\n transform: translateY(var(--gleap-nstack-collapse, 0px)) scale(var(--gleap-nstack-scale, 1));\n /* Clips a taller card behind down to the front card's height (bottom\n inset measured by updateStackLayout), so e.g. a news cover can't hang\n out below the stack. */\n clip-path: inset(-40px -40px var(--gleap-nstack-clip, -40px) -40px);\n }\n\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card:not(:last-child) {\n pointer-events: none;\n }\n\n /* Anything deeper than two peeks hides entirely until the stack expands. */\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card:nth-last-child(n+4) {\n opacity: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .gleap-notification-container--stack,\n .gleap-notification-container--stack .gleap-notification-card {\n transition: none;\n }\n }\n\n /* Floats over the stack's top-right corner instead of taking a row of its\n own above it, so the notifications read as one contained unit. */\n .gleap-notification-close {\n position: absolute;\n top: -9px;\n right: -9px;\n border-radius: 100%;\n width: 26px;\n height: 26px;\n background-color: ").concat(o,";\n box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.18);\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n visibility: hidden;\n pointer-events: none;\n z-index: 1;\n }\n\n [dir=rtl].gleap-notification-container .gleap-notification-close {\n left: -9px;\n right: initial;\n }\n\n .gleap-notification-container:hover .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n }\n\n .gleap-notification-close svg {\n width: 40%;\n height: 40%;\n object-fit: contain;\n fill: ").concat(p,";\n }\n\n .gleap-notification-item-checklist-container {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 16px;\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-notification-item-checklist-content-title {\n color: ").concat(p,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 10px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content-progress {\n width: 100%;\n height: 8px;\n border-radius: 8px;\n background-color: ").concat(v,";\n }\n\n .gleap-notification-item-checklist-content-progress-inner {\n height: 100%;\n border-radius: 8px;\n background-color: ").concat(e,";\n }\n\n .gleap-notification-item-checklist-content-next {\n color: ").concat(m,";\n font-size: 15px;\n font-weight: normal;\n line-height: 21px;\n margin-top: 10px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n }\n\n .gleap-notification-item-checklist-content-next svg {\n height: 18px;\n margin-right: 5px;\n width: auto;\n }\n\n .gleap-notification-item-checklist-content-next b {\n font-size: 15px;\n font-weight: normal;\n color: ").concat(p,";\n }\n\n .gleap-news-pagination {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n width: 100%;\n }\n\n .gleap-news-page-indicator {\n font-size: 12px;\n color: ").concat(m,";\n }\n\n .gleap-news-next-button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 5px 10px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;^\n }\n\n .gleap-notification-item-news-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n padding: 16px;\n }\n\n .gleap-notification-item-news-preview {\n color: ").concat(m,";\n font-size: 14px;\n line-height: 21px;\n font-weight: 400;\n overflow-wrap: break-word;\n word-break: break-word;\n display: block;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-sender {\n display: flex;\n align-items: center;\n color: ").concat(m,";\n font-size: 14px;\n line-height: 21px;\n font-weight: 400;\n }\n\n .gleap-notification-item-news-content-title {\n color: ").concat(p,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 6px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n cursor: pointer;\n }\n\n .gleap-notification-item-news-sender-avatar {\n border-radius: 100%;\n height: 20px;\n width: 20px;\n min-width: 20px;\n margin-right: 8px;\n object-fit: cover;\n }\n\n [dir=rtl] .gleap-notification-item-news-sender-avatar {\n margin-left: 8px;\n margin-right: 0px !important;\n }\n\n .gleap-notification-item-news-container {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-image {\n background-color: ").concat(m,";\n height: 170px;\n max-height: 170px;\n object-fit: cover;\n width: 100%;\n cursor: pointer;\n }\n \n .gleap-notification-item-news-content-title:hover {\n color: ").concat(e,";\n }\n\n .gleap-notification-item-container {\n display: flex;\n align-items: flex-start;\n padding: 16px;\n font-size: 15px;\n line-height: 21px;\n color: ").concat(p,";\n }\n\n .gleap-notification-item-avatar {\n width: 32px;\n height: 32px;\n min-width: 32px;\n border-radius: 100%;\n object-fit: cover;\n display: block;\n margin-right: 10px;\n }\n\n /* The AI is a product, not a person \u2014 a rounded square reads as a logo and\n keeps it distinct from the circular teammate avatars. Same split the\n messenger makes in ChatMessageAuthor. */\n .gleap-notification-item-avatar--bot {\n border-radius: ").concat(E,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(I,"px;\n }\n\n [dir=rtl] .gleap-notification-item-avatar {\n margin-left: 10px;\n margin-right: 0px !important;\n }\n\n /* min-width: 0 so a long unbroken word shrinks the body instead of pushing\n the card past the container. */\n .gleap-notification-item-body {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n }\n\n .gleap-notification-item-content {\n line-height: 20px;\n color: ").concat(p,";\n word-wrap: break-word;\n word-break: break-word;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-meta {\n display: flex;\n align-items: center;\n margin-top: 5px;\n font-size: 13px;\n line-height: 18px;\n color: ").concat(m,";\n overflow: hidden;\n }\n\n .gleap-notification-item-sender {\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .gleap-notification-item-meta-dot {\n margin: 0px 5px;\n opacity: 0.6;\n }\n\n .gleap-notification-item-time {\n white-space: nowrap;\n }\n\n .gleap-frame-container-inner {\n position: relative;\n width: 100%;\n height: calc(100vh - ").concat(84+a,"px);\n max-height: ").concat(700,"px;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: calc(100vh - ").concat(a+24,"px);\n height: calc(100dvh - ").concat(a+24,"px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));\n }\n\n /* Behind the survey card the frame shows the survey's surface, not the widget background. */\n .gleap-frame-container--survey .gleap-frame-container-inner:before {\n background-color: var(--gleap-survey-surface, ").concat(o,");\n }\n\n /* The page frame takes the survey's color-scheme (the messenger sets the same on its document),\n so the browser keeps the iframe transparent on the host's backdrop, whatever the host's scheme. */\n .gleap-frame-container--survey-page {\n color-scheme: light;\n }\n\n .gleap-frame-container--survey-page.gleap-frame-container--survey-dark {\n color-scheme: dark;\n }\n\n /* Smooth resizes between questions (not on the first measure, which happens before --animate). */\n .gleap-frame-container--survey.gleap-frame-container--animate .gleap-frame-container-inner {\n transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1);\n }\n \n .gleap-frame-container-inner:before {\n content: \" \";\n position: absolute;\n width: 100%;\n height: calc(100% - ").concat(x,"px);\n top: ").concat(x,"px;\n background-color: ").concat(o,";\n z-index: -1;\n }\n \n .gleap-frame-container iframe {\n height: 100% !important;\n width: 100% !important;\n max-width: 100% !important;\n display: block !important;\n pointer-events: auto !important;\n }\n \n .gleap-frame-container--hidden {\n display: none !important;\n pointer-events: none;\n animation: none !important;\n }\n\n /* Capture requests: hidden while the customer captures the page (the iframe stays alive), and\n the whole viewport while the Messenger's capture editor is open. */\n .gleap-frame-container--capture-hidden {\n visibility: hidden !important;\n pointer-events: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor {\n top: 0 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n width: 100vw !important;\n max-width: 100vw !important;\n height: 100vh !important;\n height: 100dvh !important;\n min-height: 0 !important;\n max-height: none !important;\n border-radius: 0 !important;\n transform: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor .gleap-frame-container-inner {\n width: 100% !important;\n height: 100% !important;\n max-height: none !important;\n }\n \n .bb-feedback-button {\n margin: 0px;\n position: fixed;\n bottom: ").concat(a,"px;\n right: ").concat(i,"px;\n border-radius: 30px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: transparent;\n color: #000000;\n z-index: ").concat(2147483630,";\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 0px;\n }\n\n @keyframes bbRedDotPulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 1;\n }\n }\n\n .bb-feedback-button--red-dot {\n position: absolute;\n top: 0px;\n right: 0px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #ff3b30;\n box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n z-index: ").concat(2147483631,";\n animation: bbRedDotPulse 2s ease-in-out infinite;\n }\n\n [dir=rtl].bb-feedback-button {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n \n .bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n\n [dir=rtl].bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: ").concat(i,"px;\n left: auto;\n }\n \n .bb-feedback-button:focus {\n outline: none;\n }\n\n .bb-feedback-button:focus-visible .bb-feedback-button-icon,\n .bb-feedback-button:focus-visible .bb-feedback-button-classic {\n outline: 2px solid ").concat(n,';\n outline-offset: 3px;\n }\n\n .bb-feedback-button--disabled {\n display: none !important;\n }\n\n .bb-feedback-button--hidden {\n display: none !important;\n }\n\n /* A survey takes the launcher\'s corner: the launcher steps aside while it is open (a pill or\n sharp card would otherwise show the launcher peeking out behind its corner). */\n .bb-feedback-button--open.bb-feedback-button--survey {\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n transition: opacity 0.15s ease, visibility 0s linear 0.15s;\n }\n \n .bb-feedback-button-text {\n padding: 8px 12px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n background-color: #fff;\n border-radius: 8px;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.15);\n position: relative;\n z-index: 99;\n }\n \n .bb-feedback-button-text:before {\n content: "";\n position: absolute;\n box-shadow: rgba(0, 0, 0, 0.04) 6px 6px 5px;\n transform: rotate(315deg);\n bottom: 16px;\n right: -4px;\n border-width: 10px;\n border-style: solid;\n border-color: transparent #fff #fff transparent;\n }\n \n .bb-feedback-button--bottomleft .bb-feedback-button-text:before {\n display: none;\n }\n \n .bb-feedback-button-text:after {\n content: "";\n position: absolute;\n bottom: 12px;\n right: 0px;\n background-color: #fff;\n width: 5px;\n height: 30px;\n }\n \n .bb-feedback-button-text-title {\n font-family: sans-serif;\n font-size: 14px;\n color: #666;\n line-height: 18px;\n max-width: 220px;\n }\n \n .bb-feedback-button-text-title b {\n color: #000000;\n font-weight: 600;\n }\n\n .bb-notification-bubble {\n position: absolute;\n top: -5px;\n right: -5px;\n min-width: 12px;\n padding: 0px 4px;\n height: 20px;\n min-width: 20px;\n border-radius: 20px;\n background-color: red;\n color: #fff;\n font-size: 11px;\n font-family: sans-serif;\n text-align: center;\n line-height: 20px;\n }\n\n .bb-notification-bubble--hidden {\n display: none;\n }\n \n .bb-feedback-button-icon {\n width: 48px;\n height: 48px;\n border-radius: 48px;\n background-color: #485bff;\n transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n position: relative;\n }\n \n .bb-feedback-button-classic {\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n top: 50%;\n right: 0px;\n position: fixed;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n padding: 9px 20px;\n text-align: center;\n background-color: #485bff;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n font-family: sans-serif;\n font-size: 16px;\n color: #fff;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.25);\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n \n .bb-feedback-button-classic--left {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--left {\n top: 50%;\n right: 0px;\n left: auto;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n }\n \n .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n right: ').concat(i,"px;\n left: auto;\n }\n \n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n left: ").concat(i,"px;\n right: auto;\n }\n\n .bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n \n .bb-feedback-button--open.bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeOutRight;\n }\n \n .bb-feedback-button .bb-logo-logo {\n position: absolute;\n width: 30px;\n height: 30px;\n top: 9px;\n left: 9px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n position: absolute;\n width: 14px;\n height: 14px;\n top: 17px;\n left: 17px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button--open .bb-logo-arrowdown {\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button--open .bb-logo-logo {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button-icon:hover {\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), 0px 0px 20px rgba(0, 0, 0, 0.2);\n transform: scale(1.1);\n }\n\n /* The overshoot curve lives in its own class (added only for the release)\n so plain hover in/out keeps its regular ease and never bounces. */\n .bb-feedback-button--springing .bb-feedback-button-icon {\n transition: transform 0.55s cubic-bezier(0.2, 2, 0.45, 1), box-shadow 0.2s ease-in-out;\n }\n\n .bb-feedback-button--pressed .bb-feedback-button-icon {\n transform: scale(0.875);\n transition: transform 0.11s cubic-bezier(0.2, 0, 0.4, 1), box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), 0px 0px 12px rgba(0, 0, 0, 0.1);\n }\n \n .bb-feedback-button--open .bb-feedback-button-text {\n animation-name: bbFadeOutDown;\n }\n \n .bb-feedback-button--open .bb-feedback-button-icon {\n display: flex;\n }\n \n .bb-capture-svg {\n position: fixed;\n z-index: ").concat(2147483614,";\n top: 0px;\n left: 0px;\n right: 0px;\n width: 100%;\n height: 100%;\n padding: 0px;\n margin: 0px;\n cursor: crosshair;\n }\n\n .bb-capture-svg--preview {\n cursor: auto !important;\n }\n \n .bb-rec-on-circle {\n animation-name: bbRecIconFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-rec-on-cont {\n animation-name: bbRecIconContFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-capture-editor-drag-info {\n position: fixed;\n top: -200px;\n left: 0px;\n z-index: ").concat(2147483616,";\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-editor-drag-info svg {\n width: 24px;\n height: 24px;\n }\n \n .bb-capture-editor-borderlayer {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n border: 4px solid ").concat(e,";\n cursor: crosshair;\n z-index: ").concat(2147483610,";\n box-sizing: border-box;\n pointer-events: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-borderlayer {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n .bb-capture-editor-recording .bb-capture-editor-borderlayer {\n border: 4px solid #eb144c !important;\n }\n \n .bb-capture-editor-recording .bb-capture-dismiss {\n display: none;\n }\n\n .bb-capture-editor--capturing .bb-capture-toolbar,\n .bb-capture-editor--capturing .bb-capture-toolbar-item-colorpicker,\n .bb-capture-editor--capturing .bb-capture-dismiss,\n .bb-capture-editor--capturing .bb-capture-editor-drag-info,\n .bb-capture-editor--capturing .bb-capture-editor-borderlayer {\n display: none !important;\n }\n \n .bb-capture-editor-item-inactive {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-toolbar-drawingitem {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-svg {\n pointer-events: none !important;\n }\n \n .bb-capture-toolbar {\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,";\n background-color: #fff;\n padding: 5px;\n display: flex;\n align-items: center;\n border-radius: 8px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-dismiss {\n position: fixed;\n top: 0px;\n right: 0px;\n z-index: ").concat(2147483618,";\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n width: 36px;\n height: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: ").concat(e,";\n border-bottom-left-radius: ").concat(C,"px;\n }\n\n [dir=rtl] .bb-capture-dismiss {\n top: 0px;\n left: 0px;\n right: auto;\n border-bottom-left-radius: 0px !important;\n border-bottom-right-radius: ").concat(C,"px;\n }\n \n .bb-capture-dismiss svg path {\n fill: ").concat(u,';\n }\n \n .bb-capture-dismiss svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n \n .bb-capture-button-next {\n font-family: sans-serif;\n box-sizing: border-box;\n font-weight: 600;\n text-align: center;\n width: auto;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n margin: 0px;\n line-height: 36px;\n padding: 0px 12px;\n font-size: 15px;\n margin-left: 12px;\n }\n\n [dir=rtl].bb-capture-editor .bb-capture-button-next {\n margin-left: auto;\n margin-right: 12px;\n }\n \n .bb-capture-toolbar-item-spacer {\n width: 1px;\n height: 38px;\n min-width: 1px;\n margin: 0px 5px;\n }\n \n .bb-capture-toolbar-item {\n width: 42px;\n height: 38px;\n min-width: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n position: relative;\n margin-right: 5px;\n }\n\n .drag-handle-item {\n cursor: grab !important;\n width: 34px;\n min-width: 34px;\n }\n\n .drag-handle-item svg {\n width: 18px !important;\n height: 18px !important;\n }\n \n .bb-capture-toolbar-item svg {\n width: 23px;\n height: 23px;\n object-fit: contain;\n }\n \n .bb-capture-toolbar-item-selectedcolor {\n border-radius: 100%;\n width: 20px;\n height: 20px;\n background-color: #db4035;\n }\n \n .bb-capture-toolbar-item[data-type="undo"] svg {\n width: 18px;\n height: 18px;\n }\n \n .bb-capture-toolbar-item[data-active="true"] {\n position: relative;\n }\n \n .bb-capture-preview {\n display: none;\n background-color: rgba(0, 0, 0, 0.6);\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n justify-content: center;\n align-items: center;\n z-index: ').concat(2147483620,";\n }\n \n .bb-capture-preview-inner {\n background-color: #fff;\n padding: 0px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n flex-direction: column;\n max-width: 640px;\n width: 100%;\n margin: 20px;\n }\n \n .bb-capture-preview-inner video {\n border-radius: 8px 8px 0px 0px;\n display: block;\n border: 0px;\n outline: none;\n width: 100%;\n max-height: 60vh;\n }\n \n .bb-capture-preview-buttons {\n display: flex;\n justify-content: space-between;\n padding: 14px;\n }\n \n .bb-capture-preview-retrybutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-sendbutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-retrybutton:hover,\n .bb-capture-preview-sendbutton:hover {\n opacity: 0.9;\n }\n \n .bb-capture-toolbar-item-recording {\n margin-right: 0px;\n }\n \n .bb-capture-toolbar-item-recording svg {\n width: 33px;\n height: 33px;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n position: fixed;\n top: 70px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,';\n background-color: #fff;\n display: none;\n padding: 10px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n }\n \n .bb-capture-toolbar-item-color {\n width: 20px;\n height: 20px;\n border-radius: 100%;\n margin-right: 12px;\n box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-toolbar-item-color:hover {\n box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.25);\n }\n \n .bb-capture-toolbar-item-color:last-of-type {\n margin-right: 0px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color {\n margin-right: auto;\n margin-left: 12px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color:last-of-type {\n margin-right: auto;\n margin-left: 0px;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:first-of-type {\n display: none;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:nth-of-type(2) {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:first-of-type {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:nth-of-type(2) {\n display: none;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #eee;\n }\n \n .bb-capture-toolbar-item:hover svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #f8f8f8;\n }\n \n .bb-capture-toolbar-item--active svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--inactivecross::before {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 3px;\n width: 26px;\n margin: auto;\n border-radius: 4px;\n background-color: #e80000;\n transform: rotate(45deg);\n }\n \n .bb-capture-toolbar-item--inactivecross svg {\n fill: #eee;\n }\n \n .bb-capture-toolbar-item-timer {\n text-align: left;\n line-height: 32px;\n font-size: 14px;\n font-family: sans-serif;\n margin: 5px;\n min-width: 40px;\n display: none;\n }\n \n .bb-capture-toolbar-item .bb-tooltip {\n background-color: #555;\n color: #fff;\n visibility: hidden;\n font-size: 14px;\n font-family: sans-serif;\n text-align: center;\n padding: 5px 10px;\n position: absolute;\n z-index: 1;\n top: 45px;\n left: 0px;\n transform: translateX(calc(-50% + 21px));\n opacity: 0;\n transition: opacity 0.3s;\n white-space: nowrap;\n }\n \n .bb-capture-toolbar-item .bb-tooltip::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 50%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n transform: rotate(180deg);\n border-color: #555 transparent transparent transparent;\n }\n \n .bb-capture-toolbar-item:hover .bb-tooltip {\n visibility: visible;\n opacity: 1;\n }\n \n .bb-capture-options {\n display: none;\n }\n \n .bb-capture-options--active {\n display: flex;\n }\n\n @keyframes bbFadeOutRight {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbFadeOutDown {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n }\n \n @keyframes bbFadeInOpacity {\n from {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n @keyframes bbZoomOut {\n from {\n opacity: 1;\n }\n \n 50% {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbZoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n 50% {\n opacity: 1;\n }\n }\n \n @keyframes bbRecIconContFade {\n 0% {\n fill: #b10802;\n }\n 50% {\n fill: #ff0000;\n }\n 100% {\n fill: #b10802;\n }\n } \n .bb-capture-preview-retrybutton {\n color: ').concat(p,";\n border-radius: ").concat(k,"px;\n background-color: ").concat(v,";\n }\n .bb-capture-preview-retrybutton:hover {\n background-color: ").concat(y,";\n }\n @keyframes bb-suc-fill {\n 100% {\n box-shadow: inset 0px 0px 0px 30px ").concat(e,";\n }\n }\n .bb-capture-toolbar-item-spacer {\n background-color: ").concat(v,";\n }\n .bb-tooltip {\n border-radius: ").concat(S,"px;\n }\n @keyframes bbRecIconFade {\n 0% {\n fill: transparent;\n }\n 50% {\n fill: ").concat(y,";\n }\n 100% {\n fill: transparent;\n }\n }\n .bb-capture-preview-sendbutton {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(k,"px;\n }\n .bb-capture-button-next {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(C,"px;\n }\n .bb-capture-preview-inner {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-timer {\n color: ").concat(m,";\n }\n .bb-svg-path {\n fill: ").concat(p,";\n }\n .bb-capture-toolbar-item {\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-colorpicker {\n background-color: ").concat(o,";\n }\n .bb-capture-toolbar-item--active {\n background-color: ").concat(v,";\n }\n .bb-feedback-button-classic {\n border-top-left-radius: ").concat(S,"px;\n border-top-right-radius: ").concat(S,"px;\n }\n .bb-logo-logo--default path {\n fill: ").concat(d,";\n }\n .bb-logo-arrowdown {\n fill: ").concat(d,";\n }\n .bb-feedback-button-icon {\n background-color: ").concat(n,";\n }\n .bb-feedback-button-classic {\n background-color: ").concat(n,";\n color: ").concat(d,";\n }\n\n @media only screen and (max-width: 450px) {\n [dir=rtl].gleap-frame-container,\n .gleap-frame-container {\n left: 0px;\n right: 0px;\n width: 100vw;\n max-width: 100vw;\n min-height: 100vh;\n max-height: 100vh;\n min-height: 100dvh !important;\n max-height: 100dvh !important;\n top: 0px;\n bottom: 0px;\n border-radius: 0px;\n transform-origin: center bottom;\n animation: gleapWidgetSlideUp 0.34s cubic-bezier(0.16, 1, 0.3, 1) both, gleapWidgetFade 0.15s ease-out both;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetSlideDown 0.26s cubic-bezier(0.4, 0, 1, 1) both !important;\n }\n\n .gleap-frame-container-inner {\n width: 100vw;\n height: 100%;\n }\n\n .gleap-frame-container:not(.gleap-frame-container--survey):not(.gleap-frame-container--survey-full):not(.gleap-frame-container--survey-page) .gleap-frame-container-inner {\n max-height: calc(var(--glvh, 1vh) * 100) !important;\n }\n\n /* Card surveys become a floating sheet (iOS 26 style): inset from the edges and above the\n home indicator, rounded on all corners, layered shadow, dimmed page behind. */\n .gleap-frame-container--survey,\n [dir=rtl].gleap-frame-container--survey {\n top: auto !important;\n bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;\n left: 8px !important;\n right: 8px !important;\n width: auto !important;\n max-width: none !important;\n height: auto !important;\n min-height: 0 !important;\n max-height: calc(100vh - 24px) !important;\n max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;\n box-sizing: border-box;\n padding-top: 15px;\n padding-bottom: 0;\n /* The survey's surface (survey-theme), so a dark survey has no light handle strip. */\n background-color: var(--gleap-survey-surface, ").concat(o,');\n border-radius: 32px 32px 40px 40px !important;\n overflow: hidden;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 100vmax rgba(10, 12, 16, 0.25);\n transform-origin: center bottom;\n transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n animation: gleapWidgetSlideUp 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) both, gleapWidgetFade 0.2s ease-out both;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-sharp {\n border-radius: 14px !important;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-pill {\n border-radius: 40px 40px 46px 46px !important;\n }\n\n .gleap-frame-container--survey:after {\n content: "";\n position: absolute;\n top: 8px;\n left: 50%;\n width: 36px;\n height: 5px;\n margin-left: -18px;\n border-radius: 5px;\n background-color: ').concat(h?"rgba(255, 255, 255, 0.28)":"rgba(16, 24, 40, 0.16)",";\n pointer-events: none;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-dark:after {\n background-color: rgba(255, 255, 255, 0.28);\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-light:after {\n background-color: rgba(16, 24, 40, 0.16);\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n width: 100% !important;\n height: calc(100vh - 39px) !important;\n height: calc(100dvh - 39px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n width: 100% !important;\n }\n\n /* Legacy card surveys: the old full-width panel at the bottom (no sheet chrome). */\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy,\n [dir=rtl].gleap-frame-container--survey.gleap-frame-container--survey-legacy {\n padding: 0;\n border-radius: 28px !important;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy:after {\n display: none;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy .gleap-frame-container-inner {\n height: calc(100vh - 12px) !important;\n height: calc(100dvh - 12px - env(safe-area-inset-top, 0px)) !important;\n }\n\n .bb-tooltip {\n display: none !important;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n top: 75px;\n }\n \n .bb-capture-button-next {\n margin-left: auto;\n }\n \n .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-toolbar {\n top: 15px;\n right: 15px;\n left: 15px;\n width: auto;\n transform: none;\n }\n\n .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-borderlayer {\n border-width: 4px;\n }\n }\n \n @media print {\n .bb-feedback-button {\n display: none !important;\n }\n \n .gleap-frame-container {\n display: none !important;\n }\n }\n\n .gleap-tour-sender {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n margin-bottom: 10px;\n }\n\n .gleap-tour-sender-image {\n width: 32px;\n height: 32px;\n border-radius: 32px;\n margin-right: 10px;\n background-size: cover;\n background-repeat: no-repeat;\n }\n\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: 550px;\n max-width: 550px;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: calc(100vw - 40px);\n max-width: calc(100vw - 40px);\n }\n }\n\n .gleap-tour-message,\n .gleap-tour-message p,\n .gleap-tour-message ul {\n color: ").concat(p,";\n }\n\n .gleap-tour-message h2 {\n font-weight: 600;\n font-size: 22px;\n }\n\n .gleap-tour-message h3 {\n font-weight: 600;\n font-size: 18px;\n }\n\n .gleap-tour-message p {\n line-height: 1.3;\n margin-bottom: 10px !important;\n margin-top: 10px !important;\n }\n\n .gleap-tour-message ul {\n line-height: 1.3;\n padding-left: 20px;\n margin-top: 10px !important;\n margin-bottom: 10px !important;\n }\n\n .gleap-tour-message {\n max-height: calc(80vh - 100px) !important;\n overflow-y: auto;\n min-width: 270px;\n }\n\n .gleap-tour-message::-webkit-scrollbar {\n width: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-track {\n border-radius: 0px;\n }\n \n .gleap-tour-message::-webkit-scrollbar-thumb {\n background: ").concat(y,"; \n border-radius: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-thumb:hover {\n background: ").concat(m,";\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-message {\n min-width: auto !important;\n }\n }\n\n .gleap-tour-message iframe {\n width: 100%;\n height: 300px;\n margin-top: 10px;\n margin-bottom: 10px;\n border: none;\n outline: none;\n display: block;\n }\n\n .gleap-tour-sender-name {\n font-size: 15px;\n }\n\n .gleap-tour-video {\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-tour-video-svg--fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0px !important;\n left: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n }\n\n .gleap-tour-video--playing .gleap-tour-video-playpause {\n opacity: 0;\n }\n \n .gleap-tour-video--playing:hover .gleap-tour-video-playpause {\n opacity: 1;\n }\n\n .gleap-tour-popover-video-pointer {\n padding: 0px !important;\n border-radius: 8px;\n position: relative;\n background-color: transparent !important;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer {\n position: absolute;\n top: 0px;\n left: 20px;\n right: 20px;\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer button {\n padding: 5px 12px;\n }\n\n .gleap-tour-popover-video-pointer.gleap-tour-popover-can-close .gleap-tour-popover-footer {\n right: 40px !important;\n }\n\n .gleap-tour-popover-video-pointer:hover .gleap-tour-popover-footer {\n opacity: 1;\n }\n\n .gleap-tour-popover-pointer.gleap-tour-popover-no-sender .gleap-tour-message {\n padding-right: 20px;\n }\n\n .gleap-tour-video video {\n width: 100%;\n max-width: 100%;\n height: auto;\n border: none;\n outline: none;\n display: block;\n border-radius: 8px;\n }\n\n .gleap-admin-collapse-ui {\n z-index: ").concat(2147483635,";\n cursor: pointer;\n position: fixed;\n bottom: 75px;\n right: 20px;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n background-color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;\n }\n\n .gleap-admin-collapse-ui svg {\n width: 20px;\n height: 14px;\n fill: #000 !important;\n }\n\n .gleap-admin-collapse-ui-active {\n bottom: 20px !important;\n }\n\n .gleap-admin-collapse-ui-active svg {\n transform: rotate(180deg);\n }\n\n .gleap-admin-frame-container-active {\n display: none !important;\n }\n\n .gleap-admin-frame-container {\n position: fixed;\n bottom: 0px;\n left: 0px;\n right: 0px;\n width: 100vw;\n z-index: ").concat(2147483640,";\n }\n\n .gleap-admin-frame {\n width: 100%;\n height: 100% !important;\n border: none;\n outline: none;\n display: block;\n }\n \n .gleap-tour-message .linktype-link {\n display: inline-block !important;\n background-color: transparent !important;\n color: ").concat(n," !important;\n }\n\n .gleap-tooltip .linktype-button,\n .gleap-tour-message .linktype-button {\n display: inline-block !important;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 10px 20px !important;\n text-decoration: none !important;\n background-color: ").concat(n," !important;\n color: ").concat(d," !important;\n }\n\n .gleap-tour-message img {\n width: 100%;\n max-width: 100%;\n min-height: 260px;\n height: auto;\n margin-top: 10px;\n margin-bottom: 10px;\n object-fit: cover;\n }\n\n .gleap-tour-active .gleap-tour-overlay {\n pointer-events: none;\n }\n \n .gleap-tour-active * {\n pointer-events: none;\n }\n \n .gleap-tour-active .gleap-tour-active-element,\n .gleap-tour-active .gleap-tour-active-element *,\n .gleap-tour-popover,\n .gleap-tour-popover * {\n pointer-events: auto;\n }\n \n @keyframes animate-fade-in {\n 0% {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n .gleap-tour-fade .gleap-tour-overlay {\n animation: animate-fade-in 200ms ease-in-out;\n }\n \n .gleap-tour-fade .gleap-tour-popover {\n animation: animate-fade-in 200ms;\n }\n\n .gleap-tour-video-playpause {\n position: absolute;\n bottom: 8px;\n left: 8px;\n width: 32px;\n height: 32px;\n padding: 4px;\n background-color: rgba(0,0,0,0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 8px;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-arrow {\n display: none !important;\n }\n\n .gleap-tour-video-playpause svg {\n width: 34px;\n height: auto;\n fill: #fff;\n }\n \n /* Popover styles */\n .gleap-tour-popover {\n all: unset;\n box-sizing: border-box;\n color: ").concat(w,";\n margin: 0;\n padding: 15px;\n border-radius: ").concat(S,"px;\n min-width: 250px;\n max-width: 300px;\n box-shadow: 0 1px 10px #0006;\n ").concat(h?"outline: 1px solid rgba(255, 255, 255, 0.1);":"","\n z-index: 1000000000;\n position: fixed;\n top: 0;\n right: 0;\n background-color: ").concat(b,';\n }\n \n .gleap-tour-popover * {\n font-family: "Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif;\n }\n \n .gleap-tour-popover-title {\n font: 19px / normal sans-serif;\n font-weight: 700;\n display: block;\n position: relative;\n line-height: 1.5;\n zoom: 1;\n margin: 0;\n }\n \n .gleap-tour-popover-close-btn {\n all: unset;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n font-size: 30px;\n font-weight: 500;\n line-height: 32px;\n color: ').concat(h?m:"#d2d2d2",";\n z-index: 1;\n text-align: center;\n transition: color;\n transition-duration: 200ms;\n }\n \n .gleap-tour-popover-close-btn:hover,\n .gleap-tour-popover-close-btn:focus {\n color: ").concat(w,';\n }\n \n .gleap-tour-popover-title[style*="block"] + .gleap-tour-popover-description {\n margin-top: 5px;\n }\n \n .gleap-tour-popover-description {\n margin-bottom: 0;\n font: 15px / normal sans-serif;\n line-height: 1.5;\n font-weight: 400;\n zoom: 1;\n }\n \n .gleap-tour-popover-footer {\n margin-top: 15px;\n text-align: right;\n zoom: 1;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .gleap-tour-popover-progress-text {\n font-size: 13px;\n font-weight: 400;\n color: ').concat(h?m:"#727272",";\n zoom: 1;\n }\n \n .gleap-tour-popover-footer button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 10px 20px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;\n }\n\n .gleap-tour-popover-prev-btn {\n color: ").concat(p," !important;\n background-color: ").concat(v," !important;\n margin-right: 3px;\n }\n\n .gleap-tour-popover-prev-btn:hover {\n background-color: ").concat(e,"22 !important;\n color: ").concat(e,' !important;\n }\n \n .gleap-tour-popover-footer .gleap-tour-popover-btn-disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n \n .gleap-tour-no-interaction, .gleap-tour-no-interaction * {\n pointer-events: none !important;\n }\n \n .gleap-tour-popover-navigation-btns {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n gap: 4px;\n }\n \n .gleap-tour-popover-arrow {\n content: "";\n position: absolute;\n border: 5px solid ').concat(b,";\n }\n \n .gleap-tour-popover-arrow-side-over {\n display: none;\n }\n \n /** Popover Arrow Sides **/\n .gleap-tour-popover-arrow-side-left {\n left: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-right {\n right: 100%;\n border-left-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-top {\n top: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-bottom {\n bottom: 100%;\n border-left-color: transparent;\n border-top-color: transparent;\n border-right-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-center {\n display: none;\n }\n \n /* Left/Start + Right/Start */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-start {\n top: 15px;\n }\n \n /* Top/Start + Bottom/Start */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-start {\n left: 15px;\n }\n \n /* End/Left + End/Right */\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-left,\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-right {\n bottom: 15px;\n }\n \n /* Top/End + Bottom/End */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-end,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-end {\n right: 15px;\n }\n \n /* Left/Center + Right/Center */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-center {\n top: 50%;\n margin-top: -5px;\n }\n \n /* Top/Center + Bottom/Center */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-center {\n left: 50%;\n margin-left: -5px;\n }\n \n /* No arrow */\n .gleap-tour-popover-arrow-none {\n display: none;\n } \n\n /* Modal styles */\n .gleap-modal-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Invisible until the card inside the frame reports its height. Before that the frame is an\n empty box, and a bootstrap that fails silently must not leave a blank white card behind. */\n .gleap-modal-wrapper--loading {\n visibility: hidden;\n }\n\n .gleap-modal-wrapper--loading .gleap-modal {\n animation-name: none;\n }\n\n .gleap-modal-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-modal {\n position: relative;\n width: 90%;\n max-width: 600px;\n max-height: 90vh;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-modal-frame {\n width: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-modal-open {\n overflow: hidden;\n }\n\n /* Agent Popup styles */\n .gleap-agent-popup-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-agent-popup-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-agent-popup {\n position: relative;\n width: 95%;\n max-width: 700px;\n height: 85vh;\n max-height: 800px;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-agent-popup-frame {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-agent-popup-open {\n overflow: hidden;\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 20px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .gleap-frame-container--survey,\n .gleap-frame-container--survey-page,\n .gleap-frame-container--survey-full {\n animation: gleapWidgetFade 0.15s ease-out both !important;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--closing,\n .gleap-frame-container--survey-full.gleap-frame-container--closing {\n animation: gleapWidgetFadeOut 0.15s ease-in both !important;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner,\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n transition: none !important;\n }\n }\n\n .gleap-admin-frame-container,\n .gleap-frame-container,\n .bb-feedback-button,\n .gleap-notification-container,\n .gleap-tooltip,\n .gleap-ai-ui-widget {\n pointer-events: auto !important;\n }\n "),T=document.querySelector(".gleap-styles");T&&T.remove();var L=document.createElement("style");W(L),L.innerHTML=A,L.className="gleap-styles",document.body.appendChild(L)}(e,t,n,o,r,i,a,s,l,c)}))}},{key:"sendSilentCrashReport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};return e.sendSilentCrashReportWithFormData({description:t},n,r)}},{key:"sendSilentCrashReportWithFormData",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};if(!this.silentCrashReportSent){this.silentCrashReportSent=!0,setTimeout((function(){t.silentCrashReportSent=!1}),1e4);var o=r?ee(r):{},i=Bm.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new av("CRASH",n,a,!0,o).sendFeedback().then((function(){})).catch((function(e){}))}}}},{key:"showSurvey",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"survey",r=Bm.getInstance();r.ready?r.onContactSettled((function(){var r=mb(n);e.startFeedbackFlowWithOptions(t,{hideBackButton:!0,format:r.appMode,survey:r},!0)})):r.setOnSessionReady((function(){e.showSurvey(t,n)}))}},{key:"startClassicForm",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlow",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlowWithOptions",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Bm.getInstance().onContactSettled((function(){e.startFeedbackFlowNow(t,n,r)}))}},{key:"startFeedbackFlowNow",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.autostartDrawing,i=n.hideBackButton,a=n.format,s=n.survey;if(Bm.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var l="start-feedbackflow";r&&(l="start-survey");var c=r?s||mb(a):null,u=c?c.appMode:"widget";wv.getInstance().setFrameHost(c&&"page"===c.format?c.container:null),wv.getInstance().setAppMode(u),wv.getInstance().surveyKeyboard=!(!c||"page"!==c.format||!c.keyboard);var d={flow:t,hideBackButton:i,format:c?u:a};if(c){d.surveyFormat=c.format,d.fields=c.fields,c.personalToken&&(d.personalToken=c.personalToken),d.resume=c.resume,c.outboundAction&&(d.outboundAction=c.outboundAction),c.resumeData&&(d.resumeData=c.resumeData);var p=wv.getInstance().getSafeAreaInsets();d.safeArea="card"===c.format?_b(_b({},p),{},{bottom:0}):p}wv.getInstance().sendMessage({name:l,data:d},!0),o?wv.getInstance().showDrawingScreen("screenshot"):wv.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"startConversation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.startBot("",t)}},{key:"startBot",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Bm.getInstance().onContactSettled((function(){wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),wv.getInstance().showWidget()}))}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Bm.getInstance().onContactSettled((function(){wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),wv.getInstance().showWidget()}))}},{key:"sendAgentMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||!t)return Promise.reject(new Error("agentId and message are required."));var r={messages:[{role:"user",content:t.trim()}]};return n.conversationId&&(r.conversationId=n.conversationId),n.additionalContext&&(r.additionalContext=n.additionalContext),new Promise((function(t,o){var i="",a=n.conversationId||null,s=null;x.getInstance().streamAgent(e,r,{onMeta:function(e){e.conversationId&&(a=e.conversationId),e.runId&&(s=e.runId)},onToken:function(e){i+=e.content||"",n.onToken&&n.onToken(e)},onDone:function(e){t({runId:s||(null==e?void 0:e.runId),status:(null==e?void 0:e.status)||"completed",response:i||(null==e?void 0:e.response)||"",conversationId:a})},onError:function(e){o(e)},onToolStart:function(){},onToolEnd:function(){}})}))}},{key:"clearAgentConversation",value:function(){x.getInstance().clearCache()}},{key:"createAgentChat",value:function(e){return new Ut(e)}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"startChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return!!e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"start-checklist",data:_b({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),wv.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"getChecklistData",value:function(e,t){if(!e)return Promise.reject(new Error("outboundId is required"));var n=L.getInstance();return n.validateChecklist(e,t).then((function(e){return n.fetchChecklist(e)}))}},{key:"openNews",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"startProductTour",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;Bm.getInstance().startProductTourConfig(t).then((function(o){var i;!n||null==o||!o.startURL||null!==(i=window)&&void 0!==i&&null!==(i=i.location)&&void 0!==i&&null!==(i=i.href)&&void 0!==i&&i.includes(null==o?void 0:o.baseURL)?r.startProductTourWithConfig(t,o,!0):window.location.href=e.buildTourStartUrl(o.startURL,t)})).catch((function(e){}))}},{key:"buildTourStartUrl",value:function(e,t){try{var n=new URL(e,window.location.href);return n.searchParams.set("gleap_tour",t),n.searchParams.set("gleap_tour_delay","1"),n.toString()}catch(s){var r=Pb(e.split("#"),2),o=r[0],i=r[1],a=o.includes("?")?"&":"?";return"".concat(o).concat(a,"gleap_tour=").concat(encodeURIComponent(t),"&gleap_tour_delay=1").concat(void 0!==i?"#".concat(i):"")}}},{key:"checkForUncompletedTour",value:function(){var e=Ry.getInstance().loadUncompletedTour();e&&Ry.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Ry.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{Pr.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{$v.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){Zv.getInstance().showNotification(e)}}],n&&jb(t.prototype,n),r&&jb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(Ub(qb,"invoked",!0),Ub(qb,"silentCrashReportSent",!1),Ub(qb,"instance",void 0),"undefined"!=typeof window){var zb=window.GleapActions;if(zb&&zb.length>0)for(var Wb=0;Wb{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};(()=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){r=function(){return t};var e,t={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),s=new O(r||[]);return a(i,"_invoke",{value:A(e,n,s)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var f="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};d(x,l,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(M([])));C&&C!==o&&i.call(C,l)&&(x=C);var E=k.prototype=b.prototype=Object.create(x);function I(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function r(o,a,s,l){var c=h(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==n(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,l)}),(function(e){r("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return r("throw",e,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function A(t,n,r){var o=f;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=T(s,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=h(t,n,r);if("normal"===c.type){if(o=r.done?v:g,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=v,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=h(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),F(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;F(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nJb});var s=function(e,t,n){var r,o,i,a,s,l,c;switch(e){case"meta":null===(r=n.onMeta)||void 0===r||r.call(n,t);break;case"token":null===(o=n.onToken)||void 0===o||o.call(n,t);break;case"tool_start":null===(i=n.onToolStart)||void 0===i||i.call(n,t);break;case"tool_end":null===(a=n.onToolEnd)||void 0===a||a.call(n,t);break;case"done":null===(s=n.onDone)||void 0===s||s.call(n,t);break;case"error":null===(l=n.onError)||void 0===l||l.call(n,t);break;case"handoff":null===(c=n.onHandoff)||void 0===c||c.call(n,t)}},l=function(){var e,t=(e=r().mark((function e(t,n){var i,a,l,c,u,d,p,h,f,g,m,v,y,b,w,k,x,S;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.body){e.next=3;break}return null===(i=n.onError)||void 0===i||i.call(n,{message:"No response body."}),e.abrupt("return");case 3:a=t.body.getReader(),l=new TextDecoder,c="",u="",d="",e.prev=8;case 9:return e.next=12,a.read();case 12:if(h=e.sent,f=h.done,g=h.value,!f){e.next=17;break}return e.abrupt("break",24);case 17:c+=l.decode(g,{stream:!0}),m=c.split("\n"),c=null!==(p=m.pop())&&void 0!==p?p:"",v=o(m);try{for(v.s();!(y=v.n()).done;)if(b=y.value,(w=b.replace(/\r$/,"")).startsWith("event: "))u=w.slice(7).trim();else if(w.startsWith("data: "))d+=(d?"\n":"")+w.slice(6);else if(""===w){if(u&&d)try{k=JSON.parse(d),s(u,k,n)}catch(r){}u="",d=""}}catch(C){v.e(C)}finally{v.f()}e.next=9;break;case 24:if(u&&d)try{x=JSON.parse(d),s(u,x,n)}catch(E){}e.next=30;break;case 27:e.prev=27,e.t0=e.catch(8),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&(null===(S=n.onError)||void 0===S||S.call(n,{message:"Stream interrupted."}));case 30:case"end":return e.stop()}}),e,null,[[8,27]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,l,"next",e)}function l(e){a(i,r,o,s,l,"throw",e)}s(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),F(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;F(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t=200&&i.status<300)try{r(i.responseText?JSON.parse(i.responseText):null)}catch(e){o({status:i.status,statusText:"JSON Parse Error",error:e})}else o({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){return o({status:0,statusText:"Network Error"})},i.send(n?JSON.stringify(n):null)}))}},{key:"streamAgent",value:(o=p().mark((function e(t,n,r,o){var i,a,s,c,u,d,h;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.executeInFlight.get(t)){e.next=2;break}return e.abrupt("return");case 2:if(this.executeInFlight.set(t,!0),i=this._getApiUrl()){e.next=8;break}return this.executeInFlight.delete(t),null===(a=r.onError)||void 0===a||a.call(r,{message:"Gleap API URL not configured."}),e.abrupt("return");case 8:return s="".concat(i,"/v3/shared/agents/").concat(t,"/stream"),c=f(f({},this._getHeaders()),{},{Accept:"text/event-stream"}),e.prev=10,e.next=13,fetch(s,{method:"POST",headers:c,body:JSON.stringify(n),signal:o});case 13:u=e.sent,e.next=23;break;case 16:if(e.prev=16,e.t0=e.catch(10),this.executeInFlight.delete(t),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)){e.next=21;break}return e.abrupt("return");case 21:return null===(d=r.onError)||void 0===d||d.call(r,{message:"Failed to connect to agent."}),e.abrupt("return");case 23:if(u.ok){e.next=27;break}return this.executeInFlight.delete(t),null===(h=r.onError)||void 0===h||h.call(r,{message:"Server error: ".concat(u.status)}),e.abrupt("return");case 27:return e.next=29,l(u,r);case 29:n.conversationId&&this._invalidateMessagesCache(n.conversationId),this.executeInFlight.delete(t);case 31:case"end":return e.stop()}}),e,this,[[10,16]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){g(i,n,r,a,s,"next",e)}function s(e){g(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e,t,n,r){return i.apply(this,arguments)})},{key:"executeAgent",value:function(e,t){var n=this;if(this.executeInFlight.get(e))return Promise.reject(new Error("Agent execution already in progress."));var r=this._getApiUrl();if(!r)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));this.executeInFlight.set(e,!0);var o="".concat(r,"/v3/shared/agents/").concat(e,"/execute");return this._makeRequest("POST",o,t).then((function(e){return t.conversationId&&n._invalidateMessagesCache(t.conversationId),null!=e&&e.conversationId&&n._invalidateMessagesCache(e.conversationId),e})).finally((function(){n.executeInFlight.delete(e)}))}},{key:"getConversationMessages",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("kai"===e)return Promise.resolve({messages:[]});var i="".concat(t,":").concat(r,":").concat(o),a=this.messagesCache.get(i);if(a)return a.status===b?Promise.resolve(JSON.parse(JSON.stringify(a.data))):Promise.reject(a.error);if(this.messagesRequests.has(i))return this.messagesRequests.get(i).then((function(e){return JSON.parse(JSON.stringify(e))}));var s=this._getApiUrl();if(!s)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));var l="".concat(s,"/v3/shared/agents/").concat(e,"/conversations/").concat(t,"/messages?limit=").concat(r,"&skip=").concat(o),c=this._makeRequest("GET",l,null).then((function(e){return n.messagesCache.set(i,{status:b,data:e}),JSON.parse(JSON.stringify(e))})).catch((function(e){throw n.messagesCache.set(i,{status:w,error:e}),e})).finally((function(){n.messagesRequests.delete(i)}));return this.messagesRequests.set(i,c),c.then((function(e){return JSON.parse(JSON.stringify(e))}))}},{key:"getConversations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("kai"===e)return Promise.resolve({conversations:[]});var r=this._getApiUrl();return r?this._makeRequest("GET","".concat(r,"/v3/shared/agents/").concat(e,"/conversations?limit=").concat(t,"&skip=").concat(n),null):Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."))}},{key:"_invalidateMessagesCache",value:function(e){var t,n=u(this.messagesCache.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value;r.startsWith(e+":")&&this.messagesCache.delete(r)}}catch(s){n.e(s)}finally{n.f()}var o,i=u(this.messagesRequests.keys());try{for(i.s();!(o=i.n()).done;){var a=o.value;a.startsWith(e+":")&&this.messagesRequests.delete(a)}}catch(s){i.e(s)}finally{i.f()}}}],r=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],n&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();v(k,"instance",null);const x=k;function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function C(e,t){for(var n=0;n=200&&i.status<300)try{var e=i.responseText?JSON.parse(i.responseText):null;r(e)}catch(t){o({status:i.status,statusText:"JSON Parse Error",responseText:i.responseText,error:t})}else o({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){o({status:0,statusText:"Network Error",responseText:null})},i.send(n?JSON.stringify(n):null)}))}},{key:"_createCacheKey",value:function(e,t){return t?"".concat(e,"::").concat(t):e}},{key:"validateChecklist",value:function(e,t){var n=this,r=this._createCacheKey(e,t),o=this.validationCache.get(r);if(o)return o.status===D?Promise.resolve(o.internalId):Promise.reject(o.error);if(this.validationRequests.has(r))return this.validationRequests.get(r);var i=this._getApiUrl();if(!i){var a=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.validationCache.set(r,{status:A,error:a}),Promise.reject(a)}var s="".concat(i,"/outbound/checklists?").concat(this._getQueryParams()),l=this._makeRequest("POST",s,{outboundId:e,sharedKey:t}).then((function(e){if(e&&e.id)return n.validationCache.set(r,{status:D,internalId:e.id}),e.id;var t=new Error("Validation response missing checklist ID.");throw n.validationCache.set(r,{status:A,error:e||t}),t})).catch((function(e){throw n.validationCache.set(r,{status:A,error:e}),e})).finally((function(){n.validationRequests.delete(r)}));return this.validationRequests.set(r,l),l}},{key:"fetchChecklist",value:function(e){var t=this,n=this.fetchCache.get(e);if(n)return n.status===D?Promise.resolve(JSON.parse(JSON.stringify(n.data))):Promise.reject(n.error);if(this.fetchRequests.has(e))return this.fetchRequests.get(e).then((function(e){return JSON.parse(JSON.stringify(e))}));var r=this._getApiUrl();if(!r){var o=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.fetchCache.set(e,{status:A,error:o}),Promise.reject(o)}var i="".concat(r,"/outbound/checklists/").concat(e,"?convertTipTap=true&").concat(this._getQueryParams()),a=this._makeRequest("GET",i,null).then((function(n){if(n)return t.fetchCache.set(e,{status:D,data:n}),JSON.parse(JSON.stringify(n));var r=new Error("Empty response received for checklist fetch.");throw t.fetchCache.set(e,{status:A,error:n||r}),r})).catch((function(n){throw t.fetchCache.set(e,{status:A,error:n}),n})).finally((function(){t.fetchRequests.delete(e)}));return this.fetchRequests.set(e,a),a.then((function(e){return JSON.parse(JSON.stringify(e))}))}}])&&C(t.prototype,n),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();E(T,"instance",null);const L=T;function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}function O(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],t=wv.getInstance();t.isOpened()?(t.hideWidget(),this.updateRedDot(this.showingRedDot)):(t.setAppMode("widget"),t.showWidget(),this.updateRedDot(!1),e&&t.focusFrame())}},{key:"restoreFocus",value:function(){if(this.feedbackButton&&this.feedbackButton.isConnected)try{this.feedbackButton.focus({preventScroll:!0})}catch(e){}}},{key:"injectFeedbackButton",value:function(){var e=this;if(!this.injectedFeedbackButton){this.injectedFeedbackButton=!0;var t=document.createElement("div");t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.addEventListener("click",(function(){e.feedbackButtonPressed()})),t.addEventListener("keydown",(function(t){"Enter"!==t.key&&" "!==t.key&&"Spacebar"!==t.key||(t.preventDefault(),e.feedbackButtonPressed(!0))})),this.attachPressAnimation(t),document.body.appendChild(t),this.feedbackButton=t,this.updateFeedbackButtonState()}}},{key:"attachPressAnimation",value:function(e){var t="bb-feedback-button--pressed",n="bb-feedback-button--springing",r=null,o=function(){clearTimeout(r),e.classList.remove(n),e.classList.add(t)},i=function(){e.classList.contains(t)&&(e.classList.remove(t),e.classList.add(n),r=setTimeout((function(){e.classList.remove(n)}),550))};window.PointerEvent?(e.addEventListener("pointerdown",o),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",i),this.removePressListeners=function(){document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i)}):(e.addEventListener("mousedown",o),e.addEventListener("touchstart",o,{passive:!0}),document.addEventListener("mouseup",i),document.addEventListener("touchend",i),document.addEventListener("touchcancel",i),this.removePressListeners=function(){document.removeEventListener("mouseup",i),document.removeEventListener("touchend",i),document.removeEventListener("touchcancel",i)})}},{key:"updateNotificationBadge",value:function(e){var t=document.querySelector(".bb-notification-bubble");if(t){var n="bb-notification-bubble--hidden";e>0&&!wv.getInstance().isOpened()?(t.classList.remove(n),t.innerText=e):t.classList.add(n)}}},{key:"refresh",value:function(){document.querySelector(".bb-feedback-button")?(this.updateFeedbackButtonText(),this.updateFeedbackButtonState()):(this.injectedFeedbackButton=!1,this.feedbackButton=null,this.buttonHidden=null,this.lastButtonIcon=null,this.injectFeedbackButton())}},{key:"updateFeedbackButtonText",value:function(){var t=Rd.getInstance().getFlowConfig();if(t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT){var n=document.querySelector(".bb-feedback-button-classic");n&&(n.innerText=t.widgetButtonText)}}},{key:"updateFeedbackButtonState",value:function(){var t=this;if(or.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=Rd.getInstance().getFlowConfig(),r="";r=n.buttonLogo?''):ve("button","#fff");var o=["bb-feedback-button--pressed","bb-feedback-button--springing"].filter((function(e){return t.feedbackButton.classList.contains(e)}));this.feedbackButton.className="bb-feedback-button gleap-font rr-block",o.forEach((function(e){return t.feedbackButton.classList.add(e)})),this.feedbackButton.setAttribute("dir",ub.getInstance().isRTLLayout?"rtl":"ltr");var i=wv.getInstance().isOpened();this.feedbackButton.setAttribute("aria-expanded",i?"true":"false"),this.feedbackButton.setAttribute("aria-label",n.widgetButtonText&&"".concat(n.widgetButtonText).trim()||"Open support chat"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT?(this.feedbackButton.classList.add("bb-feedback-button--classic-button-style"),this.feedbackButton.innerHTML='
').concat(n.widgetButtonText,"
")):r!==this.lastButtonIcon&&(this.feedbackButton.innerHTML='
'.concat(r).concat(ve("arrowdown","#fff"),'
')),this.lastButtonIcon=r;var a=!1;null===e.getInstance().buttonHidden?n.feedbackButtonPosition===e.FEEDBACK_BUTTON_NONE&&(a=!0):e.getInstance().buttonHidden&&(a=!0),a&&this.feedbackButton.classList.add("bb-feedback-button--disabled"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_BOTTOM_LEFT&&this.feedbackButton.classList.add("bb-feedback-button--bottomleft");var s=wv.getInstance().appMode;wv.getInstance().isOpened()&&"survey_page"!==s&&this.feedbackButton.classList.add("bb-feedback-button--open"),"survey"!==s&&"survey_full"!==s&&"survey_web"!==s||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||Bm.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&O(t.prototype,n),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e,t,n){return t=function(e){var t=function(e,t){if("object"!=B(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==B(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}M(R,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),M(R,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),M(R,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),M(R,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),M(R,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),M(R,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),M(R,"instance",void 0);var _=/^[A-Za-z0-9+/=_-]{1,256}$/,U=function(e){if("string"!=typeof e)return null;var t=e.trim();return _.test(t)?t:null},H=function(){try{if("undefined"==typeof document)return null;var e=document.currentScript;if(e){var t=U(e.nonce||e.getAttribute("nonce"));if(t)return t}var n=document.querySelector('script[src*="sdk.gleap.io"]');if(n)return U(n.nonce||n.getAttribute("nonce"))}catch(r){}return null}(),q=null,z=function(){return q||H},W=function(e){var t=z();if(!t||!e)return e;try{e.setAttribute("nonce",t),e.nonce=t}catch(n){}return e},G="https://docs.gleap.ai/documentation/javascript/content-security-policy",V=new Set,$="gleap-frame-route-failed",J=function(e){return"string"==typeof e&&(0===e.indexOf("script-src")||0===e.indexOf("style-src"))},K=function(e,t){if(e&&t){var n,r=!1,o=function(){if(!r){r=!0;try{e.src=t}catch(n){}}};if(!function(){try{var e,t=null===(e=window.location)||void 0===e?void 0:e.protocol;return"http:"===t||"https:"===t}catch(n){return!1}}())return o();try{if(!e.contentDocument)return o()}catch(a){return o()}try{var i=new URL(t);n=i.origin+"/"}catch(a){return o()}fetch(t,{mode:"cors",credentials:"omit"}).then((function(e){if(!e.ok)throw new Error("Bootstrap fetch failed: "+e.status);return e.text()})).then((function(r){var i=r.replace(/(\s(?:href|src)\s*=\s*["'])\/([^"'/][^"']*)/g,"$1"+n+"$2"),s=z(),l=function(e,t){return t?e.replace(/<(script|style)\b(?![^>]*\snonce\s*=)/gi,'<$1 nonce="'+t+'"'):e}(i,s),c=s?' nonce="'+s+'"':"",u="/",d="/";try{var p=new URL(t);u=(d=p.pathname)+p.search+p.hash}catch(a){}var h,f,g="try{history.replaceState(null,"",'+JSON.stringify(u)+");}catch(e){}try{if(location.pathname!=="+JSON.stringify(d)+"&&window.frameElement){window.frameElement.dispatchEvent(new Event("+JSON.stringify($)+"));}}catch(e){}<\/script>";h=//i.test(l)?l.replace(/<\/head>/i,g+""):l;try{f=e.contentDocument}catch(a){return o()}if(!f)return o();try{e.addEventListener($,o,{once:!0})}catch(a){}try{f.open(),function(e,t){var n=!1;try{e.addEventListener("securitypolicyviolation",(function(e){if(e&&"report"!==e.disposition){var r=e.blockedURI||"a resource",o=e.effectiveDirective||e.violatedDirective||"unknown directive",i=r+"|"+o;V.has(i)||(V.add(i),console.warn("Gleap: Your page's Content-Security-Policy blocked "+r+" ("+o+"). Gleap may not appear or work correctly until your policy allows it \u2014 see "+G)),t&&!n&&J(o)&&"string"==typeof r&&0===r.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(f,{baseHref:n,onBlocked:o}),f.write(h),f.close()}catch(a){o()}})).catch((function(e){V.has(t)||(V.add(t),console.warn("Gleap: Loading "+t+" failed ("+(e&&e.message?e.message:"network error")+") \u2014 falling back to loading the frame directly. If Gleap does not appear, your Content-Security-Policy may be blocking it (most often a missing connect-src entry) \u2014 see "+G)),o()}))}},X=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400;return new Promise((function(r,o){var i=0===e.indexOf("data:image/jpeg"),a=new Image;a.src=e,a.onerror=function(){o()},a.onload=function(){var e=document.createElement("canvas"),o=t,s=n;t>a.width/1.5&&(o=a.width/1.5),n>a.height/1.5&&(s=a.height/1.5);var l=a.width,c=a.height;l>c?l>o&&(c*=o/l,l=o):c>s&&(l*=s/c,c=s),e.width=l,e.height=c,e.getContext("2d").drawImage(a,0,0,l,c),r(i?e.toDataURL("image/jpeg",.7):e.toDataURL())}}))},Y=/(android|iphone|ipod|ipad|blackberry|iemobile|opera mini|webos)/i,Z=function(){return Q()?"mobile":"desktop"},Q=function(){if("undefined"==typeof window)return!1;try{var e="undefined"!=typeof navigator?navigator:void 0;if(null!=e&&e.userAgentData&&"boolean"==typeof e.userAgentData.mobile&&null!==e.userAgentData.mobile)return e.userAgentData.mobile;if(e&&Y.test(e.userAgent||e.vendor||""))return!0;if((null==e?void 0:e.maxTouchPoints)>1&&window.matchMedia){var t=window.matchMedia("(hover: none) and (pointer: coarse)");if(null!=t&&t.matches)return!0}}catch(n){}return!1},ee=function(e){if(!e)return{};if("string"==typeof e||e instanceof String)try{return JSON.parse(e)}catch(t){return{}}return e},te=function(e){if("string"==typeof e){var t=e.trim();return t.length>0?t:null}return"number"==typeof e?Number.isFinite(e)?String(e):null:"bigint"==typeof e?String(e):null},ne=function(e){try{if(!e||"object"!==B(e)||!("company"in e))return e;var t=e.company,n=function(e){for(var t=1;t3&&void 0!==arguments[3]&&arguments[3];try{var o="";if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),o="; expires="+i.toUTCString()}var a="";r&&(a="; SameSite=Lax"+("https:"===window.location.protocol?"; Secure":"")),document.cookie=e+"="+(t||"")+o+"; path=/"+ie("domain")+a}catch(s){}},ce=function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n=160?"#000000":"#ffffff"},ve=function(e,t){return"button"===e?'':"drag"===e?'\x3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--\x3e':"unmute"===e?'':"mute"===e?'':"replay"===e?'\n \n ':"dismiss"===e?'':"blur"===e?'\n \n':"pen"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n':"rect"===e?'\n \n \n \n \n \n \n \n \n \n \n':"pointer"===e?'\n \n ':"clip"===e?'\n \n \n \n \n \n':"mic"===e?'\n \n \n \n \n ':"camera"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n':"recorderon"===e?'\n \n \n \n \n \n \n \n \n \n \n \n':"recorderoff"===e?'\n \n \n \n \n \n \n \n \n ':"arrowdown"===e?'\n \n '):"arrowleft"===e?'\n \n '):"close"===e?'\n \n '):"undo"===e?'\n \n \n \n \n \n \n \n \n \n ':"circle-dot"===e?''):"circle-question"===e?''):"circle-info"===e?''):"circle-exclamation"===e?''):"circle-up"===e?''):"circle-right"===e?''):""};function ye(e){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ye(e)}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function we(e,t){for(var n=0;n=a-i;++s)n[i]=t[s],Te(e,t,n,s+1,o,i+1,a);else e.push(n.slice(0,i).join(""))}function Le(e){return function(e){if(Array.isArray(e))return Fe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:["id","class","length"];return Le(e.attributes).reduce((function(e,n){return t.indexOf(n.nodeName)>-1||e.push("[".concat(n.nodeName,'="').concat(n.value,'"]')),e}),[])}(e,n)},Class:Ae,ID:De};return t.reduce((function(t,n){return t[n]=r[n](e),t}),{})}function Ue(e,t){try{var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}catch(r){return!1}}function He(e,t){return t.find(Ue.bind(null,e))}function qe(e,t,n){var r=function(e,t){for(var n=[],r=e.length,o=[],i=1;i<=t;++i)Te(n,e,o,0,r-1,0,i);return n}(t,3),o=He(e,r);return Boolean(o)||Boolean(n)&&(o=He(e,r=r.map((function(e){return n+e}))),Boolean(o))?o:null}function ze(e,t,n,r){var o,i=_e(e,t,n);r&&r instanceof RegExp&&(i.ID=r.test(i.ID)?null:i.ID,i.Class=i.Class.filter((function(e){return!r.test(e)})));var a,s=je(t);try{for(s.s();!(a=s.n()).done;){var l=a.value,c=i.ID,u=i.Tag,d=i.Class,p=i.Attributes,h=i.NthChild;switch(l){case"ID":if(Boolean(c)&&Ue(e,c))return c;break;case"Tag":if(Boolean(u)&&Ue(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(o=qe(e,d,u)))return o;break;case"Attributes":if(Boolean(p)&&p.length&&(o=qe(e,p,u)))return o;break;case"NthChild":if(Boolean(h))return h}}}catch(f){s.e(f)}finally{s.f()}return"*"}function We(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.selectorTypes,o=void 0===r?["ID","Class","Tag","NthChild"]:r,i=n.attributesToIgnore,a=void 0===i?["id","class","length"]:i,s=n.excludeRegex,l=void 0===s?null:s,c=[],u=function(e){for(var t=[],n=e;Me(n);)t.push(n),n=n.parentNode;return t}(e),d=je(u);try{for(d.s();!(t=d.n()).done;){var p=ze(t.value,o,a,l);Boolean(p)&&c.push(p)}}catch(y){d.e(y)}finally{d.f()}for(var h=[],f=0,g=c;f ");if(Ne(e,v))return v}return null}var Ge=/^[A-Za-z_][\w-]*\s*[~|^$*]?=\s*(?:"[^"]*"|'[^']*'|[^\s"'\]]+)$/,Ve={},$e=function(e,t){if("string"!=typeof e||!e.trim())return null;for(var n=function(e){var t=e.trim(),n=[t];return Ge.test(t)&&n.push("[".concat(t,"]")),n.push(t.replace(/(#[^#\s]+)/g,(function(e){return e.replace(/:/g,"\\:")}))),n}(e),r=0;r=0},Xe=function(e,t){var n=$e(e,(function(e){return t.querySelectorAll(e)}));return n?n.result:[]},Ye=function(e,t){for(var n=e.split(Je),r=[t],o=0;o1&&void 0!==arguments[1]?arguments[1]:document;if(Ke(e))return Ye(e,t)[0]||null;var n=$e(e,(function(e){return t.querySelector(e)}));return n?n.result:null},Qe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Ke(e)?Ye(e,t):Xe(e,t)},et=function e(t,n){if(Ke(n)){for(var r=n.split(Je),o=t,i=r.length-1;i>=0;i--){if(!o||!e(o,r[i]))return!1;var a="function"==typeof o.getRootNode?o.getRootNode():null;o=a&&a.host?a.host:null}return!0}var s=$e(n,(function(e){return t.matches(e)}));return!!s&&s.result},tt=function(e){return'(?:[^"]*[^a-zA-Z0-9])?(?:'.concat(e.join("|"),")")},nt=new RegExp(['^(?:#|\\[id=")'.concat(tt(["v-\\d+",":r[0-9a-z]+:","\xabr[0-9a-z]+\xbb","_r_[0-9a-z]+_","(?:radix|headlessui|reach|floating-ui|mantine)-","mui-\\d+","(?:mat|cdk)-[a-z-]+-?\\d+","(?:downshift|react-select|tippy|uid|uuid)-\\d+","ember\\d+","BVID__\\d+","ext-gen\\d+","yui_\\d","[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"])),"^\\.".concat(tt(["css-[a-z0-9]*\\d[a-z0-9]*","sc-(?=[a-zA-Z0-9]*[A-Z])[a-zA-Z0-9]{5,}","jsx-\\d+","mantine-[a-z0-9]*\\d[a-z0-9]*","m_[0-9a-f]{8}$","__m__-","_r_[0-9a-z]+_"])),"^\\.[^.]*".concat("__(?=[A-Za-z0-9]{4,}$)(?=[A-Za-z0-9]*[0-9])(?=[A-Za-z0-9]*[A-Z])[A-Za-z0-9]+$")].join("|")),rt=function(e){var t=e&&"function"==typeof e.getRootNode?e.getRootNode():null;return t&&"function"==typeof t.querySelectorAll?t:document},ot=function(e,t){if(!e||"*"===e)return!1;try{var n=rt(t).querySelectorAll(e);return 1===n.length&&n[0]===t}catch(r){return!1}},it=/\d{2,}/,at=function(e){return e.replace(/\d+/g,"#")},st=function(e){return e.match(/(?:^\d|:)/)?'[id="'.concat(e,'"]'):"#".concat(e)},lt=["data-testid","data-test-id","data-test","data-cy","data-qa","name"],ct=function(e,t){var n=t(e),r=[];try{var o=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t={},n=e.querySelectorAll("[id]"),r=0;r1?e.concat(t[n]):e}),[])}(rt(e)),i="function"==typeof e.getAttribute?e.getAttribute("id"):null;i&&o.indexOf(i)<0&&!nt.test(st(i))&&r.push(st(i)),r.push.apply(r,function(e){var t=(e.tagName||"").toLowerCase();return lt.reduce((function(n,r){var o="function"==typeof e.getAttribute?e.getAttribute(r):null;if(!o||nt.test("#".concat(o)))return n;var i=o.replace(/["\\]/g,"\\$&");return n.concat(["".concat(t,"[").concat(r,'="').concat(i,'"]'),"[".concat(r,'="').concat(i,'"]')])}),[])}(e));var a=o.map((function(e){return st(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})),s=a.length?new RegExp("".concat(nt.source,"|^(?:").concat(a.join("|"),")$")):nt;r.push(t(e,{excludeRegex:s}))}catch(c){}for(var l=0;l2&&void 0!==arguments[2]?arguments[2]:We,r=rt(e);return r!==document&&r.host?"".concat(dt(r.host,n)," ").concat(Je," ").concat(t):t},dt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;return ut(e,ct(e,t),t)};function pt(e){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(e)}function ht(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0])||r(t.gleapCollapseUI,e)&&r(t.gleapFrameContainer,n))&&(t.gleapCollapseUI&&t.gleapCollapseUI.classList.toggle(e),t.gleapFrameContainer&&t.gleapFrameContainer.classList.toggle(n))})),It(this,"injectCollapseUI",(function(){if(!t.injectedCollapseUI){t.injectedCollapseUI=!0;var e=document.createElement("div");e.className="gleap-admin-collapse-ui",e.innerHTML='
\n '.concat(ve("arrowdown"),"\n
"),document.body.appendChild(e),t.gleapCollapseUI=e,e.addEventListener("click",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t.toggleCollapseUI()}))}})),It(this,"injectFrame",(function(){var e;if(!t.injectedFrame){t.injectedFrame=!0;var n=document.createElement("div");n.className="gleap-admin-frame-container",n.innerHTML=''),document.body.appendChild(n),t.gleapFrameContainer=n,t.gleapFrame=document.querySelector(".gleap-admin-frame")}}))}var t,n,r;return t=e,n=[{key:"logCurrentPage",value:function(){var e=window.location.href;e&&e!==this.lastUrl&&(this.lastUrl=e,this.sendMessageToTourBuilder({name:"page-changed",data:{page:e}}))}},{key:"startPageListener",value:function(){var e=this;setInterval((function(){e.logCurrentPage()}),1e3)}},{key:"initAdminHelper",value:function(){var e=this;this.initialized=!0,Ry.getInstance().disable(),Pr.getInstance().disable(),$v.getInstance().disable(),$b.close(),$b.showFeedbackButton(!1),e.adminHelper=new yt;try{e.adminHelper.onElementPicked=function(t){e.toggleCollapseUI(!0),e.sendMessageToTourBuilder({name:"element-picked",data:{selector:t}})}}catch(t){console.log(t)}e.injectFrame(),e.injectCollapseUI(),e.setFrameHeight("loading")}},{key:"setFrameHeight",value:function(e){if(this.gleapFrameContainer){var t="";t="picker"===e||"navigate"===e?"65px":"editor"===e?"100vh":"0px",this.gleapFrameContainer.style.height=t}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!window.gleapAdminDisabled){var t=this;window.addEventListener("message",(function(n){if(wt(n.origin))try{var r=JSON.parse(n.data);if("admin"===r.type&&("load"===r.name&&(t.adminOrigin||(t.adminOrigin=kt(n.origin)),t.configData=r.data,t.initAdminHelper()),"smartlink-search-result"===r.name&&e.sendMessageToTourBuilder({name:"smartlink-search-result",data:r.data}),"translate-complete"===r.name&&e.sendMessageToTourBuilder({name:"translate-complete",data:r.data})),"tourbuilder"===r.type){var o;if("loaddata"===r.name&&e.sendMessageToTourBuilder({name:"data",data:Ct(Ct({},t.configData),{},{currentPage:window.location.href})}),"highlight-element"===r.name&&(document.querySelectorAll(".gleap-admin-highlight").forEach((function(e){e.classList.remove("gleap-admin-highlight")})),t.shadowHighlight&&(t.shadowHighlight.style.removeProperty("box-shadow"),t.shadowHighlight=null),null!=r&&null!==(o=r.data)&&void 0!==o&&o.selector)){var i,a=Ze(null==r||null===(i=r.data)||void 0===i?void 0:i.selector);if(a){a.classList.add("gleap-admin-highlight");var s=a.getRootNode();s!==document&&s.host&&(a.style.setProperty("box-shadow","0px 0px 0px 4px red"),t.shadowHighlight=a)}}if("smartlink-search"===r.name&&e.sendMessage({name:"smartlink-search",data:r.data}),"product-tour-started"===r.name&&e.sendMessage({name:"product-tour-started",data:r.data}),"translate"===r.name&&e.sendMessage({name:"translate",data:r.data}),"save"===r.name&&e.sendMessage({name:"save",data:r.data}),"update-steps"===r.name&&e.sendMessage({name:"update-steps",data:r.data}),"click"===r.name)try{var l;null===(l=Ze(r.data.selector))||void 0===l||l.click()}catch(c){console.log(c)}"status-changed"===r.name&&(t.status=r.data,e.setFrameHeight(t.status),t.adminHelper.stopPicker(),"picker"===t.status&&t.adminHelper.startPicker())}}catch(u){}})),this.sendMessage({name:"init"}),this.startPageListener()}}},{key:"sendMessage",value:function(e){try{window&&window.opener&&window.opener.postMessage(JSON.stringify(Ct(Ct({},e),{},{type:"admin"})),this.adminOrigin||"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(Ct(Ct({},e),{},{type:"tourbuilder"})),kt(this.adminOrigin))}catch(t){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Et(t.prototype,n),r&&Et(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Tt(e){return Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(e)}function Lt(){Lt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new L(r||[]);return o(a,"_invoke",{value:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(F([])));x&&x!==n&&r.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(o,i,a,s){var l=d(e[o],e,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Tt(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=f;var c=d(t,n,r);if("normal"===c.type){if(o=r.done?g:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function D(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,D(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function F(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Ft(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._agentId=t.agentId||"kai",this._context=t.context||null,this._onChange=t.onChange||null,this._onError=t.onError||null,this._onReplyReceived=t.onReplyReceived||null,this._onConversationCreated=t.onConversationCreated||null,this._onToken=t.onToken||null,this._messages=[],this._conversationId=t.conversationId||null,this._isExecuting=!1,this._error=null,this._destroyed=!1,this._abortController=null;try{this._networkManager=x.getInstance()}catch(n){this._networkManager=null}}var t,n,r,o,i;return t=e,n=[{key:"sendMessage",value:(o=Lt().mark((function e(t){var n,r,o,i,a,s,l,c=this;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=(t||"").trim())&&!this._isExecuting&&!this._destroyed){e.next=3;break}return e.abrupt("return");case 3:return this._messages=[].concat(Pt(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),r="stream-".concat(Date.now()),this._messages=[].concat(Pt(this._messages),[{id:r,role:"assistant",content:"",createdAt:(new Date).toISOString(),isStreaming:!0}]),this._isExecuting=!0,this._error=null,this._notify(),o="kai"===this._agentId,i=o?this._messages.filter((function(e){return!e.isStreaming&&e.content})).map((function(e){return{role:e.role,content:e.content}})):[{role:"user",content:n}],a={messages:i},this._conversationId&&(a.conversationId=this._conversationId),this._context&&(a.additionalContext=this._context),this._abortController=new AbortController,s=!this._conversationId,l=this._messages.length-1,e.next=19,this._networkManager.streamAgent(this._agentId,a,{onMeta:function(e){c._destroyed||(e.conversationId&&(c._conversationId=e.conversationId,c._networkManager._invalidateMessagesCache(e.conversationId),s&&c._onConversationCreated&&c._onConversationCreated(e.conversationId)),e.runId&&c._messages[l]&&(c._messages[l]=Ot(Ot({},c._messages[l]),{},{id:e.runId})))},onToken:function(e){if(!c._destroyed){var t=c._messages[l];t&&(t.content+=e.content||""),c._notify(),c._onToken&&c._onToken(e)}},onDone:function(e){if(!c._destroyed){var t=c._messages[l];t&&(t.isStreaming=!1,e.response&&!t.content&&(t.content=e.response)),c._isExecuting=!1,c._abortController=null,c._notify(),c._onReplyReceived&&c._onReplyReceived(e)}},onError:function(e){if(!c._destroyed){var t=c._messages[l];t&&!t.content?c._messages.splice(l,1):t&&(t.isStreaming=!1),c._isExecuting=!1,c._error=e,c._abortController=null,c._notify(),c._onError&&c._onError(e)}},onToolStart:function(){},onToolEnd:function(){}},this._abortController.signal);case 19:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){Nt(i,n,r,a,s,"next",e)}function s(e){Nt(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"cancelStream",value:function(){this._abortController&&(this._abortController.abort(),this._abortController=null),this._messages=this._messages.map((function(e){return e.isStreaming?Ot(Ot({},e),{},{isStreaming:!1}):e})),this._messages=this._messages.filter((function(e){return e.content||"user"===e.role})),this._isExecuting=!1,this._notify()}},{key:"clearMessages",value:function(){this._messages=[],this._conversationId=null,this._isExecuting=!1,this._error=null,this.cancelStream(),x.getInstance().clearCache(),this._notify()}},{key:"setContext",value:function(e){this._context=e}},{key:"getState",value:function(){return{messages:this._messages,isExecuting:this._isExecuting,error:this._error,conversationId:this._conversationId}}},{key:"destroy",value:function(){this.cancelStream(),this._destroyed=!0,this._onChange=null,this._onError=null,this._onReplyReceived=null,this._onConversationCreated=null,this._onToken=null}},{key:"_notify",value:function(){this._onChange&&!this._destroyed&&this._onChange(this.getState())}}],n&&jt(t.prototype,n),r&&jt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const Ut=_t;var Ht=["http:","https:","mailto:","tel:"],qt=["javascript:","vbscript:","data:"],zt=function(e){if("string"!=typeof e||!e.trim())return null;try{return new URL(e,"https://relative.invalid/").protocol.toLowerCase()}catch(t){return null}},Wt=function(e,t){if("string"!=typeof e||!e||"null"===e||"string"!=typeof t)return!1;try{return new URL(t).origin===e}catch(n){return!1}},Gt=function(e,t){try{var n=e.contentWindow,r=n.origin||n.location.origin;return r&&"null"!==r?r:"*"}catch(i){}try{var o=new URL(t).origin;return o&&"null"!==o?o:"*"}catch(i){return"*"}},Vt={eu:{apiUrl:"https://api.gleap.io",wsApiUrl:"wss://ws.gleap.io",realtimeHost:"sockets.gleap.io"},us:{apiUrl:"https://api.us.gleap.ai",wsApiUrl:"wss://ws.us.gleap.ai",realtimeHost:"sockets.us.gleap.ai"}},$t="eu";function Jt(e){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(e)}function Kt(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("flow-started"===e){var n=$b.getInstance();n.setGlobalDataItem("webReplay",null),n.setGlobalDataItem("screenRecordingData",null),n.setGlobalDataItem("screenshotImage",null),n.takeCurrentReplay()}var r=this.getInstance().eventListeners[e];if(r)for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function mn(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function vn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};this.colorScheme=function(e){return e===Fn||e===On?e:Ln}(e),this.lightBackgroundColor=Un(null==t?void 0:t.lightBackgroundColor),this.darkBackgroundColor=Un(null==t?void 0:t.darkBackgroundColor),this.updateWatching(),this.notifyChange()}},{key:"getDashboardConfig",value:function(){try{return Rd.getInstance().rawFlowConfig||null}catch(e){return null}}},{key:"getColorScheme",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig(),n=(e=null==t?void 0:t.colorScheme,-1!==Mn.indexOf(e)?e:Tn);return n===Tn?Tn:this.colorScheme||n}},{key:"hasDarkPalette",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig();return!!this.darkBackgroundColor||!!e&&Pn.some((function(t){var n=Dn(t,2)[1];return null!==Un(e[n])}))}},{key:"getActiveColorScheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig(),t=this.getColorScheme(e),n=null;return t===Ln?n=this.detectedScheme||$n():t!==Fn&&t!==On||(n=t),n!==On||this.hasDarkPalette(e)?n:null}},{key:"applyToFlowConfig",value:function(e){var t=this.getActiveColorScheme(e);if(!e||!t)return e;if(t===Fn)return this.lightBackgroundColor?Sn(Sn({},e),{},{backgroundColor:this.lightBackgroundColor}):e;var n=Sn({},e);return Pn.forEach((function(t){var r=Dn(t,2),o=r[0],i=r[1],a=Un(e[i]);a&&(n[o]=a)})),this.darkBackgroundColor&&(n.backgroundColor=this.darkBackgroundColor),Rn.forEach((function(t){var r=Dn(t,2),o=r[0],i=r[1],a=e[i];null!=a&&(n[o]=a)})),n}},{key:"applyToChatbarStyle",value:function(e){var t=this.getActiveColorScheme();if(!t)return e;var n=!e||"light-glow"===e||"dark-glow"===e;return t===On?n?"dark-glow":"dark":n?"light-glow":"light"}},{key:"applyToChecklist",value:function(e){e&&(this.getActiveColorScheme()===On?e.setAttribute(Hn,""):e.removeAttribute(Hn))}},{key:"applyToChecklists",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("undefined"!=typeof document)for(var t=document.querySelectorAll("gleap-checklist"),n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Xn(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function Yn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Xn(i,r,o,a,s,"next",e)}function s(e){Xn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Zn(e){return Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zn(e)}function Qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function er(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];if(this._postMessageRaw({name:"chatbar-notification-clear"}),!e)try{var t;eb.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=Bm.getInstance().session)||void 0===t?void 0:t.gleapId})}catch(n){}}},{key:"_resizeFrame",value:function(e){var t=e.width,n=e.height;if(this.chatbarContainer){if(Number.isFinite(t)&&window.innerWidth>=600){var r=window.innerWidth-20;this.chatbarContainer.style.width=Math.min(Math.ceil(t),r)+"px"}Number.isFinite(n)&&(this.chatbarContainer.style.height=Math.ceil(n)+"px"),this.isHidden||(this.chatbarContainer.style.display="block")}}},{key:"_updateBlurBackdrop",value:function(e){var t=e.visible,n=e.top,r=e.bottom,o=e.left,i=e.right,a=e.radius,s=e.dark;if(this.blurBackdrop)if(this.chatbarFrame&&(this.chatbarFrame.style.backdropFilter="",this.chatbarFrame.style.webkitBackdropFilter=""),t){var l=this.blurBackdrop.style;l.top=(null!=n?n:0)+"px",l.bottom=(null!=r?r:0)+"px",l.left=(null!=o?o:0)+"px",l.right=(null!=i?i:0)+"px",l.height="auto",l.borderRadius=(null!=a?a:20)+"px",s?(l.background="rgba(40, 40, 40, 0.55)",l.backdropFilter="blur(20px) saturate(140%) brightness(0.75)",l.webkitBackdropFilter="blur(20px) saturate(140%) brightness(0.75)"):(l.background="rgba(255, 255, 255, 0.45)",l.backdropFilter="blur(20px) saturate(150%) brightness(1.04)",l.webkitBackdropFilter="blur(20px) saturate(150%) brightness(1.04)"),l.opacity="1"}else this.blurBackdrop.style.opacity="0"}},{key:"setConfig",value:function(e){this.config=e,e.enabled?this.show():this.manuallyShown||this.hide(),this.comReady&&this._sendConfigUpdate()}},{key:"setPlaceholder",value:function(e){this.config||(this.config={}),this.config.placeholder=e,this.comReady&&this._sendConfigUpdate()}},{key:"setQuickActions",value:function(e){this.config||(this.config={}),this.config.quickActions=e,this.comReady&&this._sendConfigUpdate()}},{key:"sendAgentToolsUpdate",value:function(){this._postMessageRaw({name:"config-update",data:{config:this._withChatbarConfig(Rd.getInstance().getFlowConfig()),aiTools:wn.getInstance().getAgentTools(),agentTools:wn.getInstance().getAgentTools(),overrideLanguage:ub.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===Zn(e)?"context"in e||"initialQuestion"in e||"initialMessage"in e?e:{context:e}:{}}},{key:"_getDefaultAgentId",value:function(){try{var e,t;if(null!==(e=this.config)&&void 0!==e&&e.workflowId)return this.config.workflowId;var n=Rd.getInstance().getFlowConfig()||{};return(null==n||null===(t=n.aiBar)||void 0===t?void 0:t.workflowId)||null}catch(r){return null}}},{key:"_validateAgent",value:(i=Yn(Kn().mark((function e(t){var n,r,o,i,a,s,l;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=Bm.getInstance(),i=o.apiUrl||Vt[$t].apiUrl,a={},o.sdkKey&&(a["Api-Token"]=o.sdkKey),null!==(n=o.session)&&void 0!==n&&n.gleapId&&(a["Gleap-Id"]=o.session.gleapId),null!==(r=o.session)&&void 0!==r&&r.gleapHash&&(a["Gleap-Hash"]=o.session.gleapHash),o.addGrantHeader(a),e.next=10,fetch("".concat(i,"/v3/shared/agents/").concat(encodeURIComponent(t)),{headers:a});case 10:if((s=e.sent).ok){e.next=13;break}return e.abrupt("return",null);case 13:return e.next=15,s.json();case 15:if((l=e.sent)&&!l.error){e.next=18;break}return e.abrupt("return",null);case 18:return this.agentId=t,this.agentName=l.name||"AI Agent",e.abrupt("return",l);case 23:return e.prev=23,e.t0=e.catch(0),e.abrupt("return",null);case 26:case"end":return e.stop()}}),e,this,[[0,23]])}))),function(e){return i.apply(this,arguments)})},{key:"showWithAgent",value:(o=Yn(Kn().mark((function e(t,n){var r,o,i=this;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._normalizeAgentOptions(n),this._suppressOutsideClick=!0,clearTimeout(this._suppressOutsideClickTimeout),this._suppressOutsideClickTimeout=setTimeout((function(){i._suppressOutsideClick=!1}),600),(o=t)&&"default"!==o||(o=this._getDefaultAgentId()||"kai"),!o||"kai"===o){e.next=13;break}return this.agentId=o,this.agentName=null,e.next=11,this._validateAgent(o);case 11:e.next=15;break;case 13:this.agentId="kai",this.agentName=null;case 15:r.context&&(this.agentContext=r.context),this.manuallyHidden=!1,this.manuallyShown=!0,this.show(),this.setPanelOpen(!0),this._postMessageRaw({name:"chatbar-start-agent",data:{agentId:this.agentId,agentName:this.agentName,context:this.agentContext,initialQuestion:r.initialQuestion||void 0,initialMessage:r.initialMessage||void 0}});case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"updateUIVisibility",value:function(){var e;wv.getInstance().isOpened()?this.hide():null!==(e=this.config)&&void 0!==e&&e.enabled||this.manuallyShown?this.show():this.hide()}},{key:"show",value:function(){this.manuallyHidden||(this.isHidden=!1,this._preloadIframe(),this.chatbarContainer&&(this.chatbarContainer.style.display="block"))}},{key:"hide",value:function(){this.isHidden=!0,this._removeUI()}},{key:"_removeUI",value:function(){this.chatbarContainer&&(document.body&&document.body.contains(this.chatbarContainer)&&document.body.removeChild(this.chatbarContainer),this.chatbarContainer=null,this.chatbarFrame=null,this.blurBackdrop=null,this.comReady=!1,this._panelOpen=!1,this.pendingMessages=[])}},{key:"_preloadIframe",value:function(){var e=this;this.chatbarContainer||de((function(){return e._injectUI()}))}},{key:"_injectUI",value:function(){if(document.body&&!this.chatbarContainer){var e={};try{e=Rd.getInstance().getFlowConfig()||{}}catch(s){}if(!document.getElementById("gleap-chatbar-styles")){var t=e.feedbackButtonPosition,n="";n="BOTTOM_RIGHT"===t?"right: 60px !important;":"BOTTOM_LEFT"===t?"left: 60px !important;":"right: 0 !important;";var r=document.createElement("style");W(r),r.id="gleap-chatbar-styles",r.innerHTML="\n @media (max-width: 460px) {\n .gleap-chatbar {\n width: auto !important;\n max-width: 100% !important;\n ".concat(n,"\n }\n }\n "),document.head.appendChild(r)}var o=document.createElement("div");o.className="gleap-chatbar",o.style.cssText="\n position: fixed;\n bottom: 10px;\n z-index: 2147483000;\n border: 0;\n width: 280px;\n max-width: calc(100vw - 20px);\n overflow: visible;\n height: 80px;\n display: none;\n transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1), height 0.32s cubic-bezier(0.22, 1, 0.36, 1);\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n ";var i=document.createElement("iframe");i.className="gleap-chatbar-frame",i.title="Gleap AI Chatbar",i.setAttribute("role","dialog"),i.setAttribute("frameborder","0"),i.setAttribute("allow","autoplay; encrypted-media; microphone *;"),i.style.cssText="\n position: relative;\n width: 100%;\n height: 100%;\n border: 0;\n background: transparent;\n z-index: 1;\n ";var a=document.createElement("div");a.style.cssText="\n position: absolute;\n opacity: 0;\n transition: opacity 0.24s ease;\n background: rgba(255, 255, 255, 0.45);\n backdrop-filter: blur(20px) saturate(150%) brightness(1.04);\n -webkit-backdrop-filter: blur(20px) saturate(150%) brightness(1.04);\n transform: translateZ(0);\n will-change: backdrop-filter, transform;\n backface-visibility: hidden;\n border-radius: 20px;\n pointer-events: none;\n z-index: 0;\n ",o.appendChild(a),o.appendChild(i),document.body.appendChild(o),this.chatbarContainer=o,this.chatbarFrame=i,this.blurBackdrop=a,K(this.chatbarFrame,this.chatbarUrl)}}},{key:"destroy",value:function(){this._removeUI(),this.config=null,this.isHidden=!0,this.comReady=!1,this._panelOpen=!1,this.pendingMessages=[],this.agentId=null,this.agentName=null,this.agentContext=null,e.instance=null}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&tr(t.prototype,n),r&&tr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ir(e){return ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ir(e)}function ar(e,t){for(var n=0;nhr,gr=["start-conversation","start-custom-action","start-product-tour","open-url","show-form","show-survey","show-news-article","show-help-article","show-checklist"],mr=e=>{try{return-1!==gr.indexOf(e)&&wv.getInstance().isCaptureHidden()}catch(t){return!1}},vr=()=>{try{return"19.9.2"}catch(e){return""}},yr=()=>{try{const e=Rd.getInstance().getFlowConfig();if(e&&e.capture&&"object"==typeof e.capture)return e.capture}catch(e){}return{}},br=()=>{try{return"undefined"!=typeof MediaRecorder&&"function"==typeof MediaRecorder.prototype.pause}catch(e){return!1}},wr=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}catch(e){return!1}},kr=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia}catch(e){return!1}},xr=()=>{try{const e=navigator,t=e.userAgentData;if(t&&Array.isArray(t.brands))return!t.mobile&&t.brands.some((e=>e&&/Chromium/i.test(e.brand)));const n=e.userAgent||"";return/\bChrome\/\d+/.test(n)&&!/Android|Mobile|CriOS|EdgiOS|FxiOS/i.test(n)}catch(e){return!1}},Sr=()=>"dom-only"!==yr().webScreenshotMethod&&xr()&&wr()&&(()=>{try{return window.top===window.self}catch(e){return!1}})(),Cr=()=>wr()&&"undefined"!=typeof window&&"function"==typeof window.MediaRecorder?"display":"rrweb",Er=()=>{if(!pr)return!1;try{return"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof HTMLCanvasElement&&"undefined"!=typeof Element&&"function"==typeof Element.prototype.attachShadow}catch(e){return!1}},Ir=()=>{const e={version:1,platform:dr,sdkType:ur,sdkVersion:vr(),screenshot:!1,recording:!1,annotate:!1,highlight:!0};if(!Er())return e;const t=Cr();return e.screenshot=!0,e.recording=!0,e.annotate=!0,e.recordingMethod=t,e.maxRecordingSec=180,e.microphone="display"===t&&!0===yr().allowMicrophone&&kr(),e.pause="display"===t&&br(),e.flyIn=!0,e};function Dr(e){return Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dr(e)}function Ar(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tr(e){for(var t=1;t',document.body.appendChild(t),this.bannerContainer=t;var n=t.querySelector(".gleap-b-frame");n&&K(n,this.bannerUrl)}},{key:"sendMessage",value:function(e){try{var t=document.querySelector(".gleap-b-frame");t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(Tr(Tr({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){var t=null!=e&&e.untilDismissed?null==e?void 0:e.outbound:null;if(t){var n,r;if(this.loadClosedBanners().includes(t))return void(this.closedReportedThisPage.has(t)||(this.closedReportedThisPage.add(t),this.reportBannerClosed(t)));if(this.bannerContainer&&null!==(n=this.bannerData)&&void 0!==n&&n.untilDismissed&&(null===(r=this.bannerData)||void 0===r?void 0:r.outbound)===t)return}this.injectBannerUI(e)}},{key:"bannerWasClosed",value:function(e){var t=null!=e&&e.untilDismissed?null==e?void 0:e.outbound:null;t&&(this.rememberClosedBanner(t),this.closedReportedThisPage.add(t),this.reportBannerClosed(t))}},{key:"reportBannerClosed",value:function(e){try{var t=Ky.getInstance();t.logEvent(function(e){return"outbound-".concat(e,"-closed")}(e)),t.streamEvents()}catch(n){}}},{key:"closedBannersKey",value:function(){try{var e,t=null===(e=Bm.getInstance())||void 0===e||null===(e=e.session)||void 0===e?void 0:e.gleapId;return t?"gleap-closed-banners-".concat(t):null}catch(n){return null}}},{key:"loadClosedBanners",value:function(){try{var e=this.closedBannersKey();if(!e)return[];var t=JSON.parse(localStorage.getItem(e));return Array.isArray(t)?t:[]}catch(n){return[]}}},{key:"rememberClosedBanner",value:function(e){try{var t=this.closedBannersKey();if(!t)return;var n=this.loadClosedBanners().filter((function(t){return t!==e}));n.push(e),localStorage.setItem(t,JSON.stringify(n.slice(-50)))}catch(r){}}}])&&Lr(t.prototype,n),r&&Lr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Fr(Pr,"instance",void 0);var Rr,Nr=Object.defineProperty,jr=(e,t,n)=>((e,t,n)=>t in e?Nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Br=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(Br||{}),_r=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(_r||{}),Ur=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ur||{}),Hr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Hr||{}),qr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(qr||{}),zr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(zr||{}),Wr=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Wr||{});const Gr={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Vr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},$r={},Jr={},Kr=()=>!!globalThis.Zone;function Xr(e){if($r[e])return $r[e];const t=globalThis[e],n=t.prototype,r=e in Gr?Gr[e]:void 0,o=Boolean(r&&r.every((e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))}))),i=e in Vr?Vr[e]:void 0,a=Boolean(i&&i.every((e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))})));if(o&&a&&!Kr())return $r[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const i=o[e].prototype;if(!i)return r.remove(),n;const a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(r.classList.add("rr-block"),r.setAttribute("__rrwebUntaintedMutationObserver",""),Jr[e]=()=>r.remove()):r.remove(),$r[e]=i}catch{return n}}const Yr={};function Zr(e,t,n){var r;const o=`${e}.${String(n)}`;if(Yr[o])return Yr[o].call(t);const i=Xr(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(Yr[o]=a,a.call(t)):t[n]}const Qr={};function eo(e,t,n){const r=`${e}.${String(n)}`;if(Qr[r])return Qr[r].bind(t);const o=Xr(e)[n];return"function"!=typeof o?t[n]:(Qr[r]=o,o.bind(t))}function to(){return[Xr("MutationObserver").constructor,Jr.MutationObserver??(()=>{})]}let no=Date.now;function ro(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString())||(no=()=>(new Date).getTime());const oo={ownerDocument:function(e){return Zr("Node",e,"ownerDocument")},childNodes:function(e){return Zr("Node",e,"childNodes")},parentNode:function(e){return Zr("Node",e,"parentNode")},parentElement:function(e){return Zr("Node",e,"parentElement")},textContent:function(e){return Zr("Node",e,"textContent")},contains:function(e,t){return eo("Node",e,"contains")(t)},getRootNode:function(e){return eo("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Zr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Zr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Zr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Zr("Element",e,"querySelectorAll")(t)},nowTimestamp:no,mutationObserverCtor:to,patch:ro};function io(e){return e.nodeType===e.ELEMENT_NODE}function ao(e){const t=e&&"host"in e&&"mode"in e&&oo.host(e)||null;return Boolean(t&&"shadowRoot"in t&&oo.shadowRoot(t)===e)}function so(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function lo(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const o=Array.from(n,(e=>co(e,r))).join("");return(t=o).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(n){return null}var t}function co(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=lo(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?ko(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(n)),t?ko(n,t):n}}class uo{constructor(){jr(this,"idNodeMap",new Map),jr(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function po({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let a=o||"";const s=r&&ho(r);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function ho(e){return e.toLowerCase()}const fo="__rrweb_original__";function go(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ho(t):null}function mo(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(o){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const vo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,yo=/^(?:[a-z+]+:)?\/\//i,bo=/^www\..*/i,wo=/^(data:)([^,]*),(.*)/i;function ko(e,t){return(e||"").replace(vo,((e,n,r,o,i,a)=>{const s=r||i||a,l=n||o||"";if(!s)return e;if(yo.test(s)||bo.test(s))return`url(${l}${s}${l})`;if(wo.test(s))return`url(${l}${s}${l})`;if("/"===s[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+s}${l})`;const c=s.split("#")[0],u=s.substring(c.length),d=t.split("#")[0].split("/"),p=c.split("/");d.pop();for(const t of p)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${l}${d.join("/")}${u}${l})`}))}function xo(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function So(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),o=[];let i=0;if(r.length>1&&e&&"string"==typeof e){let t=xo(e,n);const a=t.length/e.length;for(let s=1;s2&&""===p[0]&&""!==r[s-1].textContent)h=t.indexOf(d,1);else if(1===p.length){if(d=d.substring(0,d.length-1),p=t.split(d),p.length<=1)return o.push(e),o;u=c+1}else u===l.length-1&&(h=t.indexOf(d));if(p.length>=2&&u>c){const e=r[s-1].textContent;if(e&&"string"==typeof e){const n=xo(e).length;h=t.indexOf(d,n)}-1===h&&(h=p[0].length)}if(-1!==h){let s=Math.floor(h/a);for(;s>0&&s50*r.length)return o.push(e),o;const l=xo(e.substring(0,s),n);if(l.length===h){o.push(e.substring(0,s)),e=e.substring(s),t=t.substring(h);break}l.length=t.length);){let i=r(Lo);if(","===i.slice(-1))i=Mo(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=Mo(e,i);let a=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(a=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?ko(r,Ro(e)):"object"===t&&"data"===n?Mo(e,r):r:r}function jo(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function Bo(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Bo(oo.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&Bo(oo.parentNode(e),t,n)}function _o(e,t,n,r){let o;if(io(e)){if(o=e,!oo.childNodes(o).length)return!1}else{if(null===oo.parentElement(e))return!1;o=oo.parentElement(e)}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(Bo(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(i){}return!1}function Uo(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:a,inlineStylesheet:s,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Wr.Document,childNodes:[],compatMode:e.compatMode}:{type:Wr.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Wr.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:a={},maskInputFn:s,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:h}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,o),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=ho(e.tagName);return Eo.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let w=0;wt.href===e.href));let r=null;t&&(r=lo(t)),r&&(delete m.rel,delete m.href,m._cssText=r)}if("style"===g&&e.sheet){let t=lo(e.sheet);t&&(e.childNodes.length>1&&(t=So(t,e)),m._cssText=t)}if(["input","textarea","select"].includes(g)){const t=e.value,n=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&t?m.value=po({element:e,type:go(e),tagName:g,value:t,maskInputOptions:a,maskInputFn:s}):n&&(m.checked=n)}"option"===g&&(e.selected&&!a.select?m.selected=!0:delete m.selected);"dialog"===g&&e.open&&(m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(l.type,l.quality)&&(m.rr_dataURL=t)}if("img"===g&&c){Ao||(Ao=n.createElement("canvas"),To=Ao.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Ao.width=t.naturalWidth,Ao.height=t.naturalHeight,To.drawImage(t,0,0),m.rr_dataURL=Ao.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?m.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if(["audio","video"].includes(g)){const t=m;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:n}=e.getBoundingClientRect();m={class:m.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==g||d(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);let y;try{customElements.get(g)&&(y=!0)}catch(b){}return{type:Wr.Element,tagName:g,attributes:m,childNodes:[],isSVG:Po(e)||void 0,needBlock:f,rootId:h,isCustom:y}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,a=oo.parentNode(e),s=a&&a.tagName;let l="";const c="STYLE"===s||void 0,u="SCRIPT"===s||void 0;u?l="SCRIPT_PLACEHOLDER":i||(l=oo.textContent(e),c&&l&&(l=ko(l,Ro(t.doc))));!c&&!u&&l&&n&&(l=r?r(l,oo.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Wr.Text,textContent:l||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:c,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:Wr.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:Wr.Comment,textContent:oo.textContent(e)||"",rootId:v};default:return!1}}function Ho(e){return null==e?"":e.toLowerCase()}function qo(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function zo(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:S=!1,cssCaptured:C=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:I=!0}=t;if(!E){E=_o(e,a,s,void 0===E)}const D=Uo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:S,cssCaptured:C});if(!D)return console.warn(e,"not serialized"),null;let A;A=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===Wr.Comment)return!0;if(e.type===Wr.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===mo(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ho(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ho(e.attributes.name)||"icon"===Ho(e.attributes.rel)||"apple-touch-icon"===Ho(e.attributes.rel)||"shortcut icon"===Ho(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ho(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ho(e.attributes.property).match(/^(og|twitter|fb):/)||Ho(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ho(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ho(e.attributes.name)||"googlebot"===Ho(e.attributes.name)||"bingbot"===Ho(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ho(e.attributes.name)||"generator"===Ho(e.attributes.name)||"framework"===Ho(e.attributes.name)||"publisher"===Ho(e.attributes.name)||"progid"===Ho(e.attributes.name)||Ho(e.attributes.property).match(/^article:/)||Ho(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ho(e.attributes.name)||"yandex-verification"===Ho(e.attributes.name)||"csrf-token"===Ho(e.attributes.name)||"p:domain_verify"===Ho(e.attributes.name)||"verify-v1"===Ho(e.attributes.name)||"verification"===Ho(e.attributes.name)||"shopify-checkout-api-token"===Ho(e.attributes.name)))return!0}}return!1}(D,h)||!I&&D.type===Wr.Text&&!D.textContent.replace(/^\s+|\s+$/gm,"").length?Io:Do();const T=Object.assign(D,{id:A});if(r.add(e,T),A===Io)return null;v&&v(e);let L=!l;if(T.type===Wr.Element){L=L&&!T.needBlock,delete T.needBlock;const t=oo.shadowRoot(e);t&&so(t)&&(T.isShadowHost=!0)}if((T.type===Wr.Document||T.type===Wr.Element)&&L){h.headWhitespace&&T.type===Wr.Element&&"head"===T.tagName&&(I=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(T.type===Wr.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else{T.type===Wr.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(oo.childNodes(e))){const e=zo(n,t);e&&T.childNodes.push(e)}}let S=null;if(io(e)&&(S=oo.shadowRoot(e)))for(const e of Array.from(oo.childNodes(S))){const n=zo(e,t);n&&(so(S)&&(n.isShadow=!0),T.childNodes.push(n))}}const F=oo.parentNode(e);return F&&ao(F)&&so(F)&&(T.isShadow=!0),T.type===Wr.Element&&"iframe"===T.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(s){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&y){const n=zo(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),T.type===Wr.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===mo(T.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(a){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(w){const t=zo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),T}class Wo{constructor(...e){jr(this,"parentElement",null),jr(this,"parentNode",null),jr(this,"ownerDocument"),jr(this,"firstChild",null),jr(this,"lastChild",null),jr(this,"previousSibling",null),jr(this,"nextSibling",null),jr(this,"ELEMENT_NODE",1),jr(this,"TEXT_NODE",3),jr(this,"nodeType"),jr(this,"nodeName"),jr(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Wo))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Go(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Vo="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let $o={map:{},getId:()=>(console.error(Vo),-1),getNode:()=>(console.error(Vo),null),removeNodeFromMap(){console.error(Vo)},has:()=>(console.error(Vo),!1),reset(){console.error(Vo)}};function Jo(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();o||!1!==n.leading||(o=a);const s=t-(a-o),l=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(l,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(l,i)}),s))}}function Ko(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>Ko(e,t,i||{},!0)}function Xo(e){var t,n,r,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=oo.parentElement(i.body))?void 0:t.scrollLeft)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(r=oo.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function Yo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Zo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Qo(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:oo.parentElement(e)}function ei(e,t,n,r){if(!e)return!1;const o=Qo(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(Bo(o,t,r))return!0}catch(i){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ti(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===Io}function ni(e,t){if(ao(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=oo.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||ni(r,t))}function ri(e){return Boolean(e.changedTouches)}function oi(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ii(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ai(e){return!!e&&(e instanceof Wo&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(oo.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&($o=new Proxy($o,{get:(e,t,n)=>("map"===t&&console.error(Vo),Reflect.get(e,t,n))}));class si{constructor(){jr(this,"id",1),jr(this,"styleIDMap",new WeakMap),jr(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function li(e){var t;let n=null;return"getRootNode"in e&&(null==(t=oo.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&oo.host(oo.getRootNode(e))&&(n=oo.host(oo.getRootNode(e))),n}function ci(e){const t=oo.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=li(n);)n=t;return n}(e);return oo.contains(t,n)}function ui(e){const t=oo.ownerDocument(e);return!!t&&(oo.contains(t,e)||ci(e))}function di(e){return"__ln"in e}class pi{constructor(){jr(this,"length",0),jr(this,"head",null),jr(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n`${e}@${t}`;class fi{constructor(){jr(this,"frozen",!1),jr(this,"locked",!1),jr(this,"texts",[]),jr(this,"attributes",[]),jr(this,"attributeMap",new WeakMap),jr(this,"removes",[]),jr(this,"mapRemoves",[]),jr(this,"movedMap",{}),jr(this,"addedSet",new Set),jr(this,"movedSet",new Set),jr(this,"droppedSet",new Set),jr(this,"removesSubTreeCache",new Set),jr(this,"mutationCb"),jr(this,"blockClass"),jr(this,"blockSelector"),jr(this,"maskTextClass"),jr(this,"maskTextSelector"),jr(this,"inlineStylesheet"),jr(this,"maskInputOptions"),jr(this,"maskTextFn"),jr(this,"maskInputFn"),jr(this,"keepIframeSrcFn"),jr(this,"recordCanvas"),jr(this,"inlineImages"),jr(this,"slimDOMOptions"),jr(this,"dataURLOptions"),jr(this,"doc"),jr(this,"mirror"),jr(this,"iframeManager"),jr(this,"stylesheetManager"),jr(this,"shadowDomManager"),jr(this,"canvasManager"),jr(this,"processedNodeManager"),jr(this,"unattachedDoc"),jr(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),jr(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new pi,r=e=>{let t=e,n=Io;for(;n===Io;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=oo.parentNode(o);if(!i||!ui(o))return;let a=!1;if(o.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(a=!0)}const s=ao(i)?this.mirror.getId(li(o)):this.mirror.getId(i),l=r(o);if(-1===s||-1===l)return n.addNode(o);const c=zo(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{oi(e,this.mirror)&&this.iframeManager.addIframe(e),ii(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ai(o)&&this.shadowDomManager.addShadowRoot(oo.shadowRoot(o),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:a});c&&(e.push({parentId:s,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)mi(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(oo.parentNode(s))||o(s);for(const s of this.addedSet)vi(this.droppedSet,s)||mi(this.removesSubTreeCache,s,this.mirror)?vi(this.movedSet,s)?o(s):this.droppedSet.add(s):o(s);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(oo.parentNode(i.value)),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(oo.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=oo.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=oo.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const a={texts:this.texts.map((e=>{const t=e.node,n=oo.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))})),jr(this,"genTextAreaValueMutation",(e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(oo.childNodes(e),(e=>oo.textContent(e)||"")).join("");t.attributes.value=po({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:go(e),value:n,maskInputFn:this.maskInputFn})})),jr(this,"processMutation",(e=>{if(!ti(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=oo.textContent(e.target);ei(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:_o(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Qo(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,o=e.target.getAttribute(r);if("value"===r){const e=go(n);o=po({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(ei(e.target,this.blockClass,this.blockSelector,!1)||o===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(o)){if(n.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!jo(n.tagName,r))if(i.attributes[r]=No(this.doc,ho(n.tagName),ho(r),o),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),o=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?t:[t,o]:i._unchangedStyles[e]=[t,o]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(ei(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=ao(e.target)?this.mirror.getId(oo.host(e.target)):this.mirror.getId(e.target);ei(e.target,this.blockClass,this.blockSelector,!1)||ti(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(gi(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||ni(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[hi(n,r)]?gi(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!ao(e.target)||!so(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),oo.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),jr(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ti(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[hi(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ei(e,this.blockClass,this.blockSelector,!1)||(oo.childNodes(e).forEach((e=>this.genAdds(e))),ai(e)&&oo.childNodes(oo.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function gi(e,t){e.delete(t),oo.childNodes(t).forEach((t=>gi(e,t)))}function mi(e,t,n){return 0!==e.size&&function(e,t,n){const r=oo.parentNode(t);return!!r&&e.has(r)}(e,t)}function vi(e,t){return 0!==e.size&&yi(e,t)}function yi(e,t){const n=oo.parentNode(t);return!!n&&(!!e.has(n)||yi(e,n))}let bi;const wi=e=>{if(!bi)return e;return(...t)=>{try{return e(...t)}catch(n){if(bi&&!0===bi(n))return;throw n}}},ki=[];function xi(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Si(e,t){const n=new fi;ki.push(n),n.init(e);const[r,o]=to(),i=new r(wi(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Ci({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];let l=null;return Object.keys(Ur).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=ho(i);const c=(t=>i=>{const a=xi(i);if(ei(a,r,o,!0))return;let s=null,c=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=Hr.Mouse;break;case"touch":s=Hr.Touch;break;case"pen":s=Hr.Pen}s===Hr.Touch?Ur[t]===Ur.MouseDown?c="TouchStart":Ur[t]===Ur.MouseUp&&(c="TouchEnd"):Hr.Pen}else ri(i)&&(s=Hr.Touch);null!==s?(l=s,(c.startsWith("Touch")&&s===Hr.Touch||c.startsWith("Mouse")&&s===Hr.Mouse)&&(s=null)):Ur[t]===Ur.Click&&(s=l,l=null);const u=ri(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:h}=u;wi(e)({type:Ur[c],id:d,x:p,y:h,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(Ur[i]){case Ur.MouseDown:case Ur.MouseUp:a=a.replace("mouse","pointer");break;case Ur.TouchStart:case Ur.TouchEnd:return}s.push(Go(a,c,t))})),wi((()=>{s.forEach((e=>e()))}))}function Ei({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return Go("scroll",wi(Jo(wi((i=>{const a=xi(i);if(!a||ei(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=Xo(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:a.scrollLeft,y:a.scrollTop})})),i.scroll||100)),t)}const Ii=["INPUT","TEXTAREA","SELECT"],Di=new WeakMap;function Ai(e){return function e(t,n){if(Oi("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Oi("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Oi("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Oi("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const r=Array.from(t.parentRule.cssRules).indexOf(t);return n.unshift(r),e(t.parentRule,n)}if(t.parentStyleSheet){const e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);n.unshift(e)}return n}(e,[])}function Ti(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Li({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(oo.host(n));const s="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(i=null==(o=n.ownerDocument)?void 0:o.defaultView)?void 0:i.ShadowRoot,l=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=l.set)?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(o){}return r}}),wi((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Fi(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Si(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,s=[];const l=Jo(wi((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),c=wi(Jo(wi((e=>{const t=xi(e),{clientX:n,clientY:o}=ri(e)?e.changedTouches[0]:e;a||(a=no()),s.push({x:n,y:o,id:r.getId(t),timeOffset:no()-a}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?_r.Drag:e instanceof MouseEvent?_r.MouseMove:_r.TouchMove)})),o,{trailing:!1})),u=[Go("mousemove",c,n),Go("touchmove",c,n),Go("drag",c,n)];return wi((()=>{u.forEach((e=>e()))}))}(e),a=Ci(e),s=Ei(e),l=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return Go("resize",wi(Jo(wi((()=>{const t=Yo(),o=Zo();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)})),200)),t)}(e,{win:n}),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:a,maskInputOptions:s,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function d(e){let n=xi(e);const c=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=oo.parentElement(n)),!n||!d||Ii.indexOf(d)<0||ei(n,r,o,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let h=n.value,f=!1;const g=go(n)||"";"radio"===g||"checkbox"===g?f=n.checked:(s[d.toLowerCase()]||s[g])&&(h=po({element:n,maskInputOptions:s,tagName:d,type:g,value:h,maskInputFn:l})),p(n,u?{text:h,isChecked:f,userTriggered:c}:{text:h,isChecked:f});const m=n.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function p(t,r){const o=Di.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Di.set(t,r);const o=n.getId(t);wi(e)({...r,id:o})}}const h=("last"===c.input?["change"]:["input","change"]).map((e=>Go(e,wi(d),t))),f=t.defaultView;if(!f)return()=>{h.forEach((e=>e()))};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push(...m.map((e=>Ko(e[0],e[1],{set(){wi(d)({target:this,isTrusted:!1})}},!1,f)))),wi((()=>{h.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const a=wi((i=>Jo(wi((o=>{const a=xi(o);if(!a||ei(a,t,n,!0))return;const{currentTime:s,volume:l,muted:c,playbackRate:u,loop:d}=a;e({type:i,id:r.getId(a),currentTime:s,volume:l,muted:c,playbackRate:u,loop:d})})),o.media||500))),s=[Go("play",a(zr.Play),i),Go("pause",a(zr.Pause),i),Go("seeked",a(zr.Seeked),i),Go("volumechange",a(zr.VolumeChange),i),Go("ratechange",a(zr.RateChange),i)];return wi((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:wi(((r,o,i)=>{const[a,s]=i,{id:l,styleId:c}=Ti(o,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:a,index:s}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const o=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[o,n])};const i=r.CSSStyleSheet.prototype.deleteRule;let a,s;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:wi(((r,o,i)=>{const[a]=i,{id:s,styleId:l}=Ti(o,t,n.styleMirror);return(s&&-1!==s||l&&-1!==l)&&e({id:s,styleId:l,removes:[{index:a}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:wi(((r,o,i)=>{const[a]=i,{id:s,styleId:l}=Ti(o,t,n.styleMirror);return(s&&-1!==s||l&&-1!==l)&&e({id:s,styleId:l,replace:a}),r.apply(o,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:wi(((r,o,i)=>{const[a]=i,{id:s,styleId:l}=Ti(o,t,n.styleMirror);return(s&&-1!==s||l&&-1!==l)&&e({id:s,styleId:l,replaceSync:a}),r.apply(o,i)}))}));const l={};Mi("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Mi("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Mi("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Mi("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach((([r,o])=>{c[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[r].insertRule,{apply:wi(((r,o,i)=>{const[a,s]=i,{id:l,styleId:c}=Ti(o.parentStyleSheet,t,n.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:a,index:[...Ai(o),s||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:wi(((r,o,i)=>{const[a]=i,{id:s,styleId:l}=Ti(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||l&&-1!==l)&&e({id:s,styleId:l,removes:[{index:[...Ai(o),a]}]}),r.apply(o,i)}))})})),wi((()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach((([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule}))}))}(e,{win:n}),p=Li(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:wi(((o,a,s)=>{var l;const[c,u,d]=s;if(n.has(c))return i.apply(a,[c,u,d]);const{id:p,styleId:h}=Ti(null==(l=a.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:c,value:u,priority:d},index:Ai(a.parentRule)}),o.apply(a,s)}))});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:wi(((o,i,s)=>{var l;const[c]=s;if(n.has(c))return a.apply(i,[c]);const{id:u,styleId:d}=Ti(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:c},index:Ai(i.parentRule)}),o.apply(i,s)}))}),wi((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(f=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=ro(t.fonts,"add",(function(t){return function(n){return setTimeout(wi((()=>{const t=o.get(n);t&&(e(t),o.delete(n))})),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(a),wi((()=>{r.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let a=!0;const s=wi((()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],l=e.rangeCount||0;for(let t=0;t{}}(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,n,y.options));return wi((()=>{ki.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),a(),s(),l(),c(),u(),d(),p(),h(),f(),g(),m(),v.forEach((e=>e()))}))}function Oi(e){return void 0!==window[e]}function Mi(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Pi{constructor(e){jr(this,"iframeIdToRemoteIdMap",new WeakMap),jr(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Ri{constructor(e){jr(this,"iframes",new WeakMap),jr(this,"crossOriginIframeMap",new WeakMap),jr(this,"crossOriginIframeMirror",new Pi(Do)),jr(this,"crossOriginIframeStyleMirror"),jr(this,"crossOriginIframeRootIdMap",new WeakMap),jr(this,"mirror"),jr(this,"mutationCb"),jr(this,"wrappedEmit"),jr(this,"loadListener"),jr(this,"stylesheetManager"),jr(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Pi(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Br.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Br.IncrementalSnapshot,data:{source:_r.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Br.Meta:case Br.Load:case Br.DomContentLoaded:return!1;case Br.Plugin:return t;case Br.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Br.IncrementalSnapshot:switch(t.data.source){case _r.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case _r.Drag:case _r.TouchMove:case _r.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case _r.ViewportResize:return!1;case _r.MediaInteraction:case _r.MouseInteraction:case _r.Scroll:case _r.CanvasMutation:case _r.Input:return this.replaceIds(t.data,e,["id"]),t;case _r.StyleSheetRule:case _r.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case _r.Font:return t;case _r.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case _r.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===Wr.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Ni{constructor(e){jr(this,"shadowDoms",new WeakSet),jr(this,"mutationCb"),jr(this,"scrollCb"),jr(this,"bypassOptions"),jr(this,"mirror"),jr(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!so(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Si({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Ei({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(oo.host(e))),this.restoreHandlers.push(Li({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(ro(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r),i=oo.shadowRoot(this);return i&&ui(this)&&n.addShadowRoot(i,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ji="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_i=0;_i<64;_i++)Bi[ji.charCodeAt(_i)]=_i;const Ui=new Map;const Hi=(e,t,n)=>{if(!e||!Wi(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Ui.get(e);return n||(n=new Map,Ui.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function qi(e,t,n){if(e instanceof Array)return e.map((e=>qi(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t>2],o+=ji[(3&n[t])<<4|n[t+1]>>4],o+=ji[(15&n[t+1])<<2|n[t+2]>>6],o+=ji[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[qi(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[qi(e.data,t,n),e.width,e.height]}}if(Wi(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Hi(e,t,n)}}return e}const zi=(e,t,n)=>e.map((e=>qi(e,t,n))),Wi=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Gi(e,t,n,r){const o=[];try{const i=ro(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!ei(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function Vi(e,t,n,r,o,i){const a=[],s=Object.getOwnPropertyNames(e);for(const l of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const s=ro(e,l,(function(e){return function(...a){const s=e.apply(this,a);if(Hi(s,i,this),"tagName"in this.canvas&&!ei(this.canvas,r,o,!0)){const e=zi(a,i,this),r={type:t,property:l,args:e};n(this.canvas,r)}return s}}));a.push(s)}catch{const r=Ko(e,l,{set(e){n(this.canvas,{type:t,property:l,args:[e],setter:!0})}});a.push(r)}return a}const $i='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',Ji="undefined"!=typeof self&&self.Blob&&new Blob([$i],{type:"text/javascript;charset=utf-8"});function Ki(e){let t;try{if(t=Ji&&(self.URL||self.webkitURL).createObjectURL(Ji),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent($i),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Xi{constructor(e){jr(this,"pendingCanvasMutations",new Map),jr(this,"rafStamps",{latestId:0,invokeId:null}),jr(this,"mirror"),jr(this,"mutationCb"),jr(this,"resetObservers"),jr(this,"frozen",!1),jr(this,"locked",!1),jr(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=Gi(t,n,r,!0),a=new Map,s=new Ki;s.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:qr["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const d=e=>{u&&e-u{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{ei(t,n,r,!0)||e.push(t)})),e})().forEach((async e=>{var t;const n=this.mirror.getId(e);if(a.get(n))return;if(0===e.width||0===e.height)return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);s.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))),c=requestAnimationFrame(d)};c=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Gi(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=ro(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return ei(this.canvas,n,r,!0)||setTimeout((()=>{const n=zi(i,t,this);e(this.canvas,{type:qr["2D"],property:a,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch{const n=Ko(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:qr["2D"],property:a,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return void 0!==t.WebGLRenderingContext&&o.push(...Vi(t.WebGLRenderingContext.prototype,qr.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Vi(t.WebGL2RenderingContext.prototype,qr.WebGL2,e,n,r,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class Yi{constructor(e){jr(this,"trackedLinkElements",new WeakSet),jr(this,"mutationCb"),jr(this,"adoptedStyleSheetCb"),jr(this,"styleMirror",new si),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const o of e){let e;this.styleMirror.has(o)?e=this.styleMirror.getId(o):(e=this.styleMirror.add(o),r.push({styleId:e,rules:Array.from(o.rules||CSSRule,((e,t)=>({rule:co(e,o.href),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Zi{constructor(){jr(this,"nodeMap",new WeakMap),jr(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let Qi,ea,ta,na=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Rr=e.contentWindow)?void 0:Rr.Array.from)||Array.from,document.body.removeChild(e)}}catch(Kb){console.debug("Unable to override Array.from",Kb)}const ra=new uo;function oa(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:s=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:h,maskInputFn:f,maskTextFn:g,hooks:m,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:k=!0,recordCanvas:x=!1,recordCrossOriginIframes:S=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:I=!1,inlineImages:D=!1,plugins:A,keepIframeSrcFn:T=(()=>!1),ignoreCSSAttributes:L=new Set([]),errorHandler:F}=e;bi=F;const O=!S||window.parent===window;let M=!1;if(!O)try{window.parent.document&&(M=!1)}catch(V){M=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!M)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),ra.reset();const P=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},R=qo(h);let N;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let j=0;const B=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!M&&(e=v(e)),e};Qi=(e,o)=>{var i;const a=e;if(a.timestamp=no(),!(null==(i=ki[0])?void 0:i.isFrozen())||a.type===Br.FullSnapshot||a.type===Br.IncrementalSnapshot&&a.data.source===_r.Mutation||ki.forEach((e=>e.unfreeze())),O)null==t||t(B(a),o);else if(M){const e={type:"rrweb",event:B(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(a.type===Br.FullSnapshot)N=a,j=0;else if(a.type===Br.IncrementalSnapshot){if(a.data.source===_r.Mutation&&a.data.isAttachIframe)return;j++;const e=r&&j>=r,t=n&&a.timestamp-N.timestamp>n;(e||t)&&ea(!0)}};const _=e=>{Qi({type:Br.IncrementalSnapshot,data:{source:_r.Mutation,...e}})},U=e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.Scroll,...e}}),H=e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.CanvasMutation,...e}}),q=new Yi({mutationCb:_,adoptedStyleSheetCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.AdoptedStyleSheet,...e}})}),z=new Ri({mirror:ra,mutationCb:_,stylesheetManager:q,recordCrossOriginIframes:S,wrappedEmit:Qi});for(const J of A||[])J.getMirror&&J.getMirror({nodeMirror:ra,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});const W=new Zi;ta=new Xi({recordCanvas:x,mutationCb:H,win:window,blockClass:o,blockSelector:i,mirror:ra,sampling:y.canvas,dataURLOptions:b});const G=new Ni({mutationCb:_,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:P,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:x,inlineImages:D,sampling:y,slimDOMOptions:R,iframeManager:z,stylesheetManager:q,canvasManager:ta,keepIframeSrcFn:T,processedNodeManager:W},mirror:ra});ea=(e=!1)=>{if(!k)return;Qi({type:Br.Meta,data:{href:window.location.href,width:Zo(),height:Yo()}},e),q.reset(),G.init(),ki.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new uo,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:p,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return zo(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:s,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:qo(h),dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:ra,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:P,maskTextFn:g,maskInputFn:f,slimDOM:R,dataURLOptions:b,recordCanvas:x,inlineImages:D,onSerialize:e=>{oi(e,ra)&&z.addIframe(e),ii(e,ra)&&q.trackLinkElement(e),ai(e)&&G.addShadowRoot(oo.shadowRoot(e),document)},onIframeLoad:(e,t)=>{z.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!t)return console.warn("Failed to snapshot the document");Qi({type:Br.FullSnapshot,data:{node:t,initialOffset:Xo(window)}},e),ki.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,ra.getId(document))};try{const e=[],t=e=>{var t;return wi(Fi)({mutationCb:_,mousemoveCb:(e,t)=>Qi({type:Br.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.ViewportResize,...e}}),inputCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.Input,...e}}),mediaInteractionCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.MediaInteraction,...e}}),styleSheetRuleCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.StyleSheetRule,...e}}),styleDeclarationCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.StyleDeclaration,...e}}),canvasMutationCb:H,fontCb:e=>Qi({type:Br.IncrementalSnapshot,data:{source:_r.Font,...e}}),selectionCb:e=>{Qi({type:Br.IncrementalSnapshot,data:{source:_r.Selection,...e}})},customElementCb:e=>{Qi({type:Br.IncrementalSnapshot,data:{source:_r.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:s,maskTextClass:l,maskTextSelector:c,maskInputOptions:P,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:D,userTriggeredOnInput:E,collectFonts:I,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:R,dataURLOptions:b,mirror:ra,iframeManager:z,stylesheetManager:q,shadowDomManager:G,processedNodeManager:W,canvasManager:ta,ignoreCSSAttributes:L,plugins:(null==(t=null==A?void 0:A.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Qi({type:Br.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{ea(),e.push(t(document)),na=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(Go("DOMContentLoaded",(()=>{Qi({type:Br.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(Go("load",(()=>{Qi({type:Br.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),na=!1,bi=void 0}}catch($){console.warn($)}}oa.addCustomEvent=(e,t)=>{if(!na)throw new Error("please add custom event after start recording");Qi({type:Br.Custom,data:{tag:e,payload:t}})},oa.freezePage=()=>{ki.forEach((e=>e.freeze()))},oa.takeFullSnapshot=e=>{if(!na)throw new Error("please take full snapshot after start recording");ea(e)},oa.mirror=ra;var ia=Uint8Array,aa=Uint16Array,sa=Uint32Array,la=new ia([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]),ca=new ia([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]),ua=new ia([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),da=function(e,t){for(var n=new aa(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&ya)<<1;ba=(61680&(ba=(52428&ba)>>>2|(13107&ba)<<2))>>>4|(3855&ba)<<4,va[ya]=((65280&ba)>>>8|(255&ba)<<8)>>>1}var wa=function(e,t,n){for(var r=e.length,o=0,i=new aa(t);o>>l]=c}else for(a=new aa(r),o=0;o>>15-e[o];return a},ka=new ia(288);for(ya=0;ya<144;++ya)ka[ya]=8;for(ya=144;ya<256;++ya)ka[ya]=9;for(ya=256;ya<280;++ya)ka[ya]=7;for(ya=280;ya<288;++ya)ka[ya]=8;var xa=new ia(32);for(ya=0;ya<32;++ya)xa[ya]=5;var Sa=wa(ka,9,0),Ca=wa(xa,5,0),Ea=function(e){return(e/8>>0)+(7&e&&1)},Ia=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof aa?aa:e instanceof sa?sa:ia)(n-t);return r.set(e.subarray(t,n)),r},Da=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Aa=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Ta=function(e,t){for(var n=[],r=0;rp&&(p=i[r].s);var h=new aa(p+1),f=La(n[u-1],h,0);if(f>t){r=0;var g=0,m=f-t,v=1<t))break;g+=v-(1<>>=m;g>0;){var b=i[r].s;h[b]=0&&g;--r){var w=i[r].s;h[w]==t&&(--h[w],++g)}f=t}return[new ia(h),f]},La=function(e,t,n){return-1==e.s?Math.max(La(e.l,t,n+1),La(e.r,t,n+1)):t[e.s]=n},Fa=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new aa(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},Oa=function(e,t){for(var n=0,r=0;r>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i4&&!I[ua[A-1]];--A);var T,L,F,O,M=c+5<<3,P=Oa(o,ka)+Oa(i,xa)+a,R=Oa(o,p)+Oa(i,g)+a+14+3*A+Oa(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(M<=P&&M<=R)return Ma(t,u,e.subarray(l,l+c));if(Da(t,u,1+(R15&&(Da(t,u,_[C]>>>5&127),u+=_[C]>>>12)}}}else T=Sa,L=ka,F=Ca,O=xa;for(C=0;C255){U=r[C]>>>18&31;Aa(t,u,T[U+257]),u+=L[U+257],U>7&&(Da(t,u,r[C]>>>23&31),u+=la[U]);var H=31&r[C];Aa(t,u,F[H]),u+=O[H],H>3&&(Aa(t,u,r[C]>>>5&8191),u+=ca[H])}else Aa(t,u,T[r[C]]),u+=L[r[C]];return Aa(t,u,T[256]),u+L[256]},Ra=new sa([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Na=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new ia(r+a+5*(1+Math.floor(a/7e3))+o),l=s.subarray(r,s.length-o),c=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d>>13,f=8191&p,g=(1<7e3||I>24576)&&O>423){c=Pa(e,l,0,k,x,S,E,I,A,u-A,c),I=C=E=0,A=u;for(var M=0;M<286;++M)x[M]=0;for(M=0;M<30;++M)S[M]=0}var P=2,R=0,N=f,j=L-F&32767;if(O>2&&T==w(u-j))for(var B=Math.min(h,O)-1,_=Math.min(32767,u),U=Math.min(258,O);j<=_&&--N&&L!=F;){if(e[u+P]==e[u+P-j]){for(var H=0;HP){if(P=H,R=j,H>B)break;var q=Math.min(j,H-2),z=0;for(M=0;Mz&&(z=G,F=W)}}}j+=(L=F)-(F=m[L])+32768&32767}if(R){k[I++]=268435456|fa[P]<<18|ma[R];var V=31&fa[P],$=31&ma[R];E+=la[V]+ca[$],++x[257+V],++S[$],D=u+P,++C}else k[I++]=e[u],++x[e[u]]}}c=Pa(e,l,i,k,x,S,E,I,A,u-A,c)}return Ia(s,0,r+Ea(c)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)};function ja(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,a=0;a!=i;){for(var s=Math.min(a+5552,i);a>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r,o,i,a=Na(e,t,2,4);return r=a,o=t.level,i=0==o?0:o<6?1:9==o?3:2,r[0]=120,r[1]=i<<6|(i?32-2*i:1),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(a,a.length-4,n.d()),a}const Ba=e=>{const t={...e,v:"v1"};return function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r>10,56320|1023&o))}return n}(ja(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new ia(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;ar.length){var s=new ia(o+8+(n-a<<1));s.set(r),r=s}var l=e.charCodeAt(a);l<128||t?i(l):l<2048?(i(192|l>>>6),i(128|63&l)):l>55295&&l<57344?(i(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),i(128|l>>>12&63),i(128|l>>>6&63),i(128|63&l)):(i(224|l>>>12),i(128|l>>>6&63),i(128|63&l))}return Ia(r,0,o)}(JSON.stringify(t))),!0)};function _a(e){return _a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_a(e)}function Ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ha(e){for(var t=1;t=0)return null;if(function(e){if("password"===Ya(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return za.indexOf(e)>=0}))}(e)||function(e,t){return function(e,t){for(var n=e;n;){if(1===n.nodeType&&t(n))return!0;n=n.parentElement||n.parentNode&&n.parentNode.host||null}return!1}(e,(function(e){return es(e,t)||Za(e,Wa)}))}(e,t))return Xa;if(!function(e,t){var n=ns(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[Ya(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?Xa:function(t){try{return n(t,e)}catch(r){return Xa(t)}}},os=Ga.map((function(e){return':not([type="'+e+'" i])'})).join(""),is=function(e){return String(e).replace(/[\S]/g,"*")},as=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?is:function(e,n){try{var r=t(e,n);return"string"==typeof r?r:is(e)}catch(o){return is(e)}}};function ss(e){return function(e){if(Array.isArray(e))return ls(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ls(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ls(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ls(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]&&arguments[0];if(this.clearIdleStart(),t&&this.startDate){if(this.stopFunction){try{this.stopFunction()}catch(r){}this.stopFunction=void 0}if(this.segments[this.segments.length-1].length>0)for(this.segments.push([]),this.segmentSizes.push(0),this.incrementalSize=0;this.segments.length>3;)this.dropOldestSegment()}else this.stop(),this.startDate=Date.now(),this.resetBuffer();var n={inlineStylesheet:!0,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0},dataURLOptions:{quality:.7},recordCanvas:!1,checkoutEveryNms:3e5,sampling:{scroll:150,mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!0,TouchEnd:!1}},collectFonts:!1,recordCrossOriginIframes:!1};try{this.stopFunction=oa(us(us(us(us({},n),this.customOptions),function(e){var t=function(t,n){var r=rs(n,e);return r?r(t):t};return!0===(e=e||{}).maskAllInputs?{maskInputFn:t}:{maskInputFn:t,maskInputOptions:Ha(Ha({},ns(e)),Ka)}}(this.customOptions)),{},{emit:function(t,n){if(n&&t&&4===t.type)for(e.segments.push([]),e.segmentSizes.push(0),e.incrementalSize=0;e.segments.length>3;)e.dropOldestSegment();var r=ms(t);e.segments[e.segments.length-1].push(t),e.segmentSizes[e.segmentSizes.length-1]+=r,t&&4!==t.type&&2!==t.type&&(e.incrementalSize+=r),e.enforceBufferSize()}}))}catch(r){console.error(r)}}},{key:"startIfNotRunning",value:function(){var e=this;this.stopFunction||this.pausedForCapture||this.cancelIdleStart||(this.cancelIdleStart=function(e,t){if("undefined"!=typeof window&&"function"==typeof window.requestIdleCallback){var n=window.requestIdleCallback(e,{timeout:t});return function(){"function"==typeof window.cancelIdleCallback&&window.cancelIdleCallback(n)}}var r=!1,o=null,i="undefined"!=typeof window&&"function"==typeof window.addEventListener,a=function(){r=!0,clearTimeout(o),i&&window.removeEventListener("load",l)},s=function(){r||(a(),e())},l=function(){clearTimeout(o),o=setTimeout(s,0)};return"undefined"!=typeof document&&"complete"!==document.readyState&&i?(window.addEventListener("load",l),o=setTimeout(s,t)):o=setTimeout(s,0),a}((function(){e.cancelIdleStart=void 0,e.stopFunction||e.pausedForCapture||e.start()}),2e3))}},{key:"clearIdleStart",value:function(){this.cancelIdleStart&&(this.cancelIdleStart(),this.cancelIdleStart=void 0)}},{key:"stop",value:function(){this.clearIdleStart(),this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.pausedForCapture=!1,this.startDate=void 0,this.resetBuffer()}},{key:"pauseForCapture",value:function(){if(!this.stopFunction)return!!this.cancelIdleStart&&(this.clearIdleStart(),this.pausedForCapture=!0,!0);try{this.stopFunction()}catch(e){}return this.stopFunction=void 0,clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.pausedForCapture=!0,!0}},{key:"resumeAfterCapture",value:function(){this.pausedForCapture&&(this.pausedForCapture=!1,this.start(!0))}},{key:"resetBuffer",value:function(){clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.segments=[[]],this.segmentSizes=[0],this.incrementalSize=0}},{key:"dropOldestSegment",value:function(){this.segments.shift(),this.segmentSizes.shift()}},{key:"getBufferSize",value:function(){for(var e=0,t=0;t1&&this.getBufferSize()>gs;)this.dropOldestSegment();this.getBufferSize()>gs&&this.incrementalSize>5242880&&this.scheduleForcedCheckout()}},{key:"scheduleForcedCheckout",value:function(){var e=this;if(!this.forcedCheckoutTimeout){var t=Math.max(0,this.lastForcedCheckout+3e4-Date.now());this.forcedCheckoutTimeout=setTimeout((function(){e.forcedCheckoutTimeout=void 0,e.lastForcedCheckout=Date.now();try{oa.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplaySnapshot",value:function(){var e;return{startDate:this.startDate,events:(e=[]).concat.apply(e,ss(this.segments)),packed:!1,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,ss(this.segments)),n=t,r=!1;try{n=t.map((function(e){return Ba(e)})),r=!0}catch(o){n=t,r=!1}return{startDate:this.startDate,events:n,packed:r,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&ds(t.prototype,n),r&&ds(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();ps(vs,"instance",void 0);const ys=475249515,bs=(e,t,n)=>{const r=e[t];if(!r)return null;let o=1,i=128;for(;!(r&i);)i>>=1,o+=1;if(o>(n?4:8)||t+o>e.length)return null;let a=n?r:r&i-1,s=(r&i-1)==i-1;for(let l=1;l{const n=bs(e,t,!0),r=n&&bs(e,t+n.length,!1);return r?{id:n.value,start:t,idLength:n.length,size:r.value,unknown:r.unknown,dataStart:t+n.length+r.length}:null},ks=(e,t)=>{for(let n=t;n<=8;n++)if(e=0;e--)t[e]=r%256,r=Math.floor(r/256);return t[0]|=128>>n-1,t}return null},xs=(e,t,n)=>{let r=0;for(let o=0;o{let o=r;for(let i=n-1;i>=0;i--)e[t+i]=o%256,o=Math.floor(o/256);return 0===o},Cs=(e,t)=>{const n=[];for(let r=t.dataStart;r8)return null;const o=xs(e,t.dataStart,t.size);if(21419===t.id&&o===ys)return null;21420===t.id&&n.push({pos:t.dataStart,size:t.size,value:o}),r=t.dataStart+t.size}r=t.dataStart+t.size}return n},Es=(e,t)=>{try{if(!(e&&t>0&&"function"==typeof e.slice))return Promise.resolve(e);const n=e.slice(0,Math.min(e.size,65536));return"function"!=typeof n.arrayBuffer?Promise.resolve(e):n.arrayBuffer().then((n=>{try{return((e,t,n)=>{const r=ws(t,0);if(!r||440786851!==r.id||r.unknown)return null;const o=ws(t,r.dataStart+r.size);if(!o||408125543!==o.id)return null;const i=[];let a=null;for(let v=o.dataStart;vt.length)return null;let l=1e6,c=null;for(let v=a.dataStart;vs)return null;2807729===e.id&&e.size>0&&e.size<=6&&(l=xs(t,e.dataStart,e.size)||l),17545===e.id&&(c=e),v=e.dataStart+e.size}const u=1e6*n/l,d=t.slice(),p=e.slice(t.length);if(c){const t=new DataView(d.buffer);if(8===c.size)t.setFloat64(c.dataStart,u);else{if(4!==c.size)return null;t.setFloat32(c.dataStart,u)}return new Blob([d,p],{type:e.type})}const h=new Uint8Array(11);h.set([68,137,136]),new DataView(h.buffer).setFloat64(3,u);const f=ks(a.size+h.length,a.dataStart-a.start-a.idLength);if(!f)return null;const g=new Uint8Array(a.idLength+f.length);g.set(d.subarray(a.start,a.start+a.idLength)),g.set(f,a.idLength);const m=g.length-(a.dataStart-a.start)+h.length;for(let v=0;va.start)return null;for(let t=0;ta.start&&!Ss(d,n.pos,n.size,n.value+m))return null}}if(!o.unknown){const e=o.dataStart-o.start-o.idLength,t=ks(o.size+m,e);if(!t||t.length!==e)return null;d.set(t,o.start+o.idLength)}return new Blob([d.subarray(0,a.start),g,d.subarray(a.dataStart,s),h,d.subarray(s),p],{type:e.type})})(e,new Uint8Array(n),t)||e}catch(r){return e}}),(()=>e))}catch(n){return Promise.resolve(e)}},Is=()=>"undefined"!=typeof performance&&performance.now?performance.now():Date.now(),Ds=()=>new Promise((e=>{try{if("function"==typeof MessageChannel){const t=new MessageChannel;return t.port1.onmessage=()=>{t.port1.onmessage=null;try{t.port1.close(),t.port2.close()}catch(n){}e()},void t.port2.postMessage(0)}}catch(t){}setTimeout(e,0)})),As=e=>{const t=JSON.stringify(e);return void 0===t?null:t},Ts=(e,t)=>{const n=["{"];let r=!0;const o=Object.keys(e),i=o=>{const i=e[o],a=(r?"":",")+JSON.stringify(o)+":";if(Array.isArray(i)&&i.length>50)return r=!1,n.push(a+"["),((e,t,n)=>new Promise(((r,o)=>{let i=0;const a=()=>{try{if(n&&n())return void o(new Error("cancelled"));const s=Is();for(;i25&&i{let r=null;try{r=As(e)}catch(o){}n.push((t?",":"")+(r||"null"))}),t).then((()=>{n.push("]")}));if((e=>!!e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).some((t=>Array.isArray(e[t])&&e[t].length>50)))(i))return r=!1,n.push(a),Ts(i,t).then((e=>{e.forEach((e=>n.push(e)))}));let s=null;try{s=As(i)}catch(l){s=null}return null!==s&&(r=!1,n.push(a+s)),Ds()};return o.reduce(((e,t)=>e.then((()=>i(t)))),Promise.resolve()).then((()=>(n.push("}"),n)))};function Ls(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fs=["video/mp4;codecs=avc3","video/mp4;codecs=avc1","video/mp4","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"],Os=["video/mp4;codecs=avc3,mp4a.40.2","video/mp4;codecs=avc1,mp4a.40.2","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"],Ms=e=>{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}},Ps=e=>{const t={frameRate:{ideal:15,max:30}},n={video:t,audio:!1};let r;e&&(t.displaySurface="browser",n.preferCurrentTab=!0,n.selfBrowserSurface="include",n.surfaceSwitching="include");try{r=navigator.mediaDevices.getDisplayMedia(n)}catch(o){r=Promise.reject(o)}return r.catch((()=>{})),r};class Rs{constructor(e){Ls(this,"stream",null),Ls(this,"micStream",null),Ls(this,"videoTrack",null),Ls(this,"recorder",null),Ls(this,"chunks",[]),Ls(this,"mimeType",""),Ls(this,"timer",null),Ls(this,"startedAt",0),Ls(this,"endedAt",0),Ls(this,"settings",{}),Ls(this,"finished",!1),Ls(this,"recorderStopped",!1),Ls(this,"stopTimeout",null),Ls(this,"onEndedBound",null),Ls(this,"recorderError",null),Ls(this,"pausedAt",0),Ls(this,"pausedMs",0),this.options=e}start(e,t){if(this.stream=e,this.videoTrack=e.getVideoTracks()[0]||null,!this.videoTrack)return Promise.reject(new Error("no-video-track"));try{this.settings=this.videoTrack.getSettings?this.videoTrack.getSettings():{}}catch(n){this.settings={}}return(t?navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}).catch((()=>null)):Promise.resolve(null)).then((e=>{this.micStream=e;const t=e&&e.getAudioTracks()[0]||null;if(this.finished||!this.videoTrack||"ended"===this.videoTrack.readyState)throw this.cleanup(),new Error("stopped-before-start");const r=[this.videoTrack];t&&r.push(t),this.mimeType=(e=>{const t=e?Os.concat(Fs):Fs;try{if("undefined"!=typeof MediaRecorder&&"function"==typeof MediaRecorder.isTypeSupported)for(let e=0;e{try{e.data&&e.data.size>0&&this.chunks.push(e.data)}catch(n){}},this.recorder.onstop=()=>{try{this.recorderStopped=!0,this.finish()}catch(n){}},this.recorder.onerror=e=>{try{this.onRecorderError(e&&e.error||new Error("recorder-error"))}catch(n){}},this.onEndedBound=()=>{try{this.stop()}catch(n){}},this.videoTrack.addEventListener("ended",this.onEndedBound);try{this.recorder.start(1e3)}catch(a){throw this.cleanup(),a}this.startedAt=Date.now();const i=1e3*this.options.maxDurationSec;return this.timer=setInterval((()=>{try{const e=this.activeMs();try{this.options.onTick(Math.floor(e/1e3))}catch(n){}e>=i&&this.stop()}catch(n){}}),250),{hasMicrophone:!!t}}))}activeMs(e){const t=e||Date.now(),n=this.pausedAt?t-this.pausedAt:0;return Math.max(0,t-this.startedAt-this.pausedMs-n)}isPaused(){return!!this.pausedAt}pause(){if(this.finished||this.pausedAt||!this.recorder||"recording"!==this.recorder.state)return!1;try{this.recorder.pause()}catch(e){return!1}return this.pausedAt=Date.now(),!0}resume(){if(this.finished||!this.pausedAt||!this.recorder)return!1;try{"paused"===this.recorder.state&&this.recorder.resume()}catch(e){return!1}return this.pausedMs+=Date.now()-this.pausedAt,this.pausedAt=0,!0}setMicrophoneEnabled(e){try{this.micStream&&this.micStream.getAudioTracks().forEach((t=>{t.enabled=!!e}))}catch(t){}}stop(){if(!this.finished&&!this.stopTimeout)if(this.endedAt=this.endedAt||Date.now(),this.pausedAt&&(this.pausedMs+=this.endedAt-this.pausedAt,this.pausedAt=0),this.clearTimer(),this.recorder&&!this.recorderStopped){try{"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.releaseTracks(),this.stopTimeout=setTimeout((()=>{try{this.finish()}catch(e){}}),3e3)}else this.finish()}onRecorderError(e){this.finished||(this.recorderError=e,this.stop())}finish(){if(this.finished)return;this.finished=!0,this.endedAt=this.endedAt||Date.now();const e=-1!==(this.recorder&&this.recorder.mimeType||this.mimeType||"video/webm").indexOf("mp4")?"video/mp4":"video/webm",t=new Blob(this.chunks,{type:e});this.chunks=[],this.cleanup();const n={blob:t,type:e,fileName:"screen-recording."+("video/mp4"===e?"mp4":"webm"),startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt-this.pausedMs),width:this.settings.width,height:this.settings.height,method:"browser"===this.settings.displaySurface?"tab":"display"};if(0===t.size)return void this.options.onError(this.recorderError||new Error("empty-recording"));const r=e=>{n.blob=e;try{this.options.onStop(n)}catch(t){try{this.options.onError(t)}catch(r){}}};"video/webm"===e?Es(t,n.durationMs).then(r):r(t)}fail(e){if(!this.finished){this.finished=!0,this.chunks=[],this.cleanup();try{this.options.onError(e)}catch(t){}}}cancel(){this.finished=!0,this.chunks=[];try{this.recorder&&"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.cleanup()}clearTimer(){this.timer&&(clearInterval(this.timer),this.timer=null),this.stopTimeout&&(clearTimeout(this.stopTimeout),this.stopTimeout=null)}releaseTracks(){if(this.videoTrack&&this.onEndedBound)try{this.videoTrack.removeEventListener("ended",this.onEndedBound)}catch(e){}if(this.onEndedBound=null,Ms(this.stream),Ms(this.micStream),this.options.onReleased)try{this.options.onReleased()}catch(e){}}cleanup(){this.clearTimer(),this.releaseTracks(),this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null,this.stream=null,this.micStream=null,this.videoTrack=null}}const Ns=e=>e.filter((e=>{if("string"!=typeof e||!e.trim())return!1;try{return document.createDocumentFragment().querySelector(e),!0}catch(t){return!1}})).join(", ")||null,js=e=>{if("function"==typeof CompressionStream&&"function"==typeof Response){const t=JSON.stringify(Object.assign({},e,{v:"v1"}));if(t.length>204800)return new Response(new Blob([t]).stream().pipeThrough(new CompressionStream("deflate"))).arrayBuffer().then((e=>(e=>{let t="";for(let n=0;nnew Promise(((n,r)=>{const o=new Array(e.length);let i=0;const a=()=>{try{if(t&&t())return void r(new Error("cancelled"));const s=Is();for(;i{o[r]=e,a()}),(()=>n(null)));if(o[r]=t,Is()-s>25&&i{try{if(this.finished)return;this.events.push(e),this.size+=ms(e),this.size>26214400&&setTimeout((()=>{try{this.stop()}catch(e){}}),0)}catch(t){}},maskAllInputs:!0,blockClass:e.blockClass||"rr-block",blockSelector:Ns([".rr-block",".gl-block",e.blockSelector].concat(this.options.maskSelectors||[])),maskTextClass:e.maskTextClass||"rr-mask",maskTextSelector:Ns([".rr-mask",".gl-mask",e.maskTextSelector]),inlineStylesheet:!0,recordCanvas:!1,collectFonts:!1,recordCrossOriginIframes:!1,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0},dataURLOptions:{quality:.7},sampling:{scroll:150,input:"last",mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!0,TouchEnd:!1}}})}catch(n){throw this.cleanup(),n}if(!this.stopFunction)throw this.cleanup(),new Error("page-recording-unavailable");const t=1e3*this.options.maxDurationSec;this.timer=setInterval((()=>{try{const n=Date.now()-this.startedAt;try{this.options.onTick(Math.floor(n/1e3))}catch(e){}n>=t&&this.stop()}catch(e){}}),250)}stop(){if(this.finished)return;this.finished=!0,this.endedAt=Date.now(),this.cleanup();const e=this.events;this.events=[];const t=()=>this.cancelled;Bs(e,t).then((n=>Ts({startDate:this.startedAt,events:n||e,packed:!!n,baseUrl:window.location.origin,width:this.width,height:this.height,isMobile:Q(),type:"rrweb"},t))).then((e=>{this.cancelled||this.options.onStop({blob:new Blob(e,{type:"application/json"}),type:"application/json",fileName:"page-recording.json",startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt),width:this.width,height:this.height,method:"rrweb"})})).catch((e=>{if(!this.cancelled)try{this.options.onError(e)}catch(t){}}))}cancel(){this.finished=!0,this.cancelled=!0,this.events=[],this.cleanup()}cleanup(){if(this.timer&&(clearInterval(this.timer),this.timer=null),this.stopFunction){try{this.stopFunction()}catch(e){}this.stopFunction=null}if(this.resumeReplay){this.resumeReplay=!1;try{vs.getInstance().resumeAfterCapture()}catch(e){}}}}const Us=(e,t)=>{const n=String(e||"").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"\u2026":n},Hs=(e,t,n)=>{if(!e||1!==e.nodeType)return"element";const r=e.tagName.toLowerCase(),o=e.getAttribute("role")||("a"===r?"link":r),i=((e,t,n)=>{let r=e;for(;r;){if(1===r.nodeType)try{if(ts(r,t)||es(r,t)||n&&r.matches(n))return!0}catch(o){}r=r.parentElement||r.parentNode&&r.parentNode.host||null}return!1})(e,t,Ns(Array.isArray(n)?n:[]));if("input"===r||"select"===r||"textarea"===r){const t="checkbox"===e.type||"radio"===e.type?e.type:"field";return i?t:t+' "'+(Us((a=e).getAttribute("aria-label")||a.labels&&a.labels[0]&&a.labels[0].textContent||a.getAttribute("placeholder")||a.getAttribute("name")||a.id||a.type||a.tagName.toLowerCase(),60)+'"')}var a;if(i)return o;const s=Us(e.getAttribute("aria-label")||e.getAttribute("title")||e.getAttribute("alt")||e.textContent,60);return s?o+' "'+s+'"':o},qs=e=>{try{const t=new URL(e);return Us(t.pathname+t.search+t.hash,150)}catch(t){return Us(e,150)}};class zs{constructor(e){let{privacyOptions:t,maskSelectors:n,isOwnElement:r}=e;Ls(this,"entries",[]),Ls(this,"startedAt",0),Ls(this,"listeners",[]),Ls(this,"urlTimer",null),Ls(this,"lastUrl",""),Ls(this,"lastInputField",null),Ls(this,"lastInputAt",0),Ls(this,"pauses",[]),this.privacyOptions=t||{},this.maskSelectors=Array.isArray(n)?n:[],this.isOwnElement=r||(()=>!1)}add(e,t,n){if(this.entries.length>=200)return;const r=this.videoTime(n||Date.now());null!==r&&this.entries.push({t:r,type:e,label:Us(t,200)})}pause(e){const t=this.pauses[this.pauses.length-1];t&&!t[1]||this.pauses.push([e||Date.now(),0])}resume(e){const t=this.pauses[this.pauses.length-1];t&&!t[1]&&(t[1]=e||Date.now())}videoTime(e){let t=0;for(let n=0;n=r&&e=o&&(t+=o-r)}return Math.max(0,e-this.startedAt-t)}target(e){try{const t=e.composedPath?e.composedPath():[e.target];for(let e=0;e{e.addEventListener(t,n,{capture:!0,passive:!0}),this.listeners.push((()=>e.removeEventListener(t,n,{capture:!0,passive:!0})))};t(document,"click",(e=>{try{if(this.isOwnElement(e.target))return;const t=this.target(e),n=t?Hs(t,this.privacyOptions,this.maskSelectors):e.target&&e.target.tagName?e.target.tagName.toLowerCase():"page";this.add("click","Clicked "+n)}catch(t){}}));const n=e=>{try{const t=this.target(e);if(!t||this.isOwnElement(e.target))return;const n=Date.now();if(t===this.lastInputField&&n-this.lastInputAt<5e3)return void(this.lastInputAt=n);this.lastInputField=t,this.lastInputAt=n,this.add("input",("change"===e.type?"Changed ":"Typed in ")+Hs(t,this.privacyOptions,this.maskSelectors))}catch(t){}};t(document,"input",n),t(document,"change",n);const r=()=>{try{const e=window.location.href;e!==this.lastUrl&&(this.lastUrl=e,this.add("navigation","Navigated to "+qs(e)))}catch(e){}};t(window,"popstate",r),t(window,"hashchange",r),this.urlTimer=setInterval(r,500)}stop(e){const t=e||Date.now();this.listeners.forEach((e=>{try{e()}catch(t){}})),this.listeners=[],this.urlTimer&&(clearInterval(this.urlTimer),this.urlTimer=null);const n=e=>{const n=new Date(e).getTime();return n>=this.startedAt&&n<=t?n:null};try{up.getInstance().getLogs().forEach((e=>{const t=e&&"ERROR"===e.priority?n(e.date):null;null!==t&&this.add("error",String(e.log||"").split("\n")[0],t)}))}catch(r){}try{kh.getInstance().getRequests().forEach((e=>{if(!e||"RESOURCE"===e.type)return;const t=e.response&&e.response.status,r=!1===e.success||"number"==typeof t&&t>=400?n(e.date):null;null!==r&&this.add("network-error",(e.type||"GET")+" "+qs(e.url)+" \u2192 "+(t||"failed"),r)}))}catch(r){}return this.entries.sort(((e,t)=>e.t-t.t))}get interactions(){return this.entries.filter((e=>"click"===e.type||"input"===e.type)).length}}const Ws=19922944,Gs={consoleLog:!0,networkLogs:!0,customData:!0,metaData:!0,customEventLog:!0,replays:!1},Vs=(e,t)=>"/v3/shared/capture-requests/"+encodeURIComponent(String(e))+"/"+t,$s=e=>{try{return e?JSON.parse(e):null}catch(t){return null}},Js=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((o=>{let i=!1;const a=(e,t)=>{i||(i=!0,o({status:e,data:t}))};try{const o=Bm.getInstance(),i=new XMLHttpRequest;i.open(e,o.apiUrl+t),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.gzip&&i.setRequestHeader("Content-Encoding","gzip"),o.injectSession(i),i.timeout=r.timeoutMs||3e4,i.onreadystatechange=()=>{4===i.readyState&&a(i.status,$s(i.responseText))},i.onerror=()=>a(0,null),i.ontimeout=()=>a(0,null),i.send(void 0===n?null:n)}catch(s){a(0,null)}}))},Ks=(e,t,n)=>Js("POST",Vs(e,t),JSON.stringify(n||{})),Xs=(e,t,n)=>{const r={type:t};return n&&(r.reason=String(n).slice(0,200)),Ks(e,"event",r)},Ys=e=>Ts(e).then((e=>{const t=new Blob(e,{type:"application/json"});return(e=>{try{if("function"==typeof CompressionStream&&"function"==typeof Response&&"function"==typeof e.stream)return new Response(e.stream().pipeThrough(new CompressionStream("gzip"))).blob().catch((()=>null))}catch(t){}return Promise.resolve(null)})(t).then((e=>e?{body:e,gzip:!0,size:e.size}:{body:t,gzip:!1,size:t.size}))})),Zs=e=>(e=>{const t=e.webReplay;return t&&!t.packed&&Array.isArray(t.events)?Bs(t.events).then((n=>n?Object.assign({},e,{webReplay:Object.assign({},t,{events:n,packed:!0})}):e)):Promise.resolve(e)})(e).then((e=>Ys(e))).then((t=>{if(t.size<=Ws)return t;if(!e.webReplay)return null;const n=Object.assign({},e);return delete n.webReplay,Ys(n).then((e=>e.size<=Ws?e:null))})),Qs=(e,t)=>Zs(t).then((t=>{return t?Js("POST",Vs(e,"logs"),t.body,{gzip:t.gzip,timeoutMs:(n=t.size,3e4+1e3*Math.ceil((n||0)/65536))}):{status:413,data:null};var n})),el=e=>{const t=Object.assign({},Gs);return e&&"object"==typeof e&&Object.keys(Gs).forEach((n=>{"boolean"==typeof e[n]&&(t[n]=e[n])})),t},tl=(e,t,n,r)=>{if(!Array.isArray(e))return[];if(!t)return e.slice();const o=Array.isArray(r)?r:[];return e.filter((e=>{const r=(e=>{if(!e)return NaN;const t=e.date;return t instanceof Date?t.getTime():"string"==typeof t||"number"==typeof t?new Date(t).getTime():NaN})(e);return isNaN(r)||r>=t&&r<=n&&!((e,t)=>t.some((t=>Array.isArray(t)&&e>=t[0]&&(!t[1]||e0&&void 0!==arguments[0]?arguments[0]:{};const t=el(e.include),n=Date.now(),r=e.windowEnd||n,o=e.windowStart?e.windowStart-1e4:0,i={},a=(e,t)=>{try{i[e]=t()}catch(n){}};if(t.consoleLog&&a("consoleLog",(()=>tl(up.getInstance().getLogs(),o,r,e.pauses))),t.networkLogs&&a("networkLogs",(()=>tl(kh.getInstance().getRequests(),o,r,e.pauses))),t.customData&&a("customData",(()=>xp.getInstance().getCustomData())),t.metaData&&a("metaData",(()=>Uv.getInstance().getMetaData())),t.customEventLog&&a("customEventLog",(()=>tl(Ky.getInstance().getEventArray(),o,r,e.pauses))),t.replays&&(()=>{try{const e=Rd.getInstance().getFlowConfig();return!(!e||!e.enableWebReplays)}catch(e){return!1}})())try{const e=vs.getInstance().getReplaySnapshot();e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0&&(i.webReplay=e)}catch(l){}let s=e.windowStart;if(!s)try{s=Uv.getInstance().sessionStart.getTime()}catch(l){s=n}return i.capturedAt=new Date(n).toISOString(),i.windowStart=new Date(s).toISOString(),i.windowEnd=new Date(r).toISOString(),i.platform=dr,i.sdkType=ur,i.sdkVersion=vr(),e.deviceId&&(i.deviceId=e.deviceId),i};"p".charCodeAt(0),"H".charCodeAt(0),"Y".charCodeAt(0),"s".charCodeAt(0);const rl="[modern-screenshot]",ol="undefined"!=typeof window,il=ol&&"Worker"in window,al=(ol&&window,ol&&window,ol?window.navigator?.userAgent:""),sl=al.includes("Chrome"),ll=al.includes("AppleWebKit")&&!sl,cl=al.includes("Firefox"),ul=e=>e&&"__CONTEXT__"in e,dl=e=>"CSSFontFaceRule"===e.constructor.name,pl=e=>"CSSImportRule"===e.constructor.name,hl=e=>"CSSLayerBlockRule"===e.constructor.name,fl=e=>1===e.nodeType,gl=e=>"object"==typeof e.className,ml=e=>"image"===e.tagName,vl=e=>"use"===e.tagName,yl=e=>fl(e)&&void 0!==e.style&&!gl(e),bl=e=>8===e.nodeType,wl=e=>3===e.nodeType,kl=e=>"IMG"===e.tagName,xl=e=>"VIDEO"===e.tagName,Sl=e=>"CANVAS"===e.tagName,Cl=e=>"TEXTAREA"===e.tagName,El=e=>"INPUT"===e.tagName,Il=e=>"STYLE"===e.tagName,Dl=e=>"SCRIPT"===e.tagName,Al=e=>"SELECT"===e.tagName,Tl=e=>"SLOT"===e.tagName,Ll=e=>"IFRAME"===e.tagName,Fl=(...e)=>console.warn(rl,...e);function Ol(e){const t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),Boolean(t)&&"toDataURL"in t&&Boolean(t.toDataURL("image/webp").includes("image/webp"))}const Ml=e=>e.startsWith("data:");function Pl(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(ol&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;if(!ol)return e;const n=Rl().implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}function Rl(e){return(e&&fl(e)?e?.ownerDocument:e)??window.document}const Nl="http://www.w3.org/2000/svg";function jl(e,t,n){const r=Rl(n).createElementNS(Nl,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function Bl(e,t){let n=(new XMLSerializer).serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function _l(e,t){return new Promise(((n,r)=>{const o=new FileReader;o.onload=()=>n(o.result),o.onerror=()=>r(o.error),o.onabort=()=>r(new Error(`Failed read blob to ${t}`)),"dataUrl"===t?o.readAsDataURL(e):"arrayBuffer"===t&&o.readAsArrayBuffer(e)}))}const Ul=e=>_l(e,"dataUrl");function Hl(e,t){const n=Rl(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function ql(e,t){return new Promise((n=>{const{timeout:r,ownerDocument:o,onError:i,onWarn:a}=t??{},s="string"==typeof e?Hl(e,Rl(o)):e;let l=null,c=null;function u(){n(s),l&&clearTimeout(l),c?.()}if(r&&(l=setTimeout(u,r)),xl(s)){const e=s.currentSrc||s.src;if(!e)return s.poster?ql(s.poster,t).then(n):u();if(s.readyState>=2)return u();const r=u,o=t=>{a?.("Failed video load",e,t),i?.(t),u()};c=()=>{s.removeEventListener("loadeddata",r),s.removeEventListener("error",o)},s.addEventListener("loadeddata",r,{once:!0}),s.addEventListener("error",o,{once:!0})}else{const e=ml(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();const t=async()=>{if(kl(s)&&"decode"in s)try{await s.decode()}catch(t){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||e,t)}u()},n=t=>{a?.("Failed image load",s.dataset.originalSrc||e,t),u()};if(kl(s)&&s.complete)return t();c=()=>{s.removeEventListener("load",t),s.removeEventListener("error",n)},s.addEventListener("load",t,{once:!0}),s.addEventListener("error",n,{once:!0})}}))}const zl=function(){let e=0;return()=>(e+=1,`u${`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4)}${e}`)}();function Wl(e){return e?.split(",").map((e=>e.trim().replace(/"|'/g,"").toLowerCase())).filter(Boolean)}let Gl=0;function Vl(e){const t=`${rl}[#${Gl}]`;return Gl++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&Fl(...t)}}async function $l(e,t){return ul(e)?e:Jl(e,{...t,autoDestruct:!0})}async function Jl(e,t){const{scale:n=1,workerUrl:r,workerNumber:o=1}=t||{},i=Boolean(t?.debug),a=t?.features??!0,s=e.ownerDocument??(ol?window.document:void 0),l=e.ownerDocument?.defaultView??(ol?window:void 0),c=new Map,u={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:(d=t?.fetch?.bypassingCache,{cache:d?"no-cache":"force-cache"}),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:o,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Vl(i),node:e,ownerDocument:s,ownerWindow:l,dpi:1===n?null:96*n,svgStyleElement:Kl(s),svgDefsElement:s?.createElementNS(Nl,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:il&&r&&o?o:0})].map((()=>{try{const e=new Worker(r);return e.onmessage=async e=>{const{url:t,result:n}=e.data;n?c.get(t)?.resolve?.(n):c.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{const{url:t}=e.data;c.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn("Failed to new Worker",e),null}})).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Ol(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:c,drawImageCount:0,tasks:[],features:a,isEnable:e=>"restoreScrollPosition"===e?"boolean"!=typeof a&&(a[e]??!1):"boolean"==typeof a?a:a[e]??!0,shadowRoots:[]};var d;u.log.time("wait until load"),await async function(e,t){yl(e)&&(kl(e)||xl(e)?await ql(e,t):await Promise.all(["img","video"].flatMap((n=>Array.from(e.querySelectorAll(n)).map((e=>ql(e,t)))))))}(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd("wait until load");const{width:p,height:h}=function(e,t){let{width:n,height:r}=t;if(fl(e)&&(!n||!r)){const t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute("width"))||0,r=r||t.height||Number(e.getAttribute("height"))||0}return{width:n,height:r}}(e,u);return u.width=p,u.height=h,u}function Kl(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode("\n.______background-clip--text {\n background-clip: text;\n -webkit-background-clip: text;\n}\n");return t.appendChild(n),t}async function Xl(e,t){const{log:n,timeout:r,drawImageCount:o,drawImageInterval:i}=t;n.time("image to canvas");const a=await ql(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:l}=function(e,t){const{width:n,height:r,scale:o,backgroundColor:i,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*o),s.height=Math.floor(r*o),s.style.width=`${n}px`,s.style.height=`${r}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));const l=s.getContext("2d");l&&i&&(l.fillStyle=i,l.fillRect(0,0,s.width,s.height));return{canvas:s,context2d:l}}(e.ownerDocument,t),c=()=>{try{l?.drawImage(a,0,0,s.width,s.height)}catch(e){t.log.warn("Failed to drawImage",e)}};if(c(),t.isEnable("fixSvgXmlDecode"))for(let u=0;u{setTimeout((()=>{l?.clearRect(0,0,s.width,s.height),c(),e()}),u+i)}));return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Yl(e,t){if(e.ownerDocument)try{const t=e.toDataURL();if("data:,"!==t)return Hl(t,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}const n=e.cloneNode(!1),r=e.getContext("2d"),o=n.getContext("2d");try{return r&&o&&o.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function Zl(e,t){return Sl(e)?Yl(e,t):Ll(e)?function(e,t){try{if(e?.contentDocument?.documentElement)return cc(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}(e,t):kl(e)?function(e){const t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager"),t}(e):xl(e)?async function(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Hl(e.poster,e.ownerDocument);const n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);const r=n.ownerDocument;if(r){let i=!0;if(await ql(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?Hl(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise((e=>{n.addEventListener("seeked",e,{once:!0})}));const a=r.createElement("canvas");a.width=e.offsetWidth,a.height=e.offsetHeight;try{const e=a.getContext("2d");e&&e.drawImage(n,0,0,a.width,a.height)}catch(o){return t.log.warn("Failed to clone video",o),e.poster?Hl(e.poster,e.ownerDocument):n}return Yl(a,t)}return n}(e,t):e.cloneNode(!1)}const Ql=["width","height","-webkit-text-fill-color"],ec=["stroke","fill"];function tc(e,t,n){const{defaultComputedStyles:r}=n,o=e.nodeName.toLowerCase(),i=gl(e)&&"svg"!==o,a=i?ec.map((t=>[t,e.getAttribute(t)])).filter((([,e])=>null!==e)):[],s=[i&&"svg",o,a.map(((e,t)=>`${e}=${t}`)).join(","),t].filter(Boolean).join(":");if(r.has(s))return r.get(s);const l=function(e){let t=e.sandbox;if(!t){const{ownerDocument:r}=e;try{r&&(t=r.createElement("iframe"),t.id=`__SANDBOX__${zl()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",r.body.appendChild(t),t.srcdoc='',e.sandbox=t)}catch(n){e.log.warn("Failed to getSandBox",n)}}return t}(n),c=l?.contentWindow;if(!c)return new Map;const u=c?.document;let d,p;i?(d=u.createElementNS(Nl,"svg"),p=d.ownerDocument.createElementNS(d.namespaceURI,o),a.forEach((([e,t])=>{p.setAttributeNS(null,e,t)})),d.appendChild(p)):d=p=u.createElement(o),p.textContent=" ",u.body.appendChild(d);const h=c.getComputedStyle(p,t),f=new Map;for(let g=h.length,m=0;mr.set(t,e)));function a(n){const a=e.getPropertyValue(n),s=e.getPropertyPriority(n),l=n.lastIndexOf("-"),c=l>-1?n.substring(0,l):void 0;if(c){let e=i.get(c);e||(e=new Map,i.set(c,e)),e.set(n,[a,s])}(t.get(n)!==a||s)&&(c?o.push(c):r.set(n,[a,s]))}return r}const rc=["::before","::after"],oc=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];const ic=new Set(["symbol"]);async function ac(e,t,n,r,o){if(fl(n)&&(Il(n)||Dl(n)))return;if(r.filter&&!r.filter(n))return;ic.has(t.nodeName)||ic.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;const i=await cc(n,r,!1,o);r.isEnable("restoreScrollPosition")&&function(e,t){if(!yl(e)||!yl(t))return;const{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;const{transform:o}=t.style,i=new DOMMatrix(o),{a,b:s,c:l,d:c}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-r,-n),i.a=a,i.b=s,i.c=l,i.d=c,t.style.transform=i.toString()}(e,i),t.appendChild(i)}async function sc(e,t,n,r){let o=e.firstChild;fl(e)&&e.shadowRoot&&(o=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=o;i;i=i.nextSibling)if(!bl(i))if(fl(i)&&Tl(i)&&"function"==typeof i.assignedNodes){const o=i.assignedNodes();for(let i=0;i{c.delete(t)}));const u=nc(l,c,i);u.delete("transition-property"),u.delete("all"),u.delete("d"),u.delete("content"),n&&(u.delete("position"),u.delete("margin-top"),u.delete("margin-right"),u.delete("margin-bottom"),u.delete("margin-left"),u.delete("margin-block-start"),u.delete("margin-block-end"),u.delete("margin-inline-start"),u.delete("margin-inline-end"),u.set("box-sizing",["border-box",""])),"text"===u.get("background-clip")?.[0]&&t.classList.add("______background-clip--text"),sl&&(u.has("font-kerning")||u.set("font-kerning",["normal",""]),"hidden"!==u.get("overflow-x")?.[0]&&"hidden"!==u.get("overflow-y")?.[0]||"ellipsis"!==u.get("text-overflow")?.[0]||e.scrollWidth!==e.clientWidth||u.set("text-overflow",["clip",""]));for(let d=s.length,p=0;p{s.setProperty(n,e,t)})),u}(e,r,n,t);n&&function(e,t){const{backgroundColor:n,width:r,height:o,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),r&&a.setProperty("width",`${r}px`,"important"),o&&a.setProperty("height",`${o}px`,"important"),i)for(const s in i)a[s]=i[s]}(r,t);let i=!1;if(t.isEnable("copyScrollbar")){const t=[o.get("overflow-x")?.[0],o.get("overflow-y")?.[0]];i=t.includes("scroll")||(t.includes("auto")||t.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const l=o.get("text-transform")?.[0],c=Wl(o.get("font-family")?.[0]),u=c?e=>{"uppercase"===l?e=e.toUpperCase():"lowercase"===l?e=e.toLowerCase():"capitalize"===l&&(e=e[0].toUpperCase()+e.substring(1)),c.forEach((t=>{let n=a.get(t);n||a.set(t,n=new Set),e.split("").forEach((e=>n.add(e)))}))}:void 0;return function(e,t,n,r,o){const{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:l}=r;function c(n){const a=i.getComputedStyle(e,n);let c=a.getPropertyValue("content");if(!c||"none"===c)return;o?.(c),c=c.replace(/(')|(")|(counter\(.+\))/g,"");const u=[zl()],d=tc(e,n,r);l?.forEach(((e,t)=>{d.delete(t)}));const p=nc(a,d,r.includeStyleProperties);p.delete("content"),p.delete("-webkit-locale"),"text"===p.get("background-clip")?.[0]&&t.classList.add("______background-clip--text");const h=[`content: '${c}';`];if(p.forEach((([e,t],n)=>{h.push(`${n}: ${e}${t?" !important":""};`)})),1===h.length)return;try{t.className=[t.className,...u].join(" ")}catch(Kb){return void r.log.warn("Failed to copyPseudoClass",Kb)}const f=h.join("\n ");let g=s.get(f);g||(g=[],s.set(f,g)),g.push(`.${u[0]}${n}`)}a&&i&&(rc.forEach(c),n&&oc.forEach(c))}(e,r,i,t,u),function(e,t){(Cl(e)||El(e)||Al(e))&&t.setAttribute("value",e.value)}(e,r),xl(e)||await sc(e,r,t,u),await(s?.(r)),r}const l=e.cloneNode(!1);return await sc(e,l,t),await(s?.(l)),l}function uc(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(Kb){e.log.warn("Failed to destroyContext",Kb)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function dc(e,t){const{url:n,requestType:r="text",responseType:o="text",imageDom:i}=t;let a=n;const{timeout:s,acceptOfImage:l,requests:c,fetchFn:u,fetch:{requestInit:d,bypassingCache:p,placeholderImage:h},font:f,workers:g,fontFamilies:m}=e;"image"===r&&(ll||cl)&&e.drawImageCount++;let v=c.get(n);if(!v){p&&p instanceof RegExp&&p.test(a)&&(a+=(/\?/.test(a)?"&":"?")+(new Date).getTime());const t=r.startsWith("font")&&f&&f.minify,y=new Set;if(t){r.split(";")[1].split(",").forEach((e=>{m.has(e)&&m.get(e).forEach((e=>y.add(e)))}))}const b=t&&y.size,w={url:a,timeout:s,responseType:b?"arrayBuffer":o,headers:"image"===r?{accept:l}:void 0,...d};v={type:r,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(u&&"image"===r){const e=await u(n);if(e)return e}return!ll&&n.startsWith("http")&&g.length?new Promise(((e,t)=>{g[c.size&g.length-1].postMessage({rawUrl:n,...w}),v.resolve=e,v.reject=t})):function(e){const{url:t,timeout:n,responseType:r,...o}=e,i=new AbortController,a=n?setTimeout((()=>i.abort()),n):void 0;return fetch(t,{signal:i.signal,...o}).then((e=>{if(!e.ok)throw new Error("Failed fetch, not 2xx response",{cause:e});switch(r){case"arrayBuffer":return e.arrayBuffer();case"dataUrl":return e.blob().then(Ul);default:return e.text()}})).finally((()=>clearTimeout(a)))}(w)})().catch((t=>{if(c.delete(n),"image"===r&&h)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),"string"==typeof h?h:h(i);throw t})),c.set(n,v)}return v.response}async function pc(e,t,n,r){if(!hc(e))return e;for(const[i,a]of function(e,t){const n=[];return e.replace(fc,((e,r,o)=>(n.push([o,Pl(o,t)]),e))),n.filter((([e])=>!Ml(e)))}(e,t))try{const t=await dc(n,{url:a,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(gc(i),`$1${t}$3`)}catch(o){n.log.warn("Failed to fetch css data url",i,o)}return e}function hc(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}const fc=/url\((['"]?)([^'"]+?)\1\)/g;function gc(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}const mc=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function vc(e,t){const{tasks:n}=t;fl(e)&&((kl(e)||ml(e))&&n.push(...function(e,t){if(kl(e)){const n=e.currentSrc||e.src;if(!Ml(n))return[dc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.srcset="",e.dataset.originalSrc=n,e.src=t||"")}))];(ll||cl)&&t.drawImageCount++}else if(gl(e)&&!Ml(e.href.baseVal)){const n=e.href.baseVal;return[dc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||"")}))]}return[]}(e,t)),vl(e)&&n.push(...function(e,t){const{ownerDocument:n,svgDefsElement:r}=t,o=e.getAttribute("href")??e.getAttribute("xlink:href");if(!o)return[];const[i,a]=o.split("#");if(a){const o=`#${a}`,s=t.shadowRoots.reduce(((e,t)=>e??t.querySelector(`svg ${o}`)),n?.querySelector(`svg ${o}`));if(i&&e.setAttribute("href",o),r?.querySelector(o))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(i)return[dc(t,{url:i,responseType:"text"}).then((e=>{r?.insertAdjacentHTML("beforeend",e)}))]}return[]}(e,t))),yl(e)&&n.push(...function(e,t){return mc.map((n=>{const r=e.getPropertyValue(n);return r&&"none"!==r?((ll||cl)&&t.drawImageCount++,pc(r,null,t,!0).then((t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))):null})).filter(Boolean)}(e.style,t)),e.childNodes.forEach((e=>{vc(e,t)}))}async function yc(e,t){const{ownerDocument:n,svgStyleElement:r,fontFamilies:o,fontCssTexts:i,tasks:a,font:s}=t;if(n&&r&&o.size)if(s&&s.cssText){const e=Sc(s.cssText,t);r.appendChild(n.createTextNode(`${e}\n`))}else{const e=Array.from(n.styleSheets).filter((e=>{try{return"cssRules"in e&&Boolean(e.cssRules.length)}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}})),s=n.implementation.createHTMLDocument(""),l=s.createElement("style");s.head.appendChild(l);const c=l.sheet;await Promise.all(e.flatMap((e=>Array.from(e.cssRules).map((async e=>{if(pl(e)){const r=e.href;let o="";try{o=await dc(t,{url:r,requestType:"text",responseType:"text"})}catch(n){t.log.warn(`Error fetch remote css import from ${r}`,n)}const i=o.replace(fc,((e,t,n)=>e.replace(n,Pl(n,r))));for(const e of function(e){if(null==e)return[];const t=[];let n=e.replace(bc,"");for(;;){const e=wc.exec(n);if(!e)break;t.push(e[0])}n=n.replace(wc,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let e=r.exec(n);if(e)o.lastIndex=r.lastIndex;else{if(e=o.exec(n),!e)break;r.lastIndex=o.lastIndex}t.push(e[0])}return t}(i))try{c.insertRule(e,c.cssRules.length)}catch(n){t.log.warn("Error inserting rule from remote css import",{rule:e,error:n})}}}))))),c.cssRules.length&&e.push(c);const u=[];e.forEach((e=>{Cc(e.cssRules,u)})),u.filter((e=>dl(e)&&hc(e.style.getPropertyValue("src"))&&Wl(e.style.getPropertyValue("font-family"))?.some((e=>o.has(e))))).forEach((e=>{const o=e,s=i.get(o.cssText);s?r.appendChild(n.createTextNode(`${s}\n`)):a.push(pc(o.cssText,o.parentStyleSheet?o.parentStyleSheet.href:null,t).then((e=>{e=Sc(e,t),i.set(o.cssText,e),r.appendChild(n.createTextNode(`${e}\n`))})))}))}}const bc=/(\/\*[\s\S]*?\*\/)/g,wc=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;const kc=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,xc=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Sc(e,t){const{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(xc,(e=>{for(;;){const[t,,n]=kc.exec(e)||[];if(!n)return"";if(n===r)return`src: ${t};`}})):e}function Cc(e,t=[]){for(const n of Array.from(e))hl(n)?t.push(...Cc(n.cssRules)):"cssRules"in n?Cc(n.cssRules,t):t.push(n);return t}const Ec=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;async function Ic(e,t){const n=await $l(e,t);if(fl(n.node)&&gl(n.node)&&!function(e){return Ec.test(e.innerHTML)}(n.node))return n.node;const{ownerDocument:r,log:o,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:l,font:c,progress:u,autoDestruct:d,onCloneNode:p,onEmbedNode:h,onCreateForeignObjectSvg:f}=n;o.time("clone node");const g=await cc(n.node,n,!0);if(a&&r){let e="";l.forEach(((t,n)=>{e+=`${t.join(",\n")} {\n ${n}\n}\n`})),a.appendChild(r.createTextNode(e))}o.timeEnd("clone node"),await(p?.(g)),!1!==c&&fl(g)&&(o.time("embed web font"),await yc(0,n),o.timeEnd("embed web font")),o.time("embed node"),vc(g,n);const m=i.length;let v=0;u?.(v,m),await Promise.all([...Array.from({length:4})].map((async()=>{for(;;){const t=i.pop();if(!t)break;try{await t}catch(e){n.log.warn("Failed to run task",e)}u?.(++v,m)}}))),o.timeEnd("embed node"),await(h?.(g));const y=function(e,t){const{width:n,height:r}=t,o=jl(n,r,e.ownerDocument),i=o.ownerDocument.createElementNS(o.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),o.appendChild(i),o}(g,n);return s&&y.insertBefore(s,y.children[0]),a&&y.insertBefore(a,y.children[0]),d&&uc(n),await(f?.(y)),y}async function Dc(e,t){const n=await $l(e,t),r=await Ic(n),o=Bl(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=Kl(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Nl,"defs"),n.svgStyles.clear());const i=Hl(o,r.ownerDocument);return await Xl(i,n)}const Ac=2560,Tc="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Lc="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(''),Fc=e=>e?Lc:Tc,Oc=[".gleap-frame-container",".bb-feedback-button",".gleap-notification-container",".gleap-chatbar",".gleap-capture-root",".gleap-image-view",".bb-capture-editor",".gleap-b",".gleap-modal-wrapper",".gleap-tooltip",".gleap-tour-popover",".gleap-tour-overlay","#copilot-pointer-container","#copilot-joined-container",".gleap-audio-unmute-modal-overlay",".gleap-admin-frame-container",".gleap-admin-collapse-ui",".click-wave"].join(", "),Mc=["stripe.com","stripe.network","braintreegateway.com","braintree-api.com","paypal.com","adyen.com","adyenpayments.com","checkout.com","squareup.com","squareupsandbox.com","recurly.com","chargebee.com","paddle.com","mollie.com","klarna.com","worldpay.com","authorize.net","razorpay.com","2checkout.com","cybersource.com","spreedly.com","gocardless.com","payu.com","mercadopago.com","paystack.co","flutterwave.com"],Pc=new RegExp("(^|\\.)("+Mc.map((e=>e.replace(/\./g,"\\."))).join("|")+")$","i"),Rc=["card","payment","cvc","cvv","security code","expir","iban"],Nc=new RegExp(Rc.join("|"),"i"),jc=()=>{const e=['iframe[allow*="payment" i]'];return Rc.forEach((t=>{e.push('iframe[title*="'+t+'" i]','iframe[name*="'+t+'" i]')})),Mc.forEach((t=>{e.push('iframe[src*="//'+t+'" i]','iframe[src*=".'+t+'" i]')})),e.join(", ")},Bc=e=>new Promise((t=>setTimeout(t,e))),_c=(e,t,n)=>new Promise(((r,o)=>{const i=setTimeout((()=>o(new Error(n||"timeout"))),t);e.then((e=>{clearTimeout(i),r(e)}),(e=>{clearTimeout(i),o(e)}))})),Uc=e=>{try{if("undefined"!=typeof CSS&&"function"==typeof CSS.escape)return CSS.escape(e)}catch(t){}return String(e).replace(/[^a-zA-Z0-9_-]/g,(e=>"\\"+e))},Hc=e=>{if("string"!=typeof e||0===e.trim().length)return null;try{return document.createDocumentFragment().querySelector(e),e.trim()}catch(t){return null}},qc=(e,t)=>{const n=e||{},r=[".rr-block, .gl-block, .rr-mask, .gl-mask"];return[n.blockSelector,n.maskTextSelector].concat(Array.isArray(t)?t:[]).forEach((e=>{const t=Hc(e);t&&r.push(t)})),[n.blockClass,n.maskTextClass].forEach((e=>{if("string"==typeof e&&e.length>0){const t=Hc("."+Uc(e));t&&r.push(t)}})),r},zc=e=>{const t=e||{};return[t.blockClass,t.maskTextClass].filter((e=>e&&"function"==typeof e.test))},Wc=(e,t)=>{if(!t.length||!e.classList)return!1;for(let n=0;n{try{return!!(e&&e.matches&&e.matches(Oc))}catch(t){return!1}},Vc=e=>{try{return!!(e&&e.closest&&e.closest(Oc))}catch(t){return!1}},$c=e=>{try{if(-1!==(e.getAttribute("allow")||"").toLowerCase().indexOf("payment"))return!0;const t=(e.getAttribute("title")||"")+" "+(e.getAttribute("name")||"");if(Nc.test(t))return!0;const n=e.getAttribute("src");if(n)return Pc.test(new URL(n,window.location.href).hostname)}catch(t){}return!1},Jc=e=>{let t=null;try{t=e.getBoundingClientRect()}catch(n){}try{const n=(e.ownerDocument||document).createRange();n.selectNodeContents(e),t=((e,t)=>{if(!e||e.width<=0||e.height<=0)return t;if(!t||t.width<=0||t.height<=0)return e;const n=Math.min(e.left,t.left),r=Math.min(e.top,t.top);return{left:n,top:r,width:Math.max(e.left+e.width,t.left+t.width)-n,height:Math.max(e.top+e.height,t.top+t.height)-r}})(t,n.getBoundingClientRect())}catch(n){}return t},Kc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[],n={},r=e.privacyOptions||{},o=((e,t)=>qc(e,t).join(", "))(r,e.maskSelectors),i=zc(r),a=(e,r)=>{if(!(e&&e.width>0&&e.height>0))return;let o=e.left+r.x,i=e.top+r.y,a=o+e.width,s=i+e.height;r.clip&&(o=Math.max(o,r.clip.left),i=Math.max(i,r.clip.top),a=Math.min(a,r.clip.right),s=Math.min(s,r.clip.bottom));const l=[o,i,a,s].join(",");a>o&&s>i&&!n[l]&&(n[l]=!0,t.push({x:o,y:i,width:a-o,height:s-i}))},s=(e,t,n)=>{if(!e||n>8)return;const l=(t,n)=>{let r=[];try{r=e.querySelectorAll(t)}catch(o){}for(let e=0;ea(Jc(e),t))),l("input, textarea, select",(e=>{((e,t)=>{try{return!!rs(e,t)}catch(n){return!0}})(e,r)&&a(e.getBoundingClientRect(),t)})),l("iframe, frame",(e=>{const r=e.getBoundingClientRect();if($c(e))return void a(r,t);let o=null;try{o=e.contentDocument}catch(i){}if(o&&o.documentElement&&r.width>0&&r.height>0){const i=t.x+r.left+(e.clientLeft||0),a=t.y+r.top+(e.clientTop||0);let l={left:t.x+r.left,top:t.y+r.top,right:t.x+r.right,bottom:t.y+r.bottom};t.clip&&(l={left:Math.max(l.left,t.clip.left),top:Math.max(l.top,t.clip.top),right:Math.min(l.right,t.clip.right),bottom:Math.min(l.bottom,t.clip.bottom)}),s(o,{x:i,y:a,clip:l},n+1)}}));try{const r=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>Gc(e)?2:1});let o=r.nextNode();for(;o;)o.shadowRoot&&s(o.shadowRoot,t,n+1),i.length&&Wc(o,i)&&a(Jc(o),t),o=r.nextNode()}catch(c){}};return s(document,{x:0,y:0,clip:null},0),t},Xc=(e,t)=>{const n=document.createElement("canvas");return n.width=Math.max(1,Math.round(e)),n.height=Math.max(1,Math.round(t)),n},Yc=e=>{try{e&&(e.width=0,e.height=0)}catch(t){}},Zc=e=>{try{const t=48,n=Xc(t,t),r=n.getContext("2d");r.drawImage(e,0,0,t,t);const o=r.getImageData(0,0,t,t).data;Yc(n);let i=!0,a=!0;for(let e=0;e0&&(i=!1,(o[e]>12||o[e+1]>12||o[e+2]>12)&&(a=!1));return i?"transparent":a?"black":"content"}catch(t){return"content"}},Qc=e=>{let{canvas:t,scaleX:n,scaleY:r,rects:o,background:i}=e;const a=Math.max(t.width,t.height),s=a>Ac?Ac/a:1,l=Xc(t.width*s,t.height*s),c=l.getContext("2d");c.fillStyle=i||"#ffffff",c.fillRect(0,0,l.width,l.height),c.imageSmoothingEnabled=!0;try{c.imageSmoothingQuality="high"}catch(d){}c.drawImage(t,0,0,l.width,l.height),((e,t,n,r)=>{e.save(),e.fillStyle="#000000";for(let o=0;o{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}},tu=()=>{let e;try{e=navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude",monitorTypeSurfaces:"exclude"})}catch(t){e=Promise.reject(t)}return e.catch((()=>{})),e},nu=(e,t)=>("function"!=typeof ImageCapture?Promise.resolve(null):_c(new ImageCapture(e).grabFrame(),3e3,"grab-timeout").then((e=>e&&e.width>0?{source:e,width:e.width,height:e.height,release:()=>e.close&&e.close()}:null),(()=>null))).then((t=>t||(()=>{if("function"!=typeof MediaStreamTrackProcessor)return Promise.resolve(null);let t=null;const n=()=>{try{t&&t.cancel()}catch(e){}};try{t=new MediaStreamTrackProcessor({track:e}).readable.getReader()}catch(r){return Promise.resolve(null)}return _c(t.read(),3e3,"read-timeout").then((e=>{n();const t=e&&e.value;return t?{source:t,width:t.displayWidth||t.codedWidth,height:t.displayHeight||t.codedHeight,release:()=>t.close()}:null}),(()=>(n(),null)))})())).then((e=>e||(()=>{const e=document.createElement("video");e.muted=!0,e.playsInline=!0,e.srcObject=t;const n=()=>{try{e.pause(),e.srcObject=null}catch(t){}},r=new Promise((t=>{"function"==typeof e.requestVideoFrameCallback?e.requestVideoFrameCallback((()=>t())):e.addEventListener("loadeddata",(()=>setTimeout(t,60)),{once:!0})}));return _c(Promise.resolve(e.play()),3e3,"play-timeout").then((()=>_c(r,3e3,"frame-timeout"))).then((()=>({source:e,width:e.videoWidth,height:e.videoHeight,release:n})),(e=>{throw n(),e}))})())),ru=(e,t)=>{let{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=t;const a=e&&e.getVideoTracks?e.getVideoTracks()[0]:null;let s=!1;const l=()=>{s=!0,eu(e),n(!1)};if(!a)return l(),Promise.reject(new Error("no-video-track"));let c={};try{c=a.getSettings?a.getSettings():{}}catch(d){}if(c.displaySurface&&"browser"!==c.displaySurface)return l(),Promise.reject(new Error("not-this-tab"));const u=t=>{if(s)throw new Error("tab-timeout");if(t>=3)throw new Error("no-usable-frame");if("ended"===a.readyState)throw new Error("track-ended");const n=Kc({privacyOptions:r,maskSelectors:o});return nu(a,e).then((e=>{const i=window.innerWidth,a=window.innerHeight,l=(e=>{const t=window.visualViewport,n=t&&t.scale?t.scale:1;return t&&(1!==n||t.offsetLeft||t.offsetTop)?e.map((e=>({x:(e.x-t.offsetLeft)*n,y:(e.y-t.offsetTop)*n,width:e.width*n,height:e.height*n}))):e})(n.concat(Kc({privacyOptions:r,maskSelectors:o})));let c=null;try{if(!s&&e&&e.width>0&&e.height>0){const n=i/a;Math.abs(e.width/e.height-n)/n<=.04&&(c=Xc(e.width,e.height),c.getContext("2d").drawImage(e.source,0,0,e.width,e.height),t<2&&"content"!==Zc(c)&&(Yc(c),c=null))}}finally{try{e&&e.release()}catch(d){}}if(s)throw Yc(c),new Error("tab-timeout");return c?{canvas:c,scaleX:c.width/i,scaleY:c.height/a,rects:l,background:"#000000",method:"tab"}:Bc(150).then((()=>u(t+1)))}))};return n(!0),new Promise(((e,t)=>{let n=null;const r=(r,o)=>{s?o&&Yc(o.canvas):(clearInterval(n),l(),r?t(r):e(o))};n=setInterval((()=>{try{i&&!i()&&r(new Error("aborted"))}catch(d){}}),200),_c(new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(d){n()}})).then((()=>Bc(120))).then((()=>u(0))),15e3,"tab-timeout").then((e=>r(null,e)),(e=>r(e)))}))},ou=200,iu=["background-image","border-image-source","mask-image","-webkit-mask-image","list-style-image"],au=(e,t)=>(e.width>0||e.height>0)&&e.bottom>t.top&&e.topt.left&&e.left{const t=[],n=e=>{for(let n=0;nnew Promise(((t,n)=>{const r=new Set,o={top:-200,left:-200,bottom:window.innerHeight+ou,right:window.innerWidth+ou},i=document.documentElement,a=[{element:i,children:su(i),index:0,visible:!0,sized:!1}],s=()=>{try{if(e())return void n(new Error("aborted"));const l=Is();for(;a.length;){const e=a[a.length-1];if(e.index0&&n.height>0})}else a.pop(),a.length&&(e.visible?a[a.length-1].visible=!0:e.sized&&r.add(e.element));if(a.length&&Is()-l>25)return void Ds().then(s)}t(r)}catch(l){n(l)}};s()})),cu={block:!0,"flow-root":!0,"list-item":!0,flex:!0,grid:!0,table:!0},uu={flex:!0,"inline-flex":!0,grid:!0,"inline-grid":!0},du=(e,t)=>{let{offscreen:n,masked:r}=t,o=null;if(!n&&!r){try{const t=e.videoWidth,n=e.videoHeight;if(e.readyState>=2&&t>0&&n>0){const r=Math.min(1,1280/Math.max(t,n)),i=Xc(t*r,n*r);try{i.getContext("2d").drawImage(e,0,0,i.width,i.height),o=i.toDataURL("image/jpeg",.85)}finally{Yc(i)}}}catch(a){o=null}if(!o)try{o=e.poster||null}catch(a){}}const i=document.createElement(o?"img":"div");try{const t=window.getComputedStyle(e);for(let e=0;e{const i=[e],a=(Array.isArray(n)?n:[]).map(Hc).filter(Boolean).join(", "),s=document.scrollingElement||document.documentElement,l={broken:!1,offsetX:0,offsetY:0,lastYield:Is(),canYield:!1,elements:0,offscreen:null},c=new Map,u=new Map,d=new Set,p=e=>{try{return ts(e,t)||es(e,t)||!!a&&e.matches(a)}catch(n){return!1}},h=e=>c.set(e,(c.get(e)||0)+1),f=e=>e.style&&e.style.setProperty("visibility","hidden","important"),g=(e,t)=>{if(e===document.documentElement||e===s)return;const n=e.scrollTop||0,r=e.scrollLeft||0;if(!n&&!r)return;let o=null;try{o=e.getBoundingClientRect()}catch(a){}if(o&&(e=>Math.abs(e.left)<=2&&Math.abs(e.top)<=2&&Math.abs(e.right-window.innerWidth)<=20&&Math.abs(e.bottom-window.innerHeight)<=20)(o))return l.offsetX+=r,l.offsetY+=n,void t.style.setProperty("overflow","visible","important");const i=t.children||[];for(let s=0;s{o();const t=i[i.length-1];if(d.has(t))return!1;if(!e||1!==e.nodeType)return h(t),!0;const n=String(e.tagName).toUpperCase();if("NOSCRIPT"===n||"TEMPLATE"===n)return!1;if(Gc(e)||"string"==typeof e.id&&0===e.id.indexOf("__SANDBOX__"))return!1;if("VIDEO"===n){const n=u.get(t)||[];return n.push({index:c.get(t)||0,placeholder:du(e,{offscreen:!!l.offscreen&&l.offscreen.has(e),masked:p(e)})}),u.set(t,n),!1}if(l.elements+=1,l.elements>1e4)throw new Error("render-budget");return h(t),i.push(e),"IFRAME"!==n&&"FRAME"!==n||!(e=>{try{return!(!e.contentDocument||!e.contentDocument.documentElement)}catch(t){return!1}})(e)||i.push(e),l.offscreen&&l.offscreen.has(e)&&(e=>{try{if(e.ownerDocument!==document||e===document.body)return!1;const t=window.getComputedStyle(e);if(!cu[t.display])return!1;if("block"!==t.display&&"list-item"!==t.display)return!0;const n=e=>"hidden"===e||"scroll"===e||"auto"===e;if(n(t.overflowX)||n(t.overflowY)||"none"!==t.float||"absolute"===t.position||"fixed"===t.position)return!0;const r=e.parentElement;if(r&&uu[window.getComputedStyle(r).display])return!0;const o=e=>parseFloat(t["padding"+e])>0||parseFloat(t["border"+e+"Width"])>0;return o("Top")&&o("Bottom")}catch(t){return!1}})(e)&&d.add(e),!0},onCloneEachNode:e=>{if(o(),!e||1!==e.nodeType)return;const n=i.pop();if(n&&((e,t)=>{const n=String(e.nodeName).toUpperCase(),r=String(t.nodeName).toUpperCase();return n===r||("IFRAME"===n||"FRAME"===n?"HTML"===r:!("VIDEO"!==n&&"CANVAS"!==n||"IMG"!==r&&"CANVAS"!==r&&"VIDEO"!==r))})(n,e)||(l.broken=!0),!l.broken)try{((e,t)=>{const n=u.get(e);n&&(u.delete(e),n.forEach(((e,n)=>{t.insertBefore(e.placeholder,t.childNodes[e.index+n]||null)})))})(n,e),((e,n)=>{const r=String(e.tagName).toUpperCase();if("INPUT"===r||"TEXTAREA"===r||"SELECT"===r){let o=null;try{o=rs(e,t)}catch(a){o=()=>""}if(o){const t=o(e.value);if(n.setAttribute("value","string"==typeof t?t:""),"TEXTAREA"===r&&(n.textContent="string"==typeof t?t:""),"SELECT"===r){const e=n.querySelectorAll("option[selected]");for(let t=0;t{e.style&&iu.forEach((t=>e.style.setProperty(t,"none","important"))),"IMG"===String(e.nodeName).toUpperCase()&&(e.removeAttribute("srcset"),e.setAttribute("src",Tc))})(e)}catch(r){}return c.delete(n),l.canYield&&Is()-l.lastYield>40?(l.lastYield=Is(),Ds()):void 0},onCloneNode:e=>{!l.broken&&(l.offsetX||l.offsetY)&&e&&e.style&&(e.style.top=-(r.y+l.offsetY)+"px",e.style.left=-(r.x+l.offsetX)+"px")},state:l}},hu={contentWindow:null,remove:()=>{}},fu=()=>{try{const e=window.innerHeight,t=document.images;for(let n=0;n0&&o.height>0&&o.bottom>0&&o.top{try{"string"==typeof e&&0!==e.indexOf("data:")&&0!==e.indexOf("blob:")&&kh.getInstance().ignoreInternalRequest(e,null,t)}catch(n){}},mu=e=>{const t=(()=>{try{const e=-200,t=window.innerHeight+ou,n=new Set,r=new Set,o=document.images;for(let a=0;at||s.bottomt||n.bottomn.delete(e))),0===n.size?null:e=>Promise.resolve(!!n.has(e)&&Tc)}catch(e){return null}})();return n=>(gu(n,e),t?t(n):Promise.resolve(!1))};let vu=0,yu=!1;const bu=e=>{let{privacyOptions:t,maskSelectors:n,isActive:r}=e;return new Promise(((e,o)=>{const i=document.documentElement,a=Math.max(1,i.clientWidth||window.innerWidth),s=Math.max(1,i.clientHeight||window.innerHeight),l=Math.min(Math.max(window.devicePixelRatio||1,1),Ac/Math.max(a,s)),c={x:window.scrollX||0,y:window.scrollY||0},u=Kc({privacyOptions:t,maskSelectors:n}),d=(()=>{const e=e=>e&&"transparent"!==e&&!/rgba\(\s*0,\s*0,\s*0,\s*0\s*\)/.test(e);try{const t=window.getComputedStyle(document.documentElement).backgroundColor;if(e(t))return t;const n=document.body?window.getComputedStyle(document.body).backgroundColor:null;if(e(n))return n}catch(t){}return"#ffffff"})();let p=null;const h=()=>(p||!r||r()||(p="aborted"),!!p),f=()=>{if(h())throw new Error(p)},g=pu(i,t,n,c,f),m=(()=>{let e=null;try{e=kh.getInstance(),0===vu&&(yu=!!e.stopped,e.setStopped(!0)),vu+=1}catch(n){return()=>{}}let t=!1;return()=>{if(!t&&(t=!0,vu=Math.max(0,vu-1),0===vu))try{e.setStopped(yu)}catch(n){}}})(),v=Is();let y=null,b=null,w=!1,k=null,x=null;const S=(t,n)=>{w?n&&Yc(n.canvas):(w=!0,(()=>{if(clearTimeout(k),clearInterval(x),y){try{y.requests&&"function"==typeof y.requests.forEach&&y.requests.forEach(((e,t)=>gu(t,v)))}catch(e){}try{uc(y)}catch(e){}y=null}if(b){try{b.remove()}catch(e){}b=null}m()})(),t?o(t):e(n))};k=setTimeout((()=>{try{p=p||"render-timeout",S(new Error("render-timeout"))}catch(e){}}),1e4),x=setInterval((()=>{try{h()&&S(new Error(p))}catch(e){}}),200),Promise.all([lu(h),new Promise((e=>{const t=document.createElement("iframe");t.id="__SANDBOX__gleap",t.width="0",t.height="0",t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.style.visibility="hidden",t.style.position="fixed";let n=!1;try{t.srcdoc='',n=!0}catch(l){}const r=()=>{try{const e=t.contentDocument;return!(!e||!e.body||"complete"!==e.readyState||n&&"about:srcdoc"!==t.contentWindow.location.href)}catch(l){return!1}};let o=!1,i=null;const a=n=>{if(!o){if(o=!0,clearTimeout(i),t.removeEventListener("load",s),!n)try{t.remove()}catch(l){}e(n?t:null)}},s=()=>{r()&&a(!0)};t.addEventListener("load",s),i=setTimeout((()=>a(r())),1500);try{(document.body||document.documentElement).appendChild(t)}catch(l){return void a(!1)}n||a(r())}))]).then((e=>{let[t,n]=e;return w?(n&&n.remove(),null):(b=n,f(),g.state.offscreen=t,Jl(i,{width:a,height:s,scale:l,backgroundColor:null,filter:g.filter,onCloneEachNode:g.onCloneEachNode,onCloneNode:g.onCloneNode,onCreateForeignObjectSvg:()=>{y&&(y.drawImageCount=Math.min(y.drawImageCount||0,2))},style:{position:"relative",top:-c.y+"px",left:-c.x+"px",overflow:"visible"},features:{restoreScrollPosition:!1},fetchFn:mu(v),fetch:{requestInit:{cache:"force-cache"},bypassingCache:!1,placeholderImage:Fc},timeout:fu()?3e3:50}))})).then((e=>{if(!e)return null;if(w){try{uc(e)}catch(t){}return null}return y=e,y.timeout=8e3,y.sandbox=b||hu,b=null,g.state.canYield=!0,f(),Dc(y)})).then((e=>{if(e){if(!w)return"transparent"===Zc(e)?(Yc(e),void S(new Error("render-empty"))):void S(null,{canvas:e,scaleX:e.width/a,scaleY:e.height/s,rects:u,background:d,method:"dom"});Yc(e)}})).catch((e=>S(e)))}))},wu=e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,active:i}=e;return t?t.then((e=>i()?ru(e,{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}).catch((()=>null)):(eu(e),null)),(()=>(n(!1),null))):Promise.resolve(null)},ku=e=>{try{const t=Qc(e);return t.method=e.method,t}finally{Yc(e.canvas)}};function xu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Su={barScreenshotHint:"Go to the screen, then capture",barCapture:"Capture",barCancel:"Cancel",barRecordHint:"Go to where it happens, then start",barStart:"Start recording",barStop:"Stop",barRecording:"Recording",barDragHint:"Drag to move",barCaptureKeys:"{enter} to capture \xb7 {esc} to cancel",barStartKeys:"{enter} to start \xb7 {esc} to cancel",barPause:"Pause",barResume:"Resume",barPaused:"Paused",microphone:"Microphone",previewTitle:"Send this recording?",previewSend:"Send",previewRetake:"Retake",previewDiscard:"Discard",previewPlay:"Play",previewWithAudio:"with audio",previewNoAudio:"no audio",uploading:"Uploading\u2026",recordingInterrupted:"Recording stopped because the page changed.",recordAgain:"Record again",permissionDenied:"Screen capture was blocked. You can upload a file instead.",notSupported:"Screen capture isn't available here. You can upload a file instead.",failed:"That didn't work. Please try again or upload a file.",recordPage:"Record this page",recordPageHint:"Screen sharing didn't start. You can record this page instead."},Cu=e=>{const t=Object.assign({},Su);return e&&"object"==typeof e&&Object.keys(Su).forEach((n=>{const r=e[n];"string"==typeof r&&r.trim().length>0&&(t[n]=r.slice(0,300))})),t},Eu=e=>{const t=Math.max(0,Math.floor(e||0)),n=t%60;return Math.floor(t/60)+":"+(n<10?"0":"")+n},Iu=e=>{const t=/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?/i.exec(e||"");if(!t)return null;if(void 0!==t[4]){if((-1!==t[4].indexOf("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null}const n=e=>{const t=parseFloat(e)/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)};return.2126*n(t[1])+.7152*n(t[2])+.0722*n(t[3])},Du=2*Math.PI*21.75,Au=':host{all:initial}.root{--ink:#0b0b0f;--ink-2:#3c4048;--muted:#6b7280;--surface:#fff;--recess:#f3f4f6;--recess-2:#e9ebef;--line:rgba(15,17,22,.08);--hover:rgba(15,17,22,.06);--glass:rgba(255,255,255,.72);--glass-ring:rgba(15,17,22,.1);--glass-shadow:0 14px 36px -10px rgba(15,17,22,.28),0 2px 6px rgba(15,17,22,.06);--rec:#e5484d;--error:#c4262e}.root.dark{--ink:#ededf0;--ink-2:#c5c7ce;--muted:#9a9ca6;--surface:#17181c;--recess:#212227;--recess-2:#2a2b31;--line:rgba(255,255,255,.08);--hover:rgba(255,255,255,.08);--glass:rgba(32,33,38,.66);--glass-ring:rgba(255,255,255,.12);--glass-shadow:0 16px 40px -10px rgba(0,0,0,.7),0 2px 6px rgba(0,0,0,.3);--error:#ff9a9d}.pill,.sheet{font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:var(--ink);letter-spacing:normal;text-align:start;-webkit-font-smoothing:antialiased;box-sizing:border-box;pointer-events:auto}.pill *,.sheet *{box-sizing:border-box}.glass{background:var(--glass);-webkit-backdrop-filter:blur(20px) saturate(1.7);backdrop-filter:blur(20px) saturate(1.7);box-shadow:0 0 0 1px var(--glass-ring),var(--glass-shadow)}.pill{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);display:flex;align-items:center;gap:6px;padding:6px 6px 6px 18px;border-radius:999px;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;animation:pill-in .32s cubic-bezier(.2,.8,.2,1) both}.pill.dragging{cursor:grabbing}.pill.moved{transform:none;animation:none}.pill.rec{padding-left:16px}.txt{display:flex;flex-direction:column;gap:3px;min-width:0;padding-right:8px}.h{font-size:14px;font-weight:500;letter-spacing:-.005em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:min(440px,calc(100vw - 200px))}.k{font-size:11.5px;color:var(--muted);white-space:nowrap;display:flex;align-items:center;gap:4px}kbd{font:500 10.5px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;padding:2px 5px;border-radius:5px;background:var(--hover);box-shadow:inset 0 0 0 1px var(--line);color:var(--ink-2)}.sep{flex:none;width:1px;height:22px;margin:0 2px;background:var(--line)}button{-webkit-appearance:none;appearance:none;margin:0;border:0;padding:0;font:inherit;color:inherit;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}button[disabled]{opacity:.45;cursor:default}svg{display:block;flex:none;width:18px;height:18px}.ic{flex:none;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;color:var(--ink)}.ic:hover:not([disabled]){background:var(--hover)}.ic[aria-pressed=false]{color:var(--muted)}.ic.x{color:var(--muted)}.ic.x:hover{color:var(--ink)}.text-btn{flex:none;height:36px;padding:0 14px;border-radius:999px;font-size:13px;font-weight:600;white-space:nowrap;background:var(--accent);color:var(--on-accent)}.shutter{position:relative;flex:none;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--ink) 80%,transparent)}@supports not (color:color-mix(in srgb,red 50%,blue)){.shutter{box-shadow:inset 0 0 0 2px var(--ink)}}.core{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--on-accent);transition:transform .14s ease}.shutter:hover:not([aria-disabled=true]) .core{transform:scale(.92)}.shutter:active:not([aria-disabled=true]) .core{transform:scale(.84)}.shutter.start .core{width:30px;height:30px;background:var(--rec);color:#fff}.shutter.stop .core{width:16px;height:16px;border-radius:4px;background:var(--rec)}.shutter[aria-busy=true] .core{transform:none}.ring{position:absolute;top:0;left:0;width:46px;height:46px;transform:rotate(-90deg)}.ring circle{fill:none;stroke:var(--rec);stroke-width:2.5;stroke-linecap:round;transition:stroke-dashoffset .25s linear}.spin{flex:none;width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}.rec-state{display:flex;align-items:center;gap:10px;padding-right:6px;white-space:nowrap}.dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--rec);box-shadow:0 0 0 4px rgba(229,72,77,.22);animation:pulse 1.4s ease-in-out infinite}.dot.paused{animation:none;background:var(--muted);box-shadow:0 0 0 4px var(--hover)}.time{font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}.time span{color:var(--muted);font-weight:400}.label{font-size:12.5px;color:var(--muted)}.sheet{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);width:min(380px,calc(100vw - 24px));max-height:calc(100vh - 40px);display:flex;flex-direction:column;padding:8px;border-radius:24px;animation:pill-in .3s cubic-bezier(.2,.8,.2,1) both}.sheet-head{display:flex;align-items:center;gap:8px;padding:6px 4px 10px 10px}.sheet-head .txt{flex:1;padding:0}.sheet-title{font-size:15px;font-weight:600}.sheet-sub{font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums}.media{position:relative;flex:none;aspect-ratio:16/10;border-radius:16px;overflow:hidden;background:#0b0b0f;box-shadow:0 0 0 1px var(--line)}.media video{display:block;width:100%;height:100%;object-fit:contain;background:#0b0b0f}.media.summary{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:var(--recess);color:var(--ink-2)}.media.summary>svg{width:36px;height:36px;opacity:.8}.facts{display:flex;gap:14px;font-variant-numeric:tabular-nums;font-size:13px}.facts span{display:inline-flex;align-items:center;gap:6px}.facts svg{width:15px;height:15px}.play{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;width:100%;height:100%;border-radius:0;background:linear-gradient(to top,rgba(11,11,15,.35),rgba(11,11,15,.05))}.play span{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.92);color:#0b0b0f;box-shadow:0 6px 16px -6px rgba(0,0,0,.5)}.chip{position:absolute;left:8px;bottom:8px;display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:999px;background:rgba(11,11,15,.72);color:#fff;font-size:11.5px;font-weight:600;font-variant-numeric:tabular-nums;pointer-events:none}.chip svg{width:11px;height:11px}.meter{height:4px;margin:8px 4px 0;border-radius:99px;background:var(--recess);overflow:hidden}.meter div{height:100%;width:0;border-radius:99px;background:var(--accent);transition:width .2s}.status{padding:8px 6px 0;font-size:12.5px;color:var(--muted)}.status.error{color:var(--error)}.actions{display:flex;gap:8px;padding:8px 0 0}.btn{flex:1;height:42px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:14px;font-size:14px;font-weight:600;white-space:nowrap}.btn.p{background:var(--accent);color:var(--on-accent)}.btn.p:hover:not([disabled]){filter:brightness(1.08)}.btn.g{background:var(--hover);color:var(--ink)}.btn.g:hover:not([disabled]){background:var(--recess-2)}.btn svg{width:16px;height:16px}.btn[aria-busy=true]{opacity:1;cursor:default}.flash{position:fixed;top:0;right:0;bottom:0;left:0;background:#fff;pointer-events:none;opacity:0;animation:flash .34s ease-out both}.flyer{position:fixed;left:0;top:0;overflow:hidden;pointer-events:none;transform-origin:0 0;box-shadow:0 24px 50px -18px rgba(15,17,22,.55),0 0 0 1px rgba(15,17,22,.07)}.flyer img{display:block;width:100%;height:100%;object-fit:cover;object-position:top center}@keyframes pill-in{from{opacity:0;transform:translateX(-50%) translateY(14px) scale(.96)}}@keyframes pill-in-m{from{opacity:0;transform:translateY(14px)}}@keyframes pulse{50%{box-shadow:0 0 0 7px rgba(229,72,77,0);opacity:.75}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes flash{12%{opacity:.9}100%{opacity:0}}@media (hover:none){.k{display:none}}@media (max-width:600px){.pill,.pill.moved{left:12px!important;right:12px;top:auto!important;bottom:calc(14px + env(safe-area-inset-bottom,0px));width:auto;max-width:none;transform:none;padding-left:16px;cursor:default;animation-name:pill-in-m}.pill.moved{animation:none}.txt{flex:1}.h{max-width:none}.k{display:none}.pill.rec .rec-state{flex:1}.sheet{left:12px;right:12px;bottom:calc(14px + env(safe-area-inset-bottom,0px));width:auto;transform:none;animation-name:pill-in-m}}@media (prefers-reduced-motion:reduce){.pill,.sheet,.dot{animation:none}.core,.ring circle,.meter div{transition:none}.spin{animation-duration:2.4s}.flash{animation-duration:.2s;opacity:0}}',Tu={camera:["M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3zM12 16.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4Z"],x:["M18 6 6 18M6 6l12 12"],mic:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21"],micOff:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M4 4l16 16"],pause:["M8 5h2.2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1ZM13.8 5H16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1h-2.2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z","fill"],play:["M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z","fill"],arrowUp:["M12 19V5M5 12l7-7 7 7"],record:["M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"],page:["M6.5 3h11A2.5 2.5 0 0 1 20 5.5v13a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 18.5v-13A2.5 2.5 0 0 1 6.5 3ZM8 8h8M8 12h8M8 16h5"],clock:["M12 20.5a8.5 8.5 0 1 0 0-17 8.5 8.5 0 0 0 0 17ZM12 7.5V12l3 2"],pointer:["M6 3.5 18.5 12l-5.6 1.3-2.7 5.2Z"]},Lu="http://www.w3.org/2000/svg",Fu=e=>{const[t,n]=Tu[e],r=document.createElementNS(Lu,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true");const o=document.createElementNS(Lu,"path");return o.setAttribute("d",t),"fill"===n?o.setAttribute("fill","currentColor"):(o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),r.appendChild(o),r},Ou=(e,t,n)=>{const r=document.createElement(e);return t&&(r.className=t),(n||[]).forEach((e=>{null!=e&&r.appendChild("string"==typeof e?document.createTextNode(e):e)})),r},Mu={position:"fixed",top:"0",left:"0",width:"0",height:"0",overflow:"visible","z-index":"2147483647",display:"block",margin:"0",padding:"0",border:"0",transform:"none",filter:"none","pointer-events":"none"},Pu=(e,t)=>{const n=document.createElement("div");n.className="gleap-capture-root rr-block gl-block",Object.keys(Mu).forEach((e=>n.style.setProperty(e,Mu[e],"important")));const r=n.attachShadow({mode:"open"});let o=!1;try{if("function"==typeof CSSStyleSheet&&"adoptedStyleSheets"in r){const e=new CSSStyleSheet;e.replaceSync(Au),r.adoptedStyleSheets=[e],o=!0}}catch(a){}if(!o){const e=document.createElement("style");W(e),e.textContent=Au,r.appendChild(e)}const i=Ou("div","root");return i.setAttribute("dir",t?"rtl":"ltr"),Ru(i,e),r.appendChild(i),{host:n,root:i}},Ru=(e,t)=>{const n=(()=>{try{const e=[document.body,document.documentElement];for(let n=0;nIu("rgb("+parseInt(e.substr(1,2),16)+","+parseInt(e.substr(3,2),16)+","+parseInt(e.substr(5,2),16)+")"))(r)||0;n&&o<.03?(e.style.setProperty("--accent","#f2f2f4"),e.style.setProperty("--on-accent","#0b0b0f")):(e.style.setProperty("--accent",r),e.style.setProperty("--on-accent",o>.45?"#0b0b0f":"#ffffff"))},Nu=e=>{try{e&&!e.isConnected&&(document.body||document.documentElement).appendChild(e)}catch(t){}},ju=e=>{let{src:t,from:n,to:r,radius:o,done:i}=e;const a=()=>{try{i()}catch(e){}},s=e=>e&&e.width>0&&e.height>0&&isFinite(e.x)&&isFinite(e.y);if((()=>{try{return!(!window.matchMedia||!window.matchMedia("(prefers-reduced-motion: reduce)").matches)}catch(e){return!1}})()||!t||!s(n)||!s(r)||"function"!=typeof Element.prototype.animate)return void a();let l=null;try{const e=Pu(null,!1);l=e.host;const i=Ou("div","flyer"),s=document.createElement("img");s.alt="",s.src=t,i.appendChild(s),i.style.width=n.width+"px",i.style.height=n.height+"px",i.style.borderRadius="14px",e.root.appendChild(i),Nu(l);const c=r.width/n.width,u=r.height/n.height,d=(o||16)*n.width/Math.max(1,r.width),p=i.animate([{transform:"translate("+n.x+"px,"+n.y+"px) scale(1)",borderRadius:"14px"},{transform:"translate("+(n.x+.55*(r.x-n.x))+"px,"+(Math.min(n.y,r.y)-30)+"px) scale("+(.5+.5*c)+")",borderRadius:"16px",offset:.55},{transform:"translate("+r.x+"px,"+r.y+"px) scale("+c+","+u+")",borderRadius:d+"px"}],{duration:620,easing:"cubic-bezier(0.3, 0.7, 0.2, 1)",fill:"forwards"});let h=!1;const f=()=>{if(!h){h=!0,a();try{i.animate([{opacity:1},{opacity:0}],{duration:120,fill:"forwards"}).onfinish=()=>{try{l.remove()}catch(e){}}}catch(e){l.remove()}}};p.onfinish=f,setTimeout(f,1200)}catch(c){try{l&&l.remove()}catch(u){}a()}};class Bu{constructor(e){let{labels:t,primaryColor:n,rtl:r,onAction:o}=e;xu(this,"host",null),xu(this,"root",null),xu(this,"pill",null),xu(this,"timer",null),xu(this,"ring",null),xu(this,"dot",null),xu(this,"pausedLabel",null),xu(this,"pauseButton",null),xu(this,"maxSec",0),xu(this,"micButton",null),xu(this,"progress",null),xu(this,"status",null),xu(this,"previewButtons",null),xu(this,"previewMedia",null),xu(this,"previewVideo",null),xu(this,"previewUrl",null),xu(this,"meter",null),xu(this,"position",null),xu(this,"cleanupDrag",null),xu(this,"cleanupKeys",null),xu(this,"autoFocus",!0),this.labels=Cu(t),this.onAction=o,this.rtl=!!r,this.primaryColor=/^#[0-9a-f]{6}$/i.test(n||"")?n:"#485BFF"}mount(){if(this.host)Ru(this.root,this.primaryColor);else{const e=Pu(this.primaryColor,this.rtl);this.host=e.host,this.root=e.root}this.ensureAttached()}ensureAttached(){Nu(this.host)}isOwnElement(e){return!(!this.host||!e||e!==this.host&&!this.host.contains(e))}setVisible(e){this.host&&this.host.style.setProperty("visibility",e?"visible":"hidden","important")}action(e){try{this.onAction&&this.onAction(e)}catch(t){}}button(e,t,n,r){const o=Ou("button",e,n);return o.type="button",r&&(o.setAttribute("aria-label",r),o.title=r),o.addEventListener("click",(e=>{e.stopPropagation(),o.disabled||"true"===o.getAttribute("aria-disabled")||this.action(t)})),o}closeButton(e){return this.button("ic x","cancel",[Fu("x")],e)}micToggle(e,t){if(!e||!e.available)return null;const n=this.button("ic","mic",[Fu(e.on?"mic":"micOff")],this.labels.microphone);return n.setAttribute("aria-pressed",e.on?"true":"false"),n.disabled=!!t,this.micButton=n,n}shutter(e,t,n,r){const o=[Ou("span","core",[r?Ou("span","spin"):"camera"===e?Fu("camera"):null])];if("stop"===e){const e=document.createElementNS(Lu,"svg");e.setAttribute("class","ring"),e.setAttribute("viewBox","0 0 46 46"),e.setAttribute("aria-hidden","true");const t=document.createElementNS(Lu,"circle");t.setAttribute("cx","23"),t.setAttribute("cy","23"),t.setAttribute("r",String(21.75)),t.setAttribute("stroke-dasharray",String(Du)),t.setAttribute("stroke-dashoffset",String(Du)),e.appendChild(t),o.unshift(e),this.ring=t}const i=this.button("shutter"+("camera"===e?"":" "+e),t,o,n);return r&&(i.setAttribute("aria-busy","true"),i.setAttribute("aria-disabled","true")),i}focus(e){try{this.autoFocus&&e&&e.focus({preventScroll:!0})}catch(t){}}reset(){if(this.cleanupDrag&&(this.cleanupDrag(),this.cleanupDrag=null),this.cleanupKeys&&(this.cleanupKeys(),this.cleanupKeys=null),this.previewUrl){try{URL.revokeObjectURL(this.previewUrl)}catch(e){}this.previewUrl=null}for(this.pill=this.timer=this.ring=this.dot=this.pausedLabel=this.pauseButton=null,this.micButton=this.progress=this.status=this.previewButtons=this.previewMedia=this.previewVideo=null,this.meter=null;this.root&&this.root.firstChild;)this.root.removeChild(this.root.firstChild)}listenForKeys(e){const t=t=>{try{if(t.defaultPrevented||t.isComposing||t.metaKey||t.ctrlKey||t.altKey)return;const n=document.activeElement;if(!(!n||n===document.body||n===document.documentElement||n===this.host))return;const r=t.composedPath?t.composedPath():[],o=r[0]&&"BUTTON"===r[0].tagName;"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this.action("cancel")):"Enter"===t.key&&e&&!o&&(t.preventDefault(),t.stopPropagation(),this.action(e))}catch(n){}};document.addEventListener("keydown",t,!0),this.cleanupKeys=()=>document.removeEventListener("keydown",t,!0)}showPill(e){let{label:t,content:n,buttons:r,focusIndex:o,recording:i,keys:a}=e;this.mount(),this.reset();const s=Ou("div","pill glass"+(i?" rec":""),n.concat(r));s.setAttribute("role","region"),s.setAttribute("aria-label",t),s.title="",this.place(s),this.enableDragging(s),this.root.appendChild(s),this.pill=s,null!==a&&this.listenForKeys(a),this.focus(r[o])}hint(e,t){const n=[Ou("span","h",[e])];t&&n.push((e=>{const t=Ou("span","k");return String(e).split(/(\{enter\}|\{esc\})/).forEach((e=>{"{enter}"===e?t.appendChild(Ou("kbd",null,["Enter"])):"{esc}"===e?t.appendChild(Ou("kbd",null,["Esc"])):e&&t.appendChild(document.createTextNode(e))})),t.setAttribute("aria-hidden","true"),t})(t));const r=Ou("div","txt",n);return r.firstChild.title=e,r}place(e){this.position&&(e.classList.add("moved"),e.style.left=this.position.left+"px",e.style.top=this.position.top+"px",e.style.bottom="auto")}enableDragging(e){let t=null;const n=n=>{try{t&&(this.position={left:Math.max(8,Math.min(window.innerWidth-e.offsetWidth-8,t.left+n.clientX-t.x)),top:Math.max(8,Math.min(window.innerHeight-e.offsetHeight-8,t.top+n.clientY-t.y))},this.place(e))}catch(r){}},r=()=>{t=null,e.classList.remove("dragging"),window.removeEventListener("pointermove",n,!0),window.removeEventListener("pointerup",r,!0),window.removeEventListener("pointercancel",r,!0)};e.addEventListener("pointerdown",(o=>{try{const i=(o.composedPath?o.composedPath():[]).some((e=>e&&"BUTTON"===e.tagName));if(o.button||i||window.innerWidth<=600)return;o.preventDefault();const a=e.getBoundingClientRect();t={x:o.clientX,y:o.clientY,left:a.left,top:a.top},e.classList.add("dragging"),window.addEventListener("pointermove",n,!0),window.addEventListener("pointerup",r,!0),window.addEventListener("pointercancel",r,!0)}catch(i){}})),e.title=this.labels.barDragHint,this.cleanupDrag=r}showScreenshotBar(e){const t=this.labels,n=this.shutter("camera","capture",t.barCapture,e);this.showPill({label:t.barCapture,content:[this.hint(t.barScreenshotHint,t.barCaptureKeys)],buttons:[n,this.closeButton(t.barCancel)],focusIndex:0,keys:e?null:"capture"})}showRecordBar(e){let{busy:t,mic:n,interrupted:r}=e;const o=this.labels,i=r?o.recordAgain:o.barStart,a=this.shutter("start","start",i,t),s=[this.micToggle(n,t),a,this.closeButton(o.barCancel)].filter(Boolean);this.showPill({label:i,content:[this.hint(r?o.recordingInterrupted:o.barRecordHint,o.barStartKeys)],buttons:s,focusIndex:s.indexOf(a),keys:t?null:"start"})}showPageRecordingOffer(){const e=this.labels,t=this.button("text-btn","record-page",[e.recordPage]);this.showPill({label:e.recordPage,content:[this.hint(e.recordPageHint)],buttons:[t,this.closeButton(e.barCancel)],focusIndex:0,keys:"record-page"})}showRecordingBar(e){let{mic:t,maxSec:n,canPause:r}=e;const o=this.labels;this.maxSec=n;const i=Ou("span","dot");i.setAttribute("aria-hidden","true");const a=Ou("b",null,[Eu(0)]),s=Ou("span","time",[a," ",Ou("span",null,["/ "+Eu(n)])]);s.setAttribute("role","timer");const l=Ou("span","label",[o.barPaused]);l.style.display="none";const c=Ou("div","rec-state",[i,l,s]),u=r?this.button("ic","pause",[Fu("pause")],o.barPause):null,d=this.shutter("stop","stop",o.barStop,!1),p=[this.micToggle(t),u,d].filter(Boolean);this.showPill({label:o.barRecording,content:[c,Ou("span","sep")],buttons:p,focusIndex:p.length-1,recording:!0,keys:null}),this.timer=a,this.dot=i,this.pausedLabel=l,this.pauseButton=u}updateTimer(e){if(this.timer&&(this.timer.textContent=Eu(e)),this.ring&&this.maxSec>0){const t=Math.max(0,Math.min(1,e/this.maxSec));this.ring.setAttribute("stroke-dashoffset",String(Du*(1-t)))}}setPaused(e){if(this.dot&&this.dot.classList.toggle("paused",!!e),this.pausedLabel){const t=this.pillRight();this.pausedLabel.style.display=e?"":"none",this.keepPillRight(t)}const t=this.pauseButton;if(t){const n=e?this.labels.barResume:this.labels.barPause;t.setAttribute("aria-label",n),t.title=n,t.replaceChild(Fu(e?"play":"pause"),t.firstChild)}}pillRight(){try{return this.pill?this.pill.getBoundingClientRect().right:null}catch(e){return null}}keepPillRight(e){const t=this.pill,n=this.pillRight();if(!t||null===e||null===n||window.innerWidth<=600)return;const r=n-e;if(!(Math.abs(r)<.5))if(this.position)this.position={left:this.position.left-r,top:this.position.top},this.place(t);else{const e=(parseFloat(t.style.marginLeft)||0)-r;t.style.marginLeft=Math.abs(e)<.5?"":e+"px"}}setMicOn(e){const t=this.micButton;t&&(t.setAttribute("aria-pressed",e?"true":"false"),t.replaceChild(Fu(e?"mic":"micOff"),t.firstChild))}showPreview(e){this.mount(),this.reset();const t=this.labels,n=Eu((e.durationMs||0)/1e3);let r;if(e.video){const o=document.createElement("video");o.playsInline=!0,o.preload="auto",o.muted=!1,o.addEventListener("loadedmetadata",(()=>{try{if(o.duration===1/0){const e=()=>{o.removeEventListener("timeupdate",e),o.currentTime=.05};o.addEventListener("timeupdate",e),o.currentTime=1e7}else o.currentTime=.05}catch(e){}}),{once:!0}),this.previewUrl=URL.createObjectURL(e.video),o.src=this.previewUrl;const i=Ou("span","chip",[Fu("play"),n]),a=Ou("button","play",[Ou("span",null,[Fu("play")])]);a.type="button",a.setAttribute("aria-label",t.previewPlay),a.addEventListener("click",(e=>{e.stopPropagation();try{a.remove(),i.remove(),o.controls=!0;const e=o.play();e&&e.catch&&e.catch((()=>{}))}catch(t){}})),r=Ou("div","media",[o,a,i]),this.previewVideo=o}else{const t=Ou("div","facts",[Ou("span",null,[Fu("clock"),n])]);"number"==typeof e.interactions&&t.appendChild(Ou("span",null,[Fu("pointer"),String(e.interactions)])),r=Ou("div","media summary",[Fu("page"),t])}this.previewMedia=r;const o=n+("boolean"==typeof e.audio?" \xb7 "+(e.audio?t.previewWithAudio:t.previewNoAudio):""),i=Ou("span","sheet-title",[t.previewTitle]);i.id="gl-title";const a=Ou("div","sheet-head",[Ou("div","txt",[i,Ou("span","sheet-sub",[o])]),this.closeButton(t.previewDiscard)]);this.status=Ou("div","status"),this.status.setAttribute("aria-live","polite"),this.status.style.display="none";const s={retake:this.button("btn g","retake",[t.previewRetake]),send:this.button("btn p","send",[t.previewSend,Fu("arrowUp")])};this.previewButtons=s;const l=Ou("div","sheet glass",[a,r,this.status,Ou("div","actions",[s.retake,s.send])]);l.setAttribute("role","dialog"),l.setAttribute("aria-labelledby",i.id),this.root.appendChild(l),this.listenForKeys(null),this.focus(s.send)}getPreviewRect(){try{if(!this.previewMedia)return null;const e=this.previewMedia.getBoundingClientRect();return e.width>0?{x:e.left,y:e.top,width:e.width,height:e.height}:null}catch(e){return null}}getPosterDataUrl(){try{const e=this.previewVideo;if(!e||e.readyState<2||!e.videoWidth)return null;const t=Math.min(1,480/Math.max(e.videoWidth,e.videoHeight)),n=document.createElement("canvas");return n.width=Math.max(1,Math.round(e.videoWidth*t)),n.height=Math.max(1,Math.round(e.videoHeight*t)),n.getContext("2d").drawImage(e,0,0,n.width,n.height),n.toDataURL("image/jpeg",.75)}catch(e){return null}}setUploading(e){if(!this.status)return;const t=this.previewButtons;t.retake.disabled=!0,t.send.setAttribute("aria-disabled","true"),t.send.setAttribute("aria-busy","true");const n=Math.round(100*Math.max(0,Math.min(1,e||0)));for(;t.send.firstChild;)t.send.removeChild(t.send.firstChild);if(t.send.appendChild(Ou("span","spin")),t.send.appendChild(document.createTextNode(n+"%")),!this.progress){this.status.className="status",this.status.style.display="none",this.progress=Ou("div");const e=Ou("div","meter",[this.progress]);e.setAttribute("role","progressbar"),e.setAttribute("aria-label",this.labels.uploading),this.previewMedia.parentNode.insertBefore(e,this.status),this.meter=e}this.progress.style.width=n+"%"}setPreviewError(e){if(!this.status)return;const t=this.previewButtons;if(this.meter){try{this.meter.remove()}catch(n){}this.meter=null}for(this.progress=null,this.status.className="status error",this.status.style.display="",this.status.textContent=e||this.labels.failed,t.retake.disabled=!1,t.send.removeAttribute("aria-disabled"),t.send.removeAttribute("aria-busy");t.send.firstChild;)t.send.removeChild(t.send.firstChild);t.send.appendChild(document.createTextNode(this.labels.previewSend)),t.send.appendChild(Fu("arrowUp"))}destroy(){this.reset();try{this.host&&this.host.remove()}catch(e){}this.host=this.root=this.onAction=null}}const _u="filter: blur(12px) !important;",Uu=_u+" -webkit-text-security: disc !important;",Hu=Oc.split(",").map((e=>":not("+e.trim()+")")).join(""),qu=e=>{try{return!(!e.matches||!e.matches(Oc))}catch(t){return!1}},zu=e=>{const t=":is("+e+"):not(html):not(body)"+Hu,n=["html:is("+e+") > body > *","body:is("+e+") > *"].map((e=>e+Hu)).join(", ");return{rules:[t+":not("+t+" *) { "+_u+" }",n+" { "+_u+" }"],fallback:e+" { "+_u+" }"}},Wu=(e,t)=>{const n=qc(e,t).map(zu);return n.push({rules:[jc()+" { "+_u+" }"],fallback:null}),function(e){e=e||{};var t=['input[type="password" i]',"input[data-rr-is-password]"];za.forEach((function(e){t.push('input[autocomplete~="'+e+'" i]','textarea[autocomplete~="'+e+'" i]')})),["input"+os,"textarea","select"].forEach((function(e){t.push(e+Wa,Wa+" "+e)}));var n=ns(e);return Object.keys(n).forEach((function(e){!n[e]||Ga.indexOf(e)>=0||!/^[a-z-]+$/.test(e)||("textarea"!==e&&"select"!==e?(t.push('input[type="'+e+'" i]'),"text"===e&&t.push("input:not([type])")):t.push(e))})),t}(e).forEach((e=>{n.push({rules:[e+" { "+Uu+" }"],fallback:null})})),n},Gu=(e,t)=>{let n=!1;if(t.rules.forEach((t=>{try{e.insertRule(t,e.cssRules.length),n=!0}catch(r){}})),!n&&t.fallback)try{e.insertRule(t.fallback,e.cssRules.length)}catch(r){}},Vu=()=>new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(r){n()}})),$u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.privacyOptions||{},n=Wu(t,e.maskSelectors),r=zc(t),o=Object.create(null),i=[],a=new WeakSet,s=[];let l=null,c=!1;const u=e=>{const t=(e=>{for(let n=0;nGu(t.sheet,e))),Object.keys(o).forEach((e=>Gu(t.sheet,zu("."+Uc(e))))),i.push(t)),t})(9===e.nodeType?e:e.ownerDocument);if(t&&!t.style)try{e.adoptedStyleSheets=Array.prototype.slice.call(e.adoptedStyleSheets||[]).concat([t.sheet]),t.roots.push(e)}catch(r){}},d=e=>{const t=e.classList;if(r.length&&t)for(let n=0;n(t.lastIndex=0,t.test(e))))){o[e]=!0;const t=zu("."+Uc(e));i.forEach((e=>Gu(e.sheet,t)))}}};let p=null;const h=(e,t)=>{!e||a.has(e)||t>8||(a.add(e),u(e),(e=>{if(l)try{l.observe(e,r.length?{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}:{childList:!0,subtree:!0})}catch(t){}})(e),p(e,t))},f=(e,t)=>{let n=null;try{n=e.contentDocument}catch(r){}n&&n.documentElement&&h(n,t)},g=(e,t)=>{d(e),e.shadowRoot&&h(e.shadowRoot,t+1),"IFRAME"!==e.tagName&&"FRAME"!==e.tagName||((e,t)=>{for(let o=0;o{c||f(e,t)};try{e.addEventListener("load",n),s.push({frame:e,onLoad:n})}catch(r){}f(e,t)})(e,t+1)};p=(e,t)=>{if(!c&&e)try{if(1===e.nodeType){if(qu(e))return;g(e,t)}const n=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>qu(e)?2:1});let r=n.nextNode();for(;r;)g(r,t),r=n.nextNode()}catch(n){}};const m=()=>{if(!c){c=!0;try{l&&l.disconnect()}catch(e){}l=null,s.forEach((t=>{try{t.frame.removeEventListener("load",t.onLoad)}catch(e){}})),s.length=0,i.forEach((t=>{t.roots.forEach((n=>{try{n.adoptedStyleSheets=Array.prototype.filter.call(n.adoptedStyleSheets||[],(e=>e!==t.sheet))}catch(e){}}));try{t.style&&t.style.parentNode&&t.style.parentNode.removeChild(t.style)}catch(e){}})),i.length=0;try{window.removeEventListener("pagehide",m)}catch(e){}}};try{window.addEventListener("pagehide",m),"function"==typeof MutationObserver&&(l=new MutationObserver((e=>{if(!c)try{e.forEach((e=>{if("attributes"!==e.type)for(let t=0;t{try{return window.sessionStorage.getItem(e)}catch(t){return null}},ed=(e,t)=>{try{null===t?window.sessionStorage.removeItem(e):window.sessionStorage.setItem(e,t)}catch(n){}},td=e=>{const t=parseInt(e,10);return isNaN(t)?120:Math.max(5,Math.min(180,t))},nd=e=>{if(!e)return"unknown";const t=e.name&&"Error"!==e.name?e.name:"",n=e.message?String(e.message):t?"":String(e);return(t&&n?t+": "+n:t||n).slice(0,120)},rd=e=>e>=200&&e<300,od=e=>{if(!e||"object"!=typeof e)return null;const t={x:Number(e.x),y:Number(e.y),width:Number(e.width),height:Number(e.height)};return isFinite(t.x)&&isFinite(t.y)&&t.width>0&&t.height>0?t:null};let id=0;class ad{constructor(){Ju(this,"session",null),Ju(this,"ui",null),Ju(this,"watchdog",null),Ju(this,"hiddenElements",[]),Ju(this,"hiddenEscape",null),Ju(this,"handledLogRequests",[]),Ju(this,"logsPostedFor",[]),Ju(this,"deviceId",null),Ju(this,"flight",null)}static getInstance(){return this.instance||(this.instance=new ad),this.instance}setCaptureEnabled(e){(e=>{pr=!!e})(e),e||(ed(Ku,null),this.session&&this.cancelSession(this.session,"disabled"));try{wv.instance&&wv.instance.sendCaptureCapabilities()}catch(t){}}setRemoteLogCollectionEnabled(e){(e=>{hr=!!e})(e)}getDeviceId(){if(this.deviceId)return this.deviceId;let e=Qu(Xu);return e&&/^web-[0-9a-f]{32}$/.test(e)||(e="web-"+(e=>{try{const t=new Uint8Array(e);return window.crypto.getRandomValues(t),Array.prototype.map.call(t,(e=>(e<16?"0":"")+e.toString(16))).join("")}catch(t){let n="";for(let r=0;r<2*e;r++)n+=Math.floor(16*Math.random()).toString(16);return n}})(16),ed(Xu,e)),this.deviceId=e,e}privacyOptions(){try{return vs.getInstance().customOptions||{}}catch(e){return{}}}maskSelectors(){const e=yr().maskSelectors;return Array.isArray(e)?e.filter((e=>"string"==typeof e)):[]}attachesLogs(e){return!!(e&&e.options&&e.options.attachLogs)&&fr()}applyVeil(e){this.liftVeil(e);try{e.veil=$u({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors()})}catch(t){e.veil=null}}liftVeil(e,t){const n=t||e.veil;if(n){e.veil===n&&(e.veil=null);try{n.remove()}catch(r){}}}handleMessengerMessage(e){try{const t=e&&e.data&&"object"==typeof e.data?e.data:{};switch(e&&e.name){case"capture-start":this.onCaptureStart(t);break;case"capture-cancel":this.onCaptureCancel(t);break;case"capture-editor":this.setEditorOpen(!!t.open);break;case"capture-done":this.onCaptureDone(t);break;case"capture-fly":this.onCaptureFly(t)}}catch(t){}}sendState(e,t,n){try{wv.getInstance().sendMessage({name:"capture-state",data:Object.assign({requestId:e,state:t},n)})}catch(r){}}setEditorOpen(e){try{wv.getInstance().setCaptureEditorOpen(e)}catch(t){}}onCaptureStart(e){const t="string"==typeof e.requestId?e.requestId:null,n="screenshot"===e.kind||"recording"===e.kind?e.kind:null;if(!t||!n)return;if(!Er())return this.sendState(t,"unsupported",{error:"capture-disabled"}),void Xs(t,"unsupported","capture-disabled");const r=this.session;if(r){if("uploading"===r.phase)return;r.requestId!==t?this.cancelSession(r,"replaced",!0):this.endSession(r,{restore:!1})}this.setEditorOpen(!1),this.startSession({requestId:t,kind:n,ticketShareToken:"string"==typeof e.ticketShareToken?e.ticketShareToken:null,options:e.options,labels:e.labels,resumed:!1,phase:"bar"})}onCaptureCancel(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||(this.endSession(t,{restore:!0}),this.sendState(t.requestId,"cancelled")),this.setEditorOpen(!1)}onCaptureDone(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||(t.pendingLogs&&!1!==e.sent&&this.postLogs(t.requestId,t.pendingLogs),t.pendingLogs=null,this.endSession(t,{restore:!0})),this.setEditorOpen(!1)}onCaptureFly(e){const t="string"==typeof e.requestId?e.requestId:null;if(!t)return;const n=this.flight&&this.flight.requestId===t&&Date.now()-this.flight.at<15e3?this.flight:null;this.flight=null;let r=od(e.to);try{const e=wv.getInstance().gleapFrame,t=e?e.getBoundingClientRect():null;r=r&&t&&t.width>0?{x:t.left+r.x,y:t.top+r.y,width:r.width,height:r.height}:null}catch(i){r=null}var o;ju({src:(o=e.src,"string"==typeof o&&o.length<=1048576&&/^data:image\/(jpeg|jpg|png|webp);base64,/i.test(o)?e.src:n?n.src:null),from:od(e.from)||(n?n.from:null),to:r,radius:"number"==typeof e.radius?e.radius:16,done:()=>{try{wv.getInstance().sendMessage({name:"capture-fly-done",data:{requestId:t}})}catch(i){}}})}onWidgetDestroyed(){const e=this.session;e&&("editor"!==e.phase?e.resumed=!0:this.endSession(e,{restore:!1}))}destroy(){this.session&&this.endSession(this.session,{restore:!1}),this.setEditorOpen(!1)}normalizeOptions(e){const t=e&&"object"==typeof e?e:{};return{annotate:!1!==t.annotate,maxDurationSec:td(t.maxDurationSec),audio:!0===t.audio,attachLogs:!1!==t.attachLogs,include:el(t.include)}}startSession(e){let t={};try{t=Rd.getInstance().getFlowConfig()||{}}catch(r){}const n={key:++id,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken||null,options:this.normalizeOptions(e.options),labels:Cu(e.labels),rawLabels:e.labels&&"object"==typeof e.labels?e.labels:null,resumed:!!e.resumed,phase:e.phase,interrupted:"interrupted"===e.phase,pageRecording:!0===e.pageRecording,micOn:!1,createdAt:"number"==typeof e.createdAt?e.createdAt:Date.now(),startedAt:Date.now(),lastTick:-1,lastProgressSent:0,lastStateAt:0,paused:!1};this.session=n;try{let o=!1;try{o=!!ub.getInstance().isRTLLayout}catch(r){}this.ui=new Bu({labels:e.labels,primaryColor:t.color,rtl:o,onAction:e=>this.onUiAction(n,e)}),this.ui.autoFocus=!n.resumed,this.renderBar(n)}catch(o){return void this.failSession(n,"failed",nd(o))}if(!n.resumed)try{wv.getInstance().setCaptureHidden(!0)}catch(r){}this.hideGleapUi(),this.startWatchdog(),this.persist(n),this.sendState(n.requestId,"bar")}renderBar(e){this.ui&&("screenshot"===e.kind?this.ui.showScreenshotBar(!1):this.ui.showRecordBar({busy:!1,mic:this.micState(e),interrupted:e.interrupted}))}micState(e){return!0===e.options.audio&&!0===yr().allowMicrophone&&this.usesScreenRecording(e)&&kr()?{available:!0,on:e.micOn}:null}usesScreenRecording(e){return"display"===Cr()&&!e.pageRecording}endSession(e,t){let{restore:n}=t;if(e&&this.session===e){this.session=null;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e);try{e.timeline&&e.timeline.stop()}catch(r){}try{e.upload&&e.upload.abort()}catch(r){}if(e.recording=null,e.timeline=null,e.upload=null,e.result=null,this.stopWatchdog(),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),this.ui){try{this.ui.destroy()}catch(r){}this.ui=null}if(this.showGleapUi(),ed(Ku,null),n)this.restoreWidget(e);else if(!e.resumed)try{wv.getInstance().setCaptureHidden(!1,!1)}catch(r){}}}restoreWidget(e){try{e.resumed?this.openConversation(e.ticketShareToken):wv.getInstance().setCaptureHidden(!1,!0)}catch(t){}}openConversation(e){e?$b.openConversation(e,!0):$b.open()}cancelSession(e,t,n){const r="editor"===e.phase;this.endSession(e,{restore:!n}),r||(this.sendState(e.requestId,"cancelled"),Xs(e.requestId,"released",t))}failSession(e,t,n){e&&this.session===e&&(this.endSession(e,{restore:!0}),this.sendState(e.requestId,t,{error:n}),Xs(e.requestId,"declined"===t||"unsupported"===t?t:"failed",n))}onUiAction(e,t){if(this.session===e)try{switch(t){case"capture":this.takeScreenshot(e);break;case"start":this.startRecording(e);break;case"record-page":e.pageRecording=!0,this.startRecording(e);break;case"stop":e.recording&&e.recording.stop();break;case"mic":this.toggleMicrophone(e);break;case"pause":this.togglePause(e);break;case"send":this.sendRecording(e);break;case"retake":this.retakeRecording(e);break;case"cancel":"fallback"===e.phase?this.failSession(e,e.fallbackState,e.fallbackReason):this.cancelSession(e,"cancelled")}}catch(n){this.failSession(e,"failed",nd(n))}}takeScreenshot(e){if("screenshot"!==e.kind||"bar"!==e.phase)return;const t=Sr(),n=t?tu():null;e.phase="capturing",this.ui.showScreenshotBar(!0),this.sendState(e.requestId,"capturing"),t&&this.setCaptureUiHidden(!0);let r=null;if(this.attachesLogs(e)&&-1===this.logsPostedFor.indexOf(e.requestId))try{r=nl({include:e.options.include,deviceId:this.getDeviceId()})}catch(i){}const o=()=>this.session===e;(e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=e;const a=()=>!i||i();return wu({streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,active:a}).then((e=>{if(!a())throw e&&Yc(e.canvas),new Error("aborted");return e||bu({privacyOptions:r,maskSelectors:o,isActive:a})})).then(ku)})({streamPromise:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isActive:o,setUiHidden:e=>{o()&&this.setCaptureUiHidden(e)}}).then((t=>{o()&&this.onScreenshotReady(e,t,r)})).catch((t=>{o()&&this.failSession(e,"failed",nd(t))}))}onScreenshotReady(e,t,n){const r=wv.getInstance(),o={name:"capture-image",data:{requestId:e.requestId,dataUrl:t.dataUrl,width:t.width,height:t.height,method:t.method,platform:dr,sdkType:ur,sdkVersion:vr()}};(()=>{try{const{host:e,root:t}=Pu(null,!1);t.appendChild(Ou("div","flash")),Nu(e),setTimeout((()=>{try{e.remove()}catch(t){}}),420)}catch(e){}})(),e.phase="editor",ed(Ku,null),this.stopWatchdog(),this.ui&&(this.ui.destroy(),this.ui=null),this.showGleapUi(),e.resumed?(this.openConversation(e.ticketShareToken),r.sendMessage(o,!0)):(r.sendMessage(o,!0),r.setCaptureHidden(!1,!0)),e.pendingLogs=n||null}postLogs(e,t){fr()&&-1===this.logsPostedFor.indexOf(e)&&(this.logsPostedFor.push(e),this.logsPostedFor.length>100&&this.logsPostedFor.shift(),Qs(e,t).catch((()=>{})))}setCaptureUiHidden(e){if(this.ui&&this.ui.setVisible(!e),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),e){this.hideGleapUi();const e=this.session;this.hiddenEscape=t=>{try{"Escape"===t.key&&e&&this.session===e&&this.cancelSession(e,"cancelled")}catch(n){}},document.addEventListener("keydown",this.hiddenEscape,!0)}}startRecording(e){if("recording"!==e.kind||-1===["bar","interrupted","fallback"].indexOf(e.phase))return;const t=()=>this.session===e,n=e.options.maxDurationSec,r=n=>{t()&&(n!==e.lastTick?(e.lastTick=n,this.ui&&this.ui.updateTimer(n),this.sendRecordingState(e)):e.paused&&Date.now()-e.lastStateAt>=1e3&&this.sendRecordingState(e))},o=n=>{t()&&this.onRecordingStopped(e,n)},i=n=>{t()&&this.failSession(e,"failed",nd(n))};if(this.usesScreenRecording(e)){const a=Ps(xr());this.applyVeil(e);const s=e.veil;return e.phase="starting",this.ui.showRecordBar({busy:!0,mic:this.micState(e),interrupted:e.interrupted}),void a.then((e=>(s?s.ready():Promise.resolve()).then((()=>e)))).then((a=>{if(!t())return eu(a),null;const l=new Rs({maxDurationSec:n,onTick:r,onStop:o,onError:i,onReleased:()=>{s&&this.liftVeil(e,s)}});return e.recording=l,l.start(a,!!this.micState(e)&&e.micOn).then((n=>{t()?this.onRecordingStarted(e,l.startedAt,n.hasMicrophone):l.cancel()}))})).catch((n=>{t()&&this.offerPageRecording(e,n)}))}const a=new _s({maxDurationSec:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),onTick:r,onStop:o,onError:i});e.recording=a,a.start(),this.onRecordingStarted(e,a.startedAt,!1)}offerPageRecording(e,t){const n=t&&t.name;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e),e.phase="fallback",e.recording=null,e.fallbackState="NotAllowedError"===n||"SecurityError"===n?"declined":"failed",e.fallbackReason=nd(t),this.ui.showPageRecordingOffer(),this.persist(e),this.sendState(e.requestId,"bar")}sendRecordingState(e){e.lastStateAt=Date.now();const t={elapsedSec:Math.max(0,e.lastTick)};e.paused&&(t.paused=!0),this.sendState(e.requestId,"recording",t)}togglePause(e){const t=e.recording;if("recording"!==e.phase||!t||"function"!=typeof t.pause)return;const n=Date.now();if(e.paused){if(!t.resume())return;e.paused=!1,e.timeline&&e.timeline.resume(n)}else{if(!t.pause())return;e.paused=!0,e.timeline&&e.timeline.pause(n)}this.ui&&this.ui.setPaused(e.paused),this.sendRecordingState(e)}onRecordingStarted(e,t,n){e.phase="recording",e.interrupted=!1,e.paused=!1,e.hasMicrophone=!!n,e.lastTick=0,e.timeline=new zs({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isOwnElement:e=>!(!this.ui||!this.ui.isOwnElement(e))}),e.timeline.start(t),this.ui.showRecordingBar({mic:e.hasMicrophone?{available:!0,on:e.micOn}:null,maxSec:e.options.maxDurationSec,canPause:this.usesScreenRecording(e)&&br()&&!!e.recording&&!!e.recording.pause}),this.persist(e),this.sendRecordingState(e)}toggleMicrophone(e){"recording"!==e.phase&&"bar"!==e.phase&&"interrupted"!==e.phase||(e.micOn=!e.micOn,"recording"===e.phase&&e.recording&&e.recording.setMicrophoneEnabled&&e.recording.setMicrophoneEnabled(e.micOn),this.ui.setMicOn(e.micOn))}onRecordingStopped(e,t){this.liftVeil(e),e.recording=null,e.result=t,e.pauses=e.timeline?e.timeline.pauses.map((e=>[e[0],e[1]||t.endedAt])):[],e.timelineEntries=e.timeline?e.timeline.stop(t.endedAt):[];const n=e.timeline?e.timeline.interactions:0;e.timeline=null,e.phase="preview",e.paused=!1;const r=0===t.type.indexOf("video/");this.ui.showPreview({video:r?t.blob:null,durationMs:t.durationMs,interactions:n,audio:r?!!e.hasMicrophone:void 0}),this.persist(e),this.sendState(e.requestId,"preview")}retakeRecording(e){"preview"===e.phase&&(e.result=null,e.uploadedUrl=null,e.timelineEntries=null,e.pauses=null,e.phase="bar",e.interrupted=!1,this.renderBar(e),this.persist(e),this.sendState(e.requestId,"bar"))}sendRecording(e){const t=e.result;if("preview"!==e.phase||!t)return;const n=()=>this.session===e;e.phase="uploading",this.ui.setUploading(0),this.sendState(e.requestId,"uploading",{progress:0});let r=null;if(this.attachesLogs(e))try{r=nl({include:e.options.include,windowStart:t.startedAt,windowEnd:t.endedAt,pauses:e.pauses||[],deviceId:this.getDeviceId()})}catch(a){}const o=t=>{if(!n())return;this.ui&&this.ui.setUploading(t);const r=Date.now();(r-e.lastProgressSent>250||t>=1)&&(e.lastProgressSent=r,this.sendState(e.requestId,"uploading",{progress:Math.round(100*t)/100}))};let i;e.uploadedUrl?i=Promise.resolve(e.uploadedUrl):(e.upload=((e,t,n)=>{let r=null;return{promise:new Promise(((o,i)=>{try{const a=Bm.getInstance(),s=new FormData;s.append("file",e,t),r=new XMLHttpRequest,r.open("POST",a.apiUrl+"/uploads/attachments"),a.injectSession(r),r.upload&&n&&(r.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&n(Math.min(1,e.loaded/e.total))}),r.onreadystatechange=()=>{if(4!==r.readyState)return;const e=$s(r.responseText);200===r.status&&e&&Array.isArray(e.fileUrls)&&"string"==typeof e.fileUrls[0]?o(e.fileUrls[0]):i(new Error(413===r.status?"file-too-large":"upload-failed-"+r.status))},r.onerror=()=>i(new Error("upload-failed")),r.onabort=()=>i(new Error("upload-aborted")),r.send(s)}catch(a){i(a)}})),abort:()=>{try{r&&r.abort()}catch(a){}}}})(t.blob,t.fileName,o),i=e.upload.promise),i.then((o=>{if(!n())return null;e.upload=null,e.uploadedUrl=o;const i={url:o,name:t.fileName,type:t.type,size:t.blob.size,durationMs:t.durationMs};return t.width>0&&t.height>0&&(i.width=t.width,i.height=t.height),(a=e.requestId,s={files:[i],method:t.method,platform:dr,sdkType:ur,sdkVersion:vr(),deviceId:this.getDeviceId(),annotations:[],timeline:e.timelineEntries||[],recordingStartedAt:new Date(t.startedAt).toISOString(),recordingEndedAt:new Date(t.endedAt).toISOString()},Ks(a,"complete",s)).then((o=>{if(n())if(rd(o.status)){r&&this.postLogs(e.requestId,r);const n=this.ui?this.ui.getPosterDataUrl():null,o=this.ui?this.ui.getPreviewRect():null;this.flight=n&&o?{requestId:e.requestId,src:n,from:o,at:Date.now()}:null;const i=0===t.type.indexOf("video/");this.endSession(e,{restore:!0});const a={durationSec:Math.floor((t.durationMs||0)/1e3)};n&&(a.thumbnail=n),i&&(a.audio=!!e.hasMicrophone),this.sendState(e.requestId,"done",a)}else 409===o.status||410===o.status?(this.endSession(e,{restore:!0}),this.sendState(e.requestId,"failed",{error:409===o.status?"already-completed":"request-closed"})):this.onUploadFailed(e,"complete-"+o.status)}));var a,s})).catch((t=>{n()&&this.onUploadFailed(e,nd(t))}))}onUploadFailed(e,t){e.upload=null,e.phase="preview",this.ui&&this.ui.setPreviewError(e.labels.failed),this.sendState(e.requestId,"preview",{error:t})}hideGleapUi(){try{const e=document.querySelectorAll(Zu);for(let t=0;t{try{e.style.removeProperty("visibility")}catch(t){}})),this.hiddenElements=[]}startWatchdog(){this.stopWatchdog(),this.watchdog=setInterval((()=>{try{this.ui&&this.ui.ensureAttached(),this.hideGleapUi()}catch(e){}}),1e3)}stopWatchdog(){this.watchdog&&(clearInterval(this.watchdog),this.watchdog=null)}persist(e){if(this.session!==e)return;let t=null;if(-1!==["bar","capturing","starting","fallback"].indexOf(e.phase)?t=e.interrupted?"recording":"bar":"recording"===e.kind&&-1!==["recording","preview","uploading","interrupted"].indexOf(e.phase)&&(t="recording"),!t)return void ed(Ku,null);let n=null,r=null;try{const e=Bm.getInstance();n=e.session?e.session.gleapId:null,r=e.sdkKey}catch(o){}try{ed(Ku,JSON.stringify({v:1,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken,options:e.options,labels:e.rawLabels,phase:t,pageRecording:!0===e.pageRecording,gleapId:n,sdkKey:r,at:e.createdAt}))}catch(o){}}resumeFromStorage(){try{if(this.session)return;const n=Qu(Ku);if(!n)return;let r=null;try{r=JSON.parse(n)}catch(t){}const o=Bm.getInstance();if(!(r&&1===r.v&&"string"==typeof r.requestId&&("screenshot"===r.kind||"recording"===r.kind)&&"number"==typeof r.at&&Date.now()-r.at<18e5&&o.session&&r.gleapId===o.session.gleapId&&r.sdkKey===o.sdkKey)||!Er())return void ed(Ku,null);(e=r.requestId,Js("GET","/v3/shared/capture-requests/"+encodeURIComponent(String(e)))).then((e=>{try{const t=e.data;if(e.status>=400&&e.status<500||t&&-1!==Yu.indexOf(t.status)||t&&t.expiresAt&&Date.parse(t.expiresAt)100&&this.handledLogRequests.shift(),e.expiresAt&&Date.parse(e.expiresAt){this.collectLogs(t,n).catch((()=>{}))}))}catch(t){}}collectLogs(e,t){if(!fr())return Xs(e,"unsupported","disabled-by-app");if(!1===yr().backgroundLogs)return Xs(e,"unsupported","disabled-by-project");const n=this.getDeviceId();return((e,t)=>Ks(e,"claim",t))(e,{deviceId:n,platform:dr,sdkType:ur,sdkVersion:vr()}).then((r=>!rd(r.status)||r.data&&r.data.claimedElsewhere?null:Promise.resolve().then((()=>Qs(e,nl({include:t.include,deviceId:n})))).then((t=>rd(t.status)?null:Xs(e,"failed","logs-"+t.status)),(t=>Xs(e,"failed",nd(t))))))}}function sd(e){return sd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sd(e)}function ld(e){return function(e){if(Array.isArray(e))return cd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return cd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1])||arguments[1],o=(t=e.innerText||"",n=40,t.length>n?t.slice(0,n)+"...":t).replace(/(\r\n|\n|\r)/gm,"").replace(/ +(?= )/g,""),i="",a="";if(void 0!==e.getAttribute){var s=e.getAttribute("id");s&&(i=' id="'.concat(s,'"'));var l=e.getAttribute("class");l&&(a=' class="'.concat(l,'"'))}var c=(e.tagName||"").toLowerCase(),u="<",d=">";return r||(u="[",d="]"),"".concat(u).concat(c).concat(i).concat(a).concat(d).concat(o).concat(u,"/").concat(c).concat(d)}(e.target),"CLICK")}}))}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&wd(t.prototype,n),r&&wd(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Id(e){return Id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Id(e)}function Dd(e,t){for(var n=0;n0)for(var e=0;e0&&(t+="#"+e.id);var n="";"string"==typeof e.className?n=e.className:"function"==typeof e.getAttribute&&(n=e.getAttribute("class")||"");for(var r=n.trim().split(/\s+/).filter(Boolean).slice(0,5),o=0;o"}if(3===e.nodeType){var i=String(e.nodeValue||"").trim();return'#text "'+(i.length>40?i.slice(0,40)+"\u2026":i)+'"'}return String(e.nodeName).toLowerCase()},zd=function e(t,n){try{var r="Error",o="",i="";try{r=t.name?String(t.name):"Error",o=void 0!==t.message&&null!==t.message?String(t.message):"",i="string"==typeof t.stack?t.stack.trim():""}catch(u){}var a=o.length>0?r+": "+o:r,s=a;if(i.length>0)s=(o.length>0?-1!==i.indexOf(o):0===i.indexOf(r))?i:a+"\n"+i;var l,c=n||0;try{l=t.cause}catch(u){}return null!=l&&c<3&&(s+="\nCaused by: "+(_d(l)?e(l,c+1):Xd(l,1e3))),s}catch(u){return"Error"}},Wd=function(e,t){var n=e.maxLength-e.length;if(t.length>n)throw e.parts.push(t.slice(0,Math.max(0,n))),e.length=e.maxLength,e.truncated=!0,jd;e.parts.push(t),e.length+=t.length},Gd=function(e,t){var n=e.maxLength-e.length;Wd(e,JSON.stringify(t.length>n?t.slice(0,n):t))},Vd=function(e,t){try{return{value:e[t]}}catch(n){return{failed:!0}}},$d=function(e,t,n,r,o,i){Wd(e,t);for(var a=Math.min(r,100),s=0;s0&&Wd(e,","),o(s,i+1);r>a&&Wd(e,",\u2026 "+(r-a)+" more"),Wd(e,n)},Jd=function e(t,n,r){var o=Nd(n);if(null!==n)if("string"!==o)if("number"!==o&&"boolean"!==o&&"undefined"!==o)if("bigint"!==o)if("symbol"!==o)if("function"!==o)if(-1===t.seen.indexOf(n))if(_d(n)){var i="Error",a="";try{i=String(n.name||"Error"),a=String(n.message||"")}catch(f){}Gd(t,a?i+": "+a:i)}else if(Ud(n))Wd(t,qd(n));else if(function(e){return!!e&&"object"===Nd(e)&&e.window===e&&!!e.document}(n))Wd(t,"[Window]");else{var s=Bd(n);if("[object Date]"!==s)if("[object RegExp]"!==s)if("[object Promise]"!==s&&"[object WeakMap]"!==s&&"[object WeakSet]"!==s)if("[object ArrayBuffer]"!==s&&"[object SharedArrayBuffer]"!==s)if("undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(n))Wd(t,s.slice(8,-1)+"("+("number"==typeof n.length?n.length:n.byteLength)+")");else if(r>=t.maxDepth)Wd(t,Array.isArray(n)?"[Array]":"[Object]");else{t.seen.push(n);try{if(Array.isArray(n))return void $d(t,"[","]",n.length,(function(r,o){var i=Vd(n,r);i.failed?Wd(t,'"[unreadable]"'):e(t,i.value,o)}),r);if("[object Map]"===s){var l=[];return n.forEach((function(e,t){l.length<100&&l.push([t,e])})),void $d(t,"Map("+n.size+"){","}",n.size,(function(n,r){e(t,l[n][0],r),Wd(t," => "),e(t,l[n][1],r)}),r)}if("[object Set]"===s){var c=[];return n.forEach((function(e){c.length<100&&c.push(e)})),void $d(t,"Set("+n.size+")[","]",n.size,(function(n,r){return e(t,c[n],r)}),r)}if("function"==typeof n.toJSON){var u;try{u=n.toJSON()}catch(f){u=n}if(u!==n)return void e(t,u,r)}var d=Object.keys(n),p=function(e){try{var t=Object.getPrototypeOf(e);if(!t||t===Object.prototype)return"";var n=t.constructor;return n&&"string"==typeof n.name&&"Object"!==n.name?n.name:""}catch(f){return""}}(n);$d(t,(p?p+" ":"")+"{","}",d.length,(function(r,o){Gd(t,d[r]),Wd(t,":");var i=Vd(n,d[r]);i.failed?Wd(t,'"[unreadable]"'):e(t,i.value,o)}),r)}finally{t.seen.pop()}}else Wd(t,s.slice(8,-1)+"("+n.byteLength+")");else Wd(t,s.slice(8,-1));else Wd(t,String(n));else{var h=n.getTime();Gd(t,isNaN(h)?"Invalid Date":n.toISOString())}}else Wd(t,'"[Circular]"');else Wd(t,Hd(n));else Wd(t,n.toString());else Wd(t,n.toString()+"n");else Wd(t,String(n));else Gd(t,n);else Wd(t,"null")},Kd=function(e,t,n){var r=function(e,t){return{parts:[],length:0,maxLength:e,maxDepth:t,seen:[],truncated:!1}}(t,"number"==typeof n?n:1/0);try{Jd(r,e,0)}catch(o){if(o!==jd)return{text:r.parts.join("")+"[unserializable]",truncated:!1}}return{text:r.parts.join(""),truncated:r.truncated}},Xd=function(e,t){var n="number"==typeof t&&t>0?t:5e3;try{if("string"==typeof e)return e.length>n?e.slice(0,n):e;if(null==e||"number"==typeof e||"boolean"==typeof e)return String(e);if("bigint"==typeof e)return e.toString()+"n";if("symbol"===Nd(e))return e.toString();if("function"==typeof e)return Hd(e);if(_d(e)){var r=zd(e);return r.length>n?r.slice(0,n):r}if(Ud(e))return qd(e);if("[object Date]"===Bd(e)){var o=e.getTime();return isNaN(o)?"Invalid Date":e.toISOString()}return Kd(e,n,4).text}catch(i){try{return Bd(e)}catch(a){return"[unserializable]"}}},Yd=function(e){try{return"bigint"==typeof e?e:"symbol"===Nd(e)?NaN:Number(e)}catch(t){return NaN}},Zd=function(e){var t=Yd(e);return"bigint"==typeof t?t.toString()+"n":isNaN(t)?"NaN":String(t<0?Math.ceil(t):Math.floor(t))},Qd=function(e){var t=Yd(e);return String("bigint"==typeof t?Number(t):t)},ep=function(e,t){var n="number"==typeof t&&t>0?t:5e3;try{if(!e||0===e.length)return"";var r="",o=0,i=e[0];if("string"==typeof i&&e.length>1&&-1!==i.indexOf("%")){o=1;for(var a=0;a=e.length)r+=s;else{var c=e[o++];a++;var u=Math.max(1,n-r.length);"s"===l?r+=Xd(c,u):"d"===l||"i"===l?r+=Zd(c):"f"===l?r+=Qd(c):"c"!==l&&(r+="string"==typeof c?JSON.stringify(c.slice(0,u)):Xd(c,u))}else r+="%",a++}else r+=s}}for(;o0&&(r+=" "),r+=Xd(e[o],Math.max(1,n-r.length));return r.length>n?r.slice(0,n):r}catch(d){return"[unserializable console arguments]"}};function tp(e){return tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tp(e)}function np(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"INFO";if(null!=e&&("string"!=typeof e&&(e=Xd(e,sp)),!(e.length<=0)))for(this.logArray.push({log:lp(e,t),date:(new Date).toISOString(),priority:t});this.logArray.length>this.logMaxLength;)this.logArray.shift()}},{key:"addLogWithArgs",value:function(e,t){!e||e.length<=0||this.addLog(ep(e,sp),t)}},{key:"capture",value:function(e){if(!this.disabled&&!this.capturing){this.capturing=!0;try{e()}catch(t){}finally{this.capturing=!1}}}},{key:"wrapConsoleMethod",value:function(e,t,n){var r=e[t];if("function"==typeof r&&!r.__gleapConsoleWrapper){var o=function(){return n(arguments),r.apply(e,arguments)};o.__gleapConsoleWrapper=!0,this.originalConsoleMethods[t]=r,this.consoleWrappers[t]=o,e[t]=o}}},{key:"start",value:function(){var e=this;if(!this.disabled&&!this.started&&"undefined"!=typeof window){this.started=!0;var t=this,n=window.console;if(n){for(var r=Object.keys(ip),o=function(){var o=r[i];e.wrapConsoleMethod(n,o,(function(e){t.capture((function(){return t.addLogWithArgs(e,ip[o])}))}))},i=0;i0&&e[0]||t.capture((function(){var n=ep(Array.prototype.slice.call(e,1),sp);t.addLog("Assertion failed"+(n?": "+n:""),"ERROR")}))}))}try{this.errorListener=function(e){t.capture((function(){return t.addUncaughtError(e)}))},this.rejectionListener=function(e){t.capture((function(){var n=e?e.reason:void 0;t.addLog("Unhandled promise rejection: "+Xd(n,sp),"ERROR")}))},window.addEventListener("error",this.errorListener),window.addEventListener("unhandledrejection",this.rejectionListener)}catch(a){}}}},{key:"addUncaughtError",value:function(e){if(e&&("undefined"==typeof ErrorEvent||e instanceof ErrorEvent)){var t,n=e.error;t=n&&"object"===tp(n)&&"string"==typeof n.stack&&n.stack.length>0?zd(n):null!=n?Xd(n,sp)+cp(e):String(e.message||"Script error.").replace(/^Uncaught\s+/,"")+cp(e),this.addLog("Uncaught "+t,"ERROR")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&np(t.prototype,n),r&&np(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function dp(e){return dp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dp(e)}function pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hp(e){for(var t=1;t0&&-1===t.indexOf(r)&&t.push(r)}return t},Lp=function(e,t){if("string"!=typeof e||!Array.isArray(t))return!1;for(var n=0;n0&&-1!==e.indexOf(r))return!0}return!1},Fp=function(e,t){return"string"==typeof t&&-1!==e.props.indexOf(t.toLowerCase())},Op=function(e,t){for(var n={},r=!1,o=Object.keys(e),i=0;i0&&Fp(t,l)?o=!0:r.push(a)}return o?r.join("&"):e},jp=function(e){if(e>500)throw new Error("Network log body is nested too deeply to redact.")},Bp=function e(t,n,r){jp(r);var o=!1;if(Array.isArray(t)){for(var i=0;i0&&-1===n.indexOf(i)&&n.push(i)}for(var a=Hp.exec(e),s=a?e.slice(0,a.index):e,l=s,c=0;c0?"?"+a:"")+(-1===n?"":e.slice(n))}(n.url,t)),n.request&&"object"===Sp(n.request)&&!Array.isArray(n.request)){var r=Object.assign({},n.request),o=Pp(r.headers,"content-type");void 0!==r.headers&&(r.headers=Mp(r.headers,t)),void 0!==r.payload&&(r.payload=zp(r.payload,o,t)),n.request=r}if(n.response&&"object"===Sp(n.response)&&!Array.isArray(n.response)){var i=Object.assign({},n.response),a=Pp(i.headers,"content-type");void 0!==i.headers&&(i.headers=Mp(i.headers,t)),void 0!==i.responseText&&(i.responseText=zp(i.responseText,a,t)),n.response=i}return n},Gp=function(e,t){var n=[];if(!Array.isArray(e))return n;for(var r=function(e){for(var t=Tp(e).map((function(e){return e.toLowerCase()})),n=[],r=0;r0}))&&n.push(o)}return{props:t,paths:n}}(t&&t.propsToIgnore),o=Tp(Cp.concat(t&&t.blacklist||[])),i=0;i=55296&&n<=56319&&(t-=1),e.slice(0,t)+ih(e.length<=1e6?function(e){for(var t=0,n=0;n=55296&&r<=56319&&n+1=56320&&o<=57343?(t+=4,n++):t+=3}else t+=3}return t}(e):void 0)},sh=function(e,t){for(var n=t.toLowerCase(),r=Object.keys(e),o=0;o=2&&lh(t,String(e[n][0]),String(e[n][1]));else for(var r=Object.keys(e),o=0;o0&&lh(t,n[r].slice(0,o).trim(),n[r].slice(o+1).trim())}return t},ph=function(e){var t=String(e);try{var n="undefined"!=typeof document&&document.baseURI?document.baseURI:"undefined"!=typeof window&&window.location?window.location.href:void 0;return new URL(t,n).href}catch(r){return t}},hh=function(e,t,n,r){var o,i=e.byteLength>Xp||"number"==typeof r&&r>Xp,a=e.byteLength>Xp?e.subarray(0,Xp):e;try{if(n){if(-1!==(o=new TextDecoder("utf-8",{fatal:!0}).decode(a,{stream:i})).indexOf("\0"))return Zp}else o=function(e){var t=/charset\s*=\s*"?([^";\s]+)/i.exec(e||"");if(t)try{return new TextDecoder(t[1])}catch(n){}return new TextDecoder("utf-8")}(t).decode(a,{stream:i})}catch(s){return n?Zp:Ip}return i?o+ih("number"==typeof r?r:void 0):o},fh=function(e,t,n){var r=e.getReader(),o=[],i=0,a=function(e){for(var r=new Uint8Array(i),a=0,s=0;s0&&(o.push(n instanceof Uint8Array?n:new Uint8Array(n)),i+=n.byteLength),i>Xp){try{r.cancel().catch((function(){}))}catch(s){}return a(!1)}return e()}))}()},gh=function(e,t,n){var r=e.size>Xp?e.slice(0,150001):e;return("function"==typeof r.arrayBuffer?r.arrayBuffer():new Promise((function(e,t){var n=new FileReader;n.onload=function(){return e(n.result)},n.onerror=function(){return t(n.error)},n.readAsArrayBuffer(r)}))).then((function(r){return hh(new Uint8Array(r),t,n,e.size)}))},mh=function(e,t){if(null==e)return{text:""};try{var n=nh(t);if("stream"===n)return{text:Qp};if("string"==typeof e)return{text:"binary"===n?Zp:ah(e)};var r=function(e){return Object.prototype.toString.call(e)}(e);if("[object URLSearchParams]"===r)return{text:ah(e.toString())};if("[object FormData]"===r)return{text:(s=e,l={},s.forEach((function(e,t){var n;n="string"==typeof e?e.length>1e4?e.slice(0,1e4)+"\u2026 [truncated]":e:"[file "+(e&&e.name?e.name:"blob")+", "+(e&&"number"==typeof e.size?e.size:0)+" bytes"+(e&&e.type?", "+e.type:"")+"]",Object.prototype.hasOwnProperty.call(l,t)?l[t]=[].concat(l[t],n):Object.defineProperty(l,t,{value:n,enumerable:!0,writable:!0,configurable:!0})})),ah(JSON.stringify(l)))};if("[object ReadableStream]"===r)return{text:Qp};if("[object Blob]"===r||"[object File]"===r){var o=t||e.type||"",i=nh(o);return"stream"===i?{text:Qp}:"binary"===i?{text:Zp}:{text:Yp,promise:gh(e,o,"unknown"===i)}}if("[object ArrayBuffer]"===r||"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)){if("binary"===n)return{text:Zp};var a="[object ArrayBuffer]"===r?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{text:hh(a,t,"unknown"===n,a.byteLength)}}return"[object Document]"===r||"[object HTMLDocument]"===r||"[object XMLDocument]"===r?{text:Ip}:{text:"binary"===n?Zp:ah(String(e))}}catch(c){return{text:Ip}}var s,l},vh=function(e,t,n){e[t]=n.text,n.promise&&n.promise.then((function(n){e[t]=n}),(function(){e[t]=Ip}))},yh=function(e){try{if(e&&"object"===Kp(e)){var t=e.name?String(e.name):"Error",n=e.message?String(e.message):"";return n?t+": "+n:t}return String(e)}catch(r){return"Error"}},bh=function(e,t){return"abort"===e?"AbortError: The request was aborted.":"timeout"===e?"TimeoutError: The request timed out"+(t.timeout?" after "+t.timeout+" ms.":"."):"string"==typeof e&&-1!==e.indexOf(":")?e:"NetworkError: The request failed."},wh=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),$p(this,"requestId",0),$p(this,"requests",{}),$p(this,"externalRequests",[]),$p(this,"maxRequests",30),$p(this,"localFilters",[]),$p(this,"remoteFilters",[]),$p(this,"localBlacklist",[]),$p(this,"sdkApiUrlEntry",null),$p(this,"remoteBlacklist",[]),$p(this,"initialized",!1),$p(this,"stopped",!1),$p(this,"loadAllResources",!1),$p(this,"internalXhrs","undefined"!=typeof WeakSet?new WeakSet:null),$p(this,"internalUrls",new Map)}var t,n,r;return t=e,n=[{key:"ignoreInternalRequest",value:function(e,t,n){try{if(t&&this.internalXhrs&&this.internalXhrs.add(t),!e)return;var r=ph(e),o="number"==typeof n&&isFinite(n)?n:rh(),i=this.internalUrls.get(r);for(this.internalUrls.delete(r),this.internalUrls.set(r,"number"==typeof i?Math.min(i,o):o);this.internalUrls.size>300;)this.internalUrls.delete(this.internalUrls.keys().next().value)}catch(a){}}},{key:"isInternalResource",value:function(e){var t=this.internalUrls.get(e.name);return"number"==typeof t&&e.startTime>=t-5}},{key:"setLoadAllResources",value:function(e){this.loadAllResources=e}},{key:"setExternalRequests",value:function(e){var t=[];if(Array.isArray(e))for(var n=0;n0?e.timeOrigin:e.timing&&e.timing.navigationStart>0?e.timing.navigationStart:Date.now()-e.now()}(window.performance),s=window.performance.getEntriesByType("resource"),l=0;lthis.maxRequests?t.slice(t.length-this.maxRequests):t}},{key:"setMaxRequests",value:function(e){e>70&&(e=70),this.maxRequests=e}},{key:"setStopped",value:function(e){this.stopped=e}},{key:"setFilters",value:function(e){this.localFilters=Tp(e)}},{key:"setRemoteFilters",value:function(e){this.remoteFilters=Tp(e)}},{key:"setBlacklist",value:function(e){this.localBlacklist=Tp(e)}},{key:"setRemoteBlacklist",value:function(e){this.remoteBlacklist=Tp(e)}},{key:"getFilters",value:function(){return Tp(this.remoteFilters.concat(this.localFilters))}},{key:"setSdkApiUrl",value:function(e){this.sdkApiUrlEntry=function(e){if("string"!=typeof e)return null;var t=e.trim().replace(/\/+$/,"");return/^https?:\/\/[^/\s]+/i.test(t)?t:null}(e)}},{key:"getBlacklist",value:function(){return Tp(Cp.concat(this.sdkApiUrlEntry?[this.sdkApiUrlEntry]:[],this.remoteBlacklist,this.localBlacklist))}},{key:"isCapturing",value:function(){return this.initialized&&!this.stopped}},{key:"cleanRequests",value:function(){var e=Object.keys(this.requests);if(e.length>this.maxRequests)for(var t=e.slice(0,e.length-this.maxRequests),n=0;n=0&&c<=Xp)return void l.text().then((function(e){return i(ah(e))}),(function(){return i(Ip)}));i(Ip)}catch(u){i(Ip)}}},{key:"failFetch",value:function(e,t){var n=e.request;n.duration=oh(e.start),n.success=!1,n.response={errorText:yh(t)}}},{key:"interceptXhr",value:function(){if("undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof WeakMap){var e=this,t=new WeakMap,n=XMLHttpRequest.prototype,r=n.open,o=n.send,i=n.setRequestHeader;n.open=function(n,o){try{e.onXhrOpen(t,this,n,o)}catch(i){}return r.apply(this,arguments)},n.setRequestHeader=function(e,n){try{var r=t.get(this);r&&r.capture&&!r.request&&lh(r.headers,String(e),String(n))}catch(o){}return i.apply(this,arguments)},n.send=function(n){var r=!1;try{r=e.onXhrSend(t,this,n)}catch(i){}try{return o.apply(this,arguments)}catch(a){if(r)try{e.finishXhr(this,t.get(this),yh(a))}catch(i){}throw a}}}}},{key:"onXhrOpen",value:function(e,t,n,r){var o=e.get(t);if(o||(o={listening:!1},e.set(t,o)),o.request&&!o.finished){var i=4===t.readyState?void 0:"AbortError: The request was replaced by a new one.";this.finishXhr(t,o,i)}o.request=null,o.finished=!1,o.failure=null,o.headersAt=null,o.method=String(n||"GET").toUpperCase(),o.url=ph(r),o.headers={},o.capture=this.isCapturing()&&!(this.internalXhrs&&this.internalXhrs.has(t))&&!Lp(o.url,this.getBlacklist()),o.capture&&!o.listening&&(o.listening=!0,this.listenToXhr(t,o))}},{key:"listenToXhr",value:function(e,t){var n=this,r=function(n){return function(){4===e.readyState&&(t.failure=n)}};e.addEventListener("readystatechange",(function(){try{2===e.readyState&&t.request&&!t.finished&&n.recordXhrHeaders(e,t)}catch(r){}})),e.addEventListener("error",r("error")),e.addEventListener("abort",r("abort")),e.addEventListener("timeout",r("timeout")),e.addEventListener("loadend",(function(){try{4===e.readyState&&n.finishXhr(e,t)}catch(r){}}))}},{key:"onXhrSend",value:function(e,t,n){var r=e.get(t);if(!r||!r.capture||r.request||!this.isCapturing())return!1;var o=rh(),i=this.createRequest(r.method,r.url);if(!i)return r.capture=!1,!1;i.request.headers=Object.assign({},r.headers);var a="GET"!==r.method&&"HEAD"!==r.method;return vh(i.request,"payload",a?mh(n,ch(r.headers,"content-type")):{text:""}),r.request=i,r.start=o,!0}},{key:"recordXhrHeaders",value:function(e,t){t.headersAt=rh();var n=t.request;n.duration=Math.max(0,Math.round(t.headersAt-t.start)),n.success=!0,n.response={status:e.status,statusText:e.statusText||"",headers:dh(e.getAllResponseHeaders()),responseText:Yp}}},{key:"finishXhr",value:function(e,t,n){if(t&&t.request&&!t.finished){t.finished=!0;var r=t.request,o=n||t.failure||(0===e.status?"error":null);if(o)return r.duration=oh(t.start),r.success=!1,void(r.response={errorText:bh(o,e)});r.duration=t.headersAt?Math.max(0,Math.round(t.headersAt-t.start)):oh(t.start),r.success=!0;var i,a=dh(e.getAllResponseHeaders());try{i=function(e,t){var n=nh(ch(t,"content-type"));if("stream"===n)return Qp;var r=e.responseType;if(""===r||"text"===r){if("binary"===n)return Zp;var o=e.responseText;return"string"!=typeof o?"":"unknown"===n&&-1!==o.slice(0,Xp).indexOf("\0")?Zp:ah(o)}if("json"===r){if(null===e.response||void 0===e.response)return"";var i=Kd(e.response,Xp);return i.truncated?i.text+ih():i.text}return"document"===r?Ip:Zp}(e,a)}catch(s){i=Ip}r.response={status:e.status,statusText:e.statusText||"",headers:a,responseText:i}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Vp(t.prototype,n),r&&Vp(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();$p(wh,"instance",void 0);const kh=wh;function xh(e){return xh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xh(e)}function Sh(){Sh=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new L(r||[]);return o(a,"_invoke",{value:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(F([])));x&&x!==n&&r.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(o,i,a,s){var l=d(e[o],e,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==xh(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=f;var c=d(t,n,r);if("normal"===c.type){if(o=r.done?g:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function D(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,D(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function F(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Ch(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function Eh(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ch(i,r,o,a,s,"next",e)}function s(e){Ch(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ih(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"),e&&e.childNodes&&e.childNodes.length>0)for(var o=0;o1?t-1:0),o=1;o0&&(n--,t+=e[r]):t+=e[r];return t}(n)},Rh=function(e,t,n){for(var r,o=[],i=function(){var e=n.styleSheets[a];if(e.media&&"print"===e.media.mediaText)return 1;var i=Ph(e);if(e&&e.ownerNode)if(""!=i){var s=n.getElementsByTagName("base");r=s.length?s[0].href.substr(n.location.origin.length,999):n.location.href.split(/[?#]/)[0],e.href&&(r=e.href);var l=r.substring(0,r.lastIndexOf("/"));o.push(Lh(i,l,t).then((function(t){return{styletext:t,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}})))}else o.push(Promise.resolve({styletext:i,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}))},a=0;a0&&t>0&&Math.abs(e-t)>1?e/t:1};return{x:n(e.width,t.width),y:n(e.height,t.height)}},nf=function(e){for(var t=Zh(e);t;t=Zh(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return tf(t.getBoundingClientRect(),ef(t,n))}return{x:1,y:1}},rf=function(e,t){return{left:e.left/t.x,right:e.right/t.x,top:e.top/t.y,bottom:e.bottom/t.y,width:e.width/t.x,height:e.height/t.y}},of=function(e){var t=e.createElement("span");return Gh(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return Gh(t.style,e,"0")})),t},af=function e(t,n,r){return Yh(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(t);if("none"!==o.display&&!Kh(o))if("contents"===o.display||Jh(o))e(t,n,r);else{var i=rf(t.getBoundingClientRect(),n),a={left:i.left-Vh(o,"margin-left"),right:i.right+Vh(o,"margin-right"),top:i.top-Vh(o,"margin-top"),bottom:i.bottom+Vh(o,"margin-bottom"),verticalAlign:o.verticalAlign};0===o.display.indexOf("inline")?("baseline"!==a.verticalAlign||zh.test(t.localName)||(a.verticalAlign="middle"),r.atomicInlines.push(a)):r.blocks.push(a)}}})),r},sf=function(e,t,n){var r=function(e){return(e.top+e.bottom)/2},o=[];n.forEach((function(e){for(var n=0,i=1;ia.bottom-a.top)&&(o[n]=e)}));for(var i=0;i=a.top+a.height/2&&e.appendChild(e.ownerDocument.createElement("br"));var s=o[i],l=of(e.ownerDocument);Gh(l.style,"vertical-align",s?s.verticalAlign:"baseline"),$h(l.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(l)}},lf=function e(t,n,r){Yh(n).forEach((function(n){if(n.nodeType!==Node.TEXT_NODE){if(n.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(n).display;"contents"===o?e(t,n,r):"none"!==o&&t.appendChild(xf(n,t.ownerDocument,!0,r))}}else!function(e,t){var n=Qh(t);if(n.length){var r=nf(t),o=e.ownerDocument.createElement("span");Gh(o.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return Gh(o.style,e,"0")})),sf(o,n.map((function(e){return rf(e,r)})),[]),e.appendChild(o)}}(t,n)}))},cf=function(e){return!("block"!==e.display&&"list-item"!==e.display||Kh(e)||Xh(e)||/layout|paint|strict|content/.test(e.contain))},uf=function(e,t,n,r){if(!(t instanceof HTMLElement))return!1;var o=e.offsetTop,i=e.offsetTop+e.offsetHeight;if(t.offsetParent===e)o=0,i=e.clientHeight;else if(t.offsetParent!==e.offsetParent)return!1;var a=t.offsetTop-("relative"===n.position?Vh(n,"top"):0),s="top"===r?a-o:a+t.offsetHeight-i;return Math.abs(s)<=1},df=function(e,t,n,r){return r.push(Vh(t,"margin-"+n)),!cf(t)||Vh(t,"padding-"+n)||Vh(t,"border-"+n+"-width")||pf(e,Yh(e),n,r),r},pf=function e(t,n,r,o){"bottom"===r&&n.reverse();for(var i=0;i0))return!1;if(a.nodeType===Node.ELEMENT_NODE){var s=window.getComputedStyle(a);if("none"!==s.display&&!Kh(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!uf(t,a,s,r))return!1;if(df(a,s,r,o),0!==a.getBoundingClientRect().height||!cf(s))return!1;df(a,s,"top"===r?"bottom":"top",o)}else if(!e(t,Yh(a),r,o))return!1}}var l;return!0},hf=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},ff=null,gf=new Map,mf=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return gf.has(n)||((ff=ff||document.createElement("canvas").getContext("2d")).font=n,gf.set(n,ff.measureText("").fontBoundingBoxAscent)),gf.get(n)},vf=function e(t,n,r){var o=Yh(t);n&&o.reverse();for(var i=0;i0||t.scrollLeft>0)&&(m.setAttribute("bb-scrollpos",!0),m.setAttribute("bb-scrolltop",t.scrollTop),m.setAttribute("bb-scrollleft",t.scrollLeft)),"SELECT"!==v&&"TEXTAREA"!==v&&"INPUT"!==v||(y=rs(t,r),m.setAttribute("bb-data-value",y?y(t.value):t.value),y&&m.hasAttribute("value")&&m.setAttribute("value",y(m.getAttribute("value"))),"checkbox"!==t.type&&"radio"!==t.type||!t.checked||m.setAttribute("bb-data-checked",!0));case 42:if(o.appendChild(m),!t.shadowRoot){e.next=51;break}return C=i,i++,Bh(a,t.shadowRoot),e.next=49,g(t.shadowRoot.firstChild,m,C);case 49:jh(t.shadowRoot,m,C),void 0!==m.setAttribute&&m.setAttribute("bb-shadow-parent",C);case 51:if(y&&"TEXTAREA"===v){e.next=54;break}return e.next=54,g(t.firstChild,m);case 54:if(y&&"SELECT"===v)for(E=m.querySelectorAll("option[selected]"),I=0;I0){for(u=c.childNodes;u.length>0;)c.parentNode.insertBefore(u[0],c);c.remove()}for(d=s.querySelectorAll("script, noscript"),a=0;a({x:e,y:e}),Mf={left:"right",right:"left",bottom:"top",top:"bottom"},Pf={start:"end",end:"start"};function Rf(e,t,n){return Tf(e,Af(t,n))}function Nf(e,t){return"function"==typeof e?e(t):e}function jf(e){return e.split("-")[0]}function Bf(e){return e.split("-")[1]}function _f(e){return"x"===e?"y":"x"}function Uf(e){return"y"===e?"height":"width"}const Hf=new Set(["top","bottom"]);function qf(e){return Hf.has(jf(e))?"y":"x"}function zf(e){return _f(qf(e))}function Wf(e){return e.replace(/start|end/g,(e=>Pf[e]))}const Gf=["left","right"],Vf=["right","left"],$f=["top","bottom"],Jf=["bottom","top"];function Kf(e,t,n,r){const o=Bf(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Vf:Gf:t?Gf:Vf;case"left":case"right":return t?$f:Jf;default:return[]}}(jf(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Wf)))),i}function Xf(e){return e.replace(/left|right|bottom|top/g,(e=>Mf[e]))}function Yf(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Zf(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Qf(e,t,n){let{reference:r,floating:o}=e;const i=qf(t),a=zf(t),s=Uf(a),l=jf(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Bf(t)){case"start":h[a]-=p*(n&&c?-1:1);break;case"end":h[a]+=p*(n&&c?-1:1)}return h}async function eg(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Nf(t,e),f=Yf(h),g=s[p?"floating"===d?"reference":"floating":d],m=Zf(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=Zf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+f.top)/b.y,bottom:(w.bottom-m.bottom+f.bottom)/b.y,left:(m.left-w.left+f.left)/b.x,right:(w.right-m.right+f.right)/b.x}}const tg=new Set(["left","top"]);function ng(){return"undefined"!=typeof window}function rg(e){return ag(e)?(e.nodeName||"").toLowerCase():"#document"}function og(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ig(e){var t;return null==(t=(ag(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ag(e){return!!ng()&&(e instanceof Node||e instanceof og(e).Node)}function sg(e){return!!ng()&&(e instanceof Element||e instanceof og(e).Element)}function lg(e){return!!ng()&&(e instanceof HTMLElement||e instanceof og(e).HTMLElement)}function cg(e){return!(!ng()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof og(e).ShadowRoot)}const ug=new Set(["inline","contents"]);function dg(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Sg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ug.has(o)}const pg=new Set(["table","td","th"]);function hg(e){return pg.has(rg(e))}const fg=[":popover-open",":modal"];function gg(e){return fg.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const mg=["transform","translate","scale","rotate","perspective"],vg=["transform","translate","scale","rotate","perspective","filter"],yg=["paint","layout","strict","content"];function bg(e){const t=wg(),n=sg(e)?Sg(e):e;return mg.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||vg.some((e=>(n.willChange||"").includes(e)))||yg.some((e=>(n.contain||"").includes(e)))}function wg(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const kg=new Set(["html","body","#document"]);function xg(e){return kg.has(rg(e))}function Sg(e){return og(e).getComputedStyle(e)}function Cg(e){return sg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Eg(e){if("html"===rg(e))return e;const t=e.assignedSlot||e.parentNode||cg(e)&&e.host||ig(e);return cg(t)?t.host:t}function Ig(e){const t=Eg(e);return xg(t)?e.ownerDocument?e.ownerDocument.body:e.body:lg(t)&&dg(t)?t:Ig(t)}function Dg(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ig(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=og(o);if(i){const e=Ag(a);return t.concat(a,a.visualViewport||[],dg(o)?o:[],e&&n?Dg(e):[])}return t.concat(o,Dg(o,[],n))}function Ag(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tg(e){const t=Sg(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=lg(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Lf(n)!==i||Lf(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Lg(e){return sg(e)?e:e.contextElement}function Fg(e){const t=Lg(e);if(!lg(t))return Of(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Tg(t);let a=(i?Lf(n.width):n.width)/r,s=(i?Lf(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Og=Of(0);function Mg(e){const t=og(e);return wg()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Og}function Pg(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Lg(e);let a=Of(1);t&&(r?sg(r)&&(a=Fg(r)):a=Fg(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==og(e))&&t}(i,n,r)?Mg(i):Of(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=og(i),t=r&&sg(r)?og(r):r;let n=e,o=Ag(n);for(;o&&r&&t!==n;){const e=Fg(o),t=o.getBoundingClientRect(),r=Sg(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=og(o),o=Ag(n)}}return Zf({width:u,height:d,x:l,y:c})}function Rg(e,t){const n=Cg(e).scrollLeft;return t?t.left+n:Pg(ig(e)).left+n}function Ng(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Rg(e,n),y:n.top+t.scrollTop}}const jg=25;const Bg=new Set(["absolute","fixed"]);function _g(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=og(e),r=ig(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=wg();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=Rg(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=jg&&(i-=a)}else c<=jg&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=ig(e),n=Cg(e),r=e.ownerDocument.body,o=Tf(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Tf(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Rg(e);const s=-n.scrollTop;return"rtl"===Sg(r).direction&&(a+=Tf(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(ig(e));else if(sg(t))r=function(e,t){const n=Pg(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=lg(e)?Fg(e):Of(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Mg(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Zf(r)}function Ug(e,t){const n=Eg(e);return!(n===t||!sg(n)||xg(n))&&("fixed"===Sg(n).position||Ug(n,t))}function Hg(e,t,n){const r=lg(t),o=ig(t),i="fixed"===n,a=Pg(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Of(0);function c(){l.x=Rg(o)}if(r||!r&&!i)if(("body"!==rg(t)||dg(o))&&(s=Cg(t)),r){const e=Pg(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?Of(0):Ng(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function qg(e){return"static"===Sg(e).position}function zg(e,t){if(!lg(e)||"fixed"===Sg(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ig(e)===n&&(n=n.ownerDocument.body),n}function Wg(e,t){const n=og(e);if(gg(e))return n;if(!lg(e)){let t=Eg(e);for(;t&&!xg(t);){if(sg(t)&&!qg(t))return t;t=Eg(t)}return n}let r=zg(e,t);for(;r&&hg(r)&&qg(r);)r=zg(r,t);return r&&xg(r)&&qg(r)&&!bg(r)?n:r||function(e){let t=Eg(e);for(;lg(t)&&!xg(t);){if(bg(t))return t;if(gg(t))return null;t=Eg(t)}return null}(e)||n}const Gg={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=ig(r),s=!!t&&gg(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Of(1);const u=Of(0),d=lg(r);if((d||!d&&!i)&&(("body"!==rg(r)||dg(a))&&(l=Cg(r)),lg(r))){const e=Pg(r);c=Fg(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?Of(0):Ng(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:ig,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?gg(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Dg(e,[],!1).filter((e=>sg(e)&&"body"!==rg(e))),o=null;const i="fixed"===Sg(e).position;let a=i?Eg(e):e;for(;sg(a)&&!xg(a);){const t=Sg(a),n=bg(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Bg.has(o.position)||dg(a)&&!n&&Ug(e,a))?r=r.filter((e=>e!==a)):o=t,a=Eg(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce(((e,n)=>{const r=_g(t,n,o);return e.top=Tf(r.top,e.top),e.right=Af(r.right,e.right),e.bottom=Af(r.bottom,e.bottom),e.left=Tf(r.left,e.left),e}),_g(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Wg,getElementRects:async function(e){const t=this.getOffsetParent||Wg,n=this.getDimensions,r=await n(e.floating);return{reference:Hg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Tg(e);return{width:t,height:n}},getScale:Fg,isElement:sg,isRTL:function(e){return"rtl"===Sg(e).direction}};function Vg(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $g(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Lg(e),u=o||i?[...c?Dg(c):[],...Dg(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=ig(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-Ff(d)+"px "+-Ff(o.clientWidth-(u+p))+"px "+-Ff(o.clientHeight-(d+h))+"px "+-Ff(u)+"px",threshold:Tf(0,Af(1,l))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==l){if(!g)return a();r?a(!1,r):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==r||Vg(c,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let g=l?Pg(e):null;return l&&function t(){const r=Pg(e);g&&!Vg(g,r)&&n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Jg=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=jf(n),s=Bf(n),l="y"===qf(n),c=tg.has(a)?-1:1,u=i&&l?-1:1,d=Nf(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Kg=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Nf(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),p=qf(jf(o)),h=_f(p);let f=u[h],g=u[p];if(a){const e="y"===h?"bottom":"right";f=Rf(f+d["y"===h?"top":"left"],f,f-d[e])}if(s){const e="y"===p?"bottom":"right";g=Rf(g+d["y"===p?"top":"left"],g,g-d[e])}const m=l.fn({...t,[h]:f,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:s}}}}}},Xg=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=Nf(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=jf(o),y=qf(s),b=jf(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),k=p||(b||!g?[Xf(s)]:function(e){const t=Xf(e);return[Wf(e),t,Wf(t)]}(s)),x="none"!==f;!p&&x&&k.push(...Kf(s,g,f,w));const S=[s,...k],C=await l.detectOverflow(t,m),E=[];let I=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Bf(e),o=zf(e),i=Uf(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Xf(a)),[a,Xf(a)]}(o,a,w);E.push(C[e[0]],C[e[1]])}if(I=[...I,{placement:o,overflows:E}],!E.every((e=>e<=0))){var D,A;const e=((null==(D=i.flip)?void 0:D.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&y!==qf(t))||I.every((e=>qf(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}}}let n=null==(A=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(h){case"bestFit":{var T;const e=null==(T=I.filter((e=>{if(x){const t=qf(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Yg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Nf(e,t)||{};if(null==c)return{};const d=Yf(u),p={x:n,y:r},h=zf(o),f=Uf(h),g=await a.getDimensions(c),m="y"===h,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[h]-p[h]-i.floating[f],k=p[h]-i.reference[h],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let S=x?x[b]:0;S&&await(null==a.isElement?void 0:a.isElement(x))||(S=s.floating[b]||i.floating[f]);const C=w/2-k/2,E=S/2-g[f]/2-1,I=Af(d[v],E),D=Af(d[y],E),A=I,T=S-g[f]-D,L=S/2-g[f]/2+C,F=Rf(A,L,T),O=!l.arrow&&null!=Bf(o)&&L!==F&&i.reference[f]/2-(L{const r=new Map,o={platform:Gg,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Qf(c,r,l),p=r,h={},f=0;for(let m=0;m0)},nm=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(tm);if(0===n.length)return!0;var r=n.filter((function(e){return!em.includes(e.pageFilterType)})),o=n.filter((function(e){return em.includes(e.pageFilterType)})),i=0===r.length||r.some((function(t){return Qg(e,t.pageFilter,t.pageFilterType)})),a=0===o.length||o.every((function(t){return Qg(e,t.pageFilter,t.pageFilterType)}));return i&&a};function rm(e){return rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rm(e)}function om(e){return function(e){if(Array.isArray(e))return im(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return im(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return im(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function im(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n'):""),i.appendChild(c),o=c,t.elementToTooltipMap.set(e,n),t.anchorToElementMap.set(i,e)}else o=e;var u=t.createTooltip(o,n.html,n);t.elementToFloatingUIMap.set(e,sm(sm({},u),{},{anchor:i,positionedHost:a,data:n})),i&&t.repositionHotspot(e,n)}})),cm(this,"updateFilteredTooltips",(function(){t.lastUrl=window.location.href,t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),cm(this,"getFilteredTooltips",(function(){if(!t.tooltips)return[];var e=window.location.href;return t.tooltips.filter((function(t){return t.pageRules&&t.pageRules.length>0?nm(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!Qg(e,t.page,t.pageType)}))})),cm(this,"checkForTooltips",(function(){for(var e=0;e0&&this.filteredTooltips.forEach((function(n){n.selector&&et(e,n.selector)&&t.linkTooltip(e,n)}))}},{key:"start",value:function(){var e,t,n,r=this;"undefined"==typeof window||this.started||(this.started=!0,this.resizeListener=(e=r.updateHotspotPositions.bind(r),t=250,n=null,function(){if(!n){var r=this,o=arguments;n=setTimeout((function(){e.call.apply(e,[r].concat(om(o))),n=null}),t)}}),window.addEventListener("resize",this.resizeListener),this.urlCheckInterval=setInterval((function(){r.checkUrlChange()}),1e3),!this.observer&&"undefined"!=typeof MutationObserver&&document.documentElement&&(this.observer=new MutationObserver((function(e){r.checkUrlChange(),e.forEach((function(e){if("attributes"===e.type){var t=e.target;t.nodeType===Node.ELEMENT_NODE&&(t.querySelector("[data-gleap-tooltip-hotspot]")||t.hasAttribute("data-gleap-tooltip-mode")||t.hasAttribute("data-gleap-tooltip"))&&r.updateHotspotPositions()}e.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&r.processNodeInsertion(e)})),e.removedNodes.forEach((function(e){e.nodeType!==Node.ELEMENT_NODE||e.isConnected||r.processNodeRemoval(e)}))}))})),this.observer.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})))}},{key:"checkUrlChange",value:function(){var e=this;this.lastUrl!==window.location.href&&(this.lastUrl=window.location.href,this.filteredTooltips=this.getFilteredTooltips(),document.querySelectorAll("[data-gleap-tooltip]").forEach((function(t){var n=e.elementToFloatingUIMap.get(t);n&&-1===e.filteredTooltips.indexOf(n.data)&&e.unlinkElement(t)})),this.checkForTooltips())}},{key:"processNodeRemoval",value:function(e){var t=this,n=Array.from(e.querySelectorAll("[data-gleap-tooltip]"));e.hasAttribute("data-gleap-tooltip")&&n.push(e),n.forEach((function(e){t.elementToFloatingUIMap.has(e)&&t.unlinkElement(e)}));var r=Array.from(e.querySelectorAll("[data-gleap-tooltip-anchor]"));e.hasAttribute("data-gleap-tooltip-anchor")&&r.push(e),r.forEach((function(e){var n=t.anchorToElementMap.get(e),r=n?t.elementToFloatingUIMap.get(n):null;if(n&&n.isConnected&&r&&r.anchor===e){var o=r.data;t.unlinkElement(n),-1!==t.filteredTooltips.indexOf(o)&&t.linkTooltip(n,o)}}))}},{key:"isLinked",value:function(e){var t=this.elementToFloatingUIMap.get(e);return!(!t||t.anchor&&!t.anchor.isConnected||!t.tooltip||!t.tooltip.isConnected)}},{key:"unlinkElement",value:function(e){var t=this.elementToFloatingUIMap.get(e);if(t){try{t.cleanup()}catch(o){}t.tooltip&&t.tooltip.remove(),t.anchor&&t.anchor.remove(),this.restoreHost(t.positionedHost),this.elementToFloatingUIMap.delete(e)}var n=e.getAttribute("data-gleap-tooltip");if(null!==n){Array.from(e.children).forEach((function(e){e.getAttribute("data-gleap-tooltip-anchor")===n&&e.remove()}));var r=e.nextElementSibling;r&&r.getAttribute("data-gleap-tooltip-anchor")===n&&r.remove()}e.removeAttribute("data-gleap-tooltip"),e.removeAttribute("data-gleap-tooltip-mode"),this.elementToTooltipMap.delete(e)}},{key:"updateHotspotPositions",value:function(){var e=this;document.querySelectorAll("[data-gleap-tooltip-mode='hotspot']").forEach((function(t){var n=e.elementToTooltipMap.get(t);n&&e.repositionHotspot(t,n)}))}},{key:"createTooltip",value:function(e,t,n){var r=document.createElement("div");r.className="gleap-tooltip",r.innerHTML='
\n '.concat(t,'\n
\n \n \n \n
\n
'),document.body.appendChild(r),this.livePopups.add(r);var o,i=r.querySelector(".gleap-tooltip-arrow"),a=$g(e,r,(function(){Zg(e,r,{placement:"left"===n.posX?"left":"right",middleware:[Jg(10),Xg(),Kg(),Yg({element:i})]}).then((function(e){var t=e.x,n=e.y,o=e.middlewareData,a=e.placement;try{if(Object.assign(r.style,{left:"".concat(t,"px"),top:"".concat(n,"px")}),o.arrow){var s={left:"",top:"",transform:""};null!=o.arrow.x&&(s.left="".concat(o.arrow.x,"px"),"bottom"===a?(s.transform="translateY(-7px) rotate(180deg)",s.top="".concat(-20,"px")):"top"===a&&(s.transform="translateY(7px) rotate(0deg)",s.top="100%")),null!=o.arrow.y&&(s.top="".concat(o.arrow.y,"px"),"right"===a?(s.transform="translateX(-7px) rotate(90deg)",s.left="".concat(-20,"px")):"left"===a&&(s.transform="translateX(7px) rotate(270deg)",s.left="100%")),Object.assign(i.style,s)}}catch(l){}}))}));function s(){clearTimeout(o),r.style.visibility="visible",r.style.opacity="1",r.style.pointerEvents="auto"}function l(){o=setTimeout((function(){r.style.opacity="0",setTimeout((function(){r.style.visibility="hidden",r.style.pointerEvents="none"}),200)}),500)}return e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",l),r.addEventListener("mouseenter",s),r.addEventListener("mouseleave",l),e.addEventListener("click",l),r.addEventListener("click",l),{cleanup:function(){a(),clearTimeout(o),e.removeEventListener("mouseenter",s),e.removeEventListener("mouseleave",l),e.removeEventListener("click",l)},tooltip:r}}},{key:"canEmbed",value:function(e){var t=new Set(["area","base","br","embed","hr","img","input","source","track","wbr","canvas"]);return e&&!t.has(e.tagName.toLowerCase())}},{key:"destroy",value:function(){var e=this;this.observer&&(this.observer.disconnect(),this.observer=null),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.urlCheckInterval&&(clearInterval(this.urlCheckInterval),this.urlCheckInterval=null),document.querySelectorAll("[data-gleap-tooltip]").forEach((function(t){var n=e.elementToFloatingUIMap.get(t);if(n){try{n.cleanup()}catch(r){}e.restoreHost(n.positionedHost)}})),document.querySelectorAll(".gleap-tooltip").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip-anchor]").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip-hotspot]").forEach((function(e){return e.remove()})),document.querySelectorAll("[data-gleap-tooltip]").forEach((function(e){return e.removeAttribute("data-gleap-tooltip")})),document.querySelectorAll("[data-gleap-tooltip-mode]").forEach((function(e){return e.removeAttribute("data-gleap-tooltip-mode")})),this.elementToFloatingUIMap=new WeakMap,this.elementToTooltipMap=new WeakMap,this.anchorToElementMap=new WeakMap,this.livePopups=new WeakSet,this.tooltips=[],this.filteredTooltips=[],this.lastUrl=null,this.started=!1}},{key:"repositionHotspot",value:function(e,t){if(e&&t){var n=this.elementToFloatingUIMap.get(e),r=n?n.anchor:null;if(r){var o=r.querySelector("[data-gleap-tooltip-hotspot]");if(o){if(n.positionedHost&&n.positionedHost.host){var i=n.positionedHost.host;try{var a=window.getComputedStyle(i).position;a&&"static"!==a||(i.style.position="relative")}catch(v){}}t.posX||(t.posX="right"),t.posY||(t.posY="center"),t.offsetX=this.toOffset(t.offsetX,4),t.offsetY=this.toOffset(t.offsetY,0);var s=e.getBoundingClientRect(),l={left:s.left,top:s.top,width:s.width,height:s.height};try{if(r.parentNode===e){var c=document.createRange();c.setStart(e,0),c.setEndBefore(r);var u=c.getBoundingClientRect();if(u&&u.width>0){var d=u.right-l.left;d>0&&de.length)&&(t=e.length);for(var n=0,r=new Array(t);n4096)return!1;var t=e.split(".");return 3===t.length&&t.every((function(e){return vm.test(e)}))},wm=function(e){if(!bm(e))return null;try{var t,n=JSON.parse(ym(e.split(".")[1]));if(!n||"object"!==mm(n))return null;var r=null!==(t=n.userId)&&void 0!==t?t:n.user_id;return"string"==typeof r&&r.length>0||"number"==typeof r&&isFinite(r)?{userId:String(r),exp:"number"==typeof n.exp?n.exp:null}:null}catch(o){return null}},km=function(e){if(!bm(e))return null;try{var t=JSON.parse(ym(e.split(".")[1]));return t&&"object"===mm(t)?{sid:"string"==typeof t.sid?t.sid:null,uid:"string"==typeof t.uid?t.uid:null,iat:"number"==typeof t.iat?t.iat:null,exp:"number"==typeof t.exp?t.exp:null}:null}catch(n){return null}},xm=function(e){for(var t=5381,n=0;n>>0).toString(36)},Sm=["iat","exp","nbf","jti"],Cm=function e(t){return Array.isArray(t)?"["+t.map(e).join(",")+"]":t&&"object"===mm(t)?"{"+Object.keys(t).sort().map((function(n){return JSON.stringify(n)+":"+e(t[n])})).join(",")+"}":JSON.stringify(t)},Em=function(e){if(!bm(e))return null;try{var t=fm(e.split(".").slice(0,2).map((function(e){return JSON.parse(ym(e))})),2),n=t[0],r=t[1],o=function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Lm(e){return Lm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lm(e)}function Fm(e,t){for(var n=0;n0)){var e=t.contactSettledListeners;t.contactSettledListeners=[];for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:5e3;if(0!==t.pendingContactUpdates){var r=!1,o=null,i=function(){r||(r=!0,clearTimeout(o),e())};o=setTimeout(i,n),t.contactSettledListeners.push(i)}else e()})),Om(this,"injectSession",(function(e){e&&t.session&&(e.setRequestHeader("Api-Token",t.sdkKey),e.setRequestHeader("Gleap-Id",t.session.gleapId),e.setRequestHeader("Gleap-Hash",t.session.gleapHash),t.injectGrant(e))})),Om(this,"injectGrant",(function(e){if(e&&t.grant)try{e.setRequestHeader("Gleap-Grant",t.grant)}catch(n){}})),Om(this,"addGrantHeader",(function(e){return e&&t.grant&&(e["Gleap-Grant"]=t.grant),e})),Om(this,"grantCookieName",(function(){return"gleap-grant-".concat(t.sdkKey)})),Om(this,"setGrant",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="string"==typeof e&&e.length>0?e:null;if(r!==t.grant){if(t.grant=r,r&&t.rememberSignedSession(km(r)),t.useCookies)try{if(r){var o=km(r),i=o&&null!==o.exp?(1e3*o.exp-Date.now())/864e5:7;i>0?le(t.grantCookieName(),encodeURIComponent(r),i,!0):ue(t.grantCookieName())}else ue(t.grantCookieName())}catch(a){}t.scheduleGrantRefresh(r?Date.now():null),n&&t.pushSessionUpdate()}})),Om(this,"hasLiveGrant",(function(){if(!t.grant)return!1;var e=km(t.grant);return!!e&&(null===e.exp||1e3*e.exp>Date.now())})),Om(this,"grantRefreshTime",(function(e,t){if(!e||null===e.exp)return null;var n=Date.now(),r=t&&null!==e.iat&&e.exp>e.iat?1e3*(e.exp-e.iat)-(n-t):1e3*e.exp-n;return n+Math.max(3e4,r-6e4)})),Om(this,"scheduleGrantRefresh",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;clearTimeout(t.grantRefreshTimeout),t.grantRefreshTimeout=null,t.grantRefreshAt=t.grantRefreshTime(t.grant?km(t.grant):null,e),null!==t.grantRefreshAt&&t.armGrantRefresh(t.grant,t.grantRefreshAt)})),Om(this,"armGrantRefresh",(function(e,n){clearTimeout(t.grantRefreshTimeout);var r=Math.min(Math.max(0,n-Date.now()),2147483647);t.grantRefreshTimeout=setTimeout((function(){if(t.grantRefreshTimeout=null,t.grant===e){var r=Date.now();if(n-r>1e3)t.armGrantRefresh(e,n);else if(t.grantRefreshInFlight||t.identifyInFlight)t.armGrantRefresh(e,r+6e4);else if(r-t.lastGrantRefreshAt0&&void 0!==arguments[0]?arguments[0]:null;clearTimeout(t.signedSessionExpiryTimeout),t.signedSessionExpiryTimeout=null;var n=t.currentSignedSession();if(n&&null!==n.exp&&!(null===e&&1e3*n.exp<=Date.now())){var r=null!==e?e:1e3*n.exp,o=Math.min(Math.max(0,r-Date.now()),2147483647);t.signedSessionExpiryTimeout=setTimeout((function(){t.signedSessionExpiryTimeout=null,t.onSignedSessionExpiryDue(r)}),o)}})),Om(this,"onSignedSessionExpiryDue",(function(e){if(Date.now()Date.now())){if(t.useCookies)try{var r=ce(t.grantCookieName()),o=r?decodeURIComponent(r):null,i=o?km(o):null;if(i&&i.sid===t.session.gleapId&&null!==i.exp&&1e3*i.exp>Date.now())return void t.setGrant(o)}catch(a){}t.hasLiveGrant()||(t.messengerOpen()&&Date.now()<1e3*n.exp+36e5?t.armSignedSessionExpiry(Date.now()+6e4):t.startSession())}}})),Om(this,"messengerOpen",(function(){try{var e=wv.getInstance();return!(!e||"function"!=typeof e.isOpened||!e.isOpened())}catch(t){return!1}})),Om(this,"renewOrEndExpiredSignedSession",(function(){if(!t.signedSessionExpiryRunning){t.signedSessionExpiryRunning=!0;var e=t.logoutGeneration,n=null;try{n=t.renewExpiredSignedSession()}catch(i){}var r=function(){t.logoutGeneration===e&&(t.identifyInFlight||t.pendingContactUpdates>0)?o():(t.signedSessionExpiryRunning=!1,t.logoutGeneration===e&&t.signedSessionExpired()&&!t.identifyFailedTransiently&&t.endExpiredSignedSession())},o=function(){return t.onContactSettled(r,1e4)};Promise.resolve(n).then(o,o)}})),Om(this,"renewExpiredSignedSession",(function(){if(t.identifyInFlight)return null;var e=t.lastIdentify,n=t.logoutGeneration;if(e&&e.userHash&&t.refusedIdentity!==t.refusedIdentityOf(e.userId,e.userHash)){var r=wm(e.userHash);if(!(r&&null!==r.exp&&1e3*r.exp<=Date.now())||t.jwtProvider)return t.markSignedModeIdentify(),Promise.resolve(t.withFreshIdentify((function(e){var n=e.userId,r=e.userData,o=e.userHash,i=wm(o);if(!(i&&null!==i.exp&&1e3*i.exp<=Date.now()))return t.trackContactUpdate(t.sendIdentify(n,r,o,!0))}))).catch((function(){}))}return t.jwtProvider?(t.signedModeProviderAsked=!0,t.requestUserJwt().then((function(e){if(e&&t.logoutGeneration===n&&!t.identifyInFlight)return t.setUserJwt(e)}))):null})),Om(this,"endExpiredSignedSession",(function(){console.info("Gleap: the signed session expired and no fresh identity token arrived, so the user continues as a visitor. Call Gleap.setUserJwt (or set Gleap.setUserJwtProvider) to sign them in again; their visitor activity on this device is merged into their contact."),t.clearSession(0,!0)})),Om(this,"extractGrant",(function(e){if(!e||!e.identity||"object"!==Lm(e.identity)||!("grant"in e.identity))return{session:e,grant:void 0};var t=e.identity,n=t.grant,r=Tm(t,Im);return{session:Am(Am({},e),{},{identity:r}),grant:n||null}})),Om(this,"clearSession",(function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(clearTimeout(t.fileRefreshTimeout),t.openingProtectedFile=null,null!==(e=t.session)&&void 0!==e&&e.fileAccessToken)try{var o=new XMLHttpRequest;o.open("POST",t.apiUrl+"/files/session/revoke"),o.setRequestHeader("X-File-Session",t.session.fileAccessToken),o.send()}catch(i){}t.session&&t.session.gleapHash&&dn.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash));try{se("session-".concat(t.sdkKey),null)}catch(a){}if(t.useCookies)try{ue("session-".concat(t.sdkKey))}catch(a){}t.ready=!1,t.session={gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0},t.lastIdentify=null,t.identifyInFlight=!1,t.forgetSignedIdentity(),t.authTokens={},t.authTokensSentFor=null,t.setGrant(null,!1),t.forgetSignedSession(),t.signedSessionExpiryRunning=!1,t.contactVersion++,t.logoutGeneration++,t.signedModeIdentifySent=!1,t.signedModeProviderAsked=!1,t.identifyFailedTransiently=!1,wv.getInstance().sendMessage({name:"session-cleared"},!0),Zv.getInstance().clearAllNotifications(!1),Zv.getInstance().setNotificationCount(0),Pr.getInstance().removeBannerUI(),$v.getInstance().hideModal(),r&&t.scheduleSessionRetry(n)})),Om(this,"scheduleSessionRetry",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!isNaN(e)){var n=10*Math.pow(e,2);setTimeout((function(){t.startSession(e+1)}),1e3*n)}})),Om(this,"openRequestedProtectedFile",(function(){var e,n=new URLSearchParams((null===(e=window.location)||void 0===e?void 0:e.search)||"").get("gleapFile");if(/^[a-f0-9]{24}$/.test(n||"")&&t.openingProtectedFile!==n){t.openingProtectedFile=n;var r=t.session.fileAccessToken,o=new XMLHttpRequest;o.open("GET","".concat(t.apiUrl,"/files/").concat(n,"/location")),o.setRequestHeader("X-File-Session",t.session.fileAccessToken),o.onload=function(){var e;if((null===(e=t.session)||void 0===e?void 0:e.fileAccessToken)===r)if(200===o.status)try{var n=JSON.parse(o.responseText).shareToken,i=wv.getInstance();i.setAppMode("widget"),i.sendMessage({name:"open-conversation",data:{shareToken:n}},!0),i.showWidget()}catch(a){t.openingProtectedFile=null}else t.openingProtectedFile=null},o.onerror=function(){t.openingProtectedFile=null},o.send()}})),Om(this,"validateSession",(function(e){var n,r,o,i,a,s;if(e&&e.gleapId){var l=t.extractGrant(e);e=l.session,void 0!==l.grant&&t.setGrant(l.grant,!1);var c=e.identity;if(t.grant&&c&&"object"===Lm(c)&&"signed"===c.mode&&!1===c.signed&&t.setGrant(null,!1),t.grant){var u=km(t.grant);u&&u.sid===e.gleapId||t.setGrant(null,!1)}!e.fileAccessToken&&e.gleapId===(null===(n=t.session)||void 0===n?void 0:n.gleapId)&&e.userId===(null===(r=t.session)||void 0===r?void 0:r.userId)&&Date.parse(t.session.fileAccessExpiresAt)>Date.now()&&(e=Am(Am({},e),{},{fileAccessToken:t.session.fileAccessToken,fileAccessExpiresAt:t.session.fileAccessExpiresAt}));var d=!1;(null===(o=t.session)||void 0===o?void 0:o.gleapId)!==(null===(i=e)||void 0===i?void 0:i.gleapId)&&(d=!0),t.session&&t.session.gleapHash&&dn.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),t.localStorageDisabled||se("session-".concat(t.sdkKey),e),t.useCookies&&le("session-".concat(t.sdkKey),encodeURIComponent(JSON.stringify(e)),365),t.session=e,t.ready=!0,t.restoreGrant(),t.armSignedSessionExpiry(),e.fileAccessToken&&t.openRequestedProtectedFile(),clearTimeout(t.fileRefreshTimeout),e.fileAccessToken&&null!==(a=t.lastIdentify)&&void 0!==a&&a.userHash&&(t.fileRefreshTimeout=setTimeout((function(){t.withFreshIdentify((function(e){var n,r,o=e.userId,i=e.userData,a=e.userHash;null===(n=t.identifySession(o,i,a,!0))||void 0===n||null===(r=n.catch)||void 0===r||r.call(n,(function(){}))}))}),Math.max(0,Date.parse(e.fileAccessExpiresAt)-Date.now()-3e5))),t.session&&t.session.gleapHash&&dn.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),d&&(setTimeout((function(){L.getInstance().clearCache(),x.getInstance().clearCache(),Ky.getInstance().restart();var e=dm.getInstance();if(e){try{e.destroy()}catch(t){}e.load()}}),0),"function"==typeof window.dispatchEvent&&window.dispatchEvent(new CustomEvent("session-updated"))),t.notifySessionReady(),d&&t.replayIdentifyIfNeeded(),e.authenticatedFilesRequired&&!e.fileAccessToken&&null!==(s=t.lastIdentify)&&void 0!==s&&s.userHash&&!t.identifyInFlight&&t.withFreshIdentify((function(e){var n,r,o=e.userId,i=e.userData,a=e.userHash;null===(n=t.identifySession(o,i,a,!0))||void 0===n||null===(r=n.catch)||void 0===r||r.call(n,(function(){}))}))}})),Om(this,"replayIdentifyIfNeeded",(function(){try{if(!t.lastIdentify||!t.lastIdentify.userId)return;if(t.identifyInFlight)return;if(t.session&&t.session.userId)return;t.withFreshIdentify((function(e){var n,r,o=e.userId,i=e.userData,a=e.userHash;t.identifyInFlight||t.session&&t.session.userId||null===(n=t.identifySession(o,i,a))||void 0===n||null===(r=n.catch)||void 0===r||r.call(n,(function(){}))}))}catch(e){}})),Om(this,"listenForOnline",(function(){if(!t.onlineListenerAdded)try{"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("online",t.handleOnline),t.onlineListenerAdded=!0)}catch(e){}})),Om(this,"handleOnline",(function(){if(t.identifyFailedTransiently&&!t.identifyInFlight&&t.lastIdentify){t.identifyFailedTransiently=!1;try{Promise.resolve(t.withFreshIdentify((function(e){var n=e.userId,r=e.userData,o=e.userHash;if(!t.identifyInFlight)return t.trackContactUpdate(t.sendIdentify(n,r,o,!0))}))).catch((function(){}))}catch(e){}}})),Om(this,"needsSignedModeIdentify",(function(){if(t.signedModeIdentifySent||t.identifyInFlight)return!1;var e=t.session&&t.session.identity;return!!(t.session&&t.session.userId&&e&&"signed"===e.mode)&&(!(!t.lastIdentify||!t.lastIdentify.userHash||t.hasLiveGrant())&&Date.now()-t.lastSignedModeIdentifyAt>=Rm)})),Om(this,"markSignedModeIdentify",(function(){t.signedModeIdentifySent=!0,t.lastSignedModeIdentifyAt=Date.now()})),Om(this,"identifyForSignedModeIfNeeded",(function(){if(t.needsSignedModeIdentify()){t.markSignedModeIdentify();try{Promise.resolve(t.withFreshIdentify((function(e){var n=e.userId,r=e.userData,o=e.userHash;return t.trackContactUpdate(t.sendIdentify(n,r,o,!0))}))).catch((function(){}))}catch(e){}}else t.identifyWithProviderForSignedModeIfNeeded()})),Om(this,"needsSignedModeProviderIdentify",(function(){if(t.signedModeProviderAsked||t.signedModeIdentifySent||t.identifyInFlight||!t.jwtProvider)return!1;var e=t.session&&t.session.identity;return!!(t.session&&t.session.userId&&e&&"signed"===e.mode)&&(!(t.lastIdentify&&t.lastIdentify.userHash||t.hasLiveGrant())&&Date.now()-t.lastSignedModeIdentifyAt>=Rm)})),Om(this,"identifyWithProviderForSignedModeIfNeeded",(function(){if(t.needsSignedModeProviderIdentify()){t.signedModeProviderAsked=!0;var e=t.logoutGeneration;return t.requestUserJwt().then((function(n){if(n&&t.logoutGeneration===e&&!t.identifyInFlight){var r=t.session&&t.session.identity;if(!(t.lastIdentify&&t.lastIdentify.userHash||!t.session)&&t.session.userId&&r&&"signed"===r.mode&&!t.hasLiveGrant())return t.setUserJwt(n)}})).catch((function(){}))}})),Om(this,"refusedIdentityOf",(function(e,t){return"".concat(e,":").concat(t?xm(t):"")})),Om(this,"withFreshIdentify",(function(e){var n=t.lastIdentify;if(n){var r=wm(n.userHash);return r&&null!==r.exp&&1e3*r.exp-Date.now()<3e5&&t.jwtProvider?t.requestUserJwt().then((function(r){if(t.lastIdentify===n)return e(r?Am(Am({},n),{},{userId:wm(r).userId,userHash:r}):n)})):e(n)}})),Om(this,"setUserJwtProvider",(function(e){if(null===e||"function"==typeof e){if(t.jwtProvider=e,t.jwtProviderFailedAt=0,t.ready)try{t.identifyWithProviderForSignedModeIfNeeded()}catch(n){}}else console.warn("Gleap: setUserJwtProvider expects a function returning a token (or a Promise of one).")})),Om(this,"requestUserJwt",(function(){if(!t.jwtProvider)return Promise.resolve(null);if(t.jwtProviderRequest)return t.jwtProviderRequest;if(t.jwtProviderFailedAt&&Date.now()-t.jwtProviderFailedAt<3e4)return Promise.resolve(null);var e=t.jwtProvider,n=null,r=new Promise((function(e,t){n=setTimeout((function(){return t(new Error("timed out after 10 s"))}),1e4)})),o=Promise.race([Promise.resolve().then((function(){return e()})),r]).then((function(e){if(null==e)return t.jwtProviderFailedAt=Date.now(),null;var n=wm(e);if(!n)throw new Error("it did not return a JWT with a userId");if(null!==n.exp&&1e3*n.exp<=Date.now())throw new Error("it returned an expired token");return t.jwtProviderFailedAt=0,e})).catch((function(e){return t.jwtProviderFailedAt=Date.now(),console.warn("Gleap: the JWT provider failed (".concat(e&&e.message?e.message:e,"). Asking again in 30 s at the earliest.")),null})).finally((function(){clearTimeout(n),t.jwtProviderRequest=null}));return t.jwtProviderRequest=o,o})),Om(this,"startSession",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;t.listenForOnline();try{if(t.useCookies){var n=ce("session-".concat(t.sdkKey));if(n){var r=JSON.parse(decodeURIComponent(n));t.validateSession(r)}}}catch(l){}if(!(t.localStorageDisabled||t.session&&t.session.gleapId&&t.session.gleapId.length>0)){var o=ae("session-".concat(t.sdkKey));o&&t.validateSession(o)}t.restoreGrant(),t.armSignedSessionExpiry();var i=t,a=t.contactVersion,s=new XMLHttpRequest;s.open("POST",i.apiUrl+"/sessions"),s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.setRequestHeader("Api-Token",i.sdkKey);try{t.session&&t.session.gleapId&&t.session.gleapHash&&(s.setRequestHeader("Gleap-Id",t.session.gleapId),s.setRequestHeader("Gleap-Hash",t.session.gleapHash),t.injectGrant(s))}catch(l){}s.onreadystatechange=function(t){if(4===s.readyState){if(i.contactVersion!==a)return;if(200===s.status||201===s.status)try{var n=JSON.parse(s.responseText);i.validateSession(n);var r=n&&n.identity;r&&"object"===Lm(r)&&"signed"===r.mode&&!1===r.signed&&i.signedSessionExpired()?i.renewOrEndExpiredSignedSession():i.identifyForSignedModeIfNeeded()}catch(l){}else if(429!==s.status)!(s.status>=400&&s.status<500)&&i.session&&i.session.gleapId?i.scheduleSessionRetry(e):i.clearSession(e,!0)}},s.send(JSON.stringify({lang:ub.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))})),Om(this,"adoptSession",(function(e){if(e&&"string"==typeof e.gleapId&&"string"==typeof e.gleapHash&&!(t.lastIdentify&&t.lastIdentify.userId||t.session&&t.session.gleapId===e.gleapId)){var n=t,r=new XMLHttpRequest;r.open("POST",n.apiUrl+"/sessions"),r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.setRequestHeader("Api-Token",n.sdkKey),r.setRequestHeader("Gleap-Id",e.gleapId),r.setRequestHeader("Gleap-Hash",e.gleapHash),r.onreadystatechange=function(){if(4===r.readyState&&(200===r.status||201===r.status))try{var t=JSON.parse(r.responseText);t&&t.gleapId===e.gleapId&&(n.contactVersion++,n.validateSession(t))}catch(o){}},r.send(JSON.stringify({lang:ub.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))}})),Om(this,"checkIfSessionNeedsUpdate",(function(e,n){if(!t.session||!t.session.userId||!e)return!0;try{if(t.session.userId.toString()!==e.toString())return!0}catch(r){}return t.checkIfSessionDataNeedsUpdate(n)})),Om(this,"checkIfSessionDataNeedsUpdate",(function(e){if(t.session&&t.session.lang&&t.session.lang!==ub.getInstance().getActiveLanguage())return!0;if(e)for(var n=Object.keys(e),r=0;r3&&void 0!==arguments[3]&&arguments[3];if(e&&e.gleapId&&null!=n&&(t.signedIdentity=t.signedIdentityOf(e.gleapId,n,r)+(o?"#grant":""),!t.localStorageDisabled))try{se(t.signedIdentityKey(),t.signedIdentity)}catch(i){}})),Om(this,"forgetSignedIdentity",(function(){t.signedIdentity=null;try{se(t.signedIdentityKey(),null)}catch(e){}})),Om(this,"needsSignedIdentify",(function(e,n){if(!n||null==e||!t.session||!t.session.gleapId)return!1;if(!t.signedIdentity&&!t.localStorageDisabled)try{t.signedIdentity=ae(t.signedIdentityKey())}catch(o){}var r=t.signedIdentityOf(t.session.gleapId,e,n);return t.signedIdentity===r+"#grant"?!t.hasLiveGrant():t.signedIdentity!==r})),Om(this,"identifySession",(function(e,n,r){var o,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s={userId:e,userData:n,userHash:r};if(t.lastIdentify=s,!(t.ready||t.session&&t.session.gleapId))return t.trackContactUpdate(new Promise((function(o,i){t.setOnSessionReady((function(){if(t.lastIdentify!==s)return o();Promise.resolve(t.identifySession(e,n,r,a)).then(o,i)}))})));if(null===t.refusedIdentity||t.refusedIdentity!==t.refusedIdentityOf(e,r)){var l=t.checkIfSessionNeedsUpdate(e,n),c=!!r&&(null===(o=t.session)||void 0===o?void 0:o.authenticatedFilesRequired)&&(!(null!==(i=t.session)&&void 0!==i&&i.fileAccessToken)||Date.parse(t.session.fileAccessExpiresAt)<=Date.now()),u=t.needsSignedModeIdentify();if(l||a||c||u||t.needsSignedIdentify(e,r))return u&&t.markSignedModeIdentify(),t.trackContactUpdate(t.sendIdentify(e,n,r,!0))}})),Om(this,"sendIdentify",(function(e,n,r,o){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=t;return new Promise((function(s,l){t.setOnSessionReady((function(){if(!a.session.gleapId||!a.session.gleapHash)return l(Nm("identify","session not ready"));var t=new XMLHttpRequest;t.open("POST",a.apiUrl+"/sessions/identify"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",a.sdkKey);try{t.setRequestHeader("Gleap-Id",a.session.gleapId),t.setRequestHeader("Gleap-Hash",a.session.gleapHash),a.injectGrant(t)}catch(p){}a.identifyInFlight=!0,a.lastIdentifyFailure=null;var c=a.logoutGeneration,u=function(){return a.logoutGeneration!==c&&(a.lastIdentifyFailure="superseded",!0)};t.onerror=function(){if(u())return s();a.identifyInFlight=!1,a.lastIdentifyFailure="network error",a.identifyFailedTransiently=!0,l(Nm("identify","network error"))},t.onreadystatechange=function(c){if(4===t.readyState){if(u())return s();if(a.identifyInFlight=!1,200===t.status||201===t.status){a.identifyFailedTransiently=!1;try{var d=JSON.parse(t.responseText);a.contactVersion++,r&&a.rememberSignedIdentity(d,e,r,!!(d&&d.identity&&d.identity.grant)),a.validateSession(d),r&&a.resendAuthTokensIfNeeded(),s(d)}catch(p){l(p)}}else{var h=(f=t.status,"string"!=typeof(g=t.responseText)?null:400===f?-1!==g.indexOf("identity_mismatch")?"identity_mismatch":null:401!==f?null:-1!==g.indexOf("token_expired")?"token_expired":-1!==g.indexOf("token_invalid")?"token_invalid":-1!==g.indexOf("signature_required")?"signature_required":null);if("token_expired"===h&&o&&a.jwtProvider)return void s(a.requestUserJwt().then((function(e){if(!e||!a.lastIdentify||a.lastIdentify.userHash!==r)return e||console.warn("Gleap: the identity token has expired and the JWT provider returned no fresh one."),a.lastIdentifyFailure="refused",Promise.reject(Nm("identify","identity token expired"));var t=wm(e).userId;return a.lastIdentify={userId:t,userData:n,userHash:e},a.sendIdentify(t,n,e,!1,i)})));if("identity_mismatch"===h&&i&&a.lastIdentify&&a.lastIdentify.userHash===r)return void s(a.restartAsVisitorAndIdentify(e,n,r,o));"identity_mismatch"===h&&console.warn("Gleap: the identity token names another user than this session, and a fresh session was refused too (identity_mismatch)."),"token_expired"===h?console.warn("Gleap: the identity token has expired. Pass a fresh one to Gleap.setUserJwt, or set Gleap.setUserJwtProvider."):"token_invalid"===h?console.warn("Gleap: the identity token was refused (token_invalid): check the signing key and the userId claim."):"signature_required"===h&&console.warn("Gleap: this project enforces identity verification and the identify had no valid signature (signature_required). Pass a token from your backend to setUserJwt."),"token_expired"!==h&&"token_invalid"!==h&&"signature_required"!==h||(a.refusedIdentity=a.refusedIdentityOf(e,r)),"signature_required"===h&&a.session&&a.session.userId&&String(a.session.userId)!==String(e)&&a.clearSession(0,!0),!h&&(0===t.status||t.status>=500)&&(a.identifyFailedTransiently=!0),a.lastIdentifyFailure=h?"refused":jm(t.status),l(Nm("identify",h?"refused (".concat(h,")"):a.lastIdentifyFailure))}}var f,g};var d=Am({},n);n.customData&&(delete d.customData,d=Am(Am({},d),n.customData)),t.send(JSON.stringify(Am(Am(Am({},d),{},{userId:e,userHash:r},a.sessionDuration?{sessionDuration:a.sessionDuration}:{}),{},{lang:ub.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"})))}))}))})),Om(this,"restartAsVisitorAndIdentify",(function(e,n,r,o){var i=t.lastIdentify,a=Am({},t.authTokens);t.clearSession(0,!1),t.lastIdentify=i,t.authTokens=a;var s=t.sendIdentify(e,n,r,o,!1);return t.startSession(),s})),Om(this,"setSessionDuration",(function(e){null!=e?"number"!=typeof e||!isFinite(e)||e<=0?console.warn("Gleap: sessionDuration expects a positive number of milliseconds. Ignored."):t.sessionDuration=Math.round(e):t.sessionDuration=null})),Om(this,"setUserJwt",(function(e){var n,r=wm(e);if(!r)return console.warn("Gleap: setUserJwt expects a JWT (three base64url parts, at most 4096 characters) whose payload has a userId (or user_id). Nothing was sent."),Promise.resolve();try{n=Promise.resolve(t.identifySession(r.userId,{},e))}catch(o){n=Promise.reject(o)}return n.then((function(){}),(function(e){if("refused"!==t.lastIdentifyFailure&&"superseded"!==t.lastIdentifyFailure){var n=e&&(e.gleapReason||e.message||e)||t.lastIdentifyFailure||"unknown error";console.warn("Gleap: setUserJwt could not identify the user (".concat(n,"). Nothing changed; call it again later."))}}))})),Om(this,"setAuthTokens",(function(e){if(!e||"object"!==Lm(e)||Array.isArray(e))return console.warn("Gleap: setAuthTokens expects an object of { name: token }."),Promise.resolve();var n={};return Object.keys(e).forEach((function(r){var o=e[r];Pm.test(r)?null===o||"string"==typeof o?(n[r]=o,null===o?delete t.authTokens[r]:t.authTokens[r]=o):console.warn('Gleap: auth token "'.concat(r,'" skipped: the value must be a string, or null to remove it.')):console.warn('Gleap: auth token name "'.concat(r,'" skipped: use a letter followed by up to 39 letters, digits, _ or -.'))})),0===Object.keys(n).length?Promise.resolve():t.postAuthTokens(n)})),Om(this,"resendAuthTokensIfNeeded",(function(){Object.keys(t.authTokens).length>0&&t.authTokensSentFor!==t.session.gleapId&&t.postAuthTokens(Am({},t.authTokens))})),Om(this,"postAuthTokens",(function(e){var n=t;return new Promise((function(r){t.setOnSessionReady((function(){t.onContactSettled((function(){if(!n.session.gleapId||!n.session.gleapHash)return r();var t=n.session.gleapId,o=new XMLHttpRequest;o.open("POST",n.apiUrl+"/sessions/auth-tokens"),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.injectSession(o),o.onerror=function(){return r()},o.onreadystatechange=function(){4===o.readyState&&(200===o.status||201===o.status?n.authTokensSentFor=t:401===o.status&&console.warn("Gleap: auth tokens need a signed identity: call Gleap.setUserJwt first. They are kept and sent after the next signed identify."),r())},o.send(JSON.stringify({tokens:e}))}))}))}))})),Om(this,"startProductTourConfig",(function(e){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){if(!n.session.gleapId||!n.session.gleapHash)return o(Nm("product tour","session not ready"));var t=new XMLHttpRequest;t.open("POST",n.apiUrl+"/outbound/producttours"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",n.sdkKey);try{t.setRequestHeader("Gleap-Id",n.session.gleapId),t.setRequestHeader("Gleap-Hash",n.session.gleapHash),n.injectGrant(t)}catch(i){}t.onerror=function(){o(Nm("product tour","network error"))},t.onreadystatechange=function(e){if(4===t.readyState)if(200===t.status||201===t.status)try{var n=JSON.parse(t.responseText);n&&n.config&&r(n.config)}catch(i){o(i)}else o(Nm("product tour",jm(t.status)))},t.send(JSON.stringify({outboundId:e}))}))}))})),Om(this,"validateProductTour",(function(e){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){var t;if(!n.session.gleapId||!n.session.gleapHash)return o(Nm("product tour","session not ready"));var i=new XMLHttpRequest;i.open("POST",n.apiUrl+"/outbound/producttourvalidation"),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.setRequestHeader("Api-Token",n.sdkKey);try{i.setRequestHeader("Gleap-Id",n.session.gleapId),i.setRequestHeader("Gleap-Hash",n.session.gleapHash),n.injectGrant(i)}catch(a){}i.onerror=function(){o(Nm("product tour","network error"))},i.onreadystatechange=function(e){if(4===i.readyState)if(200===i.status||201===i.status)try{var t=JSON.parse(i.responseText);t&&"live"===t.status&&t.passedPageFilter?r(t.config):o(Nm("product tour","not live on this page"))}catch(a){o(a)}else o(Nm("product tour",jm(i.status)))},i.send(JSON.stringify({outboundId:e,currentUrl:null===(t=window)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.href}))}))}))}))}var t,n,r;return t=e,n=[{key:"setRegion",value:function(e){var t=function(e){if("string"!=typeof e)return null;var t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(Vt,t)?t:null}(e);if(!t)return console.warn('Gleap: Unknown region "'.concat(e,'". Supported regions: ').concat(Object.keys(Vt).join(", "),". Region not changed.")),!1;var n=Vt[t];return this.region=t,this.apiUrl=n.apiUrl,this.wsApiUrl=n.wsApiUrl,this.realtimeHost=n.realtimeHost,!0}},{key:"getRegion",value:function(){return this.region}},{key:"getName",value:function(){try{return this.session.name?this.session.name.split(" ")[0].split("@")[0].split(".")[0].split("+")[0]:""}catch(e){return this.session.name}}},{key:"getSession",value:function(){return this.session}},{key:"getGleapId",value:function(){return this.session&&this.session.gleapId?this.session.gleapId:null}},{key:"isUser",value:function(){return!(!this.session||!this.session.userId)}},{key:"notifySessionReady",value:function(){if(this.onSessionReadyListener.length>0)for(var e=0;e=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function Vm(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,o)}function $m(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(e.tags=t),this.excludeData)for(var n=Object.keys(this.excludeData),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,i=parseInt(r.v,10),a=i>=1&&i<=4?i:1,s=4!==a,l=null===(t=r.bgBlur)||void 0===t||t?'
':"";if(!s){var c,u=r.welcomeText?String(r.welcomeText).replace(/&/g,"&").replace(//g,">"):"",d='
\n
\n
\n
 
'.concat(u?'\n
'.concat(u,"
"):"","\n
\n
");if(o){var p=String(r.bgImage).replace(/"/g,""");return'
\n
\n
\n
\n ').concat(d,'\n
\n
\n
')}var h=null===(c=r.fadebg)||void 0===c||c;return'
\n
\n '.concat(d).concat(h?'\n
':"","\n
\n
")}if(o){var f=String(r.bgImage).replace(/"/g,"""),g=r.hideNews&&r.hideFeatureRequests&&r.hideAllConversations&&r.hideKnowledgeBase;return'
\n
\n ').concat(l,"
\n
")}if("classic"===r.bgType){var m,v=null===(m=r.fadebg)||void 0===m||m;return'
'.concat(v?'\n \n \n \n \n \n \n \n \n \n \n \n \n ':'\n \n \n \n \n \n \n \n ').concat(l,"
")}var y=null===(n=r.animateBG)||void 0===n||n;return'
\n \n \n \n \n \n \n \n \n \n \n \n \n ').concat(l,"
")}(Rd.getInstance().getFlowConfig()),''),(t.frameHost&&document.body.contains(t.frameHost)?t.frameHost:document.body).appendChild(e);var r=e.querySelector(".gleap-frame-loader-image");if(r){var o=function(){var t=e.querySelector(".gleap-frame-loader-image-wrap");t&&t.classList.add("gleap-frame-loader-image-wrap--loaded")};r.complete&&r.naturalWidth>0?o():r.addEventListener("load",o)}t.gleapFrameContainer=e,t.gleapFrame=document.querySelector(".gleap-frame"),K(t.gleapFrame,t.frameUrl),t.armFrameLoadWatchdog(t.gleapFrame),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),yv(this,"showImage",(function(e){de((function(){var t=document.createElement("div");t.className="gleap-image-view",t.setAttribute("tabindex","-1"),t.innerHTML='
\n \n
'),document.body.appendChild(t);var n=function(){document.removeEventListener("keydown",r,!0),t.remove()},r=function(e){"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),n())};document.addEventListener("keydown",r,!0),t.querySelector(".gleap-image-view-close").addEventListener("click",(function(){n()})),t.addEventListener("click",(function(e){e.target===t&&n()}));try{t.focus({preventScroll:!0})}catch(o){t.focus()}}))})),yv(this,"updateFrameStyle",(function(){if(t.gleapFrameContainer){for(var e="gleap-frame-container--survey",n="gleap-frame-container--extended",r="gleap-frame-container--survey-full",o="gleap-frame-container--survey-page",i="gleap-frame-container--survey-legacy",a="gleap-frame-container--corners-sharp",s="gleap-frame-container--corners-pill",l="gleap-frame-container--classic",c="gleap-frame-container--classic-left",u="gleap-frame-container--modern-left",d="gleap-frame-container--no-button",p="gleap-frame-container--expanded",h=[l,c,p,n,u,d,e,r,o,i,a,s],f=0;f0?"".concat(this.frameHeight,"px"):"");e.style.height="","survey"===this.appMode||this.isLegacyFullSurvey()?e.style.maxHeight=this.frameHeight>0?"".concat(this.frameHeight,"px"):"":this.isFullSurvey()?e.style.maxHeight="none":e.style.maxHeight="".concat(700,"px")}}},{key:"getSafeAreaInsets",value:function(){var e={top:0,right:0,bottom:0,left:0};try{if("undefined"==typeof document||!document.body||"function"!=typeof window.getComputedStyle)return e;var t=document.createElement("div");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="0",t.style.height="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.paddingTop="env(safe-area-inset-top, 0px)",t.style.paddingRight="env(safe-area-inset-right, 0px)",t.style.paddingBottom="env(safe-area-inset-bottom, 0px)",t.style.paddingLeft="env(safe-area-inset-left, 0px)",document.body.appendChild(t);var n=window.getComputedStyle(t);e.top=parseFloat(n.paddingTop)||0,e.right=parseFloat(n.paddingRight)||0,e.bottom=parseFloat(n.paddingBottom)||0,e.left=parseFloat(n.paddingLeft)||0,t.remove()}catch(r){}return e}},{key:"forwardSurveyKey",value:function(e){try{if(!this.surveyKeyboard||"survey_page"!==this.appMode||!this.comReady)return;if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)return;var t=e.target,n=t&&t.tagName;if("INPUT"===n||"TEXTAREA"===n||"SELECT"===n||t&&t.isContentEditable)return;var r=e.key;if(!/^[a-z0-9]$/i.test(r)&&"Enter"!==r&&"ArrowUp"!==r&&"ArrowDown"!==r)return;if("Enter"===r&&("BUTTON"===n||"A"===n))return;e.preventDefault(),this.sendMessage({name:"survey-key",data:{key:r,shiftKey:e.shiftKey}})}catch(o){}}},{key:"updateSurveyKeyboardInset",value:function(){try{var e=this.gleapFrameContainer;if(!e)return;var t=window.visualViewport,n="survey"===this.appMode&&!this.surveyLegacy&&window.innerWidth<=450,r=t?Math.max(0,window.innerHeight-(t.height+t.offsetTop)):0;if(!n||!t||r<80){if(!this.surveySheetLifted)return;this.surveySheetLifted=!1;var o=e.querySelector(".gleap-frame-container-inner");return e.style.removeProperty("bottom"),e.style.removeProperty("max-height"),o&&o.style.removeProperty("max-height"),void this.sendSheetViewport(0,!1)}var i=e.querySelector(".gleap-frame-container-inner"),a=Math.max(160,t.height-24);this.surveySheetLifted=!0,e.style.setProperty("bottom",r+8+"px","important"),e.style.setProperty("max-height",a+"px","important"),i&&i.style.setProperty("max-height",a-15+"px","important"),this.sendSheetViewport(a-15,!0)}catch(s){}}},{key:"sendSheetViewport",value:function(e,t){var n={maxHeight:Math.max(0,Math.floor(e)),keyboard:!!t},r=this.lastSheetViewport;this.comReady&&(r?r.maxHeight!==n.maxHeight||r.keyboard!==n.keyboard:n.keyboard)&&(this.lastSheetViewport=n,this.sendMessage({name:"sheet-viewport",data:n}))}},{key:"sendSafeAreaInsets",value:function(){this.comReady&&this.sendMessage({name:"survey-safe-area",data:this.getSafeAreaInsets()})}},{key:"revealSurvey",value:function(){this.surveyAwaitingHeight=!1,this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null);var e=this.gleapFrameContainer;e&&e.classList.remove("gleap-frame-container--measuring")}},{key:"scrollSurveyPageIntoView",value:function(e){try{var t=this.gleapFrameContainer;if("survey_page"!==this.appMode||!t||"undefined"==typeof window)return;var n=t.getBoundingClientRect().top;if(n>=0)return;window.scrollTo({top:Math.max(0,window.scrollY+n-16),behavior:e?"smooth":"auto"})}catch(r){}}},{key:"setSurveyLegacy",value:function(){this.isSurvey()&&!this.surveyLegacy&&(this.surveyLegacy=!0,this.updateFrameStyle(),this.applyInnerSize())}},{key:"setSurveyCorners",value:function(e){var t="sharp"===e||"pill"===e?e:null;t!==this.surveyCorners&&(this.surveyCorners=t,this.updateFrameStyle())}},{key:"setSurveyTheme",value:function(e){var t=e&&"string"==typeof e.surface&&/^#[0-9a-f]{3,8}$/i.test(e.surface)?e.surface:null,n=e&&"boolean"==typeof e.dark?e.dark:null,r=t!==this.surveySurface||n!==this.surveyDark;this.surveySurface=t,this.surveyDark=n;var o=e?e.corners:null;("sharp"===o||"pill"===o?o:null)!==this.surveyCorners?this.setSurveyCorners(o):r&&this.updateFrameStyle()}},{key:"hasRoomToExpand",value:function(){try{return"function"!=typeof window.matchMedia||window.matchMedia("(min-width: ".concat(768,"px)")).matches}catch(e){return!0}}},{key:"canExpandWidget",value:function(){var e=Rd.getInstance().getFlowConfig();return(!e||!e.hideExpandButton)&&!this.isSurvey()&&this.hasRoomToExpand()}},{key:"getWidgetExpandedPreference",value:function(){return void 0===this.widgetExpanded&&(this.widgetExpanded=!0===ae("widget-expanded")),this.widgetExpanded}},{key:"isWidgetExpanded",value:function(){return this.getWidgetExpandedPreference()&&this.canExpandWidget()}},{key:"setWidgetExpanded",value:function(e){this.widgetExpanded=!!e;try{se("widget-expanded",!!this.widgetExpanded||null)}catch(t){}this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0)}},{key:"sendWidgetSizeUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.comReady){var t={expandable:this.canExpandWidget(),expanded:this.isWidgetExpanded()},n=this.lastWidgetSizeUpdate;!e&&n&&n.expandable===t.expandable&&n.expanded===t.expanded||(this.lastWidgetSizeUpdate=t,this.sendMessage({name:"widget-size-update",data:t}))}}},{key:"handleViewportResize",value:function(){this.isWidgetExpanded()!==this.appliedWidgetExpanded&&this.updateFrameStyle(),this.sendWidgetSizeUpdate(),this.widgetOpened&&this.isFullSurvey()&&this.sendSafeAreaInsets()}},{key:"registerEscListener",value:function(){var e=this;this.escListener||this.captureHidden||"survey_page"===this.appMode||(this.escListener=function(t){if("Escape"===(t=t||window.event).key){var n=document.querySelectorAll(".gleap-image-view");if(n.length>0)return void n[n.length-1].remove();e.hideWidget()}},document.addEventListener("keydown",this.escListener))}},{key:"unregisterEscListener",value:function(){this.escListener&&(document.removeEventListener("keydown",this.escListener),this.escListener=null)}},{key:"destroy",value:function(){this.gleapFrame&&this.gleapFrame.remove(),this.gleapFrameContainer&&this.gleapFrameContainer.remove(),this.injectedFrame=!1,this.widgetOpened=!1,this.comReady=!1,this.clearFrameLoadWatchdog(),this.markerManager=void 0,this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null),clearTimeout(this.openAfterPingTimeout),this.openAfterPingTimeout=null,this.gleapFrameContainer=null,this.gleapFrame=null,this.captureHidden=!1;try{ad&&ad.getInstance().onWidgetDestroyed()}catch(e){}}},{key:"setCaptureHidden",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.captureHidden=!!e;var n=this.gleapFrameContainer;if(n&&n.classList.toggle("gleap-frame-container--capture-hidden",this.captureHidden),this.captureHidden)return this.unregisterEscListener(),void this.setCaptureEditorOpen(!1);n&&(this.widgetOpened?this.registerEscListener():t&&this.showWidget())}},{key:"isCaptureHidden",value:function(){return this.captureHidden}},{key:"setCaptureEditorOpen",value:function(e){this.gleapFrameContainer&&this.gleapFrameContainer.classList.toggle("gleap-frame-container--capture-editor",!!e)}},{key:"sendCaptureCapabilities",value:function(){if(this.comReady)try{this.sendMessage({name:"capture-capabilities",data:Ir()})}catch(e){}}},{key:"isOpened",value:function(){return this.widgetOpened||null!=this.markerManager}},{key:"armFrameLoadWatchdog",value:function(e){var t=this;this.clearFrameLoadWatchdog(),e&&(this.frameLoadTimeout=setTimeout((function(){if(t.frameLoadTimeout=null,!t.comReady&&t.gleapFrame===e){try{e.getAttribute("src")!==t.frameUrl&&(e.src=t.frameUrl)}catch(n){}t.frameLoadTimeout=setTimeout((function(){if(t.frameLoadTimeout=null,!t.comReady&&t.gleapFrame===e){try{console.warn("Gleap: the messenger ("+t.frameUrl+") did not load and was closed. If this keeps happening, check that your Content-Security-Policy allows frame-src, script-src and style-src for https://*.gleap.io.")}catch(n){}t.resetUnloadedFrame(!1)}}),1e4)}}),1e4))}},{key:"clearFrameLoadWatchdog",value:function(){this.frameLoadTimeout&&(clearTimeout(this.frameLoadTimeout),this.frameLoadTimeout=null)}},{key:"resetUnloadedFrame",value:function(e){var t=this.widgetOpened;this.unregisterEscListener(),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.destroy();try{R.getInstance().updateFeedbackButtonState()}catch(n){}e&&t&&this.showWidget()}},{key:"handlePageShow",value:function(e){if(e&&e.persisted)try{if(this.injectedFrame&&this.gleapFrameContainer&&!this.comReady)return void this.resetUnloadedFrame(!0);var t=this.gleapFrameContainer;t&&(this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),t.classList.remove("gleap-frame-container--closing"),this.widgetOpened?(t.classList.remove("gleap-frame-container--hidden"),t.classList.add("gleap-frame-container--animate")):t.classList.contains("gleap-frame-container--measuring")||(t.classList.add("gleap-frame-container--hidden"),t.classList.remove("gleap-frame-container--animate")),this.updateWidgetStatus()),R.getInstance().updateFeedbackButtonState()}catch(n){}}},{key:"showFrameContainer",value:function(e){var t,n=this;if(this.gleapFrameContainer){var r="gleap-frame-container--loading";null!==(t=this.gleapFrameContainer)&&void 0!==t&&t.classList&&(this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.gleapFrameContainer.classList.remove("gleap-frame-container--closing"),this.isAutoHeightSurvey()&&this.surveyAwaitingHeight?(this.gleapFrameContainer.classList.add("gleap-frame-container--measuring"),this.surveyRevealTimeout||(this.surveyRevealTimeout=setTimeout((function(){n.surveyRevealTimeout=null,n.revealSurvey()}),1200))):this.gleapFrameContainer.classList.remove("gleap-frame-container--measuring"),this.gleapFrameContainer.classList.remove("gleap-frame-container--hidden"),e?this.gleapFrameContainer.classList.add(r):this.gleapFrameContainer.classList.remove(r),setTimeout((function(){var e;null===(e=n.gleapFrameContainer)||void 0===e||e.classList.add("gleap-frame-container--animate")}),500)),this.widgetOpened=!0,this.updateUI()}}},{key:"runWidgetShouldOpenCallback",value:function(){if(this.gleapFrameContainer&&(this.workThroughQueue(),$b.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),dn.notifyEvent("open"),this.registerEscListener(),this.isFullSurvey()&&!this.isLegacyFullSurvey()))try{var e=this.gleapFrameContainer.querySelector(".gleap-frame");e&&e.focus({preventScroll:!0})}catch(t){}}},{key:"updateUI",value:function(){Zv.getInstance().clearAllNotifications(this.isSurvey()),R.getInstance().updateNotificationBadge(0),R.getInstance().updateFeedbackButtonState()}},{key:"showWidget",value:function(){var t=this;setTimeout((function(){t.gleapFrameContainer&&!t.comReady?"widget"===t.appMode&&t.showFrameContainer(!0):t.gleapFrameContainer?t.runWidgetShouldOpenCallback():e.getInstance().injectFrame(),t.updateUI()}),0)}},{key:"updateWidgetStatus",value:function(){this.sendMessage({name:"widget-status-update",data:{isWidgetOpen:this.widgetOpened}})}},{key:"hideMarkerManager",value:function(){this.markerManager&&(this.markerManager.clear(),this.markerManager=null)}},{key:"focusFrame",value:function(){var e=this;setTimeout((function(){try{var t=e.gleapFrameContainer&&e.gleapFrameContainer.querySelector(".gleap-frame");t&&t.focus({preventScroll:!0})}catch(n){}}),0)}},{key:"hideWidget",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("survey_web"!==this.appMode&&"survey_page"!==this.appMode){var n=!1;try{n=!!this.gleapFrameContainer&&this.gleapFrameContainer.contains(document.activeElement)}catch(a){}var r=this.widgetOpened,o=this.isOpened();if(this.openAfterPingTimeout&&(clearTimeout(this.openAfterPingTimeout),this.openAfterPingTimeout=null),this.hideMarkerManager(),this.setCaptureEditorOpen(!1),this.gleapFrameContainer){var i=this.gleapFrameContainer;i.classList.remove("gleap-frame-container--animate"),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null),!r||i.classList.contains("gleap-frame-container--measuring")?(i.classList.remove("gleap-frame-container--measuring"),i.classList.add("gleap-frame-container--hidden")):(i.classList.add("gleap-frame-container--closing"),this.closeTimeout=setTimeout((function(){i.classList.add("gleap-frame-container--hidden"),i.classList.remove("gleap-frame-container--closing"),e.closeTimeout=null}),260))}t&&this.sendMessage({name:"reset-routes",data:{}}),this.widgetOpened=!1,this.updateWidgetStatus(),R.getInstance().updateFeedbackButtonState(),o&&dn.notifyEvent("close"),Zv.getInstance().reloadNotificationsFromCache(),this.unregisterEscListener(),"undefined"!=typeof window&&void 0!==window.focus&&window.focus(),n&&R.getInstance().restoreFocus()}}},{key:"sendMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{this.gleapFrame=document.querySelector(".gleap-frame"),this.comReady&&this.gleapFrame&&this.gleapFrame.contentWindow?this.gleapFrame.contentWindow.postMessage(JSON.stringify(e),Gt(this.gleapFrame,this.frameUrl)):t&&this.queue.push(e)}catch(n){}}},{key:"sendSessionUpdate",value:function(){this.sendMessage({name:"session-update",data:{sessionData:Bm.getInstance().getSession(),grant:Bm.getInstance().grant,apiUrl:Bm.getInstance().apiUrl,realtimeHost:Bm.getInstance().realtimeHost,sdkKey:Bm.getInstance().sdkKey,capabilities:{adoptSession:!0}}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:Rd.getInstance().getFlowConfig(),aiTools:wn.getInstance().getAgentTools(),agentTools:wn.getInstance().getAgentTools(),overrideLanguage:ub.getInstance().getOverrideLanguage()}}),this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0))}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new Rv(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=gv(this.queue);this.queue=[];for(var t=0;t0&&(e.frameHeight=n,e.isAutoHeightSurvey()&&(e.applyInnerSize(),e.revealSurvey()))}if("survey-legacy"===t.name&&e.setSurveyLegacy(),"survey-theme"===t.name&&t.data&&e.setSurveyTheme(t.data),"survey-scroll-into-view"===t.name&&e.scrollSurveyPageIntoView(t.data&&!1!==t.data.smooth),"survey-shown"!==t.name&&"survey-step-viewed"!==t.name&&"survey-answered"!==t.name&&"survey-completed"!==t.name&&"survey-closed"!==t.name||(dn.notifyEvent(t.name,t.data||{}),pv(t.name,t.data||{})),"notify-event"===t.name){dn.notifyEvent(t.data.type,t.data.data);var r=t.data&&"outbound-sent"===t.data.type?t.data.data:null;if(r&&r.outboundId&&r.responseId){var o=Object.assign({},r.formData||{});delete o.reportedBy,$b.trackEvent("outbound-".concat(r.outboundId,"-submitted"),o)}}if("cleanup-drawings"===t.name&&e.hideMarkerManager(),"open-url"===t.name){var i=t.data,a=!!t.newTab;e.urlHandler(i,a)}var s;if("start-product-tour"===t.name&&$b.startProductTour(null===(s=t.data)||void 0===s?void 0:s.tourId,!0),"run-custom-action"===t.name&&vp.triggerCustomAction(t.data,function(e){for(var t=1;t0){dn.notifyEvent("outbound-sent",{outboundId:b,outbound:y,formData:v});try{delete v.reportedBy}catch(n){}$b.trackEvent("outbound-".concat(b,"-submitted"),v)}})).catch((function(t){setTimeout((function(){e.sendingFeedback=!1,e.sendMessage({name:"feedback-sending-failed",data:"Something went wrong, please try again."}),dn.notifyEvent("error-while-sending")}),1e3)}))}"start-screen-drawing"===t.name&&e.showDrawingScreen(t.data),!ad||"capture-start"!==t.name&&"capture-cancel"!==t.name&&"capture-editor"!==t.name&&"capture-done"!==t.name&&"capture-fly"!==t.name||ad.getInstance().handleMessengerMessage(t)})),window.addEventListener("message",(function(t){var n=Pr.getInstance(),r=n.bannerContainer?n.bannerContainer.querySelector(".gleap-b-frame"):null,o=e.gleapFrame&&t.source===e.gleapFrame.contentWindow,i=r&&t.source===r.contentWindow,a=t.origin===e.frameUrl,s=t.origin===n.bannerUrl;if(o||i||a||s)try{var l=JSON.parse(t.data);if("MODAL"===(null==l?void 0:l.type)||"BANNER"===(null==l?void 0:l.type)||"CHATBAR"===(null==l?void 0:l.type)||"AGENT_CONVERSATION"===(null==l?void 0:l.type))return;if("adopt-session"===(null==l?void 0:l.name)&&!o&&!a)return;for(var c=0;c0&&(n.tags=r);try{e&&e.contentWindow&&e.contentWindow.postMessage(JSON.stringify({name:"collect-ticket-data",data:n}),Gt(e,this.frameUrl))}catch(o){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&vv(t.prototype,n),r&&vv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function kv(e){return kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kv(e)}function xv(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Sv(this,"rerender",void 0),Sv(this,"svgElement",null),Sv(this,"path",null),Sv(this,"strPath",void 0),Sv(this,"strokeWidth",12),Sv(this,"strokeWidthRect",6),Sv(this,"bufferSize",4),Sv(this,"buffer",[]),Sv(this,"startPoint",null),Sv(this,"tool","rect"),Sv(this,"color","#EB144C"),Sv(this,"mouseDown",null),Sv(this,"mouseMove",null),Sv(this,"mouseUp",null),Sv(this,"resizeListener",null),Sv(this,"pathBuffer",[]);var o=this;this.rerender=t,this.svgElement=document.querySelector(".bb-capture-svg"),this.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px"),this.trackScroll=!!r,this.scrollListener=null,this.trackScroll&&(this.scrollListener=function(){o.svgElement.style.transform="translate(".concat(-window.scrollX,"px, ").concat(-window.scrollY,"px)"),o.svgElement.style.minWidth="".concat(document.documentElement.scrollWidth,"px")},this.scrollListener(),window.addEventListener("scroll",this.scrollListener,{passive:!0})),this.resizeListener=function(e){o.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px")},window.addEventListener("resize",this.resizeListener,!0),this.mouseDown=function(e){e.preventDefault();var t=document.querySelector(".bb-capture-toolbar-item-colorpicker");t&&(t.style.display="none"),o.fadeOutToolbar(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseDownPen(e),"rect"===o.tool&&o.mouseDownRect(e)},this.mouseMove=function(e){e.preventDefault(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseMovePen(e),"rect"===o.tool&&o.mouseMoveRect(e)},this.mouseUp=function(e){e.preventDefault(),o.fadeInToolbar(),"pen"!==o.tool&&"blur"!==o.tool||o.mouseUpPen(e),"rect"===o.tool&&o.mouseUpRect(e)},this.svgElement.addEventListener("mousedown",this.mouseDown),this.svgElement.addEventListener("mousemove",this.mouseMove),this.svgElement.addEventListener("mouseup",this.mouseUp),this.svgElement.addEventListener("touchstart",this.mouseDown,!1),this.svgElement.addEventListener("touchmove",this.mouseMove,!1),this.svgElement.addEventListener("touchend",this.mouseUp,!1),setTimeout((function(){n.rerender()}),100)}var t,n,r;return t=e,n=[{key:"clear",value:function(){if(this.svgElement)for(;this.svgElement.firstChild;)this.svgElement.firstChild.remove()}},{key:"destroy",value:function(){this.svgElement.removeEventListener("mousedown",this.mouseDown),this.svgElement.removeEventListener("mousemove",this.mouseMove),this.svgElement.removeEventListener("mouseup",this.mouseUp),this.svgElement.removeEventListener("touchstart",this.mouseDown),this.svgElement.removeEventListener("touchmove",this.mouseMove),this.svgElement.removeEventListener("touchend",this.mouseUp),window.removeEventListener("resize",this.resizeListener)}},{key:"destroyScrollTracker",value:function(){this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener),this.scrollListener=null)}},{key:"mouseUpPen",value:function(){this.path&&(this.path=null)}},{key:"mouseUpRect",value:function(){this.path&&(this.path=null)}},{key:"mouseMovePen",value:function(e){this.path&&(this.appendToBuffer(this.getMousePosition(e)),this.updateSvgPath())}},{key:"mouseMoveRect",value:function(e){if(this.path){var t=this.getMousePosition(e),n=Math.abs(t.x-this.startPoint.x),r=Math.abs(t.y-this.startPoint.y),o=t.x,i=t.y;t.x>this.startPoint.x&&(o=this.startPoint.x),t.y>this.startPoint.y&&(i=this.startPoint.y),this.path.setAttributeNS(null,"x",o),this.path.setAttributeNS(null,"y",i),this.path.setAttributeNS(null,"width",n),this.path.setAttributeNS(null,"height",r)}}},{key:"mouseDownRect",value:function(e){this.path=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",this.color),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",this.strokeWidthRect),this.startPoint=this.getMousePosition(e),this.appendPathToSvg(this.path)}},{key:"mouseDownPen",value:function(e){var t=this.color+"AA",n=this.strokeWidth;"blur"===this.tool&&(t="#000000",n=40),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",t),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",n),this.buffer=[];var r=this.getMousePosition(e);this.appendToBuffer(r),this.strPath="M"+r.x+" "+r.y,this.path.setAttribute("d",this.strPath),this.appendPathToSvg(this.path)}},{key:"setTool",value:function(e){this.tool=e}},{key:"setColor",value:function(e){this.color=e}},{key:"getMousePosition",value:function(e){var t=this.trackScroll?window.scrollX:0,n=this.trackScroll?window.scrollY:0;return e.touches&&e.touches.length>0?{x:e.touches[0].clientX+t,y:e.touches[0].clientY+n}:{x:e.clientX+t,y:e.clientY+n}}},{key:"getAveragePoint",value:function(e){var t=this.buffer.length;if(t%2==1||t>=this.bufferSize){var n,r,o=0,i=0,a=0;for(r=e;rthis.bufferSize;)this.buffer.shift()}},{key:"appendPathToSvg",value:function(e){this.svgElement.appendChild(e),this.pathBuffer.push(e),this.rerender()}},{key:"removeLastAddedPathFromSvg",value:function(){this.pathBuffer.length<=0||!this.svgElement||(this.svgElement.removeChild(this.pathBuffer[this.pathBuffer.length-1]),this.pathBuffer.pop(),this.rerender())}},{key:"fadeOutToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=0,e.style.pointerEvents="none")}},{key:"fadeInToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=1,e.style.pointerEvents="auto")}}],n&&xv(t.prototype,n),r&&xv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Iv(e){return Iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Iv(e)}function Dv(e,t){for(var n=0;n\n \n
'.concat(ve("dismiss"),"
\n
").concat(ve("rect"),'
\n
\n
\n ').concat(ve("drag"),"\n
\n ").concat("capture"===this.type?'
\n '.concat(ve("recorderon"),"\n ").concat(ve("recorderoff"),'\n \n
\n
\n ').concat(ve("mic"),'\n \n
\n
2:00
\n
\n
\n ').concat(ve("pointer"),"\n
"):"",'\n
\n ').concat(ve("rect"),'\n
\n
\n ').concat(ve("pen"),'\n
\n
\n ').concat(ve("blur"),'\n
\n
\n
\n ').concat(ub.translateText("pickAColor"),'\n
\n
\n ').concat(ve("undo"),'\n ').concat(ub.translateText("undo"),"\n
\n ").concat("capture"!==this.type?'
'.concat(ub.translateText("next"),"
"):"",'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
').concat(ub.translateText("retry"),'
\n
').concat(ub.translateText("next"),"
\n
\n
\n
\n "),document.body.appendChild(e),e.setAttribute("dir",ub.getInstance().isRTLLayout?"rtl":"ltr")}},{key:"captureTabScreenshot",value:function(){var e=this;this.capturingTab=!0;var t=tu(),n=document.querySelector(".bb-capture-editor"),r=function(e){n&&n.classList.toggle("bb-capture-editor--capturing",e)};r(!0);var o=ad.getInstance();(e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=e;const a=()=>!i||i();return wu({streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,active:a}).then((e=>e?a()?ku(e):(Yc(e.canvas),null):null))})({streamPromise:t,setUiHidden:r,privacyOptions:o.privacyOptions(),maskSelectors:o.maskSelectors(),isActive:function(){return e.capturingTab}}).catch((function(){return null})).then((function(t){e.capturingTab&&(e.capturingTab=!1,$b.getInstance().setGlobalDataItem("screenshotImage",t),e.finishNextStep())}))}},{key:"finishNextStep",value:function(){this.showWidgetUI(),this.callback&&(wv.getInstance().sendMessage({name:"set-form-data",data:{formKey:"capture",data:{value:this.type,dirty:!0}}}),this.callback(!0))}},{key:"unregisterListeners",value:function(){this.escListener&&document.removeEventListener("keydown",this.escListener),this.pageLeaveListener&&window.removeEventListener("beforeunload",this.pageLeaveListener)}},{key:"registerListeners",value:function(){var e=this;this.escListener=function(t){var n=!1,r=!1;"key"in(t=t||window.event)&&(n="Escape"===t.key,r="Enter"===t.key),n&&e.dismiss(),"screenshot"===e.type&&r&&e.showNextStep()},document.addEventListener("keydown",this.escListener),this.pageLeaveListener=function(e){e.preventDefault(),e.returnValue=""},window.addEventListener("beforeunload",this.pageLeaveListener)}},{key:"show",value:function(e){this.callback=e,this.registerListeners(),this.hideWidgetUI(),this.createEditorUI(),this.setupMousePointer(),"screenshot"===this.type?($b.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),Lv.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new Ev(this.captureScreenDrawerRerender.bind(this),"screenshot"===this.type),this.setupColorPicker(),this.setupToolbar()}},{key:"setupColorPicker",value:function(){for(var t=this,n=document.querySelector(".bb-capture-toolbar-item-selectedcolor"),r=document.querySelectorAll(".bb-capture-toolbar-item-color"),o=document.querySelector(".bb-capture-toolbar-item-colorpicker"),i=function(){var i=r[a],s=i.getAttribute("data-color");i.style.backgroundColor=s,i.onclick=function(){i&&(t.screenDrawer.setColor(s),o&&(o.style.display="none"),n.style.backgroundColor=i.style.backgroundColor,e.setPenColor(s))}},a=0;a0?r.classList.remove(e):r.classList.add(e))}}},{key:"captureRenderer",value:function(){if(this.screenRecorder){this.screenRecorder.file&&$b.getInstance().setGlobalDataItem("screenRecordingData",this.screenRecorder.file);var e="bb-capture-editor-item-inactive",t=document.querySelector(".bb-capture-toolbar-item-timer"),n=document.querySelectorAll(".bb-capture-toolbar-item"),r=document.querySelector(".bb-tooltip-screen-recording"),o=document.querySelector(".bb-tooltip-audio-recording"),i=document.querySelector(".bb-capture-editor"),a="bb-capture-editor-recording",s="bb-capture-editor-notrecording";this.screenRecorder.isRecording?(i.classList.add(a),i.classList.remove(s)):(i.classList.add(s),i.classList.remove(a));var l=document.querySelector(".bb-capture-toolbar");document.querySelector(".bb-capture-preview").style.display=this.screenRecorder.file?"flex":"none",l.style.display=this.screenRecorder.file?"none":"flex";for(var c=0;c0){var t,n=null===(t=Bm.getInstance().session)||void 0===t?void 0:t.gleapId,r=e.filter((function(e){var t;return n&&(null==e?void 0:e.cachedForGleapId)===n&&"chatbar"!==(null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource)&&new Date(e.createdAt)>new Date(Date.now()-36e5)}));this.notifications=r.slice(-4),this.renderNotifications()}}catch(o){}}},{key:"notificationPassesPageRules",value:function(e){try{var t="undefined"!=typeof window&&window.location?window.location.href:void 0;return!t||nm(t,e)}catch(n){return!0}}},{key:"getVisibleNotifications",value:function(){var e=this;return $b.getInstance().disableInAppNotifications?[]:this.notifications.filter((function(t){return e.notificationPassesPageRules(t)}))}},{key:"checkPageRulesForUrl",value:function(e){e&&e!==this.lastPageRulesUrl&&(this.lastPageRulesUrl=e,this.notifications.some((function(e){var t;return(null==e||null===(t=e.pageRules)||void 0===t?void 0:t.length)>0||(null==e?void 0:e.pageFilter)}))&&this.renderNotifications())}},{key:"setNotificationCount",value:function(e){this.unreadCount=e,this.updateTabBarNotificationCount(),R.getInstance().updateNotificationBadge(this.unreadCount)}},{key:"showNotification",value:function(e){if(this.notificationContainer&&e&&e.data){try{var t,n,r=null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource,o=or.getInstance(),i=(null==o||null===(n=o.config)||void 0===n?void 0:n.enabled)||(null==o?void 0:o.manuallyShown)||o&&!o.isHidden;if("chatbar"===r&&i)return void o.showChatbarNotification(e.data)}catch(s){}var a;for(this.notifications.find((function(t){return e.outbound===t.outbound}))||(e.cachedForGleapId=null===(a=Bm.getInstance().session)||void 0===a?void 0:a.gleapId,this.notifications.push(e),e.sound&&!$b.getInstance().disableInAppNotifications&&this.notificationPassesPageRules(e)&&cr.ping());this.notifications.length>4;)this.notifications.shift();se(this.unreadNotificationsKey,this.notifications),this.renderNotifications()}}},{key:"renderNotifications",value:function(){var e=this;if(this.notificationContainer){this.clearAllNotifications(!0);var t=document.createElement("div");t.onclick=function(){e.clearAllNotifications(),e.currentNewsIndex=0},t.className="gleap-notification-close",t.innerHTML=ve("dismiss"),this.notificationContainer.appendChild(t);var n=this.getVisibleNotifications(),r=n.filter((function(e){return e.data.news})).sort((function(e,t){return new Date(e.createdAt)-new Date(t.createdAt)})),o=n.filter((function(e){return!e.data.news}));if(r.length>0){var i=this.currentNewsIndex1){var g=document.createElement("div");g.className="gleap-news-pagination";var m=document.createElement("span");m.className="gleap-news-page-indicator",m.innerText="".concat(i+1," / ").concat(r.length),g.appendChild(m);var v=document.createElement("button");v.className="gleap-news-next-button",i\n
\n
\n
\n
\n \n \n \n ').concat(t.data.nextStepTitle,"\n
\n \n ")}else r.className="gleap-notification-item gleap-notification-card",r.innerHTML='\n
\n '.concat(e.renderAvatar(t.data.sender,"gleap-notification-item-avatar"),'\n
\n
').concat(n,"
\n ").concat(e.renderMeta(t),"\n
\n
");e.notificationContainer.appendChild(r)},b=0;b0||o.length>0||this.clearAllNotifications(!0);var w=(r.length>0?1:0)+o.length;this.notificationContainer.classList&&(this.notificationContainer.classList.toggle("gleap-notification-container--stack",w>1),this.notificationContainer.classList.remove("gleap-notification-container--expanded")),this.updateStackLayout()}}},{key:"updateStackLayout",value:function(){try{this.stackResizeObserver&&(this.stackResizeObserver.disconnect(),this.stackResizeObserver=null);var e=this.notificationContainer;if(!e||!e.classList||!e.classList.contains("gleap-notification-container--stack")||"function"!=typeof e.querySelectorAll)return;var t=Array.prototype.slice.call(e.querySelectorAll(".gleap-notification-card"));if(t.length<2)return;var n=function(){try{for(var n=t.map((function(e){return e.offsetHeight||0})),r=n[n.length-1],o=0,i=0,a=t.length-1;a>=0;a--){var s=t.length-1-a,l=0===s?0:1===s?9:17;t[a].style.setProperty("--gleap-nstack-collapse","".concat(n[a]-r-l,"px")),t[a].style.setProperty("--gleap-nstack-expand","".concat(-i,"px"));var c=n[a]-(r-12);t[a].style.setProperty("--gleap-nstack-clip",s>0&&c>0?"".concat(c,"px"):"-40px"),i+=n[a],o+=n[a]}e.style.setProperty("--gleap-nstack-h-collapsed","".concat(r+17,"px")),e.style.setProperty("--gleap-nstack-h-expanded","".concat(o,"px"))}catch(u){}};if(n(),"undefined"!=typeof ResizeObserver){this.stackResizeObserver=new ResizeObserver(n);for(var r=0;r')}},{key:"renderMeta",value:function(e){var t=e.data.sender,n=[];t&&t.name&&n.push(''.concat(t.name,""));var r=function(e,t){try{if(!e||"undefined"==typeof Intl||"function"!=typeof Intl.RelativeTimeFormat)return"";var n,r=new Date(e).getTime();if(isNaN(r))return"";try{n=new Intl.RelativeTimeFormat(t||void 0,{numeric:"auto"})}catch(l){n=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"})}var o=Math.min(0,(r-Date.now())/1e3);if(o>-60)return n.format(0,"second");for(var i=o/60,a=0;a'.concat(r,"")),0===n.length?"":'
'.concat(n.join('\u2022'),"
")}},{key:"renderDescription",value:function(e){var t=e.data,n=t.previewText,r=t.sender;return n&&n.length>0?n:r?'\n
\n '.concat(this.renderAvatar(r,"gleap-notification-item-news-sender-avatar"),"\n ").concat(r.name,"\n
\n "):""}},{key:"clearNotificationsForConversation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)try{var n=function(t){var n;return(null==t||null===(n=t.data)||void 0===n||null===(n=n.conversation)||void 0===n?void 0:n.shareToken)===e},r=ae(this.unreadNotificationsKey);r&&r.length>0&&se(this.unreadNotificationsKey,r.filter((function(e){return!n(e)})));var o,i=this.notifications.length;this.notifications=this.notifications.filter((function(e){return!n(e)})),this.notifications.length!==i&&this.renderNotifications(),t||eb.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(o=Bm.getInstance().session)||void 0===o?void 0:o.gleapId})}catch(a){}}},{key:"clearAllNotifications",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e||(this.notifications=[],this.currentNewsIndex=0,se(this.unreadNotificationsKey,this.notifications)),this.notificationContainer){for(;this.notificationContainer.firstChild;)this.notificationContainer.removeChild(this.notificationContainer.firstChild);if(!e&&!t)try{var n;eb.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=Bm.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(r){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=Rd.getInstance().getFlowConfig(),t="gleap-notification-container--left",n="gleap-notification-container--no-button";this.notificationContainer.classList.remove(t),this.notificationContainer.classList.remove(n),e.feedbackButtonPosition!==R.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==R.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===R.getInstance().buttonHidden?e.feedbackButtonPosition===R.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):R.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",ub.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Kv(t.prototype,n),r&&Kv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Qv(e){return Qv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qv(e)}function ey(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{})}function n(t){return t?e[t]:e}function r(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}function o(e){var t='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap((function(e){var n=e.matches(t),r=Array.from(e.querySelectorAll(t));return[].concat(iy(n?[e]:[]),r)})).filter((function(e){return"none"!==getComputedStyle(e).pointerEvents&&s(e)}))}function i(e){if(e&&!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(e)){var t=n("smoothScroll");e.scrollIntoView({behavior:!t||a(e)?"auto":"smooth",inline:"center",block:"center"})}}function a(e){if(e&&e.parentElement){var t=e.parentElement;return t.scrollHeight>t.clientHeight}}function s(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function l(e){for(var t=Qe(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:5e3,o=e.element,a=o;if("string"==typeof a&&(a=l(o)),o&&!a&&t>=0)setTimeout((function(){L(),C(e,t-100)}),100);else{if(!a){if(e.element){try{console.warn("[Gleap] Product tour selector did not match:",e.element)}catch(s){}return n("onElementNotFound")(e)}a=function(){var e=document.getElementById("gleap-tour-dummy-element");if(e)return e;var t=document.createElement("div");return t.id="gleap-tour-dummy-element",t.style.width="0",t.style.height="0",t.style.pointerEvents="none",t.style.opacity="0",t.style.position="fixed",t.style.top="50%",t.style.left="50%",document.body.appendChild(t),t}()}!function(e,t){var o,a,s=400,l=Date.now(),c=g("__activeStep"),u=g("__activeElement")||e,p=!u||u===e,h="gleap-tour-dummy-element"===e.id,m="gleap-tour-dummy-element"===u.id,v=n("animate"),y=t.onHighlightStarted||n("onHighlightStarted"),b=(null==t?void 0:t.onHighlighted)||n("onHighlighted"),k=(null==c?void 0:c.onDeselected)||n("onDeselected"),S=n(),C=g();!p&&k&&k(m?void 0:u,c,{config:S,state:C});y&&y(h?void 0:e,t,{config:S,state:C});var E=!p&&v,I=!1;L(),f("previousStep",c),f("previousElement",u),f("activeStep",t),f("activeElement",e);var D=function o(){if(g("__transitionCallback")===o){var i=Date.now()-l,a=s-i<=s/2;t.popover&&a&&!I&&E&&(F(e,t),I=!0),n("animate")&&i0&&O[0].focus()}function O(){var e=g("popover");if(null==e?void 0:e.wrapper){var t=e.wrapper.getBoundingClientRect(),r=n("stagePadding")||0,o=n("popoverOffset")||0;return{width:t.width+r+o,height:t.height+r+o,realWidth:t.width,realHeight:t.height}}}function M(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.top-o,window.innerHeight-r.realHeight-i.width),i.width):"end"===e?Math.max(Math.min(n.top-(null==r?void 0:r.realHeight)+n.height+o,window.innerHeight-(null==r?void 0:r.realHeight)-i.width),i.width):"center"===e?Math.max(Math.min(n.top+n.height/2-(null==r?void 0:r.realHeight)/2,window.innerHeight-(null==r?void 0:r.realHeight)-i.width),i.width):0}function P(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.left-o,window.innerWidth-r.realWidth-i.width),i.width):"end"===e?Math.max(Math.min(n.left-(null==r?void 0:r.realWidth)+n.width+o,window.innerWidth-(null==r?void 0:r.realWidth)-i.width),i.width):"center"===e?Math.max(Math.min(n.left+n.width/2-(null==r?void 0:r.realWidth)/2,window.innerWidth-(null==r?void 0:r.realWidth)-i.width),i.width):0}function R(e,t){var r=g("popover");if(r){var o=(null==t?void 0:t.popover)||{},i=o.align,a=void 0===i?"start":i,s=o.side,l=void 0===s?"left":s,c=a,u="gleap-tour-dummy-element"===e.id?"over":l,d=n("stagePadding")||0,p=O(),h=r.arrow.getBoundingClientRect(),f=e.getBoundingClientRect(),m=f.top-p.height,v=m>=0,y=window.innerHeight-(f.bottom+p.height),b=y>=0,w=f.left-p.width,k=w>=0,x=window.innerWidth-(f.right+p.width),S=x>=0,C=!(v||b||k||S),E=u;if("top"===u&&v?S=k=b=!1:"bottom"===u&&b?S=k=v=!1:"left"===u&&k?S=v=b=!1:"right"===u&&S&&(k=v=b=!1),"over"===u){var I=window.innerWidth/2-p.realWidth/2,D=window.innerHeight/2-p.realHeight/2;r.wrapper.style.left="".concat(I,"px"),r.wrapper.style.right="auto",r.wrapper.style.top="".concat(D,"px"),r.wrapper.style.bottom="auto"}else if(C){var A=window.innerWidth/2-(null==p?void 0:p.realWidth)/2;r.wrapper.style.left="".concat(A,"px"),r.wrapper.style.right="auto",r.wrapper.style.bottom="".concat(10,"px"),r.wrapper.style.top="auto"}else if(k){var T=Math.min(w,window.innerWidth-(null==p?void 0:p.realWidth)-h.width),L=M(c,{elementDimensions:f,popoverDimensions:p,popoverPadding:d,popoverArrowDimensions:h});r.wrapper.style.left="".concat(T,"px"),r.wrapper.style.top="".concat(L,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="left"}else if(S){var F=Math.min(x,window.innerWidth-(null==p?void 0:p.realWidth)-h.width),R=M(c,{elementDimensions:f,popoverDimensions:p,popoverPadding:d,popoverArrowDimensions:h});r.wrapper.style.right="".concat(F,"px"),r.wrapper.style.top="".concat(R,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",E="right"}else if(v){var N=Math.min(m,window.innerHeight-p.realHeight-h.width),j=P(c,{elementDimensions:f,popoverDimensions:p,popoverPadding:d,popoverArrowDimensions:h});r.wrapper.style.top="".concat(N,"px"),r.wrapper.style.left="".concat(j,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="top"}else if(b){var B=Math.min(y,window.innerHeight-(null==p?void 0:p.realHeight)-h.width),_=P(c,{elementDimensions:f,popoverDimensions:p,popoverPadding:d,popoverArrowDimensions:h});r.wrapper.style.left="".concat(_,"px"),r.wrapper.style.bottom="".concat(B,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",E="bottom"}C?r.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var r=g("popover");if(!r)return;var o=n.getBoundingClientRect(),i=O(),a=r.arrow,s=i.width,l=window.innerWidth,c=o.width,u=o.left,d=i.height,p=window.innerHeight,h=o.top,f=o.height;a.className="gleap-tour-popover-arrow";var m=t,v=e;"top"===t?(u+c<=0?(m="right",v="end"):u+c-s<=0&&(m="top",v="start"),u>=l?(m="left",v="end"):u+s>=l&&(m="top",v="end")):"bottom"===t?(u+c<=0?(m="right",v="start"):u+c-s<=0&&(m="bottom",v="start"),u>=l?(m="left",v="start"):u+s>=l&&(m="bottom",v="end")):"left"===t?(h+f<=0?(m="bottom",v="end"):h+f-d<=0&&(m="left",v="start"),h>=p?(m="top",v="end"):h+d>=p&&(m="left",v="end")):"right"===t&&(h+f<=0?(m="bottom",v="start"):h+f-d<=0&&(m="right",v="start"),h>=p?(m="top",v="start"):h+d>=p&&(m="right",v="end"));m?(a.classList.add("gleap-tour-popover-arrow-side-".concat(m)),a.classList.add("gleap-tour-popover-arrow-align-".concat(v))):a.classList.add("gleap-tour-popover-arrow-none")}(c,E,e)}}return function(){function e(){n("allowClose")&&d()}function r(){var e=g("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?l(r):d()}}function o(){var e=g("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?l(r):d()}}function i(){var e;if(!g("__transitionCallback")){var t=g("activeIndex"),r=g("__activeStep"),i=g("__activeElement");if("CLICK"!==r.mode)if(void 0!==t&&void 0!==r)if(void 0!==g("activeIndex")){var a=(null==(e=r.popover)?void 0:e.onPrevClick)||n("onPrevClick");if(a)return a(i,r,{config:n(),state:g()});o()}}}function a(){var e;if(!g("__transitionCallback")){var t=g("activeIndex"),o=g("__activeStep"),i=g("__activeElement");if("CLICK"!==o.mode&&void 0!==t&&void 0!==o){var a=(null==(e=o.popover)?void 0:e.onNextClick)||n("onNextClick");if(a)return a(i,o,{config:n(),state:g()});r()}}}function s(){g("isInitialized")||(f("isInitialized",!0),document.body.classList.add("gleap-tour-active",n("animate")?"gleap-tour-fade":"gleap-tour-simple"),window.addEventListener("keyup",A,!1),window.addEventListener("keydown",D,!1),window.addEventListener("resize",I),window.addEventListener("scroll",I),f("__positionInterval",setInterval((function(){g("isInitialized")&&I()}),1e3)),y("overlayClick",e),y("escapePress",e),y("arrowLeftPress",i),y("arrowRightPress",a))}function l(){var e,t,r,o,i,a,s,c,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,p=n("steps");if(!p)return console.error("No steps to drive through"),void d();if(p[u]){f("__activeOnDestroyed",document.activeElement),f("activeIndex",u);var h=p[u],g=p[u+1],m=p[u-1],v=(null==(e=h.popover)?void 0:e.doneBtnText)||n("doneBtnText")||"Done",y=n("allowClose"),b=void 0!==(null==(t=h.popover)?void 0:t.showProgress)?null==(r=h.popover)?void 0:r.showProgress:n("showProgress"),w=((null==(o=h.popover)?void 0:o.progressText)||n("progressText")||"{{current}} of {{total}}").replace("{{current}}","".concat(u+1)).replace("{{total}}","".concat(p.length)),k=(null==(i=h.popover)?void 0:i.showButtons)||n("showButtons"),x=["next","previous"].concat(iy(y?["close"]:[])).filter((function(e){return!(null==k?void 0:k.length)||k.includes(e)})),S=(null==(a=h.popover)?void 0:a.onNextClick)||n("onNextClick"),E=(null==(s=h.popover)?void 0:s.onPrevClick)||n("onPrevClick"),I=(null==(c=h.popover)?void 0:c.onCloseClick)||n("onCloseClick");C(ly(ly({},h),{},{popover:ly({showButtons:x,nextBtnText:g?void 0:v,disableButtons:iy(m?[]:["previous"]),showProgress:b,progressText:w,onNextClick:S||function(){g?l(u+1):d()},onPrevClick:E||function(){l(u-1)},onCloseClick:I||function(){d()}},(null==h?void 0:h.popover)||{})}))}else d()}function d(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=g("__activeElement"),r=g("__activeStep"),o=g("__activeOnDestroyed"),i=n("onDestroyStarted");if(e&&i){i(!t||"gleap-tour-dummy-element"===(null==t?void 0:t.id)?void 0:t,r,{config:n(),state:g()})}else{var a,s=(null==r?void 0:r.onDeselected)||n("onDeselected"),l=n("onDestroyed");if(document.body.classList.remove("gleap-tour-active","gleap-tour-fade","gleap-tour-simple"),function(){window.removeEventListener("keyup",A),window.removeEventListener("resize",I),window.removeEventListener("scroll",I);var e=g("__positionInterval");e&&clearInterval(e)}(),function(){var e,t=g("popover");t&&(null==(e=t.wrapper.parentElement)||e.removeChild(t.wrapper))}(),function(){var e;null==(e=document.getElementById("gleap-tour-dummy-element"))||e.remove(),document.querySelectorAll(".gleap-tour-active-element").forEach(p),c&&(p(c.element),u())}(),(a=g("__overlaySvg"))&&a.remove(),v={},m(),t&&r){var d="gleap-tour-dummy-element"===t.id;s&&s(d?void 0:t,r,{config:n(),state:g()}),l&&l(d?void 0:t,r,{config:n(),state:g()})}o&&o.focus()}}return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{isActive:function(){return g("isInitialized")||!1},refresh:I,drive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;s(),l(e)},setConfig:t,setSteps:function(e){m(),t(ly(ly({},n()),{},{steps:e}))},getConfig:n,getState:g,getActiveIndex:function(){return g("activeIndex")},isFirstStep:function(){return 0===g("activeIndex")},isLastStep:function(){var e=n("steps")||[],t=g("activeIndex");return void 0!==t&&t===e.length-1},getActiveStep:function(){return g("activeStep")},getActiveElement:function(){return g("activeElement")},getPreviousElement:function(){return g("previousElement")},getPreviousStep:function(){return g("previousStep")},moveNext:r,movePrevious:o,moveTo:function(e){(n("steps")||[])[e]?l(e):d()},hasNextStep:function(){var e=n("steps")||[],t=g("activeIndex");return void 0!==t&&e[t+1]},hasPreviousStep:function(){var e=n("steps")||[],t=g("activeIndex");return void 0!==t&&e[t-1]},highlight:function(e){s(),C(ly(ly({},e),{},{popover:e.popover?ly({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){d(!1)}}}}();const dy=uy;var py=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],hy="".concat(py.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),fy=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?py.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},gy=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},my=function(e,t){if(e){var n=(e.tagName||"").toLowerCase();if("input"===n||"textarea"===n){var r=function(e){var t,n;if("undefined"==typeof window)return null;var r=window.HTMLTextAreaElement&&e instanceof window.HTMLTextAreaElement?window.HTMLTextAreaElement.prototype:window.HTMLInputElement&&e instanceof window.HTMLInputElement?window.HTMLInputElement.prototype:null;return r&&null!==(t=null===(n=Object.getOwnPropertyDescriptor(r,"value"))||void 0===n?void 0:n.set)&&void 0!==t?t:null}(e);r?r.call(e,t):e.value=t}else e.textContent=t;gy(e,"input")}},vy=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.charDelay,o=void 0===r?100:r,i=n.onDone,a=function(e){if(!e)return null;if(fy(e))return e;var t="function"==typeof e.querySelector?e.querySelector(hy):null;return t&&fy(t)?t:null}(e),s=null!=t?t:"";if(a){var l=0,c=function(){gy(a,"change"),i&&i()};!function e(){try{l=0&&t.productTourData&&t.productTourData.steps){var e=t.productTourData.steps[t.currentActiveIndex];e&&e.selector&&""!==e.selector&&t.updatePointerPosition(Ze(e.selector),e)}})))}var t,n,r;return t=e,n=[{key:"disable",value:function(){this.disabled=!0,this.cleanup()}},{key:"startWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;"undefined"!=typeof window&&(this.productTourId||this.disabled||(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,this.onCompleteCallback=n,this.start()))}},{key:"storeUncompletedTour",value:function(){if("undefined"!=typeof window)if(this.productTourId&&this.productTourData)try{var e=JSON.parse(JSON.stringify({tourData:this.productTourData,tourId:this.productTourId}));e.tourData.steps=e.tourData.steps.slice(this.currentActiveIndex||0,e.tourData.steps.length),e.audioMuted=this.audioMuted,localStorage.setItem(xy,JSON.stringify(e))}catch(t){}else localStorage.removeItem(xy)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(xy));if(e&&e.tourId===this.productTourId&&"boolean"==typeof e.audioMuted)return e.audioMuted}catch(t){}}},{key:"attachScrollListeners",value:function(e,t){var n=this;if("undefined"!=typeof window&&e){var r=function(e){if("undefined"!=typeof window){for(var t=[],n=e.parentElement;n;){var r=window.getComputedStyle(n);("auto"===r.overflowY||"scroll"===r.overflowY)&&n.scrollHeight>n.clientHeight&&t.push(n),n=n.parentElement}return t}}(e);r.push(window),r.forEach((function(r){var o=function(){clearTimeout(n._scrollDebounceTimer),n._scrollDebounceTimer=setTimeout((function(){n.updatePointerPosition(e,t)}),150)};r.addEventListener("scroll",o,{passive:!0}),n._scrollListeners.push({el:r,handler:o})}))}}},{key:"removeScrollListeners",value:function(){"undefined"!=typeof window&&(this._scrollListeners&&this._scrollListeners.length>0&&(this._scrollListeners.forEach((function(e){var t=e.el,n=e.handler;t.removeEventListener("scroll",n)})),this._scrollListeners=[]),this._scrollDebounceTimer&&(clearTimeout(this._scrollDebounceTimer),this._scrollDebounceTimer=null))}},{key:"updatePointerPosition",value:function(e,t){var n,r=this;if("undefined"!=typeof window)try{var o=this._pointerContainer||document.getElementById(Sy);if(!o)return;if(!e)return o.style.position="fixed",o.style.left="50%",o.style.top="50%",o.style.transform="translate(-50%, -50%)",function(e){if("undefined"!=typeof window){var t=e-window.innerHeight/2;window.scrollTo({top:t,behavior:"smooth"})}}(window.innerHeight/2),this.removeScrollListeners(),this._currentAnchor=null,void(this._currentStep=null);n=e,"undefined"!=typeof window&&n&&n.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});var i=0;!function n(){if(function(e){if("undefined"!=typeof window){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}}(e)||i>=20){var a=e.getBoundingClientRect(),s=a.left+a.width/2,l=a.top+a.height/2+10;o.style.position="fixed",o.style.left="".concat(s,"px"),o.style.top="".concat(l,"px"),o.style.transform="translate(-50%, -50%)";var c=350;c>window.innerWidth-40&&(c=window.innerWidth-40),s+c>window.innerWidth-20?o.classList.add("copilot-pointer-container-right"):o.classList.remove("copilot-pointer-container-right"),r._currentAnchor===e&&r._currentStep===t||(r.removeScrollListeners(),r._currentAnchor=e,r._currentStep=t,r.attachScrollListeners(e,t))}else i++,setTimeout(n,100)}()}catch(a){}}},{key:"cleanup",value:function(){var e=this;"undefined"!=typeof window&&(document.body.classList.add("gl-copilot-fade-out"),this.currentAudio&&this.currentAudio.pause(),setTimeout((function(){if(e._pointerContainer)e._pointerContainer.remove(),e._pointerContainer=null;else{var t=document.getElementById(Sy);t&&t.remove()}var n=document.getElementById(Ey);n&&n.remove();var r=document.getElementById(Cy);r&&r.remove(),document.body.classList.remove("gl-copilot-fade-out")}),800),this.productTourId=void 0,this.productTourData=void 0,this.removeScrollListeners())}},{key:"toggleAudio",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.audioMuted=e,this.currentAudio&&(this.currentAudio.muted=this.audioMuted);var t=document.querySelector(".".concat(Ey,"-mute"));t&&(t.innerHTML=ve(this.audioMuted?"unmute":"mute")),this.productTourId&&this.productTourData&&this.storeUncompletedTour()}},{key:"setupCopilotTour",value:function(){var e,t,n,r,o,i,a,s=this;if("undefined"!=typeof window){var l,c,u=null!==(e=null===(t=Rd.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=me(u),p=document.getElementById(Cy);p||(p=document.createElement("style"),W(p),p.id=Cy,p.type="text/css",p.textContent="\n #".concat(Sy," {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n align-items: flex-start;\n pointer-events: none;\n z-index: 2147483610;\n transition: all 0.5s ease;\n }\n .").concat(Sy,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(Sy,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(Sy,"-clickmode svg {\n display: none !important;\n }\n #").concat(Sy," svg {\n width: 20px;\n height: auto;\n fill: none;\n }\n #copilot-info-bubble {\n position: relative;\n }\n #copilot-info-bubble-content-container {\n position: absolute;\n top: 0px;\n left: 0px;\n min-width: min(300px, 80vw);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n .").concat(Sy,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(Sy,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(Sy,"-right svg {\n transform: scaleX(-1);\n }\n #copilot-info-bubble-content svg {\n width: 16px;\n height: 16px;\n display: inline-block !important;\n margin-left: 5px;\n }\n #copilot-info-bubble-content {\n margin-top: 18px;\n margin-left: 5px;\n padding: 10px 15px;\n border-radius: 20px;\n background-color: black;\n color: white;\n font-family: Arial, sans-serif;\n font-size: 14px;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);\n max-width: 100%;\n white-space: pre-line;\n overflow-wrap: break-word;\n word-break: normal;\n hyphens: none;\n }\n .").concat(Sy,"-right #copilot-info-bubble-content {\n margin-top: 30px;\n margin-left: 0px;\n margin-right: 5px;\n }\n .click-wave {\n position: absolute;\n width: 34px;\n height: 34px;\n border-radius: 50%;\n background-color: rgba(0, 0, 0, 0.5);\n pointer-events: none;\n z-index: 2147483611;\n animation: click-wave-animation 0.8s ease forwards;\n }\n @keyframes click-wave-animation {\n 0% {\n transform: scale(0.2);\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n }\n @keyframes slideInFromTop {\n 0% {\n transform: translateY(-100%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n }\n @keyframes slideInFromBottom {\n 0% {\n transform: translateY(100%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n }\n .").concat(Ey," {\n position: fixed;\n z-index: 2147483610;\n background: #fff;\n padding: 6px;\n border-radius: 10px;\n box-shadow: 0 0 20px 0 #C294F2;\n display: flex;\n align-items: center;\n gap: 8px;\n border: 1px solid rgba(192, 146, 242, 0.5);\n }\n .").concat(Ey,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Ey,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Ey,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Ey,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Ey," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(Ey,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(Ey,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(Ey,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(Ey,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(Ey,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(Ey,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(Ey,"-dismiss svg:hover {\n opacity: 0.8;\n }\n @keyframes pulsate {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 50% {\n transform: scale(1.1);\n opacity: 0.8;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n }\n @keyframes glCoFadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n @keyframes glCoFadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n .gleap-audio-unmute-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 2147483620;\n }\n\n .gleap-audio-unmute-modal {\n background-color: #fff;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);\n text-align: center;\n max-width: 90%;\n width: 400px;\n }\n\n .gleap-audio-unmute-modal p {\n margin-bottom: 20px;\n font-size: 16px;\n line-height: 22px;\n font-weight: normal;\n }\n\n .gleap-audio-unmute-button {\n background: ").concat(u,";\n color: ").concat(d,";\n outline: none;\n border: none;\n padding: 10px 14px;\n border-radius: 12px;\n font-size: 14px;\n font-weight: bold;\n cursor: pointer;\n }\n\n .gleap-audio-unmute-button:hover {\n opacity: 0.8;\n }\n\n .gleap-tour-continue-button {\n color: ").concat(u,";\n text-decoration: none;\n cursor: pointer;\n font-size: 14px;\n font-weight: bold;\n border: none;\n background: none;\n padding: 0;\n margin: 0;\n margin-left: 20px;\n }\n\n .gleap-tour-continue-button:hover {\n opacity: 0.8;\n }\n\n body.gl-copilot-fade-out::before,\n body.gl-copilot-fade-out::after,\n body.gl-copilot-fade-out #").concat(Ey," {\n animation: glCoFadeOut 0.8s ease-out forwards;\n }\n ").concat(null===(l=null===(c=this.productTourData)||void 0===c?void 0:c.playVoice)||void 0===l||l?"":"\n .".concat(Ey,"-mute {\n display: none;\n }\n "),"\n ").concat(this.productTourData.gradient?'body::before {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n box-sizing: border-box;\n border: 18px solid transparent;\n filter: blur(25px);\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }\n \n body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0.5;\n box-sizing: border-box;\n border: 3px solid transparent;\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }':'body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0;\n }',"\n "),document.head.appendChild(p));var h=document.createElement("div");h.id=Sy,h.style.opacity=0,this._pointerContainer=h;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("viewBox","0 0 380 476"),f.innerHTML='';var g=document.createElement("div");g.id="copilot-info-bubble",g.innerHTML="
";var m,v,y=document.createElement("div");y.id=Ey,y.classList.add(Ey,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=Iy[m])&&void 0!==v?v:Iy.TOP_RIGHT)),y.innerHTML='\n \n ').concat(null===(o=this.productTourData)||void 0===o?void 0:o.kaiSlug,'\n
\n ').concat(ve(this.audioMuted?"unmute":"mute"),"\n
\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'
\n ').concat(ve("dismiss"),"\n
"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(Ey,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(Ey,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),h.appendChild(f),h.appendChild(g),document.body.appendChild(h)}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this.productTourData;if(t){var n=function(n,r){e.audioMuted=n,e.setupCopilotTour(),e.audioMuted&&r&&null!=t&&t.showUnmuteModal?e.showAudioUnmuteModal():setTimeout((function(){e.renderNextStep()}),1500)},r=this.loadStoredAudioMuted();"boolean"!=typeof r?("undefined"==typeof window?Promise.resolve(!1):new Promise((function(e){var t=setTimeout((function(){return e(!0)}),500),n=function(n){clearTimeout(t),e(n)};try{new Audio("data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEARKwAABCxAgAEABAAZGF0YQAAAAA=").play().then((function(){return n(!0)})).catch((function(){return n(!1)}))}catch(r){n(!1)}}))).then((function(e){n(!e,!0)})):n(r,!1)}}}},{key:"showAudioUnmuteModal",value:function(){var e,t,n,r=this,o=document.createElement("div");o.classList.add("gleap-audio-unmute-modal-overlay");var i=document.createElement("div");i.classList.add("gleap-audio-unmute-modal");var a=document.createElement("p");a.textContent=null===(e=this.productTourData)||void 0===e?void 0:e.unmuteModalTitle,i.appendChild(a);var s=document.createElement("button");s.classList.add("gleap-audio-unmute-button"),s.textContent=null===(t=this.productTourData)||void 0===t?void 0:t.unmuteModalButton,s.addEventListener("click",(function(){r.toggleAudio(!1),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(s);var l=document.createElement("button");l.classList.add("gleap-tour-continue-button"),l.textContent=null===(n=this.productTourData)||void 0===n?void 0:n.unmuteModalContinue,l.addEventListener("click",(function(){r.toggleAudio(!0),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(l),o.appendChild(i),document.body.appendChild(o)}},{key:"completeTour",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];"undefined"!=typeof window&&(this.cleanup(),this.onCompleteCallback&&this.onCompleteCallback(e))}},{key:"renderNextStep",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this,n=this.productTourData.steps;if(this.currentActiveIndex>=n.length)setTimeout((function(){e.completeTour()}),500);else{var r=n[this.currentActiveIndex],o=function(n){var o,i;if(e._pointerContainer.style.display="flex",r.selector&&r.selector.length>0&&!n)e.completeTour(!1);else{var a=function(){if("INPUT"===r.mode&&n){var e,o=function(){document.querySelector("#".concat(Sy)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(Sy).style.display="none",t.currentActiveIndex++,t.storeUncompletedTour(),t.renderNextStep()};if("default"===(null!==(e=r.inputType)&&void 0!==e?e:"default")){var i=function e(t){var r;if(0!==(null==t||null===(r=t.target)||void 0===r||null===(r=r.value)||void 0===r?void 0:r.length)){var i=document.getElementById("copilot-info-bubble-content");i&&(i.innerHTML="".concat(ub.translateText("next"),' \n \n'),i.addEventListener("click",o,{once:!0}),n.classList.add("gleap-input-highlight"),document.querySelector("#".concat(Sy)).classList.add("copilot-pointer-container-clickmode"),n.removeEventListener("input",e))}};n.addEventListener("input",i,{once:!1}),n.hasAttribute("contenteditable")&&n.addEventListener("keyup",i,{once:!1}),n.addEventListener("blur",(function(){n.focus()}),{once:!0}),n.focus()}else{var a;vy(n,null!==(a=r.inputValue)&&void 0!==a?a:"",{charDelay:100,onDone:function(){setTimeout((function(){o()}),1200)}})}}else{if(t.currentActiveIndex++,t.storeUncompletedTour(),"CLICK"===r.mode&&n){var s=n.getBoundingClientRect(),l=window.scrollX||0,c=window.scrollY||0;!function(e,t){if("undefined"!=typeof window){var n=document.createElement("div");n.className="click-wave",n.style.left="".concat(e-17,"px"),n.style.top="".concat(t-17,"px"),document.body.appendChild(n),setTimeout((function(){n.remove()}),800)}}(s.left+s.width/2+l,s.top+s.height/2+c),n.click()}t.renderNextStep()}};e.updatePointerPosition(n,r);var s=null!=r&&r.message?function(e){if("undefined"!=typeof window){var t=document.createElement("div");return t.innerHTML=e,t.querySelectorAll("address, article, blockquote, br, div, footer, h1, h2, h3, h4, h5, h6, header, hr, li, p, pre, section, table, tr").forEach((function(e){e.insertAdjacentText("afterend","\n")})),(t.textContent||"").replace(/[^\S\n]+/g," ").replace(/ *\n */g,"\n").replace(/\n{3,}/g,"\n\n").trim()}}(r.message):"\ud83e\udd14";document.getElementById("copilot-info-bubble-content").textContent=s,e._pointerContainer.style.opacity=1;var l=function(e){if("undefined"!=typeof window){var t=e.split(/\s+/).filter((function(e){return e.length>0})).length;return Math.ceil(t/3.6)+1}}(s),c=function(){e.currentAudio=void 0,setTimeout((function(){a()}),1e3*l)};(null===(o=null===(i=e.productTourData)||void 0===i?void 0:i.playVoice)||void 0===o||o)&&r.voice&&r.voice.length>0?(e.currentAudio=new Audio(r.voice),e.audioMuted&&(e.currentAudio.muted=!0),e.currentAudio.addEventListener("ended",(function(){setTimeout((function(){a()}),1e3)})),e.currentAudio.play().then((function(){})).catch((function(e){c()}))):c()}},i=r.selector?function(e){if("undefined"!=typeof window){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3)/100,n=0;return new Promise((function(r,o){var i=setInterval((function(){var a=Ze(e);a?(clearInterval(i),r(a)):n>=t&&(clearInterval(i),o(new Error("Element not found for selector: ".concat(e)))),n++}),100)}))}}(r.selector):Promise.resolve(null);i.then(o).catch((function(){return o(null)}))}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&by(t.prototype,n),r&&by(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ay(e){return Ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ay(e)}function Ty(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ly(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!this.productTourId&&!this.disabled)if(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,o)this.start();else{var i=this;Bm.getInstance().validateProductTour(e).then((function(){return r>0?setTimeout((function(){i.start()}),r):n.start()})).catch((function(e){e&&e.gleapReason||console.error(e),i.onComplete(!1)}))}}},{key:"onComplete",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t={tourId:this.productTourId};e?(dn.notifyEvent("productTourCompleted",t),$b.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(dn.notifyEvent("productTourQuit",t),$b.trackEvent("tour-".concat(this.productTourId,"-quit"),t)),this.gleapTourObj&&this.gleapTourObj.destroy(),this.gleapTourObj=void 0,this.productTourData=void 0,this.productTourId=void 0,this.currentActiveIndex=void 0,this.clearUncompletedTour()}},{key:"loadUncompletedTour",value:function(){try{var e=JSON.parse(localStorage.getItem(Py));if(null!=e&&e.tourData&&null!=e&&e.tourId)return e}catch(t){}return null}},{key:"storeUncompletedTour",value:function(){if(this.productTourId&&this.productTourData)try{var e=JSON.parse(JSON.stringify({tourData:this.productTourData,tourId:this.productTourId}));e.tourData.steps=e.tourData.steps.slice(this.currentActiveIndex||0,e.tourData.steps.length),localStorage.setItem(Py,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(Py)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return Dy.getInstance().startWithConfig(this.productTourId,t,(function(t){e.onComplete(t)}));this.unmuted=!1;for(var n=t.steps,r=this,o=[],i=0;i\n \n
').concat(ve("unmute"),"
\n ");else{var p="";t.sender&&t.sender.firstName&&(d=!0,p='
\n
\n
').concat(t.sender.firstName,"
\n
")),u="".concat(p,'
').concat(a.message,"
")}var h={disableActiveInteraction:!s&&!l&&!c,mode:a.mode,popover:Ly({description:u,popoverClass:"gleap-tour-popover-".concat(a.type," ").concat(!d&&"gleap-tour-popover-no-sender"," ").concat(t.allowClose&&"gleap-tour-popover-can-close")},s?{showButtons:[]}:{})};a.selector&&a.selector.length>0&&(h.element=a.selector),o.push(h)}var f=["next","close"];t.backButton&&f.push("previous"),this.gleapTourObj=dy(Oy(Oy(Oy(Oy(Oy(Oy(Oy(Oy(Oy(Oy({showProgress:!0,allowKeyboardControl:!1,steps:o},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",f),"onHighlightStarted",(function(t,n,r){var o;e.currentActiveIndex=null==r||null===(o=r.state)||void 0===o?void 0:o.activeIndex,e.storeUncompletedTour()})),"onElementNotFound",(function(t){document.removeEventListener("click",g,!0),e.onComplete(!1)})),"onDestroyStarted",(function(){e.gleapTourObj.hasNextStep()?e.onComplete(!1):e.onComplete(!0),document.removeEventListener("click",g,!0)})),"onPopoverRender",(function(t){if(t)for(var n=document.querySelectorAll(".gleap-tour-popover-description img, .gleap-tour-popover-description video"),o=function(){setTimeout((function(){e.gleapTourObj.refresh()}),500),setTimeout((function(){e.gleapTourObj.refresh()}),750)},i=0;i{const e=[];return Er()&&e.push("capture.screenshot","capture.recording"),hr&&e.push("capture.logs"),e})();n.length>0&&(t="&caps="+n.join(","))}catch(r){}this.socket=new WebSocket("".concat(Bm.getInstance().wsApiUrl,"?gleapId=").concat(Bm.getInstance().session.gleapId,"&gleapHash=").concat(Bm.getInstance().session.gleapHash,"&apiKey=").concat(Bm.getInstance().sdkKey,"&sdkVersion=").concat("19.9.2").concat(t)),this.socket.addEventListener("open",this.handleOpenBound),this.socket.addEventListener("message",this.handleMessageBound),this.socket.addEventListener("error",this.handleErrorBound),this.socket.addEventListener("close",this.handleCloseBound),this.addNetworkListeners()}}},{key:"clearReconnectTimeout",value:function(){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null)}},{key:"scheduleReconnect",value:function(){var t=this;if(this.clearReconnectTimeout(),!Vy()){var n=e.reconnectDelay(this.reconnectAttempts,Math.random());this.reconnectAttempts+=1,this.reconnectTimeout=setTimeout((function(){t.reconnectTimeout=null,Vy()||t.initWebSocket()}),n)}}},{key:"addNetworkListeners",value:function(){!this.networkListenersAdded&&"undefined"!=typeof window&&window&&"function"==typeof window.addEventListener&&(window.addEventListener("online",this.handleOnlineBound),this.networkListenersAdded=!0)}},{key:"removeNetworkListeners",value:function(){if(this.networkListenersAdded){try{window.removeEventListener("online",this.handleOnlineBound)}catch(e){}this.networkListenersAdded=!1}}},{key:"handleOnline",value:function(){(!this.socket||1!==this.socket.readyState&&0!==this.socket.readyState)&&(this.reconnectAttempts=0,this.initWebSocket())}},{key:"handleOpen",value:function(e){var t=this;this.socketOpenedAt=Date.now(),this.pingWS&&clearInterval(this.pingWS),this.pingWS=setInterval((function(){t.socket&&1===t.socket.readyState&&t.socket.send("PING")}),25e3),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null)}},{key:"handleMessage",value:function(e){this.reconnectAttempts=0,this.processMessage(JSON.parse(e.data))}},{key:"handleError",value:function(e){}},{key:"handleClose",value:function(e){this.socketOpenedAt&&Date.now()-this.socketOpenedAt>=1e4&&(this.reconnectAttempts=0),this.cleanupWebSocket(),this.scheduleReconnect()}},{key:"processMessage",value:function(e){try{if(At.getInstance().initialized)return;if("update"===e.name){var t,n,r=e.data,o=r.a,i=r.u,a=r.ai,s=r.rc,l=wv.getInstance().isOpened();if(s&&Zv.getInstance().clearNotificationsForConversation(s),a&&or.getInstance().setConfig({enabled:null!==(t=a.e)&&void 0!==t&&t,placeholder:a.p,quickActions:a.a,style:a.s,workflowId:null!==(n=a.w)&&void 0!==n?n:null}),o){var c=["banner","modal"],u=o.filter((function(e){var t;return!l||c.includes(null==e||null===(t=e.actionType)||void 0===t?void 0:t.toLowerCase())}));$b.getInstance().performActions(u)}null!=i&&Zv.getInstance().setNotificationCount(i)}if("capture-request"===e.name&&ad&&ad.getInstance().handleServerRequest(e.data),"checklist"===e.name&&null!=e&&e.data&&window){var d,p,h=e.data,f=null!==(d=h.completedSteps)&&void 0!==d?d:[],g=null!==(p=h.completedStepsBefore)&&void 0!==p?p:[];if(f.length>g.length)for(var m=function(e){var t,n=null==h||null===(t=h.steps)||void 0===t?void 0:t.find((function(t){return t.id===f[e]}));if(!n)return 1;var r=e;g.includes(n)||dn.notifyEvent("checklist-step-completed",{checklistId:h.id,outboundId:h.outboundId,stepId:n.id,stepIndex:r,step:n,completedSteps:h.completedSteps,status:h.status,data:h})},v=0;vthis.eventMaxLength&&this.eventArray.shift(),this.trimStreamedEvents()}},{key:"trimStreamedEvents",value:function(){for(;this.streamedEventArray.length>500;){var e=this.streamedEventArray.findIndex((function(e){return!e||"sessionStarted"!==e.name}));this.streamedEventArray.splice(-1!==e?e:0,1)}}},{key:"pingDidFinish",value:function(t,n,r,o){if(this.pingInFlight===t){this.pingInFlight=0;var i=o.status;if(i>=200&&i<300)return this.pingFailures=0,this.pingRetryAt=0,this.removeSentEvents(n),void(r&&this.streamEvents());e.isRetryablePingStatus(i)||this.removeSentEvents(n);var a=-1;try{a=e.parseRetryAfter(o.getResponseHeader("Retry-After"))}catch(l){}this.pingFailures+=1;var s=e.pingBackoffDelay(this.pingFailures,Math.random());a>0&&(s=Math.max(s,Math.min(a,3e5))),this.pingRetryAt=Date.now()+s}}},{key:"nextPingBatch",value:function(){for(var e=[],t=[],n=2,r=0;r0&&n+i>262144)break;e.push(o),n+=i}return t.length>0&&(this.streamedEventArray=this.streamedEventArray.filter((function(e){return-1===t.indexOf(e)}))),{events:e,hasMore:e.length=500}},{key:"parseRetryAfter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n="string"==typeof e?e.trim():"";if(!n)return-1;if(/^\d+$/.test(n))return 1e3*parseInt(n,10);var r=Date.parse(n);return isNaN(r)?-1:Math.max(0,r-t)}}],n&&qy(t.prototype,n),r&&qy(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Xy(e){return Xy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xy(e)}function Yy(e,t){for(var n=0;n100||("string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i||(t[o]=String(i).slice(0,1e3)))}return t},mb=function(e){var t=e&&"object"===db(e)?e:{format:e},n="string"==typeof t.format?t.format:"",r=hb[n]||"card",o={format:r,appMode:"survey_web"===n?"survey_web":pb[r],fields:gb(t.fields),resume:!0===t.resume,container:"page"===r?fb(t.container):null};return!0===t.keyboard&&(o.keyboard=!0),"string"==typeof t.personalToken&&t.personalToken.length>0&&(o.personalToken=t.personalToken),"string"==typeof t.outboundAction&&t.outboundAction.length>0&&(o.outboundAction=t.outboundAction),t.resumeData&&"object"===db(t.resumeData)&&!Array.isArray(t.resumeData)&&(o.resumeData=t.resumeData),o};function vb(e){return function(e){if(Array.isArray(e))return yb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return yb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yb(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.root,r=t.isVisible,o=void 0===r?Db:r,i=n||("undefined"!=typeof document?document:null);if(!i||!Eb(e))return null;var a=i.body||i,s=new Set;try{for(var l=(i.ownerDocument||i).createTreeWalker(a,4),c=l.nextNode();c;){if(c.nodeValue&&c.nodeValue.trim())for(var u=c.parentElement,d=0;u&&d<3&&(u!==a&&!Cb.has(u.tagName.toUpperCase()))&&!((u.textContent||"").length>320);d+=1)s.add(u),u=u.parentElement;c=l.nextNode()}a.querySelectorAll('[aria-label], [title], [placeholder], input[type="button"], input[type="submit"], img[alt]').forEach((function(e){return s.add(e)}))}catch(h){return null}var p=null;return s.forEach((function(t){if(!function(e){try{return!!e.closest('.gleap-frame-container, .bb-feedback-button, [id^="gleap"], [class^="gleap"], #copilot-pointer-container')}catch(h){return!1}}(t)){var n=Math.max.apply(Math,[0].concat(vb(function(e){var t=[];["aria-label","title","placeholder","alt"].forEach((function(n){var r=e.getAttribute&&e.getAttribute(n);r&&t.push(r)})),"INPUT"===e.tagName&&["button","submit","reset"].includes("".concat(e.type).toLowerCase())&&e.value&&t.push(e.value);var n=e.textContent;return n&&n.length<=320&&t.push(n),t}(t).map((function(t){return function(e,t){var n=Eb(e),r=Eb(t);if(!n||!r||n.length>160)return 0;if(n===r)return 100;if(" ".concat(n," ").includes(" ".concat(r," ")))return 60+Math.round(r.length/n.length*30);var o=Ib(r),i=Ib(n);if(0===o.length||0===i.length)return 0;var a=new Set(i),s=o.filter((function(e){return a.has(e)})).length,l=s/o.length,c=s/i.length;return 0===s||l<.5||c<.5?0:Math.round(50*Math.min(l,c))}(t,e)})))));if(0!==n){var r=!1;try{r=t.matches(Sb)||!!t.closest(Sb)}catch(h){}var i=(t.textContent||"").length;(!p||n>p.score||n===p.score&&r&&!p.interactive||n===p.score&&r===p.interactive&&i1&&void 0!==arguments[1]?arguments[1]:{}).color;if(e&&"undefined"!=typeof document){Lb(),function(e){if(!document.getElementById(kb)){var t=document.createElement("style");t.id=kb,t.textContent="\n#".concat(wb," {\n position: fixed;\n pointer-events: none;\n z-index: 2147483600;\n border: 3px solid ").concat(e,";\n border-radius: 10px;\n box-shadow: 0 0 0 4px ").concat(e,"33, 0 0 24px ").concat(e,"66;\n transition: opacity 0.3s ease;\n animation: gleap-highlight-pulse 1.2s ease-in-out 3;\n}\n@keyframes gleap-highlight-pulse {\n 0%, 100% { box-shadow: 0 0 0 4px ").concat(e,"33, 0 0 24px ").concat(e,"66; }\n 50% { box-shadow: 0 0 0 10px ").concat(e,"22, 0 0 32px ").concat(e,"88; }\n}\n@media (prefers-reduced-motion: reduce) {\n #").concat(wb," { animation: none; }\n}"),document.head.appendChild(t)}}(/^#[0-9a-f]{6}$/i.test(t||"")?t:"#485BFF");try{e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}catch(l){}var n=window.setTimeout((function(){try{var t=e.getBoundingClientRect();(t.bottom<0||t.top>window.innerHeight)&&e.scrollIntoView({block:"center",inline:"nearest"})}catch(l){}}),800),r=document.createElement("div");r.id=wb,r.setAttribute("aria-hidden","true"),document.body.appendChild(r);var o=null,i=function(){var t=e.getBoundingClientRect();r.style.top="".concat(t.top-6,"px"),r.style.left="".concat(t.left-6,"px"),r.style.width="".concat(t.width+12,"px"),r.style.height="".concat(t.height+12,"px"),r.style.opacity=e.isConnected?"1":"0"};!function e(){i(),o=window.requestAnimationFrame(e)}(),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i);var a=function(){return Lb()},s=window.setTimeout((function(){r.style.opacity="0",window.setTimeout(a,300)}),6e3);window.addEventListener("pointerdown",a,!0),window.addEventListener("keydown",a,!0),Tb=function(){window.clearTimeout(s),window.clearTimeout(n),o&&window.cancelAnimationFrame(o),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i),window.removeEventListener("pointerdown",a,!0),window.removeEventListener("keydown",a,!0),r.parentNode&&r.parentNode.removeChild(r)}}},Ob=null,Mb=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).color;if("undefined"==typeof window)return!1;var t=function(e){try{var t=new URLSearchParams(e||"").get(bb),n="".concat(null!=t?t:"").trim();return n?n.slice(0,120):null}catch(r){return null}}(window.location.search);return!!t&&(function(){try{var e=new URL(window.location.href);if(!e.searchParams.has(bb))return;e.searchParams.delete(bb),window.history.replaceState(window.history.state,"",e.toString())}catch(t){}}(),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.color,r=t.timeoutMs,o=void 0===r?1e4:r,i=t.intervalMs,a=void 0===i?300:i,s=t.isVisible;Ob&&Ob();var l=Date.now(),c=null,u=!1,d=function(){u=!0,c&&window.clearTimeout(c),Ob=null};Ob=d,function t(){if(!u){var r=Ab(e,{isVisible:s});if(r)return d(),void Fb(r,{color:n});Date.now()-l>=o?d():c=window.setTimeout(t,a)}}()}(t,{color:e}),!0)};function Pb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"";return ub.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return ub.translateTextWithVars(e,t)||n}},{key:"getCheckIcon",value:function(){return'\n \n '}},{key:"loadChecklist",value:function(){if(this._isSessionReady&&this._networkManager){var e=this.getAttribute("checklistId");e?(this.activeStep=-1,this._initialActiveSet=!1,this.validateChecklist(e)):(this.renderResponse(),this.checklistData=null,this._hasLoaded=!1)}}},{key:"getQueryParams",value:function(){var e=this._getGleapSessionInstance();if(null==e||!e.session)return"";var t=e.session,n="en";try{void 0!==ub&&(n=ub.getInstance().getActiveLanguage()||"en")}catch(r){}return"gleapId=".concat(t.gleapId||"","&gleapHash=").concat(t.gleapHash||"","&lang=").concat(n)}},{key:"makeRequest",value:function(e,t,n,r){var o=this._getGleapSessionInstance();if(null!=o&&o.session){var i=new XMLHttpRequest;i.open(e,t);try{o.injectSession(i)}catch(a){}n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){4===i.readyState&&r(i)},i.onerror=function(){r(i)},i.send(n?JSON.stringify(n):null)}else r({readyState:4,status:0,responseText:"Session unavailable",_isMock:!0})}},{key:"validateChecklist",value:function(e){var t=this;if(this._isSessionReady&&this._networkManager){this.checklistData=null,this._hasLoaded=!1,this.renderResponse();var n=this.getAttribute("sharedKey");this._networkManager.validateChecklist(e,n).then((function(e){t.isConnected&&t._isSessionReady&&e&&t.fetchChecklist(e)})).catch((function(e){t.renderResponse(),t.checklistData=null,t._hasLoaded=!1}))}}},{key:"fetchChecklist",value:function(e){var t=this;this._isSessionReady&&this._networkManager&&(this._isInitialLoad=!this._hasLoaded,this._networkManager.fetchChecklist(e).then((function(e){var n;if(!t.isConnected||!t._isSessionReady||!e)return t._hasLoaded=!1,t.checklistData=null,void t._checkSessionAndLoad();if(t.checklistData=e,t._hasLoaded=!0,"done"!==e.status){if(t._isInitialLoad&&!t._initialActiveSet){var r,o=(null===(r=e.outbound)||void 0===r||null===(r=r.config)||void 0===r?void 0:r.steps)||[],i=e.completedSteps||[],a=o.findIndex((function(e){return!i.includes(e.id)}));t.activeStep=a>=0?a:-1,-1!==t.activeStep&&(t._initialActiveSet=!0)}t.renderChecklist(t.checklistData),dn.notifyEvent("checklist-loaded",{checklistId:t.checklistData.id,outboundId:null===(n=t.checklistData.outbound)||void 0===n?void 0:n.id,completedSteps:t.checklistData.completedSteps,status:t.checklistData.status,data:t.checklistData})}else t.renderResponse()})).catch((function(e){t.renderResponse(),t.checklistData=null,t._hasLoaded=!1})))}},{key:"updateChecklist",value:function(e,t){var n,r,o=this._getGleapSessionInstance();if(null!=o&&o.session){var i=o.apiUrl;if(i){var a=o.session,s=null!==(n=null==a?void 0:a.gleapId)&&void 0!==n?n:"",l=null!==(r=null==a?void 0:a.gleapHash)&&void 0!==r?r:"",c="en";try{void 0!==ub&&(c=ub.getInstance().getActiveLanguage()||"en")}catch(d){}var u="".concat(i,"/outbound/checklists/").concat(e);t.checkedStep&&(u+="/increment/".concat(t.checkedStep)),u+="?gleapId=".concat(s,"&gleapHash=").concat(l,"&lang=").concat(c),this.makeRequest("PUT",u,t,(function(e){e._isMock||200!==e.status&&e.status}))}}}},{key:"handleChecklistUpdate",value:function(e){if(this._hasLoaded&&this.checklistData){var t=e.detail;if(t&&t.id===this.checklistData.id){var n,r=ld(this.checklistData.completedSteps||[]),o=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(r)&&(this.checklistData.completedSteps=ld(t.completedSteps),o=!0,-1!==a)){var s,l=null===(s=this.checklistData.outbound)||void 0===s||null===(s=s.config)||void 0===s||null===(s=s.steps)||void 0===s||null===(s=s[a])||void 0===s?void 0:s.id;l&&this.checklistData.completedSteps.includes(l)&&!r.includes(l)&&(i=!0)}if(t.status&&t.status!==this.checklistData.status&&(this.checklistData.status=t.status,o=!0),i){for(var c,u=(null===(c=this.checklistData.outbound)||void 0===c||null===(c=c.config)||void 0===c?void 0:c.steps)||[],d=-1,p=a+1;p1&&void 0!==arguments[1]?arguments[1]:"checklist-floating",o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=(null===(t=e.config)||void 0===t?void 0:t.steps)||[],a=(null===(n=this.checklistData)||void 0===n?void 0:n.completedSteps)||[],s=0;if(this.progressbarEnabled&&i.length>0){var l=i.length,c=a.length;s=l>0?c/l*100:0}var u,d,p=i.find((function(e){return!a.includes(e.id)})),h=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",f=i.length>0?p&&p.description||"":e.message||"";o&&(h=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",f=(null===(d=e.config)||void 0===d?void 0:d.successMessage)||"",s=100);var g=2*Math.PI*7,m=g-s/100*g,v="checklist-floating-header"===r,y=v?'\n \n \n ':'\n \n ';return'\n
\n
\n
\n \n \n \n \n
\n
').concat(h,"
\n ").concat(o?"":''.concat(y,""),'\n
\n
').concat(f,"
\n
\n ")}},{key:"renderInfoSection",value:function(e){var t;if(!this.infoEnabled||!e)return"";var n=e.subject||this._translate("checklistDefaultTitle","Checklist"),r=e.message||"",o="";return null!==(t=e.sender)&&void 0!==t&&t.profileImageUrl&&(o='\n
\n ').concat(e.sender.firstName||\n ').concat(e.sender.firstName||"","\n
")),'\n
\n '.concat(n?'
'.concat(n,"
"):"","\n ").concat(r?'
'.concat(r,"
"):"","\n ").concat(o,"\n
")}},{key:"renderProgressSection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!this.progressbarEnabled||!e.length)return"";var n=e.length,r=t.length,o=n>0?r/n*100:0,i=0;e.forEach((function(e){!t.includes(e.id)&&e.duration>0&&(i+=e.duration)}));var a=this._translateWithVars("taskProgress",{a:r,b:n},"".concat(r," of ").concat(n," done")),s=i>0?this._translateWithVars("aboutMinutes",{a:i},"About ".concat(i," min left")):"";return'\n
\n
'.concat(a,"
\n ").concat(s?'
'.concat(s,"
"):"",'\n
\n
\n
\n
')}},{key:"renderTasks",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t&&0!==t.length?t.map((function(t,r){var o=n.includes(t.id),i=e.activeStep===r,a=o?''.concat(e.getCheckIcon(),""):''.concat(r+1,""),s=t.title||e._translateWithVars("stepDefaultTitle",{index:r+1},"Step ".concat(r+1)),l=t.description||"",c=t.actionTitle||e._translate("actionDefaultTitle","Action"),u=t.action&&"none"!==t.action?'
\n \n
"):"",d=e._translate("markAsDone","Mark as done"),p=t.allowMarkDone&&!o?'
\n ').concat(e.getCheckIcon(),'\n
').concat(d,"
\n
"):"",h=["checklist-task",o?"checklist-task--done":"",i?"checklist-task--active":""].filter(Boolean).join(" ");return'\n
\n
\n ').concat(a,'\n
').concat(s,'
\n \n \n \n \n \n
\n
\n
\n ').concat(l?'
'.concat(l,"
"):"","\n ").concat(u,"\n ").concat(p,"\n
\n
\n
")})).join(""):"

".concat(this._translate("noStepsDefined","No steps defined."),"

")}},{key:"renderChecklist",value:function(e){var t;if(this._hasLoaded&&e&&e.outbound){var n=e.outbound,r=(null===(t=n.config)||void 0===t?void 0:t.steps)||[],o=e.completedSteps||[],i="";if("done"===e.status||r.length>0&&o.length>=r.length){var a,s,l=(null===(a=n.config)||void 0===a?void 0:a.successTitle)||"",c=(null===(s=n.config)||void 0===s?void 0:s.successMessage)||"";i=this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-launcher",!0):'\n
\n
\n '.concat(this.getCheckIcon(),'\n
\n
').concat(l,'
\n
').concat(c,"
\n
"),-1!==this.activeStep&&(this.activeStep=-1)}else i='\n
\n '.concat(this.floatingEnabled?"":this.renderInfoSection(n),"\n ").concat(this.floatingEnabled?"":this.renderProgressSection(r,o),"\n ").concat(this.floatingEnabled?this.renderFloatingLauncher(n):"",'\n
\n ').concat(this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-header"):"","\n ").concat(this.renderTasks(r,o),"\n
\n
");var u=Rd.getInstance().getFlowConfig(),d=u.color?u.color:"#485BFF";Jn.getInstance().applyToChecklist(this);var p="\n \n ');this.shadowRoot.innerHTML=p+i,this.addTaskEventListeners(),this.floatingEnabled&&this.addFloatingClickListeners(),-1!==this.activeStep&&this.toggleTask(this.activeStep,!0)}else this._checkSessionAndLoad()}},{key:"updateActiveTaskMaxHeight",value:function(){if(-1!==this.activeStep){var e=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(this.activeStep,'"] .checklist-task-body-inner')),t=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(this.activeStep,'"] .checklist-task-body'));if(e&&t){var n=e.offsetHeight;t.style.setProperty("--task-body-active-height","".concat(n,"px"))}}}},{key:"addTaskEventListeners",value:function(){var e=this;this.shadowRoot.querySelectorAll(".checklist-task").forEach((function(t){var n=t.querySelector(".checklist-task-header"),r=parseInt(t.getAttribute("data-task-index"),10);n&&n.addEventListener("click",(function(){var t=e.activeStep===r?-1:r;e.setActiveStep(t)}));var o=t.querySelector(".checklist-task-body-markdone");o&&o.addEventListener("click",(function(t){var n;if(t.stopPropagation(),null!==(n=e.checklistData)&&void 0!==n&&null!==(n=n.outbound)&&void 0!==n&&null!==(n=n.config)&&void 0!==n&&n.steps){var o=e.checklistData.outbound.config.steps[r];if(o){var i=e.activeStep;if(e.checklistData.completedSteps||(e.checklistData.completedSteps=[]),!e.checklistData.completedSteps.includes(o.id)){e.checklistData.completedSteps.push(o.id);var a=e.checklistData.outbound.config.steps,s=-1;if(i===r){for(var l=r+1;l0&&e.checklistData.completedSteps.length>=a.length&&(e.checklistData.status="done",c.status="done"),e.updateChecklist(e.checklistData.id,c)}}}}));var i=t.querySelector(".checklist-task-body-action .action-button");i&&i.addEventListener("click",(function(t){var n;if(t.stopPropagation(),null!==(n=e.checklistData)&&void 0!==n&&null!==(n=n.outbound)&&void 0!==n&&null!==(n=n.config)&&void 0!==n&&n.steps&&void 0!==$b){var o=e.checklistData.outbound.config.steps[r];if(o&&o.action&&"none"!==o.action&&!mr("start-custom-action"))try{"BOT"===o.action?$b.startBot(o.botId):"CUSTOM_ACTION"===o.action?$b.triggerCustomAction(o.actionBody):"REDIRECT_URL"===o.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),$b.openURL(o.actionBody,!!o.actionOpenInNewTab)):"FEEDBACK_FLOW"===o.action?$b.startFeedbackFlow(o.formId):"NEWS_ARTICLE"===o.action?$b.openNewsArticle(o.articleId):"HELP_ARTICLE"===o.action?$b.openHelpCenterArticle(o.articleId):"CHECKLIST"===o.action?$b.startChecklist(o.outboundId,!0,null==o?void 0:o.sharedKey):"PRODUCT_TOUR"===o.action&&$b.startProductTour(o.productTourId,!0)}catch(i){}}}))}))}},{key:"setActiveStep",value:function(e){var t=this,n=this.activeStep;this.activeStep=e;var r=[];-1!==n&&n!==this.activeStep&&r.push({index:n,open:!1}),-1!==this.activeStep&&this.activeStep!==n&&r.push({index:this.activeStep,open:!0}),r.forEach((function(e){var n=e.index,r=e.open;t.toggleTask(n,r)}))}},{key:"toggleTask",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(e,'"]'));if(r){var o=r.querySelector(".checklist-task-header");if(o){var i=r.classList.contains("checklist-task--active"),a=null!==n?n:!i;if(a){i||(r.classList.add("checklist-task--active"),o.setAttribute("aria-expanded","true"));var s=r.querySelector(".checklist-task-body-inner");if(s){var l=s.offsetHeight,c=r.querySelector(".checklist-task-body");c&&c.style.setProperty("--task-body-active-height","".concat(l,"px"))}r.querySelectorAll("iframe").forEach((function(n){n._heightListenerAdded||(n._heightListenerAdded=!0,n.addEventListener("load",(function(){t.activeStep===e&&t.updateActiveTaskMaxHeight()})))}))}else!a&&i&&(r.classList.remove("checklist-task--active"),o.setAttribute("aria-expanded","false"))}}}}],o=[{key:"observedAttributes",get:function(){return["checklistId","info","progressbar","dark","floating","sharedKey"]}}],r&&ud(n.prototype,r),o&&ud(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(hd(HTMLElement));"undefined"==typeof customElements||customElements.get("gleap-checklist")||customElements.define("gleap-checklist",e)}}(),function(){if("undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&"undefined"!=typeof window&&!customElements.get("gleap-agent-conversation")){var e=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=new Array(n),o=0;o0||r.pageFilter)&&window&&window.location&&!nm(window.location.href,r))continue;if("notification"===r.actionType)"widget"===(null==r||null===(a=r.data)||void 0===a||null===(a=a.checklist)||void 0===a?void 0:a.popupType)?e.openChecklist(r.data.checklist.id,!0):this.disableInAppNotifications||e.showNotification(r);else if("banner"===r.actionType)e.showBanner(r);else if("modal"===r.actionType)e.showModal(r);else if("tour"===r.actionType)e.startProductTourWithConfig(r.outbound,r.data,!1);else{if("survey_page"===wv.getInstance().appMode)continue;e.showSurvey(r.actionType,{format:r.format,resume:!0===r.resume,resumeData:!0===r.resume?r.data:void 0,outboundAction:r._id||r.id})}}}}},{key:"setGlobalDataItem",value:function(e,t){this.globalData[e]=t}},{key:"getGlobalDataItem",value:function(e){return this.globalData[e]}},{key:"takeCurrentReplay",value:function(){var e=vs.getInstance().getReplayData(),t=e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0;this.setGlobalDataItem("webReplay",t?e:null)}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"setEnvironment",value:function(e){Uv.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){Uv.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){Uv.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){q=U(e)}(e)}},{key:"setTags",value:function(e){ib.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){wv.getInstance().setUrlHandler(e)}},{key:"setOfflineMode",value:function(e){this.getInstance().offlineMode=e}},{key:"setDisableInAppNotifications",value:function(e){var t=this.getInstance();t.disableInAppNotifications!==e&&(t.disableInAppNotifications=e,Zv.getInstance().renderNotifications())}},{key:"setDisablePageTracking",value:function(e){this.getInstance().disablePageTracking=e}},{key:"disableConsoleLogOverwrite",value:function(){up.getInstance().stop()}},{key:"setAiTools",value:function(e){wn.getInstance().setAgentTools(e),or.getInstance().sendAgentToolsUpdate(),wv.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){kh.getInstance().setExternalRequests(ee(e))}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";up.getInstance().addLog(e,t)}},{key:"initialize",value:function(t,n){var r=this.getInstance();if(r.initialized)console.warn("Gleap already initialized.");else{t&&"object"===Nb(t)?t=(n=t).projectId:!t&&n&&"object"===Nb(n)&&n.projectId&&(t=n.projectId),n&&"object"===Nb(n)&&"sessionDuration"in n&&Bm.getInstance().setSessionDuration(n.sessionDuration),r.initialized=!0;try{vs.getInstance().startIfNotRunning()}catch(i){}try{!function(){try{var e=function(){try{var e=document.querySelector(".gleap-frame-container-inner iframe");if(!e)return;r(e);var t=window.visualViewport,n=l(window.innerHeight)-l(t.height);!d&&n>=a?(e.style.setProperty("max-height",t.height+"px","important"),e.style.setProperty("transform","translateY("+t.offsetTop+"px)","important")):(e.style.removeProperty("max-height"),e.style.removeProperty("transform"))}catch(i){}},t=function(){try{window.setTimeout((function(){try{var e=p&&p.activeElement;if(e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable))return;d=!0;var t=document.querySelector(".gleap-frame-container-inner iframe");t&&(t.style.removeProperty("max-height"),t.style.removeProperty("transform")),o()}catch(n){}}),100)}catch(i){}},n=function(){d=!1,o()},r=function(e){try{var r=e.contentDocument;if(!r||r===p)return;p=r,r.addEventListener("focusout",t,!0),r.addEventListener("focusin",n,!0)}catch(i){}},o=function(){try{u||(u=!0,window.requestAnimationFrame((function(){u=!1,e()}))),c&&clearTimeout(c),c=setTimeout(e,s)}catch(i){}};if(!("visualViewport"in window)||!window.visualViewport||!/iPad|iPhone|iPod/.test(navigator.userAgent))return;if(pe)return;pe=!0;var a=150,s=350,l=function(e){return Math.round(e)},c=null,u=!1,d=!1,p=null,h=window.visualViewport;h.addEventListener("resize",o),h.addEventListener("scroll",o),window.addEventListener("orientationchange",(function(){try{o()}catch(i){}})),e()}catch(i){}}()}catch(i){}var o=Bm.getInstance();o.sdkKey=t,o.setOnSessionReady((function(){setTimeout((function(){Rd.getInstance().start().then((function(){Ky.getInstance().start(),de((function(){R.getInstance().injectFeedbackButton(),Zv.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams();try{ad.getInstance().resumeFromStorage()}catch(t){}dn.notifyEvent("initialized")}))})).catch((function(e){console.warn("Failed to initialize Gleap.")}))}),0)})),o.startSession()}}},{key:"openURL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];wv.getInstance().urlHandler(e,t)}},{key:"disableQueryParams",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.getInstance().disableQueryParams=e}},{key:"checkForUrlParams",value:function(){if(this.getInstance().disableQueryParams)console.log("Query params are disabled.");else if("undefined"!=typeof window&&window.location.search)try{var t=new URLSearchParams(window.location.search),n=t.get("gleap_widget");n&&n.length>0&&e.open();var r=t.get("gleap_conversation");r&&r.length>0&&("true"===r?e.startConversation(!0):e.startBot(r,!0));var o=t.get("gleap_feedback");o&&o.length>0&&e.startFeedbackFlow(o);var i,a=t.get("gleap_survey"),s=t.get("gleap_survey_format");if(a&&a.length>0){var l="survey_full"===s||"full"===s;e.showSurvey(a,l?"survey_full":"survey")}t.get(bb)&&Mb({color:null===(i=Rd.getInstance().getFlowConfig())||void 0===i?void 0:i.color});var c=t.get("gleap_tour");if(c&&c.length>0){var u=parseInt(t.get("gleap_tour_delay"));isNaN(u)&&(u=2),setTimeout((function(){e.startProductTour(c)}),1e3*u)}}catch(d){}}},{key:"destroy",value:function(){try{ad.getInstance().destroy()}catch(e){}vs.getInstance().stop(),Ky.getInstance().stop(),wv.getInstance().destroy(),R.getInstance().destroy(),Zv.getInstance().clearAllNotifications(!0),eb.getInstance().stop(),or.getInstance().destroy(),Bm.getInstance().clearSession(0,!1),Pr.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){Pr.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){$v.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=or.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=or.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{or.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){or.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){or.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){Bm.getInstance().setUseCookies(e)}},{key:"disableLocalStorage",value:function(){Bm.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return Bm.getInstance().identifySession(e,ne(ee(t)),n)}},{key:"setUserJwt",value:function(e){return Bm.getInstance().setUserJwt(e)}},{key:"setSessionDuration",value:function(e){Bm.getInstance().setSessionDuration(e)}},{key:"setUserJwtProvider",value:function(e){Bm.getInstance().setUserJwtProvider(e)}},{key:"setAuthTokens",value:function(e){return Bm.getInstance().setAuthTokens(e)}},{key:"updateContact",value:function(e){return Bm.getInstance().updateSession(ne(ee(e)))}},{key:"clearIdentity",value:function(){Bm.getInstance().clearSession()}},{key:"getIdentity",value:function(){return _b(_b({},Bm.getInstance().getSession()),{},{grant:Bm.getInstance().grant||null})}},{key:"isUserIdentified",value:function(){var e=Bm.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return wv.getInstance().isOpened()}},{key:"hide",value:function(){wv.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){kh.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){kh.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){kh.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){kh.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){vs.getInstance().setOptions(e)}},{key:"setCaptureEnabled",value:function(e){ad.getInstance().setCaptureEnabled(e)}},{key:"setRemoteLogCollectionEnabled",value:function(e){ad.getInstance().setRemoteLogCollectionEnabled(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];wv.getInstance().hideWidget(e)}},{key:"open",value:function(){wv.getInstance().setAppMode("widget"),wv.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Ky.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Ky.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=ee(e);ry.getInstance().formPreFill=t,wv.getInstance().sendMessage({name:"prefill-form-data",data:t},!0)}},{key:"on",value:function(e,t){dn.on(e,t)}},{key:"enableShortcuts",value:function(e){e?Uy.getInstance().start():Uy.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){R.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){Uv.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){Uv.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){Bm.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return Bm.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){Bm.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){Bm.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){Bm.getInstance().apiUrl=e,kh.getInstance().setSdkApiUrl(e)}},{key:"setBannerUrl",value:function(e){Pr.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){$v.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){an(e)}},{key:"setFrameUrl",value:function(e){wv.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){xp.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){xp.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){xp.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){xp.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){xp.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){xp.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){xp.getInstance().clearCustomData()}},{key:"playSound",value:function(e){cr.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=Zv.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){ub.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){var n,r;e.getInstance().softReInitialize(),null===(n=e.updateContact({lang:t}))||void 0===n||null===(r=n.catch)||void 0===r||r.call(n,(function(){}))}),1e3)}},{key:"registerAgentToolAction",value:function(e){wn.getInstance().registerAgentToolAction(e)}},{key:"registerAgentTool",value:function(e,t){wn.getInstance().registerAgentTool(e,t)}},{key:"registerCustomAction",value:function(e){vp.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){vp.triggerCustomAction(e)}},{key:"setColorScheme",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Jn.getInstance().setColorScheme(e,t)}},{key:"setStyles",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#ffffff",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:20,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:20,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:R.FEEDBACK_BUTTON_BOTTOM_LEFT,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:void 0,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0;de((function(){!function(e,t,n,r,o,i,a,s,l,c){var u=me(e),d=me(n),p=me(o),h="#ffffff"===p,f=l||t,g=c||t,m=ge(o,h?100:-120),v=ge(o,h?30:-12),y=ge(o,h?80:-30),b=h?o:"#fff",w=h?p:"#2d2d2d",k=(r=parseInt(r,10),Math.round(1.05*r)),x=Math.round(.8*r),S=Math.round(.4*r),C=Math.round(.25*r),E=Math.max(2,Math.round(.55*r)),I=Math.max(2,Math.round(20*E/32)),D=57+a;s===R.FEEDBACK_BUTTON_CLASSIC_BOTTOM?D=a+15:(s&&s.includes("CLASSIC")||s===R.FEEDBACK_BUTTON_NONE)&&(D=a);var A='\n .gleap-font, .gleap-font * {\n font-style: normal;\n font-variant-caps: normal;\n font-variant-ligatures: normal;\n font-variant-numeric: normal;\n font-variant-east-asian: normal;\n font-weight: normal;\n font-stretch: normal;\n font-size: 100%;\n line-height: 1;\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n }\n .gleap-ai-ui-widget {\n display: none;\n }\n .gleap-input-highlight {\n box-shadow: 0 0 0 3px '.concat(e," !important;\n }\n .gleap-frame-container {\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n width: calc(100% - 40px);\n max-width: 410px;\n position: fixed;\n z-index: ").concat(2147483631,";\n visibility: visible;\n box-shadow: 0px 5px 40px 0px rgba(9, 14, 21, 0.16);\n border-radius: ").concat(1.5*x,"px;\n overflow: hidden;\n transform-origin: right bottom;\n animation: gleapWidgetScale 0.3s cubic-bezier(0, 1.2, 1, 1) both, gleapWidgetFade 0.12s ease-out both;\n user-select: none;\n pointer-events: none;\n transition: max-width 0.3s ease-out;\n }\n\n .gleap-admin-highlight {\n box-shadow: 0px 0px 0px 4px red;\n }\n\n :root {\n --gleap-margin-top: 50px;\n }\n\n .gleap-tooltip-anchor {\n position: absolute;\n display: block;\n width: 0px;\n height: 0px;\n margin: 0px;\n padding: 0px;\n overflow: visible;\n }\n\n .gleap-tooltip-hotspot {\n position: absolute;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n }\n\n @keyframes gleap-pulse {\n 0% {\n transform: scale(0);\n opacity: 0.25;\n }\n 45% {\n transform: scale(2.5);\n opacity: 0;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n }\n\n .gleap-tooltip-hotspot-animation {\n position: absolute;\n border-radius: 17px;\n opacity: 0.25;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n animation: gleap-pulse 5s infinite;\n }\n\n .gleap-tooltip-hotspot svg {\n width: 17px;\n height: 17px;\n object-fit: contain;\n display: block;\n }\n\n .gleap-tooltip-inner {\n position: relative;\n overflow: visible;\n font-size: 14px;\n font-weight: normal;\n color: #000;\n line-height: 1.3;\n }\n\n .gleap-tooltip {\n position: absolute;\n background-color: #fff;\n color: #000;\n font-size: 15px;\n line-height: 18px;\n padding: 16px;\n padding-top: 8px;\n padding-bottom: 8px;\n border-radius: 4px;\n max-width: min(350px, 80vw);\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s, visibility 0.2s;\n z-index: ").concat(2147483700,";\n }\n\n .gleap-tooltip a {\n color: ").concat(e,";\n text-decoration: underline;\n display: inline !important;\n margin: 0px !important;\n padding: 0px !important;\n word-break: break-word;\n }\n\n .gleap-tooltip ul {\n padding-left: 16px;\n }\n\n .gleap-tooltip b {\n font-weight: 600;\n }\n\n .gleap-tooltip h2 {\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip h3 {\n font-size: 16px;\n line-height: 18px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip p {\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip img {\n max-width: 100%;\n max-height: 300px;\n width: 100%;\n height: auto;\n object-fit: cover;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip iframe,\n .gleap-tooltip video {\n max-width: 100%;\n width: 100%;\n height: auto;\n min-height: 200px;\n display: block;\n border: none;\n outline: none;\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip-arrow {\n position: absolute;\n width: 20px;\n height: 20px;\n }\n\n .gleap-tooltip-arrow svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n\n .gleap-b-frame {\n width: 100%;\n height: 100%;\n border: none;\n pointer-events: auto;\n padding: 0px;\n margin: 0px;\n }\n\n .gleap-b-shown {\n transition: margin 0.3s ease-out;\n margin-top: var(--gleap-margin-top);\n position: relative;\n z-index: 10000;\n }\n\n .gleap-b-f {\n margin-top: 0px;\n }\n\n .gleap-b-shown.gleap-b-clip {\n transition: padding 0.3s ease-out;\n margin-top: 0px;\n padding-top: calc(var(--gleap-margin-top) + var(--gleap-b-body-padding-top, 0px));\n }\n\n .gleap-b-clip .gleap-b {\n top: 0px;\n }\n\n .gleap-b {\n display: none;\n position: absolute;\n top: calc(-1 * var(--gleap-margin-top));\n left: 0px;\n width: 100vw;\n height: var(--gleap-margin-top);\n z-index: ").concat(2147483699,";\n }\n\n @keyframes gleapSlideIn {\n from {\n top: calc(-1 * var(--gleap-margin-top));\n }\n to {\n top: 10px;\n }\n }\n\n .gleap-b-f .gleap-b {\n position: fixed;\n top: 10px;\n animation: gleapSlideIn .25s ease-out forwards;\n max-width: 800px;\n width: calc(100% - 20px);\n left: 50%;\n z-index: ").concat(2147483699,";\n transform: translateX(-50%);\n border-radius: ").concat(S,"px;\n overflow: hidden;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.15), 0px 5px 5px rgba(0, 0, 0, 0.05);\n }\n\n .gleap-b-shown .gleap-b {\n display: block;\n }\n\n .gleap-image-view {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n z-index: ").concat(2147483699,";\n background-color: ").concat(p,"cc;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-image-view-image {\n width: 90%;\n height: auto;\n max-width: 90%;\n max-height: 90%;\n object-fit: contain;\n }\n\n .gleap-image-view-close {\n position: fixed;\n top: 20px;\n right: 20px;\n width: 32px;\n height: 32px;\n opacity: 0.8;\n z-index: ").concat(2147483740,";\n box-shadow: 0px 5px 18px rgba(0, 0, 0, 0.16);\n cursor: pointer;\n }\n\n .gleap-image-view-close:hover {\n opacity: 1;\n }\n\n .gleap-image-view-close svg path {\n fill: ").concat(o,";\n }\n\n [dir=rtl].gleap-frame-container {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container iframe {\n transition: opacity 0.3s ease;\n }\n\n .gleap-frame-container--loading iframe {\n opacity: 0;\n transition: none;\n }\n\n .gleap-frame-loader {\n visibility: hidden;\n opacity: 0;\n transition: opacity 0.3s ease, visibility 0s linear 0.35s;\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n overflow: hidden;\n background-color: ").concat(o,";\n pointer-events: none;\n }\n\n .gleap-frame-container--loading .gleap-frame-loader {\n visibility: visible;\n opacity: 1;\n transition: none;\n }\n\n .gleap-frame-loader svg {\n display: block;\n width: 100%;\n height: auto;\n }\n\n .gleap-frame-loader .gleap-bg-base {\n fill: ").concat(o,";\n }\n\n .gleap-frame-loader .gleap-bg-c1 {\n fill: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-c2 {\n fill: ").concat(f,";\n }\n\n .gleap-frame-loader .gleap-bg-c3 {\n fill: ").concat(g,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-1 {\n stop-color: ").concat(f,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-2 {\n stop-color: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-fade {\n stop-color: ").concat(o,";\n }\n\n @keyframes gleapBgGrowShrink2 {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.35);\n }\n }\n\n @keyframes gleapBgGrowShrink3 {\n 0%, 100% {\n transform: scale(1) rotate(0deg);\n }\n 50% {\n transform: scale(1.3) rotate(20deg);\n }\n }\n\n .gleap-frame-loader--animate .gleap-bg-c2 {\n animation: gleapBgGrowShrink2 7s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader--animate .gleap-bg-c3 {\n animation: gleapBgGrowShrink3 6s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader-blur {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n -webkit-backdrop-filter: blur(30px);\n backdrop-filter: blur(30px);\n }\n\n .gleap-frame-loader--image {\n background-color: #ffffff;\n }\n\n .gleap-frame-loader-image-wrap {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0;\n transition: opacity 0.25s ease-in;\n }\n\n .gleap-frame-loader--dockedbar .gleap-frame-loader-image-wrap {\n bottom: 80px;\n }\n\n /* v4 header block: top-anchored, height driven by the strut child + the\n header's 150px padding-bottom \u2014 mirrors .agent-home-v4-header so the\n brand surface is exactly as tall as the app's, at any width/wrap. */\n .gleap-frame-loader-header {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n padding-bottom: 150px;\n overflow: hidden;\n }\n\n .gleap-frame-loader-header--colour {\n background: linear-gradient(\n 180deg,\n ").concat(t," 0%,\n ").concat(f,' 100%\n );\n }\n\n /* Strut: invisible height driver replicating the header\'s content box. */\n .gleap-frame-loader-strut {\n position: relative;\n z-index: 1;\n visibility: hidden;\n /* Match the messenger\'s font stack EXACTLY (and reset any inherited host\n font metrics), so the title wraps to the same number of lines the app\n will \u2014 the whole point of the strut is a 1:1 height, and a different\n host font would wrap differently and break it. */\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n font-style: normal;\n letter-spacing: normal;\n text-transform: none;\n box-sizing: border-box;\n }\n\n .gleap-frame-loader-strut-bar {\n height: 96px;\n }\n\n .gleap-frame-loader-strut-greeting {\n padding: 54px 38px 0px;\n box-sizing: border-box;\n }\n\n .gleap-frame-loader-strut-kicker {\n font-size: 25px;\n line-height: 25px;\n font-weight: normal;\n margin: 0px 0px 4px;\n }\n\n .gleap-frame-loader-strut-title {\n font-size: 25px;\n line-height: 29.5px;\n font-weight: 600;\n margin: 0px;\n }\n\n .gleap-frame-loader-ramp {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n /* 1px overlap past the block\'s bottom edge so fractional-DPR rounding\n can\'t let the image/gradient shimmer through as a hairline \u2014 same\n trick as the Messenger-App\'s header overlay. */\n bottom: -1px;\n background: linear-gradient(\n 180deg,\n transparent calc(100% - 120px),\n ').concat(o,"38 calc(100% - 101px),\n ").concat(o,"73 calc(100% - 82px),\n ").concat(o,"A6 calc(100% - 65px),\n ").concat(o,"D6 calc(100% - 49px),\n ").concat(o," calc(100% - 35px)\n );\n }\n\n .gleap-frame-loader-ramp--image {\n /* Smootherstep whitening ramp \u2014 must stay stop-for-stop identical to the\n Messenger-App's image header overlay (AgentHomeV4.scss), or the fade\n visibly shifts during the loader\u2192app cross-fade. */\n background: linear-gradient(\n 180deg,\n rgba(0, 0, 0, 0.2) 0px,\n rgba(0, 0, 0, 0) 60px,\n transparent calc(100% - 90px),\n ").concat(o,"03 calc(100% - 83px),\n ").concat(o,"0F calc(100% - 76px),\n ").concat(o,"29 calc(100% - 69px),\n ").concat(o,"52 calc(100% - 62px),\n ").concat(o,"80 calc(100% - 55px),\n ").concat(o,"AD calc(100% - 48px),\n ").concat(o,"D6 calc(100% - 41px),\n ").concat(o,"F0 calc(100% - 34px),\n ").concat(o,"FC calc(100% - 27px),\n ").concat(o," calc(100% - 20px)\n );\n }\n\n .gleap-frame-loader-image-wrap--loaded {\n opacity: 1;\n }\n\n .gleap-frame-loader-image {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n /* Surveys 2.0 \u2014 card: a compact popover in the launcher's corner. */\n .gleap-frame-container--survey {\n bottom: ").concat(a,"px !important;\n bottom: calc(").concat(a,"px + env(safe-area-inset-bottom, 0px)) !important;\n max-width: 348px;\n border-radius: 24px;\n box-shadow: 0 14px 44px rgba(16, 24, 40, 0.18), 0 0 0 1px rgba(16, 24, 40, 0.06);\n animation: gleapSurveyCardIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both, gleapWidgetFade 0.18s ease-out both;\n transition: none;\n }\n\n /* The survey's corners (survey-theme from the messenger); rounded is the 24px above. */\n .gleap-frame-container--survey.gleap-frame-container--corners-sharp {\n border-radius: 10px;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-pill {\n border-radius: 32px;\n }\n\n /* Card and page surveys stay invisible until the messenger reports their height. */\n .gleap-frame-container--measuring {\n visibility: hidden !important;\n animation: none !important;\n pointer-events: none !important;\n }\n\n .gleap-frame-container--extended {\n max-width: 690px !important;\n }\n\n /* Expanded by the end user (expand/collapse button in the messenger header).\n Only on viewports with room for it (see widgetExpandMinWidth). The inner\n max-height must beat the inline 700px set by GleapFrameManager.setAppMode. */\n @media only screen and (min-width: ").concat(768,"px) {\n .gleap-frame-container--expanded {\n max-width: 690px !important;\n }\n\n .gleap-frame-container--expanded .gleap-frame-container-inner {\n max-height: none !important;\n }\n }\n\n /* Surveys 2.0 \u2014 full screen: the frame covers the viewport and the messenger draws the\n brand-tinted, Typeform-style background and the close button itself. */\n .gleap-frame-container--survey-full,\n [dir=rtl].gleap-frame-container--survey-full {\n position: fixed;\n top: 0 !important;\n left: 0 !important;\n bottom: 0 !important;\n right: 0 !important;\n width: 100% !important;\n max-width: none !important;\n height: 100vh;\n height: 100dvh !important;\n min-height: 0 !important;\n max-height: none !important;\n background-color: transparent;\n border-radius: 0 !important;\n box-shadow: none !important;\n transform: none;\n animation: gleapWidgetFade 0.28s ease-out both !important;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner {\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n border-radius: 0;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner:before {\n display: none;\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--closing {\n animation: gleapWidgetFadeOut 0.22s ease-in both !important;\n }\n\n /* Legacy surveys (the messenger fell back to the pre-2.0 flow): the old survey chrome. */\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy {\n max-width: 410px;\n border-radius: ").concat(1.5*x,"px;\n box-shadow: 0px 5px 40px 0px rgba(9, 14, 21, 0.16);\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy .gleap-frame-container-inner {\n width: calc(100% - 24px) !important;\n max-width: 640px !important;\n height: calc(100% - 40px) !important;\n border-radius: ").concat(x,"px;\n overflow: hidden;\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy .gleap-frame-container-inner:before {\n display: block;\n }\n\n /* Surveys 2.0 \u2014 page: an inline frame in the host's container, as tall as the survey. */\n .gleap-frame-container.gleap-frame-container--survey-page,\n [dir=rtl].gleap-frame-container.gleap-frame-container--survey-page {\n position: relative !important;\n top: auto !important;\n right: auto !important;\n bottom: auto !important;\n left: auto !important;\n width: 100% !important;\n max-width: none !important;\n height: auto !important;\n min-height: 0 !important;\n max-height: none !important;\n z-index: auto;\n box-shadow: none !important;\n border-radius: 0 !important;\n background-color: transparent;\n transform: none !important;\n animation: gleapWidgetFade 0.3s ease-out both !important;\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n width: 100% !important;\n height: 360px;\n max-height: none !important;\n }\n\n .gleap-frame-container--survey-page.gleap-frame-container--animate .gleap-frame-container-inner {\n transition: height 0.28s cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner:before,\n .gleap-frame-container--survey-page .gleap-frame-loader {\n display: none;\n }\n\n .gleap-frame-container--classic {\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--classic-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--modern-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n [dir=rtl].gleap-frame-container--modern-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container--animate {\n pointer-events: auto !important;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetOut 0.2s cubic-bezier(0.4, 0, 1, 1) both !important;\n pointer-events: none !important;\n }\n\n .gleap-frame-container--modern-left,\n .gleap-frame-container--classic-left {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container--modern-left,\n [dir=rtl].gleap-frame-container--classic-left {\n transform-origin: right bottom;\n }\n\n @keyframes gleapWidgetScale {\n from { transform: scale(0.9); }\n to { transform: scale(1); }\n }\n\n @keyframes gleapWidgetFade {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes gleapWidgetOut {\n from { opacity: 1; transform: scale(1); }\n to { opacity: 0; transform: scale(0.96); }\n }\n\n @keyframes gleapWidgetFadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n\n @keyframes gleapSurveyCardIn {\n from { transform: translateY(14px) scale(0.98); }\n to { transform: translateY(0) scale(1); }\n }\n\n @keyframes gleapWidgetSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n\n @keyframes gleapWidgetSlideDown {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(100%); }\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes gleapFadeInUpMobile {\n from {\n opacity: 0;\n transform: translate3d(0, 10%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .gleap-notification-container {\n position: fixed;\n bottom: ").concat(D,"px;\n right: ").concat(i,"px;\n z-index: ").concat(2147483630,";\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n width: 100%;\n max-width: min(340px, 80vw);\n }\n\n .gleap-notification-container--left {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container--left {\n left: initial !important;\n right: ").concat(i,"px !important;\n align-items: flex-start !important;\n }\n\n .gleap-notification-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n /* Every notification card shares one chrome: full container width, the same\n radius, the same soft shadow, and a lift on hover. */\n .gleap-notification-item,\n .gleap-notification-item-news,\n .gleap-notification-item-checklist {\n width: 100%;\n animation-duration: 0.45s;\n animation-fill-mode: both;\n animation-name: gleapNotificationIn;\n }\n\n .gleap-notification-item-container,\n .gleap-notification-item-news-container,\n .gleap-notification-item-checklist-container {\n width: 100%;\n box-sizing: border-box;\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n /* A drop shadow alone cannot separate a dark card from a dark page, so\n the card also carries a hairline in the direction the theme needs. */\n border: 1px solid ").concat(h?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.04)",";\n /* A barely-there contact shadow + a large, soft ambient throw. */\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 10px 30px rgba(0, 0, 0, 0.1);\n margin-bottom: 12px;\n cursor: pointer;\n transition: box-shadow 0.15s ease-out;\n }\n\n .gleap-notification-item-container:hover,\n .gleap-notification-item-news-container:hover,\n .gleap-notification-item-checklist-container:hover {\n box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.05), 0px 14px 38px rgba(0, 0, 0, 0.14);\n }\n\n @keyframes gleapNotificationIn {\n from {\n opacity: 0;\n transform: translate3d(0, 12px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n /* More than one notification collapses into a stack: the newest card in\n front, older ones peeking out behind its top edge like a deck. Hovering\n the stack (or tapping it on touch devices, which adds --expanded)\n spreads it back into the full list.\n\n Every stacked card is bottom-anchored and placed purely via translateY\n offsets that updateStackLayout() measures and writes as CSS vars, so\n collapsing and expanding is one smooth transform + height transition\n rather than a layout jump. */\n .gleap-notification-card {\n position: relative;\n }\n\n .gleap-notification-container--stack {\n height: var(--gleap-nstack-h-collapsed, auto);\n transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n .gleap-notification-container--stack:hover,\n .gleap-notification-container--stack.gleap-notification-container--expanded {\n height: var(--gleap-nstack-h-expanded, auto);\n }\n\n .gleap-notification-container--stack .gleap-notification-card {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n transform: translateY(var(--gleap-nstack-expand, 0px));\n transform-origin: top center;\n /* The negative inset keeps the box-shadow outside the clip region. */\n clip-path: inset(-40px);\n transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), clip-path 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-out;\n }\n\n /* The entrance animation's fill pins transform at translate3d(0,0,0),\n which would defeat the stack offsets \u2014 so only the front card animates\n in (its stack offsets are 0 anyway). */\n .gleap-notification-container--stack .gleap-notification-card:not(:last-child) {\n animation-name: none;\n }\n\n /* How far back a card scales at each peek depth when collapsed. */\n .gleap-notification-container--stack .gleap-notification-card:nth-last-child(2) {\n --gleap-nstack-scale: 0.955;\n }\n\n .gleap-notification-container--stack .gleap-notification-card:nth-last-child(n+3) {\n --gleap-nstack-scale: 0.91;\n }\n\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card {\n transform: translateY(var(--gleap-nstack-collapse, 0px)) scale(var(--gleap-nstack-scale, 1));\n /* Clips a taller card behind down to the front card's height (bottom\n inset measured by updateStackLayout), so e.g. a news cover can't hang\n out below the stack. */\n clip-path: inset(-40px -40px var(--gleap-nstack-clip, -40px) -40px);\n }\n\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card:not(:last-child) {\n pointer-events: none;\n }\n\n /* Anything deeper than two peeks hides entirely until the stack expands. */\n .gleap-notification-container--stack:not(:hover):not(.gleap-notification-container--expanded) .gleap-notification-card:nth-last-child(n+4) {\n opacity: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .gleap-notification-container--stack,\n .gleap-notification-container--stack .gleap-notification-card {\n transition: none;\n }\n }\n\n /* Floats over the stack's top-right corner instead of taking a row of its\n own above it, so the notifications read as one contained unit. */\n .gleap-notification-close {\n position: absolute;\n top: -9px;\n right: -9px;\n border-radius: 100%;\n width: 26px;\n height: 26px;\n background-color: ").concat(o,";\n box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.18);\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n visibility: hidden;\n pointer-events: none;\n z-index: 1;\n }\n\n [dir=rtl].gleap-notification-container .gleap-notification-close {\n left: -9px;\n right: initial;\n }\n\n .gleap-notification-container:hover .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n }\n\n .gleap-notification-close svg {\n width: 40%;\n height: 40%;\n object-fit: contain;\n fill: ").concat(p,";\n }\n\n .gleap-notification-item-checklist-container {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 16px;\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-notification-item-checklist-content-title {\n color: ").concat(p,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 10px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content-progress {\n width: 100%;\n height: 8px;\n border-radius: 8px;\n background-color: ").concat(v,";\n }\n\n .gleap-notification-item-checklist-content-progress-inner {\n height: 100%;\n border-radius: 8px;\n background-color: ").concat(e,";\n }\n\n .gleap-notification-item-checklist-content-next {\n color: ").concat(m,";\n font-size: 15px;\n font-weight: normal;\n line-height: 21px;\n margin-top: 10px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n }\n\n .gleap-notification-item-checklist-content-next svg {\n height: 18px;\n margin-right: 5px;\n width: auto;\n }\n\n .gleap-notification-item-checklist-content-next b {\n font-size: 15px;\n font-weight: normal;\n color: ").concat(p,";\n }\n\n .gleap-news-pagination {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-top: 10px;\n width: 100%;\n }\n\n .gleap-news-page-indicator {\n font-size: 12px;\n color: ").concat(m,";\n }\n\n .gleap-news-next-button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 5px 10px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;^\n }\n\n .gleap-notification-item-news-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n padding: 16px;\n }\n\n .gleap-notification-item-news-preview {\n color: ").concat(m,";\n font-size: 14px;\n line-height: 21px;\n font-weight: 400;\n overflow-wrap: break-word;\n word-break: break-word;\n display: block;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-sender {\n display: flex;\n align-items: center;\n color: ").concat(m,";\n font-size: 14px;\n line-height: 21px;\n font-weight: 400;\n }\n\n .gleap-notification-item-news-content-title {\n color: ").concat(p,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 6px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n cursor: pointer;\n }\n\n .gleap-notification-item-news-sender-avatar {\n border-radius: 100%;\n height: 20px;\n width: 20px;\n min-width: 20px;\n margin-right: 8px;\n object-fit: cover;\n }\n\n [dir=rtl] .gleap-notification-item-news-sender-avatar {\n margin-left: 8px;\n margin-right: 0px !important;\n }\n\n .gleap-notification-item-news-container {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-image {\n background-color: ").concat(m,";\n height: 170px;\n max-height: 170px;\n object-fit: cover;\n width: 100%;\n cursor: pointer;\n }\n \n .gleap-notification-item-news-content-title:hover {\n color: ").concat(e,";\n }\n\n .gleap-notification-item-container {\n display: flex;\n align-items: flex-start;\n padding: 16px;\n font-size: 15px;\n line-height: 21px;\n color: ").concat(p,";\n }\n\n .gleap-notification-item-avatar {\n width: 32px;\n height: 32px;\n min-width: 32px;\n border-radius: 100%;\n object-fit: cover;\n display: block;\n margin-right: 10px;\n }\n\n /* The AI is a product, not a person \u2014 a rounded square reads as a logo and\n keeps it distinct from the circular teammate avatars. Same split the\n messenger makes in ChatMessageAuthor. */\n .gleap-notification-item-avatar--bot {\n border-radius: ").concat(E,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(I,"px;\n }\n\n [dir=rtl] .gleap-notification-item-avatar {\n margin-left: 10px;\n margin-right: 0px !important;\n }\n\n /* min-width: 0 so a long unbroken word shrinks the body instead of pushing\n the card past the container. */\n .gleap-notification-item-body {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n }\n\n .gleap-notification-item-content {\n line-height: 20px;\n color: ").concat(p,";\n word-wrap: break-word;\n word-break: break-word;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-meta {\n display: flex;\n align-items: center;\n margin-top: 5px;\n font-size: 13px;\n line-height: 18px;\n color: ").concat(m,";\n overflow: hidden;\n }\n\n .gleap-notification-item-sender {\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .gleap-notification-item-meta-dot {\n margin: 0px 5px;\n opacity: 0.6;\n }\n\n .gleap-notification-item-time {\n white-space: nowrap;\n }\n\n .gleap-frame-container-inner {\n position: relative;\n width: 100%;\n height: calc(100vh - ").concat(84+a,"px);\n max-height: ").concat(700,"px;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: calc(100vh - ").concat(a+24,"px);\n height: calc(100dvh - ").concat(a+24,"px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));\n }\n\n /* Behind the survey card the frame shows the survey's surface, not the widget background. */\n .gleap-frame-container--survey .gleap-frame-container-inner:before {\n background-color: var(--gleap-survey-surface, ").concat(o,");\n }\n\n /* The page frame takes the survey's color-scheme (the messenger sets the same on its document),\n so the browser keeps the iframe transparent on the host's backdrop, whatever the host's scheme. */\n .gleap-frame-container--survey-page {\n color-scheme: light;\n }\n\n .gleap-frame-container--survey-page.gleap-frame-container--survey-dark {\n color-scheme: dark;\n }\n\n /* Smooth resizes between questions (not on the first measure, which happens before --animate). */\n .gleap-frame-container--survey.gleap-frame-container--animate .gleap-frame-container-inner {\n transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1);\n }\n \n .gleap-frame-container-inner:before {\n content: \" \";\n position: absolute;\n width: 100%;\n height: calc(100% - ").concat(x,"px);\n top: ").concat(x,"px;\n background-color: ").concat(o,";\n z-index: -1;\n }\n \n .gleap-frame-container iframe {\n height: 100% !important;\n width: 100% !important;\n max-width: 100% !important;\n display: block !important;\n pointer-events: auto !important;\n }\n \n .gleap-frame-container--hidden {\n display: none !important;\n pointer-events: none;\n animation: none !important;\n }\n\n /* Capture requests: hidden while the customer captures the page (the iframe stays alive), and\n the whole viewport while the Messenger's capture editor is open. */\n .gleap-frame-container--capture-hidden {\n visibility: hidden !important;\n pointer-events: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor {\n top: 0 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n width: 100vw !important;\n max-width: 100vw !important;\n height: 100vh !important;\n height: 100dvh !important;\n min-height: 0 !important;\n max-height: none !important;\n border-radius: 0 !important;\n transform: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor .gleap-frame-container-inner {\n width: 100% !important;\n height: 100% !important;\n max-height: none !important;\n }\n \n .bb-feedback-button {\n margin: 0px;\n position: fixed;\n bottom: ").concat(a,"px;\n right: ").concat(i,"px;\n border-radius: 30px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: transparent;\n color: #000000;\n z-index: ").concat(2147483630,";\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 0px;\n }\n\n @keyframes bbRedDotPulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 1;\n }\n }\n\n .bb-feedback-button--red-dot {\n position: absolute;\n top: 0px;\n right: 0px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #ff3b30;\n box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n z-index: ").concat(2147483631,";\n animation: bbRedDotPulse 2s ease-in-out infinite;\n }\n\n [dir=rtl].bb-feedback-button {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n \n .bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n\n [dir=rtl].bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: ").concat(i,"px;\n left: auto;\n }\n \n .bb-feedback-button:focus {\n outline: none;\n }\n\n .bb-feedback-button:focus-visible .bb-feedback-button-icon,\n .bb-feedback-button:focus-visible .bb-feedback-button-classic {\n outline: 2px solid ").concat(n,';\n outline-offset: 3px;\n }\n\n .bb-feedback-button--disabled {\n display: none !important;\n }\n\n .bb-feedback-button--hidden {\n display: none !important;\n }\n\n /* A survey takes the launcher\'s corner: the launcher steps aside while it is open (a pill or\n sharp card would otherwise show the launcher peeking out behind its corner). */\n .bb-feedback-button--open.bb-feedback-button--survey {\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n transition: opacity 0.15s ease, visibility 0s linear 0.15s;\n }\n \n .bb-feedback-button-text {\n padding: 8px 12px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n background-color: #fff;\n border-radius: 8px;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.15);\n position: relative;\n z-index: 99;\n }\n \n .bb-feedback-button-text:before {\n content: "";\n position: absolute;\n box-shadow: rgba(0, 0, 0, 0.04) 6px 6px 5px;\n transform: rotate(315deg);\n bottom: 16px;\n right: -4px;\n border-width: 10px;\n border-style: solid;\n border-color: transparent #fff #fff transparent;\n }\n \n .bb-feedback-button--bottomleft .bb-feedback-button-text:before {\n display: none;\n }\n \n .bb-feedback-button-text:after {\n content: "";\n position: absolute;\n bottom: 12px;\n right: 0px;\n background-color: #fff;\n width: 5px;\n height: 30px;\n }\n \n .bb-feedback-button-text-title {\n font-family: sans-serif;\n font-size: 14px;\n color: #666;\n line-height: 18px;\n max-width: 220px;\n }\n \n .bb-feedback-button-text-title b {\n color: #000000;\n font-weight: 600;\n }\n\n .bb-notification-bubble {\n position: absolute;\n top: -5px;\n right: -5px;\n min-width: 12px;\n padding: 0px 4px;\n height: 20px;\n min-width: 20px;\n border-radius: 20px;\n background-color: red;\n color: #fff;\n font-size: 11px;\n font-family: sans-serif;\n text-align: center;\n line-height: 20px;\n }\n\n .bb-notification-bubble--hidden {\n display: none;\n }\n \n .bb-feedback-button-icon {\n width: 48px;\n height: 48px;\n border-radius: 48px;\n background-color: #485bff;\n transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n position: relative;\n }\n \n .bb-feedback-button-classic {\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n top: 50%;\n right: 0px;\n position: fixed;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n padding: 9px 20px;\n text-align: center;\n background-color: #485bff;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n font-family: sans-serif;\n font-size: 16px;\n color: #fff;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.25);\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n \n .bb-feedback-button-classic--left {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--left {\n top: 50%;\n right: 0px;\n left: auto;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n }\n \n .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n right: ').concat(i,"px;\n left: auto;\n }\n \n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n left: ").concat(i,"px;\n right: auto;\n }\n\n .bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n \n .bb-feedback-button--open.bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeOutRight;\n }\n \n .bb-feedback-button .bb-logo-logo {\n position: absolute;\n width: 30px;\n height: 30px;\n top: 9px;\n left: 9px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n position: absolute;\n width: 14px;\n height: 14px;\n top: 17px;\n left: 17px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button--open .bb-logo-arrowdown {\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button--open .bb-logo-logo {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button-icon:hover {\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), 0px 0px 20px rgba(0, 0, 0, 0.2);\n transform: scale(1.1);\n }\n\n /* The overshoot curve lives in its own class (added only for the release)\n so plain hover in/out keeps its regular ease and never bounces. */\n .bb-feedback-button--springing .bb-feedback-button-icon {\n transition: transform 0.55s cubic-bezier(0.2, 2, 0.45, 1), box-shadow 0.2s ease-in-out;\n }\n\n .bb-feedback-button--pressed .bb-feedback-button-icon {\n transform: scale(0.875);\n transition: transform 0.11s cubic-bezier(0.2, 0, 0.4, 1), box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), 0px 0px 12px rgba(0, 0, 0, 0.1);\n }\n \n .bb-feedback-button--open .bb-feedback-button-text {\n animation-name: bbFadeOutDown;\n }\n \n .bb-feedback-button--open .bb-feedback-button-icon {\n display: flex;\n }\n \n .bb-capture-svg {\n position: fixed;\n z-index: ").concat(2147483614,";\n top: 0px;\n left: 0px;\n right: 0px;\n width: 100%;\n height: 100%;\n padding: 0px;\n margin: 0px;\n cursor: crosshair;\n }\n\n .bb-capture-svg--preview {\n cursor: auto !important;\n }\n \n .bb-rec-on-circle {\n animation-name: bbRecIconFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-rec-on-cont {\n animation-name: bbRecIconContFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-capture-editor-drag-info {\n position: fixed;\n top: -200px;\n left: 0px;\n z-index: ").concat(2147483616,";\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-editor-drag-info svg {\n width: 24px;\n height: 24px;\n }\n \n .bb-capture-editor-borderlayer {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n border: 4px solid ").concat(e,";\n cursor: crosshair;\n z-index: ").concat(2147483610,";\n box-sizing: border-box;\n pointer-events: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-borderlayer {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n .bb-capture-editor-recording .bb-capture-editor-borderlayer {\n border: 4px solid #eb144c !important;\n }\n \n .bb-capture-editor-recording .bb-capture-dismiss {\n display: none;\n }\n\n .bb-capture-editor--capturing .bb-capture-toolbar,\n .bb-capture-editor--capturing .bb-capture-toolbar-item-colorpicker,\n .bb-capture-editor--capturing .bb-capture-dismiss,\n .bb-capture-editor--capturing .bb-capture-editor-drag-info,\n .bb-capture-editor--capturing .bb-capture-editor-borderlayer {\n display: none !important;\n }\n \n .bb-capture-editor-item-inactive {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-toolbar-drawingitem {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-svg {\n pointer-events: none !important;\n }\n \n .bb-capture-toolbar {\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,";\n background-color: #fff;\n padding: 5px;\n display: flex;\n align-items: center;\n border-radius: 8px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-dismiss {\n position: fixed;\n top: 0px;\n right: 0px;\n z-index: ").concat(2147483618,";\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n width: 36px;\n height: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: ").concat(e,";\n border-bottom-left-radius: ").concat(C,"px;\n }\n\n [dir=rtl] .bb-capture-dismiss {\n top: 0px;\n left: 0px;\n right: auto;\n border-bottom-left-radius: 0px !important;\n border-bottom-right-radius: ").concat(C,"px;\n }\n \n .bb-capture-dismiss svg path {\n fill: ").concat(u,';\n }\n \n .bb-capture-dismiss svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n \n .bb-capture-button-next {\n font-family: sans-serif;\n box-sizing: border-box;\n font-weight: 600;\n text-align: center;\n width: auto;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n margin: 0px;\n line-height: 36px;\n padding: 0px 12px;\n font-size: 15px;\n margin-left: 12px;\n }\n\n [dir=rtl].bb-capture-editor .bb-capture-button-next {\n margin-left: auto;\n margin-right: 12px;\n }\n \n .bb-capture-toolbar-item-spacer {\n width: 1px;\n height: 38px;\n min-width: 1px;\n margin: 0px 5px;\n }\n \n .bb-capture-toolbar-item {\n width: 42px;\n height: 38px;\n min-width: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n position: relative;\n margin-right: 5px;\n }\n\n .drag-handle-item {\n cursor: grab !important;\n width: 34px;\n min-width: 34px;\n }\n\n .drag-handle-item svg {\n width: 18px !important;\n height: 18px !important;\n }\n \n .bb-capture-toolbar-item svg {\n width: 23px;\n height: 23px;\n object-fit: contain;\n }\n \n .bb-capture-toolbar-item-selectedcolor {\n border-radius: 100%;\n width: 20px;\n height: 20px;\n background-color: #db4035;\n }\n \n .bb-capture-toolbar-item[data-type="undo"] svg {\n width: 18px;\n height: 18px;\n }\n \n .bb-capture-toolbar-item[data-active="true"] {\n position: relative;\n }\n \n .bb-capture-preview {\n display: none;\n background-color: rgba(0, 0, 0, 0.6);\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n justify-content: center;\n align-items: center;\n z-index: ').concat(2147483620,";\n }\n \n .bb-capture-preview-inner {\n background-color: #fff;\n padding: 0px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n flex-direction: column;\n max-width: 640px;\n width: 100%;\n margin: 20px;\n }\n \n .bb-capture-preview-inner video {\n border-radius: 8px 8px 0px 0px;\n display: block;\n border: 0px;\n outline: none;\n width: 100%;\n max-height: 60vh;\n }\n \n .bb-capture-preview-buttons {\n display: flex;\n justify-content: space-between;\n padding: 14px;\n }\n \n .bb-capture-preview-retrybutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-sendbutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-retrybutton:hover,\n .bb-capture-preview-sendbutton:hover {\n opacity: 0.9;\n }\n \n .bb-capture-toolbar-item-recording {\n margin-right: 0px;\n }\n \n .bb-capture-toolbar-item-recording svg {\n width: 33px;\n height: 33px;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n position: fixed;\n top: 70px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,';\n background-color: #fff;\n display: none;\n padding: 10px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n }\n \n .bb-capture-toolbar-item-color {\n width: 20px;\n height: 20px;\n border-radius: 100%;\n margin-right: 12px;\n box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-toolbar-item-color:hover {\n box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.25);\n }\n \n .bb-capture-toolbar-item-color:last-of-type {\n margin-right: 0px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color {\n margin-right: auto;\n margin-left: 12px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color:last-of-type {\n margin-right: auto;\n margin-left: 0px;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:first-of-type {\n display: none;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:nth-of-type(2) {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:first-of-type {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:nth-of-type(2) {\n display: none;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #eee;\n }\n \n .bb-capture-toolbar-item:hover svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #f8f8f8;\n }\n \n .bb-capture-toolbar-item--active svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--inactivecross::before {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 3px;\n width: 26px;\n margin: auto;\n border-radius: 4px;\n background-color: #e80000;\n transform: rotate(45deg);\n }\n \n .bb-capture-toolbar-item--inactivecross svg {\n fill: #eee;\n }\n \n .bb-capture-toolbar-item-timer {\n text-align: left;\n line-height: 32px;\n font-size: 14px;\n font-family: sans-serif;\n margin: 5px;\n min-width: 40px;\n display: none;\n }\n \n .bb-capture-toolbar-item .bb-tooltip {\n background-color: #555;\n color: #fff;\n visibility: hidden;\n font-size: 14px;\n font-family: sans-serif;\n text-align: center;\n padding: 5px 10px;\n position: absolute;\n z-index: 1;\n top: 45px;\n left: 0px;\n transform: translateX(calc(-50% + 21px));\n opacity: 0;\n transition: opacity 0.3s;\n white-space: nowrap;\n }\n \n .bb-capture-toolbar-item .bb-tooltip::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 50%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n transform: rotate(180deg);\n border-color: #555 transparent transparent transparent;\n }\n \n .bb-capture-toolbar-item:hover .bb-tooltip {\n visibility: visible;\n opacity: 1;\n }\n \n .bb-capture-options {\n display: none;\n }\n \n .bb-capture-options--active {\n display: flex;\n }\n\n @keyframes bbFadeOutRight {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbFadeOutDown {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n }\n \n @keyframes bbFadeInOpacity {\n from {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n @keyframes bbZoomOut {\n from {\n opacity: 1;\n }\n \n 50% {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbZoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n 50% {\n opacity: 1;\n }\n }\n \n @keyframes bbRecIconContFade {\n 0% {\n fill: #b10802;\n }\n 50% {\n fill: #ff0000;\n }\n 100% {\n fill: #b10802;\n }\n } \n .bb-capture-preview-retrybutton {\n color: ').concat(p,";\n border-radius: ").concat(k,"px;\n background-color: ").concat(v,";\n }\n .bb-capture-preview-retrybutton:hover {\n background-color: ").concat(y,";\n }\n @keyframes bb-suc-fill {\n 100% {\n box-shadow: inset 0px 0px 0px 30px ").concat(e,";\n }\n }\n .bb-capture-toolbar-item-spacer {\n background-color: ").concat(v,";\n }\n .bb-tooltip {\n border-radius: ").concat(S,"px;\n }\n @keyframes bbRecIconFade {\n 0% {\n fill: transparent;\n }\n 50% {\n fill: ").concat(y,";\n }\n 100% {\n fill: transparent;\n }\n }\n .bb-capture-preview-sendbutton {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(k,"px;\n }\n .bb-capture-button-next {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(C,"px;\n }\n .bb-capture-preview-inner {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-timer {\n color: ").concat(m,";\n }\n .bb-svg-path {\n fill: ").concat(p,";\n }\n .bb-capture-toolbar-item {\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-colorpicker {\n background-color: ").concat(o,";\n }\n .bb-capture-toolbar-item--active {\n background-color: ").concat(v,";\n }\n .bb-feedback-button-classic {\n border-top-left-radius: ").concat(S,"px;\n border-top-right-radius: ").concat(S,"px;\n }\n .bb-logo-logo--default path {\n fill: ").concat(d,";\n }\n .bb-logo-arrowdown {\n fill: ").concat(d,";\n }\n .bb-feedback-button-icon {\n background-color: ").concat(n,";\n }\n .bb-feedback-button-classic {\n background-color: ").concat(n,";\n color: ").concat(d,";\n }\n\n @media only screen and (max-width: 450px) {\n [dir=rtl].gleap-frame-container,\n .gleap-frame-container {\n left: 0px;\n right: 0px;\n width: 100vw;\n max-width: 100vw;\n min-height: 100vh;\n max-height: 100vh;\n min-height: 100dvh !important;\n max-height: 100dvh !important;\n top: 0px;\n bottom: 0px;\n border-radius: 0px;\n transform-origin: center bottom;\n animation: gleapWidgetSlideUp 0.34s cubic-bezier(0.16, 1, 0.3, 1) both, gleapWidgetFade 0.15s ease-out both;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetSlideDown 0.26s cubic-bezier(0.4, 0, 1, 1) both !important;\n }\n\n .gleap-frame-container-inner {\n width: 100vw;\n height: 100%;\n }\n\n .gleap-frame-container:not(.gleap-frame-container--survey):not(.gleap-frame-container--survey-full):not(.gleap-frame-container--survey-page) .gleap-frame-container-inner {\n max-height: calc(var(--glvh, 1vh) * 100) !important;\n }\n\n /* Card surveys become a floating sheet (iOS 26 style): inset from the edges and above the\n home indicator, rounded on all corners, layered shadow, dimmed page behind. */\n .gleap-frame-container--survey,\n [dir=rtl].gleap-frame-container--survey {\n top: auto !important;\n bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;\n left: 8px !important;\n right: 8px !important;\n width: auto !important;\n max-width: none !important;\n height: auto !important;\n min-height: 0 !important;\n max-height: calc(100vh - 24px) !important;\n max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;\n box-sizing: border-box;\n padding-top: 15px;\n padding-bottom: 0;\n /* The survey's surface (survey-theme), so a dark survey has no light handle strip. */\n background-color: var(--gleap-survey-surface, ").concat(o,');\n border-radius: 32px 32px 40px 40px !important;\n overflow: hidden;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 100vmax rgba(10, 12, 16, 0.25);\n transform-origin: center bottom;\n transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n animation: gleapWidgetSlideUp 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) both, gleapWidgetFade 0.2s ease-out both;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-sharp {\n border-radius: 14px !important;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-pill {\n border-radius: 40px 40px 46px 46px !important;\n }\n\n .gleap-frame-container--survey:after {\n content: "";\n position: absolute;\n top: 8px;\n left: 50%;\n width: 36px;\n height: 5px;\n margin-left: -18px;\n border-radius: 5px;\n background-color: ').concat(h?"rgba(255, 255, 255, 0.28)":"rgba(16, 24, 40, 0.16)",";\n pointer-events: none;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-dark:after {\n background-color: rgba(255, 255, 255, 0.28);\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-light:after {\n background-color: rgba(16, 24, 40, 0.16);\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n width: 100% !important;\n height: calc(100vh - 39px) !important;\n height: calc(100dvh - 39px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n width: 100% !important;\n }\n\n /* Legacy card surveys: the old full-width panel at the bottom (no sheet chrome). */\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy,\n [dir=rtl].gleap-frame-container--survey.gleap-frame-container--survey-legacy {\n padding: 0;\n border-radius: 28px !important;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy:after {\n display: none;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy .gleap-frame-container-inner {\n height: calc(100vh - 12px) !important;\n height: calc(100dvh - 12px - env(safe-area-inset-top, 0px)) !important;\n }\n\n .bb-tooltip {\n display: none !important;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n top: 75px;\n }\n \n .bb-capture-button-next {\n margin-left: auto;\n }\n \n .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-toolbar {\n top: 15px;\n right: 15px;\n left: 15px;\n width: auto;\n transform: none;\n }\n\n .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-borderlayer {\n border-width: 4px;\n }\n }\n \n @media print {\n .bb-feedback-button {\n display: none !important;\n }\n \n .gleap-frame-container {\n display: none !important;\n }\n }\n\n .gleap-tour-sender {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n margin-bottom: 10px;\n }\n\n .gleap-tour-sender-image {\n width: 32px;\n height: 32px;\n border-radius: 32px;\n margin-right: 10px;\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n }\n\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: 550px;\n max-width: 550px;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: calc(100vw - 40px);\n max-width: calc(100vw - 40px);\n }\n }\n\n .gleap-tour-message,\n .gleap-tour-message p,\n .gleap-tour-message ul {\n color: ").concat(p,";\n }\n\n .gleap-tour-message h2 {\n font-weight: 600;\n font-size: 22px;\n }\n\n .gleap-tour-message h3 {\n font-weight: 600;\n font-size: 18px;\n }\n\n .gleap-tour-message p {\n line-height: 1.3;\n margin-bottom: 10px !important;\n margin-top: 10px !important;\n }\n\n .gleap-tour-message ul {\n line-height: 1.3;\n padding-left: 20px;\n margin-top: 10px !important;\n margin-bottom: 10px !important;\n }\n\n .gleap-tour-message {\n max-height: calc(80vh - 100px) !important;\n overflow-y: auto;\n min-width: 270px;\n }\n\n .gleap-tour-message::-webkit-scrollbar {\n width: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-track {\n border-radius: 0px;\n }\n \n .gleap-tour-message::-webkit-scrollbar-thumb {\n background: ").concat(y,"; \n border-radius: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-thumb:hover {\n background: ").concat(m,";\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-message {\n min-width: auto !important;\n }\n }\n\n .gleap-tour-message iframe {\n width: 100%;\n height: 300px;\n margin-top: 10px;\n margin-bottom: 10px;\n border: none;\n outline: none;\n display: block;\n }\n\n .gleap-tour-sender-name {\n font-size: 15px;\n }\n\n .gleap-tour-video {\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-tour-video-svg--fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0px !important;\n left: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n }\n\n .gleap-tour-video--playing .gleap-tour-video-playpause {\n opacity: 0;\n }\n \n .gleap-tour-video--playing:hover .gleap-tour-video-playpause {\n opacity: 1;\n }\n\n .gleap-tour-popover-video-pointer {\n padding: 0px !important;\n border-radius: 8px;\n position: relative;\n background-color: transparent !important;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer {\n position: absolute;\n top: 0px;\n left: 20px;\n right: 20px;\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer button {\n padding: 5px 12px;\n }\n\n .gleap-tour-popover-video-pointer.gleap-tour-popover-can-close .gleap-tour-popover-footer {\n right: 40px !important;\n }\n\n .gleap-tour-popover-video-pointer:hover .gleap-tour-popover-footer {\n opacity: 1;\n }\n\n .gleap-tour-popover-pointer.gleap-tour-popover-no-sender .gleap-tour-message {\n padding-right: 20px;\n }\n\n .gleap-tour-video video {\n width: 100%;\n max-width: 100%;\n height: auto;\n border: none;\n outline: none;\n display: block;\n border-radius: 8px;\n }\n\n .gleap-admin-collapse-ui {\n z-index: ").concat(2147483635,";\n cursor: pointer;\n position: fixed;\n bottom: 75px;\n right: 20px;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n background-color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;\n }\n\n .gleap-admin-collapse-ui svg {\n width: 20px;\n height: 14px;\n fill: #000 !important;\n }\n\n .gleap-admin-collapse-ui-active {\n bottom: 20px !important;\n }\n\n .gleap-admin-collapse-ui-active svg {\n transform: rotate(180deg);\n }\n\n .gleap-admin-frame-container-active {\n display: none !important;\n }\n\n .gleap-admin-frame-container {\n position: fixed;\n bottom: 0px;\n left: 0px;\n right: 0px;\n width: 100vw;\n z-index: ").concat(2147483640,";\n }\n\n .gleap-admin-frame {\n width: 100%;\n height: 100% !important;\n border: none;\n outline: none;\n display: block;\n }\n \n .gleap-tour-message .linktype-link {\n display: inline-block !important;\n background-color: transparent !important;\n color: ").concat(n," !important;\n }\n\n .gleap-tooltip .linktype-button,\n .gleap-tour-message .linktype-button {\n display: inline-block !important;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 10px 20px !important;\n text-decoration: none !important;\n background-color: ").concat(n," !important;\n color: ").concat(d," !important;\n }\n\n .gleap-tour-message img {\n width: 100%;\n max-width: 100%;\n min-height: 260px;\n height: auto;\n margin-top: 10px;\n margin-bottom: 10px;\n object-fit: cover;\n }\n\n .gleap-tour-active .gleap-tour-overlay {\n pointer-events: none;\n }\n \n .gleap-tour-active * {\n pointer-events: none;\n }\n \n .gleap-tour-active .gleap-tour-active-element,\n .gleap-tour-active .gleap-tour-active-element *,\n .gleap-tour-popover,\n .gleap-tour-popover * {\n pointer-events: auto;\n }\n \n @keyframes animate-fade-in {\n 0% {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n .gleap-tour-fade .gleap-tour-overlay {\n animation: animate-fade-in 200ms ease-in-out;\n }\n \n .gleap-tour-fade .gleap-tour-popover {\n animation: animate-fade-in 200ms;\n }\n\n .gleap-tour-video-playpause {\n position: absolute;\n bottom: 8px;\n left: 8px;\n width: 32px;\n height: 32px;\n padding: 4px;\n background-color: rgba(0,0,0,0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 8px;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-arrow {\n display: none !important;\n }\n\n .gleap-tour-video-playpause svg {\n width: 34px;\n height: auto;\n fill: #fff;\n }\n \n /* Popover styles */\n .gleap-tour-popover {\n all: unset;\n box-sizing: border-box;\n color: ").concat(w,";\n margin: 0;\n padding: 15px;\n border-radius: ").concat(S,"px;\n min-width: 250px;\n max-width: 300px;\n box-shadow: 0 1px 10px #0006;\n ").concat(h?"outline: 1px solid rgba(255, 255, 255, 0.1);":"","\n z-index: 1000000000;\n position: fixed;\n top: 0;\n right: 0;\n background-color: ").concat(b,';\n }\n \n .gleap-tour-popover * {\n font-family: "Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif;\n }\n \n .gleap-tour-popover-title {\n font: 19px / normal sans-serif;\n font-weight: 700;\n display: block;\n position: relative;\n line-height: 1.5;\n zoom: 1;\n margin: 0;\n }\n \n .gleap-tour-popover-close-btn {\n all: unset;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n font-size: 30px;\n font-weight: 500;\n line-height: 32px;\n color: ').concat(h?m:"#d2d2d2",";\n z-index: 1;\n text-align: center;\n transition: color;\n transition-duration: 200ms;\n }\n \n .gleap-tour-popover-close-btn:hover,\n .gleap-tour-popover-close-btn:focus {\n color: ").concat(w,';\n }\n \n .gleap-tour-popover-title[style*="block"] + .gleap-tour-popover-description {\n margin-top: 5px;\n }\n \n .gleap-tour-popover-description {\n margin-bottom: 0;\n font: 15px / normal sans-serif;\n line-height: 1.5;\n font-weight: 400;\n zoom: 1;\n }\n \n .gleap-tour-popover-footer {\n margin-top: 15px;\n text-align: right;\n zoom: 1;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .gleap-tour-popover-progress-text {\n font-size: 13px;\n font-weight: 400;\n color: ').concat(h?m:"#727272",";\n zoom: 1;\n }\n \n .gleap-tour-popover-footer button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 10px 20px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;\n }\n\n .gleap-tour-popover-prev-btn {\n color: ").concat(p," !important;\n background-color: ").concat(v," !important;\n margin-right: 3px;\n }\n\n .gleap-tour-popover-prev-btn:hover {\n background-color: ").concat(e,"22 !important;\n color: ").concat(e,' !important;\n }\n \n .gleap-tour-popover-footer .gleap-tour-popover-btn-disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n \n .gleap-tour-no-interaction, .gleap-tour-no-interaction * {\n pointer-events: none !important;\n }\n \n .gleap-tour-popover-navigation-btns {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n gap: 4px;\n }\n \n .gleap-tour-popover-arrow {\n content: "";\n position: absolute;\n border: 5px solid ').concat(b,";\n }\n \n .gleap-tour-popover-arrow-side-over {\n display: none;\n }\n \n /** Popover Arrow Sides **/\n .gleap-tour-popover-arrow-side-left {\n left: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-right {\n right: 100%;\n border-left-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-top {\n top: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-bottom {\n bottom: 100%;\n border-left-color: transparent;\n border-top-color: transparent;\n border-right-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-center {\n display: none;\n }\n \n /* Left/Start + Right/Start */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-start {\n top: 15px;\n }\n \n /* Top/Start + Bottom/Start */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-start {\n left: 15px;\n }\n \n /* End/Left + End/Right */\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-left,\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-right {\n bottom: 15px;\n }\n \n /* Top/End + Bottom/End */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-end,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-end {\n right: 15px;\n }\n \n /* Left/Center + Right/Center */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-center {\n top: 50%;\n margin-top: -5px;\n }\n \n /* Top/Center + Bottom/Center */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-center {\n left: 50%;\n margin-left: -5px;\n }\n \n /* No arrow */\n .gleap-tour-popover-arrow-none {\n display: none;\n } \n\n /* Modal styles */\n .gleap-modal-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Invisible until the card inside the frame reports its height. Before that the frame is an\n empty box, and a bootstrap that fails silently must not leave a blank white card behind. */\n .gleap-modal-wrapper--loading {\n visibility: hidden;\n }\n\n .gleap-modal-wrapper--loading .gleap-modal {\n animation-name: none;\n }\n\n .gleap-modal-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-modal {\n position: relative;\n width: 90%;\n max-width: 600px;\n max-height: 90vh;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-modal-frame {\n width: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-modal-open {\n overflow: hidden;\n }\n\n /* Agent Popup styles */\n .gleap-agent-popup-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-agent-popup-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-agent-popup {\n position: relative;\n width: 95%;\n max-width: 700px;\n height: 85vh;\n max-height: 800px;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-agent-popup-frame {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-agent-popup-open {\n overflow: hidden;\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 20px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .gleap-frame-container--survey,\n .gleap-frame-container--survey-page,\n .gleap-frame-container--survey-full {\n animation: gleapWidgetFade 0.15s ease-out both !important;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--closing,\n .gleap-frame-container--survey-full.gleap-frame-container--closing {\n animation: gleapWidgetFadeOut 0.15s ease-in both !important;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner,\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n transition: none !important;\n }\n }\n\n .gleap-admin-frame-container,\n .gleap-frame-container,\n .bb-feedback-button,\n .gleap-notification-container,\n .gleap-tooltip,\n .gleap-ai-ui-widget {\n pointer-events: auto !important;\n }\n "),T=document.querySelector(".gleap-styles");T&&T.remove();var L=document.createElement("style");W(L),L.innerHTML=A,L.className="gleap-styles",document.body.appendChild(L)}(e,t,n,o,r,i,a,s,l,c)}))}},{key:"sendSilentCrashReport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};return e.sendSilentCrashReportWithFormData({description:t},n,r)}},{key:"sendSilentCrashReportWithFormData",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};if(!this.silentCrashReportSent){this.silentCrashReportSent=!0,setTimeout((function(){t.silentCrashReportSent=!1}),1e4);var o=r?ee(r):{},i=Bm.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new av("CRASH",n,a,!0,o).sendFeedback().then((function(){})).catch((function(e){}))}}}},{key:"showSurvey",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"survey",r=Bm.getInstance();r.ready?r.onContactSettled((function(){var r=mb(n);e.startFeedbackFlowWithOptions(t,{hideBackButton:!0,format:r.appMode,survey:r},!0)})):r.setOnSessionReady((function(){e.showSurvey(t,n)}))}},{key:"startClassicForm",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlow",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlowWithOptions",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Bm.getInstance().onContactSettled((function(){e.startFeedbackFlowNow(t,n,r)}))}},{key:"startFeedbackFlowNow",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.autostartDrawing,i=n.hideBackButton,a=n.format,s=n.survey;if(Bm.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var l="start-feedbackflow";r&&(l="start-survey");var c=r?s||mb(a):null,u=c?c.appMode:"widget";wv.getInstance().setFrameHost(c&&"page"===c.format?c.container:null),wv.getInstance().setAppMode(u),wv.getInstance().surveyKeyboard=!(!c||"page"!==c.format||!c.keyboard);var d={flow:t,hideBackButton:i,format:c?u:a};if(c){d.surveyFormat=c.format,d.fields=c.fields,c.personalToken&&(d.personalToken=c.personalToken),d.resume=c.resume,c.outboundAction&&(d.outboundAction=c.outboundAction),c.resumeData&&(d.resumeData=c.resumeData);var p=wv.getInstance().getSafeAreaInsets();d.safeArea="card"===c.format?_b(_b({},p),{},{bottom:0}):p}wv.getInstance().sendMessage({name:l,data:d},!0),o?wv.getInstance().showDrawingScreen("screenshot"):wv.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"startConversation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.startBot("",t)}},{key:"startBot",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Bm.getInstance().onContactSettled((function(){wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),wv.getInstance().showWidget()}))}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Bm.getInstance().onContactSettled((function(){wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),wv.getInstance().showWidget()}))}},{key:"sendAgentMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||!t)return Promise.reject(new Error("agentId and message are required."));var r={messages:[{role:"user",content:t.trim()}]};return n.conversationId&&(r.conversationId=n.conversationId),n.additionalContext&&(r.additionalContext=n.additionalContext),new Promise((function(t,o){var i="",a=n.conversationId||null,s=null;x.getInstance().streamAgent(e,r,{onMeta:function(e){e.conversationId&&(a=e.conversationId),e.runId&&(s=e.runId)},onToken:function(e){i+=e.content||"",n.onToken&&n.onToken(e)},onDone:function(e){t({runId:s||(null==e?void 0:e.runId),status:(null==e?void 0:e.status)||"completed",response:i||(null==e?void 0:e.response)||"",conversationId:a})},onError:function(e){o(e)},onToolStart:function(){},onToolEnd:function(){}})}))}},{key:"clearAgentConversation",value:function(){x.getInstance().clearCache()}},{key:"createAgentChat",value:function(e){return new Ut(e)}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"startChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return!!e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"start-checklist",data:_b({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),wv.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),wv.getInstance().showWidget())}},{key:"getChecklistData",value:function(e,t){if(!e)return Promise.reject(new Error("outboundId is required"));var n=L.getInstance();return n.validateChecklist(e,t).then((function(e){return n.fetchChecklist(e)}))}},{key:"openNews",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];wv.getInstance().setAppMode("widget"),wv.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),wv.getInstance().showWidget()}},{key:"startProductTour",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this;Bm.getInstance().startProductTourConfig(t).then((function(o){var i;!n||null==o||!o.startURL||null!==(i=window)&&void 0!==i&&null!==(i=i.location)&&void 0!==i&&null!==(i=i.href)&&void 0!==i&&i.includes(null==o?void 0:o.baseURL)?r.startProductTourWithConfig(t,o,!0):window.location.href=e.buildTourStartUrl(o.startURL,t)})).catch((function(e){}))}},{key:"buildTourStartUrl",value:function(e,t){try{var n=new URL(e,window.location.href);return n.searchParams.set("gleap_tour",t),n.searchParams.set("gleap_tour_delay","1"),n.toString()}catch(s){var r=Pb(e.split("#"),2),o=r[0],i=r[1],a=o.includes("?")?"&":"?";return"".concat(o).concat(a,"gleap_tour=").concat(encodeURIComponent(t),"&gleap_tour_delay=1").concat(void 0!==i?"#".concat(i):"")}}},{key:"checkForUncompletedTour",value:function(){var e=Ry.getInstance().loadUncompletedTour();e&&Ry.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Ry.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{Pr.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{$v.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){Zv.getInstance().showNotification(e)}}],n&&jb(t.prototype,n),r&&jb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(Ub(qb,"invoked",!0),Ub(qb,"silentCrashReportSent",!1),Ub(qb,"instance",void 0),"undefined"!=typeof window){var zb=window.GleapActions;if(zb&&zb.length>0)for(var Wb=0;Wb {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/**\n * Shared SSE (Server-Sent Events) stream parser.\n *\n * Reads a fetch Response body as an SSE stream and dispatches\n * parsed events to callbacks. Used by both the JavaScript SDK\n * and the Gleap Frontend dashboard.\n *\n * @example\n * import { parseSSEStream, dispatchSSEEvent } from 'gleap/sse'; // or from './GleapSSEParser'\n *\n * const response = await fetch(url, { method: 'POST', ... });\n * await parseSSEStream(response, {\n * onMeta: (data) => { ... },\n * onToken: (data) => { ... },\n * onDone: (data) => { ... },\n * onError: (data) => { ... },\n * });\n */\n\n/**\n * Dispatch a single parsed SSE event to the appropriate callback.\n *\n * @param {string} event - Event type: 'meta', 'token', 'tool_start', 'tool_end', 'done', 'error'\n * @param {object} data - Parsed JSON data\n * @param {object} callbacks - { onMeta, onToken, onToolStart?, onToolEnd?, onDone, onError }\n */\nexport const dispatchSSEEvent = (event, data, callbacks) => {\n switch (event) {\n case 'meta': callbacks.onMeta?.(data); break;\n case 'token': callbacks.onToken?.(data); break;\n case 'tool_start': callbacks.onToolStart?.(data); break;\n case 'tool_end': callbacks.onToolEnd?.(data); break;\n case 'done': callbacks.onDone?.(data); break;\n case 'error': callbacks.onError?.(data); break;\n case 'handoff': callbacks.onHandoff?.(data); break;\n }\n};\n\n/**\n * Parse an SSE stream from a fetch Response and dispatch events to callbacks.\n *\n * @param {Response} response - A fetch Response with a readable body (text/event-stream).\n * @param {object} callbacks - { onMeta, onToken, onToolStart?, onToolEnd?, onDone, onError }\n * @returns {Promise}\n */\nexport const parseSSEStream = async (response, callbacks) => {\n if (!response.body) {\n callbacks.onError?.({ message: 'No response body.' });\n return;\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = '';\n let currentEvent = '';\n let currentData = '';\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split('\\n');\n buffer = lines.pop() ?? '';\n\n for (const line of lines) {\n const trimmed = line.replace(/\\r$/, '');\n\n if (trimmed.startsWith('event: ')) {\n currentEvent = trimmed.slice(7).trim();\n } else if (trimmed.startsWith('data: ')) {\n currentData += (currentData ? '\\n' : '') + trimmed.slice(6);\n } else if (trimmed === '') {\n if (currentEvent && currentData) {\n try {\n const parsed = JSON.parse(currentData);\n dispatchSSEEvent(currentEvent, parsed, callbacks);\n } catch { /* skip malformed event */ }\n }\n currentEvent = '';\n currentData = '';\n }\n }\n }\n\n // Flush any remaining buffered event\n if (currentEvent && currentData) {\n try {\n const parsed = JSON.parse(currentData);\n dispatchSSEEvent(currentEvent, parsed, callbacks);\n } catch { /* skip */ }\n }\n } catch (err) {\n if (err?.name !== 'AbortError') {\n callbacks.onError?.({ message: 'Stream interrupted.' });\n }\n }\n};\n","import { GleapSession, GleapTranslationManager } from './Gleap';\nimport { parseSSEStream } from './GleapSSEParser';\n\nconst RequestStatus = {\n PENDING: 'pending',\n SUCCESS: 'success',\n ERROR: 'error',\n};\n\nclass AgentNetworkManager {\n static instance = null;\n\n /** @private {Map} agentId -> true if currently executing */\n executeInFlight = new Map();\n\n /** @private {Map} */\n messagesCache = new Map();\n /** @private {Map} */\n messagesRequests = new Map();\n\n constructor() {\n if (AgentNetworkManager.instance) {\n return AgentNetworkManager.instance;\n }\n AgentNetworkManager.instance = this;\n }\n\n static getInstance() {\n if (!AgentNetworkManager.instance) {\n AgentNetworkManager.instance = new AgentNetworkManager();\n }\n return AgentNetworkManager.instance;\n }\n\n clearCache() {\n this.messagesCache.clear();\n this.messagesRequests.clear();\n this.executeInFlight.clear();\n }\n\n /** @private */\n _getApiUrl() {\n const s = GleapSession.getInstance();\n return s?.apiUrl || null;\n }\n\n /** @private — build auth headers for fetch */\n _getHeaders() {\n const s = GleapSession.getInstance();\n const headers = { 'Content-Type': 'application/json' };\n if (s?.sdkKey) headers['Api-Token'] = s.sdkKey;\n if (s?.session?.gleapId) headers['Gleap-Id'] = s.session.gleapId;\n if (s?.session?.gleapHash) headers['Gleap-Hash'] = s.session.gleapHash;\n s?.addGrantHeader?.(headers);\n return headers;\n }\n\n /** @private — XHR for non-streaming requests */\n _makeRequest(method, url, data) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n const s = GleapSession.getInstance();\n s?.injectSession(xhr);\n if (data) xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n try {\n resolve(xhr.responseText ? JSON.parse(xhr.responseText) : null);\n } catch (err) {\n reject({ status: xhr.status, statusText: 'JSON Parse Error', error: err });\n }\n } else {\n reject({ status: xhr.status, statusText: xhr.statusText, responseText: xhr.responseText });\n }\n }\n };\n xhr.onerror = () => reject({ status: 0, statusText: 'Network Error' });\n xhr.send(data ? JSON.stringify(data) : null);\n });\n }\n\n /**\n * Stream an agent execution via SSE.\n *\n * @param {string} agentId\n * @param {object} body - { messages, conversationId?, additionalContext? }\n * @param {object} callbacks - { onMeta, onToken, onDone, onError, onToolStart?, onToolEnd? }\n * @param {AbortSignal} [signal] - optional abort signal\n * @returns {Promise}\n */\n async streamAgent(agentId, body, callbacks, signal) {\n if (this.executeInFlight.get(agentId)) return;\n this.executeInFlight.set(agentId, true);\n\n const apiUrl = this._getApiUrl();\n if (!apiUrl) {\n this.executeInFlight.delete(agentId);\n callbacks.onError?.({ message: 'Gleap API URL not configured.' });\n return;\n }\n\n const url = `${apiUrl}/v3/shared/agents/${agentId}/stream`;\n const headers = { ...this._getHeaders(), Accept: 'text/event-stream' };\n\n let response;\n try {\n response = await fetch(url, {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n signal,\n });\n } catch (err) {\n this.executeInFlight.delete(agentId);\n if (err?.name === 'AbortError') return;\n callbacks.onError?.({ message: 'Failed to connect to agent.' });\n return;\n }\n\n if (!response.ok) {\n this.executeInFlight.delete(agentId);\n callbacks.onError?.({ message: `Server error: ${response.status}` });\n return;\n }\n\n // Use shared SSE parser\n await parseSSEStream(response, callbacks);\n\n // Invalidate caches\n if (body.conversationId) this._invalidateMessagesCache(body.conversationId);\n this.executeInFlight.delete(agentId);\n }\n\n /**\n * Non-streaming execute (fallback).\n */\n executeAgent(agentId, body) {\n if (this.executeInFlight.get(agentId)) {\n return Promise.reject(new Error('Agent execution already in progress.'));\n }\n\n const apiUrl = this._getApiUrl();\n if (!apiUrl) return Promise.reject(new Error('AgentNetworkManager: Gleap API URL not configured.'));\n\n this.executeInFlight.set(agentId, true);\n const url = `${apiUrl}/v3/shared/agents/${agentId}/execute`;\n return this._makeRequest('POST', url, body)\n .then((responseData) => {\n if (body.conversationId) this._invalidateMessagesCache(body.conversationId);\n if (responseData?.conversationId) this._invalidateMessagesCache(responseData.conversationId);\n return responseData;\n })\n .finally(() => { this.executeInFlight.delete(agentId); });\n }\n\n getConversationMessages(agentId, conversationId, limit = 50, skip = 0) {\n if (agentId === 'kai') return Promise.resolve({ messages: [] });\n\n const cacheKey = `${conversationId}:${limit}:${skip}`;\n const cached = this.messagesCache.get(cacheKey);\n if (cached) {\n return cached.status === RequestStatus.SUCCESS\n ? Promise.resolve(JSON.parse(JSON.stringify(cached.data)))\n : Promise.reject(cached.error);\n }\n if (this.messagesRequests.has(cacheKey)) {\n return this.messagesRequests.get(cacheKey).then((d) => JSON.parse(JSON.stringify(d)));\n }\n\n const apiUrl = this._getApiUrl();\n if (!apiUrl) return Promise.reject(new Error('AgentNetworkManager: Gleap API URL not configured.'));\n\n const url = `${apiUrl}/v3/shared/agents/${agentId}/conversations/${conversationId}/messages?limit=${limit}&skip=${skip}`;\n const p = this._makeRequest('GET', url, null)\n .then((d) => { this.messagesCache.set(cacheKey, { status: RequestStatus.SUCCESS, data: d }); return JSON.parse(JSON.stringify(d)); })\n .catch((e) => { this.messagesCache.set(cacheKey, { status: RequestStatus.ERROR, error: e }); throw e; })\n .finally(() => { this.messagesRequests.delete(cacheKey); });\n\n this.messagesRequests.set(cacheKey, p);\n return p.then((d) => JSON.parse(JSON.stringify(d)));\n }\n\n getConversations(agentId, limit = 10, skip = 0) {\n if (agentId === 'kai') return Promise.resolve({ conversations: [] });\n\n const apiUrl = this._getApiUrl();\n if (!apiUrl) return Promise.reject(new Error('AgentNetworkManager: Gleap API URL not configured.'));\n return this._makeRequest('GET', `${apiUrl}/v3/shared/agents/${agentId}/conversations?limit=${limit}&skip=${skip}`, null);\n }\n\n /** @private */\n _invalidateMessagesCache(conversationId) {\n for (const key of this.messagesCache.keys()) {\n if (key.startsWith(conversationId + ':')) this.messagesCache.delete(key);\n }\n for (const key of this.messagesRequests.keys()) {\n if (key.startsWith(conversationId + ':')) this.messagesRequests.delete(key);\n }\n }\n}\n\nexport default AgentNetworkManager;\n","import { GleapSession, GleapTranslationManager } from './Gleap'; // Adjust path if needed\n\n// Enum for request states\nconst RequestStatus = {\n PENDING: 'pending',\n SUCCESS: 'success',\n ERROR: 'error',\n};\n\nclass ChecklistNetworkManager {\n static instance = null;\n\n /** @private {Map>} outboundId -> Promise */\n validationRequests = new Map();\n /** @private {Map} */\n validationCache = new Map(); // Caches final results (success/error)\n\n /** @private {Map>} internalId -> Promise */\n fetchRequests = new Map();\n /** @private {Map} */\n fetchCache = new Map(); // Caches final results (success/error)\n\n // Private constructor for Singleton\n constructor() {\n if (ChecklistNetworkManager.instance) {\n return ChecklistNetworkManager.instance;\n }\n ChecklistNetworkManager.instance = this;\n }\n\n /**\n * Gets the singleton instance of the ChecklistNetworkManager.\n * @returns {ChecklistNetworkManager} The singleton instance.\n */\n static getInstance() {\n if (!ChecklistNetworkManager.instance) {\n ChecklistNetworkManager.instance = new ChecklistNetworkManager();\n }\n return ChecklistNetworkManager.instance;\n }\n\n clearCache() {\n this.validationCache.clear();\n this.fetchCache.clear();\n this.validationRequests.clear();\n this.fetchRequests.clear();\n }\n\n /**\n * @private\n * Gets common query parameters for API requests.\n * @returns {string} Query parameter string.\n */\n _getQueryParams() {\n const gleapSessionInstance = GleapSession.getInstance();\n const session = gleapSessionInstance?.session;\n const lang = GleapTranslationManager.getInstance().getActiveLanguage() || 'en';\n return `gleapId=${session?.gleapId || ''}&gleapHash=${session?.gleapHash || ''}&lang=${lang}`;\n }\n\n /**\n * @private\n * Gets the API base URL.\n * @returns {string | null} The API URL or null if not configured.\n */\n _getApiUrl() {\n const gleapSessionInstance = GleapSession.getInstance();\n return gleapSessionInstance?.apiUrl || null;\n }\n\n /**\n * @private\n * Makes an XMLHttpRequest and returns a Promise.\n * @param {string} method - HTTP method.\n * @param {string} url - The request URL.\n * @param {object|null} data - Data to send in the request body.\n * @returns {Promise} Promise resolving with parsed JSON response on success, rejecting on error.\n */\n _makeRequest(method, url, data) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n\n const gleapSessionInstance = GleapSession.getInstance();\n gleapSessionInstance?.injectSession(xhr); // Inject session headers\n\n if (data) {\n xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n }\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n try {\n // Handle potential empty success responses (e.g., 204)\n const responseData = xhr.responseText ? JSON.parse(xhr.responseText) : null;\n resolve(responseData);\n } catch (err) {\n reject({\n status: xhr.status,\n statusText: 'JSON Parse Error',\n responseText: xhr.responseText,\n error: err,\n });\n }\n } else {\n reject({\n status: xhr.status,\n statusText: xhr.statusText,\n responseText: xhr.responseText,\n });\n }\n }\n };\n\n xhr.onerror = () => {\n reject({ status: 0, statusText: 'Network Error', responseText: null });\n };\n\n xhr.send(data ? JSON.stringify(data) : null);\n });\n }\n\n /**\n * @private\n * Creates a cache key from outboundId and sharedKey\n * @param {string} outboundId - The public/outbound checklist ID.\n * @param {string|undefined} sharedKey - Optional shared key.\n * @returns {string} Combined cache key.\n */\n _createCacheKey(outboundId, sharedKey) {\n return sharedKey ? `${outboundId}::${sharedKey}` : outboundId;\n }\n\n /**\n * Validates an outbound checklist ID, returning a Promise for the internal ID.\n * Manages caching and deduplicates requests.\n * @param {string} outboundId - The public/outbound checklist ID.\n * @param {string} [sharedKey] - Optional shared key for the checklist.\n * @returns {Promise} A promise that resolves with the internal checklist ID.\n */\n validateChecklist(outboundId, sharedKey) {\n const cacheKey = this._createCacheKey(outboundId, sharedKey);\n\n // 1. Check cache for final result (success or error)\n const cachedResult = this.validationCache.get(cacheKey);\n if (cachedResult) {\n if (cachedResult.status === RequestStatus.SUCCESS) {\n return Promise.resolve(cachedResult.internalId);\n } else {\n return Promise.reject(cachedResult.error);\n }\n }\n\n // 2. Check for an ongoing request\n if (this.validationRequests.has(cacheKey)) {\n return this.validationRequests.get(cacheKey);\n }\n\n // 3. Start a new request\n const apiUrl = this._getApiUrl();\n if (!apiUrl) {\n const error = new Error('ChecklistNetworkManager: Gleap API URL not configured.');\n this.validationCache.set(cacheKey, {\n status: RequestStatus.ERROR,\n error,\n });\n return Promise.reject(error);\n }\n\n const url = `${apiUrl}/outbound/checklists?${this._getQueryParams()}`;\n const requestPromise = this._makeRequest('POST', url, {\n outboundId,\n sharedKey,\n })\n .then((responseData) => {\n if (responseData && responseData.id) {\n this.validationCache.set(cacheKey, {\n status: RequestStatus.SUCCESS,\n internalId: responseData.id,\n });\n return responseData.id;\n } else {\n const error = new Error('Validation response missing checklist ID.');\n this.validationCache.set(cacheKey, {\n status: RequestStatus.ERROR,\n error: responseData || error,\n });\n throw error; // Rethrow to be caught by catch block\n }\n })\n .catch((error) => {\n // Store the error object itself in the cache\n this.validationCache.set(cacheKey, {\n status: RequestStatus.ERROR,\n error,\n });\n throw error; // Re-throw so callers can catch it\n })\n .finally(() => {\n // Remove from pending requests map once done (success or fail)\n this.validationRequests.delete(cacheKey);\n });\n\n // Store the promise for potential concurrent requests\n this.validationRequests.set(cacheKey, requestPromise);\n return requestPromise;\n }\n\n /**\n * Fetches the full checklist data using the internal ID, returning a Promise.\n * Manages caching and deduplicates requests.\n * @param {string} internalId - The internal checklist ID.\n * @returns {Promise} A promise that resolves with the full checklist data.\n */\n fetchChecklist(internalId) {\n // 1. Check cache for final result (success or error)\n const cachedResult = this.fetchCache.get(internalId);\n if (cachedResult) {\n if (cachedResult.status === RequestStatus.SUCCESS) {\n // Return a deep copy to prevent mutation issues if multiple components use it\n return Promise.resolve(JSON.parse(JSON.stringify(cachedResult.data)));\n } else {\n return Promise.reject(cachedResult.error);\n }\n }\n\n // 2. Check for an ongoing request\n if (this.fetchRequests.has(internalId)) {\n // Return a promise that resolves with a deep copy\n return this.fetchRequests.get(internalId).then((data) => JSON.parse(JSON.stringify(data)));\n }\n\n // 3. Start a new request\n const apiUrl = this._getApiUrl();\n if (!apiUrl) {\n const error = new Error('ChecklistNetworkManager: Gleap API URL not configured.');\n this.fetchCache.set(internalId, { status: RequestStatus.ERROR, error });\n return Promise.reject(error);\n }\n\n const url = `${apiUrl}/outbound/checklists/${internalId}?convertTipTap=true&${this._getQueryParams()}`;\n const requestPromise = this._makeRequest('GET', url, null)\n .then((responseData) => {\n if (responseData) {\n // Cache the successful data\n this.fetchCache.set(internalId, {\n status: RequestStatus.SUCCESS,\n data: responseData,\n });\n // Return a deep copy of the data\n return JSON.parse(JSON.stringify(responseData));\n } else {\n // Should not happen with successful GET usually, but handle defensively\n const error = new Error('Empty response received for checklist fetch.');\n this.fetchCache.set(internalId, {\n status: RequestStatus.ERROR,\n error: responseData || error,\n });\n throw error;\n }\n })\n .catch((error) => {\n this.fetchCache.set(internalId, { status: RequestStatus.ERROR, error });\n throw error; // Re-throw so callers can catch it\n })\n .finally(() => {\n // Remove from pending requests map once done (success or fail)\n this.fetchRequests.delete(internalId);\n });\n\n this.fetchRequests.set(internalId, requestPromise);\n // Return a promise that resolves with a deep copy\n return requestPromise.then((data) => JSON.parse(JSON.stringify(data)));\n }\n}\n\nexport default ChecklistNetworkManager;\n","import {\n GleapFrameManager,\n GleapConfigManager,\n GleapNotificationManager,\n GleapTranslationManager,\n GleapAiChatbarManager,\n GleapSession,\n} from './Gleap';\nimport { loadIcon } from './UI';\n\nexport default class GleapFeedbackButtonManager {\n feedbackButton = null;\n injectedFeedbackButton = false;\n buttonHidden = null;\n lastButtonIcon = null;\n showingRedDot = false;\n removePressListeners = null;\n\n // Feedback button types\n static FEEDBACK_BUTTON_BOTTOM_RIGHT = 'BOTTOM_RIGHT';\n static FEEDBACK_BUTTON_BOTTOM_LEFT = 'BOTTOM_LEFT';\n static FEEDBACK_BUTTON_CLASSIC = 'BUTTON_CLASSIC';\n static FEEDBACK_BUTTON_CLASSIC_LEFT = 'BUTTON_CLASSIC_LEFT';\n static FEEDBACK_BUTTON_CLASSIC_BOTTOM = 'BUTTON_CLASSIC_BOTTOM';\n static FEEDBACK_BUTTON_NONE = 'BUTTON_NONE';\n\n // GleapFeedbackButtonManager singleton\n static instance;\n static getInstance() {\n if (!this.instance) {\n this.instance = new GleapFeedbackButtonManager();\n }\n return this.instance;\n }\n\n destroy() {\n if (this.removePressListeners) {\n this.removePressListeners();\n this.removePressListeners = null;\n }\n\n if (this.feedbackButton) {\n this.feedbackButton.remove();\n this.feedbackButton = null;\n }\n\n this.buttonHidden = null;\n this.lastButtonIcon = null;\n this.injectedFeedbackButton = false;\n this.instance = null;\n }\n\n /**\n * Toggles the feedback button visibility.\n * @param {*} show\n * @returns\n */\n toggleFeedbackButton(show) {\n this.buttonHidden = !show;\n\n GleapFeedbackButtonManager.getInstance().updateFeedbackButtonState();\n GleapNotificationManager.getInstance().updateContainerStyle();\n }\n\n updateRedDot(show) {\n var frameManager = GleapFrameManager.getInstance();\n if (!this.feedbackButton || this.buttonHidden || frameManager.isOpened()) {\n return;\n }\n\n const redDotClass = 'bb-feedback-button--red-dot';\n const existingDot = this.feedbackButton.querySelector(`.${redDotClass}`);\n\n if (show) {\n if (!existingDot) {\n const dot = document.createElement('div');\n dot.className = redDotClass;\n this.feedbackButton.appendChild(dot);\n }\n } else {\n if (existingDot) {\n existingDot.remove();\n }\n }\n }\n\n feedbackButtonPressed(fromKeyboard = false) {\n var frameManager = GleapFrameManager.getInstance();\n if (frameManager.isOpened()) {\n frameManager.hideWidget();\n this.updateRedDot(this.showingRedDot);\n } else {\n frameManager.setAppMode('widget');\n frameManager.showWidget();\n this.updateRedDot(false);\n // Opened from the keyboard: the keyboard moves into the messenger with it.\n if (fromKeyboard) {\n frameManager.focusFrame();\n }\n }\n }\n\n /**\n * The messenger closed while the keyboard was in it (Escape, its close button): the keyboard\n * comes back to the launcher instead of the top of the page.\n */\n restoreFocus() {\n if (!this.feedbackButton || !this.feedbackButton.isConnected) {\n return;\n }\n try {\n this.feedbackButton.focus({ preventScroll: true });\n } catch (e) {}\n }\n\n /**\n * Injects the feedback button into the current DOM.\n */\n injectFeedbackButton() {\n if (this.injectedFeedbackButton) {\n return;\n }\n this.injectedFeedbackButton = true;\n\n // A div (a