@moveo-ai/web-client 0.29.2 → 0.30.0-true.1
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/iframe.min.js +1 -1
- package/dist/iframe.min.js.LICENSE.txt +1 -1
- package/dist/iframe.min.js.map +1 -1
- package/dist/index.html +3 -1
- package/dist/preview.css.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/web-client.min.js.map +1 -1
- package/package.json +49 -40
package/dist/index.html
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
}
|
|
6
6
|
*{
|
|
7
7
|
outline:0;
|
|
8
|
-
}</style><
|
|
8
|
+
}</style><script>if (window.parent !== window) {
|
|
9
|
+
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
10
|
+
}</script><title>Widget</title></head><body><script src="iframe.min.js?f960835f22ec5d51fea7"></script><script>const queryString = window.location.search;
|
|
9
11
|
const urlParams = new URLSearchParams(queryString);
|
|
10
12
|
const widgetId = urlParams.get('widgetId');
|
|
11
13
|
|
package/dist/web-client.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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([],t):"object"==typeof exports?exports.MoveoAI=t():e.MoveoAI=t()}(self,(function(){return function(){var e={2817:function(e,t,n){"use strict";var r=n(1864),o=n.n(r),i=n(352),a=n.n(i)()(o());a.push([e.id,".web-client-container{position:fixed;bottom:0;right:0;cursor:pointer;z-index:10000;max-height:99vh}.web-client-container.embed{position:static;width:100% !important;height:100% !important}.web-client-container.full{width:100% !important;height:100% !important;bottom:0 !important;right:0 !important;left:0 !important;top:0 !important;max-height:initial}","",{version:3,sources:["webpack://./src/styles/web-client.scss"],names:[],mappings:"AAIA,sBAIE,cAAA,CACA,QAAA,CACA,OAAA,CACA,cAAA,CACA,aAPiB,CAQjB,eAPoB,CASpB,4BACE,eAAA,CACA,qBAAA,CACA,sBAAA,CAIF,2BACE,qBAAA,CACA,sBAAA,CACA,mBAAA,CACA,kBAAA,CACA,iBAAA,CACA,gBAAA,CACA,kBAAA",sourcesContent:["// This style is applied to the iframe that customers load.\n// Ideally we use style variables rather than this so that\n// we can use the widget-id.\n\n.web-client-container {\n $widget-z-index: 10000;\n $widget-max-height: 99vh;\n\n position: fixed;\n bottom: 0;\n right: 0;\n cursor: pointer;\n z-index: $widget-z-index;\n max-height: $widget-max-height;\n\n &.embed {\n position: static;\n width: 100% !important;\n height: 100% !important;\n }\n\n // ! Important because this happens on the clients website\n &.full {\n width: 100% !important;\n height: 100% !important;\n bottom: 0 !important;\n right: 0 !important;\n left: 0 !important;\n top: 0 !important;\n max-height: initial;\n }\n}\n"],sourceRoot:""}]),t.Z=a},352:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);r&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),t.push(l))}},t}},1864:function(e){"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */"),a=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[t].concat(a).concat([i]).join("\n")}return[t].join("\n")}},8193:function(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 r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,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")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$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(4006)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},4006:function(e,t,n){e.exports=function(e){function t(e){let n,o,i,a=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];n=i.call(r,t),e.splice(a,1),a--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}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.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(4264),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}},8492:function(e,t,n){var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),d=Object.prototype.toString,f=Math.max,p=Math.min,h=function(){return l.Date.now()};function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=i.test(e);return n||a.test(e)?s(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,s,c,u=0,l=!1,d=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,u=t,a=e.apply(i,n)}function b(e){return u=e,s=setTimeout(C,t),l?y(e):a}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-u>=i}function C(){var e=h();if(w(e))return A(e);s=setTimeout(C,function(e){var n=t-(e-c);return d?p(n,i-(e-u)):n}(e))}function A(e){return s=void 0,g&&r?y(e):(r=o=void 0,a)}function _(){var e=h(),n=w(e);if(r=arguments,o=this,c=e,n){if(void 0===s)return b(c);if(d)return s=setTimeout(C,t),y(c)}return void 0===s&&(s=setTimeout(C,t)),a}return t=m(t)||0,v(n)&&(l=!!n.leading,i=(d="maxWait"in n)?f(m(n.maxWait)||0,t):i,g="trailing"in n?!!n.trailing:g),_.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=c=o=s=void 0},_.flush=function(){return void 0===s?a:A(h())},_}},732:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Function]",s="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[a]=l["[object Map]"]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var d="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,p=d||f||Function("return this")(),h=t&&!t.nodeType&&t,v=h&&e&&!e.nodeType&&e,m=v&&v.exports===h,g=m&&d.process,y=function(){try{return v&&v.require&&v.require("util").types||g&&g.binding&&g.binding("util")}catch(e){}}(),b=y&&y.isTypedArray;function w(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var C,A,_,j=Array.prototype,F=Function.prototype,x=Object.prototype,E=p["__core-js_shared__"],I=F.toString,O=x.hasOwnProperty,S=(C=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+C:"",z=x.toString,T=I.call(Object),M=RegExp("^"+I.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=m?p.Buffer:void 0,k=p.Symbol,L=p.Uint8Array,B=($&&$.allocUnsafe,A=Object.getPrototypeOf,_=Object,function(e){return A(_(e))}),R=Object.create,U=x.propertyIsEnumerable,W=j.splice,N=k?k.toStringTag:void 0,P=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),q=$?$.isBuffer:void 0,D=Math.max,Z=Date.now,J=ce(p,"Map"),H=ce(Object,"create"),V=function(){function e(){}return function(t){if(!we(t))return{};if(R)return R(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function K(e){var t=this.__data__=new Q(e);this.size=t.size}function X(e,t,n){(void 0!==n&&!pe(e[t],n)||void 0===n&&!(t in e))&&ne(e,t,n)}function ee(e,t,n){var r=e[t];O.call(e,t)&&pe(r,n)&&(void 0!==n||t in e)||ne(e,t,n)}function te(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1}function ne(e,t,n){"__proto__"==t&&P?P(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}G.prototype.clear=function(){this.__data__=H?H(null):{},this.size=0},G.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},G.prototype.get=function(e){var t=this.__data__;if(H){var n=t[e];return n===r?void 0:n}return O.call(t,e)?t[e]:void 0},G.prototype.has=function(e){var t=this.__data__;return H?void 0!==t[e]:O.call(t,e)},G.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=H&&void 0===t?r:t,this},Q.prototype.clear=function(){this.__data__=[],this.size=0},Q.prototype.delete=function(e){var t=this.__data__,n=te(t,e);return!(n<0||(n==t.length-1?t.pop():W.call(t,n,1),--this.size,0))},Q.prototype.get=function(e){var t=this.__data__,n=te(t,e);return n<0?void 0:t[n][1]},Q.prototype.has=function(e){return te(this.__data__,e)>-1},Q.prototype.set=function(e,t){var n=this.__data__,r=te(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Y.prototype.clear=function(){this.size=0,this.__data__={hash:new G,map:new(J||Q),string:new G}},Y.prototype.delete=function(e){var t=se(this,e).delete(e);return this.size-=t?1:0,t},Y.prototype.get=function(e){return se(this,e).get(e)},Y.prototype.has=function(e){return se(this,e).has(e)},Y.prototype.set=function(e,t){var n=se(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},K.prototype.clear=function(){this.__data__=new Q,this.size=0},K.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},K.prototype.get=function(e){return this.__data__.get(e)},K.prototype.has=function(e){return this.__data__.has(e)},K.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Q){var r=n.__data__;if(!J||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Y(r)}return n.set(e,t),this.size=n.size,this};function re(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":N&&N in Object(e)?function(e){var t=O.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch(e){}var o=z.call(e);return r&&(t?e[N]=n:delete e[N]),o}(e):function(e){return z.call(e)}(e)}function oe(e){return Ce(e)&&re(e)==i}function ie(e,t,n,r,o){e!==t&&function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[++r];if(!1===t(o[s],s,o))break}}(t,(function(i,a){if(o||(o=new K),we(i))!function(e,t,n,r,o,i,a){var c=de(e,n),u=de(t,n),l=a.get(u);if(l)X(e,n,l);else{var d,f,p,h,v,m=i?i(c,u,n+"",e,t,a):void 0,g=void 0===m;if(g){var y=ve(u),b=!y&&ge(u),w=!y&&!b&&Ae(u);m=u,y||b||w?ve(c)?m=c:Ce(v=c)&&me(v)?m=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(c):b?(g=!1,m=function(e,t){return e.slice()}(u)):w?(g=!1,h=new(p=(d=u).buffer).constructor(p.byteLength),new L(h).set(new L(p)),f=h,m=new d.constructor(f,d.byteOffset,d.length)):m=[]:function(e){if(!Ce(e)||re(e)!=s)return!1;var t=B(e);if(null===t)return!0;var n=O.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&I.call(n)==T}(u)||he(u)?(m=c,he(c)?m=function(e){return function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=void 0;void 0===c&&(c=e[s]),o?ne(n,s,c):ee(n,s,c)}return n}(e,_e(e))}(c):we(c)&&!ye(c)||(m=function(e){return"function"!=typeof e.constructor||le(e)?{}:V(B(e))}(u))):g=!1}g&&(a.set(u,m),o(m,u,r,i,a),a.delete(u)),X(e,n,m)}}(e,t,a,n,ie,r,o);else{var c=r?r(de(e,a),i,a+"",e,t,o):void 0;void 0===c&&(c=i),X(e,a,c)}}),_e)}var ae=P?function(e,t){return P(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:xe;function se(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ce(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!we(e)||function(e){return!!S&&S in e}(e))&&(ye(e)?M:c).test(function(e){if(null!=e){try{return I.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function ue(e,t){var n=typeof e;return!!(t=null==t?o:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function le(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||x)}function de(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fe=function(e){var t=0,n=0;return function(){var r=Z(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ae);function pe(e,t){return e===t||e!=e&&t!=t}var he=oe(function(){return arguments}())?oe:function(e){return Ce(e)&&O.call(e,"callee")&&!U.call(e,"callee")},ve=Array.isArray;function me(e){return null!=e&&be(e.length)&&!ye(e)}var ge=q||function(){return!1};function ye(e){if(!we(e))return!1;var t=re(e);return t==a||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function be(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function we(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==typeof e}var Ae=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&be(e.length)&&!!l[re(e)]};function _e(e){return me(e)?function(e,t){var n=ve(e),r=!n&&he(e),o=!n&&!r&&ge(e),i=!n&&!r&&!o&&Ae(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var u in e)!t&&!O.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ue(u,c))||s.push(u);return s}(e,!0):function(e){if(!we(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=le(e),n=[];for(var r in e)("constructor"!=r||!t&&O.call(e,r))&&n.push(r);return n}(e)}var je,Fe=(je=function(e,t,n){ie(e,t,n)},function(e,t){return fe(function(e,t,n){return t=D(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=D(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),w(e,this,s)}}(e,t,xe),e+"")}((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=je.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!we(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&ue(t,n.length):"string"==r&&t in n)&&pe(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var a=t[n];a&&je(e,a,n)}return e})));function xe(e){return e}e.exports=Fe},4264:function(e){var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,a){a=a||{};var s,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\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(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;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"===u&&isFinite(e))return a.long?(s=e,(c=Math.abs(s))>=o?i(s,c,o,"day"):c>=r?i(s,c,r,"hour"):c>=n?i(s,c,n,"minute"):c>=t?i(s,c,t,"second"):s+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=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))}},5701:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},a=[],s=0;s<e.length;s++){var c=e[s],u=r.base?c[0]+r.base:c[0],l=i[u]||0,d="".concat(u," ").concat(l);i[u]=l+1;var f=n(d),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==f)t[f].references++,t[f].updater(p);else{var h=o(p,r);r.byIndex=s,t.splice(s,0,{identifier:d,updater:h,references:1})}a.push(d)}return a}function o(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,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var s=n(i[a]);t[s].references--}for(var c=r(e,o),u=0;u<i.length;u++){var l=n(i[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}i=c}}},6080:function(e){"use strict";var t={};e.exports=function(e,n){var r=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(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},7182:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},6850:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},8236:function(e){"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9213:function(e){"use strict";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))}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},n.nc=void 0;var r={};return function(){"use strict";n.r(r),n.d(r,{init:function(){return z}});var e=n(8193),t=n.n(e),o=n(732),i=n.n(o);const a="https://channels-ws.moveo.ai",s="https://web-client.dev.moveo.ai",c=()=>window.innerWidth<600||window.innerHeight<550&&window.innerWidth<1e3,u=(e,t)=>{var n,r;const o=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.type;return"string"==typeof o&&o.startsWith(e)?{type:o.replace(e,""),data:null===(r=t.data)||void 0===r?void 0:r.data}:null};var l,d,f=n(8492),p=n.n(f);!function(e){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"}(l||(l={})),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.SendMessage="moveo-send-message",e.UpdateContext="moveo-update-context",e.WindowResize="moveo-resize",e.SessionActivity="session-activity"}(d||(d={}));class h{constructor(e){this.detectMobile=()=>{c()!==this.isMobile&&(this.sendEventToIframe({type:d.WindowResize,data:{is_mobile:c(),width:window.innerWidth,height:window.innerHeight}}),this.isMobile=c())},this.trackActivity=()=>{let e;const t=()=>{this.sendEventToIframe({type:d.SessionActivity,data:"inactive"})},n=()=>{clearTimeout(e),e=window.setTimeout(t,6e5),this.sendEventToIframe({type:d.SessionActivity,data:"active"})};window.onload=p()(n,1e3),window.onmousemove=p()(n,1e3),window.onmousedown=p()(n,1e3),window.ontouchstart=p()(n,1e3),window.ontouchmove=p()(n,1e3),window.onclick=p()(n,1e3),window.onkeydown=p()(n,1e3),window.addEventListener("scroll",p()(n,1e3),!0)},this.config=e,this.id=e.widgetId,this.initialized=!1,this.log=t()(`moveo:web-client:${this.id}`),this.iframe=this.createIframe(),this.isMobile=null}createIframe(){const e=document.createElement("iframe");return e.width="1px",e.height="1px",e.id=this.id,e.name=this.id,e.allow="geolocation",e.style.border="0",e.classList.add("web-client-container"),"embed"===this.config.widget_position&&e.classList.add("embed"),e.setAttribute("src",(e=>{let t="";const n=document.querySelectorAll("script"),r=/@moveo-ai\/web-client.*next/;n&&n.forEach((e=>{e.src.match(r)&&(t=s)}));const{origin:o}=window.location;return!t&&o.match(/localhost:|vercel.app/)?t=o:!t&&o.match(/web-client.dev/)?t=s:t||(t="https://web-client.moveo.ai"),`${t}?widgetId=${e}`})(this.id)),e}handleEvents(e,t){return n=>{const r=u(this.id,n);if(r)switch(this.log(`Event from iframe: ${r.type}`,r),r.type){case l.IframeLoaded:this.sendEventToIframe({type:d.SetConfig,data:this.config});break;case l.IframeError:return t(r.data);case l.WidgetLoaded:setTimeout((()=>{this.detectMobile(),e(this)}),0);break;case l.WidgetError:this.notify(r);break;case l.Opened:r.data.isFull&&this.iframe.classList.add("full");break;case l.Closed:r.data.isFull&&this.iframe.classList.remove("full");break;case l.Resize:this.iframe.style.width=r.data.width,this.iframe.style.height=r.data.height;break;default:this.log(`Unhandle event: ${r.type}`)}else this.log("Ignoring event: ",n.data)}}init(){return new Promise(((e,t)=>{var n,r;if(this.initialized)throw new Error(`Widget ${this.id} was already initialized`);if(window.addEventListener("message",this.handleEvents(e,t)),window.addEventListener("resize",p()(this.detectMobile,100)),this.trackActivity(),"embed"===this.config.widget_position){let e=(null===(n=this.config)||void 0===n?void 0:n.element)||null;if("string"==typeof e&&(e=document.getElementById(e),!e))throw new Error(`Element with id: ${e} not found`);null==e||e.appendChild(this.iframe)}else null===(r=window.document.querySelector("body"))||void 0===r||r.appendChild(this.iframe);this.initialized=!0}))}sendEventToIframe(e){var t;this.iframe&&this.iframe.contentWindow?(this.log(`Event to iframe: ${e.type}`,e),e.type===d.SetConfig&&(null===(t=e.data)||void 0===t?void 0:t.element)&&delete e.data.element,this.iframe.contentWindow.postMessage(Object.assign(Object.assign({},e),{type:`${this.id}${e.type}`}),"*")):this.log("Error: Cannot find iframe to send event")}notify(e){this.log(`notify ${e.type}:`,e)}openWindow(){this.sendEventToIframe({type:d.Open})}closeWindow(){this.sendEventToIframe({type:d.Close})}sendMessage(e){this.sendEventToIframe({type:d.SendMessage,data:e})}updateContext(e){this.sendEventToIframe({type:d.UpdateContext,data:e})}setCSSVariables(e){this.sendEventToIframe({type:d.SetCssVariables,data:e})}setLocale(e){this.sendEventToIframe({type:d.SetLocale,data:e})}onSessionCreated(e){window.addEventListener("message",(t=>{const n=u(this.id,t);n?(this.log(`Event from iframe: ${n.type}`,n),n.type===l.SessionCreated&&e()):this.log("Ignoring event: ",t.data)}))}}var v=n(5701),m=n.n(v),g=n(8236),y=n.n(g),b=n(6080),w=n.n(b),C=n(6850),A=n.n(C),_=n(7182),j=n.n(_),F=n(9213),x=n.n(F),E=n(2817),I={};I.styleTagTransform=x(),I.setAttributes=A(),I.insert=w().bind(null,"head"),I.domAPI=y(),I.insertStyleElement=j(),m()(E.Z,I),E.Z&&E.Z.locals&&E.Z.locals;let O=t()("moveo:web-client");const S=async e=>{const t=`moveo-${((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),""))(5)}`,n=window.location.href;if(O=O.extend(`:${t}`),!(null==e?void 0:e.integrationId))throw new Error("integrationId is required.\n Call MoveoAI.init({ integrationId: YOUR_INTEGRATION_HERE })");const r=await(async(e,t)=>{const n=t||a,r=await fetch(`${n}/v1/web/${e}`),o=await r.text();if(r.ok)return JSON.parse(o);throw new Error(`Error loading config from: ${n}/${e}`)})(e.integrationId,e.host);return O("Loaded integration configuration:",r),Object.assign(Object.assign({},i()(Object.assign({},r),e)),{clientUrl:n,widgetId:t})},z=async e=>{await new Promise((e=>{if("complete"===document.readyState)return e();window.addEventListener("load",(()=>e()))}));const t=await S(e);if(O("Configuration:",t),"embed"===t.widget_position&&!t.element)throw new Error("element is not defined but required by embed widget");const n=new h(t);O("Initializing");const r=await n.init();return O("Initialized"),r}}(),r}()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MoveoAI=t():e.MoveoAI=t()}(self,(function(){return function(){var e={2817:function(e,t,n){"use strict";var r=n(1864),o=n.n(r),i=n(352),a=n.n(i)()(o());a.push([e.id,".web-client-container{position:fixed;bottom:0;right:0;cursor:pointer;z-index:10000;max-height:99vh}.web-client-container.embed{position:static;width:100% !important;height:100% !important}.web-client-container.full{width:100% !important;height:100% !important;bottom:0 !important;right:0 !important;left:0 !important;top:0 !important;max-height:initial}","",{version:3,sources:["webpack://./src/styles/web-client.scss"],names:[],mappings:"AAIA,sBAIE,cAAA,CACA,QAAA,CACA,OAAA,CACA,cAAA,CACA,aAPiB,CAQjB,eAPoB,CASpB,4BACE,eAAA,CACA,qBAAA,CACA,sBAAA,CAIF,2BACE,qBAAA,CACA,sBAAA,CACA,mBAAA,CACA,kBAAA,CACA,iBAAA,CACA,gBAAA,CACA,kBAAA",sourcesContent:["// This style is applied to the iframe that customers load.\n// Ideally we use style variables rather than this so that\n// we can use the widget-id.\n\n.web-client-container {\n $widget-z-index: 10000;\n $widget-max-height: 99vh;\n\n position: fixed;\n bottom: 0;\n right: 0;\n cursor: pointer;\n z-index: $widget-z-index;\n max-height: $widget-max-height;\n\n &.embed {\n position: static;\n width: 100% !important;\n height: 100% !important;\n }\n\n // ! Important because this happens on the clients website\n &.full {\n width: 100% !important;\n height: 100% !important;\n bottom: 0 !important;\n right: 0 !important;\n left: 0 !important;\n top: 0 !important;\n max-height: initial;\n }\n}\n"],sourceRoot:""}]),t.Z=a},352:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);r&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),t.push(l))}},t}},1864:function(e){"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */"),a=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[t].concat(a).concat([i]).join("\n")}return[t].join("\n")}},8193:function(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 r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,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")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$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(4006)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},4006:function(e,t,n){e.exports=function(e){function t(e){let n,o,i,a=null;function s(...e){if(!s.enabled)return;const r=s,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";a++;const i=t.formatters[o];if("function"==typeof i){const t=e[a];n=i.call(r,t),e.splice(a,1),a--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}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.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(4264),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}},8492:function(e,t,n){var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),f=Object.prototype.toString,d=Math.max,p=Math.min,h=function(){return l.Date.now()};function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=i.test(e);return n||a.test(e)?s(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,s,c,u=0,l=!1,f=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,u=t,a=e.apply(i,n)}function b(e){return u=e,s=setTimeout(C,t),l?y(e):a}function w(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=i}function C(){var e=h();if(w(e))return A(e);s=setTimeout(C,function(e){var n=t-(e-c);return f?p(n,i-(e-u)):n}(e))}function A(e){return s=void 0,g&&r?y(e):(r=o=void 0,a)}function _(){var e=h(),n=w(e);if(r=arguments,o=this,c=e,n){if(void 0===s)return b(c);if(f)return s=setTimeout(C,t),y(c)}return void 0===s&&(s=setTimeout(C,t)),a}return t=m(t)||0,v(n)&&(l=!!n.leading,i=(f="maxWait"in n)?d(m(n.maxWait)||0,t):i,g="trailing"in n?!!n.trailing:g),_.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=c=o=s=void 0},_.flush=function(){return void 0===s?a:A(h())},_}},732:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Function]",s="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[a]=l["[object Map]"]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,p=f||d||Function("return this")(),h=t&&!t.nodeType&&t,v=h&&e&&!e.nodeType&&e,m=v&&v.exports===h,g=m&&f.process,y=function(){try{return v&&v.require&&v.require("util").types||g&&g.binding&&g.binding("util")}catch(e){}}(),b=y&&y.isTypedArray;function w(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var C,A,_,j=Array.prototype,F=Function.prototype,x=Object.prototype,E=p["__core-js_shared__"],O=F.toString,I=x.hasOwnProperty,S=(C=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+C:"",T=x.toString,$=O.call(Object),z=RegExp("^"+O.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=m?p.Buffer:void 0,k=p.Symbol,L=p.Uint8Array,B=(M&&M.allocUnsafe,A=Object.getPrototypeOf,_=Object,function(e){return A(_(e))}),N=Object.create,W=x.propertyIsEnumerable,R=j.splice,U=k?k.toStringTag:void 0,P=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),q=M?M.isBuffer:void 0,D=Math.max,Z=Date.now,J=ce(p,"Map"),H=ce(Object,"create"),V=function(){function e(){}return function(t){if(!we(t))return{};if(N)return N(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function K(e){var t=this.__data__=new Q(e);this.size=t.size}function X(e,t,n){(void 0!==n&&!pe(e[t],n)||void 0===n&&!(t in e))&&ne(e,t,n)}function ee(e,t,n){var r=e[t];I.call(e,t)&&pe(r,n)&&(void 0!==n||t in e)||ne(e,t,n)}function te(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1}function ne(e,t,n){"__proto__"==t&&P?P(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}G.prototype.clear=function(){this.__data__=H?H(null):{},this.size=0},G.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},G.prototype.get=function(e){var t=this.__data__;if(H){var n=t[e];return n===r?void 0:n}return I.call(t,e)?t[e]:void 0},G.prototype.has=function(e){var t=this.__data__;return H?void 0!==t[e]:I.call(t,e)},G.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=H&&void 0===t?r:t,this},Q.prototype.clear=function(){this.__data__=[],this.size=0},Q.prototype.delete=function(e){var t=this.__data__,n=te(t,e);return!(n<0||(n==t.length-1?t.pop():R.call(t,n,1),--this.size,0))},Q.prototype.get=function(e){var t=this.__data__,n=te(t,e);return n<0?void 0:t[n][1]},Q.prototype.has=function(e){return te(this.__data__,e)>-1},Q.prototype.set=function(e,t){var n=this.__data__,r=te(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Y.prototype.clear=function(){this.size=0,this.__data__={hash:new G,map:new(J||Q),string:new G}},Y.prototype.delete=function(e){var t=se(this,e).delete(e);return this.size-=t?1:0,t},Y.prototype.get=function(e){return se(this,e).get(e)},Y.prototype.has=function(e){return se(this,e).has(e)},Y.prototype.set=function(e,t){var n=se(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},K.prototype.clear=function(){this.__data__=new Q,this.size=0},K.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},K.prototype.get=function(e){return this.__data__.get(e)},K.prototype.has=function(e){return this.__data__.has(e)},K.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Q){var r=n.__data__;if(!J||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Y(r)}return n.set(e,t),this.size=n.size,this};function re(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":U&&U in Object(e)?function(e){var t=I.call(e,U),n=e[U];try{e[U]=void 0;var r=!0}catch(e){}var o=T.call(e);return r&&(t?e[U]=n:delete e[U]),o}(e):function(e){return T.call(e)}(e)}function oe(e){return Ce(e)&&re(e)==i}function ie(e,t,n,r,o){e!==t&&function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[++r];if(!1===t(o[s],s,o))break}}(t,(function(i,a){if(o||(o=new K),we(i))!function(e,t,n,r,o,i,a){var c=fe(e,n),u=fe(t,n),l=a.get(u);if(l)X(e,n,l);else{var f,d,p,h,v,m=i?i(c,u,n+"",e,t,a):void 0,g=void 0===m;if(g){var y=ve(u),b=!y&&ge(u),w=!y&&!b&&Ae(u);m=u,y||b||w?ve(c)?m=c:Ce(v=c)&&me(v)?m=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(c):b?(g=!1,m=function(e,t){return e.slice()}(u)):w?(g=!1,h=new(p=(f=u).buffer).constructor(p.byteLength),new L(h).set(new L(p)),d=h,m=new f.constructor(d,f.byteOffset,f.length)):m=[]:function(e){if(!Ce(e)||re(e)!=s)return!1;var t=B(e);if(null===t)return!0;var n=I.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&O.call(n)==$}(u)||he(u)?(m=c,he(c)?m=function(e){return function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=void 0;void 0===c&&(c=e[s]),o?ne(n,s,c):ee(n,s,c)}return n}(e,_e(e))}(c):we(c)&&!ye(c)||(m=function(e){return"function"!=typeof e.constructor||le(e)?{}:V(B(e))}(u))):g=!1}g&&(a.set(u,m),o(m,u,r,i,a),a.delete(u)),X(e,n,m)}}(e,t,a,n,ie,r,o);else{var c=r?r(fe(e,a),i,a+"",e,t,o):void 0;void 0===c&&(c=i),X(e,a,c)}}),_e)}var ae=P?function(e,t){return P(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:xe;function se(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ce(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!we(e)||function(e){return!!S&&S in e}(e))&&(ye(e)?z:c).test(function(e){if(null!=e){try{return O.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function ue(e,t){var n=typeof e;return!!(t=null==t?o:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function le(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||x)}function fe(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var de=function(e){var t=0,n=0;return function(){var r=Z(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ae);function pe(e,t){return e===t||e!=e&&t!=t}var he=oe(function(){return arguments}())?oe:function(e){return Ce(e)&&I.call(e,"callee")&&!W.call(e,"callee")},ve=Array.isArray;function me(e){return null!=e&&be(e.length)&&!ye(e)}var ge=q||function(){return!1};function ye(e){if(!we(e))return!1;var t=re(e);return t==a||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function be(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function we(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==typeof e}var Ae=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&be(e.length)&&!!l[re(e)]};function _e(e){return me(e)?function(e,t){var n=ve(e),r=!n&&he(e),o=!n&&!r&&ge(e),i=!n&&!r&&!o&&Ae(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var u in e)!t&&!I.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ue(u,c))||s.push(u);return s}(e,!0):function(e){if(!we(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=le(e),n=[];for(var r in e)("constructor"!=r||!t&&I.call(e,r))&&n.push(r);return n}(e)}var je,Fe=(je=function(e,t,n){ie(e,t,n)},function(e,t){return de(function(e,t,n){return t=D(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=D(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),w(e,this,s)}}(e,t,xe),e+"")}((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=je.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!we(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&ue(t,n.length):"string"==r&&t in n)&&pe(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var a=t[n];a&&je(e,a,n)}return e})));function xe(e){return e}e.exports=Fe},7362:function(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,l="object"==typeof self&&self&&self.Object===Object&&self,f=u||l||Function("return this")(),d=Object.prototype.toString,p=Math.max,h=Math.min,v=function(){return f.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return m(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,a,s,c,u,l=0,f=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,l=t,s=e.apply(r,n)}function w(e){return l=e,c=setTimeout(A,t),f?b(e):s}function C(e){var n=e-u;return void 0===u||n>=t||n<0||d&&e-l>=a}function A(){var e=v();if(C(e))return _(e);c=setTimeout(A,function(e){var n=t-(e-u);return d?h(n,a-(e-l)):n}(e))}function _(e){return c=void 0,y&&o?b(e):(o=i=void 0,s)}function j(){var e=v(),n=C(e);if(o=arguments,i=this,u=e,n){if(void 0===c)return w(u);if(d)return c=setTimeout(A,t),b(u)}return void 0===c&&(c=setTimeout(A,t)),s}return t=g(t)||0,m(n)&&(f=!!n.leading,a=(d="maxWait"in n)?p(g(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),j.cancel=function(){void 0!==c&&clearTimeout(c),l=0,o=u=i=c=void 0},j.flush=function(){return void 0===c?s:_(v())},j}(e,t,{leading:o,maxWait:t,trailing:i})}},4264:function(e){var t=1e3,n=60*t,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,a){a=a||{};var s,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\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(i){var a=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;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"===u&&isFinite(e))return a.long?(s=e,(c=Math.abs(s))>=o?i(s,c,o,"day"):c>=r?i(s,c,r,"hour"):c>=n?i(s,c,n,"minute"):c>=t?i(s,c,t,"second"):s+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=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))}},5701:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},a=[],s=0;s<e.length;s++){var c=e[s],u=r.base?c[0]+r.base:c[0],l=i[u]||0,f="".concat(u," ").concat(l);i[u]=l+1;var d=n(f),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==d)t[d].references++,t[d].updater(p);else{var h=o(p,r);r.byIndex=s,t.splice(s,0,{identifier:f,updater:h,references:1})}a.push(f)}return a}function o(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,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var s=n(i[a]);t[s].references--}for(var c=r(e,o),u=0;u<i.length;u++){var l=n(i[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}i=c}}},6080:function(e){"use strict";var t={};e.exports=function(e,n){var r=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(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},7182:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},6850:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},8236:function(e){"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9213:function(e){"use strict";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))}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},n.nc=void 0;var r={};return function(){"use strict";n.r(r),n.d(r,{init:function(){return z}});var e=n(8193),t=n.n(e),o=n(732),i=n.n(o);const a="https://channels-ws.moveo.ai",s="https://web-client.dev.moveo.ai",c=()=>window.innerWidth<600||window.innerHeight<550&&window.innerWidth<1e3,u=(e,t)=>{var n,r;const o=null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.type;return"string"==typeof o&&o.startsWith(e)?{type:o.replace(e,""),data:null===(r=t.data)||void 0===r?void 0:r.data}:null};var l,f,d=n(8492),p=n.n(d),h=n(7362),v=n.n(h);!function(e){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"}(l||(l={})),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.SendMessage="moveo-send-message",e.UpdateContext="moveo-update-context",e.WindowResize="moveo-resize",e.SessionActivity="session-activity"}(f||(f={}));class m{constructor(e){this.detectMobile=()=>{c()!==this.isMobile&&(this.sendEventToIframe({type:f.WindowResize,data:{is_mobile:c(),width:window.innerWidth,height:window.innerHeight}}),this.isMobile=c())},this.trackActivity=()=>{const e=()=>{this.sendEventToIframe({type:f.SessionActivity,data:"active"})};window.onload=p()(e,2e3),window.onmousemove=v()(e,1e3),window.onmousedown=v()(e,1e3),window.ontouchstart=v()(e,1e3),window.ontouchmove=v()(e,1e3),window.onclick=v()(e,1e3),window.onkeydown=v()(e,1e3),window.addEventListener("scroll",v()(e,1e3),!0)},this.config=e,this.id=e.widgetId,this.initialized=!1,this.log=t()(`moveo:web-client:${this.id}`),this.iframe=this.createIframe(),this.isMobile=null}createIframe(){const e=document.createElement("iframe");return e.width="1px",e.height="1px",e.id=this.id,e.name=this.id,e.allow="geolocation",e.style.border="0",e.classList.add("web-client-container"),"embed"===this.config.widget_position&&e.classList.add("embed"),e.setAttribute("src",(e=>{let t="";const n=document.querySelectorAll("script"),r=/@moveo-ai\/web-client.*next/;n&&n.forEach((e=>{e.src.match(r)&&(t=s)}));const{origin:o}=window.location;return!t&&o.match(/localhost:|vercel.app/)?t=o:!t&&o.match(/web-client.dev/)?t=s:t||(t="https://web-client.moveo.ai"),`${t}?widgetId=${e}`})(this.id)),e}handleEvents(e,t){return n=>{const r=u(this.id,n);if(r)switch(this.log(`Event from iframe: ${r.type}`,r),r.type){case l.IframeLoaded:this.sendEventToIframe({type:f.SetConfig,data:this.config});break;case l.IframeError:return t(r.data);case l.WidgetLoaded:setTimeout((()=>{this.detectMobile(),e(this)}),0);break;case l.WidgetError:this.notify(r);break;case l.Opened:r.data.isFull&&this.iframe.classList.add("full");break;case l.Closed:r.data.isFull&&this.iframe.classList.remove("full");break;case l.Resize:this.iframe.style.width=r.data.width,this.iframe.style.height=r.data.height;break;default:this.log(`Unhandle event: ${r.type}`)}}}init(){return new Promise(((e,t)=>{var n,r;if(this.initialized)throw new Error(`Widget ${this.id} was already initialized`);if(window.addEventListener("message",this.handleEvents(e,t)),window.addEventListener("resize",p()(this.detectMobile,100)),this.trackActivity(),"embed"===this.config.widget_position){let e=(null===(n=this.config)||void 0===n?void 0:n.element)||null;if("string"==typeof e&&(e=document.getElementById(e),!e))throw new Error(`Element with id: ${e} not found`);null==e||e.appendChild(this.iframe)}else null===(r=window.document.querySelector("body"))||void 0===r||r.appendChild(this.iframe);this.initialized=!0,this.detectMobile()}))}sendEventToIframe(e){var t;this.iframe&&this.iframe.contentWindow?(this.log(`Event to iframe: ${e.type}`,e),e.type===f.SetConfig&&(null===(t=e.data)||void 0===t?void 0:t.element)&&delete e.data.element,this.iframe.contentWindow.postMessage(Object.assign(Object.assign({},e),{type:`${this.id}${e.type}`}),"*")):this.log("Error: Cannot find iframe to send event")}notify(e){this.log(`notify ${e.type}:`,e)}openWindow(){this.sendEventToIframe({type:f.Open})}closeWindow(){this.sendEventToIframe({type:f.Close})}sendMessage(e){this.sendEventToIframe({type:f.SendMessage,data:e})}updateContext(e){this.sendEventToIframe({type:f.UpdateContext,data:e})}setCSSVariables(e){this.sendEventToIframe({type:f.SetCssVariables,data:e})}setLocale(e){this.sendEventToIframe({type:f.SetLocale,data:e})}onSessionCreated(e){window.addEventListener("message",(t=>{const n=u(this.id,t);n&&(this.log(`Event from iframe: ${n.type}`,n),n.type===l.SessionCreated&&e())}))}}var g=n(5701),y=n.n(g),b=n(8236),w=n.n(b),C=n(6080),A=n.n(C),_=n(6850),j=n.n(_),F=n(7182),x=n.n(F),E=n(9213),O=n.n(E),I=n(2817),S={};S.styleTagTransform=O(),S.setAttributes=j(),S.insert=A().bind(null,"head"),S.domAPI=w(),S.insertStyleElement=x(),y()(I.Z,S),I.Z&&I.Z.locals&&I.Z.locals;let T=t()("moveo:web-client");const $=async e=>{const t=`moveo-${((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),""))(5)}`,n=window.location.href;if(T=T.extend(`:${t}`),!(null==e?void 0:e.integrationId))throw new Error("integrationId is required.\n Call MoveoAI.init({ integrationId: YOUR_INTEGRATION_HERE })");const r=await(async(e,t)=>{const n=t||a,r=await fetch(`${n}/v1/web/${e}`),o=await r.text();if(r.ok)return JSON.parse(o);throw new Error(`Error loading config from: ${n}/${e}`)})(e.integrationId,e.host);return T("Loaded integration configuration:",r),Object.assign(Object.assign({},i()(Object.assign({},r),e)),{clientUrl:n,widgetId:t})},z=async e=>{await new Promise((e=>{if("complete"===document.readyState)return e();window.addEventListener("load",(()=>e()))}));const t=await $(e);if(T("Configuration:",t),"embed"===t.widget_position&&!t.element)throw new Error("element is not defined but required by embed widget");const n=new m(t);T("Initializing");const r=await n.init();return T("Initialized"),r}}(),r}()}));
|
|
3
3
|
//# sourceMappingURL=web-client.min.js.map
|