(function framework7ComponentLoader(t,o){void 0===o&&(o=!0);var e=window,n=t.$,s=(t.Template7,t.utils),a=(t.device,t.support,t.Class,t.Modal),r=(t.ConstructorMethods,t.ModalMethods),l=function(t){function o(o,a){var r=s.extend({on:{}},o.params.toast,a);t.call(this,o,r);var l=this;l.app=o,l.params=r;var c,i,u=l.params,d=u.closeButton,p=u.closeTimeout;if(l.params.el)c=n(l.params.el);else{var m=l.render();c=n(m)}return c&&c.length>0&&c[0].f7Modal?c[0].f7Modal:0===c.length?l.destroy():(s.extend(l,{$el:c,el:c[0],type:"toast"}),c[0].f7Modal=l,d&&(c.find(".toast-button").on("click",function(){l.emit("local::closeButtonClick toastCloseButtonClick",l),l.close()}),l.on("beforeDestroy",function(){c.find(".toast-button").off("click")})),l.on("open",function(){n(".toast.modal-in").each(function(t,e){var n=o.toast.get(e);e!==l.el&&n&&n.close()}),p&&(i=s.nextTick(function(){l.close()},p))}),l.on("close",function(){e.clearTimeout(i)}),l.params.destroyOnClose&&l.once("closed",function(){setTimeout(function(){l.destroy()},0)}),l)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.render=function(){if(this.params.render)return this.params.render.call(this,this);var t=this.params,o=t.position,e=t.cssClass,n=t.icon,s=t.text,a=t.closeButton,r=t.closeButtonColor,l=t.closeButtonText;return('\n      <div class="toast toast-'+o+" "+(e||"")+" "+(n?"toast-with-icon":"")+'">\n        <div class="toast-content">\n          '+(n?'<div class="toast-icon">'+n+"</div>":"")+'\n          <div class="toast-text">'+s+"</div>\n          "+(a&&!n?('\n          <a class="toast-button button '+(r?"color-"+r:"")+'">'+l+"</a>\n          ").trim():"")+"\n        </div>\n      </div>\n    ").trim()},o}(a),c={name:"toast",static:{Toast:l},create:function(){var t=this;t.toast=s.extend({},r({app:t,constructor:l,defaultSelector:".toast.modal-in"}),{show:function(o){return s.extend(o,{destroyOnClose:!0}),new l(t,o).open()}})},params:{toast:{icon:null,text:null,position:"bottom",closeButton:!1,closeButtonColor:null,closeButtonText:"Ok",closeTimeout:null,cssClass:null,render:null}}};if(o){if(t.prototype.modules&&t.prototype.modules[c.name])return;t.use(c),t.instance&&(t.instance.useModuleParams(c,t.instance.params),t.instance.useModule(c))}return c}(Framework7, typeof Framework7AutoInstallComponent === 'undefined' ? undefined : Framework7AutoInstallComponent))
