@moveo-ai/web-client 0.127.0-true.39 → 0.127.0-true.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/752.min.js.LICENSE.txt +1 -1
- package/dist/882.min.js.LICENSE.txt +1 -1
- package/dist/929.min.js.LICENSE.txt +1 -1
- package/dist/audio-client.min.js.LICENSE.txt +1 -1
- package/dist/continue/index.html +1 -1
- package/dist/continue.min.js.LICENSE.txt +1 -1
- package/dist/iframe.min.js +1 -1
- package/dist/iframe.min.js.LICENSE.txt +1 -1
- package/dist/index.html +1 -1
- package/dist/preview/index.html +1 -1
- package/dist/preview.css.min.js.LICENSE.txt +1 -1
- package/dist/telnyx-client.min.js.LICENSE.txt +1 -1
- package/dist/web-client.min.js +1 -1
- package/dist/web-client.min.js.LICENSE.txt +1 -1
- package/dist/webrtc-client.min.js.LICENSE.txt +1 -1
- package/package.json +5 -5
package/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1"><meta name=robots content=noindex><base target=_blank><style>body{background-color:transparent;margin:0;overflow:hidden}.uai{display:none!important}</style><title>Widget</title></head><body><script>const queryString=window.location.search,urlParams=new URLSearchParams(queryString),widgetId=urlParams.get("widgetId"),script=document.createElement("script");script.src="iframe.min.js?
|
|
1
|
+
<html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1"><meta name=robots content=noindex><base target=_blank><style>body{background-color:transparent;margin:0;overflow:hidden}.uai{display:none!important}</style><title>Widget</title></head><body><script>const queryString=window.location.search,urlParams=new URLSearchParams(queryString),widgetId=urlParams.get("widgetId"),script=document.createElement("script");script.src="iframe.min.js?aae8e343a80e8eb776b3",script.onload=function(){widgetId?MoveoAI.init(widgetId).catch(e=>{console.error(e,`Error initializing ${widgetId} iframe`)}):console.error("Moveo Webchat is missing the widgetId")},document.head.appendChild(script);</script></body></html>
|
package/dist/preview/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1"><meta name=keywords content="Moveo.ai, Preview, WebChat, WebWidget, webclient, chatbot"><meta name=description content="Preview and Improve your AI Agent"><meta name=twitter:card value=summary><meta property=og:title content="Moveo.ai Webchat Preview"><meta property=og:type content=website><meta property=og:url content=https://moveo.ai><meta property=og:image content=https://web-client.moveo.ai/public/og-image.jpg><meta property=og:image:width content=1200><meta property=og:image:height content=630><meta property=og:description content="Preview and Improve your AI Agent"><title>Moveo.ai Client Preview</title><style>@layer theme,base,components,utilities;body:before{background-image:url(/public/background.svg)}</style><script src=../preview.css.min.js?
|
|
1
|
+
<!doctype html><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1"><meta name=keywords content="Moveo.ai, Preview, WebChat, WebWidget, webclient, chatbot"><meta name=description content="Preview and Improve your AI Agent"><meta name=twitter:card value=summary><meta property=og:title content="Moveo.ai Webchat Preview"><meta property=og:type content=website><meta property=og:url content=https://moveo.ai><meta property=og:image content=https://web-client.moveo.ai/public/og-image.jpg><meta property=og:image:width content=1200><meta property=og:image:height content=630><meta property=og:description content="Preview and Improve your AI Agent"><title>Moveo.ai Client Preview</title><style>@layer theme,base,components,utilities;body:before{background-image:url(/public/background.svg)}</style><script src=../preview.css.min.js?aae8e343a80e8eb776b3></script></head><body><div class="flex flex-row flex-wrap justify-between p-[10%] pb-0 mobile:flex-col mobile:items-center mobile:p-0 mobile:pt-[75px]"><div class="w-[510px] mb-9 mobile:flex mobile:flex-col mobile:items-center mobile:w-auto mobile:min-w-0"><p class="mt-0 mb-6 text-[42px] leading-[51px] font-bold mobile:text-center mobile:text-[28px] mobile:leading-[34px]"><span class="colored text-preview-muted">Preview</span> and <span class="colored text-preview-muted">Test</span><br>your Webchat<p class="mb-9 text-2xl leading-[30px] font-normal mobile:text-center mobile:text-base mobile:leading-5 mobile:w-[280px]">Moveo.ai can help you build engaging conversational applications powered by Artificial Intelligence.<div class="flex flex-row justify-start"><button class="action_button hidden cursor-pointer" id=open-chat-button>Open Webchat</button> <button class="action_button hidden mobile:hidden cursor-pointer" id=close-chat-button>Close Webchat</button> <button class="action_button hidden cursor-pointer" id=render-chat-button>Render Webchat</button></div></div><div class="hidden box-border flex-initial w-[512px] h-[562px] min-w-[300px] mb-16 rounded-lg border-2 border-brand-background bg-white shadow-[2px_3px_6px_rgb(104_104_104/10%)] mobile:mx-[10%] mobile:w-4/5" id=embed-chat-container><p class="mt-[10%] mx-7 mb-0 text-base leading-6 text-center" id=embed-text>The webchat will render in the html element of your choice. Render the webchat here, in order to preview other settings.<div class="hidden w-full h-full" id=embed-chat></div></div></div><script>const queryString=window.location.search,urlParams=new URLSearchParams(queryString),webpackFiles="../iframe.min.js?aae8e343a80e8eb776b3,../web-client.min.js?aae8e343a80e8eb776b3,../continue.min.js?aae8e343a80e8eb776b3,../preview.css.min.js?aae8e343a80e8eb776b3,../audio-client.min.js?aae8e343a80e8eb776b3,../webrtc-client.min.js?aae8e343a80e8eb776b3,../telnyx-client.min.js?aae8e343a80e8eb776b3".split(","),webClientFile=webpackFiles.find(e=>e.includes("web-client.min.js")),previewCssFile=webpackFiles.find(e=>e.includes("preview.css.min.js")),previewCssScript=document.createElement("script");previewCssScript.src=previewCssFile,document.head.appendChild(previewCssScript);const script=document.createElement("script");script.src=webClientFile,script.onload=function(){const e=urlParams.get("integrationId"),t=urlParams.get("host"),n=document.getElementById("embed-chat"),i=urlParams.get("_config");let o={};if(i)try{o=JSON.parse(atob(i))}catch(e){console.debug({error:e,encodedConfig:i},"Error parsing config")}MoveoAI.init({...o,integrationId:e,host:t,element:n}).then(e=>{if(console.log("Preview initialized",e),window.webClientInstance=e,"embed"===e.config.widget_position){document.getElementById("embed-chat-container").classList.remove("hidden");const e=document.getElementById("render-chat-button");e.classList.remove("hidden"),e.onclick=function(){document.getElementById("embed-text").classList.add("hidden"),document.getElementById("embed-chat").classList.remove("hidden"),e.style.removeProperty("background-color"),e.classList.remove("cursor-pointer"),e.classList.add("cursor-not-allowed"),e.disabled=!0}}else{const t=document.getElementById("open-chat-button");t.classList.remove("hidden"),t.onclick=function(){e.openWindow()};const n=document.getElementById("close-chat-button");n.classList.remove("hidden"),n.onclick=function(){e.closeWindow()}}const t=e?.config?.background_color??"#1B66D6",n=document.querySelectorAll("span.colored");for(const e of n)e.style.color=t;const i=document.querySelectorAll(".action_button");for(const e of i)e.style.backgroundColor=t}).catch(e=>{console.error(e,"Error initializing preview")})},document.head.appendChild(script);</script></body></html>
|
package/dist/web-client.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see web-client.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("MoveoAI",[],t):"object"==typeof exports?exports.MoveoAI=t():e.MoveoAI=t()}(this,()=>(()=>{var e={178(e,t,n){"use strict";var o=n(601),i=n.n(o),s=n(314),r=n.n(s)()(i());r.push([e.id,"/*\n * Applied to the iframe on the customer's own page, so the overrides below are\n * deliberate: the host stylesheet must not win.\n */\n.web-client-container {\n position: fixed;\n right: 0;\n bottom: 0;\n z-index: var(--moveo-z-index, 10022);\n max-height: 99%;\n cursor: pointer;\n}\n\n.web-client-container.embed {\n position: static;\n width: 100% !important;\n height: 100% !important;\n max-height: 100%;\n}\n\n/*\n * Full is the frame's viewport — the visitor's window only on a top-level\n * page. On a nested install the loader pins the panel to the visible band\n * through these two variables; unset, they resolve to the plain full frame.\n */\n.web-client-container.full {\n inset: var(--moveo-full-top, 0) 0 auto 0 !important;\n width: 100% !important;\n height: var(--moveo-full-height, 100%) !important;\n max-height: initial;\n\n /* A visitor's drag moves the corner widget, never the full-screen panel. */\n translate: none !important;\n}\n\n/* The `/continue` page is the chat, so on a phone it is pinned like the\n open panel, and the loader keeps it above the keyboard. */\n.web-client-container.embed.fills-screen.full {\n position: fixed;\n}\n\n/* Hides the page in the gap between the phone chat and the keyboard.\n The loader sets its top and its color. */\n.web-client-keyboard-cover {\n position: absolute !important;\n left: 0 !important;\n width: 100% !important;\n height: 100vh !important;\n touch-action: none !important;\n}\n",""]);const a=r;n.d(t,["A",0,a])},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,o,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(o)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(r[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&r[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},833(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(736)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736(e,t,n){e.exports=function(e){function t(e){let n,i,s,r=null;function a(...e){if(!a.enabled)return;const o=a,i=Number(new Date),s=i-(n||i);o.diff=s,o.prev=n,o.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,i)=>{if("%%"===n)return"%";r++;const s=t.formatters[i];if("function"==typeof s){const t=e[r];n=s.call(o,t),e.splice(r,1),r--}return n}),t.formatArgs.call(o,e),(o.log||t.log).apply(o,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=o,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{r=e}}),"function"==typeof t.init&&t.init(a),a}function o(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function i(e,t){let n=0,o=0,i=-1,s=0;for(;n<e.length;)if(o<t.length&&(t[o]===e[n]||"*"===t[o]))"*"===t[o]?(i=o,s=n,o++):(n++,o++);else{if(-1===i)return!1;o=i+1,s++,n=s}for(;o<t.length&&"*"===t[o];)o++;return o===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(i(e,n))return!1;for(const n of t.names)if(i(e,n))return!0;return!1},t.humanize=n(585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},585(e){var t=1e3,n=60*t,o=60*n,i=24*o,s=7*i;function r(e,t,n,o){var i=t>=1.5*n;return Math.round(e/n)+" "+o+(i?"s":"")}e.exports=function(e,a){a=a||{};var l,c,d=typeof e;if("string"===d&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var a=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===d&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=i?r(l,c,i,"day"):c>=o?r(l,c,o,"hour"):c>=n?r(l,c,n,"minute"):c>=t?r(l,c,t,"second"):l+" ms"):function(e){var s=Math.abs(e);return s>=i?Math.round(e/i)+"d":s>=o?Math.round(e/o)+"h":s>=n?Math.round(e/n)+"m":s>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}};const t={};function n(o){const i=t[o];if(void 0!==i)return i.exports;const s=t[o]={id:o,exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},n.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var i=t[o++],s=t[o++],r=0===s?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:s};n.o(e,i)||Object.defineProperty(e,i,r)}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;let o={};return(()=>{"use strict";n.r(o),n.d(o,{init:()=>Ht});var e=n.cw(e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},r=[],a=0;a<e.length;a++){var l=e[a],c=o.base?l[0]+o.base:l[0],d=s[c]||0,h="".concat(c," ").concat(d);s[c]=d+1;var u=n(h),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(m);else{var p=i(m,o);o.byIndex=a,t.splice(a,0,{identifier:h,updater:p,references:1})}r.push(h)}return r}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var s=o(e=e||[],i=i||{});return function(e){e=e||[];for(var r=0;r<s.length;r++){var a=n(s[r]);t[a].references--}for(var l=o(e,i),c=0;c<s.length;c++){var d=n(s[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=l}}}),t=n.cw(e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}}),i=n.cw(e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}}),s=n.cw(e=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}}),r=n.cw(e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}),a=n.cw(e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}),l=n(833),c=n.n(l);let d=(e=21)=>{for(var t="",n=crypto.getRandomValues(new Uint8Array(e|=0));e--;)t+="57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9"[63&n[e]];return t};const h=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1},u=new Set(["__proto__","constructor","prototype","toString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString"]),m=(...e)=>e.reduce((e,t)=>{if(void 0===t)return e;if(Array.isArray(t))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(t).forEach(n=>{u.has(n)||(Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=m.options.mergeArrays?m.options.uniqueArrayItems?Array.from(new Set(e[n].concat(t[n]))):[...e[n],...t[n]]:t[n]:h(e[n])&&h(t[n])?e[n]=m(e[n],t[n]):!h(e[n])&&h(t[n])?e[n]=m(t[n],void 0):e[n]=void 0===t[n]?m.options.allowUndefinedOverrides?t[n]:e[n]:t[n])}),e},{}),p={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};m.options=p,m.withOptions=(e,...t)=>{m.options=Object.assign(Object.assign({},p),e);const n=m(...t);return m.options=p,n};const f="https://channels-ws.moveo.ai",v=Object.freeze({"bab4875e-0411-4ae1-9e98-19ea236d369b":"nbg","0ffdaef8-4ce9-4188-9fdd-4644e5062cf2":"alpha","0e614713-2e6b-4af2-8e9e-21c2a4617981":"fiserv"}),g=e=>Boolean(e&&"fiserv"===v[e]),w="https://web.moveo.ai",y="https://web.dev.moveo.ai",b="storage",C=[1e3,2e3,2e3,4e3,4e3],x=()=>window.innerWidth<650||window.innerHeight<550&&window.innerWidth<1e3||(()=>{const{screen:e}=window;return!!e&&Math.min(e.width,e.height)<650&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches})(),E=e=>{let t="";const n=document.querySelectorAll("script");n&&n.forEach(e=>{e.src?.includes(y)&&(t=y),e.src?.includes(w)&&(t=w),e.src?.match(/@moveo-ai\/web-client.*next/)&&(t="https://web-client.dev.moveo.ai")});const{origin:o}=window.location;return t||(t=o.match(/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\])(:\d+)?$/)||o.match(/^https:\/\/([a-z0-9-]+\.)?web-7ii\.pages\.dev$/)||o.match(/web-client.*moveo-ai\.vercel\.app/)||o.match(/web.*moveo\.ai/)?o:w),`${t}?widgetId=${e}`},k=(e,t)=>{const n=t?.data?.type;if("string"!=typeof n||!n.startsWith(e))return null;const o=n.replace(e,""),i=t.data?.data;return{type:o,data:i}};var S,I=/bot|crawl|http|lighthouse|scan|search|spider/i;var L=function(e){return"string"==typeof(t=e)&&""!==t&&function(){if(S instanceof RegExp)return S;try{S=new RegExp(" daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! channel/|google/)google(?!(?:wv|app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!cam)scan|(?<!lib)http|24x7|;\\s\\w+;$|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\b\\w+/1\\.0;|\\bbw/|\\bdlc\\b|\\bort/|\\bperl\\b|\\btime/|\\||^[<\\(;]|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[\\w\\-]+/[\\w]+$|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^\\w+/\\d\\.\\d\\s\\([\\w@]+\\)$|^active|^ad muncher|^amaya|^apache/|^avsdevicesdk/|^azure|^biglotron|^blackbox exporter|^bot|^clamav[ /]|^claude-code/|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^exodusmovement|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\((?:compatible;)?(?:\\s?[\\w\\d-.]+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^ps_daily/|^python|^rank|^read|^reed|^remove\\.bg/|^rest|^rss|^snapchat|^sora |^space bison|^stape/|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|abuse|advisor|agent\\b|analyzer|archive|ask jeeves/teoma|attracta|audit|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|collapsify\\b|convertify|cookiehubverify/|crawl|cursor/|cypress/|dareboost|datanyze|dejaclick|detect|discovery|dmbrowser|download|exaleadcloudview|feed|firephp|foregenix|functionize|grab|hardenize\\b|headless|hotjar|httrack|hubspot marketing grader|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|linktiger|mail\\.ru/|manager|manus-user/|marketgoo/|measure|monitor\\b|neustar wpm|node\\b|nutch|offbyone|openvas|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|playwright|powermarks|preview|productfinder|prospectingstudio|proxy|ptst[ /]\\d|radar|readable/|retriever|rexx;|rigor|rss\\b|scrape|securityheaders|selenium|server|silktide|sindup/|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|testlocally|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|watchtowr|webglance|webkit2png|whatcms/|xtate/","i")}catch(e){S=I}return S}().test(e);var t};const A=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;var T="object"==typeof self&&self&&self.Object===Object&&self;const F=M||T||Function("return this")(),$=function(){return F.Date.now()};var _=/\s/;var P=/^\s+/;const O=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&_.test(e.charAt(t)););return t}(e)+1).replace(P,""):e},H=F.Symbol;var R=Object.prototype,W=R.hasOwnProperty,j=R.toString,B=H?H.toStringTag:void 0;var N=Object.prototype.toString;var V=H?H.toStringTag:void 0;const z=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":V&&V in Object(e)?function(e){var t=W.call(e,B),n=e[B];try{e[B]=void 0;var o=!0}catch(e){}var i=j.call(e);return o&&(t?e[B]=n:delete e[B]),i}(e):function(e){return N.call(e)}(e)};var U=/^[-+]0x[0-9a-f]+$/i,q=/^0b[01]+$/i,D=/^0o[0-7]+$/i,Q=parseInt;const K=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==z(e)}(e))return NaN;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=O(e);var n=q.test(e);return n||D.test(e)?Q(e.slice(2),n?2:8):U.test(e)?NaN:+e};var G=Math.max,J=Math.min;const Y=function(e,t,n){var o,i,s,r,a,l,c=0,d=!1,h=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=o,s=i;return o=i=void 0,c=t,r=e.apply(s,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=s}function f(){var e=$();if(p(e))return v(e);a=setTimeout(f,function(e){var n=t-(e-l);return h?J(n,s-(e-c)):n}(e))}function v(e){return a=void 0,u&&o?m(e):(o=i=void 0,r)}function g(){var e=$(),n=p(e);if(o=arguments,i=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),d?m(e):r}(l);if(h)return clearTimeout(a),a=setTimeout(f,t),m(l)}return void 0===a&&(a=setTimeout(f,t)),r}return t=K(t)||0,A(n)&&(d=!!n.leading,s=(h="maxWait"in n)?G(K(n.maxWait)||0,t):s,u="trailing"in n?!!n.trailing:u),g.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=i=a=void 0},g.flush=function(){return void 0===a?r:v($())},g},Z=c()("moveo:safe-read"),X=(e,t)=>{try{return t()}catch(t){return void Z("%s unreadable: %o",e,t)}},ee=(e,t)=>{X(e,()=>{t()})},te=e=>{if("string"==typeof e)return e.trim()||void 0},ne=e=>{for(const t of Object.keys(e))void 0===e[t]&&delete e[t];return e},oe=()=>window,ie=()=>X("QuantumMetric scripts",()=>Array.from(document.querySelectorAll('script[src*="quantummetric"]')))??[],se=()=>ie().length>0,re=()=>X("QuantumMetricAPI.isOn",()=>{const e=oe().QuantumMetricAPI;return"function"==typeof e?.isOn&&!0===e.isOn()})??!1,ae=/\/qscripts\/quantum-([a-z0-9-]+)\.js/,le=()=>{if(re())return X("QuantumMetric script src",()=>{for(const e of ie()){const t=e.getAttribute("src")?.match(ae)?.[1];if(t)return t}})},ce=[{name:"quantum-metric",isReady:()=>re(),isExpected:()=>se(),readIdentity:()=>({qm_subscription:le()??null,qm_user_id:re()?X("QuantumMetricAPI.getUserID",()=>te(oe().QuantumMetricAPI?.getUserID?.())):se()?null:void 0}),whenReady:e=>{let t,n=e;const o=()=>ee("quantum-metric ready callback",()=>{n?.()}),i=()=>{n&&(t=o,ee("QuantumMetricAPI.addEventListener('start')",()=>{oe().QuantumMetricAPI?.addEventListener?.("start",o)}),ee("QuantumMetricAPI.addEventListener('stop')",()=>{oe().QuantumMetricAPI?.addEventListener?.("stop",o)}),o())};return X("QuantumMetricAPI",()=>oe().QuantumMetricAPI)?i():ee("QuantumMetricOnload",()=>{const e=oe().QuantumMetricOnload;if(Array.isArray(e))e.push(i);else{if("function"==typeof e){const t=e;return void(oe().QuantumMetricOnload=function(...e){return ee("QuantumMetricOnload (ours)",i),t.apply(this,e)})}oe().QuantumMetricOnload=[i]}}),()=>{n=null,t&&(ee("QuantumMetricAPI.removeEventListener('start')",()=>{oe().QuantumMetricAPI?.removeEventListener?.("start",t)}),ee("QuantumMetricAPI.removeEventListener('stop')",()=>{oe().QuantumMetricAPI?.removeEventListener?.("stop",t)}),t=void 0)}}}],de=(e,t)=>X(`${e.name}.${t}`,()=>e[t]?.())??!1,he=e=>X(`input[name="${e}"]`,()=>{const t=document.querySelectorAll(`input[name="${CSS.escape(e)}"]`);for(const e of t){const t=te(e.value);if(t)return t}}),ue="moveo_visitor_id",me=34214400,pe=(e,t,n)=>ee("document.cookie write",()=>{document.cookie=`${ue}=${e}; path=/; max-age=${t}; SameSite=Lax; Secure${n?`; domain=${n}`:""}`}),fe=e=>X(`document.cookie ${e}`,()=>{const t=`${e}=`,n=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(t));return te(n?.slice(t.length))}),ve=e=>{const t=e.split(".");if(t.length<2||/^[\d.]+$|:/.test(e))return;const n=`moveo_domain_probe_${Math.random().toString(36).slice(2,10)}`;for(let e=t.length-2;e>=0;e-=1){const o=t.slice(e).join("."),i=`${n}=1; path=/; SameSite=Lax; Secure; domain=${o}`;if(ee("document.cookie probe",()=>{document.cookie=`${i}; max-age=10`}),"1"===fe(n))return ee("document.cookie probe",()=>{document.cookie=`${i}; max-age=0`}),o}},ge=new RegExp("^[A-Za-z0-9_-]{43}$"),we=/^[0-9a-f-]{36}$/,ye=e=>ge.test(e)||we.test(e),be=new Set,Ce=({label:e,marker:t,target:n,methods:o,event:i,emitIf:s=()=>!0})=>{be.has(t)||(be.add(t),ee(e,()=>{const e=n();e[t]||(o.forEach(t=>{const n=e[t];e[t]=function(...e){const t=n.apply(this,e);return s(e)&&ee(i,()=>{window.dispatchEvent(new Event(i))}),t}}),e[t]=!0)}))},xe=["clover.com","www.clover.com","www.staging.clover.com"],Ee=e=>e.replace(/\/+$/,"")||"/",ke=(e,t)=>{const n=Ee(e);return n===t||n.startsWith(`${t}/`)},Se=e=>{try{return new URL(e)}catch{return null}},Ie=e=>{const t=Se(e);return t&&xe.includes(t.hostname.toLowerCase())?t:null},Le=e=>!!Ie(e),Ae="cart-v1",Me="checkout-plan",Te="moveo_clover_cart_seen",Fe=[Ae,Me],$e="moveo:clover:cartchange",_e=Symbol.for("moveo.clover.storage"),Pe=e=>{return(t=e)&&"object"==typeof t&&!Array.isArray(t)?e:void 0;var t},Oe=e=>Array.isArray(e)?e:[],He=e=>"number"==typeof e&&Number.isFinite(e)?e:null,Re=e=>te(e)??null,We=e=>{const t=Re(e);return t&&/^[A-Z0-9_]{1,40}$/.test(t)?t:null},je=e=>Re(e)?.replace(/[\s\p{Cc}]+/gu," ").slice(0,60)??null,Be=e=>{const t=Re(e);return t?.startsWith("//")?`https:${t}`:t?.startsWith("https://")?t:null},Ne=(e,t)=>He(Pe(Pe(e)?.[t])?.value),Ve=e=>t=>{const n=Pe(t),o=je(n?.name);if(!n||!o)return[];const i=We(n.id);return[{id:i,name:o,kind:e(i),quantity:He(n.quantity)??1,price:He(n.totalCost),monthly_36:Ne(n.installmentPlans,"SL36"),monthly_48:Ne(n.installmentPlans,"SL48"),image_url:Be(n.imageURL)}]},ze=e=>{const t=Pe(e),n=He(t?.percentage),o=He(t?.cost);return null===n||null===o?null:`${n}% + $${o.toFixed(2)}`},Ue=e=>{const t=Pe(e),n=je(t?.name);if(!t||!n)return null;const o=Pe(t.transactions);return{name:n,monthly:He(t.monthly),in_person:ze(o?.inPerson),keyed_in:ze(o?.keyedIn),additional_device:He(t.additionalDevicePrice)}},qe=(e,t)=>{const n=Pe(e),o=Pe(n?.cart),i=Pe(o?.cartMetadata),s=Pe(n?.checkout),r=Oe(i?.hardware),a=new Set(r.flatMap(e=>Oe(Pe(e)?.accessories).map(e=>We(Pe(e)?.id)))),l=[...r.flatMap(Ve(e=>e&&a.has(e)?"accessory":"device")),...Oe(o?.products).flatMap(Ve(()=>"add-on"))].slice(0,10);if(0===l.length)return null;const c=[i?.solutionTitle,i?.name].map(je).filter(Boolean).join(" · ");return{order_type:Re(o?.orderType),bundle_id:We(i?.id),plan_id:We(Pe(o?.softwarePlan)?.id),solution:c||null,items:l,plan:Ue(o?.softwarePlan),item_count:He(s?.count)??l.reduce((e,t)=>e+t.quantity,0),subtotal:He(s?.subtotal),software_monthly:He(s?.softwareTotal),installments:Oe(s?.installmentPlans).flatMap(e=>{const t=Pe(e),n=He(t?.months),o=He(t?.cost);return null===n||null===o?[]:[{months:n,monthly:o}]}).slice(0,4),payment_option:je(t)}},De=e=>`$${e.toLocaleString("en-US",{minimumFractionDigits:Number.isInteger(e)?0:2,maximumFractionDigits:2})}`,Qe=e=>e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]??"",Ke=e=>{const t=null===e.price?"":`, ${De(e.price)} each`;return`"${e.name}" (quantity ${e.quantity}${t})`},Ge=e=>{const t=1===e.item_count?"item":"items",n=[`The visitor's Clover cart has ${e.item_count} ${t}: ${Qe(e.items.map(Ke))}.`];if(e.solution&&n.push(`Package: "${e.solution}".`),null!==e.subtotal){const t=e.installments.map(({months:e,monthly:t})=>`${De(t)}/month for ${e} months`),o=t.length?`, or ${t.join(" or ")}`:"";n.push(`Hardware subtotal: ${De(e.subtotal)}${o}.`)}e.plan&&(n.push((e=>{const t=null===e.monthly?"":` at ${De(e.monthly)}/month`,n=[e.in_person&&`${e.in_person} in person`,e.keyed_in&&`${e.keyed_in} keyed in`].filter(e=>!!e),o=n.length?`, card fees ${Qe(n)}`:"";return`Software plan: "${e.name}"${t}${o}.`})(e.plan)),null!==e.plan.additional_device&&n.push(`Each additional device adds ${De(e.plan.additional_device)}/month.`)),null!==e.software_monthly&&n.push(`Software total: ${De(e.software_monthly)}/month.`),e.payment_option&&n.push(`Chosen payment option: ${(e=>{if("P"===e)return"pay the full hardware price now";const t=/^SL(\d+)$/.exec(e)?.[1];return t?`${t} monthly installments`:`"${e}"`})(e.payment_option)}.`);const o=(e=>[e.bundle_id&&`bundleId=${e.bundle_id}`,e.plan_id&&`planId=${e.plan_id}`].filter(Boolean).join(", "))(e);return o&&n.push(`Clover cart ids: ${o}.`),n.join(" ")},Je=e=>X(`localStorage ${e}`,()=>window.localStorage.getItem(e));let Ye=!1;const Ze=()=>ee(`localStorage ${Te}`,()=>window.localStorage.setItem(Te,"1")),Xe=/^\/cart\/?$/,et=/^\/purchase(\/|$)/,tt=()=>{const e=(()=>{const e=Je(Ae);if(null===e&&(Ye||"1"===Je(Te)))return{cart:null,live_instructions:{cart:"The visitor's Clover cart is empty."}};if("string"!=typeof e)return;Ye||(Ye=!0,Ze());const t=qe(X(Ae,()=>JSON.parse(e)),(()=>{const e=Re(Je(Me));return e?.startsWith('"')?Re(X(Me,()=>JSON.parse(e))):e})());return t?{cart:t,live_instructions:{cart:Ge(t)}}:{cart:null,live_instructions:{cart:"The visitor's Clover cart is empty."}}})(),t=X("location.href",()=>(e=>{if(!Le(e))return;const{pathname:t}=new URL(e);return Xe.test(t)?"The visitor is on the cart (/cart). They are reading you in the chat, which covers the cart, so they cannot see its buttons now: never tell them to select Continue or another button on the page. To check out, they close this chat.":et.test(t)?`The visitor is in the self-serve checkout (${t}), Clover's own account and payment application, not a contact form.`:`The visitor is on ${t}.`})(window.location.href));if(e||t)return{...e,live_instructions:{...e?.live_instructions,page:t}}},nt=e=>{const t=e?((e=window.location.hostname)=>{const t=ve(e),n=fe(ue);if(n&&t){pe("",0);const e=fe(ue);if(e&&ye(e))return e}if(n&&ye(n))return t?(pe(n,me,t),fe(ue)===n?n:void 0):n;const o=X("nanoid",()=>d(43));return o?(pe(o,me,t),fe(ue)===o?o:void 0):void 0})():void 0;return t?{user:{web_psid:t}}:{}},ot="moveo:activity:locationchange",it=Symbol.for("moveo.activity.history"),st=[ot,"popstate","hashchange"],rt=[0,400],at=e=>{Ce({label:"history patch",marker:it,target:()=>window.history,methods:["pushState","replaceState"],event:ot});const t=new Set,n=()=>{t.forEach(e=>window.clearTimeout(e)),t.clear(),rt.forEach(n=>{const o=window.setTimeout(()=>{t.delete(o),e()},n);t.add(o)})};return st.forEach(e=>window.addEventListener(e,n)),()=>{st.forEach(e=>window.removeEventListener(e,n)),t.forEach(e=>window.clearTimeout(e)),t.clear()}},lt=Array.from({length:21},(e,t)=>t/20),ct=(e,{onChange:t,onResolved:n},o=600,i=C)=>{const s=e.filter(e=>"string"==typeof e?.id&&!!e.id);if("undefined"==typeof IntersectionObserver)return n(s.map(e=>({id:e.id,matched:null,selectors:e.match?.length??0}))),{stop:()=>{}};const r=new Map,a=new Map,l=new Map;let c,d=null,h=!1,u=null,m=!1;const p=e=>{d=e,t(e)},f=new IntersectionObserver(e=>{e.forEach(e=>{const{width:t,height:n}=e.intersectionRect;a.set(e.target,e.isIntersecting?t*n:0)}),(()=>{let e=null,t=0,n=0;a.forEach((o,i)=>{const s=r.get(i)??null;s===d&&(n=Math.max(n,o)),o>t&&(e=s,t=o)}),(e=>{if(e!==d)return h?void(u?.id!==e&&(u&&clearTimeout(u.timer),u={id:e,timer:setTimeout(()=>{u=null,p(e)},o)})):(h=!0,void p(e));u&&(clearTimeout(u.timer),u=null)})(t<=0?null:null!==d&&n>=t?d:e)})()},{threshold:lt}),v=(e,t)=>{const o=e.filter(e=>{const t=(e=>{for(let t=0;t<e.length;t+=1){const n=e[t],o="string"==typeof n&&n.trim()?X("section selector",()=>document.querySelector(n)):null;if(o)return{element:o,index:t}}return null})(Array.isArray(e.match)?e.match:[]);if(!t)return!0;l.set(e.id,t.index);const n=(e=>{const t=X("section band",()=>e.closest("section, article, [data-moveo-section]"));if(!t||t===e)return e;const n=X("document height",()=>document.documentElement?.scrollHeight)??0,o=X("band height",()=>t.getBoundingClientRect().height)??0;return n>0&&o>.5*n?e:t})(t.element);return r.has(n)||(r.set(n,e.id),f.observe(n)),!1});o.length>0&&t<i.length?c=setTimeout(()=>{c=void 0,v(o,t+1)},i[t]):m||n(s.map(e=>({id:e.id,matched:l.get(e.id)??null,selectors:Array.isArray(e.match)?e.match.length:0})))};return v(s,0),{stop:()=>{m=!0,f.disconnect(),clearTimeout(c),u&&(clearTimeout(u.timer),u=null)}}},dt=c()("moveo:visible-band"),ht="CookiebotOnConsentReady",ut=e=>(window.addEventListener(ht,e),()=>window.removeEventListener(ht,e)),mt="data-moveo-clover-continue",pt=e=>{const t=window.location.href;return"cart"===((e,t)=>{const n=g(e)?Ie(t):null;return n?(e=>"/cart"===Ee(e.pathname))(n)?"cart":ke(n.pathname,"/purchase")?"purchase":null:null})(e,t)?'[data-testid="continue-button"]':((e,t)=>{const n=g(e)?Ie(t):null;return!!n&&ke(n.pathname,"/pricing")})(e,t)?'[data-testid$="-add-to-cart-button"]':null},ft=()=>document.head.querySelector(`style[${mt}]`),vt=e=>ee("clover continue style",()=>{const t=pt(e),n=ft();if(!t)return void n?.remove();const o=(e=>`@media (max-width: 699px) {\n ${e} { width: calc(100% - 148px) !important; margin-inline: 74px !important; }\n}`)(t);if(n)return void(n.textContent!==o&&(n.textContent=o));const i=document.createElement("style");i.setAttribute(mt,""),i.textContent=o,document.head.appendChild(i)}),gt="OneTrustGroupsUpdated";var wt,yt,bt,Ct,xt;!function(e){e.Open="open",e.Resolved="closed",e.Expired="expired",e.Spam="spam",e.Trash="trash"}(wt||(wt={})),function(e){e.AnalyticsEvent="moveo-analytics-event",e.IframeLoaded="moveo-iframe-loaded",e.IframeError="moveo-iframe-error",e.WidgetLoaded="moveo-widget-loaded",e.WidgetError="moveo-widget-error",e.Opened="moveo-widget-opened",e.Closed="moveo-widget-closed",e.Resize="moveo-widget-resize",e.LocaleChanged="moveo-widget-locale-changed",e.SessionCreated="moveo-widget-session-created",e.SessionReconnected="moveo-widget-session-reconnected",e.SessionClosed="moveo-widget-session-closed",e.SessionExpired="moveo-widget-session-expired",e.ConversationClosed="moveo-widget-conversation-closed",e.LinkClicked="moveo-widget-link-clicked",e.Navigate="moveo-widget-navigate",e.UserActivity="moveo-widget-user-activity",e.VisitorAction="moveo-widget-visitor-action",e.MemberLeave="moveo-widget-member-leave",e.ConversationUnreadMessages="moveo-conversation-unread-messages",e.ConversationNoUnreadMessages="moveo-conversation-no-unread-messages",e.UserWayInit="moveo-userway-init",e.ChatBackground="moveo-widget-chat-background",e.FloatingWindowChoice="moveo-widget-floating-window-choice",e.WidgetFocused="moveo-widget-focused",e.Detached="moveo-widget-detached",e.Drag="moveo-widget-drag",e.Place="moveo-widget-place"}(yt||(yt={})),function(e){e.SetConfig="moveo-set-config",e.SetLocale="moveo-set-locale",e.SetCssVariables="moveo-set-css-variables",e.Open="moveo-open",e.Close="moveo-close",e.CloseConversation="moveo-close-conversation",e.SendMessage="moveo-send-message",e.ShowTeaserMessage="moveo-show-teaser-message",e.UpdateContext="moveo-update-context",e.UpdateHostContext="moveo-update-host-context",e.LoadSessionReplay="moveo-load-session-replay",e.HostScroll="moveo-host-scroll",e.HostLocation="moveo-host-location",e.HostVisibility="moveo-host-visibility",e.HostOpenerPolicy="moveo-host-opener-policy",e.HostSection="moveo-host-section",e.HostSectionsResolved="moveo-host-sections-resolved",e.WindowResize="moveo-resize",e.HostFrameBox="moveo-host-frame-box",e.HostPlacement="moveo-host-placement",e.SessionActivity="session-activity",e.UserWayDisabled="userway-disabled",e.UserWayEnabled="userway-enabled",e.LinkClicked="link-clicked",e.VisitorActionHandled="moveo-visitor-action-handled"}(bt||(bt={})),function(e){e.Expired="expired",e.Survey="survey",e.Closing="closing",e.Resolved="closed",e.Inactivity="inactivity",e.Continue="continue"}(Ct||(Ct={})),function(e){e.CloseButton="close-btn",e.EndSessionButton="end-btn",e.HeaderMenuButton="header-menu-btn",e.RestartButton="restart-btn",e.LauncherButton="launcher-btn",e.MessageInput="message-input",e.DisclaimerCheck="disclaimer-check",e.DisclaimerContainer="disclaimer-container",e.HeaderContainer="header-container",e.DragHandle="drag-handle",e.ImageButton="image-btn"}(xt||(xt={}));const Et=/(?:^|[\s;(])(?:Agent\/([\w.-]+)|(Google-Agent)\b)/;yt.AnalyticsEvent,yt.LinkClicked,yt.Navigate,yt.UserActivity,yt.VisitorAction,yt.LocaleChanged;const kt=e=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(16).padStart(8,"0")};Math.random().toString(36).slice(2);const St=()=>X("window.top",()=>window===window.top)??!0,It=["s2","s3","s4","s6","s7","s10","s12","s13","s14","s15","s16","s17","s19","s23"],Lt=e=>!e.x&&!e.y,At=(e,t,n)=>t>n?0:Math.min(Math.max(e,t),n),Mt={x:0,y:0},Tt=({iframe:e,storageKey:t,onChange:n})=>{let o=(i=t,X("stored widget position",()=>{const e=JSON.parse(localStorage.getItem(i)??"null");return Number.isFinite(e?.x)&&Number.isFinite(e?.y)?{x:e.x,y:e.y}:void 0})??Mt);var i;let s=Mt,r=null;const a=()=>!e.classList.contains("full"),l=t=>{s=t,((e,t)=>{e.style.translate=Lt(t)?"":`${t.x}px ${t.y}px`})(e,t)},c=(t,n=e.getBoundingClientRect())=>{if(!n.width||!n.height)return null;const o=((e,t,n,o,i)=>({x:At(e.x,n.x-t.left,o-t.right+n.x),y:At(e.y,n.y-t.top,i-t.bottom+n.y)}))(t,n,s,document.documentElement.clientWidth||window.innerWidth,window.innerHeight);return l(o),o},d=e=>{o=e,ee("store widget position",()=>{Lt(e)?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(e))}),n()};return l(o),{drag:(t,n,o)=>{if("end"===t)return void(r&&(r=null,d(s)));if(!a())return;const i=e.getBoundingClientRect(),l={x:i.left+n,y:i.top+o};"start"!==t&&r?c({x:r.from.x+l.x-r.pointer.x,y:r.from.y+l.y-r.pointer.y},i):r={pointer:l,from:s}},place:e=>{const t="offset"===e.target?(n=e,{x:Number(n?.x)||0,y:Number(n?.y)||0}):Mt;var n;l(t),d(t)},fit:()=>{r||!a()||Lt(o)||c(o)},offset:()=>o}},Ft=["message_click"];class $t{constructor({config:e}){this.visible=!1,this.detectUserway=()=>{It.forEach(e=>{document.addEventListener(`userway:feature_enabled_${e}`,()=>{const t=localStorage.getItem(`userway-${e}`)??"";this.sendEventToIframe({type:bt.UserWayEnabled,data:{eventType:e,value:t}})}),document.addEventListener(`userway:feature_disabled_${e}`,()=>{this.sendEventToIframe({type:bt.UserWayDisabled,data:{eventType:e}})})})},this.initUserway=()=>{const e={...localStorage};Object.keys(e).forEach(t=>{const n=(e[t],e[t]);if(t.includes("userway-s")&&(!isNaN(parseInt(n))||"true"===n)){const e=t.split("-")[1];"0"===n?this.sendEventToIframe({type:bt.UserWayDisabled,data:{eventType:e}}):this.sendEventToIframe({type:bt.UserWayEnabled,data:{eventType:e,value:n}})}})},this.detectMobile=()=>{this.sendEventToIframe({type:bt.WindowResize,data:{is_mobile:x(),width:window.innerWidth,height:window.innerHeight}}),this.mover?.fit(),this.sendFrameBox()},this.updateLastActivity=()=>{try{this.sendEventToIframe({type:bt.SessionActivity,data:"active"})}catch(e){this.log("Failed to report page activity",e)}},this.visitorIdConsent=()=>{if(null!==this.visitorConsent)return this.visitorConsent;const e=(()=>{const e=window,t=X("OnetrustActiveGroups",()=>e.OnetrustActiveGroups);if("string"==typeof t){const n=t.split(",").filter(Boolean);return 0===n.length?"pending":n.includes((e=>X("OneTrust.GetDomainData",()=>e.OneTrust?.GetDomainData?.()?.Groups?.find(e=>((e,t)=>[...e.FirstPartyCookies??[],...(e.Hosts??[]).flatMap(e=>e.Cookies??[])].some(e=>e.Name===t))(e,ue))?.OptanonGroupId)??"C0002")(e))?"granted":"refused"}return X("OneTrust script",()=>void 0!==e.OneTrust||null!==document.querySelector('script[src*="otSDKStub"], script[src*="otBannerSdk"]'))?"pending":void 0})()??X("Cookiebot",()=>{const e=window.Cookiebot?.consent;return e?null==e.method?"pending":e.statistics?"granted":"refused":document.querySelector('script[src*="consent.cookiebot.com"]')?"pending":void 0});return"refused"!==e&&(!("pending"===e||!this.visitorActed)||null)},this.markVisitorActed=()=>{this.visitorActed||(this.visitorActed=!0,this.sendHostContext(),this.sendEventToIframe({type:bt.VisitorActionHandled}))},this.trackVisitorContext=()=>{const e=()=>{try{if("visible"!==document.visibilityState)return;this.sentHostContext=null,this.sendHostContext()}catch(e){this.log("Failed to resend host context for a shown tab",e)}},t=[(n=this.sendHostContext,window.addEventListener(gt,n),()=>window.removeEventListener(gt,n)),ut(this.sendHostContext)];var n;return document.addEventListener("visibilitychange",e),()=>{t.forEach(e=>e()),document.removeEventListener("visibilitychange",e)}},this.sendHostContext=()=>{try{if(this.config.floating_session_id)return;if("hidden"===document.visibilityState)return;const e=this.visitorIdConsent();!1===e&&((e=window.location.hostname)=>{if(void 0===fe(ue))return;pe("",0);const t=ve(e);t&&pe("",0,t)})();const t=this.fiservAccount?(e=>{const{path:t,...n}=(e=>{const t={};for(const n of e)for(const[e,o]of Object.entries(n))void 0!==o&&""!==o&&void 0===t[e]&&(t[e]=o);return t})([ne({qm_partner_id:he("partnerId"),qm_client_id:he("stdAppType"),qm_config_id:he("selectedConfig"),qm_page_template:(o="template",X(`meta[name="${o}"]`,()=>te(document.querySelector(`meta[name="${CSS.escape(o)}"]`)?.content))),path:X("location.pathname",()=>te(window.location.pathname))}),...ce.map(e=>X(`${e.name}.readIdentity`,()=>e.readIdentity?.())??{})]);var o;const i={...ne(n),...nt(e),...tt()};return t?{...i,global:{client_path:t}}:i})(!0===e):nt(!0===e);if(0===Object.keys(t).length)return;const n=JSON.stringify(t);if(n===this.sentHostContext)return;this.sentHostContext=n,this.log("Host context:",t),this.updateHostContext(t)}catch(e){this.log("Failed to collect host context",e)}},this.sendSessionReplayHandoff=()=>{if(this.stopHostContext)try{const e=le();if(!e)return void(this.sentReplaySubscription=null);if(e===this.sentReplaySubscription)return;this.sentReplaySubscription=e,this.log("Session replay handoff:",e),this.sendEventToIframe({type:bt.LoadSessionReplay,data:{vendor:"quantum-metric",subscription:e}})}catch(e){this.log("Failed to hand off the session replay subscription",e)}},this.trackHostContext=()=>{const e=(e=>{const t=[];ce.forEach(n=>{const o=X(`${n.name}.whenReady`,()=>n.whenReady?.(e));"function"==typeof o&&t.push(o)});const n=new Set(ce.filter(e=>de(e,"isExpected")&&!de(e,"isReady")));let o;if(n.size>0){let t=Math.ceil(20);o=window.setInterval(()=>{t-=1,n.forEach(t=>{de(t,"isReady")&&(n.delete(t),e())}),(0===n.size||t<=0)&&window.clearInterval(o)},500)}return()=>{window.clearInterval(o),t.forEach(e=>ee("provider unsubscribe",e)),t.length=0}})(()=>{this.sendHostContext(),this.sendSessionReplayHandoff()}),t=at(this.sendHostContext),n=(e=>{let t;Ce({label:"storage patch",marker:_e,target:()=>Object.getPrototypeOf(window.localStorage),methods:["setItem","removeItem","clear"],event:$e,emitIf:([e])=>void 0===e||Fe.includes(e)});const n=()=>{window.clearTimeout(t),t=window.setTimeout(e,0)},o=e=>{(null===e.key||Fe.includes(e.key))&&n()},i=()=>{Ye&&queueMicrotask(Ze),n()};return window.addEventListener($e,i),window.addEventListener(b,o),()=>{window.removeEventListener($e,i),window.removeEventListener(b,o),window.clearTimeout(t)}})(this.sendHostContext);this.stopHostContext=()=>{e(),t(),n()}},this.trackSections=()=>{this.sectionTracker?.stop(),this.sectionTracker=null,this.sectionReport=null,this.hostSection=null,this.sendHostSection();const e=((e,t)=>{const n=(e=>{try{return new URL(e??"").pathname.toLowerCase()}catch{return(e??"").toLowerCase()}})(t);let o,i=0;return e?.forEach(e=>{const t=e?.url?.trim().toLowerCase();!t||t.length<=i||!n.includes(t)||(o=e,i=t.length)}),o})(this.config.teaser?.pages,window.location.href);e?.sections?.length&&(this.sectionTracker=ct(e.sections,{onChange:e=>{this.hostSection=e,this.sendHostSection()},onResolved:t=>{this.sectionReport={page:{id:e.id??null,url:e.url},sections:t},this.sendSectionReport()}}))},this.sendHostLocation=()=>{const e=X("host location",()=>window.location.href);e&&this.sendEventToIframe({type:bt.HostLocation,data:{href:e}})},this.applyVisibility=()=>{const e=this.currentPageRule(),t=!this.hiddenByHost&&"hide"!==e&&(this.widgetOpen||this.sessionActive||"show"===e);this.iframe.style.display=t?"":"none",t!==this.visible&&(this.visible=t,this.sendHostVisibility()),this.syncMobilePage()},this.currentPageRule=()=>((e,t)=>{const n=Ee((Se(t)?.pathname??"").toLowerCase()),o=e=>!!e?.some(e=>((e,t)=>{let n=0,o=0,i=-1,s=0;for(;o<t.length;)if("*"===e[n])i=n++,s=o;else if(e[n]===t[o])n++,o++;else{if(!(i>=0))return!1;n=i+1,o=++s}for(;"*"===e[n];)n++;return n===e.length})(Ee(e.trim().toLowerCase()),n));return o(e.hide_on_pages)?"hide":e.show_on_pages?.length&&!o(e.show_on_pages)?"miss":"show"})(this.config,window.location.href),this.offersFloatingWindow=()=>Boolean(this.config.floating_window)&&!this.isNested&&"embed"!==this.config.widget_position&&"documentPictureInPicture"in window,this.sendHostOpenerPolicy=()=>{if(!this.config.floating_window)return;this.hostOpenerPolicy??(this.hostOpenerPolicy=this.isNested?Promise.resolve(""):fetch(window.location.href,{method:"HEAD",cache:"force-cache",credentials:"same-origin"}).then(e=>e.ok?(e.headers.get("cross-origin-opener-policy")??"").split(";")[0].trim():"unknown").catch(()=>"unknown"));const e=this.offersFloatingWindow();this.hostOpenerPolicy.then(t=>{this.sendEventToIframe({type:bt.HostOpenerPolicy,data:{policy:t,floatingWindow:e}})})},this.sendHostPlacement=()=>{this.sendEventToIframe({type:bt.HostPlacement,data:{canMove:null!==this.mover,offset:this.mover?.offset()??{x:0,y:0}}})},this.sendHostVisibility=()=>{this.sendEventToIframe({type:bt.HostVisibility,data:{visible:this.visible}})},this.sendFrameBox=()=>{requestAnimationFrame(()=>{if(!this.iframe)return;const{width:e,height:t}=this.iframe.getBoundingClientRect();e&&t&&(this.frameHeight=t,this.placeInVisibleBand(),this.sendEventToIframe({type:bt.HostFrameBox,data:{width:e,height:t}}))})},this.placeInVisibleBand=()=>{const e=this.visibleBand;if(!this.iframe||!e||this.hostAlignedTop||"embed"===this.config.widget_position)return;if(this.iframe.classList.contains("full"))return void this.placeFullInBand(e);if(e.bottom>=window.innerHeight-1)return this.iframe.style.removeProperty("top"),this.iframe.style.removeProperty("bottom"),this.iframe.style.removeProperty("transition"),this.iframe.style.removeProperty("transform"),this.iframe.style.removeProperty("will-change"),void(this.placedTop=null);null==this.frameHeight&&(this.frameHeight=this.iframe.getBoundingClientRect().height);const t=Math.max(0,e.bottom-this.frameHeight);if(t!==this.placedTop){if(this.placedTop=t,e.exact)return this.iframe.style.top="0px",this.iframe.style.bottom="auto",this.iframe.style.willChange="transform",this.iframe.style.transition="none",void(this.iframe.style.transform=`translateY(${t}px)`);this.iframe.style.removeProperty("transform"),this.iframe.style.removeProperty("will-change"),this.iframe.style.transition="top 0.25s linear",this.iframe.style.top=`${t}px`,this.iframe.style.bottom="auto"}},this.placeFullInBand=e=>{e.top<=1&&e.bottom>=window.innerHeight-1?this.clearFullBandPin():(this.iframe.style.transition=e.exact?"":"top 0.25s linear, height 0.25s linear",this.iframe.style.setProperty("--moveo-full-top",`${e.top}px`),this.iframe.style.setProperty("--moveo-full-height",e.bottom-e.top+"px"))},this.holdMobilePage=()=>{if(this.pageOverflow)return;const{documentElement:e,body:t}=document;this.pageOverflow=[e.style.overflow,t.style.overflow],e.style.overflow="hidden",t.style.overflow="hidden",this.isNested||(this.keyboardCover=this.createKeyboardCover(),this.followKeyboard(),window.visualViewport?.addEventListener("resize",this.followKeyboard),window.visualViewport?.addEventListener("scroll",this.followKeyboard),window.addEventListener("scroll",this.followKeyboard,{passive:!0}))},this.syncMobilePage=()=>{this.mobilePanelOpen&&this.visible&&("embed"!==this.config.widget_position||this.fillsScreen)?this.holdMobilePage():this.releaseMobilePage()},this.releaseMobilePage=()=>{if(!this.pageOverflow)return;const{documentElement:e,body:t}=document,[n,o]=this.pageOverflow;"hidden"===e.style.overflow&&(e.style.overflow=n),"hidden"===t.style.overflow&&(t.style.overflow=o),this.pageOverflow=null,this.isNested||(window.visualViewport?.removeEventListener("resize",this.followKeyboard),window.visualViewport?.removeEventListener("scroll",this.followKeyboard),window.removeEventListener("scroll",this.followKeyboard),this.clearFullBandPin(),this.keyboardCover?.remove(),this.keyboardCover=null)},this.createKeyboardCover=()=>{const e=document.createElement("div");e.className="web-client-keyboard-cover",e.setAttribute("aria-hidden","true");const t=Number.parseInt(getComputedStyle(this.iframe).zIndex,10);return Number.isFinite(t)&&(e.style.zIndex=""+(t-1)),this.chatBackground&&(e.style.backgroundColor=this.chatBackground),e.addEventListener("touchmove",e=>e.preventDefault(),{passive:!1}),document.documentElement.append(e),e},this.followKeyboard=()=>{const e=window.visualViewport;e&&(this.iframe.style.setProperty("--moveo-full-top",`${e.offsetTop}px`),this.iframe.style.setProperty("--moveo-full-height",`${e.height}px`),this.keyboardCover&&(this.keyboardCover.hidden=e.scale>1||e.height>=window.innerHeight-1,this.keyboardCover.style.top=`${e.pageTop+e.height}px`))},this.clearFullBandPin=()=>{this.iframe.style.removeProperty("--moveo-full-top"),this.iframe.style.removeProperty("--moveo-full-height")},this.config=e,this.id=e.widgetId,this.isNested=!St(),this.fillsScreen="string"==typeof e.continue_code,this.initialized=!1,this.log=c()(`moveo:web-client:${this.id}`),this.iframe=this.createIframe(),this.stopHostContext=null,this.stopActivityTracking=null,this.scrollTracker=null,this.stopLocationTracking=null,this.widgetOpen=!1,this.sessionActive=!1,this.awaitingReplacement=!1,this.fiservAccount=g(this.config.account_id),this.sectionTracker=null,this.hostSection=null,this.sectionReport=null,this.appMounted=!1,this.sentHostContext=null,this.sentReplaySubscription=null,this.stopWindowListeners=null,this.widgetLoadedEvent=null,this.stopVisibleBand=null,this.visibleBand=null,this.hostAlignedTop=!1,this.frameHeight=null,this.placedTop=null,this.pageOverflow=null,this.mobilePanelOpen=!1,this.keyboardCover=null,this.chatBackground=null,this.hiddenByHost=!1,this.visitorConsent=null,this.visitorActed=!1,this.stopVisitorContext=null,this.floatingWindow=null,this.hostOpenerPolicy=null,this.mover=null}createIframe(){const e=document.createElement("iframe");return e.width="1px",e.height="1px",e.title="Moveo webchat",e.id=this.id,e.name=this.id,e.allow="geolocation; microphone; autoplay",e.style.border="0",e.classList.add("web-client-container"),"embed"===this.config.widget_position&&e.classList.add("embed"),this.fillsScreen&&e.classList.add("fills-screen"),e.setAttribute("src",E(this.id)),e}handleEvents(e,t){return n=>{const o=k(this.id,n);if(o)switch(this.floatingWindow?.observe(o,n.source===this.iframe.contentWindow),o.type){case yt.IframeLoaded:{let e=this.config;"show"!==this.currentPageRule()&&(e={...this.config,auto_open:!1}),this.sendEventToIframe({type:bt.SetConfig,data:e}),this.fiservAccount&&!this.stopHostContext&&this.trackHostContext(),this.stopVisitorContext??(this.stopVisitorContext=this.trackVisitorContext()),this.sendHostContext(),this.sendHostVisibility(),this.sendSessionReplayHandoff();break}case yt.SessionCreated:case yt.SessionReconnected:this.sessionActive=!0,this.awaitingReplacement=!1,this.applyVisibility(),this.sendHostOpenerPolicy(),this.sentHostContext=null,this.sendHostContext();break;case yt.SessionClosed:case yt.SessionExpired:{const e=o.type===yt.SessionClosed&&!0===o.data?.restarting;this.awaitingReplacement=e,e||(this.sessionActive=!1,this.applyVisibility());break}case yt.IframeError:return this.stopInstrumentation(),this.stopWindowListeners?.(),this.stopWindowListeners=null,t(o.data);case yt.UserWayInit:this.initUserway(),this.detectUserway();break;case yt.WidgetLoaded:setTimeout(()=>{this.detectMobile(),e(this)},0),this.sentHostContext=null,this.sentReplaySubscription=null,this.sendHostContext(),this.sendHostVisibility(),this.sendSessionReplayHandoff(),this.sendHostLocation(),this.sendHostPlacement(),this.appMounted=!0,this.sectionTracker&&this.sendHostSection(),this.sendSectionReport(),this.widgetLoadedEvent={timestamp:(new Date).toISOString(),event:"widget_loaded",properties:{}};break;case yt.WidgetError:this.notify(o);break;case yt.Opened:o.data.skipInstanceCallback||(this.widgetOpen=!0===o.data.openedByUser||this.sessionActive,this.applyVisibility()),!0===o.data.openedByUser&&this.markVisitorActed(),(o.data.isFull||o.data.is_mobile||x())&&(this.iframe.classList.add("full"),this.placeInVisibleBand()),(o.data.is_mobile||x())&&(this.mobilePanelOpen=!0,this.syncMobilePage());break;case yt.Closed:o.data.skipInstanceCallback||(this.widgetOpen=!1,this.awaitingReplacement&&(this.awaitingReplacement=!1,this.sessionActive=!1),this.applyVisibility()),this.mobilePanelOpen=!1,this.syncMobilePage(),(o.data.isFull||x())&&(this.iframe.classList.remove("full"),this.clearFullBandPin(),this.frameHeight=null,this.placeInVisibleBand());break;case yt.Resize:{this.iframe.style.width=o.data.width,this.iframe.style.height=o.data.height,this.iframe.style.left=o.data.left,null!=o.data.top&&(this.iframe.style.top=o.data.top,this.iframe.style.bottom="auto",this.hostAlignedTop=!0),this.mover?.fit();const e=Number.parseFloat(o.data.height);Number.isFinite(e)&&e>0?(this.frameHeight=e,this.placeInVisibleBand()):this.frameHeight=null,this.sendFrameBox();break}case yt.Navigate:if(n.source!==this.iframe.contentWindow)break;this.followWidgetLink(o.data?.url);break;case yt.VisitorAction:this.markVisitorActed();break;case yt.LocaleChanged:case yt.WidgetFocused:case yt.Detached:break;case yt.Drag:if(n.source===this.iframe.contentWindow){const{phase:e,x:t,y:n}=o.data;this.mover?.drag(e,Number(t)||0,Number(n)||0)}break;case yt.Place:n.source===this.iframe.contentWindow&&this.mover?.place(o.data);break;case yt.ChatBackground:if(n.source!==this.iframe.contentWindow||"string"!=typeof o.data)break;this.chatBackground=o.data,this.keyboardCover&&(this.keyboardCover.style.backgroundColor=o.data);break;case yt.AnalyticsEvent:Ft.includes(o.data.event)&&this.markVisitorActed();break;default:this.log(`Unhandle event: ${o.type}`)}}}sendHostSection(){this.appMounted&&this.sendEventToIframe({type:bt.HostSection,data:{id:this.hostSection}})}sendSectionReport(){this.appMounted&&this.sectionReport&&(this.sendEventToIframe({type:bt.HostSectionsResolved,data:this.sectionReport}),this.sectionReport=null)}stopInstrumentation(){this.stopHostContext?.(),this.stopHostContext=null,this.stopVisitorContext?.(),this.stopVisitorContext=null,this.stopActivityTracking?.(),this.stopActivityTracking=null,this.scrollTracker?.stop(),this.scrollTracker=null,this.stopLocationTracking?.(),this.stopLocationTracking=null,ee("clover continue style",()=>ft()?.remove()),this.sectionTracker?.stop(),this.sectionTracker=null,this.stopVisibleBand?.(),this.stopVisibleBand=null,this.visibleBand=null,this.floatingWindow?.stop(),this.floatingWindow=null,this.mobilePanelOpen=!1,this.releaseMobilePage()}resolveEmbedElement(){const e=this.config?.element||null;if("string"!=typeof e)return e;const t=document.getElementById(e);if(!t)throw new Error(`Element with id: ${e} not found`);return t}init(){return new Promise((e,t)=>{if(L(navigator.userAgent)&&!(e=>{const t=e.match(Et);return t?t[1]??t[2]:null})(navigator.userAgent))throw new Error(`Widget ${this.id} was not initialized because user-agent is a bot`);if(this.initialized)throw new Error(`Widget ${this.id} was already initialized`);let n;n="embed"===this.config.widget_position?this.resolveEmbedElement():window.document.querySelector("body");const o=this.handleEvents(e,t),i=Y(this.detectMobile,100);window.addEventListener("message",o),window.addEventListener("resize",i),this.stopWindowListeners=()=>{window.removeEventListener("message",o),window.removeEventListener("resize",i)},this.applyVisibility(),n?.appendChild(this.iframe),!0!==this.config.draggable||this.isNested||"embed"===this.config.widget_position||this.config.floating_window_mode||(this.mover=Tt({iframe:this.iframe,storageKey:`moveo_${this.config.integrationId}_widget_position`,onChange:this.sendHostPlacement}));const s=(r=this.config.teaser?.pages,!!r?.some(e=>!!e?.sections?.length));var r,a;this.fiservAccount&&vt(this.config.account_id),this.stopLocationTracking=at(()=>{this.applyVisibility(),"hide"===this.currentPageRule()&&this.floatingWindow?.close(),this.sendHostLocation(),this.fiservAccount&&vt(this.config.account_id),s&&this.trackSections()}),s&&this.trackSections(),this.stopActivityTracking=(e=>{const t=[],n=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return A(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Y(e,t,{leading:o,maxWait:t,trailing:i})}(e,3e3),o=(e,o)=>{window.addEventListener(e,n,o),t.push(()=>window.removeEventListener(e,n,o))},i={passive:!0};return o("load",i),o("mousemove",i),o("mousedown",i),o("touchstart",i),o("touchmove",i),o("click",i),o("keydown",i),o("scroll",{capture:!0,passive:!0}),()=>{t.forEach(e=>e()),t.length=0,n.cancel()}})(this.updateLastActivity),this.offersFloatingWindow()&&(this.floatingWindow=(({config:e,canFloat:t,onNavigate:n,onVisitorAction:o,onLocaleChange:i,log:s})=>{const r=window.documentPictureInPicture;let a=null,l=!1,c=!1,d=!1,h=null,u={};const m=()=>l&&!c&&!d&&t()?a:null,p=`${e.widgetId}-floating`,f=`moveo_${e.integrationId}_floating_window`,v=()=>{const e=X("localStorage",()=>localStorage.getItem(f));if("allow"===e)return"allow";const t=Number(e?.split(":")[1]);return Date.now()-t<2592e6?"deny":null},g=e=>ee("localStorage",()=>{e?localStorage.setItem(f,"deny"===e?`deny:${Date.now()}`:e):localStorage.removeItem(f)}),w=new BroadcastChannel(f);let y=null,b=!1;const C=()=>{b=Boolean(y),y?.window.close()},x=()=>{if("visible"!==document.visibilityState)return;const e=m();e&&w.postMessage({visible:kt(e)}),C()},S=(t,s,r)=>{const{document:a}=t;a.documentElement.style.height="100%",a.body.style.cssText="margin:0;height:100%;overflow:hidden;display:flex;justify-content:center;background:#f4f4f5";const l=a.createElement("iframe");l.title="Moveo webchat",l.allow="geolocation; autoplay",l.style.cssText="display:block;width:min(560px,100%);height:100%;border:0;background:#fff;box-shadow:0 2px 12px rgb(0 0 0 / 12%)",l.src=E(p);const c=new URL(l.src).origin,d=(e,t)=>l.contentWindow?.postMessage({type:`${p}${e}`,data:t},c);return t.addEventListener("message",a=>{if(a.source!==l.contentWindow)return;const c=k(p,a);if(c?.type===yt.IframeLoaded)d(bt.SetConfig,{...e,...h&&{language:h},clientUrl:window.location.href,element:void 0,widgetId:p,widget_position:"embed",floating_window_mode:"allow"===s?"chat":"prompt",floating_session_id:r});else if(c?.type===yt.WidgetLoaded)h&&d(bt.SetLocale,h),Object.keys(u).length&&d(bt.SetCssVariables,u);else if(c?.type===yt.AnalyticsEvent||c?.type===yt.LinkClicked||c?.type===yt.UserActivity)window.postMessage({type:`${e.widgetId}${c.type}`,data:"data"in c?c.data:void 0},window.location.origin);else if(c?.type===yt.VisitorAction)o(),d(bt.VisitorActionHandled);else if(c?.type===yt.LocaleChanged)"string"==typeof c.data&&(h=c.data,i(c.data));else if(c?.type===yt.Navigate)"string"==typeof c.data?.url&&n(c.data.url);else if(c?.type===yt.FloatingWindowChoice){const e=!0===c.data.allow;g(e?"allow":"deny"),e?t.resizeBy(360-t.innerWidth,682-t.innerHeight):C()}}),t.addEventListener("pagehide",()=>{y=null,b||"allow"!==v()||g(null),b=!1}),a.body.append(l),d};let I=!1,L=!1;const A=Y(()=>{if("visible"===document.visibilityState)return void(document.hasFocus()&&x());const e=v(),t=m();"deny"===e||y||I||r.window||!t||(I=!0,r.requestWindow({width:360,height:"allow"===e?682:300}).then(n=>{L||m()!==t?n.close():(y={window:n,sessionId:t,send:S(n,e,t)},A())}).catch(e=>s("The floating window did not open",e)).finally(()=>{I=!1}))},300);return document.addEventListener("visibilitychange",A),window.addEventListener("focus",x),w.addEventListener("message",e=>{y&&e.data?.visible===kt(y.sessionId)&&C()}),{stop:()=>{L=!0,document.removeEventListener("visibilitychange",A),window.removeEventListener("focus",x),A.cancel(),w.close(),C()},observe:(e,t)=>{switch(e.type){case yt.SessionCreated:case yt.SessionReconnected:a=e.data?.session_id??null;break;case yt.Opened:case yt.Closed:e.data.skipInstanceCallback||(l=e.type===yt.Opened,l||C());break;case yt.LocaleChanged:h=e.data;break;case yt.WidgetFocused:t&&x();break;case yt.Detached:t&&(c=!0===e.data.detached,d=!0===e.data.inCall)}},setLocale:e=>{h=e,y?.send(bt.SetLocale,e)},setCssVariables:e=>{u={...u,...e},y?.send(bt.SetCssVariables,e)},close:C}})({config:this.config,canFloat:()=>this.sessionActive&&!this.awaitingReplacement&&!this.hiddenByHost&&"hide"!==this.currentPageRule(),onNavigate:e=>this.followWidgetLink(e),onVisitorAction:()=>this.markVisitorActed(),onLocaleChange:e=>{this.sendEventToIframe({type:bt.SetLocale,data:e})},log:this.log})),this.config.teaser&&(this.scrollTracker=(e=>{let t,n=!1;const o=()=>{n=!1,e(!1)},i=()=>{n||(n=!0,e(!0)),clearTimeout(t),t=setTimeout(o,1e3)},s={capture:!0,passive:!0};return window.addEventListener("scroll",i,s),{pulse:i,stop:()=>{window.removeEventListener("scroll",i,s),clearTimeout(t)}}})(e=>this.sendEventToIframe({type:bt.HostScroll,data:{scrolling:e}}))),this.isNested&&"embed"!==this.config.widget_position&&(this.stopVisibleBand=(a=e=>{const t=null!=e&&(this.visibleBand?.top!==e.top||this.visibleBand?.bottom!==e.bottom);this.visibleBand=e,this.placeInVisibleBand(),t&&this.scrollTracker?.pulse()},X("visible band",()=>(e=>{const t=(()=>{const e=[];try{let t=window;for(;t!==t.parent;){if(!t.frameElement)return null;t=t.parent,t.innerHeight,e.push(t)}}catch{return null}return e})();if(!t||0===t.length)return null;const n=()=>{let e=0,t=window.innerHeight,n=0,o=window;for(;o!==o.parent;){const i=o.frameElement;if(!i)return null;n+=i.getBoundingClientRect().top+i.clientTop,o=o.parent,e=Math.max(e,-n),t=Math.min(t,o.innerHeight-n)}return t>e?{top:e,bottom:t,exact:!0}:null};let o=null;const i=()=>{const t=X("ancestor geometry",n)??null;!t||o&&o.top===t.top&&o.bottom===t.bottom||(o=t,e(t))},s={capture:!0,passive:!0};for(const e of t)e.addEventListener("scroll",i,s),e.addEventListener("resize",i);return window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i);for(const e of t)try{e.removeEventListener("scroll",i,s),e.removeEventListener("resize",i)}catch{}}})(a))||(X("visible band ladder",()=>(e=>{const t=document.createElement("div");t.style.cssText="position:absolute;top:0;left:0;width:0;height:0;pointer-events:none";const n=document.createElement("div");n.dataset.bandProbe="";const o=()=>{const e=t.parentNode;e?.removeChild(t);const n=X("document height",()=>Math.max(document.documentElement.scrollHeight,window.innerHeight));return e?.appendChild(t),n&&n>0?n:null},i=new Set;let s=null,r=0,a=600,l=!1;const c=new IntersectionObserver(t=>{for(const e of t){const t=Number(e.target.dataset.y);e.isIntersecting?i.add(t):i.delete(t);const n=e.rootBounds?.height;n&&(a=n)}C(),(()=>{if(l)return;if(0===i.size)return;const t=X("scrollY",()=>window.scrollY)??0;let n=1/0,o=-1/0;for(const e of i)e<n&&(n=e),e>o&&(o=e);n=Math.max(0,n-t),o-=t,o<=n||s&&s.top===n&&s.bottom===o||(s={top:n,bottom:o,exact:!1},e(s))})()},{root:null,threshold:0});let d=null,h=null,u=0,m=null;const p=new IntersectionObserver(t=>{const n=(e=>{const t=e.intersectionRect,n=e.boundingClientRect;if(!e.isIntersecting||!t||!n)return null;const o=X("scrollY",()=>window.scrollY)??0,i=t.top-n.top-o,s=t.bottom-n.top-o;if(!Number.isFinite(i)||!Number.isFinite(s)||s<=i)return null;const r=performance.now(),a=Number.isFinite(e.time)&&r-e.time>-5&&r-e.time<200?e.time:r;return{top:Math.max(0,i),bottom:s,at:a}})(t[t.length-1]);if(!n)return;l||(l=!0,dt("browser clips the probe; exact bands from here on"));const o=h?.top===n.top&&h.bottom===n.bottom;return o&&null!==g?void 0:null!==g?(d=n,void(v=performance.now()+500)):void(o&&s?.exact&&s.top===n.top&&s.bottom===n.bottom||(h={t:n.at,top:n.top,bottom:n.bottom},u=0,m=n.bottom,s={top:n.top,bottom:n.bottom,exact:!0},e(s),C()))},{root:null,threshold:0}),f=()=>{p.unobserve(n),p.observe(n)};let v=0,g=null,w=0,y=0;const b=()=>{g=null,ee("visible band pump",()=>{const t=performance.now(),n=y?Math.min(50,t-y):16;if(y=t,null!==m&&(m+=u*n),d){w=0;const e=d;d=null,(e=>{const t=h;h={t:e.at,top:e.top,bottom:e.bottom};const n=t?e.at-t.t:0;if(!t||null===m||n<4||n>120)return m=e.bottom,void(u=0);let o=(e.bottom-t.bottom)/n;o=Math.max(u-.3*n,Math.min(u+.3*n,o)),u=0!==u&&Math.sign(o)!==Math.sign(u)||0===u?o:u+.4*(o-u),m+=.35*(e.bottom-m)})(e)}else if(w||(w=t),t-w>24/Math.max(.1,Math.abs(u))&&(u*=Math.exp(-n/50),Math.abs(u)<.02&&(u=0),0===u&&h&&null!==m&&(m+=(h.bottom-m)*(1-Math.exp(-n/40)),Math.abs(m-h.bottom)<.75&&(m=h.bottom))),h&&null!==m&&0!==u){const e=h.bottom+32*Math.sign(u);m=u>0?Math.min(m,e):Math.max(m,e)}if(null!==m&&h){const t=Math.max(-160,Math.min(160,8*u)),o=h.bottom-h.top;let i=m+t;if(s?.exact){const e=Math.abs(u)*n*1.75+6;i=Math.max(s.bottom-e,Math.min(s.bottom+e,i))}const r=(e=>{const t=Math.max(0,e.top+0);let n=e.bottom+0;const o=window.innerHeight-2;return e.bottom<=o&&n>o&&(n=o),n<=t?null:{top:t,bottom:n,exact:!0}})({top:Math.max(0,i-o),bottom:i});r&&((t,n)=>{s?.exact&&s.top===t&&s.bottom===n||(s={top:t,bottom:n,exact:!0},e(s))})(r.top,r.bottom)}t>=v||(f(),g=requestAnimationFrame(b))})},C=()=>{v=performance.now()+500,null===g&&"function"==typeof requestAnimationFrame&&(w=0,y=0,f(),g=requestAnimationFrame(b))},x=e=>{r=e;const o=((e,t)=>{const n=Math.max(16,Math.ceil(e/200)),o=Math.max(16,Math.floor(.5*t));return Math.max(Math.min(n,o),Math.ceil(e/2e3))})(r,a);t.replaceChildren(),i.clear(),n.style.cssText=`position:absolute;top:0;left:0;width:1px;height:${r}px;pointer-events:none`,t.appendChild(n);const s=e=>{const n=document.createElement("div");n.dataset.y=String(e),n.style.cssText=`position:absolute;top:${e}px;left:0;width:1px;height:1px`,t.appendChild(n)};let l=0;for(;l<r-1;l+=o)s(l);s(Math.max(0,r-1)),c.disconnect();for(const e of t.children)e!==n&&c.observe(e);p.disconnect(),p.observe(n)};let E=!1;const k=()=>{ee("visible band rebuild",()=>{const e=E?o():null;null!==e&&e!==r&&x(e)})},S=()=>{ee("visible band attach",()=>{(document.body??document.documentElement).appendChild(t),E=!0;const e=o();null!==e&&x(e)})};return document.body?S():document.addEventListener("DOMContentLoaded",S,{once:!0}),window.addEventListener("resize",k),()=>{null!==g&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(g),g=null,v=0,d=null,h=null,u=0,m=null,y=0,window.removeEventListener("resize",k),document.removeEventListener("DOMContentLoaded",S),c.disconnect(),p.disconnect(),t.remove(),i.clear(),s=null}})(a))??(()=>{})))),this.initialized=!0,this.detectMobile()})}sendEventToIframe(e){this.iframe&&this.iframe.contentWindow?(this.log(`Event to iframe: ${e.type}`,e),e.type===bt.SetConfig&&e.data?.element&&delete e.data.element,this.iframe.contentWindow.postMessage({...e,type:`${this.id}${e.type}`},"*")):this.log("Error: Cannot find iframe to send event")}notify(e){this.log(`notify ${e.type}:`,e)}notifyParent(e,t){window.addEventListener("message",n=>{const o=k(this.id,n);if(o&&(this.log(`Event from iframe: ${o.type}`,o),o.type===e)){if("data"in o&&"object"==typeof o.data&&null!==o.data&&"skipInstanceCallback"in o.data)return;t("data"in o?o.data:void 0)}})}openWindow(){this.sendEventToIframe({type:bt.Open})}async destroy(){var e;this.closeConversation({hide:!0}),this.stopInstrumentation(),await(e=4e3,new Promise(t=>setTimeout(t,e)));const t=document.getElementById(this.id);t&&(t.remove(),this.initialized=!1),this.stopWindowListeners?.(),this.stopWindowListeners=null,this.sentHostContext=null,this.sentReplaySubscription=null,this.visible=!1,this.widgetLoadedEvent=null,this.appMounted=!1,this.widgetOpen=!1,this.sessionActive=!1,this.awaitingReplacement=!1,this.hiddenByHost=!1,this.hostSection=null,this.sectionReport=null}setVisitorConsent(e){this.visitorConsent=e,this.sendHostContext()}closeConversation({hide:e}){this.sendEventToIframe({type:bt.CloseConversation,data:{hide:e}}),!1!==e&&(this.hiddenByHost=!0,this.applyVisibility(),this.floatingWindow?.close())}closeWindow(){this.sendEventToIframe({type:bt.Close})}sendMessage(e){this.sendEventToIframe({type:bt.SendMessage,data:e})}showTeaserMessage(e){this.sendEventToIframe({type:bt.ShowTeaserMessage,data:e?{text:e}:void 0})}updateContext(e){this.sendEventToIframe({type:bt.UpdateContext,data:e})}updateHostContext(e){this.sendEventToIframe({type:bt.UpdateHostContext,data:e})}setCSSVariables(e){const t=e["--moveo-z-index"];void 0!==t&&this.iframe&&(t?this.iframe.style.setProperty("--moveo-z-index",t):this.iframe.style.removeProperty("--moveo-z-index")),this.sendEventToIframe({type:bt.SetCssVariables,data:e}),this.floatingWindow?.setCssVariables(e)}setLocale(e){this.sendEventToIframe({type:bt.SetLocale,data:e}),this.floatingWindow?.setLocale(e)}onSessionCreated(e){this.notifyParent(yt.SessionCreated,e)}onSessionClosed(e){this.notifyParent(yt.SessionClosed,e)}onConversationClosed(e){this.notifyParent(yt.ConversationClosed,e)}onSessionReconnected(e){this.notifyParent(yt.SessionReconnected,e)}onNoUnreadMessages(e){this.notifyParent(yt.ConversationNoUnreadMessages,e)}onUnreadMessages(e){this.notifyParent(yt.ConversationUnreadMessages,e)}followWidgetLink(e){"string"==typeof e&&(e=>{try{const{protocol:t}=new URL(e);return"http:"===t||"https:"===t}catch{return!1}})(e)&&St()&&((e,t)=>{try{return new URL(e).hostname===new URL(t).hostname}catch{return!1}})(e,window.location.href)&&(this.fiservAccount&&(e=>{if(!(Le(e)&&(t=new URL(e).searchParams,t.has("bundleId")||t.has("products")&&t.has("planId"))))return!1;var t;const n=Je(Ae);return!("string"!=typeof n||!qe(X(Ae,()=>JSON.parse(n)),null)||(ee(`localStorage ${Ae}`,()=>window.localStorage.removeItem(Ae)),0))})(e)?this.navigateHost(e):this.followSameDomainLink(e))}followSameDomainLink(e){let t=!1;const n=new MutationObserver(()=>{t=!0,n.disconnect()});n.observe(document.body,{childList:!0,subtree:!0}),window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate",{state:{}})),window.setTimeout(()=>{n.disconnect(),t||this.navigateHost(e)},1e3)}navigateHost(e){window.location.assign(e)}onLinkClicked(e){this.notifyParent(yt.LinkClicked,e)}onUserActivity(e){this.notifyParent(yt.UserActivity,e)}onAnalyticsEvent(e){this.notifyParent(yt.AnalyticsEvent,e),this.widgetLoadedEvent&&e(this.widgetLoadedEvent)}onWebchatOpened(e){this.notifyParent(yt.Opened,e)}onWebchatClosed(e){this.notifyParent(yt.Closed,e)}onMemberLeave(e){this.notifyParent(yt.MemberLeave,e)}}e(),r(),t(),s(),i(),a();var _t=n(178),Pt={};Pt.styleTagTransform=function e(){return e.c||(e.c=n.n(a()))}()(),Pt.setAttributes=function e(){return e.c||(e.c=n.n(s()))}()(),Pt.insert=function e(){return e.c||(e.c=n.n(t()))}()().bind(null,"head"),Pt.domAPI=function e(){return e.c||(e.c=n.n(r()))}()(),Pt.insertStyleElement=function e(){return e.c||(e.c=n.n(i()))}()(),function t(){return t.c||(t.c=n.n(e()))}()()(_t.A,Pt),_t.A&&_t.A.locals&&_t.A.locals;let Ot=c()("moveo:web-client");const Ht=async e=>{await new Promise(e=>{if("complete"===document.readyState)return e();window.addEventListener("load",()=>e())});const t=await(async e=>{const t=`moveo-${d(5)}`,n="string"==typeof e?.floating_client_url&&e.floating_client_url||window.location.href;if(Ot=Ot.extend(`:${t}`),!e?.integrationId)throw new Error("integrationId is required.\n Call MoveoAI.init({ integrationId: YOUR_INTEGRATION_HERE })");const o=await(async(e,t)=>{const n=t||f,o=await fetch(`${n}/v1/web/${e}`,{headers:{"Cache-Control":"no-cache"}}),i=await o.text();if(o.ok)return JSON.parse(i);throw new Error(`Error loading config from: ${n}/${e}`)})(e.integrationId,e.host);Ot("Loaded integration configuration:",o);const{feature_flags:i,account_id:s,...r}=e;void 0!==i&&Ot("feature_flags is server-owned; the caller value is ignored"),void 0!==s&&Ot("account_id is server-owned; the caller value is ignored");const{teaser:a,...l}=r;return{...m({...o},l),...void 0!==a&&{teaser:a},clientUrl:n,widgetId:t}})(e);if(Ot("Configuration:",t),"embed"===t.widget_position&&!t.element)throw new Error("element is not defined but required by embed widget");const n=new $t({config:t});Ot("Initializing");const o=await n.init();return Ot("Initialized"),o}})(),o})());
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("MoveoAI",[],t):"object"==typeof exports?exports.MoveoAI=t():e.MoveoAI=t()}(this,()=>(()=>{var e={178(e,t,n){"use strict";var o=n(601),i=n.n(o),s=n(314),r=n.n(s)()(i());r.push([e.id,"/*\n * Applied to the iframe on the customer's own page, so the overrides below are\n * deliberate: the host stylesheet must not win.\n */\n.web-client-container {\n position: fixed;\n right: 0;\n bottom: 0;\n z-index: var(--moveo-z-index, 10022);\n max-height: 99%;\n cursor: pointer;\n}\n\n.web-client-container.embed {\n position: static;\n width: 100% !important;\n height: 100% !important;\n max-height: 100%;\n}\n\n/*\n * Full is the frame's viewport — the visitor's window only on a top-level\n * page. On a nested install the loader pins the panel to the visible band\n * through these two variables; unset, they resolve to the plain full frame.\n */\n.web-client-container.full {\n inset: var(--moveo-full-top, 0) 0 auto 0 !important;\n width: 100% !important;\n height: var(--moveo-full-height, 100%) !important;\n max-height: initial;\n\n /* A visitor's drag moves the corner widget, never the full-screen panel. */\n translate: none !important;\n}\n\n/* The `/continue` page is the chat, so on a phone it is pinned like the\n open panel, and the loader keeps it above the keyboard. */\n.web-client-container.embed.fills-screen.full {\n position: fixed;\n}\n\n/* Hides the page in the gap between the phone chat and the keyboard.\n The loader sets its top and its color. */\n.web-client-keyboard-cover {\n position: absolute !important;\n left: 0 !important;\n width: 100% !important;\n height: 100vh !important;\n touch-action: none !important;\n}\n",""]);const a=r;n.d(t,["A",0,a])},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,o,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(o)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(r[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&r[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},833(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(736)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736(e,t,n){e.exports=function(e){function t(e){let n,i,s,r=null;function a(...e){if(!a.enabled)return;const o=a,i=Number(new Date),s=i-(n||i);o.diff=s,o.prev=n,o.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,i)=>{if("%%"===n)return"%";r++;const s=t.formatters[i];if("function"==typeof s){const t=e[r];n=s.call(o,t),e.splice(r,1),r--}return n}),t.formatArgs.call(o,e),(o.log||t.log).apply(o,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=o,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{r=e}}),"function"==typeof t.init&&t.init(a),a}function o(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function i(e,t){let n=0,o=0,i=-1,s=0;for(;n<e.length;)if(o<t.length&&(t[o]===e[n]||"*"===t[o]))"*"===t[o]?(i=o,s=n,o++):(n++,o++);else{if(-1===i)return!1;o=i+1,s++,n=s}for(;o<t.length&&"*"===t[o];)o++;return o===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(i(e,n))return!1;for(const n of t.names)if(i(e,n))return!0;return!1},t.humanize=n(585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},585(e){var t=1e3,n=60*t,o=60*n,i=24*o,s=7*i;function r(e,t,n,o){var i=t>=1.5*n;return Math.round(e/n)+" "+o+(i?"s":"")}e.exports=function(e,a){a=a||{};var l,c,d=typeof e;if("string"===d&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var a=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===d&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=i?r(l,c,i,"day"):c>=o?r(l,c,o,"hour"):c>=n?r(l,c,n,"minute"):c>=t?r(l,c,t,"second"):l+" ms"):function(e){var s=Math.abs(e);return s>=i?Math.round(e/i)+"d":s>=o?Math.round(e/o)+"h":s>=n?Math.round(e/n)+"m":s>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}};const t={};function n(o){const i=t[o];if(void 0!==i)return i.exports;const s=t[o]={id:o,exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},n.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var i=t[o++],s=t[o++],r=0===s?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:s};n.o(e,i)||Object.defineProperty(e,i,r)}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0;let o={};return(()=>{"use strict";n.r(o),n.d(o,{init:()=>Wt});var e=n.cw(e=>{var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var s={},r=[],a=0;a<e.length;a++){var l=e[a],c=o.base?l[0]+o.base:l[0],d=s[c]||0,h="".concat(c," ").concat(d);s[c]=d+1;var u=n(h),m={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(m);else{var p=i(m,o);o.byIndex=a,t.splice(a,0,{identifier:h,updater:p,references:1})}r.push(h)}return r}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var s=o(e=e||[],i=i||{});return function(e){e=e||[];for(var r=0;r<s.length;r++){var a=n(s[r]);t[a].references--}for(var l=o(e,i),c=0;c<s.length;c++){var d=n(s[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=l}}}),t=n.cw(e=>{var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}}),i=n.cw(e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}}),s=n.cw(e=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}}),r=n.cw(e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}),a=n.cw(e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}),l=n(833),c=n.n(l);let d=(e=21)=>{for(var t="",n=crypto.getRandomValues(new Uint8Array(e|=0));e--;)t+="57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9"[63&n[e]];return t};const h=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1},u=new Set(["__proto__","constructor","prototype","toString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString"]),m=(...e)=>e.reduce((e,t)=>{if(void 0===t)return e;if(Array.isArray(t))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(t).forEach(n=>{u.has(n)||(Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=m.options.mergeArrays?m.options.uniqueArrayItems?Array.from(new Set(e[n].concat(t[n]))):[...e[n],...t[n]]:t[n]:h(e[n])&&h(t[n])?e[n]=m(e[n],t[n]):!h(e[n])&&h(t[n])?e[n]=m(t[n],void 0):e[n]=void 0===t[n]?m.options.allowUndefinedOverrides?t[n]:e[n]:t[n])}),e},{}),p={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};m.options=p,m.withOptions=(e,...t)=>{m.options=Object.assign(Object.assign({},p),e);const n=m(...t);return m.options=p,n};const f="https://channels-ws.moveo.ai",v=Object.freeze({"bab4875e-0411-4ae1-9e98-19ea236d369b":"nbg","0ffdaef8-4ce9-4188-9fdd-4644e5062cf2":"alpha","0e614713-2e6b-4af2-8e9e-21c2a4617981":"fiserv"}),g="https://web.moveo.ai",w="https://web.dev.moveo.ai",y="storage",b=[1e3,2e3,2e3,4e3,4e3],C=()=>window.innerWidth<650||window.innerHeight<550&&window.innerWidth<1e3||(()=>{const{screen:e}=window;return!!e&&Math.min(e.width,e.height)<650&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches})(),x=e=>{let t="";const n=document.querySelectorAll("script");n&&n.forEach(e=>{e.src?.includes(w)&&(t=w),e.src?.includes(g)&&(t=g),e.src?.match(/@moveo-ai\/web-client.*next/)&&(t="https://web-client.dev.moveo.ai")});const{origin:o}=window.location;return t||(t=o.match(/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\])(:\d+)?$/)||o.match(/^https:\/\/([a-z0-9-]+\.)?web-7ii\.pages\.dev$/)||o.match(/web-client.*moveo-ai\.vercel\.app/)||o.match(/web.*moveo\.ai/)?o:g),`${t}?widgetId=${e}`},k=(e,t)=>{const n=t?.data?.type;if("string"!=typeof n||!n.startsWith(e))return null;const o=n.replace(e,""),i=t.data?.data;return{type:o,data:i}};var E,S=/bot|crawl|http|lighthouse|scan|search|spider/i;var I=function(e){return"string"==typeof(t=e)&&""!==t&&function(){if(E instanceof RegExp)return E;try{E=new RegExp(" daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! channel/|google/)google(?!(?:wv|app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!cam)scan|(?<!lib)http|24x7|;\\s\\w+;$|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\b\\w+/1\\.0;|\\bbw/|\\bdlc\\b|\\bort/|\\bperl\\b|\\btime/|\\||^[<\\(;]|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[\\w\\-]+/[\\w]+$|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^\\w+/\\d\\.\\d\\s\\([\\w@]+\\)$|^active|^ad muncher|^amaya|^apache/|^avsdevicesdk/|^azure|^biglotron|^blackbox exporter|^bot|^clamav[ /]|^claude-code/|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^exodusmovement|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\((?:compatible;)?(?:\\s?[\\w\\d-.]+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^ps_daily/|^python|^rank|^read|^reed|^remove\\.bg/|^rest|^rss|^snapchat|^sora |^space bison|^stape/|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|abuse|advisor|agent\\b|analyzer|archive|ask jeeves/teoma|attracta|audit|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|collapsify\\b|convertify|cookiehubverify/|crawl|cursor/|cypress/|dareboost|datanyze|dejaclick|detect|discovery|dmbrowser|download|exaleadcloudview|feed|firephp|foregenix|functionize|grab|hardenize\\b|headless|hotjar|httrack|hubspot marketing grader|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|linktiger|mail\\.ru/|manager|manus-user/|marketgoo/|measure|monitor\\b|neustar wpm|node\\b|nutch|offbyone|openvas|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|playwright|powermarks|preview|productfinder|prospectingstudio|proxy|ptst[ /]\\d|radar|readable/|retriever|rexx;|rigor|rss\\b|scrape|securityheaders|selenium|server|silktide|sindup/|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|testlocally|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|watchtowr|webglance|webkit2png|whatcms/|xtate/","i")}catch(e){E=S}return E}().test(e);var t};const L=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;var A="object"==typeof self&&self&&self.Object===Object&&self;const T=M||A||Function("return this")(),F=function(){return T.Date.now()};var $=/\s/;var _=/^\s+/;const P=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&$.test(e.charAt(t)););return t}(e)+1).replace(_,""):e},O=T.Symbol;var H=Object.prototype,R=H.hasOwnProperty,W=H.toString,j=O?O.toStringTag:void 0;var B=Object.prototype.toString;var N=O?O.toStringTag:void 0;const V=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":N&&N in Object(e)?function(e){var t=R.call(e,j),n=e[j];try{e[j]=void 0;var o=!0}catch(e){}var i=W.call(e);return o&&(t?e[j]=n:delete e[j]),i}(e):function(e){return B.call(e)}(e)};var z=/^[-+]0x[0-9a-f]+$/i,U=/^0b[01]+$/i,q=/^0o[0-7]+$/i,D=parseInt;const Q=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==V(e)}(e))return NaN;if(L(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=L(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=P(e);var n=U.test(e);return n||q.test(e)?D(e.slice(2),n?2:8):z.test(e)?NaN:+e};var K=Math.max,G=Math.min;const J=function(e,t,n){var o,i,s,r,a,l,c=0,d=!1,h=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=o,s=i;return o=i=void 0,c=t,r=e.apply(s,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=s}function f(){var e=F();if(p(e))return v(e);a=setTimeout(f,function(e){var n=t-(e-l);return h?G(n,s-(e-c)):n}(e))}function v(e){return a=void 0,u&&o?m(e):(o=i=void 0,r)}function g(){var e=F(),n=p(e);if(o=arguments,i=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),d?m(e):r}(l);if(h)return clearTimeout(a),a=setTimeout(f,t),m(l)}return void 0===a&&(a=setTimeout(f,t)),r}return t=Q(t)||0,L(n)&&(d=!!n.leading,s=(h="maxWait"in n)?K(Q(n.maxWait)||0,t):s,u="trailing"in n?!!n.trailing:u),g.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=l=i=a=void 0},g.flush=function(){return void 0===a?r:v(F())},g},Y=e=>Boolean(e&&"fiserv"===v[e]),Z=c()("moveo:safe-read"),X=(e,t)=>{try{return t()}catch(t){return void Z("%s unreadable: %o",e,t)}},ee=(e,t)=>{X(e,()=>{t()})},te=e=>{if("string"==typeof e)return e.trim()||void 0},ne=e=>{for(const t of Object.keys(e))void 0===e[t]&&delete e[t];return e},oe=new Set,ie=({label:e,marker:t,target:n,methods:o,event:i,emitIf:s=()=>!0})=>{oe.has(t)||(oe.add(t),ee(e,()=>{const e=n();e[t]||(o.forEach(t=>{const n=e[t];e[t]=function(...e){const t=n.apply(this,e);return s(e)&&ee(i,()=>{window.dispatchEvent(new Event(i))}),t}}),e[t]=!0)}))},se="moveo:activity:locationchange",re=Symbol.for("moveo.activity.history"),ae=[se,"popstate","hashchange"],le=[0,400],ce=e=>{ie({label:"history patch",marker:re,target:()=>window.history,methods:["pushState","replaceState"],event:se});const t=new Set,n=()=>{t.forEach(e=>window.clearTimeout(e)),t.clear(),le.forEach(n=>{const o=window.setTimeout(()=>{t.delete(o),e()},n);t.add(o)})};return ae.forEach(e=>window.addEventListener(e,n)),()=>{ae.forEach(e=>window.removeEventListener(e,n)),t.forEach(e=>window.clearTimeout(e)),t.clear()}},de=e=>e.replace(/\/+$/,"")||"/",he=e=>{try{return new URL(e)}catch{return null}},ue=["clover.com","www.clover.com","www.staging.clover.com"],me=(e,t)=>{const n=de(e);return n===t||n.startsWith(`${t}/`)},pe=e=>{const t=he(e);return t&&ue.includes(t.hostname.toLowerCase())?t:null},fe=e=>!!pe(e),ve="cart-v1",ge="checkout-plan",we="moveo_clover_cart_seen",ye=[ve,ge],be="moveo:clover:cartchange",Ce=Symbol.for("moveo.clover.storage"),xe=e=>{return(t=e)&&"object"==typeof t&&!Array.isArray(t)?e:void 0;var t},ke=e=>Array.isArray(e)?e:[],Ee=e=>"number"==typeof e&&Number.isFinite(e)?e:null,Se=e=>te(e)??null,Ie=e=>{const t=Se(e);return t&&/^[A-Z0-9_]{1,40}$/.test(t)?t:null},Le=e=>Se(e)?.replace(/[\s\p{Cc}]+/gu," ").slice(0,60)??null,Me=e=>{const t=Se(e);return t?.startsWith("//")?`https:${t}`:t?.startsWith("https://")?t:null},Ae=(e,t)=>Ee(xe(xe(e)?.[t])?.value),Te=e=>t=>{const n=xe(t),o=Le(n?.name);if(!n||!o)return[];const i=Ie(n.id);return[{id:i,name:o,kind:e(i),quantity:Ee(n.quantity)??1,price:Ee(n.totalCost),monthly_36:Ae(n.installmentPlans,"SL36"),monthly_48:Ae(n.installmentPlans,"SL48"),image_url:Me(n.imageURL)}]},Fe=e=>{const t=xe(e),n=Ee(t?.percentage),o=Ee(t?.cost);return null===n||null===o?null:`${n}% + $${o.toFixed(2)}`},$e=e=>{const t=xe(e),n=Le(t?.name);if(!t||!n)return null;const o=xe(t.transactions);return{name:n,monthly:Ee(t.monthly),in_person:Fe(o?.inPerson),keyed_in:Fe(o?.keyedIn),additional_device:Ee(t.additionalDevicePrice)}},_e=(e,t)=>{const n=xe(e),o=xe(n?.cart),i=xe(o?.cartMetadata),s=xe(n?.checkout),r=ke(i?.hardware),a=new Set(r.flatMap(e=>ke(xe(e)?.accessories).map(e=>Ie(xe(e)?.id)))),l=[...r.flatMap(Te(e=>e&&a.has(e)?"accessory":"device")),...ke(o?.products).flatMap(Te(()=>"add-on"))].slice(0,10);if(0===l.length)return null;const c=[i?.solutionTitle,i?.name].map(Le).filter(Boolean).join(" · ");return{order_type:Se(o?.orderType),bundle_id:Ie(i?.id),plan_id:Ie(xe(o?.softwarePlan)?.id),solution:c||null,items:l,plan:$e(o?.softwarePlan),item_count:Ee(s?.count)??l.reduce((e,t)=>e+t.quantity,0),subtotal:Ee(s?.subtotal),software_monthly:Ee(s?.softwareTotal),installments:ke(s?.installmentPlans).flatMap(e=>{const t=xe(e),n=Ee(t?.months),o=Ee(t?.cost);return null===n||null===o?[]:[{months:n,monthly:o}]}).slice(0,4),payment_option:Le(t)}},Pe=e=>`$${e.toLocaleString("en-US",{minimumFractionDigits:Number.isInteger(e)?0:2,maximumFractionDigits:2})}`,Oe=e=>e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]??"",He=e=>{const t=null===e.price?"":`, ${Pe(e.price)} each`;return`"${e.name}" (quantity ${e.quantity}${t})`},Re=e=>{const t=1===e.item_count?"item":"items",n=[`The visitor's Clover cart has ${e.item_count} ${t}: ${Oe(e.items.map(He))}.`];if(e.solution&&n.push(`Package: "${e.solution}".`),null!==e.subtotal){const t=e.installments.map(({months:e,monthly:t})=>`${Pe(t)}/month for ${e} months`),o=t.length?`, or ${t.join(" or ")}`:"";n.push(`Hardware subtotal: ${Pe(e.subtotal)}${o}.`)}e.plan&&(n.push((e=>{const t=null===e.monthly?"":` at ${Pe(e.monthly)}/month`,n=[e.in_person&&`${e.in_person} in person`,e.keyed_in&&`${e.keyed_in} keyed in`].filter(e=>!!e),o=n.length?`, card fees ${Oe(n)}`:"";return`Software plan: "${e.name}"${t}${o}.`})(e.plan)),null!==e.plan.additional_device&&n.push(`Each additional device adds ${Pe(e.plan.additional_device)}/month.`)),null!==e.software_monthly&&n.push(`Software total: ${Pe(e.software_monthly)}/month.`),e.payment_option&&n.push(`Chosen payment option: ${(e=>{if("P"===e)return"pay the full hardware price now";const t=/^SL(\d+)$/.exec(e)?.[1];return t?`${t} monthly installments`:`"${e}"`})(e.payment_option)}.`);const o=(e=>[e.bundle_id&&`bundleId=${e.bundle_id}`,e.plan_id&&`planId=${e.plan_id}`].filter(Boolean).join(", "))(e);return o&&n.push(`Clover cart ids: ${o}.`),n.join(" ")},We=e=>X(`localStorage ${e}`,()=>window.localStorage.getItem(e));let je=!1;const Be=()=>ee(`localStorage ${we}`,()=>window.localStorage.setItem(we,"1")),Ne=e=>{if(!(fe(e)&&(t=new URL(e).searchParams,t.has("bundleId")||t.has("products")&&t.has("planId"))))return!1;var t;const n=We(ve);return!("string"!=typeof n||!_e(X(ve,()=>JSON.parse(n)),null)||(ee(`localStorage ${ve}`,()=>window.localStorage.removeItem(ve)),0))},Ve=/^\/cart\/?$/,ze=/^\/purchase(\/|$)/,Ue=()=>{const e=(()=>{const e=We(ve);if(null===e&&(je||"1"===We(we)))return{cart:null,live_instructions:{cart:"The visitor's Clover cart is empty."}};if("string"!=typeof e)return;je||(je=!0,Be());const t=_e(X(ve,()=>JSON.parse(e)),(()=>{const e=Se(We(ge));return e?.startsWith('"')?Se(X(ge,()=>JSON.parse(e))):e})());return t?{cart:t,live_instructions:{cart:Re(t)}}:{cart:null,live_instructions:{cart:"The visitor's Clover cart is empty."}}})(),t=X("location.href",()=>(e=>{if(!fe(e))return;const{pathname:t}=new URL(e);return Ve.test(t)?"The visitor is on the cart (/cart). They are reading you in the chat, which covers the cart, so they cannot see its buttons now: never tell them to select Continue or another button on the page. To check out, they close this chat.":ze.test(t)?`The visitor is in the self-serve checkout (${t}), Clover's own account and payment application, not a contact form.`:`The visitor is on ${t}.`})(window.location.href));if(e||t)return{...e,live_instructions:{...e?.live_instructions,page:t}}},qe=e=>{let t;ie({label:"storage patch",marker:Ce,target:()=>Object.getPrototypeOf(window.localStorage),methods:["setItem","removeItem","clear"],event:be,emitIf:([e])=>void 0===e||ye.includes(e)});const n=()=>{window.clearTimeout(t),t=window.setTimeout(e,0)},o=e=>{(null===e.key||ye.includes(e.key))&&n()},i=()=>{je&&queueMicrotask(Be),n()};return window.addEventListener(be,i),window.addEventListener(y,o),()=>{window.removeEventListener(be,i),window.removeEventListener(y,o),window.clearTimeout(t)}},De="data-moveo-clover-continue",Qe=e=>{const t=window.location.href;return"cart"===((e,t)=>{const n=Y(e)?pe(t):null;return n?(e=>"/cart"===de(e.pathname))(n)?"cart":me(n.pathname,"/purchase")?"purchase":null:null})(e,t)?'[data-testid="continue-button"]':((e,t)=>{const n=Y(e)?pe(t):null;return!!n&&me(n.pathname,"/pricing")})(e,t)?'[data-testid$="-add-to-cart-button"]':null},Ke=()=>document.head.querySelector(`style[${De}]`),Ge=e=>ee("clover continue style",()=>{const t=Qe(e),n=Ke();if(!t)return void n?.remove();const o=(e=>`@media (max-width: 699px) {\n ${e} { width: calc(100% - 148px) !important; margin-inline: 74px !important; }\n}`)(t);if(n)return void(n.textContent!==o&&(n.textContent=o));const i=document.createElement("style");i.setAttribute(De,""),i.textContent=o,document.head.appendChild(i)}),Je=()=>window,Ye=()=>X("QuantumMetric scripts",()=>Array.from(document.querySelectorAll('script[src*="quantummetric"]')))??[],Ze=()=>Ye().length>0,Xe=()=>X("QuantumMetricAPI.isOn",()=>{const e=Je().QuantumMetricAPI;return"function"==typeof e?.isOn&&!0===e.isOn()})??!1,et=/\/qscripts\/quantum-([a-z0-9-]+)\.js/,tt=()=>{if(Xe())return X("QuantumMetric script src",()=>{for(const e of Ye()){const t=e.getAttribute("src")?.match(et)?.[1];if(t)return t}})},nt=[{name:"quantum-metric",isReady:()=>Xe(),isExpected:()=>Ze(),readIdentity:()=>({qm_subscription:tt()??null,qm_user_id:Xe()?X("QuantumMetricAPI.getUserID",()=>te(Je().QuantumMetricAPI?.getUserID?.())):Ze()?null:void 0}),whenReady:e=>{let t,n=e;const o=()=>ee("quantum-metric ready callback",()=>{n?.()}),i=()=>{n&&(t=o,ee("QuantumMetricAPI.addEventListener('start')",()=>{Je().QuantumMetricAPI?.addEventListener?.("start",o)}),ee("QuantumMetricAPI.addEventListener('stop')",()=>{Je().QuantumMetricAPI?.addEventListener?.("stop",o)}),o())};return X("QuantumMetricAPI",()=>Je().QuantumMetricAPI)?i():ee("QuantumMetricOnload",()=>{const e=Je().QuantumMetricOnload;if(Array.isArray(e))e.push(i);else{if("function"==typeof e){const t=e;return void(Je().QuantumMetricOnload=function(...e){return ee("QuantumMetricOnload (ours)",i),t.apply(this,e)})}Je().QuantumMetricOnload=[i]}}),()=>{n=null,t&&(ee("QuantumMetricAPI.removeEventListener('start')",()=>{Je().QuantumMetricAPI?.removeEventListener?.("start",t)}),ee("QuantumMetricAPI.removeEventListener('stop')",()=>{Je().QuantumMetricAPI?.removeEventListener?.("stop",t)}),t=void 0)}}}],ot=(e,t)=>X(`${e.name}.${t}`,()=>e[t]?.())??!1,it=e=>X(`input[name="${e}"]`,()=>{const t=document.querySelectorAll(`input[name="${CSS.escape(e)}"]`);for(const e of t){const t=te(e.value);if(t)return t}}),st="moveo_visitor_id",rt=34214400,at=(e,t,n)=>ee("document.cookie write",()=>{document.cookie=`${st}=${e}; path=/; max-age=${t}; SameSite=Lax; Secure${n?`; domain=${n}`:""}`}),lt=e=>X(`document.cookie ${e}`,()=>{const t=`${e}=`,n=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(t));return te(n?.slice(t.length))}),ct=e=>{const t=e.split(".");if(t.length<2||/^[\d.]+$|:/.test(e))return;const n=`moveo_domain_probe_${Math.random().toString(36).slice(2,10)}`;for(let e=t.length-2;e>=0;e-=1){const o=t.slice(e).join("."),i=`${n}=1; path=/; SameSite=Lax; Secure; domain=${o}`;if(ee("document.cookie probe",()=>{document.cookie=`${i}; max-age=10`}),"1"===lt(n))return ee("document.cookie probe",()=>{document.cookie=`${i}; max-age=0`}),o}},dt=new RegExp("^[A-Za-z0-9_-]{43}$"),ht=/^[0-9a-f-]{36}$/,ut=e=>dt.test(e)||ht.test(e),mt=e=>{const t=e?((e=window.location.hostname)=>{const t=ct(e),n=lt(st);if(n&&t){at("",0);const e=lt(st);if(e&&ut(e))return e}if(n&&ut(n))return t?(at(n,rt,t),lt(st)===n?n:void 0):n;const o=X("nanoid",()=>d(43));return o?(at(o,rt,t),lt(st)===o?o:void 0):void 0})():void 0;return t?{user:{web_psid:t}}:{}},pt=Array.from({length:21},(e,t)=>t/20),ft=(e,{onChange:t,onResolved:n},o=600,i=b)=>{const s=e.filter(e=>"string"==typeof e?.id&&!!e.id);if("undefined"==typeof IntersectionObserver)return n(s.map(e=>({id:e.id,matched:null,selectors:e.match?.length??0}))),{stop:()=>{}};const r=new Map,a=new Map,l=new Map;let c,d=null,h=!1,u=null,m=!1;const p=e=>{d=e,t(e)},f=new IntersectionObserver(e=>{e.forEach(e=>{const{width:t,height:n}=e.intersectionRect;a.set(e.target,e.isIntersecting?t*n:0)}),(()=>{let e=null,t=0,n=0;a.forEach((o,i)=>{const s=r.get(i)??null;s===d&&(n=Math.max(n,o)),o>t&&(e=s,t=o)}),(e=>{if(e!==d)return h?void(u?.id!==e&&(u&&clearTimeout(u.timer),u={id:e,timer:setTimeout(()=>{u=null,p(e)},o)})):(h=!0,void p(e));u&&(clearTimeout(u.timer),u=null)})(t<=0?null:null!==d&&n>=t?d:e)})()},{threshold:pt}),v=(e,t)=>{const o=e.filter(e=>{const t=(e=>{for(let t=0;t<e.length;t+=1){const n=e[t],o="string"==typeof n&&n.trim()?X("section selector",()=>document.querySelector(n)):null;if(o)return{element:o,index:t}}return null})(Array.isArray(e.match)?e.match:[]);if(!t)return!0;l.set(e.id,t.index);const n=(e=>{const t=X("section band",()=>e.closest("section, article, [data-moveo-section]"));if(!t||t===e)return e;const n=X("document height",()=>document.documentElement?.scrollHeight)??0,o=X("band height",()=>t.getBoundingClientRect().height)??0;return n>0&&o>.5*n?e:t})(t.element);return r.has(n)||(r.set(n,e.id),f.observe(n)),!1});o.length>0&&t<i.length?c=setTimeout(()=>{c=void 0,v(o,t+1)},i[t]):m||n(s.map(e=>({id:e.id,matched:l.get(e.id)??null,selectors:Array.isArray(e.match)?e.match.length:0})))};return v(s,0),{stop:()=>{m=!0,f.disconnect(),clearTimeout(c),u&&(clearTimeout(u.timer),u=null)}}},vt=c()("moveo:visible-band"),gt="CookiebotOnConsentReady",wt=e=>(window.addEventListener(gt,e),()=>window.removeEventListener(gt,e)),yt="OneTrustGroupsUpdated";var bt,Ct,xt,kt,Et;!function(e){e.Open="open",e.Resolved="closed",e.Expired="expired",e.Spam="spam",e.Trash="trash"}(bt||(bt={})),function(e){e.AnalyticsEvent="moveo-analytics-event",e.IframeLoaded="moveo-iframe-loaded",e.IframeError="moveo-iframe-error",e.WidgetLoaded="moveo-widget-loaded",e.WidgetError="moveo-widget-error",e.Opened="moveo-widget-opened",e.Closed="moveo-widget-closed",e.Resize="moveo-widget-resize",e.LocaleChanged="moveo-widget-locale-changed",e.SessionCreated="moveo-widget-session-created",e.SessionReconnected="moveo-widget-session-reconnected",e.SessionClosed="moveo-widget-session-closed",e.SessionExpired="moveo-widget-session-expired",e.ConversationClosed="moveo-widget-conversation-closed",e.LinkClicked="moveo-widget-link-clicked",e.Navigate="moveo-widget-navigate",e.UserActivity="moveo-widget-user-activity",e.VisitorAction="moveo-widget-visitor-action",e.MemberLeave="moveo-widget-member-leave",e.ConversationUnreadMessages="moveo-conversation-unread-messages",e.ConversationNoUnreadMessages="moveo-conversation-no-unread-messages",e.UserWayInit="moveo-userway-init",e.ChatBackground="moveo-widget-chat-background",e.FloatingWindowChoice="moveo-widget-floating-window-choice",e.WidgetFocused="moveo-widget-focused",e.Detached="moveo-widget-detached",e.Drag="moveo-widget-drag",e.Place="moveo-widget-place"}(Ct||(Ct={})),function(e){e.SetConfig="moveo-set-config",e.SetLocale="moveo-set-locale",e.SetCssVariables="moveo-set-css-variables",e.Open="moveo-open",e.Close="moveo-close",e.CloseConversation="moveo-close-conversation",e.SendMessage="moveo-send-message",e.ShowTeaserMessage="moveo-show-teaser-message",e.UpdateContext="moveo-update-context",e.UpdateHostContext="moveo-update-host-context",e.LoadSessionReplay="moveo-load-session-replay",e.HostScroll="moveo-host-scroll",e.HostLocation="moveo-host-location",e.HostVisibility="moveo-host-visibility",e.HostOpenerPolicy="moveo-host-opener-policy",e.HostSection="moveo-host-section",e.HostSectionsResolved="moveo-host-sections-resolved",e.WindowResize="moveo-resize",e.HostFrameBox="moveo-host-frame-box",e.HostPlacement="moveo-host-placement",e.SessionActivity="session-activity",e.UserWayDisabled="userway-disabled",e.UserWayEnabled="userway-enabled",e.LinkClicked="link-clicked",e.VisitorActionHandled="moveo-visitor-action-handled"}(xt||(xt={})),function(e){e.Expired="expired",e.Survey="survey",e.Closing="closing",e.Resolved="closed",e.Inactivity="inactivity",e.Continue="continue"}(kt||(kt={})),function(e){e.CloseButton="close-btn",e.EndSessionButton="end-btn",e.HeaderMenuButton="header-menu-btn",e.RestartButton="restart-btn",e.LauncherButton="launcher-btn",e.MessageInput="message-input",e.DisclaimerCheck="disclaimer-check",e.DisclaimerContainer="disclaimer-container",e.HeaderContainer="header-container",e.DragHandle="drag-handle",e.ImageButton="image-btn"}(Et||(Et={}));const St=/(?:^|[\s;(])(?:Agent\/([\w.-]+)|(Google-Agent)\b)/;Ct.AnalyticsEvent,Ct.LinkClicked,Ct.Navigate,Ct.UserActivity,Ct.VisitorAction,Ct.LocaleChanged;const It=e=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(16).padStart(8,"0")};Math.random().toString(36).slice(2);const Lt=()=>X("window.top",()=>window===window.top)??!0,Mt=["s2","s3","s4","s6","s7","s10","s12","s13","s14","s15","s16","s17","s19","s23"],At=e=>!e.x&&!e.y,Tt=(e,t,n)=>t>n?0:Math.min(Math.max(e,t),n),Ft={x:0,y:0},$t=({iframe:e,storageKey:t,onChange:n})=>{let o=(i=t,X("stored widget position",()=>{const e=JSON.parse(localStorage.getItem(i)??"null");return Number.isFinite(e?.x)&&Number.isFinite(e?.y)?{x:e.x,y:e.y}:void 0})??Ft);var i;let s=Ft,r=null;const a=()=>!e.classList.contains("full"),l=t=>{s=t,((e,t)=>{e.style.translate=At(t)?"":`${t.x}px ${t.y}px`})(e,t)},c=(t,n=e.getBoundingClientRect())=>{if(!n.width||!n.height)return null;const o=((e,t,n,o,i)=>({x:Tt(e.x,n.x-t.left,o-t.right+n.x),y:Tt(e.y,n.y-t.top,i-t.bottom+n.y)}))(t,n,s,document.documentElement.clientWidth||window.innerWidth,window.innerHeight);return l(o),o},d=e=>{o=e,ee("store widget position",()=>{At(e)?localStorage.removeItem(t):localStorage.setItem(t,JSON.stringify(e))}),n()};return l(o),{drag:(t,n,o)=>{if("end"===t)return void(r&&(r=null,d(s)));if(!a())return;const i=e.getBoundingClientRect(),l={x:i.left+n,y:i.top+o};"start"!==t&&r?c({x:r.from.x+l.x-r.pointer.x,y:r.from.y+l.y-r.pointer.y},i):r={pointer:l,from:s}},place:e=>{const t="offset"===e.target?(n=e,{x:Number(n?.x)||0,y:Number(n?.y)||0}):Ft;var n;l(t),d(t)},fit:()=>{r||!a()||At(o)||c(o)},offset:()=>o}},_t=["message_click"];class Pt{constructor({config:e}){var t;this.visible=!1,this.detectUserway=()=>{Mt.forEach(e=>{document.addEventListener(`userway:feature_enabled_${e}`,()=>{const t=localStorage.getItem(`userway-${e}`)??"";this.sendEventToIframe({type:xt.UserWayEnabled,data:{eventType:e,value:t}})}),document.addEventListener(`userway:feature_disabled_${e}`,()=>{this.sendEventToIframe({type:xt.UserWayDisabled,data:{eventType:e}})})})},this.initUserway=()=>{const e={...localStorage};Object.keys(e).forEach(t=>{const n=(e[t],e[t]);if(t.includes("userway-s")&&(!isNaN(parseInt(n))||"true"===n)){const e=t.split("-")[1];"0"===n?this.sendEventToIframe({type:xt.UserWayDisabled,data:{eventType:e}}):this.sendEventToIframe({type:xt.UserWayEnabled,data:{eventType:e,value:n}})}})},this.detectMobile=()=>{this.sendEventToIframe({type:xt.WindowResize,data:{is_mobile:C(),width:window.innerWidth,height:window.innerHeight}}),this.mover?.fit(),this.sendFrameBox()},this.updateLastActivity=()=>{try{this.sendEventToIframe({type:xt.SessionActivity,data:"active"})}catch(e){this.log("Failed to report page activity",e)}},this.visitorIdConsent=()=>{if(null!==this.visitorConsent)return this.visitorConsent;const e=(()=>{const e=window,t=X("OnetrustActiveGroups",()=>e.OnetrustActiveGroups);if("string"==typeof t){const n=t.split(",").filter(Boolean);return 0===n.length?"pending":n.includes((e=>X("OneTrust.GetDomainData",()=>e.OneTrust?.GetDomainData?.()?.Groups?.find(e=>((e,t)=>[...e.FirstPartyCookies??[],...(e.Hosts??[]).flatMap(e=>e.Cookies??[])].some(e=>e.Name===t))(e,st))?.OptanonGroupId)??"C0002")(e))?"granted":"refused"}return X("OneTrust script",()=>void 0!==e.OneTrust||null!==document.querySelector('script[src*="otSDKStub"], script[src*="otBannerSdk"]'))?"pending":void 0})()??X("Cookiebot",()=>{const e=window.Cookiebot?.consent;return e?null==e.method?"pending":e.statistics?"granted":"refused":document.querySelector('script[src*="consent.cookiebot.com"]')?"pending":void 0});return"refused"!==e&&(!("pending"===e||!this.visitorActed)||null)},this.markVisitorActed=()=>{this.visitorActed||(this.visitorActed=!0,this.sendHostContext(),this.sendEventToIframe({type:xt.VisitorActionHandled}))},this.trackVisitorContext=()=>{const e=()=>{try{if("visible"!==document.visibilityState)return;this.sentHostContext=null,this.sendHostContext()}catch(e){this.log("Failed to resend host context for a shown tab",e)}},t=[(n=this.sendHostContext,window.addEventListener(yt,n),()=>window.removeEventListener(yt,n)),wt(this.sendHostContext)];var n;return document.addEventListener("visibilitychange",e),()=>{t.forEach(e=>e()),document.removeEventListener("visibilitychange",e)}},this.sendHostContext=()=>{try{if(this.config.floating_session_id)return;if("hidden"===document.visibilityState)return;const e=this.visitorIdConsent();!1===e&&((e=window.location.hostname)=>{if(void 0===lt(st))return;at("",0);const t=ct(e);t&&at("",0,t)})();const t=this.clover?(e=>{const{path:t,...n}=(e=>{const t={};for(const n of e)for(const[e,o]of Object.entries(n))void 0!==o&&""!==o&&void 0===t[e]&&(t[e]=o);return t})([ne({qm_partner_id:it("partnerId"),qm_client_id:it("stdAppType"),qm_config_id:it("selectedConfig"),qm_page_template:(o="template",X(`meta[name="${o}"]`,()=>te(document.querySelector(`meta[name="${CSS.escape(o)}"]`)?.content))),path:X("location.pathname",()=>te(window.location.pathname))}),...nt.map(e=>X(`${e.name}.readIdentity`,()=>e.readIdentity?.())??{})]);var o;const i={...ne(n),...mt(e),...Ue()};return t?{...i,global:{client_path:t}}:i})(!0===e):mt(!0===e);if(0===Object.keys(t).length)return;const n=JSON.stringify(t);if(n===this.sentHostContext)return;this.sentHostContext=n,this.log("Host context:",t),this.updateHostContext(t)}catch(e){this.log("Failed to collect host context",e)}},this.sendSessionReplayHandoff=()=>{if(this.stopHostContext)try{const e=tt();if(!e)return void(this.sentReplaySubscription=null);if(e===this.sentReplaySubscription)return;this.sentReplaySubscription=e,this.log("Session replay handoff:",e),this.sendEventToIframe({type:xt.LoadSessionReplay,data:{vendor:"quantum-metric",subscription:e}})}catch(e){this.log("Failed to hand off the session replay subscription",e)}},this.trackHostContext=e=>{const t=(e=>{const t=[];nt.forEach(n=>{const o=X(`${n.name}.whenReady`,()=>n.whenReady?.(e));"function"==typeof o&&t.push(o)});const n=new Set(nt.filter(e=>ot(e,"isExpected")&&!ot(e,"isReady")));let o;if(n.size>0){let t=Math.ceil(20);o=window.setInterval(()=>{t-=1,n.forEach(t=>{ot(t,"isReady")&&(n.delete(t),e())}),(0===n.size||t<=0)&&window.clearInterval(o)},500)}return()=>{window.clearInterval(o),t.forEach(e=>ee("provider unsubscribe",e)),t.length=0}})(()=>{this.sendHostContext(),this.sendSessionReplayHandoff()}),n=ce(this.sendHostContext),o=e.watchCart(this.sendHostContext);this.stopHostContext=()=>{t(),n(),o()}},this.trackSections=()=>{this.sectionTracker?.stop(),this.sectionTracker=null,this.sectionReport=null,this.hostSection=null,this.sendHostSection();const e=((e,t)=>{const n=(e=>{try{return new URL(e??"").pathname.toLowerCase()}catch{return(e??"").toLowerCase()}})(t);let o,i=0;return e?.forEach(e=>{const t=e?.url?.trim().toLowerCase();!t||t.length<=i||!n.includes(t)||(o=e,i=t.length)}),o})(this.config.teaser?.pages,window.location.href);e?.sections?.length&&(this.sectionTracker=ft(e.sections,{onChange:e=>{this.hostSection=e,this.sendHostSection()},onResolved:t=>{this.sectionReport={page:{id:e.id??null,url:e.url},sections:t},this.sendSectionReport()}}))},this.sendHostLocation=()=>{const e=X("host location",()=>window.location.href);e&&this.sendEventToIframe({type:xt.HostLocation,data:{href:e}})},this.applyVisibility=()=>{const e=this.currentPageRule(),t=!this.hiddenByHost&&"hide"!==e&&(this.widgetOpen||this.sessionActive||"show"===e);this.iframe.style.display=t?"":"none",t!==this.visible&&(this.visible=t,this.sendHostVisibility()),this.syncMobilePage()},this.currentPageRule=()=>((e,t)=>{const n=de((he(t)?.pathname??"").toLowerCase()),o=e=>!!e?.some(e=>((e,t)=>{let n=0,o=0,i=-1,s=0;for(;o<t.length;)if("*"===e[n])i=n++,s=o;else if(e[n]===t[o])n++,o++;else{if(!(i>=0))return!1;n=i+1,o=++s}for(;"*"===e[n];)n++;return n===e.length})(de(e.trim().toLowerCase()),n));return o(e.hide_on_pages)?"hide":e.show_on_pages?.length&&!o(e.show_on_pages)?"miss":"show"})(this.config,window.location.href),this.offersFloatingWindow=()=>Boolean(this.config.floating_window)&&!this.isNested&&"embed"!==this.config.widget_position&&"documentPictureInPicture"in window,this.sendHostOpenerPolicy=()=>{if(!this.config.floating_window)return;this.hostOpenerPolicy??(this.hostOpenerPolicy=this.isNested?Promise.resolve(""):fetch(window.location.href,{method:"HEAD",cache:"force-cache",credentials:"same-origin"}).then(e=>e.ok?(e.headers.get("cross-origin-opener-policy")??"").split(";")[0].trim():"unknown").catch(()=>"unknown"));const e=this.offersFloatingWindow();this.hostOpenerPolicy.then(t=>{this.sendEventToIframe({type:xt.HostOpenerPolicy,data:{policy:t,floatingWindow:e}})})},this.sendHostPlacement=()=>{this.sendEventToIframe({type:xt.HostPlacement,data:{canMove:null!==this.mover,offset:this.mover?.offset()??{x:0,y:0}}})},this.sendHostVisibility=()=>{this.sendEventToIframe({type:xt.HostVisibility,data:{visible:this.visible}})},this.sendFrameBox=()=>{requestAnimationFrame(()=>{if(!this.iframe)return;const{width:e,height:t}=this.iframe.getBoundingClientRect();e&&t&&(this.frameHeight=t,this.placeInVisibleBand(),this.sendEventToIframe({type:xt.HostFrameBox,data:{width:e,height:t}}))})},this.placeInVisibleBand=()=>{const e=this.visibleBand;if(!this.iframe||!e||this.hostAlignedTop||"embed"===this.config.widget_position)return;if(this.iframe.classList.contains("full"))return void this.placeFullInBand(e);if(e.bottom>=window.innerHeight-1)return this.iframe.style.removeProperty("top"),this.iframe.style.removeProperty("bottom"),this.iframe.style.removeProperty("transition"),this.iframe.style.removeProperty("transform"),this.iframe.style.removeProperty("will-change"),void(this.placedTop=null);null==this.frameHeight&&(this.frameHeight=this.iframe.getBoundingClientRect().height);const t=Math.max(0,e.bottom-this.frameHeight);if(t!==this.placedTop){if(this.placedTop=t,e.exact)return this.iframe.style.top="0px",this.iframe.style.bottom="auto",this.iframe.style.willChange="transform",this.iframe.style.transition="none",void(this.iframe.style.transform=`translateY(${t}px)`);this.iframe.style.removeProperty("transform"),this.iframe.style.removeProperty("will-change"),this.iframe.style.transition="top 0.25s linear",this.iframe.style.top=`${t}px`,this.iframe.style.bottom="auto"}},this.placeFullInBand=e=>{e.top<=1&&e.bottom>=window.innerHeight-1?this.clearFullBandPin():(this.iframe.style.transition=e.exact?"":"top 0.25s linear, height 0.25s linear",this.iframe.style.setProperty("--moveo-full-top",`${e.top}px`),this.iframe.style.setProperty("--moveo-full-height",e.bottom-e.top+"px"))},this.holdMobilePage=()=>{if(this.pageOverflow)return;const{documentElement:e,body:t}=document;this.pageOverflow=[e.style.overflow,t.style.overflow],e.style.overflow="hidden",t.style.overflow="hidden",this.isNested||(this.keyboardCover=this.createKeyboardCover(),this.followKeyboard(),window.visualViewport?.addEventListener("resize",this.followKeyboard),window.visualViewport?.addEventListener("scroll",this.followKeyboard),window.addEventListener("scroll",this.followKeyboard,{passive:!0}))},this.syncMobilePage=()=>{this.mobilePanelOpen&&this.visible&&("embed"!==this.config.widget_position||this.fillsScreen)?this.holdMobilePage():this.releaseMobilePage()},this.releaseMobilePage=()=>{if(!this.pageOverflow)return;const{documentElement:e,body:t}=document,[n,o]=this.pageOverflow;"hidden"===e.style.overflow&&(e.style.overflow=n),"hidden"===t.style.overflow&&(t.style.overflow=o),this.pageOverflow=null,this.isNested||(window.visualViewport?.removeEventListener("resize",this.followKeyboard),window.visualViewport?.removeEventListener("scroll",this.followKeyboard),window.removeEventListener("scroll",this.followKeyboard),this.clearFullBandPin(),this.keyboardCover?.remove(),this.keyboardCover=null)},this.createKeyboardCover=()=>{const e=document.createElement("div");e.className="web-client-keyboard-cover",e.setAttribute("aria-hidden","true");const t=Number.parseInt(getComputedStyle(this.iframe).zIndex,10);return Number.isFinite(t)&&(e.style.zIndex=""+(t-1)),this.chatBackground&&(e.style.backgroundColor=this.chatBackground),e.addEventListener("touchmove",e=>e.preventDefault(),{passive:!1}),document.documentElement.append(e),e},this.followKeyboard=()=>{const e=window.visualViewport;e&&(this.iframe.style.setProperty("--moveo-full-top",`${e.offsetTop}px`),this.iframe.style.setProperty("--moveo-full-height",`${e.height}px`),this.keyboardCover&&(this.keyboardCover.hidden=e.scale>1||e.height>=window.innerHeight-1,this.keyboardCover.style.top=`${e.pageTop+e.height}px`))},this.clearFullBandPin=()=>{this.iframe.style.removeProperty("--moveo-full-top"),this.iframe.style.removeProperty("--moveo-full-height")},this.config=e,this.id=e.widgetId,this.isNested=!Lt(),this.fillsScreen="string"==typeof e.continue_code,this.initialized=!1,this.log=c()(`moveo:web-client:${this.id}`),this.iframe=this.createIframe(),this.stopHostContext=null,this.stopActivityTracking=null,this.scrollTracker=null,this.stopLocationTracking=null,this.widgetOpen=!1,this.sessionActive=!1,this.awaitingReplacement=!1,this.clover=(t=this.config.account_id,Y(t)?{watchPage:()=>{Ge(t);const e=ce(()=>Ge(t));return()=>{e(),ee("clover continue style",()=>Ke()?.remove())}},watchCart:qe,followCartLink:Ne}:null),this.sectionTracker=null,this.hostSection=null,this.sectionReport=null,this.appMounted=!1,this.sentHostContext=null,this.sentReplaySubscription=null,this.stopWindowListeners=null,this.widgetLoadedEvent=null,this.stopVisibleBand=null,this.visibleBand=null,this.hostAlignedTop=!1,this.frameHeight=null,this.placedTop=null,this.pageOverflow=null,this.mobilePanelOpen=!1,this.keyboardCover=null,this.chatBackground=null,this.hiddenByHost=!1,this.visitorConsent=null,this.visitorActed=!1,this.stopVisitorContext=null,this.floatingWindow=null,this.hostOpenerPolicy=null,this.mover=null}createIframe(){const e=document.createElement("iframe");return e.width="1px",e.height="1px",e.title="Moveo webchat",e.id=this.id,e.name=this.id,e.allow="geolocation; microphone; autoplay",e.style.border="0",e.classList.add("web-client-container"),"embed"===this.config.widget_position&&e.classList.add("embed"),this.fillsScreen&&e.classList.add("fills-screen"),e.setAttribute("src",x(this.id)),e}handleEvents(e,t){return n=>{const o=k(this.id,n);if(o)switch(this.floatingWindow?.observe(o,n.source===this.iframe.contentWindow),o.type){case Ct.IframeLoaded:{let e=this.config;"show"!==this.currentPageRule()&&(e={...this.config,auto_open:!1}),this.sendEventToIframe({type:xt.SetConfig,data:e}),this.clover&&!this.stopHostContext&&this.trackHostContext(this.clover),this.stopVisitorContext??(this.stopVisitorContext=this.trackVisitorContext()),this.sendHostContext(),this.sendHostVisibility(),this.sendSessionReplayHandoff();break}case Ct.SessionCreated:case Ct.SessionReconnected:this.sessionActive=!0,this.awaitingReplacement=!1,this.applyVisibility(),this.sendHostOpenerPolicy(),this.sentHostContext=null,this.sendHostContext();break;case Ct.SessionClosed:case Ct.SessionExpired:{const e=o.type===Ct.SessionClosed&&!0===o.data?.restarting;this.awaitingReplacement=e,e||(this.sessionActive=!1,this.applyVisibility());break}case Ct.IframeError:return this.stopInstrumentation(),this.stopWindowListeners?.(),this.stopWindowListeners=null,t(o.data);case Ct.UserWayInit:this.initUserway(),this.detectUserway();break;case Ct.WidgetLoaded:setTimeout(()=>{this.detectMobile(),e(this)},0),this.sentHostContext=null,this.sentReplaySubscription=null,this.sendHostContext(),this.sendHostVisibility(),this.sendSessionReplayHandoff(),this.sendHostLocation(),this.sendHostPlacement(),this.appMounted=!0,this.sectionTracker&&this.sendHostSection(),this.sendSectionReport(),this.widgetLoadedEvent={timestamp:(new Date).toISOString(),event:"widget_loaded",properties:{}};break;case Ct.WidgetError:this.notify(o);break;case Ct.Opened:o.data.skipInstanceCallback||(this.widgetOpen=!0===o.data.openedByUser||this.sessionActive,this.applyVisibility()),!0===o.data.openedByUser&&this.markVisitorActed(),(o.data.isFull||o.data.is_mobile||C())&&(this.iframe.classList.add("full"),this.placeInVisibleBand()),(o.data.is_mobile||C())&&(this.mobilePanelOpen=!0,this.syncMobilePage());break;case Ct.Closed:o.data.skipInstanceCallback||(this.widgetOpen=!1,this.awaitingReplacement&&(this.awaitingReplacement=!1,this.sessionActive=!1),this.applyVisibility()),this.mobilePanelOpen=!1,this.syncMobilePage(),(o.data.isFull||C())&&(this.iframe.classList.remove("full"),this.clearFullBandPin(),this.frameHeight=null,this.placeInVisibleBand());break;case Ct.Resize:{this.iframe.style.width=o.data.width,this.iframe.style.height=o.data.height,this.iframe.style.left=o.data.left,null!=o.data.top&&(this.iframe.style.top=o.data.top,this.iframe.style.bottom="auto",this.hostAlignedTop=!0),this.mover?.fit();const e=Number.parseFloat(o.data.height);Number.isFinite(e)&&e>0?(this.frameHeight=e,this.placeInVisibleBand()):this.frameHeight=null,this.sendFrameBox();break}case Ct.Navigate:if(n.source!==this.iframe.contentWindow)break;this.followWidgetLink(o.data?.url);break;case Ct.VisitorAction:this.markVisitorActed();break;case Ct.LocaleChanged:case Ct.WidgetFocused:case Ct.Detached:break;case Ct.Drag:if(n.source===this.iframe.contentWindow){const{phase:e,x:t,y:n}=o.data;this.mover?.drag(e,Number(t)||0,Number(n)||0)}break;case Ct.Place:n.source===this.iframe.contentWindow&&this.mover?.place(o.data);break;case Ct.ChatBackground:if(n.source!==this.iframe.contentWindow||"string"!=typeof o.data)break;this.chatBackground=o.data,this.keyboardCover&&(this.keyboardCover.style.backgroundColor=o.data);break;case Ct.AnalyticsEvent:_t.includes(o.data.event)&&this.markVisitorActed();break;default:this.log(`Unhandle event: ${o.type}`)}}}sendHostSection(){this.appMounted&&this.sendEventToIframe({type:xt.HostSection,data:{id:this.hostSection}})}sendSectionReport(){this.appMounted&&this.sectionReport&&(this.sendEventToIframe({type:xt.HostSectionsResolved,data:this.sectionReport}),this.sectionReport=null)}stopInstrumentation(){this.stopHostContext?.(),this.stopHostContext=null,this.stopVisitorContext?.(),this.stopVisitorContext=null,this.stopActivityTracking?.(),this.stopActivityTracking=null,this.scrollTracker?.stop(),this.scrollTracker=null,this.stopLocationTracking?.(),this.stopLocationTracking=null,this.sectionTracker?.stop(),this.sectionTracker=null,this.stopVisibleBand?.(),this.stopVisibleBand=null,this.visibleBand=null,this.floatingWindow?.stop(),this.floatingWindow=null,this.mobilePanelOpen=!1,this.releaseMobilePage()}resolveEmbedElement(){const e=this.config?.element||null;if("string"!=typeof e)return e;const t=document.getElementById(e);if(!t)throw new Error(`Element with id: ${e} not found`);return t}init(){return new Promise((e,t)=>{if(I(navigator.userAgent)&&!(e=>{const t=e.match(St);return t?t[1]??t[2]:null})(navigator.userAgent))throw new Error(`Widget ${this.id} was not initialized because user-agent is a bot`);if(this.initialized)throw new Error(`Widget ${this.id} was already initialized`);let n;n="embed"===this.config.widget_position?this.resolveEmbedElement():window.document.querySelector("body");const o=this.handleEvents(e,t),i=J(this.detectMobile,100);window.addEventListener("message",o),window.addEventListener("resize",i),this.stopWindowListeners=()=>{window.removeEventListener("message",o),window.removeEventListener("resize",i)},this.applyVisibility(),n?.appendChild(this.iframe),!0!==this.config.draggable||this.isNested||"embed"===this.config.widget_position||this.config.floating_window_mode||(this.mover=$t({iframe:this.iframe,storageKey:`moveo_${this.config.integrationId}_widget_position`,onChange:this.sendHostPlacement}));const s=(r=this.config.teaser?.pages,!!r?.some(e=>!!e?.sections?.length));var r;const a=this.clover?.watchPage(),l=ce(()=>{this.applyVisibility(),"hide"===this.currentPageRule()&&this.floatingWindow?.close(),this.sendHostLocation(),s&&this.trackSections()});var c;this.stopLocationTracking=()=>{l(),a?.()},s&&this.trackSections(),this.stopActivityTracking=(e=>{const t=[],n=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return L(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),J(e,t,{leading:o,maxWait:t,trailing:i})}(e,3e3),o=(e,o)=>{window.addEventListener(e,n,o),t.push(()=>window.removeEventListener(e,n,o))},i={passive:!0};return o("load",i),o("mousemove",i),o("mousedown",i),o("touchstart",i),o("touchmove",i),o("click",i),o("keydown",i),o("scroll",{capture:!0,passive:!0}),()=>{t.forEach(e=>e()),t.length=0,n.cancel()}})(this.updateLastActivity),this.offersFloatingWindow()&&(this.floatingWindow=(({config:e,canFloat:t,onNavigate:n,onVisitorAction:o,onLocaleChange:i,log:s})=>{const r=window.documentPictureInPicture;let a=null,l=!1,c=!1,d=!1,h=null,u={};const m=()=>l&&!c&&!d&&t()?a:null,p=`${e.widgetId}-floating`,f=`moveo_${e.integrationId}_floating_window`,v=()=>{const e=X("localStorage",()=>localStorage.getItem(f));if("allow"===e)return"allow";const t=Number(e?.split(":")[1]);return Date.now()-t<2592e6?"deny":null},g=e=>ee("localStorage",()=>{e?localStorage.setItem(f,"deny"===e?`deny:${Date.now()}`:e):localStorage.removeItem(f)}),w=new BroadcastChannel(f);let y=null,b=!1;const C=()=>{b=Boolean(y),y?.window.close()},E=()=>{if("visible"!==document.visibilityState)return;const e=m();e&&w.postMessage({visible:It(e)}),C()},S=(t,s,r)=>{const{document:a}=t;a.documentElement.style.height="100%",a.body.style.cssText="margin:0;height:100%;overflow:hidden;display:flex;justify-content:center;background:#f4f4f5";const l=a.createElement("iframe");l.title="Moveo webchat",l.allow="geolocation; autoplay",l.style.cssText="display:block;width:min(560px,100%);height:100%;border:0;background:#fff;box-shadow:0 2px 12px rgb(0 0 0 / 12%)",l.src=x(p);const c=new URL(l.src).origin,d=(e,t)=>l.contentWindow?.postMessage({type:`${p}${e}`,data:t},c);return t.addEventListener("message",a=>{if(a.source!==l.contentWindow)return;const c=k(p,a);if(c?.type===Ct.IframeLoaded)d(xt.SetConfig,{...e,...h&&{language:h},clientUrl:window.location.href,element:void 0,widgetId:p,widget_position:"embed",floating_window_mode:"allow"===s?"chat":"prompt",floating_session_id:r});else if(c?.type===Ct.WidgetLoaded)h&&d(xt.SetLocale,h),Object.keys(u).length&&d(xt.SetCssVariables,u);else if(c?.type===Ct.AnalyticsEvent||c?.type===Ct.LinkClicked||c?.type===Ct.UserActivity)window.postMessage({type:`${e.widgetId}${c.type}`,data:"data"in c?c.data:void 0},window.location.origin);else if(c?.type===Ct.VisitorAction)o(),d(xt.VisitorActionHandled);else if(c?.type===Ct.LocaleChanged)"string"==typeof c.data&&(h=c.data,i(c.data));else if(c?.type===Ct.Navigate)"string"==typeof c.data?.url&&n(c.data.url);else if(c?.type===Ct.FloatingWindowChoice){const e=!0===c.data.allow;g(e?"allow":"deny"),e?t.resizeBy(360-t.innerWidth,682-t.innerHeight):C()}}),t.addEventListener("pagehide",()=>{y=null,b||"allow"!==v()||g(null),b=!1}),a.body.append(l),d};let I=!1,L=!1;const M=J(()=>{if("visible"===document.visibilityState)return void(document.hasFocus()&&E());const e=v(),t=m();"deny"===e||y||I||r.window||!t||(I=!0,r.requestWindow({width:360,height:"allow"===e?682:300}).then(n=>{L||m()!==t?n.close():(y={window:n,sessionId:t,send:S(n,e,t)},M())}).catch(e=>s("The floating window did not open",e)).finally(()=>{I=!1}))},300);return document.addEventListener("visibilitychange",M),window.addEventListener("focus",E),w.addEventListener("message",e=>{y&&e.data?.visible===It(y.sessionId)&&C()}),{stop:()=>{L=!0,document.removeEventListener("visibilitychange",M),window.removeEventListener("focus",E),M.cancel(),w.close(),C()},observe:(e,t)=>{switch(e.type){case Ct.SessionCreated:case Ct.SessionReconnected:a=e.data?.session_id??null;break;case Ct.Opened:case Ct.Closed:e.data.skipInstanceCallback||(l=e.type===Ct.Opened,l||C());break;case Ct.LocaleChanged:h=e.data;break;case Ct.WidgetFocused:t&&E();break;case Ct.Detached:t&&(c=!0===e.data.detached,d=!0===e.data.inCall)}},setLocale:e=>{h=e,y?.send(xt.SetLocale,e)},setCssVariables:e=>{u={...u,...e},y?.send(xt.SetCssVariables,e)},close:C}})({config:this.config,canFloat:()=>this.sessionActive&&!this.awaitingReplacement&&!this.hiddenByHost&&"hide"!==this.currentPageRule(),onNavigate:e=>this.followWidgetLink(e),onVisitorAction:()=>this.markVisitorActed(),onLocaleChange:e=>{this.sendEventToIframe({type:xt.SetLocale,data:e})},log:this.log})),this.config.teaser&&(this.scrollTracker=(e=>{let t,n=!1;const o=()=>{n=!1,e(!1)},i=()=>{n||(n=!0,e(!0)),clearTimeout(t),t=setTimeout(o,1e3)},s={capture:!0,passive:!0};return window.addEventListener("scroll",i,s),{pulse:i,stop:()=>{window.removeEventListener("scroll",i,s),clearTimeout(t)}}})(e=>this.sendEventToIframe({type:xt.HostScroll,data:{scrolling:e}}))),this.isNested&&"embed"!==this.config.widget_position&&(this.stopVisibleBand=(c=e=>{const t=null!=e&&(this.visibleBand?.top!==e.top||this.visibleBand?.bottom!==e.bottom);this.visibleBand=e,this.placeInVisibleBand(),t&&this.scrollTracker?.pulse()},X("visible band",()=>(e=>{const t=(()=>{const e=[];try{let t=window;for(;t!==t.parent;){if(!t.frameElement)return null;t=t.parent,t.innerHeight,e.push(t)}}catch{return null}return e})();if(!t||0===t.length)return null;const n=()=>{let e=0,t=window.innerHeight,n=0,o=window;for(;o!==o.parent;){const i=o.frameElement;if(!i)return null;n+=i.getBoundingClientRect().top+i.clientTop,o=o.parent,e=Math.max(e,-n),t=Math.min(t,o.innerHeight-n)}return t>e?{top:e,bottom:t,exact:!0}:null};let o=null;const i=()=>{const t=X("ancestor geometry",n)??null;!t||o&&o.top===t.top&&o.bottom===t.bottom||(o=t,e(t))},s={capture:!0,passive:!0};for(const e of t)e.addEventListener("scroll",i,s),e.addEventListener("resize",i);return window.addEventListener("resize",i),i(),()=>{window.removeEventListener("resize",i);for(const e of t)try{e.removeEventListener("scroll",i,s),e.removeEventListener("resize",i)}catch{}}})(c))||(X("visible band ladder",()=>(e=>{const t=document.createElement("div");t.style.cssText="position:absolute;top:0;left:0;width:0;height:0;pointer-events:none";const n=document.createElement("div");n.dataset.bandProbe="";const o=()=>{const e=t.parentNode;e?.removeChild(t);const n=X("document height",()=>Math.max(document.documentElement.scrollHeight,window.innerHeight));return e?.appendChild(t),n&&n>0?n:null},i=new Set;let s=null,r=0,a=600,l=!1;const c=new IntersectionObserver(t=>{for(const e of t){const t=Number(e.target.dataset.y);e.isIntersecting?i.add(t):i.delete(t);const n=e.rootBounds?.height;n&&(a=n)}C(),(()=>{if(l)return;if(0===i.size)return;const t=X("scrollY",()=>window.scrollY)??0;let n=1/0,o=-1/0;for(const e of i)e<n&&(n=e),e>o&&(o=e);n=Math.max(0,n-t),o-=t,o<=n||s&&s.top===n&&s.bottom===o||(s={top:n,bottom:o,exact:!1},e(s))})()},{root:null,threshold:0});let d=null,h=null,u=0,m=null;const p=new IntersectionObserver(t=>{const n=(e=>{const t=e.intersectionRect,n=e.boundingClientRect;if(!e.isIntersecting||!t||!n)return null;const o=X("scrollY",()=>window.scrollY)??0,i=t.top-n.top-o,s=t.bottom-n.top-o;if(!Number.isFinite(i)||!Number.isFinite(s)||s<=i)return null;const r=performance.now(),a=Number.isFinite(e.time)&&r-e.time>-5&&r-e.time<200?e.time:r;return{top:Math.max(0,i),bottom:s,at:a}})(t[t.length-1]);if(!n)return;l||(l=!0,vt("browser clips the probe; exact bands from here on"));const o=h?.top===n.top&&h.bottom===n.bottom;return o&&null!==g?void 0:null!==g?(d=n,void(v=performance.now()+500)):void(o&&s?.exact&&s.top===n.top&&s.bottom===n.bottom||(h={t:n.at,top:n.top,bottom:n.bottom},u=0,m=n.bottom,s={top:n.top,bottom:n.bottom,exact:!0},e(s),C()))},{root:null,threshold:0}),f=()=>{p.unobserve(n),p.observe(n)};let v=0,g=null,w=0,y=0;const b=()=>{g=null,ee("visible band pump",()=>{const t=performance.now(),n=y?Math.min(50,t-y):16;if(y=t,null!==m&&(m+=u*n),d){w=0;const e=d;d=null,(e=>{const t=h;h={t:e.at,top:e.top,bottom:e.bottom};const n=t?e.at-t.t:0;if(!t||null===m||n<4||n>120)return m=e.bottom,void(u=0);let o=(e.bottom-t.bottom)/n;o=Math.max(u-.3*n,Math.min(u+.3*n,o)),u=0!==u&&Math.sign(o)!==Math.sign(u)||0===u?o:u+.4*(o-u),m+=.35*(e.bottom-m)})(e)}else if(w||(w=t),t-w>24/Math.max(.1,Math.abs(u))&&(u*=Math.exp(-n/50),Math.abs(u)<.02&&(u=0),0===u&&h&&null!==m&&(m+=(h.bottom-m)*(1-Math.exp(-n/40)),Math.abs(m-h.bottom)<.75&&(m=h.bottom))),h&&null!==m&&0!==u){const e=h.bottom+32*Math.sign(u);m=u>0?Math.min(m,e):Math.max(m,e)}if(null!==m&&h){const t=Math.max(-160,Math.min(160,8*u)),o=h.bottom-h.top;let i=m+t;if(s?.exact){const e=Math.abs(u)*n*1.75+6;i=Math.max(s.bottom-e,Math.min(s.bottom+e,i))}const r=(e=>{const t=Math.max(0,e.top+0);let n=e.bottom+0;const o=window.innerHeight-2;return e.bottom<=o&&n>o&&(n=o),n<=t?null:{top:t,bottom:n,exact:!0}})({top:Math.max(0,i-o),bottom:i});r&&((t,n)=>{s?.exact&&s.top===t&&s.bottom===n||(s={top:t,bottom:n,exact:!0},e(s))})(r.top,r.bottom)}t>=v||(f(),g=requestAnimationFrame(b))})},C=()=>{v=performance.now()+500,null===g&&"function"==typeof requestAnimationFrame&&(w=0,y=0,f(),g=requestAnimationFrame(b))},x=e=>{r=e;const o=((e,t)=>{const n=Math.max(16,Math.ceil(e/200)),o=Math.max(16,Math.floor(.5*t));return Math.max(Math.min(n,o),Math.ceil(e/2e3))})(r,a);t.replaceChildren(),i.clear(),n.style.cssText=`position:absolute;top:0;left:0;width:1px;height:${r}px;pointer-events:none`,t.appendChild(n);const s=e=>{const n=document.createElement("div");n.dataset.y=String(e),n.style.cssText=`position:absolute;top:${e}px;left:0;width:1px;height:1px`,t.appendChild(n)};let l=0;for(;l<r-1;l+=o)s(l);s(Math.max(0,r-1)),c.disconnect();for(const e of t.children)e!==n&&c.observe(e);p.disconnect(),p.observe(n)};let k=!1;const E=()=>{ee("visible band rebuild",()=>{const e=k?o():null;null!==e&&e!==r&&x(e)})},S=()=>{ee("visible band attach",()=>{(document.body??document.documentElement).appendChild(t),k=!0;const e=o();null!==e&&x(e)})};return document.body?S():document.addEventListener("DOMContentLoaded",S,{once:!0}),window.addEventListener("resize",E),()=>{null!==g&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(g),g=null,v=0,d=null,h=null,u=0,m=null,y=0,window.removeEventListener("resize",E),document.removeEventListener("DOMContentLoaded",S),c.disconnect(),p.disconnect(),t.remove(),i.clear(),s=null}})(c))??(()=>{})))),this.initialized=!0,this.detectMobile()})}sendEventToIframe(e){this.iframe&&this.iframe.contentWindow?(this.log(`Event to iframe: ${e.type}`,e),e.type===xt.SetConfig&&e.data?.element&&delete e.data.element,this.iframe.contentWindow.postMessage({...e,type:`${this.id}${e.type}`},"*")):this.log("Error: Cannot find iframe to send event")}notify(e){this.log(`notify ${e.type}:`,e)}notifyParent(e,t){window.addEventListener("message",n=>{const o=k(this.id,n);if(o&&(this.log(`Event from iframe: ${o.type}`,o),o.type===e)){if("data"in o&&"object"==typeof o.data&&null!==o.data&&"skipInstanceCallback"in o.data)return;t("data"in o?o.data:void 0)}})}openWindow(){this.sendEventToIframe({type:xt.Open})}async destroy(){var e;this.closeConversation({hide:!0}),this.stopInstrumentation(),await(e=4e3,new Promise(t=>setTimeout(t,e)));const t=document.getElementById(this.id);t&&(t.remove(),this.initialized=!1),this.stopWindowListeners?.(),this.stopWindowListeners=null,this.sentHostContext=null,this.sentReplaySubscription=null,this.visible=!1,this.widgetLoadedEvent=null,this.appMounted=!1,this.widgetOpen=!1,this.sessionActive=!1,this.awaitingReplacement=!1,this.hiddenByHost=!1,this.hostSection=null,this.sectionReport=null}setVisitorConsent(e){this.visitorConsent=e,this.sendHostContext()}closeConversation({hide:e}){this.sendEventToIframe({type:xt.CloseConversation,data:{hide:e}}),!1!==e&&(this.hiddenByHost=!0,this.applyVisibility(),this.floatingWindow?.close())}closeWindow(){this.sendEventToIframe({type:xt.Close})}sendMessage(e){this.sendEventToIframe({type:xt.SendMessage,data:e})}showTeaserMessage(e){this.sendEventToIframe({type:xt.ShowTeaserMessage,data:e?{text:e}:void 0})}updateContext(e){this.sendEventToIframe({type:xt.UpdateContext,data:e})}updateHostContext(e){this.sendEventToIframe({type:xt.UpdateHostContext,data:e})}setCSSVariables(e){const t=e["--moveo-z-index"];void 0!==t&&this.iframe&&(t?this.iframe.style.setProperty("--moveo-z-index",t):this.iframe.style.removeProperty("--moveo-z-index")),this.sendEventToIframe({type:xt.SetCssVariables,data:e}),this.floatingWindow?.setCssVariables(e)}setLocale(e){this.sendEventToIframe({type:xt.SetLocale,data:e}),this.floatingWindow?.setLocale(e)}onSessionCreated(e){this.notifyParent(Ct.SessionCreated,e)}onSessionClosed(e){this.notifyParent(Ct.SessionClosed,e)}onConversationClosed(e){this.notifyParent(Ct.ConversationClosed,e)}onSessionReconnected(e){this.notifyParent(Ct.SessionReconnected,e)}onNoUnreadMessages(e){this.notifyParent(Ct.ConversationNoUnreadMessages,e)}onUnreadMessages(e){this.notifyParent(Ct.ConversationUnreadMessages,e)}followWidgetLink(e){"string"==typeof e&&(e=>{try{const{protocol:t}=new URL(e);return"http:"===t||"https:"===t}catch{return!1}})(e)&&Lt()&&((e,t)=>{try{return new URL(e).hostname===new URL(t).hostname}catch{return!1}})(e,window.location.href)&&(this.clover?.followCartLink(e)?this.navigateHost(e):this.followSameDomainLink(e))}followSameDomainLink(e){let t=!1;const n=new MutationObserver(()=>{t=!0,n.disconnect()});n.observe(document.body,{childList:!0,subtree:!0}),window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate",{state:{}})),window.setTimeout(()=>{n.disconnect(),t||this.navigateHost(e)},1e3)}navigateHost(e){window.location.assign(e)}onLinkClicked(e){this.notifyParent(Ct.LinkClicked,e)}onUserActivity(e){this.notifyParent(Ct.UserActivity,e)}onAnalyticsEvent(e){this.notifyParent(Ct.AnalyticsEvent,e),this.widgetLoadedEvent&&e(this.widgetLoadedEvent)}onWebchatOpened(e){this.notifyParent(Ct.Opened,e)}onWebchatClosed(e){this.notifyParent(Ct.Closed,e)}onMemberLeave(e){this.notifyParent(Ct.MemberLeave,e)}}e(),r(),t(),s(),i(),a();var Ot=n(178),Ht={};Ht.styleTagTransform=function e(){return e.c||(e.c=n.n(a()))}()(),Ht.setAttributes=function e(){return e.c||(e.c=n.n(s()))}()(),Ht.insert=function e(){return e.c||(e.c=n.n(t()))}()().bind(null,"head"),Ht.domAPI=function e(){return e.c||(e.c=n.n(r()))}()(),Ht.insertStyleElement=function e(){return e.c||(e.c=n.n(i()))}()(),function t(){return t.c||(t.c=n.n(e()))}()()(Ot.A,Ht),Ot.A&&Ot.A.locals&&Ot.A.locals;let Rt=c()("moveo:web-client");const Wt=async e=>{await new Promise(e=>{if("complete"===document.readyState)return e();window.addEventListener("load",()=>e())});const t=await(async e=>{const t=`moveo-${d(5)}`,n="string"==typeof e?.floating_client_url&&e.floating_client_url||window.location.href;if(Rt=Rt.extend(`:${t}`),!e?.integrationId)throw new Error("integrationId is required.\n Call MoveoAI.init({ integrationId: YOUR_INTEGRATION_HERE })");const o=await(async(e,t)=>{const n=t||f,o=await fetch(`${n}/v1/web/${e}`,{headers:{"Cache-Control":"no-cache"}}),i=await o.text();if(o.ok)return JSON.parse(i);throw new Error(`Error loading config from: ${n}/${e}`)})(e.integrationId,e.host);Rt("Loaded integration configuration:",o);const{feature_flags:i,account_id:s,...r}=e;void 0!==i&&Rt("feature_flags is server-owned; the caller value is ignored"),void 0!==s&&Rt("account_id is server-owned; the caller value is ignored");const{teaser:a,...l}=r;return{...m({...o},l),...void 0!==a&&{teaser:a},clientUrl:n,widgetId:t}})(e);if(Rt("Configuration:",t),"embed"===t.widget_position&&!t.element)throw new Error("element is not defined but required by embed widget");const n=new Pt({config:t});Rt("Initializing");const o=await n.init();return Rt("Initialized"),o}})(),o})());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moveo-ai/web-client",
|
|
3
|
-
"version": "0.127.0-true.
|
|
3
|
+
"version": "0.127.0-true.40",
|
|
4
4
|
"description": "Client side library to load the moveo chat widget and connect it with your agent",
|
|
5
5
|
"main": "dist/web-client.min.js",
|
|
6
6
|
"types": "web-client.d.ts",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"visual-diff": "node scripts/visual-diff.mjs",
|
|
31
31
|
"walkthrough": "node scripts/walkthrough.mjs",
|
|
32
32
|
"dev:disconnect-close": "node scripts/dev-disconnect-close.mjs",
|
|
33
|
-
"clover:staging": "node scripts/
|
|
34
|
-
"clover:personas": "node scripts/
|
|
35
|
-
"clover:report": "node scripts/
|
|
36
|
-
"clover:catalog": "node scripts/
|
|
33
|
+
"clover:staging": "node scripts/clover/e2e/clover-staging.mjs",
|
|
34
|
+
"clover:personas": "node scripts/clover/e2e/clover-personas.mjs",
|
|
35
|
+
"clover:report": "node scripts/clover/e2e/clover-report.mjs",
|
|
36
|
+
"clover:catalog": "node scripts/clover/clover-catalog.mjs",
|
|
37
37
|
"watch": "webpack --watch"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|