@artisan-commerce/products 0.7.9 → 0.7.11-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [0.7.11-canary.0](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/products@0.7.10...@artisan-commerce/products@0.7.11-canary.0) (2021-02-03)
7
+
8
+ **Note:** Version bump only for package @artisan-commerce/products
package/README.md CHANGED
@@ -18,73 +18,73 @@ General representation of the building pieces
18
18
 
19
19
  In the project directory, you can run:
20
20
 
21
- ### `npm start`
21
+ ### `yarn start`
22
22
 
23
23
  Runs the app in the development mode.<br>
24
24
 
25
- ### `npm dev`
25
+ ### `yarn dev`
26
26
 
27
- Alias of npm start, for some developers convinience.
27
+ Alias of yarn start, for some developers convinience.
28
28
 
29
- ### `npm test`
29
+ ### `yarn test`
30
30
 
31
31
  Launches the test runner in the interactive watch mode.<br>
32
32
  See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
33
33
 
34
- ### `npm run test:all`
34
+ ### `yarn test:all`
35
35
 
36
36
  Run every test in a none interactive mode and create a coverage report.
37
37
 
38
38
  This command is perfect for pre push hooks.
39
39
 
40
- ### `npm run test:ci`
40
+ ### `yarn test:ci`
41
41
 
42
42
  Simulates a CI environment before running all tests
43
43
 
44
- ### `npm run check-types`
44
+ ### `yarn check-types`
45
45
 
46
46
  Will attempt to compile the whole project including test files that are normally excluded.
47
47
 
48
48
  This command is perfect for verifing the project's integrity before commiting changes
49
49
 
50
- ### `npm run lint`
50
+ ### `yarn lint`
51
51
 
52
52
  Runs the configured linter to check for any lints in your code before deploying, developers must clean any lint before commiting or commints will not go through.
53
53
 
54
- ### `npm run prettier`
54
+ ### `yarn prettier`
55
55
 
56
56
  Configure prettier, the files that should be included and excluded. This command should not be used by itself.
57
57
 
58
- ### `npm run format`
58
+ ### `yarn format`
59
59
 
60
60
  Uses the prettier configuration to run prettier in write mode to all selected files. It will fix all format errors.
61
61
 
62
- ### `npm run check-format`
62
+ ### `yarn check-format`
63
63
 
64
64
  Uses the prettier configuration to run prettier in read mode to all selected files. If any is bad formated, it will display a warning.
65
65
 
66
- ### `npm run build`
66
+ ### `yarn build`
67
67
 
68
68
  Builds the app for production to the `build` folder.<br>
69
69
  It correctly bundles the project in production mode and optimizes the build for the best performance.
70
70
 
71
- ### `npm run validate`
71
+ ### `yarn validate`
72
72
 
73
73
  It validates the integrity of the project by running many of the static testing, unit/integration testing and e2e testing commands.
74
74
 
75
- ### `npm run validate:ci`
75
+ ### `yarn validate:ci`
76
76
 
77
77
  Run a different series of commands than validate, the selected commands that are run are the ones appropiate to be run on CI. This command is not met to be run locally.
78
78
 
79
79
  ## Publishing your library
80
80
 
81
- To publish your library you will only need to run `npm publish`. We will take care of the rest. Things like creating a new build of your code will be done automatically. Just take into consideration to bump the project version following the semver methodology.
81
+ To publish your library you will only need to run `yarn publish`. We will take care of the rest. Things like creating a new build of your code will be done automatically. Just take into consideration to bump the project version following the semver methodology.
82
82
 
83
83
  ## Previewing your library
84
84
 
85
85
  When you are in the middle of the development of your new library, you find your self needing to test the current features you are developing. We recommend using `npm link` and a separte project for those purposes.
86
86
 
87
- If you want to test your app on a real app, then we recommend using `npm publish`. This method should be avoided during development.
87
+ If you want to test your app on a real app, then we recommend using `yarn publish`. This method should be avoided during development.
88
88
 
89
89
  > ### Hope you are enjoying this boilerplate
90
90
  >
@@ -1,8 +1,19 @@
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=25)}([function(t,r,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),o=this&&this.__exportStar||function(t,r){for(var e in t)"default"===e||r.hasOwnProperty(e)||n(r,t,e)};Object.defineProperty(r,"__esModule",{value:!0}),o(e(4),r),o(e(5),r),o(e(6),r),o(e(7),r),o(e(8),r),o(e(9),r),o(e(10),r),o(e(11),r),o(e(12),r),o(e(13),r),o(e(14),r),o(e(15),r),o(e(16),r),o(e(17),r)},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(23),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,c=-1732584194,f=271733878,l=-1009589776;e[i>>5]|=128<<24-i%32,e[15+(i+64>>>9<<4)]=i;for(var d=0;d<e.length;d+=16){for(var h=a,p=s,y=c,v=f,g=l,m=0;m<80;m++){if(m<16)u[m]=e[d+m];else{var b=u[m-3]^u[m-8]^u[m-14]^u[m-16];u[m]=b<<1|b>>>31}var w=(a<<5|a>>>27)+l+(u[m]>>>0)+(m<20?1518500249+(s&c|~s&f):m<40?1859775393+(s^c^f):m<60?(s&c|s&f|c&f)-1894007588:(s^c^f)-899497514);l=f,f=c,c=s<<30|s>>>2,s=a,a=w}a+=h,s+=p,c+=y,f+=v,l+=g}return[a,s,c,f,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(18).Buffer)},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,"initAuth",(function(){return n})),e.d(r,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QuestionTypes=r.DayOfWeekName=r.TaxType=r.PriceCategoryType=r.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(r.ProductType||(r.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(r.PriceCategoryType||(r.PriceCategoryType={})),function(t){t.IVA="IVA"}(r.TaxType||(r.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(r.DayOfWeekName||(r.DayOfWeekName={})),function(t){t.BOOLEAN="BOOLEAN",t.RADIO="RADIO",t.CHECKBOX="CHECKBOX",t.COUNTER="COUNTER"}(r.QuestionTypes||(r.QuestionTypes={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ServiceStatus=r.Days=r.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(r.DeliveryTimeUnit||(r.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(r.Days||(r.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(r.ServiceStatus||(r.ServiceStatus={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";(function(t){
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=27)}([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={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){o=n(n({},o),t)},a=function(){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={},i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},u=function(t){o=n(n({},o),t)},a=function(){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
  *
5
5
  * @author Feross Aboukhadijeh <http://feross.org>
6
6
  * @license MIT
7
7
  */
8
- var n=e(20),o=e(21),i=e(22);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 c(this,t,r,e)}function c(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=d(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|p(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|h(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):d(t,r);if("Buffer"===r.type&&i(r.data))return d(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function f(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(f(r),t=a(t,r<0?0:0|h(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function d(t,r){var e=r.length<0?0:0|h(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function h(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function p(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 k(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 k(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 I(this,r,e);case"ascii":return _(this,r,e);case"latin1":case"binary":return S(this,r,e);case"base64":return T(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function g(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:m(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):m(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function m(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 c(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(o){var f=-1;for(i=e;i<a;i++)if(c(t,i)===c(r,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===s)return f*u}else-1!==f&&(i-=i-f),f=-1}else for(e+s>a&&(e=a-s),i=e;i>=0;i--){for(var l=!0,d=0;d<s;d++)if(c(t,i+d)!==c(r,d)){l=!1;break}if(l)return i}return-1}function b(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 w(t,r,e,n){return F(k(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 I(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=e)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&c)<<6|63&i)>127&&(f=s);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&(s=(15&c)<<12|(63&i)<<6|63&u)>2047&&(s<55296||s>57343)&&(f=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&c)<<18|(63&i)<<12|(63&u)<<6|63&a)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),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 c(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 f(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=p,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)v(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)v(this,r,r+3),v(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)v(this,r,r+7),v(this,r+1,r+6),v(this,r+2,r+5),v(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?I(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),c=this.slice(n,o),f=t.slice(r,e),l=0;l<a;++l)if(c[l]!==f[l]){i=c[l],u=f[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 g(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return g(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 b(this,t,r,e);case"utf8":case"utf-8":return w(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 _(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 S(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+=Y(t[i]);return o}function D(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 C(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 U(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 B(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 j(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 M(t,r,e,n,i){return i||j(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function L(t,r,e,n,i){return i||j(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)||C(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)||C(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||C(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||C(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):U(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||C(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):U(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||C(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):B(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||C(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):B(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);C(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);C(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||C(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||C(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):U(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||C(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):U(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||C(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):B(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||C(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):B(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return M(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return M(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return L(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return L(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:k(new s(t,n).toString()),a=u.length;for(i=0;i<e-r;++i)this[i+r]=u[i%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(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(N,"")).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(19))},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=c(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=c(t),u=n[0],a=n[1],s=new i(function(t,r,e){return 3*(r+e)/4-e}(0,u,a)),f=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[f++]=r>>16&255,s[f++]=r>>8&255,s[f++]=255&r;2===a&&(r=o[t.charCodeAt(e)]<<2|o[t.charCodeAt(e+1)]>>4,s[f++]=255&r);1===a&&(r=o[t.charCodeAt(e)]<<10|o[t.charCodeAt(e+1)]<<4|o[t.charCodeAt(e+2)]>>2,s[f++]=r>>8&255,s[f++]=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(f(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 c(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 f(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){r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=e?o-1:0,d=e?-1:1,h=t[r+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+t[r+l],l+=d,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[r+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(h?-1:1);u+=Math.pow(2,n),i-=c}return(h?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var u,a,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=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=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+l>=1?d/s:d*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=f?(a=0,u=f):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+h]=255&a,h+=p,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[e+h]=255&u,h+=p,u/=256,c-=8);t[e+h-p]|=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 C})),e.d(r,"getProductDetails",(function(){return jt})),e.d(r,"getProducts",(function(){return kt})),e.d(r,"getRecommendedProducts",(function(){return qt})),e.d(r,"getRelatedProducts",(function(){return Ft})),e.d(r,"getStoreDetails",(function(){return Vt})),e.d(r,"registerModifiersForm",(function(){return yr})),e.d(r,"validateProduct",(function(){return br})),e.d(r,"initProducts",(function(){return Pr})),e.d(r,"getProductTotals",(function(){return Tr})),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 s})),e.d(n,"isProductDetails",(function(){return c})),e.d(n,"isCartProduct",(function(){return f})),e.d(n,"isFormCartProduct",(function(){return l}));var o={};e.r(o),e.d(o,"multiplyProductQA",(function(){return w})),e.d(o,"divideProductQA",(function(){return A})),e.d(o,"operationOnProductQA",(function(){return E}));var i={};e.r(i),e.d(i,"toCartProduct",(function(){return P})),e.d(i,"toFormCartProduct",(function(){return _})),e.d(i,"toFormCartProductHelper",(function(){return S})),e.d(i,"toFormCartProductFromProductDetails",(function(){return R})),e.d(i,"toFormCartProductFromAnswer",(function(){return D})),e.d(i,"normalizeProductDetails",(function(){return x}));var u=e(0),a=function(t){console.error(t)},s=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)))))},c=function(t){if(!s(t))return!1;var r=t.questions;return!!Array.isArray(r)},f=function(t){if(!c(t))return!1;var r,e=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,a=t.priceCategory,s=t.comment,f=t.questionsAndAnswers;return"string"==typeof e&&("string"==typeof n&&("string"==typeof o&&("number"==typeof i&&("string"==typeof s&&(!!(r=u.PriceCategoryType,Object.keys(r)).includes(a)&&!!Array.isArray(f))))))},l=function(t){var r;if(!f(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},d=function(t){var r=t.min,e=t.max,n=t.type;if(n)return 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},y=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})),c=i.some((function(t){return"INCOMPLETE"===t.status})),f=i.reduce((function(t,r){return t+r.amount}),0);return g({touched:r,errors:e,required:n,min:u,amount:f,childrenWithError:a,childrenIdle:s,childrenIncomplete:c,reviewChildren:!0})},v=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,s=t.childrenWithError,c=t.childrenIdle,f=t.childrenIncomplete,l=i>0&&!r;return l||r||!n?l||r||n?e.length||u&&s?"FAIL":u&&(c||f)||i<o?"INCOMPLETE":i>=o?"OK":(a("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"},m=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 E(t,(function(t,r){var e=t.amount*r,n=w(b(b({},t),{amount:e}));return b(b({},n),{amount:t.amount*r})}))},A=function(t){return E(t,(function(t,r){var e=A(t);return b(b({},e),{amount:t.amount/r})}))},E=function(t,r){var e=t.amount,n=t.questionsAndAnswers,o=(void 0===n?[]:n).map((function(t){var n=t.answers.map((function(t){return r(t,e)}));return b(b({},t),{answers:n})}));return b(b({},t),{questionsAndAnswers:o})},O=function(){return(O=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)},P=function(t,r){if(void 0===r&&(r={}),f(t))return O(O({},t),r);if(c(t))return T(t,r);var e=I(t);return T(e,r)},T=function(t,r){void 0===r&&(r={});var e=t,n=e.questionsAndAnswers,o=e.priceCategory,i=e.amount;return O(O(O({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:u.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},I=function(t,r){return void 0===r&&(r={}),O(O(O({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},_=function(t,r){if(void 0===r&&(r={}),l(t))return O(O({},t),r);if(c(t))return R(t,r);var e=I(t);return R(e,r)},S=function(t,r){void 0===r&&(r={});var e=A(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,c=a.min,f=a.max,l={rootId:o,min:c,max:f,type:d(a),modifiersCount:t.answers.length,amount:i,path:[]};return O(O({},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}(l),a=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(l),c=function(t){var r=t.groupType,e=t.min,n=t.max;return"RADIO"===r||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:l.type}),f=o.questions.length,d=O(O({},o),{amount:null!==(r=null==o?void 0:o.amount)&&void 0!==r?r:0,priceCategory:n,questionId:s,min:i,max:a,renderType:c});return O(O({},d),{questions:f?S(d).questions:[]})}))})}));return O(O(O({},e),{questions:u}),r)},R=function(t,r){void 0===r&&(r={});var e=T(t);return S(e,r)},D=function(t,r){return void 0===r&&(r={}),S(t,r)},x=function(t){var r=t.questions;return O(O({},t),{questions:r.map((function(t){var r=t.answers;return O(O({},t),{answers:r.map((function(t){var r=t.questions;return O(O({},t),{questions:null!=r?r:[]})}))})}))})},C=function(){console.log("Not supported yet")},U={CLIENT_NAME:"Trade S.A.",DEFAULT_REQUEST_TIMEOUT:1e4,EXCLUDED_LOGGER_STATUS_CODES:[422],INCLUDED_LOGGER_ENVS:["staging","production"],INCLUDED_INTL_LOG_ENVS:[""],COUNTRY:{NAME:"Ecuador",CODE:"593",LANGUAGE:"es"},DEFAULT_API_TIMEOUT:3e5,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"]},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)},j=U.DEFAULT_API_TIMEOUT,M={artisanApp:void 0,timeout:j,apiCache:{},expiresAt:(new Date).getTime()+j,forms:{}};Object.freeze(M);var L=B({},M);Object.seal(L);var N=function(t){L=B(B({},L),t)},Y=function(){return B({},L)},k=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=Y().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=Y().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=Y().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=Y().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)},q=function(){return(q=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)},F=U.FILTERS,z=U.HEADERS,H=function(t,r,e,n){var o=null==r?void 0:r.message;try{o=r?JSON.parse(r.message):r}catch(t){}return{data:null==t?void 0:t.data,hints:G(e),config:e,error:o,pagination:W(n,t)}},G=function(t){var r={};return Object.entries(t.query).forEach((function(t){var e=t,n=e[0],o=e[1];F.includes(n)&&(r[n]=o)})),Object.entries(t.headers).forEach((function(t){var e=t,n=e[0],o=e[1];z.includes(n)&&(r[n]=o)})),r},W=function(t,r){return q(q({},t),{page:null==r?void 0:r.page,hasMorePages:null==r?void 0:r.hasMorePages})},V=function(){return(V=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)},K=function(){return(K=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)},X=U.PAGINATION,Q=U.ADDITIONAL_FILTERS,J=U.ORDER_FIELDS,Z=U.FILTERS,$=U.GROUPS,tt=U.ORDER_METHODS,rt=U.ORDER_TYPES,et=function(t){var r=Y(),e=r.vendorId,n=r.storeId,o=Y(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=K(K({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),c=at(s,Z,"filter"),f=ct(c);return K(K({},t),{filterBy:f})},nt=function(t){var r=st(t,$,"groupBy");return K({},r)},ot=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=at(e,J,"orderBy"),o=K({},n),i=e.method,u=e.type;return u&&!rt.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),rt.includes(u)||(delete o.type,o.type="predefined"),i&&!tt.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),tt.includes(i)||(delete o.method,o.method="asc"),K(K({},t),{orderBy:o})},it=function(t){var r=t.pagination,e=at(void 0===r?{}:r,X,"pagination"),n=K({product:{size:20},category:{size:20}},e);return"category"!==t.groupBy&&delete n.category,K(K({},t),{pagination:n})},ut=function(t){var r=t.additionalFilters,e=at(void 0===r?{}:r,Q,"additionalFilters");return K(K({},t),{additionalFilters:e})},at=function(t,r,e){var n=K({},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},st=function(t,r,e){var n=K({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},ct=function(t){var r=K({},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)&&ft(n[0])||ft(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},ft=function(t){var r=typeof t;return"number"===r||"string"===r},lt=e(2),dt=e.n(lt),ht=function(){return(ht=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){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}))),ht(ht({},t),"catalogueId"===o?((e={})[o]=u,e.channelId=u,e):((n={})[o]=u,n))}),{})},yt=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}},vt=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?ht(ht({},t),((e={})[n]=o,e)):t}),{})},gt=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?ht(ht({},t),{page:i}):"product"===e?ht(ht({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===e?ht(ht({},t),{size:i.size}):t}),{})},mt=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},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())}))},wt=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,n){return bt(void 0,void 0,void 0,(function(){var o,i,u,a,s,c,f,l;return wt(this,(function(d){switch(d.label){case 0:if(r=function(t){var r=et(t),e=nt(r),n=ot(e),o=it(n);return ut(o)}(r),k(r,e),o=function(t,r,e){var n,o=r.filterBy,i=r.groupBy,u=r.additionalFilters,a=r.orderBy,s=r.pagination,c=pt(o),f=yt(a),l=vt(u),d=gt(s),h=ht(ht(ht(ht(ht({},c),{groupBy:i}),f),l),d);i||delete h.groupBy;var p=mt(t,e.params),y=(null!==(n=Y().artisanApp)&&void 0!==n?n:{}).apiURL,v=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 ht(ht({},e),{url:v,query:h})}(t,r,e),p=o.url,i=dt()(p),u=function(t){return Y().apiCache[t]}(i),h=Y().expiresAt,(a=(new Date).getTime()>=h)&&function(){var t=Y().timeout,r=void 0===t?0:t;N({apiCache:V({},M.apiCache),expiresAt:(new Date).getTime()+r})}(),u&&!a)return[3,4];s=r.pagination,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,n(o)];case 2:return c=d.sent(),l=H(c,void 0,o,s),function(t,r){var e,n=Y().apiCache,o=V(V({},n),((e={})[t]=r,e));N({apiCache:o})}(i,l),[2,l];case 3:return f=d.sent(),[2,l=H(void 0,f,o,s)];case 4:return[2,u]}var h,p}))}))},Et=function(t){return bt(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return wt(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]}}))}))},Ot=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())}))},Pt=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])}}},Tt=e(3),It=function(){return(It=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,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())}))},St=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={"Content-Type":"application/json"},Dt=function(t,r){return void 0===t&&(t=!0),void 0===r&&(r={}),_t(void 0,void 0,void 0,(function(){var e,n,o,i,u,a,s,c,f,l,d,h,p,y,v;return St(this,(function(g){switch(g.label){case 0:return e=Y().artisanApp.settings,n=e.platform,o=e.accountId,i=null!==(d=null!==(l=null===(f=r.account)||void 0===f?void 0:f.toString())&&void 0!==l?l:null==o?void 0:o.toString())&&void 0!==d?d:"",u=null!==(p=null!==(h=r.Platform)&&void 0!==h?h:n)&&void 0!==p?p:"",a=u,null===(y=r.Authorization)||void 0===y?[3,1]:(c=y,[3,3]);case 1:return[4,xt(t)];case 2:c=g.sent(),g.label=3;case 3:return s=null!==(v=c)&&void 0!==v?v:"",[2,new Headers(It(It(It({},Rt),r),{Authorization:s,Platform:a,account:i}))]}}))}))},xt=function(t,r){return void 0===t&&(t=!0),_t(void 0,void 0,void 0,(function(){var e,n,o;return St(this,(function(i){switch(i.label){case 0:return e=Y().artisanApp,[4,null===(o=function(){return Object(Tt.initAuth)(e)}().currentUser)||void 0===o?void 0:o.getIdToken(r)];case 1:return(n=i.sent())||t?!n&&t?(a("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},Ct=function(){return(Ct=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)},Ut=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())}))},Bt=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,r){return Ut(void 0,void 0,void 0,(function(){var e;return Bt(this,(function(n){switch(n.label){case 0:return[4,Dt(!1)];case 1:return e=n.sent(),[4,At("v1/products/:productId",r,{headers:e,params:{productId:t},query:{},body:{}},(function(t){return Ut(void 0,void 0,void 0,(function(){var r,e;return Bt(this,(function(n){switch(n.label){case 0:return[4,(o=t,Ot(void 0,void 0,void 0,(function(){return Pt(this,(function(t){switch(t.label){case 0:return[4,Et(o)];case 1:return[2,t.sent()]}}))})))];case 1:return r=n.sent(),e=x(r.data),[2,Ct(Ct({},r),{data:e})]}var o}))}))}))];case 2:return[2,n.sent()]}}))}))},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])}}},Nt=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])}}},kt=function(t){return Nt(void 0,void 0,void 0,(function(){var r;return Yt(this,(function(e){switch(e.label){case 0:return[4,Dt(!1)];case 1:return r=e.sent(),[4,At("api/v3/productsBy",t,{headers:r,params:{},query:{},body:{}},(function(t){return Nt(void 0,void 0,void 0,(function(){return Yt(this,(function(r){switch(r.label){case 0:return[4,(e=t,Mt(void 0,void 0,void 0,(function(){return Lt(this,(function(t){switch(t.label){case 0:return[4,Et(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 2:return[2,e.sent()]}}))}))},qt=function(){console.log("Not implemented yet")},Ft=function(){console.log("not implemented yet")},zt=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())}))},Ht=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=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())}))},Wt=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])}}},Vt=function(t){return Gt(void 0,void 0,void 0,(function(){var r;return Wt(this,(function(e){switch(e.label){case 0:return[4,Dt(!1)];case 1:return r=e.sent(),[4,At("v1/stores/details",t,{headers:r,params:{},query:{},body:{}},(function(t){return Gt(void 0,void 0,void 0,(function(){return Wt(this,(function(r){switch(r.label){case 0:return[4,(e=t,zt(void 0,void 0,void 0,(function(){return Ht(this,(function(t){switch(t.label){case 0:return[4,Et(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 2:return[2,e.sent()]}}))}))},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)},Xt=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Qt=function(t,r){for(var e=Xt(r),n=t,o=t[0];e.length;){o=Zt(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},Jt=function(t,r,e){for(var n=Xt(r),o=t,i=Zt(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Zt(o,n[0]),n=n.slice(1),u=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=Xt(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?Kt({},e):Kt({},t)}));i.modifiers=s}else{var c=i.groups.map((function(t){return t.id===a?Kt({},e):Kt({},t)}));i.groups=c}return 1===r.length?Xt(i.groups):Xt(t)},Zt=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},$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(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},rr=function(t,r,e,n,o){var i=$t($t({},e),{amount:n,touched:!0,errors:h(e,n,o),totals:Tr($t($t({},e.data),{amount:n})),data:$t($t({},e.data),{amount:n})});return i.status=v(i),Jt(t,r,i)},er=function(t,r,e,n){var o=e.slice(0,-1),i=Qt(r,o),u=tr(i.modifiers);"RADIO"!==i.type||n||(u=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===e[e.length-1]?$t({},t):$t($t({},t),{amount:0,error:"",totals:Tr($t($t({},t.data),{amount:0})),data:$t($t({},t.data),{amount:0})})})));var a=(u=u.map((function(r){var o=D(r.data),i=tr(e.slice(0,-1),[r.id]),u=$t($t({},r),{groups:ar(o,{rootId:t,path:i},r.groups)});return u.errors=h(u,u.amount,n),u.status=v(u),u}))).map((function(t){return $t({},t.data)})),s=$t($t({},i.data),{answers:a}),c=$t($t({},i),{touched:!0,modifiers:u,data:s});c.errors=p(c,n),c.status=y(c);var f=Jt(r,o,c);return o.length>1&&(f=nr(t,f,o,n)),f},nr=function(t,r,e,n){var o=e.slice(0,-1),i=Qt(r,o),u=i.groups.map((function(t){return $t({},t.data)})),a=$t($t({},i.data),{questions:u}),s=i.groups.map((function(t){var r=$t({},t);return r.errors=p(r,n),r.status=y(r),r})),c=$t($t({},i),{touched:!0,groups:s,data:a});c.errors=h(c,c.amount,n),c.status=v(c);var f=Jt(r,o,c);return o.length>1&&(f=er(t,f,o,n)),f},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(){return(ir=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)},ur=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},ar=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 sr(r,{amount:t.amount,rootId:n,path:ur(o)},i)}))},sr=function(t,r,e){var n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,c=r.amount,f=r.rootId,l=r.path,h=null!=e?e:{},p=h.errors,v=h.touched,g={id:n,name:o,description:null!=i?i:"",images:ur(null!=s?s:[]),data:ir({},t),errors:null!=p?p:[],touched:null!=v&&v,status:"IDLE",hidden:c<1,required:a>0,type:d(t)},m={rootId:f,max:u,min:a,type:g.type,modifiersCount:t.answers.length,amount:c,path:ur(l,[n])},b=t.answers.map((function(t){var r=null==e?void 0:e.modifiers.find((function(r){return r.id===t.productId}));return cr(t,m,r)})),w=ir(ir({},g),{modifiers:b});return ir(ir({},w),{status:y(w)})},cr=function(t,r,e){var n,o,i=t.productId,u=t.questionId,a=t.name,s=t.images,c=t.amount,f=t.renderType,l=t.min,d=t.max,h=D(t),p=r.rootId,y=r.path,g=ur(y,[i]),b=ar(h,{rootId:p,path:g},null==e?void 0:e.groups),w={id:i,groupId:u,name:a,images:ur(s),amount:c,data:ir({},t),groups:b,errors:null!==(n=null==e?void 0:e.errors)&&void 0!==n?n:[],hidden:r.amount<1,min:l,max:d,required:l>0,touched:null!==(o=null==e?void 0:e.touched)&&void 0!==o&&o,status:"IDLE",totals:Tr(ir(ir({},t),{amount:c})),type:f,handleChange:function(t){!function(t,r,e){var n,o=or({},Y().forms),i=o[t],u=Qt(i.renderer,r),a=rr(i.renderer,r,u,e,!1);a=er(t,a,r,!1);var s=lr(a,i.product),c=or(or({},i),{renderer:a,product:s,status:m(a)}),f=or(or({},o),((n={})[t]=c,n));N({forms:f});var l=or({},c);delete l.callback,i.callback(l)}(r.rootId,g,t)}};return ir(ir({},w),{status:v(w)})},fr=function(){return(fr=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){var e=P(r);return fr(fr({},e),{questionsAndAnswers:dr(t)})},dr=function(t){return t.map((function(t){return fr(fr({},t.data),{answers:hr(t.modifiers)})}))},hr=function(t){return t.map((function(t){return t.amount?fr(fr({},t.data),{questionsAndAnswers:dr(t.groups)}):fr(fr({},t.data),{questionsAndAnswers:[]})}))},pr=function(){return(pr=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)},yr=function(t,r){var e,n=t.productId,o=Y().forms;if(!!o[n])return a("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=_(t,{amount:null!==(r=t.amount)&&void 0!==r?r:1}),n=ar(e,{rootId:e.productId,path:[]});return{product:lr(n,t),renderer:n,validate:function(){return br(t.productId)},status:m(n)}}(t),u=pr(pr({},o),((e={})[n]=pr(pr({},i),{callback:r}),e));return N({forms:u}),r(pr({},i)),function(){return vr(n)}},vr=function(t){var r=Y().forms,e=pr({},r);delete e[t],N({forms:e})},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)},mr=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},br=function(t){var r,e=gr({},Y().forms),n=e[t],o=n.renderer,i=n.callback,u=n.product,a=mr(o);o.forEach((function(r){var e=[r.id];a=wr(r,a,t,e)}));var s=lr(a,u),c=gr(gr({},n),{renderer:a,product:s,status:m(a)}),f=gr(gr({},e),((r={})[t]=c,r));N({forms:f});var l=gr({},c);return delete l.callback,i(l),c.status},wr=function(t,r,e,n){var o=t.modifiers,i=t.id,u=!o.length,a=mr(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=mr(n,[t.id]);a=Ar(t,a,e,r)})),a)},Ar=function(t,r,e,n){var o=t.groups,i=t.amount,u=t.status,a=t.required,s=!o.length||0===i,c=mr(r);if(s){var f="IDLE"===u&&a||"FAIL"===u||"INCOMPLETE"===u?"FAIL":u,l=gr(gr({},t),{status:f}),d=mr(n);c=rr(c,d,l,l.amount,!0),c=er(e,c,d,!0)}else o.forEach((function(t){var r=mr(n,[t.id]);c=wr(t,c,e,r)}));return c},Er=function(){return(Er=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=!1,Pr=function(t,r){if(void 0===r&&(r={}),Or)console.warn("artisan-commerce/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");else{if(N(Er({artisanApp:t},r)),void 0!==r.timeout){var e=(new Date).getTime()+r.timeout;N({expiresAt:e})}"undefined"==typeof window||(Or=!0)}},Tr=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");return{unitGrossPrice:Sr(t,1),unitTotalDiscounts:Rr(t,1),unitTotalTaxes:Ir(t,1),unitNetPrice:Dr(t,1),amount:r,grossPrice:Sr(t,r),totalDiscounts:Rr(t,r),totalTaxes:Ir(t,r),netPrice:Dr(t,r)}},Ir=function(t,r){var e=P(t,{amount:r}),n=e.prices,o=e.amount,i=n[e.priceCategory],u=i.taxes,a=i.grossPrice,s=Ur(u,a);return _r(e,r)+s*o},_r=function(t,r){return t.questionsAndAnswers.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*(Ur(u,a)+_r(e,r))}),0)*r}),0)},Sr=function(t,r){return xr(t,"grossPrice",r)},Rr=function(t,r){return 0},Dr=function(t,r){return xr(t,"netPrice",r)},xr=function(t,r,e){var n=P(t,{amount:e}),o=n.prices,i=n.amount,u=o[n.priceCategory][r];return Cr(n,r,e)+u*i},Cr=function(t,r,e){return t.questionsAndAnswers.reduce((function(t,n){return t+n.answers.reduce((function(t,n){var o=n.prices;return t+n.amount*(o[n.priceCategory][r]+Cr(n,r,e))}),0)*e}),0)},Ur=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)}}])}));
8
+ var n=e(5),o=e(6),i=e(7);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");return 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),t}(t,r,e,n):"string"==typeof r?function(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!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);return o!==n&&(t=t.slice(0,o)),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 k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return F(t).length;default:if(n)return k(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 _(this,r,e);case"ascii":return S(this,r,e);case"latin1":case"binary":return I(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 q(k(r,t.length-e),t,e,n)}function A(t,r,e,n){return q(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 q(F(r),t,e,n)}function P(t,r,e,n){return q(function(t,r){for(var e,n,o,i=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>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 _(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);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}function S(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 I(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+=N(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 U(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 j(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 C(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 D(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 M(t,r,e,n,i){return i||D(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function Y(t,r,e,n,i){return i||D(t,0,e,8),o.write(t,r,e,n,52,8),e+8}r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),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?_(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)}},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||U(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||U(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||U(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||U(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||U(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):C(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||U(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):C(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);U(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);U(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||U(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||U(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||U(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):C(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||U(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):C(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return M(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return M(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:k(new s(t,n).toString()),a=u.length;for(i=0;i<e-r;++i)this[i+r]=u[i%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(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 F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(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(4))},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;return 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),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));return 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]+"=")),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){
9
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
+ 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,"handleHttpCache",(function(){return d}));var n=3e5,o=["accountId"],i=["vendorId","storeId","catalogueId","categoryId","productId"],u=e(0),a=e(2),s=e.n(a),f=i,c=o,l=function(t,r,e){var n=null==r?void 0:r.message;try{n=r?JSON.parse(r.message):r}catch(t){}return{data:null==t?void 0:t.data,hints:h(e),config:e,error:n,pagination:{hasMorePages:null==t?void 0:t.hasMorePages,page:null==t?void 0:t.page}}},h=function(t){var r={};return Object.entries(t.query).forEach((function(t){var e=t,n=e[0],o=e[1];f.includes(n)&&(r[n]=o)})),Object.entries(t.headers).forEach((function(t){var e=t,n=e[0],o=e[1];c.includes(n)&&(r[n]=o)})),r},p=function(){return(p=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)},d=function(t,r){return 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())}))}(void 0,void 0,void 0,(function(){var e,n,o,i,a,f;return 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=(o=u.trys).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])}}}(this,(function(c){switch(c.label){case 0:if(d=t.url,e=s()(d),n=function(t){return Object(u.getState)().apiCache[t]}(e),h=Object(u.getState)().expiresAt,(o=(new Date).getTime()>=h)&&function(){var t=Object(u.getState)().timeout,r=void 0===t?0:t;Object(u.setState)({apiCache:{},expiresAt:(new Date).getTime()+r})}(),n&&!o)return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r(t)];case 2:return i=c.sent(),f=l(i,void 0,t),function(t,r){var e,n=Object(u.getState)().apiCache,o=p(p({},n),((e={})[t]=r,e));Object(u.setState)({apiCache:o})}(e,f),[2,f];case 3:return a=c.sent(),[2,f=l(void 0,a,t)];case 4:return[2,n]}var h,d}))}))},y=n,g={artisanApp:void 0,apiCache:{},expiresAt:(new Date).getTime()+y,timeout:y};Object(u.initState)(g)}])},function(t,r,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),o=this&&this.__exportStar||function(t,r){for(var e in t)"default"===e||r.hasOwnProperty(e)||n(r,t,e)};Object.defineProperty(r,"__esModule",{value:!0}),o(e(6),r),o(e(7),r),o(e(8),r),o(e(9),r),o(e(10),r),o(e(11),r),o(e(12),r),o(e(13),r),o(e(14),r),o(e(15),r),o(e(16),r),o(e(17),r),o(e(18),r),o(e(19),r)},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(25),o=e(3).utf8,i=e(3).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(20).Buffer)},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,"initAuth",(function(){return n})),e.d(r,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QuestionTypes=r.DayOfWeekName=r.TaxType=r.PriceCategoryType=r.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(r.ProductType||(r.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(r.PriceCategoryType||(r.PriceCategoryType={})),function(t){t.IVA="IVA"}(r.TaxType||(r.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(r.DayOfWeekName||(r.DayOfWeekName={})),function(t){t.BOOLEAN="BOOLEAN",t.RADIO="RADIO",t.CHECKBOX="CHECKBOX",t.COUNTER="COUNTER"}(r.QuestionTypes||(r.QuestionTypes={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ServiceStatus=r.Days=r.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(r.DeliveryTimeUnit||(r.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(r.Days||(r.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(r.ServiceStatus||(r.ServiceStatus={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";(function(t){
11
+ /*!
12
+ * The buffer module from node.js, for the browser.
13
+ *
14
+ * @author Feross Aboukhadijeh <http://feross.org>
15
+ * @license MIT
16
+ */
17
+ var n=e(22),o=e(23),i=e(24);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 k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return F(t).length;default:if(n)return k(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 _(this,r,e);case"ascii":return S(this,r,e);case"latin1":case"binary":return I(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 q(k(r,t.length-e),t,e,n)}function A(t,r,e,n){return q(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 q(F(r),t,e,n)}function P(t,r,e,n){return q(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 _(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?_(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 S(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 I(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+=N(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 U(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 j(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 C(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 D(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 M(t,r,e,n,i){return i||D(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function Y(t,r,e,n,i){return i||D(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)||U(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)||U(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||U(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||U(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||U(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):C(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||U(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):C(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);U(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);U(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||U(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||U(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||U(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||U(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):C(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||U(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):C(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return M(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return M(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:k(new s(t,n).toString()),a=u.length;for(i=0;i<e-r;++i)this[i+r]=u[i%a]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(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 F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(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(21))},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
+ /*! 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 M})),e.d(r,"getProductDetails",(function(){return Rt})),e.d(r,"getProducts",(function(){return Dt})),e.d(r,"getRecommendedProducts",(function(){return Mt})),e.d(r,"getRelatedProducts",(function(){return Yt})),e.d(r,"getStoreDetails",(function(){return zt})),e.d(r,"registerModifiersForm",(function(){return lr})),e.d(r,"validateProduct",(function(){return yr})),e.d(r,"initProducts",(function(){return mr})),e.d(r,"getProductTotals",(function(){return Ar})),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 s})),e.d(n,"isProductDetails",(function(){return f})),e.d(n,"isCartProduct",(function(){return c})),e.d(n,"isFormCartProduct",(function(){return l}));var o={};e.r(o),e.d(o,"multiplyProductQA",(function(){return m})),e.d(o,"divideProductQA",(function(){return A})),e.d(o,"operationOnProductQA",(function(){return E}));var i={};e.r(i),e.d(i,"toCartProduct",(function(){return P})),e.d(i,"toFormCartProduct",(function(){return S})),e.d(i,"toFormCartProductHelper",(function(){return I})),e.d(i,"toFormCartProductFromProductDetails",(function(){return R})),e.d(i,"toFormCartProductFromAnswer",(function(){return B})),e.d(i,"normalizeProductDetails",(function(){return x}));var u=e(2),a=function(t){console.error(t)},s=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)))))},f=function(t){if(!s(t))return!1;var r=t.questions;return!!Array.isArray(r)},c=function(t){if(!f(t))return!1;var r,e=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,a=t.priceCategory,s=t.comment,c=t.questionsAndAnswers;return"string"==typeof e&&("string"==typeof n&&("string"==typeof o&&("number"==typeof i&&("string"==typeof s&&(!!(r=u.PriceCategoryType,Object.keys(r)).includes(a)&&!!Array.isArray(c))))))},l=function(t){var r;if(!c(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},h=function(t){var r=t.min,e=t.max,n=t.type;if(n)return 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)},p=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},d=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},y=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 v({touched:r,errors:e,required:n,min:u,amount:c,childrenWithError:a,childrenIdle:s,childrenIncomplete:f,reviewChildren:!0})},g=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 v({touched:o,errors:i,required:u,min:a,amount:s,childrenWithError:r,childrenIdle:e,childrenIncomplete:n,reviewChildren:s>0})},v=function(t){var r=t.touched,e=t.errors,n=t.required,o=t.min,i=t.amount,u=t.reviewChildren,s=t.childrenWithError,f=t.childrenIdle,c=t.childrenIncomplete,l=i>0&&!r;return l||r||!n?l||r||n?e.length||u&&s?"FAIL":u&&(f||c)||i<o?"INCOMPLETE":i>=o?"OK":(a("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"},b=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"},w=function(){return(w=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)},m=function(t){return E(t,(function(t,r){var e=t.amount*r,n=m(w(w({},t),{amount:e}));return w(w({},n),{amount:t.amount*r})}))},A=function(t){return E(t,(function(t,r){var e=A(t);return w(w({},e),{amount:t.amount/r})}))},E=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 w(w({},t),{answers:e})}));return w(w({},t),{questionsAndAnswers:i})},O=function(){return(O=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)},P=function(t,r){if(void 0===r&&(r={}),c(t))return O(O({},t),r);if(f(t))return T(t,r);var e=_(t);return T(e,r)},T=function(t,r){void 0===r&&(r={});var e=t,n=e.questionsAndAnswers,o=e.priceCategory,i=e.amount;return O(O(O({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:u.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},_=function(t,r){return void 0===r&&(r={}),O(O(O({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},S=function(t,r){if(void 0===r&&(r={}),l(t))return O(O({},t),r);if(f(t))return R(t,r);var e=_(t);return R(e,r)},I=function(t,r){void 0===r&&(r={});var e=A(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,l={rootId:o,min:f,max:c,type:h(a),modifiersCount:t.answers.length,amount:i,path:[]};return O(O({},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}(l),a=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(l),f=function(t){var r=t.groupType,e=t.min,n=t.max;return"RADIO"===r||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:l.type}),c=o.questions.length,h=O(O({},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 O(O({},h),{questions:c?I(h).questions:[]})}))})}));return O(O(O({},e),{questions:u}),r)},R=function(t,r){void 0===r&&(r={});var e=T(t);return I(e,r)},B=function(t,r){return void 0===r&&(r={}),I(t,r)},x=function(t){var r=t.questions;return O(O({},t),{questions:r.map((function(t){var r=t.answers;return O(O({},t),{answers:r.map((function(t){var r=t.questions;return O(O({},t),{questions:null!=r?r:[]})}))})}))})},U=e(0),j={CLIENT_NAME:"Trade S.A.",DEFAULT_REQUEST_TIMEOUT:1e4,EXCLUDED_LOGGER_STATUS_CODES:[422],INCLUDED_LOGGER_ENVS:["staging","production"],INCLUDED_INTL_LOG_ENVS:[""],COUNTRY:{NAME:"Ecuador",CODE:"593",LANGUAGE:"es"},DEFAULT_API_TIMEOUT:3e5,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"]},C=j.DEFAULT_API_TIMEOUT,D={artisanApp:void 0,timeout:C,apiCache:{},expiresAt:(new Date).getTime()+C,forms:{}},M=function(){console.log("Not supported yet")},Y=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(U.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(U.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(U.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(U.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)},L=function(){return(L=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)},N=j.PAGINATION,k=j.ADDITIONAL_FILTERS,F=j.ORDER_FIELDS,q=j.FILTERS,z=j.GROUPS,H=j.ORDER_METHODS,G=j.ORDER_TYPES,W=function(t){var r=V(t),e=X(r),n=K(e),o=J(n);return Q(o)},V=function(t){var r=Object(U.getState)(),e=r.vendorId,n=r.storeId,o=Object(U.getState)(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=L(L({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),f=Z(s,q,"filter"),c=tt(f);return L(L({},t),{filterBy:c})},X=function(t){var r=$(t,z,"groupBy");return L({},r)},K=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=Z(e,F,"orderBy"),o=L({},n),i=e.method,u=e.type;return u&&!G.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),G.includes(u)||(delete o.type,o.type="predefined"),i&&!H.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),H.includes(i)||(delete o.method,o.method="asc"),L(L({},t),{orderBy:o})},J=function(t){var r=t.pagination,e=Z(void 0===r?{}:r,N,"pagination"),n=L({product:{size:20},category:{size:20}},e);return"category"!==t.groupBy&&delete n.category,L(L({},t),{pagination:n})},Q=function(t){var r=t.additionalFilters,e=Z(void 0===r?{}:r,k,"additionalFilters");return L(L({},t),{additionalFilters:e})},Z=function(t,r,e){var n=L({},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},$=function(t,r,e){var n=L({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},tt=function(t){var r=L({},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)&&rt(n[0])||rt(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},rt=function(t){var r=typeof t;return"number"===r||"string"===r},et=(e(4),function(){return(et=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)}),nt=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}))),et(et({},t),"catalogueId"===o?((e={})[o]=u,e.channelId=u,e):((n={})[o]=u,n))}),{})},ot=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}},it=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?et(et({},t),((e={})[n]=o,e)):t}),{})},ut=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?et(et({},t),{page:i}):"product"===e?et(et({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===e?et(et({},t),{size:i.size}):t}),{})},at=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},st=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())}))},ft=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])}}},ct=function(t,r,e){return r=W(r),Y(r,e),function(t,r,e){var n=r.filterBy,o=r.groupBy,i=r.additionalFilters,u=r.orderBy,a=r.pagination,s=nt(n),f=ot(u),c=it(i),l=ut(a),h=et(et(et(et(et({},s),{groupBy:o}),f),c),l);o||delete h.groupBy;var p=at(t,e.params),d=Object(U.getState)().artisanApp,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 et(et({},e),{url:g,query:h})}(t,r,e)},lt=function(t){return st(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return ft(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]}}))}))},ht=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())}))},pt=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])}}},dt=function(t){return ht(void 0,void 0,void 0,(function(){return pt(this,(function(r){switch(r.label){case 0:return[4,lt(t)];case 1:return[2,r.sent()]}}))}))},yt=e(5),gt=function(){return(gt=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)},vt=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())}))},bt=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])}}},wt={"Content-Type":"application/json"},mt=function(t,r){return void 0===t&&(t=!0),void 0===r&&(r={}),vt(void 0,void 0,void 0,(function(){var e,n,o,i,u,a,s,f,c,l,h,p,d,y,g,v;return bt(this,(function(b){switch(b.label){case 0:return e=Object(U.getState)().artisanApp,n=e.settings,o=n.platform,i=n.accountId,u=null!==(p=null!==(h=null===(l=r.account)||void 0===l?void 0:l.toString())&&void 0!==h?h:null==i?void 0:i.toString())&&void 0!==p?p:"",a=null!==(y=null!==(d=r.Platform)&&void 0!==d?d:o)&&void 0!==y?y:"",s=a,null===(g=r.Authorization)||void 0===g?[3,1]:(c=g,[3,3]);case 1:return[4,At(t)];case 2:c=b.sent(),b.label=3;case 3:return f=null!==(v=c)&&void 0!==v?v:"",[2,new Headers(gt(gt(gt({},wt),r),{Authorization:f,Platform:s,account:u}))]}}))}))},At=function(t,r){return void 0===t&&(t=!0),vt(void 0,void 0,void 0,(function(){var e,n,o;return bt(this,(function(i){switch(i.label){case 0:return e=Object(U.getState)().artisanApp,[4,null===(o=function(){return Object(yt.initAuth)(e)}().currentUser)||void 0===o?void 0:o.getIdToken(r)];case 1:return(n=i.sent())||t?!n&&t?(a("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},Et=e(1),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){var e=W(r).pagination,n=t.pagination;return Ot(Ot({},t),{pagination:Tt(e,n)})},Tt=function(t,r){return Ot(Ot({},t),{page:null==r?void 0:r.page,hasMorePages:null==r?void 0:r.hasMorePages})},_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)},St=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())}))},It=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,r){return St(void 0,void 0,void 0,(function(){var e,n,o;return It(this,(function(i){switch(i.label){case 0:return[4,mt(!1)];case 1:return e=i.sent(),n=ct("v1/products/:productId",r,{headers:e,params:{productId:t},query:{},body:{}}),[4,Object(Et.handleHttpCache)(n,(function(t){return St(void 0,void 0,void 0,(function(){var r,e;return It(this,(function(n){switch(n.label){case 0:return[4,dt(t)];case 1:return r=n.sent(),e=x(r.data),[2,_t(_t({},r),{data:e})]}}))}))}))];case 2:return o=i.sent(),[2,Pt(o,r)]}}))}))},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])}}},Ut=function(t){return Bt(void 0,void 0,void 0,(function(){return xt(this,(function(r){switch(r.label){case 0:return[4,lt(t)];case 1:return[2,r.sent()]}}))}))},jt=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])}}},Dt=function(t){return jt(void 0,void 0,void 0,(function(){var r,e,n;return Ct(this,(function(o){switch(o.label){case 0:return[4,mt(!1)];case 1:return r=o.sent(),e=ct("api/v3/productsBy",t,{headers:r,params:{},query:{},body:{}}),[4,Object(Et.handleHttpCache)(e,(function(t){return jt(void 0,void 0,void 0,(function(){return Ct(this,(function(r){switch(r.label){case 0:return[4,Ut(t)];case 1:return[2,r.sent()]}}))}))}))];case 2:return n=o.sent(),[2,Pt(n,t)]}}))}))},Mt=function(){console.log("Not implemented yet")},Yt=function(){console.log("not implemented yet")},Lt=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())}))},Nt=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])}}},kt=function(t){return Lt(void 0,void 0,void 0,(function(){return Nt(this,(function(r){switch(r.label){case 0:return[4,lt(t)];case 1:return[2,r.sent()]}}))}))},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())}))},qt=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])}}},zt=function(t){return Ft(void 0,void 0,void 0,(function(){var r,e,n;return qt(this,(function(o){switch(o.label){case 0:return[4,mt(!1)];case 1:return r=o.sent(),e=ct("v1/stores/details",t,{headers:r,params:{},query:{},body:{}}),[4,Object(Et.handleHttpCache)(e,(function(t){return Ft(void 0,void 0,void 0,(function(){return qt(this,(function(r){switch(r.label){case 0:return[4,kt(t)];case 1:return[2,r.sent()]}}))}))}))];case 2:return n=o.sent(),[2,Pt(n,t)]}}))}))},Ht=function(){return(Ht=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)},Gt=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Wt=function(t,r){for(var e=Gt(r),n=t,o=t[0];e.length;){o=Xt(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},Vt=function(t,r,e){for(var n=Gt(r),o=t,i=Xt(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Xt(o,n[0]),n=n.slice(1),u=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=Gt(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?Ht({},e):Ht({},t)}));i.modifiers=s}else{var f=i.groups.map((function(t){return t.id===a?Ht({},e):Ht({},t)}));i.groups=f}return 1===r.length?Gt(i.groups):Gt(t)},Xt=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)},Jt=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Qt=function(t,r,e,n,o){var i=Kt(Kt({},e),{amount:n,touched:!0,errors:p(e,n,o),totals:Ar(Kt(Kt({},e.data),{amount:n})),data:Kt(Kt({},e.data),{amount:n})});return i.status=g(i),Vt(t,r,i)},Zt=function(t,r,e,n){var o=e.slice(0,-1),i=Wt(r,o),u=Jt(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:Ar(Kt(Kt({},t.data),{amount:0})),data:Kt(Kt({},t.data),{amount:0})})})));var a=(u=u.map((function(r){var o=B(r.data),i=Jt(e.slice(0,-1),[r.id]),u=Kt(Kt({},r),{groups:nr(o,{rootId:t,path:i},r.groups)});return u.errors=p(u,u.amount,n),u.status=g(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=d(f,n),f.status=y(f);var c=Vt(r,o,f);return o.length>1&&(c=$t(t,c,o,n)),c},$t=function(t,r,e,n){var o=e.slice(0,-1),i=Wt(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=d(r,n),r.status=y(r),r})),f=Kt(Kt({},i),{touched:!0,groups:s,data:a});f.errors=p(f,f.amount,n),f.status=g(f);var c=Vt(r,o,f);return o.length>1&&(c=Zt(t,c,o,n)),c},tr=function(){return(tr=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)},rr=function(){return(rr=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)},er=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},nr=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 or(r,{amount:t.amount,rootId:n,path:er(o)},i)}))},or=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,l=r.path,p=null!=e?e:{},d=p.errors,g=p.touched,v={id:n,name:o,description:null!=i?i:"",images:er(null!=s?s:[]),data:rr({},t),errors:null!=d?d:[],touched:null!=g&&g,status:"IDLE",hidden:f<1,required:a>0,type:h(t)},b={rootId:c,max:u,min:a,type:v.type,modifiersCount:t.answers.length,amount:f,path:er(l,[n])},w=t.answers.map((function(t){var r=null==e?void 0:e.modifiers.find((function(r){return r.id===t.productId}));return ir(t,b,r)})),m=rr(rr({},v),{modifiers:w});return rr(rr({},m),{status:y(m)})},ir=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=B(t),d=r.rootId,y=r.path,v=er(y,[i]),w=nr(p,{rootId:d,path:v},null==e?void 0:e.groups),m={id:i,groupId:u,name:a,images:er(s),amount:f,data:rr({},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:Ar(rr(rr({},t),{amount:f})),type:c,handleChange:function(t){!function(t,r,e){var n,o=tr({},Object(U.getState)().forms),i=o[t],u=Wt(i.renderer,r),a=Qt(i.renderer,r,u,e,!1);a=Zt(t,a,r,!1);var s=ar(a,i.product),f=tr(tr({},i),{renderer:a,product:s,status:b(a)}),c=tr(tr({},o),((n={})[t]=f,n));Object(U.setState)({forms:c});var l=tr({},f);delete l.callback,i.callback(l)}(r.rootId,v,t)}};return rr(rr({},m),{status:g(m)})},ur=function(){return(ur=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)},ar=function(t,r){var e=P(r);return ur(ur({},e),{questionsAndAnswers:sr(t),updatedAt:""})},sr=function(t){return t.map((function(t){return ur(ur({},t.data),{answers:fr(t.modifiers)})}))},fr=function(t){return t.map((function(t){return t.amount?ur(ur({},t.data),{questionsAndAnswers:sr(t.groups)}):ur(ur({},t.data),{questionsAndAnswers:[]})}))},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){var e,n=t.productId,o=Object(U.getState)().forms;if(!!o[n])return a("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=nr(e,{rootId:e.productId,path:[]});return{product:ar(n,t),renderer:n,validate:function(){return yr(t.productId)},status:b(n)}}(t),u=cr(cr({},o),((e={})[n]=cr(cr({},i),{callback:r}),e));return Object(U.setState)({forms:u}),r(cr({},i)),function(){return hr(n)}},hr=function(t){var r=Object(U.getState)().forms,e=cr({},r);delete e[t],Object(U.setState)({forms:e})},pr=function(){return(pr=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)},dr=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},yr=function(t){var r,e=pr({},Object(U.getState)().forms),n=e[t],o=n.renderer,i=n.callback,u=n.product,a=dr(o);o.forEach((function(r){var e=[r.id];a=gr(r,a,t,e)}));var s=ar(a,u),f=pr(pr({},n),{renderer:a,product:s,status:b(a)}),c=pr(pr({},e),((r={})[t]=f,r));Object(U.setState)({forms:c});var l=pr({},f);return delete l.callback,i(l),f.status},gr=function(t,r,e,n){var o=t.modifiers,i=t.id,u=!o.length,a=dr(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=dr(n,[t.id]);a=vr(t,a,e,r)})),a)},vr=function(t,r,e,n){var o=t.groups,i=t.amount,u=t.status,a=t.required,s=!o.length||0===i,f=dr(r);if(s){var c="IDLE"===u&&a||"FAIL"===u||"INCOMPLETE"===u?"FAIL":u,l=pr(pr({},t),{status:c}),h=dr(n);f=Qt(f,h,l,l.amount,!0),f=Zt(e,f,h,!0)}else o.forEach((function(t){var r=dr(n,[t.id]);f=gr(t,f,e,r)}));return f},br=function(){return(br=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)},wr=!1,mr=function(t,r){if(void 0===r&&(r={}),wr)console.warn("artisan-commerce/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");else{if(Object(U.setState)(br({artisanApp:t},r)),void 0!==r.timeout){var e=(new Date).getTime()+r.timeout;Object(U.setState)({expiresAt:e})}"undefined"==typeof window||(wr=!0)}},Ar=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?A(e):t;return{unitGrossPrice:Pr(n,1),unitTotalDiscounts:Tr(n,1),unitTotalTaxes:Er(n,1),unitNetPrice:_r(n,1),amount:r,grossPrice:Pr(n,r),totalDiscounts:Tr(n,r),totalTaxes:Er(n,r),netPrice:_r(n,r)}},Er=function(t,r){var e=P(t,{amount:r}),n=e.prices,o=e.amount,i=n[e.priceCategory],u=i.taxes,a=i.grossPrice,s=Rr(u,a);return Or(e,r)+s*o},Or=function(t,r){return t.questionsAndAnswers.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*(Rr(u,a)+Or(e,r))}),0)*r}),0)},Pr=function(t,r){return Sr(t,"grossPrice",r)},Tr=function(t,r){return 0},_r=function(t,r){return Sr(t,"netPrice",r)},Sr=function(t,r,e){var n=P(t,{amount:e}),o=n.prices,i=n.amount,u=o[n.priceCategory][r];return(Ir(n,r)+u)*i},Ir=function(t,r){return t.questionsAndAnswers.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)},Rr=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)};Object(U.initState)(D)}])}));
package/build/report.json CHANGED
@@ -1 +1 @@
1
- [{"label":"main.bundle.js","isAsset":true,"statSize":171351,"parsedSize":69925,"gzipSize":17457,"groups":[{"label":"types/build","path":"./types/build","statSize":5432,"groups":[{"id":0,"label":"index.js","path":"./types/build/index.js","statSize":1405,"parsedSize":533,"gzipSize":291},{"label":"types","path":"./types/build/types","statSize":4027,"groups":[{"id":4,"label":"app.types.js","path":"./types/build/types/app.types.js","statSize":114,"parsedSize":78,"gzipSize":97},{"id":5,"label":"account.types.js","path":"./types/build/types/account.types.js","statSize":150,"parsedSize":78,"gzipSize":97},{"id":6,"label":"artisanDB.types.js","path":"./types/build/types/artisanDB.types.js","statSize":120,"parsedSize":78,"gzipSize":97},{"id":7,"label":"category.types.js","path":"./types/build/types/category.types.js","statSize":119,"parsedSize":78,"gzipSize":97},{"id":8,"label":"channel.types.js","path":"./types/build/types/channel.types.js","statSize":150,"parsedSize":78,"gzipSize":97},{"id":9,"label":"common.types.js","path":"./types/build/types/common.types.js","statSize":162,"parsedSize":78,"gzipSize":97},{"id":10,"label":"coupons.types.js","path":"./types/build/types/coupons.types.js","statSize":118,"parsedSize":78,"gzipSize":97},{"id":11,"label":"image.types.js","path":"./types/build/types/image.types.js","statSize":146,"parsedSize":78,"gzipSize":97},{"id":12,"label":"product.types.js","path":"./types/build/types/product.types.js","statSize":1492,"parsedSize":723,"gzipSize":357},{"id":13,"label":"shippingCost.types.js","path":"./types/build/types/shippingCost.types.js","statSize":160,"parsedSize":78,"gzipSize":97},{"id":14,"label":"shoppingCart.types.js","path":"./types/build/types/shoppingCart.types.js","statSize":123,"parsedSize":78,"gzipSize":97},{"id":15,"label":"store.types.js","path":"./types/build/types/store.types.js","statSize":913,"parsedSize":485,"gzipSize":270},{"id":16,"label":"vendor.types.js","path":"./types/build/types/vendor.types.js","statSize":117,"parsedSize":78,"gzipSize":97},{"id":17,"label":"http.types.js","path":"./types/build/types/http.types.js","statSize":143,"parsedSize":78,"gzipSize":97}],"parsedSize":2144,"gzipSize":460}],"parsedSize":2677,"gzipSize":659},{"label":"node_modules","path":"./node_modules","statSize":60672,"groups":[{"label":"charenc","path":"./node_modules/charenc","statSize":850,"groups":[{"id":1,"label":"charenc.js","path":"./node_modules/charenc/charenc.js","statSize":850,"parsedSize":426,"gzipSize":231}],"parsedSize":426,"gzipSize":231},{"label":"sha1","path":"./node_modules/sha1","statSize":2124,"groups":[{"id":2,"label":"sha1.js","path":"./node_modules/sha1/sha1.js","statSize":2124,"parsedSize":947,"gzipSize":626}],"parsedSize":947,"gzipSize":626},{"label":"buffer","path":"./node_modules/buffer","statSize":48590,"groups":[{"id":18,"label":"index.js","path":"./node_modules/buffer/index.js","statSize":48590,"parsedSize":19827,"gzipSize":5835}],"parsedSize":19827,"gzipSize":5835},{"label":"base64-js","path":"./node_modules/base64-js","statSize":3944,"groups":[{"id":20,"label":"index.js","path":"./node_modules/base64-js/index.js","statSize":3944,"parsedSize":1406,"gzipSize":743}],"parsedSize":1406,"gzipSize":743},{"label":"ieee754","path":"./node_modules/ieee754","statSize":2064,"groups":[{"id":21,"label":"index.js","path":"./node_modules/ieee754/index.js","statSize":2064,"parsedSize":881,"gzipSize":496}],"parsedSize":881,"gzipSize":496},{"label":"isarray","path":"./node_modules/isarray","statSize":132,"groups":[{"id":22,"label":"index.js","path":"./node_modules/isarray/index.js","statSize":132,"parsedSize":104,"gzipSize":109}],"parsedSize":104,"gzipSize":109},{"label":"crypt","path":"./node_modules/crypt","statSize":2968,"groups":[{"id":23,"label":"crypt.js","path":"./node_modules/crypt/crypt.js","statSize":2968,"parsedSize":1273,"gzipSize":646}],"parsedSize":1273,"gzipSize":646}],"parsedSize":24864,"gzipSize":7856},{"label":"auth/build","path":"./auth/build","statSize":1417,"groups":[{"id":3,"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":19,"label":"global.js","path":"./buildin/global.js","statSize":472,"parsedSize":144,"gzipSize":129}],"parsedSize":144,"gzipSize":129},{"label":"src","path":"./src","statSize":103358,"groups":[{"id":25,"label":"index.ts + 32 modules (concatenated)","path":"./src/index.ts + 32 modules (concatenated)","statSize":103358,"parsedSize":39838,"gzipSize":8852,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 32 modules (concatenated)/src","statSize":103343,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 32 modules (concatenated)/src/index.ts","statSize":1047,"parsedSize":403,"gzipSize":89,"inaccurateSizes":true},{"label":"utils","path":"./src/index.ts + 32 modules (concatenated)/src/utils","statSize":67382,"groups":[{"label":"assertions","path":"./src/index.ts + 32 modules (concatenated)/src/utils/assertions","statSize":2984,"groups":[{"id":null,"label":"assertions.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/assertions/assertions.utils.ts","statSize":2984,"parsedSize":1150,"gzipSize":255,"inaccurateSizes":true}],"parsedSize":1150,"gzipSize":255,"inaccurateSizes":true},{"label":"questionsAndAnswers","path":"./src/index.ts + 32 modules (concatenated)/src/utils/questionsAndAnswers","statSize":1793,"groups":[{"id":null,"label":"questionsAndAnswers.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/questionsAndAnswers/questionsAndAnswers.utils.ts","statSize":1793,"parsedSize":691,"gzipSize":153,"inaccurateSizes":true}],"parsedSize":691,"gzipSize":153,"inaccurateSizes":true},{"label":"transformers","path":"./src/index.ts + 32 modules (concatenated)/src/utils/transformers","statSize":8225,"groups":[{"id":null,"label":"transformers.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/transformers/transformers.utils.ts","statSize":6562,"parsedSize":2529,"gzipSize":561,"inaccurateSizes":true},{"id":null,"label":"api.transformer.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/transformers/api.transformer.ts","statSize":1663,"parsedSize":640,"gzipSize":142,"inaccurateSizes":true}],"parsedSize":3170,"gzipSize":704,"inaccurateSizes":true},{"label":"caculations","path":"./src/index.ts + 32 modules (concatenated)/src/utils/caculations","statSize":4320,"groups":[{"id":null,"label":"calculations.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/caculations/calculations.utils.ts","statSize":4320,"parsedSize":1665,"gzipSize":369,"inaccurateSizes":true}],"parsedSize":1665,"gzipSize":369,"inaccurateSizes":true},{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/common.utils.ts","statSize":383,"parsedSize":147,"gzipSize":32,"inaccurateSizes":true},{"label":"modifiers","path":"./src/index.ts + 32 modules (concatenated)/src/utils/modifiers","statSize":25602,"groups":[{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/modifiers/common.utils.ts","statSize":7399,"parsedSize":2851,"gzipSize":633,"inaccurateSizes":true},{"id":null,"label":"updateRenderer.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/modifiers/updateRenderer.utils.ts","statSize":5588,"parsedSize":2153,"gzipSize":478,"inaccurateSizes":true},{"id":null,"label":"form.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/modifiers/form.utils.ts","statSize":2441,"parsedSize":940,"gzipSize":209,"inaccurateSizes":true},{"id":null,"label":"rendererTraversal.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/modifiers/rendererTraversal.utils.ts","statSize":3092,"parsedSize":1191,"gzipSize":264,"inaccurateSizes":true},{"id":null,"label":"renderer.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/modifiers/renderer.utils.ts","statSize":5227,"parsedSize":2014,"gzipSize":447,"inaccurateSizes":true},{"id":null,"label":"handleChange.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/modifiers/handleChange.utils.ts","statSize":1855,"parsedSize":714,"gzipSize":158,"inaccurateSizes":true}],"parsedSize":9867,"gzipSize":2192,"inaccurateSizes":true},{"label":"http","path":"./src/index.ts + 32 modules (concatenated)/src/utils/http","statSize":18079,"groups":[{"id":null,"label":"http.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/http/http.utils.ts","statSize":6200,"parsedSize":2389,"gzipSize":530,"inaccurateSizes":true},{"id":null,"label":"cache.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/http/cache.utils.ts","statSize":1177,"parsedSize":453,"gzipSize":100,"inaccurateSizes":true},{"id":null,"label":"purge.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/http/purge.utils.ts","statSize":5959,"parsedSize":2296,"gzipSize":510,"inaccurateSizes":true},{"id":null,"label":"request.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/http/request.utils.ts","statSize":4743,"parsedSize":1828,"gzipSize":406,"inaccurateSizes":true}],"parsedSize":6968,"gzipSize":1548,"inaccurateSizes":true},{"id":null,"label":"services.utils.ts","path":"./src/index.ts + 32 modules (concatenated)/src/utils/services.utils.ts","statSize":5996,"parsedSize":2311,"gzipSize":513,"inaccurateSizes":true}],"parsedSize":25971,"gzipSize":5770,"inaccurateSizes":true},{"label":"lib","path":"./src/index.ts + 32 modules (concatenated)/src/lib","statSize":22378,"groups":[{"label":"getCategories","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getCategories","statSize":109,"groups":[{"id":null,"label":"getCategories.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getCategories/getCategories.ts","statSize":109,"parsedSize":42,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":42,"gzipSize":9,"inaccurateSizes":true},{"label":"getProductDetails","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getProductDetails","statSize":4705,"groups":[{"id":null,"label":"getProductDetails.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getProductDetails/getProductDetails.ts","statSize":4705,"parsedSize":1813,"gzipSize":402,"inaccurateSizes":true}],"parsedSize":1813,"gzipSize":402,"inaccurateSizes":true},{"label":"getProducts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getProducts","statSize":3800,"groups":[{"id":null,"label":"getProducts.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getProducts/getProducts.ts","statSize":3800,"parsedSize":1464,"gzipSize":325,"inaccurateSizes":true}],"parsedSize":1464,"gzipSize":325,"inaccurateSizes":true},{"label":"getRecommendedProducts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getRecommendedProducts","statSize":129,"groups":[{"id":null,"label":"getRecommendedProducts.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getRecommendedProducts/getRecommendedProducts.ts","statSize":129,"parsedSize":49,"gzipSize":11,"inaccurateSizes":true}],"parsedSize":49,"gzipSize":11,"inaccurateSizes":true},{"label":"getRelatedProducts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getRelatedProducts","statSize":121,"groups":[{"id":null,"label":"getRelatedProducts.ts","path":"./src/index.ts + 32 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 + 32 modules (concatenated)/src/lib/getStoreDetails","statSize":3961,"groups":[{"id":null,"label":"getStoreDetails.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/getStoreDetails/getStoreDetails.ts","statSize":3961,"parsedSize":1526,"gzipSize":339,"inaccurateSizes":true}],"parsedSize":1526,"gzipSize":339,"inaccurateSizes":true},{"label":"registerModifiersForm","path":"./src/index.ts + 32 modules (concatenated)/src/lib/registerModifiersForm","statSize":2978,"groups":[{"id":null,"label":"registerModifiersForm.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/registerModifiersForm/registerModifiersForm.ts","statSize":2978,"parsedSize":1147,"gzipSize":255,"inaccurateSizes":true}],"parsedSize":1147,"gzipSize":255,"inaccurateSizes":true},{"label":"validateProduct","path":"./src/index.ts + 32 modules (concatenated)/src/lib/validateProduct","statSize":4162,"groups":[{"id":null,"label":"validateProduct.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/validateProduct/validateProduct.ts","statSize":4162,"parsedSize":1604,"gzipSize":356,"inaccurateSizes":true}],"parsedSize":1604,"gzipSize":356,"inaccurateSizes":true},{"label":"initProducts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/initProducts","statSize":1483,"groups":[{"id":null,"label":"initProducts.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/initProducts/initProducts.ts","statSize":1483,"parsedSize":571,"gzipSize":127,"inaccurateSizes":true}],"parsedSize":571,"gzipSize":127,"inaccurateSizes":true},{"id":null,"label":"state.ts","path":"./src/index.ts + 32 modules (concatenated)/src/lib/state.ts","statSize":930,"parsedSize":358,"gzipSize":79,"inaccurateSizes":true}],"parsedSize":8625,"gzipSize":1916,"inaccurateSizes":true},{"label":"services","path":"./src/index.ts + 32 modules (concatenated)/src/services","statSize":8566,"groups":[{"label":"fetchProductDetails","path":"./src/index.ts + 32 modules (concatenated)/src/services/fetchProductDetails","statSize":2858,"groups":[{"id":null,"label":"fetchProductDetails.service.tsx","path":"./src/index.ts + 32 modules (concatenated)/src/services/fetchProductDetails/fetchProductDetails.service.tsx","statSize":2858,"parsedSize":1101,"gzipSize":244,"inaccurateSizes":true}],"parsedSize":1101,"gzipSize":244,"inaccurateSizes":true},{"label":"fetchProducts","path":"./src/index.ts + 32 modules (concatenated)/src/services/fetchProducts","statSize":2852,"groups":[{"id":null,"label":"fetchProducts.service.tsx","path":"./src/index.ts + 32 modules (concatenated)/src/services/fetchProducts/fetchProducts.service.tsx","statSize":2852,"parsedSize":1099,"gzipSize":244,"inaccurateSizes":true}],"parsedSize":1099,"gzipSize":244,"inaccurateSizes":true},{"label":"fetchStoreDetails","path":"./src/index.ts + 32 modules (concatenated)/src/services/fetchStoreDetails","statSize":2856,"groups":[{"id":null,"label":"fetchStoreDetails.service.tsx","path":"./src/index.ts + 32 modules (concatenated)/src/services/fetchStoreDetails/fetchStoreDetails.service.tsx","statSize":2856,"parsedSize":1100,"gzipSize":244,"inaccurateSizes":true}],"parsedSize":1100,"gzipSize":244,"inaccurateSizes":true}],"parsedSize":3301,"gzipSize":733,"inaccurateSizes":true},{"label":"config","path":"./src/index.ts + 32 modules (concatenated)/src/config","statSize":1526,"groups":[{"id":null,"label":"constants.ts","path":"./src/index.ts + 32 modules (concatenated)/src/config/constants.ts","statSize":1526,"parsedSize":588,"gzipSize":130,"inaccurateSizes":true}],"parsedSize":588,"gzipSize":130,"inaccurateSizes":true},{"label":"errors","path":"./src/index.ts + 32 modules (concatenated)/src/errors","statSize":2444,"groups":[{"id":null,"label":"api.errors.ts","path":"./src/index.ts + 32 modules (concatenated)/src/errors/api.errors.ts","statSize":2444,"parsedSize":942,"gzipSize":209,"inaccurateSizes":true}],"parsedSize":942,"gzipSize":209,"inaccurateSizes":true}],"parsedSize":39832,"gzipSize":8850,"inaccurateSizes":true}]}],"parsedSize":39838,"gzipSize":8852}]},{"label":"vendors.bundle.js","isAsset":true,"statSize":19,"parsedSize":1175,"gzipSize":528,"groups":[{"label":"src","path":"./src","statSize":19,"groups":[{"id":24,"label":"vendors.ts","path":"./src/vendors.ts","statSize":19,"parsedSize":15,"gzipSize":35}],"parsedSize":15,"gzipSize":35}]}]
1
+ [{"label":"main.bundle.js","isAsset":true,"statSize":201614,"parsedSize":101079,"gzipSize":19178,"groups":[{"label":"state/build","path":"./state/build","statSize":1640,"groups":[{"id":0,"label":"main.bundle.js","path":"./state/build/main.bundle.js","statSize":1640,"parsedSize":1440,"gzipSize":624}],"parsedSize":1440,"gzipSize":624},{"label":"cache/build","path":"./cache/build","statSize":31023,"groups":[{"id":1,"label":"main.bundle.js","path":"./cache/build/main.bundle.js","statSize":31023,"parsedSize":30527,"gzipSize":9531}],"parsedSize":30527,"gzipSize":9531},{"label":"types/build","path":"./types/build","statSize":5432,"groups":[{"id":2,"label":"index.js","path":"./types/build/index.js","statSize":1405,"parsedSize":535,"gzipSize":290},{"label":"types","path":"./types/build/types","statSize":4027,"groups":[{"id":6,"label":"app.types.js","path":"./types/build/types/app.types.js","statSize":114,"parsedSize":78,"gzipSize":97},{"id":7,"label":"account.types.js","path":"./types/build/types/account.types.js","statSize":150,"parsedSize":78,"gzipSize":97},{"id":8,"label":"artisanDB.types.js","path":"./types/build/types/artisanDB.types.js","statSize":120,"parsedSize":78,"gzipSize":97},{"id":9,"label":"category.types.js","path":"./types/build/types/category.types.js","statSize":119,"parsedSize":78,"gzipSize":97},{"id":10,"label":"channel.types.js","path":"./types/build/types/channel.types.js","statSize":150,"parsedSize":78,"gzipSize":97},{"id":11,"label":"common.types.js","path":"./types/build/types/common.types.js","statSize":162,"parsedSize":78,"gzipSize":97},{"id":12,"label":"coupons.types.js","path":"./types/build/types/coupons.types.js","statSize":118,"parsedSize":78,"gzipSize":97},{"id":13,"label":"image.types.js","path":"./types/build/types/image.types.js","statSize":146,"parsedSize":78,"gzipSize":97},{"id":14,"label":"product.types.js","path":"./types/build/types/product.types.js","statSize":1492,"parsedSize":723,"gzipSize":357},{"id":15,"label":"shippingCost.types.js","path":"./types/build/types/shippingCost.types.js","statSize":160,"parsedSize":78,"gzipSize":97},{"id":16,"label":"shoppingCart.types.js","path":"./types/build/types/shoppingCart.types.js","statSize":123,"parsedSize":78,"gzipSize":97},{"id":17,"label":"store.types.js","path":"./types/build/types/store.types.js","statSize":913,"parsedSize":485,"gzipSize":270},{"id":18,"label":"vendor.types.js","path":"./types/build/types/vendor.types.js","statSize":117,"parsedSize":78,"gzipSize":97},{"id":19,"label":"http.types.js","path":"./types/build/types/http.types.js","statSize":143,"parsedSize":78,"gzipSize":97}],"parsedSize":2144,"gzipSize":460}],"parsedSize":2679,"gzipSize":659},{"label":"Users/luiseduardo/trade/projects/artisan_monorepo/node_modules","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules","statSize":60750,"groups":[{"label":"charenc","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/charenc","statSize":850,"groups":[{"id":3,"label":"charenc.js","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/charenc/charenc.js","statSize":850,"parsedSize":426,"gzipSize":231}],"parsedSize":426,"gzipSize":231},{"label":"sha1","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/sha1","statSize":2124,"groups":[{"id":4,"label":"sha1.js","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/sha1/sha1.js","statSize":2124,"parsedSize":947,"gzipSize":625}],"parsedSize":947,"gzipSize":625},{"label":"node-libs-browser/node_modules/buffer","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/node-libs-browser/node_modules/buffer","statSize":48590,"groups":[{"id":20,"label":"index.js","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/node-libs-browser/node_modules/buffer/index.js","statSize":48590,"parsedSize":19827,"gzipSize":5836}],"parsedSize":19827,"gzipSize":5836},{"label":"base64-js","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/base64-js","statSize":3932,"groups":[{"id":22,"label":"index.js","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/base64-js/index.js","statSize":3932,"parsedSize":1406,"gzipSize":744}],"parsedSize":1406,"gzipSize":744},{"label":"ieee754","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/ieee754","statSize":2154,"groups":[{"id":23,"label":"index.js","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/ieee754/index.js","statSize":2154,"parsedSize":972,"gzipSize":573}],"parsedSize":972,"gzipSize":573},{"label":"isarray","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/isarray","statSize":132,"groups":[{"id":24,"label":"index.js","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/isarray/index.js","statSize":132,"parsedSize":104,"gzipSize":109}],"parsedSize":104,"gzipSize":109},{"label":"crypt","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/crypt","statSize":2968,"groups":[{"id":25,"label":"crypt.js","path":"./Users/luiseduardo/trade/projects/artisan_monorepo/node_modules/crypt/crypt.js","statSize":2968,"parsedSize":1273,"gzipSize":646}],"parsedSize":1273,"gzipSize":646}],"parsedSize":24955,"gzipSize":7901},{"label":"auth/build","path":"./auth/build","statSize":1417,"groups":[{"id":5,"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":21,"label":"global.js","path":"./buildin/global.js","statSize":472,"parsedSize":144,"gzipSize":129}],"parsedSize":144,"gzipSize":129},{"label":"src","path":"./src","statSize":100880,"groups":[{"id":27,"label":"index.ts + 31 modules (concatenated)","path":"./src/index.ts + 31 modules (concatenated)","statSize":100880,"parsedSize":38930,"gzipSize":8551,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 31 modules (concatenated)/src","statSize":100855,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 31 modules (concatenated)/src/index.ts","statSize":1141,"parsedSize":440,"gzipSize":96,"inaccurateSizes":true},{"label":"utils","path":"./src/index.ts + 31 modules (concatenated)/src/utils","statSize":64850,"groups":[{"label":"assertions","path":"./src/index.ts + 31 modules (concatenated)/src/utils/assertions","statSize":2984,"groups":[{"id":null,"label":"assertions.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/assertions/assertions.utils.ts","statSize":2984,"parsedSize":1151,"gzipSize":252,"inaccurateSizes":true}],"parsedSize":1151,"gzipSize":252,"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":703,"gzipSize":154,"inaccurateSizes":true}],"parsedSize":703,"gzipSize":154,"inaccurateSizes":true},{"label":"transformers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers","statSize":7513,"groups":[{"id":null,"label":"transformers.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers/transformers.utils.ts","statSize":6562,"parsedSize":2532,"gzipSize":556,"inaccurateSizes":true},{"id":null,"label":"api.transformer.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers/api.transformer.ts","statSize":951,"parsedSize":366,"gzipSize":80,"inaccurateSizes":true}],"parsedSize":2899,"gzipSize":636,"inaccurateSizes":true},{"label":"state","path":"./src/index.ts + 31 modules (concatenated)/src/utils/state","statSize":430,"groups":[{"id":null,"label":"state.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/state/state.utils.ts","statSize":430,"parsedSize":165,"gzipSize":36,"inaccurateSizes":true}],"parsedSize":165,"gzipSize":36,"inaccurateSizes":true},{"label":"caculations","path":"./src/index.ts + 31 modules (concatenated)/src/utils/caculations","statSize":4523,"groups":[{"id":null,"label":"calculations.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/caculations/calculations.utils.ts","statSize":4523,"parsedSize":1745,"gzipSize":383,"inaccurateSizes":true}],"parsedSize":1745,"gzipSize":383,"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":25746,"groups":[{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/common.utils.ts","statSize":7399,"parsedSize":2855,"gzipSize":627,"inaccurateSizes":true},{"id":null,"label":"updateRenderer.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/updateRenderer.utils.ts","statSize":5588,"parsedSize":2156,"gzipSize":473,"inaccurateSizes":true},{"id":null,"label":"form.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/form.utils.ts","statSize":2534,"parsedSize":977,"gzipSize":214,"inaccurateSizes":true},{"id":null,"label":"rendererTraversal.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/rendererTraversal.utils.ts","statSize":3092,"parsedSize":1193,"gzipSize":262,"inaccurateSizes":true},{"id":null,"label":"renderer.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/renderer.utils.ts","statSize":5227,"parsedSize":2017,"gzipSize":443,"inaccurateSizes":true},{"id":null,"label":"handleChange.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/handleChange.utils.ts","statSize":1906,"parsedSize":735,"gzipSize":161,"inaccurateSizes":true}],"parsedSize":9935,"gzipSize":2182,"inaccurateSizes":true},{"label":"http","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http","statSize":15385,"groups":[{"id":null,"label":"http.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/http.utils.ts","statSize":4637,"parsedSize":1789,"gzipSize":393,"inaccurateSizes":true},{"id":null,"label":"purge.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/purge.utils.ts","statSize":5967,"parsedSize":2302,"gzipSize":505,"inaccurateSizes":true},{"id":null,"label":"request.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/request.utils.ts","statSize":4781,"parsedSize":1845,"gzipSize":405,"inaccurateSizes":true}],"parsedSize":5937,"gzipSize":1304,"inaccurateSizes":true},{"id":null,"label":"services.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/services.utils.ts","statSize":6064,"parsedSize":2340,"gzipSize":514,"inaccurateSizes":true}],"parsedSize":25025,"gzipSize":5496,"inaccurateSizes":true},{"label":"lib","path":"./src/index.ts + 31 modules (concatenated)/src/lib","statSize":22345,"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":42,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":42,"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":1925,"gzipSize":422,"inaccurateSizes":true}],"parsedSize":1925,"gzipSize":422,"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":1576,"gzipSize":346,"inaccurateSizes":true}],"parsedSize":1576,"gzipSize":346,"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":1638,"gzipSize":359,"inaccurateSizes":true}],"parsedSize":1638,"gzipSize":359,"inaccurateSizes":true},{"label":"registerModifiersForm","path":"./src/index.ts + 31 modules (concatenated)/src/lib/registerModifiersForm","statSize":2993,"groups":[{"id":null,"label":"registerModifiersForm.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/registerModifiersForm/registerModifiersForm.ts","statSize":2993,"parsedSize":1155,"gzipSize":253,"inaccurateSizes":true}],"parsedSize":1155,"gzipSize":253,"inaccurateSizes":true},{"label":"validateProduct","path":"./src/index.ts + 31 modules (concatenated)/src/lib/validateProduct","statSize":4177,"groups":[{"id":null,"label":"validateProduct.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/validateProduct/validateProduct.ts","statSize":4177,"parsedSize":1611,"gzipSize":354,"inaccurateSizes":true}],"parsedSize":1611,"gzipSize":354,"inaccurateSizes":true},{"label":"initProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/initProducts","statSize":1498,"groups":[{"id":null,"label":"initProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/initProducts/initProducts.ts","statSize":1498,"parsedSize":578,"gzipSize":126,"inaccurateSizes":true}],"parsedSize":578,"gzipSize":126,"inaccurateSizes":true}],"parsedSize":8623,"gzipSize":1894,"inaccurateSizes":true},{"label":"config","path":"./src/index.ts + 31 modules (concatenated)/src/config","statSize":1526,"groups":[{"id":null,"label":"constants.ts","path":"./src/index.ts + 31 modules (concatenated)/src/config/constants.ts","statSize":1526,"parsedSize":588,"gzipSize":129,"inaccurateSizes":true}],"parsedSize":588,"gzipSize":129,"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":1102,"gzipSize":242,"inaccurateSizes":true}],"parsedSize":1102,"gzipSize":242,"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":1100,"gzipSize":241,"inaccurateSizes":true}],"parsedSize":1100,"gzipSize":241,"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":1102,"gzipSize":242,"inaccurateSizes":true}],"parsedSize":1102,"gzipSize":242,"inaccurateSizes":true}],"parsedSize":3305,"gzipSize":726,"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":936,"gzipSize":205,"inaccurateSizes":true}],"parsedSize":936,"gzipSize":205,"inaccurateSizes":true}],"parsedSize":38920,"gzipSize":8548,"inaccurateSizes":true}]}],"parsedSize":38930,"gzipSize":8551}]},{"label":"vendors.bundle.js","isAsset":true,"statSize":19,"parsedSize":1175,"gzipSize":528,"groups":[{"label":"src","path":"./src","statSize":19,"groups":[{"id":26,"label":"vendors.ts","path":"./src/vendors.ts","statSize":19,"parsedSize":15,"gzipSize":35}],"parsedSize":15,"gzipSize":35}]}]
@@ -1,3 +1,10 @@
1
1
  import { FetchProductDetailsConfig } from "./getProductDetails.types";
2
- import { ProductDetails } from "@artisan-commerce/types";
3
- export declare const getProductDetails: (productId: number | string, config: FetchProductDetailsConfig) => Promise<import("../../types/http.types").ResponseData<ProductDetails>>;
2
+ export declare const getProductDetails: (productId: number | string, config: FetchProductDetailsConfig) => Promise<{
3
+ pagination: import("../../types/http.types").PaginationResponse;
4
+ data: unknown;
5
+ error: string | import("../../../../cache/build/types/http.types").ResponseError | undefined;
6
+ hints: {
7
+ [key: string]: string | number | undefined;
8
+ };
9
+ config: import("../../../../types/build").ArtisanRequest;
10
+ }>;
@@ -1,3 +1,11 @@
1
1
  import { FetchProductsConfig } from "./getProducts.types";
2
2
  import { BaseProduct, ProductsByCategory } from "@artisan-commerce/types";
3
- export declare const getProducts: <R extends BaseProduct[] | ProductsByCategory[] = BaseProduct[]>(config: FetchProductsConfig) => Promise<import("../../types/http.types").ResponseData<R>>;
3
+ export declare const getProducts: <R extends BaseProduct[] | ProductsByCategory[] = BaseProduct[]>(config: FetchProductsConfig) => Promise<{
4
+ pagination: import("../../types/http.types").PaginationResponse;
5
+ data: unknown;
6
+ error: string | import("../../../../cache/build/types/http.types").ResponseError | undefined;
7
+ hints: {
8
+ [key: string]: string | number | undefined;
9
+ };
10
+ config: import("../../../../types/build").ArtisanRequest;
11
+ }>;
@@ -5,4 +5,12 @@ import { FetchStoreDetailsConfig } from "./getStoreDetails.types";
5
5
  * @param config config to fetch the store details
6
6
  * @deprecated
7
7
  */
8
- export declare const getStoreDetails: (config: FetchStoreDetailsConfig) => Promise<import("../../types/http.types").ResponseData<unknown>>;
8
+ export declare const getStoreDetails: (config: FetchStoreDetailsConfig) => Promise<{
9
+ pagination: import("../../types/http.types").PaginationResponse;
10
+ data: unknown;
11
+ error: string | import("../../../../cache/build/types/http.types").ResponseError | undefined;
12
+ hints: {
13
+ [key: string]: string | number | undefined;
14
+ };
15
+ config: import("../../../../types/build").ArtisanRequest;
16
+ }>;
@@ -17,5 +17,5 @@ export declare const getProductGrossPrice: (product: Product, setAmount: number)
17
17
  export declare const getProductTotalDiscounts: (product: Product, setAmount: number) => number;
18
18
  export declare const getProductNetPrice: (product: Product, setAmount: number) => number;
19
19
  export declare const getProductFieldPrice: (product: Product, field: "grossPrice" | "netPrice", setAmount: number) => number;
20
- export declare const getModifiersFieldTotal: (product: CartProduct | CartProductAnswer, field: "grossPrice" | "netPrice", setAmount: number) => number;
20
+ export declare const getModifiersFieldTotal: (product: CartProduct | CartProductAnswer, field: "grossPrice" | "netPrice") => number;
21
21
  export declare const getTaxTotal: (taxes: PriceCategoryTax[], grossPrice: number) => number;
@@ -1,5 +1,5 @@
1
1
  import { ArtisanRequest } from "@artisan-commerce/types";
2
- import { RequestData, ResponseData } from "../../types/http.types";
2
+ import { RequestData } from "../../types/http.types";
3
3
  import { ProductsHTTPConfig } from "../../types/http.types";
4
- export declare const handleHTTPCall: <R, T extends ProductsHTTPConfig>(path: string, config: T, data: RequestData, callback: (request: ArtisanRequest) => any) => Promise<ResponseData<R>>;
4
+ export declare const buildRequest: <R, T extends ProductsHTTPConfig>(path: string, config: T, data: RequestData) => ArtisanRequest;
5
5
  export declare const fetchHandler: <T>(request: ArtisanRequest) => Promise<T>;
@@ -0,0 +1 @@
1
+ export declare const setInitialState: () => void;
@@ -1,9 +1,12 @@
1
- import { ArtisanRequest, ArtisanHints } from "@artisan-commerce/types";
2
- import { Pagination, PaginationResponse } from "../../types/http.types";
3
- export declare const transformResponse: (data: any, error: Error | undefined, req: ArtisanRequest, pagination: Pagination | undefined) => {
4
- data: any;
5
- hints: Partial<ArtisanHints>;
6
- config: ArtisanRequest;
7
- error: string | undefined;
1
+ import { ResponseData } from "@artisan-commerce/cache";
2
+ import { PaginationResponse } from "../../types/http.types";
3
+ import { ProductsHTTPConfig } from "../../../build/src/types/http.types";
4
+ export declare const transformResponse: <R extends ProductsHTTPConfig>(responseData: ResponseData, config: R) => {
8
5
  pagination: PaginationResponse;
6
+ data: unknown;
7
+ error: string | import("../../../../cache/build/types/http.types").ResponseError | undefined;
8
+ hints: {
9
+ [key: string]: string | number | undefined;
10
+ };
11
+ config: import("../../../../types/build").ArtisanRequest;
9
12
  };
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("products",[],t):"object"==typeof exports?exports.products=t():e.products=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=24)}({24:function(e,t){}})}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("products",[],t):"object"==typeof exports?exports.products=t():e.products=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=26)}({26:function(e,t){}})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@artisan-commerce/products",
3
3
  "description": "Artisan's product management library",
4
- "version": "0.7.9",
4
+ "version": "0.7.11-canary.0",
5
5
  "main": "./build/main.bundle.js",
6
6
  "types": "./build/src/index.d.ts",
7
7
  "files": [
@@ -15,24 +15,26 @@
15
15
  "build": "webpack --config webpack.prod.js",
16
16
  "start:build": "nodemon ./build/main.bundle.js",
17
17
  "test": "jest --watchAll",
18
- "test:all": "npm run test -- --watchAll=false --coverage",
18
+ "test:all": "yarn test -- --watchAll=false --coverage",
19
19
  "test:ci": "cross-env CI=true jest --runInBand",
20
- "test:staged": "npm run test:ci --findRelatedTests",
20
+ "test:staged": "yarn test:ci --findRelatedTests ./src",
21
21
  "check-types": "tsc --noEmit",
22
22
  "lint": "eslint --ignore-path .gitignore --ignore-pattern !cypress/.eslintrc.js --ext .js,jsx,.ts,.tsx .",
23
- "lint:staged": "npm run lint --max-warnings=0",
23
+ "lint:staged": "yarn lint --max-warnings=0",
24
24
  "prettier": "prettier --ignore-path .gitignore \"**/*.+(js|jsx|ts|tsx|json|css|scss|html)\"",
25
- "format": "npm run prettier -- --write",
26
- "check-format": "npm run prettier -- --list-different",
25
+ "format": "yarn prettier -- --write",
26
+ "check-format": "yarn prettier -- --list-different",
27
27
  "validate": "cross-env CI=true npm-run-all --parallel test:ci check-types check-format lint build",
28
28
  "validate:ci": "npm-run-all --parallel check-types check-format lint",
29
- "prepare": "npm run build"
29
+ "prepare": "yarn build"
30
30
  },
31
31
  "author": "Luis Eduardo Andrade",
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "@artisan-commerce/auth": "^0.8.14",
35
- "@artisan-commerce/builders": "^0.4.11",
34
+ "@artisan-commerce/auth": "0.8.16-canary.0",
35
+ "@artisan-commerce/builders": "0.4.12-canary.0",
36
+ "@artisan-commerce/cache": "0.1.2-canary.0",
37
+ "@artisan-commerce/state": "0.1.1-canary.0",
36
38
  "@bugsnag/js": "^7.2.0",
37
39
  "i18next": "^19.6.2",
38
40
  "i18next-browser-languagedetector": "^5.0.0",
@@ -40,7 +42,7 @@
40
42
  "sha1": "^1.1.1"
41
43
  },
42
44
  "devDependencies": {
43
- "@artisan-commerce/types": "^0.10.5",
45
+ "@artisan-commerce/types": "0.10.6-canary.0",
44
46
  "@babel/core": "^7.10.5",
45
47
  "@babel/preset-env": "^7.10.4",
46
48
  "@babel/preset-react": "^7.10.4",
@@ -87,5 +89,5 @@
87
89
  "webpack-dev-server": "^3.11.0",
88
90
  "webpack-merge": "^5.0.9"
89
91
  },
90
- "gitHead": "818f3567d0b091f006721c51687f5abd7ea6fa51"
92
+ "gitHead": "af97d51b69e4804d02772cfcf181c48a8134d5aa"
91
93
  }
@@ -1 +0,0 @@
1
- export declare const sum: (a: number, b: number) => number;
@@ -1,16 +0,0 @@
1
- import { GlobalState } from "../types/common.types";
2
- export declare const initialState: GlobalState;
3
- export declare const setState: (overrides: Partial<GlobalState>) => void;
4
- export declare const getState: () => {
5
- artisanApp: import("../../../types/build").ArtisanApp | undefined;
6
- apiCache: import("../types/common.types").ApiCache;
7
- expiresAt: number;
8
- forms: import("../types/common.types").ModifiersForms;
9
- timeout?: number | undefined;
10
- accountId?: string | number | undefined;
11
- productId?: string | number | undefined;
12
- vendorId?: string | number | undefined;
13
- storeId?: number | undefined;
14
- catalogueId?: string | number | undefined;
15
- categoryId?: string | number | undefined;
16
- };
@@ -1,5 +0,0 @@
1
- import { ResponseData } from "../../types/http.types";
2
- export declare const getCacheKey: <D = unknown>(hash: string) => ResponseData<D>;
3
- export declare const setCacheKey: <D = unknown>(hash: string, data: ResponseData<D>) => void;
4
- export declare const isCacheExpired: () => boolean;
5
- export declare const flushCache: () => void;