gleap 19.1.1 → 19.2.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.
- package/build/browser/index.js +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.js +1 -1
- package/build/cjs/index.js.map +1 -1
- package/build/embed/survey-embed.js +1 -0
- package/build/esm/index.mjs +1 -1
- package/build/esm/index.mjs.map +1 -1
- package/index.d.ts +72 -1
- package/package.json +1 -1
package/build/cjs/index.js
CHANGED
|
@@ -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 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 R(r||[]);return a(i,"_invoke",{value:L(e,n,s)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var f="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};d(x,c,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(P([])));C&&C!==o&&i.call(C,c)&&(x=C);var E=k.prototype=b.prototype=Object.create(x);function I(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,a,s,c){var l=h(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=f;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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===f)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=h(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=h(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function 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 R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function P(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(E,"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(E),e},t.awrap=function(e){return{__await:e}},I(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()}))},I(E),d(E,u,"Generator"),d(E,c,(function(){return this})),d(E,"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=P,R.prototype={constructor:R,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:P(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:()=>ey});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,h,f,g,m,v,y,b,w,k,x,S;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.body){e.next=3;break}return null===(i=n.onError)||void 0===i||i.call(n,{message:"No response body."}),e.abrupt("return");case 3:a=t.body.getReader(),c=new TextDecoder,l="",u="",d="",e.prev=8;case 9:return e.next=12,a.read();case 12:if(h=e.sent,f=h.done,g=h.value,!f){e.next=17;break}return e.abrupt("break",24);case 17: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(E){}e.next=30;break;case 27:e.prev=27,e.t0=e.catch(8),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&(null===(S=n.onError)||void 0===S||S.call(n,{message:"Stream interrupted."}));case 30:case"end":return e.stop()}}),e,null,[[8,27]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,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 R(r||[]);return o(a,"_invoke",{value:L(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var f="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(P([])));C&&C!==n&&r.call(C,a)&&(x=C);var E=k.prototype=b.prototype=Object.create(x);function I(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=h(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=f;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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===f)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=h(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=h(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function 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 R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function P(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(E,"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(E),e},t.awrap=function(e){return{__await:e}},I(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()}))},I(E),u(E,c,"Generator"),u(E,a,(function(){return this})),u(E,"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=P,R.prototype={constructor:R,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:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){v(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 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=Tf.getInstance();return(null==e?void 0:e.apiUrl)||null}},{key:"_getHeaders",value:function(){var e,t,n=Tf.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=Tf.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,h;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.executeInFlight.get(t)){e.next=2;break}return e.abrupt("return");case 2:if(this.executeInFlight.set(t,!0),i=this._getApiUrl()){e.next=8;break}return this.executeInFlight.delete(t),null===(a=r.onError)||void 0===a||a.call(r,{message:"Gleap API URL not configured."}),e.abrupt("return");case 8:return s="".concat(i,"/v3/shared/agents/").concat(t,"/stream"),l=f(f({},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===(h=r.onError)||void 0===h||h.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,I(r.key),r)}}function E(e,t,n){return(t=I(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(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),E(this,"validationRequests",new Map),E(this,"validationCache",new Map),E(this,"fetchRequests",new Map),E(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=Tf.getInstance(),t=null==e?void 0:e.session,n=Hv.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=Tf.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=Tf.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}();E(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 R(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,D(r.key),r)}}function P(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"!=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 N=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),P(this,"feedbackButton",null),P(this,"injectedFeedbackButton",!1),P(this,"buttonHidden",null),P(this,"lastButtonIcon",null),P(this,"showingRedDot",!1),P(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(),Om.getInstance().updateContainerStyle()}},{key:"updateRedDot",value:function(e){var t=Zf.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=Zf.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&&!Zf.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=Xu.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(Nn.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=Xu.getInstance().getFlowConfig(),r="";r=n.buttonLogo?'<img class="bb-logo-logo" src="'.concat(n.buttonLogo,'" alt="Feedback Button" />'):he("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",Hv.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(he("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"),Zf.getInstance().isOpened()&&this.feedbackButton.classList.add("bb-feedback-button--open");var a=Zf.getInstance().appMode;"survey"!==a&&"survey_full"!==a&&"survey_web"!==a||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||Tf.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}])&&R(t.prototype,n),r&&R(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function j(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 _(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)}P(N,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),P(N,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),P(N,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),P(N,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),P(N,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),P(N,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),P(N,"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}(),q=null,z=function(){return q||H},W=function(e){var t=z();if(!t||!e)return e;try{e.setAttribute("nonce",t),e.nonce=t}catch(n){}return e},G="https://docs.gleap.ai/documentation/javascript/content-security-policy",V=new Set,$="gleap-frame-route-failed",X=function(e){return"string"==typeof e&&(0===e.indexOf("script-src")||0===e.indexOf("style-src"))},J=function(e,t){if(e&&t){var n,r=!1,o=function(){if(!r){r=!0;try{e.src=t}catch(n){}}};if(!function(){try{var e,t=null===(e=window.location)||void 0===e?void 0:e.protocol;return"http:"===t||"https:"===t}catch(n){return!1}}())return o();try{if(!e.contentDocument)return o()}catch(a){return o()}try{var i=new URL(t);n=i.origin+"/"}catch(a){return o()}fetch(t,{mode:"cors",credentials:"omit"}).then((function(e){if(!e.ok)throw new Error("Bootstrap fetch failed: "+e.status);return e.text()})).then((function(r){var i=r.replace(/(\s(?:href|src)\s*=\s*["'])\/([^"'/][^"']*)/g,"$1"+n+"$2"),s=z(),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 h,f,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($)+"));}}catch(e){}<\/script>";h=/<script\b/i.test(c)?c.replace(/<script\b/i,g+"<script"):/<\/head>/i.test(c)?c.replace(/<\/head>/i,g+"</head>"):c;try{f=e.contentDocument}catch(a){return o()}if(!f)return o();try{e.addEventListener($,o,{once:!0})}catch(a){}try{f.open(),function(e,t){var n=!1;try{e.addEventListener("securitypolicyviolation",(function(e){if(e&&"report"!==e.disposition){var r=e.blockedURI||"a resource",o=e.effectiveDirective||e.violatedDirective||"unknown directive",i=r+"|"+o;V.has(i)||(V.add(i),console.warn("Gleap: Your page's Content-Security-Policy blocked "+r+" ("+o+"). Gleap may not appear or work correctly until your policy allows it — see "+G)),t&&!n&&X(o)&&"string"==typeof r&&0===r.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(f,{baseHref:n,onBlocked:o}),f.write(h),f.close()}catch(a){o()}})).catch((function(e){V.has(t)||(V.add(t),console.warn("Gleap: Loading "+t+" failed ("+(e&&e.message?e.message:"network error")+") — 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()}))}},K=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?j(Object(n),!0).forEach((function(t){_(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"!==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"},he=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 fe(e){return fe="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},fe(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"!=fe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=fe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fe(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=function(e){var t=e.getBoundingClientRect();return{x:window.pageXOffset+t.left,y:window.pageYOffset+t.top,width:e.offsetWidth,height:e.offsetHeight}}(e);this.overlay.setBounds(t),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 Ee(e){return function(e){if(Array.isArray(e))return Ie(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 Ie(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 Ie(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 Ie(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 Re(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 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&&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 Pe(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 De(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 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:Se,ID:xe};return t.reduce((function(t,n){return t[n]=r[n](e),t}),{})}function Ne(e,t){try{var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}catch(r){return!1}}function je(e,t){return t.find(Ne.bind(null,e))}function _e(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=je(e,r);return Boolean(o)||Boolean(n)&&(o=je(e,r=r.map((function(e){return n+e}))),Boolean(o))?o:null}function Fe(e,t,n,r){var o,i=De(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=Re(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,h=i.NthChild;switch(c){case"ID":if(Boolean(l)&&Ne(e,l))return l;break;case"Tag":if(Boolean(u)&&Ne(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(o=_e(e,d,u)))return o;break;case"Attributes":if(Boolean(p)&&p.length&&(o=_e(e,p,u)))return o;break;case"NthChild":if(Boolean(h))return h}}}catch(f){s.e(f)}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=Re(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 h=[],f=0,g=l;f<g.length;f++){var m=g[f];h.unshift(m);var v=h.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("|")),qe=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}},ze=/\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"],$e=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&&ze.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(qe(r[c],e))return r[c];return n};function Xe(e){return Xe="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},Xe(e)}function Je(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 Ke(e,t,n){return t&&Je(e.prototype,t),n&&Je(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"!=Xe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Xe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Xe(t)?t:String(t)}var Qe=Ke((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=$e(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;var tt=Object.freeze(["https://app.gleap.ai","https://app.gleap.io"]),nt=function(e){return"string"==typeof e&&-1!==tt.indexOf(e)},rt=function(e){return nt(e)?e:"https://app.gleap.ai"};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 it(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 at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?it(Object(n),!0).forEach((function(t){ct(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return 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,lt(r.key),r)}}function ct(e,t,n){return(t=lt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lt(e){var t=function(e,t){if("object"!=ot(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ot(r))return r;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 ut=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),ct(this,"libraryInstance",null),ct(this,"lastUrl",void 0),ct(this,"injectedFrame",!1),ct(this,"gleapFrameContainer",null),ct(this,"gleapCollapseUI",null),ct(this,"injectedCollapseUI",!1),ct(this,"gleapFrame",null),ct(this,"configData",null),ct(this,"adminHelper",null),ct(this,"status","navigate"),ct(this,"initialized",!1),ct(this,"adminOrigin",null),ct(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))})),ct(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(he("arrowdown"),"\n </div>"),document.body.appendChild(e),t.gleapCollapseUI=e,e.addEventListener("click",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t.toggleCollapseUI()}))}})),ct(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="'.concat(rt(t.adminOrigin),"/").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,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,pv.getInstance().disable(),cr.getInstance().disable(),Eg.getInstance().disable(),Qv.close(),Qv.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(nt(n.origin))try{var r=JSON.parse(n.data);if("admin"===r.type&&("load"===r.name&&(t.adminOrigin||(t.adminOrigin=rt(n.origin)),t.configData=r.data,t.initAdminHelper()),"smartlink-search-result"===r.name&&e.sendMessageToTourBuilder({name:"smartlink-search-result",data:r.data}),"translate-complete"===r.name&&e.sendMessageToTourBuilder({name:"translate-complete",data:r.data})),"tourbuilder"===r.type){var o;if("loaddata"===r.name&&e.sendMessageToTourBuilder({name:"data",data:at(at({},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(at(at({},e),{},{type:"admin"})),this.adminOrigin||"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(at(at({},e),{},{type:"tourbuilder"})),rt(this.adminOrigin))}catch(t){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&st(t.prototype,n),r&&st(t,r),Object.defineProperty(t,"prototype",{writable:!1}),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 pt(){pt=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==dt(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(dt(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 ht(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 ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(n),!0).forEach((function(t){gt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gt(e,t,n){return(t=wt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mt(e){return function(e){if(Array.isArray(e))return vt(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 vt(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 vt(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 vt(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 yt(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 bt(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,wt(r.key),r)}}function wt(e){var t=function(e,t){if("object"!=dt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dt(t)?t:String(t)}ct(ut,"instance",void 0);var kt=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=pt().mark((function e(t){var n,r,o,i,a,s,c,l=this;return pt().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(mt(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),r="stream-".concat(Date.now()),this._messages=[].concat(mt(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]=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,r){var i=o.apply(e,t);function a(e){yt(i,n,r,a,s,"next",e)}function s(e){yt(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?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(),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&&bt(t.prototype,n),r&&bt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const xt=kt;var St={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"}},Ct="eu";function Et(e){return Et="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},Et(e)}function It(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 Tt(e,t,n){return t=Rt(t),function(e,t){if(t&&("object"===Et(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Lt(e)}(e,At()?Reflect.construct(t,n||[],Rt(e).constructor):t.apply(e,n))}function Lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ot(e){var t="function"==typeof Map?new Map:void 0;return Ot=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(At())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Mt(o,n.prototype),o}(e,arguments,Rt(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Mt(n,e)},Ot(e)}function At(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(At=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 Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rt(e)}function Pt(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"!=Et(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Et(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Et(t)?t:String(t)}var Nt="https://outboundmedia.gleap.io/agent-conversation",jt=function(e){Nt=e};function _t(e){return _t="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},_t(e)}function Ft(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,Ut(r.key),r)}}function Bt(e,t,n){return(t=Ut(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ut(e){var t=function(e,t){if("object"!=_t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_t(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),Bt(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=Qv.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)&&Ft(t.prototype,n),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 zt(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 Wt(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 Wt(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 Wt(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(){Gt=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==qt(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(qt(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 Vt(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 $t(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,Jt(r.key),r)}}function Xt(e,t,n){return(t=Jt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jt(e){var t=function(e,t){if("object"!=qt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=qt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qt(t)?t:String(t)}Bt(Ht,"instance",void 0);var Kt=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Xt(this,"agentTools",[]),Xt(this,"agentToolCallbacks",[]),Xt(this,"registeredAgentTools",{}),Xt(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=Gt().mark((function e(t){var n,r,o,i,a,s,c;return Gt().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 Ht.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){Vt(i,n,r,a,s,"next",e)}function s(e){Vt(i,n,r,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=zt(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&&$t(t.prototype,n),r&&$t(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Yt(e){return Yt="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},Yt(e)}function Zt(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 Qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(n),!0).forEach((function(t){tn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function en(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,nn(r.key),r)}}function tn(e,t,n){return(t=nn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nn(e){var t=function(e,t){if("object"!=Yt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Yt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Yt(t)?t:String(t)}function rn(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 on(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 on(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 on(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}Xt(Kt,"instance",void 0);var an="default",sn="auto",cn="light",ln="dark",un=[sn,cn,ln],dn=[["headerColor","darkHeaderColor"],["headerColor2","darkHeaderColor2"],["headerColor3","darkHeaderColor3"],["color","darkColor"],["backgroundColor","darkBackgroundColor"]],pn=[["logo","darkLogo"],["bgImage","darkBgImage"],["aurora","darkAurora"]],hn=["data-theme","data-bs-theme","data-color-scheme","data-color-mode","data-mode","data-mui-color-scheme"],fn=["dark","dark-mode","dark-theme","theme-dark"],gn=["light","light-mode","light-theme","theme-light"],mn=function(e){if("string"!=typeof e)return null;var t=e.trim().toLowerCase(),n=t.match(/^#([0-9a-f]{3})$/);if(n){var r=rn(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},vn=function(e){if("string"!=typeof e||!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e.trim()))return null;var t=mn(e);return"#"+[t.r,t.g,t.b].map((function(e){return e.toString(16).padStart(2,"0")})).join("")},yn="data-gleap-dark",bn=function(e){if("string"!=typeof e)return null;var t=e.toLowerCase();return-1!==t.indexOf("dark")?ln:-1!==t.indexOf("light")?cn:null},wn=function(e){if(!e)return null;for(var t=0;t<hn.length;t++){var n=bn(e.getAttribute(hn[t]));if(n)return n}var r=e.classList;if(r){if(fn.some((function(e){return r.contains(e)})))return ln;if(gn.some((function(e){return r.contains(e)})))return cn}return null},kn=function(e){try{return e&&window.getComputedStyle?window.getComputedStyle(e):null}catch(t){return null}},xn=function(e){var t,n=kn(e),r=mn(n?n.backgroundColor:null);return!r||r.a<.5?null:(299*(t=r).r+587*t.g+114*t.b)/1e3<128?ln:cn},Sn=function(){try{return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}catch(e){return null}},Cn=function(){if("undefined"==typeof document)return cn;var e,t,n,r,o=document.documentElement,i=document.body,a=wn(o)||wn(i)||(e=kn(o),t=e?(e.colorScheme||e.getPropertyValue("color-scheme")||"").toLowerCase():"",n=-1!==t.indexOf("dark"),r=-1!==t.indexOf("light"),n&&!r?ln:r&&!n?cn:null)||xn(i)||xn(o);if(a)return a;var s=Sn();return s&&s.matches?ln:cn},En=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),tn(this,"colorScheme",null),tn(this,"lightBackgroundColor",null),tn(this,"darkBackgroundColor",null),tn(this,"detectedScheme",null),tn(this,"mutationObserver",null),tn(this,"mediaQuery",null),tn(this,"settleTimeout",null),tn(this,"checkHostColorScheme",(function(){if(t.getColorScheme()===sn){var e=Cn();e!==t.detectedScheme&&(t.detectedScheme=e,t.notifyChange())}})),tn(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===cn||e===ln?e:sn}(e),this.lightBackgroundColor=vn(null==t?void 0:t.lightBackgroundColor),this.darkBackgroundColor=vn(null==t?void 0:t.darkBackgroundColor),this.updateWatching(),this.notifyChange()}},{key:"getDashboardConfig",value:function(){try{return Xu.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!==un.indexOf(e)?e:an);return n===an?an:this.colorScheme||n}},{key:"hasDarkPalette",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig();return!!this.darkBackgroundColor||!!e&&dn.some((function(t){var n=rn(t,2)[1];return null!==vn(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===sn?n=this.detectedScheme||Cn():t!==cn&&t!==ln||(n=t),n!==ln||this.hasDarkPalette(e)?n:null}},{key:"applyToFlowConfig",value:function(e){var t=this.getActiveColorScheme(e);if(!e||!t)return e;if(t===cn)return this.lightBackgroundColor?Qt(Qt({},e),{},{backgroundColor:this.lightBackgroundColor}):e;var n=Qt({},e);return dn.forEach((function(t){var r=rn(t,2),o=r[0],i=r[1],a=vn(e[i]);a&&(n[o]=a)})),this.darkBackgroundColor&&(n.backgroundColor=this.darkBackgroundColor),pn.forEach((function(t){var r=rn(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===ln?n?"dark-glow":"dark":n?"light-glow":"light"}},{key:"applyToChecklist",value:function(e){e&&(this.getActiveColorScheme()===ln?e.setAttribute(yn,""):e.removeAttribute(yn))}},{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()===sn?(this.mutationObserver||this.mediaQuery||(this.detectedScheme=Cn()),this.startWatching()):this.stopWatching()}},{key:"startWatching",value:function(){var e=this;if("undefined"!=typeof window&&"undefined"!=typeof document&&(this.mediaQuery||(this.mediaQuery=Sn(),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(hn)};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{Xu.getInstance().refreshColorScheme()}catch(e){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&en(t.prototype,n),r&&en(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function In(){In=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==On(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(On(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 Tn(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 Ln(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Tn(i,r,o,a,s,"next",e)}function s(e){Tn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function On(e){return On="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},On(e)}function An(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 Mn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?An(Object(n),!0).forEach((function(t){Pn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rn(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,Dn(r.key),r)}}function Pn(e,t,n){return(t=Dn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dn(e){var t=function(e,t){if("object"!=On(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=On(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==On(t)?t:String(t)}tn(En,"instance",void 0);var Nn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Pn(this,"chatbarContainer",null),Pn(this,"chatbarFrame",null),Pn(this,"config",null),Pn(this,"isHidden",!0),Pn(this,"manuallyHidden",!1),Pn(this,"manuallyShown",!1),Pn(this,"comReady",!1),Pn(this,"pendingMessages",[]),Pn(this,"chatbarStyle",null),Pn(this,"_panelOpen",!1),Pn(this,"agentId",null),Pn(this,"agentName",null),Pn(this,"agentContext",null),this._listenForMessages(),this._listenForOutsideClicks()}var t,n,r,o,i;return t=e,n=[{key:"chatbarUrl",get:function(){return"".concat(Zf.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 Zf.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{Zf.getInstance().urlHandler(o,i)}catch(a){}return}if("tool-execution"===r.name&&r.data)return Ht.notifyEvent("tool-execution",r.data),void Kt.getInstance().triggerToolAction(r.data);if("frontend-tool-execute"===r.name&&r.data)return void Kt.getInstance().executeToolAction(r.data).then((function(t){e._postMessageRaw({name:"frontend-tool-result",data:t})}));if("notify-event"===r.name&&r.data)return void Ht.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:Tf.getInstance().getSession(),apiUrl:Tf.getInstance().apiUrl,realtimeHost:Tf.getInstance().realtimeHost,sdkKey:Tf.getInstance().sdkKey}})}},{key:"_sendConfigUpdate",value:function(){this._postMessageRaw({name:"config-update",data:{config:this._withChatbarConfig(Xu.getInstance().getFlowConfig()),aiTools:Kt.getInstance().getAgentTools(),agentTools:Kt.getInstance().getAgentTools(),overrideLanguage:Hv.getInstance().getOverrideLanguage()}})}},{key:"_withChatbarConfig",value:function(e){var t,n,r,o,i,a=e||{};return Mn(Mn({},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:En.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;Mv.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=Tf.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(Xu.getInstance().getFlowConfig()),aiTools:Kt.getInstance().getAgentTools(),agentTools:Kt.getInstance().getAgentTools(),overrideLanguage:Hv.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===On(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=Xu.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=Ln(In().mark((function e(t){var n,r,o,i,a,s,c;return In().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=Tf.getInstance(),i=o.apiUrl||St[Ct].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=Ln(In().mark((function e(t,n){var r,o,i=this;return In().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;Zf.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=Xu.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,J(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&&Rn(t.prototype,n),r&&Rn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function jn(e){return jn="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},jn(e)}function _n(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,Bn(r.key),r)}}function Fn(e,t,n){return(t=Bn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bn(e){var t=function(e,t){if("object"!=jn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=jn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jn(t)?t:String(t)}Pn(Nn,"instance",void 0);var Un=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)&&_n(t.prototype,n),r&&_n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Fn(Un,"audio",void 0),Fn(Un,"settings",{play:!0});const Hn="JAVASCRIPT",qn="web";let zn=!0,Wn=!0;const Gn=()=>Wn,Vn=["start-conversation","start-custom-action","start-product-tour","open-url","show-form","show-survey","show-news-article","show-help-article","show-checklist"],$n=e=>{try{return-1!==Vn.indexOf(e)&&Zf.getInstance().isCaptureHidden()}catch(t){return!1}},Xn=()=>{try{return"19.1.1"}catch(e){return""}},Jn=()=>{try{const e=Xu.getInstance().getFlowConfig();if(e&&e.capture&&"object"==typeof e.capture)return e.capture}catch(e){}return{}},Kn=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}catch(e){return!1}},Yn=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia}catch(e){return!1}},Zn=()=>{try{const e=navigator,t=e.userAgentData;if(t&&Array.isArray(t.brands))return!t.mobile&&t.brands.some((e=>e&&/Chromium/i.test(e.brand)));const n=e.userAgent||"";return/\bChrome\/\d+/.test(n)&&!/Android|Mobile|CriOS|EdgiOS|FxiOS/i.test(n)}catch(e){return!1}},Qn=()=>Kn()&&"undefined"!=typeof window&&"function"==typeof window.MediaRecorder?"display":"rrweb",er=()=>{if(!zn)return!1;try{return"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof HTMLCanvasElement&&"undefined"!=typeof Element&&"function"==typeof Element.prototype.attachShadow}catch(e){return!1}},tr=()=>{const e={version:1,platform:qn,sdkType:Hn,sdkVersion:Xn(),screenshot:!1,recording:!1,annotate:!1};if(!er())return e;const t=Qn();return e.screenshot=!0,e.recording=!0,e.annotate=!0,e.recordingMethod=t,e.maxRecordingSec=180,e.microphone="display"===t&&!0===Jn().allowMicrophone&&Yn(),e};function nr(e){return nr="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},nr(e)}function rr(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 or(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(n),!0).forEach((function(t){ar(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ir(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,sr(r.key),r)}}function ar(e,t,n){return(t=sr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sr(e){var t=function(e,t){if("object"!=nr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=nr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==nr(t)?t:String(t)}var cr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ar(this,"bannerUrl","https://outboundmedia.gleap.io"),ar(this,"bannerContainer",null),ar(this,"bannerData",null),ar(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,h,f,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(),$n(v.name))return;if("start-conversation"===v.name&&Qv.startBot(null===(s=v.data)||void 0===s?void 0:s.botId),"start-custom-action"===v.name&&Qv.triggerCustomAction(null===(c=v.data)||void 0===c?void 0:c.action),"start-product-tour"===v.name&&Qv.startProductTour(null===(l=v.data)||void 0===l?void 0:l.tourId,!0),"open-url"===v.name){var y=v.data,b=!!v.newTab;Zf.getInstance().urlHandler(y,b)}"show-form"===v.name&&Qv.startFeedbackFlow(null===(u=v.data)||void 0===u?void 0:u.formId),"show-survey"===v.name&&Qv.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&&Qv.openNewsArticle(null===(h=v.data)||void 0===h?void 0:h.articleId),"show-help-article"===v.name&&Qv.openHelpCenterArticle(null===(f=v.data)||void 0===f?void 0:f.articleId),"show-checklist"===v.name&&Qv.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&&J(n,this.bannerUrl)}},{key:"sendMessage",value:function(e){try{var t=document.querySelector(".gleap-b-frame");t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(or(or({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){this.injectBannerUI(e)}}])&&ir(t.prototype,n),r&&ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();ar(cr,"instance",void 0);var lr,ur=Object.defineProperty,dr=(e,t,n)=>((e,t,n)=>t in e?ur(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),pr=(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))(pr||{}),hr=(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))(hr||{}),fr=(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))(fr||{}),gr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(gr||{}),mr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(mr||{}),vr=(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))(vr||{}),yr=(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))(yr||{});const br={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},wr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},kr={},xr={},Sr=()=>!!globalThis.Zone;function Cr(e){if(kr[e])return kr[e];const t=globalThis[e],n=t.prototype,r=e in br?br[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 wr?wr[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&&!Sr())return kr[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",""),xr[e]=()=>r.remove()):r.remove(),kr[e]=i}catch{return n}}const Er={};function Ir(e,t,n){var r;const o=`${e}.${String(n)}`;if(Er[o])return Er[o].call(t);const i=Cr(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(Er[o]=a,a.call(t)):t[n]}const Tr={};function Lr(e,t,n){const r=`${e}.${String(n)}`;if(Tr[r])return Tr[r].bind(t);const o=Cr(e)[n];return"function"!=typeof o?t[n]:(Tr[r]=o,o.bind(t))}function Or(){return[Cr("MutationObserver").constructor,xr.MutationObserver??(()=>{})]}let Ar=Date.now;function Mr(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())||(Ar=()=>(new Date).getTime());const Rr={ownerDocument:function(e){return Ir("Node",e,"ownerDocument")},childNodes:function(e){return Ir("Node",e,"childNodes")},parentNode:function(e){return Ir("Node",e,"parentNode")},parentElement:function(e){return Ir("Node",e,"parentElement")},textContent:function(e){return Ir("Node",e,"textContent")},contains:function(e,t){return Lr("Node",e,"contains")(t)},getRootNode:function(e){return Lr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ir("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ir("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ir("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ir("Element",e,"querySelectorAll")(t)},nowTimestamp:Ar,mutationObserverCtor:Or,patch:Mr};function Pr(e){return e.nodeType===e.ELEMENT_NODE}function Dr(e){const t=e&&"host"in e&&"mode"in e&&Rr.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Rr.shadowRoot(t)===e)}function Nr(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function jr(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=>_r(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 _r(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=jr(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?Xr(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?Xr(n,t):n}}class Fr{constructor(){dr(this,"idNodeMap",new Map),dr(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 Br({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let a=o||"";const s=r&&Ur(r);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function Ur(e){return e.toLowerCase()}const Hr="__rrweb_original__";function qr(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ur(t):null}function zr(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 Wr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Gr=/^(?:[a-z+]+:)?\/\//i,Vr=/^www\..*/i,$r=/^(data:)([^,]*),(.*)/i;function Xr(e,t){return(e||"").replace(Wr,((e,n,r,o,i,a)=>{const s=r||i||a,c=n||o||"";if(!s)return e;if(Gr.test(s)||Vr.test(s))return`url(${c}${s}${c})`;if($r.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 Jr(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Kr(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=Jr(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=Jr(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),h=-1;if(2===p.length)h=p[0].length;else if(p.length>2&&""===p[0]&&""!==r[s-1].textContent)h=t.indexOf(d,1);else if(1===p.length){if(d=d.substring(0,d.length-1),p=t.split(d),p.length<=1)return o.push(e),o;u=l+1}else u===c.length-1&&(h=t.indexOf(d));if(p.length>=2&&u>l){const e=r[s-1].textContent;if(e&&"string"==typeof e){const n=Jr(e).length;h=t.indexOf(d,n)}-1===h&&(h=p[0].length)}if(-1!==h){let s=Math.floor(h/a);for(;s>0&&s<e.length;){if(i+=1,i>50*r.length)return o.push(e),o;const c=Jr(e.substring(0,s),n);if(c.length===h){o.push(e.substring(0,s)),e=e.substring(s),t=t.substring(h);break}c.length<h?s+=Math.max(1,Math.floor((h-c.length)/a)):s-=Math.max(1,Math.floor((c.length-h)*a))}break}}}}return o.push(e),o}(e,t).join("/* rr_split */")}let Yr=1;const Zr=new RegExp("[^a-z0-9-_:]"),Qr=-2;function eo(){return Yr++}let to,no;const ro=/^[^ \t\n\r\u000c]+/,oo=/^[, \t\n\r\u000c]+/;const io=new WeakMap;function ao(e,t){return t&&""!==t.trim()?co(e,t):t}function so(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function co(e,t){let n=io.get(e);if(n||(n=e.createElement("a"),io.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function lo(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)?ao(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(oo),!(n>=t.length);){let i=r(ro);if(","===i.slice(-1))i=ao(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=ao(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?Xr(r,co(e)):"object"===t&&"data"===n?ao(e,r):r:r}function uo(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function po(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&po(Rr.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&po(Rr.parentNode(e),t,n)}function ho(e,t,n,r){let o;if(Pr(e)){if(o=e,!Rr.childNodes(o).length)return!1}else{if(null===Rr.parentElement(e))return!1;o=Rr.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(po(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 fo(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:h,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:yr.Document,childNodes:[],compatMode:e.compatMode}:{type:yr.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:yr.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:h}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,o),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=Ur(e.tagName);return Zr.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let w=0;w<v;w++){const t=e.attributes[w];uo(g,t.name,t.value)||(m[t.name]=lo(n,g,Ur(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=jr(t)),r&&(delete m.rel,delete m.href,m._cssText=r)}if("style"===g&&e.sheet){let t=jr(e.sheet);t&&(e.childNodes.length>1&&(t=Kr(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=Br({element:e,type:qr(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=Hr in o?o[Hr]: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){to||(to=n.createElement("canvas"),no=to.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{to.width=t.naturalWidth,to.height=t.naturalHeight,no.drawImage(t,0,0),m.rr_dataURL=to.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(f){const{width:t,height:n}=e.getBoundingClientRect();m={class:m.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==g||d(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);let y;try{customElements.get(g)&&(y=!0)}catch(b){}return{type:yr.Element,tagName:g,attributes:m,childNodes:[],isSVG:so(e)||void 0,needBlock:f,rootId:h,isCustom:y}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,a=Rr.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=Rr.textContent(e),l&&c&&(c=Xr(c,co(t.doc))));!l&&!u&&c&&n&&(c=r?r(c,Rr.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:yr.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:l,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:yr.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:yr.Comment,textContent:Rr.textContent(e)||"",rootId:v};default:return!1}}function go(e){return null==e?"":e.toLowerCase()}function mo(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 vo(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:h,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:S=!1,cssCaptured:C=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:I=!0}=t;if(!E){E=ho(e,a,s,void 0===E)}const T=fo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:f,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===yr.Comment)return!0;if(e.type===yr.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"===zr(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(go(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===go(e.attributes.name)||"icon"===go(e.attributes.rel)||"apple-touch-icon"===go(e.attributes.rel)||"shortcut icon"===go(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&go(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(go(e.attributes.property).match(/^(og|twitter|fb):/)||go(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===go(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===go(e.attributes.name)||"googlebot"===go(e.attributes.name)||"bingbot"===go(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===go(e.attributes.name)||"generator"===go(e.attributes.name)||"framework"===go(e.attributes.name)||"publisher"===go(e.attributes.name)||"progid"===go(e.attributes.name)||go(e.attributes.property).match(/^article:/)||go(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===go(e.attributes.name)||"yandex-verification"===go(e.attributes.name)||"csrf-token"===go(e.attributes.name)||"p:domain_verify"===go(e.attributes.name)||"verify-v1"===go(e.attributes.name)||"verification"===go(e.attributes.name)||"shopify-checkout-api-token"===go(e.attributes.name)))return!0}}return!1}(T,h)||!I&&T.type===yr.Text&&!T.textContent.replace(/^\s+|\s+$/gm,"").length?Qr:eo();const O=Object.assign(T,{id:L});if(r.add(e,O),L===Qr)return null;v&&v(e);let A=!c;if(O.type===yr.Element){A=A&&!O.needBlock,delete O.needBlock;const t=Rr.shadowRoot(e);t&&Nr(t)&&(O.isShadowHost=!0)}if((O.type===yr.Document||O.type===yr.Element)&&A){h.headWhitespace&&O.type===yr.Element&&"head"===O.tagName&&(I=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(O.type===yr.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else{O.type===yr.Element&&void 0!==O.attributes._cssText&&"string"==typeof O.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Rr.childNodes(e))){const e=vo(n,t);e&&O.childNodes.push(e)}}let S=null;if(Pr(e)&&(S=Rr.shadowRoot(e)))for(const e of Array.from(Rr.childNodes(S))){const n=vo(e,t);n&&(Nr(S)&&(n.isShadow=!0),O.childNodes.push(n))}}const M=Rr.parentNode(e);return M&&Dr(M)&&Nr(M)&&(O.isShadow=!0),O.type===yr.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=vo(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===yr.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===zr(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=vo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),O}class yo{constructor(...e){dr(this,"parentElement",null),dr(this,"parentNode",null),dr(this,"ownerDocument"),dr(this,"firstChild",null),dr(this,"lastChild",null),dr(this,"previousSibling",null),dr(this,"nextSibling",null),dr(this,"ELEMENT_NODE",1),dr(this,"TEXT_NODE",3),dr(this,"nodeType"),dr(this,"nodeName"),dr(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 yo))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 bo(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const wo="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 ko={map:{},getId:()=>(console.error(wo),-1),getNode:()=>(console.error(wo),null),removeNodeFromMap(){console.error(wo)},has:()=>(console.error(wo),!1),reset(){console.error(wo)}};function xo(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 So(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)}}),()=>So(e,t,i||{},!0)}function Co(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=Rr.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=Rr.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function Eo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Io(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function To(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Rr.parentElement(e)}function Lo(e,t,n,r){if(!e)return!1;const o=To(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(po(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 Oo(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===Qr}function Ao(e,t){if(Dr(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=Rr.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Ao(r,t))}function Mo(e){return Boolean(e.changedTouches)}function Ro(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Po(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Do(e){return!!e&&(e instanceof yo&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Rr.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ko=new Proxy(ko,{get:(e,t,n)=>("map"===t&&console.error(wo),Reflect.get(e,t,n))}));class No{constructor(){dr(this,"id",1),dr(this,"styleIDMap",new WeakMap),dr(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 jo(e){var t;let n=null;return"getRootNode"in e&&(null==(t=Rr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Rr.host(Rr.getRootNode(e))&&(n=Rr.host(Rr.getRootNode(e))),n}function _o(e){const t=Rr.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=jo(n);)n=t;return n}(e);return Rr.contains(t,n)}function Fo(e){const t=Rr.ownerDocument(e);return!!t&&(Rr.contains(t,e)||_o(e))}function Bo(e){return"__ln"in e}class Uo{constructor(){dr(this,"length",0),dr(this,"head",null),dr(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&&Bo(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&&Bo(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 Ho=(e,t)=>`${e}@${t}`;class qo{constructor(){dr(this,"frozen",!1),dr(this,"locked",!1),dr(this,"texts",[]),dr(this,"attributes",[]),dr(this,"attributeMap",new WeakMap),dr(this,"removes",[]),dr(this,"mapRemoves",[]),dr(this,"movedMap",{}),dr(this,"addedSet",new Set),dr(this,"movedSet",new Set),dr(this,"droppedSet",new Set),dr(this,"removesSubTreeCache",new Set),dr(this,"mutationCb"),dr(this,"blockClass"),dr(this,"blockSelector"),dr(this,"maskTextClass"),dr(this,"maskTextSelector"),dr(this,"inlineStylesheet"),dr(this,"maskInputOptions"),dr(this,"maskTextFn"),dr(this,"maskInputFn"),dr(this,"keepIframeSrcFn"),dr(this,"recordCanvas"),dr(this,"inlineImages"),dr(this,"slimDOMOptions"),dr(this,"dataURLOptions"),dr(this,"doc"),dr(this,"mirror"),dr(this,"iframeManager"),dr(this,"stylesheetManager"),dr(this,"shadowDomManager"),dr(this,"canvasManager"),dr(this,"processedNodeManager"),dr(this,"unattachedDoc"),dr(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),dr(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Uo,r=e=>{let t=e,n=Qr;for(;n===Qr;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=Rr.parentNode(o);if(!i||!Fo(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=Dr(i)?this.mirror.getId(jo(o)):this.mirror.getId(i),c=r(o);if(-1===s||-1===c)return n.addNode(o);const l=vo(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=>{Ro(e,this.mirror)&&this.iframeManager.addIframe(e),Po(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Do(o)&&this.shadowDomManager.addShadowRoot(Rr.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)Wo(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(Rr.parentNode(s))||o(s);for(const s of this.addedSet)Go(this.droppedSet,s)||Wo(this.removesSubTreeCache,s,this.mirror)?Go(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(Rr.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(Rr.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=Rr.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Rr.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=Rr.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))})),dr(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(Rr.childNodes(e),(e=>Rr.textContent(e)||"")).join("");t.attributes.value=Br({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:qr(e),value:n,maskInputFn:this.maskInputFn})})),dr(this,"processMutation",(e=>{if(!Oo(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Rr.textContent(e.target);Lo(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ho(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,To(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=qr(n);o=Br({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(Lo(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"),!uo(n.tagName,r))if(i.attributes[r]=lo(this.doc,Ur(n.tagName),Ur(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(Lo(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=Dr(e.target)?this.mirror.getId(Rr.host(e.target)):this.mirror.getId(e.target);Lo(e.target,this.blockClass,this.blockSelector,!1)||Oo(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(zo(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Ao(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ho(n,r)]?zo(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!Dr(e.target)||!Nr(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Rr.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),dr(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Oo(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[Ho(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Lo(e,this.blockClass,this.blockSelector,!1)||(Rr.childNodes(e).forEach((e=>this.genAdds(e))),Do(e)&&Rr.childNodes(Rr.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 zo(e,t){e.delete(t),Rr.childNodes(t).forEach((t=>zo(e,t)))}function Wo(e,t,n){return 0!==e.size&&function(e,t,n){const r=Rr.parentNode(t);return!!r&&e.has(r)}(e,t)}function Go(e,t){return 0!==e.size&&Vo(e,t)}function Vo(e,t){const n=Rr.parentNode(t);return!!n&&(!!e.has(n)||Vo(e,n))}let $o;const Xo=e=>{if(!$o)return e;return(...t)=>{try{return e(...t)}catch(n){if($o&&!0===$o(n))return;throw n}}},Jo=[];function Ko(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 Yo(e,t){const n=new qo;Jo.push(n),n.init(e);const[r,o]=Or(),i=new r(Xo(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Zo({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(fr).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=Ur(i);const l=(t=>i=>{const a=Ko(i);if(Lo(a,r,o,!0))return;let s=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=gr.Mouse;break;case"touch":s=gr.Touch;break;case"pen":s=gr.Pen}s===gr.Touch?fr[t]===fr.MouseDown?l="TouchStart":fr[t]===fr.MouseUp&&(l="TouchEnd"):gr.Pen}else Mo(i)&&(s=gr.Touch);null!==s?(c=s,(l.startsWith("Touch")&&s===gr.Touch||l.startsWith("Mouse")&&s===gr.Mouse)&&(s=null)):fr[t]===fr.Click&&(s=c,c=null);const u=Mo(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:h}=u;Xo(e)({type:fr[l],id:d,x:p,y:h,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(fr[i]){case fr.MouseDown:case fr.MouseUp:a=a.replace("mouse","pointer");break;case fr.TouchStart:case fr.TouchEnd:return}s.push(bo(a,l,t))})),Xo((()=>{s.forEach((e=>e()))}))}function Qo({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return bo("scroll",Xo(xo(Xo((i=>{const a=Ko(i);if(!a||Lo(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=Co(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 ei=["INPUT","TEXTAREA","SELECT"],ti=new WeakMap;function ni(e){return function e(t,n){if(ai("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ai("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ai("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ai("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 ri(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function oi({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(Rr.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}}),Xo((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function ii(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:h,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),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),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Yo(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=xo(Xo((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),l=Xo(xo(Xo((e=>{const t=Ko(e),{clientX:n,clientY:o}=Mo(e)?e.changedTouches[0]:e;a||(a=Ar()),s.push({x:n,y:o,id:r.getId(t),timeOffset:Ar()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?hr.Drag:e instanceof MouseEvent?hr.MouseMove:hr.TouchMove)})),o,{trailing:!1})),u=[bo("mousemove",l,n),bo("touchmove",l,n),bo("drag",l,n)];return Xo((()=>{u.forEach((e=>e()))}))}(e),a=Zo(e),s=Qo(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return bo("resize",Xo(xo(Xo((()=>{const t=Eo(),o=Io();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=Ko(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=Rr.parentElement(n)),!n||!d||ei.indexOf(d)<0||Lo(n,r,o,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let h=n.value,f=!1;const g=qr(n)||"";"radio"===g||"checkbox"===g?f=n.checked:(s[d.toLowerCase()]||s[g])&&(h=Br({element:n,maskInputOptions:s,tagName:d,type:g,value:h,maskInputFn:c})),p(n,u?{text:h,isChecked:f,userTriggered:l}:{text:h,isChecked:f});const m=n.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function p(t,r){const o=ti.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){ti.set(t,r);const o=n.getId(t);Xo(e)({...r,id:o})}}const h=("last"===l.input?["change"]:["input","change"]).map((e=>bo(e,Xo(d),t))),f=t.defaultView;if(!f)return()=>{h.forEach((e=>e()))};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push(...m.map((e=>So(e[0],e[1],{set(){Xo(d)({target:this,isTrusted:!1})}},!1,f)))),Xo((()=>{h.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const a=Xo((i=>xo(Xo((o=>{const a=Ko(o);if(!a||Lo(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=[bo("play",a(vr.Play),i),bo("pause",a(vr.Pause),i),bo("seeked",a(vr.Seeked),i),bo("volumechange",a(vr.VolumeChange),i),bo("ratechange",a(vr.RateChange),i)];return Xo((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Xo(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=ri(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:Xo(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ri(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:Xo(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ri(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:Xo(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ri(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replaceSync:a}),r.apply(o,i)}))}));const c={};si("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(si("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),si("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),si("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:Xo(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=ri(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:[...ni(o),s||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Xo(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=ri(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:[...ni(o),a]}]}),r.apply(o,i)}))})})),Xo((()=>{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=oi(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Xo(((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:h}=ri(null==(c=a.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:l,value:u,priority:d},index:ni(a.parentRule)}),o.apply(a,s)}))});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Xo(((o,i,s)=>{var c;const[l]=s;if(n.has(l))return a.apply(i,[l]);const{id:u,styleId:d}=ri(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:ni(i.parentRule)}),o.apply(i,s)}))}),Xo((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(f=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=Mr(t.fonts,"add",(function(t){return function(n){return setTimeout(Xo((()=>{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),Xo((()=>{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=Xo((()=>{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;Lo(a,r,o,!0)||Lo(l,r,o,!0)||s.push({start:n.getId(a),startOffset:c,end:n.getId(l),endOffset:u})}i({ranges:s})}));return s(),bo("selectionchange",s)}(e),m=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Mr(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 Xo((()=>{Jo.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),p(),h(),f(),g(),m(),v.forEach((e=>e()))}))}function ai(e){return void 0!==window[e]}function si(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ci{constructor(e){dr(this,"iframeIdToRemoteIdMap",new WeakMap),dr(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 li{constructor(e){dr(this,"iframes",new WeakMap),dr(this,"crossOriginIframeMap",new WeakMap),dr(this,"crossOriginIframeMirror",new ci(eo)),dr(this,"crossOriginIframeStyleMirror"),dr(this,"crossOriginIframeRootIdMap",new WeakMap),dr(this,"mirror"),dr(this,"mutationCb"),dr(this,"wrappedEmit"),dr(this,"loadListener"),dr(this,"stylesheetManager"),dr(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ci(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 pr.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:pr.IncrementalSnapshot,data:{source:hr.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case pr.Meta:case pr.Load:case pr.DomContentLoaded:return!1;case pr.Plugin:return t;case pr.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case pr.IncrementalSnapshot:switch(t.data.source){case hr.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 hr.Drag:case hr.TouchMove:case hr.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case hr.ViewportResize:return!1;case hr.MediaInteraction:case hr.MouseInteraction:case hr.Scroll:case hr.CanvasMutation:case hr.Input:return this.replaceIds(t.data,e,["id"]),t;case hr.StyleSheetRule:case hr.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case hr.Font:return t;case hr.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case hr.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===yr.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class ui{constructor(e){dr(this,"shadowDoms",new WeakSet),dr(this,"mutationCb"),dr(this,"scrollCb"),dr(this,"bypassOptions"),dr(this,"mirror"),dr(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(!Nr(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Yo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(Qo({...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(Rr.host(e))),this.restoreHandlers.push(oi({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(Mr(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r),i=Rr.shadowRoot(this);return i&&Fo(this)&&n.addShadowRoot(i,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var di="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),hi=0;hi<64;hi++)pi[di.charCodeAt(hi)]=hi;const fi=new Map;const gi=(e,t,n)=>{if(!e||!yi(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=fi.get(e);return n||(n=new Map,fi.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 mi(e,t,n){if(e instanceof Array)return e.map((e=>mi(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+=di[n[t]>>2],o+=di[(3&n[t])<<4|n[t+1]>>4],o+=di[(15&n[t+1])<<2|n[t+2]>>6],o+=di[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:[mi(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:[mi(e.data,t,n),e.width,e.height]}}if(yi(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:gi(e,t,n)}}return e}const vi=(e,t,n)=>e.map((e=>mi(e,t,n))),yi=(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 bi(e,t,n,r){const o=[];try{const i=Mr(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!Lo(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 wi(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=Mr(e,c,(function(e){return function(...a){const s=e.apply(this,a);if(gi(s,i,this),"tagName"in this.canvas&&!Lo(this.canvas,r,o,!0)){const e=vi(a,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}}));a.push(s)}catch{const r=So(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});a.push(r)}return a}const ki='(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',xi="undefined"!=typeof self&&self.Blob&&new Blob([ki],{type:"text/javascript;charset=utf-8"});function Si(e){let t;try{if(t=xi&&(self.URL||self.webkitURL).createObjectURL(xi),!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(ki),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Ci{constructor(e){dr(this,"pendingCanvasMutations",new Map),dr(this,"rafStamps",{latestId:0,invokeId:null}),dr(this,"mirror"),dr(this,"mutationCb"),dr(this,"resetObservers"),dr(this,"frozen",!1),dr(this,"locked",!1),dr(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=bi(t,n,r,!0),a=new Map,s=new Si;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:mr["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=>{Lo(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=bi(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=Mr(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return Lo(this.canvas,n,r,!0)||setTimeout((()=>{const n=vi(i,t,this);e(this.canvas,{type:mr["2D"],property:a,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch{const n=So(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:mr["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(...wi(t.WebGLRenderingContext.prototype,mr.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...wi(t.WebGL2RenderingContext.prototype,mr.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 Ei{constructor(e){dr(this,"trackedLinkElements",new WeakSet),dr(this,"mutationCb"),dr(this,"adoptedStyleSheetCb"),dr(this,"styleMirror",new No),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:_r(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 Ii{constructor(){dr(this,"nodeMap",new WeakMap),dr(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 Ti,Li,Oi,Ai=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(lr=e.contentWindow)?void 0:lr.Array.from)||Array.from,document.body.removeChild(e)}}catch(ty){console.debug("Unable to override Array.from",ty)}const Mi=new Fr;function Ri(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:h,maskInputFn:f,maskTextFn:g,hooks:m,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:k=!0,recordCanvas:x=!1,recordCrossOriginIframes:S=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:I=!1,inlineImages:T=!1,plugins:L,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:M}=e;$o=M;const R=!S||window.parent===window;let P=!1;if(!R)try{window.parent.document&&(P=!1)}catch(V){P=!0}if(R&&!t)throw new Error("emit function is required");if(!R&&!P)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Mi.reset();const D=!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=mo(h);let j;!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 _=0;const F=e=>{for(const t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!P&&(e=v(e)),e};Ti=(e,o)=>{var i;const a=e;if(a.timestamp=Ar(),!(null==(i=Jo[0])?void 0:i.isFrozen())||a.type===pr.FullSnapshot||a.type===pr.IncrementalSnapshot&&a.data.source===hr.Mutation||Jo.forEach((e=>e.unfreeze())),R)null==t||t(F(a),o);else if(P){const e={type:"rrweb",event:F(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(a.type===pr.FullSnapshot)j=a,_=0;else if(a.type===pr.IncrementalSnapshot){if(a.data.source===hr.Mutation&&a.data.isAttachIframe)return;_++;const e=r&&_>=r,t=n&&a.timestamp-j.timestamp>n;(e||t)&&Li(!0)}};const B=e=>{Ti({type:pr.IncrementalSnapshot,data:{source:hr.Mutation,...e}})},U=e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.Scroll,...e}}),H=e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.CanvasMutation,...e}}),q=new Ei({mutationCb:B,adoptedStyleSheetCb:e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.AdoptedStyleSheet,...e}})}),z=new li({mirror:Mi,mutationCb:B,stylesheetManager:q,recordCrossOriginIframes:S,wrappedEmit:Ti});for(const X of L||[])X.getMirror&&X.getMirror({nodeMirror:Mi,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});const W=new Ii;Oi=new Ci({recordCanvas:x,mutationCb:H,win:window,blockClass:o,blockSelector:i,mirror:Mi,sampling:y.canvas,dataURLOptions:b});const G=new ui({mutationCb:B,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:x,inlineImages:T,sampling:y,slimDOMOptions:N,iframeManager:z,stylesheetManager:q,canvasManager:Oi,keepIframeSrcFn:O,processedNodeManager:W},mirror:Mi});Li=(e=!1)=>{if(!k)return;Ti({type:pr.Meta,data:{href:window.location.href,width:Io(),height:Eo()}},e),q.reset(),G.init(),Jo.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new Fr,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:h=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return vo(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:mo(h),dataURLOptions:f,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:Mi,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:D,maskTextFn:g,maskInputFn:f,slimDOM:N,dataURLOptions:b,recordCanvas:x,inlineImages:T,onSerialize:e=>{Ro(e,Mi)&&z.addIframe(e),Po(e,Mi)&&q.trackLinkElement(e),Do(e)&&G.addShadowRoot(Rr.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");Ti({type:pr.FullSnapshot,data:{node:t,initialOffset:Co(window)}},e),Jo.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,Mi.getId(document))};try{const e=[],t=e=>{var t;return Xo(ii)({mutationCb:B,mousemoveCb:(e,t)=>Ti({type:pr.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.ViewportResize,...e}}),inputCb:e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.Input,...e}}),mediaInteractionCb:e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.MediaInteraction,...e}}),styleSheetRuleCb:e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.StyleSheetRule,...e}}),styleDeclarationCb:e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.StyleDeclaration,...e}}),canvasMutationCb:H,fontCb:e=>Ti({type:pr.IncrementalSnapshot,data:{source:hr.Font,...e}}),selectionCb:e=>{Ti({type:pr.IncrementalSnapshot,data:{source:hr.Selection,...e}})},customElementCb:e=>{Ti({type:pr.IncrementalSnapshot,data:{source:hr.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:D,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:T,userTriggeredOnInput:E,collectFonts:I,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:N,dataURLOptions:b,mirror:Mi,iframeManager:z,stylesheetManager:q,shadowDomManager:G,processedNodeManager:W,canvasManager:Oi,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=>Ti({type:pr.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};z.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{Li(),e.push(t(document)),Ai=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(bo("DOMContentLoaded",(()=>{Ti({type:pr.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(bo("load",(()=>{Ti({type:pr.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),Ai=!1,$o=void 0}}catch($){console.warn($)}}Ri.addCustomEvent=(e,t)=>{if(!Ai)throw new Error("please add custom event after start recording");Ti({type:pr.Custom,data:{tag:e,payload:t}})},Ri.freezePage=()=>{Jo.forEach((e=>e.freeze()))},Ri.takeFullSnapshot=e=>{if(!Ai)throw new Error("please take full snapshot after start recording");Li(e)},Ri.mirror=Mi;var Pi=Uint8Array,Di=Uint16Array,Ni=Uint32Array,ji=new Pi([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]),_i=new Pi([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]),Fi=new Pi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bi=function(e,t){for(var n=new Di(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new Ni(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]},Ui=Bi(ji,2),Hi=Ui[0],qi=Ui[1];Hi[28]=258,qi[258]=28;for(var zi=Bi(_i,0),Wi=(zi[0],zi[1]),Gi=new Di(32768),Vi=0;Vi<32768;++Vi){var $i=(43690&Vi)>>>1|(21845&Vi)<<1;$i=(61680&($i=(52428&$i)>>>2|(13107&$i)<<2))>>>4|(3855&$i)<<4,Gi[Vi]=((65280&$i)>>>8|(255&$i)<<8)>>>1}var Xi=function(e,t,n){for(var r=e.length,o=0,i=new Di(t);o<r;++o)++i[e[o]-1];var a,s=new Di(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new Di(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[Gi[d]>>>c]=l}else for(a=new Di(r),o=0;o<r;++o)a[o]=Gi[s[e[o]-1]++]>>>15-e[o];return a},Ji=new Pi(288);for(Vi=0;Vi<144;++Vi)Ji[Vi]=8;for(Vi=144;Vi<256;++Vi)Ji[Vi]=9;for(Vi=256;Vi<280;++Vi)Ji[Vi]=7;for(Vi=280;Vi<288;++Vi)Ji[Vi]=8;var Ki=new Pi(32);for(Vi=0;Vi<32;++Vi)Ki[Vi]=5;var Yi=Xi(Ji,9,0),Zi=Xi(Ki,5,0),Qi=function(e){return(e/8>>0)+(7&e&&1)},ea=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Di?Di:e instanceof Ni?Ni:Pi)(n-t);return r.set(e.subarray(t,n)),r},ta=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},na=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},ra=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 Pi(0),0];if(1==o){var a=new Pi(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 h=new Di(p+1),f=oa(n[u-1],h,0);if(f>t){r=0;var g=0,m=f-t,v=1<<m;for(i.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));r<o;++r){var y=i[r].s;if(!(h[y]>t))break;g+=v-(1<<f-h[y]),h[y]=t}for(g>>>=m;g>0;){var b=i[r].s;h[b]<t?g-=1<<t-h[b]++-1:++r}for(;r>=0&&g;--r){var w=i[r].s;h[w]==t&&(--h[w],++g)}f=t}return[new Pi(h),f]},oa=function(e,t,n){return-1==e.s?Math.max(oa(e.l,t,n+1),oa(e.r,t,n+1)):t[e.s]=n},ia=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Di(++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]},aa=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},sa=function(e,t,n){var r=n.length,o=Qi(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)},ca=function(e,t,n,r,o,i,a,s,c,l,u){ta(t,u++,n),++o[256];for(var d=ra(o,15),p=d[0],h=d[1],f=ra(i,15),g=f[0],m=f[1],v=ia(p),y=v[0],b=v[1],w=ia(g),k=w[0],x=w[1],S=new Di(19),C=0;C<y.length;++C)S[31&y[C]]++;for(C=0;C<k.length;++C)S[31&k[C]]++;for(var E=ra(S,7),I=E[0],T=E[1],L=19;L>4&&!I[Fi[L-1]];--L);var O,A,M,R,P=l+5<<3,D=aa(o,Ji)+aa(i,Ki)+a,N=aa(o,p)+aa(i,g)+a+14+3*L+aa(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(P<=D&&P<=N)return sa(t,u,e.subarray(c,c+l));if(ta(t,u,1+(N<D)),u+=2,N<D){O=Xi(p,h,0),A=p,M=Xi(g,m,0),R=g;var j=Xi(I,T,0);ta(t,u,b-257),ta(t,u+5,x-1),ta(t,u+10,L-4),u+=14;for(C=0;C<L;++C)ta(t,u+3*C,I[Fi[C]]);u+=3*L;for(var _=[y,k],F=0;F<2;++F){var B=_[F];for(C=0;C<B.length;++C){var U=31&B[C];ta(t,u,j[U]),u+=I[U],U>15&&(ta(t,u,B[C]>>>5&127),u+=B[C]>>>12)}}}else O=Yi,A=Ji,M=Zi,R=Ki;for(C=0;C<s;++C)if(r[C]>255){U=r[C]>>>18&31;na(t,u,O[U+257]),u+=A[U+257],U>7&&(ta(t,u,r[C]>>>23&31),u+=ji[U]);var H=31&r[C];na(t,u,M[H]),u+=R[H],H>3&&(na(t,u,r[C]>>>5&8191),u+=_i[H])}else na(t,u,O[r[C]]),u+=A[r[C]];return na(t,u,O[256]),u+A[256]},la=new Ni([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ua=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new Pi(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=sa(c,l,e.subarray(u,d)):(c[u]=i,l=sa(c,l,e.subarray(u,a)))}else{for(var p=la[t-1],h=p>>>13,f=8191&p,g=(1<<n)-1,m=new Di(32768),v=new Di(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 Ni(25e3),x=new Di(288),S=new Di(32),C=0,E=0,I=(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 R=a-u;if((C>7e3||I>24576)&&R>423){l=ca(e,c,0,k,x,S,E,I,L,u-L,l),I=C=E=0,L=u;for(var P=0;P<286;++P)x[P]=0;for(P=0;P<30;++P)S[P]=0}var D=2,N=0,j=f,_=A-M&32767;if(R>2&&O==w(u-_))for(var F=Math.min(h,R)-1,B=Math.min(32767,u),U=Math.min(258,R);_<=B&&--j&&A!=M;){if(e[u+D]==e[u+D-_]){for(var H=0;H<U&&e[u+H]==e[u+H-_];++H);if(H>D){if(D=H,N=_,H>F)break;var q=Math.min(_,H-2),z=0;for(P=0;P<q;++P){var W=u-_+P+32768&32767,G=W-m[W]+32768&32767;G>z&&(z=G,M=W)}}}_+=(A=M)-(M=m[A])+32768&32767}if(N){k[I++]=268435456|qi[D]<<18|Wi[N];var V=31&qi[D],$=31&Wi[N];E+=ji[V]+_i[$],++x[257+V],++S[$],T=u+D,++C}else k[I++]=e[u],++x[e[u]]}}l=ca(e,c,i,k,x,S,E,I,L,u-L,l)}return ea(s,0,r+Qi(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 da(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=ua(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 pa=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}(da(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Pi(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 Pi(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 ea(r,0,o)}(JSON.stringify(t))),!0)};function ha(e){return ha="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},ha(e)}function fa(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 ga(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fa(Object(n),!0).forEach((function(t){ma(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ma(e,t,n){return t=function(e){var t=function(e,t){if("object"!=ha(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ha(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ha(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var va=["current-password","new-password","one-time-code","cc-number","cc-csc"],ya='[gleap-ignore="value"]',ba=["checkbox","radio","submit","button","reset"],wa=function(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})},ka=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week","textarea","select","password"],xa=wa(ka),Sa=wa(ka.filter((function(e){return"select"!==e})).concat(["hidden"])),Ca=function(e){return"*".repeat(null==e?0:String(e).length)},Ea=function(e){return e.hasAttribute&&e.hasAttribute("data-rr-is-password")?"password":e.type?String(e.type).toLowerCase():""},Ia=function(e,t){try{return!!t&&e.matches(t)}catch(n){return!1}},Ta=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},La=function(e,t){return t=t||{},Ia(e,".rr-mask, .gl-mask")||Ta(e,t.maskTextClass)||Ia(e,t.maskTextSelector)},Oa=function(e,t){return t=t||{},Ia(e,".rr-block, .gl-block")||Ta(e,t.blockClass)||Ia(e,t.blockSelector)},Aa=function(e){return!0===e.maskAllInputs?xa:void 0!==e.maskInputOptions?e.maskInputOptions||{}:{password:!0}},Ma=function(e,t){if(t=t||{},!e)return Ca;if(ba.indexOf(Ea(e))>=0)return null;if(function(e){if("password"===Ea(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return va.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 La(e,t)||Ia(e,ya)}))}(e,t))return Ca;if(!function(e,t){var n=Aa(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[Ea(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?Ca:function(t){try{return n(t,e)}catch(r){return Ca(t)}}},Ra=ba.map((function(e){return':not([type="'+e+'" i])'})).join(""),Pa=function(e){return String(e).replace(/[\S]/g,"*")},Da=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?Pa:function(e,n){try{var r=t(e,n);return"string"==typeof r?r:Pa(e)}catch(o){return Pa(e)}}};function Na(e){return function(e){if(Array.isArray(e))return ja(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 ja(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 ja(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 ja(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){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 Fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_a(Object(n),!0).forEach((function(t){Ua(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ba(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,Ha(r.key),r)}}function Ua(e,t,n){return(t=Ha(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ha(e){var t=function(e,t){if("object"!=qa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=qa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qa(t)?t:String(t)}function qa(e){return qa="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},qa(e)}var za=10485760,Wa=function e(t){if("string"==typeof t)return t.length+2;if(null===t||"object"!==qa(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},Ga=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ua(this,"startDate",void 0),Ua(this,"segments",[[]]),Ua(this,"segmentSizes",[0]),Ua(this,"incrementalSize",0),Ua(this,"lastForcedCheckout",0),Ua(this,"forcedCheckoutTimeout",void 0),Ua(this,"stopFunction",void 0),Ua(this,"customOptions",{}),Ua(this,"pausedForCapture",!1)}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;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.startDate){if(this.stopFunction){try{this.stopFunction()}catch(n){}this.stopFunction=void 0}if(this.segments[this.segments.length-1].length>0)for(this.segments.push([]),this.segmentSizes.push(0),this.incrementalSize=0;this.segments.length>3;)this.dropOldestSegment()}else this.stop(),this.startDate=Date.now(),this.resetBuffer();var 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=Ri(Fa(Fa(Fa(Fa({},t),this.customOptions),function(e){var t=function(t,n){var r=Ma(n,e);return r?r(t):t};return!0===(e=e||{}).maskAllInputs?{maskInputFn:t}:{maskInputFn:t,maskInputOptions:ga(ga({},Aa(e)),Sa)}}(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=Wa(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.pausedForCapture||this.start()}},{key:"stop",value:function(){this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.pausedForCapture=!1,this.startDate=void 0,this.resetBuffer()}},{key:"pauseForCapture",value:function(){if(!this.stopFunction)return!1;try{this.stopFunction()}catch(e){}return this.stopFunction=void 0,clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.pausedForCapture=!0,!0}},{key:"resumeAfterCapture",value:function(){this.pausedForCapture&&(this.pausedForCapture=!1,this.start(!0))}},{key:"resetBuffer",value:function(){clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.segments=[[]],this.segmentSizes=[0],this.incrementalSize=0}},{key:"dropOldestSegment",value:function(){this.segments.shift(),this.segmentSizes.shift()}},{key:"getBufferSize",value:function(){for(var e=0,t=0;t<this.segmentSizes.length;t++)e+=this.segmentSizes[t];return e}},{key:"enforceBufferSize",value:function(){for(;this.segments.length>1&&this.getBufferSize()>za;)this.dropOldestSegment();this.getBufferSize()>za&&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{Ri.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplaySnapshot",value:function(){var e;return{startDate:this.startDate,events:(e=[]).concat.apply(e,Na(this.segments)),packed:!1,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,Na(this.segments)),n=t,r=!1;try{n=t.map((function(e){return pa(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&&Ba(t.prototype,n),r&&Ba(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Ua(Ga,"instance",void 0);const Va=475249515,$a=(e,t,n)=>{const r=e[t];if(!r)return null;let o=1,i=128;for(;!(r&i);)i>>=1,o+=1;if(o>(n?4:8)||t+o>e.length)return null;let a=n?r:r&i-1,s=(r&i-1)==i-1;for(let c=1;c<o;c++)a=256*a+e[t+c],s=s&&255===e[t+c];return{value:a,length:o,unknown:!n&&s}},Xa=(e,t)=>{const n=$a(e,t,!0),r=n&&$a(e,t+n.length,!1);return r?{id:n.value,start:t,idLength:n.length,size:r.value,unknown:r.unknown,dataStart:t+n.length+r.length}:null},Ja=(e,t)=>{for(let n=t;n<=8;n++)if(e<Math.pow(2,7*n)-1){const t=new Uint8Array(n);let r=e;for(let e=n-1;e>=0;e--)t[e]=r%256,r=Math.floor(r/256);return t[0]|=128>>n-1,t}return null},Ka=(e,t,n)=>{let r=0;for(let o=0;o<n;o++)r=256*r+e[t+o];return r},Ya=(e,t,n,r)=>{let o=r;for(let i=n-1;i>=0;i--)e[t+i]=o%256,o=Math.floor(o/256);return 0===o},Za=(e,t)=>{const n=[];for(let r=t.dataStart;r<t.dataStart+t.size;){const t=Xa(e,r);if(!t||t.unknown)return null;for(let r=t.dataStart;19899===t.id&&r<t.dataStart+t.size;){const t=Xa(e,r);if(!t||t.unknown||t.size>8)return null;const o=Ka(e,t.dataStart,t.size);if(21419===t.id&&o===Va)return null;21420===t.id&&n.push({pos:t.dataStart,size:t.size,value:o}),r=t.dataStart+t.size}r=t.dataStart+t.size}return n},Qa=(e,t)=>{try{if(!(e&&t>0&&"function"==typeof e.slice))return Promise.resolve(e);const n=e.slice(0,Math.min(e.size,65536));return"function"!=typeof n.arrayBuffer?Promise.resolve(e):n.arrayBuffer().then((n=>{try{return((e,t,n)=>{const r=Xa(t,0);if(!r||440786851!==r.id||r.unknown)return null;const o=Xa(t,r.dataStart+r.size);if(!o||408125543!==o.id)return null;const i=[];let a=null;for(let v=o.dataStart;v<t.length&&!a;){const e=Xa(t,v);if(!e||e.unknown||524531317===e.id||e.id===Va)return null;290298740===e.id&&i.push(e),357149030===e.id&&(a=e),v=e.dataStart+e.size}const s=a?a.dataStart+a.size:0;if(!a||s>t.length)return null;let c=1e6,l=null;for(let v=a.dataStart;v<s;){const e=Xa(t,v);if(!e||e.unknown||e.dataStart+e.size>s)return null;2807729===e.id&&e.size>0&&e.size<=6&&(c=Ka(t,e.dataStart,e.size)||c),17545===e.id&&(l=e),v=e.dataStart+e.size}const u=1e6*n/c,d=t.slice(),p=e.slice(t.length);if(l){const t=new DataView(d.buffer);if(8===l.size)t.setFloat64(l.dataStart,u);else{if(4!==l.size)return null;t.setFloat32(l.dataStart,u)}return new Blob([d,p],{type:e.type})}const h=new Uint8Array(11);h.set([68,137,136]),new DataView(h.buffer).setFloat64(3,u);const f=Ja(a.size+h.length,a.dataStart-a.start-a.idLength);if(!f)return null;const g=new Uint8Array(a.idLength+f.length);g.set(d.subarray(a.start,a.start+a.idLength)),g.set(f,a.idLength);const m=g.length-(a.dataStart-a.start)+h.length;for(let v=0;v<i.length;v++){const e=Za(t,i[v]);if(!e||i[v].dataStart+i[v].size>a.start)return null;for(let t=0;t<e.length;t++){const n=e[t];if(o.dataStart+n.value>a.start&&!Ya(d,n.pos,n.size,n.value+m))return null}}if(!o.unknown){const e=o.dataStart-o.start-o.idLength,t=Ja(o.size+m,e);if(!t||t.length!==e)return null;d.set(t,o.start+o.idLength)}return new Blob([d.subarray(0,a.start),g,d.subarray(a.dataStart,s),h,d.subarray(s),p],{type:e.type})})(e,new Uint8Array(n),t)||e}catch(r){return e}}),(()=>e))}catch(n){return Promise.resolve(e)}},es=()=>"undefined"!=typeof performance&&performance.now?performance.now():Date.now(),ts=()=>new Promise((e=>{try{if("function"==typeof MessageChannel){const t=new MessageChannel;return t.port1.onmessage=()=>{t.port1.onmessage=null;try{t.port1.close(),t.port2.close()}catch(n){}e()},void t.port2.postMessage(0)}}catch(t){}setTimeout(e,0)})),ns=e=>{const t=JSON.stringify(e);return void 0===t?null:t},rs=(e,t)=>{const n=["{"];let r=!0;const o=Object.keys(e),i=o=>{const i=e[o],a=(r?"":",")+JSON.stringify(o)+":";if(Array.isArray(i)&&i.length>50)return r=!1,n.push(a+"["),((e,t,n)=>new Promise(((r,o)=>{let i=0;const a=()=>{try{if(n&&n())return void o(new Error("cancelled"));const s=es();for(;i<e.length;)if(t(e[i],i),i+=1,es()-s>25&&i<e.length)return void ts().then(a);r()}catch(s){o(s)}};a()})))(i,((e,t)=>{let r=null;try{r=ns(e)}catch(o){}n.push((t?",":"")+(r||"null"))}),t).then((()=>{n.push("]")}));if((e=>!!e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).some((t=>Array.isArray(e[t])&&e[t].length>50)))(i))return r=!1,n.push(a),rs(i,t).then((e=>{e.forEach((e=>n.push(e)))}));let s=null;try{s=ns(i)}catch(c){s=null}return null!==s&&(r=!1,n.push(a+s)),ts()};return o.reduce(((e,t)=>e.then((()=>i(t)))),Promise.resolve()).then((()=>(n.push("}"),n)))};function os(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const is=["video/mp4;codecs=avc3","video/mp4;codecs=avc1","video/mp4","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"],as=["video/mp4;codecs=avc3,mp4a.40.2","video/mp4;codecs=avc1,mp4a.40.2","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"],ss=e=>{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}};class cs{constructor(e){os(this,"stream",null),os(this,"micStream",null),os(this,"videoTrack",null),os(this,"recorder",null),os(this,"chunks",[]),os(this,"mimeType",""),os(this,"timer",null),os(this,"startedAt",0),os(this,"endedAt",0),os(this,"settings",{}),os(this,"finished",!1),os(this,"recorderStopped",!1),os(this,"stopTimeout",null),os(this,"onEndedBound",null),os(this,"recorderError",null),this.options=e}start(e,t){if(this.stream=e,this.videoTrack=e.getVideoTracks()[0]||null,!this.videoTrack)return Promise.reject(new Error("no-video-track"));try{this.settings=this.videoTrack.getSettings?this.videoTrack.getSettings():{}}catch(n){this.settings={}}return(t?navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}).catch((()=>null)):Promise.resolve(null)).then((e=>{this.micStream=e;const t=e&&e.getAudioTracks()[0]||null;if(this.finished||!this.videoTrack||"ended"===this.videoTrack.readyState)throw this.cleanup(),new Error("stopped-before-start");const r=[this.videoTrack];t&&r.push(t),this.mimeType=(e=>{const t=e?as.concat(is):is;try{if("undefined"!=typeof MediaRecorder&&"function"==typeof MediaRecorder.isTypeSupported)for(let e=0;e<t.length;e++)if(MediaRecorder.isTypeSupported(t[e]))return t[e]}catch(n){}return""})(!!t);const o={videoBitsPerSecond:25e5};this.mimeType&&(o.mimeType=this.mimeType),t&&(o.audioBitsPerSecond=64e3);try{this.recorder=new MediaRecorder(new MediaStream(r),o)}catch(a){throw this.cleanup(),a}this.recorder.ondataavailable=e=>{try{e.data&&e.data.size>0&&this.chunks.push(e.data)}catch(n){}},this.recorder.onstop=()=>{try{this.recorderStopped=!0,this.finish()}catch(n){}},this.recorder.onerror=e=>{try{this.onRecorderError(e&&e.error||new Error("recorder-error"))}catch(n){}},this.onEndedBound=()=>{try{this.stop()}catch(n){}},this.videoTrack.addEventListener("ended",this.onEndedBound);try{this.recorder.start(1e3)}catch(a){throw this.cleanup(),a}this.startedAt=Date.now();const i=1e3*this.options.maxDurationSec;return this.timer=setInterval((()=>{try{const e=Date.now()-this.startedAt;try{this.options.onTick(Math.floor(e/1e3))}catch(n){}e>=i&&this.stop()}catch(n){}}),250),{hasMicrophone:!!t}}))}setMicrophoneEnabled(e){try{this.micStream&&this.micStream.getAudioTracks().forEach((t=>{t.enabled=!!e}))}catch(t){}}stop(){if(!this.finished&&!this.stopTimeout)if(this.endedAt=this.endedAt||Date.now(),this.clearTimer(),this.recorder&&!this.recorderStopped){try{"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.releaseTracks(),this.stopTimeout=setTimeout((()=>{try{this.finish()}catch(e){}}),3e3)}else this.finish()}onRecorderError(e){this.finished||(this.recorderError=e,this.stop())}finish(){if(this.finished)return;this.finished=!0,this.endedAt=this.endedAt||Date.now();const e=-1!==(this.recorder&&this.recorder.mimeType||this.mimeType||"video/webm").indexOf("mp4")?"video/mp4":"video/webm",t=new Blob(this.chunks,{type:e});this.chunks=[],this.cleanup();const n={blob:t,type:e,fileName:"screen-recording."+("video/mp4"===e?"mp4":"webm"),startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt),width:this.settings.width,height:this.settings.height,method:"browser"===this.settings.displaySurface?"tab":"display"};if(0===t.size)return void this.options.onError(this.recorderError||new Error("empty-recording"));const r=e=>{n.blob=e;try{this.options.onStop(n)}catch(t){try{this.options.onError(t)}catch(r){}}};"video/webm"===e?Qa(t,n.durationMs).then(r):r(t)}fail(e){if(!this.finished){this.finished=!0,this.chunks=[],this.cleanup();try{this.options.onError(e)}catch(t){}}}cancel(){this.finished=!0,this.chunks=[];try{this.recorder&&"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.cleanup()}clearTimer(){this.timer&&(clearInterval(this.timer),this.timer=null),this.stopTimeout&&(clearTimeout(this.stopTimeout),this.stopTimeout=null)}releaseTracks(){if(this.videoTrack&&this.onEndedBound)try{this.videoTrack.removeEventListener("ended",this.onEndedBound)}catch(e){}if(this.onEndedBound=null,ss(this.stream),ss(this.micStream),this.options.onReleased)try{this.options.onReleased()}catch(e){}}cleanup(){this.clearTimer(),this.releaseTracks(),this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null,this.stream=null,this.micStream=null,this.videoTrack=null}}const ls=e=>e.filter((e=>{if("string"!=typeof e||!e.trim())return!1;try{return document.createDocumentFragment().querySelector(e),!0}catch(t){return!1}})).join(", ")||null,us=e=>{if("function"==typeof CompressionStream&&"function"==typeof Response){const t=JSON.stringify(Object.assign({},e,{v:"v1"}));if(t.length>204800)return new Response(new Blob([t]).stream().pipeThrough(new CompressionStream("deflate"))).arrayBuffer().then((e=>(e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode.apply(null,e.subarray(n,n+32768));return t})(new Uint8Array(e))))}return pa(e)},ds=(e,t)=>new Promise(((n,r)=>{const o=new Array(e.length);let i=0;const a=()=>{try{if(t&&t())return void r(new Error("cancelled"));const s=es();for(;i<e.length;){const t=us(e[i]),r=i;if(i+=1,"string"!=typeof t)return void t.then((e=>{o[r]=e,a()}),(()=>n(null)));if(o[r]=t,es()-s>25&&i<e.length)return void ts().then(a)}n(o)}catch(s){n(null)}};a()}));class ps{constructor(e){os(this,"events",[]),os(this,"cancelled",!1),os(this,"size",0),os(this,"stopFunction",null),os(this,"timer",null),os(this,"startedAt",0),os(this,"endedAt",0),os(this,"finished",!1),os(this,"resumeReplay",!1),os(this,"width",0),os(this,"height",0),this.options=e}start(){const e=this.options.privacyOptions||{};this.resumeReplay=Ga.getInstance().pauseForCapture(),this.startedAt=Date.now(),this.width=window.innerWidth,this.height=window.innerHeight;try{this.stopFunction=Ri({emit:e=>{try{if(this.finished)return;this.events.push(e),this.size+=Wa(e),this.size>26214400&&setTimeout((()=>{try{this.stop()}catch(e){}}),0)}catch(t){}},maskAllInputs:!0,blockClass:e.blockClass||"rr-block",blockSelector:ls([".rr-block",".gl-block",e.blockSelector].concat(this.options.maskSelectors||[])),maskTextClass:e.maskTextClass||"rr-mask",maskTextSelector:ls([".rr-mask",".gl-mask",e.maskTextSelector]),inlineStylesheet:!0,recordCanvas:!1,collectFonts:!1,recordCrossOriginIframes:!1,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0},dataURLOptions:{quality:.7},sampling:{scroll:150,input:"last",mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!0,TouchEnd:!1}}})}catch(n){throw this.cleanup(),n}if(!this.stopFunction)throw this.cleanup(),new Error("page-recording-unavailable");const t=1e3*this.options.maxDurationSec;this.timer=setInterval((()=>{try{const n=Date.now()-this.startedAt;try{this.options.onTick(Math.floor(n/1e3))}catch(e){}n>=t&&this.stop()}catch(e){}}),250)}stop(){if(this.finished)return;this.finished=!0,this.endedAt=Date.now(),this.cleanup();const e=this.events;this.events=[];const t=()=>this.cancelled;ds(e,t).then((n=>rs({startDate:this.startedAt,events:n||e,packed:!!n,baseUrl:window.location.origin,width:this.width,height:this.height,isMobile:Q(),type:"rrweb"},t))).then((e=>{this.cancelled||this.options.onStop({blob:new Blob(e,{type:"application/json"}),type:"application/json",fileName:"page-recording.json",startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt),width:this.width,height:this.height,method:"rrweb"})})).catch((e=>{if(!this.cancelled)try{this.options.onError(e)}catch(t){}}))}cancel(){this.finished=!0,this.cancelled=!0,this.events=[],this.cleanup()}cleanup(){if(this.timer&&(clearInterval(this.timer),this.timer=null),this.stopFunction){try{this.stopFunction()}catch(e){}this.stopFunction=null}if(this.resumeReplay){this.resumeReplay=!1;try{Ga.getInstance().resumeAfterCapture()}catch(e){}}}}const hs=(e,t)=>{const n=String(e||"").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"…":n},fs=(e,t,n)=>{if(!e||1!==e.nodeType)return"element";const r=e.tagName.toLowerCase(),o=e.getAttribute("role")||("a"===r?"link":r),i=((e,t,n)=>{let r=e;for(;r;){if(1===r.nodeType)try{if(Oa(r,t)||La(r,t)||n&&r.matches(n))return!0}catch(o){}r=r.parentElement||r.parentNode&&r.parentNode.host||null}return!1})(e,t,ls(Array.isArray(n)?n:[]));if("input"===r||"select"===r||"textarea"===r){const t="checkbox"===e.type||"radio"===e.type?e.type:"field";return i?t:t+' "'+(hs((a=e).getAttribute("aria-label")||a.labels&&a.labels[0]&&a.labels[0].textContent||a.getAttribute("placeholder")||a.getAttribute("name")||a.id||a.type||a.tagName.toLowerCase(),60)+'"')}var a;if(i)return o;const s=hs(e.getAttribute("aria-label")||e.getAttribute("title")||e.getAttribute("alt")||e.textContent,60);return s?o+' "'+s+'"':o},gs=e=>{try{const t=new URL(e);return hs(t.pathname+t.search+t.hash,150)}catch(t){return hs(e,150)}};class ms{constructor(e){let{privacyOptions:t,maskSelectors:n,isOwnElement:r}=e;os(this,"entries",[]),os(this,"startedAt",0),os(this,"listeners",[]),os(this,"urlTimer",null),os(this,"lastUrl",""),os(this,"lastInputField",null),os(this,"lastInputAt",0),this.privacyOptions=t||{},this.maskSelectors=Array.isArray(n)?n:[],this.isOwnElement=r||(()=>!1)}add(e,t,n){this.entries.length>=200||this.entries.push({t:Math.max(0,(n||Date.now())-this.startedAt),type:e,label:hs(t,200)})}target(e){try{const t=e.composedPath?e.composedPath():[e.target];for(let e=0;e<t.length;e++){const n=t[e];if(n&&1===n.nodeType&&n.matches&&n.matches('a, button, input, select, textarea, label, summary, [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="checkbox"], [role="option"], [role="switch"]'))return n}}catch(t){}return null}start(e){this.startedAt=e||Date.now(),this.lastUrl=window.location.href;const t=(e,t,n)=>{e.addEventListener(t,n,{capture:!0,passive:!0}),this.listeners.push((()=>e.removeEventListener(t,n,{capture:!0,passive:!0})))};t(document,"click",(e=>{try{if(this.isOwnElement(e.target))return;const t=this.target(e),n=t?fs(t,this.privacyOptions,this.maskSelectors):e.target&&e.target.tagName?e.target.tagName.toLowerCase():"page";this.add("click","Clicked "+n)}catch(t){}}));const n=e=>{try{const t=this.target(e);if(!t||this.isOwnElement(e.target))return;const n=Date.now();if(t===this.lastInputField&&n-this.lastInputAt<5e3)return void(this.lastInputAt=n);this.lastInputField=t,this.lastInputAt=n,this.add("input",("change"===e.type?"Changed ":"Typed in ")+fs(t,this.privacyOptions,this.maskSelectors))}catch(t){}};t(document,"input",n),t(document,"change",n);const r=()=>{try{const e=window.location.href;e!==this.lastUrl&&(this.lastUrl=e,this.add("navigation","Navigated to "+gs(e)))}catch(e){}};t(window,"popstate",r),t(window,"hashchange",r),this.urlTimer=setInterval(r,500)}stop(e){const t=e||Date.now();this.listeners.forEach((e=>{try{e()}catch(t){}})),this.listeners=[],this.urlTimer&&(clearInterval(this.urlTimer),this.urlTimer=null);const n=e=>{const n=new Date(e).getTime();return n>=this.startedAt&&n<=t?n:null};try{Sd.getInstance().getLogs().forEach((e=>{const t=e&&"ERROR"===e.priority?n(e.date):null;null!==t&&this.add("error",String(e.log||"").split("\n")[0],t)}))}catch(r){}try{Cm.getInstance().getRequests().forEach((e=>{if(!e||"RESOURCE"===e.type)return;const t=e.response&&e.response.status,r=!1===e.success||"number"==typeof t&&t>=400?n(e.date):null;null!==r&&this.add("network-error",(e.type||"GET")+" "+gs(e.url)+" → "+(t||"failed"),r)}))}catch(r){}return this.entries.sort(((e,t)=>e.t-t.t))}get interactions(){return this.entries.filter((e=>"click"===e.type||"input"===e.type)).length}}const vs=19922944,ys={consoleLog:!0,networkLogs:!0,customData:!0,metaData:!0,customEventLog:!0,replays:!1},bs=(e,t)=>"/v3/shared/capture-requests/"+encodeURIComponent(String(e))+"/"+t,ws=e=>{try{return e?JSON.parse(e):null}catch(t){return null}},ks=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((o=>{let i=!1;const a=(e,t)=>{i||(i=!0,o({status:e,data:t}))};try{const o=Tf.getInstance(),i=new XMLHttpRequest;i.open(e,o.apiUrl+t),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.gzip&&i.setRequestHeader("Content-Encoding","gzip"),o.injectSession(i),i.timeout=r.timeoutMs||3e4,i.onreadystatechange=()=>{4===i.readyState&&a(i.status,ws(i.responseText))},i.onerror=()=>a(0,null),i.ontimeout=()=>a(0,null),i.send(void 0===n?null:n)}catch(s){a(0,null)}}))},xs=(e,t,n)=>ks("POST",bs(e,t),JSON.stringify(n||{})),Ss=(e,t,n)=>{const r={type:t};return n&&(r.reason=String(n).slice(0,200)),xs(e,"event",r)},Cs=e=>rs(e).then((e=>{const t=new Blob(e,{type:"application/json"});return(e=>{try{if("function"==typeof CompressionStream&&"function"==typeof Response&&"function"==typeof e.stream)return new Response(e.stream().pipeThrough(new CompressionStream("gzip"))).blob().catch((()=>null))}catch(t){}return Promise.resolve(null)})(t).then((e=>e?{body:e,gzip:!0,size:e.size}:{body:t,gzip:!1,size:t.size}))})),Es=e=>(e=>{const t=e.webReplay;return t&&!t.packed&&Array.isArray(t.events)?ds(t.events).then((n=>n?Object.assign({},e,{webReplay:Object.assign({},t,{events:n,packed:!0})}):e)):Promise.resolve(e)})(e).then((e=>Cs(e))).then((t=>{if(t.size<=vs)return t;if(!e.webReplay)return null;const n=Object.assign({},e);return delete n.webReplay,Cs(n).then((e=>e.size<=vs?e:null))})),Is=(e,t)=>Es(t).then((t=>{return t?ks("POST",bs(e,"logs"),t.body,{gzip:t.gzip,timeoutMs:(n=t.size,3e4+1e3*Math.ceil((n||0)/65536))}):{status:413,data:null};var n})),Ts=e=>{const t=Object.assign({},ys);return e&&"object"==typeof e&&Object.keys(ys).forEach((n=>{"boolean"==typeof e[n]&&(t[n]=e[n])})),t},Ls=(e,t,n)=>Array.isArray(e)?t?e.filter((e=>{const r=(e=>{if(!e)return NaN;const t=e.date;return t instanceof Date?t.getTime():"string"==typeof t||"number"==typeof t?new Date(t).getTime():NaN})(e);return isNaN(r)||r>=t&&r<=n})):e.slice():[],Os=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ts(e.include),n=Date.now(),r=e.windowEnd||n,o=e.windowStart?e.windowStart-1e4:0,i={},a=(e,t)=>{try{i[e]=t()}catch(n){}};if(t.consoleLog&&a("consoleLog",(()=>Ls(Sd.getInstance().getLogs(),o,r))),t.networkLogs&&a("networkLogs",(()=>Ls(Cm.getInstance().getRequests(),o,r))),t.customData&&a("customData",(()=>Nd.getInstance().getCustomData())),t.metaData&&a("metaData",(()=>yg.getInstance().getMetaData())),t.customEventLog&&a("customEventLog",(()=>Ls(Iv.getInstance().getEventArray(),o,r))),t.replays&&(()=>{try{const e=Xu.getInstance().getFlowConfig();return!(!e||!e.enableWebReplays)}catch(e){return!1}})())try{const e=Ga.getInstance().getReplaySnapshot();e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0&&(i.webReplay=e)}catch(c){}let s=e.windowStart;if(!s)try{s=yg.getInstance().sessionStart.getTime()}catch(c){s=n}return i.capturedAt=new Date(n).toISOString(),i.windowStart=new Date(s).toISOString(),i.windowEnd=new Date(r).toISOString(),i.platform=qn,i.sdkType=Hn,i.sdkVersion=Xn(),e.deviceId&&(i.deviceId=e.deviceId),i};"p".charCodeAt(0),"H".charCodeAt(0),"Y".charCodeAt(0),"s".charCodeAt(0);const As="[modern-screenshot]",Ms="undefined"!=typeof window,Rs=Ms&&"Worker"in window,Ps=(Ms&&window,Ms&&window,Ms?window.navigator?.userAgent:""),Ds=Ps.includes("Chrome"),Ns=Ps.includes("AppleWebKit")&&!Ds,js=Ps.includes("Firefox"),_s=e=>e&&"__CONTEXT__"in e,Fs=e=>"CSSFontFaceRule"===e.constructor.name,Bs=e=>"CSSImportRule"===e.constructor.name,Us=e=>"CSSLayerBlockRule"===e.constructor.name,Hs=e=>1===e.nodeType,qs=e=>"object"==typeof e.className,zs=e=>"image"===e.tagName,Ws=e=>"use"===e.tagName,Gs=e=>Hs(e)&&void 0!==e.style&&!qs(e),Vs=e=>8===e.nodeType,$s=e=>3===e.nodeType,Xs=e=>"IMG"===e.tagName,Js=e=>"VIDEO"===e.tagName,Ks=e=>"CANVAS"===e.tagName,Ys=e=>"TEXTAREA"===e.tagName,Zs=e=>"INPUT"===e.tagName,Qs=e=>"STYLE"===e.tagName,ec=e=>"SCRIPT"===e.tagName,tc=e=>"SELECT"===e.tagName,nc=e=>"SLOT"===e.tagName,rc=e=>"IFRAME"===e.tagName,oc=(...e)=>console.warn(As,...e);function ic(e){const t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),Boolean(t)&&"toDataURL"in t&&Boolean(t.toDataURL("image/webp").includes("image/webp"))}const ac=e=>e.startsWith("data:");function sc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Ms&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;if(!Ms)return e;const n=cc().implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}function cc(e){return(e&&Hs(e)?e?.ownerDocument:e)??window.document}const lc="http://www.w3.org/2000/svg";function uc(e,t,n){const r=cc(n).createElementNS(lc,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function dc(e,t){let n=(new XMLSerializer).serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function pc(e,t){return new Promise(((n,r)=>{const o=new FileReader;o.onload=()=>n(o.result),o.onerror=()=>r(o.error),o.onabort=()=>r(new Error(`Failed read blob to ${t}`)),"dataUrl"===t?o.readAsDataURL(e):"arrayBuffer"===t&&o.readAsArrayBuffer(e)}))}const hc=e=>pc(e,"dataUrl");function fc(e,t){const n=cc(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function gc(e,t){return new Promise((n=>{const{timeout:r,ownerDocument:o,onError:i,onWarn:a}=t??{},s="string"==typeof e?fc(e,cc(o)):e;let c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),Js(s)){const e=s.currentSrc||s.src;if(!e)return s.poster?gc(s.poster,t).then(n):u();if(s.readyState>=2)return u();const r=u,o=t=>{a?.("Failed video load",e,t),i?.(t),u()};l=()=>{s.removeEventListener("loadeddata",r),s.removeEventListener("error",o)},s.addEventListener("loadeddata",r,{once:!0}),s.addEventListener("error",o,{once:!0})}else{const e=zs(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();const t=async()=>{if(Xs(s)&&"decode"in s)try{await s.decode()}catch(t){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||e,t)}u()},n=t=>{a?.("Failed image load",s.dataset.originalSrc||e,t),u()};if(Xs(s)&&s.complete)return t();l=()=>{s.removeEventListener("load",t),s.removeEventListener("error",n)},s.addEventListener("load",t,{once:!0}),s.addEventListener("error",n,{once:!0})}}))}const mc=function(){let e=0;return()=>(e+=1,`u${`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4)}${e}`)}();function vc(e){return e?.split(",").map((e=>e.trim().replace(/"|'/g,"").toLowerCase())).filter(Boolean)}let yc=0;function bc(e){const t=`${As}[#${yc}]`;return yc++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&oc(...t)}}async function wc(e,t){return _s(e)?e:kc(e,{...t,autoDestruct:!0})}async function kc(e,t){const{scale:n=1,workerUrl:r,workerNumber:o=1}=t||{},i=Boolean(t?.debug),a=t?.features??!0,s=e.ownerDocument??(Ms?window.document:void 0),c=e.ownerDocument?.defaultView??(Ms?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:(d=t?.fetch?.bypassingCache,{cache:d?"no-cache":"force-cache"}),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:o,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:bc(i),node:e,ownerDocument:s,ownerWindow:c,dpi:1===n?null:96*n,svgStyleElement:xc(s),svgDefsElement:s?.createElementNS(lc,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Rs&&r&&o?o:0})].map((()=>{try{const e=new Worker(r);return e.onmessage=async e=>{const{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{const{url:t}=e.data;l.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn("Failed to new Worker",e),null}})).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[ic(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:a,isEnable:e=>"restoreScrollPosition"===e?"boolean"!=typeof a&&(a[e]??!1):"boolean"==typeof a?a:a[e]??!0,shadowRoots:[]};var d;u.log.time("wait until load"),await async function(e,t){Gs(e)&&(Xs(e)||Js(e)?await gc(e,t):await Promise.all(["img","video"].flatMap((n=>Array.from(e.querySelectorAll(n)).map((e=>gc(e,t)))))))}(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd("wait until load");const{width:p,height:h}=function(e,t){let{width:n,height:r}=t;if(Hs(e)&&(!n||!r)){const t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute("width"))||0,r=r||t.height||Number(e.getAttribute("height"))||0}return{width:n,height:r}}(e,u);return u.width=p,u.height=h,u}function xc(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode("\n.______background-clip--text {\n background-clip: text;\n -webkit-background-clip: text;\n}\n");return t.appendChild(n),t}async function Sc(e,t){const{log:n,timeout:r,drawImageCount:o,drawImageInterval:i}=t;n.time("image to canvas");const a=await gc(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=function(e,t){const{width:n,height:r,scale:o,backgroundColor:i,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*o),s.height=Math.floor(r*o),s.style.width=`${n}px`,s.style.height=`${r}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));const c=s.getContext("2d");c&&i&&(c.fillStyle=i,c.fillRect(0,0,s.width,s.height));return{canvas:s,context2d:c}}(e.ownerDocument,t),l=()=>{try{c?.drawImage(a,0,0,s.width,s.height)}catch(e){t.log.warn("Failed to drawImage",e)}};if(l(),t.isEnable("fixSvgXmlDecode"))for(let u=0;u<o;u++)await new Promise((e=>{setTimeout((()=>{c?.clearRect(0,0,s.width,s.height),l(),e()}),u+i)}));return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Cc(e,t){if(e.ownerDocument)try{const t=e.toDataURL();if("data:,"!==t)return fc(t,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}const n=e.cloneNode(!1),r=e.getContext("2d"),o=n.getContext("2d");try{return r&&o&&o.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function Ec(e,t){return Ks(e)?Cc(e,t):rc(e)?function(e,t){try{if(e?.contentDocument?.documentElement)return jc(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}(e,t):Xs(e)?function(e){const t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager"),t}(e):Js(e)?async function(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return fc(e.poster,e.ownerDocument);const n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);const r=n.ownerDocument;if(r){let i=!0;if(await gc(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?fc(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise((e=>{n.addEventListener("seeked",e,{once:!0})}));const a=r.createElement("canvas");a.width=e.offsetWidth,a.height=e.offsetHeight;try{const e=a.getContext("2d");e&&e.drawImage(n,0,0,a.width,a.height)}catch(o){return t.log.warn("Failed to clone video",o),e.poster?fc(e.poster,e.ownerDocument):n}return Cc(a,t)}return n}(e,t):e.cloneNode(!1)}const Ic=["width","height","-webkit-text-fill-color"],Tc=["stroke","fill"];function Lc(e,t,n){const{defaultComputedStyles:r}=n,o=e.nodeName.toLowerCase(),i=qs(e)&&"svg"!==o,a=i?Tc.map((t=>[t,e.getAttribute(t)])).filter((([,e])=>null!==e)):[],s=[i&&"svg",o,a.map(((e,t)=>`${e}=${t}`)).join(","),t].filter(Boolean).join(":");if(r.has(s))return r.get(s);const c=function(e){let t=e.sandbox;if(!t){const{ownerDocument:r}=e;try{r&&(t=r.createElement("iframe"),t.id=`__SANDBOX__${mc()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",r.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(n){e.log.warn("Failed to getSandBox",n)}}return t}(n),l=c?.contentWindow;if(!l)return new Map;const u=l?.document;let d,p;i?(d=u.createElementNS(lc,"svg"),p=d.ownerDocument.createElementNS(d.namespaceURI,o),a.forEach((([e,t])=>{p.setAttributeNS(null,e,t)})),d.appendChild(p)):d=p=u.createElement(o),p.textContent=" ",u.body.appendChild(d);const h=l.getComputedStyle(p,t),f=new Map;for(let g=h.length,m=0;m<g;m++){const e=h.item(m);Ic.includes(e)||f.set(e,h.getPropertyValue(e))}return u.body.removeChild(d),r.set(s,f),f}function Oc(e,t,n){const r=new Map,o=[],i=new Map;if(n)for(const s of n)a(s);else for(let s=e.length,c=0;c<s;c++){a(e.item(c))}for(let s=o.length,c=0;c<s;c++)i.get(o[c])?.forEach(((e,t)=>r.set(t,e)));function a(n){const a=e.getPropertyValue(n),s=e.getPropertyPriority(n),c=n.lastIndexOf("-"),l=c>-1?n.substring(0,c):void 0;if(l){let e=i.get(l);e||(e=new Map,i.set(l,e)),e.set(n,[a,s])}(t.get(n)!==a||s)&&(l?o.push(l):r.set(n,[a,s]))}return r}const Ac=["::before","::after"],Mc=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];const Rc=new Set(["symbol"]);async function Pc(e,t,n,r,o){if(Hs(n)&&(Qs(n)||ec(n)))return;if(r.filter&&!r.filter(n))return;Rc.has(t.nodeName)||Rc.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;const i=await jc(n,r,!1,o);r.isEnable("restoreScrollPosition")&&function(e,t){if(!Gs(e)||!Gs(t))return;const{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;const{transform:o}=t.style,i=new DOMMatrix(o),{a,b:s,c,d:l}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-r,-n),i.a=a,i.b=s,i.c=c,i.d=l,t.style.transform=i.toString()}(e,i),t.appendChild(i)}async function Dc(e,t,n,r){let o=e.firstChild;Hs(e)&&e.shadowRoot&&(o=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=o;i;i=i.nextSibling)if(!Vs(i))if(Hs(i)&&nc(i)&&"function"==typeof i.assignedNodes){const o=i.assignedNodes();for(let i=0;i<o.length;i++)await Pc(e,t,o[i],n,r)}else await Pc(e,t,i,n,r)}const Nc=/^[\w-:]+$/;async function jc(e,t,n=!1,r){const{ownerDocument:o,ownerWindow:i,fontFamilies:a,onCloneEachNode:s}=t;if(o&&$s(e))return r&&/\S/.test(e.data)&&r(e.data),o.createTextNode(e.data);if(o&&i&&Hs(e)&&(Gs(e)||qs(e))){const r=await Ec(e,t);if(t.isEnable("removeAbnormalAttributes")){const e=r.getAttributeNames();for(let t=e.length,n=0;n<t;n++){const t=e[n];Nc.test(t)||r.removeAttribute(t)}}const o=t.currentNodeStyle=function(e,t,n,r){const{ownerWindow:o,includeStyleProperties:i,currentParentNodeStyle:a}=r,s=t.style,c=o.getComputedStyle(e),l=Lc(e,null,r);a?.forEach(((e,t)=>{l.delete(t)}));const u=Oc(c,l,i);u.delete("transition-property"),u.delete("all"),u.delete("d"),u.delete("content"),n&&(u.delete("position"),u.delete("margin-top"),u.delete("margin-right"),u.delete("margin-bottom"),u.delete("margin-left"),u.delete("margin-block-start"),u.delete("margin-block-end"),u.delete("margin-inline-start"),u.delete("margin-inline-end"),u.set("box-sizing",["border-box",""])),"text"===u.get("background-clip")?.[0]&&t.classList.add("______background-clip--text"),Ds&&(u.has("font-kerning")||u.set("font-kerning",["normal",""]),"hidden"!==u.get("overflow-x")?.[0]&&"hidden"!==u.get("overflow-y")?.[0]||"ellipsis"!==u.get("text-overflow")?.[0]||e.scrollWidth!==e.clientWidth||u.set("text-overflow",["clip",""]));for(let d=s.length,p=0;p<d;p++)s.removeProperty(s.item(p));return u.forEach((([e,t],n)=>{s.setProperty(n,e,t)})),u}(e,r,n,t);n&&function(e,t){const{backgroundColor:n,width:r,height:o,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),r&&a.setProperty("width",`${r}px`,"important"),o&&a.setProperty("height",`${o}px`,"important"),i)for(const s in i)a[s]=i[s]}(r,t);let i=!1;if(t.isEnable("copyScrollbar")){const t=[o.get("overflow-x")?.[0],o.get("overflow-y")?.[0]];i=t.includes("scroll")||(t.includes("auto")||t.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const c=o.get("text-transform")?.[0],l=vc(o.get("font-family")?.[0]),u=l?e=>{"uppercase"===c?e=e.toUpperCase():"lowercase"===c?e=e.toLowerCase():"capitalize"===c&&(e=e[0].toUpperCase()+e.substring(1)),l.forEach((t=>{let n=a.get(t);n||a.set(t,n=new Set),e.split("").forEach((e=>n.add(e)))}))}:void 0;return function(e,t,n,r,o){const{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:c}=r;function l(n){const a=i.getComputedStyle(e,n);let l=a.getPropertyValue("content");if(!l||"none"===l)return;o?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,"");const u=[mc()],d=Lc(e,n,r);c?.forEach(((e,t)=>{d.delete(t)}));const p=Oc(a,d,r.includeStyleProperties);p.delete("content"),p.delete("-webkit-locale"),"text"===p.get("background-clip")?.[0]&&t.classList.add("______background-clip--text");const h=[`content: '${l}';`];if(p.forEach((([e,t],n)=>{h.push(`${n}: ${e}${t?" !important":""};`)})),1===h.length)return;try{t.className=[t.className,...u].join(" ")}catch(ty){return void r.log.warn("Failed to copyPseudoClass",ty)}const f=h.join("\n ");let g=s.get(f);g||(g=[],s.set(f,g)),g.push(`.${u[0]}${n}`)}a&&i&&(Ac.forEach(l),n&&Mc.forEach(l))}(e,r,i,t,u),function(e,t){(Ys(e)||Zs(e)||tc(e))&&t.setAttribute("value",e.value)}(e,r),Js(e)||await Dc(e,r,t,u),await(s?.(r)),r}const c=e.cloneNode(!1);return await Dc(e,c,t),await(s?.(c)),c}function _c(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(ty){e.log.warn("Failed to destroyContext",ty)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function Fc(e,t){const{url:n,requestType:r="text",responseType:o="text",imageDom:i}=t;let a=n;const{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:p,placeholderImage:h},font:f,workers:g,fontFamilies:m}=e;"image"===r&&(Ns||js)&&e.drawImageCount++;let v=l.get(n);if(!v){p&&p instanceof RegExp&&p.test(a)&&(a+=(/\?/.test(a)?"&":"?")+(new Date).getTime());const t=r.startsWith("font")&&f&&f.minify,y=new Set;if(t){r.split(";")[1].split(",").forEach((e=>{m.has(e)&&m.get(e).forEach((e=>y.add(e)))}))}const b=t&&y.size,w={url:a,timeout:s,responseType:b?"arrayBuffer":o,headers:"image"===r?{accept:c}:void 0,...d};v={type:r,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(u&&"image"===r){const e=await u(n);if(e)return e}return!Ns&&n.startsWith("http")&&g.length?new Promise(((e,t)=>{g[l.size&g.length-1].postMessage({rawUrl:n,...w}),v.resolve=e,v.reject=t})):function(e){const{url:t,timeout:n,responseType:r,...o}=e,i=new AbortController,a=n?setTimeout((()=>i.abort()),n):void 0;return fetch(t,{signal:i.signal,...o}).then((e=>{if(!e.ok)throw new Error("Failed fetch, not 2xx response",{cause:e});switch(r){case"arrayBuffer":return e.arrayBuffer();case"dataUrl":return e.blob().then(hc);default:return e.text()}})).finally((()=>clearTimeout(a)))}(w)})().catch((t=>{if(l.delete(n),"image"===r&&h)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),"string"==typeof h?h:h(i);throw t})),l.set(n,v)}return v.response}async function Bc(e,t,n,r){if(!Uc(e))return e;for(const[i,a]of function(e,t){const n=[];return e.replace(Hc,((e,r,o)=>(n.push([o,sc(o,t)]),e))),n.filter((([e])=>!ac(e)))}(e,t))try{const t=await Fc(n,{url:a,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(qc(i),`$1${t}$3`)}catch(o){n.log.warn("Failed to fetch css data url",i,o)}return e}function Uc(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}const Hc=/url\((['"]?)([^'"]+?)\1\)/g;function qc(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}const zc=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function Wc(e,t){const{tasks:n}=t;Hs(e)&&((Xs(e)||zs(e))&&n.push(...function(e,t){if(Xs(e)){const n=e.currentSrc||e.src;if(!ac(n))return[Fc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.srcset="",e.dataset.originalSrc=n,e.src=t||"")}))];(Ns||js)&&t.drawImageCount++}else if(qs(e)&&!ac(e.href.baseVal)){const n=e.href.baseVal;return[Fc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||"")}))]}return[]}(e,t)),Ws(e)&&n.push(...function(e,t){const{ownerDocument:n,svgDefsElement:r}=t,o=e.getAttribute("href")??e.getAttribute("xlink:href");if(!o)return[];const[i,a]=o.split("#");if(a){const o=`#${a}`,s=t.shadowRoots.reduce(((e,t)=>e??t.querySelector(`svg ${o}`)),n?.querySelector(`svg ${o}`));if(i&&e.setAttribute("href",o),r?.querySelector(o))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(i)return[Fc(t,{url:i,responseType:"text"}).then((e=>{r?.insertAdjacentHTML("beforeend",e)}))]}return[]}(e,t))),Gs(e)&&n.push(...function(e,t){return zc.map((n=>{const r=e.getPropertyValue(n);return r&&"none"!==r?((Ns||js)&&t.drawImageCount++,Bc(r,null,t,!0).then((t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))):null})).filter(Boolean)}(e.style,t)),e.childNodes.forEach((e=>{Wc(e,t)}))}async function Gc(e,t){const{ownerDocument:n,svgStyleElement:r,fontFamilies:o,fontCssTexts:i,tasks:a,font:s}=t;if(n&&r&&o.size)if(s&&s.cssText){const e=Kc(s.cssText,t);r.appendChild(n.createTextNode(`${e}\n`))}else{const e=Array.from(n.styleSheets).filter((e=>{try{return"cssRules"in e&&Boolean(e.cssRules.length)}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}})),s=n.implementation.createHTMLDocument(""),c=s.createElement("style");s.head.appendChild(c);const l=c.sheet;await Promise.all(e.flatMap((e=>Array.from(e.cssRules).map((async e=>{if(Bs(e)){const r=e.href;let o="";try{o=await Fc(t,{url:r,requestType:"text",responseType:"text"})}catch(n){t.log.warn(`Error fetch remote css import from ${r}`,n)}const i=o.replace(Hc,((e,t,n)=>e.replace(n,sc(n,r))));for(const e of function(e){if(null==e)return[];const t=[];let n=e.replace(Vc,"");for(;;){const e=$c.exec(n);if(!e)break;t.push(e[0])}n=n.replace($c,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let e=r.exec(n);if(e)o.lastIndex=r.lastIndex;else{if(e=o.exec(n),!e)break;r.lastIndex=o.lastIndex}t.push(e[0])}return t}(i))try{l.insertRule(e,l.cssRules.length)}catch(n){t.log.warn("Error inserting rule from remote css import",{rule:e,error:n})}}}))))),l.cssRules.length&&e.push(l);const u=[];e.forEach((e=>{Yc(e.cssRules,u)})),u.filter((e=>Fs(e)&&Uc(e.style.getPropertyValue("src"))&&vc(e.style.getPropertyValue("font-family"))?.some((e=>o.has(e))))).forEach((e=>{const o=e,s=i.get(o.cssText);s?r.appendChild(n.createTextNode(`${s}\n`)):a.push(Bc(o.cssText,o.parentStyleSheet?o.parentStyleSheet.href:null,t).then((e=>{e=Kc(e,t),i.set(o.cssText,e),r.appendChild(n.createTextNode(`${e}\n`))})))}))}}const Vc=/(\/\*[\s\S]*?\*\/)/g,$c=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;const Xc=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Jc=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Kc(e,t){const{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(Jc,(e=>{for(;;){const[t,,n]=Xc.exec(e)||[];if(!n)return"";if(n===r)return`src: ${t};`}})):e}function Yc(e,t=[]){for(const n of Array.from(e))Us(n)?t.push(...Yc(n.cssRules)):"cssRules"in n?Yc(n.cssRules,t):t.push(n);return t}const Zc=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;async function Qc(e,t){const n=await wc(e,t);if(Hs(n.node)&&qs(n.node)&&!function(e){return Zc.test(e.innerHTML)}(n.node))return n.node;const{ownerDocument:r,log:o,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:p,onEmbedNode:h,onCreateForeignObjectSvg:f}=n;o.time("clone node");const g=await jc(n.node,n,!0);if(a&&r){let e="";c.forEach(((t,n)=>{e+=`${t.join(",\n")} {\n ${n}\n}\n`})),a.appendChild(r.createTextNode(e))}o.timeEnd("clone node"),await(p?.(g)),!1!==l&&Hs(g)&&(o.time("embed web font"),await Gc(0,n),o.timeEnd("embed web font")),o.time("embed node"),Wc(g,n);const m=i.length;let v=0;u?.(v,m),await Promise.all([...Array.from({length:4})].map((async()=>{for(;;){const t=i.pop();if(!t)break;try{await t}catch(e){n.log.warn("Failed to run task",e)}u?.(++v,m)}}))),o.timeEnd("embed node"),await(h?.(g));const y=function(e,t){const{width:n,height:r}=t,o=uc(n,r,e.ownerDocument),i=o.ownerDocument.createElementNS(o.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),o.appendChild(i),o}(g,n);return s&&y.insertBefore(s,y.children[0]),a&&y.insertBefore(a,y.children[0]),d&&_c(n),await(f?.(y)),y}async function el(e,t){const n=await wc(e,t),r=await Qc(n),o=dc(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=xc(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(lc,"defs"),n.svgStyles.clear());const i=fc(o,r.ownerDocument);return await Sc(i,n)}const tl=2560,nl="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",rl=[".gleap-frame-container",".bb-feedback-button",".gleap-notification-container",".gleap-chatbar",".gleap-capture-root",".gleap-image-view",".bb-capture-editor",".gleap-b",".gleap-modal-wrapper",".gleap-tooltip",".gleap-tour-popover",".gleap-tour-overlay","#copilot-pointer-container","#copilot-joined-container",".gleap-audio-unmute-modal-overlay",".gleap-admin-frame-container",".gleap-admin-collapse-ui",".click-wave"].join(", "),ol=["stripe.com","stripe.network","braintreegateway.com","braintree-api.com","paypal.com","adyen.com","adyenpayments.com","checkout.com","squareup.com","squareupsandbox.com","recurly.com","chargebee.com","paddle.com","mollie.com","klarna.com","worldpay.com","authorize.net","razorpay.com","2checkout.com","cybersource.com","spreedly.com","gocardless.com","payu.com","mercadopago.com","paystack.co","flutterwave.com"],il=new RegExp("(^|\\.)("+ol.map((e=>e.replace(/\./g,"\\."))).join("|")+")$","i"),al=["card","payment","cvc","cvv","security code","expir","iban"],sl=new RegExp(al.join("|"),"i"),cl=()=>{const e=['iframe[allow*="payment" i]'];return al.forEach((t=>{e.push('iframe[title*="'+t+'" i]','iframe[name*="'+t+'" i]')})),ol.forEach((t=>{e.push('iframe[src*="//'+t+'" i]','iframe[src*=".'+t+'" i]')})),e.join(", ")},ll=e=>new Promise((t=>setTimeout(t,e))),ul=(e,t,n)=>new Promise(((r,o)=>{const i=setTimeout((()=>o(new Error(n||"timeout"))),t);e.then((e=>{clearTimeout(i),r(e)}),(e=>{clearTimeout(i),o(e)}))})),dl=e=>{try{if("undefined"!=typeof CSS&&"function"==typeof CSS.escape)return CSS.escape(e)}catch(t){}return String(e).replace(/[^a-zA-Z0-9_-]/g,(e=>"\\"+e))},pl=e=>{if("string"!=typeof e||0===e.trim().length)return null;try{return document.createDocumentFragment().querySelector(e),e.trim()}catch(t){return null}},hl=(e,t)=>{const n=e||{},r=[".rr-block, .gl-block, .rr-mask, .gl-mask"];return[n.blockSelector,n.maskTextSelector].concat(Array.isArray(t)?t:[]).forEach((e=>{const t=pl(e);t&&r.push(t)})),[n.blockClass,n.maskTextClass].forEach((e=>{if("string"==typeof e&&e.length>0){const t=pl("."+dl(e));t&&r.push(t)}})),r},fl=e=>{const t=e||{};return[t.blockClass,t.maskTextClass].filter((e=>e&&"function"==typeof e.test))},gl=(e,t)=>{if(!t.length||!e.classList)return!1;for(let n=0;n<e.classList.length;n++)for(let r=0;r<t.length;r++)if(t[r].test(e.classList[n]))return!0;return!1},ml=e=>{try{return!!(e&&e.matches&&e.matches(rl))}catch(t){return!1}},vl=e=>{try{return!!(e&&e.closest&&e.closest(rl))}catch(t){return!1}},yl=e=>{try{if(-1!==(e.getAttribute("allow")||"").toLowerCase().indexOf("payment"))return!0;const t=(e.getAttribute("title")||"")+" "+(e.getAttribute("name")||"");if(sl.test(t))return!0;const n=e.getAttribute("src");if(n)return il.test(new URL(n,window.location.href).hostname)}catch(t){}return!1},bl=e=>{let t=null;try{t=e.getBoundingClientRect()}catch(n){}try{const n=(e.ownerDocument||document).createRange();n.selectNodeContents(e),t=((e,t)=>{if(!e||e.width<=0||e.height<=0)return t;if(!t||t.width<=0||t.height<=0)return e;const n=Math.min(e.left,t.left),r=Math.min(e.top,t.top);return{left:n,top:r,width:Math.max(e.left+e.width,t.left+t.width)-n,height:Math.max(e.top+e.height,t.top+t.height)-r}})(t,n.getBoundingClientRect())}catch(n){}return t},wl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[],n={},r=e.privacyOptions||{},o=((e,t)=>hl(e,t).join(", "))(r,e.maskSelectors),i=fl(r),a=(e,r)=>{if(!(e&&e.width>0&&e.height>0))return;let o=e.left+r.x,i=e.top+r.y,a=o+e.width,s=i+e.height;r.clip&&(o=Math.max(o,r.clip.left),i=Math.max(i,r.clip.top),a=Math.min(a,r.clip.right),s=Math.min(s,r.clip.bottom));const c=[o,i,a,s].join(",");a>o&&s>i&&!n[c]&&(n[c]=!0,t.push({x:o,y:i,width:a-o,height:s-i}))},s=(e,t,n)=>{if(!e||n>8)return;const c=(t,n)=>{let r=[];try{r=e.querySelectorAll(t)}catch(o){}for(let e=0;e<r.length;e++)vl(r[e])||n(r[e])};c(o,(e=>a(bl(e),t))),c("input, textarea, select",(e=>{((e,t)=>{try{return!!Ma(e,t)}catch(n){return!0}})(e,r)&&a(e.getBoundingClientRect(),t)})),c("iframe, frame",(e=>{const r=e.getBoundingClientRect();if(yl(e))return void a(r,t);let o=null;try{o=e.contentDocument}catch(i){}if(o&&o.documentElement&&r.width>0&&r.height>0){const i=t.x+r.left+(e.clientLeft||0),a=t.y+r.top+(e.clientTop||0);let c={left:t.x+r.left,top:t.y+r.top,right:t.x+r.right,bottom:t.y+r.bottom};t.clip&&(c={left:Math.max(c.left,t.clip.left),top:Math.max(c.top,t.clip.top),right:Math.min(c.right,t.clip.right),bottom:Math.min(c.bottom,t.clip.bottom)}),s(o,{x:i,y:a,clip:c},n+1)}}));try{const r=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>ml(e)?2:1});let o=r.nextNode();for(;o;)o.shadowRoot&&s(o.shadowRoot,t,n+1),i.length&&gl(o,i)&&a(bl(o),t),o=r.nextNode()}catch(l){}};return s(document,{x:0,y:0,clip:null},0),t},kl=(e,t)=>{const n=document.createElement("canvas");return n.width=Math.max(1,Math.round(e)),n.height=Math.max(1,Math.round(t)),n},xl=e=>{try{e&&(e.width=0,e.height=0)}catch(t){}},Sl=e=>{try{const t=48,n=kl(t,t),r=n.getContext("2d");r.drawImage(e,0,0,t,t);const o=r.getImageData(0,0,t,t).data;xl(n);let i=!0,a=!0;for(let e=0;e<o.length;e+=4)o[e+3]>0&&(i=!1,(o[e]>12||o[e+1]>12||o[e+2]>12)&&(a=!1));return i?"transparent":a?"black":"content"}catch(t){return"content"}},Cl=e=>{let{canvas:t,scaleX:n,scaleY:r,rects:o,background:i}=e;const a=Math.max(t.width,t.height),s=a>tl?tl/a:1,c=kl(t.width*s,t.height*s),l=c.getContext("2d");l.fillStyle=i||"#ffffff",l.fillRect(0,0,c.width,c.height),l.imageSmoothingEnabled=!0;try{l.imageSmoothingQuality="high"}catch(d){}l.drawImage(t,0,0,c.width,c.height),((e,t,n,r)=>{e.save(),e.fillStyle="#000000";for(let o=0;o<t.length;o++){const i=t[o],a=Math.floor(i.x*n)-1,s=Math.floor(i.y*r)-1,c=Math.ceil(i.width*n)+2,l=Math.ceil(i.height*r)+2;e.fillRect(a,s,c,l)}e.restore()})(l,o,n*s,r*s);const u={dataUrl:c.toDataURL("image/jpeg",.85),width:c.width,height:c.height};return xl(c),u},El=e=>{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}},Il=(e,t)=>("function"!=typeof ImageCapture?Promise.resolve(null):ul(new ImageCapture(e).grabFrame(),3e3,"grab-timeout").then((e=>e&&e.width>0?{source:e,width:e.width,height:e.height,release:()=>e.close&&e.close()}:null),(()=>null))).then((t=>t||(()=>{if("function"!=typeof MediaStreamTrackProcessor)return Promise.resolve(null);let t=null;const n=()=>{try{t&&t.cancel()}catch(e){}};try{t=new MediaStreamTrackProcessor({track:e}).readable.getReader()}catch(r){return Promise.resolve(null)}return ul(t.read(),3e3,"read-timeout").then((e=>{n();const t=e&&e.value;return t?{source:t,width:t.displayWidth||t.codedWidth,height:t.displayHeight||t.codedHeight,release:()=>t.close()}:null}),(()=>(n(),null)))})())).then((e=>e||(()=>{const e=document.createElement("video");e.muted=!0,e.playsInline=!0,e.srcObject=t;const n=()=>{try{e.pause(),e.srcObject=null}catch(t){}},r=new Promise((t=>{"function"==typeof e.requestVideoFrameCallback?e.requestVideoFrameCallback((()=>t())):e.addEventListener("loadeddata",(()=>setTimeout(t,60)),{once:!0})}));return ul(Promise.resolve(e.play()),3e3,"play-timeout").then((()=>ul(r,3e3,"frame-timeout"))).then((()=>({source:e,width:e.videoWidth,height:e.videoHeight,release:n})),(e=>{throw n(),e}))})())),Tl=(e,t)=>{let{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=t;const a=e&&e.getVideoTracks?e.getVideoTracks()[0]:null;let s=!1;const c=()=>{s=!0,El(e),n(!1)};if(!a)return c(),Promise.reject(new Error("no-video-track"));let l={};try{l=a.getSettings?a.getSettings():{}}catch(d){}if(l.displaySurface&&"browser"!==l.displaySurface)return c(),Promise.reject(new Error("not-this-tab"));const u=t=>{if(s)throw new Error("tab-timeout");if(t>=3)throw new Error("no-usable-frame");if("ended"===a.readyState)throw new Error("track-ended");const n=wl({privacyOptions:r,maskSelectors:o});return Il(a,e).then((e=>{const i=window.innerWidth,a=window.innerHeight,c=(e=>{const t=window.visualViewport,n=t&&t.scale?t.scale:1;return t&&(1!==n||t.offsetLeft||t.offsetTop)?e.map((e=>({x:(e.x-t.offsetLeft)*n,y:(e.y-t.offsetTop)*n,width:e.width*n,height:e.height*n}))):e})(n.concat(wl({privacyOptions:r,maskSelectors:o})));let l=null;try{if(!s&&e&&e.width>0&&e.height>0){const n=i/a;Math.abs(e.width/e.height-n)/n<=.04&&(l=kl(e.width,e.height),l.getContext("2d").drawImage(e.source,0,0,e.width,e.height),t<2&&"content"!==Sl(l)&&(xl(l),l=null))}}finally{try{e&&e.release()}catch(d){}}if(s)throw xl(l),new Error("tab-timeout");return l?{canvas:l,scaleX:l.width/i,scaleY:l.height/a,rects:c,background:"#000000",method:"tab"}:ll(150).then((()=>u(t+1)))}))};return n(!0),new Promise(((e,t)=>{let n=null;const r=(r,o)=>{s?o&&xl(o.canvas):(clearInterval(n),c(),r?t(r):e(o))};n=setInterval((()=>{try{i&&!i()&&r(new Error("aborted"))}catch(d){}}),200),ul(new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(d){n()}})).then((()=>ll(120))).then((()=>u(0))),15e3,"tab-timeout").then((e=>r(null,e)),(e=>r(e)))}))},Ll=200,Ol=["background-image","border-image-source","mask-image","-webkit-mask-image","list-style-image"],Al=(e,t)=>(e.width>0||e.height>0)&&e.bottom>t.top&&e.top<t.bottom&&e.right>t.left&&e.left<t.right,Ml=e=>{const t=[],n=e=>{for(let n=0;n<e.length;n++)t.push(e[n])};try{e.shadowRoot&&n(e.shadowRoot.children),n(e.children)}catch(r){}return t},Rl=e=>new Promise(((t,n)=>{const r=new Set,o={top:-200,left:-200,bottom:window.innerHeight+Ll,right:window.innerWidth+Ll},i=document.documentElement,a=[{element:i,children:Ml(i),index:0,visible:!0,sized:!1}],s=()=>{try{if(e())return void n(new Error("aborted"));const c=es();for(;a.length;){const e=a[a.length-1];if(e.index<e.children.length){const t=e.children[e.index];e.index+=1;let n=null;try{n=t.getBoundingClientRect()}catch(i){}a.push({element:t,children:Ml(t),index:0,visible:!!n&&Al(n,o),sized:!!n&&n.width>0&&n.height>0})}else a.pop(),a.length&&(e.visible?a[a.length-1].visible=!0:e.sized&&r.add(e.element));if(a.length&&es()-c>25)return void ts().then(s)}t(r)}catch(c){n(c)}};s()})),Pl={block:!0,"flow-root":!0,"list-item":!0,flex:!0,grid:!0,table:!0},Dl={flex:!0,"inline-flex":!0,grid:!0,"inline-grid":!0},Nl=(e,t)=>{let{offscreen:n,masked:r}=t,o=null;if(!n&&!r){try{const t=e.videoWidth,n=e.videoHeight;if(e.readyState>=2&&t>0&&n>0){const r=Math.min(1,1280/Math.max(t,n)),i=kl(t*r,n*r);try{i.getContext("2d").drawImage(e,0,0,i.width,i.height),o=i.toDataURL("image/jpeg",.85)}finally{xl(i)}}}catch(a){o=null}if(!o)try{o=e.poster||null}catch(a){}}const i=document.createElement(o?"img":"div");try{const t=window.getComputedStyle(e);for(let e=0;e<t.length;e++){const n=t[e];"visibility"!==n&&i.style.setProperty(n,t.getPropertyValue(n))}}catch(a){}return o?(i.setAttribute("src",o),i.setAttribute("alt","")):i.style.setProperty("background-color","#1f2430"),r&&i.style.setProperty("visibility","hidden","important"),i},jl=(e,t,n,r,o)=>{const i=[e],a=(Array.isArray(n)?n:[]).map(pl).filter(Boolean).join(", "),s=document.scrollingElement||document.documentElement,c={broken:!1,offsetX:0,offsetY:0,lastYield:es(),canYield:!1,elements:0,offscreen:null},l=new Map,u=new Map,d=new Set,p=e=>{try{return Oa(e,t)||La(e,t)||!!a&&e.matches(a)}catch(n){return!1}},h=e=>l.set(e,(l.get(e)||0)+1),f=e=>e.style&&e.style.setProperty("visibility","hidden","important"),g=(e,t)=>{if(e===document.documentElement||e===s)return;const n=e.scrollTop||0,r=e.scrollLeft||0;if(!n&&!r)return;let o=null;try{o=e.getBoundingClientRect()}catch(a){}if(o&&(e=>Math.abs(e.left)<=2&&Math.abs(e.top)<=2&&Math.abs(e.right-window.innerWidth)<=20&&Math.abs(e.bottom-window.innerHeight)<=20)(o))return c.offsetX+=r,c.offsetY+=n,void t.style.setProperty("overflow","visible","important");const i=t.children||[];for(let s=0;s<i.length;s++){const e=i[s];e.style&&"fixed"!==e.style.position&&(e.style.transform="translate("+-r+"px, "+-n+"px) "+(e.style.transform||""))}};return{filter:e=>{o();const t=i[i.length-1];if(d.has(t))return!1;if(!e||1!==e.nodeType)return h(t),!0;const n=String(e.tagName).toUpperCase();if("NOSCRIPT"===n||"TEMPLATE"===n)return!1;if(ml(e)||"string"==typeof e.id&&0===e.id.indexOf("__SANDBOX__"))return!1;if("VIDEO"===n){const n=u.get(t)||[];return n.push({index:l.get(t)||0,placeholder:Nl(e,{offscreen:!!c.offscreen&&c.offscreen.has(e),masked:p(e)})}),u.set(t,n),!1}if(c.elements+=1,c.elements>1e4)throw new Error("render-budget");return h(t),i.push(e),"IFRAME"!==n&&"FRAME"!==n||!(e=>{try{return!(!e.contentDocument||!e.contentDocument.documentElement)}catch(t){return!1}})(e)||i.push(e),c.offscreen&&c.offscreen.has(e)&&(e=>{try{if(e.ownerDocument!==document||e===document.body)return!1;const t=window.getComputedStyle(e);if(!Pl[t.display])return!1;if("block"!==t.display&&"list-item"!==t.display)return!0;const n=e=>"hidden"===e||"scroll"===e||"auto"===e;if(n(t.overflowX)||n(t.overflowY)||"none"!==t.float||"absolute"===t.position||"fixed"===t.position)return!0;const r=e.parentElement;if(r&&Dl[window.getComputedStyle(r).display])return!0;const o=e=>parseFloat(t["padding"+e])>0||parseFloat(t["border"+e+"Width"])>0;return o("Top")&&o("Bottom")}catch(t){return!1}})(e)&&d.add(e),!0},onCloneEachNode:e=>{if(o(),!e||1!==e.nodeType)return;const n=i.pop();if(n&&((e,t)=>{const n=String(e.nodeName).toUpperCase(),r=String(t.nodeName).toUpperCase();return n===r||("IFRAME"===n||"FRAME"===n?"HTML"===r:!("VIDEO"!==n&&"CANVAS"!==n||"IMG"!==r&&"CANVAS"!==r&&"VIDEO"!==r))})(n,e)||(c.broken=!0),!c.broken)try{((e,t)=>{const n=u.get(e);n&&(u.delete(e),n.forEach(((e,n)=>{t.insertBefore(e.placeholder,t.childNodes[e.index+n]||null)})))})(n,e),((e,n)=>{const r=String(e.tagName).toUpperCase();if("INPUT"===r||"TEXTAREA"===r||"SELECT"===r){let o=null;try{o=Ma(e,t)}catch(a){o=()=>""}if(o){const t=o(e.value);if(n.setAttribute("value","string"==typeof t?t:""),"TEXTAREA"===r&&(n.textContent="string"==typeof t?t:""),"SELECT"===r){const e=n.querySelectorAll("option[selected]");for(let t=0;t<e.length;t++)e[t].removeAttribute("selected")}f(n)}return}const o="IFRAME"===r||"FRAME"===r;let i=!1;try{i=p(e)||o&&yl(e)||e.matches("gleap-checklist, .gleap-tooltip-anchor")}catch(a){}if(i&&f(n),o&&"HTML"===String(n.nodeName).toUpperCase())try{const t=window.getComputedStyle(e).display;n.style.setProperty("display","inline"===t?"inline-block":t,"important"),n.style.setProperty("overflow","hidden","important")}catch(a){}})(n,e),g(n,e),c.offscreen&&c.offscreen.has(n)&&(e=>{e.style&&Ol.forEach((t=>e.style.setProperty(t,"none","important"))),"IMG"===String(e.nodeName).toUpperCase()&&(e.removeAttribute("srcset"),e.setAttribute("src",nl))})(e)}catch(r){}return l.delete(n),c.canYield&&es()-c.lastYield>40?(c.lastYield=es(),ts()):void 0},onCloneNode:e=>{!c.broken&&(c.offsetX||c.offsetY)&&e&&e.style&&(e.style.top=-(r.y+c.offsetY)+"px",e.style.left=-(r.x+c.offsetX)+"px")},state:c}},_l={contentWindow:null,remove:()=>{}},Fl=()=>{try{const e=window.innerHeight,t=document.images;for(let n=0;n<t.length;n++){const r=t[n];if(r.complete)continue;const o=r.getBoundingClientRect();if(o.width>0&&o.height>0&&o.bottom>0&&o.top<e)return!0}}catch(e){}return!1},Bl=()=>{try{const e=-200,t=window.innerHeight+Ll,n=new Set,r=new Set,o=document.images;for(let a=0;a<o.length;a++){const i=o[a].currentSrc||o[a].src;if(!i)continue;const s=o[a].getBoundingClientRect();s.top>t||s.bottom<e?n.add(i):r.add(i)}const i=document.querySelectorAll("video[poster]");for(let a=0;a<i.length;a++){const n=i[a].getBoundingClientRect();n.top>t||n.bottom<e||r.add(i[a].poster)}return r.forEach((e=>n.delete(e))),0===n.size?null:e=>Promise.resolve(!!n.has(e)&&nl)}catch(e){return null}};let Ul=0,Hl=!1;const ql=e=>{let{privacyOptions:t,maskSelectors:n,isActive:r}=e;return new Promise(((e,o)=>{const i=document.documentElement,a=Math.max(1,i.clientWidth||window.innerWidth),s=Math.max(1,i.clientHeight||window.innerHeight),c=Math.min(Math.max(window.devicePixelRatio||1,1),tl/Math.max(a,s)),l={x:window.scrollX||0,y:window.scrollY||0},u=wl({privacyOptions:t,maskSelectors:n}),d=(()=>{const e=e=>e&&"transparent"!==e&&!/rgba\(\s*0,\s*0,\s*0,\s*0\s*\)/.test(e);try{const t=window.getComputedStyle(document.documentElement).backgroundColor;if(e(t))return t;const n=document.body?window.getComputedStyle(document.body).backgroundColor:null;if(e(n))return n}catch(t){}return"#ffffff"})();let p=null;const h=()=>(p||!r||r()||(p="aborted"),!!p),f=()=>{if(h())throw new Error(p)},g=jl(i,t,n,l,f),m=(()=>{let e=null;try{e=Cm.getInstance(),0===Ul&&(Hl=!!e.stopped,e.setStopped(!0)),Ul+=1}catch(n){return()=>{}}let t=!1;return()=>{if(!t&&(t=!0,Ul=Math.max(0,Ul-1),0===Ul))try{e.setStopped(Hl)}catch(n){}}})();let v=null,y=null,b=!1,w=null,k=null;const x=(t,n)=>{b?n&&xl(n.canvas):(b=!0,(()=>{if(clearTimeout(w),clearInterval(k),v){try{_c(v)}catch(e){}v=null}if(y){try{y.remove()}catch(e){}y=null}m()})(),t?o(t):e(n))};w=setTimeout((()=>{try{p=p||"render-timeout",x(new Error("render-timeout"))}catch(e){}}),1e4),k=setInterval((()=>{try{h()&&x(new Error(p))}catch(e){}}),200),Promise.all([Rl(h),new Promise((e=>{const t=document.createElement("iframe");t.id="__SANDBOX__gleap",t.width="0",t.height="0",t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.style.visibility="hidden",t.style.position="fixed";let n=!1;try{t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',n=!0}catch(c){}const r=()=>{try{const e=t.contentDocument;return!(!e||!e.body||"complete"!==e.readyState||n&&"about:srcdoc"!==t.contentWindow.location.href)}catch(c){return!1}};let o=!1,i=null;const a=n=>{if(!o){if(o=!0,clearTimeout(i),t.removeEventListener("load",s),!n)try{t.remove()}catch(c){}e(n?t:null)}},s=()=>{r()&&a(!0)};t.addEventListener("load",s),i=setTimeout((()=>a(r())),1500);try{(document.body||document.documentElement).appendChild(t)}catch(c){return void a(!1)}n||a(r())}))]).then((e=>{let[t,n]=e;return b?(n&&n.remove(),null):(y=n,f(),g.state.offscreen=t,kc(i,{width:a,height:s,scale:c,backgroundColor:null,filter:g.filter,onCloneEachNode:g.onCloneEachNode,onCloneNode:g.onCloneNode,onCreateForeignObjectSvg:()=>{v&&(v.drawImageCount=Math.min(v.drawImageCount||0,2))},style:{position:"relative",top:-l.y+"px",left:-l.x+"px",overflow:"visible"},features:{restoreScrollPosition:!1},fetchFn:Bl(),timeout:Fl()?3e3:50}))})).then((e=>{if(!e)return null;if(b){try{_c(e)}catch(t){}return null}return v=e,v.timeout=8e3,v.sandbox=y||_l,y=null,g.state.canYield=!0,f(),el(v)})).then((e=>{if(e){if(!b)return"transparent"===Sl(e)?(xl(e),void x(new Error("render-empty"))):void x(null,{canvas:e,scaleX:e.width/a,scaleY:e.height/s,rects:u,background:d,method:"dom"});xl(e)}})).catch((e=>x(e)))}))};function zl(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wl={barScreenshotHint:"Go to the screen you want to show, then tap Capture.",barCapture:"Capture",barCancel:"Cancel",barRecordHint:"Go to where the issue happens, then start recording.",barStart:"Start",barStop:"Stop",barRecording:"Recording",barDragHint:"Drag to move",microphone:"Microphone",previewTitle:"Send this recording?",previewSend:"Send",previewRetake:"Retake",uploading:"Uploading…",recordingInterrupted:"Recording stopped because the page changed.",recordAgain:"Record again",permissionDenied:"Screen capture was blocked. You can upload a file instead.",notSupported:"Screen capture isn't available here. You can upload a file instead.",failed:"That didn't work. Please try again or upload a file.",recordPage:"Record this page",recordPageHint:"Screen sharing didn't start. You can record this page instead."},Gl=e=>{const t=Object.assign({},Wl);return e&&"object"==typeof e&&Object.keys(Wl).forEach((n=>{const r=e[n];"string"==typeof r&&r.trim().length>0&&(t[n]=r.slice(0,300))})),t},Vl=e=>{const t=Math.max(0,Math.floor(e||0)),n=t%60;return Math.floor(t/60)+":"+(n<10?"0":"")+n},$l=':host{all:initial}.bar,.overlay{font:14px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:#fff;letter-spacing:normal;text-align:start;-webkit-font-smoothing:antialiased;box-sizing:border-box;pointer-events:auto;animation:in .18s ease-out both}.bar *,.overlay *{box-sizing:border-box}.bar{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);display:flex;align-items:center;gap:8px;width:max-content;max-width:min(680px,calc(100vw - 32px));padding:8px;border-radius:28px;background:rgba(22,22,26,.97);box-shadow:0 12px 40px rgba(0,0,0,.3),0 0 0 1px rgba(255,255,255,.1)}.moved{transform:none}.grip{flex:none;align-self:stretch;width:18px;display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.45);cursor:grab;touch-action:none}.hint{flex:1 1 auto;min-width:0;padding:0 6px}.rec{display:flex;align-items:center;gap:8px;white-space:nowrap}.dot{flex:none;width:10px;height:10px;border-radius:50%;background:#ff4d4f;animation:pulse 1.4s ease-in-out infinite}.timer{font-variant-numeric:tabular-nums;color:rgba(255,255,255,.85)}.actions{flex:none;display:flex;align-items:center;gap:8px}button{-webkit-appearance:none;appearance:none;margin:0;border:0;border-radius:999px;min-height:36px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font:inherit;font-weight:600;white-space:nowrap;cursor:pointer;color:#fff;background:rgba(255,255,255,.12)}button:hover{background:rgba(255,255,255,.2)}button:focus-visible{outline:2px solid #fff;outline-offset:2px}button[disabled]{opacity:.55;cursor:default}button[aria-disabled=true]{cursor:default}.primary,.primary:hover{background:var(--primary);color:var(--on-primary)}.stop,.stop:hover{background:#e5484d;color:#fff}.icon{width:36px;padding:0;border-radius:50%}.icon[aria-pressed=false]{color:rgba(255,255,255,.55)}.spin{flex:none;width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}svg{flex:none;width:18px;height:18px}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(8,8,10,.62)}.card{width:100%;max-width:760px;max-height:100%;display:flex;flex-direction:column;overflow:hidden;border-radius:16px;background:#16161a;box-shadow:0 24px 60px rgba(0,0,0,.45),0 0 0 1px rgba(255,255,255,.1)}.title{padding:16px 20px 12px;font-size:16px;font-weight:600}.media{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#000;color:rgba(255,255,255,.85)}.media video{display:block;width:100%;max-height:62vh;background:#000;object-fit:contain}.summary{padding:32px 20px;background:rgba(255,255,255,.04)}.summary>svg{width:40px;height:40px;opacity:.8}.facts{display:flex;gap:14px;font-variant-numeric:tabular-nums}.facts span{display:inline-flex;align-items:center;gap:6px}.footer{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px 16px 16px}.status{flex:1 1 200px;min-width:0;color:rgba(255,255,255,.8)}.error{color:#ff9a9d}.progress{height:4px;margin-top:8px;overflow:hidden;border-radius:2px;background:rgba(255,255,255,.15)}.progress div{height:100%;width:0;background:var(--primary);transition:width .2s}.footer .actions{margin-left:auto}@keyframes in{from{opacity:0}}@keyframes pulse{50%{opacity:.3}}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.bar,.overlay,.dot{animation:none}.spin{animation-duration:2.4s}.progress div{transition:none}}@media (max-width:600px){.bar,.moved{left:0!important;right:0;top:auto!important;bottom:0;transform:none;width:auto;max-width:none;flex-wrap:wrap;border-radius:16px 16px 0 0;padding:12px calc(12px + env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) calc(12px + env(safe-area-inset-left,0px))}.grip{display:none}.hint{flex:1 1 100%;padding:2px 4px 6px}.recording .hint{flex:1 1 auto}.actions{flex:1 1 100%}.recording .actions{flex:0 0 auto}.actions button:not(.icon){flex:1 1 0}button{min-height:44px}.icon{width:44px}.overlay{padding:0;align-items:flex-end}.card{max-width:none;border-radius:16px 16px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}.media video{max-height:55vh}}',Xl={grip:["M9 6h0M15 6h0M9 12h0M15 12h0M9 18h0M15 18h0","dots"],camera:["M4 8h3l1.6-2.4a1.5 1.5 0 0 1 1.3-.6h4.2a1.5 1.5 0 0 1 1.3.6L17 8h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1ZM12 16.4a3.4 3.4 0 1 0 0-6.8 3.4 3.4 0 0 0 0 6.8Z"],record:["M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"],stop:["M8 7h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Z","fill"],mic:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21"],micOff:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M4 4l16 16"],page:["M6.5 3h11A2.5 2.5 0 0 1 20 5.5v13a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 18.5v-13A2.5 2.5 0 0 1 6.5 3ZM8 8h8M8 12h8M8 16h5"],clock:["M12 20.5a8.5 8.5 0 1 0 0-17 8.5 8.5 0 0 0 0 17ZM12 7.5V12l3 2"],pointer:["M6 3.5 18.5 12l-5.6 1.3-2.7 5.2Z"],send:["M14.54 21.69a.5.5 0 0 0 .94-.03l6.5-19a.5.5 0 0 0-.64-.63l-19 6.5a.5.5 0 0 0-.02.93l7.93 3.18a2 2 0 0 1 1.11 1.11zM21.85 2.15l-10.94 10.94"]},Jl="http://www.w3.org/2000/svg",Kl=e=>{const[t,n]=Xl[e],r=document.createElementNS(Jl,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true");const o=document.createElementNS(Jl,"path");return o.setAttribute("d",t),"fill"===n?o.setAttribute("fill","currentColor"):(o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width",n?"3.2":"1.8"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),r.appendChild(o),r},Yl=(e,t,n)=>{const r=document.createElement(e);return t&&(r.className=t),(n||[]).forEach((e=>{null!=e&&r.appendChild("string"==typeof e?document.createTextNode(e):e)})),r};class Zl{constructor(e){let{labels:t,primaryColor:n,rtl:r,onAction:o}=e;zl(this,"host",null),zl(this,"root",null),zl(this,"timer",null),zl(this,"maxSec",0),zl(this,"micButton",null),zl(this,"progress",null),zl(this,"status",null),zl(this,"previewButtons",null),zl(this,"previewUrl",null),zl(this,"position",null),zl(this,"cleanupDrag",null),zl(this,"autoFocus",!0),this.labels=Gl(t),this.onAction=o,this.rtl=!!r,this.primaryColor=/^#[0-9a-f]{6}$/i.test(n||"")?n:"#485BFF"}mount(){if(!this.host){const t=document.createElement("div");t.className="gleap-capture-root rr-block gl-block";const n={position:"fixed",top:"0",left:"0",width:"0",height:"0",overflow:"visible","z-index":"2147483647",display:"block",margin:"0",padding:"0",border:"0",transform:"none",filter:"none","pointer-events":"none"};Object.keys(n).forEach((e=>t.style.setProperty(e,n[e],"important")));const r=t.attachShadow({mode:"open"});let o=!1;try{if("function"==typeof CSSStyleSheet&&"adoptedStyleSheets"in r){const e=new CSSStyleSheet;e.replaceSync($l),r.adoptedStyleSheets=[e],o=!0}}catch(e){}if(!o){const e=document.createElement("style");W(e),e.textContent=$l,r.appendChild(e)}const i=parseInt(this.primaryColor.substr(1,2),16),a=parseInt(this.primaryColor.substr(3,2),16),s=parseInt(this.primaryColor.substr(5,2),16);this.root=Yl("div"),this.root.setAttribute("dir",this.rtl?"rtl":"ltr"),this.root.style.setProperty("--primary",this.primaryColor),this.root.style.setProperty("--on-primary",(299*i+587*a+114*s)/1e3>=160?"#000":"#fff"),r.appendChild(this.root),this.host=t}this.ensureAttached()}ensureAttached(){try{this.host&&!this.host.isConnected&&(document.body||document.documentElement).appendChild(this.host)}catch(e){}}isOwnElement(e){return!(!this.host||!e||e!==this.host&&!this.host.contains(e))}setVisible(e){this.host&&this.host.style.setProperty("visibility",e?"visible":"hidden","important")}action(e){try{this.onAction&&this.onAction(e)}catch(t){}}button(e,t,n,r,o,i){const a=r?Kl(r):null,s=Yl("button",n,i?[e,a]:[a,e]);return s.type="button",s.disabled=!!o,s.addEventListener("click",(e=>{e.stopPropagation(),s.disabled||"true"===s.getAttribute("aria-disabled")||this.action(t)})),s}micToggle(e,t){if(!e||!e.available)return null;const n=this.button(null,"mic","icon",e.on?"mic":"micOff",t);return n.setAttribute("aria-pressed",e.on?"true":"false"),n.setAttribute("aria-label",this.labels.microphone),n.title=this.labels.microphone,this.micButton=n,n}focus(e){try{this.autoFocus&&e&&e.focus({preventScroll:!0})}catch(t){}}reset(){if(this.cleanupDrag&&(this.cleanupDrag(),this.cleanupDrag=null),this.previewUrl){try{URL.revokeObjectURL(this.previewUrl)}catch(e){}this.previewUrl=null}for(this.timer=this.micButton=this.progress=this.status=this.previewButtons=null;this.root&&this.root.firstChild;)this.root.removeChild(this.root.firstChild)}bar(e,t,n,r,o){this.mount(),this.reset();const i=Yl("div","grip",[Kl("grip")]);i.setAttribute("aria-hidden","true"),i.title=this.labels.barDragHint;const a=Yl("div","actions",n),s=Yl("div","bar"+(o?" recording":""),[i,t,a]);s.setAttribute("role","region"),s.setAttribute("aria-label",e),o||s.addEventListener("keydown",(e=>{try{"Escape"===e.key&&(e.stopPropagation(),this.action("cancel"))}catch(t){}})),this.place(s),this.enableDragging(s,i),this.root.appendChild(s),this.focus(n[r])}place(e){this.position&&(e.classList.add("moved"),e.style.left=this.position.left+"px",e.style.top=this.position.top+"px",e.style.bottom="auto")}enableDragging(e,t){let n=null;const r=t=>{try{n&&(this.position={left:Math.max(8,Math.min(window.innerWidth-e.offsetWidth-8,n.left+t.clientX-n.x)),top:Math.max(8,Math.min(window.innerHeight-e.offsetHeight-8,n.top+t.clientY-n.y))},this.place(e))}catch(r){}},o=()=>{n=null,window.removeEventListener("pointermove",r,!0),window.removeEventListener("pointerup",o,!0),window.removeEventListener("pointercancel",o,!0)};t.addEventListener("pointerdown",(t=>{try{if(t.button)return;t.preventDefault();const i=e.getBoundingClientRect();n={x:t.clientX,y:t.clientY,left:i.left,top:i.top},window.addEventListener("pointermove",r,!0),window.addEventListener("pointerup",o,!0),window.addEventListener("pointercancel",o,!0)}catch(i){}})),this.cleanupDrag=o}busyButton(e,t,n,r){const o=this.button(r?null:e,t,"primary",r?null:n);return r&&(o.appendChild(Yl("span","spin")),o.appendChild(document.createTextNode(e)),o.setAttribute("aria-busy","true"),o.setAttribute("aria-disabled","true")),o}showScreenshotBar(e){const t=this.labels;this.bar(t.barCapture,Yl("div","hint",[t.barScreenshotHint]),[this.busyButton(t.barCapture,"capture","camera",e),this.button(t.barCancel,"cancel")],0)}showRecordBar(e){let{busy:t,mic:n,interrupted:r}=e;const o=this.labels,i=r?o.recordAgain:o.barStart,a=[this.busyButton(i,"start","record",t),this.micToggle(n,t),this.button(o.barCancel,"cancel")].filter(Boolean);this.bar(i,Yl("div","hint",[r?o.recordingInterrupted:o.barRecordHint]),a,0)}showPageRecordingOffer(){const e=this.labels;this.bar(e.recordPage,Yl("div","hint",[e.recordPageHint]),[this.button(e.recordPage,"record-page","primary","record"),this.button(e.barCancel,"cancel")],0)}showRecordingBar(e){let{mic:t,maxSec:n}=e;const r=this.labels;this.maxSec=n;const o=Yl("span","timer",[Vl(0)+" / "+Vl(n)]);o.setAttribute("role","timer");const i=this.button(null,"stop","stop icon","stop");i.setAttribute("aria-label",r.barStop),i.title=r.barStop;const a=[this.micToggle(t),i].filter(Boolean);this.bar(r.barRecording,Yl("div","hint rec",[Yl("span","dot"),o]),a,a.length-1,!0),this.timer=o}updateTimer(e){this.timer&&(this.timer.textContent=Vl(e)+" / "+Vl(this.maxSec))}setMicOn(e){const t=this.micButton;t&&(t.setAttribute("aria-pressed",e?"true":"false"),t.replaceChild(Kl(e?"mic":"micOff"),t.firstChild))}showPreview(e){this.mount(),this.reset();const t=this.labels;let n;if(e.video){const t=document.createElement("video");t.controls=!0,t.playsInline=!0,t.preload="auto",t.addEventListener("loadedmetadata",(()=>{try{if(t.duration===1/0){const e=()=>{t.removeEventListener("timeupdate",e),t.currentTime=0};t.addEventListener("timeupdate",e),t.currentTime=1e7}}catch(e){}}),{once:!0}),this.previewUrl=URL.createObjectURL(e.video),t.src=this.previewUrl,n=Yl("div","media",[t])}else{const t=Yl("div","facts",[Yl("span",null,[Kl("clock"),Vl((e.durationMs||0)/1e3)])]);"number"==typeof e.interactions&&t.appendChild(Yl("span",null,[Kl("pointer"),String(e.interactions)])),n=Yl("div","media summary",[Kl("page"),t])}this.status=Yl("div","status"),this.status.setAttribute("aria-live","polite");const r={cancel:this.button(t.barCancel,"cancel"),retake:this.button(t.previewRetake,"retake"),send:this.button(t.previewSend,"send","primary","send",!1,!0)};this.previewButtons=r;const o=Yl("div","title",[t.previewTitle]);o.id="gl-title";const i=Yl("div","card",[o,n,Yl("div","footer",[this.status,Yl("div","actions",[r.cancel,r.retake,r.send])])]);i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-labelledby",o.id),this.root.appendChild(Yl("div","overlay",[i])),this.focus(r.send)}setUploading(e){if(this.status){if(this.previewButtons.retake.disabled=this.previewButtons.send.disabled=!0,!this.progress){this.status.className="status",this.status.textContent=this.labels.uploading,this.progress=Yl("div");const e=Yl("div","progress",[this.progress]);e.setAttribute("role","progressbar"),this.status.appendChild(e)}this.progress.style.width=Math.round(100*Math.max(0,Math.min(1,e||0)))+"%"}}setPreviewError(e){this.status&&(this.progress=null,this.status.className="status error",this.status.textContent=e||this.labels.failed,this.previewButtons.retake.disabled=this.previewButtons.send.disabled=!1)}destroy(){this.reset();try{this.host&&this.host.remove()}catch(e){}this.host=this.root=this.onAction=null}}const Ql="filter: blur(12px) !important;",eu=Ql+" -webkit-text-security: disc !important;",tu=rl.split(",").map((e=>":not("+e.trim()+")")).join(""),nu=e=>{try{return!(!e.matches||!e.matches(rl))}catch(t){return!1}},ru=e=>{const t=":is("+e+"):not(html):not(body)"+tu,n=["html:is("+e+") > body > *","body:is("+e+") > *"].map((e=>e+tu)).join(", ");return{rules:[t+":not("+t+" *) { "+Ql+" }",n+" { "+Ql+" }"],fallback:e+" { "+Ql+" }"}},ou=(e,t)=>{const n=hl(e,t).map(ru);return n.push({rules:[cl()+" { "+Ql+" }"],fallback:null}),function(e){e=e||{};var t=['input[type="password" i]',"input[data-rr-is-password]"];va.forEach((function(e){t.push('input[autocomplete~="'+e+'" i]','textarea[autocomplete~="'+e+'" i]')})),["input"+Ra,"textarea","select"].forEach((function(e){t.push(e+ya,ya+" "+e)}));var n=Aa(e);return Object.keys(n).forEach((function(e){!n[e]||ba.indexOf(e)>=0||!/^[a-z-]+$/.test(e)||("textarea"!==e&&"select"!==e?(t.push('input[type="'+e+'" i]'),"text"===e&&t.push("input:not([type])")):t.push(e))})),t}(e).forEach((e=>{n.push({rules:[e+" { "+eu+" }"],fallback:null})})),n},iu=(e,t)=>{let n=!1;if(t.rules.forEach((t=>{try{e.insertRule(t,e.cssRules.length),n=!0}catch(r){}})),!n&&t.fallback)try{e.insertRule(t.fallback,e.cssRules.length)}catch(r){}},au=()=>new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(r){n()}})),su=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.privacyOptions||{},n=ou(t,e.maskSelectors),r=fl(t),o=Object.create(null),i=[],a=new WeakSet,s=[];let c=null,l=!1;const u=e=>{const t=(e=>{for(let n=0;n<i.length;n++)if(i[n].doc===e)return i[n];let t=null;try{const n=e.defaultView;n&&"function"==typeof n.CSSStyleSheet&&"adoptedStyleSheets"in e&&(t={doc:e,sheet:new n.CSSStyleSheet,style:null,roots:[]})}catch(r){}if(!t)try{const n=e.createElement("style");W(n),(e.head||e.documentElement).appendChild(n),n.sheet?t={doc:e,sheet:n.sheet,style:n,roots:[]}:n.parentNode.removeChild(n)}catch(r){}return t&&(n.forEach((e=>iu(t.sheet,e))),Object.keys(o).forEach((e=>iu(t.sheet,ru("."+dl(e))))),i.push(t)),t})(9===e.nodeType?e:e.ownerDocument);if(t&&!t.style)try{e.adoptedStyleSheets=Array.prototype.slice.call(e.adoptedStyleSheets||[]).concat([t.sheet]),t.roots.push(e)}catch(r){}},d=e=>{const t=e.classList;if(r.length&&t)for(let n=0;n<t.length;n++){const e=t[n];if(o[e])continue;if(r.some((t=>(t.lastIndex=0,t.test(e))))){o[e]=!0;const t=ru("."+dl(e));i.forEach((e=>iu(e.sheet,t)))}}};let p=null;const h=(e,t)=>{!e||a.has(e)||t>8||(a.add(e),u(e),(e=>{if(c)try{c.observe(e,r.length?{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}:{childList:!0,subtree:!0})}catch(t){}})(e),p(e,t))},f=(e,t)=>{let n=null;try{n=e.contentDocument}catch(r){}n&&n.documentElement&&h(n,t)},g=(e,t)=>{d(e),e.shadowRoot&&h(e.shadowRoot,t+1),"IFRAME"!==e.tagName&&"FRAME"!==e.tagName||((e,t)=>{for(let o=0;o<s.length;o++)if(s[o].frame===e)return void f(e,t);const n=()=>{l||f(e,t)};try{e.addEventListener("load",n),s.push({frame:e,onLoad:n})}catch(r){}f(e,t)})(e,t+1)};p=(e,t)=>{if(!l&&e)try{if(1===e.nodeType){if(nu(e))return;g(e,t)}const n=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>nu(e)?2:1});let r=n.nextNode();for(;r;)g(r,t),r=n.nextNode()}catch(n){}};const m=()=>{if(!l){l=!0;try{c&&c.disconnect()}catch(e){}c=null,s.forEach((t=>{try{t.frame.removeEventListener("load",t.onLoad)}catch(e){}})),s.length=0,i.forEach((t=>{t.roots.forEach((n=>{try{n.adoptedStyleSheets=Array.prototype.filter.call(n.adoptedStyleSheets||[],(e=>e!==t.sheet))}catch(e){}}));try{t.style&&t.style.parentNode&&t.style.parentNode.removeChild(t.style)}catch(e){}})),i.length=0;try{window.removeEventListener("pagehide",m)}catch(e){}}};try{window.addEventListener("pagehide",m),"function"==typeof MutationObserver&&(c=new MutationObserver((e=>{if(!l)try{e.forEach((e=>{if("attributes"!==e.type)for(let t=0;t<e.addedNodes.length;t++)1===e.addedNodes[t].nodeType&&p(e.addedNodes[t],0);else d(e.target)}))}catch(t){}}))),h(document,0)}catch(v){}return{ready:au,remove:m}};function cu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const lu="gleap-capture-session",uu="gleap-capture-device",du=["completed","skipped","cancelled","expired"],pu=[".bb-feedback-button",".gleap-notification-container",".gleap-chatbar",".gleap-b",".gleap-modal-wrapper",".gleap-tooltip",".gleap-tooltip-anchor",".gleap-tour-popover",".gleap-tour-overlay","#copilot-pointer-container","#copilot-joined-container",".gleap-audio-unmute-modal-overlay",".gleap-admin-frame-container",".gleap-admin-collapse-ui","gleap-checklist"].join(", "),hu=e=>{try{return window.sessionStorage.getItem(e)}catch(t){return null}},fu=(e,t)=>{try{null===t?window.sessionStorage.removeItem(e):window.sessionStorage.setItem(e,t)}catch(n){}},gu=e=>{const t=parseInt(e,10);return isNaN(t)?60:Math.max(5,Math.min(180,t))},mu=e=>{if(!e)return"unknown";const t=e.name&&"Error"!==e.name?e.name:"",n=e.message?String(e.message):t?"":String(e);return(t&&n?t+": "+n:t||n).slice(0,120)},vu=e=>e>=200&&e<300;let yu=0;class bu{constructor(){cu(this,"session",null),cu(this,"ui",null),cu(this,"watchdog",null),cu(this,"hiddenElements",[]),cu(this,"hiddenEscape",null),cu(this,"handledLogRequests",[]),cu(this,"logsPostedFor",[]),cu(this,"deviceId",null)}static getInstance(){return this.instance||(this.instance=new bu),this.instance}setCaptureEnabled(e){(e=>{zn=!!e})(e),e||(fu(lu,null),this.session&&this.cancelSession(this.session,"disabled"));try{Zf.instance&&Zf.instance.sendCaptureCapabilities()}catch(t){}}setRemoteLogCollectionEnabled(e){(e=>{Wn=!!e})(e)}getDeviceId(){if(this.deviceId)return this.deviceId;let e=hu(uu);return e&&/^web-[0-9a-f]{32}$/.test(e)||(e="web-"+(e=>{try{const t=new Uint8Array(e);return window.crypto.getRandomValues(t),Array.prototype.map.call(t,(e=>(e<16?"0":"")+e.toString(16))).join("")}catch(t){let n="";for(let r=0;r<2*e;r++)n+=Math.floor(16*Math.random()).toString(16);return n}})(16),fu(uu,e)),this.deviceId=e,e}privacyOptions(){try{return Ga.getInstance().customOptions||{}}catch(e){return{}}}maskSelectors(){const e=Jn().maskSelectors;return Array.isArray(e)?e.filter((e=>"string"==typeof e)):[]}attachesLogs(e){return!!(e&&e.options&&e.options.attachLogs)&&Gn()}applyVeil(e){this.liftVeil(e);try{e.veil=su({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors()})}catch(t){e.veil=null}}liftVeil(e,t){const n=t||e.veil;if(n){e.veil===n&&(e.veil=null);try{n.remove()}catch(r){}}}handleMessengerMessage(e){try{const t=e&&e.data&&"object"==typeof e.data?e.data:{};switch(e&&e.name){case"capture-start":this.onCaptureStart(t);break;case"capture-cancel":this.onCaptureCancel(t);break;case"capture-editor":this.setEditorOpen(!!t.open);break;case"capture-done":this.onCaptureDone(t)}}catch(t){}}sendState(e,t,n){try{Zf.getInstance().sendMessage({name:"capture-state",data:Object.assign({requestId:e,state:t},n)})}catch(r){}}setEditorOpen(e){try{Zf.getInstance().setCaptureEditorOpen(e)}catch(t){}}onCaptureStart(e){const t="string"==typeof e.requestId?e.requestId:null,n="screenshot"===e.kind||"recording"===e.kind?e.kind:null;if(!t||!n)return;if(!er())return this.sendState(t,"unsupported",{error:"capture-disabled"}),void Ss(t,"unsupported","capture-disabled");const r=this.session;if(r){if("uploading"===r.phase)return;r.requestId!==t?this.cancelSession(r,"replaced",!0):this.endSession(r,{restore:!1})}this.setEditorOpen(!1),this.startSession({requestId:t,kind:n,ticketShareToken:"string"==typeof e.ticketShareToken?e.ticketShareToken:null,options:e.options,labels:e.labels,resumed:!1,phase:"bar"})}onCaptureCancel(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||(this.endSession(t,{restore:!0}),this.sendState(t.requestId,"cancelled")),this.setEditorOpen(!1)}onCaptureDone(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||this.endSession(t,{restore:!0}),this.setEditorOpen(!1)}onWidgetDestroyed(){const e=this.session;e&&("editor"!==e.phase?e.resumed=!0:this.endSession(e,{restore:!1}))}destroy(){this.session&&this.endSession(this.session,{restore:!1}),this.setEditorOpen(!1)}normalizeOptions(e){const t=e&&"object"==typeof e?e:{};return{annotate:!1!==t.annotate,maxDurationSec:gu(t.maxDurationSec),audio:!0===t.audio,attachLogs:!1!==t.attachLogs,include:Ts(t.include)}}startSession(e){let t={};try{t=Xu.getInstance().getFlowConfig()||{}}catch(r){}const n={key:++yu,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken||null,options:this.normalizeOptions(e.options),labels:Gl(e.labels),rawLabels:e.labels&&"object"==typeof e.labels?e.labels:null,resumed:!!e.resumed,phase:e.phase,interrupted:"interrupted"===e.phase,pageRecording:!0===e.pageRecording,micOn:!1,createdAt:"number"==typeof e.createdAt?e.createdAt:Date.now(),startedAt:Date.now(),lastTick:-1,lastProgressSent:0};this.session=n;try{let o=!1;try{o=!!Hv.getInstance().isRTLLayout}catch(r){}this.ui=new Zl({labels:e.labels,primaryColor:t.color,rtl:o,onAction:e=>this.onUiAction(n,e)}),this.ui.autoFocus=!n.resumed,this.renderBar(n)}catch(o){return void this.failSession(n,"failed",mu(o))}if(!n.resumed)try{Zf.getInstance().setCaptureHidden(!0)}catch(r){}this.hideGleapUi(),this.startWatchdog(),this.persist(n),this.sendState(n.requestId,"bar")}renderBar(e){this.ui&&("screenshot"===e.kind?this.ui.showScreenshotBar(!1):this.ui.showRecordBar({busy:!1,mic:this.micState(e),interrupted:e.interrupted}))}micState(e){return!0===e.options.audio&&!0===Jn().allowMicrophone&&this.usesScreenRecording(e)&&Yn()?{available:!0,on:e.micOn}:null}usesScreenRecording(e){return"display"===Qn()&&!e.pageRecording}endSession(e,t){let{restore:n}=t;if(e&&this.session===e){this.session=null;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e);try{e.timeline&&e.timeline.stop()}catch(r){}try{e.upload&&e.upload.abort()}catch(r){}if(e.recording=null,e.timeline=null,e.upload=null,e.result=null,this.stopWatchdog(),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),this.ui){try{this.ui.destroy()}catch(r){}this.ui=null}if(this.showGleapUi(),fu(lu,null),n)this.restoreWidget(e);else if(!e.resumed)try{Zf.getInstance().setCaptureHidden(!1,!1)}catch(r){}}}restoreWidget(e){try{e.resumed?this.openConversation(e.ticketShareToken):Zf.getInstance().setCaptureHidden(!1,!0)}catch(t){}}openConversation(e){e?Qv.openConversation(e,!0):Qv.open()}cancelSession(e,t,n){const r="editor"===e.phase;this.endSession(e,{restore:!n}),r||(this.sendState(e.requestId,"cancelled"),Ss(e.requestId,"released",t))}failSession(e,t,n){e&&this.session===e&&(this.endSession(e,{restore:!0}),this.sendState(e.requestId,t,{error:n}),Ss(e.requestId,"declined"===t||"unsupported"===t?t:"failed",n))}onUiAction(e,t){if(this.session===e)try{switch(t){case"capture":this.takeScreenshot(e);break;case"start":this.startRecording(e);break;case"record-page":e.pageRecording=!0,this.startRecording(e);break;case"stop":e.recording&&e.recording.stop();break;case"mic":this.toggleMicrophone(e);break;case"send":this.sendRecording(e);break;case"retake":this.retakeRecording(e);break;case"cancel":"fallback"===e.phase?this.failSession(e,e.fallbackState,e.fallbackReason):this.cancelSession(e,"cancelled")}}catch(n){this.failSession(e,"failed",mu(n))}}takeScreenshot(e){if("screenshot"!==e.kind||"bar"!==e.phase)return;const t="dom-only"!==Jn().webScreenshotMethod&&Zn()&&Kn()&&(()=>{try{return window.top===window.self}catch(e){return!1}})(),n=t?(()=>{let e;try{e=navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude",monitorTypeSurfaces:"exclude"})}catch(t){e=Promise.reject(t)}return e.catch((()=>{})),e})():null;e.phase="capturing",this.ui.showScreenshotBar(!0),this.sendState(e.requestId,"capturing"),t&&this.setCaptureUiHidden(!0);let r=null;if(this.attachesLogs(e)&&-1===this.logsPostedFor.indexOf(e.requestId))try{r=Os({include:e.options.include,deviceId:this.getDeviceId()})}catch(i){}const o=()=>this.session===e;(e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=e;const a=()=>!i||i();return(t?t.then((e=>a()?Tl(e,{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:a}).catch((()=>null)):(El(e),null)),(()=>(n(!1),null))):Promise.resolve(null)).then((e=>{if(!a())throw e&&xl(e.canvas),new Error("aborted");return e||ql({privacyOptions:r,maskSelectors:o,isActive:a})})).then((e=>{try{const t=Cl(e);return t.method=e.method,t}finally{xl(e.canvas)}}))})({streamPromise:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isActive:o,setUiHidden:e=>{o()&&this.setCaptureUiHidden(e)}}).then((t=>{o()&&this.onScreenshotReady(e,t,r)})).catch((t=>{o()&&this.failSession(e,"failed",mu(t))}))}onScreenshotReady(e,t,n){const r=Zf.getInstance(),o={name:"capture-image",data:{requestId:e.requestId,dataUrl:t.dataUrl,width:t.width,height:t.height,method:t.method,platform:qn,sdkType:Hn,sdkVersion:Xn()}};e.phase="editor",fu(lu,null),this.stopWatchdog(),this.ui&&(this.ui.destroy(),this.ui=null),this.showGleapUi(),e.resumed?(this.openConversation(e.ticketShareToken),r.sendMessage(o,!0)):(r.sendMessage(o,!0),r.setCaptureHidden(!1,!0)),n&&this.postLogs(e.requestId,n)}postLogs(e,t){Gn()&&-1===this.logsPostedFor.indexOf(e)&&(this.logsPostedFor.push(e),this.logsPostedFor.length>100&&this.logsPostedFor.shift(),Is(e,t).catch((()=>{})))}setCaptureUiHidden(e){if(this.ui&&this.ui.setVisible(!e),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),e){this.hideGleapUi();const e=this.session;this.hiddenEscape=t=>{try{"Escape"===t.key&&e&&this.session===e&&this.cancelSession(e,"cancelled")}catch(n){}},document.addEventListener("keydown",this.hiddenEscape,!0)}}startRecording(e){if("recording"!==e.kind||-1===["bar","interrupted","fallback"].indexOf(e.phase))return;const t=()=>this.session===e,n=e.options.maxDurationSec,r=n=>{t()&&n!==e.lastTick&&(e.lastTick=n,this.ui&&this.ui.updateTimer(n),this.sendState(e.requestId,"recording",{elapsedSec:n}))},o=n=>{t()&&this.onRecordingStopped(e,n)},i=n=>{t()&&this.failSession(e,"failed",mu(n))};if(this.usesScreenRecording(e)){const a=(e=>{const t={frameRate:{ideal:15,max:30}},n={video:t,audio:!1};let r;e&&(t.displaySurface="browser",n.preferCurrentTab=!0,n.selfBrowserSurface="include",n.surfaceSwitching="include");try{r=navigator.mediaDevices.getDisplayMedia(n)}catch(o){r=Promise.reject(o)}return r.catch((()=>{})),r})(Zn());this.applyVeil(e);const s=e.veil;return e.phase="starting",this.ui.showRecordBar({busy:!0,mic:this.micState(e),interrupted:e.interrupted}),void a.then((e=>(s?s.ready():Promise.resolve()).then((()=>e)))).then((a=>{if(!t())return El(a),null;const c=new cs({maxDurationSec:n,onTick:r,onStop:o,onError:i,onReleased:()=>{s&&this.liftVeil(e,s)}});return e.recording=c,c.start(a,!!this.micState(e)&&e.micOn).then((n=>{t()?this.onRecordingStarted(e,c.startedAt,n.hasMicrophone):c.cancel()}))})).catch((n=>{t()&&this.offerPageRecording(e,n)}))}const a=new ps({maxDurationSec:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),onTick:r,onStop:o,onError:i});e.recording=a,a.start(),this.onRecordingStarted(e,a.startedAt,!1)}offerPageRecording(e,t){const n=t&&t.name;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e),e.phase="fallback",e.recording=null,e.fallbackState="NotAllowedError"===n||"SecurityError"===n?"declined":"failed",e.fallbackReason=mu(t),this.ui.showPageRecordingOffer(),this.persist(e),this.sendState(e.requestId,"bar")}onRecordingStarted(e,t,n){e.phase="recording",e.interrupted=!1,e.hasMicrophone=!!n,e.lastTick=0,e.timeline=new ms({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isOwnElement:e=>!(!this.ui||!this.ui.isOwnElement(e))}),e.timeline.start(t),this.ui.showRecordingBar({mic:e.hasMicrophone?{available:!0,on:e.micOn}:null,maxSec:e.options.maxDurationSec}),this.persist(e),this.sendState(e.requestId,"recording",{elapsedSec:0})}toggleMicrophone(e){"recording"!==e.phase&&"bar"!==e.phase&&"interrupted"!==e.phase||(e.micOn=!e.micOn,"recording"===e.phase&&e.recording&&e.recording.setMicrophoneEnabled&&e.recording.setMicrophoneEnabled(e.micOn),this.ui.setMicOn(e.micOn))}onRecordingStopped(e,t){this.liftVeil(e),e.recording=null,e.result=t,e.timelineEntries=e.timeline?e.timeline.stop(t.endedAt):[];const n=e.timeline?e.timeline.interactions:0;e.timeline=null,e.phase="preview",this.ui.showPreview({video:0===t.type.indexOf("video/")?t.blob:null,durationMs:t.durationMs,interactions:n}),this.persist(e),this.sendState(e.requestId,"preview")}retakeRecording(e){"preview"===e.phase&&(e.result=null,e.uploadedUrl=null,e.timelineEntries=null,e.phase="bar",e.interrupted=!1,this.renderBar(e),this.persist(e),this.sendState(e.requestId,"bar"))}sendRecording(e){const t=e.result;if("preview"!==e.phase||!t)return;const n=()=>this.session===e;if(e.phase="uploading",this.ui.setUploading(0),this.sendState(e.requestId,"uploading",{progress:0}),this.attachesLogs(e))try{this.postLogs(e.requestId,Os({include:e.options.include,windowStart:t.startedAt,windowEnd:t.endedAt,deviceId:this.getDeviceId()}))}catch(i){}const r=t=>{if(!n())return;this.ui&&this.ui.setUploading(t);const r=Date.now();(r-e.lastProgressSent>250||t>=1)&&(e.lastProgressSent=r,this.sendState(e.requestId,"uploading",{progress:Math.round(100*t)/100}))};let o;e.uploadedUrl?o=Promise.resolve(e.uploadedUrl):(e.upload=((e,t,n)=>{let r=null;return{promise:new Promise(((o,a)=>{try{const i=Tf.getInstance(),s=new FormData;s.append("file",e,t),r=new XMLHttpRequest,r.open("POST",i.apiUrl+"/uploads/attachments"),i.injectSession(r),r.upload&&n&&(r.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&n(Math.min(1,e.loaded/e.total))}),r.onreadystatechange=()=>{if(4!==r.readyState)return;const e=ws(r.responseText);200===r.status&&e&&Array.isArray(e.fileUrls)&&"string"==typeof e.fileUrls[0]?o(e.fileUrls[0]):a(new Error(413===r.status?"file-too-large":"upload-failed-"+r.status))},r.onerror=()=>a(new Error("upload-failed")),r.onabort=()=>a(new Error("upload-aborted")),r.send(s)}catch(i){a(i)}})),abort:()=>{try{r&&r.abort()}catch(i){}}}})(t.blob,t.fileName,r),o=e.upload.promise),o.then((r=>{if(!n())return null;e.upload=null,e.uploadedUrl=r;const o={url:r,name:t.fileName,type:t.type,size:t.blob.size,durationMs:t.durationMs};return t.width>0&&t.height>0&&(o.width=t.width,o.height=t.height),(i=e.requestId,a={files:[o],method:t.method,platform:qn,sdkType:Hn,sdkVersion:Xn(),deviceId:this.getDeviceId(),annotations:[],timeline:e.timelineEntries||[],recordingStartedAt:new Date(t.startedAt).toISOString(),recordingEndedAt:new Date(t.endedAt).toISOString()},xs(i,"complete",a)).then((t=>{n()&&(vu(t.status)?(this.endSession(e,{restore:!0}),this.sendState(e.requestId,"done")):409===t.status||410===t.status?(this.endSession(e,{restore:!0}),this.sendState(e.requestId,"failed",{error:409===t.status?"already-completed":"request-closed"})):this.onUploadFailed(e,"complete-"+t.status))}));var i,a})).catch((t=>{n()&&this.onUploadFailed(e,mu(t))}))}onUploadFailed(e,t){e.upload=null,e.phase="preview",this.ui&&this.ui.setPreviewError(e.labels.failed),this.sendState(e.requestId,"preview",{error:t})}hideGleapUi(){try{const e=document.querySelectorAll(pu);for(let t=0;t<e.length;t++){const n=e[t];-1===this.hiddenElements.indexOf(n)&&this.hiddenElements.push(n),n.style.setProperty("visibility","hidden","important")}}catch(e){}}showGleapUi(){this.hiddenElements.forEach((e=>{try{e.style.removeProperty("visibility")}catch(t){}})),this.hiddenElements=[]}startWatchdog(){this.stopWatchdog(),this.watchdog=setInterval((()=>{try{this.ui&&this.ui.ensureAttached(),this.hideGleapUi()}catch(e){}}),1e3)}stopWatchdog(){this.watchdog&&(clearInterval(this.watchdog),this.watchdog=null)}persist(e){if(this.session!==e)return;let t=null;if(-1!==["bar","capturing","starting","fallback"].indexOf(e.phase)?t=e.interrupted?"recording":"bar":"recording"===e.kind&&-1!==["recording","preview","uploading","interrupted"].indexOf(e.phase)&&(t="recording"),!t)return void fu(lu,null);let n=null,r=null;try{const e=Tf.getInstance();n=e.session?e.session.gleapId:null,r=e.sdkKey}catch(o){}try{fu(lu,JSON.stringify({v:1,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken,options:e.options,labels:e.rawLabels,phase:t,pageRecording:!0===e.pageRecording,gleapId:n,sdkKey:r,at:e.createdAt}))}catch(o){}}resumeFromStorage(){try{if(this.session)return;const n=hu(lu);if(!n)return;let r=null;try{r=JSON.parse(n)}catch(t){}const o=Tf.getInstance();if(!(r&&1===r.v&&"string"==typeof r.requestId&&("screenshot"===r.kind||"recording"===r.kind)&&"number"==typeof r.at&&Date.now()-r.at<18e5&&o.session&&r.gleapId===o.session.gleapId&&r.sdkKey===o.sdkKey)||!er())return void fu(lu,null);(e=r.requestId,ks("GET","/v3/shared/capture-requests/"+encodeURIComponent(String(e)))).then((e=>{try{const t=e.data;if(e.status>=400&&e.status<500||t&&-1!==du.indexOf(t.status)||t&&t.expiresAt&&Date.parse(t.expiresAt)<Date.now())return void(this.session||fu(lu,null));if(this.session)return;this.startSession({requestId:r.requestId,kind:r.kind,ticketShareToken:r.ticketShareToken,options:r.options,labels:r.labels,pageRecording:!0===r.pageRecording,createdAt:r.at,resumed:!0,phase:"recording"===r.kind&&"recording"===r.phase?"interrupted":"bar"})}catch(t){}}))}catch(t){}var e}handleServerRequest(e){try{if(!e||"logs"!==e.kind||"string"!=typeof e.id)return;const t=e.id;if(-1!==this.handledLogRequests.indexOf(t))return;if(this.handledLogRequests.push(t),this.handledLogRequests.length>100&&this.handledLogRequests.shift(),e.expiresAt&&Date.parse(e.expiresAt)<Date.now())return;const n=e.options&&"object"==typeof e.options?e.options:{};Xu.getInstance().onConfigLoaded((()=>{this.collectLogs(t,n).catch((()=>{}))}))}catch(t){}}collectLogs(e,t){if(!Gn())return Ss(e,"unsupported","disabled-by-app");if(!1===Jn().backgroundLogs)return Ss(e,"unsupported","disabled-by-project");const n=this.getDeviceId();return((e,t)=>xs(e,"claim",t))(e,{deviceId:n,platform:qn,sdkType:Hn,sdkVersion:Xn()}).then((r=>!vu(r.status)||r.data&&r.data.claimedElsewhere?null:Promise.resolve().then((()=>Is(e,Os({include:t.include,deviceId:n})))).then((t=>vu(t.status)?null:Ss(e,"failed","logs-"+t.status)),(t=>Ss(e,"failed",mu(t))))))}}function wu(e){return wu="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},wu(e)}function ku(e){return function(e){if(Array.isArray(e))return xu(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 xu(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 xu(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 xu(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 Su(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,Mu(r.key),r)}}function Cu(e,t,n){return t=Ou(t),function(e,t){if(t&&("object"===wu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Eu(e)}(e,Tu()?Reflect.construct(t,n||[],Ou(e).constructor):t.apply(e,n))}function Eu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Iu(e){var t="function"==typeof Map?new Map:void 0;return Iu=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(Tu())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Lu(o,n.prototype),o}(e,arguments,Ou(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Lu(n,e)},Iu(e)}function Tu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tu=function(){return!!e})()}function Lu(e,t){return Lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lu(e,t)}function Ou(e){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ou(e)}function Au(e,t,n){return(t=Mu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mu(e){var t=function(e,t){if("object"!=wu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=wu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wu(t)?t:String(t)}cu(bu,"instance",void 0);function Ru(e){return Ru="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},Ru(e)}function Pu(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,Du(r.key),r)}}function Du(e){var t=function(e,t){if("object"!=Ru(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ru(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ru(t)?t:String(t)}var Nu,ju,_u,Fu=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(),Zv(t.href));var n=Zf.getInstance(),r="function"==typeof n.isCaptureHidden&&n.isCaptureHidden();n.isOpened()&&!r||e.target.closest&&e.target.closest(".gleap-capture-root")||Sd.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&&Pu(t.prototype,n),r&&Pu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Bu(e){return Bu="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},Bu(e)}function Uu(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,qu(r.key),r)}}function Hu(e,t,n){return(t=qu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qu(e){var t=function(e,t){if("object"!=Bu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Bu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bu(t)?t:String(t)}Nu=Fu,_u=void 0,(ju=Du(ju="instance"))in Nu?Object.defineProperty(Nu,ju,{value:_u,enumerable:!0,configurable:!0,writable:!0}):Nu[ju]=_u;var zu=["color","headerColor","headerColor2","headerColor3","backgroundColor"],Wu=["logo","bgImage","aurora"],Gu=function(e,t){return JSON.stringify(e.map((function(e){return null==t?void 0:t[e]})))},Vu=function(e,t){return"".concat(e,"|").concat(Gu([].concat(zu,Wu),t))},$u=function(e,t){var n=parseInt(e);return isNaN(n)?t:n},Xu=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),Hu(this,"rawFlowConfig",null),Hu(this,"flowConfig",null),Hu(this,"appliedColorScheme",null),Hu(this,"projectActions",null),Hu(this,"onConfigLoadedListener",[]),Hu(this,"onConfigLoaded",(function(e){null!==t.flowConfig?e():t.onConfigLoadedListener.push(e)})),Hu(this,"start",(function(){var e=Tf.getInstance(),n=ie("config-".concat(e.sdkKey,"-").concat(Hv.getInstance().getActiveLanguage()));return n?(t.applyConfig(n),t.loadConfigFromServer().catch((function(e){})),Promise.resolve()):t.loadConfigFromServer()})),Hu(this,"loadConfigFromServer",(function(){var e=t;return new Promise((function(t,n){var r=Tf.getInstance(),o=new XMLHttpRequest,i=Hv.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)),Qv.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;Qv.setStyles(e.color?e.color:"#485BFF",e.headerColor?e.headerColor:"#485BFF",e.buttonColor?e.buttonColor:"#485BFF",e.backgroundColor?e.backgroundColor:"#FFFFFF",$u(e.borderRadius,20),$u(e.buttonX,20),$u(e.buttonY,20),e.feedbackButtonPosition,e.headerColor2,e.headerColor3)}},{key:"refreshColorScheme",value:function(){if(this.rawFlowConfig){var e=En.getInstance(),t=e.applyToFlowConfig(this.rawFlowConfig),n=Vu(e.getActiveColorScheme(this.rawFlowConfig),t);if(n!==this.appliedColorScheme){this.appliedColorScheme=n;var r=this.flowConfig,o=Gu(zu,t)!==Gu(zu,r),i=Gu(Wu,t)!==Gu(Wu,r);this.flowConfig=t;var a=Nn.getInstance();a.comReady&&a._sendConfigUpdate(),o&&(this.applyStylesFromConfig(),Eg.getInstance().sendModalData(),e.applyToChecklists(t.color!==(null==r?void 0:r.color))),(o||i)&&Zf.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=En.getInstance();t.updateWatching();var n=t.applyToFlowConfig(e.flowConfig),r=this.flowConfig;this.flowConfig=n,this.appliedColorScheme=Vu(t.getActiveColorScheme(e.flowConfig),n),t.applyToChecklists(!!r&&r.color!==n.color),this.applyStylesFromConfig(),Zf.getInstance().sendConfigUpdate(),N.getInstance().updateFeedbackButtonState(),Om.getInstance().updateContainerStyle(),n.enableWebReplays?Ga.getInstance().startIfNotRunning():Ga.getInstance().stop(),n.enableNetworkLogs&&Cm.getInstance().start(),Cm.getInstance().setLoadAllResources(!!n.sendNetworkResources),Cm.getInstance().setRemoteFilters(n.networkLogPropsToIgnore||[]),Cm.getInstance().setRemoteBlacklist(n.networkLogBlacklist||[]),Hv.getInstance().updateRTLSupport(),Qv.enableShortcuts(!!n.enableShortcuts),e.aiBar&&Nn.getInstance().setConfig(e.aiBar),this.notifyConfigLoaded()}catch(o){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Uu(t.prototype,n),r&&Uu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ju(e){return Ju="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},Ju(e)}Hu(Xu,"instance",void 0);var Ku={budgetExceeded:!0},Yu=function(e){try{return Object.prototype.toString.call(e)}catch(t){return"[object Object]"}},Zu=function(e){if(!e||"object"!==Ju(e))return!1;if("undefined"!=typeof Error&&e instanceof Error)return!0;var t=Yu(e);return("[object Error]"===t||"[object DOMException]"===t)&&"string"==typeof e.message},Qu=function(e){return!!e&&"object"===Ju(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ed=function(e){var t="";try{t=e.name}catch(n){}return"[Function "+(t||"(anonymous)")+"]"},td=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()},nd=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: "+(Zu(c)?e(c,l+1):ld(c,1e3))),s}catch(u){return"Error"}},rd=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,Ku;e.parts.push(t),e.length+=t.length},od=function(e,t){var n=e.maxLength-e.length;rd(e,JSON.stringify(t.length>n?t.slice(0,n):t))},id=function(e,t){try{return{value:e[t]}}catch(n){return{failed:!0}}},ad=function(e,t,n,r,o,i){rd(e,t);for(var a=Math.min(r,100),s=0;s<a;s++)s>0&&rd(e,","),o(s,i+1);r>a&&rd(e,",… "+(r-a)+" more"),rd(e,n)},sd=function e(t,n,r){var o=Ju(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(Zu(n)){var i="Error",a="";try{i=String(n.name||"Error"),a=String(n.message||"")}catch(f){}od(t,a?i+": "+a:i)}else if(Qu(n))rd(t,td(n));else if(function(e){return!!e&&"object"===Ju(e)&&e.window===e&&!!e.document}(n))rd(t,"[Window]");else{var s=Yu(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))rd(t,s.slice(8,-1)+"("+("number"==typeof n.length?n.length:n.byteLength)+")");else if(r>=t.maxDepth)rd(t,Array.isArray(n)?"[Array]":"[Object]");else{t.seen.push(n);try{if(Array.isArray(n))return void ad(t,"[","]",n.length,(function(r,o){var i=id(n,r);i.failed?rd(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 ad(t,"Map("+n.size+"){","}",n.size,(function(n,r){e(t,c[n][0],r),rd(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 ad(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(f){u=n}if(u!==n)return void e(t,u,r)}var d=Object.keys(n),p=function(e){try{var t=Object.getPrototypeOf(e);if(!t||t===Object.prototype)return"";var n=t.constructor;return n&&"string"==typeof n.name&&"Object"!==n.name?n.name:""}catch(f){return""}}(n);ad(t,(p?p+" ":"")+"{","}",d.length,(function(r,o){od(t,d[r]),rd(t,":");var i=id(n,d[r]);i.failed?rd(t,'"[unreadable]"'):e(t,i.value,o)}),r)}finally{t.seen.pop()}}else rd(t,s.slice(8,-1)+"("+n.byteLength+")");else rd(t,s.slice(8,-1));else rd(t,String(n));else{var h=n.getTime();od(t,isNaN(h)?"Invalid Date":n.toISOString())}}else rd(t,'"[Circular]"');else rd(t,ed(n));else rd(t,n.toString());else rd(t,n.toString()+"n");else rd(t,String(n));else od(t,n);else rd(t,"null")},cd=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{sd(r,e,0)}catch(o){if(o!==Ku)return{text:r.parts.join("")+"[unserializable]",truncated:!1}}return{text:r.parts.join(""),truncated:r.truncated}},ld=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"===Ju(e))return e.toString();if("function"==typeof e)return ed(e);if(Zu(e)){var r=nd(e);return r.length>n?r.slice(0,n):r}if(Qu(e))return td(e);if("[object Date]"===Yu(e)){var o=e.getTime();return isNaN(o)?"Invalid Date":e.toISOString()}return cd(e,n,4).text}catch(i){try{return Yu(e)}catch(a){return"[unserializable]"}}},ud=function(e){try{return"bigint"==typeof e?e:"symbol"===Ju(e)?NaN:Number(e)}catch(t){return NaN}},dd=function(e){var t=ud(e);return"bigint"==typeof t?t.toString()+"n":isNaN(t)?"NaN":String(t<0?Math.ceil(t):Math.floor(t))},pd=function(e){var t=ud(e);return String("bigint"==typeof t?Number(t):t)},hd=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+=ld(l,u):"d"===c||"i"===c?r+=dd(l):"f"===c?r+=pd(l):"c"!==c&&(r+="string"==typeof l?JSON.stringify(l.slice(0,u)):ld(l,u))}else r+="%",a++}else r+=s}}for(;o<e.length&&r.length<=n;o++)r.length>0&&(r+=" "),r+=ld(e[o],Math.max(1,n-r.length));return r.length>n?r.slice(0,n):r}catch(d){return"[unserializable console arguments]"}};function fd(e){return fd="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},fd(e)}function gd(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,vd(r.key),r)}}function md(e,t,n){return(t=vd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vd(e){var t=function(e,t){if("object"!=fd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=fd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fd(t)?t:String(t)}var yd={log:"INFO",info:"INFO",debug:"INFO",warn:"WARNING",error:"ERROR"},bd="… [truncated]",wd=5001,kd=function(e,t){var n="ERROR"===t?5e3:1e3;return e.length<=n?e:e.slice(0,n-13)+bd},xd=function(e){return e.filename?" ("+e.filename+":"+(e.lineno||0)+":"+(e.colno||0)+")":""},Sd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),md(this,"logArray",[]),md(this,"disabled",!1),md(this,"started",!1),md(this,"originalConsoleMethods",{}),md(this,"consoleWrappers",{}),md(this,"capturing",!1),md(this,"errorListener",null),md(this,"rejectionListener",null),md(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=ld(e,wd)),!(e.length<=0)))for(this.logArray.push({log:kd(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(hd(e,wd),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(yd),o=function(){var o=r[i];e.wrapConsoleMethod(n,o,(function(e){t.capture((function(){return t.addLogWithArgs(e,yd[o])}))}))},i=0;i<r.length;i++)o();this.wrapConsoleMethod(n,"assert",(function(e){e.length>0&&e[0]||t.capture((function(){var n=hd(Array.prototype.slice.call(e,1),wd);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: "+ld(n,wd),"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"===fd(n)&&"string"==typeof n.stack&&n.stack.length>0?nd(n):null!=n?ld(n,wd)+xd(e):String(e.message||"Script error.").replace(/^Uncaught\s+/,"")+xd(e),this.addLog("Uncaught "+t,"ERROR")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&gd(t.prototype,n),r&&gd(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Cd(e){return Cd="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},Cd(e)}function Ed(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 Id(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ed(Object(n),!0).forEach((function(t){Ld(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ed(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Td(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,Od(r.key),r)}}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"!=Cd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Cd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Cd(t)?t:String(t)}md(Sd,"instance",void 0);var Ad=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ld(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(Id({name:e},t||{}))}}}],(n=null)&&Td(t.prototype,n),r&&Td(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Md(e){return Md="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},Md(e)}function Rd(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,Dd(r.key),r)}}function Pd(e,t,n){return(t=Dd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dd(e){var t=function(e,t){if("object"!=Md(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Md(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Md(t)?t:String(t)}Ld(Ad,"instance",void 0);var Nd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Pd(this,"customData",{}),Pd(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&&Rd(t.prototype,n),r&&Rd(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Pd(Nd,"instance",void 0);function jd(e){return jd="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},jd(e)}function _d(){_d=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==jd(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(jd(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 Fd(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 Bd(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Fd(i,r,o,a,s,"next",e)}function s(e){Fd(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Ud(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 Hd(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 Hd(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 Hd(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 qd=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},zd=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+")"):Wd(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},Wd=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()}))},Gd=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){K(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()}))},Vd=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){}},$d=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)},Xd=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=$d(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(zd(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++)Vd(e,t[n].stylesheet,t[n].styletext,t[n].styleId);return!0}))},Jd=function(e,t){return new Promise((function(n,r){return t?Xd(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(Gd(o))}return Promise.all(n)}(e).then((function(){return Xd(e,t).then((function(){n()}))})).catch((function(){console.warn("Gleap: Failed with resolving local resources. Please contact the Gleap support team."),n()}))}))},Kd=function(e,t,n){if(void 0!==e.adoptedStyleSheets)for(var r=0;r<e.adoptedStyleSheets.length;r++){var o=e.adoptedStyleSheets[r],i=$d(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)}},Yd=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},Zd=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)},Qd=["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"],ep=/^table-(row-group|header-group|footer-group|row|column-group)$/,tp=["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"],np=/^(img|video|audio|canvas|iframe|embed|object|svg)$/,rp=/^(input|select|textarea)$/,op=function(e,t,n){return e.setProperty(t,n,"important")},ip=function(e,t){return parseFloat(e.getPropertyValue(t))||0},ap=function(e,t,n){op(e,"box-sizing","border-box"),["width","min-width","max-width"].forEach((function(n){return op(e,n,t+"px")})),["height","min-height","max-height"].forEach((function(t){return op(e,t,n+"px")}))},sp=function(e){return"inline"===e.display&&"auto"===e.width},cp=function(e){return"absolute"===e.position||"fixed"===e.position||"none"!==e.float},lp=function(e){return!/^(visible|clip)$/.test(e.overflowX)||!/^(visible|clip)$/.test(e.overflowY)},up=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)},dp=function(e){return e.assignedSlot||e.parentElement||e.parentNode&&e.parentNode.host||null},pp=function(e){var t=document.createRange();return t.selectNodeContents(e),"function"==typeof t.getClientRects?Array.from(t.getClientRects()):[]},hp=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+=ip(t,"padding-left")+ip(t,"padding-right")+ip(t,"border-left-width")+ip(t,"border-right-width"),r+=ip(t,"padding-top")+ip(t,"padding-bottom")+ip(t,"border-top-width")+ip(t,"border-bottom-width")),{width:n,height:r}},fp=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)}},gp=function(e){for(var t=dp(e);t;t=dp(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return fp(t.getBoundingClientRect(),hp(t,n))}return{x:1,y:1}},mp=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}},vp=function(e){var t=e.createElement("span");return op(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return op(t.style,e,"0")})),t},yp=function e(t,n,r){return up(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(t);if("none"!==o.display&&!cp(o))if("contents"===o.display||sp(o))e(t,n,r);else{var i=mp(t.getBoundingClientRect(),n),a={left:i.left-ip(o,"margin-left"),right:i.right+ip(o,"margin-right"),top:i.top-ip(o,"margin-top"),bottom:i.bottom+ip(o,"margin-bottom"),verticalAlign:o.verticalAlign};0===o.display.indexOf("inline")?("baseline"!==a.verticalAlign||np.test(t.localName)||(a.verticalAlign="middle"),r.atomicInlines.push(a)):r.blocks.push(a)}}})),r},bp=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=vp(e.ownerDocument);op(c.style,"vertical-align",s?s.verticalAlign:"baseline"),ap(c.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(c)}},wp=function e(t,n,r){up(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(Dp(n,t.ownerDocument,!0,r))}}else!function(e,t){var n=pp(t);if(n.length){var r=gp(t),o=e.ownerDocument.createElement("span");op(o.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return op(o.style,e,"0")})),bp(o,n.map((function(e){return mp(e,r)})),[]),e.appendChild(o)}}(t,n)}))},kp=function(e){return!("block"!==e.display&&"list-item"!==e.display||cp(e)||lp(e)||/layout|paint|strict|content/.test(e.contain))},xp=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?ip(n,"top"):0),s="top"===r?a-o:a+t.offsetHeight-i;return Math.abs(s)<=1},Sp=function(e,t,n,r){return r.push(ip(t,"margin-"+n)),!kp(t)||ip(t,"padding-"+n)||ip(t,"border-"+n+"-width")||Cp(e,up(e),n,r),r},Cp=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)||pp(c).length>0))return!1;if(a.nodeType===Node.ELEMENT_NODE){var s=window.getComputedStyle(a);if("none"!==s.display&&!cp(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!xp(t,a,s,r))return!1;if(Sp(a,s,r,o),0!==a.getBoundingClientRect().height||!kp(s))return!1;Sp(a,s,"top"===r?"bottom":"top",o)}else if(!e(t,up(a),r,o))return!1}}var c;return!0},Ep=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},Ip=null,Tp=new Map,Lp=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return Tp.has(n)||((Ip=Ip||document.createElement("canvas").getContext("2d")).font=n,Tp.set(n,Ip.measureText("").fontBoundingBoxAscent)),Tp.get(n)},Op=function e(t,n,r){var o=up(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=pp(a);if(s.length)return s[n?s.length-1:0].top+Lp(dp(a))*r.y}else if(a.nodeType===Node.ELEMENT_NODE){var c=window.getComputedStyle(a);if("none"===c.display||cp(c))continue;if(np.test(a.localName)){if("baseline"===c.verticalAlign)return a.getBoundingClientRect().bottom+ip(c,"margin-bottom")*r.y;continue}var l=e(a,n,r);if(null!==l)return l}}return null},Ap=function(e,t){if("table-cell"===t.display)return"baseline"===t.verticalAlign?"first":null;var n=function(e){for(var t=dp(e);t&&"contents"===window.getComputedStyle(t).display;)t=dp(t);return t}(e),r=n&&window.getComputedStyle(n);if(r&&/flex|grid/.test(r.display)&&!cp(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)||np.test(e.localName)||rp.test(e.localName)?null:"inline-block"===t.display&&"button"!==e.localName?lp(t)?null:"last":"first"},Mp=function(e,t,n){op(e.style,"font-size","0"),op(e.style,"line-height","0");var r=vp(e.ownerDocument);op(r.style,"vertical-align",t-n+"px"),ap(r.style,0,n),e.appendChild(r)},Rp=function(e,t,n){var r=e.style,o=n.display,i="table-cell"===o,a=hp(t,n);op(r,"display","inline"===o?"inline-block":o),i?tp.forEach((function(e){return op(r,e,n.getPropertyValue(e))})):(ap(r,a.width,a.height),op(r,"padding","0"),op(r,"border-width","0"),op(r,"margin-top",Ep(Sp(t,n,"top",[]))+"px"),op(r,"margin-bottom",Ep(Sp(t,n,"bottom",[]))+"px"));var s=Ap(t,n);if(s){var c=t.getBoundingClientRect(),l=fp(c,{width:t.offsetWidth,height:t.offsetHeight}),u=Op(t,"last"===s,l);if(null!==u&&!isNaN(u)){var d=(u-c.top)/l.y;if(i){var p=d-t.clientTop-ip(n,"padding-top");Mp(e,p,p)}else op(r,"display","inline-block"),Mp(e,d,a.height)}}},Pp=function(e,t){var n=e.style,r=gp(t),o=yp(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 op(n,"display","block"),op(n,"margin-top","0"),op(n,"margin-bottom","0"),void ap(n,i.right-i.left,i.bottom-i.top)}op(n,"display","inline"),op(n,"padding","0"),op(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&&!cp(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)}bp(e,Array.from(t.getClientRects(),(function(e){return mp(e,r)})),o.atomicInlines)},Dp=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=Ud(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"),tp.forEach((function(e){return r.setProperty(e,n.getPropertyValue(e))}))}else ep.test(n.display)&&wp(e,t,!0)}(o,e,i),o;Qd.forEach((function(e){return op(a,e,i.getPropertyValue(e))})),op(a,"visibility","hidden"),"none"===s||"contents"===s||ep.test(s)?(op(a,"display",s),"none"!==s&&wp(o,e,"contents"!==s)):e instanceof HTMLElement&&sp(i)?Pp(o,e):Rp(o,e,i)}catch(c){}return o},Np=function(){var e=Bd(_d().mark((function e(t,n){var r,o,i,a,s,c,l;return _d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=1,o=Yd(new Map,window.document),i=Da(n),a=null,s=function(){var e=Bd(_d().mark((function e(t,c,l,u){var d,p,h,f,g,m,v,y,b,w,k,x,S,C;return _d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(d=t.nodeType==Node.ELEMENT_NODE)||!Oa(t,n)){e.next=7;break}return a=a||document.implementation.createHTMLDocument(""),p=Dp(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(h=u||d&&La(t,n),f=function(){var e=Bd(_d().mark((function e(t,n,r){return _d().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,h);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=Zd(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,K(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=Ma(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++,Yd(o,t.shadowRoot),e.next=41,f(t.shadowRoot.firstChild,g,x);case 41:Kd(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,f(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()}}),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),Kd(window.document,l),e.abrupt("return",c);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),jp=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){}}},_p=function(e,t){return new Promise(function(){var n=Bd(_d().mark((function n(r,o){var i,a,s,c,l,u,d,p,h,f,g,m,v,y,b;return _d().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,Np(window.document.documentElement,t);case 5:s=n.sent;try{jp(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="",h=s.querySelectorAll("base"),a=0;a<h.length;++a)h[a].href&&(p=h[a].href),h[a].remove();for(f=window.location.href.substring(0,window.location.href.lastIndexOf("/")),g=f+"/",p&&(p.startsWith("http")?g=p:(g=f+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");Jd(s,e).then((function(){var e=qd(s);r({html:e,baseUrl:f,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 Fp=Math.min,Bp=Math.max,Up=Math.round,Hp=Math.floor,qp=e=>({x:e,y:e}),zp={left:"right",right:"left",bottom:"top",top:"bottom"},Wp={start:"end",end:"start"};function Gp(e,t,n){return Bp(e,Fp(t,n))}function Vp(e,t){return"function"==typeof e?e(t):e}function $p(e){return e.split("-")[0]}function Xp(e){return e.split("-")[1]}function Jp(e){return"x"===e?"y":"x"}function Kp(e){return"y"===e?"height":"width"}const Yp=new Set(["top","bottom"]);function Zp(e){return Yp.has($p(e))?"y":"x"}function Qp(e){return Jp(Zp(e))}function eh(e){return e.replace(/start|end/g,(e=>Wp[e]))}const th=["left","right"],nh=["right","left"],rh=["top","bottom"],oh=["bottom","top"];function ih(e,t,n,r){const o=Xp(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?nh:th:t?th:nh;case"left":case"right":return t?rh:oh;default:return[]}}($p(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(eh)))),i}function ah(e){return e.replace(/left|right|bottom|top/g,(e=>zp[e]))}function sh(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 ch(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 lh(e,t,n){let{reference:r,floating:o}=e;const i=Zp(t),a=Qp(t),s=Kp(a),c=$p(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 h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Xp(t)){case"start":h[a]-=p*(n&&l?-1:1);break;case"end":h[a]+=p*(n&&l?-1:1)}return h}async function uh(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:h=0}=Vp(t,e),f=sh(h),g=s[p?"floating"===d?"reference":"floating":d],m=ch(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=ch(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(m.top-w.top+f.top)/b.y,bottom:(w.bottom-m.bottom+f.bottom)/b.y,left:(m.left-w.left+f.left)/b.x,right:(w.right-m.right+f.right)/b.x}}const dh=new Set(["left","top"]);function ph(){return"undefined"!=typeof window}function hh(e){return mh(e)?(e.nodeName||"").toLowerCase():"#document"}function fh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function gh(e){var t;return null==(t=(mh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function mh(e){return!!ph()&&(e instanceof Node||e instanceof fh(e).Node)}function vh(e){return!!ph()&&(e instanceof Element||e instanceof fh(e).Element)}function yh(e){return!!ph()&&(e instanceof HTMLElement||e instanceof fh(e).HTMLElement)}function bh(e){return!(!ph()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof fh(e).ShadowRoot)}const wh=new Set(["inline","contents"]);function kh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ph(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!wh.has(o)}const xh=new Set(["table","td","th"]);function Sh(e){return xh.has(hh(e))}const Ch=[":popover-open",":modal"];function Eh(e){return Ch.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const Ih=["transform","translate","scale","rotate","perspective"],Th=["transform","translate","scale","rotate","perspective","filter"],Lh=["paint","layout","strict","content"];function Oh(e){const t=Ah(),n=vh(e)?Ph(e):e;return Ih.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Th.some((e=>(n.willChange||"").includes(e)))||Lh.some((e=>(n.contain||"").includes(e)))}function Ah(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Mh=new Set(["html","body","#document"]);function Rh(e){return Mh.has(hh(e))}function Ph(e){return fh(e).getComputedStyle(e)}function Dh(e){return vh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nh(e){if("html"===hh(e))return e;const t=e.assignedSlot||e.parentNode||bh(e)&&e.host||gh(e);return bh(t)?t.host:t}function jh(e){const t=Nh(e);return Rh(t)?e.ownerDocument?e.ownerDocument.body:e.body:yh(t)&&kh(t)?t:jh(t)}function _h(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=jh(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=fh(o);if(i){const e=Fh(a);return t.concat(a,a.visualViewport||[],kh(o)?o:[],e&&n?_h(e):[])}return t.concat(o,_h(o,[],n))}function Fh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bh(e){const t=Ph(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=yh(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Up(n)!==i||Up(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Uh(e){return vh(e)?e:e.contextElement}function Hh(e){const t=Uh(e);if(!yh(t))return qp(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Bh(t);let a=(i?Up(n.width):n.width)/r,s=(i?Up(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const qh=qp(0);function zh(e){const t=fh(e);return Ah()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:qh}function Wh(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Uh(e);let a=qp(1);t&&(r?vh(r)&&(a=Hh(r)):a=Hh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==fh(e))&&t}(i,n,r)?zh(i):qp(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=fh(i),t=r&&vh(r)?fh(r):r;let n=e,o=Fh(n);for(;o&&r&&t!==n;){const e=Hh(o),t=o.getBoundingClientRect(),r=Ph(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=fh(o),o=Fh(n)}}return ch({width:u,height:d,x:c,y:l})}function Gh(e,t){const n=Dh(e).scrollLeft;return t?t.left+n:Wh(gh(e)).left+n}function Vh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Gh(e,n),y:n.top+t.scrollTop}}const $h=25;const Xh=new Set(["absolute","fixed"]);function Jh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=fh(e),r=gh(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=Ah();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=Gh(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<=$h&&(i-=a)}else l<=$h&&(i+=l);return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=gh(e),n=Dh(e),r=e.ownerDocument.body,o=Bp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Bp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Gh(e);const s=-n.scrollTop;return"rtl"===Ph(r).direction&&(a+=Bp(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(gh(e));else if(vh(t))r=function(e,t){const n=Wh(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=yh(e)?Hh(e):qp(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=zh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ch(r)}function Kh(e,t){const n=Nh(e);return!(n===t||!vh(n)||Rh(n))&&("fixed"===Ph(n).position||Kh(n,t))}function Yh(e,t,n){const r=yh(t),o=gh(t),i="fixed"===n,a=Wh(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=qp(0);function l(){c.x=Gh(o)}if(r||!r&&!i)if(("body"!==hh(t)||kh(o))&&(s=Dh(t)),r){const e=Wh(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?qp(0):Vh(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 Zh(e){return"static"===Ph(e).position}function Qh(e,t){if(!yh(e)||"fixed"===Ph(e).position)return null;if(t)return t(e);let n=e.offsetParent;return gh(e)===n&&(n=n.ownerDocument.body),n}function ef(e,t){const n=fh(e);if(Eh(e))return n;if(!yh(e)){let t=Nh(e);for(;t&&!Rh(t);){if(vh(t)&&!Zh(t))return t;t=Nh(t)}return n}let r=Qh(e,t);for(;r&&Sh(r)&&Zh(r);)r=Qh(r,t);return r&&Rh(r)&&Zh(r)&&!Oh(r)?n:r||function(e){let t=Nh(e);for(;yh(t)&&!Rh(t);){if(Oh(t))return t;if(Eh(t))return null;t=Nh(t)}return null}(e)||n}const tf={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=gh(r),s=!!t&&Eh(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=qp(1);const u=qp(0),d=yh(r);if((d||!d&&!i)&&(("body"!==hh(r)||kh(a))&&(c=Dh(r)),yh(r))){const e=Wh(r);l=Hh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?qp(0):Vh(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:gh,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?Eh(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=_h(e,[],!1).filter((e=>vh(e)&&"body"!==hh(e))),o=null;const i="fixed"===Ph(e).position;let a=i?Nh(e):e;for(;vh(a)&&!Rh(a);){const t=Ph(a),n=Oh(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Xh.has(o.position)||kh(a)&&!n&&Kh(e,a))?r=r.filter((e=>e!==a)):o=t,a=Nh(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],c=a.reduce(((e,n)=>{const r=Jh(t,n,o);return e.top=Bp(r.top,e.top),e.right=Fp(r.right,e.right),e.bottom=Fp(r.bottom,e.bottom),e.left=Bp(r.left,e.left),e}),Jh(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:ef,getElementRects:async function(e){const t=this.getOffsetParent||ef,n=this.getDimensions,r=await n(e.floating);return{reference:Yh(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}=Bh(e);return{width:t,height:n}},getScale:Hh,isElement:vh,isRTL:function(e){return"rtl"===Ph(e).direction}};function nf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rf(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=Uh(e),u=o||i?[...l?_h(l):[],..._h(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=gh(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:h}=l;if(s||t(),!p||!h)return;const f={rootMargin:-Hp(d)+"px "+-Hp(o.clientWidth-(u+p))+"px "+-Hp(o.clientHeight-(d+h))+"px "+-Hp(u)+"px",threshold:Bp(0,Fp(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||nf(l,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(l,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),l&&!c&&f.observe(l),f.observe(t));let g=c?Wh(e):null;return c&&function t(){const r=Wh(e);g&&!nf(g,r)&&n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const of=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=$p(n),s=Xp(n),c="y"===Zp(n),l=dh.has(a)?-1:1,u=i&&c?-1:1,d=Vp(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),c?{x:h*u,y:p*l}:{x:p*l,y:h*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}}}}},af=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}=Vp(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),p=Zp($p(o)),h=Jp(p);let f=u[h],g=u[p];if(a){const e="y"===h?"bottom":"right";f=Gp(f+d["y"===h?"top":"left"],f,f-d[e])}if(s){const e="y"===p?"bottom":"right";g=Gp(g+d["y"===p?"top":"left"],g,g-d[e])}const m=c.fn({...t,[h]:f,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:s}}}}}},sf=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:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=Vp(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=$p(o),y=Zp(s),b=$p(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),k=p||(b||!g?[ah(s)]:function(e){const t=ah(e);return[eh(e),t,eh(t)]}(s)),x="none"!==f;!p&&x&&k.push(...ih(s,g,f,w));const S=[s,...k],C=await c.detectOverflow(t,m),E=[];let I=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Xp(e),o=Qp(e),i=Kp(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ah(a)),[a,ah(a)]}(o,a,w);E.push(C[e[0]],C[e[1]])}if(I=[...I,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,L;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&y!==Zp(t))||I.every((e=>Zp(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}}}let n=null==(L=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:L.placement;if(!n)switch(h){case"bestFit":{var O;const e=null==(O=I.filter((e=>{if(x){const t=Zp(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{}}}},cf=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}=Vp(e,t)||{};if(null==l)return{};const d=sh(u),p={x:n,y:r},h=Qp(o),f=Kp(h),g=await a.getDimensions(l),m="y"===h,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[h]-p[h]-i.floating[f],k=p[h]-i.reference[h],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let S=x?x[b]:0;S&&await(null==a.isElement?void 0:a.isElement(x))||(S=s.floating[b]||i.floating[f]);const C=w/2-k/2,E=S/2-g[f]/2-1,I=Fp(d[v],E),T=Fp(d[y],E),L=I,O=S-g[f]-T,A=S/2-g[f]/2+C,M=Gp(L,A,O),R=!c.arrow&&null!=Xp(o)&&A!==M&&i.reference[f]/2-(A<L?I:T)-g[f]/2<0,P=R?A<L?A-L:A-O:0;return{[h]:p[h]+P,data:{[h]:M,centerOffset:A-M-P,...R&&{alignmentOffset:P}},reset:R}}}),lf=(e,t,n)=>{const r=new Map,o={platform:tf,...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}=lh(l,r,c),p=r,h={},f=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:h,rects:l,platform:{...a,detectOverflow:null!=(g=a.detectOverflow)?g:uh},elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,h={...h,[n]:{...h[n],...b}},w&&f<=50&&(f++,"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}=lh(l,p,c))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var uf=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},df=["notcontains","isnot"],pf=function(e){return Boolean(e&&e.pageFilter&&e.pageFilter.length>0)},hf=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(pf);if(0===n.length)return!0;var r=n.filter((function(e){return!df.includes(e.pageFilterType)})),o=n.filter((function(e){return df.includes(e.pageFilterType)})),i=0===r.length||r.some((function(t){return uf(e,t.pageFilter,t.pageFilterType)})),a=0===o.length||o.every((function(t){return uf(e,t.pageFilter,t.pageFilterType)}));return i&&a};function ff(e){return ff="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},ff(e)}function gf(e){return function(e){if(Array.isArray(e))return mf(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 mf(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 mf(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 mf(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 vf(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,bf(r.key),r)}}function yf(e,t,n){return(t=bf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bf(e){var t=function(e,t){if("object"!=ff(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ff(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ff(t)?t:String(t)}var wf=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),yf(this,"tooltips",[]),yf(this,"filteredTooltips",[]),yf(this,"lastUrl",null),yf(this,"elementToFloatingUIMap",new WeakMap),yf(this,"elementToTooltipMap",new WeakMap),yf(this,"nextId",0),yf(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(he(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)}}})),yf(this,"updateFilteredTooltips",(function(){t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),yf(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?hf(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!uf(e,t.page,t.pageType)}))})),yf(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){}}})),yf(this,"load",(function(){var e=t,n=Tf.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(gf(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=rf(e,r,(function(){lf(e,r,{placement:"left"===n.posX?"left":"right",middleware:[of(10),sf(),af(),cf({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(h){}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&&vf(t.prototype,n),r&&vf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function kf(e){return kf="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},kf(e)}function xf(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 Sf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xf(Object(n),!0).forEach((function(t){Ef(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return 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,If(r.key),r)}}function Ef(e,t,n){return(t=If(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function If(e){var t=function(e,t){if("object"!=kf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=kf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kf(t)?t:String(t)}yf(wf,"instance",void 0);var Tf=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),Ef(this,"region",Ct),Ef(this,"apiUrl",St[Ct].apiUrl),Ef(this,"wsApiUrl",St[Ct].wsApiUrl),Ef(this,"realtimeHost",void 0),Ef(this,"sdkKey",null),Ef(this,"updatingSession",!1),Ef(this,"fileRefreshTimeout",null),Ef(this,"useCookies",!0),Ef(this,"localStorageDisabled",!1),Ef(this,"session",{gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0}),Ef(this,"ready",!1),Ef(this,"onSessionReadyListener",[]),Ef(this,"lastIdentify",null),Ef(this,"identifyInFlight",!1),Ef(this,"setOnSessionReady",(function(e){t.ready?e():t.onSessionReadyListener.push(e)})),Ef(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))})),Ef(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&&Ht.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,Zf.getInstance().sendMessage({name:"session-cleared"},!0),Om.getInstance().clearAllNotifications(!1),Om.getInstance().setNotificationCount(0),cr.getInstance().removeBannerUI(),Eg.getInstance().hideModal(),r&&t.scheduleSessionRetry(n)})),Ef(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)}})),Ef(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=Zf.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()}})),Ef(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=Sf(Sf({},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&&Ht.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&&Ht.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),c&&(setTimeout((function(){A.getInstance().clearCache(),x.getInstance().clearCache(),Iv.getInstance().restart();var e=wf.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,h=d.userData,f=d.userHash;null===(l=t.identifySession(p,h,f,!0))||void 0===l||null===(u=l.catch)||void 0===u||u.call(l,(function(){}))}}})),Ef(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){}})),Ef(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:Hv.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))})),Ef(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)})),Ef(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})),Ef(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:Sf(Sf({},e),{},{lang:Hv.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}),type:"js",sdkVersion:"19.1.1",ws:!0}))}))}))}})),Ef(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=Sf({},n);n.customData&&(delete a.customData,a=Sf(Sf({},a),n.customData)),t.send(JSON.stringify(Sf(Sf({},a),{},{userId:e,userHash:r,lang:Hv.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"})))}))}))}})),Ef(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}))}))}))})),Ef(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(St,t)?t:null}(e);if(!t)return console.warn('Gleap: Unknown region "'.concat(e,'". Supported regions: ').concat(Object.keys(St).join(", "),". Region not changed.")),!1;var n=St[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=[],Zf.getInstance().sendSessionUpdate()}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Cf(t.prototype,n),r&&Cf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Lf(e){return Lf="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},Lf(e)}function Of(){Of=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==Lf(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(Lf(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 Af(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 Mf(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Af(i,r,o,a,s,"next",e)}function s(e){Af(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Rf(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 Pf(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 Pf(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 Pf(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 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,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"!=Lf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Lf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Lf(t)?t:String(t)}Ef(Tf,"instance",void 0);var _f=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),Nf(this,"rerender",void 0),Nf(this,"stream",void 0),Nf(this,"mediaRecorder",void 0),Nf(this,"audioMuted",!1),Nf(this,"audioAvailable",!0),Nf(this,"available",!0),Nf(this,"isRecording",!1),Nf(this,"file",null),Nf(this,"maxRecordTime",e.MAX_RECORD_TIME),Nf(this,"recordTime",0),Nf(this,"recordingTimer",null),Nf(this,"permissionErrorText",""),Nf(this,"_displayVideoTrack",null),Nf(this,"_displayStream",null),Nf(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=Rf(e.MIME_TYPES);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(window.MediaRecorder&&MediaRecorder.isTypeSupported(r))return r}}catch(ty){n.e(ty)}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=Mf(Of().mark((function t(){var n,r;return Of().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.releaseCapture(),this.rerender()}}},{key:"releaseCapture",value:function(){this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),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}},{key:"startAudioRecording",value:(i=Mf(Of().mark((function e(){var t,n,r,o;return Of().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.isRecording?r.stopScreenRecording():r.releaseCapture()}),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=Mf(Of().mark((function e(t){return Of().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",Tf.getInstance().apiUrl+"/uploads/sdk"),Tf.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&&Df(t.prototype,n),r&&Df(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ff(e){return Ff="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},Ff(e)}function Bf(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?Bf(Object(n),!0).forEach((function(t){qf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hf(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 qf(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"!=Ff(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ff(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ff(t)?t:String(t)}Nf(_f,"MAX_RECORD_TIME",120),Nf(_f,"MAX_WIDTH",3072),Nf(_f,"MAX_HEIGHT",1728),Nf(_f,"IDEAL_FRAME_RATE",10),Nf(_f,"MAX_FRAME_RATE",24),Nf(_f,"CHUNK_INTERVAL",200),Nf(_f,"TIMER_UPDATE_INTERVAL",1e3),Nf(_f,"RERENDER_DELAY",100),Nf(_f,"MIME_TYPES",["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm","video/mp4"]),Nf(_f,"SELECTORS",{PREVIEW_VIDEO:".bb-capture-preview video",TIMER_LABEL:".bb-capture-toolbar-item-timer"});var Wf=[["webReplay"],["screenshotData","networkLogs"]],Gf=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),qf(this,"excludeData",{}),qf(this,"type","BUG"),qf(this,"priority","LOW"),qf(this,"customData",{}),qf(this,"ticketAttributes",{}),qf(this,"metaData",{}),qf(this,"consoleLog",[]),qf(this,"networkLogs",[]),qf(this,"customEventLog",[]),qf(this,"formData",{}),qf(this,"isSilent",!1),qf(this,"outboundId",void 0),qf(this,"screenshotData",void 0),qf(this,"webReplay",void 0),qf(this,"screenRecordingUrl",void 0),qf(this,"screenRecordingData",void 0),qf(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=Qv.getInstance();this.customData=Nd.getInstance().getCustomData(),this.metaData=yg.getInstance().getMetaData(),this.consoleLog=Sd.getInstance().getLogs(),this.networkLogs=Cm.getInstance().getRequests(),this.customEventLog=Iv.getInstance().getEventArray(),this.ticketAttributes=Nd.getInstance().getTicketAttributes();var n=[],r=t.getGlobalDataItem("webReplay");null!==r&&(this.webReplay=r);var o,i,a,s,c,l=this.isSilent?null:t.getGlobalDataItem("screenRecordingData");if(null!=l){this.screenRecordingData=l;var u=_f.uploadScreenRecording(l).then((function(t){t&&(e.screenRecordingUrl=t)}));n.push(u)}if(!this.excludeData||!this.excludeData.screenshot){var d=(s=t.isLiveMode(),c=Ga.getInstance().customOptions,_p(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:Uf(Uf({},this.ticketAttributes),this.formData),isSilent:this.isSilent,outbound:this.outboundId,screenshotData:this.screenshotData,webReplay:this.webReplay,screenRecordingUrl:this.screenRecordingUrl,spamToken:this.spamToken},t=jv.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:"forgetSentScreenRecording",value:function(){try{var e=Qv.getInstance();this.screenRecordingData&&e.getGlobalDataItem("screenRecordingData")===this.screenRecordingData&&e.setGlobalDataItem("screenRecordingData",null)}catch(t){}}},{key:"sendFeedback",value:function(){var e=this,t=this;return new Promise((function(n,r){e.takeSnapshot().then((function(){var o=e.getData();!function e(i){var a=new XMLHttpRequest;a.open("POST",Tf.getInstance().apiUrl+"/bugs/v2"),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),Tf.getInstance().injectSession(a),a.onerror=function(e){r()},a.onreadystatechange=function(s){if(4===a.readyState)if(200===a.status||201===a.status){t.forgetSentScreenRecording();try{var c=JSON.parse(a.responseText);n(c)}catch(l){r()}}else 413===a.status&&i<Wf.length?(Wf[i].forEach((function(e){return delete o[e]})),e(i+1)):r()},a.send(JSON.stringify(o))}(0)})).catch((function(e){console.log("Failed to take snapshot",e),r()}))}))}}],n&&Hf(t.prototype,n),r&&Hf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Vf(e){return Vf="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},Vf(e)}function $f(e){return function(e){if(Array.isArray(e))return Xf(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 Xf(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 Xf(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 Xf(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 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,Yf(r.key),r)}}function Kf(e,t,n){return(t=Yf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yf(e){var t=function(e,t){if("object"!=Vf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Vf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vf(t)?t:String(t)}var Zf=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),Kf(this,"frameUrl","https://messenger-app.gleap.io"),Kf(this,"gleapFrameContainer",null),Kf(this,"gleapFrame",null),Kf(this,"comReady",!1),Kf(this,"injectedFrame",!1),Kf(this,"widgetOpened",!1),Kf(this,"listeners",[]),Kf(this,"appMode","widget"),Kf(this,"markerManager",void 0),Kf(this,"escListener",void 0),Kf(this,"frameHeight",0),Kf(this,"sendingFeedback",!1),Kf(this,"queue",[]),Kf(this,"widgetExpanded",void 0),Kf(this,"appliedWidgetExpanded",!1),Kf(this,"lastWidgetSizeUpdate",null),Kf(this,"captureHidden",!1),Kf(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})),Kf(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")})),Kf(this,"injectFrame",(function(){t.injectedFrame||(t.injectedFrame=!0,t.autoWhiteListCookieManager(),se((function(){Xu.getInstance().onConfigLoaded((function(){Xu.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,"&").replace(/</g,"<").replace(/>/g,">"):"",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"> </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,""");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 h=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(h?'\n <div class="gleap-frame-loader-ramp"></div>':"","\n </div>\n </div>")}if(o){var f=String(r.bgImage).replace(/"/g,"""),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(f,'" 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>")}(Xu.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"),J(t.gleapFrame,t.frameUrl),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),Kf(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()}}))})),Kf(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=Xu.getInstance().getFlowConfig();p.feedbackButtonPosition!==N.FEEDBACK_BUTTON_CLASSIC&&p.feedbackButtonPosition!==N.FEEDBACK_BUTTON_CLASSIC_BOTTOM||(d=o),p.feedbackButtonPosition===N.FEEDBACK_BUTTON_CLASSIC_LEFT&&(d=i),p.feedbackButtonPosition===N.FEEDBACK_BUTTON_BOTTOM_LEFT&&(d=a),null===N.getInstance().buttonHidden?p.feedbackButtonPosition===N.FEEDBACK_BUTTON_NONE&&(d=s):N.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",Hv.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=Xu.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.captureHidden||(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,this.captureHidden=!1;try{bu&&bu.getInstance().onWidgetDestroyed()}catch(e){}}},{key:"setCaptureHidden",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.captureHidden=!!e;var n=this.gleapFrameContainer;if(n&&n.classList.toggle("gleap-frame-container--capture-hidden",this.captureHidden),this.captureHidden)return this.unregisterEscListener(),void this.setCaptureEditorOpen(!1);n&&(this.widgetOpened?this.registerEscListener():t&&this.showWidget())}},{key:"isCaptureHidden",value:function(){return this.captureHidden}},{key:"setCaptureEditorOpen",value:function(e){this.gleapFrameContainer&&this.gleapFrameContainer.classList.toggle("gleap-frame-container--capture-editor",!!e)}},{key:"sendCaptureCapabilities",value:function(){if(this.comReady)try{this.sendMessage({name:"capture-capabilities",data:tr()})}catch(e){}}},{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(),Qv.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),Ht.notifyEvent("open"),this.registerEscListener())}},{key:"updateUI",value:function(){Om.getInstance().clearAllNotifications(this.isSurvey()),N.getInstance().updateNotificationBadge(0),N.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.setCaptureEditorOpen(!1),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(),N.getInstance().updateFeedbackButtonState(),Ht.notifyEvent("close"),Om.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:Tf.getInstance().getSession(),apiUrl:Tf.getInstance().apiUrl,realtimeHost:Tf.getInstance().realtimeHost,sdkKey:Tf.getInstance().sdkKey}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:Xu.getInstance().getFlowConfig(),aiTools:Kt.getInstance().getAgentTools(),agentTools:Kt.getInstance().getAgentTools(),overrideLanguage:Hv.getInstance().getOverrideLanguage()}}),this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0))}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new hg(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=$f(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.sendCaptureCapabilities(),e.workThroughQueue(),setTimeout((function(){e.runWidgetShouldOpenCallback()}),300)),"play-ping"===t.name&&Un.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 r=t.data,o=!!t.newTab;e.urlHandler(r,o)}var i;if("start-product-tour"===t.name&&Qv.startProductTour(null===(i=t.data)||void 0===i?void 0:i.tourId,!0),"run-custom-action"===t.name&&Ad.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&&(N.getInstance().showingRedDot=!0,N.getInstance().updateRedDot(!0)),"video-call-left"===t.name&&(N.getInstance().showingRedDot=!1,N.getInstance().updateRedDot(!1)),"tool-execution"===t.name&&(Ht.notifyEvent("tool-execution",t.data),Kt.getInstance().triggerToolAction(t.data)),"frontend-tool-execute"===t.name&&t.data&&Kt.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 h,f=t.data;Ht.notifyEvent("checklist-completed",{checklistId:f.id,outboundId:null===(h=f.outbound)||void 0===h?void 0:h.id,completedSteps:f.completedSteps,status:f.status,data:f})}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 Gf(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){}Qv.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),!bu||"capture-start"!==t.name&&"capture-cancel"!==t.name&&"capture-editor"!==t.name&&"capture-done"!==t.name||bu.getInstance().handleMessengerMessage(t)})),window.addEventListener("message",(function(t){var n=cr.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:Nd.getInstance().getCustomData(),metaData:yg.getInstance().getMetaData(),consoleLog:Sd.getInstance().getLogs(),networkLogs:Cm.getInstance().getRequests(),customEventLog:Iv.getInstance().getEventArray(),formData:Nd.getInstance().getTicketAttributes()},r=jv.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&&Jf(t.prototype,n),r&&Jf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Qf(e){return Qf="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},Qf(e)}function eg(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,ng(r.key),r)}}function tg(e,t,n){return(t=ng(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ng(e){var t=function(e,t){if("object"!=Qf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Qf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qf(t)?t:String(t)}Kf(Zf,"instance",void 0);var rg=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),tg(this,"rerender",void 0),tg(this,"svgElement",null),tg(this,"path",null),tg(this,"strPath",void 0),tg(this,"strokeWidth",12),tg(this,"strokeWidthRect",6),tg(this,"bufferSize",4),tg(this,"buffer",[]),tg(this,"startPoint",null),tg(this,"tool","rect"),tg(this,"color","#EB144C"),tg(this,"mouseDown",null),tg(this,"mouseMove",null),tg(this,"mouseUp",null),tg(this,"resizeListener",null),tg(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&&eg(t.prototype,n),r&&eg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function og(e){return og="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},og(e)}function ig(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,sg(r.key),r)}}function ag(e,t,n){return(t=sg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sg(e){var t=function(e,t){if("object"!=og(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=og(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==og(t)?t:String(t)}var cg=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ag(this,"keys",{37:1,38:1,39:1,40:1}),ag(this,"supportsPassive",!1),ag(this,"wheelOpt",!!this.supportsPassive&&{passive:!1}),ag(this,"wheelEvent","onwheel"in document.createElement("div")?"wheel":"mousewheel"),ag(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}}])&&ig(t.prototype,n),r&&ig(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function lg(e){return lg="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},lg(e)}function ug(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,pg(r.key),r)}}function dg(e,t,n){return(t=pg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pg(e){var t=function(e,t){if("object"!=lg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=lg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lg(t)?t:String(t)}ag(cg,"instance",void 0);var hg=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),dg(this,"type","screenshot"),dg(this,"dragCursor",null),dg(this,"screenRecorder",null),dg(this,"callback",null),dg(this,"screenDrawer",null),dg(this,"escListener",null),dg(this,"pageLeaveListener",null),dg(this,"overrideLanguage",Qv.getInstance().overrideLanguage),dg(this,"showNextStep",(function(){this.showWidgetUI(),this.callback&&(Zf.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&&cg.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(he("dismiss"),"</div>\n <div class='bb-capture-editor-drag-info'>").concat(he("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(he("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(he("recorderon"),"\n ").concat(he("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(he("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(he("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(he("rect"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="pen">\n ').concat(he("pen"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="blur">\n ').concat(he("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(Hv.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(he("undo"),'\n <span class="bb-tooltip">').concat(Hv.translateText("undo"),"</span>\n </div>\n ").concat("capture"!==this.type?'<div class="bb-capture-button-next">'.concat(Hv.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(Hv.translateText("retry"),'</div>\n <div class="bb-capture-preview-sendbutton">').concat(Hv.translateText("next"),"</div>\n </div>\n </div>\n </div>\n "),document.body.appendChild(e),e.setAttribute("dir",Hv.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?(Qv.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),cg.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new rg(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"),h=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){}}},f=document.querySelectorAll(".bb-capture-toolbar-item"),g=function(){var e=f[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(),h("pointer",document.querySelector(".bb-capture-toolbar-item[data-type='pointer']")))),("capture"!==o.type||o.screenRecorder.isRecording)&&("pen"!==t&&"blur"!==t&&"rect"!==t&&"pointer"!==t||h(t,e),"colorpicker"===t&&("flex"===d.style.display?d.style.display="none":d.style.display="flex"),"undo"===t&&o.screenDrawer.removeLastAddedPathFromSvg())}},m=0;m<f.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&&Qv.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=Hv.translateText("unmute")):(u.classList.remove("bb-capture-toolbar-item--inactivecross"),o.innerHTML=Hv.translateText("mute"))):(u.classList.add(e),u.classList.add("bb-capture-toolbar-item--inactivecross"),o.innerHTML=Hv.translateText("browserNotSupported"));break;case"recording":this.screenRecorder.available?(u.classList.remove(e),this.screenRecorder.isRecording?(u.setAttribute("data-active","true"),r.innerHTML=Hv.translateText("stopRecording"),t.style.display="block"):(u.setAttribute("data-active","false"),r.innerHTML=Hv.translateText("startRecording"),t.style.display="none")):(u.classList.add(e),r.innerHTML=Hv.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 _f(this.captureRenderer.bind(this),Hv.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&&ug(t.prototype,n),r&&ug(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fg(e){return fg="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},fg(e)}function gg(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,vg(r.key),r)}}function mg(e,t,n){return(t=vg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vg(e){var t=function(e,t){if("object"!=fg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=fg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fg(t)?t:String(t)}var yg=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),mg(this,"sessionStart",new Date),mg(this,"appBuildNumber",""),mg(this,"appVersionCode",""),mg(this,"environment","prod"),mg(this,"envDataPropsToIgnore",[]),mg(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.1.1",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&&gg(t.prototype,n),r&&gg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function bg(e){return bg="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},bg(e)}function wg(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 kg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wg(Object(n),!0).forEach((function(t){Sg(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xg(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,Cg(r.key),r)}}function Sg(e,t,n){return(t=Cg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cg(e){var t=function(e,t){if("object"!=bg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=bg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bg(t)?t:String(t)}mg(yg,"instance",void 0);var Eg=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Sg(this,"modalUrl","https://outboundmedia.gleap.io/modal"),Sg(this,"modalContainer",null),Sg(this,"modalData",null),Sg(this,"modalBackdropClickListener",null),Sg(this,"modalResizeListener",null),Sg(this,"modalLoadTimeout",null),Sg(this,"modalLoaded",!1),Sg(this,"lastSentMaxHeight",0),Sg(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,h,f,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(),$n(m.name))return;if("start-conversation"===m.name&&Qv.startBot(null===(a=m.data)||void 0===a?void 0:a.botId),"start-custom-action"===m.name&&Qv.triggerCustomAction(null===(s=m.data)||void 0===s?void 0:s.action),"start-product-tour"===m.name&&Qv.startProductTour(null===(c=m.data)||void 0===c?void 0:c.tourId,!0),"open-url"===m.name){var w=m.data,k=!!m.newTab;Zf.getInstance().urlHandler(w,k)}"show-form"===m.name&&Qv.startFeedbackFlow(null===(l=m.data)||void 0===l?void 0:l.formId),"show-survey"===m.name&&Qv.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&&Qv.openNewsArticle(null===(p=m.data)||void 0===p?void 0:p.articleId),"show-help-article"===m.name&&Qv.openHelpCenterArticle(null===(h=m.data)||void 0===h?void 0:h.articleId),"show-checklist"===m.name&&Qv.startChecklist(null===(f=m.data)||void 0===f?void 0:f.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&&(J(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=Xu.getInstance().getFlowConfig(),t=e.color?e.color:"#485BFF",n=e.backgroundColor?e.backgroundColor:"#FFFFFF";this.lastSentMaxHeight=this._maxModalHeight(),this._postMessage({name:"modal-data",data:kg(kg({},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(kg(kg({},e),{},{type:"modal"})),"*")}catch(ty){}}},{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"))}}])&&xg(t.prototype,n),r&&xg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ig(e){return Ig="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},Ig(e)}Sg(Eg,"instance",void 0);var Tg=["gleap.io","gleap.ai"],Lg="[REDACTED]",Og="[body not captured]",Ag=["authorization","proxy-authorization","cookie","set-cookie"],Mg=/^[^\s=&]+=[^\s&]*(?:&[^\s=&]+=[^\s&]*)*$/,Rg=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},Pg=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},Dg=function(e,t){return"string"==typeof t&&-1!==e.props.indexOf(t.toLowerCase())},Ng=function(e,t){for(var n={},r=!1,o=Object.keys(e),i=0;i<o.length;i++){var a=o[i];Dg(t,a)?r=!0:-1!==Ag.indexOf(a.toLowerCase())&&e[a]!==Lg?(n[a]=Lg,r=!0):n[a]=e[a]}return r?n:null},jg=function(e,t){if("string"==typeof e){var n;try{n=JSON.parse(e)}catch(i){return e}if(!n||"object"!==Ig(n)||Array.isArray(n))return e;var r=Ng(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?Ng(o,t)||o:e}return e&&"object"===Ig(e)?Ng(e,t)||Object.assign({},e):e},_g=function(e,t){if(!e||"object"!==Ig(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""},Fg=function(e){var t=e.replace(/\+/g," ");try{return decodeURIComponent(t)}catch(n){return t}},Bg=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=Fg(-1===s?a:a.slice(0,s));a.length>0&&Dg(t,c)?o=!0:r.push(a)}return o?r.join("&"):e},Ug=function(e){if(e>500)throw new Error("Network log body is nested too deeply to redact.")},Hg=function e(t,n,r){Ug(r);var o=!1;if(Array.isArray(t)){for(var i=0;i<t.length;i++)t[i]&&"object"===Ig(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];Dg(n,c)?(delete t[c],o=!0):t[c]&&"object"===Ig(t[c])&&e(t[c],n,r+1)&&(o=!0)}return o},qg=function e(t,n,r,o){Ug(o);var i=!1;if(Array.isArray(t)){for(var a=0;a<t.length;a++)t[a]&&"object"===Ig(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"===Ig(t[u])&&e(t[u],n,r+1,o+1)&&(i=!0))}return i},zg=function(e,t){for(var n=Hg(e,t,0),r=0;r<t.paths.length;r++)qg(e,t.paths[r],0,0)&&(n=!0);return n},Wg=/\n… \[truncated, [^\]]*\]$/,Gg=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},Vg=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"===Ig(o)?zg(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=Wg.exec(e),s=a?e.slice(0,a.index):e,c=s,l=0;l<n.length;l++){var u=new RegExp('"('+Gg(n[l])+')"(\\s*:\\s*)("(?:[^"\\\\]|\\\\.)*"?|-?\\d[0-9.eE+-]*|true|false|null)',"gi");c=c.replace(u,'"$1"$2"'+Lg+'"')}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"):Mg.test(e)}(e,t)?Bg(e,n):e}if("object"===Ig(e)){var i=JSON.parse(JSON.stringify(e));return i&&"object"===Ig(i)&&zg(i,n),i}}catch(a){return Og}return e},$g=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=Bg(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"===Ig(n.request)&&!Array.isArray(n.request)){var r=Object.assign({},n.request),o=_g(r.headers,"content-type");void 0!==r.headers&&(r.headers=jg(r.headers,t)),void 0!==r.payload&&(r.payload=Vg(r.payload,o,t)),n.request=r}if(n.response&&"object"===Ig(n.response)&&!Array.isArray(n.response)){var i=Object.assign({},n.response),a=_g(i.headers,"content-type");void 0!==i.headers&&(i.headers=jg(i.headers,t)),void 0!==i.responseText&&(i.responseText=Vg(i.responseText,a,t)),n.response=i}return n},Xg=function(e,t){var n=[];if(!Array.isArray(e))return n;for(var r=function(e){for(var t=Rg(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=Rg(Tg.concat(t&&t.blacklist||[])),i=0;i<e.length;i++){var a=e[i];if(a&&"object"===Ig(a)&&!Array.isArray(a)&&!Pg(a.url,o))try{n.push($g(a,r))}catch(s){}}return n};function Jg(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,Yg(r.key),r)}}function Kg(e,t,n){return(t=Yg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yg(e){var t=function(e,t){if("object"!=Zg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Zg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Zg(t)?t:String(t)}function Zg(e){return Zg="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},Zg(e)}var Qg=15e4,em="[body pending]",tm="[binary body omitted]",nm="[streaming body omitted]",rm=["text/event-stream","application/x-ndjson","application/stream+json","multipart/x-mixed-replace","grpc"],om=["json","xml","text/","javascript","x-www-form-urlencoded","graphql"],im=function(e){if("string"!=typeof e||0===e.trim().length)return"unknown";for(var t=e.toLowerCase(),n=0;n<rm.length;n++)if(-1!==t.indexOf(rm[n]))return"stream";for(var r=0;r<om.length;r++)if(-1!==t.indexOf(om[r]))return"text";return"binary"},am=function(){try{if("undefined"!=typeof performance&&"function"==typeof performance.now)return performance.now()}catch(e){}return Date.now()},sm=function(e){return Math.max(0,Math.round(am()-e))},cm=function(e){return"\n… [truncated, "+("number"==typeof e?e:"more than "+Qg)+" bytes]"},lm=function(e){if("string"!=typeof e)return"";if(e.length<=Qg)return e;var t=Qg,n=e.charCodeAt(t-1);return n>=55296&&n<=56319&&(t-=1),e.slice(0,t)+cm(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)},um=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]},dm=function(e,t,n){var r=um(e,t);void 0!==r?e[r]=e[r]+", "+n:e[t]=n},pm=function(e,t){var n=e?um(e,t):void 0;return void 0!==n?e[n]:""},hm=function(e){var t={};if(!e||"object"!==Zg(e))return t;try{if("function"==typeof e.forEach&&"function"==typeof e.get)e.forEach((function(e,n){dm(t,String(n),String(e))}));else if(Array.isArray(e))for(var n=0;n<e.length;n++)e[n]&&e[n].length>=2&&dm(t,String(e[n][0]),String(e[n][1]));else for(var r=Object.keys(e),o=0;o<r.length;o++)dm(t,r[o],String(e[r[o]]))}catch(i){}return t},fm=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&&dm(t,n[r].slice(0,o).trim(),n[r].slice(o+1).trim())}return t},gm=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}},mm=function(e,t,n,r){var o,i=e.byteLength>Qg||"number"==typeof r&&r>Qg,a=e.byteLength>Qg?e.subarray(0,Qg):e;try{if(n){if(-1!==(o=new TextDecoder("utf-8",{fatal:!0}).decode(a,{stream:i})).indexOf("\0"))return tm}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?tm:Og}return i?o+cm("number"==typeof r?r:void 0):o},vm=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 mm(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>Qg){try{r.cancel().catch((function(){}))}catch(s){}return a(!1)}return e()}))}()},ym=function(e,t,n){var r=e.size>Qg?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 mm(new Uint8Array(r),t,n,e.size)}))},bm=function(e,t){if(null==e)return{text:""};try{var n=im(t);if("stream"===n)return{text:nm};if("string"==typeof e)return{text:"binary"===n?tm:lm(e)};var r=function(e){return Object.prototype.toString.call(e)}(e);if("[object URLSearchParams]"===r)return{text:lm(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})})),lm(JSON.stringify(c)))};if("[object ReadableStream]"===r)return{text:nm};if("[object Blob]"===r||"[object File]"===r){var o=t||e.type||"",i=im(o);return"stream"===i?{text:nm}:"binary"===i?{text:tm}:{text:em,promise:ym(e,o,"unknown"===i)}}if("[object ArrayBuffer]"===r||"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)){if("binary"===n)return{text:tm};var a="[object ArrayBuffer]"===r?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{text:mm(a,t,"unknown"===n,a.byteLength)}}return"[object Document]"===r||"[object HTMLDocument]"===r||"[object XMLDocument]"===r?{text:Og}:{text:"binary"===n?tm:lm(String(e))}}catch(l){return{text:Og}}var s,c},wm=function(e,t,n){e[t]=n.text,n.promise&&n.promise.then((function(n){e[t]=n}),(function(){e[t]=Og}))},km=function(e){try{if(e&&"object"===Zg(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"}},xm=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."},Sm=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Kg(this,"requestId",0),Kg(this,"requests",{}),Kg(this,"externalRequests",[]),Kg(this,"maxRequests",30),Kg(this,"localFilters",[]),Kg(this,"remoteFilters",[]),Kg(this,"localBlacklist",[]),Kg(this,"remoteBlacklist",[]),Kg(this,"initialized",!1),Kg(this,"stopped",!1),Kg(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"===Zg(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 Xg(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:"+gm(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]&&!Pg(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=Rg(e)}},{key:"setRemoteFilters",value:function(e){this.remoteFilters=Rg(e)}},{key:"setBlacklist",value:function(e){this.localBlacklist=Rg(e)}},{key:"setRemoteBlacklist",value:function(e){this.remoteBlacklist=Rg(e)}},{key:"getFilters",value:function(){return Rg(this.remoteFilters.concat(this.localFilters))}},{key:"getBlacklist",value:function(){return Rg(Tg.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(Pg(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=am(),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,gm(r?e.url:e));if(!i)return null;i.request.headers=hm(t&&void 0!==t.headers?t.headers:r?e.headers:void 0);var a=pm(i.request.headers,"content-type"),s={text:""};try{t&&void 0!==t.body&&null!==t.body?s=bm(t.body,a):r&&(s=function(e,t,n){if("GET"===t||"HEAD"===t||null===e.body)return{text:""};var r=im(n);if("stream"===r)return{text:nm};if("binary"===r)return{text:tm};if(e.bodyUsed)return{text:Og};var o=e.clone();return o.body&&"function"==typeof o.body.getReader?{text:em,promise:vm(o.body,n,"unknown"===r)}:{text:em,promise:o.arrayBuffer().then((function(e){var t=new Uint8Array(e);return 0===t.byteLength?"":mm(t,n,"unknown"===r,t.byteLength)}))}}(e,o,a))}catch(c){s={text:Og}}return wm(i.request,"payload",s),{request:i,start:n}}},{key:"finishFetch",value:function(e,t){var n=e.request;n.duration=sm(e.start),n.success=!0;var r=hm(t&&t.headers),o={status:t?t.status:0,statusText:t&&t.statusText?t.statusText:"",headers:r,responseText:em};n.response=o;var i=function(e){o.responseText=e};try{if(!t||"opaque"===t.type||"opaqueredirect"===t.type)return i(Og);if(null===t.body)return i("");var a=pm(r,"content-type"),s=im(a);if("stream"===s)return i(nm);if("binary"===s)return i(tm);var c=t.clone();if(c.body&&"function"==typeof c.body.getReader)return void vm(c.body,a,"unknown"===s).then(i,(function(){return i(Og)}));var l=parseInt(pm(r,"content-length"),10);if("function"==typeof c.text&&l>=0&&l<=Qg)return void c.text().then((function(e){return i(lm(e))}),(function(){return i(Og)}));i(Og)}catch(u){i(Og)}}},{key:"failFetch",value:function(e,t){var n=e.request;n.duration=sm(e.start),n.success=!1,n.response={errorText:km(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&&dm(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),km(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=gm(r),o.headers={},o.capture=this.isCapturing()&&!Pg(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=am(),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 wm(i.request,"payload",a?bm(n,pm(r.headers,"content-type")):{text:""}),r.request=i,r.start=o,!0}},{key:"recordXhrHeaders",value:function(e,t){t.headersAt=am();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:fm(e.getAllResponseHeaders()),responseText:em}}},{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=sm(t.start),r.success=!1,void(r.response={errorText:xm(o,e)});r.duration=t.headersAt?Math.max(0,Math.round(t.headersAt-t.start)):sm(t.start),r.success=!0;var i,a=fm(e.getAllResponseHeaders());try{i=function(e,t){var n=im(pm(t,"content-type"));if("stream"===n)return nm;var r=e.responseType;if(""===r||"text"===r){if("binary"===n)return tm;var o=e.responseText;return"string"!=typeof o?"":"unknown"===n&&-1!==o.slice(0,Qg).indexOf("\0")?tm:lm(o)}if("json"===r){if(null===e.response||void 0===e.response)return"";var i=cd(e.response,Qg);return i.truncated?i.text+cm():i.text}return"document"===r?Og:tm}(e,a)}catch(s){i=Og}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&&Jg(t.prototype,n),r&&Jg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Kg(Sm,"instance",void 0);const Cm=Sm;function Em(e){return Em="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},Em(e)}function Im(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,Lm(r.key),r)}}function Tm(e,t,n){return(t=Lm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lm(e){var t=function(e,t){if("object"!=Em(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Em(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Em(t)?t:String(t)}var Om=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Tm(this,"notificationContainer",null),Tm(this,"notifications",[]),Tm(this,"unreadCount",0),Tm(this,"unreadNotificationsKey","unread-notifications"),Tm(this,"isTabActive",!0),Tm(this,"showNotificationBadge",!0),Tm(this,"lastPageRulesUrl",void 0),Tm(this,"stackResizeObserver",null),Tm(this,"currentNewsIndex",0)}var t,n,r;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(),Mv.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||hf(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(),N.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=Nn.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)&&Un.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=he("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}}",Tf.getInstance().getName()),d.innerText=p,d.onclick=function(t){t.stopPropagation(),e.openNews(a)},u.appendChild(d);var h=this.renderDescription(a);if(h){var f=document.createElement("div");f.className="gleap-notification-item-news-preview",f.innerHTML=h,u.appendChild(f)}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=Hv.translateText("next"),v.onclick=function(t){t.stopPropagation(),e.currentNewsIndex++,e.renderNotifications()}):(v.innerText=Hv.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}}",Tf.getInstance().getName());var r=document.createElement("div");if(r.onclick=function(){t.data.conversation?Qv.openConversation(t.data.conversation.shareToken,!0):t.data.checklist?Qv.openChecklist(t.data.checklist.id,!0):Qv.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?Qv.openNewsArticle(e.data.news.id,!0):Qv.open()}},{key:"renderAvatar",value:function(e,t){if(!e||!e.profileImageUrl)return"";var n=String(e.name||"").replace(/"/g,"""),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,Hv.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||Mv.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(o=Tf.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;Mv.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=Tf.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(r){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=Xu.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!==N.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==N.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===N.getInstance().buttonHidden?e.feedbackButtonPosition===N.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):N.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",Hv.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Im(t.prototype,n),r&&Im(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Am(e){return Am="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},Am(e)}function Mm(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,Pm(r.key),r)}}function Rm(e,t,n){return(t=Pm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pm(e){var t=function(e,t){if("object"!=Am(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Am(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Am(t)?t:String(t)}Tm(Om,"instance",void 0);var Dm=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Rm(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)&&Mm(t.prototype,n),r&&Mm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Nm(e){return Nm="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},Nm(e)}function jm(e){return function(e){if(Array.isArray(e))return _m(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 _m(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 _m(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 _m(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 Fm(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 Bm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fm(Object(n),!0).forEach((function(t){Um(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Um(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Nm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Nm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Nm(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Rm(Dm,"instance",void 0);var Hm=function(){var e={};function t(){e=Bm({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(jm(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 h(e){var t;null==(t=d[e])||t.call(d)}function f(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&&h("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,h=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(h," 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(h," 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,h=!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();!h&&k&&k(v?void 0:p,d,{config:x,state:S});b&&b(g?void 0:e,t,{config:x,state:S});var I=!h&&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&&I&&(E(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):(f(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),!I&&t.popover&&E(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){}f(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(jm(r?[r]:[]),jm(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?h("escapePress"):"ArrowRight"===e.key?h("arrowRightPress"):"ArrowLeft"===e.key&&h("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 E(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="×";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="← Previous";var l=document.createElement("button");return l.type="button",l.classList.add("gleap-tour-popover-next-btn"),l.innerHTML="Next →",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,f=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=f||n("showButtons"),E=m||n("showProgress")||!1,I=(null==C?void 0:C.includes("next"))||(null==C?void 0:C.includes("previous"))||E;s.closeButton.style.display=C.includes("close")?"block":"none",I?(s.footer.style.display="flex",s.progress.style.display=E?"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()}):h("nextClick"):s.classList.contains("gleap-tour-popover-prev-btn")?u?u(e,t,{config:n(),state:l()}):h("prevClick"):s.classList.contains("gleap-tour-popover-close-btn")?d?d(e,t,{config:n(),state:l()}):h("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 R=e.classList.contains("gleap-tour-dummy-element"),P=o([L].concat(jm(R?[]:[e])));P.length>0&&P[0].focus()}function I(){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,h=I(),f=r.arrow.getBoundingClientRect(),g=e.getBoundingClientRect(),m=g.top-h.height,v=m>=0,y=window.innerHeight-(g.bottom+h.height),b=y>=0,w=g.left-h.width,k=w>=0,x=window.innerWidth-(g.right+h.width),S=x>=0,C=!(v||b||k||S),E=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-h.realWidth/2,A=window.innerHeight/2-h.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==h?void 0:h.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 R=Math.min(w,window.innerWidth-(null==h?void 0:h.realWidth)-f.width),P=T(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.left="".concat(R,"px"),r.wrapper.style.top="".concat(P,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="left"}else if(S){var D=Math.min(x,window.innerWidth-(null==h?void 0:h.realWidth)-f.width),N=T(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.right="".concat(D,"px"),r.wrapper.style.top="".concat(N,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",E="right"}else if(v){var j=Math.min(m,window.innerHeight-h.realHeight-f.width),_=L(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.top="".concat(j,"px"),r.wrapper.style.left="".concat(_,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="top"}else if(b){var F=Math.min(y,window.innerHeight-(null==h?void 0:h.realHeight)-f.width),B=L(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.left="".concat(B,"px"),r.wrapper.style.bottom="".concat(F,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",E="bottom"}C?r.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var r=l("popover");if(!r)return;var o=n.getBoundingClientRect(),i=I(),a=r.arrow,s=i.width,c=window.innerWidth,u=o.width,d=o.left,p=i.height,h=window.innerHeight,f=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?(f+g<=0?(m="bottom",v="end"):f+g-p<=0&&(m="left",v="start"),f>=h?(m="top",v="end"):f+p>=h&&(m="left",v="end")):"right"===t&&(f+g<=0?(m="bottom",v="start"):f+g-p<=0&&(m="right",v="start"),f>=h?(m="top",v="start"):f+p>=h&&(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,E,e)}}return function(){function e(){n("allowClose")&&f()}function r(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?h(r):f()}}function o(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?h(r):f()}}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 h(){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 f();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(jm(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"),E=(null==(s=p.popover)?void 0:s.onPrevClick)||n("onPrevClick"),I=(null==(l=p.popover)?void 0:l.onCloseClick)||n("onCloseClick");y(Bm(Bm({},p),{},{popover:Bm({showButtons:S,nextBtnText:g?void 0:v,disableButtons:jm(m?[]:["previous"]),showProgress:w,progressText:k,onNextClick:C||function(){g?h(u+1):f()},onPrevClick:E||function(){h(u-1)},onCloseClick:I||function(){f()}},(null==p?void 0:p.popover)||{})}))}else f()}function f(){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(),h(e)},setConfig:t,setSteps:function(e){u(),t(Bm(Bm({},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]?h(e):f()},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(Bm(Bm({},e),{},{popover:e.popover?Bm({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){f(!1)}}}}();const qm=Hm;var zm=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],Wm="".concat(zm.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),Gm=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?zm.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},Vm=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},$m=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;Vm(e,"input")}},Xm=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(Gm(e))return e;var t="function"==typeof e.querySelector?e.querySelector(Wm):null;return t&&Gm(t)?t:null}(e),s=null!=t?t:"";if(a){var c=0,l=function(){Vm(a,"change"),i&&i()};!function e(){try{c<s.length?(c++,$m(a,s.slice(0,c)),setTimeout(e,o)):l()}catch(t){l()}}()}else i&&i()};function Jm(e){return Jm="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},Jm(e)}function Km(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,Zm(r.key),r)}}function Ym(e,t,n){return(t=Zm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zm(e){var t=function(e,t){if("object"!=Jm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Jm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Jm(t)?t:String(t)}var Qm="gleap-tour-data",ev="copilot-pointer-container",tv="copilot-tour-styles",nv="copilot-joined-container",rv={TOP_LEFT:"".concat(nv,"--top-left"),TOP_RIGHT:"".concat(nv,"--top-right"),BOTTOM_LEFT:"".concat(nv,"--bottom-left"),BOTTOM_RIGHT:"".concat(nv,"--bottom-right")};var ov=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ym(this,"productTourData",void 0),Ym(this,"productTourId",void 0),Ym(this,"currentActiveIndex",void 0),Ym(this,"lastArrowPositionX",void 0),Ym(this,"lastArrowPositionY",void 0),Ym(this,"onCompleteCallback",void 0),Ym(this,"audioMuted",!1),Ym(this,"currentAudio",void 0),Ym(this,"_pointerContainer",null),Ym(this,"_scrollListeners",[]),Ym(this,"_currentAnchor",null),Ym(this,"_currentStep",null),Ym(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(Qm,JSON.stringify(e))}catch(t){}else localStorage.removeItem(Qm)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(Qm));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(ev);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(ev);t&&t.remove()}var n=document.getElementById(nv);n&&n.remove();var r=document.getElementById(tv);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(nv,"-mute"));t&&(t.innerHTML=he(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=Xu.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=pe(u),p=document.getElementById(tv);p||(p=document.createElement("style"),W(p),p.id=tv,p.type="text/css",p.textContent="\n #".concat(ev," {\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(ev,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(ev,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(ev,"-clickmode svg {\n display: none !important;\n }\n #").concat(ev," 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(ev,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(ev,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(ev,"-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(ev,"-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(nv," {\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(nv,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(nv,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(nv,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(nv,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(nv," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(nv,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(nv,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(nv,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(nv,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(nv,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(nv,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(nv,"-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(nv," {\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(nv,"-mute {\n display: none;\n }\n "),"\n ").concat(this.productTourData.gradient?'body::before {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n box-sizing: border-box;\n border: 18px solid transparent;\n filter: blur(25px);\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }\n \n body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0.5;\n box-sizing: border-box;\n border: 3px solid transparent;\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }':'body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0;\n }',"\n "),document.head.appendChild(p));var h=document.createElement("div");h.id=ev,h.style.opacity=0,this._pointerContainer=h;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("viewBox","0 0 380 476"),f.innerHTML='<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=nv,y.classList.add(nv,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=rv[m])&&void 0!==v?v:rv.TOP_RIGHT)),y.innerHTML='\n <img class="'.concat(nv,'-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(nv,'-mute">\n ').concat(he(this.audioMuted?"unmute":"mute"),"\n </div>\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'<div class="'.concat(nv,'-dismiss">\n ').concat(he("dismiss"),"\n </div>"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(nv,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(nv,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),h.appendChild(f),h.appendChild(g),document.body.appendChild(h)}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this.productTourData;if(t){var n=function(n,r){e.audioMuted=n,e.setupCopilotTour(),e.audioMuted&&r&&null!=t&&t.showUnmuteModal?e.showAudioUnmuteModal():setTimeout((function(){e.renderNextStep()}),1500)},r=this.loadStoredAudioMuted();"boolean"!=typeof r?("undefined"==typeof window?Promise.resolve(!1):new Promise((function(e){var t=setTimeout((function(){return e(!0)}),500),n=function(n){clearTimeout(t),e(n)};try{new Audio("data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEARKwAABCxAgAEABAAZGF0YQAAAAA=").play().then((function(){return n(!0)})).catch((function(){return n(!1)}))}catch(r){n(!1)}}))).then((function(e){n(!e,!0)})):n(r,!1)}}}},{key:"showAudioUnmuteModal",value:function(){var e,t,n,r=this,o=document.createElement("div");o.classList.add("gleap-audio-unmute-modal-overlay");var i=document.createElement("div");i.classList.add("gleap-audio-unmute-modal");var a=document.createElement("p");a.textContent=null===(e=this.productTourData)||void 0===e?void 0:e.unmuteModalTitle,i.appendChild(a);var s=document.createElement("button");s.classList.add("gleap-audio-unmute-button"),s.textContent=null===(t=this.productTourData)||void 0===t?void 0:t.unmuteModalButton,s.addEventListener("click",(function(){r.toggleAudio(!1),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(s);var 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(ev)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(ev).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(Hv.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(ev)).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;Xm(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&&Km(t.prototype,n),r&&Km(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function iv(e){return iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iv(e)}function av(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 sv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?av(Object(n),!0).forEach((function(t){lv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):av(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cv(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,uv(r.key),r)}}function lv(e,t,n){return(t=uv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uv(e){var t=function(e,t){if("object"!=iv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=iv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==iv(t)?t:String(t)}Ym(ov,"instance",void 0);var dv="gleap-tour-data",pv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),lv(this,"productTourData",void 0),lv(this,"productTourId",void 0),lv(this,"unmuted",!1),lv(this,"currentActiveIndex",void 0),lv(this,"gleapTourObj",void 0),lv(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(),ov.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;Tf.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?(Ht.notifyEvent("productTourCompleted",t),Qv.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(Ht.notifyEvent("productTourQuit",t),Qv.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(dv));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(dv,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(dv)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return ov.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(he("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 h={disableActiveInteraction:!s&&!c&&!l,mode:a.mode,popover:sv({description:u,popoverClass:"gleap-tour-popover-".concat(a.type," ").concat(!d&&"gleap-tour-popover-no-sender"," ").concat(t.allowClose&&"gleap-tour-popover-can-close")},s?{showButtons:[]}:{})};a.selector&&a.selector.length>0&&(h.element=a.selector),o.push(h)}var f=["next","close"];t.backButton&&f.push("previous"),this.gleapTourObj=qm(lv(lv(lv(lv(lv(lv(lv(lv(lv(lv({showProgress:!0,allowKeyboardControl:!1,steps:o},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",f),"onHighlightStarted",(function(t,n,r){var o;e.currentActiveIndex=null==r||null===(o=r.state)||void 0===o?void 0:o.activeIndex,e.storeUncompletedTour()})),"onElementNotFound",(function(t){document.removeEventListener("click",g),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=he("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=he("mute"),u.classList.add(s)):l.paused?(l.muted=!1,l.play(),c.innerHTML=he("mute"),u.classList.add(s)):(l.pause(),c.innerHTML=he("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&&cv(t.prototype,n),r&&cv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function hv(e){return hv="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},hv(e)}function fv(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,mv(r.key),r)}}function gv(e,t,n){return(t=mv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mv(e){var t=function(e,t){if("object"!=hv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=hv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==hv(t)?t:String(t)}lv(pv,"instance",void 0);var vv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),gv(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||Qv.startFeedbackFlowWithOptions("bugreporting",{autostartDrawing:!0})})))}},{key:"stop",value:function(){this.shortCutListener&&(document.removeEventListener("keyup",this.shortCutListener),this.shortCutListener=void 0)}}])&&fv(t.prototype,n),r&&fv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function yv(e){return yv="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},yv(e)}function bv(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,kv(r.key),r)}}function wv(e,t,n){return(t=kv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kv(e){var t=function(e,t){if("object"!=yv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=yv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==yv(t)?t:String(t)}gv(vv,"instance",void 0);var xv=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)},Sv=function(){return"undefined"!=typeof navigator&&!!navigator&&!1===navigator.onLine},Cv=null,Ev=function(e){try{if(Cv||"undefined"==typeof TextEncoder||(Cv=new TextEncoder),Cv)return Cv.encode(e).length}catch(t){}return e.length},Iv=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),wv(this,"eventArray",[]),wv(this,"streamedEventArray",[]),wv(this,"eventMaxLength",500),wv(this,"pingInFlight",0),wv(this,"lastPingId",0),wv(this,"pingFailures",0),wv(this,"pingRetryAt",0),wv(this,"lastUrl",void 0),wv(this,"mainLoopTimeout",null),wv(this,"socket",null),wv(this,"connectedWebSocketGleapId",null),wv(this,"connectionTimeout",null),wv(this,"pingWS",null),wv(this,"reconnectTimeout",null),wv(this,"reconnectAttempts",0),wv(this,"socketOpenedAt",0),wv(this,"networkListenersAdded",!1),wv(this,"handleOpenBound",null),wv(this,"handleErrorBound",null),wv(this,"handleMessageBound",null),wv(this,"handleCloseBound",null),wv(this,"handleOnlineBound",null),wv(this,"runEventStreamLoop",(function(){var e=t;try{t.streamEvents()}catch(n){}t.mainLoopTimeout=setTimeout((function(){e.runEventStreamLoop()}),2500)})),wv(this,"streamEvents",(function(){var e=Tf.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:yg.getInstance().getSessionDuration(),events:o,opened:Zf.getInstance().isOpened(),type:"js",sdkVersion:"19.1.1",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=Tf.getInstance().session;if(this.connectedWebSocketGleapId=e?e.gleapId:null,e&&e.gleapId&&Tf.getInstance().sdkKey){var t="";try{var n=(()=>{const e=[];return er()&&e.push("capture.screenshot","capture.recording"),Wn&&e.push("capture.logs"),e})();n.length>0&&(t="&caps="+n.join(","))}catch(r){}this.socket=new WebSocket("".concat(Tf.getInstance().wsApiUrl,"?gleapId=").concat(Tf.getInstance().session.gleapId,"&gleapHash=").concat(Tf.getInstance().session.gleapHash,"&apiKey=").concat(Tf.getInstance().sdkKey,"&sdkVersion=").concat("19.1.1").concat(t)),this.socket.addEventListener("open",this.handleOpenBound),this.socket.addEventListener("message",this.handleMessageBound),this.socket.addEventListener("error",this.handleErrorBound),this.socket.addEventListener("close",this.handleCloseBound),this.addNetworkListeners()}}},{key:"clearReconnectTimeout",value:function(){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null)}},{key:"scheduleReconnect",value:function(){var t=this;if(this.clearReconnectTimeout(),!Sv()){var n=e.reconnectDelay(this.reconnectAttempts,Math.random());this.reconnectAttempts+=1,this.reconnectTimeout=setTimeout((function(){t.reconnectTimeout=null,Sv()||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(ut.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=Zf.getInstance().isOpened();if(s&&Om.getInstance().clearNotificationsForConversation(s),a&&Nn.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())}));Qv.getInstance().performActions(u)}null!=i&&Om.getInstance().setNotificationCount(i)}if("capture-request"===e.name&&bu&&bu.getInstance().handleServerRequest(e.data),"checklist"===e.name&&null!=e&&e.data&&window){var d,p,h=e.data,f=null!==(d=h.completedSteps)&&void 0!==d?d:[],g=null!==(p=h.completedStepsBefore)&&void 0!==p?p:[];if(f.length>g.length)for(var m=function(e){var t,n=null==h||null===(t=h.steps)||void 0===t?void 0:t.find((function(t){return t.id===f[e]}));if(!n)return 1;var r=e;g.includes(n)||Ht.notifyEvent("checklist-step-completed",{checklistId:h.id,outboundId:h.outboundId,stepId:n.id,stepIndex:r,step:n,completedSteps:h.completedSteps,status:h.status,data:h})},v=0;v<f.length;v++)m(v);"done"===h.status&&Ht.notifyEvent("checklist-completed",{checklistId:h.id,outboundId:h.outboundId,completedSteps:h.completedSteps,status:h.status,data:h}),"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!==Tf.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(!Qv.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{Om.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=Ev(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 xv(3e3,e-1,6e4,t)}},{key:"reconnectDelay",value:function(e,t){return xv(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&&bv(t.prototype,n),r&&bv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Tv(e){return Tv="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},Tv(e)}function Lv(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,Av(r.key),r)}}function Ov(e,t,n){return(t=Av(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Av(e){var t=function(e,t){if("object"!=Tv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Tv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Tv(t)?t:String(t)}wv(Iv,"instance",void 0);var Mv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ov(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=Tf.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=Tf.getInstance().session)||void 0===t?void 0:t.gleapId;if(!e.gleapId||!n||e.gleapId!==n)return;"notifications-cleared"===e.type&&(Om.getInstance().clearAllNotifications(!1,!0),N.getInstance().updateNotificationBadge(0)),"conversation-notifications-cleared"===e.type&&e.shareToken&&Om.getInstance().clearNotificationsForConversation(e.shareToken,!0),"chatbar-notification-cleared"===e.type&&Nn.getInstance().hideChatbarNotification(!0)}catch(r){}}},{key:"stop",value:function(){try{this.channel&&this.channel.close()}catch(e){}this.channel=null}}])&&Lv(t.prototype,n),r&&Lv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Rv(e){return Rv="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},Rv(e)}function Pv(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,Nv(r.key),r)}}function Dv(e,t,n){return(t=Nv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nv(e){var t=function(e,t){if("object"!=Rv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Rv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Rv(t)?t:String(t)}Ov(Mv,"instance",void 0);var jv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Dv(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}}])&&Pv(t.prototype,n),r&&Pv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function _v(e){return _v="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},_v(e)}function Fv(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,Uv(r.key),r)}}function Bv(e,t,n){return(t=Uv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uv(e){var t=function(e,t){if("object"!=_v(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_v(t)?t:String(t)}Dv(jv,"instance",void 0);var Hv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Bv(this,"overrideLanguage",""),Bv(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=Xu.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=Xu.getInstance().getFlowConfig();this.isRTLLayout=!1,e&&e.localizationOptions&&e.localizationOptions.rtl&&(this.isRTLLayout=!0),N.getInstance().updateFeedbackButtonState(),Zf.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}}])&&Fv(t.prototype,n),r&&Fv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function qv(e){return qv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qv(e)}function zv(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,$v(r.key),r)}}function Wv(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 Gv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wv(Object(n),!0).forEach((function(t){Vv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Vv(e,t,n){return(t=$v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $v(e){var t=function(e,t){if("object"!=qv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=qv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qv(t)?t:String(t)}Bv(Hv,"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,Gv(Gv({},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),Au(Eu(e=Cu(this,t)),"activeStep",-1),Au(Eu(e),"checklistData",null),Au(Eu(e),"_isInitialLoad",!1),Au(Eu(e),"_initialActiveSet",!1),Au(Eu(e),"_hasLoaded",!1),Au(Eu(e),"_isSessionReady",!1),Au(Eu(e),"_boundHandleChecklistUpdate",e.handleChecklistUpdate.bind(Eu(e))),Au(Eu(e),"_boundHandleSessionUpdate",e.handleSessionUpdate.bind(Eu(e))),e.attachShadow({mode:"open"});try{e._networkManager=void 0!==Tf&&void 0!==A?A.getInstance():null}catch(n){e._networkManager=null}return e._boundFloatingLauncherClick=e.handleFloatingLauncherClick.bind(Eu(e)),e._boundFloatingCloseClick=e.handleFloatingCloseClick.bind(Eu(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&&Lu(e,t)}(t,e),n=t,r=[{key:"connectedCallback",value:function(){En.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!==Tf?Tf.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 Hv.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Hv.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!==Hv&&(n=Hv.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),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,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!==Hv&&(l=Hv.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=ku(this.checklistData.completedSteps||[]),o=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(r)&&(this.checklistData.completedSteps=ku(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),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,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)})),h=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",f=i.length>0?p&&p.description||"":e.message||"";o&&(h=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",f=(null===(d=e.config)||void 0===d?void 0:d.successMessage)||"",s=100);var g=2*Math.PI*7,m=g-s/100*g,v="checklist-floating-header"===r,y=v?'<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(h,"</div>\n ").concat(o?"":'<span class="floating-icon">'.concat(y,"</span>"),'\n </div>\n <div class="floating-subtitle">').concat(f,"</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>"):"",h=["checklist-task",o?"checklist-task--done":"",i?"checklist-task--active":""].filter(Boolean).join(" ");return'\n <div part="task" class="'.concat(h,'" 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=Xu.getInstance().getFlowConfig(),d=u.color?u.color:"#485BFF";En.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!==Qv){var o=e.checklistData.outbound.config.steps[r];if(o&&o.action&&"none"!==o.action&&!$n("start-custom-action"))try{"BOT"===o.action?Qv.startBot(o.botId):"CUSTOM_ACTION"===o.action?Qv.triggerCustomAction(o.actionBody):"REDIRECT_URL"===o.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),Qv.openURL(o.actionBody,!!o.actionOpenInNewTab)):"FEEDBACK_FLOW"===o.action?Qv.startFeedbackFlow(o.formId):"NEWS_ARTICLE"===o.action?Qv.openNewsArticle(o.articleId):"HELP_ARTICLE"===o.action?Qv.openHelpCenterArticle(o.articleId):"CHECKLIST"===o.action?Qv.startChecklist(o.outboundId,!0,null==o?void 0:o.sharedKey):"PRODUCT_TOUR"===o.action&&Qv.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&&Su(n.prototype,r),o&&Su(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Iu(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 Pt(Lt(e=Tt(this,t,[].concat(r))),"_iframe",null),Pt(Lt(e),"_agentConvUrl",Nt),Pt(Lt(e),"_messageListener",null),Pt(Lt(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&&Mt(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=Nt,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,J(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=St[Ct].apiUrl,r="",o="",i="";try{var a,s,c=Tf.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:{}}),"*")}}])&&It(n.prototype,r),o&&It(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Ot(HTMLElement));customElements.define("gleap-agent-conversation",e)}}());var Xv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Vv(this,"initialized",!1),Vv(this,"offlineMode",!1),Vv(this,"disablePageTracking",!1),Vv(this,"disableInAppNotifications",!1),Vv(this,"disableQueryParams",!1),Vv(this,"globalData",{screenRecordingData:null,webReplay:null,snapshotPosition:{x:0,y:0}}),"undefined"!=typeof window&&(yg.getInstance(),Sd.getInstance().start(),Fu.getInstance().start(),ut.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(){Zf.getInstance().destroy(),Xu.getInstance().start().then((function(){N.getInstance().refresh(),Om.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&&!hf(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=Ga.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){yg.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){yg.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){yg.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){q=U(e)}(e)}},{key:"setTags",value:function(e){jv.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){Zf.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(){Sd.getInstance().stop()}},{key:"setAiTools",value:function(e){Kt.getInstance().setAgentTools(e),Nn.getInstance().sendAgentToolsUpdate(),Zf.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){Cm.getInstance().setExternalRequests(ee(e))}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";Sd.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{Ga.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,h=window.visualViewport;h.addEventListener("resize",i),h.addEventListener("scroll",i),window.addEventListener("orientationchange",(function(){try{i()}catch(o){}})),e()}catch(o){}}()}catch(o){}var r=Tf.getInstance();r.sdkKey=t,r.setOnSessionReady((function(){setTimeout((function(){Xu.getInstance().start().then((function(){Iv.getInstance().start(),se((function(){N.getInstance().injectFeedbackButton(),Om.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams();try{bu.getInstance().resumeFromStorage()}catch(t){}Ht.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];Zf.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(){try{bu.getInstance().destroy()}catch(e){}Ga.getInstance().stop(),Iv.getInstance().stop(),Zf.getInstance().destroy(),N.getInstance().destroy(),Om.getInstance().clearAllNotifications(!0),Mv.getInstance().stop(),Nn.getInstance().destroy(),Tf.getInstance().clearSession(0,!1),cr.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){cr.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){Eg.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=Nn.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=Nn.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{Nn.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){Nn.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){Nn.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){Tf.getInstance().useCookies=e}},{key:"disableLocalStorage",value:function(){Tf.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return Tf.getInstance().identifySession(e,ne(ee(t)),n)}},{key:"updateContact",value:function(e){return Tf.getInstance().updateSession(ne(ee(e)))}},{key:"clearIdentity",value:function(){Tf.getInstance().clearSession()}},{key:"getIdentity",value:function(){return Tf.getInstance().getSession()}},{key:"isUserIdentified",value:function(){var e=Tf.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return Zf.getInstance().isOpened()}},{key:"hide",value:function(){Zf.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){Cm.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){Cm.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){Cm.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){Cm.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){Ga.getInstance().setOptions(e)}},{key:"setCaptureEnabled",value:function(e){bu.getInstance().setCaptureEnabled(e)}},{key:"setRemoteLogCollectionEnabled",value:function(e){bu.getInstance().setRemoteLogCollectionEnabled(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Zf.getInstance().hideWidget(e)}},{key:"open",value:function(){Zf.getInstance().setAppMode("widget"),Zf.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Iv.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Iv.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=ee(e);Dm.getInstance().formPreFill=t,Zf.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?vv.getInstance().start():vv.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){N.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){yg.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){yg.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){Tf.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return Tf.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){Tf.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){Tf.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){Tf.getInstance().apiUrl=e}},{key:"setBannerUrl",value:function(e){cr.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){Eg.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){jt(e)}},{key:"setFrameUrl",value:function(e){Zf.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){Nd.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){Nd.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){Nd.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){Nd.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){Nd.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){Nd.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){Nd.getInstance().clearCustomData()}},{key:"playSound",value:function(e){Un.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=Om.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){Hv.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){e.getInstance().softReInitialize(),e.updateContact({lang:t})}),1e3)}},{key:"registerAgentToolAction",value:function(e){Kt.getInstance().registerAgentToolAction(e)}},{key:"registerAgentTool",value:function(e,t){Kt.getInstance().registerAgentTool(e,t)}},{key:"registerCustomAction",value:function(e){Ad.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){Ad.triggerCustomAction(e)}},{key:"setColorScheme",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};En.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]:N.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),h="#ffffff"===p,f=c||t,g=l||t,m=de(o,h?100:-120),v=de(o,h?30:-12),y=de(o,h?80:-30),b=h?o:"#fff",w=h?p:"#2d2d2d",k=(r=parseInt(r,10),Math.round(1.05*r)),x=Math.round(.8*r),S=Math.round(.4*r),C=Math.round(.25*r),E=Math.max(2,Math.round(.55*r)),I=Math.max(2,Math.round(20*E/32)),T=57+a;s===N.FEEDBACK_BUTTON_CLASSIC_BOTTOM?T=a+15:(s&&s.includes("CLASSIC")||s===N.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(f,";\n }\n\n .gleap-frame-loader .gleap-bg-c3 {\n fill: ").concat(g,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-1 {\n stop-color: ").concat(f,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-2 {\n stop-color: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-fade {\n stop-color: ").concat(o,";\n }\n\n @keyframes gleapBgGrowShrink2 {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.35);\n }\n }\n\n @keyframes gleapBgGrowShrink3 {\n 0%, 100% {\n transform: scale(1) rotate(0deg);\n }\n 50% {\n transform: scale(1.3) rotate(20deg);\n }\n }\n\n .gleap-frame-loader--animate .gleap-bg-c2 {\n animation: gleapBgGrowShrink2 7s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader--animate .gleap-bg-c3 {\n animation: gleapBgGrowShrink3 6s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader-blur {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n -webkit-backdrop-filter: blur(30px);\n backdrop-filter: blur(30px);\n }\n\n .gleap-frame-loader--image {\n background-color: #ffffff;\n }\n\n .gleap-frame-loader-image-wrap {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0;\n transition: opacity 0.25s ease-in;\n }\n\n .gleap-frame-loader--dockedbar .gleap-frame-loader-image-wrap {\n bottom: 80px;\n }\n\n /* v4 header block: top-anchored, height driven by the strut child + the\n header's 150px padding-bottom — mirrors .agent-home-v4-header so the\n brand surface is exactly as tall as the app's, at any width/wrap. */\n .gleap-frame-loader-header {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n padding-bottom: 150px;\n overflow: hidden;\n }\n\n .gleap-frame-loader-header--colour {\n background: linear-gradient(\n 180deg,\n ").concat(t," 0%,\n ").concat(f,' 100%\n );\n }\n\n /* Strut: invisible height driver replicating the header\'s content box. */\n .gleap-frame-loader-strut {\n position: relative;\n z-index: 1;\n visibility: hidden;\n /* Match the messenger\'s font stack EXACTLY (and reset any inherited host\n font metrics), so the title wraps to the same number of lines the app\n will — 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(h?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.04)",";\n /* A barely-there contact shadow + a large, soft ambient throw. */\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 10px 30px rgba(0, 0, 0, 0.1);\n margin-bottom: 12px;\n cursor: pointer;\n transition: box-shadow 0.15s ease-out;\n }\n\n .gleap-notification-item-container:hover,\n .gleap-notification-item-news-container:hover,\n .gleap-notification-item-checklist-container:hover {\n box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.05), 0px 14px 38px rgba(0, 0, 0, 0.14);\n }\n\n @keyframes gleapNotificationIn {\n from {\n opacity: 0;\n transform: translate3d(0, 12px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n /* More than one notification collapses into a stack: the newest card in\n front, older ones peeking out behind its top edge like a deck. Hovering\n the stack (or tapping it on touch devices, which adds --expanded)\n spreads it back into the full list.\n\n Every stacked card is bottom-anchored and placed purely via translateY\n offsets that updateStackLayout() measures and writes as CSS vars, so\n collapsing and expanding is one smooth transform + height transition\n rather than a layout jump. */\n .gleap-notification-card {\n position: relative;\n }\n\n .gleap-notification-container--stack {\n height: var(--gleap-nstack-h-collapsed, auto);\n transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n .gleap-notification-container--stack:hover,\n .gleap-notification-container--stack.gleap-notification-container--expanded {\n height: var(--gleap-nstack-h-expanded, auto);\n }\n\n .gleap-notification-container--stack .gleap-notification-card {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n transform: translateY(var(--gleap-nstack-expand, 0px));\n transform-origin: top center;\n /* The negative inset keeps the box-shadow outside the clip region. */\n clip-path: inset(-40px);\n transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), clip-path 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-out;\n }\n\n /* The entrance animation's fill pins transform at translate3d(0,0,0),\n which would defeat the stack offsets — 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(E,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(I,"px;\n }\n\n [dir=rtl] .gleap-notification-item-avatar {\n margin-left: 10px;\n margin-right: 0px !important;\n }\n\n /* min-width: 0 so a long unbroken word shrinks the body instead of pushing\n the card past the container. */\n .gleap-notification-item-body {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n }\n\n .gleap-notification-item-content {\n line-height: 20px;\n color: ").concat(p,";\n word-wrap: break-word;\n word-break: break-word;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-meta {\n display: flex;\n align-items: center;\n margin-top: 5px;\n font-size: 13px;\n line-height: 18px;\n color: ").concat(m,";\n overflow: hidden;\n }\n\n .gleap-notification-item-sender {\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .gleap-notification-item-meta-dot {\n margin: 0px 5px;\n opacity: 0.6;\n }\n\n .gleap-notification-item-time {\n white-space: nowrap;\n }\n\n .gleap-frame-container-inner {\n position: relative;\n width: 100%;\n height: calc(100vh - ").concat(84+a,"px);\n max-height: ").concat(700,'px;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: calc(100vh - 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 /* Capture requests: hidden while the customer captures the page (the iframe stays alive), and\n the whole viewport while the Messenger's capture editor is open. */\n .gleap-frame-container--capture-hidden {\n visibility: hidden !important;\n pointer-events: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor {\n top: 0 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n width: 100vw !important;\n max-width: 100vw !important;\n height: 100vh !important;\n height: 100dvh !important;\n min-height: 0 !important;\n max-height: none !important;\n border-radius: 0 !important;\n transform: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor .gleap-frame-container-inner {\n width: 100% !important;\n height: 100% !important;\n max-height: none !important;\n }\n \n .bb-feedback-button {\n margin: 0px;\n position: fixed;\n bottom: ").concat(a,"px;\n right: ").concat(i,"px;\n border-radius: 30px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: transparent;\n color: #000000;\n z-index: ").concat(2147483630,";\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 0px;\n }\n\n @keyframes bbRedDotPulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 1;\n }\n }\n\n .bb-feedback-button--red-dot {\n position: absolute;\n top: 0px;\n right: 0px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #ff3b30;\n box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n z-index: ").concat(2147483631,";\n animation: bbRedDotPulse 2s ease-in-out infinite;\n }\n\n [dir=rtl].bb-feedback-button {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n \n .bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n\n [dir=rtl].bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: ").concat(i,'px;\n left: auto;\n }\n \n .bb-feedback-button--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(h?"outline: 1px solid rgba(255, 255, 255, 0.1);":"","\n z-index: 1000000000;\n position: fixed;\n top: 0;\n right: 0;\n background-color: ").concat(b,';\n }\n \n .gleap-tour-popover * {\n font-family: "Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif;\n }\n \n .gleap-tour-popover-title {\n font: 19px / normal sans-serif;\n font-weight: 700;\n display: block;\n position: relative;\n line-height: 1.5;\n zoom: 1;\n margin: 0;\n }\n \n .gleap-tour-popover-close-btn {\n all: unset;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n font-size: 30px;\n font-weight: 500;\n line-height: 32px;\n color: ').concat(h?m:"#d2d2d2",";\n z-index: 1;\n text-align: center;\n transition: color;\n transition-duration: 200ms;\n }\n \n .gleap-tour-popover-close-btn:hover,\n .gleap-tour-popover-close-btn:focus {\n color: ").concat(w,';\n }\n \n .gleap-tour-popover-title[style*="block"] + .gleap-tour-popover-description {\n margin-top: 5px;\n }\n \n .gleap-tour-popover-description {\n margin-bottom: 0;\n font: 15px / normal sans-serif;\n line-height: 1.5;\n font-weight: 400;\n zoom: 1;\n }\n \n .gleap-tour-popover-footer {\n margin-top: 15px;\n text-align: right;\n zoom: 1;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .gleap-tour-popover-progress-text {\n font-size: 13px;\n font-weight: 400;\n color: ').concat(h?m:"#727272",";\n zoom: 1;\n }\n \n .gleap-tour-popover-footer button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 10px 20px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;\n }\n\n .gleap-tour-popover-prev-btn {\n color: ").concat(p," !important;\n background-color: ").concat(v," !important;\n margin-right: 3px;\n }\n\n .gleap-tour-popover-prev-btn:hover {\n background-color: ").concat(e,"22 !important;\n color: ").concat(e,' !important;\n }\n \n .gleap-tour-popover-footer .gleap-tour-popover-btn-disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n \n .gleap-tour-no-interaction, .gleap-tour-no-interaction * {\n pointer-events: none !important;\n }\n \n .gleap-tour-popover-navigation-btns {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n gap: 4px;\n }\n \n .gleap-tour-popover-arrow {\n content: "";\n position: absolute;\n border: 5px solid ').concat(b,";\n }\n \n .gleap-tour-popover-arrow-side-over {\n display: none;\n }\n \n /** Popover Arrow Sides **/\n .gleap-tour-popover-arrow-side-left {\n left: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-right {\n right: 100%;\n border-left-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-top {\n top: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-bottom {\n bottom: 100%;\n border-left-color: transparent;\n border-top-color: transparent;\n border-right-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-center {\n display: none;\n }\n \n /* Left/Start + Right/Start */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-start {\n top: 15px;\n }\n \n /* Top/Start + Bottom/Start */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-start {\n left: 15px;\n }\n \n /* End/Left + End/Right */\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-left,\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-right {\n bottom: 15px;\n }\n \n /* Top/End + Bottom/End */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-end,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-end {\n right: 15px;\n }\n \n /* Left/Center + Right/Center */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-center {\n top: 50%;\n margin-top: -5px;\n }\n \n /* Top/Center + Bottom/Center */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-center {\n left: 50%;\n margin-left: -5px;\n }\n \n /* No arrow */\n .gleap-tour-popover-arrow-none {\n display: none;\n } \n\n /* Modal styles */\n .gleap-modal-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Invisible until the card inside the frame reports its height. Before that the frame is an\n empty box, and a bootstrap that fails silently must not leave a blank white card behind. */\n .gleap-modal-wrapper--loading {\n visibility: hidden;\n }\n\n .gleap-modal-wrapper--loading .gleap-modal {\n animation-name: none;\n }\n\n .gleap-modal-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-modal {\n position: relative;\n width: 90%;\n max-width: 600px;\n max-height: 90vh;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-modal-frame {\n width: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-modal-open {\n overflow: hidden;\n }\n\n /* Agent Popup styles */\n .gleap-agent-popup-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-agent-popup-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-agent-popup {\n position: relative;\n width: 95%;\n max-width: 700px;\n height: 85vh;\n max-height: 800px;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-agent-popup-frame {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-agent-popup-open {\n overflow: hidden;\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 20px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .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=Tf.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new Gf("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(Tf.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var s="start-feedbackflow";r&&(s="start-survey"),Zf.getInstance().setAppMode(r?a:"widget"),Zf.getInstance().sendMessage({name:s,data:{flow:t,hideBackButton:i,format:a}},!0),o?Zf.getInstance().showDrawingScreen("screenshot"):Zf.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),Zf.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),Zf.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];Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),Zf.getInstance().showWidget()}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),Zf.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 xt(e)}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),Zf.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),Zf.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),Zf.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),Zf.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),Zf.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),Zf.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&&(Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"start-checklist",data:Gv({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),Zf.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),Zf.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];Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),Zf.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Zf.getInstance().setAppMode("widget"),Zf.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),Zf.getInstance().showWidget()}},{key:"startProductTour",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;Tf.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=pv.getInstance().loadUncompletedTour();e&&pv.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];pv.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{cr.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{Eg.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){Om.getInstance().showNotification(e)}}],n&&zv(t.prototype,n),r&&zv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(Vv(Xv,"invoked",!0),Vv(Xv,"silentCrashReportSent",!1),Vv(Xv,"instance",void 0),"undefined"!=typeof window){var Jv=window.GleapActions;if(Jv&&Jv.length>0)for(var Kv=0;Kv<Jv.length;Kv++){var Yv=Jv[Kv];Yv&&Yv.e&&Xv[Yv.e]&&Xv[Yv.e].apply(Xv,Yv.a)}}var Zv=function(e){try{var t=e.split("/"),n=t[2];if("article"===n){var r=t[3];Xv.openHelpCenterArticle(r,!0)}if("collection"===n){var o=t[3];Xv.openHelpCenterCollection(o,!0)}if("flow"===n){var i=t[3];Xv.startFeedbackFlow(i,!0)}if("survey"===n){var a=t[3];Xv.showSurvey(a)}if("bot"===n){var s=t[3];Xv.startBot(s,!0)}if("news"===n){var c=t[3];Xv.openNewsArticle(c,!0)}if("checklist"===n){var l=t[3];Xv.startChecklist(l,!0,t[4])}if("tour"===n){var u=t[3];Xv.startProductTour(u)}}catch(d){console.error("Failed to handle Gleap link: ",e)}};const Qv=Xv,ey=Qv;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 R(r||[]);return a(i,"_invoke",{value:L(e,n,s)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var f="suspendedStart",g="suspendedYield",m="executing",v="completed",y={};function b(){}function w(){}function k(){}var x={};d(x,c,(function(){return this}));var S=Object.getPrototypeOf,C=S&&S(S(P([])));C&&C!==o&&i.call(C,c)&&(x=C);var E=k.prototype=b.prototype=Object.create(x);function I(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,a,s,c){var l=h(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=f;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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===f)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=h(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=h(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function 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 R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function P(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(E,"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(E),e},t.awrap=function(e){return{__await:e}},I(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()}))},I(E),d(E,u,"Generator"),d(E,c,(function(){return this})),d(E,"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=P,R.prototype={constructor:R,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:P(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:()=>hy});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,h,f,g,m,v,y,b,w,k,x,S;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.body){e.next=3;break}return null===(i=n.onError)||void 0===i||i.call(n,{message:"No response body."}),e.abrupt("return");case 3:a=t.body.getReader(),c=new TextDecoder,l="",u="",d="",e.prev=8;case 9:return e.next=12,a.read();case 12:if(h=e.sent,f=h.done,g=h.value,!f){e.next=17;break}return e.abrupt("break",24);case 17: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(E){}e.next=30;break;case 27:e.prev=27,e.t0=e.catch(8),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&(null===(S=n.onError)||void 0===S||S.call(n,{message:"Stream interrupted."}));case 30:case"end":return e.stop()}}),e,null,[[8,27]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,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 R(r||[]);return o(a,"_invoke",{value:L(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var f="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(P([])));C&&C!==n&&r.call(C,a)&&(x=C);var E=k.prototype=b.prototype=Object.create(x);function I(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=h(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=f;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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===f)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var l=h(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=h(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function 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 R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function P(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(E,"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(E),e},t.awrap=function(e){return{__await:e}},I(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()}))},I(E),u(E,c,"Generator"),u(E,a,(function(){return this})),u(E,"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=P,R.prototype={constructor:R,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:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){v(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 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=Lf.getInstance();return(null==e?void 0:e.apiUrl)||null}},{key:"_getHeaders",value:function(){var e,t,n=Lf.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=Lf.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,h;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.executeInFlight.get(t)){e.next=2;break}return e.abrupt("return");case 2:if(this.executeInFlight.set(t,!0),i=this._getApiUrl()){e.next=8;break}return this.executeInFlight.delete(t),null===(a=r.onError)||void 0===a||a.call(r,{message:"Gleap API URL not configured."}),e.abrupt("return");case 8:return s="".concat(i,"/v3/shared/agents/").concat(t,"/stream"),l=f(f({},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===(h=r.onError)||void 0===h||h.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,I(r.key),r)}}function E(e,t,n){return(t=I(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(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),E(this,"validationRequests",new Map),E(this,"validationCache",new Map),E(this,"fetchRequests",new Map),E(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=Lf.getInstance(),t=null==e?void 0:e.session,n=Xv.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=Lf.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=Lf.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}();E(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 R(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,D(r.key),r)}}function P(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"!=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 N=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),P(this,"feedbackButton",null),P(this,"injectedFeedbackButton",!1),P(this,"buttonHidden",null),P(this,"lastButtonIcon",null),P(this,"showingRedDot",!1),P(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(),jm.getInstance().updateContainerStyle()}},{key:"updateRedDot",value:function(e){var t=ig.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=ig.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&&!ig.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=Ku.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(Nn.getInstance().updateUIVisibility(),null!==this.feedbackButton){var n=Ku.getInstance().getFlowConfig(),r="";r=n.buttonLogo?'<img class="bb-logo-logo" src="'.concat(n.buttonLogo,'" alt="Feedback Button" />'):he("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",Xv.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(he("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");var a=ig.getInstance().appMode;ig.getInstance().isOpened()&&"survey_page"!==a&&this.feedbackButton.classList.add("bb-feedback-button--open"),"survey"!==a&&"survey_full"!==a&&"survey_web"!==a||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||Lf.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}])&&R(t.prototype,n),r&&R(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function j(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 _(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)}P(N,"FEEDBACK_BUTTON_BOTTOM_RIGHT","BOTTOM_RIGHT"),P(N,"FEEDBACK_BUTTON_BOTTOM_LEFT","BOTTOM_LEFT"),P(N,"FEEDBACK_BUTTON_CLASSIC","BUTTON_CLASSIC"),P(N,"FEEDBACK_BUTTON_CLASSIC_LEFT","BUTTON_CLASSIC_LEFT"),P(N,"FEEDBACK_BUTTON_CLASSIC_BOTTOM","BUTTON_CLASSIC_BOTTOM"),P(N,"FEEDBACK_BUTTON_NONE","BUTTON_NONE"),P(N,"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},V="https://docs.gleap.ai/documentation/javascript/content-security-policy",G=new Set,$="gleap-frame-route-failed",X=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 h,f,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($)+"));}}catch(e){}<\/script>";h=/<script\b/i.test(c)?c.replace(/<script\b/i,g+"<script"):/<\/head>/i.test(c)?c.replace(/<\/head>/i,g+"</head>"):c;try{f=e.contentDocument}catch(a){return o()}if(!f)return o();try{e.addEventListener($,o,{once:!0})}catch(a){}try{f.open(),function(e,t){var n=!1;try{e.addEventListener("securitypolicyviolation",(function(e){if(e&&"report"!==e.disposition){var r=e.blockedURI||"a resource",o=e.effectiveDirective||e.violatedDirective||"unknown directive",i=r+"|"+o;G.has(i)||(G.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 "+V)),t&&!n&&X(o)&&"string"==typeof r&&0===r.indexOf(t.baseHref)&&(n=!0,t.onBlocked())}}))}catch(a){}}(f,{baseHref:n,onBlocked:o}),f.write(h),f.close()}catch(a){o()}})).catch((function(e){G.has(t)||(G.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)),o()}))}},J=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?j(Object(n),!0).forEach((function(t){_(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"!==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"},he=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 fe(e){return fe="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},fe(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"!=fe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=fe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fe(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=function(e){var t=e.getBoundingClientRect();return{x:window.pageXOffset+t.left,y:window.pageYOffset+t.top,width:e.offsetWidth,height:e.offsetHeight}}(e);this.overlay.setBounds(t),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 Ee(e){return function(e){if(Array.isArray(e))return Ie(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 Ie(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 Ie(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 Ie(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 Re(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 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&&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 Pe(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 De(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 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:Se,ID:xe};return t.reduce((function(t,n){return t[n]=r[n](e),t}),{})}function Ne(e,t){try{var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}catch(r){return!1}}function je(e,t){return t.find(Ne.bind(null,e))}function _e(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=je(e,r);return Boolean(o)||Boolean(n)&&(o=je(e,r=r.map((function(e){return n+e}))),Boolean(o))?o:null}function Fe(e,t,n,r){var o,i=De(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=Re(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,h=i.NthChild;switch(c){case"ID":if(Boolean(l)&&Ne(e,l))return l;break;case"Tag":if(Boolean(u)&&Ne(e,u))return u;break;case"Class":if(Boolean(d)&&d.length&&(o=_e(e,d,u)))return o;break;case"Attributes":if(Boolean(p)&&p.length&&(o=_e(e,p,u)))return o;break;case"NthChild":if(Boolean(h))return h}}}catch(f){s.e(f)}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=Re(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 h=[],f=0,g=l;f<g.length;f++){var m=g[f];h.unshift(m);var v=h.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,"#")},Ve=function(e){return e.match(/(?:^\d|:)/)?'[id="'.concat(e,'"]'):"#".concat(e)},Ge=["data-testid","data-test-id","data-test","data-cy","data-qa","name"],$e=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(Ve(i))&&r.push(Ve(i)),r.push.apply(r,function(e){var t=(e.tagName||"").toLowerCase();return Ge.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 Ve(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 Xe(e){return Xe="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},Xe(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 Je(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"!=Xe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Xe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Xe(t)?t:String(t)}var Qe=Je((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=$e(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;var tt=Object.freeze(["https://app.gleap.ai","https://app.gleap.io"]),nt=function(e){return"string"==typeof e&&-1!==tt.indexOf(e)},rt=function(e){return nt(e)?e:"https://app.gleap.ai"};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 it(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 at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?it(Object(n),!0).forEach((function(t){ct(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return 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,lt(r.key),r)}}function ct(e,t,n){return(t=lt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lt(e){var t=function(e,t){if("object"!=ot(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ot(r))return r;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 ut=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),ct(this,"libraryInstance",null),ct(this,"lastUrl",void 0),ct(this,"injectedFrame",!1),ct(this,"gleapFrameContainer",null),ct(this,"gleapCollapseUI",null),ct(this,"injectedCollapseUI",!1),ct(this,"gleapFrame",null),ct(this,"configData",null),ct(this,"adminHelper",null),ct(this,"status","navigate"),ct(this,"initialized",!1),ct(this,"adminOrigin",null),ct(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))})),ct(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(he("arrowdown"),"\n </div>"),document.body.appendChild(e),t.gleapCollapseUI=e,e.addEventListener("click",(function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t.toggleCollapseUI()}))}})),ct(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="'.concat(rt(t.adminOrigin),"/").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,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,bv.getInstance().disable(),lr.getInstance().disable(),Rg.getInstance().disable(),py.close(),py.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(nt(n.origin))try{var r=JSON.parse(n.data);if("admin"===r.type&&("load"===r.name&&(t.adminOrigin||(t.adminOrigin=rt(n.origin)),t.configData=r.data,t.initAdminHelper()),"smartlink-search-result"===r.name&&e.sendMessageToTourBuilder({name:"smartlink-search-result",data:r.data}),"translate-complete"===r.name&&e.sendMessageToTourBuilder({name:"translate-complete",data:r.data})),"tourbuilder"===r.type){var o;if("loaddata"===r.name&&e.sendMessageToTourBuilder({name:"data",data:at(at({},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(at(at({},e),{},{type:"admin"})),this.adminOrigin||"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(at(at({},e),{},{type:"tourbuilder"})),rt(this.adminOrigin))}catch(t){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&st(t.prototype,n),r&&st(t,r),Object.defineProperty(t,"prototype",{writable:!1}),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 pt(){pt=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==dt(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(dt(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 ht(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 ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(n),!0).forEach((function(t){gt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gt(e,t,n){return(t=wt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mt(e){return function(e){if(Array.isArray(e))return vt(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 vt(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 vt(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 vt(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 yt(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 bt(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,wt(r.key),r)}}function wt(e){var t=function(e,t){if("object"!=dt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dt(t)?t:String(t)}ct(ut,"instance",void 0);var kt=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=pt().mark((function e(t){var n,r,o,i,a,s,c,l=this;return pt().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(mt(this._messages),[{id:"user-".concat(Date.now()),role:"user",content:n,createdAt:(new Date).toISOString()}]),r="stream-".concat(Date.now()),this._messages=[].concat(mt(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]=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,r){var i=o.apply(e,t);function a(e){yt(i,n,r,a,s,"next",e)}function s(e){yt(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?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(),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&&bt(t.prototype,n),r&&bt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();const xt=kt;var St={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"}},Ct="eu";function Et(e){return Et="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},Et(e)}function It(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 Tt(e,t,n){return t=Rt(t),function(e,t){if(t&&("object"===Et(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Lt(e)}(e,At()?Reflect.construct(t,n||[],Rt(e).constructor):t.apply(e,n))}function Lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ot(e){var t="function"==typeof Map?new Map:void 0;return Ot=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(At())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Mt(o,n.prototype),o}(e,arguments,Rt(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Mt(n,e)},Ot(e)}function At(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(At=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 Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rt(e)}function Pt(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"!=Et(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Et(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Et(t)?t:String(t)}var Nt="https://outboundmedia.gleap.io/agent-conversation",jt=function(e){Nt=e};function _t(e){return _t="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},_t(e)}function Ft(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,Ut(r.key),r)}}function Bt(e,t,n){return(t=Ut(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ut(e){var t=function(e,t){if("object"!=_t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_t(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),Bt(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=py.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)&&Ft(t.prototype,n),r&&Ft(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function zt(e){return zt="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},zt(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 Wt(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 Wt(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 Wt(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 Vt(){Vt=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==zt(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(zt(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 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 $t(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,Kt(r.key),r)}}function Xt(e,t,n){return(t=Kt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kt(e){var t=function(e,t){if("object"!=zt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zt(t)?t:String(t)}Bt(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),Xt(this,"agentTools",[]),Xt(this,"agentToolCallbacks",[]),Xt(this,"registeredAgentTools",{}),Xt(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=Vt().mark((function e(t){var n,r,o,i,a,s,c;return Vt().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 Ht.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){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:"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 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&&$t(t.prototype,n),r&&$t(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Yt(e){return Yt="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},Yt(e)}function Zt(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 Qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(n),!0).forEach((function(t){tn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function en(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,nn(r.key),r)}}function tn(e,t,n){return(t=nn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nn(e){var t=function(e,t){if("object"!=Yt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Yt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Yt(t)?t:String(t)}function rn(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 on(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 on(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 on(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}Xt(Jt,"instance",void 0);var an="default",sn="auto",cn="light",ln="dark",un=[sn,cn,ln],dn=[["headerColor","darkHeaderColor"],["headerColor2","darkHeaderColor2"],["headerColor3","darkHeaderColor3"],["color","darkColor"],["backgroundColor","darkBackgroundColor"]],pn=[["logo","darkLogo"],["bgImage","darkBgImage"],["aurora","darkAurora"]],hn=["data-theme","data-bs-theme","data-color-scheme","data-color-mode","data-mode","data-mui-color-scheme"],fn=["dark","dark-mode","dark-theme","theme-dark"],gn=["light","light-mode","light-theme","theme-light"],mn=function(e){if("string"!=typeof e)return null;var t=e.trim().toLowerCase(),n=t.match(/^#([0-9a-f]{3})$/);if(n){var r=rn(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},vn=function(e){if("string"!=typeof e||!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e.trim()))return null;var t=mn(e);return"#"+[t.r,t.g,t.b].map((function(e){return e.toString(16).padStart(2,"0")})).join("")},yn="data-gleap-dark",bn=function(e){if("string"!=typeof e)return null;var t=e.toLowerCase();return-1!==t.indexOf("dark")?ln:-1!==t.indexOf("light")?cn:null},wn=function(e){if(!e)return null;for(var t=0;t<hn.length;t++){var n=bn(e.getAttribute(hn[t]));if(n)return n}var r=e.classList;if(r){if(fn.some((function(e){return r.contains(e)})))return ln;if(gn.some((function(e){return r.contains(e)})))return cn}return null},kn=function(e){try{return e&&window.getComputedStyle?window.getComputedStyle(e):null}catch(t){return null}},xn=function(e){var t,n=kn(e),r=mn(n?n.backgroundColor:null);return!r||r.a<.5?null:(299*(t=r).r+587*t.g+114*t.b)/1e3<128?ln:cn},Sn=function(){try{return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}catch(e){return null}},Cn=function(){if("undefined"==typeof document)return cn;var e,t,n,r,o=document.documentElement,i=document.body,a=wn(o)||wn(i)||(e=kn(o),t=e?(e.colorScheme||e.getPropertyValue("color-scheme")||"").toLowerCase():"",n=-1!==t.indexOf("dark"),r=-1!==t.indexOf("light"),n&&!r?ln:r&&!n?cn:null)||xn(i)||xn(o);if(a)return a;var s=Sn();return s&&s.matches?ln:cn},En=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),tn(this,"colorScheme",null),tn(this,"lightBackgroundColor",null),tn(this,"darkBackgroundColor",null),tn(this,"detectedScheme",null),tn(this,"mutationObserver",null),tn(this,"mediaQuery",null),tn(this,"settleTimeout",null),tn(this,"checkHostColorScheme",(function(){if(t.getColorScheme()===sn){var e=Cn();e!==t.detectedScheme&&(t.detectedScheme=e,t.notifyChange())}})),tn(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===cn||e===ln?e:sn}(e),this.lightBackgroundColor=vn(null==t?void 0:t.lightBackgroundColor),this.darkBackgroundColor=vn(null==t?void 0:t.darkBackgroundColor),this.updateWatching(),this.notifyChange()}},{key:"getDashboardConfig",value:function(){try{return Ku.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!==un.indexOf(e)?e:an);return n===an?an:this.colorScheme||n}},{key:"hasDarkPalette",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getDashboardConfig();return!!this.darkBackgroundColor||!!e&&dn.some((function(t){var n=rn(t,2)[1];return null!==vn(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===sn?n=this.detectedScheme||Cn():t!==cn&&t!==ln||(n=t),n!==ln||this.hasDarkPalette(e)?n:null}},{key:"applyToFlowConfig",value:function(e){var t=this.getActiveColorScheme(e);if(!e||!t)return e;if(t===cn)return this.lightBackgroundColor?Qt(Qt({},e),{},{backgroundColor:this.lightBackgroundColor}):e;var n=Qt({},e);return dn.forEach((function(t){var r=rn(t,2),o=r[0],i=r[1],a=vn(e[i]);a&&(n[o]=a)})),this.darkBackgroundColor&&(n.backgroundColor=this.darkBackgroundColor),pn.forEach((function(t){var r=rn(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===ln?n?"dark-glow":"dark":n?"light-glow":"light"}},{key:"applyToChecklist",value:function(e){e&&(this.getActiveColorScheme()===ln?e.setAttribute(yn,""):e.removeAttribute(yn))}},{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()===sn?(this.mutationObserver||this.mediaQuery||(this.detectedScheme=Cn()),this.startWatching()):this.stopWatching()}},{key:"startWatching",value:function(){var e=this;if("undefined"!=typeof window&&"undefined"!=typeof document&&(this.mediaQuery||(this.mediaQuery=Sn(),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(hn)};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{Ku.getInstance().refreshColorScheme()}catch(e){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&en(t.prototype,n),r&&en(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function In(){In=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==On(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(On(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 Tn(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 Ln(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Tn(i,r,o,a,s,"next",e)}function s(e){Tn(i,r,o,a,s,"throw",e)}a(void 0)}))}}function On(e){return On="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},On(e)}function An(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 Mn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?An(Object(n),!0).forEach((function(t){Pn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rn(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,Dn(r.key),r)}}function Pn(e,t,n){return(t=Dn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dn(e){var t=function(e,t){if("object"!=On(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=On(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==On(t)?t:String(t)}tn(En,"instance",void 0);var Nn=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Pn(this,"chatbarContainer",null),Pn(this,"chatbarFrame",null),Pn(this,"config",null),Pn(this,"isHidden",!0),Pn(this,"manuallyHidden",!1),Pn(this,"manuallyShown",!1),Pn(this,"comReady",!1),Pn(this,"pendingMessages",[]),Pn(this,"chatbarStyle",null),Pn(this,"_panelOpen",!1),Pn(this,"agentId",null),Pn(this,"agentName",null),Pn(this,"agentContext",null),this._listenForMessages(),this._listenForOutsideClicks()}var t,n,r,o,i;return t=e,n=[{key:"chatbarUrl",get:function(){return"".concat(ig.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 ig.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{ig.getInstance().urlHandler(o,i)}catch(a){}return}if("tool-execution"===r.name&&r.data)return Ht.notifyEvent("tool-execution",r.data),void Jt.getInstance().triggerToolAction(r.data);if("frontend-tool-execute"===r.name&&r.data)return void Jt.getInstance().executeToolAction(r.data).then((function(t){e._postMessageRaw({name:"frontend-tool-result",data:t})}));if("notify-event"===r.name&&r.data)return void Ht.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:Lf.getInstance().getSession(),apiUrl:Lf.getInstance().apiUrl,realtimeHost:Lf.getInstance().realtimeHost,sdkKey:Lf.getInstance().sdkKey}})}},{key:"_sendConfigUpdate",value:function(){this._postMessageRaw({name:"config-update",data:{config:this._withChatbarConfig(Ku.getInstance().getFlowConfig()),aiTools:Jt.getInstance().getAgentTools(),agentTools:Jt.getInstance().getAgentTools(),overrideLanguage:Xv.getInstance().getOverrideLanguage()}})}},{key:"_withChatbarConfig",value:function(e){var t,n,r,o,i,a=e||{};return Mn(Mn({},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:En.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;Fv.getInstance().sendMessage({type:"chatbar-notification-cleared",gleapId:null===(t=Lf.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(Ku.getInstance().getFlowConfig()),aiTools:Jt.getInstance().getAgentTools(),agentTools:Jt.getInstance().getAgentTools(),overrideLanguage:Xv.getInstance().getOverrideLanguage()}})}},{key:"_normalizeAgentOptions",value:function(e){return e&&"object"===On(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=Ku.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=Ln(In().mark((function e(t){var n,r,o,i,a,s,c;return In().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=Lf.getInstance(),i=o.apiUrl||St[Ct].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=Ln(In().mark((function e(t,n){var r,o,i=this;return In().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;ig.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=Ku.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&&Rn(t.prototype,n),r&&Rn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function jn(e){return jn="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},jn(e)}function _n(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,Bn(r.key),r)}}function Fn(e,t,n){return(t=Bn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bn(e){var t=function(e,t){if("object"!=jn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=jn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jn(t)?t:String(t)}Pn(Nn,"instance",void 0);var Un=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)&&_n(t.prototype,n),r&&_n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Fn(Un,"audio",void 0),Fn(Un,"settings",{play:!0});const Hn="JAVASCRIPT",zn="web";let qn=!0,Wn=!0;const Vn=()=>Wn,Gn=["start-conversation","start-custom-action","start-product-tour","open-url","show-form","show-survey","show-news-article","show-help-article","show-checklist"],$n=e=>{try{return-1!==Gn.indexOf(e)&&ig.getInstance().isCaptureHidden()}catch(t){return!1}},Xn=()=>{try{return"19.2.0"}catch(e){return""}},Kn=()=>{try{const e=Ku.getInstance().getFlowConfig();if(e&&e.capture&&"object"==typeof e.capture)return e.capture}catch(e){}return{}},Jn=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}catch(e){return!1}},Yn=()=>{try{return"undefined"!=typeof navigator&&!!navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getUserMedia}catch(e){return!1}},Zn=()=>{try{const e=navigator,t=e.userAgentData;if(t&&Array.isArray(t.brands))return!t.mobile&&t.brands.some((e=>e&&/Chromium/i.test(e.brand)));const n=e.userAgent||"";return/\bChrome\/\d+/.test(n)&&!/Android|Mobile|CriOS|EdgiOS|FxiOS/i.test(n)}catch(e){return!1}},Qn=()=>Jn()&&"undefined"!=typeof window&&"function"==typeof window.MediaRecorder?"display":"rrweb",er=()=>{if(!qn)return!1;try{return"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof HTMLCanvasElement&&"undefined"!=typeof Element&&"function"==typeof Element.prototype.attachShadow}catch(e){return!1}},tr=()=>{const e={version:1,platform:zn,sdkType:Hn,sdkVersion:Xn(),screenshot:!1,recording:!1,annotate:!1};if(!er())return e;const t=Qn();return e.screenshot=!0,e.recording=!0,e.annotate=!0,e.recordingMethod=t,e.maxRecordingSec=180,e.microphone="display"===t&&!0===Kn().allowMicrophone&&Yn(),e};function nr(e){return nr="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},nr(e)}function rr(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 or(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(n),!0).forEach((function(t){ar(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ir(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,sr(r.key),r)}}function ar(e,t,n){return(t=sr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sr(e){var t=function(e,t){if("object"!=nr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=nr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==nr(t)?t:String(t)}var cr=function(e){return!!e&&[e.overflowX||e.overflow,e.overflowY||e.overflow].some((function(e){return!!e&&"visible"!==e}))},lr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ar(this,"bannerUrl","https://outboundmedia.gleap.io"),ar(this,"bannerContainer",null),ar(this,"bannerData",null),ar(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,h,f,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"):e.applyInlineClipLayout()),"banner-close"===v.name&&e.removeBannerUI(),$n(v.name))return;if("start-conversation"===v.name&&py.startBot(null===(s=v.data)||void 0===s?void 0:s.botId),"start-custom-action"===v.name&&py.triggerCustomAction(null===(c=v.data)||void 0===c?void 0:c.action),"start-product-tour"===v.name&&py.startProductTour(null===(l=v.data)||void 0===l?void 0:l.tourId,!0),"open-url"===v.name){var y=v.data,b=!!v.newTab;ig.getInstance().urlHandler(y,b)}"show-form"===v.name&&py.startFeedbackFlow(null===(u=v.data)||void 0===u?void 0:u.formId),"show-survey"===v.name&&py.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&&py.openNewsArticle(null===(h=v.data)||void 0===h?void 0:h.articleId),"show-help-article"===v.name&&py.openHelpCenterArticle(null===(f=v.data)||void 0===f?void 0:f.articleId),"show-checklist"===v.name&&py.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"),document.body.classList.remove("gleap-b-clip")}},{key:"applyInlineClipLayout",value:function(){if(!document.body.classList.contains("gleap-b-clip"))try{var e=window.getComputedStyle(document.body);if(!function(e,t){return cr(e)&&cr(t)}(window.getComputedStyle(document.documentElement),e))return;document.documentElement.style.setProperty("--gleap-b-body-padding-top",e.paddingTop||"0px"),document.body.classList.add("gleap-b-clip")}catch(t){}}},{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(or(or({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){this.injectBannerUI(e)}}])&&ir(t.prototype,n),r&&ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();ar(lr,"instance",void 0);var ur,dr=Object.defineProperty,pr=(e,t,n)=>((e,t,n)=>t in e?dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),hr=(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))(hr||{}),fr=(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))(fr||{}),gr=(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))(gr||{}),mr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(mr||{}),vr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(vr||{}),yr=(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))(yr||{}),br=(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))(br||{});const wr={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},kr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},xr={},Sr={},Cr=()=>!!globalThis.Zone;function Er(e){if(xr[e])return xr[e];const t=globalThis[e],n=t.prototype,r=e in wr?wr[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 kr?kr[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&&!Cr())return xr[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",""),Sr[e]=()=>r.remove()):r.remove(),xr[e]=i}catch{return n}}const Ir={};function Tr(e,t,n){var r;const o=`${e}.${String(n)}`;if(Ir[o])return Ir[o].call(t);const i=Er(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(Ir[o]=a,a.call(t)):t[n]}const Lr={};function Or(e,t,n){const r=`${e}.${String(n)}`;if(Lr[r])return Lr[r].bind(t);const o=Er(e)[n];return"function"!=typeof o?t[n]:(Lr[r]=o,o.bind(t))}function Ar(){return[Er("MutationObserver").constructor,Sr.MutationObserver??(()=>{})]}let Mr=Date.now;function Rr(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())||(Mr=()=>(new Date).getTime());const Pr={ownerDocument:function(e){return Tr("Node",e,"ownerDocument")},childNodes:function(e){return Tr("Node",e,"childNodes")},parentNode:function(e){return Tr("Node",e,"parentNode")},parentElement:function(e){return Tr("Node",e,"parentElement")},textContent:function(e){return Tr("Node",e,"textContent")},contains:function(e,t){return Or("Node",e,"contains")(t)},getRootNode:function(e){return Or("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Tr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Tr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Tr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Tr("Element",e,"querySelectorAll")(t)},nowTimestamp:Mr,mutationObserverCtor:Ar,patch:Rr};function Dr(e){return e.nodeType===e.ELEMENT_NODE}function Nr(e){const t=e&&"host"in e&&"mode"in e&&Pr.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Pr.shadowRoot(t)===e)}function jr(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function _r(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=>Fr(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 Fr(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=_r(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?Kr(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?Kr(n,t):n}}class Br{constructor(){pr(this,"idNodeMap",new Map),pr(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 Ur({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let a=o||"";const s=r&&Hr(r);return(t[n.toLowerCase()]||s&&t[s])&&(a=i?i(a,e):"*".repeat(a.length)),a}function Hr(e){return e.toLowerCase()}const zr="__rrweb_original__";function qr(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Hr(t):null}function Wr(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 Vr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Gr=/^(?:[a-z+]+:)?\/\//i,$r=/^www\..*/i,Xr=/^(data:)([^,]*),(.*)/i;function Kr(e,t){return(e||"").replace(Vr,((e,n,r,o,i,a)=>{const s=r||i||a,c=n||o||"";if(!s)return e;if(Gr.test(s)||$r.test(s))return`url(${c}${s}${c})`;if(Xr.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 Jr(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Yr(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=Jr(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=Jr(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),h=-1;if(2===p.length)h=p[0].length;else if(p.length>2&&""===p[0]&&""!==r[s-1].textContent)h=t.indexOf(d,1);else if(1===p.length){if(d=d.substring(0,d.length-1),p=t.split(d),p.length<=1)return o.push(e),o;u=l+1}else u===c.length-1&&(h=t.indexOf(d));if(p.length>=2&&u>l){const e=r[s-1].textContent;if(e&&"string"==typeof e){const n=Jr(e).length;h=t.indexOf(d,n)}-1===h&&(h=p[0].length)}if(-1!==h){let s=Math.floor(h/a);for(;s>0&&s<e.length;){if(i+=1,i>50*r.length)return o.push(e),o;const c=Jr(e.substring(0,s),n);if(c.length===h){o.push(e.substring(0,s)),e=e.substring(s),t=t.substring(h);break}c.length<h?s+=Math.max(1,Math.floor((h-c.length)/a)):s-=Math.max(1,Math.floor((c.length-h)*a))}break}}}}return o.push(e),o}(e,t).join("/* rr_split */")}let Zr=1;const Qr=new RegExp("[^a-z0-9-_:]"),eo=-2;function to(){return Zr++}let no,ro;const oo=/^[^ \t\n\r\u000c]+/,io=/^[, \t\n\r\u000c]+/;const ao=new WeakMap;function so(e,t){return t&&""!==t.trim()?lo(e,t):t}function co(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function lo(e,t){let n=ao.get(e);if(n||(n=e.createElement("a"),ao.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function uo(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)?so(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(io),!(n>=t.length);){let i=r(oo);if(","===i.slice(-1))i=so(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=so(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?Kr(r,lo(e)):"object"===t&&"data"===n?so(e,r):r:r}function po(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function ho(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&ho(Pr.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&ho(Pr.parentNode(e),t,n)}function fo(e,t,n,r){let o;if(Dr(e)){if(o=e,!Pr.childNodes(o).length)return!1}else{if(null===Pr.parentElement(e))return!1;o=Pr.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(ho(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 go(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:h,keepIframeSrcFn:f,newlyAddedElement:g=!1,cssCaptured:m=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:br.Document,childNodes:[],compatMode:e.compatMode}:{type:br.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:br.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:h}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,o),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=Hr(e.tagName);return Qr.test(t)?"div":t}(e);let m={};const v=e.attributes.length;for(let w=0;w<v;w++){const t=e.attributes[w];po(g,t.name,t.value)||(m[t.name]=uo(n,g,Hr(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=_r(t)),r&&(delete m.rel,delete m.href,m._cssText=r)}if("style"===g&&e.sheet){let t=_r(e.sheet);t&&(e.childNodes.length>1&&(t=Yr(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=Ur({element:e,type:qr(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=zr in o?o[zr]: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){no||(no=n.createElement("canvas"),ro=no.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{no.width=t.naturalWidth,no.height=t.naturalHeight,ro.drawImage(t,0,0),m.rr_dataURL=no.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(f){const{width:t,height:n}=e.getBoundingClientRect();m={class:m.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==g||d(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);let y;try{customElements.get(g)&&(y=!0)}catch(b){}return{type:br.Element,tagName:g,attributes:m,childNodes:[],isSVG:co(e)||void 0,needBlock:f,rootId:h,isCustom:y}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,a=Pr.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=Pr.textContent(e),l&&c&&(c=Kr(c,lo(t.doc))));!l&&!u&&c&&n&&(c=r?r(c,Pr.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:br.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:l,rootId:v,cssCaptured:m});case e.CDATA_SECTION_NODE:return{type:br.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:br.Comment,textContent:Pr.textContent(e)||"",rootId:v};default:return!1}}function mo(e){return null==e?"":e.toLowerCase()}function vo(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 yo(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:h,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:S=!1,cssCaptured:C=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:I=!0}=t;if(!E){E=fo(e,a,s,void 0===E)}const T=go(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:f,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===br.Comment)return!0;if(e.type===br.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"===Wr(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(mo(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===mo(e.attributes.name)||"icon"===mo(e.attributes.rel)||"apple-touch-icon"===mo(e.attributes.rel)||"shortcut icon"===mo(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&mo(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(mo(e.attributes.property).match(/^(og|twitter|fb):/)||mo(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===mo(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===mo(e.attributes.name)||"googlebot"===mo(e.attributes.name)||"bingbot"===mo(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===mo(e.attributes.name)||"generator"===mo(e.attributes.name)||"framework"===mo(e.attributes.name)||"publisher"===mo(e.attributes.name)||"progid"===mo(e.attributes.name)||mo(e.attributes.property).match(/^article:/)||mo(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===mo(e.attributes.name)||"yandex-verification"===mo(e.attributes.name)||"csrf-token"===mo(e.attributes.name)||"p:domain_verify"===mo(e.attributes.name)||"verify-v1"===mo(e.attributes.name)||"verification"===mo(e.attributes.name)||"shopify-checkout-api-token"===mo(e.attributes.name)))return!0}}return!1}(T,h)||!I&&T.type===br.Text&&!T.textContent.replace(/^\s+|\s+$/gm,"").length?eo:to();const O=Object.assign(T,{id:L});if(r.add(e,O),L===eo)return null;v&&v(e);let A=!c;if(O.type===br.Element){A=A&&!O.needBlock,delete O.needBlock;const t=Pr.shadowRoot(e);t&&jr(t)&&(O.isShadowHost=!0)}if((O.type===br.Document||O.type===br.Element)&&A){h.headWhitespace&&O.type===br.Element&&"head"===O.tagName&&(I=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(O.type===br.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else{O.type===br.Element&&void 0!==O.attributes._cssText&&"string"==typeof O.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(Pr.childNodes(e))){const e=yo(n,t);e&&O.childNodes.push(e)}}let S=null;if(Dr(e)&&(S=Pr.shadowRoot(e)))for(const e of Array.from(Pr.childNodes(S))){const n=yo(e,t);n&&(jr(S)&&(n.isShadow=!0),O.childNodes.push(n))}}const M=Pr.parentNode(e);return M&&Nr(M)&&jr(M)&&(O.isShadow=!0),O.type===br.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=yo(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});n&&y(e,n)}}),b),O.type===br.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===Wr(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=yo(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:I,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&w(e,t)}}),k),O}class bo{constructor(...e){pr(this,"parentElement",null),pr(this,"parentNode",null),pr(this,"ownerDocument"),pr(this,"firstChild",null),pr(this,"lastChild",null),pr(this,"previousSibling",null),pr(this,"nextSibling",null),pr(this,"ELEMENT_NODE",1),pr(this,"TEXT_NODE",3),pr(this,"nodeType"),pr(this,"nodeName"),pr(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 bo))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 wo(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const ko="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 xo={map:{},getId:()=>(console.error(ko),-1),getNode:()=>(console.error(ko),null),removeNodeFromMap(){console.error(ko)},has:()=>(console.error(ko),!1),reset(){console.error(ko)}};function So(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 Co(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)}}),()=>Co(e,t,i||{},!0)}function Eo(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=Pr.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=Pr.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function Io(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function To(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Lo(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Pr.parentElement(e)}function Oo(e,t,n,r){if(!e)return!1;const o=Lo(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(ho(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 Ao(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||t.getId(e)===eo}function Mo(e,t){if(Nr(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=Pr.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Mo(r,t))}function Ro(e){return Boolean(e.changedTouches)}function Po(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Do(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function No(e){return!!e&&(e instanceof bo&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Pr.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(xo=new Proxy(xo,{get:(e,t,n)=>("map"===t&&console.error(ko),Reflect.get(e,t,n))}));class jo{constructor(){pr(this,"id",1),pr(this,"styleIDMap",new WeakMap),pr(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 _o(e){var t;let n=null;return"getRootNode"in e&&(null==(t=Pr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Pr.host(Pr.getRootNode(e))&&(n=Pr.host(Pr.getRootNode(e))),n}function Fo(e){const t=Pr.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=_o(n);)n=t;return n}(e);return Pr.contains(t,n)}function Bo(e){const t=Pr.ownerDocument(e);return!!t&&(Pr.contains(t,e)||Fo(e))}function Uo(e){return"__ln"in e}class Ho{constructor(){pr(this,"length",0),pr(this,"head",null),pr(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&&Uo(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&&Uo(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 zo=(e,t)=>`${e}@${t}`;class qo{constructor(){pr(this,"frozen",!1),pr(this,"locked",!1),pr(this,"texts",[]),pr(this,"attributes",[]),pr(this,"attributeMap",new WeakMap),pr(this,"removes",[]),pr(this,"mapRemoves",[]),pr(this,"movedMap",{}),pr(this,"addedSet",new Set),pr(this,"movedSet",new Set),pr(this,"droppedSet",new Set),pr(this,"removesSubTreeCache",new Set),pr(this,"mutationCb"),pr(this,"blockClass"),pr(this,"blockSelector"),pr(this,"maskTextClass"),pr(this,"maskTextSelector"),pr(this,"inlineStylesheet"),pr(this,"maskInputOptions"),pr(this,"maskTextFn"),pr(this,"maskInputFn"),pr(this,"keepIframeSrcFn"),pr(this,"recordCanvas"),pr(this,"inlineImages"),pr(this,"slimDOMOptions"),pr(this,"dataURLOptions"),pr(this,"doc"),pr(this,"mirror"),pr(this,"iframeManager"),pr(this,"stylesheetManager"),pr(this,"shadowDomManager"),pr(this,"canvasManager"),pr(this,"processedNodeManager"),pr(this,"unattachedDoc"),pr(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),pr(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Ho,r=e=>{let t=e,n=eo;for(;n===eo;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=Pr.parentNode(o);if(!i||!Bo(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=Nr(i)?this.mirror.getId(_o(o)):this.mirror.getId(i),c=r(o);if(-1===s||-1===c)return n.addNode(o);const l=yo(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=>{Po(e,this.mirror)&&this.iframeManager.addIframe(e),Do(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),No(o)&&this.shadowDomManager.addShadowRoot(Pr.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)Vo(this.removesSubTreeCache,s,this.mirror)&&!this.movedSet.has(Pr.parentNode(s))||o(s);for(const s of this.addedSet)Go(this.droppedSet,s)||Vo(this.removesSubTreeCache,s,this.mirror)?Go(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(Pr.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(Pr.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=Pr.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Pr.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=Pr.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))})),pr(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(Pr.childNodes(e),(e=>Pr.textContent(e)||"")).join("");t.attributes.value=Ur({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:qr(e),value:n,maskInputFn:this.maskInputFn})})),pr(this,"processMutation",(e=>{if(!Ao(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Pr.textContent(e.target);Oo(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:fo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Lo(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=qr(n);o=Ur({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(Oo(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"),!po(n.tagName,r))if(i.attributes[r]=uo(this.doc,Hr(n.tagName),Hr(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(Oo(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=Nr(e.target)?this.mirror.getId(Pr.host(e.target)):this.mirror.getId(e.target);Oo(e.target,this.blockClass,this.blockSelector,!1)||Ao(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Wo(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Mo(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[zo(n,r)]?Wo(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!Nr(e.target)||!jr(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Pr.childNodes(e).forEach((e=>n.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),pr(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ao(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[zo(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Oo(e,this.blockClass,this.blockSelector,!1)||(Pr.childNodes(e).forEach((e=>this.genAdds(e))),No(e)&&Pr.childNodes(Pr.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 Wo(e,t){e.delete(t),Pr.childNodes(t).forEach((t=>Wo(e,t)))}function Vo(e,t,n){return 0!==e.size&&function(e,t,n){const r=Pr.parentNode(t);return!!r&&e.has(r)}(e,t)}function Go(e,t){return 0!==e.size&&$o(e,t)}function $o(e,t){const n=Pr.parentNode(t);return!!n&&(!!e.has(n)||$o(e,n))}let Xo;const Ko=e=>{if(!Xo)return e;return(...t)=>{try{return e(...t)}catch(n){if(Xo&&!0===Xo(n))return;throw n}}},Jo=[];function Yo(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 Zo(e,t){const n=new qo;Jo.push(n),n.init(e);const[r,o]=Ar(),i=new r(Ko(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Qo({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(gr).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((i=>{let a=Hr(i);const l=(t=>i=>{const a=Yo(i);if(Oo(a,r,o,!0))return;let s=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":s=mr.Mouse;break;case"touch":s=mr.Touch;break;case"pen":s=mr.Pen}s===mr.Touch?gr[t]===gr.MouseDown?l="TouchStart":gr[t]===gr.MouseUp&&(l="TouchEnd"):mr.Pen}else Ro(i)&&(s=mr.Touch);null!==s?(c=s,(l.startsWith("Touch")&&s===mr.Touch||l.startsWith("Mouse")&&s===mr.Mouse)&&(s=null)):gr[t]===gr.Click&&(s=c,c=null);const u=Ro(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(a),{clientX:p,clientY:h}=u;Ko(e)({type:gr[l],id:d,x:p,y:h,...null!==s&&{pointerType:s}})})(i);if(window.PointerEvent)switch(gr[i]){case gr.MouseDown:case gr.MouseUp:a=a.replace("mouse","pointer");break;case gr.TouchStart:case gr.TouchEnd:return}s.push(wo(a,l,t))})),Ko((()=>{s.forEach((e=>e()))}))}function ei({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return wo("scroll",Ko(So(Ko((i=>{const a=Yo(i);if(!a||Oo(a,r,o,!0))return;const s=n.getId(a);if(a===t&&t.defaultView){const n=Eo(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 ti=["INPUT","TEXTAREA","SELECT"],ni=new WeakMap;function ri(e){return function e(t,n){if(si("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||si("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||si("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||si("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 oi(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function ii({mirror:e,stylesheetManager:t},n){var r,o,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(Pr.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}}),Ko((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function ai(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:h,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),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),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Zo(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=So(Ko((t=>{const n=Date.now()-a;e(s.map((e=>(e.timeOffset-=n,e))),t),s=[],a=null})),i),l=Ko(So(Ko((e=>{const t=Yo(e),{clientX:n,clientY:o}=Ro(e)?e.changedTouches[0]:e;a||(a=Mr()),s.push({x:n,y:o,id:r.getId(t),timeOffset:Mr()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?fr.Drag:e instanceof MouseEvent?fr.MouseMove:fr.TouchMove)})),o,{trailing:!1})),u=[wo("mousemove",l,n),wo("touchmove",l,n),wo("drag",l,n)];return Ko((()=>{u.forEach((e=>e()))}))}(e),a=Qo(e),s=ei(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return wo("resize",Ko(So(Ko((()=>{const t=Io(),o=To();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=Yo(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=Pr.parentElement(n)),!n||!d||ti.indexOf(d)<0||Oo(n,r,o,!0))return;if(n.classList.contains(i)||a&&n.matches(a))return;let h=n.value,f=!1;const g=qr(n)||"";"radio"===g||"checkbox"===g?f=n.checked:(s[d.toLowerCase()]||s[g])&&(h=Ur({element:n,maskInputOptions:s,tagName:d,type:g,value:h,maskInputFn:c})),p(n,u?{text:h,isChecked:f,userTriggered:l}:{text:h,isChecked:f});const m=n.name;"radio"===g&&m&&f&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{if(e!==n){const t=e.value;p(e,u?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}}))}function p(t,r){const o=ni.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){ni.set(t,r);const o=n.getId(t);Ko(e)({...r,id:o})}}const h=("last"===l.input?["change"]:["input","change"]).map((e=>wo(e,Ko(d),t))),f=t.defaultView;if(!f)return()=>{h.forEach((e=>e()))};const g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push(...m.map((e=>Co(e[0],e[1],{set(){Ko(d)({target:this,isTrusted:!1})}},!1,f)))),Ko((()=>{h.forEach((e=>e()))}))}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const a=Ko((i=>So(Ko((o=>{const a=Yo(o);if(!a||Oo(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=[wo("play",a(yr.Play),i),wo("pause",a(yr.Pause),i),wo("seeked",a(yr.Seeked),i),wo("volumechange",a(yr.VolumeChange),i),wo("ratechange",a(yr.RateChange),i)];return Ko((()=>{s.forEach((e=>e()))}))}(e);let d=()=>{},p=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ko(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=oi(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:Ko(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=oi(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:Ko(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=oi(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:Ko(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=oi(o,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,replaceSync:a}),r.apply(o,i)}))}));const c={};ci("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(ci("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),ci("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),ci("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:Ko(((r,o,i)=>{const[a,s]=i,{id:c,styleId:l}=oi(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:a,index:[...ri(o),s||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Ko(((r,o,i)=>{const[a]=i,{id:s,styleId:c}=oi(o.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,removes:[{index:[...ri(o),a]}]}),r.apply(o,i)}))})})),Ko((()=>{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=ii(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Ko(((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:h}=oi(null==(c=a.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:l,value:u,priority:d},index:ri(a.parentRule)}),o.apply(a,s)}))});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Ko(((o,i,s)=>{var c;const[l]=s;if(n.has(l))return a.apply(i,[l]);const{id:u,styleId:d}=oi(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:ri(i.parentRule)}),o.apply(i,s)}))}),Ko((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}))}(e,{win:n}),e.collectFonts&&(f=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=Rr(t.fonts,"add",(function(t){return function(n){return setTimeout(Ko((()=>{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),Ko((()=>{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=Ko((()=>{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;Oo(a,r,o,!0)||Oo(l,r,o,!0)||s.push({start:n.getId(a),startOffset:c,end:n.getId(l),endOffset:u})}i({ranges:s})}));return s(),wo("selectionchange",s)}(e),m=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Rr(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 Ko((()=>{Jo.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),a(),s(),c(),l(),u(),d(),p(),h(),f(),g(),m(),v.forEach((e=>e()))}))}function si(e){return void 0!==window[e]}function ci(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class li{constructor(e){pr(this,"iframeIdToRemoteIdMap",new WeakMap),pr(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 ui{constructor(e){pr(this,"iframes",new WeakMap),pr(this,"crossOriginIframeMap",new WeakMap),pr(this,"crossOriginIframeMirror",new li(to)),pr(this,"crossOriginIframeStyleMirror"),pr(this,"crossOriginIframeRootIdMap",new WeakMap),pr(this,"mirror"),pr(this,"mutationCb"),pr(this,"wrappedEmit"),pr(this,"loadListener"),pr(this,"stylesheetManager"),pr(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new li(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 hr.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:hr.IncrementalSnapshot,data:{source:fr.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case hr.Meta:case hr.Load:case hr.DomContentLoaded:return!1;case hr.Plugin:return t;case hr.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case hr.IncrementalSnapshot:switch(t.data.source){case fr.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 fr.Drag:case fr.TouchMove:case fr.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case fr.ViewportResize:return!1;case fr.MediaInteraction:case fr.MouseInteraction:case fr.Scroll:case fr.CanvasMutation:case fr.Input:return this.replaceIds(t.data,e,["id"]),t;case fr.StyleSheetRule:case fr.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case fr.Font:return t;case fr.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case fr.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===br.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class di{constructor(e){pr(this,"shadowDoms",new WeakSet),pr(this,"mutationCb"),pr(this,"scrollCb"),pr(this,"bypassOptions"),pr(this,"mirror"),pr(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(!jr(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Zo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(ei({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Pr.host(e))),this.restoreHandlers.push(ii({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(Rr(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r),i=Pr.shadowRoot(this);return i&&Bo(this)&&n.addShadowRoot(i,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var pi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),fi=0;fi<64;fi++)hi[pi.charCodeAt(fi)]=fi;const gi=new Map;const mi=(e,t,n)=>{if(!e||!bi(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=gi.get(e);return n||(n=new Map,gi.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 vi(e,t,n){if(e instanceof Array)return e.map((e=>vi(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+=pi[n[t]>>2],o+=pi[(3&n[t])<<4|n[t+1]>>4],o+=pi[(15&n[t+1])<<2|n[t+2]>>6],o+=pi[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:[vi(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:[vi(e.data,t,n),e.width,e.height]}}if(bi(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:mi(e,t,n)}}return e}const yi=(e,t,n)=>e.map((e=>vi(e,t,n))),bi=(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 wi(e,t,n,r){const o=[];try{const i=Rr(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!Oo(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 ki(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=Rr(e,c,(function(e){return function(...a){const s=e.apply(this,a);if(mi(s,i,this),"tagName"in this.canvas&&!Oo(this.canvas,r,o,!0)){const e=yi(a,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}}));a.push(s)}catch{const r=Co(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});a.push(r)}return a}const xi='(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',Si="undefined"!=typeof self&&self.Blob&&new Blob([xi],{type:"text/javascript;charset=utf-8"});function Ci(e){let t;try{if(t=Si&&(self.URL||self.webkitURL).createObjectURL(Si),!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(xi),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Ei{constructor(e){pr(this,"pendingCanvasMutations",new Map),pr(this,"rafStamps",{latestId:0,invokeId:null}),pr(this,"mirror"),pr(this,"mutationCb"),pr(this,"resetObservers"),pr(this,"frozen",!1),pr(this,"locked",!1),pr(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=wi(t,n,r,!0),a=new Map,s=new Ci;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:vr["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=>{Oo(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=wi(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=Rr(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(...i){return Oo(this.canvas,n,r,!0)||setTimeout((()=>{const n=yi(i,t,this);e(this.canvas,{type:vr["2D"],property:a,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch{const n=Co(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:vr["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(...ki(t.WebGLRenderingContext.prototype,vr.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...ki(t.WebGL2RenderingContext.prototype,vr.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 Ii{constructor(e){pr(this,"trackedLinkElements",new WeakSet),pr(this,"mutationCb"),pr(this,"adoptedStyleSheetCb"),pr(this,"styleMirror",new jo),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:Fr(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 Ti{constructor(){pr(this,"nodeMap",new WeakMap),pr(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 Li,Oi,Ai,Mi=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ur=e.contentWindow)?void 0:ur.Array.from)||Array.from,document.body.removeChild(e)}}catch(fy){console.debug("Unable to override Array.from",fy)}const Ri=new Br;function Pi(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:h,maskInputFn:f,maskTextFn:g,hooks:m,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:k=!0,recordCanvas:x=!1,recordCrossOriginIframes:S=!1,recordAfter:C=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:I=!1,inlineImages:T=!1,plugins:L,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:A=new Set([]),errorHandler:M}=e;Xo=M;const R=!S||window.parent===window;let P=!1;if(!R)try{window.parent.document&&(P=!1)}catch(G){P=!0}if(R&&!t)throw new Error("emit function is required");if(!R&&!P)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Ri.reset();const D=!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=vo(h);let j;!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 _=0;const F=e=>{for(const t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!P&&(e=v(e)),e};Li=(e,o)=>{var i;const a=e;if(a.timestamp=Mr(),!(null==(i=Jo[0])?void 0:i.isFrozen())||a.type===hr.FullSnapshot||a.type===hr.IncrementalSnapshot&&a.data.source===fr.Mutation||Jo.forEach((e=>e.unfreeze())),R)null==t||t(F(a),o);else if(P){const e={type:"rrweb",event:F(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(a.type===hr.FullSnapshot)j=a,_=0;else if(a.type===hr.IncrementalSnapshot){if(a.data.source===fr.Mutation&&a.data.isAttachIframe)return;_++;const e=r&&_>=r,t=n&&a.timestamp-j.timestamp>n;(e||t)&&Oi(!0)}};const B=e=>{Li({type:hr.IncrementalSnapshot,data:{source:fr.Mutation,...e}})},U=e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.Scroll,...e}}),H=e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.CanvasMutation,...e}}),z=new Ii({mutationCb:B,adoptedStyleSheetCb:e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.AdoptedStyleSheet,...e}})}),q=new ui({mirror:Ri,mutationCb:B,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:Li});for(const X of L||[])X.getMirror&&X.getMirror({nodeMirror:Ri,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});const W=new Ti;Ai=new Ei({recordCanvas:x,mutationCb:H,win:window,blockClass:o,blockSelector:i,mirror:Ri,sampling:y.canvas,dataURLOptions:b});const V=new di({mutationCb:B,scrollCb:U,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:b,maskTextFn:g,maskInputFn:f,recordCanvas:x,inlineImages:T,sampling:y,slimDOMOptions:N,iframeManager:q,stylesheetManager:z,canvasManager:Ai,keepIframeSrcFn:O,processedNodeManager:W},mirror:Ri});Oi=(e=!1)=>{if(!k)return;Li({type:hr.Meta,data:{href:window.location.href,width:To(),height:Io()}},e),z.reset(),V.init(),Jo.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new Br,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:h=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1)}=t;return yo(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:vo(h),dataURLOptions:f,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}(document,{mirror:Ri,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:D,maskTextFn:g,maskInputFn:f,slimDOM:N,dataURLOptions:b,recordCanvas:x,inlineImages:T,onSerialize:e=>{Po(e,Ri)&&q.addIframe(e),Do(e,Ri)&&z.trackLinkElement(e),No(e)&&V.addShadowRoot(Pr.shadowRoot(e),document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),V.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!t)return console.warn("Failed to snapshot the document");Li({type:hr.FullSnapshot,data:{node:t,initialOffset:Eo(window)}},e),Jo.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Ri.getId(document))};try{const e=[],t=e=>{var t;return Ko(ai)({mutationCb:B,mousemoveCb:(e,t)=>Li({type:hr.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.MouseInteraction,...e}}),scrollCb:U,viewportResizeCb:e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.ViewportResize,...e}}),inputCb:e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.Input,...e}}),mediaInteractionCb:e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.MediaInteraction,...e}}),styleSheetRuleCb:e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.StyleSheetRule,...e}}),styleDeclarationCb:e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.StyleDeclaration,...e}}),canvasMutationCb:H,fontCb:e=>Li({type:hr.IncrementalSnapshot,data:{source:fr.Font,...e}}),selectionCb:e=>{Li({type:hr.IncrementalSnapshot,data:{source:fr.Selection,...e}})},customElementCb:e=>{Li({type:hr.IncrementalSnapshot,data:{source:fr.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:D,inlineStylesheet:u,sampling:y,recordDOM:k,recordCanvas:x,inlineImages:T,userTriggeredOnInput:E,collectFonts:I,doc:e,maskInputFn:f,maskTextFn:g,keepIframeSrcFn:O,blockSelector:i,slimDOMOptions:N,dataURLOptions:b,mirror:Ri,iframeManager:q,stylesheetManager:z,shadowDomManager:V,processedNodeManager:W,canvasManager:Ai,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=>Li({type:hr.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};q.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{Oi(),e.push(t(document)),Mi=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(wo("DOMContentLoaded",(()=>{Li({type:hr.DomContentLoaded,data:{}}),"DOMContentLoaded"===C&&n()}))),e.push(wo("load",(()=>{Li({type:hr.Load,data:{}}),"load"===C&&n()}),window))),()=>{e.forEach((e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")||console.warn(t)}})),W.destroy(),Mi=!1,Xo=void 0}}catch($){console.warn($)}}Pi.addCustomEvent=(e,t)=>{if(!Mi)throw new Error("please add custom event after start recording");Li({type:hr.Custom,data:{tag:e,payload:t}})},Pi.freezePage=()=>{Jo.forEach((e=>e.freeze()))},Pi.takeFullSnapshot=e=>{if(!Mi)throw new Error("please take full snapshot after start recording");Oi(e)},Pi.mirror=Ri;var Di=Uint8Array,Ni=Uint16Array,ji=Uint32Array,_i=new Di([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]),Fi=new Di([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]),Bi=new Di([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ui=function(e,t){for(var n=new Ni(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new ji(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]},Hi=Ui(_i,2),zi=Hi[0],qi=Hi[1];zi[28]=258,qi[258]=28;for(var Wi=Ui(Fi,0),Vi=(Wi[0],Wi[1]),Gi=new Ni(32768),$i=0;$i<32768;++$i){var Xi=(43690&$i)>>>1|(21845&$i)<<1;Xi=(61680&(Xi=(52428&Xi)>>>2|(13107&Xi)<<2))>>>4|(3855&Xi)<<4,Gi[$i]=((65280&Xi)>>>8|(255&Xi)<<8)>>>1}var Ki=function(e,t,n){for(var r=e.length,o=0,i=new Ni(t);o<r;++o)++i[e[o]-1];var a,s=new Ni(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new Ni(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[Gi[d]>>>c]=l}else for(a=new Ni(r),o=0;o<r;++o)a[o]=Gi[s[e[o]-1]++]>>>15-e[o];return a},Ji=new Di(288);for($i=0;$i<144;++$i)Ji[$i]=8;for($i=144;$i<256;++$i)Ji[$i]=9;for($i=256;$i<280;++$i)Ji[$i]=7;for($i=280;$i<288;++$i)Ji[$i]=8;var Yi=new Di(32);for($i=0;$i<32;++$i)Yi[$i]=5;var Zi=Ki(Ji,9,0),Qi=Ki(Yi,5,0),ea=function(e){return(e/8>>0)+(7&e&&1)},ta=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Ni?Ni:e instanceof ji?ji:Di)(n-t);return r.set(e.subarray(t,n)),r},na=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},ra=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},oa=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 Di(0),0];if(1==o){var a=new Di(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 h=new Ni(p+1),f=ia(n[u-1],h,0);if(f>t){r=0;var g=0,m=f-t,v=1<<m;for(i.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));r<o;++r){var y=i[r].s;if(!(h[y]>t))break;g+=v-(1<<f-h[y]),h[y]=t}for(g>>>=m;g>0;){var b=i[r].s;h[b]<t?g-=1<<t-h[b]++-1:++r}for(;r>=0&&g;--r){var w=i[r].s;h[w]==t&&(--h[w],++g)}f=t}return[new Di(h),f]},ia=function(e,t,n){return-1==e.s?Math.max(ia(e.l,t,n+1),ia(e.r,t,n+1)):t[e.s]=n},aa=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ni(++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]},sa=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},ca=function(e,t,n){var r=n.length,o=ea(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)},la=function(e,t,n,r,o,i,a,s,c,l,u){na(t,u++,n),++o[256];for(var d=oa(o,15),p=d[0],h=d[1],f=oa(i,15),g=f[0],m=f[1],v=aa(p),y=v[0],b=v[1],w=aa(g),k=w[0],x=w[1],S=new Ni(19),C=0;C<y.length;++C)S[31&y[C]]++;for(C=0;C<k.length;++C)S[31&k[C]]++;for(var E=oa(S,7),I=E[0],T=E[1],L=19;L>4&&!I[Bi[L-1]];--L);var O,A,M,R,P=l+5<<3,D=sa(o,Ji)+sa(i,Yi)+a,N=sa(o,p)+sa(i,g)+a+14+3*L+sa(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(P<=D&&P<=N)return ca(t,u,e.subarray(c,c+l));if(na(t,u,1+(N<D)),u+=2,N<D){O=Ki(p,h,0),A=p,M=Ki(g,m,0),R=g;var j=Ki(I,T,0);na(t,u,b-257),na(t,u+5,x-1),na(t,u+10,L-4),u+=14;for(C=0;C<L;++C)na(t,u+3*C,I[Bi[C]]);u+=3*L;for(var _=[y,k],F=0;F<2;++F){var B=_[F];for(C=0;C<B.length;++C){var U=31&B[C];na(t,u,j[U]),u+=I[U],U>15&&(na(t,u,B[C]>>>5&127),u+=B[C]>>>12)}}}else O=Zi,A=Ji,M=Qi,R=Yi;for(C=0;C<s;++C)if(r[C]>255){U=r[C]>>>18&31;ra(t,u,O[U+257]),u+=A[U+257],U>7&&(na(t,u,r[C]>>>23&31),u+=_i[U]);var H=31&r[C];ra(t,u,M[H]),u+=R[H],H>3&&(ra(t,u,r[C]>>>5&8191),u+=Fi[H])}else ra(t,u,O[r[C]]),u+=A[r[C]];return ra(t,u,O[256]),u+A[256]},ua=new ji([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),da=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new Di(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=ca(c,l,e.subarray(u,d)):(c[u]=i,l=ca(c,l,e.subarray(u,a)))}else{for(var p=ua[t-1],h=p>>>13,f=8191&p,g=(1<<n)-1,m=new Ni(32768),v=new Ni(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 ji(25e3),x=new Ni(288),S=new Ni(32),C=0,E=0,I=(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 R=a-u;if((C>7e3||I>24576)&&R>423){l=la(e,c,0,k,x,S,E,I,L,u-L,l),I=C=E=0,L=u;for(var P=0;P<286;++P)x[P]=0;for(P=0;P<30;++P)S[P]=0}var D=2,N=0,j=f,_=A-M&32767;if(R>2&&O==w(u-_))for(var F=Math.min(h,R)-1,B=Math.min(32767,u),U=Math.min(258,R);_<=B&&--j&&A!=M;){if(e[u+D]==e[u+D-_]){for(var H=0;H<U&&e[u+H]==e[u+H-_];++H);if(H>D){if(D=H,N=_,H>F)break;var z=Math.min(_,H-2),q=0;for(P=0;P<z;++P){var W=u-_+P+32768&32767,V=W-m[W]+32768&32767;V>q&&(q=V,M=W)}}}_+=(A=M)-(M=m[A])+32768&32767}if(N){k[I++]=268435456|qi[D]<<18|Vi[N];var G=31&qi[D],$=31&Vi[N];E+=_i[G]+Fi[$],++x[257+G],++S[$],T=u+D,++C}else k[I++]=e[u],++x[e[u]]}}l=la(e,c,i,k,x,S,E,I,L,u-L,l)}return ta(s,0,r+ea(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 pa(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=da(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 ha=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}(pa(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Di(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 Di(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 ta(r,0,o)}(JSON.stringify(t))),!0)};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 ga(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 ma(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ga(Object(n),!0).forEach((function(t){va(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function va(e,t,n){return t=function(e){var t=function(e,t){if("object"!=fa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=fa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fa(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ya=["current-password","new-password","one-time-code","cc-number","cc-csc"],ba='[gleap-ignore="value"]',wa=["checkbox","radio","submit","button","reset"],ka=function(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})},xa=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week","textarea","select","password"],Sa=ka(xa),Ca=ka(xa.filter((function(e){return"select"!==e})).concat(["hidden"])),Ea=function(e){return"*".repeat(null==e?0:String(e).length)},Ia=function(e){return e.hasAttribute&&e.hasAttribute("data-rr-is-password")?"password":e.type?String(e.type).toLowerCase():""},Ta=function(e,t){try{return!!t&&e.matches(t)}catch(n){return!1}},La=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},Oa=function(e,t){return t=t||{},Ta(e,".rr-mask, .gl-mask")||La(e,t.maskTextClass)||Ta(e,t.maskTextSelector)},Aa=function(e,t){return t=t||{},Ta(e,".rr-block, .gl-block")||La(e,t.blockClass)||Ta(e,t.blockSelector)},Ma=function(e){return!0===e.maskAllInputs?Sa:void 0!==e.maskInputOptions?e.maskInputOptions||{}:{password:!0}},Ra=function(e,t){if(t=t||{},!e)return Ea;if(wa.indexOf(Ia(e))>=0)return null;if(function(e){if("password"===Ia(e))return!0;var t=e.getAttribute&&e.getAttribute("autocomplete");return!!t&&t.toLowerCase().split(/\s+/).some((function(e){return ya.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 Oa(e,t)||Ta(e,ba)}))}(e,t))return Ea;if(!function(e,t){var n=Ma(t);return!(!n[e.tagName?e.tagName.toLowerCase():""]&&!n[Ia(e)])}(e,t))return null;var n=t.maskInputFn;return"function"!=typeof n?Ea:function(t){try{return n(t,e)}catch(r){return Ea(t)}}},Pa=wa.map((function(e){return':not([type="'+e+'" i])'})).join(""),Da=function(e){return String(e).replace(/[\S]/g,"*")},Na=function(e){var t=e&&e.maskTextFn;return"function"!=typeof t?Da:function(e,n){try{var r=t(e,n);return"string"==typeof r?r:Da(e)}catch(o){return Da(e)}}};function ja(e){return function(e){if(Array.isArray(e))return _a(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 _a(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 _a(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 _a(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 Fa(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 Ba(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fa(Object(n),!0).forEach((function(t){Ha(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ua(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,za(r.key),r)}}function Ha(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"!=qa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=qa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qa(t)?t:String(t)}function qa(e){return qa="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},qa(e)}var Wa=10485760,Va=function e(t){if("string"==typeof t)return t.length+2;if(null===t||"object"!==qa(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},Ga=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ha(this,"startDate",void 0),Ha(this,"segments",[[]]),Ha(this,"segmentSizes",[0]),Ha(this,"incrementalSize",0),Ha(this,"lastForcedCheckout",0),Ha(this,"forcedCheckoutTimeout",void 0),Ha(this,"stopFunction",void 0),Ha(this,"customOptions",{}),Ha(this,"pausedForCapture",!1)}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;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.startDate){if(this.stopFunction){try{this.stopFunction()}catch(n){}this.stopFunction=void 0}if(this.segments[this.segments.length-1].length>0)for(this.segments.push([]),this.segmentSizes.push(0),this.incrementalSize=0;this.segments.length>3;)this.dropOldestSegment()}else this.stop(),this.startDate=Date.now(),this.resetBuffer();var 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=Pi(Ba(Ba(Ba(Ba({},t),this.customOptions),function(e){var t=function(t,n){var r=Ra(n,e);return r?r(t):t};return!0===(e=e||{}).maskAllInputs?{maskInputFn:t}:{maskInputFn:t,maskInputOptions:ma(ma({},Ma(e)),Ca)}}(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=Va(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.pausedForCapture||this.start()}},{key:"stop",value:function(){this.stopFunction&&(this.stopFunction(),this.stopFunction=void 0),this.pausedForCapture=!1,this.startDate=void 0,this.resetBuffer()}},{key:"pauseForCapture",value:function(){if(!this.stopFunction)return!1;try{this.stopFunction()}catch(e){}return this.stopFunction=void 0,clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.pausedForCapture=!0,!0}},{key:"resumeAfterCapture",value:function(){this.pausedForCapture&&(this.pausedForCapture=!1,this.start(!0))}},{key:"resetBuffer",value:function(){clearTimeout(this.forcedCheckoutTimeout),this.forcedCheckoutTimeout=void 0,this.segments=[[]],this.segmentSizes=[0],this.incrementalSize=0}},{key:"dropOldestSegment",value:function(){this.segments.shift(),this.segmentSizes.shift()}},{key:"getBufferSize",value:function(){for(var e=0,t=0;t<this.segmentSizes.length;t++)e+=this.segmentSizes[t];return e}},{key:"enforceBufferSize",value:function(){for(;this.segments.length>1&&this.getBufferSize()>Wa;)this.dropOldestSegment();this.getBufferSize()>Wa&&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{Pi.takeFullSnapshot(!0)}catch(t){}}),t)}}},{key:"getReplaySnapshot",value:function(){var e;return{startDate:this.startDate,events:(e=[]).concat.apply(e,ja(this.segments)),packed:!1,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:Q(),type:"rrweb"}}},{key:"getReplayData",value:function(){var e,t=(e=[]).concat.apply(e,ja(this.segments)),n=t,r=!1;try{n=t.map((function(e){return ha(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&&Ua(t.prototype,n),r&&Ua(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Ha(Ga,"instance",void 0);const $a=475249515,Xa=(e,t,n)=>{const r=e[t];if(!r)return null;let o=1,i=128;for(;!(r&i);)i>>=1,o+=1;if(o>(n?4:8)||t+o>e.length)return null;let a=n?r:r&i-1,s=(r&i-1)==i-1;for(let c=1;c<o;c++)a=256*a+e[t+c],s=s&&255===e[t+c];return{value:a,length:o,unknown:!n&&s}},Ka=(e,t)=>{const n=Xa(e,t,!0),r=n&&Xa(e,t+n.length,!1);return r?{id:n.value,start:t,idLength:n.length,size:r.value,unknown:r.unknown,dataStart:t+n.length+r.length}:null},Ja=(e,t)=>{for(let n=t;n<=8;n++)if(e<Math.pow(2,7*n)-1){const t=new Uint8Array(n);let r=e;for(let e=n-1;e>=0;e--)t[e]=r%256,r=Math.floor(r/256);return t[0]|=128>>n-1,t}return null},Ya=(e,t,n)=>{let r=0;for(let o=0;o<n;o++)r=256*r+e[t+o];return r},Za=(e,t,n,r)=>{let o=r;for(let i=n-1;i>=0;i--)e[t+i]=o%256,o=Math.floor(o/256);return 0===o},Qa=(e,t)=>{const n=[];for(let r=t.dataStart;r<t.dataStart+t.size;){const t=Ka(e,r);if(!t||t.unknown)return null;for(let r=t.dataStart;19899===t.id&&r<t.dataStart+t.size;){const t=Ka(e,r);if(!t||t.unknown||t.size>8)return null;const o=Ya(e,t.dataStart,t.size);if(21419===t.id&&o===$a)return null;21420===t.id&&n.push({pos:t.dataStart,size:t.size,value:o}),r=t.dataStart+t.size}r=t.dataStart+t.size}return n},es=(e,t)=>{try{if(!(e&&t>0&&"function"==typeof e.slice))return Promise.resolve(e);const n=e.slice(0,Math.min(e.size,65536));return"function"!=typeof n.arrayBuffer?Promise.resolve(e):n.arrayBuffer().then((n=>{try{return((e,t,n)=>{const r=Ka(t,0);if(!r||440786851!==r.id||r.unknown)return null;const o=Ka(t,r.dataStart+r.size);if(!o||408125543!==o.id)return null;const i=[];let a=null;for(let v=o.dataStart;v<t.length&&!a;){const e=Ka(t,v);if(!e||e.unknown||524531317===e.id||e.id===$a)return null;290298740===e.id&&i.push(e),357149030===e.id&&(a=e),v=e.dataStart+e.size}const s=a?a.dataStart+a.size:0;if(!a||s>t.length)return null;let c=1e6,l=null;for(let v=a.dataStart;v<s;){const e=Ka(t,v);if(!e||e.unknown||e.dataStart+e.size>s)return null;2807729===e.id&&e.size>0&&e.size<=6&&(c=Ya(t,e.dataStart,e.size)||c),17545===e.id&&(l=e),v=e.dataStart+e.size}const u=1e6*n/c,d=t.slice(),p=e.slice(t.length);if(l){const t=new DataView(d.buffer);if(8===l.size)t.setFloat64(l.dataStart,u);else{if(4!==l.size)return null;t.setFloat32(l.dataStart,u)}return new Blob([d,p],{type:e.type})}const h=new Uint8Array(11);h.set([68,137,136]),new DataView(h.buffer).setFloat64(3,u);const f=Ja(a.size+h.length,a.dataStart-a.start-a.idLength);if(!f)return null;const g=new Uint8Array(a.idLength+f.length);g.set(d.subarray(a.start,a.start+a.idLength)),g.set(f,a.idLength);const m=g.length-(a.dataStart-a.start)+h.length;for(let v=0;v<i.length;v++){const e=Qa(t,i[v]);if(!e||i[v].dataStart+i[v].size>a.start)return null;for(let t=0;t<e.length;t++){const n=e[t];if(o.dataStart+n.value>a.start&&!Za(d,n.pos,n.size,n.value+m))return null}}if(!o.unknown){const e=o.dataStart-o.start-o.idLength,t=Ja(o.size+m,e);if(!t||t.length!==e)return null;d.set(t,o.start+o.idLength)}return new Blob([d.subarray(0,a.start),g,d.subarray(a.dataStart,s),h,d.subarray(s),p],{type:e.type})})(e,new Uint8Array(n),t)||e}catch(r){return e}}),(()=>e))}catch(n){return Promise.resolve(e)}},ts=()=>"undefined"!=typeof performance&&performance.now?performance.now():Date.now(),ns=()=>new Promise((e=>{try{if("function"==typeof MessageChannel){const t=new MessageChannel;return t.port1.onmessage=()=>{t.port1.onmessage=null;try{t.port1.close(),t.port2.close()}catch(n){}e()},void t.port2.postMessage(0)}}catch(t){}setTimeout(e,0)})),rs=e=>{const t=JSON.stringify(e);return void 0===t?null:t},os=(e,t)=>{const n=["{"];let r=!0;const o=Object.keys(e),i=o=>{const i=e[o],a=(r?"":",")+JSON.stringify(o)+":";if(Array.isArray(i)&&i.length>50)return r=!1,n.push(a+"["),((e,t,n)=>new Promise(((r,o)=>{let i=0;const a=()=>{try{if(n&&n())return void o(new Error("cancelled"));const s=ts();for(;i<e.length;)if(t(e[i],i),i+=1,ts()-s>25&&i<e.length)return void ns().then(a);r()}catch(s){o(s)}};a()})))(i,((e,t)=>{let r=null;try{r=rs(e)}catch(o){}n.push((t?",":"")+(r||"null"))}),t).then((()=>{n.push("]")}));if((e=>!!e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).some((t=>Array.isArray(e[t])&&e[t].length>50)))(i))return r=!1,n.push(a),os(i,t).then((e=>{e.forEach((e=>n.push(e)))}));let s=null;try{s=rs(i)}catch(c){s=null}return null!==s&&(r=!1,n.push(a+s)),ns()};return o.reduce(((e,t)=>e.then((()=>i(t)))),Promise.resolve()).then((()=>(n.push("}"),n)))};function is(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const as=["video/mp4;codecs=avc3","video/mp4;codecs=avc1","video/mp4","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"],ss=["video/mp4;codecs=avc3,mp4a.40.2","video/mp4;codecs=avc1,mp4a.40.2","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"],cs=e=>{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}};class ls{constructor(e){is(this,"stream",null),is(this,"micStream",null),is(this,"videoTrack",null),is(this,"recorder",null),is(this,"chunks",[]),is(this,"mimeType",""),is(this,"timer",null),is(this,"startedAt",0),is(this,"endedAt",0),is(this,"settings",{}),is(this,"finished",!1),is(this,"recorderStopped",!1),is(this,"stopTimeout",null),is(this,"onEndedBound",null),is(this,"recorderError",null),this.options=e}start(e,t){if(this.stream=e,this.videoTrack=e.getVideoTracks()[0]||null,!this.videoTrack)return Promise.reject(new Error("no-video-track"));try{this.settings=this.videoTrack.getSettings?this.videoTrack.getSettings():{}}catch(n){this.settings={}}return(t?navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}).catch((()=>null)):Promise.resolve(null)).then((e=>{this.micStream=e;const t=e&&e.getAudioTracks()[0]||null;if(this.finished||!this.videoTrack||"ended"===this.videoTrack.readyState)throw this.cleanup(),new Error("stopped-before-start");const r=[this.videoTrack];t&&r.push(t),this.mimeType=(e=>{const t=e?ss.concat(as):as;try{if("undefined"!=typeof MediaRecorder&&"function"==typeof MediaRecorder.isTypeSupported)for(let e=0;e<t.length;e++)if(MediaRecorder.isTypeSupported(t[e]))return t[e]}catch(n){}return""})(!!t);const o={videoBitsPerSecond:25e5};this.mimeType&&(o.mimeType=this.mimeType),t&&(o.audioBitsPerSecond=64e3);try{this.recorder=new MediaRecorder(new MediaStream(r),o)}catch(a){throw this.cleanup(),a}this.recorder.ondataavailable=e=>{try{e.data&&e.data.size>0&&this.chunks.push(e.data)}catch(n){}},this.recorder.onstop=()=>{try{this.recorderStopped=!0,this.finish()}catch(n){}},this.recorder.onerror=e=>{try{this.onRecorderError(e&&e.error||new Error("recorder-error"))}catch(n){}},this.onEndedBound=()=>{try{this.stop()}catch(n){}},this.videoTrack.addEventListener("ended",this.onEndedBound);try{this.recorder.start(1e3)}catch(a){throw this.cleanup(),a}this.startedAt=Date.now();const i=1e3*this.options.maxDurationSec;return this.timer=setInterval((()=>{try{const e=Date.now()-this.startedAt;try{this.options.onTick(Math.floor(e/1e3))}catch(n){}e>=i&&this.stop()}catch(n){}}),250),{hasMicrophone:!!t}}))}setMicrophoneEnabled(e){try{this.micStream&&this.micStream.getAudioTracks().forEach((t=>{t.enabled=!!e}))}catch(t){}}stop(){if(!this.finished&&!this.stopTimeout)if(this.endedAt=this.endedAt||Date.now(),this.clearTimer(),this.recorder&&!this.recorderStopped){try{"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.releaseTracks(),this.stopTimeout=setTimeout((()=>{try{this.finish()}catch(e){}}),3e3)}else this.finish()}onRecorderError(e){this.finished||(this.recorderError=e,this.stop())}finish(){if(this.finished)return;this.finished=!0,this.endedAt=this.endedAt||Date.now();const e=-1!==(this.recorder&&this.recorder.mimeType||this.mimeType||"video/webm").indexOf("mp4")?"video/mp4":"video/webm",t=new Blob(this.chunks,{type:e});this.chunks=[],this.cleanup();const n={blob:t,type:e,fileName:"screen-recording."+("video/mp4"===e?"mp4":"webm"),startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt),width:this.settings.width,height:this.settings.height,method:"browser"===this.settings.displaySurface?"tab":"display"};if(0===t.size)return void this.options.onError(this.recorderError||new Error("empty-recording"));const r=e=>{n.blob=e;try{this.options.onStop(n)}catch(t){try{this.options.onError(t)}catch(r){}}};"video/webm"===e?es(t,n.durationMs).then(r):r(t)}fail(e){if(!this.finished){this.finished=!0,this.chunks=[],this.cleanup();try{this.options.onError(e)}catch(t){}}}cancel(){this.finished=!0,this.chunks=[];try{this.recorder&&"inactive"!==this.recorder.state&&this.recorder.stop()}catch(e){}this.cleanup()}clearTimer(){this.timer&&(clearInterval(this.timer),this.timer=null),this.stopTimeout&&(clearTimeout(this.stopTimeout),this.stopTimeout=null)}releaseTracks(){if(this.videoTrack&&this.onEndedBound)try{this.videoTrack.removeEventListener("ended",this.onEndedBound)}catch(e){}if(this.onEndedBound=null,cs(this.stream),cs(this.micStream),this.options.onReleased)try{this.options.onReleased()}catch(e){}}cleanup(){this.clearTimer(),this.releaseTracks(),this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null,this.stream=null,this.micStream=null,this.videoTrack=null}}const us=e=>e.filter((e=>{if("string"!=typeof e||!e.trim())return!1;try{return document.createDocumentFragment().querySelector(e),!0}catch(t){return!1}})).join(", ")||null,ds=e=>{if("function"==typeof CompressionStream&&"function"==typeof Response){const t=JSON.stringify(Object.assign({},e,{v:"v1"}));if(t.length>204800)return new Response(new Blob([t]).stream().pipeThrough(new CompressionStream("deflate"))).arrayBuffer().then((e=>(e=>{let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode.apply(null,e.subarray(n,n+32768));return t})(new Uint8Array(e))))}return ha(e)},ps=(e,t)=>new Promise(((n,r)=>{const o=new Array(e.length);let i=0;const a=()=>{try{if(t&&t())return void r(new Error("cancelled"));const s=ts();for(;i<e.length;){const t=ds(e[i]),r=i;if(i+=1,"string"!=typeof t)return void t.then((e=>{o[r]=e,a()}),(()=>n(null)));if(o[r]=t,ts()-s>25&&i<e.length)return void ns().then(a)}n(o)}catch(s){n(null)}};a()}));class hs{constructor(e){is(this,"events",[]),is(this,"cancelled",!1),is(this,"size",0),is(this,"stopFunction",null),is(this,"timer",null),is(this,"startedAt",0),is(this,"endedAt",0),is(this,"finished",!1),is(this,"resumeReplay",!1),is(this,"width",0),is(this,"height",0),this.options=e}start(){const e=this.options.privacyOptions||{};this.resumeReplay=Ga.getInstance().pauseForCapture(),this.startedAt=Date.now(),this.width=window.innerWidth,this.height=window.innerHeight;try{this.stopFunction=Pi({emit:e=>{try{if(this.finished)return;this.events.push(e),this.size+=Va(e),this.size>26214400&&setTimeout((()=>{try{this.stop()}catch(e){}}),0)}catch(t){}},maskAllInputs:!0,blockClass:e.blockClass||"rr-block",blockSelector:us([".rr-block",".gl-block",e.blockSelector].concat(this.options.maskSelectors||[])),maskTextClass:e.maskTextClass||"rr-mask",maskTextSelector:us([".rr-mask",".gl-mask",e.maskTextSelector]),inlineStylesheet:!0,recordCanvas:!1,collectFonts:!1,recordCrossOriginIframes:!1,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0},dataURLOptions:{quality:.7},sampling:{scroll:150,input:"last",mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!0,TouchEnd:!1}}})}catch(n){throw this.cleanup(),n}if(!this.stopFunction)throw this.cleanup(),new Error("page-recording-unavailable");const t=1e3*this.options.maxDurationSec;this.timer=setInterval((()=>{try{const n=Date.now()-this.startedAt;try{this.options.onTick(Math.floor(n/1e3))}catch(e){}n>=t&&this.stop()}catch(e){}}),250)}stop(){if(this.finished)return;this.finished=!0,this.endedAt=Date.now(),this.cleanup();const e=this.events;this.events=[];const t=()=>this.cancelled;ps(e,t).then((n=>os({startDate:this.startedAt,events:n||e,packed:!!n,baseUrl:window.location.origin,width:this.width,height:this.height,isMobile:Q(),type:"rrweb"},t))).then((e=>{this.cancelled||this.options.onStop({blob:new Blob(e,{type:"application/json"}),type:"application/json",fileName:"page-recording.json",startedAt:this.startedAt,endedAt:this.endedAt,durationMs:Math.max(0,this.endedAt-this.startedAt),width:this.width,height:this.height,method:"rrweb"})})).catch((e=>{if(!this.cancelled)try{this.options.onError(e)}catch(t){}}))}cancel(){this.finished=!0,this.cancelled=!0,this.events=[],this.cleanup()}cleanup(){if(this.timer&&(clearInterval(this.timer),this.timer=null),this.stopFunction){try{this.stopFunction()}catch(e){}this.stopFunction=null}if(this.resumeReplay){this.resumeReplay=!1;try{Ga.getInstance().resumeAfterCapture()}catch(e){}}}}const fs=(e,t)=>{const n=String(e||"").replace(/\s+/g," ").trim();return n.length>t?n.slice(0,t-1)+"…":n},gs=(e,t,n)=>{if(!e||1!==e.nodeType)return"element";const r=e.tagName.toLowerCase(),o=e.getAttribute("role")||("a"===r?"link":r),i=((e,t,n)=>{let r=e;for(;r;){if(1===r.nodeType)try{if(Aa(r,t)||Oa(r,t)||n&&r.matches(n))return!0}catch(o){}r=r.parentElement||r.parentNode&&r.parentNode.host||null}return!1})(e,t,us(Array.isArray(n)?n:[]));if("input"===r||"select"===r||"textarea"===r){const t="checkbox"===e.type||"radio"===e.type?e.type:"field";return i?t:t+' "'+(fs((a=e).getAttribute("aria-label")||a.labels&&a.labels[0]&&a.labels[0].textContent||a.getAttribute("placeholder")||a.getAttribute("name")||a.id||a.type||a.tagName.toLowerCase(),60)+'"')}var a;if(i)return o;const s=fs(e.getAttribute("aria-label")||e.getAttribute("title")||e.getAttribute("alt")||e.textContent,60);return s?o+' "'+s+'"':o},ms=e=>{try{const t=new URL(e);return fs(t.pathname+t.search+t.hash,150)}catch(t){return fs(e,150)}};class vs{constructor(e){let{privacyOptions:t,maskSelectors:n,isOwnElement:r}=e;is(this,"entries",[]),is(this,"startedAt",0),is(this,"listeners",[]),is(this,"urlTimer",null),is(this,"lastUrl",""),is(this,"lastInputField",null),is(this,"lastInputAt",0),this.privacyOptions=t||{},this.maskSelectors=Array.isArray(n)?n:[],this.isOwnElement=r||(()=>!1)}add(e,t,n){this.entries.length>=200||this.entries.push({t:Math.max(0,(n||Date.now())-this.startedAt),type:e,label:fs(t,200)})}target(e){try{const t=e.composedPath?e.composedPath():[e.target];for(let e=0;e<t.length;e++){const n=t[e];if(n&&1===n.nodeType&&n.matches&&n.matches('a, button, input, select, textarea, label, summary, [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="checkbox"], [role="option"], [role="switch"]'))return n}}catch(t){}return null}start(e){this.startedAt=e||Date.now(),this.lastUrl=window.location.href;const t=(e,t,n)=>{e.addEventListener(t,n,{capture:!0,passive:!0}),this.listeners.push((()=>e.removeEventListener(t,n,{capture:!0,passive:!0})))};t(document,"click",(e=>{try{if(this.isOwnElement(e.target))return;const t=this.target(e),n=t?gs(t,this.privacyOptions,this.maskSelectors):e.target&&e.target.tagName?e.target.tagName.toLowerCase():"page";this.add("click","Clicked "+n)}catch(t){}}));const n=e=>{try{const t=this.target(e);if(!t||this.isOwnElement(e.target))return;const n=Date.now();if(t===this.lastInputField&&n-this.lastInputAt<5e3)return void(this.lastInputAt=n);this.lastInputField=t,this.lastInputAt=n,this.add("input",("change"===e.type?"Changed ":"Typed in ")+gs(t,this.privacyOptions,this.maskSelectors))}catch(t){}};t(document,"input",n),t(document,"change",n);const r=()=>{try{const e=window.location.href;e!==this.lastUrl&&(this.lastUrl=e,this.add("navigation","Navigated to "+ms(e)))}catch(e){}};t(window,"popstate",r),t(window,"hashchange",r),this.urlTimer=setInterval(r,500)}stop(e){const t=e||Date.now();this.listeners.forEach((e=>{try{e()}catch(t){}})),this.listeners=[],this.urlTimer&&(clearInterval(this.urlTimer),this.urlTimer=null);const n=e=>{const n=new Date(e).getTime();return n>=this.startedAt&&n<=t?n:null};try{Cd.getInstance().getLogs().forEach((e=>{const t=e&&"ERROR"===e.priority?n(e.date):null;null!==t&&this.add("error",String(e.log||"").split("\n")[0],t)}))}catch(r){}try{Mm.getInstance().getRequests().forEach((e=>{if(!e||"RESOURCE"===e.type)return;const t=e.response&&e.response.status,r=!1===e.success||"number"==typeof t&&t>=400?n(e.date):null;null!==r&&this.add("network-error",(e.type||"GET")+" "+ms(e.url)+" → "+(t||"failed"),r)}))}catch(r){}return this.entries.sort(((e,t)=>e.t-t.t))}get interactions(){return this.entries.filter((e=>"click"===e.type||"input"===e.type)).length}}const ys=19922944,bs={consoleLog:!0,networkLogs:!0,customData:!0,metaData:!0,customEventLog:!0,replays:!1},ws=(e,t)=>"/v3/shared/capture-requests/"+encodeURIComponent(String(e))+"/"+t,ks=e=>{try{return e?JSON.parse(e):null}catch(t){return null}},xs=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((o=>{let i=!1;const a=(e,t)=>{i||(i=!0,o({status:e,data:t}))};try{const o=Lf.getInstance(),i=new XMLHttpRequest;i.open(e,o.apiUrl+t),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.gzip&&i.setRequestHeader("Content-Encoding","gzip"),o.injectSession(i),i.timeout=r.timeoutMs||3e4,i.onreadystatechange=()=>{4===i.readyState&&a(i.status,ks(i.responseText))},i.onerror=()=>a(0,null),i.ontimeout=()=>a(0,null),i.send(void 0===n?null:n)}catch(s){a(0,null)}}))},Ss=(e,t,n)=>xs("POST",ws(e,t),JSON.stringify(n||{})),Cs=(e,t,n)=>{const r={type:t};return n&&(r.reason=String(n).slice(0,200)),Ss(e,"event",r)},Es=e=>os(e).then((e=>{const t=new Blob(e,{type:"application/json"});return(e=>{try{if("function"==typeof CompressionStream&&"function"==typeof Response&&"function"==typeof e.stream)return new Response(e.stream().pipeThrough(new CompressionStream("gzip"))).blob().catch((()=>null))}catch(t){}return Promise.resolve(null)})(t).then((e=>e?{body:e,gzip:!0,size:e.size}:{body:t,gzip:!1,size:t.size}))})),Is=e=>(e=>{const t=e.webReplay;return t&&!t.packed&&Array.isArray(t.events)?ps(t.events).then((n=>n?Object.assign({},e,{webReplay:Object.assign({},t,{events:n,packed:!0})}):e)):Promise.resolve(e)})(e).then((e=>Es(e))).then((t=>{if(t.size<=ys)return t;if(!e.webReplay)return null;const n=Object.assign({},e);return delete n.webReplay,Es(n).then((e=>e.size<=ys?e:null))})),Ts=(e,t)=>Is(t).then((t=>{return t?xs("POST",ws(e,"logs"),t.body,{gzip:t.gzip,timeoutMs:(n=t.size,3e4+1e3*Math.ceil((n||0)/65536))}):{status:413,data:null};var n})),Ls=e=>{const t=Object.assign({},bs);return e&&"object"==typeof e&&Object.keys(bs).forEach((n=>{"boolean"==typeof e[n]&&(t[n]=e[n])})),t},Os=(e,t,n)=>Array.isArray(e)?t?e.filter((e=>{const r=(e=>{if(!e)return NaN;const t=e.date;return t instanceof Date?t.getTime():"string"==typeof t||"number"==typeof t?new Date(t).getTime():NaN})(e);return isNaN(r)||r>=t&&r<=n})):e.slice():[],As=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ls(e.include),n=Date.now(),r=e.windowEnd||n,o=e.windowStart?e.windowStart-1e4:0,i={},a=(e,t)=>{try{i[e]=t()}catch(n){}};if(t.consoleLog&&a("consoleLog",(()=>Os(Cd.getInstance().getLogs(),o,r))),t.networkLogs&&a("networkLogs",(()=>Os(Mm.getInstance().getRequests(),o,r))),t.customData&&a("customData",(()=>jd.getInstance().getCustomData())),t.metaData&&a("metaData",(()=>Eg.getInstance().getMetaData())),t.customEventLog&&a("customEventLog",(()=>Os(Pv.getInstance().getEventArray(),o,r))),t.replays&&(()=>{try{const e=Ku.getInstance().getFlowConfig();return!(!e||!e.enableWebReplays)}catch(e){return!1}})())try{const e=Ga.getInstance().getReplaySnapshot();e&&e.startDate&&Array.isArray(e.events)&&e.events.length>0&&(i.webReplay=e)}catch(c){}let s=e.windowStart;if(!s)try{s=Eg.getInstance().sessionStart.getTime()}catch(c){s=n}return i.capturedAt=new Date(n).toISOString(),i.windowStart=new Date(s).toISOString(),i.windowEnd=new Date(r).toISOString(),i.platform=zn,i.sdkType=Hn,i.sdkVersion=Xn(),e.deviceId&&(i.deviceId=e.deviceId),i};"p".charCodeAt(0),"H".charCodeAt(0),"Y".charCodeAt(0),"s".charCodeAt(0);const Ms="[modern-screenshot]",Rs="undefined"!=typeof window,Ps=Rs&&"Worker"in window,Ds=(Rs&&window,Rs&&window,Rs?window.navigator?.userAgent:""),Ns=Ds.includes("Chrome"),js=Ds.includes("AppleWebKit")&&!Ns,_s=Ds.includes("Firefox"),Fs=e=>e&&"__CONTEXT__"in e,Bs=e=>"CSSFontFaceRule"===e.constructor.name,Us=e=>"CSSImportRule"===e.constructor.name,Hs=e=>"CSSLayerBlockRule"===e.constructor.name,zs=e=>1===e.nodeType,qs=e=>"object"==typeof e.className,Ws=e=>"image"===e.tagName,Vs=e=>"use"===e.tagName,Gs=e=>zs(e)&&void 0!==e.style&&!qs(e),$s=e=>8===e.nodeType,Xs=e=>3===e.nodeType,Ks=e=>"IMG"===e.tagName,Js=e=>"VIDEO"===e.tagName,Ys=e=>"CANVAS"===e.tagName,Zs=e=>"TEXTAREA"===e.tagName,Qs=e=>"INPUT"===e.tagName,ec=e=>"STYLE"===e.tagName,tc=e=>"SCRIPT"===e.tagName,nc=e=>"SELECT"===e.tagName,rc=e=>"SLOT"===e.tagName,oc=e=>"IFRAME"===e.tagName,ic=(...e)=>console.warn(Ms,...e);function ac(e){const t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),Boolean(t)&&"toDataURL"in t&&Boolean(t.toDataURL("image/webp").includes("image/webp"))}const sc=e=>e.startsWith("data:");function cc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Rs&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;if(!Rs)return e;const n=lc().implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}function lc(e){return(e&&zs(e)?e?.ownerDocument:e)??window.document}const uc="http://www.w3.org/2000/svg";function dc(e,t,n){const r=lc(n).createElementNS(uc,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function pc(e,t){let n=(new XMLSerializer).serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function hc(e,t){return new Promise(((n,r)=>{const o=new FileReader;o.onload=()=>n(o.result),o.onerror=()=>r(o.error),o.onabort=()=>r(new Error(`Failed read blob to ${t}`)),"dataUrl"===t?o.readAsDataURL(e):"arrayBuffer"===t&&o.readAsArrayBuffer(e)}))}const fc=e=>hc(e,"dataUrl");function gc(e,t){const n=lc(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function mc(e,t){return new Promise((n=>{const{timeout:r,ownerDocument:o,onError:i,onWarn:a}=t??{},s="string"==typeof e?gc(e,lc(o)):e;let c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),Js(s)){const e=s.currentSrc||s.src;if(!e)return s.poster?mc(s.poster,t).then(n):u();if(s.readyState>=2)return u();const r=u,o=t=>{a?.("Failed video load",e,t),i?.(t),u()};l=()=>{s.removeEventListener("loadeddata",r),s.removeEventListener("error",o)},s.addEventListener("loadeddata",r,{once:!0}),s.addEventListener("error",o,{once:!0})}else{const e=Ws(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();const t=async()=>{if(Ks(s)&&"decode"in s)try{await s.decode()}catch(t){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||e,t)}u()},n=t=>{a?.("Failed image load",s.dataset.originalSrc||e,t),u()};if(Ks(s)&&s.complete)return t();l=()=>{s.removeEventListener("load",t),s.removeEventListener("error",n)},s.addEventListener("load",t,{once:!0}),s.addEventListener("error",n,{once:!0})}}))}const vc=function(){let e=0;return()=>(e+=1,`u${`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4)}${e}`)}();function yc(e){return e?.split(",").map((e=>e.trim().replace(/"|'/g,"").toLowerCase())).filter(Boolean)}let bc=0;function wc(e){const t=`${Ms}[#${bc}]`;return bc++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&ic(...t)}}async function kc(e,t){return Fs(e)?e:xc(e,{...t,autoDestruct:!0})}async function xc(e,t){const{scale:n=1,workerUrl:r,workerNumber:o=1}=t||{},i=Boolean(t?.debug),a=t?.features??!0,s=e.ownerDocument??(Rs?window.document:void 0),c=e.ownerDocument?.defaultView??(Rs?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:(d=t?.fetch?.bypassingCache,{cache:d?"no-cache":"force-cache"}),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:o,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:wc(i),node:e,ownerDocument:s,ownerWindow:c,dpi:1===n?null:96*n,svgStyleElement:Sc(s),svgDefsElement:s?.createElementNS(uc,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Ps&&r&&o?o:0})].map((()=>{try{const e=new Worker(r);return e.onmessage=async e=>{const{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{const{url:t}=e.data;l.get(t)?.reject?.(new Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn("Failed to new Worker",e),null}})).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[ac(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:a,isEnable:e=>"restoreScrollPosition"===e?"boolean"!=typeof a&&(a[e]??!1):"boolean"==typeof a?a:a[e]??!0,shadowRoots:[]};var d;u.log.time("wait until load"),await async function(e,t){Gs(e)&&(Ks(e)||Js(e)?await mc(e,t):await Promise.all(["img","video"].flatMap((n=>Array.from(e.querySelectorAll(n)).map((e=>mc(e,t)))))))}(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd("wait until load");const{width:p,height:h}=function(e,t){let{width:n,height:r}=t;if(zs(e)&&(!n||!r)){const t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute("width"))||0,r=r||t.height||Number(e.getAttribute("height"))||0}return{width:n,height:r}}(e,u);return u.width=p,u.height=h,u}function Sc(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode("\n.______background-clip--text {\n background-clip: text;\n -webkit-background-clip: text;\n}\n");return t.appendChild(n),t}async function Cc(e,t){const{log:n,timeout:r,drawImageCount:o,drawImageInterval:i}=t;n.time("image to canvas");const a=await mc(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=function(e,t){const{width:n,height:r,scale:o,backgroundColor:i,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*o),s.height=Math.floor(r*o),s.style.width=`${n}px`,s.style.height=`${r}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));const c=s.getContext("2d");c&&i&&(c.fillStyle=i,c.fillRect(0,0,s.width,s.height));return{canvas:s,context2d:c}}(e.ownerDocument,t),l=()=>{try{c?.drawImage(a,0,0,s.width,s.height)}catch(e){t.log.warn("Failed to drawImage",e)}};if(l(),t.isEnable("fixSvgXmlDecode"))for(let u=0;u<o;u++)await new Promise((e=>{setTimeout((()=>{c?.clearRect(0,0,s.width,s.height),l(),e()}),u+i)}));return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Ec(e,t){if(e.ownerDocument)try{const t=e.toDataURL();if("data:,"!==t)return gc(t,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}const n=e.cloneNode(!1),r=e.getContext("2d"),o=n.getContext("2d");try{return r&&o&&o.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function Ic(e,t){return Ys(e)?Ec(e,t):oc(e)?function(e,t){try{if(e?.contentDocument?.documentElement)return _c(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}(e,t):Ks(e)?function(e){const t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager"),t}(e):Js(e)?async function(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return gc(e.poster,e.ownerDocument);const n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);const r=n.ownerDocument;if(r){let i=!0;if(await mc(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?gc(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise((e=>{n.addEventListener("seeked",e,{once:!0})}));const a=r.createElement("canvas");a.width=e.offsetWidth,a.height=e.offsetHeight;try{const e=a.getContext("2d");e&&e.drawImage(n,0,0,a.width,a.height)}catch(o){return t.log.warn("Failed to clone video",o),e.poster?gc(e.poster,e.ownerDocument):n}return Ec(a,t)}return n}(e,t):e.cloneNode(!1)}const Tc=["width","height","-webkit-text-fill-color"],Lc=["stroke","fill"];function Oc(e,t,n){const{defaultComputedStyles:r}=n,o=e.nodeName.toLowerCase(),i=qs(e)&&"svg"!==o,a=i?Lc.map((t=>[t,e.getAttribute(t)])).filter((([,e])=>null!==e)):[],s=[i&&"svg",o,a.map(((e,t)=>`${e}=${t}`)).join(","),t].filter(Boolean).join(":");if(r.has(s))return r.get(s);const c=function(e){let t=e.sandbox;if(!t){const{ownerDocument:r}=e;try{r&&(t=r.createElement("iframe"),t.id=`__SANDBOX__${vc()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",r.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(n){e.log.warn("Failed to getSandBox",n)}}return t}(n),l=c?.contentWindow;if(!l)return new Map;const u=l?.document;let d,p;i?(d=u.createElementNS(uc,"svg"),p=d.ownerDocument.createElementNS(d.namespaceURI,o),a.forEach((([e,t])=>{p.setAttributeNS(null,e,t)})),d.appendChild(p)):d=p=u.createElement(o),p.textContent=" ",u.body.appendChild(d);const h=l.getComputedStyle(p,t),f=new Map;for(let g=h.length,m=0;m<g;m++){const e=h.item(m);Tc.includes(e)||f.set(e,h.getPropertyValue(e))}return u.body.removeChild(d),r.set(s,f),f}function Ac(e,t,n){const r=new Map,o=[],i=new Map;if(n)for(const s of n)a(s);else for(let s=e.length,c=0;c<s;c++){a(e.item(c))}for(let s=o.length,c=0;c<s;c++)i.get(o[c])?.forEach(((e,t)=>r.set(t,e)));function a(n){const a=e.getPropertyValue(n),s=e.getPropertyPriority(n),c=n.lastIndexOf("-"),l=c>-1?n.substring(0,c):void 0;if(l){let e=i.get(l);e||(e=new Map,i.set(l,e)),e.set(n,[a,s])}(t.get(n)!==a||s)&&(l?o.push(l):r.set(n,[a,s]))}return r}const Mc=["::before","::after"],Rc=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];const Pc=new Set(["symbol"]);async function Dc(e,t,n,r,o){if(zs(n)&&(ec(n)||tc(n)))return;if(r.filter&&!r.filter(n))return;Pc.has(t.nodeName)||Pc.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;const i=await _c(n,r,!1,o);r.isEnable("restoreScrollPosition")&&function(e,t){if(!Gs(e)||!Gs(t))return;const{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;const{transform:o}=t.style,i=new DOMMatrix(o),{a,b:s,c,d:l}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-r,-n),i.a=a,i.b=s,i.c=c,i.d=l,t.style.transform=i.toString()}(e,i),t.appendChild(i)}async function Nc(e,t,n,r){let o=e.firstChild;zs(e)&&e.shadowRoot&&(o=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=o;i;i=i.nextSibling)if(!$s(i))if(zs(i)&&rc(i)&&"function"==typeof i.assignedNodes){const o=i.assignedNodes();for(let i=0;i<o.length;i++)await Dc(e,t,o[i],n,r)}else await Dc(e,t,i,n,r)}const jc=/^[\w-:]+$/;async function _c(e,t,n=!1,r){const{ownerDocument:o,ownerWindow:i,fontFamilies:a,onCloneEachNode:s}=t;if(o&&Xs(e))return r&&/\S/.test(e.data)&&r(e.data),o.createTextNode(e.data);if(o&&i&&zs(e)&&(Gs(e)||qs(e))){const r=await Ic(e,t);if(t.isEnable("removeAbnormalAttributes")){const e=r.getAttributeNames();for(let t=e.length,n=0;n<t;n++){const t=e[n];jc.test(t)||r.removeAttribute(t)}}const o=t.currentNodeStyle=function(e,t,n,r){const{ownerWindow:o,includeStyleProperties:i,currentParentNodeStyle:a}=r,s=t.style,c=o.getComputedStyle(e),l=Oc(e,null,r);a?.forEach(((e,t)=>{l.delete(t)}));const u=Ac(c,l,i);u.delete("transition-property"),u.delete("all"),u.delete("d"),u.delete("content"),n&&(u.delete("position"),u.delete("margin-top"),u.delete("margin-right"),u.delete("margin-bottom"),u.delete("margin-left"),u.delete("margin-block-start"),u.delete("margin-block-end"),u.delete("margin-inline-start"),u.delete("margin-inline-end"),u.set("box-sizing",["border-box",""])),"text"===u.get("background-clip")?.[0]&&t.classList.add("______background-clip--text"),Ns&&(u.has("font-kerning")||u.set("font-kerning",["normal",""]),"hidden"!==u.get("overflow-x")?.[0]&&"hidden"!==u.get("overflow-y")?.[0]||"ellipsis"!==u.get("text-overflow")?.[0]||e.scrollWidth!==e.clientWidth||u.set("text-overflow",["clip",""]));for(let d=s.length,p=0;p<d;p++)s.removeProperty(s.item(p));return u.forEach((([e,t],n)=>{s.setProperty(n,e,t)})),u}(e,r,n,t);n&&function(e,t){const{backgroundColor:n,width:r,height:o,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),r&&a.setProperty("width",`${r}px`,"important"),o&&a.setProperty("height",`${o}px`,"important"),i)for(const s in i)a[s]=i[s]}(r,t);let i=!1;if(t.isEnable("copyScrollbar")){const t=[o.get("overflow-x")?.[0],o.get("overflow-y")?.[0]];i=t.includes("scroll")||(t.includes("auto")||t.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const c=o.get("text-transform")?.[0],l=yc(o.get("font-family")?.[0]),u=l?e=>{"uppercase"===c?e=e.toUpperCase():"lowercase"===c?e=e.toLowerCase():"capitalize"===c&&(e=e[0].toUpperCase()+e.substring(1)),l.forEach((t=>{let n=a.get(t);n||a.set(t,n=new Set),e.split("").forEach((e=>n.add(e)))}))}:void 0;return function(e,t,n,r,o){const{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:c}=r;function l(n){const a=i.getComputedStyle(e,n);let l=a.getPropertyValue("content");if(!l||"none"===l)return;o?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,"");const u=[vc()],d=Oc(e,n,r);c?.forEach(((e,t)=>{d.delete(t)}));const p=Ac(a,d,r.includeStyleProperties);p.delete("content"),p.delete("-webkit-locale"),"text"===p.get("background-clip")?.[0]&&t.classList.add("______background-clip--text");const h=[`content: '${l}';`];if(p.forEach((([e,t],n)=>{h.push(`${n}: ${e}${t?" !important":""};`)})),1===h.length)return;try{t.className=[t.className,...u].join(" ")}catch(fy){return void r.log.warn("Failed to copyPseudoClass",fy)}const f=h.join("\n ");let g=s.get(f);g||(g=[],s.set(f,g)),g.push(`.${u[0]}${n}`)}a&&i&&(Mc.forEach(l),n&&Rc.forEach(l))}(e,r,i,t,u),function(e,t){(Zs(e)||Qs(e)||nc(e))&&t.setAttribute("value",e.value)}(e,r),Js(e)||await Nc(e,r,t,u),await(s?.(r)),r}const c=e.cloneNode(!1);return await Nc(e,c,t),await(s?.(c)),c}function Fc(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(fy){e.log.warn("Failed to destroyContext",fy)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function Bc(e,t){const{url:n,requestType:r="text",responseType:o="text",imageDom:i}=t;let a=n;const{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:p,placeholderImage:h},font:f,workers:g,fontFamilies:m}=e;"image"===r&&(js||_s)&&e.drawImageCount++;let v=l.get(n);if(!v){p&&p instanceof RegExp&&p.test(a)&&(a+=(/\?/.test(a)?"&":"?")+(new Date).getTime());const t=r.startsWith("font")&&f&&f.minify,y=new Set;if(t){r.split(";")[1].split(",").forEach((e=>{m.has(e)&&m.get(e).forEach((e=>y.add(e)))}))}const b=t&&y.size,w={url:a,timeout:s,responseType:b?"arrayBuffer":o,headers:"image"===r?{accept:c}:void 0,...d};v={type:r,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(u&&"image"===r){const e=await u(n);if(e)return e}return!js&&n.startsWith("http")&&g.length?new Promise(((e,t)=>{g[l.size&g.length-1].postMessage({rawUrl:n,...w}),v.resolve=e,v.reject=t})):function(e){const{url:t,timeout:n,responseType:r,...o}=e,i=new AbortController,a=n?setTimeout((()=>i.abort()),n):void 0;return fetch(t,{signal:i.signal,...o}).then((e=>{if(!e.ok)throw new Error("Failed fetch, not 2xx response",{cause:e});switch(r){case"arrayBuffer":return e.arrayBuffer();case"dataUrl":return e.blob().then(fc);default:return e.text()}})).finally((()=>clearTimeout(a)))}(w)})().catch((t=>{if(l.delete(n),"image"===r&&h)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),"string"==typeof h?h:h(i);throw t})),l.set(n,v)}return v.response}async function Uc(e,t,n,r){if(!Hc(e))return e;for(const[i,a]of function(e,t){const n=[];return e.replace(zc,((e,r,o)=>(n.push([o,cc(o,t)]),e))),n.filter((([e])=>!sc(e)))}(e,t))try{const t=await Bc(n,{url:a,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(qc(i),`$1${t}$3`)}catch(o){n.log.warn("Failed to fetch css data url",i,o)}return e}function Hc(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}const zc=/url\((['"]?)([^'"]+?)\1\)/g;function qc(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}const Wc=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function Vc(e,t){const{tasks:n}=t;zs(e)&&((Ks(e)||Ws(e))&&n.push(...function(e,t){if(Ks(e)){const n=e.currentSrc||e.src;if(!sc(n))return[Bc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.srcset="",e.dataset.originalSrc=n,e.src=t||"")}))];(js||_s)&&t.drawImageCount++}else if(qs(e)&&!sc(e.href.baseVal)){const n=e.href.baseVal;return[Bc(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then((t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||"")}))]}return[]}(e,t)),Vs(e)&&n.push(...function(e,t){const{ownerDocument:n,svgDefsElement:r}=t,o=e.getAttribute("href")??e.getAttribute("xlink:href");if(!o)return[];const[i,a]=o.split("#");if(a){const o=`#${a}`,s=t.shadowRoots.reduce(((e,t)=>e??t.querySelector(`svg ${o}`)),n?.querySelector(`svg ${o}`));if(i&&e.setAttribute("href",o),r?.querySelector(o))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(i)return[Bc(t,{url:i,responseType:"text"}).then((e=>{r?.insertAdjacentHTML("beforeend",e)}))]}return[]}(e,t))),Gs(e)&&n.push(...function(e,t){return Wc.map((n=>{const r=e.getPropertyValue(n);return r&&"none"!==r?((js||_s)&&t.drawImageCount++,Uc(r,null,t,!0).then((t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))):null})).filter(Boolean)}(e.style,t)),e.childNodes.forEach((e=>{Vc(e,t)}))}async function Gc(e,t){const{ownerDocument:n,svgStyleElement:r,fontFamilies:o,fontCssTexts:i,tasks:a,font:s}=t;if(n&&r&&o.size)if(s&&s.cssText){const e=Yc(s.cssText,t);r.appendChild(n.createTextNode(`${e}\n`))}else{const e=Array.from(n.styleSheets).filter((e=>{try{return"cssRules"in e&&Boolean(e.cssRules.length)}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}})),s=n.implementation.createHTMLDocument(""),c=s.createElement("style");s.head.appendChild(c);const l=c.sheet;await Promise.all(e.flatMap((e=>Array.from(e.cssRules).map((async e=>{if(Us(e)){const r=e.href;let o="";try{o=await Bc(t,{url:r,requestType:"text",responseType:"text"})}catch(n){t.log.warn(`Error fetch remote css import from ${r}`,n)}const i=o.replace(zc,((e,t,n)=>e.replace(n,cc(n,r))));for(const e of function(e){if(null==e)return[];const t=[];let n=e.replace($c,"");for(;;){const e=Xc.exec(n);if(!e)break;t.push(e[0])}n=n.replace(Xc,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let e=r.exec(n);if(e)o.lastIndex=r.lastIndex;else{if(e=o.exec(n),!e)break;r.lastIndex=o.lastIndex}t.push(e[0])}return t}(i))try{l.insertRule(e,l.cssRules.length)}catch(n){t.log.warn("Error inserting rule from remote css import",{rule:e,error:n})}}}))))),l.cssRules.length&&e.push(l);const u=[];e.forEach((e=>{Zc(e.cssRules,u)})),u.filter((e=>Bs(e)&&Hc(e.style.getPropertyValue("src"))&&yc(e.style.getPropertyValue("font-family"))?.some((e=>o.has(e))))).forEach((e=>{const o=e,s=i.get(o.cssText);s?r.appendChild(n.createTextNode(`${s}\n`)):a.push(Uc(o.cssText,o.parentStyleSheet?o.parentStyleSheet.href:null,t).then((e=>{e=Yc(e,t),i.set(o.cssText,e),r.appendChild(n.createTextNode(`${e}\n`))})))}))}}const $c=/(\/\*[\s\S]*?\*\/)/g,Xc=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;const Kc=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Jc=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Yc(e,t){const{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(Jc,(e=>{for(;;){const[t,,n]=Kc.exec(e)||[];if(!n)return"";if(n===r)return`src: ${t};`}})):e}function Zc(e,t=[]){for(const n of Array.from(e))Hs(n)?t.push(...Zc(n.cssRules)):"cssRules"in n?Zc(n.cssRules,t):t.push(n);return t}const Qc=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;async function el(e,t){const n=await kc(e,t);if(zs(n.node)&&qs(n.node)&&!function(e){return Qc.test(e.innerHTML)}(n.node))return n.node;const{ownerDocument:r,log:o,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:p,onEmbedNode:h,onCreateForeignObjectSvg:f}=n;o.time("clone node");const g=await _c(n.node,n,!0);if(a&&r){let e="";c.forEach(((t,n)=>{e+=`${t.join(",\n")} {\n ${n}\n}\n`})),a.appendChild(r.createTextNode(e))}o.timeEnd("clone node"),await(p?.(g)),!1!==l&&zs(g)&&(o.time("embed web font"),await Gc(0,n),o.timeEnd("embed web font")),o.time("embed node"),Vc(g,n);const m=i.length;let v=0;u?.(v,m),await Promise.all([...Array.from({length:4})].map((async()=>{for(;;){const t=i.pop();if(!t)break;try{await t}catch(e){n.log.warn("Failed to run task",e)}u?.(++v,m)}}))),o.timeEnd("embed node"),await(h?.(g));const y=function(e,t){const{width:n,height:r}=t,o=dc(n,r,e.ownerDocument),i=o.ownerDocument.createElementNS(o.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),o.appendChild(i),o}(g,n);return s&&y.insertBefore(s,y.children[0]),a&&y.insertBefore(a,y.children[0]),d&&Fc(n),await(f?.(y)),y}async function tl(e,t){const n=await kc(e,t),r=await el(n),o=pc(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=Sc(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(uc,"defs"),n.svgStyles.clear());const i=gc(o,r.ownerDocument);return await Cc(i,n)}const nl=2560,rl="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ol=[".gleap-frame-container",".bb-feedback-button",".gleap-notification-container",".gleap-chatbar",".gleap-capture-root",".gleap-image-view",".bb-capture-editor",".gleap-b",".gleap-modal-wrapper",".gleap-tooltip",".gleap-tour-popover",".gleap-tour-overlay","#copilot-pointer-container","#copilot-joined-container",".gleap-audio-unmute-modal-overlay",".gleap-admin-frame-container",".gleap-admin-collapse-ui",".click-wave"].join(", "),il=["stripe.com","stripe.network","braintreegateway.com","braintree-api.com","paypal.com","adyen.com","adyenpayments.com","checkout.com","squareup.com","squareupsandbox.com","recurly.com","chargebee.com","paddle.com","mollie.com","klarna.com","worldpay.com","authorize.net","razorpay.com","2checkout.com","cybersource.com","spreedly.com","gocardless.com","payu.com","mercadopago.com","paystack.co","flutterwave.com"],al=new RegExp("(^|\\.)("+il.map((e=>e.replace(/\./g,"\\."))).join("|")+")$","i"),sl=["card","payment","cvc","cvv","security code","expir","iban"],cl=new RegExp(sl.join("|"),"i"),ll=()=>{const e=['iframe[allow*="payment" i]'];return sl.forEach((t=>{e.push('iframe[title*="'+t+'" i]','iframe[name*="'+t+'" i]')})),il.forEach((t=>{e.push('iframe[src*="//'+t+'" i]','iframe[src*=".'+t+'" i]')})),e.join(", ")},ul=e=>new Promise((t=>setTimeout(t,e))),dl=(e,t,n)=>new Promise(((r,o)=>{const i=setTimeout((()=>o(new Error(n||"timeout"))),t);e.then((e=>{clearTimeout(i),r(e)}),(e=>{clearTimeout(i),o(e)}))})),pl=e=>{try{if("undefined"!=typeof CSS&&"function"==typeof CSS.escape)return CSS.escape(e)}catch(t){}return String(e).replace(/[^a-zA-Z0-9_-]/g,(e=>"\\"+e))},hl=e=>{if("string"!=typeof e||0===e.trim().length)return null;try{return document.createDocumentFragment().querySelector(e),e.trim()}catch(t){return null}},fl=(e,t)=>{const n=e||{},r=[".rr-block, .gl-block, .rr-mask, .gl-mask"];return[n.blockSelector,n.maskTextSelector].concat(Array.isArray(t)?t:[]).forEach((e=>{const t=hl(e);t&&r.push(t)})),[n.blockClass,n.maskTextClass].forEach((e=>{if("string"==typeof e&&e.length>0){const t=hl("."+pl(e));t&&r.push(t)}})),r},gl=e=>{const t=e||{};return[t.blockClass,t.maskTextClass].filter((e=>e&&"function"==typeof e.test))},ml=(e,t)=>{if(!t.length||!e.classList)return!1;for(let n=0;n<e.classList.length;n++)for(let r=0;r<t.length;r++)if(t[r].test(e.classList[n]))return!0;return!1},vl=e=>{try{return!!(e&&e.matches&&e.matches(ol))}catch(t){return!1}},yl=e=>{try{return!!(e&&e.closest&&e.closest(ol))}catch(t){return!1}},bl=e=>{try{if(-1!==(e.getAttribute("allow")||"").toLowerCase().indexOf("payment"))return!0;const t=(e.getAttribute("title")||"")+" "+(e.getAttribute("name")||"");if(cl.test(t))return!0;const n=e.getAttribute("src");if(n)return al.test(new URL(n,window.location.href).hostname)}catch(t){}return!1},wl=e=>{let t=null;try{t=e.getBoundingClientRect()}catch(n){}try{const n=(e.ownerDocument||document).createRange();n.selectNodeContents(e),t=((e,t)=>{if(!e||e.width<=0||e.height<=0)return t;if(!t||t.width<=0||t.height<=0)return e;const n=Math.min(e.left,t.left),r=Math.min(e.top,t.top);return{left:n,top:r,width:Math.max(e.left+e.width,t.left+t.width)-n,height:Math.max(e.top+e.height,t.top+t.height)-r}})(t,n.getBoundingClientRect())}catch(n){}return t},kl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[],n={},r=e.privacyOptions||{},o=((e,t)=>fl(e,t).join(", "))(r,e.maskSelectors),i=gl(r),a=(e,r)=>{if(!(e&&e.width>0&&e.height>0))return;let o=e.left+r.x,i=e.top+r.y,a=o+e.width,s=i+e.height;r.clip&&(o=Math.max(o,r.clip.left),i=Math.max(i,r.clip.top),a=Math.min(a,r.clip.right),s=Math.min(s,r.clip.bottom));const c=[o,i,a,s].join(",");a>o&&s>i&&!n[c]&&(n[c]=!0,t.push({x:o,y:i,width:a-o,height:s-i}))},s=(e,t,n)=>{if(!e||n>8)return;const c=(t,n)=>{let r=[];try{r=e.querySelectorAll(t)}catch(o){}for(let e=0;e<r.length;e++)yl(r[e])||n(r[e])};c(o,(e=>a(wl(e),t))),c("input, textarea, select",(e=>{((e,t)=>{try{return!!Ra(e,t)}catch(n){return!0}})(e,r)&&a(e.getBoundingClientRect(),t)})),c("iframe, frame",(e=>{const r=e.getBoundingClientRect();if(bl(e))return void a(r,t);let o=null;try{o=e.contentDocument}catch(i){}if(o&&o.documentElement&&r.width>0&&r.height>0){const i=t.x+r.left+(e.clientLeft||0),a=t.y+r.top+(e.clientTop||0);let c={left:t.x+r.left,top:t.y+r.top,right:t.x+r.right,bottom:t.y+r.bottom};t.clip&&(c={left:Math.max(c.left,t.clip.left),top:Math.max(c.top,t.clip.top),right:Math.min(c.right,t.clip.right),bottom:Math.min(c.bottom,t.clip.bottom)}),s(o,{x:i,y:a,clip:c},n+1)}}));try{const r=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>vl(e)?2:1});let o=r.nextNode();for(;o;)o.shadowRoot&&s(o.shadowRoot,t,n+1),i.length&&ml(o,i)&&a(wl(o),t),o=r.nextNode()}catch(l){}};return s(document,{x:0,y:0,clip:null},0),t},xl=(e,t)=>{const n=document.createElement("canvas");return n.width=Math.max(1,Math.round(e)),n.height=Math.max(1,Math.round(t)),n},Sl=e=>{try{e&&(e.width=0,e.height=0)}catch(t){}},Cl=e=>{try{const t=48,n=xl(t,t),r=n.getContext("2d");r.drawImage(e,0,0,t,t);const o=r.getImageData(0,0,t,t).data;Sl(n);let i=!0,a=!0;for(let e=0;e<o.length;e+=4)o[e+3]>0&&(i=!1,(o[e]>12||o[e+1]>12||o[e+2]>12)&&(a=!1));return i?"transparent":a?"black":"content"}catch(t){return"content"}},El=e=>{let{canvas:t,scaleX:n,scaleY:r,rects:o,background:i}=e;const a=Math.max(t.width,t.height),s=a>nl?nl/a:1,c=xl(t.width*s,t.height*s),l=c.getContext("2d");l.fillStyle=i||"#ffffff",l.fillRect(0,0,c.width,c.height),l.imageSmoothingEnabled=!0;try{l.imageSmoothingQuality="high"}catch(d){}l.drawImage(t,0,0,c.width,c.height),((e,t,n,r)=>{e.save(),e.fillStyle="#000000";for(let o=0;o<t.length;o++){const i=t[o],a=Math.floor(i.x*n)-1,s=Math.floor(i.y*r)-1,c=Math.ceil(i.width*n)+2,l=Math.ceil(i.height*r)+2;e.fillRect(a,s,c,l)}e.restore()})(l,o,n*s,r*s);const u={dataUrl:c.toDataURL("image/jpeg",.85),width:c.width,height:c.height};return Sl(c),u},Il=e=>{try{e&&e.getTracks().forEach((e=>{try{e.stop()}catch(t){}}))}catch(t){}},Tl=(e,t)=>("function"!=typeof ImageCapture?Promise.resolve(null):dl(new ImageCapture(e).grabFrame(),3e3,"grab-timeout").then((e=>e&&e.width>0?{source:e,width:e.width,height:e.height,release:()=>e.close&&e.close()}:null),(()=>null))).then((t=>t||(()=>{if("function"!=typeof MediaStreamTrackProcessor)return Promise.resolve(null);let t=null;const n=()=>{try{t&&t.cancel()}catch(e){}};try{t=new MediaStreamTrackProcessor({track:e}).readable.getReader()}catch(r){return Promise.resolve(null)}return dl(t.read(),3e3,"read-timeout").then((e=>{n();const t=e&&e.value;return t?{source:t,width:t.displayWidth||t.codedWidth,height:t.displayHeight||t.codedHeight,release:()=>t.close()}:null}),(()=>(n(),null)))})())).then((e=>e||(()=>{const e=document.createElement("video");e.muted=!0,e.playsInline=!0,e.srcObject=t;const n=()=>{try{e.pause(),e.srcObject=null}catch(t){}},r=new Promise((t=>{"function"==typeof e.requestVideoFrameCallback?e.requestVideoFrameCallback((()=>t())):e.addEventListener("loadeddata",(()=>setTimeout(t,60)),{once:!0})}));return dl(Promise.resolve(e.play()),3e3,"play-timeout").then((()=>dl(r,3e3,"frame-timeout"))).then((()=>({source:e,width:e.videoWidth,height:e.videoHeight,release:n})),(e=>{throw n(),e}))})())),Ll=(e,t)=>{let{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=t;const a=e&&e.getVideoTracks?e.getVideoTracks()[0]:null;let s=!1;const c=()=>{s=!0,Il(e),n(!1)};if(!a)return c(),Promise.reject(new Error("no-video-track"));let l={};try{l=a.getSettings?a.getSettings():{}}catch(d){}if(l.displaySurface&&"browser"!==l.displaySurface)return c(),Promise.reject(new Error("not-this-tab"));const u=t=>{if(s)throw new Error("tab-timeout");if(t>=3)throw new Error("no-usable-frame");if("ended"===a.readyState)throw new Error("track-ended");const n=kl({privacyOptions:r,maskSelectors:o});return Tl(a,e).then((e=>{const i=window.innerWidth,a=window.innerHeight,c=(e=>{const t=window.visualViewport,n=t&&t.scale?t.scale:1;return t&&(1!==n||t.offsetLeft||t.offsetTop)?e.map((e=>({x:(e.x-t.offsetLeft)*n,y:(e.y-t.offsetTop)*n,width:e.width*n,height:e.height*n}))):e})(n.concat(kl({privacyOptions:r,maskSelectors:o})));let l=null;try{if(!s&&e&&e.width>0&&e.height>0){const n=i/a;Math.abs(e.width/e.height-n)/n<=.04&&(l=xl(e.width,e.height),l.getContext("2d").drawImage(e.source,0,0,e.width,e.height),t<2&&"content"!==Cl(l)&&(Sl(l),l=null))}}finally{try{e&&e.release()}catch(d){}}if(s)throw Sl(l),new Error("tab-timeout");return l?{canvas:l,scaleX:l.width/i,scaleY:l.height/a,rects:c,background:"#000000",method:"tab"}:ul(150).then((()=>u(t+1)))}))};return n(!0),new Promise(((e,t)=>{let n=null;const r=(r,o)=>{s?o&&Sl(o.canvas):(clearInterval(n),c(),r?t(r):e(o))};n=setInterval((()=>{try{i&&!i()&&r(new Error("aborted"))}catch(d){}}),200),dl(new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(d){n()}})).then((()=>ul(120))).then((()=>u(0))),15e3,"tab-timeout").then((e=>r(null,e)),(e=>r(e)))}))},Ol=200,Al=["background-image","border-image-source","mask-image","-webkit-mask-image","list-style-image"],Ml=(e,t)=>(e.width>0||e.height>0)&&e.bottom>t.top&&e.top<t.bottom&&e.right>t.left&&e.left<t.right,Rl=e=>{const t=[],n=e=>{for(let n=0;n<e.length;n++)t.push(e[n])};try{e.shadowRoot&&n(e.shadowRoot.children),n(e.children)}catch(r){}return t},Pl=e=>new Promise(((t,n)=>{const r=new Set,o={top:-200,left:-200,bottom:window.innerHeight+Ol,right:window.innerWidth+Ol},i=document.documentElement,a=[{element:i,children:Rl(i),index:0,visible:!0,sized:!1}],s=()=>{try{if(e())return void n(new Error("aborted"));const c=ts();for(;a.length;){const e=a[a.length-1];if(e.index<e.children.length){const t=e.children[e.index];e.index+=1;let n=null;try{n=t.getBoundingClientRect()}catch(i){}a.push({element:t,children:Rl(t),index:0,visible:!!n&&Ml(n,o),sized:!!n&&n.width>0&&n.height>0})}else a.pop(),a.length&&(e.visible?a[a.length-1].visible=!0:e.sized&&r.add(e.element));if(a.length&&ts()-c>25)return void ns().then(s)}t(r)}catch(c){n(c)}};s()})),Dl={block:!0,"flow-root":!0,"list-item":!0,flex:!0,grid:!0,table:!0},Nl={flex:!0,"inline-flex":!0,grid:!0,"inline-grid":!0},jl=(e,t)=>{let{offscreen:n,masked:r}=t,o=null;if(!n&&!r){try{const t=e.videoWidth,n=e.videoHeight;if(e.readyState>=2&&t>0&&n>0){const r=Math.min(1,1280/Math.max(t,n)),i=xl(t*r,n*r);try{i.getContext("2d").drawImage(e,0,0,i.width,i.height),o=i.toDataURL("image/jpeg",.85)}finally{Sl(i)}}}catch(a){o=null}if(!o)try{o=e.poster||null}catch(a){}}const i=document.createElement(o?"img":"div");try{const t=window.getComputedStyle(e);for(let e=0;e<t.length;e++){const n=t[e];"visibility"!==n&&i.style.setProperty(n,t.getPropertyValue(n))}}catch(a){}return o?(i.setAttribute("src",o),i.setAttribute("alt","")):i.style.setProperty("background-color","#1f2430"),r&&i.style.setProperty("visibility","hidden","important"),i},_l=(e,t,n,r,o)=>{const i=[e],a=(Array.isArray(n)?n:[]).map(hl).filter(Boolean).join(", "),s=document.scrollingElement||document.documentElement,c={broken:!1,offsetX:0,offsetY:0,lastYield:ts(),canYield:!1,elements:0,offscreen:null},l=new Map,u=new Map,d=new Set,p=e=>{try{return Aa(e,t)||Oa(e,t)||!!a&&e.matches(a)}catch(n){return!1}},h=e=>l.set(e,(l.get(e)||0)+1),f=e=>e.style&&e.style.setProperty("visibility","hidden","important"),g=(e,t)=>{if(e===document.documentElement||e===s)return;const n=e.scrollTop||0,r=e.scrollLeft||0;if(!n&&!r)return;let o=null;try{o=e.getBoundingClientRect()}catch(a){}if(o&&(e=>Math.abs(e.left)<=2&&Math.abs(e.top)<=2&&Math.abs(e.right-window.innerWidth)<=20&&Math.abs(e.bottom-window.innerHeight)<=20)(o))return c.offsetX+=r,c.offsetY+=n,void t.style.setProperty("overflow","visible","important");const i=t.children||[];for(let s=0;s<i.length;s++){const e=i[s];e.style&&"fixed"!==e.style.position&&(e.style.transform="translate("+-r+"px, "+-n+"px) "+(e.style.transform||""))}};return{filter:e=>{o();const t=i[i.length-1];if(d.has(t))return!1;if(!e||1!==e.nodeType)return h(t),!0;const n=String(e.tagName).toUpperCase();if("NOSCRIPT"===n||"TEMPLATE"===n)return!1;if(vl(e)||"string"==typeof e.id&&0===e.id.indexOf("__SANDBOX__"))return!1;if("VIDEO"===n){const n=u.get(t)||[];return n.push({index:l.get(t)||0,placeholder:jl(e,{offscreen:!!c.offscreen&&c.offscreen.has(e),masked:p(e)})}),u.set(t,n),!1}if(c.elements+=1,c.elements>1e4)throw new Error("render-budget");return h(t),i.push(e),"IFRAME"!==n&&"FRAME"!==n||!(e=>{try{return!(!e.contentDocument||!e.contentDocument.documentElement)}catch(t){return!1}})(e)||i.push(e),c.offscreen&&c.offscreen.has(e)&&(e=>{try{if(e.ownerDocument!==document||e===document.body)return!1;const t=window.getComputedStyle(e);if(!Dl[t.display])return!1;if("block"!==t.display&&"list-item"!==t.display)return!0;const n=e=>"hidden"===e||"scroll"===e||"auto"===e;if(n(t.overflowX)||n(t.overflowY)||"none"!==t.float||"absolute"===t.position||"fixed"===t.position)return!0;const r=e.parentElement;if(r&&Nl[window.getComputedStyle(r).display])return!0;const o=e=>parseFloat(t["padding"+e])>0||parseFloat(t["border"+e+"Width"])>0;return o("Top")&&o("Bottom")}catch(t){return!1}})(e)&&d.add(e),!0},onCloneEachNode:e=>{if(o(),!e||1!==e.nodeType)return;const n=i.pop();if(n&&((e,t)=>{const n=String(e.nodeName).toUpperCase(),r=String(t.nodeName).toUpperCase();return n===r||("IFRAME"===n||"FRAME"===n?"HTML"===r:!("VIDEO"!==n&&"CANVAS"!==n||"IMG"!==r&&"CANVAS"!==r&&"VIDEO"!==r))})(n,e)||(c.broken=!0),!c.broken)try{((e,t)=>{const n=u.get(e);n&&(u.delete(e),n.forEach(((e,n)=>{t.insertBefore(e.placeholder,t.childNodes[e.index+n]||null)})))})(n,e),((e,n)=>{const r=String(e.tagName).toUpperCase();if("INPUT"===r||"TEXTAREA"===r||"SELECT"===r){let o=null;try{o=Ra(e,t)}catch(a){o=()=>""}if(o){const t=o(e.value);if(n.setAttribute("value","string"==typeof t?t:""),"TEXTAREA"===r&&(n.textContent="string"==typeof t?t:""),"SELECT"===r){const e=n.querySelectorAll("option[selected]");for(let t=0;t<e.length;t++)e[t].removeAttribute("selected")}f(n)}return}const o="IFRAME"===r||"FRAME"===r;let i=!1;try{i=p(e)||o&&bl(e)||e.matches("gleap-checklist, .gleap-tooltip-anchor")}catch(a){}if(i&&f(n),o&&"HTML"===String(n.nodeName).toUpperCase())try{const t=window.getComputedStyle(e).display;n.style.setProperty("display","inline"===t?"inline-block":t,"important"),n.style.setProperty("overflow","hidden","important")}catch(a){}})(n,e),g(n,e),c.offscreen&&c.offscreen.has(n)&&(e=>{e.style&&Al.forEach((t=>e.style.setProperty(t,"none","important"))),"IMG"===String(e.nodeName).toUpperCase()&&(e.removeAttribute("srcset"),e.setAttribute("src",rl))})(e)}catch(r){}return l.delete(n),c.canYield&&ts()-c.lastYield>40?(c.lastYield=ts(),ns()):void 0},onCloneNode:e=>{!c.broken&&(c.offsetX||c.offsetY)&&e&&e.style&&(e.style.top=-(r.y+c.offsetY)+"px",e.style.left=-(r.x+c.offsetX)+"px")},state:c}},Fl={contentWindow:null,remove:()=>{}},Bl=()=>{try{const e=window.innerHeight,t=document.images;for(let n=0;n<t.length;n++){const r=t[n];if(r.complete)continue;const o=r.getBoundingClientRect();if(o.width>0&&o.height>0&&o.bottom>0&&o.top<e)return!0}}catch(e){}return!1},Ul=()=>{try{const e=-200,t=window.innerHeight+Ol,n=new Set,r=new Set,o=document.images;for(let a=0;a<o.length;a++){const i=o[a].currentSrc||o[a].src;if(!i)continue;const s=o[a].getBoundingClientRect();s.top>t||s.bottom<e?n.add(i):r.add(i)}const i=document.querySelectorAll("video[poster]");for(let a=0;a<i.length;a++){const n=i[a].getBoundingClientRect();n.top>t||n.bottom<e||r.add(i[a].poster)}return r.forEach((e=>n.delete(e))),0===n.size?null:e=>Promise.resolve(!!n.has(e)&&rl)}catch(e){return null}};let Hl=0,zl=!1;const ql=e=>{let{privacyOptions:t,maskSelectors:n,isActive:r}=e;return new Promise(((e,o)=>{const i=document.documentElement,a=Math.max(1,i.clientWidth||window.innerWidth),s=Math.max(1,i.clientHeight||window.innerHeight),c=Math.min(Math.max(window.devicePixelRatio||1,1),nl/Math.max(a,s)),l={x:window.scrollX||0,y:window.scrollY||0},u=kl({privacyOptions:t,maskSelectors:n}),d=(()=>{const e=e=>e&&"transparent"!==e&&!/rgba\(\s*0,\s*0,\s*0,\s*0\s*\)/.test(e);try{const t=window.getComputedStyle(document.documentElement).backgroundColor;if(e(t))return t;const n=document.body?window.getComputedStyle(document.body).backgroundColor:null;if(e(n))return n}catch(t){}return"#ffffff"})();let p=null;const h=()=>(p||!r||r()||(p="aborted"),!!p),f=()=>{if(h())throw new Error(p)},g=_l(i,t,n,l,f),m=(()=>{let e=null;try{e=Mm.getInstance(),0===Hl&&(zl=!!e.stopped,e.setStopped(!0)),Hl+=1}catch(n){return()=>{}}let t=!1;return()=>{if(!t&&(t=!0,Hl=Math.max(0,Hl-1),0===Hl))try{e.setStopped(zl)}catch(n){}}})();let v=null,y=null,b=!1,w=null,k=null;const x=(t,n)=>{b?n&&Sl(n.canvas):(b=!0,(()=>{if(clearTimeout(w),clearInterval(k),v){try{Fc(v)}catch(e){}v=null}if(y){try{y.remove()}catch(e){}y=null}m()})(),t?o(t):e(n))};w=setTimeout((()=>{try{p=p||"render-timeout",x(new Error("render-timeout"))}catch(e){}}),1e4),k=setInterval((()=>{try{h()&&x(new Error(p))}catch(e){}}),200),Promise.all([Pl(h),new Promise((e=>{const t=document.createElement("iframe");t.id="__SANDBOX__gleap",t.width="0",t.height="0",t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.style.visibility="hidden",t.style.position="fixed";let n=!1;try{t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',n=!0}catch(c){}const r=()=>{try{const e=t.contentDocument;return!(!e||!e.body||"complete"!==e.readyState||n&&"about:srcdoc"!==t.contentWindow.location.href)}catch(c){return!1}};let o=!1,i=null;const a=n=>{if(!o){if(o=!0,clearTimeout(i),t.removeEventListener("load",s),!n)try{t.remove()}catch(c){}e(n?t:null)}},s=()=>{r()&&a(!0)};t.addEventListener("load",s),i=setTimeout((()=>a(r())),1500);try{(document.body||document.documentElement).appendChild(t)}catch(c){return void a(!1)}n||a(r())}))]).then((e=>{let[t,n]=e;return b?(n&&n.remove(),null):(y=n,f(),g.state.offscreen=t,xc(i,{width:a,height:s,scale:c,backgroundColor:null,filter:g.filter,onCloneEachNode:g.onCloneEachNode,onCloneNode:g.onCloneNode,onCreateForeignObjectSvg:()=>{v&&(v.drawImageCount=Math.min(v.drawImageCount||0,2))},style:{position:"relative",top:-l.y+"px",left:-l.x+"px",overflow:"visible"},features:{restoreScrollPosition:!1},fetchFn:Ul(),timeout:Bl()?3e3:50}))})).then((e=>{if(!e)return null;if(b){try{Fc(e)}catch(t){}return null}return v=e,v.timeout=8e3,v.sandbox=y||Fl,y=null,g.state.canYield=!0,f(),tl(v)})).then((e=>{if(e){if(!b)return"transparent"===Cl(e)?(Sl(e),void x(new Error("render-empty"))):void x(null,{canvas:e,scaleX:e.width/a,scaleY:e.height/s,rects:u,background:d,method:"dom"});Sl(e)}})).catch((e=>x(e)))}))};function Wl(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Vl={barScreenshotHint:"Go to the screen you want to show, then tap Capture.",barCapture:"Capture",barCancel:"Cancel",barRecordHint:"Go to where the issue happens, then start recording.",barStart:"Start",barStop:"Stop",barRecording:"Recording",barDragHint:"Drag to move",microphone:"Microphone",previewTitle:"Send this recording?",previewSend:"Send",previewRetake:"Retake",uploading:"Uploading…",recordingInterrupted:"Recording stopped because the page changed.",recordAgain:"Record again",permissionDenied:"Screen capture was blocked. You can upload a file instead.",notSupported:"Screen capture isn't available here. You can upload a file instead.",failed:"That didn't work. Please try again or upload a file.",recordPage:"Record this page",recordPageHint:"Screen sharing didn't start. You can record this page instead."},Gl=e=>{const t=Object.assign({},Vl);return e&&"object"==typeof e&&Object.keys(Vl).forEach((n=>{const r=e[n];"string"==typeof r&&r.trim().length>0&&(t[n]=r.slice(0,300))})),t},$l=e=>{const t=Math.max(0,Math.floor(e||0)),n=t%60;return Math.floor(t/60)+":"+(n<10?"0":"")+n},Xl=':host{all:initial}.bar,.overlay{font:14px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:#fff;letter-spacing:normal;text-align:start;-webkit-font-smoothing:antialiased;box-sizing:border-box;pointer-events:auto;animation:in .18s ease-out both}.bar *,.overlay *{box-sizing:border-box}.bar{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);display:flex;align-items:center;gap:8px;width:max-content;max-width:min(680px,calc(100vw - 32px));padding:8px;border-radius:28px;background:rgba(22,22,26,.97);box-shadow:0 12px 40px rgba(0,0,0,.3),0 0 0 1px rgba(255,255,255,.1)}.moved{transform:none}.grip{flex:none;align-self:stretch;width:18px;display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.45);cursor:grab;touch-action:none}.hint{flex:1 1 auto;min-width:0;padding:0 6px}.rec{display:flex;align-items:center;gap:8px;white-space:nowrap}.dot{flex:none;width:10px;height:10px;border-radius:50%;background:#ff4d4f;animation:pulse 1.4s ease-in-out infinite}.timer{font-variant-numeric:tabular-nums;color:rgba(255,255,255,.85)}.actions{flex:none;display:flex;align-items:center;gap:8px}button{-webkit-appearance:none;appearance:none;margin:0;border:0;border-radius:999px;min-height:36px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font:inherit;font-weight:600;white-space:nowrap;cursor:pointer;color:#fff;background:rgba(255,255,255,.12)}button:hover{background:rgba(255,255,255,.2)}button:focus-visible{outline:2px solid #fff;outline-offset:2px}button[disabled]{opacity:.55;cursor:default}button[aria-disabled=true]{cursor:default}.primary,.primary:hover{background:var(--primary);color:var(--on-primary)}.stop,.stop:hover{background:#e5484d;color:#fff}.icon{width:36px;padding:0;border-radius:50%}.icon[aria-pressed=false]{color:rgba(255,255,255,.55)}.spin{flex:none;width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite}svg{flex:none;width:18px;height:18px}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(8,8,10,.62)}.card{width:100%;max-width:760px;max-height:100%;display:flex;flex-direction:column;overflow:hidden;border-radius:16px;background:#16161a;box-shadow:0 24px 60px rgba(0,0,0,.45),0 0 0 1px rgba(255,255,255,.1)}.title{padding:16px 20px 12px;font-size:16px;font-weight:600}.media{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#000;color:rgba(255,255,255,.85)}.media video{display:block;width:100%;max-height:62vh;background:#000;object-fit:contain}.summary{padding:32px 20px;background:rgba(255,255,255,.04)}.summary>svg{width:40px;height:40px;opacity:.8}.facts{display:flex;gap:14px;font-variant-numeric:tabular-nums}.facts span{display:inline-flex;align-items:center;gap:6px}.footer{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px 16px 16px}.status{flex:1 1 200px;min-width:0;color:rgba(255,255,255,.8)}.error{color:#ff9a9d}.progress{height:4px;margin-top:8px;overflow:hidden;border-radius:2px;background:rgba(255,255,255,.15)}.progress div{height:100%;width:0;background:var(--primary);transition:width .2s}.footer .actions{margin-left:auto}@keyframes in{from{opacity:0}}@keyframes pulse{50%{opacity:.3}}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.bar,.overlay,.dot{animation:none}.spin{animation-duration:2.4s}.progress div{transition:none}}@media (max-width:600px){.bar,.moved{left:0!important;right:0;top:auto!important;bottom:0;transform:none;width:auto;max-width:none;flex-wrap:wrap;border-radius:16px 16px 0 0;padding:12px calc(12px + env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) calc(12px + env(safe-area-inset-left,0px))}.grip{display:none}.hint{flex:1 1 100%;padding:2px 4px 6px}.recording .hint{flex:1 1 auto}.actions{flex:1 1 100%}.recording .actions{flex:0 0 auto}.actions button:not(.icon){flex:1 1 0}button{min-height:44px}.icon{width:44px}.overlay{padding:0;align-items:flex-end}.card{max-width:none;border-radius:16px 16px 0 0;padding-bottom:env(safe-area-inset-bottom,0px)}.media video{max-height:55vh}}',Kl={grip:["M9 6h0M15 6h0M9 12h0M15 12h0M9 18h0M15 18h0","dots"],camera:["M4 8h3l1.6-2.4a1.5 1.5 0 0 1 1.3-.6h4.2a1.5 1.5 0 0 1 1.3.6L17 8h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1ZM12 16.4a3.4 3.4 0 1 0 0-6.8 3.4 3.4 0 0 0 0 6.8Z"],record:["M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12 14.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"],stop:["M8 7h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Z","fill"],mic:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21"],micOff:["M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3ZM5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M4 4l16 16"],page:["M6.5 3h11A2.5 2.5 0 0 1 20 5.5v13a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 4 18.5v-13A2.5 2.5 0 0 1 6.5 3ZM8 8h8M8 12h8M8 16h5"],clock:["M12 20.5a8.5 8.5 0 1 0 0-17 8.5 8.5 0 0 0 0 17ZM12 7.5V12l3 2"],pointer:["M6 3.5 18.5 12l-5.6 1.3-2.7 5.2Z"],send:["M14.54 21.69a.5.5 0 0 0 .94-.03l6.5-19a.5.5 0 0 0-.64-.63l-19 6.5a.5.5 0 0 0-.02.93l7.93 3.18a2 2 0 0 1 1.11 1.11zM21.85 2.15l-10.94 10.94"]},Jl="http://www.w3.org/2000/svg",Yl=e=>{const[t,n]=Kl[e],r=document.createElementNS(Jl,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("aria-hidden","true");const o=document.createElementNS(Jl,"path");return o.setAttribute("d",t),"fill"===n?o.setAttribute("fill","currentColor"):(o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width",n?"3.2":"1.8"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),r.appendChild(o),r},Zl=(e,t,n)=>{const r=document.createElement(e);return t&&(r.className=t),(n||[]).forEach((e=>{null!=e&&r.appendChild("string"==typeof e?document.createTextNode(e):e)})),r};class Ql{constructor(e){let{labels:t,primaryColor:n,rtl:r,onAction:o}=e;Wl(this,"host",null),Wl(this,"root",null),Wl(this,"timer",null),Wl(this,"maxSec",0),Wl(this,"micButton",null),Wl(this,"progress",null),Wl(this,"status",null),Wl(this,"previewButtons",null),Wl(this,"previewUrl",null),Wl(this,"position",null),Wl(this,"cleanupDrag",null),Wl(this,"autoFocus",!0),this.labels=Gl(t),this.onAction=o,this.rtl=!!r,this.primaryColor=/^#[0-9a-f]{6}$/i.test(n||"")?n:"#485BFF"}mount(){if(!this.host){const t=document.createElement("div");t.className="gleap-capture-root rr-block gl-block";const n={position:"fixed",top:"0",left:"0",width:"0",height:"0",overflow:"visible","z-index":"2147483647",display:"block",margin:"0",padding:"0",border:"0",transform:"none",filter:"none","pointer-events":"none"};Object.keys(n).forEach((e=>t.style.setProperty(e,n[e],"important")));const r=t.attachShadow({mode:"open"});let o=!1;try{if("function"==typeof CSSStyleSheet&&"adoptedStyleSheets"in r){const e=new CSSStyleSheet;e.replaceSync(Xl),r.adoptedStyleSheets=[e],o=!0}}catch(e){}if(!o){const e=document.createElement("style");W(e),e.textContent=Xl,r.appendChild(e)}const i=parseInt(this.primaryColor.substr(1,2),16),a=parseInt(this.primaryColor.substr(3,2),16),s=parseInt(this.primaryColor.substr(5,2),16);this.root=Zl("div"),this.root.setAttribute("dir",this.rtl?"rtl":"ltr"),this.root.style.setProperty("--primary",this.primaryColor),this.root.style.setProperty("--on-primary",(299*i+587*a+114*s)/1e3>=160?"#000":"#fff"),r.appendChild(this.root),this.host=t}this.ensureAttached()}ensureAttached(){try{this.host&&!this.host.isConnected&&(document.body||document.documentElement).appendChild(this.host)}catch(e){}}isOwnElement(e){return!(!this.host||!e||e!==this.host&&!this.host.contains(e))}setVisible(e){this.host&&this.host.style.setProperty("visibility",e?"visible":"hidden","important")}action(e){try{this.onAction&&this.onAction(e)}catch(t){}}button(e,t,n,r,o,i){const a=r?Yl(r):null,s=Zl("button",n,i?[e,a]:[a,e]);return s.type="button",s.disabled=!!o,s.addEventListener("click",(e=>{e.stopPropagation(),s.disabled||"true"===s.getAttribute("aria-disabled")||this.action(t)})),s}micToggle(e,t){if(!e||!e.available)return null;const n=this.button(null,"mic","icon",e.on?"mic":"micOff",t);return n.setAttribute("aria-pressed",e.on?"true":"false"),n.setAttribute("aria-label",this.labels.microphone),n.title=this.labels.microphone,this.micButton=n,n}focus(e){try{this.autoFocus&&e&&e.focus({preventScroll:!0})}catch(t){}}reset(){if(this.cleanupDrag&&(this.cleanupDrag(),this.cleanupDrag=null),this.previewUrl){try{URL.revokeObjectURL(this.previewUrl)}catch(e){}this.previewUrl=null}for(this.timer=this.micButton=this.progress=this.status=this.previewButtons=null;this.root&&this.root.firstChild;)this.root.removeChild(this.root.firstChild)}bar(e,t,n,r,o){this.mount(),this.reset();const i=Zl("div","grip",[Yl("grip")]);i.setAttribute("aria-hidden","true"),i.title=this.labels.barDragHint;const a=Zl("div","actions",n),s=Zl("div","bar"+(o?" recording":""),[i,t,a]);s.setAttribute("role","region"),s.setAttribute("aria-label",e),o||s.addEventListener("keydown",(e=>{try{"Escape"===e.key&&(e.stopPropagation(),this.action("cancel"))}catch(t){}})),this.place(s),this.enableDragging(s,i),this.root.appendChild(s),this.focus(n[r])}place(e){this.position&&(e.classList.add("moved"),e.style.left=this.position.left+"px",e.style.top=this.position.top+"px",e.style.bottom="auto")}enableDragging(e,t){let n=null;const r=t=>{try{n&&(this.position={left:Math.max(8,Math.min(window.innerWidth-e.offsetWidth-8,n.left+t.clientX-n.x)),top:Math.max(8,Math.min(window.innerHeight-e.offsetHeight-8,n.top+t.clientY-n.y))},this.place(e))}catch(r){}},o=()=>{n=null,window.removeEventListener("pointermove",r,!0),window.removeEventListener("pointerup",o,!0),window.removeEventListener("pointercancel",o,!0)};t.addEventListener("pointerdown",(t=>{try{if(t.button)return;t.preventDefault();const i=e.getBoundingClientRect();n={x:t.clientX,y:t.clientY,left:i.left,top:i.top},window.addEventListener("pointermove",r,!0),window.addEventListener("pointerup",o,!0),window.addEventListener("pointercancel",o,!0)}catch(i){}})),this.cleanupDrag=o}busyButton(e,t,n,r){const o=this.button(r?null:e,t,"primary",r?null:n);return r&&(o.appendChild(Zl("span","spin")),o.appendChild(document.createTextNode(e)),o.setAttribute("aria-busy","true"),o.setAttribute("aria-disabled","true")),o}showScreenshotBar(e){const t=this.labels;this.bar(t.barCapture,Zl("div","hint",[t.barScreenshotHint]),[this.busyButton(t.barCapture,"capture","camera",e),this.button(t.barCancel,"cancel")],0)}showRecordBar(e){let{busy:t,mic:n,interrupted:r}=e;const o=this.labels,i=r?o.recordAgain:o.barStart,a=[this.busyButton(i,"start","record",t),this.micToggle(n,t),this.button(o.barCancel,"cancel")].filter(Boolean);this.bar(i,Zl("div","hint",[r?o.recordingInterrupted:o.barRecordHint]),a,0)}showPageRecordingOffer(){const e=this.labels;this.bar(e.recordPage,Zl("div","hint",[e.recordPageHint]),[this.button(e.recordPage,"record-page","primary","record"),this.button(e.barCancel,"cancel")],0)}showRecordingBar(e){let{mic:t,maxSec:n}=e;const r=this.labels;this.maxSec=n;const o=Zl("span","timer",[$l(0)+" / "+$l(n)]);o.setAttribute("role","timer");const i=this.button(null,"stop","stop icon","stop");i.setAttribute("aria-label",r.barStop),i.title=r.barStop;const a=[this.micToggle(t),i].filter(Boolean);this.bar(r.barRecording,Zl("div","hint rec",[Zl("span","dot"),o]),a,a.length-1,!0),this.timer=o}updateTimer(e){this.timer&&(this.timer.textContent=$l(e)+" / "+$l(this.maxSec))}setMicOn(e){const t=this.micButton;t&&(t.setAttribute("aria-pressed",e?"true":"false"),t.replaceChild(Yl(e?"mic":"micOff"),t.firstChild))}showPreview(e){this.mount(),this.reset();const t=this.labels;let n;if(e.video){const t=document.createElement("video");t.controls=!0,t.playsInline=!0,t.preload="auto",t.addEventListener("loadedmetadata",(()=>{try{if(t.duration===1/0){const e=()=>{t.removeEventListener("timeupdate",e),t.currentTime=0};t.addEventListener("timeupdate",e),t.currentTime=1e7}}catch(e){}}),{once:!0}),this.previewUrl=URL.createObjectURL(e.video),t.src=this.previewUrl,n=Zl("div","media",[t])}else{const t=Zl("div","facts",[Zl("span",null,[Yl("clock"),$l((e.durationMs||0)/1e3)])]);"number"==typeof e.interactions&&t.appendChild(Zl("span",null,[Yl("pointer"),String(e.interactions)])),n=Zl("div","media summary",[Yl("page"),t])}this.status=Zl("div","status"),this.status.setAttribute("aria-live","polite");const r={cancel:this.button(t.barCancel,"cancel"),retake:this.button(t.previewRetake,"retake"),send:this.button(t.previewSend,"send","primary","send",!1,!0)};this.previewButtons=r;const o=Zl("div","title",[t.previewTitle]);o.id="gl-title";const i=Zl("div","card",[o,n,Zl("div","footer",[this.status,Zl("div","actions",[r.cancel,r.retake,r.send])])]);i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-labelledby",o.id),this.root.appendChild(Zl("div","overlay",[i])),this.focus(r.send)}setUploading(e){if(this.status){if(this.previewButtons.retake.disabled=this.previewButtons.send.disabled=!0,!this.progress){this.status.className="status",this.status.textContent=this.labels.uploading,this.progress=Zl("div");const e=Zl("div","progress",[this.progress]);e.setAttribute("role","progressbar"),this.status.appendChild(e)}this.progress.style.width=Math.round(100*Math.max(0,Math.min(1,e||0)))+"%"}}setPreviewError(e){this.status&&(this.progress=null,this.status.className="status error",this.status.textContent=e||this.labels.failed,this.previewButtons.retake.disabled=this.previewButtons.send.disabled=!1)}destroy(){this.reset();try{this.host&&this.host.remove()}catch(e){}this.host=this.root=this.onAction=null}}const eu="filter: blur(12px) !important;",tu=eu+" -webkit-text-security: disc !important;",nu=ol.split(",").map((e=>":not("+e.trim()+")")).join(""),ru=e=>{try{return!(!e.matches||!e.matches(ol))}catch(t){return!1}},ou=e=>{const t=":is("+e+"):not(html):not(body)"+nu,n=["html:is("+e+") > body > *","body:is("+e+") > *"].map((e=>e+nu)).join(", ");return{rules:[t+":not("+t+" *) { "+eu+" }",n+" { "+eu+" }"],fallback:e+" { "+eu+" }"}},iu=(e,t)=>{const n=fl(e,t).map(ou);return n.push({rules:[ll()+" { "+eu+" }"],fallback:null}),function(e){e=e||{};var t=['input[type="password" i]',"input[data-rr-is-password]"];ya.forEach((function(e){t.push('input[autocomplete~="'+e+'" i]','textarea[autocomplete~="'+e+'" i]')})),["input"+Pa,"textarea","select"].forEach((function(e){t.push(e+ba,ba+" "+e)}));var n=Ma(e);return Object.keys(n).forEach((function(e){!n[e]||wa.indexOf(e)>=0||!/^[a-z-]+$/.test(e)||("textarea"!==e&&"select"!==e?(t.push('input[type="'+e+'" i]'),"text"===e&&t.push("input:not([type])")):t.push(e))})),t}(e).forEach((e=>{n.push({rules:[e+" { "+tu+" }"],fallback:null})})),n},au=(e,t)=>{let n=!1;if(t.rules.forEach((t=>{try{e.insertRule(t,e.cssRules.length),n=!0}catch(r){}})),!n&&t.fallback)try{e.insertRule(t.fallback,e.cssRules.length)}catch(r){}},su=()=>new Promise((e=>{let t=!1;const n=()=>{t||(t=!0,e())};setTimeout(n,120);try{requestAnimationFrame((()=>requestAnimationFrame(n)))}catch(r){n()}})),cu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.privacyOptions||{},n=iu(t,e.maskSelectors),r=gl(t),o=Object.create(null),i=[],a=new WeakSet,s=[];let c=null,l=!1;const u=e=>{const t=(e=>{for(let n=0;n<i.length;n++)if(i[n].doc===e)return i[n];let t=null;try{const n=e.defaultView;n&&"function"==typeof n.CSSStyleSheet&&"adoptedStyleSheets"in e&&(t={doc:e,sheet:new n.CSSStyleSheet,style:null,roots:[]})}catch(r){}if(!t)try{const n=e.createElement("style");W(n),(e.head||e.documentElement).appendChild(n),n.sheet?t={doc:e,sheet:n.sheet,style:n,roots:[]}:n.parentNode.removeChild(n)}catch(r){}return t&&(n.forEach((e=>au(t.sheet,e))),Object.keys(o).forEach((e=>au(t.sheet,ou("."+pl(e))))),i.push(t)),t})(9===e.nodeType?e:e.ownerDocument);if(t&&!t.style)try{e.adoptedStyleSheets=Array.prototype.slice.call(e.adoptedStyleSheets||[]).concat([t.sheet]),t.roots.push(e)}catch(r){}},d=e=>{const t=e.classList;if(r.length&&t)for(let n=0;n<t.length;n++){const e=t[n];if(o[e])continue;if(r.some((t=>(t.lastIndex=0,t.test(e))))){o[e]=!0;const t=ou("."+pl(e));i.forEach((e=>au(e.sheet,t)))}}};let p=null;const h=(e,t)=>{!e||a.has(e)||t>8||(a.add(e),u(e),(e=>{if(c)try{c.observe(e,r.length?{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}:{childList:!0,subtree:!0})}catch(t){}})(e),p(e,t))},f=(e,t)=>{let n=null;try{n=e.contentDocument}catch(r){}n&&n.documentElement&&h(n,t)},g=(e,t)=>{d(e),e.shadowRoot&&h(e.shadowRoot,t+1),"IFRAME"!==e.tagName&&"FRAME"!==e.tagName||((e,t)=>{for(let o=0;o<s.length;o++)if(s[o].frame===e)return void f(e,t);const n=()=>{l||f(e,t)};try{e.addEventListener("load",n),s.push({frame:e,onLoad:n})}catch(r){}f(e,t)})(e,t+1)};p=(e,t)=>{if(!l&&e)try{if(1===e.nodeType){if(ru(e))return;g(e,t)}const n=(e.ownerDocument||e).createTreeWalker(e,1,{acceptNode:e=>ru(e)?2:1});let r=n.nextNode();for(;r;)g(r,t),r=n.nextNode()}catch(n){}};const m=()=>{if(!l){l=!0;try{c&&c.disconnect()}catch(e){}c=null,s.forEach((t=>{try{t.frame.removeEventListener("load",t.onLoad)}catch(e){}})),s.length=0,i.forEach((t=>{t.roots.forEach((n=>{try{n.adoptedStyleSheets=Array.prototype.filter.call(n.adoptedStyleSheets||[],(e=>e!==t.sheet))}catch(e){}}));try{t.style&&t.style.parentNode&&t.style.parentNode.removeChild(t.style)}catch(e){}})),i.length=0;try{window.removeEventListener("pagehide",m)}catch(e){}}};try{window.addEventListener("pagehide",m),"function"==typeof MutationObserver&&(c=new MutationObserver((e=>{if(!l)try{e.forEach((e=>{if("attributes"!==e.type)for(let t=0;t<e.addedNodes.length;t++)1===e.addedNodes[t].nodeType&&p(e.addedNodes[t],0);else d(e.target)}))}catch(t){}}))),h(document,0)}catch(v){}return{ready:su,remove:m}};function lu(e,t,n){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const uu="gleap-capture-session",du="gleap-capture-device",pu=["completed","skipped","cancelled","expired"],hu=[".bb-feedback-button",".gleap-notification-container",".gleap-chatbar",".gleap-b",".gleap-modal-wrapper",".gleap-tooltip",".gleap-tooltip-anchor",".gleap-tour-popover",".gleap-tour-overlay","#copilot-pointer-container","#copilot-joined-container",".gleap-audio-unmute-modal-overlay",".gleap-admin-frame-container",".gleap-admin-collapse-ui","gleap-checklist"].join(", "),fu=e=>{try{return window.sessionStorage.getItem(e)}catch(t){return null}},gu=(e,t)=>{try{null===t?window.sessionStorage.removeItem(e):window.sessionStorage.setItem(e,t)}catch(n){}},mu=e=>{const t=parseInt(e,10);return isNaN(t)?60:Math.max(5,Math.min(180,t))},vu=e=>{if(!e)return"unknown";const t=e.name&&"Error"!==e.name?e.name:"",n=e.message?String(e.message):t?"":String(e);return(t&&n?t+": "+n:t||n).slice(0,120)},yu=e=>e>=200&&e<300;let bu=0;class wu{constructor(){lu(this,"session",null),lu(this,"ui",null),lu(this,"watchdog",null),lu(this,"hiddenElements",[]),lu(this,"hiddenEscape",null),lu(this,"handledLogRequests",[]),lu(this,"logsPostedFor",[]),lu(this,"deviceId",null)}static getInstance(){return this.instance||(this.instance=new wu),this.instance}setCaptureEnabled(e){(e=>{qn=!!e})(e),e||(gu(uu,null),this.session&&this.cancelSession(this.session,"disabled"));try{ig.instance&&ig.instance.sendCaptureCapabilities()}catch(t){}}setRemoteLogCollectionEnabled(e){(e=>{Wn=!!e})(e)}getDeviceId(){if(this.deviceId)return this.deviceId;let e=fu(du);return e&&/^web-[0-9a-f]{32}$/.test(e)||(e="web-"+(e=>{try{const t=new Uint8Array(e);return window.crypto.getRandomValues(t),Array.prototype.map.call(t,(e=>(e<16?"0":"")+e.toString(16))).join("")}catch(t){let n="";for(let r=0;r<2*e;r++)n+=Math.floor(16*Math.random()).toString(16);return n}})(16),gu(du,e)),this.deviceId=e,e}privacyOptions(){try{return Ga.getInstance().customOptions||{}}catch(e){return{}}}maskSelectors(){const e=Kn().maskSelectors;return Array.isArray(e)?e.filter((e=>"string"==typeof e)):[]}attachesLogs(e){return!!(e&&e.options&&e.options.attachLogs)&&Vn()}applyVeil(e){this.liftVeil(e);try{e.veil=cu({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors()})}catch(t){e.veil=null}}liftVeil(e,t){const n=t||e.veil;if(n){e.veil===n&&(e.veil=null);try{n.remove()}catch(r){}}}handleMessengerMessage(e){try{const t=e&&e.data&&"object"==typeof e.data?e.data:{};switch(e&&e.name){case"capture-start":this.onCaptureStart(t);break;case"capture-cancel":this.onCaptureCancel(t);break;case"capture-editor":this.setEditorOpen(!!t.open);break;case"capture-done":this.onCaptureDone(t)}}catch(t){}}sendState(e,t,n){try{ig.getInstance().sendMessage({name:"capture-state",data:Object.assign({requestId:e,state:t},n)})}catch(r){}}setEditorOpen(e){try{ig.getInstance().setCaptureEditorOpen(e)}catch(t){}}onCaptureStart(e){const t="string"==typeof e.requestId?e.requestId:null,n="screenshot"===e.kind||"recording"===e.kind?e.kind:null;if(!t||!n)return;if(!er())return this.sendState(t,"unsupported",{error:"capture-disabled"}),void Cs(t,"unsupported","capture-disabled");const r=this.session;if(r){if("uploading"===r.phase)return;r.requestId!==t?this.cancelSession(r,"replaced",!0):this.endSession(r,{restore:!1})}this.setEditorOpen(!1),this.startSession({requestId:t,kind:n,ticketShareToken:"string"==typeof e.ticketShareToken?e.ticketShareToken:null,options:e.options,labels:e.labels,resumed:!1,phase:"bar"})}onCaptureCancel(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||(this.endSession(t,{restore:!0}),this.sendState(t.requestId,"cancelled")),this.setEditorOpen(!1)}onCaptureDone(e){const t=this.session;!t||e.requestId&&e.requestId!==t.requestId||this.endSession(t,{restore:!0}),this.setEditorOpen(!1)}onWidgetDestroyed(){const e=this.session;e&&("editor"!==e.phase?e.resumed=!0:this.endSession(e,{restore:!1}))}destroy(){this.session&&this.endSession(this.session,{restore:!1}),this.setEditorOpen(!1)}normalizeOptions(e){const t=e&&"object"==typeof e?e:{};return{annotate:!1!==t.annotate,maxDurationSec:mu(t.maxDurationSec),audio:!0===t.audio,attachLogs:!1!==t.attachLogs,include:Ls(t.include)}}startSession(e){let t={};try{t=Ku.getInstance().getFlowConfig()||{}}catch(r){}const n={key:++bu,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken||null,options:this.normalizeOptions(e.options),labels:Gl(e.labels),rawLabels:e.labels&&"object"==typeof e.labels?e.labels:null,resumed:!!e.resumed,phase:e.phase,interrupted:"interrupted"===e.phase,pageRecording:!0===e.pageRecording,micOn:!1,createdAt:"number"==typeof e.createdAt?e.createdAt:Date.now(),startedAt:Date.now(),lastTick:-1,lastProgressSent:0};this.session=n;try{let o=!1;try{o=!!Xv.getInstance().isRTLLayout}catch(r){}this.ui=new Ql({labels:e.labels,primaryColor:t.color,rtl:o,onAction:e=>this.onUiAction(n,e)}),this.ui.autoFocus=!n.resumed,this.renderBar(n)}catch(o){return void this.failSession(n,"failed",vu(o))}if(!n.resumed)try{ig.getInstance().setCaptureHidden(!0)}catch(r){}this.hideGleapUi(),this.startWatchdog(),this.persist(n),this.sendState(n.requestId,"bar")}renderBar(e){this.ui&&("screenshot"===e.kind?this.ui.showScreenshotBar(!1):this.ui.showRecordBar({busy:!1,mic:this.micState(e),interrupted:e.interrupted}))}micState(e){return!0===e.options.audio&&!0===Kn().allowMicrophone&&this.usesScreenRecording(e)&&Yn()?{available:!0,on:e.micOn}:null}usesScreenRecording(e){return"display"===Qn()&&!e.pageRecording}endSession(e,t){let{restore:n}=t;if(e&&this.session===e){this.session=null;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e);try{e.timeline&&e.timeline.stop()}catch(r){}try{e.upload&&e.upload.abort()}catch(r){}if(e.recording=null,e.timeline=null,e.upload=null,e.result=null,this.stopWatchdog(),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),this.ui){try{this.ui.destroy()}catch(r){}this.ui=null}if(this.showGleapUi(),gu(uu,null),n)this.restoreWidget(e);else if(!e.resumed)try{ig.getInstance().setCaptureHidden(!1,!1)}catch(r){}}}restoreWidget(e){try{e.resumed?this.openConversation(e.ticketShareToken):ig.getInstance().setCaptureHidden(!1,!0)}catch(t){}}openConversation(e){e?py.openConversation(e,!0):py.open()}cancelSession(e,t,n){const r="editor"===e.phase;this.endSession(e,{restore:!n}),r||(this.sendState(e.requestId,"cancelled"),Cs(e.requestId,"released",t))}failSession(e,t,n){e&&this.session===e&&(this.endSession(e,{restore:!0}),this.sendState(e.requestId,t,{error:n}),Cs(e.requestId,"declined"===t||"unsupported"===t?t:"failed",n))}onUiAction(e,t){if(this.session===e)try{switch(t){case"capture":this.takeScreenshot(e);break;case"start":this.startRecording(e);break;case"record-page":e.pageRecording=!0,this.startRecording(e);break;case"stop":e.recording&&e.recording.stop();break;case"mic":this.toggleMicrophone(e);break;case"send":this.sendRecording(e);break;case"retake":this.retakeRecording(e);break;case"cancel":"fallback"===e.phase?this.failSession(e,e.fallbackState,e.fallbackReason):this.cancelSession(e,"cancelled")}}catch(n){this.failSession(e,"failed",vu(n))}}takeScreenshot(e){if("screenshot"!==e.kind||"bar"!==e.phase)return;const t="dom-only"!==Kn().webScreenshotMethod&&Zn()&&Jn()&&(()=>{try{return window.top===window.self}catch(e){return!1}})(),n=t?(()=>{let e;try{e=navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude",monitorTypeSurfaces:"exclude"})}catch(t){e=Promise.reject(t)}return e.catch((()=>{})),e})():null;e.phase="capturing",this.ui.showScreenshotBar(!0),this.sendState(e.requestId,"capturing"),t&&this.setCaptureUiHidden(!0);let r=null;if(this.attachesLogs(e)&&-1===this.logsPostedFor.indexOf(e.requestId))try{r=As({include:e.options.include,deviceId:this.getDeviceId()})}catch(i){}const o=()=>this.session===e;(e=>{let{streamPromise:t,setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:i}=e;const a=()=>!i||i();return(t?t.then((e=>a()?Ll(e,{setUiHidden:n,privacyOptions:r,maskSelectors:o,isActive:a}).catch((()=>null)):(Il(e),null)),(()=>(n(!1),null))):Promise.resolve(null)).then((e=>{if(!a())throw e&&Sl(e.canvas),new Error("aborted");return e||ql({privacyOptions:r,maskSelectors:o,isActive:a})})).then((e=>{try{const t=El(e);return t.method=e.method,t}finally{Sl(e.canvas)}}))})({streamPromise:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isActive:o,setUiHidden:e=>{o()&&this.setCaptureUiHidden(e)}}).then((t=>{o()&&this.onScreenshotReady(e,t,r)})).catch((t=>{o()&&this.failSession(e,"failed",vu(t))}))}onScreenshotReady(e,t,n){const r=ig.getInstance(),o={name:"capture-image",data:{requestId:e.requestId,dataUrl:t.dataUrl,width:t.width,height:t.height,method:t.method,platform:zn,sdkType:Hn,sdkVersion:Xn()}};e.phase="editor",gu(uu,null),this.stopWatchdog(),this.ui&&(this.ui.destroy(),this.ui=null),this.showGleapUi(),e.resumed?(this.openConversation(e.ticketShareToken),r.sendMessage(o,!0)):(r.sendMessage(o,!0),r.setCaptureHidden(!1,!0)),n&&this.postLogs(e.requestId,n)}postLogs(e,t){Vn()&&-1===this.logsPostedFor.indexOf(e)&&(this.logsPostedFor.push(e),this.logsPostedFor.length>100&&this.logsPostedFor.shift(),Ts(e,t).catch((()=>{})))}setCaptureUiHidden(e){if(this.ui&&this.ui.setVisible(!e),this.hiddenEscape&&(document.removeEventListener("keydown",this.hiddenEscape,!0),this.hiddenEscape=null),e){this.hideGleapUi();const e=this.session;this.hiddenEscape=t=>{try{"Escape"===t.key&&e&&this.session===e&&this.cancelSession(e,"cancelled")}catch(n){}},document.addEventListener("keydown",this.hiddenEscape,!0)}}startRecording(e){if("recording"!==e.kind||-1===["bar","interrupted","fallback"].indexOf(e.phase))return;const t=()=>this.session===e,n=e.options.maxDurationSec,r=n=>{t()&&n!==e.lastTick&&(e.lastTick=n,this.ui&&this.ui.updateTimer(n),this.sendState(e.requestId,"recording",{elapsedSec:n}))},o=n=>{t()&&this.onRecordingStopped(e,n)},i=n=>{t()&&this.failSession(e,"failed",vu(n))};if(this.usesScreenRecording(e)){const a=(e=>{const t={frameRate:{ideal:15,max:30}},n={video:t,audio:!1};let r;e&&(t.displaySurface="browser",n.preferCurrentTab=!0,n.selfBrowserSurface="include",n.surfaceSwitching="include");try{r=navigator.mediaDevices.getDisplayMedia(n)}catch(o){r=Promise.reject(o)}return r.catch((()=>{})),r})(Zn());this.applyVeil(e);const s=e.veil;return e.phase="starting",this.ui.showRecordBar({busy:!0,mic:this.micState(e),interrupted:e.interrupted}),void a.then((e=>(s?s.ready():Promise.resolve()).then((()=>e)))).then((a=>{if(!t())return Il(a),null;const c=new ls({maxDurationSec:n,onTick:r,onStop:o,onError:i,onReleased:()=>{s&&this.liftVeil(e,s)}});return e.recording=c,c.start(a,!!this.micState(e)&&e.micOn).then((n=>{t()?this.onRecordingStarted(e,c.startedAt,n.hasMicrophone):c.cancel()}))})).catch((n=>{t()&&this.offerPageRecording(e,n)}))}const a=new hs({maxDurationSec:n,privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),onTick:r,onStop:o,onError:i});e.recording=a,a.start(),this.onRecordingStarted(e,a.startedAt,!1)}offerPageRecording(e,t){const n=t&&t.name;try{e.recording&&e.recording.cancel()}catch(r){}this.liftVeil(e),e.phase="fallback",e.recording=null,e.fallbackState="NotAllowedError"===n||"SecurityError"===n?"declined":"failed",e.fallbackReason=vu(t),this.ui.showPageRecordingOffer(),this.persist(e),this.sendState(e.requestId,"bar")}onRecordingStarted(e,t,n){e.phase="recording",e.interrupted=!1,e.hasMicrophone=!!n,e.lastTick=0,e.timeline=new vs({privacyOptions:this.privacyOptions(),maskSelectors:this.maskSelectors(),isOwnElement:e=>!(!this.ui||!this.ui.isOwnElement(e))}),e.timeline.start(t),this.ui.showRecordingBar({mic:e.hasMicrophone?{available:!0,on:e.micOn}:null,maxSec:e.options.maxDurationSec}),this.persist(e),this.sendState(e.requestId,"recording",{elapsedSec:0})}toggleMicrophone(e){"recording"!==e.phase&&"bar"!==e.phase&&"interrupted"!==e.phase||(e.micOn=!e.micOn,"recording"===e.phase&&e.recording&&e.recording.setMicrophoneEnabled&&e.recording.setMicrophoneEnabled(e.micOn),this.ui.setMicOn(e.micOn))}onRecordingStopped(e,t){this.liftVeil(e),e.recording=null,e.result=t,e.timelineEntries=e.timeline?e.timeline.stop(t.endedAt):[];const n=e.timeline?e.timeline.interactions:0;e.timeline=null,e.phase="preview",this.ui.showPreview({video:0===t.type.indexOf("video/")?t.blob:null,durationMs:t.durationMs,interactions:n}),this.persist(e),this.sendState(e.requestId,"preview")}retakeRecording(e){"preview"===e.phase&&(e.result=null,e.uploadedUrl=null,e.timelineEntries=null,e.phase="bar",e.interrupted=!1,this.renderBar(e),this.persist(e),this.sendState(e.requestId,"bar"))}sendRecording(e){const t=e.result;if("preview"!==e.phase||!t)return;const n=()=>this.session===e;if(e.phase="uploading",this.ui.setUploading(0),this.sendState(e.requestId,"uploading",{progress:0}),this.attachesLogs(e))try{this.postLogs(e.requestId,As({include:e.options.include,windowStart:t.startedAt,windowEnd:t.endedAt,deviceId:this.getDeviceId()}))}catch(i){}const r=t=>{if(!n())return;this.ui&&this.ui.setUploading(t);const r=Date.now();(r-e.lastProgressSent>250||t>=1)&&(e.lastProgressSent=r,this.sendState(e.requestId,"uploading",{progress:Math.round(100*t)/100}))};let o;e.uploadedUrl?o=Promise.resolve(e.uploadedUrl):(e.upload=((e,t,n)=>{let r=null;return{promise:new Promise(((o,a)=>{try{const i=Lf.getInstance(),s=new FormData;s.append("file",e,t),r=new XMLHttpRequest,r.open("POST",i.apiUrl+"/uploads/attachments"),i.injectSession(r),r.upload&&n&&(r.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&n(Math.min(1,e.loaded/e.total))}),r.onreadystatechange=()=>{if(4!==r.readyState)return;const e=ks(r.responseText);200===r.status&&e&&Array.isArray(e.fileUrls)&&"string"==typeof e.fileUrls[0]?o(e.fileUrls[0]):a(new Error(413===r.status?"file-too-large":"upload-failed-"+r.status))},r.onerror=()=>a(new Error("upload-failed")),r.onabort=()=>a(new Error("upload-aborted")),r.send(s)}catch(i){a(i)}})),abort:()=>{try{r&&r.abort()}catch(i){}}}})(t.blob,t.fileName,r),o=e.upload.promise),o.then((r=>{if(!n())return null;e.upload=null,e.uploadedUrl=r;const o={url:r,name:t.fileName,type:t.type,size:t.blob.size,durationMs:t.durationMs};return t.width>0&&t.height>0&&(o.width=t.width,o.height=t.height),(i=e.requestId,a={files:[o],method:t.method,platform:zn,sdkType:Hn,sdkVersion:Xn(),deviceId:this.getDeviceId(),annotations:[],timeline:e.timelineEntries||[],recordingStartedAt:new Date(t.startedAt).toISOString(),recordingEndedAt:new Date(t.endedAt).toISOString()},Ss(i,"complete",a)).then((t=>{n()&&(yu(t.status)?(this.endSession(e,{restore:!0}),this.sendState(e.requestId,"done")):409===t.status||410===t.status?(this.endSession(e,{restore:!0}),this.sendState(e.requestId,"failed",{error:409===t.status?"already-completed":"request-closed"})):this.onUploadFailed(e,"complete-"+t.status))}));var i,a})).catch((t=>{n()&&this.onUploadFailed(e,vu(t))}))}onUploadFailed(e,t){e.upload=null,e.phase="preview",this.ui&&this.ui.setPreviewError(e.labels.failed),this.sendState(e.requestId,"preview",{error:t})}hideGleapUi(){try{const e=document.querySelectorAll(hu);for(let t=0;t<e.length;t++){const n=e[t];-1===this.hiddenElements.indexOf(n)&&this.hiddenElements.push(n),n.style.setProperty("visibility","hidden","important")}}catch(e){}}showGleapUi(){this.hiddenElements.forEach((e=>{try{e.style.removeProperty("visibility")}catch(t){}})),this.hiddenElements=[]}startWatchdog(){this.stopWatchdog(),this.watchdog=setInterval((()=>{try{this.ui&&this.ui.ensureAttached(),this.hideGleapUi()}catch(e){}}),1e3)}stopWatchdog(){this.watchdog&&(clearInterval(this.watchdog),this.watchdog=null)}persist(e){if(this.session!==e)return;let t=null;if(-1!==["bar","capturing","starting","fallback"].indexOf(e.phase)?t=e.interrupted?"recording":"bar":"recording"===e.kind&&-1!==["recording","preview","uploading","interrupted"].indexOf(e.phase)&&(t="recording"),!t)return void gu(uu,null);let n=null,r=null;try{const e=Lf.getInstance();n=e.session?e.session.gleapId:null,r=e.sdkKey}catch(o){}try{gu(uu,JSON.stringify({v:1,requestId:e.requestId,kind:e.kind,ticketShareToken:e.ticketShareToken,options:e.options,labels:e.rawLabels,phase:t,pageRecording:!0===e.pageRecording,gleapId:n,sdkKey:r,at:e.createdAt}))}catch(o){}}resumeFromStorage(){try{if(this.session)return;const n=fu(uu);if(!n)return;let r=null;try{r=JSON.parse(n)}catch(t){}const o=Lf.getInstance();if(!(r&&1===r.v&&"string"==typeof r.requestId&&("screenshot"===r.kind||"recording"===r.kind)&&"number"==typeof r.at&&Date.now()-r.at<18e5&&o.session&&r.gleapId===o.session.gleapId&&r.sdkKey===o.sdkKey)||!er())return void gu(uu,null);(e=r.requestId,xs("GET","/v3/shared/capture-requests/"+encodeURIComponent(String(e)))).then((e=>{try{const t=e.data;if(e.status>=400&&e.status<500||t&&-1!==pu.indexOf(t.status)||t&&t.expiresAt&&Date.parse(t.expiresAt)<Date.now())return void(this.session||gu(uu,null));if(this.session)return;this.startSession({requestId:r.requestId,kind:r.kind,ticketShareToken:r.ticketShareToken,options:r.options,labels:r.labels,pageRecording:!0===r.pageRecording,createdAt:r.at,resumed:!0,phase:"recording"===r.kind&&"recording"===r.phase?"interrupted":"bar"})}catch(t){}}))}catch(t){}var e}handleServerRequest(e){try{if(!e||"logs"!==e.kind||"string"!=typeof e.id)return;const t=e.id;if(-1!==this.handledLogRequests.indexOf(t))return;if(this.handledLogRequests.push(t),this.handledLogRequests.length>100&&this.handledLogRequests.shift(),e.expiresAt&&Date.parse(e.expiresAt)<Date.now())return;const n=e.options&&"object"==typeof e.options?e.options:{};Ku.getInstance().onConfigLoaded((()=>{this.collectLogs(t,n).catch((()=>{}))}))}catch(t){}}collectLogs(e,t){if(!Vn())return Cs(e,"unsupported","disabled-by-app");if(!1===Kn().backgroundLogs)return Cs(e,"unsupported","disabled-by-project");const n=this.getDeviceId();return((e,t)=>Ss(e,"claim",t))(e,{deviceId:n,platform:zn,sdkType:Hn,sdkVersion:Xn()}).then((r=>!yu(r.status)||r.data&&r.data.claimedElsewhere?null:Promise.resolve().then((()=>Ts(e,As({include:t.include,deviceId:n})))).then((t=>yu(t.status)?null:Cs(e,"failed","logs-"+t.status)),(t=>Cs(e,"failed",vu(t))))))}}function ku(e){return ku="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},ku(e)}function xu(e){return function(e){if(Array.isArray(e))return Su(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 Su(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 Su(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 Su(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 Cu(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,Ru(r.key),r)}}function Eu(e,t,n){return t=Au(t),function(e,t){if(t&&("object"===ku(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Iu(e)}(e,Lu()?Reflect.construct(t,n||[],Au(e).constructor):t.apply(e,n))}function Iu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tu(e){var t="function"==typeof Map?new Map:void 0;return Tu=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(Lu())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Ou(o,n.prototype),o}(e,arguments,Au(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ou(n,e)},Tu(e)}function Lu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lu=function(){return!!e})()}function Ou(e,t){return Ou=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ou(e,t)}function Au(e){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Au(e)}function Mu(e,t,n){return(t=Ru(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ru(e){var t=function(e,t){if("object"!=ku(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ku(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ku(t)?t:String(t)}lu(wu,"instance",void 0);function Pu(e){return Pu="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},Pu(e)}function Du(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,Nu(r.key),r)}}function Nu(e){var t=function(e,t){if("object"!=Pu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Pu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pu(t)?t:String(t)}var ju,_u,Fu,Bu=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(),dy(t.href));var n=ig.getInstance(),r="function"==typeof n.isCaptureHidden&&n.isCaptureHidden();n.isOpened()&&!r||e.target.closest&&e.target.closest(".gleap-capture-root")||Cd.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&&Du(t.prototype,n),r&&Du(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Uu(e){return Uu="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},Uu(e)}function Hu(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,qu(r.key),r)}}function zu(e,t,n){return(t=qu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qu(e){var t=function(e,t){if("object"!=Uu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Uu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Uu(t)?t:String(t)}ju=Bu,Fu=void 0,(_u=Nu(_u="instance"))in ju?Object.defineProperty(ju,_u,{value:Fu,enumerable:!0,configurable:!0,writable:!0}):ju[_u]=Fu;var Wu=["color","headerColor","headerColor2","headerColor3","backgroundColor"],Vu=["logo","bgImage","aurora"],Gu=function(e,t){return JSON.stringify(e.map((function(e){return null==t?void 0:t[e]})))},$u=function(e,t){return"".concat(e,"|").concat(Gu([].concat(Wu,Vu),t))},Xu=function(e,t){var n=parseInt(e);return isNaN(n)?t:n},Ku=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),zu(this,"rawFlowConfig",null),zu(this,"flowConfig",null),zu(this,"appliedColorScheme",null),zu(this,"projectActions",null),zu(this,"onConfigLoadedListener",[]),zu(this,"onConfigLoaded",(function(e){null!==t.flowConfig?e():t.onConfigLoadedListener.push(e)})),zu(this,"start",(function(){var e=Lf.getInstance(),n=ie("config-".concat(e.sdkKey,"-").concat(Xv.getInstance().getActiveLanguage()));return n?(t.applyConfig(n),t.loadConfigFromServer().catch((function(e){})),Promise.resolve()):t.loadConfigFromServer()})),zu(this,"loadConfigFromServer",(function(){var e=t;return new Promise((function(t,n){var r=Lf.getInstance(),o=new XMLHttpRequest,i=Xv.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)),py.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;py.setStyles(e.color?e.color:"#485BFF",e.headerColor?e.headerColor:"#485BFF",e.buttonColor?e.buttonColor:"#485BFF",e.backgroundColor?e.backgroundColor:"#FFFFFF",Xu(e.borderRadius,20),Xu(e.buttonX,20),Xu(e.buttonY,20),e.feedbackButtonPosition,e.headerColor2,e.headerColor3)}},{key:"refreshColorScheme",value:function(){if(this.rawFlowConfig){var e=En.getInstance(),t=e.applyToFlowConfig(this.rawFlowConfig),n=$u(e.getActiveColorScheme(this.rawFlowConfig),t);if(n!==this.appliedColorScheme){this.appliedColorScheme=n;var r=this.flowConfig,o=Gu(Wu,t)!==Gu(Wu,r),i=Gu(Vu,t)!==Gu(Vu,r);this.flowConfig=t;var a=Nn.getInstance();a.comReady&&a._sendConfigUpdate(),o&&(this.applyStylesFromConfig(),Rg.getInstance().sendModalData(),e.applyToChecklists(t.color!==(null==r?void 0:r.color))),(o||i)&&ig.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=En.getInstance();t.updateWatching();var n=t.applyToFlowConfig(e.flowConfig),r=this.flowConfig;this.flowConfig=n,this.appliedColorScheme=$u(t.getActiveColorScheme(e.flowConfig),n),t.applyToChecklists(!!r&&r.color!==n.color),this.applyStylesFromConfig(),ig.getInstance().sendConfigUpdate(),N.getInstance().updateFeedbackButtonState(),jm.getInstance().updateContainerStyle(),n.enableWebReplays?Ga.getInstance().startIfNotRunning():Ga.getInstance().stop(),n.enableNetworkLogs&&Mm.getInstance().start(),Mm.getInstance().setLoadAllResources(!!n.sendNetworkResources),Mm.getInstance().setRemoteFilters(n.networkLogPropsToIgnore||[]),Mm.getInstance().setRemoteBlacklist(n.networkLogBlacklist||[]),Xv.getInstance().updateRTLSupport(),py.enableShortcuts(!!n.enableShortcuts),e.aiBar&&Nn.getInstance().setConfig(e.aiBar),this.notifyConfigLoaded()}catch(o){}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Hu(t.prototype,n),r&&Hu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ju(e){return Ju="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},Ju(e)}zu(Ku,"instance",void 0);var Yu={budgetExceeded:!0},Zu=function(e){try{return Object.prototype.toString.call(e)}catch(t){return"[object Object]"}},Qu=function(e){if(!e||"object"!==Ju(e))return!1;if("undefined"!=typeof Error&&e instanceof Error)return!0;var t=Zu(e);return("[object Error]"===t||"[object DOMException]"===t)&&"string"==typeof e.message},ed=function(e){return!!e&&"object"===Ju(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},td=function(e){var t="";try{t=e.name}catch(n){}return"[Function "+(t||"(anonymous)")+"]"},nd=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()},rd=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: "+(Qu(c)?e(c,l+1):ud(c,1e3))),s}catch(u){return"Error"}},od=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,Yu;e.parts.push(t),e.length+=t.length},id=function(e,t){var n=e.maxLength-e.length;od(e,JSON.stringify(t.length>n?t.slice(0,n):t))},ad=function(e,t){try{return{value:e[t]}}catch(n){return{failed:!0}}},sd=function(e,t,n,r,o,i){od(e,t);for(var a=Math.min(r,100),s=0;s<a;s++)s>0&&od(e,","),o(s,i+1);r>a&&od(e,",… "+(r-a)+" more"),od(e,n)},cd=function e(t,n,r){var o=Ju(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(Qu(n)){var i="Error",a="";try{i=String(n.name||"Error"),a=String(n.message||"")}catch(f){}id(t,a?i+": "+a:i)}else if(ed(n))od(t,nd(n));else if(function(e){return!!e&&"object"===Ju(e)&&e.window===e&&!!e.document}(n))od(t,"[Window]");else{var s=Zu(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))od(t,s.slice(8,-1)+"("+("number"==typeof n.length?n.length:n.byteLength)+")");else if(r>=t.maxDepth)od(t,Array.isArray(n)?"[Array]":"[Object]");else{t.seen.push(n);try{if(Array.isArray(n))return void sd(t,"[","]",n.length,(function(r,o){var i=ad(n,r);i.failed?od(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 sd(t,"Map("+n.size+"){","}",n.size,(function(n,r){e(t,c[n][0],r),od(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 sd(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(f){u=n}if(u!==n)return void e(t,u,r)}var d=Object.keys(n),p=function(e){try{var t=Object.getPrototypeOf(e);if(!t||t===Object.prototype)return"";var n=t.constructor;return n&&"string"==typeof n.name&&"Object"!==n.name?n.name:""}catch(f){return""}}(n);sd(t,(p?p+" ":"")+"{","}",d.length,(function(r,o){id(t,d[r]),od(t,":");var i=ad(n,d[r]);i.failed?od(t,'"[unreadable]"'):e(t,i.value,o)}),r)}finally{t.seen.pop()}}else od(t,s.slice(8,-1)+"("+n.byteLength+")");else od(t,s.slice(8,-1));else od(t,String(n));else{var h=n.getTime();id(t,isNaN(h)?"Invalid Date":n.toISOString())}}else od(t,'"[Circular]"');else od(t,td(n));else od(t,n.toString());else od(t,n.toString()+"n");else od(t,String(n));else id(t,n);else od(t,"null")},ld=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{cd(r,e,0)}catch(o){if(o!==Yu)return{text:r.parts.join("")+"[unserializable]",truncated:!1}}return{text:r.parts.join(""),truncated:r.truncated}},ud=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"===Ju(e))return e.toString();if("function"==typeof e)return td(e);if(Qu(e)){var r=rd(e);return r.length>n?r.slice(0,n):r}if(ed(e))return nd(e);if("[object Date]"===Zu(e)){var o=e.getTime();return isNaN(o)?"Invalid Date":e.toISOString()}return ld(e,n,4).text}catch(i){try{return Zu(e)}catch(a){return"[unserializable]"}}},dd=function(e){try{return"bigint"==typeof e?e:"symbol"===Ju(e)?NaN:Number(e)}catch(t){return NaN}},pd=function(e){var t=dd(e);return"bigint"==typeof t?t.toString()+"n":isNaN(t)?"NaN":String(t<0?Math.ceil(t):Math.floor(t))},hd=function(e){var t=dd(e);return String("bigint"==typeof t?Number(t):t)},fd=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+=ud(l,u):"d"===c||"i"===c?r+=pd(l):"f"===c?r+=hd(l):"c"!==c&&(r+="string"==typeof l?JSON.stringify(l.slice(0,u)):ud(l,u))}else r+="%",a++}else r+=s}}for(;o<e.length&&r.length<=n;o++)r.length>0&&(r+=" "),r+=ud(e[o],Math.max(1,n-r.length));return r.length>n?r.slice(0,n):r}catch(d){return"[unserializable console arguments]"}};function gd(e){return gd="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},gd(e)}function md(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,yd(r.key),r)}}function vd(e,t,n){return(t=yd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yd(e){var t=function(e,t){if("object"!=gd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=gd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gd(t)?t:String(t)}var bd={log:"INFO",info:"INFO",debug:"INFO",warn:"WARNING",error:"ERROR"},wd="… [truncated]",kd=5001,xd=function(e,t){var n="ERROR"===t?5e3:1e3;return e.length<=n?e:e.slice(0,n-13)+wd},Sd=function(e){return e.filename?" ("+e.filename+":"+(e.lineno||0)+":"+(e.colno||0)+")":""},Cd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),vd(this,"logArray",[]),vd(this,"disabled",!1),vd(this,"started",!1),vd(this,"originalConsoleMethods",{}),vd(this,"consoleWrappers",{}),vd(this,"capturing",!1),vd(this,"errorListener",null),vd(this,"rejectionListener",null),vd(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=ud(e,kd)),!(e.length<=0)))for(this.logArray.push({log:xd(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(fd(e,kd),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(bd),o=function(){var o=r[i];e.wrapConsoleMethod(n,o,(function(e){t.capture((function(){return t.addLogWithArgs(e,bd[o])}))}))},i=0;i<r.length;i++)o();this.wrapConsoleMethod(n,"assert",(function(e){e.length>0&&e[0]||t.capture((function(){var n=fd(Array.prototype.slice.call(e,1),kd);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: "+ud(n,kd),"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"===gd(n)&&"string"==typeof n.stack&&n.stack.length>0?rd(n):null!=n?ud(n,kd)+Sd(e):String(e.message||"Script error.").replace(/^Uncaught\s+/,"")+Sd(e),this.addLog("Uncaught "+t,"ERROR")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&md(t.prototype,n),r&&md(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ed(e){return Ed="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},Ed(e)}function Id(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 Td(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Id(Object(n),!0).forEach((function(t){Od(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Id(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ld(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,Ad(r.key),r)}}function Od(e,t,n){return(t=Ad(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ad(e){var t=function(e,t){if("object"!=Ed(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ed(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ed(t)?t:String(t)}vd(Cd,"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),Od(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(Td({name:e},t||{}))}}}],(n=null)&&Ld(t.prototype,n),r&&Ld(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Rd(e){return Rd="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},Rd(e)}function Pd(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,Nd(r.key),r)}}function Dd(e,t,n){return(t=Nd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nd(e){var t=function(e,t){if("object"!=Rd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Rd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Rd(t)?t:String(t)}Od(Md,"instance",void 0);var jd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Dd(this,"customData",{}),Dd(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&&Pd(t.prototype,n),r&&Pd(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();Dd(jd,"instance",void 0);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 Fd(){Fd=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==_d(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(_d(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 Bd(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 Ud(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Bd(i,r,o,a,s,"next",e)}function s(e){Bd(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Hd(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 zd(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 zd(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 zd(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 qd=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},Wd=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+")"):Vd(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},Vd=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()}))},Gd=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){J(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()}))},$d=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){}},Xd=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)},Kd=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=Xd(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(Wd(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++)$d(e,t[n].stylesheet,t[n].styletext,t[n].styleId);return!0}))},Jd=function(e,t){return new Promise((function(n,r){return t?Kd(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(Gd(o))}return Promise.all(n)}(e).then((function(){return Kd(e,t).then((function(){n()}))})).catch((function(){console.warn("Gleap: Failed with resolving local resources. Please contact the Gleap support team."),n()}))}))},Yd=function(e,t,n){if(void 0!==e.adoptedStyleSheets)for(var r=0;r<e.adoptedStyleSheets.length;r++){var o=e.adoptedStyleSheets[r],i=Xd(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)}},Zd=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},Qd=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)},ep=["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"],tp=/^table-(row-group|header-group|footer-group|row|column-group)$/,np=["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"],rp=/^(img|video|audio|canvas|iframe|embed|object|svg)$/,op=/^(input|select|textarea)$/,ip=function(e,t,n){return e.setProperty(t,n,"important")},ap=function(e,t){return parseFloat(e.getPropertyValue(t))||0},sp=function(e,t,n){ip(e,"box-sizing","border-box"),["width","min-width","max-width"].forEach((function(n){return ip(e,n,t+"px")})),["height","min-height","max-height"].forEach((function(t){return ip(e,t,n+"px")}))},cp=function(e){return"inline"===e.display&&"auto"===e.width},lp=function(e){return"absolute"===e.position||"fixed"===e.position||"none"!==e.float},up=function(e){return!/^(visible|clip)$/.test(e.overflowX)||!/^(visible|clip)$/.test(e.overflowY)},dp=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)},pp=function(e){return e.assignedSlot||e.parentElement||e.parentNode&&e.parentNode.host||null},hp=function(e){var t=document.createRange();return t.selectNodeContents(e),"function"==typeof t.getClientRects?Array.from(t.getClientRects()):[]},fp=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+=ap(t,"padding-left")+ap(t,"padding-right")+ap(t,"border-left-width")+ap(t,"border-right-width"),r+=ap(t,"padding-top")+ap(t,"padding-bottom")+ap(t,"border-top-width")+ap(t,"border-bottom-width")),{width:n,height:r}},gp=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)}},mp=function(e){for(var t=pp(e);t;t=pp(t)){var n=window.getComputedStyle(t);if(parseFloat(n.width)>0&&parseFloat(n.height)>0)return gp(t.getBoundingClientRect(),fp(t,n))}return{x:1,y:1}},vp=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}},yp=function(e){var t=e.createElement("span");return ip(t.style,"display","inline-block"),["margin","padding","border-width"].forEach((function(e){return ip(t.style,e,"0")})),t},bp=function e(t,n,r){return dp(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=window.getComputedStyle(t);if("none"!==o.display&&!lp(o))if("contents"===o.display||cp(o))e(t,n,r);else{var i=vp(t.getBoundingClientRect(),n),a={left:i.left-ap(o,"margin-left"),right:i.right+ap(o,"margin-right"),top:i.top-ap(o,"margin-top"),bottom:i.bottom+ap(o,"margin-bottom"),verticalAlign:o.verticalAlign};0===o.display.indexOf("inline")?("baseline"!==a.verticalAlign||rp.test(t.localName)||(a.verticalAlign="middle"),r.atomicInlines.push(a)):r.blocks.push(a)}}})),r},wp=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=yp(e.ownerDocument);ip(c.style,"vertical-align",s?s.verticalAlign:"baseline"),sp(c.style,t[i].width,s?s.bottom-s.top:0),e.appendChild(c)}},kp=function e(t,n,r){dp(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(Np(n,t.ownerDocument,!0,r))}}else!function(e,t){var n=hp(t);if(n.length){var r=mp(t),o=e.ownerDocument.createElement("span");ip(o.style,"display","inline"),["margin","padding","border-width"].forEach((function(e){return ip(o.style,e,"0")})),wp(o,n.map((function(e){return vp(e,r)})),[]),e.appendChild(o)}}(t,n)}))},xp=function(e){return!("block"!==e.display&&"list-item"!==e.display||lp(e)||up(e)||/layout|paint|strict|content/.test(e.contain))},Sp=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?ap(n,"top"):0),s="top"===r?a-o:a+t.offsetHeight-i;return Math.abs(s)<=1},Cp=function(e,t,n,r){return r.push(ap(t,"margin-"+n)),!xp(t)||ap(t,"padding-"+n)||ap(t,"border-"+n+"-width")||Ep(e,dp(e),n,r),r},Ep=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)||hp(c).length>0))return!1;if(a.nodeType===Node.ELEMENT_NODE){var s=window.getComputedStyle(a);if("none"!==s.display&&!lp(s))if("contents"!==s.display){if(/^(inline|ruby)/.test(s.display)||!Sp(t,a,s,r))return!1;if(Cp(a,s,r,o),0!==a.getBoundingClientRect().height||!xp(s))return!1;Cp(a,s,"top"===r?"bottom":"top",o)}else if(!e(t,dp(a),r,o))return!1}}var c;return!0},Ip=function(e){return Math.max(0,Math.max.apply(null,e))+Math.min(0,Math.min.apply(null,e))},Tp=null,Lp=new Map,Op=function(e){var t=window.getComputedStyle(e),n=[t.fontStyle,t.fontWeight,t.fontSize,t.fontFamily].join(" ");return Lp.has(n)||((Tp=Tp||document.createElement("canvas").getContext("2d")).font=n,Lp.set(n,Tp.measureText("").fontBoundingBoxAscent)),Lp.get(n)},Ap=function e(t,n,r){var o=dp(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=hp(a);if(s.length)return s[n?s.length-1:0].top+Op(pp(a))*r.y}else if(a.nodeType===Node.ELEMENT_NODE){var c=window.getComputedStyle(a);if("none"===c.display||lp(c))continue;if(rp.test(a.localName)){if("baseline"===c.verticalAlign)return a.getBoundingClientRect().bottom+ap(c,"margin-bottom")*r.y;continue}var l=e(a,n,r);if(null!==l)return l}}return null},Mp=function(e,t){if("table-cell"===t.display)return"baseline"===t.verticalAlign?"first":null;var n=function(e){for(var t=pp(e);t&&"contents"===window.getComputedStyle(t).display;)t=pp(t);return t}(e),r=n&&window.getComputedStyle(n);if(r&&/flex|grid/.test(r.display)&&!lp(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)||rp.test(e.localName)||op.test(e.localName)?null:"inline-block"===t.display&&"button"!==e.localName?up(t)?null:"last":"first"},Rp=function(e,t,n){ip(e.style,"font-size","0"),ip(e.style,"line-height","0");var r=yp(e.ownerDocument);ip(r.style,"vertical-align",t-n+"px"),sp(r.style,0,n),e.appendChild(r)},Pp=function(e,t,n){var r=e.style,o=n.display,i="table-cell"===o,a=fp(t,n);ip(r,"display","inline"===o?"inline-block":o),i?np.forEach((function(e){return ip(r,e,n.getPropertyValue(e))})):(sp(r,a.width,a.height),ip(r,"padding","0"),ip(r,"border-width","0"),ip(r,"margin-top",Ip(Cp(t,n,"top",[]))+"px"),ip(r,"margin-bottom",Ip(Cp(t,n,"bottom",[]))+"px"));var s=Mp(t,n);if(s){var c=t.getBoundingClientRect(),l=gp(c,{width:t.offsetWidth,height:t.offsetHeight}),u=Ap(t,"last"===s,l);if(null!==u&&!isNaN(u)){var d=(u-c.top)/l.y;if(i){var p=d-t.clientTop-ap(n,"padding-top");Rp(e,p,p)}else ip(r,"display","inline-block"),Rp(e,d,a.height)}}},Dp=function(e,t){var n=e.style,r=mp(t),o=bp(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 ip(n,"display","block"),ip(n,"margin-top","0"),ip(n,"margin-bottom","0"),void sp(n,i.right-i.left,i.bottom-i.top)}ip(n,"display","inline"),ip(n,"padding","0"),ip(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&&!lp(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)}wp(e,Array.from(t.getClientRects(),(function(e){return vp(e,r)})),o.atomicInlines)},Np=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=Hd(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"),np.forEach((function(e){return r.setProperty(e,n.getPropertyValue(e))}))}else tp.test(n.display)&&kp(e,t,!0)}(o,e,i),o;ep.forEach((function(e){return ip(a,e,i.getPropertyValue(e))})),ip(a,"visibility","hidden"),"none"===s||"contents"===s||tp.test(s)?(ip(a,"display",s),"none"!==s&&kp(o,e,"contents"!==s)):e instanceof HTMLElement&&cp(i)?Dp(o,e):Pp(o,e,i)}catch(c){}return o},jp=function(){var e=Ud(Fd().mark((function e(t,n){var r,o,i,a,s,c,l;return Fd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=1,o=Zd(new Map,window.document),i=Na(n),a=null,s=function(){var e=Ud(Fd().mark((function e(t,c,l,u){var d,p,h,f,g,m,v,y,b,w,k,x,S,C;return Fd().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(d=t.nodeType==Node.ELEMENT_NODE)||!Aa(t,n)){e.next=7;break}return a=a||document.implementation.createHTMLDocument(""),p=Np(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(h=u||d&&Oa(t,n),f=function(){var e=Ud(Fd().mark((function e(t,n,r){return Fd().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,h);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=Qd(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,J(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=Ra(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++,Zd(o,t.shadowRoot),e.next=41,f(t.shadowRoot.firstChild,g,x);case 41:Yd(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,f(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()}}),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),Yd(window.document,l),e.abrupt("return",c);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),_p=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){}}},Fp=function(e,t){return new Promise(function(){var n=Ud(Fd().mark((function n(r,o){var i,a,s,c,l,u,d,p,h,f,g,m,v,y,b;return Fd().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,jp(window.document.documentElement,t);case 5:s=n.sent;try{_p(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="",h=s.querySelectorAll("base"),a=0;a<h.length;++a)h[a].href&&(p=h[a].href),h[a].remove();for(f=window.location.href.substring(0,window.location.href.lastIndexOf("/")),g=f+"/",p&&(p.startsWith("http")?g=p:(g=f+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");Jd(s,e).then((function(){var e=qd(s);r({html:e,baseUrl:f,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 Bp=Math.min,Up=Math.max,Hp=Math.round,zp=Math.floor,qp=e=>({x:e,y:e}),Wp={left:"right",right:"left",bottom:"top",top:"bottom"},Vp={start:"end",end:"start"};function Gp(e,t,n){return Up(e,Bp(t,n))}function $p(e,t){return"function"==typeof e?e(t):e}function Xp(e){return e.split("-")[0]}function Kp(e){return e.split("-")[1]}function Jp(e){return"x"===e?"y":"x"}function Yp(e){return"y"===e?"height":"width"}const Zp=new Set(["top","bottom"]);function Qp(e){return Zp.has(Xp(e))?"y":"x"}function eh(e){return Jp(Qp(e))}function th(e){return e.replace(/start|end/g,(e=>Vp[e]))}const nh=["left","right"],rh=["right","left"],oh=["top","bottom"],ih=["bottom","top"];function ah(e,t,n,r){const o=Kp(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?rh:nh:t?nh:rh;case"left":case"right":return t?oh:ih;default:return[]}}(Xp(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(th)))),i}function sh(e){return e.replace(/left|right|bottom|top/g,(e=>Wp[e]))}function ch(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 lh(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 uh(e,t,n){let{reference:r,floating:o}=e;const i=Qp(t),a=eh(t),s=Yp(a),c=Xp(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 h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Kp(t)){case"start":h[a]-=p*(n&&l?-1:1);break;case"end":h[a]+=p*(n&&l?-1:1)}return h}async function dh(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:h=0}=$p(t,e),f=ch(h),g=s[p?"floating"===d?"reference":"floating":d],m=lh(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=lh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(m.top-w.top+f.top)/b.y,bottom:(w.bottom-m.bottom+f.bottom)/b.y,left:(m.left-w.left+f.left)/b.x,right:(w.right-m.right+f.right)/b.x}}const ph=new Set(["left","top"]);function hh(){return"undefined"!=typeof window}function fh(e){return vh(e)?(e.nodeName||"").toLowerCase():"#document"}function gh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function mh(e){var t;return null==(t=(vh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function vh(e){return!!hh()&&(e instanceof Node||e instanceof gh(e).Node)}function yh(e){return!!hh()&&(e instanceof Element||e instanceof gh(e).Element)}function bh(e){return!!hh()&&(e instanceof HTMLElement||e instanceof gh(e).HTMLElement)}function wh(e){return!(!hh()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof gh(e).ShadowRoot)}const kh=new Set(["inline","contents"]);function xh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Dh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!kh.has(o)}const Sh=new Set(["table","td","th"]);function Ch(e){return Sh.has(fh(e))}const Eh=[":popover-open",":modal"];function Ih(e){return Eh.some((t=>{try{return e.matches(t)}catch(n){return!1}}))}const Th=["transform","translate","scale","rotate","perspective"],Lh=["transform","translate","scale","rotate","perspective","filter"],Oh=["paint","layout","strict","content"];function Ah(e){const t=Mh(),n=yh(e)?Dh(e):e;return Th.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Lh.some((e=>(n.willChange||"").includes(e)))||Oh.some((e=>(n.contain||"").includes(e)))}function Mh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Rh=new Set(["html","body","#document"]);function Ph(e){return Rh.has(fh(e))}function Dh(e){return gh(e).getComputedStyle(e)}function Nh(e){return yh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jh(e){if("html"===fh(e))return e;const t=e.assignedSlot||e.parentNode||wh(e)&&e.host||mh(e);return wh(t)?t.host:t}function _h(e){const t=jh(e);return Ph(t)?e.ownerDocument?e.ownerDocument.body:e.body:bh(t)&&xh(t)?t:_h(t)}function Fh(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=_h(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=gh(o);if(i){const e=Bh(a);return t.concat(a,a.visualViewport||[],xh(o)?o:[],e&&n?Fh(e):[])}return t.concat(o,Fh(o,[],n))}function Bh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Uh(e){const t=Dh(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=bh(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Hp(n)!==i||Hp(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Hh(e){return yh(e)?e:e.contextElement}function zh(e){const t=Hh(e);if(!bh(t))return qp(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Uh(t);let a=(i?Hp(n.width):n.width)/r,s=(i?Hp(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const qh=qp(0);function Wh(e){const t=gh(e);return Mh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:qh}function Vh(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Hh(e);let a=qp(1);t&&(r?yh(r)&&(a=zh(r)):a=zh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==gh(e))&&t}(i,n,r)?Wh(i):qp(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=gh(i),t=r&&yh(r)?gh(r):r;let n=e,o=Bh(n);for(;o&&r&&t!==n;){const e=zh(o),t=o.getBoundingClientRect(),r=Dh(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=gh(o),o=Bh(n)}}return lh({width:u,height:d,x:c,y:l})}function Gh(e,t){const n=Nh(e).scrollLeft;return t?t.left+n:Vh(mh(e)).left+n}function $h(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Gh(e,n),y:n.top+t.scrollTop}}const Xh=25;const Kh=new Set(["absolute","fixed"]);function Jh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=gh(e),r=mh(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=Mh();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop)}const l=Gh(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<=Xh&&(i-=a)}else l<=Xh&&(i+=l);return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=mh(e),n=Nh(e),r=e.ownerDocument.body,o=Up(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Up(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Gh(e);const s=-n.scrollTop;return"rtl"===Dh(r).direction&&(a+=Up(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(mh(e));else if(yh(t))r=function(e,t){const n=Vh(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=bh(e)?zh(e):qp(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=Wh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return lh(r)}function Yh(e,t){const n=jh(e);return!(n===t||!yh(n)||Ph(n))&&("fixed"===Dh(n).position||Yh(n,t))}function Zh(e,t,n){const r=bh(t),o=mh(t),i="fixed"===n,a=Vh(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=qp(0);function l(){c.x=Gh(o)}if(r||!r&&!i)if(("body"!==fh(t)||xh(o))&&(s=Nh(t)),r){const e=Vh(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?qp(0):$h(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 Qh(e){return"static"===Dh(e).position}function ef(e,t){if(!bh(e)||"fixed"===Dh(e).position)return null;if(t)return t(e);let n=e.offsetParent;return mh(e)===n&&(n=n.ownerDocument.body),n}function tf(e,t){const n=gh(e);if(Ih(e))return n;if(!bh(e)){let t=jh(e);for(;t&&!Ph(t);){if(yh(t)&&!Qh(t))return t;t=jh(t)}return n}let r=ef(e,t);for(;r&&Ch(r)&&Qh(r);)r=ef(r,t);return r&&Ph(r)&&Qh(r)&&!Ah(r)?n:r||function(e){let t=jh(e);for(;bh(t)&&!Ph(t);){if(Ah(t))return t;if(Ih(t))return null;t=jh(t)}return null}(e)||n}const nf={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=mh(r),s=!!t&&Ih(t.floating);if(r===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=qp(1);const u=qp(0),d=bh(r);if((d||!d&&!i)&&(("body"!==fh(r)||xh(a))&&(c=Nh(r)),bh(r))){const e=Vh(r);l=zh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?qp(0):$h(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:mh,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?Ih(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Fh(e,[],!1).filter((e=>yh(e)&&"body"!==fh(e))),o=null;const i="fixed"===Dh(e).position;let a=i?jh(e):e;for(;yh(a)&&!Ph(a);){const t=Dh(a),n=Ah(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Kh.has(o.position)||xh(a)&&!n&&Yh(e,a))?r=r.filter((e=>e!==a)):o=t,a=jh(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],c=a.reduce(((e,n)=>{const r=Jh(t,n,o);return e.top=Up(r.top,e.top),e.right=Bp(r.right,e.right),e.bottom=Bp(r.bottom,e.bottom),e.left=Up(r.left,e.left),e}),Jh(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:tf,getElementRects:async function(e){const t=this.getOffsetParent||tf,n=this.getDimensions,r=await n(e.floating);return{reference:Zh(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}=Uh(e);return{width:t,height:n}},getScale:zh,isElement:yh,isRTL:function(e){return"rtl"===Dh(e).direction}};function rf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function of(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=Hh(e),u=o||i?[...l?Fh(l):[],...Fh(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=mh(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:h}=l;if(s||t(),!p||!h)return;const f={rootMargin:-zp(d)+"px "+-zp(o.clientWidth-(u+p))+"px "+-zp(o.clientHeight-(d+h))+"px "+-zp(u)+"px",threshold:Up(0,Bp(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||rf(l,e.getBoundingClientRect())||a(),g=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(v){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(l,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),l&&!c&&f.observe(l),f.observe(t));let g=c?Vh(e):null;return c&&function t(){const r=Vh(e);g&&!rf(g,r)&&n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const af=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=Xp(n),s=Kp(n),c="y"===Qp(n),l=ph.has(a)?-1:1,u=i&&c?-1:1,d=$p(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),c?{x:h*u,y:p*l}:{x:p*l,y:h*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}}}}},sf=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}=$p(e,t),u={x:n,y:r},d=await i.detectOverflow(t,l),p=Qp(Xp(o)),h=Jp(p);let f=u[h],g=u[p];if(a){const e="y"===h?"bottom":"right";f=Gp(f+d["y"===h?"top":"left"],f,f-d[e])}if(s){const e="y"===p?"bottom":"right";g=Gp(g+d["y"===p?"top":"left"],g,g-d[e])}const m=c.fn({...t,[h]:f,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[p]:s}}}}}},cf=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:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=$p(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Xp(o),y=Qp(s),b=Xp(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),k=p||(b||!g?[sh(s)]:function(e){const t=sh(e);return[th(e),t,th(t)]}(s)),x="none"!==f;!p&&x&&k.push(...ah(s,g,f,w));const S=[s,...k],C=await c.detectOverflow(t,m),E=[];let I=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Kp(e),o=eh(e),i=Yp(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=sh(a)),[a,sh(a)]}(o,a,w);E.push(C[e[0]],C[e[1]])}if(I=[...I,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,L;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&y!==Qp(t))||I.every((e=>Qp(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}}}let n=null==(L=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:L.placement;if(!n)switch(h){case"bestFit":{var O;const e=null==(O=I.filter((e=>{if(x){const t=Qp(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{}}}},lf=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}=$p(e,t)||{};if(null==l)return{};const d=ch(u),p={x:n,y:r},h=eh(o),f=Yp(h),g=await a.getDimensions(l),m="y"===h,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[h]-p[h]-i.floating[f],k=p[h]-i.reference[h],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let S=x?x[b]:0;S&&await(null==a.isElement?void 0:a.isElement(x))||(S=s.floating[b]||i.floating[f]);const C=w/2-k/2,E=S/2-g[f]/2-1,I=Bp(d[v],E),T=Bp(d[y],E),L=I,O=S-g[f]-T,A=S/2-g[f]/2+C,M=Gp(L,A,O),R=!c.arrow&&null!=Kp(o)&&A!==M&&i.reference[f]/2-(A<L?I:T)-g[f]/2<0,P=R?A<L?A-L:A-O:0;return{[h]:p[h]+P,data:{[h]:M,centerOffset:A-M-P,...R&&{alignmentOffset:P}},reset:R}}}),uf=(e,t,n)=>{const r=new Map,o={platform:nf,...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}=uh(l,r,c),p=r,h={},f=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:h,rects:l,platform:{...a,detectOverflow:null!=(g=a.detectOverflow)?g:dh},elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,h={...h,[n]:{...h[n],...b}},w&&f<=50&&(f++,"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}=uh(l,p,c))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var df=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},pf=["notcontains","isnot"],hf=function(e){return Boolean(e&&e.pageFilter&&e.pageFilter.length>0)},ff=function(e,t){var n=(t.pageRules&&t.pageRules.length>0?t.pageRules:t.pageFilter?[{pageFilter:t.pageFilter,pageFilterType:t.pageFilterType}]:[]).filter(hf);if(0===n.length)return!0;var r=n.filter((function(e){return!pf.includes(e.pageFilterType)})),o=n.filter((function(e){return pf.includes(e.pageFilterType)})),i=0===r.length||r.some((function(t){return df(e,t.pageFilter,t.pageFilterType)})),a=0===o.length||o.every((function(t){return df(e,t.pageFilter,t.pageFilterType)}));return i&&a};function gf(e){return gf="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},gf(e)}function mf(e){return function(e){if(Array.isArray(e))return vf(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 vf(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 vf(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 vf(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 yf(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,wf(r.key),r)}}function bf(e,t,n){return(t=wf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wf(e){var t=function(e,t){if("object"!=gf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=gf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gf(t)?t:String(t)}var kf=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),bf(this,"tooltips",[]),bf(this,"filteredTooltips",[]),bf(this,"lastUrl",null),bf(this,"elementToFloatingUIMap",new WeakMap),bf(this,"elementToTooltipMap",new WeakMap),bf(this,"nextId",0),bf(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(he(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)}}})),bf(this,"updateFilteredTooltips",(function(){t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),bf(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?ff(e,{pageRules:t.pageRules}):!t.page||0===t.page.length||!!df(e,t.page,t.pageType)}))})),bf(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){}}})),bf(this,"load",(function(){var e=t,n=Lf.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(mf(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=of(e,r,(function(){uf(e,r,{placement:"left"===n.posX?"left":"right",middleware:[af(10),cf(),sf(),lf({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(h){}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&&yf(t.prototype,n),r&&yf(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 Sf(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 Cf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sf(Object(n),!0).forEach((function(t){If(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ef(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,Tf(r.key),r)}}function If(e,t,n){return(t=Tf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tf(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)}bf(kf,"instance",void 0);var Lf=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,"region",Ct),If(this,"apiUrl",St[Ct].apiUrl),If(this,"wsApiUrl",St[Ct].wsApiUrl),If(this,"realtimeHost",void 0),If(this,"sdkKey",null),If(this,"updatingSession",!1),If(this,"fileRefreshTimeout",null),If(this,"useCookies",!0),If(this,"localStorageDisabled",!1),If(this,"session",{gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0}),If(this,"ready",!1),If(this,"onSessionReadyListener",[]),If(this,"lastIdentify",null),If(this,"identifyInFlight",!1),If(this,"setOnSessionReady",(function(e){t.ready?e():t.onSessionReadyListener.push(e)})),If(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))})),If(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&&Ht.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,ig.getInstance().sendMessage({name:"session-cleared"},!0),jm.getInstance().clearAllNotifications(!1),jm.getInstance().setNotificationCount(0),lr.getInstance().removeBannerUI(),Rg.getInstance().hideModal(),r&&t.scheduleSessionRetry(n)})),If(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)}})),If(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=ig.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()}})),If(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=Cf(Cf({},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&&Ht.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&&Ht.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),c&&(setTimeout((function(){A.getInstance().clearCache(),x.getInstance().clearCache(),Pv.getInstance().restart();var e=kf.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,h=d.userData,f=d.userHash;null===(l=t.identifySession(p,h,f,!0))||void 0===l||null===(u=l.catch)||void 0===u||u.call(l,(function(){}))}}})),If(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){}})),If(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:Xv.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}))})),If(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)})),If(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})),If(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:Cf(Cf({},e),{},{lang:Xv.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"}),type:"js",sdkVersion:"19.2.0",ws:!0}))}))}))}})),If(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=Cf({},n);n.customData&&(delete a.customData,a=Cf(Cf({},a),n.customData)),t.send(JSON.stringify(Cf(Cf({},a),{},{userId:e,userHash:r,lang:Xv.getInstance().getActiveLanguage(),deviceType:Z(),platform:"web"})))}))}))}})),If(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}))}))}))})),If(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(St,t)?t:null}(e);if(!t)return console.warn('Gleap: Unknown region "'.concat(e,'". Supported regions: ').concat(Object.keys(St).join(", "),". Region not changed.")),!1;var n=St[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=[],ig.getInstance().sendSessionUpdate()}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Ef(t.prototype,n),r&&Ef(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Of(e){return Of="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},Of(e)}function Af(){Af=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:I(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",h="suspendedYield",f="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};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 E(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"==Of(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 I(t,n,r){var o=p;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var 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=f;var l=d(t,n,r);if("normal"===l.type){if(o=r.done?g:h,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(Of(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(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new E(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 Mf(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 Rf(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Mf(i,r,o,a,s,"next",e)}function s(e){Mf(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Pf(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 Df(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 Df(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 Df(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 Nf(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,_f(r.key),r)}}function jf(e,t,n){return(t=_f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _f(e){var t=function(e,t){if("object"!=Of(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Of(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Of(t)?t:String(t)}If(Lf,"instance",void 0);var Ff=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),jf(this,"rerender",void 0),jf(this,"stream",void 0),jf(this,"mediaRecorder",void 0),jf(this,"audioMuted",!1),jf(this,"audioAvailable",!0),jf(this,"available",!0),jf(this,"isRecording",!1),jf(this,"file",null),jf(this,"maxRecordTime",e.MAX_RECORD_TIME),jf(this,"recordTime",0),jf(this,"recordingTimer",null),jf(this,"permissionErrorText",""),jf(this,"_displayVideoTrack",null),jf(this,"_displayStream",null),jf(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=Pf(e.MIME_TYPES);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(window.MediaRecorder&&MediaRecorder.isTypeSupported(r))return r}}catch(fy){n.e(fy)}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=Rf(Af().mark((function t(){var n,r;return Af().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.releaseCapture(),this.rerender()}}},{key:"releaseCapture",value:function(){this.recordingTimer&&(clearInterval(this.recordingTimer),this.recordingTimer=null),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}},{key:"startAudioRecording",value:(i=Rf(Af().mark((function e(){var t,n,r,o;return Af().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.isRecording?r.stopScreenRecording():r.releaseCapture()}),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=Rf(Af().mark((function e(t){return Af().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",Lf.getInstance().apiUrl+"/uploads/sdk"),Lf.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&&Nf(t.prototype,n),r&&Nf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Bf(e){return Bf="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},Bf(e)}function Uf(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 Hf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uf(Object(n),!0).forEach((function(t){qf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zf(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,Wf(r.key),r)}}function qf(e,t,n){return(t=Wf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wf(e){var t=function(e,t){if("object"!=Bf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Bf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bf(t)?t:String(t)}jf(Ff,"MAX_RECORD_TIME",120),jf(Ff,"MAX_WIDTH",3072),jf(Ff,"MAX_HEIGHT",1728),jf(Ff,"IDEAL_FRAME_RATE",10),jf(Ff,"MAX_FRAME_RATE",24),jf(Ff,"CHUNK_INTERVAL",200),jf(Ff,"TIMER_UPDATE_INTERVAL",1e3),jf(Ff,"RERENDER_DELAY",100),jf(Ff,"MIME_TYPES",["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm","video/mp4"]),jf(Ff,"SELECTORS",{PREVIEW_VIDEO:".bb-capture-preview video",TIMER_LABEL:".bb-capture-toolbar-item-timer"});var Vf=[["webReplay"],["screenshotData","networkLogs"]],Gf=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),qf(this,"excludeData",{}),qf(this,"type","BUG"),qf(this,"priority","LOW"),qf(this,"customData",{}),qf(this,"ticketAttributes",{}),qf(this,"metaData",{}),qf(this,"consoleLog",[]),qf(this,"networkLogs",[]),qf(this,"customEventLog",[]),qf(this,"formData",{}),qf(this,"isSilent",!1),qf(this,"outboundId",void 0),qf(this,"screenshotData",void 0),qf(this,"webReplay",void 0),qf(this,"screenRecordingUrl",void 0),qf(this,"screenRecordingData",void 0),qf(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=py.getInstance();this.customData=jd.getInstance().getCustomData(),this.metaData=Eg.getInstance().getMetaData(),this.consoleLog=Cd.getInstance().getLogs(),this.networkLogs=Mm.getInstance().getRequests(),this.customEventLog=Pv.getInstance().getEventArray(),this.ticketAttributes=jd.getInstance().getTicketAttributes();var n=[],r=t.getGlobalDataItem("webReplay");null!==r&&(this.webReplay=r);var o,i,a,s,c,l=this.isSilent?null:t.getGlobalDataItem("screenRecordingData");if(null!=l){this.screenRecordingData=l;var u=Ff.uploadScreenRecording(l).then((function(t){t&&(e.screenRecordingUrl=t)}));n.push(u)}if(!this.excludeData||!this.excludeData.screenshot){var d=(s=t.isLiveMode(),c=Ga.getInstance().customOptions,Fp(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:Hf(Hf({},this.ticketAttributes),this.formData),isSilent:this.isSilent,outbound:this.outboundId,screenshotData:this.screenshotData,webReplay:this.webReplay,screenRecordingUrl:this.screenRecordingUrl,spamToken:this.spamToken},t=qv.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:"forgetSentScreenRecording",value:function(){try{var e=py.getInstance();this.screenRecordingData&&e.getGlobalDataItem("screenRecordingData")===this.screenRecordingData&&e.setGlobalDataItem("screenRecordingData",null)}catch(t){}}},{key:"sendFeedback",value:function(){var e=this,t=this;return new Promise((function(n,r){e.takeSnapshot().then((function(){var o=e.getData();!function e(i){var a=new XMLHttpRequest;a.open("POST",Lf.getInstance().apiUrl+"/bugs/v2"),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),Lf.getInstance().injectSession(a),a.onerror=function(e){r()},a.onreadystatechange=function(s){if(4===a.readyState)if(200===a.status||201===a.status){t.forgetSentScreenRecording();try{var c=JSON.parse(a.responseText);n(c)}catch(l){r()}}else 413===a.status&&i<Vf.length?(Vf[i].forEach((function(e){return delete o[e]})),e(i+1)):r()},a.send(JSON.stringify(o))}(0)})).catch((function(e){console.log("Failed to take snapshot",e),r()}))}))}}],n&&zf(t.prototype,n),r&&zf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 Xf(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){Kf(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 Kf(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Jf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Jf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Jf(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 Jf(e){return Jf="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},Jf(e)}var Yf={"survey-shown":"gleap_survey_shown","survey-step-viewed":"gleap_survey_step_viewed","survey-answered":"gleap_survey_answered","survey-completed":"gleap_survey_completed"},Zf=function(e,t){var n=Yf[e];if(!n||"undefined"==typeof window||!function(e){if(e&&!0===e.forward)return!0;try{var t=Ku.getInstance().getFlowConfig();return!(!t||!0!==t.surveyAnalyticsForwarding)}catch(n){return!1}}(t))return!1;var r=function(e){var t={};return e&&"object"===Jf(e)?(null!=e.surveyId&&(t.survey_id=String(e.surveyId)),"string"==typeof e.surveyName&&e.surveyName&&(t.survey_name=e.surveyName),"number"==typeof e.stepIndex&&Number.isFinite(e.stepIndex)&&(t.step_index=e.stepIndex),"string"==typeof e.key&&e.key&&(t.block_key=e.key),t):t}(t);try{Array.isArray(window.dataLayer)&&window.dataLayer.push(Xf({event:n},r))}catch(o){}try{"function"==typeof window.gtag&&window.gtag("event",n,Xf({},r))}catch(o){}try{"function"==typeof window.fbq&&window.fbq("trackCustom",n,Xf({},r))}catch(o){}return!0};function Qf(e){return Qf="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},Qf(e)}function eg(e){return function(e){if(Array.isArray(e))return tg(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 tg(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 tg(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 tg(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 ng(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,og(r.key),r)}}function rg(e,t,n){return(t=og(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function og(e){var t=function(e,t){if("object"!=Qf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Qf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qf(t)?t:String(t)}var ig=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),rg(this,"frameUrl","https://messenger-app.gleap.io"),rg(this,"gleapFrameContainer",null),rg(this,"gleapFrame",null),rg(this,"comReady",!1),rg(this,"injectedFrame",!1),rg(this,"widgetOpened",!1),rg(this,"listeners",[]),rg(this,"appMode","widget"),rg(this,"markerManager",void 0),rg(this,"escListener",void 0),rg(this,"frameHeight",0),rg(this,"sendingFeedback",!1),rg(this,"queue",[]),rg(this,"widgetExpanded",void 0),rg(this,"surveyKeyboard",!1),rg(this,"surveySheetLifted",!1),rg(this,"appliedWidgetExpanded",!1),rg(this,"lastWidgetSizeUpdate",null),rg(this,"captureHidden",!1),rg(this,"frameHost",null),rg(this,"surveyAwaitingHeight",!1),rg(this,"surveyRevealTimeout",null),rg(this,"surveyLegacy",!1),rg(this,"surveyCorners",null),rg(this,"surveySurface",null),rg(this,"surveyDark",null),rg(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})),rg(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")})),rg(this,"injectFrame",(function(){t.injectedFrame||(t.injectedFrame=!0,t.autoWhiteListCookieManager(),se((function(){Ku.getInstance().onConfigLoaded((function(){Ku.getInstance().applyStylesFromConfig();var e=document.createElement("div"),n=t.isAutoHeightSurvey()&&t.surveyAwaitingHeight?"gleap-frame-container--measuring":"gleap-frame-container--hidden";e.className="gleap-frame-container ".concat(n," 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,"&").replace(/</g,"<").replace(/>/g,">"):"",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"> </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,""");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 h=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(h?'\n <div class="gleap-frame-loader-ramp"></div>':"","\n </div>\n </div>")}if(o){var f=String(r.bgImage).replace(/"/g,"""),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(f,'" 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>")}(Ku.getInstance().getFlowConfig()),'<iframe class="gleap-frame" scrolling="yes" allow="autoplay; encrypted-media; fullscreen; microphone *; display-capture *; camera *;" frameborder="0"></iframe></div>'),(t.frameHost&&document.body.contains(t.frameHost)?t.frameHost:document.body).appendChild(e);var r=e.querySelector(".gleap-frame-loader-image");if(r){var o=function(){var t=e.querySelector(".gleap-frame-loader-image-wrap");t&&t.classList.add("gleap-frame-loader-image-wrap--loaded")};r.complete&&r.naturalWidth>0?o():r.addEventListener("load",o)}t.gleapFrameContainer=e,t.gleapFrame=document.querySelector(".gleap-frame"),K(t.gleapFrame,t.frameUrl),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),rg(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()}}))})),rg(this,"updateFrameStyle",(function(){if(t.gleapFrameContainer){for(var e="gleap-frame-container--survey",n="gleap-frame-container--extended",r="gleap-frame-container--survey-full",o="gleap-frame-container--survey-page",i="gleap-frame-container--survey-legacy",a="gleap-frame-container--corners-sharp",s="gleap-frame-container--corners-pill",c="gleap-frame-container--classic",l="gleap-frame-container--classic-left",u="gleap-frame-container--modern-left",d="gleap-frame-container--no-button",p="gleap-frame-container--expanded",h=[c,l,p,n,u,d,e,r,o,i,a,s],f=0;f<h.length;f++)t.gleapFrameContainer.classList.remove(h[f]);var g=void 0,m=Ku.getInstance().getFlowConfig();m.feedbackButtonPosition!==N.FEEDBACK_BUTTON_CLASSIC&&m.feedbackButtonPosition!==N.FEEDBACK_BUTTON_CLASSIC_BOTTOM||(g=c),m.feedbackButtonPosition===N.FEEDBACK_BUTTON_CLASSIC_LEFT&&(g=l),m.feedbackButtonPosition===N.FEEDBACK_BUTTON_BOTTOM_LEFT&&(g=u),null===N.getInstance().buttonHidden?m.feedbackButtonPosition===N.FEEDBACK_BUTTON_NONE&&(g=d):N.getInstance().buttonHidden&&(g=d),g&&t.gleapFrameContainer.classList.add(g),"survey"===t.appMode&&t.gleapFrameContainer.classList.add(e),t.isFullSurvey()&&t.gleapFrameContainer.classList.add(r),"survey_page"===t.appMode&&t.gleapFrameContainer.classList.add(o),t.surveyLegacy&&t.isSurvey()&&t.gleapFrameContainer.classList.add(i),t.surveyCorners&&t.isSurvey()&&!t.surveyLegacy&&t.gleapFrameContainer.classList.add("sharp"===t.surveyCorners?a:s);var v=t.isSurvey()&&!t.surveyLegacy,y=t.gleapFrameContainer.style;v&&t.surveySurface?y.setProperty("--gleap-survey-surface",t.surveySurface):y.removeProperty("--gleap-survey-surface"),t.gleapFrameContainer.classList.toggle("gleap-frame-container--survey-dark",v&&!0===t.surveyDark),t.gleapFrameContainer.classList.toggle("gleap-frame-container--survey-light",v&&!1===t.surveyDark),"extended"===t.appMode&&t.gleapFrameContainer.classList.add(n),t.appliedWidgetExpanded=t.isWidgetExpanded(),t.appliedWidgetExpanded&&t.gleapFrameContainer.classList.add(p),t.gleapFrameContainer.setAttribute("dir",Xv.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{if(window.addEventListener("resize",n),window.addEventListener("resize",(function(){return t.handleViewportResize()})),n(),document.addEventListener("keydown",(function(e){return t.forwardSurveyKey(e)})),window.visualViewport){var r=null,o=function(){null===r&&(r=window.requestAnimationFrame((function(){r=null,t.updateSurveyKeyboardInset()})))};window.visualViewport.addEventListener("resize",o),window.visualViewport.addEventListener("scroll",o)}}catch(i){}}}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||"survey_page"===this.appMode}},{key:"isFullSurvey",value:function(){return"survey_full"===this.appMode||"survey_web"===this.appMode}},{key:"isLegacyFullSurvey",value:function(){return this.surveyLegacy&&this.isFullSurvey()}},{key:"isAutoHeightSurvey",value:function(){return"survey"===this.appMode||"survey_page"===this.appMode||this.isLegacyFullSurvey()}},{key:"setAppMode",value:function(e){this.appMode=e,this.surveyLegacy=!1,this.surveyCorners=null,this.surveySurface=null,this.surveyDark=null,this.updateFrameStyle(),this.surveyAwaitingHeight=this.isAutoHeightSurvey()&&(!this.comReady||!this.frameHeight),this.applyInnerSize();var t=this.gleapFrameContainer;this.surveyAwaitingHeight&&t&&t.classList.contains("gleap-frame-container--hidden")?(t.classList.add("gleap-frame-container--measuring"),t.classList.remove("gleap-frame-container--hidden")):!this.surveyAwaitingHeight&&t&&t.classList.contains("gleap-frame-container--measuring")&&(t.classList.remove("gleap-frame-container--measuring"),this.widgetOpened||t.classList.add("gleap-frame-container--hidden"),this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null)),this.sendWidgetSizeUpdate(),this.isSurvey()&&this.sendSafeAreaInsets()}},{key:"setFrameHost",value:function(e){var t=e&&1===e.nodeType?e:null;this.frameHost=t;var n=this.gleapFrameContainer;if(n&&"undefined"!=typeof document){var r=t||document.body;n.parentNode!==r&&(this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.unregisterEscListener(),this.destroy(),this.comReady=!1,this.frameHeight=0,this.lastWidgetSizeUpdate=null)}}},{key:"applyInnerSize",value:function(){var e=this.gleapFrameContainer?this.gleapFrameContainer.querySelector(".gleap-frame-container-inner"):null;if(e){if("survey_page"===this.appMode)return e.style.maxHeight="none",void(e.style.height=this.frameHeight>0?"".concat(this.frameHeight,"px"):"");e.style.height="","survey"===this.appMode||this.isLegacyFullSurvey()?e.style.maxHeight=this.frameHeight>0?"".concat(this.frameHeight,"px"):"":this.isFullSurvey()?e.style.maxHeight="none":e.style.maxHeight="".concat(700,"px")}}},{key:"getSafeAreaInsets",value:function(){var e={top:0,right:0,bottom:0,left:0};try{if("undefined"==typeof document||!document.body||"function"!=typeof window.getComputedStyle)return e;var t=document.createElement("div");t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="0",t.style.height="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.paddingTop="env(safe-area-inset-top, 0px)",t.style.paddingRight="env(safe-area-inset-right, 0px)",t.style.paddingBottom="env(safe-area-inset-bottom, 0px)",t.style.paddingLeft="env(safe-area-inset-left, 0px)",document.body.appendChild(t);var n=window.getComputedStyle(t);e.top=parseFloat(n.paddingTop)||0,e.right=parseFloat(n.paddingRight)||0,e.bottom=parseFloat(n.paddingBottom)||0,e.left=parseFloat(n.paddingLeft)||0,t.remove()}catch(r){}return e}},{key:"forwardSurveyKey",value:function(e){try{if(!this.surveyKeyboard||"survey_page"!==this.appMode||!this.comReady)return;if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey)return;var t=e.target,n=t&&t.tagName;if("INPUT"===n||"TEXTAREA"===n||"SELECT"===n||t&&t.isContentEditable)return;var r=e.key;if(!/^[a-z0-9]$/i.test(r)&&"Enter"!==r&&"ArrowUp"!==r&&"ArrowDown"!==r)return;if("Enter"===r&&("BUTTON"===n||"A"===n))return;e.preventDefault(),this.sendMessage({name:"survey-key",data:{key:r,shiftKey:e.shiftKey}})}catch(o){}}},{key:"updateSurveyKeyboardInset",value:function(){try{var e=this.gleapFrameContainer;if(!e)return;var t=window.visualViewport,n="survey"===this.appMode&&!this.surveyLegacy&&window.innerWidth<=450,r=t?Math.max(0,window.innerHeight-(t.height+t.offsetTop)):0;if(!n||!t||r<80){if(!this.surveySheetLifted)return;this.surveySheetLifted=!1;var o=e.querySelector(".gleap-frame-container-inner");return e.style.removeProperty("bottom"),e.style.removeProperty("max-height"),o&&o.style.removeProperty("max-height"),void this.sendSheetViewport(0,!1)}var i=e.querySelector(".gleap-frame-container-inner"),a=Math.max(160,t.height-24);this.surveySheetLifted=!0,e.style.setProperty("bottom",r+8+"px","important"),e.style.setProperty("max-height",a+"px","important"),i&&i.style.setProperty("max-height",a-15+"px","important"),this.sendSheetViewport(a-15,!0)}catch(s){}}},{key:"sendSheetViewport",value:function(e,t){var n={maxHeight:Math.max(0,Math.floor(e)),keyboard:!!t},r=this.lastSheetViewport;this.comReady&&(r?r.maxHeight!==n.maxHeight||r.keyboard!==n.keyboard:n.keyboard)&&(this.lastSheetViewport=n,this.sendMessage({name:"sheet-viewport",data:n}))}},{key:"sendSafeAreaInsets",value:function(){this.comReady&&this.sendMessage({name:"survey-safe-area",data:this.getSafeAreaInsets()})}},{key:"revealSurvey",value:function(){this.surveyAwaitingHeight=!1,this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null);var e=this.gleapFrameContainer;e&&e.classList.remove("gleap-frame-container--measuring")}},{key:"scrollSurveyPageIntoView",value:function(e){try{var t=this.gleapFrameContainer;if("survey_page"!==this.appMode||!t||"undefined"==typeof window)return;var n=t.getBoundingClientRect().top;if(n>=0)return;window.scrollTo({top:Math.max(0,window.scrollY+n-16),behavior:e?"smooth":"auto"})}catch(r){}}},{key:"setSurveyLegacy",value:function(){this.isSurvey()&&!this.surveyLegacy&&(this.surveyLegacy=!0,this.updateFrameStyle(),this.applyInnerSize())}},{key:"setSurveyCorners",value:function(e){var t="sharp"===e||"pill"===e?e:null;t!==this.surveyCorners&&(this.surveyCorners=t,this.updateFrameStyle())}},{key:"setSurveyTheme",value:function(e){var t=e&&"string"==typeof e.surface&&/^#[0-9a-f]{3,8}$/i.test(e.surface)?e.surface:null,n=e&&"boolean"==typeof e.dark?e.dark:null,r=t!==this.surveySurface||n!==this.surveyDark;this.surveySurface=t,this.surveyDark=n;var o=e?e.corners:null;("sharp"===o||"pill"===o?o:null)!==this.surveyCorners?this.setSurveyCorners(o):r&&this.updateFrameStyle()}},{key:"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=Ku.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(),this.widgetOpened&&this.isFullSurvey()&&this.sendSafeAreaInsets()}},{key:"registerEscListener",value:function(){var e=this;this.escListener||this.captureHidden||"survey_page"===this.appMode||(this.escListener=function(t){if("Escape"===(t=t||window.event).key){var n=document.querySelectorAll(".gleap-image-view");if(n.length>0)return void n[n.length-1].remove();e.hideWidget()}},document.addEventListener("keydown",this.escListener))}},{key:"unregisterEscListener",value:function(){this.escListener&&(document.removeEventListener("keydown",this.escListener),this.escListener=null)}},{key:"destroy",value:function(){this.gleapFrame&&this.gleapFrame.remove(),this.gleapFrameContainer&&this.gleapFrameContainer.remove(),this.injectedFrame=!1,this.widgetOpened=!1,this.markerManager=void 0,this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null),this.gleapFrameContainer=null,this.gleapFrame=null,this.captureHidden=!1;try{wu&&wu.getInstance().onWidgetDestroyed()}catch(e){}}},{key:"setCaptureHidden",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.captureHidden=!!e;var n=this.gleapFrameContainer;if(n&&n.classList.toggle("gleap-frame-container--capture-hidden",this.captureHidden),this.captureHidden)return this.unregisterEscListener(),void this.setCaptureEditorOpen(!1);n&&(this.widgetOpened?this.registerEscListener():t&&this.showWidget())}},{key:"isCaptureHidden",value:function(){return this.captureHidden}},{key:"setCaptureEditorOpen",value:function(e){this.gleapFrameContainer&&this.gleapFrameContainer.classList.toggle("gleap-frame-container--capture-editor",!!e)}},{key:"sendCaptureCapabilities",value:function(){if(this.comReady)try{this.sendMessage({name:"capture-capabilities",data:tr()})}catch(e){}}},{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.isAutoHeightSurvey()&&this.surveyAwaitingHeight?(this.gleapFrameContainer.classList.add("gleap-frame-container--measuring"),this.surveyRevealTimeout||(this.surveyRevealTimeout=setTimeout((function(){n.surveyRevealTimeout=null,n.revealSurvey()}),1200))):this.gleapFrameContainer.classList.remove("gleap-frame-container--measuring"),this.gleapFrameContainer.classList.remove("gleap-frame-container--hidden"),e?this.gleapFrameContainer.classList.add(r):this.gleapFrameContainer.classList.remove(r),setTimeout((function(){var e;null===(e=n.gleapFrameContainer)||void 0===e||e.classList.add("gleap-frame-container--animate")}),500)),this.widgetOpened=!0,this.updateUI()}}},{key:"runWidgetShouldOpenCallback",value:function(){if(this.gleapFrameContainer&&(this.workThroughQueue(),py.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),this.showFrameContainer(!1),this.updateWidgetStatus(),Ht.notifyEvent("open"),this.registerEscListener(),this.isFullSurvey()&&!this.isLegacyFullSurvey()))try{var e=this.gleapFrameContainer.querySelector(".gleap-frame");e&&e.focus({preventScroll:!0})}catch(t){}}},{key:"updateUI",value:function(){jm.getInstance().clearAllNotifications(this.isSurvey()),N.getInstance().updateNotificationBadge(0),N.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&&"survey_page"!==this.appMode){if(this.hideMarkerManager(),this.setCaptureEditorOpen(!1),this.gleapFrameContainer){var n=this.gleapFrameContainer;n.classList.remove("gleap-frame-container--animate"),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null),this.surveyRevealTimeout&&(clearTimeout(this.surveyRevealTimeout),this.surveyRevealTimeout=null),n.classList.contains("gleap-frame-container--measuring")?(n.classList.remove("gleap-frame-container--measuring"),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(),N.getInstance().updateFeedbackButtonState(),Ht.notifyEvent("close"),jm.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:Lf.getInstance().getSession(),apiUrl:Lf.getInstance().apiUrl,realtimeHost:Lf.getInstance().realtimeHost,sdkKey:Lf.getInstance().sdkKey}})}},{key:"sendConfigUpdate",value:function(){this.comReady&&(this.sendMessage({name:"config-update",data:{config:Ku.getInstance().getFlowConfig(),aiTools:Jt.getInstance().getAgentTools(),agentTools:Jt.getInstance().getAgentTools(),overrideLanguage:Xv.getInstance().getOverrideLanguage()}}),this.updateFrameStyle(),this.sendWidgetSizeUpdate(!0))}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new wg(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=eg(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.sendCaptureCapabilities(),e.workThroughQueue(),setTimeout((function(){e.runWidgetShouldOpenCallback()}),300)),"play-ping"===t.name&&Un.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){var n=parseInt(t.data,10);n>0&&(e.frameHeight=n,e.isAutoHeightSurvey()&&(e.applyInnerSize(),e.revealSurvey()))}if("survey-legacy"===t.name&&e.setSurveyLegacy(),"survey-theme"===t.name&&t.data&&e.setSurveyTheme(t.data),"survey-scroll-into-view"===t.name&&e.scrollSurveyPageIntoView(t.data&&!1!==t.data.smooth),"survey-shown"!==t.name&&"survey-step-viewed"!==t.name&&"survey-answered"!==t.name&&"survey-completed"!==t.name&&"survey-closed"!==t.name||(Ht.notifyEvent(t.name,t.data||{}),Zf(t.name,t.data||{})),"notify-event"===t.name){Ht.notifyEvent(t.data.type,t.data.data);var r=t.data&&"outbound-sent"===t.data.type?t.data.data:null;if(r&&r.outboundId&&r.responseId){var o=Object.assign({},r.formData||{});delete o.reportedBy,py.trackEvent("outbound-".concat(r.outboundId,"-submitted"),o)}}if("cleanup-drawings"===t.name&&e.hideMarkerManager(),"open-url"===t.name){var i=t.data,a=!!t.newTab;e.urlHandler(i,a)}var s;if("start-product-tour"===t.name&&py.startProductTour(null===(s=t.data)||void 0===s?void 0:s.tourId,!0),"run-custom-action"===t.name&&Md.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&&(N.getInstance().showingRedDot=!0,N.getInstance().updateRedDot(!0)),"video-call-left"===t.name&&(N.getInstance().showingRedDot=!1,N.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 c,l=t.data;Ht.notifyEvent("checklist-loaded",{checklistId:l.id,outboundId:null===(c=l.outbound)||void 0===c?void 0:c.id,completedSteps:l.completedSteps,status:l.status,data:l})}if("checklist-step-completed"===t.name){var u,d=t.data,p=d.checklistData,h=d.step,f=d.index;Ht.notifyEvent("checklist-step-completed",{checklistId:p.id,outboundId:null===(u=p.outbound)||void 0===u?void 0:u.id,stepId:h.id,stepIndex:f,step:h,completedSteps:p.completedSteps,status:p.status,data:p})}if("checklist-completed"===t.name){var g,m=t.data;Ht.notifyEvent("checklist-completed",{checklistId:m.id,outboundId:null===(g=m.outbound)||void 0===g?void 0:g.id,completedSteps:m.completedSteps,status:m.status,data:m})}if("send-feedback"===t.name){if(e.sendingFeedback)return;e.sendingFeedback=!0;var v=t.data.formData,y=t.data.action,b=t.data.outboundId,w=t.data.spamToken;new Gf(y.feedbackType,"MEDIUM",v,!1,y.excludeData,b,w).sendFeedback().then((function(t){if(setTimeout((function(){e.sendingFeedback=!1}),1e3),e.sendMessage({name:"feedback-sent",data:t}),Ht.notifyEvent("feedback-sent",v),b&&b.length>0){Ht.notifyEvent("outbound-sent",{outboundId:b,outbound:y,formData:v});try{delete v.reportedBy}catch(n){}py.trackEvent("outbound-".concat(b,"-submitted"),v)}})).catch((function(t){setTimeout((function(){e.sendingFeedback=!1,e.sendMessage({name:"feedback-sending-failed",data:"Something went wrong, please try again."}),Ht.notifyEvent("error-while-sending")}),1e3)}))}"start-screen-drawing"===t.name&&e.showDrawingScreen(t.data),!wu||"capture-start"!==t.name&&"capture-cancel"!==t.name&&"capture-editor"!==t.name&&"capture-done"!==t.name||wu.getInstance().handleMessengerMessage(t)})),window.addEventListener("message",(function(t){var n=lr.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:jd.getInstance().getCustomData(),metaData:Eg.getInstance().getMetaData(),consoleLog:Cd.getInstance().getLogs(),networkLogs:Mm.getInstance().getRequests(),customEventLog:Pv.getInstance().getEventArray(),formData:jd.getInstance().getTicketAttributes()},r=qv.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&&ng(t.prototype,n),r&&ng(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ag(e){return ag="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},ag(e)}function sg(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,lg(r.key),r)}}function cg(e,t,n){return(t=lg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lg(e){var t=function(e,t){if("object"!=ag(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ag(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ag(t)?t:String(t)}rg(ig,"instance",void 0);var ug=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),cg(this,"rerender",void 0),cg(this,"svgElement",null),cg(this,"path",null),cg(this,"strPath",void 0),cg(this,"strokeWidth",12),cg(this,"strokeWidthRect",6),cg(this,"bufferSize",4),cg(this,"buffer",[]),cg(this,"startPoint",null),cg(this,"tool","rect"),cg(this,"color","#EB144C"),cg(this,"mouseDown",null),cg(this,"mouseMove",null),cg(this,"mouseUp",null),cg(this,"resizeListener",null),cg(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&&sg(t.prototype,n),r&&sg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function dg(e){return dg="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},dg(e)}function pg(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,fg(r.key),r)}}function hg(e,t,n){return(t=fg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fg(e){var t=function(e,t){if("object"!=dg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=dg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dg(t)?t:String(t)}var gg=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),hg(this,"keys",{37:1,38:1,39:1,40:1}),hg(this,"supportsPassive",!1),hg(this,"wheelOpt",!!this.supportsPassive&&{passive:!1}),hg(this,"wheelEvent","onwheel"in document.createElement("div")?"wheel":"mousewheel"),hg(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}}])&&pg(t.prototype,n),r&&pg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function mg(e){return mg="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},mg(e)}function vg(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,bg(r.key),r)}}function yg(e,t,n){return(t=bg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bg(e){var t=function(e,t){if("object"!=mg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=mg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==mg(t)?t:String(t)}hg(gg,"instance",void 0);var wg=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),yg(this,"type","screenshot"),yg(this,"dragCursor",null),yg(this,"screenRecorder",null),yg(this,"callback",null),yg(this,"screenDrawer",null),yg(this,"escListener",null),yg(this,"pageLeaveListener",null),yg(this,"overrideLanguage",py.getInstance().overrideLanguage),yg(this,"showNextStep",(function(){this.showWidgetUI(),this.callback&&(ig.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&&gg.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(he("dismiss"),"</div>\n <div class='bb-capture-editor-drag-info'>").concat(he("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(he("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(he("recorderon"),"\n ").concat(he("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(he("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(he("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(he("rect"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="pen">\n ').concat(he("pen"),'\n </div>\n <div class="bb-capture-toolbar-item bb-capture-toolbar-drawingitem bb-capture-toolbar-item-tool" data-type="blur">\n ').concat(he("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(Xv.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(he("undo"),'\n <span class="bb-tooltip">').concat(Xv.translateText("undo"),"</span>\n </div>\n ").concat("capture"!==this.type?'<div class="bb-capture-button-next">'.concat(Xv.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(Xv.translateText("retry"),'</div>\n <div class="bb-capture-preview-sendbutton">').concat(Xv.translateText("next"),"</div>\n </div>\n </div>\n </div>\n "),document.body.appendChild(e),e.setAttribute("dir",Xv.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?(py.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),gg.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new ug(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"),h=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){}}},f=document.querySelectorAll(".bb-capture-toolbar-item"),g=function(){var e=f[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(),h("pointer",document.querySelector(".bb-capture-toolbar-item[data-type='pointer']")))),("capture"!==o.type||o.screenRecorder.isRecording)&&("pen"!==t&&"blur"!==t&&"rect"!==t&&"pointer"!==t||h(t,e),"colorpicker"===t&&("flex"===d.style.display?d.style.display="none":d.style.display="flex"),"undo"===t&&o.screenDrawer.removeLastAddedPathFromSvg())}},m=0;m<f.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&&py.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=Xv.translateText("unmute")):(u.classList.remove("bb-capture-toolbar-item--inactivecross"),o.innerHTML=Xv.translateText("mute"))):(u.classList.add(e),u.classList.add("bb-capture-toolbar-item--inactivecross"),o.innerHTML=Xv.translateText("browserNotSupported"));break;case"recording":this.screenRecorder.available?(u.classList.remove(e),this.screenRecorder.isRecording?(u.setAttribute("data-active","true"),r.innerHTML=Xv.translateText("stopRecording"),t.style.display="block"):(u.setAttribute("data-active","false"),r.innerHTML=Xv.translateText("startRecording"),t.style.display="none")):(u.classList.add(e),r.innerHTML=Xv.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 Ff(this.captureRenderer.bind(this),Xv.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&&vg(t.prototype,n),r&&vg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function kg(e){return kg="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},kg(e)}function xg(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,Cg(r.key),r)}}function Sg(e,t,n){return(t=Cg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cg(e){var t=function(e,t){if("object"!=kg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=kg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kg(t)?t:String(t)}var Eg=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Sg(this,"sessionStart",new Date),Sg(this,"appBuildNumber",""),Sg(this,"appVersionCode",""),Sg(this,"environment","prod"),Sg(this,"envDataPropsToIgnore",[]),Sg(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.2.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&&xg(t.prototype,n),r&&xg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ig(e){return Ig="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},Ig(e)}function Tg(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 Lg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tg(Object(n),!0).forEach((function(t){Ag(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Og(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,Mg(r.key),r)}}function Ag(e,t,n){return(t=Mg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mg(e){var t=function(e,t){if("object"!=Ig(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ig(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ig(t)?t:String(t)}Sg(Eg,"instance",void 0);var Rg=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ag(this,"modalUrl","https://outboundmedia.gleap.io/modal"),Ag(this,"modalContainer",null),Ag(this,"modalData",null),Ag(this,"modalBackdropClickListener",null),Ag(this,"modalResizeListener",null),Ag(this,"modalLoadTimeout",null),Ag(this,"modalLoaded",!1),Ag(this,"lastSentMaxHeight",0),Ag(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,h,f,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(),$n(m.name))return;if("start-conversation"===m.name&&py.startBot(null===(a=m.data)||void 0===a?void 0:a.botId),"start-custom-action"===m.name&&py.triggerCustomAction(null===(s=m.data)||void 0===s?void 0:s.action),"start-product-tour"===m.name&&py.startProductTour(null===(c=m.data)||void 0===c?void 0:c.tourId,!0),"open-url"===m.name){var w=m.data,k=!!m.newTab;ig.getInstance().urlHandler(w,k)}"show-form"===m.name&&py.startFeedbackFlow(null===(l=m.data)||void 0===l?void 0:l.formId),"show-survey"===m.name&&py.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&&py.openNewsArticle(null===(p=m.data)||void 0===p?void 0:p.articleId),"show-help-article"===m.name&&py.openHelpCenterArticle(null===(h=m.data)||void 0===h?void 0:h.articleId),"show-checklist"===m.name&&py.startChecklist(null===(f=m.data)||void 0===f?void 0:f.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=Ku.getInstance().getFlowConfig(),t=e.color?e.color:"#485BFF",n=e.backgroundColor?e.backgroundColor:"#FFFFFF";this.lastSentMaxHeight=this._maxModalHeight(),this._postMessage({name:"modal-data",data:Lg(Lg({},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(Lg(Lg({},e),{},{type:"modal"})),"*")}catch(fy){}}},{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"))}}])&&Og(t.prototype,n),r&&Og(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Pg(e){return Pg="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},Pg(e)}Ag(Rg,"instance",void 0);var Dg=["gleap.io","gleap.ai"],Ng="[REDACTED]",jg="[body not captured]",_g=["authorization","proxy-authorization","cookie","set-cookie"],Fg=/^[^\s=&]+=[^\s&]*(?:&[^\s=&]+=[^\s&]*)*$/,Bg=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},Ug=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},Hg=function(e,t){return"string"==typeof t&&-1!==e.props.indexOf(t.toLowerCase())},zg=function(e,t){for(var n={},r=!1,o=Object.keys(e),i=0;i<o.length;i++){var a=o[i];Hg(t,a)?r=!0:-1!==_g.indexOf(a.toLowerCase())&&e[a]!==Ng?(n[a]=Ng,r=!0):n[a]=e[a]}return r?n:null},qg=function(e,t){if("string"==typeof e){var n;try{n=JSON.parse(e)}catch(i){return e}if(!n||"object"!==Pg(n)||Array.isArray(n))return e;var r=zg(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?zg(o,t)||o:e}return e&&"object"===Pg(e)?zg(e,t)||Object.assign({},e):e},Wg=function(e,t){if(!e||"object"!==Pg(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""},Vg=function(e){var t=e.replace(/\+/g," ");try{return decodeURIComponent(t)}catch(n){return t}},Gg=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=Vg(-1===s?a:a.slice(0,s));a.length>0&&Hg(t,c)?o=!0:r.push(a)}return o?r.join("&"):e},$g=function(e){if(e>500)throw new Error("Network log body is nested too deeply to redact.")},Xg=function e(t,n,r){$g(r);var o=!1;if(Array.isArray(t)){for(var i=0;i<t.length;i++)t[i]&&"object"===Pg(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];Hg(n,c)?(delete t[c],o=!0):t[c]&&"object"===Pg(t[c])&&e(t[c],n,r+1)&&(o=!0)}return o},Kg=function e(t,n,r,o){$g(o);var i=!1;if(Array.isArray(t)){for(var a=0;a<t.length;a++)t[a]&&"object"===Pg(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"===Pg(t[u])&&e(t[u],n,r+1,o+1)&&(i=!0))}return i},Jg=function(e,t){for(var n=Xg(e,t,0),r=0;r<t.paths.length;r++)Kg(e,t.paths[r],0,0)&&(n=!0);return n},Yg=/\n… \[truncated, [^\]]*\]$/,Zg=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},Qg=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"===Pg(o)?Jg(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=Yg.exec(e),s=a?e.slice(0,a.index):e,c=s,l=0;l<n.length;l++){var u=new RegExp('"('+Zg(n[l])+')"(\\s*:\\s*)("(?:[^"\\\\]|\\\\.)*"?|-?\\d[0-9.eE+-]*|true|false|null)',"gi");c=c.replace(u,'"$1"$2"'+Ng+'"')}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"):Fg.test(e)}(e,t)?Gg(e,n):e}if("object"===Pg(e)){var i=JSON.parse(JSON.stringify(e));return i&&"object"===Pg(i)&&Jg(i,n),i}}catch(a){return jg}return e},em=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=Gg(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"===Pg(n.request)&&!Array.isArray(n.request)){var r=Object.assign({},n.request),o=Wg(r.headers,"content-type");void 0!==r.headers&&(r.headers=qg(r.headers,t)),void 0!==r.payload&&(r.payload=Qg(r.payload,o,t)),n.request=r}if(n.response&&"object"===Pg(n.response)&&!Array.isArray(n.response)){var i=Object.assign({},n.response),a=Wg(i.headers,"content-type");void 0!==i.headers&&(i.headers=qg(i.headers,t)),void 0!==i.responseText&&(i.responseText=Qg(i.responseText,a,t)),n.response=i}return n},tm=function(e,t){var n=[];if(!Array.isArray(e))return n;for(var r=function(e){for(var t=Bg(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=Bg(Dg.concat(t&&t.blacklist||[])),i=0;i<e.length;i++){var a=e[i];if(a&&"object"===Pg(a)&&!Array.isArray(a)&&!Ug(a.url,o))try{n.push(em(a,r))}catch(s){}}return n};function nm(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,om(r.key),r)}}function rm(e,t,n){return(t=om(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function om(e){var t=function(e,t){if("object"!=im(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=im(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==im(t)?t:String(t)}function im(e){return im="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},im(e)}var am=15e4,sm="[body pending]",cm="[binary body omitted]",lm="[streaming body omitted]",um=["text/event-stream","application/x-ndjson","application/stream+json","multipart/x-mixed-replace","grpc"],dm=["json","xml","text/","javascript","x-www-form-urlencoded","graphql"],pm=function(e){if("string"!=typeof e||0===e.trim().length)return"unknown";for(var t=e.toLowerCase(),n=0;n<um.length;n++)if(-1!==t.indexOf(um[n]))return"stream";for(var r=0;r<dm.length;r++)if(-1!==t.indexOf(dm[r]))return"text";return"binary"},hm=function(){try{if("undefined"!=typeof performance&&"function"==typeof performance.now)return performance.now()}catch(e){}return Date.now()},fm=function(e){return Math.max(0,Math.round(hm()-e))},gm=function(e){return"\n… [truncated, "+("number"==typeof e?e:"more than "+am)+" bytes]"},mm=function(e){if("string"!=typeof e)return"";if(e.length<=am)return e;var t=am,n=e.charCodeAt(t-1);return n>=55296&&n<=56319&&(t-=1),e.slice(0,t)+gm(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)},vm=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]},ym=function(e,t,n){var r=vm(e,t);void 0!==r?e[r]=e[r]+", "+n:e[t]=n},bm=function(e,t){var n=e?vm(e,t):void 0;return void 0!==n?e[n]:""},wm=function(e){var t={};if(!e||"object"!==im(e))return t;try{if("function"==typeof e.forEach&&"function"==typeof e.get)e.forEach((function(e,n){ym(t,String(n),String(e))}));else if(Array.isArray(e))for(var n=0;n<e.length;n++)e[n]&&e[n].length>=2&&ym(t,String(e[n][0]),String(e[n][1]));else for(var r=Object.keys(e),o=0;o<r.length;o++)ym(t,r[o],String(e[r[o]]))}catch(i){}return t},km=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&&ym(t,n[r].slice(0,o).trim(),n[r].slice(o+1).trim())}return t},xm=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}},Sm=function(e,t,n,r){var o,i=e.byteLength>am||"number"==typeof r&&r>am,a=e.byteLength>am?e.subarray(0,am):e;try{if(n){if(-1!==(o=new TextDecoder("utf-8",{fatal:!0}).decode(a,{stream:i})).indexOf("\0"))return cm}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?cm:jg}return i?o+gm("number"==typeof r?r:void 0):o},Cm=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 Sm(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>am){try{r.cancel().catch((function(){}))}catch(s){}return a(!1)}return e()}))}()},Em=function(e,t,n){var r=e.size>am?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 Sm(new Uint8Array(r),t,n,e.size)}))},Im=function(e,t){if(null==e)return{text:""};try{var n=pm(t);if("stream"===n)return{text:lm};if("string"==typeof e)return{text:"binary"===n?cm:mm(e)};var r=function(e){return Object.prototype.toString.call(e)}(e);if("[object URLSearchParams]"===r)return{text:mm(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})})),mm(JSON.stringify(c)))};if("[object ReadableStream]"===r)return{text:lm};if("[object Blob]"===r||"[object File]"===r){var o=t||e.type||"",i=pm(o);return"stream"===i?{text:lm}:"binary"===i?{text:cm}:{text:sm,promise:Em(e,o,"unknown"===i)}}if("[object ArrayBuffer]"===r||"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)){if("binary"===n)return{text:cm};var a="[object ArrayBuffer]"===r?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{text:Sm(a,t,"unknown"===n,a.byteLength)}}return"[object Document]"===r||"[object HTMLDocument]"===r||"[object XMLDocument]"===r?{text:jg}:{text:"binary"===n?cm:mm(String(e))}}catch(l){return{text:jg}}var s,c},Tm=function(e,t,n){e[t]=n.text,n.promise&&n.promise.then((function(n){e[t]=n}),(function(){e[t]=jg}))},Lm=function(e){try{if(e&&"object"===im(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"}},Om=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."},Am=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),rm(this,"requestId",0),rm(this,"requests",{}),rm(this,"externalRequests",[]),rm(this,"maxRequests",30),rm(this,"localFilters",[]),rm(this,"remoteFilters",[]),rm(this,"localBlacklist",[]),rm(this,"remoteBlacklist",[]),rm(this,"initialized",!1),rm(this,"stopped",!1),rm(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"===im(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 tm(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:"+xm(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]&&!Ug(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=Bg(e)}},{key:"setRemoteFilters",value:function(e){this.remoteFilters=Bg(e)}},{key:"setBlacklist",value:function(e){this.localBlacklist=Bg(e)}},{key:"setRemoteBlacklist",value:function(e){this.remoteBlacklist=Bg(e)}},{key:"getFilters",value:function(){return Bg(this.remoteFilters.concat(this.localFilters))}},{key:"getBlacklist",value:function(){return Bg(Dg.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(Ug(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=hm(),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,xm(r?e.url:e));if(!i)return null;i.request.headers=wm(t&&void 0!==t.headers?t.headers:r?e.headers:void 0);var a=bm(i.request.headers,"content-type"),s={text:""};try{t&&void 0!==t.body&&null!==t.body?s=Im(t.body,a):r&&(s=function(e,t,n){if("GET"===t||"HEAD"===t||null===e.body)return{text:""};var r=pm(n);if("stream"===r)return{text:lm};if("binary"===r)return{text:cm};if(e.bodyUsed)return{text:jg};var o=e.clone();return o.body&&"function"==typeof o.body.getReader?{text:sm,promise:Cm(o.body,n,"unknown"===r)}:{text:sm,promise:o.arrayBuffer().then((function(e){var t=new Uint8Array(e);return 0===t.byteLength?"":Sm(t,n,"unknown"===r,t.byteLength)}))}}(e,o,a))}catch(c){s={text:jg}}return Tm(i.request,"payload",s),{request:i,start:n}}},{key:"finishFetch",value:function(e,t){var n=e.request;n.duration=fm(e.start),n.success=!0;var r=wm(t&&t.headers),o={status:t?t.status:0,statusText:t&&t.statusText?t.statusText:"",headers:r,responseText:sm};n.response=o;var i=function(e){o.responseText=e};try{if(!t||"opaque"===t.type||"opaqueredirect"===t.type)return i(jg);if(null===t.body)return i("");var a=bm(r,"content-type"),s=pm(a);if("stream"===s)return i(lm);if("binary"===s)return i(cm);var c=t.clone();if(c.body&&"function"==typeof c.body.getReader)return void Cm(c.body,a,"unknown"===s).then(i,(function(){return i(jg)}));var l=parseInt(bm(r,"content-length"),10);if("function"==typeof c.text&&l>=0&&l<=am)return void c.text().then((function(e){return i(mm(e))}),(function(){return i(jg)}));i(jg)}catch(u){i(jg)}}},{key:"failFetch",value:function(e,t){var n=e.request;n.duration=fm(e.start),n.success=!1,n.response={errorText:Lm(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&&ym(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),Lm(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=xm(r),o.headers={},o.capture=this.isCapturing()&&!Ug(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=hm(),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 Tm(i.request,"payload",a?Im(n,bm(r.headers,"content-type")):{text:""}),r.request=i,r.start=o,!0}},{key:"recordXhrHeaders",value:function(e,t){t.headersAt=hm();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:km(e.getAllResponseHeaders()),responseText:sm}}},{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=fm(t.start),r.success=!1,void(r.response={errorText:Om(o,e)});r.duration=t.headersAt?Math.max(0,Math.round(t.headersAt-t.start)):fm(t.start),r.success=!0;var i,a=km(e.getAllResponseHeaders());try{i=function(e,t){var n=pm(bm(t,"content-type"));if("stream"===n)return lm;var r=e.responseType;if(""===r||"text"===r){if("binary"===n)return cm;var o=e.responseText;return"string"!=typeof o?"":"unknown"===n&&-1!==o.slice(0,am).indexOf("\0")?cm:mm(o)}if("json"===r){if(null===e.response||void 0===e.response)return"";var i=ld(e.response,am);return i.truncated?i.text+gm():i.text}return"document"===r?jg:cm}(e,a)}catch(s){i=jg}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&&nm(t.prototype,n),r&&nm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();rm(Am,"instance",void 0);const Mm=Am;function Rm(e){return Rm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rm(e)}function Pm(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,Nm(r.key),r)}}function Dm(e,t,n){return(t=Nm(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nm(e){var t=function(e,t){if("object"!=Rm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Rm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Rm(t)?t:String(t)}var jm=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Dm(this,"notificationContainer",null),Dm(this,"notifications",[]),Dm(this,"unreadCount",0),Dm(this,"unreadNotificationsKey","unread-notifications"),Dm(this,"isTabActive",!0),Dm(this,"showNotificationBadge",!0),Dm(this,"lastPageRulesUrl",void 0),Dm(this,"stackResizeObserver",null),Dm(this,"currentNewsIndex",0)}var t,n,r;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(),Fv.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||ff(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(),N.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=Nn.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)&&Un.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=he("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}}",Lf.getInstance().getName()),d.innerText=p,d.onclick=function(t){t.stopPropagation(),e.openNews(a)},u.appendChild(d);var h=this.renderDescription(a);if(h){var f=document.createElement("div");f.className="gleap-notification-item-news-preview",f.innerHTML=h,u.appendChild(f)}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=Xv.translateText("next"),v.onclick=function(t){t.stopPropagation(),e.currentNewsIndex++,e.renderNotifications()}):(v.innerText=Xv.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}}",Lf.getInstance().getName());var r=document.createElement("div");if(r.onclick=function(){t.data.conversation?py.openConversation(t.data.conversation.shareToken,!0):t.data.checklist?py.openChecklist(t.data.checklist.id,!0):py.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?py.openNewsArticle(e.data.news.id,!0):py.open()}},{key:"renderAvatar",value:function(e,t){if(!e||!e.profileImageUrl)return"";var n=String(e.name||"").replace(/"/g,"""),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,Xv.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||Fv.getInstance().sendMessage({type:"conversation-notifications-cleared",shareToken:e,gleapId:null===(o=Lf.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;Fv.getInstance().sendMessage({type:"notifications-cleared",gleapId:null===(n=Lf.getInstance().session)||void 0===n?void 0:n.gleapId})}catch(r){}}}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=Ku.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!==N.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==N.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===N.getInstance().buttonHidden?e.feedbackButtonPosition===N.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):N.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",Xv.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&Pm(t.prototype,n),r&&Pm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 Fm(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,Um(r.key),r)}}function Bm(e,t,n){return(t=Um(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Um(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)}Dm(jm,"instance",void 0);var Hm=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Bm(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)&&Fm(t.prototype,n),r&&Fm(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function zm(e){return zm="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},zm(e)}function qm(e){return function(e){if(Array.isArray(e))return Wm(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 Wm(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 Wm(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 Wm(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 Vm(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 Gm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vm(Object(n),!0).forEach((function(t){$m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $m(e,t,n){return t=function(e){var t=function(e,t){if("object"!=zm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=zm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zm(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Bm(Hm,"instance",void 0);var Xm=function(){var e={};function t(){e=Gm({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(qm(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 h(e){var t;null==(t=d[e])||t.call(d)}function f(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&&h("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,h=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(h," 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(h," 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,h=!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();!h&&k&&k(v?void 0:p,d,{config:x,state:S});b&&b(g?void 0:e,t,{config:x,state:S});var I=!h&&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&&I&&(E(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):(f(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),!I&&t.popover&&E(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){}f(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(qm(r?[r]:[]),qm(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?h("escapePress"):"ArrowRight"===e.key?h("arrowRightPress"):"ArrowLeft"===e.key&&h("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 E(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="×";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="← Previous";var l=document.createElement("button");return l.type="button",l.classList.add("gleap-tour-popover-next-btn"),l.innerHTML="Next →",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,f=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=f||n("showButtons"),E=m||n("showProgress")||!1,I=(null==C?void 0:C.includes("next"))||(null==C?void 0:C.includes("previous"))||E;s.closeButton.style.display=C.includes("close")?"block":"none",I?(s.footer.style.display="flex",s.progress.style.display=E?"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()}):h("nextClick"):s.classList.contains("gleap-tour-popover-prev-btn")?u?u(e,t,{config:n(),state:l()}):h("prevClick"):s.classList.contains("gleap-tour-popover-close-btn")?d?d(e,t,{config:n(),state:l()}):h("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 R=e.classList.contains("gleap-tour-dummy-element"),P=o([L].concat(qm(R?[]:[e])));P.length>0&&P[0].focus()}function I(){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,h=I(),f=r.arrow.getBoundingClientRect(),g=e.getBoundingClientRect(),m=g.top-h.height,v=m>=0,y=window.innerHeight-(g.bottom+h.height),b=y>=0,w=g.left-h.width,k=w>=0,x=window.innerWidth-(g.right+h.width),S=x>=0,C=!(v||b||k||S),E=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-h.realWidth/2,A=window.innerHeight/2-h.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==h?void 0:h.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 R=Math.min(w,window.innerWidth-(null==h?void 0:h.realWidth)-f.width),P=T(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.left="".concat(R,"px"),r.wrapper.style.top="".concat(P,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="left"}else if(S){var D=Math.min(x,window.innerWidth-(null==h?void 0:h.realWidth)-f.width),N=T(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.right="".concat(D,"px"),r.wrapper.style.top="".concat(N,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",E="right"}else if(v){var j=Math.min(m,window.innerHeight-h.realHeight-f.width),_=L(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.top="".concat(j,"px"),r.wrapper.style.left="".concat(_,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="top"}else if(b){var F=Math.min(y,window.innerHeight-(null==h?void 0:h.realHeight)-f.width),B=L(u,{elementDimensions:g,popoverDimensions:h,popoverPadding:p,popoverArrowDimensions:f});r.wrapper.style.left="".concat(B,"px"),r.wrapper.style.bottom="".concat(F,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",E="bottom"}C?r.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var r=l("popover");if(!r)return;var o=n.getBoundingClientRect(),i=I(),a=r.arrow,s=i.width,c=window.innerWidth,u=o.width,d=o.left,p=i.height,h=window.innerHeight,f=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?(f+g<=0?(m="bottom",v="end"):f+g-p<=0&&(m="left",v="start"),f>=h?(m="top",v="end"):f+p>=h&&(m="left",v="end")):"right"===t&&(f+g<=0?(m="bottom",v="start"):f+g-p<=0&&(m="right",v="start"),f>=h?(m="top",v="start"):f+p>=h&&(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,E,e)}}return function(){function e(){n("allowClose")&&f()}function r(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?h(r):f()}}function o(){var e=l("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?h(r):f()}}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 h(){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 f();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(qm(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"),E=(null==(s=p.popover)?void 0:s.onPrevClick)||n("onPrevClick"),I=(null==(l=p.popover)?void 0:l.onCloseClick)||n("onCloseClick");y(Gm(Gm({},p),{},{popover:Gm({showButtons:S,nextBtnText:g?void 0:v,disableButtons:qm(m?[]:["previous"]),showProgress:w,progressText:k,onNextClick:C||function(){g?h(u+1):f()},onPrevClick:E||function(){h(u-1)},onCloseClick:I||function(){f()}},(null==p?void 0:p.popover)||{})}))}else f()}function f(){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(),h(e)},setConfig:t,setSteps:function(e){u(),t(Gm(Gm({},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]?h(e):f()},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(Gm(Gm({},e),{},{popover:e.popover?Gm({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){f(!1)}}}}();const Km=Xm;var Jm=["text","email","password","search","tel","url","number","date","datetime-local","month","week","time"],Ym="".concat(Jm.map((function(e){return'input[type="'.concat(e,'" i]')})).join(", "),", input:not([type]), textarea, [contenteditable]"),Zm=function(e){if(!e||!e.tagName)return!1;var t=e.tagName.toLowerCase();return"input"===t?Jm.indexOf((e.getAttribute("type")||"text").toLowerCase())>=0:"textarea"===t||function(e){return!0===e.isContentEditable||"function"==typeof e.getAttribute&&null!==e.getAttribute("contenteditable")}(e)},Qm=function(e,t){try{e.dispatchEvent(new Event(t,{bubbles:!0}))}catch(n){}},ev=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;Qm(e,"input")}},tv=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(Zm(e))return e;var t="function"==typeof e.querySelector?e.querySelector(Ym):null;return t&&Zm(t)?t:null}(e),s=null!=t?t:"";if(a){var c=0,l=function(){Qm(a,"change"),i&&i()};!function e(){try{c<s.length?(c++,ev(a,s.slice(0,c)),setTimeout(e,o)):l()}catch(t){l()}}()}else i&&i()};function nv(e){return nv="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},nv(e)}function rv(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,iv(r.key),r)}}function ov(e,t,n){return(t=iv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iv(e){var t=function(e,t){if("object"!=nv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=nv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==nv(t)?t:String(t)}var av="gleap-tour-data",sv="copilot-pointer-container",cv="copilot-tour-styles",lv="copilot-joined-container",uv={TOP_LEFT:"".concat(lv,"--top-left"),TOP_RIGHT:"".concat(lv,"--top-right"),BOTTOM_LEFT:"".concat(lv,"--bottom-left"),BOTTOM_RIGHT:"".concat(lv,"--bottom-right")};var dv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ov(this,"productTourData",void 0),ov(this,"productTourId",void 0),ov(this,"currentActiveIndex",void 0),ov(this,"lastArrowPositionX",void 0),ov(this,"lastArrowPositionY",void 0),ov(this,"onCompleteCallback",void 0),ov(this,"audioMuted",!1),ov(this,"currentAudio",void 0),ov(this,"_pointerContainer",null),ov(this,"_scrollListeners",[]),ov(this,"_currentAnchor",null),ov(this,"_currentStep",null),ov(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(av,JSON.stringify(e))}catch(t){}else localStorage.removeItem(av)}},{key:"loadStoredAudioMuted",value:function(){if("undefined"!=typeof window)try{var e=JSON.parse(localStorage.getItem(av));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(sv);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(sv);t&&t.remove()}var n=document.getElementById(lv);n&&n.remove();var r=document.getElementById(cv);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(lv,"-mute"));t&&(t.innerHTML=he(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=Ku.getInstance().flowConfig)||void 0===t?void 0:t.color)&&void 0!==e?e:"#485BFF",d=pe(u),p=document.getElementById(cv);p||(p=document.createElement("style"),W(p),p.id=cv,p.type="text/css",p.textContent="\n #".concat(sv," {\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(sv,"-clickmode {\n cursor: pointer;\n pointer-events: all !important;\n }\n .").concat(sv,"-clickmode #copilot-info-bubble-content {\n display: flex !important;\n }\n .").concat(sv,"-clickmode svg {\n display: none !important;\n }\n #").concat(sv," 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(sv,"-right #copilot-info-bubble-content-container {\n left: auto !important;\n right: 0px !important;\n align-items: flex-end;\n }\n .").concat(sv,"-right .copilot-info-bubble-content {\n margin-right: 5px;\n }\n .").concat(sv,"-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(sv,"-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(lv," {\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(lv,"--top-left {\n top: 20px;\n left: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(lv,"--top-right {\n top: 20px;\n right: 20px;\n animation: slideInFromTop 0.5s ease-out forwards;\n }\n .").concat(lv,"--bottom-left {\n bottom: 20px;\n left: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(lv,"--bottom-right {\n bottom: 20px;\n right: 20px;\n animation: slideInFromBottom 0.5s ease-out forwards;\n }\n .").concat(lv," span {\n font-size: 13px;\n color: #000;\n font-family: sans-serif;\n }\n .").concat(lv,"-avatar {\n width: 24px;\n height: 24px;\n flex-shrink: 0;\n border-radius: 6px;\n }\n .").concat(lv,"-mute {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .").concat(lv,"-mute svg {\n width: 20px;\n height: auto;\n cursor: pointer;\n animation: pulsate 2s infinite;\n }\n .").concat(lv,"-mute svg:hover {\n opacity: 0.8;\n }\n .").concat(lv,"-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 3px;\n }\n .").concat(lv,"-dismiss svg {\n width: 15px;\n height: auto;\n cursor: pointer;\n }\n .").concat(lv,"-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(lv," {\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(lv,"-mute {\n display: none;\n }\n "),"\n ").concat(this.productTourData.gradient?'body::before {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n box-sizing: border-box;\n border: 18px solid transparent;\n filter: blur(25px);\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }\n \n body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0.5;\n box-sizing: border-box;\n border: 3px solid transparent;\n border-image-slice: 1;\n border-image-source: linear-gradient(45deg, #ED5587, #FBE6A9, #a6e3f8, #C294F2);\n animation: glCoFadeIn 1.5s ease-out forwards;\n }':'body::after {\n content: "";\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n pointer-events: all;\n z-index: 2147483609;\n opacity: 0;\n }',"\n "),document.head.appendChild(p));var h=document.createElement("div");h.id=sv,h.style.opacity=0,this._pointerContainer=h;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("viewBox","0 0 380 476"),f.innerHTML='<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=lv,y.classList.add(lv,(m=null===(n=this.productTourData)||void 0===n?void 0:n.joinedIndicatorPosition,null!==(v=uv[m])&&void 0!==v?v:uv.TOP_RIGHT)),y.innerHTML='\n <img class="'.concat(lv,'-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(lv,'-mute">\n ').concat(he(this.audioMuted?"unmute":"mute"),"\n </div>\n ").concat(null!==(i=this.productTourData)&&void 0!==i&&i.allowClose?'<div class="'.concat(lv,'-dismiss">\n ').concat(he("dismiss"),"\n </div>"):"","\n "),document.body.appendChild(y),document.querySelector(".".concat(lv,"-mute")).addEventListener("click",(function(){s.toggleAudio(!s.audioMuted)})),null!==(a=this.productTourData)&&void 0!==a&&a.allowClose&&document.querySelector(".".concat(lv,"-dismiss")).addEventListener("click",(function(){s.completeTour(!1)})),h.appendChild(f),h.appendChild(g),document.body.appendChild(h)}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!this.disabled){var t=this.productTourData;if(t){var n=function(n,r){e.audioMuted=n,e.setupCopilotTour(),e.audioMuted&&r&&null!=t&&t.showUnmuteModal?e.showAudioUnmuteModal():setTimeout((function(){e.renderNextStep()}),1500)},r=this.loadStoredAudioMuted();"boolean"!=typeof r?("undefined"==typeof window?Promise.resolve(!1):new Promise((function(e){var t=setTimeout((function(){return e(!0)}),500),n=function(n){clearTimeout(t),e(n)};try{new Audio("data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEARKwAABCxAgAEABAAZGF0YQAAAAA=").play().then((function(){return n(!0)})).catch((function(){return n(!1)}))}catch(r){n(!1)}}))).then((function(e){n(!e,!0)})):n(r,!1)}}}},{key:"showAudioUnmuteModal",value:function(){var e,t,n,r=this,o=document.createElement("div");o.classList.add("gleap-audio-unmute-modal-overlay");var i=document.createElement("div");i.classList.add("gleap-audio-unmute-modal");var a=document.createElement("p");a.textContent=null===(e=this.productTourData)||void 0===e?void 0:e.unmuteModalTitle,i.appendChild(a);var s=document.createElement("button");s.classList.add("gleap-audio-unmute-button"),s.textContent=null===(t=this.productTourData)||void 0===t?void 0:t.unmuteModalButton,s.addEventListener("click",(function(){r.toggleAudio(!1),o.parentNode&&o.parentNode.removeChild(o),setTimeout((function(){r.renderNextStep()}),1e3)})),i.appendChild(s);var 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(sv)).classList.remove("copilot-pointer-container-clickmode"),n.classList.remove("gleap-input-highlight"),document.getElementById(sv).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(Xv.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(sv)).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;tv(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&&rv(t.prototype,n),r&&rv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function pv(e){return pv="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},pv(e)}function hv(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 fv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hv(Object(n),!0).forEach((function(t){mv(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gv(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,vv(r.key),r)}}function mv(e,t,n){return(t=vv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vv(e){var t=function(e,t){if("object"!=pv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=pv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pv(t)?t:String(t)}ov(dv,"instance",void 0);var yv="gleap-tour-data",bv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),mv(this,"productTourData",void 0),mv(this,"productTourId",void 0),mv(this,"unmuted",!1),mv(this,"currentActiveIndex",void 0),mv(this,"gleapTourObj",void 0),mv(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(),dv.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;Lf.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?(Ht.notifyEvent("productTourCompleted",t),py.trackEvent("tour-".concat(this.productTourId,"-completed"),t)):(Ht.notifyEvent("productTourQuit",t),py.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(yv));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(yv,JSON.stringify(e))}catch(t){}else this.clearUncompletedTour()}},{key:"clearUncompletedTour",value:function(){try{localStorage.removeItem(yv)}catch(e){}}},{key:"start",value:function(){var e=this,t=this.productTourData;if(t){if("cobrowse"===t.tourType)return dv.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(he("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 h={disableActiveInteraction:!s&&!c&&!l,mode:a.mode,popover:fv({description:u,popoverClass:"gleap-tour-popover-".concat(a.type," ").concat(!d&&"gleap-tour-popover-no-sender"," ").concat(t.allowClose&&"gleap-tour-popover-can-close")},s?{showButtons:[]}:{})};a.selector&&a.selector.length>0&&(h.element=a.selector),o.push(h)}var f=["next","close"];t.backButton&&f.push("previous"),this.gleapTourObj=Km(mv(mv(mv(mv(mv(mv(mv(mv(mv(mv({showProgress:!0,allowKeyboardControl:!1,steps:o},"showProgress",n.length>1),"allowClose",t.allowClose),"nextBtnText",t.nextText),"doneBtnText",t.doneText),"prevBtnText",t.prevText),"showButtons",f),"onHighlightStarted",(function(t,n,r){var o;e.currentActiveIndex=null==r||null===(o=r.state)||void 0===o?void 0:o.activeIndex,e.storeUncompletedTour()})),"onElementNotFound",(function(t){document.removeEventListener("click",g),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=he("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=he("mute"),u.classList.add(s)):l.paused?(l.muted=!1,l.play(),c.innerHTML=he("mute"),u.classList.add(s)):(l.pause(),c.innerHTML=he("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&&gv(t.prototype,n),r&&gv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function wv(e){return wv="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},wv(e)}function kv(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,Sv(r.key),r)}}function xv(e,t,n){return(t=Sv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sv(e){var t=function(e,t){if("object"!=wv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=wv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wv(t)?t:String(t)}mv(bv,"instance",void 0);var Cv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xv(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||py.startFeedbackFlowWithOptions("bugreporting",{autostartDrawing:!0})})))}},{key:"stop",value:function(){this.shortCutListener&&(document.removeEventListener("keyup",this.shortCutListener),this.shortCutListener=void 0)}}])&&kv(t.prototype,n),r&&kv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ev(e){return Ev="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},Ev(e)}function Iv(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,Lv(r.key),r)}}function Tv(e,t,n){return(t=Lv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lv(e){var t=function(e,t){if("object"!=Ev(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ev(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ev(t)?t:String(t)}xv(Cv,"instance",void 0);var Ov=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)},Av=function(){return"undefined"!=typeof navigator&&!!navigator&&!1===navigator.onLine},Mv=null,Rv=function(e){try{if(Mv||"undefined"==typeof TextEncoder||(Mv=new TextEncoder),Mv)return Mv.encode(e).length}catch(t){}return e.length},Pv=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),Tv(this,"eventArray",[]),Tv(this,"streamedEventArray",[]),Tv(this,"eventMaxLength",500),Tv(this,"pingInFlight",0),Tv(this,"lastPingId",0),Tv(this,"pingFailures",0),Tv(this,"pingRetryAt",0),Tv(this,"lastUrl",void 0),Tv(this,"mainLoopTimeout",null),Tv(this,"socket",null),Tv(this,"connectedWebSocketGleapId",null),Tv(this,"connectionTimeout",null),Tv(this,"pingWS",null),Tv(this,"reconnectTimeout",null),Tv(this,"reconnectAttempts",0),Tv(this,"socketOpenedAt",0),Tv(this,"networkListenersAdded",!1),Tv(this,"handleOpenBound",null),Tv(this,"handleErrorBound",null),Tv(this,"handleMessageBound",null),Tv(this,"handleCloseBound",null),Tv(this,"handleOnlineBound",null),Tv(this,"runEventStreamLoop",(function(){var e=t;try{t.streamEvents()}catch(n){}t.mainLoopTimeout=setTimeout((function(){e.runEventStreamLoop()}),2500)})),Tv(this,"streamEvents",(function(){var e=Lf.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:Eg.getInstance().getSessionDuration(),events:o,opened:ig.getInstance().isOpened(),type:"js",sdkVersion:"19.2.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=Lf.getInstance().session;if(this.connectedWebSocketGleapId=e?e.gleapId:null,e&&e.gleapId&&Lf.getInstance().sdkKey){var t="";try{var n=(()=>{const e=[];return er()&&e.push("capture.screenshot","capture.recording"),Wn&&e.push("capture.logs"),e})();n.length>0&&(t="&caps="+n.join(","))}catch(r){}this.socket=new WebSocket("".concat(Lf.getInstance().wsApiUrl,"?gleapId=").concat(Lf.getInstance().session.gleapId,"&gleapHash=").concat(Lf.getInstance().session.gleapHash,"&apiKey=").concat(Lf.getInstance().sdkKey,"&sdkVersion=").concat("19.2.0").concat(t)),this.socket.addEventListener("open",this.handleOpenBound),this.socket.addEventListener("message",this.handleMessageBound),this.socket.addEventListener("error",this.handleErrorBound),this.socket.addEventListener("close",this.handleCloseBound),this.addNetworkListeners()}}},{key:"clearReconnectTimeout",value:function(){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null)}},{key:"scheduleReconnect",value:function(){var t=this;if(this.clearReconnectTimeout(),!Av()){var n=e.reconnectDelay(this.reconnectAttempts,Math.random());this.reconnectAttempts+=1,this.reconnectTimeout=setTimeout((function(){t.reconnectTimeout=null,Av()||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(ut.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=ig.getInstance().isOpened();if(s&&jm.getInstance().clearNotificationsForConversation(s),a&&Nn.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())}));py.getInstance().performActions(u)}null!=i&&jm.getInstance().setNotificationCount(i)}if("capture-request"===e.name&&wu&&wu.getInstance().handleServerRequest(e.data),"checklist"===e.name&&null!=e&&e.data&&window){var d,p,h=e.data,f=null!==(d=h.completedSteps)&&void 0!==d?d:[],g=null!==(p=h.completedStepsBefore)&&void 0!==p?p:[];if(f.length>g.length)for(var m=function(e){var t,n=null==h||null===(t=h.steps)||void 0===t?void 0:t.find((function(t){return t.id===f[e]}));if(!n)return 1;var r=e;g.includes(n)||Ht.notifyEvent("checklist-step-completed",{checklistId:h.id,outboundId:h.outboundId,stepId:n.id,stepIndex:r,step:n,completedSteps:h.completedSteps,status:h.status,data:h})},v=0;v<f.length;v++)m(v);"done"===h.status&&Ht.notifyEvent("checklist-completed",{checklistId:h.id,outboundId:h.outboundId,completedSteps:h.completedSteps,status:h.status,data:h}),"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!==Lf.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(!py.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{jm.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=Rv(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 Ov(3e3,e-1,6e4,t)}},{key:"reconnectDelay",value:function(e,t){return Ov(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&&Iv(t.prototype,n),r&&Iv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Dv(e){return Dv="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},Dv(e)}function Nv(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,_v(r.key),r)}}function jv(e,t,n){return(t=_v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _v(e){var t=function(e,t){if("object"!=Dv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Dv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Dv(t)?t:String(t)}Tv(Pv,"instance",void 0);var Fv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),jv(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=Lf.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=Lf.getInstance().session)||void 0===t?void 0:t.gleapId;if(!e.gleapId||!n||e.gleapId!==n)return;"notifications-cleared"===e.type&&(jm.getInstance().clearAllNotifications(!1,!0),N.getInstance().updateNotificationBadge(0)),"conversation-notifications-cleared"===e.type&&e.shareToken&&jm.getInstance().clearNotificationsForConversation(e.shareToken,!0),"chatbar-notification-cleared"===e.type&&Nn.getInstance().hideChatbarNotification(!0)}catch(r){}}},{key:"stop",value:function(){try{this.channel&&this.channel.close()}catch(e){}this.channel=null}}])&&Nv(t.prototype,n),r&&Nv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Bv(e){return Bv="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},Bv(e)}function Uv(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,zv(r.key),r)}}function Hv(e,t,n){return(t=zv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zv(e){var t=function(e,t){if("object"!=Bv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Bv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bv(t)?t:String(t)}jv(Fv,"instance",void 0);var qv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Hv(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}}])&&Uv(t.prototype,n),r&&Uv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Wv(e){return Wv="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},Wv(e)}function Vv(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,$v(r.key),r)}}function Gv(e,t,n){return(t=$v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $v(e){var t=function(e,t){if("object"!=Wv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Wv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wv(t)?t:String(t)}Hv(qv,"instance",void 0);var Xv=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Gv(this,"overrideLanguage",""),Gv(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=Ku.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=Ku.getInstance().getFlowConfig();this.isRTLLayout=!1,e&&e.localizationOptions&&e.localizationOptions.rtl&&(this.isRTLLayout=!0),N.getInstance().updateFeedbackButtonState(),ig.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}}])&&Vv(t.prototype,n),r&&Vv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kv(e){return Kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kv(e)}Gv(Xv,"instance",void 0);var Jv={card:"survey",full:"survey_full",page:"survey_page"},Yv={card:"card",survey:"card",full:"full",survey_full:"full",survey_web:"full",page:"page",survey_page:"page"},Zv=function(e){if(!e||"undefined"==typeof document)return null;if("string"==typeof e)try{return document.querySelector(e)}catch(t){return null}return"object"===Kv(e)&&1===e.nodeType?e:null},Qv=function(e){var t={};if(!e||"object"!==Kv(e)||Array.isArray(e))return t;for(var n=Object.keys(e).slice(0,50),r=0;r<n.length;r++){var o=n[r],i=e[o];!o||o.length>100||("string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i||(t[o]=String(i).slice(0,1e3)))}return t},ey=function(e){var t=e&&"object"===Kv(e)?e:{format:e},n="string"==typeof t.format?t.format:"",r=Yv[n]||"card",o={format:r,appMode:"survey_web"===n?"survey_web":Jv[r],fields:Qv(t.fields),resume:!0===t.resume,container:"page"===r?Zv(t.container):null};return!0===t.keyboard&&(o.keyboard=!0),"string"==typeof t.personalToken&&t.personalToken.length>0&&(o.personalToken=t.personalToken),"string"==typeof t.outboundAction&&t.outboundAction.length>0&&(o.outboundAction=t.outboundAction),t.resumeData&&"object"===Kv(t.resumeData)&&!Array.isArray(t.resumeData)&&(o.resumeData=t.resumeData),o};function ty(e){return ty="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},ty(e)}function ny(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,ay(r.key),r)}}function ry(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 oy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ry(Object(n),!0).forEach((function(t){iy(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ry(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function iy(e,t,n){return(t=ay(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ay(e){var t=function(e,t){if("object"!=ty(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ty(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ty(t)?t:String(t)}"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,oy(oy({},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),Mu(Iu(e=Eu(this,t)),"activeStep",-1),Mu(Iu(e),"checklistData",null),Mu(Iu(e),"_isInitialLoad",!1),Mu(Iu(e),"_initialActiveSet",!1),Mu(Iu(e),"_hasLoaded",!1),Mu(Iu(e),"_isSessionReady",!1),Mu(Iu(e),"_boundHandleChecklistUpdate",e.handleChecklistUpdate.bind(Iu(e))),Mu(Iu(e),"_boundHandleSessionUpdate",e.handleSessionUpdate.bind(Iu(e))),e.attachShadow({mode:"open"});try{e._networkManager=void 0!==Lf&&void 0!==A?A.getInstance():null}catch(n){e._networkManager=null}return e._boundFloatingLauncherClick=e.handleFloatingLauncherClick.bind(Iu(e)),e._boundFloatingCloseClick=e.handleFloatingCloseClick.bind(Iu(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&&Ou(e,t)}(t,e),n=t,r=[{key:"connectedCallback",value:function(){En.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!==Lf?Lf.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 Xv.translateText(e)||t}},{key:"_translateWithVars",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Xv.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!==Xv&&(n=Xv.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),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,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!==Xv&&(l=Xv.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=xu(this.checklistData.completedSteps||[]),o=!1,i=!1,a=this.activeStep;if(t.completedSteps&&JSON.stringify(t.completedSteps)!==JSON.stringify(r)&&(this.checklistData.completedSteps=xu(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),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,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)})),h=i.length>0?p?p.title||this._translateWithVars("stepDefaultTitle",{index:i.indexOf(p)+1},"Step ".concat(i.indexOf(p)+1)):"":e.subject||"",f=i.length>0?p&&p.description||"":e.message||"";o&&(h=(null===(u=e.config)||void 0===u?void 0:u.successTitle)||"",f=(null===(d=e.config)||void 0===d?void 0:d.successMessage)||"",s=100);var g=2*Math.PI*7,m=g-s/100*g,v="checklist-floating-header"===r,y=v?'<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(h,"</div>\n ").concat(o?"":'<span class="floating-icon">'.concat(y,"</span>"),'\n </div>\n <div class="floating-subtitle">').concat(f,"</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>"):"",h=["checklist-task",o?"checklist-task--done":"",i?"checklist-task--active":""].filter(Boolean).join(" ");return'\n <div part="task" class="'.concat(h,'" 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=Ku.getInstance().getFlowConfig(),d=u.color?u.color:"#485BFF";En.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!==py){var o=e.checklistData.outbound.config.steps[r];if(o&&o.action&&"none"!==o.action&&!$n("start-custom-action"))try{"BOT"===o.action?py.startBot(o.botId):"CUSTOM_ACTION"===o.action?py.triggerCustomAction(o.actionBody):"REDIRECT_URL"===o.action?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),py.openURL(o.actionBody,!!o.actionOpenInNewTab)):"FEEDBACK_FLOW"===o.action?py.startFeedbackFlow(o.formId):"NEWS_ARTICLE"===o.action?py.openNewsArticle(o.articleId):"HELP_ARTICLE"===o.action?py.openHelpCenterArticle(o.articleId):"CHECKLIST"===o.action?py.startChecklist(o.outboundId,!0,null==o?void 0:o.sharedKey):"PRODUCT_TOUR"===o.action&&py.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&&Cu(n.prototype,r),o&&Cu(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Tu(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 Pt(Lt(e=Tt(this,t,[].concat(r))),"_iframe",null),Pt(Lt(e),"_agentConvUrl",Nt),Pt(Lt(e),"_messageListener",null),Pt(Lt(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&&Mt(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=Nt,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=St[Ct].apiUrl,r="",o="",i="";try{var a,s,c=Lf.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:{}}),"*")}}])&&It(n.prototype,r),o&&It(n,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(Ot(HTMLElement));customElements.define("gleap-agent-conversation",e)}}());var sy=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),iy(this,"initialized",!1),iy(this,"offlineMode",!1),iy(this,"disablePageTracking",!1),iy(this,"disableInAppNotifications",!1),iy(this,"disableQueryParams",!1),iy(this,"globalData",{screenRecordingData:null,webReplay:null,snapshotPosition:{x:0,y:0}}),"undefined"!=typeof window&&(Eg.getInstance(),Cd.getInstance().start(),Bu.getInstance().start(),ut.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(){ig.getInstance().destroy(),Ku.getInstance().start().then((function(){N.getInstance().refresh(),jm.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&&!ff(window.location.href,r))continue;if("notification"===r.actionType)"widget"===(null==r||null===(a=r.data)||void 0===a||null===(a=a.checklist)||void 0===a?void 0:a.popupType)?e.openChecklist(r.data.checklist.id,!0):this.disableInAppNotifications||e.showNotification(r);else if("banner"===r.actionType)e.showBanner(r);else if("modal"===r.actionType)e.showModal(r);else if("tour"===r.actionType)e.startProductTourWithConfig(r.outbound,r.data,!1);else{if("survey_page"===ig.getInstance().appMode)continue;e.showSurvey(r.actionType,{format:r.format,resume:!0===r.resume,resumeData:!0===r.resume?r.data:void 0,outboundAction:r._id||r.id})}}}}},{key:"setGlobalDataItem",value:function(e,t){this.globalData[e]=t}},{key:"getGlobalDataItem",value:function(e){return this.globalData[e]}},{key:"takeCurrentReplay",value:function(){var e=Ga.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){Eg.getInstance().environment=e}},{key:"setEnvDataPropsToIgnore",value:function(e){Eg.setEnvDataPropsToIgnore(e)}},{key:"setDisableEnvData",value:function(e){Eg.setDisableEnvData(e)}},{key:"setCSPNonce",value:function(e){!function(e){z=U(e)}(e)}},{key:"setTags",value:function(e){qv.getInstance().setTags(e)}},{key:"setUrlHandler",value:function(e){ig.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(){Cd.getInstance().stop()}},{key:"setAiTools",value:function(e){Jt.getInstance().setAgentTools(e),Nn.getInstance().sendAgentToolsUpdate(),ig.getInstance().sendConfigUpdate()}},{key:"attachNetworkLogs",value:function(e){Mm.getInstance().setExternalRequests(ee(e))}},{key:"log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"INFO";Cd.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{Ga.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,h=window.visualViewport;h.addEventListener("resize",i),h.addEventListener("scroll",i),window.addEventListener("orientationchange",(function(){try{i()}catch(o){}})),e()}catch(o){}}()}catch(o){}var r=Lf.getInstance();r.sdkKey=t,r.setOnSessionReady((function(){setTimeout((function(){Ku.getInstance().start().then((function(){Pv.getInstance().start(),se((function(){N.getInstance().injectFeedbackButton(),jm.getInstance().injectNotificationUI(),e.checkForUncompletedTour(),e.checkForUrlParams();try{wu.getInstance().resumeFromStorage()}catch(t){}Ht.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];ig.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");if(i&&i.length>0){var s="survey_full"===a||"full"===a;e.showSurvey(i,s?"survey_full":"survey")}var c=t.get("gleap_tour");if(c&&c.length>0){var l=parseInt(t.get("gleap_tour_delay"));isNaN(l)&&(l=2),setTimeout((function(){e.startProductTour(c)}),1e3*l)}}catch(u){}}},{key:"destroy",value:function(){try{wu.getInstance().destroy()}catch(e){}Ga.getInstance().stop(),Pv.getInstance().stop(),ig.getInstance().destroy(),N.getInstance().destroy(),jm.getInstance().clearAllNotifications(!0),Fv.getInstance().stop(),Nn.getInstance().destroy(),Lf.getInstance().clearSession(0,!1),lr.getInstance().removeBannerUI(),this.instance=null}},{key:"closeBanner",value:function(){lr.getInstance().removeBannerUI()}},{key:"closeModal",value:function(){Rg.getInstance().hideModal()}},{key:"showAiChatbar",value:function(){var e=Nn.getInstance();e.manuallyHidden=!1,e.manuallyShown=!0,e.show()}},{key:"hideAiChatbar",value:function(){var e=Nn.getInstance();e.manuallyHidden=!0,e.manuallyShown=!1,e.hide()}},{key:"startAgent",value:function(e,t){try{Nn.getInstance().showWithAgent(e,t)}catch(n){}}},{key:"setAiChatbarQuickActions",value:function(e){Nn.getInstance().setQuickActions(e)}},{key:"setAiChatbarPlaceholder",value:function(e){Nn.getInstance().setPlaceholder(e)}},{key:"setUseCookies",value:function(e){Lf.getInstance().useCookies=e}},{key:"disableLocalStorage",value:function(){Lf.getInstance().localStorageDisabled=!0}},{key:"identify",value:function(e,t,n){return Lf.getInstance().identifySession(e,ne(ee(t)),n)}},{key:"updateContact",value:function(e){return Lf.getInstance().updateSession(ne(ee(e)))}},{key:"clearIdentity",value:function(){Lf.getInstance().clearSession()}},{key:"getIdentity",value:function(){return Lf.getInstance().getSession()}},{key:"isUserIdentified",value:function(){var e=Lf.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return ig.getInstance().isOpened()}},{key:"hide",value:function(){ig.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){Mm.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){Mm.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){Mm.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){Mm.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){Ga.getInstance().setOptions(e)}},{key:"setCaptureEnabled",value:function(e){wu.getInstance().setCaptureEnabled(e)}},{key:"setRemoteLogCollectionEnabled",value:function(e){wu.getInstance().setRemoteLogCollectionEnabled(e)}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ig.getInstance().hideWidget(e)}},{key:"open",value:function(){ig.getInstance().setAppMode("widget"),ig.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Pv.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Pv.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=ee(e);Hm.getInstance().formPreFill=t,ig.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?Cv.getInstance().start():Cv.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){N.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){Eg.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){Eg.setAppBuildNumber(e)}},{key:"setRegion",value:function(e){Lf.getInstance().setRegion(e)}},{key:"getRegion",value:function(){return Lf.getInstance().getRegion()}},{key:"setWSApiUrl",value:function(e){Lf.getInstance().wsApiUrl=e}},{key:"setRealtimeHost",value:function(e){Lf.getInstance().realtimeHost=e}},{key:"setApiUrl",value:function(e){Lf.getInstance().apiUrl=e}},{key:"setBannerUrl",value:function(e){lr.getInstance().setBannerUrl(e)}},{key:"setModalUrl",value:function(e){Rg.getInstance().setModalUrl(e)}},{key:"setAgentConversationUrl",value:function(e){jt(e)}},{key:"setFrameUrl",value:function(e){ig.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){jd.getInstance().setTicketAttribute(e,t)}},{key:"unsetTicketAttribute",value:function(e){jd.getInstance().unsetTicketAttribute(e)}},{key:"clearTicketAttributes",value:function(){jd.getInstance().clearTicketAttributes()}},{key:"attachCustomData",value:function(e){jd.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){jd.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){jd.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){jd.getInstance().clearCustomData()}},{key:"playSound",value:function(e){Un.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=jm.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){Xv.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){Md.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){Md.triggerCustomAction(e)}},{key:"setColorScheme",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};En.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]:N.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),h="#ffffff"===p,f=c||t,g=l||t,m=de(o,h?100:-120),v=de(o,h?30:-12),y=de(o,h?80:-30),b=h?o:"#fff",w=h?p:"#2d2d2d",k=(r=parseInt(r,10),Math.round(1.05*r)),x=Math.round(.8*r),S=Math.round(.4*r),C=Math.round(.25*r),E=Math.max(2,Math.round(.55*r)),I=Math.max(2,Math.round(20*E/32)),T=57+a;s===N.FEEDBACK_BUTTON_CLASSIC_BOTTOM?T=a+15:(s&&s.includes("CLASSIC")||s===N.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-shown.gleap-b-clip {\n transition: padding 0.3s ease-out;\n margin-top: 0px;\n padding-top: calc(var(--gleap-margin-top) + var(--gleap-b-body-padding-top, 0px));\n }\n\n .gleap-b-clip .gleap-b {\n top: 0px;\n }\n\n .gleap-b {\n display: none;\n position: absolute;\n top: calc(-1 * var(--gleap-margin-top));\n left: 0px;\n width: 100vw;\n height: var(--gleap-margin-top);\n z-index: ").concat(2147483699,";\n }\n\n @keyframes gleapSlideIn {\n from {\n top: calc(-1 * var(--gleap-margin-top));\n }\n to {\n top: 10px;\n }\n }\n\n .gleap-b-f .gleap-b {\n position: fixed;\n top: 10px;\n animation: gleapSlideIn .25s ease-out forwards;\n max-width: 800px;\n width: calc(100% - 20px);\n left: 50%;\n z-index: ").concat(2147483699,";\n transform: translateX(-50%);\n border-radius: ").concat(S,"px;\n overflow: hidden;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.15), 0px 5px 5px rgba(0, 0, 0, 0.05);\n }\n\n .gleap-b-shown .gleap-b {\n display: block;\n }\n\n .gleap-image-view {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n z-index: ").concat(2147483699,";\n background-color: ").concat(p,"cc;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-image-view-image {\n width: 90%;\n height: auto;\n max-width: 90%;\n max-height: 90%;\n object-fit: contain;\n }\n\n .gleap-image-view-close {\n position: fixed;\n top: 20px;\n right: 20px;\n width: 32px;\n height: 32px;\n opacity: 0.8;\n z-index: ").concat(2147483740,";\n box-shadow: 0px 5px 18px rgba(0, 0, 0, 0.16);\n cursor: pointer;\n }\n\n .gleap-image-view-close:hover {\n opacity: 1;\n }\n\n .gleap-image-view-close svg path {\n fill: ").concat(o,";\n }\n\n [dir=rtl].gleap-frame-container {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container iframe {\n transition: opacity 0.3s ease;\n }\n\n .gleap-frame-container--loading iframe {\n opacity: 0;\n transition: none;\n }\n\n .gleap-frame-loader {\n visibility: hidden;\n opacity: 0;\n transition: opacity 0.3s ease, visibility 0s linear 0.35s;\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n overflow: hidden;\n background-color: ").concat(o,";\n pointer-events: none;\n }\n\n .gleap-frame-container--loading .gleap-frame-loader {\n visibility: visible;\n opacity: 1;\n transition: none;\n }\n\n .gleap-frame-loader svg {\n display: block;\n width: 100%;\n height: auto;\n }\n\n .gleap-frame-loader .gleap-bg-base {\n fill: ").concat(o,";\n }\n\n .gleap-frame-loader .gleap-bg-c1 {\n fill: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-c2 {\n fill: ").concat(f,";\n }\n\n .gleap-frame-loader .gleap-bg-c3 {\n fill: ").concat(g,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-1 {\n stop-color: ").concat(f,";\n }\n\n .gleap-frame-loader .gleap-bg-grad-2 {\n stop-color: ").concat(t,";\n }\n\n .gleap-frame-loader .gleap-bg-fade {\n stop-color: ").concat(o,";\n }\n\n @keyframes gleapBgGrowShrink2 {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.35);\n }\n }\n\n @keyframes gleapBgGrowShrink3 {\n 0%, 100% {\n transform: scale(1) rotate(0deg);\n }\n 50% {\n transform: scale(1.3) rotate(20deg);\n }\n }\n\n .gleap-frame-loader--animate .gleap-bg-c2 {\n animation: gleapBgGrowShrink2 7s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader--animate .gleap-bg-c3 {\n animation: gleapBgGrowShrink3 6s infinite;\n transform-origin: 50% 50%;\n }\n\n .gleap-frame-loader-blur {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n -webkit-backdrop-filter: blur(30px);\n backdrop-filter: blur(30px);\n }\n\n .gleap-frame-loader--image {\n background-color: #ffffff;\n }\n\n .gleap-frame-loader-image-wrap {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0;\n transition: opacity 0.25s ease-in;\n }\n\n .gleap-frame-loader--dockedbar .gleap-frame-loader-image-wrap {\n bottom: 80px;\n }\n\n /* v4 header block: top-anchored, height driven by the strut child + the\n header's 150px padding-bottom — mirrors .agent-home-v4-header so the\n brand surface is exactly as tall as the app's, at any width/wrap. */\n .gleap-frame-loader-header {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n padding-bottom: 150px;\n overflow: hidden;\n }\n\n .gleap-frame-loader-header--colour {\n background: linear-gradient(\n 180deg,\n ").concat(t," 0%,\n ").concat(f,' 100%\n );\n }\n\n /* Strut: invisible height driver replicating the header\'s content box. */\n .gleap-frame-loader-strut {\n position: relative;\n z-index: 1;\n visibility: hidden;\n /* Match the messenger\'s font stack EXACTLY (and reset any inherited host\n font metrics), so the title wraps to the same number of lines the app\n will — 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 /* Surveys 2.0 — card: a compact popover in the launcher's corner. */\n .gleap-frame-container--survey {\n bottom: ").concat(a,"px !important;\n bottom: calc(").concat(a,"px + env(safe-area-inset-bottom, 0px)) !important;\n max-width: 348px;\n border-radius: 24px;\n box-shadow: 0 14px 44px rgba(16, 24, 40, 0.18), 0 0 0 1px rgba(16, 24, 40, 0.06);\n animation: gleapSurveyCardIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both, gleapWidgetFade 0.18s ease-out both;\n transition: none;\n }\n\n /* The survey's corners (survey-theme from the messenger); rounded is the 24px above. */\n .gleap-frame-container--survey.gleap-frame-container--corners-sharp {\n border-radius: 10px;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-pill {\n border-radius: 32px;\n }\n\n /* Card and page surveys stay invisible until the messenger reports their height. */\n .gleap-frame-container--measuring {\n visibility: hidden !important;\n animation: none !important;\n pointer-events: none !important;\n }\n\n .gleap-frame-container--extended {\n max-width: 690px !important;\n }\n\n /* Expanded by the end user (expand/collapse button in the messenger header).\n 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 /* Surveys 2.0 — full screen: the frame covers the viewport and the messenger draws the\n brand-tinted, Typeform-style background and the close button itself. */\n .gleap-frame-container--survey-full,\n [dir=rtl].gleap-frame-container--survey-full {\n position: fixed;\n top: 0 !important;\n left: 0 !important;\n bottom: 0 !important;\n right: 0 !important;\n width: 100% !important;\n max-width: none !important;\n height: 100vh;\n height: 100dvh !important;\n min-height: 0 !important;\n max-height: none !important;\n background-color: transparent;\n border-radius: 0 !important;\n box-shadow: none !important;\n transform: none;\n animation: gleapWidgetFade 0.28s ease-out both !important;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner {\n width: 100% !important;\n height: 100% !important;\n max-width: none !important;\n max-height: none !important;\n border-radius: 0;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner:before {\n display: none;\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--closing {\n animation: gleapWidgetFadeOut 0.22s ease-in both !important;\n }\n\n /* Legacy surveys (the messenger fell back to the pre-2.0 flow): the old survey chrome. */\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy {\n max-width: 410px;\n border-radius: ").concat(1.5*x,"px;\n box-shadow: 0px 5px 40px 0px rgba(9, 14, 21, 0.16);\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy .gleap-frame-container-inner {\n width: calc(100% - 24px) !important;\n max-width: 640px !important;\n height: calc(100% - 40px) !important;\n border-radius: ").concat(x,"px;\n overflow: hidden;\n }\n\n .gleap-frame-container--survey-full.gleap-frame-container--survey-legacy .gleap-frame-container-inner:before {\n display: block;\n }\n\n /* Surveys 2.0 — page: an inline frame in the host's container, as tall as the survey. */\n .gleap-frame-container.gleap-frame-container--survey-page,\n [dir=rtl].gleap-frame-container.gleap-frame-container--survey-page {\n position: relative !important;\n top: auto !important;\n right: auto !important;\n bottom: auto !important;\n left: auto !important;\n width: 100% !important;\n max-width: none !important;\n height: auto !important;\n min-height: 0 !important;\n max-height: none !important;\n z-index: auto;\n box-shadow: none !important;\n border-radius: 0 !important;\n background-color: transparent;\n transform: none !important;\n animation: gleapWidgetFade 0.3s ease-out both !important;\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n width: 100% !important;\n height: 360px;\n max-height: none !important;\n }\n\n .gleap-frame-container--survey-page.gleap-frame-container--animate .gleap-frame-container-inner {\n transition: height 0.28s cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner:before,\n .gleap-frame-container--survey-page .gleap-frame-loader {\n display: none;\n }\n\n .gleap-frame-container--classic {\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--no-button {\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--classic-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(a,"px;\n }\n\n .gleap-frame-container--modern-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n [dir=rtl].gleap-frame-container--modern-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(61+a,"px;\n }\n\n .gleap-frame-container--animate {\n pointer-events: auto !important;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetOut 0.2s cubic-bezier(0.4, 0, 1, 1) both !important;\n pointer-events: none !important;\n }\n\n .gleap-frame-container--modern-left,\n .gleap-frame-container--classic-left {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container {\n transform-origin: left bottom;\n }\n\n [dir=rtl].gleap-frame-container--modern-left,\n [dir=rtl].gleap-frame-container--classic-left {\n transform-origin: right bottom;\n }\n\n @keyframes gleapWidgetScale {\n from { transform: scale(0.9); }\n to { transform: scale(1); }\n }\n\n @keyframes gleapWidgetFade {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes gleapWidgetOut {\n from { opacity: 1; transform: scale(1); }\n to { opacity: 0; transform: scale(0.96); }\n }\n\n @keyframes gleapWidgetFadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n }\n\n @keyframes gleapSurveyCardIn {\n from { transform: translateY(14px) scale(0.98); }\n to { transform: translateY(0) scale(1); }\n }\n\n @keyframes gleapWidgetSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n\n @keyframes gleapWidgetSlideDown {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(100%); }\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes gleapFadeInUpMobile {\n from {\n opacity: 0;\n transform: translate3d(0, 10%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .gleap-notification-container {\n position: fixed;\n bottom: ").concat(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(h?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.04)",";\n /* A barely-there contact shadow + a large, soft ambient throw. */\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 10px 30px rgba(0, 0, 0, 0.1);\n margin-bottom: 12px;\n cursor: pointer;\n transition: box-shadow 0.15s ease-out;\n }\n\n .gleap-notification-item-container:hover,\n .gleap-notification-item-news-container:hover,\n .gleap-notification-item-checklist-container:hover {\n box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.05), 0px 14px 38px rgba(0, 0, 0, 0.14);\n }\n\n @keyframes gleapNotificationIn {\n from {\n opacity: 0;\n transform: translate3d(0, 12px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n /* More than one notification collapses into a stack: the newest card in\n front, older ones peeking out behind its top edge like a deck. Hovering\n the stack (or tapping it on touch devices, which adds --expanded)\n spreads it back into the full list.\n\n Every stacked card is bottom-anchored and placed purely via translateY\n offsets that updateStackLayout() measures and writes as CSS vars, so\n collapsing and expanding is one smooth transform + height transition\n rather than a layout jump. */\n .gleap-notification-card {\n position: relative;\n }\n\n .gleap-notification-container--stack {\n height: var(--gleap-nstack-h-collapsed, auto);\n transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n .gleap-notification-container--stack:hover,\n .gleap-notification-container--stack.gleap-notification-container--expanded {\n height: var(--gleap-nstack-h-expanded, auto);\n }\n\n .gleap-notification-container--stack .gleap-notification-card {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n transform: translateY(var(--gleap-nstack-expand, 0px));\n transform-origin: top center;\n /* The negative inset keeps the box-shadow outside the clip region. */\n clip-path: inset(-40px);\n transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), clip-path 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease-out;\n }\n\n /* The entrance animation's fill pins transform at translate3d(0,0,0),\n which would defeat the stack offsets — 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(E,"px;\n }\n\n .gleap-notification-item-news-sender-avatar--bot {\n border-radius: ").concat(I,"px;\n }\n\n [dir=rtl] .gleap-notification-item-avatar {\n margin-left: 10px;\n margin-right: 0px !important;\n }\n\n /* min-width: 0 so a long unbroken word shrinks the body instead of pushing\n the card past the container. */\n .gleap-notification-item-body {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n }\n\n .gleap-notification-item-content {\n line-height: 20px;\n color: ").concat(p,";\n word-wrap: break-word;\n word-break: break-word;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-meta {\n display: flex;\n align-items: center;\n margin-top: 5px;\n font-size: 13px;\n line-height: 18px;\n color: ").concat(m,";\n overflow: hidden;\n }\n\n .gleap-notification-item-sender {\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .gleap-notification-item-meta-dot {\n margin: 0px 5px;\n opacity: 0.6;\n }\n\n .gleap-notification-item-time {\n white-space: nowrap;\n }\n\n .gleap-frame-container-inner {\n position: relative;\n width: 100%;\n height: calc(100vh - ").concat(84+a,"px);\n max-height: ").concat(700,"px;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: calc(100vh - ").concat(a+24,"px);\n height: calc(100dvh - ").concat(a+24,"px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));\n }\n\n /* Behind the survey card the frame shows the survey's surface, not the widget background. */\n .gleap-frame-container--survey .gleap-frame-container-inner:before {\n background-color: var(--gleap-survey-surface, ").concat(o,");\n }\n\n /* The page frame takes the survey's color-scheme (the messenger sets the same on its document),\n so the browser keeps the iframe transparent on the host's backdrop, whatever the host's scheme. */\n .gleap-frame-container--survey-page {\n color-scheme: light;\n }\n\n .gleap-frame-container--survey-page.gleap-frame-container--survey-dark {\n color-scheme: dark;\n }\n\n /* Smooth resizes between questions (not on the first measure, which happens before --animate). */\n .gleap-frame-container--survey.gleap-frame-container--animate .gleap-frame-container-inner {\n transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1);\n }\n \n .gleap-frame-container-inner:before {\n content: \" \";\n position: absolute;\n width: 100%;\n height: calc(100% - ").concat(x,"px);\n top: ").concat(x,"px;\n background-color: ").concat(o,";\n z-index: -1;\n }\n \n .gleap-frame-container iframe {\n height: 100% !important;\n width: 100% !important;\n max-width: 100% !important;\n display: block !important;\n pointer-events: auto !important;\n }\n \n .gleap-frame-container--hidden {\n display: none !important;\n pointer-events: none;\n animation: none !important;\n }\n\n /* Capture requests: hidden while the customer captures the page (the iframe stays alive), and\n the whole viewport while the Messenger's capture editor is open. */\n .gleap-frame-container--capture-hidden {\n visibility: hidden !important;\n pointer-events: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor {\n top: 0 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n width: 100vw !important;\n max-width: 100vw !important;\n height: 100vh !important;\n height: 100dvh !important;\n min-height: 0 !important;\n max-height: none !important;\n border-radius: 0 !important;\n transform: none !important;\n animation: none !important;\n }\n\n .gleap-frame-container--capture-editor .gleap-frame-container-inner {\n width: 100% !important;\n height: 100% !important;\n max-height: none !important;\n }\n \n .bb-feedback-button {\n margin: 0px;\n position: fixed;\n bottom: ").concat(a,"px;\n right: ").concat(i,"px;\n border-radius: 30px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: transparent;\n color: #000000;\n z-index: ").concat(2147483630,";\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 0px;\n }\n\n @keyframes bbRedDotPulse {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 1;\n }\n }\n\n .bb-feedback-button--red-dot {\n position: absolute;\n top: 0px;\n right: 0px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #ff3b30;\n box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n z-index: ").concat(2147483631,";\n animation: bbRedDotPulse 2s ease-in-out infinite;\n }\n\n [dir=rtl].bb-feedback-button {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n \n .bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n\n [dir=rtl].bb-feedback-button--bottomleft {\n bottom: ").concat(a,"px;\n right: ").concat(i,'px;\n left: auto;\n }\n \n .bb-feedback-button--disabled {\n display: none !important;\n }\n\n .bb-feedback-button--hidden {\n display: none !important;\n }\n\n /* A survey takes the launcher\'s corner: the launcher steps aside while it is open (a pill or\n sharp card would otherwise show the launcher peeking out behind its corner). */\n .bb-feedback-button--open.bb-feedback-button--survey {\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n transition: opacity 0.15s ease, visibility 0s linear 0.15s;\n }\n \n .bb-feedback-button-text {\n padding: 8px 12px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n background-color: #fff;\n border-radius: 8px;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.15);\n position: relative;\n z-index: 99;\n }\n \n .bb-feedback-button-text:before {\n content: "";\n position: absolute;\n box-shadow: rgba(0, 0, 0, 0.04) 6px 6px 5px;\n transform: rotate(315deg);\n bottom: 16px;\n right: -4px;\n border-width: 10px;\n border-style: solid;\n border-color: transparent #fff #fff transparent;\n }\n \n .bb-feedback-button--bottomleft .bb-feedback-button-text:before {\n display: none;\n }\n \n .bb-feedback-button-text:after {\n content: "";\n position: absolute;\n bottom: 12px;\n right: 0px;\n background-color: #fff;\n width: 5px;\n height: 30px;\n }\n \n .bb-feedback-button-text-title {\n font-family: sans-serif;\n font-size: 14px;\n color: #666;\n line-height: 18px;\n max-width: 220px;\n }\n \n .bb-feedback-button-text-title b {\n color: #000000;\n font-weight: 600;\n }\n\n .bb-notification-bubble {\n position: absolute;\n top: -5px;\n right: -5px;\n min-width: 12px;\n padding: 0px 4px;\n height: 20px;\n min-width: 20px;\n border-radius: 20px;\n background-color: red;\n color: #fff;\n font-size: 11px;\n font-family: sans-serif;\n text-align: center;\n line-height: 20px;\n }\n\n .bb-notification-bubble--hidden {\n display: none;\n }\n \n .bb-feedback-button-icon {\n width: 48px;\n height: 48px;\n border-radius: 48px;\n background-color: #485bff;\n transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n position: relative;\n }\n \n .bb-feedback-button-classic {\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n top: 50%;\n right: 0px;\n position: fixed;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n padding: 9px 20px;\n text-align: center;\n background-color: #485bff;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n font-family: sans-serif;\n font-size: 16px;\n color: #fff;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.25);\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n \n .bb-feedback-button-classic--left {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--left {\n top: 50%;\n right: 0px;\n left: auto;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n }\n \n .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n right: ').concat(i,"px;\n left: auto;\n }\n \n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n left: ").concat(i,"px;\n right: auto;\n }\n\n .bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n \n .bb-feedback-button--open.bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeOutRight;\n }\n \n .bb-feedback-button .bb-logo-logo {\n position: absolute;\n width: 30px;\n height: 30px;\n top: 9px;\n left: 9px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n position: absolute;\n width: 14px;\n height: 14px;\n top: 17px;\n left: 17px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button--open .bb-logo-arrowdown {\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button--open .bb-logo-logo {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button-icon:hover {\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), 0px 0px 20px rgba(0, 0, 0, 0.2);\n transform: scale(1.1);\n }\n\n /* The overshoot curve lives in its own class (added only for the release)\n so plain hover in/out keeps its regular ease and never bounces. */\n .bb-feedback-button--springing .bb-feedback-button-icon {\n transition: transform 0.55s cubic-bezier(0.2, 2, 0.45, 1), box-shadow 0.2s ease-in-out;\n }\n\n .bb-feedback-button--pressed .bb-feedback-button-icon {\n transform: scale(0.875);\n transition: transform 0.11s cubic-bezier(0.2, 0, 0.4, 1), box-shadow 0.2s ease-in-out;\n box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2), 0px 0px 12px rgba(0, 0, 0, 0.1);\n }\n \n .bb-feedback-button--open .bb-feedback-button-text {\n animation-name: bbFadeOutDown;\n }\n \n .bb-feedback-button--open .bb-feedback-button-icon {\n display: flex;\n }\n \n .bb-capture-svg {\n position: fixed;\n z-index: ").concat(2147483614,";\n top: 0px;\n left: 0px;\n right: 0px;\n width: 100%;\n height: 100%;\n padding: 0px;\n margin: 0px;\n cursor: crosshair;\n }\n\n .bb-capture-svg--preview {\n cursor: auto !important;\n }\n \n .bb-rec-on-circle {\n animation-name: bbRecIconFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-rec-on-cont {\n animation-name: bbRecIconContFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-capture-editor-drag-info {\n position: fixed;\n top: -200px;\n left: 0px;\n z-index: ").concat(2147483616,";\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-editor-drag-info svg {\n width: 24px;\n height: 24px;\n }\n \n .bb-capture-editor-borderlayer {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n border: 4px solid ").concat(e,";\n cursor: crosshair;\n z-index: ").concat(2147483610,";\n box-sizing: border-box;\n pointer-events: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-borderlayer {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n .bb-capture-editor-recording .bb-capture-editor-borderlayer {\n border: 4px solid #eb144c !important;\n }\n \n .bb-capture-editor-recording .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-editor-item-inactive {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-toolbar-drawingitem {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-svg {\n pointer-events: none !important;\n }\n \n .bb-capture-toolbar {\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,";\n background-color: #fff;\n padding: 5px;\n display: flex;\n align-items: center;\n border-radius: 8px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-dismiss {\n position: fixed;\n top: 0px;\n right: 0px;\n z-index: ").concat(2147483618,";\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n width: 36px;\n height: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: ").concat(e,";\n border-bottom-left-radius: ").concat(C,"px;\n }\n\n [dir=rtl] .bb-capture-dismiss {\n top: 0px;\n left: 0px;\n right: auto;\n border-bottom-left-radius: 0px !important;\n border-bottom-right-radius: ").concat(C,"px;\n }\n \n .bb-capture-dismiss svg path {\n fill: ").concat(u,';\n }\n \n .bb-capture-dismiss svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n \n .bb-capture-button-next {\n font-family: sans-serif;\n box-sizing: border-box;\n font-weight: 600;\n text-align: center;\n width: auto;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n margin: 0px;\n line-height: 36px;\n padding: 0px 12px;\n font-size: 15px;\n margin-left: 12px;\n }\n\n [dir=rtl].bb-capture-editor .bb-capture-button-next {\n margin-left: auto;\n margin-right: 12px;\n }\n \n .bb-capture-toolbar-item-spacer {\n width: 1px;\n height: 38px;\n min-width: 1px;\n margin: 0px 5px;\n }\n \n .bb-capture-toolbar-item {\n width: 42px;\n height: 38px;\n min-width: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n position: relative;\n margin-right: 5px;\n }\n\n .drag-handle-item {\n cursor: grab !important;\n width: 34px;\n min-width: 34px;\n }\n\n .drag-handle-item svg {\n width: 18px !important;\n height: 18px !important;\n }\n \n .bb-capture-toolbar-item svg {\n width: 23px;\n height: 23px;\n object-fit: contain;\n }\n \n .bb-capture-toolbar-item-selectedcolor {\n border-radius: 100%;\n width: 20px;\n height: 20px;\n background-color: #db4035;\n }\n \n .bb-capture-toolbar-item[data-type="undo"] svg {\n width: 18px;\n height: 18px;\n }\n \n .bb-capture-toolbar-item[data-active="true"] {\n position: relative;\n }\n \n .bb-capture-preview {\n display: none;\n background-color: rgba(0, 0, 0, 0.6);\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n justify-content: center;\n align-items: center;\n z-index: ').concat(2147483620,";\n }\n \n .bb-capture-preview-inner {\n background-color: #fff;\n padding: 0px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n flex-direction: column;\n max-width: 640px;\n width: 100%;\n margin: 20px;\n }\n \n .bb-capture-preview-inner video {\n border-radius: 8px 8px 0px 0px;\n display: block;\n border: 0px;\n outline: none;\n width: 100%;\n max-height: 60vh;\n }\n \n .bb-capture-preview-buttons {\n display: flex;\n justify-content: space-between;\n padding: 14px;\n }\n \n .bb-capture-preview-retrybutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-sendbutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-retrybutton:hover,\n .bb-capture-preview-sendbutton:hover {\n opacity: 0.9;\n }\n \n .bb-capture-toolbar-item-recording {\n margin-right: 0px;\n }\n \n .bb-capture-toolbar-item-recording svg {\n width: 33px;\n height: 33px;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n position: fixed;\n top: 70px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,';\n background-color: #fff;\n display: none;\n padding: 10px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n }\n \n .bb-capture-toolbar-item-color {\n width: 20px;\n height: 20px;\n border-radius: 100%;\n margin-right: 12px;\n box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-toolbar-item-color:hover {\n box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.25);\n }\n \n .bb-capture-toolbar-item-color:last-of-type {\n margin-right: 0px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color {\n margin-right: auto;\n margin-left: 12px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color:last-of-type {\n margin-right: auto;\n margin-left: 0px;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:first-of-type {\n display: none;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:nth-of-type(2) {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:first-of-type {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:nth-of-type(2) {\n display: none;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #eee;\n }\n \n .bb-capture-toolbar-item:hover svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #f8f8f8;\n }\n \n .bb-capture-toolbar-item--active svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--inactivecross::before {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 3px;\n width: 26px;\n margin: auto;\n border-radius: 4px;\n background-color: #e80000;\n transform: rotate(45deg);\n }\n \n .bb-capture-toolbar-item--inactivecross svg {\n fill: #eee;\n }\n \n .bb-capture-toolbar-item-timer {\n text-align: left;\n line-height: 32px;\n font-size: 14px;\n font-family: sans-serif;\n margin: 5px;\n min-width: 40px;\n display: none;\n }\n \n .bb-capture-toolbar-item .bb-tooltip {\n background-color: #555;\n color: #fff;\n visibility: hidden;\n font-size: 14px;\n font-family: sans-serif;\n text-align: center;\n padding: 5px 10px;\n position: absolute;\n z-index: 1;\n top: 45px;\n left: 0px;\n transform: translateX(calc(-50% + 21px));\n opacity: 0;\n transition: opacity 0.3s;\n white-space: nowrap;\n }\n \n .bb-capture-toolbar-item .bb-tooltip::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 50%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n transform: rotate(180deg);\n border-color: #555 transparent transparent transparent;\n }\n \n .bb-capture-toolbar-item:hover .bb-tooltip {\n visibility: visible;\n opacity: 1;\n }\n \n .bb-capture-options {\n display: none;\n }\n \n .bb-capture-options--active {\n display: flex;\n }\n\n @keyframes bbFadeOutRight {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbFadeOutDown {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n }\n \n @keyframes bbFadeInOpacity {\n from {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n @keyframes bbZoomOut {\n from {\n opacity: 1;\n }\n \n 50% {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbZoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n 50% {\n opacity: 1;\n }\n }\n \n @keyframes bbRecIconContFade {\n 0% {\n fill: #b10802;\n }\n 50% {\n fill: #ff0000;\n }\n 100% {\n fill: #b10802;\n }\n } \n .bb-capture-preview-retrybutton {\n color: ').concat(p,";\n border-radius: ").concat(k,"px;\n background-color: ").concat(v,";\n }\n .bb-capture-preview-retrybutton:hover {\n background-color: ").concat(y,";\n }\n @keyframes bb-suc-fill {\n 100% {\n box-shadow: inset 0px 0px 0px 30px ").concat(e,";\n }\n }\n .bb-capture-toolbar-item-spacer {\n background-color: ").concat(v,";\n }\n .bb-tooltip {\n border-radius: ").concat(S,"px;\n }\n @keyframes bbRecIconFade {\n 0% {\n fill: transparent;\n }\n 50% {\n fill: ").concat(y,";\n }\n 100% {\n fill: transparent;\n }\n }\n .bb-capture-preview-sendbutton {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(k,"px;\n }\n .bb-capture-button-next {\n color: ").concat(u,";\n background-color: ").concat(e,";\n border-radius: ").concat(C,"px;\n }\n .bb-capture-preview-inner {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-timer {\n color: ").concat(m,";\n }\n .bb-svg-path {\n fill: ").concat(p,";\n }\n .bb-capture-toolbar-item {\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar {\n background-color: ").concat(o,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-colorpicker {\n background-color: ").concat(o,";\n }\n .bb-capture-toolbar-item--active {\n background-color: ").concat(v,";\n }\n .bb-feedback-button-classic {\n border-top-left-radius: ").concat(S,"px;\n border-top-right-radius: ").concat(S,"px;\n }\n .bb-logo-logo--default path {\n fill: ").concat(d,";\n }\n .bb-logo-arrowdown {\n fill: ").concat(d,";\n }\n .bb-feedback-button-icon {\n background-color: ").concat(n,";\n }\n .bb-feedback-button-classic {\n background-color: ").concat(n,";\n color: ").concat(d,";\n }\n\n @media only screen and (max-width: 450px) {\n [dir=rtl].gleap-frame-container,\n .gleap-frame-container {\n left: 0px;\n right: 0px;\n width: 100vw;\n max-width: 100vw;\n min-height: 100vh;\n max-height: 100vh;\n min-height: 100dvh !important;\n max-height: 100dvh !important;\n top: 0px;\n bottom: 0px;\n border-radius: 0px;\n transform-origin: center bottom;\n animation: gleapWidgetSlideUp 0.34s cubic-bezier(0.16, 1, 0.3, 1) both, gleapWidgetFade 0.15s ease-out both;\n }\n\n .gleap-frame-container--closing {\n animation: gleapWidgetSlideDown 0.26s cubic-bezier(0.4, 0, 1, 1) both !important;\n }\n\n .gleap-frame-container-inner {\n width: 100vw;\n height: 100%;\n }\n\n .gleap-frame-container:not(.gleap-frame-container--survey):not(.gleap-frame-container--survey-full):not(.gleap-frame-container--survey-page) .gleap-frame-container-inner {\n max-height: calc(var(--glvh, 1vh) * 100) !important;\n }\n\n /* Card surveys become a floating sheet (iOS 26 style): inset from the edges and above the\n home indicator, rounded on all corners, layered shadow, dimmed page behind. */\n .gleap-frame-container--survey,\n [dir=rtl].gleap-frame-container--survey {\n top: auto !important;\n bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;\n left: 8px !important;\n right: 8px !important;\n width: auto !important;\n max-width: none !important;\n height: auto !important;\n min-height: 0 !important;\n max-height: calc(100vh - 24px) !important;\n max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;\n box-sizing: border-box;\n padding-top: 15px;\n padding-bottom: 0;\n /* The survey's surface (survey-theme), so a dark survey has no light handle strip. */\n background-color: var(--gleap-survey-surface, ").concat(o,');\n border-radius: 32px 32px 40px 40px !important;\n overflow: hidden;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 100vmax rgba(10, 12, 16, 0.25);\n transform-origin: center bottom;\n transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1);\n animation: gleapWidgetSlideUp 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) both, gleapWidgetFade 0.2s ease-out both;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-sharp {\n border-radius: 14px !important;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--corners-pill {\n border-radius: 40px 40px 46px 46px !important;\n }\n\n .gleap-frame-container--survey:after {\n content: "";\n position: absolute;\n top: 8px;\n left: 50%;\n width: 36px;\n height: 5px;\n margin-left: -18px;\n border-radius: 5px;\n background-color: ').concat(h?"rgba(255, 255, 255, 0.28)":"rgba(16, 24, 40, 0.16)",";\n pointer-events: none;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-dark:after {\n background-color: rgba(255, 255, 255, 0.28);\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-light:after {\n background-color: rgba(16, 24, 40, 0.16);\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n width: 100% !important;\n height: calc(100vh - 39px) !important;\n height: calc(100dvh - 39px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;\n }\n\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n width: 100% !important;\n }\n\n /* Legacy card surveys: the old full-width panel at the bottom (no sheet chrome). */\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy,\n [dir=rtl].gleap-frame-container--survey.gleap-frame-container--survey-legacy {\n padding: 0;\n border-radius: 28px !important;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy:after {\n display: none;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--survey-legacy .gleap-frame-container-inner {\n height: calc(100vh - 12px) !important;\n height: calc(100dvh - 12px - env(safe-area-inset-top, 0px)) !important;\n }\n\n .bb-tooltip {\n display: none !important;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n top: 75px;\n }\n \n .bb-capture-button-next {\n margin-left: auto;\n }\n \n .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-toolbar {\n top: 15px;\n right: 15px;\n left: 15px;\n width: auto;\n transform: none;\n }\n\n .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-borderlayer {\n border-width: 4px;\n }\n }\n \n @media print {\n .bb-feedback-button {\n display: none !important;\n }\n \n .gleap-frame-container {\n display: none !important;\n }\n }\n\n .gleap-tour-sender {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n margin-bottom: 10px;\n }\n\n .gleap-tour-sender-image {\n width: 32px;\n height: 32px;\n border-radius: 32px;\n margin-right: 10px;\n background-size: cover;\n background-repeat: no-repeat;\n }\n\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: 550px;\n max-width: 550px;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: calc(100vw - 40px);\n max-width: calc(100vw - 40px);\n }\n }\n\n .gleap-tour-message,\n .gleap-tour-message p,\n .gleap-tour-message ul {\n color: ").concat(p,";\n }\n\n .gleap-tour-message h2 {\n font-weight: 600;\n font-size: 22px;\n }\n\n .gleap-tour-message h3 {\n font-weight: 600;\n font-size: 18px;\n }\n\n .gleap-tour-message p {\n line-height: 1.3;\n margin-bottom: 10px !important;\n margin-top: 10px !important;\n }\n\n .gleap-tour-message ul {\n line-height: 1.3;\n padding-left: 20px;\n margin-top: 10px !important;\n margin-bottom: 10px !important;\n }\n\n .gleap-tour-message {\n max-height: calc(80vh - 100px) !important;\n overflow-y: auto;\n min-width: 270px;\n }\n\n .gleap-tour-message::-webkit-scrollbar {\n width: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-track {\n border-radius: 0px;\n }\n \n .gleap-tour-message::-webkit-scrollbar-thumb {\n background: ").concat(y,"; \n border-radius: 5px;\n }\n\n .gleap-tour-message::-webkit-scrollbar-thumb:hover {\n background: ").concat(m,";\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-message {\n min-width: auto !important;\n }\n }\n\n .gleap-tour-message iframe {\n width: 100%;\n height: 300px;\n margin-top: 10px;\n margin-bottom: 10px;\n border: none;\n outline: none;\n display: block;\n }\n\n .gleap-tour-sender-name {\n font-size: 15px;\n }\n\n .gleap-tour-video {\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-tour-video-svg--fullscreen {\n width: 100% !important;\n height: 100% !important;\n top: 0px !important;\n left: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n }\n\n .gleap-tour-video--playing .gleap-tour-video-playpause {\n opacity: 0;\n }\n \n .gleap-tour-video--playing:hover .gleap-tour-video-playpause {\n opacity: 1;\n }\n\n .gleap-tour-popover-video-pointer {\n padding: 0px !important;\n border-radius: 8px;\n position: relative;\n background-color: transparent !important;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer {\n position: absolute;\n top: 0px;\n left: 20px;\n right: 20px;\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer button {\n padding: 5px 12px;\n }\n\n .gleap-tour-popover-video-pointer.gleap-tour-popover-can-close .gleap-tour-popover-footer {\n right: 40px !important;\n }\n\n .gleap-tour-popover-video-pointer:hover .gleap-tour-popover-footer {\n opacity: 1;\n }\n\n .gleap-tour-popover-pointer.gleap-tour-popover-no-sender .gleap-tour-message {\n padding-right: 20px;\n }\n\n .gleap-tour-video video {\n width: 100%;\n max-width: 100%;\n height: auto;\n border: none;\n outline: none;\n display: block;\n border-radius: 8px;\n }\n\n .gleap-admin-collapse-ui {\n z-index: ").concat(2147483635,";\n cursor: pointer;\n position: fixed;\n bottom: 75px;\n right: 20px;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n background-color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;\n }\n\n .gleap-admin-collapse-ui svg {\n width: 20px;\n height: 14px;\n fill: #000 !important;\n }\n\n .gleap-admin-collapse-ui-active {\n bottom: 20px !important;\n }\n\n .gleap-admin-collapse-ui-active svg {\n transform: rotate(180deg);\n }\n\n .gleap-admin-frame-container-active {\n display: none !important;\n }\n\n .gleap-admin-frame-container {\n position: fixed;\n bottom: 0px;\n left: 0px;\n right: 0px;\n width: 100vw;\n z-index: ").concat(2147483640,";\n }\n\n .gleap-admin-frame {\n width: 100%;\n height: 100% !important;\n border: none;\n outline: none;\n display: block;\n }\n \n .gleap-tour-message .linktype-link {\n display: inline-block !important;\n background-color: transparent !important;\n color: ").concat(n," !important;\n }\n\n .gleap-tooltip .linktype-button,\n .gleap-tour-message .linktype-button {\n display: inline-block !important;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 10px 20px !important;\n text-decoration: none !important;\n background-color: ").concat(n," !important;\n color: ").concat(d," !important;\n }\n\n .gleap-tour-message img {\n width: 100%;\n max-width: 100%;\n min-height: 260px;\n height: auto;\n margin-top: 10px;\n margin-bottom: 10px;\n object-fit: cover;\n }\n\n .gleap-tour-active .gleap-tour-overlay {\n pointer-events: none;\n }\n \n .gleap-tour-active * {\n pointer-events: none;\n }\n \n .gleap-tour-active .gleap-tour-active-element,\n .gleap-tour-active .gleap-tour-active-element *,\n .gleap-tour-popover,\n .gleap-tour-popover * {\n pointer-events: auto;\n }\n \n @keyframes animate-fade-in {\n 0% {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n .gleap-tour-fade .gleap-tour-overlay {\n animation: animate-fade-in 200ms ease-in-out;\n }\n \n .gleap-tour-fade .gleap-tour-popover {\n animation: animate-fade-in 200ms;\n }\n\n .gleap-tour-video-playpause {\n position: absolute;\n bottom: 8px;\n left: 8px;\n width: 32px;\n height: 32px;\n padding: 4px;\n background-color: rgba(0,0,0,0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 8px;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-arrow {\n display: none !important;\n }\n\n .gleap-tour-video-playpause svg {\n width: 34px;\n height: auto;\n fill: #fff;\n }\n \n /* Popover styles */\n .gleap-tour-popover {\n all: unset;\n box-sizing: border-box;\n color: ").concat(w,";\n margin: 0;\n padding: 15px;\n border-radius: ").concat(S,"px;\n min-width: 250px;\n max-width: 300px;\n box-shadow: 0 1px 10px #0006;\n ").concat(h?"outline: 1px solid rgba(255, 255, 255, 0.1);":"","\n z-index: 1000000000;\n position: fixed;\n top: 0;\n right: 0;\n background-color: ").concat(b,';\n }\n \n .gleap-tour-popover * {\n font-family: "Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif;\n }\n \n .gleap-tour-popover-title {\n font: 19px / normal sans-serif;\n font-weight: 700;\n display: block;\n position: relative;\n line-height: 1.5;\n zoom: 1;\n margin: 0;\n }\n \n .gleap-tour-popover-close-btn {\n all: unset;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n font-size: 30px;\n font-weight: 500;\n line-height: 32px;\n color: ').concat(h?m:"#d2d2d2",";\n z-index: 1;\n text-align: center;\n transition: color;\n transition-duration: 200ms;\n }\n \n .gleap-tour-popover-close-btn:hover,\n .gleap-tour-popover-close-btn:focus {\n color: ").concat(w,';\n }\n \n .gleap-tour-popover-title[style*="block"] + .gleap-tour-popover-description {\n margin-top: 5px;\n }\n \n .gleap-tour-popover-description {\n margin-bottom: 0;\n font: 15px / normal sans-serif;\n line-height: 1.5;\n font-weight: 400;\n zoom: 1;\n }\n \n .gleap-tour-popover-footer {\n margin-top: 15px;\n text-align: right;\n zoom: 1;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .gleap-tour-popover-progress-text {\n font-size: 13px;\n font-weight: 400;\n color: ').concat(h?m:"#727272",";\n zoom: 1;\n }\n \n .gleap-tour-popover-footer button {\n background-color: ").concat(e,";\n color: ").concat(u,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 10px 20px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;\n }\n\n .gleap-tour-popover-prev-btn {\n color: ").concat(p," !important;\n background-color: ").concat(v," !important;\n margin-right: 3px;\n }\n\n .gleap-tour-popover-prev-btn:hover {\n background-color: ").concat(e,"22 !important;\n color: ").concat(e,' !important;\n }\n \n .gleap-tour-popover-footer .gleap-tour-popover-btn-disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n \n .gleap-tour-no-interaction, .gleap-tour-no-interaction * {\n pointer-events: none !important;\n }\n \n .gleap-tour-popover-navigation-btns {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n gap: 4px;\n }\n \n .gleap-tour-popover-arrow {\n content: "";\n position: absolute;\n border: 5px solid ').concat(b,";\n }\n \n .gleap-tour-popover-arrow-side-over {\n display: none;\n }\n \n /** Popover Arrow Sides **/\n .gleap-tour-popover-arrow-side-left {\n left: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-right {\n right: 100%;\n border-left-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-top {\n top: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-bottom {\n bottom: 100%;\n border-left-color: transparent;\n border-top-color: transparent;\n border-right-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-center {\n display: none;\n }\n \n /* Left/Start + Right/Start */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-start {\n top: 15px;\n }\n \n /* Top/Start + Bottom/Start */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-start {\n left: 15px;\n }\n \n /* End/Left + End/Right */\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-left,\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-right {\n bottom: 15px;\n }\n \n /* Top/End + Bottom/End */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-end,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-end {\n right: 15px;\n }\n \n /* Left/Center + Right/Center */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-center {\n top: 50%;\n margin-top: -5px;\n }\n \n /* Top/Center + Bottom/Center */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-center {\n left: 50%;\n margin-left: -5px;\n }\n \n /* No arrow */\n .gleap-tour-popover-arrow-none {\n display: none;\n } \n\n /* Modal styles */\n .gleap-modal-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Invisible until the card inside the frame reports its height. Before that the frame is an\n empty box, and a bootstrap that fails silently must not leave a blank white card behind. */\n .gleap-modal-wrapper--loading {\n visibility: hidden;\n }\n\n .gleap-modal-wrapper--loading .gleap-modal {\n animation-name: none;\n }\n\n .gleap-modal-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-modal {\n position: relative;\n width: 90%;\n max-width: 600px;\n max-height: 90vh;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-modal-frame {\n width: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-modal-open {\n overflow: hidden;\n }\n\n /* Agent Popup styles */\n .gleap-agent-popup-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ").concat(2147483640,";\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-agent-popup-backdrop {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: ").concat(2147483641,";\n }\n\n .gleap-agent-popup {\n position: relative;\n width: 95%;\n max-width: 700px;\n height: 85vh;\n max-height: 800px;\n z-index: ").concat(2147483700,";\n background-color: ").concat(o,";\n border-radius: ").concat(x,"px;\n overflow: hidden;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n }\n\n .gleap-agent-popup-frame {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n outline: none;\n }\n\n body.gleap-agent-popup-open {\n overflow: hidden;\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 20px, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .gleap-frame-container--survey,\n .gleap-frame-container--survey-page,\n .gleap-frame-container--survey-full {\n animation: gleapWidgetFade 0.15s ease-out both !important;\n }\n\n .gleap-frame-container--survey.gleap-frame-container--closing,\n .gleap-frame-container--survey-full.gleap-frame-container--closing {\n animation: gleapWidgetFadeOut 0.15s ease-in both !important;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner,\n .gleap-frame-container--survey-page .gleap-frame-container-inner {\n transition: none !important;\n }\n }\n\n .gleap-admin-frame-container,\n .gleap-frame-container,\n .bb-feedback-button,\n .gleap-notification-container,\n .gleap-tooltip,\n .gleap-ai-ui-widget {\n pointer-events: auto !important;\n }\n "),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=Lf.getInstance();if(i.ready){var a=e||{};i.session.email&&(a.reportedBy=i.session.email),new Gf("CRASH",n,a,!0,o).sendFeedback().then((function(){})).catch((function(e){}))}}}},{key:"showSurvey",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"survey",r=Lf.getInstance();if(r.ready){var o=ey(n);e.startFeedbackFlowWithOptions(t,{hideBackButton:!0,format:o.appMode,survey:o},!0)}else r.setOnSessionReady((function(){e.showSurvey(t,n)}))}},{key:"startClassicForm",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlow",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlowWithOptions",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.autostartDrawing,i=n.hideBackButton,a=n.format,s=n.survey;if(Lf.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var c="start-feedbackflow";r&&(c="start-survey");var l=r?s||ey(a):null,u=l?l.appMode:"widget";ig.getInstance().setFrameHost(l&&"page"===l.format?l.container:null),ig.getInstance().setAppMode(u),ig.getInstance().surveyKeyboard=!(!l||"page"!==l.format||!l.keyboard);var d={flow:t,hideBackButton:i,format:l?u:a};if(l){d.surveyFormat=l.format,d.fields=l.fields,l.personalToken&&(d.personalToken=l.personalToken),d.resume=l.resume,l.outboundAction&&(d.outboundAction=l.outboundAction),l.resumeData&&(d.resumeData=l.resumeData);var p=ig.getInstance().getSafeAreaInsets();d.safeArea="card"===l.format?oy(oy({},p),{},{bottom:0}):p}ig.getInstance().sendMessage({name:c,data:d},!0),o?ig.getInstance().showDrawingScreen("screenshot"):ig.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),ig.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),ig.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];ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),ig.getInstance().showWidget()}},{key:"askAI",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"ask-ai",data:{question:e,hideBackButton:!t}},!0),ig.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 xt(e)}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),ig.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),ig.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),ig.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),ig.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),ig.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),ig.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&&(ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"start-checklist",data:oy({outboundId:e,hideBackButton:!t},n?{sharedKey:n}:{})},!0),ig.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),ig.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];ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),ig.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];ig.getInstance().setAppMode("widget"),ig.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),ig.getInstance().showWidget()}},{key:"startProductTour",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this;Lf.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=bv.getInstance().loadUncompletedTour();e&&bv.getInstance().startWithConfig(e.tourId,e.tourData,500)}},{key:"startProductTourWithConfig",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];bv.getInstance().startWithConfig(e,t,0,n)}},{key:"showBanner",value:function(e){try{lr.getInstance().showBanner(e)}catch(t){}}},{key:"showModal",value:function(e){try{Rg.getInstance().showModal(e)}catch(t){}}},{key:"showNotification",value:function(e){jm.getInstance().showNotification(e)}}],n&&ny(t.prototype,n),r&&ny(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(iy(sy,"invoked",!0),iy(sy,"silentCrashReportSent",!1),iy(sy,"instance",void 0),"undefined"!=typeof window){var cy=window.GleapActions;if(cy&&cy.length>0)for(var ly=0;ly<cy.length;ly++){var uy=cy[ly];uy&&uy.e&&sy[uy.e]&&sy[uy.e].apply(sy,uy.a)}}var dy=function(e){try{var t=e.split("/"),n=t[2];if("article"===n){var r=t[3];sy.openHelpCenterArticle(r,!0)}if("collection"===n){var o=t[3];sy.openHelpCenterCollection(o,!0)}if("flow"===n){var i=t[3];sy.startFeedbackFlow(i,!0)}if("survey"===n){var a=t[3];sy.showSurvey(a)}if("bot"===n){var s=t[3];sy.startBot(s,!0)}if("news"===n){var c=t[3];sy.openNewsArticle(c,!0)}if("checklist"===n){var l=t[3];sy.startChecklist(l,!0,t[4])}if("tour"===n){var u=t[3];sy.startProductTour(u)}}catch(d){console.error("Failed to handle Gleap link: ",e)}};const py=sy,hy=py;return t=t.default})()));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|