var __awaiter=this&&this.__awaiter||function(t,n,o,e){function i(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,r){function a(t){try{c(e.next(t))}catch(t){r(t)}}function s(t){try{c(e["throw"](t))}catch(t){r(t)}}function c(t){t.done?o(t.value):i(t.value).then(a,s)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},e,i,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(n){return c([t,n])}}function c(s){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(e=1,i&&(r=s[0]&2?i["return"]:s[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;if(i=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;i=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]u+h:fu+h;if(i&&!n){if(p){var x=a-1;if(x>=0){l=x}}else if(k){if(i&&!n){var x=a+1;if(x.");this.disabled=false}};t.prototype.disconnectedCallback=function(){var t=this.segmentEl;if(t){u(t,"ionSelect",this.updateState);u(t,"ionStyle",this.updateStyle);this.segmentEl=null}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign({},h(this.el,["aria-label"]));if(!this.contentId)return;var t=document.getElementById(this.contentId);if(!t){p('[ion-segment-button] - Unable to find Segment Content with id="'.concat(this.contentId,'".'));return}if(t.tagName!=="ION-SEGMENT-CONTENT"){p('[ion-segment-button] - Element with id="'.concat(this.contentId,'" is not an element.'));return}};Object.defineProperty(t.prototype,"hasLabel",{get:function(){return!!this.el.querySelector("ion-label")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hasIcon",{get:function(){return!!this.el.querySelector("ion-icon")},enumerable:false,configurable:true});t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){t=this.nativeEl;if(t!==undefined){t.focus()}return[2]}))}))};t.prototype.render=function(){var t;var n=this;var o=this,e=o.checked,i=o.type,s=o.disabled,c=o.hasIcon,l=o.hasLabel,d=o.layout,u=o.segmentEl;var h=m(this);var b=function(){return(u===null||u===void 0?void 0:u.color)!==undefined};return r(a,{key:"d79dad80db69123510c6d52bbf4424558600c14a",class:(t={},t[h]=true,t["in-toolbar"]=g("ion-toolbar",this.el),t["in-toolbar-color"]=g("ion-toolbar[color]",this.el),t["in-segment"]=g("ion-segment",this.el),t["in-segment-color"]=b(),t["segment-button-has-label"]=l,t["segment-button-has-icon"]=c,t["segment-button-has-label-only"]=l&&!c,t["segment-button-has-icon-only"]=c&&!l,t["segment-button-disabled"]=s,t["segment-button-checked"]=e,t["segment-button-layout-".concat(d)]=true,t["ion-activatable"]=true,t["ion-activatable-instant"]=true,t["ion-focusable"]=true,t)},r("button",Object.assign({key:"781fd7fef443a2fbd404b8a399d1203794759a69","aria-selected":e?"true":"false",role:"tab",ref:function(t){return n.nativeEl=t},type:i,class:"button-native",part:"native",disabled:s},this.inheritedAttributes),r("span",{key:"64df08f60ea17481183f8ad284884b9979eaeb24",class:"button-inner"},r("slot",{key:"2b7ef328023ab5ccc0adc6f865e5e7121467eeb8"})),h==="md"&&r("ion-ripple-effect",{key:"1fd5e6179227925a03b6c3b5258bbf4ea99bfef1"})),r("div",{key:"dbcedad6988b0eadeebe02bdafdedb8eb37af19c",part:"indicator",class:"segment-button-indicator segment-button-indicator-animated"},r("div",{key:"f4f1789f66bdfa2de5445bc0d292116a93bad7cc",part:"indicator-background",class:"segment-button-indicator-background"})))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}());N.style={ios:S,md:_}}}}));