gleap 18.1.2 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Gleap=t():e.Gleap=t()}(this,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};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 o(){o=function(){return t};var e,t={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",l=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,o){var r=t&&t.prototype instanceof b?t:b,i=Object.create(r.prototype),s=new P(o||[]);return a(i,"_invoke",{value:L(e,n,s)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};d(x,c,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(R([])));C&&C!==r&&i.call(C,c)&&(x=C);var I=k.prototype=b.prototype=Object.create(x);function T(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function o(r,a,s,c){var l=f(e[r],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==n(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,s,c)}),(function(e){o("throw",e,s,c)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return o("throw",e,s,c)}))}c(l.arg)}var r;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,r){o(e,n,t,r)}))}return r=r?r.then(i,i):i()}})}function L(t,n,o){var r=h;return function(i,a){if(r===m)throw new Error("Generator is already running");if(r===v){if("throw"===i)throw a;return{value:e,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=O(s,o);if(c){if(c===y)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===h)throw r=v,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=m;var l=f(t,n,o);if("normal"===l.type){if(r=o.done?v:g,l.arg===y)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(r=v,o.method="throw",o.arg=l.arg)}}}function O(t,n){var o=n.method,r=t.iterator[o];if(r===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),y;var i=f(r,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 M(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 A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function R(t){if(t||""===t){var o=t[c];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=k,a(I,"constructor",{value:k,configurable:!0}),a(k,"constructor",{value:w,configurable:!0}),w.displayName=d(k,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,d(e,u,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},T(E.prototype),d(E.prototype,l,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new E(p(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(I),d(I,u,"Generator"),d(I,c,(function(){return this})),d(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=R,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(o,r){return s.type="throw",s.arg=t,n.next=o,r&&(n.method="next",n.arg=e),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(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 o=n.completion;if("throw"===o.type){var r=o.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:R(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),y}},t}function r(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 o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(o,r)}e.d(t,{default:()=>lp});var c=function(e,t,n){var o,r,i,a,s,c,l;switch(e){case"meta":null===(o=n.onMeta)||void 0===o||o.call(n,t);break;case"token":null===(r=n.onToken)||void 0===r||r.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===(c=n.onError)||void 0===c||c.call(n,t);break;case"handoff":null===(l=n.onHandoff)||void 0===l||l.call(n,t)}},l=function(){var e,t=(e=o().mark((function e(t,n){var i,a,s,l,u,d,p,f,h,g,m,v,y,b,w,k,x,S;return o().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(),s=new TextDecoder,l="",u="",d="",e.prev=8;case 9:return e.next=12,a.read();case 12:if(f=e.sent,h=f.done,g=f.value,!h){e.next=17;break}return e.abrupt("break",24);case 17:l+=s.decode(g,{stream:!0}),m=l.split("\n"),l=null!==(p=m.pop())&&void 0!==p?p:"",v=r(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),c(u,k,n)}catch(o){}u="",d=""}}catch(C){v.e(C)}finally{v.f()}e.next=9;break;case 24:if(u&&d)try{x=JSON.parse(d),c(u,x,n)}catch(I){}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(o,r){var i=e.apply(t,n);function s(e){a(i,o,r,s,c,"next",e)}function c(e){a(i,o,r,s,c,"throw",e)}s(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function u(e){return u="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},u(e)}function d(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 p(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 p(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function f(){f=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function d(e,t,n,o){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new P(o||[]);return r(a,"_invoke",{value:L(e,n,s)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var h="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};l(x,a,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(R([])));C&&C!==n&&o.call(C,a)&&(x=C);var I=k.prototype=b.prototype=Object.create(x);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(r,i,a,s){var c=p(e[r],e,i);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==u(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,o){function r(){return new t((function(t,r){n(e,o,t,r)}))}return i=i?i.then(r,r):r()}})}function L(t,n,o){var r=h;return function(i,a){if(r===m)throw new Error("Generator is already running");if(r===v){if("throw"===i)throw a;return{value:e,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=O(s,o);if(c){if(c===y)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===h)throw r=v,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=m;var l=p(t,n,o);if("normal"===l.type){if(r=o.done?v:g,l.arg===y)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(r=v,o.method="throw",o.arg=l.arg)}}}function O(t,n){var o=n.method,r=t.iterator[o];if(r===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),y;var i=p(r,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 M(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 A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function R(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 r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(u(t)+" is not iterable")}return w.prototype=k,r(I,"constructor",{value:k,configurable:!0}),r(k,"constructor",{value:w,configurable:!0}),w.displayName=l(k,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,l(e,c,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},T(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new E(d(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(I),l(I,c,"Generator"),l(I,a,(function(){return this})),l(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=R,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(o,r){return s.type="throw",s.arg=t,n.next=o,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(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 o=n.completion;if("throw"===o.type){var r=o.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:R(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),y}},t}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(o,r)}function v(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,b(o.key),o)}}function y(e,t,n){return(t=b(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:String(t)}var w="success",k="error",x=function(){function e(){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),y(this,"executeInFlight",new Map),y(this,"messagesCache",new Map),y(this,"messagesRequests",new Map),e.instance)return e.instance;e.instance=this}var t,n,o,r,i;return t=e,n=[{key:"clearCache",value:function(){this.messagesCache.clear(),this.messagesRequests.clear(),this.executeInFlight.clear()}},{key:"_getApiUrl",value:function(){var e=ba.getInstance();return(null==e?void 0:e.apiUrl)||null}},{key:"_getHeaders",value:function(){var e,t,n=ba.getInstance(),o={"Content-Type":"application/json"};return null!=n&&n.sdkKey&&(o["Api-Token"]=n.sdkKey),null!=n&&null!==(e=n.session)&&void 0!==e&&e.gleapId&&(o["Gleap-Id"]=n.session.gleapId),null!=n&&null!==(t=n.session)&&void 0!==t&&t.gleapHash&&(o["Gleap-Hash"]=n.session.gleapHash),o}},{key:"_makeRequest",value:function(e,t,n){return new Promise((function(o,r){var i=new XMLHttpRequest;i.open(e,t);var a=ba.getInstance();null==a||a.injectSession(i),n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){if(4===i.readyState)if(i.status>=200&&i.status<300)try{o(i.responseText?JSON.parse(i.responseText):null)}catch(e){r({status:i.status,statusText:"JSON Parse Error",error:e})}else r({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){return r({status:0,statusText:"Network Error"})},i.send(n?JSON.stringify(n):null)}))}},{key:"streamAgent",value:(r=f().mark((function e(t,n,o,r){var i,a,s,c,u,d,p;return f().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=o.onError)||void 0===a||a.call(o,{message:"Gleap API URL not configured."}),e.abrupt("return");case 8:return s="".concat(i,"/v3/shared/agents/").concat(t,"/stream"),c=g(g({},this._getHeaders()),{},{Accept:"text/event-stream"}),e.prev=10,e.next=13,fetch(s,{method:"POST",headers:c,body:JSON.stringify(n),signal:r});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=o.onError)||void 0===d||d.call(o,{message:"Failed to connect to agent."}),e.abrupt("return");case 23:if(u.ok){e.next=27;break}return this.executeInFlight.delete(t),null===(p=o.onError)||void 0===p||p.call(o,{message:"Server error: ".concat(u.status)}),e.abrupt("return");case 27:return e.next=29,l(u,o);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,o){var i=r.apply(e,t);function a(e){m(i,n,o,a,s,"next",e)}function s(e){m(i,n,o,a,s,"throw",e)}a(void 0)}))},function(e,t,n,o){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 o=this._getApiUrl();if(!o)return Promise.reject(new Error("AgentNetworkManager: Gleap API URL not configured."));this.executeInFlight.set(e,!0);var r="".concat(o,"/v3/shared/agents/").concat(e,"/execute");return this._makeRequest("POST",r,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,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if("kai"===e)return Promise.resolve({messages:[]});var i="".concat(t,":").concat(o,":").concat(r),a=this.messagesCache.get(i);if(a)return a.status===w?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 c="".concat(s,"/v3/shared/agents/").concat(e,"/conversations/").concat(t,"/messages?limit=").concat(o,"&skip=").concat(r),l=this._makeRequest("GET",c,null).then((function(e){return n.messagesCache.set(i,{status:w,data:e}),JSON.parse(JSON.stringify(e))})).catch((function(e){throw n.messagesCache.set(i,{status:k,error:e}),e})).finally((function(){n.messagesRequests.delete(i)}));return this.messagesRequests.set(i,l),l.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 o=this._getApiUrl();return o?this._makeRequest("GET","".concat(o,"/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=d(this.messagesCache.keys());try{for(n.s();!(t=n.n()).done;){var o=t.value;o.startsWith(e+":")&&this.messagesCache.delete(o)}}catch(s){n.e(s)}finally{n.f()}var r,i=d(this.messagesRequests.keys());try{for(i.s();!(r=i.n()).done;){var a=r.value;a.startsWith(e+":")&&this.messagesRequests.delete(a)}}catch(s){i.e(s)}finally{i.f()}}}],o=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],n&&v(t.prototype,n),o&&v(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();y(x,"instance",null);const S=x;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 I(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,E(o.key),o)}}function T(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=function(e,t){if("object"!=C(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=C(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==C(t)?t:String(t)}var L="success",O="error",M=function(){function e(){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),T(this,"validationRequests",new Map),T(this,"validationCache",new Map),T(this,"fetchRequests",new Map),T(this,"fetchCache",new Map),e.instance)return e.instance;e.instance=this}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],(n=[{key:"clearCache",value:function(){this.validationCache.clear(),this.fetchCache.clear(),this.validationRequests.clear(),this.fetchRequests.clear()}},{key:"_getQueryParams",value:function(){var e=ba.getInstance(),t=null==e?void 0:e.session,n=Yd.getInstance().getActiveLanguage()||"en";return"gleapId=".concat((null==t?void 0:t.gleapId)||"","&gleapHash=").concat((null==t?void 0:t.gleapHash)||"","&lang=").concat(n)}},{key:"_getApiUrl",value:function(){var e=ba.getInstance();return(null==e?void 0:e.apiUrl)||null}},{key:"_makeRequest",value:function(e,t,n){return new Promise((function(o,r){var i=new XMLHttpRequest;i.open(e,t);var a=ba.getInstance();null==a||a.injectSession(i),n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){if(4===i.readyState)if(i.status>=200&&i.status<300)try{var e=i.responseText?JSON.parse(i.responseText):null;o(e)}catch(t){r({status:i.status,statusText:"JSON Parse Error",responseText:i.responseText,error:t})}else r({status:i.status,statusText:i.statusText,responseText:i.responseText})},i.onerror=function(){r({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,o=this._createCacheKey(e,t),r=this.validationCache.get(o);if(r)return r.status===L?Promise.resolve(r.internalId):Promise.reject(r.error);if(this.validationRequests.has(o))return this.validationRequests.get(o);var i=this._getApiUrl();if(!i){var a=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.validationCache.set(o,{status:O,error:a}),Promise.reject(a)}var s="".concat(i,"/outbound/checklists?").concat(this._getQueryParams()),c=this._makeRequest("POST",s,{outboundId:e,sharedKey:t}).then((function(e){if(e&&e.id)return n.validationCache.set(o,{status:L,internalId:e.id}),e.id;var t=new Error("Validation response missing checklist ID.");throw n.validationCache.set(o,{status:O,error:e||t}),t})).catch((function(e){throw n.validationCache.set(o,{status:O,error:e}),e})).finally((function(){n.validationRequests.delete(o)}));return this.validationRequests.set(o,c),c}},{key:"fetchChecklist",value:function(e){var t=this,n=this.fetchCache.get(e);if(n)return n.status===L?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 o=this._getApiUrl();if(!o){var r=new Error("ChecklistNetworkManager: Gleap API URL not configured.");return this.fetchCache.set(e,{status:O,error:r}),Promise.reject(r)}var i="".concat(o,"/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:L,data:n}),JSON.parse(JSON.stringify(n));var o=new Error("Empty response received for checklist fetch.");throw t.fetchCache.set(e,{status:O,error:n||o}),o})).catch((function(n){throw t.fetchCache.set(e,{status:O,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))}))}}])&&I(t.prototype,n),o&&I(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();T(M,"instance",null);const A=M;function P(e){return P="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},P(e)}function R(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,N(o.key),o)}}function _(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){var t=function(e,t){if("object"!=P(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=P(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==P(t)?t:String(t)}var D=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"feedbackButton",null),_(this,"injectedFeedbackButton",!1),_(this,"buttonHidden",null),_(this,"lastButtonIcon",null),_(this,"showingRedDot",!1),_(this,"removePressListeners",null)}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"destroy",value:function(){this.removePressListeners&&(this.removePressListeners(),this.removePressListeners=null),this.feedbackButton&&(this.feedbackButton.remove(),this.feedbackButton=null),this.buttonHidden=null,this.lastButtonIcon=null,this.injectedFeedbackButton=!1,this.instance=null}},{key:"toggleFeedbackButton",value:function(t){this.buttonHidden=!t,e.getInstance().updateFeedbackButtonState(),Ls.getInstance().updateContainerStyle()}},{key:"updateRedDot",value:function(e){var t=Wa.getInstance();if(this.feedbackButton&&!this.buttonHidden&&!t.isOpened()){var n="bb-feedback-button--red-dot",o=this.feedbackButton.querySelector(".".concat(n));if(e){if(!o){var r=document.createElement("div");r.className=n,this.feedbackButton.appendChild(r)}}else o&&o.remove()}}},{key:"feedbackButtonPressed",value:function(){var e=Wa.getInstance();e.isOpened()?(e.hideWidget(),this.updateRedDot(this.showingRedDot)):(e.setAppMode("widget"),e.showWidget(),this.updateRedDot(!1))}},{key:"injectFeedbackButton",value:function(){var e=this;if(!this.injectedFeedbackButton){this.injectedFeedbackButton=!0;var t=document.createElement("div");t.addEventListener("click",(function(){e.feedbackButtonPressed()})),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",o=null,r=function(){clearTimeout(o),e.classList.remove(n),e.classList.add(t)},i=function(){e.classList.contains(t)&&(e.classList.remove(t),e.classList.add(n),o=setTimeout((function(){e.classList.remove(n)}),550))};window.PointerEvent?(e.addEventListener("pointerdown",r),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",i),this.removePressListeners=function(){document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i)}):(e.addEventListener("mousedown",r),e.addEventListener("touchstart",r,{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&&!Wa.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=zn.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(an.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=zn.getInstance().getFlowConfig(),o="";o=n.buttonLogo?'<img class="bb-logo-logo" src="'.concat(n.buttonLogo,'" alt="Feedback Button" />'):ge("button","#fff");var r=["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",r.forEach((function(e){return t.feedbackButton.classList.add(e)})),this.feedbackButton.setAttribute("dir",Yd.getInstance().isRTLLayout?"rtl":"ltr"),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='<div class="bb-feedback-button-classic '.concat(n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT?"bb-feedback-button-classic--left":"").concat(n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM?"bb-feedback-button-classic--bottom":"",'">').concat(n.widgetButtonText,"</div>")):o!==this.lastButtonIcon&&(this.feedbackButton.innerHTML='<div class="bb-feedback-button-icon">'.concat(o).concat(ge("arrowdown","#fff"),'</div><div class="bb-notification-bubble bb-notification-bubble--hidden"></div>')),this.lastButtonIcon=o;var i=!1;null===e.getInstance().buttonHidden?n.feedbackButtonPosition===e.FEEDBACK_BUTTON_NONE&&(i=!0):e.getInstance().buttonHidden&&(i=!0),i&&this.feedbackButton.classList.add("bb-feedback-button--disabled"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_BOTTOM_LEFT&&this.feedbackButton.classList.add("bb-feedback-button--bottomleft"),Wa.getInstance().isOpened()&&this.feedbackButton.classList.add("bb-feedback-button--open");var a=Wa.getInstance().appMode;"survey"!==a&&"survey_full"!==a&&"survey_web"!==a||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||ba.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}])&&R(t.prototype,n),o&&R(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function F(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 o=n.call(e,t||"default");if("object"!=B(o))return o;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)}_(D,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),_(D,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),_(D,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),_(D,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),_(D,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),_(D,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),_(D,"instance",void 0);var H=/^[A-Za-z0-9+/=_-]{1,256}$/,U=function(e){if("string"!=typeof e)return null;var t=e.trim();return H.test(t)?t:null},q=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(o){}return null}(),z=null,W=function(){return z||q},G=function(e){var t=W();if(!t||!e)return e;try{e.setAttribute("nonce",t),e.nonce=t}catch(n){}return e},V="https://docs.gleap.ai/documentation/javascript/content-security-policy",K=new Set,X="gleap-frame-route-failed",J=function(e){return"string"==typeof e&&(0===e.indexOf("script-src")||0===e.indexOf("style-src"))},Y=function(e,t){if(e&&t){var n,o=!1,r=function(){if(!o){o=!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 r();try{if(!e.contentDocument)return r()}catch(a){return r()}try{var i=new URL(t);n=i.origin+"/"}catch(a){return r()}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(o){var i=o.replace(/(\s(?:href|src)\s*=\s*["'])\/([^"'/][^"']*)/g,"$1"+n+"$2"),s=W(),c=function(e,t){return t?e.replace(/<(script|style)\b(?![^>]*\snonce\s*=)/gi,'<$1 nonce="'+t+'"'):e}(i,s),l=s?' nonce="'+s+'"':"",u="/",d="/";try{var p=new URL(t);u=(d=p.pathname)+p.search+p.hash}catch(a){}var f,h,g="<script"+l+'>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(X)+"));}}catch(e){}<\/script>";f=/<script\b/i.test(c)?c.replace(/<script\b/i,g+"<script"):/<\/head>/i.test(c)?c.replace(/<\/head>/i,g+"</head>"):c;try{h=e.contentDocument}catch(a){return r()}if(!h)return r();try{e.addEventListener(X,r,{once:!0})}catch(a){}try{h.open(),function(e,t){var n=!1;try{e.addEventListener("securitypolicyviolation",(function(e){if(e&&"report"!==e.disposition){var o=e.blockedURI||"a resource",r=e.effectiveDirective||e.violatedDirective||"unknown directive",i=o+"|"+r;K.has(i)||(K.add(i),console.warn("Gleap: Your page's Content-Security-Policy blocked "+o+" ("+r+"). Gleap may not appear or work correctly until your policy allows it — see "+V)),t&&!n&&J(r)&&"string"==typeof o&&0===o.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(h,{baseHref:n,onBlocked:r}),h.write(f),h.close()}catch(a){r()}})).catch((function(e){K.has(t)||(K.add(t),console.warn("Gleap: Loading "+t+" failed ("+(e&&e.message?e.message:"network error")+") — 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) — see "+V)),r()}))}},$=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(o,r){var i=0===e.indexOf("data:image/jpeg"),a=new Image;a.src=e,a.onerror=function(){r()},a.onload=function(){var e=document.createElement("canvas"),r=t,s=n;t>a.width/1.5&&(r=a.width/1.5),n>a.height/1.5&&(s=a.height/1.5);var c=a.width,l=a.height;c>l?c>r&&(l*=r/c,c=r):l>s&&(c*=s/l,l=s),e.width=c,e.height=l,e.getContext("2d").drawImage(a,0,0,c,l),o(i?e.toDataURL("image/jpeg",.7):e.toDataURL())}}))},Z=/(android|iphone|ipod|ipad|blackberry|iemobile|opera mini|webos)/i,Q=function(){return ee()?"mobile":"desktop"},ee=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&&Z.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},te=function(e){if(!e)return{};if("string"==typeof e||e instanceof String)try{return JSON.parse(e)}catch(t){return{}}return e},ne=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},oe=function(e){try{if(!e||"object"!==B(e)||!("company"in e))return e;var t=e.company,n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){F(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);if(delete n.company,!t||"object"!==B(t))return n;var o=ne(t.id);if(!o)return n;n.companyId=o;var r=ne(t.name);return r&&(n.companyName=r),n}catch(i){return e}},re=[{amount:60,unit:"minute"},{amount:24,unit:"hour"},{amount:7,unit:"day"},{amount:4.34524,unit:"week"},{amount:12,unit:"month"},{amount:Number.POSITIVE_INFINITY,unit:"year"}],ie=function(e,t){return e.length>t?e.slice(0,t)+"...":e},ae=function(e){try{var t=e.split("."),n=!1,o=t[t.length-2];return"co"!==o&&"com"!==o&&"gv"!==o&&"ac"!==o&&"edu"!==o&&"gov"!==o&&"mil"!==o&&"net"!==o&&"org"!==o||(n=!0),(t=t.slice(n?-3:-2)).join(".")}catch(r){}return e},se=function(e){try{var t=localStorage.getItem("gleap-widget-".concat(e));if(t)return JSON.parse(t)}catch(n){}return null},ce=function(e,t){var n="gleap-widget-".concat(e);if(t)try{localStorage.setItem(n,JSON.stringify(t))}catch(o){}else localStorage.removeItem(n)},le=function(e){"complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",(function(){e()}))},ue=!1;function de(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 o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pe(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 pe(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 pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var fe=function(e,t){3===(e=e.replace(/^#/,"")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var n=de(e.match(/.{2}/g),3),o=n[0],r=n[1],i=n[2],a=[parseInt(o,16)+t,parseInt(r,16)+t,parseInt(i,16)+t];o=a[0],r=a[1],i=a[2],o=Math.max(Math.min(255,o),0).toString(16),r=Math.max(Math.min(255,r),0).toString(16),i=Math.max(Math.min(255,i),0).toString(16);var s=(o.length<2?"0":"")+o,c=(r.length<2?"0":"")+r,l=(i.length<2?"0":"")+i;return"#".concat(s).concat(c).concat(l)},he=function(e){return(299*parseInt(e.substr(1,2),16)+587*parseInt(e.substr(3,2),16)+114*parseInt(e.substr(5,2),16))/1e3>=160?"#000000":"#ffffff"},ge=function(e,t){return"button"===e?'<svg class="bb-logo-logo bb-logo-logo--default" width="145" height="144" viewBox="0 0 145 144" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M38.9534 15H105.047C113.857 15 121 22.1426 121 30.9534L121 89.5238L121 96.015L121 125.541C121 128.759 117.393 130.66 114.739 128.84L90.1188 111.968H38.9534C30.1426 111.968 23 104.826 23 96.015V30.9534C23 22.1426 30.1426 15 38.9534 15Z" fill="white"/>\n </svg>':"drag"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512">\x3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--\x3e<path d="M64 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm0 160a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM96 416a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96-288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 128a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM192 448a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"/></svg>':"unmute"===e?'<svg id="tooltip-svg-unmute" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path id="tooltip-svg-unmute-path" d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.1 386.2C556.7 352 576 306.3 576 256c0-60.1-27.7-113.8-70.9-149c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C507.3 170.7 528 210.9 528 256c0 39.1-15.6 74.5-40.9 100.5L449 326.6c19-17.5 31-42.7 31-70.6c0-30.1-13.9-56.9-35.4-74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C425.1 227.6 432 241 432 256s-6.9 28.4-17.7 37.3c-1.3 1-2.4 2.2-3.4 3.4L352 250.6V64c0-12.6-7.4-24-18.9-29.2s-25-3.1-34.4 5.3L197.8 129.8 38.8 5.1zM352 373.3L82.9 161.3C53.8 167.4 32 193.1 32 224v64c0 35.3 28.7 64 64 64h67.8L298.7 471.9c9.4 8.4 22.9 10.4 34.4 5.3S352 460.6 352 448V373.3z"/></svg>':"mute"===e?'<svg id="tooltip-svg-mute" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path id="tooltip-svg-mute-path" d="M533.6 32.5C598.5 85.3 640 165.8 640 256s-41.5 170.8-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"/></svg>':"replay"===e?'<svg id="tooltip-svg-replay" width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path id="tooltip-svg-replay-path" d="M48.5 224H40C26.7 224 16 213.3 16 200V72C16 62.3 21.8 53.5 30.8 49.8C39.8 46.1 50.1 48.1 57 55L98.6 96.6C186.2 10.1 327.3 10.4 414.4 97.6C501.9 185.1 501.9 326.9 414.4 414.4C326.9 501.9 185.1 501.9 97.6 414.4C85.1 401.9 85.1 381.6 97.6 369.1C110.1 356.6 130.4 356.6 142.9 369.1C205.4 431.6 306.7 431.6 369.2 369.1C431.7 306.6 431.7 205.3 369.2 142.8C307 80.6 206.5 80.3 143.9 141.8L185 183C191.9 189.9 193.9 200.2 190.2 209.2C186.5 218.2 177.7 224 168 224H48.5Z" />\n </svg>':"dismiss"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M294.6 166.6L317.3 144 272 98.7l-22.6 22.6L160 210.7 70.6 121.4 48 98.7 2.7 144l22.6 22.6L114.7 256 25.4 345.4 2.7 368 48 413.3l22.6-22.6L160 301.3l89.4 89.4L272 413.3 317.3 368l-22.6-22.6L205.3 256l89.4-89.4z"/></svg>':"blur"===e?'<svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">\n <path class="bb-svg-path" d="m602.25 1200c238.2 0 435.95-193.26 435.95-435.95 0-269.66-220.23-615.73-435.95-764.05-220.23 161.8-440.45 485.39-440.45 764.05 0 242.7 197.75 435.95 440.45 435.95zm-260.68-382.02c0 112.36 89.887 206.74 206.74 206.74v62.922c-148.32 0-274.16-121.35-274.16-269.66z" fill="#333"/>\n</svg>':"pen"===e?'<svg width="1072px" height="1034px" viewBox="0 0 1072 1034" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-907.000000, -217.000000)" fill-rule="nonzero">\n <g transform="translate(907.268457, 217.009827)">\n <g transform="translate(132.335119, 0.000000)" fill="#000" class="bb-svg-path">\n <path d="M20.3764235,730.530173 L10.1884235,720.342173 C-0.791576454,709.362173 -3.16357645,692.432173 4.37592355,678.858173 L83.1809235,537.018173 C71.7589235,502.979173 82.3098335,463.998173 112.254924,440.706173 L655.334924,18.3161733 C689.951924,-8.6058267 739.197924,-5.5388267 770.214924,25.4684733 L913.774924,169.028473 C944.782924,200.040473 947.848924,249.286473 920.927224,283.908473 L498.537224,826.988473 C496.322424,829.836173 493.935624,832.543173 491.384924,835.090073 C467.271924,859.207073 432.513924,866.195073 402.232924,856.063073 L260.382924,934.868073 C246.804924,942.407173 229.874924,940.036073 218.894924,929.055573 L208.706924,918.867573 L20.3764235,730.530173 Z M866.006424,241.190173 C871.393124,234.264373 870.779824,224.417173 864.576724,218.213173 L721.016724,74.6531733 C714.813624,68.4500733 704.965724,67.8367733 698.043724,73.2234733 L154.963724,495.613473 C147.381724,501.507973 146.018424,512.433473 151.912924,520.015473 C152.358234,520.585783 152.834804,521.128773 153.346524,521.636573 L417.586524,785.886573 C424.379524,792.675673 435.391524,792.675673 442.180524,785.886573 C442.692244,785.374853 443.168804,784.831873 443.610224,784.265473 L866.006424,241.190173 Z M342.796424,809.480173 L129.746424,596.430173 L77.9264235,689.707173 L249.516424,861.297173 L342.796424,809.480173 Z"></path>\n </g>\n <g transform="translate(-0.000000, 755.530173)" fill="#EB144C">\n <path d="M124.711543,0 L313.042043,188.3374 L233.288043,268.0914 C222.003043,279.3764 204.483043,281.5324 190.800043,273.3219 L16.8900429,168.9719 C-2.51595711,157.3309 -5.80895711,130.5499 10.1908429,114.5499 L124.711543,0 Z" class="bb-pen-tip"></path>\n </g>\n </g>\n </g>\n </g>\n</svg>':"rect"===e?'<svg width="339px" height="241px" viewBox="0 0 339 241" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-0.000865, 0.000000)" fill-rule="nonzero">\n <g transform="translate(0.000865, 0.000000)" fill="#000000" class="bb-svg-path">\n <path d="M339,0 L339,241 L0,241 L0,0 L339,0 Z M312.826351,26.168387 L26.1855674,26.168387 L26.1855674,214.41156 L312.826351,214.41156 L312.826351,26.168387 Z"></path>\n </g>\n <g transform="translate(0.000000, 83.206095)" fill="#EB144C" class="bb-pen-tip">\n <path d="M0,0 L26.186,26.186 L26.1864325,131.205465 L131.204,131.205 L157.792,157.793 L0.000865118243,157.793905 L0,0 Z"></path>\n </g>\n </g>\n </g>\n</svg>':"pointer"===e?'<svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">\n <path d="m1050.7 508.95-225.94 157.5 160.31 160.31c4.4531 4.4531 6.9141 10.43 6.9141 16.758s-2.4609 12.305-6.9141 16.758l-126.09 126.09c-4.4531 4.4531-10.43 6.9141-16.758 6.9141-6.3281 0-12.188-2.4609-16.758-6.9141l-160.2-160.43-157.62 225.94c-3.3984 4.9219-9.0234 7.8516-14.883 7.8516-0.70313 0-1.5234 0-2.2266-0.11719-6.7969-0.82031-12.422-5.2734-14.766-11.719l-333.16-880.55c-2.5781-6.6797-0.9375-14.297 4.2188-19.336 5.0391-5.0391 12.656-6.6797 19.336-4.2188l880.66 333.05c6.3281 2.3438 10.781 8.0859 11.602 14.766 0.82031 6.7969-2.1094 13.359-7.7344 17.344z" fill="#333"/>\n </svg>':"clip"===e?'<svg width="600px" height="1126px" viewBox="0 0 600 1126" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-0.002000, 0.501000)" fill="#333333" fill-rule="nonzero">\n <path d="M225.002,1124.999 C165.33,1124.999 108.102,1101.292 65.902,1059.097 C23.707,1016.902 5.68434189e-14,959.671 5.68434189e-14,899.997 L5.68434189e-14,299.997 C5.68434189e-14,220.431 31.605,144.127 87.867,87.867 C144.129,31.605 220.437,-4.26325641e-14 299.997,-4.26325641e-14 C379.557,-4.26325641e-14 455.867,31.605 512.127,87.867 C568.389,144.129 599.994,220.437 599.994,299.997 L599.994,1012.497 C599.994,1025.895 592.8456,1038.274 581.244,1044.974 C569.642,1051.6732 555.346,1051.6732 543.744,1044.974 C532.142,1038.2748 524.994,1025.896 524.994,1012.497 L524.994,299.997 C524.994,240.325 501.287,183.097 459.092,140.897 C416.897,98.702 359.666,74.995 299.992,74.995 C240.318,74.995 183.092,98.702 140.892,140.897 C98.697,183.092 74.99,240.323 74.99,299.997 L74.99,899.997 C74.99,953.587 103.58,1003.107 149.99,1029.897 C196.4,1056.694 253.58,1056.694 299.99,1029.897 C346.4,1003.104 374.99,953.585 374.99,899.997 L374.99,337.497 C374.99,310.704 360.697,285.942 337.49,272.544 C314.283,259.149 285.697,259.149 262.49,272.544 C239.283,285.942 224.99,310.704 224.99,337.497 L224.99,824.997 C224.99,838.395 217.8416,850.774 206.24,857.474 C194.638,864.1732 180.342,864.1732 168.74,857.474 C157.138,850.7748 149.99,838.396 149.99,824.997 L149.99,337.497 C149.99,283.907 178.58,234.387 224.99,207.597 C271.4,180.8 328.58,180.8 374.99,207.597 C421.4,234.39 449.99,283.909 449.99,337.497 L449.99,899.997 C449.99,959.669 426.283,1016.897 384.088,1059.097 C341.893,1101.292 284.662,1124.999 224.988,1124.999 L225.002,1124.999 Z" id="Path"></path>\n </g>\n </g>\n</svg>':"mic"===e?'<svg\n width="1200pt"\n height="1200pt"\n version="1.1"\n viewBox="0 0 1200 1200"\n xmlns="http://www.w3.org/2000/svg"\n >\n <g class="bb-svg-path">\n <path\n d="m600 862.5c144.75 0 262.5-117.75 262.5-262.5v-300c0-144.75-117.75-262.5-262.5-262.5s-262.5 117.75-262.5 262.5v300c0 144.75 117.75 262.5 262.5 262.5z"\n />\n <path\n d="m1012.5 600c0-20.707-16.793-37.5-37.5-37.5s-37.5 16.793-37.5 37.5c0 186.11-151.41 337.5-337.5 337.5s-337.5-151.39-337.5-337.5c0-20.707-16.793-37.5-37.5-37.5s-37.5 16.793-37.5 37.5c0 214.8 165.08 391.57 375 410.6v114.4c0 20.727 16.793 37.5 37.5 37.5s37.5-16.773 37.5-37.5v-114.4c209.92-19.031 375-195.8 375-410.6z"\n />\n </g>\n </svg>':"camera"===e?'<svg width="1155px" height="1004px" viewBox="0 0 1155 1004" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="#333333" fill-rule="nonzero">\n <g transform="translate(128.324095, 0.000000)">\n <path d="M42.7803063,0.00413459787 C31.4357421,0.00413459787 20.5549853,4.41399115 12.5336107,12.2572687 C4.51223664,20.1005462 0.00420584816,30.741831 0.00420584816,41.8370305 L0.00420584816,251.00151 C-0.156199045,262.200455 4.27736739,272.989996 12.315738,280.963903 C20.3585574,288.938257 31.3288589,293.431222 42.7803063,293.431222 C54.2317532,293.431222 65.2018267,288.938592 73.2448746,280.963903 C81.2832452,272.989549 85.7172445,262.200455 85.5564062,251.00151 L85.5564062,83.6699265 L256.660808,83.6699265 C268.112255,83.8267939 279.145066,79.4909873 287.298762,71.6298611 C295.452913,63.7643845 300.04718,53.0359758 300.04718,41.8370305 C300.04718,30.6380854 295.453255,19.9098998 287.298762,12.0441998 C279.144611,4.18307356 268.112255,-0.153157091 256.660808,0.00413459787 L42.7803063,0.00413459787 Z"></path>\n <path d="M983.227131,710.59444 C971.895913,710.764382 961.099907,715.326799 953.20401,723.279287 C945.312674,731.227538 940.964345,741.91668 941.119476,752.99849 L941.119476,920.330075 L770.015075,920.330075 C758.563631,920.173205 747.530815,924.509015 739.377123,932.370139 C731.222968,940.235615 726.628705,950.964028 726.628705,962.16297 C726.628705,973.361918 731.222627,984.090105 739.377123,991.955802 C747.531272,999.816926 758.563631,1004.15316 770.015075,1003.99587 L983.895579,1003.99587 C995.24014,1003.99587 1006.1209,999.586011 1014.14227,991.742733 C1022.16365,983.899455 1026.67168,973.258169 1026.67168,962.16297 L1026.67168,752.99849 C1026.83208,741.690223 1022.30053,730.801401 1014.11489,722.812989 C1005.93394,714.825472 994.790363,710.415949 983.227131,710.59444 L983.227131,710.59444 Z"></path>\n <path d="M983.227131,375.93127 C971.895913,376.101212 961.099907,380.66363 953.20401,388.61612 C945.312674,396.56437 940.964345,407.253512 941.119476,418.335325 L941.119476,585.66691 C940.959072,596.865853 945.39264,607.655394 953.431008,615.629303 C961.47383,623.603658 972.444131,628.096618 983.895579,628.096618 C995.347023,628.096618 1006.3171,623.603989 1014.36015,615.629303 C1022.39852,607.654947 1026.83251,596.865853 1026.67168,585.66691 L1026.67168,418.335325 C1026.83208,407.027056 1022.30053,396.138232 1014.11489,388.149822 C1005.93394,380.162305 994.790363,375.752783 983.227131,375.93127 L983.227131,375.93127 Z"></path>\n <path d="M769.974012,0.00413459787 C758.522563,-0.152733184 747.489752,4.18307356 739.336055,12.0441998 C731.181906,19.9096767 726.587637,30.6380854 726.587637,41.8370305 C726.587637,53.0359758 731.181564,63.7641611 739.336055,71.6298611 C747.490209,79.4909873 758.522563,83.8272181 769.974012,83.6699265 L941.078414,83.6699265 L941.078414,251.00151 C940.918009,262.200455 945.351572,272.989996 953.389945,280.963903 C961.432763,288.938257 972.403063,293.431222 983.854512,293.431222 C995.30596,293.431222 1006.27603,288.938592 1014.31908,280.963903 C1022.35745,272.989549 1026.79145,262.200455 1026.63061,251.00151 L1026.63061,41.8370305 C1026.63061,30.7426118 1022.12133,20.1017733 1014.10121,12.2572687 C1006.08109,4.41276405 995.199876,0.00413459787 983.854512,0.00413459787 L769.974012,0.00413459787 Z"></path>\n <path d="M427.765208,0.00413459787 C416.31376,-0.152733184 405.280949,4.18307356 397.127256,12.0441998 C388.973102,19.9096767 384.378838,30.6380854 384.378838,41.8370305 C384.378838,53.0359758 388.972761,63.7641611 397.127256,71.6298611 C405.281406,79.4909873 416.31376,83.8272181 427.765208,83.6699265 L598.86961,83.6699265 C610.321058,83.8267939 621.35387,79.4909873 629.507562,71.6298611 C637.661716,63.7643845 642.255985,53.0359758 642.255985,41.8370305 C642.255985,30.6380854 637.662058,19.9098998 629.507562,12.0441998 C621.353413,4.18307356 610.321058,-0.153157091 598.86961,0.00413459787 L427.765208,0.00413459787 Z"></path>\n </g>\n <g transform="translate(0.000000, 427.000000)">\n <path d="M768.516184,22.1826583 C752.659627,13.73125 732.573775,13.73125 717.773442,24.29375 L562.379192,124.6375 L562.379192,31.6875 C562.379192,13.7330104 548.635081,0 530.666079,0 L31.7131123,0 C13.7441105,0 0,13.7330104 0,31.6875 L0,475.3125 C0,493.26699 13.7441105,507 31.7131123,507 L530.666079,507 C548.635081,507 562.379192,493.26699 562.379192,475.3125 L562.379192,382.3625 L717.773442,482.70625 C726.231681,487.9875 735.742444,491.157658 745.257258,491.157658 C753.715498,491.157658 761.113815,489.046567 769.572406,484.820862 C786.485185,475.313732 796,458.414612 796,439.400352 L796,68.6566021 C794.943601,48.5869719 785.428963,31.6878521 768.516184,22.1807219 L768.516184,22.1826583 Z"></path>\n </g>\n </g>\n </g>\n</svg>':"recorderon"===e?'<svg width="1251px" height="1251px" viewBox="0 0 1251 1251" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g>\n <circle fill="#E31810" cx="625.5" cy="625.5" r="625.5"></circle>\n <circle fill="#F71008" cx="625" cy="625" r="507"></circle>\n <g transform="translate(175.000000, 449.000000)" fill="#FFFFFF" fill-rule="nonzero">\n <path d="M0,347.097493 L0,4.90250696 L135.528311,4.90250696 C161.471024,4.90250696 183.639743,9.49741034 202.034469,18.6872171 C220.429194,27.8770239 234.46286,40.8541449 244.135466,57.6185803 C253.808072,74.3830156 258.644376,94.0714804 258.644376,116.683975 C258.644376,139.40786 253.724206,158.929238 243.883867,175.248107 C234.043527,191.566976 219.814173,204.070682 201.195803,212.759227 C182.577434,221.447772 160.073248,225.792044 133.683247,225.792044 L42.9396629,225.792044 L42.9396629,167.64563 L121.941933,167.64563 C135.807866,167.64563 147.325536,165.751973 156.494943,161.964659 C165.66435,158.177344 172.51345,152.496373 177.042243,144.921744 C181.571035,137.347116 183.835432,127.934526 183.835432,116.683975 C183.835432,105.322032 181.571035,95.7423543 177.042243,87.9449425 C172.51345,80.1475308 165.636395,74.2159282 156.411077,70.1501349 C147.185759,66.0843416 135.584222,64.051445 121.606467,64.051445 L72.6284142,64.051445 L72.6284142,347.097493 L0,347.097493 Z M185.512762,191.37204 L270.888889,347.097493 L190.712487,347.097493 L107.181424,191.37204 L185.512762,191.37204 Z"></path>\n <polygon points="309.166667 347.097493 309.166667 4.90250696 540.126846 4.90250696 540.126846 64.5527072 381.634607 64.5527072 381.634607 146.091356 528.244113 146.091356 528.244113 205.741556 381.634607 205.741556 381.634607 287.447293 540.796296 287.447293 540.796296 347.097493"></polygon>\n <path d="M901,124.638783 L827.757943,124.638783 C826.420189,115.158428 823.68894,106.709759 819.564197,99.2927757 C815.439454,91.8757921 810.144176,85.5462611 803.678363,80.3041825 C797.212549,75.0621039 789.77129,71.0468948 781.354585,68.2585551 C772.93788,65.4702155 763.824427,64.0760456 754.014228,64.0760456 C736.288981,64.0760456 720.849065,68.4537389 707.69448,77.2091255 C694.539894,85.964512 684.339516,98.6793409 677.093346,115.353612 C669.847176,132.027883 666.224091,152.243346 666.224091,176 C666.224091,200.425856 669.875046,220.948035 677.176956,237.56654 C684.478866,254.185044 694.707113,266.732573 707.861699,275.209125 C721.016285,283.685678 736.233242,287.923954 753.51257,287.923954 C763.21129,287.923954 772.213263,286.641318 780.518488,284.076046 C788.823714,281.510773 796.209233,277.746515 802.675047,272.78327 C809.14086,267.820025 814.519748,261.769328 818.81171,254.631179 C823.103672,247.493029 826.08575,239.351077 827.757943,230.205323 L901,230.539924 C899.104848,246.26616 894.394837,261.406844 886.869968,275.961977 C879.3451,290.51711 869.256201,303.510773 856.603274,314.942966 C843.950346,326.375158 828.900608,335.409379 811.45406,342.045627 C794.007513,348.681876 774.303504,352 752.342035,352 C721.796641,352 694.512024,345.084918 670.488184,331.254753 C646.464343,317.424588 627.512821,297.404309 613.633619,271.193916 C599.754416,244.983523 592.814815,213.252218 592.814815,176 C592.814815,138.636248 599.838026,106.849176 613.884448,80.6387833 C627.93087,54.4283904 646.993871,34.4359949 671.073451,20.661597 C695.153031,6.88719899 722.242559,0 752.342035,0 C772.185393,0 790.607387,2.78833967 807.608016,8.36501901 C824.608646,13.9416984 839.686254,22.0557668 852.840839,32.7072243 C865.995425,43.3586819 876.72533,56.3802281 885.030556,71.7718631 C893.335782,87.1634981 898.65893,104.785805 901,124.638783 Z"></path>\n </g>\n </g>\n </g>\n</svg>':"recorderoff"===e?'<svg width="1251px" height="1251px" viewBox="0 0 1251 1251" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g class="bb-rec-on-circle" fill="#EEEEEE" fill-rule="nonzero">\n <path d="M625.5,0 C970.954111,0 1251,280.045889 1251,625.5 C1251,970.954111 970.954111,1251 625.5,1251 C280.045889,1251 0,970.954111 0,625.5 C0,280.045889 280.045889,0 625.5,0 Z M626,124 C348.753056,124 124,348.753056 124,626 C124,903.246944 348.753056,1128 626,1128 C903.246944,1128 1128,903.246944 1128,626 C1128,348.753056 903.246944,124 626,124 Z"></path>\n </g>\n <g class="bb-rec-on-cont" fill="#E31810" transform="translate(86.000000, 86.000000)" fill-rule="nonzero">\n <path d="M540,0 C241.2,0 0,241.2 0,540 C0,838.8 241.2,1080 540,1080 C838.8,1080 1080,838.8 1080,540 C1080,241.2 838.8,0 540,0 Z M777.6,741.6 C777.6,761.998 761.998,777.6 741.6,777.6 L338.4,777.6 C318.002,777.6 302.4,761.998 302.4,741.6 L302.4,338.4 C302.4,318.002 318.002,302.4 338.4,302.4 L741.6,302.4 C761.998,302.4 777.6,318.002 777.6,338.4 L777.6,741.6 Z"></path>\n </g>\n </g>\n </svg>':"arrowdown"===e?'<svg class="bb-logo-arrowdown" fill="'.concat(t,'" width="100pt" height="100pt" version="1.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <path d="m50 77.637c-1.3477 0-2.6953-0.51562-3.7266-1.543l-44.73-44.73c-2.0586-2.0586-2.0586-5.3945 0-7.4531 2.0586-2.0586 5.3945-2.0586 7.4531 0l41.004 41 41.004-41c2.0586-2.0586 5.3945-2.0586 7.4531 0 2.0586 2.0586 2.0586 5.3945 0 7.4531l-44.73 44.727c-1.0312 1.0312-2.3789 1.5469-3.7266 1.5469z"/>\n </svg>'):"arrowleft"===e?'<svg fill="'.concat(t,'" width="100pt" height="100pt" version="1.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <path d="m70.988 1.6211c2.1875-2.168 5.7344-2.168 7.9297 0 2.1836 2.168 2.1836 5.7227 0 7.8906l-46.016 40.445 46.016 40.5c2.1836 2.168 2.1836 5.668 0 7.8906-2.1953 2.168-5.7383 2.168-7.9297 0l-50.039-44.109c-1.168-1.168-1.668-2.7227-1.5898-4.2773-0.078125-1.5 0.42188-3.0547 1.5898-4.2227l50.039-44.109z" fill-rule="evenodd"/>\n </svg>'):"close"===e?'<svg fill="'.concat(t,'" width="100pt" height="100pt" version="1.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <path d="m72.812 33.02l-5.832-5.832-16.98 16.875-16.98-16.875-5.832 5.832 16.875 16.98-16.875 16.98 5.832 5.832 16.98-16.875 16.98 16.875 5.832-5.832-16.875-16.98z"/>\n </svg>'):"undo"===e?'<svg width="62px" height="60px" viewBox="0 0 62 60" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g class="bb-svg-path" transform="translate(-0.000500, 0.001926)" fill-rule="nonzero">\n <path d="M28.0005,51.6270739 C24.9653,51.0684839 22.0825,49.8731739 19.5396,48.1192739 L13.8208,53.8380739 C17.9536,57.0060739 22.8403,59.0333739 28.0008,59.7286739 L28.0005,51.6270739 Z" id="Path"></path>\n <path d="M2.2705,33.9980739 C2.96581,39.1582739 4.9932,44.0450739 8.1611,48.1780739 L13.8799,42.4592739 C12.126,39.9162739 10.9307,37.0334739 10.3721,33.9983739 L2.2705,33.9980739 Z" id="Path"></path>\n <path d="M61.7305,33.9980739 L53.6289,33.9980739 C53.07031,37.0332739 51.875,39.9160739 50.1211,42.4589739 L55.8399,48.1777739 C59.0079,44.0449739 61.0352,39.1582739 61.7305,33.9977739 L61.7305,33.9980739 Z" id="Path"></path>\n <path d="M4.0005,24.9980739 L24.0005,24.9980739 L24.0005,16.9980739 L14.27,16.9980739 C17.6762,12.3613739 22.7622,9.24417393 28.442,8.31057393 C34.1178,7.38088393 39.934,8.70901393 44.645,12.0175739 C49.352,15.3222739 52.5786,20.3417739 53.6294,25.9975739 L61.731,25.9975739 C60.6646,18.0834739 56.4888,10.9235739 50.129,6.09957393 C43.7657,1.27147393 35.746,-0.818426068 27.836,0.290973932 C19.9298,1.39647393 12.793,5.61127393 8,11.9979739 L8,0.997973932 L-3.55271368e-15,0.997973932 L-3.55271368e-15,20.9979739 C-3.55271368e-15,22.0604739 0.42188,23.0760739 1.1719,23.8260739 C1.92192,24.5760739 2.9375,24.9979739 4,24.9979739 L4.0005,24.9980739 Z" id="Path"></path>\n <path d="M36.0005,51.6270739 L36.0005,59.7286739 C41.1607,59.0333639 46.0475,57.0059739 50.1805,53.8380739 L44.4617,48.1192739 C41.9187,49.8731739 39.0359,51.0684739 36.0008,51.6270739 L36.0005,51.6270739 Z" id="Path"></path>\n </g>\n </g>\n </svg>':"circle-dot"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"/></svg>'):"circle-question"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>'):"circle-info"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216 192V224h24 48 24v24 88h8 24v48H296 216 192V336h24zm72-144H224V128h64v64z"/></svg>'):"circle-exclamation"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm24-384v24V264v24H232V264 152 128h48zM232 368V320h48v48H232z"/></svg>'):"circle-up"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM384 256H304V384H208V256H128V224L256 96 384 224v32z"/></svg>'):"circle-right"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM256 384l0-80-128 0 0-96 128 0 0-80 32 0L416 256 288 384l-32 0z"/></svg>'):""};function me(e){return me="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},me(e)}function ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ye(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,we(o.key),o)}}function be(e,t,n){return t&&ye(e.prototype,t),n&&ye(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function we(e){var t=function(e,t){if("object"!=me(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=me(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==me(t)?t:String(t)}var ke=function(){function e(t){ve(this,e),this.overlay=document.createElement("div"),this.overlay.className=t.className||"_ext-element-overlay",this.overlay.style.background=t.style&&t.style.background||"rgba(250, 240, 202, 0.2)",this.overlay.style.borderColor=t.style&&t.style.borderColor||"#F95738",this.overlay.style.borderStyle=t.style&&t.style.borderStyle||"solid",this.overlay.style.borderRadius=t.style&&t.style.borderRadius||"1px",this.overlay.style.borderWidth=t.style&&t.style.borderWidth||"1px",this.overlay.style.boxSizing=t.style&&t.style.boxSizing||"border-box",this.overlay.style.cursor=t.style&&t.style.cursor||"crosshair",this.overlay.style.position=t.style&&t.style.position||"absolute",this.overlay.style.zIndex=t.style&&t.style.zIndex||"2147483647",this.overlay.style.margin=t.style&&t.style.margin||"0px",this.overlay.style.padding=t.style&&t.style.padding||"0px",this.shadowContainer=document.createElement("div"),this.shadowContainer.className="_ext-element-overlay-container",this.shadowContainer.style.position="absolute",this.shadowContainer.style.top="0px",this.shadowContainer.style.left="0px",this.shadowContainer.style.margin="0px",this.shadowContainer.style.padding="0px",this.shadowRoot=this.shadowContainer.attachShadow({mode:"open"})}return be(e,[{key:"addToDOM",value:function(e,t){this.usingShadowDOM=t,t?(e.insertBefore(this.shadowContainer,e.firstChild),this.shadowRoot.appendChild(this.overlay)):e.appendChild(this.overlay)}},{key:"removeFromDOM",value:function(){this.setBounds({x:0,y:0,width:0,height:0}),this.overlay.remove?this.overlay.remove():this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.usingShadowDOM&&(this.shadowContainer.remove?this.shadowContainer.remove():this.shadowContainer.parentNode&&this.shadowContainer.parentNode.removeChild(this.shadowContainer))}},{key:"captureCursor",value:function(){this.overlay.style.pointerEvents="auto"}},{key:"ignoreCursor",value:function(){this.overlay.style.pointerEvents="none"}},{key:"setBounds",value:function(e){var t=e.x,n=e.y,o=e.width,r=e.height;this.overlay.style.left=t+"px",this.overlay.style.top=n+"px",this.overlay.style.width=o+"px",this.overlay.style.height=r+"px"}}]),e}(),xe=function(){function e(t){ve(this,e),this.active=!1,this.overlay=new ke(t||{}),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleClick=this.handleClick.bind(this),this.tick=this.tick.bind(this)}return be(e,[{key:"start",value:function(e){if(this.active)return!1;this.active=!0,this.options=e,document.addEventListener("mousemove",this.handleMouseMove,!0),document.addEventListener("click",this.handleClick,!0);var t=e.parentElement||document.body,n=void 0===e.useShadowDOM||e.useShadowDOM;return this.overlay.addToDOM(t,n),this.tick(),!0}},{key:"stop",value:function(){this.active=!1,this.options=void 0,document.removeEventListener("mousemove",this.handleMouseMove,!0),document.removeEventListener("click",this.handleClick,!0),this.overlay.removeFromDOM(),this.target=void 0,this.mouseX=void 0,this.mouseY=void 0,this.tickReq&&window.cancelAnimationFrame(this.tickReq)}},{key:"handleMouseMove",value:function(e){this.mouseX=e.clientX,this.mouseY=e.clientY}},{key:"handleClick",value:function(e){var t=document.elementFromPoint(e.clientX,e.clientY);this.options&&this.options.elementFilter&&t&&!this.options.elementFilter(t)||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.target&&this.options&&this.options.onClick&&this.options.onClick(this.target))}},{key:"tick",value:function(){this.updateTarget(),this.tickReq=window.requestAnimationFrame(this.tick)}},{key:"updateTarget",value:function(){if(void 0!==this.mouseX&&void 0!==this.mouseY){this.overlay.ignoreCursor();var e=document.elementFromPoint(this.mouseX,this.mouseY);if(this.overlay.captureCursor(),e&&e!==this.target){if(this.options&&this.options.elementFilter&&!this.options.elementFilter(e))return this.target=void 0,void this.overlay.setBounds({x:0,y:0,width:0,height:0});this.target=e;var t,n,o=(n=(t=e).getBoundingClientRect(),{x:window.pageXOffset+n.left,y:window.pageYOffset+n.top,width:t.offsetWidth,height:t.offsetHeight});this.overlay.setBounds(o),this.options&&this.options.onHover&&this.options.onHover(e)}}}}]),e}();const Se=xe;function Ce(e){var t=e.getAttribute("id");return null!==t&&""!==t?t.match(/(?:^\d|:)/)?'[id="'.concat(t,'"]'):"#"+t:null}function Ie(e){var t=function(e){if(!e.hasAttribute("class"))return[];try{return Array.prototype.slice.call(e.classList).filter((function(e){return/^[a-z_-][a-z\d_-]*$/i.test(e)?e:null}))}catch(n){var t=e.getAttribute("class");return(t=t.trim().replace(/\s+/g," ")).split(" ")}}(e).filter(Boolean);return t.map((function(e){return".".concat(e)}))}function Te(e,t,n,o,r,i,a){if(i!==a)for(var s=o;s<=r&&r-s+1>=a-i;++s)n[i]=t[s],Te(e,t,n,s+1,r,i+1,a);else e.push(n.slice(0,i).join(""))}function Ee(e){return function(e){if(Array.isArray(e))return Le(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 Le(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 Le(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 Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Oe(e){return Oe="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},Oe(e)}function Me(e){return"object"===("undefined"==typeof HTMLElement?"undefined":Oe(HTMLElement))?e instanceof HTMLElement:!!e&&"object"===Oe(e)&&1===e.nodeType&&"string"==typeof e.nodeName}function Ae(e){var t,n,o=0,r=e.parentNode;if(Boolean(r)){var i=r.childNodes,a=i.length;for(t=0;t<a;t++)if(Me(n=i[t])&&(o++,n===e))return":nth-child(".concat(o,")")}return null}function Pe(e){return e.tagName.toLowerCase().replace(/:/g,"\\:")}function Re(e,t){if(!Boolean(t))return!1;var n=e.ownerDocument.querySelectorAll(t);return 1===n.length&&n[0]===e}function _e(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 Ne(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 Ne(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function De(e,t,n){var o={Tag:Pe,NthChild:Ae,Attributes:function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["id","class","length"];return Ee(e.attributes).reduce((function(e,n){return t.indexOf(n.nodeName)>-1||e.push("[".concat(n.nodeName,'="').concat(n.value,'"]')),e}),[])}(e,n)},Class:Ie,ID:Ce};return t.reduce((function(t,n){return t[n]=o[n](e),t}),{})}function je(e,t){try{var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}catch(o){return!1}}function Fe(e,t){return t.find(je.bind(null,e))}function Be(e,t,n){var o=function(e,t){for(var n=[],o=e.length,r=[],i=1;i<=t;++i)Te(n,e,r,0,o-1,0,i);return n}(t,3),r=Fe(e,o);return Boolean(r)||Boolean(n)&&(r=Fe(e,o=o.map((function(e){return n+e}))),Boolean(r))?r:null}function He(e,t,n,o){var r,i=De(e,t,n);o&&o instanceof RegExp&&(i.ID=o.test(i.ID)?null:i.ID,i.Class=i.Class.filter((function(e){return!o.test(e)})));var a,s=_e(t);try{for(s.s();!(a=s.n()).done;){var c=a.value,l=i.ID,u=i.Tag,d=i.Class,p=i.Attributes,f=i.NthChild;switch(c){case"ID":if(Boolean(l)&&je(e,l))return l;break;case"Tag":if(Boolean(u)&&je(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(r=Be(e,d,u)))return r;break;case"Attributes":if(Boolean(p)&&p.length&&(r=Be(e,p,u)))return r;break;case"NthChild":if(Boolean(f))return f}}}catch(h){s.e(h)}finally{s.f()}return"*"}function Ue(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.selectorTypes,r=void 0===o?["ID","Class","Tag","NthChild"]:o,i=n.attributesToIgnore,a=void 0===i?["id","class","length"]:i,s=n.excludeRegex,c=void 0===s?null:s,l=[],u=function(e){for(var t=[],n=e;Me(n);)t.push(n),n=n.parentNode;return t}(e),d=_e(u);try{for(d.s();!(t=d.n()).done;){var p=He(t.value,r,a,c);Boolean(p)&&l.push(p)}}catch(y){d.e(y)}finally{d.f()}for(var f=[],h=0,g=l;h<g.length;h++){var m=g[h];f.unshift(m);var v=f.join(" > ");if(Re(e,v))return v}return null}var qe=function(e){return'(?:[^"]*[^a-zA-Z0-9])?(?:'.concat(e.join("|"),")")},ze=new RegExp(['^(?:#|\\[id=")'.concat(qe(["v-\\d+",":r[0-9a-z]+:","(?:radix|headlessui|reach|floating-ui)-","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(qe(["css-[a-z0-9]*\\d[a-z0-9]*","sc-(?=[a-zA-Z0-9]*[A-Z])[a-zA-Z0-9]{5,}","jsx-\\d+"])),"^\\.[^.]*".concat("__(?=[A-Za-z0-9]{4,}$)(?=[A-Za-z0-9]*[0-9])(?=[A-Za-z0-9]*[A-Z])[A-Za-z0-9]+$")].join("|")),We=function(e,t){if(!e||"*"===e)return!1;try{var n=document.querySelectorAll(e);return 1===n.length&&n[0]===t}catch(o){return!1}},Ge=/\d{2,}/,Ve=function(e){return e.replace(/\d+/g,"#")},Ke=function(e){return e.match(/(?:^\d|:)/)?'[id="'.concat(e,'"]'):"#".concat(e)},Xe=["data-testid","data-test-id","data-test","data-cy","data-qa","name"],Je=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ue,n=t(e),o=[];try{var r=function(){for(var e={},t=document.querySelectorAll("[id]"),n=0;n<t.length;n++){var o=t[n].getAttribute("id");if(o&&Ge.test(o)){var r=Ve(o);e[r]||(e[r]=[]),e[r].indexOf(o)<0&&e[r].push(o)}}return Object.keys(e).reduce((function(t,n){return e[n].length>1?t.concat(e[n]):t}),[])}(),i="function"==typeof e.getAttribute?e.getAttribute("id"):null;i&&r.indexOf(i)<0&&!ze.test(Ke(i))&&o.push(Ke(i)),o.push.apply(o,function(e){var t=(e.tagName||"").toLowerCase();return Xe.reduce((function(n,o){var r="function"==typeof e.getAttribute?e.getAttribute(o):null;if(!r||ze.test("#".concat(r)))return n;var i=r.replace(/["\\]/g,"\\$&");return n.concat(["".concat(t,"[").concat(o,'="').concat(i,'"]'),"[".concat(o,'="').concat(i,'"]')])}),[])}(e));var a=r.map((function(e){return Ke(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})),s=a.length?new RegExp("".concat(ze.source,"|^(?:").concat(a.join("|"),")$")):ze;o.push(t(e,{excludeRegex:s}))}catch(l){}for(var c=0;c<o.length;c++)if(We(o[c],e))return o[c];return n};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 $e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,et(o.key),o)}}function Ze(e,t,n){return t&&$e(e.prototype,t),n&&$e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qe(e,t,n){return(t=et(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function et(e){var t=function(e,t){if("object"!=Ye(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ye(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ye(t)?t:String(t)}var tt=Ze((function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Qe(this,"picker",null),Qe(this,"onElementPicked",null),Qe(this,"stopPicker",(function(){if(t.picker)return t.picker.stop(),void(t.picker=null)})),Qe(this,"startPicker",(function(){t.stopPicker();var e=t;t.picker=new Se({style:{borderColor:"#2142E7",background:"transparent",borderWidth:"4px",borderRadius:"5px"}}),t.picker.start({useShadowDOM:!1,onClick:function(t){try{for(var n,o=null,r=t,i=0;r&&i<=3;i++){if(r.getAttribute&&r.getAttribute("data-gleap-tour")){o=r;break}r=r.parentElement}if(o){var a=o.getAttribute("data-gleap-tour");n='[data-gleap-tour="'.concat(a,'"]')}else n=Je(t);e.onElementPicked&&e.onElementPicked(n)}catch(s){console.error("Error while getting unique selector",s)}},elementFilter:function(e){return!e.classList.contains("gleap-admin-collapse-ui")&&!e.closest(".gleap-admin-collapse-ui")}})})),Qe(this,"setMode",(function(e){t.mode=e,"navigate"===e&&t.stopPicker(),"picker"===e&&t.startPicker()}))}));const nt=tt;function ot(e){return ot="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},ot(e)}function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function it(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rt(Object(n),!0).forEach((function(t){st(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function at(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,ct(o.key),o)}}function st(e,t,n){return(t=ct(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e){var t=function(e,t){if("object"!=ot(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=ot(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ot(t)?t:String(t)}var lt=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),st(this,"libraryInstance",null),st(this,"lastUrl",void 0),st(this,"injectedFrame",!1),st(this,"gleapFrameContainer",null),st(this,"gleapCollapseUI",null),st(this,"injectedCollapseUI",!1),st(this,"gleapFrame",null),st(this,"configData",null),st(this,"adminHelper",null),st(this,"status","navigate"),st(this,"initialized",!1),st(this,"toggleCollapseUI",(function(){var e="gleap-admin-collapse-ui-active",n="gleap-admin-frame-container-active",o=function(e,t){return e&&e.classList.contains(t)};(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])||o(t.gleapCollapseUI,e)&&o(t.gleapFrameContainer,n))&&(t.gleapCollapseUI&&t.gleapCollapseUI.classList.toggle(e),t.gleapFrameContainer&&t.gleapFrameContainer.classList.toggle(n))})),st(this,"injectCollapseUI",(function(){if(!t.injectedCollapseUI){t.injectedCollapseUI=!0;var e=document.createElement("div");e.className="gleap-admin-collapse-ui",e.innerHTML='<div class="gleap-admin-collapse-ui-icon">\n '.concat(ge("arrowdown"),"\n </div>"),document.body.appendChild(e),t.gleapCollapseUI=e,e.addEventListener("click",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t.toggleCollapseUI()}))}})),st(this,"injectFrame",(function(){var e;if(!t.injectedFrame){t.injectedFrame=!0;var n=document.createElement("div");n.className="gleap-admin-frame-container",n.innerHTML='<iframe src="https://app.gleap.io/'.concat("tooltips"===(null==t||null===(e=t.configData)||void 0===e?void 0:e.type)?"tooltipbuilder":"producttourbuilder",'" class="gleap-admin-frame" scrolling="no" title="Gleap Admin Window" allow="autoplay; encrypted-media; fullscreen;" frameborder="0"></iframe>'),document.body.appendChild(n),t.gleapFrameContainer=n,t.gleapFrame=document.querySelector(".gleap-admin-frame")}}))}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(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,dc.getInstance().disable(),yn.getInstance().disable(),vs.getInstance().disable(),cp.close(),cp.showFeedbackButton(!1),e.adminHelper=new nt;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("https://app.gleap.io"===n.origin)try{var o=JSON.parse(n.data);if("admin"===o.type&&("load"===o.name&&(t.configData=o.data,t.initAdminHelper()),"smartlink-search-result"===o.name&&e.sendMessageToTourBuilder({name:"smartlink-search-result",data:o.data}),"translate-complete"===o.name&&e.sendMessageToTourBuilder({name:"translate-complete",data:o.data})),"tourbuilder"===o.type){var r;if("loaddata"===o.name&&e.sendMessageToTourBuilder({name:"data",data:it(it({},t.configData),{},{currentPage:window.location.href})}),"highlight-element"===o.name&&(document.querySelectorAll(".gleap-admin-highlight").forEach((function(e){e.classList.remove("gleap-admin-highlight")})),null!=o&&null!==(r=o.data)&&void 0!==r&&r.selector)){var i,a=document.querySelector(null==o||null===(i=o.data)||void 0===i?void 0:i.selector);a&&a.classList.add("gleap-admin-highlight")}if("smartlink-search"===o.name&&e.sendMessage({name:"smartlink-search",data:o.data}),"product-tour-started"===o.name&&e.sendMessage({name:"product-tour-started",data:o.data}),"translate"===o.name&&e.sendMessage({name:"translate",data:o.data}),"save"===o.name&&e.sendMessage({name:"save",data:o.data}),"update-steps"===o.name&&e.sendMessage({name:"update-steps",data:o.data}),"click"===o.name)try{document.querySelector(o.data.selector).click()}catch(s){console.log(s)}"status-changed"===o.name&&(t.status=o.data,e.setFrameHeight(t.status),t.adminHelper.stopPicker(),"picker"===t.status&&t.adminHelper.startPicker())}}catch(c){}})),this.sendMessage({name:"init"}),this.startPageListener()}}},{key:"sendMessage",value:function(e){try{window&&window.opener&&window.opener.postMessage(JSON.stringify(it(it({},e),{},{type:"admin"})),"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(it(it({},e),{},{type:"tourbuilder"})),"*")}catch(t){}}}])&&at(t.prototype,n),o&&at(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ut(e){return ut="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},ut(e)}function dt(){dt=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new M(o||[]);return r(a,"_invoke",{value:T(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(A([])));x&&x!==n&&o.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(r,i,a,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==ut(u)&&o.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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,o){function r(){return new t((function(t,r){n(e,o,t,r)}))}return i=i?i.then(r,r):r()}})}function T(t,n,o){var r=p;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw a;return{value:e,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=E(s,o);if(c){if(c===m)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===p)throw r=g,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=h;var l=d(t,n,o);if("normal"===l.type){if(r=o.done?g:f,l.arg===m)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(r=g,o.method="throw",o.arg=l.arg)}}}function E(t,n){var o=n.method,r=t.iterator[o];if(r===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),m;var i=d(r,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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(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 r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(ut(t)+" is not iterable")}return y.prototype=b,r(S,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new I(u(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=A,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(o,r){return s.type="throw",s.arg=t,n.next=o,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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 o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:A(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),m}},t}function pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(n),!0).forEach((function(t){ht(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ht(e,t,n){return(t=bt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(e){return function(e){if(Array.isArray(e))return mt(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 mt(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 mt(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 mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function vt(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(o,r)}function yt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,bt(o.key),o)}}function bt(e){var t=function(e,t){if("object"!=ut(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=ut(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ut(t)?t:String(t)}st(lt,"instance",void 0);var wt=function(){function e(){var t=arguments.length>0&&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=S.getInstance()}catch(n){this._networkManager=null}}var t,n,o,r,i;return t=e,n=[{key:"sendMessage",value:(r=dt().mark((function e(t){var n,o,r,i,a,s,c,l=this;return dt().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(gt(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),o="stream-".concat(Date.now()),this._messages=[].concat(gt(this._messages),[{id:o,role:"assistant",content:"",createdAt:(new Date).toISOString(),isStreaming:!0}]),this._isExecuting=!0,this._error=null,this._notify(),r="kai"===this._agentId,i=r?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,c=this._messages.length-1,e.next=19,this._networkManager.streamAgent(this._agentId,a,{onMeta:function(e){l._destroyed||(e.conversationId&&(l._conversationId=e.conversationId,l._networkManager._invalidateMessagesCache(e.conversationId),s&&l._onConversationCreated&&l._onConversationCreated(e.conversationId)),e.runId&&l._messages[c]&&(l._messages[c]=ft(ft({},l._messages[c]),{},{id:e.runId})))},onToken:function(e){if(!l._destroyed){var t=l._messages[c];t&&(t.content+=e.content||""),l._notify(),l._onToken&&l._onToken(e)}},onDone:function(e){if(!l._destroyed){var t=l._messages[c];t&&(t.isStreaming=!1,e.response&&!t.content&&(t.content=e.response)),l._isExecuting=!1,l._abortController=null,l._notify(),l._onReplyReceived&&l._onReplyReceived(e)}},onError:function(e){if(!l._destroyed){var t=l._messages[c];t&&!t.content?l._messages.splice(c,1):t&&(t.isStreaming=!1),l._isExecuting=!1,l._error=e,l._abortController=null,l._notify(),l._onError&&l._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,o){var i=r.apply(e,t);function a(e){vt(i,n,o,a,s,"next",e)}function s(e){vt(i,n,o,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?ft(ft({},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(),S.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&&yt(t.prototype,n),o&&yt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();const kt=wt;var xt={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"}},St="eu";function Ct(e){return Ct="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},Ct(e)}function It(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Rt(o.key),o)}}function Tt(e,t,n){return t=At(t),function(e,t){if(t&&("object"===Ct(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Et(e)}(e,Ot()?Reflect.construct(t,n||[],At(e).constructor):t.apply(e,n))}function Et(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lt(e){var t="function"==typeof Map?new Map:void 0;return Lt=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Ot())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var r=new(e.bind.apply(e,o));return n&&Mt(r,n.prototype),r}(e,arguments,At(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Mt(n,e)},Lt(e)}function Ot(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ot=function(){return!!e})()}function Mt(e,t){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mt(e,t)}function At(e){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},At(e)}function Pt(e,t,n){return(t=Rt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rt(e){var t=function(e,t){if("object"!=Ct(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ct(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ct(t)?t:String(t)}var _t="https://outboundmedia.gleap.io/agent-conversation",Nt=function(e){_t=e};function Dt(e){return Dt="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},Dt(e)}function jt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Bt(o.key),o)}}function Ft(e,t,n){return(t=Bt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bt(e){var t=function(e,t){if("object"!=Dt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Dt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Dt(t)?t:String(t)}var Ht=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ft(this,"eventListeners",{})}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"notifyEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("flow-started"===e){var n=cp.getInstance();n.setGlobalDataItem("webReplay",null),n.setGlobalDataItem("screenRecordingData",null),n.takeCurrentReplay()}var o=this.getInstance().eventListeners[e];if(o)for(var r=0;r<o.length;r++){var i=o[r];i&&i(t)}}},{key:"on",value:function(e,t){var n=this.getInstance();n.eventListeners[e]||(n.eventListeners[e]=[]),n.eventListeners[e].push(t)}}],(n=null)&&jt(t.prototype,n),o&&jt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ut(e){return Ut="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},Ut(e)}function qt(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 zt(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 zt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Wt(){Wt=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new M(o||[]);return r(a,"_invoke",{value:T(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(A([])));x&&x!==n&&o.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(r,i,a,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==Ut(u)&&o.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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,o){function r(){return new t((function(t,r){n(e,o,t,r)}))}return i=i?i.then(r,r):r()}})}function T(t,n,o){var r=p;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw a;return{value:e,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=E(s,o);if(c){if(c===m)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===p)throw r=g,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=h;var l=d(t,n,o);if("normal"===l.type){if(r=o.done?g:f,l.arg===m)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(r=g,o.method="throw",o.arg=l.arg)}}}function E(t,n){var o=n.method,r=t.iterator[o];if(r===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),m;var i=d(r,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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(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 r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Ut(t)+" is not iterable")}return y.prototype=b,r(S,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new I(u(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=A,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(o,r){return s.type="throw",s.arg=t,n.next=o,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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 o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:A(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),m}},t}function Gt(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(o,r)}function Vt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Xt(o.key),o)}}function Kt(e,t,n){return(t=Xt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xt(e){var t=function(e,t){if("object"!=Ut(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ut(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ut(t)?t:String(t)}Ft(Ht,"instance",void 0);var Jt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Kt(this,"agentTools",[]),Kt(this,"agentToolCallbacks",[]),Kt(this,"registeredAgentTools",{}),Kt(this,"runningToolExecutions",{})}var t,n,o,r,i;return t=e,n=[{key:"setAgentTools",value:function(e){this.agentTools=e||[]}},{key:"getAgentTools",value:function(){return this.agentTools}},{key:"registerAgentToolAction",value:function(e){e&&this.agentToolCallbacks.push(e)}},{key:"registerAgentTool",value:function(e,t){e&&"function"==typeof t&&(this.registeredAgentTools[e]=t)}},{key:"executeToolAction",value:function(e){var t=e.toolCallId,n=e.name,o=e.params;if(t&&this.runningToolExecutions[t])return this.runningToolExecutions[t];var r=this._runToolAction({toolCallId:t,name:n,params:o});return t&&(this.runningToolExecutions[t]=r),r}},{key:"_runToolAction",value:(r=Wt().mark((function e(t){var n,o,r,i,a,s,c;return Wt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.toolCallId,o=t.name,r=t.params,i=this.registeredAgentTools[o]){e.next=6;break}a="No handler registered for tool '".concat(o,"' in the app. Register one via Gleap.registerAgentTool('").concat(o,"', handler)."),e.next=17;break;case 6:return e.prev=6,e.next=9,i(null!=r?r:{});case 9:s=e.sent,(a="string"==typeof s?s:JSON.stringify(null!=s?s:""))||(a="The action completed without returning a result."),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(6),a="Tool execution failed: ".concat(null!==(c=null===e.t0||void 0===e.t0?void 0:e.t0.message)&&void 0!==c?c:"unknown error");case 17:return Ht.notifyEvent("agent-tool-executed",{name:o,params:null!=r?r:{},result:a,toolCallId:n}),e.abrupt("return",{toolCallId:n,name:o,result:a});case 19:case"end":return e.stop()}}),e,this,[[6,14]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function a(e){Gt(i,n,o,a,s,"next",e)}function s(e){Gt(i,n,o,a,s,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"triggerToolAction",value:function(e){if(e){Ht.notifyEvent("agent-tool-executed",e);var t,n=qt(this.agentToolCallbacks);try{for(n.s();!(t=n.n()).done;){var o=t.value;try{o(e)}catch(r){}}}catch(i){n.e(i)}finally{n.f()}}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Vt(t.prototype,n),o&&Vt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Yt(){Yt=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new M(o||[]);return r(a,"_invoke",{value:T(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(A([])));x&&x!==n&&o.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(r,i,a,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==Qt(u)&&o.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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,o){function r(){return new t((function(t,r){n(e,o,t,r)}))}return i=i?i.then(r,r):r()}})}function T(t,n,o){var r=p;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw a;return{value:e,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=E(s,o);if(c){if(c===m)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===p)throw r=g,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=h;var l=d(t,n,o);if("normal"===l.type){if(r=o.done?g:f,l.arg===m)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(r=g,o.method="throw",o.arg=l.arg)}}}function E(t,n){var o=n.method,r=t.iterator[o];if(r===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),m;var i=d(r,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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(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 r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Qt(t)+" is not iterable")}return y.prototype=b,r(S,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new I(u(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=A,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(o,r){return s.type="throw",s.arg=t,n.next=o,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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 o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:A(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),m}},t}function $t(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(o,r)}function Zt(e){return function(){var t=this,n=arguments;return new Promise((function(o,r){var i=e.apply(t,n);function a(e){$t(i,o,r,a,s,"next",e)}function s(e){$t(i,o,r,a,s,"throw",e)}a(void 0)}))}}function Qt(e){return Qt="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},Qt(e)}function en(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function tn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?en(Object(n),!0).forEach((function(t){on(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):en(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,rn(o.key),o)}}function on(e,t,n){return(t=rn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rn(e){var t=function(e,t){if("object"!=Qt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Qt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qt(t)?t:String(t)}Kt(Jt,"instance",void 0);var an=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),on(this,"chatbarContainer",null),on(this,"chatbarFrame",null),on(this,"config",null),on(this,"isHidden",!0),on(this,"manuallyHidden",!1),on(this,"manuallyShown",!1),on(this,"comReady",!1),on(this,"pendingMessages",[]),on(this,"chatbarStyle",null),on(this,"_panelOpen",!1),on(this,"agentId",null),on(this,"agentName",null),on(this,"agentContext",null),this._listenForMessages(),this._listenForOutsideClicks()}var t,n,o,r,i;return t=e,n=[{key:"chatbarUrl",get:function(){return"".concat(Wa.getInstance().frameUrl.replace(/\/$/,""),"/chatbar")}},{key:"_listenForOutsideClicks",value:function(){var e=this;document.addEventListener("click",(function(t){e.chatbarContainer&&(e.chatbarContainer.contains(t.target)||e._suppressOutsideClick||e._postMessageRaw({name:"chatbar-outside-click"}))}))}},{key:"_listenForMessages",value:function(){var e=this;window.addEventListener("message",(function(t){if(e.chatbarFrame&&t.source===e.chatbarFrame.contentWindow)try{var n,o=JSON.parse(t.data);if(!o||!o.name)return;if("ping"===o.name)return e.comReady=!0,e._sendSessionUpdate(),e._sendConfigUpdate(),e._flushPendingMessages(),void e.setPanelOpen(!0);if("collect-ticket-data"===o.name)return void Wa.getInstance().answerCollectTicketData(e.chatbarFrame,o);if("chatbar-panel-state"===o.name)return void e.setPanelOpen(!(null===(n=o.data)||void 0===n||!n.isOpen));if("chatbar-resize"===o.name&&o.data)return void e._resizeFrame(o.data);if("chatbar-panel-blur"===o.name&&o.data)return void e._updateBlurBackdrop(o.data);if("close-widget"===o.name)return void e.setPanelOpen(!1);if("open-url"===o.name){var r=o.data,i=!!o.newTab;try{Wa.getInstance().urlHandler(r,i)}catch(a){}return}if("tool-execution"===o.name&&o.data)return Ht.notifyEvent("tool-execution",o.data),void Jt.getInstance().triggerToolAction(o.data);if("frontend-tool-execute"===o.name&&o.data)return void Jt.getInstance().executeToolAction(o.data).then((function(t){e._postMessageRaw({name:"frontend-tool-result",data:t})}));if("notify-event"===o.name&&o.data)return void Ht.notifyEvent(o.data.type,o.data.data);if("chatbar-notification-read"===o.name)return void e.hideChatbarNotification()}catch(a){}}))}},{key:"_postMessageRaw",value:function(e){try{var t;if(!this.comReady||null===(t=this.chatbarFrame)||void 0===t||!t.contentWindow)return void this.pendingMessages.push(e);this.chatbarFrame.contentWindow.postMessage(JSON.stringify(e),"*")}catch(n){}}},{key:"_flushPendingMessages",value:function(){var e=this,t=this.pendingMessages||[];this.pendingMessages=[],t.forEach((function(t){return e._postMessageRaw(t)}))}},{key:"_sendSessionUpdate",value:function(){this._postMessageRaw({name:"session-update",data:{sessionData:ba.getInstance().getSession(),apiUrl:ba.getInstance().apiUrl,realtimeHost:ba.getInstance().realtimeHost,sdkKey:ba.getInstance().sdkKey}})}},{key:"_sendConfigUpdate",value:function(){this._postMessageRaw({name:"config-update",data:{config:this._withChatbarConfig(zn.getInstance().getFlowConfig()),aiTools:Jt.getInstance().getAgentTools(),agentTools:Jt.getInstance().getAgentTools(),overrideLanguage:Yd.getInstance().getOverrideLanguage()}})}},{key:"_withChatbarConfig",value:function(e){var t,n,o,r,i,a=e||{};return tn(tn({},a),{},{chatbarPlaceholder:null===(t=this.config)||void 0===t?void 0:t.placeholder,chatbarQuickActions:(null===(n=this.config)||void 0===n?void 0:n.quickActions)||[],chatbarStyle:null===(o=this.config)||void 0===o?void 0:o.style,chatbarColor:null==a?void 0:a.color,chatbarWorkflowId:null!==(r=null===(i=this.config)||void 0===i?void 0:i.workflowId)&&void 0!==r?r:null})}},{key:"setPanelOpen",value:function(e){this._panelOpen=!!e,this._postMessageRaw({name:"widget-status-update",data:{isWidgetOpen:!!e}})}},{key:"showChatbarNotification",value:function(e){var t,n;this._postMessageRaw({name:"chatbar-notification",data:{sender:null==e||null===(t=e.sender)||void 0===t?void 0:t.name,text:null==e?void 0:e.text,shareToken:null==e||null===(n=e.conversation)||void 0===n?void 0:n.shareToken}})}},{key:"hideChatbarNotification",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._postMessageRaw({name:"chatbar-notification-clear"}),!e)try{var t;Hd.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=ba.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 o=window.innerWidth-20;this.chatbarContainer.style.width=Math.min(Math.ceil(t),o)+"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,o=e.bottom,r=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 c=this.blurBackdrop.style;c.top=(null!=n?n:0)+"px",c.bottom=(null!=o?o:0)+"px",c.left=(null!=r?r:0)+"px",c.right=(null!=i?i:0)+"px",c.height="auto",c.borderRadius=(null!=a?a:20)+"px",s?(c.background="rgba(40, 40, 40, 0.55)",c.backdropFilter="blur(20px) saturate(140%) brightness(0.75)",c.webkitBackdropFilter="blur(20px) saturate(140%) brightness(0.75)"):(c.background="rgba(255, 255, 255, 0.45)",c.backdropFilter="blur(20px) saturate(150%) brightness(1.04)",c.webkitBackdropFilter="blur(20px) saturate(150%) brightness(1.04)"),c.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(zn.getInstance().getFlowConfig()),aiTools:Jt.getInstance().getAgentTools(),agentTools:Jt.getInstance().getAgentTools(),overrideLanguage:Yd.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===Qt(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=zn.getInstance().getFlowConfig()||{};return(null==n||null===(t=n.aiBar)||void 0===t?void 0:t.workflowId)||null}catch(o){return null}}},{key:"_validateAgent",value:(i=Zt(Yt().mark((function e(t){var n,o,r,i,a,s,c;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=ba.getInstance(),i=r.apiUrl||xt[St].apiUrl,a={},r.sdkKey&&(a["Api-Token"]=r.sdkKey),null!==(n=r.session)&&void 0!==n&&n.gleapId&&(a["Gleap-Id"]=r.session.gleapId),null!==(o=r.session)&&void 0!==o&&o.gleapHash&&(a["Gleap-Hash"]=r.session.gleapHash),e.next=9,fetch("".concat(i,"/v3/shared/agents/").concat(encodeURIComponent(t)),{headers:a});case 9:if((s=e.sent).ok){e.next=12;break}return e.abrupt("return",null);case 12:return e.next=14,s.json();case 14:if((c=e.sent)&&!c.error){e.next=17;break}return e.abrupt("return",null);case 17:return this.agentId=t,this.agentName=c.name||"AI Agent",e.abrupt("return",c);case 22:return e.prev=22,e.t0=e.catch(0),e.abrupt("return",null);case 25:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e){return i.apply(this,arguments)})},{key:"showWithAgent",value:(r=Zt(Yt().mark((function e(t,n){var o,r,i=this;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this._normalizeAgentOptions(n),this._suppressOutsideClick=!0,clearTimeout(this._suppressOutsideClickTimeout),this._suppressOutsideClickTimeout=setTimeout((function(){i._suppressOutsideClick=!1}),600),(r=t)&&"default"!==r||(r=this._getDefaultAgentId()||"kai"),!r||"kai"===r){e.next=13;break}return this.agentId=r,this.agentName=null,e.next=11,this._validateAgent(r);case 11:e.next=15;break;case 13:this.agentId="kai",this.agentName=null;case 15:o.context&&(this.agentContext=o.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:o.initialQuestion||void 0,initialMessage:o.initialMessage||void 0}});case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"updateUIVisibility",value:function(){var e;Wa.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||le((function(){return e._injectUI()}))}},{key:"_injectUI",value:function(){if(document.body&&!this.chatbarContainer){var e={};try{e=zn.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 o=document.createElement("style");G(o),o.id="gleap-chatbar-styles",o.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(o)}var r=document.createElement("div");r.className="gleap-chatbar",r.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 ",r.appendChild(a),r.appendChild(i),document.body.appendChild(r),this.chatbarContainer=r,this.chatbarFrame=i,this.blurBackdrop=a,Y(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}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&nn(t.prototype,n),o&&nn(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function sn(e){return sn="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},sn(e)}function cn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,un(o.key),o)}}function ln(e,t,n){return(t=un(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function un(e){var t=function(e,t){if("object"!=sn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=sn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==sn(t)?t:String(t)}on(an,"instance",void 0);var dn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,o;return t=e,o=[{key:"playSound",value:function(e){this.settings.play=e}},{key:"ping",value:function(){try{if(!this.settings.play)return;this.audio||(this.audio=new Audio("https://js.gleap.io/res/ping.mp3"));var e=this.audio.play();void 0!==e&&e.then((function(e){})).catch((function(e){}))}catch(t){}}}],(n=null)&&cn(t.prototype,n),o&&cn(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function pn(e){return pn="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},pn(e)}function fn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(n),!0).forEach((function(t){mn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,vn(o.key),o)}}function mn(e,t,n){return(t=vn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vn(e){var t=function(e,t){if("object"!=pn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=pn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pn(t)?t:String(t)}ln(dn,"audio",void 0),ln(dn,"settings",{play:!0});var yn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),mn(this,"bannerUrl","https://outboundmedia.gleap.io"),mn(this,"bannerContainer",null),mn(this,"bannerData",null),mn(this,"disabled",!1),this.startCommunication()}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"setBannerUrl",value:function(e){this.bannerUrl=e}},{key:"startCommunication",value:function(){var e=this;window.addEventListener("message",(function(t){var n,o=e.bannerContainer?e.bannerContainer.querySelector(".gleap-b-frame"):null,r=o&&t.source===o.contentWindow,i=null===(n=e.bannerUrl)||void 0===n?void 0:n.includes(t.origin);if(r||i)try{var a,s,c,l,u,d,p,f,h,g,m,v=JSON.parse(t.data);if("BANNER"!==(null==v?void 0:v.type))return;if("banner-loaded"===v.name&&e.bannerData&&e.sendMessage({name:"banner-data",data:e.bannerData}),"banner-height"===v.name&&document.documentElement.style.setProperty("--gleap-margin-top",v.data.height+"px"),"banner-data-set"===v.name&&(document.body.classList.add("gleap-b-shown"),"floating"===(null===(a=e.bannerData)||void 0===a?void 0:a.format)&&document.body.classList.add("gleap-b-f")),"banner-close"===v.name&&e.removeBannerUI(),"start-conversation"===v.name&&cp.startBot(null===(s=v.data)||void 0===s?void 0:s.botId),"start-custom-action"===v.name&&cp.triggerCustomAction(null===(c=v.data)||void 0===c?void 0:c.action),"start-product-tour"===v.name&&cp.startProductTour(null===(l=v.data)||void 0===l?void 0:l.tourId,!0),"open-url"===v.name){var y=v.data,b=!!v.newTab;Wa.getInstance().urlHandler(y,b)}"show-form"===v.name&&cp.startFeedbackFlow(null===(u=v.data)||void 0===u?void 0:u.formId),"show-survey"===v.name&&cp.showSurvey(null===(d=v.data)||void 0===d?void 0:d.formId,null===(p=v.data)||void 0===p?void 0:p.surveyFormat),"show-news-article"===v.name&&cp.openNewsArticle(null===(f=v.data)||void 0===f?void 0:f.articleId),"show-help-article"===v.name&&cp.openHelpCenterArticle(null===(h=v.data)||void 0===h?void 0:h.articleId),"show-checklist"===v.name&&cp.startChecklist(null===(g=v.data)||void 0===g?void 0:g.checklistId,!0,null===(m=v.data)||void 0===m?void 0:m.sharedKey)}catch(w){}}))}},{key:"removeBannerUI",value:function(){this.bannerContainer&&(document.body.removeChild(this.bannerContainer),this.bannerContainer=null),document.body.classList.remove("gleap-b-shown"),document.body.classList.remove("gleap-b-f")}},{key:"disable",value:function(){this.disabled=!0,this.removeBannerUI()}},{key:"injectBannerUI",value:function(e){if(!document.body)return!1;if(this.disabled)return!1;this.bannerContainer&&this.removeBannerUI(),this.bannerData=e;var t=document.createElement("div");t.className="gleap-b",t.innerHTML='<iframe class="gleap-b-frame" scrolling="no" title="Gleap Banner" role="dialog" frameborder="0"></iframe>',document.body.appendChild(t),this.bannerContainer=t;var n=t.querySelector(".gleap-b-frame");n&&Y(n,this.bannerUrl)}},{key:"sendMessage",value:function(e){try{var t=document.querySelector(".gleap-b-frame");t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(hn(hn({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){this.injectBannerUI(e)}}])&&gn(t.prototype,n),o&&gn(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function bn(e){return bn="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},bn(e)}function wn(e){return function(e){if(Array.isArray(e))return kn(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 kn(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 kn(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 kn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function xn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Mn(o.key),o)}}function Sn(e,t,n){return t=Ln(t),function(e,t){if(t&&("object"===bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Cn(e)}(e,Tn()?Reflect.construct(t,n||[],Ln(e).constructor):t.apply(e,n))}function Cn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function In(e){var t="function"==typeof Map?new Map:void 0;return In=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Tn())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var r=new(e.bind.apply(e,o));return n&&En(r,n.prototype),r}(e,arguments,Ln(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),En(n,e)},In(e)}function Tn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tn=function(){return!!e})()}function En(e,t){return En=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},En(e,t)}function Ln(e){return Ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ln(e)}function On(e,t,n){return(t=Mn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mn(e){var t=function(e,t){if("object"!=bn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=bn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bn(t)?t:String(t)}mn(yn,"instance",void 0);function An(e){return An="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},An(e)}function Pn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Rn(o.key),o)}}function Rn(e){var t=function(e,t){if("object"!=An(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=An(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==An(t)?t:String(t)}var _n,Nn,Dn,jn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,o;return t=e,n=[{key:"start",value:function(){document.addEventListener("click",(function(e){if(e.target){var t=e.target.closest?e.target.closest("a"):null;t&&"gleap:"===t.protocol&&(e.preventDefault(),sp(t.href)),Wa.getInstance().isOpened()||Yn.getInstance().addLog(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=ie(e.innerText||"",40).replace(/(\r\n|\n|\r)/gm,"").replace(/ +(?= )/g,""),o="",r="";if(void 0!==e.getAttribute){var i=e.getAttribute("id");i&&(o=' id="'.concat(i,'"'));var a=e.getAttribute("class");a&&(r=' class="'.concat(a,'"'))}var s=(e.tagName||"").toLowerCase(),c="<",l=">";return t||(c="[",l="]"),"".concat(c).concat(s).concat(o).concat(r).concat(l).concat(n).concat(c,"/").concat(s).concat(l)}(e.target),"CLICK")}}))}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Pn(t.prototype,n),o&&Pn(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Fn(e){return Fn="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},Fn(e)}function Bn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Un(o.key),o)}}function Hn(e,t,n){return(t=Un(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Un(e){var t=function(e,t){if("object"!=Fn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Fn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Fn(t)?t:String(t)}_n=jn,Dn=void 0,(Nn=Rn(Nn="instance"))in _n?Object.defineProperty(_n,Nn,{value:Dn,enumerable:!0,configurable:!0,writable:!0}):_n[Nn]=Dn;var qn=function(e,t){var n=parseInt(e);return isNaN(n)?t:n},zn=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Hn(this,"flowConfig",null),Hn(this,"projectActions",null),Hn(this,"onConfigLoadedListener",[]),Hn(this,"onConfigLoaded",(function(e){null!==t.flowConfig?e():t.onConfigLoadedListener.push(e)})),Hn(this,"start",(function(){var e=ba.getInstance(),n=se("config-".concat(e.sdkKey,"-").concat(Yd.getInstance().getActiveLanguage()));return n?(t.applyConfig(n),t.loadConfigFromServer().catch((function(e){})),Promise.resolve()):t.loadConfigFromServer()})),Hn(this,"loadConfigFromServer",(function(){var e=t;return new Promise((function(t,n){var o=ba.getInstance(),r=new XMLHttpRequest,i=Yd.getInstance().getActiveLanguage();r.open("GET",o.apiUrl+"/config/"+o.sdkKey+"?lang="+i),r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.injectSession(r),r.onerror=function(){n()},r.onreadystatechange=function(a){if(4===r.readyState){if(403===r.status&&(!function(e){try{var t="gleap-widget-".concat(e);localStorage.removeItem(t)}catch(n){}}("config-".concat(o.sdkKey,"-").concat(i)),cp.destroy()),200===r.status||201===r.status)try{var s=JSON.parse(r.responseText);try{ce("config-".concat(o.sdkKey,"-").concat(i),s)}catch(c){}return e.applyConfig(s),t()}catch(a){}n()}},r.send()}))}))}var t,n,o;return t=e,n=[{key:"getFlowConfig",value:function(){return this.flowConfig}},{key:"applyStylesFromConfig",value:function(){var e=this.flowConfig;cp.setStyles(e.color?e.color:"#485BFF",e.headerColor?e.headerColor:"#485BFF",e.buttonColor?e.buttonColor:"#485BFF",e.backgroundColor?e.backgroundColor:"#FFFFFF",qn(e.borderRadius,20),qn(e.buttonX,20),qn(e.buttonY,20),e.feedbackButtonPosition,e.headerColor2,e.headerColor3)}},{key:"notifyConfigLoaded",value:function(){if(this.onConfigLoadedListener.length>0)for(var e=0;e<this.onConfigLoadedListener.length;e++)this.onConfigLoadedListener[e]();this.onConfigLoadedListener=[]}},{key:"applyConfig",value:function(e){try{var t=e.flowConfig;this.flowConfig=t,this.applyStylesFromConfig(),Wa.getInstance().sendConfigUpdate(),D.getInstance().updateFeedbackButtonState(),Ls.getInstance().updateContainerStyle(),t.enableWebReplays?Id.getInstance().startIfNotRunning():Id.getInstance().stop(),t.enableNetworkLogs&&Ss.getInstance().start(),Ss.getInstance().setLoadAllResources(!!t.sendNetworkResources),t.networkLogPropsToIgnore&&Ss.getInstance().setFilters(t.networkLogPropsToIgnore),t.networkLogBlacklist&&Ss.getInstance().setBlacklist(t.networkLogBlacklist),Yd.getInstance().updateRTLSupport(),cp.enableShortcuts(!!t.enableShortcuts),e.aiBar&&an.getInstance().setConfig(e.aiBar),this.notifyConfigLoaded()}catch(n){}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Bn(t.prototype,n),o&&Bn(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Wn(e){return Wn="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},Wn(e)}function Gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Vn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gn(Object(n),!0).forEach((function(t){Xn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kn(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Jn(o.key),o)}}function Xn(e,t,n){return(t=Jn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jn(e){var t=function(e,t){if("object"!=Wn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Wn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wn(t)?t:String(t)}Hn(zn,"instance",void 0);var Yn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Xn(this,"logArray",[]),Xn(this,"disabled",!1),Xn(this,"originalConsoleLog",void 0),Xn(this,"logMaxLength",500)}var t,n,o;return t=e,n=[{key:"getLogs",value:function(){return this.logArray}},{key:"stop",value:function(){this.disabled=!0,this.originalConsoleLog&&(window.console=this.originalConsoleLog)}},{key:"addLog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";!e||e.length<=0||(this.logArray.push({log:ie(e,1e3),date:new Date,priority:t}),this.logArray.length>this.logMaxLength&&this.logArray.shift())}},{key:"addLogWithArgs",value:function(e,t){if(e&&!(e.length<=0)){var n="";try{for(var o=0;o<e.length;o++)n+=e[o]+" "}catch(r){}this.addLog(n,t)}}},{key:"start",value:function(){if(!this.disabled){var e,t=this;window.console=(e=window.console,window.console&&e||(e={}),t.originalConsoleLog=e,Vn(Vn({},e),{},{log:function(){t.addLogWithArgs(arguments,"INFO"),e.log&&e.log.apply(e,arguments)},warn:function(){t.addLogWithArgs(arguments,"WARNING"),e.warn&&e.warn.apply(e,arguments)},error:function(){t.addLogWithArgs(arguments,"ERROR"),e.error&&e.error.apply(e,arguments)},info:function(n){t.addLogWithArgs(arguments,"INFO"),e.info&&e.info.apply(e,arguments)}}))}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Kn(t.prototype,n),o&&Kn(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 Zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Qn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(n),!0).forEach((function(t){to(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function eo(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,no(o.key),o)}}function to(e,t,n){return(t=no(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function no(e){var t=function(e,t){if("object"!=$n(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=$n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$n(t)?t:String(t)}Xn(Yn,"instance",void 0);var oo=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),to(this,"customActionCallbacks",[])}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"registerCustomAction",value:function(e){var t=this.getInstance();t.customActionCallbacks&&t.customActionCallbacks.push(e)}},{key:"triggerCustomAction",value:function(e,t){var n=this.getInstance();if(n.customActionCallbacks)for(var o=0;o<n.customActionCallbacks.length;o++){var r=n.customActionCallbacks[o];r&&r(Qn({name:e},t||{}))}}}],(n=null)&&eo(t.prototype,n),o&&eo(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ro(e){return ro="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},ro(e)}function io(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,so(o.key),o)}}function ao(e,t,n){return(t=so(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function so(e){var t=function(e,t){if("object"!=ro(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=ro(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ro(t)?t:String(t)}to(oo,"instance",void 0);var co=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ao(this,"customData",{}),ao(this,"ticketAttributes",{})}var t,n,o;return t=e,n=[{key:"getCustomData",value:function(){return this.customData}},{key:"attachCustomData",value:function(e){this.customData=Object.assign(this.customData,te(e))}},{key:"setCustomData",value:function(e,t){this.customData[e]=t}},{key:"removeCustomData",value:function(e){delete this.customData[e]}},{key:"clearCustomData",value:function(){this.customData={}}},{key:"setTicketAttribute",value:function(e,t){this.ticketAttributes[e]=t}},{key:"unsetTicketAttribute",value:function(e){delete this.ticketAttributes[e]}},{key:"clearTicketAttributes",value:function(){this.ticketAttributes={}}},{key:"getTicketAttributes",value:function(){return this.ticketAttributes}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&io(t.prototype,n),o&&io(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function lo(e){return lo="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},lo(e)}function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function po(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach((function(t){fo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fo(e,t,n){return t=function(e){var t=function(e,t){if("object"!=lo(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=lo(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lo(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}ao(co,"instance",void 0);var ho=["current-password","new-password","one-time-code","cc-number","cc-csc"],go=["checkbox","radio","submit","button","reset"],mo=function(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})},vo=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week","textarea","select","password"],yo=mo(vo),bo=mo(vo.filter((function(e){return"select"!==e})).concat(["hidden"])),wo=function(e){return"*".repeat(null==e?0:String(e).length)},ko=function(e){return e.hasAttribute&&e.hasAttribute("data-rr-is-password")?"password":e.type?String(e.type).toLowerCase():""},xo=function(e,t){try{return!!t&&e.matches(t)}catch(n){return!1}},So=function(e,t){if(!t||!e.classList)return!1;if("string"==typeof t)return e.classList.contains(t);if("function"==typeof t.test)for(var n=0;n<e.classList.length;n++)if(t.test(e.classList[n]))return!0;return!1},Co=function(e,t){return t=t||{},xo(e,".rr-mask, .gl-mask")||So(e,t.maskTextClass)||xo(e,t.maskTextSelector)},Io=function(e){return!0===e.maskAllInputs?yo:void 0!==e.maskInputOptions?e.maskInputOptions||{}:{password:!0}},To=function(e,t){if(t=t||{},!e)return wo;if(go.indexOf(ko(e))>=0)return null;if(function(e){if("password"===ko(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return ho.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 Co(e,t)||xo(e,'[gleap-ignore="value"]')}))}(e,t))return wo;if(!function(e,t){var n=Io(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[ko(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?wo:function(t){try{return n(t,e)}catch(o){return wo(t)}}},Eo=function(e){return String(e).replace(/[\S]/g,"*")},Lo=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?Eo:function(e,n){try{var o=t(e,n);return"string"==typeof o?o:Eo(e)}catch(r){return Eo(e)}}};function Oo(e){return Oo="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},Oo(e)}function Mo(){Mo=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new M(o||[]);return r(a,"_invoke",{value:T(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(A([])));x&&x!==n&&o.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(r,i,a,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==Oo(u)&&o.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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,o){function r(){return new t((function(t,r){n(e,o,t,r)}))}return i=i?i.then(r,r):r()}})}function T(t,n,o){var r=p;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw a;return{value:e,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=E(s,o);if(c){if(c===m)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===p)throw r=g,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=h;var l=d(t,n,o);if("normal"===l.type){if(r=o.done?g:f,l.arg===m)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(r=g,o.method="throw",o.arg=l.arg)}}}function E(t,n){var o=n.method,r=t.iterator[o];if(r===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),m;var i=d(r,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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(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 r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Oo(t)+" is not iterable")}return y.prototype=b,r(S,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new I(u(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=A,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(o,r){return s.type="throw",s.arg=t,n.next=o,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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 o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:A(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),m}},t}function Ao(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(o,r)}function Po(e){return function(){var t=this,n=arguments;return new Promise((function(o,r){var i=e.apply(t,n);function a(e){Ao(i,o,r,a,s,"next",e)}function s(e){Ao(i,o,r,a,s,"throw",e)}a(void 0)}))}}function Ro(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 o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _o(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 _o(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 _o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var No=function(e){var t="",n=window.document.doctype;if(n&&(t="<!DOCTYPE "+n.name+(n.publicId?' PUBLIC "'+n.publicId+'"':"")+(!n.publicId&&n.systemId?" SYSTEM":"")+(n.systemId?' "'+n.systemId+'"':"")+">"),e&&e.childNodes&&e.childNodes.length>0)for(var o=0;o<e.childNodes.length;o++)e.childNodes[o]&&(t+=e.childNodes[o].outerHTML);return t},Do=function(e,t,n){return o=e,r=/url\((.*?)\)/g,i=function(e){return new Promise((function(o,r){if(!e)return o(e);var i=e.substr(4,e.length-5).replaceAll("'","").replaceAll('"',"");if(0===i.indexOf("http")||0===i.indexOf("//")||0===i.indexOf("data"))return o(e);try{var a=i;return t&&(a=new URL(i,t+"/").href),n?o("url("+a+")"):jo(a).then((function(e){return o("url("+e+")")}))}catch(s){return o(e)}}))},new Promise((function(e,t){var n=[];o.replace(r,(function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];var a=i.apply(void 0,[e].concat(o));n.push(a)})),Promise.all(n).then((function(t){e(o.replace(r,(function(){return t.shift()})))})).catch((function(){t()}))}));var o,r,i},jo=function(e){return new Promise((function(t,n){if(e){var o=new XMLHttpRequest;o.onload=function(){var e=new FileReader;e.onloadend=function(){t(e.result)},e.onerror=function(){n()},e.readAsDataURL(o.response)},o.onerror=function(e){t()},o.open("GET",e),o.responseType="blob",o.send()}else t()}))},Fo=function(e){return new Promise((function(t,n){if(e&&e.src){if(function(e){var t=["//fonts.googleapis.com","//cdn.jsdelivr.net","//cdnjs.cloudflare.com","//ajax.googleapis.com","//use.typekit.net",".amazonaws.com","//jssdk.gleap.io",".gstatic.com"];if(!e)return!1;for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n]))return!0;return!1}(e.src))return t();var o=new XMLHttpRequest;o.onload=function(){var n=new FileReader;n.onloadend=function(){!function(e,t,n,o){$(e,500,500).then((function(e){t.src=e,n()})).catch((function(){console.warn("BB: Image resize failed."),n()}))}(n.result,e,t)},n.onerror=function(){t()},n.readAsDataURL(o.response)},o.onerror=function(e){t()};var r=e.src;o.open("GET",r),o.responseType="blob",o.send()}else t()}))},Bo=function(e,t,n,o){var r=null;t.ownerNode&&(r=e.querySelector('[bb-styleid="'+o+'"]'));try{if(r){var i=null;if(""!=n){var a=e.querySelector("head"),s=window.document.createElement("style");a.appendChild(s),s.type="text/css",s.styleSheet?s.styleSheet.cssText=n:s.appendChild(window.document.createTextNode(n)),i=s}else{var c=window.document.createElement("link");c.rel="stylesheet",c.type=t.type,c.href=t.href,c.media=t.media,i=c}i&&(r.parentNode.insertBefore(i,r),r.remove())}}catch(l){}},Ho=function(e){var t=null;try{e.cssRules?t=e.cssRules:e.rules&&(t=e.rules)}catch(r){}var n="";if(t)for(var o in t)t[o].cssText&&(n+=t[o].cssText+"\n");return function(e){for(var t="",n=0,o=0;o<e.length;o++)"{"===e[o]?(n++,t+=e[o]):"}"===e[o]?n>0&&(n--,t+=e[o]):t+=e[o];return t}(n)},Uo=function(e,t){for(var n,o=[],r=function(){var e=document.styleSheets[i];if(e.media&&"print"===e.media.mediaText)return 1;var r=Ho(e);if(e&&e.ownerNode)if(""!=r){var a=document.getElementsByTagName("base");n=a.length?a[0].href.substr(location.origin.length,999):window.location.href.split(/[?#]/)[0],e.href&&(n=e.href);var s=n.substring(0,n.lastIndexOf("/"));o.push(Do(r,s,t).then((function(t){return{styletext:t,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}})))}else o.push(Promise.resolve({styletext:r,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}))},i=0;i<document.styleSheets.length;i++)r();return Promise.all(o).then((function(t){if(t)for(var n=0;n<t.length;n++)Bo(e,t[n].stylesheet,t[n].styletext,t[n].styleId);return!0}))},qo=function(e,t){return new Promise((function(n,o){return t?Uo(e,t).then((function(){n()})).catch((function(){n()})):function(e){for(var t=e.querySelectorAll("img"),n=[],o=0;o<t.length;o++){var r=t[o];n.push(Fo(r))}return Promise.all(n)}(e).then((function(){return Uo(e,t).then((function(){n()}))})).catch((function(){console.warn("Gleap: Failed with resolving local resources. Please contact the Gleap support team."),n()}))}))},zo=function(e,t,n){if(void 0!==e.adoptedStyleSheets)for(var o=0;o<e.adoptedStyleSheets.length;o++){var r=e.adoptedStyleSheets[o],i=Ho(r),a=window.document.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=i:a.appendChild(window.document.createTextNode(i)),n&&a.setAttribute("bb-shadow-child",n),t.insertBefore(a,t.firstElementChild)}},Wo=function(e,t){try{if(!t||"function"!=typeof t.getAnimations)return e;for(var n=t.getAnimations(),o=0;o<n.length;o++){var r=n[o].effect&&n[o].effect.target;if(r){var i=e.get(r);i?i.push(n[o]):e.set(r,[n[o]])}}}catch(a){}return e},Go=function(e,t){var n=t.get(e);if(!n)return null;var o={},r=getComputedStyle(e);return n.forEach((function(e){var t,n=(null===(t=e.effect)||void 0===t?void 0:t.getKeyframes())||[],i=n[n.length-1]||{};Object.keys(i).forEach((function(e){"offset"!==e&&(o[e]=r[e])}))})),0===Object.keys(o).length?null:JSON.stringify(o)},Vo=["position","top","right","bottom","left","float","clear","margin-top","margin-right","margin-bottom","margin-left","overflow-x","overflow-y","order","align-self","justify-self","grid-row-start","grid-row-end","grid-column-start","grid-column-end","vertical-align","font-family","font-size","line-height"],Ko=/^table-(row-group|header-group|footer-group|row|column-group)$/,Xo=["box-sizing","width","height","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style"],Jo=/^(img|video|audio|canvas|iframe|embed|object|svg)$/,Yo=/^(input|select|textarea)$/,$o=function(e,t,n){return e.setProperty(t,n,"important")},Zo=function(e,t){return parseFloat(e.getPropertyValue(t))||0},Qo=function(e,t,n){$o(e,"box-sizing","border-box"),["width","min-width","max-width"].forEach((function(n){return $o(e,n,t+"px")})),["height","min-height","max-height"].forEach((function(t){return $o(e,t,n+"px")}))},er=function(e){return"inline"===e.display&&"auto"===e.width},tr=function(e){return"absolute"===e.position||"fixed"===e.position||"none"!==e.float},nr=function(e){return!/^(visible|clip)$/.test(e.overflowX)||!/^(visible|clip)$/.test(e.overflowY)},or=function(e){if(e.shadowRoot)return Array.from(e.shadowRoot.childNodes);var t="function"==typeof e.assignedNodes?e.assignedNodes():[];return Array.from(t.length?t:e.childNodes)},rr=function(e){return e.assignedSlot||e.parentElement||e.parentNode&&e.parentNode.host||null},ir=function(e){var t=document.createRange();return t.selectNodeContents(e),"function"==typeof t.getClientRects?Array.from(t.getClientRects()):[]},ar=function(e,t){var n=parseFloat(t.width),o=parseFloat(t.height);if(isNaN(n)||isNaN(o)){var r=e.getBoundingClientRect();return{width:r.width,height:r.height}}return"border-box"!==t.boxSizing&&(n+=Zo(t,"padding-left")+Zo(t,"padding-right")+Zo(t,"border-left-width")+Zo(t,"border-right-width"),o+=Zo(t,"padding-top")+Zo(t,"padding-bottom")+Zo(t,"border-top-width")+Zo(t,"border-bottom-width")),{width:n,height:o}},sr=function(e,t){var n=function(e,t){return e>0&&t>0&&Math.abs(e-t)>1?e/t:1};return{x:n(e.width,t.width),y:n(e.height,t.height)}},cr=function(e){for(var t=rr(e);t;t=rr(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return sr(t.getBoundingClientRect(),ar(t,n))}return{x:1,y:1}},lr=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}},ur=function(e){var t=e.createElement("span");return $o(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return $o(t.style,e,"0")})),t},dr=function e(t,n,o){return or(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var r=window.getComputedStyle(t);if("none"!==r.display&&!tr(r))if("contents"===r.display||er(r))e(t,n,o);else{var i=lr(t.getBoundingClientRect(),n),a={left:i.left-Zo(r,"margin-left"),right:i.right+Zo(r,"margin-right"),top:i.top-Zo(r,"margin-top"),bottom:i.bottom+Zo(r,"margin-bottom"),verticalAlign:r.verticalAlign};0===r.display.indexOf("inline")?("baseline"!==a.verticalAlign||Jo.test(t.localName)||(a.verticalAlign="middle"),o.atomicInlines.push(a)):o.blocks.push(a)}}})),o},pr=function(e,t,n){var o=function(e){return(e.top+e.bottom)/2},r=[];n.forEach((function(e){for(var n=0,i=1;i<t.length;i++)Math.abs(o(t[i])-o(e))<Math.abs(o(t[n])-o(e))&&(n=i);var a=r[n];(!a||e.bottom-e.top>a.bottom-a.top)&&(r[n]=e)}));for(var i=0;i<t.length;i++){var a=t[i-1];a&&t[i].top>=a.top+a.height/2&&e.appendChild(e.ownerDocument.createElement("br"));var s=r[i],c=ur(e.ownerDocument);$o(c.style,"vertical-align",s?s.verticalAlign:"baseline"),Qo(c.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(c)}},fr=function e(t,n,o){or(n).forEach((function(n){if(n.nodeType!==Node.TEXT_NODE){if(n.nodeType===Node.ELEMENT_NODE){var r=window.getComputedStyle(n).display;"contents"===r?e(t,n,o):"none"!==r&&t.appendChild(Er(n,t.ownerDocument,!0,o))}}else!function(e,t){var n=ir(t);if(n.length){var o=cr(t),r=e.ownerDocument.createElement("span");$o(r.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return $o(r.style,e,"0")})),pr(r,n.map((function(e){return lr(e,o)})),[]),e.appendChild(r)}}(t,n)}))},hr=function(e){return!("block"!==e.display&&"list-item"!==e.display||tr(e)||nr(e)||/layout|paint|strict|content/.test(e.contain))},gr=function(e,t,n,o){if(!(t instanceof HTMLElement))return!1;var r=e.offsetTop,i=e.offsetTop+e.offsetHeight;if(t.offsetParent===e)r=0,i=e.clientHeight;else if(t.offsetParent!==e.offsetParent)return!1;var a=t.offsetTop-("relative"===n.position?Zo(n,"top"):0),s="top"===o?a-r:a+t.offsetHeight-i;return Math.abs(s)<=1},mr=function(e,t,n,o){return o.push(Zo(t,"margin-"+n)),!hr(t)||Zo(t,"padding-"+n)||Zo(t,"border-"+n+"-width")||vr(e,or(e),n,o),o},vr=function e(t,n,o,r){"bottom"===o&&n.reverse();for(var i=0;i<n.length;i++){var a=n[i];if(a.nodeType===Node.TEXT_NODE&&(/[^\t\n\f\r ]/.test((c=a).data)||ir(c).length>0))return!1;if(a.nodeType===Node.ELEMENT_NODE){var s=window.getComputedStyle(a);if("none"!==s.display&&!tr(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!gr(t,a,s,o))return!1;if(mr(a,s,o,r),0!==a.getBoundingClientRect().height||!hr(s))return!1;mr(a,s,"top"===o?"bottom":"top",r)}else if(!e(t,or(a),o,r))return!1}}var c;return!0},yr=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},br=null,wr=new Map,kr=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return wr.has(n)||((br=br||document.createElement("canvas").getContext("2d")).font=n,wr.set(n,br.measureText("").fontBoundingBoxAscent)),wr.get(n)},xr=function e(t,n,o){var r=or(t);n&&r.reverse();for(var i=0;i<r.length;i++){var a=r[i];if(a.nodeType===Node.TEXT_NODE&&/[^\t\n\f\r ]/.test(a.data)){var s=ir(a);if(s.length)return s[n?s.length-1:0].top+kr(rr(a))*o.y}else if(a.nodeType===Node.ELEMENT_NODE){var c=window.getComputedStyle(a);if("none"===c.display||tr(c))continue;if(Jo.test(a.localName)){if("baseline"===c.verticalAlign)return a.getBoundingClientRect().bottom+Zo(c,"margin-bottom")*o.y;continue}var l=e(a,n,o);if(null!==l)return l}}return null},Sr=function(e,t){if("table-cell"===t.display)return"baseline"===t.verticalAlign?"first":null;var n=function(e){for(var t=rr(e);t&&"contents"===window.getComputedStyle(t).display;)t=rr(t);return t}(e),o=n&&window.getComputedStyle(n);if(o&&/flex|grid/.test(o.display)&&!tr(t)){var r=/^(auto|normal)$/.test(t.alignSelf)?o.alignItems:t.alignSelf;return/baseline/.test(r)?/last/.test(r)?"last":"first":null}return 0!==t.display.indexOf("inline-")||/^(top|bottom|middle|text-top|text-bottom)$/.test(t.verticalAlign)||Jo.test(e.localName)||Yo.test(e.localName)?null:"inline-block"===t.display&&"button"!==e.localName?nr(t)?null:"last":"first"},Cr=function(e,t,n){$o(e.style,"font-size","0"),$o(e.style,"line-height","0");var o=ur(e.ownerDocument);$o(o.style,"vertical-align",t-n+"px"),Qo(o.style,0,n),e.appendChild(o)},Ir=function(e,t,n){var o=e.style,r=n.display,i="table-cell"===r,a=ar(t,n);$o(o,"display","inline"===r?"inline-block":r),i?Xo.forEach((function(e){return $o(o,e,n.getPropertyValue(e))})):(Qo(o,a.width,a.height),$o(o,"padding","0"),$o(o,"border-width","0"),$o(o,"margin-top",yr(mr(t,n,"top",[]))+"px"),$o(o,"margin-bottom",yr(mr(t,n,"bottom",[]))+"px"));var s=Sr(t,n);if(s){var c=t.getBoundingClientRect(),l=sr(c,{width:t.offsetWidth,height:t.offsetHeight}),u=xr(t,"last"===s,l);if(null!==u&&!isNaN(u)){var d=(u-c.top)/l.y;if(i){var p=d-t.clientTop-Zo(n,"padding-top");Cr(e,p,p)}else $o(o,"display","inline-block"),Cr(e,d,a.height)}}},Tr=function(e,t){var n=e.style,o=cr(t),r=dr(t,o,{blocks:[],atomicInlines:[]});if(r.blocks.length){var i=r.blocks.reduce((function(e,t){return{left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom)}}));return $o(n,"display","block"),$o(n,"margin-top","0"),$o(n,"margin-bottom","0"),void Qo(n,i.right-i.left,i.bottom-i.top)}$o(n,"display","inline"),$o(n,"padding","0"),$o(n,"border-width","0");var a=["before","after"].filter((function(e){var n=window.getComputedStyle(t,"::"+e);return!/^(none|normal|)$/.test(n.content)&&"none"!==n.display&&!tr(n)}));if(a.length){e.setAttribute("bb-no-content",a.join(" "));var s=e.ownerDocument.createElement("style");s.textContent=a.map((function(e){return"[bb-no-content~=".concat(e,"]::").concat(e,"{content:none!important}")})).join(""),e.appendChild(s)}pr(e,Array.from(t.getClientRects(),(function(e){return lr(e,o)})),r.atomicInlines)},Er=function(e,t,n,o){var r=t.createElementNS(e.namespaceURI,e.localName);if(!n&&e.hasAttribute("class")&&r.setAttribute("class",e.getAttribute("class")),function(e,t){e instanceof HTMLTableCellElement?[["colspan","colSpan"],["rowspan","rowSpan"]].forEach((function(n){var o=Ro(n,2),r=o[0],i=o[1];e.hasAttribute(r)&&t.setAttribute(r,e[i])})):e instanceof HTMLTableColElement&&e.hasAttribute("span")?t.setAttribute("span",e.span):e instanceof HTMLLIElement&&e.hasAttribute("value")&&t.setAttribute("value",e.value)}(e,r),!r.style||/^(br|wbr)$/.test(e.localName))return r;try{var i=window.getComputedStyle(e),a=r.style,s=i.display;if(o&&/^table-/.test(s))return function(e,t,n){if("table-cell"===n.display){var o=e.style;o.setProperty("vertical-align","top"),Xo.forEach((function(e){return o.setProperty(e,n.getPropertyValue(e))}))}else Ko.test(n.display)&&fr(e,t,!0)}(r,e,i),r;Vo.forEach((function(e){return $o(a,e,i.getPropertyValue(e))})),$o(a,"visibility","hidden"),"none"===s||"contents"===s||Ko.test(s)?($o(a,"display",s),"none"!==s&&fr(r,e,"contents"!==s)):e instanceof HTMLElement&&er(i)?Tr(r,e):Ir(r,e,i)}catch(c){}return r},Lr=function(){var e=Po(Mo().mark((function e(t,n){var o,r,i,a,s,c,l;return Mo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=1,r=Wo(new Map,window.document),i=Lo(n),a=null,s=function(){var e=Po(Mo().mark((function e(t,c,l,u){var d,p,f,h,g,m,v,y,b,w,k,x,S,C;return Mo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((d=t.nodeType==Node.ELEMENT_NODE)&&(I=t,T=n,T=T||{},xo(I,".rr-block, .gl-block")||So(I,T.blockClass)||xo(I,T.blockSelector)))){e.next=7;break}return a=a||document.implementation.createHTMLDocument(""),p=Er(t,a),l&&p.setAttribute("bb-shadow-child",l),c.appendChild(p),e.abrupt("return");case 7:if(!u||t.nodeType!=Node.COMMENT_NODE){e.next=9;break}return e.abrupt("return");case 9:if(f=u||d&&Co(t,n),h=function(){var e=Po(Mo().mark((function e(t,n,o){return Mo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=11;break}return e.prev=1,e.next=4,s(t,n,o,f);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:t=!t.nextElementSibling||t.nextElementSibling.nextSibling!==t.nextSibling&&null!==t.nextSibling?t.nextSibling:t.nextElementSibling,e.next=0;break;case 11:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t,n,o){return e.apply(this,arguments)}}(),g=t.cloneNode(),m=t.tagName?t.tagName.toUpperCase():t.tagName,v=null,u&&t.nodeType==Node.TEXT_NODE&&"STYLE"!==t.parentNode.nodeName.toUpperCase()&&(g.data=i(t.data,t.parentElement)),null!=(y=Go(t,r))&&g.setAttribute("bb-web-animations",y),void 0===g.setAttribute){e.next=33;break}if(l&&g.setAttribute("bb-shadow-child",l),!(t instanceof HTMLCanvasElement)){e.next=33;break}return e.prev=20,b=t.getBoundingClientRect(),e.next=24,$(t.toDataURL(),1400,1400);case 24:w=e.sent,g.setAttribute("bb-canvas-data",w),g.setAttribute("bb-canvas-height",b.height),g.setAttribute("bb-canvas-width",b.width),e.next=33;break;case 30:e.prev=30,e.t0=e.catch(20),console.warn("Gleap: Failed to clone canvas data.",e.t0);case 33:if(d&&("IFRAME"!=m&&"VIDEO"!=m&&"EMBED"!=m&&"IMG"!=m&&"SVG"!=m||(k=t.getBoundingClientRect(),g.setAttribute("bb-element",!0),g.setAttribute("bb-height",k.height),g.setAttribute("bb-width",k.width)),(t.scrollTop>0||t.scrollLeft>0)&&(g.setAttribute("bb-scrollpos",!0),g.setAttribute("bb-scrolltop",t.scrollTop),g.setAttribute("bb-scrollleft",t.scrollLeft)),"SELECT"!==m&&"TEXTAREA"!==m&&"INPUT"!==m||(v=To(t,n),g.setAttribute("bb-data-value",v?v(t.value):t.value),v&&g.hasAttribute("value")&&g.setAttribute("value",v(g.getAttribute("value"))),"checkbox"!==t.type&&"radio"!==t.type||!t.checked||g.setAttribute("bb-data-checked",!0))),c.appendChild(g),!t.shadowRoot){e.next=43;break}return x=o,o++,Wo(r,t.shadowRoot),e.next=41,h(t.shadowRoot.firstChild,g,x);case 41:zo(t.shadowRoot,g,x),void 0!==g.setAttribute&&g.setAttribute("bb-shadow-parent",x);case 43:if(v&&"TEXTAREA"===m){e.next=46;break}return e.next=46,h(t.firstChild,g);case 46:if(v&&"SELECT"===m)for(S=g.querySelectorAll("option[selected]"),C=0;C<S.length;C++)S[C].removeAttribute("selected");case 47:case"end":return e.stop()}var I,T}),e,null,[[20,30]])})));return function(t,n,o,r){return e.apply(this,arguments)}}(),c=document.createDocumentFragment(),e.next=8,s(t,c);case 8:return(l=c.querySelector("head"))||(l=c),zo(window.document,l),e.abrupt("return",c);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Or=function(e){for(var t=[{selector:"button button",role:"button"},{selector:"a a",role:"link"},{selector:"form form",role:null}],n=0;n<t.length;n++)for(var o=e.querySelectorAll(t[n].selector),r=0;r<o.length;r++){var i=o[r];try{if(i.namespaceURI&&"http://www.w3.org/1999/xhtml"!==i.namespaceURI)continue;for(var a=window.document.createElement("div"),s=0;s<i.attributes.length;s++)a.setAttribute(i.attributes[s].name,i.attributes[s].value);for(t[n].role&&!a.hasAttribute("role")&&a.setAttribute("role",t[n].role),a.setAttribute("bb-nested-"+i.tagName.toLowerCase(),"true");i.firstChild;)a.appendChild(i.firstChild);i.parentNode.replaceChild(a,i)}catch(c){}}},Mr=function(e,t){return new Promise(function(){var n=Po(Mo().mark((function n(o,r){var i,a,s,c,l,u,d,p,f,h,g,m,v,y,b;return Mo().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:for(n.prev=0,i=window.document.querySelectorAll("style, link"),a=0;a<i.length;++a)i[a].setAttribute("bb-styleid",a);return n.next=5,Lr(window.document.documentElement,t);case 5:s=n.sent;try{Or(s)}catch(r){}for(c=s.querySelectorAll("link[rel=import]"),a=0;a<c.length;++a)if((l=c[a])&&l.childNodes&&l.childNodes.length>0){for(u=l.childNodes;u.length>0;)l.parentNode.insertBefore(u[0],l);l.remove()}for(d=s.querySelectorAll("script, noscript"),a=0;a<d.length;++a)d[a].remove();for(p="",f=s.querySelectorAll("base"),a=0;a<f.length;++a)f[a].href&&(p=f[a].href),f[a].remove();for(h=window.location.href.substring(0,window.location.href.lastIndexOf("/")),g=h+"/",p&&(p.startsWith("http")?g=p:(g=h+p).endsWith("/")||(g+="/")),(m=window.document.createElement("base")).href=g,(v=s.querySelector("head")).insertBefore(m,v.firstChild),y=s.querySelectorAll(".bb-feedback-dialog-container, .bb-capture-editor-borderlayer"),a=0;a<y.length;++a)y[a].remove();for(b=s.querySelectorAll("[bb-element=true]"),a=0;a<b.length;++a)b[a]&&(b[a].style.height=b[a].getAttribute("bb-height")+"px");qo(s,e).then((function(){var e=No(s);o({html:e,baseUrl:h,width:window.innerWidth,height:window.innerHeight,isMobile:ee()})})),n.next=32;break;case 28:n.prev=28,n.t0=n.catch(0),console.warn("Gleap: Failed to capture screenshot",n.t0),o(null);case 32:case"end":return n.stop()}}),n,null,[[0,28]])})));return function(e,t){return n.apply(this,arguments)}}())};const Ar=Math.min,Pr=Math.max,Rr=Math.round,_r=Math.floor,Nr=e=>({x:e,y:e}),Dr={left:"right",right:"left",bottom:"top",top:"bottom"},jr={start:"end",end:"start"};function Fr(e,t,n){return Pr(e,Ar(t,n))}function Br(e,t){return"function"==typeof e?e(t):e}function Hr(e){return e.split("-")[0]}function Ur(e){return e.split("-")[1]}function qr(e){return"x"===e?"y":"x"}function zr(e){return"y"===e?"height":"width"}const Wr=new Set(["top","bottom"]);function Gr(e){return Wr.has(Hr(e))?"y":"x"}function Vr(e){return qr(Gr(e))}function Kr(e){return e.replace(/start|end/g,(e=>jr[e]))}const Xr=["left","right"],Jr=["right","left"],Yr=["top","bottom"],$r=["bottom","top"];function Zr(e,t,n,o){const r=Ur(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Jr:Xr:t?Xr:Jr;case"left":case"right":return t?Yr:$r;default:return[]}}(Hr(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(Kr)))),i}function Qr(e){return e.replace(/left|right|bottom|top/g,(e=>Dr[e]))}function ei(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 ti(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function ni(e,t,n){let{reference:o,floating:r}=e;const i=Gr(t),a=Vr(t),s=zr(a),c=Hr(t),l="y"===i,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2;let f;switch(c){case"top":f={x:u,y:o.y-r.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-r.width,y:d};break;default:f={x:o.x,y:o.y}}switch(Ur(t)){case"start":f[a]-=p*(n&&l?-1:1);break;case"end":f[a]+=p*(n&&l?-1:1)}return f}async function oi(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Br(t,e),h=ei(f),g=s[p?"floating"===d?"reference":"floating":d],m=ti(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:l,rootBoundary:u,strategy:c})),v="floating"===d?{x:o,y:r,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=ti(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}const ri=new Set(["left","top"]);function ii(){return"undefined"!=typeof window}function ai(e){return li(e)?(e.nodeName||"").toLowerCase():"#document"}function si(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ci(e){var t;return null==(t=(li(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function li(e){return!!ii()&&(e instanceof Node||e instanceof si(e).Node)}function ui(e){return!!ii()&&(e instanceof Element||e instanceof si(e).Element)}function di(e){return!!ii()&&(e instanceof HTMLElement||e instanceof si(e).HTMLElement)}function pi(e){return!(!ii()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof si(e).ShadowRoot)}const fi=new Set(["inline","contents"]);function hi(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ti(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!fi.has(r)}const gi=new Set(["table","td","th"]);function mi(e){return gi.has(ai(e))}const vi=[":popover-open",":modal"];function yi(e){return vi.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const bi=["transform","translate","scale","rotate","perspective"],wi=["transform","translate","scale","rotate","perspective","filter"],ki=["paint","layout","strict","content"];function xi(e){const t=Si(),n=ui(e)?Ti(e):e;return bi.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||wi.some((e=>(n.willChange||"").includes(e)))||ki.some((e=>(n.contain||"").includes(e)))}function Si(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ci=new Set(["html","body","#document"]);function Ii(e){return Ci.has(ai(e))}function Ti(e){return si(e).getComputedStyle(e)}function Ei(e){return ui(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Li(e){if("html"===ai(e))return e;const t=e.assignedSlot||e.parentNode||pi(e)&&e.host||ci(e);return pi(t)?t.host:t}function Oi(e){const t=Li(e);return Ii(t)?e.ownerDocument?e.ownerDocument.body:e.body:di(t)&&hi(t)?t:Oi(t)}function Mi(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Oi(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),a=si(r);if(i){const e=Ai(a);return t.concat(a,a.visualViewport||[],hi(r)?r:[],e&&n?Mi(e):[])}return t.concat(r,Mi(r,[],n))}function Ai(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pi(e){const t=Ti(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=di(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=Rr(n)!==i||Rr(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function Ri(e){return ui(e)?e:e.contextElement}function _i(e){const t=Ri(e);if(!di(t))return Nr(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Pi(t);let a=(i?Rr(n.width):n.width)/o,s=(i?Rr(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ni=Nr(0);function Di(e){const t=si(e);return Si()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ni}function ji(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Ri(e);let a=Nr(1);t&&(o?ui(o)&&(a=_i(o)):a=_i(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==si(e))&&t}(i,n,o)?Di(i):Nr(0);let c=(r.left+s.x)/a.x,l=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(i){const e=si(i),t=o&&ui(o)?si(o):o;let n=e,r=Ai(n);for(;r&&o&&t!==n;){const e=_i(r),t=r.getBoundingClientRect(),o=Ti(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=i,l+=a,n=si(r),r=Ai(n)}}return ti({width:u,height:d,x:c,y:l})}function Fi(e,t){const n=Ei(e).scrollLeft;return t?t.left+n:ji(ci(e)).left+n}function Bi(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Fi(e,n),y:n.top+t.scrollTop}}const Hi=25;const Ui=new Set(["absolute","fixed"]);function qi(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=si(e),o=ci(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,c=0;if(r){i=r.width,a=r.height;const e=Si();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,c=r.offsetTop)}const l=Fi(o);if(l<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(o.clientWidth-t.clientWidth-r);a<=Hi&&(i-=a)}else l<=Hi&&(i+=l);return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)o=function(e){const t=ci(e),n=Ei(e),o=e.ownerDocument.body,r=Pr(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Pr(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Fi(e);const s=-n.scrollTop;return"rtl"===Ti(o).direction&&(a+=Pr(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(ci(e));else if(ui(t))o=function(e,t){const n=ji(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=di(e)?_i(e):Nr(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=Di(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ti(o)}function zi(e,t){const n=Li(e);return!(n===t||!ui(n)||Ii(n))&&("fixed"===Ti(n).position||zi(n,t))}function Wi(e,t,n){const o=di(t),r=ci(t),i="fixed"===n,a=ji(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Nr(0);function l(){c.x=Fi(r)}if(o||!o&&!i)if(("body"!==ai(t)||hi(r))&&(s=Ei(t)),o){const e=ji(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else r&&l();i&&!o&&r&&l();const u=!r||o||i?Nr(0):Bi(r,s);return{x:a.left+s.scrollLeft-c.x-u.x,y:a.top+s.scrollTop-c.y-u.y,width:a.width,height:a.height}}function Gi(e){return"static"===Ti(e).position}function Vi(e,t){if(!di(e)||"fixed"===Ti(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ci(e)===n&&(n=n.ownerDocument.body),n}function Ki(e,t){const n=si(e);if(yi(e))return n;if(!di(e)){let t=Li(e);for(;t&&!Ii(t);){if(ui(t)&&!Gi(t))return t;t=Li(t)}return n}let o=Vi(e,t);for(;o&&mi(o)&&Gi(o);)o=Vi(o,t);return o&&Ii(o)&&Gi(o)&&!xi(o)?n:o||function(e){let t=Li(e);for(;di(t)&&!Ii(t);){if(xi(t))return t;if(yi(t))return null;t=Li(t)}return null}(e)||n}const Xi={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,a=ci(o),s=!!t&&yi(t.floating);if(o===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Nr(1);const u=Nr(0),d=di(o);if((d||!d&&!i)&&(("body"!==ai(o)||hi(a))&&(c=Ei(o)),di(o))){const e=ji(o);l=_i(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const p=!a||d||i?Nr(0):Bi(a,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:ci,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?yi(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Mi(e,[],!1).filter((e=>ui(e)&&"body"!==ai(e))),r=null;const i="fixed"===Ti(e).position;let a=i?Li(e):e;for(;ui(a)&&!Ii(a);){const t=Ti(a),n=xi(a);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&Ui.has(r.position)||hi(a)&&!n&&zi(e,a))?o=o.filter((e=>e!==a)):r=t,a=Li(a)}return t.set(e,o),o}(t,this._c):[].concat(n),o],a=i[0],s=i.reduce(((e,n)=>{const o=qi(t,n,r);return e.top=Pr(o.top,e.top),e.right=Ar(o.right,e.right),e.bottom=Ar(o.bottom,e.bottom),e.left=Pr(o.left,e.left),e}),qi(t,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ki,getElementRects:async function(e){const t=this.getOffsetParent||Ki,n=this.getDimensions,o=await n(e.floating);return{reference:Wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Pi(e);return{width:t,height:n}},getScale:_i,isElement:ui,isRTL:function(e){return"rtl"===Ti(e).direction}};function Ji(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yi(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,l=Ri(e),u=r||i?[...l?Mi(l):[],...Mi(t)]:[];u.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=l&&s?function(e,t){let n,o=null;const r=ci(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=l;if(s||t(),!p||!f)return;const h={rootMargin:-_r(d)+"px "+-_r(r.clientWidth-(u+p))+"px "+-_r(r.clientHeight-(d+f))+"px "+-_r(u)+"px",threshold:Pr(0,Ar(1,c))||1};let g=!0;function m(t){const o=t[0].intersectionRatio;if(o!==c){if(!g)return a();o?a(!1,o):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==o||Ji(l,e.getBoundingClientRect())||a(),g=!1}try{o=new IntersectionObserver(m,{...h,root:r.ownerDocument})}catch(v){o=new IntersectionObserver(m,h)}o.observe(e)}(!0),i}(l,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver((e=>{let[o]=e;o&&o.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),l&&!c&&h.observe(l),h.observe(t));let g=c?ji(e):null;return c&&function t(){const o=ji(e);g&&!Ji(g,o)&&n();g=o,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const $i=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=Hr(n),s=Ur(n),c="y"===Gr(n),l=ri.has(a)?-1:1,u=i&&c?-1:1,d=Br(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),c?{x:f*u,y:p*l}:{x:p*l,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}},Zi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Br(e,t),u={x:n,y:o},d=await i.detectOverflow(t,l),p=Gr(Hr(r)),f=qr(p);let h=u[f],g=u[p];if(a){const e="y"===f?"bottom":"right";h=Fr(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";g=Fr(g+d["y"===p?"top":"left"],g,g-d[e])}const m=c.fn({...t,[f]:h,[p]:g});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[f]:a,[p]:s}}}}}},Qi=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=Br(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Hr(r),y=Gr(s),b=Hr(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),k=p||(b||!g?[Qr(s)]:function(e){const t=Qr(e);return[Kr(e),t,Kr(t)]}(s)),x="none"!==h;!p&&x&&k.push(...Zr(s,g,h,w));const S=[s,...k],C=await c.detectOverflow(t,m),I=[];let T=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&I.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Ur(e),r=Vr(e),i=zr(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Qr(a)),[a,Qr(a)]}(r,a,w);I.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:I}],!I.every((e=>e<=0))){var E,L;const e=((null==(E=i.flip)?void 0:E.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&y!==Gr(t))||T.every((e=>Gr(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}}}let n=null==(L=T.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:L.placement;if(!n)switch(f){case"bestFit":{var O;const e=null==(O=T.filter((e=>{if(x){const t=Gr(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:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},ea=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Br(e,t)||{};if(null==l)return{};const d=ei(u),p={x:n,y:o},f=Vr(r),h=zr(f),g=await a.getDimensions(l),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],k=p[f]-i.reference[f],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let S=x?x[b]:0;S&&await(null==a.isElement?void 0:a.isElement(x))||(S=s.floating[b]||i.floating[h]);const C=w/2-k/2,I=S/2-g[h]/2-1,T=Ar(d[v],I),E=Ar(d[y],I),L=T,O=S-g[h]-E,M=S/2-g[h]/2+C,A=Fr(L,M,O),P=!c.arrow&&null!=Ur(r)&&M!==A&&i.reference[h]/2-(M<L?T:E)-g[h]/2<0,R=P?M<L?M-L:M-O:0;return{[f]:p[f]+R,data:{[f]:A,centerOffset:M-A-R,...P&&{alignmentOffset:R}},reset:P}}}),ta=(e,t,n)=>{const o=new Map,r={platform:Xi,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=ni(l,o,c),p=o,f={},h=0;for(let m=0;m<s.length;m++){var g;const{name:n,fn:i}=s[m],{x:v,y,data:b,reset:w}=await i({x:u,y:d,initialPlacement:o,placement:p,strategy:r,middlewareData:f,rects:l,platform:{...a,detectOverflow:null!=(g=a.detectOverflow)?g:oi},elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,f={...f,[n]:{...f[n],...b}},w&&h<=50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(l=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):w.rects),({x:u,y:d}=ni(l,p,c))),m=-1)}return{x:u,y:d,placement:p,strategy:r,middlewareData:f}})(e,t,{...r,platform:i})};var na=function(e,t,n){if(!e||!t||!n)return!0;var o=function(e){return e.replace(/\/$/,"")},r=function(e,t){if(!e||!t)return!1;try{if(e.includes(t))return!0}catch(o){}var n=function(e){if(!e)return null;try{e.startsWith("/")&&(e=e.substring(1));var t=e.replace(/{\w+}/g,"___PLACEHOLDER___");return t=(t=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/___PLACEHOLDER___/g,"[^&?]+"),new RegExp(t,"i")}catch(o){return null}}(t);if(!n)return!1;try{return n.test(e)}catch(o){return!1}},i=!1;switch(n){case"is":i=o(e)===o(t);break;case"isnot":i=o(e)!==o(t);break;case"contains":i=r(e,t);break;case"startswith":i=e.startsWith(t);break;case"endswith":i=e.endsWith(t);break;case"notcontains":i=!r(e,t);break;default:i=!1}return i},oa=["notcontains","isnot"],ra=function(e){return Boolean(e&&e.pageFilter&&e.pageFilter.length>0)},ia=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(ra);if(0===n.length)return!0;var o=n.filter((function(e){return!oa.includes(e.pageFilterType)})),r=n.filter((function(e){return oa.includes(e.pageFilterType)})),i=0===o.length||o.some((function(t){return na(e,t.pageFilter,t.pageFilterType)})),a=0===r.length||r.every((function(t){return na(e,t.pageFilter,t.pageFilterType)}));return i&&a};function aa(e){return aa="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},aa(e)}function sa(e){return function(e){if(Array.isArray(e))return ca(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 ca(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 ca(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 ca(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function la(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,da(o.key),o)}}function ua(e,t,n){return(t=da(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function da(e){var t=function(e,t){if("object"!=aa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=aa(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==aa(t)?t:String(t)}var pa=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ua(this,"tooltips",[]),ua(this,"filteredTooltips",[]),ua(this,"lastUrl",null),ua(this,"elementToFloatingUIMap",new WeakMap),ua(this,"elementToTooltipMap",new WeakMap),ua(this,"nextId",0),ua(this,"linkTooltip",(function(e,n){if(!e.hasAttribute("data-gleap-tooltip")){var o=t.nextId++;if(e.setAttribute("data-gleap-tooltip",o),e){var r=null;if("hotspot"===n.mode){var i=document.createElement("div");i.setAttribute("data-gleap-tooltip-anchor",o),i.classList.add("gleap-tooltip-anchor"),e.setAttribute("data-gleap-tooltip-mode","hotspot"),t.canEmbed(e)?e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i):e.parentNode.insertBefore(i,e.nextSibling);var a=document.createElement("div");a.classList.add("gleap-tooltip-hotspot"),a.setAttribute("data-gleap-tooltip-hotspot",o),a.innerHTML="".concat(ge(n.icon,n.color)).concat(n.animated?'<div style="background-color: '.concat(n.color,'" class="gleap-tooltip-hotspot-animation"></div>'):""),i.appendChild(a),t.repositionHotspot(e,n),r=a,t.elementToTooltipMap.set(e,n)}else r=e;var s=t.createTooltip(r,n.html,n);t.elementToFloatingUIMap.set(e,s)}}})),ua(this,"updateFilteredTooltips",(function(){t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),ua(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?ia(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!na(e,t.page,t.pageType)}))})),ua(this,"checkForTooltips",(function(){for(var e=0;e<t.filteredTooltips.length;e++){var n=t.filteredTooltips[e];try{for(var o=document.querySelectorAll(n.selector),r=0;r<o.length;r++){var i=o[r];i&&t.linkTooltip(i,n)}}catch(a){}}})),ua(this,"load",(function(){var e=t,n=ba.getInstance(),o=new XMLHttpRequest;o.open("GET",n.apiUrl+"/config/"+n.sdkKey+"/tooltips"),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("Api-Token",n.sdkKey);try{o.setRequestHeader("Gleap-Id",n.session.gleapId),o.setRequestHeader("Gleap-Hash",n.session.gleapHash)}catch(r){}o.onerror=function(){console.error("Failed to fetch tooltips")},o.onreadystatechange=function(t){if(4===o.readyState&&200===o.status)try{e.tooltips=JSON.parse(o.responseText),e.updateFilteredTooltips()}catch(r){console.error("Failed to parse tooltips",r)}},o.send()}))}var t,n,o;return t=e,n=[{key:"processNodeInsertion",value:function(e){var t=this;e.nodeType===Node.ELEMENT_NODE&&(this.checkNodeTooltip(e),e.childNodes&&e.childNodes.forEach((function(e){t.processNodeInsertion(e)})))}},{key:"checkNodeTooltip",value:function(e){var t=this;this.filteredTooltips.length>0&&this.filteredTooltips.forEach((function(n){n.selector&&e.matches(n.selector)&&t.linkTooltip(e,n)}))}},{key:"start",value:function(){var e=this,t=this;if(window){var n,o,r,i=(n=t.updateHotspotPositions.bind(t),o=250,r=null,function(){if(!r){var e=this,t=arguments;r=setTimeout((function(){n.call.apply(n,[e].concat(sa(t))),r=null}),o)}});window.addEventListener("resize",i),window.requestAnimationFrame((function(){e.observer=new MutationObserver((function(n){t.lastUrl!==window.location.href&&(t.lastUrl=window.location.href,t.filteredTooltips=t.getFilteredTooltips()),n.forEach((function(n){if("attributes"===n.type){var o=n.target;o.nodeType===Node.ELEMENT_NODE&&(o.querySelector("[data-gleap-tooltip-hotspot]")||o.hasAttribute("data-gleap-tooltip-mode")||o.hasAttribute("data-gleap-tooltip"))&&t.updateHotspotPositions()}n.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t.processNodeInsertion(e)})),n.removedNodes.forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE&&e.elementToFloatingUIMap.has(t)){var n=e.elementToFloatingUIMap.get(t);n&&(n.tooltip&&n.tooltip.remove(),n.cleanup(),e.elementToFloatingUIMap.delete(t))}e.elementToTooltipMap.has(t)&&e.elementToTooltipMap.delete(t)}))}))})),e.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})}))}}},{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 o=document.createElement("div");o.className="gleap-tooltip",o.innerHTML='<div class="gleap-tooltip-inner">\n '.concat(t,'\n <div class="gleap-tooltip-arrow">\n <svg width="116" height="56" viewBox="0 0 116 56" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M57.75 0.74998L115.5 0.680177L66.8726 49.3076C61.7958 54.3844 53.5646 54.3844 48.4878 49.3076L4.05618e-05 0.819784L57.75 0.74998Z" fill="white"/>\n </svg>\n </div>\n </div>'),document.body.appendChild(o);var r,i=o.querySelector(".gleap-tooltip-arrow"),a=Yi(e,o,(function(){ta(e,o,{placement:"left"===n.posX?"left":"right",middleware:[$i(10),Qi(),Zi(),ea({element:i})]}).then((function(e){var t=e.x,n=e.y,r=e.middlewareData,a=e.placement;try{if(Object.assign(o.style,{left:"".concat(t,"px"),top:"".concat(n,"px")}),r.arrow){var s={left:"",top:"",transform:""};null!=r.arrow.x&&(s.left="".concat(r.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!=r.arrow.y&&(s.top="".concat(r.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(c){}}))}));function s(){clearTimeout(r),o.style.visibility="visible",o.style.opacity="1",o.style.pointerEvents="auto"}function c(){r=setTimeout((function(){o.style.opacity="0",setTimeout((function(){o.style.visibility="hidden",o.style.pointerEvents="none"}),200)}),500)}return e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",c),o.addEventListener("mouseenter",s),o.addEventListener("mouseleave",c),e.addEventListener("click",c),o.addEventListener("click",c),{cleanup:a,tooltip:o}}},{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(){this.observer&&(this.observer.disconnect(),this.observer=null),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),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.tooltips=[],this.filteredTooltips=[]}},{key:"repositionHotspot",value:function(e,t){if(e&&t){var n=e.getAttribute("data-gleap-tooltip");if(n){var o=document.querySelector('[data-gleap-tooltip-hotspot="'.concat(n,'"]'));if(o){t.posX||(t.posX="right"),t.posY||(t.posY="center"),t.offsetX||(t.offsetX=4),t.offsetY||(t.offsetY=0);var r=e.getBoundingClientRect();try{var i=document.createRange();i.selectNodeContents(e);var a=window.getComputedStyle(e),s=i.getBoundingClientRect().width+parseFloat(a.paddingLeft);s<r.width&&(r.width=s)}catch(f){}var c=document.querySelector('[data-gleap-tooltip-anchor="'.concat(n,'"]')).getBoundingClientRect(),l=c.left-r.left,u=c.top-r.top,d=0,p=0;switch(t.posX){case"left":p=-1*(t.offsetX+17);break;case"right":p=r.width+t.offsetX}switch(t.posY){case"top":d=0+t.offsetY;break;case"bottom":d=r.height-17+t.offsetY;break;case"center":d=r.height/2-8.5+t.offsetY}o&&(o.style.position="absolute",o.style.top=d-u+"px",o.style.left=p-l+"px")}}}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e,this.instance.start()),this.instance}}],n&&la(t.prototype,n),o&&la(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fa(e){return fa="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},fa(e)}function ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ga(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ha(Object(n),!0).forEach((function(t){va(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ha(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ma(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,ya(o.key),o)}}function va(e,t,n){return(t=ya(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ya(e){var t=function(e,t){if("object"!=fa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=fa(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fa(t)?t:String(t)}ua(pa,"instance",void 0);var ba=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),va(this,"region",St),va(this,"apiUrl",xt[St].apiUrl),va(this,"wsApiUrl",xt[St].wsApiUrl),va(this,"realtimeHost",void 0),va(this,"sdkKey",null),va(this,"updatingSession",!1),va(this,"fileRefreshTimeout",null),va(this,"useCookies",!0),va(this,"localStorageDisabled",!1),va(this,"session",{gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0}),va(this,"ready",!1),va(this,"onSessionReadyListener",[]),va(this,"lastIdentify",null),va(this,"identifyInFlight",!1),va(this,"setOnSessionReady",(function(e){t.ready?e():t.onSessionReadyListener.push(e)})),va(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))})),va(this,"clearSession",(function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=!(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 r=new XMLHttpRequest;r.open("POST",t.apiUrl+"/files/session/revoke"),r.setRequestHeader("X-File-Session",t.session.fileAccessToken),r.send()}catch(i){}t.session&&t.session.gleapHash&&Ht.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash));try{ce("session-".concat(t.sdkKey),null)}catch(a){}if(t.useCookies)try{!function(e){try{var t=ae(window.location.host.split(":")[0]);document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT; Domain="+t}catch(a){}}("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,Wa.getInstance().sendMessage({name:"session-cleared"},!0),Ls.getInstance().clearAllNotifications(!1),Ls.getInstance().setNotificationCount(0),yn.getInstance().removeBannerUI(),vs.getInstance().hideModal(),o&&t.scheduleSessionRetry(n)})),va(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)}})),va(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 o=t.session.fileAccessToken,r=new XMLHttpRequest;r.open("GET","".concat(t.apiUrl,"/files/").concat(n,"/location")),r.setRequestHeader("X-File-Session",t.session.fileAccessToken),r.onload=function(){var e;if((null===(e=t.session)||void 0===e?void 0:e.fileAccessToken)===o)if(200===r.status)try{var n=JSON.parse(r.responseText).shareToken,i=Wa.getInstance();i.setAppMode("widget"),i.sendMessage({name:"open-conversation",data:{shareToken:n}},!0),i.showWidget()}catch(a){t.openingProtectedFile=null}else t.openingProtectedFile=null},r.onerror=function(){t.openingProtectedFile=null},r.send()}})),va(this,"validateSession",(function(e){var n,o,r,i,a,s;if(e&&e.gleapId){!e.fileAccessToken&&e.gleapId===(null===(n=t.session)||void 0===n?void 0:n.gleapId)&&e.userId===(null===(o=t.session)||void 0===o?void 0:o.userId)&&Date.parse(t.session.fileAccessExpiresAt)>Date.now()&&(e=ga(ga({},e),{},{fileAccessToken:t.session.fileAccessToken,fileAccessExpiresAt:t.session.fileAccessExpiresAt}));var c=!1;if((null===(r=t.session)||void 0===r?void 0:r.gleapId)!==(null===(i=e)||void 0===i?void 0:i.gleapId)&&(c=!0),t.session&&t.session.gleapHash&&Ht.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),t.localStorageDisabled||ce("session-".concat(t.sdkKey),e),t.useCookies&&function(e,t,n){try{var o="";if(n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),o="; expires="+r.toUTCString()}var i=ae(window.location.host.split(":")[0]);document.cookie=e+"="+(t||"")+o+"; path=/; domain="+i}catch(a){}}("session-".concat(t.sdkKey),encodeURIComponent(JSON.stringify(e)),365),t.session=e,t.ready=!0,e.fileAccessToken&&t.openRequestedProtectedFile(),clearTimeout(t.fileRefreshTimeout),e.fileAccessToken&&null!==(a=t.lastIdentify)&&void 0!==a&&a.userHash&&(t.fileRefreshTimeout=setTimeout((function(){if(t.lastIdentify){var e,n,o=t.lastIdentify,r=o.userId,i=o.userData,a=o.userHash;null===(e=t.identifySession(r,i,a,!0))||void 0===e||null===(n=e.catch)||void 0===n||n.call(e,(function(){}))}}),Math.max(0,Date.parse(e.fileAccessExpiresAt)-Date.now()-3e5))),t.session&&t.session.gleapHash&&Ht.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),c&&(setTimeout((function(){A.getInstance().clearCache(),S.getInstance().clearCache(),Nd.getInstance().restart();var e=pa.getInstance();if(e){try{e.destroy()}catch(t){}e.load()}}),0),"function"==typeof window.dispatchEvent&&window.dispatchEvent(new CustomEvent("session-updated"))),t.notifySessionReady(),c&&t.replayIdentifyIfNeeded(),e.authenticatedFilesRequired&&!e.fileAccessToken&&null!==(s=t.lastIdentify)&&void 0!==s&&s.userHash&&!t.identifyInFlight){var l,u,d=t.lastIdentify,p=d.userId,f=d.userData,h=d.userHash;null===(l=t.identifySession(p,f,h,!0))||void 0===l||null===(u=l.catch)||void 0===u||u.call(l,(function(){}))}}})),va(this,"replayIdentifyIfNeeded",(function(){try{if(!t.lastIdentify||!t.lastIdentify.userId)return;if(t.identifyInFlight)return;if(t.session&&t.session.userId)return;var e=t.lastIdentify,n=e.userId,o=e.userData,r=e.userHash,i=t.identifySession(n,o,r);i&&"function"==typeof i.catch&&i.catch((function(){}))}catch(a){}})),va(this,"startSession",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{if(t.useCookies){var n=function(e){try{for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t))return r.substring(t.length,r.length)}}catch(i){}return null}("session-".concat(t.sdkKey));if(n){var o=JSON.parse(decodeURIComponent(n));t.validateSession(o)}}}catch(s){}if(!(t.localStorageDisabled||t.session&&t.session.gleapId&&t.session.gleapId.length>0)){var r=se("session-".concat(t.sdkKey));r&&t.validateSession(r)}var i=t,a=new XMLHttpRequest;a.open("POST",i.apiUrl+"/sessions"),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.setRequestHeader("Api-Token",i.sdkKey);try{t.session&&t.session.gleapId&&t.session.gleapHash&&(a.setRequestHeader("Gleap-Id",t.session.gleapId),a.setRequestHeader("Gleap-Hash",t.session.gleapHash))}catch(s){}a.onreadystatechange=function(t){if(4===a.readyState)if(200===a.status||201===a.status)try{var n=JSON.parse(a.responseText);i.validateSession(n)}catch(s){}else 429!==a.status&&(!(a.status>=400&&a.status<500)&&i.session&&i.session.gleapId?i.scheduleSessionRetry(e):i.clearSession(e,!0))},a.send(JSON.stringify({lang:Yd.getInstance().getActiveLanguage(),deviceType:Q(),platform:"web"}))})),va(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(o){}return t.checkIfSessionDataNeedsUpdate(n)})),va(this,"checkIfSessionDataNeedsUpdate",(function(e){if(e)for(var n=Object.keys(e),o=0;o<n.length;o++){var r=n[o];if(JSON.stringify(t.session[r])!==JSON.stringify(e[r])&&(!t.session.customData||JSON.stringify(t.session.customData[r])!==JSON.stringify(e[r])))return!0}return!1})),va(this,"updateSession",(function(e){if(t.checkIfSessionDataNeedsUpdate(e)){var n=t;return new Promise((function(o,r){t.setOnSessionReady((function(){if(!n.session.gleapId||!n.session.gleapHash)return r("Session not ready yet.");var t=new XMLHttpRequest;t.open("POST",n.apiUrl+"/sessions/partialupdate"),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)}catch(i){}t.onerror=function(){r()},t.onreadystatechange=function(e){if(4===t.readyState)if(200===t.status||201===t.status)try{var a=JSON.parse(t.responseText);n.validateSession(a),o(a)}catch(i){r(i)}else r()},t.send(JSON.stringify({data:ga(ga({},e),{},{lang:Yd.getInstance().getActiveLanguage(),deviceType:Q(),platform:"web"}),type:"js",sdkVersion:"18.1.2",ws:!0}))}))}))}})),va(this,"identifySession",(function(e,n,o){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.lastIdentify={userId:e,userData:n,userHash:o};var s=t.checkIfSessionNeedsUpdate(e,n),c=!!o&&(null===(r=t.session)||void 0===r?void 0:r.authenticatedFilesRequired)&&(!(null!==(i=t.session)&&void 0!==i&&i.fileAccessToken)||Date.parse(t.session.fileAccessExpiresAt)<=Date.now());if(s||a||c){var l=t;return new Promise((function(r,i){t.setOnSessionReady((function(){if(!l.session.gleapId||!l.session.gleapHash)return i("Session not ready yet.");var t=new XMLHttpRequest;t.open("POST",l.apiUrl+"/sessions/identify"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",l.sdkKey);try{t.setRequestHeader("Gleap-Id",l.session.gleapId),t.setRequestHeader("Gleap-Hash",l.session.gleapHash)}catch(s){}l.identifyInFlight=!0,t.onerror=function(){l.identifyInFlight=!1,i()},t.onreadystatechange=function(e){if(4===t.readyState)if(l.identifyInFlight=!1,200===t.status||201===t.status)try{var n=JSON.parse(t.responseText);l.validateSession(n),r(n)}catch(s){i(s)}else i()};var a=ga({},n);n.customData&&(delete a.customData,a=ga(ga({},a),n.customData)),t.send(JSON.stringify(ga(ga({},a),{},{userId:e,userHash:o,lang:Yd.getInstance().getActiveLanguage(),deviceType:Q(),platform:"web"})))}))}))}})),va(this,"startProductTourConfig",(function(e){var n=t;return new Promise((function(o,r){t.setOnSessionReady((function(){if(!n.session.gleapId||!n.session.gleapHash)return r("Session not ready yet.");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)}catch(i){}t.onerror=function(){r()},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&&o(n.config)}catch(i){r(i)}else r()},t.send(JSON.stringify({outboundId:e}))}))}))})),va(this,"validateProductTour",(function(e){var n=t;return new Promise((function(o,r){t.setOnSessionReady((function(){var t;if(!n.session.gleapId||!n.session.gleapHash)return r("Session not ready yet.");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)}catch(a){}i.onerror=function(){r()},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?o(t.config):r()}catch(a){r(a)}else r()},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,o;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(xt,t)?t:null}(e);if(!t)return console.warn('Gleap: Unknown region "'.concat(e,'". Supported regions: ').concat(Object.keys(xt).join(", "),". Region not changed.")),!1;var n=xt[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<this.onSessionReadyListener.length;e++)this.onSessionReadyListener[e]();this.onSessionReadyListener=[],Wa.getInstance().sendSessionUpdate()}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&ma(t.prototype,n),o&&ma(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function wa(e){return wa="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},wa(e)}function ka(){ka=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new M(o||[]);return r(a,"_invoke",{value:T(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(A([])));x&&x!==n&&o.call(x,a)&&(w=x);var S=b.prototype=v.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(r,i,a,s){var c=d(e[r],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==wa(u)&&o.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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(e,o){function r(){return new t((function(t,r){n(e,o,t,r)}))}return i=i?i.then(r,r):r()}})}function T(t,n,o){var r=p;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw a;return{value:e,done:!0}}for(o.method=i,o.arg=a;;){var s=o.delegate;if(s){var c=E(s,o);if(c){if(c===m)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===p)throw r=g,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=h;var l=d(t,n,o);if("normal"===l.type){if(r=o.done?g:f,l.arg===m)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(r=g,o.method="throw",o.arg=l.arg)}}}function E(t,n){var o=n.method,r=t.iterator[o];if(r===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),m;var i=d(r,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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(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 r=-1,i=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(wa(t)+" is not iterable")}return y.prototype=b,r(S,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new I(u(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=A,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(o,r){return s.type="throw",s.arg=t,n.next=o,r&&(n.method="next",n.arg=e),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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 o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:A(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),m}},t}function xa(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(o,r)}function Sa(e){return function(){var t=this,n=arguments;return new Promise((function(o,r){var i=e.apply(t,n);function a(e){xa(i,o,r,a,s,"next",e)}function s(e){xa(i,o,r,a,s,"throw",e)}a(void 0)}))}}function Ca(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 Ia(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 Ia(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 Ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ta(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,La(o.key),o)}}function Ea(e,t,n){return(t=La(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function La(e){var t=function(e,t){if("object"!=wa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=wa(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wa(t)?t:String(t)}va(ba,"instance",void 0);var Oa=function(){function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ea(this,"rerender",void 0),Ea(this,"stream",void 0),Ea(this,"mediaRecorder",void 0),Ea(this,"audioMuted",!1),Ea(this,"audioAvailable",!0),Ea(this,"available",!0),Ea(this,"isRecording",!1),Ea(this,"file",null),Ea(this,"maxRecordTime",e.MAX_RECORD_TIME),Ea(this,"recordTime",0),Ea(this,"recordingTimer",null),Ea(this,"permissionErrorText",""),Ea(this,"_displayVideoTrack",null),Ea(this,"_displayStream",null),Ea(this,"_micStream",null),this.rerender=t,this.permissionErrorText=n,navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia||(this.available=!1),setTimeout((function(){o.rerender()}),e.RERENDER_DELAY)}var t,n,o,r,i,a;return t=e,n=[{key:"getSupportedMimeType",value:function(){var t,n=Ca(e.MIME_TYPES);try{for(n.s();!(t=n.n()).done;){var o=t.value;if(window.MediaRecorder&&MediaRecorder.isTypeSupported(o))return o}}catch(r){n.e(r)}finally{n.f()}return"video/webm"}},{key:"formatTime",value:function(e){return(e-(e%=60))/60+(9<e?":":":0")+e}},{key:"stopStreamTracks",value:function(e){if(e)try{e.getTracks().forEach((function(e){return e.stop()}))}catch(t){}}},{key:"createMediaStream",value:function(e){var t=e.filter((function(e){return null!==e}));return new MediaStream(t)}},{key:"getFirstVideoTrack",value:function(e){if(!e)return null;var t=e.getVideoTracks();return t.length>0?t[0]:null}},{key:"getFirstAudioTrack",value:function(e){if(!e)return null;var t=e.getAudioTracks();return t.length>0?t[0]:null}},{key:"startScreenRecording",value:(a=Sa(ka().mark((function t(){var n,o;return ka().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&!this.isRecording){t.next=4;break}return this.available=!1,this.rerender(),t.abrupt("return");case 4:return t.prev=4,t.next=7,navigator.mediaDevices.getDisplayMedia({video:{width:{ideal:Math.min(window.screen.width,e.MAX_WIDTH)},height:{ideal:Math.min(window.screen.height,e.MAX_HEIGHT)},frameRate:{ideal:e.IDEAL_FRAME_RATE,max:e.MAX_FRAME_RATE},displaySurface:"monitor"},audio:!1,selfBrowserSurface:"include"});case 7:if(n=t.sent,this._displayStream=n,this._displayVideoTrack=this.getFirstVideoTrack(n),this.audioMuted){t.next=15;break}return t.next=13,this.startAudioRecording();case 13:t.next=19;break;case 15:this.audioAvailable=!1,o=this.createMediaStream([this._displayVideoTrack]),this.stream=o,this.handleRecord({stream:o});case 19:this.rerender(),t.next=26;break;case 22:t.prev=22,t.t0=t.catch(4),window.alert(this.permissionErrorText),this.rerender();case 26:case"end":return t.stop()}}),t,this,[[4,22]])}))),function(){return a.apply(this,arguments)})},{key:"stopScreenRecording",value:function(){if(this.mediaRecorder&&this.stream&&this.isRecording){this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null);try{this.mediaRecorder.stop()}catch(e){}this.stopStreamTracks(this.stream),this._displayStream&&(this.stopStreamTracks(this._displayStream),this._displayStream=null),this._micStream&&(this.stopStreamTracks(this._micStream),this._micStream=null),this._displayVideoTrack=null,this.rerender()}}},{key:"startAudioRecording",value:(i=Sa(ka().mark((function e(){var t,n,o,r;return ka().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._displayVideoTrack){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1});case 5:t=e.sent,this._micStream=t,n=this.getFirstAudioTrack(t),this.audioMuted=!1,this.audioAvailable=!!n,o=this.createMediaStream([this._displayVideoTrack,n]),this.stream=o,this.handleRecord({stream:o}),this.rerender(),e.next=23;break;case 16:e.prev=16,e.t0=e.catch(2),this.audioAvailable=!1,r=this.createMediaStream([this._displayVideoTrack]),this.stream=r,this.handleRecord({stream:r}),this.rerender();case 23:case"end":return e.stop()}}),e,this,[[2,16]])}))),function(){return i.apply(this,arguments)})},{key:"toggleAudio",value:function(){if(this.audioMuted=!this.audioMuted,this.rerender(),this.stream)for(var e=this.stream.getAudioTracks(),t=0;t<e.length;t++)e[t].enabled=!this.audioMuted}},{key:"clearPreview",value:function(){var t=document.querySelector(e.SELECTORS.PREVIEW_VIDEO);t&&(t.src=null),this.file=null,this.rerender()}},{key:"handleRecord",value:function(t){var n=t.stream,o=this,r=[];this.mediaRecorder=new MediaRecorder(n,{mimeType:this.getSupportedMimeType()}),this.isRecording=!0,this.recordTime=0;var i=document.querySelector(e.SELECTORS.TIMER_LABEL);this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),this.recordingTimer=setInterval((function(){o.recordTime++;var e=o.maxRecordTime-o.recordTime;i?e>0?i.innerHTML=o.formatTime(e):(i.innerHTML="2:00",o.stopScreenRecording()):e<=0&&o.stopScreenRecording()}),e.TIMER_UPDATE_INTERVAL),this.mediaRecorder.ondataavailable=function(e){e.data&&e.data.size>0&&r.push(e.data)};var a=this.getFirstVideoTrack(n);a&&(a.onended=function(){o.prepareRecording(r)}),this.mediaRecorder.onstop=function(){o.prepareRecording(r)},this.mediaRecorder.start(e.CHUNK_INTERVAL),o.rerender()}},{key:"prepareRecording",value:function(t){var n=this.getSupportedMimeType(),o=new Blob(t,{type:n}),r=n.includes("mp4")?"mp4":"webm";this.file=new File([o],"screen-recording.".concat(r),{type:n});var i=document.querySelector(e.SELECTORS.PREVIEW_VIDEO);i&&(i.src=URL.createObjectURL(o),this.audioAvailable=this.stream?this.stream.getAudioTracks().length>0:this.audioAvailable,this.isRecording=!1,this.rerender())}}],o=[{key:"uploadScreenRecording",value:(r=Sa(ka().mark((function e(t){return ka().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.abrupt("return",new Promise((function(e,n){var o=new XMLHttpRequest;o.open("POST",ba.getInstance().apiUrl+"/uploads/sdk"),ba.getInstance().injectSession(o);var r=new FormData;r.append("file",t),o.onerror=function(){n(new Error("Network error during file upload"))},o.onreadystatechange=function(){4==o.readyState&&(200==o.status?e(JSON.parse(o.response).fileUrl):n(new Error("Upload failed with status ".concat(o.status))))},o.send(r)})));case 3:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})}],n&&Ta(t.prototype,n),o&&Ta(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ma(e){return Ma="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},Ma(e)}function Aa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aa(Object(n),!0).forEach((function(t){_a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ra(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Na(o.key),o)}}function _a(e,t,n){return(t=Na(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Na(e){var t=function(e,t){if("object"!=Ma(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ma(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ma(t)?t:String(t)}Ea(Oa,"MAX_RECORD_TIME",120),Ea(Oa,"MAX_WIDTH",3072),Ea(Oa,"MAX_HEIGHT",1728),Ea(Oa,"IDEAL_FRAME_RATE",10),Ea(Oa,"MAX_FRAME_RATE",24),Ea(Oa,"CHUNK_INTERVAL",200),Ea(Oa,"TIMER_UPDATE_INTERVAL",1e3),Ea(Oa,"RERENDER_DELAY",100),Ea(Oa,"MIME_TYPES",["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm","video/mp4"]),Ea(Oa,"SELECTORS",{PREVIEW_VIDEO:".bb-capture-preview video",TIMER_LABEL:".bb-capture-toolbar-item-timer"});var Da=[["webReplay"],["screenshotData","networkLogs"]],ja=function(){function e(t,n,o,r,i,a,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_a(this,"excludeData",{}),_a(this,"type","BUG"),_a(this,"priority","LOW"),_a(this,"customData",{}),_a(this,"ticketAttributes",{}),_a(this,"metaData",{}),_a(this,"consoleLog",[]),_a(this,"networkLogs",[]),_a(this,"customEventLog",[]),_a(this,"formData",{}),_a(this,"isSilent",!1),_a(this,"outboundId",void 0),_a(this,"screenshotData",void 0),_a(this,"webReplay",void 0),_a(this,"screenRecordingUrl",void 0),_a(this,"spamToken",void 0),this.type=t,this.priority=n,this.formData=o,this.isSilent=r,this.excludeData=i,this.outboundId=a,this.spamToken=s}var t,n,o;return t=e,n=[{key:"takeSnapshot",value:function(){var e=this,t=cp.getInstance();this.customData=co.getInstance().getCustomData(),this.metaData=us.getInstance().getMetaData(),this.consoleLog=Yn.getInstance().getLogs(),this.networkLogs=Ss.getInstance().getRequests(),this.customEventLog=Nd.getInstance().getEventArray(),this.ticketAttributes=co.getInstance().getTicketAttributes();var n=[],o=t.getGlobalDataItem("webReplay");null!==o&&(this.webReplay=o);var r,i,a,s,c,l=t.getGlobalDataItem("screenRecordingData");if(null!=l){var u=Oa.uploadScreenRecording(l).then((function(t){t&&(e.screenRecordingUrl=t)}));n.push(u)}if(!this.excludeData||!this.excludeData.screenshot){var d=(s=t.isLiveMode(),c=Id.getInstance().customOptions,Mr(s,c||{})).then((function(n){if(n){var o=t.getGlobalDataItem("snapshotPosition");n.x=o.x,n.y=o.y,e.screenshotData=n}}));n.push((r=d,i=15e3,a="screenshot capture",new Promise((function(e,t){var n=!1,o=setTimeout((function(){n||(n=!0,console.warn("Gleap: "+a+" timed out after "+i+"ms. Sending the report without it."),e())}),i);r.then((function(t){n||(n=!0,clearTimeout(o),e(t))}),(function(e){n||(n=!0,clearTimeout(o),t(e))}))}))))}return Promise.all(n)}},{key:"getData",value:function(){var e={type:this.type,priority:this.priority,customData:this.customData,metaData:this.metaData,consoleLog:this.consoleLog,networkLogs:this.networkLogs,customEventLog:this.customEventLog,formData:Pa(Pa({},this.ticketAttributes),this.formData),isSilent:this.isSilent,outbound:this.outboundId,screenshotData:this.screenshotData,webReplay:this.webReplay,screenRecordingUrl:this.screenRecordingUrl,spamToken:this.spamToken},t=Gd.getInstance().getTags();if(t&&t.length>0&&(e.tags=t),this.excludeData)for(var n=Object.keys(this.excludeData),o=0;o<n.length;o++){var r=n[o];!0===this.excludeData[r]&&(e[r]&&delete e[r],"screenshot"===r&&delete e.screenshotData,"replays"===r&&delete e.webReplay)}return e}},{key:"getTicketData",value:function(){var e=this;return new Promise((function(t,n){e.takeSnapshot().then((function(){var n=e.getData();t(n)})).catch((function(e){console.log("Failed to take snapshot",e),n()}))}))}},{key:"sendFeedback",value:function(){var e=this;return new Promise((function(t,n){e.takeSnapshot().then((function(){var o=e.getData();!function e(r){var i=new XMLHttpRequest;i.open("POST",ba.getInstance().apiUrl+"/bugs/v2"),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),ba.getInstance().injectSession(i),i.onerror=function(e){n()},i.onreadystatechange=function(a){if(4===i.readyState)if(200===i.status||201===i.status)try{var s=JSON.parse(i.responseText);t(s)}catch(c){n()}else 413===i.status&&r<Da.length?(Da[r].forEach((function(e){return delete o[e]})),e(r+1)):n()},i.send(JSON.stringify(o))}(0)})).catch((function(e){console.log("Failed to take snapshot",e),n()}))}))}}],n&&Ra(t.prototype,n),o&&Ra(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Fa(e){return Fa="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},Fa(e)}function Ba(e){return function(e){if(Array.isArray(e))return Ha(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 Ha(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 Ha(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 Ha(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ua(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,za(o.key),o)}}function qa(e,t,n){return(t=za(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function za(e){var t=function(e,t){if("object"!=Fa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Fa(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Fa(t)?t:String(t)}var Wa=function(){function e(){var t=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),qa(this,"frameUrl","https://messenger-app.gleap.io"),qa(this,"gleapFrameContainer",null),qa(this,"gleapFrame",null),qa(this,"comReady",!1),qa(this,"injectedFrame",!1),qa(this,"widgetOpened",!1),qa(this,"listeners",[]),qa(this,"appMode","widget"),qa(this,"markerManager",void 0),qa(this,"escListener",void 0),qa(this,"frameHeight",0),qa(this,"sendingFeedback",!1),qa(this,"queue",[]),qa(this,"urlHandler",(function(e,t){if(e&&e.length>0)if(t){var n=window.open(e,"_blank");n&&n.focus()}else window.location.href=e})),qa(this,"autoWhiteListCookieManager",(function(){window&&Array.isArray(window.cmp_block_ignoredomains)&&-1===window.cmp_block_ignoredomains.indexOf("messenger-app.gleap.io")&&window.cmp_block_ignoredomains.push("messenger-app.gleap.io")})),qa(this,"injectFrame",(function(){t.injectedFrame||(t.injectedFrame=!0,t.autoWhiteListCookieManager(),le((function(){zn.getInstance().onConfigLoaded((function(){zn.getInstance().applyStylesFromConfig();var e=document.createElement("div");e.className="gleap-frame-container gleap-frame-container--hidden rr-block",e.innerHTML='<div class="gleap-frame-container-inner">'.concat(function(e){var t,n,o=e||{},r="image"===o.bgType&&o.bgImage&&o.bgImage.length>0,i=parseInt(o.v,10),a=i>=1&&i<=4?i:1,s=4!==a,c=null===(t=o.bgBlur)||void 0===t||t?'<div class="gleap-frame-loader-blur"></div>':"";if(!s){var l,u=o.welcomeText?String(o.welcomeText).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):"",d='<div class="gleap-frame-loader-strut">\n <div class="gleap-frame-loader-strut-bar"></div>\n <div class="gleap-frame-loader-strut-greeting">\n <div class="gleap-frame-loader-strut-kicker">&nbsp;</div>'.concat(u?'\n <div class="gleap-frame-loader-strut-title">'.concat(u,"</div>"):"","\n </div>\n </div>");if(r){var p=String(o.bgImage).replace(/"/g,"&quot;");return'<div class="gleap-frame-loader">\n <div class="gleap-frame-loader-header gleap-frame-loader-header--image">\n <div class="gleap-frame-loader-image-wrap">\n <img class="gleap-frame-loader-image" src="'.concat(p,'" alt="" /></div>\n ').concat(d,'\n <div class="gleap-frame-loader-ramp gleap-frame-loader-ramp--image"></div>\n </div>\n </div>')}var f=null===(l=o.fadebg)||void 0===l||l;return'<div class="gleap-frame-loader">\n <div class="gleap-frame-loader-header gleap-frame-loader-header--colour">\n '.concat(d).concat(f?'\n <div class="gleap-frame-loader-ramp"></div>':"","\n </div>\n </div>")}if(r){var h=String(o.bgImage).replace(/"/g,"&quot;"),g=o.hideNews&&o.hideFeatureRequests&&o.hideAllConversations&&o.hideKnowledgeBase;return'<div class="gleap-frame-loader gleap-frame-loader--image'.concat(1!==a&&2!==a||g?"":" gleap-frame-loader--dockedbar",'">\n <div class="gleap-frame-loader-image-wrap">\n <img class="gleap-frame-loader-image" src="').concat(h,'" alt="" />').concat(c,"</div>\n </div>")}if("classic"===o.bgType){var m,v=null===(m=o.fadebg)||void 0===m||m;return'<div class="gleap-frame-loader">'.concat(v?'<svg width="403" height="598" viewBox="0 0 403 598" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect width="403" height="503" fill="url(#gleap-bg-classic-grad)"/>\n <rect y="158" width="403" height="346" fill="url(#gleap-bg-classic-fade)"/>\n <defs>\n <linearGradient id="gleap-bg-classic-grad" x1="-2.40293e-06" y1="4.72174" x2="427.062" y2="248.078" gradientUnits="userSpaceOnUse">\n <stop class="gleap-bg-grad-1"/>\n <stop class="gleap-bg-grad-2" offset="1"/>\n </linearGradient>\n <linearGradient id="gleap-bg-classic-fade" x1="201" y1="158" x2="201.35" y2="473" gradientUnits="userSpaceOnUse">\n <stop class="gleap-bg-fade" stop-opacity="0"/>\n <stop class="gleap-bg-fade" offset="1"/>\n </linearGradient>\n </defs>\n </svg>':'<svg width="403" height="598" viewBox="0 0 403 598" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M403 0H0V362H403V0Z" fill="url(#gleap-bg-classic-grad)"/>\n <defs>\n <linearGradient id="gleap-bg-classic-grad" x1="-3.25162e-06" y1="3.02267" x2="315.636" y2="283.986" gradientUnits="userSpaceOnUse">\n <stop class="gleap-bg-grad-1"/>\n <stop class="gleap-bg-grad-2" offset="1"/>\n </linearGradient>\n </defs>\n </svg>').concat(c,"</div>")}var y=null===(n=o.animateBG)||void 0===n||n;return'<div class="gleap-frame-loader'.concat(y?" gleap-frame-loader--animate":"",'">\n <svg width="403" height="598" viewBox="0 0 403 598" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#gleap-bg-gradient-clip)">\n <path class="gleap-bg-base" d="M403 0H0V598H403V0Z"/>\n <path class="gleap-bg-c1" d="M0 0H403V308.5L350.5 298.5H294L144.5 250L78.5 152.5L27 125L0 104V0Z"/>\n <path class="gleap-bg-c2" d="M0 151V108V101.5H137L156 151L352 300L106 340L0 344.5V151Z"/>\n <path class="gleap-bg-c3" d="M254.5 118L331.5 94L403 85V318H347.5L221 207L254.5 118Z"/>\n </g>\n <defs>\n <clipPath id="gleap-bg-gradient-clip">\n <rect width="403" height="598" fill="white"/>\n </clipPath>\n </defs>\n </svg>').concat(c,"</div>")}(zn.getInstance().getFlowConfig()),'<iframe class="gleap-frame" scrolling="yes" allow="autoplay; encrypted-media; fullscreen; microphone *; display-capture *; camera *;" frameborder="0"></iframe></div>'),document.body.appendChild(e);var n=e.querySelector(".gleap-frame-loader-image");if(n){var o=function(){var t=e.querySelector(".gleap-frame-loader-image-wrap");t&&t.classList.add("gleap-frame-loader-image-wrap--loaded")};n.complete&&n.naturalWidth>0?o():n.addEventListener("load",o)}t.gleapFrameContainer=e,t.gleapFrame=document.querySelector(".gleap-frame"),Y(t.gleapFrame,t.frameUrl),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),qa(this,"showImage",(function(e){le((function(){var t=document.createElement("div");t.className="gleap-image-view",t.setAttribute("tabindex","-1"),t.innerHTML='<div class="gleap-image-view-close">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm97.9-320l-17 17-47 47 47 47 17 17L320 353.9l-17-17-47-47-47 47-17 17L158.1 320l17-17 47-47-47-47-17-17L192 158.1l17 17 47 47 47-47 17-17L353.9 192z"/></svg>\n </div><img class="gleap-image-view-image" src="'.concat(e,'" />'),document.body.appendChild(t);var n=function(){document.removeEventListener("keydown",o,!0),t.remove()},o=function(e){"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),n())};document.addEventListener("keydown",o,!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(r){t.focus()}}))})),qa(this,"updateFrameStyle",(function(){if(t.gleapFrameContainer){for(var e="gleap-frame-container--survey",n="gleap-frame-container--extended",o="gleap-frame-container--survey-full",r="gleap-frame-container--classic",i="gleap-frame-container--classic-left",a="gleap-frame-container--modern-left",s="gleap-frame-container--no-button",c=[r,i,n,a,s,e,o],l=0;l<c.length;l++)t.gleapFrameContainer.classList.remove(c[l]);var u=void 0,d=zn.getInstance().getFlowConfig();d.feedbackButtonPosition!==D.FEEDBACK_BUTTON_CLASSIC&&d.feedbackButtonPosition!==D.FEEDBACK_BUTTON_CLASSIC_BOTTOM||(u=r),d.feedbackButtonPosition===D.FEEDBACK_BUTTON_CLASSIC_LEFT&&(u=i),d.feedbackButtonPosition===D.FEEDBACK_BUTTON_BOTTOM_LEFT&&(u=a),null===D.getInstance().buttonHidden?d.feedbackButtonPosition===D.FEEDBACK_BUTTON_NONE&&(u=s):D.getInstance().buttonHidden&&(u=s),u&&t.gleapFrameContainer.classList.add(u),"survey"===t.appMode&&t.gleapFrameContainer.classList.add(e),"survey_full"!==t.appMode&&"survey_web"!==t.appMode||t.gleapFrameContainer.classList.add(o),"extended"===t.appMode&&t.gleapFrameContainer.classList.add(n),t.gleapFrameContainer.setAttribute("dir",Yd.getInstance().isRTLLayout?"rtl":"ltr")}})),this.startCommunication(),"undefined"!=typeof window){var n=function(){try{document.documentElement.style.setProperty("--glvh",.01*window.innerHeight+"px")}catch(e){}};try{window.addEventListener("resize",n),n()}catch(o){}}}var t,n,o;return t=e,n=[{key:"setUrlHandler",value:function(e){this.urlHandler=e}},{key:"isSurvey",value:function(){return"survey"===this.appMode||"survey_full"===this.appMode||"survey_web"===this.appMode}},{key:"setAppMode",value:function(e){this.appMode=e,this.updateFrameStyle();var t=document.querySelector(".gleap-frame-container-inner");"widget"!==this.appMode&&"survey_full"!==this.appMode&&"survey_web"!==this.appMode||!t||(t.style.maxHeight="".concat(700,"px"))}},{key:"registerEscListener",value:function(){var e=this;this.escListener||(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.markerManager=void 0,this.gleapFrameContainer=null,this.gleapFrame=null}},{key:"isOpened",value:function(){return this.widgetOpened||null!=this.markerManager}},{key:"showFrameContainer",value:function(e){var t,n=this;if(this.gleapFrameContainer){var o="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.gleapFrameContainer.classList.remove("gleap-frame-container--hidden"),e?this.gleapFrameContainer.classList.add(o):this.gleapFrameContainer.classList.remove(o),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(){this.gleapFrameContainer&&(this.workThroughQueue(),cp.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),Ht.notifyEvent("open"),this.registerEscListener())}},{key:"updateUI",value:function(){Ls.getInstance().clearAllNotifications(this.isSurvey()),D.getInstance().updateNotificationBadge(0),D.getInstance().updateFeedbackButtonState()}},{key:"showWidget",value:function(){var t=this;setTimeout((function(){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:"hideWidget",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("survey_web"!==this.appMode){if(this.hideMarkerManager(),this.gleapFrameContainer){var n=this.gleapFrameContainer;n.classList.remove("gleap-frame-container--animate"),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),n.classList.contains("gleap-frame-container--survey-full")?n.classList.add("gleap-frame-container--hidden"):(n.classList.add("gleap-frame-container--closing"),this.closeTimeout=setTimeout((function(){n.classList.add("gleap-frame-container--hidden"),n.classList.remove("gleap-frame-container--closing"),e.closeTimeout=null}),260))}t&&this.sendMessage({name:"reset-routes",data:{}}),this.widgetOpened=!1,this.updateWidgetStatus(),D.getInstance().updateFeedbackButtonState(),Ht.notifyEvent("close"),Ls.getInstance().reloadNotificationsFromCache(),this.unregisterEscListener(),"undefined"!=typeof window&&void 0!==window.focus&&window.focus()}}},{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),"*"):t&&this.queue.push(e)}catch(n){}}},{key:"sendSessionUpdate",value:function(){this.sendMessage({name:"session-update",data:{sessionData:ba.getInstance().getSession(),apiUrl:ba.getInstance().apiUrl,realtimeHost:ba.getInstance().realtimeHost,sdkKey:ba.getInstance().sdkKey}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:zn.getInstance().getFlowConfig(),aiTools:Jt.getInstance().getAgentTools(),agentTools:Jt.getInstance().getAgentTools(),overrideLanguage:Yd.getInstance().getOverrideLanguage()}}),this.updateFrameStyle())}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new is(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=Ba(this.queue);this.queue=[];for(var t=0;t<e.length;t++)this.sendMessage(e[t],!0)}},{key:"startCommunication",value:function(){var e=this;this.addMessageListener((function(t){if("ping"===t.name&&(e.comReady=!0,e.sendConfigUpdate(),e.sendSessionUpdate(),e.workThroughQueue(),setTimeout((function(){e.runWidgetShouldOpenCallback()}),300)),"play-ping"===t.name&&dn.ping(),"open-image"===t.name&&e.showImage(t.data.url),"page-changed"===t.name&&(!t.data||"newsdetails"!==t.data.name&&"appextended"!==t.data.name?"extended"===e.appMode&&e.setAppMode("widget"):e.setAppMode("extended")),"collect-ticket-data"===t.name&&(e.gleapFrame=document.querySelector(".gleap-frame"),e.answerCollectTicketData(e.gleapFrame,t)),"height-update"===t.name){e.frameHeight=t.data;var n=document.querySelector(".gleap-frame-container-inner");"survey"!==e.appMode&&"survey_full"!==e.appMode&&"survey_web"!==e.appMode||!n||(n.style.maxHeight="".concat(e.frameHeight,"px"))}if("notify-event"===t.name&&Ht.notifyEvent(t.data.type,t.data.data),"cleanup-drawings"===t.name&&e.hideMarkerManager(),"open-url"===t.name){var o=t.data,r=!!t.newTab;e.urlHandler(o,r)}var i;if("start-product-tour"===t.name&&cp.startProductTour(null===(i=t.data)||void 0===i?void 0:i.tourId,!0),"run-custom-action"===t.name&&oo.triggerCustomAction(t.data,{shareToken:t.shareToken}),"close-widget"===t.name&&e.hideWidget(),"video-call-joined"===t.name&&(D.getInstance().showingRedDot=!0,D.getInstance().updateRedDot(!0)),"video-call-left"===t.name&&(D.getInstance().showingRedDot=!1,D.getInstance().updateRedDot(!1)),"tool-execution"===t.name&&(Ht.notifyEvent("tool-execution",t.data),Jt.getInstance().triggerToolAction(t.data)),"frontend-tool-execute"===t.name&&t.data&&Jt.getInstance().executeToolAction(t.data).then((function(t){e.sendMessage({name:"frontend-tool-result",data:t})})),"checklist-loaded"===t.name){var a,s=t.data;Ht.notifyEvent("checklist-loaded",{checklistId:s.id,outboundId:null===(a=s.outbound)||void 0===a?void 0:a.id,completedSteps:s.completedSteps,status:s.status,data:s})}if("checklist-step-completed"===t.name){var c,l=t.data,u=l.checklistData,d=l.step,p=l.index;Ht.notifyEvent("checklist-step-completed",{checklistId:u.id,outboundId:null===(c=u.outbound)||void 0===c?void 0:c.id,stepId:d.id,stepIndex:p,step:d,completedSteps:u.completedSteps,status:u.status,data:u})}if("checklist-completed"===t.name){var f,h=t.data;Ht.notifyEvent("checklist-completed",{checklistId:h.id,outboundId:null===(f=h.outbound)||void 0===f?void 0:f.id,completedSteps:h.completedSteps,status:h.status,data:h})}if("send-feedback"===t.name){if(e.sendingFeedback)return;e.sendingFeedback=!0;var g=t.data.formData,m=t.data.action,v=t.data.outboundId,y=t.data.spamToken;new ja(m.feedbackType,"MEDIUM",g,!1,m.excludeData,v,y).sendFeedback().then((function(t){if(setTimeout((function(){e.sendingFeedback=!1}),1e3),e.sendMessage({name:"feedback-sent",data:t}),Ht.notifyEvent("feedback-sent",g),v&&v.length>0){Ht.notifyEvent("outbound-sent",{outboundId:v,outbound:m,formData:g});try{delete g.reportedBy}catch(n){}cp.trackEvent("outbound-".concat(v,"-submitted"),g)}})).catch((function(t){setTimeout((function(){e.sendingFeedback=!1,e.sendMessage({name:"feedback-sending-failed",data:"Something went wrong, please try again."}),Ht.notifyEvent("error-while-sending")}),1e3)}))}"start-screen-drawing"===t.name&&e.showDrawingScreen(t.data)})),window.addEventListener("message",(function(t){var n=yn.getInstance(),o=n.bannerContainer?n.bannerContainer.querySelector(".gleap-b-frame"):null,r=e.gleapFrame&&t.source===e.gleapFrame.contentWindow,i=o&&t.source===o.contentWindow,a=t.origin===e.frameUrl,s=t.origin===n.bannerUrl;if(r||i||a||s)try{var c=JSON.parse(t.data);if("MODAL"===(null==c?void 0:c.type)||"BANNER"===(null==c?void 0:c.type)||"CHATBAR"===(null==c?void 0:c.type)||"AGENT_CONVERSATION"===(null==c?void 0:c.type))return;for(var l=0;l<e.listeners.length;l++)e.listeners[l]&&e.listeners[l](c)}catch(u){}}))}},{key:"addMessageListener",value:function(e){this.listeners.push(e)}},{key:"answerCollectTicketData",value:function(e,t){var n={customData:co.getInstance().getCustomData(),metaData:us.getInstance().getMetaData(),consoleLog:Yn.getInstance().getLogs(),networkLogs:Ss.getInstance().getRequests(),customEventLog:Nd.getInstance().getEventArray(),formData:co.getInstance().getTicketAttributes()},o=Gd.getInstance().getTags();o&&o.length>0&&(n.tags=o);try{e&&e.contentWindow&&e.contentWindow.postMessage(JSON.stringify({name:"collect-ticket-data",data:n}),"*")}catch(r){}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Ua(t.prototype,n),o&&Ua(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ga(e){return Ga="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},Ga(e)}function Va(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Xa(o.key),o)}}function Ka(e,t,n){return(t=Xa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xa(e){var t=function(e,t){if("object"!=Ga(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ga(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ga(t)?t:String(t)}qa(Wa,"instance",void 0);var Ja=function(){function e(t){var n=this,o=arguments.length>1&&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),Ka(this,"rerender",void 0),Ka(this,"svgElement",null),Ka(this,"path",null),Ka(this,"strPath",void 0),Ka(this,"strokeWidth",12),Ka(this,"strokeWidthRect",6),Ka(this,"bufferSize",4),Ka(this,"buffer",[]),Ka(this,"startPoint",null),Ka(this,"tool","rect"),Ka(this,"color","#EB144C"),Ka(this,"mouseDown",null),Ka(this,"mouseMove",null),Ka(this,"mouseUp",null),Ka(this,"resizeListener",null),Ka(this,"pathBuffer",[]);var r=this;this.rerender=t,this.svgElement=document.querySelector(".bb-capture-svg"),this.svgElement.style.minHeight="".concat(document.documentElement.scrollHeight,"px"),this.trackScroll=!!o,this.scrollListener=null,this.trackScroll&&(this.scrollListener=function(){r.svgElement.style.transform="translate(".concat(-window.scrollX,"px, ").concat(-window.scrollY,"px)"),r.svgElement.style.minWidth="".concat(document.documentElement.scrollWidth,"px")},this.scrollListener(),window.addEventListener("scroll",this.scrollListener,{passive:!0})),this.resizeListener=function(e){r.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"),r.fadeOutToolbar(),"pen"!==r.tool&&"blur"!==r.tool||r.mouseDownPen(e),"rect"===r.tool&&r.mouseDownRect(e)},this.mouseMove=function(e){e.preventDefault(),"pen"!==r.tool&&"blur"!==r.tool||r.mouseMovePen(e),"rect"===r.tool&&r.mouseMoveRect(e)},this.mouseUp=function(e){e.preventDefault(),r.fadeInToolbar(),"pen"!==r.tool&&"blur"!==r.tool||r.mouseUpPen(e),"rect"===r.tool&&r.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,o;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),o=Math.abs(t.y-this.startPoint.y),r=t.x,i=t.y;t.x>this.startPoint.x&&(r=this.startPoint.x),t.y>this.startPoint.y&&(i=this.startPoint.y),this.path.setAttributeNS(null,"x",r),this.path.setAttributeNS(null,"y",i),this.path.setAttributeNS(null,"width",n),this.path.setAttributeNS(null,"height",o)}}},{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 o=this.getMousePosition(e);this.appendToBuffer(o),this.strPath="M"+o.x+" "+o.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,o,r=0,i=0,a=0;for(o=e;o<t;o++)a++,r+=(n=this.buffer[o]).x,i+=n.y;return{x:r/a,y:i/a}}return null}},{key:"updateSvgPath",value:function(){var e=this.getAveragePoint(0);if(e){this.strPath+=" L"+e.x+" "+e.y;for(var t="",n=2;n<this.buffer.length;n+=2)t+=" L"+(e=this.getAveragePoint(n)).x+" "+e.y;this.path.setAttribute("d",this.strPath+t)}}},{key:"appendToBuffer",value:function(e){for(this.buffer.push(e);this.buffer.length>this.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&&Va(t.prototype,n),o&&Va(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ya(e){return Ya="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},Ya(e)}function $a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Qa(o.key),o)}}function Za(e,t,n){return(t=Qa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qa(e){var t=function(e,t){if("object"!=Ya(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ya(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ya(t)?t:String(t)}var es=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Za(this,"keys",{37:1,38:1,39:1,40:1}),Za(this,"supportsPassive",!1),Za(this,"wheelOpt",!!this.supportsPassive&&{passive:!1}),Za(this,"wheelEvent","onwheel"in document.createElement("div")?"wheel":"mousewheel"),Za(this,"scrollDisabled",!1);var t=this;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){t.supportsPassive=!0,t.wheelOpt=!!t.supportsPassive&&{passive:!1}}}))}catch(n){}}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"disableScroll",value:function(){var e=this.getInstance();e.scrollDisabled||(e.scrollDisabled=!0,window.addEventListener("DOMMouseScroll",e.preventDefault,!1),window.addEventListener(e.wheelEvent,e.preventDefault,e.wheelOpt),window.addEventListener("touchmove",e.preventDefault,e.wheelOpt),window.addEventListener("keydown",e.preventDefaultForScrollKeys,!1))}},{key:"enableScroll",value:function(){var e=this.getInstance();e.scrollDisabled&&(e.scrollDisabled=!1,window.removeEventListener("DOMMouseScroll",e.preventDefault,!1),window.removeEventListener(e.wheelEvent,e.preventDefault,e.wheelOpt),window.removeEventListener("touchmove",e.preventDefault,e.wheelOpt),window.removeEventListener("keydown",e.preventDefaultForScrollKeys,!1))}}],(n=[{key:"preventDefault",value:function(e){e.preventDefault()}},{key:"preventDefaultForScrollKeys",value:function(e){if(this.keys&&this.keys[e.keyCode])return this.preventDefault(e),!1}}])&&$a(t.prototype,n),o&&$a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ts(e){return ts="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},ts(e)}function ns(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,rs(o.key),o)}}function os(e,t,n){return(t=rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rs(e){var t=function(e,t){if("object"!=ts(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=ts(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ts(t)?t:String(t)}Za(es,"instance",void 0);var is=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),os(this,"type","screenshot"),os(this,"dragCursor",null),os(this,"screenRecorder",null),os(this,"callback",null),os(this,"screenDrawer",null),os(this,"escListener",null),os(this,"pageLeaveListener",null),os(this,"overrideLanguage",cp.getInstance().overrideLanguage),os(this,"showNextStep",(function(){this.showWidgetUI(),this.callback&&(Wa.getInstance().sendMessage({name:"set-form-data",data:{formKey:"capture",data:{value:this.type,dirty:!0}}}),this.callback(!0))})),this.type=t}var t,n,o;return t=e,n=[{key:"hideWidgetUI",value:function(){var e=document.querySelector(".bb-feedback-button");e&&(e.style.display="none");var t=document.querySelector(".bb-feedback-dialog-container");t&&(t.style.display="none")}},{key:"showWidgetUI",value:function(){"screenshot"===this.type&&es.enableScroll(),this.screenRecorder&&this.screenRecorder.stopScreenRecording(),this.unregisterListeners(),this.cleanupMousePointer(),this.screenDrawer&&this.screenDrawer.destroy();var e=document.querySelector(".bb-capture-toolbar");e&&e.remove();var t=document.querySelector(".bb-capture-svg");t&&t.classList.add("bb-capture-svg--preview");var n=document.querySelector(".bb-capture-preview");n&&n.remove();var o=document.querySelector(".bb-feedback-button");o&&(o.style.display="flex");var r=document.querySelector(".bb-feedback-dialog-container");r&&(r.style.display="block");var i=document.querySelector(".bb-capture-dismiss");i&&(i.style.display="none");var a=document.querySelector(".bb-capture-toolbar-item-colorpicker");a&&(a.style.display="none");var s=document.querySelector(".bb-capture-editor-borderlayer");s&&(s.style.display="none")}},{key:"clear",value:function(){this.screenDrawer&&this.screenDrawer.destroyScrollTracker();var e=document.querySelector(".bb-capture-editor");e&&e.remove()}},{key:"setMouseMove",value:function(e,t){this.dragCursor&&(this.dragCursor.style.left="".concat(e+6,"px"),this.dragCursor.style.top="".concat(t-26,"px"),this.dragCursor.style.right=null)}},{key:"mouseMoveEventHandler",value:function(e){var t=e.clientX,n=e.clientY;this.setMouseMove(t,n)}},{key:"touchMoveEventHandler",value:function(e){var t=e.touches[0].clientX,n=e.touches[0].clientY;this.setMouseMove(t,n)}},{key:"setupMousePointer",value:function(){var e=this;this.dragCursor=document.querySelector(".bb-capture-editor-drag-info");var t=document.querySelector(".bb-capture-svg");t.addEventListener("mouseenter",(function(t){e.dragCursor.style.opacity=1})),t.addEventListener("mouseleave",(function(t){e.dragCursor.style.opacity=0})),document.documentElement.addEventListener("mousemove",this.mouseMoveEventHandler.bind(this)),document.documentElement.addEventListener("touchmove",this.touchMoveEventHandler.bind(this))}},{key:"cleanupMousePointer",value:function(){document.documentElement.removeEventListener("mousemove",this.mouseMoveEventHandler),document.documentElement.removeEventListener("touchmove",this.touchMoveEventHandler);var e=document.querySelector(".bb-capture-toolbar-item[data-type='drag']");e&&(e.removeEventListener("mousedown",this.dragStart),e.removeEventListener("touchstart",this.dragStart),document.removeEventListener("mousemove",this.drag),document.removeEventListener("touchmove",this.drag),document.removeEventListener("mouseup",this.dragEnd),document.removeEventListener("touchend",this.dragEnd)),this.dragCursor&&this.dragCursor.remove()}},{key:"createEditorUI",value:function(){var e=document.createElement("div");e.className="bb-capture-editor",e.innerHTML='\n <div class="bb-capture-editor-borderlayer"></div>\n <svg class="bb-capture-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" xml:space="preserve"></svg>\n <div class="bb-capture-dismiss">'.concat(ge("dismiss"),"</div>\n <div class='bb-capture-editor-drag-info'>").concat(ge("rect"),'</div>\n <div class="bb-capture-toolbar">\n <div class="bb-capture-toolbar-item bb-capture-item-rec bb-capture-toolbar-item-tool drag-handle-item" data-type="drag">\n ').concat(ge("drag"),"\n </div>\n ").concat("capture"===this.type?'<div class="bb-capture-toolbar-item bb-capture-item-rec bb-capture-toolbar-item-recording" data-type="recording">\n '.concat(ge("recorderon"),"\n ").concat(ge("recorderoff"),'\n <span class="bb-tooltip bb-tooltip-screen-recording"></span>\n </div>\n <div class="bb-capture-toolbar-item bb-capture-item-rec" data-type="mic">\n ').concat(ge("mic"),'\n <span class="bb-tooltip bb-tooltip-audio-recording"></span>\n </div>\n <div class="bb-capture-toolbar-item-timer bb-capture-item-rec">2:00</div>\n <div class="bb-capture-toolbar-item-spacer"></div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="pointer">\n ').concat(ge("pointer"),"\n </div>"):"",'\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool bb-capture-toolbar-item--active" data-type="rect">\n ').concat(ge("rect"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="pen">\n ').concat(ge("pen"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="blur">\n ').concat(ge("blur"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem" data-type="colorpicker">\n <div class="bb-capture-toolbar-item-selectedcolor"></div>\n <span class="bb-tooltip">').concat(Yd.translateText("pickAColor"),'</span>\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="undo">\n ').concat(ge("undo"),'\n <span class="bb-tooltip">').concat(Yd.translateText("undo"),"</span>\n </div>\n ").concat("capture"!==this.type?'<div class="bb-capture-button-next">'.concat(Yd.translateText("next"),"</div>"):"",'\n </div>\n <div class="bb-capture-toolbar-item-colorpicker">\n <div class="bb-capture-toolbar-item-color" data-color="#EB144C"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#FF6705"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#FDB903"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#9900EE"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#00D082"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#0A93E4"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#CCCCCC"></div>\n </div>\n <div class="bb-capture-preview">\n <div class="bb-capture-preview-inner">\n <video controls muted autoplay></video>\n <div class="bb-capture-preview-buttons">\n <div class="bb-capture-preview-retrybutton">').concat(Yd.translateText("retry"),'</div>\n <div class="bb-capture-preview-sendbutton">').concat(Yd.translateText("next"),"</div>\n </div>\n </div>\n </div>\n "),document.body.appendChild(e),e.setAttribute("dir",Yd.getInstance().isRTLLayout?"rtl":"ltr")}},{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,o=!1;"key"in(t=t||window.event)&&(n="Escape"===t.key,o="Enter"===t.key),n&&e.dismiss(),"screenshot"===e.type&&o&&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?(cp.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),es.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new Ja(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"),o=document.querySelectorAll(".bb-capture-toolbar-item-color"),r=document.querySelector(".bb-capture-toolbar-item-colorpicker"),i=function(){var i=o[a],s=i.getAttribute("data-color");i.style.backgroundColor=s,i.onclick=function(){i&&(t.screenDrawer.setColor(s),r&&(r.style.display="none"),n.style.backgroundColor=i.style.backgroundColor,e.setPenColor(s))}},a=0;a<o.length;a++)i()}},{key:"dismiss",value:function(){this.showWidgetUI(),this.callback&&this.callback(!1)}},{key:"setupToolbar",value:function(){var e,t,n,o,r=this,i=document.querySelector(".bb-capture-toolbar"),a=!1,s=0,c=0;this.dragStart=function(e){var t=function(){var e=window.getComputedStyle(i).transform;if("none"===e)return{x:0,y:0};var t=new DOMMatrix(e);return{x:t.m41,y:t.m42}}(),r=t.x,l=t.y;s=r,c=l,"mousedown"===e.type?(n=e.clientX-s,o=e.clientY-c):(n=e.touches[0].clientX-s,o=e.touches[0].clientY-c),a=!0},this.dragEnd=function(){a=!1},this.drag=function(r){a&&(r.preventDefault(),"mousemove"===r.type?(e=r.clientX-n,t=r.clientY-o):(e=r.touches[0].clientX-n,t=r.touches[0].clientY-o),s=e,c=t,i.style.transform="translate(".concat(e,"px, ").concat(t,"px)"))};var l=document.querySelector(".bb-capture-toolbar-item[data-type='drag']");l.addEventListener("mousedown",this.dragStart),l.addEventListener("touchstart",this.dragStart),document.addEventListener("mousemove",this.drag),document.addEventListener("touchmove",this.drag),document.addEventListener("mouseup",this.dragEnd),document.addEventListener("touchend",this.dragEnd),document.querySelector(".bb-capture-dismiss").onclick=function(){r.dismiss()};var u=document.querySelector(".bb-capture-button-next");u&&(u.onclick=this.showNextStep.bind(this));for(var d=document.querySelector(".bb-capture-toolbar-item-colorpicker"),p=document.querySelector(".bb-capture-svg"),f=function(e,t){for(var n=document.querySelectorAll(".bb-capture-toolbar-item-tool"),o=0;o<n.length;o++)n[o].classList.remove("bb-capture-toolbar-item--active");if(t.classList.add("bb-capture-toolbar-item--active"),r.screenDrawer.setTool(e),r.dragCursor.innerHTML="","pointer"===e)p.style.pointerEvents="none";else{p.style.pointerEvents="auto";try{var i=t.querySelector("svg").cloneNode(!0);i&&r.dragCursor&&r.dragCursor.appendChild(i)}catch(a){}}},h=document.querySelectorAll(".bb-capture-toolbar-item"),g=function(){var e=h[m];e.onclick=function(){var t=e.getAttribute("data-type");d&&"colorpicker"!==t&&(d.style.display="none"),"mic"===t&&r.screenRecorder.toggleAudio(),"recording"===t&&(r.screenRecorder.isRecording?r.screenRecorder.stopScreenRecording():(r.screenRecorder.startScreenRecording(),f("pointer",document.querySelector(".bb-capture-toolbar-item[data-type='pointer']")))),("capture"!==r.type||r.screenRecorder.isRecording)&&("pen"!==t&&"blur"!==t&&"rect"!==t&&"pointer"!==t||f(t,e),"colorpicker"===t&&("flex"===d.style.display?d.style.display="none":d.style.display="flex"),"undo"===t&&r.screenDrawer.removeLastAddedPathFromSvg())}},m=0;m<h.length;m++)g()}},{key:"captureScreenDrawerRerender",value:function(){if(this.screenDrawer)for(var e="bb-capture-editor-item-inactive",t=document.querySelectorAll(".bb-capture-toolbar-item"),n=0;n<t.length;n++){var o=t[n];"undo"===o.getAttribute("data-type")&&(null!=this.screenDrawer.pathBuffer&&this.screenDrawer.pathBuffer.length>0?o.classList.remove(e):o.classList.add(e))}}},{key:"captureRenderer",value:function(){if(this.screenRecorder){this.screenRecorder.file&&cp.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"),o=document.querySelector(".bb-tooltip-screen-recording"),r=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 c=document.querySelector(".bb-capture-toolbar");document.querySelector(".bb-capture-preview").style.display=this.screenRecorder.file?"flex":"none",c.style.display=this.screenRecorder.file?"none":"flex";for(var l=0;l<n.length;l++){var u=n[l];switch(u.getAttribute("data-type")){case"mic":this.screenRecorder.audioAvailable&&this.screenRecorder.available?(u.classList.remove(e),this.screenRecorder.audioMuted?(u.classList.add("bb-capture-toolbar-item--inactivecross"),r.innerHTML=Yd.translateText("unmute")):(u.classList.remove("bb-capture-toolbar-item--inactivecross"),r.innerHTML=Yd.translateText("mute"))):(u.classList.add(e),u.classList.add("bb-capture-toolbar-item--inactivecross"),r.innerHTML=Yd.translateText("browserNotSupported"));break;case"recording":this.screenRecorder.available?(u.classList.remove(e),this.screenRecorder.isRecording?(u.setAttribute("data-active","true"),o.innerHTML=Yd.translateText("stopRecording"),t.style.display="block"):(u.setAttribute("data-active","false"),o.innerHTML=Yd.translateText("startRecording"),t.style.display="none")):(u.classList.add(e),o.innerHTML=Yd.translateText("browserNotSupported"))}}}}},{key:"setupScreenRecording",value:function(){var e=this;document.querySelector(".bb-capture-preview-sendbutton").onclick=this.showNextStep.bind(this),document.querySelector(".bb-capture-preview-retrybutton").onclick=function(){e.screenRecorder.clearPreview(),e.screenDrawer&&e.screenDrawer.clear()},this.screenRecorder=new Oa(this.captureRenderer.bind(this),Yd.translateText("accessToScreenSharingDenied"))}}],o=[{key:"setPenColor",value:function(e){for(var t=document.querySelectorAll(".bb-pen-tip"),n=0;n<t.length;n++)t[n].style.fill=e}}],n&&ns(t.prototype,n),o&&ns(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function as(e){return as="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},as(e)}function ss(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,ls(o.key),o)}}function cs(e,t,n){return(t=ls(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ls(e){var t=function(e,t){if("object"!=as(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=as(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==as(t)?t:String(t)}var us=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),cs(this,"sessionStart",new Date),cs(this,"appBuildNumber",""),cs(this,"appVersionCode",""),cs(this,"environment","prod"),cs(this,"envDataPropsToIgnore",[]),cs(this,"envDataDisabled",!1)}var t,n,o;return t=e,n=[{key:"getSessionDuration",value:function(){var e=new Date;return Math.round((e.getTime()-this.sessionStart.getTime())/1e3)}},{key:"getMetaData",value:function(){if(this.envDataDisabled)return{};for(var e=this.collectMetaData(),t=0;t<this.envDataPropsToIgnore.length;t++)delete e[this.envDataPropsToIgnore[t]];return e}},{key:"collectMetaData",value:function(){var e,t,n,o=navigator.userAgent,r=navigator.appName,i=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10);-1!==(t=o.indexOf("Opera"))?(r="Opera",i=o.substring(t+6),-1!==(t=o.indexOf("Version"))&&(i=o.substring(t+8))):-1!==(t=o.indexOf("MSIE"))?(r="Microsoft Internet Explorer",i=o.substring(t+5)):-1!==(t=o.indexOf("Chrome"))?(r="Chrome",i=o.substring(t+7)):-1!==(t=o.indexOf("Safari"))?(r="Safari",i=o.substring(t+7),-1!==(t=o.indexOf("Version"))&&(i=o.substring(t+8))):-1!==(t=o.indexOf("Firefox"))?(r="Firefox",i=o.substring(t+8)):(e=o.lastIndexOf(" ")+1)<(t=o.lastIndexOf("/"))&&(r=o.substring(e,t),i=o.substring(t+1),r.toLowerCase()===r.toUpperCase()&&(r=navigator.appName)),-1!==(n=i.indexOf(";"))&&(i=i.substring(0,n)),-1!==(n=i.indexOf(" "))&&(i=i.substring(0,n)),a=parseInt(""+i,10),isNaN(a)&&(i=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10));var s="Unknown OS";return-1!==navigator.appVersion.indexOf("Win")&&(s="Windows"),-1!==navigator.appVersion.indexOf("Mac")&&(s="MacOS"),-1!==navigator.appVersion.indexOf("X11")&&(s="UNIX"),-1!==navigator.appVersion.indexOf("Linux")&&(s="Linux"),-1!==navigator.appVersion.indexOf("iPad")&&(s="iPad"),-1!==navigator.appVersion.indexOf("iPhone")&&(s="iPhone"),-1!==navigator.appVersion.indexOf("Android")&&(s="Android"),{browserName:r+"("+i+")",userAgent:o,browser:r,systemName:s,buildVersionNumber:this.appBuildNumber,releaseVersionNumber:this.appVersionCode,sessionDuration:this.getSessionDuration(),devicePixelRatio:window.devicePixelRatio,screenWidth:window.screen.width,screenHeight:window.screen.height,innerWidth:window.innerWidth,innerHeight:window.innerHeight,currentUrl:window.location.href,language:navigator.language||navigator.userLanguage,mobile:ee(),sdkVersion:"18.1.2",sdkType:"javascript",environment:this.environment}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"setAppVersionCode",value:function(e){this.getInstance().appVersionCode=e}},{key:"setAppBuildNumber",value:function(e){this.getInstance().appBuildNumber=e}},{key:"setEnvDataPropsToIgnore",value:function(e){this.getInstance().envDataPropsToIgnore=Array.isArray(e)?e.slice():[]}},{key:"setDisableEnvData",value:function(e){this.getInstance().envDataDisabled=!!e}}],n&&ss(t.prototype,n),o&&ss(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ds(e){return ds="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},ds(e)}function ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function fs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ps(Object(n),!0).forEach((function(t){gs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ps(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hs(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,ms(o.key),o)}}function gs(e,t,n){return(t=ms(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ms(e){var t=function(e,t){if("object"!=ds(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=ds(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ds(t)?t:String(t)}cs(us,"instance",void 0);var vs=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),gs(this,"modalUrl","https://outboundmedia.gleap.io/modal"),gs(this,"modalContainer",null),gs(this,"modalData",null),gs(this,"modalBackdropClickListener",null),gs(this,"modalResizeListener",null),gs(this,"modalLoadTimeout",null),gs(this,"modalLoaded",!1),gs(this,"lastSentMaxHeight",0),gs(this,"disabled",!1),this._listenForMessages()}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"setModalUrl",value:function(e){this.modalUrl=e}},{key:"_maxModalHeight",value:function(){var e,t=(null===(e=document.documentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight||0;return Math.floor(.9*t)}},{key:"disable",value:function(){this.disabled=!0,this.hideModal()}},{key:"_listenForMessages",value:function(){var e=this;window.addEventListener("message",(function(t){var n,o=e.modalContainer?e.modalContainer.querySelector(".gleap-modal-frame"):null,r=o&&t.source===o.contentWindow,i=null===(n=e.modalUrl)||void 0===n?void 0:n.includes(t.origin);if(r||i)try{var a,s,c,l,u,d,p,f,h,g,m=JSON.parse(t.data);if("MODAL"!==(null==m?void 0:m.type))return;if("modal-loaded"===m.name&&(e.modalLoaded=!0,e._clearLoadWatchdog()),"modal-loaded"===m.name&&e.modalData){var v=zn.getInstance().getFlowConfig(),y=v.color?v.color:"#485BFF",b=v.backgroundColor?v.backgroundColor:"#FFFFFF";e.lastSentMaxHeight=e._maxModalHeight(),e._postMessage({name:"modal-data",data:fs(fs({},e.modalData),{},{primaryColor:y,backgroundColor:b,maxHeight:e.lastSentMaxHeight})})}if("modal-height"===m.name){var w,k=null==m||null===(w=m.data)||void 0===w?void 0:w.height;if(k){var x=e.modalContainer.querySelector(".gleap-modal-frame");x&&(x.style.height="".concat(k,"px")),e._revealModal()}}if(m.name,"modal-close"===m.name&&e.hideModal(),"start-conversation"===m.name&&cp.startBot(null===(a=m.data)||void 0===a?void 0:a.botId),"start-custom-action"===m.name&&cp.triggerCustomAction(null===(s=m.data)||void 0===s?void 0:s.action),"start-product-tour"===m.name&&cp.startProductTour(null===(c=m.data)||void 0===c?void 0:c.tourId,!0),"open-url"===m.name){var S=m.data,C=!!m.newTab;Wa.getInstance().urlHandler(S,C)}"show-form"===m.name&&cp.startFeedbackFlow(null===(l=m.data)||void 0===l?void 0:l.formId),"show-survey"===m.name&&cp.showSurvey(null===(u=m.data)||void 0===u?void 0:u.formId,null===(d=m.data)||void 0===d?void 0:d.surveyFormat),"show-news-article"===m.name&&cp.openNewsArticle(null===(p=m.data)||void 0===p?void 0:p.articleId),"show-help-article"===m.name&&cp.openHelpCenterArticle(null===(f=m.data)||void 0===f?void 0:f.articleId),"show-checklist"===m.name&&cp.startChecklist(null===(h=m.data)||void 0===h?void 0:h.checklistId,!0,null===(g=m.data)||void 0===g?void 0:g.sharedKey)}catch(I){}}))}},{key:"_injectModalUI",value:function(e){var t=this;if(!document.body)return!1;if(this.disabled)return!1;this.modalContainer&&this.hideModal(),this.modalData=e;var n=document.createElement("div");n.className="gleap-modal-wrapper gleap-modal-wrapper--loading",n.innerHTML='\n <div class="gleap-modal-backdrop"></div>\n <div class="gleap-modal">\n <iframe\n class="gleap-modal-frame"\n scrolling="no"\n title="Gleap Modal"\n role="dialog"\n frameborder="0"\n allow="autoplay; encrypted-media; fullscreen; microphone *;"\n ></iframe>\n </div>\n ',document.body.appendChild(n),this.modalContainer=n;var o=n.querySelector(".gleap-modal-frame");o&&(Y(o,this.modalUrl),this._armLoadWatchdog(o)),this.modalBackdropClickListener=this.modalContainer.querySelector(".gleap-modal-backdrop").addEventListener("click",(function(){var e,n;(null===(e=null===(n=t.modalData)||void 0===n?void 0:n.showCloseButton)||void 0===e||e)&&t.hideModal()})),window.addEventListener("resize",this.modalResizeListener=this._handleResize.bind(this)),document.body.classList.add("gleap-modal-open")}},{key:"_revealModal",value:function(){this.modalContainer&&this.modalContainer.classList.remove("gleap-modal-wrapper--loading")}},{key:"_armLoadWatchdog",value:function(e){var t=this;this._clearLoadWatchdog(),this.modalLoaded=!1,this.modalLoadTimeout=setTimeout((function(){if(t.modalLoadTimeout=null,!t.modalLoaded&&t.modalContainer){try{e.getAttribute("src")!==t.modalUrl&&(e.src=t.modalUrl)}catch(n){}t.modalLoadTimeout=setTimeout((function(){if(t.modalLoadTimeout=null,!t.modalLoaded&&t.modalContainer){try{console.warn("Gleap: the info card ("+t.modalUrl+") 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.hideModal()}}),8e3)}}),8e3)}},{key:"_clearLoadWatchdog",value:function(){this.modalLoadTimeout&&(clearTimeout(this.modalLoadTimeout),this.modalLoadTimeout=null)}},{key:"_handleResize",value:function(){var e=this._maxModalHeight();e<=0||e===this.lastSentMaxHeight||(this.lastSentMaxHeight=e,this._postMessage({name:"modal-max-height",data:{maxHeight:e}}))}},{key:"_postMessage",value:function(e){try{var t=this.modalContainer.querySelector(".gleap-modal-frame");null!=t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(fs(fs({},e),{},{type:"modal"})),"*")}catch(n){}}},{key:"showModal",value:function(e){e&&e.config&&this._injectModalUI(e.config)}},{key:"hideModal",value:function(){this.modalContainer&&(this.modalBackdropClickListener&&this.modalContainer.querySelector(".gleap-modal-backdrop").removeEventListener("click",this.modalBackdropClickListener),this.modalResizeListener&&(window.removeEventListener("resize",this.modalResizeListener),this.modalResizeListener=null),this._clearLoadWatchdog(),this.modalLoaded=!1,this.lastSentMaxHeight=0,document.body.removeChild(this.modalContainer),this.modalContainer=null,document.body.classList.remove("gleap-modal-open"))}}])&&hs(t.prototype,n),o&&hs(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ys(e){return ys="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},ys(e)}function bs(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,ks(o.key),o)}}function ws(e,t,n){return(t=ks(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ks(e){var t=function(e,t){if("object"!=ys(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=ys(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ys(t)?t:String(t)}gs(vs,"instance",void 0);var xs=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ws(this,"startTimestamp",Date.now()),ws(this,"requestId",0),ws(this,"requests",{}),ws(this,"externalRequests",[]),ws(this,"maxRequests",30),ws(this,"filters",[]),ws(this,"defaultBlacklist",["gleap.io","gleap.ai"]),ws(this,"blacklist",[]),ws(this,"initialized",!1),ws(this,"stopped",!1),ws(this,"loadAllResources",!1)}var t,n,o;return t=e,n=[{key:"setLoadAllResources",value:function(e){this.loadAllResources=e}},{key:"isContentTypeSupported",value:function(e){if("string"!=typeof e)return!1;if(""===e)return!0;e=e.toLocaleLowerCase();for(var t=["text/","xml","json"],n=0;n<t.length;n++)if(e.includes(t[n]))return!0;return!1}},{key:"getRequests",value:function(){var e=JSON.parse(JSON.stringify(Object.values(this.requests)));if(this.externalRequests&&this.externalRequests.length>0&&(e=e.concat(this.externalRequests)),this.filters&&this.filters.length>0)for(var t=0;t<e.length;t++){var n=e[t];if(n&&n.request&&n.request.headers)for(var o=0;o<this.filters.length;o++)delete n.request.headers[this.filters[o]];if(n&&n.request&&n.request.payload){var r=n.request.payload;try{r=JSON.parse(n.request.payload)}catch(l){}if(r){for(o=0;o<this.filters.length;o++)delete r[this.filters[o]];n.request.payload=JSON.stringify(r)}}if(n&&n.response&&n.response.responseText)try{var i=JSON.parse(n.response.responseText);for(o=0;o<this.filters.length;o++)delete i[this.filters[o]];n.response.responseText=JSON.stringify(i)}catch(l){}}try{if("undefined"!=typeof window&&window.performance){var a=window.performance.getEntriesByType("resource");for(t=0;t<a.length;t++){var s=a[t];s&&s.name&&(this.loadAllResources||["xmlhttprequest","fetch"].indexOf(s.initiatorType)>-1)&&!e.find((function(e){return e.url===s.name}))&&e.push({type:"RESOURCE",date:new Date(this.startTimestamp+s.startTime),url:s.name,duration:Math.round(s.duration),initiatorType:s.initiatorType})}}}catch(u){}var c=this.blacklist.concat(this.defaultBlacklist);if(c&&c.length>0)try{e=e.filter((function(e){for(var t=0;t<c.length;t++)if(e&&e.url&&e.url.includes(c[t]))return!1;return!0}))}catch(u){}return e}},{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.filters=this.filters.concat(e||[])}},{key:"setBlacklist",value:function(e){this.blacklist=this.blacklist.concat(e||[])}},{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<t.length;n++)delete this.requests[t[n]]}},{key:"calcRequestTime",value:function(e){if(e&&this.requests&&this.requests[e]){var t=this.requests[e].date;t&&(this.requests[e].duration=(new Date).getTime()-t.getTime())}}},{key:"getTextContentSize",value:function(e){var t=0;try{t=(new TextEncoder).encode(e).length}catch(n){try{t=encodeURI(s).split(/%..|./).length-1}catch(n){try{t=new Blob([e]).size}catch(n){t=e.length}}}return t/1024/1024}},{key:"cleanupContentSize",value:function(e){return this.getTextContentSize(e)>.15?"<content_too_large>":e}},{key:"cleanupPayload",value:function(e){if(null==e)return"{}";try{if(void 0!==("undefined"==typeof TextDecoder?"undefined":ys(TextDecoder))&&ArrayBuffer.isView(e))return(new TextDecoder).decode(e)}catch(t){}return e}},{key:"preparePayload",value:function(e){var t=this.cleanupPayload(e);return this.cleanupContentSize(t)}},{key:"start",value:function(){var e=this;if(!this.initialized){this.initialized=!0;var t=this;this.interceptNetworkRequests({onFetch:function(n,o){if(!e.stopped&&o&&e.requests){if(n.length>0&&void 0!==n[0]&&void 0!==n[0].url)e.requests[o]={url:n[0].url,date:new Date,request:{payload:"",headers:void 0!==n[0].headers?Object.fromEntries(n[0].headers.entries()):{}},type:void 0!==n[0].method?n[0].method:""};else if(n.length>=2&&n[1]){var r=n[1]&&n[1].method?n[1].method:"GET";e.requests[o]={request:{payload:t.preparePayload(n[1].body),headers:n[1].headers},type:r,url:n[0],date:new Date}}else e.requests[o]={url:n[0],date:new Date};e.cleanRequests()}},onFetchLoad:function(n,o){if(!e.stopped&&o&&e.requests&&e.requests[o]){try{e.requests[o].success=!0,e.requests[o].response={status:n.status,statusText:"",responseText:"<request_still_open>"},e.calcRequestTime(o)}catch(i){}try{var r="";n.headers&&void 0!==n.headers.get&&(r=n.headers.get("content-type")),e.isContentTypeSupported(r)?n.text().then((function(r){e.requests[o]&&(e.requests[o].success=!0,e.requests[o].response={status:n.status,statusText:n.statusText,responseText:t.cleanupContentSize(r)}),e.calcRequestTime(o),e.cleanRequests()})).catch((function(t){e.cleanRequests()})):(e.requests[o]&&(e.requests[o].success=!0,e.requests[o].response={status:n.status,statusText:n.statusText,responseText:"<content_type_not_supported>"}),e.calcRequestTime(o),e.cleanRequests())}catch(i){}}},onFetchFailed:function(t,n){!e.stopped&&n&&e.requests&&e.requests[n]&&(e.requests[n].success=!1,e.calcRequestTime(n),e.cleanRequests())},onOpen:function(t,n){e.stopped||(t&&t.bbRequestId&&n.length>=2&&e.requests&&(e.requests[t.bbRequestId]={type:n[0],url:n[1],date:new Date}),e.cleanRequests())},onSend:function(t,n){e.stopped||(t&&t.bbRequestId&&e.requests&&e.requests[t.bbRequestId]&&(e.requests[t.bbRequestId].request={payload:e.preparePayload(n.length>0?n[0]:"{}"),headers:t.requestHeaders}),e.cleanRequests())},onError:function(t,n){!e.stopped&&e.requests&&t&&t.currentTarget&&t.currentTarget.bbRequestId&&e.requests[t.currentTarget.bbRequestId]&&(e.requests[t.currentTarget.bbRequestId].success=!1,e.calcRequestTime(t.bbRequestId)),e.cleanRequests()},onLoad:function(t,n){if(!e.stopped){if(t&&t.currentTarget&&t.currentTarget.bbRequestId&&e.requests&&e.requests[t.currentTarget.bbRequestId]){var o=t.currentTarget,r=o.responseType,i="<"+r+">";""!==r&&"text"!==r||(i=e.cleanupContentSize(o.responseText)),e.requests[o.bbRequestId].success=!0,e.requests[o.bbRequestId].response={status:o.status,statusText:o.statusText,responseText:i},e.calcRequestTime(o.bbRequestId)}e.cleanRequests()}}})}}},{key:"interceptNetworkRequests",value:function(e){var t,n=this,o=XMLHttpRequest.prototype.open,r=XMLHttpRequest.prototype.send;return void 0===XMLHttpRequest.prototype.gleapSetRequestHeader&&(XMLHttpRequest.prototype.gleapSetRequestHeader=XMLHttpRequest.prototype.setRequestHeader),XMLHttpRequest.prototype.gleapSetRequestHeader&&(XMLHttpRequest.prototype.setRequestHeader=function(e,t){try{this.requestHeaders||(this.requestHeaders={}),this.requestHeaders[e]||(this.requestHeaders[e]=[]),this.requestHeaders[e].push(t)}catch(n){}return this.gleapSetRequestHeader(e,t)}),XMLHttpRequest.prototype.open=function(){try{this.bbRequestId=++n.requestId,e.onOpen&&e.onOpen(this,arguments),e.onLoad&&this.addEventListener("load",e.onLoad.bind(e)),e.onError&&this.addEventListener("error",e.onError.bind(e))}catch(t){}return o.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){try{e.onSend&&e.onSend(this,arguments)}catch(t){}return r.apply(this,arguments)},window.fetch&&(t=window.fetch,window.fetch=function(){var o=++n.requestId;try{e.onFetch(arguments,o)}catch(r){}return t.apply(this,arguments).then((function(t){try{if(t&&"function"==typeof t.clone){var n=t.clone();e.onFetchLoad(n,o)}}catch(r){}return t})).catch((function(t){try{e.onFetchFailed(t,o)}catch(r){}throw t}))}),e}},{key:"blobToTextPromise",value:function(e){return new Promise((function(t,n){var o=new FileReader;o.onload=function(e){e&&e.target&&e.target.result?t(e.target.result):n()},o.onerror=function(e){n(e)},o.readAsText(e)}))}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&bs(t.prototype,n),o&&bs(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();ws(xs,"instance",void 0);const Ss=xs;function Cs(e){return Cs="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},Cs(e)}function Is(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Es(o.key),o)}}function Ts(e,t,n){return(t=Es(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Es(e){var t=function(e,t){if("object"!=Cs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Cs(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Cs(t)?t:String(t)}var Ls=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ts(this,"notificationContainer",null),Ts(this,"notifications",[]),Ts(this,"unreadCount",0),Ts(this,"unreadNotificationsKey","unread-notifications"),Ts(this,"isTabActive",!0),Ts(this,"showNotificationBadge",!0),Ts(this,"lastPageRulesUrl",void 0),Ts(this,"stackResizeObserver",null),Ts(this,"currentNewsIndex",0)}var t,n,o;return t=e,n=[{key:"updateTabBarNotificationCount",value:function(){Ht.notifyEvent("unread-count-changed",this.unreadCount)}},{key:"injectNotificationUI",value:function(){if(!this.notificationContainer){var e=document.createElement("div");e.className="gleap-notification-container gleap-font",document.body.appendChild(e),this.notificationContainer=e,e.addEventListener("click",(function(t){e.classList.contains("gleap-notification-container--stack")&&!e.classList.contains("gleap-notification-container--expanded")&&window.matchMedia&&window.matchMedia("(hover: none)").matches&&(t.target&&t.target.closest&&t.target.closest(".gleap-notification-close")||(t.preventDefault(),t.stopPropagation(),e.classList.add("gleap-notification-container--expanded")))}),!0),this.updateContainerStyle(),this.reloadNotificationsFromCache(),Hd.getInstance().start()}}},{key:"reloadNotificationsFromCache",value:function(){try{var e=se(this.unreadNotificationsKey);if(e&&e.length>0){var t=e.filter((function(e){var t;return"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=t.slice(-4),this.renderNotifications()}}catch(n){}}},{key:"notificationPassesPageRules",value:function(e){try{var t="undefined"!=typeof window&&window.location?window.location.href:void 0;return!t||ia(t,e)}catch(n){return!0}}},{key:"getVisibleNotifications",value:function(){var e=this;return 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(),D.getInstance().updateNotificationBadge(this.unreadCount)}},{key:"showNotification",value:function(e){if(this.notificationContainer&&e&&e.data){try{var t,n,o=null==e||null===(t=e.data)||void 0===t?void 0:t.lastSource,r=an.getInstance(),i=(null==r||null===(n=r.config)||void 0===n?void 0:n.enabled)||(null==r?void 0:r.manuallyShown)||r&&!r.isHidden;if("chatbar"===o&&i)return void r.showChatbarNotification(e.data)}catch(a){}for(this.notifications.find((function(t){return e.outbound===t.outbound}))||(this.notifications.push(e),e.sound&&this.notificationPassesPageRules(e)&&dn.ping());this.notifications.length>4;)this.notifications.shift();ce(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=ge("dismiss"),this.notificationContainer.appendChild(t);var n=this.getVisibleNotifications(),o=n.filter((function(e){return e.data.news})).sort((function(e,t){return new Date(e.createdAt)-new Date(t.createdAt)})),r=n.filter((function(e){return!e.data.news}));if(o.length>0){var i=this.currentNewsIndex<o.length?this.currentNewsIndex:0,a=o[i],s=document.createElement("div");s.className="gleap-notification-item-news gleap-notification-card";var c=document.createElement("div");if(c.className="gleap-notification-item-news-container",a.data.coverImageUrl&&""!==a.data.coverImageUrl&&!a.data.coverImageUrl.includes("NewsImagePlaceholder")){var l=document.createElement("img");l.className="gleap-notification-item-news-image",l.src=a.data.coverImageUrl,l.onclick=function(t){t.stopPropagation(),e.openNews(a)},c.appendChild(l)}var u=document.createElement("div");u.className="gleap-notification-item-news-content";var d=document.createElement("div");d.className="gleap-notification-item-news-content-title";var p=a.data.text||"";p=p.replaceAll("{{name}}",ba.getInstance().getName()),d.innerText=p,d.onclick=function(t){t.stopPropagation(),e.openNews(a)},u.appendChild(d);var f=this.renderDescription(a);if(f){var h=document.createElement("div");h.className="gleap-notification-item-news-preview",h.innerHTML=f,u.appendChild(h)}if(o.length>1){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(o.length),g.appendChild(m);var v=document.createElement("button");v.className="gleap-news-next-button",i<o.length-1?(v.innerText=Yd.translateText("next"),v.onclick=function(t){t.stopPropagation(),e.currentNewsIndex++,e.renderNotifications()}):(v.innerText=Yd.translateText("done"),v.onclick=function(t){t.stopPropagation(),e.clearAllNotifications(),e.currentNewsIndex=0}),g.appendChild(v),u.appendChild(g)}c.appendChild(u),s.appendChild(c),this.notificationContainer.appendChild(s)}for(var y=function(){var t=r[b],n=t.data.text||"";n=n.replaceAll("{{name}}",ba.getInstance().getName());var o=document.createElement("div");if(o.onclick=function(){t.data.conversation?cp.openConversation(t.data.conversation.shareToken,!0):t.data.checklist?cp.openChecklist(t.data.checklist.id,!0):cp.open()},t.data.checklist){var i=Math.round(t.data.currentStep/t.data.totalSteps*100);i<100&&(i+=4),o.className="gleap-notification-item-checklist gleap-notification-card",o.innerHTML='\n <div class="gleap-notification-item-checklist-container">\n <div class="gleap-notification-item-checklist-content">\n <div class="gleap-notification-item-checklist-content-title">\n '.concat(t.data.text,'\n </div>\n <div class="gleap-notification-item-checklist-content-progress">\n <div class="gleap-notification-item-checklist-content-progress-inner" style="width: ').concat(i,'%;"></div>\n </div>\n <div class="gleap-notification-item-checklist-content-next">\n <svg width="24" height="24" viewBox="0 0 24 24"\n fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M4 12H20M20 12L14 6M20 12L14 18"\n stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n ').concat(t.data.nextStepTitle,"\n </div>\n </div>\n </div>")}else o.className="gleap-notification-item gleap-notification-card",o.innerHTML='\n <div class="gleap-notification-item-container">\n '.concat(e.renderAvatar(t.data.sender,"gleap-notification-item-avatar"),'\n <div class="gleap-notification-item-body">\n <div class="gleap-notification-item-content">').concat(n,"</div>\n ").concat(e.renderMeta(t),"\n </div>\n </div>");e.notificationContainer.appendChild(o)},b=0;b<r.length;b++)y();o.length>0||r.length>0||this.clearAllNotifications(!0);var w=(o.length>0?1:0)+r.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})),o=n[n.length-1],r=0,i=0,a=t.length-1;a>=0;a--){var s=t.length-1-a,c=0===s?0:1===s?9:17;t[a].style.setProperty("--gleap-nstack-collapse","".concat(n[a]-o-c,"px")),t[a].style.setProperty("--gleap-nstack-expand","".concat(-i,"px"));var l=n[a]-(o-12);t[a].style.setProperty("--gleap-nstack-clip",s>0&&l>0?"".concat(l,"px"):"-40px"),i+=n[a],r+=n[a]}e.style.setProperty("--gleap-nstack-h-collapsed","".concat(o+17,"px")),e.style.setProperty("--gleap-nstack-h-expanded","".concat(r,"px"))}catch(u){}};if(n(),"undefined"!=typeof ResizeObserver){this.stackResizeObserver=new ResizeObserver(n);for(var o=0;o<t.length;o++)this.stackResizeObserver.observe(t[o])}}catch(r){}}},{key:"openNews",value:function(e){e.data.news?cp.openNewsArticle(e.data.news.id,!0):cp.open()}},{key:"renderAvatar",value:function(e,t){if(!e||!e.profileImageUrl)return"";var n=String(e.name||"").replace(/"/g,"&quot;"),o=e.isBot?"".concat(t," ").concat(t,"--bot"):t;return'<img class="'.concat(o,'" src="').concat(e.profileImageUrl,'" alt="').concat(n,'" />')}},{key:"renderMeta",value:function(e){var t=e.data.sender,n=[];t&&t.name&&n.push('<span class="gleap-notification-item-sender">'.concat(t.name,"</span>"));var o=function(e,t){try{if(!e||"undefined"==typeof Intl||"function"!=typeof Intl.RelativeTimeFormat)return"";var n,o=new Date(e).getTime();if(isNaN(o))return"";try{n=new Intl.RelativeTimeFormat(t||void 0,{numeric:"auto"})}catch(c){n=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"})}var r=Math.min(0,(o-Date.now())/1e3);if(r>-60)return n.format(0,"second");for(var i=r/60,a=0;a<re.length;a++){var s=re[a];if(Math.abs(i)<s.amount)return n.format(Math.round(i),s.unit);i/=s.amount}}catch(c){}return""}(e.sendAt||e.createdAt,Yd.getInstance().getActiveLanguage());return o&&n.push('<span class="gleap-notification-item-time">'.concat(o,"</span>")),0===n.length?"":'<div class="gleap-notification-item-meta">'.concat(n.join('<span class="gleap-notification-item-meta-dot">•</span>'),"</div>")}},{key:"renderDescription",value:function(e){var t=e.data,n=t.previewText,o=t.sender;return n&&n.length>0?n:o?'\n <div class="gleap-notification-item-news-sender">\n '.concat(this.renderAvatar(o,"gleap-notification-item-news-sender-avatar"),"\n ").concat(o.name,"\n </div>\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},o=se(this.unreadNotificationsKey);o&&o.length>0&&ce(this.unreadNotificationsKey,o.filter((function(e){return!n(e)})));var r,i=this.notifications.length;this.notifications=this.notifications.filter((function(e){return!n(e)})),this.notifications.length!==i&&this.renderNotifications(),t||Hd.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(r=ba.getInstance().session)||void 0===r?void 0:r.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(this.notificationContainer){for(e||(this.notifications=[],this.currentNewsIndex=0,ce(this.unreadNotificationsKey,this.notifications));this.notificationContainer.firstChild;)this.notificationContainer.removeChild(this.notificationContainer.firstChild);if(!e&&!t)try{var n;Hd.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=ba.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(o){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=zn.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!==D.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==D.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===D.getInstance().buttonHidden?e.feedbackButtonPosition===D.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):D.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",Yd.getInstance().isRTLLayout?"rtl":"ltr")}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Is(t.prototype,n),o&&Is(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Os(e){return Os="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},Os(e)}function Ms(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Ps(o.key),o)}}function As(e,t,n){return(t=Ps(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ps(e){var t=function(e,t){if("object"!=Os(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Os(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Os(t)?t:String(t)}Ts(Ls,"instance",void 0);var Rs=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),As(this,"formPreFill",{})}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=null)&&Ms(t.prototype,n),o&&Ms(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 Ns(e){return function(e){if(Array.isArray(e))return Ds(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 Ds(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 Ds(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 Ds(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Fs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach((function(t){Bs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bs(e,t,n){return t=function(e){var t=function(e,t){if("object"!=_s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=_s(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_s(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}As(Rs,"instance",void 0);var Hs=function(){var e={};function t(){e=Fs({animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function n(t){return t?e[t]:e}function o(e,t,n,o){return(e/=o/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}function r(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),o=Array.from(e.querySelectorAll(t));return[].concat(Ns(n?[e]:[]),o)})).filter((function(e){return"none"!==getComputedStyle(e).pointerEvents&&function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}(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}}var s={};function c(e,t){s[e]=t}function l(e){return e?s[e]:s}function u(){s={}}var d={};function p(e,t){d[e]=t}function f(e){var t;null==(t=d[e])||t.call(d)}function h(e){if(e){var t=e.getBoundingClientRect(),n={x:t.x,y:t.y,width:t.width,height:t.height};c("__activeStagePosition",n),m(n)}}function g(e){var t=function(e){var t=window.innerWidth,o=window.innerHeight,r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.classList.add("gleap-tour-overlay","gleap-tour-overlay-animated"),r.setAttribute("viewBox","0 0 ".concat(t," ").concat(o)),r.setAttribute("xmlSpace","preserve"),r.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),r.setAttribute("version","1.1"),r.setAttribute("preserveAspectRatio","xMinYMin slice"),r.style.fillRule="evenodd",r.style.clipRule="evenodd",r.style.strokeLinejoin="round",r.style.strokeMiterlimit="2",r.style.zIndex="10000",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%";var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",v(e)),i.style.fill=n("overlayColor")||"rgb(0,0,0)",i.style.opacity="".concat(n("overlayOpacity")),i.style.pointerEvents="auto",i.style.cursor="auto",r.appendChild(i),r}(e);document.body.appendChild(t),S(t,(function(e){"path"===e.target.tagName&&f("overlayClick")})),c("__overlaySvg",t)}function m(e){var t=l("__overlaySvg");if(t){var n=t.firstElementChild;if("path"!==(null==n?void 0:n.tagName))throw new Error("no path element found in stage svg");n.setAttribute("d",v(e))}else g(e)}function v(e){var t=window.innerWidth,o=window.innerHeight,r=n("stagePadding")||0,i=n("stageRadius")||0,a=e.width+2*r,s=e.height+2*r,c=Math.min(i,a/2,s/2),l=Math.floor(Math.max(c,0)),u=e.x-r+l,d=e.y-r,p=a-2*l,f=s-2*l;return"M".concat(t,",0L0,0L0,").concat(o,"L").concat(t,",").concat(o,"L").concat(t,",0Z\n M").concat(u,",").concat(d," h").concat(p," a").concat(l,",").concat(l," 0 0 1 ").concat(l,",").concat(l," v").concat(f," a").concat(l,",").concat(l," 0 0 1 -").concat(l,",").concat(l," h-").concat(p," a").concat(l,",").concat(l," 0 0 1 -").concat(l,",-").concat(l," v-").concat(f," a").concat(l,",").concat(l," 0 0 1 ").concat(l,",-").concat(l," z")}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,r=e.element,a=r;if("string"==typeof a)try{a=document.querySelector(r)}catch(u){var s=r.replace(/(#[^#\s]+)/g,(function(e){return e.replace(/:/g,"\\:")}));a=document.querySelector(s)}if(r&&!a&&t>=0)setTimeout((function(){C(),y(e,t-100)}),100);else{if(!a){if(e.element){try{console.warn("[Gleap] Product tour selector did not match:",e.element)}catch(d){}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 r,a,s=400,u=Date.now(),d=l("__activeStep"),p=l("__activeElement")||e,f=!p||p===e,g="gleap-tour-dummy-element"===e.id,v="gleap-tour-dummy-element"===p.id,y=n("animate"),b=t.onHighlightStarted||n("onHighlightStarted"),w=(null==t?void 0:t.onHighlighted)||n("onHighlighted"),k=(null==d?void 0:d.onDeselected)||n("onDeselected"),x=n(),S=l();!f&&k&&k(v?void 0:p,d,{config:x,state:S});b&&b(g?void 0:e,t,{config:x,state:S});var T=!f&&y,E=!1;C(),c("previousStep",d),c("previousElement",p),c("activeStep",t),c("activeElement",e);var L=function r(){if(l("__transitionCallback")===r){var i=Date.now()-u,a=s-i<=s/2;t.popover&&a&&!E&&T&&(I(e,t),E=!0),n("animate")&&i<s?function(e,t,n,r){var i=l("__activeStagePosition"),a=i||n.getBoundingClientRect(),s=r.getBoundingClientRect();m(i={x:o(e,a.x,s.x-a.x,t),y:o(e,a.y,s.y-a.y,t),width:o(e,a.width,s.width-a.width,t),height:o(e,a.height,s.height-a.height,t)}),c("__activeStagePosition",i)}(i,s,p,e):(h(e),w&&w(g?void 0:e,t,{config:n(),state:l()}),c("__transitionCallback",void 0),c("__previousStep",d),c("__previousElement",p),c("__activeStep",t),c("__activeElement",e)),window.requestAnimationFrame(r)}};c("__transitionCallback",L),window.requestAnimationFrame(L),i(e),!T&&t.popover&&I(e,t);p.classList.remove("gleap-tour-active-element","gleap-tour-no-interaction"),p.removeAttribute("aria-haspopup"),p.removeAttribute("aria-expanded"),p.removeAttribute("aria-controls"),null!==(r=null!==(a=t.disableActiveInteraction)&&void 0!==a?a:n("disableActiveInteraction"))&&void 0!==r&&r&&e.classList.add("gleap-tour-no-interaction");e.classList.add("gleap-tour-active-element"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls","gleap-tour-popover-content")}(a,e)}}function b(){var e=l("__activeElement"),t=l("__activeStep");if(e&&t){if(!document.body.contains(e)&&t.element&&"string"==typeof t.element)try{var n=document.querySelector(t.element);if(!n){var o=t.element.replace(/(#[^#\s]+)/g,(function(e){return e.replace(/:/g,"\\:")}));n=document.querySelector(o)}n&&(e=n,c("__activeElement",n),c("activeElement",n),n.classList.add("gleap-tour-active-element"))}catch(r){}h(e),function(){var e=l("__activeStagePosition"),t=l("__overlaySvg");if(e)if(t){var n=window.innerWidth,o=window.innerHeight;t.setAttribute("viewBox","0 0 ".concat(n," ").concat(o))}else console.warn("No stage svg found.")}(),O(e,t)}}function w(){var e=l("__resizeTimeout");e&&window.cancelAnimationFrame(e),c("__resizeTimeout",window.requestAnimationFrame(b))}function k(e){var t;if(l("isInitialized")&&("Tab"===e.key||9===e.keyCode)){var n=l("__activeElement"),o=null==(t=l("popover"))?void 0:t.wrapper,i=r([].concat(Ns(o?[o]:[]),Ns(n?[n]:[]))),a=i[0],s=i[i.length-1];if(e.preventDefault(),e.shiftKey){var c=i[i.indexOf(document.activeElement)-1]||s;null==c||c.focus()}else{var u=i[i.indexOf(document.activeElement)+1]||a;null==u||u.focus()}}}function x(e){var t;(null==(t=n("allowKeyboardControl"))||t)&&("Escape"===e.key?f("escapePress"):"ArrowRight"===e.key?f("arrowRightPress"):"ArrowLeft"===e.key&&f("arrowLeftPress"))}function S(e,t,n){var o=function(t,o){var r=t.target;e.contains(r)&&(n&&!n(r)||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()),null==o||o(t))},r=!0;document.addEventListener("pointerdown",o,r),document.addEventListener("mousedown",o,r),document.addEventListener("pointerup",o,r),document.addEventListener("mouseup",o,r),document.addEventListener("click",(function(e){o(e,t)}),r)}function C(){var e=l("popover");e&&(e.wrapper.style.display="none")}function I(e,t){var o,a,s=l("popover");s&&document.body.removeChild(s.wrapper),s=function(){var e=document.createElement("div");e.classList.add("gleap-tour-popover");var t=document.createElement("div");t.classList.add("gleap-tour-popover-arrow");var n=document.createElement("div");n.id="gleap-tour-popover-title",n.classList.add("gleap-tour-popover-title"),n.style.display="none",n.innerText="Popover Title";var o=document.createElement("div");o.id="gleap-tour-popover-description",o.classList.add("gleap-tour-popover-description"),o.style.display="none",o.innerText="Popover description is here";var r=document.createElement("button");r.type="button",r.classList.add("gleap-tour-popover-close-btn"),r.setAttribute("aria-label","Close"),r.innerHTML="&times;";var i=document.createElement("div");i.classList.add("gleap-tour-popover-footer");var a=document.createElement("span");a.classList.add("gleap-tour-popover-progress-text"),a.innerText="";var s=document.createElement("span");s.classList.add("gleap-tour-popover-navigation-btns");var c=document.createElement("button");c.type="button",c.classList.add("gleap-tour-popover-prev-btn"),c.innerHTML="&larr; Previous";var l=document.createElement("button");return l.type="button",l.classList.add("gleap-tour-popover-next-btn"),l.innerHTML="Next &rarr;",s.appendChild(c),s.appendChild(l),i.appendChild(a),i.appendChild(s),e.appendChild(r),e.appendChild(t),e.appendChild(n),e.appendChild(o),e.appendChild(i),{wrapper:e,arrow:t,title:n,description:o,footer:i,previousButton:c,nextButton:l,closeButton:r,footerButtons:s,progress:a}}(),document.body.appendChild(s.wrapper);var u=t.popover||{},d=u.title,p=u.description,h=u.showButtons,g=u.disableButtons,m=u.showProgress,v=u.nextBtnText,y=void 0===v?n("nextBtnText")||"Next":v,b=u.prevBtnText,w=void 0===b?n("prevBtnText")||"Previous":b,k=u.progressText,x=void 0===k?n("progressText")||"{current} of {total}":k;s.nextButton.innerHTML=y,s.previousButton.innerHTML=w,s.progress.innerHTML=x,d?(s.title.innerHTML=d,s.title.style.display="block"):s.title.style.display="none",p?(s.description.innerHTML=p,s.description.style.display="block"):s.description.style.display="none";var C=h||n("showButtons"),I=m||n("showProgress")||!1,T=(null==C?void 0:C.includes("next"))||(null==C?void 0:C.includes("previous"))||I;s.closeButton.style.display=C.includes("close")?"block":"none",T?(s.footer.style.display="flex",s.progress.style.display=I?"block":"none",s.nextButton.style.display=C.includes("next")?"block":"none",s.previousButton.style.display=C.includes("previous")?"block":"none"):s.footer.style.display="none";var E=g||n("disableButtons")||[];(null==E?void 0:E.includes("next"))&&(s.nextButton.disabled=!0,s.nextButton.classList.add("gleap-tour-popover-btn-disabled")),(null==E?void 0:E.includes("previous"))&&(s.previousButton.disabled=!0,s.previousButton.classList.add("gleap-tour-popover-btn-disabled")),(null==E?void 0:E.includes("close"))&&(s.closeButton.disabled=!0,s.closeButton.classList.add("gleap-tour-popover-btn-disabled"));var L=s.wrapper;L.style.display="block",L.style.left="",L.style.top="",L.style.bottom="",L.style.right="",L.id="gleap-tour-popover-content",L.setAttribute("role","dialog"),L.setAttribute("aria-labelledby","gleap-tour-popover-title"),L.setAttribute("aria-describedby","gleap-tour-popover-description"),s.arrow.className="gleap-tour-popover-arrow";var M=(null==(o=t.popover)?void 0:o.popoverClass)||n("popoverClass")||"";L.className="gleap-tour-popover ".concat(M).trim(),S(s.wrapper,(function(o){var r,i,a,s=o.target,c=(null==(r=t.popover)?void 0:r.onNextClick)||n("onNextClick"),u=(null==(i=t.popover)?void 0:i.onPrevClick)||n("onPrevClick"),d=(null==(a=t.popover)?void 0:a.onCloseClick)||n("onCloseClick");return s.classList.contains("gleap-tour-popover-next-btn")?c?c(e,t,{config:n(),state:l()}):f("nextClick"):s.classList.contains("gleap-tour-popover-prev-btn")?u?u(e,t,{config:n(),state:l()}):f("prevClick"):s.classList.contains("gleap-tour-popover-close-btn")?d?d(e,t,{config:n(),state:l()}):f("closeClick"):void 0}),(function(e){return!(null==s?void 0:s.description.contains(e))&&!(null==s?void 0:s.title.contains(e))&&"string"==typeof e.className&&e.className.includes("gleap-tour-popover")})),c("popover",s);var A=(null==(a=t.popover)?void 0:a.onPopoverRender)||n("onPopoverRender");A&&A(s,{config:n(),state:l()}),O(e,t),i(L);var P=e.classList.contains("gleap-tour-dummy-element"),R=r([L].concat(Ns(P?[]:[e])));R.length>0&&R[0].focus()}function T(){var e=l("popover");if(null==e?void 0:e.wrapper){var t=e.wrapper.getBoundingClientRect(),o=n("stagePadding")||0,r=n("popoverOffset")||0;return{width:t.width+o+r,height:t.height+o+r,realWidth:t.width,realHeight:t.height}}}function E(e,t){var n=t.elementDimensions,o=t.popoverDimensions,r=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.top-r,window.innerHeight-o.realHeight-i.width),i.width):"end"===e?Math.max(Math.min(n.top-(null==o?void 0:o.realHeight)+n.height+r,window.innerHeight-(null==o?void 0:o.realHeight)-i.width),i.width):"center"===e?Math.max(Math.min(n.top+n.height/2-(null==o?void 0:o.realHeight)/2,window.innerHeight-(null==o?void 0:o.realHeight)-i.width),i.width):0}function L(e,t){var n=t.elementDimensions,o=t.popoverDimensions,r=t.popoverPadding,i=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.left-r,window.innerWidth-o.realWidth-i.width),i.width):"end"===e?Math.max(Math.min(n.left-(null==o?void 0:o.realWidth)+n.width+r,window.innerWidth-(null==o?void 0:o.realWidth)-i.width),i.width):"center"===e?Math.max(Math.min(n.left+n.width/2-(null==o?void 0:o.realWidth)/2,window.innerWidth-(null==o?void 0:o.realWidth)-i.width),i.width):0}function O(e,t){var o=l("popover");if(o){var r=(null==t?void 0:t.popover)||{},i=r.align,a=void 0===i?"start":i,s=r.side,c=void 0===s?"left":s,u=a,d="gleap-tour-dummy-element"===e.id?"over":c,p=n("stagePadding")||0,f=T(),h=o.arrow.getBoundingClientRect(),g=e.getBoundingClientRect(),m=g.top-f.height,v=m>=0,y=window.innerHeight-(g.bottom+f.height),b=y>=0,w=g.left-f.width,k=w>=0,x=window.innerWidth-(g.right+f.width),S=x>=0,C=!(v||b||k||S),I=d;if("top"===d&&v?S=k=b=!1:"bottom"===d&&b?S=k=v=!1:"left"===d&&k?S=v=b=!1:"right"===d&&S&&(k=v=b=!1),"over"===d){var O=window.innerWidth/2-f.realWidth/2,M=window.innerHeight/2-f.realHeight/2;o.wrapper.style.left="".concat(O,"px"),o.wrapper.style.right="auto",o.wrapper.style.top="".concat(M,"px"),o.wrapper.style.bottom="auto"}else if(C){var A=window.innerWidth/2-(null==f?void 0:f.realWidth)/2;o.wrapper.style.left="".concat(A,"px"),o.wrapper.style.right="auto",o.wrapper.style.bottom="".concat(10,"px"),o.wrapper.style.top="auto"}else if(k){var P=Math.min(w,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),R=E(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});o.wrapper.style.left="".concat(P,"px"),o.wrapper.style.top="".concat(R,"px"),o.wrapper.style.bottom="auto",o.wrapper.style.right="auto",I="left"}else if(S){var _=Math.min(x,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),N=E(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});o.wrapper.style.right="".concat(_,"px"),o.wrapper.style.top="".concat(N,"px"),o.wrapper.style.bottom="auto",o.wrapper.style.left="auto",I="right"}else if(v){var D=Math.min(m,window.innerHeight-f.realHeight-h.width),j=L(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});o.wrapper.style.top="".concat(D,"px"),o.wrapper.style.left="".concat(j,"px"),o.wrapper.style.bottom="auto",o.wrapper.style.right="auto",I="top"}else if(b){var F=Math.min(y,window.innerHeight-(null==f?void 0:f.realHeight)-h.width),B=L(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});o.wrapper.style.left="".concat(B,"px"),o.wrapper.style.bottom="".concat(F,"px"),o.wrapper.style.top="auto",o.wrapper.style.right="auto",I="bottom"}C?o.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var o=l("popover");if(!o)return;var r=n.getBoundingClientRect(),i=T(),a=o.arrow,s=i.width,c=window.innerWidth,u=r.width,d=r.left,p=i.height,f=window.innerHeight,h=r.top,g=r.height;a.className="gleap-tour-popover-arrow";var m=t,v=e;"top"===t?(d+u<=0?(m="right",v="end"):d+u-s<=0&&(m="top",v="start"),d>=c?(m="left",v="end"):d+s>=c&&(m="top",v="end")):"bottom"===t?(d+u<=0?(m="right",v="start"):d+u-s<=0&&(m="bottom",v="start"),d>=c?(m="left",v="start"):d+s>=c&&(m="bottom",v="end")):"left"===t?(h+g<=0?(m="bottom",v="end"):h+g-p<=0&&(m="left",v="start"),h>=f?(m="top",v="end"):h+p>=f&&(m="left",v="end")):"right"===t&&(h+g<=0?(m="bottom",v="start"):h+g-p<=0&&(m="right",v="start"),h>=f?(m="top",v="start"):h+p>=f&&(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")}(u,I,e)}}return function(){function e(){n("allowClose")&&h()}function o(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var o=e+1;t[o]?f(o):h()}}function r(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var o=e-1;t[o]?f(o):h()}}function i(){var e;if(!l("__transitionCallback")){var t=l("activeIndex"),o=l("__activeStep"),i=l("__activeElement");if("CLICK"!==o.mode)if(void 0!==t&&void 0!==o)if(void 0!==l("activeIndex")){var a=(null==(e=o.popover)?void 0:e.onPrevClick)||n("onPrevClick");if(a)return a(i,o,{config:n(),state:l()});r()}}}function a(){var e;if(!l("__transitionCallback")){var t=l("activeIndex"),r=l("__activeStep"),i=l("__activeElement");if("CLICK"!==r.mode&&void 0!==t&&void 0!==r){var a=(null==(e=r.popover)?void 0:e.onNextClick)||n("onNextClick");if(a)return a(i,r,{config:n(),state:l()});o()}}}function s(){l("isInitialized")||(c("isInitialized",!0),document.body.classList.add("gleap-tour-active",n("animate")?"gleap-tour-fade":"gleap-tour-simple"),window.addEventListener("keyup",x,!1),window.addEventListener("keydown",k,!1),window.addEventListener("resize",w),window.addEventListener("scroll",w),c("__positionInterval",setInterval((function(){l("isInitialized")&&w()}),1e3)),p("overlayClick",e),p("escapePress",e),p("arrowLeftPress",i),p("arrowRightPress",a))}function f(){var e,t,o,r,i,a,s,l,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,d=n("steps");if(!d)return console.error("No steps to drive through"),void h();if(d[u]){c("__activeOnDestroyed",document.activeElement),c("activeIndex",u);var p=d[u],g=d[u+1],m=d[u-1],v=(null==(e=p.popover)?void 0:e.doneBtnText)||n("doneBtnText")||"Done",b=n("allowClose"),w=void 0!==(null==(t=p.popover)?void 0:t.showProgress)?null==(o=p.popover)?void 0:o.showProgress:n("showProgress"),k=((null==(r=p.popover)?void 0:r.progressText)||n("progressText")||"{{current}} of {{total}}").replace("{{current}}","".concat(u+1)).replace("{{total}}","".concat(d.length)),x=(null==(i=p.popover)?void 0:i.showButtons)||n("showButtons"),S=["next","previous"].concat(Ns(b?["close"]:[])).filter((function(e){return!(null==x?void 0:x.length)||x.includes(e)})),C=(null==(a=p.popover)?void 0:a.onNextClick)||n("onNextClick"),I=(null==(s=p.popover)?void 0:s.onPrevClick)||n("onPrevClick"),T=(null==(l=p.popover)?void 0:l.onCloseClick)||n("onCloseClick");y(Fs(Fs({},p),{},{popover:Fs({showButtons:S,nextBtnText:g?void 0:v,disableButtons:Ns(m?[]:["previous"]),showProgress:w,progressText:k,onNextClick:C||function(){g?f(u+1):h()},onPrevClick:I||function(){f(u-1)},onCloseClick:T||function(){h()}},(null==p?void 0:p.popover)||{})}))}else h()}function h(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=l("__activeElement"),o=l("__activeStep"),r=l("__activeOnDestroyed"),i=n("onDestroyStarted");if(e&&i){i(!t||"gleap-tour-dummy-element"===(null==t?void 0:t.id)?void 0:t,o,{config:n(),state:l()})}else{var a,s=(null==o?void 0:o.onDeselected)||n("onDeselected"),c=n("onDestroyed");if(document.body.classList.remove("gleap-tour-active","gleap-tour-fade","gleap-tour-simple"),function(){window.removeEventListener("keyup",x),window.removeEventListener("resize",w),window.removeEventListener("scroll",w);var e=l("__positionInterval");e&&clearInterval(e)}(),function(){var e,t=l("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((function(e){e.classList.remove("gleap-tour-active-element","gleap-tour-no-interaction"),e.removeAttribute("aria-haspopup"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls")}))}(),(a=l("__overlaySvg"))&&a.remove(),d={},u(),t&&o){var p="gleap-tour-dummy-element"===t.id;s&&s(p?void 0:t,o,{config:n(),state:l()}),c&&c(p?void 0:t,o,{config:n(),state:l()})}r&&r.focus()}}return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{isActive:function(){return l("isInitialized")||!1},refresh:w,drive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;s(),f(e)},setConfig:t,setSteps:function(e){u(),t(Fs(Fs({},n()),{},{steps:e}))},getConfig:n,getState:l,getActiveIndex:function(){return l("activeIndex")},isFirstStep:function(){return 0===l("activeIndex")},isLastStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&t===e.length-1},getActiveStep:function(){return l("activeStep")},getActiveElement:function(){return l("activeElement")},getPreviousElement:function(){return l("previousElement")},getPreviousStep:function(){return l("previousStep")},moveNext:o,movePrevious:r,moveTo:function(e){(n("steps")||[])[e]?f(e):h()},hasNextStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&e[t+1]},hasPreviousStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&e[t-1]},highlight:function(e){s(),y(Fs(Fs({},e),{},{popover:e.popover?Fs({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){h(!1)}}}}();const Us=Hs;var qs=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],zs="".concat(qs.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),Ws=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?qs.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},Gs=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},Vs=function(e,t){if(e){var n=(e.tagName||"").toLowerCase();if("input"===n||"textarea"===n){var o=function(e){var t,n;if("undefined"==typeof window)return null;var o=window.HTMLTextAreaElement&&e instanceof window.HTMLTextAreaElement?window.HTMLTextAreaElement.prototype:window.HTMLInputElement&&e instanceof window.HTMLInputElement?window.HTMLInputElement.prototype:null;return o&&null!==(t=null===(n=Object.getOwnPropertyDescriptor(o,"value"))||void 0===n?void 0:n.set)&&void 0!==t?t:null}(e);o?o.call(e,t):e.value=t}else e.textContent=t;Gs(e,"input")}},Ks=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.charDelay,r=void 0===o?100:o,i=n.onDone,a=function(e){if(!e)return null;if(Ws(e))return e;var t="function"==typeof e.querySelector?e.querySelector(zs):null;return t&&Ws(t)?t:null}(e),s=null!=t?t:"";if(a){var c=0,l=function(){Gs(a,"change"),i&&i()};!function e(){try{c<s.length?(c++,Vs(a,s.slice(0,c)),setTimeout(e,r)):l()}catch(t){l()}}()}else i&&i()};function Xs(e){return Xs="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},Xs(e)}function Js(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,$s(o.key),o)}}function Ys(e,t,n){return(t=$s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $s(e){var t=function(e,t){if("object"!=Xs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Xs(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Xs(t)?t:String(t)}var Zs="gleap-tour-data",Qs="copilot-pointer-container",ec="copilot-tour-styles",tc="copilot-joined-container",nc={TOP_LEFT:"".concat(tc,"--top-left"),TOP_RIGHT:"".concat(tc,"--top-right"),BOTTOM_LEFT:"".concat(tc,"--bottom-left"),BOTTOM_RIGHT:"".concat(tc,"--bottom-right")};var oc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ys(this,"productTourData",void 0),Ys(this,"productTourId",void 0),Ys(this,"currentActiveIndex",void 0),Ys(this,"lastArrowPositionX",void 0),Ys(this,"lastArrowPositionY",void 0),Ys(this,"onCompleteCallback",void 0),Ys(this,"audioMuted",!1),Ys(this,"currentAudio",void 0),Ys(this,"_pointerContainer",null),Ys(this,"_scrollListeners",[]),Ys(this,"_currentAnchor",null),Ys(this,"_currentStep",null),Ys(this,"_scrollDebounceTimer",null);var t=this;"undefined"!=typeof window&&(this._scrollListeners=[],this._currentAnchor=null,this._currentStep=null,this._scrollDebounceTimer=null,window.addEventListener("resize",(function(){if(t.productTourId&&t.currentActiveIndex>=0&&t.productTourData&&t.productTourData.steps){var e=t.productTourData.steps[t.currentActiveIndex];e&&e.selector&&""!==e.selector&&t.updatePointerPosition(document.querySelector(e.selector),e)}})))}var t,n,o;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(Zs,JSON.stringify(e))}catch(t){}else localStorage.removeItem(Zs)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(Zs));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 o=function(e){if("undefined"!=typeof window){for(var t=[],n=e.parentElement;n;){var o=window.getComputedStyle(n);("auto"===o.overflowY||"scroll"===o.overflowY)&&n.scrollHeight>n.clientHeight&&t.push(n),n=n.parentElement}return t}}(e);o.push(window),o.forEach((function(o){var r=function(){clearTimeout(n._scrollDebounceTimer),n._scrollDebounceTimer=setTimeout((function(){n.updatePointerPosition(e,t)}),150)};o.addEventListener("scroll",r,{passive:!0}),n._scrollListeners.push({el:o,handler:r})}))}}},{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,o=this;if("undefined"!=typeof window)try{var r=this._pointerContainer||document.getElementById(Qs);if(!r)return;if(!e)return r.style.position="fixed",r.style.left="50%",r.style.top="50%",r.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,c=a.top+a.height/2+10;r.style.position="fixed",r.style.left="".concat(s,"px"),r.style.top="".concat(c,"px"),r.style.transform="translate(-50%, -50%)";var l=350;l>window.innerWidth-40&&(l=window.innerWidth-40),s+l>window.innerWidth-20?r.classList.add("copilot-pointer-container-right"):r.classList.remove("copilot-pointer-container-right"),o._currentAnchor===e&&o._currentStep===t||(o.removeScrollListeners(),o._currentAnchor=e,o._currentStep=t,o.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(Qs);t&&t.remove()}var n=document.getElementById(tc);n&&n.remove();var o=document.getElementById(ec);o&&o.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(tc,"-mute"));t&&(t.innerHTML=ge(this.audioMuted?"unmute":"mute")),this.productTourId&&this.productTourData&&this.storeUncompletedTour()}},{key:"setupCopilotTour",value:function(){var e,t,n,o,r,i,a,s=this;if("undefined"!=typeof window){var c,l,u=null!==(e=null===(t=zn.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=he(u),p=document.getElementById(ec);p||(p=document.createElement("style"),G(p),p.id=ec,p.type="text/css",p.textContent="\n #".concat(Qs," {\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(Qs,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(Qs,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(Qs,"-clickmode svg {\n display: none !important;\n }\n #").concat(Qs," 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(Qs,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(Qs,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(Qs,"-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(Qs,"-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(tc," {\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(tc,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(tc,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(tc,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(tc,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(tc," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(tc,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(tc,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(tc,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(tc,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(tc,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(tc,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(tc,"-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(tc," {\n animation: glCoFadeOut 0.8s ease-out forwards;\n }\n ").concat(null===(c=null===(l=this.productTourData)||void 0===l?void 0:l.playVoice)||void 0===c||c?"":"\n .".concat(tc,"-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 f=document.createElement("div");f.id=Qs,f.style.opacity=0,this._pointerContainer=f;var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("viewBox","0 0 380 476"),h.innerHTML='<path d="M352.595 268.315L352.581 268.302L352.566 268.29L78.6092 24.7278C71.6245 18.433 62.5487 15 53.2 15C32.1157 15 15 32.1157 15 53.2V424C15 444.34 31.4714 461 52 461C62.6797 461 72.8089 456.467 79.8863 448.38C79.8871 448.379 79.8879 448.378 79.8886 448.378L180.804 333.1H327.9C348.384 333.1 365 316.484 365 296C365 285.404 360.46 275.344 352.595 268.315Z" fill="black" stroke="white" stroke-width="30"/>';var g=document.createElement("div");g.id="copilot-info-bubble",g.innerHTML="<div id='copilot-info-bubble-content-container'><div id='copilot-info-bubble-content'></div></div>";var m,v,y=document.createElement("div");y.id=tc,y.classList.add(tc,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=nc[m])&&void 0!==v?v:nc.TOP_RIGHT)),y.innerHTML='\n <img class="'.concat(tc,'-avatar" src="').concat(null===(o=this.productTourData)||void 0===o?void 0:o.kaiAvatar,'" />\n <span>').concat(null===(r=this.productTourData)||void 0===r?void 0:r.kaiSlug,'</span>\n <div class="').concat(tc,'-mute">\n ').concat(ge(this.audioMuted?"unmute":"mute"),"\n </div>\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'<div class="'.concat(tc,'-dismiss">\n ').concat(ge("dismiss"),"\n </div>"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(tc,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(tc,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),f.appendChild(h),f.appendChild(g),document.body.appendChild(f)}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this.productTourData;if(t){var n=function(n,o){e.audioMuted=n,e.setupCopilotTour(),e.audioMuted&&o&&null!=t&&t.showUnmuteModal?e.showAudioUnmuteModal():setTimeout((function(){e.renderNextStep()}),1500)},o=this.loadStoredAudioMuted();"boolean"!=typeof o?("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(o){n(!1)}}))).then((function(e){n(!e,!0)})):n(o,!1)}}}},{key:"showAudioUnmuteModal",value:function(){var e,t,n,o=this,r=document.createElement("div");r.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(){o.toggleAudio(!1),r.parentNode&&r.parentNode.removeChild(r),setTimeout((function(){o.renderNextStep()}),1e3)})),i.appendChild(s);var c=document.createElement("button");c.classList.add("gleap-tour-continue-button"),c.textContent=null===(n=this.productTourData)||void 0===n?void 0:n.unmuteModalContinue,c.addEventListener("click",(function(){o.toggleAudio(!0),r.parentNode&&r.parentNode.removeChild(r),setTimeout((function(){o.renderNextStep()}),1e3)})),i.appendChild(c),r.appendChild(i),document.body.appendChild(r)}},{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 o=n[this.currentActiveIndex],r=function(n){var r,i;if(e._pointerContainer.style.display="flex",o.selector&&o.selector.length>0&&!n)e.completeTour(!1);else{var a=function(){if("INPUT"===o.mode&&n){var e,r=function(){document.querySelector("#".concat(Qs)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(Qs).style.display="none",t.currentActiveIndex++,t.storeUncompletedTour(),t.renderNextStep()};if("default"===(null!==(e=o.inputType)&&void 0!==e?e:"default")){var i=function e(t){var o;if(0!==(null==t||null===(o=t.target)||void 0===o||null===(o=o.value)||void 0===o?void 0:o.length)){var i=document.getElementById("copilot-info-bubble-content");i&&(i.innerHTML="".concat(Yd.translateText("next"),' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\n <path fill="currentColor" d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"/>\n</svg>'),i.addEventListener("click",r,{once:!0}),n.classList.add("gleap-input-highlight"),document.querySelector("#".concat(Qs)).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;Ks(n,null!==(a=o.inputValue)&&void 0!==a?a:"",{charDelay:100,onDone:function(){setTimeout((function(){r()}),1200)}})}}else{if(t.currentActiveIndex++,t.storeUncompletedTour(),"CLICK"===o.mode&&n){var s=n.getBoundingClientRect(),c=window.scrollX||0,l=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+c,s.top+s.height/2+l),n.click()}t.renderNextStep()}};e.updatePointerPosition(n,o);var s=null!=o&&o.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()}}(o.message):"🤔";document.getElementById("copilot-info-bubble-content").textContent=s,e._pointerContainer.style.opacity=1;var c=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),l=function(){e.currentAudio=void 0,setTimeout((function(){a()}),1e3*c)};(null===(r=null===(i=e.productTourData)||void 0===i?void 0:i.playVoice)||void 0===r||r)&&o.voice&&o.voice.length>0?(e.currentAudio=new Audio(o.voice),e.audioMuted&&(e.currentAudio.muted=!0),e.currentAudio.addEventListener("ended",(function(){setTimeout((function(){a()}),1e3)})),e.currentAudio.play().then((function(){})).catch((function(e){l()}))):l()}},i=o.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(o,r){var i=setInterval((function(){var a=document.querySelector(e);a?(clearInterval(i),o(a)):n>=t&&(clearInterval(i),r(new Error("Element not found for selector: ".concat(e)))),n++}),100)}))}}(o.selector):Promise.resolve(null);i.then(r).catch((function(){return r(null)}))}}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Js(t.prototype,n),o&&Js(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function rc(e){return rc="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},rc(e)}function ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ac(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ic(Object(n),!0).forEach((function(t){cc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ic(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sc(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,lc(o.key),o)}}function cc(e,t,n){return(t=lc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lc(e){var t=function(e,t){if("object"!=rc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=rc(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rc(t)?t:String(t)}Ys(oc,"instance",void 0);var uc="gleap-tour-data",dc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),cc(this,"productTourData",void 0),cc(this,"productTourId",void 0),cc(this,"unmuted",!1),cc(this,"currentActiveIndex",void 0),cc(this,"gleapTourObj",void 0),cc(this,"disabled",!1);var t=this;if("undefined"!=typeof window){"undefined"!=typeof window&&window.addEventListener("beforeunload",(function(e){var n;null!=t&&t.disabled||null==t||!t.productTourId||null==t||!t.productTourData||"cobrowse"===(null==t||null===(n=t.productTourData)||void 0===n?void 0:n.tourType)||t.storeUncompletedTour()}))}}var t,n,o;return t=e,n=[{key:"disable",value:function(){this.gleapTourObj&&this.gleapTourObj.destroy(),oc.getInstance().disable(),this.gleapTourObj=void 0,this.disabled=!0}},{key:"startWithConfig",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!this.productTourId&&!this.disabled)if(this.productTourId=e,this.productTourData=t,this.currentActiveIndex=0,r)this.start();else{var i=this;ba.getInstance().validateProductTour(e).then((function(){return o>0?setTimeout((function(){i.start()}),o):n.start()})).catch((function(e){console.log("Product tour is not live. Cleaning up..."),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?(Ht.notifyEvent("productTourCompleted",t),cp.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(Ht.notifyEvent("productTourQuit",t),cp.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(uc));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(uc,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(uc)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return oc.getInstance().startWithConfig(this.productTourId,t,(function(t){e.onComplete(t)}));this.unmuted=!1;for(var n=t.steps,o=this,r=[],i=0;i<n.length;i++){var a=n[i],s="CLICK"===a.mode,c="INPUT"===a.mode,l="INTERACTION"===a.mode,u="",d=!1;if("video-pointer"===a.type)u='<div class="gleap-tour-video">\n <video class="gleap-tour-video-obj" muted autoplay>\n <source src="'.concat(a.videoUrl,'" type="video/mp4">\n </video>\n <div class="gleap-tour-video-playpause">').concat(ge("unmute"),"</div>\n </div>");else{var p="";t.sender&&t.sender.firstName&&(d=!0,p='<div class="gleap-tour-sender">\n <div class="gleap-tour-sender-image" style="background-image: url(\''.concat(t.sender.profileImageUrl,'\');"></div>\n <div class="gleap-tour-sender-name">').concat(t.sender.firstName,"</div>\n </div>")),u="".concat(p,'<div class="gleap-tour-message">').concat(a.message,"</div>")}var f={disableActiveInteraction:!s&&!c&&!l,mode:a.mode,popover:ac({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&&(f.element=a.selector),r.push(f)}var h=["next","close"];t.backButton&&h.push("previous"),this.gleapTourObj=Us(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc({showProgress:!0,allowKeyboardControl:!1,steps:r},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",h),"onHighlightStarted",(function(t,n,o){var r;e.currentActiveIndex=null==o||null===(r=o.state)||void 0===r?void 0:r.activeIndex,e.storeUncompletedTour()})),"onElementNotFound",(function(t){document.removeEventListener("click",g),e.onComplete(!1)})),"onDestroyStarted",(function(){e.gleapTourObj.hasNextStep()?e.onComplete(!1):e.onComplete(!0),document.removeEventListener("click",g)})),"onPopoverRender",(function(t){if(t)for(var n=document.querySelectorAll(".gleap-tour-popover-description img, .gleap-tour-popover-description video"),r=function(){setTimeout((function(){e.gleapTourObj.refresh()}),500),setTimeout((function(){e.gleapTourObj.refresh()}),750)},i=0;i<n.length;i++){var a=n[i];"IMG"===a.tagName?(a.addEventListener("load",(function(){r()})),a.addEventListener("error",(function(){r()}))):"VIDEO"===a.tagName&&(a.addEventListener("canplaythrough",(function(){r()})),a.addEventListener("error",(function(){r()})))}var s="gleap-tour-video--playing",c=document.querySelector(".gleap-tour-video-playpause"),l=document.querySelector(".gleap-tour-video-obj");if(l){var u=l.closest(".gleap-tour-video");o.unmuted&&l&&(l.pause(),l.muted=!1,l.play(),u.classList.add(s)),l.addEventListener("ended",(function(){c.innerHTML=ge("replay"),c.classList.add("gleap-tour-video-svg--fullscreen"),u.classList.remove(s)})),l.addEventListener("play",(function(){c.classList.remove("gleap-tour-video-svg--fullscreen")})),c&&c.addEventListener("click",(function(){return d()}));var d=function(){l.muted?(o.unmuted=!0,l.pause(),l.currentTime=0,l.muted=!1,l.play(),c.innerHTML=ge("mute"),u.classList.add(s)):l.paused?(l.muted=!1,l.play(),c.innerHTML=ge("mute"),u.classList.add(s)):(l.pause(),c.innerHTML=ge("unmute"),u.classList.remove(s))}}}))),this.gleapTourObj.drive(),document.addEventListener("click",g,!0)}function g(e){try{var t=document.querySelector(".gleap-tour-popover");if(t&&!t.contains(e.target)){var r,i=o.gleapTourObj.getActiveIndex(),a=n[i],s=o.gleapTourObj.getActiveElement();if("CLICK"===(null==a?void 0:a.mode)&&(null==e?void 0:e.target)!==s&&!s.contains(null==e?void 0:e.target))return;o.currentActiveIndex=(o.currentActiveIndex||0)+1,o.storeUncompletedTour(),s&&"INPUT"===s.tagName||"INPUT"===a.mode||"INTERACTION"===a.mode||null!=e&&null!==(r=e.target)&&void 0!==r&&r.id.includes("tooltip-svg")||o.gleapTourObj.moveNext()}}catch(c){}}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&sc(t.prototype,n),o&&sc(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();cc(dc,"instance",void 0);var pc,fc=Object.defineProperty,hc=(e,t,n)=>((e,t,n)=>t in e?fc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),gc=(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))(gc||{}),mc=(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))(mc||{}),vc=(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))(vc||{}),yc=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(yc||{}),bc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(bc||{}),wc=(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))(wc||{}),kc=(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))(kc||{});const xc={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Sc={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Cc={},Ic={},Tc=()=>!!globalThis.Zone;function Ec(e){if(Cc[e])return Cc[e];const t=globalThis[e],n=t.prototype,o=e in xc?xc[e]:void 0,r=Boolean(o&&o.every((e=>{var t,o;return Boolean(null==(o=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:o.toString().includes("[native code]"))}))),i=e in Sc?Sc[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(r&&a&&!Tc())return Cc[e]=t.prototype,t.prototype;try{const o=document.createElement("iframe");o.style.display="none",document.body.appendChild(o);const r=o.contentWindow;if(!r)return t.prototype;const i=r[e].prototype;if(!i)return o.remove(),n;const a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(o.classList.add("rr-block"),o.setAttribute("__rrwebUntaintedMutationObserver",""),Ic[e]=()=>o.remove()):o.remove(),Cc[e]=i}catch{return n}}const Lc={};function Oc(e,t,n){var o;const r=`${e}.${String(n)}`;if(Lc[r])return Lc[r].call(t);const i=Ec(e),a=null==(o=Object.getOwnPropertyDescriptor(i,n))?void 0:o.get;return a?(Lc[r]=a,a.call(t)):t[n]}const Mc={};function Ac(e,t,n){const o=`${e}.${String(n)}`;if(Mc[o])return Mc[o].bind(t);const r=Ec(e)[n];return"function"!=typeof r?t[n]:(Mc[o]=r,r.bind(t))}function Pc(){return[Ec("MutationObserver").constructor,Ic.MutationObserver??(()=>{})]}let Rc=Date.now;function _c(e,t,n){try{if(!(t in e))return()=>{};const o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,()=>{e[t]=o}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString())||(Rc=()=>(new Date).getTime());const Nc={ownerDocument:function(e){return Oc("Node",e,"ownerDocument")},childNodes:function(e){return Oc("Node",e,"childNodes")},parentNode:function(e){return Oc("Node",e,"parentNode")},parentElement:function(e){return Oc("Node",e,"parentElement")},textContent:function(e){return Oc("Node",e,"textContent")},contains:function(e,t){return Ac("Node",e,"contains")(t)},getRootNode:function(e){return Ac("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Oc("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Oc("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Oc("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Oc("Element",e,"querySelectorAll")(t)},nowTimestamp:Rc,mutationObserverCtor:Pc,patch:_c};function Dc(e){return e.nodeType===e.ELEMENT_NODE}function jc(e){const t=e&&"host"in e&&"mode"in e&&Nc.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Nc.shadowRoot(t)===e)}function Fc(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Bc(e){try{const n=e.rules||e.cssRules;if(!n)return null;let o=e.href;!o&&e.ownerNode&&(o=e.ownerNode.baseURI);const r=Array.from(n,(e=>Hc(e,o))).join("");return(t=r).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 Hc(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Bc(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?$c(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?$c(n,t):n}}class Uc{constructor(){hc(this,"idNodeMap",new Map),hc(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 qc({element:e,maskInputOptions:t,tagName:n,type:o,value:r,maskInputFn:i}){let a=r||"";const s=o&&zc(o);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function zc(e){return e.toLowerCase()}const Wc="__rrweb_original__";function Gc(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?zc(t):null}function Vc(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(r){return null}const o=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==o?void 0:o[1])??null}const Kc=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Xc=/^(?:[a-z+]+:)?\/\//i,Jc=/^www\..*/i,Yc=/^(data:)([^,]*),(.*)/i;function $c(e,t){return(e||"").replace(Kc,((e,n,o,r,i,a)=>{const s=o||i||a,c=n||r||"";if(!s)return e;if(Xc.test(s)||Jc.test(s))return`url(${c}${s}${c})`;if(Yc.test(s))return`url(${c}${s}${c})`;if("/"===s[0])return`url(${c}${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}${c})`;const l=s.split("#")[0],u=s.substring(l.length),d=t.split("#")[0].split("/"),p=l.split("/");d.pop();for(const t of p)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${c}${d.join("/")}${u}${c})`}))}function Zc(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Qc(e,t){return function(e,t,n=!1){const o=Array.from(t.childNodes),r=[];let i=0;if(o.length>1&&e&&"string"==typeof e){let t=Zc(e,n);const a=t.length/e.length;for(let s=1;s<o.length;s++)if(o[s].textContent&&"string"==typeof o[s].textContent){const c=Zc(o[s].textContent,n),l=100;let u=3;for(;u<c.length&&(c[u].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,u),1));u++);for(;u<c.length;u++){let d=c.substring(0,u),p=t.split(d),f=-1;if(2===p.length)f=p[0].length;else if(p.length>2&&""===p[0]&&""!==o[s-1].textContent)f=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 r.push(e),r;u=l+1}else u===c.length-1&&(f=t.indexOf(d));if(p.length>=2&&u>l){const e=o[s-1].textContent;if(e&&"string"==typeof e){const n=Zc(e).length;f=t.indexOf(d,n)}-1===f&&(f=p[0].length)}if(-1!==f){let s=Math.floor(f/a);for(;s>0&&s<e.length;){if(i+=1,i>50*o.length)return r.push(e),r;const c=Zc(e.substring(0,s),n);if(c.length===f){r.push(e.substring(0,s)),e=e.substring(s),t=t.substring(f);break}c.length<f?s+=Math.max(1,Math.floor((f-c.length)/a)):s-=Math.max(1,Math.floor((c.length-f)*a))}break}}}}return r.push(e),r}(e,t).join("/* rr_split */")}let el=1;const tl=new RegExp("[^a-z0-9-_:]"),nl=-2;function ol(){return el++}let rl,il;const al=/^[^ \t\n\r\u000c]+/,sl=/^[, \t\n\r\u000c]+/;const cl=new WeakMap;function ll(e,t){return t&&""!==t.trim()?dl(e,t):t}function ul(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function dl(e,t){let n=cl.get(e);if(n||(n=e.createElement("a"),cl.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function pl(e,t,n,o){return o?"src"===n||"href"===n&&("use"!==t||"#"!==o[0])||"xlink:href"===n&&"#"!==o[0]||"background"===n&&["table","td","th"].includes(t)?ll(e,o):"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function o(e){let o;const r=e.exec(t.substring(n));return r?(o=r[0],n+=o.length,o):""}const r=[];for(;o(sl),!(n>=t.length);){let i=o(al);if(","===i.slice(-1))i=ll(e,i.substring(0,i.length-1)),r.push(i);else{let o="";i=ll(e,i);let a=!1;for(;;){const e=t.charAt(n);if(""===e){r.push((i+o).trim());break}if(a)")"===e&&(a=!1);else{if(","===e){n+=1,r.push((i+o).trim());break}"("===e&&(a=!0)}o+=e,n+=1}}}return r.join(", ")}(e,o):"style"===n?$c(o,dl(e)):"object"===t&&"data"===n?ll(e,o):o:o}function fl(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function hl(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&hl(Nc.parentNode(e),t,n);for(let o=e.classList.length;o--;){const n=e.classList[o];if(t.test(n))return!0}return!!n&&hl(Nc.parentNode(e),t,n)}function gl(e,t,n,o){let r;if(Dc(e)){if(r=e,!Nc.childNodes(r).length)return!1}else{if(null===Nc.parentElement(e))return!1;r=Nc.parentElement(e)}try{if("string"==typeof t){if(o){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(hl(r,t,o))return!0;if(n)if(o){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(i){}return!1}function ml(e,t){const{doc:n,mirror:o,blockClass:r,blockSelector:i,needsMask:a,inlineStylesheet:s,maskInputOptions:c={},maskTextFn:l,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:h,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,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:kc.Document,childNodes:[],compatMode:e.compatMode}:{type:kc.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:kc.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:o,blockSelector:r,inlineStylesheet:i,maskInputOptions:a={},maskInputFn:s,dataURLOptions:c={},inlineImages:l,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f}=t,h=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 o=e.classList[n];if(t.test(o))return!0}if(n)return e.matches(n)}catch(o){}return!1}(e,o,r),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=zc(e.tagName);return tl.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let w=0;w<v;w++){const t=e.attributes[w];fl(g,t.name,t.value)||(m[t.name]=pl(n,g,zc(t.name),t.value))}if("link"===g&&i){const t=Array.from(n.styleSheets).find((t=>t.href===e.href));let o=null;t&&(o=Bc(t)),o&&(delete m.rel,delete m.href,m._cssText=o)}if("style"===g&&e.sheet){let t=Bc(e.sheet);t&&(e.childNodes.length>1&&(t=Qc(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=qc({element:e,type:Gc(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;n<e.width;n+=50)for(let o=0;o<e.height;o+=50){const r=t.getImageData,i=Wc in r?r[Wc]:r;if(new Uint32Array(i.call(t,n,o,Math.min(50,e.width-n),Math.min(50,e.height-o)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),o=n.createElement("canvas");o.width=e.width,o.height=e.height;t!==o.toDataURL(c.type,c.quality)&&(m.rr_dataURL=t)}if("img"===g&&l){rl||(rl=n.createElement("canvas"),il=rl.getContext("2d"));const t=e,o=t.currentSrc||t.getAttribute("src")||"<unknown-src>",r=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{rl.width=t.naturalWidth,rl.height=t.naturalHeight,il.drawImage(t,0,0),m.rr_dataURL=rl.toDataURL(c.type,c.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=${o}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(r?m.crossOrigin=r: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(h){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:kc.Element,tagName:g,attributes:m,childNodes:[],isSVG:ul(e)||void 0,needBlock:h,rootId:f,isCustom:y}}(e,{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:o,rootId:r,cssCaptured:i}=t,a=Nc.parentNode(e),s=a&&a.tagName;let c="";const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;u?c="SCRIPT_PLACEHOLDER":i||(c=Nc.textContent(e),l&&c&&(c=$c(c,dl(t.doc))));!l&&!u&&c&&n&&(c=o?o(c,Nc.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:kc.Text,textContent:c||"",rootId:r}}(e,{doc:n,needsMask:a,maskTextFn:l,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:kc.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:kc.Comment,textContent:Nc.textContent(e)||"",rootId:v};default:return!1}}function vl(e){return null==e?"":e.toLowerCase()}function yl(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 bl(e,t){const{doc:n,mirror:o,blockClass:r,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h={},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:I}=t,{preserveWhiteSpace:T=!0}=t;if(!I){I=gl(e,a,s,void 0===I)}const E=ml(e,{doc:n,mirror:o,blockClass:r,blockSelector:i,needsMask:I,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:S,cssCaptured:C});if(!E)return console.warn(e,"not serialized"),null;let L;L=o.hasNode(e)?o.getId(e):function(e,t){if(t.comment&&e.type===kc.Comment)return!0;if(e.type===kc.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"===Vc(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(vl(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===vl(e.attributes.name)||"icon"===vl(e.attributes.rel)||"apple-touch-icon"===vl(e.attributes.rel)||"shortcut icon"===vl(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&vl(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(vl(e.attributes.property).match(/^(og|twitter|fb):/)||vl(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===vl(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===vl(e.attributes.name)||"googlebot"===vl(e.attributes.name)||"bingbot"===vl(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===vl(e.attributes.name)||"generator"===vl(e.attributes.name)||"framework"===vl(e.attributes.name)||"publisher"===vl(e.attributes.name)||"progid"===vl(e.attributes.name)||vl(e.attributes.property).match(/^article:/)||vl(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===vl(e.attributes.name)||"yandex-verification"===vl(e.attributes.name)||"csrf-token"===vl(e.attributes.name)||"p:domain_verify"===vl(e.attributes.name)||"verify-v1"===vl(e.attributes.name)||"verification"===vl(e.attributes.name)||"shopify-checkout-api-token"===vl(e.attributes.name)))return!0}}return!1}(E,f)||!T&&E.type===kc.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?nl:ol();const O=Object.assign(E,{id:L});if(o.add(e,O),L===nl)return null;v&&v(e);let M=!c;if(O.type===kc.Element){M=M&&!O.needBlock,delete O.needBlock;const t=Nc.shadowRoot(e);t&&Fc(t)&&(O.isShadowHost=!0)}if((O.type===kc.Document||O.type===kc.Element)&&M){f.headWhitespace&&O.type===kc.Element&&"head"===O.tagName&&(T=!1);const t={doc:n,mirror:o,blockClass:r,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:T,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(O.type===kc.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else{O.type===kc.Element&&void 0!==O.attributes._cssText&&"string"==typeof O.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Nc.childNodes(e))){const e=bl(n,t);e&&O.childNodes.push(e)}}let S=null;if(Dc(e)&&(S=Nc.shadowRoot(e)))for(const e of Array.from(Nc.childNodes(S))){const n=bl(e,t);n&&(Fc(S)&&(n.isShadow=!0),O.childNodes.push(n))}}const A=Nc.parentNode(e);return A&&jc(A)&&Fc(A)&&(O.isShadow=!0),O.type===kc.Element&&"iframe"===O.tagName&&function(e,t,n){const o=e.contentWindow;if(!o)return;let r,i=!1;try{r=o.document.readyState}catch(s){return}if("complete"!==r){const o=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}const a="about:blank";if(o.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=bl(t,{doc:t,mirror:o,blockClass:r,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:T,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===kc.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===Vc(O.attributes.href))&&function(e,t,n){let o,r=!1;try{o=e.sheet}catch(a){return}if(o)return;const i=setTimeout((()=>{r||(t(),r=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),r=!0,t()}))}(e,(()=>{if(w){const t=bl(e,{doc:n,mirror:o,blockClass:r,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:T,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),O}class wl{constructor(...e){hc(this,"parentElement",null),hc(this,"parentNode",null),hc(this,"ownerDocument"),hc(this,"firstChild",null),hc(this,"lastChild",null),hc(this,"previousSibling",null),hc(this,"nextSibling",null),hc(this,"ELEMENT_NODE",1),hc(this,"TEXT_NODE",3),hc(this,"nodeType"),hc(this,"nodeName"),hc(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 wl))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 kl(e,t,n=document){const o={capture:!0,passive:!0};return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)}const xl="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 Sl={map:{},getId:()=>(console.error(xl),-1),getNode:()=>(console.error(xl),null),removeNodeFromMap(){console.error(xl)},has:()=>(console.error(xl),!1),reset(){console.error(xl)}};function Cl(e,t,n={}){let o=null,r=0;return function(...i){const a=Date.now();r||!1!==n.leading||(r=a);const s=t-(a-r),c=this;s<=0||s>t?(o&&(clearTimeout(o),o=null),r=a,e.apply(c,i)):o||!1===n.trailing||(o=setTimeout((()=>{r=!1===n.leading?0:Date.now(),o=null,e.apply(c,i)}),s))}}function Il(e,t,n,o,r=window){const i=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>Il(e,t,i||{},!0)}function Tl(e){var t,n,o,r;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=Nc.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==(o=Nc.parentElement(i.body))?void 0:o.scrollTop)||(null==(r=null==i?void 0:i.body)?void 0:r.scrollTop)||0}}function El(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ll(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ol(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Nc.parentElement(e)}function Ml(e,t,n,o){if(!e)return!1;const r=Ol(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(o&&null!==r.closest("."+t))return!0}else if(hl(r,t,o))return!0}catch(i){}if(n){if(r.matches(n))return!0;if(o&&null!==r.closest(n))return!0}return!1}function Al(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===nl}function Pl(e,t){if(jc(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const o=Nc.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||Pl(o,t))}function Rl(e){return Boolean(e.changedTouches)}function _l(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Nl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Dl(e){return!!e&&(e instanceof wl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Nc.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Sl=new Proxy(Sl,{get:(e,t,n)=>("map"===t&&console.error(xl),Reflect.get(e,t,n))}));class jl{constructor(){hc(this,"id",1),hc(this,"styleIDMap",new WeakMap),hc(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 Fl(e){var t;let n=null;return"getRootNode"in e&&(null==(t=Nc.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Nc.host(Nc.getRootNode(e))&&(n=Nc.host(Nc.getRootNode(e))),n}function Bl(e){const t=Nc.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Fl(n);)n=t;return n}(e);return Nc.contains(t,n)}function Hl(e){const t=Nc.ownerDocument(e);return!!t&&(Nc.contains(t,e)||Bl(e))}function Ul(e){return"__ln"in e}class ql{constructor(){hc(this,"length",0),hc(this,"head",null),hc(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;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ul(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ul(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const zl=(e,t)=>`${e}@${t}`;class Wl{constructor(){hc(this,"frozen",!1),hc(this,"locked",!1),hc(this,"texts",[]),hc(this,"attributes",[]),hc(this,"attributeMap",new WeakMap),hc(this,"removes",[]),hc(this,"mapRemoves",[]),hc(this,"movedMap",{}),hc(this,"addedSet",new Set),hc(this,"movedSet",new Set),hc(this,"droppedSet",new Set),hc(this,"removesSubTreeCache",new Set),hc(this,"mutationCb"),hc(this,"blockClass"),hc(this,"blockSelector"),hc(this,"maskTextClass"),hc(this,"maskTextSelector"),hc(this,"inlineStylesheet"),hc(this,"maskInputOptions"),hc(this,"maskTextFn"),hc(this,"maskInputFn"),hc(this,"keepIframeSrcFn"),hc(this,"recordCanvas"),hc(this,"inlineImages"),hc(this,"slimDOMOptions"),hc(this,"dataURLOptions"),hc(this,"doc"),hc(this,"mirror"),hc(this,"iframeManager"),hc(this,"stylesheetManager"),hc(this,"shadowDomManager"),hc(this,"canvasManager"),hc(this,"processedNodeManager"),hc(this,"unattachedDoc"),hc(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),hc(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new ql,o=e=>{let t=e,n=nl;for(;n===nl;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{const i=Nc.parentNode(r);if(!i||!Hl(r))return;let a=!1;if(r.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(a=!0)}const s=jc(i)?this.mirror.getId(Fl(r)):this.mirror.getId(i),c=o(r);if(-1===s||-1===c)return n.addNode(r);const l=bl(r,{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=>{_l(e,this.mirror)&&this.iframeManager.addIframe(e),Nl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Dl(r)&&this.shadowDomManager.addShadowRoot(Nc.shadowRoot(r),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:a});l&&(e.push({parentId:s,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)Vl(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(Nc.parentNode(s))||r(s);for(const s of this.addedSet)Kl(this.droppedSet,s)||Vl(this.removesSubTreeCache,s,this.mirror)?Kl(this.movedSet,s)?r(s):this.droppedSet.add(s):r(s);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(Nc.parentNode(i.value)),n=o(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(Nc.parentNode(n.value));if(-1===o(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,o=Nc.parentNode(t);if(o&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Nc.host(o);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),r(e.value)}const a={texts:this.texts.map((e=>{const t=e.node,n=Nc.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),o=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+o).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!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))})),hc(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(Nc.childNodes(e),(e=>Nc.textContent(e)||"")).join("");t.attributes.value=qc({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Gc(e),value:n,maskInputFn:this.maskInputFn})})),hc(this,"processMutation",(e=>{if(!Al(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Nc.textContent(e.target);Ml(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:gl(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ol(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let o=e.attributeName,r=e.target.getAttribute(o);if("value"===o){const e=Gc(n);r=qc({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(Ml(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===o&&!this.keepIframeSrcFn(r)){if(n.contentDocument)return;o="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===o&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!fl(n.tagName,o))if(i.attributes[o]=pl(this.doc,zc(n.tagName),zc(o),r),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),r=n.style.getPropertyPriority(e);t!==o.style.getPropertyValue(e)||r!==o.style.getPropertyPriority(e)?i.styleDiff[e]=""===r?t:[t,r]:i._unchangedStyles[e]=[t,r]}for(const e of Array.from(o.style))""===n.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===o&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Ml(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),o=jc(e.target)?this.mirror.getId(Nc.host(e.target)):this.mirror.getId(e.target);Ml(e.target,this.blockClass,this.blockSelector,!1)||Al(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Gl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Pl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[zl(n,o)]?Gl(this.movedSet,t):(this.removes.push({parentId:o,id:n,isShadow:!(!jc(e.target)||!Fc(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Nc.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),hc(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Al(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[zl(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ml(e,this.blockClass,this.blockSelector,!1)||(Nc.childNodes(e).forEach((e=>this.genAdds(e))),Dl(e)&&Nc.childNodes(Nc.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 Gl(e,t){e.delete(t),Nc.childNodes(t).forEach((t=>Gl(e,t)))}function Vl(e,t,n){return 0!==e.size&&function(e,t,n){const o=Nc.parentNode(t);return!!o&&e.has(o)}(e,t)}function Kl(e,t){return 0!==e.size&&Xl(e,t)}function Xl(e,t){const n=Nc.parentNode(t);return!!n&&(!!e.has(n)||Xl(e,n))}let Jl;const Yl=e=>{if(!Jl)return e;return(...t)=>{try{return e(...t)}catch(n){if(Jl&&!0===Jl(n))return;throw n}}},$l=[];function Zl(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 Ql(e,t){const n=new Wl;$l.push(n),n.init(e);const[o,r]=Pc(),i=new o(Yl(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,r]}function eu({mouseInteractionCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];let c=null;return Object.keys(vc).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=zc(i);const l=(t=>i=>{const a=Zl(i);if(Ml(a,o,r,!0))return;let s=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=yc.Mouse;break;case"touch":s=yc.Touch;break;case"pen":s=yc.Pen}s===yc.Touch?vc[t]===vc.MouseDown?l="TouchStart":vc[t]===vc.MouseUp&&(l="TouchEnd"):yc.Pen}else Rl(i)&&(s=yc.Touch);null!==s?(c=s,(l.startsWith("Touch")&&s===yc.Touch||l.startsWith("Mouse")&&s===yc.Mouse)&&(s=null)):vc[t]===vc.Click&&(s=c,c=null);const u=Rl(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:f}=u;Yl(e)({type:vc[l],id:d,x:p,y:f,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(vc[i]){case vc.MouseDown:case vc.MouseUp:a=a.replace("mouse","pointer");break;case vc.TouchStart:case vc.TouchEnd:return}s.push(kl(a,l,t))})),Yl((()=>{s.forEach((e=>e()))}))}function tu({scrollCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:i}){return kl("scroll",Yl(Cl(Yl((i=>{const a=Zl(i);if(!a||Ml(a,o,r,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=Tl(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 nu=["INPUT","TEXTAREA","SELECT"],ou=new WeakMap;function ru(e){return function e(t,n){if(cu("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||cu("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||cu("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||cu("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const o=Array.from(t.parentRule.cssRules).indexOf(t);return n.unshift(o),e(t.parentRule,n)}if(t.parentStyleSheet){const e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);n.unshift(e)}return n}(e,[])}function iu(e,t,n){let o,r;return e?(e.ownerNode?o=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:o}):{}}function au({mirror:e,stylesheetManager:t},n){var o,r,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(Nc.host(n));const s="#document"===n.nodeName?null==(o=n.defaultView)?void 0:o.Document:null==(i=null==(r=n.ownerDocument)?void 0:r.defaultView)?void 0:i.ShadowRoot,c=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var n;const o=null==(n=c.set)?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(r){}return o}}),Yl((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function su(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let o;!function(e,t){const{mutationCb:n,mousemoveCb:o,mouseInteractionCb:r,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:f,customElementCb:h}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),o(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),r(...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),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...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),f(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),h(...e)}}(e,t);let r=()=>{};e.recordDOM&&([o,r]=Ql(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:o}){if(!1===t.mousemove)return()=>{};const r="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,s=[];const c=Cl(Yl((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),l=Yl(Cl(Yl((e=>{const t=Zl(e),{clientX:n,clientY:r}=Rl(e)?e.changedTouches[0]:e;a||(a=Rc()),s.push({x:n,y:r,id:o.getId(t),timeOffset:Rc()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?mc.Drag:e instanceof MouseEvent?mc.MouseMove:mc.TouchMove)})),r,{trailing:!1})),u=[kl("mousemove",l,n),kl("touchmove",l,n),kl("drag",l,n)];return Yl((()=>{u.forEach((e=>e()))}))}(e),a=eu(e),s=tu(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,o=-1;return kl("resize",Yl(Cl(Yl((()=>{const t=El(),r=Ll();n===t&&o===r||(e({width:Number(r),height:Number(t)}),n=t,o=r)})),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,ignoreClass:i,ignoreSelector:a,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=Zl(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=Nc.parentElement(n)),!n||!d||nu.indexOf(d)<0||Ml(n,o,r,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let f=n.value,h=!1;const g=Gc(n)||"";"radio"===g||"checkbox"===g?h=n.checked:(s[d.toLowerCase()]||s[g])&&(f=qc({element:n,maskInputOptions:s,tagName:d,type:g,value:f,maskInputFn:c})),p(n,u?{text:f,isChecked:h,userTriggered:l}:{text:f,isChecked:h});const m=n.name;"radio"===g&&m&&h&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!h,userTriggered:!1}:{text:t,isChecked:!h})}}))}function p(t,o){const r=ou.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){ou.set(t,o);const r=n.getId(t);Yl(e)({...o,id:r})}}const f=("last"===l.input?["change"]:["input","change"]).map((e=>kl(e,Yl(d),t))),h=t.defaultView;if(!h)return()=>{f.forEach((e=>e()))};const g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),m=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...m.map((e=>Il(e[0],e[1],{set(){Yl(d)({target:this,isTrusted:!1})}},!1,h)))),Yl((()=>{f.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:o,sampling:r,doc:i}){const a=Yl((i=>Cl(Yl((r=>{const a=Zl(r);if(!a||Ml(a,t,n,!0))return;const{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=a;e({type:i,id:o.getId(a),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})})),r.media||500))),s=[kl("play",a(wc.Play),i),kl("pause",a(wc.Pause),i),kl("seeked",a(wc.Seeked),i),kl("volumechange",a(wc.VolumeChange),i),kl("ratechange",a(wc.RateChange),i)];return Yl((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},f=()=>{},h=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:o}){if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};const r=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:Yl(((o,r,i)=>{const[a,s]=i,{id:c,styleId:l}=iu(r,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:s}]}),o.apply(r,i)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const r=`${e} { ${t} }`;return o.CSSStyleSheet.prototype.insertRule.apply(this,[r,n])};const i=o.CSSStyleSheet.prototype.deleteRule;let a,s;o.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Yl(((o,r,i)=>{const[a]=i,{id:s,styleId:c}=iu(r,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:a}]}),o.apply(r,i)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Yl(((o,r,i)=>{const[a]=i,{id:s,styleId:c}=iu(r,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replace:a}),o.apply(r,i)}))})),o.CSSStyleSheet.prototype.replaceSync&&(s=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Yl(((o,r,i)=>{const[a]=i,{id:s,styleId:c}=iu(r,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replaceSync:a}),o.apply(r,i)}))}));const c={};lu("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(lu("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),lu("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),lu("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));const l={};return Object.entries(c).forEach((([o,r])=>{l[o]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=new Proxy(l[o].insertRule,{apply:Yl(((o,r,i)=>{const[a,s]=i,{id:c,styleId:l}=iu(r.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:[...ru(r),s||0]}]}),o.apply(r,i)}))}),r.prototype.deleteRule=new Proxy(l[o].deleteRule,{apply:Yl(((o,r,i)=>{const[a]=i,{id:s,styleId:c}=iu(r.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:[...ru(r),a]}]}),o.apply(r,i)}))})})),Yl((()=>{o.CSSStyleSheet.prototype.insertRule=r,o.CSSStyleSheet.prototype.deleteRule=i,a&&(o.CSSStyleSheet.prototype.replace=a),s&&(o.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule}))}))}(e,{win:n}),p=au(e,e.doc),f=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:o},{win:r}){const i=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Yl(((r,a,s)=>{var c;const[l,u,d]=s;if(n.has(l))return i.apply(a,[l,u,d]);const{id:p,styleId:f}=iu(null==(c=a.parentRule)?void 0:c.parentStyleSheet,t,o.styleMirror);return(p&&-1!==p||f&&-1!==f)&&e({id:p,styleId:f,set:{property:l,value:u,priority:d},index:ru(a.parentRule)}),r.apply(a,s)}))});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Yl(((r,i,s)=>{var c;const[l]=s;if(n.has(l))return a.apply(i,[l]);const{id:u,styleId:d}=iu(null==(c=i.parentRule)?void 0:c.parentStyleSheet,t,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:l},index:ru(i.parentRule)}),r.apply(i,s)}))}),Yl((()=>{r.CSSStyleDeclaration.prototype.setProperty=i,r.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(h=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const o=[],r=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const o=new i(e,t,n);return r.set(o,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),o};const a=_c(t.fonts,"add",(function(t){return function(n){return setTimeout(Yl((()=>{const t=r.get(n);t&&(e(t),r.delete(n))})),0),t.apply(this,[n])}}));return o.push((()=>{n.FontFace=i})),o.push(a),Yl((()=>{o.forEach((e=>e()))}))}(e)));const g=function(e){const{doc:t,mirror:n,blockClass:o,blockSelector:r,selectionCb:i}=e;let a=!0;const s=Yl((()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const i=e.getRangeAt(t),{startContainer:a,startOffset:c,endContainer:l,endOffset:u}=i;Ml(a,o,r,!0)||Ml(l,o,r,!0)||s.push({start:n.getId(a),startOffset:c,end:n.getId(l),endOffset:u})}i({ranges:s})}));return s(),kl("selectionchange",s)}(e),m=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?_c(n.customElements,"define",(function(e){return function(n,o,r){try{t({define:{name:n}})}catch(i){console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,o,r])}})):()=>{}}(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,n,y.options));return Yl((()=>{$l.forEach((e=>e.reset())),null==o||o.disconnect(),r(),i(),a(),s(),c(),l(),u(),d(),p(),f(),h(),g(),m(),v.forEach((e=>e()))}))}function cu(e){return void 0!==window[e]}function lu(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class uu{constructor(e){hc(this,"iframeIdToRemoteIdMap",new WeakMap),hc(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,o){const r=n||this.getIdToRemoteIdMap(e),i=o||this.getRemoteIdToIdMap(e);let a=r.get(t);return a||(a=this.generateIdFn(),r.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,o)))}getRemoteId(e,t,n){const o=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=o.get(t);return r||-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 du{constructor(e){hc(this,"iframes",new WeakMap),hc(this,"crossOriginIframeMap",new WeakMap),hc(this,"crossOriginIframeMirror",new uu(ol)),hc(this,"crossOriginIframeStyleMirror"),hc(this,"crossOriginIframeRootIdMap",new WeakMap),hc(this,"mirror"),hc(this,"mutationCb"),hc(this,"wrappedEmit"),hc(this,"loadListener"),hc(this,"stylesheetManager"),hc(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new uu(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,o;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==(o=this.loadListener)||o.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 o=this.transformCrossOriginEvent(n,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case gc.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:gc.IncrementalSnapshot,data:{source:mc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case gc.Meta:case gc.Load:case gc.DomContentLoaded:return!1;case gc.Plugin:return t;case gc.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case gc.IncrementalSnapshot:switch(t.data.source){case mc.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 mc.Drag:case mc.TouchMove:case mc.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case mc.ViewportResize:return!1;case mc.MediaInteraction:case mc.MouseInteraction:case mc.Scroll:case mc.CanvasMutation:case mc.Input:return this.replaceIds(t.data,e,["id"]),t;case mc.StyleSheetRule:case mc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case mc.Font:return t;case mc.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case mc.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,o){for(const r of o)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));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===kc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class pu{constructor(e){hc(this,"shadowDoms",new WeakSet),hc(this,"mutationCb"),hc(this,"scrollCb"),hc(this,"bypassOptions"),hc(this,"mirror"),hc(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(!Fc(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Ql({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(tu({...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(Nc.host(e))),this.restoreHandlers.push(au({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(_c(e.prototype,"attachShadow",(function(e){return function(o){const r=e.call(this,o),i=Nc.shadowRoot(this);return i&&Hl(this)&&n.addShadowRoot(i,t),r}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hu="undefined"==typeof Uint8Array?[]:new Uint8Array(256),gu=0;gu<64;gu++)hu[fu.charCodeAt(gu)]=gu;const mu=new Map;const vu=(e,t,n)=>{if(!e||!wu(e,t)&&"object"!=typeof e)return;const o=function(e,t){let n=mu.get(e);return n||(n=new Map,mu.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=o.indexOf(e);return-1===r&&(r=o.length,o.push(e)),r};function yu(e,t,n){if(e instanceof Array)return e.map((e=>yu(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),o=n.length,r="";for(t=0;t<o;t+=3)r+=fu[n[t]>>2],r+=fu[(3&n[t])<<4|n[t+1]>>4],r+=fu[(15&n[t+1])<<2|n[t+2]>>6],r+=fu[63&n[t+2]];return o%3==2?r=r.substring(0,r.length-1)+"=":o%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[yu(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:[yu(e.data,t,n),e.width,e.height]}}if(wu(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:vu(e,t,n)}}return e}const bu=(e,t,n)=>e.map((e=>yu(e,t,n))),wu=(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 ku(e,t,n,o){const r=[];try{const i=_c(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r,...i){if(!Ml(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(r);if("__context"in this||(this.__context=e),o&&["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,[r,...i])}}));r.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach((e=>e()))}}function xu(e,t,n,o,r,i){const a=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if("function"!=typeof e[c])continue;const s=_c(e,c,(function(e){return function(...a){const s=e.apply(this,a);if(vu(s,i,this),"tagName"in this.canvas&&!Ml(this.canvas,o,r,!0)){const e=bu(a,i,this),o={type:t,property:c,args:e};n(this.canvas,o)}return s}}));a.push(s)}catch{const o=Il(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});a.push(o)}return a}const Su='(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',Cu="undefined"!=typeof self&&self.Blob&&new Blob([Su],{type:"text/javascript;charset=utf-8"});function Iu(e){let t;try{if(t=Cu&&(self.URL||self.webkitURL).createObjectURL(Cu),!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(Su),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Tu{constructor(e){hc(this,"pendingCanvasMutations",new Map),hc(this,"rafStamps",{latestId:0,invokeId:null}),hc(this,"mirror"),hc(this,"mutationCb"),hc(this,"resetObservers"),hc(this,"frozen",!1),hc(this,"locked",!1),hc(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:o,blockSelector:r,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,o,r),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,o,r,{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,o,r){const i=ku(t,n,o,!0),a=new Map,s=new Iu;s.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:o,width:r,height:i}=e.data;this.mutationCb({id:t,type:bc["2D"],commands:[{property:"clearRect",args:[0,0,r,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})};const c=1e3/e;let l,u=0;const d=e=>{u&&e-u<c||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{Ml(t,n,o,!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 o=await createImageBitmap(e);s.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:r.dataURLOptions},[o])}))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=ku(e,t,n,!1),r=function(e,t,n,o){const r=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=_c(t.CanvasRenderingContext2D.prototype,a,(function(r){return function(...i){return Ml(this.canvas,n,o,!0)||setTimeout((()=>{const n=bu(i,t,this);e(this.canvas,{type:bc["2D"],property:a,args:n})}),0),r.apply(this,i)}}));r.push(i)}catch{const n=Il(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:bc["2D"],property:a,args:[t],setter:!0})}});r.push(n)}return()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,o){const r=[];return void 0!==t.WebGLRenderingContext&&r.push(...xu(t.WebGLRenderingContext.prototype,bc.WebGL,e,n,o,t)),void 0!==t.WebGL2RenderingContext&&r.push(...xu(t.WebGL2RenderingContext.prototype,bc.WebGL2,e,n,o,t)),()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{o(),r(),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 o=n.map((e=>{const{type:t,...n}=e;return n})),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:o}),this.pendingCanvasMutations.delete(e)}}class Eu{constructor(e){hc(this,"trackedLinkElements",new WeakSet),hc(this,"mutationCb"),hc(this,"adoptedStyleSheetCb"),hc(this,"styleMirror",new jl),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:[]},o=[];for(const r of e){let e;this.styleMirror.has(r)?e=this.styleMirror.getId(r):(e=this.styleMirror.add(r),o.push({styleId:e,rules:Array.from(r.rules||CSSRule,((e,t)=>({rule:Hc(e,r.href),index:t})))})),n.styleIds.push(e)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Lu{constructor(){hc(this,"nodeMap",new WeakMap),hc(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 Ou,Mu,Au,Pu=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(pc=e.contentWindow)?void 0:pc.Array.from)||Array.from,document.body.removeChild(e)}}catch(up){console.debug("Unable to override Array.from",up)}const Ru=new Uc;function _u(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:o,blockClass:r="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:s=null,maskTextClass:c="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:h,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:I=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:L,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:A}=e;Jl=A;const P=!S||window.parent===window;let R=!1;if(!P)try{window.parent.document&&(R=!1)}catch(V){R=!0}if(P&&!t)throw new Error("emit function is required");if(!P&&!R)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Ru.reset();const _=!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},N=yl(f);let D;!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 F=e=>{for(const t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!R&&(e=v(e)),e};Ou=(e,r)=>{var i;const a=e;if(a.timestamp=Rc(),!(null==(i=$l[0])?void 0:i.isFrozen())||a.type===gc.FullSnapshot||a.type===gc.IncrementalSnapshot&&a.data.source===mc.Mutation||$l.forEach((e=>e.unfreeze())),P)null==t||t(F(a),r);else if(R){const e={type:"rrweb",event:F(a),origin:window.location.origin,isCheckout:r};window.parent.postMessage(e,"*")}if(a.type===gc.FullSnapshot)D=a,j=0;else if(a.type===gc.IncrementalSnapshot){if(a.data.source===mc.Mutation&&a.data.isAttachIframe)return;j++;const e=o&&j>=o,t=n&&a.timestamp-D.timestamp>n;(e||t)&&Mu(!0)}};const B=e=>{Ou({type:gc.IncrementalSnapshot,data:{source:mc.Mutation,...e}})},H=e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.Scroll,...e}}),U=e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.CanvasMutation,...e}}),q=new Eu({mutationCb:B,adoptedStyleSheetCb:e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.AdoptedStyleSheet,...e}})}),z=new du({mirror:Ru,mutationCb:B,stylesheetManager:q,recordCrossOriginIframes:S,wrappedEmit:Ou});for(const X of L||[])X.getMirror&&X.getMirror({nodeMirror:Ru,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});const W=new Lu;Au=new Tu({recordCanvas:x,mutationCb:U,win:window,blockClass:r,blockSelector:i,mirror:Ru,sampling:y.canvas,dataURLOptions:b});const G=new pu({mutationCb:B,scrollCb:H,bypassOptions:{blockClass:r,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:_,dataURLOptions:b,maskTextFn:g,maskInputFn:h,recordCanvas:x,inlineImages:E,sampling:y,slimDOMOptions:N,iframeManager:z,stylesheetManager:q,canvasManager:Au,keepIframeSrcFn:O,processedNodeManager:W},mirror:Ru});Mu=(e=!1)=>{if(!k)return;Ou({type:gc.Meta,data:{href:window.location.href,width:Ll(),height:El()}},e),q.reset(),G.init(),$l.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new Uc,blockClass:o="rr-block",blockSelector:r=null,maskTextClass:i="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:p,slimDOM:f=!1,dataURLOptions:h,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return bl(e,{doc:e,mirror:n,blockClass:o,blockSelector:r,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:yl(f),dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:Ru,blockClass:r,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:_,maskTextFn:g,maskInputFn:h,slimDOM:N,dataURLOptions:b,recordCanvas:x,inlineImages:E,onSerialize:e=>{_l(e,Ru)&&z.addIframe(e),Nl(e,Ru)&&q.trackLinkElement(e),Dl(e)&&G.addShadowRoot(Nc.shadowRoot(e),document)},onIframeLoad:(e,t)=>{z.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!t)return console.warn("Failed to snapshot the document");Ou({type:gc.FullSnapshot,data:{node:t,initialOffset:Tl(window)}},e),$l.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,Ru.getId(document))};try{const e=[],t=e=>{var t;return Yl(su)({mutationCb:B,mousemoveCb:(e,t)=>Ou({type:gc.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.MouseInteraction,...e}}),scrollCb:H,viewportResizeCb:e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.ViewportResize,...e}}),inputCb:e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.Input,...e}}),mediaInteractionCb:e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.MediaInteraction,...e}}),styleSheetRuleCb:e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.StyleSheetRule,...e}}),styleDeclarationCb:e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.StyleDeclaration,...e}}),canvasMutationCb:U,fontCb:e=>Ou({type:gc.IncrementalSnapshot,data:{source:mc.Font,...e}}),selectionCb:e=>{Ou({type:gc.IncrementalSnapshot,data:{source:mc.Selection,...e}})},customElementCb:e=>{Ou({type:gc.IncrementalSnapshot,data:{source:mc.CustomElement,...e}})},blockClass:r,ignoreClass:a,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:_,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:E,userTriggeredOnInput:I,collectFonts:T,doc:e,maskInputFn:h,maskTextFn:g,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:N,dataURLOptions:b,mirror:Ru,iframeManager:z,stylesheetManager:q,shadowDomManager:G,processedNodeManager:W,canvasManager:Au,ignoreCSSAttributes:M,plugins:(null==(t=null==L?void 0:L.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Ou({type:gc.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(o){console.warn(o)}}));const n=()=>{Mu(),e.push(t(document)),Pu=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(kl("DOMContentLoaded",(()=>{Ou({type:gc.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(kl("load",(()=>{Ou({type:gc.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),Pu=!1,Jl=void 0}}catch(K){console.warn(K)}}_u.addCustomEvent=(e,t)=>{if(!Pu)throw new Error("please add custom event after start recording");Ou({type:gc.Custom,data:{tag:e,payload:t}})},_u.freezePage=()=>{$l.forEach((e=>e.freeze()))},_u.takeFullSnapshot=e=>{if(!Pu)throw new Error("please take full snapshot after start recording");Mu(e)},_u.mirror=Ru;var Nu=Uint8Array,Du=Uint16Array,ju=Uint32Array,Fu=new Nu([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]),Bu=new Nu([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]),Hu=new Nu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Uu=function(e,t){for(var n=new Du(31),o=0;o<31;++o)n[o]=t+=1<<e[o-1];var r=new ju(n[30]);for(o=1;o<30;++o)for(var i=n[o];i<n[o+1];++i)r[i]=i-n[o]<<5|o;return[n,r]},qu=Uu(Fu,2),zu=qu[0],Wu=qu[1];zu[28]=258,Wu[258]=28;for(var Gu=Uu(Bu,0),Vu=(Gu[0],Gu[1]),Ku=new Du(32768),Xu=0;Xu<32768;++Xu){var Ju=(43690&Xu)>>>1|(21845&Xu)<<1;Ju=(61680&(Ju=(52428&Ju)>>>2|(13107&Ju)<<2))>>>4|(3855&Ju)<<4,Ku[Xu]=((65280&Ju)>>>8|(255&Ju)<<8)>>>1}var Yu=function(e,t,n){for(var o=e.length,r=0,i=new Du(t);r<o;++r)++i[e[r]-1];var a,s=new Du(t);for(r=0;r<t;++r)s[r]=s[r-1]+i[r-1]<<1;if(n){a=new Du(1<<t);var c=15-t;for(r=0;r<o;++r)if(e[r])for(var l=r<<4|e[r],u=t-e[r],d=s[e[r]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[Ku[d]>>>c]=l}else for(a=new Du(o),r=0;r<o;++r)a[r]=Ku[s[e[r]-1]++]>>>15-e[r];return a},$u=new Nu(288);for(Xu=0;Xu<144;++Xu)$u[Xu]=8;for(Xu=144;Xu<256;++Xu)$u[Xu]=9;for(Xu=256;Xu<280;++Xu)$u[Xu]=7;for(Xu=280;Xu<288;++Xu)$u[Xu]=8;var Zu=new Nu(32);for(Xu=0;Xu<32;++Xu)Zu[Xu]=5;var Qu=Yu($u,9,0),ed=Yu(Zu,5,0),td=function(e){return(e/8>>0)+(7&e&&1)},nd=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var o=new(e instanceof Du?Du:e instanceof ju?ju:Nu)(n-t);return o.set(e.subarray(t,n)),o},od=function(e,t,n){n<<=7&t;var o=t/8>>0;e[o]|=n,e[o+1]|=n>>>8},rd=function(e,t,n){n<<=7&t;var o=t/8>>0;e[o]|=n,e[o+1]|=n>>>8,e[o+2]|=n>>>16},id=function(e,t){for(var n=[],o=0;o<e.length;++o)e[o]&&n.push({s:o,f:e[o]});var r=n.length,i=n.slice();if(!r)return[new Nu(0),0];if(1==r){var a=new Nu(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=r-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var p=i[0].s;for(o=1;o<r;++o)i[o].s>p&&(p=i[o].s);var f=new Du(p+1),h=ad(n[u-1],f,0);if(h>t){o=0;var g=0,m=h-t,v=1<<m;for(i.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));o<r;++o){var y=i[o].s;if(!(f[y]>t))break;g+=v-(1<<h-f[y]),f[y]=t}for(g>>>=m;g>0;){var b=i[o].s;f[b]<t?g-=1<<t-f[b]++-1:++o}for(;o>=0&&g;--o){var w=i[o].s;f[w]==t&&(--f[w],++g)}h=t}return[new Nu(f),h]},ad=function(e,t,n){return-1==e.s?Math.max(ad(e.l,t,n+1),ad(e.r,t,n+1)):t[e.s]=n},sd=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Du(++t),o=0,r=e[0],i=1,a=function(e){n[o++]=e},s=1;s<=t;++s)if(e[s]==r&&s!=t)++i;else{if(!r&&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(r),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(r);i=1,r=e[s]}return[n.subarray(0,o),t]},cd=function(e,t){for(var n=0,o=0;o<t.length;++o)n+=e[o]*t[o];return n},ld=function(e,t,n){var o=n.length,r=td(t+2);e[r]=255&o,e[r+1]=o>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var i=0;i<o;++i)e[r+i+4]=n[i];return 8*(r+4+o)},ud=function(e,t,n,o,r,i,a,s,c,l,u){od(t,u++,n),++r[256];for(var d=id(r,15),p=d[0],f=d[1],h=id(i,15),g=h[0],m=h[1],v=sd(p),y=v[0],b=v[1],w=sd(g),k=w[0],x=w[1],S=new Du(19),C=0;C<y.length;++C)S[31&y[C]]++;for(C=0;C<k.length;++C)S[31&k[C]]++;for(var I=id(S,7),T=I[0],E=I[1],L=19;L>4&&!T[Hu[L-1]];--L);var O,M,A,P,R=l+5<<3,_=cd(r,$u)+cd(i,Zu)+a,N=cd(r,p)+cd(i,g)+a+14+3*L+cd(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(R<=_&&R<=N)return ld(t,u,e.subarray(c,c+l));if(od(t,u,1+(N<_)),u+=2,N<_){O=Yu(p,f,0),M=p,A=Yu(g,m,0),P=g;var D=Yu(T,E,0);od(t,u,b-257),od(t,u+5,x-1),od(t,u+10,L-4),u+=14;for(C=0;C<L;++C)od(t,u+3*C,T[Hu[C]]);u+=3*L;for(var j=[y,k],F=0;F<2;++F){var B=j[F];for(C=0;C<B.length;++C){var H=31&B[C];od(t,u,D[H]),u+=T[H],H>15&&(od(t,u,B[C]>>>5&127),u+=B[C]>>>12)}}}else O=Qu,M=$u,A=ed,P=Zu;for(C=0;C<s;++C)if(o[C]>255){H=o[C]>>>18&31;rd(t,u,O[H+257]),u+=M[H+257],H>7&&(od(t,u,o[C]>>>23&31),u+=Fu[H]);var U=31&o[C];rd(t,u,A[U]),u+=P[U],U>3&&(rd(t,u,o[C]>>>5&8191),u+=Bu[U])}else rd(t,u,O[o[C]]),u+=M[o[C]];return rd(t,u,O[256]),u+M[256]},dd=new ju([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),pd=function(e,t,n,o,r){return function(e,t,n,o,r,i){var a=e.length,s=new Nu(o+a+5*(1+Math.floor(a/7e3))+r),c=s.subarray(o,s.length-r),l=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d<a?l=ld(c,l,e.subarray(u,d)):(c[u]=i,l=ld(c,l,e.subarray(u,a)))}else{for(var p=dd[t-1],f=p>>>13,h=8191&p,g=(1<<n)-1,m=new Du(32768),v=new Du(g+1),y=Math.ceil(n/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},k=new ju(25e3),x=new Du(288),S=new Du(32),C=0,I=0,T=(u=0,0),E=0,L=0;u<a;++u){var O=w(u),M=32767&u,A=v[O];if(m[M]=A,v[O]=M,E<=u){var P=a-u;if((C>7e3||T>24576)&&P>423){l=ud(e,c,0,k,x,S,I,T,L,u-L,l),T=C=I=0,L=u;for(var R=0;R<286;++R)x[R]=0;for(R=0;R<30;++R)S[R]=0}var _=2,N=0,D=h,j=M-A&32767;if(P>2&&O==w(u-j))for(var F=Math.min(f,P)-1,B=Math.min(32767,u),H=Math.min(258,P);j<=B&&--D&&M!=A;){if(e[u+_]==e[u+_-j]){for(var U=0;U<H&&e[u+U]==e[u+U-j];++U);if(U>_){if(_=U,N=j,U>F)break;var q=Math.min(j,U-2),z=0;for(R=0;R<q;++R){var W=u-j+R+32768&32767,G=W-m[W]+32768&32767;G>z&&(z=G,A=W)}}}j+=(M=A)-(A=m[M])+32768&32767}if(N){k[T++]=268435456|Wu[_]<<18|Vu[N];var V=31&Wu[_],K=31&Vu[N];I+=Fu[V]+Bu[K],++x[257+V],++S[K],E=u+_,++C}else k[T++]=e[u],++x[e[u]]}}l=ud(e,c,i,k,x,S,I,T,L,u-L,l)}return nd(s,0,o+td(l)+r)}(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,o,!0)};function fd(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var o=e,r=t,i=n.length,a=0;a!=i;){for(var s=Math.min(a+5552,i);a<s;++a)r+=o+=n[a];o%=65521,r%=65521}e=o,t=r},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var o,r,i,a=pd(e,t,2,4);return o=a,r=t.level,i=0==r?0:r<6?1:9==r?3:2,o[0]=120,o[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 hd=e=>{const t={...e,v:"v1"};return function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var o=0;o<e.length;){var r=e[o++];r<128||t?n+=String.fromCharCode(r):r<224?n+=String.fromCharCode((31&r)<<6|63&e[o++]):r<240?n+=String.fromCharCode((15&r)<<12|(63&e[o++])<<6|63&e[o++]):(r=((15&r)<<18|(63&e[o++])<<12|(63&e[o++])<<6|63&e[o++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}(fd(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var o=new Nu(e.length+(e.length>>>1)),r=0,i=function(e){o[r++]=e},a=0;a<n;++a){if(r+5>o.length){var s=new Nu(r+8+(n-a<<1));s.set(o),o=s}var c=e.charCodeAt(a);c<128||t?i(c):c<2048?(i(192|c>>>6),i(128|63&c)):c>55295&&c<57344?(i(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),i(128|c>>>12&63),i(128|c>>>6&63),i(128|63&c)):(i(224|c>>>12),i(128|c>>>6&63),i(128|63&c))}return nd(o,0,r)}(JSON.stringify(t))),!0)};function gd(e){return function(e){if(Array.isArray(e))return md(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 md(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 md(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 md(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function vd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function yd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vd(Object(n),!0).forEach((function(t){wd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bd(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,kd(o.key),o)}}function wd(e,t,n){return(t=kd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kd(e){var t=function(e,t){if("object"!=xd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=xd(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xd(t)?t:String(t)}function xd(e){return xd="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},xd(e)}var Sd=10485760,Cd=function e(t){if("string"==typeof t)return t.length+2;if(null===t||"object"!==xd(t))return"number"==typeof t?String(t).length:5;var n=2;if(Array.isArray(t)){for(var o=0;o<t.length;o++)n+=e(t[o])+1;return n}for(var r in t)n+=r.length+4+e(t[r]);return n},Id=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),wd(this,"startDate",void 0),wd(this,"segments",[[]]),wd(this,"segmentSizes",[0]),wd(this,"incrementalSize",0),wd(this,"lastForcedCheckout",0),wd(this,"forcedCheckoutTimeout",void 0),wd(this,"stopFunction",void 0),wd(this,"customOptions",{})}var t,n,o;return t=e,n=[{key:"setOptions",value:function(e){this.customOptions=e,this.stopFunction&&this.start()}},{key:"start",value:function(){var e=this;this.stop(),this.startDate=Date.now(),this.resetBuffer();var t={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=_u(yd(yd(yd(yd({},t),this.customOptions),function(e){var t=function(t,n){var o=To(n,e);return o?o(t):t};return!0===(e=e||{}).maskAllInputs?{maskInputFn:t}:{maskInputFn:t,maskInputOptions:po(po({},Io(e)),bo)}}(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 o=Cd(t);e.segments[e.segments.length-1].push(t),e.segmentSizes[e.segmentSizes.length-1]+=o,t&&4!==t.type&&2!==t.type&&(e.incrementalSize+=o),e.enforceBufferSize()}}))}catch(n){console.error(n)}}},{key:"startIfNotRunning",value:function(){this.stopFunction||this.start()}},{key:"stop",value:function(){this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.startDate=void 0,this.resetBuffer()}},{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;t<this.segmentSizes.length;t++)e+=this.segmentSizes[t];return e}},{key:"enforceBufferSize",value:function(){for(;this.segments.length>1&&this.getBufferSize()>Sd;)this.dropOldestSegment();this.getBufferSize()>Sd&&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{_u.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,gd(this.segments)),n=t,o=!1;try{n=t.map((function(e){return hd(e)})),o=!0}catch(r){n=t,o=!1}return{startDate:this.startDate,events:n,packed:o,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:ee(),type:"rrweb"}}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&bd(t.prototype,n),o&&bd(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Td(e){return Td="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},Td(e)}function Ed(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Od(o.key),o)}}function Ld(e,t,n){return(t=Od(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Od(e){var t=function(e,t){if("object"!=Td(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Td(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Td(t)?t:String(t)}wd(Id,"instance",void 0);var Md=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ld(this,"shortCutListener",void 0)}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"start",value:function(){this.shortCutListener||(this.shortCutListener=document.addEventListener("keyup",(function(e){var t,n,o=(void 0!==(t=e).key?n=t.key:void 0!==t.keyIdentifier?n=t.keyIdentifier:void 0!==t.keyCode&&(n=t.keyCode),n);!e.ctrlKey||"u"!==o&&"U"!==o&&85!==o||cp.startFeedbackFlowWithOptions("bugreporting",{autostartDrawing:!0})})))}},{key:"stop",value:function(){this.shortCutListener&&(document.removeEventListener("keyup",this.shortCutListener),this.shortCutListener=void 0)}}])&&Ed(t.prototype,n),o&&Ed(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ad(e){return Ad="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},Ad(e)}function Pd(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_d(o.key),o)}}function Rd(e,t,n){return(t=_d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _d(e){var t=function(e,t){if("object"!=Ad(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ad(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ad(t)?t:String(t)}Ld(Md,"instance",void 0);var Nd=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Rd(this,"eventArray",[]),Rd(this,"streamedEventArray",[]),Rd(this,"eventMaxLength",500),Rd(this,"errorCount",0),Rd(this,"streamingEvents",!1),Rd(this,"lastUrl",void 0),Rd(this,"mainLoopTimeout",null),Rd(this,"socket",null),Rd(this,"connectedWebSocketGleapId",null),Rd(this,"connectionTimeout",null),Rd(this,"pingWS",null),Rd(this,"handleOpenBound",null),Rd(this,"handleErrorBound",null),Rd(this,"handleMessageBound",null),Rd(this,"handleCloseBound",null),Rd(this,"runEventStreamLoop",(function(){var e=t;t.streamEvents(),t.mainLoopTimeout=setTimeout((function(){e.runEventStreamLoop()}),2500)})),Rd(this,"streamEvents",(function(){if(!(!ba.getInstance().ready||t.streamingEvents||t.errorCount>2)&&0!==t.streamedEventArray.length&&t.socket&&t.socket.readyState===t.socket.OPEN){var e=t;t.streamingEvents=!0;var n=new XMLHttpRequest;n.open("POST",ba.getInstance().apiUrl+"/sessions/events"),n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),ba.getInstance().injectSession(n),n.onerror=function(){e.errorCount++,e.streamingEvents=!1},n.onreadystatechange=function(t){4===n.readyState&&(200===n.status||201===n.status?e.errorCount=0:e.errorCount++,e.streamingEvents=!1)};var o=us.getInstance().getSessionDuration();n.send(JSON.stringify({time:o,events:t.streamedEventArray,opened:Wa.getInstance().isOpened(),type:"js",sdkVersion:"18.1.2",ws:!0})),t.streamedEventArray=[]}})),this.handleOpenBound=this.handleOpen.bind(this),this.handleErrorBound=this.handleError.bind(this),this.handleMessageBound=this.handleMessage.bind(this),this.handleCloseBound=this.handleClose.bind(this)}var t,n,o;return t=e,n=[{key:"cleanupWebSocket",value:function(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.pingWS&&clearInterval(this.pingWS),this.socket&&(this.socket.removeEventListener("open",this.handleOpenBound),this.socket.removeEventListener("error",this.handleErrorBound),this.socket.removeEventListener("message",this.handleMessageBound),this.socket.removeEventListener("close",this.handleCloseBound),this.socket.close(),this.socket=null)}},{key:"initWebSocket",value:function(){this.cleanupWebSocket(),this.connectedWebSocketGleapId=ba.getInstance().session.gleapId,ba.getInstance().session&&ba.getInstance().sdkKey&&(this.socket=new WebSocket("".concat(ba.getInstance().wsApiUrl,"?gleapId=").concat(ba.getInstance().session.gleapId,"&gleapHash=").concat(ba.getInstance().session.gleapHash,"&apiKey=").concat(ba.getInstance().sdkKey,"&sdkVersion=").concat("18.1.2")),this.socket.addEventListener("open",this.handleOpenBound),this.socket.addEventListener("message",this.handleMessageBound),this.socket.addEventListener("error",this.handleErrorBound),this.socket.addEventListener("close",this.handleCloseBound))}},{key:"handleOpen",value:function(e){var t=this;this.pingWS=setInterval((function(){t.socket.readyState===t.socket.OPEN&&(t.socket.send("PING"),t.socket.send(9))}),1e4),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null)}},{key:"handleMessage",value:function(e){this.processMessage(JSON.parse(e.data))}},{key:"handleError",value:function(e){}},{key:"handleClose",value:function(e){var t=this;setTimeout((function(){t.initWebSocket()}),5e3)}},{key:"processMessage",value:function(e){try{if(lt.getInstance().initialized)return;if("update"===e.name){var t,n,o=e.data,r=o.a,i=o.u,a=o.ai,s=o.rc,c=Wa.getInstance().isOpened();if(s&&Ls.getInstance().clearNotificationsForConversation(s),a&&an.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}),r){var l=["banner","modal"],u=r.filter((function(e){var t;return!c||l.includes(null==e||null===(t=e.actionType)||void 0===t?void 0:t.toLowerCase())}));cp.getInstance().performActions(u)}null!=i&&Ls.getInstance().setNotificationCount(i)}if("checklist"===e.name&&null!=e&&e.data&&window){var d,p,f=e.data,h=null!==(d=f.completedSteps)&&void 0!==d?d:[],g=null!==(p=f.completedStepsBefore)&&void 0!==p?p:[];if(h.length>g.length)for(var m=function(e){var t,n=null==f||null===(t=f.steps)||void 0===t?void 0:t.find((function(t){return t.id===h[e]}));if(!n)return 1;var o=e;g.includes(n)||Ht.notifyEvent("checklist-step-completed",{checklistId:f.id,outboundId:f.outboundId,stepId:n.id,stepIndex:o,step:n,completedSteps:f.completedSteps,status:f.status,data:f})},v=0;v<h.length;v++)m(v);"done"===f.status&&Ht.notifyEvent("checklist-completed",{checklistId:f.id,outboundId:f.outboundId,completedSteps:f.completedSteps,status:f.status,data:f}),"function"==typeof window.dispatchEvent&&window.dispatchEvent(new CustomEvent("checkListUpdate",{detail:e.data}))}}catch(y){}}},{key:"getEventArray",value:function(){return this.eventArray}},{key:"stop",value:function(){this.cleanupMainLoop()}},{key:"resetErrorCountLoop",value:function(){var e=this;setInterval((function(){e.errorCount=0}),6e4)}},{key:"cleanupMainLoop",value:function(){this.mainLoopTimeout&&(clearInterval(this.mainLoopTimeout),this.mainLoopTimeout=null)}},{key:"restart",value:function(){this.connectedWebSocketGleapId!==ba.getInstance().session.gleapId&&this.initWebSocket(),this.cleanupMainLoop(),this.trackInitialEvents(),this.runEventStreamLoop()}},{key:"start",value:function(){this.startPageListener(),this.resetErrorCountLoop()}},{key:"trackInitialEvents",value:function(){e.getInstance().logEvent("sessionStarted"),e.getInstance().logCurrentPage()}},{key:"logCurrentPage",value:function(){if(!cp.getInstance().disablePageTracking){var e=window.location.href;e&&e!==this.lastUrl&&(this.lastUrl=e,this.logEvent("pageView",{page:e}))}}},{key:"startPageListener",value:function(){var e=this;setInterval((function(){e.logCurrentPage();try{Ls.getInstance().checkPageRulesForUrl(window.location.href)}catch(t){}}),1e3)}},{key:"logEvent",value:function(e,t){var n={name:e,date:new Date};t&&(n.data=te(t)),this.eventArray.push(n),this.streamedEventArray.push(n),this.eventArray.length>this.eventMaxLength&&this.eventArray.shift(),this.streamedEventArray.length>this.eventMaxLength&&this.streamedEventArray.shift()}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Pd(t.prototype,n),o&&Pd(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Dd(e){return Dd="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},Dd(e)}function jd(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Bd(o.key),o)}}function Fd(e,t,n){return(t=Bd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bd(e){var t=function(e,t){if("object"!=Dd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Dd(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Dd(t)?t:String(t)}Rd(Nd,"instance",void 0);var Hd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Fd(this,"channel",null)}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"start",value:function(){var e=this;if(!this.channel&&"undefined"!=typeof BroadcastChannel)try{var t=ba.getInstance().sdkKey;this.channel=new BroadcastChannel("gleap-tabs-".concat(t)),this.channel.onmessage=function(t){return e.handleMessage(t&&t.data)}}catch(n){this.channel=null}}},{key:"sendMessage",value:function(e){if(this.channel)try{this.channel.postMessage(e)}catch(t){}}},{key:"handleMessage",value:function(e){try{var t;if(!e||!e.type)return;var n=null===(t=ba.getInstance().session)||void 0===t?void 0:t.gleapId;if(!e.gleapId||!n||e.gleapId!==n)return;"notifications-cleared"===e.type&&(Ls.getInstance().clearAllNotifications(!1,!0),D.getInstance().updateNotificationBadge(0)),"conversation-notifications-cleared"===e.type&&e.shareToken&&Ls.getInstance().clearNotificationsForConversation(e.shareToken,!0),"chatbar-notification-cleared"===e.type&&an.getInstance().hideChatbarNotification(!0)}catch(o){}}},{key:"stop",value:function(){try{this.channel&&this.channel.close()}catch(e){}this.channel=null}}])&&jd(t.prototype,n),o&&jd(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ud(e){return Ud="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},Ud(e)}function qd(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Wd(o.key),o)}}function zd(e,t,n){return(t=Wd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wd(e){var t=function(e,t){if("object"!=Ud(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ud(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ud(t)?t:String(t)}Fd(Hd,"instance",void 0);var Gd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),zd(this,"tags",[])}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"getTags",value:function(){return this.tags}},{key:"setTags",value:function(e){this.tags=e}}])&&qd(t.prototype,n),o&&qd(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Vd(e){return Vd="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},Vd(e)}function Kd(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Jd(o.key),o)}}function Xd(e,t,n){return(t=Jd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jd(e){var t=function(e,t){if("object"!=Vd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Vd(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vd(t)?t:String(t)}zd(Gd,"instance",void 0);var Yd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Xd(this,"overrideLanguage",""),Xd(this,"isRTLLayout",!1)}var t,n,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"translateText",value:function(e){if(!e)return"";var t=zn.getInstance().getFlowConfig().staticTranslations;return t&&t[e]?t[e]:e}},{key:"translateTextWithVars",value:function(e,t){if(!e)return"";var n=this.translateText(e);return n?n.replace(/{(\w+)}/g,(function(e,n){return t[n]})):""}}],(n=[{key:"getOverrideLanguage",value:function(){return this.overrideLanguage}},{key:"setOverrideLanguage",value:function(e){this.overrideLanguage=e}},{key:"updateRTLSupport",value:function(){var e=zn.getInstance().getFlowConfig();this.isRTLLayout=!1,e&&e.localizationOptions&&e.localizationOptions.rtl&&(this.isRTLLayout=!0),D.getInstance().updateFeedbackButtonState(),Wa.getInstance().updateFrameStyle()}},{key:"getActiveLanguage",value:function(){var e="en";if("undefined"!=typeof navigator&&(e=navigator.language.toLowerCase()),"undefined"!=typeof document&&document.documentElement){var t=document.documentElement.lang;t&&""!==t.trim()&&(e=t.toLowerCase().trim())}return this.overrideLanguage&&""!==this.overrideLanguage&&(e=this.overrideLanguage.toLowerCase()),e}}])&&Kd(t.prototype,n),o&&Kd(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function $d(e){return $d="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},$d(e)}function Zd(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,np(o.key),o)}}function Qd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ep(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qd(Object(n),!0).forEach((function(t){tp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tp(e,t,n){return(t=np(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function np(e){var t=function(e,t){if("object"!=$d(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=$d(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$d(t)?t:String(t)}Xd(Yd,"instance",void 0),"undefined"!=typeof window&&"undefined"!=typeof HTMLCanvasElement&&HTMLCanvasElement.prototype&&void 0===HTMLCanvasElement.prototype.__originalGetContext&&(HTMLCanvasElement.prototype.__originalGetContext=HTMLCanvasElement.prototype.getContext,HTMLCanvasElement.prototype.getContext=function(e,t){return this.__originalGetContext(e,ep(ep({},t),{},{preserveDrawingBuffer:!0}))}),"undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&"undefined"!=typeof window&&(function(){if("undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&"undefined"!=typeof window){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),On(Cn(e=Sn(this,t)),"activeStep",-1),On(Cn(e),"checklistData",null),On(Cn(e),"_isInitialLoad",!1),On(Cn(e),"_initialActiveSet",!1),On(Cn(e),"_hasLoaded",!1),On(Cn(e),"_isSessionReady",!1),On(Cn(e),"_boundHandleChecklistUpdate",e.handleChecklistUpdate.bind(Cn(e))),On(Cn(e),"_boundHandleSessionUpdate",e.handleSessionUpdate.bind(Cn(e))),e.attachShadow({mode:"open"});try{e._networkManager=void 0!==ba&&void 0!==A?A.getInstance():null}catch(n){e._networkManager=null}return e._boundFloatingLauncherClick=e.handleFloatingLauncherClick.bind(Cn(e)),e._boundFloatingCloseClick=e.handleFloatingCloseClick.bind(Cn(e)),e._floatingHideTimeout=null,e}var n,o,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&En(e,t)}(t,e),n=t,o=[{key:"connectedCallback",value:function(){window.addEventListener("checkListUpdate",this._boundHandleChecklistUpdate),window.addEventListener("session-updated",this._boundHandleSessionUpdate),window.addEventListener("resize",this._boundResizeHandler=this.handleResize.bind(this)),this._checkSessionAndLoad()}},{key:"disconnectedCallback",value:function(){window.removeEventListener("checkListUpdate",this._boundHandleChecklistUpdate),window.removeEventListener("session-updated",this._boundHandleSessionUpdate),window.removeEventListener("resize",this._boundResizeHandler),this.removeFloatingClickListeners(),this._floatingHideTimeout&&(clearTimeout(this._floatingHideTimeout),this._floatingHideTimeout=null),this.checklistData=null,this.activeStep=-1,this._hasLoaded=!1,this._isSessionReady=!1,this._initialActiveSet=!1,this.renderResponse()}},{key:"handleResize",value:function(){this.updateActiveTaskMaxHeight()}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&("checklistId"===e&&this._isSessionReady?this.loadChecklist():"checklistId"!==e&&this._hasLoaded&&this.checklistData&&this.renderChecklist(this.checklistData))}},{key:"_checkSessionAndLoad",value:function(){var e=this._getGleapSessionInstance(),t=this.getAttribute("checklistId");e.ready&&t?(this._isSessionReady=!0,this._networkManager=A.getInstance(),this.loadChecklist()):(this._isSessionReady=!1,this._hasLoaded=!1,this.checklistData=null,this.activeStep=-1,this._initialActiveSet=!1,this.renderResponse())}},{key:"handleSessionUpdate",value:function(){this._checkSessionAndLoad()}},{key:"_getGleapSessionInstance",value:function(){try{return void 0!==ba?ba.getInstance():null}catch(e){return null}}},{key:"infoEnabled",get:function(){var e=this.getAttribute("info");return null===e||"false"!==e.toLowerCase()}},{key:"progressbarEnabled",get:function(){var e=this.getAttribute("progressbar");return null===e||"false"!==e.toLowerCase()}},{key:"floatingEnabled",get:function(){return"true"===this.getAttribute("floating")}},{key:"_translate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Yd.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Yd.translateTextWithVars(e,t)||n}},{key:"getCheckIcon",value:function(){return'<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M20.7071 5.29289C21.0976 5.68342 21.0976 6.31658 20.7071 6.70711L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071L3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929C3.68342 10.9024 4.31658 10.9024 4.70711 11.2929L9 15.5858L19.2929 5.29289C19.6834 4.90237 20.3166 4.90237 20.7071 5.29289Z" fill="currentColor"/>\n </svg>'}},{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!==Yd&&(n=Yd.getInstance().getActiveLanguage()||"en")}catch(o){}return"gleapId=".concat(t.gleapId||"","&gleapHash=").concat(t.gleapHash||"","&lang=").concat(n)}},{key:"makeRequest",value:function(e,t,n,o){var r=this._getGleapSessionInstance();if(null!=r&&r.session){var i=new XMLHttpRequest;i.open(e,t);try{r.injectSession(i)}catch(a){}n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){4===i.readyState&&o(i)},i.onerror=function(){o(i)},i.send(n?JSON.stringify(n):null)}else o({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 o,r=(null===(o=e.outbound)||void 0===o||null===(o=o.config)||void 0===o?void 0:o.steps)||[],i=e.completedSteps||[],a=r.findIndex((function(e){return!i.includes(e.id)}));t.activeStep=a>=0?a:-1,-1!==t.activeStep&&(t._initialActiveSet=!0)}t.renderChecklist(t.checklistData),Ht.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,o,r=this._getGleapSessionInstance();if(null!=r&&r.session){var i=r.apiUrl;if(i){var a=r.session,s=null!==(n=null==a?void 0:a.gleapId)&&void 0!==n?n:"",c=null!==(o=null==a?void 0:a.gleapHash)&&void 0!==o?o:"",l="en";try{void 0!==Yd&&(l=Yd.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(c,"&lang=").concat(l),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,o=wn(this.checklistData.completedSteps||[]),r=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(o)&&(this.checklistData.completedSteps=wn(t.completedSteps),r=!0,-1!==a)){var s,c=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;c&&this.checklistData.completedSteps.includes(c)&&!o.includes(c)&&(i=!0)}if(t.status&&t.status!==this.checklistData.status&&(this.checklistData.status=t.status,r=!0),i){for(var l,u=(null===(l=this.checklistData.outbound)||void 0===l||null===(l=l.config)||void 0===l?void 0:l.steps)||[],d=-1,p=a+1;p<u.length;p++)if(!this.checklistData.completedSteps.includes(u[p].id)){d=p;break}this.activeStep!==d&&this.setActiveStep(d),r=!0}r&&(this.renderChecklist(this.checklistData),Ht.notifyEvent("checklist-update",{checklistId:this.checklistData.id,outboundId:null===(n=this.checklistData.outbound)||void 0===n?void 0:n.id,completedSteps:this.checklistData.completedSteps,status:this.checklistData.status,data:this.checklistData}))}}}},{key:"handleFloatingLauncherClick",value:function(e){if(e.stopPropagation(),"done"!==this.checklistData.status){var t=this.shadowRoot.querySelector(".checklist-tasks");t&&(t.style.display="block"===t.style.display?"none":"block")}}},{key:"handleFloatingCloseClick",value:function(e){e.stopPropagation();var t=this.shadowRoot.querySelector(".checklist-tasks");t&&(t.style.display="none")}},{key:"addFloatingClickListeners",value:function(){var e=this.shadowRoot.querySelector(".checklist-floating-launcher");e&&e.addEventListener("click",this._boundFloatingLauncherClick);var t=this.shadowRoot.querySelector(".checklist-floating-header");t&&t.addEventListener("click",this._boundFloatingCloseClick)}},{key:"removeFloatingClickListeners",value:function(){var e=this.shadowRoot.querySelector(".checklist-floating-launcher");e&&e.removeEventListener("click",this._boundFloatingLauncherClick);var t=this.shadowRoot.querySelector(".checklist-floating-header");t&&t.removeEventListener("click",this._boundFloatingCloseClick)}},{key:"renderResponse",value:function(){this.shadowRoot.innerHTML=""}},{key:"renderFloatingLauncher",value:function(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"checklist-floating",r=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 c=i.length,l=a.length;s=c>0?l/c*100:0}var u,d,p=i.find((function(e){return!a.includes(e.id)})),f=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",h=i.length>0?p&&p.description||"":e.message||"";r&&(f=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",h=(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"===o,y=v?'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>';return'\n <div part="'.concat(o,'" class="').concat(v?"checklist-floating-header":"checklist-floating-launcher"," ").concat(r?"checklist-floating-launcher--done":"",'">\n <div class="floating-header">\n <div class="floating-circular-progress">\n <svg viewBox="0 0 20 20">\n <circle class="track" cx="10" cy="10" r="7"></circle>\n <circle class="progress" cx="10" cy="10" r="7" stroke-dasharray="').concat(g.toFixed(2),'" stroke-dashoffset="').concat(m.toFixed(2),'"></circle>\n </svg>\n </div>\n <div class="floating-title">').concat(f,"</div>\n ").concat(r?"":'<span class="floating-icon">'.concat(y,"</span>"),'\n </div>\n <div class="floating-subtitle">').concat(h,"</div>\n </div>\n ")}},{key:"renderInfoSection",value:function(e){var t;if(!this.infoEnabled||!e)return"";var n=e.subject||this._translate("checklistDefaultTitle","Checklist"),o=e.message||"",r="";return null!==(t=e.sender)&&void 0!==t&&t.profileImageUrl&&(r='\n <div part="sender" class="checklists-sender">\n <img part="sender-image" src="'.concat(e.sender.profileImageUrl,'" alt="').concat(e.sender.firstName||"Sender",'\'s profile picture" style="object-fit: cover;" />\n <span part="sender-name">').concat(e.sender.firstName||"","</span>\n </div>")),'\n <div part="info" class="checklists-info">\n '.concat(n?'<div part="info-title" class="checklists-title">'.concat(n,"</div>"):"","\n ").concat(o?'<div part="info-description" class="checklists-description">'.concat(o,"</div>"):"","\n ").concat(r,"\n </div>")}},{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,o=t.length,r=n>0?o/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:o,b:n},"".concat(o," of ").concat(n," done")),s=i>0?this._translateWithVars("aboutMinutes",{a:i},"About ".concat(i," min left")):"";return'\n <div part="progress-labels" class="checklist-progress-labels">\n <div part="progress-label-primary" class="checklist-progress-label">'.concat(a,"</div>\n ").concat(s?'<div part="progress-label-secondary" class="checklist-progress-label">'.concat(s,"</div>"):"",'\n </div>\n <div part="progress-bar" class="checklist-progress-bar">\n <div part="progress-bar-progress" class="checklist-progress-bar-progress" style="width: ').concat(r,'%;"></div>\n </div>')}},{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,o){var r=n.includes(t.id),i=e.activeStep===o,a=r?'<span part="task-badge" class="checklist-task-header--badge checklist-task-header--badge-done">'.concat(e.getCheckIcon(),"</span>"):'<span part="task-badge" class="checklist-task-header--badge">'.concat(o+1,"</span>"),s=t.title||e._translateWithVars("stepDefaultTitle",{index:o+1},"Step ".concat(o+1)),c=t.description||"",l=t.actionTitle||e._translate("actionDefaultTitle","Action"),u=t.action&&"none"!==t.action?'<div part="task-action" class="checklist-task-body-action" data-action-index="'.concat(o,'">\n <button type="button" class="action-button form-send-button">').concat(l,"</button>\n </div>"):"",d=e._translate("markAsDone","Mark as done"),p=t.allowMarkDone&&!r?'<div part="task-mark-done" class="checklist-task-body-markdone" data-markdone-index="'.concat(o,'">\n ').concat(e.getCheckIcon(),'\n <div class="checklist-task-body-markdone-label">').concat(d,"</div>\n </div>"):"",f=["checklist-task",r?"checklist-task--done":"",i?"checklist-task--active":""].filter(Boolean).join(" ");return'\n <div part="task" class="'.concat(f,'" data-task-index="').concat(o,'">\n <div part="task-header" class="checklist-task-header" role="button" aria-expanded="').concat(i,'" aria-controls="task-body-').concat(o,'">\n ').concat(a,'\n <div part="task-header-title" class="checklist-task-header--title">').concat(s,'</div>\n <span part="task-header-chevron" class="checklist-task-header--chevron">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>\n </span>\n </div>\n <div part="task-body" class="checklist-task-body" id="task-body-').concat(o,'">\n <div part="task-body-inner" class="checklist-task-body-inner">\n ').concat(c?'<div part="task-body-content" class="checklist-task-body-content">'.concat(c,"</div>"):"","\n ").concat(u,"\n ").concat(p,"\n </div>\n </div>\n </div>")})).join(""):"<p>".concat(this._translate("noStepsDefined","No steps defined."),"</p>")}},{key:"renderChecklist",value:function(e){var t;if(this._hasLoaded&&e&&e.outbound){var n=e.outbound,o=(null===(t=n.config)||void 0===t?void 0:t.steps)||[],r=e.completedSteps||[],i="";if("done"===e.status||o.length>0&&r.length>=o.length){var a,s,c=(null===(a=n.config)||void 0===a?void 0:a.successTitle)||"",l=(null===(s=n.config)||void 0===s?void 0:s.successMessage)||"";i=this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-launcher",!0):'\n <div part="content" class="checklists-content checklists-content--done">\n <div part="success-icon" class="checklists-success-icon">\n <span part="success-icon-circle" class="checklists-success-icon--circle">'.concat(this.getCheckIcon(),'</span>\n </div>\n <div part="success-title" class="checklists-title">').concat(c,'</div>\n <div part="success-description" class="checklists-description">').concat(l,"</div>\n </div>"),-1!==this.activeStep&&(this.activeStep=-1)}else i='\n <div part="content" class="checklists-content">\n '.concat(this.floatingEnabled?"":this.renderInfoSection(n),"\n ").concat(this.floatingEnabled?"":this.renderProgressSection(o,r),"\n ").concat(this.floatingEnabled?this.renderFloatingLauncher(n):"",'\n <div part="tasks" class="checklist-tasks">\n ').concat(this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-header"):"","\n ").concat(this.renderTasks(o,r),"\n </div>\n </div>");var u=zn.getInstance().getFlowConfig(),d=u.color?u.color:"#485BFF",p="\n <style>\n :host {\n display: block;\n --color-bg: #ffffff;\n --color-font-title: #1f2937;\n --color-font-text: #4b5563;\n --color-font-light: #6b7280;\n --color-primary: ".concat(d,";\n --color-primary-light: ").concat(d,'22;\n --color-primary-contrast: #ffffff;\n --color-border: #e5e7eb;\n --color-gray-light: #f3f4f6;\n --color-gray-lighter: #f9fafb;\n --color-gray-dark: #6b7280;\n --color-success: #10b981;\n --color-success-light: #ffffff;\n --radius-sm: 4px;\n --radius-lg: 12px;\n --radius-full: 9999px;\n --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08);\n --shadow-lg: rgba(0, 0, 0, 0.2) 0px 7px 29px 0px;\n --animation-duration: 0.2s;\n --animation-timing: ease-in-out;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n box-sizing: border-box;\n }\n :host([dark]) {\n --color-bg: #1f2937;\n --color-font-title: #f9fafb;\n --color-font-text: #d1d5db;\n --color-font-light: #9ca3af;\n --color-primary: ').concat(d,";\n --color-primary-light: ").concat(d,'22;\n --color-primary-contrast: #ffffff;\n --color-border: #374151;\n --color-gray-light: #374151;\n --color-gray-lighter: #111827;\n --color-gray-dark: #9ca3af;\n --color-success: #34d399;\n --color-success-light: #1f2937;\n }\n *, *:before, *:after { box-sizing: inherit; }\n .checklists-content { color: var(--color-font-text); }\n .checklists-content--done { text-align: center; }\n .checklists-info { margin-bottom: 24px; text-align: center; }\n .checklists-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; color: var(--color-font-title); }\n .checklists-description { font-size: 0.9rem; margin-bottom: 16px; color: var(--color-font-text); line-height: 1.5; }\n .checklists-sender { display: flex; align-items: center; justify-content: center; gap: 8px; }\n .checklists-sender img { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; }\n .checklists-sender span { font-size: 0.875rem; color: var(--color-font-light); font-weight: 500; }\n .checklists-success-icon { margin-bottom: 16px; line-height: 0; }\n .checklists-success-icon--circle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-full); background-color: var(--color-success); color: var(--color-success-light); font-size: 22px; }\n .checklist-progress-labels { display: flex; justify-content: space-between; margin-bottom: 8px; }\n .checklist-progress-label { font-size: 0.75rem; color: var(--color-font-light); font-weight: 500; }\n .checklist-progress-bar { width: 100%; height: 6px; background-color: var(--color-gray-light); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 20px; }\n .checklist-progress-bar-progress { height: 100%; background-color: var(--color-primary); transition: width var(--animation-duration) var(--animation-timing); border-radius: var(--radius-full); }\n .checklist-tasks { display: flex; flex-direction: column; gap: 12px; }\n .checklist-task { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background-color: var(--color-bg); box-shadow: var(--shadow-sm); overflow: hidden; transition: background-color var(--animation-duration) var(--animation-timing), border-color var(--animation-duration) var(--animation-timing); }\n .checklist-task-header { display: flex; align-items: center; padding: 15px 20px; cursor: pointer; gap: 12px; position: relative; }\n .checklist-task-header:hover { background: var(--color-gray-lighter); }\n .checklist-task-header:hover .checklist-task-header--chevron {\n color: var(--color-font-title);\n }\n .checklist-task-header--badge { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-full); background-color: var(--color-primary-light); color: var(--color-primary); font-size: 0.875rem; font-weight: 600; flex-shrink: 0; transition: background-color var(--animation-duration) var(--animation-timing), color var(--animation-duration) var(--animation-timing); line-height: 1; }\n .checklist-task-header--badge svg { width: 16px; height: 16px; }\n .checklist-task-header--title { flex-grow: 1; font-size: 0.9rem; font-weight: 500; color: var(--color-font-title); transition: font-weight var(--animation-duration) var(--animation-timing), color var(--animation-duration) var(--animation-timing), text-decoration var(--animation-duration) var(--animation-timing); }\n .checklist-task-header--chevron { color: var(--color-font-light); transition: transform var(--animation-duration) var(--animation-timing); flex-shrink: 0; margin-left: auto; }\n .checklist-task-header--chevron svg { display: block; width: 18px; height: 18px; }\n .checklist-task-body {\n overflow: hidden;\n transition: max-height var(--animation-duration) var(--animation-timing), opacity var(--animation-duration) var(--animation-timing);\n max-height: 0;\n opacity: 0;\n }\n .checklist-task--active .checklist-task-body {\n max-height: var(--task-body-active-height, 200px);\n opacity: 1;\n }\n .checklist-task-body-inner { padding: 4px 16px 20px 60px; font-size: 0.875rem; color: var(--color-font-text); line-height: 1.5; }\n .checklist-task-body-content { margin-bottom: 16px; }\n .checklist-task-body-content p:first-child { margin-top: 0; }\n .checklist-task-body-content p:last-child { margin-bottom: 0; }\n .checklist-task-body-content iframe { width: 100%; height: 315px; object-fit: contain; border: none; }\n .checklist-task-body-action { margin-top: 16px; }\n .action-button { display: inline-flex; align-items: center; justify-content: center; background-color: var(--color-primary); color: var(--color-primary-contrast); padding: 10px 18px; font-size: 0.875rem; font-weight: 500; border-radius: var(--radius-lg); border: none; text-align: center; cursor: pointer; transition: background-color var(--animation-duration) var(--animation-timing), box-shadow var(--animation-duration) var(--animation-timing); box-shadow: var(--shadow-sm); }\n .action-button:hover { background-color: color-mix(in srgb, var(--color-primary) 90%, black); box-shadow: var(--shadow-md); }\n .action-button:focus { outline: 2px solid color-mix(in srgb, var(--color-primary) 50%, transparent); outline-offset: 2px; }\n .checklist-task-body-markdone { margin-top: 20px; border-top: 1px solid var(--color-border); padding: 16px 0 0px 0; display: flex; align-items: center; cursor: pointer; color: var(--color-primary); transition: color var(--animation-duration) var(--animation-timing); }\n .checklist-task-body-markdone:hover { color: color-mix(in srgb, var(--color-primary) 80%, black); }\n .checklist-task-body-markdone svg { width: 18px; height: 18px; margin-right: 6px; flex-shrink: 0; font-size: 18px; }\n .checklist-task-body-markdone-label { font-size: 0.875rem; font-weight: 500; line-height: 1; }\n .checklist-task--active .checklist-task-header--title { font-weight: 600; }\n .checklist-task--active .checklist-task-header--chevron { transform: rotate(180deg); }\n .checklist-task--active .checklist-task-header:hover { background: linear-gradient(180deg, var(--color-gray-lighter), transparent); }\n .checklist-task--done { background-color: var(--color-gray-lighter); border-color: var(--color-gray-light); box-shadow: none; }\n .checklist-task--done .checklist-task-header--badge { background-color: var(--color-success); color: var(--color-success-light); }\n .checklist-task--done .checklist-task-header--title { color: var(--color-font-light); }\n .checklist-task--done .checklist-task-body-inner { color: var(--color-font-light); }\n .checklist-task--done .checklist-task-header--title {\n text-decoration: line-through;\n }\n \n /* -------------------------\n Floating style addition\n Only applies if floating="true"\n ------------------------- */\n :host([floating="true"]) .checklists-content {\n position: relative;\n }\n :host([floating="true"]) .checklist-tasks {\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 1000;\n max-height: 90vh;\n display: none;\n padding: 0px;\n min-width: min(380px, 90vw);\n background-color: var(--color-bg);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-lg);\n overflow: hidden;\n }\n :host([floating="true"]) .checklist-task {\n border-radius: 0px;\n border: none;\n box-shadow: none;\n border-bottom: 1px solid var(--color-border);\n }\n :host([floating="true"]) .checklist-task:last-child {\n border-bottom: none;\n }\n :host([floating="true"]) .checklist-task--done {\n background-color: transparent;\n }\n :host([floating="true"]) .checklist-task-header:hover {\n background: linear-gradient(180deg, var(--color-gray-lighter), transparent);\n }\n \n /* -------------------------\n Floating Launcher Styles\n ------------------------- */\n .checklist-floating-launcher {\n padding: 12px;\n background-color: var(--color-bg);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-md);\n transition: transform 0.3s ease;\n cursor: pointer;\n }\n .checklist-floating-launcher--done {\n cursor: default !important;\n }\n .checklist-floating-header {\n padding: 20px;\n padding-bottom: 16px;\n border-bottom: 1px solid var(--color-border);\n cursor: pointer;\n }\n .checklist-floating-header:hover .floating-icon,\n .checklist-floating-launcher:hover .floating-icon {\n color: var(--color-font-title);\n }\n .floating-header {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n }\n .floating-title {\n font-size: 0.875rem;\n font-weight: 600;\n color: var(--color-font-title);\n max-width: calc(100% - 32px);\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n .floating-subtitle {\n font-size: 0.875rem;\n color: var(--color-font-text);\n margin-top: 8px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n .floating-circular-progress {\n width: 26px;\n height: 26px;\n margin-right: 6px;\n }\n .floating-circular-progress svg {\n width: 100%;\n height: 100%;\n transform: rotate(-90deg);\n }\n .floating-circular-progress .track {\n fill: none;\n stroke: var(--color-gray-light);\n stroke-width: 3;\n }\n .floating-circular-progress .progress {\n fill: none;\n stroke: var(--color-primary);\n stroke-width: 3;\n stroke-linecap: round;\n transition: stroke-dashoffset var(--animation-duration) var(--animation-timing);\n }\n .checklist-floating-launcher--done .floating-circular-progress .progress {\n stroke: var(--color-success);\n }\n .floating-icon {\n margin-left: auto;\n color: var(--color-font-light);\n }\n </style>\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"),o=parseInt(t.getAttribute("data-task-index"),10);n&&n.addEventListener("click",(function(){var t=e.activeStep===o?-1:o;e.setActiveStep(t)}));var r=t.querySelector(".checklist-task-body-markdone");r&&r.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 r=e.checklistData.outbound.config.steps[o];if(r){var i=e.activeStep;if(e.checklistData.completedSteps||(e.checklistData.completedSteps=[]),!e.checklistData.completedSteps.includes(r.id)){e.checklistData.completedSteps.push(r.id);var a=e.checklistData.outbound.config.steps,s=-1;if(i===o){for(var c=o+1;c<a.length;c++)if(!e.checklistData.completedSteps.includes(a[c].id)){s=c;break}e.setActiveStep(s)}setTimeout((function(){var t=!1;if(e.floatingEnabled){var n=e.shadowRoot.querySelector(".checklist-tasks");t=n&&"block"===n.style.display}if(e.renderChecklist(e.checklistData),e.floatingEnabled&&t){var o=e.shadowRoot.querySelector(".checklist-tasks");o&&(o.style.display="block")}}),300);var l={checkedStep:r.id};a.length>0&&e.checklistData.completedSteps.length>=a.length&&(e.checklistData.status="done",l.status="done"),e.updateChecklist(e.checklistData.id,l)}}}}));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!==cp){var r=e.checklistData.outbound.config.steps[o];if(r&&r.action&&"none"!==r.action)try{"BOT"===r.action?cp.startBot(r.botId):"CUSTOM_ACTION"===r.action?cp.triggerCustomAction(r.actionBody):"REDIRECT_URL"===r.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),cp.openURL(r.actionBody,!!r.actionOpenInNewTab)):"FEEDBACK_FLOW"===r.action?cp.startFeedbackFlow(r.formId):"NEWS_ARTICLE"===r.action?cp.openNewsArticle(r.articleId):"HELP_ARTICLE"===r.action?cp.openHelpCenterArticle(r.articleId):"CHECKLIST"===r.action?cp.startChecklist(r.outboundId,!0,null==r?void 0:r.sharedKey):"PRODUCT_TOUR"===r.action&&cp.startProductTour(r.productTourId,!0)}catch(i){}}}))}))}},{key:"setActiveStep",value:function(e){var t=this,n=this.activeStep;this.activeStep=e;var o=[];-1!==n&&n!==this.activeStep&&o.push({index:n,open:!1}),-1!==this.activeStep&&this.activeStep!==n&&o.push({index:this.activeStep,open:!0}),o.forEach((function(e){var n=e.index,o=e.open;t.toggleTask(n,o)}))}},{key:"toggleTask",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=this.shadowRoot.querySelector('.checklist-task[data-task-index="'.concat(e,'"]'));if(o){var r=o.querySelector(".checklist-task-header");if(r){var i=o.classList.contains("checklist-task--active"),a=null!==n?n:!i;if(a){i||(o.classList.add("checklist-task--active"),r.setAttribute("aria-expanded","true"));var s=o.querySelector(".checklist-task-body-inner");if(s){var c=s.offsetHeight,l=o.querySelector(".checklist-task-body");l&&l.style.setProperty("--task-body-active-height","".concat(c,"px"))}o.querySelectorAll("iframe").forEach((function(n){n._heightListenerAdded||(n._heightListenerAdded=!0,n.addEventListener("load",(function(){t.activeStep===e&&t.updateActiveTaskMaxHeight()})))}))}else!a&&i&&(o.classList.remove("checklist-task--active"),r.setAttribute("aria-expanded","false"))}}}}],r=[{key:"observedAttributes",get:function(){return["checklistId","info","progressbar","dark","floating","sharedKey"]}}],o&&xn(n.prototype,o),r&&xn(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(In(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,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return Pt(Et(e=Tt(this,t,[].concat(o))),"_iframe",null),Pt(Et(e),"_agentConvUrl",_t),Pt(Et(e),"_messageListener",null),Pt(Et(e),"_config",{}),e}var n,o,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mt(e,t)}(t,e),n=t,r=[{key:"observedAttributes",get:function(){return["agentId","conversationId","dark","placeholder","agentColor","emptyText","context"]}}],(o=[{key:"connectedCallback",value:function(){this._injectIframe(),this._listenForMessages()}},{key:"disconnectedCallback",value:function(){this._messageListener&&window.removeEventListener("message",this._messageListener),this._messageListener=null}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&this._iframe&&this._sendConfig()}},{key:"_injectIframe",value:function(){if(!this._iframe){this._agentConvUrl=_t,this.style.display="block",this.style.width="100%",this.style.height="100%";var e=document.createElement("iframe");e.style.cssText="width: 100%; height: 100%; border: 0; background: transparent;",e.setAttribute("frameborder","0"),e.setAttribute("allow","autoplay; encrypted-media; microphone *;"),e.title="Gleap Agent Conversation",this.appendChild(e),this._iframe=e,Y(e,this._agentConvUrl)}}},{key:"_listenForMessages",value:function(){var e=this;this._messageListener||(this._messageListener=function(t){var n,o=!1,r=!1;try{o=!(!e._iframe||t.source!==e._iframe.contentWindow);var i=new URL(e._agentConvUrl);r=t.origin===i.origin}catch(s){return}if(o||r){var a;try{a=JSON.parse(t.data)}catch(s){return}"AGENT_CONVERSATION"===(null===(n=a)||void 0===n?void 0:n.type)&&("agent-conv-loaded"===a.name&&e._sendConfig(),"agent-conv-conversation-created"===a.name&&e.dispatchEvent(new CustomEvent("gleap-agent-conversation-created",{bubbles:!0,composed:!0,detail:a.data})),"agent-conv-message-sent"===a.name&&e.dispatchEvent(new CustomEvent("gleap-agent-message-sent",{bubbles:!0,composed:!0,detail:a.data})),"agent-conv-reply-received"===a.name&&e.dispatchEvent(new CustomEvent("gleap-agent-reply-received",{bubbles:!0,composed:!0,detail:a.data})),"agent-conv-error"===a.name&&e.dispatchEvent(new CustomEvent("gleap-agent-error",{bubbles:!0,composed:!0,detail:a.data})))}},window.addEventListener("message",this._messageListener))}},{key:"_sendConfig",value:function(){var e,t=this;if(null!==(e=this._iframe)&&void 0!==e&&e.contentWindow){var n=xt[St].apiUrl,o="",r="",i="";try{var a,s,c=ba.getInstance();n=c.apiUrl||n,o=c.sdkKey||"",r=(null===(a=c.session)||void 0===a?void 0:a.gleapId)||"",i=(null===(s=c.session)||void 0===s?void 0:s.gleapHash)||""}catch(u){}var l={agentId:this.getAttribute("agentId")||"",conversationId:this.getAttribute("conversationId")||null,dark:"true"===this.getAttribute("dark")||""===this.getAttribute("dark"),placeholder:this.getAttribute("placeholder")||"Type a message...",agentColor:this.getAttribute("agentColor")||null,emptyText:this.getAttribute("emptyText")||"How can I help you today?",context:function(){try{var e=t.getAttribute("context");return e?JSON.parse(e):null}catch(n){return null}}(),apiUrl:n,sdkKey:o,gleapId:r,gleapHash:i};this._config=l,this._iframe.contentWindow.postMessage(JSON.stringify({type:"agent-conversation",name:"agent-conv-data",data:l}),"*")}}},{key:"sendMessage",value:function(e){var t;null!==(t=this._iframe)&&void 0!==t&&t.contentWindow&&null!=e&&e.trim()&&this._iframe.contentWindow.postMessage(JSON.stringify({type:"agent-conversation",name:"agent-conv-send-message",data:{content:e}}),"*")}},{key:"clearConversation",value:function(){var e;null!==(e=this._iframe)&&void 0!==e&&e.contentWindow&&this._iframe.contentWindow.postMessage(JSON.stringify({type:"agent-conversation",name:"agent-conv-clear",data:{}}),"*")}}])&&It(n.prototype,o),r&&It(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(Lt(HTMLElement));customElements.define("gleap-agent-conversation",e)}}());var op=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),tp(this,"initialized",!1),tp(this,"offlineMode",!1),tp(this,"disablePageTracking",!1),tp(this,"disableInAppNotifications",!1),tp(this,"disableQueryParams",!1),tp(this,"globalData",{screenRecordingData:null,webReplay:null,snapshotPosition:{x:0,y:0}}),"undefined"!=typeof window&&(us.getInstance(),Yn.getInstance().start(),jn.getInstance().start(),lt.getInstance().start())}var t,n,o;return t=e,n=[{key:"isLiveMode",value:function(){if(!0===this.offlineMode)return!1;var e=window.location.hostname;return!(["localhost","127.0.0.1","0.0.0.0","","::1"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")||!e.includes("."))}},{key:"softReInitialize",value:function(){Wa.getInstance().destroy(),zn.getInstance().start().then((function(){D.getInstance().refresh(),Ls.getInstance().injectNotificationUI()})).catch((function(e){console.warn("Failed to initialize Gleap.")}))}},{key:"performActions",value:function(t){for(var n=0;n<t.length;n++){var o=t[n];if(o&&o.actionType){var r,i,a;if(("notification"!==o.actionType||"widget"===(null==o||null===(r=o.data)||void 0===r||null===(r=r.checklist)||void 0===r?void 0:r.popupType))&&((null===(i=o.pageRules)||void 0===i?void 0:i.length)>0||o.pageFilter)&&window&&window.location&&!ia(window.location.href,o))continue;"notification"===o.actionType?"widget"===(null==o||null===(a=o.data)||void 0===a||null===(a=a.checklist)||void 0===a?void 0:a.popupType)?e.openChecklist(o.data.checklist.id,!0):this.disableInAppNotifications||e.showNotification(o):"banner"===o.actionType?e.showBanner(o):"modal"===o.actionType?e.showModal(o):"tour"===o.actionType?e.startProductTourWithConfig(o.outbound,o.data,!1):e.showSurvey(o.actionType,o.format)}}}},{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=Id.getInstance().getReplayData(),t=e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0;this.setGlobalDataItem("webReplay",t?e:null)}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"setEnvironment",value:function(e){us.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){us.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){us.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){z=U(e)}(e)}},{key:"setTags",value:function(e){Gd.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){Wa.getInstance().setUrlHandler(e)}},{key:"setOfflineMode",value:function(e){this.getInstance().offlineMode=e}},{key:"setDisableInAppNotifications",value:function(e){this.getInstance().disableInAppNotifications=e}},{key:"setDisablePageTracking",value:function(e){this.getInstance().disablePageTracking=e}},{key:"disableConsoleLogOverwrite",value:function(){Yn.getInstance().stop()}},{key:"setAiTools",value:function(e){Jt.getInstance().setAgentTools(e),an.getInstance().sendAgentToolsUpdate(),Wa.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){Ss.getInstance().externalRequests=te(e)}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";Yn.getInstance().addLog(e,t)}},{key:"initialize",value:function(t){var n=this.getInstance();if(n.initialized)console.warn("Gleap already initialized.");else{n.initialized=!0;try{Id.getInstance().startIfNotRunning()}catch(r){}try{!function(){try{var e=function(){try{var e=document.querySelector(".gleap-frame-container-inner iframe");if(!e)return;o(e);var t=window.visualViewport,n=c(window.innerHeight)-c(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(r){}},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")),i()}catch(n){}}),100)}catch(r){}},n=function(){d=!1,i()},o=function(e){try{var o=e.contentDocument;if(!o||o===p)return;p=o,o.addEventListener("focusout",t,!0),o.addEventListener("focusin",n,!0)}catch(r){}},i=function(){try{u||(u=!0,window.requestAnimationFrame((function(){u=!1,e()}))),l&&clearTimeout(l),l=setTimeout(e,s)}catch(r){}};if(!("visualViewport"in window)||!window.visualViewport||!/iPad|iPhone|iPod/.test(navigator.userAgent))return;if(ue)return;ue=!0;var a=150,s=350,c=function(e){return Math.round(e)},l=null,u=!1,d=!1,p=null,f=window.visualViewport;f.addEventListener("resize",i),f.addEventListener("scroll",i),window.addEventListener("orientationchange",(function(){try{i()}catch(r){}})),e()}catch(r){}}()}catch(r){}var o=ba.getInstance();o.sdkKey=t,o.setOnSessionReady((function(){setTimeout((function(){zn.getInstance().start().then((function(){Nd.getInstance().start(),le((function(){D.getInstance().injectFeedbackButton(),Ls.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams(),Ht.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];Wa.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 o=t.get("gleap_conversation");o&&o.length>0&&("true"===o?e.startConversation(!0):e.startBot(o,!0));var r=t.get("gleap_feedback");r&&r.length>0&&e.startFeedbackFlow(r);var i=t.get("gleap_survey"),a=t.get("gleap_survey_format");i&&i.length>0&&e.showSurvey(i,"survey_full"===a?"survey_full":"survey");var s=t.get("gleap_tour");if(s&&s.length>0){var c=parseInt(t.get("gleap_tour_delay"));isNaN(c)&&(c=2),setTimeout((function(){e.startProductTour(s)}),1e3*c)}}catch(l){}}},{key:"destroy",value:function(){Id.getInstance().stop(),Nd.getInstance().stop(),Wa.getInstance().destroy(),D.getInstance().destroy(),Ls.getInstance().clearAllNotifications(!0),Hd.getInstance().stop(),an.getInstance().destroy(),ba.getInstance().clearSession(0,!1),yn.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){yn.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){vs.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=an.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=an.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{an.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){an.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){an.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){ba.getInstance().useCookies=e}},{key:"disableLocalStorage",value:function(){ba.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return ba.getInstance().identifySession(e,oe(te(t)),n)}},{key:"updateContact",value:function(e){return ba.getInstance().updateSession(oe(te(e)))}},{key:"clearIdentity",value:function(){ba.getInstance().clearSession()}},{key:"getIdentity",value:function(){return ba.getInstance().getSession()}},{key:"isUserIdentified",value:function(){var e=ba.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return Wa.getInstance().isOpened()}},{key:"hide",value:function(){Wa.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){Ss.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){Ss.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){Ss.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){Ss.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){Id.getInstance().setOptions(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Wa.getInstance().hideWidget(e)}},{key:"open",value:function(){Wa.getInstance().setAppMode("widget"),Wa.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Nd.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Nd.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=te(e);Rs.getInstance().formPreFill=t,Wa.getInstance().sendMessage({name:"prefill-form-data",data:t},!0)}},{key:"on",value:function(e,t){Ht.on(e,t)}},{key:"enableShortcuts",value:function(e){e?Md.getInstance().start():Md.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){D.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){us.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){us.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){ba.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return ba.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){ba.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){ba.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){ba.getInstance().apiUrl=e}},{key:"setBannerUrl",value:function(e){yn.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){vs.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){Nt(e)}},{key:"setFrameUrl",value:function(e){Wa.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){co.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){co.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){co.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){co.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){co.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){co.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){co.getInstance().clearCustomData()}},{key:"playSound",value:function(e){dn.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=Ls.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){Yd.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){e.getInstance().softReInitialize(),e.updateContact({lang:t})}),1e3)}},{key:"registerAgentToolAction",value:function(e){Jt.getInstance().registerAgentToolAction(e)}},{key:"registerAgentTool",value:function(e,t){Jt.getInstance().registerAgentTool(e,t)}},{key:"registerCustomAction",value:function(e){oo.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){oo.triggerCustomAction(e)}},{key:"setStyles",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#ffffff",r=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]:D.FEEDBACK_BUTTON_BOTTOM_LEFT,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:void 0,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0;le((function(){!function(e,t,n,o,r,i,a,s,c,l){var u=he(e),d=he(n),p=he(r),f="#ffffff"===p,h=c||t,g=l||t,m=fe(r,f?100:-120),v=fe(r,f?30:-12),y=fe(r,f?80:-30),b=(o=parseInt(o,10),Math.round(1.05*o)),w=Math.round(.8*o),k=Math.round(.4*o),x=Math.round(.25*o),S=Math.max(2,Math.round(.55*o)),C=Math.max(2,Math.round(20*S/32)),I=57+a;s===D.FEEDBACK_BUTTON_CLASSIC_BOTTOM?I=a+15:(s&&s.includes("CLASSIC")||s===D.FEEDBACK_BUTTON_NONE)&&(I=a);var T='\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*w,"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: relative;\n display: inline-block;\n float: left;\n max-width: 0px;\n width: 17px;\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 {\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(k,"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(r,";\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(r,";\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(r,";\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(h,";\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(h,";\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(r,";\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 — 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(h,' 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 — 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 — 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(r,"38 calc(100% - 101px),\n ").concat(r,"73 calc(100% - 82px),\n ").concat(r,"A6 calc(100% - 65px),\n ").concat(r,"D6 calc(100% - 49px),\n ").concat(r," calc(100% - 35px)\n );\n }\n\n .gleap-frame-loader-ramp--image {\n /* Smootherstep whitening ramp — 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→app 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(r,"03 calc(100% - 83px),\n ").concat(r,"0F calc(100% - 76px),\n ").concat(r,"29 calc(100% - 69px),\n ").concat(r,"52 calc(100% - 62px),\n ").concat(r,"80 calc(100% - 55px),\n ").concat(r,"AD calc(100% - 48px),\n ").concat(r,"D6 calc(100% - 41px),\n ").concat(r,"F0 calc(100% - 34px),\n ").concat(r,"FC calc(100% - 27px),\n ").concat(r," 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 .gleap-frame-container--survey {\n bottom: ").concat(a,"px !important;\n }\n\n .gleap-frame-container--extended {\n max-width: 690px !important;\n }\n\n .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: 100vw !important;\n max-width: 100vw !important;\n height: 100vh;\n height: 100dvh !important;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(6px);\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n max-height: 100vh;\n max-height: 100dvh !important;\n border-radius: 0 !important;\n animation-name: none !important;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner {\n max-width: 640px !important;\n width: calc(100% - 24px);\n border-radius: ").concat(w,"px;\n overflow: hidden;\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 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(I,"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(r,";\n border-radius: ").concat(w,"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(f?"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 — 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(r,";\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(x,"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 — 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(S,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(C,"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 - 40px);\n }\n \n .gleap-frame-container-inner:before {\n content: " ";\n position: absolute;\n width: 100%;\n height: calc(100% - ').concat(w,"px);\n top: ").concat(w,"px;\n background-color: ").concat(r,";\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 .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--disabled {\n display: none !important;\n }\n\n .bb-feedback-button--hidden {\n display: none !important;\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-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(x,"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(x,"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(b,"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(k,"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(b,"px;\n }\n .bb-capture-button-next {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(x,"px;\n }\n .bb-capture-preview-inner {\n background-color: ").concat(r,";\n border-radius: ").concat(k,"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(k,"px;\n }\n .bb-capture-toolbar {\n background-color: ").concat(r,";\n border-radius: ").concat(k,"px;\n }\n .bb-capture-toolbar-item-colorpicker {\n background-color: ").concat(r,";\n }\n .bb-capture-toolbar-item--active {\n background-color: ").concat(v,";\n }\n .bb-feedback-button-classic {\n border-top-left-radius: ").concat(k,"px;\n border-top-right-radius: ").concat(k,"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) .gleap-frame-container-inner {\n max-height: calc(var(--glvh, 1vh) * 100) !important;\n }\n\n .gleap-frame-container--survey {\n height: auto !important;\n top: initial !important;\n bottom: 0px !important;\n min-height: initial !important;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: 100vh !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: #2d2d2d;\n margin: 0;\n padding: 15px;\n border-radius: ").concat(k,'px;\n min-width: 250px;\n max-width: 300px;\n box-shadow: 0 1px 10px #0006;\n z-index: 1000000000;\n position: fixed;\n top: 0;\n right: 0;\n background-color: #fff;\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: #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: #2d2d2d;\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: #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(x,"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 }\n \n .gleap-tour-popover-navigation-btns button + button {\n margin-left: 4px;\n }\n \n .gleap-tour-popover-arrow {\n content: "";\n position: absolute;\n border: 5px solid #fff;\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(r,";\n border-radius: ").concat(w,"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(r,";\n border-radius: ").concat(w,"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 .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 "),E=document.querySelector(".gleap-styles");E&&E.remove();var L=document.createElement("style");G(L),L.innerHTML=T,L.className="gleap-styles",document.body.appendChild(L)}(e,t,n,r,o,i,a,s,c,l)}))}},{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",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};return e.sendSilentCrashReportWithFormData({description:t},n,o)}},{key:"sendSilentCrashReportWithFormData",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",o=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 r=o?te(o):{},i=ba.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new ja("CRASH",n,a,!0,r).sendFeedback().then((function(){})).catch((function(e){}))}}}},{key:"showSurvey",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"survey";e.startFeedbackFlowWithOptions(t,{hideBackButton:!0,format:n},!0)}},{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]:{},o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n.autostartDrawing,i=n.hideBackButton,a=n.format;if(ba.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var s="start-feedbackflow";o&&(s="start-survey"),Wa.getInstance().setAppMode(o?a:"widget"),Wa.getInstance().sendMessage({name:s,data:{flow:t,hideBackButton:i,format:a}},!0),r?Wa.getInstance().showDrawingScreen("screenshot"):Wa.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),Wa.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),Wa.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];Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),Wa.getInstance().showWidget()}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),Wa.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 o={messages:[{role:"user",content:t.trim()}]};return n.conversationId&&(o.conversationId=n.conversationId),n.additionalContext&&(o.additionalContext=n.additionalContext),new Promise((function(t,r){var i="",a=n.conversationId||null,s=null;S.getInstance().streamAgent(e,o,{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){r(e)},onToolStart:function(){},onToolEnd:function(){}})}))}},{key:"clearAgentConversation",value:function(){S.getInstance().clearCache()}},{key:"createAgentChat",value:function(e){return new kt(e)}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),Wa.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),Wa.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),Wa.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),Wa.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),Wa.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),Wa.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&&(Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"start-checklist",data:ep({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),Wa.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),Wa.getInstance().showWidget())}},{key:"getChecklistData",value:function(e,t){if(!e)return Promise.reject(new Error("outboundId is required"));var n=A.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];Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),Wa.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Wa.getInstance().setAppMode("widget"),Wa.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),Wa.getInstance().showWidget()}},{key:"startProductTour",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;ba.getInstance().startProductTourConfig(e).then((function(o){var r;!t||null==o||!o.startURL||null!==(r=window)&&void 0!==r&&null!==(r=r.location)&&void 0!==r&&null!==(r=r.href)&&void 0!==r&&r.includes(null==o?void 0:o.baseURL)?n.startProductTourWithConfig(e,o,!0):window.location.href="".concat(o.startURL,"?gleap_tour=").concat(e,"&gleap_tour_delay=1")})).catch((function(e){}))}},{key:"checkForUncompletedTour",value:function(){var e=dc.getInstance().loadUncompletedTour();e&&dc.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];dc.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{yn.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{vs.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){Ls.getInstance().showNotification(e)}}],n&&Zd(t.prototype,n),o&&Zd(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(tp(op,"invoked",!0),tp(op,"silentCrashReportSent",!1),tp(op,"instance",void 0),"undefined"!=typeof window){var rp=window.GleapActions;if(rp&&rp.length>0)for(var ip=0;ip<rp.length;ip++){var ap=rp[ip];ap&&ap.e&&op[ap.e]&&op[ap.e].apply(op,ap.a)}}var sp=function(e){try{var t=e.split("/"),n=t[2];if("article"===n){var o=t[3];op.openHelpCenterArticle(o,!0)}if("collection"===n){var r=t[3];op.openHelpCenterCollection(r,!0)}if("flow"===n){var i=t[3];op.startFeedbackFlow(i,!0)}if("survey"===n){var a=t[3];op.showSurvey(a)}if("bot"===n){var s=t[3];op.startBot(s,!0)}if("news"===n){var c=t[3];op.openNewsArticle(c,!0)}if("checklist"===n){var l=t[3];op.startChecklist(l,!0,t[4])}if("tour"===n){var u=t[3];op.startProductTour(u)}}catch(d){console.error("Failed to handle Gleap link: ",e)}};const cp=op,lp=cp;return t=t.default})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Gleap=t():e.Gleap=t()}(this,(()=>(()=>{"use strict";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={};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:{},c=s.iterator||"@@iterator",l=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 P(r||[]);return a(i,"_invoke",{value:L(e,n,s)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};d(x,c,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(R([])));C&&C!==o&&i.call(C,c)&&(x=C);var I=k.prototype=b.prototype=Object.create(x);function E(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,a,s,c){var l=f(e[o],e,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==n(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return r("throw",e,s,c)}))}c(l.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 L(t,n,r){var o=h;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 c=O(s,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?v:g,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function O(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,O(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=f(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 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 M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(t){if(t||""===t){var r=t[c];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<t.length;)if(i.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return w.prototype=k,a(I,"constructor",{value:k,configurable:!0}),a(k,"constructor",{value:w,configurable:!0}),w.displayName=d(k,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,d(e,u,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},E(T.prototype),d(T.prototype,l,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new T(p(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(I),d(I,u,"Generator"),d(I,c,(function(){return this})),d(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=R,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(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;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(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,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}e.d(t,{default:()=>ih});var s=function(e,t,n){var r,o,i,a,s,c,l;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===(c=n.onError)||void 0===c||c.call(n,t);break;case"handoff":null===(l=n.onHandoff)||void 0===l||l.call(n,t)}},c=function(){var e,t=(e=r().mark((function e(t,n){var i,a,c,l,u,d,p,f,h,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(),c=new TextDecoder,l="",u="",d="",e.prev=8;case 9:return e.next=12,a.read();case 12:if(f=e.sent,h=f.done,g=f.value,!h){e.next=17;break}return e.abrupt("break",24);case 17:l+=c.decode(g,{stream:!0}),m=l.split("\n"),l=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(I){}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,c,"next",e)}function c(e){a(i,r,o,s,c,"throw",e)}s(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function l(e){return l="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},l(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<t;n++)r[n]=e[n];return r}function p(){p=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",c=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new P(r||[]);return o(a,"_invoke",{value:L(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var h="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};u(x,a,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(R([])));C&&C!==n&&r.call(C,a)&&(x=C);var I=k.prototype=b.prototype=Object.create(x);function E(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(o,i,a,s){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==l(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.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 L(t,n,r){var o=h;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 c=O(s,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=f(t,n,r);if("normal"===l.type){if(o=r.done?v:g,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=v,r.method="throw",r.arg=l.arg)}}}function O(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,O(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=f(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 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 M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(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<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(l(t)+" is not iterable")}return w.prototype=k,o(I,"constructor",{value:k,configurable:!0}),o(k,"constructor",{value:w,configurable:!0}),w.displayName=u(k,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,u(e,c,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},E(T.prototype),u(T.prototype,s,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new T(d(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(I),u(I,c,"Generator"),u(I,a,(function(){return this})),u(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=R,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(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;M(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function f(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 h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y(r.key),r)}}function v(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:String(t)}var b="success",w="error",k=function(){function e(){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),v(this,"executeInFlight",new Map),v(this,"messagesCache",new Map),v(this,"messagesRequests",new Map),e.instance)return e.instance;e.instance=this}var t,n,r,o,i;return t=e,n=[{key:"clearCache",value:function(){this.messagesCache.clear(),this.messagesRequests.clear(),this.executeInFlight.clear()}},{key:"_getApiUrl",value:function(){var e=vs.getInstance();return(null==e?void 0:e.apiUrl)||null}},{key:"_getHeaders",value:function(){var e,t,n=vs.getInstance(),r={"Content-Type":"application/json"};return null!=n&&n.sdkKey&&(r["Api-Token"]=n.sdkKey),null!=n&&null!==(e=n.session)&&void 0!==e&&e.gleapId&&(r["Gleap-Id"]=n.session.gleapId),null!=n&&null!==(t=n.session)&&void 0!==t&&t.gleapHash&&(r["Gleap-Hash"]=n.session.gleapHash),r}},{key:"_makeRequest",value:function(e,t,n){return new Promise((function(r,o){var i=new XMLHttpRequest;i.open(e,t);var a=vs.getInstance();null==a||a.injectSession(i),n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){if(4===i.readyState)if(i.status>=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,l,u,d,f;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"),l=h(h({},this._getHeaders()),{},{Accept:"text/event-stream"}),e.prev=10,e.next=13,fetch(s,{method:"POST",headers:l,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===(f=r.onError)||void 0===f||f.call(r,{message:"Server error: ".concat(u.status)}),e.abrupt("return");case 27:return e.next=29,c(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 c="".concat(s,"/v3/shared/agents/").concat(e,"/conversations/").concat(t,"/messages?limit=").concat(r,"&skip=").concat(o),l=this._makeRequest("GET",c,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,l),l.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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function I(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=function(e,t){if("object"!=S(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==S(t)?t:String(t)}var T="success",L="error",O=function(){function e(){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),I(this,"validationRequests",new Map),I(this,"validationCache",new Map),I(this,"fetchRequests",new Map),I(this,"fetchCache",new Map),e.instance)return e.instance;e.instance=this}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}],(n=[{key:"clearCache",value:function(){this.validationCache.clear(),this.fetchCache.clear(),this.validationRequests.clear(),this.fetchRequests.clear()}},{key:"_getQueryParams",value:function(){var e=vs.getInstance(),t=null==e?void 0:e.session,n=Vf.getInstance().getActiveLanguage()||"en";return"gleapId=".concat((null==t?void 0:t.gleapId)||"","&gleapHash=").concat((null==t?void 0:t.gleapHash)||"","&lang=").concat(n)}},{key:"_getApiUrl",value:function(){var e=vs.getInstance();return(null==e?void 0:e.apiUrl)||null}},{key:"_makeRequest",value:function(e,t,n){return new Promise((function(r,o){var i=new XMLHttpRequest;i.open(e,t);var a=vs.getInstance();null==a||a.injectSession(i),n&&i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.onreadystatechange=function(){if(4===i.readyState)if(i.status>=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===T?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:L,error:a}),Promise.reject(a)}var s="".concat(i,"/outbound/checklists?").concat(this._getQueryParams()),c=this._makeRequest("POST",s,{outboundId:e,sharedKey:t}).then((function(e){if(e&&e.id)return n.validationCache.set(r,{status:T,internalId:e.id}),e.id;var t=new Error("Validation response missing checklist ID.");throw n.validationCache.set(r,{status:L,error:e||t}),t})).catch((function(e){throw n.validationCache.set(r,{status:L,error:e}),e})).finally((function(){n.validationRequests.delete(r)}));return this.validationRequests.set(r,c),c}},{key:"fetchChecklist",value:function(e){var t=this,n=this.fetchCache.get(e);if(n)return n.status===T?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:L,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:T,data:n}),JSON.parse(JSON.stringify(n));var r=new Error("Empty response received for checklist fetch.");throw t.fetchCache.set(e,{status:L,error:n||r}),r})).catch((function(n){throw t.fetchCache.set(e,{status:L,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}();I(O,"instance",null);const A=O;function M(e){return M="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},M(e)}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N(r.key),r)}}function R(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){var t=function(e,t){if("object"!=M(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=M(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==M(t)?t:String(t)}var j=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),R(this,"feedbackButton",null),R(this,"injectedFeedbackButton",!1),R(this,"buttonHidden",null),R(this,"lastButtonIcon",null),R(this,"showingRedDot",!1),R(this,"removePressListeners",null)}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"destroy",value:function(){this.removePressListeners&&(this.removePressListeners(),this.removePressListeners=null),this.feedbackButton&&(this.feedbackButton.remove(),this.feedbackButton=null),this.buttonHidden=null,this.lastButtonIcon=null,this.injectedFeedbackButton=!1,this.instance=null}},{key:"toggleFeedbackButton",value:function(t){this.buttonHidden=!t,e.getInstance().updateFeedbackButtonState(),bl.getInstance().updateContainerStyle()}},{key:"updateRedDot",value:function(e){var t=zs.getInstance();if(this.feedbackButton&&!this.buttonHidden&&!t.isOpened()){var n="bb-feedback-button--red-dot",r=this.feedbackButton.querySelector(".".concat(n));if(e){if(!r){var o=document.createElement("div");o.className=n,this.feedbackButton.appendChild(o)}}else r&&r.remove()}}},{key:"feedbackButtonPressed",value:function(){var e=zs.getInstance();e.isOpened()?(e.hideWidget(),this.updateRedDot(this.showingRedDot)):(e.setAppMode("widget"),e.showWidget(),this.updateRedDot(!1))}},{key:"injectFeedbackButton",value:function(){var e=this;if(!this.injectedFeedbackButton){this.injectedFeedbackButton=!0;var t=document.createElement("div");t.addEventListener("click",(function(){e.feedbackButtonPressed()})),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&&!zs.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=br.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(Pn.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=br.getInstance().getFlowConfig(),r="";r=n.buttonLogo?'<img class="bb-logo-logo" src="'.concat(n.buttonLogo,'" alt="Feedback Button" />'):fe("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",Vf.getInstance().isRTLLayout?"rtl":"ltr"),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='<div class="bb-feedback-button-classic '.concat(n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT?"bb-feedback-button-classic--left":"").concat(n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM?"bb-feedback-button-classic--bottom":"",'">').concat(n.widgetButtonText,"</div>")):r!==this.lastButtonIcon&&(this.feedbackButton.innerHTML='<div class="bb-feedback-button-icon">'.concat(r).concat(fe("arrowdown","#fff"),'</div><div class="bb-notification-bubble bb-notification-bubble--hidden"></div>')),this.lastButtonIcon=r;var i=!1;null===e.getInstance().buttonHidden?n.feedbackButtonPosition===e.FEEDBACK_BUTTON_NONE&&(i=!0):e.getInstance().buttonHidden&&(i=!0),i&&this.feedbackButton.classList.add("bb-feedback-button--disabled"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_BOTTOM_LEFT&&this.feedbackButton.classList.add("bb-feedback-button--bottomleft"),zs.getInstance().isOpened()&&this.feedbackButton.classList.add("bb-feedback-button--open");var a=zs.getInstance().appMode;"survey"!==a&&"survey_full"!==a&&"survey_web"!==a||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||vs.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}])&&P(t.prototype,n),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function _(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 D(e,t,n){return t=function(e){var t=function(e,t){if("object"!=F(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==F(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 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)}R(j,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),R(j,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),R(j,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),R(j,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),R(j,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),R(j,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),R(j,"instance",void 0);var B=/^[A-Za-z0-9+/=_-]{1,256}$/,U=function(e){if("string"!=typeof e)return null;var t=e.trim();return B.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}(),z=null,q=function(){return z||H},W=function(e){var t=q();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,X="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=q(),c=function(e,t){return t?e.replace(/<(script|style)\b(?![^>]*\snonce\s*=)/gi,'<$1 nonce="'+t+'"'):e}(i,s),l=s?' nonce="'+s+'"':"",u="/",d="/";try{var p=new URL(t);u=(d=p.pathname)+p.search+p.hash}catch(a){}var f,h,g="<script"+l+'>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(X)+"));}}catch(e){}<\/script>";f=/<script\b/i.test(c)?c.replace(/<script\b/i,g+"<script"):/<\/head>/i.test(c)?c.replace(/<\/head>/i,g+"</head>"):c;try{h=e.contentDocument}catch(a){return o()}if(!h)return o();try{e.addEventListener(X,o,{once:!0})}catch(a){}try{h.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 — see "+G)),t&&!n&&J(o)&&"string"==typeof r&&0===r.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(h,{baseHref:n,onBlocked:o}),h.write(f),h.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")+") — 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) — see "+G)),o()}))}},$=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 c=a.width,l=a.height;c>l?c>o&&(l*=o/c,c=o):l>s&&(c*=s/l,l=s),e.width=c,e.height=l,e.getContext("2d").drawImage(a,0,0,c,l),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"!==F(e)||!("company"in e))return e;var t=e.company,n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);if(delete n.company,!t||"object"!==F(t))return n;var r=te(t.id);if(!r)return n;n.companyId=r;var o=te(t.name);return o&&(n.companyName=o),n}catch(i){return e}},re=[{amount:60,unit:"minute"},{amount:24,unit:"hour"},{amount:7,unit:"day"},{amount:4.34524,unit:"week"},{amount:12,unit:"month"},{amount:Number.POSITIVE_INFINITY,unit:"year"}],oe=function(e){try{var t=e.split("."),n=!1,r=t[t.length-2];return"co"!==r&&"com"!==r&&"gv"!==r&&"ac"!==r&&"edu"!==r&&"gov"!==r&&"mil"!==r&&"net"!==r&&"org"!==r||(n=!0),(t=t.slice(n?-3:-2)).join(".")}catch(o){}return e},ie=function(e){try{var t=localStorage.getItem("gleap-widget-".concat(e));if(t)return JSON.parse(t)}catch(n){}return null},ae=function(e,t){var n="gleap-widget-".concat(e);if(t)try{localStorage.setItem(n,JSON.stringify(t))}catch(r){}else localStorage.removeItem(n)},se=function(e){"complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",(function(){e()}))},ce=!1;function le(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=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ue(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 ue(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 ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var de=function(e,t){3===(e=e.replace(/^#/,"")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var n=le(e.match(/.{2}/g),3),r=n[0],o=n[1],i=n[2],a=[parseInt(r,16)+t,parseInt(o,16)+t,parseInt(i,16)+t];r=a[0],o=a[1],i=a[2],r=Math.max(Math.min(255,r),0).toString(16),o=Math.max(Math.min(255,o),0).toString(16),i=Math.max(Math.min(255,i),0).toString(16);var s=(r.length<2?"0":"")+r,c=(o.length<2?"0":"")+o,l=(i.length<2?"0":"")+i;return"#".concat(s).concat(c).concat(l)},pe=function(e){return(299*parseInt(e.substr(1,2),16)+587*parseInt(e.substr(3,2),16)+114*parseInt(e.substr(5,2),16))/1e3>=160?"#000000":"#ffffff"},fe=function(e,t){return"button"===e?'<svg class="bb-logo-logo bb-logo-logo--default" width="145" height="144" viewBox="0 0 145 144" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M38.9534 15H105.047C113.857 15 121 22.1426 121 30.9534L121 89.5238L121 96.015L121 125.541C121 128.759 117.393 130.66 114.739 128.84L90.1188 111.968H38.9534C30.1426 111.968 23 104.826 23 96.015V30.9534C23 22.1426 30.1426 15 38.9534 15Z" fill="white"/>\n </svg>':"drag"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512">\x3c!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--\x3e<path d="M64 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm0 160a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM96 416a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96-288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm32 128a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM192 448a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"/></svg>':"unmute"===e?'<svg id="tooltip-svg-unmute" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path id="tooltip-svg-unmute-path" d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.1 386.2C556.7 352 576 306.3 576 256c0-60.1-27.7-113.8-70.9-149c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C507.3 170.7 528 210.9 528 256c0 39.1-15.6 74.5-40.9 100.5L449 326.6c19-17.5 31-42.7 31-70.6c0-30.1-13.9-56.9-35.4-74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C425.1 227.6 432 241 432 256s-6.9 28.4-17.7 37.3c-1.3 1-2.4 2.2-3.4 3.4L352 250.6V64c0-12.6-7.4-24-18.9-29.2s-25-3.1-34.4 5.3L197.8 129.8 38.8 5.1zM352 373.3L82.9 161.3C53.8 167.4 32 193.1 32 224v64c0 35.3 28.7 64 64 64h67.8L298.7 471.9c9.4 8.4 22.9 10.4 34.4 5.3S352 460.6 352 448V373.3z"/></svg>':"mute"===e?'<svg id="tooltip-svg-mute" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path id="tooltip-svg-mute-path" d="M533.6 32.5C598.5 85.3 640 165.8 640 256s-41.5 170.8-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"/></svg>':"replay"===e?'<svg id="tooltip-svg-replay" width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path id="tooltip-svg-replay-path" d="M48.5 224H40C26.7 224 16 213.3 16 200V72C16 62.3 21.8 53.5 30.8 49.8C39.8 46.1 50.1 48.1 57 55L98.6 96.6C186.2 10.1 327.3 10.4 414.4 97.6C501.9 185.1 501.9 326.9 414.4 414.4C326.9 501.9 185.1 501.9 97.6 414.4C85.1 401.9 85.1 381.6 97.6 369.1C110.1 356.6 130.4 356.6 142.9 369.1C205.4 431.6 306.7 431.6 369.2 369.1C431.7 306.6 431.7 205.3 369.2 142.8C307 80.6 206.5 80.3 143.9 141.8L185 183C191.9 189.9 193.9 200.2 190.2 209.2C186.5 218.2 177.7 224 168 224H48.5Z" />\n </svg>':"dismiss"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M294.6 166.6L317.3 144 272 98.7l-22.6 22.6L160 210.7 70.6 121.4 48 98.7 2.7 144l22.6 22.6L114.7 256 25.4 345.4 2.7 368 48 413.3l22.6-22.6L160 301.3l89.4 89.4L272 413.3 317.3 368l-22.6-22.6L205.3 256l89.4-89.4z"/></svg>':"blur"===e?'<svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">\n <path class="bb-svg-path" d="m602.25 1200c238.2 0 435.95-193.26 435.95-435.95 0-269.66-220.23-615.73-435.95-764.05-220.23 161.8-440.45 485.39-440.45 764.05 0 242.7 197.75 435.95 440.45 435.95zm-260.68-382.02c0 112.36 89.887 206.74 206.74 206.74v62.922c-148.32 0-274.16-121.35-274.16-269.66z" fill="#333"/>\n</svg>':"pen"===e?'<svg width="1072px" height="1034px" viewBox="0 0 1072 1034" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-907.000000, -217.000000)" fill-rule="nonzero">\n <g transform="translate(907.268457, 217.009827)">\n <g transform="translate(132.335119, 0.000000)" fill="#000" class="bb-svg-path">\n <path d="M20.3764235,730.530173 L10.1884235,720.342173 C-0.791576454,709.362173 -3.16357645,692.432173 4.37592355,678.858173 L83.1809235,537.018173 C71.7589235,502.979173 82.3098335,463.998173 112.254924,440.706173 L655.334924,18.3161733 C689.951924,-8.6058267 739.197924,-5.5388267 770.214924,25.4684733 L913.774924,169.028473 C944.782924,200.040473 947.848924,249.286473 920.927224,283.908473 L498.537224,826.988473 C496.322424,829.836173 493.935624,832.543173 491.384924,835.090073 C467.271924,859.207073 432.513924,866.195073 402.232924,856.063073 L260.382924,934.868073 C246.804924,942.407173 229.874924,940.036073 218.894924,929.055573 L208.706924,918.867573 L20.3764235,730.530173 Z M866.006424,241.190173 C871.393124,234.264373 870.779824,224.417173 864.576724,218.213173 L721.016724,74.6531733 C714.813624,68.4500733 704.965724,67.8367733 698.043724,73.2234733 L154.963724,495.613473 C147.381724,501.507973 146.018424,512.433473 151.912924,520.015473 C152.358234,520.585783 152.834804,521.128773 153.346524,521.636573 L417.586524,785.886573 C424.379524,792.675673 435.391524,792.675673 442.180524,785.886573 C442.692244,785.374853 443.168804,784.831873 443.610224,784.265473 L866.006424,241.190173 Z M342.796424,809.480173 L129.746424,596.430173 L77.9264235,689.707173 L249.516424,861.297173 L342.796424,809.480173 Z"></path>\n </g>\n <g transform="translate(-0.000000, 755.530173)" fill="#EB144C">\n <path d="M124.711543,0 L313.042043,188.3374 L233.288043,268.0914 C222.003043,279.3764 204.483043,281.5324 190.800043,273.3219 L16.8900429,168.9719 C-2.51595711,157.3309 -5.80895711,130.5499 10.1908429,114.5499 L124.711543,0 Z" class="bb-pen-tip"></path>\n </g>\n </g>\n </g>\n </g>\n</svg>':"rect"===e?'<svg width="339px" height="241px" viewBox="0 0 339 241" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-0.000865, 0.000000)" fill-rule="nonzero">\n <g transform="translate(0.000865, 0.000000)" fill="#000000" class="bb-svg-path">\n <path d="M339,0 L339,241 L0,241 L0,0 L339,0 Z M312.826351,26.168387 L26.1855674,26.168387 L26.1855674,214.41156 L312.826351,214.41156 L312.826351,26.168387 Z"></path>\n </g>\n <g transform="translate(0.000000, 83.206095)" fill="#EB144C" class="bb-pen-tip">\n <path d="M0,0 L26.186,26.186 L26.1864325,131.205465 L131.204,131.205 L157.792,157.793 L0.000865118243,157.793905 L0,0 Z"></path>\n </g>\n </g>\n </g>\n</svg>':"pointer"===e?'<svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">\n <path d="m1050.7 508.95-225.94 157.5 160.31 160.31c4.4531 4.4531 6.9141 10.43 6.9141 16.758s-2.4609 12.305-6.9141 16.758l-126.09 126.09c-4.4531 4.4531-10.43 6.9141-16.758 6.9141-6.3281 0-12.188-2.4609-16.758-6.9141l-160.2-160.43-157.62 225.94c-3.3984 4.9219-9.0234 7.8516-14.883 7.8516-0.70313 0-1.5234 0-2.2266-0.11719-6.7969-0.82031-12.422-5.2734-14.766-11.719l-333.16-880.55c-2.5781-6.6797-0.9375-14.297 4.2188-19.336 5.0391-5.0391 12.656-6.6797 19.336-4.2188l880.66 333.05c6.3281 2.3438 10.781 8.0859 11.602 14.766 0.82031 6.7969-2.1094 13.359-7.7344 17.344z" fill="#333"/>\n </svg>':"clip"===e?'<svg width="600px" height="1126px" viewBox="0 0 600 1126" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-0.002000, 0.501000)" fill="#333333" fill-rule="nonzero">\n <path d="M225.002,1124.999 C165.33,1124.999 108.102,1101.292 65.902,1059.097 C23.707,1016.902 5.68434189e-14,959.671 5.68434189e-14,899.997 L5.68434189e-14,299.997 C5.68434189e-14,220.431 31.605,144.127 87.867,87.867 C144.129,31.605 220.437,-4.26325641e-14 299.997,-4.26325641e-14 C379.557,-4.26325641e-14 455.867,31.605 512.127,87.867 C568.389,144.129 599.994,220.437 599.994,299.997 L599.994,1012.497 C599.994,1025.895 592.8456,1038.274 581.244,1044.974 C569.642,1051.6732 555.346,1051.6732 543.744,1044.974 C532.142,1038.2748 524.994,1025.896 524.994,1012.497 L524.994,299.997 C524.994,240.325 501.287,183.097 459.092,140.897 C416.897,98.702 359.666,74.995 299.992,74.995 C240.318,74.995 183.092,98.702 140.892,140.897 C98.697,183.092 74.99,240.323 74.99,299.997 L74.99,899.997 C74.99,953.587 103.58,1003.107 149.99,1029.897 C196.4,1056.694 253.58,1056.694 299.99,1029.897 C346.4,1003.104 374.99,953.585 374.99,899.997 L374.99,337.497 C374.99,310.704 360.697,285.942 337.49,272.544 C314.283,259.149 285.697,259.149 262.49,272.544 C239.283,285.942 224.99,310.704 224.99,337.497 L224.99,824.997 C224.99,838.395 217.8416,850.774 206.24,857.474 C194.638,864.1732 180.342,864.1732 168.74,857.474 C157.138,850.7748 149.99,838.396 149.99,824.997 L149.99,337.497 C149.99,283.907 178.58,234.387 224.99,207.597 C271.4,180.8 328.58,180.8 374.99,207.597 C421.4,234.39 449.99,283.909 449.99,337.497 L449.99,899.997 C449.99,959.669 426.283,1016.897 384.088,1059.097 C341.893,1101.292 284.662,1124.999 224.988,1124.999 L225.002,1124.999 Z" id="Path"></path>\n </g>\n </g>\n</svg>':"mic"===e?'<svg\n width="1200pt"\n height="1200pt"\n version="1.1"\n viewBox="0 0 1200 1200"\n xmlns="http://www.w3.org/2000/svg"\n >\n <g class="bb-svg-path">\n <path\n d="m600 862.5c144.75 0 262.5-117.75 262.5-262.5v-300c0-144.75-117.75-262.5-262.5-262.5s-262.5 117.75-262.5 262.5v300c0 144.75 117.75 262.5 262.5 262.5z"\n />\n <path\n d="m1012.5 600c0-20.707-16.793-37.5-37.5-37.5s-37.5 16.793-37.5 37.5c0 186.11-151.41 337.5-337.5 337.5s-337.5-151.39-337.5-337.5c0-20.707-16.793-37.5-37.5-37.5s-37.5 16.793-37.5 37.5c0 214.8 165.08 391.57 375 410.6v114.4c0 20.727 16.793 37.5 37.5 37.5s37.5-16.773 37.5-37.5v-114.4c209.92-19.031 375-195.8 375-410.6z"\n />\n </g>\n </svg>':"camera"===e?'<svg width="1155px" height="1004px" viewBox="0 0 1155 1004" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="#333333" fill-rule="nonzero">\n <g transform="translate(128.324095, 0.000000)">\n <path d="M42.7803063,0.00413459787 C31.4357421,0.00413459787 20.5549853,4.41399115 12.5336107,12.2572687 C4.51223664,20.1005462 0.00420584816,30.741831 0.00420584816,41.8370305 L0.00420584816,251.00151 C-0.156199045,262.200455 4.27736739,272.989996 12.315738,280.963903 C20.3585574,288.938257 31.3288589,293.431222 42.7803063,293.431222 C54.2317532,293.431222 65.2018267,288.938592 73.2448746,280.963903 C81.2832452,272.989549 85.7172445,262.200455 85.5564062,251.00151 L85.5564062,83.6699265 L256.660808,83.6699265 C268.112255,83.8267939 279.145066,79.4909873 287.298762,71.6298611 C295.452913,63.7643845 300.04718,53.0359758 300.04718,41.8370305 C300.04718,30.6380854 295.453255,19.9098998 287.298762,12.0441998 C279.144611,4.18307356 268.112255,-0.153157091 256.660808,0.00413459787 L42.7803063,0.00413459787 Z"></path>\n <path d="M983.227131,710.59444 C971.895913,710.764382 961.099907,715.326799 953.20401,723.279287 C945.312674,731.227538 940.964345,741.91668 941.119476,752.99849 L941.119476,920.330075 L770.015075,920.330075 C758.563631,920.173205 747.530815,924.509015 739.377123,932.370139 C731.222968,940.235615 726.628705,950.964028 726.628705,962.16297 C726.628705,973.361918 731.222627,984.090105 739.377123,991.955802 C747.531272,999.816926 758.563631,1004.15316 770.015075,1003.99587 L983.895579,1003.99587 C995.24014,1003.99587 1006.1209,999.586011 1014.14227,991.742733 C1022.16365,983.899455 1026.67168,973.258169 1026.67168,962.16297 L1026.67168,752.99849 C1026.83208,741.690223 1022.30053,730.801401 1014.11489,722.812989 C1005.93394,714.825472 994.790363,710.415949 983.227131,710.59444 L983.227131,710.59444 Z"></path>\n <path d="M983.227131,375.93127 C971.895913,376.101212 961.099907,380.66363 953.20401,388.61612 C945.312674,396.56437 940.964345,407.253512 941.119476,418.335325 L941.119476,585.66691 C940.959072,596.865853 945.39264,607.655394 953.431008,615.629303 C961.47383,623.603658 972.444131,628.096618 983.895579,628.096618 C995.347023,628.096618 1006.3171,623.603989 1014.36015,615.629303 C1022.39852,607.654947 1026.83251,596.865853 1026.67168,585.66691 L1026.67168,418.335325 C1026.83208,407.027056 1022.30053,396.138232 1014.11489,388.149822 C1005.93394,380.162305 994.790363,375.752783 983.227131,375.93127 L983.227131,375.93127 Z"></path>\n <path d="M769.974012,0.00413459787 C758.522563,-0.152733184 747.489752,4.18307356 739.336055,12.0441998 C731.181906,19.9096767 726.587637,30.6380854 726.587637,41.8370305 C726.587637,53.0359758 731.181564,63.7641611 739.336055,71.6298611 C747.490209,79.4909873 758.522563,83.8272181 769.974012,83.6699265 L941.078414,83.6699265 L941.078414,251.00151 C940.918009,262.200455 945.351572,272.989996 953.389945,280.963903 C961.432763,288.938257 972.403063,293.431222 983.854512,293.431222 C995.30596,293.431222 1006.27603,288.938592 1014.31908,280.963903 C1022.35745,272.989549 1026.79145,262.200455 1026.63061,251.00151 L1026.63061,41.8370305 C1026.63061,30.7426118 1022.12133,20.1017733 1014.10121,12.2572687 C1006.08109,4.41276405 995.199876,0.00413459787 983.854512,0.00413459787 L769.974012,0.00413459787 Z"></path>\n <path d="M427.765208,0.00413459787 C416.31376,-0.152733184 405.280949,4.18307356 397.127256,12.0441998 C388.973102,19.9096767 384.378838,30.6380854 384.378838,41.8370305 C384.378838,53.0359758 388.972761,63.7641611 397.127256,71.6298611 C405.281406,79.4909873 416.31376,83.8272181 427.765208,83.6699265 L598.86961,83.6699265 C610.321058,83.8267939 621.35387,79.4909873 629.507562,71.6298611 C637.661716,63.7643845 642.255985,53.0359758 642.255985,41.8370305 C642.255985,30.6380854 637.662058,19.9098998 629.507562,12.0441998 C621.353413,4.18307356 610.321058,-0.153157091 598.86961,0.00413459787 L427.765208,0.00413459787 Z"></path>\n </g>\n <g transform="translate(0.000000, 427.000000)">\n <path d="M768.516184,22.1826583 C752.659627,13.73125 732.573775,13.73125 717.773442,24.29375 L562.379192,124.6375 L562.379192,31.6875 C562.379192,13.7330104 548.635081,0 530.666079,0 L31.7131123,0 C13.7441105,0 0,13.7330104 0,31.6875 L0,475.3125 C0,493.26699 13.7441105,507 31.7131123,507 L530.666079,507 C548.635081,507 562.379192,493.26699 562.379192,475.3125 L562.379192,382.3625 L717.773442,482.70625 C726.231681,487.9875 735.742444,491.157658 745.257258,491.157658 C753.715498,491.157658 761.113815,489.046567 769.572406,484.820862 C786.485185,475.313732 796,458.414612 796,439.400352 L796,68.6566021 C794.943601,48.5869719 785.428963,31.6878521 768.516184,22.1807219 L768.516184,22.1826583 Z"></path>\n </g>\n </g>\n </g>\n</svg>':"recorderon"===e?'<svg width="1251px" height="1251px" viewBox="0 0 1251 1251" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g>\n <circle fill="#E31810" cx="625.5" cy="625.5" r="625.5"></circle>\n <circle fill="#F71008" cx="625" cy="625" r="507"></circle>\n <g transform="translate(175.000000, 449.000000)" fill="#FFFFFF" fill-rule="nonzero">\n <path d="M0,347.097493 L0,4.90250696 L135.528311,4.90250696 C161.471024,4.90250696 183.639743,9.49741034 202.034469,18.6872171 C220.429194,27.8770239 234.46286,40.8541449 244.135466,57.6185803 C253.808072,74.3830156 258.644376,94.0714804 258.644376,116.683975 C258.644376,139.40786 253.724206,158.929238 243.883867,175.248107 C234.043527,191.566976 219.814173,204.070682 201.195803,212.759227 C182.577434,221.447772 160.073248,225.792044 133.683247,225.792044 L42.9396629,225.792044 L42.9396629,167.64563 L121.941933,167.64563 C135.807866,167.64563 147.325536,165.751973 156.494943,161.964659 C165.66435,158.177344 172.51345,152.496373 177.042243,144.921744 C181.571035,137.347116 183.835432,127.934526 183.835432,116.683975 C183.835432,105.322032 181.571035,95.7423543 177.042243,87.9449425 C172.51345,80.1475308 165.636395,74.2159282 156.411077,70.1501349 C147.185759,66.0843416 135.584222,64.051445 121.606467,64.051445 L72.6284142,64.051445 L72.6284142,347.097493 L0,347.097493 Z M185.512762,191.37204 L270.888889,347.097493 L190.712487,347.097493 L107.181424,191.37204 L185.512762,191.37204 Z"></path>\n <polygon points="309.166667 347.097493 309.166667 4.90250696 540.126846 4.90250696 540.126846 64.5527072 381.634607 64.5527072 381.634607 146.091356 528.244113 146.091356 528.244113 205.741556 381.634607 205.741556 381.634607 287.447293 540.796296 287.447293 540.796296 347.097493"></polygon>\n <path d="M901,124.638783 L827.757943,124.638783 C826.420189,115.158428 823.68894,106.709759 819.564197,99.2927757 C815.439454,91.8757921 810.144176,85.5462611 803.678363,80.3041825 C797.212549,75.0621039 789.77129,71.0468948 781.354585,68.2585551 C772.93788,65.4702155 763.824427,64.0760456 754.014228,64.0760456 C736.288981,64.0760456 720.849065,68.4537389 707.69448,77.2091255 C694.539894,85.964512 684.339516,98.6793409 677.093346,115.353612 C669.847176,132.027883 666.224091,152.243346 666.224091,176 C666.224091,200.425856 669.875046,220.948035 677.176956,237.56654 C684.478866,254.185044 694.707113,266.732573 707.861699,275.209125 C721.016285,283.685678 736.233242,287.923954 753.51257,287.923954 C763.21129,287.923954 772.213263,286.641318 780.518488,284.076046 C788.823714,281.510773 796.209233,277.746515 802.675047,272.78327 C809.14086,267.820025 814.519748,261.769328 818.81171,254.631179 C823.103672,247.493029 826.08575,239.351077 827.757943,230.205323 L901,230.539924 C899.104848,246.26616 894.394837,261.406844 886.869968,275.961977 C879.3451,290.51711 869.256201,303.510773 856.603274,314.942966 C843.950346,326.375158 828.900608,335.409379 811.45406,342.045627 C794.007513,348.681876 774.303504,352 752.342035,352 C721.796641,352 694.512024,345.084918 670.488184,331.254753 C646.464343,317.424588 627.512821,297.404309 613.633619,271.193916 C599.754416,244.983523 592.814815,213.252218 592.814815,176 C592.814815,138.636248 599.838026,106.849176 613.884448,80.6387833 C627.93087,54.4283904 646.993871,34.4359949 671.073451,20.661597 C695.153031,6.88719899 722.242559,0 752.342035,0 C772.185393,0 790.607387,2.78833967 807.608016,8.36501901 C824.608646,13.9416984 839.686254,22.0557668 852.840839,32.7072243 C865.995425,43.3586819 876.72533,56.3802281 885.030556,71.7718631 C893.335782,87.1634981 898.65893,104.785805 901,124.638783 Z"></path>\n </g>\n </g>\n </g>\n</svg>':"recorderoff"===e?'<svg width="1251px" height="1251px" viewBox="0 0 1251 1251" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g class="bb-rec-on-circle" fill="#EEEEEE" fill-rule="nonzero">\n <path d="M625.5,0 C970.954111,0 1251,280.045889 1251,625.5 C1251,970.954111 970.954111,1251 625.5,1251 C280.045889,1251 0,970.954111 0,625.5 C0,280.045889 280.045889,0 625.5,0 Z M626,124 C348.753056,124 124,348.753056 124,626 C124,903.246944 348.753056,1128 626,1128 C903.246944,1128 1128,903.246944 1128,626 C1128,348.753056 903.246944,124 626,124 Z"></path>\n </g>\n <g class="bb-rec-on-cont" fill="#E31810" transform="translate(86.000000, 86.000000)" fill-rule="nonzero">\n <path d="M540,0 C241.2,0 0,241.2 0,540 C0,838.8 241.2,1080 540,1080 C838.8,1080 1080,838.8 1080,540 C1080,241.2 838.8,0 540,0 Z M777.6,741.6 C777.6,761.998 761.998,777.6 741.6,777.6 L338.4,777.6 C318.002,777.6 302.4,761.998 302.4,741.6 L302.4,338.4 C302.4,318.002 318.002,302.4 338.4,302.4 L741.6,302.4 C761.998,302.4 777.6,318.002 777.6,338.4 L777.6,741.6 Z"></path>\n </g>\n </g>\n </svg>':"arrowdown"===e?'<svg class="bb-logo-arrowdown" fill="'.concat(t,'" width="100pt" height="100pt" version="1.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <path d="m50 77.637c-1.3477 0-2.6953-0.51562-3.7266-1.543l-44.73-44.73c-2.0586-2.0586-2.0586-5.3945 0-7.4531 2.0586-2.0586 5.3945-2.0586 7.4531 0l41.004 41 41.004-41c2.0586-2.0586 5.3945-2.0586 7.4531 0 2.0586 2.0586 2.0586 5.3945 0 7.4531l-44.73 44.727c-1.0312 1.0312-2.3789 1.5469-3.7266 1.5469z"/>\n </svg>'):"arrowleft"===e?'<svg fill="'.concat(t,'" width="100pt" height="100pt" version="1.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <path d="m70.988 1.6211c2.1875-2.168 5.7344-2.168 7.9297 0 2.1836 2.168 2.1836 5.7227 0 7.8906l-46.016 40.445 46.016 40.5c2.1836 2.168 2.1836 5.668 0 7.8906-2.1953 2.168-5.7383 2.168-7.9297 0l-50.039-44.109c-1.168-1.168-1.668-2.7227-1.5898-4.2773-0.078125-1.5 0.42188-3.0547 1.5898-4.2227l50.039-44.109z" fill-rule="evenodd"/>\n </svg>'):"close"===e?'<svg fill="'.concat(t,'" width="100pt" height="100pt" version="1.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">\n <path d="m72.812 33.02l-5.832-5.832-16.98 16.875-16.98-16.875-5.832 5.832 16.875 16.98-16.875 16.98 5.832 5.832 16.98-16.875 16.98 16.875 5.832-5.832-16.875-16.98z"/>\n </svg>'):"undo"===e?'<svg width="62px" height="60px" viewBox="0 0 62 60" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g class="bb-svg-path" transform="translate(-0.000500, 0.001926)" fill-rule="nonzero">\n <path d="M28.0005,51.6270739 C24.9653,51.0684839 22.0825,49.8731739 19.5396,48.1192739 L13.8208,53.8380739 C17.9536,57.0060739 22.8403,59.0333739 28.0008,59.7286739 L28.0005,51.6270739 Z" id="Path"></path>\n <path d="M2.2705,33.9980739 C2.96581,39.1582739 4.9932,44.0450739 8.1611,48.1780739 L13.8799,42.4592739 C12.126,39.9162739 10.9307,37.0334739 10.3721,33.9983739 L2.2705,33.9980739 Z" id="Path"></path>\n <path d="M61.7305,33.9980739 L53.6289,33.9980739 C53.07031,37.0332739 51.875,39.9160739 50.1211,42.4589739 L55.8399,48.1777739 C59.0079,44.0449739 61.0352,39.1582739 61.7305,33.9977739 L61.7305,33.9980739 Z" id="Path"></path>\n <path d="M4.0005,24.9980739 L24.0005,24.9980739 L24.0005,16.9980739 L14.27,16.9980739 C17.6762,12.3613739 22.7622,9.24417393 28.442,8.31057393 C34.1178,7.38088393 39.934,8.70901393 44.645,12.0175739 C49.352,15.3222739 52.5786,20.3417739 53.6294,25.9975739 L61.731,25.9975739 C60.6646,18.0834739 56.4888,10.9235739 50.129,6.09957393 C43.7657,1.27147393 35.746,-0.818426068 27.836,0.290973932 C19.9298,1.39647393 12.793,5.61127393 8,11.9979739 L8,0.997973932 L-3.55271368e-15,0.997973932 L-3.55271368e-15,20.9979739 C-3.55271368e-15,22.0604739 0.42188,23.0760739 1.1719,23.8260739 C1.92192,24.5760739 2.9375,24.9979739 4,24.9979739 L4.0005,24.9980739 Z" id="Path"></path>\n <path d="M36.0005,51.6270739 L36.0005,59.7286739 C41.1607,59.0333639 46.0475,57.0059739 50.1805,53.8380739 L44.4617,48.1192739 C41.9187,49.8731739 39.0359,51.0684739 36.0008,51.6270739 L36.0005,51.6270739 Z" id="Path"></path>\n </g>\n </g>\n </svg>':"circle-dot"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm256-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"/></svg>'):"circle-question"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>'):"circle-info"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216 192V224h24 48 24v24 88h8 24v48H296 216 192V336h24zm72-144H224V128h64v64z"/></svg>'):"circle-exclamation"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm24-384v24V264v24H232V264 152 128h48zM232 368V320h48v48H232z"/></svg>'):"circle-up"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM384 256H304V384H208V256H128V224L256 96 384 224v32z"/></svg>'):"circle-right"===e?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="'.concat(t,'" d="M0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM256 384l0-80-128 0 0-96 128 0 0-80 32 0L416 256 288 384l-32 0z"/></svg>'):""};function he(e){return he="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},he(e)}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ye(r.key),r)}}function ve(e,t,n){return t&&me(e.prototype,t),n&&me(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ye(e){var t=function(e,t){if("object"!=he(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==he(t)?t:String(t)}var be=function(){function e(t){ge(this,e),this.overlay=document.createElement("div"),this.overlay.className=t.className||"_ext-element-overlay",this.overlay.style.background=t.style&&t.style.background||"rgba(250, 240, 202, 0.2)",this.overlay.style.borderColor=t.style&&t.style.borderColor||"#F95738",this.overlay.style.borderStyle=t.style&&t.style.borderStyle||"solid",this.overlay.style.borderRadius=t.style&&t.style.borderRadius||"1px",this.overlay.style.borderWidth=t.style&&t.style.borderWidth||"1px",this.overlay.style.boxSizing=t.style&&t.style.boxSizing||"border-box",this.overlay.style.cursor=t.style&&t.style.cursor||"crosshair",this.overlay.style.position=t.style&&t.style.position||"absolute",this.overlay.style.zIndex=t.style&&t.style.zIndex||"2147483647",this.overlay.style.margin=t.style&&t.style.margin||"0px",this.overlay.style.padding=t.style&&t.style.padding||"0px",this.shadowContainer=document.createElement("div"),this.shadowContainer.className="_ext-element-overlay-container",this.shadowContainer.style.position="absolute",this.shadowContainer.style.top="0px",this.shadowContainer.style.left="0px",this.shadowContainer.style.margin="0px",this.shadowContainer.style.padding="0px",this.shadowRoot=this.shadowContainer.attachShadow({mode:"open"})}return ve(e,[{key:"addToDOM",value:function(e,t){this.usingShadowDOM=t,t?(e.insertBefore(this.shadowContainer,e.firstChild),this.shadowRoot.appendChild(this.overlay)):e.appendChild(this.overlay)}},{key:"removeFromDOM",value:function(){this.setBounds({x:0,y:0,width:0,height:0}),this.overlay.remove?this.overlay.remove():this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.usingShadowDOM&&(this.shadowContainer.remove?this.shadowContainer.remove():this.shadowContainer.parentNode&&this.shadowContainer.parentNode.removeChild(this.shadowContainer))}},{key:"captureCursor",value:function(){this.overlay.style.pointerEvents="auto"}},{key:"ignoreCursor",value:function(){this.overlay.style.pointerEvents="none"}},{key:"setBounds",value:function(e){var t=e.x,n=e.y,r=e.width,o=e.height;this.overlay.style.left=t+"px",this.overlay.style.top=n+"px",this.overlay.style.width=r+"px",this.overlay.style.height=o+"px"}}]),e}(),we=function(){function e(t){ge(this,e),this.active=!1,this.overlay=new be(t||{}),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleClick=this.handleClick.bind(this),this.tick=this.tick.bind(this)}return ve(e,[{key:"start",value:function(e){if(this.active)return!1;this.active=!0,this.options=e,document.addEventListener("mousemove",this.handleMouseMove,!0),document.addEventListener("click",this.handleClick,!0);var t=e.parentElement||document.body,n=void 0===e.useShadowDOM||e.useShadowDOM;return this.overlay.addToDOM(t,n),this.tick(),!0}},{key:"stop",value:function(){this.active=!1,this.options=void 0,document.removeEventListener("mousemove",this.handleMouseMove,!0),document.removeEventListener("click",this.handleClick,!0),this.overlay.removeFromDOM(),this.target=void 0,this.mouseX=void 0,this.mouseY=void 0,this.tickReq&&window.cancelAnimationFrame(this.tickReq)}},{key:"handleMouseMove",value:function(e){this.mouseX=e.clientX,this.mouseY=e.clientY}},{key:"handleClick",value:function(e){var t=document.elementFromPoint(e.clientX,e.clientY);this.options&&this.options.elementFilter&&t&&!this.options.elementFilter(t)||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.target&&this.options&&this.options.onClick&&this.options.onClick(this.target))}},{key:"tick",value:function(){this.updateTarget(),this.tickReq=window.requestAnimationFrame(this.tick)}},{key:"updateTarget",value:function(){if(void 0!==this.mouseX&&void 0!==this.mouseY){this.overlay.ignoreCursor();var e=document.elementFromPoint(this.mouseX,this.mouseY);if(this.overlay.captureCursor(),e&&e!==this.target){if(this.options&&this.options.elementFilter&&!this.options.elementFilter(e))return this.target=void 0,void this.overlay.setBounds({x:0,y:0,width:0,height:0});this.target=e;var t,n,r=(n=(t=e).getBoundingClientRect(),{x:window.pageXOffset+n.left,y:window.pageYOffset+n.top,width:t.offsetWidth,height:t.offsetHeight});this.overlay.setBounds(r),this.options&&this.options.onHover&&this.options.onHover(e)}}}}]),e}();const ke=we;function xe(e){var t=e.getAttribute("id");return null!==t&&""!==t?t.match(/(?:^\d|:)/)?'[id="'.concat(t,'"]'):"#"+t:null}function Se(e){var t=function(e){if(!e.hasAttribute("class"))return[];try{return Array.prototype.slice.call(e.classList).filter((function(e){return/^[a-z_-][a-z\d_-]*$/i.test(e)?e:null}))}catch(n){var t=e.getAttribute("class");return(t=t.trim().replace(/\s+/g," ")).split(" ")}}(e).filter(Boolean);return t.map((function(e){return".".concat(e)}))}function Ce(e,t,n,r,o,i,a){if(i!==a)for(var s=r;s<=o&&o-s+1>=a-i;++s)n[i]=t[s],Ce(e,t,n,s+1,o,i+1,a);else e.push(n.slice(0,i).join(""))}function Ie(e){return function(e){if(Array.isArray(e))return Ee(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 Ee(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 Ee(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 Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Te(e){return Te="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},Te(e)}function Le(e){return"object"===("undefined"==typeof HTMLElement?"undefined":Te(HTMLElement))?e instanceof HTMLElement:!!e&&"object"===Te(e)&&1===e.nodeType&&"string"==typeof e.nodeName}function Oe(e){var t,n,r=0,o=e.parentNode;if(Boolean(o)){var i=o.childNodes,a=i.length;for(t=0;t<a;t++)if(Le(n=i[t])&&(r++,n===e))return":nth-child(".concat(r,")")}return null}function Ae(e){return e.tagName.toLowerCase().replace(/:/g,"\\:")}function Me(e,t){if(!Boolean(t))return!1;var n=e.ownerDocument.querySelectorAll(t);return 1===n.length&&n[0]===e}function Pe(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 Re(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 Re(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 Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ne(e,t,n){var r={Tag:Ae,NthChild:Oe,Attributes:function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["id","class","length"];return Ie(e.attributes).reduce((function(e,n){return t.indexOf(n.nodeName)>-1||e.push("[".concat(n.nodeName,'="').concat(n.value,'"]')),e}),[])}(e,n)},Class:Se,ID:xe};return t.reduce((function(t,n){return t[n]=r[n](e),t}),{})}function je(e,t){try{var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}catch(r){return!1}}function _e(e,t){return t.find(je.bind(null,e))}function De(e,t,n){var r=function(e,t){for(var n=[],r=e.length,o=[],i=1;i<=t;++i)Ce(n,e,o,0,r-1,0,i);return n}(t,3),o=_e(e,r);return Boolean(o)||Boolean(n)&&(o=_e(e,r=r.map((function(e){return n+e}))),Boolean(o))?o:null}function Fe(e,t,n,r){var o,i=Ne(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=Pe(t);try{for(s.s();!(a=s.n()).done;){var c=a.value,l=i.ID,u=i.Tag,d=i.Class,p=i.Attributes,f=i.NthChild;switch(c){case"ID":if(Boolean(l)&&je(e,l))return l;break;case"Tag":if(Boolean(u)&&je(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(o=De(e,d,u)))return o;break;case"Attributes":if(Boolean(p)&&p.length&&(o=De(e,p,u)))return o;break;case"NthChild":if(Boolean(f))return f}}}catch(h){s.e(h)}finally{s.f()}return"*"}function Be(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,c=void 0===s?null:s,l=[],u=function(e){for(var t=[],n=e;Le(n);)t.push(n),n=n.parentNode;return t}(e),d=Pe(u);try{for(d.s();!(t=d.n()).done;){var p=Fe(t.value,o,a,c);Boolean(p)&&l.push(p)}}catch(y){d.e(y)}finally{d.f()}for(var f=[],h=0,g=l;h<g.length;h++){var m=g[h];f.unshift(m);var v=f.join(" > ");if(Me(e,v))return v}return null}var Ue=function(e){return'(?:[^"]*[^a-zA-Z0-9])?(?:'.concat(e.join("|"),")")},He=new RegExp(['^(?:#|\\[id=")'.concat(Ue(["v-\\d+",":r[0-9a-z]+:","(?:radix|headlessui|reach|floating-ui)-","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(Ue(["css-[a-z0-9]*\\d[a-z0-9]*","sc-(?=[a-zA-Z0-9]*[A-Z])[a-zA-Z0-9]{5,}","jsx-\\d+"])),"^\\.[^.]*".concat("__(?=[A-Za-z0-9]{4,}$)(?=[A-Za-z0-9]*[0-9])(?=[A-Za-z0-9]*[A-Z])[A-Za-z0-9]+$")].join("|")),ze=function(e,t){if(!e||"*"===e)return!1;try{var n=document.querySelectorAll(e);return 1===n.length&&n[0]===t}catch(r){return!1}},qe=/\d{2,}/,We=function(e){return e.replace(/\d+/g,"#")},Ge=function(e){return e.match(/(?:^\d|:)/)?'[id="'.concat(e,'"]'):"#".concat(e)},Ve=["data-testid","data-test-id","data-test","data-cy","data-qa","name"],Xe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be,n=t(e),r=[];try{var o=function(){for(var e={},t=document.querySelectorAll("[id]"),n=0;n<t.length;n++){var r=t[n].getAttribute("id");if(r&&qe.test(r)){var o=We(r);e[o]||(e[o]=[]),e[o].indexOf(r)<0&&e[o].push(r)}}return Object.keys(e).reduce((function(t,n){return e[n].length>1?t.concat(e[n]):t}),[])}(),i="function"==typeof e.getAttribute?e.getAttribute("id"):null;i&&o.indexOf(i)<0&&!He.test(Ge(i))&&r.push(Ge(i)),r.push.apply(r,function(e){var t=(e.tagName||"").toLowerCase();return Ve.reduce((function(n,r){var o="function"==typeof e.getAttribute?e.getAttribute(r):null;if(!o||He.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 Ge(e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})),s=a.length?new RegExp("".concat(He.source,"|^(?:").concat(a.join("|"),")$")):He;r.push(t(e,{excludeRegex:s}))}catch(l){}for(var c=0;c<r.length;c++)if(ze(r[c],e))return r[c];return n};function Je(e){return Je="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},Je(e)}function Ke(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ze(r.key),r)}}function $e(e,t,n){return t&&Ke(e.prototype,t),n&&Ke(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ye(e,t,n){return(t=Ze(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(e){var t=function(e,t){if("object"!=Je(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Je(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Je(t)?t:String(t)}var Qe=$e((function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ye(this,"picker",null),Ye(this,"onElementPicked",null),Ye(this,"stopPicker",(function(){if(t.picker)return t.picker.stop(),void(t.picker=null)})),Ye(this,"startPicker",(function(){t.stopPicker();var e=t;t.picker=new ke({style:{borderColor:"#2142E7",background:"transparent",borderWidth:"4px",borderRadius:"5px"}}),t.picker.start({useShadowDOM:!1,onClick:function(t){try{for(var n,r=null,o=t,i=0;o&&i<=3;i++){if(o.getAttribute&&o.getAttribute("data-gleap-tour")){r=o;break}o=o.parentElement}if(r){var a=r.getAttribute("data-gleap-tour");n='[data-gleap-tour="'.concat(a,'"]')}else n=Xe(t);e.onElementPicked&&e.onElementPicked(n)}catch(s){console.error("Error while getting unique selector",s)}},elementFilter:function(e){return!e.classList.contains("gleap-admin-collapse-ui")&&!e.closest(".gleap-admin-collapse-ui")}})})),Ye(this,"setMode",(function(e){t.mode=e,"navigate"===e&&t.stopPicker(),"picker"===e&&t.startPicker()}))}));const et=Qe;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 nt(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 rt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(n),!0).forEach((function(t){it(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ot(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,at(r.key),r)}}function it(e,t,n){return(t=at(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function at(e){var t=function(e,t){if("object"!=tt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=tt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==tt(t)?t:String(t)}var st=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),it(this,"libraryInstance",null),it(this,"lastUrl",void 0),it(this,"injectedFrame",!1),it(this,"gleapFrameContainer",null),it(this,"gleapCollapseUI",null),it(this,"injectedCollapseUI",!1),it(this,"gleapFrame",null),it(this,"configData",null),it(this,"adminHelper",null),it(this,"status","navigate"),it(this,"initialized",!1),it(this,"toggleCollapseUI",(function(){var e="gleap-admin-collapse-ui-active",n="gleap-admin-frame-container-active",r=function(e,t){return e&&e.classList.contains(t)};(!(arguments.length>0&&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='<div class="gleap-admin-collapse-ui-icon">\n '.concat(fe("arrowdown"),"\n </div>"),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='<iframe src="https://app.gleap.io/'.concat("tooltips"===(null==t||null===(e=t.configData)||void 0===e?void 0:e.type)?"tooltipbuilder":"producttourbuilder",'" class="gleap-admin-frame" scrolling="no" title="Gleap Admin Window" allow="autoplay; encrypted-media; fullscreen;" frameborder="0"></iframe>'),document.body.appendChild(n),t.gleapFrameContainer=n,t.gleapFrame=document.querySelector(".gleap-admin-frame")}}))}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(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,nu.getInstance().disable(),Wn.getInstance().disable(),gc.getInstance().disable(),oh.close(),oh.showFeedbackButton(!1),e.adminHelper=new et;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("https://app.gleap.io"===n.origin)try{var r=JSON.parse(n.data);if("admin"===r.type&&("load"===r.name&&(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:rt(rt({},t.configData),{},{currentPage:window.location.href})}),"highlight-element"===r.name&&(document.querySelectorAll(".gleap-admin-highlight").forEach((function(e){e.classList.remove("gleap-admin-highlight")})),null!=r&&null!==(o=r.data)&&void 0!==o&&o.selector)){var i,a=document.querySelector(null==r||null===(i=r.data)||void 0===i?void 0:i.selector);a&&a.classList.add("gleap-admin-highlight")}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{document.querySelector(r.data.selector).click()}catch(s){console.log(s)}"status-changed"===r.name&&(t.status=r.data,e.setFrameHeight(t.status),t.adminHelper.stopPicker(),"picker"===t.status&&t.adminHelper.startPicker())}}catch(c){}})),this.sendMessage({name:"init"}),this.startPageListener()}}},{key:"sendMessage",value:function(e){try{window&&window.opener&&window.opener.postMessage(JSON.stringify(rt(rt({},e),{},{type:"admin"})),"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(rt(rt({},e),{},{type:"tourbuilder"})),"*")}catch(t){}}}])&&ot(t.prototype,n),r&&ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ct(e){return ct="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},ct(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",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=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 A(r||[]);return o(a,"_invoke",{value:E(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));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){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==ct(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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.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 E(t,n,r){var o=p;return function(i,a){if(o===h)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 c=T(s,r);if(c){if(c===m)continue;return c}}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=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.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")),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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(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<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(ct(t)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new I(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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;O(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),m}},t}function ut(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 dt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(n),!0).forEach((function(t){pt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pt(e,t,n){return(t=vt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ft(e){return function(e){if(Array.isArray(e))return ht(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 ht(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 ht(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 ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gt(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vt(r.key),r)}}function vt(e){var t=function(e,t){if("object"!=ct(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ct(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ct(t)?t:String(t)}it(st,"instance",void 0);var yt=function(){function e(){var t=arguments.length>0&&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,c,l=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(ft(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),r="stream-".concat(Date.now()),this._messages=[].concat(ft(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,c=this._messages.length-1,e.next=19,this._networkManager.streamAgent(this._agentId,a,{onMeta:function(e){l._destroyed||(e.conversationId&&(l._conversationId=e.conversationId,l._networkManager._invalidateMessagesCache(e.conversationId),s&&l._onConversationCreated&&l._onConversationCreated(e.conversationId)),e.runId&&l._messages[c]&&(l._messages[c]=dt(dt({},l._messages[c]),{},{id:e.runId})))},onToken:function(e){if(!l._destroyed){var t=l._messages[c];t&&(t.content+=e.content||""),l._notify(),l._onToken&&l._onToken(e)}},onDone:function(e){if(!l._destroyed){var t=l._messages[c];t&&(t.isStreaming=!1,e.response&&!t.content&&(t.content=e.response)),l._isExecuting=!1,l._abortController=null,l._notify(),l._onReplyReceived&&l._onReplyReceived(e)}},onError:function(e){if(!l._destroyed){var t=l._messages[c];t&&!t.content?l._messages.splice(c,1):t&&(t.isStreaming=!1),l._isExecuting=!1,l._error=e,l._abortController=null,l._notify(),l._onError&&l._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){gt(i,n,r,a,s,"next",e)}function s(e){gt(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?dt(dt({},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&&mt(t.prototype,n),r&&mt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const bt=yt;var wt={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"}},kt="eu";function xt(e){return xt="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},xt(e)}function St(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mt(r.key),r)}}function Ct(e,t,n){return t=Ot(t),function(e,t){if(t&&("object"===xt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return It(e)}(e,Tt()?Reflect.construct(t,n||[],Ot(e).constructor):t.apply(e,n))}function It(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Et(e){var t="function"==typeof Map?new Map:void 0;return Et=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Tt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Lt(o,n.prototype),o}(e,arguments,Ot(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Lt(n,e)},Et(e)}function Tt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tt=function(){return!!e})()}function Lt(e,t){return Lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lt(e,t)}function Ot(e){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ot(e)}function At(e,t,n){return(t=Mt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mt(e){var t=function(e,t){if("object"!=xt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=xt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xt(t)?t:String(t)}var Pt="https://outboundmedia.gleap.io/agent-conversation",Rt=function(e){Pt=e};function Nt(e){return Nt="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},Nt(e)}function jt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dt(r.key),r)}}function _t(e,t,n){return(t=Dt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dt(e){var t=function(e,t){if("object"!=Nt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Nt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Nt(t)?t:String(t)}var Ft=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_t(this,"eventListeners",{})}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"notifyEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("flow-started"===e){var n=oh.getInstance();n.setGlobalDataItem("webReplay",null),n.setGlobalDataItem("screenRecordingData",null),n.takeCurrentReplay()}var r=this.getInstance().eventListeners[e];if(r)for(var o=0;o<r.length;o++){var i=r[o];i&&i(t)}}},{key:"on",value:function(e,t){var n=this.getInstance();n.eventListeners[e]||(n.eventListeners[e]=[]),n.eventListeners[e].push(t)}}],(n=null)&&jt(t.prototype,n),r&&jt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Bt(e){return Bt="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},Bt(e)}function Ut(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 Ht(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 Ht(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 Ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zt(){zt=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",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=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 A(r||[]);return o(a,"_invoke",{value:E(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));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){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==Bt(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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.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 E(t,n,r){var o=p;return function(i,a){if(o===h)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 c=T(s,r);if(c){if(c===m)continue;return c}}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=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.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")),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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(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<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Bt(t)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new I(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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;O(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),m}},t}function qt(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function Wt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Vt(r.key),r)}}function Gt(e,t,n){return(t=Vt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e){var t=function(e,t){if("object"!=Bt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Bt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bt(t)?t:String(t)}_t(Ft,"instance",void 0);var Xt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Gt(this,"agentTools",[]),Gt(this,"agentToolCallbacks",[]),Gt(this,"registeredAgentTools",{}),Gt(this,"runningToolExecutions",{})}var t,n,r,o,i;return t=e,n=[{key:"setAgentTools",value:function(e){this.agentTools=e||[]}},{key:"getAgentTools",value:function(){return this.agentTools}},{key:"registerAgentToolAction",value:function(e){e&&this.agentToolCallbacks.push(e)}},{key:"registerAgentTool",value:function(e,t){e&&"function"==typeof t&&(this.registeredAgentTools[e]=t)}},{key:"executeToolAction",value:function(e){var t=e.toolCallId,n=e.name,r=e.params;if(t&&this.runningToolExecutions[t])return this.runningToolExecutions[t];var o=this._runToolAction({toolCallId:t,name:n,params:r});return t&&(this.runningToolExecutions[t]=o),o}},{key:"_runToolAction",value:(o=zt().mark((function e(t){var n,r,o,i,a,s,c;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.toolCallId,r=t.name,o=t.params,i=this.registeredAgentTools[r]){e.next=6;break}a="No handler registered for tool '".concat(r,"' in the app. Register one via Gleap.registerAgentTool('").concat(r,"', handler)."),e.next=17;break;case 6:return e.prev=6,e.next=9,i(null!=o?o:{});case 9:s=e.sent,(a="string"==typeof s?s:JSON.stringify(null!=s?s:""))||(a="The action completed without returning a result."),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(6),a="Tool execution failed: ".concat(null!==(c=null===e.t0||void 0===e.t0?void 0:e.t0.message)&&void 0!==c?c:"unknown error");case 17:return Ft.notifyEvent("agent-tool-executed",{name:r,params:null!=o?o:{},result:a,toolCallId:n}),e.abrupt("return",{toolCallId:n,name:r,result:a});case 19:case"end":return e.stop()}}),e,this,[[6,14]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){qt(i,n,r,a,s,"next",e)}function s(e){qt(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"triggerToolAction",value:function(e){if(e){Ft.notifyEvent("agent-tool-executed",e);var t,n=Ut(this.agentToolCallbacks);try{for(n.s();!(t=n.n()).done;){var r=t.value;try{r(e)}catch(o){}}}catch(i){n.e(i)}finally{n.f()}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Wt(t.prototype,n),r&&Wt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();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){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 $t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kt(Object(n),!0).forEach((function(t){Zt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Qt(r.key),r)}}function Zt(e,t,n){return(t=Qt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qt(e){var t=function(e,t){if("object"!=Jt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Jt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Jt(t)?t:String(t)}function en(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=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tn(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 tn(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 tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Gt(Xt,"instance",void 0);var nn="default",rn="auto",on="light",an="dark",sn=[rn,on,an],cn=[["headerColor","darkHeaderColor"],["headerColor2","darkHeaderColor2"],["headerColor3","darkHeaderColor3"],["color","darkColor"],["backgroundColor","darkBackgroundColor"]],ln=[["logo","darkLogo"],["bgImage","darkBgImage"],["aurora","darkAurora"]],un=["data-theme","data-bs-theme","data-color-scheme","data-color-mode","data-mode","data-mui-color-scheme"],dn=["dark","dark-mode","dark-theme","theme-dark"],pn=["light","light-mode","light-theme","theme-light"],fn=function(e){if("string"!=typeof e)return null;var t=e.trim().toLowerCase(),n=t.match(/^#([0-9a-f]{3})$/);if(n){var r=en(n[1].split("").map((function(e){return parseInt(e+e,16)})),3);return{r:r[0],g:r[1],b:r[2],a:1}}if(n=t.match(/^#([0-9a-f]{6})([0-9a-f]{2})?$/))return{r:parseInt(n[1].substr(0,2),16),g:parseInt(n[1].substr(2,2),16),b:parseInt(n[1].substr(4,2),16),a:n[2]?parseInt(n[2],16)/255:1};if(n=t.match(/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/)){var o=1;return void 0!==n[4]&&(o=n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4])),{r:parseFloat(n[1]),g:parseFloat(n[2]),b:parseFloat(n[3]),a:o}}return null},hn=function(e){if("string"!=typeof e||!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e.trim()))return null;var t=fn(e);return"#"+[t.r,t.g,t.b].map((function(e){return e.toString(16).padStart(2,"0")})).join("")},gn="data-gleap-dark",mn=function(e){if("string"!=typeof e)return null;var t=e.toLowerCase();return-1!==t.indexOf("dark")?an:-1!==t.indexOf("light")?on:null},vn=function(e){if(!e)return null;for(var t=0;t<un.length;t++){var n=mn(e.getAttribute(un[t]));if(n)return n}var r=e.classList;if(r){if(dn.some((function(e){return r.contains(e)})))return an;if(pn.some((function(e){return r.contains(e)})))return on}return null},yn=function(e){try{return e&&window.getComputedStyle?window.getComputedStyle(e):null}catch(t){return null}},bn=function(e){var t,n=yn(e),r=fn(n?n.backgroundColor:null);return!r||r.a<.5?null:(299*(t=r).r+587*t.g+114*t.b)/1e3<128?an:on},wn=function(){try{return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}catch(e){return null}},kn=function(){if("undefined"==typeof document)return on;var e,t,n,r,o=document.documentElement,i=document.body,a=vn(o)||vn(i)||(e=yn(o),t=e?(e.colorScheme||e.getPropertyValue("color-scheme")||"").toLowerCase():"",n=-1!==t.indexOf("dark"),r=-1!==t.indexOf("light"),n&&!r?an:r&&!n?on:null)||bn(i)||bn(o);if(a)return a;var s=wn();return s&&s.matches?an:on},xn=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zt(this,"colorScheme",null),Zt(this,"lightBackgroundColor",null),Zt(this,"darkBackgroundColor",null),Zt(this,"detectedScheme",null),Zt(this,"mutationObserver",null),Zt(this,"mediaQuery",null),Zt(this,"settleTimeout",null),Zt(this,"checkHostColorScheme",(function(){if(t.getColorScheme()===rn){var e=kn();e!==t.detectedScheme&&(t.detectedScheme=e,t.notifyChange())}})),Zt(this,"onHostChange",(function(){t.checkHostColorScheme(),clearTimeout(t.settleTimeout),t.settleTimeout=setTimeout(t.checkHostColorScheme,500)}))}var t,n,r;return t=e,n=[{key:"setColorScheme",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.colorScheme=function(e){return e===on||e===an?e:rn}(e),this.lightBackgroundColor=hn(null==t?void 0:t.lightBackgroundColor),this.darkBackgroundColor=hn(null==t?void 0:t.darkBackgroundColor),this.updateWatching(),this.notifyChange()}},{key:"getDashboardConfig",value:function(){try{return br.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!==sn.indexOf(e)?e:nn);return n===nn?nn:this.colorScheme||n}},{key:"hasDarkPalette",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig();return!!this.darkBackgroundColor||!!e&&cn.some((function(t){var n=en(t,2)[1];return null!==hn(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===rn?n=this.detectedScheme||kn():t!==on&&t!==an||(n=t),n!==an||this.hasDarkPalette(e)?n:null}},{key:"applyToFlowConfig",value:function(e){var t=this.getActiveColorScheme(e);if(!e||!t)return e;if(t===on)return this.lightBackgroundColor?$t($t({},e),{},{backgroundColor:this.lightBackgroundColor}):e;var n=$t({},e);return cn.forEach((function(t){var r=en(t,2),o=r[0],i=r[1],a=hn(e[i]);a&&(n[o]=a)})),this.darkBackgroundColor&&(n.backgroundColor=this.darkBackgroundColor),ln.forEach((function(t){var r=en(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===an?n?"dark-glow":"dark":n?"light-glow":"light"}},{key:"applyToChecklist",value:function(e){e&&(this.getActiveColorScheme()===an?e.setAttribute(gn,""):e.removeAttribute(gn))}},{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<t.length;n++){var r=t[n];if(this.applyToChecklist(r),e&&r._hasLoaded&&r.checklistData&&"function"==typeof r.renderChecklist)try{r.renderChecklist(r.checklistData)}catch(o){}}}},{key:"updateWatching",value:function(){this.getColorScheme()===rn?(this.mutationObserver||this.mediaQuery||(this.detectedScheme=kn()),this.startWatching()):this.stopWatching()}},{key:"startWatching",value:function(){var e=this;if("undefined"!=typeof window&&"undefined"!=typeof document&&(this.mediaQuery||(this.mediaQuery=wn(),this.mediaQuery&&(this.mediaQuery.addEventListener?this.mediaQuery.addEventListener("change",this.onHostChange):this.mediaQuery.addListener&&this.mediaQuery.addListener(this.onHostChange))),!this.mutationObserver&&"undefined"!=typeof MutationObserver)){this.mutationObserver=new MutationObserver(this.onHostChange);var t={attributes:!0,attributeFilter:["class","style"].concat(un)};this.mutationObserver.observe(document.documentElement,t);var n=function(){e.mutationObserver&&document.body&&(e.mutationObserver.observe(document.body,t),e.checkHostColorScheme())};document.body?n():document.addEventListener("DOMContentLoaded",n,{once:!0})}}},{key:"stopWatching",value:function(){clearTimeout(this.settleTimeout),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.mediaQuery&&(this.mediaQuery.removeEventListener?this.mediaQuery.removeEventListener("change",this.onHostChange):this.mediaQuery.removeListener&&this.mediaQuery.removeListener(this.onHostChange),this.mediaQuery=null),this.detectedScheme=null}},{key:"notifyChange",value:function(){this.applyToChecklists();try{br.getInstance().refreshColorScheme()}catch(e){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Yt(t.prototype,n),r&&Yt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Sn(){Sn=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",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=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 A(r||[]);return o(a,"_invoke",{value:E(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));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){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==En(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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.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 E(t,n,r){var o=p;return function(i,a){if(o===h)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 c=T(s,r);if(c){if(c===m)continue;return c}}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=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.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")),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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(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<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(En(t)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new I(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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;O(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),m}},t}function Cn(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function In(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Cn(i,r,o,a,s,"next",e)}function s(e){Cn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function En(e){return En="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},En(e)}function Tn(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 Ln(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tn(Object(n),!0).forEach((function(t){An(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function On(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mn(r.key),r)}}function An(e,t,n){return(t=Mn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mn(e){var t=function(e,t){if("object"!=En(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=En(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==En(t)?t:String(t)}Zt(xn,"instance",void 0);var Pn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),An(this,"chatbarContainer",null),An(this,"chatbarFrame",null),An(this,"config",null),An(this,"isHidden",!0),An(this,"manuallyHidden",!1),An(this,"manuallyShown",!1),An(this,"comReady",!1),An(this,"pendingMessages",[]),An(this,"chatbarStyle",null),An(this,"_panelOpen",!1),An(this,"agentId",null),An(this,"agentName",null),An(this,"agentContext",null),this._listenForMessages(),this._listenForOutsideClicks()}var t,n,r,o,i;return t=e,n=[{key:"chatbarUrl",get:function(){return"".concat(zs.getInstance().frameUrl.replace(/\/$/,""),"/chatbar")}},{key:"_listenForOutsideClicks",value:function(){var e=this;document.addEventListener("click",(function(t){e.chatbarContainer&&(e.chatbarContainer.contains(t.target)||e._suppressOutsideClick||e._postMessageRaw({name:"chatbar-outside-click"}))}))}},{key:"_listenForMessages",value:function(){var e=this;window.addEventListener("message",(function(t){if(e.chatbarFrame&&t.source===e.chatbarFrame.contentWindow)try{var n,r=JSON.parse(t.data);if(!r||!r.name)return;if("ping"===r.name)return e.comReady=!0,e._sendSessionUpdate(),e._sendConfigUpdate(),e._flushPendingMessages(),void e.setPanelOpen(!0);if("collect-ticket-data"===r.name)return void zs.getInstance().answerCollectTicketData(e.chatbarFrame,r);if("chatbar-panel-state"===r.name)return void e.setPanelOpen(!(null===(n=r.data)||void 0===n||!n.isOpen));if("chatbar-resize"===r.name&&r.data)return void e._resizeFrame(r.data);if("chatbar-panel-blur"===r.name&&r.data)return void e._updateBlurBackdrop(r.data);if("close-widget"===r.name)return void e.setPanelOpen(!1);if("open-url"===r.name){var o=r.data,i=!!r.newTab;try{zs.getInstance().urlHandler(o,i)}catch(a){}return}if("tool-execution"===r.name&&r.data)return Ft.notifyEvent("tool-execution",r.data),void Xt.getInstance().triggerToolAction(r.data);if("frontend-tool-execute"===r.name&&r.data)return void Xt.getInstance().executeToolAction(r.data).then((function(t){e._postMessageRaw({name:"frontend-tool-result",data:t})}));if("notify-event"===r.name&&r.data)return void Ft.notifyEvent(r.data.type,r.data.data);if("chatbar-notification-read"===r.name)return void e.hideChatbarNotification()}catch(a){}}))}},{key:"_postMessageRaw",value:function(e){try{var t;if(!this.comReady||null===(t=this.chatbarFrame)||void 0===t||!t.contentWindow)return void this.pendingMessages.push(e);this.chatbarFrame.contentWindow.postMessage(JSON.stringify(e),"*")}catch(n){}}},{key:"_flushPendingMessages",value:function(){var e=this,t=this.pendingMessages||[];this.pendingMessages=[],t.forEach((function(t){return e._postMessageRaw(t)}))}},{key:"_sendSessionUpdate",value:function(){this._postMessageRaw({name:"session-update",data:{sessionData:vs.getInstance().getSession(),apiUrl:vs.getInstance().apiUrl,realtimeHost:vs.getInstance().realtimeHost,sdkKey:vs.getInstance().sdkKey}})}},{key:"_sendConfigUpdate",value:function(){this._postMessageRaw({name:"config-update",data:{config:this._withChatbarConfig(br.getInstance().getFlowConfig()),aiTools:Xt.getInstance().getAgentTools(),agentTools:Xt.getInstance().getAgentTools(),overrideLanguage:Vf.getInstance().getOverrideLanguage()}})}},{key:"_withChatbarConfig",value:function(e){var t,n,r,o,i,a=e||{};return Ln(Ln({},a),{},{chatbarPlaceholder:null===(t=this.config)||void 0===t?void 0:t.placeholder,chatbarQuickActions:(null===(n=this.config)||void 0===n?void 0:n.quickActions)||[],chatbarStyle:xn.getInstance().applyToChatbarStyle(null===(r=this.config)||void 0===r?void 0:r.style),chatbarColor:null==a?void 0:a.color,chatbarWorkflowId:null!==(o=null===(i=this.config)||void 0===i?void 0:i.workflowId)&&void 0!==o?o:null})}},{key:"setPanelOpen",value:function(e){this._panelOpen=!!e,this._postMessageRaw({name:"widget-status-update",data:{isWidgetOpen:!!e}})}},{key:"showChatbarNotification",value:function(e){var t,n;this._postMessageRaw({name:"chatbar-notification",data:{sender:null==e||null===(t=e.sender)||void 0===t?void 0:t.name,text:null==e?void 0:e.text,shareToken:null==e||null===(n=e.conversation)||void 0===n?void 0:n.shareToken}})}},{key:"hideChatbarNotification",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._postMessageRaw({name:"chatbar-notification-clear"}),!e)try{var t;_f.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=vs.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 c=this.blurBackdrop.style;c.top=(null!=n?n:0)+"px",c.bottom=(null!=r?r:0)+"px",c.left=(null!=o?o:0)+"px",c.right=(null!=i?i:0)+"px",c.height="auto",c.borderRadius=(null!=a?a:20)+"px",s?(c.background="rgba(40, 40, 40, 0.55)",c.backdropFilter="blur(20px) saturate(140%) brightness(0.75)",c.webkitBackdropFilter="blur(20px) saturate(140%) brightness(0.75)"):(c.background="rgba(255, 255, 255, 0.45)",c.backdropFilter="blur(20px) saturate(150%) brightness(1.04)",c.webkitBackdropFilter="blur(20px) saturate(150%) brightness(1.04)"),c.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(br.getInstance().getFlowConfig()),aiTools:Xt.getInstance().getAgentTools(),agentTools:Xt.getInstance().getAgentTools(),overrideLanguage:Vf.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===En(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=br.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=In(Sn().mark((function e(t){var n,r,o,i,a,s,c;return Sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=vs.getInstance(),i=o.apiUrl||wt[kt].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),e.next=9,fetch("".concat(i,"/v3/shared/agents/").concat(encodeURIComponent(t)),{headers:a});case 9:if((s=e.sent).ok){e.next=12;break}return e.abrupt("return",null);case 12:return e.next=14,s.json();case 14:if((c=e.sent)&&!c.error){e.next=17;break}return e.abrupt("return",null);case 17:return this.agentId=t,this.agentName=c.name||"AI Agent",e.abrupt("return",c);case 22:return e.prev=22,e.t0=e.catch(0),e.abrupt("return",null);case 25:case"end":return e.stop()}}),e,this,[[0,22]])}))),function(e){return i.apply(this,arguments)})},{key:"showWithAgent",value:(o=In(Sn().mark((function e(t,n){var r,o,i=this;return Sn().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;zs.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||se((function(){return e._injectUI()}))}},{key:"_injectUI",value:function(){if(document.body&&!this.chatbarContainer){var e={};try{e=br.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&&On(t.prototype,n),r&&On(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Rn(e){return Rn="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},Rn(e)}function Nn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_n(r.key),r)}}function jn(e,t,n){return(t=_n(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _n(e){var t=function(e,t){if("object"!=Rn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Rn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Rn(t)?t:String(t)}An(Pn,"instance",void 0);var Dn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"playSound",value:function(e){this.settings.play=e}},{key:"ping",value:function(){try{if(!this.settings.play)return;this.audio||(this.audio=new Audio("https://js.gleap.io/res/ping.mp3"));var e=this.audio.play();void 0!==e&&e.then((function(e){})).catch((function(e){}))}catch(t){}}}],(n=null)&&Nn(t.prototype,n),r&&Nn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Fn(e){return Fn="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},Fn(e)}function Bn(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 Un(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bn(Object(n),!0).forEach((function(t){zn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qn(r.key),r)}}function zn(e,t,n){return(t=qn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qn(e){var t=function(e,t){if("object"!=Fn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Fn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Fn(t)?t:String(t)}jn(Dn,"audio",void 0),jn(Dn,"settings",{play:!0});var Wn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),zn(this,"bannerUrl","https://outboundmedia.gleap.io"),zn(this,"bannerContainer",null),zn(this,"bannerData",null),zn(this,"disabled",!1),this.startCommunication()}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"setBannerUrl",value:function(e){this.bannerUrl=e}},{key:"startCommunication",value:function(){var e=this;window.addEventListener("message",(function(t){var n,r=e.bannerContainer?e.bannerContainer.querySelector(".gleap-b-frame"):null,o=r&&t.source===r.contentWindow,i=null===(n=e.bannerUrl)||void 0===n?void 0:n.includes(t.origin);if(o||i)try{var a,s,c,l,u,d,p,f,h,g,m,v=JSON.parse(t.data);if("BANNER"!==(null==v?void 0:v.type))return;if("banner-loaded"===v.name&&e.bannerData&&e.sendMessage({name:"banner-data",data:e.bannerData}),"banner-height"===v.name&&document.documentElement.style.setProperty("--gleap-margin-top",v.data.height+"px"),"banner-data-set"===v.name&&(document.body.classList.add("gleap-b-shown"),"floating"===(null===(a=e.bannerData)||void 0===a?void 0:a.format)&&document.body.classList.add("gleap-b-f")),"banner-close"===v.name&&e.removeBannerUI(),"start-conversation"===v.name&&oh.startBot(null===(s=v.data)||void 0===s?void 0:s.botId),"start-custom-action"===v.name&&oh.triggerCustomAction(null===(c=v.data)||void 0===c?void 0:c.action),"start-product-tour"===v.name&&oh.startProductTour(null===(l=v.data)||void 0===l?void 0:l.tourId,!0),"open-url"===v.name){var y=v.data,b=!!v.newTab;zs.getInstance().urlHandler(y,b)}"show-form"===v.name&&oh.startFeedbackFlow(null===(u=v.data)||void 0===u?void 0:u.formId),"show-survey"===v.name&&oh.showSurvey(null===(d=v.data)||void 0===d?void 0:d.formId,null===(p=v.data)||void 0===p?void 0:p.surveyFormat),"show-news-article"===v.name&&oh.openNewsArticle(null===(f=v.data)||void 0===f?void 0:f.articleId),"show-help-article"===v.name&&oh.openHelpCenterArticle(null===(h=v.data)||void 0===h?void 0:h.articleId),"show-checklist"===v.name&&oh.startChecklist(null===(g=v.data)||void 0===g?void 0:g.checklistId,!0,null===(m=v.data)||void 0===m?void 0:m.sharedKey)}catch(w){}}))}},{key:"removeBannerUI",value:function(){this.bannerContainer&&(document.body.removeChild(this.bannerContainer),this.bannerContainer=null),document.body.classList.remove("gleap-b-shown"),document.body.classList.remove("gleap-b-f")}},{key:"disable",value:function(){this.disabled=!0,this.removeBannerUI()}},{key:"injectBannerUI",value:function(e){if(!document.body)return!1;if(this.disabled)return!1;this.bannerContainer&&this.removeBannerUI(),this.bannerData=e;var t=document.createElement("div");t.className="gleap-b",t.innerHTML='<iframe class="gleap-b-frame" scrolling="no" title="Gleap Banner" role="dialog" frameborder="0"></iframe>',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(Un(Un({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){this.injectBannerUI(e)}}])&&Hn(t.prototype,n),r&&Hn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Gn(e){return Gn="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},Gn(e)}function Vn(e){return function(e){if(Array.isArray(e))return Xn(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 Xn(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 Xn(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 Xn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nr(r.key),r)}}function Kn(e,t,n){return t=er(t),function(e,t){if(t&&("object"===Gn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $n(e)}(e,Zn()?Reflect.construct(t,n||[],er(e).constructor):t.apply(e,n))}function $n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yn(e){var t="function"==typeof Map?new Map:void 0;return Yn=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Zn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Qn(o,n.prototype),o}(e,arguments,er(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Qn(n,e)},Yn(e)}function Zn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zn=function(){return!!e})()}function Qn(e,t){return Qn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qn(e,t)}function er(e){return er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},er(e)}function tr(e,t,n){return(t=nr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nr(e){var t=function(e,t){if("object"!=Gn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Gn(t)?t:String(t)}zn(Wn,"instance",void 0);function rr(e){return rr="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},rr(e)}function or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ir(r.key),r)}}function ir(e){var t=function(e,t){if("object"!=rr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rr(t)?t:String(t)}var ar,sr,cr,lr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,n=[{key:"start",value:function(){document.addEventListener("click",(function(e){if(e.target){var t=e.target.closest?e.target.closest("a"):null;t&&"gleap:"===t.protocol&&(e.preventDefault(),rh(t.href)),zs.getInstance().isOpened()||Jr.getInstance().addLog(function(e){var t,n,r=!(arguments.length>1&&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 c=e.getAttribute("class");c&&(a=' class="'.concat(c,'"'))}var l=(e.tagName||"").toLowerCase(),u="<",d=">";return r||(u="[",d="]"),"".concat(u).concat(l).concat(i).concat(a).concat(d).concat(o).concat(u,"/").concat(l).concat(d)}(e.target),"CLICK")}}))}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&or(t.prototype,n),r&&or(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ur(e){return ur="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},ur(e)}function dr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fr(r.key),r)}}function pr(e,t,n){return(t=fr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fr(e){var t=function(e,t){if("object"!=ur(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ur(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ur(t)?t:String(t)}ar=lr,cr=void 0,(sr=ir(sr="instance"))in ar?Object.defineProperty(ar,sr,{value:cr,enumerable:!0,configurable:!0,writable:!0}):ar[sr]=cr;var hr=["color","headerColor","headerColor2","headerColor3","backgroundColor"],gr=["logo","bgImage","aurora"],mr=function(e,t){return JSON.stringify(e.map((function(e){return null==t?void 0:t[e]})))},vr=function(e,t){return"".concat(e,"|").concat(mr([].concat(hr,gr),t))},yr=function(e,t){var n=parseInt(e);return isNaN(n)?t:n},br=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),pr(this,"rawFlowConfig",null),pr(this,"flowConfig",null),pr(this,"appliedColorScheme",null),pr(this,"projectActions",null),pr(this,"onConfigLoadedListener",[]),pr(this,"onConfigLoaded",(function(e){null!==t.flowConfig?e():t.onConfigLoadedListener.push(e)})),pr(this,"start",(function(){var e=vs.getInstance(),n=ie("config-".concat(e.sdkKey,"-").concat(Vf.getInstance().getActiveLanguage()));return n?(t.applyConfig(n),t.loadConfigFromServer().catch((function(e){})),Promise.resolve()):t.loadConfigFromServer()})),pr(this,"loadConfigFromServer",(function(){var e=t;return new Promise((function(t,n){var r=vs.getInstance(),o=new XMLHttpRequest,i=Vf.getInstance().getActiveLanguage();o.open("GET",r.apiUrl+"/config/"+r.sdkKey+"?lang="+i),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.injectSession(o),o.onerror=function(){n()},o.onreadystatechange=function(a){if(4===o.readyState){if(403===o.status&&(!function(e){try{var t="gleap-widget-".concat(e);localStorage.removeItem(t)}catch(n){}}("config-".concat(r.sdkKey,"-").concat(i)),oh.destroy()),200===o.status||201===o.status)try{var s=JSON.parse(o.responseText);try{ae("config-".concat(r.sdkKey,"-").concat(i),s)}catch(c){}return e.applyConfig(s),t()}catch(a){}n()}},o.send()}))}))}var t,n,r;return t=e,n=[{key:"getFlowConfig",value:function(){return this.flowConfig}},{key:"applyStylesFromConfig",value:function(){var e=this.flowConfig;oh.setStyles(e.color?e.color:"#485BFF",e.headerColor?e.headerColor:"#485BFF",e.buttonColor?e.buttonColor:"#485BFF",e.backgroundColor?e.backgroundColor:"#FFFFFF",yr(e.borderRadius,20),yr(e.buttonX,20),yr(e.buttonY,20),e.feedbackButtonPosition,e.headerColor2,e.headerColor3)}},{key:"refreshColorScheme",value:function(){if(this.rawFlowConfig){var e=xn.getInstance(),t=e.applyToFlowConfig(this.rawFlowConfig),n=vr(e.getActiveColorScheme(this.rawFlowConfig),t);if(n!==this.appliedColorScheme){this.appliedColorScheme=n;var r=this.flowConfig,o=mr(hr,t)!==mr(hr,r),i=mr(gr,t)!==mr(gr,r);this.flowConfig=t;var a=Pn.getInstance();a.comReady&&a._sendConfigUpdate(),o&&(this.applyStylesFromConfig(),gc.getInstance().sendModalData(),e.applyToChecklists(t.color!==(null==r?void 0:r.color))),(o||i)&&zs.getInstance().sendConfigUpdate()}}}},{key:"notifyConfigLoaded",value:function(){if(this.onConfigLoadedListener.length>0)for(var e=0;e<this.onConfigLoadedListener.length;e++)this.onConfigLoadedListener[e]();this.onConfigLoadedListener=[]}},{key:"applyConfig",value:function(e){try{this.rawFlowConfig=e.flowConfig;var t=xn.getInstance();t.updateWatching();var n=t.applyToFlowConfig(e.flowConfig),r=this.flowConfig;this.flowConfig=n,this.appliedColorScheme=vr(t.getActiveColorScheme(e.flowConfig),n),t.applyToChecklists(!!r&&r.color!==n.color),this.applyStylesFromConfig(),zs.getInstance().sendConfigUpdate(),j.getInstance().updateFeedbackButtonState(),bl.getInstance().updateContainerStyle(),n.enableWebReplays?vf.getInstance().startIfNotRunning():vf.getInstance().stop(),n.enableNetworkLogs&&hl.getInstance().start(),hl.getInstance().setLoadAllResources(!!n.sendNetworkResources),hl.getInstance().setRemoteFilters(n.networkLogPropsToIgnore||[]),hl.getInstance().setRemoteBlacklist(n.networkLogBlacklist||[]),Vf.getInstance().updateRTLSupport(),oh.enableShortcuts(!!n.enableShortcuts),e.aiBar&&Pn.getInstance().setConfig(e.aiBar),this.notifyConfigLoaded()}catch(o){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&dr(t.prototype,n),r&&dr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function wr(e){return wr="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},wr(e)}pr(br,"instance",void 0);var kr={budgetExceeded:!0},xr=function(e){try{return Object.prototype.toString.call(e)}catch(t){return"[object Object]"}},Sr=function(e){if(!e||"object"!==wr(e))return!1;if("undefined"!=typeof Error&&e instanceof Error)return!0;var t=xr(e);return("[object Error]"===t||"[object DOMException]"===t)&&"string"==typeof e.message},Cr=function(e){return!!e&&"object"===wr(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Ir=function(e){var t="";try{t=e.name}catch(n){}return"[Function "+(t||"(anonymous)")+"]"},Er=function(e){if(1===e.nodeType){var t="<"+String(e.nodeName).toLowerCase();"string"==typeof e.id&&e.id.length>0&&(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<r.length;o++)t+="."+r[o];return t+">"}if(3===e.nodeType){var i=String(e.nodeValue||"").trim();return'#text "'+(i.length>40?i.slice(0,40)+"…":i)+'"'}return String(e.nodeName).toLowerCase()},Tr=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 c,l=n||0;try{c=t.cause}catch(u){}return null!=c&&l<3&&(s+="\nCaused by: "+(Sr(c)?e(c,l+1):Nr(c,1e3))),s}catch(u){return"Error"}},Lr=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,kr;e.parts.push(t),e.length+=t.length},Or=function(e,t){var n=e.maxLength-e.length;Lr(e,JSON.stringify(t.length>n?t.slice(0,n):t))},Ar=function(e,t){try{return{value:e[t]}}catch(n){return{failed:!0}}},Mr=function(e,t,n,r,o,i){Lr(e,t);for(var a=Math.min(r,100),s=0;s<a;s++)s>0&&Lr(e,","),o(s,i+1);r>a&&Lr(e,",… "+(r-a)+" more"),Lr(e,n)},Pr=function e(t,n,r){var o=wr(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(Sr(n)){var i="Error",a="";try{i=String(n.name||"Error"),a=String(n.message||"")}catch(h){}Or(t,a?i+": "+a:i)}else if(Cr(n))Lr(t,Er(n));else if(function(e){return!!e&&"object"===wr(e)&&e.window===e&&!!e.document}(n))Lr(t,"[Window]");else{var s=xr(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))Lr(t,s.slice(8,-1)+"("+("number"==typeof n.length?n.length:n.byteLength)+")");else if(r>=t.maxDepth)Lr(t,Array.isArray(n)?"[Array]":"[Object]");else{t.seen.push(n);try{if(Array.isArray(n))return void Mr(t,"[","]",n.length,(function(r,o){var i=Ar(n,r);i.failed?Lr(t,'"[unreadable]"'):e(t,i.value,o)}),r);if("[object Map]"===s){var c=[];return n.forEach((function(e,t){c.length<100&&c.push([t,e])})),void Mr(t,"Map("+n.size+"){","}",n.size,(function(n,r){e(t,c[n][0],r),Lr(t," => "),e(t,c[n][1],r)}),r)}if("[object Set]"===s){var l=[];return n.forEach((function(e){l.length<100&&l.push(e)})),void Mr(t,"Set("+n.size+")[","]",n.size,(function(n,r){return e(t,l[n],r)}),r)}if("function"==typeof n.toJSON){var u;try{u=n.toJSON()}catch(h){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(h){return""}}(n);Mr(t,(p?p+" ":"")+"{","}",d.length,(function(r,o){Or(t,d[r]),Lr(t,":");var i=Ar(n,d[r]);i.failed?Lr(t,'"[unreadable]"'):e(t,i.value,o)}),r)}finally{t.seen.pop()}}else Lr(t,s.slice(8,-1)+"("+n.byteLength+")");else Lr(t,s.slice(8,-1));else Lr(t,String(n));else{var f=n.getTime();Or(t,isNaN(f)?"Invalid Date":n.toISOString())}}else Lr(t,'"[Circular]"');else Lr(t,Ir(n));else Lr(t,n.toString());else Lr(t,n.toString()+"n");else Lr(t,String(n));else Or(t,n);else Lr(t,"null")},Rr=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{Pr(r,e,0)}catch(o){if(o!==kr)return{text:r.parts.join("")+"[unserializable]",truncated:!1}}return{text:r.parts.join(""),truncated:r.truncated}},Nr=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"===wr(e))return e.toString();if("function"==typeof e)return Ir(e);if(Sr(e)){var r=Tr(e);return r.length>n?r.slice(0,n):r}if(Cr(e))return Er(e);if("[object Date]"===xr(e)){var o=e.getTime();return isNaN(o)?"Invalid Date":e.toISOString()}return Rr(e,n,4).text}catch(i){try{return xr(e)}catch(a){return"[unserializable]"}}},jr=function(e){try{return"bigint"==typeof e?e:"symbol"===wr(e)?NaN:Number(e)}catch(t){return NaN}},_r=function(e){var t=jr(e);return"bigint"==typeof t?t.toString()+"n":isNaN(t)?"NaN":String(t<0?Math.ceil(t):Math.floor(t))},Dr=function(e){var t=jr(e);return String("bigint"==typeof t?Number(t):t)},Fr=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<i.length&&r.length<=n;a++){var s=i.charAt(a);if("%"===s&&a!==i.length-1){var c=i.charAt(a+1);if("%"!==c)if(-1==="sdifoOjc".indexOf(c)||o>=e.length)r+=s;else{var l=e[o++];a++;var u=Math.max(1,n-r.length);"s"===c?r+=Nr(l,u):"d"===c||"i"===c?r+=_r(l):"f"===c?r+=Dr(l):"c"!==c&&(r+="string"==typeof l?JSON.stringify(l.slice(0,u)):Nr(l,u))}else r+="%",a++}else r+=s}}for(;o<e.length&&r.length<=n;o++)r.length>0&&(r+=" "),r+=Nr(e[o],Math.max(1,n-r.length));return r.length>n?r.slice(0,n):r}catch(d){return"[unserializable console arguments]"}};function Br(e){return Br="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},Br(e)}function Ur(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zr(r.key),r)}}function Hr(e,t,n){return(t=zr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zr(e){var t=function(e,t){if("object"!=Br(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Br(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Br(t)?t:String(t)}var qr={log:"INFO",info:"INFO",debug:"INFO",warn:"WARNING",error:"ERROR"},Wr="… [truncated]",Gr=5001,Vr=function(e,t){var n="ERROR"===t?5e3:1e3;return e.length<=n?e:e.slice(0,n-13)+Wr},Xr=function(e){return e.filename?" ("+e.filename+":"+(e.lineno||0)+":"+(e.colno||0)+")":""},Jr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Hr(this,"logArray",[]),Hr(this,"disabled",!1),Hr(this,"started",!1),Hr(this,"originalConsoleMethods",{}),Hr(this,"consoleWrappers",{}),Hr(this,"capturing",!1),Hr(this,"errorListener",null),Hr(this,"rejectionListener",null),Hr(this,"logMaxLength",500)}var t,n,r;return t=e,n=[{key:"getLogs",value:function(){return this.logArray.slice()}},{key:"stop",value:function(){this.disabled=!0,this.started=!1;try{var e="undefined"!=typeof window?window.console:void 0;if(e)for(var t=Object.keys(this.consoleWrappers),n=0;n<t.length;n++){var r=t[n];e[r]===this.consoleWrappers[r]&&(e[r]=this.originalConsoleMethods[r])}}catch(o){}this.consoleWrappers={},this.originalConsoleMethods={};try{this.errorListener&&window.removeEventListener("error",this.errorListener),this.rejectionListener&&window.removeEventListener("unhandledrejection",this.rejectionListener)}catch(o){}this.errorListener=null,this.rejectionListener=null}},{key:"addLog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";if(null!=e&&("string"!=typeof e&&(e=Nr(e,Gr)),!(e.length<=0)))for(this.logArray.push({log:Vr(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(Fr(e,Gr),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(qr),o=function(){var o=r[i];e.wrapConsoleMethod(n,o,(function(e){t.capture((function(){return t.addLogWithArgs(e,qr[o])}))}))},i=0;i<r.length;i++)o();this.wrapConsoleMethod(n,"assert",(function(e){e.length>0&&e[0]||t.capture((function(){var n=Fr(Array.prototype.slice.call(e,1),Gr);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: "+Nr(n,Gr),"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"===Br(n)&&"string"==typeof n.stack&&n.stack.length>0?Tr(n):null!=n?Nr(n,Gr)+Xr(e):String(e.message||"Script error.").replace(/^Uncaught\s+/,"")+Xr(e),this.addLog("Uncaught "+t,"ERROR")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Ur(t.prototype,n),r&&Ur(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kr(e){return Kr="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},Kr(e)}function $r(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 Yr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$r(Object(n),!0).forEach((function(t){Qr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eo(r.key),r)}}function Qr(e,t,n){return(t=eo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eo(e){var t=function(e,t){if("object"!=Kr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Kr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Kr(t)?t:String(t)}Hr(Jr,"instance",void 0);var to=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Qr(this,"customActionCallbacks",[])}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"registerCustomAction",value:function(e){var t=this.getInstance();t.customActionCallbacks&&t.customActionCallbacks.push(e)}},{key:"triggerCustomAction",value:function(e,t){var n=this.getInstance();if(n.customActionCallbacks)for(var r=0;r<n.customActionCallbacks.length;r++){var o=n.customActionCallbacks[r];o&&o(Yr({name:e},t||{}))}}}],(n=null)&&Zr(t.prototype,n),r&&Zr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function no(e){return no="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},no(e)}function ro(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,io(r.key),r)}}function oo(e,t,n){return(t=io(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function io(e){var t=function(e,t){if("object"!=no(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=no(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==no(t)?t:String(t)}Qr(to,"instance",void 0);var ao=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oo(this,"customData",{}),oo(this,"ticketAttributes",{})}var t,n,r;return t=e,n=[{key:"getCustomData",value:function(){return this.customData}},{key:"attachCustomData",value:function(e){this.customData=Object.assign(this.customData,ee(e))}},{key:"setCustomData",value:function(e,t){this.customData[e]=t}},{key:"removeCustomData",value:function(e){delete this.customData[e]}},{key:"clearCustomData",value:function(){this.customData={}}},{key:"setTicketAttribute",value:function(e,t){this.ticketAttributes[e]=t}},{key:"unsetTicketAttribute",value:function(e){delete this.ticketAttributes[e]}},{key:"clearTicketAttributes",value:function(){this.ticketAttributes={}}},{key:"getTicketAttributes",value:function(){return this.ticketAttributes}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&ro(t.prototype,n),r&&ro(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function so(e){return so="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},so(e)}function co(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 lo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?co(Object(n),!0).forEach((function(t){uo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):co(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function uo(e,t,n){return t=function(e){var t=function(e,t){if("object"!=so(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=so(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==so(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}oo(ao,"instance",void 0);var po=["current-password","new-password","one-time-code","cc-number","cc-csc"],fo=["checkbox","radio","submit","button","reset"],ho=function(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})},go=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week","textarea","select","password"],mo=ho(go),vo=ho(go.filter((function(e){return"select"!==e})).concat(["hidden"])),yo=function(e){return"*".repeat(null==e?0:String(e).length)},bo=function(e){return e.hasAttribute&&e.hasAttribute("data-rr-is-password")?"password":e.type?String(e.type).toLowerCase():""},wo=function(e,t){try{return!!t&&e.matches(t)}catch(n){return!1}},ko=function(e,t){if(!t||!e.classList)return!1;if("string"==typeof t)return e.classList.contains(t);if("function"==typeof t.test)for(var n=0;n<e.classList.length;n++)if(t.test(e.classList[n]))return!0;return!1},xo=function(e,t){return t=t||{},wo(e,".rr-mask, .gl-mask")||ko(e,t.maskTextClass)||wo(e,t.maskTextSelector)},So=function(e){return!0===e.maskAllInputs?mo:void 0!==e.maskInputOptions?e.maskInputOptions||{}:{password:!0}},Co=function(e,t){if(t=t||{},!e)return yo;if(fo.indexOf(bo(e))>=0)return null;if(function(e){if("password"===bo(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return po.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 xo(e,t)||wo(e,'[gleap-ignore="value"]')}))}(e,t))return yo;if(!function(e,t){var n=So(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[bo(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?yo:function(t){try{return n(t,e)}catch(r){return yo(t)}}},Io=function(e){return String(e).replace(/[\S]/g,"*")},Eo=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?Io:function(e,n){try{var r=t(e,n);return"string"==typeof r?r:Io(e)}catch(o){return Io(e)}}};function To(e){return To="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},To(e)}function Lo(){Lo=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",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=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 A(r||[]);return o(a,"_invoke",{value:E(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));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){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==To(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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.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 E(t,n,r){var o=p;return function(i,a){if(o===h)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 c=T(s,r);if(c){if(c===m)continue;return c}}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=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.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")),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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(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<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(To(t)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new I(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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;O(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),m}},t}function Oo(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function Ao(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Oo(i,r,o,a,s,"next",e)}function s(e){Oo(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Mo(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=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Po(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 Po(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 Po(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ro=function(e){var t="",n=window.document.doctype;if(n&&(t="<!DOCTYPE "+n.name+(n.publicId?' PUBLIC "'+n.publicId+'"':"")+(!n.publicId&&n.systemId?" SYSTEM":"")+(n.systemId?' "'+n.systemId+'"':"")+">"),e&&e.childNodes&&e.childNodes.length>0)for(var r=0;r<e.childNodes.length;r++)e.childNodes[r]&&(t+=e.childNodes[r].outerHTML);return t},No=function(e,t,n){return r=e,o=/url\((.*?)\)/g,i=function(e){return new Promise((function(r,o){if(!e)return r(e);var i=e.substr(4,e.length-5).replaceAll("'","").replaceAll('"',"");if(0===i.indexOf("http")||0===i.indexOf("//")||0===i.indexOf("data"))return r(e);try{var a=i;return t&&(a=new URL(i,t+"/").href),n?r("url("+a+")"):jo(a).then((function(e){return r("url("+e+")")}))}catch(s){return r(e)}}))},new Promise((function(e,t){var n=[];r.replace(o,(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];var a=i.apply(void 0,[e].concat(r));n.push(a)})),Promise.all(n).then((function(t){e(r.replace(o,(function(){return t.shift()})))})).catch((function(){t()}))}));var r,o,i},jo=function(e){return new Promise((function(t,n){if(e){var r=new XMLHttpRequest;r.onload=function(){var e=new FileReader;e.onloadend=function(){t(e.result)},e.onerror=function(){n()},e.readAsDataURL(r.response)},r.onerror=function(e){t()},r.open("GET",e),r.responseType="blob",r.send()}else t()}))},_o=function(e){return new Promise((function(t,n){if(e&&e.src){if(function(e){var t=["//fonts.googleapis.com","//cdn.jsdelivr.net","//cdnjs.cloudflare.com","//ajax.googleapis.com","//use.typekit.net",".amazonaws.com","//jssdk.gleap.io",".gstatic.com"];if(!e)return!1;for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n]))return!0;return!1}(e.src))return t();var r=new XMLHttpRequest;r.onload=function(){var n=new FileReader;n.onloadend=function(){!function(e,t,n,r){$(e,500,500).then((function(e){t.src=e,n()})).catch((function(){console.warn("BB: Image resize failed."),n()}))}(n.result,e,t)},n.onerror=function(){t()},n.readAsDataURL(r.response)},r.onerror=function(e){t()};var o=e.src;r.open("GET",o),r.responseType="blob",r.send()}else t()}))},Do=function(e,t,n,r){var o=null;t.ownerNode&&(o=e.querySelector('[bb-styleid="'+r+'"]'));try{if(o){var i=null;if(""!=n){var a=e.querySelector("head"),s=window.document.createElement("style");a.appendChild(s),s.type="text/css",s.styleSheet?s.styleSheet.cssText=n:s.appendChild(window.document.createTextNode(n)),i=s}else{var c=window.document.createElement("link");c.rel="stylesheet",c.type=t.type,c.href=t.href,c.media=t.media,i=c}i&&(o.parentNode.insertBefore(i,o),o.remove())}}catch(l){}},Fo=function(e){var t=null;try{e.cssRules?t=e.cssRules:e.rules&&(t=e.rules)}catch(o){}var n="";if(t)for(var r in t)t[r].cssText&&(n+=t[r].cssText+"\n");return function(e){for(var t="",n=0,r=0;r<e.length;r++)"{"===e[r]?(n++,t+=e[r]):"}"===e[r]?n>0&&(n--,t+=e[r]):t+=e[r];return t}(n)},Bo=function(e,t){for(var n,r=[],o=function(){var e=document.styleSheets[i];if(e.media&&"print"===e.media.mediaText)return 1;var o=Fo(e);if(e&&e.ownerNode)if(""!=o){var a=document.getElementsByTagName("base");n=a.length?a[0].href.substr(location.origin.length,999):window.location.href.split(/[?#]/)[0],e.href&&(n=e.href);var s=n.substring(0,n.lastIndexOf("/"));r.push(No(o,s,t).then((function(t){return{styletext:t,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}})))}else r.push(Promise.resolve({styletext:o,stylesheet:e,styleId:e.ownerNode.getAttribute("bb-styleid")}))},i=0;i<document.styleSheets.length;i++)o();return Promise.all(r).then((function(t){if(t)for(var n=0;n<t.length;n++)Do(e,t[n].stylesheet,t[n].styletext,t[n].styleId);return!0}))},Uo=function(e,t){return new Promise((function(n,r){return t?Bo(e,t).then((function(){n()})).catch((function(){n()})):function(e){for(var t=e.querySelectorAll("img"),n=[],r=0;r<t.length;r++){var o=t[r];n.push(_o(o))}return Promise.all(n)}(e).then((function(){return Bo(e,t).then((function(){n()}))})).catch((function(){console.warn("Gleap: Failed with resolving local resources. Please contact the Gleap support team."),n()}))}))},Ho=function(e,t,n){if(void 0!==e.adoptedStyleSheets)for(var r=0;r<e.adoptedStyleSheets.length;r++){var o=e.adoptedStyleSheets[r],i=Fo(o),a=window.document.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=i:a.appendChild(window.document.createTextNode(i)),n&&a.setAttribute("bb-shadow-child",n),t.insertBefore(a,t.firstElementChild)}},zo=function(e,t){try{if(!t||"function"!=typeof t.getAnimations)return e;for(var n=t.getAnimations(),r=0;r<n.length;r++){var o=n[r].effect&&n[r].effect.target;if(o){var i=e.get(o);i?i.push(n[r]):e.set(o,[n[r]])}}}catch(a){}return e},qo=function(e,t){var n=t.get(e);if(!n)return null;var r={},o=getComputedStyle(e);return n.forEach((function(e){var t,n=(null===(t=e.effect)||void 0===t?void 0:t.getKeyframes())||[],i=n[n.length-1]||{};Object.keys(i).forEach((function(e){"offset"!==e&&(r[e]=o[e])}))})),0===Object.keys(r).length?null:JSON.stringify(r)},Wo=["position","top","right","bottom","left","float","clear","margin-top","margin-right","margin-bottom","margin-left","overflow-x","overflow-y","order","align-self","justify-self","grid-row-start","grid-row-end","grid-column-start","grid-column-end","vertical-align","font-family","font-size","line-height"],Go=/^table-(row-group|header-group|footer-group|row|column-group)$/,Vo=["box-sizing","width","height","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-style","border-right-style","border-bottom-style","border-left-style"],Xo=/^(img|video|audio|canvas|iframe|embed|object|svg)$/,Jo=/^(input|select|textarea)$/,Ko=function(e,t,n){return e.setProperty(t,n,"important")},$o=function(e,t){return parseFloat(e.getPropertyValue(t))||0},Yo=function(e,t,n){Ko(e,"box-sizing","border-box"),["width","min-width","max-width"].forEach((function(n){return Ko(e,n,t+"px")})),["height","min-height","max-height"].forEach((function(t){return Ko(e,t,n+"px")}))},Zo=function(e){return"inline"===e.display&&"auto"===e.width},Qo=function(e){return"absolute"===e.position||"fixed"===e.position||"none"!==e.float},ei=function(e){return!/^(visible|clip)$/.test(e.overflowX)||!/^(visible|clip)$/.test(e.overflowY)},ti=function(e){if(e.shadowRoot)return Array.from(e.shadowRoot.childNodes);var t="function"==typeof e.assignedNodes?e.assignedNodes():[];return Array.from(t.length?t:e.childNodes)},ni=function(e){return e.assignedSlot||e.parentElement||e.parentNode&&e.parentNode.host||null},ri=function(e){var t=document.createRange();return t.selectNodeContents(e),"function"==typeof t.getClientRects?Array.from(t.getClientRects()):[]},oi=function(e,t){var n=parseFloat(t.width),r=parseFloat(t.height);if(isNaN(n)||isNaN(r)){var o=e.getBoundingClientRect();return{width:o.width,height:o.height}}return"border-box"!==t.boxSizing&&(n+=$o(t,"padding-left")+$o(t,"padding-right")+$o(t,"border-left-width")+$o(t,"border-right-width"),r+=$o(t,"padding-top")+$o(t,"padding-bottom")+$o(t,"border-top-width")+$o(t,"border-bottom-width")),{width:n,height:r}},ii=function(e,t){var n=function(e,t){return e>0&&t>0&&Math.abs(e-t)>1?e/t:1};return{x:n(e.width,t.width),y:n(e.height,t.height)}},ai=function(e){for(var t=ni(e);t;t=ni(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return ii(t.getBoundingClientRect(),oi(t,n))}return{x:1,y:1}},si=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}},ci=function(e){var t=e.createElement("span");return Ko(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return Ko(t.style,e,"0")})),t},li=function e(t,n,r){return ti(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(t);if("none"!==o.display&&!Qo(o))if("contents"===o.display||Zo(o))e(t,n,r);else{var i=si(t.getBoundingClientRect(),n),a={left:i.left-$o(o,"margin-left"),right:i.right+$o(o,"margin-right"),top:i.top-$o(o,"margin-top"),bottom:i.bottom+$o(o,"margin-bottom"),verticalAlign:o.verticalAlign};0===o.display.indexOf("inline")?("baseline"!==a.verticalAlign||Xo.test(t.localName)||(a.verticalAlign="middle"),r.atomicInlines.push(a)):r.blocks.push(a)}}})),r},ui=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;i<t.length;i++)Math.abs(r(t[i])-r(e))<Math.abs(r(t[n])-r(e))&&(n=i);var a=o[n];(!a||e.bottom-e.top>a.bottom-a.top)&&(o[n]=e)}));for(var i=0;i<t.length;i++){var a=t[i-1];a&&t[i].top>=a.top+a.height/2&&e.appendChild(e.ownerDocument.createElement("br"));var s=o[i],c=ci(e.ownerDocument);Ko(c.style,"vertical-align",s?s.verticalAlign:"baseline"),Yo(c.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(c)}},di=function e(t,n,r){ti(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(Ii(n,t.ownerDocument,!0,r))}}else!function(e,t){var n=ri(t);if(n.length){var r=ai(t),o=e.ownerDocument.createElement("span");Ko(o.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return Ko(o.style,e,"0")})),ui(o,n.map((function(e){return si(e,r)})),[]),e.appendChild(o)}}(t,n)}))},pi=function(e){return!("block"!==e.display&&"list-item"!==e.display||Qo(e)||ei(e)||/layout|paint|strict|content/.test(e.contain))},fi=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?$o(n,"top"):0),s="top"===r?a-o:a+t.offsetHeight-i;return Math.abs(s)<=1},hi=function(e,t,n,r){return r.push($o(t,"margin-"+n)),!pi(t)||$o(t,"padding-"+n)||$o(t,"border-"+n+"-width")||gi(e,ti(e),n,r),r},gi=function e(t,n,r,o){"bottom"===r&&n.reverse();for(var i=0;i<n.length;i++){var a=n[i];if(a.nodeType===Node.TEXT_NODE&&(/[^\t\n\f\r ]/.test((c=a).data)||ri(c).length>0))return!1;if(a.nodeType===Node.ELEMENT_NODE){var s=window.getComputedStyle(a);if("none"!==s.display&&!Qo(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!fi(t,a,s,r))return!1;if(hi(a,s,r,o),0!==a.getBoundingClientRect().height||!pi(s))return!1;hi(a,s,"top"===r?"bottom":"top",o)}else if(!e(t,ti(a),r,o))return!1}}var c;return!0},mi=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},vi=null,yi=new Map,bi=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return yi.has(n)||((vi=vi||document.createElement("canvas").getContext("2d")).font=n,yi.set(n,vi.measureText("").fontBoundingBoxAscent)),yi.get(n)},wi=function e(t,n,r){var o=ti(t);n&&o.reverse();for(var i=0;i<o.length;i++){var a=o[i];if(a.nodeType===Node.TEXT_NODE&&/[^\t\n\f\r ]/.test(a.data)){var s=ri(a);if(s.length)return s[n?s.length-1:0].top+bi(ni(a))*r.y}else if(a.nodeType===Node.ELEMENT_NODE){var c=window.getComputedStyle(a);if("none"===c.display||Qo(c))continue;if(Xo.test(a.localName)){if("baseline"===c.verticalAlign)return a.getBoundingClientRect().bottom+$o(c,"margin-bottom")*r.y;continue}var l=e(a,n,r);if(null!==l)return l}}return null},ki=function(e,t){if("table-cell"===t.display)return"baseline"===t.verticalAlign?"first":null;var n=function(e){for(var t=ni(e);t&&"contents"===window.getComputedStyle(t).display;)t=ni(t);return t}(e),r=n&&window.getComputedStyle(n);if(r&&/flex|grid/.test(r.display)&&!Qo(t)){var o=/^(auto|normal)$/.test(t.alignSelf)?r.alignItems:t.alignSelf;return/baseline/.test(o)?/last/.test(o)?"last":"first":null}return 0!==t.display.indexOf("inline-")||/^(top|bottom|middle|text-top|text-bottom)$/.test(t.verticalAlign)||Xo.test(e.localName)||Jo.test(e.localName)?null:"inline-block"===t.display&&"button"!==e.localName?ei(t)?null:"last":"first"},xi=function(e,t,n){Ko(e.style,"font-size","0"),Ko(e.style,"line-height","0");var r=ci(e.ownerDocument);Ko(r.style,"vertical-align",t-n+"px"),Yo(r.style,0,n),e.appendChild(r)},Si=function(e,t,n){var r=e.style,o=n.display,i="table-cell"===o,a=oi(t,n);Ko(r,"display","inline"===o?"inline-block":o),i?Vo.forEach((function(e){return Ko(r,e,n.getPropertyValue(e))})):(Yo(r,a.width,a.height),Ko(r,"padding","0"),Ko(r,"border-width","0"),Ko(r,"margin-top",mi(hi(t,n,"top",[]))+"px"),Ko(r,"margin-bottom",mi(hi(t,n,"bottom",[]))+"px"));var s=ki(t,n);if(s){var c=t.getBoundingClientRect(),l=ii(c,{width:t.offsetWidth,height:t.offsetHeight}),u=wi(t,"last"===s,l);if(null!==u&&!isNaN(u)){var d=(u-c.top)/l.y;if(i){var p=d-t.clientTop-$o(n,"padding-top");xi(e,p,p)}else Ko(r,"display","inline-block"),xi(e,d,a.height)}}},Ci=function(e,t){var n=e.style,r=ai(t),o=li(t,r,{blocks:[],atomicInlines:[]});if(o.blocks.length){var i=o.blocks.reduce((function(e,t){return{left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom)}}));return Ko(n,"display","block"),Ko(n,"margin-top","0"),Ko(n,"margin-bottom","0"),void Yo(n,i.right-i.left,i.bottom-i.top)}Ko(n,"display","inline"),Ko(n,"padding","0"),Ko(n,"border-width","0");var a=["before","after"].filter((function(e){var n=window.getComputedStyle(t,"::"+e);return!/^(none|normal|)$/.test(n.content)&&"none"!==n.display&&!Qo(n)}));if(a.length){e.setAttribute("bb-no-content",a.join(" "));var s=e.ownerDocument.createElement("style");s.textContent=a.map((function(e){return"[bb-no-content~=".concat(e,"]::").concat(e,"{content:none!important}")})).join(""),e.appendChild(s)}ui(e,Array.from(t.getClientRects(),(function(e){return si(e,r)})),o.atomicInlines)},Ii=function(e,t,n,r){var o=t.createElementNS(e.namespaceURI,e.localName);if(!n&&e.hasAttribute("class")&&o.setAttribute("class",e.getAttribute("class")),function(e,t){e instanceof HTMLTableCellElement?[["colspan","colSpan"],["rowspan","rowSpan"]].forEach((function(n){var r=Mo(n,2),o=r[0],i=r[1];e.hasAttribute(o)&&t.setAttribute(o,e[i])})):e instanceof HTMLTableColElement&&e.hasAttribute("span")?t.setAttribute("span",e.span):e instanceof HTMLLIElement&&e.hasAttribute("value")&&t.setAttribute("value",e.value)}(e,o),!o.style||/^(br|wbr)$/.test(e.localName))return o;try{var i=window.getComputedStyle(e),a=o.style,s=i.display;if(r&&/^table-/.test(s))return function(e,t,n){if("table-cell"===n.display){var r=e.style;r.setProperty("vertical-align","top"),Vo.forEach((function(e){return r.setProperty(e,n.getPropertyValue(e))}))}else Go.test(n.display)&&di(e,t,!0)}(o,e,i),o;Wo.forEach((function(e){return Ko(a,e,i.getPropertyValue(e))})),Ko(a,"visibility","hidden"),"none"===s||"contents"===s||Go.test(s)?(Ko(a,"display",s),"none"!==s&&di(o,e,"contents"!==s)):e instanceof HTMLElement&&Zo(i)?Ci(o,e):Si(o,e,i)}catch(c){}return o},Ei=function(){var e=Ao(Lo().mark((function e(t,n){var r,o,i,a,s,c,l;return Lo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=1,o=zo(new Map,window.document),i=Eo(n),a=null,s=function(){var e=Ao(Lo().mark((function e(t,c,l,u){var d,p,f,h,g,m,v,y,b,w,k,x,S,C;return Lo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((d=t.nodeType==Node.ELEMENT_NODE)&&(I=t,E=n,E=E||{},wo(I,".rr-block, .gl-block")||ko(I,E.blockClass)||wo(I,E.blockSelector)))){e.next=7;break}return a=a||document.implementation.createHTMLDocument(""),p=Ii(t,a),l&&p.setAttribute("bb-shadow-child",l),c.appendChild(p),e.abrupt("return");case 7:if(!u||t.nodeType!=Node.COMMENT_NODE){e.next=9;break}return e.abrupt("return");case 9:if(f=u||d&&xo(t,n),h=function(){var e=Ao(Lo().mark((function e(t,n,r){return Lo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=11;break}return e.prev=1,e.next=4,s(t,n,r,f);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:t=!t.nextElementSibling||t.nextElementSibling.nextSibling!==t.nextSibling&&null!==t.nextSibling?t.nextSibling:t.nextElementSibling,e.next=0;break;case 11:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t,n,r){return e.apply(this,arguments)}}(),g=t.cloneNode(),m=t.tagName?t.tagName.toUpperCase():t.tagName,v=null,u&&t.nodeType==Node.TEXT_NODE&&"STYLE"!==t.parentNode.nodeName.toUpperCase()&&(g.data=i(t.data,t.parentElement)),null!=(y=qo(t,o))&&g.setAttribute("bb-web-animations",y),void 0===g.setAttribute){e.next=33;break}if(l&&g.setAttribute("bb-shadow-child",l),!(t instanceof HTMLCanvasElement)){e.next=33;break}return e.prev=20,b=t.getBoundingClientRect(),e.next=24,$(t.toDataURL(),1400,1400);case 24:w=e.sent,g.setAttribute("bb-canvas-data",w),g.setAttribute("bb-canvas-height",b.height),g.setAttribute("bb-canvas-width",b.width),e.next=33;break;case 30:e.prev=30,e.t0=e.catch(20),console.warn("Gleap: Failed to clone canvas data.",e.t0);case 33:if(d&&("IFRAME"!=m&&"VIDEO"!=m&&"EMBED"!=m&&"IMG"!=m&&"SVG"!=m||(k=t.getBoundingClientRect(),g.setAttribute("bb-element",!0),g.setAttribute("bb-height",k.height),g.setAttribute("bb-width",k.width)),(t.scrollTop>0||t.scrollLeft>0)&&(g.setAttribute("bb-scrollpos",!0),g.setAttribute("bb-scrolltop",t.scrollTop),g.setAttribute("bb-scrollleft",t.scrollLeft)),"SELECT"!==m&&"TEXTAREA"!==m&&"INPUT"!==m||(v=Co(t,n),g.setAttribute("bb-data-value",v?v(t.value):t.value),v&&g.hasAttribute("value")&&g.setAttribute("value",v(g.getAttribute("value"))),"checkbox"!==t.type&&"radio"!==t.type||!t.checked||g.setAttribute("bb-data-checked",!0))),c.appendChild(g),!t.shadowRoot){e.next=43;break}return x=r,r++,zo(o,t.shadowRoot),e.next=41,h(t.shadowRoot.firstChild,g,x);case 41:Ho(t.shadowRoot,g,x),void 0!==g.setAttribute&&g.setAttribute("bb-shadow-parent",x);case 43:if(v&&"TEXTAREA"===m){e.next=46;break}return e.next=46,h(t.firstChild,g);case 46:if(v&&"SELECT"===m)for(S=g.querySelectorAll("option[selected]"),C=0;C<S.length;C++)S[C].removeAttribute("selected");case 47:case"end":return e.stop()}var I,E}),e,null,[[20,30]])})));return function(t,n,r,o){return e.apply(this,arguments)}}(),c=document.createDocumentFragment(),e.next=8,s(t,c);case 8:return(l=c.querySelector("head"))||(l=c),Ho(window.document,l),e.abrupt("return",c);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Ti=function(e){for(var t=[{selector:"button button",role:"button"},{selector:"a a",role:"link"},{selector:"form form",role:null}],n=0;n<t.length;n++)for(var r=e.querySelectorAll(t[n].selector),o=0;o<r.length;o++){var i=r[o];try{if(i.namespaceURI&&"http://www.w3.org/1999/xhtml"!==i.namespaceURI)continue;for(var a=window.document.createElement("div"),s=0;s<i.attributes.length;s++)a.setAttribute(i.attributes[s].name,i.attributes[s].value);for(t[n].role&&!a.hasAttribute("role")&&a.setAttribute("role",t[n].role),a.setAttribute("bb-nested-"+i.tagName.toLowerCase(),"true");i.firstChild;)a.appendChild(i.firstChild);i.parentNode.replaceChild(a,i)}catch(c){}}},Li=function(e,t){return new Promise(function(){var n=Ao(Lo().mark((function n(r,o){var i,a,s,c,l,u,d,p,f,h,g,m,v,y,b;return Lo().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:for(n.prev=0,i=window.document.querySelectorAll("style, link"),a=0;a<i.length;++a)i[a].setAttribute("bb-styleid",a);return n.next=5,Ei(window.document.documentElement,t);case 5:s=n.sent;try{Ti(s)}catch(o){}for(c=s.querySelectorAll("link[rel=import]"),a=0;a<c.length;++a)if((l=c[a])&&l.childNodes&&l.childNodes.length>0){for(u=l.childNodes;u.length>0;)l.parentNode.insertBefore(u[0],l);l.remove()}for(d=s.querySelectorAll("script, noscript"),a=0;a<d.length;++a)d[a].remove();for(p="",f=s.querySelectorAll("base"),a=0;a<f.length;++a)f[a].href&&(p=f[a].href),f[a].remove();for(h=window.location.href.substring(0,window.location.href.lastIndexOf("/")),g=h+"/",p&&(p.startsWith("http")?g=p:(g=h+p).endsWith("/")||(g+="/")),(m=window.document.createElement("base")).href=g,(v=s.querySelector("head")).insertBefore(m,v.firstChild),y=s.querySelectorAll(".bb-feedback-dialog-container, .bb-capture-editor-borderlayer"),a=0;a<y.length;++a)y[a].remove();for(b=s.querySelectorAll("[bb-element=true]"),a=0;a<b.length;++a)b[a]&&(b[a].style.height=b[a].getAttribute("bb-height")+"px");Uo(s,e).then((function(){var e=Ro(s);r({html:e,baseUrl:h,width:window.innerWidth,height:window.innerHeight,isMobile:Q()})})),n.next=32;break;case 28:n.prev=28,n.t0=n.catch(0),console.warn("Gleap: Failed to capture screenshot",n.t0),r(null);case 32:case"end":return n.stop()}}),n,null,[[0,28]])})));return function(e,t){return n.apply(this,arguments)}}())};const Oi=Math.min,Ai=Math.max,Mi=Math.round,Pi=Math.floor,Ri=e=>({x:e,y:e}),Ni={left:"right",right:"left",bottom:"top",top:"bottom"},ji={start:"end",end:"start"};function _i(e,t,n){return Ai(e,Oi(t,n))}function Di(e,t){return"function"==typeof e?e(t):e}function Fi(e){return e.split("-")[0]}function Bi(e){return e.split("-")[1]}function Ui(e){return"x"===e?"y":"x"}function Hi(e){return"y"===e?"height":"width"}const zi=new Set(["top","bottom"]);function qi(e){return zi.has(Fi(e))?"y":"x"}function Wi(e){return Ui(qi(e))}function Gi(e){return e.replace(/start|end/g,(e=>ji[e]))}const Vi=["left","right"],Xi=["right","left"],Ji=["top","bottom"],Ki=["bottom","top"];function $i(e,t,n,r){const o=Bi(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Xi:Vi:t?Vi:Xi;case"left":case"right":return t?Ji:Ki;default:return[]}}(Fi(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Gi)))),i}function Yi(e){return e.replace(/left|right|bottom|top/g,(e=>Ni[e]))}function Zi(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 Qi(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 ea(e,t,n){let{reference:r,floating:o}=e;const i=qi(t),a=Wi(t),s=Hi(a),c=Fi(t),l="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 f;switch(c){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Bi(t)){case"start":f[a]-=p*(n&&l?-1:1);break;case"end":f[a]+=p*(n&&l?-1:1)}return f}async function ta(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Di(t,e),h=Zi(f),g=s[p?"floating"===d?"reference":"floating":d],m=Qi(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:l,rootBoundary:u,strategy:c})),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=Qi(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}const na=new Set(["left","top"]);function ra(){return"undefined"!=typeof window}function oa(e){return sa(e)?(e.nodeName||"").toLowerCase():"#document"}function ia(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function aa(e){var t;return null==(t=(sa(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function sa(e){return!!ra()&&(e instanceof Node||e instanceof ia(e).Node)}function ca(e){return!!ra()&&(e instanceof Element||e instanceof ia(e).Element)}function la(e){return!!ra()&&(e instanceof HTMLElement||e instanceof ia(e).HTMLElement)}function ua(e){return!(!ra()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ia(e).ShadowRoot)}const da=new Set(["inline","contents"]);function pa(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ca(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!da.has(o)}const fa=new Set(["table","td","th"]);function ha(e){return fa.has(oa(e))}const ga=[":popover-open",":modal"];function ma(e){return ga.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const va=["transform","translate","scale","rotate","perspective"],ya=["transform","translate","scale","rotate","perspective","filter"],ba=["paint","layout","strict","content"];function wa(e){const t=ka(),n=ca(e)?Ca(e):e;return va.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ya.some((e=>(n.willChange||"").includes(e)))||ba.some((e=>(n.contain||"").includes(e)))}function ka(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const xa=new Set(["html","body","#document"]);function Sa(e){return xa.has(oa(e))}function Ca(e){return ia(e).getComputedStyle(e)}function Ia(e){return ca(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ea(e){if("html"===oa(e))return e;const t=e.assignedSlot||e.parentNode||ua(e)&&e.host||aa(e);return ua(t)?t.host:t}function Ta(e){const t=Ea(e);return Sa(t)?e.ownerDocument?e.ownerDocument.body:e.body:la(t)&&pa(t)?t:Ta(t)}function La(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ta(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=ia(o);if(i){const e=Oa(a);return t.concat(a,a.visualViewport||[],pa(o)?o:[],e&&n?La(e):[])}return t.concat(o,La(o,[],n))}function Oa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Aa(e){const t=Ca(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=la(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Mi(n)!==i||Mi(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Ma(e){return ca(e)?e:e.contextElement}function Pa(e){const t=Ma(e);if(!la(t))return Ri(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Aa(t);let a=(i?Mi(n.width):n.width)/r,s=(i?Mi(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ra=Ri(0);function Na(e){const t=ia(e);return ka()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ra}function ja(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ma(e);let a=Ri(1);t&&(r?ca(r)&&(a=Pa(r)):a=Pa(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ia(e))&&t}(i,n,r)?Na(i):Ri(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=ia(i),t=r&&ca(r)?ia(r):r;let n=e,o=Oa(n);for(;o&&r&&t!==n;){const e=Pa(o),t=o.getBoundingClientRect(),r=Ca(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=i,l+=a,n=ia(o),o=Oa(n)}}return Qi({width:u,height:d,x:c,y:l})}function _a(e,t){const n=Ia(e).scrollLeft;return t?t.left+n:ja(aa(e)).left+n}function Da(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-_a(e,n),y:n.top+t.scrollTop}}const Fa=25;const Ba=new Set(["absolute","fixed"]);function Ua(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ia(e),r=aa(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const e=ka();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=_a(r);if(l<=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<=Fa&&(i-=a)}else l<=Fa&&(i+=l);return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=aa(e),n=Ia(e),r=e.ownerDocument.body,o=Ai(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ai(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+_a(e);const s=-n.scrollTop;return"rtl"===Ca(r).direction&&(a+=Ai(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(aa(e));else if(ca(t))r=function(e,t){const n=ja(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=la(e)?Pa(e):Ri(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=Na(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Qi(r)}function Ha(e,t){const n=Ea(e);return!(n===t||!ca(n)||Sa(n))&&("fixed"===Ca(n).position||Ha(n,t))}function za(e,t,n){const r=la(t),o=aa(t),i="fixed"===n,a=ja(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Ri(0);function l(){c.x=_a(o)}if(r||!r&&!i)if(("body"!==oa(t)||pa(o))&&(s=Ia(t)),r){const e=ja(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const u=!o||r||i?Ri(0):Da(o,s);return{x:a.left+s.scrollLeft-c.x-u.x,y:a.top+s.scrollTop-c.y-u.y,width:a.width,height:a.height}}function qa(e){return"static"===Ca(e).position}function Wa(e,t){if(!la(e)||"fixed"===Ca(e).position)return null;if(t)return t(e);let n=e.offsetParent;return aa(e)===n&&(n=n.ownerDocument.body),n}function Ga(e,t){const n=ia(e);if(ma(e))return n;if(!la(e)){let t=Ea(e);for(;t&&!Sa(t);){if(ca(t)&&!qa(t))return t;t=Ea(t)}return n}let r=Wa(e,t);for(;r&&ha(r)&&qa(r);)r=Wa(r,t);return r&&Sa(r)&&qa(r)&&!wa(r)?n:r||function(e){let t=Ea(e);for(;la(t)&&!Sa(t);){if(wa(t))return t;if(ma(t))return null;t=Ea(t)}return null}(e)||n}const Va={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=aa(r),s=!!t&&ma(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Ri(1);const u=Ri(0),d=la(r);if((d||!d&&!i)&&(("body"!==oa(r)||pa(a))&&(c=Ia(r)),la(r))){const e=ja(r);l=Pa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?Ri(0):Da(a,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:aa,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ma(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=La(e,[],!1).filter((e=>ca(e)&&"body"!==oa(e))),o=null;const i="fixed"===Ca(e).position;let a=i?Ea(e):e;for(;ca(a)&&!Sa(a);){const t=Ca(a),n=wa(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Ba.has(o.position)||pa(a)&&!n&&Ha(e,a))?r=r.filter((e=>e!==a)):o=t,a=Ea(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce(((e,n)=>{const r=Ua(t,n,o);return e.top=Ai(r.top,e.top),e.right=Oi(r.right,e.right),e.bottom=Oi(r.bottom,e.bottom),e.left=Ai(r.left,e.left),e}),Ua(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ga,getElementRects:async function(e){const t=this.getOffsetParent||Ga,n=this.getDimensions,r=await n(e.floating);return{reference:za(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}=Aa(e);return{width:t,height:n}},getScale:Pa,isElement:ca,isRTL:function(e){return"rtl"===Ca(e).direction}};function Xa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ja(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:c=!1}=r,l=Ma(e),u=o||i?[...l?La(l):[],...La(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=l&&s?function(e,t){let n,r=null;const o=aa(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=l;if(s||t(),!p||!f)return;const h={rootMargin:-Pi(d)+"px "+-Pi(o.clientWidth-(u+p))+"px "+-Pi(o.clientHeight-(d+f))+"px "+-Pi(u)+"px",threshold:Ai(0,Oi(1,c))||1};let g=!0;function m(t){const r=t[0].intersectionRatio;if(r!==c){if(!g)return a();r?a(!1,r):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==r||Xa(l,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(l,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),l&&!c&&h.observe(l),h.observe(t));let g=c?ja(e):null;return c&&function t(){const r=ja(e);g&&!Xa(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=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Ka=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,c=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=Fi(n),s=Bi(n),c="y"===qi(n),l=na.has(a)?-1:1,u=i&&c?-1:1,d=Di(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),c?{x:f*u,y:p*l}:{x:p*l,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},$a=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:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Di(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),p=qi(Fi(o)),f=Ui(p);let h=u[f],g=u[p];if(a){const e="y"===f?"bottom":"right";h=_i(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";g=_i(g+d["y"===p?"top":"left"],g,g-d[e])}const m=c.fn({...t,[f]:h,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[p]:s}}}}}},Ya=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:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=Di(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Fi(o),y=qi(s),b=Fi(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),k=p||(b||!g?[Yi(s)]:function(e){const t=Yi(e);return[Gi(e),t,Gi(t)]}(s)),x="none"!==h;!p&&x&&k.push(...$i(s,g,h,w));const S=[s,...k],C=await c.detectOverflow(t,m),I=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&I.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Bi(e),o=Wi(e),i=Hi(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Yi(a)),[a,Yi(a)]}(o,a,w);I.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:o,overflows:I}],!I.every((e=>e<=0))){var T,L;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&y!==qi(t))||E.every((e=>qi(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}}}let n=null==(L=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:L.placement;if(!n)switch(f){case"bestFit":{var O;const e=null==(O=E.filter((e=>{if(x){const t=qi(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:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Za=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Di(e,t)||{};if(null==l)return{};const d=Zi(u),p={x:n,y:r},f=Wi(o),h=Hi(f),g=await a.getDimensions(l),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],k=p[f]-i.reference[f],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let S=x?x[b]:0;S&&await(null==a.isElement?void 0:a.isElement(x))||(S=s.floating[b]||i.floating[h]);const C=w/2-k/2,I=S/2-g[h]/2-1,E=Oi(d[v],I),T=Oi(d[y],I),L=E,O=S-g[h]-T,A=S/2-g[h]/2+C,M=_i(L,A,O),P=!c.arrow&&null!=Bi(o)&&A!==M&&i.reference[h]/2-(A<L?E:T)-g[h]/2<0,R=P?A<L?A-L:A-O:0;return{[f]:p[f]+R,data:{[f]:M,centerOffset:A-M-R,...P&&{alignmentOffset:R}},reset:P}}}),Qa=(e,t,n)=>{const r=new Map,o={platform:Va,...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),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ea(l,r,c),p=r,f={},h=0;for(let m=0;m<s.length;m++){var g;const{name:n,fn:i}=s[m],{x:v,y,data:b,reset:w}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:l,platform:{...a,detectOverflow:null!=(g=a.detectOverflow)?g:ta},elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,f={...f,[n]:{...f[n],...b}},w&&h<=50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(l=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:d}=ea(l,p,c))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};var es=function(e,t,n){if(!e||!t||!n)return!0;var r=function(e){return e.replace(/\/$/,"")},o=function(e,t){if(!e||!t)return!1;try{if(e.includes(t))return!0}catch(r){}var n=function(e){if(!e)return null;try{e.startsWith("/")&&(e=e.substring(1));var t=e.replace(/{\w+}/g,"___PLACEHOLDER___");return t=(t=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/___PLACEHOLDER___/g,"[^&?]+"),new RegExp(t,"i")}catch(r){return null}}(t);if(!n)return!1;try{return n.test(e)}catch(r){return!1}},i=!1;switch(n){case"is":i=r(e)===r(t);break;case"isnot":i=r(e)!==r(t);break;case"contains":i=o(e,t);break;case"startswith":i=e.startsWith(t);break;case"endswith":i=e.endsWith(t);break;case"notcontains":i=!o(e,t);break;default:i=!1}return i},ts=["notcontains","isnot"],ns=function(e){return Boolean(e&&e.pageFilter&&e.pageFilter.length>0)},rs=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(ns);if(0===n.length)return!0;var r=n.filter((function(e){return!ts.includes(e.pageFilterType)})),o=n.filter((function(e){return ts.includes(e.pageFilterType)})),i=0===r.length||r.some((function(t){return es(e,t.pageFilter,t.pageFilterType)})),a=0===o.length||o.every((function(t){return es(e,t.pageFilter,t.pageFilterType)}));return i&&a};function os(e){return os="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},os(e)}function is(e){return function(e){if(Array.isArray(e))return as(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 as(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 as(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 as(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ss(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ls(r.key),r)}}function cs(e,t,n){return(t=ls(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ls(e){var t=function(e,t){if("object"!=os(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=os(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==os(t)?t:String(t)}var us=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),cs(this,"tooltips",[]),cs(this,"filteredTooltips",[]),cs(this,"lastUrl",null),cs(this,"elementToFloatingUIMap",new WeakMap),cs(this,"elementToTooltipMap",new WeakMap),cs(this,"nextId",0),cs(this,"linkTooltip",(function(e,n){if(!e.hasAttribute("data-gleap-tooltip")){var r=t.nextId++;if(e.setAttribute("data-gleap-tooltip",r),e){var o=null;if("hotspot"===n.mode){var i=document.createElement("div");i.setAttribute("data-gleap-tooltip-anchor",r),i.classList.add("gleap-tooltip-anchor"),e.setAttribute("data-gleap-tooltip-mode","hotspot"),t.canEmbed(e)?e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i):e.parentNode.insertBefore(i,e.nextSibling);var a=document.createElement("div");a.classList.add("gleap-tooltip-hotspot"),a.setAttribute("data-gleap-tooltip-hotspot",r),a.innerHTML="".concat(fe(n.icon,n.color)).concat(n.animated?'<div style="background-color: '.concat(n.color,'" class="gleap-tooltip-hotspot-animation"></div>'):""),i.appendChild(a),t.repositionHotspot(e,n),o=a,t.elementToTooltipMap.set(e,n)}else o=e;var s=t.createTooltip(o,n.html,n);t.elementToFloatingUIMap.set(e,s)}}})),cs(this,"updateFilteredTooltips",(function(){t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),cs(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?rs(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!es(e,t.page,t.pageType)}))})),cs(this,"checkForTooltips",(function(){for(var e=0;e<t.filteredTooltips.length;e++){var n=t.filteredTooltips[e];try{for(var r=document.querySelectorAll(n.selector),o=0;o<r.length;o++){var i=r[o];i&&t.linkTooltip(i,n)}}catch(a){}}})),cs(this,"load",(function(){var e=t,n=vs.getInstance(),r=new XMLHttpRequest;r.open("GET",n.apiUrl+"/config/"+n.sdkKey+"/tooltips"),r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.setRequestHeader("Api-Token",n.sdkKey);try{r.setRequestHeader("Gleap-Id",n.session.gleapId),r.setRequestHeader("Gleap-Hash",n.session.gleapHash)}catch(o){}r.onerror=function(){console.error("Failed to fetch tooltips")},r.onreadystatechange=function(t){if(4===r.readyState&&200===r.status)try{e.tooltips=JSON.parse(r.responseText),e.updateFilteredTooltips()}catch(o){console.error("Failed to parse tooltips",o)}},r.send()}))}var t,n,r;return t=e,n=[{key:"processNodeInsertion",value:function(e){var t=this;e.nodeType===Node.ELEMENT_NODE&&(this.checkNodeTooltip(e),e.childNodes&&e.childNodes.forEach((function(e){t.processNodeInsertion(e)})))}},{key:"checkNodeTooltip",value:function(e){var t=this;this.filteredTooltips.length>0&&this.filteredTooltips.forEach((function(n){n.selector&&e.matches(n.selector)&&t.linkTooltip(e,n)}))}},{key:"start",value:function(){var e=this,t=this;if(window){var n,r,o,i=(n=t.updateHotspotPositions.bind(t),r=250,o=null,function(){if(!o){var e=this,t=arguments;o=setTimeout((function(){n.call.apply(n,[e].concat(is(t))),o=null}),r)}});window.addEventListener("resize",i),window.requestAnimationFrame((function(){e.observer=new MutationObserver((function(n){t.lastUrl!==window.location.href&&(t.lastUrl=window.location.href,t.filteredTooltips=t.getFilteredTooltips()),n.forEach((function(n){if("attributes"===n.type){var r=n.target;r.nodeType===Node.ELEMENT_NODE&&(r.querySelector("[data-gleap-tooltip-hotspot]")||r.hasAttribute("data-gleap-tooltip-mode")||r.hasAttribute("data-gleap-tooltip"))&&t.updateHotspotPositions()}n.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t.processNodeInsertion(e)})),n.removedNodes.forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE&&e.elementToFloatingUIMap.has(t)){var n=e.elementToFloatingUIMap.get(t);n&&(n.tooltip&&n.tooltip.remove(),n.cleanup(),e.elementToFloatingUIMap.delete(t))}e.elementToTooltipMap.has(t)&&e.elementToTooltipMap.delete(t)}))}))})),e.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})}))}}},{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='<div class="gleap-tooltip-inner">\n '.concat(t,'\n <div class="gleap-tooltip-arrow">\n <svg width="116" height="56" viewBox="0 0 116 56" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M57.75 0.74998L115.5 0.680177L66.8726 49.3076C61.7958 54.3844 53.5646 54.3844 48.4878 49.3076L4.05618e-05 0.819784L57.75 0.74998Z" fill="white"/>\n </svg>\n </div>\n </div>'),document.body.appendChild(r);var o,i=r.querySelector(".gleap-tooltip-arrow"),a=Ja(e,r,(function(){Qa(e,r,{placement:"left"===n.posX?"left":"right",middleware:[Ka(10),Ya(),$a(),Za({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(c){}}))}));function s(){clearTimeout(o),r.style.visibility="visible",r.style.opacity="1",r.style.pointerEvents="auto"}function c(){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",c),r.addEventListener("mouseenter",s),r.addEventListener("mouseleave",c),e.addEventListener("click",c),r.addEventListener("click",c),{cleanup:a,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(){this.observer&&(this.observer.disconnect(),this.observer=null),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),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.tooltips=[],this.filteredTooltips=[]}},{key:"repositionHotspot",value:function(e,t){if(e&&t){var n=e.getAttribute("data-gleap-tooltip");if(n){var r=document.querySelector('[data-gleap-tooltip-hotspot="'.concat(n,'"]'));if(r){t.posX||(t.posX="right"),t.posY||(t.posY="center"),t.offsetX||(t.offsetX=4),t.offsetY||(t.offsetY=0);var o=e.getBoundingClientRect();try{var i=document.createRange();i.selectNodeContents(e);var a=window.getComputedStyle(e),s=i.getBoundingClientRect().width+parseFloat(a.paddingLeft);s<o.width&&(o.width=s)}catch(f){}var c=document.querySelector('[data-gleap-tooltip-anchor="'.concat(n,'"]')).getBoundingClientRect(),l=c.left-o.left,u=c.top-o.top,d=0,p=0;switch(t.posX){case"left":p=-1*(t.offsetX+17);break;case"right":p=o.width+t.offsetX}switch(t.posY){case"top":d=0+t.offsetY;break;case"bottom":d=o.height-17+t.offsetY;break;case"center":d=o.height/2-8.5+t.offsetY}r&&(r.style.position="absolute",r.style.top=d-u+"px",r.style.left=p-l+"px")}}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e,this.instance.start()),this.instance}}],n&&ss(t.prototype,n),r&&ss(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ds(e){return ds="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},ds(e)}function ps(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 fs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ps(Object(n),!0).forEach((function(t){gs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ps(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ms(r.key),r)}}function gs(e,t,n){return(t=ms(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ms(e){var t=function(e,t){if("object"!=ds(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ds(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ds(t)?t:String(t)}cs(us,"instance",void 0);var vs=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),gs(this,"region",kt),gs(this,"apiUrl",wt[kt].apiUrl),gs(this,"wsApiUrl",wt[kt].wsApiUrl),gs(this,"realtimeHost",void 0),gs(this,"sdkKey",null),gs(this,"updatingSession",!1),gs(this,"fileRefreshTimeout",null),gs(this,"useCookies",!0),gs(this,"localStorageDisabled",!1),gs(this,"session",{gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0}),gs(this,"ready",!1),gs(this,"onSessionReadyListener",[]),gs(this,"lastIdentify",null),gs(this,"identifyInFlight",!1),gs(this,"setOnSessionReady",(function(e){t.ready?e():t.onSessionReadyListener.push(e)})),gs(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))})),gs(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&&Ft.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash));try{ae("session-".concat(t.sdkKey),null)}catch(a){}if(t.useCookies)try{!function(e){try{var t=oe(window.location.host.split(":")[0]);document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT; Domain="+t}catch(a){}}("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,zs.getInstance().sendMessage({name:"session-cleared"},!0),bl.getInstance().clearAllNotifications(!1),bl.getInstance().setNotificationCount(0),Wn.getInstance().removeBannerUI(),gc.getInstance().hideModal(),r&&t.scheduleSessionRetry(n)})),gs(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)}})),gs(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=zs.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()}})),gs(this,"validateSession",(function(e){var n,r,o,i,a,s;if(e&&e.gleapId){!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=fs(fs({},e),{},{fileAccessToken:t.session.fileAccessToken,fileAccessExpiresAt:t.session.fileAccessExpiresAt}));var c=!1;if((null===(o=t.session)||void 0===o?void 0:o.gleapId)!==(null===(i=e)||void 0===i?void 0:i.gleapId)&&(c=!0),t.session&&t.session.gleapHash&&Ft.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),t.localStorageDisabled||ae("session-".concat(t.sdkKey),e),t.useCookies&&function(e,t,n){try{var r="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r="; expires="+o.toUTCString()}var i=oe(window.location.host.split(":")[0]);document.cookie=e+"="+(t||"")+r+"; path=/; domain="+i}catch(a){}}("session-".concat(t.sdkKey),encodeURIComponent(JSON.stringify(e)),365),t.session=e,t.ready=!0,e.fileAccessToken&&t.openRequestedProtectedFile(),clearTimeout(t.fileRefreshTimeout),e.fileAccessToken&&null!==(a=t.lastIdentify)&&void 0!==a&&a.userHash&&(t.fileRefreshTimeout=setTimeout((function(){if(t.lastIdentify){var e,n,r=t.lastIdentify,o=r.userId,i=r.userData,a=r.userHash;null===(e=t.identifySession(o,i,a,!0))||void 0===e||null===(n=e.catch)||void 0===n||n.call(e,(function(){}))}}),Math.max(0,Date.parse(e.fileAccessExpiresAt)-Date.now()-3e5))),t.session&&t.session.gleapHash&&Ft.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),c&&(setTimeout((function(){A.getInstance().clearCache(),x.getInstance().clearCache(),Mf.getInstance().restart();var e=us.getInstance();if(e){try{e.destroy()}catch(t){}e.load()}}),0),"function"==typeof window.dispatchEvent&&window.dispatchEvent(new CustomEvent("session-updated"))),t.notifySessionReady(),c&&t.replayIdentifyIfNeeded(),e.authenticatedFilesRequired&&!e.fileAccessToken&&null!==(s=t.lastIdentify)&&void 0!==s&&s.userHash&&!t.identifyInFlight){var l,u,d=t.lastIdentify,p=d.userId,f=d.userData,h=d.userHash;null===(l=t.identifySession(p,f,h,!0))||void 0===l||null===(u=l.catch)||void 0===u||u.call(l,(function(){}))}}})),gs(this,"replayIdentifyIfNeeded",(function(){try{if(!t.lastIdentify||!t.lastIdentify.userId)return;if(t.identifyInFlight)return;if(t.session&&t.session.userId)return;var e=t.lastIdentify,n=e.userId,r=e.userData,o=e.userHash,i=t.identifySession(n,r,o);i&&"function"==typeof i.catch&&i.catch((function(){}))}catch(a){}})),gs(this,"startSession",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{if(t.useCookies){var n=function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}}catch(i){}return null}("session-".concat(t.sdkKey));if(n){var r=JSON.parse(decodeURIComponent(n));t.validateSession(r)}}}catch(s){}if(!(t.localStorageDisabled||t.session&&t.session.gleapId&&t.session.gleapId.length>0)){var o=ie("session-".concat(t.sdkKey));o&&t.validateSession(o)}var i=t,a=new XMLHttpRequest;a.open("POST",i.apiUrl+"/sessions"),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.setRequestHeader("Api-Token",i.sdkKey);try{t.session&&t.session.gleapId&&t.session.gleapHash&&(a.setRequestHeader("Gleap-Id",t.session.gleapId),a.setRequestHeader("Gleap-Hash",t.session.gleapHash))}catch(s){}a.onreadystatechange=function(t){if(4===a.readyState)if(200===a.status||201===a.status)try{var n=JSON.parse(a.responseText);i.validateSession(n)}catch(s){}else 429!==a.status&&(!(a.status>=400&&a.status<500)&&i.session&&i.session.gleapId?i.scheduleSessionRetry(e):i.clearSession(e,!0))},a.send(JSON.stringify({lang:Vf.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))})),gs(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)})),gs(this,"checkIfSessionDataNeedsUpdate",(function(e){if(e)for(var n=Object.keys(e),r=0;r<n.length;r++){var o=n[r];if(JSON.stringify(t.session[o])!==JSON.stringify(e[o])&&(!t.session.customData||JSON.stringify(t.session.customData[o])!==JSON.stringify(e[o])))return!0}return!1})),gs(this,"updateSession",(function(e){if(t.checkIfSessionDataNeedsUpdate(e)){var n=t;return new Promise((function(r,o){t.setOnSessionReady((function(){if(!n.session.gleapId||!n.session.gleapHash)return o("Session not ready yet.");var t=new XMLHttpRequest;t.open("POST",n.apiUrl+"/sessions/partialupdate"),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)}catch(i){}t.onerror=function(){o()},t.onreadystatechange=function(e){if(4===t.readyState)if(200===t.status||201===t.status)try{var a=JSON.parse(t.responseText);n.validateSession(a),r(a)}catch(i){o(i)}else o()},t.send(JSON.stringify({data:fs(fs({},e),{},{lang:Vf.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}),type:"js",sdkVersion:"19.0.0",ws:!0}))}))}))}})),gs(this,"identifySession",(function(e,n,r){var o,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.lastIdentify={userId:e,userData:n,userHash:r};var s=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());if(s||a||c){var l=t;return new Promise((function(o,i){t.setOnSessionReady((function(){if(!l.session.gleapId||!l.session.gleapHash)return i("Session not ready yet.");var t=new XMLHttpRequest;t.open("POST",l.apiUrl+"/sessions/identify"),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.setRequestHeader("Api-Token",l.sdkKey);try{t.setRequestHeader("Gleap-Id",l.session.gleapId),t.setRequestHeader("Gleap-Hash",l.session.gleapHash)}catch(s){}l.identifyInFlight=!0,t.onerror=function(){l.identifyInFlight=!1,i()},t.onreadystatechange=function(e){if(4===t.readyState)if(l.identifyInFlight=!1,200===t.status||201===t.status)try{var n=JSON.parse(t.responseText);l.validateSession(n),o(n)}catch(s){i(s)}else i()};var a=fs({},n);n.customData&&(delete a.customData,a=fs(fs({},a),n.customData)),t.send(JSON.stringify(fs(fs({},a),{},{userId:e,userHash:r,lang:Vf.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"})))}))}))}})),gs(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("Session not ready yet.");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)}catch(i){}t.onerror=function(){o()},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()},t.send(JSON.stringify({outboundId:e}))}))}))})),gs(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("Session not ready yet.");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)}catch(a){}i.onerror=function(){o()},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()}catch(a){o(a)}else o()},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(wt,t)?t:null}(e);if(!t)return console.warn('Gleap: Unknown region "'.concat(e,'". Supported regions: ').concat(Object.keys(wt).join(", "),". Region not changed.")),!1;var n=wt[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<this.onSessionReadyListener.length;e++)this.onSessionReadyListener[e]();this.onSessionReadyListener=[],zs.getInstance().sendSessionUpdate()}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&hs(t.prototype,n),r&&hs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ys(e){return ys="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},ys(e)}function bs(){bs=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",c=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=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 A(r||[]);return o(a,"_invoke",{value:E(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",f="suspendedYield",h="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(M([])));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){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==ys(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){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.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 E(t,n,r){var o=p;return function(i,a){if(o===h)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 c=T(s,r);if(c){if(c===m)continue;return c}}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=h;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:f,l.arg===m)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.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")),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 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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function M(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<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(ys(t)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(I.prototype),l(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new I(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),l(S,c,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(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;O(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),m}},t}function ws(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function ks(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ws(i,r,o,a,s,"next",e)}function s(e){ws(i,r,o,a,s,"throw",e)}a(void 0)}))}}function xs(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 Ss(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 Ss(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 Ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Es(r.key),r)}}function Is(e,t,n){return(t=Es(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Es(e){var t=function(e,t){if("object"!=ys(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ys(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ys(t)?t:String(t)}gs(vs,"instance",void 0);var Ts=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Is(this,"rerender",void 0),Is(this,"stream",void 0),Is(this,"mediaRecorder",void 0),Is(this,"audioMuted",!1),Is(this,"audioAvailable",!0),Is(this,"available",!0),Is(this,"isRecording",!1),Is(this,"file",null),Is(this,"maxRecordTime",e.MAX_RECORD_TIME),Is(this,"recordTime",0),Is(this,"recordingTimer",null),Is(this,"permissionErrorText",""),Is(this,"_displayVideoTrack",null),Is(this,"_displayStream",null),Is(this,"_micStream",null),this.rerender=t,this.permissionErrorText=n,navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia||(this.available=!1),setTimeout((function(){r.rerender()}),e.RERENDER_DELAY)}var t,n,r,o,i,a;return t=e,n=[{key:"getSupportedMimeType",value:function(){var t,n=xs(e.MIME_TYPES);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(window.MediaRecorder&&MediaRecorder.isTypeSupported(r))return r}}catch(o){n.e(o)}finally{n.f()}return"video/webm"}},{key:"formatTime",value:function(e){return(e-(e%=60))/60+(9<e?":":":0")+e}},{key:"stopStreamTracks",value:function(e){if(e)try{e.getTracks().forEach((function(e){return e.stop()}))}catch(t){}}},{key:"createMediaStream",value:function(e){var t=e.filter((function(e){return null!==e}));return new MediaStream(t)}},{key:"getFirstVideoTrack",value:function(e){if(!e)return null;var t=e.getVideoTracks();return t.length>0?t[0]:null}},{key:"getFirstAudioTrack",value:function(e){if(!e)return null;var t=e.getAudioTracks();return t.length>0?t[0]:null}},{key:"startScreenRecording",value:(a=ks(bs().mark((function t(){var n,r;return bs().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&!this.isRecording){t.next=4;break}return this.available=!1,this.rerender(),t.abrupt("return");case 4:return t.prev=4,t.next=7,navigator.mediaDevices.getDisplayMedia({video:{width:{ideal:Math.min(window.screen.width,e.MAX_WIDTH)},height:{ideal:Math.min(window.screen.height,e.MAX_HEIGHT)},frameRate:{ideal:e.IDEAL_FRAME_RATE,max:e.MAX_FRAME_RATE},displaySurface:"monitor"},audio:!1,selfBrowserSurface:"include"});case 7:if(n=t.sent,this._displayStream=n,this._displayVideoTrack=this.getFirstVideoTrack(n),this.audioMuted){t.next=15;break}return t.next=13,this.startAudioRecording();case 13:t.next=19;break;case 15:this.audioAvailable=!1,r=this.createMediaStream([this._displayVideoTrack]),this.stream=r,this.handleRecord({stream:r});case 19:this.rerender(),t.next=26;break;case 22:t.prev=22,t.t0=t.catch(4),window.alert(this.permissionErrorText),this.rerender();case 26:case"end":return t.stop()}}),t,this,[[4,22]])}))),function(){return a.apply(this,arguments)})},{key:"stopScreenRecording",value:function(){if(this.mediaRecorder&&this.stream&&this.isRecording){this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null);try{this.mediaRecorder.stop()}catch(e){}this.stopStreamTracks(this.stream),this._displayStream&&(this.stopStreamTracks(this._displayStream),this._displayStream=null),this._micStream&&(this.stopStreamTracks(this._micStream),this._micStream=null),this._displayVideoTrack=null,this.rerender()}}},{key:"startAudioRecording",value:(i=ks(bs().mark((function e(){var t,n,r,o;return bs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._displayVideoTrack){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1});case 5:t=e.sent,this._micStream=t,n=this.getFirstAudioTrack(t),this.audioMuted=!1,this.audioAvailable=!!n,r=this.createMediaStream([this._displayVideoTrack,n]),this.stream=r,this.handleRecord({stream:r}),this.rerender(),e.next=23;break;case 16:e.prev=16,e.t0=e.catch(2),this.audioAvailable=!1,o=this.createMediaStream([this._displayVideoTrack]),this.stream=o,this.handleRecord({stream:o}),this.rerender();case 23:case"end":return e.stop()}}),e,this,[[2,16]])}))),function(){return i.apply(this,arguments)})},{key:"toggleAudio",value:function(){if(this.audioMuted=!this.audioMuted,this.rerender(),this.stream)for(var e=this.stream.getAudioTracks(),t=0;t<e.length;t++)e[t].enabled=!this.audioMuted}},{key:"clearPreview",value:function(){var t=document.querySelector(e.SELECTORS.PREVIEW_VIDEO);t&&(t.src=null),this.file=null,this.rerender()}},{key:"handleRecord",value:function(t){var n=t.stream,r=this,o=[];this.mediaRecorder=new MediaRecorder(n,{mimeType:this.getSupportedMimeType()}),this.isRecording=!0,this.recordTime=0;var i=document.querySelector(e.SELECTORS.TIMER_LABEL);this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),this.recordingTimer=setInterval((function(){r.recordTime++;var e=r.maxRecordTime-r.recordTime;i?e>0?i.innerHTML=r.formatTime(e):(i.innerHTML="2:00",r.stopScreenRecording()):e<=0&&r.stopScreenRecording()}),e.TIMER_UPDATE_INTERVAL),this.mediaRecorder.ondataavailable=function(e){e.data&&e.data.size>0&&o.push(e.data)};var a=this.getFirstVideoTrack(n);a&&(a.onended=function(){r.prepareRecording(o)}),this.mediaRecorder.onstop=function(){r.prepareRecording(o)},this.mediaRecorder.start(e.CHUNK_INTERVAL),r.rerender()}},{key:"prepareRecording",value:function(t){var n=this.getSupportedMimeType(),r=new Blob(t,{type:n}),o=n.includes("mp4")?"mp4":"webm";this.file=new File([r],"screen-recording.".concat(o),{type:n});var i=document.querySelector(e.SELECTORS.PREVIEW_VIDEO);i&&(i.src=URL.createObjectURL(r),this.audioAvailable=this.stream?this.stream.getAudioTracks().length>0:this.audioAvailable,this.isRecording=!1,this.rerender())}}],r=[{key:"uploadScreenRecording",value:(o=ks(bs().mark((function e(t){return bs().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",null);case 2:return e.abrupt("return",new Promise((function(e,n){var r=new XMLHttpRequest;r.open("POST",vs.getInstance().apiUrl+"/uploads/sdk"),vs.getInstance().injectSession(r);var o=new FormData;o.append("file",t),r.onerror=function(){n(new Error("Network error during file upload"))},r.onreadystatechange=function(){4==r.readyState&&(200==r.status?e(JSON.parse(r.response).fileUrl):n(new Error("Upload failed with status ".concat(r.status))))},r.send(o)})));case 3:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}],n&&Cs(t.prototype,n),r&&Cs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ls(e){return Ls="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},Ls(e)}function Os(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 As(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Os(Object(n),!0).forEach((function(t){Ps(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ms(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rs(r.key),r)}}function Ps(e,t,n){return(t=Rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rs(e){var t=function(e,t){if("object"!=Ls(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ls(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ls(t)?t:String(t)}Is(Ts,"MAX_RECORD_TIME",120),Is(Ts,"MAX_WIDTH",3072),Is(Ts,"MAX_HEIGHT",1728),Is(Ts,"IDEAL_FRAME_RATE",10),Is(Ts,"MAX_FRAME_RATE",24),Is(Ts,"CHUNK_INTERVAL",200),Is(Ts,"TIMER_UPDATE_INTERVAL",1e3),Is(Ts,"RERENDER_DELAY",100),Is(Ts,"MIME_TYPES",["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm","video/mp4"]),Is(Ts,"SELECTORS",{PREVIEW_VIDEO:".bb-capture-preview video",TIMER_LABEL:".bb-capture-toolbar-item-timer"});var Ns=[["webReplay"],["screenshotData","networkLogs"]],js=function(){function e(t,n,r,o,i,a,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ps(this,"excludeData",{}),Ps(this,"type","BUG"),Ps(this,"priority","LOW"),Ps(this,"customData",{}),Ps(this,"ticketAttributes",{}),Ps(this,"metaData",{}),Ps(this,"consoleLog",[]),Ps(this,"networkLogs",[]),Ps(this,"customEventLog",[]),Ps(this,"formData",{}),Ps(this,"isSilent",!1),Ps(this,"outboundId",void 0),Ps(this,"screenshotData",void 0),Ps(this,"webReplay",void 0),Ps(this,"screenRecordingUrl",void 0),Ps(this,"spamToken",void 0),this.type=t,this.priority=n,this.formData=r,this.isSilent=o,this.excludeData=i,this.outboundId=a,this.spamToken=s}var t,n,r;return t=e,n=[{key:"takeSnapshot",value:function(){var e=this,t=oh.getInstance();this.customData=ao.getInstance().getCustomData(),this.metaData=cc.getInstance().getMetaData(),this.consoleLog=Jr.getInstance().getLogs(),this.networkLogs=hl.getInstance().getRequests(),this.customEventLog=Mf.getInstance().getEventArray(),this.ticketAttributes=ao.getInstance().getTicketAttributes();var n=[],r=t.getGlobalDataItem("webReplay");null!==r&&(this.webReplay=r);var o,i,a,s,c,l=t.getGlobalDataItem("screenRecordingData");if(null!=l){var u=Ts.uploadScreenRecording(l).then((function(t){t&&(e.screenRecordingUrl=t)}));n.push(u)}if(!this.excludeData||!this.excludeData.screenshot){var d=(s=t.isLiveMode(),c=vf.getInstance().customOptions,Li(s,c||{})).then((function(n){if(n){var r=t.getGlobalDataItem("snapshotPosition");n.x=r.x,n.y=r.y,e.screenshotData=n}}));n.push((o=d,i=15e3,a="screenshot capture",new Promise((function(e,t){var n=!1,r=setTimeout((function(){n||(n=!0,console.warn("Gleap: "+a+" timed out after "+i+"ms. Sending the report without it."),e())}),i);o.then((function(t){n||(n=!0,clearTimeout(r),e(t))}),(function(e){n||(n=!0,clearTimeout(r),t(e))}))}))))}return Promise.all(n)}},{key:"getData",value:function(){var e={type:this.type,priority:this.priority,customData:this.customData,metaData:this.metaData,consoleLog:this.consoleLog,networkLogs:this.networkLogs,customEventLog:this.customEventLog,formData:As(As({},this.ticketAttributes),this.formData),isSilent:this.isSilent,outbound:this.outboundId,screenshotData:this.screenshotData,webReplay:this.webReplay,screenRecordingUrl:this.screenRecordingUrl,spamToken:this.spamToken},t=Hf.getInstance().getTags();if(t&&t.length>0&&(e.tags=t),this.excludeData)for(var n=Object.keys(this.excludeData),r=0;r<n.length;r++){var o=n[r];!0===this.excludeData[o]&&(e[o]&&delete e[o],"screenshot"===o&&delete e.screenshotData,"replays"===o&&delete e.webReplay)}return e}},{key:"getTicketData",value:function(){var e=this;return new Promise((function(t,n){e.takeSnapshot().then((function(){var n=e.getData();t(n)})).catch((function(e){console.log("Failed to take snapshot",e),n()}))}))}},{key:"sendFeedback",value:function(){var e=this;return new Promise((function(t,n){e.takeSnapshot().then((function(){var r=e.getData();!function e(o){var i=new XMLHttpRequest;i.open("POST",vs.getInstance().apiUrl+"/bugs/v2"),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),vs.getInstance().injectSession(i),i.onerror=function(e){n()},i.onreadystatechange=function(a){if(4===i.readyState)if(200===i.status||201===i.status)try{var s=JSON.parse(i.responseText);t(s)}catch(c){n()}else 413===i.status&&o<Ns.length?(Ns[o].forEach((function(e){return delete r[e]})),e(o+1)):n()},i.send(JSON.stringify(r))}(0)})).catch((function(e){console.log("Failed to take snapshot",e),n()}))}))}}],n&&Ms(t.prototype,n),r&&Ms(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 Ds(e){return function(e){if(Array.isArray(e))return Fs(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 Fs(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 Fs(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 Fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Bs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hs(r.key),r)}}function Us(e,t,n){return(t=Hs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hs(e){var t=function(e,t){if("object"!=_s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_s(t)?t:String(t)}var zs=function(){function e(){var t=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Us(this,"frameUrl","https://messenger-app.gleap.io"),Us(this,"gleapFrameContainer",null),Us(this,"gleapFrame",null),Us(this,"comReady",!1),Us(this,"injectedFrame",!1),Us(this,"widgetOpened",!1),Us(this,"listeners",[]),Us(this,"appMode","widget"),Us(this,"markerManager",void 0),Us(this,"escListener",void 0),Us(this,"frameHeight",0),Us(this,"sendingFeedback",!1),Us(this,"queue",[]),Us(this,"widgetExpanded",void 0),Us(this,"appliedWidgetExpanded",!1),Us(this,"lastWidgetSizeUpdate",null),Us(this,"urlHandler",(function(e,t){if(e&&e.length>0)if(t){var n=window.open(e,"_blank");n&&n.focus()}else window.location.href=e})),Us(this,"autoWhiteListCookieManager",(function(){window&&Array.isArray(window.cmp_block_ignoredomains)&&-1===window.cmp_block_ignoredomains.indexOf("messenger-app.gleap.io")&&window.cmp_block_ignoredomains.push("messenger-app.gleap.io")})),Us(this,"injectFrame",(function(){t.injectedFrame||(t.injectedFrame=!0,t.autoWhiteListCookieManager(),se((function(){br.getInstance().onConfigLoaded((function(){br.getInstance().applyStylesFromConfig();var e=document.createElement("div");e.className="gleap-frame-container gleap-frame-container--hidden rr-block",e.innerHTML='<div class="gleap-frame-container-inner">'.concat(function(e){var t,n,r=e||{},o="image"===r.bgType&&r.bgImage&&r.bgImage.length>0,i=parseInt(r.v,10),a=i>=1&&i<=4?i:1,s=4!==a,c=null===(t=r.bgBlur)||void 0===t||t?'<div class="gleap-frame-loader-blur"></div>':"";if(!s){var l,u=r.welcomeText?String(r.welcomeText).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):"",d='<div class="gleap-frame-loader-strut">\n <div class="gleap-frame-loader-strut-bar"></div>\n <div class="gleap-frame-loader-strut-greeting">\n <div class="gleap-frame-loader-strut-kicker">&nbsp;</div>'.concat(u?'\n <div class="gleap-frame-loader-strut-title">'.concat(u,"</div>"):"","\n </div>\n </div>");if(o){var p=String(r.bgImage).replace(/"/g,"&quot;");return'<div class="gleap-frame-loader">\n <div class="gleap-frame-loader-header gleap-frame-loader-header--image">\n <div class="gleap-frame-loader-image-wrap">\n <img class="gleap-frame-loader-image" src="'.concat(p,'" alt="" /></div>\n ').concat(d,'\n <div class="gleap-frame-loader-ramp gleap-frame-loader-ramp--image"></div>\n </div>\n </div>')}var f=null===(l=r.fadebg)||void 0===l||l;return'<div class="gleap-frame-loader">\n <div class="gleap-frame-loader-header gleap-frame-loader-header--colour">\n '.concat(d).concat(f?'\n <div class="gleap-frame-loader-ramp"></div>':"","\n </div>\n </div>")}if(o){var h=String(r.bgImage).replace(/"/g,"&quot;"),g=r.hideNews&&r.hideFeatureRequests&&r.hideAllConversations&&r.hideKnowledgeBase;return'<div class="gleap-frame-loader gleap-frame-loader--image'.concat(1!==a&&2!==a||g?"":" gleap-frame-loader--dockedbar",'">\n <div class="gleap-frame-loader-image-wrap">\n <img class="gleap-frame-loader-image" src="').concat(h,'" alt="" />').concat(c,"</div>\n </div>")}if("classic"===r.bgType){var m,v=null===(m=r.fadebg)||void 0===m||m;return'<div class="gleap-frame-loader">'.concat(v?'<svg width="403" height="598" viewBox="0 0 403 598" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect width="403" height="503" fill="url(#gleap-bg-classic-grad)"/>\n <rect y="158" width="403" height="346" fill="url(#gleap-bg-classic-fade)"/>\n <defs>\n <linearGradient id="gleap-bg-classic-grad" x1="-2.40293e-06" y1="4.72174" x2="427.062" y2="248.078" gradientUnits="userSpaceOnUse">\n <stop class="gleap-bg-grad-1"/>\n <stop class="gleap-bg-grad-2" offset="1"/>\n </linearGradient>\n <linearGradient id="gleap-bg-classic-fade" x1="201" y1="158" x2="201.35" y2="473" gradientUnits="userSpaceOnUse">\n <stop class="gleap-bg-fade" stop-opacity="0"/>\n <stop class="gleap-bg-fade" offset="1"/>\n </linearGradient>\n </defs>\n </svg>':'<svg width="403" height="598" viewBox="0 0 403 598" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M403 0H0V362H403V0Z" fill="url(#gleap-bg-classic-grad)"/>\n <defs>\n <linearGradient id="gleap-bg-classic-grad" x1="-3.25162e-06" y1="3.02267" x2="315.636" y2="283.986" gradientUnits="userSpaceOnUse">\n <stop class="gleap-bg-grad-1"/>\n <stop class="gleap-bg-grad-2" offset="1"/>\n </linearGradient>\n </defs>\n </svg>').concat(c,"</div>")}var y=null===(n=r.animateBG)||void 0===n||n;return'<div class="gleap-frame-loader'.concat(y?" gleap-frame-loader--animate":"",'">\n <svg width="403" height="598" viewBox="0 0 403 598" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#gleap-bg-gradient-clip)">\n <path class="gleap-bg-base" d="M403 0H0V598H403V0Z"/>\n <path class="gleap-bg-c1" d="M0 0H403V308.5L350.5 298.5H294L144.5 250L78.5 152.5L27 125L0 104V0Z"/>\n <path class="gleap-bg-c2" d="M0 151V108V101.5H137L156 151L352 300L106 340L0 344.5V151Z"/>\n <path class="gleap-bg-c3" d="M254.5 118L331.5 94L403 85V318H347.5L221 207L254.5 118Z"/>\n </g>\n <defs>\n <clipPath id="gleap-bg-gradient-clip">\n <rect width="403" height="598" fill="white"/>\n </clipPath>\n </defs>\n </svg>').concat(c,"</div>")}(br.getInstance().getFlowConfig()),'<iframe class="gleap-frame" scrolling="yes" allow="autoplay; encrypted-media; fullscreen; microphone *; display-capture *; camera *;" frameborder="0"></iframe></div>'),document.body.appendChild(e);var n=e.querySelector(".gleap-frame-loader-image");if(n){var r=function(){var t=e.querySelector(".gleap-frame-loader-image-wrap");t&&t.classList.add("gleap-frame-loader-image-wrap--loaded")};n.complete&&n.naturalWidth>0?r():n.addEventListener("load",r)}t.gleapFrameContainer=e,t.gleapFrame=document.querySelector(".gleap-frame"),K(t.gleapFrame,t.frameUrl),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),Us(this,"showImage",(function(e){se((function(){var t=document.createElement("div");t.className="gleap-image-view",t.setAttribute("tabindex","-1"),t.innerHTML='<div class="gleap-image-view-close">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm97.9-320l-17 17-47 47 47 47 17 17L320 353.9l-17-17-47-47-47 47-17 17L158.1 320l17-17 47-47-47-47-17-17L192 158.1l17 17 47 47 47-47 17-17L353.9 192z"/></svg>\n </div><img class="gleap-image-view-image" src="'.concat(e,'" />'),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()}}))})),Us(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--classic",i="gleap-frame-container--classic-left",a="gleap-frame-container--modern-left",s="gleap-frame-container--no-button",c="gleap-frame-container--expanded",l=[o,i,c,n,a,s,e,r],u=0;u<l.length;u++)t.gleapFrameContainer.classList.remove(l[u]);var d=void 0,p=br.getInstance().getFlowConfig();p.feedbackButtonPosition!==j.FEEDBACK_BUTTON_CLASSIC&&p.feedbackButtonPosition!==j.FEEDBACK_BUTTON_CLASSIC_BOTTOM||(d=o),p.feedbackButtonPosition===j.FEEDBACK_BUTTON_CLASSIC_LEFT&&(d=i),p.feedbackButtonPosition===j.FEEDBACK_BUTTON_BOTTOM_LEFT&&(d=a),null===j.getInstance().buttonHidden?p.feedbackButtonPosition===j.FEEDBACK_BUTTON_NONE&&(d=s):j.getInstance().buttonHidden&&(d=s),d&&t.gleapFrameContainer.classList.add(d),"survey"===t.appMode&&t.gleapFrameContainer.classList.add(e),"survey_full"!==t.appMode&&"survey_web"!==t.appMode||t.gleapFrameContainer.classList.add(r),"extended"===t.appMode&&t.gleapFrameContainer.classList.add(n),t.appliedWidgetExpanded=t.isWidgetExpanded(),t.appliedWidgetExpanded&&t.gleapFrameContainer.classList.add(c),t.gleapFrameContainer.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr")}})),this.startCommunication(),"undefined"!=typeof window){var n=function(){try{document.documentElement.style.setProperty("--glvh",.01*window.innerHeight+"px")}catch(e){}};try{window.addEventListener("resize",n),window.addEventListener("resize",(function(){return t.handleViewportResize()})),n()}catch(r){}}}var t,n,r;return t=e,n=[{key:"setUrlHandler",value:function(e){this.urlHandler=e}},{key:"isSurvey",value:function(){return"survey"===this.appMode||"survey_full"===this.appMode||"survey_web"===this.appMode}},{key:"setAppMode",value:function(e){this.appMode=e,this.updateFrameStyle();var t=document.querySelector(".gleap-frame-container-inner");"widget"!==this.appMode&&"survey_full"!==this.appMode&&"survey_web"!==this.appMode||!t||(t.style.maxHeight="".concat(700,"px")),this.sendWidgetSizeUpdate()}},{key:"isMobileViewport",value:function(){try{return"function"==typeof window.matchMedia&&!window.matchMedia("(min-width: 451px)").matches}catch(e){return!1}}},{key:"canExpandWidget",value:function(){var e=br.getInstance().getFlowConfig();return!(e&&e.hideExpandButton||this.isSurvey()||this.isMobileViewport())}},{key:"getWidgetExpandedPreference",value:function(){return void 0===this.widgetExpanded&&(this.widgetExpanded=!0===ie("widget-expanded")),this.widgetExpanded}},{key:"isWidgetExpanded",value:function(){return this.getWidgetExpandedPreference()&&this.canExpandWidget()}},{key:"setWidgetExpanded",value:function(e){this.widgetExpanded=!!e;try{ae("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()}},{key:"registerEscListener",value:function(){var e=this;this.escListener||(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.markerManager=void 0,this.gleapFrameContainer=null,this.gleapFrame=null}},{key:"isOpened",value:function(){return this.widgetOpened||null!=this.markerManager}},{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.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(){this.gleapFrameContainer&&(this.workThroughQueue(),oh.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),Ft.notifyEvent("open"),this.registerEscListener())}},{key:"updateUI",value:function(){bl.getInstance().clearAllNotifications(this.isSurvey()),j.getInstance().updateNotificationBadge(0),j.getInstance().updateFeedbackButtonState()}},{key:"showWidget",value:function(){var t=this;setTimeout((function(){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:"hideWidget",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("survey_web"!==this.appMode){if(this.hideMarkerManager(),this.gleapFrameContainer){var n=this.gleapFrameContainer;n.classList.remove("gleap-frame-container--animate"),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),n.classList.contains("gleap-frame-container--survey-full")?n.classList.add("gleap-frame-container--hidden"):(n.classList.add("gleap-frame-container--closing"),this.closeTimeout=setTimeout((function(){n.classList.add("gleap-frame-container--hidden"),n.classList.remove("gleap-frame-container--closing"),e.closeTimeout=null}),260))}t&&this.sendMessage({name:"reset-routes",data:{}}),this.widgetOpened=!1,this.updateWidgetStatus(),j.getInstance().updateFeedbackButtonState(),Ft.notifyEvent("close"),bl.getInstance().reloadNotificationsFromCache(),this.unregisterEscListener(),"undefined"!=typeof window&&void 0!==window.focus&&window.focus()}}},{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),"*"):t&&this.queue.push(e)}catch(n){}}},{key:"sendSessionUpdate",value:function(){this.sendMessage({name:"session-update",data:{sessionData:vs.getInstance().getSession(),apiUrl:vs.getInstance().apiUrl,realtimeHost:vs.getInstance().realtimeHost,sdkKey:vs.getInstance().sdkKey}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:br.getInstance().getFlowConfig(),aiTools:Xt.getInstance().getAgentTools(),agentTools:Xt.getInstance().getAgentTools(),overrideLanguage:Vf.getInstance().getOverrideLanguage()}}),this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0))}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new rc(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=Ds(this.queue);this.queue=[];for(var t=0;t<e.length;t++)this.sendMessage(e[t],!0)}},{key:"startCommunication",value:function(){var e=this;this.addMessageListener((function(t){if("ping"===t.name&&(e.comReady=!0,e.sendConfigUpdate(),e.sendSessionUpdate(),e.workThroughQueue(),setTimeout((function(){e.runWidgetShouldOpenCallback()}),300)),"play-ping"===t.name&&Dn.ping(),"open-image"===t.name&&e.showImage(t.data.url),"page-changed"===t.name&&(!t.data||"newsdetails"!==t.data.name&&"appextended"!==t.data.name?"extended"===e.appMode&&e.setAppMode("widget"):e.setAppMode("extended")),"collect-ticket-data"===t.name&&(e.gleapFrame=document.querySelector(".gleap-frame"),e.answerCollectTicketData(e.gleapFrame,t)),"height-update"===t.name){e.frameHeight=t.data;var n=document.querySelector(".gleap-frame-container-inner");"survey"!==e.appMode&&"survey_full"!==e.appMode&&"survey_web"!==e.appMode||!n||(n.style.maxHeight="".concat(e.frameHeight,"px"))}if("notify-event"===t.name&&Ft.notifyEvent(t.data.type,t.data.data),"cleanup-drawings"===t.name&&e.hideMarkerManager(),"open-url"===t.name){var r=t.data,o=!!t.newTab;e.urlHandler(r,o)}var i;if("start-product-tour"===t.name&&oh.startProductTour(null===(i=t.data)||void 0===i?void 0:i.tourId,!0),"run-custom-action"===t.name&&to.triggerCustomAction(t.data,{shareToken:t.shareToken}),"close-widget"===t.name&&e.hideWidget(),"set-widget-expanded"===t.name&&e.setWidgetExpanded(t.data&&t.data.expanded),"video-call-joined"===t.name&&(j.getInstance().showingRedDot=!0,j.getInstance().updateRedDot(!0)),"video-call-left"===t.name&&(j.getInstance().showingRedDot=!1,j.getInstance().updateRedDot(!1)),"tool-execution"===t.name&&(Ft.notifyEvent("tool-execution",t.data),Xt.getInstance().triggerToolAction(t.data)),"frontend-tool-execute"===t.name&&t.data&&Xt.getInstance().executeToolAction(t.data).then((function(t){e.sendMessage({name:"frontend-tool-result",data:t})})),"checklist-loaded"===t.name){var a,s=t.data;Ft.notifyEvent("checklist-loaded",{checklistId:s.id,outboundId:null===(a=s.outbound)||void 0===a?void 0:a.id,completedSteps:s.completedSteps,status:s.status,data:s})}if("checklist-step-completed"===t.name){var c,l=t.data,u=l.checklistData,d=l.step,p=l.index;Ft.notifyEvent("checklist-step-completed",{checklistId:u.id,outboundId:null===(c=u.outbound)||void 0===c?void 0:c.id,stepId:d.id,stepIndex:p,step:d,completedSteps:u.completedSteps,status:u.status,data:u})}if("checklist-completed"===t.name){var f,h=t.data;Ft.notifyEvent("checklist-completed",{checklistId:h.id,outboundId:null===(f=h.outbound)||void 0===f?void 0:f.id,completedSteps:h.completedSteps,status:h.status,data:h})}if("send-feedback"===t.name){if(e.sendingFeedback)return;e.sendingFeedback=!0;var g=t.data.formData,m=t.data.action,v=t.data.outboundId,y=t.data.spamToken;new js(m.feedbackType,"MEDIUM",g,!1,m.excludeData,v,y).sendFeedback().then((function(t){if(setTimeout((function(){e.sendingFeedback=!1}),1e3),e.sendMessage({name:"feedback-sent",data:t}),Ft.notifyEvent("feedback-sent",g),v&&v.length>0){Ft.notifyEvent("outbound-sent",{outboundId:v,outbound:m,formData:g});try{delete g.reportedBy}catch(n){}oh.trackEvent("outbound-".concat(v,"-submitted"),g)}})).catch((function(t){setTimeout((function(){e.sendingFeedback=!1,e.sendMessage({name:"feedback-sending-failed",data:"Something went wrong, please try again."}),Ft.notifyEvent("error-while-sending")}),1e3)}))}"start-screen-drawing"===t.name&&e.showDrawingScreen(t.data)})),window.addEventListener("message",(function(t){var n=Wn.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 c=JSON.parse(t.data);if("MODAL"===(null==c?void 0:c.type)||"BANNER"===(null==c?void 0:c.type)||"CHATBAR"===(null==c?void 0:c.type)||"AGENT_CONVERSATION"===(null==c?void 0:c.type))return;for(var l=0;l<e.listeners.length;l++)e.listeners[l]&&e.listeners[l](c)}catch(u){}}))}},{key:"addMessageListener",value:function(e){this.listeners.push(e)}},{key:"answerCollectTicketData",value:function(e,t){var n={customData:ao.getInstance().getCustomData(),metaData:cc.getInstance().getMetaData(),consoleLog:Jr.getInstance().getLogs(),networkLogs:hl.getInstance().getRequests(),customEventLog:Mf.getInstance().getEventArray(),formData:ao.getInstance().getTicketAttributes()},r=Hf.getInstance().getTags();r&&r.length>0&&(n.tags=r);try{e&&e.contentWindow&&e.contentWindow.postMessage(JSON.stringify({name:"collect-ticket-data",data:n}),"*")}catch(o){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Bs(t.prototype,n),r&&Bs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function qs(e){return qs="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},qs(e)}function Ws(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Vs(r.key),r)}}function Gs(e,t,n){return(t=Vs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vs(e){var t=function(e,t){if("object"!=qs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=qs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qs(t)?t:String(t)}Us(zs,"instance",void 0);var Xs=function(){function e(t){var n=this,r=arguments.length>1&&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),Gs(this,"rerender",void 0),Gs(this,"svgElement",null),Gs(this,"path",null),Gs(this,"strPath",void 0),Gs(this,"strokeWidth",12),Gs(this,"strokeWidthRect",6),Gs(this,"bufferSize",4),Gs(this,"buffer",[]),Gs(this,"startPoint",null),Gs(this,"tool","rect"),Gs(this,"color","#EB144C"),Gs(this,"mouseDown",null),Gs(this,"mouseMove",null),Gs(this,"mouseUp",null),Gs(this,"resizeListener",null),Gs(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;r<t;r++)a++,o+=(n=this.buffer[r]).x,i+=n.y;return{x:o/a,y:i/a}}return null}},{key:"updateSvgPath",value:function(){var e=this.getAveragePoint(0);if(e){this.strPath+=" L"+e.x+" "+e.y;for(var t="",n=2;n<this.buffer.length;n+=2)t+=" L"+(e=this.getAveragePoint(n)).x+" "+e.y;this.path.setAttribute("d",this.strPath+t)}}},{key:"appendToBuffer",value:function(e){for(this.buffer.push(e);this.buffer.length>this.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&&Ws(t.prototype,n),r&&Ws(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Js(e){return Js="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},Js(e)}function Ks(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ys(r.key),r)}}function $s(e,t,n){return(t=Ys(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ys(e){var t=function(e,t){if("object"!=Js(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Js(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Js(t)?t:String(t)}var Zs=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),$s(this,"keys",{37:1,38:1,39:1,40:1}),$s(this,"supportsPassive",!1),$s(this,"wheelOpt",!!this.supportsPassive&&{passive:!1}),$s(this,"wheelEvent","onwheel"in document.createElement("div")?"wheel":"mousewheel"),$s(this,"scrollDisabled",!1);var t=this;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){t.supportsPassive=!0,t.wheelOpt=!!t.supportsPassive&&{passive:!1}}}))}catch(n){}}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"disableScroll",value:function(){var e=this.getInstance();e.scrollDisabled||(e.scrollDisabled=!0,window.addEventListener("DOMMouseScroll",e.preventDefault,!1),window.addEventListener(e.wheelEvent,e.preventDefault,e.wheelOpt),window.addEventListener("touchmove",e.preventDefault,e.wheelOpt),window.addEventListener("keydown",e.preventDefaultForScrollKeys,!1))}},{key:"enableScroll",value:function(){var e=this.getInstance();e.scrollDisabled&&(e.scrollDisabled=!1,window.removeEventListener("DOMMouseScroll",e.preventDefault,!1),window.removeEventListener(e.wheelEvent,e.preventDefault,e.wheelOpt),window.removeEventListener("touchmove",e.preventDefault,e.wheelOpt),window.removeEventListener("keydown",e.preventDefaultForScrollKeys,!1))}}],(n=[{key:"preventDefault",value:function(e){e.preventDefault()}},{key:"preventDefaultForScrollKeys",value:function(e){if(this.keys&&this.keys[e.keyCode])return this.preventDefault(e),!1}}])&&Ks(t.prototype,n),r&&Ks(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Qs(e){return Qs="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},Qs(e)}function ec(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nc(r.key),r)}}function tc(e,t,n){return(t=nc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nc(e){var t=function(e,t){if("object"!=Qs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Qs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qs(t)?t:String(t)}$s(Zs,"instance",void 0);var rc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),tc(this,"type","screenshot"),tc(this,"dragCursor",null),tc(this,"screenRecorder",null),tc(this,"callback",null),tc(this,"screenDrawer",null),tc(this,"escListener",null),tc(this,"pageLeaveListener",null),tc(this,"overrideLanguage",oh.getInstance().overrideLanguage),tc(this,"showNextStep",(function(){this.showWidgetUI(),this.callback&&(zs.getInstance().sendMessage({name:"set-form-data",data:{formKey:"capture",data:{value:this.type,dirty:!0}}}),this.callback(!0))})),this.type=t}var t,n,r;return t=e,n=[{key:"hideWidgetUI",value:function(){var e=document.querySelector(".bb-feedback-button");e&&(e.style.display="none");var t=document.querySelector(".bb-feedback-dialog-container");t&&(t.style.display="none")}},{key:"showWidgetUI",value:function(){"screenshot"===this.type&&Zs.enableScroll(),this.screenRecorder&&this.screenRecorder.stopScreenRecording(),this.unregisterListeners(),this.cleanupMousePointer(),this.screenDrawer&&this.screenDrawer.destroy();var e=document.querySelector(".bb-capture-toolbar");e&&e.remove();var t=document.querySelector(".bb-capture-svg");t&&t.classList.add("bb-capture-svg--preview");var n=document.querySelector(".bb-capture-preview");n&&n.remove();var r=document.querySelector(".bb-feedback-button");r&&(r.style.display="flex");var o=document.querySelector(".bb-feedback-dialog-container");o&&(o.style.display="block");var i=document.querySelector(".bb-capture-dismiss");i&&(i.style.display="none");var a=document.querySelector(".bb-capture-toolbar-item-colorpicker");a&&(a.style.display="none");var s=document.querySelector(".bb-capture-editor-borderlayer");s&&(s.style.display="none")}},{key:"clear",value:function(){this.screenDrawer&&this.screenDrawer.destroyScrollTracker();var e=document.querySelector(".bb-capture-editor");e&&e.remove()}},{key:"setMouseMove",value:function(e,t){this.dragCursor&&(this.dragCursor.style.left="".concat(e+6,"px"),this.dragCursor.style.top="".concat(t-26,"px"),this.dragCursor.style.right=null)}},{key:"mouseMoveEventHandler",value:function(e){var t=e.clientX,n=e.clientY;this.setMouseMove(t,n)}},{key:"touchMoveEventHandler",value:function(e){var t=e.touches[0].clientX,n=e.touches[0].clientY;this.setMouseMove(t,n)}},{key:"setupMousePointer",value:function(){var e=this;this.dragCursor=document.querySelector(".bb-capture-editor-drag-info");var t=document.querySelector(".bb-capture-svg");t.addEventListener("mouseenter",(function(t){e.dragCursor.style.opacity=1})),t.addEventListener("mouseleave",(function(t){e.dragCursor.style.opacity=0})),document.documentElement.addEventListener("mousemove",this.mouseMoveEventHandler.bind(this)),document.documentElement.addEventListener("touchmove",this.touchMoveEventHandler.bind(this))}},{key:"cleanupMousePointer",value:function(){document.documentElement.removeEventListener("mousemove",this.mouseMoveEventHandler),document.documentElement.removeEventListener("touchmove",this.touchMoveEventHandler);var e=document.querySelector(".bb-capture-toolbar-item[data-type='drag']");e&&(e.removeEventListener("mousedown",this.dragStart),e.removeEventListener("touchstart",this.dragStart),document.removeEventListener("mousemove",this.drag),document.removeEventListener("touchmove",this.drag),document.removeEventListener("mouseup",this.dragEnd),document.removeEventListener("touchend",this.dragEnd)),this.dragCursor&&this.dragCursor.remove()}},{key:"createEditorUI",value:function(){var e=document.createElement("div");e.className="bb-capture-editor",e.innerHTML='\n <div class="bb-capture-editor-borderlayer"></div>\n <svg class="bb-capture-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" xml:space="preserve"></svg>\n <div class="bb-capture-dismiss">'.concat(fe("dismiss"),"</div>\n <div class='bb-capture-editor-drag-info'>").concat(fe("rect"),'</div>\n <div class="bb-capture-toolbar">\n <div class="bb-capture-toolbar-item bb-capture-item-rec bb-capture-toolbar-item-tool drag-handle-item" data-type="drag">\n ').concat(fe("drag"),"\n </div>\n ").concat("capture"===this.type?'<div class="bb-capture-toolbar-item bb-capture-item-rec bb-capture-toolbar-item-recording" data-type="recording">\n '.concat(fe("recorderon"),"\n ").concat(fe("recorderoff"),'\n <span class="bb-tooltip bb-tooltip-screen-recording"></span>\n </div>\n <div class="bb-capture-toolbar-item bb-capture-item-rec" data-type="mic">\n ').concat(fe("mic"),'\n <span class="bb-tooltip bb-tooltip-audio-recording"></span>\n </div>\n <div class="bb-capture-toolbar-item-timer bb-capture-item-rec">2:00</div>\n <div class="bb-capture-toolbar-item-spacer"></div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="pointer">\n ').concat(fe("pointer"),"\n </div>"):"",'\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool bb-capture-toolbar-item--active" data-type="rect">\n ').concat(fe("rect"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="pen">\n ').concat(fe("pen"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="blur">\n ').concat(fe("blur"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem" data-type="colorpicker">\n <div class="bb-capture-toolbar-item-selectedcolor"></div>\n <span class="bb-tooltip">').concat(Vf.translateText("pickAColor"),'</span>\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="undo">\n ').concat(fe("undo"),'\n <span class="bb-tooltip">').concat(Vf.translateText("undo"),"</span>\n </div>\n ").concat("capture"!==this.type?'<div class="bb-capture-button-next">'.concat(Vf.translateText("next"),"</div>"):"",'\n </div>\n <div class="bb-capture-toolbar-item-colorpicker">\n <div class="bb-capture-toolbar-item-color" data-color="#EB144C"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#FF6705"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#FDB903"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#9900EE"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#00D082"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#0A93E4"></div>\n <div class="bb-capture-toolbar-item-color" data-color="#CCCCCC"></div>\n </div>\n <div class="bb-capture-preview">\n <div class="bb-capture-preview-inner">\n <video controls muted autoplay></video>\n <div class="bb-capture-preview-buttons">\n <div class="bb-capture-preview-retrybutton">').concat(Vf.translateText("retry"),'</div>\n <div class="bb-capture-preview-sendbutton">').concat(Vf.translateText("next"),"</div>\n </div>\n </div>\n </div>\n "),document.body.appendChild(e),e.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr")}},{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?(oh.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),Zs.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new Xs(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;a<r.length;a++)i()}},{key:"dismiss",value:function(){this.showWidgetUI(),this.callback&&this.callback(!1)}},{key:"setupToolbar",value:function(){var e,t,n,r,o=this,i=document.querySelector(".bb-capture-toolbar"),a=!1,s=0,c=0;this.dragStart=function(e){var t=function(){var e=window.getComputedStyle(i).transform;if("none"===e)return{x:0,y:0};var t=new DOMMatrix(e);return{x:t.m41,y:t.m42}}(),o=t.x,l=t.y;s=o,c=l,"mousedown"===e.type?(n=e.clientX-s,r=e.clientY-c):(n=e.touches[0].clientX-s,r=e.touches[0].clientY-c),a=!0},this.dragEnd=function(){a=!1},this.drag=function(o){a&&(o.preventDefault(),"mousemove"===o.type?(e=o.clientX-n,t=o.clientY-r):(e=o.touches[0].clientX-n,t=o.touches[0].clientY-r),s=e,c=t,i.style.transform="translate(".concat(e,"px, ").concat(t,"px)"))};var l=document.querySelector(".bb-capture-toolbar-item[data-type='drag']");l.addEventListener("mousedown",this.dragStart),l.addEventListener("touchstart",this.dragStart),document.addEventListener("mousemove",this.drag),document.addEventListener("touchmove",this.drag),document.addEventListener("mouseup",this.dragEnd),document.addEventListener("touchend",this.dragEnd),document.querySelector(".bb-capture-dismiss").onclick=function(){o.dismiss()};var u=document.querySelector(".bb-capture-button-next");u&&(u.onclick=this.showNextStep.bind(this));for(var d=document.querySelector(".bb-capture-toolbar-item-colorpicker"),p=document.querySelector(".bb-capture-svg"),f=function(e,t){for(var n=document.querySelectorAll(".bb-capture-toolbar-item-tool"),r=0;r<n.length;r++)n[r].classList.remove("bb-capture-toolbar-item--active");if(t.classList.add("bb-capture-toolbar-item--active"),o.screenDrawer.setTool(e),o.dragCursor.innerHTML="","pointer"===e)p.style.pointerEvents="none";else{p.style.pointerEvents="auto";try{var i=t.querySelector("svg").cloneNode(!0);i&&o.dragCursor&&o.dragCursor.appendChild(i)}catch(a){}}},h=document.querySelectorAll(".bb-capture-toolbar-item"),g=function(){var e=h[m];e.onclick=function(){var t=e.getAttribute("data-type");d&&"colorpicker"!==t&&(d.style.display="none"),"mic"===t&&o.screenRecorder.toggleAudio(),"recording"===t&&(o.screenRecorder.isRecording?o.screenRecorder.stopScreenRecording():(o.screenRecorder.startScreenRecording(),f("pointer",document.querySelector(".bb-capture-toolbar-item[data-type='pointer']")))),("capture"!==o.type||o.screenRecorder.isRecording)&&("pen"!==t&&"blur"!==t&&"rect"!==t&&"pointer"!==t||f(t,e),"colorpicker"===t&&("flex"===d.style.display?d.style.display="none":d.style.display="flex"),"undo"===t&&o.screenDrawer.removeLastAddedPathFromSvg())}},m=0;m<h.length;m++)g()}},{key:"captureScreenDrawerRerender",value:function(){if(this.screenDrawer)for(var e="bb-capture-editor-item-inactive",t=document.querySelectorAll(".bb-capture-toolbar-item"),n=0;n<t.length;n++){var r=t[n];"undo"===r.getAttribute("data-type")&&(null!=this.screenDrawer.pathBuffer&&this.screenDrawer.pathBuffer.length>0?r.classList.remove(e):r.classList.add(e))}}},{key:"captureRenderer",value:function(){if(this.screenRecorder){this.screenRecorder.file&&oh.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 c=document.querySelector(".bb-capture-toolbar");document.querySelector(".bb-capture-preview").style.display=this.screenRecorder.file?"flex":"none",c.style.display=this.screenRecorder.file?"none":"flex";for(var l=0;l<n.length;l++){var u=n[l];switch(u.getAttribute("data-type")){case"mic":this.screenRecorder.audioAvailable&&this.screenRecorder.available?(u.classList.remove(e),this.screenRecorder.audioMuted?(u.classList.add("bb-capture-toolbar-item--inactivecross"),o.innerHTML=Vf.translateText("unmute")):(u.classList.remove("bb-capture-toolbar-item--inactivecross"),o.innerHTML=Vf.translateText("mute"))):(u.classList.add(e),u.classList.add("bb-capture-toolbar-item--inactivecross"),o.innerHTML=Vf.translateText("browserNotSupported"));break;case"recording":this.screenRecorder.available?(u.classList.remove(e),this.screenRecorder.isRecording?(u.setAttribute("data-active","true"),r.innerHTML=Vf.translateText("stopRecording"),t.style.display="block"):(u.setAttribute("data-active","false"),r.innerHTML=Vf.translateText("startRecording"),t.style.display="none")):(u.classList.add(e),r.innerHTML=Vf.translateText("browserNotSupported"))}}}}},{key:"setupScreenRecording",value:function(){var e=this;document.querySelector(".bb-capture-preview-sendbutton").onclick=this.showNextStep.bind(this),document.querySelector(".bb-capture-preview-retrybutton").onclick=function(){e.screenRecorder.clearPreview(),e.screenDrawer&&e.screenDrawer.clear()},this.screenRecorder=new Ts(this.captureRenderer.bind(this),Vf.translateText("accessToScreenSharingDenied"))}}],r=[{key:"setPenColor",value:function(e){for(var t=document.querySelectorAll(".bb-pen-tip"),n=0;n<t.length;n++)t[n].style.fill=e}}],n&&ec(t.prototype,n),r&&ec(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function oc(e){return oc="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},oc(e)}function ic(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sc(r.key),r)}}function ac(e,t,n){return(t=sc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sc(e){var t=function(e,t){if("object"!=oc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=oc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oc(t)?t:String(t)}var cc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ac(this,"sessionStart",new Date),ac(this,"appBuildNumber",""),ac(this,"appVersionCode",""),ac(this,"environment","prod"),ac(this,"envDataPropsToIgnore",[]),ac(this,"envDataDisabled",!1)}var t,n,r;return t=e,n=[{key:"getSessionDuration",value:function(){var e=new Date;return Math.round((e.getTime()-this.sessionStart.getTime())/1e3)}},{key:"getMetaData",value:function(){if(this.envDataDisabled)return{};for(var e=this.collectMetaData(),t=0;t<this.envDataPropsToIgnore.length;t++)delete e[this.envDataPropsToIgnore[t]];return e}},{key:"collectMetaData",value:function(){var e,t,n,r=navigator.userAgent,o=navigator.appName,i=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10);-1!==(t=r.indexOf("Opera"))?(o="Opera",i=r.substring(t+6),-1!==(t=r.indexOf("Version"))&&(i=r.substring(t+8))):-1!==(t=r.indexOf("MSIE"))?(o="Microsoft Internet Explorer",i=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(o="Chrome",i=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(o="Safari",i=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(i=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(o="Firefox",i=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(o=r.substring(e,t),i=r.substring(t+1),o.toLowerCase()===o.toUpperCase()&&(o=navigator.appName)),-1!==(n=i.indexOf(";"))&&(i=i.substring(0,n)),-1!==(n=i.indexOf(" "))&&(i=i.substring(0,n)),a=parseInt(""+i,10),isNaN(a)&&(i=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10));var s="Unknown OS";return-1!==navigator.appVersion.indexOf("Win")&&(s="Windows"),-1!==navigator.appVersion.indexOf("Mac")&&(s="MacOS"),-1!==navigator.appVersion.indexOf("X11")&&(s="UNIX"),-1!==navigator.appVersion.indexOf("Linux")&&(s="Linux"),-1!==navigator.appVersion.indexOf("iPad")&&(s="iPad"),-1!==navigator.appVersion.indexOf("iPhone")&&(s="iPhone"),-1!==navigator.appVersion.indexOf("Android")&&(s="Android"),{browserName:o+"("+i+")",userAgent:r,browser:o,systemName:s,buildVersionNumber:this.appBuildNumber,releaseVersionNumber:this.appVersionCode,sessionDuration:this.getSessionDuration(),devicePixelRatio:window.devicePixelRatio,screenWidth:window.screen.width,screenHeight:window.screen.height,innerWidth:window.innerWidth,innerHeight:window.innerHeight,currentUrl:window.location.href,language:navigator.language||navigator.userLanguage,mobile:Q(),sdkVersion:"19.0.0",sdkType:"javascript",environment:this.environment}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"setAppVersionCode",value:function(e){this.getInstance().appVersionCode=e}},{key:"setAppBuildNumber",value:function(e){this.getInstance().appBuildNumber=e}},{key:"setEnvDataPropsToIgnore",value:function(e){this.getInstance().envDataPropsToIgnore=Array.isArray(e)?e.slice():[]}},{key:"setDisableEnvData",value:function(e){this.getInstance().envDataDisabled=!!e}}],n&&ic(t.prototype,n),r&&ic(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function lc(e){return lc="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},lc(e)}function uc(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 dc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(n),!0).forEach((function(t){fc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hc(r.key),r)}}function fc(e,t,n){return(t=hc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hc(e){var t=function(e,t){if("object"!=lc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=lc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lc(t)?t:String(t)}ac(cc,"instance",void 0);var gc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),fc(this,"modalUrl","https://outboundmedia.gleap.io/modal"),fc(this,"modalContainer",null),fc(this,"modalData",null),fc(this,"modalBackdropClickListener",null),fc(this,"modalResizeListener",null),fc(this,"modalLoadTimeout",null),fc(this,"modalLoaded",!1),fc(this,"lastSentMaxHeight",0),fc(this,"disabled",!1),this._listenForMessages()}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"setModalUrl",value:function(e){this.modalUrl=e}},{key:"_maxModalHeight",value:function(){var e,t=(null===(e=document.documentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight||0;return Math.floor(.9*t)}},{key:"disable",value:function(){this.disabled=!0,this.hideModal()}},{key:"_listenForMessages",value:function(){var e=this;window.addEventListener("message",(function(t){var n,r=e.modalContainer?e.modalContainer.querySelector(".gleap-modal-frame"):null,o=r&&t.source===r.contentWindow,i=null===(n=e.modalUrl)||void 0===n?void 0:n.includes(t.origin);if(o||i)try{var a,s,c,l,u,d,p,f,h,g,m=JSON.parse(t.data);if("MODAL"!==(null==m?void 0:m.type))return;if("modal-loaded"===m.name&&(e.modalLoaded=!0,e._clearLoadWatchdog()),"modal-loaded"===m.name&&e.modalData&&e.sendModalData(),"modal-height"===m.name){var v,y=null==m||null===(v=m.data)||void 0===v?void 0:v.height;if(y){var b=e.modalContainer.querySelector(".gleap-modal-frame");b&&(b.style.height="".concat(y,"px")),e._revealModal()}}if(m.name,"modal-close"===m.name&&e.hideModal(),"start-conversation"===m.name&&oh.startBot(null===(a=m.data)||void 0===a?void 0:a.botId),"start-custom-action"===m.name&&oh.triggerCustomAction(null===(s=m.data)||void 0===s?void 0:s.action),"start-product-tour"===m.name&&oh.startProductTour(null===(c=m.data)||void 0===c?void 0:c.tourId,!0),"open-url"===m.name){var w=m.data,k=!!m.newTab;zs.getInstance().urlHandler(w,k)}"show-form"===m.name&&oh.startFeedbackFlow(null===(l=m.data)||void 0===l?void 0:l.formId),"show-survey"===m.name&&oh.showSurvey(null===(u=m.data)||void 0===u?void 0:u.formId,null===(d=m.data)||void 0===d?void 0:d.surveyFormat),"show-news-article"===m.name&&oh.openNewsArticle(null===(p=m.data)||void 0===p?void 0:p.articleId),"show-help-article"===m.name&&oh.openHelpCenterArticle(null===(f=m.data)||void 0===f?void 0:f.articleId),"show-checklist"===m.name&&oh.startChecklist(null===(h=m.data)||void 0===h?void 0:h.checklistId,!0,null===(g=m.data)||void 0===g?void 0:g.sharedKey)}catch(x){}}))}},{key:"_injectModalUI",value:function(e){var t=this;if(!document.body)return!1;if(this.disabled)return!1;this.modalContainer&&this.hideModal(),this.modalData=e;var n=document.createElement("div");n.className="gleap-modal-wrapper gleap-modal-wrapper--loading",n.innerHTML='\n <div class="gleap-modal-backdrop"></div>\n <div class="gleap-modal">\n <iframe\n class="gleap-modal-frame"\n scrolling="no"\n title="Gleap Modal"\n role="dialog"\n frameborder="0"\n allow="autoplay; encrypted-media; fullscreen; microphone *;"\n ></iframe>\n </div>\n ',document.body.appendChild(n),this.modalContainer=n;var r=n.querySelector(".gleap-modal-frame");r&&(K(r,this.modalUrl),this._armLoadWatchdog(r)),this.modalBackdropClickListener=this.modalContainer.querySelector(".gleap-modal-backdrop").addEventListener("click",(function(){var e,n;(null===(e=null===(n=t.modalData)||void 0===n?void 0:n.showCloseButton)||void 0===e||e)&&t.hideModal()})),window.addEventListener("resize",this.modalResizeListener=this._handleResize.bind(this)),document.body.classList.add("gleap-modal-open")}},{key:"_revealModal",value:function(){this.modalContainer&&this.modalContainer.classList.remove("gleap-modal-wrapper--loading")}},{key:"_armLoadWatchdog",value:function(e){var t=this;this._clearLoadWatchdog(),this.modalLoaded=!1,this.modalLoadTimeout=setTimeout((function(){if(t.modalLoadTimeout=null,!t.modalLoaded&&t.modalContainer){try{e.getAttribute("src")!==t.modalUrl&&(e.src=t.modalUrl)}catch(n){}t.modalLoadTimeout=setTimeout((function(){if(t.modalLoadTimeout=null,!t.modalLoaded&&t.modalContainer){try{console.warn("Gleap: the info card ("+t.modalUrl+") 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.hideModal()}}),8e3)}}),8e3)}},{key:"_clearLoadWatchdog",value:function(){this.modalLoadTimeout&&(clearTimeout(this.modalLoadTimeout),this.modalLoadTimeout=null)}},{key:"_handleResize",value:function(){var e=this._maxModalHeight();e<=0||e===this.lastSentMaxHeight||(this.lastSentMaxHeight=e,this._postMessage({name:"modal-max-height",data:{maxHeight:e}}))}},{key:"sendModalData",value:function(){if(this.modalLoaded&&this.modalData){var e=br.getInstance().getFlowConfig(),t=e.color?e.color:"#485BFF",n=e.backgroundColor?e.backgroundColor:"#FFFFFF";this.lastSentMaxHeight=this._maxModalHeight(),this._postMessage({name:"modal-data",data:dc(dc({},this.modalData),{},{primaryColor:t,backgroundColor:n,maxHeight:this.lastSentMaxHeight})})}}},{key:"_postMessage",value:function(e){try{var t=this.modalContainer.querySelector(".gleap-modal-frame");null!=t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(dc(dc({},e),{},{type:"modal"})),"*")}catch(n){}}},{key:"showModal",value:function(e){e&&e.config&&this._injectModalUI(e.config)}},{key:"hideModal",value:function(){this.modalContainer&&(this.modalBackdropClickListener&&this.modalContainer.querySelector(".gleap-modal-backdrop").removeEventListener("click",this.modalBackdropClickListener),this.modalResizeListener&&(window.removeEventListener("resize",this.modalResizeListener),this.modalResizeListener=null),this._clearLoadWatchdog(),this.modalLoaded=!1,this.lastSentMaxHeight=0,document.body.removeChild(this.modalContainer),this.modalContainer=null,document.body.classList.remove("gleap-modal-open"))}}])&&pc(t.prototype,n),r&&pc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function mc(e){return mc="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},mc(e)}fc(gc,"instance",void 0);var vc=["gleap.io","gleap.ai"],yc="[REDACTED]",bc="[body not captured]",wc=["authorization","proxy-authorization","cookie","set-cookie"],kc=/^[^\s=&]+=[^\s&]*(?:&[^\s=&]+=[^\s&]*)*$/,xc=function(e){var t=[];if("string"==typeof e&&(e=[e]),!Array.isArray(e))return t;for(var n=0;n<e.length;n++)if("string"==typeof e[n]){var r=e[n].trim();r.length>0&&-1===t.indexOf(r)&&t.push(r)}return t},Sc=function(e,t){if("string"!=typeof e||!Array.isArray(t))return!1;for(var n=0;n<t.length;n++){var r=t[n];if("string"==typeof r&&r.length>0&&-1!==e.indexOf(r))return!0}return!1},Cc=function(e,t){return"string"==typeof t&&-1!==e.props.indexOf(t.toLowerCase())},Ic=function(e,t){for(var n={},r=!1,o=Object.keys(e),i=0;i<o.length;i++){var a=o[i];Cc(t,a)?r=!0:-1!==wc.indexOf(a.toLowerCase())&&e[a]!==yc?(n[a]=yc,r=!0):n[a]=e[a]}return r?n:null},Ec=function(e,t){if("string"==typeof e){var n;try{n=JSON.parse(e)}catch(i){return e}if(!n||"object"!==mc(n)||Array.isArray(n))return e;var r=Ic(n,t);return r?JSON.stringify(r):e}if(Array.isArray(e)){var o=function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];if(!Array.isArray(r)||r.length<2)return null;var o=String(r[0]);t[o]=void 0!==t[o]?t[o]+", "+r[1]:r[1]}return t}(e);return o?Ic(o,t)||o:e}return e&&"object"===mc(e)?Ic(e,t)||Object.assign({},e):e},Tc=function(e,t){if(!e||"object"!==mc(e)||Array.isArray(e))return"";for(var n=Object.keys(e),r=0;r<n.length;r++)if(n[r].toLowerCase()===t)return"string"==typeof e[n[r]]?e[n[r]]:"";return""},Lc=function(e){var t=e.replace(/\+/g," ");try{return decodeURIComponent(t)}catch(n){return t}},Oc=function(e,t){if("string"!=typeof e||0===e.length||0===t.props.length)return e;for(var n=e.split("&"),r=[],o=!1,i=0;i<n.length;i++){var a=n[i],s=a.indexOf("="),c=Lc(-1===s?a:a.slice(0,s));a.length>0&&Cc(t,c)?o=!0:r.push(a)}return o?r.join("&"):e},Ac=function(e){if(e>500)throw new Error("Network log body is nested too deeply to redact.")},Mc=function e(t,n,r){Ac(r);var o=!1;if(Array.isArray(t)){for(var i=0;i<t.length;i++)t[i]&&"object"===mc(t[i])&&e(t[i],n,r+1)&&(o=!0);return o}for(var a=Object.keys(t),s=0;s<a.length;s++){var c=a[s];Cc(n,c)?(delete t[c],o=!0):t[c]&&"object"===mc(t[c])&&e(t[c],n,r+1)&&(o=!0)}return o},Pc=function e(t,n,r,o){Ac(o);var i=!1;if(Array.isArray(t)){for(var a=0;a<t.length;a++)t[a]&&"object"===mc(t[a])&&e(t[a],n,r,o+1)&&(i=!0);return i}for(var s=r===n.length-1,c=Object.keys(t),l=0;l<c.length;l++){var u=c[l];u.toLowerCase()===n[r]&&(s?(delete t[u],i=!0):t[u]&&"object"===mc(t[u])&&e(t[u],n,r+1,o+1)&&(i=!0))}return i},Rc=function(e,t){for(var n=Mc(e,t,0),r=0;r<t.paths.length;r++)Pc(e,t.paths[r],0,0)&&(n=!0);return n},Nc=/\n… \[truncated, [^\]]*\]$/,jc=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},_c=function(e,t,n){if(0===n.props.length||null==e)return e;try{if("string"==typeof e){var r=e.trim().charAt(0);if("{"===r||"["===r){var o;try{o=JSON.parse(e)}catch(a){o=void 0}return o&&"object"===mc(o)?Rc(o,n)?JSON.stringify(o):e:function(e,t){for(var n=[],r=0;r<t.props.length;r++){var o=t.props[r],i=o.slice(o.lastIndexOf(".")+1);-1===n.indexOf(o)&&n.push(o),i.length>0&&-1===n.indexOf(i)&&n.push(i)}for(var a=Nc.exec(e),s=a?e.slice(0,a.index):e,c=s,l=0;l<n.length;l++){var u=new RegExp('"('+jc(n[l])+')"(\\s*:\\s*)("(?:[^"\\\\]|\\\\.)*"?|-?\\d[0-9.eE+-]*|true|false|null)',"gi");c=c.replace(u,'"$1"$2"'+yc+'"')}return c===s?e:c+(a?a[0]:"")}(e,n)}return function(e,t){return t?-1!==t.toLowerCase().indexOf("application/x-www-form-urlencoded"):kc.test(e)}(e,t)?Oc(e,n):e}if("object"===mc(e)){var i=JSON.parse(JSON.stringify(e));return i&&"object"===mc(i)&&Rc(i,n),i}}catch(a){return bc}return e},Dc=function(e,t){var n=Object.assign({},e);if("string"==typeof n.url&&(n.url=function(e,t){if("string"!=typeof e||0===t.props.length)return e;var n=e.indexOf("#"),r=-1===n?e:e.slice(0,n),o=r.indexOf("?");if(-1===o)return e;var i=r.slice(o+1),a=Oc(i,t);return a===i?e:r.slice(0,o)+(a.length>0?"?"+a:"")+(-1===n?"":e.slice(n))}(n.url,t)),n.request&&"object"===mc(n.request)&&!Array.isArray(n.request)){var r=Object.assign({},n.request),o=Tc(r.headers,"content-type");void 0!==r.headers&&(r.headers=Ec(r.headers,t)),void 0!==r.payload&&(r.payload=_c(r.payload,o,t)),n.request=r}if(n.response&&"object"===mc(n.response)&&!Array.isArray(n.response)){var i=Object.assign({},n.response),a=Tc(i.headers,"content-type");void 0!==i.headers&&(i.headers=Ec(i.headers,t)),void 0!==i.responseText&&(i.responseText=_c(i.responseText,a,t)),n.response=i}return n},Fc=function(e,t){var n=[];if(!Array.isArray(e))return n;for(var r=function(e){for(var t=xc(e).map((function(e){return e.toLowerCase()})),n=[],r=0;r<t.length;r++)if(-1!==t[r].indexOf(".")){var o=t[r].split(".");o.every((function(e){return e.length>0}))&&n.push(o)}return{props:t,paths:n}}(t&&t.propsToIgnore),o=xc(vc.concat(t&&t.blacklist||[])),i=0;i<e.length;i++){var a=e[i];if(a&&"object"===mc(a)&&!Array.isArray(a)&&!Sc(a.url,o))try{n.push(Dc(a,r))}catch(s){}}return n};function Bc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hc(r.key),r)}}function Uc(e,t,n){return(t=Hc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hc(e){var t=function(e,t){if("object"!=zc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=zc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zc(t)?t:String(t)}function zc(e){return zc="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},zc(e)}var qc=15e4,Wc="[body pending]",Gc="[binary body omitted]",Vc="[streaming body omitted]",Xc=["text/event-stream","application/x-ndjson","application/stream+json","multipart/x-mixed-replace","grpc"],Jc=["json","xml","text/","javascript","x-www-form-urlencoded","graphql"],Kc=function(e){if("string"!=typeof e||0===e.trim().length)return"unknown";for(var t=e.toLowerCase(),n=0;n<Xc.length;n++)if(-1!==t.indexOf(Xc[n]))return"stream";for(var r=0;r<Jc.length;r++)if(-1!==t.indexOf(Jc[r]))return"text";return"binary"},$c=function(){try{if("undefined"!=typeof performance&&"function"==typeof performance.now)return performance.now()}catch(e){}return Date.now()},Yc=function(e){return Math.max(0,Math.round($c()-e))},Zc=function(e){return"\n… [truncated, "+("number"==typeof e?e:"more than "+qc)+" bytes]"},Qc=function(e){if("string"!=typeof e)return"";if(e.length<=qc)return e;var t=qc,n=e.charCodeAt(t-1);return n>=55296&&n<=56319&&(t-=1),e.slice(0,t)+Zc(e.length<=1e6?function(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128)t+=1;else if(r<2048)t+=2;else if(r>=55296&&r<=56319&&n+1<e.length){var o=e.charCodeAt(n+1);o>=56320&&o<=57343?(t+=4,n++):t+=3}else t+=3}return t}(e):void 0)},el=function(e,t){for(var n=t.toLowerCase(),r=Object.keys(e),o=0;o<r.length;o++)if(r[o].toLowerCase()===n)return r[o]},tl=function(e,t,n){var r=el(e,t);void 0!==r?e[r]=e[r]+", "+n:e[t]=n},nl=function(e,t){var n=e?el(e,t):void 0;return void 0!==n?e[n]:""},rl=function(e){var t={};if(!e||"object"!==zc(e))return t;try{if("function"==typeof e.forEach&&"function"==typeof e.get)e.forEach((function(e,n){tl(t,String(n),String(e))}));else if(Array.isArray(e))for(var n=0;n<e.length;n++)e[n]&&e[n].length>=2&&tl(t,String(e[n][0]),String(e[n][1]));else for(var r=Object.keys(e),o=0;o<r.length;o++)tl(t,r[o],String(e[r[o]]))}catch(i){}return t},ol=function(e){var t={};if("string"!=typeof e)return t;for(var n=e.trim().split(/[\r\n]+/),r=0;r<n.length;r++){var o=n[r].indexOf(":");o>0&&tl(t,n[r].slice(0,o).trim(),n[r].slice(o+1).trim())}return t},il=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}},al=function(e,t,n,r){var o,i=e.byteLength>qc||"number"==typeof r&&r>qc,a=e.byteLength>qc?e.subarray(0,qc):e;try{if(n){if(-1!==(o=new TextDecoder("utf-8",{fatal:!0}).decode(a,{stream:i})).indexOf("\0"))return Gc}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?Gc:bc}return i?o+Zc("number"==typeof r?r:void 0):o},sl=function(e,t,n){var r=e.getReader(),o=[],i=0,a=function(e){for(var r=new Uint8Array(i),a=0,s=0;s<o.length;s++)r.set(o[s],a),a+=o[s].byteLength;return al(r,t,n,e?i:void 0)};return function e(){return r.read().then((function(t){if(t.done)return a(!0);var n=t.value;if(n&&n.byteLength>0&&(o.push(n instanceof Uint8Array?n:new Uint8Array(n)),i+=n.byteLength),i>qc){try{r.cancel().catch((function(){}))}catch(s){}return a(!1)}return e()}))}()},cl=function(e,t,n){var r=e.size>qc?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 al(new Uint8Array(r),t,n,e.size)}))},ll=function(e,t){if(null==e)return{text:""};try{var n=Kc(t);if("stream"===n)return{text:Vc};if("string"==typeof e)return{text:"binary"===n?Gc:Qc(e)};var r=function(e){return Object.prototype.toString.call(e)}(e);if("[object URLSearchParams]"===r)return{text:Qc(e.toString())};if("[object FormData]"===r)return{text:(s=e,c={},s.forEach((function(e,t){var n;n="string"==typeof e?e.length>1e4?e.slice(0,1e4)+"… [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(c,t)?c[t]=[].concat(c[t],n):Object.defineProperty(c,t,{value:n,enumerable:!0,writable:!0,configurable:!0})})),Qc(JSON.stringify(c)))};if("[object ReadableStream]"===r)return{text:Vc};if("[object Blob]"===r||"[object File]"===r){var o=t||e.type||"",i=Kc(o);return"stream"===i?{text:Vc}:"binary"===i?{text:Gc}:{text:Wc,promise:cl(e,o,"unknown"===i)}}if("[object ArrayBuffer]"===r||"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)){if("binary"===n)return{text:Gc};var a="[object ArrayBuffer]"===r?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{text:al(a,t,"unknown"===n,a.byteLength)}}return"[object Document]"===r||"[object HTMLDocument]"===r||"[object XMLDocument]"===r?{text:bc}:{text:"binary"===n?Gc:Qc(String(e))}}catch(l){return{text:bc}}var s,c},ul=function(e,t,n){e[t]=n.text,n.promise&&n.promise.then((function(n){e[t]=n}),(function(){e[t]=bc}))},dl=function(e){try{if(e&&"object"===zc(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"}},pl=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."},fl=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Uc(this,"requestId",0),Uc(this,"requests",{}),Uc(this,"externalRequests",[]),Uc(this,"maxRequests",30),Uc(this,"localFilters",[]),Uc(this,"remoteFilters",[]),Uc(this,"localBlacklist",[]),Uc(this,"remoteBlacklist",[]),Uc(this,"initialized",!1),Uc(this,"stopped",!1),Uc(this,"loadAllResources",!1)}var t,n,r;return t=e,n=[{key:"setLoadAllResources",value:function(e){this.loadAllResources=e}},{key:"setExternalRequests",value:function(e){var t=[];if(Array.isArray(e))for(var n=0;n<e.length;n++)try{var r=JSON.parse(JSON.stringify(e[n]));r&&"object"===zc(r)&&!Array.isArray(r)&&t.push(r)}catch(o){}this.externalRequests=t}},{key:"getRequests",value:function(){try{for(var e=[],t=Object.keys(this.requests),n=0;n<t.length;n++)this.requests[t[n]]&&e.push(this.requests[t[n]]);if(Array.isArray(this.externalRequests))for(var r=0;r<this.externalRequests.length;r++)e.push(this.externalRequests[r]);return Fc(e.concat(this.getResourceRequests(e)),{propsToIgnore:this.getFilters(),blacklist:this.getBlacklist()})}catch(o){return[]}}},{key:"getResourceRequests",value:function(e){var t=[];try{if("undefined"==typeof window||!window.performance||"function"!=typeof window.performance.getEntriesByType)return t;for(var n={},r=0;r<e.length;r++){var o=e[r];o&&"string"==typeof o.url&&(n["url:"+il(o.url)]=!0)}for(var i=this.getBlacklist(),a=function(e){return"number"==typeof e.timeOrigin&&e.timeOrigin>0?e.timeOrigin:e.timing&&e.timing.navigationStart>0?e.timing.navigationStart:Date.now()-e.now()}(window.performance),s=window.performance.getEntriesByType("resource"),c=0;c<s.length;c++){var l=s[c];if(l&&l.name&&(this.loadAllResources||-1!==["xmlhttprequest","fetch"].indexOf(l.initiatorType))&&!n["url:"+l.name]&&!Sc(l.name,i)){var u=a+l.startTime;t.push({type:"RESOURCE",date:new Date(isFinite(u)?u:Date.now()).toISOString(),url:l.name,duration:Math.round(l.duration),initiatorType:l.initiatorType})}}}catch(d){}return t.length>this.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=xc(e)}},{key:"setRemoteFilters",value:function(e){this.remoteFilters=xc(e)}},{key:"setBlacklist",value:function(e){this.localBlacklist=xc(e)}},{key:"setRemoteBlacklist",value:function(e){this.remoteBlacklist=xc(e)}},{key:"getFilters",value:function(){return xc(this.remoteFilters.concat(this.localFilters))}},{key:"getBlacklist",value:function(){return xc(vc.concat(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<t.length;n++)delete this.requests[t[n]]}},{key:"createRequest",value:function(e,t){if(Sc(t,this.getBlacklist()))return null;var n={date:(new Date).toISOString(),type:e,url:t,request:{headers:{},payload:""}};return this.requests[++this.requestId]=n,this.cleanRequests(),n}},{key:"start",value:function(){if(!this.initialized){this.initialized=!0;try{this.interceptXhr()}catch(e){}try{this.interceptFetch()}catch(e){}}}},{key:"interceptFetch",value:function(){if("undefined"!=typeof window&&"function"==typeof window.fetch){var e=this,t=window.fetch;window.fetch=function(n,r){if(!e.isCapturing())return t.apply(this,arguments);var o,i=null;try{i=e.startFetch(n,r)}catch(a){}try{o=t.apply(this,arguments)}catch(s){if(i)try{e.failFetch(i,s)}catch(a){}throw s}if(i&&o&&"function"==typeof o.then)try{return o.then((function(t){try{e.finishFetch(i,t)}catch(a){}return t}),(function(t){try{e.failFetch(i,t)}catch(a){}throw t}))}catch(a){}return o}}}},{key:"startFetch",value:function(e,t){var n=$c(),r="undefined"!=typeof Request&&e instanceof Request,o=t&&t.method?t.method:r?e.method:"GET";o=String(o||"GET").toUpperCase();var i=this.createRequest(o,il(r?e.url:e));if(!i)return null;i.request.headers=rl(t&&void 0!==t.headers?t.headers:r?e.headers:void 0);var a=nl(i.request.headers,"content-type"),s={text:""};try{t&&void 0!==t.body&&null!==t.body?s=ll(t.body,a):r&&(s=function(e,t,n){if("GET"===t||"HEAD"===t||null===e.body)return{text:""};var r=Kc(n);if("stream"===r)return{text:Vc};if("binary"===r)return{text:Gc};if(e.bodyUsed)return{text:bc};var o=e.clone();return o.body&&"function"==typeof o.body.getReader?{text:Wc,promise:sl(o.body,n,"unknown"===r)}:{text:Wc,promise:o.arrayBuffer().then((function(e){var t=new Uint8Array(e);return 0===t.byteLength?"":al(t,n,"unknown"===r,t.byteLength)}))}}(e,o,a))}catch(c){s={text:bc}}return ul(i.request,"payload",s),{request:i,start:n}}},{key:"finishFetch",value:function(e,t){var n=e.request;n.duration=Yc(e.start),n.success=!0;var r=rl(t&&t.headers),o={status:t?t.status:0,statusText:t&&t.statusText?t.statusText:"",headers:r,responseText:Wc};n.response=o;var i=function(e){o.responseText=e};try{if(!t||"opaque"===t.type||"opaqueredirect"===t.type)return i(bc);if(null===t.body)return i("");var a=nl(r,"content-type"),s=Kc(a);if("stream"===s)return i(Vc);if("binary"===s)return i(Gc);var c=t.clone();if(c.body&&"function"==typeof c.body.getReader)return void sl(c.body,a,"unknown"===s).then(i,(function(){return i(bc)}));var l=parseInt(nl(r,"content-length"),10);if("function"==typeof c.text&&l>=0&&l<=qc)return void c.text().then((function(e){return i(Qc(e))}),(function(){return i(bc)}));i(bc)}catch(u){i(bc)}}},{key:"failFetch",value:function(e,t){var n=e.request;n.duration=Yc(e.start),n.success=!1,n.response={errorText:dl(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&&tl(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),dl(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=il(r),o.headers={},o.capture=this.isCapturing()&&!Sc(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=$c(),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 ul(i.request,"payload",a?ll(n,nl(r.headers,"content-type")):{text:""}),r.request=i,r.start=o,!0}},{key:"recordXhrHeaders",value:function(e,t){t.headersAt=$c();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:ol(e.getAllResponseHeaders()),responseText:Wc}}},{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=Yc(t.start),r.success=!1,void(r.response={errorText:pl(o,e)});r.duration=t.headersAt?Math.max(0,Math.round(t.headersAt-t.start)):Yc(t.start),r.success=!0;var i,a=ol(e.getAllResponseHeaders());try{i=function(e,t){var n=Kc(nl(t,"content-type"));if("stream"===n)return Vc;var r=e.responseType;if(""===r||"text"===r){if("binary"===n)return Gc;var o=e.responseText;return"string"!=typeof o?"":"unknown"===n&&-1!==o.slice(0,qc).indexOf("\0")?Gc:Qc(o)}if("json"===r){if(null===e.response||void 0===e.response)return"";var i=Rr(e.response,qc);return i.truncated?i.text+Zc():i.text}return"document"===r?bc:Gc}(e,a)}catch(s){i=bc}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&&Bc(t.prototype,n),r&&Bc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Uc(fl,"instance",void 0);const hl=fl;function gl(e){return gl="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},gl(e)}function ml(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,yl(r.key),r)}}function vl(e,t,n){return(t=yl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yl(e){var t=function(e,t){if("object"!=gl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=gl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gl(t)?t:String(t)}var bl=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),vl(this,"notificationContainer",null),vl(this,"notifications",[]),vl(this,"unreadCount",0),vl(this,"unreadNotificationsKey","unread-notifications"),vl(this,"isTabActive",!0),vl(this,"showNotificationBadge",!0),vl(this,"lastPageRulesUrl",void 0),vl(this,"stackResizeObserver",null),vl(this,"currentNewsIndex",0)}var t,n,r;return t=e,n=[{key:"updateTabBarNotificationCount",value:function(){Ft.notifyEvent("unread-count-changed",this.unreadCount)}},{key:"injectNotificationUI",value:function(){if(!this.notificationContainer){var e=document.createElement("div");e.className="gleap-notification-container gleap-font",document.body.appendChild(e),this.notificationContainer=e,e.addEventListener("click",(function(t){e.classList.contains("gleap-notification-container--stack")&&!e.classList.contains("gleap-notification-container--expanded")&&window.matchMedia&&window.matchMedia("(hover: none)").matches&&(t.target&&t.target.closest&&t.target.closest(".gleap-notification-close")||(t.preventDefault(),t.stopPropagation(),e.classList.add("gleap-notification-container--expanded")))}),!0),this.updateContainerStyle(),this.reloadNotificationsFromCache(),_f.getInstance().start()}}},{key:"reloadNotificationsFromCache",value:function(){try{var e=ie(this.unreadNotificationsKey);if(e&&e.length>0){var t=e.filter((function(e){var t;return"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=t.slice(-4),this.renderNotifications()}}catch(n){}}},{key:"notificationPassesPageRules",value:function(e){try{var t="undefined"!=typeof window&&window.location?window.location.href:void 0;return!t||rs(t,e)}catch(n){return!0}}},{key:"getVisibleNotifications",value:function(){var e=this;return 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(),j.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=Pn.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(a){}for(this.notifications.find((function(t){return e.outbound===t.outbound}))||(this.notifications.push(e),e.sound&&this.notificationPassesPageRules(e)&&Dn.ping());this.notifications.length>4;)this.notifications.shift();ae(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=fe("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.currentNewsIndex<r.length?this.currentNewsIndex:0,a=r[i],s=document.createElement("div");s.className="gleap-notification-item-news gleap-notification-card";var c=document.createElement("div");if(c.className="gleap-notification-item-news-container",a.data.coverImageUrl&&""!==a.data.coverImageUrl&&!a.data.coverImageUrl.includes("NewsImagePlaceholder")){var l=document.createElement("img");l.className="gleap-notification-item-news-image",l.src=a.data.coverImageUrl,l.onclick=function(t){t.stopPropagation(),e.openNews(a)},c.appendChild(l)}var u=document.createElement("div");u.className="gleap-notification-item-news-content";var d=document.createElement("div");d.className="gleap-notification-item-news-content-title";var p=a.data.text||"";p=p.replaceAll("{{name}}",vs.getInstance().getName()),d.innerText=p,d.onclick=function(t){t.stopPropagation(),e.openNews(a)},u.appendChild(d);var f=this.renderDescription(a);if(f){var h=document.createElement("div");h.className="gleap-notification-item-news-preview",h.innerHTML=f,u.appendChild(h)}if(r.length>1){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<r.length-1?(v.innerText=Vf.translateText("next"),v.onclick=function(t){t.stopPropagation(),e.currentNewsIndex++,e.renderNotifications()}):(v.innerText=Vf.translateText("done"),v.onclick=function(t){t.stopPropagation(),e.clearAllNotifications(),e.currentNewsIndex=0}),g.appendChild(v),u.appendChild(g)}c.appendChild(u),s.appendChild(c),this.notificationContainer.appendChild(s)}for(var y=function(){var t=o[b],n=t.data.text||"";n=n.replaceAll("{{name}}",vs.getInstance().getName());var r=document.createElement("div");if(r.onclick=function(){t.data.conversation?oh.openConversation(t.data.conversation.shareToken,!0):t.data.checklist?oh.openChecklist(t.data.checklist.id,!0):oh.open()},t.data.checklist){var i=Math.round(t.data.currentStep/t.data.totalSteps*100);i<100&&(i+=4),r.className="gleap-notification-item-checklist gleap-notification-card",r.innerHTML='\n <div class="gleap-notification-item-checklist-container">\n <div class="gleap-notification-item-checklist-content">\n <div class="gleap-notification-item-checklist-content-title">\n '.concat(t.data.text,'\n </div>\n <div class="gleap-notification-item-checklist-content-progress">\n <div class="gleap-notification-item-checklist-content-progress-inner" style="width: ').concat(i,'%;"></div>\n </div>\n <div class="gleap-notification-item-checklist-content-next">\n <svg width="24" height="24" viewBox="0 0 24 24"\n fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M4 12H20M20 12L14 6M20 12L14 18"\n stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n ').concat(t.data.nextStepTitle,"\n </div>\n </div>\n </div>")}else r.className="gleap-notification-item gleap-notification-card",r.innerHTML='\n <div class="gleap-notification-item-container">\n '.concat(e.renderAvatar(t.data.sender,"gleap-notification-item-avatar"),'\n <div class="gleap-notification-item-body">\n <div class="gleap-notification-item-content">').concat(n,"</div>\n ").concat(e.renderMeta(t),"\n </div>\n </div>");e.notificationContainer.appendChild(r)},b=0;b<o.length;b++)y();r.length>0||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,c=0===s?0:1===s?9:17;t[a].style.setProperty("--gleap-nstack-collapse","".concat(n[a]-r-c,"px")),t[a].style.setProperty("--gleap-nstack-expand","".concat(-i,"px"));var l=n[a]-(r-12);t[a].style.setProperty("--gleap-nstack-clip",s>0&&l>0?"".concat(l,"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<t.length;r++)this.stackResizeObserver.observe(t[r])}}catch(o){}}},{key:"openNews",value:function(e){e.data.news?oh.openNewsArticle(e.data.news.id,!0):oh.open()}},{key:"renderAvatar",value:function(e,t){if(!e||!e.profileImageUrl)return"";var n=String(e.name||"").replace(/"/g,"&quot;"),r=e.isBot?"".concat(t," ").concat(t,"--bot"):t;return'<img class="'.concat(r,'" src="').concat(e.profileImageUrl,'" alt="').concat(n,'" />')}},{key:"renderMeta",value:function(e){var t=e.data.sender,n=[];t&&t.name&&n.push('<span class="gleap-notification-item-sender">'.concat(t.name,"</span>"));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(c){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<re.length;a++){var s=re[a];if(Math.abs(i)<s.amount)return n.format(Math.round(i),s.unit);i/=s.amount}}catch(c){}return""}(e.sendAt||e.createdAt,Vf.getInstance().getActiveLanguage());return r&&n.push('<span class="gleap-notification-item-time">'.concat(r,"</span>")),0===n.length?"":'<div class="gleap-notification-item-meta">'.concat(n.join('<span class="gleap-notification-item-meta-dot">•</span>'),"</div>")}},{key:"renderDescription",value:function(e){var t=e.data,n=t.previewText,r=t.sender;return n&&n.length>0?n:r?'\n <div class="gleap-notification-item-news-sender">\n '.concat(this.renderAvatar(r,"gleap-notification-item-news-sender-avatar"),"\n ").concat(r.name,"\n </div>\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=ie(this.unreadNotificationsKey);r&&r.length>0&&ae(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||_f.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(o=vs.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(this.notificationContainer){for(e||(this.notifications=[],this.currentNewsIndex=0,ae(this.unreadNotificationsKey,this.notifications));this.notificationContainer.firstChild;)this.notificationContainer.removeChild(this.notificationContainer.firstChild);if(!e&&!t)try{var n;_f.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=vs.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(r){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=br.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!==j.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==j.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===j.getInstance().buttonHidden?e.feedbackButtonPosition===j.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):j.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",Vf.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&ml(t.prototype,n),r&&ml(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function wl(e){return wl="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},wl(e)}function kl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sl(r.key),r)}}function xl(e,t,n){return(t=Sl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sl(e){var t=function(e,t){if("object"!=wl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=wl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wl(t)?t:String(t)}vl(bl,"instance",void 0);var Cl=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xl(this,"formPreFill",{})}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=null)&&kl(t.prototype,n),r&&kl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Il(e){return Il="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},Il(e)}function El(e){return function(e){if(Array.isArray(e))return Tl(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 Tl(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 Tl(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 Tl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ll(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 Ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ll(Object(n),!0).forEach((function(t){Al(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ll(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Al(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Il(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Il(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Il(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}xl(Cl,"instance",void 0);var Ml=function(){var e={};function t(){e=Ol({animate:!0,allowClose:!0,overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000"},arguments.length>0&&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(El(n?[e]:[]),r)})).filter((function(e){return"none"!==getComputedStyle(e).pointerEvents&&function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}(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}}var s={};function c(e,t){s[e]=t}function l(e){return e?s[e]:s}function u(){s={}}var d={};function p(e,t){d[e]=t}function f(e){var t;null==(t=d[e])||t.call(d)}function h(e){if(e){var t=e.getBoundingClientRect(),n={x:t.x,y:t.y,width:t.width,height:t.height};c("__activeStagePosition",n),m(n)}}function g(e){var t=function(e){var t=window.innerWidth,r=window.innerHeight,o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.classList.add("gleap-tour-overlay","gleap-tour-overlay-animated"),o.setAttribute("viewBox","0 0 ".concat(t," ").concat(r)),o.setAttribute("xmlSpace","preserve"),o.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),o.setAttribute("version","1.1"),o.setAttribute("preserveAspectRatio","xMinYMin slice"),o.style.fillRule="evenodd",o.style.clipRule="evenodd",o.style.strokeLinejoin="round",o.style.strokeMiterlimit="2",o.style.zIndex="10000",o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%";var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",v(e)),i.style.fill=n("overlayColor")||"rgb(0,0,0)",i.style.opacity="".concat(n("overlayOpacity")),i.style.pointerEvents="auto",i.style.cursor="auto",o.appendChild(i),o}(e);document.body.appendChild(t),S(t,(function(e){"path"===e.target.tagName&&f("overlayClick")})),c("__overlaySvg",t)}function m(e){var t=l("__overlaySvg");if(t){var n=t.firstElementChild;if("path"!==(null==n?void 0:n.tagName))throw new Error("no path element found in stage svg");n.setAttribute("d",v(e))}else g(e)}function v(e){var t=window.innerWidth,r=window.innerHeight,o=n("stagePadding")||0,i=n("stageRadius")||0,a=e.width+2*o,s=e.height+2*o,c=Math.min(i,a/2,s/2),l=Math.floor(Math.max(c,0)),u=e.x-o+l,d=e.y-o,p=a-2*l,f=s-2*l;return"M".concat(t,",0L0,0L0,").concat(r,"L").concat(t,",").concat(r,"L").concat(t,",0Z\n M").concat(u,",").concat(d," h").concat(p," a").concat(l,",").concat(l," 0 0 1 ").concat(l,",").concat(l," v").concat(f," a").concat(l,",").concat(l," 0 0 1 -").concat(l,",").concat(l," h-").concat(p," a").concat(l,",").concat(l," 0 0 1 -").concat(l,",-").concat(l," v-").concat(f," a").concat(l,",").concat(l," 0 0 1 ").concat(l,",-").concat(l," z")}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,o=e.element,a=o;if("string"==typeof a)try{a=document.querySelector(o)}catch(u){var s=o.replace(/(#[^#\s]+)/g,(function(e){return e.replace(/:/g,"\\:")}));a=document.querySelector(s)}if(o&&!a&&t>=0)setTimeout((function(){C(),y(e,t-100)}),100);else{if(!a){if(e.element){try{console.warn("[Gleap] Product tour selector did not match:",e.element)}catch(d){}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,u=Date.now(),d=l("__activeStep"),p=l("__activeElement")||e,f=!p||p===e,g="gleap-tour-dummy-element"===e.id,v="gleap-tour-dummy-element"===p.id,y=n("animate"),b=t.onHighlightStarted||n("onHighlightStarted"),w=(null==t?void 0:t.onHighlighted)||n("onHighlighted"),k=(null==d?void 0:d.onDeselected)||n("onDeselected"),x=n(),S=l();!f&&k&&k(v?void 0:p,d,{config:x,state:S});b&&b(g?void 0:e,t,{config:x,state:S});var E=!f&&y,T=!1;C(),c("previousStep",d),c("previousElement",p),c("activeStep",t),c("activeElement",e);var L=function o(){if(l("__transitionCallback")===o){var i=Date.now()-u,a=s-i<=s/2;t.popover&&a&&!T&&E&&(I(e,t),T=!0),n("animate")&&i<s?function(e,t,n,o){var i=l("__activeStagePosition"),a=i||n.getBoundingClientRect(),s=o.getBoundingClientRect();m(i={x:r(e,a.x,s.x-a.x,t),y:r(e,a.y,s.y-a.y,t),width:r(e,a.width,s.width-a.width,t),height:r(e,a.height,s.height-a.height,t)}),c("__activeStagePosition",i)}(i,s,p,e):(h(e),w&&w(g?void 0:e,t,{config:n(),state:l()}),c("__transitionCallback",void 0),c("__previousStep",d),c("__previousElement",p),c("__activeStep",t),c("__activeElement",e)),window.requestAnimationFrame(o)}};c("__transitionCallback",L),window.requestAnimationFrame(L),i(e),!E&&t.popover&&I(e,t);p.classList.remove("gleap-tour-active-element","gleap-tour-no-interaction"),p.removeAttribute("aria-haspopup"),p.removeAttribute("aria-expanded"),p.removeAttribute("aria-controls"),null!==(o=null!==(a=t.disableActiveInteraction)&&void 0!==a?a:n("disableActiveInteraction"))&&void 0!==o&&o&&e.classList.add("gleap-tour-no-interaction");e.classList.add("gleap-tour-active-element"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls","gleap-tour-popover-content")}(a,e)}}function b(){var e=l("__activeElement"),t=l("__activeStep");if(e&&t){if(!document.body.contains(e)&&t.element&&"string"==typeof t.element)try{var n=document.querySelector(t.element);if(!n){var r=t.element.replace(/(#[^#\s]+)/g,(function(e){return e.replace(/:/g,"\\:")}));n=document.querySelector(r)}n&&(e=n,c("__activeElement",n),c("activeElement",n),n.classList.add("gleap-tour-active-element"))}catch(o){}h(e),function(){var e=l("__activeStagePosition"),t=l("__overlaySvg");if(e)if(t){var n=window.innerWidth,r=window.innerHeight;t.setAttribute("viewBox","0 0 ".concat(n," ").concat(r))}else console.warn("No stage svg found.")}(),O(e,t)}}function w(){var e=l("__resizeTimeout");e&&window.cancelAnimationFrame(e),c("__resizeTimeout",window.requestAnimationFrame(b))}function k(e){var t;if(l("isInitialized")&&("Tab"===e.key||9===e.keyCode)){var n=l("__activeElement"),r=null==(t=l("popover"))?void 0:t.wrapper,i=o([].concat(El(r?[r]:[]),El(n?[n]:[]))),a=i[0],s=i[i.length-1];if(e.preventDefault(),e.shiftKey){var c=i[i.indexOf(document.activeElement)-1]||s;null==c||c.focus()}else{var u=i[i.indexOf(document.activeElement)+1]||a;null==u||u.focus()}}}function x(e){var t;(null==(t=n("allowKeyboardControl"))||t)&&("Escape"===e.key?f("escapePress"):"ArrowRight"===e.key?f("arrowRightPress"):"ArrowLeft"===e.key&&f("arrowLeftPress"))}function S(e,t,n){var r=function(t,r){var o=t.target;e.contains(o)&&(n&&!n(o)||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()),null==r||r(t))},o=!0;document.addEventListener("pointerdown",r,o),document.addEventListener("mousedown",r,o),document.addEventListener("pointerup",r,o),document.addEventListener("mouseup",r,o),document.addEventListener("click",(function(e){r(e,t)}),o)}function C(){var e=l("popover");e&&(e.wrapper.style.display="none")}function I(e,t){var r,a,s=l("popover");s&&document.body.removeChild(s.wrapper),s=function(){var e=document.createElement("div");e.classList.add("gleap-tour-popover");var t=document.createElement("div");t.classList.add("gleap-tour-popover-arrow");var n=document.createElement("div");n.id="gleap-tour-popover-title",n.classList.add("gleap-tour-popover-title"),n.style.display="none",n.innerText="Popover Title";var r=document.createElement("div");r.id="gleap-tour-popover-description",r.classList.add("gleap-tour-popover-description"),r.style.display="none",r.innerText="Popover description is here";var o=document.createElement("button");o.type="button",o.classList.add("gleap-tour-popover-close-btn"),o.setAttribute("aria-label","Close"),o.innerHTML="&times;";var i=document.createElement("div");i.classList.add("gleap-tour-popover-footer");var a=document.createElement("span");a.classList.add("gleap-tour-popover-progress-text"),a.innerText="";var s=document.createElement("span");s.classList.add("gleap-tour-popover-navigation-btns");var c=document.createElement("button");c.type="button",c.classList.add("gleap-tour-popover-prev-btn"),c.innerHTML="&larr; Previous";var l=document.createElement("button");return l.type="button",l.classList.add("gleap-tour-popover-next-btn"),l.innerHTML="Next &rarr;",s.appendChild(c),s.appendChild(l),i.appendChild(a),i.appendChild(s),e.appendChild(o),e.appendChild(t),e.appendChild(n),e.appendChild(r),e.appendChild(i),{wrapper:e,arrow:t,title:n,description:r,footer:i,previousButton:c,nextButton:l,closeButton:o,footerButtons:s,progress:a}}(),document.body.appendChild(s.wrapper);var u=t.popover||{},d=u.title,p=u.description,h=u.showButtons,g=u.disableButtons,m=u.showProgress,v=u.nextBtnText,y=void 0===v?n("nextBtnText")||"Next":v,b=u.prevBtnText,w=void 0===b?n("prevBtnText")||"Previous":b,k=u.progressText,x=void 0===k?n("progressText")||"{current} of {total}":k;s.nextButton.innerHTML=y,s.previousButton.innerHTML=w,s.progress.innerHTML=x,d?(s.title.innerHTML=d,s.title.style.display="block"):s.title.style.display="none",p?(s.description.innerHTML=p,s.description.style.display="block"):s.description.style.display="none";var C=h||n("showButtons"),I=m||n("showProgress")||!1,E=(null==C?void 0:C.includes("next"))||(null==C?void 0:C.includes("previous"))||I;s.closeButton.style.display=C.includes("close")?"block":"none",E?(s.footer.style.display="flex",s.progress.style.display=I?"block":"none",s.nextButton.style.display=C.includes("next")?"block":"none",s.previousButton.style.display=C.includes("previous")?"block":"none"):s.footer.style.display="none";var T=g||n("disableButtons")||[];(null==T?void 0:T.includes("next"))&&(s.nextButton.disabled=!0,s.nextButton.classList.add("gleap-tour-popover-btn-disabled")),(null==T?void 0:T.includes("previous"))&&(s.previousButton.disabled=!0,s.previousButton.classList.add("gleap-tour-popover-btn-disabled")),(null==T?void 0:T.includes("close"))&&(s.closeButton.disabled=!0,s.closeButton.classList.add("gleap-tour-popover-btn-disabled"));var L=s.wrapper;L.style.display="block",L.style.left="",L.style.top="",L.style.bottom="",L.style.right="",L.id="gleap-tour-popover-content",L.setAttribute("role","dialog"),L.setAttribute("aria-labelledby","gleap-tour-popover-title"),L.setAttribute("aria-describedby","gleap-tour-popover-description"),s.arrow.className="gleap-tour-popover-arrow";var A=(null==(r=t.popover)?void 0:r.popoverClass)||n("popoverClass")||"";L.className="gleap-tour-popover ".concat(A).trim(),S(s.wrapper,(function(r){var o,i,a,s=r.target,c=(null==(o=t.popover)?void 0:o.onNextClick)||n("onNextClick"),u=(null==(i=t.popover)?void 0:i.onPrevClick)||n("onPrevClick"),d=(null==(a=t.popover)?void 0:a.onCloseClick)||n("onCloseClick");return s.classList.contains("gleap-tour-popover-next-btn")?c?c(e,t,{config:n(),state:l()}):f("nextClick"):s.classList.contains("gleap-tour-popover-prev-btn")?u?u(e,t,{config:n(),state:l()}):f("prevClick"):s.classList.contains("gleap-tour-popover-close-btn")?d?d(e,t,{config:n(),state:l()}):f("closeClick"):void 0}),(function(e){return!(null==s?void 0:s.description.contains(e))&&!(null==s?void 0:s.title.contains(e))&&"string"==typeof e.className&&e.className.includes("gleap-tour-popover")})),c("popover",s);var M=(null==(a=t.popover)?void 0:a.onPopoverRender)||n("onPopoverRender");M&&M(s,{config:n(),state:l()}),O(e,t),i(L);var P=e.classList.contains("gleap-tour-dummy-element"),R=o([L].concat(El(P?[]:[e])));R.length>0&&R[0].focus()}function E(){var e=l("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 T(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 L(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 O(e,t){var r=l("popover");if(r){var o=(null==t?void 0:t.popover)||{},i=o.align,a=void 0===i?"start":i,s=o.side,c=void 0===s?"left":s,u=a,d="gleap-tour-dummy-element"===e.id?"over":c,p=n("stagePadding")||0,f=E(),h=r.arrow.getBoundingClientRect(),g=e.getBoundingClientRect(),m=g.top-f.height,v=m>=0,y=window.innerHeight-(g.bottom+f.height),b=y>=0,w=g.left-f.width,k=w>=0,x=window.innerWidth-(g.right+f.width),S=x>=0,C=!(v||b||k||S),I=d;if("top"===d&&v?S=k=b=!1:"bottom"===d&&b?S=k=v=!1:"left"===d&&k?S=v=b=!1:"right"===d&&S&&(k=v=b=!1),"over"===d){var O=window.innerWidth/2-f.realWidth/2,A=window.innerHeight/2-f.realHeight/2;r.wrapper.style.left="".concat(O,"px"),r.wrapper.style.right="auto",r.wrapper.style.top="".concat(A,"px"),r.wrapper.style.bottom="auto"}else if(C){var M=window.innerWidth/2-(null==f?void 0:f.realWidth)/2;r.wrapper.style.left="".concat(M,"px"),r.wrapper.style.right="auto",r.wrapper.style.bottom="".concat(10,"px"),r.wrapper.style.top="auto"}else if(k){var P=Math.min(w,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),R=T(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.left="".concat(P,"px"),r.wrapper.style.top="".concat(R,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",I="left"}else if(S){var N=Math.min(x,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),j=T(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.right="".concat(N,"px"),r.wrapper.style.top="".concat(j,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",I="right"}else if(v){var _=Math.min(m,window.innerHeight-f.realHeight-h.width),D=L(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.top="".concat(_,"px"),r.wrapper.style.left="".concat(D,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",I="top"}else if(b){var F=Math.min(y,window.innerHeight-(null==f?void 0:f.realHeight)-h.width),B=L(u,{elementDimensions:g,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.left="".concat(B,"px"),r.wrapper.style.bottom="".concat(F,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",I="bottom"}C?r.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var r=l("popover");if(!r)return;var o=n.getBoundingClientRect(),i=E(),a=r.arrow,s=i.width,c=window.innerWidth,u=o.width,d=o.left,p=i.height,f=window.innerHeight,h=o.top,g=o.height;a.className="gleap-tour-popover-arrow";var m=t,v=e;"top"===t?(d+u<=0?(m="right",v="end"):d+u-s<=0&&(m="top",v="start"),d>=c?(m="left",v="end"):d+s>=c&&(m="top",v="end")):"bottom"===t?(d+u<=0?(m="right",v="start"):d+u-s<=0&&(m="bottom",v="start"),d>=c?(m="left",v="start"):d+s>=c&&(m="bottom",v="end")):"left"===t?(h+g<=0?(m="bottom",v="end"):h+g-p<=0&&(m="left",v="start"),h>=f?(m="top",v="end"):h+p>=f&&(m="left",v="end")):"right"===t&&(h+g<=0?(m="bottom",v="start"):h+g-p<=0&&(m="right",v="start"),h>=f?(m="top",v="start"):h+p>=f&&(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")}(u,I,e)}}return function(){function e(){n("allowClose")&&h()}function r(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?f(r):h()}}function o(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?f(r):h()}}function i(){var e;if(!l("__transitionCallback")){var t=l("activeIndex"),r=l("__activeStep"),i=l("__activeElement");if("CLICK"!==r.mode)if(void 0!==t&&void 0!==r)if(void 0!==l("activeIndex")){var a=(null==(e=r.popover)?void 0:e.onPrevClick)||n("onPrevClick");if(a)return a(i,r,{config:n(),state:l()});o()}}}function a(){var e;if(!l("__transitionCallback")){var t=l("activeIndex"),o=l("__activeStep"),i=l("__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:l()});r()}}}function s(){l("isInitialized")||(c("isInitialized",!0),document.body.classList.add("gleap-tour-active",n("animate")?"gleap-tour-fade":"gleap-tour-simple"),window.addEventListener("keyup",x,!1),window.addEventListener("keydown",k,!1),window.addEventListener("resize",w),window.addEventListener("scroll",w),c("__positionInterval",setInterval((function(){l("isInitialized")&&w()}),1e3)),p("overlayClick",e),p("escapePress",e),p("arrowLeftPress",i),p("arrowRightPress",a))}function f(){var e,t,r,o,i,a,s,l,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,d=n("steps");if(!d)return console.error("No steps to drive through"),void h();if(d[u]){c("__activeOnDestroyed",document.activeElement),c("activeIndex",u);var p=d[u],g=d[u+1],m=d[u-1],v=(null==(e=p.popover)?void 0:e.doneBtnText)||n("doneBtnText")||"Done",b=n("allowClose"),w=void 0!==(null==(t=p.popover)?void 0:t.showProgress)?null==(r=p.popover)?void 0:r.showProgress:n("showProgress"),k=((null==(o=p.popover)?void 0:o.progressText)||n("progressText")||"{{current}} of {{total}}").replace("{{current}}","".concat(u+1)).replace("{{total}}","".concat(d.length)),x=(null==(i=p.popover)?void 0:i.showButtons)||n("showButtons"),S=["next","previous"].concat(El(b?["close"]:[])).filter((function(e){return!(null==x?void 0:x.length)||x.includes(e)})),C=(null==(a=p.popover)?void 0:a.onNextClick)||n("onNextClick"),I=(null==(s=p.popover)?void 0:s.onPrevClick)||n("onPrevClick"),E=(null==(l=p.popover)?void 0:l.onCloseClick)||n("onCloseClick");y(Ol(Ol({},p),{},{popover:Ol({showButtons:S,nextBtnText:g?void 0:v,disableButtons:El(m?[]:["previous"]),showProgress:w,progressText:k,onNextClick:C||function(){g?f(u+1):h()},onPrevClick:I||function(){f(u-1)},onCloseClick:E||function(){h()}},(null==p?void 0:p.popover)||{})}))}else h()}function h(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=l("__activeElement"),r=l("__activeStep"),o=l("__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:l()})}else{var a,s=(null==r?void 0:r.onDeselected)||n("onDeselected"),c=n("onDestroyed");if(document.body.classList.remove("gleap-tour-active","gleap-tour-fade","gleap-tour-simple"),function(){window.removeEventListener("keyup",x),window.removeEventListener("resize",w),window.removeEventListener("scroll",w);var e=l("__positionInterval");e&&clearInterval(e)}(),function(){var e,t=l("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((function(e){e.classList.remove("gleap-tour-active-element","gleap-tour-no-interaction"),e.removeAttribute("aria-haspopup"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls")}))}(),(a=l("__overlaySvg"))&&a.remove(),d={},u(),t&&r){var p="gleap-tour-dummy-element"===t.id;s&&s(p?void 0:t,r,{config:n(),state:l()}),c&&c(p?void 0:t,r,{config:n(),state:l()})}o&&o.focus()}}return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{isActive:function(){return l("isInitialized")||!1},refresh:w,drive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;s(),f(e)},setConfig:t,setSteps:function(e){u(),t(Ol(Ol({},n()),{},{steps:e}))},getConfig:n,getState:l,getActiveIndex:function(){return l("activeIndex")},isFirstStep:function(){return 0===l("activeIndex")},isLastStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&t===e.length-1},getActiveStep:function(){return l("activeStep")},getActiveElement:function(){return l("activeElement")},getPreviousElement:function(){return l("previousElement")},getPreviousStep:function(){return l("previousStep")},moveNext:r,movePrevious:o,moveTo:function(e){(n("steps")||[])[e]?f(e):h()},hasNextStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&e[t+1]},hasPreviousStep:function(){var e=n("steps")||[],t=l("activeIndex");return void 0!==t&&e[t-1]},highlight:function(e){s(),y(Ol(Ol({},e),{},{popover:e.popover?Ol({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){h(!1)}}}}();const Pl=Ml;var Rl=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],Nl="".concat(Rl.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),jl=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?Rl.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},_l=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},Dl=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;_l(e,"input")}},Fl=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(jl(e))return e;var t="function"==typeof e.querySelector?e.querySelector(Nl):null;return t&&jl(t)?t:null}(e),s=null!=t?t:"";if(a){var c=0,l=function(){_l(a,"change"),i&&i()};!function e(){try{c<s.length?(c++,Dl(a,s.slice(0,c)),setTimeout(e,o)):l()}catch(t){l()}}()}else i&&i()};function Bl(e){return Bl="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},Bl(e)}function Ul(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zl(r.key),r)}}function Hl(e,t,n){return(t=zl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zl(e){var t=function(e,t){if("object"!=Bl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Bl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bl(t)?t:String(t)}var ql="gleap-tour-data",Wl="copilot-pointer-container",Gl="copilot-tour-styles",Vl="copilot-joined-container",Xl={TOP_LEFT:"".concat(Vl,"--top-left"),TOP_RIGHT:"".concat(Vl,"--top-right"),BOTTOM_LEFT:"".concat(Vl,"--bottom-left"),BOTTOM_RIGHT:"".concat(Vl,"--bottom-right")};var Jl=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Hl(this,"productTourData",void 0),Hl(this,"productTourId",void 0),Hl(this,"currentActiveIndex",void 0),Hl(this,"lastArrowPositionX",void 0),Hl(this,"lastArrowPositionY",void 0),Hl(this,"onCompleteCallback",void 0),Hl(this,"audioMuted",!1),Hl(this,"currentAudio",void 0),Hl(this,"_pointerContainer",null),Hl(this,"_scrollListeners",[]),Hl(this,"_currentAnchor",null),Hl(this,"_currentStep",null),Hl(this,"_scrollDebounceTimer",null);var t=this;"undefined"!=typeof window&&(this._scrollListeners=[],this._currentAnchor=null,this._currentStep=null,this._scrollDebounceTimer=null,window.addEventListener("resize",(function(){if(t.productTourId&&t.currentActiveIndex>=0&&t.productTourData&&t.productTourData.steps){var e=t.productTourData.steps[t.currentActiveIndex];e&&e.selector&&""!==e.selector&&t.updatePointerPosition(document.querySelector(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(ql,JSON.stringify(e))}catch(t){}else localStorage.removeItem(ql)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(ql));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(Wl);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,c=a.top+a.height/2+10;o.style.position="fixed",o.style.left="".concat(s,"px"),o.style.top="".concat(c,"px"),o.style.transform="translate(-50%, -50%)";var l=350;l>window.innerWidth-40&&(l=window.innerWidth-40),s+l>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(Wl);t&&t.remove()}var n=document.getElementById(Vl);n&&n.remove();var r=document.getElementById(Gl);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(Vl,"-mute"));t&&(t.innerHTML=fe(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 c,l,u=null!==(e=null===(t=br.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=pe(u),p=document.getElementById(Gl);p||(p=document.createElement("style"),W(p),p.id=Gl,p.type="text/css",p.textContent="\n #".concat(Wl," {\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(Wl,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(Wl,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(Wl,"-clickmode svg {\n display: none !important;\n }\n #").concat(Wl," 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(Wl,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(Wl,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(Wl,"-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(Wl,"-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(Vl," {\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(Vl,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Vl,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(Vl,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Vl,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(Vl," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(Vl,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(Vl,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(Vl,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(Vl,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(Vl,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(Vl,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(Vl,"-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(Vl," {\n animation: glCoFadeOut 0.8s ease-out forwards;\n }\n ").concat(null===(c=null===(l=this.productTourData)||void 0===l?void 0:l.playVoice)||void 0===c||c?"":"\n .".concat(Vl,"-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 f=document.createElement("div");f.id=Wl,f.style.opacity=0,this._pointerContainer=f;var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("viewBox","0 0 380 476"),h.innerHTML='<path d="M352.595 268.315L352.581 268.302L352.566 268.29L78.6092 24.7278C71.6245 18.433 62.5487 15 53.2 15C32.1157 15 15 32.1157 15 53.2V424C15 444.34 31.4714 461 52 461C62.6797 461 72.8089 456.467 79.8863 448.38C79.8871 448.379 79.8879 448.378 79.8886 448.378L180.804 333.1H327.9C348.384 333.1 365 316.484 365 296C365 285.404 360.46 275.344 352.595 268.315Z" fill="black" stroke="white" stroke-width="30"/>';var g=document.createElement("div");g.id="copilot-info-bubble",g.innerHTML="<div id='copilot-info-bubble-content-container'><div id='copilot-info-bubble-content'></div></div>";var m,v,y=document.createElement("div");y.id=Vl,y.classList.add(Vl,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=Xl[m])&&void 0!==v?v:Xl.TOP_RIGHT)),y.innerHTML='\n <img class="'.concat(Vl,'-avatar" src="').concat(null===(r=this.productTourData)||void 0===r?void 0:r.kaiAvatar,'" />\n <span>').concat(null===(o=this.productTourData)||void 0===o?void 0:o.kaiSlug,'</span>\n <div class="').concat(Vl,'-mute">\n ').concat(fe(this.audioMuted?"unmute":"mute"),"\n </div>\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'<div class="'.concat(Vl,'-dismiss">\n ').concat(fe("dismiss"),"\n </div>"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(Vl,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(Vl,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),f.appendChild(h),f.appendChild(g),document.body.appendChild(f)}}},{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 c=document.createElement("button");c.classList.add("gleap-tour-continue-button"),c.textContent=null===(n=this.productTourData)||void 0===n?void 0:n.unmuteModalContinue,c.addEventListener("click",(function(){r.toggleAudio(!0),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(c),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(Wl)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(Wl).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(Vf.translateText("next"),' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\n <path fill="currentColor" d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"/>\n</svg>'),i.addEventListener("click",o,{once:!0}),n.classList.add("gleap-input-highlight"),document.querySelector("#".concat(Wl)).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;Fl(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(),c=window.scrollX||0,l=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+c,s.top+s.height/2+l),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):"🤔";document.getElementById("copilot-info-bubble-content").textContent=s,e._pointerContainer.style.opacity=1;var c=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),l=function(){e.currentAudio=void 0,setTimeout((function(){a()}),1e3*c)};(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){l()}))):l()}},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=document.querySelector(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&&Ul(t.prototype,n),r&&Ul(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kl(e){return Kl="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},Kl(e)}function $l(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 Yl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$l(Object(n),!0).forEach((function(t){Ql(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eu(r.key),r)}}function Ql(e,t,n){return(t=eu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eu(e){var t=function(e,t){if("object"!=Kl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Kl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Kl(t)?t:String(t)}Hl(Jl,"instance",void 0);var tu="gleap-tour-data",nu=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ql(this,"productTourData",void 0),Ql(this,"productTourId",void 0),Ql(this,"unmuted",!1),Ql(this,"currentActiveIndex",void 0),Ql(this,"gleapTourObj",void 0),Ql(this,"disabled",!1);var t=this;if("undefined"!=typeof window){"undefined"!=typeof window&&window.addEventListener("beforeunload",(function(e){var n;null!=t&&t.disabled||null==t||!t.productTourId||null==t||!t.productTourData||"cobrowse"===(null==t||null===(n=t.productTourData)||void 0===n?void 0:n.tourType)||t.storeUncompletedTour()}))}}var t,n,r;return t=e,n=[{key:"disable",value:function(){this.gleapTourObj&&this.gleapTourObj.destroy(),Jl.getInstance().disable(),this.gleapTourObj=void 0,this.disabled=!0}},{key:"startWithConfig",value:function(e,t){var n=this,r=arguments.length>2&&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;vs.getInstance().validateProductTour(e).then((function(){return r>0?setTimeout((function(){i.start()}),r):n.start()})).catch((function(e){console.log("Product tour is not live. Cleaning up..."),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?(Ft.notifyEvent("productTourCompleted",t),oh.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(Ft.notifyEvent("productTourQuit",t),oh.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(tu));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(tu,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(tu)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return Jl.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.length;i++){var a=n[i],s="CLICK"===a.mode,c="INPUT"===a.mode,l="INTERACTION"===a.mode,u="",d=!1;if("video-pointer"===a.type)u='<div class="gleap-tour-video">\n <video class="gleap-tour-video-obj" muted autoplay>\n <source src="'.concat(a.videoUrl,'" type="video/mp4">\n </video>\n <div class="gleap-tour-video-playpause">').concat(fe("unmute"),"</div>\n </div>");else{var p="";t.sender&&t.sender.firstName&&(d=!0,p='<div class="gleap-tour-sender">\n <div class="gleap-tour-sender-image" style="background-image: url(\''.concat(t.sender.profileImageUrl,'\');"></div>\n <div class="gleap-tour-sender-name">').concat(t.sender.firstName,"</div>\n </div>")),u="".concat(p,'<div class="gleap-tour-message">').concat(a.message,"</div>")}var f={disableActiveInteraction:!s&&!c&&!l,mode:a.mode,popover:Yl({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&&(f.element=a.selector),o.push(f)}var h=["next","close"];t.backButton&&h.push("previous"),this.gleapTourObj=Pl(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql(Ql({showProgress:!0,allowKeyboardControl:!1,steps:o},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",h),"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),e.onComplete(!1)})),"onDestroyStarted",(function(){e.gleapTourObj.hasNextStep()?e.onComplete(!1):e.onComplete(!0),document.removeEventListener("click",g)})),"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<n.length;i++){var a=n[i];"IMG"===a.tagName?(a.addEventListener("load",(function(){o()})),a.addEventListener("error",(function(){o()}))):"VIDEO"===a.tagName&&(a.addEventListener("canplaythrough",(function(){o()})),a.addEventListener("error",(function(){o()})))}var s="gleap-tour-video--playing",c=document.querySelector(".gleap-tour-video-playpause"),l=document.querySelector(".gleap-tour-video-obj");if(l){var u=l.closest(".gleap-tour-video");r.unmuted&&l&&(l.pause(),l.muted=!1,l.play(),u.classList.add(s)),l.addEventListener("ended",(function(){c.innerHTML=fe("replay"),c.classList.add("gleap-tour-video-svg--fullscreen"),u.classList.remove(s)})),l.addEventListener("play",(function(){c.classList.remove("gleap-tour-video-svg--fullscreen")})),c&&c.addEventListener("click",(function(){return d()}));var d=function(){l.muted?(r.unmuted=!0,l.pause(),l.currentTime=0,l.muted=!1,l.play(),c.innerHTML=fe("mute"),u.classList.add(s)):l.paused?(l.muted=!1,l.play(),c.innerHTML=fe("mute"),u.classList.add(s)):(l.pause(),c.innerHTML=fe("unmute"),u.classList.remove(s))}}}))),this.gleapTourObj.drive(),document.addEventListener("click",g,!0)}function g(e){try{var t=document.querySelector(".gleap-tour-popover");if(t&&!t.contains(e.target)){var o,i=r.gleapTourObj.getActiveIndex(),a=n[i],s=r.gleapTourObj.getActiveElement();if("CLICK"===(null==a?void 0:a.mode)&&(null==e?void 0:e.target)!==s&&!s.contains(null==e?void 0:e.target))return;r.currentActiveIndex=(r.currentActiveIndex||0)+1,r.storeUncompletedTour(),s&&"INPUT"===s.tagName||"INPUT"===a.mode||"INTERACTION"===a.mode||null!=e&&null!==(o=e.target)&&void 0!==o&&o.id.includes("tooltip-svg")||r.gleapTourObj.moveNext()}}catch(c){}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Zl(t.prototype,n),r&&Zl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Ql(nu,"instance",void 0);var ru,ou=Object.defineProperty,iu=(e,t,n)=>((e,t,n)=>t in e?ou(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),au=(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))(au||{}),su=(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))(su||{}),cu=(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))(cu||{}),lu=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(lu||{}),uu=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(uu||{}),du=(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))(du||{}),pu=(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))(pu||{});const fu={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},hu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gu={},mu={},vu=()=>!!globalThis.Zone;function yu(e){if(gu[e])return gu[e];const t=globalThis[e],n=t.prototype,r=e in fu?fu[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 hu?hu[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&&!vu())return gu[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",""),mu[e]=()=>r.remove()):r.remove(),gu[e]=i}catch{return n}}const bu={};function wu(e,t,n){var r;const o=`${e}.${String(n)}`;if(bu[o])return bu[o].call(t);const i=yu(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(bu[o]=a,a.call(t)):t[n]}const ku={};function xu(e,t,n){const r=`${e}.${String(n)}`;if(ku[r])return ku[r].bind(t);const o=yu(e)[n];return"function"!=typeof o?t[n]:(ku[r]=o,o.bind(t))}function Su(){return[yu("MutationObserver").constructor,mu.MutationObserver??(()=>{})]}let Cu=Date.now;function Iu(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())||(Cu=()=>(new Date).getTime());const Eu={ownerDocument:function(e){return wu("Node",e,"ownerDocument")},childNodes:function(e){return wu("Node",e,"childNodes")},parentNode:function(e){return wu("Node",e,"parentNode")},parentElement:function(e){return wu("Node",e,"parentElement")},textContent:function(e){return wu("Node",e,"textContent")},contains:function(e,t){return xu("Node",e,"contains")(t)},getRootNode:function(e){return xu("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?wu("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?wu("Element",e,"shadowRoot"):null},querySelector:function(e,t){return wu("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return wu("Element",e,"querySelectorAll")(t)},nowTimestamp:Cu,mutationObserverCtor:Su,patch:Iu};function Tu(e){return e.nodeType===e.ELEMENT_NODE}function Lu(e){const t=e&&"host"in e&&"mode"in e&&Eu.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Eu.shadowRoot(t)===e)}function Ou(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Au(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=>Mu(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 Mu(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Au(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?zu(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?zu(n,t):n}}class Pu{constructor(){iu(this,"idNodeMap",new Map),iu(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 Ru({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let a=o||"";const s=r&&Nu(r);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function Nu(e){return e.toLowerCase()}const ju="__rrweb_original__";function _u(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Nu(t):null}function Du(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 Fu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Bu=/^(?:[a-z+]+:)?\/\//i,Uu=/^www\..*/i,Hu=/^(data:)([^,]*),(.*)/i;function zu(e,t){return(e||"").replace(Fu,((e,n,r,o,i,a)=>{const s=r||i||a,c=n||o||"";if(!s)return e;if(Bu.test(s)||Uu.test(s))return`url(${c}${s}${c})`;if(Hu.test(s))return`url(${c}${s}${c})`;if("/"===s[0])return`url(${c}${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}${c})`;const l=s.split("#")[0],u=s.substring(l.length),d=t.split("#")[0].split("/"),p=l.split("/");d.pop();for(const t of p)"."!==t&&(".."===t?d.pop():d.push(t));return`url(${c}${d.join("/")}${u}${c})`}))}function qu(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Wu(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=qu(e,n);const a=t.length/e.length;for(let s=1;s<r.length;s++)if(r[s].textContent&&"string"==typeof r[s].textContent){const c=qu(r[s].textContent,n),l=100;let u=3;for(;u<c.length&&(c[u].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,u),1));u++);for(;u<c.length;u++){let d=c.substring(0,u),p=t.split(d),f=-1;if(2===p.length)f=p[0].length;else if(p.length>2&&""===p[0]&&""!==r[s-1].textContent)f=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=l+1}else u===c.length-1&&(f=t.indexOf(d));if(p.length>=2&&u>l){const e=r[s-1].textContent;if(e&&"string"==typeof e){const n=qu(e).length;f=t.indexOf(d,n)}-1===f&&(f=p[0].length)}if(-1!==f){let s=Math.floor(f/a);for(;s>0&&s<e.length;){if(i+=1,i>50*r.length)return o.push(e),o;const c=qu(e.substring(0,s),n);if(c.length===f){o.push(e.substring(0,s)),e=e.substring(s),t=t.substring(f);break}c.length<f?s+=Math.max(1,Math.floor((f-c.length)/a)):s-=Math.max(1,Math.floor((c.length-f)*a))}break}}}}return o.push(e),o}(e,t).join("/* rr_split */")}let Gu=1;const Vu=new RegExp("[^a-z0-9-_:]"),Xu=-2;function Ju(){return Gu++}let Ku,$u;const Yu=/^[^ \t\n\r\u000c]+/,Zu=/^[, \t\n\r\u000c]+/;const Qu=new WeakMap;function ed(e,t){return t&&""!==t.trim()?nd(e,t):t}function td(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function nd(e,t){let n=Qu.get(e);if(n||(n=e.createElement("a"),Qu.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function rd(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?ed(e,r):"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(Zu),!(n>=t.length);){let i=r(Yu);if(","===i.slice(-1))i=ed(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=ed(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?zu(r,nd(e)):"object"===t&&"data"===n?ed(e,r):r:r}function od(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function id(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&id(Eu.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&id(Eu.parentNode(e),t,n)}function ad(e,t,n,r){let o;if(Tu(e)){if(o=e,!Eu.childNodes(o).length)return!1}else{if(null===Eu.parentElement(e))return!1;o=Eu.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(id(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 sd(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:a,inlineStylesheet:s,maskInputOptions:c={},maskTextFn:l,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:h,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:pu.Document,childNodes:[],compatMode:e.compatMode}:{type:pu.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:pu.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:c={},inlineImages:l,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f}=t,h=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=Nu(e.tagName);return Vu.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let w=0;w<v;w++){const t=e.attributes[w];od(g,t.name,t.value)||(m[t.name]=rd(n,g,Nu(t.name),t.value))}if("link"===g&&i){const t=Array.from(n.styleSheets).find((t=>t.href===e.href));let r=null;t&&(r=Au(t)),r&&(delete m.rel,delete m.href,m._cssText=r)}if("style"===g&&e.sheet){let t=Au(e.sheet);t&&(e.childNodes.length>1&&(t=Wu(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=Ru({element:e,type:_u(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;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,i=ju in o?o[ju]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(c.type,c.quality)&&(m.rr_dataURL=t)}if("img"===g&&l){Ku||(Ku=n.createElement("canvas"),$u=Ku.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Ku.width=t.naturalWidth,Ku.height=t.naturalHeight,$u.drawImage(t,0,0),m.rr_dataURL=Ku.toDataURL(c.type,c.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(h){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:pu.Element,tagName:g,attributes:m,childNodes:[],isSVG:td(e)||void 0,needBlock:h,rootId:f,isCustom:y}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:h,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,a=Eu.parentNode(e),s=a&&a.tagName;let c="";const l="STYLE"===s||void 0,u="SCRIPT"===s||void 0;u?c="SCRIPT_PLACEHOLDER":i||(c=Eu.textContent(e),l&&c&&(c=zu(c,nd(t.doc))));!l&&!u&&c&&n&&(c=r?r(c,Eu.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:pu.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:l,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:pu.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:pu.Comment,textContent:Eu.textContent(e)||"",rootId:v};default:return!1}}function cd(e){return null==e?"":e.toLowerCase()}function ld(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 ud(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:s,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h={},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:I}=t,{preserveWhiteSpace:E=!0}=t;if(!I){I=ad(e,a,s,void 0===I)}const T=sd(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:S,cssCaptured:C});if(!T)return console.warn(e,"not serialized"),null;let L;L=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===pu.Comment)return!0;if(e.type===pu.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"===Du(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(cd(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===cd(e.attributes.name)||"icon"===cd(e.attributes.rel)||"apple-touch-icon"===cd(e.attributes.rel)||"shortcut icon"===cd(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&cd(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(cd(e.attributes.property).match(/^(og|twitter|fb):/)||cd(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===cd(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===cd(e.attributes.name)||"googlebot"===cd(e.attributes.name)||"bingbot"===cd(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===cd(e.attributes.name)||"generator"===cd(e.attributes.name)||"framework"===cd(e.attributes.name)||"publisher"===cd(e.attributes.name)||"progid"===cd(e.attributes.name)||cd(e.attributes.property).match(/^article:/)||cd(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===cd(e.attributes.name)||"yandex-verification"===cd(e.attributes.name)||"csrf-token"===cd(e.attributes.name)||"p:domain_verify"===cd(e.attributes.name)||"verify-v1"===cd(e.attributes.name)||"verification"===cd(e.attributes.name)||"shopify-checkout-api-token"===cd(e.attributes.name)))return!0}}return!1}(T,f)||!E&&T.type===pu.Text&&!T.textContent.replace(/^\s+|\s+$/gm,"").length?Xu:Ju();const O=Object.assign(T,{id:L});if(r.add(e,O),L===Xu)return null;v&&v(e);let A=!c;if(O.type===pu.Element){A=A&&!O.needBlock,delete O.needBlock;const t=Eu.shadowRoot(e);t&&Ou(t)&&(O.isShadowHost=!0)}if((O.type===pu.Document||O.type===pu.Element)&&A){f.headWhitespace&&O.type===pu.Element&&"head"===O.tagName&&(E=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(O.type===pu.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else{O.type===pu.Element&&void 0!==O.attributes._cssText&&"string"==typeof O.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Eu.childNodes(e))){const e=ud(n,t);e&&O.childNodes.push(e)}}let S=null;if(Tu(e)&&(S=Eu.shadowRoot(e)))for(const e of Array.from(Eu.childNodes(S))){const n=ud(e,t);n&&(Ou(S)&&(n.isShadow=!0),O.childNodes.push(n))}}const M=Eu.parentNode(e);return M&&Lu(M)&&Ou(M)&&(O.isShadow=!0),O.type===pu.Element&&"iframe"===O.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=ud(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===pu.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===Du(O.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=ud(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),O}class dd{constructor(...e){iu(this,"parentElement",null),iu(this,"parentNode",null),iu(this,"ownerDocument"),iu(this,"firstChild",null),iu(this,"lastChild",null),iu(this,"previousSibling",null),iu(this,"nextSibling",null),iu(this,"ELEMENT_NODE",1),iu(this,"TEXT_NODE",3),iu(this,"nodeType"),iu(this,"nodeName"),iu(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 dd))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 pd(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const fd="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 hd={map:{},getId:()=>(console.error(fd),-1),getNode:()=>(console.error(fd),null),removeNodeFromMap(){console.error(fd)},has:()=>(console.error(fd),!1),reset(){console.error(fd)}};function gd(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),c=this;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)}),s))}}function md(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)}}),()=>md(e,t,i||{},!0)}function vd(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=Eu.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=Eu.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function yd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function bd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function wd(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Eu.parentElement(e)}function kd(e,t,n,r){if(!e)return!1;const o=wd(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(id(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 xd(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===Xu}function Sd(e,t){if(Lu(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=Eu.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Sd(r,t))}function Cd(e){return Boolean(e.changedTouches)}function Id(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ed(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Td(e){return!!e&&(e instanceof dd&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Eu.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hd=new Proxy(hd,{get:(e,t,n)=>("map"===t&&console.error(fd),Reflect.get(e,t,n))}));class Ld{constructor(){iu(this,"id",1),iu(this,"styleIDMap",new WeakMap),iu(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 Od(e){var t;let n=null;return"getRootNode"in e&&(null==(t=Eu.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Eu.host(Eu.getRootNode(e))&&(n=Eu.host(Eu.getRootNode(e))),n}function Ad(e){const t=Eu.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Od(n);)n=t;return n}(e);return Eu.contains(t,n)}function Md(e){const t=Eu.ownerDocument(e);return!!t&&(Eu.contains(t,e)||Ad(e))}function Pd(e){return"__ln"in e}class Rd{constructor(){iu(this,"length",0),iu(this,"head",null),iu(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;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Pd(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Pd(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Nd=(e,t)=>`${e}@${t}`;class jd{constructor(){iu(this,"frozen",!1),iu(this,"locked",!1),iu(this,"texts",[]),iu(this,"attributes",[]),iu(this,"attributeMap",new WeakMap),iu(this,"removes",[]),iu(this,"mapRemoves",[]),iu(this,"movedMap",{}),iu(this,"addedSet",new Set),iu(this,"movedSet",new Set),iu(this,"droppedSet",new Set),iu(this,"removesSubTreeCache",new Set),iu(this,"mutationCb"),iu(this,"blockClass"),iu(this,"blockSelector"),iu(this,"maskTextClass"),iu(this,"maskTextSelector"),iu(this,"inlineStylesheet"),iu(this,"maskInputOptions"),iu(this,"maskTextFn"),iu(this,"maskInputFn"),iu(this,"keepIframeSrcFn"),iu(this,"recordCanvas"),iu(this,"inlineImages"),iu(this,"slimDOMOptions"),iu(this,"dataURLOptions"),iu(this,"doc"),iu(this,"mirror"),iu(this,"iframeManager"),iu(this,"stylesheetManager"),iu(this,"shadowDomManager"),iu(this,"canvasManager"),iu(this,"processedNodeManager"),iu(this,"unattachedDoc"),iu(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),iu(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Rd,r=e=>{let t=e,n=Xu;for(;n===Xu;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=Eu.parentNode(o);if(!i||!Md(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=Lu(i)?this.mirror.getId(Od(o)):this.mirror.getId(i),c=r(o);if(-1===s||-1===c)return n.addNode(o);const l=ud(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=>{Id(e,this.mirror)&&this.iframeManager.addIframe(e),Ed(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Td(o)&&this.shadowDomManager.addShadowRoot(Eu.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});l&&(e.push({parentId:s,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)Dd(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(Eu.parentNode(s))||o(s);for(const s of this.addedSet)Fd(this.droppedSet,s)||Dd(this.removesSubTreeCache,s,this.mirror)?Fd(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(Eu.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(Eu.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=Eu.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Eu.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=Eu.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.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!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))})),iu(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(Eu.childNodes(e),(e=>Eu.textContent(e)||"")).join("");t.attributes.value=Ru({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:_u(e),value:n,maskInputFn:this.maskInputFn})})),iu(this,"processMutation",(e=>{if(!xd(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Eu.textContent(e.target);kd(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ad(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,wd(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=_u(n);o=Ru({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(kd(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"),!od(n.tagName,r))if(i.attributes[r]=rd(this.doc,Nu(n.tagName),Nu(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(kd(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=Lu(e.target)?this.mirror.getId(Eu.host(e.target)):this.mirror.getId(e.target);kd(e.target,this.blockClass,this.blockSelector,!1)||xd(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(_d(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Sd(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Nd(n,r)]?_d(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!Lu(e.target)||!Ou(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Eu.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),iu(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xd(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[Nd(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);kd(e,this.blockClass,this.blockSelector,!1)||(Eu.childNodes(e).forEach((e=>this.genAdds(e))),Td(e)&&Eu.childNodes(Eu.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 _d(e,t){e.delete(t),Eu.childNodes(t).forEach((t=>_d(e,t)))}function Dd(e,t,n){return 0!==e.size&&function(e,t,n){const r=Eu.parentNode(t);return!!r&&e.has(r)}(e,t)}function Fd(e,t){return 0!==e.size&&Bd(e,t)}function Bd(e,t){const n=Eu.parentNode(t);return!!n&&(!!e.has(n)||Bd(e,n))}let Ud;const Hd=e=>{if(!Ud)return e;return(...t)=>{try{return e(...t)}catch(n){if(Ud&&!0===Ud(n))return;throw n}}},zd=[];function qd(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 Wd(e,t){const n=new jd;zd.push(n),n.init(e);const[r,o]=Su(),i=new r(Hd(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Gd({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 c=null;return Object.keys(cu).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=Nu(i);const l=(t=>i=>{const a=qd(i);if(kd(a,r,o,!0))return;let s=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=lu.Mouse;break;case"touch":s=lu.Touch;break;case"pen":s=lu.Pen}s===lu.Touch?cu[t]===cu.MouseDown?l="TouchStart":cu[t]===cu.MouseUp&&(l="TouchEnd"):lu.Pen}else Cd(i)&&(s=lu.Touch);null!==s?(c=s,(l.startsWith("Touch")&&s===lu.Touch||l.startsWith("Mouse")&&s===lu.Mouse)&&(s=null)):cu[t]===cu.Click&&(s=c,c=null);const u=Cd(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:f}=u;Hd(e)({type:cu[l],id:d,x:p,y:f,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(cu[i]){case cu.MouseDown:case cu.MouseUp:a=a.replace("mouse","pointer");break;case cu.TouchStart:case cu.TouchEnd:return}s.push(pd(a,l,t))})),Hd((()=>{s.forEach((e=>e()))}))}function Vd({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return pd("scroll",Hd(gd(Hd((i=>{const a=qd(i);if(!a||kd(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=vd(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 Xd=["INPUT","TEXTAREA","SELECT"],Jd=new WeakMap;function Kd(e){return function e(t,n){if(Qd("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Qd("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Qd("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Qd("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 $d(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Yd({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(Eu.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,c=(null==s?void 0:s.prototype)?Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&s&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=c.set)?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(o){}return r}}),Hd((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function Zd(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:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:p,selectionCb:f,customElementCb:h}=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),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...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),f(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),h(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Wd(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 c=gd(Hd((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),l=Hd(gd(Hd((e=>{const t=qd(e),{clientX:n,clientY:o}=Cd(e)?e.changedTouches[0]:e;a||(a=Cu()),s.push({x:n,y:o,id:r.getId(t),timeOffset:Cu()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?su.Drag:e instanceof MouseEvent?su.MouseMove:su.TouchMove)})),o,{trailing:!1})),u=[pd("mousemove",l,n),pd("touchmove",l,n),pd("drag",l,n)];return Hd((()=>{u.forEach((e=>e()))}))}(e),a=Gd(e),s=Vd(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return pd("resize",Hd(gd(Hd((()=>{const t=yd(),o=bd();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)})),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:a,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=qd(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=Eu.parentElement(n)),!n||!d||Xd.indexOf(d)<0||kd(n,r,o,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let f=n.value,h=!1;const g=_u(n)||"";"radio"===g||"checkbox"===g?h=n.checked:(s[d.toLowerCase()]||s[g])&&(f=Ru({element:n,maskInputOptions:s,tagName:d,type:g,value:f,maskInputFn:c})),p(n,u?{text:f,isChecked:h,userTriggered:l}:{text:f,isChecked:h});const m=n.name;"radio"===g&&m&&h&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!h,userTriggered:!1}:{text:t,isChecked:!h})}}))}function p(t,r){const o=Jd.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Jd.set(t,r);const o=n.getId(t);Hd(e)({...r,id:o})}}const f=("last"===l.input?["change"]:["input","change"]).map((e=>pd(e,Hd(d),t))),h=t.defaultView;if(!h)return()=>{f.forEach((e=>e()))};const g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),m=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&f.push(...m.map((e=>md(e[0],e[1],{set(){Hd(d)({target:this,isTrusted:!1})}},!1,h)))),Hd((()=>{f.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const a=Hd((i=>gd(Hd((o=>{const a=qd(o);if(!a||kd(a,t,n,!0))return;const{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=a;e({type:i,id:r.getId(a),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})})),o.media||500))),s=[pd("play",a(du.Play),i),pd("pause",a(du.Pause),i),pd("seeked",a(du.Seeked),i),pd("volumechange",a(du.VolumeChange),i),pd("ratechange",a(du.RateChange),i)];return Hd((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},f=()=>{},h=()=>{};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:Hd(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=$d(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,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:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,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:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replace:a}),r.apply(o,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replaceSync:a}),r.apply(o,i)}))}));const c={};ep("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(ep("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),ep("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),ep("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach((([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Hd(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=$d(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:[...Kd(o),s||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Hd(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=$d(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:[...Kd(o),a]}]}),r.apply(o,i)}))})})),Hd((()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,a&&(r.CSSStyleSheet.prototype.replace=a),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule}))}))}(e,{win:n}),p=Yd(e,e.doc),f=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:Hd(((o,a,s)=>{var c;const[l,u,d]=s;if(n.has(l))return i.apply(a,[l,u,d]);const{id:p,styleId:f}=$d(null==(c=a.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||f&&-1!==f)&&e({id:p,styleId:f,set:{property:l,value:u,priority:d},index:Kd(a.parentRule)}),o.apply(a,s)}))});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Hd(((o,i,s)=>{var c;const[l]=s;if(n.has(l))return a.apply(i,[l]);const{id:u,styleId:d}=$d(null==(c=i.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:l},index:Kd(i.parentRule)}),o.apply(i,s)}))}),Hd((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(h=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=Iu(t.fonts,"add",(function(t){return function(n){return setTimeout(Hd((()=>{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),Hd((()=>{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=Hd((()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const i=e.getRangeAt(t),{startContainer:a,startOffset:c,endContainer:l,endOffset:u}=i;kd(a,r,o,!0)||kd(l,r,o,!0)||s.push({start:n.getId(a),startOffset:c,end:n.getId(l),endOffset:u})}i({ranges:s})}));return s(),pd("selectionchange",s)}(e),m=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Iu(n.customElements,"define",(function(e){return function(n,r,o){try{t({define:{name:n}})}catch(i){console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,r,o])}})):()=>{}}(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,n,y.options));return Hd((()=>{zd.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),p(),f(),h(),g(),m(),v.forEach((e=>e()))}))}function Qd(e){return void 0!==window[e]}function ep(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class tp{constructor(e){iu(this,"iframeIdToRemoteIdMap",new WeakMap),iu(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 np{constructor(e){iu(this,"iframes",new WeakMap),iu(this,"crossOriginIframeMap",new WeakMap),iu(this,"crossOriginIframeMirror",new tp(Ju)),iu(this,"crossOriginIframeStyleMirror"),iu(this,"crossOriginIframeRootIdMap",new WeakMap),iu(this,"mirror"),iu(this,"mutationCb"),iu(this,"wrappedEmit"),iu(this,"loadListener"),iu(this,"stylesheetManager"),iu(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tp(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 au.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:au.IncrementalSnapshot,data:{source:su.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case au.Meta:case au.Load:case au.DomContentLoaded:return!1;case au.Plugin:return t;case au.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case au.IncrementalSnapshot:switch(t.data.source){case su.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 su.Drag:case su.TouchMove:case su.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case su.ViewportResize:return!1;case su.MediaInteraction:case su.MouseInteraction:case su.Scroll:case su.CanvasMutation:case su.Input:return this.replaceIds(t.data,e,["id"]),t;case su.StyleSheetRule:case su.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case su.Font:return t;case su.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case su.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===pu.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class rp{constructor(e){iu(this,"shadowDoms",new WeakSet),iu(this,"mutationCb"),iu(this,"scrollCb"),iu(this,"bypassOptions"),iu(this,"mirror"),iu(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(!Ou(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Wd({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Vd({...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(Eu.host(e))),this.restoreHandlers.push(Yd({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(Iu(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r),i=Eu.shadowRoot(this);return i&&Md(this)&&n.addShadowRoot(i,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var op="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ip="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ap=0;ap<64;ap++)ip[op.charCodeAt(ap)]=ap;const sp=new Map;const cp=(e,t,n)=>{if(!e||!dp(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=sp.get(e);return n||(n=new Map,sp.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 lp(e,t,n){if(e instanceof Array)return e.map((e=>lp(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<r;t+=3)o+=op[n[t]>>2],o+=op[(3&n[t])<<4|n[t+1]>>4],o+=op[(15&n[t+1])<<2|n[t+2]>>6],o+=op[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:[lp(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:[lp(e.data,t,n),e.width,e.height]}}if(dp(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:cp(e,t,n)}}return e}const up=(e,t,n)=>e.map((e=>lp(e,t,n))),dp=(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 pp(e,t,n,r){const o=[];try{const i=Iu(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!kd(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 fp(e,t,n,r,o,i){const a=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if("function"!=typeof e[c])continue;const s=Iu(e,c,(function(e){return function(...a){const s=e.apply(this,a);if(cp(s,i,this),"tagName"in this.canvas&&!kd(this.canvas,r,o,!0)){const e=up(a,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}}));a.push(s)}catch{const r=md(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});a.push(r)}return a}const hp='(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',gp="undefined"!=typeof self&&self.Blob&&new Blob([hp],{type:"text/javascript;charset=utf-8"});function mp(e){let t;try{if(t=gp&&(self.URL||self.webkitURL).createObjectURL(gp),!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(hp),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class vp{constructor(e){iu(this,"pendingCanvasMutations",new Map),iu(this,"rafStamps",{latestId:0,invokeId:null}),iu(this,"mirror"),iu(this,"mutationCb"),iu(this,"resetObservers"),iu(this,"frozen",!1),iu(this,"locked",!1),iu(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=pp(t,n,r,!0),a=new Map,s=new mp;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:uu["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 c=1e3/e;let l,u=0;const d=e=>{u&&e-u<c||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{kd(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])}))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=pp(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=Iu(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return kd(this.canvas,n,r,!0)||setTimeout((()=>{const n=up(i,t,this);e(this.canvas,{type:uu["2D"],property:a,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch{const n=md(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:uu["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(...fp(t.WebGLRenderingContext.prototype,uu.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...fp(t.WebGL2RenderingContext.prototype,uu.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 yp{constructor(e){iu(this,"trackedLinkElements",new WeakSet),iu(this,"mutationCb"),iu(this,"adoptedStyleSheetCb"),iu(this,"styleMirror",new Ld),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:Mu(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 bp{constructor(){iu(this,"nodeMap",new WeakMap),iu(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 wp,kp,xp,Sp=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ru=e.contentWindow)?void 0:ru.Array.from)||Array.from,document.body.removeChild(e)}}catch(ah){console.debug("Unable to override Array.from",ah)}const Cp=new Pu;function Ip(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:s=null,maskTextClass:c="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:f,maskInputFn:h,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:I=!1,collectFonts:E=!1,inlineImages:T=!1,plugins:L,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:M}=e;Ud=M;const P=!S||window.parent===window;let R=!1;if(!P)try{window.parent.document&&(R=!1)}catch(V){R=!0}if(P&&!t)throw new Error("emit function is required");if(!P&&!R)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Cp.reset();const N=!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},j=ld(f);let _;!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 D=0;const F=e=>{for(const t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!R&&(e=v(e)),e};wp=(e,o)=>{var i;const a=e;if(a.timestamp=Cu(),!(null==(i=zd[0])?void 0:i.isFrozen())||a.type===au.FullSnapshot||a.type===au.IncrementalSnapshot&&a.data.source===su.Mutation||zd.forEach((e=>e.unfreeze())),P)null==t||t(F(a),o);else if(R){const e={type:"rrweb",event:F(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(a.type===au.FullSnapshot)_=a,D=0;else if(a.type===au.IncrementalSnapshot){if(a.data.source===su.Mutation&&a.data.isAttachIframe)return;D++;const e=r&&D>=r,t=n&&a.timestamp-_.timestamp>n;(e||t)&&kp(!0)}};const B=e=>{wp({type:au.IncrementalSnapshot,data:{source:su.Mutation,...e}})},U=e=>wp({type:au.IncrementalSnapshot,data:{source:su.Scroll,...e}}),H=e=>wp({type:au.IncrementalSnapshot,data:{source:su.CanvasMutation,...e}}),z=new yp({mutationCb:B,adoptedStyleSheetCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.AdoptedStyleSheet,...e}})}),q=new np({mirror:Cp,mutationCb:B,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:wp});for(const J of L||[])J.getMirror&&J.getMirror({nodeMirror:Cp,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const W=new bp;xp=new vp({recordCanvas:x,mutationCb:H,win:window,blockClass:o,blockSelector:i,mirror:Cp,sampling:y.canvas,dataURLOptions:b});const G=new rp({mutationCb:B,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:N,dataURLOptions:b,maskTextFn:g,maskInputFn:h,recordCanvas:x,inlineImages:T,sampling:y,slimDOMOptions:j,iframeManager:q,stylesheetManager:z,canvasManager:xp,keepIframeSrcFn:O,processedNodeManager:W},mirror:Cp});kp=(e=!1)=>{if(!k)return;wp({type:au.Meta,data:{href:window.location.href,width:bd(),height:yd()}},e),z.reset(),G.init(),zd.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new Pu,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:p,slimDOM:f=!1,dataURLOptions:h,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return ud(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:ld(f),dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:Cp,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:N,maskTextFn:g,maskInputFn:h,slimDOM:j,dataURLOptions:b,recordCanvas:x,inlineImages:T,onSerialize:e=>{Id(e,Cp)&&q.addIframe(e),Ed(e,Cp)&&z.trackLinkElement(e),Td(e)&&G.addShadowRoot(Eu.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!t)return console.warn("Failed to snapshot the document");wp({type:au.FullSnapshot,data:{node:t,initialOffset:vd(window)}},e),zd.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Cp.getId(document))};try{const e=[],t=e=>{var t;return Hd(Zd)({mutationCb:B,mousemoveCb:(e,t)=>wp({type:au.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.ViewportResize,...e}}),inputCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.Input,...e}}),mediaInteractionCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.MediaInteraction,...e}}),styleSheetRuleCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.StyleSheetRule,...e}}),styleDeclarationCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.StyleDeclaration,...e}}),canvasMutationCb:H,fontCb:e=>wp({type:au.IncrementalSnapshot,data:{source:su.Font,...e}}),selectionCb:e=>{wp({type:au.IncrementalSnapshot,data:{source:su.Selection,...e}})},customElementCb:e=>{wp({type:au.IncrementalSnapshot,data:{source:su.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:N,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:T,userTriggeredOnInput:I,collectFonts:E,doc:e,maskInputFn:h,maskTextFn:g,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:j,dataURLOptions:b,mirror:Cp,iframeManager:q,stylesheetManager:z,shadowDomManager:G,processedNodeManager:W,canvasManager:xp,ignoreCSSAttributes:A,plugins:(null==(t=null==L?void 0:L.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>wp({type:au.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};q.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{kp(),e.push(t(document)),Sp=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(pd("DOMContentLoaded",(()=>{wp({type:au.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(pd("load",(()=>{wp({type:au.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),Sp=!1,Ud=void 0}}catch(X){console.warn(X)}}Ip.addCustomEvent=(e,t)=>{if(!Sp)throw new Error("please add custom event after start recording");wp({type:au.Custom,data:{tag:e,payload:t}})},Ip.freezePage=()=>{zd.forEach((e=>e.freeze()))},Ip.takeFullSnapshot=e=>{if(!Sp)throw new Error("please take full snapshot after start recording");kp(e)},Ip.mirror=Cp;var Ep=Uint8Array,Tp=Uint16Array,Lp=Uint32Array,Op=new Ep([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]),Ap=new Ep([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]),Mp=new Ep([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pp=function(e,t){for(var n=new Tp(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new Lp(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},Rp=Pp(Op,2),Np=Rp[0],jp=Rp[1];Np[28]=258,jp[258]=28;for(var _p=Pp(Ap,0),Dp=(_p[0],_p[1]),Fp=new Tp(32768),Bp=0;Bp<32768;++Bp){var Up=(43690&Bp)>>>1|(21845&Bp)<<1;Up=(61680&(Up=(52428&Up)>>>2|(13107&Up)<<2))>>>4|(3855&Up)<<4,Fp[Bp]=((65280&Up)>>>8|(255&Up)<<8)>>>1}var Hp=function(e,t,n){for(var r=e.length,o=0,i=new Tp(t);o<r;++o)++i[e[o]-1];var a,s=new Tp(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new Tp(1<<t);var c=15-t;for(o=0;o<r;++o)if(e[o])for(var l=o<<4|e[o],u=t-e[o],d=s[e[o]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)a[Fp[d]>>>c]=l}else for(a=new Tp(r),o=0;o<r;++o)a[o]=Fp[s[e[o]-1]++]>>>15-e[o];return a},zp=new Ep(288);for(Bp=0;Bp<144;++Bp)zp[Bp]=8;for(Bp=144;Bp<256;++Bp)zp[Bp]=9;for(Bp=256;Bp<280;++Bp)zp[Bp]=7;for(Bp=280;Bp<288;++Bp)zp[Bp]=8;var qp=new Ep(32);for(Bp=0;Bp<32;++Bp)qp[Bp]=5;var Wp=Hp(zp,9,0),Gp=Hp(qp,5,0),Vp=function(e){return(e/8>>0)+(7&e&&1)},Xp=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Tp?Tp:e instanceof Lp?Lp:Ep)(n-t);return r.set(e.subarray(t,n)),r},Jp=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Kp=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},$p=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new Ep(0),0];if(1==o){var a=new Ep(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=o-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var f=new Tp(p+1),h=Yp(n[u-1],f,0);if(h>t){r=0;var g=0,m=h-t,v=1<<m;for(i.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<o;++r){var y=i[r].s;if(!(f[y]>t))break;g+=v-(1<<h-f[y]),f[y]=t}for(g>>>=m;g>0;){var b=i[r].s;f[b]<t?g-=1<<t-f[b]++-1:++r}for(;r>=0&&g;--r){var w=i[r].s;f[w]==t&&(--f[w],++g)}h=t}return[new Ep(f),h]},Yp=function(e,t,n){return-1==e.s?Math.max(Yp(e.l,t,n+1),Yp(e.r,t,n+1)):t[e.s]=n},Zp=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Tp(++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]},Qp=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ef=function(e,t,n){var r=n.length,o=Vp(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},tf=function(e,t,n,r,o,i,a,s,c,l,u){Jp(t,u++,n),++o[256];for(var d=$p(o,15),p=d[0],f=d[1],h=$p(i,15),g=h[0],m=h[1],v=Zp(p),y=v[0],b=v[1],w=Zp(g),k=w[0],x=w[1],S=new Tp(19),C=0;C<y.length;++C)S[31&y[C]]++;for(C=0;C<k.length;++C)S[31&k[C]]++;for(var I=$p(S,7),E=I[0],T=I[1],L=19;L>4&&!E[Mp[L-1]];--L);var O,A,M,P,R=l+5<<3,N=Qp(o,zp)+Qp(i,qp)+a,j=Qp(o,p)+Qp(i,g)+a+14+3*L+Qp(S,E)+(2*S[16]+3*S[17]+7*S[18]);if(R<=N&&R<=j)return ef(t,u,e.subarray(c,c+l));if(Jp(t,u,1+(j<N)),u+=2,j<N){O=Hp(p,f,0),A=p,M=Hp(g,m,0),P=g;var _=Hp(E,T,0);Jp(t,u,b-257),Jp(t,u+5,x-1),Jp(t,u+10,L-4),u+=14;for(C=0;C<L;++C)Jp(t,u+3*C,E[Mp[C]]);u+=3*L;for(var D=[y,k],F=0;F<2;++F){var B=D[F];for(C=0;C<B.length;++C){var U=31&B[C];Jp(t,u,_[U]),u+=E[U],U>15&&(Jp(t,u,B[C]>>>5&127),u+=B[C]>>>12)}}}else O=Wp,A=zp,M=Gp,P=qp;for(C=0;C<s;++C)if(r[C]>255){U=r[C]>>>18&31;Kp(t,u,O[U+257]),u+=A[U+257],U>7&&(Jp(t,u,r[C]>>>23&31),u+=Op[U]);var H=31&r[C];Kp(t,u,M[H]),u+=P[H],H>3&&(Kp(t,u,r[C]>>>5&8191),u+=Ap[H])}else Kp(t,u,O[r[C]]),u+=A[r[C]];return Kp(t,u,O[256]),u+A[256]},nf=new Lp([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rf=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new Ep(r+a+5*(1+Math.floor(a/7e3))+o),c=s.subarray(r,s.length-o),l=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d<a?l=ef(c,l,e.subarray(u,d)):(c[u]=i,l=ef(c,l,e.subarray(u,a)))}else{for(var p=nf[t-1],f=p>>>13,h=8191&p,g=(1<<n)-1,m=new Tp(32768),v=new Tp(g+1),y=Math.ceil(n/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},k=new Lp(25e3),x=new Tp(288),S=new Tp(32),C=0,I=0,E=(u=0,0),T=0,L=0;u<a;++u){var O=w(u),A=32767&u,M=v[O];if(m[A]=M,v[O]=A,T<=u){var P=a-u;if((C>7e3||E>24576)&&P>423){l=tf(e,c,0,k,x,S,I,E,L,u-L,l),E=C=I=0,L=u;for(var R=0;R<286;++R)x[R]=0;for(R=0;R<30;++R)S[R]=0}var N=2,j=0,_=h,D=A-M&32767;if(P>2&&O==w(u-D))for(var F=Math.min(f,P)-1,B=Math.min(32767,u),U=Math.min(258,P);D<=B&&--_&&A!=M;){if(e[u+N]==e[u+N-D]){for(var H=0;H<U&&e[u+H]==e[u+H-D];++H);if(H>N){if(N=H,j=D,H>F)break;var z=Math.min(D,H-2),q=0;for(R=0;R<z;++R){var W=u-D+R+32768&32767,G=W-m[W]+32768&32767;G>q&&(q=G,M=W)}}}D+=(A=M)-(M=m[A])+32768&32767}if(j){k[E++]=268435456|jp[N]<<18|Dp[j];var V=31&jp[N],X=31&Dp[j];I+=Op[V]+Ap[X],++x[257+V],++S[X],T=u+N,++C}else k[E++]=e[u],++x[e[u]]}}l=tf(e,c,i,k,x,S,I,E,L,u-L,l)}return Xp(s,0,r+Vp(l)+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 of(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<s;++a)o+=r+=n[a];r%=65521,o%=65521}e=r,t=o},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r,o,i,a=rf(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 af=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<e.length;){var o=e[r++];o<128||t?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&e[r++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&e[r++])<<6|63&e[r++]):(o=((15&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(of(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ep(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;a<n;++a){if(o+5>r.length){var s=new Ep(o+8+(n-a<<1));s.set(r),r=s}var c=e.charCodeAt(a);c<128||t?i(c):c<2048?(i(192|c>>>6),i(128|63&c)):c>55295&&c<57344?(i(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++a))>>>18),i(128|c>>>12&63),i(128|c>>>6&63),i(128|63&c)):(i(224|c>>>12),i(128|c>>>6&63),i(128|63&c))}return Xp(r,0,o)}(JSON.stringify(t))),!0)};function sf(e){return function(e){if(Array.isArray(e))return cf(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 cf(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 cf(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 cf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lf(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 uf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lf(Object(n),!0).forEach((function(t){pf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function df(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ff(r.key),r)}}function pf(e,t,n){return(t=ff(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ff(e){var t=function(e,t){if("object"!=hf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=hf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==hf(t)?t:String(t)}function hf(e){return hf="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},hf(e)}var gf=10485760,mf=function e(t){if("string"==typeof t)return t.length+2;if(null===t||"object"!==hf(t))return"number"==typeof t?String(t).length:5;var n=2;if(Array.isArray(t)){for(var r=0;r<t.length;r++)n+=e(t[r])+1;return n}for(var o in t)n+=o.length+4+e(t[o]);return n},vf=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),pf(this,"startDate",void 0),pf(this,"segments",[[]]),pf(this,"segmentSizes",[0]),pf(this,"incrementalSize",0),pf(this,"lastForcedCheckout",0),pf(this,"forcedCheckoutTimeout",void 0),pf(this,"stopFunction",void 0),pf(this,"customOptions",{})}var t,n,r;return t=e,n=[{key:"setOptions",value:function(e){this.customOptions=e,this.stopFunction&&this.start()}},{key:"start",value:function(){var e=this;this.stop(),this.startDate=Date.now(),this.resetBuffer();var t={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=Ip(uf(uf(uf(uf({},t),this.customOptions),function(e){var t=function(t,n){var r=Co(n,e);return r?r(t):t};return!0===(e=e||{}).maskAllInputs?{maskInputFn:t}:{maskInputFn:t,maskInputOptions:lo(lo({},So(e)),vo)}}(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=mf(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(n){console.error(n)}}},{key:"startIfNotRunning",value:function(){this.stopFunction||this.start()}},{key:"stop",value:function(){this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.startDate=void 0,this.resetBuffer()}},{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;t<this.segmentSizes.length;t++)e+=this.segmentSizes[t];return e}},{key:"enforceBufferSize",value:function(){for(;this.segments.length>1&&this.getBufferSize()>gf;)this.dropOldestSegment();this.getBufferSize()>gf&&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{Ip.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,sf(this.segments)),n=t,r=!1;try{n=t.map((function(e){return af(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&&df(t.prototype,n),r&&df(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function yf(e){return yf="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},yf(e)}function bf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kf(r.key),r)}}function wf(e,t,n){return(t=kf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kf(e){var t=function(e,t){if("object"!=yf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=yf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==yf(t)?t:String(t)}pf(vf,"instance",void 0);var xf=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),wf(this,"shortCutListener",void 0)}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"start",value:function(){this.shortCutListener||(this.shortCutListener=document.addEventListener("keyup",(function(e){var t,n,r=(void 0!==(t=e).key?n=t.key:void 0!==t.keyIdentifier?n=t.keyIdentifier:void 0!==t.keyCode&&(n=t.keyCode),n);!e.ctrlKey||"u"!==r&&"U"!==r&&85!==r||oh.startFeedbackFlowWithOptions("bugreporting",{autostartDrawing:!0})})))}},{key:"stop",value:function(){this.shortCutListener&&(document.removeEventListener("keyup",this.shortCutListener),this.shortCutListener=void 0)}}])&&bf(t.prototype,n),r&&bf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Sf(e){return Sf="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},Sf(e)}function Cf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ef(r.key),r)}}function If(e,t,n){return(t=Ef(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ef(e){var t=function(e,t){if("object"!=Sf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Sf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Sf(t)?t:String(t)}wf(xf,"instance",void 0);var Tf=function(e,t,n,r){var o=Math.min(e*Math.pow(2,Math.min(Math.max(t,0),16)),n),i=.8+.4*Math.min(Math.max(r,0),1);return Math.min(o*i,n)},Lf=function(){return"undefined"!=typeof navigator&&!!navigator&&!1===navigator.onLine},Of=null,Af=function(e){try{if(Of||"undefined"==typeof TextEncoder||(Of=new TextEncoder),Of)return Of.encode(e).length}catch(t){}return e.length},Mf=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),If(this,"eventArray",[]),If(this,"streamedEventArray",[]),If(this,"eventMaxLength",500),If(this,"pingInFlight",0),If(this,"lastPingId",0),If(this,"pingFailures",0),If(this,"pingRetryAt",0),If(this,"lastUrl",void 0),If(this,"mainLoopTimeout",null),If(this,"socket",null),If(this,"connectedWebSocketGleapId",null),If(this,"connectionTimeout",null),If(this,"pingWS",null),If(this,"reconnectTimeout",null),If(this,"reconnectAttempts",0),If(this,"socketOpenedAt",0),If(this,"networkListenersAdded",!1),If(this,"handleOpenBound",null),If(this,"handleErrorBound",null),If(this,"handleMessageBound",null),If(this,"handleCloseBound",null),If(this,"handleOnlineBound",null),If(this,"runEventStreamLoop",(function(){var e=t;try{t.streamEvents()}catch(n){}t.mainLoopTimeout=setTimeout((function(){e.runEventStreamLoop()}),2500)})),If(this,"streamEvents",(function(){var e=vs.getInstance(),n=e.session;if(e.ready&&n&&n.gleapId&&n.gleapHash&&!(t.pingInFlight||Date.now()<t.pingRetryAt)&&0!==t.streamedEventArray.length&&t.socket&&t.socket.readyState===t.socket.OPEN){var r=t.nextPingBatch(),o=r.events,i=r.hasMore;if(0!==o.length){t.lastPingId+=1;var a=t.lastPingId;t.pingInFlight=a;var s=new XMLHttpRequest,c=null,l=function(){clearTimeout(c),t.pingDidFinish(a,o,i,s)};c=setTimeout((function(){try{s.abort()}catch(e){}l()}),3e4);try{s.open("POST",e.apiUrl+"/sessions/events"),s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),e.injectSession(s),s.onerror=l,s.onreadystatechange=function(){4===s.readyState&&l()},s.send(JSON.stringify({time:cc.getInstance().getSessionDuration(),events:o,opened:zs.getInstance().isOpened(),type:"js",sdkVersion:"19.0.0",ws:!0}))}catch(u){l()}}}})),this.handleOpenBound=this.handleOpen.bind(this),this.handleErrorBound=this.handleError.bind(this),this.handleMessageBound=this.handleMessage.bind(this),this.handleCloseBound=this.handleClose.bind(this),this.handleOnlineBound=this.handleOnline.bind(this)}var t,n,r;return t=e,n=[{key:"cleanupWebSocket",value:function(){this.clearReconnectTimeout(),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.pingWS&&(clearInterval(this.pingWS),this.pingWS=null),this.socketOpenedAt=0,this.socket&&(this.socket.removeEventListener("open",this.handleOpenBound),this.socket.removeEventListener("error",this.handleErrorBound),this.socket.removeEventListener("message",this.handleMessageBound),this.socket.removeEventListener("close",this.handleCloseBound),this.socket.close(),this.socket=null)}},{key:"initWebSocket",value:function(){this.cleanupWebSocket();var e=vs.getInstance().session;this.connectedWebSocketGleapId=e?e.gleapId:null,e&&e.gleapId&&vs.getInstance().sdkKey&&(this.socket=new WebSocket("".concat(vs.getInstance().wsApiUrl,"?gleapId=").concat(vs.getInstance().session.gleapId,"&gleapHash=").concat(vs.getInstance().session.gleapHash,"&apiKey=").concat(vs.getInstance().sdkKey,"&sdkVersion=").concat("19.0.0")),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(),!Lf()){var n=e.reconnectDelay(this.reconnectAttempts,Math.random());this.reconnectAttempts+=1,this.reconnectTimeout=setTimeout((function(){t.reconnectTimeout=null,Lf()||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&&this.socket.readyState===this.socket.OPEN||(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.readyState===t.socket.OPEN&&(t.socket.send("PING"),t.socket.send(9))}),1e4),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(st.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,c=zs.getInstance().isOpened();if(s&&bl.getInstance().clearNotificationsForConversation(s),a&&Pn.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 l=["banner","modal"],u=o.filter((function(e){var t;return!c||l.includes(null==e||null===(t=e.actionType)||void 0===t?void 0:t.toLowerCase())}));oh.getInstance().performActions(u)}null!=i&&bl.getInstance().setNotificationCount(i)}if("checklist"===e.name&&null!=e&&e.data&&window){var d,p,f=e.data,h=null!==(d=f.completedSteps)&&void 0!==d?d:[],g=null!==(p=f.completedStepsBefore)&&void 0!==p?p:[];if(h.length>g.length)for(var m=function(e){var t,n=null==f||null===(t=f.steps)||void 0===t?void 0:t.find((function(t){return t.id===h[e]}));if(!n)return 1;var r=e;g.includes(n)||Ft.notifyEvent("checklist-step-completed",{checklistId:f.id,outboundId:f.outboundId,stepId:n.id,stepIndex:r,step:n,completedSteps:f.completedSteps,status:f.status,data:f})},v=0;v<h.length;v++)m(v);"done"===f.status&&Ft.notifyEvent("checklist-completed",{checklistId:f.id,outboundId:f.outboundId,completedSteps:f.completedSteps,status:f.status,data:f}),"function"==typeof window.dispatchEvent&&window.dispatchEvent(new CustomEvent("checkListUpdate",{detail:e.data}))}}catch(y){}}},{key:"getEventArray",value:function(){return this.eventArray}},{key:"stop",value:function(){this.cleanupMainLoop(),this.cleanupWebSocket(),this.removeNetworkListeners(),this.reconnectAttempts=0,this.connectedWebSocketGleapId=null}},{key:"cleanupMainLoop",value:function(){this.mainLoopTimeout&&(clearTimeout(this.mainLoopTimeout),this.mainLoopTimeout=null)}},{key:"restart",value:function(){this.connectedWebSocketGleapId!==vs.getInstance().session.gleapId&&this.initWebSocket(),this.cleanupMainLoop(),this.trackInitialEvents(),this.runEventStreamLoop()}},{key:"start",value:function(){this.startPageListener()}},{key:"trackInitialEvents",value:function(){e.getInstance().logEvent("sessionStarted"),e.getInstance().logCurrentPage()}},{key:"logCurrentPage",value:function(){if(!oh.getInstance().disablePageTracking){var e=window.location.href;e&&e!==this.lastUrl&&(this.lastUrl=e,this.logEvent("pageView",{page:e}))}}},{key:"startPageListener",value:function(){var e=this;setInterval((function(){e.logCurrentPage();try{bl.getInstance().checkPageRulesForUrl(window.location.href)}catch(t){}}),1e3)}},{key:"logEvent",value:function(e,t){var n={name:e,date:new Date};t&&(n.data=ee(t)),this.eventArray.push(n),this.streamedEventArray.push(n),this.eventArray.length>this.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(c){}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;r<this.streamedEventArray.length&&e.length<100;r++){var o=this.streamedEventArray[r],i=void 0;try{i=Af(JSON.stringify(o))+1}catch(a){t.push(o);continue}if(e.length>0&&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<this.streamedEventArray.length}}},{key:"removeSentEvents",value:function(e){var t=new Set(e);this.streamedEventArray=this.streamedEventArray.filter((function(e){return!t.has(e)}))}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"pingBackoffDelay",value:function(e,t){return Tf(3e3,e-1,6e4,t)}},{key:"reconnectDelay",value:function(e,t){return Tf(1e3,e,6e4,t)}},{key:"isRetryablePingStatus",value:function(e){return!e||408===e||429===e||e>=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&&Cf(t.prototype,n),r&&Cf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Pf(e){return Pf="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},Pf(e)}function Rf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jf(r.key),r)}}function Nf(e,t,n){return(t=jf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jf(e){var t=function(e,t){if("object"!=Pf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Pf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pf(t)?t:String(t)}If(Mf,"instance",void 0);var _f=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Nf(this,"channel",null)}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"start",value:function(){var e=this;if(!this.channel&&"undefined"!=typeof BroadcastChannel)try{var t=vs.getInstance().sdkKey;this.channel=new BroadcastChannel("gleap-tabs-".concat(t)),this.channel.onmessage=function(t){return e.handleMessage(t&&t.data)}}catch(n){this.channel=null}}},{key:"sendMessage",value:function(e){if(this.channel)try{this.channel.postMessage(e)}catch(t){}}},{key:"handleMessage",value:function(e){try{var t;if(!e||!e.type)return;var n=null===(t=vs.getInstance().session)||void 0===t?void 0:t.gleapId;if(!e.gleapId||!n||e.gleapId!==n)return;"notifications-cleared"===e.type&&(bl.getInstance().clearAllNotifications(!1,!0),j.getInstance().updateNotificationBadge(0)),"conversation-notifications-cleared"===e.type&&e.shareToken&&bl.getInstance().clearNotificationsForConversation(e.shareToken,!0),"chatbar-notification-cleared"===e.type&&Pn.getInstance().hideChatbarNotification(!0)}catch(r){}}},{key:"stop",value:function(){try{this.channel&&this.channel.close()}catch(e){}this.channel=null}}])&&Rf(t.prototype,n),r&&Rf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Df(e){return Df="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},Df(e)}function Ff(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Uf(r.key),r)}}function Bf(e,t,n){return(t=Uf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uf(e){var t=function(e,t){if("object"!=Df(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Df(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Df(t)?t:String(t)}Nf(_f,"instance",void 0);var Hf=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Bf(this,"tags",[])}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(n=[{key:"getTags",value:function(){return this.tags}},{key:"setTags",value:function(e){this.tags=e}}])&&Ff(t.prototype,n),r&&Ff(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function zf(e){return zf="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},zf(e)}function qf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gf(r.key),r)}}function Wf(e,t,n){return(t=Gf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gf(e){var t=function(e,t){if("object"!=zf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=zf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zf(t)?t:String(t)}Bf(Hf,"instance",void 0);var Vf=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wf(this,"overrideLanguage",""),Wf(this,"isRTLLayout",!1)}var t,n,r;return t=e,r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}},{key:"translateText",value:function(e){if(!e)return"";var t=br.getInstance().getFlowConfig().staticTranslations;return t&&t[e]?t[e]:e}},{key:"translateTextWithVars",value:function(e,t){if(!e)return"";var n=this.translateText(e);return n?n.replace(/{(\w+)}/g,(function(e,n){return t[n]})):""}}],(n=[{key:"getOverrideLanguage",value:function(){return this.overrideLanguage}},{key:"setOverrideLanguage",value:function(e){this.overrideLanguage=e}},{key:"updateRTLSupport",value:function(){var e=br.getInstance().getFlowConfig();this.isRTLLayout=!1,e&&e.localizationOptions&&e.localizationOptions.rtl&&(this.isRTLLayout=!0),j.getInstance().updateFeedbackButtonState(),zs.getInstance().updateFrameStyle()}},{key:"getActiveLanguage",value:function(){var e="en";if("undefined"!=typeof navigator&&(e=navigator.language.toLowerCase()),"undefined"!=typeof document&&document.documentElement){var t=document.documentElement.lang;t&&""!==t.trim()&&(e=t.toLowerCase().trim())}return this.overrideLanguage&&""!==this.overrideLanguage&&(e=this.overrideLanguage.toLowerCase()),e}}])&&qf(t.prototype,n),r&&qf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Xf(e){return Xf="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},Xf(e)}function Jf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zf(r.key),r)}}function Kf(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<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kf(Object(n),!0).forEach((function(t){Yf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yf(e,t,n){return(t=Zf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zf(e){var t=function(e,t){if("object"!=Xf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Xf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Xf(t)?t:String(t)}Wf(Vf,"instance",void 0),"undefined"!=typeof window&&"undefined"!=typeof HTMLCanvasElement&&HTMLCanvasElement.prototype&&void 0===HTMLCanvasElement.prototype.__originalGetContext&&(HTMLCanvasElement.prototype.__originalGetContext=HTMLCanvasElement.prototype.getContext,HTMLCanvasElement.prototype.getContext=function(e,t){return this.__originalGetContext(e,$f($f({},t),{},{preserveDrawingBuffer:!0}))}),"undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&"undefined"!=typeof window&&(function(){if("undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&"undefined"!=typeof window){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),tr($n(e=Kn(this,t)),"activeStep",-1),tr($n(e),"checklistData",null),tr($n(e),"_isInitialLoad",!1),tr($n(e),"_initialActiveSet",!1),tr($n(e),"_hasLoaded",!1),tr($n(e),"_isSessionReady",!1),tr($n(e),"_boundHandleChecklistUpdate",e.handleChecklistUpdate.bind($n(e))),tr($n(e),"_boundHandleSessionUpdate",e.handleSessionUpdate.bind($n(e))),e.attachShadow({mode:"open"});try{e._networkManager=void 0!==vs&&void 0!==A?A.getInstance():null}catch(n){e._networkManager=null}return e._boundFloatingLauncherClick=e.handleFloatingLauncherClick.bind($n(e)),e._boundFloatingCloseClick=e.handleFloatingCloseClick.bind($n(e)),e._floatingHideTimeout=null,e}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qn(e,t)}(t,e),n=t,r=[{key:"connectedCallback",value:function(){xn.getInstance().applyToChecklist(this),window.addEventListener("checkListUpdate",this._boundHandleChecklistUpdate),window.addEventListener("session-updated",this._boundHandleSessionUpdate),window.addEventListener("resize",this._boundResizeHandler=this.handleResize.bind(this)),this._checkSessionAndLoad()}},{key:"disconnectedCallback",value:function(){window.removeEventListener("checkListUpdate",this._boundHandleChecklistUpdate),window.removeEventListener("session-updated",this._boundHandleSessionUpdate),window.removeEventListener("resize",this._boundResizeHandler),this.removeFloatingClickListeners(),this._floatingHideTimeout&&(clearTimeout(this._floatingHideTimeout),this._floatingHideTimeout=null),this.checklistData=null,this.activeStep=-1,this._hasLoaded=!1,this._isSessionReady=!1,this._initialActiveSet=!1,this.renderResponse()}},{key:"handleResize",value:function(){this.updateActiveTaskMaxHeight()}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&("checklistId"===e&&this._isSessionReady?this.loadChecklist():"checklistId"!==e&&this._hasLoaded&&this.checklistData&&this.renderChecklist(this.checklistData))}},{key:"_checkSessionAndLoad",value:function(){var e=this._getGleapSessionInstance(),t=this.getAttribute("checklistId");e.ready&&t?(this._isSessionReady=!0,this._networkManager=A.getInstance(),this.loadChecklist()):(this._isSessionReady=!1,this._hasLoaded=!1,this.checklistData=null,this.activeStep=-1,this._initialActiveSet=!1,this.renderResponse())}},{key:"handleSessionUpdate",value:function(){this._checkSessionAndLoad()}},{key:"_getGleapSessionInstance",value:function(){try{return void 0!==vs?vs.getInstance():null}catch(e){return null}}},{key:"infoEnabled",get:function(){var e=this.getAttribute("info");return null===e||"false"!==e.toLowerCase()}},{key:"progressbarEnabled",get:function(){var e=this.getAttribute("progressbar");return null===e||"false"!==e.toLowerCase()}},{key:"floatingEnabled",get:function(){return"true"===this.getAttribute("floating")}},{key:"_translate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Vf.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Vf.translateTextWithVars(e,t)||n}},{key:"getCheckIcon",value:function(){return'<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M20.7071 5.29289C21.0976 5.68342 21.0976 6.31658 20.7071 6.70711L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071L3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929C3.68342 10.9024 4.31658 10.9024 4.70711 11.2929L9 15.5858L19.2929 5.29289C19.6834 4.90237 20.3166 4.90237 20.7071 5.29289Z" fill="currentColor"/>\n </svg>'}},{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!==Vf&&(n=Vf.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),Ft.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:"",c=null!==(r=null==a?void 0:a.gleapHash)&&void 0!==r?r:"",l="en";try{void 0!==Vf&&(l=Vf.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(c,"&lang=").concat(l),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=Vn(this.checklistData.completedSteps||[]),o=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(r)&&(this.checklistData.completedSteps=Vn(t.completedSteps),o=!0,-1!==a)){var s,c=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;c&&this.checklistData.completedSteps.includes(c)&&!r.includes(c)&&(i=!0)}if(t.status&&t.status!==this.checklistData.status&&(this.checklistData.status=t.status,o=!0),i){for(var l,u=(null===(l=this.checklistData.outbound)||void 0===l||null===(l=l.config)||void 0===l?void 0:l.steps)||[],d=-1,p=a+1;p<u.length;p++)if(!this.checklistData.completedSteps.includes(u[p].id)){d=p;break}this.activeStep!==d&&this.setActiveStep(d),o=!0}o&&(this.renderChecklist(this.checklistData),Ft.notifyEvent("checklist-update",{checklistId:this.checklistData.id,outboundId:null===(n=this.checklistData.outbound)||void 0===n?void 0:n.id,completedSteps:this.checklistData.completedSteps,status:this.checklistData.status,data:this.checklistData}))}}}},{key:"handleFloatingLauncherClick",value:function(e){if(e.stopPropagation(),"done"!==this.checklistData.status){var t=this.shadowRoot.querySelector(".checklist-tasks");t&&(t.style.display="block"===t.style.display?"none":"block")}}},{key:"handleFloatingCloseClick",value:function(e){e.stopPropagation();var t=this.shadowRoot.querySelector(".checklist-tasks");t&&(t.style.display="none")}},{key:"addFloatingClickListeners",value:function(){var e=this.shadowRoot.querySelector(".checklist-floating-launcher");e&&e.addEventListener("click",this._boundFloatingLauncherClick);var t=this.shadowRoot.querySelector(".checklist-floating-header");t&&t.addEventListener("click",this._boundFloatingCloseClick)}},{key:"removeFloatingClickListeners",value:function(){var e=this.shadowRoot.querySelector(".checklist-floating-launcher");e&&e.removeEventListener("click",this._boundFloatingLauncherClick);var t=this.shadowRoot.querySelector(".checklist-floating-header");t&&t.removeEventListener("click",this._boundFloatingCloseClick)}},{key:"renderResponse",value:function(){this.shadowRoot.innerHTML=""}},{key:"renderFloatingLauncher",value:function(e){var t,n,r=arguments.length>1&&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 c=i.length,l=a.length;s=c>0?l/c*100:0}var u,d,p=i.find((function(e){return!a.includes(e.id)})),f=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",h=i.length>0?p&&p.description||"":e.message||"";o&&(f=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",h=(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?'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>';return'\n <div part="'.concat(r,'" class="').concat(v?"checklist-floating-header":"checklist-floating-launcher"," ").concat(o?"checklist-floating-launcher--done":"",'">\n <div class="floating-header">\n <div class="floating-circular-progress">\n <svg viewBox="0 0 20 20">\n <circle class="track" cx="10" cy="10" r="7"></circle>\n <circle class="progress" cx="10" cy="10" r="7" stroke-dasharray="').concat(g.toFixed(2),'" stroke-dashoffset="').concat(m.toFixed(2),'"></circle>\n </svg>\n </div>\n <div class="floating-title">').concat(f,"</div>\n ").concat(o?"":'<span class="floating-icon">'.concat(y,"</span>"),'\n </div>\n <div class="floating-subtitle">').concat(h,"</div>\n </div>\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 <div part="sender" class="checklists-sender">\n <img part="sender-image" src="'.concat(e.sender.profileImageUrl,'" alt="').concat(e.sender.firstName||"Sender",'\'s profile picture" style="object-fit: cover;" />\n <span part="sender-name">').concat(e.sender.firstName||"","</span>\n </div>")),'\n <div part="info" class="checklists-info">\n '.concat(n?'<div part="info-title" class="checklists-title">'.concat(n,"</div>"):"","\n ").concat(r?'<div part="info-description" class="checklists-description">'.concat(r,"</div>"):"","\n ").concat(o,"\n </div>")}},{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 <div part="progress-labels" class="checklist-progress-labels">\n <div part="progress-label-primary" class="checklist-progress-label">'.concat(a,"</div>\n ").concat(s?'<div part="progress-label-secondary" class="checklist-progress-label">'.concat(s,"</div>"):"",'\n </div>\n <div part="progress-bar" class="checklist-progress-bar">\n <div part="progress-bar-progress" class="checklist-progress-bar-progress" style="width: ').concat(o,'%;"></div>\n </div>')}},{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?'<span part="task-badge" class="checklist-task-header--badge checklist-task-header--badge-done">'.concat(e.getCheckIcon(),"</span>"):'<span part="task-badge" class="checklist-task-header--badge">'.concat(r+1,"</span>"),s=t.title||e._translateWithVars("stepDefaultTitle",{index:r+1},"Step ".concat(r+1)),c=t.description||"",l=t.actionTitle||e._translate("actionDefaultTitle","Action"),u=t.action&&"none"!==t.action?'<div part="task-action" class="checklist-task-body-action" data-action-index="'.concat(r,'">\n <button type="button" class="action-button form-send-button">').concat(l,"</button>\n </div>"):"",d=e._translate("markAsDone","Mark as done"),p=t.allowMarkDone&&!o?'<div part="task-mark-done" class="checklist-task-body-markdone" data-markdone-index="'.concat(r,'">\n ').concat(e.getCheckIcon(),'\n <div class="checklist-task-body-markdone-label">').concat(d,"</div>\n </div>"):"",f=["checklist-task",o?"checklist-task--done":"",i?"checklist-task--active":""].filter(Boolean).join(" ");return'\n <div part="task" class="'.concat(f,'" data-task-index="').concat(r,'">\n <div part="task-header" class="checklist-task-header" role="button" aria-expanded="').concat(i,'" aria-controls="task-body-').concat(r,'">\n ').concat(a,'\n <div part="task-header-title" class="checklist-task-header--title">').concat(s,'</div>\n <span part="task-header-chevron" class="checklist-task-header--chevron">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>\n </span>\n </div>\n <div part="task-body" class="checklist-task-body" id="task-body-').concat(r,'">\n <div part="task-body-inner" class="checklist-task-body-inner">\n ').concat(c?'<div part="task-body-content" class="checklist-task-body-content">'.concat(c,"</div>"):"","\n ").concat(u,"\n ").concat(p,"\n </div>\n </div>\n </div>")})).join(""):"<p>".concat(this._translate("noStepsDefined","No steps defined."),"</p>")}},{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,c=(null===(a=n.config)||void 0===a?void 0:a.successTitle)||"",l=(null===(s=n.config)||void 0===s?void 0:s.successMessage)||"";i=this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-launcher",!0):'\n <div part="content" class="checklists-content checklists-content--done">\n <div part="success-icon" class="checklists-success-icon">\n <span part="success-icon-circle" class="checklists-success-icon--circle">'.concat(this.getCheckIcon(),'</span>\n </div>\n <div part="success-title" class="checklists-title">').concat(c,'</div>\n <div part="success-description" class="checklists-description">').concat(l,"</div>\n </div>"),-1!==this.activeStep&&(this.activeStep=-1)}else i='\n <div part="content" class="checklists-content">\n '.concat(this.floatingEnabled?"":this.renderInfoSection(n),"\n ").concat(this.floatingEnabled?"":this.renderProgressSection(r,o),"\n ").concat(this.floatingEnabled?this.renderFloatingLauncher(n):"",'\n <div part="tasks" class="checklist-tasks">\n ').concat(this.floatingEnabled?this.renderFloatingLauncher(n,"checklist-floating-header"):"","\n ").concat(this.renderTasks(r,o),"\n </div>\n </div>");var u=br.getInstance().getFlowConfig(),d=u.color?u.color:"#485BFF";xn.getInstance().applyToChecklist(this);var p="\n <style>\n :host {\n display: block;\n --color-bg: #ffffff;\n --color-font-title: #1f2937;\n --color-font-text: #4b5563;\n --color-font-light: #6b7280;\n --color-primary: ".concat(d,";\n --color-primary-light: ").concat(d,'22;\n --color-primary-contrast: #ffffff;\n --color-border: #e5e7eb;\n --color-gray-light: #f3f4f6;\n --color-gray-lighter: #f9fafb;\n --color-gray-dark: #6b7280;\n --color-success: #10b981;\n --color-success-light: #ffffff;\n --radius-sm: 4px;\n --radius-lg: 12px;\n --radius-full: 9999px;\n --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08);\n --shadow-lg: rgba(0, 0, 0, 0.2) 0px 7px 29px 0px;\n --animation-duration: 0.2s;\n --animation-timing: ease-in-out;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n box-sizing: border-box;\n }\n :host([dark]),\n :host([data-gleap-dark]) {\n --color-bg: #1f2937;\n --color-font-title: #f9fafb;\n --color-font-text: #d1d5db;\n --color-font-light: #9ca3af;\n --color-primary: ').concat(d,";\n --color-primary-light: ").concat(d,'22;\n --color-primary-contrast: #ffffff;\n --color-border: #374151;\n --color-gray-light: #374151;\n --color-gray-lighter: #111827;\n --color-gray-dark: #9ca3af;\n --color-success: #34d399;\n --color-success-light: #1f2937;\n }\n *, *:before, *:after { box-sizing: inherit; }\n .checklists-content { color: var(--color-font-text); }\n .checklists-content--done { text-align: center; }\n .checklists-info { margin-bottom: 24px; text-align: center; }\n .checklists-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; color: var(--color-font-title); }\n .checklists-description { font-size: 0.9rem; margin-bottom: 16px; color: var(--color-font-text); line-height: 1.5; }\n .checklists-sender { display: flex; align-items: center; justify-content: center; gap: 8px; }\n .checklists-sender img { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; }\n .checklists-sender span { font-size: 0.875rem; color: var(--color-font-light); font-weight: 500; }\n .checklists-success-icon { margin-bottom: 16px; line-height: 0; }\n .checklists-success-icon--circle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-full); background-color: var(--color-success); color: var(--color-success-light); font-size: 22px; }\n .checklist-progress-labels { display: flex; justify-content: space-between; margin-bottom: 8px; }\n .checklist-progress-label { font-size: 0.75rem; color: var(--color-font-light); font-weight: 500; }\n .checklist-progress-bar { width: 100%; height: 6px; background-color: var(--color-gray-light); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 20px; }\n .checklist-progress-bar-progress { height: 100%; background-color: var(--color-primary); transition: width var(--animation-duration) var(--animation-timing); border-radius: var(--radius-full); }\n .checklist-tasks { display: flex; flex-direction: column; gap: 12px; }\n .checklist-task { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background-color: var(--color-bg); box-shadow: var(--shadow-sm); overflow: hidden; transition: background-color var(--animation-duration) var(--animation-timing), border-color var(--animation-duration) var(--animation-timing); }\n .checklist-task-header { display: flex; align-items: center; padding: 15px 20px; cursor: pointer; gap: 12px; position: relative; }\n .checklist-task-header:hover { background: var(--color-gray-lighter); }\n .checklist-task-header:hover .checklist-task-header--chevron {\n color: var(--color-font-title);\n }\n .checklist-task-header--badge { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-full); background-color: var(--color-primary-light); color: var(--color-primary); font-size: 0.875rem; font-weight: 600; flex-shrink: 0; transition: background-color var(--animation-duration) var(--animation-timing), color var(--animation-duration) var(--animation-timing); line-height: 1; }\n .checklist-task-header--badge svg { width: 16px; height: 16px; }\n .checklist-task-header--title { flex-grow: 1; font-size: 0.9rem; font-weight: 500; color: var(--color-font-title); transition: font-weight var(--animation-duration) var(--animation-timing), color var(--animation-duration) var(--animation-timing), text-decoration var(--animation-duration) var(--animation-timing); }\n .checklist-task-header--chevron { color: var(--color-font-light); transition: transform var(--animation-duration) var(--animation-timing); flex-shrink: 0; margin-left: auto; }\n .checklist-task-header--chevron svg { display: block; width: 18px; height: 18px; }\n .checklist-task-body {\n overflow: hidden;\n transition: max-height var(--animation-duration) var(--animation-timing), opacity var(--animation-duration) var(--animation-timing);\n max-height: 0;\n opacity: 0;\n }\n .checklist-task--active .checklist-task-body {\n max-height: var(--task-body-active-height, 200px);\n opacity: 1;\n }\n .checklist-task-body-inner { padding: 4px 16px 20px 60px; font-size: 0.875rem; color: var(--color-font-text); line-height: 1.5; }\n .checklist-task-body-content { margin-bottom: 16px; }\n .checklist-task-body-content p:first-child { margin-top: 0; }\n .checklist-task-body-content p:last-child { margin-bottom: 0; }\n .checklist-task-body-content iframe { width: 100%; height: 315px; object-fit: contain; border: none; }\n .checklist-task-body-action { margin-top: 16px; }\n .action-button { display: inline-flex; align-items: center; justify-content: center; background-color: var(--color-primary); color: var(--color-primary-contrast); padding: 10px 18px; font-size: 0.875rem; font-weight: 500; border-radius: var(--radius-lg); border: none; text-align: center; cursor: pointer; transition: background-color var(--animation-duration) var(--animation-timing), box-shadow var(--animation-duration) var(--animation-timing); box-shadow: var(--shadow-sm); }\n .action-button:hover { background-color: color-mix(in srgb, var(--color-primary) 90%, black); box-shadow: var(--shadow-md); }\n .action-button:focus { outline: 2px solid color-mix(in srgb, var(--color-primary) 50%, transparent); outline-offset: 2px; }\n .checklist-task-body-markdone { margin-top: 20px; border-top: 1px solid var(--color-border); padding: 16px 0 0px 0; display: flex; align-items: center; cursor: pointer; color: var(--color-primary); transition: color var(--animation-duration) var(--animation-timing); }\n .checklist-task-body-markdone:hover { color: color-mix(in srgb, var(--color-primary) 80%, black); }\n .checklist-task-body-markdone svg { width: 18px; height: 18px; margin-right: 6px; flex-shrink: 0; font-size: 18px; }\n .checklist-task-body-markdone-label { font-size: 0.875rem; font-weight: 500; line-height: 1; }\n .checklist-task--active .checklist-task-header--title { font-weight: 600; }\n .checklist-task--active .checklist-task-header--chevron { transform: rotate(180deg); }\n .checklist-task--active .checklist-task-header:hover { background: linear-gradient(180deg, var(--color-gray-lighter), transparent); }\n .checklist-task--done { background-color: var(--color-gray-lighter); border-color: var(--color-gray-light); box-shadow: none; }\n .checklist-task--done .checklist-task-header--badge { background-color: var(--color-success); color: var(--color-success-light); }\n .checklist-task--done .checklist-task-header--title { color: var(--color-font-light); }\n .checklist-task--done .checklist-task-body-inner { color: var(--color-font-light); }\n .checklist-task--done .checklist-task-header--title {\n text-decoration: line-through;\n }\n \n /* -------------------------\n Floating style addition\n Only applies if floating="true"\n ------------------------- */\n :host([floating="true"]) .checklists-content {\n position: relative;\n }\n :host([floating="true"]) .checklist-tasks {\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 1000;\n max-height: 90vh;\n display: none;\n padding: 0px;\n min-width: min(380px, 90vw);\n background-color: var(--color-bg);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-lg);\n overflow: hidden;\n }\n :host([floating="true"]) .checklist-task {\n border-radius: 0px;\n border: none;\n box-shadow: none;\n border-bottom: 1px solid var(--color-border);\n }\n :host([floating="true"]) .checklist-task:last-child {\n border-bottom: none;\n }\n :host([floating="true"]) .checklist-task--done {\n background-color: transparent;\n }\n :host([floating="true"]) .checklist-task-header:hover {\n background: linear-gradient(180deg, var(--color-gray-lighter), transparent);\n }\n \n /* -------------------------\n Floating Launcher Styles\n ------------------------- */\n .checklist-floating-launcher {\n padding: 12px;\n background-color: var(--color-bg);\n border: 1px solid var(--color-border);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-md);\n transition: transform 0.3s ease;\n cursor: pointer;\n }\n .checklist-floating-launcher--done {\n cursor: default !important;\n }\n .checklist-floating-header {\n padding: 20px;\n padding-bottom: 16px;\n border-bottom: 1px solid var(--color-border);\n cursor: pointer;\n }\n .checklist-floating-header:hover .floating-icon,\n .checklist-floating-launcher:hover .floating-icon {\n color: var(--color-font-title);\n }\n .floating-header {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n }\n .floating-title {\n font-size: 0.875rem;\n font-weight: 600;\n color: var(--color-font-title);\n max-width: calc(100% - 32px);\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n .floating-subtitle {\n font-size: 0.875rem;\n color: var(--color-font-text);\n margin-top: 8px;\n max-width: 100%;\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n .floating-circular-progress {\n width: 26px;\n height: 26px;\n margin-right: 6px;\n }\n .floating-circular-progress svg {\n width: 100%;\n height: 100%;\n transform: rotate(-90deg);\n }\n .floating-circular-progress .track {\n fill: none;\n stroke: var(--color-gray-light);\n stroke-width: 3;\n }\n .floating-circular-progress .progress {\n fill: none;\n stroke: var(--color-primary);\n stroke-width: 3;\n stroke-linecap: round;\n transition: stroke-dashoffset var(--animation-duration) var(--animation-timing);\n }\n .checklist-floating-launcher--done .floating-circular-progress .progress {\n stroke: var(--color-success);\n }\n .floating-icon {\n margin-left: auto;\n color: var(--color-font-light);\n }\n </style>\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 c=r+1;c<a.length;c++)if(!e.checklistData.completedSteps.includes(a[c].id)){s=c;break}e.setActiveStep(s)}setTimeout((function(){var t=!1;if(e.floatingEnabled){var n=e.shadowRoot.querySelector(".checklist-tasks");t=n&&"block"===n.style.display}if(e.renderChecklist(e.checklistData),e.floatingEnabled&&t){var r=e.shadowRoot.querySelector(".checklist-tasks");r&&(r.style.display="block")}}),300);var l={checkedStep:o.id};a.length>0&&e.checklistData.completedSteps.length>=a.length&&(e.checklistData.status="done",l.status="done"),e.updateChecklist(e.checklistData.id,l)}}}}));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!==oh){var o=e.checklistData.outbound.config.steps[r];if(o&&o.action&&"none"!==o.action)try{"BOT"===o.action?oh.startBot(o.botId):"CUSTOM_ACTION"===o.action?oh.triggerCustomAction(o.actionBody):"REDIRECT_URL"===o.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),oh.openURL(o.actionBody,!!o.actionOpenInNewTab)):"FEEDBACK_FLOW"===o.action?oh.startFeedbackFlow(o.formId):"NEWS_ARTICLE"===o.action?oh.openNewsArticle(o.articleId):"HELP_ARTICLE"===o.action?oh.openHelpCenterArticle(o.articleId):"CHECKLIST"===o.action?oh.startChecklist(o.outboundId,!0,null==o?void 0:o.sharedKey):"PRODUCT_TOUR"===o.action&&oh.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 c=s.offsetHeight,l=r.querySelector(".checklist-task-body");l&&l.style.setProperty("--task-body-active-height","".concat(c,"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&&Jn(n.prototype,r),o&&Jn(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Yn(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;o<n;o++)r[o]=arguments[o];return At(It(e=Ct(this,t,[].concat(r))),"_iframe",null),At(It(e),"_agentConvUrl",Pt),At(It(e),"_messageListener",null),At(It(e),"_config",{}),e}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lt(e,t)}(t,e),n=t,o=[{key:"observedAttributes",get:function(){return["agentId","conversationId","dark","placeholder","agentColor","emptyText","context"]}}],(r=[{key:"connectedCallback",value:function(){this._injectIframe(),this._listenForMessages()}},{key:"disconnectedCallback",value:function(){this._messageListener&&window.removeEventListener("message",this._messageListener),this._messageListener=null}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&this._iframe&&this._sendConfig()}},{key:"_injectIframe",value:function(){if(!this._iframe){this._agentConvUrl=Pt,this.style.display="block",this.style.width="100%",this.style.height="100%";var e=document.createElement("iframe");e.style.cssText="width: 100%; height: 100%; border: 0; background: transparent;",e.setAttribute("frameborder","0"),e.setAttribute("allow","autoplay; encrypted-media; microphone *;"),e.title="Gleap Agent Conversation",this.appendChild(e),this._iframe=e,K(e,this._agentConvUrl)}}},{key:"_listenForMessages",value:function(){var e=this;this._messageListener||(this._messageListener=function(t){var n,r=!1,o=!1;try{r=!(!e._iframe||t.source!==e._iframe.contentWindow);var i=new URL(e._agentConvUrl);o=t.origin===i.origin}catch(s){return}if(r||o){var a;try{a=JSON.parse(t.data)}catch(s){return}"AGENT_CONVERSATION"===(null===(n=a)||void 0===n?void 0:n.type)&&("agent-conv-loaded"===a.name&&e._sendConfig(),"agent-conv-conversation-created"===a.name&&e.dispatchEvent(new CustomEvent("gleap-agent-conversation-created",{bubbles:!0,composed:!0,detail:a.data})),"agent-conv-message-sent"===a.name&&e.dispatchEvent(new CustomEvent("gleap-agent-message-sent",{bubbles:!0,composed:!0,detail:a.data})),"agent-conv-reply-received"===a.name&&e.dispatchEvent(new CustomEvent("gleap-agent-reply-received",{bubbles:!0,composed:!0,detail:a.data})),"agent-conv-error"===a.name&&e.dispatchEvent(new CustomEvent("gleap-agent-error",{bubbles:!0,composed:!0,detail:a.data})))}},window.addEventListener("message",this._messageListener))}},{key:"_sendConfig",value:function(){var e,t=this;if(null!==(e=this._iframe)&&void 0!==e&&e.contentWindow){var n=wt[kt].apiUrl,r="",o="",i="";try{var a,s,c=vs.getInstance();n=c.apiUrl||n,r=c.sdkKey||"",o=(null===(a=c.session)||void 0===a?void 0:a.gleapId)||"",i=(null===(s=c.session)||void 0===s?void 0:s.gleapHash)||""}catch(u){}var l={agentId:this.getAttribute("agentId")||"",conversationId:this.getAttribute("conversationId")||null,dark:"true"===this.getAttribute("dark")||""===this.getAttribute("dark"),placeholder:this.getAttribute("placeholder")||"Type a message...",agentColor:this.getAttribute("agentColor")||null,emptyText:this.getAttribute("emptyText")||"How can I help you today?",context:function(){try{var e=t.getAttribute("context");return e?JSON.parse(e):null}catch(n){return null}}(),apiUrl:n,sdkKey:r,gleapId:o,gleapHash:i};this._config=l,this._iframe.contentWindow.postMessage(JSON.stringify({type:"agent-conversation",name:"agent-conv-data",data:l}),"*")}}},{key:"sendMessage",value:function(e){var t;null!==(t=this._iframe)&&void 0!==t&&t.contentWindow&&null!=e&&e.trim()&&this._iframe.contentWindow.postMessage(JSON.stringify({type:"agent-conversation",name:"agent-conv-send-message",data:{content:e}}),"*")}},{key:"clearConversation",value:function(){var e;null!==(e=this._iframe)&&void 0!==e&&e.contentWindow&&this._iframe.contentWindow.postMessage(JSON.stringify({type:"agent-conversation",name:"agent-conv-clear",data:{}}),"*")}}])&&St(n.prototype,r),o&&St(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Et(HTMLElement));customElements.define("gleap-agent-conversation",e)}}());var Qf=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Yf(this,"initialized",!1),Yf(this,"offlineMode",!1),Yf(this,"disablePageTracking",!1),Yf(this,"disableInAppNotifications",!1),Yf(this,"disableQueryParams",!1),Yf(this,"globalData",{screenRecordingData:null,webReplay:null,snapshotPosition:{x:0,y:0}}),"undefined"!=typeof window&&(cc.getInstance(),Jr.getInstance().start(),lr.getInstance().start(),st.getInstance().start())}var t,n,r;return t=e,n=[{key:"isLiveMode",value:function(){if(!0===this.offlineMode)return!1;var e=window.location.hostname;return!(["localhost","127.0.0.1","0.0.0.0","","::1"].includes(e)||e.startsWith("192.168.")||e.startsWith("10.0.")||e.endsWith(".local")||!e.includes("."))}},{key:"softReInitialize",value:function(){zs.getInstance().destroy(),br.getInstance().start().then((function(){j.getInstance().refresh(),bl.getInstance().injectNotificationUI()})).catch((function(e){console.warn("Failed to initialize Gleap.")}))}},{key:"performActions",value:function(t){for(var n=0;n<t.length;n++){var r=t[n];if(r&&r.actionType){var o,i,a;if(("notification"!==r.actionType||"widget"===(null==r||null===(o=r.data)||void 0===o||null===(o=o.checklist)||void 0===o?void 0:o.popupType))&&((null===(i=r.pageRules)||void 0===i?void 0:i.length)>0||r.pageFilter)&&window&&window.location&&!rs(window.location.href,r))continue;"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):"banner"===r.actionType?e.showBanner(r):"modal"===r.actionType?e.showModal(r):"tour"===r.actionType?e.startProductTourWithConfig(r.outbound,r.data,!1):e.showSurvey(r.actionType,r.format)}}}},{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=vf.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){cc.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){cc.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){cc.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){z=U(e)}(e)}},{key:"setTags",value:function(e){Hf.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){zs.getInstance().setUrlHandler(e)}},{key:"setOfflineMode",value:function(e){this.getInstance().offlineMode=e}},{key:"setDisableInAppNotifications",value:function(e){this.getInstance().disableInAppNotifications=e}},{key:"setDisablePageTracking",value:function(e){this.getInstance().disablePageTracking=e}},{key:"disableConsoleLogOverwrite",value:function(){Jr.getInstance().stop()}},{key:"setAiTools",value:function(e){Xt.getInstance().setAgentTools(e),Pn.getInstance().sendAgentToolsUpdate(),zs.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){hl.getInstance().setExternalRequests(ee(e))}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";Jr.getInstance().addLog(e,t)}},{key:"initialize",value:function(t){var n=this.getInstance();if(n.initialized)console.warn("Gleap already initialized.");else{n.initialized=!0;try{vf.getInstance().startIfNotRunning()}catch(o){}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=c(window.innerHeight)-c(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(o){}},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")),i()}catch(n){}}),100)}catch(o){}},n=function(){d=!1,i()},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(o){}},i=function(){try{u||(u=!0,window.requestAnimationFrame((function(){u=!1,e()}))),l&&clearTimeout(l),l=setTimeout(e,s)}catch(o){}};if(!("visualViewport"in window)||!window.visualViewport||!/iPad|iPhone|iPod/.test(navigator.userAgent))return;if(ce)return;ce=!0;var a=150,s=350,c=function(e){return Math.round(e)},l=null,u=!1,d=!1,p=null,f=window.visualViewport;f.addEventListener("resize",i),f.addEventListener("scroll",i),window.addEventListener("orientationchange",(function(){try{i()}catch(o){}})),e()}catch(o){}}()}catch(o){}var r=vs.getInstance();r.sdkKey=t,r.setOnSessionReady((function(){setTimeout((function(){br.getInstance().start().then((function(){Mf.getInstance().start(),se((function(){j.getInstance().injectFeedbackButton(),bl.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams(),Ft.notifyEvent("initialized")}))})).catch((function(e){console.warn("Failed to initialize Gleap.")}))}),0)})),r.startSession()}}},{key:"openURL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];zs.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=t.get("gleap_survey"),a=t.get("gleap_survey_format");i&&i.length>0&&e.showSurvey(i,"survey_full"===a?"survey_full":"survey");var s=t.get("gleap_tour");if(s&&s.length>0){var c=parseInt(t.get("gleap_tour_delay"));isNaN(c)&&(c=2),setTimeout((function(){e.startProductTour(s)}),1e3*c)}}catch(l){}}},{key:"destroy",value:function(){vf.getInstance().stop(),Mf.getInstance().stop(),zs.getInstance().destroy(),j.getInstance().destroy(),bl.getInstance().clearAllNotifications(!0),_f.getInstance().stop(),Pn.getInstance().destroy(),vs.getInstance().clearSession(0,!1),Wn.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){Wn.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){gc.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=Pn.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=Pn.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{Pn.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){Pn.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){Pn.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){vs.getInstance().useCookies=e}},{key:"disableLocalStorage",value:function(){vs.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return vs.getInstance().identifySession(e,ne(ee(t)),n)}},{key:"updateContact",value:function(e){return vs.getInstance().updateSession(ne(ee(e)))}},{key:"clearIdentity",value:function(){vs.getInstance().clearSession()}},{key:"getIdentity",value:function(){return vs.getInstance().getSession()}},{key:"isUserIdentified",value:function(){var e=vs.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return zs.getInstance().isOpened()}},{key:"hide",value:function(){zs.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){hl.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){hl.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){hl.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){hl.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){vf.getInstance().setOptions(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];zs.getInstance().hideWidget(e)}},{key:"open",value:function(){zs.getInstance().setAppMode("widget"),zs.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Mf.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Mf.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=ee(e);Cl.getInstance().formPreFill=t,zs.getInstance().sendMessage({name:"prefill-form-data",data:t},!0)}},{key:"on",value:function(e,t){Ft.on(e,t)}},{key:"enableShortcuts",value:function(e){e?xf.getInstance().start():xf.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){j.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){cc.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){cc.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){vs.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return vs.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){vs.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){vs.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){vs.getInstance().apiUrl=e}},{key:"setBannerUrl",value:function(e){Wn.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){gc.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){Rt(e)}},{key:"setFrameUrl",value:function(e){zs.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){ao.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){ao.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){ao.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){ao.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){ao.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){ao.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){ao.getInstance().clearCustomData()}},{key:"playSound",value:function(e){Dn.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=bl.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){Vf.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){e.getInstance().softReInitialize(),e.updateContact({lang:t})}),1e3)}},{key:"registerAgentToolAction",value:function(e){Xt.getInstance().registerAgentToolAction(e)}},{key:"registerAgentTool",value:function(e,t){Xt.getInstance().registerAgentTool(e,t)}},{key:"registerCustomAction",value:function(e){to.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){to.triggerCustomAction(e)}},{key:"setColorScheme",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};xn.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]:j.FEEDBACK_BUTTON_BOTTOM_LEFT,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:void 0,l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:void 0;se((function(){!function(e,t,n,r,o,i,a,s,c,l){var u=pe(e),d=pe(n),p=pe(o),f="#ffffff"===p,h=c||t,g=l||t,m=de(o,f?100:-120),v=de(o,f?30:-12),y=de(o,f?80:-30),b=f?o:"#fff",w=f?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),I=Math.max(2,Math.round(.55*r)),E=Math.max(2,Math.round(20*I/32)),T=57+a;s===j.FEEDBACK_BUTTON_CLASSIC_BOTTOM?T=a+15:(s&&s.includes("CLASSIC")||s===j.FEEDBACK_BUTTON_NONE)&&(T=a);var L='\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: relative;\n display: inline-block;\n float: left;\n max-width: 0px;\n width: 17px;\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 {\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(h,";\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(h,";\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 — 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(h,' 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 — 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 — 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 — 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→app 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 .gleap-frame-container--survey {\n bottom: ").concat(a,"px !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 Below 451px the widget is full screen anyway. The inner max-height must beat\n the inline 700px set by GleapFrameManager.setAppMode. */\n @media only screen and (min-width: 451px) {\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 .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: 100vw !important;\n max-width: 100vw !important;\n height: 100vh;\n height: 100dvh !important;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(6px);\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n max-height: 100vh;\n max-height: 100dvh !important;\n border-radius: 0 !important;\n animation-name: none !important;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner {\n max-width: 640px !important;\n width: calc(100% - 24px);\n border-radius: ").concat(x,"px;\n overflow: hidden;\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 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(T,"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(f?"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 — 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 — 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(I,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(E,"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 - 40px);\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 .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--disabled {\n display: none !important;\n }\n\n .bb-feedback-button--hidden {\n display: none !important;\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-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) .gleap-frame-container-inner {\n max-height: calc(var(--glvh, 1vh) * 100) !important;\n }\n\n .gleap-frame-container--survey {\n height: auto !important;\n top: initial !important;\n bottom: 0px !important;\n min-height: initial !important;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: 100vh !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(f?"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(f?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(f?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 }\n \n .gleap-tour-popover-navigation-btns button + button {\n margin-left: 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 .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 "),O=document.querySelector(".gleap-styles");O&&O.remove();var A=document.createElement("style");W(A),A.innerHTML=L,A.className="gleap-styles",document.body.appendChild(A)}(e,t,n,o,r,i,a,s,c,l)}))}},{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=vs.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new js("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";e.startFeedbackFlowWithOptions(t,{hideBackButton:!0,format:n},!0)}},{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],o=n.autostartDrawing,i=n.hideBackButton,a=n.format;if(vs.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var s="start-feedbackflow";r&&(s="start-survey"),zs.getInstance().setAppMode(r?a:"widget"),zs.getInstance().sendMessage({name:s,data:{flow:t,hideBackButton:i,format:a}},!0),o?zs.getInstance().showDrawingScreen("screenshot"):zs.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),zs.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];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),zs.getInstance().showWidget()}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),zs.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 bt(e)}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),zs.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&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"start-checklist",data:$f({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),zs.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),zs.getInstance().showWidget())}},{key:"getChecklistData",value:function(e,t){if(!e)return Promise.reject(new Error("outboundId is required"));var n=A.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];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];zs.getInstance().setAppMode("widget"),zs.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),zs.getInstance().showWidget()}},{key:"startProductTour",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;vs.getInstance().startProductTourConfig(e).then((function(r){var o;!t||null==r||!r.startURL||null!==(o=window)&&void 0!==o&&null!==(o=o.location)&&void 0!==o&&null!==(o=o.href)&&void 0!==o&&o.includes(null==r?void 0:r.baseURL)?n.startProductTourWithConfig(e,r,!0):window.location.href="".concat(r.startURL,"?gleap_tour=").concat(e,"&gleap_tour_delay=1")})).catch((function(e){}))}},{key:"checkForUncompletedTour",value:function(){var e=nu.getInstance().loadUncompletedTour();e&&nu.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];nu.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{Wn.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{gc.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){bl.getInstance().showNotification(e)}}],n&&Jf(t.prototype,n),r&&Jf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(Yf(Qf,"invoked",!0),Yf(Qf,"silentCrashReportSent",!1),Yf(Qf,"instance",void 0),"undefined"!=typeof window){var eh=window.GleapActions;if(eh&&eh.length>0)for(var th=0;th<eh.length;th++){var nh=eh[th];nh&&nh.e&&Qf[nh.e]&&Qf[nh.e].apply(Qf,nh.a)}}var rh=function(e){try{var t=e.split("/"),n=t[2];if("article"===n){var r=t[3];Qf.openHelpCenterArticle(r,!0)}if("collection"===n){var o=t[3];Qf.openHelpCenterCollection(o,!0)}if("flow"===n){var i=t[3];Qf.startFeedbackFlow(i,!0)}if("survey"===n){var a=t[3];Qf.showSurvey(a)}if("bot"===n){var s=t[3];Qf.startBot(s,!0)}if("news"===n){var c=t[3];Qf.openNewsArticle(c,!0)}if("checklist"===n){var l=t[3];Qf.startChecklist(l,!0,t[4])}if("tour"===n){var u=t[3];Qf.startProductTour(u)}}catch(d){console.error("Failed to handle Gleap link: ",e)}};const oh=Qf,ih=oh;return t=t.default})()));
2
2
  //# sourceMappingURL=index.js.map