@notabene/javascript-sdk 1.13.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @ajunge @brunosimplicio @lluissuros @omrinuri @dw1284 @ilja.nevolin @richardcrosby @cblage_notabene @anibal9 @david1250 @marieh_mai
package/README.md CHANGED
@@ -19,13 +19,13 @@ This library is the JavaScript SDK for loading the widget on a frontend.
19
19
 
20
20
  There are two options for loading the Notabene SDK:
21
21
 
22
- ```
22
+ ```bash
23
23
  <script id="notabene" async src="https://unpkg.com/@notabene/javascript-sdk@latest/dist/es/index.js"></script>
24
24
  ```
25
25
 
26
26
  Or installing the library:
27
27
 
28
- ```
28
+ ```bash
29
29
  yarn add @notabene/javascript-sdk
30
30
  ```
31
31
 
@@ -33,50 +33,50 @@ yarn add @notabene/javascript-sdk
33
33
 
34
34
  Create a new Notabene instance:
35
35
 
36
- ```
36
+ ```js
37
37
  const notabene = new Notabene({
38
- vaspDID: 'did:ethr:0x94c38fd29ef36f5cb2f7bc771f9d5bd9f7d05f27',
39
- widget: 'https://beta-widget.notabene.id',
40
- container: '#container',
41
- authToken: '{CUSTOMER_TOKEN}',
42
- onValidStateChange: (isValid) => {
43
- // Use this value to determine if the transaction is ready to be created.
44
- console.log('is transaction valid', isValid);
45
- },
46
- onError: (err) => {
47
- // If any errors are encountered, they will be passed to this function
48
- alert(err.message)
49
- }
38
+ vaspDID: 'did:ethr:0x94c38fd29ef36f5cb2f7bc771f9d5bd9f7d05f27',
39
+ widget: 'https://beta-widget.notabene.id',
40
+ container: '#container',
41
+ authToken: '{CUSTOMER_TOKEN}',
42
+ onValidStateChange: (isValid) => {
43
+ // Use this value to determine if the transaction is ready to be created.
44
+ console.log('is transaction valid', isValid);
45
+ },
46
+ onError: (err) => {
47
+ // If any errors are encountered, they will be passed to this function
48
+ alert(err.message);
49
+ },
50
50
  });
51
51
  ```
52
52
 
53
53
  Then render the widget:
54
54
 
55
- ```
55
+ ```js
56
56
  notabene.renderWidget();
57
57
  ```
58
58
 
59
59
  To update the widget as users enter transaction details:
60
60
 
61
- ```
61
+ ```js
62
62
  notabene.setTransaction({
63
63
  transactionAsset: 'ETH',
64
64
  beneficiaryAccountNumber: '0x8d12a197cb00d4747a1fe03395095ce2a5cc6819',
65
65
  transactionAmount: '2000000000',
66
- })
66
+ });
67
67
  ```
68
68
 
69
69
  Once the widget determines the transaction is valid, it will call the `onValidStateChange` callback, to access the transaction details:
70
70
 
71
- ```
72
- const currentTransactionInfo = notabene.tx
71
+ ```js
72
+ const currentTransactionInfo = notabene.tx;
73
73
  ```
74
74
 
75
75
  ### Re-rendering
76
76
 
77
77
  If you need to close and re-render the widget, call the `destroyWidget` method like so:
78
78
 
79
- ```
79
+ ```js
80
80
  notabene.destroyWidget(); // Will remove the widget
81
81
  notabene.renderWidget(); // Will re-render the widget
82
82
  ```
@@ -106,7 +106,7 @@ For deciding which ownership proof type you want to use.
106
106
 
107
107
  **Pass the variables in the configuration**
108
108
 
109
- ```
109
+ ```js
110
110
  const notabene = new Notabene({
111
111
  vaspDID: 'did:ethr:0x94c38fd29ef36f5cb2f7bc771f9d5bd9f7d05f27',
112
112
  widget: 'https://beta-widget.notabene.id',
@@ -125,7 +125,7 @@ Pass a `theme` object when creating an instance
125
125
 
126
126
  Here you can pass configuration which will customize the styles of the widget to meet your brand needs, all values are optional.
127
127
 
128
- ```
128
+ ```js
129
129
  {
130
130
  primaryColor: '#fff',
131
131
  secondaryColor: '#fff',
@@ -148,7 +148,7 @@ Pass a `dictionary` object mapping in text in the widget to your own language, f
148
148
 
149
149
  To replace `Loading...` with `Cargando...`
150
150
 
151
- ```
151
+ ```js
152
152
  {
153
153
  'Loading...': 'Cargando...',
154
154
  }
@@ -158,15 +158,31 @@ To replace `Loading...` with `Cargando...`
158
158
 
159
159
  ---
160
160
 
161
- Finally you pass the configuration to a Notabene instance:
161
+ **Beneficiary Details**
162
+
163
+ You can require specific beneficiary fields that are not required by your jurisdiction.
164
+
165
+ Field options:
166
+
167
+ - `beneficiaryName` - Recipient Name
168
+ - `beneficiaryGeographicAddress` - Recipient Address
162
169
 
170
+ ```js
171
+ beneficiaryDetails: ['benficiaryName', 'beneficiaryGeographicAddress'];
163
172
  ```
173
+
174
+ ---
175
+
176
+ Finally you pass the configuration to a Notabene instance:
177
+
178
+ ```js
164
179
  const notabene = new Notabene({
165
180
  widget: 'https://beta-widget.notabene.id',
166
181
  container: '#container',
167
182
  authToken: '{CUSTOMER_TOKEN}'
168
183
  theme: {THEME},
169
184
  dictionary: {DICTIONARY},
185
+ beneficiaryDetails: {BENEFICIARY_DETAILS},
170
186
  });
171
187
  ```
172
188
 
package/dist/es/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&e.__esModule?e.default:e}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},r={},t={},o=n.parcelRequire31dc;null==o&&((o=function(e){if(e in r)return r[e].exports;if(e in t){var n=t[e];delete t[e];var o={id:e,exports:{}};return r[e]=o,n.call(o.exports,o,o.exports),o.exports}var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,n){t[e]=n},n.parcelRequire31dc=o),o.register("cZQrj",(function(e,n){"undefined"!=typeof self?self:e.exports,e.exports=function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)r.d(t,o,function(n){return e[n]}.bind(null,o));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return{}.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,r){r.r(n),r.d(n,"ElementNode",(function(){return i})),r.d(n,"FragmentNode",(function(){return a})),r.d(n,"TextNode",(function(){return u})),r.d(n,"ComponentNode",(function(){return c})),r.d(n,"node",(function(){return h})),r.d(n,"Fragment",(function(){return p})),r.d(n,"text",(function(){return w})),r.d(n,"dom",(function(){return _})),r.d(n,"react",(function(){return C})),r.d(n,"html",(function(){return A})),r.d(n,"preact",(function(){return R})),r.d(n,"regex",(function(){return W})),r.d(n,"NODE_TYPE",(function(){return t})),r.d(n,"Style",(function(){return j})),r.d(n,"Regex",(function(){return k})),r.d(n,"RegexText",(function(){return z})),r.d(n,"RegexWord",(function(){return F})),r.d(n,"RegexCharacters",(function(){return L})),r.d(n,"RegexGroup",(function(){return U})),r.d(n,"RegexUnion",(function(){return q}));var t={ELEMENT:"element",TEXT:"text",COMPONENT:"component",FRAGMENT:"fragment"};function o(e,n){for(var r=[],t=0;t<e.length;t++){var o=e[t].render(n);if(o)if(Array.isArray(o))for(var i=0;i<o.length;i++){var a=o[i];a&&r.push(a)}else r.push(o)}return r}var i=function(){function e(e,n,r){this.type=t.ELEMENT,this.name=void 0,this.props=void 0,this.children=void 0,this.onRender=void 0,this.name=e,this.props=n||{},this.children=r;var o=this.props.onRender;"function"==typeof o&&(this.onRender=o,delete n.onRender)}var n=e.prototype;return n.render=function(e){var n=e(this);return this.onRender&&this.onRender(n),n},n.renderChildren=function(e){return o(this.children,e)},e}(),a=function(){function e(e){this.type=t.FRAGMENT,this.children=void 0,this.children=e}return e.prototype.render=function(e){return o(this.children,e)},e}(),u=function(){function e(e){this.type=t.TEXT,this.text=void 0,this.text=e}return e.prototype.render=function(e){return e(this)},e}(),c=function(){function e(e,n,r){this.type=t.COMPONENT,this.component=void 0,this.props=void 0,this.children=void 0,this.component=e,this.props=n||{},this.children=r,this.props.children=r}var n=e.prototype;return n.renderComponent=function(e){var n,r,t=(n=this.component(this.props,this.children),1===(r=s(Array.isArray(n)?n:[n])).length?r[0]:r.length>1?new a(r):void 0);if(t)return t.render(e)},n.render=function(e){return e(this)},n.renderChildren=function(e){return o(this.children,e)},e}();function s(e){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(o)if("string"==typeof o||"number"==typeof o)n.push(new u(o.toString()));else{if("boolean"==typeof o)continue;if(Array.isArray(o))for(var i=0,a=s(o);i<a.length;i++)n.push(a[i]);else{if(!o||o.type!==t.ELEMENT&&o.type!==t.TEXT&&o.type!==t.COMPONENT)throw new TypeError("Unrecognized node type: "+typeof o);n.push(o)}}}return n}var d,f,l,h=function(e,n){for(var r=arguments.length,t=new Array(r>2?r-2:0),o=2;o<r;o++)t[o-2]=arguments[o];if(t=s(t),"string"==typeof e)return new i(e,n,t);if("function"==typeof e)return new c(e,n,t);throw new TypeError("Expected jsx element to be a string or a function")},p=function(e,n){return n};function w(){return function e(n){if(n.type===t.COMPONENT)return[].concat(n.renderComponent(e)).join("");if(n.type===t.ELEMENT)throw new Error("Text renderer does not support basic elements");if(n.type===t.TEXT)return n.text;throw new TypeError("Unhandleable node: "+n.type)}}function v(e){return null!=e}var m=((d={}).svg="http://www.w3.org/2000/svg",d),y=((f={})["xlink:href"]="http://www.w3.org/1999/xlink",f);function g(e,n){return e.createTextNode(n.text)}function E(e,n){for(var r=n.props,t=0,o=Object.keys(r);t<o.length;t++){var i=o[t],a=r[i];if(null!=a&&"el"!==i&&"innerHTML"!==i)if(i.match(/^on[A-Z][a-z]/)&&"function"==typeof a)e.addEventListener(i.slice(2).toLowerCase(),a);else if("string"==typeof a||"number"==typeof a){var u=y[i];u?e.setAttributeNS(u,i,a.toString()):e.setAttribute(i,a.toString())}else"boolean"==typeof a&&!0===a&&e.setAttribute(i,"")}"iframe"!==e.tagName.toLowerCase()||r.id||e.setAttribute("id","jsx-iframe-"+"xxxxxxxxxx".replace(/./g,(function(){return"0123456789abcdef".charAt(Math.floor(16*Math.random()))})))}var b=((l={}).iframe=function(e,n){var r=n.children[0];if(1!==n.children.length||!r||r.type!==t.ELEMENT||"html"!==r.name)throw new Error("Expected only single html element node as child of iframe element");e.addEventListener("load",(function(){var n=e.contentWindow;if(!n)throw new Error("Expected frame to have contentWindow");for(var t=n.document,o=t.documentElement;o.children&&o.children.length;)o.removeChild(o.children[0]);for(var i=r.render(_({doc:t}));i.children.length;)o.appendChild(i.children[0])}))},l.script=function(e,n){var r=n.children[0];if(1!==n.children.length||!r||r.type!==t.TEXT)throw new Error("Expected only single text node as child of script element");e.text=r.text},l.default=function(e,n,r){for(var t=0,o=n.renderChildren(r);t<o.length;t++)e.appendChild(o[t])},l);function x(e,n,r,t){if(n.props.hasOwnProperty("innerHTML")){if(n.children.length)throw new Error("Expected no children to be passed when innerHTML prop is set");var o=n.props.innerHTML;if("string"!=typeof o)throw new TypeError("innerHTML prop must be string");"script"===n.name?e.text=o:(e.innerHTML=o,function(e,n){void 0===n&&(n=window.document);for(var r=0,t=e.querySelectorAll("script");r<t.length;r++){var o=t[r],i=o.parentNode;if(i){var a=n.createElement("script");a.text=o.textContent,i.replaceChild(a,o)}}}(e,r))}else(b[n.name]||b.default)(e,n,t)}function _(e){void 0===e&&(e={});var n=e.doc,r=void 0===n?document:n;return function e(n){if(n.type===t.COMPONENT)return n.renderComponent(e);if(n.type===t.TEXT)return g(r,n);if(n.type===t.ELEMENT){var o=m[n.name.toLowerCase()];if(o)return function e(n,o){if(n.type===t.COMPONENT)return n.renderComponent((function(n){return e(n,o)}));if(n.type===t.TEXT)return g(r,n);if(n.type===t.ELEMENT){var i=(a=n,u=o,r.createElementNS(u,a.name));return E(i,n),x(i,n,r,(function(n){return e(n,o)})),i}var a,u;throw new TypeError("Unhandleable node")}(n,o);var i=(a=r,(u=n).props.el?u.props.el:a.createElement(u.name));return E(i,n),x(i,n,r,e),i}var a,u;throw new TypeError("Unhandleable node")}}function P(){return(P=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}function T(e,n){if(null==e)return{};var r,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n.indexOf(r=i[t])>=0||(o[r]=e[r]);return o}var O=["innerHTML","class"];function C(e){var n=(void 0===e?{}:e).React;if(!n)throw new Error("Must pass React library to react renderer");return function e(r){if(r.type===t.COMPONENT)return n.createElement.apply(n,[function(){return r.renderComponent(e)||null},r.props].concat(r.renderChildren(e)));if(r.type===t.ELEMENT)return n.createElement.apply(n,[r.name,(o=r.props,i=o.innerHTML,P({dangerouslySetInnerHTML:i?{__html:i}:null,className:o.class},T(o,O)))].concat(r.renderChildren(e)));var o,i;if(r.type===t.TEXT)return r.text;throw new TypeError("Unhandleable node")}}var N={br:!0};function S(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\//g,"&#x2F;")}function A(){return function e(n){if(n.type===t.COMPONENT)return[].concat(n.renderComponent(e)).join("");if(n.type===t.ELEMENT){var r=(i=n.props,(a=Object.keys(i).filter((function(e){var n=i[e];return"innerHTML"!==e&&("string"==typeof n||"number"==typeof n||!0===n)}))).length?" "+a.map((function(e){var n=i[e];if(!0===n)return""+S(e);if("string"!=typeof n&&"number"!=typeof n)throw new TypeError("Unexpected prop type: "+typeof n);return""===n?S(e):S(e)+'="'+S(n.toString())+'"'})).join(" "):"");if(N[n.name])return"<"+n.name+r+" />";var o="string"==typeof n.props.innerHTML?n.props.innerHTML:n.renderChildren(e).join("");return"<"+n.name+r+">"+o+"</"+n.name+">"}var i,a;if(n.type===t.TEXT)return S(n.text);throw new TypeError("Unhandleable node: "+n.type)}}var D=["innerHTML"];function R(e){var n=(void 0===e?{}:e).Preact;if(!n)throw new Error("Must pass Preact library to react renderer");return function e(r){if(r.type===t.COMPONENT)return n.h.apply(n,[function(){return r.renderComponent(e)||null},r.props].concat(r.renderChildren(e)));if(r.type===t.ELEMENT)return n.h.apply(n,[r.name,(o=r.props,i=o.innerHTML,P({dangerouslySetInnerHTML:i?{__html:i}:null},T(o,D)))].concat(r.renderChildren(e)));var o,i;if(r.type===t.TEXT)return r.text;throw new TypeError("Unhandleable node")}}function W(){var e=w();return function(n){return new RegExp(e(n))}}function j(e){var n=e.css,r=e.nonce,t=e.children;return h(p,null,h("style",{innerHTML:"string"==typeof n?n:n._getCss(),nonce:r}),t)}W.node=function(e,n){for(var r=arguments.length,t=new Array(r>2?r-2:0),o=2;o<r;o++)t[o-2]=arguments[o];var i=h.apply(void 0,[e,n].concat(t));return e.renderer?i.render(e.renderer()):i};var M=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")},I=function(e,n){return(n=function(e,n){if(!n)throw new Error("Must pass children to "+e);return n}(e,n)).map((function(e){return e.type===t.TEXT?new u(M(e.text)):e}))};function k(e,n){var r=e.exact,t=void 0===r||r;return n=I("RegexGroup",n),t?["^"].concat(n,["$"]):n}function z(e,n){return I("RegexText",n)}function F(e,n){return function(e,n){if(n&&n.length)throw new Error("Must not pass children to RegexWord")}(0,n),"\\w+"}function L(e,n){return["["].concat(I("RegexText",n),["]"])}function U(e,n){var r=e.repeat,t=e.repeatMin,o=e.repeatMax,i=e.name,a=e.optional,c=void 0!==a&&a,s=e.capture,d=void 0===s||s,f=e.union,l=void 0!==f&&f;if(n=I("RegexGroup",n),v(r)&&(v(t)||v(o)))throw new Error("repeat can not be used with repeatMin or repeatMax");if(i&&!d)throw new Error("Named groups must be captured");if(l){for(var h=[],p=0,w=n;p<w.length;p++)h.push(w[p]),h.push(new u("|"));h.pop(),n=h}var m=[];return m.push(d?"(":"(?:"),i&&m.push("?<"+M(i)+">"),m.push.apply(m,n),m.push(")"),v(r)&&("number"==typeof r?m.push("{"+r+"}"):!0===r&&m.push("+")),(v(t)||v(o))&&m.push("{"+(t||"")+","+(o||"")+"}"),c&&m.push("?"),m}function q(e,n){for(var r=[],t=0,o=n=I("RegexGroup",n);t<o.length;t++)r.push(o[t]),r.push("|");return r.pop(),r}k.renderer=W}])})),o.register("cBfIu",(function(e,n){var r=o("8BAlD").Buffer;"undefined"!=typeof self?self:e.exports,e.exports=function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)r.d(t,o,function(n){return e[n]}.bind(null,o));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return{}.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,t){function o(e,n){return(o=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function i(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,o(e,n)}function a(){return(a=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}function u(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&"function"==typeof window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&"function"==typeof window.constructor&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var r=n.call(e);if("[object Window]"===r||"[object global]"===r||"[object DOMWindow]"===r)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}t.r(n),t.d(n,"PopupOpenError",(function(){return Fe})),t.d(n,"create",(function(){return kr})),t.d(n,"destroy",(function(){return Lr})),t.d(n,"destroyComponents",(function(){return zr})),t.d(n,"destroyAll",(function(){return Fr})),t.d(n,"PROP_TYPE",(function(){return wr})),t.d(n,"PROP_SERIALIZATION",(function(){return vr})),t.d(n,"CONTEXT",(function(){return mr})),t.d(n,"EVENT",(function(){return yr}));var c,s=[],d=[],f=0;function l(){if(!f&&c){var e=c;c=null,e.resolve()}}function h(){f+=1}function p(){f-=1,l()}var w=function(){function e(e){var n=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=[],e){var r,t,o=!1,i=!1,a=!1;h();try{e((function(e){a?n.resolve(e):(o=!0,r=e)}),(function(e){a?n.reject(e):(i=!0,t=e)}))}catch(e){return p(),void this.reject(e)}p(),a=!0,o?this.resolve(r):i&&this.reject(t)}}var n=e.prototype;return n.resolve=function(e){if(this.resolved||this.rejected)return this;if(u(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},n.reject=function(e){var n=this;if(this.resolved||this.rejected)return this;if(u(e))throw new Error("Can not reject promise with another promise");if(!e){var r=e&&"function"==typeof e.toString?e.toString():{}.toString.call(e);e=new Error("Expected reject to be called with Error, got "+r)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout((function(){n.errorHandled||function(e,n){if(-1===s.indexOf(e)){s.push(e),setTimeout((function(){throw e}),1);for(var r=0;r<d.length;r++)d[r](e,n)}}(e,n)}),1),this.dispatch(),this},n.asyncReject=function(e){return this.errorHandled=!0,this.reject(e),this},n.dispatch=function(){var n=this.resolved,r=this.rejected,t=this.handlers;if(!this.dispatching&&(n||r)){this.dispatching=!0,h();for(var o=function(e,n){return e.then((function(e){n.resolve(e)}),(function(e){n.reject(e)}))},i=0;i<t.length;i++){var a=t[i],c=a.onSuccess,s=a.onError,d=a.promise,f=void 0;if(n)try{f=c?c(this.value):this.value}catch(e){d.reject(e);continue}else if(r){if(!s){d.reject(this.error);continue}try{f=s(this.error)}catch(e){d.reject(e);continue}}if(f instanceof e&&(f.resolved||f.rejected)){var l=f;l.resolved?d.resolve(l.value):d.reject(l.error),l.errorHandled=!0}else u(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?d.resolve(f.value):d.reject(f.error):o(f,d):d.resolve(f)}t.length=0,this.dispatching=!1,p()}},n.then=function(n,r){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for success handler");if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for error handler");var t=new e;return this.handlers.push({promise:t,onSuccess:n,onError:r}),this.errorHandled=!0,this.dispatch(),t},n.catch=function(e){return this.then(void 0,e)},n.finally=function(n){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.finally expected a function");return this.then((function(r){return e.try(n).then((function(){return r}))}),(function(r){return e.try(n).then((function(){throw r}))}))},n.timeout=function(e,n){var r=this;if(this.resolved||this.rejected)return this;var t=setTimeout((function(){r.resolved||r.rejected||r.reject(n||new Error("Promise timed out after "+e+"ms"))}),e);return this.then((function(e){return clearTimeout(t),e}))},n.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(n){return n instanceof e?n:u(n)?new e((function(e,r){return n.then(e,r)})):(new e).resolve(n)},e.reject=function(n){return(new e).reject(n)},e.asyncReject=function(n){return(new e).asyncReject(n)},e.all=function(n){var r=new e,t=n.length,o=[].slice();if(!t)return r.resolve(o),r;for(var i=function(e,n,i){return n.then((function(n){o[e]=n,0==(t-=1)&&r.resolve(o)}),(function(e){i.reject(e)}))},a=0;a<n.length;a++){var c=n[a];if(c instanceof e){if(c.resolved){o[a]=c.value,t-=1;continue}}else if(!u(c)){o[a]=c,t-=1;continue}i(a,e.resolve(c),r)}return 0===t&&r.resolve(o),r},e.hash=function(n){var r={},t=[],o=function(e){if(n.hasOwnProperty(e)){var o=n[e];u(o)?t.push(o.then((function(n){r[e]=n}))):r[e]=o}};for(var i in n)o(i);return e.all(t).then((function(){return r}))},e.map=function(n,r){return e.all(n.map(r))},e.onPossiblyUnhandledException=function(e){return n=e,d.push(n),{cancel:function(){d.splice(d.indexOf(n),1)}};var n},e.try=function(n,r,t){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.try expected a function");var o;h();try{o=n.apply(r,t||[])}catch(n){return p(),e.reject(n)}return p(),e.resolve(o)},e.delay=function(n){return new e((function(e){setTimeout(e,n)}))},e.isPromise=function(n){return!!(n&&n instanceof e)||u(n)},e.flush=function(){return n=e,r=c=c||new n,l(),r;var n,r},e}();function v(e){return"[object RegExp]"==={}.toString.call(e)}var m={IFRAME:"iframe",POPUP:"popup"},y="Call was rejected by callee.\r\n";function g(e){return void 0===e&&(e=window),e.location.protocol}function E(e){if(void 0===e&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return g(e)}function b(e){return void 0===e&&(e=window),"about:"===E(e)}function x(e){if(void 0===e&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function _(e){if(void 0===e&&(e=window),e&&!x(e))try{return e.opener}catch(e){}}function P(e){try{return!0}catch(e){}return!1}function T(e){void 0===e&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var r=g(e);if(!r)throw new Error("Can not read window protocol");if("file:"===r)return"file://";if("about:"===r){var t=x(e);return t&&P()?T(t):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return r+"//"+o}function O(e){void 0===e&&(e=window);var n=T(e);return n&&e.mockDomain&&0===e.mockDomain.indexOf("mock:")?e.mockDomain:n}function C(e){if(!function(e){try{if(e===window)return!0}catch(e){}try{var n=Object.getOwnPropertyDescriptor(e,"location");if(n&&!1===n.enumerable)return!1}catch(e){}try{if(b(e)&&P())return!0}catch(e){}try{if(void 0===(r=e)&&(r=window),"mock:"===E(r)&&P())return!0}catch(e){}var r;try{if(T(e)===T(window))return!0}catch(e){}return!1}(e))return!1;try{if(e===window)return!0;if(b(e)&&P())return!0;if(O(window)===O(e))return!0}catch(e){}return!1}function N(e){if(!C(e))throw new Error("Expected window to be same domain");return e}function S(e,n){if(!e||!n)return!1;var r=x(n);return r?r===e:-1!==function(e){var n=[];try{for(;e.parent!==e;)n.push(e.parent),e=e.parent}catch(e){}return n}(n).indexOf(e)}function A(e){var n,r,t=[];try{n=e.frames}catch(r){n=e}try{r=n.length}catch(e){}if(0===r)return t;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=n[o]}catch(e){continue}t.push(i)}return t}for(var a=0;a<100;a++){var u=void 0;try{u=n[a]}catch(e){return t}if(!u)return t;t.push(u)}return t}function D(e){for(var n=[],r=0,t=A(e);r<t.length;r++){var o=t[r];n.push(o);for(var i=0,a=D(o);i<a.length;i++)n.push(a[i])}return n}function R(e){void 0===e&&(e=window);try{if(e.top)return e.top}catch(e){}if(x(e)===e)return e;try{if(S(window,e)&&window.top)return window.top}catch(e){}try{if(S(e,window)&&window.top)return window.top}catch(e){}for(var n=0,r=D(e);n<r.length;n++){var t=r[n];try{if(t.top)return t.top}catch(e){}if(x(t)===t)return t}}function W(e){var n=R(e);if(!n)throw new Error("Can not determine top window");var r=[].concat(D(n),[n]);return-1===r.indexOf(e)&&(r=[].concat(r,[e],D(e))),r}var j=[],M=[];function I(e,n){void 0===n&&(n=!0);try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==y}if(n&&C(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var r=function(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}(j,e);if(-1!==r){var t=M[r];if(t&&function(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var n=e.ownerDocument;if(n&&n.documentElement&&!n.documentElement.contains(e)){for(var r=e;r.parentNode&&r.parentNode!==r;)r=r.parentNode;if(!r.host||!n.documentElement.contains(r.host))return!0}return!1}(t))return!0}return!1}function k(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent}function z(e,n){for(var r=A(e),t=0;t<r.length;t++){var o=r[t];try{if(C(o)&&o.name===n&&-1!==r.indexOf(o))return o}catch(e){}}try{if(-1!==r.indexOf(e.frames[n]))return e.frames[n]}catch(e){}try{if(-1!==r.indexOf(e[n]))return e[n]}catch(e){}}function F(e,n){return e===_(n)}function L(e){return void 0===e&&(e=window),_(e=e||window)||x(e)||void 0}function U(e,n){for(var r=0;r<e.length;r++)for(var t=e[r],o=0;o<n.length;o++)if(t===n[o])return!0;return!1}function q(e){void 0===e&&(e=window);for(var n=0,r=e;r;)(r=x(r))&&(n+=1);return n}function B(e,n){var r=R(e)||e,t=R(n)||n;try{if(r&&t)return r===t}catch(e){}var o=W(e),i=W(n);if(U(o,i))return!0;var a=_(r),u=_(t);return a&&U(W(a),i)||u&&U(W(u),o),!1}function H(e,n){if("string"==typeof e){if("string"==typeof n)return"*"===e||n===e;if(v(n))return!1;if(Array.isArray(n))return!1}return v(e)?v(n)?e.toString()===n.toString():!Array.isArray(n)&&Boolean(n.match(e)):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!v(n)&&e.some((function(e){return H(e,n)})))}function J(e){return e.match(/^(https?|mock|file):\/\//)?e.split("/").slice(0,3).join("/"):O()}function V(e,n,r,t){var o;return void 0===r&&(r=1e3),void 0===t&&(t=1/0),function i(){if(I(e))return o&&clearTimeout(o),n();t<=0?clearTimeout(o):(t-=r,o=setTimeout(i,r))}(),{cancel:function(){o&&clearTimeout(o)}}}function Y(e){try{if(e===window)return!0}catch(e){if(e&&e.message===y)return!0}try{if("[object Window]"==={}.toString.call(e))return!0}catch(e){if(e&&e.message===y)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===y)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===y)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===y)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===y)return!0}try{if(e&&"__unlikely_value__"===e.__cross_domain_utils_window_check__)return!1}catch(e){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(e){}return!1}function G(e){if(0!==J(e).indexOf("mock:"))return e;throw new Error("Mock urls not supported out of test mode")}function X(e){if(C(e))return N(e).frameElement;for(var n=0,r=document.querySelectorAll("iframe");n<r.length;n++){var t=r[n];if(t&&t.contentWindow&&t.contentWindow===e)return t}}function $(e){if(void 0===(r=e)&&(r=window),Boolean(x(r))){var n=X(e);if(n&&n.parentElement)return void n.parentElement.removeChild(n)}var r;try{e.close()}catch(e){}}function Z(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}var Q,K=function(){function e(){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("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var e=new WeakMap,n={};return Object.freeze(n),e.set(n,"__testvalue__"),"__testvalue__"===e.get(n)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var e=this.weakmap,n=this.keys,r=0;r<n.length;r++){var t=n[r];if(Y(t)&&I(t)){if(e)try{e.delete(t)}catch(e){}n.splice(r,1),this.values.splice(r,1),r-=1}}},n.isSafeToReadWrite=function(e){return!Y(e)},n.set=function(e,n){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.set(e,n)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e))try{var t=this.name,o=e[t];return void(o&&o[0]===e?o[1]=n:Object.defineProperty(e,t,{value:[e,n],writable:!0}))}catch(e){}this._cleanupClosedWindows();var i=this.keys,a=this.values,u=Z(i,e);-1===u?(i.push(e),a.push(n)):a[u]=n},n.get=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return n.get(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e))try{var r=e[this.name];return r&&r[0]===e?r[1]:void 0}catch(e){}this._cleanupClosedWindows();var t=Z(this.keys,e);if(-1!==t)return this.values[t]},n.delete=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e))try{var r=e[this.name];r&&r[0]===e&&(r[0]=r[1]=void 0)}catch(e){}this._cleanupClosedWindows();var t=this.keys,o=Z(t,e);-1!==o&&(t.splice(o,1),this.values.splice(o,1))},n.has=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return!0}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e))try{var r=e[this.name];return!(!r||r[0]!==e)}catch(e){}return this._cleanupClosedWindows(),-1!==Z(this.keys,e)},n.getOrSet=function(e,n){if(this.has(e))return this.get(e);var r=n();return this.set(e,r),r},e}();function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ne(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function re(e,n,r){return(re=ne()?Reflect.construct:function(e,n,r){var t=[null];t.push.apply(t,n);var i=new(Function.bind.apply(e,t));return r&&o(i,r.prototype),i}).apply(null,arguments)}function te(e){var n="function"==typeof Map?new Map:void 0;return(te=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return re(e,arguments,ee(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)})(e)}function oe(e){return e.name||e.__name__||e.displayName||"anonymous"}function ie(e,n){try{delete e.name,e.name=n}catch(e){}return e.__name__=e.displayName=n,e}function ae(e){if("function"==typeof btoa)return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,n){return String.fromCharCode(parseInt(n,16))}))).replace(/[=]/g,"");if(void 0!==r)return r.from(e,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}function ue(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,(function(){return e.charAt(Math.floor(Math.random()*e.length))}))+"_"+ae((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function ce(e){try{return JSON.stringify([].slice.call(e),(function(e,n){return"function"==typeof n?"memoize["+function(e){if(Q=Q||new K,null==e||"object"!=typeof e&&"function"!=typeof e)throw new Error("Invalid object");var n=Q.get(e);return n||(n=typeof e+":"+ue(),Q.set(e,n)),n}(n)+"]":n}))}catch(e){throw new Error("Arguments not serializable -- can not be used to memoize")}}function se(){return{}}var de=0,fe=0;function le(e,n){void 0===n&&(n={});var r,t,o=n.thisNamespace,i=void 0!==o&&o,a=n.time,u=de;de+=1;var c=function(){for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];var s;u<fe&&(r=null,t=null,u=de,de+=1),s=i?(t=t||new K).getOrSet(this,se):r=r||{};var d=ce(o),f=s[d];if(f&&a&&Date.now()-f.time<a&&(delete s[d],f=null),f)return f.value;var l=Date.now(),h=e.apply(this,arguments);return s[d]={time:l,value:h},h};return c.reset=function(){r=null,t=null},ie(c,(n.name||oe(e))+"::memoized")}function he(e){var n={};function r(){for(var r=arguments,t=this,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var u=ce(i);return n.hasOwnProperty(u)||(n[u]=w.try((function(){return e.apply(t,r)})).finally((function(){delete n[u]}))),n[u]}return r.reset=function(){n={}},ie(r,oe(e)+"::promiseMemoized")}function pe(){}function we(e){var n=!1;return ie((function(){if(!n)return n=!0,e.apply(this,arguments)}),oe(e)+"::once")}function ve(e,n){if(void 0===n&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if("string"==typeof e)return e;if(e instanceof Error){var r=e&&e.stack,t=e&&e.message;if(r&&t)return-1!==r.indexOf(t)?r:t+"\n"+r;if(r)return r;if(t)return t}return e&&e.toString&&"function"==typeof e.toString?e.toString():{}.toString.call(e)}catch(e){return"Error while stringifying error: "+ve(e,n+1)}}function me(e){return"string"==typeof e?e:e&&e.toString&&"function"==typeof e.toString?e.toString():{}.toString.call(e)}function ye(e,n){if(!n)return e;if(Object.assign)return Object.assign(e,n);for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r]);return e}function ge(e){return e}function Ee(e,n){var r;return function t(){r=setTimeout((function(){e(),t()}),n)}(),{cancel:function(){clearTimeout(r)}}}function be(e){return[].slice.call(e)}function xe(e){return null!=e}function _e(e){return"[object RegExp]"==={}.toString.call(e)}function Pe(e,n,r){if(e.hasOwnProperty(n))return e[n];var t=r();return e[n]=t,t}function Te(e){var n,r=[],t=!1,o={set:function(n,r){return t||(e[n]=r,o.register((function(){delete e[n]}))),r},register:function(e){var o=we((function(){return e(n)}));return t?e(n):r.push(o),{cancel:function(){var e=r.indexOf(o);-1!==e&&r.splice(e,1)}}},all:function(e){n=e;var o=[];for(t=!0;r.length;){var i=r.shift();o.push(i())}return w.all(o).then(pe)}};return o}function Oe(e,n){if(null==n)throw new Error("Expected "+e+" to be present");return n}le.clear=function(){fe=de},le((function(e){if(Object.values)return Object.values(e);var n=[];for(var r in e)e.hasOwnProperty(r)&&n.push(e[r]);return n}));var Ce=function(e){function n(n){var r;return(r=e.call(this,n)||this).name=r.constructor.name,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r),r.constructor):r.stack=new Error(n).stack,r}return i(n,e),n}(te(Error));function Ne(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function Se(){return Boolean(document.body)&&"complete"===document.readyState}function Ae(){return Boolean(document.body)&&"interactive"===document.readyState}function De(e){return encodeURIComponent(e)}function Re(e){return function(n,r,t){void 0===t&&(t=[]);var o=n.__inline_memoize_cache__=n.__inline_memoize_cache__||{},i=ce(t);return o.hasOwnProperty(i)?o[i]:o[i]=function(){var n={};if(!e)return n;if(-1===e.indexOf("="))return n;for(var r=0,t=e.split("&");r<t.length;r++){var o=t[r];(o=o.split("="))[0]&&o[1]&&(n[decodeURIComponent(o[0])]=decodeURIComponent(o[1]))}return n}.apply(void 0,t)}(Re,0,[e])}function We(e,n){return void 0===n&&(n={}),n&&Object.keys(n).length?(void 0===(r=a({},Re(e),n))&&(r={}),Object.keys(r).filter((function(e){return"string"==typeof r[e]||"boolean"==typeof r[e]})).map((function(e){var n=r[e];if("string"!=typeof n&&"boolean"!=typeof n)throw new TypeError("Invalid type for query");return De(e)+"="+De(n.toString())})).join("&")):e;var r}function je(e,n){e.appendChild(n)}function Me(e){return e instanceof window.Element||null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument}function Ie(e,n){return void 0===n&&(n=document),Me(e)?e:"string"==typeof e?n.querySelector(e):void 0}function ke(e){return new w((function(n,r){var t=me(e),o=Ie(e);if(o)return n(o);if(Se())return r(new Error("Document is ready and element "+t+" does not exist"));var i=setInterval((function(){if(o=Ie(e))n(o),clearInterval(i);else if(Se())return clearInterval(i),r(new Error("Document is ready and element "+t+" does not exist"))}),10)}))}le((function(){return new w((function(e){if(Se()||Ae())return e();var n=setInterval((function(){if(Se()||Ae())return clearInterval(n),e()}),10)}))}));var ze,Fe=function(e){function n(){return e.apply(this,arguments)||this}return i(n,e),n}(Ce);function Le(e){if((ze=ze||new K).has(e)){var n=ze.get(e);if(n)return n}var r=new w((function(n,r){e.addEventListener("load",(function(){!function(e){if(function(){for(var e=0;e<j.length;e++){var n=!1;try{n=j[e].closed}catch(e){}n&&(M.splice(e,1),j.splice(e,1))}}(),e&&e.contentWindow)try{j.push(e.contentWindow),M.push(e)}catch(e){}}(e),n(e)})),e.addEventListener("error",(function(t){e.contentWindow?n(e):r(t)}))}));return ze.set(e,r),r}function Ue(e){return Le(e).then((function(e){if(!e.contentWindow)throw new Error("Could not find window in iframe");return e.contentWindow}))}function qe(e,n){void 0===e&&(e={});var r=e.style||{},t=function(e,n,r){void 0===e&&(e="div"),void 0===n&&(n={}),e=e.toLowerCase();var t,o,i,a=document.createElement(e);if(n.style&&ye(a.style,n.style),n.class&&(a.className=n.class.join(" ")),n.id&&a.setAttribute("id",n.id),n.attributes)for(var u=0,c=Object.keys(n.attributes);u<c.length;u++){var s=c[u];a.setAttribute(s,n.attributes[s])}if(n.styleSheet&&(t=a,o=n.styleSheet,void 0===i&&(i=window.document),t.styleSheet?t.styleSheet.cssText=o:t.appendChild(i.createTextNode(o))),n.html){if("iframe"===e)throw new Error("Iframe html can not be written unless container provided and iframe in DOM");a.innerHTML=n.html}return a}("iframe",{attributes:a({allowTransparency:"true"},e.attributes||{}),style:a({backgroundColor:"transparent",border:"none"},r),html:e.html,class:e.class}),o=window.navigator.userAgent.match(/MSIE|Edge/i);return t.hasAttribute("id")||t.setAttribute("id",ue()),Le(t),n&&function(e,n){void 0===n&&(n=document);var r=Ie(e,n);if(r)return r;throw new Error("Can not find element: "+me(e))}(n).appendChild(t),(e.url||o)&&t.setAttribute("src",e.url||"about:blank"),t}function Be(e,n,r){return e.addEventListener(n,r),{cancel:function(){e.removeEventListener(n,r)}}}function He(e){e.style.setProperty("display","")}function Je(e){e.style.setProperty("display","none","important")}function Ve(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ye(e){return!(e&&e.parentNode&&e.ownerDocument&&e.ownerDocument.documentElement&&e.ownerDocument.documentElement.contains(e))}function Ge(e,n,r){var t=void 0===r?{}:r,o=t.width,i=void 0===o||o,a=t.height,u=void 0===a||a,c=t.interval,s=void 0===c?100:c,d=t.win,f=void 0===d?window:d,l=e.offsetWidth,h=e.offsetHeight,p=!1;n({width:l,height:h});var w,v,m=function(){if(!p&&(o=e,Boolean(o.offsetWidth||o.offsetHeight||o.getClientRects().length))){var r=e.offsetWidth,t=e.offsetHeight;(i&&r!==l||u&&t!==h)&&n({width:r,height:t}),l=r,h=t}var o};return f.addEventListener("resize",m),void 0!==f.ResizeObserver?((w=new f.ResizeObserver(m)).observe(e),v=Ee(m,10*s)):void 0!==f.MutationObserver?((w=new f.MutationObserver(m)).observe(e,{attributes:!0,childList:!0,subtree:!0,characterData:!1}),v=Ee(m,10*s)):v=Ee(m,s),{cancel:function(){p=!0,w.disconnect(),window.removeEventListener("resize",m),v.cancel()}}}function Xe(e){for(;e.parentNode;)e=e.parentNode;return"[object ShadowRoot]"===e.toString()}var $e="undefined"!=typeof document?document.currentScript:null,Ze=le((function(){if($e)return $e;if($e=function(){try{var e=function(){try{throw new Error("_")}catch(e){return e.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),r=n&&n[1];if(!r)return;for(var t=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();t<o.length;t++){var i=o[t];if(i.src&&i.src===r)return i}}catch(e){}}())return $e;throw new Error("Can not determine current script")})),Qe=ue();function Ke(e){return"string"==typeof e&&/^[0-9]+%$/.test(e)}function en(e){if("number"==typeof e)return e;var n=e.match(/^([0-9]+)(px|%)$/);if(!n)throw new Error("Could not match css value from "+e);return parseInt(n[1],10)}function nn(e){return en(e)+"px"}function rn(e){return"number"==typeof e?nn(e):Ke(e)?e:nn(e)}function tn(e,n){if("number"==typeof e)return e;if(Ke(e))return parseInt(n*en(e)/100,10);if("string"==typeof(r=e)&&/^[0-9]+px$/.test(r))return en(e);var r;throw new Error("Can not normalize dimension: "+e)}function on(e){void 0===e&&(e=window);var n="__post_robot_10_0_44__";return e!==window?e[n]:e[n]=e[n]||{}}le((function(){var e;try{e=Ze()}catch(e){return Qe}var n=e.getAttribute("data-uid");if(n&&"string"==typeof n)return n;if((n=e.getAttribute("data-uid-auto"))&&"string"==typeof n)return n;if(e.src){var r=function(e){for(var n="",r=0;r<e.length;r++){var t=e[r].charCodeAt(0)*r;e[r+1]&&(t+=e[r+1].charCodeAt(0)*(r-1)),n+=String.fromCharCode(97+Math.abs(t)%26)}return n}(JSON.stringify({src:e.src,dataset:e.dataset}));n="uid_"+r.slice(r.length-30)}else n=ue();return e.setAttribute("data-uid-auto",n),n}));var an=function(){return{}};function un(e,n){return void 0===e&&(e="store"),void 0===n&&(n=an),Pe(on(),e,(function(){var e=n();return{has:function(n){return e.hasOwnProperty(n)},get:function(n,r){return e.hasOwnProperty(n)?e[n]:r},set:function(n,r){return e[n]=r,r},del:function(n){delete e[n]},getOrSet:function(n,r){return Pe(e,n,r)},reset:function(){e=n()},keys:function(){return Object.keys(e)}}}))}var cn,sn=function(){};function dn(){var e=on();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new sn,e.WINDOW_WILDCARD}function fn(e,n){return void 0===e&&(e="store"),void 0===n&&(n=an),un("windowStore").getOrSet(e,(function(){var r=new K,t=function(e){return r.getOrSet(e,n)};return{has:function(n){return t(n).hasOwnProperty(e)},get:function(n,r){var o=t(n);return o.hasOwnProperty(e)?o[e]:r},set:function(n,r){return t(n)[e]=r,r},del:function(n){delete t(n)[e]},getOrSet:function(n,r){return Pe(t(n),e,r)}}}))}function ln(){return un("instance").getOrSet("instanceID",ue)}function hn(e,n){var r=n.domain,t=fn("helloPromises"),o=t.get(e);o&&o.resolve({domain:r});var i=w.resolve({domain:r});return t.set(e,i),i}function pn(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:ln()},{domain:"*",timeout:-1}).then((function(n){var r=n.origin,t=n.data.instanceID;return hn(e,{domain:r}),{win:e,domain:r,instanceID:t}}))}function wn(e,n){var r=n.send;return fn("windowInstanceIDPromises").getOrSet(e,(function(){return pn(e,{send:r}).then((function(e){return e.instanceID}))}))}function vn(e,n,r){void 0===n&&(n=5e3),void 0===r&&(r="Window");var t,o=(t=e,fn("helloPromises").getOrSet(t,(function(){return new w})));return-1!==n&&(o=o.timeout(n,new Error(r+" did not load after "+n+"ms"))),o}function mn(e){fn("knownWindows").set(e,!0)}function yn(e){return"object"==typeof e&&null!==e&&"string"==typeof e.__type__}function gn(e){return void 0===e?"undefined":null===e?"null":Array.isArray(e)?"array":"function"==typeof e?"function":"object"==typeof e?e instanceof Error?"error":"function"==typeof e.then?"promise":"[object RegExp]"==={}.toString.call(e)?"regex":"[object Date]"==={}.toString.call(e)?"date":"object":"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":void 0}function En(e,n){return{__type__:e,__val__:n}}var bn,xn=((cn={}).function=function(){},cn.error=function(e){return En("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},cn.promise=function(){},cn.regex=function(e){return En("regex",e.source)},cn.date=function(e){return En("date",e.toJSON())},cn.array=function(e){return e},cn.object=function(e){return e},cn.string=function(e){return e},cn.number=function(e){return e},cn.boolean=function(e){return e},cn.null=function(e){return e},cn[void 0]=function(e){return En("undefined",e)},cn),_n={},Pn=((bn={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},bn.error=function(e){var n=e.stack,r=e.code,t=e.data,o=new Error(e.message);return o.code=r,t&&(o.data=t),o.stack=n+"\n\n"+o.stack,o},bn.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},bn.regex=function(e){return new RegExp(e)},bn.date=function(e){return new Date(e)},bn.array=function(e){return e},bn.object=function(e){return e},bn.string=function(e){return e},bn.number=function(e){return e},bn.boolean=function(e){return e},bn.null=function(e){return e},bn[void 0]=function(){},bn),Tn={};function On(){return!!k(window).match(/MSIE|trident|edge\/12|edge\/13/i)}function Cn(e){return!B(window,e)}function Nn(e,n){if(e){if(O()!==J(e))return!0}else if(n&&!C(n))return!0;return!1}function Sn(e){var n=e.win,r=e.domain;return!(!On()||r&&!Nn(r,n)||n&&!Cn(n))}function An(e){return"__postrobot_bridge___"+(e=e||J(e)).replace(/[^a-zA-Z0-9]+/g,"_")}function Dn(){return Boolean(window.name&&window.name===An(O()))}var Rn=new w((function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval((function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)}),10)}));function Wn(e){fn("remoteWindowPromises").getOrSet(e,(function(){return new w}))}function jn(e){var n=fn("remoteWindowPromises").get(e);if(!n)throw new Error("Remote window promise not found");return n}function Mn(e,n,r){jn(e).resolve((function(t,o,i){if(t!==e)throw new Error("Remote window does not match window");if(!H(o,n))throw new Error("Remote domain "+o+" does not match domain "+n);r.fireAndForget(i)}))}function In(e,n){jn(e).reject(n).catch(pe)}function kn(e){for(var n=e.win,r=e.name,t=e.domain,o=un("popupWindowsByName"),i=fn("popupWindowsByWin"),a=0,u=o.keys();a<u.length;a++){var c=u[a],s=o.get(c);s&&!I(s.win)||o.del(c)}if(I(n))return{win:n,name:r,domain:t};var d=i.getOrSet(n,(function(){return r?o.getOrSet(r,(function(){return{win:n,name:r}})):{win:n}}));if(d.win&&d.win!==n)throw new Error("Different window already linked for window: "+(r||"undefined"));return r&&(d.name=r,o.set(r,d)),t&&(d.domain=t,Wn(n)),i.set(n,d),d}function zn(e){var n,r,t,o,i,a,u=e.on,c=e.send,s=e.receiveMessage;n=window.open,window.open=function(e,r,t,o){var i=n.call(this,G(e),r,t,o);return i?(kn({win:i,name:r,domain:e?J(e):null}),i):i},t=(r={on:u,send:c,receiveMessage:s}).on,o=r.send,i=r.receiveMessage,a=un("popupWindowsByName"),t("postrobot_open_tunnel",(function(e){var n=e.source,r=e.origin,u=e.data,c=un("bridges").get(r);if(!c)throw new Error("Can not find bridge promise for domain "+r);return c.then((function(e){if(n!==e)throw new Error("Message source does not matched registered bridge for domain "+r);if(!u.name)throw new Error("Register window expected to be passed window name");if(!u.sendMessage)throw new Error("Register window expected to be passed sendMessage method");if(!a.has(u.name))throw new Error("Window with name "+u.name+" does not exist, or was not opened by this window");var c=function(){return a.get(u.name)};if(!c().domain)throw new Error("We do not have a registered domain for window "+u.name);if(c().domain!==r)throw new Error("Message origin "+r+" does not matched registered window origin "+(c().domain||"unknown"));return Mn(c().win,r,u.sendMessage),{sendMessage:function(e){if(window&&!window.closed&&c()){var n=c().domain;if(n)try{i({data:e,origin:n,source:c().win},{on:t,send:o})}catch(e){w.reject(e)}}}}}))})),function(e){var n=e.send;on(window).openTunnelToParent=function(e){var r=e.name,t=e.source,o=e.canary,i=e.sendMessage,a=un("tunnelWindows"),u=x(window);if(!u)throw new Error("No parent window found to open tunnel to");var c=function(e){var n=e.name,r=e.source,t=e.canary,o=e.sendMessage;!function(){for(var e=un("tunnelWindows"),n=0,r=e.keys();n<r.length;n++){var t=r[n];I(e[t].source)&&e.del(t)}}();var i=ue();return un("tunnelWindows").set(i,{name:n,source:r,canary:t,sendMessage:o}),i}({name:r,source:t,canary:o,sendMessage:i});return n(u,"postrobot_open_tunnel",{name:r,sendMessage:function(){var e=a.get(c);if(e&&e.source&&!I(e.source)){try{e.canary()}catch(e){return}e.sendMessage.apply(this,arguments)}}},{domain:"*"})}}({send:c}),function(e){var n=e.on,r=e.send,t=e.receiveMessage;w.try((function(){var e,o=_(window);if(o&&Sn({win:o}))return Wn(o),(e=o,fn("remoteBridgeAwaiters").getOrSet(e,(function(){return w.try((function(){var n=z(e,An(O()));if(n)return C(n)&&on(N(n))?n:new w((function(e){var r,t;r=setInterval((function(){if(n&&C(n)&&on(N(n)))return clearInterval(r),clearTimeout(t),e(n)}),100),t=setTimeout((function(){return clearInterval(r),e()}),2e3)}))}))}))).then((function(e){return e?window.name?on(N(e)).openTunnelToParent({name:window.name,source:window,canary:function(){},sendMessage:function(e){if(window&&!window.closed)try{t({data:e,origin:this.origin,source:this.source},{on:n,send:r})}catch(e){w.reject(e)}}}).then((function(e){var n=e.source,r=e.origin,t=e.data;if(n!==o)throw new Error("Source does not match opener");Mn(n,r,t.sendMessage)})).catch((function(e){throw In(o,e),e})):In(o,new Error("Can not register with opener: window does not have a name")):In(o,new Error("Can not register with opener: no bridge found in opener"))}))}))}({on:u,send:c,receiveMessage:s})}function Fn(){for(var e=un("idToProxyWindow"),n=0,r=e.keys();n<r.length;n++){var t=r[n];e.get(t).shouldClean()&&e.del(t)}}function Ln(e,n){var r=n.send,t=n.id,o=void 0===t?ue():t,i=e.then((function(e){if(C(e))return N(e).name})),a=e.then((function(e){if(I(e))throw new Error("Window is closed, can not determine type");return _(e)?m.POPUP:m.IFRAME}));i.catch(pe),a.catch(pe);var u=function(){return e.then((function(e){if(!I(e))return C(e)?N(e).name:i}))};return{id:o,getType:function(){return a},getInstanceID:he((function(){return e.then((function(e){return wn(e,{send:r})}))})),close:function(){return e.then($)},getName:u,focus:function(){return e.then((function(e){e.focus()}))},isClosed:function(){return e.then((function(e){return I(e)}))},setLocation:function(n,r){return void 0===r&&(r={}),e.then((function(e){var t=window.location.protocol+"//"+window.location.host,o=r.method,i=void 0===o?"get":o,a=r.body;if(0===n.indexOf("/"))n=""+t+n;else if(!n.match(/^https?:\/\//)&&0!==n.indexOf(t))throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(n));if("post"===i)return u().then((function(e){if(!e)throw new Error("Can not post to window without target name");!function(e){var n=e.url,r=e.target,t=e.body,o=e.method,i=void 0===o?"post":o,a=document.createElement("form");if(a.setAttribute("target",r),a.setAttribute("method",i),a.setAttribute("action",n),a.style.display="none",t)for(var u=0,c=Object.keys(t);u<c.length;u++){var s,d=c[u],f=document.createElement("input");f.setAttribute("name",d),f.setAttribute("value",null==(s=t[d])?void 0:s.toString()),a.appendChild(f)}Ne().appendChild(a),a.submit(),Ne().removeChild(a)}({url:n,target:e,method:i,body:a})}));if("get"!==i)throw new Error("Unsupported method: "+i);if(C(e))try{if(e.location&&"function"==typeof e.location.replace)return void e.location.replace(n)}catch(e){}e.location=n}))},setName:function(n){return e.then((function(e){kn({win:e,name:n});var r=C(e),t=X(e);if(!r)throw new Error("Can not set name for cross-domain window: "+n);N(e).name=n,t&&t.setAttribute("name",n),i=w.resolve(n)}))}}}var Un=function(){function e(e){var n=e.send,r=e.win,t=e.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 w,this.serializedWindow=t||Ln(this.actualWindowPromise,{send:n}),un("idToProxyWindow").set(this.getID(),this),r&&this.setWindow(r,{send:n})}var n=e.prototype;return n.getID=function(){return this.serializedWindow.id},n.getType=function(){return this.serializedWindow.getType()},n.isPopup=function(){return this.getType().then((function(e){return e===m.POPUP}))},n.setLocation=function(e,n){var r=this;return this.serializedWindow.setLocation(e,n).then((function(){return r}))},n.getName=function(){return this.serializedWindow.getName()},n.setName=function(e){var n=this;return this.serializedWindow.setName(e).then((function(){return n}))},n.close=function(){var e=this;return this.serializedWindow.close().then((function(){return e}))},n.focus=function(){var e=this,n=this.isPopup(),r=this.getName(),t=w.hash({isPopup:n,name:r}).then((function(e){var n=e.name;e.isPopup&&n&&window.open("",n)})),o=this.serializedWindow.focus();return w.all([t,o]).then((function(){return e}))},n.isClosed=function(){return this.serializedWindow.isClosed()},n.getWindow=function(){return this.actualWindow},n.setWindow=function(e,n){var r=n.send;this.actualWindow=e,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=Ln(this.actualWindowPromise,{send:r,id:this.getID()}),fn("winToProxyWindow").set(e,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(e,n){var r=this,t=n.send;return w.try((function(){return r.actualWindow?e===r.actualWindow:w.hash({proxyInstanceID:r.getInstanceID(),knownWindowInstanceID:wn(e,{send:t})}).then((function(n){var o=n.proxyInstanceID===n.knownWindowInstanceID;return o&&r.setWindow(e,{send:t}),o}))}))},n.unwrap=function(){return this.actualWindow||this},n.getInstanceID=function(){return this.serializedWindow.getInstanceID()},n.shouldClean=function(){return Boolean(this.actualWindow&&I(this.actualWindow))},n.serialize=function(){return this.serializedWindow},e.unwrap=function(n){return e.isProxyWindow(n)?n.unwrap():n},e.serialize=function(n,r){var t=r.send;return Fn(),e.toProxyWindow(n,{send:t}).serialize()},e.deserialize=function(n,r){var t=r.send;return Fn(),un("idToProxyWindow").get(n.id)||new e({serializedWindow:n,send:t})},e.isProxyWindow=function(e){return Boolean(e&&!Y(e)&&e.isProxyWindow)},e.toProxyWindow=function(n,r){var t=r.send;if(Fn(),e.isProxyWindow(n))return n;var o=n;return fn("winToProxyWindow").get(o)||new e({win:o,send:t})},e}();function qn(e,n,r,t,o){var i=fn("methodStore"),a=un("proxyWindowMethods");Un.isProxyWindow(t)?a.set(e,{val:n,name:r,domain:o,source:t}):(a.del(e),i.getOrSet(t,(function(){return{}}))[e]={domain:o,name:r,val:n,source:t})}function Bn(e,n){var r=fn("methodStore"),t=un("proxyWindowMethods");return r.getOrSet(e,(function(){return{}}))[n]||t.get(n)}function Hn(e,n,r,t,o){var i,a,u;a=(i={on:o.on,send:o.send}).on,u=i.send,un("builtinListeners").getOrSet("functionCalls",(function(){return a("postrobot_method",{domain:"*"},(function(e){var n=e.source,r=e.origin,t=e.data,o=t.id,i=t.name,a=Bn(n,o);if(!a)throw new Error("Could not find method '"+i+"' with id: "+t.id+" in "+O(window));var c=a.source,s=a.domain,d=a.val;return w.try((function(){if(!H(s,r))throw new Error("Method '"+t.name+"' domain "+JSON.stringify(_e(a.domain)?a.domain.source:a.domain)+" does not match origin "+r+" in "+O(window));if(Un.isProxyWindow(c))return c.matchWindow(n,{send:u}).then((function(e){if(!e)throw new Error("Method call '"+t.name+"' failed - proxy window does not match source in "+O(window))}))})).then((function(){return d.apply({source:n,origin:r},t.args)}),(function(e){return w.try((function(){if(d.onError)return d.onError(e)})).then((function(){var n;throw e.stack&&(e.stack="Remote call to "+i+"("+(void 0===(n=t.args)&&(n=[]),be(n).map((function(e){return"string"==typeof e?"'"+e+"'":void 0===e?"undefined":null===e?"null":"boolean"==typeof e?e.toString():Array.isArray(e)?"[ ... ]":"object"==typeof e?"{ ... }":"function"==typeof e?"() => { ... }":"<"+typeof e+">"})).join(", ")+") failed\n\n")+e.stack),e}))})).then((function(e){return{result:e,id:o,name:i}}))}))}));var c=r.__id__||ue();e=Un.unwrap(e);var s=r.__name__||r.name||t;return"string"==typeof s&&"function"==typeof s.indexOf&&0===s.indexOf("anonymous::")&&(s=s.replace("anonymous::",t+"::")),Un.isProxyWindow(e)?(qn(c,r,s,e,n),e.awaitWindow().then((function(e){qn(c,r,s,e,n)}))):qn(c,r,s,e,n),En("cross_domain_function",{id:c,name:s})}function Jn(e,n,r,t){var o,i=t.on,a=t.send;return function(e,n){void 0===n&&(n=_n);var r=JSON.stringify(e,(function(e){var r=this[e];if(yn(this))return r;var t=gn(r);if(!t)return r;var o=n[t]||xn[t];return o?o(r,e):r}));return void 0===r?"undefined":r}(r,((o={}).promise=function(r,t){return o=r,En("cross_domain_zalgo_promise",{then:Hn(e,n,(function(e,n){return o.then(e,n)}),t,{on:(u={on:i,send:a}).on,send:u.send})});var o,u},o.function=function(r,t){return Hn(e,n,r,t,{on:i,send:a})},o.object=function(e){return Y(e)||Un.isProxyWindow(e)?En("cross_domain_window",Un.serialize(e,{send:a})):e},o))}function Vn(e,n,r,t){var o,i=t.send;return function(e,n){if(void 0===n&&(n=Tn),"undefined"!==e)return JSON.parse(e,(function(e,r){if(yn(this))return r;var t,o;if(yn(r)?(t=r.__type__,o=r.__val__):(t=gn(r),o=r),!t)return o;var i=n[t]||Pn[t];return i?i(o,e):o}))}(r,((o={}).cross_domain_zalgo_promise=function(e){return new w(e.then)},o.cross_domain_function=function(r){return t=e,o=n,u={send:i},c=(a=r).id,s=a.name,d=u.send,f=function(e){function n(){var r=arguments;return Un.toProxyWindow(t,{send:d}).awaitWindow().then((function(t){var i=Bn(t,c);if(i&&i.val!==n)return i.val.apply({source:window,origin:O()},r);var a=[].slice.call(r);return e.fireAndForget?d(t,"postrobot_method",{id:c,name:s,args:a},{domain:o,fireAndForget:!0}):d(t,"postrobot_method",{id:c,name:s,args:a},{domain:o,fireAndForget:!1}).then((function(e){return e.data.result}))})).catch((function(e){throw e}))}return void 0===e&&(e={}),n.__name__=s,n.__origin__=o,n.__source__=t,n.__id__=c,n.origin=o,n},(l=f()).fireAndForget=f({fireAndForget:!0}),l;var t,o,a,u,c,s,d,f,l},o.cross_domain_window=function(e){return Un.deserialize(e,{send:i})},o))}var Yn={};function Gn(e,n,r,t){var o=t.on,i=t.send;return w.try((function(){var t=fn().getOrSet(e,(function(){return{}}));return t.buffer=t.buffer||[],t.buffer.push(r),t.flush=t.flush||w.flush().then((function(){if(I(e))throw new Error("Window is closed");var r,a=Jn(e,n,((r={}).__post_robot_10_0_44__=t.buffer||[],r),{on:o,send:i});delete t.buffer;for(var u=Object.keys(Yn),c=[],s=0;s<u.length;s++){var d=u[s];try{Yn[d](e,a,n)}catch(e){c.push(e)}}if(c.length===u.length)throw new Error("All post-robot messaging strategies failed:\n\n"+c.map((function(e,n){return n+". "+ve(e)})).join("\n\n"))})),t.flush.then((function(){delete t.flush}))})).then(pe)}function Xn(e){return un("responseListeners").get(e)}function $n(e){un("responseListeners").del(e)}function Zn(e){return un("erroredResponseListeners").has(e)}function Qn(e){var n=e.name,r=e.win,t=e.domain,o=fn("requestListeners");if("*"===r&&(r=null),"*"===t&&(t=null),!n)throw new Error("Name required to get request listener");for(var i=0,a=[r,dn()];i<a.length;i++){var u=a[i];if(u){var c=o.get(u);if(c){var s=c[n];if(s){if(t&&"string"==typeof t){if(s[t])return s[t];if(s.__domain_regex__)for(var d=0,f=s.__domain_regex__;d<f.length;d++){var l=f[d],h=l.listener;if(H(l.regex,t))return h}}if(s["*"])return s["*"]}}}}}function Kn(e,n,r,t){var o=t.on,i=t.send,a=Qn({name:r.name,win:e,domain:n}),u="postrobot_method"===r.name&&r.data&&"string"==typeof r.data.name?r.data.name+"()":r.name;function c(t,a,c){return w.flush().then((function(){if(!r.fireAndForget&&!I(e))try{return Gn(e,n,{id:ue(),origin:O(window),type:"postrobot_message_response",hash:r.hash,name:r.name,ack:t,data:a,error:c},{on:o,send:i})}catch(e){throw new Error("Send response message failed for "+u+" in "+O()+"\n\n"+ve(e))}}))}return w.all([w.flush().then((function(){if(!r.fireAndForget&&!I(e))try{return Gn(e,n,{id:ue(),origin:O(window),type:"postrobot_message_ack",hash:r.hash,name:r.name},{on:o,send:i})}catch(e){throw new Error("Send ack message failed for "+u+" in "+O()+"\n\n"+ve(e))}})),w.try((function(){if(!a)throw new Error("No handler found for post message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!H(a.domain,n))throw new Error("Request origin "+n+" does not match domain "+a.domain.toString());return a.handler({source:e,origin:n,data:r.data})})).then((function(e){return c("success",e)}),(function(e){return c("error",null,e)}))]).then(pe).catch((function(e){if(a&&a.handleError)return a.handleError(e);throw e}))}function er(e,n,r){if(!Zn(r.hash)){var t=Xn(r.hash);if(!t)throw new Error("No handler found for post message ack for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!H(t.domain,n))throw new Error("Ack origin "+n+" does not match domain "+t.domain.toString());if(e!==t.win)throw new Error("Ack source does not match registered window")}catch(e){t.promise.reject(e)}t.ack=!0}}function nr(e,n,r){if(!Zn(r.hash)){var t,o=Xn(r.hash);if(!o)throw new Error("No handler found for post message response for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!H(o.domain,n))throw new Error("Response origin "+n+" does not match domain "+(t=o.domain,Array.isArray(t)?"("+t.join(" | ")+")":v(t)?"RegExp("+t.toString()+")":t.toString()));if(e!==o.win)throw new Error("Response source does not match registered window");$n(r.hash),"error"===r.ack?o.promise.reject(r.error):"success"===r.ack&&o.promise.resolve({source:e,origin:n,data:r.data})}}function rr(e,n){var r=n.on,t=n.send,o=un("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(e){return}var i=e.source,a=e.origin,u=function(e,n,r,t){var o,i=t.on,a=t.send;try{o=Vn(n,r,e,{on:i,send:a})}catch(e){return}if(o&&"object"==typeof o&&null!==o){var u=o.__post_robot_10_0_44__;if(Array.isArray(u))return u}}(e.data,i,a,{on:r,send:t});if(u){mn(i);for(var c=0;c<u.length;c++){var s=u[c];if(o.has(s.id))return;if(o.set(s.id,!0),I(i)&&!s.fireAndForget)return;0===s.origin.indexOf("file:")&&(a="file://");try{"postrobot_message_request"===s.type?Kn(i,a,s,{on:r,send:t}):"postrobot_message_response"===s.type?nr(i,a,s):"postrobot_message_ack"===s.type&&er(i,a,s)}catch(e){setTimeout((function(){throw e}),0)}}}}function tr(e,n,r){if(!e)throw new Error("Expected name");if("function"==typeof(n=n||{})&&(r=n,n={}),!r)throw new Error("Expected handler");(n=n||{}).name=e,n.handler=r||n.handler;var t=n.window,o=n.domain,i=function e(n,r){var t=n.name,o=n.win,i=n.domain,a=fn("requestListeners");if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var u=[],c=0,s=o;c<s.length;c++)u.push(e({name:t,domain:i,win:s[c]},r));return{cancel:function(){for(var e=0;e<u.length;e++)u[e].cancel()}}}if(Array.isArray(i)){for(var d=[],f=0,l=i;f<l.length;f++)d.push(e({name:t,win:o,domain:l[f]},r));return{cancel:function(){for(var e=0;e<d.length;e++)d[e].cancel()}}}var h=Qn({name:t,win:o,domain:i});if(o&&"*"!==o||(o=dn()),i=i||"*",h)throw o&&i?new Error("Request listener already exists for "+t+" on domain "+i.toString()+" for "+(o===dn()?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+t+" for "+(o===dn()?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" on domain "+i.toString()):new Error("Request listener already exists for "+t);var p,w,v=a.getOrSet(o,(function(){return{}})),m=Pe(v,t,(function(){return{}})),y=i.toString();return _e(i)?(p=Pe(m,"__domain_regex__",(function(){return[]}))).push(w={regex:i,listener:r}):m[y]=r,{cancel:function(){delete m[y],w&&(p.splice(p.indexOf(w,1)),p.length||delete m.__domain_regex__),Object.keys(m).length||delete v[t],o&&!Object.keys(v).length&&a.del(o)}}}({name:e,win:t,domain:o},{handler:n.handler,handleError:n.errorHandler||function(e){throw e},window:t,domain:o||"*",name:e});return{cancel:function(){i.cancel()}}}Yn.postrobot_post_message=function(e,n,r){0===r.indexOf("file:")&&(r="*"),e.postMessage(n,r)},Yn.postrobot_bridge=function(e,n,r){if(!On()&&!Dn())throw new Error("Bridge not needed for browser");if(C(e))throw new Error("Post message through bridge disabled between same domain windows");if(!1!==B(window,e))throw new Error("Can only use bridge to communicate between two different windows, not between frames");!function(e,n,r){var t=F(window,e),o=F(e,window);if(!t&&!o)throw new Error("Can only send messages to and from parent and popup windows");jn(e).then((function(t){return t(e,n,r)}))}(e,r,n)},Yn.postrobot_global=function(e,n){if(!k(window).match(/MSIE|rv:11|trident|edge\/12|edge\/13/i))throw new Error("Global messaging not needed for browser");if(!C(e))throw new Error("Post message through global disabled between different domain windows");if(!1!==B(window,e))throw new Error("Can only use global to communicate between two different windows, not between frames");var r=on(e);if(!r)throw new Error("Can not find postRobot global on foreign window");r.receiveMessage({source:window,origin:O(),data:n})};var or,ir=function e(n,r,t,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,u=o.timeout||5e3,c=o.fireAndForget||!1;return w.try((function(){if(function(e,n,r){if(!e)throw new Error("Expected name");if(r&&"string"!=typeof r&&!Array.isArray(r)&&!_e(r))throw new TypeError("Can not send "+e+". Expected domain "+JSON.stringify(r)+" to be a string, array, or regex");if(I(n))throw new Error("Can not send "+e+". Target window is closed")}(r,n,i),function(e,n){var r=L(n);if(r)return r===e;if(n===e)return!1;if(R(n)===n)return!1;for(var t=0,o=A(e);t<o.length;t++)if(o[t]===n)return!0;return!1}(window,n))return vn(n,u)})).then((function(r){return t=n,o=i,a=(void 0===r?{}:r).domain,u={send:e}.send,w.try((function(){return"string"==typeof o?o:w.try((function(){return a||pn(t,{send:u}).then((function(e){return e.domain}))})).then((function(e){if(!H(o,o))throw new Error("Domain "+me(o)+" does not match "+me(o));return e}))}));var t,o,a,u})).then((function(o){var i,u,s,d=o,f="postrobot_method"===r&&t&&"string"==typeof t.name?t.name+"()":r,l=new w,h=r+"_"+ue();if(!c){var p={name:r,win:n,domain:d,promise:l};u=h,s=p,un("responseListeners").set(u,s);var v=fn("requestPromises").getOrSet(n,(function(){return[]}));v.push(l),l.catch((function(){!function(e){un("erroredResponseListeners").set(e,!0)}(h),$n(h)}));var m=(i=n,fn("knownWindows").get(i,!1)?1e4:2e3),y=a,g=m,E=y,b=Ee((function(){return I(n)?l.reject(new Error("Window closed for "+r+" before "+(p.ack?"response":"ack"))):p.cancelled?l.reject(new Error("Response listener was cancelled for "+r)):(g=Math.max(g-500,0),-1!==E&&(E=Math.max(E-500,0)),p.ack||0!==g?0===E?l.reject(new Error("No response for postMessage "+f+" in "+O()+" in "+y+"ms")):void 0:l.reject(new Error("No ack for postMessage "+f+" in "+O()+" in "+m+"ms")))}),500);l.finally((function(){b.cancel(),v.splice(v.indexOf(l,1))})).catch(pe)}return Gn(n,d,{id:ue(),origin:O(window),type:"postrobot_message_request",hash:h,name:r,data:t,fireAndForget:c},{on:tr,send:e}).then((function(){return c?l.resolve():l}),(function(e){throw new Error("Send request message failed for "+f+" in "+O()+"\n\n"+ve(e))}))}))};function ar(e){return Un.toProxyWindow(e,{send:ir})}function ur(e){for(var n=0,r=fn("requestPromises").get(e,[]);n<r.length;n++)r[n].reject(new Error("Window "+(I(e)?"closed":"cleaned up")+" before response")).catch(pe)}function cr(e){if(!C(e))throw new Error("Can not get global for window on different domain");return e.__zoid_9_0_86__||(e.__zoid_9_0_86__={}),e.__zoid_9_0_86__}function sr(e,n){try{return n(cr(e))}catch(e){}}function dr(e){return{get:function(){var n=this;return w.try((function(){if(n.source&&n.source!==window)throw new Error("Can not call get on proxy object from a remote window");return e}))}}}function fr(e){return ae(JSON.stringify(e))}function lr(e){var n=cr(e);return n.references=n.references||{},n.references}function hr(e){var n,r,t=e.data,o=e.metaData,i=e.sender,a=e.receiver,u=e.passByReference,c=void 0!==u&&u,s=e.basic,d=void 0!==s&&s,f=ar(a.win),l=d?JSON.stringify(t):Jn(f,a.domain,t,{on:tr,send:ir}),h=c?(n=l,r=ue(),lr(window)[r]=n,{type:"uid",uid:r}):{type:"raw",val:l};return{serializedData:fr({sender:{domain:i.domain},metaData:o,reference:h}),cleanReference:function(){var e,n;e=window,"uid"===(n=h).type&&delete lr(e)[n.uid]}}}function pr(e){var n,t,o,i=e.sender,a=e.basic,u=void 0!==a&&a,c=(n=e.data,JSON.parse(function(e){if("function"==typeof atob)return decodeURIComponent([].map.call(atob(e),(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));if(void 0!==r)return r.from(e,"base64").toString("utf8");throw new Error("Can not find window.atob or Buffer")}(n))),s=c.reference,d=c.metaData;t="function"==typeof i.win?i.win({metaData:d}):i.win,o="function"==typeof i.domain?i.domain({metaData:d}):"string"==typeof i.domain?i.domain:c.sender.domain;var f,l,h,p=function(e,n){if("raw"===n.type)return n.val;if("uid"===n.type)return lr(e)[n.uid];throw new Error("Unsupported ref type: "+n.type)}(t,s);return{data:u?JSON.parse(p):(f=t,l=o,h=p,Vn(f,l,h,{on:tr,send:ir})),metaData:d,sender:{win:t,domain:o},reference:s}}or={setupBridge:zn,openBridge:function(e,n){var r=un("bridges"),t=un("bridgeFrames");return n=n||J(e),r.getOrSet(n,(function(){return w.try((function(){if(O()===n)throw new Error("Can not open bridge on the same domain as current domain: "+n);var r=An(n);if(z(window,r))throw new Error("Frame with name "+r+" already exists on page");var o,i,a,u=(o=r,i=e,(a=document.createElement("iframe")).setAttribute("name",o),a.setAttribute("id",o),a.setAttribute("style","display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"),a.setAttribute("frameborder","0"),a.setAttribute("border","0"),a.setAttribute("scrolling","no"),a.setAttribute("allowTransparency","true"),a.setAttribute("tabindex","-1"),a.setAttribute("hidden","true"),a.setAttribute("title",""),a.setAttribute("role","presentation"),a.src=i,a);return t.set(n,u),Rn.then((function(n){n.appendChild(u);var r=u.contentWindow;return new w((function(e,n){u.addEventListener("load",e),u.addEventListener("error",n)})).then((function(){return vn(r,5e3,"Bridge "+e)})).then((function(){return r}))}))}))}))},linkWindow:kn,linkUrl:function(e,n){kn({win:e,domain:J(n)})},isBridge:Dn,needsBridge:Sn,needsBridgeForBrowser:On,hasBridge:function(e,n){return un("bridges").has(n||J(e))},needsBridgeForWin:Cn,needsBridgeForDomain:Nn,destroyBridges:function(){for(var e=un("bridges"),n=un("bridgeFrames"),r=0,t=n.keys();r<t.length;r++){var o=n.get(t[r]);o&&o.parentNode&&o.parentNode.removeChild(o)}n.reset(),e.reset()}};var wr={STRING:"string",OBJECT:"object",FUNCTION:"function",BOOLEAN:"boolean",NUMBER:"number",ARRAY:"array"},vr={JSON:"json",DOTIFY:"dotify",BASE64:"base64"},mr=m,yr={RENDER:"zoid-render",RENDERED:"zoid-rendered",DISPLAY:"zoid-display",ERROR:"zoid-error",CLOSE:"zoid-close",DESTROY:"zoid-destroy",PROPS:"zoid-props",RESIZE:"zoid-resize",FOCUS:"zoid-focus"};function gr(e){return"__zoid__"+e.name+"__"+e.serializedPayload+"__"}function Er(e){if(!e)throw new Error("No window name");var n=e.split("__"),r=n[1],t=n[2],o=n[3];if("zoid"!==r)throw new Error("Window not rendered by zoid - got "+r);if(!t)throw new Error("Expected component name");if(!o)throw new Error("Expected serialized payload ref");return{name:t,serializedInitialPayload:o}}var br=le((function(e){var n=pr({data:Er(e).serializedInitialPayload,sender:{win:function(e){return function(e){if("opener"===e.type)return Oe("opener",_(window));if("parent"===e.type&&"number"==typeof e.distance)return Oe("parent",(n=window,void 0===(r=e.distance)&&(r=1),function(e,n){void 0===n&&(n=1);for(var r=e,t=0;t<n;t++){if(!r)return;r=x(r)}return r}(n,q(n)-r)));var n,r,t,o;if("global"===e.type&&e.uid&&"string"==typeof e.uid){var i=function(){var n=e.uid,r=L(window);if(!r)throw new Error("Can not find ancestor window");for(var t=0,o=W(r);t<o.length;t++){var i=o[t];if(C(i)){var a=sr(i,(function(e){return e.windows&&e.windows[n]}));if(a)return{v:a}}}}();if("object"==typeof i)return i.v}else if("name"===e.type){var a=e.name;return Oe("namedWindow",z(t=Oe("ancestor",L(window)),o=a)||function e(n,r){var t=z(n,r);if(t)return t;for(var o=0,i=A(n);o<i.length;o++){var a=e(i[o],r);if(a)return a}}(R(t)||t,o))}throw new Error("Unable to find "+e.type+" parent component window")}(e.metaData.windowRef)}}});return{parent:n.sender,payload:n.data,reference:n.reference}}));function xr(){return br(window.name)}function _r(e,n){if(void 0===n&&(n=window),e===x(n))return{type:"parent",distance:q(e)};if(e===_(n))return{type:"opener"};if(C(e)&&(t=e)!==R(t)){var r=N(e).name;if(r)return{type:"name",name:r}}var t}function Pr(e,n,r,t,o){if(!e.hasOwnProperty(r))return t;var i=e[r];return"function"==typeof i.childDecorate?i.childDecorate({value:t,uid:o.uid,tag:o.tag,close:o.close,focus:o.focus,onError:o.onError,onProps:o.onProps,resize:o.resize,getParent:o.getParent,getParentDomain:o.getParentDomain,show:o.show,hide:o.hide,export:o.export,getSiblings:o.getSiblings}):t}function Tr(){return w.try((function(){window.focus()}))}function Or(){return w.try((function(){window.close()}))}var Cr=function(){return pe},Nr=function(e){return we(e.value)};function Sr(e,n,r){for(var t=0,o=Object.keys(a({},e,n));t<o.length;t++){var i=o[t];r(i,n[i],e[i])}}function Ar(e,n,r){var t,o,i,a={};return w.all((t=n,o=e,i=[],Sr(t,o,(function(e,n,t){var o,u,c,s=(o=e,u=n,c=t,w.resolve().then((function(){var e,n;if(null!=c&&u){var t=(e={},e.get=u.queryParam,e.post=u.bodyParam,e)[r],i=(n={},n.get=u.queryValue,n.post=u.bodyValue,n)[r];if(t)return w.hash({finalParam:w.try((function(){return"function"==typeof t?t({value:c}):"string"==typeof t?t:o})),finalValue:w.try((function(){return"function"==typeof i&&xe(c)?i({value:c}):c}))}).then((function(e){var n,r=e.finalParam,t=e.finalValue;if("boolean"==typeof t)n=t.toString();else if("string"==typeof t)n=t.toString();else if("object"==typeof t&&null!==t){if(u.serialization===vr.JSON)n=JSON.stringify(t);else if(u.serialization===vr.BASE64)n=ae(JSON.stringify(t));else if(u.serialization===vr.DOTIFY||!u.serialization){n=function e(n,r,t){for(var o in void 0===r&&(r=""),void 0===t&&(t={}),r=r?r+".":r,n)n.hasOwnProperty(o)&&null!=n[o]&&"function"!=typeof n[o]&&(n[o]&&Array.isArray(n[o])&&n[o].length&&n[o].every((function(e){return"object"!=typeof e}))?t[""+r+o+"[]"]=n[o].join(","):n[o]&&"object"==typeof n[o]?t=e(n[o],""+r+o,t):t[""+r+o]=n[o].toString());return t}(t,o);for(var i=0,c=Object.keys(n);i<c.length;i++){var s=c[i];a[s]=n[s]}return}}else"number"==typeof t&&(n=t.toString());a[r]=n}))}})));i.push(s)})),i)).then((function(){return a}))}function Dr(e){var n,r,t,o,i,u,c,s,d=e.uid,f=e.options,l=e.overrides,h=void 0===l?{}:l,p=e.parentWin,v=void 0===p?window:p,m=f.propsDef,y=f.containerTemplate,g=f.prerenderTemplate,E=f.tag,b=f.name,x=f.attributes,_=f.dimensions,P=f.autoResize,T=f.url,S=f.domain,A=f.exports,D=new w,R=[],W=Te(),j={},M={},k={visible:!0},z=h.event?h.event:(n={},r={},t={on:function(e,n){var t=r[e]=r[e]||[];t.push(n);var o=!1;return{cancel:function(){o||(o=!0,t.splice(t.indexOf(n),1))}}},once:function(e,n){var r=t.on(e,(function(){r.cancel(),n()}));return r},trigger:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];var i=r[e],a=[];if(i)for(var u=function(e){var n=i[e];a.push(w.try((function(){return n.apply(void 0,t)})))},c=0;c<i.length;c++)u(c);return w.all(a).then(pe)},triggerOnce:function(e){if(n[e])return w.resolve();n[e]=!0;for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.trigger.apply(t,[e].concat(o))},reset:function(){r={}}}),F=h.props?h.props:{},U=h.onError,Y=h.getProxyContainer,X=h.show,Z=h.hide,Q=h.close,K=h.renderContainer,ee=h.getProxyWindow,ne=h.setProxyWin,re=h.openFrame,te=h.openPrerenderFrame,oe=h.prerender,ie=h.open,ae=h.openPrerender,ce=h.watchForUnload,se=h.getInternalState,de=h.setInternalState,fe=function(){return"function"==typeof _?_({props:F}):_},he=function(){return w.try((function(){return h.resolveInitPromise?h.resolveInitPromise():D.resolve()}))},ge=function(e){return w.try((function(){return h.rejectInitPromise?h.rejectInitPromise(e):D.reject(e)}))},_e=function(e){for(var n={},r=0,t=Object.keys(F);r<t.length;r++){var o=t[r],i=m[o];i&&!1===i.sendToChild||i&&i.sameDomain&&!H(e,O(window))||(n[o]=F[o])}return w.hash(n)},Pe=function(){return w.try((function(){return se?se():k}))},Oe=function(e){return w.try((function(){return de?de(e):k=a({},k,e)}))},Ce=function(){return ee?ee():w.try((function(){var e=F.window;if(e){var n=ar(e);return W.register((function(){return e.close()})),n}return new Un({send:ir})}))},Ne=function(e){return ne?ne(e):w.try((function(){o=e}))},Se=function(){return X?X():w.hash({setState:Oe({visible:!0}),showElement:i?i.get().then(He):null}).then(pe)},Ae=function(){return Z?Z():w.hash({setState:Oe({visible:!1}),showElement:i?i.get().then(Je):null}).then(pe)},De=function(){return"function"==typeof T?T({props:F}):T},Re=function(){return"function"==typeof x?x({props:F}):x},Me=function(){return J(De())},ze=function(e,n){var r=n.windowName;return re?re(e,{windowName:r}):w.try((function(){if(e===mr.IFRAME)return dr(qe({attributes:a({name:r,title:b},Re().iframe)}))}))},Le=function(e){return te?te(e):w.try((function(){if(e===mr.IFRAME)return dr(qe({attributes:a({name:"__zoid_prerender_frame__"+b+"_"+ue()+"__",title:"prerender__"+b},Re().iframe)}))}))},$e=function(e,n,r){return ae?ae(e,n,r):w.try((function(){if(e===mr.IFRAME){if(!r)throw new Error("Expected proxy frame to be passed");return r.get().then((function(e){return W.register((function(){return Ve(e)})),Ue(e).then((function(e){return N(e)})).then((function(e){return ar(e)}))}))}if(e===mr.POPUP)return n;throw new Error("No render context available for "+e)}))},Ze=function(){return w.try((function(){if(o)return w.all([z.trigger(yr.FOCUS),o.focus()]).then(pe)}))},Qe=function(){var e=cr(window);return e.windows=e.windows||{},e.windows[d]=window,W.register((function(){delete e.windows[d]})),d},Ke=function(e,n,r,t){if(n===O(window))return{type:"global",uid:Qe()};if(e!==window)throw new Error("Can not construct cross-domain window reference for different target window");if(F.window){var o=t.getWindow();if(!o)throw new Error("Can not construct cross-domain window reference for lazy window prop");if(L(o)!==window)throw new Error("Can not construct cross-domain window reference for window prop with different ancestor")}if(r===mr.POPUP)return{type:"opener"};if(r===mr.IFRAME)return{type:"parent",distance:q(window)};throw new Error("Can not construct window reference for child")},en=function(e,n){return w.try((function(){c=e,u=n,he(),W.register((function(){return n.close.fireAndForget().catch(pe)}))}))},nn=function(e){var n=e.width,r=e.height;return w.try((function(){z.trigger(yr.RESIZE,{width:n,height:r})}))},rn=function(e){return w.try((function(){return z.trigger(yr.DESTROY)})).catch(pe).then((function(){return W.all(e)})).then((function(){D.asyncReject(e||new Error("Component destroyed"))}))},on=le((function(e){return w.try((function(){if(Q){if(I(Q.__source__))return;return Q()}return w.try((function(){return z.trigger(yr.CLOSE)})).then((function(){return rn(e||new Error("Component closed"))}))}))})),an=function(e,n){var r=n.proxyWin,t=n.proxyFrame,o=n.windowName;return ie?ie(e,{proxyWin:r,proxyFrame:t,windowName:o}):w.try((function(){if(e===mr.IFRAME){if(!t)throw new Error("Expected proxy frame to be passed");return t.get().then((function(e){return Ue(e).then((function(n){return W.register((function(){return Ve(e)})),W.register((function(){return ur(n)})),n}))}))}if(e===mr.POPUP){var n=fe(),r=n.width,i=void 0===r?"300px":r,u=n.height,c=void 0===u?"150px":u;i=tn(i,window.outerWidth),c=tn(c,window.outerWidth);var s=function(e,n){var r=(n=n||{}).closeOnUnload,t=void 0===r?1:r,o=n.name,i=void 0===o?"":o,u=n.width,c=n.height,s=0,d=0;u&&(window.outerWidth?d=Math.round((window.outerWidth-u)/2)+window.screenX:window.screen.width&&(d=Math.round((window.screen.width-u)/2))),c&&(window.outerHeight?s=Math.round((window.outerHeight-c)/2)+window.screenY:window.screen.height&&(s=Math.round((window.screen.height-c)/2))),delete n.closeOnUnload,delete n.name,u&&c&&(n=a({top:s,left:d,width:u,height:c,status:1,toolbar:0,menubar:0,resizable:1,scrollbars:1},n));var f,l=Object.keys(n).map((function(e){if(null!=n[e])return e+"="+me(n[e])})).filter(Boolean).join(",");try{f=window.open("",i,l)}catch(e){throw new Fe("Can not open popup window - "+(e.stack||e.message))}if(I(f))throw new Fe("Can not open popup window - blocked");return t&&window.addEventListener("unload",(function(){return f.close()})),f}(0,a({name:o,width:i,height:c},Re().popup));return W.register((function(){return $(s)})),W.register((function(){return ur(s)})),s}throw new Error("No render context available for "+e)})).then((function(e){return r.setWindow(e,{send:ir}),r.setName(o).then((function(){return r}))}))},un=function(){return w.try((function(){var e=Be(window,"unload",we((function(){rn(new Error("Window navigated away"))}))),n=V(v,rn,3e3);if(W.register(n.cancel),W.register(e.cancel),ce)return ce()}))},cn=function(e){var n=!1;return e.isClosed().then((function(r){return r?(n=!0,on(new Error("Detected component window close"))):w.delay(200).then((function(){return e.isClosed()})).then((function(e){if(e)return n=!0,on(new Error("Detected component window close"))}))})).then((function(){return n}))},sn=function(e){return U?U(e):w.try((function(){if(-1===R.indexOf(e))return R.push(e),D.asyncReject(e),z.trigger(yr.ERROR,e)}))},dn=new w,fn=function(e){return w.try((function(){dn.resolve(e)}))};en.onError=sn;var ln=function(e,n){return e({uid:d,container:n.container,context:n.context,doc:n.doc,frame:n.frame,prerenderFrame:n.prerenderFrame,focus:Ze,close:on,state:j,props:F,tag:E,dimensions:fe(),event:z})},hn=function(e,n){var r=n.context;return oe?oe(e,{context:r}):w.try((function(){if(g){var n=e.getWindow();if(n&&C(n)&&function(e){try{if(!e.location.href)return!0;if("about:blank"===e.location.href)return!0}catch(e){}return!1}(n)){var t=(n=N(n)).document,o=ln(g,{context:r,doc:t});if(o){if(o.ownerDocument!==t)throw new Error("Expected prerender template to have been created with document from child window");!function(e,n){var r=n.tagName.toLowerCase();if("html"!==r)throw new Error("Expected element to be html, got "+r);for(var t=e.document.documentElement,o=0,i=be(t.children);o<i.length;o++)t.removeChild(i[o]);for(var a=0,u=be(n.children);a<u.length;a++)t.appendChild(u[a])}(n,o);var i=P.width,a=void 0!==i&&i,u=P.height,c=void 0!==u&&u,s=P.element,d=void 0===s?"body":s;if((d=Ie(d,t))&&(a||c)){var f=Ge(d,(function(e){nn({width:a?e.width:void 0,height:c?e.height:void 0})}),{width:a,height:c,win:n});z.on(yr.RENDERED,f.cancel)}}}}}))},pn=function(e,n){var r=n.proxyFrame,t=n.proxyPrerenderFrame,o=n.context,a=n.rerender;return K?K(e,{proxyFrame:r,proxyPrerenderFrame:t,context:o,rerender:a}):w.hash({container:e.get(),frame:r?r.get():null,prerenderFrame:t?t.get():null,internalState:Pe()}).then((function(e){var n=e.container,r=e.internalState.visible,t=ln(y,{context:o,container:n,frame:e.frame,prerenderFrame:e.prerenderFrame,doc:document});if(t){r||Je(t),je(n,t);var u=function(e,n){n=we(n);var r,t,o,i=!1,a=[],u=function(){i=!0;for(var e=0;e<a.length;e++)a[e].disconnect();r&&r.cancel(),o&&o.removeEventListener("unload",c),t&&Ve(t)},c=function(){i||(n(),u())};if(Ye(e))return c(),{cancel:u};if(window.MutationObserver)for(var s=e.parentElement;s;){var d=new window.MutationObserver((function(){Ye(e)&&c()}));d.observe(s,{childList:!0}),a.push(d),s=s.parentElement}return(t=document.createElement("iframe")).setAttribute("name","__detect_close_"+ue()+"__"),t.style.display="none",Ue(t).then((function(e){(o=N(e)).addEventListener("unload",c)})),e.appendChild(t),r=Ee((function(){Ye(e)&&c()}),1e3),{cancel:u}}(t,(function(){var e=new Error("Detected container element removed from DOM");return w.delay(1).then((function(){if(!Ye(t))return W.all(e),a().then(he,ge);on(e)}))}));return W.register((function(){return u.cancel()})),W.register((function(){return Ve(t)})),i=dr(t)}}))},wn=function(){return{state:j,event:z,close:on,focus:Ze,resize:nn,onError:sn,updateProps:mn,show:Se,hide:Ae}},vn=function(e){void 0===e&&(e={});var n,r,t,o,i,a,u,c,d,f,l=s,h=wn();ye(M,e),n=m,r=F,t=M,i=l,a=(o=h).state,u=o.close,c=o.focus,d=o.event,f=o.onError,Sr(t,n,(function(e,n,o){var s=!1,l=o;Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){return s?l:(s=!0,function(){if(!n)return l;var s=n.alias;if(s&&!xe(o)&&xe(t[s])&&(l=t[s]),n.value&&(l=n.value({props:r,state:a,close:u,focus:c,event:d,onError:f,container:i})),!n.default||xe(l)||xe(t[e])||(l=n.default({props:r,state:a,close:u,focus:c,event:d,onError:f,container:i})),xe(l)){if(n.type===wr.ARRAY?!Array.isArray(l):typeof l!==n.type)throw new TypeError("Prop is not of type "+n.type+": "+e)}else if(!1!==n.required&&!xe(t[e]))throw new Error('Expected prop "'+e+'" to be defined');return xe(l)&&n.decorate&&(l=n.decorate({value:l,props:r,state:a,close:u,focus:c,event:d,onError:f,container:i})),l}())}})})),Sr(r,n,pe)},mn=function(e){return vn(e),D.then((function(){var e=u,n=o;if(e&&n&&c)return _e(c).then((function(r){return e.updateProps(r).catch((function(e){return cn(n).then((function(n){if(!n)throw e}))}))}))}))},yn=function(e){return Y?Y(e):w.try((function(){return ke(e)})).then((function(e){return Xe(e)&&(e=function e(n){var r=function(e){var n=function(e){for(;e.parentNode;)e=e.parentNode;if(Xe(e))return e}(e);if(n&&n.host)return n.host}(n);if(!r)throw new Error("Element is not in shadow dom");var t="shadow-slot-"+ue(),o=document.createElement("slot");o.setAttribute("name",t),n.appendChild(o);var i=document.createElement("div");return i.setAttribute("slot",t),r.appendChild(i),Xe(r)?e(i):i}(e)),s=e,dr(e)}))};return{init:function(){z.on(yr.RENDER,(function(){return F.onRender()})),z.on(yr.DISPLAY,(function(){return F.onDisplay()})),z.on(yr.RENDERED,(function(){return F.onRendered()})),z.on(yr.CLOSE,(function(){return F.onClose()})),z.on(yr.DESTROY,(function(){return F.onDestroy()})),z.on(yr.RESIZE,(function(){return F.onResize()})),z.on(yr.FOCUS,(function(){return F.onFocus()})),z.on(yr.PROPS,(function(e){return F.onProps(e)})),z.on(yr.ERROR,(function(e){return F&&F.onError?F.onError(e):ge(e).then((function(){setTimeout((function(){throw e}),1)}))})),W.register(z.reset)},render:function(e){var n=e.target,r=e.container,t=e.context,i=e.rerender;return w.try((function(){var e=Me(),a=S||Me();!function(e,n,r){if(e!==window){if(!B(window,e))throw new Error("Can only renderTo an adjacent frame");var t=O();if(!H(n,t)&&!C(e))throw new Error("Can not render remotely to "+n.toString()+" - can only render to "+t);if(r&&"string"!=typeof r)throw new Error("Container passed to renderTo must be a string selector, got "+typeof r+" }")}}(n,a,r);var u=w.try((function(){if(n!==window)return function(e,n){for(var r={},t=0,o=Object.keys(F);t<o.length;t++){var i=o[t],a=m[i];a&&a.allowDelegate&&(r[i]=F[i])}var u=ir(n,"zoid_delegate_"+b,{uid:d,overrides:{props:r,event:z,close:on,onError:sn,getInternalState:Pe,setInternalState:Oe,resolveInitPromise:he,rejectInitPromise:ge}}).then((function(e){var r=e.data.parent;return W.register((function(e){if(!I(n))return r.destroy(e)})),r.getDelegateOverrides()})).catch((function(e){throw new Error("Unable to delegate rendering. Possibly the component is not loaded in the target window.\n\n"+ve(e))}));return Y=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.getProxyContainer.apply(e,n)}))},K=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.renderContainer.apply(e,n)}))},X=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.show.apply(e,n)}))},Z=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.hide.apply(e,n)}))},ce=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.watchForUnload.apply(e,n)}))},e===mr.IFRAME?(ee=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.getProxyWindow.apply(e,n)}))},re=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.openFrame.apply(e,n)}))},te=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.openPrerenderFrame.apply(e,n)}))},oe=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.prerender.apply(e,n)}))},ie=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.open.apply(e,n)}))},ae=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.openPrerender.apply(e,n)}))}):e===mr.POPUP&&(ne=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.setProxyWin.apply(e,n)}))}),u}(t,n)})),c=F.window,s=un(),l=Ar(m,F,"post"),h=z.trigger(yr.RENDER),p=yn(r),v=Ce(),y=p.then((function(){return vn()})),g=y.then((function(){return Ar(m,F,"get").then((function(e){return function(e,n){var r,t,o=n.query||{},i=n.hash||{},a=e.split("#");t=a[1];var u=(r=a[0]).split("?");r=u[0];var c=We(u[1],o),s=We(t,i);return c&&(r=r+"?"+c),s&&(r=r+"#"+s),r}(G(De()),{query:e})}))})),x=v.then((function(r){var o,i,u,c,s,f,l,h,p,w,v,m,y,g;return(i={proxyWin:(o={proxyWin:r,initialChildDomain:e,childDomainMatch:a,target:n,context:t}).proxyWin,initialChildDomain:o.initialChildDomain,childDomainMatch:o.childDomainMatch,target:o.target,context:o.context},h=void 0===i?{}:i,p=h.proxyWin,w=h.initialChildDomain,v=h.childDomainMatch,m=h.target,y=void 0===m?window:m,g=h.context,(u={proxyWin:p,initialChildDomain:w,childDomainMatch:v,context:g},c=void 0===u?{}:u,s=c.proxyWin,f=c.childDomainMatch,l=c.context,_e(c.initialChildDomain).then((function(e){var n;return{uid:d,context:l,tag:E,childDomainMatch:f,version:"9_0_86",props:e,exports:(n=s,{init:function(e){return en(this.origin,e)},close:on,checkClose:function(){return cn(n)},resize:nn,onError:sn,show:Se,hide:Ae,export:fn})}}))).then((function(e){var n=hr({data:e,metaData:{windowRef:Ke(y,w,g,p)},sender:{domain:O(window)},receiver:{win:p,domain:v},passByReference:w===O()}),r=n.serializedData;return W.register(n.cleanReference),r}))).then((function(e){return gr({name:b,serializedPayload:e})}))})),_=x.then((function(e){return ze(t,{windowName:e})})),P=Le(t),T=w.hash({proxyContainer:p,proxyFrame:_,proxyPrerenderFrame:P}).then((function(e){return pn(e.proxyContainer,{context:t,proxyFrame:e.proxyFrame,proxyPrerenderFrame:e.proxyPrerenderFrame,rerender:i})})).then((function(e){return e})),N=w.hash({windowName:x,proxyFrame:_,proxyWin:v}).then((function(e){var n=e.proxyWin;return c?n:an(t,{windowName:e.windowName,proxyWin:n,proxyFrame:e.proxyFrame})})),A=w.hash({proxyWin:N,proxyPrerenderFrame:P}).then((function(e){return $e(t,e.proxyWin,e.proxyPrerenderFrame)})),R=N.then((function(e){return o=e,Ne(e)})),j=w.hash({proxyPrerenderWin:A,state:R}).then((function(e){return hn(e.proxyPrerenderWin,{context:t})})),M=w.hash({proxyWin:N,windowName:x}).then((function(e){if(c)return e.proxyWin.setName(e.windowName)})),k=w.hash({body:l}).then((function(e){return f.method?f.method:Object.keys(e.body).length?"post":"get"})),L=w.hash({proxyWin:N,windowUrl:g,body:l,method:k,windowName:M,prerender:j}).then((function(e){return e.proxyWin.setLocation(e.windowUrl,{method:e.method,body:e.body})})),U=N.then((function(e){!function e(n,r){var t=!1;return W.register((function(){t=!0})),w.delay(2e3).then((function(){return n.isClosed()})).then((function(o){if(!t)return o?on(new Error("Detected "+r+" close")):e(n,r)}))}(e,t)})),q=w.hash({container:T,prerender:j}).then((function(){return z.trigger(yr.DISPLAY)})),V=N.then((function(n){return r=n,o=e,i=t,w.try((function(){return r.awaitWindow()})).then((function(e){if(or&&or.needsBridge({win:e,domain:o})&&!or.hasBridge(o,o)){var n="function"==typeof f.bridgeUrl?f.bridgeUrl({props:F}):f.bridgeUrl;if(!n)throw new Error("Bridge needed to render "+i);var r=J(n);return or.linkUrl(e,o),or.openBridge(G(n),r)}}));var r,o,i})),$=L.then((function(){return w.try((function(){var e=F.timeout;if(e)return D.timeout(e,new Error("Loading component timed out after "+e+" milliseconds"))}))})),Q=D.then((function(){return z.trigger(yr.RENDERED)}));return w.hash({initPromise:D,buildUrlPromise:g,onRenderPromise:h,getProxyContainerPromise:p,openFramePromise:_,openPrerenderFramePromise:P,renderContainerPromise:T,openPromise:N,openPrerenderPromise:A,setStatePromise:R,prerenderPromise:j,loadUrlPromise:L,buildWindowNamePromise:x,setWindowNamePromise:M,watchForClosePromise:U,onDisplayPromise:q,openBridgePromise:V,runTimeoutPromise:$,onRenderedPromise:Q,delegatePromise:u,watchForUnloadPromise:s,finalSetPropsPromise:y})})).catch((function(e){return w.all([sn(e),rn(e)]).then((function(){throw e}),(function(){throw e}))})).then(pe)},destroy:rn,getProps:function(){return F},setProps:vn,export:fn,getHelpers:wn,getDelegateOverrides:function(){return w.try((function(){return{getProxyContainer:yn,show:Se,hide:Ae,renderContainer:pn,getProxyWindow:Ce,watchForUnload:un,openFrame:ze,openPrerenderFrame:Le,prerender:hn,open:an,openPrerender:$e,setProxyWin:Ne}}))},getExports:function(){return A({getExports:function(){return dn}})}}}function Rr(e){var n=e.uid,r=e.frame,t=e.prerenderFrame,o=e.doc,i=e.props,a=e.event,u=e.dimensions,c=u.width,s=u.height;if(r&&t){var d=o.createElement("div");d.setAttribute("id",n);var f=o.createElement("style");return i.cspNonce&&f.setAttribute("nonce",i.cspNonce),f.appendChild(o.createTextNode("\n #"+n+" {\n display: inline-block;\n position: relative;\n width: "+c+";\n height: "+s+";\n }\n\n #"+n+" > iframe {\n display: inline-block;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n transition: opacity .2s ease-in-out;\n }\n\n #"+n+" > iframe.zoid-invisible {\n opacity: 0;\n }\n\n #"+n+" > iframe.zoid-visible {\n opacity: 1;\n }\n ")),d.appendChild(r),d.appendChild(t),d.appendChild(f),t.classList.add("zoid-visible"),r.classList.add("zoid-invisible"),a.on(yr.RENDERED,(function(){t.classList.remove("zoid-visible"),t.classList.add("zoid-invisible"),r.classList.remove("zoid-invisible"),r.classList.add("zoid-visible"),setTimeout((function(){Ve(t)}),1)})),a.on(yr.RESIZE,(function(e){var n=e.width,r=e.height;"number"==typeof n&&(d.style.width=rn(n)),"number"==typeof r&&(d.style.height=rn(r))})),d}}function Wr(e){var n=e.doc,r=e.props,t=n.createElement("html"),o=n.createElement("body"),i=n.createElement("style"),a=n.createElement("div");return a.classList.add("spinner"),r.cspNonce&&i.setAttribute("nonce",r.cspNonce),t.appendChild(o),o.appendChild(a),o.appendChild(i),i.appendChild(n.createTextNode("\n html, body {\n width: 100%;\n height: 100%;\n }\n\n .spinner {\n position: fixed;\n max-height: 60vmin;\n max-width: 60vmin;\n height: 40px;\n width: 40px;\n top: 50%;\n left: 50%;\n box-sizing: border-box;\n border: 3px solid rgba(0, 0, 0, .2);\n border-top-color: rgba(33, 128, 192, 0.8);\n border-radius: 100%;\n animation: rotation .7s infinite linear;\n }\n\n @keyframes rotation {\n from {\n transform: translateX(-50%) translateY(-50%) rotate(0deg);\n }\n to {\n transform: translateX(-50%) translateY(-50%) rotate(359deg);\n }\n }\n ")),t}var jr=Te(),Mr=Te();function Ir(e){var n,r,t=function(e){var n=e.tag,r=e.url,t=e.domain,o=e.bridgeUrl,i=e.props,u=void 0===i?{}:i,c=e.dimensions,s=void 0===c?{}:c,d=e.autoResize,f=void 0===d?{}:d,l=e.allowedParentDomains,h=void 0===l?"*":l,p=e.attributes,w=void 0===p?{}:p,v=e.defaultContext,m=void 0===v?mr.IFRAME:v,y=e.containerTemplate,g=void 0===y?Rr:y,E=e.prerenderTemplate,b=void 0===E?Wr:E,x=e.validate,_=e.eligible,P=void 0===_?function(){return{eligible:!0}}:_,T=e.logger,O=void 0===T?{info:pe}:T,N=e.exports,S=void 0===N?pe:N,A=e.method,D=e.children,R=void 0===D?function(){return{}}:D,W=n.replace(/-/g,"_"),j=a({},{window:{type:wr.OBJECT,sendToChild:!1,required:!1,allowDelegate:!0,validate:function(e){var n=e.value;if(!Y(n)&&!Un.isProxyWindow(n))throw new Error("Expected Window or ProxyWindow");if(Y(n)){if(I(n))throw new Error("Window is closed");if(!C(n))throw new Error("Window is not same domain")}},decorate:function(e){return ar(e.value)}},timeout:{type:wr.NUMBER,required:!1,sendToChild:!1},cspNonce:{type:wr.STRING,required:!1},onDisplay:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr,decorate:Nr},onRendered:{type:wr.FUNCTION,required:!1,sendToChild:!1,default:Cr,decorate:Nr},onRender:{type:wr.FUNCTION,required:!1,sendToChild:!1,default:Cr,decorate:Nr},onClose:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr,decorate:Nr},onDestroy:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr,decorate:Nr},onResize:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr},onFocus:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr},close:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.close}},focus:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.focus}},resize:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.resize}},uid:{type:wr.STRING,required:!1,sendToChild:!1,childDecorate:function(e){return e.uid}},tag:{type:wr.STRING,required:!1,sendToChild:!1,childDecorate:function(e){return e.tag}},getParent:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.getParent}},getParentDomain:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.getParentDomain}},show:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.show}},hide:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.hide}},export:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.export}},onError:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.onError}},onProps:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.onProps}},getSiblings:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.getSiblings}}},u);if(!g)throw new Error("Container template required");return{name:W,tag:n,url:r,domain:t,bridgeUrl:o,method:A,propsDef:j,dimensions:s,autoResize:f,allowedParentDomains:h,attributes:w,defaultContext:m,containerTemplate:g,prerenderTemplate:b,validate:x,logger:O,eligible:P,children:R,exports:"function"==typeof S?S:function(e){for(var n=e.getExports,r={},t=function(e,t){var o=t[e],i=S[o].type,a=n().then((function(e){return e[o]}));r[o]=i===wr.FUNCTION?function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return a.then((function(e){return e.apply(void 0,n)}))}:a},o=0,i=Object.keys(S);o<i.length;o++)t(o,i);return r}}}(e),o=t.name,i=t.tag,u=t.defaultContext,c=t.eligible,s=t.children,d=cr(window),f=[],l=function(){if(function(e){try{return Er(window.name).name===e}catch(e){}return!1}(o)){var e=xr().payload;if(e.tag===i&&H(e.childDomainMatch,O()))return!0}return!1},h=le((function(){if(l()){if(window.xprops)throw delete d.components[i],new Error("Can not register "+o+" as child - child already registered");var e=function(e){var n,r=e.tag,t=e.propsDef,o=e.autoResize,i=e.allowedParentDomains,a=[],u=xr(),c=u.parent,s=u.payload,d=c.win,f=c.domain,l=new w,h=s.version,p=s.uid,v=s.exports,m=s.context,y=s.props;if("9_0_86"!==h)throw new Error("Parent window has zoid version "+h+", child window has version 9_0_86");var g=v.show,E=v.hide,b=v.close,x=v.onError,_=v.checkClose,P=v.export,T=v.resize,S=v.init,A=function(){return d},D=function(){return f},R=function(e){return a.push(e),{cancel:function(){a.splice(a.indexOf(e),1)}}},j=function(e){return T.fireAndForget({width:e.width,height:e.height})},M=function(e){return l.resolve(e),P(e)},I=function(e){var t=(void 0===e?{}:e).anyParent,o=[],i=n.parent;if(void 0===t&&(t=!i),!t&&!i)throw new Error("No parent found for "+r+" child");for(var a=0,u=W(window);a<u.length;a++){var c=u[a];if(C(c)){var s=N(c).xprops;if(s&&A()===s.getParent()){var d=s.parent;if(t||!i||d&&d.uid===i.uid){var f=sr(c,(function(e){return e.exports}));o.push({props:s,exports:f})}}}}return o},k=function(e,o,i){void 0===i&&(i=!1);var u=function(e,n,r,t,o,i){void 0===i&&(i=!1);for(var a={},u=0,c=Object.keys(r);u<c.length;u++){var s=c[u],d=n[s];if(!d||!d.sameDomain||t===O(window)&&C(e)){var f=Pr(n,0,s,r[s],o);a[s]=f,d&&d.alias&&!a[d.alias]&&(a[d.alias]=f)}}if(!i)for(var l=0,h=Object.keys(n);l<h.length;l++){var p=h[l];r.hasOwnProperty(p)||(a[p]=Pr(n,0,p,void 0,o))}return a}(d,t,e,o,{tag:r,show:g,hide:E,close:b,focus:Tr,onError:x,resize:j,getSiblings:I,onProps:R,getParent:A,getParentDomain:D,uid:p,export:M},i);n?ye(n,u):n=u;for(var c=0;c<a.length;c++)(0,a[c])(n)},z=function(e){return w.try((function(){return k(e,f,!0)}))};return{init:function(){return w.try((function(){return C(d)&&function(e){var n=e.componentName,r=e.parentComponentWindow,t=pr({data:Er(window.name).serializedInitialPayload,sender:{win:r},basic:!0}),o=t.sender;if("uid"===t.reference.type||"global"===t.metaData.windowRef.type){var i=hr({data:t.data,metaData:{windowRef:_r(r)},sender:{domain:o.domain},receiver:{win:window,domain:O()},basic:!0});window.name=gr({name:n,serializedPayload:i.serializedData})}}({componentName:e.name,parentComponentWindow:d}),cr(window).exports=e.exports({getExports:function(){return l}}),function(e,n){if(!H(e,n))throw new Error("Can not be rendered by domain: "+n)}(i,f),mn(d),window.addEventListener("beforeunload",(function(){_.fireAndForget()})),window.addEventListener("unload",(function(){_.fireAndForget()})),V(d,(function(){Or()})),S({updateProps:z,close:Or})})).then((function(){var e,n,r,t,i;return(e=o.width,n=void 0!==e&&e,r=o.height,t=void 0!==r&&r,i=o.element,ke(void 0===i?"body":i).catch(pe).then((function(e){return{width:n,height:t,element:e}}))).then((function(e){var n=e.width,r=e.height,t=e.element;t&&(n||r)&&m!==mr.POPUP&&Ge(t,(function(e){j({width:n?e.width:void 0,height:r?e.height:void 0})}),{width:n,height:r})}))})).catch((function(e){x(e)}))},getProps:function(){return n||(k(y,f),n)}}}(t);return e.init(),e}}));if(h(),n=tr("zoid_allow_delegate_"+o,(function(){return!0})),r=tr("zoid_delegate_"+o,(function(e){var n=e.data;return{parent:Dr({uid:n.uid,options:t,overrides:n.overrides,parentWin:e.source})}})),Mr.register(n.cancel),Mr.register(r.cancel),d.components=d.components||{},d.components[i])throw new Error("Can not register multiple components with the same tag: "+i);return d.components[i]=!0,{init:function e(n){var r,d="zoid-"+i+"-"+ue(),l=n||{},h=c({props:l}),p=h.eligible,v=h.reason,m=l.onDestroy;l.onDestroy=function(){if(r&&p&&f.splice(f.indexOf(r),1),m)return m.apply(void 0,arguments)};var y=Dr({uid:d,options:t});y.init(),p?y.setProps(l):l.onDestroy&&l.onDestroy(),jr.register((function(e){return y.destroy(e||new Error("zoid destroyed all components"))}));var g=function(n){var r=(void 0===n?{}:n).decorate;return e((void 0===r?ge:r)(l))},E=function(e,n,t){return w.try((function(){if(!p){var n=new Error(v||o+" component is not eligible");return y.destroy(n).then((function(){throw n}))}if(!Y(e))throw new Error("Must pass window to renderTo");return r=l,i=t,w.try((function(){if(r.window)return ar(r.window).getType();if(i){if(i!==mr.IFRAME&&i!==mr.POPUP)throw new Error("Unrecognized context: "+i);return i}return u}));var r,i})).then((function(o){if(n=function(e,n){if(n){if("string"!=typeof n&&!Me(n))throw new TypeError("Expected string or element selector to be passed");return n}if(e===mr.POPUP)return"body";throw new Error("Expected element to be passed to render iframe")}(o,n),e!==window&&"string"!=typeof n)throw new Error("Must pass string element when rendering to another window");return y.render({target:e,container:n,context:o,rerender:function(){var o=g();return ye(r,o),o.renderTo(e,n,t)}})})).catch((function(e){return y.destroy(e).then((function(){throw e}))}))};return r=a({},y.getExports(),y.getHelpers(),function(){for(var e=s(),n={},r=function(r,t){var o=t[r],i=e[o];n[o]=function(e){var n=y.getProps(),r=a({},e,{parent:{uid:d,props:n,export:y.export}});return i(r)}},t=0,o=Object.keys(e);t<o.length;t++)r(t,o);return n}(),{isEligible:function(){return p},clone:g,render:function(e,n){return E(window,e,n)},renderTo:function(e,n,r){return E(e,n,r)}}),p&&f.push(r),r},instances:f,driver:function(e,n){throw new Error("Driver support not enabled")},isChild:l,canRenderTo:function(e){return ir(e,"zoid_allow_delegate_"+o).then((function(e){return e.data})).catch((function(){return!1}))},registerChild:h}}var kr=function(e){!function(){var e,n,r,t,o,i,a,u,c,s;on().initialized||(on().initialized=!0,u=(a={on:tr,send:ir}).on,c=a.send,(s=on()).receiveMessage=s.receiveMessage||function(e){return rr(e,{on:u,send:c})},o=(t={on:tr,send:ir}).on,i=t.send,un().getOrSet("postMessageListener",(function(){return Be(window,"message",(function(e){var n,r,t,a;n=e,t=(r={on:o,send:i}).on,a=r.send,w.try((function(){var e=n.source||n.sourceElement,r=n.origin||n.originalEvent&&n.originalEvent.origin,o=n.data;if("null"===r&&(r="file://"),e){if(!r)throw new Error("Post message did not have origin domain");rr({source:e,origin:r,data:o},{on:t,send:a})}}))}))})),zn({on:tr,send:ir,receiveMessage:rr}),n=(e={on:tr,send:ir}).on,r=e.send,un("builtinListeners").getOrSet("helloListener",(function(){var e=n("postrobot_hello",{domain:"*"},(function(e){return hn(e.source,{domain:e.origin}),{instanceID:ln()}})),t=L();return t&&pn(t,{send:r}).catch((function(e){})),e})))}();var n=Ir(e),r=function(e){return n.init(e)};r.driver=function(e,r){return n.driver(e,r)},r.isChild=function(){return n.isChild()},r.canRenderTo=function(e){return n.canRenderTo(e)},r.instances=n.instances;var t=n.registerChild();return t&&(window.xprops=r.xprops=t.getProps()),r};function zr(e){or&&or.destroyBridges();var n=jr.all(e);return jr=Te(),n}var Fr=zr;function Lr(e){var n;return Fr(),delete window.__zoid_9_0_86__,function(){for(var e=un("responseListeners"),n=0,r=e.keys();n<r.length;n++){var t=r[n],o=e.get(t);o&&(o.cancelled=!0),e.del(t)}}(),(n=un().get("postMessageListener"))&&n.cancel(),delete window.__post_robot_10_0_44__,Mr.all(e)}}])})),o.register("8BAlD",(function(e,n){}));var i={};i=o("cZQrj");var a={},u=o("8BAlD");let c,s;u&&u.env,(a=o("cBfIu")).default=a,function(e){e.ALL="ALL",e.VASP_2_VASP_ONLY="VASP_2_VASP_ONLY",e.SELF_TRANSACTION_ONLY="SELF_TRANSACTION_ONLY"}(c||(c={})),function(e){e.SIGNATURE="SIGNATURE",e.DECLARATION="DECLARATION",e.SIGNATURE_OR_DECLARATION="SIGNATURE_OR_DECLARATION"}(s||(s={}));class d{async renderWidget(){this.widgetRendered?console.error("Notabene: Widget already rendered, please destroy it first"):(this.widget=await this.buildWidget(),this.popup=await this.buildPopup(),this.widget.updateProps({transaction:this.tx}),this.popup.updateProps({transaction:this.tx}),this.popup.hide(),await this.widget.render(this.config.container),await this.renderPopup())}async renderPopup(){this.popup&&(this.popupRendered||(await this.popup.render(this.config.container),this.popupRendered=!0))}async destroyWidget(){await a.destroy(),this.widgetRendered=!1,this.popupRendered=!1}setTransaction(e){const n=["transactionAsset","transactionAmount","beneficiaryAccountNumber","beneficiaryAccountNumber","originatorVASPdid","originatorDid","transactionBlockchainInfo","beneficiaryVASPname","beneficiaryVASPdid","beneficiaryName","beneficiaryDid","isNonCustodial","originatorEqualsBeneficiary","beneficiaryProof","isValid","errors"];e&&Object.keys(e).forEach((e=>{if(!n.includes(e))throw new Error(`Notabene: Invalid transaction property ${e}`)})),this.tx=e,this.widgetRendered&&(this.widget.updateProps({transaction:e}),this.popup.updateProps({transaction:e}))}getWidgetUrl(){const e=new URL(this.config.widget);return e.hash=`authToken=${this.config.authToken}`,e.toString()}getAdditionalInfoUrl(){const e=new URL(this.config.widget);return e.search="popup=true",e.hash=`authToken=${this.config.authToken}`,e.toString()}handleError(e){this.error=e,this.widget&&this.popup&&(this.widget.updateProps({error:e}),this.popup.updateProps({error:e})),e&&this.onError&&this.onError(e)}buildWidget(){if(!this.config.authToken)return void console.error("Notabene: authToken is required");const n=e(a).create({tag:"widget",url:this.getWidgetUrl(),dimensions:{width:"100%",height:"280px"},props:{vaspDID:{type:"string",required:!0},transaction:{type:"object",required:!1},onRequireAdditionalInformation:{type:"function",required:!0},onValidStateChange:{type:"function"},error:{type:"object",required:!1},onError:{type:"function",required:!0},storeTransaction:{type:"function",required:!0},theme:{type:"object",required:!1},dictionary:{type:"object",required:!1},transactionTypeAllowed:{type:"string",required:!1},nonCustodialDeclarationType:{type:"string",required:!1}}})({vaspDID:this.config.vaspDID,transaction:{},theme:this.config.theme,dictionary:this.config.dictionary,transactionTypeAllowed:this.config.transactionTypeAllowed,nonCustodialDeclarationType:this.config.nonCustodialDeclarationType,onRequireAdditionalInformation:()=>{this.popup.updateProps({popupOpen:!0}),this.popup.show()},onValidStateChange:e=>{this.onValidStateChange(e)},error:this.error,onError:e=>{this.handleError(e),console.debug("Notabene: Error handler called")},storeTransaction:e=>{this.setTransaction(e)}});return n.event.on(e(a).EVENT.RENDERED,(e=>{this.widgetRendered=!0})),n}buildPopup(){if(!this.config.authToken)return void console.error("Notabene: authToken is required");const n=e(a).create({tag:"popup",url:this.getAdditionalInfoUrl(),children:()=>({Transaction:this.tx}),dimensions:{width:"100%",height:"100%"},props:{vaspDID:{type:"string",required:!0},transaction:{type:"object",required:!1},storeTransaction:{type:"function",required:!0},close:{type:"function"},theme:{type:"object",required:!1},dictionary:{type:"object",required:!1},transactionTypeAllowed:{type:"string",required:!1},nonCustodialDeclarationType:{type:"string",required:!1},popupOpen:{type:"boolean",required:!0},setPopupOpen:{type:"function",required:!0},error:{type:"object",required:!1},onError:{type:"function",required:!0}},containerTemplate:({uid:e,doc:n,frame:r,prerenderFrame:t})=>i.node("div",{id:e,class:"nb-container"},i.node("style",null,`\n #${e}.container {\n border: 5px solid red;\n }\n .nb-overlay {\n position: fixed;\n width: 100vw;\n height: 100vh;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(0,0,0,0.5);\n }\n .nb-popup {\n max-width: 608px;\n width: 100%;\n height: 100%;\n }\n .nb-preloader {\n display: none;\n }\n `),i.node("div",{class:"nb-overlay"},i.node("node",{el:r,class:"nb-popup"}),i.node("node",{el:t,class:"nb-preloader"}))).render(i.dom({doc:n}))})({vaspDID:this.config.vaspDID,transaction:this.tx,storeTransaction:e=>{this.setTransaction(e),console.debug("Notabene: Transaction stored")},close:()=>{this.popup.close(),console.debug("Notabene: Popup closing")},setPopupOpen:e=>{this.popup.updateProps({popupOpen:e})},error:this.error,onError:e=>{this.handleError(e),console.debug("Notabene: Error handler called")},popupOpen:!1,theme:this.config.theme,dictionary:this.config.dictionary,transactionTypeAllowed:this.config.transactionTypeAllowed,nonCustodialDeclarationType:this.config.nonCustodialDeclarationType});return n.event.on(e(a).EVENT.RENDERED,(e=>{this.popupRendered=!0})),n}constructor(e){this.config=e,this.config.nonCustodialDeclarationType=e.nonCustodialDeclarationType||s.SIGNATURE,this.config.transactionTypeAllowed=e.transactionTypeAllowed||c.ALL,this.onValidStateChange=e.onValidStateChange,this.onError=e.onError,this.widgetRendered=!1,this.popupRendered=!1}}window&&(window.Notabene=d),window&&(window.Notabene=d);
1
+ function e(e){return e&&e.__esModule?e.default:e}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},r={},t={},o=n.parcelRequire31dc;null==o&&((o=function(e){if(e in r)return r[e].exports;if(e in t){var n=t[e];delete t[e];var o={id:e,exports:{}};return r[e]=o,n.call(o.exports,o,o.exports),o.exports}var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,n){t[e]=n},n.parcelRequire31dc=o),o.register("cZQrj",(function(e,n){"undefined"!=typeof self?self:e.exports,e.exports=function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)r.d(t,o,function(n){return e[n]}.bind(null,o));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return{}.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,r){r.r(n),r.d(n,"ElementNode",(function(){return i})),r.d(n,"FragmentNode",(function(){return a})),r.d(n,"TextNode",(function(){return u})),r.d(n,"ComponentNode",(function(){return c})),r.d(n,"node",(function(){return h})),r.d(n,"Fragment",(function(){return p})),r.d(n,"text",(function(){return w})),r.d(n,"dom",(function(){return _})),r.d(n,"react",(function(){return C})),r.d(n,"html",(function(){return A})),r.d(n,"preact",(function(){return R})),r.d(n,"regex",(function(){return W})),r.d(n,"NODE_TYPE",(function(){return t})),r.d(n,"Style",(function(){return j})),r.d(n,"Regex",(function(){return k})),r.d(n,"RegexText",(function(){return z})),r.d(n,"RegexWord",(function(){return F})),r.d(n,"RegexCharacters",(function(){return L})),r.d(n,"RegexGroup",(function(){return U})),r.d(n,"RegexUnion",(function(){return q}));var t={ELEMENT:"element",TEXT:"text",COMPONENT:"component",FRAGMENT:"fragment"};function o(e,n){for(var r=[],t=0;t<e.length;t++){var o=e[t].render(n);if(o)if(Array.isArray(o))for(var i=0;i<o.length;i++){var a=o[i];a&&r.push(a)}else r.push(o)}return r}var i=function(){function e(e,n,r){this.type=t.ELEMENT,this.name=void 0,this.props=void 0,this.children=void 0,this.onRender=void 0,this.name=e,this.props=n||{},this.children=r;var o=this.props.onRender;"function"==typeof o&&(this.onRender=o,delete n.onRender)}var n=e.prototype;return n.render=function(e){var n=e(this);return this.onRender&&this.onRender(n),n},n.renderChildren=function(e){return o(this.children,e)},e}(),a=function(){function e(e){this.type=t.FRAGMENT,this.children=void 0,this.children=e}return e.prototype.render=function(e){return o(this.children,e)},e}(),u=function(){function e(e){this.type=t.TEXT,this.text=void 0,this.text=e}return e.prototype.render=function(e){return e(this)},e}(),c=function(){function e(e,n,r){this.type=t.COMPONENT,this.component=void 0,this.props=void 0,this.children=void 0,this.component=e,this.props=n||{},this.children=r,this.props.children=r}var n=e.prototype;return n.renderComponent=function(e){var n,r,t=(n=this.component(this.props,this.children),1===(r=s(Array.isArray(n)?n:[n])).length?r[0]:r.length>1?new a(r):void 0);if(t)return t.render(e)},n.render=function(e){return e(this)},n.renderChildren=function(e){return o(this.children,e)},e}();function s(e){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(o)if("string"==typeof o||"number"==typeof o)n.push(new u(o.toString()));else{if("boolean"==typeof o)continue;if(Array.isArray(o))for(var i=0,a=s(o);i<a.length;i++)n.push(a[i]);else{if(!o||o.type!==t.ELEMENT&&o.type!==t.TEXT&&o.type!==t.COMPONENT)throw new TypeError("Unrecognized node type: "+typeof o);n.push(o)}}}return n}var d,f,l,h=function(e,n){for(var r=arguments.length,t=new Array(r>2?r-2:0),o=2;o<r;o++)t[o-2]=arguments[o];if(t=s(t),"string"==typeof e)return new i(e,n,t);if("function"==typeof e)return new c(e,n,t);throw new TypeError("Expected jsx element to be a string or a function")},p=function(e,n){return n};function w(){return function e(n){if(n.type===t.COMPONENT)return[].concat(n.renderComponent(e)).join("");if(n.type===t.ELEMENT)throw new Error("Text renderer does not support basic elements");if(n.type===t.TEXT)return n.text;throw new TypeError("Unhandleable node: "+n.type)}}function v(e){return null!=e}var m=((d={}).svg="http://www.w3.org/2000/svg",d),y=((f={})["xlink:href"]="http://www.w3.org/1999/xlink",f);function g(e,n){return e.createTextNode(n.text)}function b(e,n){for(var r=n.props,t=0,o=Object.keys(r);t<o.length;t++){var i=o[t],a=r[i];if(null!=a&&"el"!==i&&"innerHTML"!==i)if(i.match(/^on[A-Z][a-z]/)&&"function"==typeof a)e.addEventListener(i.slice(2).toLowerCase(),a);else if("string"==typeof a||"number"==typeof a){var u=y[i];u?e.setAttributeNS(u,i,a.toString()):e.setAttribute(i,a.toString())}else"boolean"==typeof a&&!0===a&&e.setAttribute(i,"")}"iframe"!==e.tagName.toLowerCase()||r.id||e.setAttribute("id","jsx-iframe-"+"xxxxxxxxxx".replace(/./g,(function(){return"0123456789abcdef".charAt(Math.floor(16*Math.random()))})))}var E=((l={}).iframe=function(e,n){var r=n.children[0];if(1!==n.children.length||!r||r.type!==t.ELEMENT||"html"!==r.name)throw new Error("Expected only single html element node as child of iframe element");e.addEventListener("load",(function(){var n=e.contentWindow;if(!n)throw new Error("Expected frame to have contentWindow");for(var t=n.document,o=t.documentElement;o.children&&o.children.length;)o.removeChild(o.children[0]);for(var i=r.render(_({doc:t}));i.children.length;)o.appendChild(i.children[0])}))},l.script=function(e,n){var r=n.children[0];if(1!==n.children.length||!r||r.type!==t.TEXT)throw new Error("Expected only single text node as child of script element");e.text=r.text},l.default=function(e,n,r){for(var t=0,o=n.renderChildren(r);t<o.length;t++)e.appendChild(o[t])},l);function x(e,n,r,t){if(n.props.hasOwnProperty("innerHTML")){if(n.children.length)throw new Error("Expected no children to be passed when innerHTML prop is set");var o=n.props.innerHTML;if("string"!=typeof o)throw new TypeError("innerHTML prop must be string");"script"===n.name?e.text=o:(e.innerHTML=o,function(e,n){void 0===n&&(n=window.document);for(var r=0,t=e.querySelectorAll("script");r<t.length;r++){var o=t[r],i=o.parentNode;if(i){var a=n.createElement("script");a.text=o.textContent,i.replaceChild(a,o)}}}(e,r))}else(E[n.name]||E.default)(e,n,t)}function _(e){void 0===e&&(e={});var n=e.doc,r=void 0===n?document:n;return function e(n){if(n.type===t.COMPONENT)return n.renderComponent(e);if(n.type===t.TEXT)return g(r,n);if(n.type===t.ELEMENT){var o=m[n.name.toLowerCase()];if(o)return function e(n,o){if(n.type===t.COMPONENT)return n.renderComponent((function(n){return e(n,o)}));if(n.type===t.TEXT)return g(r,n);if(n.type===t.ELEMENT){var i=(a=n,u=o,r.createElementNS(u,a.name));return b(i,n),x(i,n,r,(function(n){return e(n,o)})),i}var a,u;throw new TypeError("Unhandleable node")}(n,o);var i=(a=r,(u=n).props.el?u.props.el:a.createElement(u.name));return b(i,n),x(i,n,r,e),i}var a,u;throw new TypeError("Unhandleable node")}}function P(){return(P=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}function T(e,n){if(null==e)return{};var r,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n.indexOf(r=i[t])>=0||(o[r]=e[r]);return o}var O=["innerHTML","class"];function C(e){var n=(void 0===e?{}:e).React;if(!n)throw new Error("Must pass React library to react renderer");return function e(r){if(r.type===t.COMPONENT)return n.createElement.apply(n,[function(){return r.renderComponent(e)||null},r.props].concat(r.renderChildren(e)));if(r.type===t.ELEMENT)return n.createElement.apply(n,[r.name,(o=r.props,i=o.innerHTML,P({dangerouslySetInnerHTML:i?{__html:i}:null,className:o.class},T(o,O)))].concat(r.renderChildren(e)));var o,i;if(r.type===t.TEXT)return r.text;throw new TypeError("Unhandleable node")}}var N={br:!0};function D(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\//g,"&#x2F;")}function A(){return function e(n){if(n.type===t.COMPONENT)return[].concat(n.renderComponent(e)).join("");if(n.type===t.ELEMENT){var r=(i=n.props,(a=Object.keys(i).filter((function(e){var n=i[e];return"innerHTML"!==e&&("string"==typeof n||"number"==typeof n||!0===n)}))).length?" "+a.map((function(e){var n=i[e];if(!0===n)return""+D(e);if("string"!=typeof n&&"number"!=typeof n)throw new TypeError("Unexpected prop type: "+typeof n);return""===n?D(e):D(e)+'="'+D(n.toString())+'"'})).join(" "):"");if(N[n.name])return"<"+n.name+r+" />";var o="string"==typeof n.props.innerHTML?n.props.innerHTML:n.renderChildren(e).join("");return"<"+n.name+r+">"+o+"</"+n.name+">"}var i,a;if(n.type===t.TEXT)return D(n.text);throw new TypeError("Unhandleable node: "+n.type)}}var S=["innerHTML"];function R(e){var n=(void 0===e?{}:e).Preact;if(!n)throw new Error("Must pass Preact library to react renderer");return function e(r){if(r.type===t.COMPONENT)return n.h.apply(n,[function(){return r.renderComponent(e)||null},r.props].concat(r.renderChildren(e)));if(r.type===t.ELEMENT)return n.h.apply(n,[r.name,(o=r.props,i=o.innerHTML,P({dangerouslySetInnerHTML:i?{__html:i}:null},T(o,S)))].concat(r.renderChildren(e)));var o,i;if(r.type===t.TEXT)return r.text;throw new TypeError("Unhandleable node")}}function W(){var e=w();return function(n){return new RegExp(e(n))}}function j(e){var n=e.css,r=e.nonce,t=e.children;return h(p,null,h("style",{innerHTML:"string"==typeof n?n:n._getCss(),nonce:r}),t)}W.node=function(e,n){for(var r=arguments.length,t=new Array(r>2?r-2:0),o=2;o<r;o++)t[o-2]=arguments[o];var i=h.apply(void 0,[e,n].concat(t));return e.renderer?i.render(e.renderer()):i};var I=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&")},M=function(e,n){return(n=function(e,n){if(!n)throw new Error("Must pass children to "+e);return n}(e,n)).map((function(e){return e.type===t.TEXT?new u(I(e.text)):e}))};function k(e,n){var r=e.exact,t=void 0===r||r;return n=M("RegexGroup",n),t?["^"].concat(n,["$"]):n}function z(e,n){return M("RegexText",n)}function F(e,n){return function(e,n){if(n&&n.length)throw new Error("Must not pass children to RegexWord")}(0,n),"\\w+"}function L(e,n){return["["].concat(M("RegexText",n),["]"])}function U(e,n){var r=e.repeat,t=e.repeatMin,o=e.repeatMax,i=e.name,a=e.optional,c=void 0!==a&&a,s=e.capture,d=void 0===s||s,f=e.union,l=void 0!==f&&f;if(n=M("RegexGroup",n),v(r)&&(v(t)||v(o)))throw new Error("repeat can not be used with repeatMin or repeatMax");if(i&&!d)throw new Error("Named groups must be captured");if(l){for(var h=[],p=0,w=n;p<w.length;p++)h.push(w[p]),h.push(new u("|"));h.pop(),n=h}var m=[];return m.push(d?"(":"(?:"),i&&m.push("?<"+I(i)+">"),m.push.apply(m,n),m.push(")"),v(r)&&("number"==typeof r?m.push("{"+r+"}"):!0===r&&m.push("+")),(v(t)||v(o))&&m.push("{"+(t||"")+","+(o||"")+"}"),c&&m.push("?"),m}function q(e,n){for(var r=[],t=0,o=n=M("RegexGroup",n);t<o.length;t++)r.push(o[t]),r.push("|");return r.pop(),r}k.renderer=W}])})),o.register("cBfIu",(function(e,n){var r=o("8BAlD").Buffer;"undefined"!=typeof self?self:e.exports,e.exports=function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)r.d(t,o,function(n){return e[n]}.bind(null,o));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return{}.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,t){function o(e,n){return(o=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function i(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,o(e,n)}function a(){return(a=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}function u(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&"function"==typeof window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&"function"==typeof window.constructor&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var r=n.call(e);if("[object Window]"===r||"[object global]"===r||"[object DOMWindow]"===r)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}t.r(n),t.d(n,"PopupOpenError",(function(){return Fe})),t.d(n,"create",(function(){return kr})),t.d(n,"destroy",(function(){return Lr})),t.d(n,"destroyComponents",(function(){return zr})),t.d(n,"destroyAll",(function(){return Fr})),t.d(n,"PROP_TYPE",(function(){return wr})),t.d(n,"PROP_SERIALIZATION",(function(){return vr})),t.d(n,"CONTEXT",(function(){return mr})),t.d(n,"EVENT",(function(){return yr}));var c,s=[],d=[],f=0;function l(){if(!f&&c){var e=c;c=null,e.resolve()}}function h(){f+=1}function p(){f-=1,l()}var w=function(){function e(e){var n=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=[],e){var r,t,o=!1,i=!1,a=!1;h();try{e((function(e){a?n.resolve(e):(o=!0,r=e)}),(function(e){a?n.reject(e):(i=!0,t=e)}))}catch(e){return p(),void this.reject(e)}p(),a=!0,o?this.resolve(r):i&&this.reject(t)}}var n=e.prototype;return n.resolve=function(e){if(this.resolved||this.rejected)return this;if(u(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},n.reject=function(e){var n=this;if(this.resolved||this.rejected)return this;if(u(e))throw new Error("Can not reject promise with another promise");if(!e){var r=e&&"function"==typeof e.toString?e.toString():{}.toString.call(e);e=new Error("Expected reject to be called with Error, got "+r)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout((function(){n.errorHandled||function(e,n){if(-1===s.indexOf(e)){s.push(e),setTimeout((function(){throw e}),1);for(var r=0;r<d.length;r++)d[r](e,n)}}(e,n)}),1),this.dispatch(),this},n.asyncReject=function(e){return this.errorHandled=!0,this.reject(e),this},n.dispatch=function(){var n=this.resolved,r=this.rejected,t=this.handlers;if(!this.dispatching&&(n||r)){this.dispatching=!0,h();for(var o=function(e,n){return e.then((function(e){n.resolve(e)}),(function(e){n.reject(e)}))},i=0;i<t.length;i++){var a=t[i],c=a.onSuccess,s=a.onError,d=a.promise,f=void 0;if(n)try{f=c?c(this.value):this.value}catch(e){d.reject(e);continue}else if(r){if(!s){d.reject(this.error);continue}try{f=s(this.error)}catch(e){d.reject(e);continue}}if(f instanceof e&&(f.resolved||f.rejected)){var l=f;l.resolved?d.resolve(l.value):d.reject(l.error),l.errorHandled=!0}else u(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?d.resolve(f.value):d.reject(f.error):o(f,d):d.resolve(f)}t.length=0,this.dispatching=!1,p()}},n.then=function(n,r){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for success handler");if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for error handler");var t=new e;return this.handlers.push({promise:t,onSuccess:n,onError:r}),this.errorHandled=!0,this.dispatch(),t},n.catch=function(e){return this.then(void 0,e)},n.finally=function(n){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.finally expected a function");return this.then((function(r){return e.try(n).then((function(){return r}))}),(function(r){return e.try(n).then((function(){throw r}))}))},n.timeout=function(e,n){var r=this;if(this.resolved||this.rejected)return this;var t=setTimeout((function(){r.resolved||r.rejected||r.reject(n||new Error("Promise timed out after "+e+"ms"))}),e);return this.then((function(e){return clearTimeout(t),e}))},n.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(n){return n instanceof e?n:u(n)?new e((function(e,r){return n.then(e,r)})):(new e).resolve(n)},e.reject=function(n){return(new e).reject(n)},e.asyncReject=function(n){return(new e).asyncReject(n)},e.all=function(n){var r=new e,t=n.length,o=[].slice();if(!t)return r.resolve(o),r;for(var i=function(e,n,i){return n.then((function(n){o[e]=n,0==(t-=1)&&r.resolve(o)}),(function(e){i.reject(e)}))},a=0;a<n.length;a++){var c=n[a];if(c instanceof e){if(c.resolved){o[a]=c.value,t-=1;continue}}else if(!u(c)){o[a]=c,t-=1;continue}i(a,e.resolve(c),r)}return 0===t&&r.resolve(o),r},e.hash=function(n){var r={},t=[],o=function(e){if(n.hasOwnProperty(e)){var o=n[e];u(o)?t.push(o.then((function(n){r[e]=n}))):r[e]=o}};for(var i in n)o(i);return e.all(t).then((function(){return r}))},e.map=function(n,r){return e.all(n.map(r))},e.onPossiblyUnhandledException=function(e){return n=e,d.push(n),{cancel:function(){d.splice(d.indexOf(n),1)}};var n},e.try=function(n,r,t){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.try expected a function");var o;h();try{o=n.apply(r,t||[])}catch(n){return p(),e.reject(n)}return p(),e.resolve(o)},e.delay=function(n){return new e((function(e){setTimeout(e,n)}))},e.isPromise=function(n){return!!(n&&n instanceof e)||u(n)},e.flush=function(){return n=e,r=c=c||new n,l(),r;var n,r},e}();function v(e){return"[object RegExp]"==={}.toString.call(e)}var m={IFRAME:"iframe",POPUP:"popup"},y="Call was rejected by callee.\r\n";function g(e){return void 0===e&&(e=window),e.location.protocol}function b(e){if(void 0===e&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return g(e)}function E(e){return void 0===e&&(e=window),"about:"===b(e)}function x(e){if(void 0===e&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function _(e){if(void 0===e&&(e=window),e&&!x(e))try{return e.opener}catch(e){}}function P(e){try{return!0}catch(e){}return!1}function T(e){void 0===e&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var r=g(e);if(!r)throw new Error("Can not read window protocol");if("file:"===r)return"file://";if("about:"===r){var t=x(e);return t&&P()?T(t):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return r+"//"+o}function O(e){void 0===e&&(e=window);var n=T(e);return n&&e.mockDomain&&0===e.mockDomain.indexOf("mock:")?e.mockDomain:n}function C(e){if(!function(e){try{if(e===window)return!0}catch(e){}try{var n=Object.getOwnPropertyDescriptor(e,"location");if(n&&!1===n.enumerable)return!1}catch(e){}try{if(E(e)&&P())return!0}catch(e){}try{if(void 0===(r=e)&&(r=window),"mock:"===b(r)&&P())return!0}catch(e){}var r;try{if(T(e)===T(window))return!0}catch(e){}return!1}(e))return!1;try{if(e===window)return!0;if(E(e)&&P())return!0;if(O(window)===O(e))return!0}catch(e){}return!1}function N(e){if(!C(e))throw new Error("Expected window to be same domain");return e}function D(e,n){if(!e||!n)return!1;var r=x(n);return r?r===e:-1!==function(e){var n=[];try{for(;e.parent!==e;)n.push(e.parent),e=e.parent}catch(e){}return n}(n).indexOf(e)}function A(e){var n,r,t=[];try{n=e.frames}catch(r){n=e}try{r=n.length}catch(e){}if(0===r)return t;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=n[o]}catch(e){continue}t.push(i)}return t}for(var a=0;a<100;a++){var u=void 0;try{u=n[a]}catch(e){return t}if(!u)return t;t.push(u)}return t}function S(e){for(var n=[],r=0,t=A(e);r<t.length;r++){var o=t[r];n.push(o);for(var i=0,a=S(o);i<a.length;i++)n.push(a[i])}return n}function R(e){void 0===e&&(e=window);try{if(e.top)return e.top}catch(e){}if(x(e)===e)return e;try{if(D(window,e)&&window.top)return window.top}catch(e){}try{if(D(e,window)&&window.top)return window.top}catch(e){}for(var n=0,r=S(e);n<r.length;n++){var t=r[n];try{if(t.top)return t.top}catch(e){}if(x(t)===t)return t}}function W(e){var n=R(e);if(!n)throw new Error("Can not determine top window");var r=[].concat(S(n),[n]);return-1===r.indexOf(e)&&(r=[].concat(r,[e],S(e))),r}var j=[],I=[];function M(e,n){void 0===n&&(n=!0);try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==y}if(n&&C(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var r=function(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}(j,e);if(-1!==r){var t=I[r];if(t&&function(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var n=e.ownerDocument;if(n&&n.documentElement&&!n.documentElement.contains(e)){for(var r=e;r.parentNode&&r.parentNode!==r;)r=r.parentNode;if(!r.host||!n.documentElement.contains(r.host))return!0}return!1}(t))return!0}return!1}function k(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent}function z(e,n){for(var r=A(e),t=0;t<r.length;t++){var o=r[t];try{if(C(o)&&o.name===n&&-1!==r.indexOf(o))return o}catch(e){}}try{if(-1!==r.indexOf(e.frames[n]))return e.frames[n]}catch(e){}try{if(-1!==r.indexOf(e[n]))return e[n]}catch(e){}}function F(e,n){return e===_(n)}function L(e){return void 0===e&&(e=window),_(e=e||window)||x(e)||void 0}function U(e,n){for(var r=0;r<e.length;r++)for(var t=e[r],o=0;o<n.length;o++)if(t===n[o])return!0;return!1}function q(e){void 0===e&&(e=window);for(var n=0,r=e;r;)(r=x(r))&&(n+=1);return n}function B(e,n){var r=R(e)||e,t=R(n)||n;try{if(r&&t)return r===t}catch(e){}var o=W(e),i=W(n);if(U(o,i))return!0;var a=_(r),u=_(t);return a&&U(W(a),i)||u&&U(W(u),o),!1}function H(e,n){if("string"==typeof e){if("string"==typeof n)return"*"===e||n===e;if(v(n))return!1;if(Array.isArray(n))return!1}return v(e)?v(n)?e.toString()===n.toString():!Array.isArray(n)&&Boolean(n.match(e)):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!v(n)&&e.some((function(e){return H(e,n)})))}function J(e){return e.match(/^(https?|mock|file):\/\//)?e.split("/").slice(0,3).join("/"):O()}function Y(e,n,r,t){var o;return void 0===r&&(r=1e3),void 0===t&&(t=1/0),function i(){if(M(e))return o&&clearTimeout(o),n();t<=0?clearTimeout(o):(t-=r,o=setTimeout(i,r))}(),{cancel:function(){o&&clearTimeout(o)}}}function V(e){try{if(e===window)return!0}catch(e){if(e&&e.message===y)return!0}try{if("[object Window]"==={}.toString.call(e))return!0}catch(e){if(e&&e.message===y)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===y)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===y)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===y)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===y)return!0}try{if(e&&"__unlikely_value__"===e.__cross_domain_utils_window_check__)return!1}catch(e){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(e){}return!1}function G(e){if(0!==J(e).indexOf("mock:"))return e;throw new Error("Mock urls not supported out of test mode")}function X(e){if(C(e))return N(e).frameElement;for(var n=0,r=document.querySelectorAll("iframe");n<r.length;n++){var t=r[n];if(t&&t.contentWindow&&t.contentWindow===e)return t}}function $(e){if(void 0===(r=e)&&(r=window),Boolean(x(r))){var n=X(e);if(n&&n.parentElement)return void n.parentElement.removeChild(n)}var r;try{e.close()}catch(e){}}function Z(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}var Q,K=function(){function e(){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("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var e=new WeakMap,n={};return Object.freeze(n),e.set(n,"__testvalue__"),"__testvalue__"===e.get(n)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var e=this.weakmap,n=this.keys,r=0;r<n.length;r++){var t=n[r];if(V(t)&&M(t)){if(e)try{e.delete(t)}catch(e){}n.splice(r,1),this.values.splice(r,1),r-=1}}},n.isSafeToReadWrite=function(e){return!V(e)},n.set=function(e,n){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.set(e,n)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e))try{var t=this.name,o=e[t];return void(o&&o[0]===e?o[1]=n:Object.defineProperty(e,t,{value:[e,n],writable:!0}))}catch(e){}this._cleanupClosedWindows();var i=this.keys,a=this.values,u=Z(i,e);-1===u?(i.push(e),a.push(n)):a[u]=n},n.get=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return n.get(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e))try{var r=e[this.name];return r&&r[0]===e?r[1]:void 0}catch(e){}this._cleanupClosedWindows();var t=Z(this.keys,e);if(-1!==t)return this.values[t]},n.delete=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e))try{var r=e[this.name];r&&r[0]===e&&(r[0]=r[1]=void 0)}catch(e){}this._cleanupClosedWindows();var t=this.keys,o=Z(t,e);-1!==o&&(t.splice(o,1),this.values.splice(o,1))},n.has=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return!0}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e))try{var r=e[this.name];return!(!r||r[0]!==e)}catch(e){}return this._cleanupClosedWindows(),-1!==Z(this.keys,e)},n.getOrSet=function(e,n){if(this.has(e))return this.get(e);var r=n();return this.set(e,r),r},e}();function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ne(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function re(e,n,r){return(re=ne()?Reflect.construct:function(e,n,r){var t=[null];t.push.apply(t,n);var i=new(Function.bind.apply(e,t));return r&&o(i,r.prototype),i}).apply(null,arguments)}function te(e){var n="function"==typeof Map?new Map:void 0;return(te=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return re(e,arguments,ee(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)})(e)}function oe(e){return e.name||e.__name__||e.displayName||"anonymous"}function ie(e,n){try{delete e.name,e.name=n}catch(e){}return e.__name__=e.displayName=n,e}function ae(e){if("function"==typeof btoa)return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,n){return String.fromCharCode(parseInt(n,16))}))).replace(/[=]/g,"");if(void 0!==r)return r.from(e,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}function ue(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,(function(){return e.charAt(Math.floor(Math.random()*e.length))}))+"_"+ae((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function ce(e){try{return JSON.stringify([].slice.call(e),(function(e,n){return"function"==typeof n?"memoize["+function(e){if(Q=Q||new K,null==e||"object"!=typeof e&&"function"!=typeof e)throw new Error("Invalid object");var n=Q.get(e);return n||(n=typeof e+":"+ue(),Q.set(e,n)),n}(n)+"]":n}))}catch(e){throw new Error("Arguments not serializable -- can not be used to memoize")}}function se(){return{}}var de=0,fe=0;function le(e,n){void 0===n&&(n={});var r,t,o=n.thisNamespace,i=void 0!==o&&o,a=n.time,u=de;de+=1;var c=function(){for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];var s;u<fe&&(r=null,t=null,u=de,de+=1),s=i?(t=t||new K).getOrSet(this,se):r=r||{};var d=ce(o),f=s[d];if(f&&a&&Date.now()-f.time<a&&(delete s[d],f=null),f)return f.value;var l=Date.now(),h=e.apply(this,arguments);return s[d]={time:l,value:h},h};return c.reset=function(){r=null,t=null},ie(c,(n.name||oe(e))+"::memoized")}function he(e){var n={};function r(){for(var r=arguments,t=this,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var u=ce(i);return n.hasOwnProperty(u)||(n[u]=w.try((function(){return e.apply(t,r)})).finally((function(){delete n[u]}))),n[u]}return r.reset=function(){n={}},ie(r,oe(e)+"::promiseMemoized")}function pe(){}function we(e){var n=!1;return ie((function(){if(!n)return n=!0,e.apply(this,arguments)}),oe(e)+"::once")}function ve(e,n){if(void 0===n&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if("string"==typeof e)return e;if(e instanceof Error){var r=e&&e.stack,t=e&&e.message;if(r&&t)return-1!==r.indexOf(t)?r:t+"\n"+r;if(r)return r;if(t)return t}return e&&e.toString&&"function"==typeof e.toString?e.toString():{}.toString.call(e)}catch(e){return"Error while stringifying error: "+ve(e,n+1)}}function me(e){return"string"==typeof e?e:e&&e.toString&&"function"==typeof e.toString?e.toString():{}.toString.call(e)}function ye(e,n){if(!n)return e;if(Object.assign)return Object.assign(e,n);for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r]);return e}function ge(e){return e}function be(e,n){var r;return function t(){r=setTimeout((function(){e(),t()}),n)}(),{cancel:function(){clearTimeout(r)}}}function Ee(e){return[].slice.call(e)}function xe(e){return null!=e}function _e(e){return"[object RegExp]"==={}.toString.call(e)}function Pe(e,n,r){if(e.hasOwnProperty(n))return e[n];var t=r();return e[n]=t,t}function Te(e){var n,r=[],t=!1,o={set:function(n,r){return t||(e[n]=r,o.register((function(){delete e[n]}))),r},register:function(e){var o=we((function(){return e(n)}));return t?e(n):r.push(o),{cancel:function(){var e=r.indexOf(o);-1!==e&&r.splice(e,1)}}},all:function(e){n=e;var o=[];for(t=!0;r.length;){var i=r.shift();o.push(i())}return w.all(o).then(pe)}};return o}function Oe(e,n){if(null==n)throw new Error("Expected "+e+" to be present");return n}le.clear=function(){fe=de},le((function(e){if(Object.values)return Object.values(e);var n=[];for(var r in e)e.hasOwnProperty(r)&&n.push(e[r]);return n}));var Ce=function(e){function n(n){var r;return(r=e.call(this,n)||this).name=r.constructor.name,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r),r.constructor):r.stack=new Error(n).stack,r}return i(n,e),n}(te(Error));function Ne(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function De(){return Boolean(document.body)&&"complete"===document.readyState}function Ae(){return Boolean(document.body)&&"interactive"===document.readyState}function Se(e){return encodeURIComponent(e)}function Re(e){return function(n,r,t){void 0===t&&(t=[]);var o=n.__inline_memoize_cache__=n.__inline_memoize_cache__||{},i=ce(t);return o.hasOwnProperty(i)?o[i]:o[i]=function(){var n={};if(!e)return n;if(-1===e.indexOf("="))return n;for(var r=0,t=e.split("&");r<t.length;r++){var o=t[r];(o=o.split("="))[0]&&o[1]&&(n[decodeURIComponent(o[0])]=decodeURIComponent(o[1]))}return n}.apply(void 0,t)}(Re,0,[e])}function We(e,n){return void 0===n&&(n={}),n&&Object.keys(n).length?(void 0===(r=a({},Re(e),n))&&(r={}),Object.keys(r).filter((function(e){return"string"==typeof r[e]||"boolean"==typeof r[e]})).map((function(e){var n=r[e];if("string"!=typeof n&&"boolean"!=typeof n)throw new TypeError("Invalid type for query");return Se(e)+"="+Se(n.toString())})).join("&")):e;var r}function je(e,n){e.appendChild(n)}function Ie(e){return e instanceof window.Element||null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument}function Me(e,n){return void 0===n&&(n=document),Ie(e)?e:"string"==typeof e?n.querySelector(e):void 0}function ke(e){return new w((function(n,r){var t=me(e),o=Me(e);if(o)return n(o);if(De())return r(new Error("Document is ready and element "+t+" does not exist"));var i=setInterval((function(){if(o=Me(e))n(o),clearInterval(i);else if(De())return clearInterval(i),r(new Error("Document is ready and element "+t+" does not exist"))}),10)}))}le((function(){return new w((function(e){if(De()||Ae())return e();var n=setInterval((function(){if(De()||Ae())return clearInterval(n),e()}),10)}))}));var ze,Fe=function(e){function n(){return e.apply(this,arguments)||this}return i(n,e),n}(Ce);function Le(e){if((ze=ze||new K).has(e)){var n=ze.get(e);if(n)return n}var r=new w((function(n,r){e.addEventListener("load",(function(){!function(e){if(function(){for(var e=0;e<j.length;e++){var n=!1;try{n=j[e].closed}catch(e){}n&&(I.splice(e,1),j.splice(e,1))}}(),e&&e.contentWindow)try{j.push(e.contentWindow),I.push(e)}catch(e){}}(e),n(e)})),e.addEventListener("error",(function(t){e.contentWindow?n(e):r(t)}))}));return ze.set(e,r),r}function Ue(e){return Le(e).then((function(e){if(!e.contentWindow)throw new Error("Could not find window in iframe");return e.contentWindow}))}function qe(e,n){void 0===e&&(e={});var r=e.style||{},t=function(e,n,r){void 0===e&&(e="div"),void 0===n&&(n={}),e=e.toLowerCase();var t,o,i,a=document.createElement(e);if(n.style&&ye(a.style,n.style),n.class&&(a.className=n.class.join(" ")),n.id&&a.setAttribute("id",n.id),n.attributes)for(var u=0,c=Object.keys(n.attributes);u<c.length;u++){var s=c[u];a.setAttribute(s,n.attributes[s])}if(n.styleSheet&&(t=a,o=n.styleSheet,void 0===i&&(i=window.document),t.styleSheet?t.styleSheet.cssText=o:t.appendChild(i.createTextNode(o))),n.html){if("iframe"===e)throw new Error("Iframe html can not be written unless container provided and iframe in DOM");a.innerHTML=n.html}return a}("iframe",{attributes:a({allowTransparency:"true"},e.attributes||{}),style:a({backgroundColor:"transparent",border:"none"},r),html:e.html,class:e.class}),o=window.navigator.userAgent.match(/MSIE|Edge/i);return t.hasAttribute("id")||t.setAttribute("id",ue()),Le(t),n&&function(e,n){void 0===n&&(n=document);var r=Me(e,n);if(r)return r;throw new Error("Can not find element: "+me(e))}(n).appendChild(t),(e.url||o)&&t.setAttribute("src",e.url||"about:blank"),t}function Be(e,n,r){return e.addEventListener(n,r),{cancel:function(){e.removeEventListener(n,r)}}}function He(e){e.style.setProperty("display","")}function Je(e){e.style.setProperty("display","none","important")}function Ye(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ve(e){return!(e&&e.parentNode&&e.ownerDocument&&e.ownerDocument.documentElement&&e.ownerDocument.documentElement.contains(e))}function Ge(e,n,r){var t=void 0===r?{}:r,o=t.width,i=void 0===o||o,a=t.height,u=void 0===a||a,c=t.interval,s=void 0===c?100:c,d=t.win,f=void 0===d?window:d,l=e.offsetWidth,h=e.offsetHeight,p=!1;n({width:l,height:h});var w,v,m=function(){if(!p&&(o=e,Boolean(o.offsetWidth||o.offsetHeight||o.getClientRects().length))){var r=e.offsetWidth,t=e.offsetHeight;(i&&r!==l||u&&t!==h)&&n({width:r,height:t}),l=r,h=t}var o};return f.addEventListener("resize",m),void 0!==f.ResizeObserver?((w=new f.ResizeObserver(m)).observe(e),v=be(m,10*s)):void 0!==f.MutationObserver?((w=new f.MutationObserver(m)).observe(e,{attributes:!0,childList:!0,subtree:!0,characterData:!1}),v=be(m,10*s)):v=be(m,s),{cancel:function(){p=!0,w.disconnect(),window.removeEventListener("resize",m),v.cancel()}}}function Xe(e){for(;e.parentNode;)e=e.parentNode;return"[object ShadowRoot]"===e.toString()}var $e="undefined"!=typeof document?document.currentScript:null,Ze=le((function(){if($e)return $e;if($e=function(){try{var e=function(){try{throw new Error("_")}catch(e){return e.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),r=n&&n[1];if(!r)return;for(var t=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();t<o.length;t++){var i=o[t];if(i.src&&i.src===r)return i}}catch(e){}}())return $e;throw new Error("Can not determine current script")})),Qe=ue();function Ke(e){return"string"==typeof e&&/^[0-9]+%$/.test(e)}function en(e){if("number"==typeof e)return e;var n=e.match(/^([0-9]+)(px|%)$/);if(!n)throw new Error("Could not match css value from "+e);return parseInt(n[1],10)}function nn(e){return en(e)+"px"}function rn(e){return"number"==typeof e?nn(e):Ke(e)?e:nn(e)}function tn(e,n){if("number"==typeof e)return e;if(Ke(e))return parseInt(n*en(e)/100,10);if("string"==typeof(r=e)&&/^[0-9]+px$/.test(r))return en(e);var r;throw new Error("Can not normalize dimension: "+e)}function on(e){void 0===e&&(e=window);var n="__post_robot_10_0_44__";return e!==window?e[n]:e[n]=e[n]||{}}le((function(){var e;try{e=Ze()}catch(e){return Qe}var n=e.getAttribute("data-uid");if(n&&"string"==typeof n)return n;if((n=e.getAttribute("data-uid-auto"))&&"string"==typeof n)return n;if(e.src){var r=function(e){for(var n="",r=0;r<e.length;r++){var t=e[r].charCodeAt(0)*r;e[r+1]&&(t+=e[r+1].charCodeAt(0)*(r-1)),n+=String.fromCharCode(97+Math.abs(t)%26)}return n}(JSON.stringify({src:e.src,dataset:e.dataset}));n="uid_"+r.slice(r.length-30)}else n=ue();return e.setAttribute("data-uid-auto",n),n}));var an=function(){return{}};function un(e,n){return void 0===e&&(e="store"),void 0===n&&(n=an),Pe(on(),e,(function(){var e=n();return{has:function(n){return e.hasOwnProperty(n)},get:function(n,r){return e.hasOwnProperty(n)?e[n]:r},set:function(n,r){return e[n]=r,r},del:function(n){delete e[n]},getOrSet:function(n,r){return Pe(e,n,r)},reset:function(){e=n()},keys:function(){return Object.keys(e)}}}))}var cn,sn=function(){};function dn(){var e=on();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new sn,e.WINDOW_WILDCARD}function fn(e,n){return void 0===e&&(e="store"),void 0===n&&(n=an),un("windowStore").getOrSet(e,(function(){var r=new K,t=function(e){return r.getOrSet(e,n)};return{has:function(n){return t(n).hasOwnProperty(e)},get:function(n,r){var o=t(n);return o.hasOwnProperty(e)?o[e]:r},set:function(n,r){return t(n)[e]=r,r},del:function(n){delete t(n)[e]},getOrSet:function(n,r){return Pe(t(n),e,r)}}}))}function ln(){return un("instance").getOrSet("instanceID",ue)}function hn(e,n){var r=n.domain,t=fn("helloPromises"),o=t.get(e);o&&o.resolve({domain:r});var i=w.resolve({domain:r});return t.set(e,i),i}function pn(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:ln()},{domain:"*",timeout:-1}).then((function(n){var r=n.origin,t=n.data.instanceID;return hn(e,{domain:r}),{win:e,domain:r,instanceID:t}}))}function wn(e,n){var r=n.send;return fn("windowInstanceIDPromises").getOrSet(e,(function(){return pn(e,{send:r}).then((function(e){return e.instanceID}))}))}function vn(e,n,r){void 0===n&&(n=5e3),void 0===r&&(r="Window");var t,o=(t=e,fn("helloPromises").getOrSet(t,(function(){return new w})));return-1!==n&&(o=o.timeout(n,new Error(r+" did not load after "+n+"ms"))),o}function mn(e){fn("knownWindows").set(e,!0)}function yn(e){return"object"==typeof e&&null!==e&&"string"==typeof e.__type__}function gn(e){return void 0===e?"undefined":null===e?"null":Array.isArray(e)?"array":"function"==typeof e?"function":"object"==typeof e?e instanceof Error?"error":"function"==typeof e.then?"promise":"[object RegExp]"==={}.toString.call(e)?"regex":"[object Date]"==={}.toString.call(e)?"date":"object":"string"==typeof e?"string":"number"==typeof e?"number":"boolean"==typeof e?"boolean":void 0}function bn(e,n){return{__type__:e,__val__:n}}var En,xn=((cn={}).function=function(){},cn.error=function(e){return bn("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},cn.promise=function(){},cn.regex=function(e){return bn("regex",e.source)},cn.date=function(e){return bn("date",e.toJSON())},cn.array=function(e){return e},cn.object=function(e){return e},cn.string=function(e){return e},cn.number=function(e){return e},cn.boolean=function(e){return e},cn.null=function(e){return e},cn[void 0]=function(e){return bn("undefined",e)},cn),_n={},Pn=((En={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},En.error=function(e){var n=e.stack,r=e.code,t=e.data,o=new Error(e.message);return o.code=r,t&&(o.data=t),o.stack=n+"\n\n"+o.stack,o},En.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},En.regex=function(e){return new RegExp(e)},En.date=function(e){return new Date(e)},En.array=function(e){return e},En.object=function(e){return e},En.string=function(e){return e},En.number=function(e){return e},En.boolean=function(e){return e},En.null=function(e){return e},En[void 0]=function(){},En),Tn={};function On(){return!!k(window).match(/MSIE|trident|edge\/12|edge\/13/i)}function Cn(e){return!B(window,e)}function Nn(e,n){if(e){if(O()!==J(e))return!0}else if(n&&!C(n))return!0;return!1}function Dn(e){var n=e.win,r=e.domain;return!(!On()||r&&!Nn(r,n)||n&&!Cn(n))}function An(e){return"__postrobot_bridge___"+(e=e||J(e)).replace(/[^a-zA-Z0-9]+/g,"_")}function Sn(){return Boolean(window.name&&window.name===An(O()))}var Rn=new w((function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval((function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)}),10)}));function Wn(e){fn("remoteWindowPromises").getOrSet(e,(function(){return new w}))}function jn(e){var n=fn("remoteWindowPromises").get(e);if(!n)throw new Error("Remote window promise not found");return n}function In(e,n,r){jn(e).resolve((function(t,o,i){if(t!==e)throw new Error("Remote window does not match window");if(!H(o,n))throw new Error("Remote domain "+o+" does not match domain "+n);r.fireAndForget(i)}))}function Mn(e,n){jn(e).reject(n).catch(pe)}function kn(e){for(var n=e.win,r=e.name,t=e.domain,o=un("popupWindowsByName"),i=fn("popupWindowsByWin"),a=0,u=o.keys();a<u.length;a++){var c=u[a],s=o.get(c);s&&!M(s.win)||o.del(c)}if(M(n))return{win:n,name:r,domain:t};var d=i.getOrSet(n,(function(){return r?o.getOrSet(r,(function(){return{win:n,name:r}})):{win:n}}));if(d.win&&d.win!==n)throw new Error("Different window already linked for window: "+(r||"undefined"));return r&&(d.name=r,o.set(r,d)),t&&(d.domain=t,Wn(n)),i.set(n,d),d}function zn(e){var n,r,t,o,i,a,u=e.on,c=e.send,s=e.receiveMessage;n=window.open,window.open=function(e,r,t,o){var i=n.call(this,G(e),r,t,o);return i?(kn({win:i,name:r,domain:e?J(e):null}),i):i},t=(r={on:u,send:c,receiveMessage:s}).on,o=r.send,i=r.receiveMessage,a=un("popupWindowsByName"),t("postrobot_open_tunnel",(function(e){var n=e.source,r=e.origin,u=e.data,c=un("bridges").get(r);if(!c)throw new Error("Can not find bridge promise for domain "+r);return c.then((function(e){if(n!==e)throw new Error("Message source does not matched registered bridge for domain "+r);if(!u.name)throw new Error("Register window expected to be passed window name");if(!u.sendMessage)throw new Error("Register window expected to be passed sendMessage method");if(!a.has(u.name))throw new Error("Window with name "+u.name+" does not exist, or was not opened by this window");var c=function(){return a.get(u.name)};if(!c().domain)throw new Error("We do not have a registered domain for window "+u.name);if(c().domain!==r)throw new Error("Message origin "+r+" does not matched registered window origin "+(c().domain||"unknown"));return In(c().win,r,u.sendMessage),{sendMessage:function(e){if(window&&!window.closed&&c()){var n=c().domain;if(n)try{i({data:e,origin:n,source:c().win},{on:t,send:o})}catch(e){w.reject(e)}}}}}))})),function(e){var n=e.send;on(window).openTunnelToParent=function(e){var r=e.name,t=e.source,o=e.canary,i=e.sendMessage,a=un("tunnelWindows"),u=x(window);if(!u)throw new Error("No parent window found to open tunnel to");var c=function(e){var n=e.name,r=e.source,t=e.canary,o=e.sendMessage;!function(){for(var e=un("tunnelWindows"),n=0,r=e.keys();n<r.length;n++){var t=r[n];M(e[t].source)&&e.del(t)}}();var i=ue();return un("tunnelWindows").set(i,{name:n,source:r,canary:t,sendMessage:o}),i}({name:r,source:t,canary:o,sendMessage:i});return n(u,"postrobot_open_tunnel",{name:r,sendMessage:function(){var e=a.get(c);if(e&&e.source&&!M(e.source)){try{e.canary()}catch(e){return}e.sendMessage.apply(this,arguments)}}},{domain:"*"})}}({send:c}),function(e){var n=e.on,r=e.send,t=e.receiveMessage;w.try((function(){var e,o=_(window);if(o&&Dn({win:o}))return Wn(o),(e=o,fn("remoteBridgeAwaiters").getOrSet(e,(function(){return w.try((function(){var n=z(e,An(O()));if(n)return C(n)&&on(N(n))?n:new w((function(e){var r,t;r=setInterval((function(){if(n&&C(n)&&on(N(n)))return clearInterval(r),clearTimeout(t),e(n)}),100),t=setTimeout((function(){return clearInterval(r),e()}),2e3)}))}))}))).then((function(e){return e?window.name?on(N(e)).openTunnelToParent({name:window.name,source:window,canary:function(){},sendMessage:function(e){if(window&&!window.closed)try{t({data:e,origin:this.origin,source:this.source},{on:n,send:r})}catch(e){w.reject(e)}}}).then((function(e){var n=e.source,r=e.origin,t=e.data;if(n!==o)throw new Error("Source does not match opener");In(n,r,t.sendMessage)})).catch((function(e){throw Mn(o,e),e})):Mn(o,new Error("Can not register with opener: window does not have a name")):Mn(o,new Error("Can not register with opener: no bridge found in opener"))}))}))}({on:u,send:c,receiveMessage:s})}function Fn(){for(var e=un("idToProxyWindow"),n=0,r=e.keys();n<r.length;n++){var t=r[n];e.get(t).shouldClean()&&e.del(t)}}function Ln(e,n){var r=n.send,t=n.id,o=void 0===t?ue():t,i=e.then((function(e){if(C(e))return N(e).name})),a=e.then((function(e){if(M(e))throw new Error("Window is closed, can not determine type");return _(e)?m.POPUP:m.IFRAME}));i.catch(pe),a.catch(pe);var u=function(){return e.then((function(e){if(!M(e))return C(e)?N(e).name:i}))};return{id:o,getType:function(){return a},getInstanceID:he((function(){return e.then((function(e){return wn(e,{send:r})}))})),close:function(){return e.then($)},getName:u,focus:function(){return e.then((function(e){e.focus()}))},isClosed:function(){return e.then((function(e){return M(e)}))},setLocation:function(n,r){return void 0===r&&(r={}),e.then((function(e){var t=window.location.protocol+"//"+window.location.host,o=r.method,i=void 0===o?"get":o,a=r.body;if(0===n.indexOf("/"))n=""+t+n;else if(!n.match(/^https?:\/\//)&&0!==n.indexOf(t))throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(n));if("post"===i)return u().then((function(e){if(!e)throw new Error("Can not post to window without target name");!function(e){var n=e.url,r=e.target,t=e.body,o=e.method,i=void 0===o?"post":o,a=document.createElement("form");if(a.setAttribute("target",r),a.setAttribute("method",i),a.setAttribute("action",n),a.style.display="none",t)for(var u=0,c=Object.keys(t);u<c.length;u++){var s,d=c[u],f=document.createElement("input");f.setAttribute("name",d),f.setAttribute("value",null==(s=t[d])?void 0:s.toString()),a.appendChild(f)}Ne().appendChild(a),a.submit(),Ne().removeChild(a)}({url:n,target:e,method:i,body:a})}));if("get"!==i)throw new Error("Unsupported method: "+i);if(C(e))try{if(e.location&&"function"==typeof e.location.replace)return void e.location.replace(n)}catch(e){}e.location=n}))},setName:function(n){return e.then((function(e){kn({win:e,name:n});var r=C(e),t=X(e);if(!r)throw new Error("Can not set name for cross-domain window: "+n);N(e).name=n,t&&t.setAttribute("name",n),i=w.resolve(n)}))}}}var Un=function(){function e(e){var n=e.send,r=e.win,t=e.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 w,this.serializedWindow=t||Ln(this.actualWindowPromise,{send:n}),un("idToProxyWindow").set(this.getID(),this),r&&this.setWindow(r,{send:n})}var n=e.prototype;return n.getID=function(){return this.serializedWindow.id},n.getType=function(){return this.serializedWindow.getType()},n.isPopup=function(){return this.getType().then((function(e){return e===m.POPUP}))},n.setLocation=function(e,n){var r=this;return this.serializedWindow.setLocation(e,n).then((function(){return r}))},n.getName=function(){return this.serializedWindow.getName()},n.setName=function(e){var n=this;return this.serializedWindow.setName(e).then((function(){return n}))},n.close=function(){var e=this;return this.serializedWindow.close().then((function(){return e}))},n.focus=function(){var e=this,n=this.isPopup(),r=this.getName(),t=w.hash({isPopup:n,name:r}).then((function(e){var n=e.name;e.isPopup&&n&&window.open("",n)})),o=this.serializedWindow.focus();return w.all([t,o]).then((function(){return e}))},n.isClosed=function(){return this.serializedWindow.isClosed()},n.getWindow=function(){return this.actualWindow},n.setWindow=function(e,n){var r=n.send;this.actualWindow=e,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=Ln(this.actualWindowPromise,{send:r,id:this.getID()}),fn("winToProxyWindow").set(e,this)},n.awaitWindow=function(){return this.actualWindowPromise},n.matchWindow=function(e,n){var r=this,t=n.send;return w.try((function(){return r.actualWindow?e===r.actualWindow:w.hash({proxyInstanceID:r.getInstanceID(),knownWindowInstanceID:wn(e,{send:t})}).then((function(n){var o=n.proxyInstanceID===n.knownWindowInstanceID;return o&&r.setWindow(e,{send:t}),o}))}))},n.unwrap=function(){return this.actualWindow||this},n.getInstanceID=function(){return this.serializedWindow.getInstanceID()},n.shouldClean=function(){return Boolean(this.actualWindow&&M(this.actualWindow))},n.serialize=function(){return this.serializedWindow},e.unwrap=function(n){return e.isProxyWindow(n)?n.unwrap():n},e.serialize=function(n,r){var t=r.send;return Fn(),e.toProxyWindow(n,{send:t}).serialize()},e.deserialize=function(n,r){var t=r.send;return Fn(),un("idToProxyWindow").get(n.id)||new e({serializedWindow:n,send:t})},e.isProxyWindow=function(e){return Boolean(e&&!V(e)&&e.isProxyWindow)},e.toProxyWindow=function(n,r){var t=r.send;if(Fn(),e.isProxyWindow(n))return n;var o=n;return fn("winToProxyWindow").get(o)||new e({win:o,send:t})},e}();function qn(e,n,r,t,o){var i=fn("methodStore"),a=un("proxyWindowMethods");Un.isProxyWindow(t)?a.set(e,{val:n,name:r,domain:o,source:t}):(a.del(e),i.getOrSet(t,(function(){return{}}))[e]={domain:o,name:r,val:n,source:t})}function Bn(e,n){var r=fn("methodStore"),t=un("proxyWindowMethods");return r.getOrSet(e,(function(){return{}}))[n]||t.get(n)}function Hn(e,n,r,t,o){var i,a,u;a=(i={on:o.on,send:o.send}).on,u=i.send,un("builtinListeners").getOrSet("functionCalls",(function(){return a("postrobot_method",{domain:"*"},(function(e){var n=e.source,r=e.origin,t=e.data,o=t.id,i=t.name,a=Bn(n,o);if(!a)throw new Error("Could not find method '"+i+"' with id: "+t.id+" in "+O(window));var c=a.source,s=a.domain,d=a.val;return w.try((function(){if(!H(s,r))throw new Error("Method '"+t.name+"' domain "+JSON.stringify(_e(a.domain)?a.domain.source:a.domain)+" does not match origin "+r+" in "+O(window));if(Un.isProxyWindow(c))return c.matchWindow(n,{send:u}).then((function(e){if(!e)throw new Error("Method call '"+t.name+"' failed - proxy window does not match source in "+O(window))}))})).then((function(){return d.apply({source:n,origin:r},t.args)}),(function(e){return w.try((function(){if(d.onError)return d.onError(e)})).then((function(){var n;throw e.stack&&(e.stack="Remote call to "+i+"("+(void 0===(n=t.args)&&(n=[]),Ee(n).map((function(e){return"string"==typeof e?"'"+e+"'":void 0===e?"undefined":null===e?"null":"boolean"==typeof e?e.toString():Array.isArray(e)?"[ ... ]":"object"==typeof e?"{ ... }":"function"==typeof e?"() => { ... }":"<"+typeof e+">"})).join(", ")+") failed\n\n")+e.stack),e}))})).then((function(e){return{result:e,id:o,name:i}}))}))}));var c=r.__id__||ue();e=Un.unwrap(e);var s=r.__name__||r.name||t;return"string"==typeof s&&"function"==typeof s.indexOf&&0===s.indexOf("anonymous::")&&(s=s.replace("anonymous::",t+"::")),Un.isProxyWindow(e)?(qn(c,r,s,e,n),e.awaitWindow().then((function(e){qn(c,r,s,e,n)}))):qn(c,r,s,e,n),bn("cross_domain_function",{id:c,name:s})}function Jn(e,n,r,t){var o,i=t.on,a=t.send;return function(e,n){void 0===n&&(n=_n);var r=JSON.stringify(e,(function(e){var r=this[e];if(yn(this))return r;var t=gn(r);if(!t)return r;var o=n[t]||xn[t];return o?o(r,e):r}));return void 0===r?"undefined":r}(r,((o={}).promise=function(r,t){return o=r,bn("cross_domain_zalgo_promise",{then:Hn(e,n,(function(e,n){return o.then(e,n)}),t,{on:(u={on:i,send:a}).on,send:u.send})});var o,u},o.function=function(r,t){return Hn(e,n,r,t,{on:i,send:a})},o.object=function(e){return V(e)||Un.isProxyWindow(e)?bn("cross_domain_window",Un.serialize(e,{send:a})):e},o))}function Yn(e,n,r,t){var o,i=t.send;return function(e,n){if(void 0===n&&(n=Tn),"undefined"!==e)return JSON.parse(e,(function(e,r){if(yn(this))return r;var t,o;if(yn(r)?(t=r.__type__,o=r.__val__):(t=gn(r),o=r),!t)return o;var i=n[t]||Pn[t];return i?i(o,e):o}))}(r,((o={}).cross_domain_zalgo_promise=function(e){return new w(e.then)},o.cross_domain_function=function(r){return t=e,o=n,u={send:i},c=(a=r).id,s=a.name,d=u.send,f=function(e){function n(){var r=arguments;return Un.toProxyWindow(t,{send:d}).awaitWindow().then((function(t){var i=Bn(t,c);if(i&&i.val!==n)return i.val.apply({source:window,origin:O()},r);var a=[].slice.call(r);return e.fireAndForget?d(t,"postrobot_method",{id:c,name:s,args:a},{domain:o,fireAndForget:!0}):d(t,"postrobot_method",{id:c,name:s,args:a},{domain:o,fireAndForget:!1}).then((function(e){return e.data.result}))})).catch((function(e){throw e}))}return void 0===e&&(e={}),n.__name__=s,n.__origin__=o,n.__source__=t,n.__id__=c,n.origin=o,n},(l=f()).fireAndForget=f({fireAndForget:!0}),l;var t,o,a,u,c,s,d,f,l},o.cross_domain_window=function(e){return Un.deserialize(e,{send:i})},o))}var Vn={};function Gn(e,n,r,t){var o=t.on,i=t.send;return w.try((function(){var t=fn().getOrSet(e,(function(){return{}}));return t.buffer=t.buffer||[],t.buffer.push(r),t.flush=t.flush||w.flush().then((function(){if(M(e))throw new Error("Window is closed");var r,a=Jn(e,n,((r={}).__post_robot_10_0_44__=t.buffer||[],r),{on:o,send:i});delete t.buffer;for(var u=Object.keys(Vn),c=[],s=0;s<u.length;s++){var d=u[s];try{Vn[d](e,a,n)}catch(e){c.push(e)}}if(c.length===u.length)throw new Error("All post-robot messaging strategies failed:\n\n"+c.map((function(e,n){return n+". "+ve(e)})).join("\n\n"))})),t.flush.then((function(){delete t.flush}))})).then(pe)}function Xn(e){return un("responseListeners").get(e)}function $n(e){un("responseListeners").del(e)}function Zn(e){return un("erroredResponseListeners").has(e)}function Qn(e){var n=e.name,r=e.win,t=e.domain,o=fn("requestListeners");if("*"===r&&(r=null),"*"===t&&(t=null),!n)throw new Error("Name required to get request listener");for(var i=0,a=[r,dn()];i<a.length;i++){var u=a[i];if(u){var c=o.get(u);if(c){var s=c[n];if(s){if(t&&"string"==typeof t){if(s[t])return s[t];if(s.__domain_regex__)for(var d=0,f=s.__domain_regex__;d<f.length;d++){var l=f[d],h=l.listener;if(H(l.regex,t))return h}}if(s["*"])return s["*"]}}}}}function Kn(e,n,r,t){var o=t.on,i=t.send,a=Qn({name:r.name,win:e,domain:n}),u="postrobot_method"===r.name&&r.data&&"string"==typeof r.data.name?r.data.name+"()":r.name;function c(t,a,c){return w.flush().then((function(){if(!r.fireAndForget&&!M(e))try{return Gn(e,n,{id:ue(),origin:O(window),type:"postrobot_message_response",hash:r.hash,name:r.name,ack:t,data:a,error:c},{on:o,send:i})}catch(e){throw new Error("Send response message failed for "+u+" in "+O()+"\n\n"+ve(e))}}))}return w.all([w.flush().then((function(){if(!r.fireAndForget&&!M(e))try{return Gn(e,n,{id:ue(),origin:O(window),type:"postrobot_message_ack",hash:r.hash,name:r.name},{on:o,send:i})}catch(e){throw new Error("Send ack message failed for "+u+" in "+O()+"\n\n"+ve(e))}})),w.try((function(){if(!a)throw new Error("No handler found for post message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!H(a.domain,n))throw new Error("Request origin "+n+" does not match domain "+a.domain.toString());return a.handler({source:e,origin:n,data:r.data})})).then((function(e){return c("success",e)}),(function(e){return c("error",null,e)}))]).then(pe).catch((function(e){if(a&&a.handleError)return a.handleError(e);throw e}))}function er(e,n,r){if(!Zn(r.hash)){var t=Xn(r.hash);if(!t)throw new Error("No handler found for post message ack for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!H(t.domain,n))throw new Error("Ack origin "+n+" does not match domain "+t.domain.toString());if(e!==t.win)throw new Error("Ack source does not match registered window")}catch(e){t.promise.reject(e)}t.ack=!0}}function nr(e,n,r){if(!Zn(r.hash)){var t,o=Xn(r.hash);if(!o)throw new Error("No handler found for post message response for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!H(o.domain,n))throw new Error("Response origin "+n+" does not match domain "+(t=o.domain,Array.isArray(t)?"("+t.join(" | ")+")":v(t)?"RegExp("+t.toString()+")":t.toString()));if(e!==o.win)throw new Error("Response source does not match registered window");$n(r.hash),"error"===r.ack?o.promise.reject(r.error):"success"===r.ack&&o.promise.resolve({source:e,origin:n,data:r.data})}}function rr(e,n){var r=n.on,t=n.send,o=un("receivedMessages");try{if(!window||window.closed||!e.source)return}catch(e){return}var i=e.source,a=e.origin,u=function(e,n,r,t){var o,i=t.on,a=t.send;try{o=Yn(n,r,e,{on:i,send:a})}catch(e){return}if(o&&"object"==typeof o&&null!==o){var u=o.__post_robot_10_0_44__;if(Array.isArray(u))return u}}(e.data,i,a,{on:r,send:t});if(u){mn(i);for(var c=0;c<u.length;c++){var s=u[c];if(o.has(s.id))return;if(o.set(s.id,!0),M(i)&&!s.fireAndForget)return;0===s.origin.indexOf("file:")&&(a="file://");try{"postrobot_message_request"===s.type?Kn(i,a,s,{on:r,send:t}):"postrobot_message_response"===s.type?nr(i,a,s):"postrobot_message_ack"===s.type&&er(i,a,s)}catch(e){setTimeout((function(){throw e}),0)}}}}function tr(e,n,r){if(!e)throw new Error("Expected name");if("function"==typeof(n=n||{})&&(r=n,n={}),!r)throw new Error("Expected handler");(n=n||{}).name=e,n.handler=r||n.handler;var t=n.window,o=n.domain,i=function e(n,r){var t=n.name,o=n.win,i=n.domain,a=fn("requestListeners");if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var u=[],c=0,s=o;c<s.length;c++)u.push(e({name:t,domain:i,win:s[c]},r));return{cancel:function(){for(var e=0;e<u.length;e++)u[e].cancel()}}}if(Array.isArray(i)){for(var d=[],f=0,l=i;f<l.length;f++)d.push(e({name:t,win:o,domain:l[f]},r));return{cancel:function(){for(var e=0;e<d.length;e++)d[e].cancel()}}}var h=Qn({name:t,win:o,domain:i});if(o&&"*"!==o||(o=dn()),i=i||"*",h)throw o&&i?new Error("Request listener already exists for "+t+" on domain "+i.toString()+" for "+(o===dn()?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+t+" for "+(o===dn()?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" on domain "+i.toString()):new Error("Request listener already exists for "+t);var p,w,v=a.getOrSet(o,(function(){return{}})),m=Pe(v,t,(function(){return{}})),y=i.toString();return _e(i)?(p=Pe(m,"__domain_regex__",(function(){return[]}))).push(w={regex:i,listener:r}):m[y]=r,{cancel:function(){delete m[y],w&&(p.splice(p.indexOf(w,1)),p.length||delete m.__domain_regex__),Object.keys(m).length||delete v[t],o&&!Object.keys(v).length&&a.del(o)}}}({name:e,win:t,domain:o},{handler:n.handler,handleError:n.errorHandler||function(e){throw e},window:t,domain:o||"*",name:e});return{cancel:function(){i.cancel()}}}Vn.postrobot_post_message=function(e,n,r){0===r.indexOf("file:")&&(r="*"),e.postMessage(n,r)},Vn.postrobot_bridge=function(e,n,r){if(!On()&&!Sn())throw new Error("Bridge not needed for browser");if(C(e))throw new Error("Post message through bridge disabled between same domain windows");if(!1!==B(window,e))throw new Error("Can only use bridge to communicate between two different windows, not between frames");!function(e,n,r){var t=F(window,e),o=F(e,window);if(!t&&!o)throw new Error("Can only send messages to and from parent and popup windows");jn(e).then((function(t){return t(e,n,r)}))}(e,r,n)},Vn.postrobot_global=function(e,n){if(!k(window).match(/MSIE|rv:11|trident|edge\/12|edge\/13/i))throw new Error("Global messaging not needed for browser");if(!C(e))throw new Error("Post message through global disabled between different domain windows");if(!1!==B(window,e))throw new Error("Can only use global to communicate between two different windows, not between frames");var r=on(e);if(!r)throw new Error("Can not find postRobot global on foreign window");r.receiveMessage({source:window,origin:O(),data:n})};var or,ir=function e(n,r,t,o){var i=(o=o||{}).domain||"*",a=o.timeout||-1,u=o.timeout||5e3,c=o.fireAndForget||!1;return w.try((function(){if(function(e,n,r){if(!e)throw new Error("Expected name");if(r&&"string"!=typeof r&&!Array.isArray(r)&&!_e(r))throw new TypeError("Can not send "+e+". Expected domain "+JSON.stringify(r)+" to be a string, array, or regex");if(M(n))throw new Error("Can not send "+e+". Target window is closed")}(r,n,i),function(e,n){var r=L(n);if(r)return r===e;if(n===e)return!1;if(R(n)===n)return!1;for(var t=0,o=A(e);t<o.length;t++)if(o[t]===n)return!0;return!1}(window,n))return vn(n,u)})).then((function(r){return t=n,o=i,a=(void 0===r?{}:r).domain,u={send:e}.send,w.try((function(){return"string"==typeof o?o:w.try((function(){return a||pn(t,{send:u}).then((function(e){return e.domain}))})).then((function(e){if(!H(o,o))throw new Error("Domain "+me(o)+" does not match "+me(o));return e}))}));var t,o,a,u})).then((function(o){var i,u,s,d=o,f="postrobot_method"===r&&t&&"string"==typeof t.name?t.name+"()":r,l=new w,h=r+"_"+ue();if(!c){var p={name:r,win:n,domain:d,promise:l};u=h,s=p,un("responseListeners").set(u,s);var v=fn("requestPromises").getOrSet(n,(function(){return[]}));v.push(l),l.catch((function(){!function(e){un("erroredResponseListeners").set(e,!0)}(h),$n(h)}));var m=(i=n,fn("knownWindows").get(i,!1)?1e4:2e3),y=a,g=m,b=y,E=be((function(){return M(n)?l.reject(new Error("Window closed for "+r+" before "+(p.ack?"response":"ack"))):p.cancelled?l.reject(new Error("Response listener was cancelled for "+r)):(g=Math.max(g-500,0),-1!==b&&(b=Math.max(b-500,0)),p.ack||0!==g?0===b?l.reject(new Error("No response for postMessage "+f+" in "+O()+" in "+y+"ms")):void 0:l.reject(new Error("No ack for postMessage "+f+" in "+O()+" in "+m+"ms")))}),500);l.finally((function(){E.cancel(),v.splice(v.indexOf(l,1))})).catch(pe)}return Gn(n,d,{id:ue(),origin:O(window),type:"postrobot_message_request",hash:h,name:r,data:t,fireAndForget:c},{on:tr,send:e}).then((function(){return c?l.resolve():l}),(function(e){throw new Error("Send request message failed for "+f+" in "+O()+"\n\n"+ve(e))}))}))};function ar(e){return Un.toProxyWindow(e,{send:ir})}function ur(e){for(var n=0,r=fn("requestPromises").get(e,[]);n<r.length;n++)r[n].reject(new Error("Window "+(M(e)?"closed":"cleaned up")+" before response")).catch(pe)}function cr(e){if(!C(e))throw new Error("Can not get global for window on different domain");return e.__zoid_9_0_86__||(e.__zoid_9_0_86__={}),e.__zoid_9_0_86__}function sr(e,n){try{return n(cr(e))}catch(e){}}function dr(e){return{get:function(){var n=this;return w.try((function(){if(n.source&&n.source!==window)throw new Error("Can not call get on proxy object from a remote window");return e}))}}}function fr(e){return ae(JSON.stringify(e))}function lr(e){var n=cr(e);return n.references=n.references||{},n.references}function hr(e){var n,r,t=e.data,o=e.metaData,i=e.sender,a=e.receiver,u=e.passByReference,c=void 0!==u&&u,s=e.basic,d=void 0!==s&&s,f=ar(a.win),l=d?JSON.stringify(t):Jn(f,a.domain,t,{on:tr,send:ir}),h=c?(n=l,r=ue(),lr(window)[r]=n,{type:"uid",uid:r}):{type:"raw",val:l};return{serializedData:fr({sender:{domain:i.domain},metaData:o,reference:h}),cleanReference:function(){var e,n;e=window,"uid"===(n=h).type&&delete lr(e)[n.uid]}}}function pr(e){var n,t,o,i=e.sender,a=e.basic,u=void 0!==a&&a,c=(n=e.data,JSON.parse(function(e){if("function"==typeof atob)return decodeURIComponent([].map.call(atob(e),(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));if(void 0!==r)return r.from(e,"base64").toString("utf8");throw new Error("Can not find window.atob or Buffer")}(n))),s=c.reference,d=c.metaData;t="function"==typeof i.win?i.win({metaData:d}):i.win,o="function"==typeof i.domain?i.domain({metaData:d}):"string"==typeof i.domain?i.domain:c.sender.domain;var f,l,h,p=function(e,n){if("raw"===n.type)return n.val;if("uid"===n.type)return lr(e)[n.uid];throw new Error("Unsupported ref type: "+n.type)}(t,s);return{data:u?JSON.parse(p):(f=t,l=o,h=p,Yn(f,l,h,{on:tr,send:ir})),metaData:d,sender:{win:t,domain:o},reference:s}}or={setupBridge:zn,openBridge:function(e,n){var r=un("bridges"),t=un("bridgeFrames");return n=n||J(e),r.getOrSet(n,(function(){return w.try((function(){if(O()===n)throw new Error("Can not open bridge on the same domain as current domain: "+n);var r=An(n);if(z(window,r))throw new Error("Frame with name "+r+" already exists on page");var o,i,a,u=(o=r,i=e,(a=document.createElement("iframe")).setAttribute("name",o),a.setAttribute("id",o),a.setAttribute("style","display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"),a.setAttribute("frameborder","0"),a.setAttribute("border","0"),a.setAttribute("scrolling","no"),a.setAttribute("allowTransparency","true"),a.setAttribute("tabindex","-1"),a.setAttribute("hidden","true"),a.setAttribute("title",""),a.setAttribute("role","presentation"),a.src=i,a);return t.set(n,u),Rn.then((function(n){n.appendChild(u);var r=u.contentWindow;return new w((function(e,n){u.addEventListener("load",e),u.addEventListener("error",n)})).then((function(){return vn(r,5e3,"Bridge "+e)})).then((function(){return r}))}))}))}))},linkWindow:kn,linkUrl:function(e,n){kn({win:e,domain:J(n)})},isBridge:Sn,needsBridge:Dn,needsBridgeForBrowser:On,hasBridge:function(e,n){return un("bridges").has(n||J(e))},needsBridgeForWin:Cn,needsBridgeForDomain:Nn,destroyBridges:function(){for(var e=un("bridges"),n=un("bridgeFrames"),r=0,t=n.keys();r<t.length;r++){var o=n.get(t[r]);o&&o.parentNode&&o.parentNode.removeChild(o)}n.reset(),e.reset()}};var wr={STRING:"string",OBJECT:"object",FUNCTION:"function",BOOLEAN:"boolean",NUMBER:"number",ARRAY:"array"},vr={JSON:"json",DOTIFY:"dotify",BASE64:"base64"},mr=m,yr={RENDER:"zoid-render",RENDERED:"zoid-rendered",DISPLAY:"zoid-display",ERROR:"zoid-error",CLOSE:"zoid-close",DESTROY:"zoid-destroy",PROPS:"zoid-props",RESIZE:"zoid-resize",FOCUS:"zoid-focus"};function gr(e){return"__zoid__"+e.name+"__"+e.serializedPayload+"__"}function br(e){if(!e)throw new Error("No window name");var n=e.split("__"),r=n[1],t=n[2],o=n[3];if("zoid"!==r)throw new Error("Window not rendered by zoid - got "+r);if(!t)throw new Error("Expected component name");if(!o)throw new Error("Expected serialized payload ref");return{name:t,serializedInitialPayload:o}}var Er=le((function(e){var n=pr({data:br(e).serializedInitialPayload,sender:{win:function(e){return function(e){if("opener"===e.type)return Oe("opener",_(window));if("parent"===e.type&&"number"==typeof e.distance)return Oe("parent",(n=window,void 0===(r=e.distance)&&(r=1),function(e,n){void 0===n&&(n=1);for(var r=e,t=0;t<n;t++){if(!r)return;r=x(r)}return r}(n,q(n)-r)));var n,r,t,o;if("global"===e.type&&e.uid&&"string"==typeof e.uid){var i=function(){var n=e.uid,r=L(window);if(!r)throw new Error("Can not find ancestor window");for(var t=0,o=W(r);t<o.length;t++){var i=o[t];if(C(i)){var a=sr(i,(function(e){return e.windows&&e.windows[n]}));if(a)return{v:a}}}}();if("object"==typeof i)return i.v}else if("name"===e.type){var a=e.name;return Oe("namedWindow",z(t=Oe("ancestor",L(window)),o=a)||function e(n,r){var t=z(n,r);if(t)return t;for(var o=0,i=A(n);o<i.length;o++){var a=e(i[o],r);if(a)return a}}(R(t)||t,o))}throw new Error("Unable to find "+e.type+" parent component window")}(e.metaData.windowRef)}}});return{parent:n.sender,payload:n.data,reference:n.reference}}));function xr(){return Er(window.name)}function _r(e,n){if(void 0===n&&(n=window),e===x(n))return{type:"parent",distance:q(e)};if(e===_(n))return{type:"opener"};if(C(e)&&(t=e)!==R(t)){var r=N(e).name;if(r)return{type:"name",name:r}}var t}function Pr(e,n,r,t,o){if(!e.hasOwnProperty(r))return t;var i=e[r];return"function"==typeof i.childDecorate?i.childDecorate({value:t,uid:o.uid,tag:o.tag,close:o.close,focus:o.focus,onError:o.onError,onProps:o.onProps,resize:o.resize,getParent:o.getParent,getParentDomain:o.getParentDomain,show:o.show,hide:o.hide,export:o.export,getSiblings:o.getSiblings}):t}function Tr(){return w.try((function(){window.focus()}))}function Or(){return w.try((function(){window.close()}))}var Cr=function(){return pe},Nr=function(e){return we(e.value)};function Dr(e,n,r){for(var t=0,o=Object.keys(a({},e,n));t<o.length;t++){var i=o[t];r(i,n[i],e[i])}}function Ar(e,n,r){var t,o,i,a={};return w.all((t=n,o=e,i=[],Dr(t,o,(function(e,n,t){var o,u,c,s=(o=e,u=n,c=t,w.resolve().then((function(){var e,n;if(null!=c&&u){var t=(e={},e.get=u.queryParam,e.post=u.bodyParam,e)[r],i=(n={},n.get=u.queryValue,n.post=u.bodyValue,n)[r];if(t)return w.hash({finalParam:w.try((function(){return"function"==typeof t?t({value:c}):"string"==typeof t?t:o})),finalValue:w.try((function(){return"function"==typeof i&&xe(c)?i({value:c}):c}))}).then((function(e){var n,r=e.finalParam,t=e.finalValue;if("boolean"==typeof t)n=t.toString();else if("string"==typeof t)n=t.toString();else if("object"==typeof t&&null!==t){if(u.serialization===vr.JSON)n=JSON.stringify(t);else if(u.serialization===vr.BASE64)n=ae(JSON.stringify(t));else if(u.serialization===vr.DOTIFY||!u.serialization){n=function e(n,r,t){for(var o in void 0===r&&(r=""),void 0===t&&(t={}),r=r?r+".":r,n)n.hasOwnProperty(o)&&null!=n[o]&&"function"!=typeof n[o]&&(n[o]&&Array.isArray(n[o])&&n[o].length&&n[o].every((function(e){return"object"!=typeof e}))?t[""+r+o+"[]"]=n[o].join(","):n[o]&&"object"==typeof n[o]?t=e(n[o],""+r+o,t):t[""+r+o]=n[o].toString());return t}(t,o);for(var i=0,c=Object.keys(n);i<c.length;i++){var s=c[i];a[s]=n[s]}return}}else"number"==typeof t&&(n=t.toString());a[r]=n}))}})));i.push(s)})),i)).then((function(){return a}))}function Sr(e){var n,r,t,o,i,u,c,s,d=e.uid,f=e.options,l=e.overrides,h=void 0===l?{}:l,p=e.parentWin,v=void 0===p?window:p,m=f.propsDef,y=f.containerTemplate,g=f.prerenderTemplate,b=f.tag,E=f.name,x=f.attributes,_=f.dimensions,P=f.autoResize,T=f.url,D=f.domain,A=f.exports,S=new w,R=[],W=Te(),j={},I={},k={visible:!0},z=h.event?h.event:(n={},r={},t={on:function(e,n){var t=r[e]=r[e]||[];t.push(n);var o=!1;return{cancel:function(){o||(o=!0,t.splice(t.indexOf(n),1))}}},once:function(e,n){var r=t.on(e,(function(){r.cancel(),n()}));return r},trigger:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];var i=r[e],a=[];if(i)for(var u=function(e){var n=i[e];a.push(w.try((function(){return n.apply(void 0,t)})))},c=0;c<i.length;c++)u(c);return w.all(a).then(pe)},triggerOnce:function(e){if(n[e])return w.resolve();n[e]=!0;for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.trigger.apply(t,[e].concat(o))},reset:function(){r={}}}),F=h.props?h.props:{},U=h.onError,V=h.getProxyContainer,X=h.show,Z=h.hide,Q=h.close,K=h.renderContainer,ee=h.getProxyWindow,ne=h.setProxyWin,re=h.openFrame,te=h.openPrerenderFrame,oe=h.prerender,ie=h.open,ae=h.openPrerender,ce=h.watchForUnload,se=h.getInternalState,de=h.setInternalState,fe=function(){return"function"==typeof _?_({props:F}):_},he=function(){return w.try((function(){return h.resolveInitPromise?h.resolveInitPromise():S.resolve()}))},ge=function(e){return w.try((function(){return h.rejectInitPromise?h.rejectInitPromise(e):S.reject(e)}))},_e=function(e){for(var n={},r=0,t=Object.keys(F);r<t.length;r++){var o=t[r],i=m[o];i&&!1===i.sendToChild||i&&i.sameDomain&&!H(e,O(window))||(n[o]=F[o])}return w.hash(n)},Pe=function(){return w.try((function(){return se?se():k}))},Oe=function(e){return w.try((function(){return de?de(e):k=a({},k,e)}))},Ce=function(){return ee?ee():w.try((function(){var e=F.window;if(e){var n=ar(e);return W.register((function(){return e.close()})),n}return new Un({send:ir})}))},Ne=function(e){return ne?ne(e):w.try((function(){o=e}))},De=function(){return X?X():w.hash({setState:Oe({visible:!0}),showElement:i?i.get().then(He):null}).then(pe)},Ae=function(){return Z?Z():w.hash({setState:Oe({visible:!1}),showElement:i?i.get().then(Je):null}).then(pe)},Se=function(){return"function"==typeof T?T({props:F}):T},Re=function(){return"function"==typeof x?x({props:F}):x},Ie=function(){return J(Se())},ze=function(e,n){var r=n.windowName;return re?re(e,{windowName:r}):w.try((function(){if(e===mr.IFRAME)return dr(qe({attributes:a({name:r,title:E},Re().iframe)}))}))},Le=function(e){return te?te(e):w.try((function(){if(e===mr.IFRAME)return dr(qe({attributes:a({name:"__zoid_prerender_frame__"+E+"_"+ue()+"__",title:"prerender__"+E},Re().iframe)}))}))},$e=function(e,n,r){return ae?ae(e,n,r):w.try((function(){if(e===mr.IFRAME){if(!r)throw new Error("Expected proxy frame to be passed");return r.get().then((function(e){return W.register((function(){return Ye(e)})),Ue(e).then((function(e){return N(e)})).then((function(e){return ar(e)}))}))}if(e===mr.POPUP)return n;throw new Error("No render context available for "+e)}))},Ze=function(){return w.try((function(){if(o)return w.all([z.trigger(yr.FOCUS),o.focus()]).then(pe)}))},Qe=function(){var e=cr(window);return e.windows=e.windows||{},e.windows[d]=window,W.register((function(){delete e.windows[d]})),d},Ke=function(e,n,r,t){if(n===O(window))return{type:"global",uid:Qe()};if(e!==window)throw new Error("Can not construct cross-domain window reference for different target window");if(F.window){var o=t.getWindow();if(!o)throw new Error("Can not construct cross-domain window reference for lazy window prop");if(L(o)!==window)throw new Error("Can not construct cross-domain window reference for window prop with different ancestor")}if(r===mr.POPUP)return{type:"opener"};if(r===mr.IFRAME)return{type:"parent",distance:q(window)};throw new Error("Can not construct window reference for child")},en=function(e,n){return w.try((function(){c=e,u=n,he(),W.register((function(){return n.close.fireAndForget().catch(pe)}))}))},nn=function(e){var n=e.width,r=e.height;return w.try((function(){z.trigger(yr.RESIZE,{width:n,height:r})}))},rn=function(e){return w.try((function(){return z.trigger(yr.DESTROY)})).catch(pe).then((function(){return W.all(e)})).then((function(){S.asyncReject(e||new Error("Component destroyed"))}))},on=le((function(e){return w.try((function(){if(Q){if(M(Q.__source__))return;return Q()}return w.try((function(){return z.trigger(yr.CLOSE)})).then((function(){return rn(e||new Error("Component closed"))}))}))})),an=function(e,n){var r=n.proxyWin,t=n.proxyFrame,o=n.windowName;return ie?ie(e,{proxyWin:r,proxyFrame:t,windowName:o}):w.try((function(){if(e===mr.IFRAME){if(!t)throw new Error("Expected proxy frame to be passed");return t.get().then((function(e){return Ue(e).then((function(n){return W.register((function(){return Ye(e)})),W.register((function(){return ur(n)})),n}))}))}if(e===mr.POPUP){var n=fe(),r=n.width,i=void 0===r?"300px":r,u=n.height,c=void 0===u?"150px":u;i=tn(i,window.outerWidth),c=tn(c,window.outerWidth);var s=function(e,n){var r=(n=n||{}).closeOnUnload,t=void 0===r?1:r,o=n.name,i=void 0===o?"":o,u=n.width,c=n.height,s=0,d=0;u&&(window.outerWidth?d=Math.round((window.outerWidth-u)/2)+window.screenX:window.screen.width&&(d=Math.round((window.screen.width-u)/2))),c&&(window.outerHeight?s=Math.round((window.outerHeight-c)/2)+window.screenY:window.screen.height&&(s=Math.round((window.screen.height-c)/2))),delete n.closeOnUnload,delete n.name,u&&c&&(n=a({top:s,left:d,width:u,height:c,status:1,toolbar:0,menubar:0,resizable:1,scrollbars:1},n));var f,l=Object.keys(n).map((function(e){if(null!=n[e])return e+"="+me(n[e])})).filter(Boolean).join(",");try{f=window.open("",i,l)}catch(e){throw new Fe("Can not open popup window - "+(e.stack||e.message))}if(M(f))throw new Fe("Can not open popup window - blocked");return t&&window.addEventListener("unload",(function(){return f.close()})),f}(0,a({name:o,width:i,height:c},Re().popup));return W.register((function(){return $(s)})),W.register((function(){return ur(s)})),s}throw new Error("No render context available for "+e)})).then((function(e){return r.setWindow(e,{send:ir}),r.setName(o).then((function(){return r}))}))},un=function(){return w.try((function(){var e=Be(window,"unload",we((function(){rn(new Error("Window navigated away"))}))),n=Y(v,rn,3e3);if(W.register(n.cancel),W.register(e.cancel),ce)return ce()}))},cn=function(e){var n=!1;return e.isClosed().then((function(r){return r?(n=!0,on(new Error("Detected component window close"))):w.delay(200).then((function(){return e.isClosed()})).then((function(e){if(e)return n=!0,on(new Error("Detected component window close"))}))})).then((function(){return n}))},sn=function(e){return U?U(e):w.try((function(){if(-1===R.indexOf(e))return R.push(e),S.asyncReject(e),z.trigger(yr.ERROR,e)}))},dn=new w,fn=function(e){return w.try((function(){dn.resolve(e)}))};en.onError=sn;var ln=function(e,n){return e({uid:d,container:n.container,context:n.context,doc:n.doc,frame:n.frame,prerenderFrame:n.prerenderFrame,focus:Ze,close:on,state:j,props:F,tag:b,dimensions:fe(),event:z})},hn=function(e,n){var r=n.context;return oe?oe(e,{context:r}):w.try((function(){if(g){var n=e.getWindow();if(n&&C(n)&&function(e){try{if(!e.location.href)return!0;if("about:blank"===e.location.href)return!0}catch(e){}return!1}(n)){var t=(n=N(n)).document,o=ln(g,{context:r,doc:t});if(o){if(o.ownerDocument!==t)throw new Error("Expected prerender template to have been created with document from child window");!function(e,n){var r=n.tagName.toLowerCase();if("html"!==r)throw new Error("Expected element to be html, got "+r);for(var t=e.document.documentElement,o=0,i=Ee(t.children);o<i.length;o++)t.removeChild(i[o]);for(var a=0,u=Ee(n.children);a<u.length;a++)t.appendChild(u[a])}(n,o);var i=P.width,a=void 0!==i&&i,u=P.height,c=void 0!==u&&u,s=P.element,d=void 0===s?"body":s;if((d=Me(d,t))&&(a||c)){var f=Ge(d,(function(e){nn({width:a?e.width:void 0,height:c?e.height:void 0})}),{width:a,height:c,win:n});z.on(yr.RENDERED,f.cancel)}}}}}))},pn=function(e,n){var r=n.proxyFrame,t=n.proxyPrerenderFrame,o=n.context,a=n.rerender;return K?K(e,{proxyFrame:r,proxyPrerenderFrame:t,context:o,rerender:a}):w.hash({container:e.get(),frame:r?r.get():null,prerenderFrame:t?t.get():null,internalState:Pe()}).then((function(e){var n=e.container,r=e.internalState.visible,t=ln(y,{context:o,container:n,frame:e.frame,prerenderFrame:e.prerenderFrame,doc:document});if(t){r||Je(t),je(n,t);var u=function(e,n){n=we(n);var r,t,o,i=!1,a=[],u=function(){i=!0;for(var e=0;e<a.length;e++)a[e].disconnect();r&&r.cancel(),o&&o.removeEventListener("unload",c),t&&Ye(t)},c=function(){i||(n(),u())};if(Ve(e))return c(),{cancel:u};if(window.MutationObserver)for(var s=e.parentElement;s;){var d=new window.MutationObserver((function(){Ve(e)&&c()}));d.observe(s,{childList:!0}),a.push(d),s=s.parentElement}return(t=document.createElement("iframe")).setAttribute("name","__detect_close_"+ue()+"__"),t.style.display="none",Ue(t).then((function(e){(o=N(e)).addEventListener("unload",c)})),e.appendChild(t),r=be((function(){Ve(e)&&c()}),1e3),{cancel:u}}(t,(function(){var e=new Error("Detected container element removed from DOM");return w.delay(1).then((function(){if(!Ve(t))return W.all(e),a().then(he,ge);on(e)}))}));return W.register((function(){return u.cancel()})),W.register((function(){return Ye(t)})),i=dr(t)}}))},wn=function(){return{state:j,event:z,close:on,focus:Ze,resize:nn,onError:sn,updateProps:mn,show:De,hide:Ae}},vn=function(e){void 0===e&&(e={});var n,r,t,o,i,a,u,c,d,f,l=s,h=wn();ye(I,e),n=m,r=F,t=I,i=l,a=(o=h).state,u=o.close,c=o.focus,d=o.event,f=o.onError,Dr(t,n,(function(e,n,o){var s=!1,l=o;Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){return s?l:(s=!0,function(){if(!n)return l;var s=n.alias;if(s&&!xe(o)&&xe(t[s])&&(l=t[s]),n.value&&(l=n.value({props:r,state:a,close:u,focus:c,event:d,onError:f,container:i})),!n.default||xe(l)||xe(t[e])||(l=n.default({props:r,state:a,close:u,focus:c,event:d,onError:f,container:i})),xe(l)){if(n.type===wr.ARRAY?!Array.isArray(l):typeof l!==n.type)throw new TypeError("Prop is not of type "+n.type+": "+e)}else if(!1!==n.required&&!xe(t[e]))throw new Error('Expected prop "'+e+'" to be defined');return xe(l)&&n.decorate&&(l=n.decorate({value:l,props:r,state:a,close:u,focus:c,event:d,onError:f,container:i})),l}())}})})),Dr(r,n,pe)},mn=function(e){return vn(e),S.then((function(){var e=u,n=o;if(e&&n&&c)return _e(c).then((function(r){return e.updateProps(r).catch((function(e){return cn(n).then((function(n){if(!n)throw e}))}))}))}))},yn=function(e){return V?V(e):w.try((function(){return ke(e)})).then((function(e){return Xe(e)&&(e=function e(n){var r=function(e){var n=function(e){for(;e.parentNode;)e=e.parentNode;if(Xe(e))return e}(e);if(n&&n.host)return n.host}(n);if(!r)throw new Error("Element is not in shadow dom");var t="shadow-slot-"+ue(),o=document.createElement("slot");o.setAttribute("name",t),n.appendChild(o);var i=document.createElement("div");return i.setAttribute("slot",t),r.appendChild(i),Xe(r)?e(i):i}(e)),s=e,dr(e)}))};return{init:function(){z.on(yr.RENDER,(function(){return F.onRender()})),z.on(yr.DISPLAY,(function(){return F.onDisplay()})),z.on(yr.RENDERED,(function(){return F.onRendered()})),z.on(yr.CLOSE,(function(){return F.onClose()})),z.on(yr.DESTROY,(function(){return F.onDestroy()})),z.on(yr.RESIZE,(function(){return F.onResize()})),z.on(yr.FOCUS,(function(){return F.onFocus()})),z.on(yr.PROPS,(function(e){return F.onProps(e)})),z.on(yr.ERROR,(function(e){return F&&F.onError?F.onError(e):ge(e).then((function(){setTimeout((function(){throw e}),1)}))})),W.register(z.reset)},render:function(e){var n=e.target,r=e.container,t=e.context,i=e.rerender;return w.try((function(){var e=Ie(),a=D||Ie();!function(e,n,r){if(e!==window){if(!B(window,e))throw new Error("Can only renderTo an adjacent frame");var t=O();if(!H(n,t)&&!C(e))throw new Error("Can not render remotely to "+n.toString()+" - can only render to "+t);if(r&&"string"!=typeof r)throw new Error("Container passed to renderTo must be a string selector, got "+typeof r+" }")}}(n,a,r);var u=w.try((function(){if(n!==window)return function(e,n){for(var r={},t=0,o=Object.keys(F);t<o.length;t++){var i=o[t],a=m[i];a&&a.allowDelegate&&(r[i]=F[i])}var u=ir(n,"zoid_delegate_"+E,{uid:d,overrides:{props:r,event:z,close:on,onError:sn,getInternalState:Pe,setInternalState:Oe,resolveInitPromise:he,rejectInitPromise:ge}}).then((function(e){var r=e.data.parent;return W.register((function(e){if(!M(n))return r.destroy(e)})),r.getDelegateOverrides()})).catch((function(e){throw new Error("Unable to delegate rendering. Possibly the component is not loaded in the target window.\n\n"+ve(e))}));return V=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.getProxyContainer.apply(e,n)}))},K=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.renderContainer.apply(e,n)}))},X=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.show.apply(e,n)}))},Z=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.hide.apply(e,n)}))},ce=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.watchForUnload.apply(e,n)}))},e===mr.IFRAME?(ee=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.getProxyWindow.apply(e,n)}))},re=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.openFrame.apply(e,n)}))},te=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.openPrerenderFrame.apply(e,n)}))},oe=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.prerender.apply(e,n)}))},ie=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.open.apply(e,n)}))},ae=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.openPrerender.apply(e,n)}))}):e===mr.POPUP&&(ne=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return u.then((function(e){return e.setProxyWin.apply(e,n)}))}),u}(t,n)})),c=F.window,s=un(),l=Ar(m,F,"post"),h=z.trigger(yr.RENDER),p=yn(r),v=Ce(),y=p.then((function(){return vn()})),g=y.then((function(){return Ar(m,F,"get").then((function(e){return function(e,n){var r,t,o=n.query||{},i=n.hash||{},a=e.split("#");t=a[1];var u=(r=a[0]).split("?");r=u[0];var c=We(u[1],o),s=We(t,i);return c&&(r=r+"?"+c),s&&(r=r+"#"+s),r}(G(Se()),{query:e})}))})),x=v.then((function(r){var o,i,u,c,s,f,l,h,p,w,v,m,y,g;return(i={proxyWin:(o={proxyWin:r,initialChildDomain:e,childDomainMatch:a,target:n,context:t}).proxyWin,initialChildDomain:o.initialChildDomain,childDomainMatch:o.childDomainMatch,target:o.target,context:o.context},h=void 0===i?{}:i,p=h.proxyWin,w=h.initialChildDomain,v=h.childDomainMatch,m=h.target,y=void 0===m?window:m,g=h.context,(u={proxyWin:p,initialChildDomain:w,childDomainMatch:v,context:g},c=void 0===u?{}:u,s=c.proxyWin,f=c.childDomainMatch,l=c.context,_e(c.initialChildDomain).then((function(e){var n;return{uid:d,context:l,tag:b,childDomainMatch:f,version:"9_0_86",props:e,exports:(n=s,{init:function(e){return en(this.origin,e)},close:on,checkClose:function(){return cn(n)},resize:nn,onError:sn,show:De,hide:Ae,export:fn})}}))).then((function(e){var n=hr({data:e,metaData:{windowRef:Ke(y,w,g,p)},sender:{domain:O(window)},receiver:{win:p,domain:v},passByReference:w===O()}),r=n.serializedData;return W.register(n.cleanReference),r}))).then((function(e){return gr({name:E,serializedPayload:e})}))})),_=x.then((function(e){return ze(t,{windowName:e})})),P=Le(t),T=w.hash({proxyContainer:p,proxyFrame:_,proxyPrerenderFrame:P}).then((function(e){return pn(e.proxyContainer,{context:t,proxyFrame:e.proxyFrame,proxyPrerenderFrame:e.proxyPrerenderFrame,rerender:i})})).then((function(e){return e})),N=w.hash({windowName:x,proxyFrame:_,proxyWin:v}).then((function(e){var n=e.proxyWin;return c?n:an(t,{windowName:e.windowName,proxyWin:n,proxyFrame:e.proxyFrame})})),A=w.hash({proxyWin:N,proxyPrerenderFrame:P}).then((function(e){return $e(t,e.proxyWin,e.proxyPrerenderFrame)})),R=N.then((function(e){return o=e,Ne(e)})),j=w.hash({proxyPrerenderWin:A,state:R}).then((function(e){return hn(e.proxyPrerenderWin,{context:t})})),I=w.hash({proxyWin:N,windowName:x}).then((function(e){if(c)return e.proxyWin.setName(e.windowName)})),k=w.hash({body:l}).then((function(e){return f.method?f.method:Object.keys(e.body).length?"post":"get"})),L=w.hash({proxyWin:N,windowUrl:g,body:l,method:k,windowName:I,prerender:j}).then((function(e){return e.proxyWin.setLocation(e.windowUrl,{method:e.method,body:e.body})})),U=N.then((function(e){!function e(n,r){var t=!1;return W.register((function(){t=!0})),w.delay(2e3).then((function(){return n.isClosed()})).then((function(o){if(!t)return o?on(new Error("Detected "+r+" close")):e(n,r)}))}(e,t)})),q=w.hash({container:T,prerender:j}).then((function(){return z.trigger(yr.DISPLAY)})),Y=N.then((function(n){return r=n,o=e,i=t,w.try((function(){return r.awaitWindow()})).then((function(e){if(or&&or.needsBridge({win:e,domain:o})&&!or.hasBridge(o,o)){var n="function"==typeof f.bridgeUrl?f.bridgeUrl({props:F}):f.bridgeUrl;if(!n)throw new Error("Bridge needed to render "+i);var r=J(n);return or.linkUrl(e,o),or.openBridge(G(n),r)}}));var r,o,i})),$=L.then((function(){return w.try((function(){var e=F.timeout;if(e)return S.timeout(e,new Error("Loading component timed out after "+e+" milliseconds"))}))})),Q=S.then((function(){return z.trigger(yr.RENDERED)}));return w.hash({initPromise:S,buildUrlPromise:g,onRenderPromise:h,getProxyContainerPromise:p,openFramePromise:_,openPrerenderFramePromise:P,renderContainerPromise:T,openPromise:N,openPrerenderPromise:A,setStatePromise:R,prerenderPromise:j,loadUrlPromise:L,buildWindowNamePromise:x,setWindowNamePromise:I,watchForClosePromise:U,onDisplayPromise:q,openBridgePromise:Y,runTimeoutPromise:$,onRenderedPromise:Q,delegatePromise:u,watchForUnloadPromise:s,finalSetPropsPromise:y})})).catch((function(e){return w.all([sn(e),rn(e)]).then((function(){throw e}),(function(){throw e}))})).then(pe)},destroy:rn,getProps:function(){return F},setProps:vn,export:fn,getHelpers:wn,getDelegateOverrides:function(){return w.try((function(){return{getProxyContainer:yn,show:De,hide:Ae,renderContainer:pn,getProxyWindow:Ce,watchForUnload:un,openFrame:ze,openPrerenderFrame:Le,prerender:hn,open:an,openPrerender:$e,setProxyWin:Ne}}))},getExports:function(){return A({getExports:function(){return dn}})}}}function Rr(e){var n=e.uid,r=e.frame,t=e.prerenderFrame,o=e.doc,i=e.props,a=e.event,u=e.dimensions,c=u.width,s=u.height;if(r&&t){var d=o.createElement("div");d.setAttribute("id",n);var f=o.createElement("style");return i.cspNonce&&f.setAttribute("nonce",i.cspNonce),f.appendChild(o.createTextNode("\n #"+n+" {\n display: inline-block;\n position: relative;\n width: "+c+";\n height: "+s+";\n }\n\n #"+n+" > iframe {\n display: inline-block;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n transition: opacity .2s ease-in-out;\n }\n\n #"+n+" > iframe.zoid-invisible {\n opacity: 0;\n }\n\n #"+n+" > iframe.zoid-visible {\n opacity: 1;\n }\n ")),d.appendChild(r),d.appendChild(t),d.appendChild(f),t.classList.add("zoid-visible"),r.classList.add("zoid-invisible"),a.on(yr.RENDERED,(function(){t.classList.remove("zoid-visible"),t.classList.add("zoid-invisible"),r.classList.remove("zoid-invisible"),r.classList.add("zoid-visible"),setTimeout((function(){Ye(t)}),1)})),a.on(yr.RESIZE,(function(e){var n=e.width,r=e.height;"number"==typeof n&&(d.style.width=rn(n)),"number"==typeof r&&(d.style.height=rn(r))})),d}}function Wr(e){var n=e.doc,r=e.props,t=n.createElement("html"),o=n.createElement("body"),i=n.createElement("style"),a=n.createElement("div");return a.classList.add("spinner"),r.cspNonce&&i.setAttribute("nonce",r.cspNonce),t.appendChild(o),o.appendChild(a),o.appendChild(i),i.appendChild(n.createTextNode("\n html, body {\n width: 100%;\n height: 100%;\n }\n\n .spinner {\n position: fixed;\n max-height: 60vmin;\n max-width: 60vmin;\n height: 40px;\n width: 40px;\n top: 50%;\n left: 50%;\n box-sizing: border-box;\n border: 3px solid rgba(0, 0, 0, .2);\n border-top-color: rgba(33, 128, 192, 0.8);\n border-radius: 100%;\n animation: rotation .7s infinite linear;\n }\n\n @keyframes rotation {\n from {\n transform: translateX(-50%) translateY(-50%) rotate(0deg);\n }\n to {\n transform: translateX(-50%) translateY(-50%) rotate(359deg);\n }\n }\n ")),t}var jr=Te(),Ir=Te();function Mr(e){var n,r,t=function(e){var n=e.tag,r=e.url,t=e.domain,o=e.bridgeUrl,i=e.props,u=void 0===i?{}:i,c=e.dimensions,s=void 0===c?{}:c,d=e.autoResize,f=void 0===d?{}:d,l=e.allowedParentDomains,h=void 0===l?"*":l,p=e.attributes,w=void 0===p?{}:p,v=e.defaultContext,m=void 0===v?mr.IFRAME:v,y=e.containerTemplate,g=void 0===y?Rr:y,b=e.prerenderTemplate,E=void 0===b?Wr:b,x=e.validate,_=e.eligible,P=void 0===_?function(){return{eligible:!0}}:_,T=e.logger,O=void 0===T?{info:pe}:T,N=e.exports,D=void 0===N?pe:N,A=e.method,S=e.children,R=void 0===S?function(){return{}}:S,W=n.replace(/-/g,"_"),j=a({},{window:{type:wr.OBJECT,sendToChild:!1,required:!1,allowDelegate:!0,validate:function(e){var n=e.value;if(!V(n)&&!Un.isProxyWindow(n))throw new Error("Expected Window or ProxyWindow");if(V(n)){if(M(n))throw new Error("Window is closed");if(!C(n))throw new Error("Window is not same domain")}},decorate:function(e){return ar(e.value)}},timeout:{type:wr.NUMBER,required:!1,sendToChild:!1},cspNonce:{type:wr.STRING,required:!1},onDisplay:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr,decorate:Nr},onRendered:{type:wr.FUNCTION,required:!1,sendToChild:!1,default:Cr,decorate:Nr},onRender:{type:wr.FUNCTION,required:!1,sendToChild:!1,default:Cr,decorate:Nr},onClose:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr,decorate:Nr},onDestroy:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr,decorate:Nr},onResize:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr},onFocus:{type:wr.FUNCTION,required:!1,sendToChild:!1,allowDelegate:!0,default:Cr},close:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.close}},focus:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.focus}},resize:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.resize}},uid:{type:wr.STRING,required:!1,sendToChild:!1,childDecorate:function(e){return e.uid}},tag:{type:wr.STRING,required:!1,sendToChild:!1,childDecorate:function(e){return e.tag}},getParent:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.getParent}},getParentDomain:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.getParentDomain}},show:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.show}},hide:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.hide}},export:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.export}},onError:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.onError}},onProps:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.onProps}},getSiblings:{type:wr.FUNCTION,required:!1,sendToChild:!1,childDecorate:function(e){return e.getSiblings}}},u);if(!g)throw new Error("Container template required");return{name:W,tag:n,url:r,domain:t,bridgeUrl:o,method:A,propsDef:j,dimensions:s,autoResize:f,allowedParentDomains:h,attributes:w,defaultContext:m,containerTemplate:g,prerenderTemplate:E,validate:x,logger:O,eligible:P,children:R,exports:"function"==typeof D?D:function(e){for(var n=e.getExports,r={},t=function(e,t){var o=t[e],i=D[o].type,a=n().then((function(e){return e[o]}));r[o]=i===wr.FUNCTION?function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return a.then((function(e){return e.apply(void 0,n)}))}:a},o=0,i=Object.keys(D);o<i.length;o++)t(o,i);return r}}}(e),o=t.name,i=t.tag,u=t.defaultContext,c=t.eligible,s=t.children,d=cr(window),f=[],l=function(){if(function(e){try{return br(window.name).name===e}catch(e){}return!1}(o)){var e=xr().payload;if(e.tag===i&&H(e.childDomainMatch,O()))return!0}return!1},h=le((function(){if(l()){if(window.xprops)throw delete d.components[i],new Error("Can not register "+o+" as child - child already registered");var e=function(e){var n,r=e.tag,t=e.propsDef,o=e.autoResize,i=e.allowedParentDomains,a=[],u=xr(),c=u.parent,s=u.payload,d=c.win,f=c.domain,l=new w,h=s.version,p=s.uid,v=s.exports,m=s.context,y=s.props;if("9_0_86"!==h)throw new Error("Parent window has zoid version "+h+", child window has version 9_0_86");var g=v.show,b=v.hide,E=v.close,x=v.onError,_=v.checkClose,P=v.export,T=v.resize,D=v.init,A=function(){return d},S=function(){return f},R=function(e){return a.push(e),{cancel:function(){a.splice(a.indexOf(e),1)}}},j=function(e){return T.fireAndForget({width:e.width,height:e.height})},I=function(e){return l.resolve(e),P(e)},M=function(e){var t=(void 0===e?{}:e).anyParent,o=[],i=n.parent;if(void 0===t&&(t=!i),!t&&!i)throw new Error("No parent found for "+r+" child");for(var a=0,u=W(window);a<u.length;a++){var c=u[a];if(C(c)){var s=N(c).xprops;if(s&&A()===s.getParent()){var d=s.parent;if(t||!i||d&&d.uid===i.uid){var f=sr(c,(function(e){return e.exports}));o.push({props:s,exports:f})}}}}return o},k=function(e,o,i){void 0===i&&(i=!1);var u=function(e,n,r,t,o,i){void 0===i&&(i=!1);for(var a={},u=0,c=Object.keys(r);u<c.length;u++){var s=c[u],d=n[s];if(!d||!d.sameDomain||t===O(window)&&C(e)){var f=Pr(n,0,s,r[s],o);a[s]=f,d&&d.alias&&!a[d.alias]&&(a[d.alias]=f)}}if(!i)for(var l=0,h=Object.keys(n);l<h.length;l++){var p=h[l];r.hasOwnProperty(p)||(a[p]=Pr(n,0,p,void 0,o))}return a}(d,t,e,o,{tag:r,show:g,hide:b,close:E,focus:Tr,onError:x,resize:j,getSiblings:M,onProps:R,getParent:A,getParentDomain:S,uid:p,export:I},i);n?ye(n,u):n=u;for(var c=0;c<a.length;c++)(0,a[c])(n)},z=function(e){return w.try((function(){return k(e,f,!0)}))};return{init:function(){return w.try((function(){return C(d)&&function(e){var n=e.componentName,r=e.parentComponentWindow,t=pr({data:br(window.name).serializedInitialPayload,sender:{win:r},basic:!0}),o=t.sender;if("uid"===t.reference.type||"global"===t.metaData.windowRef.type){var i=hr({data:t.data,metaData:{windowRef:_r(r)},sender:{domain:o.domain},receiver:{win:window,domain:O()},basic:!0});window.name=gr({name:n,serializedPayload:i.serializedData})}}({componentName:e.name,parentComponentWindow:d}),cr(window).exports=e.exports({getExports:function(){return l}}),function(e,n){if(!H(e,n))throw new Error("Can not be rendered by domain: "+n)}(i,f),mn(d),window.addEventListener("beforeunload",(function(){_.fireAndForget()})),window.addEventListener("unload",(function(){_.fireAndForget()})),Y(d,(function(){Or()})),D({updateProps:z,close:Or})})).then((function(){var e,n,r,t,i;return(e=o.width,n=void 0!==e&&e,r=o.height,t=void 0!==r&&r,i=o.element,ke(void 0===i?"body":i).catch(pe).then((function(e){return{width:n,height:t,element:e}}))).then((function(e){var n=e.width,r=e.height,t=e.element;t&&(n||r)&&m!==mr.POPUP&&Ge(t,(function(e){j({width:n?e.width:void 0,height:r?e.height:void 0})}),{width:n,height:r})}))})).catch((function(e){x(e)}))},getProps:function(){return n||(k(y,f),n)}}}(t);return e.init(),e}}));if(h(),n=tr("zoid_allow_delegate_"+o,(function(){return!0})),r=tr("zoid_delegate_"+o,(function(e){var n=e.data;return{parent:Sr({uid:n.uid,options:t,overrides:n.overrides,parentWin:e.source})}})),Ir.register(n.cancel),Ir.register(r.cancel),d.components=d.components||{},d.components[i])throw new Error("Can not register multiple components with the same tag: "+i);return d.components[i]=!0,{init:function e(n){var r,d="zoid-"+i+"-"+ue(),l=n||{},h=c({props:l}),p=h.eligible,v=h.reason,m=l.onDestroy;l.onDestroy=function(){if(r&&p&&f.splice(f.indexOf(r),1),m)return m.apply(void 0,arguments)};var y=Sr({uid:d,options:t});y.init(),p?y.setProps(l):l.onDestroy&&l.onDestroy(),jr.register((function(e){return y.destroy(e||new Error("zoid destroyed all components"))}));var g=function(n){var r=(void 0===n?{}:n).decorate;return e((void 0===r?ge:r)(l))},b=function(e,n,t){return w.try((function(){if(!p){var n=new Error(v||o+" component is not eligible");return y.destroy(n).then((function(){throw n}))}if(!V(e))throw new Error("Must pass window to renderTo");return r=l,i=t,w.try((function(){if(r.window)return ar(r.window).getType();if(i){if(i!==mr.IFRAME&&i!==mr.POPUP)throw new Error("Unrecognized context: "+i);return i}return u}));var r,i})).then((function(o){if(n=function(e,n){if(n){if("string"!=typeof n&&!Ie(n))throw new TypeError("Expected string or element selector to be passed");return n}if(e===mr.POPUP)return"body";throw new Error("Expected element to be passed to render iframe")}(o,n),e!==window&&"string"!=typeof n)throw new Error("Must pass string element when rendering to another window");return y.render({target:e,container:n,context:o,rerender:function(){var o=g();return ye(r,o),o.renderTo(e,n,t)}})})).catch((function(e){return y.destroy(e).then((function(){throw e}))}))};return r=a({},y.getExports(),y.getHelpers(),function(){for(var e=s(),n={},r=function(r,t){var o=t[r],i=e[o];n[o]=function(e){var n=y.getProps(),r=a({},e,{parent:{uid:d,props:n,export:y.export}});return i(r)}},t=0,o=Object.keys(e);t<o.length;t++)r(t,o);return n}(),{isEligible:function(){return p},clone:g,render:function(e,n){return b(window,e,n)},renderTo:function(e,n,r){return b(e,n,r)}}),p&&f.push(r),r},instances:f,driver:function(e,n){throw new Error("Driver support not enabled")},isChild:l,canRenderTo:function(e){return ir(e,"zoid_allow_delegate_"+o).then((function(e){return e.data})).catch((function(){return!1}))},registerChild:h}}var kr=function(e){!function(){var e,n,r,t,o,i,a,u,c,s;on().initialized||(on().initialized=!0,u=(a={on:tr,send:ir}).on,c=a.send,(s=on()).receiveMessage=s.receiveMessage||function(e){return rr(e,{on:u,send:c})},o=(t={on:tr,send:ir}).on,i=t.send,un().getOrSet("postMessageListener",(function(){return Be(window,"message",(function(e){var n,r,t,a;n=e,t=(r={on:o,send:i}).on,a=r.send,w.try((function(){var e=n.source||n.sourceElement,r=n.origin||n.originalEvent&&n.originalEvent.origin,o=n.data;if("null"===r&&(r="file://"),e){if(!r)throw new Error("Post message did not have origin domain");rr({source:e,origin:r,data:o},{on:t,send:a})}}))}))})),zn({on:tr,send:ir,receiveMessage:rr}),n=(e={on:tr,send:ir}).on,r=e.send,un("builtinListeners").getOrSet("helloListener",(function(){var e=n("postrobot_hello",{domain:"*"},(function(e){return hn(e.source,{domain:e.origin}),{instanceID:ln()}})),t=L();return t&&pn(t,{send:r}).catch((function(e){})),e})))}();var n=Mr(e),r=function(e){return n.init(e)};r.driver=function(e,r){return n.driver(e,r)},r.isChild=function(){return n.isChild()},r.canRenderTo=function(e){return n.canRenderTo(e)},r.instances=n.instances;var t=n.registerChild();return t&&(window.xprops=r.xprops=t.getProps()),r};function zr(e){or&&or.destroyBridges();var n=jr.all(e);return jr=Te(),n}var Fr=zr;function Lr(e){var n;return Fr(),delete window.__zoid_9_0_86__,function(){for(var e=un("responseListeners"),n=0,r=e.keys();n<r.length;n++){var t=r[n],o=e.get(t);o&&(o.cancelled=!0),e.del(t)}}(),(n=un().get("postMessageListener"))&&n.cancel(),delete window.__post_robot_10_0_44__,Ir.all(e)}}])})),o.register("8BAlD",(function(e,n){}));var i={};i=o("cZQrj");var a={},u=o("8BAlD");let c,s;u&&u.env,(a=o("cBfIu")).default=a,function(e){e.ALL="ALL",e.VASP_2_VASP_ONLY="VASP_2_VASP_ONLY",e.SELF_TRANSACTION_ONLY="SELF_TRANSACTION_ONLY"}(c||(c={})),function(e){e.SIGNATURE="SIGNATURE",e.DECLARATION="DECLARATION",e.SIGNATURE_OR_DECLARATION="SIGNATURE_OR_DECLARATION"}(s||(s={}));class d{async renderWidget(){this.widgetRendered?console.error("Notabene: Widget already rendered, please destroy it first"):(this.widget=await this.buildWidget(),this.popup=await this.buildPopup(),this.widget.updateProps({transaction:this.tx}),this.popup.updateProps({transaction:this.tx}),this.popup.hide(),await this.widget.render(this.config.container),await this.renderPopup())}async renderPopup(){this.popup&&(this.popupRendered||(await this.popup.render(this.config.container),this.popupRendered=!0))}async destroyWidget(){this.widgetRendered&&(await a.destroy(),this.widgetRendered=!1,this.popupRendered=!1)}setTransaction(e){const n=["transactionAsset","transactionAmount","beneficiaryAccountNumber","beneficiaryAccountNumber","originatorVASPdid","originatorDid","transactionBlockchainInfo","beneficiaryVASPname","beneficiaryVASPdid","beneficiaryName","beneficiaryGeographicAddress","beneficiaryNationalIdentification","beneficiaryDateAndPlaceOfBirth","beneficiaryDid","isNonCustodial","originatorEqualsBeneficiary","beneficiaryProof","isValid","errors"];e&&Object.keys(e).forEach((e=>{if(!n.includes(e))throw new Error(`Notabene: Invalid transaction property ${e}`)})),this.tx=e,this.widgetRendered&&(this.widget.updateProps({transaction:e}),this.popup.updateProps({transaction:e}))}getWidgetUrl(){const e=new URL(this.config.widget);return e.hash=`authToken=${this.config.authToken}`,e.toString()}getAdditionalInfoUrl(){const e=new URL(this.config.widget);return e.search="popup=true",e.hash=`authToken=${this.config.authToken}`,e.toString()}handleError(e){this.error=e,this.widget&&this.popup&&(this.widget.updateProps({error:e}),this.popup.updateProps({error:e})),e&&this.config.onError&&this.config.onError(e)}buildWidget(){if(!this.config.authToken)return void console.error("Notabene: authToken is required");const n=e(a).create({tag:"widget",url:this.getWidgetUrl(),dimensions:{width:"100%",height:"280px"},props:{vaspDID:{type:"string",required:!0},transaction:{type:"object",required:!1},onRequireAdditionalInformation:{type:"function",required:!0},onValidStateChange:{type:"function",required:!0},error:{type:"object",required:!1},onError:{type:"function",required:!0},storeTransaction:{type:"function",required:!0},theme:{type:"object",required:!1},dictionary:{type:"object",required:!1},transactionTypeAllowed:{type:"string",required:!1},nonCustodialDeclarationType:{type:"string",required:!1},beneficiaryDetails:{type:"array",required:!1}}})({vaspDID:this.config.vaspDID,transaction:{},theme:this.config.theme,dictionary:this.config.dictionary,transactionTypeAllowed:this.config.transactionTypeAllowed,nonCustodialDeclarationType:this.config.nonCustodialDeclarationType,beneficiaryDetails:this.config.beneficiaryDetails,onRequireAdditionalInformation:()=>{this.popup.updateProps({popupOpen:!0}),this.popup.show()},onValidStateChange:e=>{this.config.onValidStateChange(e)},error:this.error,onError:e=>{this.handleError(e),console.debug("Notabene: Error handler called")},storeTransaction:e=>{this.setTransaction(e)}});return n.event.on(e(a).EVENT.RENDERED,(e=>{this.widgetRendered=!0})),n}buildPopup(){if(!this.config.authToken)return void console.error("Notabene: authToken is required");const n=e(a).create({tag:"popup",url:this.getAdditionalInfoUrl(),children:()=>({Transaction:this.tx}),dimensions:{width:"100%",height:"100%"},props:{vaspDID:{type:"string",required:!0},transaction:{type:"object",required:!1},storeTransaction:{type:"function",required:!0},close:{type:"function"},theme:{type:"object",required:!1},dictionary:{type:"object",required:!1},transactionTypeAllowed:{type:"string",required:!1},nonCustodialDeclarationType:{type:"string",required:!1},popupOpen:{type:"boolean",required:!0},setPopupOpen:{type:"function",required:!0},error:{type:"object",required:!1},onError:{type:"function",required:!0},beneficiaryDetails:{type:"array",required:!1}},containerTemplate:({uid:e,doc:n,frame:r,prerenderFrame:t})=>i.node("div",{id:e,class:"nb-container"},i.node("style",null,`\n #${e}.container {\n border: 5px solid red;\n }\n .nb-overlay {\n position: fixed;\n width: 100vw;\n height: 100vh;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(0,0,0,0.5);\n }\n .nb-popup {\n max-width: 608px;\n width: 100%;\n height: 100%;\n }\n .nb-preloader {\n display: none;\n }\n `),i.node("div",{class:"nb-overlay"},i.node("node",{el:r,class:"nb-popup"}),i.node("node",{el:t,class:"nb-preloader"}))).render(i.dom({doc:n}))})({vaspDID:this.config.vaspDID,transaction:this.tx,beneficiaryDetails:this.config.beneficiaryDetails,storeTransaction:e=>{this.setTransaction(e),console.debug("Notabene: Transaction stored")},close:()=>{this.popup.close(),console.debug("Notabene: Popup closing")},setPopupOpen:e=>{this.popup.updateProps({popupOpen:e})},error:this.error,onError:e=>{this.handleError(e),console.debug("Notabene: Error handler called")},popupOpen:!1,theme:this.config.theme,dictionary:this.config.dictionary,transactionTypeAllowed:this.config.transactionTypeAllowed,nonCustodialDeclarationType:this.config.nonCustodialDeclarationType});return n.event.on(e(a).EVENT.RENDERED,(e=>{this.popupRendered=!0})),n}constructor(e){this.config=e,this.config.nonCustodialDeclarationType=e.nonCustodialDeclarationType||s.SIGNATURE,this.config.transactionTypeAllowed=e.transactionTypeAllowed||c.ALL,this.widgetRendered=!1,this.popupRendered=!1}}window&&(window.Notabene=d),window&&(window.Notabene=d);
package/dist/lib/index.js CHANGED
@@ -28,8 +28,6 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
28
28
  this.config = config;
29
29
  this.config.nonCustodialDeclarationType = config.nonCustodialDeclarationType || $fef5d623a19b12b5$export$1a2fd016dc0a19e9.SIGNATURE;
30
30
  this.config.transactionTypeAllowed = config.transactionTypeAllowed || $fef5d623a19b12b5$export$7f2c168e71c689ea.ALL;
31
- this.onValidStateChange = config.onValidStateChange;
32
- this.onError = config.onError;
33
31
  this.widgetRendered = false;
34
32
  this.popupRendered = false;
35
33
  }
@@ -58,6 +56,7 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
58
56
  }
59
57
  }
60
58
  async destroyWidget() {
59
+ if (!this.widgetRendered) return;
61
60
  await $4mxld$zoid.destroy();
62
61
  this.widgetRendered = false;
63
62
  this.popupRendered = false;
@@ -74,6 +73,9 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
74
73
  'beneficiaryVASPname',
75
74
  'beneficiaryVASPdid',
76
75
  'beneficiaryName',
76
+ 'beneficiaryGeographicAddress',
77
+ 'beneficiaryNationalIdentification',
78
+ 'beneficiaryDateAndPlaceOfBirth',
77
79
  'beneficiaryDid',
78
80
  'isNonCustodial',
79
81
  'originatorEqualsBeneficiary',
@@ -115,8 +117,8 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
115
117
  error: err
116
118
  });
117
119
  }
118
- if (!err || !this.onError) return;
119
- this.onError(err);
120
+ if (!err || !this.config.onError) return;
121
+ this.config.onError(err);
120
122
  }
121
123
  buildWidget() {
122
124
  if (!this.config.authToken) {
@@ -144,7 +146,8 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
144
146
  required: true
145
147
  },
146
148
  onValidStateChange: {
147
- type: 'function'
149
+ type: 'function',
150
+ required: true
148
151
  },
149
152
  error: {
150
153
  type: 'object',
@@ -173,6 +176,10 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
173
176
  nonCustodialDeclarationType: {
174
177
  type: 'string',
175
178
  required: false
179
+ },
180
+ beneficiaryDetails: {
181
+ type: 'array',
182
+ required: false
176
183
  }
177
184
  }
178
185
  })({
@@ -182,6 +189,7 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
182
189
  dictionary: this.config.dictionary,
183
190
  transactionTypeAllowed: this.config.transactionTypeAllowed,
184
191
  nonCustodialDeclarationType: this.config.nonCustodialDeclarationType,
192
+ beneficiaryDetails: this.config.beneficiaryDetails,
185
193
  onRequireAdditionalInformation: ()=>{
186
194
  this.popup.updateProps({
187
195
  popupOpen: true
@@ -189,7 +197,7 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
189
197
  this.popup.show();
190
198
  },
191
199
  onValidStateChange: (isValid)=>{
192
- this.onValidStateChange(isValid);
200
+ this.config.onValidStateChange(isValid);
193
201
  },
194
202
  error: this.error,
195
203
  onError: (err)=>{
@@ -269,6 +277,10 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
269
277
  onError: {
270
278
  type: 'function',
271
279
  required: true
280
+ },
281
+ beneficiaryDetails: {
282
+ type: 'array',
283
+ required: false
272
284
  }
273
285
  },
274
286
  containerTemplate: ({ uid: uid , doc: doc , frame: frame , prerenderFrame: prerenderFrame })=>{
@@ -313,6 +325,7 @@ class $fef5d623a19b12b5$export$2e2bcd8739ae039 {
313
325
  })({
314
326
  vaspDID: this.config.vaspDID,
315
327
  transaction: this.tx,
328
+ beneficiaryDetails: this.config.beneficiaryDetails,
316
329
  storeTransaction: (tx)=>{
317
330
  this.setTransaction(tx);
318
331
  console.debug('Notabene: Transaction stored');
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "author": "Notabene <developers@notabene.id>",
10
10
  "license": "MIT",
11
- "version": "1.13.0",
11
+ "version": "1.14.1",
12
12
  "main": "dist/index.js",
13
13
  "packageManager": "yarn@3.2.1",
14
14
  "browserslist": "> 0.5%, last 2 versions, not dead",
@@ -37,6 +37,7 @@
37
37
  "prepare": "husky install",
38
38
  "watch": "parcel watch",
39
39
  "dev": "sirv --dev --port 3002 public",
40
+ "build:dev": "yarn build && yarn dev",
40
41
  "build": "yarn build:clean && yarn build:compile",
41
42
  "build:clean": "rimraf dist/ .parcel-cache/",
42
43
  "build:compile": "parcel build --no-source-maps && cp dist/es/index.js public/js/notabene.js",
package/public/index.html CHANGED
@@ -12,22 +12,24 @@
12
12
  const nb = new Notabene({
13
13
  widget: 'http://localhost:8080',
14
14
  container: '#container',
15
- authToken: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE2NjI1ODkxMDksInZjIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIiwiaHR0cHM6Ly9hcGkubm90YWJlbmUuaWQvc2NoZW1hcy92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiQWNjZXNzVG9rZW4iXSwiY3JlZGVudGlhbFN1YmplY3QiOnsic2NvcGUiOiJhZG1pbiJ9fSwic3ViIjoiZGlkOmV0aHI6MHgzMTY2NjUzYmUyY2VjODE3OTBiMzhjMzkxNDhlNjdjNWU0MWQ0MWY4IiwiaXNzIjoiZGlkOmV0aHI6MHgzMTY2NjUzYmUyY2VjODE3OTBiMzhjMzkxNDhlNjdjNWU0MWQ0MWY4In0.hGkC5kVsVgXZ27rxyrtGokgo_fTxqk_hqXTwm8ItyDx5-8x-Qt10rTsV5hbdjC1XFqn6mSXqoLUf2I9mJZ-_jQA',
15
+ authToken: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NkstUiJ9.eyJpYXQiOjE2NjQyOTQ4MjgsImV4cCI6bnVsbCwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL2FwaS5ub3RhYmVuZS5pZC9zY2hlbWFzL3YxIl0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJBY2Nlc3NUb2tlbiJdLCJjcmVkZW50aWFsU3ViamVjdCI6eyJzY29wZSI6ImN1c3RvbWVyIn19LCJzdWIiOiJkaWQ6ZXRocjoweGIxMDlkYWM4Y2RmOThiNTk5NzdjMzUyZjM5OGMzZGQ0MjE3NGFhNTQiLCJpc3MiOiJkaWQ6ZXRocjoweGIxMDlkYWM4Y2RmOThiNTk5NzdjMzUyZjM5OGMzZGQ0MjE3NGFhNTQifQ.vgRl581FJnwp2FOeggHzI_81PBQuQMcvCcQlaMcGpc6AsbcAgYCK3-XCk1j1QWx7W4dcv62Qec_Ui2pecijwzQE',
16
16
  onValidStateChange: (isValid) => {
17
17
  console.log(isValid)
18
+ console.log(nb.tx)
18
19
  },
19
20
  onError: (err) => {
20
21
  // If any errors are encountered, this function will be called.
21
22
  alert(err.message);
22
23
  },
23
- vaspDID: 'did:ethr:0xcea876c94528c8d790836ad7e9420ba8253fdf70',
24
+ vaspDID: 'did:ethr:0x8049eb912be2ffb0a9cf559932e215f04ecf9c46',
24
25
  theme:{
25
26
  // primaryColor: '#fff',
26
27
  // primaryFontColor: '#fff',
27
28
  // secondaryFontColor: '#fff',
28
29
  // backgroundColor: 'black',
29
30
  // mode: 'dark',
30
- }
31
+ },
32
+ // beneficiaryDetails: ['beneficiaryGeographicAddress'],
31
33
  // transactionTypeAllowed: 'SELF_TRANSACTION_ONLY',
32
34
  // nonCustodialDeclarationType: 'DECLARATION'
33
35
  });
package/src/notabene.ts CHANGED
@@ -27,12 +27,13 @@ interface NotabeneConfig {
27
27
  container: string;
28
28
  authToken: string;
29
29
  vaspDID: string;
30
- onValidStateChange(): void;
31
- onError(): void;
30
+ onValidStateChange(isValid: boolean): void;
31
+ onError(err: any): void;
32
32
  theme?: Theme;
33
33
  dictionary?: { [key: string]: string };
34
34
  transactionTypeAllowed?: TransactionTypeAllowed;
35
35
  nonCustodialDeclarationType?: NonCustodialDeclarationType;
36
+ beneficiaryDetails?: string[];
36
37
  }
37
38
 
38
39
  export interface OwnershipProofInput {
@@ -52,6 +53,9 @@ interface Transaction {
52
53
  transactionBlockchainInfo?: TransactionBlockchainInfo;
53
54
  beneficiaryVASPname?: string;
54
55
  beneficiaryName?: string;
56
+ beneficiaryGeographicAddress?: string;
57
+ beneficiaryNationalIdentification?: string;
58
+ beneficiaryDateAndPlaceOfBirth?: string;
55
59
  beneficiaryDid?: string;
56
60
  isNonCustodial?: boolean;
57
61
  originatorEqualsBeneficiary?: boolean;
@@ -65,8 +69,6 @@ export default class Notabene {
65
69
  private popup: zoid.ZoidComponent;
66
70
  private config: NotabeneConfig;
67
71
  private tx: Transaction | undefined;
68
- private onValidStateChange: (isValid: boolean) => void;
69
- private onError?: (err: Error) => void;
70
72
  private error?: Error;
71
73
  private widgetRendered: boolean;
72
74
  private popupRendered: boolean;
@@ -78,8 +80,6 @@ export default class Notabene {
78
80
  NonCustodialDeclarationType.SIGNATURE;
79
81
  this.config.transactionTypeAllowed =
80
82
  config.transactionTypeAllowed || TransactionTypeAllowed.ALL;
81
- this.onValidStateChange = config.onValidStateChange;
82
- this.onError = config.onError;
83
83
  this.widgetRendered = false;
84
84
  this.popupRendered = false;
85
85
  }
@@ -115,6 +115,7 @@ export default class Notabene {
115
115
  }
116
116
 
117
117
  public async destroyWidget(): Promise<void> {
118
+ if (!this.widgetRendered) return;
118
119
  await destroy();
119
120
  this.widgetRendered = false;
120
121
  this.popupRendered = false;
@@ -132,6 +133,9 @@ export default class Notabene {
132
133
  'beneficiaryVASPname',
133
134
  'beneficiaryVASPdid',
134
135
  'beneficiaryName',
136
+ 'beneficiaryGeographicAddress',
137
+ 'beneficiaryNationalIdentification',
138
+ 'beneficiaryDateAndPlaceOfBirth',
135
139
  'beneficiaryDid',
136
140
  'isNonCustodial',
137
141
  'originatorEqualsBeneficiary',
@@ -180,8 +184,8 @@ export default class Notabene {
180
184
  error: err,
181
185
  });
182
186
  }
183
- if (!err || !this.onError) return;
184
- this.onError(err);
187
+ if (!err || !this.config.onError) return;
188
+ this.config.onError(err);
185
189
  }
186
190
 
187
191
  private buildWidget(): zoid.ZoidComponent {
@@ -212,6 +216,7 @@ export default class Notabene {
212
216
  },
213
217
  onValidStateChange: {
214
218
  type: 'function',
219
+ required: true,
215
220
  },
216
221
  error: {
217
222
  type: 'object',
@@ -241,6 +246,10 @@ export default class Notabene {
241
246
  type: 'string',
242
247
  required: false,
243
248
  },
249
+ beneficiaryDetails: {
250
+ type: 'array',
251
+ required: false,
252
+ },
244
253
  },
245
254
  })({
246
255
  vaspDID: this.config.vaspDID,
@@ -249,6 +258,7 @@ export default class Notabene {
249
258
  dictionary: this.config.dictionary,
250
259
  transactionTypeAllowed: this.config.transactionTypeAllowed,
251
260
  nonCustodialDeclarationType: this.config.nonCustodialDeclarationType,
261
+ beneficiaryDetails: this.config.beneficiaryDetails,
252
262
  onRequireAdditionalInformation: () => {
253
263
  this.popup.updateProps({
254
264
  popupOpen: true,
@@ -256,7 +266,7 @@ export default class Notabene {
256
266
  this.popup.show();
257
267
  },
258
268
  onValidStateChange: (isValid: boolean) => {
259
- this.onValidStateChange(isValid);
269
+ this.config.onValidStateChange(isValid);
260
270
  },
261
271
  error: this.error,
262
272
  onError: (err: any) => {
@@ -341,6 +351,10 @@ export default class Notabene {
341
351
  type: 'function',
342
352
  required: true,
343
353
  },
354
+ beneficiaryDetails: {
355
+ type: 'array',
356
+ required: false,
357
+ },
344
358
  },
345
359
  containerTemplate: ({ uid, doc, frame, prerenderFrame }: any) => {
346
360
  return node(
@@ -385,6 +399,7 @@ export default class Notabene {
385
399
  })({
386
400
  vaspDID: this.config.vaspDID,
387
401
  transaction: this.tx,
402
+ beneficiaryDetails: this.config.beneficiaryDetails,
388
403
  storeTransaction: (tx: Transaction) => {
389
404
  this.setTransaction(tx);
390
405
  console.debug('Notabene: Transaction stored');