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