; /* Start:"a:4:{s:4:"full";s:103:"/bitrix/components/bitrix/sale.location.selector.search/templates/.default/script.min.js?16896756187796";s:6:"source";s:84:"/bitrix/components/bitrix/sale.location.selector.search/templates/.default/script.js";s:3:"min";s:88:"/bitrix/components/bitrix/sale.location.selector.search/templates/.default/script.min.js";s:3:"map";s:88:"/bitrix/components/bitrix/sale.location.selector.search/templates/.default/script.map.js";}"*/ BX.namespace("BX.Sale.component.location.selector");if(typeof BX.Sale.component.location.selector.search=="undefined"&&typeof BX.ui!="undefined"&&typeof BX.ui.widget!="undefined"){BX.Sale.component.location.selector.search=function(e,t){this.parentConstruct(BX.Sale.component.location.selector.search,e);BX.merge(this,{opts:{usePagingOnScroll:true,pageSize:10,arrowScrollAdditional:2,pageUpWardOffset:3,provideLinkBy:"id",bindEvents:{"after-input-value-modify":function(){this.ctrls.fullRoute.value=""},"after-select-item":function(e){var t=this.opts;var i=this.vars.cache.nodes[e];var s=i.DISPLAY;if(typeof i.PATH=="object"){for(var o=0;o0&&this.opts.callback in window)window[this.opts.callback].apply(this,[e,this])},"after-deselect-item":function(){this.ctrls.fullRoute.value="";this.ctrls.inputs.fake.setAttribute("title","")},"before-render-variant":function(e){if(e.PATH.length>0){var t="";for(var i=0;i0){if(this.opts.provideLinkBy=="id")this.setValueByLocationId(this.ctrls.inputs.origin.value);else this.setValueByLocationCode(this.ctrls.inputs.origin.value)}},addItem2Cache:function(e){this.vars.cache.nodes[e.VALUE]=e;this.vars.cache.nodesByCode[e.CODE]=e},refineRequest:function(e){var t={};if(typeof e["QUERY"]!="undefined")t["=PHRASE"]=e.QUERY;if(typeof e["VALUE"]!="undefined")t["=ID"]=e.VALUE;if(typeof e["CODE"]!="undefined")t["=CODE"]=e.CODE;if(typeof this.opts.query.BEHAVIOUR.LANGUAGE_ID!="undefined")t["=NAME.LANGUAGE_ID"]=this.opts.query.BEHAVIOUR.LANGUAGE_ID;if(BX.type.isNotEmptyString(this.opts.query.FILTER.SITE_ID))t["=SITE_ID"]=this.opts.query.FILTER.SITE_ID;var i={select:{VALUE:"ID",DISPLAY:"NAME.NAME",1:"CODE",2:"TYPE_ID"},additionals:{1:"PATH"},filter:t,version:"2"};if(typeof e["order"]!="undefined")i["order"]=e.order;return i},refineResponce:function(e,t){if(typeof e.ETC.PATH_ITEMS!="undefined"){for(var i in e.ETC.PATH_ITEMS){if(BX.type.isNotEmptyString(e.ETC.PATH_ITEMS[i].DISPLAY))this.vars.cache.path[i]=e.ETC.PATH_ITEMS[i].DISPLAY}for(var i in e.ITEMS){var s=e.ITEMS[i];if(typeof s.PATH!="undefined"){var o=BX.clone(s.PATH);for(var n in s.PATH){var a=s.PATH[n];o.shift();if(typeof this.vars.cache.nodes[a]=="undefined"&&typeof e.ETC.PATH_ITEMS[a]!="undefined"){var l=BX.clone(e.ETC.PATH_ITEMS[a]);l.PATH=BX.clone(o);this.vars.cache.nodes[a]=l}}}}}return e.ITEMS},refineItems:function(e){return e},refineItemDataForTemplate:function(e){return e},getSelectorValue:function(e){if(this.opts.provideLinkBy=="id")return e;if(typeof this.vars.cache.nodes[e]!="undefined")return this.vars.cache.nodes[e].CODE;else return""},whenLoaderToggle:function(e){BX[e?"show":"hide"](this.ctrls.loader)}})} /* End */ ; ; /* Start:"a:4:{s:4:"full";s:79:"/bitrix/components/ipol/ipol.dpdPickup/templates/order/script.js?16914097072688";s:6:"source";s:64:"/bitrix/components/ipol/ipol.dpdPickup/templates/order/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ BX.ready(function() { var popupContent = BX('DPD_pvz_popup'); popupContent.style.display = 'block'; var popup = new BX.PopupWindow('DPD_pvz_popup_window', null, { content: popupContent, closeIcon: { right: "20px", top: "10px" }, zIndex: 0, offsetLeft: 0, offsetTop: 0, draggable: { restrict: false }, width: Math.min(900, window.innerWidth - 80), }); BX.bindDelegate(document, 'click', {className: 'DPD_openTerminalSelect'}, function(event) { var componentNode = BX('DPD_pvz'); var componentParams = eval('('+ this.dataset.componentParams +')'); var componentResult = eval('('+ this.dataset.componentResult +')'); var terminalCode = BX('IPOLH_DPD_TERMINAL').value; popup.show(); componentNode.DpdPickupMap.liveReload(componentParams, componentResult); componentNode.DpdPickupMap.highlightTerminal({code: terminalCode, highlightIcon: true}); saveTerminalInfo(terminalCode); return BX.PreventDefault(event) }); BX.addCustomEvent(BX('DPD_pvz'), 'dpdPickup:selectTerminal', function (terminalCode, needUpdate) { document.querySelectorAll('#IPOLH_DPD_TERMINAL').forEach((element) => element.value = terminalCode); saveTerminalInfo(terminalCode); if (needUpdate !== false) { (typeof window.submitForm == "function") && setTimeout(submitForm, 500); (typeof window.submitFormProxy == "function") && setTimeout(submitFormProxy, 500); popup.close(); } }); function saveTerminalInfo(terminalCode) { var componentNode = BX('DPD_pvz') var terminalFieldId = BX('IPOLH_DPD_TERMINAL_FIELD_ID').value; var terminalFieldCode = BX('IPOLH_DPD_TERMINAL_FIELD_CODE').value; var terminalInfo = componentNode.querySelector('.DPD_terminalSelect[data-terminal-code="'+ terminalCode +'"]'); var terminalName = terminalInfo ? terminalInfo.getAttribute('data-terminal-addr') +' ('+ terminalCode +')' : ''; var terminalAddr = terminalInfo ? terminalInfo.getAttribute('data-terminal-addr'): ''; if (terminalAddr){ var addr = document.getElementById('IPOLH_DPD_TERMINAL_ADDR'); addr.innerText = terminalAddr; } var f1 = document.querySelector('*[name="ORDER_PROP_'+ terminalFieldId +'"]'); var f2 = document.querySelector('*[name="ORDER_PROP_'+ terminalFieldCode +'"]'); if (f1) { f1.value = terminalName; f1.setAttribute('readonly', 'readonly') f1.style.backgroundColor = '#eee'; } if (f2) { f2.value = terminalName; f2.setAttribute('readonly', 'readonly') f2.style.backgroundColor = '#eee'; } } }); /* End */ ; ; /* Start:"a:4:{s:4:"full";s:113:"/bitrix/components/ipol/ipol.dpdPickup/templates/order/bitrix/map.yandex.view/dpd.pickup/script.js?15884447701505";s:6:"source";s:98:"/bitrix/components/ipol/ipol.dpdPickup/templates/order/bitrix/map.yandex.view/dpd.pickup/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ if (!window.BX_YMapAddPlacemarkDPD) { window.BX_YMapAddPlacemarkDPD = function(map, arPlacemark) { if (null == map) return false; if(!arPlacemark.LAT || !arPlacemark.LON) return false; var props = {}; if (null != arPlacemark.TEXT && arPlacemark.TEXT.length > 0) { props.hintContent = arPlacemark.TITLE; props.balloonContent = arPlacemark.TEXT; } var obPlacemark = new ymaps.Placemark( [arPlacemark.LAT, arPlacemark.LON], props, { balloonCloseButton: true, iconLayout: 'default#image', iconImageHref: '/bitrix/images/ipol.dpd/pickup_locationmarker.png', iconImageSize: [53, 53], iconImageOffset: [-25, -53] } ); map.geoObjects.add(obPlacemark); return obPlacemark; } } if (!window.BX_YMapAddPolylineDPD) { window.BX_YMapAddPolylineDPD = function(map, arPolyline) { if (null == map) return false; if (null != arPolyline.POINTS && arPolyline.POINTS.length > 1) { var arPoints = []; for (var i = 0, len = arPolyline.POINTS.length; i < len; i++) { arPoints.push([arPolyline.POINTS[i].LAT, arPolyline.POINTS[i].LON]); } } else { return false; } var obParams = {clickable: true}; if (null != arPolyline.STYLE) { obParams.strokeColor = arPolyline.STYLE.strokeColor; obParams.strokeWidth = arPolyline.STYLE.strokeWidth; } var obPolyline = new ymaps.Polyline( arPoints, {balloonContent: arPolyline.TITLE}, obParams ); map.geoObjects.add(obPolyline); return obPolyline; } } /* End */ ; ; /* Start:"a:4:{s:4:"full";s:77:"/bitrix/components/ipol/ipol.dpdPickup/templates/order/map.js?163578697811286";s:6:"source";s:61:"/bitrix/components/ipol/ipol.dpdPickup/templates/order/map.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ function DpdPickupMap(map, arObjects) { if (this === window) { return new DpdPickupMap(map, arObjects); } this.map = map; this.placemarks = arObjects.PLACEMARKS; this.containerNode = BX('DPD_pvz'); this.terminalsNode = BX('DPD_wrapper'); this.maskNode = BX('DPD_mask'); this.init(); // TODO: циклическая ссылка this.containerNode.DpdPickupMap = this; } DpdPickupMap.prototype.init = function() { this._bindDomEvents(); this._bindMapEvents(); this.setCenterMap(); this.map.controls.get('zoomControl').options.set('position', {left: this.getZoomMargin(10).left, top: 110}); } DpdPickupMap.prototype.setCenterMap = function (x, y, callback) { this.map.container.fitToViewport(); if (x != window.undef && y != window.undef) { return this.map.setCenter([x, y]); } if (this.placemarks.length < 1) { return false; } if (this.placemarks.length > 1) { var bounds = this.map.geoObjects.getBounds(); return this.map.setBounds(bounds, { zoomMargin: [this.getZoomMargin().top, 0, 0, this.getZoomMargin().left] }); } return this.map.setCenter(this.placemarks[0].geometry.getCoordinates()); } DpdPickupMap.prototype.getZoomMargin = function(offset) { if (window.innerWidth > 919) { return {left: 260, top: 0}; } return {left: 0 + (offset || 0), top: 100}; } DpdPickupMap.prototype.selectCity = function(cityId) { this.sendRequest('set_city', {city_id: cityId}, this._bind('doReload')); } DpdPickupMap.prototype.selectTerminal = function(code) { BX.onCustomEvent(this.containerNode, 'dpdPickup:selectTerminal', [code]); // this.sendRequest('set_terminal', {terminal_code: code}, this._bind(function(arResult) { // })); } DpdPickupMap.prototype.highlightTerminal = function(parms) { var nodes = this.containerNode.querySelectorAll('.DPD_terminalSelect'); var node = parms.code ? this.containerNode.querySelector('.DPD_terminalSelect[data-terminal-code="'+ parms.code +'"]') : nodes.item(parms.index); if (!node) { return false; } [].forEach.call(nodes, function(node) { BX.removeClass(node, 'DPD_chosen'); }); BX.addClass(node, 'DPD_chosen'); index = parms.index || [].indexOf.call(nodes, node); if (!this.placemarks[index].balloon.isOpen() && (!!parms.openBalloon) !== false ) { this.placemarks[index].balloon.open(); } if ((!!parms.openBalloon) !== false || 1 == 1) { this.sendRequest('get_terminal_data', { terminal_code: node.dataset.terminalCode }, this._bind(function(data) { this.placemarks[index].properties.set('balloonContent', data.TEXT); }), true); } if (!!parms.highlightIcon) { this.placemarks[index].options.set('iconImageHref', '/bitrix/images/ipol.dpd/pickup_locationmarker_highlighted.png'); } } DpdPickupMap.prototype.resetTerminals = function(arPlacemarks) { this.showLoading(); this.clearTerminals(); var terminalTypes = ['all']; for (var i in arPlacemarks) { var arPlacemark = arPlacemarks[i]; var obPlacemark = BX_YMapAddPlacemarkDPD(this.map, arPlacemark); var node = BX.create('p', { attrs: { 'data-terminal-code': arPlacemark['CODE'], 'data-terminal-type': arPlacemark['TYPE'], 'data-terminal-addr': arPlacemark['ADDR'] }, props: { className: 'DPD_terminalSelect', }, text: arPlacemark['TITLE'] }); if (!obPlacemark) { continue; } this.terminalsNode.appendChild(node); this.placemarks.push(obPlacemark); if (arPlacemark.TYPE && terminalTypes.indexOf(arPlacemark.TYPE) == -1) { terminalTypes.push(arPlacemark.TYPE); } } this.containerNode.querySelector('#DPD_modController').className = terminalTypes.length > 2 ? '' : 'dpd-hidden'; [].forEach.call(this.containerNode.querySelectorAll('.DPD_mC_block'), function(node) { if (terminalTypes.indexOf(node.dataset.type) != -1) { BX.removeClass(node, 'dpd-hidden'); } else { BX.addClass(node, 'dpd-hidden'); } }); this._bindMapEvents(); this.showByType('all'); this.setCenterMap(); this.hideLoading(); } DpdPickupMap.prototype.clearTerminals = function() { if (this.map.geoObjects.removeAll != window.undefined) { this.map.geoObjects.removeAll(); } else { for (var i = 0; i < this.map.geoObjects.length; i++) { this.map.geoObjects.remove(this.map.geoObjects[i]); } } BX.cleanNode(this.terminalsNode); this.placemarks = []; } DpdPickupMap.prototype.reload = function(componentParms, callback) { this .setComponentParams(componentParms) .sendRequest('reload', {}, this._bind('doReload')); } DpdPickupMap.prototype.liveReload = function(componentParms, componentResult) { this .setComponentParams(componentParms) .doReload(componentResult) ; } DpdPickupMap.prototype.doReload = function(arResult) { var node; (node = BX('DPD_cityName')) && (node.innerHTML = arResult.CITY_NAME); this.resetTerminals(arResult.PLACEMARKS); this.setTariff(arResult.TARIFFS.COURIER, 'c'); this.setTariff(arResult.TARIFFS.PICKUP, 'p'); } DpdPickupMap.prototype.setTariff = function(tariff, prefix) { var node; (node = this.containerNode.querySelector('#DPD_'+ prefix +'Price')) && (node.innerHTML = BX.message('IPOLH_DPD_PICKUP_COST_TEXT').replace('#PRICE#', tariff.COST)); (node = this.containerNode.querySelector('#DPD_'+ prefix +'Date')) && (node.innerHTML = BX.message('IPOLH_DPD_PICKUP_PERIOD_TEXT').replace('#DAYS#', tariff.DAYS)); } DpdPickupMap.prototype.sendRequest = function(action, parms, callback) { this._ajaxRequest && this._ajaxRequest.abort(); this.showLoading(); return this._ajaxRequest = BX.ajax({ timeout: 60, method: 'POST', url: '/bitrix/components/ipol/ipol.dpdPickup/ajax.php', data: Object.assign({}, parms, { AJAX_CALL : 'Y', ACTION : action, COMPONENT_PARAMS : this.getComponentParams(), COMPONENT_TEMP : this.getComponentTemplate(), bitrix_sessid : BX.bitrix_sessid() }), dataType: 'json', onsuccess: this._bind(function(response) { try { if (response.status != 'ok') { alert(response.data); } else { callback(response.data); } this.hideLoading(); } catch (e) { console.log(e); } }) }); } DpdPickupMap.prototype.getComponentParams = function() { try { return eval('('+ this.containerNode.dataset.componentParams +')'); } catch(e) { console.log(e); return {}; } } DpdPickupMap.prototype.setComponentParams = function(parms) { this.containerNode.dataset.componentParams = BX.type.isString(parms) ? parms : JSON.stringify(parms); return this; } DpdPickupMap.prototype.getComponentTemplate = function () { return this.containerNode.dataset.componentTemplate; } DpdPickupMap.prototype.setComponentTemplate = function (template) { this.containerNode.dataset.componentTemplate = template; return this; } DpdPickupMap.prototype.showByType = function(showedType) { var items = this.containerNode.querySelectorAll('.DPD_terminalSelect'); for (var i = 0; i < items.length; i++) { var isShow = showedType == 'all' || showedType == items[i].dataset.terminalType; items[i].style.display = isShow ? 'block' : 'none'; this.placemarks[i] && this.placemarks[i].options.set('visible', isShow); } BX.removeClass(this.containerNode.querySelector('.DPD_mC_block.active'), 'active'); BX.addClass(this.containerNode.querySelector('.DPD_mC_block[data-type="'+ showedType +'"]'), 'active'); } ////////////////////////////////////////////////////////////////////////////////////// DpdPickupMap.prototype.onSelectCity = function(e) { var cityId = e.target.dataset.cityId; this.selectCity(cityId); return false; } DpdPickupMap.prototype.onClickTerminal = function(e) { var parms = {openBalloon: !!e.target}; if (e.target) { parms.code = e.target.dataset.terminalCode; } else { parms.index = this.placemarks.indexOf(e.get('target')); } this.highlightTerminal(parms); [].forEach.call(this.containerNode.querySelectorAll('.arrow'), function(node) { BX.removeClass(node, 'up'); }); [].forEach.call(this.containerNode.querySelectorAll('#DPD_wrapper'), function(node) { BX.removeClass(node, 'show'); }); return false; } DpdPickupMap.prototype.onSelectTerminal = function(e) { var code = e.target.dataset.terminalCode; this.selectTerminal(code); } DpdPickupMap.prototype.onSearchCity = function(e) { var text = BX.util.trim(e.target.value.toLowerCase()); var items = this.containerNode.querySelectorAll('.DPD_citySelect'); for (var i = 0; i < items.length; i++) { var item = items[i]; if (item.textContent.toLowerCase().indexOf(text) != -1) { item.style.display = 'block'; } else { item.style.display = 'none'; } } } DpdPickupMap.prototype.onSwitchShowedType = function(e) { var showedType = e.target.dataset.type; this.showByType(showedType); return false; } DpdPickupMap.prototype.onToggleList = function(e) { var arrow = this.containerNode.querySelectorAll('.DPD_arrow'); var list = this.containerNode.querySelectorAll('#DPD_wrapper'); [].forEach.call(arrow, function(node) { BX.toggleClass(node, ['up', 'down']); }); [].forEach.call(list, function(node) { BX.toggleClass(node, ['show', 'hide']); }); return false; } //////////////////////////////////////////////////////////////////////////////////////// DpdPickupMap.prototype._bind = function(callback) { var self = this; callback = (typeof callback == 'function') ? callback : this[callback] ; return function () { return callback.apply(self, arguments); } } DpdPickupMap.prototype._bindDomEvents = function() { BX.bindDelegate(this.containerNode, 'click', {className: 'DPD_citySelect'}, this._bind('onSelectCity')); BX.bindDelegate(this.containerNode, 'click', {className: 'DPD_terminalSelect'}, this._bind('onClickTerminal')); BX.bindDelegate(this.containerNode, 'click', {className: 'DPD_button'}, this._bind('onSelectTerminal')); BX.bindDelegate(this.containerNode, 'click', {className: 'DPD_mC_block'}, this._bind('onSwitchShowedType')); BX.bindDelegate(this.containerNode, 'click', {className: 'DPD_arrow'}, this._bind('onToggleList')); BX.bindDelegate(this.containerNode, 'keyup', {id: 'DPD_citySearcher'}, this._bind('onSearchCity')); } DpdPickupMap.prototype._bindMapEvents = function() { for (var i = 0; i < this.placemarks.length; i++) { this.placemarks[i] && this.placemarks[i].events.add('click', this._bind('onClickTerminal')); } } ///////////////////////////////////////////////////////////////////////////////////////////////////// DpdPickupMap.prototype.showLoading = function() { this._loading && this.hideLoading(); this._loading = BX.showWait(this.containerNode); this.maskNode.style.display = 'block'; } DpdPickupMap.prototype.hideLoading = function() { BX.closeWait(this._loading); this._loading = false; this.maskNode.style.display = 'none'; } /* End */ ; ; /* Start:"a:4:{s:4:"full";s:99:"/bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/script.min.js?17077613675850";s:6:"source";s:80:"/bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ BX.saleOrderAjax={BXCallAllowed:!1,options:{},indexCache:{},controls:{},modes:{},properties:{},init:function(t){var e=this;this.options=t,window.submitFormProxy=BX.proxy(function(){e.submitFormProxy.apply(e,arguments)},this),BX(function(){e.initDeferredControl()}),BX(function(){e.BXCallAllowed=!0}),this.controls.scope=BX("bx-soa-order"),BX.bindDelegate(this.controls.scope,"click",{className:"-bx-popup-set-mode-add-loc"},function(){var t=BX.create("input",{attrs:{type:"hidden",name:"PERMANENT_MODE_STEPS",value:"1"}});BX.prepend(t,BX("bx-soa-order")),e.BXCallAllowed=!1,BX.Sale.OrderAjaxComponent.sendRequest()})},cleanUp:function(){for(var t in this.properties)this.properties.hasOwnProperty(t)&&(void 0!==this.properties[t].input&&(BX.unbindAll(this.properties[t].input),this.properties[t].input=null),void 0!==this.properties[t].control)&&BX.unbindAll(this.properties[t].control);this.properties={}},addPropertyDesc:function(t){this.properties[t.id]=t.attributes,this.properties[t.id].id=t.id},initDeferredControl:function(){var t,o,i,r,e,s,n,p,l,a=this;if(void 0!==window.BX.locationsDeferred)for(t in this.BXCallAllowed=!1,window.BX.locationsDeferred)window.BX.locationsDeferred[t].call(this),window.BX.locationsDeferred[t]=null,delete window.BX.locationsDeferred[t],this.properties[t].control=window.BX.locationSelectors[t],delete window.BX.locationSelectors[t];for(t in this.properties){if(this.properties[t].isZip&&(o=this.controls.scope.querySelector('[data-property-id-row="'+t+'"]'),BX.type.isElementNode(o))&&(i=o.querySelector('input[type="text"]'),BX.type.isElementNode(i))){for(e in this.properties[t].input=i,r=!1,this.properties)if("LOCATION"==this.properties[e].type){r=e;break}!1!==r&&BX.bindDebouncedChange(i,function(t){var e=BX("ZIP_PROPERTY_CHANGED");e&&(e.value="Y"),o=i=null,BX.type.isNotEmptyString(t)&&/^\s*\d+\s*$/.test(t)&&3new r(e,i.extend(!0,{mask:"+7 (999) 999-99-99",namespace:"masked",autoclear:!0,placeholder:"_",definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},completed:()=>{},uncompleted:()=>{}},s)))};class r{constructor(t,e){this.$input=i(t),this.options=e,this.processor=new a(this),this.processor.isComplited()||this.processor.first(),this.events=new s(this),this.events.bind(),this.state=new o(this),this.state.process()}applyCompleted(){return this.options.completed.call(this,this),this.getInput().trigger("completed",this),this}applyUncompleted(){return this.options.uncompleted.call(this,this),this.getInput().trigger("uncompleted",this),this}isAutoclearEnabled(){return this.options.autoclear}getPlaceholder(){return this.options.placeholder}getDefinitions(){return this.options.definitions}getNamespace(){return this.options.namespace}getMask(){return this.options.mask}getProcessor(){return this.processor}getEvents(){return this.events}getState(){return this.state}getInput(){return this.$input}}class s{constructor(t){this.masked=t}bind(){this.masked.getInput().on(this.addNamespace("beforeinput"),t=>this.beforeinput(t)),this.masked.getInput().on(this.addNamespace("input"),t=>this.input(t)),this.masked.getInput().on(this.addNamespace("focus"),t=>this.focus(t)),this.masked.getInput().on(this.addNamespace("blur"),t=>this.blur(t))}focus(t){this.masked.getProcessor().needReset()&&(this.masked.getProcessor().reset(),this.masked.getState().process())}beforeinput(t){this.masked.getProcessor().updateCache()}input(t){this.masked.getProcessor().updateCache().isComplited()||(this.masked.getProcessor().correct(),this.masked.getState().process())}blur(t){this.masked.getProcessor().needClear()&&(this.masked.getProcessor().clear(),this.masked.getState().process())}addNamespace(t){return t+"."+this.masked.getNamespace()}}class o{constructor(t){this.masked=t,this.completed=!1}process(){return this.masked.getProcessor().isComplited()!==this.getComplited()&&this.reverse(),this}reverse(){return(this.completed=!this.completed)?this.masked.applyCompleted():this.masked.applyUncompleted(),this}getComplited(){return this.completed}}class a{constructor(t){this.masked=t,this.formatter=new n(this.masked),this.input=new h(this),this.caret=new l(this)}first(){this.getInput().setLastValue(this.getFormatter().getDefaultValue()),this.getCaret().setVirtualPosition(this.getFormatter().getLastPosition());var t=new e(this);return t.process(),t.existEditedPositions()&&this.getInput().setValue(t.getResult()),this}correct(){var t=new e(this);return t.process(),this.getInput().setValue(t.getResult()),this.getCaret().setPosition(t.getLastEditedPosition()),this}reset(){return this.getInput().setValue(this.getFormatter().getDefaultValue()),this.getCaret().setPositionWithDelay(this.getFormatter().getFirstAvailablePosition()),this}clear(){return this.getInput().setValue(""),this}isComplited(){return this.getFormatter().getFinalExpression().test(this.getInput().getValue())}isEmpty(){return""===this.getInput().getValue()||this.getInput().getValue()===this.getFormatter().getDefaultValue()}needReset(){return!this.isComplited()&&this.isEmpty()}needClear(){return this.getMasked().isAutoclearEnabled()?!this.isComplited():!this.isComplited()&&this.isEmpty()}updateCache(){return this.getInput().readValue(),this.getCaret().readPosition(),this}getInputNative(){return this.masked.getInput().get(0)}getFormatter(){return this.formatter}getMasked(){return this.masked}getCaret(){return this.caret}getInput(){return this.input}}class e{constructor(t){this.processor=t,this.initValues()}initValues(){return this.mask=this.processor.getFormatter().getDefaultValueArray(),this.value=this.processor.getInput().getValueArray(),this.lastValue=this.processor.getInput().getLastValueArray(),this.caretPosition=this.processor.getCaret().getPosition(),this.caretLastPosition=this.processor.getCaret().getLastPosition(),this.lastEditedPosition=this.caretLastPosition[0],this.updateEditedPositions(),this.result=this.lastValue,this}updateEditedPositions(){return this.editedPositions=[],i.each(this.lastValue,(t,e)=>{this.processor.getFormatter().isAllowedCharInPosition(t,e)&&(this.editedPositions[t]=e)}),this}process(){return this.clearSelected(),this.isInput()?this.input():this.isBackspace()?this.backspace():this.isDelete()?this.delete():this}clearSelected(){i.each(this.getSelectedPositions(),(t,e)=>{this.lastValue[e]=this.mask[e],this.result[e]=this.mask[e]}),this.updateEditedPositions()}backspace(){var t=this.getPrevEditedPosition();return-1!==t?(this.result[t]=this.mask[t],this.lastEditedPosition=t):(t=this.processor.getFormatter().getFirstAvailablePosition(),this.lastEditedPosition=this.lastEditedPosition>t?this.lastEditedPosition-1:t),this}delete(){var t=this.getNextEditedPosition();return-1!==t&&(this.result[t]=this.mask[t]),this}input(s=0){var t=this.getInputChars();return this.isPaste()&&!this.existEditedPositions()&&(this.caretLastPosition[0]=0),i.each(t,(t,e)=>{this.inputChar(t-s,e)||s++}),this}inputChar(t,e){var t=this.caretLastPosition[0]+t;return this.mask[t]===e?(this.lastEditedPosition=t+1,!0):!(-1===(t=this.getNearestAllowedPosition(t))||!this.processor.getFormatter().isAllowedCharInPosition(t,e)||(this.result[t]=e,this.lastEditedPosition=t+1,this.editedPositions[t]=e,0))}isInput(){return 0void 0!==t&&s<=e&&void 0===this.getEditedPositions()[e])}getNextEditedPosition(){return this.getEditedPositions().findIndex((t,e)=>void 0!==t&&e>=this.lastEditedPosition)}getPrevEditedPosition(){let t=this.getEditedPositions().length;for(;t--;)if(void 0!==this.getEditedPositions()[t]&&t{this.isDefinition(e)&&(this.allowedPositions[t]=e)}),this}initFinalExpression(s=["^"]){return i.each(this.getMaskArray(),(t,e)=>{if(this.isDefinition(e))return s.push(this.getDefinitionExpression(e)),!0;s.push(this.addSlashesForRegexp(e))}),s.push("$"),this.finalExpression=new RegExp(s.join("")),this}initDefaltValue(s=[]){return i.each(this.getMaskArray(),(t,e)=>{s[t]=this.isAllowedPosition(t)?this.getMasked().getPlaceholder():e}),this.defaultValue=s.join(""),this}isAllowedCharInPosition(t,e){return!!this.isAllowedPosition(t)&&new RegExp(this.getDefinitionExpression(this.getAllowedPositions()[t])).test(e)}isAllowedPosition(t){return void 0!==this.getAllowedPositions()[t]}isDefinition(t){return void 0!==this.getMasked().getDefinitions()[t]}addSlashesForRegexp(t){return t.replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/\\/g,"\\").replace(/\^/g,"\\^").replace(/\$/g,"\\$").replace(/\./g,"\\.").replace(/\|/g,"\\|").replace(/\?/g,"\\?").replace(/\*/g,"\\*").replace(/\+/g,"\\+").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}getFirstAvailablePosition(){return this.allowedPositions.findIndex(t=>t)}getDefinitionExpression(t){return this.getMasked().getDefinitions()[t]}getLastPosition(){return this.getDefaultValueArray().length}getFinalExpression(){return this.finalExpression}getAllowedPositions(){return this.allowedPositions}getDefaultValueArray(){return this.getDefaultValue().split("")}getDefaultValue(){return this.defaultValue}getMaskArray(){return this.getMasked().getMask().split("")}getMasked(){return this.masked}}class h{constructor(t){this.processor=t,this.target=this.processor.getMasked().getInput(),this.readValue()}readValue(){return this.value=this.updateLastValue().getTarget().val(),this}updateLastValue(){return this.setLastValue(this.getValue()),this}setLastValue(t){return void 0!==t?this.lastValue=t:this.lastValue="",this}setValue(t){return this.updateLastValue(),this.value=t,this.getTarget().val(t),this}getTarget(){return this.target}getLastValueArray(){return this.lastValue.split("")}getLastValue(){return this.lastValue}getValueArray(){return this.value.split("")}getValue(){return this.value}}class l{constructor(t){this.processor=t,this.readPosition()}readPosition(){this.updateLastPosition(),this.position=[this.processor.getInputNative().selectionStart,this.processor.getInputNative().selectionEnd]}updateLastPosition(){return void 0!==this.position?this.lastPosition=this.position:this.lastPosition=[0,0],this}setVirtualPosition(t){this.position=t}setPosition(t){this.updateLastPosition(),this.position=[t,t],this.processor.getInputNative().setSelectionRange(t,t)}setPositionWithDelay(t){setTimeout(()=>{this.setPosition(t)},0)}getDelta(){return this.getLastPosition()[1]-this.getLastPosition()[0]}getLastPosition(){return this.lastPosition}getPosition(){return this.position}}}($); /* End */ ; ; /* Start:"a:4:{s:4:"full";s:105:"/bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/order_ajax.min.js?1719643752150269";s:6:"source";s:84:"/bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/order_ajax.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ BX.namespace("BX.Sale.OrderAjaxComponent"),BX.Sale&&BX.Sale.Input&&BX.Sale.Input.Utils&&(BX.Sale.Input.Utils.asMultiple=function(e){if(null==e||""===e)return[];if(e.constructor!==Array)return[e];for(var t,s=0,i=e.length;s{let e=document.querySelector(".main-user-consent-request-popup-buttons"),t=document.querySelector(".main-user-consent-request-popup-button-acc"),s=document.querySelector(".main-user-consent-request-popup-button-rej");var i=document.getElementById("bx-soa-order").classList.value;e?(i&&$(e).addClass(i),$(t).addClass("btn-simple btn-medium"),$(s).addClass("btn-simple btn-medium btn-border")):(e=document.querySelector(".main-user-consent-request-popup-buttons"),t=document.querySelector(".main-user-consent-request-popup-button-acc"),s=document.querySelector(".main-user-consent-request-popup-button-rej"))},10)}),console.log(this)},checkMinimumPrice:function(){this.switchOrderSaveButtons(Number(this.params.MIN_SUM_TO_PAYMENT)<=Number(this.result.TOTAL.ORDER_TOTAL_PRICE))},createFakeSelect:function(){var s=BX("bx-soa-order").querySelectorAll("select:not([multiple])");for(let e=0;e/g,">").replace(/"/g,""")},saveFiles:function(){if(this.result.ORDER_PROP&&this.result.ORDER_PROP.properties)for(var e,t=this.result.ORDER_PROP.properties,s=0;sa.bottom&&(e=a.bottom-window.innerHeight+17),new BX.easing({duration:t||800,start:{scroll:i},finish:{scroll:e},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:BX.delegate(function(e){window.scrollTo(0,e.scroll)},this)}).animate())},checkKeyPress:function(e){if(13==e.keyCode){var t=e.target||e.srcElement;if(!t.getAttribute("data-send"))return(t=t.getAttribute("data-next"))&&(t=this.orderBlockNode.querySelector("input[name="+t+"]"))&&t.focus(),BX.PreventDefault(e)}},getSizeString:function(e,t){var s=1073741824;return e=parseInt(e),t=parseInt(t),s");for(a=BX.util.array_unique(a),s=0;s"));var i=e.querySelector(".alert.alert-danger");i&&t.length&&(BX.cleanNode(i),i.appendChild(BX.create("DIV",{html:t})),!this.hasErrorSection[e.id]?(i.style.opacity=0,i.style.display="",new BX.easing({duration:300,start:{opacity:0},finish:{opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:function(e){i.style.opacity=e.opacity/100},complete:function(){i.removeAttribute("style")}}).animate()):i.style.display="",s)&&BX.addClass(e,"bx-step-error")},showErrors:function(e,t,s){for(var i,a,o=this.orderBlockNode.querySelectorAll("div.alert.alert-danger"),r=0;ri.top&&window.scrollBy(0,-(i.height+20)),a.style.display="none",BX.cleanNode(a),a.removeAttribute("class"),a.removeAttribute("style")}}).animate()))},checkPreload:function(e){var t;switch(e.id){case this.regionBlockNode.id:t=this.result.LAST_ORDER_DATA&&this.result.LAST_ORDER_DATA.PERSON_TYPE;break;case this.paySystemBlockNode.id:t=this.result.LAST_ORDER_DATA&&this.result.LAST_ORDER_DATA.PAY_SYSTEM;break;case this.deliveryBlockNode.id:t=this.result.LAST_ORDER_DATA&&this.result.LAST_ORDER_DATA.DELIVERY;break;case this.pickUpBlockNode.id:t=this.result.LAST_ORDER_DATA&&this.result.LAST_ORDER_DATA.PICK_UP;break;default:t=!0}return t},checkBlockErrors:function(e){var t,s,i,a,o;if((t=BX(e.id+"-hidden"))&&(s=(i=t.querySelector("div.alert.alert-danger"))&&"none"!=i.style.display,i=t.querySelector("div.alert.alert-warning.alert-show"),!s))for(a=t.querySelectorAll("div.tooltip"),o=0;o"+this.params.MESS_DELIVERY_CALC_ERROR_TITLE+"",this.params.MESS_DELIVERY_CALC_ERROR_TEXT.length&&(t+="
"+this.params.MESS_DELIVERY_CALC_ERROR_TEXT+""),this.showBlockWarning(this.deliveryBlockNode,t),this.showBlockWarning(this.deliveryHiddenBlockNode,t),this.activeSectionId!=this.deliveryBlockNode.id&&(BX.addClass(this.deliveryBlockNode,"bx-step-completed"),BX.bind(this.deliveryBlockNode.querySelector(".alert.alert-warning"),"click",BX.proxy(this.showByClick,this)))):BX.hasClass(this.deliveryBlockNode,"bx-step-warning")&&this.activeSectionId!=this.deliveryBlockNode.id&&BX.removeClass(this.deliveryBlockNode,"bx-step-warning"),this.result.WARNING&&this.options.showWarnings)for(s in this.result.WARNING)if(this.result.WARNING.hasOwnProperty(s))switch(s.toUpperCase()){case"DELIVERY":"true"===this.deliveryBlockNode.getAttribute("data-visited")&&(this.showBlockWarning(this.deliveryBlockNode,this.result.WARNING[s],!0),this.showBlockWarning(this.deliveryHiddenBlockNode,this.result.WARNING[s],!0));break;case"PAY_SYSTEM":"true"===this.paySystemBlockNode.getAttribute("data-visited")&&(this.showBlockWarning(this.paySystemBlockNode,this.result.WARNING[s],!0),this.showBlockWarning(this.paySystemHiddenBlockNode,this.result.WARNING[s],!0))}},notifyAboutWarnings:function(e){if(BX.type.isDomNode(e))switch(e.id){case this.deliveryBlockNode.id:this.showBlockWarning(this.deliveryBlockNode,this.result.WARNING.DELIVERY,!0);break;case this.paySystemBlockNode.id:this.showBlockWarning(this.paySystemBlockNode,this.result.WARNING.PAY_SYSTEM,!0)}},showBlockWarning:function(e,t,s){var i,a,o=e.querySelector(".alert.alert-danger"),r="";if(o){if(BX.type.isString(t))r=t;else for(i in t)t.hasOwnProperty(i)&&t[i]&&(r+=t[i]+"
");if(r){for(i in a=e.querySelectorAll(".alert.alert-warning"))if(a.hasOwnProperty(i)&&BX.type.isDomNode(a[i])&&-1!==a[i].innerHTML.indexOf(r))return;s=BX.create("DIV",{props:{className:"alert alert-warning"+(s?" alert-hide":" alert-show")},html:r}),BX.prepend(s,o.parentNode),BX.addClass(e,"bx-step-warning")}}},showPagination:function(e,t){if(t&&e){var s,i,a,o,r,l=[];switch(e){case"delivery":s=this.deliveryPagination;break;case"paySystem":s=this.paySystemPagination;break;case"pickUp":s=this.pickUpPagination}if(1"+this.params.MESS_NAV_BACK+"":''+this.params.MESS_NAV_BACK+"",events:{click:BX.proxy(this.doPagination,this)}})),i=0;i'+a+"",events:{click:BX.proxy(this.doPagination,this)}}));l.push(BX.create("LI",{attrs:{"data-action":"next","data-entity":e},props:{className:"bx-pag-next"},html:s.pageNumber==s.pages.length?""+this.params.MESS_NAV_FORWARD+"":''+this.params.MESS_NAV_FORWARD+"",events:{click:BX.proxy(this.doPagination,this)}})),r=BX.create("DIV",{props:{className:"bx-pagination"},children:[BX.create("DIV",{props:{className:"bx-pagination-container"},children:[BX.create("UL",{children:l})]})]}),t.appendChild(BX.create("DIV",{style:{clear:"both"}})),t.appendChild(r)}}},doPagination:function(e){var t=e.target||e.srcElement,t="LI"==t.tagName?t:BX.findParent(t,{tagName:"LI"}),s=t.getAttribute("data-action"),i=t.getAttribute("data-entity");return BX.hasClass(t,"bx-active")||("prev"!=s&&"next"!=s||(t=parseInt(BX.findParent(t).querySelector(".bx-active").getAttribute("data-action")),s="next"==s?++t:--t),"delivery"==i?this.showDeliveryItemsPage(s):"paySystem"==i?this.showPaySystemItemsPage(s):"pickUp"==i&&this.showPickUpItemsPage(s)),BX.PreventDefault(e)},showDeliveryItemsPage:function(e){this.getCurrentPageItems("delivery",e);var t,s,i,a,e=this.getSelectedDelivery();for(e&&e.ID&&(t=(t=this.deliveryBlockNode.querySelector("input[type=hidden][name=DELIVERY_ID]"))||BX.create("INPUT",{props:{type:"hidden",name:"DELIVERY_ID",value:e.ID}})),s=this.deliveryBlockNode.querySelector(".bx-soa-pp-item-container"),BX.cleanNode(s),BX.type.isDomNode(t)&&BX.prepend(t,BX.findParent(s)),i=0;is.pages.length||(s.pageNumber=t,s.currentPage=s.pages.slice(s.pageNumber-1,s.pageNumber)[0]))}},initPropsListForLocation:function(){var e,t,s,i;if(BX.saleOrderAjax&&this.result.ORDER_PROP&&this.result.ORDER_PROP.properties)for(BX.saleOrderAjax.cleanUp(),e=0;ethis.options.deliveriesPerPage){for(e=this.result.DELIVERY.slice(),t=Math.ceil(e.length/this.options.deliveriesPerPage),s=[],i=0;ithis.options.paySystemsPerPage){for(e=this.result.PAY_SYSTEM.slice(),t=Math.ceil(e.length/this.options.paySystemsPerPage),s=[],i=0;ithis.options.pickUpsPerPage,o&&(e=this.getPickUpInfoArray(this.result.DELIVERY[r].STORE_MAIN));break}if(o)if(0Number(this.result.TOTAL.ORDER_TOTAL_PRICE))&&(this.isValidForm()&&(this.allowOrderSave(),"Y"===this.params.USER_CONSENT&&BX.UserConsent?BX.onCustomEvent("bx-soa-order-save",[]):this.doSaveAction()),BX.PreventDefault(e))},doSaveAction:function(){this.isOrderSaveAllowed()&&(this.reachGoal("order"),this.sendRequest("saveOrderAjax"))},clickNextAction:function(e){var t,s=e.target||e.srcElement,s=BX.findParent(s,{className:"bx-active"}),i=this.getNextSection(s);return this.reachGoal("next",s),this.result.IS_AUTHORIZED&&void 0===this.result.LAST_ORDER_DATA.FAIL||"false"!=i.next.getAttribute("data-visited")||(t=i.next.querySelector(".bx-soa-section-title-container"),BX.bind(t,"click",BX.proxy(this.showByClick,this)),(t=i.next.querySelector(".bx-soa-editstep"))&&(t.style.display=""),t=this.orderBlockNode.querySelectorAll(".bx-soa-section.bx-active"),i.next.id==t[t.length-1].id&&this.switchOrderSaveButtons(!0)),this.fade(s,i.next),this.show(i.next),BX.PreventDefault(e)},clickPrevAction:function(e){var t=e.target||e.srcElement,t=BX.findParent(t,{className:"bx-active"}),s=this.getPrevSection(t);return this.fade(t),this.show(s.next),this.animateScrollTo(s.next,800),BX.PreventDefault(e)},showAuthBlock:function(){var e=this.authBlockNode;BX(this.activeSectionId);this.show(e)},closeAuthBlock:function(){var e=this.authBlockNode,t=this.getNextSection(e).next;this.fade(e),BX.cleanNode(BX(t.id+"-hidden")),this.show(t)},shouldSkipSection:function(e){var t,s=!1;return s="Y"===this.params.SKIP_USELESS_BLOCK&&(e.id===this.pickUpBlockNode.id&&(t=this.getSelectedDelivery())&&(s=1===this.getPickUpInfoArray(t.STORE).length),e.id===this.deliveryBlockNode.id&&(s=this.result.DELIVERY&&1===this.result.DELIVERY.length&&0===this.result.DELIVERY[0].EXTRA_SERVICES.length&&!this.result.DELIVERY[0].CALCULATE_ERRORS),e.id===this.paySystemBlockNode.id)?this.result.PAY_SYSTEM&&1===this.result.PAY_SYSTEM.length&&"Y"!==this.result.PAY_FROM_ACCOUNT:s},getNextSection:function(e,t){if(!this.orderBlockNode||!e)return{};for(var s,i=this.orderBlockNode.querySelectorAll(".bx-soa-section.bx-active"),a=0;ai?o.top:o.bottom+6-p+e)+window.innerHeight>a.bottom+25+c&&(r=a.bottom+25+c-window.innerHeight),r-=this.isMobile?50:0),new BX.easing({duration:s?800:600,start:{height:p,scrollTop:i},finish:{height:e,scrollTop:r},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:function(e){t.style.height=e.height+"px",s&&window.scrollTo(0,e.scrollTop)},complete:function(){t.style.height=""}}).animate(),this.checkBlockErrors(t)}},show:function(e){if(e&&e.id&&this.activeSectionId!=e.id){switch(this.activeSectionId=e.id,BX.removeClass(e,"bx-step-error bx-step-warning"),e.id){case this.authBlockNode.id:this.authBlockNode.style.display="",BX.addClass(this.authBlockNode,"bx-active");break;case this.basketBlockNode.id:this.editActiveBasketBlock(!0),this.alignBasketColumns();break;case this.regionBlockNode.id:this.editActiveRegionBlock(!0);break;case this.deliveryBlockNode.id:this.editActiveDeliveryBlock(!0);break;case this.paySystemBlockNode.id:this.editActivePaySystemBlock(!0);break;case this.pickUpBlockNode.id:this.editActivePickUpBlock(!0);break;case this.propsBlockNode.id:this.editActivePropsBlock(!0)}"false"===e.getAttribute("data-visited")&&(this.showBlockErrors(e),this.notifyAboutWarnings(e)),e.setAttribute("data-visited","true"),BX.removeClass(e,"bx-step-completed")}},showByClick:function(e){var t=e.target||e.srcElement,s=BX.findParent(t,{className:"bx-active"}),t=BX(this.activeSectionId),i=BX.GetWindowScrollPos().scrollTop;return s&&!BX.hasClass(s,"bx-selected")&&(this.reachGoal("edit",s),t&&this.fade(t),this.show(s),setTimeout(BX.delegate(function(){BX.pos(s).top";t.style.display=""}})},editRegistrationForm:function(e){var t,s;this.result.AUTH&&(t=[],(s=this.result.SMS_AUTH&&"OK"===this.result.SMS_AUTH.TYPE)?(t.push(BX.create("DIV",{props:{className:"alert alert-success"},text:BX.message("STOF_REG_SMS_REQUEST")})),t.push(BX.create("INPUT",{props:{type:"hidden",name:"SIGNED_DATA",value:this.result.SMS_AUTH.SIGNED_DATA||""}})),t.push(this.createAuthFormInputContainer(BX.message("STOF_SMS_CODE"),BX.create("INPUT",{attrs:{"data-send":!0},props:{name:"SMS_CODE",type:"text",size:40,value:""},events:{keypress:BX.proxy(this.checkKeyPress,this)}}),!0)),t.push(BX.create("DIV",{props:{className:"bx-authform-formgroup-container"},children:[BX.create("INPUT",{props:{name:"code_submit_button",type:"submit",className:"btn btn-lg btn-default",value:BX.message("STOF_SEND")},events:{click:BX.delegate(function(e){return this.sendRequest("confirmSmsCode"),BX.PreventDefault(e)},this)}})]})),t.push(BX.create("DIV",{props:{className:"bx-authform-formgroup-container"},children:[BX.create("DIV",{props:{id:"bx_register_error"},style:{display:"none"}}),BX.create("DIV",{props:{id:"bx_register_resend"}})]}))):(t.push(BX.create("H3",{props:{className:"bx-title"},text:BX.message("STOF_REG_REQUEST")})),t.push(this.createAuthFormInputContainer(BX.message("STOF_NAME"),BX.create("INPUT",{attrs:{"data-next":"NEW_LAST_NAME"},props:{name:"NEW_NAME",type:"text",size:40,value:this.result.AUTH.NEW_NAME||""},events:{keypress:BX.proxy(this.checkKeyPress,this)}}),!0)),t.push(this.createAuthFormInputContainer(BX.message("STOF_LASTNAME"),BX.create("INPUT",{attrs:{"data-next":"NEW_EMAIL"},props:{name:"NEW_LAST_NAME",type:"text",size:40,value:this.result.AUTH.NEW_LAST_NAME||""},events:{keypress:BX.proxy(this.checkKeyPress,this)}}),!0)),t.push(this.createAuthFormInputContainer(BX.message("STOF_EMAIL"),BX.create("INPUT",{attrs:{"data-next":"PHONE_NUMBER"},props:{name:"NEW_EMAIL",type:"text",size:40,value:this.result.AUTH.NEW_EMAIL||""},events:{keypress:BX.proxy(this.checkKeyPress,this)}}),"Y"==this.result.AUTH.new_user_email_required)),"Y"===this.result.AUTH.new_user_phone_auth&&t.push(this.createAuthFormInputContainer(BX.message("STOF_PHONE"),BX.create("INPUT",{attrs:{"data-next":"captcha_word"},props:{name:"PHONE_NUMBER",type:"text",size:40,value:this.result.AUTH.PHONE_NUMBER||""},events:{keypress:BX.proxy(this.checkKeyPress,this)}}),"Y"===this.result.AUTH.new_user_phone_required)),this.authGenerateUser&&(t.push(BX.create("LABEL",{props:{for:"NEW_GENERATE_N"},children:[BX.create("INPUT",{attrs:{checked:!this.authGenerateUser},props:{id:"NEW_GENERATE_N",type:"radio",name:"NEW_GENERATE",value:"N"}}),BX.message("STOF_MY_PASSWORD")],events:{change:BX.delegate(function(){this.authBlockNode.querySelector(".generated").style.display="",this.authGenerateUser=!1},this)}})),t.push(BX.create("BR")),t.push(BX.create("LABEL",{props:{for:"NEW_GENERATE_Y"},children:[BX.create("INPUT",{attrs:{checked:this.authGenerateUser},props:{id:"NEW_GENERATE_Y",type:"radio",name:"NEW_GENERATE",value:"Y"}}),BX.message("STOF_SYS_PASSWORD")],events:{change:BX.delegate(function(){this.authBlockNode.querySelector(".generated").style.display="none",this.authGenerateUser=!0},this)}}))),t.push(BX.create("DIV",{props:{className:"generated"},style:{display:this.authGenerateUser?"none":""},children:[this.createAuthFormInputContainer(BX.message("STOF_LOGIN"),BX.create("INPUT",{props:{name:"NEW_LOGIN",type:"text",size:30,value:this.result.AUTH.NEW_LOGIN||""},events:{keypress:BX.proxy(this.checkKeyPress,this)}}),!0),this.createAuthFormInputContainer(BX.message("STOF_PASSWORD"),BX.create("INPUT",{props:{name:"NEW_PASSWORD",type:"password",size:30},events:{keypress:BX.proxy(this.checkKeyPress,this)}}),!0),this.createAuthFormInputContainer(BX.message("STOF_RE_PASSWORD"),BX.create("INPUT",{props:{name:"NEW_PASSWORD_CONFIRM",type:"password",size:30},events:{keypress:BX.proxy(this.checkKeyPress,this)}}),!0)]})),"Y"==this.result.AUTH.captcha_registration&&t.push(BX.create("DIV",{props:{className:"bx-authform-formgroup-container"},children:[BX.create("DIV",{props:{className:"bx-authform-label-container"},children:[BX.create("SPAN",{props:{className:"bx-authform-starrequired"},text:"*"}),BX.message("CAPTCHA_REGF_PROMT"),BX.create("DIV",{props:{className:"bx-captcha"},children:[BX.create("INPUT",{props:{name:"captcha_sid",type:"hidden",value:this.result.AUTH.capCode||""}}),BX.create("IMG",{props:{src:"/bitrix/tools/captcha.php?captcha_sid="+this.result.AUTH.capCode,alt:""}})]})]}),BX.create("DIV",{props:{className:"bx-authform-input-container"},children:[BX.create("INPUT",{attrs:{"data-send":!0},props:{name:"captcha_word",type:"text",size:"30",maxlength:"50",value:""},events:{keypress:BX.proxy(this.checkKeyPress,this)}})]})]})),t.push(BX.create("DIV",{props:{className:"bx-authform-formgroup-container"},children:[BX.create("INPUT",{props:{id:"do_register",name:"do_register",type:"hidden",value:"N"}}),BX.create("INPUT",{props:{type:"submit",className:"btn btn-lg btn-default",value:BX.message("STOF_REGISTER")},events:{click:BX.delegate(function(e){return BX("do_register").value="Y",this.sendRequest("showAuthForm"),BX.PreventDefault(e)},this)}}),BX.create("A",{props:{className:"btn btn-link",href:""},text:BX.message("STOF_DO_AUTHORIZE"),events:{click:BX.delegate(function(e){return this.toggleAuthForm(e),BX.PreventDefault(e)},this)}})]}))),e.appendChild(BX.create("DIV",{props:{className:"col-md-12"},children:[BX.create("DIV",{props:{className:"bx-authform"},children:t})]})),s)&&this.activatePhoneAuth()},editSocialContent:function(e){var t,s;BX("bx-soa-soc-auth-services")&&(!(t=[])===this.socServiceHiddenNode&&(s=BX("bx-soa-soc-auth-services").querySelector(".bx-authform-social"),BX.type.isDomNode(s))&&(this.socServiceHiddenNode=s.innerHTML,BX.remove(s)),this.socServiceHiddenNode&&t.push(BX.create("DIV",{props:{className:"bx-authform-social"},html:'

'+BX.message("SOA_DO_SOC_SERV")+"

"+this.socServiceHiddenNode})),"Y"===this.result.AUTH.new_user_registration&&t.push(BX.create("DIV",{props:{className:"bx-soa-reg-block"},children:[BX.create("P",{html:this.params.MESS_REGISTRATION_REFERENCE}),BX.create("A",{props:{className:"btn btn-default btn-lg"},text:BX.message("STOF_DO_REGISTER"),events:{click:BX.delegate(function(e){return this.toggleAuthForm(e),BX.PreventDefault(e)},this)}})]})),e.appendChild(BX.create("DIV",{props:{className:""},children:t})))},getAuthReference:function(e){e.appendChild(BX.create("DIV",{props:{className:""},children:[BX.create("DIV",{props:{className:"bx-soa-reference col-xs-12"},children:[this.params.MESS_AUTH_REFERENCE_1,BX.create("BR"),this.params.MESS_AUTH_REFERENCE_2,BX.create("BR"),this.params.MESS_AUTH_REFERENCE_3]})]}))},toggleAuthForm:function(e){var t,s,i;e&&(e=e.target||e.srcElement,t=BX.findParent(e,{className:"bx-soa-section"}),s=BX.findParent(e,{className:"bx-soa-section-content"}),i=BX.firstChild(this.authHiddenBlockNode),new BX.easing({duration:100,start:{opacity:100},finish:{opacity:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quad),step:function(e){s.style.opacity=e.opacity/100}}).animate(),this.authHiddenBlockNode.appendChild(s),BX.cleanNode(t),t.appendChild(BX.create("DIV",{props:{className:"bx-soa-section-title-container"},children:[BX.create("h2",{props:{className:"bx-soa-section-title"},html:BX.hasClass(i,"reg")?this.params.MESS_REG_BLOCK_NAME:this.params.MESS_AUTH_BLOCK_NAME})]})),i.style.opacity=0,t.appendChild(i),setTimeout(function(){new BX.easing({duration:100,start:{opacity:0},finish:{opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(e){i.style.opacity=e.opacity/100},complete:function(){i.style.height="",i.style.opacity=""}}).animate()},110),this.animateScrollTo(t))},alignBasketColumns:function(){if(this.basketBlockNode){var e,t,s,i,a=0,o=BX.GetWindowInnerSize();if(580'+s+""),this.options.showPropsInBasket&&i.length)for(var o in i)i.hasOwnProperty(o)&&(t=i[o].NAME||"",o=i[o].VALUE||"",a.push(BX.create("DIV",{props:{className:"bx-soa-item-td-title"},style:{textAlign:"left"},text:t})),a.push(BX.create("DIV",{props:{className:"bx-soa-item-td-text"},style:{textAlign:"left"},text:o})));return BX.create("DIV",{props:{className:"bx-soa-item-content"},children:a.length?[BX.create("DIV",{props:{className:"bx-soa-item-title"},html:s}),BX.create("DIV",{props:{className:"bx-scu-container"},children:a})]:[BX.create("DIV",{props:{className:"bx-soa-item-title"},html:s})]})},createBasketItemColumn:function(e,t,s){if(e&&t){var i,a=t.columns[e.id]?t.columns:t.data,o=BX.util.in_array(e.id,["QUANTITY","PRICE_FORMATED","DISCOUNT_PRICE_PERCENT_FORMATED","SUM"]),r=BX.create("DIV",{props:{className:"bx-soa-item-td-text"}});if("PRICE_FORMATED"===e.id)r.appendChild(BX.create("STRONG",{props:{className:"bx-price"},html:a.PRICE_FORMATED})),0e.innerHeight*t&&(a.style.height=e.innerHeight*t+"px",a.style.width=i*(e.innerHeight*t/s)+"px",s=a.offsetHeight,i=a.offsetWidth),i>e.innerWidth*t&&(a.style.width=e.innerWidth*t+"px",a.style.height=s*(e.innerWidth*t/i)+"px"),a.style.height=a.offsetHeight+"px",a.style.width=a.offsetWidth+"px",o.popup.adjustPosition())}}})},onPopupClose:function(){this.destroy()}},content:BX.create("DIV",{props:{id:"bx-soa-image-popup-content"},children:[BX.create("IMG",{props:{src:this.templateFolder+"/images/loader.gif"}})]})}),this.popup.show()},getImageContainer:function(t,s){return BX.create("LI",{props:{className:"bx-img-item"},children:[BX.create("DIV",{props:{className:"bx-scu-itemColorBlock"},children:[BX.create("DIV",{props:{className:"bx-img-itemColor"},style:{backgroundImage:'url("'+t+'")'}})],events:{click:BX.delegate(function(e){this.popupShow(e,t,s)},this)}})]})},editCoupons:function(e){var t=this.getCouponsList(!0),s=this.getCouponsLabel(!0),t=BX.create("DIV",{props:{className:"bx-soa-coupon-block"},children:[BX.create("DIV",{props:{className:"bx-soa-coupon-input"},dataset:{word:this.params.MESS_COUPON_USE},children:[BX.create("INPUT",{props:{className:"form-control bx-ios-fix",type:"text",placeholder:this.params.COUPON_PLACEHOLDER},events:{change:BX.delegate(function(e){e=BX.getEventTarget(e);e&&e.value&&(this.sendRequest("enterCoupon",e.value),e.value="")},this)}})]}),BX.create("SPAN",{props:{className:"bx-soa-coupon-item"},children:t})]});e.appendChild(BX.create("DIV",{props:{className:"bx-soa-coupon"},children:[s,t]}))},editCouponsFade:function(e){var t,s;this.result.COUPON_LIST.length<1||(t=this.getCouponsList(!1)).length&&(s=this.getCouponsLabel(!1),s=BX.create("DIV",{props:{className:"bx-soa-coupon-block"},children:[BX.create("DIV",{props:{className:"bx-soa-coupon-list"},children:[BX.create("DIV",{props:{className:"bx-soa-coupon-item"},children:[s].concat(t)})]})]}),e.appendChild(BX.create("DIV",{props:{className:"bx-soa-coupon bx-soa-coupon-item-fixed"},children:[s]})))},getCouponsList:function(e){for(var t=[],s=0;s=this.params.COUNT_QUICK_LOCATIONS&&(t[e].style.display="none")}},editActiveRegionBlock:function(e){var t,s,i,e=e?this.regionBlockNode:this.regionHiddenBlockNode;this.initialized.region?(BX.remove(BX.lastChild(e)),e.appendChild(BX.firstChild(this.regionHiddenBlockNode))):((t=e.querySelector(".bx-soa-section-content"))?BX.cleanNode(t):(t=this.getNewContainer(),e.appendChild(t)),this.getErrorContainer(t),e=BX.create("DIV",{props:{className:"bx_soa_location"}}),s=BX.create("DIV",{props:{className:"regionCol"}}),i=BX.create("DIV",{props:{className:"regionRow"}}),this.getPersonTypeControl(i),this.getProfilesControl(i),s.appendChild(i),this.getDeliveryLocationInput(s),this.result.SHOW_AUTH||(this.regionBlockNotEmpty?(BX.addClass(this.regionBlockNode,"bx-active"),this.regionBlockNode.style.display=""):(BX.removeClass(this.regionBlockNode,"bx-active"),this.regionBlockNode.style.display="none",this.result.IS_AUTHORIZED&&void 0===this.result.LAST_ORDER_DATA.FAIL||this.initFirstSection())),e.appendChild(s),t.appendChild(e),this.getBlockFooter(t))},editFadeRegionBlock:function(){var e=this.regionBlockNode.querySelector(".bx-soa-section-content");this.initialized.region?this.regionHiddenBlockNode.appendChild(e):(this.editActiveRegionBlock(!1),BX.remove(BX.lastChild(this.regionBlockNode))),e=this.getNewContainer(!0),this.regionBlockNode.appendChild(e),this.editActiveRegionBlock(!0)},editFadeRegionContent:function(e){if(e&&this.locationsInitialized){var t,s,i,a,o,r=this.getSelectedPersonType(),l=this.regionHiddenBlockNode.querySelector(".alert.alert-danger"),n="",c=[],p="";for(a in BX.cleanNode(e),l&&e.appendChild(l.cloneNode(!0)),r&&r.NAME&&1"+this.params.MESS_PERSON_TYPE+": "+BX.util.htmlspecialchars(r.NAME)+"
"),r&&(l="PROPS_FADE_LIST_"+r.ID,c=this.params[l]||[]),this.result.ORDER_PROP.properties)if(this.result.ORDER_PROP.properties.hasOwnProperty(a))if("Y"==this.result.ORDER_PROP.properties[a].IS_LOCATION&&this.result.ORDER_PROP.properties[a].ID==this.deliveryLocationInfo.loc)t=this.result.ORDER_PROP.properties[a];else if("Y"==this.result.ORDER_PROP.properties[a].IS_ZIP&&this.result.ORDER_PROP.properties[a].ID==this.deliveryLocationInfo.zip)for(i=this.result.ORDER_PROP.properties[a],o=0;o"+BX.util.htmlspecialchars(t.NAME)+": "+BX.util.htmlspecialchars(r)+"
"),i&&p.length&&(n+=""+BX.util.htmlspecialchars(i.NAME)+": "+BX.util.htmlspecialchars(p)),e.innerHTML+=n,"true"==this.regionBlockNode.getAttribute("data-visited")&&((l=this.isValidRegionBlock()).length?(BX.addClass(this.regionBlockNode,"bx-step-error"),this.showError(this.regionBlockNode,l)):BX.removeClass(this.regionBlockNode,"bx-step-error")),BX.bind(e.querySelector(".alert.alert-danger"),"click",BX.proxy(this.showByClick,this)),BX.bind(e.querySelector(".alert.alert-warning"),"click",BX.proxy(this.showByClick,this))}},getSelectedPersonType:function(){var e,t,s,i=this.result.PERSON_TYPE.length,a=1==i?(a=this.regionBlockNode.querySelector("input[type=hidden][name=PERSON_TYPE]"))||this.regionHiddenBlockNode.querySelector("input[type=hidden][name=PERSON_TYPE]"):2==i?(a=this.regionBlockNode.querySelector("input[type=radio][name=PERSON_TYPE]:checked"))||this.regionHiddenBlockNode.querySelector("input[type=radio][name=PERSON_TYPE]:checked"):(a=this.regionBlockNode.querySelector("select[name=PERSON_TYPE] > option:checked"))||this.regionHiddenBlockNode.querySelector("select[name=PERSON_TYPE] > option:checked");if(a)for(s in t=a.value,this.result.PERSON_TYPE)if(this.result.PERSON_TYPE[s].ID==t){e=this.result.PERSON_TYPE[s];break}return e},getDeliveryLocationInput:function(e){var t,s,i,a,o,r,l,n,c;for(a in this.result.ORDER_PROP.properties)if(this.result.ORDER_PROP.properties.hasOwnProperty(a)&&"Y"==(t=this.result.ORDER_PROP.properties[a]).IS_LOCATION){s=t.ID,i=parseInt(t.INPUT_FIELD_LOCATION);break}if((l=this.locations[s])&&l[0]&&l[0].output)for(a in this.regionBlockNotEmpty=!0,c='",r=l[0].output,c=BX.create("DIV",{attrs:{"data-property-id-row":s},props:{className:"form-group bx-soa-location-input-container"},style:{visibility:"hidden"},html:c+r.HTML}),e.appendChild(c),e.appendChild(BX.create("INPUT",{props:{type:"hidden",name:"RECENT_DELIVERY_VALUE",value:l[0].lastValue}})),r.SCRIPT)r.SCRIPT.hasOwnProperty(a)&&BX.evalGlobal(r.SCRIPT[a].JS);if(l&&l[0]&&l[0].showAlt&&0* ':"",l+=BX.util.htmlspecialchars(o.NAME),l=BX.create("LABEL",{attrs:{for:"altProperty"},props:{className:"bx-soa-custom-label"},html:l}),n=BX.create("INPUT",{props:{id:"altProperty",type:"text",placeholder:o.DESCRIPTION,autocomplete:"off",className:"form-control bx-soa-customer-input bx-ios-fix",name:"ORDER_PROP_"+o.ID,value:o.VALUE}}),c.appendChild(l),c.appendChild(n),e.appendChild(c),this.bindValidation(o.ID,c)),this.getZipLocationInput(e)},getLocationString:function(e){if(!e)return"";var t,s,i,a=e.querySelector(".bx-ui-sls-route"),o="";if(a&&a.value&&a.value.length)o=a.value;else{for(s=(t=e.querySelectorAll(".bx-ui-combobox-fake.bx-combobox-fake-as-input")).length;s--;)0<=t[s].innerHTML.indexOf("...")||(0<=t[s].innerHTML.indexOf("---")?(i=BX("altProperty"))&&i.value.length&&(o+=i.value):(o.length&&(o+=", "),o+=t[s].innerHTML));0==o.length&&(o=BX.message("SOA_NOT_SPECIFIED"))}return o},getZipLocationInput:function(e){var t,s,i,a,o;for(s in this.result.ORDER_PROP.properties)if(this.result.ORDER_PROP.properties.hasOwnProperty(s)&&"Y"==this.result.ORDER_PROP.properties[s].IS_ZIP){t=this.result.ORDER_PROP.properties[s];break}t&&(this.regionBlockNotEmpty=!0,(i=BX.create("DIV",{props:{className:"form-group bx-soa-location-input-container"}})).setAttribute("data-property-id-row",t.ID),a="Y"==t.REQUIRED?'* ':"",a+=BX.util.htmlspecialchars(t.NAME),a=BX.create("LABEL",{attrs:{for:"zipProperty"},props:{className:"bx-soa-custom-label"},html:a}),o=BX.create("INPUT",{props:{id:"zipProperty",type:"text",placeholder:t.DESCRIPTION,autocomplete:"off",className:"form-control bx-soa-customer-input bx-ios-fix",name:"ORDER_PROP_"+t.ID,value:t.VALUE}}),i.appendChild(a),i.appendChild(o),e.appendChild(i),e.appendChild(BX.create("input",{props:{id:"ZIP_PROPERTY_CHANGED",name:"ZIP_PROPERTY_CHANGED",type:"hidden",value:this.result.ZIP_PROPERTY_CHANGED||"N"}})),this.bindValidation(t.ID,i))},getPersonTypeSortedArray:function(e){var t,s=[];for(t in e)e.hasOwnProperty(t)&&s.push(e[t]);return s.sort(function(e,t){return parseInt(e.SORT)-parseInt(t.SORT)})},getPersonTypeControl:function(e){if(this.result.PERSON_TYPE){this.result.PERSON_TYPE=this.getPersonTypeSortedArray(this.result.PERSON_TYPE);var t,s,i,a,o=this.result.PERSON_TYPE.length,r=[],l=[];if(1'+this.result.CURRENT_BUDGET_FORMATED+"
"+(o?BX.message("SOA_PAY_ACCOUNT3"):""),o=BX.create("DIV",{props:{className:"bx-soa-pp-company-desc"},html:o}),BX.create("LABEL",{props:{className:"bx-soa-pp-inner-ps"+(e?" bx-selected":"")},children:[a,s,BX.create("DIV",{children:[t,i,o]})]})},editFadePaySystemContent:function(e){var t,s=this.getSelectedPaySystem(),i=this.paySystemHiddenBlockNode.querySelector("div.alert.alert-danger"),a=this.paySystemHiddenBlockNode.querySelector("div.alert.alert-warning.alert-show"),o="";i?e.appendChild(i.cloneNode(!0)):this.getErrorContainer(e),a&&a.innerHTML&&e.appendChild(a.cloneNode(!0)),this.isSelectedInnerPayment()&&(o=(o=o+'
')+""+this.result.INNER_PAY_SYSTEM.NAME+"
"),(o=s&&s.NAME?(o=o+'
')+""+BX.util.htmlspecialchars(s.NAME)+"
":o).length||(o=""+BX.message("SOA_PS_SELECT_ERROR")+""),e.innerHTML+=o,e.appendChild(BX.create("DIV",{style:{clear:"both"}})),BX.bind(e.querySelector(".alert.alert-danger"),"click",BX.proxy(this.showByClick,this)),BX.bind(e.querySelector(".alert.alert-warning"),"click",BX.proxy(this.showByClick,this))},getSelectedPaySystem:function(){var e,t,s=this.paySystemBlockNode.querySelector("input[type=checkbox][name=PAY_SYSTEM_ID]:checked"),i=null;if(s=(s=s||this.paySystemHiddenBlockNode.querySelector("input[type=checkbox][name=PAY_SYSTEM_ID]:checked"))||this.paySystemHiddenBlockNode.querySelector("input[type=hidden][name=PAY_SYSTEM_ID]"))for(e=s.value,t=0;tparseFloat(e.PRICE)?[e.DELIVERY_DISCOUNT_PRICE_FORMATED]:[e.DELIVERY_DISCOUNT_PRICE_FORMATED,BX.create("BR"),BX.create("SPAN",{props:{className:"bx-price-old"},html:e.PRICE_FORMATED})]:e.PRICE?[e.PRICE_FORMATED]:this.params.MESS_PRICE_FREE;return e},getDeliveryExtraServices:function(e){var t,s,i,a,o=[];for(t in e.EXTRA_SERVICES)e.EXTRA_SERVICES.hasOwnProperty(t)&&(a=e.EXTRA_SERVICES[t]).canUserEditValue&&(-1==a.editControl.indexOf("this.checked")?(s=BX.create("LABEL",{html:BX.util.htmlspecialchars(a.name)+(a.price?" ("+a.priceFormatted+")":"")}),(i=document.createElement("div")).innerHTML=a.editControl,i.querySelector("select")&&(a.editControl='
'+a.editControl+"
"),i=BX.create("DIV",{props:{className:"form-group bx-soa-pp-field"},html:(a.description&&a.description.length?'
'+BX.util.htmlspecialchars(a.description)+"
":"")+a.editControl}),BX.prepend(s,i),(s=(s=i.querySelector("input[type=text]"))||i.querySelector("select"))&&BX.addClass(s,"form-control")):i=BX.create("DIV",{props:{className:"checkbox"+("Y"===a.value?" checked":"")},children:[BX.create("LABEL",{html:a.editControl+BX.util.htmlspecialchars(a.name)+(a.price?" ("+a.priceFormatted+")":"")+(a.description&&a.description.length?'
'+BX.util.htmlspecialchars(a.description)+"
":"")})]}),o.push(i));return o},editFadeDeliveryBlock:function(){var e=this.deliveryBlockNode.querySelector(".bx-soa-section-content");this.initialized.delivery?this.deliveryHiddenBlockNode.appendChild(e):(this.editActiveDeliveryBlock(!1),BX.remove(BX.lastChild(this.deliveryBlockNode))),e=this.getNewContainer(!0),this.deliveryBlockNode.appendChild(e),this.editFadeDeliveryContent(e),"Y"==this.params.SHOW_COUPONS_DELIVERY&&this.editCouponsFade(e)},createDeliveryItem:function(e){var t="Y"==e.CHECKED,s=parseInt(e.ID),i=[BX.create("INPUT",{props:{id:"ID_DELIVERY_ID_"+s,name:"DELIVERY_ID",type:"checkbox",className:"bx-soa-pp-company-checkbox",value:s,checked:t}})],a=this.deliveryCachedInfo[s],o=this.getImageSources(e,"LOGOTIP"),o=BX.create("img",{props:{className:"bx-soa-pp-company-image",src:o.src_1x||o||this.defaultDeliveryLogo}}),o=(i.push(o),[]);return"Y"==this.params.SHOW_DELIVERY_LIST_NAMES&&o.push(BX.create("DIV",{props:{className:"bx-soa-pp-company-smalltitle"},text:"N"!=this.params.SHOW_DELIVERY_PARENT_NAMES?e.NAME:e.OWN_NAME})),0<=e.PRICE||void 0!==e.DELIVERY_DISCOUNT_PRICE?o.push(BX.create("DIV",{props:{className:"bx-soa-pp-delivery-cost"},html:0==e.PRICE?this.params.MESS_PRICE_FREE:void 0!==e.DELIVERY_DISCOUNT_PRICE?e.DELIVERY_DISCOUNT_PRICE_FORMATED:e.PRICE_FORMATED})):a&&(0<=a.PRICE||void 0!==a.DELIVERY_DISCOUNT_PRICE)?o.push(BX.create("DIV",{props:{className:"bx-soa-pp-delivery-cost"},html:0==e.PRICE?this.params.MESS_PRICE_FREE:void 0!==a.DELIVERY_DISCOUNT_PRICE?a.DELIVERY_DISCOUNT_PRICE_FORMATED:a.PRICE_FORMATED})):o.push(BX.create("DIV",{props:{className:"bx-soa-pp-delivery-cost bx-soa-pp-delivery-calculate"},html:this.params.CALCULATE})),i.push(BX.create("DIV",{props:{className:"delivery-text"},children:o})),i.push(BX.create("DIV",{props:{className:"delivery-check"}})),o=BX.create("DIV",{props:{className:"bx-soa-pp-company-graf-container"+(e.CALCULATE_ERRORS||a&&a.CALCULATE_ERRORS?" bx-bd-waring":"")},children:i}),e=BX.create("DIV",{props:{className:"bx-soa-pp-company"},children:[o],events:{click:BX.proxy(this.selectDelivery,this)}}),t&&BX.addClass(e,"bx-selected"),t&&this.result.LAST_ORDER_DATA.PICK_UP&&(this.lastSelectedDelivery=s),e},editFadeDeliveryContent:function(e){var t,s,i,a=this.getSelectedDelivery(),o="N"!=this.params.SHOW_DELIVERY_PARENT_NAMES?a.NAME:a.OWN_NAME,r=this.deliveryHiddenBlockNode.querySelector("div.alert.alert-danger"),l=this.deliveryHiddenBlockNode.querySelector("div.alert.alert-warning.alert-show");if(r&&r.innerHTML?e.appendChild(r.cloneNode(!0)):this.getErrorContainer(e),l&&l.innerHTML&&e.appendChild(l.cloneNode(!0)),a&&a.NAME){if(l=(r=this.getImageSources(a,"LOGOTIP"))&&r.src_1x||this.defaultDeliveryLogo,s=[BX.create("IMG",{props:{src:l,alt:""},style:{height:"18px"}}),BX.create("STRONG",{text:o})],"Y"==this.params.DELIVERY_FADE_EXTRA_SERVICES&&BX.util.object_keys(a.EXTRA_SERVICES).length)for(i in s.push(BX.create("BR")),a.EXTRA_SERVICES)a.EXTRA_SERVICES.hasOwnProperty(i)&&(t=a.EXTRA_SERVICES[i]).value&&"N"!=t.value&&t.canUserEditValue&&(s.push(BX.create("BR")),s.push(BX.create("STRONG",{text:t.name+": "})),s.push(t.viewControl));e.appendChild(BX.create("DIV",{props:{className:" bx-soa-pp-company-selected"},children:s})),e.appendChild(BX.create("DIV",{props:{className:" bx-soa-pp-price"},children:this.getDeliveryPriceNodes(a)}))}else e.appendChild(BX.create("STRONG",{text:BX.message("SOA_DELIVERY_SELECT_ERROR")}));e.appendChild(BX.create("DIV",{style:{clear:"both"}})),BX.bind(e.querySelector(".alert.alert-danger"),"click",BX.proxy(this.showByClick,this)),BX.bind(e.querySelector(".alert.alert-warning"),"click",BX.proxy(this.showByClick,this))},selectDelivery:function(e){if(this.orderBlockNode){var t=e.target||e.srcElement,t=BX.hasClass(t,"bx-soa-pp-company")?t:BX.findParent(t,{className:"bx-soa-pp-company"}),s=this.deliveryBlockNode.querySelector(".bx-soa-pp-company.bx-selected");if(BX.hasClass(t,"bx-selected"))return BX.PreventDefault(e);t&&(e=t.querySelector("input[type=checkbox]"),BX.addClass(t,"bx-selected"),e.checked=!0),s&&(t=s.querySelector("input[type=checkbox]"),BX.removeClass(s,"bx-selected"),t.checked=!1),this.sendRequest()}},getSelectedDelivery:function(){var e,t,s=this.deliveryBlockNode.querySelector("input[type=checkbox][name=DELIVERY_ID]:checked"),i=!1;if(s=(s=s||this.deliveryHiddenBlockNode.querySelector("input[type=checkbox][name=DELIVERY_ID]:checked"))||this.deliveryHiddenBlockNode.querySelector("input[type=hidden][name=DELIVERY_ID]"))for(t in e=s.value,this.result.DELIVERY)if(this.result.DELIVERY[t].ID==e){i=this.result.DELIVERY[t];break}return i},activatePickUp:function(e){this.pickUpBlockNode&&this.pickUpHiddenBlockNode&&(this.pickUpBlockNode.style.display="",this.pickUpBlockNode.querySelector("h2.bx-soa-section-title").innerHTML=this.params.PICKUP_NAME,BX.hasClass(this.pickUpBlockNode,"bx-active")||(BX.addClass(this.pickUpBlockNode,"bx-active"),this.pickUpBlockNode.style.display=""))},deactivatePickUp:function(){this.pickUpBlockNode&&this.pickUpHiddenBlockNode&&BX.hasClass(this.pickUpBlockNode,"bx-active")&&(BX.removeClass(this.pickUpBlockNode,"bx-active"),this.pickUpBlockNode.style.display="none")},editPickUpBlock:function(e){this.pickUpBlockNode&&this.pickUpHiddenBlockNode&&BX.hasClass(this.pickUpBlockNode,"bx-active")&&this.result.DELIVERY&&(this.initialized.pickup=!1,e?this.editActivePickUpBlock(!0):this.editFadePickUpBlock(),this.initialized.pickup=!0)},editActivePickUpBlock:function(e){var t,e=e?this.pickUpBlockNode:this.pickUpHiddenBlockNode;this.initialized.pickup?(BX.remove(BX.lastChild(e)),e.appendChild(BX.firstChild(this.pickUpHiddenBlockNode)),"Y"===this.params.SHOW_NEAREST_PICKUP&&this.maps&&!this.maps.maxWaitTimeExpired&&(this.maps.maxWaitTimeExpired=!0,this.initPickUpPagination(),this.editPickUpList(!0),this.pickUpFinalAction()),this.maps&&!this.pickUpMapFocused&&(this.pickUpMapFocused=!0,setTimeout(BX.proxy(this.maps.pickUpMapFocusWaiter,this.maps),200))):((t=e.querySelector(".bx-soa-section-content"))||(t=this.getNewContainer(),e.appendChild(t)),BX.cleanNode(t),e=BX.create("DIV",{props:{className:"pickup-container"}}),this.editPickUpMap(e),this.editPickUpLoader(e),t.appendChild(BX.create("DIV",{props:{className:"bx_soa_pickup "},children:[e]})),"Y"==this.params.SHOW_PICKUP_MAP&&"Y"==this.params.SHOW_NEAREST_PICKUP||(this.initPickUpPagination(),this.editPickUpList(!0),this.pickUpFinalAction()),this.getBlockFooter(t))},editFadePickUpBlock:function(){var e=this.pickUpBlockNode.querySelector(".bx-soa-section-content");this.initialized.pickup?this.pickUpHiddenBlockNode.appendChild(e):(this.editActivePickUpBlock(!1),BX.remove(BX.lastChild(this.pickUpBlockNode))),e=this.getNewContainer(),this.pickUpBlockNode.appendChild(e),this.editFadePickUpContent(e)},editFadePickUpContent:function(e){var t,s,i=this.getSelectedPickUp(),a="";i&&("Y"==this.params.SHOW_STORES_IMAGES&&(t=this.getImageSources(i,"IMAGE_ID"),a+=''),a+=""+BX.util.htmlspecialchars(i.TITLE)+"",i.ADDRESS&&(a+="
"+BX.message("SOA_PICKUP_ADDRESS")+": "+BX.util.htmlspecialchars(i.ADDRESS)),i.PHONE&&(a+="
"+BX.message("SOA_PICKUP_PHONE")+": "+BX.util.htmlspecialchars(i.PHONE)),i.SCHEDULE&&(a+="
"+BX.message("SOA_PICKUP_WORK")+": "+BX.util.htmlspecialchars(i.SCHEDULE)),i.DESCRIPTION&&(a+="
"+BX.message("SOA_PICKUP_DESC")+": "+BX.util.htmlspecialchars(i.DESCRIPTION)),e.innerHTML=a,"Y"==this.params.SHOW_STORES_IMAGES)&&BX.bind(e.querySelector(".bx-soa-pickup-preview-img"),"click",BX.delegate(function(e){this.popupShow(e,t&&t.src_orig||s)},this))},getPickUpInfoArray:function(e){if(!e||e.length<=0)return[];for(var t=[],s=0;s=this.options.pickUpMap.minToShowNearestBlock&&this.editPickUpRecommendList(e.geoObjects.get(0)),this.initPickUpPagination(),this.editPickUpList(!0),this.pickUpFinalAction()},geoLocationFailCallback:function(){this.initPickUpPagination(),this.editPickUpList(!0),this.pickUpFinalAction()},initMaps:function(){var e,t;this.maps=BX.Sale.OrderAjaxComponent.Maps.init(this),this.maps&&(this.mapsReady=!0,this.resizeMapContainers(),"Y"===this.params.SHOW_PICKUP_MAP&&BX("pickUpMap")&&(e=(t=this.getSelectedDelivery())&&t.STORE&&t.STORE.length?this.getPickUpInfoArray(t.STORE):e)&&e.length&&(t=this.getSelectedPickUp(),this.maps.initializePickUpMap(t),"Y"===this.params.SHOW_NEAREST_PICKUP&&this.maps.showNearestPickups(BX.proxy(this.geoLocationSuccessCallback,this),BX.proxy(this.geoLocationFailCallback,this)),this.maps.buildBalloons(e)),"Y"===this.params.SHOW_MAP_IN_PROPS)&&BX("propsMap")&&(t=this.getPropertyMapData(),this.maps.initializePropsMap(t))},getPropertyMapData:function(){var e,t,s,i,a,o=this.options.propertyMap.defaultMapPosition;for(t in this.result.ORDER_PROP.properties)if(this.result.ORDER_PROP.properties.hasOwnProperty(t)&&"Y"==(s=this.result.ORDER_PROP.properties[t]).IS_LOCATION){e=s.ID;break}return this.locations[e]&&this.locations[e][0]&&this.locations[e][0].coordinates&&(s=this.locations[e][0].coordinates,i=parseFloat(s.LONGITUDE),a=parseFloat(s.LATITUDE),isNaN(i)||isNaN(a)||0==i||0==a||(o.lon=i,o.lat=a)),o},resizeMapContainers:function(){var e,t=BX("pickUpMap"),s=BX("propsMap");"Y"===this.params.SHOW_PICKUP_MAP&&t&&(e=BX.findParent(t),document.documentElement.clientWidth<1366&&400<=document.documentElement.clientWidth?t.style.height="280px":document.documentElement.clientWidth<400?t.style.height="240px":t.style.height="345px",t.style.width="0px",t.style.width=e.clientWidth+"px"),"Y"===this.params.SHOW_MAP_IN_PROPS&&s&&(e=BX.findParent(s),document.documentElement.clientWidth<1366?s.style.height="280px":document.documentElement.clientWidth<400?s.style.height="240px":s.style.height="345px",s.style.width="0px",s.style.width=e.clientWidth+"px")},editPickUpMap:function(e){"Y"===this.params.SHOW_PICKUP_MAP&&e.appendChild(BX.create("DIV",{props:{id:"pickUpMap"},style:{width:"100%",marginBottom:"18px"}}))},editPickUpLoader:function(e){e.appendChild(BX.create("DIV",{props:{id:"pickUpLoader",className:"text-center"},children:[BX.create("IMG",{props:{src:this.templateFolder+"/images/loader.gif"}})]}))},editPickUpList:function(e){if(console.log(e),this.pickUpPagination.currentPage&&this.pickUpPagination.currentPage.length){BX.remove(BX("pickUpLoader"));var t,s,i,a,o,r,l=BX.create("DIV",{props:{className:"bx-soa-pickup-list main"}}),n=BX("BUYER_STORE"),c=!1;if(n&&(t=n.value),(a=(a=this.pickUpBlockNode.querySelector(".bx-soa-pickup-list.recommend"))||this.pickUpHiddenBlockNode.querySelector(".bx-soa-pickup-list.recommend"))&&a.querySelector(".bx-soa-pickup-list-item.bx-selected"))c=!0;else if((o=this.getSelectedDelivery())&&o.STORE)for(i=0;i.pickup-container"))||this.pickUpBlockNode.querySelector(".bx_soa_pickup>.pickup-container")).appendChild(l):(s=this.pickUpBlockNode.querySelector(".bx-soa-pickup-list.main"),BX.insertAfter(l,s),BX.remove(s)),this.pickUpPagination.show&&this.showPagination("pickUp",l)}},pickUpFinalAction:function(){var e,t=this.getSelectedDelivery();t&&(e=this.lastSelectedDelivery!==parseInt(t.ID),this.lastSelectedDelivery=parseInt(t.ID)),e&&this.pickUpBlockNode.id!==this.activeSectionId&&BX.removeClass(this.pickUpBlockNode,"bx-step-completed"),this.maps&&this.maps.pickUpFinalAction()},getStoreInfoHtml:function(e){var t="";return e.DESCRIPTION&&(t+=BX.util.htmlspecialchars(e.DESCRIPTION)+"
"),e.SCHEDULE&&(t+=BX.util.htmlspecialchars(e.SCHEDULE)+"
"),e.PHONE&&(t+=BX.util.htmlspecialchars(e.PHONE)+"
"),t},createPickUpItem:function(e,t){t=t||{};var s,i,a,o,r="bx-soa-pickup-l-item-detail",l="bx-soa-pickup-l-item-btn";return"Y"===this.params.SHOW_STORES_IMAGES?(i=this.getImageSources(e,"IMAGE_ID"),(o=i&&i.src_1x)?s=BX.create("IMG",{props:{src:o,className:"bx-soa-pickup-l-item-img"},events:{click:BX.delegate(function(e){this.popupShow(e,i&&i.src_orig||o)},this)}}):r+=" no-image"):(r+=" no-image",l+=" no-image"),a=this.getStoreInfoHtml(e),e=BX.create("DIV",{props:{className:"bx-soa-pickup-list-item",id:"store-"+e.ID},children:[BX.create("DIV",{props:{className:"bx-soa-pickup-l-item-name"},text:e.TITLE}),BX.create("DIV",{props:{className:"bx-soa-pickup-l-item-adress"},children:t.distance?[BX.util.htmlspecialchars(e.ADDRESS)," ( ~"+t.distance+" "+BX.message("SOA_DISTANCE_KM")+" ) "]:[BX.util.htmlspecialchars(e.ADDRESS)]}),BX.create("DIV",{props:{className:r},children:[s,BX.create("DIV",{props:{className:"bx-soa-pickup-l-item-desc"},html:a})]}),BX.create("DIV",{props:{className:l},children:[BX.create("A",{props:{href:"",className:"btn btn-sm"+(t.selected?" btn-default":"")},html:t.selected?this.params.MESS_SELECTED_PICKUP:this.params.MESS_SELECT_PICKUP,events:{click:BX.delegate(function(e){e.preventDefault(),this.selectStore(e),this.clickNextAction(e)},this)}})]})],events:{click:BX.proxy(this.selectStore,this)}}),t.selected&&BX.addClass(e,"bx-selected"),e},editPickUpRecommendList:function(e){if(this.maps&&this.maps.canUseRecommendList()&&e){BX.remove(BX("pickUpLoader"));for(var t,s,i,a=BX.create("DIV",{props:{className:"bx-soa-pickup-list recommend"}}),o=BX("BUYER_STORE"),r=this.getSelectedDelivery(),l=this.maps.getRecommendedStoreIds(e),n=0;n.pickup-container")||this.pickUpBlockNode.querySelector(".bx_soa_pickup>.pickup-container")).appendChild(a)}},selectStore:function(e){var t,s,i,a,o,r,l,n=BX("BUYER_STORE");if(BX.type.isString(e)){if(!(t=BX("store-"+e))){for(i=0;it.OWN_NAME.toLowerCase()?1:e.OWN_NAME.toLowerCase()";"true"===this.propsBlockNode.getAttribute("data-visited")&&(n=this.isValidPropertiesBlock()).length&&this.showError(this.propsBlockNode,n),BX.bind(e.querySelector(".alert.alert-danger"),"click",BX.proxy(this.showByClick,this)),BX.bind(e.querySelector(".alert.alert-warning"),"click",BX.proxy(this.showByClick,this))}},editPropsItems:function(e){if(this.result.ORDER_PROP&&this.propertyCollection){for(var t,s,i,a=BX.create("DIV",{props:{className:"bx-soa-customer"}}),o=this.propertyCollection.getGroupIterator(),a=a||this.propsBlockNode.querySelector(".bx-soa-customer");t=o();)for(i=t.getIterator();s=i();)this.deliveryLocationInfo.loc!=s.getId()&&this.deliveryLocationInfo.zip!=s.getId()&&this.deliveryLocationInfo.city!=s.getId()&&this.getPropertyRowNode(s,a,!1);e.appendChild(a)}},getPropertyRowNode:function(e,t,s){var i=BX.create("DIV"),a="",o=e.getType()||"",r=e.getDescription()||"";switch(s?i.innerHTML=""+BX.util.htmlspecialchars(e.getName())+": ":(BX.addClass(i,"form-group bx-soa-customer-field"),a+=BX.util.htmlspecialchars(e.getName()).trim(),e.isRequired()&&(a+='* '),r.length&&"STRING"!=o&&"NUMBER"!=o&&"DATE"!=o&&(a+=" ("+BX.util.htmlspecialchars(r)+")"),r=BX.create("LABEL",{attrs:{for:"soa-property-"+e.getId()},props:{className:"bx-soa-custom-label"},html:a}),i.setAttribute("data-property-id-row",e.getId()),i.appendChild(r)),o){case"LOCATION":this.insertLocationProperty(e,i,s);break;case"DATE":this.insertDateProperty(e,i,s);break;case"FILE":this.insertFileProperty(e,i,s);break;case"STRING":this.insertStringProperty(e,i,s);break;case"ENUM":this.insertEnumProperty(e,i,s);break;case"Y/N":this.insertYNProperty(e,i,s);break;case"NUMBER":this.insertNumberProperty(e,i,s)}t.appendChild(i)},insertLocationProperty:function(e,t,s){var i,a,o,r,l,n,c,p,h=[];if(e.getId()in this.locations)if(s){if(i=this.propsHiddenBlockNode.querySelector('[data-property-id-row="'+e.getId()+'"]'))for(a=i.querySelectorAll("div.bx-soa-loc"),c=0;c")}else{for(n=BX.create("DIV",{props:{className:"soa-property-container"}}),i=this.locations[e.getId()],c=0;c"));this.showValidationResult(e.inputs,a)}return a},bindValidation:function(e,t){if(this.validation.properties&&this.validation.properties[e]){var s,i,e=this.validation.properties[e],a=this.getValidationData(e,t);if(a&&a.inputs&&a.action)for(s=0;s"),i?a=i.querySelector("div.tooltip-inner"):(a=BX.create("DIV",{props:{className:"tooltip-inner"}}),i=BX.create("DIV",{props:{id:"tooltip-"+e,className:"bx-soa-tooltip bx-soa-tooltip-static bx-soa-tooltip-danger tooltip top"},children:[BX.create("DIV",{props:{className:"tooltip-arrow"}}),a]}),(e=t.parentNode.querySelector("div.quick-locations"))&&(t=e),BX.insertAfter(i,t)),a.innerHTML=s,"opened"!=i.getAttribute("data-state"))&&(i.setAttribute("data-state","opened"),i.style.opacity=0,i.style.display="block",new BX.easing({duration:150,start:{opacity:0},finish:{opacity:100},transition:BX.easing.transitions.quad,step:function(e){i.style.opacity=e.opacity/100}}).animate())},closeErrorTooltip:function(e){var t=BX("tooltip-"+e);t&&(t.setAttribute("data-state","closed"),new BX.easing({duration:150,start:{opacity:100},finish:{opacity:0},transition:BX.easing.transitions.quad,step:function(e){t.style.opacity=e.opacity/100},complete:function(){t.style.display="none"}}).animate())},showValidationResult:function(e,t){if(e&&e.length&&t){var s,i,a,o=(BX.type.isElementNode(e[0])?e:e[0])[0],o=BX.findParent(o,{tagName:"DIV",className:"form-group"}).querySelector("label");for(o&&(s=o.getAttribute("for")),a=0;a")):this.closeErrorTooltip(s)}},validateString:function(e,t,s){var i,a,o;return e&&t?(i=e.value,a=[],o=BX.util.htmlspecialchars(t.NAME),s=s?BX.message("SOA_FIELD")+' "'+o+'"':BX.message("SOA_FIELD"),"Y"!==t.MULTIPLE&&("Y"===t.REQUIRED&&0===i.length&&a.push(s+" "+BX.message("SOA_REQUIRED")),i.length)&&(t.MINLENGTH&&t.MINLENGTH>i.length&&a.push(BX.message("SOA_MIN_LENGTH")+' "'+o+'" '+BX.message("SOA_LESS")+" "+t.MINLENGTH+" "+BX.message("SOA_SYMBOLS")),t.MAXLENGTH&&t.MAXLENGTH()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(i)&&a.push(BX.message("SOA_INVALID_EMAIL")),0parseFloat(e)&&i.push(BX.message("SOA_MIN_VALUE")+' "'+a+'" '+parseFloat(t.MIN)),t.MAX&&parseFloat(t.MAX)parseInt(t.MAXSIZE)&&l.push(BX.message("SOA_MAX_SIZE")+' "'+o+'" ('+this.getSizeString(t.MAXSIZE,1)+")");else l.push(s+" "+BX.message("SOA_REQUIRED"));return l},validateDate:function(e,t,s){var i,a;return e&&t?(e=e.value,i=[],a=BX.util.htmlspecialchars(t.NAME),s=s?BX.message("SOA_FIELD")+' "'+a+'"':BX.message("SOA_FIELD"),"Y"!=t.MULTIPLE&&"Y"==t.REQUIRED&&0==e.length&&i.push(s+" "+BX.message("SOA_REQUIRED")),i):[]},editPropsMap:function(e){var t=BX.create("DIV",{props:{className:""},style:{marginBottom:"10px"}}),s=BX.create("DIV",{props:{id:"propsMap"},style:{width:"100%"}});t.appendChild(s),e.appendChild(t)},editPropsComment:function(e){var t=BX.create("DIV",{props:{className:""}}),s=BX.create("LABEL",{attrs:{for:"orderDescription"},props:{className:"bx-soa-customer-label"},html:this.params.MESS_ORDER_DESC}),i=BX.create("TEXTAREA",{props:{id:"orderDescription",cols:"4",className:"form-control bx-soa-customer-textarea bx-ios-fix",name:"ORDER_DESCRIPTION"},text:this.result.ORDER_DESCRIPTION||""}),s=BX.create("DIV",{props:{className:"form-group bx-soa-customer-field"},children:[s,i]});t.appendChild(s),e.appendChild(t)},editTotalBlock:function(){if(this.totalInfoBlockNode&&this.result.TOTAL){var e,t,s,i,a,o=this.result.TOTAL,r={},l="Y"===this.params.SHOW_TOTAL_ORDER_BUTTON;if(BX.cleanNode(this.totalInfoBlockNode),0===parseFloat(o.ORDER_PRICE)?(i=this.params.MESS_PRICE_FREE,r.free=!0):i=o.ORDER_PRICE_FORMATED,this.options.showPriceWithoutDiscount,Number(o.DISCOUNT_PRICE)&&this.totalInfoBlockNode.appendChild(BX.create("SPAN",{props:{className:"discount_procent"},html:`-${Math.round(Number(o.DISCOUNT_PRICE)/(Number(o.PRICE_WITHOUT_DISCOUNT_VALUE)/100))}%`})),this.options.showPayedFromInnerBudget?(this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("SOA_SUM_IT"),o.ORDER_TOTAL_PRICE_FORMATED,{total:!0})),Number(this.params.MIN_SUM_TO_PAYMENT)>Number(this.result.TOTAL.ORDER_TOTAL_PRICE)&&this.totalInfoBlockNode.appendChild(this.createMinimumSumBlock()),this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("SOA_SUM_PAYED"),o.PAYED_FROM_ACCOUNT_FORMATED)),this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("SOA_SUM_LEFT_TO_PAY"),o.ORDER_TOTAL_LEFT_TO_PAY_FORMATED))):(this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("SOA_SUM_IT"),o.ORDER_TOTAL_PRICE_FORMATED,{total:!0})),Number(this.params.MIN_SUM_TO_PAYMENT)>Number(this.result.TOTAL.ORDER_TOTAL_PRICE)&&this.totalInfoBlockNode.appendChild(this.createMinimumSumBlock())),this.options.showDiscountPrice&&(s=this.params.MESS_ECONOMY,o.DISCOUNT_PERCENT_FORMATED&&0parseFloat(s.DELIVERY_DISCOUNT_PRICE)&&(a+='
'+s.PRICE_FORMATED+""),r.delivery=!0),this.result.DELIVERY.length&&this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("SOA_SUM_DELIVERY"),a,r)),0<=parseFloat(o.PAY_SYSTEM_PRICE)&&this.result.DELIVERY.length&&this.totalInfoBlockNode.appendChild(this.createTotalUnit(BX.message("SOA_PAYSYSTEM_PRICE"),"~"+o.PAY_SYSTEM_PRICE_FORMATTED)),this.result.SHOW_AUTH||"Y"!==this.params.SHOW_TOTAL_ORDER_BUTTON||this.totalInfoBlockNode.appendChild(BX.create("DIV",{props:{className:"bx-soa-cart-total-button-container"+(l?"":" visible-xs")},children:[BX.create("A",{props:{href:"javascript:void(0)",className:"btn btn-default btn-lg btn-order-save"},html:this.params.MESS_ORDER,events:{click:BX.proxy(this.clickOrderSaveAction,this)}})]})),"Y"===this.params.SHOW_COUPONS&&"Y"===this.params.SHOW_COUPONS_TOTAL&&this.editCoupons(this.totalInfoBlockNode),this.editMobileTotalBlock()}},editMobileTotalBlock:function(){},createTotalUnit:function(e,t,s){var i="bx-soa-cart-total-line";return e=e||"",t=t||"",t=(s=s||{}).error?[BX.create("A",{props:{className:"bx-soa-price-not-calc"},html:t,events:{click:BX.delegate(function(){this.animateScrollTo(this.deliveryBlockNode)},this)}})]:s.free?[BX.create("SPAN",{props:{className:"bx-soa-price-free"},html:t})]:[t],s.total&&(i+=" bx-soa-cart-total-line-total"),s.highlighted&&(i+=" bx-soa-cart-total-line-highlighted"),s.delivery&&(i+=" bx-soa-cart-total-line-delivery"),BX.create("DIV",{props:{className:i},children:[BX.create("SPAN",{props:{className:"bx-soa-cart-t"},text:e}),BX.create("SPAN",{props:{className:"bx-soa-cart-border"}}),BX.create("SPAN",{props:{className:"bx-soa-cart-d"+(s.total&&this.options.totalPriceChanged?" bx-soa-changeCostSign":"")},children:t})]})},createMinimumSumBlock:function(){var e=BX.Currency.currencyFormat(this.params.MIN_SUM_TO_PAYMENT,this.currency,!0);return BX.create("DIV",{props:{className:"minimum-sum-block"},children:[BX.create("DIV",{props:{className:"minimum-sum-block_top"},children:[BX.create("DIV",{props:{className:"minimum-sum-block_left"},children:[BX.create("DIV",{props:{className:"minimum-sum-block_name"},text:this.params.MIN_SUM_TO_PAYMENT_TITLE}),BX.create("DIV",{props:{className:"minimum-sum-block_sum"},html:e})]}),BX.create("DIV",{props:{className:"bx-soa-pp-info"}})]}),BX.create("A",{props:{className:"minimum-sum-block_link btn btn-default btn-lg",href:this.params.EMPTY_BASKET_HINT_PATH},text:this.params.ADDED_TO_ORDER})]})},basketBlockScrollCheckEvent:function(e){var e=e.target||e.srcElement,t=e.scrollLeft,s=e.scrollWidth-(t+e.clientWidth),e=e.parentNode;0==t?BX.removeClass(e,"bx-soa-table-fade-left"):BX.addClass(e,"bx-soa-table-fade-left"),0==s?BX.removeClass(e,"bx-soa-table-fade-right"):BX.addClass(e,"bx-soa-table-fade-right")},basketBlockScrollCheck:function(){for(var e,t,s,i=this.orderBlockNode.querySelectorAll("div.bx-soa-table-fade"),a=!1,o=0;o0&&this.opts.callback in window)window[this.opts.callback].apply(this,[e,this])}},disableKeyboardInput:false,dontShowNextChoice:false,pseudoValues:[],provideLinkBy:"id",requestParamsInject:false},vars:{cache:{nodesByCode:{}}},sys:{code:"slst"},flags:{skipAfterSelectItemEventOnce:false}});this.handleInitStack(t,BX.Sale.component.location.selector.steps,e)};BX.extend(BX.Sale.component.location.selector.steps,BX.ui.chainedSelectors);BX.merge(BX.Sale.component.location.selector.steps.prototype,{init:function(){this.pushFuncStack("buildUpDOM",BX.Sale.component.location.selector.steps);this.pushFuncStack("bindEvents",BX.Sale.component.location.selector.steps)},buildUpDOM:function(){},bindEvents:function(){var e=this,t=this.opts;if(t.disableKeyboardInput){this.bindEvent("after-control-placed",function(e){var t=e.getControl();BX.unbindAll(t.ctrls.toggle);BX.bind(t.ctrls.scope,"click",function(e){t.toggleDropDown()})})}BX.bindDelegate(this.getControl("quick-locations",true),"click",{tag:"a"},function(){e.setValueByLocationId(BX.data(this,"id"))})},setValueByLocationId:function(e){BX.Sale.component.location.selector.steps.superclass.setValue.apply(this,[e])},setValueByLocationIds:function(e){if(!e.PARENT_ID)return;this.flags.skipAfterSelectItemEventOnce=true;this.setValueByLocationId(e.PARENT_ID);this.bindEvent("after-control-placed",function(t){var s=t.getControl();if(s.vars.value!=false)return;if(e.IDS)this.opts.requestParamsInject={filter:{"=ID":e.IDS}};s.tryDisplayPage("toggle")})},setValueByLocationCode:function(e){var t=this.vars;if(e==null||e==false||typeof e=="undefined"||e.toString().length==0){this.displayRoute([]);this.setValueVariable("");this.setTargetValue("");this.fireEvent("after-clear-selection");return}this.fireEvent("before-set-value",[e]);var s=new BX.deferred;var i=this;s.done(BX.proxy(function(s){this.displayRoute(s);var i=t.cache.nodesByCode[e].VALUE;t.value=i;this.setTargetValue(this.checkCanSelectItem(i)?i:this.getLastValidValue())},this));s.fail(function(e){if(e=="notfound"){i.displayRoute([]);i.setValueVariable("");i.setTargetValue("");i.showError({errors:[i.opts.messages.nothingFound],type:"server-logic",options:{}})}});this.hideError();this.getRouteToNodeByCode(e,s)},setValue:function(e){if(this.opts.provideLinkBy=="id")BX.Sale.component.location.selector.steps.superclass.setValue.apply(this,[e]);else this.setValueByLocationCode(e)},setTargetValue:function(e){this.setTargetInputValue(this.opts.provideLinkBy=="code"?e?this.vars.cache.nodes[e].CODE:"":e);if(!this.flags.skipAfterSelectItemEventOnce)this.fireEvent("after-select-item",[e]);else this.flags.skipAfterSelectItemEventOnce=false},getValue:function(){if(this.opts.provideLinkBy=="id")return this.vars.value===false?"":this.vars.value;else{return this.vars.value?this.vars.cache.nodes[this.vars.value].CODE:""}},getNodeByLocationId:function(e){return this.vars.cache.nodes[e]},getSelectedPath:function(){var e=this.vars,t=[];if(typeof e.value=="undefined"||e.value==false||e.value=="")return t;if(typeof e.cache.nodes[e.value]!="undefined"){var s=e.cache.nodes[e.value];while(typeof s!="undefined"){var i=BX.clone(s);var n=i.PARENT_VALUE;delete i.PATH;delete i.PARENT_VALUE;delete i.IS_PARENT;if(typeof i.TYPE_ID!="undefined"&&typeof this.opts.types!="undefined")i.TYPE=this.opts.types[i.TYPE_ID].CODE;t.push(i);if(typeof n=="undefined"||typeof e.cache.nodes[n]=="undefined")break;else s=e.cache.nodes[n]}}return t},setInitialValue:function(){if(this.opts.selectedItem!==false)this.setValueByLocationId(this.opts.selectedItem);else if(this.ctrls.inputs.origin.value.length>0){if(this.opts.provideLinkBy=="id")this.setValueByLocationId(this.ctrls.inputs.origin.value);else this.setValueByLocationCode(this.ctrls.inputs.origin.value)}},getRouteToNodeByCode:function(e,t){var s=this.vars,i=this;if(typeof e!="undefined"&&e!==false&&e.toString().length>0){var n=[];if(typeof s.cache.nodesByCode[e]!="undefined")n=this.getRouteToNodeFromCache(s.cache.nodesByCode[e].VALUE);if(n.length==0){i.downloadBundle({request:{CODE:e},callbacks:{onLoad:function(o){for(var a in o){if(typeof s.cache.links[a]=="undefined")s.cache.incomplete[a]=true}i.fillCache(o,true);n=[];if(typeof s.cache.nodesByCode[e]!="undefined")n=this.getRouteToNodeFromCache(s.cache.nodesByCode[e].VALUE);if(n.length==0)t.reject("notfound");else t.resolve(n)},onError:function(){t.reject("internal")}},options:{}})}else t.resolve(n)}else t.resolve([])},addItem2Cache:function(e){this.vars.cache.nodes[e.VALUE]=e;this.vars.cache.nodesByCode[e.CODE]=e},controlChangeActions:function(e,t){var s=this,i=this.opts,n=this.vars,o=this.ctrls;this.hideError();if(t.length==0){s.truncateStack(e);n.value=s.getLastValidValue();s.setTargetValue(n.value);this.fireEvent("after-select-real-value")}else if(BX.util.in_array(t,i.pseudoValues)){s.truncateStack(e);s.setTargetValue(s.getLastValidValue());this.fireEvent("after-select-item",[t]);this.fireEvent("after-select-pseudo-value")}else{var a=n.cache.nodes[t];if(typeof a=="undefined")throw new Error("Selected node not found in the cache");s.truncateStack(e);if(i.dontShowNextChoice){if(a.IS_UNCHOOSABLE)s.appendControl(t)}else{if(typeof n.cache.links[t]!="undefined"||a.IS_PARENT)s.appendControl(t)}if(s.checkCanSelectItem(t)){n.value=t;s.setTargetValue(t);this.fireEvent("after-select-real-value")}}},refineRequest:function(e){var t={};var s={VALUE:"ID",DISPLAY:"NAME.NAME",1:"TYPE_ID",2:"CODE"};var i={};if(typeof e["PARENT_VALUE"]!="undefined"){t["=PARENT_ID"]=e.PARENT_VALUE;s["10"]="IS_PARENT"}if(typeof e["VALUE"]!="undefined"){t["=ID"]=e.VALUE;i["1"]="PATH"}if(BX.type.isNotEmptyString(e["CODE"])){t["=CODE"]=e.CODE;i["1"]="PATH"}if(BX.type.isNotEmptyString(this.opts.query.BEHAVIOUR.LANGUAGE_ID))t["=NAME.LANGUAGE_ID"]=this.opts.query.BEHAVIOUR.LANGUAGE_ID;if(BX.type.isNotEmptyString(this.opts.query.FILTER.SITE_ID)){if(typeof this.vars.cache.nodes[e.PARENT_VALUE]=="undefined"||this.vars.cache.nodes[e.PARENT_VALUE].IS_UNCHOOSABLE)t["=SITE_ID"]=this.opts.query.FILTER.SITE_ID}var n={select:s,filter:t,additionals:i,version:"2"};if(this.opts.requestParamsInject){for(var o in this.opts.requestParamsInject){if(this.opts.requestParamsInject.hasOwnProperty(o)){if(n[o]==undefined)n[o]={};for(var a in this.opts.requestParamsInject[o]){if(this.opts.requestParamsInject[o].hasOwnProperty(a)){if(n[o][a]!=undefined){var r=n[o][a];n[o][a]=[];n[o][a].push(r)}else{n[o][a]=[]}for(var l in this.opts.requestParamsInject[o][a])if(this.opts.requestParamsInject[o][a].hasOwnProperty(l))n[o][a].push(this.opts.requestParamsInject[o][a][l])}}}}}return n},refineResponce:function(e,t){if(e.length==0)return e;if(typeof t.PARENT_VALUE!="undefined"){var s={};s[t.PARENT_VALUE]=e["ITEMS"];e=s}else if(typeof t.VALUE!="undefined"||typeof t.CODE!="undefined"){var i={};if(typeof e.ITEMS[0]!="undefined"&&typeof e.ETC.PATH_ITEMS!="undefined"){var n=0;for(var o=e.ITEMS[0]["PATH"].length-1;o>=0;o--){var a=e.ITEMS[0]["PATH"][o];var r=e.ETC.PATH_ITEMS[a];r.IS_PARENT=true;i[n]=[r];n=r.VALUE}i[n]=[e.ITEMS[0]]}e=i}return e},showError:function(e){if(e.type!="server-logic")e.errors=[this.opts.messages.error];this.ctrls.errorMessage.innerHTML='

'+BX.util.htmlspecialchars(e.errors.join(", "))+"

";BX.show(this.ctrls.errorMessage);BX.debug(e)}})} /* End */ ; ; /* Start:"a:4:{s:4:"full";s:112:"/bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/scripts/yandex_maps.min.js?17196437525757";s:6:"source";s:93:"/bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/scripts/yandex_maps.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ BX.namespace("BX.Sale.OrderAjaxComponent.Maps"),BX.Sale.OrderAjaxComponent.Maps={init:function(t){return this.context=t||{},this.pickUpOptions=this.context.options.pickUpMap,this.propsOptions=this.context.options.propertyMap,this.maxWaitTimeExpired=!1,this},initializePickUpMap:function(t){ymaps&&(this.pickUpMap=new ymaps.Map("pickUpMap",{center:t?[t.GPS_N,t.GPS_S]:[this.pickUpOptions.defaultMapPosition.lat,this.pickUpOptions.defaultMapPosition.lon],zoom:this.pickUpOptions.defaultMapPosition.zoom},{autoFitToViewport:"always"}),this.pickUpMap.behaviors.disable("scrollZoom"),this.pickUpMap.events.add("click",BX.delegate(function(){this.pickUpMap.balloon.isOpen()&&this.pickUpMap.balloon.close()},this)))},pickUpMapFocusWaiter:function(){this.pickUpMap&&this.pickUpMap.geoObjects?this.setPickUpMapFocus():setTimeout(BX.proxy(this.pickUpMapFocusWaiter,this),100)},setPickUpMapFocus:function(){var t,e,s=this.pickUpMap.geoObjects.getBounds();s&&s.length&&(t=s[1][0]-s[0][0],e=s[1][1]-s[0][1],s[0][0]-=t/10,s[0][1]-=e/10,s[1][0]+=t/10,s[1][1]+=e/10,this.pickUpMap.setBounds(s,{checkZoomRange:!0}))},showNearestPickups:function(e,t){var s,i;ymaps&&(s=this.pickUpOptions.secureGeoLocation&&BX.browser.IsChrome()&&!this.context.isHttps?"yandex":"auto",i=this.pickUpOptions.geoLocationMaxTime||5e3,ymaps.geolocation.get({provider:s,timeOut:i}).then(BX.delegate(function(t){this.maxWaitTimeExpired||(this.maxWaitTimeExpired=!0,t.geoObjects.options.set("preset","islands#darkGreenCircleDotIcon"),this.pickUpMap.geoObjects.add(t.geoObjects),e(t))},this),BX.delegate(function(){this.maxWaitTimeExpired||(this.maxWaitTimeExpired=!0,t())},this)))},buildBalloons:function(t){if(ymaps){var s=this;this.pickUpPointsJSON=[];for(var e=0;e"+BX.util.htmlspecialchars(t[e].ADDRESS),storeTitle:t[e].TITLE,storeBody:i,id:t[e].ID,text:this.context.params.MESS_SELECT_PICKUP},{balloonContentLayout:ymaps.templateLayoutFactory.createClass('

{{ properties.storeTitle }}

{{ properties.storeBody|raw }}
{{ properties.text }}',{build:function(){this.constructor.superclass.build.call(this);var t=document.querySelector("a[data-store]");t&&BX.bind(t,"click",this.selectStoreByClick)},clear:function(){var t=document.querySelector("a[data-store]");t&&BX.unbind(t,"click",this.selectStoreByClick),this.constructor.superclass.clear.call(this)},selectStoreByClick:function(t){var e=t.target||t.srcElement;s.pickUpMap.container.isFullscreen()&&s.pickUpMap.container.exitFullscreen(),s.context.selectStore(e.getAttribute("data-store")),s.context.clickNextAction(t),s.pickUpMap.balloon.close()}})}));BX("BUYER_STORE").value===t[e].ID&&i.options.set("preset","islands#redDotIcon"),this.pickUpMap.geoObjects.add(i)}}},selectBalloon:function(e){this.pickUpMap&&this.pickUpMap.geoObjects&&this.pickUpMap.geoObjects.each(BX.delegate(function(t){t.properties.get("id")&&t.options.unset("preset"),t.properties.get("id")===e&&(t.options.set({preset:"islands#redDotIcon"}),this.pickUpMap.panTo([t.geometry.getCoordinates()]))},this))},pickUpFinalAction:function(){var e;this.pickUpMap&&this.pickUpMap.geoObjects&&(e=BX("BUYER_STORE"),this.pickUpMap.geoObjects.each(function(t){t.properties.get("id")===e.value?t.options.set({preset:"islands#redDotIcon"}):0"),t.PHONE&&(e+=BX.message("SOA_PICKUP_PHONE")+": "+BX.util.htmlspecialchars(t.PHONE)+"
"),t.SCHEDULE&&(e+=BX.message("SOA_PICKUP_WORK")+": "+BX.util.htmlspecialchars(t.SCHEDULE)+"
"),t.DESCRIPTION&&(e+=BX.message("SOA_PICKUP_DESC")+": "+BX.util.htmlspecialchars(t.DESCRIPTION)+"
"),e}}; /* End */ ;; /* /bitrix/components/bitrix/sale.location.selector.search/templates/.default/script.min.js?16896756187796*/ ; /* /bitrix/components/ipol/ipol.dpdPickup/templates/order/script.js?16914097072688*/ ; /* /bitrix/components/ipol/ipol.dpdPickup/templates/order/bitrix/map.yandex.view/dpd.pickup/script.js?15884447701505*/ ; /* /bitrix/components/ipol/ipol.dpdPickup/templates/order/map.js?163578697811286*/ ; /* /bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/script.min.js?17077613675850*/ ; /* /bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/scripts/masked.min.js?17077613679560*/ ; /* /bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/order_ajax.min.js?1719643752150269*/ ; /* /bitrix/components/bitrix/sale.location.selector.steps/templates/.default/script.min.js?16093382657752*/ ; /* /bitrix/templates/dresscode/components/bitrix/sale.order.ajax/.default/scripts/yandex_maps.min.js?17196437525757*/ //# sourceMappingURL=page_52b8965cc5f73a3a5b03054ac1c0caae.map.js