(function framework7ComponentLoader(e,t){void 0===t&&(t=!0);document,window;var a=e.$,l=(e.Template7,e.utils),o=(e.device,e.support,e.Class),c=(e.Modal,e.ConstructorMethods),d=(e.ModalMethods,function(e){function t(t,o){void 0===o&&(o={}),e.call(this,o,[t]);var c=this,d={};c.useModulesParams(d),c.params=l.extend(d,o);var n=a(c.params.el);if(0!==n.length){if(c.$el=n,c.el=n[0],c.$el[0].f7DataTable){var s=c.$el[0].f7DataTable;return c.destroy(),s}return c.$el[0].f7DataTable=c,l.extend(c,{collapsible:n.hasClass("data-table-collapsible"),$headerEl:n.find(".data-table-header"),$headerSelectedEl:n.find(".data-table-header-selected")}),c.attachEvents=function(){c.$el.on("change",'.checkbox-cell input[type="checkbox"]',i),c.$el.find("thead .sortable-cell").on("click",r)},c.detachEvents=function(){c.$el.off("change",'.checkbox-cell input[type="checkbox"]',i),c.$el.find("thead .sortable-cell").off("click",r)},c.useModules(),c.init(),c}function i(e){if(!e.detail||!e.detail.sentByF7DataTable){var t=a(this),l=t[0].checked,o=t.parents("td,th").index();if(t.parents("thead").length>0)0===o&&n.find("tbody tr")[l?"addClass":"removeClass"]("data-table-row-selected"),n.find("tbody tr td:nth-child("+(o+1)+") input").prop("checked",l).trigger("change",{sentByF7DataTable:!0}),t.prop("indeterminate",!1);else{0===o&&t.parents("tr")[l?"addClass":"removeClass"]("data-table-row-selected");var d=n.find("tbody .checkbox-cell:nth-child("+(o+1)+') input[type="checkbox"]:checked').length,s=n.find("tbody tr").length,i=n.find("thead .checkbox-cell:nth-child("+(o+1)+') input[type="checkbox"]');l?d===s&&i.prop("checked",!0).trigger("change",{sentByF7DataTable:!0}):i.prop("checked",!1),i.prop("indeterminate",d>0&&d<s)}c.checkSelectedHeader()}}function r(){var e,t=a(this),l=t.hasClass("sortable-cell-active"),o=t.hasClass("sortable-desc")?"desc":"asc";l?(e="desc"===o?"asc":"desc",t.removeClass("sortable-desc sortable-asc").addClass("sortable-"+e)):(n.find("thead .sortable-cell-active").removeClass("sortable-cell-active"),t.addClass("sortable-cell-active"),e=o),t.trigger("datatable:sort",e),c.emit("local::sort dataTableSort",c,e)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setCollapsibleLabels=function(){var e=this;e.collapsible&&e.$el.find("tbody td:not(.checkbox-cell)").each(function(t,l){var o=a(l),c=o.index(),d=o.attr("data-collapsible-title");d||""===d||o.attr("data-collapsible-title",e.$el.find("thead th").eq(c).text())})},t.prototype.checkSelectedHeader=function(){if(this.$headerEl.length>0&&this.$headerSelectedEl.length>0){var e=this.$el.find("tbody .checkbox-cell input:checked").length;this.$el[e>0?"addClass":"removeClass"]("data-table-has-checked"),this.$headerSelectedEl.find(".data-table-selected-count").text(e)}},t.prototype.init=function(){this.attachEvents(),this.setCollapsibleLabels(),this.checkSelectedHeader()},t.prototype.destroy=function(){var e=this;e.$el.trigger("datatable:beforedestroy",e),e.emit("local::beforeDestroy dataTableBeforeDestroy",e),e.attachEvents(),e.$el[0]&&(e.$el[0].f7DataTable=null,delete e.$el[0].f7DataTable),l.deleteProps(e),e=null},t}(o)),n={name:"dataTable",static:{DataTable:d},create:function(){this.dataTable=c({defaultSelector:".data-table",constructor:d,app:this,domProp:"f7DataTable"})},on:{tabBeforeRemove:function(e){var t=this;a(e).find(".data-table-init").each(function(e,a){t.dataTable.destroy(a)})},tabMounted:function(e){var t=this;a(e).find(".data-table-init").each(function(e,a){t.dataTable.create({el:a})})},pageBeforeRemove:function(e){var t=this;e.$el.find(".data-table-init").each(function(e,a){t.dataTable.destroy(a)})},pageInit:function(e){var t=this;e.$el.find(".data-table-init").each(function(e,a){t.dataTable.create({el:a})})}},vnode:{"data-table-init":{insert:function(e){var t=e.elm;this.dataTable.create({el:t})},destroy:function(e){var t=e.elm;this.dataTable.destroy(t)}}}};if(t){if(e.prototype.modules&&e.prototype.modules[n.name])return;e.use(n),e.instance&&(e.instance.useModuleParams(n,e.instance.params),e.instance.useModule(n))}return n}(Framework7, typeof Framework7AutoInstallComponent === 'undefined' ? undefined : Framework7AutoInstallComponent))
