import{g as e,ae as t,f as c,af as s,ag as i,M as r,_ as a,t as d,n as o,a as l,e as n,i as h,b as p,F as m,R as w,x as b,o as u,l as f,c as v,d as _}from"./core.js";function y(c,s,i){var r=function(c,s){var i=new Map;g.has(c)||g.set(c,{isEnabled:!0,getObservers:function(e){var t=i.get(e)||[];return i.has(e)||i.set(e,t),t},installedProperties:new Set});var r=g.get(c);if(r.installedProperties.has(s))return r;var a=function(e,t){var c,s=e;for(;s&&!(c=Object.getOwnPropertyDescriptor(s,t));)s=Object.getPrototypeOf(s);return c}(c,s)||{configurable:!0,enumerable:!0,value:c[s],writable:!0},d=e({},a),o=a.get,l=a.set;if("value"in a){delete d.value,delete d.writable;var n=a.value;o=function(){return n},a.writable&&(l=function(e){n=e})}o&&(d.get=function(){return o.call(this)});l&&(d.set=function(e){var c,i,a=o?o.call(this):e;if(l.call(this,e),r.isEnabled&&(!o||e!==a))try{for(var d=t(r.getObservers(s)),n=d.next();!n.done;n=d.next()){(0,n.value)(e,a)}}catch(e){c={error:e}}finally{try{n&&!n.done&&(i=d.return)&&i.call(d)}finally{if(c)throw c.error}}});return r.installedProperties.add(s),Object.defineProperty(c,s,d),r}(c,s),a=r.getObservers(s);return a.push(i),function(){a.splice(a.indexOf(i),1)}}var g=new WeakMap;var x,k,C=function(e){function r(t){var c=e.call(this,t)||this;return c.unobserves=new Set,c}return c(r,e),r.prototype.destroy=function(){e.prototype.destroy.call(this),this.unobserve()},r.prototype.observe=function(e,c){var s,i,r=this,a=[];try{for(var d=t(Object.keys(c)),o=d.next();!o.done;o=d.next()){var l=o.value,n=c[l].bind(this);a.push(this.observeProperty(e,l,n))}}catch(e){s={error:e}}finally{try{o&&!o.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}var h=function(){var e,c;try{for(var s=t(a),i=s.next();!i.done;i=s.next()){(0,i.value)()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(c=s.return)&&c.call(s)}finally{if(e)throw e.error}}r.unobserves.delete(h)};return this.unobserves.add(h),h},r.prototype.observeProperty=function(e,t,c){return y(e,t,c)},r.prototype.setObserversEnabled=function(e,t){!function(e,t){var c=g.get(e);c&&(c.isEnabled=t)}(e,t)},r.prototype.unobserve=function(){var e,c;try{for(var r=t(s([],i(this.unobserves))),a=r.next();!a.done;a=r.next()){(0,a.value)()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(c=r.return)&&c.call(r)}finally{if(e)throw e.error}}},r}(r);!function(e){e.PROCESSING="mdc-switch--processing",e.SELECTED="mdc-switch--selected",e.UNSELECTED="mdc-switch--unselected"}(x||(x={})),function(e){e.RIPPLE=".mdc-switch__ripple"}(k||(k={}));var P=function(e){function t(t){var c=e.call(this,t)||this;return c.handleClick=c.handleClick.bind(c),c}return c(t,e),t.prototype.init=function(){this.observe(this.adapter.state,{disabled:this.stopProcessingIfDisabled,processing:this.stopProcessingIfDisabled})},t.prototype.handleClick=function(){this.adapter.state.disabled||(this.adapter.state.selected=!this.adapter.state.selected)},t.prototype.stopProcessingIfDisabled=function(){this.adapter.state.disabled&&(this.adapter.state.processing=!1)},t}(C);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}c(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.observe(this.adapter.state,{disabled:this.onDisabledChange,processing:this.onProcessingChange,selected:this.onSelectedChange})},t.prototype.initFromDOM=function(){this.setObserversEnabled(this.adapter.state,!1),this.adapter.state.selected=this.adapter.hasClass(x.SELECTED),this.onSelectedChange(),this.adapter.state.disabled=this.adapter.isDisabled(),this.adapter.state.processing=this.adapter.hasClass(x.PROCESSING),this.setObserversEnabled(this.adapter.state,!0),this.stopProcessingIfDisabled()},t.prototype.onDisabledChange=function(){this.adapter.setDisabled(this.adapter.state.disabled)},t.prototype.onProcessingChange=function(){this.toggleClass(this.adapter.state.processing,x.PROCESSING)},t.prototype.onSelectedChange=function(){this.adapter.setAriaChecked(String(this.adapter.state.selected)),this.toggleClass(this.adapter.state.selected,x.SELECTED),this.toggleClass(!this.adapter.state.selected,x.UNSELECTED)},t.prototype.toggleClass=function(e,t){e?this.adapter.addClass(t):this.adapter.removeClass(t)}}(P);class E extends m{constructor(){super(...arguments),this.processing=!1,this.selected=!1,this.ariaLabel="",this.ariaLabelledBy="",this.shouldRenderRipple=!1,this.rippleHandlers=new w((()=>(this.shouldRenderRipple=!0,this.ripple))),this.name="",this.value="on",this.mdcFoundationClass=P}setFormData(e){this.name&&this.selected&&e.append(this.name,this.value)}click(){var e,t;this.disabled||(null===(e=this.mdcRoot)||void 0===e||e.focus(),null===(t=this.mdcRoot)||void 0===t||t.click())}render(){return b`
`}getRenderClasses(){return{"mdc-switch--processing":this.processing,"mdc-switch--selected":this.selected,"mdc-switch--unselected":!this.selected}}renderHandle(){return b`