@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
21 lines • 101 kB
JavaScript
var ecommerceDriver=function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var r=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(r,'a',r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='',t(t.s=103)}([function(e,t,r){'use strict';r.d(t,'a',function(){return a});var o=r(1),n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function o(){this.constructor=t}if('function'!=typeof r&&null!==r)throw new TypeError('Class extends value '+(r+'')+' is not a constructor or null');e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.id=-1,t.title='',t}return n(t,e),t.prototype.mergeWithPartial=function(t){return e.prototype.mergeWithPartial.call(this,t)},t.matchObjects=function(e,t,r){var o;return function(e){e[e.Ok=0]='Ok',e[e.NotExists=1]='NotExists',e[e.Fail=2]='Fail'}(o||(o={})),r.reduce(function(r,n){var a=Object.keys(n)[0],i=n[a];return r===o.Ok?o.Ok:r===o.NotExists?'undefined'==typeof(t||{})[i]?o.NotExists:e[a]===t[i]?o.Ok:o.Fail:o.Fail},o.NotExists)===o.Ok},t.prototype.matchesPartial=function(e){return this.id===e.id||'undefined'==typeof e.id&&this.title===e.title},t}(o.a)},function(e,t,r){'use strict';r.d(t,'a',function(){return n});var o=r(3),n=function(){function e(){}return e.prototype.clone=function(){return new this.constructor().mergeWithPartial(this)},e.prototype.validateModel=function(e){return!!e},e.prototype.mergeWithModel=function(t){var r=e.BuildFromModel(this,t);return e.typeSafeMerge(this,r)},e.prototype.mergeWithPartial=function(t){return e.typeSafeMerge(this,t)},e.BuildFromModel=function(e,t){if(!t)return null;var r=e.clone();return r.validateModel(t)?(r.init(t),r):null},e.Build=function(t,r,n){switch(n){case o.a.ExternalModel:return e.BuildFromModel(t,r);case o.a.PartialSelf:return e.BuildFromPartialSelf(t,r);default:throw'Unexpected ModelTreatment found!';}},e.BuildFromPartialSelf=function(t,r){return r?e.typeSafeMerge(t,r):null},e.typeSafeMerge=function(t,r){if(typeof r!=typeof t)return r;if(!t)return t;var n=function(e,t){return e===t||null!==e&&'object'==typeof e&&'function'==typeof e.equals&&e.equals(t)};return Object.keys(r||{}).forEach(function(a){if(!!t[a]&&'undefined'!=typeof t[a].pushMerged){var i=t[a];r[a].forEach(function(e){i.pushMerged(e,o.a.PartialSelf)})}else if(Array.isArray(t[a]))r[a].forEach(function(e){var r=JSON.stringify(e);null===t[a].find(function(e){return JSON.stringify(e)===r})&&t[a].push(e)});else if('undefined'!=typeof r[a]&&!n(t[a],r[a])&&('undefined'==typeof t[a]||null===t[a]||'undefined'==typeof t[a].subscribe))switch(!0){case null!==t[a]&&'object'==typeof t[a]:t[a]=e.typeSafeMerge(t[a],r[a]);break;default:t[a]=r[a];}}),t},e}()},function(e,t,r){'use strict';(function(o,n){var a,i,p='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&'function'==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?'symbol':typeof e};/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/(function(o,n){'object'===p(t)&&'undefined'!=typeof e?e.exports=n():(a=n,i='function'==typeof a?a.call(t,r,t,e):a,!(i!==void 0&&(e.exports=i)))})(void 0,function(){function e(e){var t='undefined'==typeof e?'undefined':p(e);return null!==e&&('object'===t||'function'===t)}function t(e){return'function'==typeof e}function r(){return'undefined'==typeof A?a():function(){A(i)}}function a(){var e=setTimeout;return function(){return e(i,1)}}function i(){for(var e=0;e<U;e+=2){var t=V[e],r=V[e+1];t(r),V[e]=void 0,V[e+1]=void 0}U=0}function s(e,t){var r=this,o=new this.constructor(l);void 0===o[W]&&O(o);var n=r._state;if(n){var a=arguments[n-1];B(function(){return E(n,o,a,r._result)})}else v(r,o,e,t);return o}function d(e){var t=this;if(e&&'object'===('undefined'==typeof e?'undefined':p(e))&&e.constructor===t)return e;var r=new t(l);return m(r,e),r}function l(){}function c(){return new TypeError('You cannot resolve a promise with itself')}function u(){return new TypeError('A promises callback cannot return that same promise.')}function y(e,t,r,o){try{e.call(t,r,o)}catch(t){return t}}function f(e,t,r){B(function(e){var o=!1,n=y(r,t,function(r){o||(o=!0,t===r?h(e,r):m(e,r))},function(t){o||(o=!0,P(e,t))},'Settle: '+(e._label||' unknown promise'));!o&&n&&(o=!0,P(e,n))},e)}function _(e,t){t._state===H?h(e,t._result):t._state===J?P(e,t._result):v(t,void 0,function(t){return m(e,t)},function(t){return P(e,t)})}function g(e,r,o){r.constructor===e.constructor&&o===s&&r.constructor.resolve===d?_(e,r):void 0===o?h(e,r):t(o)?f(e,r,o):h(e,r)}function m(t,r){if(t===r)P(t,c());else if(e(r)){var o;try{o=r.then}catch(e){return void P(t,e)}g(t,r,o)}else h(t,r)}function b(e){e._onerror&&e._onerror(e._result),S(e)}function h(e,t){e._state!==z||(e._result=t,e._state=H,0!==e._subscribers.length&&B(S,e))}function P(e,t){e._state!==z||(e._state=J,e._result=t,B(b,e))}function v(e,t,r,o){var n=e._subscribers,a=n.length;e._onerror=null,n[a]=t,n[a+H]=r,n[a+J]=o,0===a&&e._state&&B(S,e)}function S(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var o=void 0,n=void 0,a=e._result,p=0;p<t.length;p+=3)o=t[p],n=t[p+r],o?E(r,o,n,a):n(a);e._subscribers.length=0}}function E(e,r,o,n){var a,i,p=t(o),s=!0;if(p){try{a=o(n)}catch(t){s=!1,i=t}if(r===a)return void P(r,u())}else a=n;r._state!==z||(p&&s?m(r,a):!1==s?P(r,i):e===H?h(r,a):e===J&&P(r,a))}function x(t,e){try{e(function(e){m(t,e)},function(e){P(t,e)})}catch(r){P(t,r)}}function C(){return G++}function O(e){e[W]=G++,e._state=void 0,e._result=void 0,e._subscribers=[]}function I(){return new Error('Array Methods must be provided an Array')}function w(){throw new TypeError('You must pass a resolver function as the first argument to the promise constructor')}function k(){throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.')}var M=Array.isArray?Array.isArray:function(e){return'[object Array]'===Object.prototype.toString.call(e)};var D=M,U=0,A=void 0,L=void 0,B=function(e,t){V[U]=e,V[U+1]=t,U+=2,2==U&&(L?L(i):R())},F='undefined'==typeof window?void 0:window,N=F||{},j=N.MutationObserver||N.WebKitMutationObserver,q='undefined'==typeof self&&'undefined'!=typeof o&&'[object process]'==={}.toString.call(o),T='undefined'!=typeof Uint8ClampedArray&&'undefined'!=typeof importScripts&&'undefined'!=typeof MessageChannel,V=Array(1e3),R=void 0;R=q?function(){return function(){return o.nextTick(i)}}():j?function(){var e=0,t=new j(i),r=document.createTextNode('');return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}():T?function(){var e=new MessageChannel;return e.port1.onmessage=i,function(){return e.port2.postMessage(0)}}():void 0!==F||0?a():function(){try{var e=Function('return this')().require('vertx');return A=e.runOnLoop||e.runOnContext,r()}catch(t){return a()}}();var W=Math.random().toString(36).substring(2),z=void 0,H=1,J=2,G=0,K=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(l),this.promise[W]||O(this.promise),D(t)?(this.length=t.length,this._remaining=t.length,this._result=Array(this.length),0===this.length?h(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&h(this.promise,this._result))):P(this.promise,I())}return e.prototype._enumerate=function(e){for(var t=0;this._state===z&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,o=r.resolve;if(o===d){var n=void 0,a=void 0,i=!1;try{n=e.then}catch(t){i=!0,a=t}if(n===s&&e._state!==z)this._settledAt(e._state,t,e._result);else if('function'!=typeof n)this._remaining--,this._result[t]=e;else if(r===Y){var p=new r(l);i?P(p,a):g(p,e,n),this._willSettleAt(p,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(o(e),t)},e.prototype._settledAt=function(e,t,r){var o=this.promise;o._state===z&&(this._remaining--,e===J?P(o,r):this._result[t]=r),0===this._remaining&&h(o,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;v(e,void 0,function(e){return r._settledAt(H,t,e)},function(e){return r._settledAt(J,t,e)})},e}(),Y=function(){function e(t){this[W]=C(),this._result=this._state=void 0,this._subscribers=[],l!==t&&('function'!=typeof t&&w(),this instanceof e?x(this,t):k())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,o=r.constructor;return t(e)?r.then(function(t){return o.resolve(e()).then(function(){return t})},function(t){return o.resolve(e()).then(function(){throw t})}):r.then(e,e)},e}();return Y.prototype.then=s,Y.all=function(e){return new K(this,e).promise},Y.race=function(e){var t=this;return D(e)?new t(function(r,o){for(var n=e.length,a=0;a<n;a++)t.resolve(e[a]).then(r,o)}):new t(function(e,t){return t(new TypeError('You must pass an array to race.'))})},Y.resolve=d,Y.reject=function(e){var t=this,r=new t(l);return P(r,e),r},Y._setScheduler=function(e){L=e},Y._setAsap=function(e){B=e},Y._asap=B,Y.polyfill=function(){var e;if('undefined'!=typeof n)e=n;else if('undefined'!=typeof self)e=self;else try{e=Function('return this')()}catch(t){throw new Error('polyfill failed because global object is unavailable in this environment')}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(t){}if('[object Promise]'===r&&!t.cast)return}e.Promise=Y},Y.Promise=Y,Y})}).call(t,r(18),r(15))},function(e,t,r){'use strict';r.d(t,'a',function(){return o}),r.d(t,'b',function(){return d});var o,n=r(4),a=r(1),i=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function o(){this.constructor=t}if('function'!=typeof r&&null!==r)throw new TypeError('Class extends value '+(r+'')+' is not a constructor or null');e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),p=this&&this.__decorate||function(e,t,o,n){var a,p=arguments.length,s=3>p?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var r=e.length-1;0<=r;r--)(a=e[r])&&(s=(3>p?a(s):3<p?a(t,o,s):a(t,o))||s);return 3<p&&s&&Object.defineProperty(t,o,s),s},s=this&&this.__metadata||function(e,t){if('object'==typeof Reflect&&'function'==typeof Reflect.metadata)return Reflect.metadata(e,t)};(function(e){e[e.ExternalModel=0]='ExternalModel',e[e.PartialSelf=1]='PartialSelf'})(o||(o={}));var d=function(e){function t(t,r){void 0===r&&(r=null);var o=e.call(this)||this;return o._owner=null,o.current=null,o._itemCreatorFactory=t,o._owner=r,o}return i(t,e),t.prototype.pushAndMoveCursor=function(e){return this.push(e),this.current=e},t.prototype.moveCursorTo=function(e){var t=this.indexOf(e);return 0<=t?this.current=this[t]:this.pushAndMoveCursor(e)},t.prototype.setCurrent=function(e){if(0<=e&&e<=this.length-1){var t=this[e];t&&(this.current=t)}else this.current=null},t.prototype.pushMerged=function(e,t,r){void 0===t&&(t=o.PartialSelf),void 0===r&&(r=!0);var n=this.findIndex(function(r){return t===o.ExternalModel?r.matchesModel(e):r.matchesPartial(e)});if(-1<n)return this[n]=t===o.ExternalModel?this[n].mergeWithModel(e):this[n].mergeWithPartial(e),this.moveCursorTo(this[n]),this[n];var i=a.a.Build(this._itemCreatorFactory(e,t),e,t);return void 0!==i.owner&&(i.owner=this._owner),r?this.pushAndMoveCursor(i):(this.push(i),i)},t.prototype.initByMerged=function(e,t){this.splice(0,this.length);var r=this;'undefined'==typeof e&&(e=[]),e.forEach(function(e){r.pushAndMoveCursor(r._itemCreatorFactory(e,t))})},t=p([Object(n.d)(),s('design:paramtypes',[Function,Object])],t),t}(Array)},function(e,t,r){'use strict';t.d=function(){return function(e){return function(t){function r(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var n=t.apply(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return a(r,t),r}(e)}},t.a=function(e){return function(){for(var t in i={},e)e.hasOwnProperty(t)&&(i[t]=function(e){var t=null;try{t=new e}catch(t){}return t}.bind(null,e[t],t))}},t.b=function(e){return function(t,r){Object.defineProperty(t,r,{get:function(){return i[e]()}})}},t.c=function(e){return function(t){return function(r){function i(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var p=this;try{p=r.apply(this,a)||this}catch(t){}return p.info=new n.a(o.a,e),window.Aurigma=window.Aurigma||{},window.Aurigma.EcommerceDriver=p.info,Object.setPrototypeOf(p,t.prototype),p}return a(i,r),i}(t)}};var o=r(32),n=r(33),a=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function o(){this.constructor=t}if('function'!=typeof r&&null!==r)throw new TypeError('Class extends value '+(r+'')+' is not a constructor or null');e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),i={}},function(e,t,r){'use strict';var o=r(20);r.d(t,'a',function(){return o.a});var n=r(21);r.d(t,'b',function(){return n.a});var a=r(7);r.d(t,'c',function(){return a.a});r(17)},function(e,t,r){'use strict';/*!
* Strongly Typed Events for TypeScript - Core
* https://github.com/KeesCBakker/StronlyTypedEvents/
* http://keestalkstech.com
*
* Copyright Kees C. Bakker / KeesTalksTech
* Released under the MIT license
*/Object.defineProperty(t,'__esModule',{value:!0});var o=r(24);Object.defineProperty(t,'DispatcherBase',{enumerable:!0,get:function(){return o.DispatcherBase}}),Object.defineProperty(t,'DispatcherWrapper',{enumerable:!0,get:function(){return o.DispatcherWrapper}}),Object.defineProperty(t,'EventListBase',{enumerable:!0,get:function(){return o.EventListBase}});var n=r(12);Object.defineProperty(t,'Subscription',{enumerable:!0,get:function(){return n.Subscription}})},function(e,t,r){'use strict';(function(e){r.d(t,'a',function(){return o});var o=function(){function t(){}return t.clone=function(e){if('object'!=typeof e)return e;if(!e)return e;var t=e instanceof Array?[]:{};for(var r in e)e.hasOwnProperty(r)&&(t[r]=this.clone(e[r]));return t},t.JSON_to_URLEncoded=function(e,t,r){if(void 0===t&&(t=null),void 0===r&&(r=[]),r=r||[],'object'==typeof e)for(var o in e)e.hasOwnProperty(o)&&this.JSON_to_URLEncoded(e[o],t?t+'['+o+']':o,r);else r.push(t+'='+encodeURIComponent(e));return r.join('&')},t.FormatPrice=function(e,t,r){if(null===e||void 0===e)return null;var o='number'==typeof e?e:parseFloat(e.replace(',','.').replace(/[^0-9\.]+/g,''));return o.toLocaleString(t,{style:'currency',currency:r})},t.loadJsonJsonp=function(t,r){return void 0===r&&(r={}),new e(function(e,o){var n='jsonp_callback_'+Math.round(1e5*Math.random());window[n]=function(t){delete window[n],document.body.removeChild(a);try{var r=JSON.parse(t);e(r)}catch(t){e(null)}},r&&Object.keys(r).forEach(function(e){t+=(0<=t.indexOf('?')?'&':'?')+e+'='+r[e]});var a=document.createElement('script');a.src=t+(0<=t.indexOf('?')?'&':'?')+'callback='+n,a.onerror=function(){o(arguments)},document.body.appendChild(a)})},t.ensureArrayLength=function(e,t){return e.length>=t?e:e.concat(Array(t-e.length))},Object.defineProperty(t,'guidRegex',{get:function(){return /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/},enumerable:!1,configurable:!0}),t.isNotEmptyString=function(e){return null!==e&&void 0!==e&&''!==e},t.stringOrNumberEquals=function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&e.toString()===t.toString()},t.ensureStartsWith=function(e,t){return e.startsWith(t)?e:t+e},t.ensureEndsWith=function(e,t){return e.endsWith(t)?e:e+t},t}()}).call(t,r(2).Promise)},function(e,t,r){'use strict';/*!
* Strongly Typed Events for TypeScript
* https://github.com/KeesCBakker/StronlyTypedEvents/
* http://keestalkstech.com
*
* Copyright Kees C. Bakker / KeesTalksTech
* Released under the MIT license
*/Object.defineProperty(t,'__esModule',{value:!0});var o=r(6);Object.defineProperty(t,'DispatcherBase',{enumerable:!0,get:function(){return o.DispatcherBase}}),Object.defineProperty(t,'DispatcherWrapper',{enumerable:!0,get:function(){return o.DispatcherWrapper}}),Object.defineProperty(t,'EventListBase',{enumerable:!0,get:function(){return o.EventListBase}}),Object.defineProperty(t,'Subscription',{enumerable:!0,get:function(){return o.Subscription}});var n=r(26);Object.defineProperty(t,'EventDispatcher',{enumerable:!0,get:function(){return n.EventDispatcher}}),Object.defineProperty(t,'EventHandlingBase',{enumerable:!0,get:function(){return n.EventHandlingBase}}),Object.defineProperty(t,'EventList',{enumerable:!0,get:function(){return n.EventList}}),Object.defineProperty(t,'NonUniformEventList',{enumerable:!0,get:function(){return n.NonUniformEventList}});var a=r(28);Object.defineProperty(t,'SimpleEventDispatcher',{enumerable:!0,get:function(){return a.SimpleEventDispatcher}}),Object.defineProperty(t,'SimpleEventHandlingBase',{enumerable:!0,get:function(){return a.SimpleEventHandlingBase}}),Object.defineProperty(t,'SimpleEventList',{enumerable:!0,get:function(){return a.SimpleEventList}}),Object.defineProperty(t,'NonUniformSimpleEventList',{enumerable:!0,get:function(){return a.NonUniformSimpleEventList}});var i=r(30);Object.defineProperty(t,'SignalDispatcher',{enumerable:!0,get:function(){return i.SignalDispatcher}}),Object.defineProperty(t,'SignalHandlingBase',{enumerable:!0,get:function(){return i.SignalHandlingBase}}),Object.defineProperty(t,'SignalList',{enumerable:!0,get:function(){return i.SignalList}})},function(e,t,r){'use strict';r.d(t,'a',function(){return o});var o=function(){function e(e,t,r,o){this.err=e,this.response=t,this.body=r,this.readyState=o,this.isFromCart=!1}return e.empty=function(){return new e(null,null,'')},e}()},function(e,t,r){'use strict';r.d(t,'a',function(){return a});var o=r(23),n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function o(){this.constructor=t}if('function'!=typeof r&&null!==r)throw new TypeError('Class extends value '+(r+'')+' is not a constructor or null');e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(o.a)},function(e,t,r){'use strict';(function(e){r.d(t,'a',function(){return i});var o=r(8),n=r.n(o),a=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function o(){this.constructor=t}if('function'!=typeof r&&null!==r)throw new TypeError('Class extends value '+(r+'')+' is not a constructor or null');e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),i=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.callbacks=[],e}return a(r,t),r.prototype.subscribe=function(e){var t=this;return e&&this.callbacks.push(new o.Subscription(e,!1)),function(){t.unsubscribe(e)}},r.prototype.unsubscribe=function(e){if(e)for(var t=0;t<this.callbacks.length;t++)if(this.callbacks[t].handler===e){this.callbacks.splice(t,1);break}},r.prototype.dispatch=function(t,r){var o=this,n=this.callbacks.map(function(e){return o.executeCallback(e,t,r)});return e.all(n).then(function(){})},r.prototype.executeCallback=function(t,r,o){var n=t.handler.apply(this,[r,o]);return this.isPromise(n)?n:e.resolve()},r.prototype.isPromise=function(e){return!!e&&'function'==typeof e.then},r}(o.EventDispatcher)}).call(t,r(2).Promise)},function(e,t){'use strict';Object.defineProperty(t,'__esModule',{value:!0}),t.Subscription=void 0;var r=function(){function e(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}return e.prototype.execute=function(e,t,r){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var o=this.handler;e?setTimeout(function(){o.apply(t,r)},1):o.apply(t,r)}},e}();t.Subscription=r},function(e,t,r){'use strict';r.d(t,'c',function(){return n}),r.d(t,'b',function(){return a}),r.d(t,'a',function(){return i});var o;(function(e){e.Preselect='Preselect',e.Filter='Filter'})(o||(o={}));var n;(function(e){e[e.Template=1]='Template',e[e.OptionBasedProduct=2]='OptionBasedProduct'})(n||(n={}));var a;(function(e){e[e.Custom=0]='Custom',e[e.ShopifyLegacy=1]='ShopifyLegacy',e[e.DocketManager=2]='DocketManager',e[e.Auth0Saml=3]='Auth0Saml',e[e.NopCommerce=4]='NopCommerce',e[e.WooCommerce=5]='WooCommerce',e[e.Magento=6]='Magento',e[e.BigCommerce=7]='BigCommerce',e[e.Shopify=8]='Shopify',e[e.ShopifyCustom=9]='ShopifyCustom'})(a||(a={}));var i=function(){return function(){this.storefrontId='',this.apiGatewayUrl='',this.backOfficeUrl='',this.assetStorageUrl='',this.assetProcessorUrl='',this.designAtomsApiUrl='',this.tenantId=0,this.userId=0,this.token='',this.externalProductId='',this.integrationType=n.Template,this.optionBasedProductInfo=void 0,this.ecommerceSystemType=a.Custom}}()},function(e,t,r){'use strict';r.d(t,'a',function(){return s});var o=r(4),n=r(9),a=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function o(){this.constructor=t}if('function'!=typeof r&&null!==r)throw new TypeError('Class extends value '+(r+'')+' is not a constructor or null');e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),i=this&&this.__decorate||function(e,t,o,n){var a,p=arguments.length,s=3>p?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var r=e.length-1;0<=r;r--)(a=e[r])&&(s=(3>p?a(s):3<p?a(t,o,s):a(t,o))||s);return 3<p&&s&&Object.defineProperty(t,o,s),s},p=this&&this.__metadata||function(e,t){if('object'==typeof Reflect&&'function'==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=function(e){function t(t,r){var o=e.call(this,t)||this;return'undefined'!=typeof r&&(o.body=r.body,o.response=r.response),o}return a(t,e),t=i([Object(o.d)(),p('design:paramtypes',[String,n.a])],t),t}(Error)},function(e){'use strict';var t,r='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&'function'==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?'symbol':typeof e};t=function(){return this}();try{t=t||Function('return this')()||(1,eval)('this')}catch(o){'object'===('undefined'==typeof window?'undefined':r(window))&&(t=window)}e.exports=t},function(e,t,r){'use strict';r.d(t,'a',function(){return o});var o=function(){return function(e,t){this.option=e,this.value=[],t&&(t instanceof Array?this.value=t:this.value.push(t))}}()},function(e,t,r){'use strict';r.d(t,'a',function(){return o});var o=function(){function e(){}return e.postByForm=function(t,r,o){void 0===o&&(o='post');var n=document.createElement('form');for(var a in n.method=o,n.action=t,n.enctype='multipart/form-data',r)if(r.hasOwnProperty(a))if(!!r[a]&&'object'==typeof r[a])e.genInput(r[a],n,a);else{var i=document.createElement('input');i.type='hidden',i.name=a,i.value=r[a]||'',n.appendChild(i)}document.body.appendChild(n),n.submit()},e.genInput=function(t,r,o){Object.keys(t).forEach(function(n){var a=o?o+'['+n+']':n;if(!!t[n]&&'object'==typeof t[n])t[n]&&e.genInput(t[n],r,a);else{var i=document.createElement('input');i.type='hidden',i.name=a,i.value=t[n]||'',r.appendChild(i)}})},e}()},function(e){'use strict';function t(){throw new Error('setTimeout has not been defined')}function r(){throw new Error('clearTimeout has not been defined')}function o(e){if(d===setTimeout)return setTimeout(e,0);if((d===t||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch(t){try{return d.call(null,e,0)}catch(t){return d.call(this,e,0)}}}function n(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function a(){f&&u&&(f=!1,u.length?y=u.concat(y):_=-1,y.length&&p())}function p(){if(!f){var e=o(a);f=!0;for(var t=y.length;t;){for(u=y,y=[];++_<t;)u&&u[_].run();_=-1,t=y.length}u=null,f=!1,n(e)}}function s(e,t){this.fun=e,this.array=t}function i(){}var d,l,c=e.exports={};(function(){try{d='function'==typeof setTimeout?setTimeout:t}catch(r){d=t}try{l='function'==typeof clearTimeout?clearTimeout:r}catch(t){l=r}})();var u,y=[],f=!1,_=-1;c.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];y.push(new s(e,t)),1!==y.length||f||o(p)},s.prototype.run=function(){this.fun.apply(null,this.array)},c.title='browser',c.browser=!0,c.env={},c.argv=[],c.version='',c.versions={},c.on=i,c.addListener=i,c.once=i,c.off=i,c.removeListener=i,c.removeAllListeners=i,c.emit=i,c.prependListener=i,c.prependOnceListener=i,c.listeners=function(){return[]},c.binding=function(){throw new Error('process.binding is not supported')},c.cwd=function(){return'/'},c.chdir=function(){throw new Error('process.chdir is not supported')},c.umask=function(){return 0}},function(e,t,r){'use strict';(function(e){r.d(t,'a',function(){return b});var o=r(5),n=r(22),a=r(34),i=r.n(a),p=r(35),s=r.n(p),d=r(13),l=r(36),c=r(4),u=r(1),y=r(3),f=this&&this.__decorate||function(e,t,o,n){var a,p=arguments.length,s=3>p?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var r=e.length-1;0<=r;r--)(a=e[r])&&(s=(3>p?a(s):3<p?a(t,o,s):a(t,o))||s);return 3<p&&s&&Object.defineProperty(t,o,s),s},_=this&&this.__metadata||function(e,t){if('object'==typeof Reflect&&'function'==typeof Reflect.metadata)return Reflect.metadata(e,t)},g=this&&this.__awaiter||function(t,r,o,n){function a(e){return e instanceof o?e:new o(function(t){t(e)})}return new(o||(o=e))(function(e,o){function i(e){try{s(n.next(e))}catch(t){o(t)}}function p(e){try{s(n['throw'](e))}catch(t){o(t)}}function s(t){t.done?e(t.value):a(t.value).then(i,p)}s((n=n.apply(t,r||[])).next())})},m=this&&this.__generator||function(e,r){function o(e){return function(t){return a([e,t])}}function a(o){if(n)throw new TypeError('Generator is already executing.');for(;d;)try{if(n=1,i&&(p=2&o[0]?i['return']:o[0]?i['throw']||((p=i['return'])&&p.call(i),0):i.next)&&!(p=p.call(i,o[1])).done)return p;switch((i=0,p)&&(o=[2&o[0],p.value]),o[0]){case 0:case 1:p=o;break;case 4:return d.label++,{value:o[1],done:!1};case 5:d.label++,i=o[1],o=[0];continue;case 7:o=d.ops.pop(),d.trys.pop();continue;default:if((p=d.trys,!(p=0<p.length&&p[p.length-1]))&&(6===o[0]||2===o[0])){d=0;continue}if(3===o[0]&&(!p||o[1]>p[0]&&o[1]<p[3])){d.label=o[1];break}if(6===o[0]&&d.label<p[1]){d.label=p[1],p=o;break}if(p&&d.label<p[2]){d.label=p[2],d.ops.push(o);break}p[2]&&d.ops.pop(),d.trys.pop();continue;}o=r.call(e,d)}catch(t){o=[6,t],i=0}finally{n=p=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}var n,i,p,s,d={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},'function'==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s},b=function(){function e(){var e=this;this._products=new y.b(function(){return e.productCreateInstance},this),this._orders=new y.b(function(){return e.orderCreateInstance},this),this._localization=[],this._additionalProductsPromises=[],this.findProduct={byId:function(t){return g(e,void 0,void 0,function(){return m(this,function(){return[2,this.findProductById(t)]})})}}}return e.prototype.productFactoryFromModel=function(e,t){var r=u.a.BuildFromModel(this.productCreateInstance,e);return r?(r.owner=t,r):null},e.prototype.productFactoryFromPartialSelf=function(e,t){var r=u.a.BuildFromPartialSelf(this.productCreateInstance,e);return r?(r.owner=t,r):null},e.prototype.init=function(e,t,r,o,a,i,p,s,c,y){return g(this,void 0,void 0,function(){var f,_,g,b,h,P,v;return m(this,function(){for(this.backOffice=s||new d.a,this.settings=u.a.BuildFromModel(this.pluginSettingsCreateInstance,o),this.editor=t,c&&(this.themeSettings=c),this.localization=y,Array.isArray(e)||(e=[e]),(f=0,_=e);f<_.length;f++)g=_[f],this.products.push(this.productFactoryFromModel(g,this));if(this.products.setCurrent(0),a=a||{},Object.assign(a,{quantity:i,product:this.products.current,settings:this.settings}),b=this.orders.pushAndMoveCursor(this.buildOrder(a)),b.driver=this,this._cart=new n.a(this),this.user=u.a.BuildFromModel(this.userCreateInstance,p),this.config=r.config||r,this._configProcessor=new l.a(this),t&&'multistep'!==t.editorType&&(this.config=this.configProcessor.processConfig(r)),r.additionalProducts)for(h=0,P=r.additionalProducts;h<P.length;h++)v=P[h],this._additionalProductsPromises.push(this.findProduct.byId(v.id));return t&&(t.driver=this),this._supportUserLogin=!1,[2,this]})})},Object.defineProperty(e.prototype,'supportUserLogin',{get:function(){return this._supportUserLogin},set:function(e){this._supportUserLogin=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'backOffice',{get:function(){return this._backOffice},set:function(e){this._backOffice=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'info',{get:function(){return this._info},set:function(e){this._info=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'editor',{get:function(){return this._editor},set:function(e){this._editor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'config',{get:function(){return this._config},set:function(e){this._config=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'configProcessor',{get:function(){return this._configProcessor},set:function(e){this._configProcessor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'user',{get:function(){return this._user},set:function(e){this._user=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'settings',{get:function(){return this._settings},set:function(e){this._settings=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'products',{get:function(){return this._products},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'orders',{get:function(){return this._orders},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'cart',{get:function(){return this._cart},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'themeSettings',{get:function(){return this._themeSettings},set:function(e){this._themeSettings=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,'localization',{get:function(){return this._localization},set:function(e){this._localization=e?Array.isArray(e)?e:[e]:this._localization},enumerable:!1,configurable:!0}),e.prototype.addProduct=function(e){var t=this.products.find(function(t){return t.id===e.id});t||this.products.push(e)},e.prototype.findProductById=function(e){return g(this,void 0,void 0,function(){var t,r;return m(this,function(n){switch(n.label){case 0:return t=this.products.find(function(t){return o.c.stringOrNumberEquals(t.id,e)}),t?[2,t]:[4,this.getExternalProductModel(e)];case 1:return r=n.sent(),null===r?[2,null]:[2,this.productFactoryFromModel(r,this)];}})})},e.prototype.buildOrder=function(e){return u.a.BuildFromModel(this.orderCreateInstance,e)},f([Object(c.b)('Product'),_('design:type',Object)],e.prototype,'productCreateInstance',void 0),f([Object(c.b)('Order'),_('design:type',Object)],e.prototype,'orderCreateInstance',void 0),f([Object(c.b)('PluginSettings'),_('design:type',Object)],e.prototype,'pluginSettingsCreateInstance',void 0),f([Object(c.b)('User'),_('design:type',Object)],e.prototype,'userCreateInstance',void 0),e}()}).call(t,r(2).Promise)},function(e,t,r){'use strict';r.d(t,'a',function(){return o});var o=function(){function e(){}return e.colorNameToHex=function(e){return null===e||void 0===e?null:'undefined'==typeof this.colors[e.toLowerCase()]?null:this.colors[e.toLowerCase()]},e.colors={aliceblue:'#f0f8ff',antiquewhite:'#faebd7',aqua:'#00ffff',aquamarine:'#7fffd4',azure:'#f0ffff',beige:'#f5f5dc',bisque:'#ffe4c4',black:'#000000',blanchedalmond:'#ffebcd',blue:'#0000ff',blueviolet:'#8a2be2',brown:'#a52a2a',burlywood:'#deb887',cadetblue:'#5f9ea0',chartreuse:'#7fff00',chocolate:'#d2691e',coral:'#ff7f50',cornflowerblue:'#6495ed',cornsilk:'#fff8dc',crimson:'#dc143c',cyan:'#00ffff',darkblue:'#00008b',darkcyan:'#008b8b',darkgoldenrod:'#b8860b',darkgray:'#a9a9a9',darkgreen:'#006400',darkkhaki:'#bdb76b',darkmagenta:'#8b008b',darkolivegreen:'#556b2f',darkorange:'#ff8c00',darkorchid:'#9932cc',darkred:'#8b0000',darksalmon:'#e9967a',darkseagreen:'#8fbc8f',darkslateblue:'#483d8b',darkslategray:'#2f4f4f',darkturquoise:'#00ced1',darkviolet:'#9400d3',deeppink:'#ff1493',deepskyblue:'#00bfff',dimgray:'#696969',dodgerblue:'#1e90ff',firebrick:'#b22222',floralwhite:'#fffaf0',forestgreen:'#228b22',fuchsia:'#ff00ff',gainsboro:'#dcdcdc',ghostwhite:'#f8f8ff',gold:'#ffd700',goldenrod:'#daa520',gray:'#808080',green:'#008000',greenyellow:'#adff2f',honeydew:'#f0fff0',hotpink:'#ff69b4',"indianred ":'#cd5c5c',indigo:'#4b0082',ivory:'#fffff0',khaki:'#f0e68c',lavender:'#e6e6fa',lavenderblush:'#fff0f5',lawngreen:'#7cfc00',lemonchiffon:'#fffacd',lightblue:'#add8e6',lightcoral:'#f08080',lightcyan:'#e0ffff',lightgoldenrodyellow:'#fafad2',lightgrey:'#d3d3d3',lightgreen:'#90ee90',lightpink:'#ffb6c1',lightsalmon:'#ffa07a',lightseagreen:'#20b2aa',lightskyblue:'#87cefa',lightslategray:'#778899',lightsteelblue:'#b0c4de',lightyellow:'#ffffe0',lime:'#00ff00',limegreen:'#32cd32',linen:'#faf0e6',magenta:'#ff00ff',maroon:'#800000',mediumaquamarine:'#66cdaa',mediumblue:'#0000cd',mediumorchid:'#ba55d3',mediumpurple:'#9370d8',mediumseagreen:'#3cb371',mediumslateblue:'#7b68ee',mediumspringgreen:'#00fa9a',mediumturquoise:'#48d1cc',mediumvioletred:'#c71585',midnightblue:'#191970',mintcream:'#f5fffa',mistyrose:'#ffe4e1',moccasin:'#ffe4b5',navajowhite:'#ffdead',navy:'#000080',oldlace:'#fdf5e6',olive:'#808000',olivedrab:'#6b8e23',orange:'#ffa500',orangered:'#ff4500',orchid:'#da70d6',palegoldenrod:'#eee8aa',palegreen:'#98fb98',paleturquoise:'#afeeee',palevioletred:'#d87093',papayawhip:'#ffefd5',peachpuff:'#ffdab9',peru:'#cd853f',pink:'#ffc0cb',plum:'#dda0dd',powderblue:'#b0e0e6',purple:'#800080',rebeccapurple:'#663399',red:'#ff0000',rosybrown:'#bc8f8f',royalblue:'#4169e1',saddlebrown:'#8b4513',salmon:'#fa8072',sandybrown:'#f4a460',seagreen:'#2e8b57',seashell:'#fff5ee',sienna:'#a0522d',silver:'#c0c0c0',skyblue:'#87ceeb',slateblue:'#6a5acd',slategray:'#708090',snow:'#fffafa',springgreen:'#00ff7f',steelblue:'#4682b4',tan:'#d2b48c',teal:'#008080',thistle:'#d8bfd8',tomato:'#ff6347',turquoise:'#40e0d0',violet:'#ee82ee',wheat:'#f5deb3',white:'#ffffff',whitesmoke:'#f5f5f5',yellow:'#ffff00',yellowgreen:'#9acd32'},e}()},function(e,t,r){'use strict';r.d(t,'a',function(){return o});var o=function(){function e(){}return e.guid=function(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+'-'+e()+'-'+e()+'-'+e()+'-'+e()+e()+e()},e}()},function(e,t,r){'use strict';(function(e){r.d(t,'a',function(){return d});var o=r(10),n=r(11),a=r(3),i=r(5),p=this&&this.__awaiter||function(t,r,o,n){function a(e){return e instanceof o?e:new o(function(t){t(e)})}return new(o||(o=e))(function(e,o){function i(e){try{s(n.next(e))}catch(t){o(t)}}function p(e){try{s(n['throw'](e))}catch(t){o(t)}}function s(t){t.done?e(t.value):a(t.value).then(i,p)}s((n=n.apply(t,r||[])).next())})},s=this&&this.__generator||function(e,r){function o(e){return function(t){return a([e,t])}}function a(o){if(n)throw new TypeError('Generator is already executing.');for(;d;)try{if(n=1,i&&(p=2&o[0]?i['return']:o[0]?i['throw']||((p=i['return'])&&p.call(i),0):i.next)&&!(p=p.call(i,o[1])).done)return p;switch((i=0,p)&&(o=[2&o[0],p.value]),o[0]){case 0:case 1:p=o;break;case 4:return d.label++,{value:o[1],done:!1};case 5:d.label++,i=o[1],o=[0];continue;case 7:o=d.ops.pop(),d.trys.pop();continue;default:if((p=d.trys,!(p=0<p.length&&p[p.length-1]))&&(6===o[0]||2===o[0])){d=0;continue}if(3===o[0]&&(!p||o[1]>p[0]&&o[1]<p[3])){d.label=o[1];break}if(6===o[0]&&d.label<p[1]){d.label=p[1],p=o;break}if(p&&d.label<p[2]){d.label=p[2],d.ops.push(o);break}p[2]&&d.ops.pop(),d.trys.pop();continue;}o=r.call(e,d)}catch(t){o=[6,t],i=0}finally{n=p=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}var n,i,p,s,d={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},'function'==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s},d=function(){function t(e){var t=this;this._onSubmitting=new n.a,this._onSubmitted=new n.a,this._onPriceChanging=new n.a,this._onPriceChanged=new n.a,this._onSaving=new n.a,this._onSaved=new n.a,this._onError=new n.a,this._owner=e,this._settings=e.settings,this._lineItems=e.orders,this._subscribePriceChange(),this.onSubmitted.subscribe(function(e){!0===t._settings.redirectToCartAfterAdd&&e.lineItems[0].redirectToCart()})}return t.prototype._subscribePriceChange=function(){for(var e,t=0,r=this._lineItems;t<r.length;t++)e=r[t],this.subscribePriceChanges(e)},t.prototype.subscribePriceChanges=function(e){var t=this,r=new o.a;r.old=this.price,e.onPriceChanging.subscribe(function(){return p(t,void 0,void 0,function(){return s(this,function(){return[2,this._onPriceChanging.dispatch(this,r)]})})}),e.onPriceChanged.subscribe(function(){return p(t,void 0,void 0,function(){return s(this,function(){return r.new=this.price,r.newLocalized=this.priceLocalized,[2,this._onPriceChanged.dispatch(this,r)]})})})},Object.defineProperty(t.prototype,'lineItems',{get:function(){return this._lineItems},set:function(e){var t=this.price;this._lineItems.length=0;for(var r,o=0,n=e;o<n.length;o++)r=n[o],this._lineItems.push(r);this._lineItems.setCurrent(0),this._subscribePriceChange(),t!==this.price&&this.updatePrice(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'price',{get:function(){for(var e,t=0,r=0,o=this._lineItems;r<o.length;r++)e=o[r],t+=e.price;return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'priceLocalized',{get:function(){return this.formatPrice(this.price)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'discount',{get:function(){for(var e,t=0,r=0,o=this._lineItems;r<o.length;r++)e=o[r],t+=e.discount;return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'discountLocalized',{get:function(){return this.formatPrice(this.discount)},enumerable:!1,configurable:!0}),t.prototype.formatPrice=function(e){return(null===e||void 0===e)&&(e=this.price),i.c.FormatPrice(e,this._settings.locale,this._settings.currency)},t.prototype.updatePrice=function(e){var t=new o.a;t.old=e,t.new=this.price,t.newLocalized=this.priceLocalized,this._onPriceChanged.dispatch(this,t)},t.prototype.add=function(e,t){void 0===t&&(t=1);var r=this.price,o=this._lineItems.pushMerged({product:e,quantity:t},a.a.PartialSelf,!1);this.subscribePriceChanges(o),r!==this.price&&this.updatePrice(r)},t.prototype.remove=function(e){var t=this.price;this._lineItems.splice(this._lineItems.indexOf(e),1),t!==this.price&&this.updatePrice(t)},t.prototype.submit=function(){return p(this,void 0,void 0,function(){var t,r,o,n,a,i;return s(this,function(p){switch(p.label){case 0:return 0===this._lineItems.length||0===this._lineItems.filter(function(e){return 0<e.quantity}).length?[2,e.resolve([])]:[4,this.preSubmitting()];case 1:return p.sent(),[4,this._onSubmitting.dispatch(this,function(){}())];case 2:p.sent(),t=[],r=0,o=this._lineItems,p.label=3;case 3:return r<o.length?(n=o[r],0===n.quantity)?[3,5]:(i=(a=t).push,[4,n.submit(!0)]):[3,6];case 4:i.apply(a,[p.sent()]),p.label=5;case 5:return r++,[3,3];case 6:return[4,this._onSubmitted.dispatch(this,t)];case 7:return p.sent(),[2,t];}})})},t.prototype.save=function(){return p(this,void 0,void 0,function(){var e,t,r,o,n,a;return s(this,function(i){switch(i.label){case 0:return[4,this._onSaving.dispatch(this,function(){}())];case 1:i.sent(),e=[],t=0,r=this._lineItems,i.label=2;case 2:return t<r.length?(o=r[t],a=(n=e).push,[4,o.save()]):[3,5];case 3:a.apply(n,[i.sent()]),i.label=4;case 4:return t++,[3,2];case 5:return[4,this._onSaved.dispatch(this,e)];case 6:return i.sent(),[2,e];}})})},t.prototype.preSubmitting=function(){return p(this,void 0,void 0,function(){var e,t,r;return s(this,function(o){switch(o.label){case 0:e=0,t=this.lineItems,o.label=1;case 1:return e<t.length?(r=t[e],[4,r.preSubmitting()]):[3,4];case 2:o.sent(),o.label=3;case 3:return e++,[3,1];case 4:return[2];}})})},Object.defineProperty(t.prototype,'onSubmitting',{get:function(){return this._onSubmitting.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onSubmitted',{get:function(){return this._onSubmitted.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onPriceChanging',{get:function(){return this._onPriceChanging.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onPriceChanged',{get:function(){return this._onPriceChanged.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onSaving',{get:function(){return this._onSaving.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onSaved',{get:function(){return this._onSaved.asEvent()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,'onError',{get:function(){return this._onError.asEvent()},enumerable:!1,configurable:!0}),t}()}).call(t,r(2).Promise)},function(e,t,r){'use strict';r.d(t,'a',function(){return o});var o=function(){return function(){this.new=null,this.newLocalized=''}}()},function(e,t,r){'use strict';var o=function(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;for(var n=Array(e),r=0,t=0;t<o;t++)for(var i=arguments[t],a=0,p=i.length;a<p;a++,r++)n[r]=i[a];return n};Object.defineProperty(t,'__esModule',{value:!0}),t.DispatcherWrapper=t.EventListBase=t.DispatcherBase=void 0;var n=r(25),a=r(12),i=function(){function e(){this._wrap=new s(this),this._subscriptions=[]}return Object.defineProperty(e.prototype,'count',{get:function(){return this._subscriptions.length},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){var t=this;return e&&this._subscriptions.push(new a.Subscription(e,!1)),function(){t.unsubscribe(e)}},e.prototype.sub=function(e){return this.subscribe(e)},e.prototype.one=function(e){var t=this;return e&&this._subscriptions.push(new a.Subscription(e,!0)),function(){t.unsubscribe(e)}},e.prototype.has=function(e){return!!e&&this._subscriptions.some(function(t){return t.handler==e})},e.prototype.unsubscribe=function(e){if(e)for(var t=0;t<this._subscriptions.length;t++)if(this._subscriptions[t].handler==e){this._subscriptions.splice(t,1);break}},e.prototype.unsub=function(e){this.unsubscribe(e)},e.prototype._dispatch=function(e,t,r){for(var a=this,i=function(o){var i=new n.EventManagement(function(){return a.unsub(o.handler)}),s=Array.prototype.slice.call(r);if(s.push(i),o.execute(e,t,s),p.cleanup(o),!e&&i.propagationStopped)return'break'},p=this,s=0,d=o(this._subscriptions);s<d.length;s++){var l=d[s],c=i(l);if('break'===c)break}},e.prototype.cleanup=function(e){if(e.isOnce&&e.isExecuted){var t=this._subscriptions.indexOf(e);-1<t&&this._subscriptions.splice(t,1)}},e.prototype.asEvent=function(){return this._wrap},e.prototype.clear=function(){this._subscriptions.splice(0,this._subscriptions.length)},e}();t.DispatcherBase=i;var p=function(){function e(){this._events={}}return e.prototype.get=function(e){var t=this._events[e];return t?t:(t=this.createDispatcher(),this._events[e]=t,t)},e.prototype.remove=function(e){delete this._events[e]},e}();t.EventListBase=p;var s=function(){function e(e){this._subscribe=function(t){return e.subscribe(t)},this._unsubscribe=function(t){return e.unsubscribe(t)},this._one=function(t){return e.one(t)},this._has=function(t){return e.has(t)},this._clear=function(){return e.clear()},this._count=function(){return e.count}}return Object.defineProperty(e.prototype,'count',{get:function(){return this._count()},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){return this._subscribe(e)},e.prototype.sub=function(e){return this.subscribe(e)},e.prototype.unsubscribe=function(e){this._unsubscribe(e)},e.prototype.unsub=function(e){this.unsubscribe(e)},e.prototype.one=function(e){return this._one(e)},e.prototype.has=function(e){return this._has(e)},e.prototype.clear=function(){this._clear()},e}();t.DispatcherWrapper=s},function(e,t){'use strict';Object.defineProperty(t,'__esModule',{value:!0}),t.EventManagement=void 0;var r=function(){function e(e){this.unsub=e,this.propagationStopped=!1}return e.prototype.stopPropagation=function(){this.propagationStopped=!0},e}();t.EventManagement=r},function(e,t,r){'use strict';Object.defineProperty(t,'__esModule',{value:!0});var o=r(27);Object.defineProperty(t,'EventDispatcher',{enumerable:!0,get:function(){return o.EventDispatcher}}),Object.defineProperty(t,'EventHandlingBase',{enumerable:!0,get:function(){return o.EventHandlingBase}}),Object.defineProperty(t,'EventList',{enumerable:!0,get:function(){return o.EventList}}),Object.defineProperty(t,'NonUniformEventList',{enumerable:!0,get:function(){return o.NonUniformEventList}})},function(e,t,r){'use strict';var o=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();Object.defineProperty(t,'__esModule',{value:!0}),t.EventHandlingBase=t.EventList=t.NonUniformEventList=t.EventDispatcher=void 0;var n=r(6),a=function(e){function t(){return e.call(this)||this}return o(t,e),t.prototype.dispatch=function(){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(n.DispatcherBase);t.EventDispatcher=a;var i=function(){function e(){this._events={}}return e.prototype.get=function(e){if(this._events[e])return this._events[e];var t=this.createDispatcher();return this._events[e]=t,t},e.prototype.remove=function(e){delete this._events[e]},e.prototype.createDispatcher=function(){return new a},e}();t.NonUniformEventList=i;var p=function(e){function t(){return e.call(this)||this}return o(t,e),t.prototype.createDispatcher=function(){return new a},t}(n.EventListBase);t.EventList=p;var s=function(){function e(){this._events=new p}return Object.defineProperty(e.prototype,'events',{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e,t){this._events.get(e).subscribe(t)},e.prototype.sub=function(e,t){this.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._events.get(e).unsubscribe(t)},e.prototype.unsub=function(e,t){this.unsubscribe(e,t)},e.prototype.one=function(e,t){this._events.get(e).one(t)},e.prototype.has=function(e,t){return this._events.get(e).has(t)},e}();t.EventHandlingBase=s},function(e,t,r){'use strict';Object.defineProperty(t,'__esModule',{value:!0});var o=r(29);Object.defineProperty(t,'SimpleEventDispatcher',{enumerable:!0,get:function(){return o.SimpleEventDispatcher}}),Object.defineProperty(t,'SimpleEventHandlingBase',{enumerable:!0,get:function(){return o.SimpleEventHandlingBase}}),Object.defineProperty(t,'SimpleEventList',{enumerable:!0,get:function(){return o.SimpleEventList}}),Object.defineProperty(t,'NonUniformSimpleEventList',{enumerable:!0,get:function(){return o.NonUniformSimpleEventList}})},function(e,t,r){'use strict';var o=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();Object.defineProperty(t,'__esModule',{value:!0}),t.SimpleEventHandlingBase=t.SimpleEventList=t.NonUniformSimpleEventList=t.SimpleEventDispatcher=void 0;var n=r(6),a=function(e){function t(){return e.call(this)||this}return o(t,e),t.prototype.dispatch=function(){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(n.DispatcherBa