');a.hide();a.appendTo($(document.body))}});
$(function(){$(".editable-link").each(function(a,b){$el=$(b);$wrapper=$el.parents(".editable-link-wrapper");0==$wrapper.length&&($wrapper=$(''),$el.replaceWith($wrapper),$el.appendTo($wrapper));$link=$('');$el.data("header")?($header=$(""),$link.appendTo($header),$header.appendTo($wrapper)):$link.appendTo($wrapper);var c=null;""!=$el.val()?c=$el.val():$el.attr("placeholder")&&""!=$el.attr("placeholder")?c=$el.attr("placeholder"):(c="\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c",
"undefined"!=typeof Yii&&(c=Yii.t("common","change")),$wrapper.addClass("no-value"));$link.html(c);$link.click(function(){$(this).parents(".editable-link-wrapper").addClass("edit-mode")})})});window.runOneTimeOnElement=function(a,b,c){a.data(b)||a.data(b,c(a))};window.eachAndRunOneTimeOnElement=function(a,b,c){a.each(function(a,e){runOneTimeOnElement($(e),b,c)})};
function objectToQueryString(a){var b,c,d,e;c=[];d=function(a,b){b="function"==typeof b?b():null==b?"":b;c[c.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(a instanceof Array)for(e in a)d(e,a[e]);else for(b in a)buildParams(b,a[b],d);return c.join("&").replace(/%20/g,"+")}
function buildParams(a,b,c){var d,e,g;g=/\[\]$/;if(b instanceof Array)for(d=0,e=b.length;dd&&(c[c.length]=[a,b].join("="));document.location.search=c.join("&")}
function removeParamFromLocation(a){a=encodeURI(a);for(var b=document.location.search.substr(1).split("&"),c=b.length,d;c--;)if(d=b[c].split("="),d[0]==a){b[c]=null;break}a="&"!=b.join("&")?b.join("&"):"";document.location.search=a}function escapeDoubleQuotes(a){return a.replace(/\\([\s\S])|(")/g,"\\$1$2")}function setVisibilityRelation(a,b){var c=$(a),d=$(b),e=function(){c.prop("checked")?d.show():d.hide()};c.click(e);e()}
function getParamFromLocation(a){a=encodeURI(a);for(var b=document.location.search.substr(1).split("&"),c=b.length,d;c--;)if(d=b[c].split("="),d[0]==a)return d[1];return null}function getParamFromHash(a){a=encodeURI(a);for(var b=document.location.hash.substr(1).split("&"),c=b.length,d;c--;)if(d=b[c].split("="),d[0]==a)return d[1];return null}
var gcParseUrl=function(a){var b=document.createElement("a");b.href=a;return b},gcAddResourceElement=function(a,b,c){var d={};return function(e){if(!d.hasOwnProperty(e)){for(var g=document.getElementsByTagName(a),f=g.length,h=!1;f--;){var l=gcParseUrl(g[f][b]);if(l.pathname+l.search==e){h=!0;break}}h||(d[e]=c(e),console.log("loaded "+e))}}},gcAddScriptElement=function(){return gcAddResourceElement("script","src",function(a){var b=document.createElement("script");b.type="text/javascript";b.src=a;document.getElementsByTagName("head")[0].appendChild(b);
return b})}(),gcAddLinkElement=function(){return gcAddResourceElement("link","href",function(a){var b=document.createElement("link");b.rel="stylesheet";b.src=a;document.getElementsByTagName("head")[0].appendChild(b);return b})}();function replaceAll(a,b,c){return a.replace(new RegExp(b,"g"),c)}
serializeObj=function(a,b){var c=[],d;for(d in a)if(a.hasOwnProperty(d)){var e=b?b+"["+d+"]":d,g=a[d];"undefined"!==typeof g&&null!=g&&c.push(null!==g&&"object"===typeof g?serializeObj(g,e):encodeURIComponent(e)+"="+encodeURIComponent(g))}return c.join("&")};
function addGlobalCheckbox(a){var b=!1;0
"),d=c.find(".global-confirm-checkbox");
a.find("button[type=submit]");c.appendTo(a)}return function(a){if(window.globalCheckboxEnabled&&!d.prop("checked")){if(b&&(!a||"register"!=a.state))return!0;a="To submit the form, you must agree to the terms and conditions for processing personal data. Check the checkbox";"undefined"!=typeof Yii&&(a=Yii.t("common",a));alert(a);return!1}return!0}}
function initListSearch(a,b){var c=function(c){c=c.toLowerCase();var d=!1;a.find(b).each(function(){var a=$(this).html().toLowerCase();""==c?($(this).show(),d=!0):-1
"+e+"
");g.prependTo(a);g.find("input").keyup(function(){c($(this).val())?g.find(".nothing-found-label").hide():g.find(".nothing-found-label").show()})}
function initDropdownSearch(a){a=a.find(".dropdown-menu");initListSearch(a,"a");a.parent().on("show.bs.dropdown",function(){setTimeout(function(){a.find(".search-input").focus()})})}function number_format(a,b,c,d){var e,g,f;isNaN(b=Math.abs(b))&&(b=2);void 0==c&&(c=",");void 0==d&&(d=".");e=parseInt(a=(+a||0).toFixed(b))+"";f=(g=3<(g=e.length)?g%3:0)?e.substr(0,g)+d:"";d=e.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d);a=b?c+Math.abs(a-e).toFixed(b).replace(/-/,0).slice(2):"";return f+d+a}
function onTelegramAuth(a){ajaxCall("/pl/user/profile/login-with-telegram",{user:a},{method:"get"},function(a){window.afterTelegramAuthCallback&&window.afterTelegramAuthCallback()})}window.phoneChecked=!1;window.checkFormPhone=function(a){var b=$(a).find("input.phone-input");return 0'));this.resultBlock.html("");c.lastSend&&4E3>Date.now()-c.lastSend&&alert("\u0417\u0430\u043f\u0440\u043e\u0441 \u0435\u0449\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f");c.lastSend=
Date.now();var g="function"===typeof gcModalActive?gcModalActive():null;ajaxCall(d,e,{enableSimpleSign:!0,async:1==a.data("open-new-window")?!1:!0},function(a){c.buttonSubmit.find(".form-loader").remove();c.lastSend=null;c.breakedOn=a.data.breakedOn;a.data.dealId&&!a.data.isResultModal&&(c.dealId=a.data.dealId);if(a.data.formProcessed){if(a.data.preParts){var b;a.data.isResultModal&&(b=window.gcModalFactory.create({onShow:function(){var a=$(c.element).find("input[name='formParams[setted_offer_id]']");
a&&a.val("");window.ltCheckBasketRunned&&(window.ltCheckBasketRunned=!1,ltCheckBasket())},onHide:function(){g&&(g.hide(),$("body").addClass("modals-closed"))}}));for(var d in a.data.preParts){var e=a.data.preParts[d];e.javascript&&eval(e.javascript);e.html&&(a.data.isResultModal?b.setContent(e.html):c.resultBlock.html(e.html))}b&&a.data.isResultModal&&(b.show(),0<$(".close-link").length&&$(".close-link").click(function(){b.hide()}))}if(a.data.redirectUrl&&!a.data.noRedirect&&!a.data.isResultModal){e=
a.data.redirectUrl;a.data.confirmMessage&&a.data.confirmCancelRedirectUrl&&!confirm(a.data.confirmMessage)&&(e=a.data.confirmCancelRedirectUrl);if(a.data.newWindow){null===window.open(e)&&(window.location.href=e);return}window.top!==window.window?window.top.location.href=e:window.location.href=e;if(!a.data.refreshPage)return}if(a.data.refreshPage)window.location.reload();else if(!a.data.isResultModal){c.resultBlock.html("
"+a.data.defaultMessage+"
");for(d in a.data.parts)e=
a.data.parts[d],e.html&&c.resultBlock.html(e.html);c.element.height(c.element.height());c.resultBlock.show();c.formContentBlock.hide()}}else c.resultBlock.show(),c.resultBlock.html("
"+a.data.error+"
"),c.resultBlock.addClass("error"),c.resultBlock.parent().find("button").each(function(){var a=$(this).attr("id");window["prs"+a]=!1;$(this).removeClass("disabled")})},function(){c.formContentBlock.trigger("submitForm")})}},onCreate:function(){this.buttonSubmit&&this.buttonSubmit.attr("disabled")&&
this.buttonSubmit.attr("disabled",!1)}});
function ltShowModalBlock(a,b){var c=null,c=$("#"+a);0==c.length&&(c=$("[data-code='"+a+"']"));if(b)for(key in b){var d=b[key];c.find(".external-value."+key).val(d)}if(c.hasClass("lt-modal-block")){if(c.hasClass("js--modal-block-popup-type-block")){c.removeClass("lt-modal-block");return}var e=window.gcModalFactory.create();c.data("modal-width")&&""!=c.data("modal-width")?e.getModalEl().find(".modal-dialog").width(c.data("modal-width")):e.getModalEl().find(".modal-dialog").width("500px");c.data("modal-class")&&
""!=c.data("modal-class")&&e.getModalEl().find(".modal-dialog").addClass(c.data("modal-class"));e.setContent("");e.getModalEl().addClass("lt-block-modal-window");c.appendTo(e.getContentEl());c.show()}else bodyScrollTo(c,10);if(e)e.get$Modal().on("hidden.bs.modal",function(a){(a=$(this).find(".videoWrapper iframe"))&&a.attr("src",a.attr("src"))})}
function ltShowModalForm(a){if("custom"==a.formType){var b={};a.position&&a.position.offer_id&&(b.offer_id=a.position.offer_id);ltShowModalBlock(a.formBlockCode,b)}else{var c=window.gcModalFactory.create();c.getModalEl().addClass("lt-block-modal-window");c.getModalEl().addClass("lt-form-modal-window");ajaxCall("/pl/lite/block-public/get-block-html",a,{},function(a){c.setContent(a.data.html)})}}
jQuery.widget("gc.liteSinglyForm",{currentPartIndex:0,_create:function(){this.element.show();var a=this;this.element.find("input,select").change(function(){a.checkNextAvailable()});this.element.find("input,textarea").keyup(function(){a.checkNextAvailable()});this.surveyFieldsBlock=this.element.find(".part-surveyFields");this.otherFieldsBlocks=this.element.find(".builder-item:not(.part-surveyFields)");var b=$('');b.appendTo(this.element.find(".builder"));this.progressBar=
$('