@artisan-commerce/products 0.9.0-canary.18 → 0.9.0-canary.2
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/CHANGELOG.md +0 -131
- package/build/lib/initProducts/initProducts.d.ts +1 -1
- package/build/lib/registerModifiersForm/registerModifiersForm.d.ts +4 -4
- package/build/lib/registerModifiersForm/registerModifiersForm.types.d.ts +1 -1
- package/build/main.bundle.js +2 -2
- package/build/report.json +1 -1
- package/build/types/modifiers.types.d.ts +3 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,137 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [0.9.0-canary.18](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.17...@artisan-commerce/products@0.9.0-canary.18) (2021-10-04)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Features
|
|
10
|
-
|
|
11
|
-
* **global:** update registerModifiersForm function, control state error ([c3534cf](https://bitbucket.org/tradesystem/artisn_sdk/commit/c3534cf2eac5f7d90176888ad5b6dd575998e2f1))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## [0.9.0-canary.17](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.16...@artisan-commerce/products@0.9.0-canary.17) (2021-10-01)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
|
|
20
|
-
* **global:** fix firebase related types ([efa5081](https://bitbucket.org/tradesystem/artisn_sdk/commit/efa5081a844be033ac9135ac65bf8f56184b71b0))
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## [0.9.0-canary.16](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.15...@artisan-commerce/products@0.9.0-canary.16) (2021-09-30)
|
|
25
|
-
|
|
26
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## [0.9.0-canary.15](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.14...@artisan-commerce/products@0.9.0-canary.15) (2021-09-30)
|
|
33
|
-
|
|
34
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## [0.9.0-canary.14](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.13...@artisan-commerce/products@0.9.0-canary.14) (2021-09-23)
|
|
41
|
-
|
|
42
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## [0.9.0-canary.13](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.12...@artisan-commerce/products@0.9.0-canary.13) (2021-09-21)
|
|
49
|
-
|
|
50
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
## [0.9.0-canary.12](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.11...@artisan-commerce/products@0.9.0-canary.12) (2021-09-17)
|
|
57
|
-
|
|
58
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## [0.9.0-canary.11](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.10...@artisan-commerce/products@0.9.0-canary.11) (2021-08-25)
|
|
65
|
-
|
|
66
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## [0.9.0-canary.10](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.9...@artisan-commerce/products@0.9.0-canary.10) (2021-08-25)
|
|
73
|
-
|
|
74
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
## [0.9.0-canary.9](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.8...@artisan-commerce/products@0.9.0-canary.9) (2021-08-24)
|
|
81
|
-
|
|
82
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
## [0.9.0-canary.8](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.7...@artisan-commerce/products@0.9.0-canary.8) (2021-08-23)
|
|
89
|
-
|
|
90
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## [0.9.0-canary.7](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.6...@artisan-commerce/products@0.9.0-canary.7) (2021-08-23)
|
|
97
|
-
|
|
98
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
## [0.9.0-canary.6](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.5...@artisan-commerce/products@0.9.0-canary.6) (2021-08-12)
|
|
105
|
-
|
|
106
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
## [0.9.0-canary.5](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.4...@artisan-commerce/products@0.9.0-canary.5) (2021-08-12)
|
|
113
|
-
|
|
114
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
## [0.9.0-canary.4](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.3...@artisan-commerce/products@0.9.0-canary.4) (2021-08-12)
|
|
121
|
-
|
|
122
|
-
**Note:** Version bump only for package @artisan-commerce/products
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
## [0.9.0-canary.3](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.2...@artisan-commerce/products@0.9.0-canary.3) (2021-08-12)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
### Bug Fixes
|
|
132
|
-
|
|
133
|
-
* **modifiers:** fix modifiers images typing to CDNImage ([04de8b6](https://bitbucket.org/tradesystem/artisn_sdk/commit/04de8b6ecc3551a3610e4e4220fcbd507e7d40c1))
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
6
|
## [0.9.0-canary.2](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.1...@artisan-commerce/products@0.9.0-canary.2) (2021-08-11)
|
|
138
7
|
|
|
139
8
|
|
|
@@ -8,7 +8,7 @@ import { InitProductsConfig } from "../../types/common.types";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const initProducts: (artisnApp: ArtisnApp, config?: InitProductsConfig) => void;
|
|
10
10
|
/**
|
|
11
|
-
* Closes all
|
|
11
|
+
* Closes all conections and resets the library to its default state
|
|
12
12
|
* @since 1.0
|
|
13
13
|
*/
|
|
14
14
|
export declare const closeProducts: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Product } from "@artisan-commerce/types";
|
|
2
2
|
import { ModifiersFormCallback } from "./registerModifiersForm.types";
|
|
3
|
-
import {
|
|
3
|
+
import { ModifiersFormUnsuscriber } from "./registerModifiersForm.types";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a product modifiers form listener that handles the input change
|
|
6
6
|
* events automatically.
|
|
@@ -8,14 +8,14 @@ import { ModifiersFormUnsubscriber } from "./registerModifiersForm.types";
|
|
|
8
8
|
* @param {Product} product The product that will be listened
|
|
9
9
|
* @param {ModifiersFormCallback} callback Returns a snapshot of the current
|
|
10
10
|
* state of the form
|
|
11
|
-
* @returns {
|
|
11
|
+
* @returns {ModifiersFormUnsuscriber} Returns a function that when called it
|
|
12
12
|
* stops listening to the form
|
|
13
13
|
*/
|
|
14
|
-
export declare const registerModifiersForm: (product: Product, callback: ModifiersFormCallback) =>
|
|
14
|
+
export declare const registerModifiersForm: (product: Product, callback: ModifiersFormCallback) => ModifiersFormUnsuscriber;
|
|
15
15
|
/**
|
|
16
16
|
* Function that when called it stops listening to the form.
|
|
17
17
|
*
|
|
18
18
|
* @param {string} productId The id of the product that will be deleted from the
|
|
19
19
|
* form
|
|
20
20
|
*/
|
|
21
|
-
export declare const
|
|
21
|
+
export declare const unsuscriber: (productId: Product["productId"]) => void;
|
|
@@ -12,7 +12,7 @@ export interface ModifiersFormInternal extends ModifiersForm {
|
|
|
12
12
|
callback: ModifiersFormCallback;
|
|
13
13
|
}
|
|
14
14
|
export declare type ModifiersFormCallback = (form: ModifiersForm) => void;
|
|
15
|
-
export declare type
|
|
15
|
+
export declare type ModifiersFormUnsuscriber = () => void;
|
|
16
16
|
export declare type HandleChangeFunction = (amount: number) => void;
|
|
17
17
|
export interface BuildModifierRendererConfig {
|
|
18
18
|
rootId: string;
|
package/build/main.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("products",[],r):"object"==typeof exports?exports.products=r():t.products=r()}(this,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=12)}([function(t,r,e){t.exports=function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=1)}([,function(t,r,e){"use strict";e.r(r),e.d(r,"
|
|
1
|
+
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("products",[],r):"object"==typeof exports?exports.products=r():t.products=r()}(this,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=12)}([function(t,r,e){t.exports=function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=1)}([,function(t,r,e){"use strict";e.r(r),e.d(r,"initState",(function(){return i})),e.d(r,"getState",(function(){return a})),e.d(r,"setState",(function(){return u}));var n=function(){return(n=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},o=null,i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){var r=o?n({},o):{};o=null,o=n(n({},r),t),Object.seal(o)},a=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,r,e){t.exports=function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=10)}([function(t,r,e){t.exports=function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=1)}([,function(t,r,e){"use strict";e.r(r),e.d(r,"initState",(function(){return i})),e.d(r,"getState",(function(){return a})),e.d(r,"setState",(function(){return u}));var n=function(){return(n=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},o=null,i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){var r=o?n({},o):{};o=null,o=n(n({},r),t),Object.seal(o)},a=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,r){var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var r=[],e=0;e<t.length;e++)r.push(255&t.charCodeAt(e));return r},bytesToString:function(t){for(var r=[],e=0;e<t.length;e++)r.push(String.fromCharCode(t[e]));return r.join("")}}};t.exports=e},function(t,r,e){(function(r){var n,o,i,u;n=e(8),o=e(1).utf8,i=e(1).bin,(u=function(t,e){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==r&&"function"==typeof r.isBuffer&&r.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var e=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,f=-1732584194,c=271733878,l=-1009589776;e[i>>5]|=128<<24-i%32,e[15+(i+64>>>9<<4)]=i;for(var h=0;h<e.length;h+=16){for(var p=a,d=s,y=f,g=c,v=l,b=0;b<80;b++){if(b<16)u[b]=e[h+b];else{var w=u[b-3]^u[b-8]^u[b-14]^u[b-16];u[b]=w<<1|w>>>31}var m=(a<<5|a>>>27)+l+(u[b]>>>0)+(b<20?1518500249+(s&f|~s&c):b<40?1859775393+(s^f^c):b<60?(s&f|s&c|f&c)-1894007588:(s^f^c)-899497514);l=c,c=f,f=s<<30|s>>>2,s=a,a=m}a+=p,s+=d,f+=y,c+=g,l+=v}return[a,s,f,c,l]}(t));return e&&e.asBytes?u:e&&e.asString?i.bytesToString(u):n.bytesToHex(u)})._blocksize=16,u._digestsize=20,t.exports=u}).call(this,e(3).Buffer)},function(t,r,e){"use strict";(function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
@@ -16,4 +16,4 @@ r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,f=s>>1,c=-7,l=e?o-1:0,h=
|
|
|
16
16
|
*/
|
|
17
17
|
var n=e(7),o=e(8),i=e(9);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(u()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=s.prototype:(null===t&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return f(this,t,r,e)}function f(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);s.TYPED_ARRAY_SUPPORT?(t=r).__proto__=s.prototype:t=h(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(r,e),o=(t=a(t,n)).write(r,e);o!==n&&(t=t.slice(0,o));return t}(t,r,e):function(t,r){if(s.isBuffer(r)){var e=0|p(r.length);return 0===(t=a(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?a(t,0):h(t,r);if("Buffer"===r.type&&i(r.data))return h(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,r){if(c(r),t=a(t,r<0?0:0|p(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function h(t,r){var e=r.length<0?0:0|p(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function p(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function d(t,r){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return q(t).length;default:if(n)return N(t).length;r=(""+r).toLowerCase(),n=!0}}function y(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,r,e);case"utf8":case"utf-8":return S(this,r,e);case"ascii":return I(this,r,e);case"latin1":case"binary":return _(this,r,e);case"base64":return T(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function v(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:b(t,r,e,n,o);if("number"==typeof r)return r&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):b(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,r,e,n,o){var i,u=1,a=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,a/=2,s/=2,e/=2}function f(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(o){var c=-1;for(i=e;i<a;i++)if(f(t,i)===f(r,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===s)return c*u}else-1!==c&&(i-=i-c),c=-1}else for(e+s>a&&(e=a-s),i=e;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(f(t,i+h)!==f(r,h)){l=!1;break}if(l)return i}return-1}function w(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=r.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var a=parseInt(r.substr(2*u,2),16);if(isNaN(a))return u;t[e+u]=a}return u}function m(t,r,e,n){return F(N(r,t.length-e),t,e,n)}function A(t,r,e,n){return F(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function E(t,r,e,n){return A(t,r,e,n)}function O(t,r,e,n){return F(q(r),t,e,n)}function P(t,r,e,n){return F(function(t,r){for(var e,n,o,i=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,o=e%256,i.push(o),i.push(n);return i}(r,t.length-e),t,e,n)}function T(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function S(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,u,a,s,f=t[o],c=null,l=f>239?4:f>223?3:f>191?2:1;if(o+l<=e)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&f)<<6|63&i)>127&&(c=s);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&(s=(15&f)<<12|(63&i)<<6|63&u)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=t[o+1],u=t[o+2],a=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&a)&&(s=(15&f)<<18|(63&i)<<12|(63&u)<<6|63&a)>65535&&s<1114112&&(c=s)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=l}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,r,e){return f(null,t,r,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,r,e){return function(t,r,e,n){return c(r),r<=0?a(t,r):void 0!==e?"string"==typeof n?a(t,r).fill(e,n):a(t,r).fill(e):a(t,r)}(null,t,r,e)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,r){if(!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,r){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=s.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!s.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,o),o+=u.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)g(this,r,r+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)g(this,r,r+3),g(this,r+1,r+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)g(this,r,r+7),g(this,r+1,r+6),g(this,r+2,r+5),g(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,r,e,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),a=Math.min(i,u),f=this.slice(n,o),c=t.slice(r,e),l=0;l<a;++l)if(f[l]!==c[l]){i=f[l],u=c[l];break}return i<u?-1:u<i?1:0},s.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},s.prototype.indexOf=function(t,r,e){return v(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return v(this,t,r,e,!1)},s.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return A(this,t,r,e);case"latin1":case"binary":return E(this,t,r,e);case"base64":return O(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function R(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=k(t[i]);return o}function B(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function x(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function j(t,r,e,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function C(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function U(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function M(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function L(t,r,e,n,i){return i||M(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function Y(t,r,e,n,i){return i||M(t,0,e,8),o.write(t,r,e,n,52,8),e+8}s.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),s.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=s.prototype;else{var o=r-t;e=new s(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+t]}return e},s.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||x(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||x(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},s.prototype.readUInt8=function(t,r){return r||x(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,r){return r||x(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,r){return r||x(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,r){return r||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,r){return r||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||x(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||x(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},s.prototype.readInt8=function(t,r){return r||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,r){r||x(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(t,r){r||x(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(t,r){return r||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return r||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return r||x(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return r||x(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return r||x(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return r||x(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},s.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+e},s.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):C(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):C(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):U(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):U(this,t,r,!1),r+4},s.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);j(this,t,r,e,o-1,-o)}var i=0,u=1,a=0;for(this[r]=255&t;++i<e&&(u*=256);)t<0&&0===a&&0!==this[r+i-1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);j(this,t,r,e,o-1,-o)}var i=e-1,u=1,a=0;for(this[r+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):C(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):C(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):U(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):U(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return L(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return L(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return Y(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return Y(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,i=n-e;if(this===t&&e<r&&r<n)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},s.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var i;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var u=s.isBuffer(t)?t:N(new s(t,n).toString()),a=u.length;for(i=0;i<e-r;++i)this[i+r]=u[i%a]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function k(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function q(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}}).call(this,e(6))},function(t,r){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,r,e){"use strict";r.byteLength=function(t){var r=f(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=f(t),u=n[0],a=n[1],s=new i(function(t,r,e){return 3*(r+e)/4-e}(0,u,a)),c=0,l=a>0?u-4:u;for(e=0;e<l;e+=4)r=o[t.charCodeAt(e)]<<18|o[t.charCodeAt(e+1)]<<12|o[t.charCodeAt(e+2)]<<6|o[t.charCodeAt(e+3)],s[c++]=r>>16&255,s[c++]=r>>8&255,s[c++]=255&r;2===a&&(r=o[t.charCodeAt(e)]<<2|o[t.charCodeAt(e+1)]>>4,s[c++]=255&r);1===a&&(r=o[t.charCodeAt(e)]<<10|o[t.charCodeAt(e+1)]<<4|o[t.charCodeAt(e+2)]>>2,s[c++]=r>>8&255,s[c++]=255&r);return s},r.fromByteArray=function(t){for(var r,e=t.length,o=e%3,i=[],u=0,a=e-o;u<a;u+=16383)i.push(c(t,u,u+16383>a?a:u+16383));1===o?(r=t[e-1],i.push(n[r>>2]+n[r<<4&63]+"==")):2===o&&(r=(t[e-2]<<8)+t[e-1],i.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=u.length;a<s;++a)n[a]=u[a],o[u.charCodeAt(a)]=a;function f(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function c(t,r,e){for(var o,i,u=[],a=r;a<e;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),u.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return u.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,r){
|
|
18
18
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
19
|
-
r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,f=s>>1,c=-7,l=e?o-1:0,h=e?-1:1,p=t[r+l];for(l+=h,i=p&(1<<-c)-1,p>>=-c,c+=a;c>0;i=256*i+t[r+l],l+=h,c-=8);for(u=i&(1<<-c)-1,i>>=-c,c+=n;c>0;u=256*u+t[r+l],l+=h,c-=8);if(0===i)i=1-f;else{if(i===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=f}return(p?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var u,a,s,f=8*i-o-1,c=(1<<f)-1,l=c>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=c):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+l>=1?h/s:h*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=c?(a=0,u=c):u+l>=1?(a=(r*s-1)*Math.pow(2,o),u+=l):(a=r*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[e+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,f+=o;f>0;t[e+p]=255&u,p+=d,u/=256,f-=8);t[e+p-d]|=128*y}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r){var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,r){return t<<r|t>>>32-r},rotr:function(t,r){return t<<32-r|t>>>r},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var r=0;r<t.length;r++)t[r]=n.endian(t[r]);return t},randomBytes:function(t){for(var r=[];t>0;t--)r.push(Math.floor(256*Math.random()));return r},bytesToWords:function(t){for(var r=[],e=0,n=0;e<t.length;e++,n+=8)r[n>>>5]|=t[e]<<24-n%32;return r},wordsToBytes:function(t){for(var r=[],e=0;e<32*t.length;e+=8)r.push(t[e>>>5]>>>24-e%32&255);return r},bytesToHex:function(t){for(var r=[],e=0;e<t.length;e++)r.push((t[e]>>>4).toString(16)),r.push((15&t[e]).toString(16));return r.join("")},hexToBytes:function(t){for(var r=[],e=0;e<t.length;e+=2)r.push(parseInt(t.substr(e,2),16));return r},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?r.push(e.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(n))>>>6-2*o);return r}},t.exports=n},,function(t,r,e){"use strict";e.r(r),e.d(r,"getCategories",(function(){return x})),e.d(r,"getProductDetails",(function(){return St})),e.d(r,"getProducts",(function(){return jt})),e.d(r,"getRecommendedProducts",(function(){return Ct})),e.d(r,"getRelatedProducts",(function(){return Ut})),e.d(r,"getStoreDetails",(function(){return Nt})),e.d(r,"registerModifiersForm",(function(){return fr})),e.d(r,"validateProduct",(function(){return pr})),e.d(r,"initProducts",(function(){return br})),e.d(r,"closeProducts",(function(){return wr})),e.d(r,"getProductTotals",(function(){return mr})),e.d(r,"transformers",(function(){return i})),e.d(r,"assertions",(function(){return n})),e.d(r,"modifierUtils",(function(){return o}));var n={};e.r(n),e.d(n,"isBaseProduct",(function(){return u})),e.d(n,"isProductDetails",(function(){return a})),e.d(n,"isCartProduct",(function(){return s})),e.d(n,"isFormCartProduct",(function(){return f}));var o={};e.r(o),e.d(o,"multiplyProductQA",(function(){return w})),e.d(o,"divideProductQA",(function(){return m})),e.d(o,"operationOnProductQA",(function(){return A}));var i={};e.r(i),e.d(i,"toCartProduct",(function(){return O})),e.d(i,"toFormCartProduct",(function(){return S})),e.d(i,"toFormCartProductHelper",(function(){return I})),e.d(i,"toFormCartProductFromProductDetails",(function(){return _})),e.d(i,"toFormCartProductFromAnswer",(function(){return R})),e.d(i,"normalizeProductDetails",(function(){return B}));var u=function(t){var r=t.attributes,e=t.description,n=t.name,o=t.images,i=t.prices,u=t.productId;return"boolean"==typeof r.showInMenu&&("string"==typeof e&&("string"==typeof n&&("string"==typeof u&&(!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)))))},a=function(t){if(!u(t))return!1;var r=t.questions;return!!Array.isArray(r)},s=function(t){if(!a(t))return!1;var r=t.hash,e=t.createdAt,n=t.updatedAt,o=t.amount,i=t.priceCategory,u=t.comment,s=t.questionsAndAnswers;return"string"==typeof r&&("string"==typeof e&&("string"==typeof n&&("number"==typeof o&&("string"==typeof u&&(!!["NORMAL","POINTS"].includes(i)&&!!Array.isArray(s))))))},f=function(t){var r;if(!s(t))return!1;var e=t.questions;if(!Array.isArray(e))return!1;var n=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},c=function(t){console.error(t)},l=function(t){var r=t.min,e=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===r&&1===e)return"CHECKBOX";if(1===r&&1===e)return"RADIO";if(0===r&&(0===e||e===1/0))return"COUNTER";if(e>=r)return"COUNTER";throw new Error("Modifier group bad configured. min "+r+", max "+e+", type "+n)},h=function(t,r,e){var n=[],o=t.max,i=t.min;return r>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),e&&r<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},p=function(t,r){var e=[],n=t.modifiers,o=t.data,i=o.min,u=o.max;0===i&&0===u&&(u=1/0);var a=n.reduce((function(t,r){return t+r.amount}),0);return a>u&&e.push({code:201,message:"Amount is heigher than the maximum allowed amount "+u}),r&&a<i&&e.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),e},d=function(t){var r=t.touched,e=t.errors,n=t.required,o=t.data,i=t.modifiers,u=o.min,a=i.some((function(t){return"FAIL"===t.status})),s=i.some((function(t){return"IDLE"===t.status})),f=i.some((function(t){return"INCOMPLETE"===t.status})),c=i.reduce((function(t,r){return t+r.amount}),0);return g({touched:r,errors:e,required:n,min:u,amount:c,childrenWithError:a,childrenIdle:s,childrenIncomplete:f,reviewChildren:!0})},y=function(t){var r=t.groups.some((function(t){return"FAIL"===t.status})),e=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,u=t.required,a=t.min,s=t.amount;return g({touched:o,errors:i,required:u,min:a,amount:s,childrenWithError:r,childrenIdle:e,childrenIncomplete:n,reviewChildren:s>0})},g=function(t){var r=t.touched,e=t.errors,n=t.required,o=t.min,i=t.amount,u=t.reviewChildren,a=t.childrenWithError,s=t.childrenIdle,f=t.childrenIncomplete,l=i>0&&!r;return l||r||!n?l||r||n?e.length||u&&a?"FAIL":u&&(s||f)||i<o?"INCOMPLETE":i>=o?"OK":(c("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:r,errors:e,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},v=function(t){return t.every((function(t){var r=t.status,e=t.required;return"OK"===r||"IDLE"===r&&!e}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},b=function(){return(b=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},w=function(t){return A(t,(function(t,r){var e=t.amount*r,n=w(b(b({},t),{amount:e}));return b(b({},n),{amount:t.amount*r})}))},m=function(t){return A(t,(function(t,r){var e=m(t);return b(b({},e),{amount:t.amount/r})}))},A=function(t,r){var e=t.amount,n=void 0===e?1:e,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var e=t.answers.map((function(t){return r(t,n)}));return b(b({},t),{answers:e})}));return b(b({},t),{questionsAndAnswers:i})},E=function(){return(E=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},O=function(t,r){if(void 0===r&&(r={}),s(t))return E(E({},t),r);if(a(t))return P(t,r);var e=T(t);return P(e,r)},P=function(t,r){void 0===r&&(r={});var e=t,n=e.questionsAndAnswers,o=e.priceCategory,i=e.amount;return E(E(E({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:"NORMAL",comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},T=function(t,r){return void 0===r&&(r={}),E(E(E({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},S=function(t,r){if(void 0===r&&(r={}),f(t))return E(E({},t),r);if(a(t))return _(t,r);var e=T(t);return _(e,r)},I=function(t,r){void 0===r&&(r={});var e=m(t),n=e.priceCategory,o=e.productId,i=e.amount,u=e.questions.map((function(t){var r,u=null===(r=e.questionsAndAnswers)||void 0===r?void 0:r.find((function(r){return r.questionId===t.questionId})),a=null!=u?u:t,s=a.questionId,f=a.min,c=a.max,h={rootId:o,min:f,max:c,type:l(a),modifiersCount:t.answers.length,amount:i,path:[]};return E(E({},a),{answers:t.answers.map((function(t){var r,e=null==u?void 0:u.answers.find((function(r){return r.amount>0&&r.productId===t.productId})),o=null!=e?e:t,i=function(t){var r=t.min;return 1===t.modifiersCount?r:0}(h),a=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(h),f=function(t){var r=t.groupType,e=t.min,n=t.max,o=t.type;return"RADIO"===r?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===e&&1===n?"RADIO":0===e&&1===n?"CHECKBOX":0!==e||0!==n&&n!==1/0?n>=e?"COUNTER":r:"COUNTER"}({min:i,max:a,groupType:h.type,type:o.renderType}),c=o.questions.length,l=E(E({},o),{amount:null!==(r=null==o?void 0:o.amount)&&void 0!==r?r:0,priceCategory:n,questionId:s,min:i,max:a,renderType:f});return E(E({},l),{questions:c?I(l).questions:[]})}))})}));return E(E(E({},e),{questions:u}),r)},_=function(t,r){void 0===r&&(r={});var e=P(t);return I(e,r)},R=function(t,r){return void 0===r&&(r={}),I(t,r)},B=function(t){var r=t.questions;return E(E({},t),{questions:r.map((function(t){var r=t.answers;return E(E({},t),{answers:r.map((function(t){var r=t.questions;return E(E({},t),{questions:null!=r?r:[]})}))})}))})},x=function(){console.log("Not supported yet")},j=e(0),C=function(t,r,e){var n;void 0===e&&(e="");var o=null!==(n=r.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,u=i.vendorId,a=i.storeId,s=i.catalogueId;!function(t,r){void 0===r&&(r="");var e=Object(j.getState)().accountId;if(void 0===t&&void 0===e)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+r)}(o,e),function(t,r){void 0===r&&(r="");var e=Object(j.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+r)}(u,e),function(t,r){void 0===r&&(r="");var e=Object(j.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+r)}(a,e),function(t,r){void 0===r&&(r="");var e=Object(j.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+r)}(s,e)},U={HEADERS:["accountId"],FILTERS:["vendorId","storeId","catalogueId","categoryId","productId"],GROUPS:["category"],ORDER_FIELDS:["type","method"],ORDER_TYPES:["alphabetic","price","predefined"],ORDER_METHODS:["asc","desc"],PAGINATION:["page","vendor","store","catalogue","category","product"],ADDITIONAL_FILTERS:["price","query","tags","manufacturerId","weight","dimensions"]},M=function(){return(M=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},L=U.PAGINATION,Y=U.ADDITIONAL_FILTERS,D=U.ORDER_FIELDS,k=U.FILTERS,N=U.GROUPS,q=U.ORDER_METHODS,F=U.ORDER_TYPES,z=function(t){var r=H(t),e=G(r),n=J(e),o=K(n);return W(o)},H=function(t){var r=Object(j.getState)(),e=r.vendorId,n=r.storeId,o=Object(j.getState)(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=M(M({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),f=X(s,k,"filter"),c=V(f);return M(M({},t),{filterBy:c})},G=function(t){var r=Q(t,N,"groupBy");return M({},r)},J=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=X(e,D,"orderBy"),o=M({},n),i=e.method,u=e.type;return u&&!F.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),F.includes(u)||(delete o.type,o.type="predefined"),i&&!q.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),q.includes(i)||(delete o.method,o.method="asc"),M(M({},t),{orderBy:o})},K=function(t){var r=t.pagination,e=X(void 0===r?{}:r,L,"pagination"),n=M({product:{size:20},category:{size:20}},e);return"category"!==t.groupBy&&delete n.category,M(M({},t),{pagination:n})},W=function(t){var r=t.additionalFilters,e=X(void 0===r?{}:r,Y,"additionalFilters");return M(M({},t),{additionalFilters:e})},X=function(t,r,e){var n=M({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?r.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+t),delete n[t]):delete n[t]})),n},Q=function(t,r,e){var n=M({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},V=function(t){var r=M({},t);return Object.entries(r).forEach((function(t){var e=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete r[e]:Array.isArray(n)&&Z(n[0])||Z(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},Z=function(t){var r=typeof t;return"number"===r||"string"===r},$=(e(3),function(){return($=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)}),tt=function(t){return Object.entries(t).reduce((function(t,r){var e,n,o=r[0],i=r[1],u=i;return Array.isArray(i)&&(u=i.reduce((function(t,r){return t+","+r}))),$($({},t),"catalogueId"===o?((e={})[o]=u,e.channelId=u,e):((n={})[o]=u,n))}),{})},rt=function(t){var r=null!=t?t:{},e=r.type,n=void 0===e?"predefined":e,o=r.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}},et=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1];return"query"===n?$($({},t),((e={})[n]=o,e)):t}),{})},nt=function(t){var r;void 0===t&&(t={});var e=Object.entries(t),n=(null!==(r=e.find((function(t){return"category"===t[0]})))&&void 0!==r?r:[])[1],o=(null==n?void 0:n.size)>0;return e.reduce((function(t,r){var e=r[0],n=r[1],i=void 0===n?{}:n;return"page"===e?$($({},t),{page:i}):"product"===e?$($({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===e?$($({},t),{size:i.size}):t}),{})},ot=function(t,r){for(var e=t,n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],u=i[0],a=i[1],s=new RegExp("/:"+u,"g");e=e.replace(s,"/"+a)}return e},it=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},ut=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},at=function(t,r,e){return r=z(r),C(r,e),function(t,r,e){var n=r.filterBy,o=r.groupBy,i=r.additionalFilters,u=r.orderBy,a=r.pagination,s=tt(n),f=rt(u),c=et(i),l=nt(a),h=$($($($($({},s),{groupBy:o}),f),c),l);o||delete h.groupBy;var p=ot(t,e.params),d=Object(j.getState)().artisnApp,y=(null!=d?d:{}).apiURL,g=Object.entries(h).reduce((function(t,r,e){var n=r[0],o=r[1];return void 0===o?t:t+(e?"&":"")+n+"="+o}),y+"/"+p+"?");return $($({},e),{url:g,query:h})}(t,r,e)},st=function(t){return it(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return ut(this,(function(a){switch(a.label){case 0:r=t.url,e=t.headers,n=t.body,"{}"===(o={headers:e,body:JSON.stringify(n)}).body&&delete o.body,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(r,o).then((function(t){return t.json()}))];case 2:return i=a.sent(),[3,4];case 3:return u=a.sent(),i={code:null,status:"failed",message:u.message,stack:u.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i]}}))}))},ft=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},ct=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},lt=function(t){return ft(void 0,void 0,void 0,(function(){return ct(this,(function(r){switch(r.label){case 0:return[4,st(t)];case 1:return[2,r.sent()]}}))}))},ht=e(4),pt=function(){return(pt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},dt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},yt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},gt={"Content-Type":"application/json"},vt=function(t,r){return void 0===t&&(t=!0),void 0===r&&(r={}),dt(void 0,void 0,void 0,(function(){var e,n,o,i,u,a,s,f,c,l,h,p,d,y,g,v,b,w,m;return yt(this,(function(A){switch(A.label){case 0:return e=Object(j.getState)(),n=e.artisnApp,o=e.accountId,i=n.settings,u=i.platform,a=i.accountId,s=null!==(g=null!==(y=null!==(d=null===(p=r.account)||void 0===p?void 0:p.toString())&&void 0!==d?d:null==o?void 0:o.toString())&&void 0!==y?y:null==a?void 0:a.toString())&&void 0!==g?g:"",f=null!==(b=null!==(v=r.Platform)&&void 0!==v?v:u)&&void 0!==b?b:"",c=f,null===(w=r.Authorization)||void 0===w?[3,1]:(h=w,[3,3]);case 1:return[4,bt(t)];case 2:h=A.sent(),A.label=3;case 3:return l=null!==(m=h)&&void 0!==m?m:"",[2,new Headers(pt(pt(pt({},gt),r),{Authorization:l,Platform:c,account:s}))]}}))}))},bt=function(t,r){return void 0===t&&(t=!0),dt(void 0,void 0,void 0,(function(){var e,n,o;return yt(this,(function(i){switch(i.label){case 0:return(e=Object(j.getState)().artisnApp)?[4,null===(o=function(){return Object(ht.initAuth)(e)}().currentUser)||void 0===o?void 0:o.getIdToken(r)]:[2];case 1:return(n=i.sent())||t?!n&&t?(c("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},wt=e(1),mt=function(){return(mt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},At=function(t,r){var e=z(r).pagination,n=t.pagination;return mt(mt({},t),{pagination:Et(e,n)})},Et=function(t,r){return mt(mt({},t),{page:null==r?void 0:r.page,hasMorePages:null==r?void 0:r.hasMorePages})},Ot=function(){return(Ot=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Pt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Tt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},St=function(t,r){return Pt(void 0,void 0,void 0,(function(){var e,n,o;return Tt(this,(function(i){switch(i.label){case 0:return[4,vt(!1)];case 1:return e=i.sent(),n=at("v1/products/:productId",r,{headers:e,params:{productId:t},query:{},body:{}}),[4,Object(wt.handleHttpCache)(n,(function(t){return Pt(void 0,void 0,void 0,(function(){var r,e;return Tt(this,(function(n){switch(n.label){case 0:return[4,lt(t)];case 1:return r=n.sent(),e=B(r.data),[2,Ot(Ot({},r),{data:e})]}}))}))}))];case 2:return o=i.sent(),[2,At(o,r)]}}))}))},It=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},_t=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Rt=function(t){return It(void 0,void 0,void 0,(function(){return _t(this,(function(r){switch(r.label){case 0:return[4,st(t)];case 1:return[2,r.sent()]}}))}))},Bt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},xt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},jt=function(t){return Bt(void 0,void 0,void 0,(function(){var r,e,n;return xt(this,(function(o){switch(o.label){case 0:return[4,vt(!1)];case 1:return r=o.sent(),e=at("api/v3/productsBy",t,{headers:r,params:{},query:{},body:{}}),[4,Object(wt.handleHttpCache)(e,(function(t){return Bt(void 0,void 0,void 0,(function(){return xt(this,(function(r){switch(r.label){case 0:return[4,Rt(t)];case 1:return[2,r.sent()]}}))}))}))];case 2:return n=o.sent(),[2,At(n,t)]}}))}))},Ct=function(){console.log("Not implemented yet")},Ut=function(){console.log("not implemented yet")},Mt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Lt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Yt=function(t){return Mt(void 0,void 0,void 0,(function(){return Lt(this,(function(r){switch(r.label){case 0:return[4,st(t)];case 1:return[2,r.sent()]}}))}))},Dt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},kt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Nt=function(t){return Dt(void 0,void 0,void 0,(function(){var r,e,n;return kt(this,(function(o){switch(o.label){case 0:return[4,vt(!1)];case 1:return r=o.sent(),e=at("v1/stores/details",t,{headers:r,params:{},query:{},body:{}}),[4,Object(wt.handleHttpCache)(e,(function(t){return Dt(void 0,void 0,void 0,(function(){return kt(this,(function(r){switch(r.label){case 0:return[4,Yt(t)];case 1:return[2,r.sent()]}}))}))}))];case 2:return n=o.sent(),[2,At(n,t)]}}))}))},qt={artisnApp:void 0,forms:{},accountId:void 0},Ft=function(){return(Ft=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},zt=function(t,r){for(var e=0,n=r.length,o=t.length;e<n;e++,o++)t[o]=r[e];return t},Ht=function(t,r){for(var e=zt([],r),n=t,o=t[0];e.length;){o=Jt(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},Gt=function(t,r,e){for(var n=zt([],r),o=t,i=Jt(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Jt(o,n[0]),n=n.slice(1),u=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=zt([],u?i.modifiers:i.groups);var a=n[0];if(1===r.length&&(i={groups:t},u=!1),u){var s=i.modifiers.map((function(t){return t.id===a?Ft({},e):Ft({},t)}));i.modifiers=s}else{var f=i.groups.map((function(t){return t.id===a?Ft({},e):Ft({},t)}));i.groups=f}return 1===r.length?zt([],i.groups):zt([],t)},Jt=function(t,r){var e=t.find((function(t){return t.id===r}));if(!e)throw new Error("Path segment "+r+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return e},Kt=function(){return(Kt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Wt=function(t,r){for(var e=0,n=r.length,o=t.length;e<n;e++,o++)t[o]=r[e];return t},Xt=function(t,r,e,n,o){var i=Kt(Kt({},e),{amount:n,touched:!0,errors:h(e,n,o),totals:mr(Kt(Kt({},e.data),{amount:n})),data:Kt(Kt({},e.data),{amount:n})});return i.status=y(i),Gt(t,r,i)},Qt=function(t,r,e,n){var o=e.slice(0,-1),i=Ht(r,o),u=Wt([],i.modifiers);"RADIO"!==i.type||n||(u=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===e[e.length-1]?Kt({},t):Kt(Kt({},t),{amount:0,error:"",totals:mr(Kt(Kt({},t.data),{amount:0})),data:Kt(Kt({},t.data),{amount:0})})})));var a=(u=u.map((function(r){var o=R(r.data),i=Wt(Wt([],e.slice(0,-1)),[r.id]),u=Kt(Kt({},r),{groups:rr(o,{rootId:t,path:i},r.groups)});return u.errors=h(u,u.amount,n),u.status=y(u),u}))).map((function(t){return Kt({},t.data)})),s=Kt(Kt({},i.data),{answers:a}),f=Kt(Kt({},i),{touched:!0,modifiers:u,data:s});f.errors=p(f,n),f.status=d(f);var c=Gt(r,o,f);return o.length>1&&(c=Vt(t,c,o,n)),c},Vt=function(t,r,e,n){var o=e.slice(0,-1),i=Ht(r,o),u=i.groups.map((function(t){return Kt({},t.data)})),a=Kt(Kt({},i.data),{questions:u}),s=i.groups.map((function(t){var r=Kt({},t);return r.errors=p(r,n),r.status=d(r),r})),f=Kt(Kt({},i),{touched:!0,groups:s,data:a});f.errors=h(f,f.amount,n),f.status=y(f);var c=Gt(r,o,f);return o.length>1&&(c=Qt(t,c,o,n)),c},Zt=function(){return(Zt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},$t=function(){return($t=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},tr=function(t,r){for(var e=0,n=r.length,o=t.length;e<n;e++,o++)t[o]=r[e];return t},rr=function(t,r,e){var n=r.rootId,o=r.path;return t.questions.map((function(r){var i=null==e?void 0:e.find((function(t){return t.id===r.questionId}));return er(r,{amount:t.amount,rootId:n,path:tr([],o)},i)}))},er=function(t,r,e){var n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,f=r.amount,c=r.rootId,h=r.path,p=null!=e?e:{},y=p.errors,g=p.touched,v={id:n,name:o,description:null!=i?i:"",images:tr([],null!=s?s:[]),data:$t({},t),errors:null!=y?y:[],touched:null!=g&&g,status:"IDLE",hidden:f<1,required:a>0,type:l(t)},b={rootId:c,max:u,min:a,type:v.type,modifiersCount:t.answers.length,amount:f,path:tr(tr([],h),[n])},w=t.answers.map((function(t){var r=null==e?void 0:e.modifiers.find((function(r){return r.id===t.productId}));return nr(t,b,r)})),m=$t($t({},v),{modifiers:w});return $t($t({},m),{status:d(m)})},nr=function(t,r,e){var n,o,i=t.productId,u=t.questionId,a=t.name,s=t.images,f=t.amount,c=t.renderType,l=t.min,h=t.max,p=R(t),d=r.rootId,g=r.path,b=tr(tr([],g),[i]),w=rr(p,{rootId:d,path:b},null==e?void 0:e.groups),m={id:i,groupId:u,name:a,images:tr([],s),amount:f,data:$t({},t),groups:w,errors:null!==(n=null==e?void 0:e.errors)&&void 0!==n?n:[],hidden:r.amount<1,min:l,max:h,required:l>0,touched:null!==(o=null==e?void 0:e.touched)&&void 0!==o&&o,status:"IDLE",totals:mr($t($t({},t),{amount:f})),type:c,handleChange:function(t){!function(t,r,e){var n,o=Zt({},Object(j.getState)().forms),i=o[t],u=Ht(i.renderer,r),a=Xt(i.renderer,r,u,e,!1);a=Qt(t,a,r,!1);var s=ir(a,i.product),f=Zt(Zt({},i),{renderer:a,product:s,status:v(a)}),c=Zt(Zt({},o),((n={})[t]=f,n));Object(j.setState)({forms:c});var l=Zt({},f);delete l.callback,i.callback(l)}(r.rootId,b,t)}};return $t($t({},m),{status:y(m)})},or=function(){return(or=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},ir=function(t,r){var e=O(r);return or(or({},e),{questionsAndAnswers:ur(t),updatedAt:""})},ur=function(t){return t.map((function(t){return or(or({},t.data),{answers:ar(t.modifiers)})}))},ar=function(t){return t.map((function(t){return t.amount?or(or({},t.data),{questionsAndAnswers:ur(t.groups)}):or(or({},t.data),{questionsAndAnswers:[]})}))},sr=function(){return(sr=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},fr=function(t,r){var e,n=t.productId;Object(j.checkInit)()||Object(j.initState)(qt);var o=Object(j.getState)().forms;if(!!o[n])return c("Form for product with id "+n+" has already been register. Please unsubscribe if you need to register a new form."),function(){};var i=function(t){var r,e=S(t,{amount:null!==(r=t.amount)&&void 0!==r?r:1}),n=rr(e,{rootId:e.productId,path:[]});return{product:ir(n,t),renderer:n,validate:function(){return pr(t.productId)},status:v(n)}}(t),u=sr(sr({},o),((e={})[n]=sr(sr({},i),{callback:r}),e));return Object(j.setState)({forms:u}),r(sr({},i)),function(){return cr(n)}},cr=function(t){var r=Object(j.getState)().forms,e=sr({},r);delete e[t],Object(j.setState)({forms:e})},lr=function(){return(lr=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},hr=function(t,r){for(var e=0,n=r.length,o=t.length;e<n;e++,o++)t[o]=r[e];return t},pr=function(t){var r,e=lr({},Object(j.getState)().forms),n=e[t],o=n.renderer,i=n.callback,u=n.product,a=hr([],o);o.forEach((function(r){var e=[r.id];a=dr(r,a,t,e)}));var s=ir(a,u),f=lr(lr({},n),{renderer:a,product:s,status:v(a)}),c=lr(lr({},e),((r={})[t]=f,r));Object(j.setState)({forms:c});var l=lr({},f);return delete l.callback,i(l),f.status},dr=function(t,r,e,n){var o=t.modifiers,i=t.id,u=!o.length,a=hr([],r);return u?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),a):(o.forEach((function(t){var r=hr(hr([],n),[t.id]);a=yr(t,a,e,r)})),a)},yr=function(t,r,e,n){var o=t.groups,i=t.amount,u=t.status,a=t.required,s=!o.length||0===i,f=hr([],r);if(s){var c="IDLE"===u&&a||"FAIL"===u||"INCOMPLETE"===u?"FAIL":u,l=lr(lr({},t),{status:c}),h=hr([],n);f=Xt(f,h,l,l.amount,!0),f=Qt(e,f,h,!0)}else o.forEach((function(t){var r=hr(hr([],n),[t.id]);f=dr(t,f,e,r)}));return f},gr=function(){return(gr=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},vr=!1,br=function(t,r){(void 0===r&&(r={}),vr)?console.warn("artisn/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once"):(Object(j.initState)(qt),Object(j.setState)(gr({artisnApp:t},r)),Object(wt.initCache)({timeout:r.timeout}),"undefined"==typeof window||(vr=!0))},wr=function(){Object(j.setState)(gr({},qt)),vr=!1},mr=function(t,r){if(void 0===r&&(r=t.amount>0?t.amount:1),r<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var e=t,n=!!e.updatedAt?m(e):t;return{unitGrossPrice:Or(n,1),unitTotalDiscounts:Pr(n,1),unitTotalTaxes:Ar(n,1),unitNetPrice:Tr(n,1),amount:r,grossPrice:Or(n,r),totalDiscounts:Pr(n,r),totalTaxes:Ar(n,r),netPrice:Tr(n,r)}},Ar=function(t,r){var e=O(t,{amount:r}),n=e.prices,o=e.amount,i=n[e.priceCategory],u=i.taxes,a=i.grossPrice,s=_r(u,a);return Er(e,r)+s*o},Er=function(t,r){var e,n;return null!==(n=null===(e=t.questionsAndAnswers)||void 0===e?void 0:e.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices,o=e.amount,i=n[e.priceCategory],u=i.taxes,a=i.grossPrice;return t+o*(_r(u,a)+Er(e,r))}),0)*r}),0))&&void 0!==n?n:0},Or=function(t,r){return Sr(t,"grossPrice",r)},Pr=function(t,r){return 0},Tr=function(t,r){return Sr(t,"netPrice",r)},Sr=function(t,r,e){var n=O(t,{amount:e}),o=n.prices,i=n.amount,u=o[n.priceCategory][r];return(Ir(n,r)+u)*i},Ir=function(t,r){var e,n;return null!==(n=null===(e=t.questionsAndAnswers)||void 0===e?void 0:e.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices;return t+e.amount*(n[e.priceCategory][r]+Ir(e,r))}),0)}),0))&&void 0!==n?n:0},_r=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)}}])}));
|
|
19
|
+
r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,f=s>>1,c=-7,l=e?o-1:0,h=e?-1:1,p=t[r+l];for(l+=h,i=p&(1<<-c)-1,p>>=-c,c+=a;c>0;i=256*i+t[r+l],l+=h,c-=8);for(u=i&(1<<-c)-1,i>>=-c,c+=n;c>0;u=256*u+t[r+l],l+=h,c-=8);if(0===i)i=1-f;else{if(i===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=f}return(p?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var u,a,s,f=8*i-o-1,c=(1<<f)-1,l=c>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=c):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+l>=1?h/s:h*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=c?(a=0,u=c):u+l>=1?(a=(r*s-1)*Math.pow(2,o),u+=l):(a=r*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[e+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,f+=o;f>0;t[e+p]=255&u,p+=d,u/=256,f-=8);t[e+p-d]|=128*y}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r){var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,r){return t<<r|t>>>32-r},rotr:function(t,r){return t<<32-r|t>>>r},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var r=0;r<t.length;r++)t[r]=n.endian(t[r]);return t},randomBytes:function(t){for(var r=[];t>0;t--)r.push(Math.floor(256*Math.random()));return r},bytesToWords:function(t){for(var r=[],e=0,n=0;e<t.length;e++,n+=8)r[n>>>5]|=t[e]<<24-n%32;return r},wordsToBytes:function(t){for(var r=[],e=0;e<32*t.length;e+=8)r.push(t[e>>>5]>>>24-e%32&255);return r},bytesToHex:function(t){for(var r=[],e=0;e<t.length;e++)r.push((t[e]>>>4).toString(16)),r.push((15&t[e]).toString(16));return r.join("")},hexToBytes:function(t){for(var r=[],e=0;e<t.length;e+=2)r.push(parseInt(t.substr(e,2),16));return r},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?r.push(e.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(n))>>>6-2*o);return r}},t.exports=n},,function(t,r,e){"use strict";e.r(r),e.d(r,"getCategories",(function(){return x})),e.d(r,"getProductDetails",(function(){return St})),e.d(r,"getProducts",(function(){return jt})),e.d(r,"getRecommendedProducts",(function(){return Ct})),e.d(r,"getRelatedProducts",(function(){return Ut})),e.d(r,"getStoreDetails",(function(){return Nt})),e.d(r,"registerModifiersForm",(function(){return sr})),e.d(r,"validateProduct",(function(){return hr})),e.d(r,"initProducts",(function(){return br})),e.d(r,"closeProducts",(function(){return wr})),e.d(r,"getProductTotals",(function(){return mr})),e.d(r,"transformers",(function(){return i})),e.d(r,"assertions",(function(){return n})),e.d(r,"modifierUtils",(function(){return o}));var n={};e.r(n),e.d(n,"isBaseProduct",(function(){return u})),e.d(n,"isProductDetails",(function(){return a})),e.d(n,"isCartProduct",(function(){return s})),e.d(n,"isFormCartProduct",(function(){return f}));var o={};e.r(o),e.d(o,"multiplyProductQA",(function(){return w})),e.d(o,"divideProductQA",(function(){return m})),e.d(o,"operationOnProductQA",(function(){return A}));var i={};e.r(i),e.d(i,"toCartProduct",(function(){return O})),e.d(i,"toFormCartProduct",(function(){return S})),e.d(i,"toFormCartProductHelper",(function(){return I})),e.d(i,"toFormCartProductFromProductDetails",(function(){return _})),e.d(i,"toFormCartProductFromAnswer",(function(){return R})),e.d(i,"normalizeProductDetails",(function(){return B}));var u=function(t){var r=t.attributes,e=t.description,n=t.name,o=t.images,i=t.prices,u=t.productId;return"boolean"==typeof r.showInMenu&&("string"==typeof e&&("string"==typeof n&&("string"==typeof u&&(!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)))))},a=function(t){if(!u(t))return!1;var r=t.questions;return!!Array.isArray(r)},s=function(t){if(!a(t))return!1;var r=t.hash,e=t.createdAt,n=t.updatedAt,o=t.amount,i=t.priceCategory,u=t.comment,s=t.questionsAndAnswers;return"string"==typeof r&&("string"==typeof e&&("string"==typeof n&&("number"==typeof o&&("string"==typeof u&&(!!["NORMAL","POINTS"].includes(i)&&!!Array.isArray(s))))))},f=function(t){var r;if(!s(t))return!1;var e=t.questions;if(!Array.isArray(e))return!1;var n=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},c=function(t){console.error(t)},l=function(t){var r=t.min,e=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===r&&1===e)return"CHECKBOX";if(1===r&&1===e)return"RADIO";if(0===r&&(0===e||e===1/0))return"COUNTER";if(e>=r)return"COUNTER";throw new Error("Modifier group bad configured. min "+r+", max "+e+", type "+n)},h=function(t,r,e){var n=[],o=t.max,i=t.min;return r>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),e&&r<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},p=function(t,r){var e=[],n=t.modifiers,o=t.data,i=o.min,u=o.max;0===i&&0===u&&(u=1/0);var a=n.reduce((function(t,r){return t+r.amount}),0);return a>u&&e.push({code:201,message:"Amount is heigher than the maximum allowed amount "+u}),r&&a<i&&e.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),e},d=function(t){var r=t.touched,e=t.errors,n=t.required,o=t.data,i=t.modifiers,u=o.min,a=i.some((function(t){return"FAIL"===t.status})),s=i.some((function(t){return"IDLE"===t.status})),f=i.some((function(t){return"INCOMPLETE"===t.status})),c=i.reduce((function(t,r){return t+r.amount}),0);return g({touched:r,errors:e,required:n,min:u,amount:c,childrenWithError:a,childrenIdle:s,childrenIncomplete:f,reviewChildren:!0})},y=function(t){var r=t.groups.some((function(t){return"FAIL"===t.status})),e=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,u=t.required,a=t.min,s=t.amount;return g({touched:o,errors:i,required:u,min:a,amount:s,childrenWithError:r,childrenIdle:e,childrenIncomplete:n,reviewChildren:s>0})},g=function(t){var r=t.touched,e=t.errors,n=t.required,o=t.min,i=t.amount,u=t.reviewChildren,a=t.childrenWithError,s=t.childrenIdle,f=t.childrenIncomplete,l=i>0&&!r;return l||r||!n?l||r||n?e.length||u&&a?"FAIL":u&&(s||f)||i<o?"INCOMPLETE":i>=o?"OK":(c("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:r,errors:e,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},v=function(t){return t.every((function(t){var r=t.status,e=t.required;return"OK"===r||"IDLE"===r&&!e}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},b=function(){return(b=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},w=function(t){return A(t,(function(t,r){var e=t.amount*r,n=w(b(b({},t),{amount:e}));return b(b({},n),{amount:t.amount*r})}))},m=function(t){return A(t,(function(t,r){var e=m(t);return b(b({},e),{amount:t.amount/r})}))},A=function(t,r){var e=t.amount,n=void 0===e?1:e,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var e=t.answers.map((function(t){return r(t,n)}));return b(b({},t),{answers:e})}));return b(b({},t),{questionsAndAnswers:i})},E=function(){return(E=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},O=function(t,r){if(void 0===r&&(r={}),s(t))return E(E({},t),r);if(a(t))return P(t,r);var e=T(t);return P(e,r)},P=function(t,r){void 0===r&&(r={});var e=t,n=e.questionsAndAnswers,o=e.priceCategory,i=e.amount;return E(E(E({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:"NORMAL",comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},T=function(t,r){return void 0===r&&(r={}),E(E(E({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},S=function(t,r){if(void 0===r&&(r={}),f(t))return E(E({},t),r);if(a(t))return _(t,r);var e=T(t);return _(e,r)},I=function(t,r){void 0===r&&(r={});var e=m(t),n=e.priceCategory,o=e.productId,i=e.amount,u=e.questions.map((function(t){var r,u=null===(r=e.questionsAndAnswers)||void 0===r?void 0:r.find((function(r){return r.questionId===t.questionId})),a=null!=u?u:t,s=a.questionId,f=a.min,c=a.max,h={rootId:o,min:f,max:c,type:l(a),modifiersCount:t.answers.length,amount:i,path:[]};return E(E({},a),{answers:t.answers.map((function(t){var r,e=null==u?void 0:u.answers.find((function(r){return r.amount>0&&r.productId===t.productId})),o=null!=e?e:t,i=function(t){var r=t.min;return 1===t.modifiersCount?r:0}(h),a=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(h),f=function(t){var r=t.groupType,e=t.min,n=t.max,o=t.type;return"RADIO"===r?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===e&&1===n?"RADIO":0===e&&1===n?"CHECKBOX":0!==e||0!==n&&n!==1/0?n>=e?"COUNTER":r:"COUNTER"}({min:i,max:a,groupType:h.type,type:o.renderType}),c=o.questions.length,l=E(E({},o),{amount:null!==(r=null==o?void 0:o.amount)&&void 0!==r?r:0,priceCategory:n,questionId:s,min:i,max:a,renderType:f});return E(E({},l),{questions:c?I(l).questions:[]})}))})}));return E(E(E({},e),{questions:u}),r)},_=function(t,r){void 0===r&&(r={});var e=P(t);return I(e,r)},R=function(t,r){return void 0===r&&(r={}),I(t,r)},B=function(t){var r=t.questions;return E(E({},t),{questions:r.map((function(t){var r=t.answers;return E(E({},t),{answers:r.map((function(t){var r=t.questions;return E(E({},t),{questions:null!=r?r:[]})}))})}))})},x=function(){console.log("Not supported yet")},j=e(0),C=function(t,r,e){var n;void 0===e&&(e="");var o=null!==(n=r.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,u=i.vendorId,a=i.storeId,s=i.catalogueId;!function(t,r){void 0===r&&(r="");var e=Object(j.getState)().accountId;if(void 0===t&&void 0===e)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+r)}(o,e),function(t,r){void 0===r&&(r="");var e=Object(j.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+r)}(u,e),function(t,r){void 0===r&&(r="");var e=Object(j.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+r)}(a,e),function(t,r){void 0===r&&(r="");var e=Object(j.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+r)}(s,e)},U={HEADERS:["accountId"],FILTERS:["vendorId","storeId","catalogueId","categoryId","productId"],GROUPS:["category"],ORDER_FIELDS:["type","method"],ORDER_TYPES:["alphabetic","price","predefined"],ORDER_METHODS:["asc","desc"],PAGINATION:["page","vendor","store","catalogue","category","product"],ADDITIONAL_FILTERS:["price","query","tags","manufacturerId","weight","dimensions"]},M=function(){return(M=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},L=U.PAGINATION,Y=U.ADDITIONAL_FILTERS,D=U.ORDER_FIELDS,k=U.FILTERS,N=U.GROUPS,q=U.ORDER_METHODS,F=U.ORDER_TYPES,z=function(t){var r=H(t),e=G(r),n=J(e),o=K(n);return W(o)},H=function(t){var r=Object(j.getState)(),e=r.vendorId,n=r.storeId,o=Object(j.getState)(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=M(M({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),f=X(s,k,"filter"),c=V(f);return M(M({},t),{filterBy:c})},G=function(t){var r=Q(t,N,"groupBy");return M({},r)},J=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=X(e,D,"orderBy"),o=M({},n),i=e.method,u=e.type;return u&&!F.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),F.includes(u)||(delete o.type,o.type="predefined"),i&&!q.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),q.includes(i)||(delete o.method,o.method="asc"),M(M({},t),{orderBy:o})},K=function(t){var r=t.pagination,e=X(void 0===r?{}:r,L,"pagination"),n=M({product:{size:20},category:{size:20}},e);return"category"!==t.groupBy&&delete n.category,M(M({},t),{pagination:n})},W=function(t){var r=t.additionalFilters,e=X(void 0===r?{}:r,Y,"additionalFilters");return M(M({},t),{additionalFilters:e})},X=function(t,r,e){var n=M({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?r.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+t),delete n[t]):delete n[t]})),n},Q=function(t,r,e){var n=M({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},V=function(t){var r=M({},t);return Object.entries(r).forEach((function(t){var e=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete r[e]:Array.isArray(n)&&Z(n[0])||Z(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},Z=function(t){var r=typeof t;return"number"===r||"string"===r},$=(e(3),function(){return($=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)}),tt=function(t){return Object.entries(t).reduce((function(t,r){var e,n,o=r[0],i=r[1],u=i;return Array.isArray(i)&&(u=i.reduce((function(t,r){return t+","+r}))),$($({},t),"catalogueId"===o?((e={})[o]=u,e.channelId=u,e):((n={})[o]=u,n))}),{})},rt=function(t){var r=null!=t?t:{},e=r.type,n=void 0===e?"predefined":e,o=r.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}},et=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1];return"query"===n?$($({},t),((e={})[n]=o,e)):t}),{})},nt=function(t){var r;void 0===t&&(t={});var e=Object.entries(t),n=(null!==(r=e.find((function(t){return"category"===t[0]})))&&void 0!==r?r:[])[1],o=(null==n?void 0:n.size)>0;return e.reduce((function(t,r){var e=r[0],n=r[1],i=void 0===n?{}:n;return"page"===e?$($({},t),{page:i}):"product"===e?$($({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===e?$($({},t),{size:i.size}):t}),{})},ot=function(t,r){for(var e=t,n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],u=i[0],a=i[1],s=new RegExp("/:"+u,"g");e=e.replace(s,"/"+a)}return e},it=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},ut=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},at=function(t,r,e){return r=z(r),C(r,e),function(t,r,e){var n=r.filterBy,o=r.groupBy,i=r.additionalFilters,u=r.orderBy,a=r.pagination,s=tt(n),f=rt(u),c=et(i),l=nt(a),h=$($($($($({},s),{groupBy:o}),f),c),l);o||delete h.groupBy;var p=ot(t,e.params),d=Object(j.getState)().artisnApp,y=(null!=d?d:{}).apiURL,g=Object.entries(h).reduce((function(t,r,e){var n=r[0],o=r[1];return void 0===o?t:t+(e?"&":"")+n+"="+o}),y+"/"+p+"?");return $($({},e),{url:g,query:h})}(t,r,e)},st=function(t){return it(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return ut(this,(function(a){switch(a.label){case 0:r=t.url,e=t.headers,n=t.body,"{}"===(o={headers:e,body:JSON.stringify(n)}).body&&delete o.body,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(r,o).then((function(t){return t.json()}))];case 2:return i=a.sent(),[3,4];case 3:return u=a.sent(),i={code:null,status:"failed",message:u.message,stack:u.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i]}}))}))},ft=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},ct=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},lt=function(t){return ft(void 0,void 0,void 0,(function(){return ct(this,(function(r){switch(r.label){case 0:return[4,st(t)];case 1:return[2,r.sent()]}}))}))},ht=e(4),pt=function(){return(pt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},dt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},yt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},gt={"Content-Type":"application/json"},vt=function(t,r){return void 0===t&&(t=!0),void 0===r&&(r={}),dt(void 0,void 0,void 0,(function(){var e,n,o,i,u,a,s,f,c,l,h,p,d,y,g,v,b,w,m;return yt(this,(function(A){switch(A.label){case 0:return e=Object(j.getState)(),n=e.artisnApp,o=e.accountId,i=n.settings,u=i.platform,a=i.accountId,s=null!==(g=null!==(y=null!==(d=null===(p=r.account)||void 0===p?void 0:p.toString())&&void 0!==d?d:null==o?void 0:o.toString())&&void 0!==y?y:null==a?void 0:a.toString())&&void 0!==g?g:"",f=null!==(b=null!==(v=r.Platform)&&void 0!==v?v:u)&&void 0!==b?b:"",c=f,null===(w=r.Authorization)||void 0===w?[3,1]:(h=w,[3,3]);case 1:return[4,bt(t)];case 2:h=A.sent(),A.label=3;case 3:return l=null!==(m=h)&&void 0!==m?m:"",[2,new Headers(pt(pt(pt({},gt),r),{Authorization:l,Platform:c,account:s}))]}}))}))},bt=function(t,r){return void 0===t&&(t=!0),dt(void 0,void 0,void 0,(function(){var e,n,o;return yt(this,(function(i){switch(i.label){case 0:return e=Object(j.getState)().artisnApp,[4,null===(o=function(){return Object(ht.initAuth)(e)}().currentUser)||void 0===o?void 0:o.getIdToken(r)];case 1:return(n=i.sent())||t?!n&&t?(c("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},wt=e(1),mt=function(){return(mt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},At=function(t,r){var e=z(r).pagination,n=t.pagination;return mt(mt({},t),{pagination:Et(e,n)})},Et=function(t,r){return mt(mt({},t),{page:null==r?void 0:r.page,hasMorePages:null==r?void 0:r.hasMorePages})},Ot=function(){return(Ot=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Pt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Tt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},St=function(t,r){return Pt(void 0,void 0,void 0,(function(){var e,n,o;return Tt(this,(function(i){switch(i.label){case 0:return[4,vt(!1)];case 1:return e=i.sent(),n=at("v1/products/:productId",r,{headers:e,params:{productId:t},query:{},body:{}}),[4,Object(wt.handleHttpCache)(n,(function(t){return Pt(void 0,void 0,void 0,(function(){var r,e;return Tt(this,(function(n){switch(n.label){case 0:return[4,lt(t)];case 1:return r=n.sent(),e=B(r.data),[2,Ot(Ot({},r),{data:e})]}}))}))}))];case 2:return o=i.sent(),[2,At(o,r)]}}))}))},It=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},_t=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Rt=function(t){return It(void 0,void 0,void 0,(function(){return _t(this,(function(r){switch(r.label){case 0:return[4,st(t)];case 1:return[2,r.sent()]}}))}))},Bt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},xt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},jt=function(t){return Bt(void 0,void 0,void 0,(function(){var r,e,n;return xt(this,(function(o){switch(o.label){case 0:return[4,vt(!1)];case 1:return r=o.sent(),e=at("api/v3/productsBy",t,{headers:r,params:{},query:{},body:{}}),[4,Object(wt.handleHttpCache)(e,(function(t){return Bt(void 0,void 0,void 0,(function(){return xt(this,(function(r){switch(r.label){case 0:return[4,Rt(t)];case 1:return[2,r.sent()]}}))}))}))];case 2:return n=o.sent(),[2,At(n,t)]}}))}))},Ct=function(){console.log("Not implemented yet")},Ut=function(){console.log("not implemented yet")},Mt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Lt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Yt=function(t){return Mt(void 0,void 0,void 0,(function(){return Lt(this,(function(r){switch(r.label){case 0:return[4,st(t)];case 1:return[2,r.sent()]}}))}))},Dt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},kt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Nt=function(t){return Dt(void 0,void 0,void 0,(function(){var r,e,n;return kt(this,(function(o){switch(o.label){case 0:return[4,vt(!1)];case 1:return r=o.sent(),e=at("v1/stores/details",t,{headers:r,params:{},query:{},body:{}}),[4,Object(wt.handleHttpCache)(e,(function(t){return Dt(void 0,void 0,void 0,(function(){return kt(this,(function(r){switch(r.label){case 0:return[4,Yt(t)];case 1:return[2,r.sent()]}}))}))}))];case 2:return n=o.sent(),[2,At(n,t)]}}))}))},qt=function(){return(qt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Ft=function(t,r){for(var e=0,n=r.length,o=t.length;e<n;e++,o++)t[o]=r[e];return t},zt=function(t,r){for(var e=Ft([],r),n=t,o=t[0];e.length;){o=Gt(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},Ht=function(t,r,e){for(var n=Ft([],r),o=t,i=Gt(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Gt(o,n[0]),n=n.slice(1),u=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=Ft([],u?i.modifiers:i.groups);var a=n[0];if(1===r.length&&(i={groups:t},u=!1),u){var s=i.modifiers.map((function(t){return t.id===a?qt({},e):qt({},t)}));i.modifiers=s}else{var f=i.groups.map((function(t){return t.id===a?qt({},e):qt({},t)}));i.groups=f}return 1===r.length?Ft([],i.groups):Ft([],t)},Gt=function(t,r){var e=t.find((function(t){return t.id===r}));if(!e)throw new Error("Path segment "+r+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return e},Jt=function(){return(Jt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Kt=function(t,r){for(var e=0,n=r.length,o=t.length;e<n;e++,o++)t[o]=r[e];return t},Wt=function(t,r,e,n,o){var i=Jt(Jt({},e),{amount:n,touched:!0,errors:h(e,n,o),totals:mr(Jt(Jt({},e.data),{amount:n})),data:Jt(Jt({},e.data),{amount:n})});return i.status=y(i),Ht(t,r,i)},Xt=function(t,r,e,n){var o=e.slice(0,-1),i=zt(r,o),u=Kt([],i.modifiers);"RADIO"!==i.type||n||(u=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===e[e.length-1]?Jt({},t):Jt(Jt({},t),{amount:0,error:"",totals:mr(Jt(Jt({},t.data),{amount:0})),data:Jt(Jt({},t.data),{amount:0})})})));var a=(u=u.map((function(r){var o=R(r.data),i=Kt(Kt([],e.slice(0,-1)),[r.id]),u=Jt(Jt({},r),{groups:tr(o,{rootId:t,path:i},r.groups)});return u.errors=h(u,u.amount,n),u.status=y(u),u}))).map((function(t){return Jt({},t.data)})),s=Jt(Jt({},i.data),{answers:a}),f=Jt(Jt({},i),{touched:!0,modifiers:u,data:s});f.errors=p(f,n),f.status=d(f);var c=Ht(r,o,f);return o.length>1&&(c=Qt(t,c,o,n)),c},Qt=function(t,r,e,n){var o=e.slice(0,-1),i=zt(r,o),u=i.groups.map((function(t){return Jt({},t.data)})),a=Jt(Jt({},i.data),{questions:u}),s=i.groups.map((function(t){var r=Jt({},t);return r.errors=p(r,n),r.status=d(r),r})),f=Jt(Jt({},i),{touched:!0,groups:s,data:a});f.errors=h(f,f.amount,n),f.status=y(f);var c=Ht(r,o,f);return o.length>1&&(c=Xt(t,c,o,n)),c},Vt=function(){return(Vt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Zt=function(){return(Zt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},$t=function(t,r){for(var e=0,n=r.length,o=t.length;e<n;e++,o++)t[o]=r[e];return t},tr=function(t,r,e){var n=r.rootId,o=r.path;return t.questions.map((function(r){var i=null==e?void 0:e.find((function(t){return t.id===r.questionId}));return rr(r,{amount:t.amount,rootId:n,path:$t([],o)},i)}))},rr=function(t,r,e){var n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,f=r.amount,c=r.rootId,h=r.path,p=null!=e?e:{},y=p.errors,g=p.touched,v={id:n,name:o,description:null!=i?i:"",images:$t([],null!=s?s:[]),data:Zt({},t),errors:null!=y?y:[],touched:null!=g&&g,status:"IDLE",hidden:f<1,required:a>0,type:l(t)},b={rootId:c,max:u,min:a,type:v.type,modifiersCount:t.answers.length,amount:f,path:$t($t([],h),[n])},w=t.answers.map((function(t){var r=null==e?void 0:e.modifiers.find((function(r){return r.id===t.productId}));return er(t,b,r)})),m=Zt(Zt({},v),{modifiers:w});return Zt(Zt({},m),{status:d(m)})},er=function(t,r,e){var n,o,i=t.productId,u=t.questionId,a=t.name,s=t.images,f=t.amount,c=t.renderType,l=t.min,h=t.max,p=R(t),d=r.rootId,g=r.path,b=$t($t([],g),[i]),w=tr(p,{rootId:d,path:b},null==e?void 0:e.groups),m={id:i,groupId:u,name:a,images:$t([],s),amount:f,data:Zt({},t),groups:w,errors:null!==(n=null==e?void 0:e.errors)&&void 0!==n?n:[],hidden:r.amount<1,min:l,max:h,required:l>0,touched:null!==(o=null==e?void 0:e.touched)&&void 0!==o&&o,status:"IDLE",totals:mr(Zt(Zt({},t),{amount:f})),type:c,handleChange:function(t){!function(t,r,e){var n,o=Vt({},Object(j.getState)().forms),i=o[t],u=zt(i.renderer,r),a=Wt(i.renderer,r,u,e,!1);a=Xt(t,a,r,!1);var s=or(a,i.product),f=Vt(Vt({},i),{renderer:a,product:s,status:v(a)}),c=Vt(Vt({},o),((n={})[t]=f,n));Object(j.setState)({forms:c});var l=Vt({},f);delete l.callback,i.callback(l)}(r.rootId,b,t)}};return Zt(Zt({},m),{status:y(m)})},nr=function(){return(nr=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},or=function(t,r){var e=O(r);return nr(nr({},e),{questionsAndAnswers:ir(t),updatedAt:""})},ir=function(t){return t.map((function(t){return nr(nr({},t.data),{answers:ur(t.modifiers)})}))},ur=function(t){return t.map((function(t){return t.amount?nr(nr({},t.data),{questionsAndAnswers:ir(t.groups)}):nr(nr({},t.data),{questionsAndAnswers:[]})}))},ar=function(){return(ar=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},sr=function(t,r){var e,n=t.productId,o=Object(j.getState)().forms;if(!!o[n])return c("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var i=function(t){var r,e=S(t,{amount:null!==(r=t.amount)&&void 0!==r?r:1}),n=tr(e,{rootId:e.productId,path:[]});return{product:or(n,t),renderer:n,validate:function(){return hr(t.productId)},status:v(n)}}(t),u=ar(ar({},o),((e={})[n]=ar(ar({},i),{callback:r}),e));return Object(j.setState)({forms:u}),r(ar({},i)),function(){return fr(n)}},fr=function(t){var r=Object(j.getState)().forms,e=ar({},r);delete e[t],Object(j.setState)({forms:e})},cr=function(){return(cr=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},lr=function(t,r){for(var e=0,n=r.length,o=t.length;e<n;e++,o++)t[o]=r[e];return t},hr=function(t){var r,e=cr({},Object(j.getState)().forms),n=e[t],o=n.renderer,i=n.callback,u=n.product,a=lr([],o);o.forEach((function(r){var e=[r.id];a=pr(r,a,t,e)}));var s=or(a,u),f=cr(cr({},n),{renderer:a,product:s,status:v(a)}),c=cr(cr({},e),((r={})[t]=f,r));Object(j.setState)({forms:c});var l=cr({},f);return delete l.callback,i(l),f.status},pr=function(t,r,e,n){var o=t.modifiers,i=t.id,u=!o.length,a=lr([],r);return u?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),a):(o.forEach((function(t){var r=lr(lr([],n),[t.id]);a=dr(t,a,e,r)})),a)},dr=function(t,r,e,n){var o=t.groups,i=t.amount,u=t.status,a=t.required,s=!o.length||0===i,f=lr([],r);if(s){var c="IDLE"===u&&a||"FAIL"===u||"INCOMPLETE"===u?"FAIL":u,l=cr(cr({},t),{status:c}),h=lr([],n);f=Wt(f,h,l,l.amount,!0),f=Xt(e,f,h,!0)}else o.forEach((function(t){var r=lr(lr([],n),[t.id]);f=pr(t,f,e,r)}));return f},yr={artisnApp:void 0,forms:{},accountId:void 0},gr=function(){return(gr=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},vr=!1,br=function(t,r){(void 0===r&&(r={}),vr)?console.warn("artisn/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once"):(Object(j.initState)(yr),Object(j.setState)(gr({artisnApp:t},r)),Object(wt.initCache)({timeout:r.timeout}),"undefined"==typeof window||(vr=!0))},wr=function(){Object(j.setState)(gr({},yr)),vr=!1},mr=function(t,r){if(void 0===r&&(r=t.amount>0?t.amount:1),r<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var e=t,n=!!e.updatedAt?m(e):t;return{unitGrossPrice:Or(n,1),unitTotalDiscounts:Pr(n,1),unitTotalTaxes:Ar(n,1),unitNetPrice:Tr(n,1),amount:r,grossPrice:Or(n,r),totalDiscounts:Pr(n,r),totalTaxes:Ar(n,r),netPrice:Tr(n,r)}},Ar=function(t,r){var e=O(t,{amount:r}),n=e.prices,o=e.amount,i=n[e.priceCategory],u=i.taxes,a=i.grossPrice,s=_r(u,a);return Er(e,r)+s*o},Er=function(t,r){var e,n;return null!==(n=null===(e=t.questionsAndAnswers)||void 0===e?void 0:e.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices,o=e.amount,i=n[e.priceCategory],u=i.taxes,a=i.grossPrice;return t+o*(_r(u,a)+Er(e,r))}),0)*r}),0))&&void 0!==n?n:0},Or=function(t,r){return Sr(t,"grossPrice",r)},Pr=function(t,r){return 0},Tr=function(t,r){return Sr(t,"netPrice",r)},Sr=function(t,r,e){var n=O(t,{amount:e}),o=n.prices,i=n.amount,u=o[n.priceCategory][r];return(Ir(n,r)+u)*i},Ir=function(t,r){var e,n;return null!==(n=null===(e=t.questionsAndAnswers)||void 0===e?void 0:e.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices;return t+e.amount*(n[e.priceCategory][r]+Ir(e,r))}),0)}),0))&&void 0!==n?n:0},_r=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)}}])}));
|
package/build/report.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"label":"main.bundle.js","isAsset":true,"statSize":196749,"parsedSize":99014,"gzipSize":18668,"groups":[{"label":"state/build","path":"./state/build","statSize":1855,"groups":[{"id":0,"label":"main.bundle.js","path":"./state/build/main.bundle.js","statSize":1855,"parsedSize":1655,"gzipSize":719}],"parsedSize":1655,"gzipSize":719},{"label":"cache/build","path":"./cache/build","statSize":31533,"groups":[{"id":1,"label":"main.bundle.js","path":"./cache/build/main.bundle.js","statSize":31533,"parsedSize":31237,"gzipSize":9702}],"parsedSize":31237,"gzipSize":9702},{"label":"home/circleci/repo/node_modules","path":"./home/circleci/repo/node_modules","statSize":60750,"groups":[{"label":"charenc","path":"./home/circleci/repo/node_modules/charenc","statSize":850,"groups":[{"id":2,"label":"charenc.js","path":"./home/circleci/repo/node_modules/charenc/charenc.js","statSize":850,"parsedSize":426,"gzipSize":231}],"parsedSize":426,"gzipSize":231},{"label":"sha1","path":"./home/circleci/repo/node_modules/sha1","statSize":2124,"groups":[{"id":3,"label":"sha1.js","path":"./home/circleci/repo/node_modules/sha1/sha1.js","statSize":2124,"parsedSize":946,"gzipSize":624}],"parsedSize":946,"gzipSize":624},{"label":"node-libs-browser/node_modules/buffer","path":"./home/circleci/repo/node_modules/node-libs-browser/node_modules/buffer","statSize":48590,"groups":[{"id":5,"label":"index.js","path":"./home/circleci/repo/node_modules/node-libs-browser/node_modules/buffer/index.js","statSize":48590,"parsedSize":19823,"gzipSize":5835}],"parsedSize":19823,"gzipSize":5835},{"label":"base64-js","path":"./home/circleci/repo/node_modules/base64-js","statSize":3932,"groups":[{"id":7,"label":"index.js","path":"./home/circleci/repo/node_modules/base64-js/index.js","statSize":3932,"parsedSize":1406,"gzipSize":744}],"parsedSize":1406,"gzipSize":744},{"label":"ieee754","path":"./home/circleci/repo/node_modules/ieee754","statSize":2154,"groups":[{"id":8,"label":"index.js","path":"./home/circleci/repo/node_modules/ieee754/index.js","statSize":2154,"parsedSize":972,"gzipSize":573}],"parsedSize":972,"gzipSize":573},{"label":"isarray","path":"./home/circleci/repo/node_modules/isarray","statSize":132,"groups":[{"id":9,"label":"index.js","path":"./home/circleci/repo/node_modules/isarray/index.js","statSize":132,"parsedSize":104,"gzipSize":109}],"parsedSize":104,"gzipSize":109},{"label":"crypt","path":"./home/circleci/repo/node_modules/crypt","statSize":2968,"groups":[{"id":10,"label":"crypt.js","path":"./home/circleci/repo/node_modules/crypt/crypt.js","statSize":2968,"parsedSize":1273,"gzipSize":646}],"parsedSize":1273,"gzipSize":646}],"parsedSize":24950,"gzipSize":7900},{"label":"auth/build","path":"./auth/build","statSize":1417,"groups":[{"id":4,"label":"main.bundle.js","path":"./auth/build/main.bundle.js","statSize":1417,"parsedSize":1220,"gzipSize":542}],"parsedSize":1220,"gzipSize":542},{"label":"buildin","path":"./buildin","statSize":472,"groups":[{"id":6,"label":"global.js","path":"./buildin/global.js","statSize":472,"parsedSize":144,"gzipSize":129}],"parsedSize":144,"gzipSize":129},{"label":"src","path":"./src","statSize":100722,"groups":[{"id":12,"label":"index.ts + 31 modules (concatenated)","path":"./src/index.ts + 31 modules (concatenated)","statSize":100722,"parsedSize":38639,"gzipSize":8427,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 31 modules (concatenated)/src","statSize":100702,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 31 modules (concatenated)/src/index.ts","statSize":1063,"parsedSize":407,"gzipSize":88,"inaccurateSizes":true},{"label":"utils","path":"./src/index.ts + 31 modules (concatenated)/src/utils","statSize":64610,"groups":[{"label":"assertions","path":"./src/index.ts + 31 modules (concatenated)/src/utils/assertions","statSize":2866,"groups":[{"id":null,"label":"assertions.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/assertions/assertions.utils.ts","statSize":2866,"parsedSize":1099,"gzipSize":239,"inaccurateSizes":true}],"parsedSize":1099,"gzipSize":239,"inaccurateSizes":true},{"label":"questionsAndAnswers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/questionsAndAnswers","statSize":1822,"groups":[{"id":null,"label":"questionsAndAnswers.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/questionsAndAnswers/questionsAndAnswers.utils.ts","statSize":1822,"parsedSize":698,"gzipSize":152,"inaccurateSizes":true}],"parsedSize":698,"gzipSize":152,"inaccurateSizes":true},{"label":"transformers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers","statSize":7429,"groups":[{"id":null,"label":"transformers.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers/transformers.utils.ts","statSize":6478,"parsedSize":2485,"gzipSize":541,"inaccurateSizes":true},{"id":null,"label":"api.transformer.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers/api.transformer.ts","statSize":951,"parsedSize":364,"gzipSize":79,"inaccurateSizes":true}],"parsedSize":2849,"gzipSize":621,"inaccurateSizes":true},{"label":"calculations","path":"./src/index.ts + 31 modules (concatenated)/src/utils/calculations","statSize":4693,"groups":[{"id":null,"label":"calculations.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/calculations/calculations.utils.ts","statSize":4693,"parsedSize":1800,"gzipSize":392,"inaccurateSizes":true}],"parsedSize":1800,"gzipSize":392,"inaccurateSizes":true},{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/common.utils.ts","statSize":383,"parsedSize":146,"gzipSize":32,"inaccurateSizes":true},{"label":"modifiers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers","statSize":25665,"groups":[{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/common.utils.ts","statSize":7654,"parsedSize":2936,"gzipSize":640,"inaccurateSizes":true},{"id":null,"label":"updateRenderer.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/updateRenderer.utils.ts","statSize":5469,"parsedSize":2098,"gzipSize":457,"inaccurateSizes":true},{"id":null,"label":"form.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/form.utils.ts","statSize":2534,"parsedSize":972,"gzipSize":212,"inaccurateSizes":true},{"id":null,"label":"rendererTraversal.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/rendererTraversal.utils.ts","statSize":2970,"parsedSize":1139,"gzipSize":248,"inaccurateSizes":true},{"id":null,"label":"renderer.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/renderer.utils.ts","statSize":5132,"parsedSize":1968,"gzipSize":429,"inaccurateSizes":true},{"id":null,"label":"handleChange.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/handleChange.utils.ts","statSize":1906,"parsedSize":731,"gzipSize":159,"inaccurateSizes":true}],"parsedSize":9845,"gzipSize":2147,"inaccurateSizes":true},{"label":"http","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http","statSize":15380,"groups":[{"id":null,"label":"http.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/http.utils.ts","statSize":4637,"parsedSize":1778,"gzipSize":387,"inaccurateSizes":true},{"id":null,"label":"purge.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/purge.utils.ts","statSize":5967,"parsedSize":2289,"gzipSize":499,"inaccurateSizes":true},{"id":null,"label":"request.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/request.utils.ts","statSize":4776,"parsedSize":1832,"gzipSize":399,"inaccurateSizes":true}],"parsedSize":5900,"gzipSize":1286,"inaccurateSizes":true},{"id":null,"label":"services.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/services.utils.ts","statSize":6275,"parsedSize":2407,"gzipSize":525,"inaccurateSizes":true},{"label":"state","path":"./src/index.ts + 31 modules (concatenated)/src/utils/state","statSize":97,"groups":[{"id":null,"label":"state.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/state/state.utils.ts","statSize":97,"parsedSize":37,"gzipSize":8,"inaccurateSizes":true}],"parsedSize":37,"gzipSize":8,"inaccurateSizes":true}],"parsedSize":24785,"gzipSize":5405,"inaccurateSizes":true},{"label":"lib","path":"./src/index.ts + 31 modules (concatenated)/src/lib","statSize":23190,"groups":[{"label":"getCategories","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getCategories","statSize":109,"groups":[{"id":null,"label":"getCategories.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getCategories/getCategories.ts","statSize":109,"parsedSize":41,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":41,"gzipSize":9,"inaccurateSizes":true},{"label":"getProductDetails","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProductDetails","statSize":4989,"groups":[{"id":null,"label":"getProductDetails.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProductDetails/getProductDetails.ts","statSize":4989,"parsedSize":1913,"gzipSize":417,"inaccurateSizes":true}],"parsedSize":1913,"gzipSize":417,"inaccurateSizes":true},{"label":"getProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProducts","statSize":4084,"groups":[{"id":null,"label":"getProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProducts/getProducts.ts","statSize":4084,"parsedSize":1566,"gzipSize":341,"inaccurateSizes":true}],"parsedSize":1566,"gzipSize":341,"inaccurateSizes":true},{"label":"getRecommendedProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getRecommendedProducts","statSize":129,"groups":[{"id":null,"label":"getRecommendedProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getRecommendedProducts/getRecommendedProducts.ts","statSize":129,"parsedSize":49,"gzipSize":10,"inaccurateSizes":true}],"parsedSize":49,"gzipSize":10,"inaccurateSizes":true},{"label":"getRelatedProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getRelatedProducts","statSize":121,"groups":[{"id":null,"label":"getRelatedProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getRelatedProducts/getRelatedProducts.ts","statSize":121,"parsedSize":46,"gzipSize":10,"inaccurateSizes":true}],"parsedSize":46,"gzipSize":10,"inaccurateSizes":true},{"label":"getStoreDetails","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getStoreDetails","statSize":4245,"groups":[{"id":null,"label":"getStoreDetails.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getStoreDetails/getStoreDetails.ts","statSize":4245,"parsedSize":1628,"gzipSize":355,"inaccurateSizes":true}],"parsedSize":1628,"gzipSize":355,"inaccurateSizes":true},{"label":"registerModifiersForm","path":"./src/index.ts + 31 modules (concatenated)/src/lib/registerModifiersForm","statSize":3719,"groups":[{"id":null,"label":"registerModifiersForm.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/registerModifiersForm/registerModifiersForm.ts","statSize":3719,"parsedSize":1426,"gzipSize":311,"inaccurateSizes":true}],"parsedSize":1426,"gzipSize":311,"inaccurateSizes":true},{"label":"validateProduct","path":"./src/index.ts + 31 modules (concatenated)/src/lib/validateProduct","statSize":4085,"groups":[{"id":null,"label":"validateProduct.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/validateProduct/validateProduct.ts","statSize":4085,"parsedSize":1567,"gzipSize":341,"inaccurateSizes":true}],"parsedSize":1567,"gzipSize":341,"inaccurateSizes":true},{"label":"initProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/initProducts","statSize":1709,"groups":[{"id":null,"label":"initProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/initProducts/initProducts.ts","statSize":1709,"parsedSize":655,"gzipSize":142,"inaccurateSizes":true}],"parsedSize":655,"gzipSize":142,"inaccurateSizes":true}],"parsedSize":8896,"gzipSize":1940,"inaccurateSizes":true},{"label":"services","path":"./src/index.ts + 31 modules (concatenated)/src/services","statSize":8566,"groups":[{"label":"fetchProductDetails","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchProductDetails","statSize":2858,"groups":[{"id":null,"label":"fetchProductDetails.service.tsx","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchProductDetails/fetchProductDetails.service.tsx","statSize":2858,"parsedSize":1096,"gzipSize":239,"inaccurateSizes":true}],"parsedSize":1096,"gzipSize":239,"inaccurateSizes":true},{"label":"fetchProducts","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchProducts","statSize":2852,"groups":[{"id":null,"label":"fetchProducts.service.tsx","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchProducts/fetchProducts.service.tsx","statSize":2852,"parsedSize":1094,"gzipSize":238,"inaccurateSizes":true}],"parsedSize":1094,"gzipSize":238,"inaccurateSizes":true},{"label":"fetchStoreDetails","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchStoreDetails","statSize":2856,"groups":[{"id":null,"label":"fetchStoreDetails.service.tsx","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchStoreDetails/fetchStoreDetails.service.tsx","statSize":2856,"parsedSize":1095,"gzipSize":238,"inaccurateSizes":true}],"parsedSize":1095,"gzipSize":238,"inaccurateSizes":true}],"parsedSize":3286,"gzipSize":716,"inaccurateSizes":true},{"label":"errors","path":"./src/index.ts + 31 modules (concatenated)/src/errors","statSize":2427,"groups":[{"id":null,"label":"api.errors.ts","path":"./src/index.ts + 31 modules (concatenated)/src/errors/api.errors.ts","statSize":2427,"parsedSize":931,"gzipSize":203,"inaccurateSizes":true}],"parsedSize":931,"gzipSize":203,"inaccurateSizes":true},{"label":"config","path":"./src/index.ts + 31 modules (concatenated)/src/config","statSize":846,"groups":[{"id":null,"label":"constants.ts","path":"./src/index.ts + 31 modules (concatenated)/src/config/constants.ts","statSize":846,"parsedSize":324,"gzipSize":70,"inaccurateSizes":true}],"parsedSize":324,"gzipSize":70,"inaccurateSizes":true}],"parsedSize":38631,"gzipSize":8425,"inaccurateSizes":true}]}],"parsedSize":38639,"gzipSize":8427}]},{"label":"vendors.bundle.js","isAsset":true,"statSize":30,"parsedSize":1196,"gzipSize":540,"groups":[{"label":"src","path":"./src","statSize":30,"groups":[{"id":11,"label":"vendors.ts","path":"./src/vendors.ts","statSize":30,"parsedSize":36,"gzipSize":56}],"parsedSize":36,"gzipSize":56}]}]
|
|
1
|
+
[{"label":"main.bundle.js","isAsset":true,"statSize":196348,"parsedSize":98825,"gzipSize":18622,"groups":[{"label":"state/build","path":"./state/build","statSize":1789,"groups":[{"id":0,"label":"main.bundle.js","path":"./state/build/main.bundle.js","statSize":1789,"parsedSize":1589,"gzipSize":701}],"parsedSize":1589,"gzipSize":701},{"label":"cache/build","path":"./cache/build","statSize":31467,"groups":[{"id":1,"label":"main.bundle.js","path":"./cache/build/main.bundle.js","statSize":31467,"parsedSize":31171,"gzipSize":9682}],"parsedSize":31171,"gzipSize":9682},{"label":"home/circleci/repo/node_modules","path":"./home/circleci/repo/node_modules","statSize":60750,"groups":[{"label":"charenc","path":"./home/circleci/repo/node_modules/charenc","statSize":850,"groups":[{"id":2,"label":"charenc.js","path":"./home/circleci/repo/node_modules/charenc/charenc.js","statSize":850,"parsedSize":426,"gzipSize":231}],"parsedSize":426,"gzipSize":231},{"label":"sha1","path":"./home/circleci/repo/node_modules/sha1","statSize":2124,"groups":[{"id":3,"label":"sha1.js","path":"./home/circleci/repo/node_modules/sha1/sha1.js","statSize":2124,"parsedSize":946,"gzipSize":624}],"parsedSize":946,"gzipSize":624},{"label":"node-libs-browser/node_modules/buffer","path":"./home/circleci/repo/node_modules/node-libs-browser/node_modules/buffer","statSize":48590,"groups":[{"id":5,"label":"index.js","path":"./home/circleci/repo/node_modules/node-libs-browser/node_modules/buffer/index.js","statSize":48590,"parsedSize":19823,"gzipSize":5835}],"parsedSize":19823,"gzipSize":5835},{"label":"base64-js","path":"./home/circleci/repo/node_modules/base64-js","statSize":3932,"groups":[{"id":7,"label":"index.js","path":"./home/circleci/repo/node_modules/base64-js/index.js","statSize":3932,"parsedSize":1406,"gzipSize":744}],"parsedSize":1406,"gzipSize":744},{"label":"ieee754","path":"./home/circleci/repo/node_modules/ieee754","statSize":2154,"groups":[{"id":8,"label":"index.js","path":"./home/circleci/repo/node_modules/ieee754/index.js","statSize":2154,"parsedSize":972,"gzipSize":573}],"parsedSize":972,"gzipSize":573},{"label":"isarray","path":"./home/circleci/repo/node_modules/isarray","statSize":132,"groups":[{"id":9,"label":"index.js","path":"./home/circleci/repo/node_modules/isarray/index.js","statSize":132,"parsedSize":104,"gzipSize":109}],"parsedSize":104,"gzipSize":109},{"label":"crypt","path":"./home/circleci/repo/node_modules/crypt","statSize":2968,"groups":[{"id":10,"label":"crypt.js","path":"./home/circleci/repo/node_modules/crypt/crypt.js","statSize":2968,"parsedSize":1273,"gzipSize":646}],"parsedSize":1273,"gzipSize":646}],"parsedSize":24950,"gzipSize":7900},{"label":"auth/build","path":"./auth/build","statSize":1417,"groups":[{"id":4,"label":"main.bundle.js","path":"./auth/build/main.bundle.js","statSize":1417,"parsedSize":1220,"gzipSize":542}],"parsedSize":1220,"gzipSize":542},{"label":"buildin","path":"./buildin","statSize":472,"groups":[{"id":6,"label":"global.js","path":"./buildin/global.js","statSize":472,"parsedSize":144,"gzipSize":129}],"parsedSize":144,"gzipSize":129},{"label":"src","path":"./src","statSize":100453,"groups":[{"id":12,"label":"index.ts + 31 modules (concatenated)","path":"./src/index.ts + 31 modules (concatenated)","statSize":100453,"parsedSize":38582,"gzipSize":8402,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 31 modules (concatenated)/src","statSize":100433,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 31 modules (concatenated)/src/index.ts","statSize":1063,"parsedSize":408,"gzipSize":88,"inaccurateSizes":true},{"label":"utils","path":"./src/index.ts + 31 modules (concatenated)/src/utils","statSize":64527,"groups":[{"label":"assertions","path":"./src/index.ts + 31 modules (concatenated)/src/utils/assertions","statSize":2866,"groups":[{"id":null,"label":"assertions.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/assertions/assertions.utils.ts","statSize":2866,"parsedSize":1100,"gzipSize":239,"inaccurateSizes":true}],"parsedSize":1100,"gzipSize":239,"inaccurateSizes":true},{"label":"questionsAndAnswers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/questionsAndAnswers","statSize":1822,"groups":[{"id":null,"label":"questionsAndAnswers.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/questionsAndAnswers/questionsAndAnswers.utils.ts","statSize":1822,"parsedSize":699,"gzipSize":152,"inaccurateSizes":true}],"parsedSize":699,"gzipSize":152,"inaccurateSizes":true},{"label":"transformers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers","statSize":7429,"groups":[{"id":null,"label":"transformers.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers/transformers.utils.ts","statSize":6478,"parsedSize":2488,"gzipSize":541,"inaccurateSizes":true},{"id":null,"label":"api.transformer.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers/api.transformer.ts","statSize":951,"parsedSize":365,"gzipSize":79,"inaccurateSizes":true}],"parsedSize":2853,"gzipSize":621,"inaccurateSizes":true},{"label":"calculations","path":"./src/index.ts + 31 modules (concatenated)/src/utils/calculations","statSize":4693,"groups":[{"id":null,"label":"calculations.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/calculations/calculations.utils.ts","statSize":4693,"parsedSize":1802,"gzipSize":392,"inaccurateSizes":true}],"parsedSize":1802,"gzipSize":392,"inaccurateSizes":true},{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/common.utils.ts","statSize":383,"parsedSize":147,"gzipSize":32,"inaccurateSizes":true},{"label":"modifiers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers","statSize":25665,"groups":[{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/common.utils.ts","statSize":7654,"parsedSize":2939,"gzipSize":640,"inaccurateSizes":true},{"id":null,"label":"updateRenderer.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/updateRenderer.utils.ts","statSize":5469,"parsedSize":2100,"gzipSize":457,"inaccurateSizes":true},{"id":null,"label":"form.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/form.utils.ts","statSize":2534,"parsedSize":973,"gzipSize":211,"inaccurateSizes":true},{"id":null,"label":"rendererTraversal.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/rendererTraversal.utils.ts","statSize":2970,"parsedSize":1140,"gzipSize":248,"inaccurateSizes":true},{"id":null,"label":"renderer.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/renderer.utils.ts","statSize":5132,"parsedSize":1971,"gzipSize":429,"inaccurateSizes":true},{"id":null,"label":"handleChange.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/handleChange.utils.ts","statSize":1906,"parsedSize":732,"gzipSize":159,"inaccurateSizes":true}],"parsedSize":9857,"gzipSize":2146,"inaccurateSizes":true},{"label":"http","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http","statSize":15380,"groups":[{"id":null,"label":"http.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/http.utils.ts","statSize":4637,"parsedSize":1780,"gzipSize":387,"inaccurateSizes":true},{"id":null,"label":"purge.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/purge.utils.ts","statSize":5967,"parsedSize":2291,"gzipSize":499,"inaccurateSizes":true},{"id":null,"label":"request.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/request.utils.ts","statSize":4776,"parsedSize":1834,"gzipSize":399,"inaccurateSizes":true}],"parsedSize":5907,"gzipSize":1286,"inaccurateSizes":true},{"id":null,"label":"services.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/services.utils.ts","statSize":6192,"parsedSize":2378,"gzipSize":517,"inaccurateSizes":true},{"label":"state","path":"./src/index.ts + 31 modules (concatenated)/src/utils/state","statSize":97,"groups":[{"id":null,"label":"state.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/state/state.utils.ts","statSize":97,"parsedSize":37,"gzipSize":8,"inaccurateSizes":true}],"parsedSize":37,"gzipSize":8,"inaccurateSizes":true}],"parsedSize":24783,"gzipSize":5397,"inaccurateSizes":true},{"label":"lib","path":"./src/index.ts + 31 modules (concatenated)/src/lib","statSize":23004,"groups":[{"label":"getCategories","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getCategories","statSize":109,"groups":[{"id":null,"label":"getCategories.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getCategories/getCategories.ts","statSize":109,"parsedSize":41,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":41,"gzipSize":9,"inaccurateSizes":true},{"label":"getProductDetails","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProductDetails","statSize":4989,"groups":[{"id":null,"label":"getProductDetails.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProductDetails/getProductDetails.ts","statSize":4989,"parsedSize":1916,"gzipSize":417,"inaccurateSizes":true}],"parsedSize":1916,"gzipSize":417,"inaccurateSizes":true},{"label":"getProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProducts","statSize":4084,"groups":[{"id":null,"label":"getProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProducts/getProducts.ts","statSize":4084,"parsedSize":1568,"gzipSize":341,"inaccurateSizes":true}],"parsedSize":1568,"gzipSize":341,"inaccurateSizes":true},{"label":"getRecommendedProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getRecommendedProducts","statSize":129,"groups":[{"id":null,"label":"getRecommendedProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getRecommendedProducts/getRecommendedProducts.ts","statSize":129,"parsedSize":49,"gzipSize":10,"inaccurateSizes":true}],"parsedSize":49,"gzipSize":10,"inaccurateSizes":true},{"label":"getRelatedProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getRelatedProducts","statSize":121,"groups":[{"id":null,"label":"getRelatedProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getRelatedProducts/getRelatedProducts.ts","statSize":121,"parsedSize":46,"gzipSize":10,"inaccurateSizes":true}],"parsedSize":46,"gzipSize":10,"inaccurateSizes":true},{"label":"getStoreDetails","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getStoreDetails","statSize":4245,"groups":[{"id":null,"label":"getStoreDetails.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getStoreDetails/getStoreDetails.ts","statSize":4245,"parsedSize":1630,"gzipSize":355,"inaccurateSizes":true}],"parsedSize":1630,"gzipSize":355,"inaccurateSizes":true},{"label":"registerModifiersForm","path":"./src/index.ts + 31 modules (concatenated)/src/lib/registerModifiersForm","statSize":3534,"groups":[{"id":null,"label":"registerModifiersForm.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/registerModifiersForm/registerModifiersForm.ts","statSize":3534,"parsedSize":1357,"gzipSize":295,"inaccurateSizes":true}],"parsedSize":1357,"gzipSize":295,"inaccurateSizes":true},{"label":"validateProduct","path":"./src/index.ts + 31 modules (concatenated)/src/lib/validateProduct","statSize":4085,"groups":[{"id":null,"label":"validateProduct.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/validateProduct/validateProduct.ts","statSize":4085,"parsedSize":1568,"gzipSize":341,"inaccurateSizes":true}],"parsedSize":1568,"gzipSize":341,"inaccurateSizes":true},{"label":"initProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/initProducts","statSize":1708,"groups":[{"id":null,"label":"initProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/initProducts/initProducts.ts","statSize":1708,"parsedSize":656,"gzipSize":142,"inaccurateSizes":true}],"parsedSize":656,"gzipSize":142,"inaccurateSizes":true}],"parsedSize":8835,"gzipSize":1924,"inaccurateSizes":true},{"label":"services","path":"./src/index.ts + 31 modules (concatenated)/src/services","statSize":8566,"groups":[{"label":"fetchProductDetails","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchProductDetails","statSize":2858,"groups":[{"id":null,"label":"fetchProductDetails.service.tsx","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchProductDetails/fetchProductDetails.service.tsx","statSize":2858,"parsedSize":1097,"gzipSize":239,"inaccurateSizes":true}],"parsedSize":1097,"gzipSize":239,"inaccurateSizes":true},{"label":"fetchProducts","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchProducts","statSize":2852,"groups":[{"id":null,"label":"fetchProducts.service.tsx","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchProducts/fetchProducts.service.tsx","statSize":2852,"parsedSize":1095,"gzipSize":238,"inaccurateSizes":true}],"parsedSize":1095,"gzipSize":238,"inaccurateSizes":true},{"label":"fetchStoreDetails","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchStoreDetails","statSize":2856,"groups":[{"id":null,"label":"fetchStoreDetails.service.tsx","path":"./src/index.ts + 31 modules (concatenated)/src/services/fetchStoreDetails/fetchStoreDetails.service.tsx","statSize":2856,"parsedSize":1096,"gzipSize":238,"inaccurateSizes":true}],"parsedSize":1096,"gzipSize":238,"inaccurateSizes":true}],"parsedSize":3290,"gzipSize":716,"inaccurateSizes":true},{"label":"errors","path":"./src/index.ts + 31 modules (concatenated)/src/errors","statSize":2427,"groups":[{"id":null,"label":"api.errors.ts","path":"./src/index.ts + 31 modules (concatenated)/src/errors/api.errors.ts","statSize":2427,"parsedSize":932,"gzipSize":202,"inaccurateSizes":true}],"parsedSize":932,"gzipSize":202,"inaccurateSizes":true},{"label":"config","path":"./src/index.ts + 31 modules (concatenated)/src/config","statSize":846,"groups":[{"id":null,"label":"constants.ts","path":"./src/index.ts + 31 modules (concatenated)/src/config/constants.ts","statSize":846,"parsedSize":324,"gzipSize":70,"inaccurateSizes":true}],"parsedSize":324,"gzipSize":70,"inaccurateSizes":true}],"parsedSize":38574,"gzipSize":8400,"inaccurateSizes":true}]}],"parsedSize":38582,"gzipSize":8402}]},{"label":"vendors.bundle.js","isAsset":true,"statSize":30,"parsedSize":1196,"gzipSize":540,"groups":[{"label":"src","path":"./src","statSize":30,"groups":[{"id":11,"label":"vendors.ts","path":"./src/vendors.ts","statSize":30,"parsedSize":36,"gzipSize":56}],"parsedSize":36,"gzipSize":56}]}]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CartProduct,
|
|
1
|
+
import { CartProduct, Image } from "@artisan-commerce/types";
|
|
2
2
|
import { CartProductQuestion } from "@artisan-commerce/types";
|
|
3
3
|
import { CartProductAnswer } from "@artisan-commerce/types";
|
|
4
4
|
import { HandleChangeFunction } from "../lib/registerModifiersForm/registerModifiersForm.types";
|
|
@@ -9,7 +9,7 @@ export interface ModifierGroupRenderer {
|
|
|
9
9
|
id: string;
|
|
10
10
|
name: string;
|
|
11
11
|
description: string;
|
|
12
|
-
images:
|
|
12
|
+
images: Image[];
|
|
13
13
|
data: CartProductQuestion;
|
|
14
14
|
type: GroupTypes;
|
|
15
15
|
errors: RendererError[];
|
|
@@ -26,7 +26,7 @@ export interface ModifierRenderer {
|
|
|
26
26
|
groupId: string;
|
|
27
27
|
name: string;
|
|
28
28
|
amount: number;
|
|
29
|
-
images:
|
|
29
|
+
images: Image[];
|
|
30
30
|
min: number;
|
|
31
31
|
max: number;
|
|
32
32
|
groups: ModifierGroupRenderer[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artisan-commerce/products",
|
|
3
3
|
"description": "Artisn's product management library",
|
|
4
|
-
"version": "0.9.0-canary.
|
|
4
|
+
"version": "0.9.0-canary.2",
|
|
5
5
|
"main": "./build/main.bundle.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"author": "Luis Eduardo Andrade",
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@artisan-commerce/auth": "0.9.0-canary.
|
|
34
|
-
"@artisan-commerce/cache": "0.2.0-canary.
|
|
33
|
+
"@artisan-commerce/auth": "0.9.0-canary.0",
|
|
34
|
+
"@artisan-commerce/cache": "0.2.0-canary.0",
|
|
35
35
|
"sha1": "^1.1.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@artisan-commerce/builders": "0.7.0-canary.
|
|
39
|
-
"@artisan-commerce/types": "0.14.0-canary.
|
|
38
|
+
"@artisan-commerce/builders": "0.7.0-canary.2",
|
|
39
|
+
"@artisan-commerce/types": "0.14.0-canary.2",
|
|
40
40
|
"@babel/core": "^7.10.5",
|
|
41
41
|
"@babel/preset-env": "^7.10.4",
|
|
42
42
|
"@babel/preset-react": "^7.10.4",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"webpack-dev-server": "^3.11.0",
|
|
81
81
|
"webpack-merge": "^5.0.9"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "61cd421cf586b967fe48a7502e1f3841c0877f0e"
|
|
84
84
|
}
|