1import{A as e,C as t,M as n,Q as r,S as i,T as a,an as o,cn as s,dt as c,en as l,nn as u,pt as d,t as f,w as p,wt as m}from"./vue.runtime.esm-bundler-CQND_IVA.js";import{r as h,rt as g}from"./core-hDH_FBV0.js";import{n as _,t as v}from"./FaMinusRegular-CAr0fuiS.js";import{n as y,t as b}from"./Fade-DRofutVp.js";var x,S,C,w=s((()=>{f(),h(),_(),y(),x={class:`eds-reset`},S=200,C=n({__name:`ToggleSwitch`,props:{on:{type:[Boolean,null]},isExecuting:{type:Boolean},label:{},size:{default:`Small`},disabled:{type:Boolean}},emits:[`update:on`],setup(n,{emit:s}){let f=s,h=m(n.on),_=m(n.isExecuting),y=m(void 0),C;function w(){f(`update:on`,!n.on)}return c(()=>n.on,async e=>{await g(_).not.toBeTruthy(),h.value=e}),c(()=>n.isExecuting,e=>{if(window.clearTimeout(C),C=void 0,e){_.value=!0,y.value=Date.now();return}if(y.value===void 0)return;let t=Date.now()-y.value,n=Math.max(0,S-t);C=window.setTimeout(()=>{C=void 0,_.value=!1},n)}),(s,c)=>(r(),a(`div`,x,[i(`div`,{class:l([`flex items-center gap-x-eds-s`,{"eds-paragraphs-s-regular":n.size===`Small`,"pointer-events-none":n.disabled||_.value}])},[i(`div`,{style:u({"--diameter":n.size===`Small`?`1.25rem`:`1.5rem`,transitionDuration:`${S}ms`}),class:l([`h-[var(--diameter)] shrink-0 grid justify-center transition-[grid-template-columns] ease-out`,n.size===`Small`?`w-9`:`w-11`,_.value?`grid-cols-[var(--diameter)]`:`grid-cols-[100%]`])},[i(`div`,{style:u({transitionDuration:`${S}ms`}),class:l([`size-full relative border-2 border-transparent rounded-eds-m cursor-pointer transition-colors ease-out`,h.value||h.value===null?n.disabled?`bg-eds-brand-light`:`bg-eds-brand`:n.disabled?`bg-eds-disabled`:`bg-grey-200`]),onClick:w},[i(`span`,{style:u({transitionDuration:`${S}ms`}),class:l([`absolute top-0 h-full aspect-square flex justify-center items-center rounded-full bg-eds-primary shadow-[0_0_0_2px_transparent] ease-out before:absolute before:-inset-[2px] before:border-2 before:border-transparent before:rounded-full`,h.value?`left-full -translate-x-full`:h.value===null?`left-1/2 -translate-x-1/2`:`left-0`,y.value!==void 0&&_.value===!1?`transition-[box-shadow]`:`transition-[left,transform,box-shadow]`,{"shadow-eds-tertiary before:border-r-eds-brand before:animate-spin":_.value}])},[e(b,null,{default:d(()=>[h.value===null&&!_.value?(r(),t(v,{key:0,class:l([`icon-square-0-75`,n.disabled?`text-eds-disabled`:`text-eds-brand`])},null,8,[`class`])):p(``,!0)]),_:1})],6)],6)],6),n.label===void 0?p(``,!0):(r(),a(`label`,{key:0,onClick:w},o(n.label),1))],2)]))}})})),T,E=s((()=>{w(),w(),T=C}));export{E as n,T as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.