PageSourceSearch

https://tokatta.com.ua/bundles/default/production/main-e498c03b.b31af0c5c3d760a95f83.js

js tokatta.com.ua collected 2026-10-07 11:37:27 UTC 28,709 bytes, 1 lines download raw bytes

1(self.webpackChunkHoroshop=self.webpackChunkHoroshop||[]).push([[4415],{9629:function(t,e,n){!function(t,e){var n=function(){!1!==this.trigger("beforeInit")&&(this.init(),this.trigger("afterInit"))},i=function(e,i){this.container=t(e),this.owner=i,this.name=this.container.data("component"),n.call(this)};i.extend=function(e){var n=this,r=function(){n.apply(this,arguments)};r.extend=i.extend,t.extend(r.prototype,n.prototype),t.extend(r.prototype,e);var o=t.extend({},n.prototype);return r.prototype.parent=function(t){o[t].apply(this,Array.prototype.slice.call(arguments,1))},r},i.prototype={init:function(){},performAction:function(t,e,n){var i=this;return!1!==this.trigger("beforeAction",t,e)&&(this.trigger("beforeAjax"),this.owner.performAction("component/"+this.name+"/"+t,e,function(r,o){"function"==typeof n&&n(r,o),i.trigger("afterAction",t,e),i.trigger("afterAjax")}))},render:function(){var t=this;!1!==this.trigger("beforeRender")&&this.performAction("index",{},function(e,n){"OK"===e&&t.replaceHtml(n.html),t.trigger("afterRender")})},replaceHtml:function(e){if(!1!==this.trigger("beforeReplaceHtml")){var n=t(e),i=n.prop("attributes");this.container.html(n.html());var r=this.container;t.each(i,function(){r.attr(this.name,this.value)}),this.trigger("afterReplaceHtml")}},getFieldName:function(t){var e=t.indexOf("["),n=-1!==e?t.substr(0,e):t,i=-1!==e?t.substr(e):"";return this.name+"["+n+"]"+i},disableComponent:function(){this.container.addClass(this.owner.disabledClass)},enableComponent:function(){this.container.removeClass(this.owner.disabledClass)}},t.extend(i.prototype,TMEvents),e.CheckoutComponent=i}(n(3521),window)},197:function(t,e,n){var i,r,o,a=n(3521);i=a,r=window,o=CheckoutRecipient.extend({initSearch:function(){this.parent("initSearch"),this.initCountrySearch(),IntlTelInputManager.init("delivery-phone-country-recipient")},setCountry:function(t,e){var n=this,r=this.container.find(':input[name="'+this.getFieldName("delivery_country")+'"]'),o=this.container.find(':input[name="'+this.getFieldName("delivery_city")+'"]'),a=r.siblings(".j-country-loader"),s=this.container.find(':input[name="'+this.getFieldName("delivery_country_id")+'"]');s.attr("value",t),a.show(),e=i.trim(e),r.val(e),this.trigger("onBeforeChangeCountry"),this.performAction("setCountry",{value:e,id:t},function(t,i){r.errorBox(),o.errorBox(),a.hide(),"OK"===t&&(s.attr("value",i.country_id),n.checkCity(),n.container.find('input[name="'+n.getFieldName("delivery_city")+'"]').val(i.city),n.trigger("changeCountry",r,e)),"VALIDATION_ERROR"===t&&n.owner.setErrors(i.errors),"EMPTY"===t&&answer([{label:l10n("Ничего не найдено"),value:null,disabled:!0}])}),this.countryName=e},setCity:function(t,e,n){let r=this,o=this.container.find(':input[name="'+this.getFieldName("delivery_city")+'"]'),a=this.container.find(':input[name="'+this.getFieldName("delivery_city_id")+'"]');t=i.trim(t),e=i.trim(e),o.val(t),a.val(e),this.trigger("onBeforeChangeCity"),this.performAction("setCity",{cityName:t,cityId:e,npCityDescription:n},function(e,n){"OK"===e&&(o.val(""!=t&&""==n.city?t:n.city),r.trigger("changeCity"),n.city_id&&a.val(n.city_id)),"VALIDATION_ERROR"===e&&r.owner.setErrors(n.errors)}),this.cityVal=t},checkCity:function(){var t=this.container.find(':input[name="'+this.getFieldName("delivery_country_id")+'"]'),e=this.container.find(".delivery_city");""===i.trim(t.val())?e.hide():e.show()},initCountrySearch:function(){var t=this,e=this.container.find('input[name="'+this.getFieldName("delivery_country")+'"]'),n=e.siblings(".j-country-loader"),r=e.siblings(".j-search-icon");e.on("input",function(){t.container.find(':input[name="'+t.getFieldName("delivery_country_id")+'"]').attr("value",""),t.checkCity()}),e.on("focus",function(){r.show(),e.parent().addClass("form-item--search")}).on("focusout",function(){r.hide(),e.parent().removeClass("form-item--search")}),0!==e.length&&(t.countryName=i.trim(e.val()||""),e.autocomplete({autoFocus:!0,minLength:2,source:function(e,i){n.show(),t.performAction("findCountries",{term:e.term},function(t,e){n.hide(),"OK"===t&&i(e.countries),"EMPTY"===t&&i([{label:l10n("Ничего не найдено"),value:null,disabled:!0}])})},select:function(e,n){t.setCountry(n.item.id,n.item.label)},change(e,n){const r=n.item?n.item.label:i(this).val(),o=n.item?n.item.id:"";t.changeProcess=setTimeout(()=>{t.countryName!==r&&t.setCountry(o,r)},300)},create:function(t){i.browser.chrome&&t.target.setAttribute("autocomplete","disabled")}}).data("ui-autocomplete")._renderItem=(t,e)=>i("<li>").append(e.label).addClass(e.disabled?"ui-state-disabled":"").appendTo(t),e.off("keypress.countryRecipient").on("keypress.countryRecipient",function(n){if(13===n.which){
1n.preventDefault(),e.autocomplete("close");var r=i.trim(i(this).val());r!==i.trim(t.countryName||"")&&t.setCountry("",r)}})),this.checkCity()}}),r.CheckoutCountryRecipient=o},9364:function(t,e,n){!function(t,e){let n=CheckoutComponent.extend({init:function(){var t=this;this.attachEventHandler("afterReplaceHtml",function(){t.initDeliveryType(),t.trigger("replaceDeliveryHtml",t.delivery_type,t.delivery_type.val())}),this.initDeliveryType()},initDeliveryType:function(){this.delivery_method=this.container.find(".j-delivery-method"),this.delivery_type=this.container.find(".j-delivery-type");var e=this;this.delivery_type.off("change").on("change",function(){e.setDeliveryType(t(this).val())})},setDeliveryType:function(e){if(this.delivery_type.val(e),t.fn.selectBoxIt)try{this.delivery_type.selectBoxIt("refresh")}catch(t){}var n=this;CheckoutModule.getInstance().disableSubmitButton(),this.performAction("set_delivery_type/"+e,{},function(t,i){"OK"===t?(n.delivery_method.empty().append(i.method),n.trigger("replaceDeliveryHtml"),n.owner.initAttributes(),n.trigger("changeDeliveryType",n.delivery_type,e,i),CheckoutModule.getInstance().enableSubmitButton()):CheckoutModule.getInstance().enableSubmitButton()})},reload:function(){let t=this;this.performAction("reload",{},function(e,n){"OK"===e&&(t.container.empty().append(n.html),t.init(),t.owner.initAttributes())})}});e.CheckoutDelivery=n}(n(3521),window)},8992:function(t,e,n){!function(t,e,n){var i=null,r=null,o=[],a=function(n){this.container=t(n),this.theme="default",this.disabledClass="horoshop_default"===e.GLOBAL.theme?"__disabled":"is-disabled",this.attachEventHandler("afterAjax",function(){this.updateComponents()}),this.init()};a.prototype={init:function(){!1!==this.trigger("beforeInit")&&(this.components=[],this.isPostponeSubmit=!1,this.moduleUri=null,this.initAttributes(),this.initForm(),this.initComponents(),this.trigger("afterInit"))},setUseChangeEvent:function(e){let n=this,i=this.attributes.filter(":not([type=checkbox], [type=radio], .j-has-action)").off("change.CheckoutModule");e&&i.on("change.CheckoutModule",function(){var e=t(this),i=[{name:e.attr("name"),value:e.val()}];n.setAttributes(i)})},setTheme:function(t){this.theme=t},setModuleUri:function(t){this.moduleUri=t},initAttributes:function(){var e=this;this.attributes=this.container.find(":input:not(.j-ignore)"),this.attributes=this.attributes.filter(function(){return""!=t(this).attr("name")}),this.setUseChangeEvent(!0),this.attributes.filter("[type=radio]").off("click.CheckoutModule").on("click.CheckoutModule",function(){var n=t(this),i=[{name:n.attr("name"),value:n.val()}];e.setAttributes(i)}),this.attributes.filter("[type=checkbox]").off("click.CheckoutModule").on("click.CheckoutModule",function(){var n,i=t(this),r=i.siblings('[name="'+i.attr("name")+'"]');n=r.length?i.is(":checked")?i.val():r.val():i.is(":checked")?i.val():0;var o=[{name:i.attr("name"),value:n}];e.setAttributes(o)}),this.attributes.filter("[type=text], [type=email]").off("keypress.CheckoutModule").on("keypress.CheckoutModule",function(t){return 13!=t.which})},clearErrors:function(){this.container.find("input").errorBox()},clearValid:function(){t.fn.validBox&&this.container.find("input").validBox()},setErrors:function(e){for(var n=this.getFields(),i=0;i<n.length;i++){for(var r=t(n[i]).attr("name"),o=t(n[i]).attr("data-relation-input"),a=!0,s=[],c=0;c<e.length;c++)r!=e[c].field&&o!=e[c].field||(s=e[c],a=!1);a?this.setValid(r,"",""):this.setError(s.field,s.message)}this.trigger("onInputErrors",e)},setError:function(t,e,n){var i=this.container.find('[data-relation-input="'+t+'"]');0===i.length&&(i=this.container.find('[name="'+t+'"]')),i.errorBox(e,n)},setValid:function(e,n,i){if(t.fn.validBox){var r=this.container.find('[data-relation-input="'+e+'"]');0===r.length&&(r=this.container.find('[name="'+e+'"]')),r.validBox(n,i)}},getFields:function(){return this.container.find(":input").filter(function(){var e=t(this);return e.is("select")||!e.is(":hidden, :submit")})},initComponents:function(){this.clearComponents(),this.updateComponents()},initForm:function(){var e=this.container.is("form")?this.container:this.container.find("form"),n=this;this.submitting=!1,e.off("submit").on("submit",function(){return t(e).find("input").blur(),AjaxCart.getInstance().getIsBusy()?setTimeout(function(){t(e).submit()},500):n.submit(),!1}),this.submit_btn=e.find(".j-submit"),this.save_btn=t(".j-save-and-exit, .just-save-button")},submit:function(){if(this.submitting)return this.isPostponeSubmit=!0,void this.trigger("onSubmitPending");if(!1!==this.trigger("onBeforeSubmit")){this.submitting=!0;var t=(this.container.is("form")?this.container:this.container.find("form")).serializeArray();t.push({name:"analytics",value:JSON.stringify(AnalyticsHelper.getDataInJson())});var n=this;this.performAction("submit",t,function(t,i){n.clearErrors(),n.clearValid(),n.trigger("onAfterSubmit",t,i);var r=!1;if("OK"===t){r=!0;var o=i.attributes;e.triggerMarketingEvent&&e.triggerMarketingEvent("checkout_success",o?[o.order_id,o.cart,o.name,o.email,o.phone,o.eventId]:null),window.location.href=i.redirect}else"ERROR_VALIDATION"===t?n.setErrors(i.errors):"ERROR_OTHER"===t?(AjaxCart.getInstance().reloadHtml(),n.setErrors(i.errors)):["ERROR_DISCOUNT","ERROR_UNAVAILABLE_PRODUCTS"].includes(t)?n.renderModal(i.modal):"ERROR_NO_PRODUCTS_FOR_ORDER"===t&&window.location.reload();n.submitting=r})}else this.trigger("onSubmitError")},renderModal:function(e){const n=t(e).attr("id"),i=t("#checkoutModalContainer");t("#"+n).remove(),i.append(e),this.trigger("onModalAppend",n)},attachComponent:function(i){var r=t(i),o=r.attr("data-component-handler")?r.attr("data-component-handler"):r.attr("data-component"),a="Checkout"+r.attr("data-component"),s=e[o]!==n?e[o]:e[a]!==n?e[a]:CheckoutComponent;this.components.push(new s(i,this)),this.componentsObjects=this.componentsObjects.add(r)},updateComponents:function(){var e=this,n=this.container.find(".j-component");n.each(function(){t(this).is(e.componentsObjects)||e.attachComponent(this)});var i=this.components.slice();this.components=[];for(var r=0,o=i.length;r<o;++r){var a=i[r];a.container.is(n)&&this.components.push(a)}},clearComponents:function(){this.components=[],this.componentsObjects=t()},getComponents:function(){return this.components},getComponentByName:function(t){for(var e=this.components.length;--e>=0;){var n=this.components[e];if(n.name==t)return n}return null},reload:function(t){this.performAction("reload",{},t)}
1,performAction:function(t,e,i){var r=this;if(!1===this.trigger("beforeAction",t,e))return!1;let o=this.container.find("[name=configPresetName]").val(),a=this.container.find("[name=orderId]").val(),s=this.container.find("[name=userId]").val(),c=this.container.find("[name=handlerId]").val();return e===n?e={configPresetName:o,theme:this.theme}:e instanceof Array?(e.push({name:"configPresetName",value:o}),e.push({name:"theme",value:this.theme})):e===e+""?e+="&configPresetName="+encodeURIComponent(o)+"&theme="+encodeURIComponent(this.theme):(e.configPresetName=o,e.theme=this.theme),void 0!==a&&void 0!==s&&void 0!==c&&(e instanceof Array?(e.push({name:"orderId",value:a}),e.push({name:"userId",value:s}),e.push({name:"handlerId",value:c})):"string"==typeof e?e+="&orderId="+encodeURIComponent(a)+"&userId="+encodeURIComponent(s)+"&handlerId="+encodeURIComponent(c):(e.orderId=a,e.userId=s,e.handlerId=c)),this.trigger("beforeAjax"),sendAjax(this.moduleUri+t+"/",e,function(o,a){if(!a.redirect&&a.render_data){for(var s in a.render_data)if(a.render_data.hasOwnProperty(s)){var c=a.render_data[s],l=r.getComponentByName(s);l&&l.replaceHtml(c)}r.initAttributes()}a.enabled===n||r.isPostponeSubmit||(a.enabled?r.enableSubmitButton():r.disableSubmitButton()),"function"==typeof i&&i(o,a),r.trigger("afterAction",t,e),r.trigger("afterAjax"),"EXCEPTION"===o?r.trigger("AJAX_EXCEPTION",a):"OK"===o&&r.trigger("afterActionResponded",t,a)})},setAttributes:function(t,e){this.trigger("onBeforeSetAttributes",t);var n=this;this.submitting=!0,this.performAction("setAttributes",t,function(i,r){n.trigger("onAfterSetAttributes",i,t),n.submitting=!1,n.isPostponeSubmit&&(n.isPostponeSubmit=!1,n.submit()),"function"==typeof e&&e(i,r)})},setFormDataAttributes:function(t,e){var i=this;let r=this.container.find("[name=configPresetName]").val();t.append("configPresetName",r),t.append("theme",this.theme);const o={method:"post",body:t,headers:{"X-Requested-With":"XMLHttpRequest"}};"undefined"!=typeof GLOBAL&&(o.headers["X-CSRF-Token"]=GLOBAL.GLOBAL_CSRF_TOKEN),fetch(this.moduleUri+"setAttributes/",o).then(t=>t.json()).then(function(t){const r=t.response,o=t.status;if(!r.redirect){if(r.render_data){for(var a in r.render_data)if(r.render_data.hasOwnProperty(a)){var s=r.render_data[a],c=i.getComponentByName(a);c&&c.replaceHtml(s)}i.initAttributes()}r.enabled!==n&&(r.enabled?i.enableSubmitButton():i.disableSubmitButton()),"ERROR_VALIDATION"===o&&i.setErrors(r.errors)}"function"==typeof e&&e(o,r),"EXCEPTION"===o&&i.trigger("AJAX_EXCEPTION",r)})},disableSubmitButton:function(){this.submit_btn.addClass(this.disabledClass).prop("disabled",!0)},enableSubmitButton:function(){this.submit_btn.removeClass(this.disabledClass).prop("disabled",!1)},disableSaveButton:function(){this.save_btn.addClass("disabled").prop("disabled",!0)},enableSaveButton:function(){this.save_btn.removeClass("disabled").prop("disabled",!1)}},a.setSelector=function(t){t!==i&&(i=t,r=null)},a.getInstance=function(){return null===r&&(r=new a(i),o.push(r)),r},a.getInstances=function(){return o},t.extend(a.prototype,TMEvents),e.CheckoutModule=a}(n(3521),window)},1560:function(t,e,n){var i,r,o,a=n(3521);i=a,r=window,o=CheckoutComponent.extend({init:function(){var t=this;this.attachEventHandler("afterReplaceHtml",function(){t.initPaymentType(),t.initWarning(),t.trigger("replacePaymentHtml",t.payment_type,t.payment_type.val())}),this.initPaymentType()},initPaymentType:function(){var t=this;this.initInstallmentSelect(),this.payment_type=this.container.find(".j-payment-type"),this.payment_type.off("change.trigger").on("change.trigger",function(){t.setPaymentType(t.payment_type.val())}),this.trigger("onPaymentTypeInit")},setPaymentType:function(t){var e=this,n=t?"set_payment_type/"+t:"set_default_payment_type";this.performAction(n,{},function(n,i){"OK"===n&&(e.container.empty().append(i.html),e.trigger("replacePaymentHtml"),e.initPaymentType(),e.initWarning(),e.owner.initAttributes(),e.trigger("changePaymentType",e.payment_type,t))})},initInstallmentSelect:function(){var t=this.container[0].querySelector(".j-payment-parts"),e=this.container[0].querySelector(".j-payments-text");t&&e&&i(t).on("change",function(t){var n=t.target.options[t.target.selectedIndex];e.innerHTML=n.dataset.paymentsText||""})},initWarning:function(){var t=this;this.warningContainer=this.container[0].querySelector("#payment-warning"),this.warningContainer&&(this.warningContainer.querySelectorAll(".j-remove-disallowed-products").forEach(function(e){e.addEventListener("click",function(e){t.removeDisallowedProducts(),e.preventDefault()})}),this.trigger("onInitWarning"))},removeDisallowedProducts:function(){var t=this,e=AjaxCart.getInstance(),n=this.warningContainer.querySelectorAll(".j-disallowed-product"),i=0;confirm(l10n("Вы уверены что хотите удалить товары?"))&&(this.trigger("beforeAjax"),n.forEac
1h(function(t){e.removeProductByHash(t.dataset.id)}),e.Cart.attachEventHandler("onProductRemove",function(){++i===n.length&&t.trigger("afterAjax")}),this.trigger("removedDisallowedProducts"))}}),r.CheckoutPayment=o},5245:function(t,e,n){!function(t,e){var n=CheckoutComponent.extend({init:function(){var t=this;this.attachEventHandler("afterReplaceHtml",function(){t.initSearch(),t.initEmailSearch(),t.initComment()}),this.initSearch(),t.initEmailSearch(),this.initComment()},initComment:function(){var e=t(".j-comment-head"),n=t(".j-comment-body");n.find(".j-comment-opener").off("click").on("click",function(){return e.show().removeClass("is-hidden"),n.removeClass("__closed"),n.find(":input").show().focus(),n.find(".j-comment-opener").hide(),!1})},initEmailSearch:function(){var e,n=this,i=this.container.find(':input[name="'+this.getFieldName("delivery_email")+'"]'),r=i.siblings(".j-email-loader"),o=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/gim,a=i.val();i.off("keyup.checkout").on("keyup.checkout",function(){var i=t(this),s=i.val();clearTimeout(e),e=setTimeout(function(){-1!==s.search(o)&&s!==a&&(a=s,r.show(),n.emailInUse(s,function(t,e){r.hide(),"USED"===t?i.errorBox(e.message,e.authorizationRequired?"error":"info"):i.errorBox()}))},300)})},emailInUse:function(t,e){this.performAction("emailInUse",{email:t},e)},initSearch:function(){this.initCitySearch(),IntlTelInputManager.init("delivery-phone-recipient")},initCitySearch:function(){var t=this.container.find('input[name="'+this.getFieldName("delivery_city")+'"]');0!==t.length&&(this.cityVal=t.val(),this.trigger("initCitySearch"))},enableDeliveryAndPayment:function(t){var e=t&&t.render_data?t.render_data:{};if(!e.Delivery){var n=this.owner.getComponentByName("Delivery");n&&n.enableComponent()}if(!e.Payment){var i=this.owner.getComponentByName("Payment");i&&i.enableComponent()}},setCity:function(t,e,n){let i=this,r=this.container.find(':input[name="'+this.getFieldName("delivery_city")+'"]'),o=this.container.find(':input[name="'+this.getFieldName("delivery_city_id")+'"]');r.val(t),o.val(e),this.trigger("onBeforeChangeCity"),this.owner.setAttributes([{name:o.attr("name"),value:e},{name:r.attr("name"),value:t},{name:this.getFieldName("np_city_name"),value:n}],function(t,e){i.enableDeliveryAndPayment(e),i.trigger("changeCity")}),this.cityVal=t}});e.CheckoutRecipient=n}(n(3521),window)},7260:function(t,e,n){var i,r=n(3521);i=r,window.NovaPoshta=CheckoutComponent.extend({init:function(){var t=this.owner.getComponentByName("Delivery");if(t){var e=this;t.attachEventHandler("changeDeliveryType",function(){e.initAll()}),t.attachEventHandler("afterReplaceHtml",function(){e.initAll()})}(t=this.owner.getComponentByName("Recipient")).attachEventHandler("afterReplaceHtml",function(){e.initAll()}),this.attachEventHandler("afterReplaceHtml",function(){e.initAll()}),this.cartEvents=!1,this.initAll(),this.attachEventHandlers({afterReplaceHtml:function(){e.initAll()},beforeAction:function(t){if("city_search"!==t){var n=this.getItemsToDisable();n.prop("disabled",!0),n.addClass("__disabled"),e.showLoader()}},afterAction:function(){e.toogleFieldsVisibility(),e.hideLoader()}})},initCitySearch:function(){var t=this.container.find(".j-np-sender-city"),e=this,n=[],r="";t.autocomplete({source:function(t,i){e.performAction("city_search",{text:t.term},function(t,e){"OK"===t&&(n=e,i(e))})},select:function(n,i){e.changeWarehouses(i.item.label),r=i.item.label,t.errorBox()},create:function(t){i.browser.chrome&&t.target.setAttribute("autocomplete","disabled")}}),t.off("change").on("change",function(){var i=t[0].value;if(i!==r){t.errorBox();var o=!1;for(let t of n)if(i===t.label){o=!0;break}o?e.changeWarehouses(i):t.errorBox("Выберите город из списка")}})},changeWarehouses:function(t){let e=this.container.find(".j-np-sender-warehouse");e[0].options.length=0,this.performAction("get_warehouses",{cityTitle:t},function(t,n){if("OK"===t)for(let t=0;t<n.warehouses.length;t++)e[0].options[t]=new Option(n.warehouses[t].title,n.warehouses[t].id)})}
1,initCartEvents:function(){if(!this.cartEvents){var t=this;setTimeout(function(){t.cartEvents=!0;var e=AjaxCart.getInstance(),n=t.container.parents("form").find(".j-delivery-type");e.attachEventHandler("onChange",function(){sendAjax("/adminLegacy/params/ajax_router.php",{param_full_name:"nova_poshta",current_currency_id:GLOBAL.currency.id,totalSum:this.total.sum},function(e,i){setTimeout(function(){var e=t.container.find(".j-np-cost");if(n.length){var r=n.find(":selected"),o=(1*r.data("by-carrier")?0:1*r.data("price"))+i.uahTotalSum;e.val(o).trigger("change")}},1e3)})})},500)}},getItemsToDisable:function(){var t=this.container.parents("form:first"),e=t.find(":input:not(.j-ignore, .j-admin_comment), .j-cart-search");return(e=(e=e.add(t.find(".j-remove-p, .j-coupon-remove, .j-coupon-add, .j-markup-add"))).add(t.find(".j-place-input, .j-np-place-add, .j-np-place-duplicate, .j-np-place-remove"))).filter(':not(:input[type="button"], :input[type="submit"])')},toogleFieldsVisibility:function(){var t=this.container.is(".j-disabled");t?this.getItemsToDisable().addClass("__disabled"):this.getItemsToDisable().removeClass("__disabled"),this.getItemsToDisable().prop("disabled",t)},showLoader:function(){this.container.find(".j-np-loader").show()},hideLoader:function(){this.container.find(".j-np-loader").hide()},initAll:function(){this.container=i(this.owner.container).find('.j-component[data-component="'+this.name+'"]'),this.toogleFieldsVisibility();var t=this.container.find(".j-print"),e=this.container.find(".j-remove"),n=this.container.find(".j-np-sender"),r=this.container.find(".j-np-payment-method"),o=this.container.find(".j-np-sender-city"),a=this.container.find(".j-np-sender-payer"),s=this.container.find(".j-np-sender-warehouse"),c=this.container.find(".j-np-cost"),l=this.container.find(".j-np-contact-person");this.initGeneralWeightVolumeFields(this.container),this.initSeparatedWeightVolumeFields(this.container);var d=this.container.find(".j-calculate"),h=this;d.off("click").on("click",function(){return h.calculate(),!1}),t.off("mousedown mouseup").on("mousedown mouseup",function(e){return 0==e.button||(t.blur(),e.preventDefault(),!1)}).off("click").on("click",function(){return!!confirm("Вы уверены что хотите распечатать накладную?\r\nПосле распечатки Вы не сможете редактировать данные ТТН.")&&(setTimeout(function(){h.render()},100),i(window).one("focus",function(){h.render()}),!0)}),e.off("click").on("click",function(){return confirm("Вы уверены что хотите удалить ТТН?")&&h.remove(),!1});var u=function(){n.find(":selected").data("allow-non-cash")&&1==a.val()?r.prop("disabled",!1):(r.val(1),setTimeout(function(){r.prop("disabled",!0)},100))};n.off("change").on("change",function(){var t=i(this).val();h.performAction("set_sender",{id:t},function(t,e){if("OK"===t){o[0].value=e.city,s.empty().append(e.wares),l.empty();for(let t=0;t<e.contactPersons.length;t++){let n=!1;0===t&&(n=!0),l.append(new Option(e.contactPersons[t].text,e.contactPersons[t].value,!1,n))}u(),n=e.editLink,s.children().length>0?(d.removeClass("__disabled").removeAttr("disabled").prop("disabled",!1),s.removeClass("__disabled").removeAttr("disabled").prop("disabled",!1)):(d.addClass("__disabled").attr("disabled","disabled").prop("disabled",!0),s.addClass("__disabled").attr("disabled","disabled").prop("disabled",!0),o.html("У отправителя не указан город отправки. Нажмите <a href='"+n+"'>сюда</a> что-бы отредактировать"))}var n})}),a.off("change.NPInitAll").on("change.NPInitAll",u);var f=this.container.parents("form:first");this.container.find(".np-disallow-edit").length>0?(f.addClass("__readonly"),this.getItemsToDisable().addClass("__disabled j-disabled").prop("disabled",!0)):(f.removeClass("__readonly"),this.getItemsToDisable().removeClass("__disabled j-disabled").prop("disabled",!1)),c.numberMask({type:"float",afterPoint:2}),h.initCartEvents(),h.initCitySearch(),u()},remove:function(){var t=this;this.performAction("remove_np",{},function(e,n){if("OK"===e)i(n.html).insertAfter(t.container),t.container.remove(),t.trigger("afterReplaceHtml");else if("NP_EXCEPTION"===e){for(var r=[],o=0,a=n.errors.length;o<a;++o)r.push(n.errors[o]);r.length&&alert("При обработке накладной Новая Почта вернула такие ошибки:\r\n- "+r.join("\r\n- "))}})},render:function(){var t=this;this.performAction("render_np",{},function(e,n){"OK"===e&&(i(n.html).insertAfter(t.container),t.container.remove(),t.trigger("afterReplaceHtml"))})},calculate:function(){var t=this.container.find(":input"),e=[];t.each(function(){var t=i(this);if(!t.is(":disabled")){if((t.is("[type=checkbox]")||t.is("[type=radio]"))&&
1!t.is(":checked"))return!0;e.push({name:t.attr("name"),value:t.val()})}});var n=this;this.performAction("calculate_np",e,function(t,e){if(n.owner.container.find(":input").errorBox(),"OK"===t)i(e.html).insertAfter(n.container),n.container.remove(),n.trigger("afterReplaceHtml");else if("VALIDATION_ERROR"===t){for(var r="Delivery[delivery_method]",o=0,a=(l=e.errors).length;o<a;++o){var s=l[o];if("FilterFormArray"===s.validator)var c=n.container.find(':input[name="'+r+s.code+'"]');else c=-1===s.code.indexOf("[")?n.container.find(':input[name="'+r+"["+s.code+']"]'):n.owner.container.find(':input[name="'+s.code+'"]');c.errorBox(s.message)}n.trigger("onValidationError")}else if("NP_EXCEPTION"===t){var l=[];for(o=0,a=e.errors.length;o<a;++o)l.push(e.errors[o]);l.length&&alert("При обработке накладной Новая Почта вернула такие ошибки:\r\n- "+l.join("\r\n- "))}})},performAction:function(t,e,n){var i=this;if(!1===this.trigger("beforeAction",t,e))return!1;this.trigger("beforeAjax");var r=this.owner.getComponentByName("Delivery");return this.owner.performAction("component/"+r.name+"/delivery_action/"+t,e,function(r,o){"function"==typeof n&&n(r,o),i.owner.initAttributes(),i.trigger("afterAction",t,e),i.trigger("afterAjax")})},initGeneralWeightVolumeFields:function(t){var e=t.find(".j-np-weight"),n=t.find(".j-np-volume-general"),i=t.find(".j-np-volume-weight"),r=t.find(".j-np-seats-amount");e.numberMask({type:"float",afterPoint:3}),n.numberMask({type:"float",afterPoint:6}),r.numberMask({type:"int"});var o=function(){var t,e=1*n.val();t=0===e?"<i>Укажите объем</i>":250*e,i.empty().append(t)};o(),e.off("change.NP").on("change.NP",o),n.off("change.NP").on("change.NP",o)},initSeparatedWeightVolumeFields:function(t){var e=this;t.find(".j-np-separated-place").each(function(){e.initWeightVolumeRow(i(this))}),this.initPlaceAttributeSetter(t),t.find(".j-np-place-add").off("click").on("click",function(){e.performAction("np_place_add",{},function(t,n){"OK"===t&&(i(n.html).insertAfter(e.container),e.container.remove(),e.trigger("afterReplaceHtml"))})}),t.find(".j-np-place-remove").off("click").on("click",function(){var t=i(this).attr("data-place-id");e.performAction("np_place_remove",{placeId:t},function(t,n){"OK"===t&&(i(n.html).insertAfter(e.container),e.container.remove(),e.trigger("afterReplaceHtml"))})}),t.find(".j-np-place-duplicate").off("click").on("click",function(){var t=i(this).attr("data-place-id");e.performAction("np_place_duplicate",{placeId:t},function(t,n){"OK"===t&&(i(n.html).insertAfter(e.container),e.container.remove(),e.trigger("afterReplaceHtml"))})})},initWeightVolumeRow:function(t){var e=t.find(".j-np-place-weight"),n=t.find(".j-np-place-width"),i=t.find(".j-np-place-length"),r=t.find(".j-np-place-height"),o=t.find(".j-np-place-volume-weight");e.numberMask({type:"float",afterPoint:3}),n.numberMask({type:"int"}),i.numberMask({type:"int"}),r.numberMask({type:"int"});var a=function(){var t,e=1*n.val(),a=1*i.val(),s=1*r.val();t=0==Math.min(e,a,s)?"<i>Укажите габариты</i>":(e*a*s/4e3).toFixed(4),o.empty().append(t)};a(),n.off("change.NP").on("change.NP",a),i.off("change.NP").on("change.NP",a),r.off("change.NP").on("change.NP",a)},initPlaceAttributeSetter:function(t){var e=this;t.find(".j-np-separated-place :input").off("change.CheckoutModule").on("change.CheckoutModule",function(){var n=t.find(".j-np-separated-place .j-place-input").map(function(){var t=i(this),e=t.val();return"checkbox"===t.attr("type")&&(e=t.is(":checked")?1:0),{name:t.attr("name"),value:e}}).toArray();e.owner.setAttributes(n)})}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.