@pitcher/js-api 1.21.0-beta.4 → 1.21.0-beta.5
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.esm.js +8 -4
- package/js-api.esm.js.map +1 -1
- package/js-api.umd.min.js +10 -10
- package/js-api.umd.min.js.map +1 -1
- package/lib/sdk/main.d.ts +1 -1
- package/package.json +1 -1
package/js-api.umd.min.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
(function(E,
|
|
2
|
-
`;function A(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 A(t)}function P(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 ie(t){if(t===void 0&&(t=window),t&&!Q(t))try{return t.opener}catch{}}function ge(t){try{return!0}catch{}return!1}function ve(t){t===void 0&&(t=window);var o=t.location;if(!o)throw new Error("Can not read window location");var r=A(t);if(!r)throw new Error("Can not read window protocol");if(r==="file:")return"file://";if(r==="about:"){var a=Q(t);return a&&ge()?ve(a):"about://"}var s=o.host;if(!s)throw new Error("Can not read window host");return r+"//"+s}function q(t){t===void 0&&(t=window);var o=ve(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 r=Object.getOwnPropertyDescriptor(o,"location");if(r&&r.enumerable===!1)return!1}catch{}try{if(P(o)&&ge())return!0}catch{}try{if(function(a){return a===void 0&&(a=window),I(a)==="mock:"}(o)&&ge())return!0}catch{}try{if(ve(o)===ve(window))return!0}catch{}return!1}(t))return!1;try{if(t===window||P(t)&&ge()||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 r=Q(o);return r?r===t:function(a){var s=[];try{for(;a.parent!==a;)s.push(a.parent),a=a.parent}catch{}return s}(o).indexOf(t)!==-1}function Sr(t){var o=[],r;try{r=t.frames}catch{r=t}var a;try{a=r.length}catch{}if(a===0)return o;if(a){for(var s=0;s<a;s++){var c=void 0;try{c=r[s]}catch{continue}o.push(c)}return o}for(var d=0;d<100;d++){var p=void 0;try{p=r[d]}catch{return o}if(!p)return o;o.push(p)}return o}var df=[],ff=[];function k(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(s){return!s||s.message!==_}if(o&&X(t))try{if(t.mockclosed)return!0}catch{}try{if(!t.parent||!t.top)return!0}catch{}var r=function(s,c){for(var d=0;d<s.length;d++)try{if(s[d]===c)return d}catch{}return-1}(df,t);if(r!==-1){var a=ff[r];if(a&&function(s){if(!s.contentWindow||!s.parentNode)return!0;var c=s.ownerDocument;if(c&&c.documentElement&&!c.documentElement.contains(s)){for(var d=s;d.parentNode&&d.parentNode!==d;)d=d.parentNode;if(!d.host||!c.documentElement.contains(d.host))return!0}return!1}(a))return!0}return!1}function Tr(t){return t===void 0&&(t=window),ie(t=t||window)||Q(t)||void 0}function xe(t,o){if(typeof t=="string"){if(typeof o=="string")return t==="*"||o===t;if(g(o)||Array.isArray(o))return!1}return g(t)?g(o)?t.toString()===o.toString():!Array.isArray(o)&&!!o.match(t):!!Array.isArray(t)&&(Array.isArray(o)?JSON.stringify(t)===JSON.stringify(o):!g(o)&&t.some(function(r){return xe(r,o)}))}function it(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 Pr(t){if(X(t))return H(t).frameElement;for(var o=0,r=document.querySelectorAll("iframe");o<r.length;o++){var a=r[o];if(a&&a.contentWindow&&a.contentWindow===t)return a}}function lf(t){if(function(r){return r===void 0&&(r=window),!!Q(r)}(t)){var o=Pr(t);if(o&&o.parentElement){o.parentElement.removeChild(o);return}}try{t.close()}catch{}}function we(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 r=o.call(t);if(r==="[object Window]"||r==="[object global]"||r==="[object DOMWindow]")return!1}if(typeof t.then=="function")return!0}catch{return!1}return!1}var Ir=[],We=[],xt=0,ze;function Or(){if(!xt&&ze){var t=ze;ze=null,t.resolve()}}function Dt(){xt+=1}function Fe(){xt-=1,Or()}var x=function(){function t(r){var a=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=[],r){var s,c,d=!1,p=!1,l=!1;Dt();try{r(function(f){l?a.resolve(f):(d=!0,s=f)},function(f){l?a.reject(f):(p=!0,c=f)})}catch(f){Fe(),this.reject(f);return}Fe(),l=!0,d?this.resolve(s):p&&this.reject(c)}}var o=t.prototype;return o.resolve=function(r){if(this.resolved||this.rejected)return this;if(we(r))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=r,this.dispatch(),this},o.reject=function(r){var a=this;if(this.resolved||this.rejected)return this;if(we(r))throw new Error("Can not reject promise with another promise");if(!r){var s=r&&typeof r.toString=="function"?r.toString():{}.toString.call(r);r=new Error("Expected reject to be called with Error, got "+s)}return this.rejected=!0,this.error=r,this.errorHandled||setTimeout(function(){a.errorHandled||function(c,d){if(Ir.indexOf(c)===-1){Ir.push(c),setTimeout(function(){throw c},1);for(var p=0;p<We.length;p++)We[p](c,d)}}(r,a)},1),this.dispatch(),this},o.asyncReject=function(r){return this.errorHandled=!0,this.reject(r),this},o.dispatch=function(){var r=this.resolved,a=this.rejected,s=this.handlers;if(!this.dispatching&&(r||a)){this.dispatching=!0,Dt();for(var c=function(m,T){return m.then(function(b){T.resolve(b)},function(b){T.reject(b)})},d=0;d<s.length;d++){var p=s[d],l=p.onSuccess,f=p.onError,y=p.promise,v=void 0;if(r)try{v=l?l(this.value):this.value}catch(m){y.reject(m);continue}else if(a){if(!f){y.reject(this.error);continue}try{v=f(this.error)}catch(m){y.reject(m);continue}}if(v instanceof t&&(v.resolved||v.rejected)){var w=v;w.resolved?y.resolve(w.value):y.reject(w.error),w.errorHandled=!0}else we(v)?v instanceof t&&(v.resolved||v.rejected)?v.resolved?y.resolve(v.value):y.reject(v.error):c(v,y):y.resolve(v)}s.length=0,this.dispatching=!1,Fe()}},o.then=function(r,a){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for success handler");if(a&&typeof a!="function"&&!a.call)throw new Error("Promise.then expected a function for error handler");var s=new t;return this.handlers.push({promise:s,onSuccess:r,onError:a}),this.errorHandled=!0,this.dispatch(),s},o.catch=function(r){return this.then(void 0,r)},o.finally=function(r){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.finally expected a function");return this.then(function(a){return t.try(r).then(function(){return a})},function(a){return t.try(r).then(function(){throw a})})},o.timeout=function(r,a){var s=this;if(this.resolved||this.rejected)return this;var c=setTimeout(function(){s.resolved||s.rejected||s.reject(a||new Error("Promise timed out after "+r+"ms"))},r);return this.then(function(d){return clearTimeout(c),d})},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(r){return r instanceof t?r:we(r)?new t(function(a,s){return r.then(a,s)}):new t().resolve(r)},t.reject=function(r){return new t().reject(r)},t.asyncReject=function(r){return new t().asyncReject(r)},t.all=function(r){var a=new t,s=r.length,c=[].slice();if(!s)return a.resolve(c),a;for(var d=function(f,y,v){return y.then(function(w){c[f]=w,(s-=1)==0&&a.resolve(c)},function(w){v.reject(w)})},p=0;p<r.length;p++){var l=r[p];if(l instanceof t){if(l.resolved){c[p]=l.value,s-=1;continue}}else if(!we(l)){c[p]=l,s-=1;continue}d(p,t.resolve(l),a)}return s===0&&a.resolve(c),a},t.hash=function(r){var a={},s=[],c=function(p){if(r.hasOwnProperty(p)){var l=r[p];we(l)?s.push(l.then(function(f){a[p]=f})):a[p]=l}};for(var d in r)c(d);return t.all(s).then(function(){return a})},t.map=function(r,a){return t.all(r.map(a))},t.onPossiblyUnhandledException=function(r){return function(a){return We.push(a),{cancel:function(){We.splice(We.indexOf(a),1)}}}(r)},t.try=function(r,a,s){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.try expected a function");var c;Dt();try{c=r.apply(a,s||[])}catch(d){return Fe(),t.reject(d)}return Fe(),t.resolve(c)},t.delay=function(r){return new t(function(a){setTimeout(a,r)})},t.isPromise=function(r){return!!(r&&r instanceof t)||we(r)},t.flush=function(){return function(r){var a=ze=ze||new r;return Or(),a}(t)},t}();function at(t,o){for(var r=0;r<t.length;r++)try{if(t[r]===o)return r}catch{}return-1}var Rt=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 r=new WeakMap,a={};return Object.freeze(a),r.set(a,"__testvalue__"),r.get(a)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var o=t.prototype;return o._cleanupClosedWindows=function(){for(var r=this.weakmap,a=this.keys,s=0;s<a.length;s++){var c=a[s];if(it(c)&&k(c)){if(r)try{r.delete(c)}catch{}a.splice(s,1),this.values.splice(s,1),s-=1}}},o.isSafeToReadWrite=function(r){return!it(r)},o.set=function(r,a){if(!r)throw new Error("WeakMap expected key");var s=this.weakmap;if(s)try{s.set(r,a)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var c=this.name,d=r[c];d&&d[0]===r?d[1]=a:Object.defineProperty(r,c,{value:[r,a],writable:!0});return}catch{}this._cleanupClosedWindows();var p=this.keys,l=this.values,f=at(p,r);f===-1?(p.push(r),l.push(a)):l[f]=a},o.get=function(r){if(!r)throw new Error("WeakMap expected key");var a=this.weakmap;if(a)try{if(a.has(r))return a.get(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var s=r[this.name];return s&&s[0]===r?s[1]:void 0}catch{}this._cleanupClosedWindows();var c=at(this.keys,r);if(c!==-1)return this.values[c]},o.delete=function(r){if(!r)throw new Error("WeakMap expected key");var a=this.weakmap;if(a)try{a.delete(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var s=r[this.name];s&&s[0]===r&&(s[0]=s[1]=void 0)}catch{}this._cleanupClosedWindows();var c=this.keys,d=at(c,r);d!==-1&&(c.splice(d,1),this.values.splice(d,1))},o.has=function(r){if(!r)throw new Error("WeakMap expected key");var a=this.weakmap;if(a)try{if(a.has(r))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var s=r[this.name];return!(!s||s[0]!==r)}catch{}return this._cleanupClosedWindows(),at(this.keys,r)!==-1},o.getOrSet=function(r,a){if(this.has(r))return this.get(r);var s=a();return this.set(r,s),s},t}();function Cr(t){return t.name||t.__name__||t.displayName||"anonymous"}function xr(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(r,a){return String.fromCharCode(parseInt(a,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 st;function Dr(t){try{return JSON.stringify([].slice.call(t),function(o,r){return typeof r=="function"?"memoize["+function(a){if(st=st||new Rt,a==null||typeof a!="object"&&typeof a!="function")throw new Error("Invalid object");var s=st.get(a);return s||(s=typeof a+":"+te(),st.set(a,s)),s}(r)+"]":typeof window<"u"&&r instanceof window.Element||r!==null&&typeof r=="object"&&r.nodeType===1&&typeof r.style=="object"&&typeof r.ownerDocument=="object"?{}:r})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function hf(){return{}}var Ge=0,Rr=0;function qe(t,o){o===void 0&&(o={});var r=o.thisNamespace,a=r!==void 0&&r,s=o.time,c,d,p=Ge;Ge+=1;var l=function(){for(var f=arguments.length,y=new Array(f),v=0;v<f;v++)y[v]=arguments[v];p<Rr&&(c=null,d=null,p=Ge,Ge+=1);var w;w=a?(d=d||new Rt).getOrSet(this,hf):c=c||{};var m;try{m=Dr(y)}catch{return t.apply(this,arguments)}var T=w[m];if(T&&s&&Date.now()-T.time<s&&(delete w[m],T=null),T)return T.value;var b=Date.now(),S=t.apply(this,arguments);return w[m]={time:b,value:S},S};return l.reset=function(){c=null,d=null},xr(l,(o.name||Cr(t))+"::memoized")}qe.clear=function(){Rr=Ge};function pf(t){var o={};function r(){for(var a=arguments,s=this,c=arguments.length,d=new Array(c),p=0;p<c;p++)d[p]=arguments[p];var l=Dr(d);return o.hasOwnProperty(l)||(o[l]=x.try(function(){return t.apply(s,a)}).finally(function(){delete o[l]})),o[l]}return r.reset=function(){o={}},xr(r,Cr(t)+"::promiseMemoized")}function _e(){}function Ve(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 r=t&&t.stack,a=t&&t.message;if(r&&a)return r.indexOf(a)!==-1?r:a+`
|
|
3
|
-
`+r;if(r)return r;if(a)return a}return
|
|
1
|
+
(function(E,Ne){typeof exports=="object"&&typeof module<"u"?Ne(exports):typeof define=="function"&&define.amd?define(["exports"],Ne):(E=typeof globalThis<"u"?globalThis:E||self,Ne(E.pitcher={}))})(this,function(E){"use strict";function Ne(e,t){for(var o=0;o<t.length;o++){const u=t[o];if(typeof u!="string"&&!Array.isArray(u)){for(const f in u)if(f!=="default"&&!(f in e)){const d=Object.getOwnPropertyDescriptor(u,f);d&&Object.defineProperty(e,f,d.get?d:{enumerable:!0,get:()=>u[f]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qt={exports:{}},Xt={exports:{}};(function(e,t){(function(o,u){e.exports=u()})(typeof self<"u"?self:go,function(){return function(o){var u={};function f(d){if(u[d])return u[d].exports;var v=u[d]={i:d,l:!1,exports:{}};return o[d].call(v.exports,v,v.exports,f),v.l=!0,v.exports}return f.m=o,f.c=u,f.d=function(d,v,m){f.o(d,v)||Object.defineProperty(d,v,{enumerable:!0,get:m})},f.r=function(d){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})},f.t=function(d,v){if(1&v&&(d=f(d)),8&v||4&v&&typeof d=="object"&&d&&d.__esModule)return d;var m=Object.create(null);if(f.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:d}),2&v&&typeof d!="string")for(var b in d)f.d(m,b,function(S){return d[S]}.bind(null,b));return m},f.n=function(d){var v=d&&d.__esModule?function(){return d.default}:function(){return d};return f.d(v,"a",v),v},f.o=function(d,v){return{}.hasOwnProperty.call(d,v)},f.p="",f(f.s=0)}([function(o,u,f){f.r(u),f.d(u,"Promise",function(){return x}),f.d(u,"TYPES",function(){return yl}),f.d(u,"ProxyWindow",function(){return te}),f.d(u,"setup",function(){return po}),f.d(u,"destroy",function(){return wl}),f.d(u,"serializeMessage",function(){return pl}),f.d(u,"deserializeMessage",function(){return gl}),f.d(u,"createProxyWindow",function(){return vl}),f.d(u,"toProxyWindow",function(){return _l}),f.d(u,"on",function(){return le}),f.d(u,"once",function(){return hl}),f.d(u,"send",function(){return he}),f.d(u,"markWindowKnown",function(){return to}),f.d(u,"cleanUpWindow",function(){return Al}),f.d(u,"bridge",function(){});function d(n){return{}.toString.call(n)==="[object RegExp]"}var v=`Call was rejected by callee.\r
|
|
2
|
+
`;function m(n){return n===void 0&&(n=window),n.location.protocol}function b(n){if(n===void 0&&(n=window),n.mockDomain){var i=n.mockDomain.split("//")[0];if(i)return i}return m(n)}function S(n){return n===void 0&&(n=window),b(n)==="about:"}function G(n){if(n===void 0&&(n=window),n)try{if(n.parent&&n.parent!==n)return n.parent}catch{}}function W(n){if(n===void 0&&(n=window),n&&!G(n))try{return n.opener}catch{}}function M(n){try{return!0}catch{}return!1}function K(n){n===void 0&&(n=window);var i=n.location;if(!i)throw new Error("Can not read window location");var r=m(n);if(!r)throw new Error("Can not read window protocol");if(r==="file:")return"file://";if(r==="about:"){var a=G(n);return a&&M()?K(a):"about://"}var s=i.host;if(!s)throw new Error("Can not read window host");return r+"//"+s}function C(n){n===void 0&&(n=window);var i=K(n);return i&&n.mockDomain&&n.mockDomain.indexOf("mock:")===0?n.mockDomain:i}function F(n){if(!function(i){try{if(i===window)return!0}catch{}try{var r=Object.getOwnPropertyDescriptor(i,"location");if(r&&r.enumerable===!1)return!1}catch{}try{if(S(i)&&M())return!0}catch{}try{if(function(a){return a===void 0&&(a=window),b(a)==="mock:"}(i)&&M())return!0}catch{}try{if(K(i)===K(window))return!0}catch{}return!1}(n))return!1;try{if(n===window||S(n)&&M()||C(window)===C(n))return!0}catch{}return!1}function z(n){if(!F(n))throw new Error("Expected window to be same domain");return n}function V(n,i){if(!n||!i)return!1;var r=G(i);return r?r===n:function(a){var s=[];try{for(;a.parent!==a;)s.push(a.parent),a=a.parent}catch{}return s}(i).indexOf(n)!==-1}function ie(n){var i=[],r;try{r=n.frames}catch{r=n}var a;try{a=r.length}catch{}if(a===0)return i;if(a){for(var s=0;s<a;s++){var c=void 0;try{c=r[s]}catch{continue}i.push(c)}return i}for(var l=0;l<100;l++){var g=void 0;try{g=r[l]}catch{return i}if(!g)return i;i.push(g)}return i}var lt=[],Re=[];function Q(n,i){i===void 0&&(i=!0);try{if(n===window)return!1}catch{return!0}try{if(!n)return!0}catch{return!0}try{if(n.closed)return!0}catch(s){return!s||s.message!==v}if(i&&F(n))try{if(n.mockclosed)return!0}catch{}try{if(!n.parent||!n.top)return!0}catch{}var r=function(s,c){for(var l=0;l<s.length;l++)try{if(s[l]===c)return l}catch{}return-1}(lt,n);if(r!==-1){var a=Re[r];if(a&&function(s){if(!s.contentWindow||!s.parentNode)return!0;var c=s.ownerDocument;if(c&&c.documentElement&&!c.documentElement.contains(s)){for(var l=s;l.parentNode&&l.parentNode!==l;)l=l.parentNode;if(!l.host||!c.documentElement.contains(l.host))return!0}return!1}(a))return!0}return!1}function Wr(n){return n===void 0&&(n=window),W(n=n||window)||G(n)||void 0}function $e(n,i){if(typeof n=="string"){if(typeof i=="string")return n==="*"||i===n;if(d(i)||Array.isArray(i))return!1}return d(n)?d(i)?n.toString()===i.toString():!Array.isArray(i)&&!!i.match(n):!!Array.isArray(n)&&(Array.isArray(i)?JSON.stringify(n)===JSON.stringify(i):!d(i)&&n.some(function(r){return $e(r,i)}))}function ht(n){try{if(n===window)return!0}catch(i){if(i&&i.message===v)return!0}try{if({}.toString.call(n)==="[object Window]")return!0}catch(i){if(i&&i.message===v)return!0}try{if(window.Window&&n instanceof window.Window)return!0}catch(i){if(i&&i.message===v)return!0}try{if(n&&n.self===n)return!0}catch(i){if(i&&i.message===v)return!0}try{if(n&&n.parent===n)return!0}catch(i){if(i&&i.message===v)return!0}try{if(n&&n.top===n)return!0}catch(i){if(i&&i.message===v)return!0}try{if(n&&n.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in n&&"self"in n&&"location"in n)return!0}catch{}return!1}function Fr(n){if(F(n))return z(n).frameElement;for(var i=0,r=document.querySelectorAll("iframe");i<r.length;i++){var a=r[i];if(a&&a.contentWindow&&a.contentWindow===n)return a}}function el(n){if(function(r){return r===void 0&&(r=window),!!G(r)}(n)){var i=Fr(n);if(i&&i.parentElement){i.parentElement.removeChild(i);return}}try{n.close()}catch{}}function me(n){try{if(!n)return!1;if(typeof Promise<"u"&&n instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&n instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&n instanceof window.constructor)return!1;var i={}.toString;if(i){var r=i.call(n);if(r==="[object Window]"||r==="[object global]"||r==="[object DOMWindow]")return!1}if(typeof n.then=="function")return!0}catch{return!1}return!1}var zr=[],qe=[],Ft=0,He;function Gr(){if(!Ft&&He){var n=He;He=null,n.resolve()}}function zt(){Ft+=1}function Be(){Ft-=1,Gr()}var x=function(){function n(r){var a=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=[],r){var s,c,l=!1,g=!1,p=!1;zt();try{r(function(h){p?a.resolve(h):(l=!0,s=h)},function(h){p?a.reject(h):(g=!0,c=h)})}catch(h){Be(),this.reject(h);return}Be(),p=!0,l?this.resolve(s):g&&this.reject(c)}}var i=n.prototype;return i.resolve=function(r){if(this.resolved||this.rejected)return this;if(me(r))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=r,this.dispatch(),this},i.reject=function(r){var a=this;if(this.resolved||this.rejected)return this;if(me(r))throw new Error("Can not reject promise with another promise");if(!r){var s=r&&typeof r.toString=="function"?r.toString():{}.toString.call(r);r=new Error("Expected reject to be called with Error, got "+s)}return this.rejected=!0,this.error=r,this.errorHandled||setTimeout(function(){a.errorHandled||function(c,l){if(zr.indexOf(c)===-1){zr.push(c),setTimeout(function(){throw c},1);for(var g=0;g<qe.length;g++)qe[g](c,l)}}(r,a)},1),this.dispatch(),this},i.asyncReject=function(r){return this.errorHandled=!0,this.reject(r),this},i.dispatch=function(){var r=this.resolved,a=this.rejected,s=this.handlers;if(!this.dispatching&&(r||a)){this.dispatching=!0,zt();for(var c=function(A,I){return A.then(function(T){I.resolve(T)},function(T){I.reject(T)})},l=0;l<s.length;l++){var g=s[l],p=g.onSuccess,h=g.onError,y=g.promise,_=void 0;if(r)try{_=p?p(this.value):this.value}catch(A){y.reject(A);continue}else if(a){if(!h){y.reject(this.error);continue}try{_=h(this.error)}catch(A){y.reject(A);continue}}if(_ instanceof n&&(_.resolved||_.rejected)){var w=_;w.resolved?y.resolve(w.value):y.reject(w.error),w.errorHandled=!0}else me(_)?_ instanceof n&&(_.resolved||_.rejected)?_.resolved?y.resolve(_.value):y.reject(_.error):c(_,y):y.resolve(_)}s.length=0,this.dispatching=!1,Be()}},i.then=function(r,a){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for success handler");if(a&&typeof a!="function"&&!a.call)throw new Error("Promise.then expected a function for error handler");var s=new n;return this.handlers.push({promise:s,onSuccess:r,onError:a}),this.errorHandled=!0,this.dispatch(),s},i.catch=function(r){return this.then(void 0,r)},i.finally=function(r){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.finally expected a function");return this.then(function(a){return n.try(r).then(function(){return a})},function(a){return n.try(r).then(function(){throw a})})},i.timeout=function(r,a){var s=this;if(this.resolved||this.rejected)return this;var c=setTimeout(function(){s.resolved||s.rejected||s.reject(a||new Error("Promise timed out after "+r+"ms"))},r);return this.then(function(l){return clearTimeout(c),l})},i.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},i.lazy=function(){return this.errorHandled=!0,this},n.resolve=function(r){return r instanceof n?r:me(r)?new n(function(a,s){return r.then(a,s)}):new n().resolve(r)},n.reject=function(r){return new n().reject(r)},n.asyncReject=function(r){return new n().asyncReject(r)},n.all=function(r){var a=new n,s=r.length,c=[].slice();if(!s)return a.resolve(c),a;for(var l=function(h,y,_){return y.then(function(w){c[h]=w,(s-=1)==0&&a.resolve(c)},function(w){_.reject(w)})},g=0;g<r.length;g++){var p=r[g];if(p instanceof n){if(p.resolved){c[g]=p.value,s-=1;continue}}else if(!me(p)){c[g]=p,s-=1;continue}l(g,n.resolve(p),a)}return s===0&&a.resolve(c),a},n.hash=function(r){var a={},s=[],c=function(g){if(r.hasOwnProperty(g)){var p=r[g];me(p)?s.push(p.then(function(h){a[g]=h})):a[g]=p}};for(var l in r)c(l);return n.all(s).then(function(){return a})},n.map=function(r,a){return n.all(r.map(a))},n.onPossiblyUnhandledException=function(r){return function(a){return qe.push(a),{cancel:function(){qe.splice(qe.indexOf(a),1)}}}(r)},n.try=function(r,a,s){if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.try expected a function");var c;zt();try{c=r.apply(a,s||[])}catch(l){return Be(),n.reject(l)}return Be(),n.resolve(c)},n.delay=function(r){return new n(function(a){setTimeout(a,r)})},n.isPromise=function(r){return!!(r&&r instanceof n)||me(r)},n.flush=function(){return function(r){var a=He=He||new r;return Gr(),a}(n)},n}();function pt(n,i){for(var r=0;r<n.length;r++)try{if(n[r]===i)return r}catch{}return-1}var Gt=function(){function n(){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 r=new WeakMap,a={};return Object.freeze(a),r.set(a,"__testvalue__"),r.get(a)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var i=n.prototype;return i._cleanupClosedWindows=function(){for(var r=this.weakmap,a=this.keys,s=0;s<a.length;s++){var c=a[s];if(ht(c)&&Q(c)){if(r)try{r.delete(c)}catch{}a.splice(s,1),this.values.splice(s,1),s-=1}}},i.isSafeToReadWrite=function(r){return!ht(r)},i.set=function(r,a){if(!r)throw new Error("WeakMap expected key");var s=this.weakmap;if(s)try{s.set(r,a)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var c=this.name,l=r[c];l&&l[0]===r?l[1]=a:Object.defineProperty(r,c,{value:[r,a],writable:!0});return}catch{}this._cleanupClosedWindows();var g=this.keys,p=this.values,h=pt(g,r);h===-1?(g.push(r),p.push(a)):p[h]=a},i.get=function(r){if(!r)throw new Error("WeakMap expected key");var a=this.weakmap;if(a)try{if(a.has(r))return a.get(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var s=r[this.name];return s&&s[0]===r?s[1]:void 0}catch{}this._cleanupClosedWindows();var c=pt(this.keys,r);if(c!==-1)return this.values[c]},i.delete=function(r){if(!r)throw new Error("WeakMap expected key");var a=this.weakmap;if(a)try{a.delete(r)}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var s=r[this.name];s&&s[0]===r&&(s[0]=s[1]=void 0)}catch{}this._cleanupClosedWindows();var c=this.keys,l=pt(c,r);l!==-1&&(c.splice(l,1),this.values.splice(l,1))},i.has=function(r){if(!r)throw new Error("WeakMap expected key");var a=this.weakmap;if(a)try{if(a.has(r))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(r))try{var s=r[this.name];return!(!s||s[0]!==r)}catch{}return this._cleanupClosedWindows(),pt(this.keys,r)!==-1},i.getOrSet=function(r,a){if(this.has(r))return this.get(r);var s=a();return this.set(r,s),s},n}();function qr(n){return n.name||n.__name__||n.displayName||"anonymous"}function Hr(n,i){try{delete n.name,n.name=i}catch{}return n.__name__=n.displayName=i,n}function ae(){var n="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return n.charAt(Math.floor(Math.random()*n.length))})+"_"+function(i){if(typeof btoa=="function")return btoa(encodeURIComponent(i).replace(/%([0-9A-F]{2})/g,function(r,a){return String.fromCharCode(parseInt(a,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(i,"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 gt;function Br(n){try{return JSON.stringify([].slice.call(n),function(i,r){return typeof r=="function"?"memoize["+function(a){if(gt=gt||new Gt,a==null||typeof a!="object"&&typeof a!="function")throw new Error("Invalid object");var s=gt.get(a);return s||(s=typeof a+":"+ae(),gt.set(a,s)),s}(r)+"]":typeof window<"u"&&r instanceof window.Element||r!==null&&typeof r=="object"&&r.nodeType===1&&typeof r.style=="object"&&typeof r.ownerDocument=="object"?{}:r})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function tl(){return{}}var Ve=0,Vr=0;function Ye(n,i){i===void 0&&(i={});var r=i.thisNamespace,a=r!==void 0&&r,s=i.time,c,l,g=Ve;Ve+=1;var p=function(){for(var h=arguments.length,y=new Array(h),_=0;_<h;_++)y[_]=arguments[_];g<Vr&&(c=null,l=null,g=Ve,Ve+=1);var w;w=a?(l=l||new Gt).getOrSet(this,tl):c=c||{};var A;try{A=Br(y)}catch{return n.apply(this,arguments)}var I=w[A];if(I&&s&&Date.now()-I.time<s&&(delete w[A],I=null),I)return I.value;var T=Date.now(),P=n.apply(this,arguments);return w[A]={time:T,value:P},P};return p.reset=function(){c=null,l=null},Hr(p,(i.name||qr(n))+"::memoized")}Ye.clear=function(){Vr=Ve};function nl(n){var i={};function r(){for(var a=arguments,s=this,c=arguments.length,l=new Array(c),g=0;g<c;g++)l[g]=arguments[g];var p=Br(l);return i.hasOwnProperty(p)||(i[p]=x.try(function(){return n.apply(s,a)}).finally(function(){delete i[p]})),i[p]}return r.reset=function(){i={}},Hr(r,qr(n)+"::promiseMemoized")}function Ee(){}function Je(n,i){if(i===void 0&&(i=1),i>=3)return"stringifyError stack overflow";try{if(!n)return"<unknown error: "+{}.toString.call(n)+">";if(typeof n=="string")return n;if(n instanceof Error){var r=n&&n.stack,a=n&&n.message;if(r&&a)return r.indexOf(a)!==-1?r:a+`
|
|
3
|
+
`+r;if(r)return r;if(a)return a}return n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}catch(s){return"Error while stringifying error: "+Je(s,i+1)}}function Yr(n){return typeof n=="string"?n:n&&n.toString&&typeof n.toString=="function"?n.toString():{}.toString.call(n)}Ye(function(n){if(Object.values)return Object.values(n);var i=[];for(var r in n)n.hasOwnProperty(r)&&i.push(n[r]);return i});function qt(n){return{}.toString.call(n)==="[object RegExp]"}function Ze(n,i,r){if(n.hasOwnProperty(i))return n[i];var a=r();return n[i]=a,a}function Jr(){var n=document.body;if(!n)throw new Error("Body element not found");return n}function Zr(){return!!document.body&&document.readyState==="complete"}function Kr(){return!!document.body&&document.readyState==="interactive"}Ye(function(){return new x(function(n){if(Zr()||Kr())return n();var i=setInterval(function(){if(Zr()||Kr())return clearInterval(i),n()},10)})});var vt=typeof document<"u"?document.currentScript:null,rl=Ye(function(){if(vt||(vt=function(){try{var n=function(){try{throw new Error("_")}catch(l){return l.stack||""}}(),i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(n),r=i&&i[1];if(!r)return;for(var a=0,s=[].slice.call(document.getElementsByTagName("script")).reverse();a<s.length;a++){var c=s[a];if(c.src&&c.src===r)return c}}catch{}}()))return vt;throw new Error("Can not determine current script")}),ol=ae();Ye(function(){var n;try{n=rl()}catch{return ol}var i=n.getAttribute("data-uid");if(i&&typeof i=="string"||(i=n.getAttribute("data-uid-auto"))&&typeof i=="string")return i;if(n.src){var r=function(a){for(var s="",c=0;c<a.length;c++){var l=a[c].charCodeAt(0)*c;a[c+1]&&(l+=a[c+1].charCodeAt(0)*(c-1)),s+=String.fromCharCode(97+Math.abs(l)%26)}return s}(JSON.stringify({src:n.src,dataset:n.dataset}));i="uid_"+r.slice(r.length-30)}else i=ae();return n.setAttribute("data-uid-auto",i),i});function Ke(n){n===void 0&&(n=window);var i="__post_robot_10_0_46__";return n!==window?n[i]:n[i]=n[i]||{}}var Qr=function(){return{}};function Y(n,i){return n===void 0&&(n="store"),i===void 0&&(i=Qr),Ze(Ke(),n,function(){var r=i();return{has:function(a){return r.hasOwnProperty(a)},get:function(a,s){return r.hasOwnProperty(a)?r[a]:s},set:function(a,s){return r[a]=s,s},del:function(a){delete r[a]},getOrSet:function(a,s){return Ze(r,a,s)},reset:function(){r=i()},keys:function(){return Object.keys(r)}}})}var il=function(){};function _t(){var n=Ke();return n.WINDOW_WILDCARD=n.WINDOW_WILDCARD||new il,n.WINDOW_WILDCARD}function X(n,i){return n===void 0&&(n="store"),i===void 0&&(i=Qr),Y("windowStore").getOrSet(n,function(){var r=new Gt,a=function(s){return r.getOrSet(s,i)};return{has:function(s){return a(s).hasOwnProperty(n)},get:function(s,c){var l=a(s);return l.hasOwnProperty(n)?l[n]:c},set:function(s,c){return a(s)[n]=c,c},del:function(s){delete a(s)[n]},getOrSet:function(s,c){return Ze(a(s),n,c)}}})}function Xr(){return Y("instance").getOrSet("instanceID",ae)}function kr(n,i){var r=i.domain,a=X("helloPromises"),s=a.get(n);s&&s.resolve({domain:r});var c=x.resolve({domain:r});return a.set(n,c),c}function Ht(n,i){return(0,i.send)(n,"postrobot_hello",{instanceID:Xr()},{domain:"*",timeout:-1}).then(function(r){var a=r.origin,s=r.data.instanceID;return kr(n,{domain:a}),{win:n,domain:a,instanceID:s}})}function eo(n,i){var r=i.send;return X("windowInstanceIDPromises").getOrSet(n,function(){return Ht(n,{send:r}).then(function(a){return a.instanceID})})}function to(n){X("knownWindows").set(n,!0)}function Bt(n){return typeof n=="object"&&n!==null&&typeof n.__type__=="string"}function no(n){return n===void 0?"undefined":n===null?"null":Array.isArray(n)?"array":typeof n=="function"?"function":typeof n=="object"?n instanceof Error?"error":typeof n.then=="function"?"promise":{}.toString.call(n)==="[object RegExp]"?"regex":{}.toString.call(n)==="[object Date]"?"date":"object":typeof n=="string"?"string":typeof n=="number"?"number":typeof n=="boolean"?"boolean":void 0}function be(n,i){return{__type__:n,__val__:i}}var k,al=((k={}).function=function(){},k.error=function(n){return be("error",{message:n.message,stack:n.stack,code:n.code,data:n.data})},k.promise=function(){},k.regex=function(n){return be("regex",n.source)},k.date=function(n){return be("date",n.toJSON())},k.array=function(n){return n},k.object=function(n){return n},k.string=function(n){return n},k.number=function(n){return n},k.boolean=function(n){return n},k.null=function(n){return n},k[void 0]=function(n){return be("undefined",n)},k),sl={},ee,ul=((ee={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},ee.error=function(n){var i=n.stack,r=n.code,a=n.data,s=new Error(n.message);return s.code=r,a&&(s.data=a),s.stack=i+`
|
|
4
4
|
|
|
5
|
-
`+s.stack,s},
|
|
5
|
+
`+s.stack,s},ee.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},ee.regex=function(n){return new RegExp(n)},ee.date=function(n){return new Date(n)},ee.array=function(n){return n},ee.object=function(n){return n},ee.string=function(n){return n},ee.number=function(n){return n},ee.boolean=function(n){return n},ee.null=function(n){return n},ee[void 0]=function(){},ee),cl={};new x(function(n){if(window.document&&window.document.body)return n(window.document.body);var i=setInterval(function(){if(window.document&&window.document.body)return clearInterval(i),n(window.document.body)},10)});function Vt(){for(var n=Y("idToProxyWindow"),i=0,r=n.keys();i<r.length;i++){var a=r[i];n.get(a).shouldClean()&&n.del(a)}}function ro(n,i){var r=i.send,a=i.id,s=a===void 0?ae():a,c=n.then(function(p){if(F(p))return z(p).name}),l=n.then(function(p){if(Q(p))throw new Error("Window is closed, can not determine type");return W(p)?"popup":"iframe"});c.catch(Ee),l.catch(Ee);var g=function(){return n.then(function(p){if(!Q(p))return F(p)?z(p).name:c})};return{id:s,getType:function(){return l},getInstanceID:nl(function(){return n.then(function(p){return eo(p,{send:r})})}),close:function(){return n.then(el)},getName:g,focus:function(){return n.then(function(p){p.focus()})},isClosed:function(){return n.then(function(p){return Q(p)})},setLocation:function(p,h){return h===void 0&&(h={}),n.then(function(y){var _=window.location.protocol+"//"+window.location.host,w=h.method,A=w===void 0?"get":w,I=h.body;if(p.indexOf("/")===0)p=""+_+p;else if(!p.match(/^https?:\/\//)&&p.indexOf(_)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(p));if(A==="post")return g().then(function(T){if(!T)throw new Error("Can not post to window without target name");(function(P){var $=P.url,B=P.target,U=P.body,N=P.method,J=N===void 0?"post":N,O=document.createElement("form");if(O.setAttribute("target",B),O.setAttribute("method",J),O.setAttribute("action",$),O.style.display="none",U)for(var j=0,ne=Object.keys(U);j<ne.length;j++){var H,Qe=ne[j],Kt=document.createElement("input");Kt.setAttribute("name",Qe),Kt.setAttribute("value",(H=U[Qe])==null?void 0:H.toString()),O.appendChild(Kt)}Jr().appendChild(O),O.submit(),Jr().removeChild(O)})({url:p,target:T,method:A,body:I})});if(A!=="get")throw new Error("Unsupported method: "+A);if(F(y))try{if(y.location&&typeof y.location.replace=="function"){y.location.replace(p);return}}catch{}y.location=p})},setName:function(p){return n.then(function(h){var y=F(h),_=Fr(h);if(!y)throw new Error("Can not set name for cross-domain window: "+p);z(h).name=p,_&&_.setAttribute("name",p),c=x.resolve(p)})}}}var te=function(){function n(r){var a=r.send,s=r.win,c=r.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 x,this.serializedWindow=c||ro(this.actualWindowPromise,{send:a}),Y("idToProxyWindow").set(this.getID(),this),s&&this.setWindow(s,{send:a})}var i=n.prototype;return i.getID=function(){return this.serializedWindow.id},i.getType=function(){return this.serializedWindow.getType()},i.isPopup=function(){return this.getType().then(function(r){return r==="popup"})},i.setLocation=function(r,a){var s=this;return this.serializedWindow.setLocation(r,a).then(function(){return s})},i.getName=function(){return this.serializedWindow.getName()},i.setName=function(r){var a=this;return this.serializedWindow.setName(r).then(function(){return a})},i.close=function(){var r=this;return this.serializedWindow.close().then(function(){return r})},i.focus=function(){var r=this,a=this.isPopup(),s=this.getName(),c=x.hash({isPopup:a,name:s}).then(function(g){var p=g.name;g.isPopup&&p&&window.open("",p,"noopener")}),l=this.serializedWindow.focus();return x.all([c,l]).then(function(){return r})},i.isClosed=function(){return this.serializedWindow.isClosed()},i.getWindow=function(){return this.actualWindow},i.setWindow=function(r,a){var s=a.send;this.actualWindow=r,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=ro(this.actualWindowPromise,{send:s,id:this.getID()}),X("winToProxyWindow").set(r,this)},i.awaitWindow=function(){return this.actualWindowPromise},i.matchWindow=function(r,a){var s=this,c=a.send;return x.try(function(){return s.actualWindow?r===s.actualWindow:x.hash({proxyInstanceID:s.getInstanceID(),knownWindowInstanceID:eo(r,{send:c})}).then(function(l){var g=l.proxyInstanceID===l.knownWindowInstanceID;return g&&s.setWindow(r,{send:c}),g})})},i.unwrap=function(){return this.actualWindow||this},i.getInstanceID=function(){return this.serializedWindow.getInstanceID()},i.shouldClean=function(){return!!(this.actualWindow&&Q(this.actualWindow))},i.serialize=function(){return this.serializedWindow},n.unwrap=function(r){return n.isProxyWindow(r)?r.unwrap():r},n.serialize=function(r,a){var s=a.send;return Vt(),n.toProxyWindow(r,{send:s}).serialize()},n.deserialize=function(r,a){var s=a.send;return Vt(),Y("idToProxyWindow").get(r.id)||new n({serializedWindow:r,send:s})},n.isProxyWindow=function(r){return!!(r&&!ht(r)&&r.isProxyWindow)},n.toProxyWindow=function(r,a){var s=a.send;if(Vt(),n.isProxyWindow(r))return r;var c=r;return X("winToProxyWindow").get(c)||new n({win:c,send:s})},n}();function Yt(n,i,r,a,s){var c=X("methodStore"),l=Y("proxyWindowMethods");te.isProxyWindow(a)?l.set(n,{val:i,name:r,domain:s,source:a}):(l.del(n),c.getOrSet(a,function(){return{}})[n]={domain:s,name:r,val:i,source:a})}function oo(n,i){var r=X("methodStore"),a=Y("proxyWindowMethods");return r.getOrSet(n,function(){return{}})[i]||a.get(i)}function io(n,i,r,a,s){l=(c={on:s.on,send:s.send}).on,g=c.send,Y("builtinListeners").getOrSet("functionCalls",function(){return l("postrobot_method",{domain:"*"},function(y){var _=y.source,w=y.origin,A=y.data,I=A.id,T=A.name,P=oo(_,I);if(!P)throw new Error("Could not find method '"+T+"' with id: "+A.id+" in "+C(window));var $=P.source,B=P.domain,U=P.val;return x.try(function(){if(!$e(B,w))throw new Error("Method '"+A.name+"' domain "+JSON.stringify(qt(P.domain)?P.domain.source:P.domain)+" does not match origin "+w+" in "+C(window));if(te.isProxyWindow($))return $.matchWindow(_,{send:g}).then(function(N){if(!N)throw new Error("Method call '"+A.name+"' failed - proxy window does not match source in "+C(window))})}).then(function(){return U.apply({source:_,origin:w},A.args)},function(N){return x.try(function(){if(U.onError)return U.onError(N)}).then(function(){throw N.stack&&(N.stack="Remote call to "+T+"("+function(J){return J===void 0&&(J=[]),(O=J,[].slice.call(O)).map(function(j){return typeof j=="string"?"'"+j+"'":j===void 0?"undefined":j===null?"null":typeof j=="boolean"?j.toString():Array.isArray(j)?"[ ... ]":typeof j=="object"?"{ ... }":typeof j=="function"?"() => { ... }":"<"+typeof j+">"}).join(", ");var O}(A.args)+`) failed
|
|
6
6
|
|
|
7
|
-
`+
|
|
7
|
+
`+N.stack),N})}).then(function(N){return{result:N,id:I,name:T}})})});var c,l,g,p=r.__id__||ae();n=te.unwrap(n);var h=r.__name__||r.name||a;return typeof h=="string"&&typeof h.indexOf=="function"&&h.indexOf("anonymous::")===0&&(h=h.replace("anonymous::",a+"::")),te.isProxyWindow(n)?(Yt(p,r,h,n,i),n.awaitWindow().then(function(y){Yt(p,r,h,y,i)})):Yt(p,r,h,n,i),be("cross_domain_function",{id:p,name:h})}function ao(n,i,r,a){var s,c=a.on,l=a.send;return function(g,p){p===void 0&&(p=sl);var h=JSON.stringify(g,function(y){var _=this[y];if(Bt(this))return _;var w=no(_);if(!w)return _;var A=p[w]||al[w];return A?A(_,y):_});return h===void 0?"undefined":h}(r,((s={}).promise=function(g,p){return function(h,y,_,w,A){return be("cross_domain_zalgo_promise",{then:io(h,y,function(I,T){return _.then(I,T)},w,{on:A.on,send:A.send})})}(n,i,g,p,{on:c,send:l})},s.function=function(g,p){return io(n,i,g,p,{on:c,send:l})},s.object=function(g){return ht(g)||te.isProxyWindow(g)?be("cross_domain_window",te.serialize(g,{send:l})):g},s))}function so(n,i,r,a){var s,c=a.send;return function(l,g){if(g===void 0&&(g=cl),l!=="undefined")return JSON.parse(l,function(p,h){if(Bt(this))return h;var y,_;if(Bt(h)?(y=h.__type__,_=h.__val__):(y=no(h),_=h),!y)return _;var w=g[y]||ul[y];return w?w(_,p):_})}(r,((s={}).cross_domain_zalgo_promise=function(l){return function(g,p,h){return new x(h.then)}(0,0,l)},s.cross_domain_function=function(l){return function(g,p,h,y){var _=h.id,w=h.name,A=y.send,I=function(P){P===void 0&&(P={});function $(){var B=arguments;return te.toProxyWindow(g,{send:A}).awaitWindow().then(function(U){var N=oo(U,_);if(N&&N.val!==$)return N.val.apply({source:window,origin:C()},B);var J=[].slice.call(B);return P.fireAndForget?A(U,"postrobot_method",{id:_,name:w,args:J},{domain:p,fireAndForget:!0}):A(U,"postrobot_method",{id:_,name:w,args:J},{domain:p,fireAndForget:!1}).then(function(O){return O.data.result})}).catch(function(U){throw U})}return $.__name__=w,$.__origin__=p,$.__source__=g,$.__id__=_,$.origin=p,$},T=I();return T.fireAndForget=I({fireAndForget:!0}),T}(n,i,l,{send:c})},s.cross_domain_window=function(l){return te.deserialize(l,{send:c})},s))}var Jt={};Jt.postrobot_post_message=function(n,i,r){r.indexOf("file:")===0&&(r="*"),n.postMessage(i,r)};function Zt(n,i,r,a){var s=a.on,c=a.send;return x.try(function(){var l=X().getOrSet(n,function(){return{}});return l.buffer=l.buffer||[],l.buffer.push(r),l.flush=l.flush||x.flush().then(function(){if(Q(n))throw new Error("Window is closed");var g=ao(n,i,((p={}).__post_robot_10_0_46__=l.buffer||[],p),{on:s,send:c}),p;delete l.buffer;for(var h=Object.keys(Jt),y=[],_=0;_<h.length;_++){var w=h[_];try{Jt[w](n,g,i)}catch(A){y.push(A)}}if(y.length===h.length)throw new Error(`All post-robot messaging strategies failed:
|
|
8
8
|
|
|
9
|
-
`+y.map(function(
|
|
9
|
+
`+y.map(function(A,I){return I+". "+Je(A)}).join(`
|
|
10
10
|
|
|
11
|
-
`))}),
|
|
11
|
+
`))}),l.flush.then(function(){delete l.flush})}).then(Ee)}function uo(n){return Y("responseListeners").get(n)}function co(n){Y("responseListeners").del(n)}function fo(n){return Y("erroredResponseListeners").has(n)}function lo(n){var i=n.name,r=n.win,a=n.domain,s=X("requestListeners");if(r==="*"&&(r=null),a==="*"&&(a=null),!i)throw new Error("Name required to get request listener");for(var c=0,l=[r,_t()];c<l.length;c++){var g=l[c];if(g){var p=s.get(g);if(p){var h=p[i];if(h){if(a&&typeof a=="string"){if(h[a])return h[a];if(h.__domain_regex__)for(var y=0,_=h.__domain_regex__;y<_.length;y++){var w=_[y],A=w.listener;if($e(w.regex,a))return A}}if(h["*"])return h["*"]}}}}}function fl(n,i,r,a){var s=a.on,c=a.send,l=lo({name:r.name,win:n,domain:i}),g=r.name==="postrobot_method"&&r.data&&typeof r.data.name=="string"?r.data.name+"()":r.name;function p(h,y,_){return x.flush().then(function(){if(!r.fireAndForget&&!Q(n))try{return Zt(n,i,{id:ae(),origin:C(window),type:"postrobot_message_response",hash:r.hash,name:r.name,ack:h,data:y,error:_},{on:s,send:c})}catch(w){throw new Error("Send response message failed for "+g+" in "+C()+`
|
|
12
12
|
|
|
13
|
-
`+
|
|
13
|
+
`+Je(w))}})}return x.all([x.flush().then(function(){if(!r.fireAndForget&&!Q(n))try{return Zt(n,i,{id:ae(),origin:C(window),type:"postrobot_message_ack",hash:r.hash,name:r.name},{on:s,send:c})}catch(h){throw new Error("Send ack message failed for "+g+" in "+C()+`
|
|
14
14
|
|
|
15
|
-
`+
|
|
15
|
+
`+Je(h))}}),x.try(function(){if(!l)throw new Error("No handler found for post message: "+r.name+" from "+i+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return l.handler({source:n,origin:i,data:r.data})}).then(function(h){return p("success",h)},function(h){return p("error",null,h)})]).then(Ee).catch(function(h){if(l&&l.handleError)return l.handleError(h);throw h})}function dl(n,i,r){if(!fo(r.hash)){var a=uo(r.hash);if(!a)throw new Error("No handler found for post message ack for message: "+r.name+" from "+i+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!$e(a.domain,i))throw new Error("Ack origin "+i+" does not match domain "+a.domain.toString());if(n!==a.win)throw new Error("Ack source does not match registered window")}catch(s){a.promise.reject(s)}a.ack=!0}}function ll(n,i,r){if(!fo(r.hash)){var a=uo(r.hash);if(!a)throw new Error("No handler found for post message response for message: "+r.name+" from "+i+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!$e(a.domain,i))throw new Error("Response origin "+i+" does not match domain "+(s=a.domain,Array.isArray(s)?"("+s.join(" | ")+")":d(s)?"RegExp("+s.toString()+")":s.toString()));var s;if(n!==a.win)throw new Error("Response source does not match registered window");co(r.hash),r.ack==="error"?a.promise.reject(r.error):r.ack==="success"&&a.promise.resolve({source:n,origin:i,data:r.data})}}function ho(n,i){var r=i.on,a=i.send,s=Y("receivedMessages");try{if(!window||window.closed||!n.source)return}catch{return}var c=n.source,l=n.origin,g=function(y,_,w,A){var I=A.on,T=A.send,P;try{P=so(_,w,y,{on:I,send:T})}catch{return}if(P&&typeof P=="object"&&P!==null){var $=P.__post_robot_10_0_46__;if(Array.isArray($))return $}}(n.data,c,l,{on:r,send:a});if(g){to(c);for(var p=0;p<g.length;p++){var h=g[p];if(s.has(h.id)||(s.set(h.id,!0),Q(c)&&!h.fireAndForget))return;h.origin.indexOf("file:")===0&&(l="file://");try{h.type==="postrobot_message_request"?fl(c,l,h,{on:r,send:a}):h.type==="postrobot_message_response"?ll(c,l,h):h.type==="postrobot_message_ack"&&dl(c,l,h)}catch(y){setTimeout(function(){throw y},0)}}}}function le(n,i,r){if(!n)throw new Error("Expected name");if(typeof(i=i||{})=="function"&&(r=i,i={}),!r)throw new Error("Expected handler");var a=function s(c,l){var g=c.name,p=c.win,h=c.domain,y=X("requestListeners");if(!g||typeof g!="string")throw new Error("Name required to add request listener");if(p&&p!=="*"&&te.isProxyWindow(p)){var _=p.awaitWindow().then(function(H){return s({name:g,win:H,domain:h},l)});return{cancel:function(){_.then(function(H){return H.cancel()},Ee)}}}var w=p;if(Array.isArray(w)){for(var A=[],I=0,T=w;I<T.length;I++)A.push(s({name:g,domain:h,win:T[I]},l));return{cancel:function(){for(var H=0;H<A.length;H++)A[H].cancel()}}}if(Array.isArray(h)){for(var P=[],$=0,B=h;$<B.length;$++)P.push(s({name:g,win:w,domain:B[$]},l));return{cancel:function(){for(var H=0;H<P.length;H++)P[H].cancel()}}}var U=lo({name:g,win:w,domain:h});w&&w!=="*"||(w=_t());var N=(h=h||"*").toString();if(U)throw w&&h?new Error("Request listener already exists for "+g+" on domain "+h.toString()+" for "+(w===_t()?"wildcard":"specified")+" window"):w?new Error("Request listener already exists for "+g+" for "+(w===_t()?"wildcard":"specified")+" window"):h?new Error("Request listener already exists for "+g+" on domain "+h.toString()):new Error("Request listener already exists for "+g);var J=y.getOrSet(w,function(){return{}}),O=Ze(J,g,function(){return{}}),j,ne;return qt(h)?(j=Ze(O,"__domain_regex__",function(){return[]})).push(ne={regex:h,listener:l}):O[N]=l,{cancel:function(){delete O[N],ne&&(j.splice(j.indexOf(ne,1)),j.length||delete O.__domain_regex__),Object.keys(O).length||delete J[g],w&&!Object.keys(J).length&&y.del(w)}}}({name:n,win:i.window,domain:i.domain||"*"},{handler:r||i.handler,handleError:i.errorHandler||function(s){throw s}});return{cancel:function(){a.cancel()}}}function hl(n,i,r){typeof(i=i||{})=="function"&&(r=i,i={});var a=new x,s;return i.errorHandler=function(c){s.cancel(),a.reject(c)},s=le(n,i,function(c){if(s.cancel(),a.resolve(c),r)return r(c)}),a.cancel=s.cancel,a}var he=function n(i,r,a,s){var c=(s=s||{}).domain||"*",l=s.timeout||-1,g=s.timeout||5e3,p=s.fireAndForget||!1;return te.toProxyWindow(i,{send:n}).awaitWindow().then(function(h){return x.try(function(){if(function(y,_,w){if(!y)throw new Error("Expected name");if(w&&typeof w!="string"&&!Array.isArray(w)&&!qt(w))throw new TypeError("Can not send "+y+". Expected domain "+JSON.stringify(w)+" to be a string, array, or regex");if(Q(_))throw new Error("Can not send "+y+". Target window is closed")}(r,h,c),function(y,_){var w=Wr(_);if(w)return w===y;if(_===y||function(T){T===void 0&&(T=window);try{if(T.top)return T.top}catch{}if(G(T)===T)return T;try{if(V(window,T)&&window.top)return window.top}catch{}try{if(V(T,window)&&window.top)return window.top}catch{}for(var P=0,$=function U(N){for(var J=[],O=0,j=ie(N);O<j.length;O++){var ne=j[O];J.push(ne);for(var H=0,Qe=U(ne);H<Qe.length;H++)J.push(Qe[H])}return J}(T);P<$.length;P++){var B=$[P];try{if(B.top)return B.top}catch{}if(G(B)===B)return B}}(_)===_)return!1;for(var A=0,I=ie(y);A<I.length;A++)if(I[A]===_)return!0;return!1}(window,h))return function(y,_,w){_===void 0&&(_=5e3),w===void 0&&(w="Window");var A=function(I){return X("helloPromises").getOrSet(I,function(){return new x})}(y);return _!==-1&&(A=A.timeout(_,new Error(w+" did not load after "+_+"ms"))),A}(h,g)}).then(function(y){return function(_,w,A,I){var T=I.send;return x.try(function(){return typeof w=="string"?w:x.try(function(){return A||Ht(_,{send:T}).then(function(P){return P.domain})}).then(function(P){if(!$e(w,w))throw new Error("Domain "+Yr(w)+" does not match "+Yr(w));return P})})}(h,c,(y===void 0?{}:y).domain,{send:n})}).then(function(y){var _=y,w=r==="postrobot_method"&&a&&typeof a.name=="string"?a.name+"()":r,A=new x,I=r+"_"+ae();if(!p){var T={name:r,win:h,domain:_,promise:A};(function(O,j){Y("responseListeners").set(O,j)})(I,T);var P=X("requestPromises").getOrSet(h,function(){return[]});P.push(A),A.catch(function(){(function(O){Y("erroredResponseListeners").set(O,!0)})(I),co(I)});var $=function(O){return X("knownWindows").get(O,!1)}(h)?1e4:2e3,B=l,U=$,N=B,J=function(O,j){var ne;return function H(){ne=setTimeout(function(){(function(){if(Q(h))return A.reject(new Error("Window closed for "+r+" before "+(T.ack?"response":"ack")));if(T.cancelled)return A.reject(new Error("Response listener was cancelled for "+r));U=Math.max(U-500,0),N!==-1&&(N=Math.max(N-500,0)),T.ack||U!==0?N===0&&A.reject(new Error("No response for postMessage "+w+" in "+C()+" in "+B+"ms")):A.reject(new Error("No ack for postMessage "+w+" in "+C()+" in "+$+"ms"))})(),H()},500)}(),{cancel:function(){clearTimeout(ne)}}}();A.finally(function(){J.cancel(),P.splice(P.indexOf(A,1))}).catch(Ee)}return Zt(h,_,{id:ae(),origin:C(window),type:"postrobot_message_request",hash:I,name:r,data:a,fireAndForget:p},{on:le,send:n}).then(function(){return p?A.resolve():A},function(O){throw new Error("Send request message failed for "+w+" in "+C()+`
|
|
16
16
|
|
|
17
|
-
`+Ve(O))})})})};function Pf(t,o,r){return Br(t,o,r,{on:se,send:ue})}function If(t,o,r){return Yr(t,o,r,{on:se,send:ue})}function Of(t){return new J({send:ue,win:t})}function Cf(t){return J.toProxyWindow(t,{send:ue})}function Xr(){Be().initialized||(Be().initialized=!0,o=(t={on:se,send:ue}).on,r=t.send,(a=Be()).receiveMessage=a.receiveMessage||function(s){return Qr(s,{on:o,send:r})},function(s){var c=s.on,d=s.send;z().getOrSet("postMessageListener",function(){return function(p,l,f){return p.addEventListener("message",f),{cancel:function(){p.removeEventListener("message",f)}}}(window,0,function(p){(function(l,f){var y=f.on,v=f.send;x.try(function(){var w=l.source||l.sourceElement,m=l.origin||l.originalEvent&&l.originalEvent.origin,T=l.data;if(m==="null"&&(m="file://"),w){if(!m)throw new Error("Post message did not have origin domain");Qr({source:w,origin:m,data:T},{on:y,send:v})}})})(p,{on:c,send:d})})})}({on:se,send:ue}),function(s){var c=s.on,d=s.send;z("builtinListeners").getOrSet("helloListener",function(){var p=c("postrobot_hello",{domain:"*"},function(f){return Wr(f.source,{domain:f.origin}),{instanceID:$r()}}),l=Tr();return l&&Nt(l,{send:d}).catch(function(f){}),p})}({on:se,send:ue}));var t,o,r,a}function xf(){(function(){for(var o=z("responseListeners"),r=0,a=o.keys();r<a.length;r++){var s=a[r],c=o.get(s);c&&(c.cancelled=!0),o.del(s)}})(),(t=z().get("postMessageListener"))&&t.cancel();var t;delete window.__post_robot_10_0_46__}var Df=!0;function Rf(t){for(var o=0,r=V("requestPromises").get(t,[]);o<r.length;o++)r[o].reject(new Error("Window "+(k(t)?"closed":"cleaned up")+" before response")).catch(_e)}Xr()}])})})(Gt);var no=Gt.exports;(function(e){e.exports=no,e.exports.default=e.exports})(Ft);var qt=Ft.exports;const Vt=to(qt),ro=De({__proto__:null,default:Vt},[qt]);var Ht=typeof global=="object"&&global&&global.Object===Object&&global,oo=typeof self=="object"&&self&&self.Object===Object&&self,K=Ht||oo||Function("return this")(),ae=K.Symbol,Bt=Object.prototype,io=Bt.hasOwnProperty,ao=Bt.toString,Re=ae?ae.toStringTag:void 0;function so(e){var n=io.call(e,Re),i=e[Re];try{e[Re]=void 0;var u=!0}catch{}var h=ao.call(e);return u&&(n?e[Re]=i:delete e[Re]),h}var uo=Object.prototype,co=uo.toString;function fo(e){return co.call(e)}var lo="[object Null]",ho="[object Undefined]",Yt=ae?ae.toStringTag:void 0;function me(e){return e==null?e===void 0?ho:lo:Yt&&Yt in Object(e)?so(e):fo(e)}function Ee(e){return e!=null&&typeof e=="object"}var po="[object Symbol]";function go(e){return typeof e=="symbol"||Ee(e)&&me(e)==po}function vo(e,n){for(var i=-1,u=e==null?0:e.length,h=Array(u);++i<u;)h[i]=n(e[i],i,e);return h}var Je=Array.isArray,wo=1/0,Jt=ae?ae.prototype:void 0,kt=Jt?Jt.toString:void 0;function Zt(e){if(typeof e=="string")return e;if(Je(e))return vo(e,Zt)+"";if(go(e))return kt?kt.call(e):"";var n=e+"";return n=="0"&&1/e==-wo?"-0":n}function je(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var _o="[object AsyncFunction]",yo="[object Function]",mo="[object GeneratorFunction]",Eo="[object Proxy]";function Kt(e){if(!je(e))return!1;var n=me(e);return n==yo||n==mo||n==_o||n==Eo}var dt=K["__core-js_shared__"],Qt=function(){var e=/[^.]+$/.exec(dt&&dt.keys&&dt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ao(e){return!!Qt&&Qt in e}var bo=Function.prototype,So=bo.toString;function ce(e){if(e!=null){try{return So.call(e)}catch{}try{return e+""}catch{}}return""}var To=/[\\^$.*+?()[\]{}|]/g,Po=/^\[object .+?Constructor\]$/,Io=Function.prototype,Oo=Object.prototype,Co=Io.toString,xo=Oo.hasOwnProperty,Do=RegExp("^"+Co.call(xo).replace(To,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ro(e){if(!je(e)||Ao(e))return!1;var n=Kt(e)?Do:Po;return n.test(ce(e))}function jo(e,n){return e?.[n]}function de(e,n){var i=jo(e,n);return Ro(i)?i:void 0}var ft=de(K,"WeakMap"),Xt=Object.create,No=function(){function e(){}return function(n){if(!je(n))return{};if(Xt)return Xt(n);e.prototype=n;var i=new e;return e.prototype=void 0,i}}();function Uo(e,n){var i=-1,u=e.length;for(n||(n=Array(u));++i<u;)n[i]=e[i];return n}var en=function(){try{var e=de(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Mo(e,n){for(var i=-1,u=e==null?0:e.length;++i<u&&n(e[i],i,e)!==!1;);return e}var Lo=9007199254740991,$o=/^(?:0|[1-9]\d*)$/;function Wo(e,n){var i=typeof e;return n=n??Lo,!!n&&(i=="number"||i!="symbol"&&$o.test(e))&&e>-1&&e%1==0&&e<n}function tn(e,n,i){n=="__proto__"&&en?en(e,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[n]=i}function nn(e,n){return e===n||e!==e&&n!==n}var zo=Object.prototype,Fo=zo.hasOwnProperty;function rn(e,n,i){var u=e[n];(!(Fo.call(e,n)&&nn(u,i))||i===void 0&&!(n in e))&&tn(e,n,i)}function ke(e,n,i,u){var h=!i;i||(i={});for(var g=-1,_=n.length;++g<_;){var A=n[g],I=u?u(i[A],e[A],A,i,e):void 0;I===void 0&&(I=e[A]),h?tn(i,A,I):rn(i,A,I)}return i}var Go=9007199254740991;function on(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Go}function an(e){return e!=null&&on(e.length)&&!Kt(e)}var qo=Object.prototype;function lt(e){var n=e&&e.constructor,i=typeof n=="function"&&n.prototype||qo;return e===i}function Vo(e,n){for(var i=-1,u=Array(e);++i<e;)u[i]=n(i);return u}var Ho="[object Arguments]";function sn(e){return Ee(e)&&me(e)==Ho}var un=Object.prototype,Bo=un.hasOwnProperty,Yo=un.propertyIsEnumerable,Jo=sn(function(){return arguments}())?sn:function(e){return Ee(e)&&Bo.call(e,"callee")&&!Yo.call(e,"callee")};function ko(){return!1}var cn=typeof E=="object"&&E&&!E.nodeType&&E,dn=cn&&typeof module=="object"&&module&&!module.nodeType&&module,Zo=dn&&dn.exports===cn,fn=Zo?K.Buffer:void 0,Ko=fn?fn.isBuffer:void 0,ln=Ko||ko,Qo="[object Arguments]",Xo="[object Array]",ei="[object Boolean]",ti="[object Date]",ni="[object Error]",ri="[object Function]",oi="[object Map]",ii="[object Number]",ai="[object Object]",si="[object RegExp]",ui="[object Set]",ci="[object String]",di="[object WeakMap]",fi="[object ArrayBuffer]",li="[object DataView]",hi="[object Float32Array]",pi="[object Float64Array]",gi="[object Int8Array]",vi="[object Int16Array]",wi="[object Int32Array]",_i="[object Uint8Array]",yi="[object Uint8ClampedArray]",mi="[object Uint16Array]",Ei="[object Uint32Array]",N={};N[hi]=N[pi]=N[gi]=N[vi]=N[wi]=N[_i]=N[yi]=N[mi]=N[Ei]=!0,N[Qo]=N[Xo]=N[fi]=N[ei]=N[li]=N[ti]=N[ni]=N[ri]=N[oi]=N[ii]=N[ai]=N[si]=N[ui]=N[ci]=N[di]=!1;function Ai(e){return Ee(e)&&on(e.length)&&!!N[me(e)]}function ht(e){return function(n){return e(n)}}var hn=typeof E=="object"&&E&&!E.nodeType&&E,Ne=hn&&typeof module=="object"&&module&&!module.nodeType&&module,bi=Ne&&Ne.exports===hn,pt=bi&&Ht.process,Ae=function(){try{var e=Ne&&Ne.require&&Ne.require("util").types;return e||pt&&pt.binding&&pt.binding("util")}catch{}}(),pn=Ae&&Ae.isTypedArray,Si=pn?ht(pn):Ai,Ti=Object.prototype,Pi=Ti.hasOwnProperty;function gn(e,n){var i=Je(e),u=!i&&Jo(e),h=!i&&!u&&ln(e),g=!i&&!u&&!h&&Si(e),_=i||u||h||g,A=_?Vo(e.length,String):[],I=A.length;for(var P in e)(n||Pi.call(e,P))&&!(_&&(P=="length"||h&&(P=="offset"||P=="parent")||g&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||Wo(P,I)))&&A.push(P);return A}function vn(e,n){return function(i){return e(n(i))}}var Ii=vn(Object.keys,Object),Oi=Object.prototype,Ci=Oi.hasOwnProperty;function xi(e){if(!lt(e))return Ii(e);var n=[];for(var i in Object(e))Ci.call(e,i)&&i!="constructor"&&n.push(i);return n}function gt(e){return an(e)?gn(e):xi(e)}function Di(e){var n=[];if(e!=null)for(var i in Object(e))n.push(i);return n}var Ri=Object.prototype,ji=Ri.hasOwnProperty;function Ni(e){if(!je(e))return Di(e);var n=lt(e),i=[];for(var u in e)u=="constructor"&&(n||!ji.call(e,u))||i.push(u);return i}function vt(e){return an(e)?gn(e,!0):Ni(e)}var Ue=de(Object,"create");function Ui(){this.__data__=Ue?Ue(null):{},this.size=0}function Mi(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Li="__lodash_hash_undefined__",$i=Object.prototype,Wi=$i.hasOwnProperty;function zi(e){var n=this.__data__;if(Ue){var i=n[e];return i===Li?void 0:i}return Wi.call(n,e)?n[e]:void 0}var Fi=Object.prototype,Gi=Fi.hasOwnProperty;function qi(e){var n=this.__data__;return Ue?n[e]!==void 0:Gi.call(n,e)}var Vi="__lodash_hash_undefined__";function Hi(e,n){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Ue&&n===void 0?Vi:n,this}function fe(e){var n=-1,i=e==null?0:e.length;for(this.clear();++n<i;){var u=e[n];this.set(u[0],u[1])}}fe.prototype.clear=Ui,fe.prototype.delete=Mi,fe.prototype.get=zi,fe.prototype.has=qi,fe.prototype.set=Hi;function Bi(){this.__data__=[],this.size=0}function Ze(e,n){for(var i=e.length;i--;)if(nn(e[i][0],n))return i;return-1}var Yi=Array.prototype,Ji=Yi.splice;function ki(e){var n=this.__data__,i=Ze(n,e);if(i<0)return!1;var u=n.length-1;return i==u?n.pop():Ji.call(n,i,1),--this.size,!0}function Zi(e){var n=this.__data__,i=Ze(n,e);return i<0?void 0:n[i][1]}function Ki(e){return Ze(this.__data__,e)>-1}function Qi(e,n){var i=this.__data__,u=Ze(i,e);return u<0?(++this.size,i.push([e,n])):i[u][1]=n,this}function ne(e){var n=-1,i=e==null?0:e.length;for(this.clear();++n<i;){var u=e[n];this.set(u[0],u[1])}}ne.prototype.clear=Bi,ne.prototype.delete=ki,ne.prototype.get=Zi,ne.prototype.has=Ki,ne.prototype.set=Qi;var Me=de(K,"Map");function Xi(){this.size=0,this.__data__={hash:new fe,map:new(Me||ne),string:new fe}}function ea(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Ke(e,n){var i=e.__data__;return ea(n)?i[typeof n=="string"?"string":"hash"]:i.map}function ta(e){var n=Ke(this,e).delete(e);return this.size-=n?1:0,n}function na(e){return Ke(this,e).get(e)}function ra(e){return Ke(this,e).has(e)}function oa(e,n){var i=Ke(this,e),u=i.size;return i.set(e,n),this.size+=i.size==u?0:1,this}function be(e){var n=-1,i=e==null?0:e.length;for(this.clear();++n<i;){var u=e[n];this.set(u[0],u[1])}}be.prototype.clear=Xi,be.prototype.delete=ta,be.prototype.get=na,be.prototype.has=ra,be.prototype.set=oa;function Qe(e){return e==null?"":Zt(e)}function wn(e,n){for(var i=-1,u=n.length,h=e.length;++i<u;)e[h+i]=n[i];return e}var ia=vn(Object.getPrototypeOf,Object);const _n=ia;function aa(e,n,i){var u=-1,h=e.length;n<0&&(n=-n>h?0:h+n),i=i>h?h:i,i<0&&(i+=h),h=n>i?0:i-n>>>0,n>>>=0;for(var g=Array(h);++u<h;)g[u]=e[u+n];return g}function sa(e,n,i){var u=e.length;return i=i===void 0?u:i,!n&&i>=u?e:aa(e,n,i)}var ua="\\ud800-\\udfff",ca="\\u0300-\\u036f",da="\\ufe20-\\ufe2f",fa="\\u20d0-\\u20ff",la=ca+da+fa,ha="\\ufe0e\\ufe0f",pa="\\u200d",ga=RegExp("["+pa+ua+la+ha+"]");function yn(e){return ga.test(e)}function va(e){return e.split("")}var mn="\\ud800-\\udfff",wa="\\u0300-\\u036f",_a="\\ufe20-\\ufe2f",ya="\\u20d0-\\u20ff",ma=wa+_a+ya,Ea="\\ufe0e\\ufe0f",Aa="["+mn+"]",wt="["+ma+"]",_t="\\ud83c[\\udffb-\\udfff]",ba="(?:"+wt+"|"+_t+")",En="[^"+mn+"]",An="(?:\\ud83c[\\udde6-\\uddff]){2}",bn="[\\ud800-\\udbff][\\udc00-\\udfff]",Sa="\\u200d",Sn=ba+"?",Tn="["+Ea+"]?",Ta="(?:"+Sa+"(?:"+[En,An,bn].join("|")+")"+Tn+Sn+")*",Pa=Tn+Sn+Ta,Ia="(?:"+[En+wt+"?",wt,An,bn,Aa].join("|")+")",Oa=RegExp(_t+"(?="+_t+")|"+Ia+Pa,"g");function Ca(e){return e.match(Oa)||[]}function xa(e){return yn(e)?Ca(e):va(e)}function Da(e){return function(n){n=Qe(n);var i=yn(n)?xa(n):void 0,u=i?i[0]:n.charAt(0),h=i?sa(i,1).join(""):n.slice(1);return u[e]()+h}}var Ra=Da("toUpperCase");function ja(e){return Ra(Qe(e).toLowerCase())}function Na(e,n,i,u){var h=-1,g=e==null?0:e.length;for(u&&g&&(i=e[++h]);++h<g;)i=n(i,e[h],h,e);return i}function Ua(e){return function(n){return e?.[n]}}var Ma={À:"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"},La=Ua(Ma);const $a=La;var Wa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,za="\\u0300-\\u036f",Fa="\\ufe20-\\ufe2f",Ga="\\u20d0-\\u20ff",qa=za+Fa+Ga,Va="["+qa+"]",Ha=RegExp(Va,"g");function Ba(e){return e=Qe(e),e&&e.replace(Wa,$a).replace(Ha,"")}var Ya=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Ja(e){return e.match(Ya)||[]}var ka=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Za(e){return ka.test(e)}var Pn="\\ud800-\\udfff",Ka="\\u0300-\\u036f",Qa="\\ufe20-\\ufe2f",Xa="\\u20d0-\\u20ff",es=Ka+Qa+Xa,In="\\u2700-\\u27bf",On="a-z\\xdf-\\xf6\\xf8-\\xff",ts="\\xac\\xb1\\xd7\\xf7",ns="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rs="\\u2000-\\u206f",os=" \\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",Cn="A-Z\\xc0-\\xd6\\xd8-\\xde",is="\\ufe0e\\ufe0f",xn=ts+ns+rs+os,Dn="['’]",Rn="["+xn+"]",as="["+es+"]",jn="\\d+",ss="["+In+"]",Nn="["+On+"]",Un="[^"+Pn+xn+jn+In+On+Cn+"]",us="\\ud83c[\\udffb-\\udfff]",cs="(?:"+as+"|"+us+")",ds="[^"+Pn+"]",Mn="(?:\\ud83c[\\udde6-\\uddff]){2}",Ln="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="["+Cn+"]",fs="\\u200d",$n="(?:"+Nn+"|"+Un+")",ls="(?:"+Se+"|"+Un+")",Wn="(?:"+Dn+"(?:d|ll|m|re|s|t|ve))?",zn="(?:"+Dn+"(?:D|LL|M|RE|S|T|VE))?",Fn=cs+"?",Gn="["+is+"]?",hs="(?:"+fs+"(?:"+[ds,Mn,Ln].join("|")+")"+Gn+Fn+")*",ps="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gs="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",vs=Gn+Fn+hs,ws="(?:"+[ss,Mn,Ln].join("|")+")"+vs,_s=RegExp([Se+"?"+Nn+"+"+Wn+"(?="+[Rn,Se,"$"].join("|")+")",ls+"+"+zn+"(?="+[Rn,Se+$n,"$"].join("|")+")",Se+"?"+$n+"+"+Wn,Se+"+"+zn,gs,ps,jn,ws].join("|"),"g");function ys(e){return e.match(_s)||[]}function ms(e,n,i){return e=Qe(e),n=i?void 0:n,n===void 0?Za(e)?ys(e):Ja(e):e.match(n)||[]}var Es="['’]",As=RegExp(Es,"g");function qn(e){return function(n){return Na(ms(Ba(n).replace(As,"")),e,"")}}var bs=qn(function(e,n,i){return n=n.toLowerCase(),e+(i?ja(n):n)});const Ss=bs;function Ts(){this.__data__=new ne,this.size=0}function Ps(e){var n=this.__data__,i=n.delete(e);return this.size=n.size,i}function Is(e){return this.__data__.get(e)}function Os(e){return this.__data__.has(e)}var Cs=200;function xs(e,n){var i=this.__data__;if(i instanceof ne){var u=i.__data__;if(!Me||u.length<Cs-1)return u.push([e,n]),this.size=++i.size,this;i=this.__data__=new be(u)}return i.set(e,n),this.size=i.size,this}function Te(e){var n=this.__data__=new ne(e);this.size=n.size}Te.prototype.clear=Ts,Te.prototype.delete=Ps,Te.prototype.get=Is,Te.prototype.has=Os,Te.prototype.set=xs;function Ds(e,n){return e&&ke(n,gt(n),e)}function Rs(e,n){return e&&ke(n,vt(n),e)}var Vn=typeof E=="object"&&E&&!E.nodeType&&E,Hn=Vn&&typeof module=="object"&&module&&!module.nodeType&&module,js=Hn&&Hn.exports===Vn,Bn=js?K.Buffer:void 0,Yn=Bn?Bn.allocUnsafe:void 0;function Ns(e,n){if(n)return e.slice();var i=e.length,u=Yn?Yn(i):new e.constructor(i);return e.copy(u),u}function Us(e,n){for(var i=-1,u=e==null?0:e.length,h=0,g=[];++i<u;){var _=e[i];n(_,i,e)&&(g[h++]=_)}return g}function Jn(){return[]}var Ms=Object.prototype,Ls=Ms.propertyIsEnumerable,kn=Object.getOwnPropertySymbols,yt=kn?function(e){return e==null?[]:(e=Object(e),Us(kn(e),function(n){return Ls.call(e,n)}))}:Jn;function $s(e,n){return ke(e,yt(e),n)}var Ws=Object.getOwnPropertySymbols,Zn=Ws?function(e){for(var n=[];e;)wn(n,yt(e)),e=_n(e);return n}:Jn;function zs(e,n){return ke(e,Zn(e),n)}function Kn(e,n,i){var u=n(e);return Je(e)?u:wn(u,i(e))}function Fs(e){return Kn(e,gt,yt)}function Gs(e){return Kn(e,vt,Zn)}var mt=de(K,"DataView"),Et=de(K,"Promise"),At=de(K,"Set"),Qn="[object Map]",qs="[object Object]",Xn="[object Promise]",er="[object Set]",tr="[object WeakMap]",nr="[object DataView]",Vs=ce(mt),Hs=ce(Me),Bs=ce(Et),Ys=ce(At),Js=ce(ft),le=me;(mt&&le(new mt(new ArrayBuffer(1)))!=nr||Me&&le(new Me)!=Qn||Et&&le(Et.resolve())!=Xn||At&&le(new At)!=er||ft&&le(new ft)!=tr)&&(le=function(e){var n=me(e),i=n==qs?e.constructor:void 0,u=i?ce(i):"";if(u)switch(u){case Vs:return nr;case Hs:return Qn;case Bs:return Xn;case Ys:return er;case Js:return tr}return n});const bt=le;var ks=Object.prototype,Zs=ks.hasOwnProperty;function Ks(e){var n=e.length,i=new e.constructor(n);return n&&typeof e[0]=="string"&&Zs.call(e,"index")&&(i.index=e.index,i.input=e.input),i}var rr=K.Uint8Array;function St(e){var n=new e.constructor(e.byteLength);return new rr(n).set(new rr(e)),n}function Qs(e,n){var i=n?St(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}var Xs=/\w*$/;function eu(e){var n=new e.constructor(e.source,Xs.exec(e));return n.lastIndex=e.lastIndex,n}var or=ae?ae.prototype:void 0,ir=or?or.valueOf:void 0;function tu(e){return ir?Object(ir.call(e)):{}}function nu(e,n){var i=n?St(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}var ru="[object Boolean]",ou="[object Date]",iu="[object Map]",au="[object Number]",su="[object RegExp]",uu="[object Set]",cu="[object String]",du="[object Symbol]",fu="[object ArrayBuffer]",lu="[object DataView]",hu="[object Float32Array]",pu="[object Float64Array]",gu="[object Int8Array]",vu="[object Int16Array]",wu="[object Int32Array]",_u="[object Uint8Array]",yu="[object Uint8ClampedArray]",mu="[object Uint16Array]",Eu="[object Uint32Array]";function Au(e,n,i){var u=e.constructor;switch(n){case fu:return St(e);case ru:case ou:return new u(+e);case lu:return Qs(e,i);case hu:case pu:case gu:case vu:case wu:case _u:case yu:case mu:case Eu:return nu(e,i);case iu:return new u;case au:case cu:return new u(e);case su:return eu(e);case uu:return new u;case du:return tu(e)}}function bu(e){return typeof e.constructor=="function"&&!lt(e)?No(_n(e)):{}}var Su="[object Map]";function Tu(e){return Ee(e)&&bt(e)==Su}var ar=Ae&&Ae.isMap,Pu=ar?ht(ar):Tu,Iu="[object Set]";function Ou(e){return Ee(e)&&bt(e)==Iu}var sr=Ae&&Ae.isSet,Cu=sr?ht(sr):Ou,xu=1,Du=2,Ru=4,ur="[object Arguments]",ju="[object Array]",Nu="[object Boolean]",Uu="[object Date]",Mu="[object Error]",cr="[object Function]",Lu="[object GeneratorFunction]",$u="[object Map]",Wu="[object Number]",dr="[object Object]",zu="[object RegExp]",Fu="[object Set]",Gu="[object String]",qu="[object Symbol]",Vu="[object WeakMap]",Hu="[object ArrayBuffer]",Bu="[object DataView]",Yu="[object Float32Array]",Ju="[object Float64Array]",ku="[object Int8Array]",Zu="[object Int16Array]",Ku="[object Int32Array]",Qu="[object Uint8Array]",Xu="[object Uint8ClampedArray]",ec="[object Uint16Array]",tc="[object Uint32Array]",D={};D[ur]=D[ju]=D[Hu]=D[Bu]=D[Nu]=D[Uu]=D[Yu]=D[Ju]=D[ku]=D[Zu]=D[Ku]=D[$u]=D[Wu]=D[dr]=D[zu]=D[Fu]=D[Gu]=D[qu]=D[Qu]=D[Xu]=D[ec]=D[tc]=!0,D[Mu]=D[cr]=D[Vu]=!1;function Xe(e,n,i,u,h,g){var _,A=n&xu,I=n&Du,P=n&Ru;if(i&&(_=h?i(e,u,h,g):i(e)),_!==void 0)return _;if(!je(e))return e;var Q=Je(e);if(Q){if(_=Ks(e),!A)return Uo(e,_)}else{var ie=bt(e),ge=ie==cr||ie==Lu;if(ln(e))return Ns(e,A);if(ie==dr||ie==ur||ge&&!h){if(_=I||ge?{}:bu(e),!A)return I?zs(e,Rs(_,e)):$s(e,Ds(_,e))}else{if(!D[ie])return h?e:{};_=Au(e,ie,A)}}g||(g=new Te);var ve=g.get(e);if(ve)return ve;g.set(e,_),Cu(e)?e.forEach(function(H){_.add(Xe(H,n,i,H,e,g))}):Pu(e)&&e.forEach(function(H,ee){_.set(ee,Xe(H,n,i,ee,e,g))});var q=P?I?Gs:Fs:I?vt:gt,X=Q?void 0:q(e);return Mo(X||e,function(H,ee){X&&(ee=H,H=e[ee]),rn(_,ee,Xe(H,n,i,ee,e,g))}),_}var nc=1,rc=4;function oc(e){return Xe(e,nc|rc)}var et=qn(function(e,n,i){return e+(i?"_":"")+n.toLowerCase()});function ic(e={}){return this.API.request("open",e)}function ac(e){return this.API.request("open_external_url",e)}function sc(){return this.API.request("get_env")}function uc(e){return this.API.request("update_my_user",e)}function cc(){return this.API.request("get_languages")}function dc(e){return E.highLevelApi.API.request("get_events",e)}function fc(e){return E.highLevelApi.API.request("create_event",e)}function lc(e){return E.highLevelApi.API.request("update_event",e)}function hc(e){return E.highLevelApi.API.request("delete_event",e)}function pc(e){return this.API.request("get_canvases",e)}function gc(e){return this.API.request("create_canvas",e)}function vc(e){return this.API.request("delete_canvas",e)}function wc(e){let n=!1;return typeof window<"u"&&(n=new URLSearchParams(window.location.search).get("debug")==="true"||!!window.debug),n&&console.info("JS API UPDATE CANVAS",e),this.API.request("update_canvas",e).then(i=>(n&&console.info("JS API UPDATE CANVAS RESPONSE",i),i))}function _c(e){return this.API.request("get_canvas",e)}function yc(e){return this.API.request("share_canvas",e)}function mc(e){const n={...e};return n.type&&(n.type=Array.isArray(n.type)?n.type:[n.type]),n.content_type&&(n.content_type=Array.isArray(n.content_type)?n.content_type:[n.content_type]),this.API.request("get_files",n)}function Ec(e){return this.API.request("get_recent_files",e||{})}function Ac(e){return this.API.request("download_file",e)}function bc(e){return this.API.request("get_app_config",e)}function Sc(e){return this.API.request("get_file",e)}function Tc(e){return this.API.request("update_file",e)}function Pc(e){return this.API.request("delete_file",e)}function Ic(e){return this.API.request("create_file",e)}function Oc(){return this.API.request("select_device_file")}function Cc(e){return this.API.request("search",e)}function xc(e){return this.API.request("get_users",e)}function Dc(e){return this.API.request("refresh_service_token",e)}function Rc(e){return this.API.request("fetch_document_info",e)}function jc(e){return this.API.request("render_page_as_image",e)}function Nc(e){return this.API.request("toast",e)}function Uc(e){return E.highLevelApi.API.request("query",e)}function Mc(e={id:"root"}){return this.API.request("get_folder",e)}function Lc(e){return this.API.request("create_folder",e)}function $c(e){return this.API.request("update_folder",e)}function Wc(e){return this.API.request("delete_folder",e)}function zc(e){return this.API.request("move_folder_items",e)}function Fc(e){return this.API.request("get_favorites",e)}function Gc(e){return this.API.request("create_favorite",e)}function qc(e){return this.API.request("delete_favorite",e)}function Vc(e){return e.type||(e.type="native"),E.highLevelApi.API.request("notify",e)}function Hc(e){return E.highLevelApi.API.request("track",e)}function Bc(e){return this.API.request("get_instance_metadata_templates",e)}function Yc(){return this.API.request("trigger_non_files_sync")}function Jc(e){return E.highLevelApi.API.request("submit_user_feedback",e)}function kc(){return E.highLevelApi.API.request("close")}function Zc(e){return this.API.request("open_web_view_always_on_top",e)}const Kc=Object.freeze(Object.defineProperty({__proto__:null,close:kc,createCanvas:gc,createEvent:fc,createFavorite:Gc,createFile:Ic,createFolder:Lc,deleteCanvas:vc,deleteEvent:hc,deleteFavorite:qc,deleteFile:Pc,deleteFolder:Wc,downloadFile:Ac,fetchDocumentInfo:Rc,getAppConfig:bc,getCanvas:_c,getCanvases:pc,getEnv:sc,getEvents:dc,getFavorites:Fc,getFile:Sc,getFiles:mc,getFolder:Mc,getInstanceMetadataTemplates:Bc,getLanguages:cc,getRecentFiles:Ec,getUsers:xc,moveFolderItems:zc,notify:Vc,open:ic,openExternalUrl:ac,openWebViewAlwaysOnTop:Zc,query:Uc,refreshServiceToken:Dc,renderPageAsImage:jc,search:Cc,selectDeviceFile:Oc,shareCanvas:yc,submitUserFeedback:Jc,toast:Nc,track:Hc,triggerNonFilesSync:Yc,updateCanvas:wc,updateEvent:lc,updateFile:Tc,updateFolder:$c,updateMyUser:uc},Symbol.toStringTag,{value:"Module"}));class fr{listeners={};on(n,i){this.listeners[n]=(this.listeners[n]??[]).concat(i)}off(n,i){this.listeners[n]=(this.listeners[n]??[]).filter(u=>u!==i)}emit(n,i){(this.listeners[n]??[]).forEach(u=>u(i))}}for(var G=[],Tt=0;Tt<256;++Tt)G.push((Tt+256).toString(16).slice(1));function Qc(e,n=0){return(G[e[n+0]]+G[e[n+1]]+G[e[n+2]]+G[e[n+3]]+"-"+G[e[n+4]]+G[e[n+5]]+"-"+G[e[n+6]]+G[e[n+7]]+"-"+G[e[n+8]]+G[e[n+9]]+"-"+G[e[n+10]]+G[e[n+11]]+G[e[n+12]]+G[e[n+13]]+G[e[n+14]]+G[e[n+15]]).toLowerCase()}var tt,Xc=new Uint8Array(16);function ed(){if(!tt&&(tt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!tt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tt(Xc)}var td=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const lr={randomUUID:td};function nd(e,n,i){if(lr.randomUUID&&!n&&!e)return lr.randomUUID();e=e||{};var u=e.random||(e.rng||ed)();if(u[6]=u[6]&15|64,u[8]=u[8]&63|128,n){i=i||0;for(var h=0;h<16;++h)n[i+h]=u[h];return n}return Qc(u)}const rd="PITCHER_EVENT";var nt=(e=>(e.REQUEST="PITCHER_REQUEST",e.RESPONSE="PITCHER_RESPONSE",e))(nt||{}),rt=(e=>(e.OK="ok",e.ERROR="error",e))(rt||{}),hr=(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))(hr||{}),pr=(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))(pr||{}),gr=(e=>(e.CREATE_AND_OPEN_CANVAS="create_and_open_canvas",e.OPEN_CANVAS="open_canvas",e.START_CALL="start_call",e))(gr||{});class od extends Error{}function id(e,n){if(!e)throw new od(n)}const vr=["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"],wr=["context","overrides","filters","metadata","style","hidden"],_r=(e,n)=>n.includes(e)||e.endsWith("style"),Le=(e,n=vr,i=wr)=>Array.isArray(e)?e.map(u=>Le(u,n,i)):e!=null&&e.constructor===Object?Object.keys(e).reduce((u,h)=>{const g=_r(h,i),_=n.includes(h)||g?h:Ss(h),A=g?e[h]:Le(e[h],n,i);return{...u,[_]:A}},{}):e,Pt=(e,n=vr,i=wr)=>Array.isArray(e)?e.map(u=>Pt(u,n,i)):e!=null&&e.constructor===Object?Object.keys(e).reduce((u,h)=>{const g=_r(h,i),_=n.includes(h)||g?h:et(h),A=g?e[h]:Pt(e[h],n,i);return{...u,[_]:A}},{}):e;function ad(e,n=[],i=["development","test"].includes("production")){if(i)return!0;if(!e||!e.origin)return!1;const u=[...n,window.location.origin,"pitcher.com"],h=u.includes(e.origin)||u.some(g=>e.origin.endsWith(g));return h||console.warn(`The message origin ${e.origin} is not the same as the current origin ${window.location.origin}. Bailing...`),h}const It=5,yr=1e3;function $e(e){const n=new URLSearchParams;for(const i in e)Array.isArray(e[i])?e[i].forEach(u=>n.append(i,u)):n.append(i,e[i]);return n.toString()}async function he(e,n,i=It){try{const u=await fetch(e,n);if(!u.ok){if(u.status>=500&&u.status<600&&i>0){const _=yr*Math.pow(2,It-i);return await new Promise(A=>setTimeout(A,_)),he(e,n,i-1)}const h=await u.json(),g=new Error(`HTTP error! status: ${u.status}, message: ${h.message||u.statusText}`);throw g.status=u.status,g}return u.json()}catch(u){if(i>0){const h=yr*Math.pow(2,It-i);return await new Promise(g=>setTimeout(g,h)),he(e,n,i-1)}throw u}}function sd(e,n){const i={"Content-Type":"application/json",Authorization:`Bearer ${n}`},u=e+"/api/v1",h={credentials:"include"};return{get:async(g,_={})=>{const A=new URL(`${u}${g}`);return _.params&&(A.search=$e(_.params)),await he(A.toString(),{...h,..._,method:"GET",headers:i})},post:async(g,_,A={})=>{const I=new URL(`${u}${g}`);return A.params&&(I.search=$e(A.params)),await he(I.toString(),{...h,...A,method:"POST",headers:i,body:JSON.stringify(_)})},put:async(g,_,A={})=>{const I=new URL(`${u}${g}`);return A.params&&(I.search=$e(A.params)),await he(I.toString(),{...h,...A,method:"PUT",headers:i,body:JSON.stringify(_)})},delete:async(g,_={})=>{const A=new URL(`${u}${g}`);return _.params&&(A.search=$e(_.params)),await he(A.toString(),{...h,..._,method:"DELETE",headers:i})},patch:async(g,_,A={})=>{const I=new URL(`${u}${g}`);return A.params&&(I.search=$e(A.params)),await he(I.toString(),{...h,...A,method:"PATCH",headers:i,body:JSON.stringify(_)})}}}let Pe,re;const Ie=(e,...n)=>console.info(`[online handlers]: ${e}`,...n),Oe=()=>{if(!Pe)throw new Error("Missing env");if(!re)throw new Error("Missing http")},ud=e=>{Pe=e,re=sd(Pe.pitcher.token_claims["https://pitcher.com/claims/urls"].custom_domain,Pe.pitcher.access_token)},mr={get_canvases:async e=>{Ie("online handler get_canvases called with:",e),Oe();const{api_base_url:n,...i}=e;return await re.get("/canvases",{params:{...i,instance_id:Pe.pitcher.instance.id}})},get_canvas:async e=>{Ie("online handler get_canvas called with:",e),Oe();const{id:n,...i}=e;return await re.get(`/canvases/${e.id}`,{params:i})},create_canvas:async e=>(Ie("online handler create_canvas called with:",e),Oe(),await re.post("/canvases",{...e,instance_id:Pe.pitcher.instance.id})),update_canvas:async e=>{Ie("online handler update_canvas called with:",e),Oe();const{id:n,...i}=e;return await re.patch(`/canvases/${e.id}`,i)},delete_canvas:async e=>(Ie("online handler delete_canvas called with:",e),Oe(),await re.delete(`/canvases/${e.id}`)),share_canvas:async e=>{Ie("online handler share_canvas called with:",e),Oe();let n;try{n=await re.get(`/shared-links/canvas/${e.id}`)}catch(i){if(i?.status===404)n=await re.post("/shared-links",{canvas_id:e.id});else throw i}return n}};function cd(e){e&&ud(e)}class dd extends fr{constructor(n){super(),this.callbacks={},this.options=n??{casing:"snake",logLevel:"off",errorLogger:()=>{},fetchMode:"postmessage"},typeof window<"u"&&(window.addEventListener("message",i=>{ad(i)&&(this.options.logLevel==="debug"&&console.log("message received",i),i.data.type==="PITCHER_RESPONSE"?(id(i.data.request.id,"event id is required"),this.handleCallbackMessage(i.data.request.id,i.data)):i.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?Le(i.data.event):i.data.event))}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(n,i){this.callbacks[n]&&(this.callbacks[n].callback(i),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[n].dispatched_at} ms for the event ${this.callbacks[n].type}`),delete this.callbacks[n])}handleEventMessage(n){this.emit("event",n)}request(n,i=null){const u=this.options.fetchMode??"postmessage";return new Promise((h,g)=>{const _=nd(),A=P=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${_} response:`,P),P.response.status==="ok")h(this.options.casing==="camel"?Le(P.response.body):P.response.body),n==="get_env"&&cd(P.response.body);else if(P.response.status==="error")this.options.errorLogger?.({message:`Pitcher JS API call failure: ${P.request.type}`,js_api_response:JSON.stringify(P)}),g(this.options.casing==="camel"?Le(P.response.body):P.response.body);else throw new Error("unsupported response status")},I=oc(Pt(i));this.callbacks[_]={dispatched_at:Date.now(),type:n,payload:I??{},callback:A},u==="prefer-online"&&n&&mr[n]?mr[n](I).then(P=>{this.callbacks[_]&&(this.callbacks[_].callback({type:nt.RESPONSE,request:{id:_,type:n},response:{status:rt.OK,body:P}}),delete this.callbacks[_])}).catch(P=>{this.callbacks[_]&&(this.callbacks[_].callback({type:nt.RESPONSE,request:{id:_,type:n},response:{status:rt.ERROR,body:P}}),delete this.callbacks[_])}):typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:n,id:_,body:I}},"*")})}}function fd(e){const n=new dd(e),i=new fr;return n.on("event",u=>{i.emit(u.type,u.body)}),{API:n,...Kc,on:(u,h)=>i.on(u,h),off:(u,h)=>i.off(u,h),enterFullscreen:()=>n.request("enter_fullscreen"),exitFullscreen:()=>n.request("exit_fullscreen"),logout:()=>n.request("logout"),quitInstance:()=>n.request("quit_instance"),getRequestTypes:()=>n.request("get_request_types"),broadcast:u=>n.request("broadcast",u),subscribe:()=>n.request("subscribe"),unsubscribe:()=>n.request("unsubscribe")}}function C(){return window.postRobot?window.postRobot:Promise.resolve().then(()=>ro).then(e=>e.default||e)}const ld="UI_MESSAGE",L={UI_BROADCAST:"ui_broadcast",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",UI_SET_POSTCALL_STYLE:"ui_set_postcall_style",UI_ENABLE_POSTCALL_SUBMIT:"ui_enable_postcall_submit",UI_DISABLE_POSTCALL_SUBMIT:"ui_disable_postcall_submit",UI_COMPLETE_POSTCALL:"ui_complete_postcall",UI_CANVAS_NAVIGATE_NEXT_PAGE:"ui_canvas_navigate_next_page",UI_CANVAS_NAVIGATE_PREVIOUS_PAGE:"ui_canvas_navigate_previous_page",UI_CANVAS_NAVIGATE_PAGE:"ui_canvas_navigate_page",UI_APP_LOADED:"ui_app_loaded",UI_APP_RESIZE:"ui_app_resize"},oe={UI_MEETING_CANCELED:"ui_meeting_canceled",UI_CANVAS_UPDATED:"ui_canvas_updated",UI_SECTION_LIST_UPDATED:"ui_section_list_updated",UI_APP_SET_DATA:"ui_app_set_data",UI_APP_UPDATE_DATA:"ui_app_update_data"},Er=[oe.UI_APP_SET_DATA,oe.UI_APP_UPDATE_DATA,oe.UI_CANVAS_UPDATED];async function hd(e={}){const n=await C();return console.warn("[content.ui.ts]: ui_select_content is deprecated and might get removed in future versions, please use select_content instead."),(await n.send(window.parent,L.UI_SELECT_CONTENT,e)).data}async function pd(e={}){return(await(await C()).send(window.parent,L.UI_SELECT_CONTENT,e)).data}async function gd(e){await(await C()).send(window.parent,L.UI_OPEN,e)}async function vd(e){await(await C()).send(window.parent,L.UI_TOAST,e)}async function wd(e){return(await(await C()).send(window.parent,L.UI_PRESELECT_SFDC_MEETING_ID,e)).data}async function _d(){await(await C()).send(window.parent,L.UI_EMBEDDABLE_READY)}async function yd(e){return(await C()).send(window.top,L.UI_UPDATE_LOCATION,e)}async function md(e){(await C()).send(window.parent,L.UI_CAPTURE_APP_ERROR,e)}async function Ed(e){return(await C()).send(window.parent,L.UI_UPDATE_CANVAS,e).then(i=>i.data)}async function Ad(){window.parent.postMessage({type:L.UI_APP_LOADED,body:{}},"*")}async function bd(e){window.parent.postMessage({type:L.UI_APP_RESIZE,body:e},"*")}async function Sd(){(await C()).send(window.parent,L.UI_CANVAS_NAVIGATE_NEXT_PAGE)}async function Td(){(await C()).send(window.parent,L.UI_CANVAS_NAVIGATE_PREVIOUS_PAGE)}async function Pd(e){(await C()).send(window.parent,L.UI_CANVAS_NAVIGATE_PAGE,e)}async function Id(e){(await C()).send(window.parent,L.UI_COMPLETE_POSTCALL,e)}async function Od(){(await C()).send(window.parent,L.UI_ENABLE_POSTCALL_SUBMIT)}async function Cd(){(await C()).send(window.parent,L.UI_DISABLE_POSTCALL_SUBMIT)}async function xd(e){(await C()).send(window.parent,L.UI_SET_POSTCALL_STYLE,e)}async function Dd(e,n){console.log("attaching native handler for type",e);const i=u=>{u.data.type===e&&n(u.data.body)};return window.addEventListener("message",i),()=>window.removeEventListener("message",i)}async function Rd(e,n){return(await C()).on(e,h=>n(h.data)).cancel}function Ce(e,n){return Er.includes(e)?Dd(e,n):Rd(e,n)}function jd(e){return Ce(oe.UI_MEETING_CANCELED,e)}function Nd(e){return Ce(oe.UI_CANVAS_UPDATED,e)}function Ud(e){return Ce(oe.UI_SECTION_LIST_UPDATED,e)}function Md(e){return Ce(oe.UI_APP_SET_DATA,e)}function Ld(e){return Ce(oe.UI_APP_UPDATE_DATA,e)}async function $d(e){(await C()).send(window.parent,L.UI_BROADCAST,e)}const Wd=Object.freeze(Object.defineProperty({__proto__:null,app_loaded:Ad,app_resize:bd,canvas_navigate_next_page:Sd,canvas_navigate_page:Pd,canvas_navigate_previous_page:Td,capture_app_error:md,complete_postcall:Id,disable_postcall_submit:Cd,embeddable_ready:_d,enable_postcall_submit:Od,on:Ce,on_app_set_data:Md,on_app_update_data:Ld,on_canvas_updated:Nd,on_meeting_canceled:jd,on_section_list_updated:Ud,open:gd,preselect_sfdc_meeting_id:wd,select_content:pd,set_postcall_style:xd,toast:vd,ui_broadcast:$d,ui_select_content:hd,update_canvas:Ed,update_location:yd},Symbol.toStringTag,{value:"Module"})),zd="ADMIN_MESSAGE",Fd={ENV_CHANGED:"admin_env_changed"},Gd={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},pe={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 qd(){return(await(await C()).send(window.parent,pe.GET_ENV)).data}async function Vd(e){return(await(await C()).send(window.parent,pe.CREATE_CANVAS,e)).data}async function Hd(e){return(await(await C()).send(window.parent,pe.GET_CANVASES,e)).data}async function Bd(e){return(await(await C()).send(window.parent,pe.GET_CANVAS,e)).data}async function Yd(e){return(await(await C()).send(window.parent,pe.UPDATE_CANVAS,e)).data}async function Jd(e){return(await(await C()).send(window.parent,pe.GET_INSTANCE_METADATA_TEMPLATES,e)).data}async function kd(e,n){return(await C()).on(e,h=>n(h.data)).cancel}const Zd=Object.freeze(Object.defineProperty({__proto__:null,createCanvas:Vd,getCanvas:Bd,getCanvases:Hd,getEnv:qd,getInstanceMetadataTemplates:Jd,on:kd,updateCanvas:Yd},Symbol.toStringTag,{value:"Module"})),Kd="DSR_MESSAGE",Qd={ENV_CHANGED:"dsr_env_changed"},Xd={DSR_REQUEST:"DSR_REQUEST",DSR_RESPONSE:"DSR_RESPONSE"},Ot={GET_ENV:"dsr_get_env",DSR_EMBEDDABLE_READY:"dsr_embeddable_ready"};async function ef(){return(await(await C()).send(window.parent,Ot.GET_ENV)).data}async function tf(){await(await C()).send(window.parent,Ot.DSR_EMBEDDABLE_READY)}async function nf(e,n){return(await C()).on(e,h=>n(h.data)).cancel}const rf=Object.freeze(Object.defineProperty({__proto__:null,embeddable_ready:tf,getEnv:ef,on:nf},Symbol.toStringTag,{value:"Module"}));E.highLevelApi=void 0;function ot(e){return E.highLevelApi||(E.highLevelApi=fd(e)),E.highLevelApi}const of=Object.entries(Wd).reduce((e,[n,i])=>(e[n]=i,e[et(n)]=i,e),{});function Ct(){return of}const af=Object.entries(Zd).reduce((e,[n,i])=>(e[n]=i,e[et(n)]=i,e),{});function Ar(){return af}const sf=Object.entries(rf).reduce((e,[n,i])=>(e[n]=i,e[et(n)]=i,e),{});function br(){return sf}function uf(){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 cf(){if(typeof window>"u")throw new Error("useApi: window is not defined");const e=window.parent.jsApiLocation;switch(e){case"ui":return{...ot(),...Ct(),ui:Ct(),impact:ot()};case"admin":return Ar();case"dsr":return br();case"impact":return ot();default:throw new Error(`Unknown api for location: ${e}`)}}window.postRobot=Vt,E.ADMIN_API_METHOD_TYPES=pe,E.ADMIN_API_TYPES=Gd,E.ADMIN_MESSAGE=zd,E.ADMIN_MESSAGE_TYPES=Fd,E.DSR_API_METHOD_TYPES=Ot,E.DSR_API_TYPES=Xd,E.DSR_MESSAGE=Kd,E.DSR_MESSAGE_TYPES=Qd,E.PITCHER_EVENT=rd,E.PitcherBroadcastedEventName=pr,E.PitcherEventName=hr,E.PitcherExternalEventName=gr,E.PitcherMessageType=nt,E.PitcherResponseStatus=rt,E.UI_API_METHOD_TYPES=L,E.UI_MESSAGE=ld,E.UI_MESSAGE_TYPES=oe,E.UI_NATIVE_MESSAGE_TYPES=Er,E.getAvailableApis=uf,E.useAdmin=Ar,E.useApi=cf,E.useDsr=br,E.usePitcherApi=ot,E.useUi=Ct,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
17
|
+
`+Je(O))})})})};function pl(n,i,r){return ao(n,i,r,{on:le,send:he})}function gl(n,i,r){return so(n,i,r,{on:le,send:he})}function vl(n){return new te({send:he,win:n})}function _l(n){return te.toProxyWindow(n,{send:he})}function po(){Ke().initialized||(Ke().initialized=!0,i=(n={on:le,send:he}).on,r=n.send,(a=Ke()).receiveMessage=a.receiveMessage||function(s){return ho(s,{on:i,send:r})},function(s){var c=s.on,l=s.send;Y().getOrSet("postMessageListener",function(){return function(g,p,h){return g.addEventListener("message",h),{cancel:function(){g.removeEventListener("message",h)}}}(window,0,function(g){(function(p,h){var y=h.on,_=h.send;x.try(function(){var w=p.source||p.sourceElement,A=p.origin||p.originalEvent&&p.originalEvent.origin,I=p.data;if(A==="null"&&(A="file://"),w){if(!A)throw new Error("Post message did not have origin domain");ho({source:w,origin:A,data:I},{on:y,send:_})}})})(g,{on:c,send:l})})})}({on:le,send:he}),function(s){var c=s.on,l=s.send;Y("builtinListeners").getOrSet("helloListener",function(){var g=c("postrobot_hello",{domain:"*"},function(h){return kr(h.source,{domain:h.origin}),{instanceID:Xr()}}),p=Wr();return p&&Ht(p,{send:l}).catch(function(h){}),g})}({on:le,send:he}));var n,i,r,a}function wl(){(function(){for(var i=Y("responseListeners"),r=0,a=i.keys();r<a.length;r++){var s=a[r],c=i.get(s);c&&(c.cancelled=!0),i.del(s)}})(),(n=Y().get("postMessageListener"))&&n.cancel();var n;delete window.__post_robot_10_0_46__}var yl=!0;function Al(n){for(var i=0,r=X("requestPromises").get(n,[]);i<r.length;i++)r[i].reject(new Error("Window "+(Q(n)?"closed":"cleaned up")+" before response")).catch(Ee)}po()}])})})(Xt);var _o=Xt.exports;(function(e){e.exports=_o,e.exports.default=e.exports})(Qt);var kt=Qt.exports;const en=vo(kt),wo=Ne({__proto__:null,default:en},[kt]);var tn=typeof global=="object"&&global&&global.Object===Object&&global,yo=typeof self=="object"&&self&&self.Object===Object&&self,re=tn||yo||Function("return this")(),oe=re.Symbol,nn=Object.prototype,Ao=nn.hasOwnProperty,mo=nn.toString,Le=oe?oe.toStringTag:void 0;function Eo(e){var t=Ao.call(e,Le),o=e[Le];try{e[Le]=void 0;var u=!0}catch{}var f=mo.call(e);return u&&(t?e[Le]=o:delete e[Le]),f}var bo=Object.prototype,So=bo.toString;function To(e){return So.call(e)}var Po="[object Null]",Io="[object Undefined]",rn=oe?oe.toStringTag:void 0;function Se(e){return e==null?e===void 0?Io:Po:rn&&rn in Object(e)?Eo(e):To(e)}function de(e){return e!=null&&typeof e=="object"}var Oo="[object Symbol]";function Co(e){return typeof e=="symbol"||de(e)&&Se(e)==Oo}function Do(e,t){for(var o=-1,u=e==null?0:e.length,f=Array(u);++o<u;)f[o]=t(e[o],o,e);return f}var Te=Array.isArray,xo=1/0,on=oe?oe.prototype:void 0,an=on?on.toString:void 0;function sn(e){if(typeof e=="string")return e;if(Te(e))return Do(e,sn)+"";if(Co(e))return an?an.call(e):"";var t=e+"";return t=="0"&&1/e==-xo?"-0":t}function Me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ro="[object AsyncFunction]",$o="[object Function]",No="[object GeneratorFunction]",Lo="[object Proxy]";function un(e){if(!Me(e))return!1;var t=Se(e);return t==$o||t==No||t==Ro||t==Lo}var wt=re["__core-js_shared__"],cn=function(){var e=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Mo(e){return!!cn&&cn in e}var Uo=Function.prototype,jo=Uo.toString;function pe(e){if(e!=null){try{return jo.call(e)}catch{}try{return e+""}catch{}}return""}var Wo=/[\\^$.*+?()[\]{}|]/g,Fo=/^\[object .+?Constructor\]$/,zo=Function.prototype,Go=Object.prototype,qo=zo.toString,Ho=Go.hasOwnProperty,Bo=RegExp("^"+qo.call(Ho).replace(Wo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vo(e){if(!Me(e)||Mo(e))return!1;var t=un(e)?Bo:Fo;return t.test(pe(e))}function Yo(e,t){return e?.[t]}function ge(e,t){var o=Yo(e,t);return Vo(o)?o:void 0}var yt=ge(re,"WeakMap"),fn=Object.create,Jo=function(){function e(){}return function(t){if(!Me(t))return{};if(fn)return fn(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}}();function Zo(e,t){var o=-1,u=e.length;for(t||(t=Array(u));++o<u;)t[o]=e[o];return t}var dn=function(){try{var e=ge(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Ko(e,t){for(var o=-1,u=e==null?0:e.length;++o<u&&t(e[o],o,e)!==!1;);return e}var Qo=9007199254740991,Xo=/^(?:0|[1-9]\d*)$/;function ko(e,t){var o=typeof e;return t=t??Qo,!!t&&(o=="number"||o!="symbol"&&Xo.test(e))&&e>-1&&e%1==0&&e<t}function ln(e,t,o){t=="__proto__"&&dn?dn(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}function At(e,t){return e===t||e!==e&&t!==t}var ei=Object.prototype,ti=ei.hasOwnProperty;function hn(e,t,o){var u=e[t];(!(ti.call(e,t)&&At(u,o))||o===void 0&&!(t in e))&&ln(e,t,o)}function Xe(e,t,o,u){var f=!o;o||(o={});for(var d=-1,v=t.length;++d<v;){var m=t[d],b=u?u(o[m],e[m],m,o,e):void 0;b===void 0&&(b=e[m]),f?ln(o,m,b):hn(o,m,b)}return o}var ni=9007199254740991;function pn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ni}function gn(e){return e!=null&&pn(e.length)&&!un(e)}var ri=Object.prototype;function mt(e){var t=e&&e.constructor,o=typeof t=="function"&&t.prototype||ri;return e===o}function oi(e,t){for(var o=-1,u=Array(e);++o<e;)u[o]=t(o);return u}var ii="[object Arguments]";function vn(e){return de(e)&&Se(e)==ii}var _n=Object.prototype,ai=_n.hasOwnProperty,si=_n.propertyIsEnumerable,ui=vn(function(){return arguments}())?vn:function(e){return de(e)&&ai.call(e,"callee")&&!si.call(e,"callee")};function ci(){return!1}var wn=typeof E=="object"&&E&&!E.nodeType&&E,yn=wn&&typeof module=="object"&&module&&!module.nodeType&&module,fi=yn&&yn.exports===wn,An=fi?re.Buffer:void 0,di=An?An.isBuffer:void 0,ke=di||ci,li="[object Arguments]",hi="[object Array]",pi="[object Boolean]",gi="[object Date]",vi="[object Error]",_i="[object Function]",wi="[object Map]",yi="[object Number]",Ai="[object Object]",mi="[object RegExp]",Ei="[object Set]",bi="[object String]",Si="[object WeakMap]",Ti="[object ArrayBuffer]",Pi="[object DataView]",Ii="[object Float32Array]",Oi="[object Float64Array]",Ci="[object Int8Array]",Di="[object Int16Array]",xi="[object Int32Array]",Ri="[object Uint8Array]",$i="[object Uint8ClampedArray]",Ni="[object Uint16Array]",Li="[object Uint32Array]",L={};L[Ii]=L[Oi]=L[Ci]=L[Di]=L[xi]=L[Ri]=L[$i]=L[Ni]=L[Li]=!0,L[li]=L[hi]=L[Ti]=L[pi]=L[Pi]=L[gi]=L[vi]=L[_i]=L[wi]=L[yi]=L[Ai]=L[mi]=L[Ei]=L[bi]=L[Si]=!1;function Mi(e){return de(e)&&pn(e.length)&&!!L[Se(e)]}function Et(e){return function(t){return e(t)}}var mn=typeof E=="object"&&E&&!E.nodeType&&E,Ue=mn&&typeof module=="object"&&module&&!module.nodeType&&module,Ui=Ue&&Ue.exports===mn,bt=Ui&&tn.process,Pe=function(){try{var e=Ue&&Ue.require&&Ue.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch{}}(),En=Pe&&Pe.isTypedArray,bn=En?Et(En):Mi,ji=Object.prototype,Wi=ji.hasOwnProperty;function Sn(e,t){var o=Te(e),u=!o&&ui(e),f=!o&&!u&&ke(e),d=!o&&!u&&!f&&bn(e),v=o||u||f||d,m=v?oi(e.length,String):[],b=m.length;for(var S in e)(t||Wi.call(e,S))&&!(v&&(S=="length"||f&&(S=="offset"||S=="parent")||d&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||ko(S,b)))&&m.push(S);return m}function Tn(e,t){return function(o){return e(t(o))}}var Fi=Tn(Object.keys,Object),zi=Object.prototype,Gi=zi.hasOwnProperty;function qi(e){if(!mt(e))return Fi(e);var t=[];for(var o in Object(e))Gi.call(e,o)&&o!="constructor"&&t.push(o);return t}function St(e){return gn(e)?Sn(e):qi(e)}function Hi(e){var t=[];if(e!=null)for(var o in Object(e))t.push(o);return t}var Bi=Object.prototype,Vi=Bi.hasOwnProperty;function Yi(e){if(!Me(e))return Hi(e);var t=mt(e),o=[];for(var u in e)u=="constructor"&&(t||!Vi.call(e,u))||o.push(u);return o}function Tt(e){return gn(e)?Sn(e,!0):Yi(e)}var je=ge(Object,"create");function Ji(){this.__data__=je?je(null):{},this.size=0}function Zi(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ki="__lodash_hash_undefined__",Qi=Object.prototype,Xi=Qi.hasOwnProperty;function ki(e){var t=this.__data__;if(je){var o=t[e];return o===Ki?void 0:o}return Xi.call(t,e)?t[e]:void 0}var ea=Object.prototype,ta=ea.hasOwnProperty;function na(e){var t=this.__data__;return je?t[e]!==void 0:ta.call(t,e)}var ra="__lodash_hash_undefined__";function oa(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=je&&t===void 0?ra:t,this}function ve(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var u=e[t];this.set(u[0],u[1])}}ve.prototype.clear=Ji,ve.prototype.delete=Zi,ve.prototype.get=ki,ve.prototype.has=na,ve.prototype.set=oa;function ia(){this.__data__=[],this.size=0}function et(e,t){for(var o=e.length;o--;)if(At(e[o][0],t))return o;return-1}var aa=Array.prototype,sa=aa.splice;function ua(e){var t=this.__data__,o=et(t,e);if(o<0)return!1;var u=t.length-1;return o==u?t.pop():sa.call(t,o,1),--this.size,!0}function ca(e){var t=this.__data__,o=et(t,e);return o<0?void 0:t[o][1]}function fa(e){return et(this.__data__,e)>-1}function da(e,t){var o=this.__data__,u=et(o,e);return u<0?(++this.size,o.push([e,t])):o[u][1]=t,this}function se(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var u=e[t];this.set(u[0],u[1])}}se.prototype.clear=ia,se.prototype.delete=ua,se.prototype.get=ca,se.prototype.has=fa,se.prototype.set=da;var We=ge(re,"Map");function la(){this.size=0,this.__data__={hash:new ve,map:new(We||se),string:new ve}}function ha(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function tt(e,t){var o=e.__data__;return ha(t)?o[typeof t=="string"?"string":"hash"]:o.map}function pa(e){var t=tt(this,e).delete(e);return this.size-=t?1:0,t}function ga(e){return tt(this,e).get(e)}function va(e){return tt(this,e).has(e)}function _a(e,t){var o=tt(this,e),u=o.size;return o.set(e,t),this.size+=o.size==u?0:1,this}function _e(e){var t=-1,o=e==null?0:e.length;for(this.clear();++t<o;){var u=e[t];this.set(u[0],u[1])}}_e.prototype.clear=la,_e.prototype.delete=pa,_e.prototype.get=ga,_e.prototype.has=va,_e.prototype.set=_a;function nt(e){return e==null?"":sn(e)}function Pn(e,t){for(var o=-1,u=t.length,f=e.length;++o<u;)e[f+o]=t[o];return e}var wa=Tn(Object.getPrototypeOf,Object);const In=wa;function ya(e,t,o){var u=-1,f=e.length;t<0&&(t=-t>f?0:f+t),o=o>f?f:o,o<0&&(o+=f),f=t>o?0:o-t>>>0,t>>>=0;for(var d=Array(f);++u<f;)d[u]=e[u+t];return d}function Aa(e,t,o){var u=e.length;return o=o===void 0?u:o,!t&&o>=u?e:ya(e,t,o)}var ma="\\ud800-\\udfff",Ea="\\u0300-\\u036f",ba="\\ufe20-\\ufe2f",Sa="\\u20d0-\\u20ff",Ta=Ea+ba+Sa,Pa="\\ufe0e\\ufe0f",Ia="\\u200d",Oa=RegExp("["+Ia+ma+Ta+Pa+"]");function On(e){return Oa.test(e)}function Ca(e){return e.split("")}var Cn="\\ud800-\\udfff",Da="\\u0300-\\u036f",xa="\\ufe20-\\ufe2f",Ra="\\u20d0-\\u20ff",$a=Da+xa+Ra,Na="\\ufe0e\\ufe0f",La="["+Cn+"]",Pt="["+$a+"]",It="\\ud83c[\\udffb-\\udfff]",Ma="(?:"+Pt+"|"+It+")",Dn="[^"+Cn+"]",xn="(?:\\ud83c[\\udde6-\\uddff]){2}",Rn="[\\ud800-\\udbff][\\udc00-\\udfff]",Ua="\\u200d",$n=Ma+"?",Nn="["+Na+"]?",ja="(?:"+Ua+"(?:"+[Dn,xn,Rn].join("|")+")"+Nn+$n+")*",Wa=Nn+$n+ja,Fa="(?:"+[Dn+Pt+"?",Pt,xn,Rn,La].join("|")+")",za=RegExp(It+"(?="+It+")|"+Fa+Wa,"g");function Ga(e){return e.match(za)||[]}function qa(e){return On(e)?Ga(e):Ca(e)}function Ha(e){return function(t){t=nt(t);var o=On(t)?qa(t):void 0,u=o?o[0]:t.charAt(0),f=o?Aa(o,1).join(""):t.slice(1);return u[e]()+f}}var Ba=Ha("toUpperCase");function Va(e){return Ba(nt(e).toLowerCase())}function Ya(e,t,o,u){var f=-1,d=e==null?0:e.length;for(u&&d&&(o=e[++f]);++f<d;)o=t(o,e[f],f,e);return o}function Ja(e){return function(t){return e?.[t]}}var Za={À:"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"},Ka=Ja(Za);const Qa=Ka;var Xa=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ka="\\u0300-\\u036f",es="\\ufe20-\\ufe2f",ts="\\u20d0-\\u20ff",ns=ka+es+ts,rs="["+ns+"]",os=RegExp(rs,"g");function is(e){return e=nt(e),e&&e.replace(Xa,Qa).replace(os,"")}var as=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ss(e){return e.match(as)||[]}var us=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cs(e){return us.test(e)}var Ln="\\ud800-\\udfff",fs="\\u0300-\\u036f",ds="\\ufe20-\\ufe2f",ls="\\u20d0-\\u20ff",hs=fs+ds+ls,Mn="\\u2700-\\u27bf",Un="a-z\\xdf-\\xf6\\xf8-\\xff",ps="\\xac\\xb1\\xd7\\xf7",gs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vs="\\u2000-\\u206f",_s=" \\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",jn="A-Z\\xc0-\\xd6\\xd8-\\xde",ws="\\ufe0e\\ufe0f",Wn=ps+gs+vs+_s,Fn="['’]",zn="["+Wn+"]",ys="["+hs+"]",Gn="\\d+",As="["+Mn+"]",qn="["+Un+"]",Hn="[^"+Ln+Wn+Gn+Mn+Un+jn+"]",ms="\\ud83c[\\udffb-\\udfff]",Es="(?:"+ys+"|"+ms+")",bs="[^"+Ln+"]",Bn="(?:\\ud83c[\\udde6-\\uddff]){2}",Vn="[\\ud800-\\udbff][\\udc00-\\udfff]",Ie="["+jn+"]",Ss="\\u200d",Yn="(?:"+qn+"|"+Hn+")",Ts="(?:"+Ie+"|"+Hn+")",Jn="(?:"+Fn+"(?:d|ll|m|re|s|t|ve))?",Zn="(?:"+Fn+"(?:D|LL|M|RE|S|T|VE))?",Kn=Es+"?",Qn="["+ws+"]?",Ps="(?:"+Ss+"(?:"+[bs,Bn,Vn].join("|")+")"+Qn+Kn+")*",Is="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Os="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Cs=Qn+Kn+Ps,Ds="(?:"+[As,Bn,Vn].join("|")+")"+Cs,xs=RegExp([Ie+"?"+qn+"+"+Jn+"(?="+[zn,Ie,"$"].join("|")+")",Ts+"+"+Zn+"(?="+[zn,Ie+Yn,"$"].join("|")+")",Ie+"?"+Yn+"+"+Jn,Ie+"+"+Zn,Os,Is,Gn,Ds].join("|"),"g");function Rs(e){return e.match(xs)||[]}function $s(e,t,o){return e=nt(e),t=o?void 0:t,t===void 0?cs(e)?Rs(e):ss(e):e.match(t)||[]}var Ns="['’]",Ls=RegExp(Ns,"g");function Xn(e){return function(t){return Ya($s(is(t).replace(Ls,"")),e,"")}}var Ms=Xn(function(e,t,o){return t=t.toLowerCase(),e+(o?Va(t):t)});const Us=Ms;function js(){this.__data__=new se,this.size=0}function Ws(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}function Fs(e){return this.__data__.get(e)}function zs(e){return this.__data__.has(e)}var Gs=200;function qs(e,t){var o=this.__data__;if(o instanceof se){var u=o.__data__;if(!We||u.length<Gs-1)return u.push([e,t]),this.size=++o.size,this;o=this.__data__=new _e(u)}return o.set(e,t),this.size=o.size,this}function ue(e){var t=this.__data__=new se(e);this.size=t.size}ue.prototype.clear=js,ue.prototype.delete=Ws,ue.prototype.get=Fs,ue.prototype.has=zs,ue.prototype.set=qs;function Hs(e,t){return e&&Xe(t,St(t),e)}function Bs(e,t){return e&&Xe(t,Tt(t),e)}var kn=typeof E=="object"&&E&&!E.nodeType&&E,er=kn&&typeof module=="object"&&module&&!module.nodeType&&module,Vs=er&&er.exports===kn,tr=Vs?re.Buffer:void 0,nr=tr?tr.allocUnsafe:void 0;function Ys(e,t){if(t)return e.slice();var o=e.length,u=nr?nr(o):new e.constructor(o);return e.copy(u),u}function Js(e,t){for(var o=-1,u=e==null?0:e.length,f=0,d=[];++o<u;){var v=e[o];t(v,o,e)&&(d[f++]=v)}return d}function rr(){return[]}var Zs=Object.prototype,Ks=Zs.propertyIsEnumerable,or=Object.getOwnPropertySymbols,Ot=or?function(e){return e==null?[]:(e=Object(e),Js(or(e),function(t){return Ks.call(e,t)}))}:rr;function Qs(e,t){return Xe(e,Ot(e),t)}var Xs=Object.getOwnPropertySymbols,ir=Xs?function(e){for(var t=[];e;)Pn(t,Ot(e)),e=In(e);return t}:rr;function ks(e,t){return Xe(e,ir(e),t)}function ar(e,t,o){var u=t(e);return Te(e)?u:Pn(u,o(e))}function Ct(e){return ar(e,St,Ot)}function eu(e){return ar(e,Tt,ir)}var Dt=ge(re,"DataView"),xt=ge(re,"Promise"),Rt=ge(re,"Set"),sr="[object Map]",tu="[object Object]",ur="[object Promise]",cr="[object Set]",fr="[object WeakMap]",dr="[object DataView]",nu=pe(Dt),ru=pe(We),ou=pe(xt),iu=pe(Rt),au=pe(yt),we=Se;(Dt&&we(new Dt(new ArrayBuffer(1)))!=dr||We&&we(new We)!=sr||xt&&we(xt.resolve())!=ur||Rt&&we(new Rt)!=cr||yt&&we(new yt)!=fr)&&(we=function(e){var t=Se(e),o=t==tu?e.constructor:void 0,u=o?pe(o):"";if(u)switch(u){case nu:return dr;case ru:return sr;case ou:return ur;case iu:return cr;case au:return fr}return t});const Fe=we;var su=Object.prototype,uu=su.hasOwnProperty;function cu(e){var t=e.length,o=new e.constructor(t);return t&&typeof e[0]=="string"&&uu.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var fu=re.Uint8Array;const rt=fu;function $t(e){var t=new e.constructor(e.byteLength);return new rt(t).set(new rt(e)),t}function du(e,t){var o=t?$t(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var lu=/\w*$/;function hu(e){var t=new e.constructor(e.source,lu.exec(e));return t.lastIndex=e.lastIndex,t}var lr=oe?oe.prototype:void 0,hr=lr?lr.valueOf:void 0;function pu(e){return hr?Object(hr.call(e)):{}}function gu(e,t){var o=t?$t(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var vu="[object Boolean]",_u="[object Date]",wu="[object Map]",yu="[object Number]",Au="[object RegExp]",mu="[object Set]",Eu="[object String]",bu="[object Symbol]",Su="[object ArrayBuffer]",Tu="[object DataView]",Pu="[object Float32Array]",Iu="[object Float64Array]",Ou="[object Int8Array]",Cu="[object Int16Array]",Du="[object Int32Array]",xu="[object Uint8Array]",Ru="[object Uint8ClampedArray]",$u="[object Uint16Array]",Nu="[object Uint32Array]";function Lu(e,t,o){var u=e.constructor;switch(t){case Su:return $t(e);case vu:case _u:return new u(+e);case Tu:return du(e,o);case Pu:case Iu:case Ou:case Cu:case Du:case xu:case Ru:case $u:case Nu:return gu(e,o);case wu:return new u;case yu:case Eu:return new u(e);case Au:return hu(e);case mu:return new u;case bu:return pu(e)}}function Mu(e){return typeof e.constructor=="function"&&!mt(e)?Jo(In(e)):{}}var Uu="[object Map]";function ju(e){return de(e)&&Fe(e)==Uu}var pr=Pe&&Pe.isMap,Wu=pr?Et(pr):ju,Fu="[object Set]";function zu(e){return de(e)&&Fe(e)==Fu}var gr=Pe&&Pe.isSet,Gu=gr?Et(gr):zu,qu=1,Hu=2,Bu=4,vr="[object Arguments]",Vu="[object Array]",Yu="[object Boolean]",Ju="[object Date]",Zu="[object Error]",_r="[object Function]",Ku="[object GeneratorFunction]",Qu="[object Map]",Xu="[object Number]",wr="[object Object]",ku="[object RegExp]",ec="[object Set]",tc="[object String]",nc="[object Symbol]",rc="[object WeakMap]",oc="[object ArrayBuffer]",ic="[object DataView]",ac="[object Float32Array]",sc="[object Float64Array]",uc="[object Int8Array]",cc="[object Int16Array]",fc="[object Int32Array]",dc="[object Uint8Array]",lc="[object Uint8ClampedArray]",hc="[object Uint16Array]",pc="[object Uint32Array]",R={};R[vr]=R[Vu]=R[oc]=R[ic]=R[Yu]=R[Ju]=R[ac]=R[sc]=R[uc]=R[cc]=R[fc]=R[Qu]=R[Xu]=R[wr]=R[ku]=R[ec]=R[tc]=R[nc]=R[dc]=R[lc]=R[hc]=R[pc]=!0,R[Zu]=R[_r]=R[rc]=!1;function ot(e,t,o,u,f,d){var v,m=t&qu,b=t&Hu,S=t&Bu;if(o&&(v=f?o(e,u,f,d):o(e)),v!==void 0)return v;if(!Me(e))return e;var G=Te(e);if(G){if(v=cu(e),!m)return Zo(e,v)}else{var W=Fe(e),M=W==_r||W==Ku;if(ke(e))return Ys(e,m);if(W==wr||W==vr||M&&!f){if(v=b||M?{}:Mu(e),!m)return b?ks(e,Bs(v,e)):Qs(e,Hs(v,e))}else{if(!R[W])return f?e:{};v=Lu(e,W,m)}}d||(d=new ue);var K=d.get(e);if(K)return K;d.set(e,v),Gu(e)?e.forEach(function(z){v.add(ot(z,t,o,z,e,d))}):Wu(e)&&e.forEach(function(z,V){v.set(V,ot(z,t,o,V,e,d))});var C=S?b?eu:Ct:b?Tt:St,F=G?void 0:C(e);return Ko(F||e,function(z,V){F&&(V=z,z=e[V]),hn(v,V,ot(z,t,o,V,e,d))}),v}var gc=1,vc=4;function _c(e){return ot(e,gc|vc)}var wc="__lodash_hash_undefined__";function yc(e){return this.__data__.set(e,wc),this}function Ac(e){return this.__data__.has(e)}function it(e){var t=-1,o=e==null?0:e.length;for(this.__data__=new _e;++t<o;)this.add(e[t])}it.prototype.add=it.prototype.push=yc,it.prototype.has=Ac;function mc(e,t){for(var o=-1,u=e==null?0:e.length;++o<u;)if(t(e[o],o,e))return!0;return!1}function Ec(e,t){return e.has(t)}var bc=1,Sc=2;function yr(e,t,o,u,f,d){var v=o&bc,m=e.length,b=t.length;if(m!=b&&!(v&&b>m))return!1;var S=d.get(e),G=d.get(t);if(S&&G)return S==t&&G==e;var W=-1,M=!0,K=o&Sc?new it:void 0;for(d.set(e,t),d.set(t,e);++W<m;){var C=e[W],F=t[W];if(u)var z=v?u(F,C,W,t,e,d):u(C,F,W,e,t,d);if(z!==void 0){if(z)continue;M=!1;break}if(K){if(!mc(t,function(V,ie){if(!Ec(K,ie)&&(C===V||f(C,V,o,u,d)))return K.push(ie)})){M=!1;break}}else if(!(C===F||f(C,F,o,u,d))){M=!1;break}}return d.delete(e),d.delete(t),M}function Tc(e){var t=-1,o=Array(e.size);return e.forEach(function(u,f){o[++t]=[f,u]}),o}function Pc(e){var t=-1,o=Array(e.size);return e.forEach(function(u){o[++t]=u}),o}var Ic=1,Oc=2,Cc="[object Boolean]",Dc="[object Date]",xc="[object Error]",Rc="[object Map]",$c="[object Number]",Nc="[object RegExp]",Lc="[object Set]",Mc="[object String]",Uc="[object Symbol]",jc="[object ArrayBuffer]",Wc="[object DataView]",Ar=oe?oe.prototype:void 0,Nt=Ar?Ar.valueOf:void 0;function Fc(e,t,o,u,f,d,v){switch(o){case Wc:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case jc:return!(e.byteLength!=t.byteLength||!d(new rt(e),new rt(t)));case Cc:case Dc:case $c:return At(+e,+t);case xc:return e.name==t.name&&e.message==t.message;case Nc:case Mc:return e==t+"";case Rc:var m=Tc;case Lc:var b=u&Ic;if(m||(m=Pc),e.size!=t.size&&!b)return!1;var S=v.get(e);if(S)return S==t;u|=Oc,v.set(e,t);var G=yr(m(e),m(t),u,f,d,v);return v.delete(e),G;case Uc:if(Nt)return Nt.call(e)==Nt.call(t)}return!1}var zc=1,Gc=Object.prototype,qc=Gc.hasOwnProperty;function Hc(e,t,o,u,f,d){var v=o&zc,m=Ct(e),b=m.length,S=Ct(t),G=S.length;if(b!=G&&!v)return!1;for(var W=b;W--;){var M=m[W];if(!(v?M in t:qc.call(t,M)))return!1}var K=d.get(e),C=d.get(t);if(K&&C)return K==t&&C==e;var F=!0;d.set(e,t),d.set(t,e);for(var z=v;++W<b;){M=m[W];var V=e[M],ie=t[M];if(u)var lt=v?u(ie,V,M,t,e,d):u(V,ie,M,e,t,d);if(!(lt===void 0?V===ie||f(V,ie,o,u,d):lt)){F=!1;break}z||(z=M=="constructor")}if(F&&!z){var Re=e.constructor,Q=t.constructor;Re!=Q&&"constructor"in e&&"constructor"in t&&!(typeof Re=="function"&&Re instanceof Re&&typeof Q=="function"&&Q instanceof Q)&&(F=!1)}return d.delete(e),d.delete(t),F}var Bc=1,mr="[object Arguments]",Er="[object Array]",at="[object Object]",Vc=Object.prototype,br=Vc.hasOwnProperty;function Yc(e,t,o,u,f,d){var v=Te(e),m=Te(t),b=v?Er:Fe(e),S=m?Er:Fe(t);b=b==mr?at:b,S=S==mr?at:S;var G=b==at,W=S==at,M=b==S;if(M&&ke(e)){if(!ke(t))return!1;v=!0,G=!1}if(M&&!G)return d||(d=new ue),v||bn(e)?yr(e,t,o,u,f,d):Fc(e,t,b,o,u,f,d);if(!(o&Bc)){var K=G&&br.call(e,"__wrapped__"),C=W&&br.call(t,"__wrapped__");if(K||C){var F=K?e.value():e,z=C?t.value():t;return d||(d=new ue),f(F,z,o,u,d)}}return M?(d||(d=new ue),Hc(e,t,o,u,f,d)):!1}function Sr(e,t,o,u,f){return e===t?!0:e==null||t==null||!de(e)&&!de(t)?e!==e&&t!==t:Yc(e,t,o,u,Sr,f)}function Jc(e,t){return Sr(e,t)}var st=Xn(function(e,t,o){return e+(o?"_":"")+t.toLowerCase()});function Zc(e={}){return this.API.request("open",e)}function Kc(e){return this.API.request("open_external_url",e)}function Qc(){return this.API.request("get_env")}function Xc(e){return this.API.request("update_my_user",e)}function kc(){return this.API.request("get_languages")}function ef(e){return E.highLevelApi.API.request("get_events",e)}function tf(e){return E.highLevelApi.API.request("create_event",e)}function nf(e){return E.highLevelApi.API.request("update_event",e)}function rf(e){return E.highLevelApi.API.request("delete_event",e)}function of(e){return this.API.request("get_canvases",e)}function af(e){return this.API.request("create_canvas",e)}function sf(e){return this.API.request("delete_canvas",e)}function uf(e){let t=!1;return typeof window<"u"&&(t=new URLSearchParams(window.location.search).get("debug")==="true"||!!window.debug),t&&console.info("JS API UPDATE CANVAS",e),this.API.request("update_canvas",e).then(o=>(t&&console.info("JS API UPDATE CANVAS RESPONSE",o),o))}function cf(e){return this.API.request("get_canvas",e)}function ff(e){return this.API.request("share_canvas",e)}function df(e){const t={...e};return t.type&&(t.type=Array.isArray(t.type)?t.type:[t.type]),t.content_type&&(t.content_type=Array.isArray(t.content_type)?t.content_type:[t.content_type]),this.API.request("get_files",t)}function lf(e){return this.API.request("get_recent_files",e||{})}function hf(e){return this.API.request("download_file",e)}function pf(e){return this.API.request("get_app_config",e)}function gf(e){return this.API.request("get_file",e)}function vf(e){return this.API.request("update_file",e)}function _f(e){return this.API.request("delete_file",e)}function wf(e){return this.API.request("create_file",e)}function yf(){return this.API.request("select_device_file")}function Af(e){return this.API.request("search",e)}function mf(e){return this.API.request("get_users",e)}function Ef(e){return this.API.request("refresh_service_token",e)}function bf(e){return this.API.request("fetch_document_info",e)}function Sf(e){return this.API.request("render_page_as_image",e)}function Tf(e){return this.API.request("toast",e)}function Pf(e){return E.highLevelApi.API.request("query",e)}function If(e={id:"root"}){return this.API.request("get_folder",e)}function Of(e){return this.API.request("create_folder",e)}function Cf(e){return this.API.request("update_folder",e)}function Df(e){return this.API.request("delete_folder",e)}function xf(e){return this.API.request("move_folder_items",e)}function Rf(e){return this.API.request("get_favorites",e)}function $f(e){return this.API.request("create_favorite",e)}function Nf(e){return this.API.request("delete_favorite",e)}function Lf(e){return e.type||(e.type="native"),E.highLevelApi.API.request("notify",e)}function Mf(e){return E.highLevelApi.API.request("track",e)}function Uf(e){return this.API.request("get_instance_metadata_templates",e)}function jf(){return this.API.request("trigger_non_files_sync")}function Wf(e){return E.highLevelApi.API.request("submit_user_feedback",e)}function Ff(){return E.highLevelApi.API.request("close")}function zf(e){return this.API.request("open_web_view_always_on_top",e)}const Gf=Object.freeze(Object.defineProperty({__proto__:null,close:Ff,createCanvas:af,createEvent:tf,createFavorite:$f,createFile:wf,createFolder:Of,deleteCanvas:sf,deleteEvent:rf,deleteFavorite:Nf,deleteFile:_f,deleteFolder:Df,downloadFile:hf,fetchDocumentInfo:bf,getAppConfig:pf,getCanvas:cf,getCanvases:of,getEnv:Qc,getEvents:ef,getFavorites:Rf,getFile:gf,getFiles:df,getFolder:If,getInstanceMetadataTemplates:Uf,getLanguages:kc,getRecentFiles:lf,getUsers:mf,moveFolderItems:xf,notify:Lf,open:Zc,openExternalUrl:Kc,openWebViewAlwaysOnTop:zf,query:Pf,refreshServiceToken:Ef,renderPageAsImage:Sf,search:Af,selectDeviceFile:yf,shareCanvas:ff,submitUserFeedback:Wf,toast:Tf,track:Mf,triggerNonFilesSync:jf,updateCanvas:uf,updateEvent:nf,updateFile:vf,updateFolder:Cf,updateMyUser:Xc},Symbol.toStringTag,{value:"Module"}));class Tr{listeners={};on(t,o){this.listeners[t]=(this.listeners[t]??[]).concat(o)}off(t,o){this.listeners[t]=(this.listeners[t]??[]).filter(u=>u!==o)}emit(t,o){(this.listeners[t]??[]).forEach(u=>u(o))}}for(var Z=[],Lt=0;Lt<256;++Lt)Z.push((Lt+256).toString(16).slice(1));function qf(e,t=0){return(Z[e[t+0]]+Z[e[t+1]]+Z[e[t+2]]+Z[e[t+3]]+"-"+Z[e[t+4]]+Z[e[t+5]]+"-"+Z[e[t+6]]+Z[e[t+7]]+"-"+Z[e[t+8]]+Z[e[t+9]]+"-"+Z[e[t+10]]+Z[e[t+11]]+Z[e[t+12]]+Z[e[t+13]]+Z[e[t+14]]+Z[e[t+15]]).toLowerCase()}var ut,Hf=new Uint8Array(16);function Bf(){if(!ut&&(ut=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ut))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ut(Hf)}var Vf=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Pr={randomUUID:Vf};function Yf(e,t,o){if(Pr.randomUUID&&!t&&!e)return Pr.randomUUID();e=e||{};var u=e.random||(e.rng||Bf)();if(u[6]=u[6]&15|64,u[8]=u[8]&63|128,t){o=o||0;for(var f=0;f<16;++f)t[o+f]=u[f];return t}return qf(u)}const Jf="PITCHER_EVENT";var ct=(e=>(e.REQUEST="PITCHER_REQUEST",e.RESPONSE="PITCHER_RESPONSE",e))(ct||{}),ft=(e=>(e.OK="ok",e.ERROR="error",e))(ft||{}),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||{}),Or=(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))(Or||{}),Cr=(e=>(e.CREATE_AND_OPEN_CANVAS="create_and_open_canvas",e.OPEN_CANVAS="open_canvas",e.START_CALL="start_call",e))(Cr||{});class Zf extends Error{}function Kf(e,t){if(!e)throw new Zf(t)}const Dr=["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"],xr=["context","overrides","filters","metadata","style","hidden"],Rr=(e,t)=>t.includes(e)||e.endsWith("style"),ze=(e,t=Dr,o=xr)=>Array.isArray(e)?e.map(u=>ze(u,t,o)):e!=null&&e.constructor===Object?Object.keys(e).reduce((u,f)=>{const d=Rr(f,o),v=t.includes(f)||d?f:Us(f),m=d?e[f]:ze(e[f],t,o);return{...u,[v]:m}},{}):e,Mt=(e,t=Dr,o=xr)=>Array.isArray(e)?e.map(u=>Mt(u,t,o)):e!=null&&e.constructor===Object?Object.keys(e).reduce((u,f)=>{const d=Rr(f,o),v=t.includes(f)||d?f:st(f),m=d?e[f]:Mt(e[f],t,o);return{...u,[v]:m}},{}):e;function Qf(e,t=[],o=["development","test"].includes("production")){if(o)return!0;if(!e||!e.origin)return!1;const u=[...t,window.location.origin,"pitcher.com"],f=u.includes(e.origin)||u.some(d=>e.origin.endsWith(d));return f||console.warn(`The message origin ${e.origin} is not the same as the current origin ${window.location.origin}. Bailing...`),f}const Ut=5,$r=1e3;function Ge(e){const t=new URLSearchParams;for(const o in e)Array.isArray(e[o])?e[o].forEach(u=>t.append(o,u)):t.append(o,e[o]);return t.toString()}async function ye(e,t,o=Ut){try{const u=await fetch(e,t);if(!u.ok){if(u.status>=500&&u.status<600&&o>0){const v=$r*Math.pow(2,Ut-o);return await new Promise(m=>setTimeout(m,v)),ye(e,t,o-1)}const f=await u.json(),d=new Error(`HTTP error! status: ${u.status}, message: ${f.message||u.statusText}`);throw d.status=u.status,d}return u.json()}catch(u){if(o>0){const f=$r*Math.pow(2,Ut-o);return await new Promise(d=>setTimeout(d,f)),ye(e,t,o-1)}throw u}}function Xf(e,t){const o={"Content-Type":"application/json",Authorization:`Bearer ${t}`},u=e+"/api/v1",f={credentials:"include"};return{get:async(d,v={})=>{const m=new URL(`${u}${d}`);return v.params&&(m.search=Ge(v.params)),await ye(m.toString(),{...f,...v,method:"GET",headers:o})},post:async(d,v,m={})=>{const b=new URL(`${u}${d}`);return m.params&&(b.search=Ge(m.params)),await ye(b.toString(),{...f,...m,method:"POST",headers:o,body:JSON.stringify(v)})},put:async(d,v,m={})=>{const b=new URL(`${u}${d}`);return m.params&&(b.search=Ge(m.params)),await ye(b.toString(),{...f,...m,method:"PUT",headers:o,body:JSON.stringify(v)})},delete:async(d,v={})=>{const m=new URL(`${u}${d}`);return v.params&&(m.search=Ge(v.params)),await ye(m.toString(),{...f,...v,method:"DELETE",headers:o})},patch:async(d,v,m={})=>{const b=new URL(`${u}${d}`);return m.params&&(b.search=Ge(m.params)),await ye(b.toString(),{...f,...m,method:"PATCH",headers:o,body:JSON.stringify(v)})}}}let Oe,ce;const Ce=(e,...t)=>console.info(`[online handlers]: ${e}`,...t),De=()=>{if(!Oe)throw new Error("Missing env");if(!ce)throw new Error("Missing http")},kf=e=>{Oe=e,ce=Xf(Oe.pitcher.token_claims["https://pitcher.com/claims/urls"].custom_domain,Oe.pitcher.access_token)},Nr={get_canvases:async e=>{Ce("online handler get_canvases called with:",e),De();const{api_base_url:t,...o}=e;return await ce.get("/canvases",{params:{...o,instance_id:Oe.pitcher.instance.id}})},get_canvas:async e=>{Ce("online handler get_canvas called with:",e),De();const{id:t,...o}=e;return await ce.get(`/canvases/${e.id}`,{params:o})},create_canvas:async e=>(Ce("online handler create_canvas called with:",e),De(),await ce.post("/canvases",{...e,instance_id:Oe.pitcher.instance.id})),update_canvas:async e=>{Ce("online handler update_canvas called with:",e),De();const{id:t,...o}=e;return await ce.patch(`/canvases/${e.id}`,o)},delete_canvas:async e=>(Ce("online handler delete_canvas called with:",e),De(),await ce.delete(`/canvases/${e.id}`)),share_canvas:async e=>{Ce("online handler share_canvas called with:",e),De();let t;try{t=await ce.get(`/shared-links/canvas/${e.id}`)}catch(o){if(o?.status===404)t=await ce.post("/shared-links",{canvas_id:e.id});else throw o}return t}};function ed(e){e&&kf(e)}class td extends Tr{constructor(t){super(),this.callbacks={},this.options=t??{casing:"snake",logLevel:"off",errorLogger:()=>{},fetchMode:"postmessage"},typeof window<"u"&&(window.addEventListener("message",o=>{Qf(o)&&(this.options.logLevel==="debug"&&console.log("message received",o),o.data.type==="PITCHER_RESPONSE"?(Kf(o.data.request.id,"event id is required"),this.handleCallbackMessage(o.data.request.id,o.data)):o.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?ze(o.data.event):o.data.event))}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(t,o){this.callbacks[t]&&(this.callbacks[t].callback(o),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[t].dispatched_at} ms for the event ${this.callbacks[t].type}`),delete this.callbacks[t])}handleEventMessage(t){this.emit("event",t)}request(t,o=null){const u=this.options.fetchMode??"postmessage";return new Promise((f,d)=>{const v=Yf(),m=S=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${v} response:`,S),S.response.status==="ok")f(this.options.casing==="camel"?ze(S.response.body):S.response.body),t==="get_env"&&ed(S.response.body);else if(S.response.status==="error")this.options.errorLogger?.({message:`Pitcher JS API call failure: ${S.request.type}`,js_api_response:JSON.stringify(S)}),d(this.options.casing==="camel"?ze(S.response.body):S.response.body);else throw new Error("unsupported response status")},b=_c(Mt(o));this.callbacks[v]={dispatched_at:Date.now(),type:t,payload:b??{},callback:m},u==="prefer-online"&&t&&Nr[t]?Nr[t](b).then(S=>{this.callbacks[v]&&(this.callbacks[v].callback({type:ct.RESPONSE,request:{id:v,type:t},response:{status:ft.OK,body:S}}),delete this.callbacks[v])}).catch(S=>{this.callbacks[v]&&(this.callbacks[v].callback({type:ct.RESPONSE,request:{id:v,type:t},response:{status:ft.ERROR,body:S}}),delete this.callbacks[v])}):typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:t,id:v,body:b}},"*")})}}function nd(e){const t=new td(e),o=new Tr;return t.on("event",u=>{o.emit(u.type,u.body)}),{API:t,...Gf,on:(u,f)=>o.on(u,f),off:(u,f)=>o.off(u,f),enterFullscreen:()=>t.request("enter_fullscreen"),exitFullscreen:()=>t.request("exit_fullscreen"),logout:()=>t.request("logout"),quitInstance:()=>t.request("quit_instance"),getRequestTypes:()=>t.request("get_request_types"),broadcast:u=>t.request("broadcast",u),subscribe:()=>t.request("subscribe"),unsubscribe:()=>t.request("unsubscribe")}}function D(){return window.postRobot?window.postRobot:Promise.resolve().then(()=>wo).then(e=>e.default||e)}const rd="UI_MESSAGE",q={UI_BROADCAST:"ui_broadcast",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",UI_SET_POSTCALL_STYLE:"ui_set_postcall_style",UI_ENABLE_POSTCALL_SUBMIT:"ui_enable_postcall_submit",UI_DISABLE_POSTCALL_SUBMIT:"ui_disable_postcall_submit",UI_COMPLETE_POSTCALL:"ui_complete_postcall",UI_CANVAS_NAVIGATE_NEXT_PAGE:"ui_canvas_navigate_next_page",UI_CANVAS_NAVIGATE_PREVIOUS_PAGE:"ui_canvas_navigate_previous_page",UI_CANVAS_NAVIGATE_PAGE:"ui_canvas_navigate_page",UI_APP_LOADED:"ui_app_loaded",UI_APP_RESIZE:"ui_app_resize"},fe={UI_MEETING_CANCELED:"ui_meeting_canceled",UI_CANVAS_UPDATED:"ui_canvas_updated",UI_SECTION_LIST_UPDATED:"ui_section_list_updated",UI_APP_SET_DATA:"ui_app_set_data",UI_APP_UPDATE_DATA:"ui_app_update_data"},Lr=[fe.UI_APP_SET_DATA,fe.UI_APP_UPDATE_DATA,fe.UI_CANVAS_UPDATED];async function od(e={}){const t=await D();return console.warn("[content.ui.ts]: ui_select_content is deprecated and might get removed in future versions, please use select_content instead."),(await t.send(window.parent,q.UI_SELECT_CONTENT,e)).data}async function id(e={}){return(await(await D()).send(window.parent,q.UI_SELECT_CONTENT,e)).data}async function ad(e){await(await D()).send(window.parent,q.UI_OPEN,e)}async function sd(e){await(await D()).send(window.parent,q.UI_TOAST,e)}async function ud(e){return(await(await D()).send(window.parent,q.UI_PRESELECT_SFDC_MEETING_ID,e)).data}async function cd(){await(await D()).send(window.parent,q.UI_EMBEDDABLE_READY)}async function fd(e){return(await D()).send(window.top,q.UI_UPDATE_LOCATION,e)}async function dd(e){(await D()).send(window.parent,q.UI_CAPTURE_APP_ERROR,e)}async function ld(e){return(await D()).send(window.parent,q.UI_UPDATE_CANVAS,e).then(o=>o.data)}async function hd(){window.parent.postMessage({type:q.UI_APP_LOADED,body:{}},"*")}async function pd(e){window.parent.postMessage({type:q.UI_APP_RESIZE,body:e},"*")}async function gd(){(await D()).send(window.parent,q.UI_CANVAS_NAVIGATE_NEXT_PAGE)}async function vd(){(await D()).send(window.parent,q.UI_CANVAS_NAVIGATE_PREVIOUS_PAGE)}async function _d(e){(await D()).send(window.parent,q.UI_CANVAS_NAVIGATE_PAGE,e)}async function wd(e){(await D()).send(window.parent,q.UI_COMPLETE_POSTCALL,e)}async function yd(){(await D()).send(window.parent,q.UI_ENABLE_POSTCALL_SUBMIT)}async function Ad(){(await D()).send(window.parent,q.UI_DISABLE_POSTCALL_SUBMIT)}async function md(e){(await D()).send(window.parent,q.UI_SET_POSTCALL_STYLE,e)}async function Ed(e,t){console.log("attaching native handler for type",e);const o=u=>{u.data.type===e&&t(u.data.body)};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)}async function bd(e,t){return(await D()).on(e,f=>t(f.data)).cancel}function xe(e,t){return Lr.includes(e)?Ed(e,t):bd(e,t)}function Sd(e){return xe(fe.UI_MEETING_CANCELED,e)}function Td(e){return xe(fe.UI_CANVAS_UPDATED,e)}function Pd(e){return xe(fe.UI_SECTION_LIST_UPDATED,e)}function Id(e){return xe(fe.UI_APP_SET_DATA,e)}function Od(e){return xe(fe.UI_APP_UPDATE_DATA,e)}async function Cd(e){(await D()).send(window.parent,q.UI_BROADCAST,e)}const Dd=Object.freeze(Object.defineProperty({__proto__:null,app_loaded:hd,app_resize:pd,canvas_navigate_next_page:gd,canvas_navigate_page:_d,canvas_navigate_previous_page:vd,capture_app_error:dd,complete_postcall:wd,disable_postcall_submit:Ad,embeddable_ready:cd,enable_postcall_submit:yd,on:xe,on_app_set_data:Id,on_app_update_data:Od,on_canvas_updated:Td,on_meeting_canceled:Sd,on_section_list_updated:Pd,open:ad,preselect_sfdc_meeting_id:ud,select_content:id,set_postcall_style:md,toast:sd,ui_broadcast:Cd,ui_select_content:od,update_canvas:ld,update_location:fd},Symbol.toStringTag,{value:"Module"})),xd="ADMIN_MESSAGE",Rd={ENV_CHANGED:"admin_env_changed"},$d={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},Ae={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 Nd(){return(await(await D()).send(window.parent,Ae.GET_ENV)).data}async function Ld(e){return(await(await D()).send(window.parent,Ae.CREATE_CANVAS,e)).data}async function Md(e){return(await(await D()).send(window.parent,Ae.GET_CANVASES,e)).data}async function Ud(e){return(await(await D()).send(window.parent,Ae.GET_CANVAS,e)).data}async function jd(e){return(await(await D()).send(window.parent,Ae.UPDATE_CANVAS,e)).data}async function Wd(e){return(await(await D()).send(window.parent,Ae.GET_INSTANCE_METADATA_TEMPLATES,e)).data}async function Fd(e,t){return(await D()).on(e,f=>t(f.data)).cancel}const zd=Object.freeze(Object.defineProperty({__proto__:null,createCanvas:Ld,getCanvas:Ud,getCanvases:Md,getEnv:Nd,getInstanceMetadataTemplates:Wd,on:Fd,updateCanvas:jd},Symbol.toStringTag,{value:"Module"})),Gd="DSR_MESSAGE",qd={ENV_CHANGED:"dsr_env_changed"},Hd={DSR_REQUEST:"DSR_REQUEST",DSR_RESPONSE:"DSR_RESPONSE"},jt={GET_ENV:"dsr_get_env",DSR_EMBEDDABLE_READY:"dsr_embeddable_ready"};async function Bd(){return(await(await D()).send(window.parent,jt.GET_ENV)).data}async function Vd(){await(await D()).send(window.parent,jt.DSR_EMBEDDABLE_READY)}async function Yd(e,t){return(await D()).on(e,f=>t(f.data)).cancel}const Jd=Object.freeze(Object.defineProperty({__proto__:null,embeddable_ready:Vd,getEnv:Bd,on:Yd},Symbol.toStringTag,{value:"Module"}));E.highLevelApi=void 0;let Mr;function dt(e){return(!E.highLevelApi||!Jc(e,Mr))&&(E.highLevelApi=nd(e),Mr=e),E.highLevelApi}const Zd=Object.entries(Dd).reduce((e,[t,o])=>(e[t]=o,e[st(t)]=o,e),{});function Wt(){return Zd}const Kd=Object.entries(zd).reduce((e,[t,o])=>(e[t]=o,e[st(t)]=o,e),{});function Ur(){return Kd}const Qd=Object.entries(Jd).reduce((e,[t,o])=>(e[t]=o,e[st(t)]=o,e),{});function jr(){return Qd}function Xd(){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 kd(e){if(typeof window>"u")throw new Error("useApi: window is not defined");const t=window.parent.jsApiLocation;switch(t){case"ui":return{...dt(),...Wt(),ui:Wt(),impact:dt()};case"admin":return Ur();case"dsr":return jr();case"impact":return dt(e);default:throw new Error(`Unknown api for location: ${t}`)}}window.postRobot=en,E.ADMIN_API_METHOD_TYPES=Ae,E.ADMIN_API_TYPES=$d,E.ADMIN_MESSAGE=xd,E.ADMIN_MESSAGE_TYPES=Rd,E.DSR_API_METHOD_TYPES=jt,E.DSR_API_TYPES=Hd,E.DSR_MESSAGE=Gd,E.DSR_MESSAGE_TYPES=qd,E.PITCHER_EVENT=Jf,E.PitcherBroadcastedEventName=Or,E.PitcherEventName=Ir,E.PitcherExternalEventName=Cr,E.PitcherMessageType=ct,E.PitcherResponseStatus=ft,E.UI_API_METHOD_TYPES=q,E.UI_MESSAGE=rd,E.UI_MESSAGE_TYPES=fe,E.UI_NATIVE_MESSAGE_TYPES=Lr,E.getAvailableApis=Xd,E.useAdmin=Ur,E.useApi=kd,E.useDsr=jr,E.usePitcherApi=dt,E.useUi=Wt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
18
18
|
//# sourceMappingURL=js-api.umd.min.js.map
|