@artisan-commerce/products 0.7.7 → 0.7.9
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/build/main.bundle.js +2 -2
- package/build/report.json +1 -1
- package/build/src/index.d.ts +2 -1
- package/build/src/lib/getStoreDetails/getStoreDetails.d.ts +6 -0
- package/build/src/utils/caculations/calculations.utils.d.ts +10 -6
- package/build/src/utils/caculations/calculations.utils.types.d.ts +5 -0
- package/build/src/utils/questionsAndAnswers/questionsAndAnswers.utils.d.ts +5 -0
- package/build/src/utils/questionsAndAnswers/questionsAndAnswers.utils.test.d.ts +1 -0
- package/package.json +4 -5
package/build/main.bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
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){
|
|
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=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|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|d(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 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|d(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|d(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function d(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 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 I(this,r,e);case"ascii":return _(this,r,e);case"latin1":case"binary":return S(this,r,e);case"base64":return P(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,h=0;h<s;h++)if(c(t,i+h)!==c(r,h)){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 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 T(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 P(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 T(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 F(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 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(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,h=e?-1:1,d=t[r+l];for(l+=h,i=d&(1<<-f)-1,d>>=-f,f+=a;f>0;i=256*i+t[r+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[r+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(d?-1:1);u+=Math.pow(2,n),i-=c}return(d?-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,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=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?h/s:h*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+d]=255&a,d+=p,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[e+d]=255&u,d+=p,u/=256,c-=8);t[e+d-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 S})),e.d(r,"getProductDetails",(function(){return xt})),e.d(r,"getProducts",(function(){return Mt})),e.d(r,"getRecommendedProducts",(function(){return Lt})),e.d(r,"getRelatedProducts",(function(){return Nt})),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 wr})),e.d(r,"getProductTotals",(function(){return Ar})),e.d(r,"transformers",(function(){return o})),e.d(r,"assertions",(function(){return n}));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,"toCartProduct",(function(){return w})),e.d(o,"toFormCartProduct",(function(){return O})),e.d(o,"toFormCartProductHelper",(function(){return T})),e.d(o,"toFormCartProductFromProductDetails",(function(){return P})),e.d(o,"toFormCartProductFromAnswer",(function(){return I})),e.d(o,"normalizeProductDetails",(function(){return _}));var i=e(0),u=function(t){return Object.keys(t)},a=function(t){console.error(t)},s=function(t){var r=t.attributes,e=t.available,n=t.description,o=t.name,a=t.images,s=t.prices,c=t.productId,f=t.sponsored,l=t.status,h=t.type;return"boolean"==typeof r.showInMenu&&("boolean"==typeof e&&("boolean"==typeof f&&("string"==typeof n&&("string"==typeof o&&("string"==typeof c&&(!("object"!=typeof s||"object"==typeof s&&Object.keys(s).length<1)&&(!!Array.isArray(a)&&((!l||"ACTIVE"===l||"INACTIVE"===l)&&!!u(i.ProductType).includes(h)))))))))},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=t.hash,e=t.createdAt,n=t.updatedAt,o=t.amount,a=t.priceCategory,s=t.comment,f=t.questionsAndAnswers;return"string"==typeof r&&("string"==typeof e&&("string"==typeof n&&("number"==typeof o&&("string"==typeof s&&(!!u(i.PriceCategoryType).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},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)},d=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;return!r&&n?"IDLE":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"},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,r){if(void 0===r&&(r={}),f(t))return b(b({},t),r);if(c(t))return A(t,r);var e=E(t);return A(e,r)},A=function(t,r){var e;return void 0===r&&(r={}),b(b(b({},t),{questionsAndAnswers:[],amount:null!==(e=t.amount)&&void 0!==e?e:0,priceCategory:i.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},E=function(t,r){return void 0===r&&(r={}),b(b(b({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},O=function(t,r){if(void 0===r&&(r={}),l(t))return b(b({},t),r);if(c(t))return P(t,r);var e=E(t);return P(e,r)},T=function(t,r){void 0===r&&(r={});var e=t.priceCategory,n=t.productId,o=t.amount,i=t.questions.map((function(t){var r=t.answers,i=t.questionId,u=t.min,a=t.max,s={rootId:n,min:u,max:a,type:h(t),modifiersCount:r.length,amount:o,path:[]};return b(b({},t),{answers:r.map((function(t){var r=function(t){var r=t.min;return 1===t.modifiersCount?r:0}(s),n=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(s),o=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:r,max:n,groupType:s.type}),u=t.questions.length;return b(b({amount:0},t),{priceCategory:e,questionId:i,min:r,max:n,renderType:o,questions:u?T(t).questions:[]})}))})}));return b(b(b({},t),{questions:i}),r)},P=function(t,r){void 0===r&&(r={});var e=A(t);return T(e,r)},I=function(t,r){return void 0===r&&(r={}),T(t,r)},_=function(t){var r=t.questions;return b(b({},t),{questions:r.map((function(t){var r=t.answers;return b(b({},t),{answers:r.map((function(t){var r=t.questions;return b(b({},t),{questions:null!=r?r:[]})}))})}))})},S=function(){console.log("Not supported yet")},R={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"]},D=function(){return(D=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=R.DEFAULT_API_TIMEOUT,C={artisanApp:void 0,timeout:x,apiCache:{},expiresAt:(new Date).getTime()+x,forms:{}};Object.freeze(C);var U=D({},C);Object.seal(U);var B=function(t){U=D(D({},U),t)},j=function(){return D({},U)},M=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=j().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=j().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=j().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=j().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=R.FILTERS,Y=R.HEADERS,k=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:F(e),config:e,error:o,pagination:q(n,t)}},F=function(t){var r={};return Object.entries(t.query).forEach((function(t){var e=t,n=e[0],o=e[1];N.includes(n)&&(r[n]=o)})),Object.entries(t.headers).forEach((function(t){var e=t,n=e[0],o=e[1];Y.includes(n)&&(r[n]=o)})),r},q=function(t,r){return L(L({},t),{page:null==r?void 0:r.page,hasMorePages:null==r?void 0:r.hasMorePages})},z=function(){return(z=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)},H=function(){return(H=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)},G=R.PAGINATION,V=R.ADDITIONAL_FILTERS,W=R.ORDER_FIELDS,K=R.FILTERS,X=R.GROUPS,J=R.ORDER_METHODS,Q=R.ORDER_TYPES,Z=function(t){var r=j(),e=r.vendorId,n=r.storeId,o=j(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=H(H({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),c=nt(s,K,"filter"),f=it(c);return H(H({},t),{filterBy:f})},$=function(t){var r=ot(t,X,"groupBy");return H({},r)},tt=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=nt(e,W,"orderBy"),o=H({},n),i=e.method,u=e.type;return u&&!Q.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),Q.includes(u)||(delete o.type,o.type="predefined"),i&&!J.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),J.includes(i)||(delete o.method,o.method="asc"),H(H({},t),{orderBy:o})},rt=function(t){var r=t.pagination,e=nt(void 0===r?{}:r,G,"pagination"),n=H({product:{size:20},category:{size:20}},e);return"category"!==t.groupBy&&delete n.category,H(H({},t),{pagination:n})},et=function(t){var r=t.additionalFilters,e=nt(void 0===r?{}:r,V,"additionalFilters");return H(H({},t),{additionalFilters:e})},nt=function(t,r,e){var n=H({},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},ot=function(t,r,e){var n=H({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},it=function(t){var r=H({},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)&&ut(n[0])||ut(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},ut=function(t){var r=typeof t;return"number"===r||"string"===r},at=e(2),st=e.n(at),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)},ft=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}))),ct(ct({},t),"catalogueId"===o?((e={})[o]=u,e.channelId=u,e):((n={})[o]=u,n))}),{})},lt=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}},ht=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?ct(ct({},t),((e={})[n]=o,e)):t}),{})},dt=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?ct(ct({},t),{page:i}):"product"===e?ct(ct({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===e?ct(ct({},t),{size:i.size}):t}),{})},pt=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},yt=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())}))},vt=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 yt(void 0,void 0,void 0,(function(){var o,i,u,a,s,c,f,l;return vt(this,(function(h){switch(h.label){case 0:if(r=function(t){var r=Z(t),e=$(r),n=tt(e),o=rt(n);return et(o)}(r),M(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=ft(o),f=lt(a),l=ht(u),h=dt(s),d=ct(ct(ct(ct(ct({},c),{groupBy:i}),f),l),h);i||delete d.groupBy;var p=pt(t,e.params),y=(null!==(n=j().artisanApp)&&void 0!==n?n:{}).apiURL,v=Object.entries(d).reduce((function(t,r,e){var n=r[0],o=r[1];return void 0===o?t:t+(e?"&":"")+n+"="+o}),y+"/"+p+"?");return ct(ct({},e),{url:v,query:d})}(t,r,e),p=o.url,i=st()(p),u=function(t){return j().apiCache[t]}(i),d=j().expiresAt,(a=(new Date).getTime()>=d)&&function(){var t=j().timeout,r=void 0===t?0:t;B({apiCache:z({},C.apiCache),expiresAt:(new Date).getTime()+r})}(),u&&!a)return[3,4];s=r.pagination,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,n(o)];case 2:return c=h.sent(),l=k(c,void 0,o,s),function(t,r){var e,n=j().apiCache,o=z(z({},n),((e={})[t]=r,e));B({apiCache:o})}(i,l),[2,l];case 3:return f=h.sent(),[2,l=k(void 0,f,o,s)];case 4:return[2,u]}var d,p}))}))},mt=function(t){return yt(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return vt(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]}}))}))},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=e(3),Et=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)},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())}))},Tt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Pt={"Content-Type":"application/json"},It=function(t,r){return void 0===t&&(t=!0),void 0===r&&(r={}),Ot(void 0,void 0,void 0,(function(){var e,n,o,i,u,a,s,c,f,l,h,d,p,y,v;return Tt(this,(function(g){switch(g.label){case 0:return e=j().artisanApp.settings,n=e.platform,o=e.accountId,i=null!==(h=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!==h?h:"",u=null!==(p=null!==(d=r.Platform)&&void 0!==d?d:n)&&void 0!==p?p:"",a=u,null===(y=r.Authorization)||void 0===y?[3,1]:(c=y,[3,3]);case 1:return[4,_t(t)];case 2:c=g.sent(),g.label=3;case 3:return s=null!==(v=c)&&void 0!==v?v:"",[2,new Headers(Et(Et(Et({},Pt),r),{Authorization:s,Platform:a,account:i}))]}}))}))},_t=function(t,r){return void 0===t&&(t=!0),Ot(void 0,void 0,void 0,(function(){var e,n,o;return Tt(this,(function(i){switch(i.label){case 0:return e=j().artisanApp,[4,null===(o=function(){return Object(At.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]}}))}))},St=function(){return(St=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)},Rt=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())}))},Dt=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])}}},xt=function(t,r){return Rt(void 0,void 0,void 0,(function(){var e;return Dt(this,(function(n){switch(n.label){case 0:return[4,It(!1)];case 1:return e=n.sent(),[4,gt("v1/products/:productId",r,{headers:e,params:{productId:t},query:{},body:{}},(function(t){return Rt(void 0,void 0,void 0,(function(){var r,e;return Dt(this,(function(n){switch(n.label){case 0:return[4,(o=t,bt(void 0,void 0,void 0,(function(){return wt(this,(function(t){switch(t.label){case 0:return[4,mt(o)];case 1:return[2,t.sent()]}}))})))];case 1:return r=n.sent(),e=_(r.data),[2,St(St({},r),{data:e})]}var o}))}))}))];case 2:return[2,n.sent()]}}))}))},Ct=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Ut=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},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())}))},jt=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])}}},Mt=function(t){return Bt(void 0,void 0,void 0,(function(){var r;return jt(this,(function(e){switch(e.label){case 0:return[4,It(!1)];case 1:return r=e.sent(),[4,gt("api/v3/productsBy",t,{headers:r,params:{},query:{},body:{}},(function(t){return Bt(void 0,void 0,void 0,(function(){return jt(this,(function(r){switch(r.label){case 0:return[4,(e=t,Ct(void 0,void 0,void 0,(function(){return Ut(this,(function(t){switch(t.label){case 0:return[4,mt(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 2:return[2,e.sent()]}}))}))},Lt=function(){console.log("Not implemented yet")},Nt=function(){console.log("not implemented yet")},Yt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},kt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},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;return qt(this,(function(e){switch(e.label){case 0:return[4,It(!1)];case 1:return r=e.sent(),[4,gt("v1/stores/details",t,{headers:r,params:{},query:{},body:{}},(function(t){return Ft(void 0,void 0,void 0,(function(){return qt(this,(function(r){switch(r.label){case 0:return[4,(e=t,Yt(void 0,void 0,void 0,(function(){return kt(this,(function(t){switch(t.label){case 0:return[4,mt(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 2:return[2,e.sent()]}}))}))},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},Vt=function(t,r){for(var e=Gt(r),n=t,o=t[0];e.length;){o=Kt(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},Wt=function(t,r,e){for(var n=Gt(r),o=t,i=Kt(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Kt(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 c=i.groups.map((function(t){return t.id===a?Ht({},e):Ht({},t)}));i.groups=c}return 1===r.length?Gt(i.groups):Gt(t)},Kt=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},Xt=function(){return(Xt=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=Xt(Xt({},e),{amount:n,touched:!0,errors:d(e,n,o),totals:Ar(Xt(Xt({},e.data),{amount:n})),data:Xt(Xt({},e.data),{amount:n})});return i.status=v(i),Wt(t,r,i)},Zt=function(t,r,e,n){var o=e.slice(0,-1),i=Vt(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]?Xt({},t):Xt(Xt({},t),{amount:0,error:"",totals:Ar(Xt(Xt({},t.data),{amount:0})),data:Xt(Xt({},t.data),{amount:0})})})));var a=(u=u.map((function(r){var o=I(r.data),i=Jt(e.slice(0,-1),[r.id]),u=Xt(Xt({},r),{groups:nr(o,{rootId:t,path:i},r.groups)});return u.errors=d(u,u.amount,n),u.status=v(u),u}))).map((function(t){return Xt({},t.data)})),s=Xt(Xt({},i.data),{answers:a}),c=Xt(Xt({},i),{touched:!0,modifiers:u,data:s});c.errors=p(c,n),c.status=y(c);var f=Wt(r,o,c);return o.length>1&&(f=$t(t,f,o,n)),f},$t=function(t,r,e,n){var o=e.slice(0,-1),i=Vt(r,o),u=i.groups.map((function(t){return Xt({},t.data)})),a=Xt(Xt({},i.data),{questions:u}),s=i.groups.map((function(t){var r=Xt({},t);return r.errors=p(r,n),r.status=y(r),r})),c=Xt(Xt({},i),{touched:!0,groups:s,data:a});c.errors=d(c,c.amount,n),c.status=v(c);var f=Wt(r,o,c);return o.length>1&&(f=Zt(t,f,o,n)),f},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,c=r.amount,f=r.rootId,l=r.path,d=null!=e?e:{},p=d.errors,v=d.touched,g={id:n,name:o,description:null!=i?i:"",images:er(null!=s?s:[]),data:rr({},t),errors:null!=p?p:[],touched:null!=v&&v,status:"IDLE",hidden:c<1,required:a>0,type:h(t)},m={rootId:f,max:u,min:a,type:g.type,modifiersCount:t.answers.length,amount:c,path:er(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 ir(t,m,r)})),w=rr(rr({},g),{modifiers:b});return rr(rr({},w),{status:y(w)})},ir=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,h=t.max,d=I(t),p=r.rootId,y=r.path,g=er(y,[i]),b=nr(d,{rootId:p,path:g},null==e?void 0:e.groups),w={id:i,groupId:u,name:a,images:er(s),amount:c,data:rr({},t),groups:b,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:c})),type:f,handleChange:function(t){!function(t,r,e){var n,o=tr({},j().forms),i=o[t],u=Vt(i.renderer,r),a=Qt(i.renderer,r,u,e,!1);a=Zt(t,a,r,!1);var s=ar(a,i.product),c=tr(tr({},i),{renderer:a,product:s,status:m(a)}),f=tr(tr({},o),((n={})[t]=c,n));B({forms:f});var l=tr({},c);delete l.callback,i.callback(l)}(r.rootId,g,t)}};return rr(rr({},w),{status:v(w)})},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=w(r);return ur(ur({},e),{questionsAndAnswers:sr(t)})},sr=function(t){return t.map((function(t){return ur(ur({},t.data),{answers:cr(t.modifiers)})}))},cr=function(t){return t.map((function(t){return t.amount?ur(ur({},t.data),{questionsAndAnswers:sr(t.groups)}):ur(ur({},t.data),{questionsAndAnswers:[]})}))},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,n=t.productId,o=j().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=O(t,{amount:1});console.log("after",r);var e=nr(r,{rootId:r.productId,path:[]});return{product:ar(e,t),renderer:e,validate:function(){return yr(t.productId)},status:m(e)}}(t),u=fr(fr({},o),((e={})[n]=fr(fr({},i),{callback:r}),e));return B({forms:u}),r(fr({},i)),function(){return hr(n)}},hr=function(t){var r=j().forms,e=fr({},r);delete e[t],B({forms:e})},dr=function(){return(dr=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)},pr=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=dr({},j().forms),n=e[t],o=n.renderer,i=n.callback,u=n.product,a=pr(o);o.forEach((function(r){var e=[r.id];a=vr(r,a,t,e)}));var s=ar(a,u),c=dr(dr({},n),{renderer:a,product:s,status:m(a)}),f=dr(dr({},e),((r={})[t]=c,r));B({forms:f});var l=dr({},c);return delete l.callback,i(l),c.status},vr=function(t,r,e,n){var o=t.modifiers,i=t.id,u=!o.length,a=pr(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=pr(n,[t.id]);a=gr(t,a,e,r)})),a)},gr=function(t,r,e,n){var o=t.groups,i=t.amount,u=t.status,a=t.required,s=!o.length||0===i,c=pr(r);if(s){var f="IDLE"===u&&a||"FAIL"===u||"INCOMPLETE"===u?"FAIL":u,l=dr(dr({},t),{status:f}),h=pr(n);c=Qt(c,h,l,l.amount,!0),c=Zt(e,c,h,!0)}else o.forEach((function(t){var r=pr(n,[t.id]);c=vr(t,c,e,r)}));return c},mr=function(){return(mr=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)},br=!1,wr=function(t,r){if(void 0===r&&(r={}),br)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(B(mr({artisanApp:t},r)),void 0!==r.timeout){var e=(new Date).getTime()+r.timeout;B({expiresAt:e})}"undefined"==typeof window||(br=!0)}},Ar=function(t){return{grossPrice:Or(t),totalDiscounts:Tr(t),totalTaxes:Er(t),netPrice:Pr(t)}},Er=function(t){var r=w(t),e=r.prices,n=r.amount,o=r.priceCategory,i=e[o],u=i.taxes,a=i.grossPrice,s=_r(u,a);return r.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var e=r.prices,n=r.amount,i=e[o],u=i.taxes,a=i.grossPrice;return t+n*_r(u,a)}),0)}),0)+s*n},Or=function(t){return Ir(t,"grossPrice")},Tr=function(t){return 0},Pr=function(t){return Ir(t,"netPrice")},Ir=function(t,r){var e=w(t),n=e.prices,o=e.amount,i=e.priceCategory,u=n[i][r];return e.questionsAndAnswers.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices;return t+e.amount*n[i][r]}),0)}),0)+u*o},_r=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)}}])}));
|
|
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)}}])}));
|
package/build/report.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"label":"main.bundle.js","isAsset":true,"statSize":166850,"parsedSize":68457,"gzipSize":17108,"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":5834}],"parsedSize":19827,"gzipSize":5834},{"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":7854},{"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":98857,"groups":[{"id":25,"label":"index.ts + 31 modules (concatenated)","path":"./src/index.ts + 31 modules (concatenated)","statSize":98857,"parsedSize":38370,"gzipSize":8504,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 31 modules (concatenated)/src","statSize":98842,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 31 modules (concatenated)/src/index.ts","statSize":944,"parsedSize":366,"gzipSize":81,"inaccurateSizes":true},{"label":"utils","path":"./src/index.ts + 31 modules (concatenated)/src/utils","statSize":63121,"groups":[{"label":"assertions","path":"./src/index.ts + 31 modules (concatenated)/src/utils/assertions","statSize":3461,"groups":[{"id":null,"label":"assertions.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/assertions/assertions.utils.ts","statSize":3461,"parsedSize":1343,"gzipSize":297,"inaccurateSizes":true}],"parsedSize":1343,"gzipSize":297,"inaccurateSizes":true},{"label":"transformers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers","statSize":6814,"groups":[{"id":null,"label":"transformers.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers/transformers.utils.ts","statSize":5151,"parsedSize":1999,"gzipSize":443,"inaccurateSizes":true},{"id":null,"label":"api.transformer.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/transformers/api.transformer.ts","statSize":1663,"parsedSize":645,"gzipSize":143,"inaccurateSizes":true}],"parsedSize":2644,"gzipSize":586,"inaccurateSizes":true},{"label":"caculations","path":"./src/index.ts + 31 modules (concatenated)/src/utils/caculations","statSize":2900,"groups":[{"id":null,"label":"calculations.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/caculations/calculations.utils.ts","statSize":2900,"parsedSize":1125,"gzipSize":249,"inaccurateSizes":true}],"parsedSize":1125,"gzipSize":249,"inaccurateSizes":true},{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/common.utils.ts","statSize":383,"parsedSize":148,"gzipSize":32,"inaccurateSizes":true},{"label":"modifiers","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers","statSize":25488,"groups":[{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/common.utils.ts","statSize":7321,"parsedSize":2841,"gzipSize":629,"inaccurateSizes":true},{"id":null,"label":"updateRenderer.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/updateRenderer.utils.ts","statSize":5588,"parsedSize":2168,"gzipSize":480,"inaccurateSizes":true},{"id":null,"label":"form.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/form.utils.ts","statSize":2405,"parsedSize":933,"gzipSize":206,"inaccurateSizes":true},{"id":null,"label":"rendererTraversal.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/rendererTraversal.utils.ts","statSize":3092,"parsedSize":1200,"gzipSize":265,"inaccurateSizes":true},{"id":null,"label":"renderer.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/renderer.utils.ts","statSize":5227,"parsedSize":2028,"gzipSize":449,"inaccurateSizes":true},{"id":null,"label":"handleChange.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/modifiers/handleChange.utils.ts","statSize":1855,"parsedSize":719,"gzipSize":159,"inaccurateSizes":true}],"parsedSize":9892,"gzipSize":2192,"inaccurateSizes":true},{"label":"http","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http","statSize":18079,"groups":[{"id":null,"label":"http.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/http.utils.ts","statSize":6200,"parsedSize":2406,"gzipSize":533,"inaccurateSizes":true},{"id":null,"label":"cache.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/cache.utils.ts","statSize":1177,"parsedSize":456,"gzipSize":101,"inaccurateSizes":true},{"id":null,"label":"purge.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/purge.utils.ts","statSize":5959,"parsedSize":2312,"gzipSize":512,"inaccurateSizes":true},{"id":null,"label":"request.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/http/request.utils.ts","statSize":4743,"parsedSize":1840,"gzipSize":408,"inaccurateSizes":true}],"parsedSize":7017,"gzipSize":1555,"inaccurateSizes":true},{"id":null,"label":"services.utils.ts","path":"./src/index.ts + 31 modules (concatenated)/src/utils/services.utils.ts","statSize":5996,"parsedSize":2327,"gzipSize":515,"inaccurateSizes":true}],"parsedSize":24499,"gzipSize":5429,"inaccurateSizes":true},{"label":"lib","path":"./src/index.ts + 31 modules (concatenated)/src/lib","statSize":22241,"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":4705,"groups":[{"id":null,"label":"getProductDetails.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProductDetails/getProductDetails.ts","statSize":4705,"parsedSize":1826,"gzipSize":404,"inaccurateSizes":true}],"parsedSize":1826,"gzipSize":404,"inaccurateSizes":true},{"label":"getProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProducts","statSize":3800,"groups":[{"id":null,"label":"getProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getProducts/getProducts.ts","statSize":3800,"parsedSize":1474,"gzipSize":326,"inaccurateSizes":true}],"parsedSize":1474,"gzipSize":326,"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":50,"gzipSize":11,"inaccurateSizes":true}],"parsedSize":50,"gzipSize":11,"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":3824,"groups":[{"id":null,"label":"getStoreDetails.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/getStoreDetails/getStoreDetails.ts","statSize":3824,"parsedSize":1484,"gzipSize":328,"inaccurateSizes":true}],"parsedSize":1484,"gzipSize":328,"inaccurateSizes":true},{"label":"registerModifiersForm","path":"./src/index.ts + 31 modules (concatenated)/src/lib/registerModifiersForm","statSize":2978,"groups":[{"id":null,"label":"registerModifiersForm.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/registerModifiersForm/registerModifiersForm.ts","statSize":2978,"parsedSize":1155,"gzipSize":256,"inaccurateSizes":true}],"parsedSize":1155,"gzipSize":256,"inaccurateSizes":true},{"label":"validateProduct","path":"./src/index.ts + 31 modules (concatenated)/src/lib/validateProduct","statSize":4162,"groups":[{"id":null,"label":"validateProduct.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/validateProduct/validateProduct.ts","statSize":4162,"parsedSize":1615,"gzipSize":358,"inaccurateSizes":true}],"parsedSize":1615,"gzipSize":358,"inaccurateSizes":true},{"label":"initProducts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/initProducts","statSize":1483,"groups":[{"id":null,"label":"initProducts.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/initProducts/initProducts.ts","statSize":1483,"parsedSize":575,"gzipSize":127,"inaccurateSizes":true}],"parsedSize":575,"gzipSize":127,"inaccurateSizes":true},{"id":null,"label":"state.ts","path":"./src/index.ts + 31 modules (concatenated)/src/lib/state.ts","statSize":930,"parsedSize":360,"gzipSize":80,"inaccurateSizes":true}],"parsedSize":8632,"gzipSize":1913,"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":1109,"gzipSize":245,"inaccurateSizes":true}],"parsedSize":1109,"gzipSize":245,"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":1106,"gzipSize":245,"inaccurateSizes":true}],"parsedSize":1106,"gzipSize":245,"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":1108,"gzipSize":245,"inaccurateSizes":true}],"parsedSize":1108,"gzipSize":245,"inaccurateSizes":true}],"parsedSize":3324,"gzipSize":736,"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":592,"gzipSize":131,"inaccurateSizes":true}],"parsedSize":592,"gzipSize":131,"inaccurateSizes":true},{"label":"errors","path":"./src/index.ts + 31 modules (concatenated)/src/errors","statSize":2444,"groups":[{"id":null,"label":"api.errors.ts","path":"./src/index.ts + 31 modules (concatenated)/src/errors/api.errors.ts","statSize":2444,"parsedSize":948,"gzipSize":210,"inaccurateSizes":true}],"parsedSize":948,"gzipSize":210,"inaccurateSizes":true}],"parsedSize":38364,"gzipSize":8502,"inaccurateSizes":true}]}],"parsedSize":38370,"gzipSize":8504}]},{"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":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}]}]
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as transformers from "./utils/transformers/transformers.utils";
|
|
2
2
|
import * as assertions from "./utils/assertions/assertions.utils";
|
|
3
|
+
import * as modifierUtils from "./utils/questionsAndAnswers/questionsAndAnswers.utils";
|
|
3
4
|
export { getCategories } from "./lib/getCategories/getCategories";
|
|
4
5
|
export { getProductDetails } from "./lib/getProductDetails/getProductDetails";
|
|
5
6
|
export { getProducts } from "./lib/getProducts/getProducts";
|
|
@@ -10,7 +11,7 @@ export { registerModifiersForm } from "./lib/registerModifiersForm/registerModif
|
|
|
10
11
|
export { validateProduct } from "./lib/validateProduct/validateProduct";
|
|
11
12
|
export { initProducts } from "./lib/initProducts/initProducts";
|
|
12
13
|
export { getProductTotals } from "./utils/caculations/calculations.utils";
|
|
13
|
-
export { transformers, assertions };
|
|
14
|
+
export { transformers, assertions, modifierUtils };
|
|
14
15
|
export type { ModifierGroupRenderer } from "./types/modifiers.types";
|
|
15
16
|
export type { ModifierRenderer } from "./types/modifiers.types";
|
|
16
17
|
export type { ModifiersForm } from "./lib/registerModifiersForm/registerModifiersForm.types";
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { FetchStoreDetailsConfig } from "./getStoreDetails.types";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches all categories and products from the given store
|
|
4
|
+
*
|
|
5
|
+
* @param config config to fetch the store details
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
2
8
|
export declare const getStoreDetails: (config: FetchStoreDetailsConfig) => Promise<import("../../types/http.types").ResponseData<unknown>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Product, PriceCategoryTax } from "@artisan-commerce/types";
|
|
2
|
+
import { CartProductAnswer, CartProduct } from "@artisan-commerce/types";
|
|
2
3
|
import { ProductTotals } from "./calculations.utils.types";
|
|
3
4
|
/**
|
|
4
5
|
* Get a summary of all price totals of a given product
|
|
@@ -6,12 +7,15 @@ import { ProductTotals } from "./calculations.utils.types";
|
|
|
6
7
|
* @author Luis Eduardo Andrade, John Arias
|
|
7
8
|
* @since 1.0
|
|
8
9
|
* @param product the product that will be calculated
|
|
10
|
+
* @param amount amount of products, if not provided will use product amount field
|
|
9
11
|
* @returns an object with a summary of the prodcut totals
|
|
10
12
|
*/
|
|
11
|
-
export declare const getProductTotals: (product: Product) => ProductTotals;
|
|
12
|
-
export declare const getProductTotalTaxes: (product: Product) => number;
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
13
|
+
export declare const getProductTotals: (product: Product, amount?: number) => ProductTotals;
|
|
14
|
+
export declare const getProductTotalTaxes: (product: Product, setAmount: number) => number;
|
|
15
|
+
export declare const getModifiersTotalTaxes: (product: CartProduct | CartProductAnswer, setAmount: number) => number;
|
|
16
|
+
export declare const getProductGrossPrice: (product: Product, setAmount: number) => number;
|
|
17
|
+
export declare const getProductTotalDiscounts: (product: Product, setAmount: number) => number;
|
|
18
|
+
export declare const getProductNetPrice: (product: Product, setAmount: number) => number;
|
|
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;
|
|
17
21
|
export declare const getTaxTotal: (taxes: PriceCategoryTax[], grossPrice: number) => number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CartProduct } from "@artisan-commerce/types";
|
|
2
|
+
import { CartProductAnswer } from "@artisan-commerce/types";
|
|
3
|
+
export declare const multiplyProductQA: (product: CartProduct | CartProductAnswer) => CartProduct;
|
|
4
|
+
export declare const divideProductQA: (product: CartProduct | CartProductAnswer) => CartProduct;
|
|
5
|
+
export declare const operationOnProductQA: (product: CartProduct | CartProductAnswer, answerEnhancer: (answer: CartProductAnswer, amount: number) => CartProductAnswer) => CartProduct;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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.
|
|
4
|
+
"version": "0.7.9",
|
|
5
5
|
"main": "./build/main.bundle.js",
|
|
6
6
|
"types": "./build/src/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -31,10 +31,9 @@
|
|
|
31
31
|
"author": "Luis Eduardo Andrade",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@artisan-commerce/auth": "^0.8.
|
|
35
|
-
"@artisan-commerce/builders": "^0.4.
|
|
34
|
+
"@artisan-commerce/auth": "^0.8.14",
|
|
35
|
+
"@artisan-commerce/builders": "^0.4.11",
|
|
36
36
|
"@bugsnag/js": "^7.2.0",
|
|
37
|
-
"axios": "^0.19.2",
|
|
38
37
|
"i18next": "^19.6.2",
|
|
39
38
|
"i18next-browser-languagedetector": "^5.0.0",
|
|
40
39
|
"i18next-xhr-backend": "^3.2.2",
|
|
@@ -88,5 +87,5 @@
|
|
|
88
87
|
"webpack-dev-server": "^3.11.0",
|
|
89
88
|
"webpack-merge": "^5.0.9"
|
|
90
89
|
},
|
|
91
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "818f3567d0b091f006721c51687f5abd7ea6fa51"
|
|
92
91
|
}
|