!function(t,e){for(var o in e)t[o]=e[o]}(this,function(t){function e(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return t[r].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e){Comagic.UI.registerViewController("personal_form",function(t,e){var o=Comagic.UI.createWidget("personal_form",{settings:t,id:t.id,template:e.personal_form,render:function(){return t.is_image&&!this.imgLoaded?void this._onImageLoad(t.image_url,this.render,this):(this.constructor.prototype.render.apply(this,arguments),this._setPosition(),this.getEl(".comagic-personal-form__main-btn").addEventListener("click",function(){o.submit(),window.open(t.button_url),o.destroy()}),void this.getEl(".comagic-personal-form__close-btn").addEventListener("click",function(){o.isSubmitted()||o.cancel(),o.destroy()}))},_onImageLoad:function(t,e,o){var r=document.createElement("IMG"),n=function(){o.imgLoaded=!0,e.apply(o)};r.addEventListener("load",n),r.addEventListener("error",n),r.src=t},_setPosition:function(){var e=this.getEl(),o=e.querySelector(".comagic-personal-form");setTimeout(function(){o.classList.add("comagic-personal-form--shown")},10),this._centered="center"==t.h_position&&"middle"==t.v_position},destroy:function(){var t=this,e=this.getEl(),o=e.querySelector(".comagic-personal-form");this._centered?t.constructor.prototype.destroy.apply(t,arguments):(o.classList.remove("comagic-personal-form--shown"),setTimeout(function(){t.constructor.prototype.destroy.apply(t,arguments)},500))}});o.render(),o.on("leadhide",function(){o.destroy()}),o.on("leadsubmit",function(t){})})}]));