@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
21 lines • 170 kB
JavaScript
var ecommerceDriver=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(n,'a',n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='',t(t.s=216)}([function(e,t,n){'use strict';n.d(t,'a',function(){return i});var r=n(1),o=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if('function'!=typeof n&&null!==n)throw new TypeError('Class extends value '+(n+'')+' is not a constructor or null');e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.id=-1,t.title='',t}return o(t,e),t.prototype.mergeWithPartial=function(t){return e.prototype.mergeWithPartial.call(this,t)},t.matchObjects=function(e,t,n){var r;return function(e){e[e.Ok=0]='Ok',e[e.NotExists=1]='NotExists',e[e.Fail=2]='Fail'}(r||(r={})),n.reduce(function(n,o){var i=Object.keys(o)[0],a=o[i];return n===r.Ok?r.Ok:n===r.NotExists?'undefined'==typeof(t||{})[a]?r.NotExists:e[i]===t[a]?r.Ok:r.Fail:r.Fail},r.NotExists)===r.Ok},t.prototype.matchesPartial=function(e){return this.id===e.id||'undefined'==typeof e.id&&this.title===e.title},t}(r.a)},function(e,t,n){'use strict';n.d(t,'a',function(){return o});var r=n(3),o=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 n=e.BuildFromModel(this,t);return e.typeSafeMerge(this,n)},e.prototype.mergeWithPartial=function(t){return e.typeSafeMerge(this,t)},e.BuildFromModel=function(e,t){if(!t)return null;var n=e.clone();return n.validateModel(t)?(n.init(t),n):null},e.Build=function(t,n,o){switch(o){case r.a.ExternalModel:return e.BuildFromModel(t,n);case r.a.PartialSelf:return e.BuildFromPartialSelf(t,n);default:throw'Unexpected ModelTreatment found!';}},e.BuildFromPartialSelf=function(t,n){return n?e.typeSafeMerge(t,n):null},e.typeSafeMerge=function(t,n){if(typeof n!=typeof t)return n;if(!t)return t;var o=function(e,t){return e===t||null!==e&&'object'==typeof e&&'function'==typeof e.equals&&e.equals(t)};return Object.keys(n||{}).forEach(function(i){if(!!t[i]&&'undefined'!=typeof t[i].pushMerged){var a=t[i];n[i].forEach(function(e){a.pushMerged(e,r.a.PartialSelf)})}else if(Array.isArray(t[i]))n[i].forEach(function(e){var n=JSON.stringify(e);null===t[i].find(function(e){return JSON.stringify(e)===n})&&t[i].push(e)});else if('undefined'!=typeof n[i]&&!o(t[i],n[i])&&('undefined'==typeof t[i]||null===t[i]||'undefined'==typeof t[i].subscribe))switch(!0){case null!==t[i]&&'object'==typeof t[i]:t[i]=e.typeSafeMerge(t[i],n[i]);break;default:t[i]=n[i];}}),t},e}()},function(e,t,n){'use strict';(function(r,o){var i='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},a,p;/*!
* @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(r,o){'object'===i(t)&&'undefined'!=typeof e?e.exports=o():(a=o,p='function'==typeof a?a.call(t,n,t,e):a,!(p!==void 0&&(e.exports=p)))})(void 0,function(){function e(e){var t='undefined'==typeof e?'undefined':i(e);return null!==e&&('object'===t||'function'===t)}function t(e){return'function'==typeof e}function n(){return'undefined'==typeof L?a():function(){L(p)}}function a(){var e=setTimeout;return function(){return e(p,1)}}function p(){for(var e=0;e<T;e+=2){var t=F[e],n=F[e+1];t(n),F[e]=void 0,F[e+1]=void 0}T=0}function s(e,t){var n=this,r=new this.constructor(l);void 0===r[q]&&E(r);var o=n._state;if(o){var i=arguments[o-1];D(function(){return S(o,r,i,n._result)})}else P(n,r,e,t);return r}function d(e){var t=this;if(e&&'object'===('undefined'==typeof e?'undefined':i(e))&&e.constructor===t)return e;var n=new t(l);return h(n,e),n}function l(){}function u(){return new TypeError('You cannot resolve a promise with itself')}function c(){return new TypeError('A promises callback cannot return that same promise.')}function f(e,t,n,r){try{e.call(t,n,r)}catch(t){return t}}function _(e,t,n){D(function(e){var r=!1,o=f(n,t,function(n){r||(r=!0,t===n?m(e,n):h(e,n))},function(t){r||(r=!0,v(e,t))},'Settle: '+(e._label||' unknown promise'));!r&&o&&(r=!0,v(e,o))},e)}function g(e,t){t._state===H?m(e,t._result):t._state===K?v(e,t._result):P(t,void 0,function(t){return h(e,t)},function(t){return v(e,t)})}function y(e,n,r){n.constructor===e.constructor&&r===s&&n.constructor.resolve===d?g(e,n):void 0===r?m(e,n):t(r)?_(e,n,r):m(e,n)}function h(t,n){if(t===n)v(t,u());else if(e(n)){var r;try{r=n.then}catch(e){return void v(t,e)}y(t,n,r)}else m(t,n)}function b(e){e._onerror&&e._onerror(e._result),x(e)}function m(e,t){e._state!==V||(e._result=t,e._state=H,0!==e._subscribers.length&&D(x,e))}function v(e,t){e._state!==V||(e._state=K,e._result=t,D(b,e))}function P(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+H]=n,o[i+K]=r,0===i&&e._state&&D(x,e)}function x(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,a=e._result,p=0;p<t.length;p+=3)r=t[p],o=t[p+n],r?S(n,r,o,a):o(a);e._subscribers.length=0}}function S(e,n,r,o){var i=t(r),a=!0,p,s;if(i){try{p=r(o)}catch(t){a=!1,s=t}if(n===p)return void v(n,c())}else p=o;n._state!==V||(i&&a?h(n,p):!1==a?v(n,s):e===H?m(n,p):e===K&&v(n,p))}function k(t,e){try{e(function(e){h(t,e)},function(e){v(t,e)})}catch(n){v(t,n)}}function w(){return G++}function E(e){e[q]=G++,e._state=void 0,e._result=void 0,e._subscribers=[]}function O(){return new Error('Array Methods must be provided an Array')}function I(){throw new TypeError('You must pass a resolver function as the first argument to the promise constructor')}function C(){throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.')}var j=Array.isArray?Array.isArray:function(e){return'[object Array]'===Object.prototype.toString.call(e)};var A=j,T=0,L=void 0,U=void 0,D=function(e,t){F[T]=e,F[T+1]=t,T+=2,2==T&&(U?U(p):W())},M='undefined'==typeof window?void 0:window,B=M||{},N=B.MutationObserver||B.WebKitMutationObserver,R='undefined'==typeof self&&'undefined'!=typeof r&&'[object process]'==={}.toString.call(r),z='undefined'!=typeof Uint8ClampedArray&&'undefined'!=typeof importScripts&&'undefined'!=typeof MessageChannel,F=Array(1e3),W=void 0;W=R?function(){return function(){return r.nextTick(p)}}():N?function(){var e=0,t=new N(p),n=document.createTextNode('');return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}():z?function(){var e=new MessageChannel;return e.port1.onmessage=p,function(){return e.port2.postMessage(0)}}():void 0!==M||0?a():function(){try{var e=Function('return this')().require('vertx');return L=e.runOnLoop||e.runOnContext,n()}catch(t){return a()}}();var q=Math.random().toString(36).substring(2),V=void 0,H=1,K=2,G=0,$=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(l),this.promise[q]||E(this.promise),A(t)?(this.length=t.length,this._remaining=t.length,this._result=Array(this.length),0===this.length?m(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&m(this.promise,this._result))):v(this.promise,O())}return e.prototype._enumerate=function(e){for(var t=0;this._state===V&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===d){var o=void 0,i=void 0,a=!1;try{o=e.then}catch(t){a=!0,i=t}if(o===s&&e._state!==V)this._settledAt(e._state,t,e._result);else if('function'!=typeof o)this._remaining--,this._result[t]=e;else if(n===J){var p=new n(l);a?v(p,i):y(p,e,o),this._willSettleAt(p,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===V&&(this._remaining--,e===K?v(r,n):this._result[t]=n),0===this._remaining&&m(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;P(e,void 0,function(e){return n._settledAt(H,t,e)},function(e){return n._settledAt(K,t,e)})},e}(),J=function(){function e(t){this[q]=w(),this._result=this._state=void 0,this._subscribers=[],l!==t&&('function'!=typeof t&&I(),this instanceof e?k(this,t):C())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var n=this,r=n.constructor;return t(e)?n.then(function(t){return r.resolve(e()).then(function(){return t})},function(t){return r.resolve(e()).then(function(){throw t})}):n.then(e,e)},e}();return J.prototype.then=s,J.all=function(e){return new $(this,e).promise},J.race=function(e){var t=this;return A(e)?new t(function(n,r){for(var o=e.length,a=0;a<o;a++)t.resolve(e[a]).then(n,r)}):new t(function(e,t){return t(new TypeError('You must pass an array to race.'))})},J.resolve=d,J.reject=function(e){var t=this,n=new t(l);return v(n,e),n},J._setScheduler=function(e){U=e},J._setAsap=function(e){D=e},J._asap=D,J.polyfill=function(){var e;if('undefined'!=typeof o)e=o;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 n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(t){}if('[object Promise]'===n&&!t.cast)return}e.Promise=J},J.Promise=J,J})}).call(t,n(18),n(15))},function(e,t,n){'use strict';n.d(t,'a',function(){return s}),n.d(t,'b',function(){return d});var r=n(4),o=n(1),i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if('function'!=typeof n&&null!==n)throw new TypeError('Class extends value '+(n+'')+' is not a constructor or null');e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__decorate||function(e,t,n,o){var a=arguments.length,p=3>a?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o,r;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)p=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;0<=s;s--)(r=e[s])&&(p=(3>a?r(p):3<a?r(t,n,p):r(t,n))||p);return 3<a&&p&&Object.defineProperty(t,n,p),p},p=this&&this.__metadata||function(e,t){if('object'==typeof Reflect&&'function'==typeof Reflect.metadata)return Reflect.metadata(e,t)},s;(function(e){e[e.ExternalModel=0]='ExternalModel',e[e.PartialSelf=1]='PartialSelf'})(s||(s={}));var d=function(e){function t(t,n){void 0===n&&(n=null);var r=e.call(this)||this;return r._owner=null,r.current=null,r._itemCreatorFactory=t,r._owner=n,r}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,n){void 0===t&&(t=s.PartialSelf),void 0===n&&(n=!0);var r=this.findIndex(function(n){return t===s.ExternalModel?n.matchesModel(e):n.matchesPartial(e)});if(-1<r)return this[r]=t===s.ExternalModel?this[r].mergeWithModel(e):this[r].mergeWithPartial(e),this.moveCursorTo(this[r]),this[r];var i=o.a.Build(this._itemCreatorFactory(e,t),e,t);return void 0!==i.owner&&(i.owner=this._owner),n?this.pushAndMoveCursor(i):(this.push(i),i)},t.prototype.initByMerged=function(e,t){this.splice(0,this.length);var n=this;'undefined'==typeof e&&(e=[]),e.forEach(function(e){n.pushAndMoveCursor(n._itemCreatorFactory(e,t))})},t=a([Object(r.d)(),p('design:paramtypes',[Function,Object])],t),t}(Array)},function(e,t,n){'use strict';t.d=function(){return function(e){return function(t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.apply(this,n)||this;return Object.setPrototypeOf(o,e.prototype),o}return i(n,t),n}(e)}},t.a=function(e){return function(){for(var t in a={},e)e.hasOwnProperty(t)&&(a[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,n){Object.defineProperty(t,n,{get:function(){return a[e]()}})}},t.c=function(e){return function(t){return function(n){function a(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var p=this;try{p=n.apply(this,i)||this}catch(t){}return p.info=new o.a(r.a,e),window.Aurigma=window.Aurigma||{},window.Aurigma.EcommerceDriver=p.info,Object.setPrototypeOf(p,t.prototype),p}return i(a,n),a}(t)}};var r=n(32),o=n(33),i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if('function'!=typeof n&&null!==n)throw new TypeError('Class extends value '+(n+'')+' is not a constructor or null');e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a={}},function(e,t,n){'use strict';var r=n(20);n.d(t,'a',function(){return r.a});var o=n(21);n.d(t,'b',function(){return o.a});var i=n(7);n.d(t,'c',function(){return i.a});n(17)},function(e,t,n){'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 r=n(24);Object.defineProperty(t,'DispatcherBase',{enumerable:!0,get:function(){return r.DispatcherBase}}),Object.defineProperty(t,'DispatcherWrapper',{enumerable:!0,get:function(){return r.DispatcherWrapper}}),Object.defineProperty(t,'EventListBase',{enumerable:!0,get:function(){return r.EventListBase}});var o=n(12);Object.defineProperty(t,'Subscription',{enumerable:!0,get:function(){return o.Subscription}})},function(e,t,n){'use strict';(function(e){n.d(t,'a',function(){return r});var r=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 n in e)e.hasOwnProperty(n)&&(t[n]=this.clone(e[n]));return t},t.JSON_to_URLEncoded=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n=[]),n=n||[],'object'==typeof e)for(var r in e)e.hasOwnProperty(r)&&this.JSON_to_URLEncoded(e[r],t?t+'['+r+']':r,n);else n.push(t+'='+encodeURIComponent(e));return n.join('&')},t.FormatPrice=function(e,t,n){if(null===e||void 0===e)return null;var r='number'==typeof e?e:parseFloat(e.replace(',','.').replace(/[^0-9\.]+/g,''));return r.toLocaleString(t,{style:'currency',currency:n})},t.loadJsonJsonp=function(t,n){return void 0===n&&(n={}),new e(function(e,r){var o='jsonp_callback_'+Math.round(1e5*Math.random());window[o]=function(t){delete window[o],document.body.removeChild(i);try{var n=JSON.parse(t);e(n)}catch(t){e(null)}},n&&Object.keys(n).forEach(function(e){t+=(0<=t.indexOf('?')?'&':'?')+e+'='+n[e]});var i=document.createElement('script');i.src=t+(0<=t.indexOf('?')?'&':'?')+'callback='+o,i.onerror=function(){r(arguments)},document.body.appendChild(i)})},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,n(2).Promise)},function(e,t,n){'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 r=n(6);Object.defineProperty(t,'DispatcherBase',{enumerable:!0,get:function(){return r.DispatcherBase}}),Object.defineProperty(t,'DispatcherWrapper',{enumerable:!0,get:function(){return r.DispatcherWrapper}}),Object.defineProperty(t,'EventListBase',{enumerable:!0,get:function(){return r.EventListBase}}),Object.defineProperty(t,'Subscription',{enumerable:!0,get:function(){return r.Subscription}});var o=n(26);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}});var i=n(28);Object.defineProperty(t,'SimpleEventDispatcher',{enumerable:!0,get:function(){return i.SimpleEventDispatcher}}),Object.defineProperty(t,'SimpleEventHandlingBase',{enumerable:!0,get:function(){return i.SimpleEventHandlingBase}}),Object.defineProperty(t,'SimpleEventList',{enumerable:!0,get:function(){return i.SimpleEventList}}),Object.defineProperty(t,'NonUniformSimpleEventList',{enumerable:!0,get:function(){return i.NonUniformSimpleEventList}});var a=n(30);Object.defineProperty(t,'SignalDispatcher',{enumerable:!0,get:function(){return a.SignalDispatcher}}),Object.defineProperty(t,'SignalHandlingBase',{enumerable:!0,get:function(){return a.SignalHandlingBase}}),Object.defineProperty(t,'SignalList',{enumerable:!0,get:function(){return a.SignalList}})},function(e,t,n){'use strict';n.d(t,'a',function(){return r});var r=function(){function e(e,t,n,r){this.err=e,this.response=t,this.body=n,this.readyState=r,this.isFromCart=!1}return e.empty=function(){return new e(null,null,'')},e}()},function(e,t,n){'use strict';n.d(t,'a',function(){return i});var r=n(23),o=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if('function'!=typeof n&&null!==n)throw new TypeError('Class extends value '+(n+'')+' is not a constructor or null');e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(r.a)},function(e,t,n){'use strict';(function(e){n.d(t,'a',function(){return a});var r=n(8),o=n.n(r),i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if('function'!=typeof n&&null!==n)throw new TypeError('Class extends value '+(n+'')+' is not a constructor or null');e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.callbacks=[],e}return i(n,t),n.prototype.subscribe=function(e){var t=this;return e&&this.callbacks.push(new r.Subscription(e,!1)),function(){t.unsubscribe(e)}},n.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}},n.prototype.dispatch=function(t,n){var r=this,o=this.callbacks.map(function(e){return r.executeCallback(e,t,n)});return e.all(o).then(function(){})},n.prototype.executeCallback=function(t,n,r){var o=t.handler.apply(this,[n,r]);return this.isPromise(o)?o:e.resolve()},n.prototype.isPromise=function(e){return!!e&&'function'==typeof e.then},n}(r.EventDispatcher)}).call(t,n(2).Promise)},function(e,t){'use strict';Object.defineProperty(t,'__esModule',{value:!0}),t.Subscription=void 0;var n=function(){function e(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}return e.prototype.execute=function(e,t,n){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var r=this.handler;e?setTimeout(function(){r.apply(t,n)},1):r.apply(t,n)}},e}();t.Subscription=n},function(e,t,n){'use strict';n.d(t,'c',function(){return o}),n.d(t,'b',function(){return i}),n.d(t,'a',function(){return a});var r;(function(e){e.Preselect='Preselect',e.Filter='Filter'})(r||(r={}));var o;(function(e){e[e.Template=1]='Template',e[e.OptionBasedProduct=2]='OptionBasedProduct'})(o||(o={}));var i;(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'})(i||(i={}));var a=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=o.Template,this.optionBasedProductInfo=void 0,this.ecommerceSystemType=i.Custom}}()},function(e,t,n){'use strict';n.d(t,'a',function(){return s});var r=n(4),o=n(9),i=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if('function'!=typeof n&&null!==n)throw new TypeError('Class extends value '+(n+'')+' is not a constructor or null');e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=this&&this.__decorate||function(e,t,n,o){var a=arguments.length,p=3>a?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o,r;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)p=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;0<=s;s--)(r=e[s])&&(p=(3>a?r(p):3<a?r(t,n,p):r(t,n))||p);return 3<a&&p&&Object.defineProperty(t,n,p),p},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,n){var r=e.call(this,t)||this;return'undefined'!=typeof n&&(r.body=n.body,r.response=n.response),r}return i(t,e),t=a([Object(r.d)(),p('design:paramtypes',[String,o.a])],t),t}(Error)},function(e){'use strict';var t='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},n;n=function(){return this}();try{n=n||Function('return this')()||(1,eval)('this')}catch(r){'object'===('undefined'==typeof window?'undefined':t(window))&&(n=window)}e.exports=n},function(e,t,n){'use strict';n.d(t,'a',function(){return r});var r=function(){return function(e,t){this.option=e,this.value=[],t&&(t instanceof Array?this.value=t:this.value.push(t))}}()},function(e,t,n){'use strict';n.d(t,'a',function(){return r});var r=function(){function e(){}return e.postByForm=function(t,n,r){void 0===r&&(r='post');var o=document.createElement('form');for(var i in o.method=r,o.action=t,o.enctype='multipart/form-data',n)if(n.hasOwnProperty(i))if(!!n[i]&&'object'==typeof n[i])e.genInput(n[i],o,i);else{var a=document.createElement('input');a.type='hidden',a.name=i,a.value=n[i]||'',o.appendChild(a)}document.body.appendChild(o),o.submit()},e.genInput=function(t,n,r){Object.keys(t).forEach(function(o){var i=r?r+'['+o+']':o;if(!!t[o]&&'object'==typeof t[o])t[o]&&e.genInput(t[o],n,i);else{var a=document.createElement('input');a.type='hidden',a.name=i,a.value=t[o]||'',n.appendChild(a)}})},e}()},function(e){'use strict';function t(){throw new Error('setTimeout has not been defined')}function n(){throw new Error('clearTimeout has not been defined')}function r(e){if(l===setTimeout)return setTimeout(e,0);if((l===t||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function o(e){if(u===clearTimeout)return clearTimeout(e);if((u===n||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{return u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}function i(){f&&g&&(f=!1,g.length?c=g.concat(c):_=-1,c.length&&a())}function a(){if(!f){var e=r(i);f=!0;for(var t=c.length;t;){for(g=c,c=[];++_<t;)g&&g[_].run();_=-1,t=c.length}g=null,f=!1,o(e)}}function p(e,t){this.fun=e,this.array=t}function s(){}var d=e.exports={},l,u;(function(){try{l='function'==typeof setTimeout?setTimeout:t}catch(n){l=t}try{u='function'==typeof clearTimeout?clearTimeout:n}catch(t){u=n}})();var c=[],f=!1,_=-1,g;d.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||f||r(a)},p.prototype.run=function(){this.fun.apply(null,this.array)},d.title='browser',d.browser=!0,d.env={},d.argv=[],d.version='',d.versions={},d.on=s,d.addListener=s,d.once=s,d.off=s,d.removeListener=s,d.removeAllListeners=s,d.emit=s,d.prependListener=s,d.prependOnceListener=s,d.listeners=function(){return[]},d.binding=function(){throw new Error('process.binding is not supported')},d.cwd=function(){return'/'},d.chdir=function(){throw new Error('process.chdir is not supported')},d.umask=function(){return 0}},function(e,t,n){'use strict';(function(e){n.d(t,'a',function(){return b});var r=n(5),o=n(22),i=n(34),a=n.n(i),p=n(35),s=n.n(p),d=n(13),l=n(36),u=n(4),c=n(1),f=n(3),_=this&&this.__decorate||function(e,t,n,o){var a=arguments.length,p=3>a?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o,r;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)p=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;0<=s;s--)(r=e[s])&&(p=(3>a?r(p):3<a?r(t,n,p):r(t,n))||p);return 3<a&&p&&Object.defineProperty(t,n,p),p},g=this&&this.__metadata||function(e,t){if('object'==typeof Reflect&&'function'==typeof Reflect.metadata)return Reflect.metadata(e,t)},y=this&&this.__awaiter||function(t,n,r,o){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=e))(function(e,r){function a(e){try{s(o.next(e))}catch(t){r(t)}}function p(e){try{s(o['throw'](e))}catch(t){r(t)}}function s(t){t.done?e(t.value):i(t.value).then(a,p)}s((o=o.apply(t,n||[])).next())})},h=this&&this.__generator||function(e,n){function r(e){return function(t){return o([e,t])}}function o(r){if(a)throw new TypeError('Generator is already executing.');for(;i;)try{if(a=1,p&&(s=2&r[0]?p['return']:r[0]?p['throw']||((s=p['return'])&&s.call(p),0):p.next)&&!(s=s.call(p,r[1])).done)return s;switch((p=0,s)&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,p=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if((s=i.trys,!(s=0<s.length&&s[s.length-1]))&&(6===r[0]||2===r[0])){i=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(6===r[0]&&i.label<s[1]){i.label=s[1],s=r;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(r);break}s[2]&&i.ops.pop(),i.trys.pop();continue;}r=n.call(e,i)}catch(t){r=[6,t],p=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a,p,s,d;return d={next:r(0),throw:r(1),return:r(2)},'function'==typeof Symbol&&(d[Symbol.iterator]=function(){return this}),d},b=function(){function e(){var e=this;this._products=new f.b(function(){return e.productCreateInstance},this),this._orders=new f.b(function(){return e.orderCreateInstance},this),this._localization=[],this._additionalProductsPromises=[],this.findProduct={byId:function(t){return y(e,void 0,void 0,function(){return h(this,function(){return[2,this.findProductById(t)]})})}}}return e.prototype.productFactoryFromModel=function(e,t){var n=c.a.BuildFromModel(this.productCreateInstance,e);return n?(n.owner=t,n):null},e.prototype.productFactoryFromPartialSelf=function(e,t){var n=c.a.BuildFromPartialSelf(this.productCreateInstance,e);return n?(n.owner=t,n):null},e.prototype.init=function(e,t,n,r,i,a,p,s,u,f){return y(this,void 0,void 0,function(){var _,g,y,b,m,v,P;return h(this,function(){for(this.backOffice=s||new d.a,this.settings=c.a.BuildFromModel(this.pluginSettingsCreateInstance,r),this.editor=t,u&&(this.themeSettings=u),this.localization=f,Array.isArray(e)||(e=[e]),(_=0,g=e);_<g.length;_++)y=g[_],this.products.push(this.productFactoryFromModel(y,this));if(this.products.setCurrent(0),i=i||{},Object.assign(i,{quantity:a,product:this.products.current,settings:this.settings}),b=this.orders.pushAndMoveCursor(this.buildOrder(i)),b.driver=this,this._cart=new o.a(this),this.user=c.a.BuildFromModel(this.userCreateInstance,p),this.config=n.config||n,this._configProcessor=new l.a(this),t&&'multistep'!==t.editorType&&(this.config=this.configProcessor.processConfig(n)),n.additionalProducts)for(m=0,v=n.additionalProducts;m<v.length;m++)P=v[m],this._additionalProductsPromises.push(this.findProduct.byId(P.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 y(this,void 0,void 0,function(){var t,n;return h(this,function(o){switch(o.label){case 0:return t=this.products.find(function(t){return r.c.stringOrNumberEquals(t.id,e)}),t?[2,t]:[4,this.getExternalProductModel(e)];case 1:return n=o.sent(),null===n?[2,null]:[2,this.productFactoryFromModel(n,this)];}})})},e.prototype.buildOrder=function(e){return c.a.BuildFromModel(this.orderCreateInstance,e)},_([Object(u.b)('Product'),g('design:type',Object)],e.prototype,'productCreateInstance',void 0),_([Object(u.b)('Order'),g('design:type',Object)],e.prototype,'orderCreateInstance',void 0),_([Object(u.b)('PluginSettings'),g('design:type',Object)],e.prototype,'pluginSettingsCreateInstance',void 0),_([Object(u.b)('User'),g('design:type',Object)],e.prototype,'userCreateInstance',void 0),e}()}).call(t,n(2).Promise)},function(e,t,n){'use strict';n.d(t,'a',function(){return r});var r=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,n){'use strict';n.d(t,'a',function(){return r});var r=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,n){'use strict';(function(e){n.d(t,'a',function(){return d});var r=n(10),o=n(11),i=n(3),a=n(5),p=this&&this.__awaiter||function(t,n,r,o){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=e))(function(e,r){function a(e){try{s(o.next(e))}catch(t){r(t)}}function p(e){try{s(o['throw'](e))}catch(t){r(t)}}function s(t){t.done?e(t.value):i(t.value).then(a,p)}s((o=o.apply(t,n||[])).next())})},s=this&&this.__generator||function(e,n){function r(e){return function(t){return o([e,t])}}function o(r){if(a)throw new TypeError('Generator is already executing.');for(;i;)try{if(a=1,p&&(s=2&r[0]?p['return']:r[0]?p['throw']||((s=p['return'])&&s.call(p),0):p.next)&&!(s=s.call(p,r[1])).done)return s;switch((p=0,s)&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,p=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if((s=i.trys,!(s=0<s.length&&s[s.length-1]))&&(6===r[0]||2===r[0])){i=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(6===r[0]&&i.label<s[1]){i.label=s[1],s=r;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(r);break}s[2]&&i.ops.pop(),i.trys.pop();continue;}r=n.call(e,i)}catch(t){r=[6,t],p=0}finally{a=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a,p,s,d;return d={next:r(0),throw:r(1),return:r(2)},'function'==typeof Symbol&&(d[Symbol.iterator]=function(){return this}),d},d=function(){function t(e){var t=this;this._onSubmitting=new o.a,this._onSubmitted=new o.a,this._onPriceChanging=new o.a,this._onPriceChanged=new o.a,this._onSaving=new o.a,this._onSaved=new o.a,this._onError=new o.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=0,t=this._lineItems,n;e<t.length;e++)n=t[e],this.subscribePriceChanges(n)},t.prototype.subscribePriceChanges=function(e){var t=this,n=new r.a;n.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,n)]})})}),e.onPriceChanged.subscribe(function(){return p(t,void 0,void 0,function(){return s(this,function(){return n.new=this.price,n.newLocalized=this.priceLocalized,[2,this._onPriceChanged.dispatch(this,n)]})})})},Object.defineProperty(t.prototype,'lineItems',{get:function(){return this._lineItems},set:function(e){var t=this.price;this._lineItems.length=0;for(var n=0,r=e,o;n<r.length;n++)o=r[n],this._lineItems.push(o);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=0,t=0,n=this._lineItems,r;t<n.length;t++)r=n[t],e+=r.price;return e},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=0,t=0,n=this._lineItems,r;t<n.length;t++)r=n[t],e+=r.discount;return e},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),a.c.FormatPrice(e,this._settings.locale,this._settings.currency)},t.prototype.updatePrice=function(e){var t=new r.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 n=this.price,r=this._lineItems.pushMerged({product:e,quantity:t},i.a.PartialSelf,!1);this.subscribePriceChanges(r),n!==this.price&&this.updatePrice(n)},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,n,r,o,i,a;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=[],n=0,r=this._lineItems,p.label=3;case 3:return n<r.length?(o=r[n],0===o.quantity)?[3,5]:(a=(i=t).push,[4,o.submit(!0)]):[3,6];case 4:a.apply(i,[p.sent()]),p.label=5;case 5:return n++,[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,n,r,o,i;return s(this,function(a){switch(a.label){case 0:return[4,this._onSaving.dispatch(this,function(){}())];case 1:a.sent(),e=[],t=0,n=this._lineItems,a.label=2;case 2:return t<n.length?(r=n[t],i=(o=e).push,[4,r.save()]):[3,5];case 3:i.apply(o,[a.sent()]),a.label=4;case 4:return t++,[3,2];case 5:return[4,this._onSaved.dispatch(this,e)];case 6:return a.sent(),[2,e];}})})},t.prototype.preSubmitting=function(){return p(this,void 0,void 0,function(){var e,t,n;return s(this,function(r){switch(r.label){case 0:e=0,t=this.lineItems,r.label=1;case 1:return e<t.length?(n=t[e],[4,n.preSubmitting()]):[3,4];case 2:r.sent(),r.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,n(2).Promise)},function(e,t,n){'use strict';n.d(t,'a',function(){return r});var r=function(){return function(){this.new=null,this.newLocalized=''}}()},function(e,t,n){'use strict';var r=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var o=Array(e),r=0,t=0;t<n;t++)for(var i=arguments[t],a=0,p=i.length;a<p;a++,r++)o[r]=i[a];return o};Object.defineProperty(t,'__esModule',{value:!0}),t.DispatcherWrapper=t.EventListBase=t.DispatcherBase=void 0;var o=n(25),i=n(12),a=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 i.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 i.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,n){for(var i=this,a=function(r){var a=new o.EventManagement(function(){return i.unsub(r.handler)}),s=Array.prototype.slice.call(n);if(s.push(a),r.execute(e,t,s),p.cleanup(r),!e&&a.propagationStopped)return'break'},p=this,s=0,d=r(this._subscriptions);s<d.length;s++){var l=d[s],u=a(l);if('break'===u)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=a;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 n=function(){function e(e){this.unsub=e,this.propagationStopped=!1}return e.prototype.stopPropagation=function(){this.propagationStopped=!0},e}();t.EventManagement=n},function(e,t,n){'use strict';Object.defineProperty(t,'__esModule',{value:!0});var r=n(27);Object.defineProperty(t,'EventDispatcher',{enumerable:!0,get:function(){return r.EventDispatcher}}),Object.defineProperty(t,'EventHandlingBase',{enumerable:!0,get:function(){return r.EventHandlingBase}}),Object.defineProperty(t,'EventList',{enumerable:!0,get:function(){return r.EventList}}),Object.defineProperty(t,'NonUniformEventList',{enumerable:!0,get:function(){return r.NonUniformEventList}})},function(e,t,n){'use strict';var r=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,'__esModule',{value:!0}),t.EventHandlingBase=t.EventList=t.NonUniformEventList=t.EventDispatcher=void 0;var o=n(6),i=function(e){function t(){return e.call(this)||this}return r(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}(o.DispatcherBase);t.EventDispatcher=i;var a=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 i},e}();t.NonUniformEventList=a;var p=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.createDispatcher=function(){return new i},t}(o.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,n){'use strict';Object.defineProperty(t,'__esModule',{value:!0});var r=n(29);Object.defineProperty(t,'SimpleEventDispatcher',{enumerable:!0,get:function(){return r.SimpleEventDispatcher}}),Object.defineProperty(t,'SimpleEventHandlingBase',{enumerable:!0,get:function(){return r.SimpleEventHandlingBase}}),Object.defineProperty(t,'SimpleEventList',{enumerable:!0,get:function(){return r.SimpleEventList}}),Object.defineProperty(t,'NonUniformSimpleEventList',{enumerable:!0,get:function(){return r.NonUniformSimpleEventList}})},function(e,t,n){'use strict';var r=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,'__esModule',{value:!0}),t.SimpleEventHandlingBase=t.SimpleEventList=t.NonUniformSimpleEventList=t.SimpleEventDispatcher=void 0;var o=n(6),i=function(e){function t(){return e.call(this)||this}return r(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}(o.DispatcherBa