(function framework7ComponentLoader(t,e){void 0===e&&(e=!0);var i=t.$,o=(t.Template7,t.utils),n=(t.getDevice,t.getSupport,t.Class,t.Modal),a=(t.ConstructorMethods,t.ModalMethods),s=o.extend,c=o.nextTick,l=o.now;function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u=function(t){var e,o;function n(e,o){var n,a=s({on:{}},e.params.notification,o),u=r(n=t.call(this,e,a)||this);u.app=e,u.params=a;var f,p,d,v,h,m,g,y=u.params,T=y.icon,b=y.title,x=y.titleRightText,C=y.subtitle,M=y.text,$=y.closeButton,k=y.closeTimeout,w=y.cssClass,R=y.closeOnClick;if(u.params.el)f=i(u.params.el);else{var B=u.render({icon:T,title:b,titleRightText:x,subtitle:C,text:M,closeButton:$,cssClass:w});f=i(B)}if(f&&f.length>0&&f[0].f7Modal)return f[0].f7Modal||r(n);if(0===f.length)return u.destroy()||r(n);s(u,{$el:f,el:f[0],type:"notification"}),f[0].f7Modal=u,$&&f.find(".notification-close-button").on("click",(function(){u.close()})),f.on("click",(function(t){$&&i(t.target).closest(".notification-close-button").length||(u.emit("local::click notificationClick",u),R&&u.close())})),u.on("beforeDestroy",(function(){f.off("click")}));var D,X={};function Y(t){p||(p=!0,d=!1,v=void 0,m=l(),X.x="touchstart"===t.type?t.targetTouches[0].pageX:t.pageX,X.y="touchstart"===t.type?t.targetTouches[0].pageY:t.pageY)}function _(t){if(p){var e="touchmove"===t.type?t.targetTouches[0].pageX:t.pageX,i="touchmove"===t.type?t.targetTouches[0].pageY:t.pageY;if(void 0===v&&(v=!!(v||Math.abs(i-X.y)<Math.abs(e-X.x))),v)p=!1;else{t.preventDefault(),d||(u.$el.removeClass("notification-transitioning"),u.$el.transition(0),g=u.$el[0].offsetHeight/2),d=!0;var o=h=i-X.y;h>0&&(o=Math.pow(h,.8)),u.$el.transform("translate3d(0, "+o+"px, 0)")}}}function E(){if(!p||!d)return p=!1,void(d=!1);if(p=!1,d=!1,0!==h){var t=l()-m;u.$el.transition(""),u.$el.addClass("notification-transitioning"),u.$el.transform(""),(h<-10&&t<300||-h>=g/1)&&u.close()}}return u.on("open",(function(){u.params.swipeToClose&&(u.$el.on(e.touchEvents.start,Y,{passive:!0}),e.on("touchmove:active",_),e.on("touchend:passive",E)),i(".notification.modal-in").each((function(t){var i=e.notification.get(t);t!==u.el&&i&&i.close()})),k&&function t(){D=c((function(){p&&d?t():u.close()}),k)}()})),u.on("close beforeDestroy",(function(){u.params.swipeToClose&&(u.$el.off(e.touchEvents.start,Y,{passive:!0}),e.off("touchmove:active",_),e.off("touchend:passive",E)),clearTimeout(D)})),u||r(n)}return o=t,(e=n).prototype=Object.create(o.prototype),e.prototype.constructor=e,e.__proto__=o,n.prototype.render=function(){if(this.params.render)return this.params.render.call(this,this);var t=this.params,e=t.icon,i=t.title,o=t.titleRightText,n=t.subtitle,a=t.text,s=t.closeButton;return('\n      <div class="notification '+(t.cssClass||"")+'">\n        <div class="notification-header">\n          '+(e?'<div class="notification-icon">'+e+"</div>":"")+"\n          "+(i?'<div class="notification-title">'+i+"</div>":"")+"\n          "+(o?'<div class="notification-title-right-text">'+o+"</div>":"")+"\n          "+(s?'<span class="notification-close-button"></span>':"")+'\n        </div>\n        <div class="notification-content">\n          '+(n?'<div class="notification-subtitle">'+n+"</div>":"")+"\n          "+(a?'<div class="notification-text">'+a+"</div>":"")+"\n        </div>\n      </div>\n    ").trim()},n}(n),f={name:"notification",static:{Notification:u},create:function(){this.notification=s({},a({app:this,constructor:u,defaultSelector:".notification.modal-in"}))},params:{notification:{icon:null,title:null,titleRightText:null,subtitle:null,text:null,closeButton:!1,closeTimeout:null,closeOnClick:!1,swipeToClose:!0,cssClass:null,render:null}}};if(e){if(t.prototype.modules&&t.prototype.modules[f.name])return;t.use(f),t.instance&&(t.instance.useModuleParams(f,t.instance.params),t.instance.useModule(f))}return f}(Framework7, typeof Framework7AutoInstallComponent === 'undefined' ? undefined : Framework7AutoInstallComponent))
