!function(){"use strict";var t,e,n,i,o,r,a,l,d,u=JSON.parse("{\"init_type\":\"default\",\"auto_data_load\":1,\"mode\":\"constructor\",\"disable_orders\":0,\"list_denied_templates\":\"\",\"printery_elements_only\":0,\"printery_templates_only\":0,\"disable_templates_page\":0,\"disable_templates_categories\":0,\"iframe_only\":0,\"list_allowed_performers\":\"\",\"show_many_performers\":0,\"show_copyright\":1,\"default_outer_title\":\"Конструктор печатей и штампов\",\"overlay_white_theme\":1,\"force_loading\":1,\"main_color_3\":\"#077fe8\",\"main_color_2\":\"#dd0330\",\"main_color_1\":\"#077fe8\",\"outer_title_attribute\":\"\",\"use_outer_title\":0,\"show_title\":0}"),c=JSON.parse("{\"skip_performer_section\":false,\"default_printery_id\":1,\"printery\":{\"materials\":[\"polymer\"]},\"default_city\":{\"title\":\"Москва\",\"id\":1,\"coordinates\":[\"55.7538789\",\"37.6203735\"]}}"),s=JSON.parse("[]"),p=(e={},n="#printut-stamp",i="k2N249wY",o=window.location.href,r=function(e,n){n=JSON.stringify({type:"printut",method:e,data:n}),t.contentWindow.postMessage(n,"*")},a={loadPublishTemplateByKey:function(t){return r("loadPublishTemplateByKey",{template_key:t}),!0},loadPublishTemplateById:function(t){return r("loadPublishTemplateById",{template_id:t}),!0},changeWidgetColors:function(t,e,n){return r("changeWidgetColors",{color1:t,color2:e,color3:n}),!0},hide:function(){null!=t&&(t.style.display="none")},show:function(){return null!=t&&(t.style.display="block"),!0},reload:function(){return null!=t&&(t.src=t.getAttribute("src")),!0},getInfo:function(){return{widgetId:i,widgetUrl:o,container:document.querySelector(n),height:t.height}},setTemplatesPage:function(t){return r("setTemplatesPage",{type:t}),!0}},l={ping:function(){r("ping")},getWidgetData:function(){r("getWidgetData",{widgetId:i,widgetUrl:o,printeryId:parseInt("132"),params:u,options:c})},changeSize:function(e){null!=e&&(null!=e.width&&(t.width=e.width),null!=e.height&&(t.height=e.height))},updateTitle:function(t){if(u.use_outer_title&&u.outer_title_attribute){var e=document.querySelector(u.outer_title_attribute);null!=e&&(e.innerHTML=t)}},ready:function(){var t=document.querySelector(n);null!=t&&(t.classList.remove("loading"),t.classList.add("loaded"),"default"==u.init_type&&null!=s&&"string"==typeof s.onload&&"function"==typeof window[s.onload]&&window[s.onload](a))},removeUrlParameter:function(t){var e=function(t){if(null!=t){var e=window.location.href,n=e.split("?");if(n.length>=2){for(var i=encodeURIComponent(t)+"=",o=n[1].split(/[&;]/g),r=o.length;r-- >0;)-1!==o[r].lastIndexOf(i,0)&&o.splice(r,1);e=n[0]+(o.length>0?"?"+o.join("&"):""),window.history&&window.history.replaceState&&window.history.replaceState({},document.title,e)}}},n=function(t){return t.replace(/\W+/g," ").split(/ |\B(?=[A-Z])/).map((t=>t.toLowerCase())).join("_")};if("object"!=typeof t)e(t),(o=n(t))!==t&&e(o);else for(var i in t){var o;e(t[i]),(o=n(t[i]))!==t[i]&&e(o)}},redirect:function(t){window.location.href=t}},e.init=function(e,o){"string"==typeof e&&(n=e),"object"!=typeof o&&(o={});var r=document.querySelector(n);if(null!=r){r.classList.contains("loading")||r.classList.add("loading"),t=document.createElement("iframe"),o.empty?t.src="https://pechati.printut.com/constructor?widget="+i+"&as=script&empty":t.src="https://pechati.printut.com/constructor?widget="+i+"&as=script",t.width="100%",t.setAttribute("frameborder","0"),t.setAttribute("style","margin: 0 auto;"),r.appendChild(t),window.addEventListener("message",(function(t){if(null!=t.data){var e=function(t){try{t=JSON.parse(t)}catch(t){return null}if("object"==typeof t&&null!==t)return t}(t.data);null!=e&&"printut"===e.type&&null!=l[e.method]&&l[e.method](e.data)}})),window.innerWidth;var d=function(e){var n=770;u.show_title||(n=710),window.innerWidth<=768?e&&(t.height=793):window.innerWidth<=992?t.height=800:window.innerHeight<=n||window.innerWidth<1110?t.height=u.show_title?630:560:t.height=u.show_title?780:720};window.innerWidth>992?(window.addEventListener("load",(function(){d(!0)})),d(!0)):d(!0),window.addEventListener("resize",(function(){d(!1)}))}else console.error("[PRINTUT] Элемент-контейнер "+n+" не найден");return a},e.getWidgetId=function(){return i},e);d=function(){"object"!=typeof window.printutStamp&&(window.printutStamp={});var t=p.getWidgetId();if("default"===u.init_type){var e=p.init();window.printutStamp[t]=function(){return e}}else{var n={init:p.init};window.printutStamp[t]=function(){return n},null!=s&&"string"==typeof s.onload&&"function"==typeof window[s.onload]&&window[s.onload](n)}},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(d,1):document.addEventListener("DOMContentLoaded",d)}();