1import{D as e,E as t,Et as l,G as a,Gt as o,J as s,Lt as n,N as r,Nt as i,St as u,Tt as c,_ as d,fn as g,hn as m,it as p,mn as f,q as b,vt as v,w}from"./B8XHxhss.js";import{B as h,Ft as y,Nt as _,O as x,_ as E}from"#entry";import{t as C}from"./DXNx4Ry-.js";import{t as O}from"./tKPW4sCS.js";import{t as S}from"./BHxXZfbq.js";var T=Object.assign({inheritAttrs:!1},{__name:"ToggleButton",props:b({color:{type:String,default:""}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=v(t,"modelValue");return(n,r)=>(p(),e("div",s({class:["c-toggle-button",{[`c-toggle-button--color--${t.color}`]:t.color}]},("useAttrsSome"in n?n.useAttrsSome:o(O))(["class","style","data-n-ids"],n.$attrs)),[w("div",{class:g(["group relative w-full h-full rounded-full p-4 cursor-pointer",[!t.color&&"before:content-[''] before:absolute before:inset-0 before:transition-colors before:duration-200 before:rounded-full hover:before:bg-opacity-50",a.value?"before:bg-onIndentActive":"before:bg-onIndent"]])},[l(w("input",s({"onUpdate:modelValue":r[0]||(r[0]=e=>a.value=e),type:"checkbox",class:"appearance-none absolute inset-0 w-full h-full"},("useAttrsExcept"in n?n.useAttrsExcept:o(x))(["class","style","data-n-ids"],n.$attrs)),null,16),[[y,a.value]]),r[1]||(r[1]=w("div",{class:"c-toggle-button__pill relative w-auto h-full aspect-ratio-1 bg-bgCurrent border border-extraStrong rounded-full"},null,-1))],2)],16))}}),j={class:"sr-only"},z=["aria-hidden","inert"],A={class:"pl-4xs"},B={__name:"ClimateToggle",setup(l){const b=h(),v=n(!!b.value),y=n({}),x=n({}),O=n(null),B=n(0),k=n(!a("climateButtonStartsOpen",!0));S("scroll",V),S("resize",V),u(k,()=>{B.value=0}),u(v,e=>{if(!!e!=!!b.value&&O.value){const{left:t,top:l,width:a,height:o}=(document.getElementById("climate-toggle")||O.value).getBoundingClientRect();Object.assign(y.value,{backgroundColor:getComputedStyle(document.documentElement).backgroundColor,"--origin-x":Math.round((t+a/2)/window.innerWidth*1e4)/100+"%","--origin-y":Math.round((l+o/2)/window.innerHeight*1e4)/100+"%"}),setTimeout(()=>{b.value=e},200)}});let N=0;function V(){const e=N;({scrollY:N}=window);const t=Math.abs(N-e);B.value=Math.min(B.value+t,N),B.value>.8*window.innerHeight&&(k.value=!0)}function I(){k.value&&(k.value=!1)}return(l,a)=>{const n=C,u=T;return p(),e(d,null,[r(_,{name:"t-climate-toggle__screen-cover"},{default:c(()=>[o(v)!==o(b)?(p(),e("div",{key:0,class:"c-climate-toggle__screen-cover",style:f(o(y))},null,4)):t("",!0)]),_:1}),w("div",s({ref_key:"$el",ref:O,class:["c-climate-toggle",{"c-climate-toggle--has-scrolled":o(k)}]},l.$attrs),[w("div",{class:g(["c-climate-toggle__wrap relative grid items-center w-fit p-4xs bg-secondary text-strong text-body-sm-strong rounded-full pointer-events-auto transition-colors duration-300",[!o(k)&&">=656:justify-end 656:w-fit 656:pr-28"]]),style:f(o(x))},[r(n,{name:"eco",class:"w-24 h-24 >=656:w-48 656:h-48"}),o(k)?(p(),e("button",{key:0,class:"absolute left-0 top-0 h-full w-auto aspect-ratio-1 z-10",onClick:I},[w("span",j,m(("localize"in l?l.localize:o(E))("OPEN_CLIMATE_BUTTON",{capitalize:!0})),1)])):t("",!0),w("label",{class:g(["ml-auto cursor-pointer inline-flex justify-between items-center gap-4xs w-max max-w-[calc(100cqw-64px)] transition-opacity duration-200",{"opacity-0 invisible":o(k),"delay-100":!o(k)}]),"aria-hidden":o(k)?"true":null,inert:o(k)?"true":null},[w("span",A,m(("localize"in l?l.localize:o(E))("REDUCE_SITES_CARBON_FOOTPRING",{capitalize:!0})),1),r(u,{id:"climate-toggle",modelValue:o(v),"onUpdate:modelValue":a[0]||(a[0]=e=>i(v)?v.value=e:null),name:"climate-mode","data-focus":".c-climate-toggle__wrap",class:"transition-colors duration-300"},null,8,["modelValue"])],10,z)],6)],16)],64)}}};export{B as default};
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.