@one-commerce/sdk-core 1.7.1 → 1.12.0-alpha.0

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.
Files changed (47) hide show
  1. package/lib/bundles/bundle.esm.js +962 -0
  2. package/lib/bundles/bundle.esm.js.map +1 -0
  3. package/lib/bundles/bundle.esm.min.js +2 -0
  4. package/lib/bundles/bundle.esm.min.js.map +1 -0
  5. package/lib/bundles/bundle.umd.js +973 -0
  6. package/lib/bundles/bundle.umd.js.map +1 -0
  7. package/lib/bundles/bundle.umd.min.js +2 -0
  8. package/lib/bundles/bundle.umd.min.js.map +1 -0
  9. package/lib/cjs/backofficeServices.js +180 -28
  10. package/lib/cjs/backofficeServices.js.map +1 -0
  11. package/lib/cjs/events.js +56 -22
  12. package/lib/cjs/events.js.map +1 -0
  13. package/lib/cjs/index.js +306 -130
  14. package/lib/cjs/index.js.map +1 -0
  15. package/lib/cjs/shopServices.js +248 -54
  16. package/lib/cjs/shopServices.js.map +1 -0
  17. package/lib/cjs/utils.js +63 -28
  18. package/lib/cjs/utils.js.map +1 -0
  19. package/lib/esm/backofficeServices.js +59 -16
  20. package/lib/esm/backofficeServices.js.map +1 -0
  21. package/lib/esm/events.js +30 -22
  22. package/lib/esm/events.js.map +1 -0
  23. package/lib/esm/index.js +165 -117
  24. package/lib/esm/index.js.map +1 -0
  25. package/lib/esm/shopServices.js +125 -67
  26. package/lib/esm/shopServices.js.map +1 -0
  27. package/lib/esm/utils.js +34 -25
  28. package/lib/esm/utils.js.map +1 -0
  29. package/lib/{cjs → types}/backofficeServices.d.ts +7 -0
  30. package/lib/types/backofficeServices.d.ts.map +1 -0
  31. package/lib/{cjs → types}/events.d.ts +1 -0
  32. package/lib/types/events.d.ts.map +1 -0
  33. package/lib/types/iframe-channel.d.ts +19 -0
  34. package/lib/{esm → types}/index.d.ts +7 -2
  35. package/lib/types/index.d.ts.map +1 -0
  36. package/lib/{esm → types}/shopServices.d.ts +1 -0
  37. package/lib/types/shopServices.d.ts.map +1 -0
  38. package/lib/{esm → types}/utils.d.ts +1 -0
  39. package/lib/types/utils.d.ts.map +1 -0
  40. package/package.json +42 -16
  41. package/lib/cjs/index.d.ts +0 -75
  42. package/lib/cjs/shopServices.d.ts +0 -98
  43. package/lib/cjs/utils.d.ts +0 -8
  44. package/lib/esm/backofficeServices.d.ts +0 -21
  45. package/lib/esm/events.d.ts +0 -7
  46. package/lib/tsconfig.module.tsbuildinfo +0 -1
  47. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,962 @@
1
+ function _classCallCheck(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+
7
+ function _defineProperties(target, props) {
8
+ for (var i = 0; i < props.length; i++) {
9
+ var descriptor = props[i];
10
+ descriptor.enumerable = descriptor.enumerable || false;
11
+ descriptor.configurable = true;
12
+ if ("value" in descriptor) descriptor.writable = true;
13
+ Object.defineProperty(target, descriptor.key, descriptor);
14
+ }
15
+ }
16
+
17
+ function _createClass(Constructor, protoProps, staticProps) {
18
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
19
+ if (staticProps) _defineProperties(Constructor, staticProps);
20
+ Object.defineProperty(Constructor, "prototype", {
21
+ writable: false
22
+ });
23
+ return Constructor;
24
+ }
25
+
26
+ function _defineProperty(obj, key, value) {
27
+ if (key in obj) {
28
+ Object.defineProperty(obj, key, {
29
+ value: value,
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true
33
+ });
34
+ } else {
35
+ obj[key] = value;
36
+ }
37
+
38
+ return obj;
39
+ }
40
+
41
+ function _inherits(subClass, superClass) {
42
+ if (typeof superClass !== "function" && superClass !== null) {
43
+ throw new TypeError("Super expression must either be null or a function");
44
+ }
45
+
46
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
47
+ constructor: {
48
+ value: subClass,
49
+ writable: true,
50
+ configurable: true
51
+ }
52
+ });
53
+ Object.defineProperty(subClass, "prototype", {
54
+ writable: false
55
+ });
56
+ if (superClass) _setPrototypeOf(subClass, superClass);
57
+ }
58
+
59
+ function _getPrototypeOf(o) {
60
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
61
+ return o.__proto__ || Object.getPrototypeOf(o);
62
+ };
63
+ return _getPrototypeOf(o);
64
+ }
65
+
66
+ function _setPrototypeOf(o, p) {
67
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
68
+ o.__proto__ = p;
69
+ return o;
70
+ };
71
+
72
+ return _setPrototypeOf(o, p);
73
+ }
74
+
75
+ function _isNativeReflectConstruct() {
76
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
77
+ if (Reflect.construct.sham) return false;
78
+ if (typeof Proxy === "function") return true;
79
+
80
+ try {
81
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
82
+ return true;
83
+ } catch (e) {
84
+ return false;
85
+ }
86
+ }
87
+
88
+ function _assertThisInitialized(self) {
89
+ if (self === void 0) {
90
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
91
+ }
92
+
93
+ return self;
94
+ }
95
+
96
+ function _possibleConstructorReturn(self, call) {
97
+ if (call && (typeof call === "object" || typeof call === "function")) {
98
+ return call;
99
+ } else if (call !== void 0) {
100
+ throw new TypeError("Derived constructors may only return object or undefined");
101
+ }
102
+
103
+ return _assertThisInitialized(self);
104
+ }
105
+
106
+ function _createSuper(Derived) {
107
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
108
+
109
+ return function _createSuperInternal() {
110
+ var Super = _getPrototypeOf(Derived),
111
+ result;
112
+
113
+ if (hasNativeReflectConstruct) {
114
+ var NewTarget = _getPrototypeOf(this).constructor;
115
+
116
+ result = Reflect.construct(Super, arguments, NewTarget);
117
+ } else {
118
+ result = Super.apply(this, arguments);
119
+ }
120
+
121
+ return _possibleConstructorReturn(this, result);
122
+ };
123
+ }
124
+
125
+ function _slicedToArray(arr, i) {
126
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
127
+ }
128
+
129
+ function _arrayWithHoles(arr) {
130
+ if (Array.isArray(arr)) return arr;
131
+ }
132
+
133
+ function _iterableToArrayLimit(arr, i) {
134
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
135
+
136
+ if (_i == null) return;
137
+ var _arr = [];
138
+ var _n = true;
139
+ var _d = false;
140
+
141
+ var _s, _e;
142
+
143
+ try {
144
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
145
+ _arr.push(_s.value);
146
+
147
+ if (i && _arr.length === i) break;
148
+ }
149
+ } catch (err) {
150
+ _d = true;
151
+ _e = err;
152
+ } finally {
153
+ try {
154
+ if (!_n && _i["return"] != null) _i["return"]();
155
+ } finally {
156
+ if (_d) throw _e;
157
+ }
158
+ }
159
+
160
+ return _arr;
161
+ }
162
+
163
+ function _unsupportedIterableToArray(o, minLen) {
164
+ if (!o) return;
165
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
166
+ var n = Object.prototype.toString.call(o).slice(8, -1);
167
+ if (n === "Object" && o.constructor) n = o.constructor.name;
168
+ if (n === "Map" || n === "Set") return Array.from(o);
169
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
170
+ }
171
+
172
+ function _arrayLikeToArray(arr, len) {
173
+ if (len == null || len > arr.length) len = arr.length;
174
+
175
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
176
+
177
+ return arr2;
178
+ }
179
+
180
+ function _nonIterableRest() {
181
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
182
+ }
183
+
184
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
185
+
186
+ function getDefaultExportFromCjs (x) {
187
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
188
+ }
189
+
190
+ var main = {};
191
+
192
+ var messages = {};
193
+
194
+ (function (exports) {
195
+ Object.defineProperty(exports, "__esModule", { value: true });
196
+ exports.Errors = exports.Message = void 0;
197
+ (function (Message) {
198
+ Message["INIT"] = "one:init";
199
+ Message["UPDATE"] = "one:update";
200
+ Message["METHOD_CALL"] = "one:method:call";
201
+ Message["METHOD_CALL_ERROR"] = "one:method:error";
202
+ Message["METHOD_RESULT"] = "one:method:result";
203
+ Message["NAVIGATION_PUSH"] = "one:navigation:push";
204
+ Message["FRAME_HEIGHT_REQUEST"] = "one:frameheight:request";
205
+ Message["FRAME_HEIGHT_CHANGE"] = "one:frameheight:change";
206
+ })(exports.Message || (exports.Message = {}));
207
+ (function (Errors) {
208
+ Errors["METHOD_DOES_NOT_EXISTS"] = "Method does not exists";
209
+ Errors["SERVICE_DOES_NOT_EXISTS"] = "Service does not exists";
210
+ })(exports.Errors || (exports.Errors = {}));
211
+
212
+ }(messages));
213
+
214
+ var api = {};
215
+
216
+ Object.defineProperty(api, "__esModule", { value: true });
217
+
218
+ (function (exports) {
219
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
220
+ if (k2 === undefined) k2 = k;
221
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
222
+ }) : (function(o, m, k, k2) {
223
+ if (k2 === undefined) k2 = k;
224
+ o[k2] = m[k];
225
+ }));
226
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
227
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
228
+ };
229
+ Object.defineProperty(exports, "__esModule", { value: true });
230
+ __exportStar(messages, exports);
231
+ __exportStar(api, exports);
232
+
233
+ }(main));
234
+
235
+ var lib = {exports: {}};
236
+
237
+ (function (module, exports) {
238
+ !function(t,n){module.exports=n();}(window,function(){return r={},o.m=e=[function(t,n){var e=Array.isArray;t.exports=e;},function(t,n,e){var r=e(26),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i;},function(t,n,e){var r=e(74),o=e(77);t.exports=function(t,n){var e=o(t,n);return r(e)?e:void 0};},function(t,n,e){var r=e(7),o=e(51),i=e(52),u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)};},function(t,n){t.exports=function(t){return null!=t&&"object"==typeof t};},function(t,n){t.exports=function(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)};},function(t,n,e){var r=e(23);t.exports=function(t){if("string"==typeof t||r(t))return t;var n=t+"";return "0"==n&&1/t==-1/0?"-0":n};},function(t,n,e){var r=e(1).Symbol;t.exports=r;},function(t,n){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var e=typeof t;return !!(n=null==n?9007199254740991:n)&&("number"==e||"symbol"!=e&&r.test(t))&&-1<t&&t%1==0&&t<n};},function(t,n,e){var r=e(64),o=e(65),i=e(66),u=e(67),c=e(68);function a(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1]);}}a.prototype.clear=r,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=u,a.prototype.set=c,t.exports=a;},function(t,n,e){var r=e(11);t.exports=function(t,n){for(var e=t.length;e--;)if(r(t[e][0],n))return e;return -1};},function(t,n){t.exports=function(t,n){return t===n||t!=t&&n!=n};},function(t,n,e){var r=e(2)(Object,"create");t.exports=r;},function(t,n,e){var r=e(86);t.exports=function(t,n){var e=t.__data__;return r(n)?e["string"==typeof n?"string":"hash"]:e.map};},function(t,n,e){var o=e(38);t.exports=function(t,n,e){var r=null==t?void 0:o(t,n);return void 0===r?e:r};},function(t,n,e){var r=e(3),o=e(128),i=e(4),u=Function.prototype,c=Object.prototype,a=u.toString,s=c.hasOwnProperty,f=a.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return !1;var n=o(t);if(null===n)return !0;var e=s.call(n,"constructor")&&n.constructor;return "function"==typeof e&&e instanceof e&&a.call(e)==f};},function(t,n,e){var r=e(47),o=e(57),i=e(18);t.exports=function(t){return i(t)?r(t):o(t)};},function(t,n){t.exports=function(t){return "number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991};},function(t,n,e){var r=e(31),o=e(17);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)};},function(t,n,e){var r=e(2)(e(1),"Map");t.exports=r;},function(t,n,e){var r=e(78),o=e(85),i=e(87),u=e(88),c=e(89);function a(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1]);}}a.prototype.clear=r,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=u,a.prototype.set=c,t.exports=a;},function(t,n,e){var r=e(0),o=e(22),i=e(114),u=e(117);t.exports=function(t,n){return r(t)?t:o(t,n)?[t]:i(u(t))};},function(t,n,e){var r=e(0),o=e(23),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/;t.exports=function(t,n){if(r(t))return !1;var e=typeof t;return !("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!o(t))||(u.test(t)||!i.test(t)||null!=n&&t in Object(n))};},function(t,n,e){var r=e(3),o=e(4);t.exports=function(t){return "symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)};},function(t,n,e){var r=e(129);t.exports=function(t,n,e){return null==t?t:r(t,n,e)};},function(t,n,e){var r=e(49),o=e(4),i=Object.prototype,u=i.hasOwnProperty,c=i.propertyIsEnumerable,a=r(function(){return arguments}())?r:function(t){return o(t)&&u.call(t,"callee")&&!c.call(t,"callee")};t.exports=a;},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n;}).call(this,n(50));},function(t,c,a){(function(t){var n=a(1),e=a(53),r=c&&!c.nodeType&&c,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,i=o&&o.exports===r?n.Buffer:void 0,u=(i?i.isBuffer:void 0)||e;t.exports=u;}).call(this,a(28)(t));},function(t,n){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t};},function(t,n,e){var r=e(54),o=e(55),i=e(56),u=i&&i.isTypedArray,c=u?o(u):r;t.exports=c;},function(t,n){t.exports=function(n,e){return function(t){return n(e(t))}};},function(t,n,e){var r=e(3),o=e(5);t.exports=function(t){if(!o(t))return !1;var n=r(t);return "[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n};},function(t,n,e){var r=e(9),o=e(69),i=e(70),u=e(71),c=e(72),a=e(73);function s(t){var n=this.__data__=new r(t);this.size=n.size;}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=u,s.prototype.has=c,s.prototype.set=a,t.exports=s;},function(t,n){var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return ""};},function(t,n,e){var u=e(90),c=e(4);t.exports=function t(n,e,r,o,i){return n===e||(null==n||null==e||!c(n)&&!c(e)?n!=n&&e!=e:u(n,e,r,o,t,i))};},function(t,n,e){var d=e(91),b=e(94),_=e(95);t.exports=function(t,n,e,r,o,i){var u=1&e,c=t.length,a=n.length;if(c!=a&&!(u&&c<a))return !1;var s=i.get(t);if(s&&i.get(n))return s==n;var f=-1,p=!0,l=2&e?new d:void 0;for(i.set(t,n),i.set(n,t);++f<c;){var v=t[f],h=n[f];if(r)var y=u?r(h,v,f,n,t,i):r(v,h,f,t,n,i);if(void 0!==y){if(y)continue;p=!1;break}if(l){if(!b(n,function(t,n){if(!_(l,n)&&(v===t||o(v,t,e,r,i)))return l.push(n)})){p=!1;break}}else if(v!==h&&!o(v,h,e,r,i)){p=!1;break}}return i.delete(t),i.delete(n),p};},function(t,n,e){var r=e(5);t.exports=function(t){return t==t&&!r(t)};},function(t,n){t.exports=function(n,e){return function(t){return null!=t&&(t[n]===e&&(void 0!==e||n in Object(t)))}};},function(t,n,e){var o=e(21),i=e(6);t.exports=function(t,n){for(var e=0,r=(n=o(n,t)).length;null!=t&&e<r;)t=t[i(n[e++])];return e&&e==r?t:void 0};},function(t,n,e){var o=e(41),i=e(42),u=e(61),c=e(0),a=e(127);t.exports=function(t,n,e){var r=c(t)?o:i;return e&&a(t,n,e)&&(n=void 0),r(t,u(n,3))};},function(t,n,e){var h,y,d=e(133),b=e(134),_=0,g=0;t.exports=function(t,n,e){var r=n&&e||0,o=n||[],i=(t=t||{}).node||h,u=void 0!==t.clockseq?t.clockseq:y;if(null==i||null==u){var c=d();null==i&&(i=h=[1|c[0],c[1],c[2],c[3],c[4],c[5]]),null==u&&(u=y=16383&(c[6]<<8|c[7]));}var a=void 0!==t.msecs?t.msecs:(new Date).getTime(),s=void 0!==t.nsecs?t.nsecs:g+1,f=a-_+(s-g)/1e4;if(f<0&&void 0===t.clockseq&&(u=u+1&16383),(f<0||_<a)&&void 0===t.nsecs&&(s=0),1e4<=s)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_=a,y=u;var p=(1e4*(268435455&(a+=122192928e5))+(g=s))%4294967296;o[r++]=p>>>24&255,o[r++]=p>>>16&255,o[r++]=p>>>8&255,o[r++]=255&p;var l=a/4294967296*1e4&268435455;o[r++]=l>>>8&255,o[r++]=255&l,o[r++]=l>>>24&15|16,o[r++]=l>>>16&255,o[r++]=u>>>8|128,o[r++]=255&u;for(var v=0;v<6;++v)o[r+v]=i[v];return n||b(o)};},function(t,n){t.exports=function(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(!n(t[e],e,t))return !1;return !0};},function(t,n,e){var i=e(43);t.exports=function(t,r){var o=!0;return i(t,function(t,n,e){return o=!!r(t,n,e)}),o};},function(t,n,e){var r=e(44),o=e(60)(r);t.exports=o;},function(t,n,e){var r=e(45),o=e(16);t.exports=function(t,n){return t&&r(t,n,o)};},function(t,n,e){var r=e(46)();t.exports=r;},function(t,n){t.exports=function(a){return function(t,n,e){for(var r=-1,o=Object(t),i=e(t),u=i.length;u--;){var c=i[a?u:++r];if(!1===n(o[c],c,o))break}return t}};},function(t,n,e){var f=e(48),p=e(25),l=e(0),v=e(27),h=e(8),y=e(29),d=Object.prototype.hasOwnProperty;t.exports=function(t,n){var e=l(t),r=!e&&p(t),o=!e&&!r&&v(t),i=!e&&!r&&!o&&y(t),u=e||r||o||i,c=u?f(t.length,String):[],a=c.length;for(var s in t)!n&&!d.call(t,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||h(s,a))||c.push(s);return c};},function(t,n){t.exports=function(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r};},function(t,n,e){var r=e(3),o=e(4);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)};},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")();}catch(t){"object"==typeof window&&(e=window);}t.exports=e;},function(t,n,e){var r=e(7),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,c=r?r.toStringTag:void 0;t.exports=function(t){var n=i.call(t,c),e=t[c];try{var r=!(t[c]=void 0);}catch(t){}var o=u.call(t);return r&&(n?t[c]=e:delete t[c]),o};},function(t,n){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)};},function(t,n){t.exports=function(){return !1};},function(t,n,e){var r=e(3),o=e(17),i=e(4),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!u[r(t)]};},function(t,n){t.exports=function(n){return function(t){return n(t)}};},function(t,u,c){(function(t){var n=c(26),e=u&&!u.nodeType&&u,r=e&&"object"==typeof t&&t&&!t.nodeType&&t,o=r&&r.exports===e&&n.process,i=function(){try{var t=r&&r.require&&r.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i;}).call(this,c(28)(t));},function(t,n,e){var r=e(58),o=e(59),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var n=[];for(var e in Object(t))i.call(t,e)&&"constructor"!=e&&n.push(e);return n};},function(t,n){var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)};},function(t,n,e){var r=e(30)(Object.keys,Object);t.exports=r;},function(t,n,e){var c=e(18);t.exports=function(i,u){return function(t,n){if(null==t)return t;if(!c(t))return i(t,n);for(var e=t.length,r=u?e:-1,o=Object(t);(u?r--:++r<e)&&!1!==n(o[r],r,o););return t}};},function(t,n,e){var r=e(62),o=e(113),i=e(123),u=e(0),c=e(124);t.exports=function(t){return "function"==typeof t?t:null==t?i:"object"==typeof t?u(t)?o(t[0],t[1]):r(t):c(t)};},function(t,n,e){var r=e(63),o=e(112),i=e(37);t.exports=function(n){var e=o(n);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(t){return t===n||r(t,n,e)}};},function(t,n,e){var v=e(32),h=e(34);t.exports=function(t,n,e,r){var o=e.length,i=o,u=!r;if(null==t)return !i;for(t=Object(t);o--;){var c=e[o];if(u&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return !1}for(;++o<i;){var a=(c=e[o])[0],s=t[a],f=c[1];if(u&&c[2]){if(void 0===s&&!(a in t))return !1}else {var p=new v;if(r)var l=r(s,f,a,t,n,p);if(!(void 0===l?h(f,s,3,r,p):l))return !1}}return !0};},function(t,n){t.exports=function(){this.__data__=[],this.size=0;};},function(t,n,e){var r=e(10),o=Array.prototype.splice;t.exports=function(t){var n=this.__data__,e=r(n,t);return !(e<0)&&(e==n.length-1?n.pop():o.call(n,e,1),--this.size,!0)};},function(t,n,e){var r=e(10);t.exports=function(t){var n=this.__data__,e=r(n,t);return e<0?void 0:n[e][1]};},function(t,n,e){var r=e(10);t.exports=function(t){return -1<r(this.__data__,t)};},function(t,n,e){var o=e(10);t.exports=function(t,n){var e=this.__data__,r=o(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this};},function(t,n,e){var r=e(9);t.exports=function(){this.__data__=new r,this.size=0;};},function(t,n){t.exports=function(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e};},function(t,n){t.exports=function(t){return this.__data__.get(t)};},function(t,n){t.exports=function(t){return this.__data__.has(t)};},function(t,n,e){var o=e(9),i=e(19),u=e(20);t.exports=function(t,n){var e=this.__data__;if(e instanceof o){var r=e.__data__;if(!i||r.length<199)return r.push([t,n]),this.size=++e.size,this;e=this.__data__=new u(r);}return e.set(t,n),this.size=e.size,this};},function(t,n,e){var r=e(31),o=e(75),i=e(5),u=e(33),c=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,f=a.toString,p=s.hasOwnProperty,l=RegExp("^"+f.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return !(!i(t)||o(t))&&(r(t)?l:c).test(u(t))};},function(t,n,e){var r,o=e(76),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return !!i&&i in t};},function(t,n,e){var r=e(1)["__core-js_shared__"];t.exports=r;},function(t,n){t.exports=function(t,n){return null==t?void 0:t[n]};},function(t,n,e){var r=e(79),o=e(9),i=e(19);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r};};},function(t,n,e){var r=e(80),o=e(81),i=e(82),u=e(83),c=e(84);function a(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1]);}}a.prototype.clear=r,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=u,a.prototype.set=c,t.exports=a;},function(t,n,e){var r=e(12);t.exports=function(){this.__data__=r?r(null):{},this.size=0;};},function(t,n){t.exports=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n};},function(t,n,e){var r=e(12),o=Object.prototype.hasOwnProperty;t.exports=function(t){var n=this.__data__;if(r){var e=n[t];return "__lodash_hash_undefined__"===e?void 0:e}return o.call(n,t)?n[t]:void 0};},function(t,n,e){var r=e(12),o=Object.prototype.hasOwnProperty;t.exports=function(t){var n=this.__data__;return r?void 0!==n[t]:o.call(n,t)};},function(t,n,e){var r=e(12);t.exports=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=r&&void 0===n?"__lodash_hash_undefined__":n,this};},function(t,n,e){var r=e(13);t.exports=function(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n};},function(t,n){t.exports=function(t){var n=typeof t;return "string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t};},function(t,n,e){var r=e(13);t.exports=function(t){return r(this,t).get(t)};},function(t,n,e){var r=e(13);t.exports=function(t){return r(this,t).has(t)};},function(t,n,e){var o=e(13);t.exports=function(t,n){var e=o(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this};},function(t,n,e){var y=e(32),d=e(35),b=e(96),_=e(100),g=e(107),x=e(0),j=e(27),m=e(29),w="[object Arguments]",O="[object Array]",A="[object Object]",P=Object.prototype.hasOwnProperty;t.exports=function(t,n,e,r,o,i){var u=x(t),c=x(n),a=u?O:g(t),s=c?O:g(n),f=(a=a==w?A:a)==A,p=(s=s==w?A:s)==A,l=a==s;if(l&&j(t)){if(!j(n))return !1;f=!(u=!0);}if(l&&!f)return i=i||new y,u||m(t)?d(t,n,e,r,o,i):b(t,n,a,e,r,o,i);if(!(1&e)){var v=f&&P.call(t,"__wrapped__"),h=p&&P.call(n,"__wrapped__");if(v||h)return o(v?t.value():t,h?n.value():n,e,r,i=i||new y)}return l&&(i=i||new y,_(t,n,e,r,o,i))};},function(t,n,e){var r=e(20),o=e(92),i=e(93);function u(t){var n=-1,e=null==t?0:t.length;for(this.__data__=new r;++n<e;)this.add(t[n]);}u.prototype.add=u.prototype.push=o,u.prototype.has=i,t.exports=u;},function(t,n){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};},function(t,n){t.exports=function(t){return this.__data__.has(t)};},function(t,n){t.exports=function(t,n){for(var e=-1,r=null==t?0:t.length;++e<r;)if(n(t[e],e,t))return !0;return !1};},function(t,n){t.exports=function(t,n){return t.has(n)};},function(t,n,e){var r=e(7),p=e(97),l=e(11),v=e(35),h=e(98),y=e(99),o=r?r.prototype:void 0,d=o?o.valueOf:void 0;t.exports=function(t,n,e,r,o,i,u){switch(e){case"[object DataView]":if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return !1;t=t.buffer,n=n.buffer;case"[object ArrayBuffer]":return !(t.byteLength!=n.byteLength||!i(new p(t),new p(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return l(+t,+n);case"[object Error]":return t.name==n.name&&t.message==n.message;case"[object RegExp]":case"[object String]":return t==n+"";case"[object Map]":var c=h;case"[object Set]":var a=1&r;if(c=c||y,t.size!=n.size&&!a)return !1;var s=u.get(t);if(s)return s==n;r|=2,u.set(t,n);var f=v(c(t),c(n),r,o,i,u);return u.delete(t),f;case"[object Symbol]":if(d)return d.call(t)==d.call(n)}return !1};},function(t,n,e){var r=e(1).Uint8Array;t.exports=r;},function(t,n){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t];}),r};},function(t,n){t.exports=function(t){var n=-1,e=Array(t.size);return t.forEach(function(t){e[++n]=t;}),e};},function(t,n,e){var g=e(101),x=Object.prototype.hasOwnProperty;t.exports=function(t,n,e,r,o,i){var u=1&e,c=g(t),a=c.length;if(a!=g(n).length&&!u)return !1;for(var s=a;s--;){var f=c[s];if(!(u?f in n:x.call(n,f)))return !1}var p=i.get(t);if(p&&i.get(n))return p==n;var l=!0;i.set(t,n),i.set(n,t);for(var v=u;++s<a;){var h=t[f=c[s]],y=n[f];if(r)var d=u?r(y,h,f,n,t,i):r(h,y,f,t,n,i);if(!(void 0===d?h===y||o(h,y,e,r,i):d)){l=!1;break}v=v||"constructor"==f;}if(l&&!v){var b=t.constructor,_=n.constructor;b!=_&&"constructor"in t&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(l=!1);}return i.delete(t),i.delete(n),l};},function(t,n,e){var r=e(102),o=e(104),i=e(16);t.exports=function(t){return r(t,i,o)};},function(t,n,e){var o=e(103),i=e(0);t.exports=function(t,n,e){var r=n(t);return i(t)?r:o(r,e(t))};},function(t,n){t.exports=function(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t};},function(t,n,e){var r=e(105),o=e(106),i=Object.prototype.propertyIsEnumerable,u=Object.getOwnPropertySymbols,c=u?function(n){return null==n?[]:(n=Object(n),r(u(n),function(t){return i.call(n,t)}))}:o;t.exports=c;},function(t,n){t.exports=function(t,n){for(var e=-1,r=null==t?0:t.length,o=0,i=[];++e<r;){var u=t[e];n(u,e,t)&&(i[o++]=u);}return i};},function(t,n){t.exports=function(){return []};},function(t,n,e){var r=e(108),o=e(19),i=e(109),u=e(110),c=e(111),a=e(3),s=e(33),f="[object Map]",p="[object Promise]",l="[object Set]",v="[object WeakMap]",h="[object DataView]",y=s(r),d=s(o),b=s(i),_=s(u),g=s(c),x=a;(r&&x(new r(new ArrayBuffer(1)))!=h||o&&x(new o)!=f||i&&x(i.resolve())!=p||u&&x(new u)!=l||c&&x(new c)!=v)&&(x=function(t){var n=a(t),e="[object Object]"==n?t.constructor:void 0,r=e?s(e):"";if(r)switch(r){case y:return h;case d:return f;case b:return p;case _:return l;case g:return v}return n}),t.exports=x;},function(t,n,e){var r=e(2)(e(1),"DataView");t.exports=r;},function(t,n,e){var r=e(2)(e(1),"Promise");t.exports=r;},function(t,n,e){var r=e(2)(e(1),"Set");t.exports=r;},function(t,n,e){var r=e(2)(e(1),"WeakMap");t.exports=r;},function(t,n,e){var i=e(36),u=e(16);t.exports=function(t){for(var n=u(t),e=n.length;e--;){var r=n[e],o=t[r];n[e]=[r,o,i(o)];}return n};},function(t,n,e){var o=e(34),i=e(14),u=e(120),c=e(22),a=e(36),s=e(37),f=e(6);t.exports=function(e,r){return c(e)&&a(r)?s(f(e),r):function(t){var n=i(t,e);return void 0===n&&n===r?u(t,e):o(r,n,3)}};},function(t,n,e){var r=e(115),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=/\\(\\)?/g,o=r(function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(i,function(t,n,e,r){o.push(e?r.replace(u,"$1"):n||t);}),o});t.exports=o;},function(t,n,e){var r=e(116);t.exports=function(t){var n=r(t,function(t){return 500===e.size&&e.clear(),t}),e=n.cache;return n};},function(t,n,e){var r=e(20),c="Expected a function";function a(o,i){if("function"!=typeof o||null!=i&&"function"!=typeof i)throw new TypeError(c);var u=function(){var t=arguments,n=i?i.apply(this,t):t[0],e=u.cache;if(e.has(n))return e.get(n);var r=o.apply(this,t);return u.cache=e.set(n,r)||e,r};return u.cache=new(a.Cache||r),u}a.Cache=r,t.exports=a;},function(t,n,e){var r=e(118);t.exports=function(t){return null==t?"":r(t)};},function(t,n,e){var r=e(7),o=e(119),i=e(0),u=e(23),c=1/0,a=r?r.prototype:void 0,s=a?a.toString:void 0;t.exports=function t(n){if("string"==typeof n)return n;if(i(n))return o(n,t)+"";if(u(n))return s?s.call(n):"";var e=n+"";return "0"==e&&1/n==-c?"-0":e};},function(t,n){t.exports=function(t,n){for(var e=-1,r=null==t?0:t.length,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o};},function(t,n,e){var r=e(121),o=e(122);t.exports=function(t,n){return null!=t&&o(t,n,r)};},function(t,n){t.exports=function(t,n){return null!=t&&n in Object(t)};},function(t,n,e){var c=e(21),a=e(25),s=e(0),f=e(8),p=e(17),l=e(6);t.exports=function(t,n,e){for(var r=-1,o=(n=c(n,t)).length,i=!1;++r<o;){var u=l(n[r]);if(!(i=null!=t&&e(t,u)))break;t=t[u];}return i||++r!=o?i:!!(o=null==t?0:t.length)&&p(o)&&f(u,o)&&(s(t)||a(t))};},function(t,n){t.exports=function(t){return t};},function(t,n,e){var r=e(125),o=e(126),i=e(22),u=e(6);t.exports=function(t){return i(t)?r(u(t)):o(t)};},function(t,n){t.exports=function(n){return function(t){return null==t?void 0:t[n]}};},function(t,n,e){var r=e(38);t.exports=function(n){return function(t){return r(t,n)}};},function(t,n,e){var o=e(11),i=e(18),u=e(8),c=e(5);t.exports=function(t,n,e){if(!c(e))return !1;var r=typeof n;return !!("number"==r?i(e)&&u(n,e.length):"string"==r&&n in e)&&o(e[n],t)};},function(t,n,e){var r=e(30)(Object.getPrototypeOf,Object);t.exports=r;},function(t,n,e){var p=e(130),l=e(21),v=e(8),h=e(5),y=e(6);t.exports=function(t,n,e,r){if(!h(t))return t;for(var o=-1,i=(n=l(n,t)).length,u=i-1,c=t;null!=c&&++o<i;){var a=y(n[o]),s=e;if(o!=u){var f=c[a];void 0===(s=r?r(f,a,c):void 0)&&(s=h(f)?f:v(n[o+1])?[]:{});}p(c,a,s),c=c[a];}return t};},function(t,n,e){var o=e(131),i=e(11),u=Object.prototype.hasOwnProperty;t.exports=function(t,n,e){var r=t[n];u.call(t,n)&&i(r,e)&&(void 0!==e||n in t)||o(t,n,e);};},function(t,n,e){var r=e(132);t.exports=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e;};},function(t,n,e){var r=e(2),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o;},function(t,n){var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(e){var r=new Uint8Array(16);t.exports=function(){return e(r),r};}else {var o=new Array(16);t.exports=function(){for(var t,n=0;n<16;n++)0==(3&n)&&(t=4294967296*Math.random()),o[n]=t>>>((3&n)<<3)&255;return o};}},function(t,n){for(var o=[],e=0;e<256;++e)o[e]=(e+256).toString(16).substr(1);t.exports=function(t,n){var e=n||0,r=o;return [r[t[e++]],r[t[e++]],r[t[e++]],r[t[e++]],"-",r[t[e++]],r[t[e++]],"-",r[t[e++]],r[t[e++]],"-",r[t[e++]],r[t[e++]],"-",r[t[e++]],r[t[e++]],r[t[e++]],r[t[e++]],r[t[e++]],r[t[e++]]].join("")};},function(t,n,e){e.r(n);var r=e(39),a=e.n(r),o=e(0),s=e.n(o),i=e(15),f=e.n(i);var u=e(14),p=e.n(u),c=e(24),l=e.n(c),v=e(40),h=e.n(v);function y(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function d(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}function b(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}e.d(n,"default",function(){return m});var _,g,j="__FUNCTION__",m=(_=w,(g=[{key:"_handleQueue",value:function(){var r=this;this._queue.forEach(function(t){var n=t.message,e=t.msgChan;r._target.postMessage(n,r._targetOrigin,[e.port2]);}),this._queue=[];}},{key:"_publish",value:function(e){var t=e.data,n=t.type,r=t.data,o=t.meta,i=this._parseFunction(n,r,o.functionKeys),u=(this._subscribers[n]||[]).map(function(t){return function(o){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new Promise(function(t,n){try{var e=o.apply(void 0,r);e&&e.then?e.then(t).catch(n):t(e);}catch(t){n(t);}})}}(t)(i,e.data,e).then(function(t){if(t)return {type:n,data:t}}).catch(function(t){return {type:n,error:t.message}})});Promise.all(u).then(function(t){t=t.filter(function(t){return !!t});var n={};t.forEach(function(t){Object.assign(n,t);}),e.ports[0].postMessage(n);});}},{key:"_subscribeFunction",value:function(t,n){this.unsubscribe(t),this.subscribe(t,function(t){return n.apply(void 0,y(t))});}},{key:"_stringifyFunction",value:function(i,r,t){var u=this,c=2<arguments.length&&void 0!==t?t:[];if(c&&0!==c.length)return c.forEach(function(t){var n=p()(r,t),e="".concat(j).concat(i,"_").concat(t);u._subscribeFunction(e,n),l()(r,t,e);}),{data:r,keys:c};if("function"!=typeof r)return function r(o,i,t){var u=2<arguments.length&&void 0!==t?t:"";return a()(o,function(t,n){var e="".concat(u,"[").concat(n,"]");return "number"!=typeof n&&(e=u?"".concat(u,".").concat(n):"".concat(n)),!1===i(t,n,o,e)||!f()(t)&&!s()(t)||r(t,i,e)})}(r,function(t,n,e,r){if("function"==typeof t){var o="".concat(j).concat(i,"_").concat(r);u._subscribeFunction(o,t),e[n]=o,c.push(r);}}),{data:r,keys:c};var n="".concat(j).concat(i);return this._subscribeFunction(n,r),{data:n,keys:[""]}}},{key:"_parseFunction",value:function(e,o,t){var i=this,n=2<arguments.length&&void 0!==t?t:[];return 0===n.length?o:1===n.length&&""===n[0]?function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return i.postMessage(o,n)}:(n.forEach(function(t){var n=t.replace("".concat(j).concat(e,"_"),""),r=p()(o,n);l()(o,n,function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return i.postMessage(r,n)});}),o)}},{key:"_subscribe",value:function(e,t){var r=this;this._subscribers[e]||(this._subscribers[e]=[]);var o=this._subscribers[e];t.forEach(function(t){if(o.includes(t)||o.push(t),"connect"===e&&r._isTargetReady){var n={source:r._target};t(n.data,n);}});}},{key:"subscribe",value:function(e,t){var r=this;"string"!=typeof e&&!f()(e)||"string"==typeof e&&!t||("string"==typeof e&&(e=b({},e,t)),Object.keys(e).forEach(function(t){var n=e[t];"function"==typeof n&&(n=[n]),r._subscribe(t,n);}));}},{key:"unsubscribe",value:function(t,n){if(void 0!==t){var e=this._subscribers[t]||[];if(void 0!==n){var r=e.indexOf(n);-1<r&&e.splice(r,1);}else this._subscribers[t]=[];}else this._subscribers={};}},{key:"postMessage",value:function(a,s,t){var f=this,p=2<arguments.length&&void 0!==t?t:{};return new Promise(function(o,i){var t=new MessageChannel;t.port1.onmessage=function(t){var n=t.data,e=n.data,r=n.error;r?i(new Error(r)):o(e);};var n={type:a,data:s,meta:{id:f._id}},e=p.hasFunction,r=p.functionKeys,u=void 0===r?[]:r;if(!0===e){var c=f._stringifyFunction(a,s,u);n.data=c.data,n.meta.functionKeys=c.keys;}f._isTargetReady||"pre_connect"===a?f._target.postMessage(n,f._targetOrigin,[t.port2]):f._queue.push({message:n,msgChan:t});})}},{key:"_preConnect",value:function(){function t(){i++,r.postMessage("pre_connect",r._id).then(function(t){e&&(clearTimeout(e),e=void 0),o[0]&&(o[0](t),o=[]);}).catch(function(t){e&&(clearTimeout(e),e=void 0),o[1]&&(o[1](t),o=[]);});}var e,r=this,o=[],i=0,n=new Promise(function(t,n){o[0]=t,o[1]=n;});return t(),function t(n){!r._isTargetReady&&i>=r._maxAttempts?o[1]&&(o[1](new Error("Exceed the max attempts, connect failed.")),o=[]):e=setTimeout(function(){n(),t(n);},r._attemptInterval);}(t),n}},{key:"connect",value:function(){var n=this;return this._target?this._isTargetReady?Promise.resolve("Target has already connected."):this._preConnect().then(function(t){return n._targetId=t,n._isTargetReady=!0,n._handleQueue(),n.postMessage("connect")}).catch(function(t){throw n._isTargetReady=!1,t}):Promise.reject(new Error("Target is not exist."))}},{key:"clearQueue",value:function(){this._queue=[];}},{key:"destory",value:function(){this._subscribers={},this._targetOrigin="",this._target=void 0,this._queue=[],this._isTargetReady=!1,window.removeEventListener("message",this._handleMessage);}}])&&d(_.prototype,g),w);function w(){var o=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,w),b(this,"_handleMessage",function(t){if(t.origin===o._targetOrigin||"*"===o._targetOrigin){var n=t.data,e=n.type,r=n.meta;"pre_connect"!==e&&(void 0===r?{}:r).id!==o._targetId||o._publish(t);}}),b(this,"_handlePreConnect",function(t,n,e){var r=e.source;if(o._target&&o._target!==r)throw new Error("Connection is rejected.");return o._target=r,o._targetId=t,o._id}),b(this,"_handleConnect",function(t,n,e){o._isTargetReady=!0,o._handleQueue();});var n=t.targetOrigin,e=void 0===n?"":n,r=t.subscribers,i=void 0===r?{}:r,u=t.target,c=t.attemptInterval,a=void 0===c?1e3:c,s=t.maxAttempts,f=void 0===s?10:s;if(u===window)throw new Error("The target can not be current window.");this._subscribers=i,this._targetOrigin=e,this._target=u,this._queue=[],this._isTargetReady=!1,this._id=h()(),this._targetId="",this._attemptInterval=a,this._maxAttempts=f,this.subscribe("pre_connect",this._handlePreConnect),this.subscribe("connect",this._handleConnect),window.addEventListener("message",this._handleMessage,!1),window.addEventListener("beforeunload",function(){o.destory();});}}],o.c=r,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e});},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var r in n)o.d(e,r,function(t){return n[t]}.bind(null,r));return e},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=135);function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var e,r;});
239
+ }(lib));
240
+
241
+ var Channel = /*@__PURE__*/getDefaultExportFromCjs(lib.exports);
242
+
243
+ var dec2hex = function dec2hex(dec) {
244
+ return dec.toString(16).padStart(2, "0");
245
+ }; // generateId :: Integer -> String
246
+
247
+
248
+ function generateCallId() {
249
+ var arr = new Uint8Array((10 ) / 2);
250
+ window.crypto.getRandomValues(arr);
251
+ return Array.from(arr, dec2hex).join('');
252
+ }
253
+ var BaseCallClass = /*#__PURE__*/function () {
254
+ function BaseCallClass(call) {
255
+ var _this = this;
256
+
257
+ _classCallCheck(this, BaseCallClass);
258
+
259
+ _defineProperty(this, "serviceName", '');
260
+
261
+ _defineProperty(this, "call", void 0);
262
+
263
+ this.call = function (fun) {
264
+ for (var _len = arguments.length, arg = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
265
+ arg[_key - 1] = arguments[_key];
266
+ }
267
+
268
+ return call.apply(void 0, [_this.serviceName, fun].concat(arg));
269
+ };
270
+ }
271
+
272
+ _createClass(BaseCallClass, [{
273
+ key: "update",
274
+ value: function update(payload) {
275
+ var attributes = payload[this.serviceName];
276
+
277
+ if (attributes) {
278
+ BaseCallClass.update(this, attributes);
279
+ }
280
+ }
281
+ }], [{
282
+ key: "update",
283
+ value: function update(target, payload) {
284
+ Object.keys(payload).forEach(function (key) {
285
+ target[key] = payload[key];
286
+ });
287
+ }
288
+ }]);
289
+
290
+ return BaseCallClass;
291
+ }();
292
+
293
+ var BackofficeCatalog = /*#__PURE__*/function (_BaseCallClass) {
294
+ _inherits(BackofficeCatalog, _BaseCallClass);
295
+
296
+ var _super = _createSuper(BackofficeCatalog);
297
+
298
+ function BackofficeCatalog() {
299
+ var _this;
300
+
301
+ _classCallCheck(this, BackofficeCatalog);
302
+
303
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
304
+ args[_key] = arguments[_key];
305
+ }
306
+
307
+ _this = _super.call.apply(_super, [this].concat(args));
308
+
309
+ _defineProperty(_assertThisInitialized(_this), "serviceName", 'catalog');
310
+
311
+ return _this;
312
+ }
313
+
314
+ _createClass(BackofficeCatalog, [{
315
+ key: "fetchCategories",
316
+ value: function fetchCategories() {
317
+ return this.call('fetchCategories');
318
+ }
319
+ }, {
320
+ key: "fetchProduct",
321
+ value: function fetchProduct(id) {
322
+ return this.call('fetchProduct', id);
323
+ }
324
+ }]);
325
+
326
+ return BackofficeCatalog;
327
+ }(BaseCallClass);
328
+ var BackofficeUser = /*#__PURE__*/function (_BaseCallClass2) {
329
+ _inherits(BackofficeUser, _BaseCallClass2);
330
+
331
+ var _super2 = _createSuper(BackofficeUser);
332
+
333
+ function BackofficeUser() {
334
+ var _this2;
335
+
336
+ _classCallCheck(this, BackofficeUser);
337
+
338
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
339
+ args[_key2] = arguments[_key2];
340
+ }
341
+
342
+ _this2 = _super2.call.apply(_super2, [this].concat(args));
343
+
344
+ _defineProperty(_assertThisInitialized(_this2), "serviceName", 'user');
345
+
346
+ _defineProperty(_assertThisInitialized(_this2), "email", void 0);
347
+
348
+ _defineProperty(_assertThisInitialized(_this2), "id", void 0);
349
+
350
+ _defineProperty(_assertThisInitialized(_this2), "name", void 0);
351
+
352
+ _defineProperty(_assertThisInitialized(_this2), "authorities", void 0);
353
+
354
+ return _this2;
355
+ }
356
+
357
+ return _createClass(BackofficeUser);
358
+ }(BaseCallClass);
359
+ var BackofficeTenant = /*#__PURE__*/function (_BaseCallClass3) {
360
+ _inherits(BackofficeTenant, _BaseCallClass3);
361
+
362
+ var _super3 = _createSuper(BackofficeTenant);
363
+
364
+ function BackofficeTenant() {
365
+ var _this3;
366
+
367
+ _classCallCheck(this, BackofficeTenant);
368
+
369
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
370
+ args[_key3] = arguments[_key3];
371
+ }
372
+
373
+ _this3 = _super3.call.apply(_super3, [this].concat(args));
374
+
375
+ _defineProperty(_assertThisInitialized(_this3), "serviceName", 'tenant');
376
+
377
+ _defineProperty(_assertThisInitialized(_this3), "tenantKey", void 0);
378
+
379
+ _defineProperty(_assertThisInitialized(_this3), "language", void 0);
380
+
381
+ _defineProperty(_assertThisInitialized(_this3), "currency", void 0);
382
+
383
+ return _this3;
384
+ }
385
+
386
+ return _createClass(BackofficeTenant);
387
+ }(BaseCallClass);
388
+ var BackofficeOrderpath = /*#__PURE__*/function (_BaseCallClass4) {
389
+ _inherits(BackofficeOrderpath, _BaseCallClass4);
390
+
391
+ var _super4 = _createSuper(BackofficeOrderpath);
392
+
393
+ function BackofficeOrderpath() {
394
+ var _this4;
395
+
396
+ _classCallCheck(this, BackofficeOrderpath);
397
+
398
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
399
+ args[_key4] = arguments[_key4];
400
+ }
401
+
402
+ _this4 = _super4.call.apply(_super4, [this].concat(args));
403
+
404
+ _defineProperty(_assertThisInitialized(_this4), "serviceName", 'orderpath');
405
+
406
+ return _this4;
407
+ }
408
+
409
+ return _createClass(BackofficeOrderpath);
410
+ }(BaseCallClass);
411
+ var BackofficeLayout = /*#__PURE__*/function (_BaseCallClass5) {
412
+ _inherits(BackofficeLayout, _BaseCallClass5);
413
+
414
+ var _super5 = _createSuper(BackofficeLayout);
415
+
416
+ function BackofficeLayout() {
417
+ var _this5;
418
+
419
+ _classCallCheck(this, BackofficeLayout);
420
+
421
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
422
+ args[_key5] = arguments[_key5];
423
+ }
424
+
425
+ _this5 = _super5.call.apply(_super5, [this].concat(args));
426
+
427
+ _defineProperty(_assertThisInitialized(_this5), "serviceName", 'layout');
428
+
429
+ _defineProperty(_assertThisInitialized(_this5), "isAsideOpened", void 0);
430
+
431
+ return _this5;
432
+ }
433
+
434
+ return _createClass(BackofficeLayout);
435
+ }(BaseCallClass);
436
+
437
+ var Events = /*#__PURE__*/function () {
438
+ function Events() {
439
+ _classCallCheck(this, Events);
440
+
441
+ _defineProperty(this, "_callbacks", void 0);
442
+
443
+ this._callbacks = {};
444
+ }
445
+
446
+ _createClass(Events, [{
447
+ key: "on",
448
+ value: function on(key, callback) {
449
+ // create an empty array for the event key
450
+ if (this._callbacks[key] === undefined) {
451
+ this._callbacks[key] = [];
452
+ } // save the callback in the array for the event key
453
+
454
+
455
+ this._callbacks[key].push(callback);
456
+ }
457
+ }, {
458
+ key: "emit",
459
+ value: function emit(key) {
460
+ // if the key exists
461
+ if (this._callbacks[key] !== undefined) {
462
+ for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
463
+ params[_key - 1] = arguments[_key];
464
+ }
465
+
466
+ // iterate through the callbacks for the event key
467
+ for (var i = 0; i < this._callbacks[key].length; i++) {
468
+ var _this$_callbacks$key;
469
+
470
+ // trigger the callbacks with all provided params
471
+ (_this$_callbacks$key = this._callbacks[key])[i].apply(_this$_callbacks$key, params);
472
+ }
473
+ }
474
+ }
475
+ }]);
476
+
477
+ return Events;
478
+ }();
479
+
480
+ var ShopCatalog = /*#__PURE__*/function (_BaseCallClass) {
481
+ _inherits(ShopCatalog, _BaseCallClass);
482
+
483
+ var _super = _createSuper(ShopCatalog);
484
+
485
+ function ShopCatalog() {
486
+ var _this;
487
+
488
+ _classCallCheck(this, ShopCatalog);
489
+
490
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
491
+ args[_key] = arguments[_key];
492
+ }
493
+
494
+ _this = _super.call.apply(_super, [this].concat(args));
495
+
496
+ _defineProperty(_assertThisInitialized(_this), "serviceName", 'catalog');
497
+
498
+ _defineProperty(_assertThisInitialized(_this), "categories", void 0);
499
+
500
+ _defineProperty(_assertThisInitialized(_this), "selectedCategoryId", void 0);
501
+
502
+ return _this;
503
+ }
504
+
505
+ _createClass(ShopCatalog, [{
506
+ key: "fetchProduct",
507
+ value: function fetchProduct(productId) {
508
+ return this.call('fetchProduct', productId);
509
+ }
510
+ }, {
511
+ key: "getCategoryById",
512
+ value: function getCategoryById(categoryId) {
513
+ return this.call('getCategoryById', categoryId);
514
+ }
515
+ }]);
516
+
517
+ return ShopCatalog;
518
+ }(BaseCallClass);
519
+ var ShopAccount = /*#__PURE__*/function (_BaseCallClass2) {
520
+ _inherits(ShopAccount, _BaseCallClass2);
521
+
522
+ var _super2 = _createSuper(ShopAccount);
523
+
524
+ function ShopAccount() {
525
+ var _this2;
526
+
527
+ _classCallCheck(this, ShopAccount);
528
+
529
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
530
+ args[_key2] = arguments[_key2];
531
+ }
532
+
533
+ _this2 = _super2.call.apply(_super2, [this].concat(args));
534
+
535
+ _defineProperty(_assertThisInitialized(_this2), "serviceName", 'account');
536
+
537
+ _defineProperty(_assertThisInitialized(_this2), "client", void 0);
538
+
539
+ _defineProperty(_assertThisInitialized(_this2), "isAuthenticated", void 0);
540
+
541
+ _defineProperty(_assertThisInitialized(_this2), "user", void 0);
542
+
543
+ _defineProperty(_assertThisInitialized(_this2), "manager", void 0);
544
+
545
+ return _this2;
546
+ }
547
+
548
+ _createClass(ShopAccount, [{
549
+ key: "hasSegment",
550
+ value: function hasSegment(name) {
551
+ return this.call('hasSegment', name);
552
+ }
553
+ }, {
554
+ key: "logout",
555
+ value: function logout() {// NotImplementedYet
556
+ }
557
+ }]);
558
+
559
+ return ShopAccount;
560
+ }(BaseCallClass);
561
+ var ShopCart = /*#__PURE__*/function (_BaseCallClass3) {
562
+ _inherits(ShopCart, _BaseCallClass3);
563
+
564
+ var _super3 = _createSuper(ShopCart);
565
+
566
+ function ShopCart() {
567
+ var _this3;
568
+
569
+ _classCallCheck(this, ShopCart);
570
+
571
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
572
+ args[_key3] = arguments[_key3];
573
+ }
574
+
575
+ _this3 = _super3.call.apply(_super3, [this].concat(args));
576
+
577
+ _defineProperty(_assertThisInitialized(_this3), "serviceName", 'cart');
578
+
579
+ _defineProperty(_assertThisInitialized(_this3), "carts", void 0);
580
+
581
+ _defineProperty(_assertThisInitialized(_this3), "currentCart", void 0);
582
+
583
+ _defineProperty(_assertThisInitialized(_this3), "totalCartPrice", void 0);
584
+
585
+ return _this3;
586
+ }
587
+
588
+ _createClass(ShopCart, [{
589
+ key: "addToCart",
590
+ value: function addToCart(productId, amount, where, cartId) {
591
+ return this.call('addToCart', productId, amount, where, cartId);
592
+ }
593
+ }]);
594
+
595
+ return ShopCart;
596
+ }(BaseCallClass);
597
+ var ShopUtils = /*#__PURE__*/function (_BaseCallClass4) {
598
+ _inherits(ShopUtils, _BaseCallClass4);
599
+
600
+ var _super4 = _createSuper(ShopUtils);
601
+
602
+ function ShopUtils(call) {
603
+ var _this4;
604
+
605
+ _classCallCheck(this, ShopUtils);
606
+
607
+ _this4 = _super4.call(this, call);
608
+
609
+ _defineProperty(_assertThisInitialized(_this4), "serviceName", 'utils');
610
+
611
+ _defineProperty(_assertThisInitialized(_this4), "currency", void 0);
612
+
613
+ _defineProperty(_assertThisInitialized(_this4), "isAnonymousAndPurchaseDisabled", void 0);
614
+
615
+ _defineProperty(_assertThisInitialized(_this4), "isB2B", void 0);
616
+
617
+ _defineProperty(_assertThisInitialized(_this4), "isB2BAndPlatformIsNotOpened", void 0);
618
+
619
+ _defineProperty(_assertThisInitialized(_this4), "isIndexPage", void 0);
620
+
621
+ _defineProperty(_assertThisInitialized(_this4), "isPurchaseEnabledOrAuthenticated", void 0);
622
+
623
+ _defineProperty(_assertThisInitialized(_this4), "routes", void 0);
624
+
625
+ _this4.routes = {
626
+ getCategoryPath: _this4.getCategoryPath,
627
+ getManufacturerSearchUrl: _this4.getManufacturerSearchUrl,
628
+ getProductUrl: _this4.getProductUrl,
629
+ isExternalUrl: _this4.isExternalUrl
630
+ };
631
+ return _this4;
632
+ }
633
+
634
+ _createClass(ShopUtils, [{
635
+ key: "getCategoryPath",
636
+ value: function getCategoryPath(id) {
637
+ return this.call('getCategoryPath', id);
638
+ }
639
+ }, {
640
+ key: "getManufacturerSearchUrl",
641
+ value: function getManufacturerSearchUrl(manufacturer) {
642
+ return this.call('getManufacturerSearchUrl', manufacturer);
643
+ }
644
+ }, {
645
+ key: "getProductUrl",
646
+ value: function getProductUrl(product) {
647
+ return this.call('getProductUrl', product);
648
+ }
649
+ }, {
650
+ key: "isExternalUrl",
651
+ value: function isExternalUrl(url) {
652
+ return this.call('isExternalUrl', url);
653
+ }
654
+ }]);
655
+
656
+ return ShopUtils;
657
+ }(BaseCallClass);
658
+ var ShopConfig = /*#__PURE__*/function (_BaseCallClass5) {
659
+ _inherits(ShopConfig, _BaseCallClass5);
660
+
661
+ var _super5 = _createSuper(ShopConfig);
662
+
663
+ function ShopConfig() {
664
+ var _this5;
665
+
666
+ _classCallCheck(this, ShopConfig);
667
+
668
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
669
+ args[_key4] = arguments[_key4];
670
+ }
671
+
672
+ _this5 = _super5.call.apply(_super5, [this].concat(args));
673
+
674
+ _defineProperty(_assertThisInitialized(_this5), "serviceName", 'config');
675
+
676
+ _defineProperty(_assertThisInitialized(_this5), "accessMode", void 0);
677
+
678
+ _defineProperty(_assertThisInitialized(_this5), "isB2CRegistrationEnabled", void 0);
679
+
680
+ _defineProperty(_assertThisInitialized(_this5), "isCatalogOpened", void 0);
681
+
682
+ _defineProperty(_assertThisInitialized(_this5), "isGrossSelected", void 0);
683
+
684
+ _defineProperty(_assertThisInitialized(_this5), "isPlatformClosed", void 0);
685
+
686
+ _defineProperty(_assertThisInitialized(_this5), "isPlatformOpened", void 0);
687
+
688
+ _defineProperty(_assertThisInitialized(_this5), "isPurchaseEnabled", void 0);
689
+
690
+ _defineProperty(_assertThisInitialized(_this5), "isRegistrationEnabled", void 0);
691
+
692
+ _defineProperty(_assertThisInitialized(_this5), "currency", void 0);
693
+
694
+ return _this5;
695
+ }
696
+
697
+ return _createClass(ShopConfig);
698
+ }(BaseCallClass);
699
+
700
+ var SdkInternalEvents;
701
+
702
+ (function (SdkInternalEvents) {
703
+ SdkInternalEvents["INIT"] = "INIT";
704
+ SdkInternalEvents["UPDATE"] = "UPDATE";
705
+ })(SdkInternalEvents || (SdkInternalEvents = {}));
706
+
707
+ var SdkEvents;
708
+
709
+ (function (SdkEvents) {
710
+ SdkEvents["INIT"] = "INIT";
711
+ SdkEvents["UPDATE"] = "UPDATE";
712
+ })(SdkEvents || (SdkEvents = {}));
713
+
714
+ var Sdk = /*#__PURE__*/function (_Events) {
715
+ _inherits(Sdk, _Events);
716
+
717
+ var _super = _createSuper(Sdk);
718
+
719
+ function Sdk(options) {
720
+ var _this;
721
+
722
+ _classCallCheck(this, Sdk);
723
+
724
+ _this = _super.call(this);
725
+
726
+ _defineProperty(_assertThisInitialized(_this), "channel", void 0);
727
+
728
+ _defineProperty(_assertThisInitialized(_this), "autoheight", true);
729
+
730
+ _defineProperty(_assertThisInitialized(_this), "origin", void 0);
731
+
732
+ _defineProperty(_assertThisInitialized(_this), "isInitialized", false);
733
+
734
+ _defineProperty(_assertThisInitialized(_this), "instances", void 0);
735
+
736
+ _this.initializeServiceGetters();
737
+
738
+ _this.origin = options.origin;
739
+ _this.channel = new Channel({
740
+ targetOrigin: _this.origin,
741
+ target: window.parent
742
+ });
743
+
744
+ _this.channel.subscribe(main.Message.INIT, function (payload) {
745
+ Sdk.log('Handling INIT message');
746
+ Object.entries(_this.instances).forEach(function (_ref) {
747
+ var _ref2 = _slicedToArray(_ref, 2),
748
+ key = _ref2[0],
749
+ value = _ref2[1];
750
+
751
+ if (value instanceof BaseCallClass) {
752
+ value.update(payload);
753
+ } else {
754
+ var attributesForKey = payload[key];
755
+
756
+ if (typeof attributesForKey !== 'undefined') {
757
+ BaseCallClass.update(value, payload[key]);
758
+ } else {
759
+ Sdk.warn("Missing attributes for ".concat(key, " in "), payload);
760
+ }
761
+ }
762
+ });
763
+ Sdk.log('Emitting INIT with payload ', _this.instances);
764
+
765
+ _this.emit(SdkInternalEvents.INIT, _this.instances);
766
+
767
+ _this.isInitialized = true;
768
+ });
769
+
770
+ _this.channel.subscribe(main.Message.UPDATE, function (payload) {
771
+ Sdk.log('Emitting UPDATE with payload ', payload);
772
+
773
+ _this.emit(SdkInternalEvents.UPDATE, payload);
774
+ });
775
+
776
+ _this.channel.subscribe(main.Message.FRAME_HEIGHT_REQUEST, function (payload) {
777
+ if (_this.autoheight) {
778
+ Sdk.log('Request for iframe height');
779
+ var body = document.body,
780
+ html = document.documentElement;
781
+ var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
782
+
783
+ _this.channel.postMessage(main.Message.FRAME_HEIGHT_CHANGE, height);
784
+ }
785
+ });
786
+
787
+ _this.channel.connect().then(function () {
788
+ Sdk.log('Connected with ONe SDK');
789
+ });
790
+
791
+ _this.setupOptions(options);
792
+
793
+ Sdk.log('Initialized.');
794
+ return _this;
795
+ }
796
+
797
+ _createClass(Sdk, [{
798
+ key: "initializeServiceGetters",
799
+ value: function initializeServiceGetters() {
800
+ var _this2 = this;
801
+
802
+ if (this.instances) {
803
+ Object.keys(this.instances).forEach(function (serviceName) {
804
+ Object.defineProperty(_this2, serviceName, {
805
+ get: function get() {
806
+ return _this2.isInitialized ? _this2.instances[serviceName] : null;
807
+ }
808
+ });
809
+ });
810
+ }
811
+ }
812
+ }, {
813
+ key: "setupOptions",
814
+ value: function setupOptions(options) {
815
+ if (options) {
816
+ if (typeof options.debug !== 'undefined') {
817
+ Sdk.debug = options.debug;
818
+ }
819
+
820
+ if (typeof options.autoheight !== 'undefined') {
821
+ this.autoheight = options.autoheight;
822
+ }
823
+ }
824
+ }
825
+ }, {
826
+ key: "callFunction",
827
+ value: function callFunction(service, fun) {
828
+ var _this3 = this;
829
+
830
+ var callId = generateCallId();
831
+
832
+ if (this.isInitialized) {
833
+ for (var _len = arguments.length, payload = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
834
+ payload[_key - 2] = arguments[_key];
835
+ }
836
+
837
+ Sdk.log("Call ID ".concat(callId, " for ").concat(service, ":").concat(fun), payload);
838
+ this.channel.postMessage(main.Message.METHOD_CALL, {
839
+ callId: callId,
840
+ service: service,
841
+ method: fun,
842
+ payload: payload
843
+ });
844
+ return new Promise(function (resolve) {
845
+ var onChannelMessage = function onChannelMessage(response) {
846
+ if (response.callId === callId) {
847
+ _this3.channel.unsubscribe(main.Message.METHOD_RESULT, onChannelMessage);
848
+
849
+ return resolve(response.result);
850
+ }
851
+ };
852
+
853
+ _this3.channel.subscribe(main.Message.METHOD_RESULT, onChannelMessage);
854
+ });
855
+ }
856
+
857
+ Sdk.log('SDK is not initialized!');
858
+ return Promise.resolve(null);
859
+ }
860
+ }, {
861
+ key: "navigate",
862
+ value: function navigate(event) {
863
+ this.channel.postMessage(main.Message.NAVIGATION_PUSH, event);
864
+ }
865
+ }], [{
866
+ key: "log",
867
+ value: function log() {
868
+ var _console;
869
+
870
+ for (var _len2 = arguments.length, data = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
871
+ data[_key2] = arguments[_key2];
872
+ }
873
+
874
+ Sdk.debug && (_console = console).log.apply(_console, ['[SDK Core] '].concat(data));
875
+ }
876
+ }, {
877
+ key: "warn",
878
+ value: function warn() {
879
+ var _console2;
880
+
881
+ for (var _len3 = arguments.length, data = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
882
+ data[_key3] = arguments[_key3];
883
+ }
884
+
885
+ (_console2 = console).warn.apply(_console2, ['[SDK Core] '].concat(data));
886
+ }
887
+ }]);
888
+
889
+ return Sdk;
890
+ }(Events);
891
+
892
+ _defineProperty(Sdk, "debug", false);
893
+
894
+ var BackofficeSdk = /*#__PURE__*/function (_Sdk) {
895
+ _inherits(BackofficeSdk, _Sdk);
896
+
897
+ var _super2 = _createSuper(BackofficeSdk);
898
+
899
+ function BackofficeSdk() {
900
+ var _this4;
901
+
902
+ _classCallCheck(this, BackofficeSdk);
903
+
904
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
905
+ args[_key4] = arguments[_key4];
906
+ }
907
+
908
+ _this4 = _super2.call.apply(_super2, [this].concat(args));
909
+
910
+ _defineProperty(_assertThisInitialized(_this4), "instances", {
911
+ route: {
912
+ hash: '',
913
+ query: {}
914
+ },
915
+ orderpath: new BackofficeOrderpath(_this4.callFunction.bind(_assertThisInitialized(_this4))),
916
+ catalog: new BackofficeCatalog(_this4.callFunction.bind(_assertThisInitialized(_this4))),
917
+ user: new BackofficeUser(_this4.callFunction.bind(_assertThisInitialized(_this4))),
918
+ tenant: new BackofficeTenant(_this4.callFunction.bind(_assertThisInitialized(_this4))),
919
+ layout: new BackofficeLayout(_this4.callFunction.bind(_assertThisInitialized(_this4)))
920
+ });
921
+
922
+ return _this4;
923
+ }
924
+
925
+ return _createClass(BackofficeSdk);
926
+ }(Sdk);
927
+ var ShopSdk = /*#__PURE__*/function (_Sdk2) {
928
+ _inherits(ShopSdk, _Sdk2);
929
+
930
+ var _super3 = _createSuper(ShopSdk);
931
+
932
+ function ShopSdk() {
933
+ var _this5;
934
+
935
+ _classCallCheck(this, ShopSdk);
936
+
937
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
938
+ args[_key5] = arguments[_key5];
939
+ }
940
+
941
+ _this5 = _super3.call.apply(_super3, [this].concat(args));
942
+
943
+ _defineProperty(_assertThisInitialized(_this5), "instances", {
944
+ route: {
945
+ hash: '',
946
+ query: {}
947
+ },
948
+ cart: new ShopCart(_this5.callFunction.bind(_assertThisInitialized(_this5))),
949
+ catalog: new ShopCatalog(_this5.callFunction.bind(_assertThisInitialized(_this5))),
950
+ account: new ShopAccount(_this5.callFunction.bind(_assertThisInitialized(_this5))),
951
+ utils: new ShopUtils(_this5.callFunction.bind(_assertThisInitialized(_this5))),
952
+ config: new ShopConfig(_this5.callFunction.bind(_assertThisInitialized(_this5)))
953
+ });
954
+
955
+ return _this5;
956
+ }
957
+
958
+ return _createClass(ShopSdk);
959
+ }(Sdk);
960
+
961
+ export { BackofficeSdk, SdkEvents, ShopSdk };
962
+ //# sourceMappingURL=bundle.esm.js.map