@one-commerce/sdk-backoffice-vue3 2.3.5 → 2.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@one-commerce/sdk-backoffice-vue3",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "module": "lib/esm/index.js",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "lint": "vue-cli-service lint"
27
27
  },
28
28
  "dependencies": {
29
- "@one-commerce/sdk-core": "^2.3.5",
29
+ "@one-commerce/sdk-core": "^2.3.6",
30
30
  "vue": "^3.0.0"
31
31
  },
32
32
  "devDependencies": {
@@ -56,5 +56,5 @@
56
56
  "rollup-plugin-terser": "^7.0.2",
57
57
  "typescript": "~4.6.4"
58
58
  },
59
- "gitHead": "f578e4ee7e34eb527b6c8c62c19ff4ef5defa77a"
59
+ "gitHead": "bdaf1559f4e554f5e33d1e4137cc93584121c34a"
60
60
  }
@@ -1,571 +0,0 @@
1
- import { reactive, getCurrentInstance } from 'vue';
2
-
3
- function ownKeys(object, enumerableOnly) {
4
- var keys = Object.keys(object);
5
-
6
- if (Object.getOwnPropertySymbols) {
7
- var symbols = Object.getOwnPropertySymbols(object);
8
- enumerableOnly && (symbols = symbols.filter(function (sym) {
9
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10
- })), keys.push.apply(keys, symbols);
11
- }
12
-
13
- return keys;
14
- }
15
-
16
- function _objectSpread2(target) {
17
- for (var i = 1; i < arguments.length; i++) {
18
- var source = null != arguments[i] ? arguments[i] : {};
19
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
20
- _defineProperty$4(target, key, source[key]);
21
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
22
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
23
- });
24
- }
25
-
26
- return target;
27
- }
28
-
29
- function _defineProperty$4(obj, key, value) {
30
- if (key in obj) {
31
- Object.defineProperty(obj, key, {
32
- value: value,
33
- enumerable: true,
34
- configurable: true,
35
- writable: true
36
- });
37
- } else {
38
- obj[key] = value;
39
- }
40
-
41
- return obj;
42
- }
43
-
44
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
45
-
46
- function getDefaultExportFromCjs (x) {
47
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
48
- }
49
-
50
- var main = {};
51
-
52
- var messages = {};
53
-
54
- (function (exports) {
55
- Object.defineProperty(exports, "__esModule", { value: true });
56
- exports.Errors = exports.Message = void 0;
57
- (function (Message) {
58
- Message["INIT"] = "one:init";
59
- Message["UPDATE"] = "one:update";
60
- Message["METHOD_CALL"] = "one:method:call";
61
- Message["METHOD_CALL_ERROR"] = "one:method:error";
62
- Message["METHOD_RESULT"] = "one:method:result";
63
- Message["NAVIGATION_PUSH"] = "one:navigation:push";
64
- Message["FRAME_HEIGHT_REQUEST"] = "one:frameheight:request";
65
- Message["FRAME_HEIGHT_CHANGE"] = "one:frameheight:change";
66
- })(exports.Message || (exports.Message = {}));
67
- (function (Errors) {
68
- Errors["METHOD_DOES_NOT_EXISTS"] = "Method does not exists";
69
- Errors["SERVICE_DOES_NOT_EXISTS"] = "Service does not exists";
70
- })(exports.Errors || (exports.Errors = {}));
71
-
72
- }(messages));
73
-
74
- var api = {};
75
-
76
- Object.defineProperty(api, "__esModule", { value: true });
77
-
78
- (function (exports) {
79
- var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
80
- if (k2 === undefined) k2 = k;
81
- var desc = Object.getOwnPropertyDescriptor(m, k);
82
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
83
- desc = { enumerable: true, get: function() { return m[k]; } };
84
- }
85
- Object.defineProperty(o, k2, desc);
86
- }) : (function(o, m, k, k2) {
87
- if (k2 === undefined) k2 = k;
88
- o[k2] = m[k];
89
- }));
90
- var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
91
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
92
- };
93
- Object.defineProperty(exports, "__esModule", { value: true });
94
- __exportStar(messages, exports);
95
- __exportStar(api, exports);
96
-
97
- }(main));
98
-
99
- var lib = {exports: {}};
100
-
101
- (function (module, exports) {
102
- !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;});
103
- }(lib));
104
-
105
- var Channel = /*@__PURE__*/getDefaultExportFromCjs(lib.exports);
106
-
107
- function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
108
-
109
- const dec2hex = dec => {
110
- return dec.toString(16).padStart(2, "0");
111
- }; // generateId :: Integer -> String
112
-
113
-
114
- function generateCallId() {
115
- const arr = new Uint8Array((10 ) / 2);
116
- window.crypto.getRandomValues(arr);
117
- return Array.from(arr, dec2hex).join('');
118
- }
119
- class BaseCallClass {
120
- constructor(call) {
121
- _defineProperty$3(this, "serviceName", '');
122
-
123
- _defineProperty$3(this, "call", void 0);
124
-
125
- this.call = (fun, ...arg) => {
126
- return call(this.serviceName, fun, ...arg);
127
- };
128
- }
129
-
130
- static update(target, payload) {
131
- Object.keys(payload).forEach(key => {
132
- target[key] = payload[key];
133
- });
134
- }
135
-
136
- update(payload) {
137
- const attributes = payload[this.serviceName];
138
-
139
- if (attributes) {
140
- BaseCallClass.update(this, attributes);
141
- }
142
- }
143
-
144
- }
145
-
146
- function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
147
- class BackofficeCatalog extends BaseCallClass {
148
- constructor(...args) {
149
- super(...args);
150
-
151
- _defineProperty$2(this, "serviceName", 'catalog');
152
- }
153
-
154
- fetchCategories() {
155
- return this.call('fetchCategories');
156
- }
157
-
158
- fetchProduct(id) {
159
- return this.call('fetchProduct', id);
160
- }
161
-
162
- }
163
- class BackofficeUser extends BaseCallClass {
164
- constructor(...args) {
165
- super(...args);
166
-
167
- _defineProperty$2(this, "serviceName", 'user');
168
-
169
- _defineProperty$2(this, "email", void 0);
170
-
171
- _defineProperty$2(this, "id", void 0);
172
-
173
- _defineProperty$2(this, "name", void 0);
174
-
175
- _defineProperty$2(this, "authorities", void 0);
176
- }
177
-
178
- }
179
- class BackofficeTenant extends BaseCallClass {
180
- constructor(...args) {
181
- super(...args);
182
-
183
- _defineProperty$2(this, "serviceName", 'tenant');
184
-
185
- _defineProperty$2(this, "tenantKey", void 0);
186
-
187
- _defineProperty$2(this, "language", void 0);
188
-
189
- _defineProperty$2(this, "currency", void 0);
190
- }
191
-
192
- }
193
- class BackofficeLayout extends BaseCallClass {
194
- constructor(...args) {
195
- super(...args);
196
-
197
- _defineProperty$2(this, "serviceName", 'layout');
198
-
199
- _defineProperty$2(this, "isAsideOpened", void 0);
200
- }
201
-
202
- }
203
- class BackofficeAuthorization extends BaseCallClass {
204
- constructor(...args) {
205
- super(...args);
206
-
207
- _defineProperty$2(this, "serviceName", 'authorization');
208
- }
209
-
210
- getAuthToken() {
211
- return this.call('getAuthToken');
212
- }
213
-
214
- }
215
- class BackofficeCustomer extends BaseCallClass {
216
- constructor(...args) {
217
- super(...args);
218
-
219
- _defineProperty$2(this, "serviceName", 'customer');
220
-
221
- _defineProperty$2(this, "id", void 0);
222
-
223
- _defineProperty$2(this, "name", void 0);
224
- }
225
-
226
- }
227
- class BackofficePlugin extends BaseCallClass {
228
- constructor(...args) {
229
- super(...args);
230
-
231
- _defineProperty$2(this, "serviceName", 'plugin');
232
-
233
- _defineProperty$2(this, "id", void 0);
234
-
235
- _defineProperty$2(this, "srcUrl", void 0);
236
-
237
- _defineProperty$2(this, "name", void 0);
238
- }
239
-
240
- }
241
- class BackofficeOrderpath extends BaseCallClass {
242
- constructor(...args) {
243
- super(...args);
244
-
245
- _defineProperty$2(this, "serviceName", 'orderpath');
246
- }
247
-
248
- fetchCart(id) {
249
- return this.call('fetchCart', id);
250
- }
251
-
252
- fetchOffer(id) {
253
- return this.call('fetchOffer', id);
254
- }
255
-
256
- }
257
-
258
- function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
259
-
260
- class Events {
261
- constructor() {
262
- _defineProperty$1(this, "_callbacks", void 0);
263
-
264
- this._callbacks = {};
265
- }
266
-
267
- on(key, callback) {
268
- // create an empty array for the event key
269
- if (this._callbacks[key] === undefined) {
270
- this._callbacks[key] = [];
271
- } // save the callback in the array for the event key
272
-
273
-
274
- this._callbacks[key].push(callback);
275
- }
276
-
277
- off(key, callback) {
278
- // if the key exists
279
- if (this._callbacks[key] !== undefined) {
280
- // iterate through the callbacks for the event key
281
- for (let i = 0; i < this._callbacks[key].length; i++) {
282
- // if the callback matches, remove it
283
- if (this._callbacks[key][i] === callback) {
284
- this._callbacks[key].splice(i, 1);
285
- }
286
- }
287
- }
288
- }
289
-
290
- emit(key, ...params) {
291
- // if the key exists
292
- if (this._callbacks[key] !== undefined) {
293
- // iterate through the callbacks for the event key
294
- for (let i = 0; i < this._callbacks[key].length; i++) {
295
- // trigger the callbacks with all provided params
296
- this._callbacks[key][i](...params);
297
- }
298
- }
299
- }
300
-
301
- }
302
-
303
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
304
- var SdkInternalEvents;
305
-
306
- (function (SdkInternalEvents) {
307
- SdkInternalEvents["INIT"] = "INIT";
308
- SdkInternalEvents["UPDATE"] = "UPDATE";
309
- })(SdkInternalEvents || (SdkInternalEvents = {}));
310
-
311
- let SdkEvents;
312
-
313
- (function (SdkEvents) {
314
- SdkEvents["INIT"] = "INIT";
315
- SdkEvents["UPDATE"] = "UPDATE";
316
- })(SdkEvents || (SdkEvents = {}));
317
-
318
- class Sdk extends Events {
319
- static log(...data) {
320
- Sdk.debug && console.log('[SDK Core] ', ...data);
321
- }
322
-
323
- static warn(...data) {
324
- console.warn('[SDK Core] ', ...data);
325
- }
326
-
327
- initializeServiceGetters() {
328
- if (this.instances) {
329
- Object.keys(this.instances).forEach(serviceName => {
330
- Object.defineProperty(this, serviceName, {
331
- get: () => {
332
- return this.isInitialized ? this.instances[serviceName] : null;
333
- }
334
- });
335
- });
336
- }
337
- }
338
-
339
- initializeContextClass() {
340
- if (this.contextClass) {
341
- return new this.contextClass(this.callFunction.bind(this));
342
- }
343
-
344
- return {};
345
- }
346
-
347
- constructor(options) {
348
- super();
349
-
350
- _defineProperty(this, "channel", void 0);
351
-
352
- _defineProperty(this, "autoheight", true);
353
-
354
- _defineProperty(this, "heightMutationObserver", null);
355
-
356
- _defineProperty(this, "origin", void 0);
357
-
358
- _defineProperty(this, "isInitialized", false);
359
-
360
- _defineProperty(this, "instances", void 0);
361
-
362
- _defineProperty(this, "contextClass", void 0);
363
-
364
- this.initializeServiceGetters();
365
- this.origin = options.origin;
366
- this.channel = new Channel({
367
- targetOrigin: this.origin,
368
- target: window.parent
369
- });
370
- this.channel.subscribe(main.Message.INIT, payload => {
371
- Sdk.log('Handling INIT message');
372
- Object.entries(this.instances).forEach(([key, value]) => {
373
- if (value instanceof BaseCallClass) {
374
- value.update(payload);
375
- } else {
376
- const attributesForKey = payload[key];
377
-
378
- if (typeof attributesForKey !== 'undefined') {
379
- BaseCallClass.update(value, payload[key]);
380
- } else {
381
- Sdk.warn(`Missing attributes for ${key} in `, payload);
382
- }
383
- }
384
- });
385
- Sdk.log('Emitting INIT with payload ', this.instances);
386
- this.isInitialized = true;
387
- this.emit(SdkInternalEvents.INIT, this.instances);
388
- });
389
- this.channel.subscribe(main.Message.UPDATE, payload => {
390
- Sdk.log('Emitting UPDATE with payload ', payload);
391
- this.emit(SdkInternalEvents.UPDATE, payload);
392
- });
393
- this.channel.subscribe(main.Message.FRAME_HEIGHT_REQUEST, payload => {
394
- if (this.autoheight) {
395
- Sdk.log('Request for iframe height');
396
- this.sendFrameHeight();
397
- }
398
- });
399
- this.channel.connect().then(() => {
400
- Sdk.log('Connected with ONe SDK');
401
-
402
- if (this.autoheight) {
403
- this.initializeHeightObserver();
404
- }
405
- });
406
- this.setupOptions(options);
407
- Sdk.log('Initialized.');
408
- }
409
-
410
- sendFrameHeight() {
411
- this.channel.postMessage(main.Message.FRAME_HEIGHT_CHANGE, document.body.scrollHeight);
412
- }
413
-
414
- initializeHeightObserver() {
415
- if ("MutationObserver" in window) {
416
- const onMutationObserved = () => {
417
- this.sendFrameHeight();
418
- };
419
-
420
- const target = document.querySelector('body'),
421
- config = {
422
- attributes: true,
423
- attributeOldValue: false,
424
- characterData: true,
425
- characterDataOldValue: false,
426
- childList: true,
427
- subtree: true
428
- };
429
- this.heightMutationObserver = new MutationObserver(onMutationObserved);
430
- Sdk.log('Create body MutationObserver');
431
- this.heightMutationObserver.observe(target, config);
432
- } else {
433
- Sdk.warn('MutationObserver not available. Auto-height functionality disabled.');
434
- }
435
- }
436
-
437
- setupOptions(options) {
438
- if (options) {
439
- if (typeof options.debug !== 'undefined') {
440
- Sdk.debug = options.debug;
441
- }
442
-
443
- if (typeof options.autoheight !== 'undefined') {
444
- this.autoheight = options.autoheight;
445
- }
446
-
447
- this.contextClass = options.context;
448
- }
449
- }
450
-
451
- callFunction(service, fun, ...payload) {
452
- const callId = generateCallId();
453
-
454
- if (this.isInitialized) {
455
- Sdk.log(`Call ID ${callId} for ${service}:${fun}`, payload);
456
- this.channel.postMessage(main.Message.METHOD_CALL, {
457
- callId,
458
- service,
459
- method: fun,
460
- payload: payload
461
- });
462
- return new Promise((resolve, reject) => {
463
- const onChannelMessage = response => {
464
- if (response.callId === callId) {
465
- this.channel.unsubscribe(main.Message.METHOD_RESULT, onChannelMessage);
466
-
467
- if (response !== null && response !== void 0 && response.isException) {
468
- return reject(response.result);
469
- }
470
-
471
- return resolve(response.result);
472
- }
473
- };
474
-
475
- this.channel.subscribe(main.Message.METHOD_RESULT, onChannelMessage);
476
- });
477
- }
478
-
479
- Sdk.log('SDK is not initialized!');
480
- return Promise.resolve(null);
481
- }
482
-
483
- navigate(event) {
484
- this.channel.postMessage(main.Message.NAVIGATION_PUSH, event);
485
- }
486
-
487
- }
488
-
489
- _defineProperty(Sdk, "debug", false);
490
-
491
- class BackofficeSdk extends Sdk {
492
- constructor(...args) {
493
- super(...args);
494
-
495
- _defineProperty(this, "instances", {
496
- route: {
497
- hash: '',
498
- query: {}
499
- },
500
- catalog: new BackofficeCatalog(this.callFunction.bind(this)),
501
- user: new BackofficeUser(this.callFunction.bind(this)),
502
- tenant: new BackofficeTenant(this.callFunction.bind(this)),
503
- layout: new BackofficeLayout(this.callFunction.bind(this)),
504
- authorization: new BackofficeAuthorization(this.callFunction.bind(this)),
505
- customer: new BackofficeCustomer(this.callFunction.bind(this)),
506
- plugin: new BackofficePlugin(this.callFunction.bind(this)),
507
- orderpath: new BackofficeOrderpath(this.callFunction.bind(this)),
508
- context: this.initializeContextClass()
509
- });
510
- }
511
-
512
- }
513
-
514
- var MISSING_ORIGIN_ERROR = "MISSING_ORIGIN_ERROR";
515
- var useOneSdk = function useOneSdk() {
516
- var instance = getCurrentInstance();
517
- return instance === null || instance === void 0 ? void 0 : instance.appContext.config.globalProperties.$one;
518
- };
519
- var index = {
520
- install: function install(app, options) {
521
- if (typeof options === "undefined") {
522
- throw new Error("[SDK Vue3] " + MISSING_ORIGIN_ERROR);
523
- }
524
-
525
- var log = function log() {
526
- for (var _len = arguments.length, data = new Array(_len), _key = 0; _key < _len; _key++) {
527
- data[_key] = arguments[_key];
528
- }
529
-
530
- ((options === null || options === void 0 ? void 0 : options.debug) || false) && console.log("[SDK Vue3] ".concat(data.join(" ")));
531
- };
532
-
533
- var sdk = new BackofficeSdk(options);
534
- var obj = reactive(_objectSpread2({
535
- isInitialized: false,
536
- navigate: sdk.navigate,
537
- on: sdk.on,
538
- off: sdk.off
539
- }, sdk.instances));
540
-
541
- var updateInstances = function updateInstances(payload) {
542
- obj.route = payload.route;
543
- obj.user.update(payload);
544
- obj.tenant.update(payload);
545
- obj.layout.update(payload);
546
- obj.catalog.update(payload);
547
- obj.authorization.update(payload);
548
- obj.customer.update(payload);
549
- obj.orderpath.update(payload);
550
- obj.plugin.update(payload);
551
- obj.context.update(payload);
552
- };
553
-
554
- sdk.on(SdkEvents.INIT, function (payload) {
555
- log("Handling INIT ");
556
-
557
- if (!obj.isInitialized) {
558
- obj.isInitialized = true;
559
- updateInstances(payload);
560
- }
561
- });
562
- sdk.on(SdkEvents.UPDATE, function (payload) {
563
- log("Handling UPDATE");
564
- updateInstances(payload);
565
- });
566
- app.config.globalProperties.$one = obj;
567
- }
568
- };
569
-
570
- export { index as default, useOneSdk };
571
- //# sourceMappingURL=bundle.esm.js.map