var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function u(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}c((r=r.apply(e,t||[])).next())})};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,o,a,i;return i={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(t){return c([e,t])}}function c(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(a=i[0]&2?o["return"]:i[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;if(o=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;o=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){n.label=i[1];break}if(i[0]===6&&n.label<a[1]){n.label=a[1];a=i;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(i);break}if(a[2])n.ops.pop();n.trys.pop();continue}i=t.call(e,n)}catch(e){i=[6,e];o=0}finally{r=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-dde863a3.system.js"],function(e){"use strict";var t,n,r;return{setters:[function(e){t=e.r;n=e.h;r=e.g}],execute:function(){var o=function(){function e(e){t(this,e)}e.prototype.componentDidLoad=function(){var e=this;this.createGroup().then(function(){var t=e.tabGroup[0];e.selectGroup(t);if(e.selectedIndex)e.activeIndex=Number(e.selectedIndex)-1})};e.prototype.componentDidUpdate=function(){if(this.selectedIndex)this.activeIndex=Number(this.selectedIndex)-1};e.prototype.onSelectedTab=function(e){var t=this.tabGroup.find(function(t){return t.header.id===e.detail.id});this.selectGroup(t)};e.prototype.createGroup=function(){return __awaiter(this,void 0,void 0,function(){var e,t;var n=this;return __generator(this,function(r){switch(r.label){case 0:e=Array.from(this.host.querySelectorAll("ema-tab-header"));this.tabsHeader=[];e.map(function(e){return __awaiter(n,void 0,void 0,function(){var t,n;return __generator(this,function(r){switch(r.label){case 0:n=(t=this.tabsHeader).push;return[4,e.getChild()];case 1:n.apply(t,[r.sent()]);return[2]}})})});t=Array.from(this.host.querySelectorAll("ema-tab-content"));this.tabsContent=[];t.map(function(e){return __awaiter(n,void 0,void 0,function(){var t,n;return __generator(this,function(r){switch(r.label){case 0:n=(t=this.tabsContent).push;return[4,e.getChild()];case 1:n.apply(t,[r.sent()]);return[2]}})})});return[4,new Promise(function(e){return setTimeout(e,40)})];case 1:r.sent();this.tabGroup=this.tabsHeader.map(function(e){var t=n.tabsContent.find(function(t){return t.name===e.name});return{header:e,content:t}});return[2]}})})};e.prototype.selectGroup=function(e){this.tabGroup.forEach(function(e){e.header.unselect();e.content.unselect()});e.header.select();e.content.select()};Object.defineProperty(e.prototype,"activeIndex",{set:function(e){var t=0;this.tabGroup.forEach(function(n){if(t==e){n.header.select();n.content.select()}else{n.header.unselect();n.content.unselect()}t++})},enumerable:true,configurable:true});e.prototype.render=function(){return[n("div",{class:"ema-tabs-header"},n("slot",{name:"header"})),n("div",{class:"ema-tabs-content"},n("slot",{name:"content"}))]};Object.defineProperty(e.prototype,"host",{get:function(){return r(this)},enumerable:true,configurable:true});Object.defineProperty(e,"style",{get:function(){return":root{--ema-color:#343a40;--ema-primary:#007bff;--ema-secondary:#6c757d;--ema-success:#28a745;--ema-info:#17a2b8;--ema-warning:#ffc107;--ema-danger:#dc3545;--ema-light:#f8f9fa;--ema-dark:#343a40;--ema-background:#fff;--ema-background-diap:rgba(29,29,29,0.97);--ema-border-color:#c5c9cd;--ema-border:1px solid #c5c9cd;--ema-border-radius:3px 3px 3px 3px;--ema-box-shadow:1px 1px 10px 1px #ccc;--ema-margin:0.25rem;--ema-margin-sm:0.5rem;--ema-margin-md:1rem;--ema-margin-lg:1.5rem;--ema-margin-xl:2rem;--ema-padding:0.25rem;--ema-padding-sm:0.5rem;--ema-padding-md:1rem;--ema-padding-lg:1.5rem;--ema-padding-xl:2rem;--ema-gray-100:#f8f9fa;--ema-gray-200:#e9ecef;--ema-gray-300:#dee2e6;--ema-gray-400:#ced4da;--ema-gray-500:#adb5bd;--ema-gray-600:#868e96;--ema-gray-700:#495057;--ema-gray-800:#343a40;--ema-gray-900:#212529}.ema-tabs-header{display:-ms-flexbox;display:flex;border-bottom:1px solid rgba(0,0,0,.3)}.ema-tabs-content{padding:10px}"},enumerable:true,configurable:true});return e}();e("ema_tabs",o)}}});