viewar-guide
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.viewarGuide=e():t.viewarGuide=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=98)}([function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var i=n(17),o="object"==typeof self&&self&&self.Object===Object&&self,r=i||o||Function("return this")();t.exports=r},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var i=n(33),o=n(34),r=n(35),a=n(36),s=n(37);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=r,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,n){var i=n(5);t.exports=function(t,e){for(var n=t.length;n--;)if(i(t[n][0],e))return n;return-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var i=n(16),o=n(45),r=n(46),a="[object Null]",s="[object Undefined]",c=i?i.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:a:c&&c in Object(t)?o(t):r(t)}},function(t,e,n){var i=n(10)(Object,"create");t.exports=i},function(t,e,n){var i=n(60);t.exports=function(t,e){var n=t.__data__;return i(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var i=n(31),o=n(89)(function(t,e,n){i(t,e,n)});t.exports=o},function(t,e,n){var i=n(43),o=n(50);t.exports=function(t,e){var n=o(t,e);return i(n)?n:void 0}},function(t,e,n){var i=n(6),o=n(0),r="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",c="[object Proxy]";t.exports=function(t){if(!o(t))return!1;var e=i(t);return e==a||e==s||e==r||e==c}},function(t,e,n){var i=n(19);t.exports=function(t,e,n){"__proto__"==e&&i?i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var i=n(11),o=n(24);t.exports=function(t){return null!=t&&o(t.length)&&!i(t)}},function(t,e,n){var i=n(10)(n(1),"Map");t.exports=i},function(t,e,n){var i=n(1).Symbol;t.exports=i},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(44))},function(t,e,n){var i=n(12),o=n(5);t.exports=function(t,e,n){(void 0===n||o(t[e],n))&&(void 0!==n||e in t)||i(t,e,n)}},function(t,e,n){var i=n(10),o=function(){try{var t=i(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){var i=n(74)(Object.getPrototypeOf,Object);t.exports=i},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var i=n(75),o=n(2),r=Object.prototype,a=r.hasOwnProperty,s=r.propertyIsEnumerable,c=i(function(){return arguments}())?i:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=c},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){var n=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},function(t,e,n){(function(t){var i=n(1),o=n(77),r="object"==typeof e&&e&&!e.nodeType&&e,a=r&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===r?i.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;t.exports=c}).call(this,n(13)(t))},function(t,e,n){var i=n(79),o=n(80),r=n(81),a=r&&r.isTypedArray,s=a?o(a):i;t.exports=s},function(t,e){t.exports=function(t,e){return"__proto__"==e?void 0:t[e]}},function(t,e,n){var i=n(85),o=n(87),r=n(14);t.exports=function(t){return r(t)?i(t,!0):o(t)}},function(t,e){var n=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=typeof t;return!!(e=null==e?n:e)&&("number"==o||"symbol"!=o&&i.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var i=n(32),o=n(18),r=n(64),a=n(66),s=n(0),c=n(28),u=n(27);t.exports=function t(e,n,p,l,h){e!==n&&r(n,function(r,c){if(s(r))h||(h=new i),a(e,n,c,p,t,l,h);else{var f=l?l(u(e,c),r,c+"",e,n,h):void 0;void 0===f&&(f=r),o(e,c,f)}},c)}},function(t,e,n){var i=n(3),o=n(38),r=n(39),a=n(40),s=n(41),c=n(42);function u(t){var e=this.__data__=new i(t);this.size=e.size}u.prototype.clear=o,u.prototype.delete=r,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,t.exports=u},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var i=n(4),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=i(e,t);return!(n<0||(n==e.length-1?e.pop():o.call(e,n,1),--this.size,0))}},function(t,e,n){var i=n(4);t.exports=function(t){var e=this.__data__,n=i(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var i=n(4);t.exports=function(t){return i(this.__data__,t)>-1}},function(t,e,n){var i=n(4);t.exports=function(t,e){var n=this.__data__,o=i(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var i=n(3);t.exports=function(){this.__data__=new i,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var i=n(3),o=n(15),r=n(51),a=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof i){var s=n.__data__;if(!o||s.length<a-1)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new r(s)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var i=n(11),o=n(47),r=n(0),a=n(49),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,p=c.toString,l=u.hasOwnProperty,h=RegExp("^"+p.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!r(t)||o(t))&&(i(t)?h:s).test(a(t))}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var i=n(16),o=Object.prototype,r=o.hasOwnProperty,a=o.toString,s=i?i.toStringTag:void 0;t.exports=function(t){var e=r.call(t,s),n=t[s];try{t[s]=void 0;var i=!0}catch(t){}var o=a.call(t);return i&&(e?t[s]=n:delete t[s]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var i=n(48),o=function(){var t=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!o&&o in t}},function(t,e,n){var i=n(1)["__core-js_shared__"];t.exports=i},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var i=n(52),o=n(59),r=n(61),a=n(62),s=n(63);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=r,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,n){var i=n(53),o=n(3),r=n(15);t.exports=function(){this.size=0,this.__data__={hash:new i,map:new(r||o),string:new i}}},function(t,e,n){var i=n(54),o=n(55),r=n(56),a=n(57),s=n(58);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=r,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,n){var i=n(7);t.exports=function(){this.__data__=i?i(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var i=n(7),o="__lodash_hash_undefined__",r=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(i){var n=e[t];return n===o?void 0:n}return r.call(e,t)?e[t]:void 0}},function(t,e,n){var i=n(7),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return i?void 0!==e[t]:o.call(e,t)}},function(t,e,n){var i=n(7),o="__lodash_hash_undefined__";t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=i&&void 0===e?o:e,this}},function(t,e,n){var i=n(8);t.exports=function(t){var e=i(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var i=n(8);t.exports=function(t){return i(this,t).get(t)}},function(t,e,n){var i=n(8);t.exports=function(t){return i(this,t).has(t)}},function(t,e,n){var i=n(8);t.exports=function(t,e){var n=i(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e,n){var i=n(65)();t.exports=i},function(t,e){t.exports=function(t){return function(e,n,i){for(var o=-1,r=Object(e),a=i(e),s=a.length;s--;){var c=a[t?s:++o];if(!1===n(r[c],c,r))break}return e}}},function(t,e,n){var i=n(18),o=n(67),r=n(68),a=n(71),s=n(72),c=n(22),u=n(23),p=n(76),l=n(25),h=n(11),f=n(0),d=n(78),y=n(26),g=n(27),w=n(82);t.exports=function(t,e,n,v,m,x,b){var _=g(t,n),z=g(e,n),O=b.get(z);if(O)i(t,n,O);else{var S=x?x(_,z,n+"",t,e,b):void 0,j=void 0===S;if(j){var A=u(z),T=!A&&l(z),I=!A&&!T&&y(z);S=z,A||T||I?u(_)?S=_:p(_)?S=a(_):T?(j=!1,S=o(z,!0)):I?(j=!1,S=r(z,!0)):S=[]:d(z)||c(z)?(S=_,c(_)?S=w(_):(!f(_)||v&&h(_))&&(S=s(z))):j=!1}j&&(b.set(z,S),m(S,z,v,x,b),b.delete(z)),i(t,n,S)}}},function(t,e,n){(function(t){var i=n(1),o="object"==typeof e&&e&&!e.nodeType&&e,r=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=r&&r.exports===o?i.Buffer:void 0,s=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,i=s?s(n):new t.constructor(n);return t.copy(i),i}}).call(this,n(13)(t))},function(t,e,n){var i=n(69);t.exports=function(t,e){var n=e?i(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var i=n(70);t.exports=function(t){var e=new t.constructor(t.byteLength);return new i(e).set(new i(t)),e}},function(t,e,n){var i=n(1).Uint8Array;t.exports=i},function(t,e){t.exports=function(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}},function(t,e,n){var i=n(73),o=n(20),r=n(21);t.exports=function(t){return"function"!=typeof t.constructor||r(t)?{}:i(o(t))}},function(t,e,n){var i=n(0),o=Object.create,r=function(){function t(){}return function(e){if(!i(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=r},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var i=n(6),o=n(2),r="[object Arguments]";t.exports=function(t){return o(t)&&i(t)==r}},function(t,e,n){var i=n(14),o=n(2);t.exports=function(t){return o(t)&&i(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var i=n(6),o=n(20),r=n(2),a="[object Object]",s=Function.prototype,c=Object.prototype,u=s.toString,p=c.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!r(t)||i(t)!=a)return!1;var e=o(t);if(null===e)return!0;var n=p.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},function(t,e,n){var i=n(6),o=n(24),r=n(2),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return r(t)&&o(t.length)&&!!a[i(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var i=n(17),o="object"==typeof e&&e&&!e.nodeType&&e,r=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=r&&r.exports===o&&i.process,s=function(){try{var t=r&&r.require&&r.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(this,n(13)(t))},function(t,e,n){var i=n(83),o=n(28);t.exports=function(t){return i(t,o(t))}},function(t,e,n){var i=n(84),o=n(12);t.exports=function(t,e,n,r){var a=!n;n||(n={});for(var s=-1,c=e.length;++s<c;){var u=e[s],p=r?r(n[u],t[u],u,n,t):void 0;void 0===p&&(p=t[u]),a?o(n,u,p):i(n,u,p)}return n}},function(t,e,n){var i=n(12),o=n(5),r=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];r.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||i(t,e,n)}},function(t,e,n){var i=n(86),o=n(22),r=n(23),a=n(25),s=n(29),c=n(26),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=r(t),p=!n&&o(t),l=!n&&!p&&a(t),h=!n&&!p&&!l&&c(t),f=n||p||l||h,d=f?i(t.length,String):[],y=d.length;for(var g in t)!e&&!u.call(t,g)||f&&("length"==g||l&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,y))||d.push(g);return d}},function(t,e){t.exports=function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}},function(t,e,n){var i=n(0),o=n(21),r=n(88),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!i(t))return r(t);var e=o(t),n=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&n.push(s);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var i=n(90),o=n(97);t.exports=function(t){return i(function(e,n){var i=-1,r=n.length,a=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(r--,a):void 0,s&&o(n[0],n[1],s)&&(a=r<3?void 0:a,r=1),e=Object(e);++i<r;){var c=n[i];c&&t(e,c,i,a)}return e})}},function(t,e,n){var i=n(30),o=n(91),r=n(93);t.exports=function(t,e){return r(o(t,e,i),t+"")}},function(t,e,n){var i=n(92),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var r=arguments,a=-1,s=o(r.length-e,0),c=Array(s);++a<s;)c[a]=r[e+a];a=-1;for(var u=Array(e+1);++a<e;)u[a]=r[a];return u[e]=n(c),i(t,this,u)}}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var i=n(94),o=n(96)(i);t.exports=o},function(t,e,n){var i=n(95),o=n(19),r=n(30),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:i(e),writable:!0})}:r;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var n=800,i=16,o=Date.now;t.exports=function(t){var e=0,r=0;return function(){var a=o(),s=i-(a-r);if(r=a,s>0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var i=n(5),o=n(14),r=n(29),a=n(0);t.exports=function(t,e,n){if(!a(n))return!1;var s=typeof e;return!!("number"==s?o(n)&&r(e,n.length):"string"==s&&e in n)&&i(n[e],t)}},function(t,e,n){"use strict";n.r(e);const i=2**-16;class o{static get ZERO(){return new o(0,0,0)}static get X_AXIS(){return new o(1,0,0)}static get Y_AXIS(){return new o(0,1,0)}static get Z_AXIS(){return new o(0,0,1)}static get UNIT_SCALE(){return new o(1,1,1)}constructor(...t){if(0===t.length)this.x=0,this.y=0,this.z=0;else if(1===t.length)if(t[0]&&"object"==typeof t[0]){const{x:e,y:n,z:i}=t[0];Object.assign(this,{x:e,y:n,z:i})}else{if(!(t[0]instanceof Array))throw new Error;{const[e,n,i]=t[0];Object.assign(this,{x:e,y:n,z:i})}}else{if(3!==t.length)throw new Error;{const[e,n,i]=t;Object.assign(this,{x:e,y:n,z:i})}}}set(t,e,n){return this.x=t,this.y=e,this.z=n,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}clone(){return new o(this.x,this.y,this.z)}cross(t){return Object.assign(this,{x:this.y*t.z-this.z*t.y,y:this.z*t.x-this.x*t.z,z:this.x*t.y-this.y*t.x})}scale(t){return Object.assign(this,{x:this.x*t,y:this.y*t,z:this.z*t})}add(t){return Object.assign(this,{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z})}subtract(t){return Object.assign(this,{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z})}length(){return Math.hypot(this.x,this.y,this.z)}lengthSq(){return this.x**2+this.y**2+this.z**2}invert(){return this.scale(-1)}normalize(){const t=this.length();return t?this.scale(1/t):this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}equals(t){return Math.abs(this.x-t.x)<i&&Math.abs(this.y-t.y)<i&&Math.abs(this.z-t.z)<i}rotate(t){const e=t.w*this.x+t.y*this.z-t.z*this.y,n=t.w*this.y+t.z*this.x-t.x*this.z,i=t.w*this.z+t.x*this.y-t.y*this.x,o=-t.x*this.x-t.y*this.y-t.z*this.z;return Object.assign(this,{x:e*t.w+o*-t.x+n*-t.z-i*-t.y,y:n*t.w+o*-t.y+i*-t.x-e*-t.z,z:i*t.w+o*-t.z+e*-t.y-n*-t.x})}rotateAroundVector(t,e){return this.subtract(t).rotate(e).add(t)}projectOntoVector(t){const e=t.dot(this)/t.lengthSq();return this.copy(t).scale(e)}projectOntoPlane(t){return this.subtract(r.copy(this).projectOntoVector(t.normal))}}const r=new o,a=2**-16;class s{static get IDENTITY(){return new s(1,0,0,0)}static fromAxisAngle({x:t,y:e,z:n},i){return(new s).set(Math.cos(i/2),t*Math.sin(i/2),e*Math.sin(i/2),n*Math.sin(i/2)).normalize()}fromAxisAngle({x:t,y:e,z:n},i){return this.set(Math.cos(i/2),t*Math.sin(i/2),e*Math.sin(i/2),n*Math.sin(i/2)).normalize()}static fromUnitVectors(t,e){const n=new s;let i=t.dot(e)+1;return i<a?(i=0,Math.abs(t.x)>Math.abs(t.z)?u.set(-t.y,t.x,0):u.set(0,-t.z,t.y)):u.copy(t).cross(e),n.set(i,u.x,u.y,u.z).normalize()}fromUnitVectors(t,e){let n=t.dot(e)+1;return n<a?(n=0,Math.abs(t.x)>Math.abs(t.z)?u.set(-t.y,t.x,0):u.set(0,-t.z,t.y)):u.copy(t).cross(e),this.set(n,u.x,u.y,u.z).normalize()}constructor(...t){if(0===t.length)this.w=1,this.x=0,this.y=0,this.z=0;else if(1===t.length)if(t[0]&&"object"==typeof t[0])this.w=t[0].w,this.x=t[0].x,this.y=t[0].y,this.z=t[0].z;else{if(!(t[0]instanceof Array))throw new Error;this.w=t[0][0],this.x=t[0][1],this.y=t[0][2],this.z=t[0][3]}else{if(4!==t.length)throw new Error;this.w=t[0],this.x=t[1],this.y=t[2],this.z=t[3]}}set(t,e,n,i){return this.w=t,this.x=e,this.y=n,this.z=i,this}copy(t){return this.w=t.w,this.x=t.x,this.y=t.y,this.z=t.z,this}clone(){return new s(this.w,this.x,this.y,this.z)}multiply(t){return Object.assign(this,{w:this.w*t.w-this.x*t.x-this.y*t.y-this.z*t.z,x:this.w*t.x+this.x*t.w+this.y*t.z-this.z*t.y,y:this.w*t.y+this.y*t.w+this.z*t.x-this.x*t.z,z:this.w*t.z+this.z*t.w+this.x*t.y-this.y*t.x})}lengthSquared(){return this.w**2+this.x**2+this.y**2+this.z**2}length(){return Math.hypot(this.w,this.x,this.y,this.z)}normalize(){const t=this.lengthSquared();if(Math.abs(t-1)<a)return this;{const e=Math.sqrt(t);return Object.assign(this,{w:this.w/e,x:this.x/e,y:this.y/e,z:this.z/e})}}invert(){return this.conjugate()}conjugate(){return Object.assign(this,{w:this.w,x:-this.x,y:-this.y,z:-this.z})}dot(t){return this.w*t.w+this.x*t.x+this.y*t.y+this.z*t.z}equals(t){return Math.abs(Math.abs(this.dot(t))-1)<a}toAxisAngle(){const{w:t,x:e,y:n,z:i}=this,r=2*Math.acos(t),s=Math.sqrt(1-t**2);return{angle:r,axis:s<a?new o(1,0,0):new o(e/s,n/s,i/s)}}toAngleAround(t){const e=0!==(t=t.clone().normalize()).y||0!==t.z?new o(0,-t.z,t.y):new o(-t.z,0,t.x),n=e.clone().rotate(this),i=n.clone().subtract(t.clone().scale(n.dot(t))).normalize();return Math.acos(e.dot(i))}toEulerAngles(){const t=this.x*this.y+this.z*this.w;if(t>.499){return{heading:2*Math.atan2(this.x,this.w),bank:0,attitude:Math.PI/2}}if(t<-.499){return{heading:-2*Math.atan2(this.x,this.w),bank:0,attitude:-Math.PI/2}}const e=this.x*this.x,n=this.y*this.y,i=this.z*this.z;let o=Math.atan2(2*this.y*this.w-2*this.x*this.z,1-2*n-2*i),r=Math.asin(2*t);return{heading:o,bank:Math.atan2(2*this.x*this.w-2*this.y*this.z,1-2*e-2*i),attitude:r}}slerp(t,e){const n=this,i=this;if(0===e)return n;if(1===e)return n.copy(t);let o=i.dot(t);if(o<0&&((t=c.copy(t)).w=-t.w,t.x=-t.x,t.y=-t.y,t.z=-t.z,o=-o),o>=1)return n;const r=Math.sqrt(1-o**2);if(Math.abs(r)<.001)return n.w=.5*(i.w+t.w),n.x=.5*(i.x+t.x),n.y=.5*(i.y+t.y),n.z=.5*(i.z+t.z),n;const a=Math.atan2(r,o),s=Math.sin((1-e)*a)/r,u=Math.sin(e*a)/r;return n.w=i.w*s+t.w*u,n.x=i.x*s+t.x*u,n.y=i.y*s+t.y*u,n.z=i.z*s+t.z*u,n}}const c=new s,u=new o,p=(new o,new o,Object.freeze({pose:{position:{x:NaN,y:NaN,z:NaN},orientation:{w:NaN,x:NaN,y:NaN,z:NaN},scale:{x:NaN,y:NaN,z:NaN}}})),l=Object.freeze({translation:!1,rotation:!1,scaling:!1}),h=(Object.freeze({translation:!0,rotation:!1,scaling:!1}),Object.freeze({pose:{position:{x:0,y:1e5,z:0},orientation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},interaction:l,visible:!1})),f=1e3/30,d=2*Math.PI,y=d/2,g=Object.freeze({app:{admin:!1,usePoiImages:!1,userAvoidanceEnabled:!1,showTargetNotification:!1,visualizeQrCodes:!1,defaultUser:"tempuser",initialProject:null,projectId:"guidebot-978f7",language:"en-US",viewDistance:2e4},debug:{debugStateMachine:!1,showRobotHelpers:!1,exposeServices:!1,showDebugOutput:!1,showGraphDuringNavigation:!1,showReplayControls:!1},models:{qr:"guidebot_qrcode",guide:"guidebot_robot_v4",reticule:"guidebot_reticule",poi:"guidebot_poi",path:"guidebot_path",waypoint:"guidebot_waypoint"},fallbackModels:{qr:"55563",guide:"56664",reticule:"54428",poi:"54426",path:"54429",waypoint:"54383"},guideParams:{spawnDistance:2e3,nearDistance:2e3,farDistance:4e3,minProximityRadius:100,verticalCutoff:2e3,maxLinearVelocity:1e3/30,maxAngularVelocity:d/3/30,linearAcceleration:1e3/30/30},text:{greetUser:"Hi there! How can I help you?",followMe:"Sure, follow me!",selectPoi:"Hi there! Please select a point of interest."}});var w=n(9),v=n.n(w),m=v()({},g);const x=(t,e=.001)=>t>-e&&t<e?0:t;function b(t,e){const n=e-t;return Math.atan2(Math.sin(n),Math.cos(n))}function _(t,e,n){return Math.min(Math.max(t,e),n)}var z=t=>new Promise(e=>setTimeout(e,t));function O(t,e=10){const n=new Array(e).fill(null).map(()=>t()),i=[];return{get:function(){0===n.length&&console.info("Object pool exhausted, populating...");const e=n.pop()||t();return i.push(e),e},release:function(){for(;i.length;)n.push(i.pop())},get usage(){return i.length}}}const{X_AXIS:S,Y_AXIS:j,Z_AXIS:A,ZERO:T}=o,{IDENTITY:I}=s;[S,j,A,T,I].forEach(Object.freeze);const P=O(()=>new o,20),M=O(()=>new s,20),E=()=>{P.release(),M.release()},N=(t=T)=>P.get().copy(t),V=(t,e)=>N(e).subtract(t),U=t=>N(A).rotate(t),R=(t=I)=>M.get().copy(t),D=t=>R().fromUnitVectors(N(A).normalize(),N(t).normalize()),k=t=>t.pose.position,q=t=>t.toEulerAngles().heading,L=({maxAngularVelocity:t},e,n,i)=>{const o=V(e.position,k(n)).setY(0),r=D(o),a=b(q(e.orientation),q(r)),s=Math.sign(x(a)),c=a*s;e.angularVelocity=s*t,e.angularDeviation=c,e.targetOrientation=r;const u=V(k(n),e.position).setY(0),p=V(k(n),k(i)).setY(0);e.curveAngle=q(((t,e)=>R().fromUnitVectors(N(t).normalize(),N(e).normalize()))(u,p))},F=({linearAcceleration:t,maxLinearVelocity:e},n,i,o)=>{n.linearVelocity<n.targetLinearVelocity?n.linearVelocity=_(n.linearVelocity+t,0,n.targetLinearVelocity):n.linearVelocity=_(n.linearVelocity-t,n.targetLinearVelocity,e)},G=({maxLinearVelocity:t},e,n,i)=>{e.targetLinearVelocity=t*_((y-e.angularDeviation)/y,0,1)};function C(t,e,[n,i]){L(t,e,n,i),G(t,e,n,i),F(t,e,n,i),E()}const Y=({linearAcceleration:t,maxLinearVelocity:e},n,i)=>{const o=V(n.position,k(i)).setY(0),r=D(o),a=b(q(n.orientation),q(r)),s=a*Math.sign(x(a));n.linearVelocity=e*_(1-s/Math.PI,0,1),n.angularDeviation=s,n.targetOrientation=r,n.curveAngle=Math.PI},$=({maxAngularVelocity:t},e,n)=>{const i=V(e.position,k(n)).setY(0),o=D(i),r=b(q(e.orientation),q(o)),a=Math.sign(x(r)),s=r*a;e.angularVelocity=_(s/t,0,t)*a};function X(t,e,[n]){Y(t,e,n),$(t,e,n),E()}var Z={viewarApi:{}};class W{constructor({position:t=o.ZERO,orientation:e=s.IDENTITY,scale:n=o.UNIT_SCALE}={}){this.position=o.ZERO.copy(t),this.orientation=s.IDENTITY.copy(e),this.scale=o.UNIT_SCALE.copy(n)}copy(t){this.position.copy(t.position),this.orientation.copy(t.orientation),this.scale.copy(t.scale)}}const H={ViewARRobotVideoDisplay:"RobotFaceTalk"},B={ViewARRobotVideoDisplay:"RobotFaceNeutral"};var Q=function({insertGuide:t,setAnimationState:e,addToPoseUpdateQueue:n}){let i=null,r=!1;const a={position:o.ZERO,orientation:s.IDENTITY,scale:o.UNIT_SCALE};let c=0,u=[];return{init:async()=>i=await Z.queueSceneUpdate(t),showTalkingFace:()=>Z.queueSceneUpdate(()=>i.setPropertyValues(H)),showNormalFace:()=>Z.queueSceneUpdate(()=>i.setPropertyValues(B)),show:()=>Z.queueSceneUpdate(()=>i.setVisible(!0)),hide:()=>Z.queueSceneUpdate(()=>i.setVisible(!1)),setPose:async t=>{t.position&&a.position.copy(t.position),t.orientation&&a.orientation.copy(t.orientation),t.scale&&a.scale.copy(t.scale),r||await i.setPose(a)},processTick:()=>{r&&(u.push(Object.assign(new W(a),{durationInSeconds:1/30})),(c+=1)%3==0&&(n(i.id,u),u=[]))},animate:async t=>{const n=(()=>{const t={};for(const e of Object.keys(i.animations))t[e]={enabled:!1,time:0,loop:!1}})();e({[i.id]:Object.assign({},n,t)})},startPoseUpdate:()=>{u=[],r=!0},stopPoseUpdate:()=>r=!1,get animations(){return i.animations},get model(){return i.model},get pose(){return a},get initialized(){return!!i}}}({insertGuide:async()=>{const{sceneManager:t,modelManager:e}=Z.viewarApi,n=await t.insertContainer(h),i=m.models.guide,o=e.findModelById(i)||e.findModelByForeignKey(i)||await e.getModelFromRepository(m.fallbackModels.guide),r=await t.insertModel(o,{parent:n});return await async function(t){}(),Object.defineProperties(n,{model:{value:r.model,enumerable:!0},animations:{value:r.animations,enumerable:!0},setPropertyValues:{value:r.setPropertyValues,enumerable:!0},propertyValues:{get:()=>r.propertyValues,enumerable:!0}}),n.animations.FlyOut.start({time:0,loop:!1},!0),await n.setVisible(!1),n},setAnimationState:(...t)=>Z.viewarApi.coreInterface.call("setAnimationStatus",...t),addToPoseUpdateQueue:(...t)=>Z.viewarApi.coreInterface.call("addToPoseUpdateQueue",...t),clearPoseUpdateQueue:(...t)=>Z.viewarApi.coreInterface.call("clearPoseUpdateQueue",...t)});const K=new o;var J=()=>{const t=Z.viewarApi.cameras;for(let e of Object.values(t))if(e.active)return e};var tt=function({findPathToPoi:t}){let e=null,n=[];const i=()=>e&&n[0]||p;return{chooseDestination:i=>{i&&i!==e&&(n=t(e=i))},clearDestination:()=>{e=null,n=[]},update:(t,e)=>{i()&&K.copy(i().pose.position).subtract(t).setY(0).length()<=e&&n.shift()},hasCurrentWaypoint:()=>!(!e||!n[0]),hasNextWaypoint:()=>!(!e||!n[1]),get currentWaypoint(){return i()},get nextWaypoint(){return e&&n[1]||p},get path(){return n},get destination(){return e}}}({findPathToPoi:t=>Z.findPath(J(),t)});var et=(({body:t,navigation:e,getGuideParams:n})=>{const i={linearVelocity:0,targetLinearVelocity:0,angularVelocity:0,targetAngularVelocity:0,targetOrientation:s.IDENTITY,proximityRadius:0,curveAngle:0,angularDeviation:0,position:o.ZERO,orientation:s.IDENTITY,scale:o.UNIT_SCALE,forward:o.Z_AXIS},r=({maxAngularVelocity:t},e)=>{if(e.angularDeviation>t){const t=(t=>M.get().fromAxisAngle(j,t))(e.angularVelocity);e.orientation.multiply(t),e.forward.rotate(t)}else e.orientation.copy(e.targetOrientation),e.forward.copy(U(e.targetOrientation))},a=o=>async()=>{const a=n();i.position.copy(t.pose.position),i.orientation.copy(t.pose.orientation),i.scale.copy(t.pose.scale),o(a,i,e.path),r(a,i),((t,e)=>{const n=U(e.orientation).scale(e.linearVelocity);e.position.add(n)})(0,i),(({maxLinearVelocity:t,maxAngularVelocity:e},n)=>{const i=t/(2*Math.sin(e)*Math.sin(n.curveAngle/2));n.proximityRadius=Math.max(i,t)})(a,i),e.update(i.position,i.proximityRadius),t.setPose(i)};return{get state(){return i},arrive:a(X),followPath:a(C)}})({body:Q,navigation:tt,getGuideParams:()=>m.guideParams});const nt=Symbol(),it=Symbol(),ot=(t,e={time:0,loop:!1},n=!1)=>Promise.all([t.start(e,n),z(1e3*t.duration)]),rt=async()=>nt,at=async({body:t,camera:e})=>{const n=(await e.getPoseInViewingDirection(m.guideParams.spawnDistance,!0)).position;n.y=e.pose.position.y-1e3;const i=new o(e.pose.position).subtract(n).setY(0).normalize(),r=s.fromUnitVectors(o.Z_AXIS,i.normalize());return await t.setPose({position:n,orientation:r}),await Promise.all([ot(t.animations.FlyIn,{time:0,loop:!1},!0),t.show()]),t.startPoseUpdate(),it},st=async({body:t})=>(t.stopPoseUpdate(),await ot(t.animations.FlyOut,{time:0,loop:!1},!0),await t.hide(),it);let ct=void 0;const ut=async({body:t,camera:e})=>(await lt(t,e),nt);let pt=void 0;const lt=async(t,e,n)=>{const i=new o(e.pose.position).subtract(t.pose.position).setY(0).normalize();return await ht(t,s.fromUnitVectors(o.Z_AXIS,i),n),nt},ht=async(t,e,n)=>{const i=b(new s(t.pose.orientation).toEulerAngles().heading,e.toEulerAngles().heading);if(n=n||Math.sign(i),Math.abs(Math.abs(i)-m.guideParams.maxAngularVelocity)>m.guideParams.maxAngularVelocity){const e=s.fromAxisAngle(o.Y_AXIS,n*m.guideParams.maxAngularVelocity);t.setPose({orientation:new s(t.pose.orientation).multiply(e)})}else pt=void 0,t.setPose({orientation:e});return nt},ft=new Map,dt=t=>new Promise(e=>setTimeout(e,t));const yt=t=>{ft.has(t)||ft.set(t,Promise.resolve().then(()=>(async function(t){const e=Date.now(),n={startTime:e,idealTime:e,lastTime:e,actualTime:e,difference:0,timeElapsed:0,frameNumber:0,frameLength:f};for(;ft.has(t);)n.frameNumber+=1,n.frameLength=f,n.actualTime=Date.now(),n.idealTime+=n.frameLength,n.difference=n.actualTime-n.idealTime,n.timeElapsed=n.actualTime-n.lastTime,n.lastTime=n.actualTime,t(Object.assign({},n)),await dt(n.frameLength-n.difference)})(t)))};var gt=(()=>{let t=!1,e=!1,n=()=>{};const i=async t=>{if(!e)try{e=!0,n(t)}catch(t){console.error(t)}finally{e=!1}};return{start:async(e=(()=>{}))=>{n=e,t||(t=!0,yt(i))},stop:async()=>{t&&(t=!1,await(async t=>{const e=ft.get(t)||Promise.resolve();ft.delete(t),await e})(i))}}})();function wt(){const t={},e=(e,n)=>(t[e]=t[e]||new Set).add(n),n=(e,n)=>n?t[e].delete(n):t[e].clear();return{on:e,off:n,once:(t,i)=>{const o=(...e)=>{i(...e),n(t,o)};e(t,o)},emit:(e,...n)=>(t[e]||[]).forEach(t=>t(...n))}}const vt=({initialState:t,finalStates:e=[],getNextState:n})=>{e=new Set(e);let i=t;return{get done(){return e.has(i)},get currentState(){return i},reset:()=>void(i=t),process:t=>(i.done?(i=n(i,t)).reset():i.process(t),i.output),getDebug:()=>i.getDebug()}},mt=({name:t,output:e})=>({name:t,output:e,done:!0,process:()=>{},reset:()=>{},getDebug:()=>t}),xt=({name:t,stateMachine:e})=>({name:t,get output(){return e.currentState.output},get done(){return e.done},process:t=>e.process(t),reset:()=>e.reset(),getDebug:()=>[t,e.getDebug()].join(" >> ")}),bt=mt({name:"TELEPORT_TO_USER",output:at}),_t=mt({name:"IDLE",output:rt}),zt=mt({name:"TELEPORT_AWAY",output:st});var Ot=xt({name:"HIDDEN",stateMachine:vt({initialState:zt,finalStates:[bt],getNextState:(t,{guideRequested:e})=>{switch(t){case zt:case _t:return e?bt:_t;case bt:return bt;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const St=mt({name:"GREET_USER_STATE",output:async({body:t,chatbot:e,userInput:n})=>(e.greetUser(n.greetMessage),await z(250),await ot(t.animations.Wave,{time:0,loop:!1},!0),await z(33),t.animations.Idle.start({time:0,loop:!0},!0),n.startListening(),nt)}),jt=mt({name:"LISTEN",output:ut}),At=mt({name:"DONE",output:async({body:t,userInput:e})=>(t.animate({}),e.stopListening(),it)});var Tt=xt({name:"TALKING",stateMachine:vt({initialState:St,finalStates:[At],getNextState:(t,{guideRequested:e,userAnswered:n,queryUnderstood:i,destinationChosen:o})=>{switch(t){case St:return e?jt:At;case jt:return e?o?At:i?At:jt:At;case At:return At;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const It=mt({name:"START_HOVERING",output:async({body:t})=>(t.animations.Idle.start({time:0,loop:!0},!0),nt)}),Pt=mt({name:"STOP_HOVERING",output:async({body:t})=>(t.animations.Idle.stop(),it)}),Mt=mt({name:"TURN_TO_USER",output:ut});var Et=xt({name:"WAITING",stateMachine:vt({initialState:It,finalStates:[Pt],getNextState:(t,{guideRequested:e,userNear:n,destinationChanged:i})=>{switch(t){case It:return Mt;case Mt:return e?i?Pt:n?Pt:Mt:Pt;case Pt:return Pt;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const Nt=mt({name:"START_MOVING",output:async({body:t})=>(t.animations.ForwardIn.start({time:0,loop:!1},!0),nt)}),Vt=mt({name:"FOLLOW_PATH_STATE",output:()=>(et.followPath(),nt)}),Ut=mt({name:"ARRIVE_STATE",output:()=>(et.arrive(),nt)}),Rt=mt({name:"STOP_MOVING",output:async({body:t})=>(await ot(t.animations.ForwardOut,{time:0,loop:!1},!0),it)});var Dt=xt({name:"GUIDING",stateMachine:vt({initialState:Nt,finalStates:[Rt],getNextState:(t,{guideRequested:e,userFar:n,destinationChanged:i,destinationReached:o,guideShouldHalt:r})=>{switch(t){case Nt:case Vt:return e?n?Rt:r?Ut:Vt:Rt;case Ut:return e?n?Rt:o?Rt:Ut:Rt;case Rt:return Rt;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const kt=mt({name:"TURN_TO_PRESENT",output:async({body:t,camera:e,navigation:n})=>{const i=new o(o.Z_AXIS).rotate(new s(t.pose.orientation)).setY(0),r=new o(n.destination.pose.position).subtract(t.pose.position).setY(0);return pt=pt||s.fromUnitVectors(i.normalize(),r.normalize()).toEulerAngles().heading,await lt(t,e,Math.sign(pt)),nt}}),qt=mt({name:"POINT_TOWARD_POI",output:async({body:t,camera:e,navigation:n})=>{const i=new o(n.destination.pose.position).subtract(t.pose.position),r=new o(e.pose.position).subtract(t.pose.position),a=s.fromUnitVectors(r.normalize(),i.normalize()).toEulerAngles().heading;return ct||(ct=a>0^["guidebot_robot_v2","guidebot_robot_v3","guidebot_robot_v4"].includes(t.model.foreignKey)?"Right":"Left"),await ot(t.animations[`Point${ct}In`],{time:0,loop:!1},!0),nt}}),Lt=mt({name:"START_PRESENTING_STATE",output:async({chatbot:t})=>(t.presentDestination(),nt)}),Ft=mt({name:"PRESENT_POI",output:rt}),Gt=mt({name:"STOP_PRESENTING",output:async({speechModule:t,navigation:e,userInput:n})=>(e.clearDestination(),t.stopSpeaking(),n.dismissGuide(),nt)}),Ct=mt({name:"PUT_DOWN_HAND",output:async({body:t})=>(ct&&(await ot(t.animations[`Point${ct}Out`],{time:0,loop:!1},!0),ct=void 0),await z(1e3),it)});var Yt=xt({name:"PRESENTING",stateMachine:vt({initialState:kt,finalStates:[Ct],getNextState:(t,{guideRequested:e,guideFacingUser:n,destinationChanged:i,guideSpeaking:o})=>{switch(t){case kt:return n?qt:kt;case qt:return e?i?Ct:Lt:Ct;case Lt:return e?Ft:Ct;case Ft:return e?i?Gt:o?Ft:Gt:Ct;case Gt:case Ct:return Ct;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const $t=mt({name:"TELEPORT_TO_USER",output:at}),Xt=mt({name:"TELEPORT_AWAY",output:st});var Zt=xt({name:"RECALIBRATE",stateMachine:vt({initialState:Xt,finalStates:[$t],getNextState:(t,{})=>{switch(t){case Xt:case $t:return $t;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});var Wt=vt({initialState:Ot,finalStates:[],getNextState:(({hidden:t,talking:e,waiting:n,guiding:i,presenting:o})=>(r,a)=>{const{guideRequested:s,destinationChosen:c,userNear:u,userFar:p,destinationReached:l,guideSpeaking:h,recalibrationRequested:f}=a;switch(r){case t:return s?e:t;case e:return s?c&&l?o:c&&!l?i:e:t;case i:return s?p?n:!u&&l?n:u&&l?o:f?Zt:i:t;case n:return s?u&&l?o:u&&!l?i:f?Zt:n:t;case Zt:return i;case o:return s&&h?o:t;default:throw new Error(`Unrecognized state: ${r?r.name:r}`)}})({hidden:Ot,talking:Tt,waiting:Et,guiding:Dt,presenting:Yt})});var Ht=function({getGreetMessage:t,navigation:e}){const n=wt(),{emit:i}=n,o=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(n,["emit"]);let r=!1,a=!1,s=!1,c=()=>{},u=t();const p=t=>(function(t){r&&i("userInput",{speaker:"user",sentence:t})})(t);return Object.assign({startListening:async function(){if(m.app.speechDisabled)return;const{coreInterface:t}=Z.viewarApi;"iOS"===t.platform&&(a=!1,r=!0,t.on("speechToText",p),await t.call("startVoiceInput"),await new Promise(e=>t.once("speechToText",t=>e(t))),a=!0)},stopListening:l,pickDestination:function(t){i("userInput",{destination:t})},requestGuide:function(e=(()=>{}),n=t()){u=n,c=e,s=!0},dismissGuide:function(){s=!1,e.clearDestination(),l(),c()},get userAnswered(){return a},get guideRequested(){return s},get greetMessage(){return u}},o);async function l(){if(m.app.speechDisabled)return;const{coreInterface:t}=Z.viewarApi;r=!1,a=!1,"iOS"===t.platform&&(t.off("speechToText",p),await t.call("stopVoiceInput"))}}({navigation:tt,getGreetMessage:()=>m.text.greetUser}),Bt=()=>Math.random().toString(36).slice(2);const Qt=t=>`https://dialogflow.googleapis.com/v2/projects/${m.app.projectId}/agent/sessions/${t}:detectIntent`,Kt=()=>fetch(`https://www.viewar.com/proxy.php?url=http://test2.3.viewar.com/guidebot/key.php?cache_bust=${Date.now()}`).then(t=>t.text()).then(t=>t.trim()),Jt=(t,e)=>({queryParams:{},queryInput:{text:{text:t,languageCode:e}}});var te=function({navigation:t,userInput:e,sendQuery:n,findDestination:i,getText:o}){const r=wt(),{emit:a}=r,s=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(r,["emit"]);let c=!1,u=!1,p=null;return Object.assign({init:function(){e.on("userInput",l)},greetUser:function(t){p=Bt(),c=!1,u=!1,a("guideSpeaking",{speaker:"guide",sentence:t})},presentDestination:function(){a("guideSpeaking",{speaker:"guide",sentence:t.destination?t.destination.data.description||t.destination.data.name:""})},get queryUnderstood(){return c},get userAnswered(){return u}},s);async function l({sentence:e,destination:r}){if(u=!0,r)c=!0,t.chooseDestination(r),a("guideSpeaking",{speaker:"guide",sentence:o("followMe")});else{const{fulfillmentText:o,parameters:r}=await n(p,e),s=Object.values(r)[0];if(s){const e=i(s);e&&(c=!0,t.chooseDestination(e))}a("guideSpeaking",{speaker:"guide",sentence:o})}}}({navigation:tt,userInput:Ht,findDestination:t=>Z.getPois().find(e=>e.data&&e.data.name.toLowerCase()===t.toLowerCase()),sendQuery:async function(t,e){return m.app.chatbotUrl?await async function(t,e,n){const{appConfig:i}=Z.viewarApi,o=new FormData;o.append("data",JSON.stringify({text:n,language:m.app.language,appId:i.appId,version:i.version.app,sessionId:e}));const r=await fetch(t,{method:"POST",body:o}).then(t=>t.json()),{error:a,queryResult:s}=r;if(a)throw alert(a.message),new Error(a.message);return s}(m.app.chatbotUrl,t,e):await async function(t,e){const n=await Kt(),{error:i,queryResult:o}=await fetch(Qt(t),{method:"POST",headers:{Accept:"application/json",Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify(Jt(e,m.app.language))}).then(t=>t.json());if(i)throw alert(i.message),new Error(i.message);return o}(t,e)},getText:t=>m.text[t]});var ee=function({getLanguageKey:t,getSpeaker:e,body:n,chatbot:i}){let o=!1;const r=async(n,i=e(),o=t())=>{const{coreInterface:r}=Z.viewarApi;"iOS"===r.platform?(await r.call("stopVoiceInput"),await(async(t,e,n)=>Z.viewarApi.coreInterface.call("textToSpeech",t,{name:e,lang:n}))(n,i,o),await r.call("startVoiceInput")):"Android"===r.platform?(await r.call("stopVoiceInput"),await(async(t,e,n)=>Z.viewarApi.coreInterface.call("textToSpeech",t,{name:e,lang:n}))(n,i,o),await r.call("startVoiceInput")):await(async(t,e,n)=>{let i=window.speechSynthesis,o=window.SpeechSynthesisUtterance;const r=i.getVoices().find(t=>t.name===e)||i.getVoices().find(t=>t.lang===n),a=Object.assign(new o,{text:t,lang:n,voice:r});return new Promise((t,e)=>{a.onend=t,a.onerror=e,i.speak(a)})})(n,i,o)},a=async t=>{o||(o=!0,await n.showTalkingFace(),r(t).then(s))},s=async()=>{o&&(o=!1,await r(""),await n.showNormalFace())},c=({sentence:t})=>a(t);return{init:()=>{i.on("guideSpeaking",c)},startSpeaking:a,stopSpeaking:s,get speaking(){return o}}}({getLanguageKey:()=>m.app.language||"en-US",getSpeaker:()=>m.app.speaker||"Google US English",body:Q,chatbot:te});e.default=(({stateMachine:t,getStateMachineInput:e,body:n,speechModule:i,navigation:o,kinematics:r,userInput:a,chatbot:s,defaultConfig:c,dependencies:u})=>{const p=wt(),{emit:l}=p,h=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(p,["emit"]);let f,d=!1,y=!1;const g=async c=>{if(d&&y){const u={body:n,camera:J(),speechModule:i,navigation:o,kinematics:r,userInput:a,chatbot:s};let p=nt;const l=e(u);do{const e=t.process(l);p=await e(u)}while(p===it);n.processTick(c)}},w=async()=>{if(!d){await n.init(),i.init(),s.init();const{coreInterface:t}=u.viewarApi;"iOS"===t.platform&&(await t.call("startVoiceInput"),await t.call("stopVoiceInput")),s.on("guideSpeaking",(...t)=>l("guideSpeaking",...t)),a.on("userInput",(...t)=>l("userInput",...t)),d=!0}};return Object.assign({setup:({viewarApi:t,useExternalUpdateLoop:e=!1,queueSceneUpdate:n=(t=>t()),config:i,getPois:o=(()=>[]),modes:r=[],findPath:a=(()=>[])})=>{v()(c,i),f=!e,Object.assign(u,{viewarApi:t,queueSceneUpdate:n,getPois:o,modes:r,findPath:a,useExternalUpdateLoop:e})},init:w,start:async()=>{d||await w(),y||(f&>.start(g),y=!0,t.reset(),await n.hide())},stop:async()=>{y&&(f&>.stop(),y=!1,await n.hide())},processTick:g,get running(){return y},runsInMode:t=>u.modes.includes(t)},h,{requestGuide:a.requestGuide,dismissGuide:a.dismissGuide,pickDestination:a.pickDestination})})({body:Q,navigation:tt,kinematics:et,speechModule:ee,chatbot:te,defaultConfig:m,userInput:Ht,stateMachine:Wt,getStateMachineInput:({body:t,camera:e,navigation:n,speechModule:i,userInput:r,chatbot:a})=>{const c=new o(t.pose.position).setY(0),u=new o(e.pose.position).setY(0).clone().subtract(c),p=u.length(),l=s.fromUnitVectors(o.Z_AXIS,u.normalize()).toEulerAngles().heading,h=new s(t.pose.orientation).toEulerAngles().heading,f=Math.abs(b(h,l))<m.guideParams.maxAngularVelocity,d=p<m.guideParams.nearDistance,y=p>m.guideParams.farDistance,g=!!n.destination,w=g&&0===n.path.length,v=g&&1===n.path.length,x=i.speaking;return{destinationChosen:g,destinationReached:w,guideFacingUser:f,guideRequested:r.guideRequested,guideShouldHalt:v,guideSpeaking:x,queryUnderstood:a.queryUnderstood,userAnswered:a.userAnswered,userFar:y,userNear:d}},dependencies:Z})}]).default}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.viewarGuide=e():t.viewarGuide=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=100)}([function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(18),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e,n){(function(n){var r;e=t.exports=W,r="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var o=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,a=e.re=[],s=e.src=[],c=0,u=c++;s[u]="0|[1-9]\\d*";var p=c++;s[p]="[0-9]+";var l=c++;s[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var h=c++;s[h]="("+s[u]+")\\.("+s[u]+")\\.("+s[u]+")";var f=c++;s[f]="("+s[p]+")\\.("+s[p]+")\\.("+s[p]+")";var d=c++;s[d]="(?:"+s[u]+"|"+s[l]+")";var y=c++;s[y]="(?:"+s[p]+"|"+s[l]+")";var g=c++;s[g]="(?:-("+s[d]+"(?:\\."+s[d]+")*))";var v=c++;s[v]="(?:-?("+s[y]+"(?:\\."+s[y]+")*))";var m=c++;s[m]="[0-9A-Za-z-]+";var w=c++;s[w]="(?:\\+("+s[m]+"(?:\\."+s[m]+")*))";var b=c++,x="v?"+s[h]+s[g]+"?"+s[w]+"?";s[b]="^"+x+"$";var _="[v=\\s]*"+s[f]+s[v]+"?"+s[w]+"?",j=c++;s[j]="^"+_+"$";var z=c++;s[z]="((?:<|>)?=?)";var S=c++;s[S]=s[p]+"|x|X|\\*";var T=c++;s[T]=s[u]+"|x|X|\\*";var O=c++;s[O]="[v=\\s]*("+s[T]+")(?:\\.("+s[T]+")(?:\\.("+s[T]+")(?:"+s[g]+")?"+s[w]+"?)?)?";var A=c++;s[A]="[v=\\s]*("+s[S]+")(?:\\.("+s[S]+")(?:\\.("+s[S]+")(?:"+s[v]+")?"+s[w]+"?)?)?";var I=c++;s[I]="^"+s[z]+"\\s*"+s[O]+"$";var P=c++;s[P]="^"+s[z]+"\\s*"+s[A]+"$";var E=c++;s[E]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var M=c++;s[M]="(?:~>?)";var N=c++;s[N]="(\\s*)"+s[M]+"\\s+",a[N]=new RegExp(s[N],"g");var V=c++;s[V]="^"+s[M]+s[O]+"$";var R=c++;s[R]="^"+s[M]+s[A]+"$";var U=c++;s[U]="(?:\\^)";var k=c++;s[k]="(\\s*)"+s[U]+"\\s+",a[k]=new RegExp(s[k],"g");var D=c++;s[D]="^"+s[U]+s[O]+"$";var L=c++;s[L]="^"+s[U]+s[A]+"$";var q=c++;s[q]="^"+s[z]+"\\s*("+_+")$|^$";var $=c++;s[$]="^"+s[z]+"\\s*("+x+")$|^$";var C=c++;s[C]="(\\s*)"+s[z]+"\\s*("+_+"|"+s[O]+")",a[C]=new RegExp(s[C],"g");var G=c++;s[G]="^\\s*("+s[O]+")\\s+-\\s+("+s[O]+")\\s*$";var F=c++;s[F]="^\\s*("+s[A]+")\\s+-\\s+("+s[A]+")\\s*$";var Y=c++;s[Y]="(<|>)?=?\\s*\\*";for(var X=0;X<c;X++)r(X,s[X]),a[X]||(a[X]=new RegExp(s[X]));function Z(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof W)return t;if("string"!=typeof t)return null;if(t.length>o)return null;if(!(e.loose?a[j]:a[b]).test(t))return null;try{return new W(t,e)}catch(t){return null}}function W(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof W){if(t.loose===e.loose)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>o)throw new TypeError("version is longer than "+o+" characters");if(!(this instanceof W))return new W(t,e);r("SemVer",t,e),this.options=e,this.loose=!!e.loose;var n=t.trim().match(e.loose?a[j]:a[b]);if(!n)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<i)return e}return t}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}e.parse=Z,e.valid=function(t,e){var n=Z(t,e);return n?n.version:null},e.clean=function(t,e){var n=Z(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null},e.SemVer=W,W.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},W.prototype.toString=function(){return this.version},W.prototype.compare=function(t){return r("SemVer.compare",this.version,this.options,t),t instanceof W||(t=new W(t,this.options)),this.compareMain(t)||this.comparePre(t)},W.prototype.compareMain=function(t){return t instanceof W||(t=new W(t,this.options)),H(this.major,t.major)||H(this.minor,t.minor)||H(this.patch,t.patch)},W.prototype.comparePre=function(t){if(t instanceof W||(t=new W(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var n=this.prerelease[e],o=t.prerelease[e];if(r("prerelease compare",e,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return H(n,o)}while(++e)},W.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this},e.inc=function(t,e,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new W(t,n).inc(e,r).version}catch(t){return null}},e.diff=function(t,e){if(tt(t,e))return null;var n=Z(t),r=Z(e);if(n.prerelease.length||r.prerelease.length){for(var o in n)if(("major"===o||"minor"===o||"patch"===o)&&n[o]!==r[o])return"pre"+o;return"prerelease"}for(var o in n)if(("major"===o||"minor"===o||"patch"===o)&&n[o]!==r[o])return o},e.compareIdentifiers=H;var B=/^[0-9]+$/;function H(t,e){var n=B.test(t),r=B.test(e);return n&&r&&(t=+t,e=+e),n&&!r?-1:r&&!n?1:t<e?-1:t>e?1:0}function Q(t,e,n){return new W(t,n).compare(new W(e,n))}function K(t,e,n){return Q(t,e,n)>0}function J(t,e,n){return Q(t,e,n)<0}function tt(t,e,n){return 0===Q(t,e,n)}function et(t,e,n){return 0!==Q(t,e,n)}function nt(t,e,n){return Q(t,e,n)>=0}function rt(t,e,n){return Q(t,e,n)<=0}function ot(t,e,n,r){var o;switch(e){case"===":"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),o=t===n;break;case"!==":"object"==typeof t&&(t=t.version),"object"==typeof n&&(n=n.version),o=t!==n;break;case"":case"=":case"==":o=tt(t,n,r);break;case"!=":o=et(t,n,r);break;case">":o=K(t,n,r);break;case">=":o=nt(t,n,r);break;case"<":o=J(t,n,r);break;case"<=":o=rt(t,n,r);break;default:throw new TypeError("Invalid operator: "+e)}return o}function it(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof it){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof it))return new it(t,e);r("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===at?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}e.rcompareIdentifiers=function(t,e){return H(e,t)},e.major=function(t,e){return new W(t,e).major},e.minor=function(t,e){return new W(t,e).minor},e.patch=function(t,e){return new W(t,e).patch},e.compare=Q,e.compareLoose=function(t,e){return Q(t,e,!0)},e.rcompare=function(t,e,n){return Q(e,t,n)},e.sort=function(t,n){return t.sort(function(t,r){return e.compare(t,r,n)})},e.rsort=function(t,n){return t.sort(function(t,r){return e.rcompare(t,r,n)})},e.gt=K,e.lt=J,e.eq=tt,e.neq=et,e.gte=nt,e.lte=rt,e.cmp=ot,e.Comparator=it;var at={};function st(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof st)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new st(t.raw,e);if(t instanceof it)return new st(t.value,e);if(!(this instanceof st))return new st(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(function(t){return this.parseRange(t.trim())},this).filter(function(t){return t.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}function ct(t){return!t||"x"===t.toLowerCase()||"*"===t}function ut(t,e,n,r,o,i,a,s,c,u,p,l,h){return((e=ct(n)?"":ct(r)?">="+n+".0.0":ct(o)?">="+n+"."+r+".0":">="+e)+" "+(s=ct(c)?"":ct(u)?"<"+(+c+1)+".0.0":ct(p)?"<"+c+"."+(+u+1)+".0":l?"<="+c+"."+u+"."+p+"-"+l:"<="+s)).trim()}function pt(t,e,n){for(var o=0;o<t.length;o++)if(!t[o].test(e))return!1;if(n||(n={}),e.prerelease.length&&!n.includePrerelease){for(o=0;o<t.length;o++)if(r(t[o].semver),t[o].semver!==at&&t[o].semver.prerelease.length>0){var i=t[o].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}function lt(t,e,n){try{e=new st(e,n)}catch(t){return!1}return e.test(t)}function ht(t,e,n,r){var o,i,a,s,c;switch(t=new W(t,r),e=new st(e,r),n){case">":o=K,i=rt,a=J,s=">",c=">=";break;case"<":o=J,i=nt,a=K,s="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(lt(t,e,r))return!1;for(var u=0;u<e.set.length;++u){var p=null,l=null;if(e.set[u].forEach(function(t){t.semver===at&&(t=new it(">=0.0.0")),p=p||t,l=l||t,o(t.semver,p.semver,r)?p=t:a(t.semver,l.semver,r)&&(l=t)}),p.operator===s||p.operator===c)return!1;if((!l.operator||l.operator===s)&&i(t,l.semver))return!1;if(l.operator===c&&a(t,l.semver))return!1}return!0}it.prototype.parse=function(t){var e=this.options.loose?a[q]:a[$],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: "+t);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new W(n[2],this.options.loose):this.semver=at},it.prototype.toString=function(){return this.value},it.prototype.test=function(t){return r("Comparator.test",t,this.options.loose),this.semver===at||("string"==typeof t&&(t=new W(t,this.options)),ot(t,this.operator,this.semver,this.options))},it.prototype.intersects=function(t,e){if(!(t instanceof it))throw new TypeError("a Comparator is required");var n;if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return n=new st(t.value,e),lt(this.value,n,e);if(""===t.operator)return n=new st(this.value,e),lt(t.semver,n,e);var r=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),i=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=ot(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),c=ot(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return r||o||i&&a||s||c},e.Range=st,st.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range},st.prototype.toString=function(){return this.range},st.prototype.parseRange=function(t){var e=this.options.loose;t=t.trim();var n=e?a[F]:a[G];t=t.replace(n,ut),r("hyphen replace",t),t=t.replace(a[C],"$1$2$3"),r("comparator trim",t,a[C]),t=(t=(t=t.replace(a[N],"$1~")).replace(a[k],"$1^")).split(/\s+/).join(" ");var o=e?a[q]:a[$],i=t.split(" ").map(function(t){return function(t,e){return r("comp",t,e),t=function(t,e){return t.trim().split(/\s+/).map(function(t){return function(t,e){r("caret",t,e),e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1});var n=e.loose?a[L]:a[D];return t.replace(n,function(e,n,o,i,a){var s;return r("caret",t,e,n,o,i,a),ct(n)?s="":ct(o)?s=">="+n+".0.0 <"+(+n+1)+".0.0":ct(i)?s="0"===n?">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":">="+n+"."+o+".0 <"+(+n+1)+".0.0":a?(r("replaceCaret pr",a),"-"!==a.charAt(0)&&(a="-"+a),s="0"===n?"0"===o?">="+n+"."+o+"."+i+a+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+a+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+a+" <"+(+n+1)+".0.0"):(r("no pr"),s="0"===n?"0"===o?">="+n+"."+o+"."+i+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0"),r("caret return",s),s})}(t,e)}).join(" ")}(t,e),r("caret",t),t=function(t,e){return t.trim().split(/\s+/).map(function(t){return function(t,e){e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1});var n=e.loose?a[R]:a[V];return t.replace(n,function(e,n,o,i,a){var s;return r("tilde",t,e,n,o,i,a),ct(n)?s="":ct(o)?s=">="+n+".0.0 <"+(+n+1)+".0.0":ct(i)?s=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":a?(r("replaceTilde pr",a),"-"!==a.charAt(0)&&(a="-"+a),s=">="+n+"."+o+"."+i+a+" <"+n+"."+(+o+1)+".0"):s=">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0",r("tilde return",s),s})}(t,e)}).join(" ")}(t,e),r("tildes",t),t=function(t,e){return r("replaceXRanges",t,e),t.split(/\s+/).map(function(t){return function(t,e){t=t.trim(),e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1});var n=e.loose?a[P]:a[I];return t.replace(n,function(e,n,o,i,a,s){r("xRange",t,e,n,o,i,a,s);var c=ct(o),u=c||ct(i),p=u||ct(a),l=p;return"="===n&&l&&(n=""),c?e=">"===n||"<"===n?"<0.0.0":"*":n&&l?(u&&(i=0),p&&(a=0),">"===n?(n=">=",u?(o=+o+1,i=0,a=0):p&&(i=+i+1,a=0)):"<="===n&&(n="<",u?o=+o+1:i=+i+1),e=n+o+"."+i+"."+a):u?e=">="+o+".0.0 <"+(+o+1)+".0.0":p&&(e=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),r("xRange return",e),e})}(t,e)}).join(" ")}(t,e),r("xrange",t),t=function(t,e){return r("replaceStars",t,e),t.trim().replace(a[Y],"")}(t,e),r("stars",t),t}(t,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter(function(t){return!!t.match(o)})),i=i.map(function(t){return new it(t,this.options)},this)},st.prototype.intersects=function(t,e){if(!(t instanceof st))throw new TypeError("a Range is required");return this.set.some(function(n){return n.every(function(n){return t.set.some(function(t){return t.every(function(t){return n.intersects(t,e)})})})})},e.toComparators=function(t,e){return new st(t,e).set.map(function(t){return t.map(function(t){return t.value}).join(" ").trim().split(" ")})},st.prototype.test=function(t){if(!t)return!1;"string"==typeof t&&(t=new W(t,this.options));for(var e=0;e<this.set.length;e++)if(pt(this.set[e],t,this.options))return!0;return!1},e.satisfies=lt,e.maxSatisfying=function(t,e,n){var r=null,o=null;try{var i=new st(e,n)}catch(t){return null}return t.forEach(function(t){i.test(t)&&(r&&-1!==o.compare(t)||(o=new W(r=t,n)))}),r},e.minSatisfying=function(t,e,n){var r=null,o=null;try{var i=new st(e,n)}catch(t){return null}return t.forEach(function(t){i.test(t)&&(r&&1!==o.compare(t)||(o=new W(r=t,n)))}),r},e.validRange=function(t,e){try{return new st(t,e).range||"*"}catch(t){return null}},e.ltr=function(t,e,n){return ht(t,e,"<",n)},e.gtr=function(t,e,n){return ht(t,e,">",n)},e.outside=ht,e.prerelease=function(t,e){var n=Z(t,e);return n&&n.prerelease.length?n.prerelease:null},e.intersects=function(t,e,n){return t=new st(t,n),e=new st(e,n),t.intersects(e)},e.coerce=function(t){if(t instanceof W)return t;if("string"!=typeof t)return null;var e=t.match(a[E]);return null==e?null:Z((e[1]||"0")+"."+(e[2]||"0")+"."+(e[3]||"0"))}}).call(this,n(99))},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var r=n(34),o=n(35),i=n(36),a=n(37),s=n(38);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,n){var r=n(6);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(17),o=n(46),i=n(47),a="[object Null]",s="[object Undefined]",c=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:a:c&&c in Object(t)?o(t):i(t)}},function(t,e,n){var r=n(11)(Object,"create");t.exports=r},function(t,e,n){var r=n(61);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(32),o=n(90)(function(t,e,n){r(t,e,n)});t.exports=o},function(t,e,n){var r=n(44),o=n(51);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(7),o=n(0),i="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",c="[object Proxy]";t.exports=function(t){if(!o(t))return!1;var e=r(t);return e==a||e==s||e==i||e==c}},function(t,e,n){var r=n(20);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(12),o=n(25);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},function(t,e,n){var r=n(11)(n(1),"Map");t.exports=r},function(t,e,n){var r=n(1).Symbol;t.exports=r},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(45))},function(t,e,n){var r=n(13),o=n(6);t.exports=function(t,e,n){(void 0===n||o(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(11),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){var r=n(75)(Object.getPrototypeOf,Object);t.exports=r},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(76),o=n(3),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=c},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){var n=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},function(t,e,n){(function(t){var r=n(1),o=n(78),i="object"==typeof e&&e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;t.exports=c}).call(this,n(14)(t))},function(t,e,n){var r=n(80),o=n(81),i=n(82),a=i&&i.isTypedArray,s=a?o(a):r;t.exports=s},function(t,e){t.exports=function(t,e){return"__proto__"==e?void 0:t[e]}},function(t,e,n){var r=n(86),o=n(88),i=n(15);t.exports=function(t){return i(t)?r(t,!0):o(t)}},function(t,e){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=typeof t;return!!(e=null==e?n:e)&&("number"==o||"symbol"!=o&&r.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(33),o=n(19),i=n(65),a=n(67),s=n(0),c=n(29),u=n(28);t.exports=function t(e,n,p,l,h){e!==n&&i(n,function(i,c){if(s(i))h||(h=new r),a(e,n,c,p,t,l,h);else{var f=l?l(u(e,c),i,c+"",e,n,h):void 0;void 0===f&&(f=i),o(e,c,f)}},c)}},function(t,e,n){var r=n(4),o=n(39),i=n(40),a=n(41),s=n(42),c=n(43);function u(t){var e=this.__data__=new r(t);this.size=e.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=s,u.prototype.set=c,t.exports=u},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(5),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():o.call(e,n,1),--this.size,0))}},function(t,e,n){var r=n(5);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(5);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(5);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(4);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(4),o=n(16),i=n(52),a=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<a-1)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(12),o=n(48),i=n(0),a=n(50),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,p=c.toString,l=u.hasOwnProperty,h=RegExp("^"+p.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?h:s).test(a(t))}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(17),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[s]=n:delete t[s]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(49),o=function(){var t=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(1)["__core-js_shared__"];t.exports=r},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(53),o=n(60),i=n(62),a=n(63),s=n(64);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,n){var r=n(54),o=n(4),i=n(16);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(55),o=n(56),i=n(57),a=n(58),s=n(59);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,t.exports=c},function(t,e,n){var r=n(8);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(8),o="__lodash_hash_undefined__",i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return n===o?void 0:n}return i.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(8),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},function(t,e,n){var r=n(8),o="__lodash_hash_undefined__";t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?o:e,this}},function(t,e,n){var r=n(9);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(9);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(9);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(9);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e,n){var r=n(66)();t.exports=r},function(t,e){t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var c=a[t?s:++o];if(!1===n(i[c],c,i))break}return e}}},function(t,e,n){var r=n(19),o=n(68),i=n(69),a=n(72),s=n(73),c=n(23),u=n(24),p=n(77),l=n(26),h=n(12),f=n(0),d=n(79),y=n(27),g=n(28),v=n(83);t.exports=function(t,e,n,m,w,b,x){var _=g(t,n),j=g(e,n),z=x.get(j);if(z)r(t,n,z);else{var S=b?b(_,j,n+"",t,e,x):void 0,T=void 0===S;if(T){var O=u(j),A=!O&&l(j),I=!O&&!A&&y(j);S=j,O||A||I?u(_)?S=_:p(_)?S=a(_):A?(T=!1,S=o(j,!0)):I?(T=!1,S=i(j,!0)):S=[]:d(j)||c(j)?(S=_,c(_)?S=v(_):(!f(_)||m&&h(_))&&(S=s(j))):T=!1}T&&(x.set(j,S),w(S,j,m,b,x),x.delete(j)),r(t,n,S)}}},function(t,e,n){(function(t){var r=n(1),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=s?s(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(14)(t))},function(t,e,n){var r=n(70);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(71);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e,n){var r=n(1).Uint8Array;t.exports=r},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e,n){var r=n(74),o=n(21),i=n(22);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},function(t,e,n){var r=n(0),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(7),o=n(3),i="[object Arguments]";t.exports=function(t){return o(t)&&r(t)==i}},function(t,e,n){var r=n(15),o=n(3);t.exports=function(t){return o(t)&&r(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(7),o=n(21),i=n(3),a="[object Object]",s=Function.prototype,c=Object.prototype,u=s.toString,p=c.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!i(t)||r(t)!=a)return!1;var e=o(t);if(null===e)return!0;var n=p.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},function(t,e,n){var r=n(7),o=n(25),i=n(3),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(18),o="object"==typeof e&&e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(this,n(14)(t))},function(t,e,n){var r=n(84),o=n(29);t.exports=function(t){return r(t,o(t))}},function(t,e,n){var r=n(85),o=n(13);t.exports=function(t,e,n,i){var a=!n;n||(n={});for(var s=-1,c=e.length;++s<c;){var u=e[s],p=i?i(n[u],t[u],u,n,t):void 0;void 0===p&&(p=t[u]),a?o(n,u,p):r(n,u,p)}return n}},function(t,e,n){var r=n(13),o=n(6),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(87),o=n(23),i=n(24),a=n(26),s=n(30),c=n(27),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),p=!n&&o(t),l=!n&&!p&&a(t),h=!n&&!p&&!l&&c(t),f=n||p||l||h,d=f?r(t.length,String):[],y=d.length;for(var g in t)!e&&!u.call(t,g)||f&&("length"==g||l&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,y))||d.push(g);return d}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e,n){var r=n(0),o=n(22),i=n(89),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=o(t),n=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&n.push(s);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){var r=n(91),o=n(98);t.exports=function(t){return r(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,s&&o(n[0],n[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++r<i;){var c=n[r];c&&t(e,c,r,a)}return e})}},function(t,e,n){var r=n(31),o=n(92),i=n(94);t.exports=function(t,e){return i(o(t,e,r),t+"")}},function(t,e,n){var r=n(93),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,s=o(i.length-e,0),c=Array(s);++a<s;)c[a]=i[e+a];a=-1;for(var u=Array(e+1);++a<e;)u[a]=i[a];return u[e]=n(c),r(t,this,u)}}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(95),o=n(97)(r);t.exports=o},function(t,e,n){var r=n(96),o=n(20),i=n(31),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var n=800,r=16,o=Date.now;t.exports=function(t){var e=0,i=0;return function(){var a=o(),s=r-(a-i);if(i=a,s>0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(6),o=n(15),i=n(30),a=n(0);t.exports=function(t,e,n){if(!a(n))return!1;var s=typeof e;return!!("number"==s?o(n)&&i(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var c,u=[],p=!1,l=-1;function h(){p&&c&&(p=!1,c.length?u=c.concat(u):l=-1,u.length&&f())}function f(){if(!p){var t=s(h);p=!0;for(var e=u.length;e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,p=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new d(t,e)),1!==u.length||p||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";n.r(e);const r=2**-16;class o{static get ZERO(){return new o(0,0,0)}static get X_AXIS(){return new o(1,0,0)}static get Y_AXIS(){return new o(0,1,0)}static get Z_AXIS(){return new o(0,0,1)}static get UNIT_SCALE(){return new o(1,1,1)}constructor(...t){if(0===t.length)this.x=0,this.y=0,this.z=0;else if(1===t.length)if(t[0]&&"object"==typeof t[0]){const{x:e,y:n,z:r}=t[0];Object.assign(this,{x:e,y:n,z:r})}else{if(!(t[0]instanceof Array))throw new Error;{const[e,n,r]=t[0];Object.assign(this,{x:e,y:n,z:r})}}else{if(3!==t.length)throw new Error;{const[e,n,r]=t;Object.assign(this,{x:e,y:n,z:r})}}}set(t,e,n){return this.x=t,this.y=e,this.z=n,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}clone(){return new o(this.x,this.y,this.z)}cross(t){return Object.assign(this,{x:this.y*t.z-this.z*t.y,y:this.z*t.x-this.x*t.z,z:this.x*t.y-this.y*t.x})}scale(t){return Object.assign(this,{x:this.x*t,y:this.y*t,z:this.z*t})}add(t){return Object.assign(this,{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z})}subtract(t){return Object.assign(this,{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z})}length(){return Math.hypot(this.x,this.y,this.z)}lengthSq(){return this.x**2+this.y**2+this.z**2}invert(){return this.scale(-1)}normalize(){const t=this.length();return t?this.scale(1/t):this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}equals(t){return Math.abs(this.x-t.x)<r&&Math.abs(this.y-t.y)<r&&Math.abs(this.z-t.z)<r}rotate(t){const e=t.w*this.x+t.y*this.z-t.z*this.y,n=t.w*this.y+t.z*this.x-t.x*this.z,r=t.w*this.z+t.x*this.y-t.y*this.x,o=-t.x*this.x-t.y*this.y-t.z*this.z;return Object.assign(this,{x:e*t.w+o*-t.x+n*-t.z-r*-t.y,y:n*t.w+o*-t.y+r*-t.x-e*-t.z,z:r*t.w+o*-t.z+e*-t.y-n*-t.x})}rotateAroundVector(t,e){return this.subtract(t).rotate(e).add(t)}projectOntoVector(t){const e=t.dot(this)/t.lengthSq();return this.copy(t).scale(e)}projectOntoPlane(t){return this.subtract(i.copy(this).projectOntoVector(t.normal))}}const i=new o,a=2**-16;class s{static get IDENTITY(){return new s(1,0,0,0)}static fromAxisAngle({x:t,y:e,z:n},r){return(new s).set(Math.cos(r/2),t*Math.sin(r/2),e*Math.sin(r/2),n*Math.sin(r/2)).normalize()}fromAxisAngle({x:t,y:e,z:n},r){return this.set(Math.cos(r/2),t*Math.sin(r/2),e*Math.sin(r/2),n*Math.sin(r/2)).normalize()}static fromUnitVectors(t,e){const n=new s;let r=t.dot(e)+1;return r<a?(r=0,Math.abs(t.x)>Math.abs(t.z)?u.set(-t.y,t.x,0):u.set(0,-t.z,t.y)):u.copy(t).cross(e),n.set(r,u.x,u.y,u.z).normalize()}fromUnitVectors(t,e){let n=t.dot(e)+1;return n<a?(n=0,Math.abs(t.x)>Math.abs(t.z)?u.set(-t.y,t.x,0):u.set(0,-t.z,t.y)):u.copy(t).cross(e),this.set(n,u.x,u.y,u.z).normalize()}constructor(...t){if(0===t.length)this.w=1,this.x=0,this.y=0,this.z=0;else if(1===t.length)if(t[0]&&"object"==typeof t[0])this.w=t[0].w,this.x=t[0].x,this.y=t[0].y,this.z=t[0].z;else{if(!(t[0]instanceof Array))throw new Error;this.w=t[0][0],this.x=t[0][1],this.y=t[0][2],this.z=t[0][3]}else{if(4!==t.length)throw new Error;this.w=t[0],this.x=t[1],this.y=t[2],this.z=t[3]}}set(t,e,n,r){return this.w=t,this.x=e,this.y=n,this.z=r,this}copy(t){return this.w=t.w,this.x=t.x,this.y=t.y,this.z=t.z,this}clone(){return new s(this.w,this.x,this.y,this.z)}multiply(t){return Object.assign(this,{w:this.w*t.w-this.x*t.x-this.y*t.y-this.z*t.z,x:this.w*t.x+this.x*t.w+this.y*t.z-this.z*t.y,y:this.w*t.y+this.y*t.w+this.z*t.x-this.x*t.z,z:this.w*t.z+this.z*t.w+this.x*t.y-this.y*t.x})}lengthSquared(){return this.w**2+this.x**2+this.y**2+this.z**2}length(){return Math.hypot(this.w,this.x,this.y,this.z)}normalize(){const t=this.lengthSquared();if(Math.abs(t-1)<a)return this;{const e=Math.sqrt(t);return Object.assign(this,{w:this.w/e,x:this.x/e,y:this.y/e,z:this.z/e})}}invert(){return this.conjugate()}conjugate(){return Object.assign(this,{w:this.w,x:-this.x,y:-this.y,z:-this.z})}dot(t){return this.w*t.w+this.x*t.x+this.y*t.y+this.z*t.z}equals(t){return Math.abs(Math.abs(this.dot(t))-1)<a}toAxisAngle(){const{w:t,x:e,y:n,z:r}=this,i=2*Math.acos(t),s=Math.sqrt(1-t**2);return{angle:i,axis:s<a?new o(1,0,0):new o(e/s,n/s,r/s)}}toAngleAround(t){const e=0!==(t=t.clone().normalize()).y||0!==t.z?new o(0,-t.z,t.y):new o(-t.z,0,t.x),n=e.clone().rotate(this),r=n.clone().subtract(t.clone().scale(n.dot(t))).normalize();return Math.acos(e.dot(r))}toEulerAngles(){const t=this.x*this.y+this.z*this.w;if(t>.499){return{heading:2*Math.atan2(this.x,this.w),bank:0,attitude:Math.PI/2}}if(t<-.499){return{heading:-2*Math.atan2(this.x,this.w),bank:0,attitude:-Math.PI/2}}const e=this.x*this.x,n=this.y*this.y,r=this.z*this.z;let o=Math.atan2(2*this.y*this.w-2*this.x*this.z,1-2*n-2*r),i=Math.asin(2*t);return{heading:o,bank:Math.atan2(2*this.x*this.w-2*this.y*this.z,1-2*e-2*r),attitude:i}}slerp(t,e){const n=this,r=this;if(0===e)return n;if(1===e)return n.copy(t);let o=r.dot(t);if(o<0&&((t=c.copy(t)).w=-t.w,t.x=-t.x,t.y=-t.y,t.z=-t.z,o=-o),o>=1)return n;const i=Math.sqrt(1-o**2);if(Math.abs(i)<.001)return n.w=.5*(r.w+t.w),n.x=.5*(r.x+t.x),n.y=.5*(r.y+t.y),n.z=.5*(r.z+t.z),n;const a=Math.atan2(i,o),s=Math.sin((1-e)*a)/i,u=Math.sin(e*a)/i;return n.w=r.w*s+t.w*u,n.x=r.x*s+t.x*u,n.y=r.y*s+t.y*u,n.z=r.z*s+t.z*u,n}}const c=new s,u=new o,p=(new o,new o,Object.freeze({pose:{position:{x:NaN,y:NaN,z:NaN},orientation:{w:NaN,x:NaN,y:NaN,z:NaN},scale:{x:NaN,y:NaN,z:NaN}}})),l=Object.freeze({translation:!1,rotation:!1,scaling:!1}),h=(Object.freeze({translation:!0,rotation:!1,scaling:!1}),Object.freeze({pose:{position:{x:0,y:1e5,z:0},orientation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},interaction:l,visible:!1})),f=1e3/30,d=2*Math.PI,y=d/2,g=Object.freeze({app:{admin:!1,usePoiImages:!1,userAvoidanceEnabled:!1,showTargetNotification:!1,visualizeQrCodes:!1,defaultUser:"tempuser",initialProject:null,projectId:"guidebot-978f7",language:"en-US",viewDistance:2e4},debug:{debugStateMachine:!1,showRobotHelpers:!1,exposeServices:!1,showDebugOutput:!1,showGraphDuringNavigation:!1,showReplayControls:!1},models:{qr:"guidebot_qrcode",guide:"guidebot_robot_v4",reticule:"guidebot_reticule",poi:"guidebot_poi",path:"guidebot_path",waypoint:"guidebot_waypoint"},fallbackModels:{qr:"55563",guide:"56664",reticule:"54428",poi:"54426",path:"54429",waypoint:"54383"},guideParams:{spawnDistance:2e3,nearDistance:2e3,farDistance:4e3,minProximityRadius:100,verticalCutoff:2e3,maxLinearVelocity:1e3/30,maxAngularVelocity:d/3/30,linearAcceleration:1e3/30/30},text:{greetUser:"Hi there! How can I help you?",followMe:"Sure, follow me!",selectPoi:"Hi there! Please select a point of interest."}});var v=n(10),m=n.n(v),w=m()({},g);const b=(t,e=.001)=>t>-e&&t<e?0:t;function x(t,e){const n=e-t;return Math.atan2(Math.sin(n),Math.cos(n))}function _(t,e,n){return Math.min(Math.max(t,e),n)}var j=t=>new Promise(e=>setTimeout(e,t));function z(t,e=10){const n=new Array(e).fill(null).map(()=>t()),r=[];return{get:function(){0===n.length&&console.info("Object pool exhausted, populating...");const e=n.pop()||t();return r.push(e),e},release:function(){for(;r.length;)n.push(r.pop())},get usage(){return r.length}}}const{X_AXIS:S,Y_AXIS:T,Z_AXIS:O,ZERO:A}=o,{IDENTITY:I}=s;[S,T,O,A,I].forEach(Object.freeze);const P=z(()=>new o,20),E=z(()=>new s,20),M=()=>{P.release(),E.release()},N=(t=A)=>P.get().copy(t),V=(t,e)=>N(e).subtract(t),R=t=>N(O).rotate(t),U=(t=I)=>E.get().copy(t),k=t=>U().fromUnitVectors(N(O).normalize(),N(t).normalize()),D=t=>t.pose.position,L=t=>t.toEulerAngles().heading,q=({maxAngularVelocity:t},e,n,r)=>{const o=V(e.position,D(n)).setY(0),i=k(o),a=x(L(e.orientation),L(i)),s=Math.sign(b(a)),c=a*s;e.angularVelocity=s*t,e.angularDeviation=c,e.targetOrientation=i;const u=V(D(n),e.position).setY(0),p=V(D(n),D(r)).setY(0);e.curveAngle=L(((t,e)=>U().fromUnitVectors(N(t).normalize(),N(e).normalize()))(u,p))},$=({linearAcceleration:t,maxLinearVelocity:e},n,r,o)=>{n.linearVelocity<n.targetLinearVelocity?n.linearVelocity=_(n.linearVelocity+t,0,n.targetLinearVelocity):n.linearVelocity=_(n.linearVelocity-t,n.targetLinearVelocity,e)},C=({maxLinearVelocity:t},e,n,r)=>{e.targetLinearVelocity=t*_((y-e.angularDeviation)/y,0,1)};function G(t,e,[n,r]){q(t,e,n,r),C(t,e,n,r),$(t,e,n,r),M()}const F=({linearAcceleration:t,maxLinearVelocity:e},n,r)=>{const o=V(n.position,D(r)).setY(0),i=k(o),a=x(L(n.orientation),L(i)),s=a*Math.sign(b(a));n.linearVelocity=e*_(1-s/Math.PI,0,1),n.angularDeviation=s,n.targetOrientation=i,n.curveAngle=Math.PI},Y=({maxAngularVelocity:t},e,n)=>{const r=V(e.position,D(n)).setY(0),o=k(r),i=x(L(e.orientation),L(o)),a=Math.sign(b(i)),s=i*a;e.angularVelocity=_(s/t,0,t)*a};function X(t,e,[n]){F(t,e,n),Y(t,e,n),M()}var Z={viewarApi:{}};class W{constructor({position:t=o.ZERO,orientation:e=s.IDENTITY,scale:n=o.UNIT_SCALE}={}){this.position=o.ZERO.copy(t),this.orientation=s.IDENTITY.copy(e),this.scale=o.UNIT_SCALE.copy(n)}copy(t){this.position.copy(t.position),this.orientation.copy(t.orientation),this.scale.copy(t.scale)}}const B={ViewARRobotVideoDisplay:"RobotFaceTalk"},H={ViewARRobotVideoDisplay:"RobotFaceNeutral"};var Q=function({insertGuide:t,setAnimationState:e,addToPoseUpdateQueue:n}){let r=null,i=!1;const a={position:o.ZERO,orientation:s.IDENTITY,scale:o.UNIT_SCALE};let c=0,u=[];return{init:async()=>r=await Z.queueSceneUpdate(t),showTalkingFace:()=>Z.queueSceneUpdate(()=>r.setPropertyValues(B)),showNormalFace:()=>Z.queueSceneUpdate(()=>r.setPropertyValues(H)),show:()=>Z.queueSceneUpdate(()=>r.setVisible(!0)),hide:()=>Z.queueSceneUpdate(()=>r.setVisible(!1)),setPose:async t=>{t.position&&a.position.copy(t.position),t.orientation&&a.orientation.copy(t.orientation),t.scale&&a.scale.copy(t.scale),i||await r.setPose(a)},processTick:()=>{i&&(u.push(Object.assign(new W(a),{durationInSeconds:1/30})),(c+=1)%3==0&&(n(r.id,u),u=[]))},animate:async t=>{const n=(()=>{const t={};for(const e of Object.keys(r.animations))t[e]={enabled:!1,time:0,loop:!1}})();e({[r.id]:Object.assign({},n,t)})},startPoseUpdate:()=>{u=[],i=!0},stopPoseUpdate:()=>i=!1,get animations(){return r.animations},get model(){return r.model},get pose(){return a},get initialized(){return!!r}}}({insertGuide:async()=>{const{sceneManager:t,modelManager:e}=Z.viewarApi,n=await t.insertContainer(h),r=w.models.guide,o=e.findModelById(r)||e.findModelByForeignKey(r)||await e.getModelFromRepository(w.fallbackModels.guide),i=await t.insertModel(o,{parent:n});return await async function(t){}(),Object.defineProperties(n,{model:{value:i.model,enumerable:!0},animations:{value:i.animations,enumerable:!0},setPropertyValues:{value:i.setPropertyValues,enumerable:!0},propertyValues:{get:()=>i.propertyValues,enumerable:!0}}),n.animations.FlyOut.start({time:0,loop:!1},!0),await n.setVisible(!1),n},setAnimationState:(...t)=>Z.viewarApi.coreInterface.call("setAnimationStatus",...t),addToPoseUpdateQueue:(...t)=>Z.viewarApi.coreInterface.call("addToPoseUpdateQueue",...t),clearPoseUpdateQueue:(...t)=>Z.viewarApi.coreInterface.call("clearPoseUpdateQueue",...t)});const K=new o;var J=()=>{const t=Z.viewarApi.cameras;for(let e of Object.values(t))if(e.active)return e};var tt=function({findPathToPoi:t}){let e=null,n=[];const r=()=>e&&n[0]||p;return{chooseDestination:r=>{r&&r!==e&&(n=t(e=r))},clearDestination:()=>{e=null,n=[]},update:(t,e)=>{r()&&K.copy(r().pose.position).subtract(t).setY(0).length()<=e&&n.shift()},hasCurrentWaypoint:()=>!(!e||!n[0]),hasNextWaypoint:()=>!(!e||!n[1]),get currentWaypoint(){return r()},get nextWaypoint(){return e&&n[1]||p},get path(){return n},get destination(){return e}}}({findPathToPoi:t=>Z.findPath(J(),t)});var et=(({body:t,navigation:e,getGuideParams:n})=>{const r={linearVelocity:0,targetLinearVelocity:0,angularVelocity:0,targetAngularVelocity:0,targetOrientation:s.IDENTITY,proximityRadius:0,curveAngle:0,angularDeviation:0,position:o.ZERO,orientation:s.IDENTITY,scale:o.UNIT_SCALE,forward:o.Z_AXIS},i=({maxAngularVelocity:t},e)=>{if(e.angularDeviation>t){const t=(t=>E.get().fromAxisAngle(T,t))(e.angularVelocity);e.orientation.multiply(t),e.forward.rotate(t)}else e.orientation.copy(e.targetOrientation),e.forward.copy(R(e.targetOrientation))},a=o=>async()=>{const a=n();r.position.copy(t.pose.position),r.orientation.copy(t.pose.orientation),r.scale.copy(t.pose.scale),o(a,r,e.path),i(a,r),((t,e)=>{const n=R(e.orientation).scale(e.linearVelocity);e.position.add(n)})(0,r),(({maxLinearVelocity:t,maxAngularVelocity:e},n)=>{const r=t/(2*Math.sin(e)*Math.sin(n.curveAngle/2));n.proximityRadius=Math.max(r,t)})(a,r),e.update(r.position,r.proximityRadius),t.setPose(r)};return{get state(){return r},arrive:a(X),followPath:a(G)}})({body:Q,navigation:tt,getGuideParams:()=>w.guideParams});const nt=Symbol(),rt=Symbol(),ot=(t,e={time:0,loop:!1},n=!1)=>Promise.all([t.start(e,n),j(1e3*t.duration)]),it=async()=>nt,at=async({body:t,camera:e})=>{const n=(await e.getPoseInViewingDirection(w.guideParams.spawnDistance,!0)).position;n.y=e.pose.position.y-1e3;const r=new o(e.pose.position).subtract(n).setY(0).normalize(),i=s.fromUnitVectors(o.Z_AXIS,r.normalize());return await t.setPose({position:n,orientation:i}),await Promise.all([ot(t.animations.FlyIn,{time:0,loop:!1},!0),t.show()]),t.startPoseUpdate(),rt},st=async({body:t})=>(t.stopPoseUpdate(),await ot(t.animations.FlyOut,{time:0,loop:!1},!0),await t.hide(),rt);let ct=void 0;const ut=async({body:t,camera:e})=>(await lt(t,e),nt);let pt=void 0;const lt=async(t,e,n)=>{const r=new o(e.pose.position).subtract(t.pose.position).setY(0).normalize();return await ht(t,s.fromUnitVectors(o.Z_AXIS,r),n),nt},ht=async(t,e,n)=>{const r=x(new s(t.pose.orientation).toEulerAngles().heading,e.toEulerAngles().heading);if(n=n||Math.sign(r),Math.abs(Math.abs(r)-w.guideParams.maxAngularVelocity)>w.guideParams.maxAngularVelocity){const e=s.fromAxisAngle(o.Y_AXIS,n*w.guideParams.maxAngularVelocity);t.setPose({orientation:new s(t.pose.orientation).multiply(e)})}else pt=void 0,t.setPose({orientation:e});return nt},ft=new Map,dt=t=>new Promise(e=>setTimeout(e,t));const yt=t=>{ft.has(t)||ft.set(t,Promise.resolve().then(()=>(async function(t){const e=Date.now(),n={startTime:e,idealTime:e,lastTime:e,actualTime:e,difference:0,timeElapsed:0,frameNumber:0,frameLength:f};for(;ft.has(t);)n.frameNumber+=1,n.frameLength=f,n.actualTime=Date.now(),n.idealTime+=n.frameLength,n.difference=n.actualTime-n.idealTime,n.timeElapsed=n.actualTime-n.lastTime,n.lastTime=n.actualTime,t(Object.assign({},n)),await dt(n.frameLength-n.difference)})(t)))};var gt=(()=>{let t=!1,e=!1,n=()=>{};const r=async t=>{if(!e)try{e=!0,n(t)}catch(t){console.error(t)}finally{e=!1}};return{start:async(e=(()=>{}))=>{n=e,t||(t=!0,yt(r))},stop:async()=>{t&&(t=!1,await(async t=>{const e=ft.get(t)||Promise.resolve();ft.delete(t),await e})(r))}}})(),vt=n(2),mt=n.n(vt);function wt(){const t={},e=(e,n)=>(t[e]=t[e]||new Set).add(n),n=(e,n)=>n?t[e].delete(n):t[e].clear();return{on:e,off:n,once:(t,r)=>{const o=(...e)=>{r(...e),n(t,o)};e(t,o)},emit:(e,...n)=>(t[e]||[]).forEach(t=>t(...n))}}const bt=({initialState:t,finalStates:e=[],getNextState:n})=>{e=new Set(e);let r=t;return{get done(){return e.has(r)},get currentState(){return r},reset:()=>void(r=t),process:t=>(r.done?(r=n(r,t)).reset():r.process(t),r.output),getDebug:()=>r.getDebug()}},xt=({name:t,output:e})=>({name:t,output:e,done:!0,process:()=>{},reset:()=>{},getDebug:()=>t}),_t=({name:t,stateMachine:e})=>({name:t,get output(){return e.currentState.output},get done(){return e.done},process:t=>e.process(t),reset:()=>e.reset(),getDebug:()=>[t,e.getDebug()].join(" >> ")}),jt=xt({name:"TELEPORT_TO_USER",output:at}),zt=xt({name:"IDLE",output:it}),St=xt({name:"TELEPORT_AWAY",output:st});var Tt=_t({name:"HIDDEN",stateMachine:bt({initialState:St,finalStates:[jt],getNextState:(t,{guideRequested:e})=>{switch(t){case St:case zt:return e?jt:zt;case jt:return jt;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const Ot=xt({name:"GREET_USER_STATE",output:async({body:t,chatbot:e,userInput:n})=>(e.greetUser(n.greetMessage),await j(250),await ot(t.animations.Wave,{time:0,loop:!1},!0),await j(33),t.animations.Idle.start({time:0,loop:!0},!0),n.startListening(),nt)}),At=xt({name:"LISTEN",output:ut}),It=xt({name:"DONE",output:async({body:t,userInput:e})=>(t.animate({}),e.stopListening(),rt)});var Pt=_t({name:"TALKING",stateMachine:bt({initialState:Ot,finalStates:[It],getNextState:(t,{guideRequested:e,userAnswered:n,queryUnderstood:r,destinationChosen:o})=>{switch(t){case Ot:return e?At:It;case At:return e?o?It:r?It:At:It;case It:return It;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const Et=xt({name:"START_HOVERING",output:async({body:t})=>(t.animations.Idle.start({time:0,loop:!0},!0),nt)}),Mt=xt({name:"STOP_HOVERING",output:async({body:t})=>(t.animations.Idle.stop(),rt)}),Nt=xt({name:"TURN_TO_USER",output:ut});var Vt=_t({name:"WAITING",stateMachine:bt({initialState:Et,finalStates:[Mt],getNextState:(t,{guideRequested:e,userNear:n,destinationChanged:r})=>{switch(t){case Et:return Nt;case Nt:return e?r?Mt:n?Mt:Nt:Mt;case Mt:return Mt;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const Rt=xt({name:"START_MOVING",output:async({body:t})=>(t.animations.ForwardIn.start({time:0,loop:!1},!0),nt)}),Ut=xt({name:"FOLLOW_PATH_STATE",output:()=>(et.followPath(),nt)}),kt=xt({name:"ARRIVE_STATE",output:()=>(et.arrive(),nt)}),Dt=xt({name:"STOP_MOVING",output:async({body:t})=>(await ot(t.animations.ForwardOut,{time:0,loop:!1},!0),rt)});var Lt=_t({name:"GUIDING",stateMachine:bt({initialState:Rt,finalStates:[Dt],getNextState:(t,{guideRequested:e,userFar:n,destinationChanged:r,destinationReached:o,guideShouldHalt:i})=>{switch(t){case Rt:case Ut:return e?n?Dt:i?kt:Ut:Dt;case kt:return e?n?Dt:o?Dt:kt:Dt;case Dt:return Dt;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const qt=xt({name:"TURN_TO_PRESENT",output:async({body:t,camera:e,navigation:n})=>{const r=new o(o.Z_AXIS).rotate(new s(t.pose.orientation)).setY(0),i=new o(n.destination.pose.position).subtract(t.pose.position).setY(0);return pt=pt||s.fromUnitVectors(r.normalize(),i.normalize()).toEulerAngles().heading,await lt(t,e,Math.sign(pt)),nt}}),$t=xt({name:"POINT_TOWARD_POI",output:async({body:t,camera:e,navigation:n})=>{const r=new o(n.destination.pose.position).subtract(t.pose.position),i=new o(e.pose.position).subtract(t.pose.position),a=s.fromUnitVectors(i.normalize(),r.normalize()).toEulerAngles().heading;return ct||(ct=a>0^["guidebot_robot_v2","guidebot_robot_v3","guidebot_robot_v4"].includes(t.model.foreignKey)?"Right":"Left"),await ot(t.animations[`Point${ct}In`],{time:0,loop:!1},!0),nt}}),Ct=xt({name:"START_PRESENTING_STATE",output:async({chatbot:t})=>(t.presentDestination(),nt)}),Gt=xt({name:"PRESENT_POI",output:it}),Ft=xt({name:"STOP_PRESENTING",output:async({speechModule:t,navigation:e,userInput:n})=>(e.clearDestination(),t.stopSpeaking(),n.dismissGuide(),nt)}),Yt=xt({name:"PUT_DOWN_HAND",output:async({body:t})=>(ct&&(await ot(t.animations[`Point${ct}Out`],{time:0,loop:!1},!0),ct=void 0),await j(1e3),rt)});var Xt=_t({name:"PRESENTING",stateMachine:bt({initialState:qt,finalStates:[Yt],getNextState:(t,{guideRequested:e,guideFacingUser:n,destinationChanged:r,guideSpeaking:o})=>{switch(t){case qt:return n?$t:qt;case $t:return e?r?Yt:Ct:Yt;case Ct:return e?Gt:Yt;case Gt:return e?r?Ft:o?Gt:Ft:Yt;case Ft:case Yt:return Yt;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});const Zt=xt({name:"TELEPORT_TO_USER",output:at}),Wt=xt({name:"TELEPORT_AWAY",output:st});var Bt=_t({name:"RECALIBRATE",stateMachine:bt({initialState:Wt,finalStates:[Zt],getNextState:(t,{})=>{switch(t){case Wt:case Zt:return Zt;default:throw new Error(`Unrecognized state: ${t?t.name:t}`)}}})});var Ht=bt({initialState:Tt,finalStates:[],getNextState:(({hidden:t,talking:e,waiting:n,guiding:r,presenting:o})=>(i,a)=>{const{guideRequested:s,destinationChosen:c,userNear:u,userFar:p,destinationReached:l,guideSpeaking:h,recalibrationRequested:f}=a;switch(i){case t:return s?e:t;case e:return s?c&&l?o:c&&!l?r:e:t;case r:return s?p?n:!u&&l?n:u&&l?o:f?Bt:r:t;case n:return s?u&&l?o:u&&!l?r:f?Bt:n:t;case Bt:return r;case o:return s&&h?o:t;default:throw new Error(`Unrecognized state: ${i?i.name:i}`)}})({hidden:Tt,talking:Pt,waiting:Vt,guiding:Lt,presenting:Xt})});var Qt=function({getGreetMessage:t,navigation:e}){const n=wt(),{emit:r}=n,o=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(n,["emit"]);let i=!1,a=!1,s=!1,c=()=>{},u=t();const p=t=>(function(t){i&&r("userInput",{speaker:"user",sentence:t})})(t);return Object.assign({startListening:async function(){if(w.app.speechDisabled)return;const{coreInterface:t,versionInfo:e}=Z.viewarApi;"iOS"===t.platform&&(a=!1,i=!0,t.on("speechToText",p),mt.a.satisfies(e.core,"^11.17.5")?await t.call("startVoiceInput",{}):await t.call("startVoiceInput"),await new Promise(e=>t.once("speechToText",t=>e(t))),a=!0)},stopListening:l,pickDestination:function(t){r("userInput",{destination:t})},requestGuide:function(e=(()=>{}),n=t()){u=n,c=e,s=!0},dismissGuide:function(){s=!1,e.clearDestination(),l(),c()},get userAnswered(){return a},get guideRequested(){return s},get greetMessage(){return u}},o);async function l(){if(w.app.speechDisabled)return;const{coreInterface:t}=Z.viewarApi;i=!1,a=!1,"iOS"===t.platform&&(t.off("speechToText",p),await t.call("stopVoiceInput"))}}({navigation:tt,getGreetMessage:()=>w.text.greetUser}),Kt=()=>Math.random().toString(36).slice(2);const Jt=t=>`https://dialogflow.googleapis.com/v2/projects/${w.app.projectId}/agent/sessions/${t}:detectIntent`,te=()=>fetch(`https://www.viewar.com/proxy.php?url=http://test2.3.viewar.com/guidebot/key.php?cache_bust=${Date.now()}`).then(t=>t.text()).then(t=>t.trim()),ee=(t,e)=>({queryParams:{},queryInput:{text:{text:t,languageCode:e}}});var ne=function({navigation:t,userInput:e,sendQuery:n,findDestination:r,getText:o}){const i=wt(),{emit:a}=i,s=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(i,["emit"]);let c=!1,u=!1,p=null;return Object.assign({init:function(){e.on("userInput",l)},greetUser:function(t){p=Kt(),c=!1,u=!1,a("guideSpeaking",{speaker:"guide",sentence:t})},presentDestination:function(){a("guideSpeaking",{speaker:"guide",sentence:t.destination?t.destination.data.description||t.destination.data.name:""})},get queryUnderstood(){return c},get userAnswered(){return u}},s);async function l({sentence:e,destination:i}){if(u=!0,i)c=!0,t.chooseDestination(i),a("guideSpeaking",{speaker:"guide",sentence:o("followMe")});else{const{fulfillmentText:o,parameters:i}=await n(p,e),s=Object.values(i)[0];if(s){const e=r(s);e&&(c=!0,t.chooseDestination(e))}a("guideSpeaking",{speaker:"guide",sentence:o})}}}({navigation:tt,userInput:Qt,findDestination:t=>Z.getPois().find(e=>e.data&&e.data.name.toLowerCase()===t.toLowerCase()),sendQuery:async function(t,e){return w.app.chatbotUrl?await async function(t,e,n){const{appConfig:r}=Z.viewarApi,o=new FormData;o.append("data",JSON.stringify({text:n,language:w.app.language,appId:r.appId,version:r.version.app,sessionId:e}));const i=await fetch(t,{method:"POST",body:o}).then(t=>t.json()),{error:a,queryResult:s}=i;if(a)throw alert(a.message),new Error(a.message);return s}(w.app.chatbotUrl,t,e):await async function(t,e){const n=await te(),{error:r,queryResult:o}=await fetch(Jt(t),{method:"POST",headers:{Accept:"application/json",Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify(ee(e,w.app.language))}).then(t=>t.json());if(r)throw alert(r.message),new Error(r.message);return o}(t,e)},getText:t=>w.text[t]});var re=function({getLanguageKey:t,getSpeaker:e,body:n,chatbot:r}){let o=!1;const i=async(n,r=e(),o=t())=>{const{coreInterface:i,versionInfo:a}=Z.viewarApi;"iOS"===i.platform||"Android"===i.platform?(await i.call("stopVoiceInput"),await i.call("textToSpeech",n,{name:r,lang:o}),mt.a.satisfies(a.core,"^11.17.5")?await i.call("startVoiceInput",{}):await i.call("startVoiceInput")):await(async(t,e,n)=>{let r=window.speechSynthesis,o=window.SpeechSynthesisUtterance;const i=r.getVoices().find(t=>t.name===e)||r.getVoices().find(t=>t.lang===n),a=Object.assign(new o,{text:t,lang:n,voice:i});return new Promise((t,e)=>{a.onend=t,a.onerror=e,r.speak(a)})})(n,r,o)},a=async t=>{o||(o=!0,await n.showTalkingFace(),i(t).then(s))},s=async()=>{o&&(o=!1,await i(""),await n.showNormalFace())},c=({sentence:t})=>a(t);return{init:()=>{r.on("guideSpeaking",c)},startSpeaking:a,stopSpeaking:s,get speaking(){return o}}}({getLanguageKey:()=>w.app.language||"en-US",getSpeaker:()=>w.app.speaker||"Google US English",body:Q,chatbot:ne});e.default=(({stateMachine:t,getStateMachineInput:e,body:n,speechModule:r,navigation:o,kinematics:i,userInput:a,chatbot:s,defaultConfig:c,dependencies:u})=>{const p=wt(),{emit:l}=p,h=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(p,["emit"]);let f,d=!1,y=!1;const g=async c=>{if(d&&y){const u={body:n,camera:J(),speechModule:r,navigation:o,kinematics:i,userInput:a,chatbot:s};let p=nt;const l=e(u);do{const e=t.process(l);p=await e(u)}while(p===rt);n.processTick(c)}},v=async()=>{if(!d){await n.init(),r.init(),s.init();const{coreInterface:t,versionInfo:e}=u.viewarApi;"iOS"!==t.platform&&"Android"!==t.platform||(mt.a.satisfies(e.core,"^11.17.5")?await t.call("startVoiceInput",{}):await t.call("startVoiceInput"),await t.call("stopVoiceInput")),s.on("guideSpeaking",(...t)=>l("guideSpeaking",...t)),a.on("userInput",(...t)=>l("userInput",...t)),d=!0}};return Object.assign({setup:({viewarApi:t,useExternalUpdateLoop:e=!1,queueSceneUpdate:n=(t=>t()),config:r,getPois:o=(()=>[]),modes:i=[],findPath:a=(()=>[])})=>{m()(c,r),f=!e,Object.assign(u,{viewarApi:t,queueSceneUpdate:n,getPois:o,modes:i,findPath:a,useExternalUpdateLoop:e})},init:v,start:async()=>{d||await v(),y||(f&>.start(g),y=!0,t.reset(),await n.hide())},stop:async()=>{y&&(f&>.stop(),y=!1,await n.hide())},processTick:g,get running(){return y},runsInMode:t=>u.modes.includes(t)},h,{requestGuide:a.requestGuide,dismissGuide:a.dismissGuide,pickDestination:a.pickDestination})})({body:Q,navigation:tt,kinematics:et,speechModule:re,chatbot:ne,defaultConfig:w,userInput:Qt,stateMachine:Ht,getStateMachineInput:({body:t,camera:e,navigation:n,speechModule:r,userInput:i,chatbot:a})=>{const c=new o(t.pose.position).setY(0),u=new o(e.pose.position).setY(0).clone().subtract(c),p=u.length(),l=s.fromUnitVectors(o.Z_AXIS,u.normalize()).toEulerAngles().heading,h=new s(t.pose.orientation).toEulerAngles().heading,f=Math.abs(x(h,l))<w.guideParams.maxAngularVelocity,d=p<w.guideParams.nearDistance,y=p>w.guideParams.farDistance,g=!!n.destination,v=g&&0===n.path.length,m=g&&1===n.path.length,b=r.speaking;return{destinationChosen:g,destinationReached:v,guideFacingUser:f,guideRequested:i.guideRequested,guideShouldHalt:m,guideSpeaking:b,queryUnderstood:a.queryUnderstood,userAnswered:a.userAnswered,userFar:y,userNear:d}},dependencies:Z})}]).default}); |
{ | ||
"name": "viewar-guide", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "ViewAR Guide", | ||
@@ -52,3 +52,5 @@ "main": "dist/viewar-guide.min.js", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"semver": "^5.6.0" | ||
}, | ||
"files": [ | ||
@@ -55,0 +57,0 @@ "dist/viewar-guide.min.js" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
61927
1
+ Addedsemver@^5.6.0
+ Addedsemver@5.7.2(transitive)