this.BX=this.BX||{};(function(e,r){"use strict";function t(e,r,t){n(e,r);r.set(e,t)}function n(e,r){if(r.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var i=new WeakMap;var a=new WeakMap;var c=function(){function e(r,n){babelHelpers.classCallCheck(this,e);t(this,i,{writable:true,value:""});t(this,a,{writable:true,value:{}});babelHelpers.classPrivateFieldSet(this,i,r);babelHelpers.classPrivateFieldSet(this,a,n)}babelHelpers.createClass(e,[{key:"getCurrency",value:function e(){return babelHelpers.classPrivateFieldGet(this,i)}},{key:"getFormat",value:function e(){return babelHelpers.classPrivateFieldGet(this,a)}},{key:"setFormat",value:function e(r){babelHelpers.classPrivateFieldSet(this,a,r)}}]);return e}();function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var r=1;r-1&&!i){return}var s=u(u({},this.defaultFormat),n);if(a===-1){this.currencies.push(new c(t,s))}else{this.currencies[a].setFormat(s)}}},{key:"setCurrencies",value:function e(t,n){if(r.Type.isArray(t)){for(var i=0;i-1?this.getCurrencyList()[t].getFormat():false}},{key:"getCurrencyIndex",value:function e(r){var t=this.getCurrencyList();for(var n=0;n-1){this.currencies=BX.util.deleteFromArray(this.currencies,t)}}},{key:"clean",value:function e(){this.currencies=[]}},{key:"currencyFormat",value:function e(t,n,i){var a="";var c=this.getCurrencyFormat(n);if(r.Type.isObject(c)){c.CURRENT_DECIMALS=c.DECIMALS;if(c.HIDE_ZERO==="Y"&&t==parseInt(t,10)){c.CURRENT_DECIMALS=0}a=BX.util.number_format(t,c.CURRENT_DECIMALS,c.DEC_POINT,c.THOUSANDS_SEP);if(i){a=c.FORMAT_STRING.replace(/(^|[^&])#/,"$1"+a)}}return a}},{key:"getPriceControl",value:function e(t,n){var i="";var a=this.getCurrencyFormat(n);if(r.Type.isObject(a)){i=a.FORMAT_STRING.replace(/(^|[^&])#/,"$1"+t.outerHTML)}return i}},{key:"loadCurrencyFormat",value:function e(r){var t=this;return new Promise((function(e,n){var i=t.getCurrencyIndex(r);if(i>-1){e(t.getCurrencyList()[i].getFormat())}else{BX.ajax.runAction("currency.format.get",{data:{currencyId:r}}).then((function(n){var i=n.data;t.setCurrencyFormat(r,i);e(i)}))["catch"]((function(e){n(e.errors)}))}}))}}]);return e}();babelHelpers.defineProperty(l,"currencies",[]);babelHelpers.defineProperty(l,"defaultFormat",{FORMAT_STRING:"#",DEC_POINT:".",THOUSANDS_SEP:" ",DECIMALS:2,HIDE_ZERO:"N"});r.Reflection.namespace("BX.Currency").Core=l;e.CurrencyCore=l})(this.BX.Currency=this.BX.Currency||{},BX); //# sourceMappingURL=currency-core.bundle.map.js