@pitcher/js-api 1.20.0 → 1.21.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js-api.umd.min.js +10 -10
- package/js-api.umd.min.js.map +1 -1
- package/package.json +1 -1
package/js-api.umd.min.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
(function(E,Se){typeof exports=="object"&&typeof module<"u"?Se(exports):typeof define=="function"&&define.amd?define(["exports"],Se):(E=typeof globalThis<"u"?globalThis:E||self,Se(E.pitcher={}))})(this,function(E){"use strict";function Se(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const h in s)if(h!=="default"&&!(h in e)){const y=Object.getOwnPropertyDescriptor(s,h);y&&Object.defineProperty(e,h,y.get?y:{enumerable:!0,get:()=>s[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var
|
|
2
|
-
`;function P(t){return t===void 0&&(t=window),t.location.protocol}function I(t){if(t===void 0&&(t=window),t.mockDomain){var o=t.mockDomain.split("//")[0];if(o)return o}return P(t)}function F(t){return t===void 0&&(t=window),I(t)==="about:"}function Q(t){if(t===void 0&&(t=window),t)try{if(t.parent&&t.parent!==t)return t.parent}catch{}}function re(t){if(t===void 0&&(t=window),t&&!Q(t))try{return t.opener}catch{}}function le(t){try{return!0}catch{}return!1}function he(t){t===void 0&&(t=window);var o=t.location;if(!o)throw new Error("Can not read window location");var n=P(t);if(!n)throw new Error("Can not read window protocol");if(n==="file:")return"file://";if(n==="about:"){var i=Q(t);return i&&le()?he(i):"about://"}var u=o.host;if(!u)throw new Error("Can not read window host");return n+"//"+u}function q(t){t===void 0&&(t=window);var o=he(t);return o&&t.mockDomain&&t.mockDomain.indexOf("mock:")===0?t.mockDomain:o}function X(t){if(!function(o){try{if(o===window)return!0}catch{}try{var n=Object.getOwnPropertyDescriptor(o,"location");if(n&&n.enumerable===!1)return!1}catch{}try{if(F(o)&&le())return!0}catch{}try{if(function(i){return i===void 0&&(i=window),I(i)==="mock:"}(o)&&le())return!0}catch{}try{if(he(o)===he(window))return!0}catch{}return!1}(t))return!1;try{if(t===window||F(t)&&le()||q(window)===q(t))return!0}catch{}return!1}function H(t){if(!X(t))throw new Error("Expected window to be same domain");return t}function k(t,o){if(!t||!o)return!1;var n=Q(o);return n?n===t:function(i){var u=[];try{for(;i.parent!==i;)u.push(i.parent),i=i.parent}catch{}return u}(o).indexOf(t)!==-1}function fr(t){var o=[],n;try{n=t.frames}catch{n=t}var i;try{i=n.length}catch{}if(i===0)return o;if(i){for(var u=0;u<i;u++){var c=void 0;try{c=n[u]}catch{continue}o.push(c)}return o}for(var f=0;f<100;f++){var p=void 0;try{p=n[f]}catch{return o}if(!p)return o;o.push(p)}return o}var Cf=[],Df=[];function Z(t,o){o===void 0&&(o=!0);try{if(t===window)return!1}catch{return!0}try{if(!t)return!0}catch{return!0}try{if(t.closed)return!0}catch(u){return!u||u.message!==_}if(o&&X(t))try{if(t.mockclosed)return!0}catch{}try{if(!t.parent||!t.top)return!0}catch{}var n=function(u,c){for(var f=0;f<u.length;f++)try{if(u[f]===c)return f}catch{}return-1}(Cf,t);if(n!==-1){var i=Df[n];if(i&&function(u){if(!u.contentWindow||!u.parentNode)return!0;var c=u.ownerDocument;if(c&&c.documentElement&&!c.documentElement.contains(u)){for(var f=u;f.parentNode&&f.parentNode!==f;)f=f.parentNode;if(!f.host||!c.documentElement.contains(f.host))return!0}return!1}(i))return!0}return!1}function dr(t){return t===void 0&&(t=window),re(t=t||window)||Q(t)||void 0}function Ae(t,o){if(typeof t=="string"){if(typeof o=="string")return t==="*"||o===t;if(y(o)||Array.isArray(o))return!1}return y(t)?y(o)?t.toString()===o.toString():!Array.isArray(o)&&!!o.match(t):!!Array.isArray(t)&&(Array.isArray(o)?JSON.stringify(t)===JSON.stringify(o):!y(o)&&t.some(function(n){return Ae(n,o)}))}function Je(t){try{if(t===window)return!0}catch(o){if(o&&o.message===_)return!0}try{if({}.toString.call(t)==="[object Window]")return!0}catch(o){if(o&&o.message===_)return!0}try{if(window.Window&&t instanceof window.Window)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.self===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.parent===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.top===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in t&&"self"in t&&"location"in t)return!0}catch{}return!1}function lr(t){if(X(t))return H(t).frameElement;for(var o=0,n=document.querySelectorAll("iframe");o<n.length;o++){var i=n[o];if(i&&i.contentWindow&&i.contentWindow===t)return i}}function Rf(t){if(function(n){return n===void 0&&(n=window),!!Q(n)}(t)){var o=lr(t);if(o&&o.parentElement){o.parentElement.removeChild(o);return}}try{t.close()}catch{}}function pe(t){try{if(!t)return!1;if(typeof Promise<"u"&&t instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&t instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&t instanceof window.constructor)return!1;var o={}.toString;if(o){var n=o.call(t);if(n==="[object Window]"||n==="[object global]"||n==="[object DOMWindow]")return!1}if(typeof t.then=="function")return!0}catch{return!1}return!1}var hr=[],De=[],yt=0,Re;function pr(){if(!yt&&Re){var t=Re;Re=null,t.resolve()}}function mt(){yt+=1}function je(){yt-=1,pr()}var O=function(){function t(n){var i=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var u,c,f=!1,p=!1,l=!1;mt();try{n(function(d){l?i.resolve(d):(f=!0,u=d)},function(d){l?i.reject(d):(p=!0,c=d)})}catch(d){je(),this.reject(d);return}je(),l=!0,f?this.resolve(u):p&&this.reject(c)}}var o=t.prototype;return o.resolve=function(n){if(this.resolved||this.rejected)return this;if(pe(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},o.reject=function(n){var i=this;if(this.resolved||this.rejected)return this;if(pe(n))throw new Error("Can not reject promise with another promise");if(!n){var u=n&&typeof n.toString=="function"?n.toString():{}.toString.call(n);n=new Error("Expected reject to be called with Error, got "+u)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){i.errorHandled||function(c,f){if(hr.indexOf(c)===-1){hr.push(c),setTimeout(function(){throw c},1);for(var p=0;p<De.length;p++)De[p](c,f)}}(n,i)},1),this.dispatch(),this},o.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},o.dispatch=function(){var n=this.resolved,i=this.rejected,u=this.handlers;if(!this.dispatching&&(n||i)){this.dispatching=!0,mt();for(var c=function(m,S){return m.then(function(b){S.resolve(b)},function(b){S.reject(b)})},f=0;f<u.length;f++){var p=u[f],l=p.onSuccess,d=p.onError,w=p.promise,g=void 0;if(n)try{g=l?l(this.value):this.value}catch(m){w.reject(m);continue}else if(i){if(!d){w.reject(this.error);continue}try{g=d(this.error)}catch(m){w.reject(m);continue}}if(g instanceof t&&(g.resolved||g.rejected)){var v=g;v.resolved?w.resolve(v.value):w.reject(v.error),v.errorHandled=!0}else pe(g)?g instanceof t&&(g.resolved||g.rejected)?g.resolved?w.resolve(g.value):w.reject(g.error):c(g,w):w.resolve(g)}u.length=0,this.dispatching=!1,je()}},o.then=function(n,i){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.then expected a function for success handler");if(i&&typeof i!="function"&&!i.call)throw new Error("Promise.then expected a function for error handler");var u=new t;return this.handlers.push({promise:u,onSuccess:n,onError:i}),this.errorHandled=!0,this.dispatch(),u},o.catch=function(n){return this.then(void 0,n)},o.finally=function(n){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(i){return t.try(n).then(function(){return i})},function(i){return t.try(n).then(function(){throw i})})},o.timeout=function(n,i){var u=this;if(this.resolved||this.rejected)return this;var c=setTimeout(function(){u.resolved||u.rejected||u.reject(i||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(f){return clearTimeout(c),f})},o.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},o.lazy=function(){return this.errorHandled=!0,this},t.resolve=function(n){return n instanceof t?n:pe(n)?new t(function(i,u){return n.then(i,u)}):new t().resolve(n)},t.reject=function(n){return new t().reject(n)},t.asyncReject=function(n){return new t().asyncReject(n)},t.all=function(n){var i=new t,u=n.length,c=[].slice();if(!u)return i.resolve(c),i;for(var f=function(d,w,g){return w.then(function(v){c[d]=v,(u-=1)==0&&i.resolve(c)},function(v){g.reject(v)})},p=0;p<n.length;p++){var l=n[p];if(l instanceof t){if(l.resolved){c[p]=l.value,u-=1;continue}}else if(!pe(l)){c[p]=l,u-=1;continue}f(p,t.resolve(l),i)}return u===0&&i.resolve(c),i},t.hash=function(n){var i={},u=[],c=function(p){if(n.hasOwnProperty(p)){var l=n[p];pe(l)?u.push(l.then(function(d){i[p]=d})):i[p]=l}};for(var f in n)c(f);return t.all(u).then(function(){return i})},t.map=function(n,i){return t.all(n.map(i))},t.onPossiblyUnhandledException=function(n){return function(i){return De.push(i),{cancel:function(){De.splice(De.indexOf(i),1)}}}(n)},t.try=function(n,i,u){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.try expected a function");var c;mt();try{c=n.apply(i,u||[])}catch(f){return je(),t.reject(f)}return je(),t.resolve(c)},t.delay=function(n){return new t(function(i){setTimeout(i,n)})},t.isPromise=function(n){return!!(n&&n instanceof t)||pe(n)},t.flush=function(){return function(n){var i=Re=Re||new n;return pr(),i}(t)},t}();function Ke(t,o){for(var n=0;n<t.length;n++)try{if(t[n]===o)return n}catch{}return-1}var _t=function(){function t(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap>"u"||Object.freeze===void 0)return!1;try{var n=new WeakMap,i={};return Object.freeze(i),n.set(i,"__testvalue__"),n.get(i)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var o=t.prototype;return o._cleanupClosedWindows=function(){for(var n=this.weakmap,i=this.keys,u=0;u<i.length;u++){var c=i[u];if(Je(c)&&Z(c)){if(n)try{n.delete(c)}catch{}i.splice(u,1),this.values.splice(u,1),u-=1}}},o.isSafeToReadWrite=function(n){return!Je(n)},o.set=function(n,i){if(!n)throw new Error("WeakMap expected key");var u=this.weakmap;if(u)try{u.set(n,i)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var c=this.name,f=n[c];f&&f[0]===n?f[1]=i:Object.defineProperty(n,c,{value:[n,i],writable:!0});return}catch{}this._cleanupClosedWindows();var p=this.keys,l=this.values,d=Ke(p,n);d===-1?(p.push(n),l.push(i)):l[d]=i},o.get=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return i.get(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return u&&u[0]===n?u[1]:void 0}catch{}this._cleanupClosedWindows();var c=Ke(this.keys,n);if(c!==-1)return this.values[c]},o.delete=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{i.delete(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];u&&u[0]===n&&(u[0]=u[1]=void 0)}catch{}this._cleanupClosedWindows();var c=this.keys,f=Ke(c,n);f!==-1&&(c.splice(f,1),this.values.splice(f,1))},o.has=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return!(!u||u[0]!==n)}catch{}return this._cleanupClosedWindows(),Ke(this.keys,n)!==-1},o.getOrSet=function(n,i){if(this.has(n))return this.get(n);var u=i();return this.set(n,u),u},t}();function gr(t){return t.name||t.__name__||t.displayName||"anonymous"}function vr(t,o){try{delete t.name,t.name=o}catch{}return t.__name__=t.displayName=o,t}function ee(){var t="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return t.charAt(Math.floor(Math.random()*t.length))})+"_"+function(o){if(typeof btoa=="function")return btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,function(n,i){return String.fromCharCode(parseInt(i,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(o,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Qe;function wr(t){try{return JSON.stringify([].slice.call(t),function(o,n){return typeof n=="function"?"memoize["+function(i){if(Qe=Qe||new _t,i==null||typeof i!="object"&&typeof i!="function")throw new Error("Invalid object");var u=Qe.get(i);return u||(u=typeof i+":"+ee(),Qe.set(i,u)),u}(n)+"]":typeof window<"u"&&n instanceof window.Element||n!==null&&typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"?{}:n})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function jf(){return{}}var We=0,yr=0;function Me(t,o){o===void 0&&(o={});var n=o.thisNamespace,i=n!==void 0&&n,u=o.time,c,f,p=We;We+=1;var l=function(){for(var d=arguments.length,w=new Array(d),g=0;g<d;g++)w[g]=arguments[g];p<yr&&(c=null,f=null,p=We,We+=1);var v;v=i?(f=f||new _t).getOrSet(this,jf):c=c||{};var m;try{m=wr(w)}catch{return t.apply(this,arguments)}var S=v[m];if(S&&u&&Date.now()-S.time<u&&(delete v[m],S=null),S)return S.value;var b=Date.now(),A=t.apply(this,arguments);return v[m]={time:b,value:A},A};return l.reset=function(){c=null,f=null},vr(l,(o.name||gr(t))+"::memoized")}Me.clear=function(){yr=We};function Wf(t){var o={};function n(){for(var i=arguments,u=this,c=arguments.length,f=new Array(c),p=0;p<c;p++)f[p]=arguments[p];var l=wr(f);return o.hasOwnProperty(l)||(o[l]=O.try(function(){return t.apply(u,i)}).finally(function(){delete o[l]})),o[l]}return n.reset=function(){o={}},vr(n,gr(t)+"::promiseMemoized")}function ge(){}function $e(t,o){if(o===void 0&&(o=1),o>=3)return"stringifyError stack overflow";try{if(!t)return"<unknown error: "+{}.toString.call(t)+">";if(typeof t=="string")return t;if(t instanceof Error){var n=t&&t.stack,i=t&&t.message;if(n&&i)return n.indexOf(i)!==-1?n:i+`
|
|
3
|
-
`+n;if(n)return n;if(i)return i}return t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}catch(u){return"Error while stringifying error: "
|
|
1
|
+
(function(E,Se){typeof exports=="object"&&typeof module<"u"?Se(exports):typeof define=="function"&&define.amd?define(["exports"],Se):(E=typeof globalThis<"u"?globalThis:E||self,Se(E.pitcher={}))})(this,function(E){"use strict";function Se(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const h in s)if(h!=="default"&&!(h in e)){const y=Object.getOwnPropertyDescriptor(s,h);y&&Object.defineProperty(e,h,y.get?y:{enumerable:!0,get:()=>s[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xt={exports:{}},Ct={exports:{}};(function(e,r){(function(a,s){e.exports=s()})(typeof self<"u"?self:Fr,function(){return function(a){var s={};function h(y){if(s[y])return s[y].exports;var _=s[y]={i:y,l:!1,exports:{}};return a[y].call(_.exports,_,_.exports,h),_.l=!0,_.exports}return h.m=a,h.c=s,h.d=function(y,_,T){h.o(y,_)||Object.defineProperty(y,_,{enumerable:!0,get:T})},h.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},h.t=function(y,_){if(1&_&&(y=h(y)),8&_||4&_&&typeof y=="object"&&y&&y.__esModule)return y;var T=Object.create(null);if(h.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:y}),2&_&&typeof y!="string")for(var I in y)h.d(T,I,function(F){return y[F]}.bind(null,I));return T},h.n=function(y){var _=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(_,"a",_),_},h.o=function(y,_){return{}.hasOwnProperty.call(y,_)},h.p="",h(h.s=0)}([function(a,s,h){h.r(s),h.d(s,"Promise",function(){return O}),h.d(s,"TYPES",function(){return Xf}),h.d(s,"ProxyWindow",function(){return Y}),h.d(s,"setup",function(){return zr}),h.d(s,"destroy",function(){return Qf}),h.d(s,"serializeMessage",function(){return Zf}),h.d(s,"deserializeMessage",function(){return Jf}),h.d(s,"createProxyWindow",function(){return Kf}),h.d(s,"toProxyWindow",function(){return kf}),h.d(s,"on",function(){return ie}),h.d(s,"once",function(){return Yf}),h.d(s,"send",function(){return ae}),h.d(s,"markWindowKnown",function(){return Or}),h.d(s,"cleanUpWindow",function(){return ed}),h.d(s,"bridge",function(){});function y(t){return{}.toString.call(t)==="[object RegExp]"}var _=`Call was rejected by callee.\r
|
|
2
|
+
`;function T(t){return t===void 0&&(t=window),t.location.protocol}function I(t){if(t===void 0&&(t=window),t.mockDomain){var o=t.mockDomain.split("//")[0];if(o)return o}return T(t)}function F(t){return t===void 0&&(t=window),I(t)==="about:"}function Q(t){if(t===void 0&&(t=window),t)try{if(t.parent&&t.parent!==t)return t.parent}catch{}}function re(t){if(t===void 0&&(t=window),t&&!Q(t))try{return t.opener}catch{}}function le(t){try{return!0}catch{}return!1}function he(t){t===void 0&&(t=window);var o=t.location;if(!o)throw new Error("Can not read window location");var n=T(t);if(!n)throw new Error("Can not read window protocol");if(n==="file:")return"file://";if(n==="about:"){var i=Q(t);return i&&le()?he(i):"about://"}var u=o.host;if(!u)throw new Error("Can not read window host");return n+"//"+u}function q(t){t===void 0&&(t=window);var o=he(t);return o&&t.mockDomain&&t.mockDomain.indexOf("mock:")===0?t.mockDomain:o}function X(t){if(!function(o){try{if(o===window)return!0}catch{}try{var n=Object.getOwnPropertyDescriptor(o,"location");if(n&&n.enumerable===!1)return!1}catch{}try{if(F(o)&&le())return!0}catch{}try{if(function(i){return i===void 0&&(i=window),I(i)==="mock:"}(o)&&le())return!0}catch{}try{if(he(o)===he(window))return!0}catch{}return!1}(t))return!1;try{if(t===window||F(t)&&le()||q(window)===q(t))return!0}catch{}return!1}function H(t){if(!X(t))throw new Error("Expected window to be same domain");return t}function ee(t,o){if(!t||!o)return!1;var n=Q(o);return n?n===t:function(i){var u=[];try{for(;i.parent!==i;)u.push(i.parent),i=i.parent}catch{}return u}(o).indexOf(t)!==-1}function dr(t){var o=[],n;try{n=t.frames}catch{n=t}var i;try{i=n.length}catch{}if(i===0)return o;if(i){for(var u=0;u<i;u++){var c=void 0;try{c=n[u]}catch{continue}o.push(c)}return o}for(var f=0;f<100;f++){var p=void 0;try{p=n[f]}catch{return o}if(!p)return o;o.push(p)}return o}var Rf=[],jf=[];function Z(t,o){o===void 0&&(o=!0);try{if(t===window)return!1}catch{return!0}try{if(!t)return!0}catch{return!0}try{if(t.closed)return!0}catch(u){return!u||u.message!==_}if(o&&X(t))try{if(t.mockclosed)return!0}catch{}try{if(!t.parent||!t.top)return!0}catch{}var n=function(u,c){for(var f=0;f<u.length;f++)try{if(u[f]===c)return f}catch{}return-1}(Rf,t);if(n!==-1){var i=jf[n];if(i&&function(u){if(!u.contentWindow||!u.parentNode)return!0;var c=u.ownerDocument;if(c&&c.documentElement&&!c.documentElement.contains(u)){for(var f=u;f.parentNode&&f.parentNode!==f;)f=f.parentNode;if(!f.host||!c.documentElement.contains(f.host))return!0}return!1}(i))return!0}return!1}function lr(t){return t===void 0&&(t=window),re(t=t||window)||Q(t)||void 0}function Ae(t,o){if(typeof t=="string"){if(typeof o=="string")return t==="*"||o===t;if(y(o)||Array.isArray(o))return!1}return y(t)?y(o)?t.toString()===o.toString():!Array.isArray(o)&&!!o.match(t):!!Array.isArray(t)&&(Array.isArray(o)?JSON.stringify(t)===JSON.stringify(o):!y(o)&&t.some(function(n){return Ae(n,o)}))}function Je(t){try{if(t===window)return!0}catch(o){if(o&&o.message===_)return!0}try{if({}.toString.call(t)==="[object Window]")return!0}catch(o){if(o&&o.message===_)return!0}try{if(window.Window&&t instanceof window.Window)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.self===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.parent===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.top===t)return!0}catch(o){if(o&&o.message===_)return!0}try{if(t&&t.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in t&&"self"in t&&"location"in t)return!0}catch{}return!1}function hr(t){if(X(t))return H(t).frameElement;for(var o=0,n=document.querySelectorAll("iframe");o<n.length;o++){var i=n[o];if(i&&i.contentWindow&&i.contentWindow===t)return i}}function Mf(t){if(function(n){return n===void 0&&(n=window),!!Q(n)}(t)){var o=hr(t);if(o&&o.parentElement){o.parentElement.removeChild(o);return}}try{t.close()}catch{}}function pe(t){try{if(!t)return!1;if(typeof Promise<"u"&&t instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&t instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&t instanceof window.constructor)return!1;var o={}.toString;if(o){var n=o.call(t);if(n==="[object Window]"||n==="[object global]"||n==="[object DOMWindow]")return!1}if(typeof t.then=="function")return!0}catch{return!1}return!1}var pr=[],De=[],yt=0,Re;function gr(){if(!yt&&Re){var t=Re;Re=null,t.resolve()}}function mt(){yt+=1}function je(){yt-=1,gr()}var O=function(){function t(n){var i=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var u,c,f=!1,p=!1,l=!1;mt();try{n(function(d){l?i.resolve(d):(f=!0,u=d)},function(d){l?i.reject(d):(p=!0,c=d)})}catch(d){je(),this.reject(d);return}je(),l=!0,f?this.resolve(u):p&&this.reject(c)}}var o=t.prototype;return o.resolve=function(n){if(this.resolved||this.rejected)return this;if(pe(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},o.reject=function(n){var i=this;if(this.resolved||this.rejected)return this;if(pe(n))throw new Error("Can not reject promise with another promise");if(!n){var u=n&&typeof n.toString=="function"?n.toString():{}.toString.call(n);n=new Error("Expected reject to be called with Error, got "+u)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){i.errorHandled||function(c,f){if(pr.indexOf(c)===-1){pr.push(c),setTimeout(function(){throw c},1);for(var p=0;p<De.length;p++)De[p](c,f)}}(n,i)},1),this.dispatch(),this},o.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},o.dispatch=function(){var n=this.resolved,i=this.rejected,u=this.handlers;if(!this.dispatching&&(n||i)){this.dispatching=!0,mt();for(var c=function(m,S){return m.then(function(b){S.resolve(b)},function(b){S.reject(b)})},f=0;f<u.length;f++){var p=u[f],l=p.onSuccess,d=p.onError,w=p.promise,g=void 0;if(n)try{g=l?l(this.value):this.value}catch(m){w.reject(m);continue}else if(i){if(!d){w.reject(this.error);continue}try{g=d(this.error)}catch(m){w.reject(m);continue}}if(g instanceof t&&(g.resolved||g.rejected)){var v=g;v.resolved?w.resolve(v.value):w.reject(v.error),v.errorHandled=!0}else pe(g)?g instanceof t&&(g.resolved||g.rejected)?g.resolved?w.resolve(g.value):w.reject(g.error):c(g,w):w.resolve(g)}u.length=0,this.dispatching=!1,je()}},o.then=function(n,i){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.then expected a function for success handler");if(i&&typeof i!="function"&&!i.call)throw new Error("Promise.then expected a function for error handler");var u=new t;return this.handlers.push({promise:u,onSuccess:n,onError:i}),this.errorHandled=!0,this.dispatch(),u},o.catch=function(n){return this.then(void 0,n)},o.finally=function(n){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(i){return t.try(n).then(function(){return i})},function(i){return t.try(n).then(function(){throw i})})},o.timeout=function(n,i){var u=this;if(this.resolved||this.rejected)return this;var c=setTimeout(function(){u.resolved||u.rejected||u.reject(i||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(f){return clearTimeout(c),f})},o.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},o.lazy=function(){return this.errorHandled=!0,this},t.resolve=function(n){return n instanceof t?n:pe(n)?new t(function(i,u){return n.then(i,u)}):new t().resolve(n)},t.reject=function(n){return new t().reject(n)},t.asyncReject=function(n){return new t().asyncReject(n)},t.all=function(n){var i=new t,u=n.length,c=[].slice();if(!u)return i.resolve(c),i;for(var f=function(d,w,g){return w.then(function(v){c[d]=v,(u-=1)==0&&i.resolve(c)},function(v){g.reject(v)})},p=0;p<n.length;p++){var l=n[p];if(l instanceof t){if(l.resolved){c[p]=l.value,u-=1;continue}}else if(!pe(l)){c[p]=l,u-=1;continue}f(p,t.resolve(l),i)}return u===0&&i.resolve(c),i},t.hash=function(n){var i={},u=[],c=function(p){if(n.hasOwnProperty(p)){var l=n[p];pe(l)?u.push(l.then(function(d){i[p]=d})):i[p]=l}};for(var f in n)c(f);return t.all(u).then(function(){return i})},t.map=function(n,i){return t.all(n.map(i))},t.onPossiblyUnhandledException=function(n){return function(i){return De.push(i),{cancel:function(){De.splice(De.indexOf(i),1)}}}(n)},t.try=function(n,i,u){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.try expected a function");var c;mt();try{c=n.apply(i,u||[])}catch(f){return je(),t.reject(f)}return je(),t.resolve(c)},t.delay=function(n){return new t(function(i){setTimeout(i,n)})},t.isPromise=function(n){return!!(n&&n instanceof t)||pe(n)},t.flush=function(){return function(n){var i=Re=Re||new n;return gr(),i}(t)},t}();function Ke(t,o){for(var n=0;n<t.length;n++)try{if(t[n]===o)return n}catch{}return-1}var _t=function(){function t(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap>"u"||Object.freeze===void 0)return!1;try{var n=new WeakMap,i={};return Object.freeze(i),n.set(i,"__testvalue__"),n.get(i)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var o=t.prototype;return o._cleanupClosedWindows=function(){for(var n=this.weakmap,i=this.keys,u=0;u<i.length;u++){var c=i[u];if(Je(c)&&Z(c)){if(n)try{n.delete(c)}catch{}i.splice(u,1),this.values.splice(u,1),u-=1}}},o.isSafeToReadWrite=function(n){return!Je(n)},o.set=function(n,i){if(!n)throw new Error("WeakMap expected key");var u=this.weakmap;if(u)try{u.set(n,i)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var c=this.name,f=n[c];f&&f[0]===n?f[1]=i:Object.defineProperty(n,c,{value:[n,i],writable:!0});return}catch{}this._cleanupClosedWindows();var p=this.keys,l=this.values,d=Ke(p,n);d===-1?(p.push(n),l.push(i)):l[d]=i},o.get=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return i.get(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return u&&u[0]===n?u[1]:void 0}catch{}this._cleanupClosedWindows();var c=Ke(this.keys,n);if(c!==-1)return this.values[c]},o.delete=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{i.delete(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];u&&u[0]===n&&(u[0]=u[1]=void 0)}catch{}this._cleanupClosedWindows();var c=this.keys,f=Ke(c,n);f!==-1&&(c.splice(f,1),this.values.splice(f,1))},o.has=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return!(!u||u[0]!==n)}catch{}return this._cleanupClosedWindows(),Ke(this.keys,n)!==-1},o.getOrSet=function(n,i){if(this.has(n))return this.get(n);var u=i();return this.set(n,u),u},t}();function vr(t){return t.name||t.__name__||t.displayName||"anonymous"}function wr(t,o){try{delete t.name,t.name=o}catch{}return t.__name__=t.displayName=o,t}function te(){var t="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return t.charAt(Math.floor(Math.random()*t.length))})+"_"+function(o){if(typeof btoa=="function")return btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,function(n,i){return String.fromCharCode(parseInt(i,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(o,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var ke;function yr(t){try{return JSON.stringify([].slice.call(t),function(o,n){return typeof n=="function"?"memoize["+function(i){if(ke=ke||new _t,i==null||typeof i!="object"&&typeof i!="function")throw new Error("Invalid object");var u=ke.get(i);return u||(u=typeof i+":"+te(),ke.set(i,u)),u}(n)+"]":typeof window<"u"&&n instanceof window.Element||n!==null&&typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"?{}:n})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function Wf(){return{}}var Me=0,mr=0;function We(t,o){o===void 0&&(o={});var n=o.thisNamespace,i=n!==void 0&&n,u=o.time,c,f,p=Me;Me+=1;var l=function(){for(var d=arguments.length,w=new Array(d),g=0;g<d;g++)w[g]=arguments[g];p<mr&&(c=null,f=null,p=Me,Me+=1);var v;v=i?(f=f||new _t).getOrSet(this,Wf):c=c||{};var m;try{m=yr(w)}catch{return t.apply(this,arguments)}var S=v[m];if(S&&u&&Date.now()-S.time<u&&(delete v[m],S=null),S)return S.value;var b=Date.now(),A=t.apply(this,arguments);return v[m]={time:b,value:A},A};return l.reset=function(){c=null,f=null},wr(l,(o.name||vr(t))+"::memoized")}We.clear=function(){mr=Me};function Nf(t){var o={};function n(){for(var i=arguments,u=this,c=arguments.length,f=new Array(c),p=0;p<c;p++)f[p]=arguments[p];var l=yr(f);return o.hasOwnProperty(l)||(o[l]=O.try(function(){return t.apply(u,i)}).finally(function(){delete o[l]})),o[l]}return n.reset=function(){o={}},wr(n,vr(t)+"::promiseMemoized")}function ge(){}function Ne(t,o){if(o===void 0&&(o=1),o>=3)return"stringifyError stack overflow";try{if(!t)return"<unknown error: "+{}.toString.call(t)+">";if(typeof t=="string")return t;if(t instanceof Error){var n=t&&t.stack,i=t&&t.message;if(n&&i)return n.indexOf(i)!==-1?n:i+`
|
|
3
|
+
`+n;if(n)return n;if(i)return i}return t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}catch(u){return"Error while stringifying error: "+Ne(u,o+1)}}function _r(t){return typeof t=="string"?t:t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}We(function(t){if(Object.values)return Object.values(t);var o=[];for(var n in t)t.hasOwnProperty(n)&&o.push(t[n]);return o});function Et(t){return{}.toString.call(t)==="[object RegExp]"}function $e(t,o,n){if(t.hasOwnProperty(o))return t[o];var i=n();return t[o]=i,i}function Er(){var t=document.body;if(!t)throw new Error("Body element not found");return t}function br(){return!!document.body&&document.readyState==="complete"}function Ar(){return!!document.body&&document.readyState==="interactive"}We(function(){return new O(function(t){if(br()||Ar())return t();var o=setInterval(function(){if(br()||Ar())return clearInterval(o),t()},10)})});var Qe=typeof document<"u"?document.currentScript:null,$f=We(function(){if(Qe||(Qe=function(){try{var t=function(){try{throw new Error("_")}catch(f){return f.stack||""}}(),o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(t),n=o&&o[1];if(!n)return;for(var i=0,u=[].slice.call(document.getElementsByTagName("script")).reverse();i<u.length;i++){var c=u[i];if(c.src&&c.src===n)return c}}catch{}}()))return Qe;throw new Error("Can not determine current script")}),Lf=te();We(function(){var t;try{t=$f()}catch{return Lf}var o=t.getAttribute("data-uid");if(o&&typeof o=="string"||(o=t.getAttribute("data-uid-auto"))&&typeof o=="string")return o;if(t.src){var n=function(i){for(var u="",c=0;c<i.length;c++){var f=i[c].charCodeAt(0)*c;i[c+1]&&(f+=i[c+1].charCodeAt(0)*(c-1)),u+=String.fromCharCode(97+Math.abs(f)%26)}return u}(JSON.stringify({src:t.src,dataset:t.dataset}));o="uid_"+n.slice(n.length-30)}else o=te();return t.setAttribute("data-uid-auto",o),o});function Le(t){t===void 0&&(t=window);var o="__post_robot_10_0_46__";return t!==window?t[o]:t[o]=t[o]||{}}var Sr=function(){return{}};function L(t,o){return t===void 0&&(t="store"),o===void 0&&(o=Sr),$e(Le(),t,function(){var n=o();return{has:function(i){return n.hasOwnProperty(i)},get:function(i,u){return n.hasOwnProperty(i)?n[i]:u},set:function(i,u){return n[i]=u,u},del:function(i){delete n[i]},getOrSet:function(i,u){return $e(n,i,u)},reset:function(){n=o()},keys:function(){return Object.keys(n)}}})}var Uf=function(){};function Xe(){var t=Le();return t.WINDOW_WILDCARD=t.WINDOW_WILDCARD||new Uf,t.WINDOW_WILDCARD}function G(t,o){return t===void 0&&(t="store"),o===void 0&&(o=Sr),L("windowStore").getOrSet(t,function(){var n=new _t,i=function(u){return n.getOrSet(u,o)};return{has:function(u){return i(u).hasOwnProperty(t)},get:function(u,c){var f=i(u);return f.hasOwnProperty(t)?f[t]:c},set:function(u,c){return i(u)[t]=c,c},del:function(u){delete i(u)[t]},getOrSet:function(u,c){return $e(i(u),t,c)}}})}function Tr(){return L("instance").getOrSet("instanceID",te)}function Pr(t,o){var n=o.domain,i=G("helloPromises"),u=i.get(t);u&&u.resolve({domain:n});var c=O.resolve({domain:n});return i.set(t,c),c}function bt(t,o){return(0,o.send)(t,"postrobot_hello",{instanceID:Tr()},{domain:"*",timeout:-1}).then(function(n){var i=n.origin,u=n.data.instanceID;return Pr(t,{domain:i}),{win:t,domain:i,instanceID:u}})}function Ir(t,o){var n=o.send;return G("windowInstanceIDPromises").getOrSet(t,function(){return bt(t,{send:n}).then(function(i){return i.instanceID})})}function Or(t){G("knownWindows").set(t,!0)}function At(t){return typeof t=="object"&&t!==null&&typeof t.__type__=="string"}function xr(t){return t===void 0?"undefined":t===null?"null":Array.isArray(t)?"array":typeof t=="function"?"function":typeof t=="object"?t instanceof Error?"error":typeof t.then=="function"?"promise":{}.toString.call(t)==="[object RegExp]"?"regex":{}.toString.call(t)==="[object Date]"?"date":"object":typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":void 0}function ve(t,o){return{__type__:t,__val__:o}}var V,zf=((V={}).function=function(){},V.error=function(t){return ve("error",{message:t.message,stack:t.stack,code:t.code,data:t.data})},V.promise=function(){},V.regex=function(t){return ve("regex",t.source)},V.date=function(t){return ve("date",t.toJSON())},V.array=function(t){return t},V.object=function(t){return t},V.string=function(t){return t},V.number=function(t){return t},V.boolean=function(t){return t},V.null=function(t){return t},V[void 0]=function(t){return ve("undefined",t)},V),Ff={},B,qf=((B={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},B.error=function(t){var o=t.stack,n=t.code,i=t.data,u=new Error(t.message);return u.code=n,i&&(u.data=i),u.stack=o+`
|
|
4
4
|
|
|
5
|
-
`+u.stack,u},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(t){return new RegExp(t)},B.date=function(t){return new Date(t)},B.array=function(t){return t},B.object=function(t){return t},B.string=function(t){return t},B.number=function(t){return t},B.boolean=function(t){return t},B.null=function(t){return t},B[void 0]=function(){},B),
|
|
5
|
+
`+u.stack,u},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(t){return new RegExp(t)},B.date=function(t){return new Date(t)},B.array=function(t){return t},B.object=function(t){return t},B.string=function(t){return t},B.number=function(t){return t},B.boolean=function(t){return t},B.null=function(t){return t},B[void 0]=function(){},B),Gf={};new O(function(t){if(window.document&&window.document.body)return t(window.document.body);var o=setInterval(function(){if(window.document&&window.document.body)return clearInterval(o),t(window.document.body)},10)});function St(){for(var t=L("idToProxyWindow"),o=0,n=t.keys();o<n.length;o++){var i=n[o];t.get(i).shouldClean()&&t.del(i)}}function Cr(t,o){var n=o.send,i=o.id,u=i===void 0?te():i,c=t.then(function(l){if(X(l))return H(l).name}),f=t.then(function(l){if(Z(l))throw new Error("Window is closed, can not determine type");return re(l)?"popup":"iframe"});c.catch(ge),f.catch(ge);var p=function(){return t.then(function(l){if(!Z(l))return X(l)?H(l).name:c})};return{id:u,getType:function(){return f},getInstanceID:Nf(function(){return t.then(function(l){return Ir(l,{send:n})})}),close:function(){return t.then(Mf)},getName:p,focus:function(){return t.then(function(l){l.focus()})},isClosed:function(){return t.then(function(l){return Z(l)})},setLocation:function(l,d){return d===void 0&&(d={}),t.then(function(w){var g=window.location.protocol+"//"+window.location.host,v=d.method,m=v===void 0?"get":v,S=d.body;if(l.indexOf("/")===0)l=""+g+l;else if(!l.match(/^https?:\/\//)&&l.indexOf(g)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(l));if(m==="post")return p().then(function(b){if(!b)throw new Error("Can not post to window without target name");(function(A){var C=A.url,$=A.target,j=A.body,D=A.method,U=D===void 0?"post":D,P=document.createElement("form");if(P.setAttribute("target",$),P.setAttribute("method",U),P.setAttribute("action",C),P.style.display="none",j)for(var M=0,J=Object.keys(j);M<J.length;M++){var N,Ue=J[M],Ot=document.createElement("input");Ot.setAttribute("name",Ue),Ot.setAttribute("value",(N=j[Ue])==null?void 0:N.toString()),P.appendChild(Ot)}Er().appendChild(P),P.submit(),Er().removeChild(P)})({url:l,target:b,method:m,body:S})});if(m!=="get")throw new Error("Unsupported method: "+m);if(X(w))try{if(w.location&&typeof w.location.replace=="function"){w.location.replace(l);return}}catch{}w.location=l})},setName:function(l){return t.then(function(d){var w=X(d),g=hr(d);if(!w)throw new Error("Can not set name for cross-domain window: "+l);H(d).name=l,g&&g.setAttribute("name",l),c=O.resolve(l)})}}}var Y=function(){function t(n){var i=n.send,u=n.win,c=n.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new O,this.serializedWindow=c||Cr(this.actualWindowPromise,{send:i}),L("idToProxyWindow").set(this.getID(),this),u&&this.setWindow(u,{send:i})}var o=t.prototype;return o.getID=function(){return this.serializedWindow.id},o.getType=function(){return this.serializedWindow.getType()},o.isPopup=function(){return this.getType().then(function(n){return n==="popup"})},o.setLocation=function(n,i){var u=this;return this.serializedWindow.setLocation(n,i).then(function(){return u})},o.getName=function(){return this.serializedWindow.getName()},o.setName=function(n){var i=this;return this.serializedWindow.setName(n).then(function(){return i})},o.close=function(){var n=this;return this.serializedWindow.close().then(function(){return n})},o.focus=function(){var n=this,i=this.isPopup(),u=this.getName(),c=O.hash({isPopup:i,name:u}).then(function(p){var l=p.name;p.isPopup&&l&&window.open("",l,"noopener")}),f=this.serializedWindow.focus();return O.all([c,f]).then(function(){return n})},o.isClosed=function(){return this.serializedWindow.isClosed()},o.getWindow=function(){return this.actualWindow},o.setWindow=function(n,i){var u=i.send;this.actualWindow=n,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=Cr(this.actualWindowPromise,{send:u,id:this.getID()}),G("winToProxyWindow").set(n,this)},o.awaitWindow=function(){return this.actualWindowPromise},o.matchWindow=function(n,i){var u=this,c=i.send;return O.try(function(){return u.actualWindow?n===u.actualWindow:O.hash({proxyInstanceID:u.getInstanceID(),knownWindowInstanceID:Ir(n,{send:c})}).then(function(f){var p=f.proxyInstanceID===f.knownWindowInstanceID;return p&&u.setWindow(n,{send:c}),p})})},o.unwrap=function(){return this.actualWindow||this},o.getInstanceID=function(){return this.serializedWindow.getInstanceID()},o.shouldClean=function(){return!!(this.actualWindow&&Z(this.actualWindow))},o.serialize=function(){return this.serializedWindow},t.unwrap=function(n){return t.isProxyWindow(n)?n.unwrap():n},t.serialize=function(n,i){var u=i.send;return St(),t.toProxyWindow(n,{send:u}).serialize()},t.deserialize=function(n,i){var u=i.send;return St(),L("idToProxyWindow").get(n.id)||new t({serializedWindow:n,send:u})},t.isProxyWindow=function(n){return!!(n&&!Je(n)&&n.isProxyWindow)},t.toProxyWindow=function(n,i){var u=i.send;if(St(),t.isProxyWindow(n))return n;var c=n;return G("winToProxyWindow").get(c)||new t({win:c,send:u})},t}();function Tt(t,o,n,i,u){var c=G("methodStore"),f=L("proxyWindowMethods");Y.isProxyWindow(i)?f.set(t,{val:o,name:n,domain:u,source:i}):(f.del(t),c.getOrSet(i,function(){return{}})[t]={domain:u,name:n,val:o,source:i})}function Dr(t,o){var n=G("methodStore"),i=L("proxyWindowMethods");return n.getOrSet(t,function(){return{}})[o]||i.get(o)}function Rr(t,o,n,i,u){f=(c={on:u.on,send:u.send}).on,p=c.send,L("builtinListeners").getOrSet("functionCalls",function(){return f("postrobot_method",{domain:"*"},function(w){var g=w.source,v=w.origin,m=w.data,S=m.id,b=m.name,A=Dr(g,S);if(!A)throw new Error("Could not find method '"+b+"' with id: "+m.id+" in "+q(window));var C=A.source,$=A.domain,j=A.val;return O.try(function(){if(!Ae($,v))throw new Error("Method '"+m.name+"' domain "+JSON.stringify(Et(A.domain)?A.domain.source:A.domain)+" does not match origin "+v+" in "+q(window));if(Y.isProxyWindow(C))return C.matchWindow(g,{send:p}).then(function(D){if(!D)throw new Error("Method call '"+m.name+"' failed - proxy window does not match source in "+q(window))})}).then(function(){return j.apply({source:g,origin:v},m.args)},function(D){return O.try(function(){if(j.onError)return j.onError(D)}).then(function(){throw D.stack&&(D.stack="Remote call to "+b+"("+function(U){return U===void 0&&(U=[]),(P=U,[].slice.call(P)).map(function(M){return typeof M=="string"?"'"+M+"'":M===void 0?"undefined":M===null?"null":typeof M=="boolean"?M.toString():Array.isArray(M)?"[ ... ]":typeof M=="object"?"{ ... }":typeof M=="function"?"() => { ... }":"<"+typeof M+">"}).join(", ");var P}(m.args)+`) failed
|
|
6
6
|
|
|
7
|
-
`+D.stack),D})}).then(function(D){return{result:D,id:S,name:b}})})});var c,f,p,l=n.__id__||
|
|
7
|
+
`+D.stack),D})}).then(function(D){return{result:D,id:S,name:b}})})});var c,f,p,l=n.__id__||te();t=Y.unwrap(t);var d=n.__name__||n.name||i;return typeof d=="string"&&typeof d.indexOf=="function"&&d.indexOf("anonymous::")===0&&(d=d.replace("anonymous::",i+"::")),Y.isProxyWindow(t)?(Tt(l,n,d,t,o),t.awaitWindow().then(function(w){Tt(l,n,d,w,o)})):Tt(l,n,d,t,o),ve("cross_domain_function",{id:l,name:d})}function jr(t,o,n,i){var u,c=i.on,f=i.send;return function(p,l){l===void 0&&(l=Ff);var d=JSON.stringify(p,function(w){var g=this[w];if(At(this))return g;var v=xr(g);if(!v)return g;var m=l[v]||zf[v];return m?m(g,w):g});return d===void 0?"undefined":d}(n,((u={}).promise=function(p,l){return function(d,w,g,v,m){return ve("cross_domain_zalgo_promise",{then:Rr(d,w,function(S,b){return g.then(S,b)},v,{on:m.on,send:m.send})})}(t,o,p,l,{on:c,send:f})},u.function=function(p,l){return Rr(t,o,p,l,{on:c,send:f})},u.object=function(p){return Je(p)||Y.isProxyWindow(p)?ve("cross_domain_window",Y.serialize(p,{send:f})):p},u))}function Mr(t,o,n,i){var u,c=i.send;return function(f,p){if(p===void 0&&(p=Gf),f!=="undefined")return JSON.parse(f,function(l,d){if(At(this))return d;var w,g;if(At(d)?(w=d.__type__,g=d.__val__):(w=xr(d),g=d),!w)return g;var v=p[w]||qf[w];return v?v(g,l):g})}(n,((u={}).cross_domain_zalgo_promise=function(f){return function(p,l,d){return new O(d.then)}(0,0,f)},u.cross_domain_function=function(f){return function(p,l,d,w){var g=d.id,v=d.name,m=w.send,S=function(A){A===void 0&&(A={});function C(){var $=arguments;return Y.toProxyWindow(p,{send:m}).awaitWindow().then(function(j){var D=Dr(j,g);if(D&&D.val!==C)return D.val.apply({source:window,origin:q()},$);var U=[].slice.call($);return A.fireAndForget?m(j,"postrobot_method",{id:g,name:v,args:U},{domain:l,fireAndForget:!0}):m(j,"postrobot_method",{id:g,name:v,args:U},{domain:l,fireAndForget:!1}).then(function(P){return P.data.result})}).catch(function(j){throw j})}return C.__name__=v,C.__origin__=l,C.__source__=p,C.__id__=g,C.origin=l,C},b=S();return b.fireAndForget=S({fireAndForget:!0}),b}(t,o,f,{send:c})},u.cross_domain_window=function(f){return Y.deserialize(f,{send:c})},u))}var Pt={};Pt.postrobot_post_message=function(t,o,n){n.indexOf("file:")===0&&(n="*"),t.postMessage(o,n)};function It(t,o,n,i){var u=i.on,c=i.send;return O.try(function(){var f=G().getOrSet(t,function(){return{}});return f.buffer=f.buffer||[],f.buffer.push(n),f.flush=f.flush||O.flush().then(function(){if(Z(t))throw new Error("Window is closed");var p=jr(t,o,((l={}).__post_robot_10_0_46__=f.buffer||[],l),{on:u,send:c}),l;delete f.buffer;for(var d=Object.keys(Pt),w=[],g=0;g<d.length;g++){var v=d[g];try{Pt[v](t,p,o)}catch(m){w.push(m)}}if(w.length===d.length)throw new Error(`All post-robot messaging strategies failed:
|
|
8
8
|
|
|
9
|
-
`+w.map(function(m,S){return S+". "
|
|
9
|
+
`+w.map(function(m,S){return S+". "+Ne(m)}).join(`
|
|
10
10
|
|
|
11
|
-
`))}),f.flush.then(function(){delete f.flush})}).then(ge)}function Wr(t){return L("responseListeners").get(t)}function
|
|
11
|
+
`))}),f.flush.then(function(){delete f.flush})}).then(ge)}function Wr(t){return L("responseListeners").get(t)}function Nr(t){L("responseListeners").del(t)}function $r(t){return L("erroredResponseListeners").has(t)}function Lr(t){var o=t.name,n=t.win,i=t.domain,u=G("requestListeners");if(n==="*"&&(n=null),i==="*"&&(i=null),!o)throw new Error("Name required to get request listener");for(var c=0,f=[n,Xe()];c<f.length;c++){var p=f[c];if(p){var l=u.get(p);if(l){var d=l[o];if(d){if(i&&typeof i=="string"){if(d[i])return d[i];if(d.__domain_regex__)for(var w=0,g=d.__domain_regex__;w<g.length;w++){var v=g[w],m=v.listener;if(Ae(v.regex,i))return m}}if(d["*"])return d["*"]}}}}}function Hf(t,o,n,i){var u=i.on,c=i.send,f=Lr({name:n.name,win:t,domain:o}),p=n.name==="postrobot_method"&&n.data&&typeof n.data.name=="string"?n.data.name+"()":n.name;function l(d,w,g){return O.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return It(t,o,{id:te(),origin:q(window),type:"postrobot_message_response",hash:n.hash,name:n.name,ack:d,data:w,error:g},{on:u,send:c})}catch(v){throw new Error("Send response message failed for "+p+" in "+q()+`
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`+Ne(v))}})}return O.all([O.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return It(t,o,{id:te(),origin:q(window),type:"postrobot_message_ack",hash:n.hash,name:n.name},{on:u,send:c})}catch(d){throw new Error("Send ack message failed for "+p+" in "+q()+`
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
`+Ne(d))}}),O.try(function(){if(!f)throw new Error("No handler found for post message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return f.handler({source:t,origin:o,data:n.data})}).then(function(d){return l("success",d)},function(d){return l("error",null,d)})]).then(ge).catch(function(d){if(f&&f.handleError)return f.handleError(d);throw d})}function Vf(t,o,n){if(!$r(n.hash)){var i=Wr(n.hash);if(!i)throw new Error("No handler found for post message ack for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!Ae(i.domain,o))throw new Error("Ack origin "+o+" does not match domain "+i.domain.toString());if(t!==i.win)throw new Error("Ack source does not match registered window")}catch(u){i.promise.reject(u)}i.ack=!0}}function Bf(t,o,n){if(!$r(n.hash)){var i=Wr(n.hash);if(!i)throw new Error("No handler found for post message response for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Ae(i.domain,o))throw new Error("Response origin "+o+" does not match domain "+(u=i.domain,Array.isArray(u)?"("+u.join(" | ")+")":y(u)?"RegExp("+u.toString()+")":u.toString()));var u;if(t!==i.win)throw new Error("Response source does not match registered window");Nr(n.hash),n.ack==="error"?i.promise.reject(n.error):n.ack==="success"&&i.promise.resolve({source:t,origin:o,data:n.data})}}function Ur(t,o){var n=o.on,i=o.send,u=L("receivedMessages");try{if(!window||window.closed||!t.source)return}catch{return}var c=t.source,f=t.origin,p=function(w,g,v,m){var S=m.on,b=m.send,A;try{A=Mr(g,v,w,{on:S,send:b})}catch{return}if(A&&typeof A=="object"&&A!==null){var C=A.__post_robot_10_0_46__;if(Array.isArray(C))return C}}(t.data,c,f,{on:n,send:i});if(p){Or(c);for(var l=0;l<p.length;l++){var d=p[l];if(u.has(d.id)||(u.set(d.id,!0),Z(c)&&!d.fireAndForget))return;d.origin.indexOf("file:")===0&&(f="file://");try{d.type==="postrobot_message_request"?Hf(c,f,d,{on:n,send:i}):d.type==="postrobot_message_response"?Bf(c,f,d):d.type==="postrobot_message_ack"&&Vf(c,f,d)}catch(w){setTimeout(function(){throw w},0)}}}}function ie(t,o,n){if(!t)throw new Error("Expected name");if(typeof(o=o||{})=="function"&&(n=o,o={}),!n)throw new Error("Expected handler");var i=function u(c,f){var p=c.name,l=c.win,d=c.domain,w=G("requestListeners");if(!p||typeof p!="string")throw new Error("Name required to add request listener");if(l&&l!=="*"&&Y.isProxyWindow(l)){var g=l.awaitWindow().then(function(N){return u({name:p,win:N,domain:d},f)});return{cancel:function(){g.then(function(N){return N.cancel()},ge)}}}var v=l;if(Array.isArray(v)){for(var m=[],S=0,b=v;S<b.length;S++)m.push(u({name:p,domain:d,win:b[S]},f));return{cancel:function(){for(var N=0;N<m.length;N++)m[N].cancel()}}}if(Array.isArray(d)){for(var A=[],C=0,$=d;C<$.length;C++)A.push(u({name:p,win:v,domain:$[C]},f));return{cancel:function(){for(var N=0;N<A.length;N++)A[N].cancel()}}}var j=Lr({name:p,win:v,domain:d});v&&v!=="*"||(v=Xe());var D=(d=d||"*").toString();if(j)throw v&&d?new Error("Request listener already exists for "+p+" on domain "+d.toString()+" for "+(v===Xe()?"wildcard":"specified")+" window"):v?new Error("Request listener already exists for "+p+" for "+(v===Xe()?"wildcard":"specified")+" window"):d?new Error("Request listener already exists for "+p+" on domain "+d.toString()):new Error("Request listener already exists for "+p);var U=w.getOrSet(v,function(){return{}}),P=$e(U,p,function(){return{}}),M,J;return Et(d)?(M=$e(P,"__domain_regex__",function(){return[]})).push(J={regex:d,listener:f}):P[D]=f,{cancel:function(){delete P[D],J&&(M.splice(M.indexOf(J,1)),M.length||delete P.__domain_regex__),Object.keys(P).length||delete U[p],v&&!Object.keys(U).length&&w.del(v)}}}({name:t,win:o.window,domain:o.domain||"*"},{handler:n||o.handler,handleError:o.errorHandler||function(u){throw u}});return{cancel:function(){i.cancel()}}}function Yf(t,o,n){typeof(o=o||{})=="function"&&(n=o,o={});var i=new O,u;return o.errorHandler=function(c){u.cancel(),i.reject(c)},u=ie(t,o,function(c){if(u.cancel(),i.resolve(c),n)return n(c)}),i.cancel=u.cancel,i}var ae=function t(o,n,i,u){var c=(u=u||{}).domain||"*",f=u.timeout||-1,p=u.timeout||5e3,l=u.fireAndForget||!1;return Y.toProxyWindow(o,{send:t}).awaitWindow().then(function(d){return O.try(function(){if(function(w,g,v){if(!w)throw new Error("Expected name");if(v&&typeof v!="string"&&!Array.isArray(v)&&!Et(v))throw new TypeError("Can not send "+w+". Expected domain "+JSON.stringify(v)+" to be a string, array, or regex");if(Z(g))throw new Error("Can not send "+w+". Target window is closed")}(n,d,c),function(w,g){var v=lr(g);if(v)return v===w;if(g===w||function(b){b===void 0&&(b=window);try{if(b.top)return b.top}catch{}if(Q(b)===b)return b;try{if(ee(window,b)&&window.top)return window.top}catch{}try{if(ee(b,window)&&window.top)return window.top}catch{}for(var A=0,C=function j(D){for(var U=[],P=0,M=dr(D);P<M.length;P++){var J=M[P];U.push(J);for(var N=0,Ue=j(J);N<Ue.length;N++)U.push(Ue[N])}return U}(b);A<C.length;A++){var $=C[A];try{if($.top)return $.top}catch{}if(Q($)===$)return $}}(g)===g)return!1;for(var m=0,S=dr(w);m<S.length;m++)if(S[m]===g)return!0;return!1}(window,d))return function(w,g,v){g===void 0&&(g=5e3),v===void 0&&(v="Window");var m=function(S){return G("helloPromises").getOrSet(S,function(){return new O})}(w);return g!==-1&&(m=m.timeout(g,new Error(v+" did not load after "+g+"ms"))),m}(d,p)}).then(function(w){return function(g,v,m,S){var b=S.send;return O.try(function(){return typeof v=="string"?v:O.try(function(){return m||bt(g,{send:b}).then(function(A){return A.domain})}).then(function(A){if(!Ae(v,v))throw new Error("Domain "+_r(v)+" does not match "+_r(v));return A})})}(d,c,(w===void 0?{}:w).domain,{send:t})}).then(function(w){var g=w,v=n==="postrobot_method"&&i&&typeof i.name=="string"?i.name+"()":n,m=new O,S=n+"_"+te();if(!l){var b={name:n,win:d,domain:g,promise:m};(function(P,M){L("responseListeners").set(P,M)})(S,b);var A=G("requestPromises").getOrSet(d,function(){return[]});A.push(m),m.catch(function(){(function(P){L("erroredResponseListeners").set(P,!0)})(S),Nr(S)});var C=function(P){return G("knownWindows").get(P,!1)}(d)?1e4:2e3,$=f,j=C,D=$,U=function(P,M){var J;return function N(){J=setTimeout(function(){(function(){if(Z(d))return m.reject(new Error("Window closed for "+n+" before "+(b.ack?"response":"ack")));if(b.cancelled)return m.reject(new Error("Response listener was cancelled for "+n));j=Math.max(j-500,0),D!==-1&&(D=Math.max(D-500,0)),b.ack||j!==0?D===0&&m.reject(new Error("No response for postMessage "+v+" in "+q()+" in "+$+"ms")):m.reject(new Error("No ack for postMessage "+v+" in "+q()+" in "+C+"ms"))})(),N()},500)}(),{cancel:function(){clearTimeout(J)}}}();m.finally(function(){U.cancel(),A.splice(A.indexOf(m,1))}).catch(ge)}return It(d,g,{id:te(),origin:q(window),type:"postrobot_message_request",hash:S,name:n,data:i,fireAndForget:l},{on:ie,send:t}).then(function(){return l?m.resolve():m},function(P){throw new Error("Send request message failed for "+v+" in "+q()+`
|
|
16
16
|
|
|
17
|
-
`+$e(T))})})})};function Bf(t,o,n){return Rr(t,o,n,{on:ie,send:ae})}function Yf(t,o,n){return jr(t,o,n,{on:ie,send:ae})}function Zf(t){return new Y({send:ae,win:t})}function Jf(t){return Y.toProxyWindow(t,{send:ae})}function Ur(){Le().initialized||(Le().initialized=!0,o=(t={on:ie,send:ae}).on,n=t.send,(i=Le()).receiveMessage=i.receiveMessage||function(u){return Lr(u,{on:o,send:n})},function(u){var c=u.on,f=u.send;L().getOrSet("postMessageListener",function(){return function(p,l,d){return p.addEventListener("message",d),{cancel:function(){p.removeEventListener("message",d)}}}(window,0,function(p){(function(l,d){var w=d.on,g=d.send;O.try(function(){var v=l.source||l.sourceElement,m=l.origin||l.originalEvent&&l.originalEvent.origin,S=l.data;if(m==="null"&&(m="file://"),v){if(!m)throw new Error("Post message did not have origin domain");Lr({source:v,origin:m,data:S},{on:w,send:g})}})})(p,{on:c,send:f})})})}({on:ie,send:ae}),function(u){var c=u.on,f=u.send;L("builtinListeners").getOrSet("helloListener",function(){var p=c("postrobot_hello",{domain:"*"},function(d){return Tr(d.source,{domain:d.origin}),{instanceID:Sr()}}),l=dr();return l&&bt(l,{send:f}).catch(function(d){}),p})}({on:ie,send:ae}));var t,o,n,i}function Kf(){(function(){for(var o=L("responseListeners"),n=0,i=o.keys();n<i.length;n++){var u=i[n],c=o.get(u);c&&(c.cancelled=!0),o.del(u)}})(),(t=L().get("postMessageListener"))&&t.cancel();var t;delete window.__post_robot_10_0_46__}var Qf=!0;function Xf(t){for(var o=0,n=G("requestPromises").get(t,[]);o<n.length;o++)n[o].reject(new Error("Window "+(Z(t)?"closed":"cleaned up")+" before response")).catch(ge)}Ur()}])})})(Ct);var qr=Ct.exports;(function(e){e.exports=qr,e.exports.default=e.exports})(xt);var Dt=xt.exports;const Rt=Fr(Dt),Gr=Se({__proto__:null,default:Rt},[Dt]);var jt=typeof global=="object"&&global&&global.Object===Object&&global,Hr=typeof self=="object"&&self&&self.Object===Object&&self,K=jt||Hr||Function("return this")(),oe=K.Symbol,Wt=Object.prototype,Vr=Wt.hasOwnProperty,Br=Wt.toString,Te=oe?oe.toStringTag:void 0;function Yr(e){var r=Vr.call(e,Te),a=e[Te];try{e[Te]=void 0;var s=!0}catch{}var h=Br.call(e);return s&&(r?e[Te]=a:delete e[Te]),h}var Zr=Object.prototype,Jr=Zr.toString;function Kr(e){return Jr.call(e)}var Qr="[object Null]",Xr="[object Undefined]",Mt=oe?oe.toStringTag:void 0;function we(e){return e==null?e===void 0?Xr:Qr:Mt&&Mt in Object(e)?Yr(e):Kr(e)}function ye(e){return e!=null&&typeof e=="object"}var kr="[object Symbol]";function eo(e){return typeof e=="symbol"||ye(e)&&we(e)==kr}function to(e,r){for(var a=-1,s=e==null?0:e.length,h=Array(s);++a<s;)h[a]=r(e[a],a,e);return h}var ze=Array.isArray,no=1/0,$t=oe?oe.prototype:void 0,Nt=$t?$t.toString:void 0;function Lt(e){if(typeof e=="string")return e;if(ze(e))return to(e,Lt)+"";if(eo(e))return Nt?Nt.call(e):"";var r=e+"";return r=="0"&&1/e==-no?"-0":r}function Pe(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var ro="[object AsyncFunction]",oo="[object Function]",io="[object GeneratorFunction]",ao="[object Proxy]";function Ut(e){if(!Pe(e))return!1;var r=we(e);return r==oo||r==io||r==ro||r==ao}var et=K["__core-js_shared__"],zt=function(){var e=/[^.]+$/.exec(et&&et.keys&&et.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function uo(e){return!!zt&&zt in e}var so=Function.prototype,co=so.toString;function ue(e){if(e!=null){try{return co.call(e)}catch{}try{return e+""}catch{}}return""}var fo=/[\\^$.*+?()[\]{}|]/g,lo=/^\[object .+?Constructor\]$/,ho=Function.prototype,po=Object.prototype,go=ho.toString,vo=po.hasOwnProperty,wo=RegExp("^"+go.call(vo).replace(fo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yo(e){if(!Pe(e)||uo(e))return!1;var r=Ut(e)?wo:lo;return r.test(ue(e))}function mo(e,r){return e?.[r]}function se(e,r){var a=mo(e,r);return yo(a)?a:void 0}var tt=se(K,"WeakMap"),Ft=Object.create,_o=function(){function e(){}return function(r){if(!Pe(r))return{};if(Ft)return Ft(r);e.prototype=r;var a=new e;return e.prototype=void 0,a}}();function Eo(e,r){var a=-1,s=e.length;for(r||(r=Array(s));++a<s;)r[a]=e[a];return r}var qt=function(){try{var e=se(Object,"defineProperty");return e({},"",{}),e}catch{}}();function bo(e,r){for(var a=-1,s=e==null?0:e.length;++a<s&&r(e[a],a,e)!==!1;);return e}var Ao=9007199254740991,So=/^(?:0|[1-9]\d*)$/;function To(e,r){var a=typeof e;return r=r??Ao,!!r&&(a=="number"||a!="symbol"&&So.test(e))&&e>-1&&e%1==0&&e<r}function Gt(e,r,a){r=="__proto__"&&qt?qt(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}function Ht(e,r){return e===r||e!==e&&r!==r}var Po=Object.prototype,Io=Po.hasOwnProperty;function Vt(e,r,a){var s=e[r];(!(Io.call(e,r)&&Ht(s,a))||a===void 0&&!(r in e))&&Gt(e,r,a)}function Fe(e,r,a,s){var h=!a;a||(a={});for(var y=-1,_=r.length;++y<_;){var P=r[y],I=s?s(a[P],e[P],P,a,e):void 0;I===void 0&&(I=e[P]),h?Gt(a,P,I):Vt(a,P,I)}return a}var Oo=9007199254740991;function Bt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Oo}function Yt(e){return e!=null&&Bt(e.length)&&!Ut(e)}var xo=Object.prototype;function nt(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||xo;return e===a}function Co(e,r){for(var a=-1,s=Array(e);++a<e;)s[a]=r(a);return s}var Do="[object Arguments]";function Zt(e){return ye(e)&&we(e)==Do}var Jt=Object.prototype,Ro=Jt.hasOwnProperty,jo=Jt.propertyIsEnumerable,Wo=Zt(function(){return arguments}())?Zt:function(e){return ye(e)&&Ro.call(e,"callee")&&!jo.call(e,"callee")};function Mo(){return!1}var Kt=typeof E=="object"&&E&&!E.nodeType&&E,Qt=Kt&&typeof module=="object"&&module&&!module.nodeType&&module,$o=Qt&&Qt.exports===Kt,Xt=$o?K.Buffer:void 0,No=Xt?Xt.isBuffer:void 0,kt=No||Mo,Lo="[object Arguments]",Uo="[object Array]",zo="[object Boolean]",Fo="[object Date]",qo="[object Error]",Go="[object Function]",Ho="[object Map]",Vo="[object Number]",Bo="[object Object]",Yo="[object RegExp]",Zo="[object Set]",Jo="[object String]",Ko="[object WeakMap]",Qo="[object ArrayBuffer]",Xo="[object DataView]",ko="[object Float32Array]",ei="[object Float64Array]",ti="[object Int8Array]",ni="[object Int16Array]",ri="[object Int32Array]",oi="[object Uint8Array]",ii="[object Uint8ClampedArray]",ai="[object Uint16Array]",ui="[object Uint32Array]",R={};R[ko]=R[ei]=R[ti]=R[ni]=R[ri]=R[oi]=R[ii]=R[ai]=R[ui]=!0,R[Lo]=R[Uo]=R[Qo]=R[zo]=R[Xo]=R[Fo]=R[qo]=R[Go]=R[Ho]=R[Vo]=R[Bo]=R[Yo]=R[Zo]=R[Jo]=R[Ko]=!1;function si(e){return ye(e)&&Bt(e.length)&&!!R[we(e)]}function rt(e){return function(r){return e(r)}}var en=typeof E=="object"&&E&&!E.nodeType&&E,Ie=en&&typeof module=="object"&&module&&!module.nodeType&&module,ci=Ie&&Ie.exports===en,ot=ci&&jt.process,me=function(){try{var e=Ie&&Ie.require&&Ie.require("util").types;return e||ot&&ot.binding&&ot.binding("util")}catch{}}(),tn=me&&me.isTypedArray,fi=tn?rt(tn):si,di=Object.prototype,li=di.hasOwnProperty;function nn(e,r){var a=ze(e),s=!a&&Wo(e),h=!a&&!s&&kt(e),y=!a&&!s&&!h&&fi(e),_=a||s||h||y,P=_?Co(e.length,String):[],I=P.length;for(var F in e)(r||li.call(e,F))&&!(_&&(F=="length"||h&&(F=="offset"||F=="parent")||y&&(F=="buffer"||F=="byteLength"||F=="byteOffset")||To(F,I)))&&P.push(F);return P}function rn(e,r){return function(a){return e(r(a))}}var hi=rn(Object.keys,Object),pi=Object.prototype,gi=pi.hasOwnProperty;function vi(e){if(!nt(e))return hi(e);var r=[];for(var a in Object(e))gi.call(e,a)&&a!="constructor"&&r.push(a);return r}function it(e){return Yt(e)?nn(e):vi(e)}function wi(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}var yi=Object.prototype,mi=yi.hasOwnProperty;function _i(e){if(!Pe(e))return wi(e);var r=nt(e),a=[];for(var s in e)s=="constructor"&&(r||!mi.call(e,s))||a.push(s);return a}function at(e){return Yt(e)?nn(e,!0):_i(e)}var Oe=se(Object,"create");function Ei(){this.__data__=Oe?Oe(null):{},this.size=0}function bi(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var Ai="__lodash_hash_undefined__",Si=Object.prototype,Ti=Si.hasOwnProperty;function Pi(e){var r=this.__data__;if(Oe){var a=r[e];return a===Ai?void 0:a}return Ti.call(r,e)?r[e]:void 0}var Ii=Object.prototype,Oi=Ii.hasOwnProperty;function xi(e){var r=this.__data__;return Oe?r[e]!==void 0:Oi.call(r,e)}var Ci="__lodash_hash_undefined__";function Di(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=Oe&&r===void 0?Ci:r,this}function ce(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ce.prototype.clear=Ei,ce.prototype.delete=bi,ce.prototype.get=Pi,ce.prototype.has=xi,ce.prototype.set=Di;function Ri(){this.__data__=[],this.size=0}function qe(e,r){for(var a=e.length;a--;)if(Ht(e[a][0],r))return a;return-1}var ji=Array.prototype,Wi=ji.splice;function Mi(e){var r=this.__data__,a=qe(r,e);if(a<0)return!1;var s=r.length-1;return a==s?r.pop():Wi.call(r,a,1),--this.size,!0}function $i(e){var r=this.__data__,a=qe(r,e);return a<0?void 0:r[a][1]}function Ni(e){return qe(this.__data__,e)>-1}function Li(e,r){var a=this.__data__,s=qe(a,e);return s<0?(++this.size,a.push([e,r])):a[s][1]=r,this}function te(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}te.prototype.clear=Ri,te.prototype.delete=Mi,te.prototype.get=$i,te.prototype.has=Ni,te.prototype.set=Li;var xe=se(K,"Map");function Ui(){this.size=0,this.__data__={hash:new ce,map:new(xe||te),string:new ce}}function zi(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function Ge(e,r){var a=e.__data__;return zi(r)?a[typeof r=="string"?"string":"hash"]:a.map}function Fi(e){var r=Ge(this,e).delete(e);return this.size-=r?1:0,r}function qi(e){return Ge(this,e).get(e)}function Gi(e){return Ge(this,e).has(e)}function Hi(e,r){var a=Ge(this,e),s=a.size;return a.set(e,r),this.size+=a.size==s?0:1,this}function _e(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}_e.prototype.clear=Ui,_e.prototype.delete=Fi,_e.prototype.get=qi,_e.prototype.has=Gi,_e.prototype.set=Hi;function He(e){return e==null?"":Lt(e)}function on(e,r){for(var a=-1,s=r.length,h=e.length;++a<s;)e[h+a]=r[a];return e}var Vi=rn(Object.getPrototypeOf,Object);const an=Vi;function Bi(e,r,a){var s=-1,h=e.length;r<0&&(r=-r>h?0:h+r),a=a>h?h:a,a<0&&(a+=h),h=r>a?0:a-r>>>0,r>>>=0;for(var y=Array(h);++s<h;)y[s]=e[s+r];return y}function Yi(e,r,a){var s=e.length;return a=a===void 0?s:a,!r&&a>=s?e:Bi(e,r,a)}var Zi="\\ud800-\\udfff",Ji="\\u0300-\\u036f",Ki="\\ufe20-\\ufe2f",Qi="\\u20d0-\\u20ff",Xi=Ji+Ki+Qi,ki="\\ufe0e\\ufe0f",ea="\\u200d",ta=RegExp("["+ea+Zi+Xi+ki+"]");function un(e){return ta.test(e)}function na(e){return e.split("")}var sn="\\ud800-\\udfff",ra="\\u0300-\\u036f",oa="\\ufe20-\\ufe2f",ia="\\u20d0-\\u20ff",aa=ra+oa+ia,ua="\\ufe0e\\ufe0f",sa="["+sn+"]",ut="["+aa+"]",st="\\ud83c[\\udffb-\\udfff]",ca="(?:"+ut+"|"+st+")",cn="[^"+sn+"]",fn="(?:\\ud83c[\\udde6-\\uddff]){2}",dn="[\\ud800-\\udbff][\\udc00-\\udfff]",fa="\\u200d",ln=ca+"?",hn="["+ua+"]?",da="(?:"+fa+"(?:"+[cn,fn,dn].join("|")+")"+hn+ln+")*",la=hn+ln+da,ha="(?:"+[cn+ut+"?",ut,fn,dn,sa].join("|")+")",pa=RegExp(st+"(?="+st+")|"+ha+la,"g");function ga(e){return e.match(pa)||[]}function va(e){return un(e)?ga(e):na(e)}function wa(e){return function(r){r=He(r);var a=un(r)?va(r):void 0,s=a?a[0]:r.charAt(0),h=a?Yi(a,1).join(""):r.slice(1);return s[e]()+h}}var ya=wa("toUpperCase");function ma(e){return ya(He(e).toLowerCase())}function _a(e,r,a,s){var h=-1,y=e==null?0:e.length;for(s&&y&&(a=e[++h]);++h<y;)a=r(a,e[h],h,e);return a}function Ea(e){return function(r){return e?.[r]}}var ba={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Aa=Ea(ba);const Sa=Aa;var Ta=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Pa="\\u0300-\\u036f",Ia="\\ufe20-\\ufe2f",Oa="\\u20d0-\\u20ff",xa=Pa+Ia+Oa,Ca="["+xa+"]",Da=RegExp(Ca,"g");function Ra(e){return e=He(e),e&&e.replace(Ta,Sa).replace(Da,"")}var ja=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Wa(e){return e.match(ja)||[]}var Ma=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function $a(e){return Ma.test(e)}var pn="\\ud800-\\udfff",Na="\\u0300-\\u036f",La="\\ufe20-\\ufe2f",Ua="\\u20d0-\\u20ff",za=Na+La+Ua,gn="\\u2700-\\u27bf",vn="a-z\\xdf-\\xf6\\xf8-\\xff",Fa="\\xac\\xb1\\xd7\\xf7",qa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ga="\\u2000-\\u206f",Ha=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",wn="A-Z\\xc0-\\xd6\\xd8-\\xde",Va="\\ufe0e\\ufe0f",yn=Fa+qa+Ga+Ha,mn="['’]",_n="["+yn+"]",Ba="["+za+"]",En="\\d+",Ya="["+gn+"]",bn="["+vn+"]",An="[^"+pn+yn+En+gn+vn+wn+"]",Za="\\ud83c[\\udffb-\\udfff]",Ja="(?:"+Ba+"|"+Za+")",Ka="[^"+pn+"]",Sn="(?:\\ud83c[\\udde6-\\uddff]){2}",Tn="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee="["+wn+"]",Qa="\\u200d",Pn="(?:"+bn+"|"+An+")",Xa="(?:"+Ee+"|"+An+")",In="(?:"+mn+"(?:d|ll|m|re|s|t|ve))?",On="(?:"+mn+"(?:D|LL|M|RE|S|T|VE))?",xn=Ja+"?",Cn="["+Va+"]?",ka="(?:"+Qa+"(?:"+[Ka,Sn,Tn].join("|")+")"+Cn+xn+")*",eu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",nu=Cn+xn+ka,ru="(?:"+[Ya,Sn,Tn].join("|")+")"+nu,ou=RegExp([Ee+"?"+bn+"+"+In+"(?="+[_n,Ee,"$"].join("|")+")",Xa+"+"+On+"(?="+[_n,Ee+Pn,"$"].join("|")+")",Ee+"?"+Pn+"+"+In,Ee+"+"+On,tu,eu,En,ru].join("|"),"g");function iu(e){return e.match(ou)||[]}function au(e,r,a){return e=He(e),r=a?void 0:r,r===void 0?$a(e)?iu(e):Wa(e):e.match(r)||[]}var uu="['’]",su=RegExp(uu,"g");function Dn(e){return function(r){return _a(au(Ra(r).replace(su,"")),e,"")}}var cu=Dn(function(e,r,a){return r=r.toLowerCase(),e+(a?ma(r):r)});const fu=cu;function du(){this.__data__=new te,this.size=0}function lu(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}function hu(e){return this.__data__.get(e)}function pu(e){return this.__data__.has(e)}var gu=200;function vu(e,r){var a=this.__data__;if(a instanceof te){var s=a.__data__;if(!xe||s.length<gu-1)return s.push([e,r]),this.size=++a.size,this;a=this.__data__=new _e(s)}return a.set(e,r),this.size=a.size,this}function be(e){var r=this.__data__=new te(e);this.size=r.size}be.prototype.clear=du,be.prototype.delete=lu,be.prototype.get=hu,be.prototype.has=pu,be.prototype.set=vu;function wu(e,r){return e&&Fe(r,it(r),e)}function yu(e,r){return e&&Fe(r,at(r),e)}var Rn=typeof E=="object"&&E&&!E.nodeType&&E,jn=Rn&&typeof module=="object"&&module&&!module.nodeType&&module,mu=jn&&jn.exports===Rn,Wn=mu?K.Buffer:void 0,Mn=Wn?Wn.allocUnsafe:void 0;function _u(e,r){if(r)return e.slice();var a=e.length,s=Mn?Mn(a):new e.constructor(a);return e.copy(s),s}function Eu(e,r){for(var a=-1,s=e==null?0:e.length,h=0,y=[];++a<s;){var _=e[a];r(_,a,e)&&(y[h++]=_)}return y}function $n(){return[]}var bu=Object.prototype,Au=bu.propertyIsEnumerable,Nn=Object.getOwnPropertySymbols,ct=Nn?function(e){return e==null?[]:(e=Object(e),Eu(Nn(e),function(r){return Au.call(e,r)}))}:$n;function Su(e,r){return Fe(e,ct(e),r)}var Tu=Object.getOwnPropertySymbols,Ln=Tu?function(e){for(var r=[];e;)on(r,ct(e)),e=an(e);return r}:$n;function Pu(e,r){return Fe(e,Ln(e),r)}function Un(e,r,a){var s=r(e);return ze(e)?s:on(s,a(e))}function Iu(e){return Un(e,it,ct)}function Ou(e){return Un(e,at,Ln)}var ft=se(K,"DataView"),dt=se(K,"Promise"),lt=se(K,"Set"),zn="[object Map]",xu="[object Object]",Fn="[object Promise]",qn="[object Set]",Gn="[object WeakMap]",Hn="[object DataView]",Cu=ue(ft),Du=ue(xe),Ru=ue(dt),ju=ue(lt),Wu=ue(tt),fe=we;(ft&&fe(new ft(new ArrayBuffer(1)))!=Hn||xe&&fe(new xe)!=zn||dt&&fe(dt.resolve())!=Fn||lt&&fe(new lt)!=qn||tt&&fe(new tt)!=Gn)&&(fe=function(e){var r=we(e),a=r==xu?e.constructor:void 0,s=a?ue(a):"";if(s)switch(s){case Cu:return Hn;case Du:return zn;case Ru:return Fn;case ju:return qn;case Wu:return Gn}return r});const ht=fe;var Mu=Object.prototype,$u=Mu.hasOwnProperty;function Nu(e){var r=e.length,a=new e.constructor(r);return r&&typeof e[0]=="string"&&$u.call(e,"index")&&(a.index=e.index,a.input=e.input),a}var Vn=K.Uint8Array;function pt(e){var r=new e.constructor(e.byteLength);return new Vn(r).set(new Vn(e)),r}function Lu(e,r){var a=r?pt(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.byteLength)}var Uu=/\w*$/;function zu(e){var r=new e.constructor(e.source,Uu.exec(e));return r.lastIndex=e.lastIndex,r}var Bn=oe?oe.prototype:void 0,Yn=Bn?Bn.valueOf:void 0;function Fu(e){return Yn?Object(Yn.call(e)):{}}function qu(e,r){var a=r?pt(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}var Gu="[object Boolean]",Hu="[object Date]",Vu="[object Map]",Bu="[object Number]",Yu="[object RegExp]",Zu="[object Set]",Ju="[object String]",Ku="[object Symbol]",Qu="[object ArrayBuffer]",Xu="[object DataView]",ku="[object Float32Array]",es="[object Float64Array]",ts="[object Int8Array]",ns="[object Int16Array]",rs="[object Int32Array]",os="[object Uint8Array]",is="[object Uint8ClampedArray]",as="[object Uint16Array]",us="[object Uint32Array]";function ss(e,r,a){var s=e.constructor;switch(r){case Qu:return pt(e);case Gu:case Hu:return new s(+e);case Xu:return Lu(e,a);case ku:case es:case ts:case ns:case rs:case os:case is:case as:case us:return qu(e,a);case Vu:return new s;case Bu:case Ju:return new s(e);case Yu:return zu(e);case Zu:return new s;case Ku:return Fu(e)}}function cs(e){return typeof e.constructor=="function"&&!nt(e)?_o(an(e)):{}}var fs="[object Map]";function ds(e){return ye(e)&&ht(e)==fs}var Zn=me&&me.isMap,ls=Zn?rt(Zn):ds,hs="[object Set]";function ps(e){return ye(e)&&ht(e)==hs}var Jn=me&&me.isSet,gs=Jn?rt(Jn):ps,vs=1,ws=2,ys=4,Kn="[object Arguments]",ms="[object Array]",_s="[object Boolean]",Es="[object Date]",bs="[object Error]",Qn="[object Function]",As="[object GeneratorFunction]",Ss="[object Map]",Ts="[object Number]",Xn="[object Object]",Ps="[object RegExp]",Is="[object Set]",Os="[object String]",xs="[object Symbol]",Cs="[object WeakMap]",Ds="[object ArrayBuffer]",Rs="[object DataView]",js="[object Float32Array]",Ws="[object Float64Array]",Ms="[object Int8Array]",$s="[object Int16Array]",Ns="[object Int32Array]",Ls="[object Uint8Array]",Us="[object Uint8ClampedArray]",zs="[object Uint16Array]",Fs="[object Uint32Array]",x={};x[Kn]=x[ms]=x[Ds]=x[Rs]=x[_s]=x[Es]=x[js]=x[Ws]=x[Ms]=x[$s]=x[Ns]=x[Ss]=x[Ts]=x[Xn]=x[Ps]=x[Is]=x[Os]=x[xs]=x[Ls]=x[Us]=x[zs]=x[Fs]=!0,x[bs]=x[Qn]=x[Cs]=!1;function Ve(e,r,a,s,h,y){var _,P=r&vs,I=r&ws,F=r&ys;if(a&&(_=h?a(e,s,h,y):a(e)),_!==void 0)return _;if(!Pe(e))return e;var Q=ze(e);if(Q){if(_=Nu(e),!P)return Eo(e,_)}else{var re=ht(e),le=re==Qn||re==As;if(kt(e))return _u(e,P);if(re==Xn||re==Kn||le&&!h){if(_=I||le?{}:cs(e),!P)return I?Pu(e,yu(_,e)):Su(e,wu(_,e))}else{if(!x[re])return h?e:{};_=ss(e,re,P)}}y||(y=new be);var he=y.get(e);if(he)return he;y.set(e,_),gs(e)?e.forEach(function(H){_.add(Ve(H,r,a,H,e,y))}):ls(e)&&e.forEach(function(H,k){_.set(k,Ve(H,r,a,k,e,y))});var q=F?I?Ou:Iu:I?at:it,X=Q?void 0:q(e);return bo(X||e,function(H,k){X&&(k=H,H=e[k]),Vt(_,k,Ve(H,r,a,k,e,y))}),_}var qs=1,Gs=4;function Hs(e){return Ve(e,qs|Gs)}var Be=Dn(function(e,r,a){return e+(a?"_":"")+r.toLowerCase()});function Vs(e={}){return this.API.request("open",e)}function Bs(e){return this.API.request("open_external_url",e)}function Ys(){return this.API.request("get_env")}function Zs(e){return this.API.request("update_my_user",e)}function Js(){return this.API.request("get_languages")}function Ks(e){return E.highLevelApi.API.request("get_events",e)}function Qs(e){return E.highLevelApi.API.request("create_event",e)}function Xs(e){return E.highLevelApi.API.request("update_event",e)}function ks(e){return E.highLevelApi.API.request("delete_event",e)}function ec(e){return this.API.request("get_canvases",e)}function tc(e){return this.API.request("create_canvas",e)}function nc(e){return this.API.request("delete_canvas",e)}function rc(e){return this.API.request("update_canvas",e)}function oc(e){return this.API.request("get_canvas",e)}function ic(e){return this.API.request("share_canvas",e)}function ac(e){const r={...e};return r.type&&(r.type=Array.isArray(r.type)?r.type:[r.type]),r.content_type&&(r.content_type=Array.isArray(r.content_type)?r.content_type:[r.content_type]),this.API.request("get_files",r)}function uc(e){return this.API.request("get_recent_files",e||{})}function sc(e){return this.API.request("download_file",e)}function cc(e){return this.API.request("get_app_config",e)}function fc(e){return this.API.request("get_file",e)}function dc(e){return this.API.request("update_file",e)}function lc(e){return this.API.request("delete_file",e)}function hc(e){return this.API.request("create_file",e)}function pc(){return this.API.request("select_device_file")}function gc(e){return this.API.request("search",e)}function vc(e){return this.API.request("get_users",e)}function wc(e){return this.API.request("refresh_service_token",e)}function yc(e){return this.API.request("fetch_document_info",e)}function mc(e){return this.API.request("render_page_as_image",e)}function _c(e){return this.API.request("toast",e)}function Ec(e){return E.highLevelApi.API.request("query",e)}function bc(e={id:"root"}){return this.API.request("get_folder",e)}function Ac(e){return this.API.request("create_folder",e)}function Sc(e){return this.API.request("update_folder",e)}function Tc(e){return this.API.request("delete_folder",e)}function Pc(e){return this.API.request("move_folder_items",e)}function Ic(e){return this.API.request("get_favorites",e)}function Oc(e){return this.API.request("create_favorite",e)}function xc(e){return this.API.request("delete_favorite",e)}function Cc(e){return e.type||(e.type="native"),E.highLevelApi.API.request("notify",e)}function Dc(e){return E.highLevelApi.API.request("track",e)}function Rc(e){return this.API.request("get_instance_metadata_templates",e)}function jc(){return this.API.request("trigger_non_files_sync")}function Wc(e){return E.highLevelApi.API.request("submit_user_feedback",e)}function Mc(){return E.highLevelApi.API.request("close")}function $c(e){return this.API.request("open_web_view_always_on_top",e)}const Nc=Object.freeze(Object.defineProperty({__proto__:null,close:Mc,createCanvas:tc,createEvent:Qs,createFavorite:Oc,createFile:hc,createFolder:Ac,deleteCanvas:nc,deleteEvent:ks,deleteFavorite:xc,deleteFile:lc,deleteFolder:Tc,downloadFile:sc,fetchDocumentInfo:yc,getAppConfig:cc,getCanvas:oc,getCanvases:ec,getEnv:Ys,getEvents:Ks,getFavorites:Ic,getFile:fc,getFiles:ac,getFolder:bc,getInstanceMetadataTemplates:Rc,getLanguages:Js,getRecentFiles:uc,getUsers:vc,moveFolderItems:Pc,notify:Cc,open:Vs,openExternalUrl:Bs,openWebViewAlwaysOnTop:$c,query:Ec,refreshServiceToken:wc,renderPageAsImage:mc,search:gc,selectDeviceFile:pc,shareCanvas:ic,submitUserFeedback:Wc,toast:_c,track:Dc,triggerNonFilesSync:jc,updateCanvas:rc,updateEvent:Xs,updateFile:dc,updateFolder:Sc,updateMyUser:Zs},Symbol.toStringTag,{value:"Module"}));class kn{listeners={};on(r,a){this.listeners[r]=(this.listeners[r]??[]).concat(a)}off(r,a){this.listeners[r]=(this.listeners[r]??[]).filter(s=>s!==a)}emit(r,a){(this.listeners[r]??[]).forEach(s=>s(a))}}let Ye;const Lc=new Uint8Array(16);function Uc(){if(!Ye&&(Ye=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ye))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ye(Lc)}const z=[];for(let e=0;e<256;++e)z.push((e+256).toString(16).slice(1));function zc(e,r=0){return z[e[r+0]]+z[e[r+1]]+z[e[r+2]]+z[e[r+3]]+"-"+z[e[r+4]]+z[e[r+5]]+"-"+z[e[r+6]]+z[e[r+7]]+"-"+z[e[r+8]]+z[e[r+9]]+"-"+z[e[r+10]]+z[e[r+11]]+z[e[r+12]]+z[e[r+13]]+z[e[r+14]]+z[e[r+15]]}const er={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Fc(e,r,a){if(er.randomUUID&&!r&&!e)return er.randomUUID();e=e||{};const s=e.random||(e.rng||Uc)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,r){a=a||0;for(let h=0;h<16;++h)r[a+h]=s[h];return r}return zc(s)}class qc extends Error{}function Gc(e,r){if(!e)throw new qc(r)}const tr=["id__in","modified_at__gtr","created_at__gtr","end_at__lt","start_at__gt","account__id","end_at__gt","end_at__range","start_at__lt","start_at__range","external_objects__connection_id","external_objects__content_type","external_objects__external_content_type","external_objects__external_object_id"],nr=["context","overrides","filters","metadata","style","hidden"],Ce=(e,r=tr,a=nr)=>Array.isArray(e)?e.map(s=>Ce(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:fu(h),_=a.includes(h)?e[h]:Ce(e[h],r,a);return{...s,[y]:_}},{}):e,gt=(e,r=tr,a=nr)=>Array.isArray(e)?e.map(s=>gt(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:Be(h),_=a.includes(h)?e[h]:gt(e[h],r,a);return{...s,[y]:_}},{}):e;function Hc(e,r=[],a=["development","test"].includes("production")){if(a)return!0;if(!e||!e.origin)return!1;const s=[...r,window.location.origin,"pitcher.com"],h=s.includes(e.origin)||s.some(y=>e.origin.endsWith(y));return h||console.warn(`The message origin ${e.origin} is not the same as the current origin ${window.location.origin}. Bailing...`),h}class Vc extends kn{constructor(r){super(),this.callbacks={},this.options=r??{casing:"snake",logLevel:"off",errorLogger:()=>{}},typeof window<"u"&&(window.addEventListener("message",a=>{Hc(a)&&(this.options.logLevel==="debug"&&console.log("message received",a),a.data.type==="PITCHER_RESPONSE"?(Gc(a.data.request.id,"event id is required"),this.handleCallbackMessage(a.data.request.id,a.data)):a.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?Ce(a.data.event):a.data.event))}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(r,a){this.callbacks[r]&&(this.callbacks[r].callback(a),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[r].dispatched_at} ms for the event ${this.callbacks[r].type}`),delete this.callbacks[r])}handleEventMessage(r){this.emit("event",r)}request(r,a=null){return new Promise((s,h)=>{const y=Fc(),_=I=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${y} response:`,I),I.response.status==="ok")s(this.options.casing==="camel"?Ce(I.response.body):I.response.body);else if(I.response.status==="error")this.options.errorLogger?.({message:`Pitcher JS API call failure: ${I.request.type}`,js_api_response:JSON.stringify(I)}),h(this.options.casing==="camel"?Ce(I.response.body):I.response.body);else throw new Error("unsupported response status")},P=Hs(gt(a));this.callbacks[y]={dispatched_at:Date.now(),type:r,payload:P??{},callback:_},typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:r,id:y,body:P}},"*")})}}function Bc(e){const r=new Vc(e),a=new kn;return r.on("event",s=>{a.emit(s.type,s.body)}),{API:r,...Nc,on:(s,h)=>a.on(s,h),off:(s,h)=>a.off(s,h),enterFullscreen:()=>r.request("enter_fullscreen"),exitFullscreen:()=>r.request("exit_fullscreen"),logout:()=>r.request("logout"),quitInstance:()=>r.request("quit_instance"),getRequestTypes:()=>r.request("get_request_types"),broadcast:s=>r.request("broadcast",s),subscribe:()=>r.request("subscribe"),unsubscribe:()=>r.request("unsubscribe")}}function $(){return window.postRobot?window.postRobot:Promise.resolve().then(()=>Gr).then(e=>e.default||e)}const Yc="UI_MESSAGE",ne={UI_SELECT_CONTENT:"ui_select_content",UI_OPEN:"ui_open",UI_EMBEDDABLE_READY:"ui_embeddable_ready",UI_TOAST:"ui_toast",UI_CAPTURE_APP_ERROR:"ui_capture_app_error",UI_UPDATE_CANVAS:"ui_update_canvas",UI_UPDATE_LOCATION:"ui_update_location"},Zc={UI_CONTENT_SELECTED:"ui_content_selected"};async function Jc(e={}){const r=await $();return console.warn("[content.ui.ts]: ui_select_content is deprecated and might get removed in future versions, please use select_content instead."),(await r.send(window.parent,ne.UI_SELECT_CONTENT,e)).data}async function Kc(e={}){return(await(await $()).send(window.parent,ne.UI_SELECT_CONTENT,e)).data}async function Qc(e){await(await $()).send(window.parent,ne.UI_OPEN,e)}async function Xc(e){await(await $()).send(window.parent,ne.UI_TOAST,e)}async function kc(){await(await $()).send(window.parent,ne.UI_EMBEDDABLE_READY)}async function ef(e){return(await $()).send(window.top,ne.UI_UPDATE_LOCATION,e)}async function tf(e){(await $()).send(window.parent,ne.UI_CAPTURE_APP_ERROR,e)}async function nf(e){return(await $()).send(window.parent,ne.UI_UPDATE_CANVAS,e).then(a=>a.data)}async function rf(e,r){return(await $()).on(e,h=>r(h.data)).cancel}const of=Object.freeze(Object.defineProperty({__proto__:null,capture_app_error:tf,embeddable_ready:kc,on:rf,open:Qc,select_content:Kc,toast:Xc,ui_select_content:Jc,update_canvas:nf,update_location:ef},Symbol.toStringTag,{value:"Module"})),af="ADMIN_MESSAGE",uf={ENV_CHANGED:"admin_env_changed"},sf={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},de={CREATE_CANVAS:"admin_create_canvas",GET_ENV:"admin_get_env",GET_CANVAS:"admin_get_canvas",GET_CANVASES:"admin_get_canvases",UPDATE_CANVAS:"admin_update_canvas",GET_INSTANCE_METADATA_TEMPLATES:"admin_get_instance_metadata_templates",GET_APP_CONFIG:"admin_get_app_config"};async function cf(){return(await(await $()).send(window.parent,de.GET_ENV)).data}async function ff(e){return(await(await $()).send(window.parent,de.CREATE_CANVAS,e)).data}async function df(e){return(await(await $()).send(window.parent,de.GET_CANVASES,e)).data}async function lf(e){return(await(await $()).send(window.parent,de.GET_CANVAS,e)).data}async function hf(e){return(await(await $()).send(window.parent,de.UPDATE_CANVAS,e)).data}async function pf(e){return(await(await $()).send(window.parent,de.GET_INSTANCE_METADATA_TEMPLATES,e)).data}async function gf(e,r){return(await $()).on(e,h=>r(h.data)).cancel}const vf=Object.freeze(Object.defineProperty({__proto__:null,createCanvas:ff,getCanvas:lf,getCanvases:df,getEnv:cf,getInstanceMetadataTemplates:pf,on:gf,updateCanvas:hf},Symbol.toStringTag,{value:"Module"})),wf="DSR_MESSAGE",yf={ENV_CHANGED:"dsr_env_changed"},mf={DSR_REQUEST:"DSR_REQUEST",DSR_RESPONSE:"DSR_RESPONSE"},vt={GET_ENV:"dsr_get_env",DSR_EMBEDDABLE_READY:"dsr_embeddable_ready"};async function _f(){return(await(await $()).send(window.parent,vt.GET_ENV)).data}async function Ef(){await(await $()).send(window.parent,vt.DSR_EMBEDDABLE_READY)}async function bf(e,r){return(await $()).on(e,h=>r(h.data)).cancel}const Af=Object.freeze(Object.defineProperty({__proto__:null,embeddable_ready:Ef,getEnv:_f,on:bf},Symbol.toStringTag,{value:"Module"})),Sf="PITCHER_EVENT";var rr=(e=>(e.REQUEST="PITCHER_REQUEST",e.RESPONSE="PITCHER_RESPONSE",e))(rr||{}),or=(e=>(e.OK="ok",e.ERROR="error",e))(or||{}),ir=(e=>(e.ENV_CHANGED="env_changed",e.PHOTOS_CAPTURED="photos_captured",e.FILE_DOWNLOADED="file_downloaded",e.FILE_UPLOAD_PROGRESS="file_upload_progress",e.UPDATE_LOCATION="update_location",e.CANVAS_UPDATED="canvas_updated",e.CANVAS_UPDATED_SUCCESS="canvas_updated_success",e.FILE_CLOSED="file_closed",e.APP_BACKGROUNDED="app_backgrounded",e.APP_FOREGROUNDED="app_foregrounded",e.NON_FILES_SYNC_FINISHED="non_files_sync_finished",e.CONTENT_LIST_REFRESH_REQUESTED="content_list_refresh_requested",e.NETWORK_CONNECTION_ESTABLISHED="network_connection_established",e.NETWORK_CONNECTION_LOST="network_connection_lost",e.ENTERED_FULLSCREEN="entered_fullscreen",e.EXITED_FULLSCREEN="exited_fullscreen",e.SUBMIT_POSTCALL_CLICKED="submit_postcall_clicked",e))(ir||{}),ar=(e=>(e.UI_SHOW_MODAL="ui:show-modal",e.UI_HIDE_MODAL="ui:hide-modal",e.FAVORITES_CHANGED="favorites:changed",e.FILE_DOWNLOAD="file:download",e))(ar||{}),ur=(e=>(e.CREATE_AND_OPEN_CANVAS="create_and_open_canvas",e.OPEN_CANVAS="open_canvas",e.START_CALL="start_call",e))(ur||{});E.highLevelApi=void 0;function Ze(e){return E.highLevelApi||(E.highLevelApi=Bc(e)),E.highLevelApi}const Tf=Object.entries(of).reduce((e,[r,a])=>(e[r]=a,e[Be(r)]=a,e),{});function wt(){return Tf}const Pf=Object.entries(vf).reduce((e,[r,a])=>(e[r]=a,e[Be(r)]=a,e),{});function sr(){return Pf}const If=Object.entries(Af).reduce((e,[r,a])=>(e[r]=a,e[Be(r)]=a,e),{});function cr(){return If}function Of(){if(typeof window>"u")throw new Error("getAvailableApis: window is not defined");const e=window.parent.jsApiLocation;return e==="ui"?["ui","impact"]:[e??"impact"]}function xf(){if(typeof window>"u")throw new Error("useApi: window is not defined");const e=window.parent.jsApiLocation;switch(e){case"ui":return{...Ze(),...wt(),ui:wt(),impact:Ze()};case"admin":return sr();case"dsr":return cr();case"impact":return Ze();default:throw new Error(`Unknown api for location: ${e}`)}}window.postRobot=Rt,E.ADMIN_API_METHOD_TYPES=de,E.ADMIN_API_TYPES=sf,E.ADMIN_MESSAGE=af,E.ADMIN_MESSAGE_TYPES=uf,E.DSR_API_METHOD_TYPES=vt,E.DSR_API_TYPES=mf,E.DSR_MESSAGE=wf,E.DSR_MESSAGE_TYPES=yf,E.PITCHER_EVENT=Sf,E.PitcherBroadcastedEventName=ar,E.PitcherEventName=ir,E.PitcherExternalEventName=ur,E.PitcherMessageType=rr,E.PitcherResponseStatus=or,E.UI_API_METHOD_TYPES=ne,E.UI_MESSAGE=Yc,E.UI_MESSAGE_TYPES=Zc,E.getAvailableApis=Of,E.useAdmin=sr,E.useApi=xf,E.useDsr=cr,E.usePitcherApi=Ze,E.useUi=wt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
17
|
+
`+Ne(P))})})})};function Zf(t,o,n){return jr(t,o,n,{on:ie,send:ae})}function Jf(t,o,n){return Mr(t,o,n,{on:ie,send:ae})}function Kf(t){return new Y({send:ae,win:t})}function kf(t){return Y.toProxyWindow(t,{send:ae})}function zr(){Le().initialized||(Le().initialized=!0,o=(t={on:ie,send:ae}).on,n=t.send,(i=Le()).receiveMessage=i.receiveMessage||function(u){return Ur(u,{on:o,send:n})},function(u){var c=u.on,f=u.send;L().getOrSet("postMessageListener",function(){return function(p,l,d){return p.addEventListener("message",d),{cancel:function(){p.removeEventListener("message",d)}}}(window,0,function(p){(function(l,d){var w=d.on,g=d.send;O.try(function(){var v=l.source||l.sourceElement,m=l.origin||l.originalEvent&&l.originalEvent.origin,S=l.data;if(m==="null"&&(m="file://"),v){if(!m)throw new Error("Post message did not have origin domain");Ur({source:v,origin:m,data:S},{on:w,send:g})}})})(p,{on:c,send:f})})})}({on:ie,send:ae}),function(u){var c=u.on,f=u.send;L("builtinListeners").getOrSet("helloListener",function(){var p=c("postrobot_hello",{domain:"*"},function(d){return Pr(d.source,{domain:d.origin}),{instanceID:Tr()}}),l=lr();return l&&bt(l,{send:f}).catch(function(d){}),p})}({on:ie,send:ae}));var t,o,n,i}function Qf(){(function(){for(var o=L("responseListeners"),n=0,i=o.keys();n<i.length;n++){var u=i[n],c=o.get(u);c&&(c.cancelled=!0),o.del(u)}})(),(t=L().get("postMessageListener"))&&t.cancel();var t;delete window.__post_robot_10_0_46__}var Xf=!0;function ed(t){for(var o=0,n=G("requestPromises").get(t,[]);o<n.length;o++)n[o].reject(new Error("Window "+(Z(t)?"closed":"cleaned up")+" before response")).catch(ge)}zr()}])})})(Ct);var Gr=Ct.exports;(function(e){e.exports=Gr,e.exports.default=e.exports})(xt);var Dt=xt.exports;const Rt=qr(Dt),Hr=Se({__proto__:null,default:Rt},[Dt]);var jt=typeof global=="object"&&global&&global.Object===Object&&global,Vr=typeof self=="object"&&self&&self.Object===Object&&self,K=jt||Vr||Function("return this")(),oe=K.Symbol,Mt=Object.prototype,Br=Mt.hasOwnProperty,Yr=Mt.toString,Te=oe?oe.toStringTag:void 0;function Zr(e){var r=Br.call(e,Te),a=e[Te];try{e[Te]=void 0;var s=!0}catch{}var h=Yr.call(e);return s&&(r?e[Te]=a:delete e[Te]),h}var Jr=Object.prototype,Kr=Jr.toString;function kr(e){return Kr.call(e)}var Qr="[object Null]",Xr="[object Undefined]",Wt=oe?oe.toStringTag:void 0;function we(e){return e==null?e===void 0?Xr:Qr:Wt&&Wt in Object(e)?Zr(e):kr(e)}function ye(e){return e!=null&&typeof e=="object"}var eo="[object Symbol]";function to(e){return typeof e=="symbol"||ye(e)&&we(e)==eo}function no(e,r){for(var a=-1,s=e==null?0:e.length,h=Array(s);++a<s;)h[a]=r(e[a],a,e);return h}var ze=Array.isArray,ro=1/0,Nt=oe?oe.prototype:void 0,$t=Nt?Nt.toString:void 0;function Lt(e){if(typeof e=="string")return e;if(ze(e))return no(e,Lt)+"";if(to(e))return $t?$t.call(e):"";var r=e+"";return r=="0"&&1/e==-ro?"-0":r}function Pe(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var oo="[object AsyncFunction]",io="[object Function]",ao="[object GeneratorFunction]",uo="[object Proxy]";function Ut(e){if(!Pe(e))return!1;var r=we(e);return r==io||r==ao||r==oo||r==uo}var et=K["__core-js_shared__"],zt=function(){var e=/[^.]+$/.exec(et&&et.keys&&et.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function so(e){return!!zt&&zt in e}var co=Function.prototype,fo=co.toString;function ue(e){if(e!=null){try{return fo.call(e)}catch{}try{return e+""}catch{}}return""}var lo=/[\\^$.*+?()[\]{}|]/g,ho=/^\[object .+?Constructor\]$/,po=Function.prototype,go=Object.prototype,vo=po.toString,wo=go.hasOwnProperty,yo=RegExp("^"+vo.call(wo).replace(lo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mo(e){if(!Pe(e)||so(e))return!1;var r=Ut(e)?yo:ho;return r.test(ue(e))}function _o(e,r){return e?.[r]}function se(e,r){var a=_o(e,r);return mo(a)?a:void 0}var tt=se(K,"WeakMap"),Ft=Object.create,Eo=function(){function e(){}return function(r){if(!Pe(r))return{};if(Ft)return Ft(r);e.prototype=r;var a=new e;return e.prototype=void 0,a}}();function bo(e,r){var a=-1,s=e.length;for(r||(r=Array(s));++a<s;)r[a]=e[a];return r}var qt=function(){try{var e=se(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Ao(e,r){for(var a=-1,s=e==null?0:e.length;++a<s&&r(e[a],a,e)!==!1;);return e}var So=9007199254740991,To=/^(?:0|[1-9]\d*)$/;function Po(e,r){var a=typeof e;return r=r??So,!!r&&(a=="number"||a!="symbol"&&To.test(e))&&e>-1&&e%1==0&&e<r}function Gt(e,r,a){r=="__proto__"&&qt?qt(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}function Ht(e,r){return e===r||e!==e&&r!==r}var Io=Object.prototype,Oo=Io.hasOwnProperty;function Vt(e,r,a){var s=e[r];(!(Oo.call(e,r)&&Ht(s,a))||a===void 0&&!(r in e))&&Gt(e,r,a)}function Fe(e,r,a,s){var h=!a;a||(a={});for(var y=-1,_=r.length;++y<_;){var T=r[y],I=s?s(a[T],e[T],T,a,e):void 0;I===void 0&&(I=e[T]),h?Gt(a,T,I):Vt(a,T,I)}return a}var xo=9007199254740991;function Bt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=xo}function Yt(e){return e!=null&&Bt(e.length)&&!Ut(e)}var Co=Object.prototype;function nt(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||Co;return e===a}function Do(e,r){for(var a=-1,s=Array(e);++a<e;)s[a]=r(a);return s}var Ro="[object Arguments]";function Zt(e){return ye(e)&&we(e)==Ro}var Jt=Object.prototype,jo=Jt.hasOwnProperty,Mo=Jt.propertyIsEnumerable,Wo=Zt(function(){return arguments}())?Zt:function(e){return ye(e)&&jo.call(e,"callee")&&!Mo.call(e,"callee")};function No(){return!1}var Kt=typeof E=="object"&&E&&!E.nodeType&&E,kt=Kt&&typeof module=="object"&&module&&!module.nodeType&&module,$o=kt&&kt.exports===Kt,Qt=$o?K.Buffer:void 0,Lo=Qt?Qt.isBuffer:void 0,Xt=Lo||No,Uo="[object Arguments]",zo="[object Array]",Fo="[object Boolean]",qo="[object Date]",Go="[object Error]",Ho="[object Function]",Vo="[object Map]",Bo="[object Number]",Yo="[object Object]",Zo="[object RegExp]",Jo="[object Set]",Ko="[object String]",ko="[object WeakMap]",Qo="[object ArrayBuffer]",Xo="[object DataView]",ei="[object Float32Array]",ti="[object Float64Array]",ni="[object Int8Array]",ri="[object Int16Array]",oi="[object Int32Array]",ii="[object Uint8Array]",ai="[object Uint8ClampedArray]",ui="[object Uint16Array]",si="[object Uint32Array]",R={};R[ei]=R[ti]=R[ni]=R[ri]=R[oi]=R[ii]=R[ai]=R[ui]=R[si]=!0,R[Uo]=R[zo]=R[Qo]=R[Fo]=R[Xo]=R[qo]=R[Go]=R[Ho]=R[Vo]=R[Bo]=R[Yo]=R[Zo]=R[Jo]=R[Ko]=R[ko]=!1;function ci(e){return ye(e)&&Bt(e.length)&&!!R[we(e)]}function rt(e){return function(r){return e(r)}}var en=typeof E=="object"&&E&&!E.nodeType&&E,Ie=en&&typeof module=="object"&&module&&!module.nodeType&&module,fi=Ie&&Ie.exports===en,ot=fi&&jt.process,me=function(){try{var e=Ie&&Ie.require&&Ie.require("util").types;return e||ot&&ot.binding&&ot.binding("util")}catch{}}(),tn=me&&me.isTypedArray,di=tn?rt(tn):ci,li=Object.prototype,hi=li.hasOwnProperty;function nn(e,r){var a=ze(e),s=!a&&Wo(e),h=!a&&!s&&Xt(e),y=!a&&!s&&!h&&di(e),_=a||s||h||y,T=_?Do(e.length,String):[],I=T.length;for(var F in e)(r||hi.call(e,F))&&!(_&&(F=="length"||h&&(F=="offset"||F=="parent")||y&&(F=="buffer"||F=="byteLength"||F=="byteOffset")||Po(F,I)))&&T.push(F);return T}function rn(e,r){return function(a){return e(r(a))}}var pi=rn(Object.keys,Object),gi=Object.prototype,vi=gi.hasOwnProperty;function wi(e){if(!nt(e))return pi(e);var r=[];for(var a in Object(e))vi.call(e,a)&&a!="constructor"&&r.push(a);return r}function it(e){return Yt(e)?nn(e):wi(e)}function yi(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}var mi=Object.prototype,_i=mi.hasOwnProperty;function Ei(e){if(!Pe(e))return yi(e);var r=nt(e),a=[];for(var s in e)s=="constructor"&&(r||!_i.call(e,s))||a.push(s);return a}function at(e){return Yt(e)?nn(e,!0):Ei(e)}var Oe=se(Object,"create");function bi(){this.__data__=Oe?Oe(null):{},this.size=0}function Ai(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var Si="__lodash_hash_undefined__",Ti=Object.prototype,Pi=Ti.hasOwnProperty;function Ii(e){var r=this.__data__;if(Oe){var a=r[e];return a===Si?void 0:a}return Pi.call(r,e)?r[e]:void 0}var Oi=Object.prototype,xi=Oi.hasOwnProperty;function Ci(e){var r=this.__data__;return Oe?r[e]!==void 0:xi.call(r,e)}var Di="__lodash_hash_undefined__";function Ri(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=Oe&&r===void 0?Di:r,this}function ce(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ce.prototype.clear=bi,ce.prototype.delete=Ai,ce.prototype.get=Ii,ce.prototype.has=Ci,ce.prototype.set=Ri;function ji(){this.__data__=[],this.size=0}function qe(e,r){for(var a=e.length;a--;)if(Ht(e[a][0],r))return a;return-1}var Mi=Array.prototype,Wi=Mi.splice;function Ni(e){var r=this.__data__,a=qe(r,e);if(a<0)return!1;var s=r.length-1;return a==s?r.pop():Wi.call(r,a,1),--this.size,!0}function $i(e){var r=this.__data__,a=qe(r,e);return a<0?void 0:r[a][1]}function Li(e){return qe(this.__data__,e)>-1}function Ui(e,r){var a=this.__data__,s=qe(a,e);return s<0?(++this.size,a.push([e,r])):a[s][1]=r,this}function ne(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ne.prototype.clear=ji,ne.prototype.delete=Ni,ne.prototype.get=$i,ne.prototype.has=Li,ne.prototype.set=Ui;var xe=se(K,"Map");function zi(){this.size=0,this.__data__={hash:new ce,map:new(xe||ne),string:new ce}}function Fi(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function Ge(e,r){var a=e.__data__;return Fi(r)?a[typeof r=="string"?"string":"hash"]:a.map}function qi(e){var r=Ge(this,e).delete(e);return this.size-=r?1:0,r}function Gi(e){return Ge(this,e).get(e)}function Hi(e){return Ge(this,e).has(e)}function Vi(e,r){var a=Ge(this,e),s=a.size;return a.set(e,r),this.size+=a.size==s?0:1,this}function _e(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}_e.prototype.clear=zi,_e.prototype.delete=qi,_e.prototype.get=Gi,_e.prototype.has=Hi,_e.prototype.set=Vi;function He(e){return e==null?"":Lt(e)}function on(e,r){for(var a=-1,s=r.length,h=e.length;++a<s;)e[h+a]=r[a];return e}var Bi=rn(Object.getPrototypeOf,Object);const an=Bi;function Yi(e,r,a){var s=-1,h=e.length;r<0&&(r=-r>h?0:h+r),a=a>h?h:a,a<0&&(a+=h),h=r>a?0:a-r>>>0,r>>>=0;for(var y=Array(h);++s<h;)y[s]=e[s+r];return y}function Zi(e,r,a){var s=e.length;return a=a===void 0?s:a,!r&&a>=s?e:Yi(e,r,a)}var Ji="\\ud800-\\udfff",Ki="\\u0300-\\u036f",ki="\\ufe20-\\ufe2f",Qi="\\u20d0-\\u20ff",Xi=Ki+ki+Qi,ea="\\ufe0e\\ufe0f",ta="\\u200d",na=RegExp("["+ta+Ji+Xi+ea+"]");function un(e){return na.test(e)}function ra(e){return e.split("")}var sn="\\ud800-\\udfff",oa="\\u0300-\\u036f",ia="\\ufe20-\\ufe2f",aa="\\u20d0-\\u20ff",ua=oa+ia+aa,sa="\\ufe0e\\ufe0f",ca="["+sn+"]",ut="["+ua+"]",st="\\ud83c[\\udffb-\\udfff]",fa="(?:"+ut+"|"+st+")",cn="[^"+sn+"]",fn="(?:\\ud83c[\\udde6-\\uddff]){2}",dn="[\\ud800-\\udbff][\\udc00-\\udfff]",da="\\u200d",ln=fa+"?",hn="["+sa+"]?",la="(?:"+da+"(?:"+[cn,fn,dn].join("|")+")"+hn+ln+")*",ha=hn+ln+la,pa="(?:"+[cn+ut+"?",ut,fn,dn,ca].join("|")+")",ga=RegExp(st+"(?="+st+")|"+pa+ha,"g");function va(e){return e.match(ga)||[]}function wa(e){return un(e)?va(e):ra(e)}function ya(e){return function(r){r=He(r);var a=un(r)?wa(r):void 0,s=a?a[0]:r.charAt(0),h=a?Zi(a,1).join(""):r.slice(1);return s[e]()+h}}var ma=ya("toUpperCase");function _a(e){return ma(He(e).toLowerCase())}function Ea(e,r,a,s){var h=-1,y=e==null?0:e.length;for(s&&y&&(a=e[++h]);++h<y;)a=r(a,e[h],h,e);return a}function ba(e){return function(r){return e?.[r]}}var Aa={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Sa=ba(Aa);const Ta=Sa;var Pa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ia="\\u0300-\\u036f",Oa="\\ufe20-\\ufe2f",xa="\\u20d0-\\u20ff",Ca=Ia+Oa+xa,Da="["+Ca+"]",Ra=RegExp(Da,"g");function ja(e){return e=He(e),e&&e.replace(Pa,Ta).replace(Ra,"")}var Ma=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Wa(e){return e.match(Ma)||[]}var Na=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function $a(e){return Na.test(e)}var pn="\\ud800-\\udfff",La="\\u0300-\\u036f",Ua="\\ufe20-\\ufe2f",za="\\u20d0-\\u20ff",Fa=La+Ua+za,gn="\\u2700-\\u27bf",vn="a-z\\xdf-\\xf6\\xf8-\\xff",qa="\\xac\\xb1\\xd7\\xf7",Ga="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ha="\\u2000-\\u206f",Va=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",wn="A-Z\\xc0-\\xd6\\xd8-\\xde",Ba="\\ufe0e\\ufe0f",yn=qa+Ga+Ha+Va,mn="['’]",_n="["+yn+"]",Ya="["+Fa+"]",En="\\d+",Za="["+gn+"]",bn="["+vn+"]",An="[^"+pn+yn+En+gn+vn+wn+"]",Ja="\\ud83c[\\udffb-\\udfff]",Ka="(?:"+Ya+"|"+Ja+")",ka="[^"+pn+"]",Sn="(?:\\ud83c[\\udde6-\\uddff]){2}",Tn="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee="["+wn+"]",Qa="\\u200d",Pn="(?:"+bn+"|"+An+")",Xa="(?:"+Ee+"|"+An+")",In="(?:"+mn+"(?:d|ll|m|re|s|t|ve))?",On="(?:"+mn+"(?:D|LL|M|RE|S|T|VE))?",xn=Ka+"?",Cn="["+Ba+"]?",eu="(?:"+Qa+"(?:"+[ka,Sn,Tn].join("|")+")"+Cn+xn+")*",tu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ru=Cn+xn+eu,ou="(?:"+[Za,Sn,Tn].join("|")+")"+ru,iu=RegExp([Ee+"?"+bn+"+"+In+"(?="+[_n,Ee,"$"].join("|")+")",Xa+"+"+On+"(?="+[_n,Ee+Pn,"$"].join("|")+")",Ee+"?"+Pn+"+"+In,Ee+"+"+On,nu,tu,En,ou].join("|"),"g");function au(e){return e.match(iu)||[]}function uu(e,r,a){return e=He(e),r=a?void 0:r,r===void 0?$a(e)?au(e):Wa(e):e.match(r)||[]}var su="['’]",cu=RegExp(su,"g");function Dn(e){return function(r){return Ea(uu(ja(r).replace(cu,"")),e,"")}}var fu=Dn(function(e,r,a){return r=r.toLowerCase(),e+(a?_a(r):r)});const du=fu;function lu(){this.__data__=new ne,this.size=0}function hu(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}function pu(e){return this.__data__.get(e)}function gu(e){return this.__data__.has(e)}var vu=200;function wu(e,r){var a=this.__data__;if(a instanceof ne){var s=a.__data__;if(!xe||s.length<vu-1)return s.push([e,r]),this.size=++a.size,this;a=this.__data__=new _e(s)}return a.set(e,r),this.size=a.size,this}function be(e){var r=this.__data__=new ne(e);this.size=r.size}be.prototype.clear=lu,be.prototype.delete=hu,be.prototype.get=pu,be.prototype.has=gu,be.prototype.set=wu;function yu(e,r){return e&&Fe(r,it(r),e)}function mu(e,r){return e&&Fe(r,at(r),e)}var Rn=typeof E=="object"&&E&&!E.nodeType&&E,jn=Rn&&typeof module=="object"&&module&&!module.nodeType&&module,_u=jn&&jn.exports===Rn,Mn=_u?K.Buffer:void 0,Wn=Mn?Mn.allocUnsafe:void 0;function Eu(e,r){if(r)return e.slice();var a=e.length,s=Wn?Wn(a):new e.constructor(a);return e.copy(s),s}function bu(e,r){for(var a=-1,s=e==null?0:e.length,h=0,y=[];++a<s;){var _=e[a];r(_,a,e)&&(y[h++]=_)}return y}function Nn(){return[]}var Au=Object.prototype,Su=Au.propertyIsEnumerable,$n=Object.getOwnPropertySymbols,ct=$n?function(e){return e==null?[]:(e=Object(e),bu($n(e),function(r){return Su.call(e,r)}))}:Nn;function Tu(e,r){return Fe(e,ct(e),r)}var Pu=Object.getOwnPropertySymbols,Ln=Pu?function(e){for(var r=[];e;)on(r,ct(e)),e=an(e);return r}:Nn;function Iu(e,r){return Fe(e,Ln(e),r)}function Un(e,r,a){var s=r(e);return ze(e)?s:on(s,a(e))}function Ou(e){return Un(e,it,ct)}function xu(e){return Un(e,at,Ln)}var ft=se(K,"DataView"),dt=se(K,"Promise"),lt=se(K,"Set"),zn="[object Map]",Cu="[object Object]",Fn="[object Promise]",qn="[object Set]",Gn="[object WeakMap]",Hn="[object DataView]",Du=ue(ft),Ru=ue(xe),ju=ue(dt),Mu=ue(lt),Wu=ue(tt),fe=we;(ft&&fe(new ft(new ArrayBuffer(1)))!=Hn||xe&&fe(new xe)!=zn||dt&&fe(dt.resolve())!=Fn||lt&&fe(new lt)!=qn||tt&&fe(new tt)!=Gn)&&(fe=function(e){var r=we(e),a=r==Cu?e.constructor:void 0,s=a?ue(a):"";if(s)switch(s){case Du:return Hn;case Ru:return zn;case ju:return Fn;case Mu:return qn;case Wu:return Gn}return r});const ht=fe;var Nu=Object.prototype,$u=Nu.hasOwnProperty;function Lu(e){var r=e.length,a=new e.constructor(r);return r&&typeof e[0]=="string"&&$u.call(e,"index")&&(a.index=e.index,a.input=e.input),a}var Vn=K.Uint8Array;function pt(e){var r=new e.constructor(e.byteLength);return new Vn(r).set(new Vn(e)),r}function Uu(e,r){var a=r?pt(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.byteLength)}var zu=/\w*$/;function Fu(e){var r=new e.constructor(e.source,zu.exec(e));return r.lastIndex=e.lastIndex,r}var Bn=oe?oe.prototype:void 0,Yn=Bn?Bn.valueOf:void 0;function qu(e){return Yn?Object(Yn.call(e)):{}}function Gu(e,r){var a=r?pt(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}var Hu="[object Boolean]",Vu="[object Date]",Bu="[object Map]",Yu="[object Number]",Zu="[object RegExp]",Ju="[object Set]",Ku="[object String]",ku="[object Symbol]",Qu="[object ArrayBuffer]",Xu="[object DataView]",es="[object Float32Array]",ts="[object Float64Array]",ns="[object Int8Array]",rs="[object Int16Array]",os="[object Int32Array]",is="[object Uint8Array]",as="[object Uint8ClampedArray]",us="[object Uint16Array]",ss="[object Uint32Array]";function cs(e,r,a){var s=e.constructor;switch(r){case Qu:return pt(e);case Hu:case Vu:return new s(+e);case Xu:return Uu(e,a);case es:case ts:case ns:case rs:case os:case is:case as:case us:case ss:return Gu(e,a);case Bu:return new s;case Yu:case Ku:return new s(e);case Zu:return Fu(e);case Ju:return new s;case ku:return qu(e)}}function fs(e){return typeof e.constructor=="function"&&!nt(e)?Eo(an(e)):{}}var ds="[object Map]";function ls(e){return ye(e)&&ht(e)==ds}var Zn=me&&me.isMap,hs=Zn?rt(Zn):ls,ps="[object Set]";function gs(e){return ye(e)&&ht(e)==ps}var Jn=me&&me.isSet,vs=Jn?rt(Jn):gs,ws=1,ys=2,ms=4,Kn="[object Arguments]",_s="[object Array]",Es="[object Boolean]",bs="[object Date]",As="[object Error]",kn="[object Function]",Ss="[object GeneratorFunction]",Ts="[object Map]",Ps="[object Number]",Qn="[object Object]",Is="[object RegExp]",Os="[object Set]",xs="[object String]",Cs="[object Symbol]",Ds="[object WeakMap]",Rs="[object ArrayBuffer]",js="[object DataView]",Ms="[object Float32Array]",Ws="[object Float64Array]",Ns="[object Int8Array]",$s="[object Int16Array]",Ls="[object Int32Array]",Us="[object Uint8Array]",zs="[object Uint8ClampedArray]",Fs="[object Uint16Array]",qs="[object Uint32Array]",x={};x[Kn]=x[_s]=x[Rs]=x[js]=x[Es]=x[bs]=x[Ms]=x[Ws]=x[Ns]=x[$s]=x[Ls]=x[Ts]=x[Ps]=x[Qn]=x[Is]=x[Os]=x[xs]=x[Cs]=x[Us]=x[zs]=x[Fs]=x[qs]=!0,x[As]=x[kn]=x[Ds]=!1;function Ve(e,r,a,s,h,y){var _,T=r&ws,I=r&ys,F=r&ms;if(a&&(_=h?a(e,s,h,y):a(e)),_!==void 0)return _;if(!Pe(e))return e;var Q=ze(e);if(Q){if(_=Lu(e),!T)return bo(e,_)}else{var re=ht(e),le=re==kn||re==Ss;if(Xt(e))return Eu(e,T);if(re==Qn||re==Kn||le&&!h){if(_=I||le?{}:fs(e),!T)return I?Iu(e,mu(_,e)):Tu(e,yu(_,e))}else{if(!x[re])return h?e:{};_=cs(e,re,T)}}y||(y=new be);var he=y.get(e);if(he)return he;y.set(e,_),vs(e)?e.forEach(function(H){_.add(Ve(H,r,a,H,e,y))}):hs(e)&&e.forEach(function(H,ee){_.set(ee,Ve(H,r,a,ee,e,y))});var q=F?I?xu:Ou:I?at:it,X=Q?void 0:q(e);return Ao(X||e,function(H,ee){X&&(ee=H,H=e[ee]),Vt(_,ee,Ve(H,r,a,ee,e,y))}),_}var Gs=1,Hs=4;function Vs(e){return Ve(e,Gs|Hs)}var Be=Dn(function(e,r,a){return e+(a?"_":"")+r.toLowerCase()});function Bs(e={}){return this.API.request("open",e)}function Ys(e){return this.API.request("open_external_url",e)}function Zs(){return this.API.request("get_env")}function Js(e){return this.API.request("update_my_user",e)}function Ks(){return this.API.request("get_languages")}function ks(e){return E.highLevelApi.API.request("get_events",e)}function Qs(e){return E.highLevelApi.API.request("create_event",e)}function Xs(e){return E.highLevelApi.API.request("update_event",e)}function ec(e){return E.highLevelApi.API.request("delete_event",e)}function tc(e){return this.API.request("get_canvases",e)}function nc(e){return this.API.request("create_canvas",e)}function rc(e){return this.API.request("delete_canvas",e)}function oc(e){return this.API.request("update_canvas",e)}function ic(e){return this.API.request("get_canvas",e)}function ac(e){return this.API.request("share_canvas",e)}function uc(e){const r={...e};return r.type&&(r.type=Array.isArray(r.type)?r.type:[r.type]),r.content_type&&(r.content_type=Array.isArray(r.content_type)?r.content_type:[r.content_type]),this.API.request("get_files",r)}function sc(e){return this.API.request("get_recent_files",e||{})}function cc(e){return this.API.request("download_file",e)}function fc(e){return this.API.request("get_app_config",e)}function dc(e){return this.API.request("get_file",e)}function lc(e){return this.API.request("update_file",e)}function hc(e){return this.API.request("delete_file",e)}function pc(e){return this.API.request("create_file",e)}function gc(){return this.API.request("select_device_file")}function vc(e){return this.API.request("search",e)}function wc(e){return this.API.request("get_users",e)}function yc(e){return this.API.request("refresh_service_token",e)}function mc(e){return this.API.request("fetch_document_info",e)}function _c(e){return this.API.request("render_page_as_image",e)}function Ec(e){return this.API.request("toast",e)}function bc(e){return E.highLevelApi.API.request("query",e)}function Ac(e={id:"root"}){return this.API.request("get_folder",e)}function Sc(e){return this.API.request("create_folder",e)}function Tc(e){return this.API.request("update_folder",e)}function Pc(e){return this.API.request("delete_folder",e)}function Ic(e){return this.API.request("move_folder_items",e)}function Oc(e){return this.API.request("get_favorites",e)}function xc(e){return this.API.request("create_favorite",e)}function Cc(e){return this.API.request("delete_favorite",e)}function Dc(e){return e.type||(e.type="native"),E.highLevelApi.API.request("notify",e)}function Rc(e){return E.highLevelApi.API.request("track",e)}function jc(e){return this.API.request("get_instance_metadata_templates",e)}function Mc(){return this.API.request("trigger_non_files_sync")}function Wc(e){return E.highLevelApi.API.request("submit_user_feedback",e)}function Nc(){return E.highLevelApi.API.request("close")}function $c(e){return this.API.request("open_web_view_always_on_top",e)}const Lc=Object.freeze(Object.defineProperty({__proto__:null,close:Nc,createCanvas:nc,createEvent:Qs,createFavorite:xc,createFile:pc,createFolder:Sc,deleteCanvas:rc,deleteEvent:ec,deleteFavorite:Cc,deleteFile:hc,deleteFolder:Pc,downloadFile:cc,fetchDocumentInfo:mc,getAppConfig:fc,getCanvas:ic,getCanvases:tc,getEnv:Zs,getEvents:ks,getFavorites:Oc,getFile:dc,getFiles:uc,getFolder:Ac,getInstanceMetadataTemplates:jc,getLanguages:Ks,getRecentFiles:sc,getUsers:wc,moveFolderItems:Ic,notify:Dc,open:Bs,openExternalUrl:Ys,openWebViewAlwaysOnTop:$c,query:bc,refreshServiceToken:yc,renderPageAsImage:_c,search:vc,selectDeviceFile:gc,shareCanvas:ac,submitUserFeedback:Wc,toast:Ec,track:Rc,triggerNonFilesSync:Mc,updateCanvas:oc,updateEvent:Xs,updateFile:lc,updateFolder:Tc,updateMyUser:Js},Symbol.toStringTag,{value:"Module"}));class Xn{listeners={};on(r,a){this.listeners[r]=(this.listeners[r]??[]).concat(a)}off(r,a){this.listeners[r]=(this.listeners[r]??[]).filter(s=>s!==a)}emit(r,a){(this.listeners[r]??[]).forEach(s=>s(a))}}let Ye;const Uc=new Uint8Array(16);function zc(){if(!Ye&&(Ye=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ye))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ye(Uc)}const z=[];for(let e=0;e<256;++e)z.push((e+256).toString(16).slice(1));function Fc(e,r=0){return z[e[r+0]]+z[e[r+1]]+z[e[r+2]]+z[e[r+3]]+"-"+z[e[r+4]]+z[e[r+5]]+"-"+z[e[r+6]]+z[e[r+7]]+"-"+z[e[r+8]]+z[e[r+9]]+"-"+z[e[r+10]]+z[e[r+11]]+z[e[r+12]]+z[e[r+13]]+z[e[r+14]]+z[e[r+15]]}const er={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qc(e,r,a){if(er.randomUUID&&!r&&!e)return er.randomUUID();e=e||{};const s=e.random||(e.rng||zc)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,r){a=a||0;for(let h=0;h<16;++h)r[a+h]=s[h];return r}return Fc(s)}class Gc extends Error{}function Hc(e,r){if(!e)throw new Gc(r)}const tr=["id__in","modified_at__gtr","created_at__gtr","end_at__lt","start_at__gt","account__id","end_at__gt","end_at__range","start_at__lt","start_at__range","external_objects__connection_id","external_objects__content_type","external_objects__external_content_type","external_objects__external_object_id"],nr=["context","overrides","filters","metadata","style","hidden"],rr=(e,r)=>r.includes(e)||e.endsWith("style"),Ce=(e,r=tr,a=nr)=>Array.isArray(e)?e.map(s=>Ce(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=rr(h,a),_=r.includes(h)||y?h:du(h),T=y?e[h]:Ce(e[h],r,a);return{...s,[_]:T}},{}):e,gt=(e,r=tr,a=nr)=>Array.isArray(e)?e.map(s=>gt(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=rr(h,a),_=r.includes(h)||y?h:Be(h),T=y?e[h]:gt(e[h],r,a);return{...s,[_]:T}},{}):e;function Vc(e,r=[],a=["development","test"].includes("production")){if(a)return!0;if(!e||!e.origin)return!1;const s=[...r,window.location.origin,"pitcher.com"],h=s.includes(e.origin)||s.some(y=>e.origin.endsWith(y));return h||console.warn(`The message origin ${e.origin} is not the same as the current origin ${window.location.origin}. Bailing...`),h}class Bc extends Xn{constructor(r){super(),this.callbacks={},this.options=r??{casing:"snake",logLevel:"off",errorLogger:()=>{}},typeof window<"u"&&(window.addEventListener("message",a=>{Vc(a)&&(this.options.logLevel==="debug"&&console.log("message received",a),a.data.type==="PITCHER_RESPONSE"?(Hc(a.data.request.id,"event id is required"),this.handleCallbackMessage(a.data.request.id,a.data)):a.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?Ce(a.data.event):a.data.event))}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(r,a){this.callbacks[r]&&(this.callbacks[r].callback(a),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[r].dispatched_at} ms for the event ${this.callbacks[r].type}`),delete this.callbacks[r])}handleEventMessage(r){this.emit("event",r)}request(r,a=null){return new Promise((s,h)=>{const y=qc(),_=I=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${y} response:`,I),I.response.status==="ok")s(this.options.casing==="camel"?Ce(I.response.body):I.response.body);else if(I.response.status==="error")this.options.errorLogger?.({message:`Pitcher JS API call failure: ${I.request.type}`,js_api_response:JSON.stringify(I)}),h(this.options.casing==="camel"?Ce(I.response.body):I.response.body);else throw new Error("unsupported response status")},T=Vs(gt(a));this.callbacks[y]={dispatched_at:Date.now(),type:r,payload:T??{},callback:_},typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:r,id:y,body:T}},"*")})}}function Yc(e){const r=new Bc(e),a=new Xn;return r.on("event",s=>{a.emit(s.type,s.body)}),{API:r,...Lc,on:(s,h)=>a.on(s,h),off:(s,h)=>a.off(s,h),enterFullscreen:()=>r.request("enter_fullscreen"),exitFullscreen:()=>r.request("exit_fullscreen"),logout:()=>r.request("logout"),quitInstance:()=>r.request("quit_instance"),getRequestTypes:()=>r.request("get_request_types"),broadcast:s=>r.request("broadcast",s),subscribe:()=>r.request("subscribe"),unsubscribe:()=>r.request("unsubscribe")}}function W(){return window.postRobot?window.postRobot:Promise.resolve().then(()=>Hr).then(e=>e.default||e)}const Zc="UI_MESSAGE",k={UI_SELECT_CONTENT:"ui_select_content",UI_OPEN:"ui_open",UI_EMBEDDABLE_READY:"ui_embeddable_ready",UI_TOAST:"ui_toast",UI_CAPTURE_APP_ERROR:"ui_capture_app_error",UI_UPDATE_CANVAS:"ui_update_canvas",UI_UPDATE_LOCATION:"ui_update_location",UI_PRESELECT_SFDC_MEETING_ID:"ui_preselect_sfdc_meeting_id"},Jc={UI_CONTENT_SELECTED:"ui_content_selected"};async function Kc(e={}){const r=await W();return console.warn("[content.ui.ts]: ui_select_content is deprecated and might get removed in future versions, please use select_content instead."),(await r.send(window.parent,k.UI_SELECT_CONTENT,e)).data}async function kc(e={}){return(await(await W()).send(window.parent,k.UI_SELECT_CONTENT,e)).data}async function Qc(e){await(await W()).send(window.parent,k.UI_OPEN,e)}async function Xc(e){await(await W()).send(window.parent,k.UI_TOAST,e)}async function ef(e){return(await(await W()).send(window.parent,k.UI_PRESELECT_SFDC_MEETING_ID,e)).data}async function tf(){await(await W()).send(window.parent,k.UI_EMBEDDABLE_READY)}async function nf(e){return(await W()).send(window.top,k.UI_UPDATE_LOCATION,e)}async function rf(e){(await W()).send(window.parent,k.UI_CAPTURE_APP_ERROR,e)}async function of(e){return(await W()).send(window.parent,k.UI_UPDATE_CANVAS,e).then(a=>a.data)}async function af(e,r){return(await W()).on(e,h=>r(h.data)).cancel}const uf=Object.freeze(Object.defineProperty({__proto__:null,capture_app_error:rf,embeddable_ready:tf,on:af,open:Qc,preselect_sfdc_meeting_id:ef,select_content:kc,toast:Xc,ui_select_content:Kc,update_canvas:of,update_location:nf},Symbol.toStringTag,{value:"Module"})),sf="ADMIN_MESSAGE",cf={ENV_CHANGED:"admin_env_changed"},ff={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},de={CREATE_CANVAS:"admin_create_canvas",GET_ENV:"admin_get_env",GET_CANVAS:"admin_get_canvas",GET_CANVASES:"admin_get_canvases",UPDATE_CANVAS:"admin_update_canvas",GET_INSTANCE_METADATA_TEMPLATES:"admin_get_instance_metadata_templates",GET_APP_CONFIG:"admin_get_app_config"};async function df(){return(await(await W()).send(window.parent,de.GET_ENV)).data}async function lf(e){return(await(await W()).send(window.parent,de.CREATE_CANVAS,e)).data}async function hf(e){return(await(await W()).send(window.parent,de.GET_CANVASES,e)).data}async function pf(e){return(await(await W()).send(window.parent,de.GET_CANVAS,e)).data}async function gf(e){return(await(await W()).send(window.parent,de.UPDATE_CANVAS,e)).data}async function vf(e){return(await(await W()).send(window.parent,de.GET_INSTANCE_METADATA_TEMPLATES,e)).data}async function wf(e,r){return(await W()).on(e,h=>r(h.data)).cancel}const yf=Object.freeze(Object.defineProperty({__proto__:null,createCanvas:lf,getCanvas:pf,getCanvases:hf,getEnv:df,getInstanceMetadataTemplates:vf,on:wf,updateCanvas:gf},Symbol.toStringTag,{value:"Module"})),mf="DSR_MESSAGE",_f={ENV_CHANGED:"dsr_env_changed"},Ef={DSR_REQUEST:"DSR_REQUEST",DSR_RESPONSE:"DSR_RESPONSE"},vt={GET_ENV:"dsr_get_env",DSR_EMBEDDABLE_READY:"dsr_embeddable_ready"};async function bf(){return(await(await W()).send(window.parent,vt.GET_ENV)).data}async function Af(){await(await W()).send(window.parent,vt.DSR_EMBEDDABLE_READY)}async function Sf(e,r){return(await W()).on(e,h=>r(h.data)).cancel}const Tf=Object.freeze(Object.defineProperty({__proto__:null,embeddable_ready:Af,getEnv:bf,on:Sf},Symbol.toStringTag,{value:"Module"})),Pf="PITCHER_EVENT";var or=(e=>(e.REQUEST="PITCHER_REQUEST",e.RESPONSE="PITCHER_RESPONSE",e))(or||{}),ir=(e=>(e.OK="ok",e.ERROR="error",e))(ir||{}),ar=(e=>(e.ENV_CHANGED="env_changed",e.PHOTOS_CAPTURED="photos_captured",e.FILE_DOWNLOADED="file_downloaded",e.FILE_UPLOAD_PROGRESS="file_upload_progress",e.UPDATE_LOCATION="update_location",e.CANVAS_UPDATED="canvas_updated",e.CANVAS_UPDATED_SUCCESS="canvas_updated_success",e.FILE_CLOSED="file_closed",e.APP_BACKGROUNDED="app_backgrounded",e.APP_FOREGROUNDED="app_foregrounded",e.NON_FILES_SYNC_FINISHED="non_files_sync_finished",e.CONTENT_LIST_REFRESH_REQUESTED="content_list_refresh_requested",e.NETWORK_CONNECTION_ESTABLISHED="network_connection_established",e.NETWORK_CONNECTION_LOST="network_connection_lost",e.ENTERED_FULLSCREEN="entered_fullscreen",e.EXITED_FULLSCREEN="exited_fullscreen",e.SUBMIT_POSTCALL_CLICKED="submit_postcall_clicked",e))(ar||{}),ur=(e=>(e.UI_SHOW_MODAL="ui:show-modal",e.UI_HIDE_MODAL="ui:hide-modal",e.FAVORITES_CHANGED="favorites:changed",e.FILE_DOWNLOAD="file:download",e))(ur||{}),sr=(e=>(e.CREATE_AND_OPEN_CANVAS="create_and_open_canvas",e.OPEN_CANVAS="open_canvas",e.START_CALL="start_call",e))(sr||{});E.highLevelApi=void 0;function Ze(e){return E.highLevelApi||(E.highLevelApi=Yc(e)),E.highLevelApi}const If=Object.entries(uf).reduce((e,[r,a])=>(e[r]=a,e[Be(r)]=a,e),{});function wt(){return If}const Of=Object.entries(yf).reduce((e,[r,a])=>(e[r]=a,e[Be(r)]=a,e),{});function cr(){return Of}const xf=Object.entries(Tf).reduce((e,[r,a])=>(e[r]=a,e[Be(r)]=a,e),{});function fr(){return xf}function Cf(){if(typeof window>"u")throw new Error("getAvailableApis: window is not defined");const e=window.parent.jsApiLocation;return e==="ui"?["ui","impact"]:[e??"impact"]}function Df(){if(typeof window>"u")throw new Error("useApi: window is not defined");const e=window.parent.jsApiLocation;switch(e){case"ui":return{...Ze(),...wt(),ui:wt(),impact:Ze()};case"admin":return cr();case"dsr":return fr();case"impact":return Ze();default:throw new Error(`Unknown api for location: ${e}`)}}window.postRobot=Rt,E.ADMIN_API_METHOD_TYPES=de,E.ADMIN_API_TYPES=ff,E.ADMIN_MESSAGE=sf,E.ADMIN_MESSAGE_TYPES=cf,E.DSR_API_METHOD_TYPES=vt,E.DSR_API_TYPES=Ef,E.DSR_MESSAGE=mf,E.DSR_MESSAGE_TYPES=_f,E.PITCHER_EVENT=Pf,E.PitcherBroadcastedEventName=ur,E.PitcherEventName=ar,E.PitcherExternalEventName=sr,E.PitcherMessageType=or,E.PitcherResponseStatus=ir,E.UI_API_METHOD_TYPES=k,E.UI_MESSAGE=Zc,E.UI_MESSAGE_TYPES=Jc,E.getAvailableApis=Cf,E.useAdmin=cr,E.useApi=Df,E.useDsr=fr,E.usePitcherApi=Ze,E.useUi=wt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
18
18
|
//# sourceMappingURL=js-api.umd.min.js.map
|