(function framework7ComponentLoader(a,t){void 0===t&&(t=!0);var e=a.$,n=(a.Template7,a.utils),i=(a.getDevice,a.getSupport,a.Class,a.Modal,a.ConstructorMethods,a.ModalMethods,n.extend),r={show:function(){for(var a,t,n,i,r,s=this,l=arguments.length,o=new Array(l),b=0;b<l;b++)o[b]=arguments[b];1===o.length&&o[0]&&o[0].constructor===Object?(a=o[0].tabEl,t=o[0].tabLinkEl,n=o[0].animate,i=o[0].tabRoute,r=o[0].animatedInit):(a=o[0],t=o[1],n=o[2],i=o[3],"boolean"==typeof o[1]&&(a=o[0],n=o[1],t=o[2],i=o[3],o.length>2&&t.constructor===Object&&(a=o[0],n=o[1],i=o[2],t=o[3]))),void 0===n&&(n=!0);var d,h=e(a);if(i&&h[0]&&(h[0].f7TabRoute=i),!r&&(0===h.length||h.hasClass("tab-active")))return{$newTabEl:h,newTabEl:h[0]};t&&(d=e(t));var g=h.parent(".tabs");if(0===g.length)return{$newTabEl:h,newTabEl:h[0]};s.swipeout&&(s.swipeout.allowOpen=!0);var c=[];function p(a){c.push(a)}function u(){c.forEach((function(a){a()}))}var f,v=!1;if(g.parent().hasClass("tabs-animated-wrap")){g.parent()[n?"removeClass":"addClass"]("not-animated");var m=parseFloat(g.css("transition-duration").replace(",","."));n&&m&&(g.transitionEnd(u),v=!0);var w=100*(s.rtl?h.index():-h.index());g.transform("translate3d("+w+"%,0,0)")}g.parent().hasClass("tabs-swipeable-wrap")&&s.swiper&&((f=g.parent()[0].swiper)&&f.activeIndex!==h.index()?(v=!0,f.once("slideChangeTransitionEnd",(function(){u()})).slideTo(h.index(),n?void 0:0)):f&&f.animating&&(v=!0,f.once("slideChangeTransitionEnd",(function(){u()}))));var E=g.children(".tab-active");if(E.removeClass("tab-active"),!r&&(!f||f&&!f.animating||f&&i)&&(E.hasClass("view")&&E.children(".page").length&&E.children(".page").each((function(a){e(a).trigger("page:tabhide"),s.emit("pageTabHide",a)})),E.trigger("tab:hide"),s.emit("tabHide",E[0])),h.addClass("tab-active"),!r&&(!f||f&&!f.animating||f&&i)&&(h.hasClass("view")&&h.children(".page").length&&h.children(".page").each((function(a){e(a).trigger("page:tabshow"),s.emit("pageTabShow",a)})),h.trigger("tab:show"),s.emit("tabShow",h[0])),!d&&((!(d=e("string"==typeof a?'.tab-link[href="'+a+'"]':'.tab-link[href="#'+h.attr("id")+'"]'))||d&&0===d.length)&&e("[data-tab]").each((function(a){h.is(e(a).attr("data-tab"))&&(d=e(a))})),i&&(!d||d&&0===d.length)&&0===(d=e('[data-route-tab-id="'+i.route.tab.id+'"]')).length&&(d=e('.tab-link[href="'+i.url+'"]')),d.length>1&&h.parents(".page").length&&(d=d.filter((function(a){return e(a).parents(".page")[0]===h.parents(".page")[0]})),"ios"===s.theme&&0===d.length&&i))){var C=h.parents(".page"),T=e(s.navbar.getElByPage(C));0===(d=T.find('[data-route-tab-id="'+i.route.tab.id+'"]')).length&&(d=T.find('.tab-link[href="'+i.url+'"]'))}if(d.length>0){var k;if(E&&E.length>0){var x=E.attr("id");x&&(!(k=e('.tab-link[href="#'+x+'"]'))||k&&0===k.length)&&(k=e('.tab-link[data-route-tab-id="'+x+'"]')),(!k||k&&0===k.length)&&e("[data-tab]").each((function(a){E.is(e(a).attr("data-tab"))&&(k=e(a))})),(!k||k&&0===k.length)&&(k=d.siblings(".tab-link-active"))}else i&&(k=d.siblings(".tab-link-active"));if(k&&k.length>1&&E&&E.parents(".page").length&&(k=k.filter((function(a){return e(a).parents(".page")[0]===E.parents(".page")[0]}))),k&&k.length>0&&k.removeClass("tab-link-active"),d&&d.length>0&&(d.addClass("tab-link-active"),"md"===s.theme&&s.toolbar)){var M=d.parents(".tabbar, .tabbar-labels");M.length>0&&s.toolbar.setHighlight(M)}}return{$newTabEl:h,newTabEl:h[0],$oldTabEl:E,oldTabEl:E[0],onTabsChanged:p,animated:v}}},s={name:"tabs",create:function(){i(this,{tab:{show:r.show.bind(this)}})},on:{"pageInit tabMounted":function(a){var t=e(a.el||a).find(".tabs-animated-wrap > .tabs > .tab-active")[0];if(t){this.tab.show({tabEl:t,animatedInit:!0,animate:!1})}}},clicks:{".tab-link":function(a,t){if(void 0===t&&(t={}),a.attr("href")&&0===a.attr("href").indexOf("#")||a.attr("data-tab")){this.tab.show({tabEl:t.tab||a.attr("href"),tabLinkEl:a,animate:t.animate})}}}};if(t){if(a.prototype.modules&&a.prototype.modules[s.name])return;a.use(s),a.instance&&(a.instance.useModuleParams(s,a.instance.params),a.instance.useModule(s))}return s}(Framework7, typeof Framework7AutoInstallComponent === 'undefined' ? undefined : Framework7AutoInstallComponent))
