vanilla-breeze 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/components/accordion-wc.js +1 -1
- package/dist/cdn/components/analytics-panel.js +1 -1
- package/dist/cdn/components/audio-player.js +1 -1
- package/dist/cdn/components/audio-visualizer.js +2 -2
- package/dist/cdn/components/author-index.js +1 -1
- package/dist/cdn/components/brand-mark.js +1 -1
- package/dist/cdn/components/calendar-wc.js +2 -2
- package/dist/cdn/components/card-list.js +1 -1
- package/dist/cdn/components/carousel-wc.js +1 -1
- package/dist/cdn/components/change-set.js +1 -1
- package/dist/cdn/components/chart-wc.js +11 -11
- package/dist/cdn/components/chat-input.js +1 -1
- package/dist/cdn/components/chat-window.js +1 -1
- package/dist/cdn/components/color-palette.js +4 -4
- package/dist/cdn/components/color-picker.js +1 -1
- package/dist/cdn/components/combo-box.js +1 -1
- package/dist/cdn/components/command-palette.js +1 -1
- package/dist/cdn/components/comment-wc.js +1 -1
- package/dist/cdn/components/compare-surface.js +1 -1
- package/dist/cdn/components/component-sampler.js +4 -4
- package/dist/cdn/components/consent-banner.js +1 -1
- package/dist/cdn/components/content-lens.js +1 -1
- package/dist/cdn/components/content-swap.js +1 -1
- package/dist/cdn/components/context-menu.js +1 -1
- package/dist/cdn/components/data-table.js +1 -1
- package/dist/cdn/components/date-picker.js +1 -1
- package/dist/cdn/components/day-view.js +1 -1
- package/dist/cdn/components/drag-surface.js +1 -1
- package/dist/cdn/components/drop-down.js +1 -1
- package/dist/cdn/components/emoji-picker.js +1 -1
- package/dist/cdn/components/flow-diagram.js +1 -1
- package/dist/cdn/components/font-pairer.js +1 -1
- package/dist/cdn/components/foot-notes.js +1 -1
- package/dist/cdn/components/form-field.js +1 -1
- package/dist/cdn/components/gantt-chart.js +1 -1
- package/dist/cdn/components/geo-map.js +3 -3
- package/dist/cdn/components/glossary-index.js +1 -1
- package/dist/cdn/components/glossary-wc.js +1 -1
- package/dist/cdn/components/gradient-builder.js +1 -1
- package/dist/cdn/components/heading-links.js +1 -1
- package/dist/cdn/components/highlight-wc.js +2 -2
- package/dist/cdn/components/image-gallery.js +1 -1
- package/dist/cdn/components/image-map.js +1 -1
- package/dist/cdn/components/impact-effort.js +1 -1
- package/dist/cdn/components/include-file.js +1 -1
- package/dist/cdn/components/kanban-board.js +1 -1
- package/dist/cdn/components/manifest.json +95 -95
- package/dist/cdn/components/markdown-editor.js +1 -1
- package/dist/cdn/components/markdown-viewer.js +1 -1
- package/dist/cdn/components/motion-specimen.js +3 -3
- package/dist/cdn/components/note-wc.js +1 -1
- package/dist/cdn/components/notification-wc.js +4 -4
- package/dist/cdn/components/page-info.js +20 -20
- package/dist/cdn/components/page-stats.js +1 -1
- package/dist/cdn/components/page-toc.js +1 -1
- package/dist/cdn/components/page-tools.js +1 -1
- package/dist/cdn/components/page-tour.js +2 -2
- package/dist/cdn/components/palette-generator.js +1 -1
- package/dist/cdn/components/popularity-index.js +1 -1
- package/dist/cdn/components/print-page.js +1 -1
- package/dist/cdn/components/qr-code.js +1 -1
- package/dist/cdn/components/reader-view.js +2 -2
- package/dist/cdn/components/recently-visited.js +26 -2
- package/dist/cdn/components/selection-menu.js +1 -1
- package/dist/cdn/components/semantic-palette.js +1 -1
- package/dist/cdn/components/settings-panel.js +2 -2
- package/dist/cdn/components/share-wc.js +1 -1
- package/dist/cdn/components/short-cuts.js +1 -1
- package/dist/cdn/components/site-index.js +1 -1
- package/dist/cdn/components/site-map-wc.js +1 -1
- package/dist/cdn/components/site-map.js +1 -1
- package/dist/cdn/components/site-search.js +3 -3
- package/dist/cdn/components/slide-accept.js +1 -1
- package/dist/cdn/components/social-embed.js +1 -1
- package/dist/cdn/components/spacing-specimen.js +2 -2
- package/dist/cdn/components/split-surface.js +1 -1
- package/dist/cdn/components/star-rating.js +1 -1
- package/dist/cdn/components/story-map.js +1 -1
- package/dist/cdn/components/tab-set.js +1 -1
- package/dist/cdn/components/text-reader.js +2 -2
- package/dist/cdn/components/theme-export.js +1 -1
- package/dist/cdn/components/theme-picker.js +3 -3
- package/dist/cdn/components/time-index.js +1 -1
- package/dist/cdn/components/time-picker.js +1 -1
- package/dist/cdn/components/toast-msg.js +1 -1
- package/dist/cdn/components/token-specimen.js +6 -6
- package/dist/cdn/components/tool-tip.js +1 -1
- package/dist/cdn/components/topic-map.js +3 -2
- package/dist/cdn/components/trust-filter.js +3 -3
- package/dist/cdn/components/type-specimen.js +1 -1
- package/dist/cdn/components/user-story.js +8 -8
- package/dist/cdn/components/video-player.js +4 -4
- package/dist/cdn/components/watch-wc.js +2 -2
- package/dist/cdn/components/week-view.js +1 -1
- package/dist/cdn/components/work-item.js +14 -14
- package/dist/cdn/components/youtube-player.js +1 -1
- package/dist/cdn/packs/design-system.full.js +15 -15
- package/dist/cdn/packs/effects.full.js +1 -1
- package/dist/cdn/packs/manifest.json +5 -5
- package/dist/cdn/packs/ui.full.css +1 -1
- package/dist/cdn/packs/ui.full.js +5 -5
- package/dist/cdn/packs/ux-planning.full.js +119 -119
- package/dist/cdn/vanilla-breeze-charts.css +1 -1
- package/dist/cdn/vanilla-breeze-charts.js +11 -11
- package/dist/cdn/vanilla-breeze-core.css +1 -1
- package/dist/cdn/vanilla-breeze-core.js +21 -21
- package/dist/cdn/vanilla-breeze-extras.js +3 -3
- package/dist/cdn/vanilla-breeze.css +1 -1
- package/dist/cdn/vanilla-breeze.js +210 -185
- package/package.json +5 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var sa=Object.defineProperty;var D=(i,t)=>()=>(i&&(t=i(i=0)),t);var bt=(i,t)=>{for(var e in t)sa(i,e,{get:t[e],enumerable:!0})};function ha(){let i=globalThis.localStorage;if(!i)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return i.getItem(t)},async setRaw(t,e){i.setItem(t,e)},async removeRaw(t){i.removeItem(t)},async keys(t){let e=[];for(let s=0;s<i.length;s++){let n=i.key(s);n&&n.startsWith(t)&&e.push(n)}return e}}}function V(){return Rt||(Rt=ha()),Rt}function Ee(i,t){if(typeof i!="string"||!i)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${i}:${t}`}function Rs(i){if(typeof i!="string"||!i)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${i}:`}function Hs(i){try{let t=JSON.parse(i);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var Rt,w,W=D(()=>{Rt=null;w={configure(i={}){Rt=i.backend??null},async set(i,t,e){let s={data:e,timestamp:Date.now()};await V().setRaw(Ee(i,t),JSON.stringify(s))},async get(i,t,e){let s=await V().getRaw(Ee(i,t));if(s==null)return null;let n=Hs(s);return!n||e?.maxAge!=null&&Date.now()-n.timestamp>e.maxAge?null:n.data},async remove(i,t){await V().removeRaw(Ee(i,t))},async list(i){let t=Rs(i),e=await V().keys(t),s=[];for(let n of e){let r=await V().getRaw(n);if(r==null)continue;let a=Hs(r);a&&s.push({key:n.slice(t.length),data:a.data,timestamp:a.timestamp})}return s},async clear(i){let t=Rs(i),e=await V().keys(t);for(let s of e)await V().removeRaw(s)},async clearAll(){let i=await V().keys("vb:");for(let t of i)await V().removeRaw(t)},async setMany(i,t){for(let[e,s]of t)await w.set(i,e,s)}}});var cn={};bt(cn,{addDialogDismiss:()=>an,addLongPress:()=>rn,addPullToRefresh:()=>ka,addSwipeListener:()=>sn,haptic:()=>Ut,initGestures:()=>on,makeSwipeable:()=>nn});function sn(i,t={}){let e=t.threshold??50,s=t.restraint??100,n=t.timeout??300,r,a,o;function c(h){h.isPrimary&&(r=h.clientX,a=h.clientY,o=Date.now())}function l(h){if(!h.isPrimary)return;let d=h.clientX-r,u=h.clientY-a,b=Date.now()-o;if(b>n)return;let y=Math.abs(d),p=Math.abs(u),E;if(y>=e&&p<=s?E=d<0?"left":"right":p>=e&&y<=s&&(E=u<0?"up":"down"),E){let v=E==="left"||E==="right"?y:p;i.dispatchEvent(new CustomEvent(`swipe-${E}`,{bubbles:!0,detail:{distance:v,duration:b}}))}}return i.addEventListener("pointerdown",c,{passive:!0}),i.addEventListener("pointerup",l,{passive:!0}),()=>{i.removeEventListener("pointerdown",c),i.removeEventListener("pointerup",l)}}function nn(i,t={}){let e=t.threshold??100,s=t.direction??"horizontal",n=t.removeOnDismiss??!0,r=s==="horizontal",a=0,o=0,c=!1;function l(p){!p.isPrimary||i.hasAttribute("data-dismissed")||(p.preventDefault(),c=!0,a=r?p.clientX:p.clientY,o=0,i.setPointerCapture(p.pointerId),i.setAttribute("data-swiping",""))}function h(p){if(!c||!p.isPrimary)return;o=(r?p.clientX:p.clientY)-a;let v=1-Math.min(Math.abs(o)/e,1)*.5;r?i.style.transform=`translateX(${o}px)`:i.style.transform=`translateY(${o}px)`,i.style.opacity=String(v)}function d(p){!c||!p.isPrimary||(c=!1,i.releasePointerCapture(p.pointerId),i.removeAttribute("data-swiping"),Math.abs(o)>=e?b(o>0?"right":"left"):y())}function u(p){!c||!p.isPrimary||(c=!1,i.releasePointerCapture(p.pointerId),i.removeAttribute("data-swiping"),y())}function b(p){let E=p==="right"?"100%":"-100%";i.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",i.style.transform=r?`translateX(${E})`:`translateY(${E})`,i.style.opacity="0",i.setAttribute("data-dismissed",""),Ut.dismiss(),i.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:p,distance:Math.abs(o)}})),n&&i.addEventListener("transitionend",()=>i.remove(),{once:!0})}function y(){i.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",i.style.transform="",i.style.opacity="",i.addEventListener("transitionend",()=>{i.style.transition=""},{once:!0})}return i.addEventListener("pointerdown",l),i.addEventListener("pointermove",h),i.addEventListener("pointerup",d),i.addEventListener("pointercancel",u),()=>{i.removeEventListener("pointerdown",l),i.removeEventListener("pointermove",h),i.removeEventListener("pointerup",d),i.removeEventListener("pointercancel",u)}}function ka(i,t,e={}){let s=e.threshold??70,n=e.maxPull??120,r=document.createElement("div");r.setAttribute("data-pull-indicator",""),r.setAttribute("aria-hidden","true");let a=document.createElement("div");a.setAttribute("data-pull-spinner",""),r.appendChild(a),i.prepend(r);let o=0,c=!1,l=!1;function h(E){!E.isPrimary||l||i.scrollTop<=0&&(o=E.clientY,c=!0)}function d(E){if(!c||!E.isPrimary||l)return;let v=E.clientY-o;if(v<=0){r.style.transform="",r.style.opacity="";return}let T=Math.min(v,n),q=T/s;r.style.transform=`translateY(${T}px)`,r.style.opacity=String(Math.min(q,1)),q>=1?r.setAttribute("data-pull-ready",""):r.removeAttribute("data-pull-ready")}function u(E){!c||!E.isPrimary||(c=!1,r.hasAttribute("data-pull-ready")&&!l?y():p())}function b(E){!c||!E.isPrimary||(c=!1,p())}async function y(){l=!0,r.removeAttribute("data-pull-ready"),r.setAttribute("data-pull-loading",""),r.style.transform=`translateY(${s}px)`,r.style.opacity="1";try{await t()}finally{l=!1,r.removeAttribute("data-pull-loading"),p()}}function p(){r.style.transition="transform 0.3s ease, opacity 0.3s ease",r.style.transform="",r.style.opacity="",r.removeAttribute("data-pull-ready"),r.addEventListener("transitionend",()=>{r.style.transition=""},{once:!0})}return i.addEventListener("pointerdown",h,{passive:!0}),i.addEventListener("pointermove",d,{passive:!0}),i.addEventListener("pointerup",u,{passive:!0}),i.addEventListener("pointercancel",b,{passive:!0}),()=>{i.removeEventListener("pointerdown",h),i.removeEventListener("pointermove",d),i.removeEventListener("pointerup",u),i.removeEventListener("pointercancel",b),r.remove()}}function rn(i,t,e={}){let s=e.duration??500,n=e.hapticFeedback??!0,r=e.blockContextMenu??!0,a=null;function o(h){h.isPrimary&&(a=setTimeout(()=>{n&&Ut.tap(),t(h),a=null},s))}function c(){a&&(clearTimeout(a),a=null)}function l(h){r&&h.preventDefault()}return i.addEventListener("pointerdown",o,{passive:!0}),i.addEventListener("pointermove",c,{passive:!0}),i.addEventListener("pointerup",c,{passive:!0}),i.addEventListener("pointercancel",c,{passive:!0}),i.addEventListener("contextmenu",l),()=>{c(),i.removeEventListener("pointerdown",o),i.removeEventListener("pointermove",c),i.removeEventListener("pointerup",c),i.removeEventListener("pointercancel",c),i.removeEventListener("contextmenu",l)}}function an(i,t={}){let e=t.threshold??80,s=0,n=0,r=!1;function a(u){if(!u.isPrimary||!i.open)return;let b=u.target;b.closest("a, button, input, select, textarea, [contenteditable]")&&!b.closest("header")||(r=!0,s=u.clientY,n=0,i.setPointerCapture(u.pointerId),i.style.transition="none")}function o(u){if(!r||!u.isPrimary)return;if(n=u.clientY-s,n<=0){i.style.transform="",i.style.opacity="";return}let y=1-Math.min(n/e,1)*.4;i.style.transform=`translateY(${n}px)`,i.style.opacity=String(y)}function c(u){!r||!u.isPrimary||(r=!1,i.releasePointerCapture(u.pointerId),n>=e?h():d())}function l(u){!r||!u.isPrimary||(r=!1,i.releasePointerCapture(u.pointerId),d())}function h(){i.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",i.style.transform="translateY(100%)",i.style.opacity="0",Ut.dismiss(),i.addEventListener("transitionend",()=>{i.style.transition="",i.style.transform="",i.style.opacity="",i.close("dismiss")},{once:!0})}function d(){i.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",i.style.transform="",i.style.opacity="",i.addEventListener("transitionend",()=>{i.style.transition=""},{once:!0})}return i.addEventListener("pointerdown",a),i.addEventListener("pointermove",o),i.addEventListener("pointerup",c),i.addEventListener("pointercancel",l),()=>{i.removeEventListener("pointerdown",a),i.removeEventListener("pointermove",o),i.removeEventListener("pointerup",c),i.removeEventListener("pointercancel",l)}}function on(i=document){let t=[];for(let e of i.querySelectorAll('[data-gesture="swipe"]'))t.push(sn(e));for(let e of i.querySelectorAll('[data-gesture="dismiss"]'))t.push(nn(e));for(let e of i.querySelectorAll('[data-gesture="long-press"]'))t.push(rn(e,()=>{e.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let e of i.querySelectorAll('dialog[data-gesture="dismiss-down"]'))t.push(an(e));return()=>t.forEach(e=>e())}var Ut,ln=D(()=>{Ut={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};on()});var Xt={};bt(Xt,{destroyStickyManager:()=>Ra,initStickyManager:()=>ti});function et(){let i=document.documentElement;if(!i.hasAttribute("data-sticky"))return;let t=document.querySelector("header");t&&!t.hasAttribute("data-sticky")&&(t.dataset.sticky="",Qe=!0);let e=document.querySelector("header[data-sticky]"),s=e?e.getBoundingClientRect().height:0;i.style.setProperty("--sticky-offset",`${s}px`)}function En(){et()}function ti(){if(Kt)return;Kt=!0,et(),requestAnimationFrame(et),document.fonts?.ready?.then(et),window.addEventListener("resize",et,{passive:!0}),document.addEventListener("toggle",En,!0),Ze=new ResizeObserver(et);let i=document.querySelector("header[data-sticky]");i&&Ze.observe(i)}function Ra(){if(Kt){if(Kt=!1,window.removeEventListener("resize",et),document.removeEventListener("toggle",En,!0),Ze?.disconnect(),Qe){let i=document.querySelector("header[data-sticky]");i&&delete i.dataset.sticky,Qe=!1}document.documentElement.style.removeProperty("--sticky-offset")}}var Kt,Ze,Qe,kt=D(()=>{Kt=!1,Qe=!1});var Sn={};bt(Sn,{SoundManager:()=>Ha});var An,ei,Ha,Cn=D(()=>{An="vb-sound",ei={enabled:!1,volume:.5},Ha={_ctx:null,_enabled:!1,_volume:.5,_initialized:!1,init(){if(this._initialized)return this;let i=this._load();return this._enabled=i.enabled,this._volume=i.volume,this._initialized=!0,this},_getContext(){return this._ctx||(this._ctx=new(window.AudioContext||window.webkitAudioContext)),this._ctx.state==="suspended"&&this._ctx.resume(),this._ctx},_load(){try{let i=localStorage.getItem(An);return i?{...ei,...JSON.parse(i)}:{...ei}}catch{return{...ei}}},_save(i){try{let t=this._load();localStorage.setItem(An,JSON.stringify({...t,...i}))}catch{}},_playTone(i,t,e="sine"){if(!this._enabled)return;let s=this._getContext(),n=s.createOscillator(),r=s.createGain();n.connect(r),r.connect(s.destination),n.frequency.value=i,n.type=e,r.gain.value=this._volume*.3,n.start(),r.gain.exponentialRampToValueAtTime(.01,s.currentTime+t),n.stop(s.currentTime+t)},enable(){this._enabled=!0,this._save({enabled:!0}),this.play("click")},disable(){this._enabled=!1,this._save({enabled:!1})},toggle(){return this._enabled?this.disable():this.enable(),this._enabled},isEnabled(){return this._enabled},setVolume(i){this._volume=Math.max(0,Math.min(1,i)),this._save({volume:this._volume})},getVolume(){return this._volume},play(i){if(this._enabled)switch(i){case"click":this._playTone(800,.1);break;case"success":this._playTone(523,.1),setTimeout(()=>this._playTone(659,.1),100),setTimeout(()=>this._playTone(784,.15),200);break;case"error":this._playTone(200,.15,"sawtooth"),setTimeout(()=>this._playTone(180,.2,"sawtooth"),150);break;case"notification":this._playTone(880,.1),setTimeout(()=>this._playTone(1100,.15),100);break;case"soft":this._playTone(600,.05);break;case"tick":this._playTone(1200,.02,"square");break}},getState(){return{enabled:this._enabled,volume:this._volume}}}});function Va(i,t){if(!t)return i;let e=i??new URLSearchParams;for(let[s,n]of Object.entries(t))n!=null&&e.set(s,String(n));return e}async function za(i){if((i.headers.get("content-type")??"").includes("application/json"))try{return await i.json()}catch{return null}try{return await i.text()}catch{return null}}function kn(i){return i.endsWith("/")?i.slice(0,-1):i}var R,z,it,si=D(()=>{R={baseUrl:"/go",headers:{},services:{}},z=class extends Error{constructor(t,e,s,n){super(`VBService(${s}): ${t} ${n}`),this.name="VBServiceError",this.status=t,this.body=e,this.role=s,this.path=n}};it=class i{static configure(t={}){R={baseUrl:t.baseUrl??R.baseUrl,headers:{...R.headers,...t.headers??{}},services:{...R.services,...t.services??{}}}}static resolve(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");return R.services[t]?kn(R.services[t]):R.baseUrl?`${kn(R.baseUrl)}/${t}`:`/go/${t}`}static _reset(){R={baseUrl:"/go",headers:{},services:{}}}constructor(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");this.role=t}async get(t,e){return this.#e("GET",t,{params:e})}async post(t,e){return this.#e("POST",t,{body:e})}async patch(t,e){return this.#e("PATCH",t,{body:e})}async delete(t){return this.#e("DELETE",t,{})}async#e(t,e,s){let n=i.resolve(this.role),r=e?e.startsWith("/")?e:`/${e}`:"",a=new URL(`${n}${r}`,globalThis.location?.origin??"http://localhost"),o=Va(a.searchParams,s.params);o&&(a.search=o.toString());let c={method:t,headers:{...R.headers}};s.body!==void 0&&(c.body=JSON.stringify(s.body),c.headers["content-type"]="application/json");let l=a.toString(),h=await fetch(l,c),d=await za(h);if(!h.ok)throw new z(h.status,d,this.role,`${r||"/"}`);return d}}});function Zt(i){let t=2166136261;for(let e=0;e<i.length;e++)t^=i.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Ya(){return"hn-"+crypto.randomUUID().slice(0,8)}function Nn(i,t){return getComputedStyle(i).getPropertyValue(`--highlight-${t}`).trim()}function Ga(i){if(rt){Tt++;return}rt=new CSSStyleSheet;let t=i.map(e=>`::highlight(hn-${e}) { background-color: var(--highlight-${e}); text-decoration-line: underline; text-decoration-color: var(--highlight-${e}); text-underline-offset: 2px; }`).join(`
|
|
2
|
-
`);rt.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,rt],Tt=1}function Ka(){Tt--,Tt<=0&&rt&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(i=>i!==rt),rt=null,Tt=0)}function Xa(){return C||(C=document.createElement("div"),C.className="hn-toolbar",C.setAttribute("role","toolbar"),C.setAttribute("aria-label","Highlight tools"),C.setAttribute("popover","auto"),C.hidden=!0,document.body.appendChild(C),C.addEventListener("toggle",i=>{i.newState==="closed"&&(C.hidden=!0,Qt=null)}),C)}function ai(i,t,e){let s=Xa();s.innerHTML="",Qt=t;let n=t.colors,r=t.element,a=e?.color,o=document.createElement("div");if(o.className="hn-swatches",o.setAttribute("role","group"),o.setAttribute("aria-label","Highlight colors"),n.forEach((c,l)=>{let h=document.createElement("button");h.type="button",h.className="hn-swatch",h.dataset.color=c,h.setAttribute("aria-label",`Highlight ${c}${a===c?" (current)":""}`),h.setAttribute("tabindex",l===0?"0":"-1");let d=Nn(r,c);d&&(h.style.backgroundColor=d),a===c&&h.setAttribute("aria-pressed","true"),h.addEventListener("click",()=>{e?t._changeColor(e.id,c):t._createFromSelection(c),xt()}),o.appendChild(h)}),s.appendChild(o),e){let c=document.createElement("span");c.className="hn-separator",c.setAttribute("aria-hidden","true"),s.appendChild(c);let l=document.createElement("button");l.type="button",l.className="hn-action",l.textContent=e.note?"Edit Note":"Add Note",l.addEventListener("click",()=>{Dn(t,e),xt()}),s.appendChild(l);let h=document.createElement("button");h.type="button",h.className="hn-action hn-action-remove",h.textContent="Remove",h.addEventListener("click",()=>{t.removeHighlight(e.id),xt()}),s.appendChild(h)}o.addEventListener("keydown",c=>{let l=[...o.querySelectorAll("button")],h=l.indexOf(document.activeElement);if(h<0)return;let d=-1;if(c.key==="ArrowRight"||c.key==="ArrowDown")c.preventDefault(),d=(h+1)%l.length;else if(c.key==="ArrowLeft"||c.key==="ArrowUp")c.preventDefault(),d=(h-1+l.length)%l.length;else if(c.key==="Escape"){xt();return}d>=0&&(l[h].setAttribute("tabindex","-1"),l[d].setAttribute("tabindex","0"),l[d].focus())}),s.hidden=!1;try{s.showPopover()}catch{}Ja(i),requestAnimationFrame(()=>{let c=s.querySelector(".hn-swatch");c&&c.focus()})}function Dn(i,t){nt();let e=i.element,s=st(e,t.startOffset,t.endOffset);if(!s)return;M=document.createElement("div"),M.className="hn-note-panel",M.setAttribute("role","dialog"),M.setAttribute("aria-label","Private note");let n=document.createElement("header");n.className="hn-note-header",n.innerHTML="<small>PRIVATE NOTE</small>",M.appendChild(n);let r=document.createElement("blockquote");r.className="hn-note-quote",r.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,M.appendChild(r);let a=document.createElement("textarea");a.className="hn-note-textarea",a.placeholder="Add a note\u2026",a.value=t.note||"",a.rows=3,a.setAttribute("aria-label","Note for highlighted text"),M.appendChild(a);let o=document.createElement("footer");o.className="hn-note-actions";let c=document.createElement("button");c.type="button",c.className="hn-action hn-action-save",c.textContent="Save",c.addEventListener("click",()=>{i._updateNote(t.id,a.value.trim()),nt()});let l=document.createElement("button");l.type="button",l.className="hn-action",l.textContent="Cancel",l.addEventListener("click",()=>nt()),o.append(c,l),M.appendChild(o),a.addEventListener("keydown",u=>{u.key==="Escape"&&(u.preventDefault(),nt()),u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),i._updateNote(t.id,a.value.trim()),nt())}),e.style.position="relative",e.appendChild(M);let h=s.getClientRects()[0],d=e.getBoundingClientRect();if(h){let u=h.top-d.top;M.style.top=`${u}px`}requestAnimationFrame(()=>{a.focus(),document.addEventListener("pointerdown",_n)})}function _n(i){M&&!M.contains(i.target)&&nt()}function nt(){M&&(document.removeEventListener("pointerdown",_n),M.remove(),M=null)}function Ja(i){C&&requestAnimationFrame(()=>{let t=C.getBoundingClientRect(),e=t.width||200,s=t.height||40,n=i.top-s-Tn,r=i.left+i.width/2-e/2;n<ri&&(n=i.bottom+Tn);let a=window.innerWidth-e-ri;r=Math.max(ri,Math.min(r,a)),C.style.top=`${n}px`,C.style.left=`${r}px`})}function xt(){if(C){try{C.hidePopover()}catch{}C.hidden=!0,Qt=null}}function oi(i){K||(K=document.createElement("div"),K.setAttribute("aria-live","polite"),K.setAttribute("aria-atomic","true"),K.className="hn-sr-only",document.body.appendChild(K)),K.textContent="",requestAnimationFrame(()=>{K.textContent=i})}function Ln(i,t,e){let s=document.createTreeWalker(i,NodeFilter.SHOW_TEXT),n=0;for(;s.nextNode();){if(s.currentNode===t)return n+e;n+=(s.currentNode.textContent??"").length}return-1}function st(i,t,e){let s=document.createTreeWalker(i,NodeFilter.SHOW_TEXT),n=0,r=null,a=0,o=null,c=0;for(;s.nextNode();){let l=s.currentNode,h=(l.textContent??"").length;if(!r&&n+h>t&&(r=l,a=t-n),n+h>=e){o=l,c=e-n;break}n+=h}if(!r||!o)return null;try{let l=document.createRange();return l.setStart(r,Math.min(a,(r.textContent??"").length)),l.setEnd(o,Math.min(c,(o.textContent??"").length)),l}catch{return null}}function di(i){if(ci.has(i))return ci.get(i);let t=new hi(i);return ci.set(i,t),t}function Mn(i=document){i.querySelectorAll(li).forEach(t=>{t.hasAttribute("data-highlights-init")||di(t)})}var li,xn,Wa,Tn,ri,ja,rt,Tt,C,Qt,M,K,hi,ci,Za,qn=D(()=>{W();li="[data-highlights]",xn="highlights",Wa=["yellow","green","blue","pink"],Tn=8,ri=8,ja=typeof CSS<"u"&&"highlights"in CSS;rt=null,Tt=0;C=null,Qt=null;M=null;K=null;hi=class{#e;#t;#i;#n;#s=[];#r=!ja;#a;#c;#o=!1;#p=[];constructor(t){this.#e=t,this.#n=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#t=e&&e!==""?e:location.pathname;let s=t.dataset.highlightsColors;this.#i=s?s.split(",").map(n=>n.trim()).filter(Boolean):[...Wa],this.#r||Ga(this.#i),this.#m(),this.#n||(this.#a=this.#h.bind(this),this.#c=this.#f.bind(this),t.addEventListener("pointerup",this.#a),t.addEventListener("click",this.#c)),t.setAttribute("data-highlights-init",""),this.#l().then(()=>{this.#o||this.#m()})}get colors(){return[...this.#i]}get element(){return this.#e}getHighlights(){return this.#s.map(t=>({...t}))}removeHighlight(t){let e=this.#s.findIndex(s=>s.id===t);e<0||(this.#s.splice(e,1),this.#u(),this.#m(),this.#y("highlights:removed",{id:t}),oi("Highlight removed"))}clearAll(){this.#s=[],this.#u(),this.#m()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#s})}importHighlights(t){try{let e=typeof t=="string"?JSON.parse(t):t;if(!e.highlights||!Array.isArray(e.highlights))return;this.#s=e.highlights,this.#u(),this.#m()}catch{}}destroy(){if(!this.#o){if(this.#o=!0,this.#a&&this.#e.removeEventListener("pointerup",this.#a),this.#c&&this.#e.removeEventListener("click",this.#c),this.#r)this.#e.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()});else{for(let t of this.#i)CSS.highlights.delete(`hn-${t}`);Ka()}this.#A(),this.#e.removeAttribute("data-highlights-init"),Qt===this&&xt(),nt()}}#h(){requestAnimationFrame(()=>{if(this.#o||this.#e.hasAttribute("data-selection-menu"))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);if(!this.#e.contains(e.commonAncestorContainer))return;let s=e.getBoundingClientRect();ai(s,this,null)})}#f(t){if(this.#e.hasAttribute("data-selection-menu"))return;let e=t.target.closest?.(".hn-margin-annotation");if(e){let n=e.dataset.hnId,r=this.#s.find(a=>a.id===n);if(r){Dn(this,r);return}}let s=t.target.closest?.("mark[data-hn-id]");if(s){let n=s.dataset.hnId,r=this.#s.find(a=>a.id===n);if(r){this.#y("highlights:clicked",{id:n});let a=s.getBoundingClientRect();ai(a,this,r);return}}if(!this.#r){let n=this.#d(t.clientX,t.clientY);if(n){this.#y("highlights:clicked",{id:n.id});let r=st(this.#e,n.startOffset,n.endOffset);r&&ai(r.getBoundingClientRect(),this,n)}}}#d(t,e){for(let s of this.#s){let n=st(this.#e,s.startOffset,s.endOffset);if(!n)continue;let r=n.getClientRects();for(let a of r)if(t>=a.left&&t<=a.right&&e>=a.top&&e<=a.bottom)return s}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let s=e.getRangeAt(0);if(!this.#e.contains(s.commonAncestorContainer))return;let n=Ln(this.#e,s.startContainer,s.startOffset),r=Ln(this.#e,s.endContainer,s.endOffset);if(n<0||r<0||n>=r)return;let a=e.toString().trim(),o={id:Ya(),startOffset:n,endOffset:r,text:a,color:t,note:"",created:Date.now()};this.#s.push(o),this.#u(),this.#m(),e.removeAllRanges(),this.#y("highlights:added",{id:o.id,text:a,color:t,note:""}),oi("Highlight added")}_changeColor(t,e){let s=this.#s.find(n=>n.id===t);s&&(s.color=e,this.#u(),this.#m())}_updateNote(t,e){let s=this.#s.find(n=>n.id===t);s&&(s.note=e,this.#u(),this.#b(),this.#y("highlights:note-changed",{id:t,note:e}),oi("Note saved"))}async#l(){let t=await w.get(xn,this.#t);if(!t||!Array.isArray(t.highlights))return;let e=Zt(this.#e.textContent);t.contentHash&&t.contentHash!==e?(this.#s=t.highlights.filter(s=>{let n=st(this.#e,s.startOffset,s.endOffset);return n?n.toString().trim()===s.text:!1}),this.#u()):this.#s=t.highlights}#u(){let t={version:1,contentHash:Zt(this.#e.textContent),highlights:this.#s};w.set(xn,this.#t,t).catch(()=>{})}#m(){this.#r?this.#v():this.#g(),this.#b()}#g(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#s){let s=st(this.#e,e.startOffset,e.endOffset);s&&t.has(e.color)&&t.get(e.color).push(s)}for(let[e,s]of t){let n=`hn-${e}`;s.length===0?CSS.highlights.delete(n):CSS.highlights.set(n,new Highlight(...s))}}#v(){this.#e.querySelectorAll("mark[data-hn-id]").forEach(e=>{let s=e.parentNode;for(;e.firstChild;)s.insertBefore(e.firstChild,e);s.removeChild(e)}),this.#e.normalize();let t=[...this.#s].sort((e,s)=>s.startOffset-e.startOffset);for(let e of t){let s=st(this.#e,e.startOffset,e.endOffset);if(!s)continue;let n=Nn(this.#e,e.color),r=document.createElement("mark");r.dataset.hnId=e.id,r.dataset.hnColor=e.color,n&&(r.style.backgroundColor=n,r.style.textDecorationColor=n);try{s.surroundContents(r)}catch{let a=s.extractContents();r.appendChild(a),s.insertNode(r)}}}#A(){for(let t of this.#p)t.remove();this.#p=[]}#b(){if(this.#A(),this.#s.length===0)return;getComputedStyle(this.#e).position==="static"&&(this.#e.style.position="relative");for(let e of this.#s){let s=st(this.#e,e.startOffset,e.endOffset);if(!s)continue;let n=s.getClientRects();if(n.length===0)continue;let r=n[0],a=this.#e.getBoundingClientRect(),o=r.top-a.top,c=document.createElement("span");c.className="hn-margin-annotation",c.dataset.hnId=e.id,c.setAttribute("aria-hidden","true"),c.style.top=`${o}px`,e.note?(c.innerHTML='<span class="hn-note-indicator">*</span> You highlighted',c.classList.add("hn-has-note")):c.textContent="You highlighted",this.#e.appendChild(c),this.#p.push(c)}}#y(t,e={}){this.#e.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}},ci=new WeakMap;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Mn()):Mn();Za=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(li)&&di(s),s.querySelectorAll(li).forEach(n=>{n.hasAttribute("data-highlights-init")||di(n)})}});Za.observe(document.documentElement,{childList:!0,subtree:!0})});var yi={};bt(yi,{currentHash:()=>gi,initPageWatch:()=>mi,readWatch:()=>te,removeWatch:()=>In,writeWatch:()=>Lt});function $n(){return typeof window<"u"&&window.vbPageWatch?.serverSync===!0?!0:document.querySelector('meta[name="vb-page-watch-server"]')?.getAttribute("content")==="true"}async function Qa(i){if(!$n())return null;try{let t=new it("notify"),e={url:i.url,type:"page-watch",notify:["panel"]},s=await t.post("/subscribe",e);return typeof s?.id=="string"?s.id:null}catch(t){let e=t instanceof z?`${t.status}`:String(t);return console.warn("[page-watch] server subscribe failed; client-only watch in effect.",e),null}}async function to(i){if(!(!i||!$n()))try{await new it("notify").delete(`/subscribe/${encodeURIComponent(i)}`)}catch(t){let e=t instanceof z?`${t.status}`:String(t);console.warn("[page-watch] server unsubscribe failed; local state already cleared.",e)}}function eo(){return document.querySelector("main")||document.querySelector("article")||document.body}function Mt(){return location.pathname||"/"}function gi(){let i=eo();return i?Zt(i.textContent||""):""}function io(){return document.title||Mt()}async function te(){return await w.get(bi,Mt())}async function Lt(i){await w.set(bi,Mt(),i)}async function In(){await w.remove(bi,Mt())}function ui(i,t){i.setAttribute("aria-pressed",t?"true":"false"),i.dataset.watching="",t||delete i.dataset.watching;let e=i.querySelector("icon-wc");e&&e.setAttribute("name",t?"bookmark-check":"bookmark");let s=[...i.childNodes].find(n=>n.nodeType===Node.TEXT_NODE&&(n.textContent||"").trim());s&&!i.hasAttribute("data-watch-label-locked")&&(s.textContent=t?"Watching":"Watch for updates"),i.setAttribute("title",t?"Stop watching this page":"Watch this page for content updates")}async function fi(i){if(i.hasAttribute("data-watch-page-init"))return;i.setAttribute("data-watch-page-init",""),i.setAttribute("type",i.getAttribute("type")||"button");let t=await te();ui(i,!!t),i.addEventListener("click",async e=>{e.preventDefault();let s=await te();if(s)await In(),ui(i,!1),i.dispatchEvent(new CustomEvent("page-watch:remove",{bubbles:!0,composed:!0,detail:{url:s.url,subscriptionId:s.subscriptionId}})),to(s.subscriptionId);else{let n={url:Mt(),title:io(),contentHash:gi(),watchedAt:new Date().toISOString(),lastChecked:new Date().toISOString(),lastChanged:null,subscriptionId:null};await Lt(n),ui(i,!0),i.dispatchEvent(new CustomEvent("page-watch:add",{bubbles:!0,composed:!0,detail:{entry:n}}));let r=await Qa(n);r&&await Lt({...n,subscriptionId:r})}})}async function so(){let i=await te();if(!i)return;let t=gi(),e=new Date().toISOString(),s=i.contentHash,n={...i,lastChecked:e};if(t&&t!==s){n.contentHash=t,n.lastChanged=e,await Lt(n);let r={id:`page-watch:${i.url}:${t}`,type:"watch",title:`Updated: ${i.title}`,body:"Content changed since your last visit.",url:i.url,date:e,read:!1,dismissed:!1,priority:"normal"};document.dispatchEvent(new CustomEvent("notification-wc:new",{bubbles:!0,composed:!0,detail:{notification:r}}))}else await Lt(n)}function mi(i=document){for(let t of i.querySelectorAll(pi))fi(t);so()}var pi,bi,no,vi=D(()=>{W();si();qn();pi="[data-watch-page]",bi="watches";document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>mi()):mi();no=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches?.(pi)&&fi(s),s.querySelectorAll?.(pi).forEach(n=>fi(n))}});no.observe(document.documentElement,{childList:!0,subtree:!0})});function pe(i){try{if(sessionStorage.getItem("vb_optout")==="1")return!0}catch{}if(navigator.globalPrivacyControl===!0||navigator.doNotTrack==="1")return!0;if(typeof i.consent=="function")try{return i.consent()===!1}catch{return!0}return!1}function qr(i){return i?.closest?.("[data-vb-no-track]")!=null}function Rc(){let{dataset:i}=document.documentElement,t={};for(let e of Object.keys(i)){let s=i[e];s!=null&&s!==""&&(t[e]=s)}return t}function Hc(){let i={};for(let t of document.querySelectorAll('meta[name^="vb:"]')){let e=t.getAttribute("name").slice(3),s=t.getAttribute("content")?.trim();e&&s&&(i[e]=s)}return i}function Vc(i,t){if(!t?.length)return i;for(let{pattern:e,replace:s}of t)if(e.test(i))return i.replace(e,s);return i}function zc(i,t){let e=JSON.stringify(t);if(typeof navigator.sendBeacon=="function"){let s=new Blob([e],{type:"application/json"});if(navigator.sendBeacon(i,s))return!0}try{return fetch(i,{method:"POST",body:e,keepalive:!0,headers:{"content-type":"application/json"}}),!0}catch{return!1}}function $r(i){return`${(A.config?.endpoint??"/api/analytics").replace(/\/+$/,"")}/${i}`}function bs(i,t){let e=A.config,s=Vc(location.pathname+location.search,e.urlMasks),n=typeof e.context=="function"?e.context()??{}:{};return{name:i,ts:Date.now(),site:e.siteId,path:s,referrer:document.referrer||"",context:{...Rc(),...Hc(),...n},props:t??{}}}function fe(i,t){let e=A.config;return!e||e.transport==="disabled"?!1:e.transport==="console"?(console.log("%c[vb:analytics]","color:#0aa;font-weight:600",i,t),!0):zc($r(i),t)}function Ir(){let i=A.config?.sampleRate??1;return i>=1?!0:Math.random()<i}function Or(){if(!A.config||pe(A.config)||document.documentElement.hasAttribute("data-vb-no-track")||!Ir())return;let i=location.pathname+location.search;i!==Dr&&(Dr=i,fe("hit",bs("page.view",{})))}function Uc(){let i,t=()=>{clearTimeout(i),i=setTimeout(Or,100)},e=history.pushState.bind(history);history.pushState=function(...n){e(...n),t()};let s=history.replaceState.bind(history);history.replaceState=function(...n){s(...n),t()},window.addEventListener("popstate",t)}function Wc(i){let t={};for(let[e,s]of Object.entries(i.dataset)){if(e==="vbEvent"||!e.startsWith("vbEvent"))continue;let n=e.slice(7).replace(/^./,r=>r.toLowerCase());t[n]=s}return t}function jc(i){if(!A.config||pe(A.config))return;let t=i.target.closest?.("[data-vb-event]");if(!t||qr(t))return;let e=t.dataset.vbEvent;e&&g.track(e,Wc(t))}function _r(){let i=document.querySelectorAll('a[href^="http"]');for(let t of i){if(t.hostname===location.hostname||qr(t)||t.hasAttribute("data-vb-analytics-wired"))continue;let e=encodeURIComponent(A.config?.siteId??"default"),s=`${$r("click")}?site=${e}&from=${encodeURIComponent(location.pathname)}`;t.hasAttribute("ping")||t.setAttribute("ping",s),t.addEventListener("click",()=>{if(pe(A.config))return;let n=navigator.userAgent;/Firefox|Brave/.test(n)&&fe("click",bs("link.outbound",{to:t.hostname,href:t.href}))}),t.setAttribute("data-vb-analytics-wired","")}}function ms(){if(!A.queue.length)return;let i=A.queue.splice(0);fe("events",{site:A.config?.siteId,events:i})}function Yc(){document.visibilityState==="hidden"&&ms()}function Kc(){try{return window.top!==window.self}catch{return!0}}var A,Dr,Gc,g,ot=D(()=>{A={config:null,queue:[]};Dr=null;Gc={endpoint:"/api/analytics",siteId:"default",transport:"disabled",sampleRate:1,consent:null,context:null,urlMasks:null,autoPageView:!0,autoOutboundLinks:!0,autoDeclarative:!0,allowInIframe:!1};g={init(i={}){if(!A.config){if(A.config={...Gc,...i},Kc()&&!A.config.allowInIframe){A.config.transport="disabled",A.config.autoPageView=!1,A.config.autoOutboundLinks=!1,A.config.autoDeclarative=!1;return}A.config.transport==="disabled"&&(A.config.autoOutboundLinks=!1),A.config.autoDeclarative&&document.addEventListener("click",jc,{capture:!0}),A.config.autoOutboundLinks&&(_r(),new MutationObserver(()=>_r()).observe(document.body,{childList:!0,subtree:!0})),A.config.autoPageView&&(Or(),Uc()),document.addEventListener("visibilitychange",Yc),window.addEventListener("pagehide",ms)}},track(i,t={}){A.config&&(pe(A.config)||Ir()&&fe("hit",bs(i,t)))},flush:ms,setConsent(i){try{i?sessionStorage.removeItem("vb_optout"):sessionStorage.setItem("vb_optout","1")}catch{}},get config(){return A.config?{...A.config}:null}}});var sl={};function Qc(i,t,e){return i<=t?"good":i<=e?"needs-improvement":"poor"}function me(i,t,e,s,n={}){g.track(i,{value:Math.round(t*1e3)/1e3,rating:Qc(t,e,s),...n})}function tl(){let i=null,t=new PerformanceObserver(s=>{let n=s.getEntries();i=n[n.length-1]});try{t.observe({type:"largest-contentful-paint",buffered:!0})}catch{return}let e=()=>{i&&(me("perf.lcp",i.startTime,2500,4e3),i=null)};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()}),window.addEventListener("pagehide",e)}function el(){let i=0,t=new PerformanceObserver(s=>{for(let n of s.getEntries())n.hadRecentInput||(i+=n.value)});try{t.observe({type:"layout-shift",buffered:!0})}catch{return}let e=()=>{me("perf.cls",i,.1,.25),i=0};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()}),window.addEventListener("pagehide",e)}function il(){let i=0,t=new PerformanceObserver(s=>{for(let n of s.getEntries())n.duration>i&&(i=n.duration)});try{t.observe({type:"event",durationThreshold:40,buffered:!0})}catch{return}let e=()=>{i!==0&&(me("perf.inp",i,200,500),i=0)};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()}),window.addEventListener("pagehide",e)}function Rr(){try{let[i]=performance.getEntriesByType("navigation");if(!i||!i.responseStart)return;me("perf.ttfb",i.responseStart,800,1800,{navigationType:i.type})}catch{}}var Hr=D(()=>{ot();typeof window<"u"&&"PerformanceObserver"in window&&(tl(),el(),il(),document.readyState==="complete"?Rr():window.addEventListener("load",Rr,{once:!0}))});var rl={};function nl(i){if(typeof i!="string"||!i)return"";try{let t=new URL(i,location.origin);return t.pathname.split("/").pop()||t.pathname}catch{return i.split("/").pop()??i}}function Vr(i){return typeof i!="string"?String(i??"").slice(0,ys):i.length>ys?i.slice(0,ys):i}var ys,zr=D(()=>{ot();ys=200;typeof window<"u"&&(window.addEventListener("error",i=>{i.target&&i.target!==window||g.track("error.js_runtime",{message:Vr(i.message),source:nl(i.filename),line:i.lineno??0,col:i.colno??0})}),window.addEventListener("unhandledrejection",i=>{let t=i.reason,e=t instanceof Error?t.message:typeof t=="string"?t:JSON.stringify(t??null);g.track("error.unhandled_promise",{message:Vr(e)})}))});var ol={};function Gr(){let i=window.scrollY+window.innerHeight,t=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0);return t<=0?0:Math.min(100,Math.max(0,Math.round(i/t*100)))}function al(){clearTimeout(Wr),Wr=setTimeout(()=>{let i=Gr();i>vs&&(vs=i)},500)}function jr(){Ot==null&&(Ot=Date.now())}function Kr(){Ot!=null&&(ws+=Date.now()-Ot,Ot=null)}function Yr(){if(Ur)return;Ur=!0,Kr();let i=Math.max(vs,Gr());i>0&&g.track("__scroll",{depth:i}),ws>0&&g.track("__attention",{ms:ws})}var vs,Ot,ws,Ur,Wr,Xr=D(()=>{ot();vs=0,Ot=null,ws=0,Ur=!1,Wr=null;typeof window<"u"&&(window.addEventListener("scroll",al,{passive:!0}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?jr():(Kr(),Yr())}),window.addEventListener("pagehide",Yr),document.visibilityState==="visible"&&jr())});var Zr={};bt(Zr,{WizardController:()=>be,initWizards:()=>As});function Es(i){if(i.hasAttribute("data-wizard-enhanced"))return;let t=new be(i);i.wizardController=t,i.wizardGoTo=e=>t.goTo(e),i.wizardNext=()=>t.next(),i.wizardPrev=()=>t.prev(),i.wizardReset=()=>t.reset()}function As(){document.querySelectorAll("form[data-wizard]").forEach(i=>{Es(i)})}function Jr(){new MutationObserver(t=>{for(let e of t)for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.matches("form[data-wizard]")&&Es(n),n.querySelectorAll?.("form[data-wizard]:not([data-wizard-enhanced])").forEach(r=>{Es(r)})}}).observe(document.documentElement,{childList:!0,subtree:!0})}var be,Qr=D(()=>{be=class{#e;#t=[];#i=0;#n=null;#s=null;#r=null;#a=!1;#c="step";#o=null;#p="";#h=0;#f=0;constructor(t){if(!t||!(t instanceof HTMLFormElement))throw new Error("WizardController requires a form element");this.#e=t,this.#d()}#d(){if(this.#t=Array.from(this.#e.querySelectorAll("fieldset[data-wizard-step]")),this.#t.length===0){console.warn("Wizard form has no steps");return}this.#a=this.#e.hasAttribute("data-wizard-history"),this.#c=this.#e.getAttribute("data-wizard-validate")||"step",this.#l(),this.#n=this.#e.querySelector("[data-wizard-progress]"),this.#y(),this.#w(),this.#b(),this.#e.setAttribute("data-wizard-enhanced",""),this.#e.setAttribute("data-wizard-total",String(this.#t.length)),this.#$(),this.#S(),this.#D();let t=()=>{cancelAnimationFrame(this.#h),this.#h=requestAnimationFrame(()=>this.#M())};if(this.#e.addEventListener("change",t),this.#e.addEventListener("input",t),this.#o&&(this.#e.addEventListener("change",()=>this.#m()),this.#e.addEventListener("input",()=>this.#m())),this.#e.addEventListener("submit",e=>this.#A(e)),this.#e.addEventListener("reset",()=>{requestAnimationFrame(()=>this.reset())}),this.#a){let e=this.#q();e!==null&&e>=0&&e<this.#t.length&&(this.#i=e),window.addEventListener("hashchange",()=>{let s=this.#q();s!==null&&s!==this.#i&&this.goTo(s)})}this.#g(),this.#M(),this.#_()}#l(){let t=this.#e.getAttribute("data-wizard-persist");if(t){if(!this.#e.id){console.warn("Wizard persistence requires an id on the form element");return}this.#p=`vb-wizard:${this.#e.id}`,t==="local"?this.#o=localStorage:this.#o=sessionStorage}}#u(){if(!this.#o)return;let t={},e=new FormData(this.#e);for(let[s,n]of e.entries())t[s]!==void 0?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(n)):t[s]=n;try{this.#o.setItem(this.#p,JSON.stringify({step:this.#i,data:t}))}catch{}}#m(){this.#o&&(cancelAnimationFrame(this.#f),this.#f=requestAnimationFrame(()=>this.#u()))}#g(){if(this.#o)try{let t=this.#o.getItem(this.#p);if(!t)return;let e=JSON.parse(t);if(!e||typeof e!="object")return;if(e.data&&typeof e.data=="object")for(let[s,n]of Object.entries(e.data)){let r=this.#e.elements.namedItem(s);if(r)if(r instanceof RadioNodeList)r.value=n;else if(r instanceof HTMLInputElement)if(r.type==="checkbox"){let a=Array.isArray(n)?n:[n];r.checked=a.includes(r.value||"on")}else r.type==="radio"?r.checked=r.value===n:r.value=n;else(r instanceof HTMLSelectElement||r instanceof HTMLTextAreaElement)&&(r.value=n)}typeof e.step=="number"&&e.step>=0&&e.step<this.#t.length&&(this.#i=e.step)}catch{}}#v(){this.#o&&this.#o.removeItem(this.#p)}#A(t){let e=this.#k();this.#i===e.length-1&&(this.#z("wizard:complete"),this.#v())}#b(){this.#s=document.createElement("div"),this.#s.setAttribute("role","status"),this.#s.setAttribute("aria-live","polite"),this.#s.setAttribute("aria-atomic","true"),this.#s.setAttribute("data-wizard-status",""),this.#e.prepend(this.#s)}#y(){let t=this.#e.getAttribute("data-wizard-steps");if(t){this.#r=document.querySelector(t);return}this.#r=this.#e.querySelector("nav.steps")}#w(){if(!this.#r)return;let t=this.#r.querySelector("ol");if(!(!t||t.children.length>0))for(let e of this.#t){let s=e.querySelector("legend"),n=document.createElement("li");n.textContent=s?.textContent||`Step ${this.#t.indexOf(e)+1}`,t.appendChild(n)}}#B(){if(!this.#r)return;let t=Array.from(this.#r.querySelectorAll("ol > li")),e=this.#k(),s=0;for(let n=0;n<this.#t.length;n++){let r=this.#t[n],a=t[s];if(!a)break;if(r.hasAttribute("data-wizard-hidden")){a.setAttribute("hidden","");continue}else a.removeAttribute("hidden");let o=e.indexOf(r);if(a.removeAttribute("data-completed"),a.removeAttribute("aria-current"),a.removeAttribute("aria-disabled"),o<this.#i){a.setAttribute("data-completed",""),this.#N(a,o);let c=a.querySelector("a");if(c){let h=r.querySelector("legend")?.textContent||`Step ${o+1}`;c.setAttribute("aria-label",`Go to ${h} (completed)`)}}else o===this.#i?a.setAttribute("aria-current","step"):a.setAttribute("aria-disabled","true");s++}for(let n of t){if(n.hasAttribute("hidden"))continue;let r=n.querySelector("a, button")||n,a=n.hasAttribute("aria-current");r.setAttribute("tabindex",a?"0":"-1")}}#N(t,e){if(t.hasAttribute("data-wizard-nav-bound"))return;t.setAttribute("data-wizard-nav-bound","");let s=t.querySelector("a, button")||t;s.addEventListener("click",n=>{n.preventDefault(),this.goTo(e)}),s===t&&!t.getAttribute("tabindex")&&(t.setAttribute("tabindex","0"),t.setAttribute("role","button"),t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this.goTo(e))}))}#S(){let t=this.#e.querySelector("[data-wizard-prev]"),e=this.#e.querySelector("[data-wizard-next]");t?.addEventListener("click",s=>{s.preventDefault(),this.prev()}),e?.addEventListener("click",s=>{s.preventDefault(),this.next()})}#$(){if(this.#e.querySelector("[data-wizard-nav]"))return;let t=document.createElement("nav");t.setAttribute("data-wizard-nav","");let e=document.createElement("button");e.type="button",e.setAttribute("data-wizard-prev",""),e.textContent="Back";let s=document.createElement("button");s.type="button",s.setAttribute("data-wizard-next",""),s.textContent="Next";let n=document.createElement("button");n.type="submit",n.textContent="Submit",t.append(e,s,n),this.#e.appendChild(t)}#D(){this.#r&&this.#r.addEventListener("keydown",t=>{let e=Array.from(this.#r.querySelectorAll("ol > li:not([hidden])")),s=t.target.closest("li"),n=e.indexOf(s);if(n===-1)return;let r;switch(t.key){case"ArrowRight":case"ArrowDown":r=Math.min(n+1,e.length-1);break;case"ArrowLeft":case"ArrowUp":r=Math.max(n-1,0);break;case"Home":r=0;break;case"End":r=e.length-1;break;default:return}t.preventDefault();let a=e[n].querySelector("a, button")||e[n],o=e[r].querySelector("a, button")||e[r];a.setAttribute("tabindex","-1"),o.setAttribute("tabindex","0"),o.focus()})}#k(){return this.#t.filter(t=>!t.hasAttribute("data-wizard-hidden"))}#I(){return this.#k()[this.#i]}#_(){let t=this.#k();this.#t.forEach(n=>{n.removeAttribute("data-wizard-active")});let e=t[this.#i];e&&e.setAttribute("data-wizard-active","");let s=this.#i+1;this.#e.setAttribute("data-wizard-current",String(s)),this.#e.setAttribute("data-wizard-total",String(t.length)),this.#i===t.length-1?this.#e.setAttribute("data-wizard-last",""):this.#e.removeAttribute("data-wizard-last"),this.#F(),this.#B(),this.#a&&this.#T(),this.#L(),this.#C()}#F(){if(!this.#n)return;let t=this.#k();this.#n.max=t.length,this.#n.value=this.#i+1}#T(){let t=`#step=${this.#i+1}`;window.location.hash!==t&&history.replaceState(null,"",t)}#q(){let e=window.location.hash.match(/step=(\d+)/);return e?parseInt(e[1],10)-1:null}#L(){if(!this.#s)return;let s=this.#I()?.querySelector("legend")?.textContent||`Step ${this.#i+1}`,n=this.#k();this.#s.textContent=`Now on step ${this.#i+1} of ${n.length}: ${s}`}#x(){if(this.#c==="none")return!0;let t=this.#I();if(!t||t.hasAttribute("data-wizard-optional"))return!0;let e=t.querySelectorAll("input, select, textarea"),s=!0;for(let n of e){let r=n;if(!r.checkValidity()){r.reportValidity(),s=!1;break}}return s}#M(){this.#t.forEach(e=>{let s=e.getAttribute("data-wizard-if");if(!s)return;this.#P(s)?e.removeAttribute("data-wizard-hidden"):e.setAttribute("data-wizard-hidden","")});let t=this.#k();this.#i>=t.length&&(this.#i=Math.max(0,t.length-1)),this.#_()}#P(t){return t.includes("||")?t.split("||").some(e=>this.#P(e.trim())):t.includes("&&")?t.split("&&").every(e=>this.#V(e.trim())):this.#V(t)}#V(t){let e=t.startsWith("!"),s=e?t.slice(1):t;if(s.includes(":")){let[o,c]=s.split(":"),l=c.startsWith("!"),h=l?c.slice(1):c,d=this.#E(o);return l?d!==h:d===h}let a=!!this.#E(s);return e?!a:a}#E(t){let e=this.#e.elements.namedItem(t);return e?e instanceof RadioNodeList?e.value:e instanceof HTMLInputElement?e.type==="checkbox"?e.checked?e.value||"true":"":e.value:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.value:"":""}#C(){let t=this.#I();if(!t||!t.hasAttribute("data-wizard-summary"))return;let e=t.querySelectorAll("[data-wizard-field]");if(e.length>0){for(let r of e){let a=r.getAttribute("data-wizard-field");r.textContent=this.#E(a)||"\u2014"}return}let s=t.querySelector("[data-wizard-summary-list]");s||(s=document.createElement("dl"),s.setAttribute("data-wizard-summary-list",""),t.appendChild(s)),s.innerHTML="";let n=new Set;for(let r of this.#t){if(r===t||r.hasAttribute("data-wizard-hidden"))continue;let a=r.querySelectorAll("input, select, textarea");for(let o of a){let c=o.name;if(!c||n.has(c))continue;n.add(c);let l=this.#E(c);if(!l)continue;let h=this.#R(o),d=document.createElement("dt");d.textContent=h||c;let u=document.createElement("dd");u.textContent=l,s.append(d,u)}}}#R(t){if(t.id){let n=this.#e.querySelector(`label[for="${CSS.escape(t.id)}"]`);if(n)return n.textContent.trim()}let e=t.closest("label");if(e){let n=e.cloneNode(!0);n.querySelectorAll("input, select, textarea").forEach(a=>a.remove());let r=n.textContent.trim();if(r)return r}let s=t.closest("form-field");if(s){let n=s.querySelector("label");if(n)return n.textContent.trim()}return""}#z(t,e={}){this.#e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))}goTo(t){let e=this.#k();if(t<0||t>=e.length||t>this.#i&&!this.#x())return!1;let s=this.#i;return this.#i=t,this.#_(),this.#z("wizard:step-change",{from:s,to:t}),this.#m(),!0}next(){let t=this.#k();return this.#i>=t.length-1?!1:this.goTo(this.#i+1)}prev(){return this.#i<=0?!1:this.goTo(this.#i-1)}reset(){this.#i=0,this.#_(),this.#v(),this.#z("wizard:reset")}get currentStep(){return this.#i}get totalSteps(){return this.#k().length}get form(){return this.#e}};typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{As(),Jr()}):(As(),Jr()))});var J=new Map,ge=new Map;var qs=null;function $s(){if(typeof window<"u"&&window.__VB_THEME_BASE)return String(window.__VB_THEME_BASE).replace(/\/$/,"");if(qs)return qs;if(typeof document<"u"){let i=document.querySelectorAll('script[src*="vanilla-breeze"]');for(let t of i){let e=t.getAttribute("src");if(e){let s=e.lastIndexOf("/");if(s!==-1)return e.slice(0,s)}}}return"/cdn"}var na=new Set(["default","a11y-high-contrast","a11y-large-text","a11y-dyslexia","modern","minimal","classic"]),ra=new Set(["kawaii","memphis"]);function ye(i){return ra.has(i)}function aa(i,t){return`${t}/themes/${i}.css`}function Is(i,t){if(!ye(i))return Promise.resolve();if(ge.has(i))return ge.get(i);let e=import(`${t}/packs/${i}.full.js`).catch(()=>{});return ge.set(i,e),e}function oa(i,t){let e=$s(),s=()=>{(ye(t)||i.hasAttribute("data-vb-pack"))&&Is(t,e)};return i.getAttribute("data-vb-theme-state")==="error"?Promise.reject(new Error(`Failed to load theme: ${t}`)):i.getAttribute("data-vb-theme-state")==="ready"||i.sheet?(s(),Promise.resolve()):new Promise((n,r)=>{let a=()=>{i.setAttribute("data-vb-theme-state","ready"),c(),s(),n()},o=()=>{i.setAttribute("data-vb-theme-state","error"),J.delete(t),c(),r(new Error(`Failed to load theme: ${t}`))},c=()=>{i.removeEventListener("load",a),i.removeEventListener("error",o)};i.addEventListener("load",a,{once:!0}),i.addEventListener("error",o,{once:!0})})}async function Ft(i){if(!i||na.has(i))return;if(J.has(i))return J.get(i);if(typeof document<"u"){let s=document.querySelector(`link[data-vb-theme="${i}"]`);if(s){let n=oa(s,i);return J.set(i,n),n}}let t=$s(),e=ye(i)?la(i,t):ca(i,t);return J.set(i,e),e}async function ca(i,t){let e=aa(i,t);return new Promise((s,n)=>{let r=document.querySelector(`link[data-vb-theme-preload="${i}"]`);r&&r.remove();let a=document.createElement("link");a.rel="stylesheet",a.href=e,a.setAttribute("data-vb-theme",i),a.setAttribute("data-vb-theme-state","loading"),a.onload=()=>{a.setAttribute("data-vb-theme-state","ready"),s()},a.onerror=()=>{a.setAttribute("data-vb-theme-state","error"),a.remove(),J.delete(i),n(new Error(`Failed to load theme: ${i}`))},document.head.appendChild(a)})}function la(i,t){let e=`${t}/packs/${i}.theme.css`,s=`${t}/packs/${i}.effects.css`;return new Promise((n,r)=>{let a=document.querySelector(`link[data-vb-theme-preload="${i}"]`);a&&a.remove();let o=document.createElement("link");o.rel="stylesheet",o.href=e,o.setAttribute("data-vb-theme",i),o.setAttribute("data-vb-pack",i),o.setAttribute("data-vb-theme-state","loading"),o.onload=()=>{o.setAttribute("data-vb-theme-state","ready");let c=document.createElement("link");c.rel="stylesheet",c.href=s,c.setAttribute("data-vb-pack-effects",i),document.head.appendChild(c),Is(i,t),n()},o.onerror=()=>{o.setAttribute("data-vb-theme-state","error"),o.remove(),J.delete(i),r(new Error(`Failed to load pack: ${i}`))},document.head.appendChild(o)})}var Os=[{id:"default",name:"Default",swatchBg:"#3b82f6",seeds:{}},{id:"ocean",name:"Ocean",swatchBg:"#0891b2",seeds:{"--hue-primary":200,"--hue-secondary":180,"--hue-accent":45,"--lightness-primary":"50%","--chroma-primary":.15,"--lightness-secondary":"45%","--chroma-secondary":.1,"--lightness-accent":"70%","--chroma-accent":.15},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.12}},{id:"forest",name:"Forest",swatchBg:"#059669",seeds:{"--hue-primary":145,"--hue-secondary":90,"--hue-accent":30,"--lightness-primary":"45%","--chroma-primary":.15,"--lightness-secondary":"55%","--chroma-secondary":.12,"--lightness-accent":"65%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"55%","--chroma-primary":.12}},{id:"sunset",name:"Sunset",swatchBg:"#ea580c",seeds:{"--hue-primary":25,"--hue-secondary":0,"--hue-accent":280,"--lightness-primary":"60%","--chroma-primary":.2,"--lightness-secondary":"55%","--chroma-secondary":.18,"--lightness-accent":"55%","--chroma-accent":.18},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.16}},{id:"rose",name:"Rose",swatchBg:"#e11d48",seeds:{"--hue-primary":350,"--hue-secondary":330,"--hue-accent":200,"--lightness-primary":"55%","--chroma-primary":.18,"--lightness-secondary":"50%","--chroma-secondary":.14,"--lightness-accent":"60%","--chroma-accent":.12},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.14}},{id:"lavender",name:"Lavender",swatchBg:"#a855f7",seeds:{"--hue-primary":280,"--hue-secondary":300,"--hue-accent":60,"--lightness-primary":"55%","--chroma-primary":.14,"--lightness-secondary":"50%","--chroma-secondary":.12,"--lightness-accent":"70%","--chroma-accent":.14},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.12}},{id:"coral",name:"Coral",swatchBg:"#f97316",seeds:{"--hue-primary":15,"--hue-secondary":25,"--hue-accent":180,"--lightness-primary":"60%","--chroma-primary":.18,"--lightness-secondary":"55%","--chroma-secondary":.15,"--lightness-accent":"55%","--chroma-accent":.12},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.15}},{id:"slate",name:"Slate",swatchBg:"#64748b",seeds:{"--hue-primary":220,"--hue-secondary":210,"--hue-accent":45,"--lightness-primary":"48%","--chroma-primary":.1,"--lightness-secondary":"45%","--chroma-secondary":.06,"--lightness-accent":"68%","--chroma-accent":.15},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.08}},{id:"emerald",name:"Emerald",swatchBg:"#10b981",seeds:{"--hue-primary":160,"--hue-secondary":140,"--hue-accent":30,"--lightness-primary":"50%","--chroma-primary":.15,"--lightness-secondary":"48%","--chroma-secondary":.12,"--lightness-accent":"65%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.12}},{id:"amber",name:"Amber",swatchBg:"#f59e0b",seeds:{"--hue-primary":45,"--hue-secondary":30,"--hue-accent":240,"--lightness-primary":"60%","--chroma-primary":.16,"--lightness-secondary":"55%","--chroma-secondary":.15,"--lightness-accent":"52%","--chroma-accent":.14},seedsDark:{"--lightness-primary":"68%","--chroma-primary":.14}},{id:"indigo",name:"Indigo",swatchBg:"#6366f1",seeds:{"--hue-primary":250,"--hue-secondary":270,"--hue-accent":35,"--lightness-primary":"48%","--chroma-primary":.18,"--lightness-secondary":"45%","--chroma-secondary":.14,"--lightness-accent":"68%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"62%","--chroma-primary":.14}}],Bs=[{id:"default",name:"Default",hue:210,shape:"balanced",character:"The default",swatchBg:"#3b82f6",tier:"core"},{id:"modern",name:"Modern",hue:270,shape:"rounded",character:"Vibrant & elevated",swatchBg:"#6366f1",tier:"core"},{id:"minimal",name:"Minimal",hue:240,shape:"sharp",character:"Clean & flat",swatchBg:"#71717a",tier:"core"},{id:"classic",name:"Classic",hue:220,shape:"subtle",character:"Serif & elegant",swatchBg:"#92400e",tier:"core"}],ve=[{id:"swiss",name:"Swiss",icon:"grid-3x3",character:"Precision grid",swatchBg:"#ff3e00",swatchFg:"white",tier:"showcase",category:"Design"},{id:"brutalist",name:"Brutalist",icon:"square",character:"Raw, industrial",swatchBg:"#1a1a1a",swatchFg:"#f5f5f5",tier:"showcase",category:"Design"},{id:"art-deco",name:"Art Deco",icon:"crown",character:"1920s luxury",swatchBg:"#1A1A1A",swatchFg:"#C9A84C",tier:"showcase",category:"Design"},{id:"editorial",name:"Editorial",icon:"newspaper",character:"Magazine elegance",swatchBg:"#1a1a1a",swatchFg:"#c9a227",tier:"showcase",category:"Content"},{id:"genai",name:"GenAI",icon:"sparkles",character:"AI aesthetic",swatchBg:"#1a0a2e",swatchFg:"#a855f7",tier:"showcase",category:"Modern"},{id:"glassmorphism",name:"Glass",icon:"glass-water",character:"Frosted surfaces",swatchBg:"#667eea",swatchFg:"#ffffff",tier:"showcase",category:"Modern"},{id:"startup",name:"Startup",icon:"rocket",character:"SaaS energy",swatchBg:"#4f46e5",swatchFg:"#ffffff",tier:"showcase",category:"Modern"},{id:"organic",name:"Organic",icon:"leaf",character:"Natural, handcrafted",swatchBg:"#2d5016",swatchFg:"#faf5e6",tier:"showcase",category:"Creative"},{id:"rough",name:"Rough",icon:"pencil",character:"Hand-drawn sketch",swatchBg:"#f5f0e8",swatchFg:"#3a3a3a",tier:"showcase",category:"Creative"},{id:"cyber",name:"Cyber",icon:"zap",character:"Neon futuristic",swatchBg:"#0a0a1a",swatchFg:"#00ff88",tier:"showcase",category:"Creative"},{id:"vaporwave",name:"Vaporwave",icon:"radio",character:"Neon dreamy",swatchBg:"#2b0040",swatchFg:"#ff6ad5",tier:"showcase",category:"Aesthetic"},{id:"neumorphism",name:"Neumorph",icon:"circle",character:"Soft embossed",swatchBg:"#e0e0e0",swatchFg:"#a0a0a0",tier:"showcase",category:"Aesthetic"},{id:"bauhaus",name:"Bauhaus",icon:"shapes",character:"Geometric",swatchBg:"#F1FAEE",swatchFg:"#E63946",tier:"showcase",category:"Aesthetic"},{id:"claymorphism",name:"Clay",icon:"circle-dot",character:"Puffy 3D",swatchBg:"#f0f0f5",swatchFg:"#FF6B9D",tier:"showcase",category:"Aesthetic"},{id:"alpha1999",name:"Alpha1999",icon:"orbit",character:"Space retro-fi",swatchBg:"#0a0a14",swatchFg:"#d4880f",tier:"showcase",category:"Signature"},{id:"super2026",name:"Super2026",icon:"triangle",character:"Supergraphic bold",swatchBg:"#f5f0e6",swatchFg:"#c23616",tier:"showcase",category:"Signature"},{id:"magna",name:"Magna",icon:"orbit",character:"Odyssey 2 retro",swatchBg:"#0d0b14",swatchFg:"#f97316",tier:"showcase",category:"Signature"},{id:"win9x",name:"Win9x",icon:"monitor",character:"Classic desktop",swatchBg:"#008080",swatchFg:"#c0c0c0",tier:"showcase",category:"OS Styles"},{id:"nes",name:"NES",icon:"joystick",character:"Console pixels",swatchBg:"#bcbcbc",swatchFg:"#e40521",tier:"showcase",category:"OS Styles"},{id:"8bit",name:"8-Bit",icon:"gamepad-2",character:"Retro pixel art",swatchBg:"#000080",swatchFg:"#ffff00",tier:"showcase",category:"OS Styles"}],we=[{id:"nord",name:"Nord",icon:"snowflake",character:"Arctic calm",swatchBg:"#2E3440",swatchFg:"#81A1C1",tier:"community",category:"Editor Palettes"},{id:"solarized",name:"Solarized",icon:"sun-dim",character:"Engineered precision",swatchBg:"#002B36",swatchFg:"#268BD2",tier:"community",category:"Editor Palettes"},{id:"dracula",name:"Dracula",icon:"moon-star",character:"Dark elegance",swatchBg:"#282A36",swatchFg:"#BD93F9",tier:"community",category:"Editor Palettes"},{id:"catppuccin-mocha",name:"Catppuccin",icon:"coffee",character:"Warm pastels",swatchBg:"#1E1E2E",swatchFg:"#CBA6F7",tier:"community",category:"Editor Palettes"},{id:"catppuccin-latte",name:"Ctp Latte",icon:"coffee",character:"Cozy daytime",swatchBg:"#eff1f5",swatchFg:"#8839ef",tier:"community",category:"Editor Palettes"},{id:"catppuccin-frappe",name:"Ctp Frapp\xE9",icon:"coffee",character:"Cool twilight",swatchBg:"#303446",swatchFg:"#ca9ee6",tier:"community",category:"Editor Palettes"},{id:"catppuccin-macchiato",name:"Ctp Macchiato",icon:"coffee",character:"Deep blue",swatchBg:"#24273a",swatchFg:"#c6a0f6",tier:"community",category:"Editor Palettes"},{id:"gruvbox",name:"Gruvbox",icon:"palette",character:"Retro warmth",swatchBg:"#282828",swatchFg:"#ebdbb2",tier:"community",category:"Editor Palettes"},{id:"tokyo-night",name:"Tokyo Night",icon:"moon",character:"Night-owl vibes",swatchBg:"#1a1b26",swatchFg:"#7aa2f7",tier:"community",category:"Editor Palettes"},{id:"rose-pine",name:"Ros\xE9 Pine",icon:"flower-2",character:"Muted elegance",swatchBg:"#191724",swatchFg:"#ebbcba",tier:"community",category:"Editor Palettes"},{id:"cottagecore",name:"Cottagecore",icon:"flower-2",character:"Pastoral",swatchBg:"#fdf8f0",swatchFg:"#7d8c6d",tier:"community",category:"Niche"},{id:"terminal",name:"Terminal",icon:"terminal",character:"Retro CRT",swatchBg:"#0d1117",swatchFg:"#00ff00",tier:"community",category:"Niche"},{id:"clinical",name:"Clinical",icon:"heart-pulse",character:"Sterile precision",swatchBg:"#ffffff",swatchFg:"#0077b6",tier:"community",category:"Industry"},{id:"financial",name:"Financial",icon:"landmark",character:"Navy + gold",swatchBg:"#1b2a4a",swatchFg:"#c9a84c",tier:"community",category:"Industry"},{id:"government",name:"Government",icon:"shield",character:"Official",swatchBg:"#002868",swatchFg:"#bf0a30",tier:"community",category:"Industry"},{id:"dawn",name:"Dawn",icon:"sunrise",character:"Golden morning",swatchBg:"#fef3e2",swatchFg:"#d4a574",tier:"community",category:"Mood/Time"},{id:"dusk",name:"Dusk",icon:"sunset",character:"Twilight",swatchBg:"#1a1b2e",swatchFg:"#e5a858",tier:"community",category:"Mood/Time"},{id:"midnight",name:"Midnight",icon:"moon",character:"Deep night",swatchBg:"#0d1117",swatchFg:"#58a6ff",tier:"community",category:"Mood/Time"},{id:"high-noon",name:"High Noon",icon:"sun",character:"Maximum bright",swatchBg:"#ffffff",swatchFg:"#e63946",tier:"community",category:"Mood/Time"}],Ps=[{id:"kawaii",name:"Kawaii",icon:"heart",character:"Cute aesthetic",swatchBg:"#ffb7c5",swatchFg:"#ff69b4",tier:"showcase",category:"Packs"},{id:"memphis",name:"Memphis",icon:"star",character:"Bold patterns",swatchBg:"#FFF8F0",swatchFg:"#d03040",tier:"showcase",category:"Packs"}];var hl=[...ve,...we],dl=[...Bs,...ve,...we,...Ps],Z=i=>ve.filter(t=>t.category===i),Fs=[{label:"Style",themes:Bs,tier:"core"},{label:"Design",themes:Z("Design"),tier:"showcase"},{label:"Content",themes:Z("Content"),tier:"showcase"},{label:"Modern",themes:Z("Modern"),tier:"showcase"},{label:"Creative",themes:Z("Creative"),tier:"showcase"},{label:"Aesthetic",themes:Z("Aesthetic"),tier:"showcase"},{label:"Signature",themes:Z("Signature"),tier:"showcase"},{label:"OS Styles",themes:Z("OS Styles"),tier:"showcase"},{label:"Packs",themes:Ps,tier:"showcase"},{label:"More Themes",themes:we,tier:"community"}];W();var Ae="theme",Se="current",ct={mode:"auto",brand:"default",accent:"default",borderStyle:"",iconSet:"",fluid:"",backdrop:"",backdropChrome:"",pageBgType:"",pageBgColor:"",pageBgGradStart:"",pageBgGradEnd:"",pageBgGradDir:""},Vs=["--hue-primary","--hue-secondary","--hue-accent","--lightness-primary","--chroma-primary","--lightness-secondary","--chroma-secondary","--lightness-accent","--chroma-accent"],k=null,S={_initPromise:null,async init(){return this._initPromise?this._initPromise:(this._initPromise=(async()=>{let i=await w.get(Ae,Se);k=i?{...ct,...i}:{...ct};try{await Ft(k.brand)}catch{k.brand="default"}return this.apply(k),this._watchSystemPreference(),this._watchRootAttributes(),k})(),this._initPromise)},load(){return k?{...k}:{...ct}},save(i){let t={...k??ct,...i};return k=t,w.set(Ae,Se,t).catch(()=>{}),t},apply({mode:i="auto",brand:t="default",borderStyle:e="",iconSet:s="",fluid:n="",backdrop:r="",backdropChrome:a="",pageBgType:o="",pageBgColor:c="",pageBgGradStart:l="",pageBgGradEnd:h="",pageBgGradDir:d=""}={}){let u=document.documentElement;u.dataset.mode=i==="auto"?this.getEffectiveMode():i;let y=(u.dataset.theme||"").split(" ").filter(q=>q.startsWith("a11y-")),p=t!=="default"?[t,...y]:[...y];p.length?u.dataset.theme=p.join(" "):delete u.dataset.theme;let E=e||this._readCSSHint("--theme-border-style");E&&E!=="clean"?u.dataset.borderStyle=E:delete u.dataset.borderStyle;let v=s||this._readCSSHint("--theme-icon-set");if(v&&v!=="lucide"?u.dataset.iconSet=v:delete u.dataset.iconSet,n?u.dataset.fluid=n:delete u.dataset.fluid,r?u.dataset.backdrop=r:delete u.dataset.backdrop,a&&a!=="card"?u.dataset.backdropChrome=a:delete u.dataset.backdropChrome,o==="color"&&c)u.style.setProperty("--page-bg-color",c),u.style.removeProperty("--page-bg-gradient");else if(o==="gradient"&&l&&h){let q=d||"to bottom";u.style.setProperty("--page-bg-gradient",`linear-gradient(${q}, ${l}, ${h})`),u.style.removeProperty("--page-bg-color")}else u.style.removeProperty("--page-bg-color"),u.style.removeProperty("--page-bg-gradient");let T=this.load().accent||"default";this._applyAccent(T),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{mode:i,brand:t,accent:T,borderStyle:E,iconSet:v,fluid:n,backdrop:r,backdropChrome:a,pageBgType:o,effectiveMode:this.getEffectiveMode()}}))},setMode(i){let t=this.save({mode:i});this.apply(t)},async setBrand(i){try{await Ft(i)}catch(e){console.warn(`[VB] Theme "${i}" failed to load, using default`,e),i="default"}let t=this.save({brand:i});this.apply(t)},setAccent(i){this.save({accent:i}),this._applyAccent(i),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}}))},setBorderStyle(i){let t=this.save({borderStyle:i});this.apply(t)},setIconSet(i){let t=this.save({iconSet:i});this.apply(t)},setFluid(i){let t=this.save({fluid:i});this.apply(t)},setBackdrop(i){let t=this.save({backdrop:i});this.apply(t)},setBackdropChrome(i){let t=this.save({backdropChrome:i});this.apply(t)},setPageBg({type:i="",color:t="",gradStart:e="",gradEnd:s="",gradDir:n=""}={}){let r=this.save({pageBgType:i,pageBgColor:t,pageBgGradStart:e,pageBgGradEnd:s,pageBgGradDir:n});this.apply(r)},getEffectiveMode(){let{mode:i}=this.load();return i!=="auto"?i:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},getState(){let{mode:i,brand:t,accent:e,borderStyle:s,iconSet:n,fluid:r,backdrop:a,backdropChrome:o,pageBgType:c,pageBgColor:l,pageBgGradStart:h,pageBgGradEnd:d,pageBgGradDir:u}=this.load();return{mode:i,brand:t,accent:e,borderStyle:s,iconSet:n,fluid:r,backdrop:a,backdropChrome:o,pageBgType:c,pageBgColor:l,pageBgGradStart:h,pageBgGradEnd:d,pageBgGradDir:u,effectiveMode:this.getEffectiveMode()}},toggleMode(){let t=this.getEffectiveMode()==="dark"?"light":"dark";this.setMode(t)},reset(){k={...ct},w.remove(Ae,Se).catch(()=>{});let i=document.documentElement;i.style.removeProperty("--page-bg-color"),i.style.removeProperty("--page-bg-gradient");for(let t of Vs)i.style.removeProperty(t);this.apply(ct)},_readCSSHint(i){return getComputedStyle(document.documentElement).getPropertyValue(i).trim()},_applyAccent(i){let t=document.documentElement,e=Os.find(s=>s.id===i);for(let s of Vs)t.style.removeProperty(s);if(!(!e||!e.seeds||Object.keys(e.seeds).length===0)){for(let[s,n]of Object.entries(e.seeds))t.style.setProperty(s,String(n));if(e.seedsDark&&this.getEffectiveMode()==="dark")for(let[s,n]of Object.entries(e.seedsDark))t.style.setProperty(s,String(n))}},_watchRootAttributes(){this._rootObserver||(this._rootObserver=new MutationObserver(i=>{for(let t of i)t.attributeName==="data-theme"?this._syncFromDataTheme():t.attributeName==="data-mode"&&this._syncFromDataMode()}),this._rootObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-mode"]}))},_syncFromDataTheme(){if(!k)return;let e=(document.documentElement.dataset.theme||"").split(/\s+/).filter(Boolean).find(s=>!s.startsWith("a11y-"))||"default";e!==k.brand&&(k.brand=e,Ft(e).catch(()=>{}),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}})))},_syncFromDataMode(){if(!k)return;let i=document.documentElement.dataset.mode||"auto",t=k.mode==="auto"?this.getEffectiveMode():k.mode;i!==t&&(k.mode=i,window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}})))},_watchSystemPreference(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{let t=this.load();t.mode==="auto"&&this.apply(t)})}};var da=["layout-text","layout-reel","layout-canvas","dl-item"];da.forEach(i=>{customElements.get(i)||customElements.define(i,class extends HTMLElement{})});var vl=window.matchMedia("(prefers-reduced-motion: reduce)");var zs=new Map;function f(i,t,e={}){let s=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:s},r=zs.get(i);if(customElements.get(i)){if(!r||r.priority>=s){r&&r.priority===s&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=s){r.priority===s&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}zs.set(i,n),customElements.define(i,t)}var m=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,n){t.addEventListener(e,s,n),this.#e.push(()=>t.removeEventListener(e,s,n))}setup(){}teardown(){}};var ua=["valueMissing","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","customError"],Ce=class extends m{#e=null;#t=null;#i=!1;setup(){if(this.#e=this.querySelector("input, textarea, select"),this.#t=this.querySelector("output.error")??this.querySelector("output:not(.hint)"),!this.#e)return!1;this.listen(this.#e,"blur",()=>this.validate()),this.listen(this.#e,"input",()=>{this.#i&&this.validate()})}teardown(){this.#e=null,this.#t=null,this.#i=!1}validate(){let t=this.#e;if(!t)return!0;t.validity.customError||t.setCustomValidity("");let e=t.checkValidity();return e?(this.#n(t.value?"valid":null),t.removeAttribute("aria-invalid"),this.#t&&(this.#t.textContent="")):(this.#i=!0,this.#n("invalid"),t.setAttribute("aria-invalid","true"),this.#s(t.validity)),e}setError(t){this.#e&&(this.#e.setCustomValidity(t),this.#i=!0,this.#n("invalid"),this.#e.setAttribute("aria-invalid","true"),this.#t&&(this.#t.textContent=t))}clearError(){this.#e&&(this.#e.setCustomValidity(""),this.#n(null),this.#e.removeAttribute("aria-invalid"),this.#i=!1,this.#t&&(this.#t.textContent=""))}get fieldName(){return this.querySelector("label")?.textContent?.trim()??this.#e?.getAttribute("aria-label")??this.#e?.name??this.#e?.id??"Field"}get input(){return this.#e}#n(t){delete this.dataset.valid,delete this.dataset.invalid,t&&(this.dataset[t]="")}#s(t){if(!this.#t)return;let e=this.#e;for(let s of ua){if(!t[s])continue;let n=`data-message-${s.toLowerCase()}`,r=e.getAttribute(n)??e.validationMessage;this.#t.textContent=r;return}}};f("form-field",Ce);function P(i){return document.startViewTransition?document.startViewTransition(i):i()}var pa=0,ke=class extends m{#e=[];#t=[];#i=!1;#n=0;setup(){if(this.#e=[...this.querySelectorAll(":scope > details")],this.#t=this.#e.map(t=>t.querySelector("summary")),this.#e.length===0)return!1;this.#a(),this.#c(),this.#s()}teardown(){this.#e=[],this.#t=[],this.#i=!1}#s(){if(!this.hasAttribute("transition")||!document.startViewTransition)return;this.#i=!0;let t=++pa,e=this.getAttribute("transition")||"fade",s=e==="slide"?"vt-tabs-slide":e==="scale"?"vt-tabs-scale":"vt-tabs";this.#e.forEach(n=>{let r=n.querySelector(":scope > :not(summary)");r&&(r.style.viewTransitionName=`tabs-${t}`,r.style.viewTransitionClass=s)}),this.#n=this.#e.findIndex(n=>n.open),this.#n===-1&&(this.#n=0)}#r(t){if(t===this.#n)return;let e=t>this.#n?"forward":"backward";document.documentElement.dataset.vtDirection=e,P(()=>{this.#e[t].open=!0}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}#a(){this.#e.forEach((t,e)=>{let s=this.#t[e],n=t.querySelector(":scope > :not(summary)");if(!s||!n)return;let r=s.id||`tab-${crypto.randomUUID().slice(0,8)}`,a=n.id||`panel-${crypto.randomUUID().slice(0,8)}`;s.id=r,s.setAttribute("aria-controls",a),s.setAttribute("tabindex",t.open?"0":"-1"),s.setAttribute("aria-selected",t.open?"true":"false"),n.id=a,n.setAttribute("aria-labelledby",r),this.listen(s,"click",o=>{this.#i&&(o.preventDefault(),this.#r(e))}),this.listen(s,"keydown",o=>this.#h(o,e)),this.listen(t,"toggle",()=>this.#o(e))})}#c(){!this.#e.some(e=>e.open)&&this.#e.length>0&&(this.#e[0].open=!0,this.#p())}#o(t){this.#e[t].open&&(this.#n=t),this.#p(),this.dispatchEvent(new CustomEvent("tab-set:change",{detail:{index:t},bubbles:!0}))}#p(){this.#e.forEach((t,e)=>{let s=this.#t[e];s.setAttribute("tabindex",t.open?"0":"-1"),s.setAttribute("aria-selected",t.open?"true":"false")})}#h(t,e){let{key:s}=t,n;switch(s){case"ArrowRight":n=(e+1)%this.#e.length;break;case"ArrowLeft":n=(e-1+this.#e.length)%this.#e.length;break;case"Home":n=0;break;case"End":n=this.#e.length-1;break;default:return}t.preventDefault(),this.#i?this.#r(n):this.#e[n].open=!0,this.#t[n].focus()}};f("tab-set",ke);var xe=class i extends m{static#e=0;#t;#i=[];#n="Back to content";setup(){this.#t=++i.#e,this.hasAttribute("data-back-label")&&(this.#n=this.getAttribute("data-back-label")??this.#n),this.#s(),this.getAttribute("data-mode")==="sidenotes"?this.#c():this.#r()}#s(){let t=[...document.querySelectorAll("foot-note:not([data-enhanced])")];this.#i=t.filter(e=>this.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}#r(){if(this.#i.length===0)return;let t=document.createElement("ol");this.#i.forEach((e,s)=>{let n=s+1,r=`fnref-${this.#t}-${n}`,a=`fn-${this.#t}-${n}`;this.#a(e,n,r,a);let o=this.#p(e,n,r,a);t.appendChild(o)}),this.appendChild(t)}#a(t,e,s,n){t.setAttribute("data-enhanced",""),t.id=s;let r=t.innerHTML,a=document.createElement("span");a.innerHTML=r;let o=document.createElement("a");o.href=`#${n}`,o.setAttribute("aria-describedby",n),o.textContent=`[${e}]`,t.innerHTML="",t.appendChild(a),t.appendChild(o)}#c(){if(this.#i.length===0)return;let t=[];if(this.#i.forEach((e,s)=>{let n=s+1,r=`fnref-${this.#t}-${n}`,a=`fn-${this.#t}-${n}`;e.getAttribute("data-side")==="false"?(this.#a(e,n,r,a),t.push({ref:e,num:n,refId:r,noteId:a})):this.#o(e,n,r,a)}),t.length>0){let e=document.createElement("ol");for(let{ref:s,num:n,refId:r,noteId:a}of t)e.appendChild(this.#p(s,n,r,a));this.appendChild(e)}else this.hidden=!0}#o(t,e,s,n){let r=t.innerHTML;t.setAttribute("data-enhanced",""),t.setAttribute("data-side",""),t.id=s;let a=document.createElement("a");a.href=`#${n}`,a.setAttribute("aria-describedby",n),a.textContent=`[${e}]`;let o=document.createElement("aside");o.className="sidenote",o.id=n,o.setAttribute("role","note"),o.innerHTML=`<span class="sidenote-number">${e}.</span> ${r}`,t.innerHTML="",t.appendChild(a),t.appendChild(o)}#p(t,e,s,n){let r=document.createElement("li");r.id=n;let a=t.querySelector("span"),o=a?a.innerHTML:"",c=document.createElement("a");return c.href=`#${s}`,c.setAttribute("data-backref",""),c.setAttribute("aria-label",this.#n),c.textContent="\u21A9",r.innerHTML=o+" ",r.appendChild(c),r}},Te=class extends HTMLElement{};f("foot-notes",xe);f("foot-note",Te);var fa=0,Le=class extends m{#e=[];#t=[];#i=[];#n=!1;setup(){if(this.#e=[...this.querySelectorAll(":scope > details")],this.#t=this.#e.map(t=>t.querySelector("summary")),this.#e.length===0)return!1;this.#s(),this.#c(),this.#r()}teardown(){this.#e=[],this.#t=[],this.#i=[],this.#n=!1}#s(){this.#i=this.#e.map(t=>{let e=t.querySelector("summary");if(!e)return null;let s=[...t.children].filter(n=>n!==e);if(s.length===1)return s[0];if(s.length>1){let n=document.createElement("div");for(let r of s)n.appendChild(r);return t.appendChild(n),n}return null})}#r(){if(!this.hasAttribute("transition")||!document.startViewTransition)return;this.#n=!0;let t=++fa,e=this.getAttribute("transition")||"fade",s=e==="slide"?"vt-accordion-slide":e==="scale"?"vt-accordion-scale":"vt-accordion";this.#i.forEach((n,r)=>{n&&(n.style.viewTransitionName=`accordion-${t}-${r}`,n.style.viewTransitionClass=s)})}#a(t){P(()=>{t.open=!t.open})}#c(){this.#e.forEach((t,e)=>{let s=this.#t[e],n=this.#i[e];if(s){if(n){let r=s.id||`accordion-heading-${crypto.randomUUID().slice(0,8)}`,a=n.id||`accordion-panel-${crypto.randomUUID().slice(0,8)}`;s.id=r,n.id=a,s.setAttribute("aria-expanded",t.open?"true":"false"),s.setAttribute("aria-controls",a),n.setAttribute("aria-labelledby",r),n.setAttribute("role","region")}else s.setAttribute("aria-expanded",t.open?"true":"false");this.listen(s,"click",r=>{this.#n&&(r.preventDefault(),this.#a(t))}),this.listen(s,"keydown",r=>this.#p(r,e)),this.listen(t,"toggle",()=>this.#o(t,e))}})}#o(t,e){this.#t[e].setAttribute("aria-expanded",t.open?"true":"false"),this.hasAttribute("single")&&t.open&&this.#e.forEach((n,r)=>{r!==e&&n.open&&(n.open=!1,this.#t[r].setAttribute("aria-expanded","false"))}),this.dispatchEvent(new CustomEvent("accordion-wc:toggle",{detail:{index:e,open:t.open},bubbles:!0}))}#p(t,e){let{key:s}=t,n;switch(s){case"ArrowDown":n=(e+1)%this.#e.length;break;case"ArrowUp":n=(e-1+this.#e.length)%this.#e.length;break;case"Home":n=0;break;case"End":n=this.#e.length-1;break;default:return}t.preventDefault(),this.#t[n].focus()}open(t){t<0||t>=this.#e.length||(this.#n&&!this.#e[t].open?P(()=>{this.#e[t].open=!0}):this.#e[t].open=!0)}close(t){t<0||t>=this.#e.length||(this.#n&&this.#e[t].open?P(()=>{this.#e[t].open=!1}):this.#e[t].open=!1)}toggle(t){t<0||t>=this.#e.length||(this.#n?this.#a(this.#e[t]):this.#e[t].open=!this.#e[t].open)}openAll(){this.hasAttribute("single")||this.#e.forEach(t=>{t.open=!0})}closeAll(){this.#e.forEach(t=>{t.open=!1})}};f("accordion-wc",Le);var Me=class extends m{#e=[];#t=[];static get observedAttributes(){return["position","max"]}setup(){this.setAttribute("role","region"),this.setAttribute("aria-label","Notifications"),this.setAttribute("aria-live","polite")}teardown(){this.#t.forEach(t=>{t._dismissTimer&&clearTimeout(t._dismissTimer)}),this.#e=[],this.#t=[]}show(t){let{message:e,variant:s="info",duration:n=this.#r(),dismissible:r=!0,action:a,onAction:o}=t,c=this.#i({message:e,variant:s,dismissible:r,action:a,onAction:o}),l=this.#a();return this.#t.length>=l?this.#e.push({toast:c,duration:n}):this.#n(c,n),c}#i({message:t,variant:e,dismissible:s,action:n,onAction:r}){let a=document.createElement("div");a.className="toast",a.setAttribute("role",e==="error"||e==="warning"?"alert":"status"),a.setAttribute("data-variant",e);let o={info:"ⓘ",success:"✓",warning:"⚠",error:"✗"};return a.innerHTML=`
|
|
1
|
+
var ra=Object.defineProperty;var D=(i,t)=>()=>(i&&(t=i(i=0)),t);var bt=(i,t)=>{for(var e in t)ra(i,e,{get:t[e],enumerable:!0})};function ua(){let i=globalThis.localStorage;if(!i)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return i.getItem(t)},async setRaw(t,e){i.setItem(t,e)},async removeRaw(t){i.removeItem(t)},async keys(t){let e=[];for(let s=0;s<i.length;s++){let n=i.key(s);n&&n.startsWith(t)&&e.push(n)}return e}}}function V(){return Rt||(Rt=ua()),Rt}function Ee(i,t){if(typeof i!="string"||!i)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${i}:${t}`}function Hs(i){if(typeof i!="string"||!i)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${i}:`}function Vs(i){try{let t=JSON.parse(i);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var Rt,w,W=D(()=>{Rt=null;w={configure(i={}){Rt=i.backend??null},async set(i,t,e){let s={data:e,timestamp:Date.now()};await V().setRaw(Ee(i,t),JSON.stringify(s))},async get(i,t,e){let s=await V().getRaw(Ee(i,t));if(s==null)return null;let n=Vs(s);return!n||e?.maxAge!=null&&Date.now()-n.timestamp>e.maxAge?null:n.data},async remove(i,t){await V().removeRaw(Ee(i,t))},async list(i){let t=Hs(i),e=await V().keys(t),s=[];for(let n of e){let r=await V().getRaw(n);if(r==null)continue;let a=Vs(r);a&&s.push({key:n.slice(t.length),data:a.data,timestamp:a.timestamp})}return s},async clear(i){let t=Hs(i),e=await V().keys(t);for(let s of e)await V().removeRaw(s)},async clearAll(){let i=await V().keys("vb:");for(let t of i)await V().removeRaw(t)},async setMany(i,t){for(let[e,s]of t)await w.set(i,e,s)}}});var ln={};bt(ln,{addDialogDismiss:()=>on,addLongPress:()=>an,addPullToRefresh:()=>Ta,addSwipeListener:()=>nn,haptic:()=>Ut,initGestures:()=>cn,makeSwipeable:()=>rn});function nn(i,t={}){let e=t.threshold??50,s=t.restraint??100,n=t.timeout??300,r,a,o;function c(h){h.isPrimary&&(r=h.clientX,a=h.clientY,o=Date.now())}function l(h){if(!h.isPrimary)return;let d=h.clientX-r,u=h.clientY-a,b=Date.now()-o;if(b>n)return;let y=Math.abs(d),p=Math.abs(u),E;if(y>=e&&p<=s?E=d<0?"left":"right":p>=e&&y<=s&&(E=u<0?"up":"down"),E){let v=E==="left"||E==="right"?y:p;i.dispatchEvent(new CustomEvent(`swipe-${E}`,{bubbles:!0,detail:{distance:v,duration:b}}))}}return i.addEventListener("pointerdown",c,{passive:!0}),i.addEventListener("pointerup",l,{passive:!0}),()=>{i.removeEventListener("pointerdown",c),i.removeEventListener("pointerup",l)}}function rn(i,t={}){let e=t.threshold??100,s=t.direction??"horizontal",n=t.removeOnDismiss??!0,r=s==="horizontal",a=0,o=0,c=!1;function l(p){!p.isPrimary||i.hasAttribute("data-dismissed")||(p.preventDefault(),c=!0,a=r?p.clientX:p.clientY,o=0,i.setPointerCapture(p.pointerId),i.setAttribute("data-swiping",""))}function h(p){if(!c||!p.isPrimary)return;o=(r?p.clientX:p.clientY)-a;let v=1-Math.min(Math.abs(o)/e,1)*.5;r?i.style.transform=`translateX(${o}px)`:i.style.transform=`translateY(${o}px)`,i.style.opacity=String(v)}function d(p){!c||!p.isPrimary||(c=!1,i.releasePointerCapture(p.pointerId),i.removeAttribute("data-swiping"),Math.abs(o)>=e?b(o>0?"right":"left"):y())}function u(p){!c||!p.isPrimary||(c=!1,i.releasePointerCapture(p.pointerId),i.removeAttribute("data-swiping"),y())}function b(p){let E=p==="right"?"100%":"-100%";i.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",i.style.transform=r?`translateX(${E})`:`translateY(${E})`,i.style.opacity="0",i.setAttribute("data-dismissed",""),Ut.dismiss(),i.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:p,distance:Math.abs(o)}})),n&&i.addEventListener("transitionend",()=>i.remove(),{once:!0})}function y(){i.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",i.style.transform="",i.style.opacity="",i.addEventListener("transitionend",()=>{i.style.transition=""},{once:!0})}return i.addEventListener("pointerdown",l),i.addEventListener("pointermove",h),i.addEventListener("pointerup",d),i.addEventListener("pointercancel",u),()=>{i.removeEventListener("pointerdown",l),i.removeEventListener("pointermove",h),i.removeEventListener("pointerup",d),i.removeEventListener("pointercancel",u)}}function Ta(i,t,e={}){let s=e.threshold??70,n=e.maxPull??120,r=document.createElement("div");r.setAttribute("data-pull-indicator",""),r.setAttribute("aria-hidden","true");let a=document.createElement("div");a.setAttribute("data-pull-spinner",""),r.appendChild(a),i.prepend(r);let o=0,c=!1,l=!1;function h(E){!E.isPrimary||l||i.scrollTop<=0&&(o=E.clientY,c=!0)}function d(E){if(!c||!E.isPrimary||l)return;let v=E.clientY-o;if(v<=0){r.style.transform="",r.style.opacity="";return}let T=Math.min(v,n),q=T/s;r.style.transform=`translateY(${T}px)`,r.style.opacity=String(Math.min(q,1)),q>=1?r.setAttribute("data-pull-ready",""):r.removeAttribute("data-pull-ready")}function u(E){!c||!E.isPrimary||(c=!1,r.hasAttribute("data-pull-ready")&&!l?y():p())}function b(E){!c||!E.isPrimary||(c=!1,p())}async function y(){l=!0,r.removeAttribute("data-pull-ready"),r.setAttribute("data-pull-loading",""),r.style.transform=`translateY(${s}px)`,r.style.opacity="1";try{await t()}finally{l=!1,r.removeAttribute("data-pull-loading"),p()}}function p(){r.style.transition="transform 0.3s ease, opacity 0.3s ease",r.style.transform="",r.style.opacity="",r.removeAttribute("data-pull-ready"),r.addEventListener("transitionend",()=>{r.style.transition=""},{once:!0})}return i.addEventListener("pointerdown",h,{passive:!0}),i.addEventListener("pointermove",d,{passive:!0}),i.addEventListener("pointerup",u,{passive:!0}),i.addEventListener("pointercancel",b,{passive:!0}),()=>{i.removeEventListener("pointerdown",h),i.removeEventListener("pointermove",d),i.removeEventListener("pointerup",u),i.removeEventListener("pointercancel",b),r.remove()}}function an(i,t,e={}){let s=e.duration??500,n=e.hapticFeedback??!0,r=e.blockContextMenu??!0,a=null;function o(h){h.isPrimary&&(a=setTimeout(()=>{n&&Ut.tap(),t(h),a=null},s))}function c(){a&&(clearTimeout(a),a=null)}function l(h){r&&h.preventDefault()}return i.addEventListener("pointerdown",o,{passive:!0}),i.addEventListener("pointermove",c,{passive:!0}),i.addEventListener("pointerup",c,{passive:!0}),i.addEventListener("pointercancel",c,{passive:!0}),i.addEventListener("contextmenu",l),()=>{c(),i.removeEventListener("pointerdown",o),i.removeEventListener("pointermove",c),i.removeEventListener("pointerup",c),i.removeEventListener("pointercancel",c),i.removeEventListener("contextmenu",l)}}function on(i,t={}){let e=t.threshold??80,s=0,n=0,r=!1;function a(u){if(!u.isPrimary||!i.open)return;let b=u.target;b.closest("a, button, input, select, textarea, [contenteditable]")&&!b.closest("header")||(r=!0,s=u.clientY,n=0,i.setPointerCapture(u.pointerId),i.style.transition="none")}function o(u){if(!r||!u.isPrimary)return;if(n=u.clientY-s,n<=0){i.style.transform="",i.style.opacity="";return}let y=1-Math.min(n/e,1)*.4;i.style.transform=`translateY(${n}px)`,i.style.opacity=String(y)}function c(u){!r||!u.isPrimary||(r=!1,i.releasePointerCapture(u.pointerId),n>=e?h():d())}function l(u){!r||!u.isPrimary||(r=!1,i.releasePointerCapture(u.pointerId),d())}function h(){i.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",i.style.transform="translateY(100%)",i.style.opacity="0",Ut.dismiss(),i.addEventListener("transitionend",()=>{i.style.transition="",i.style.transform="",i.style.opacity="",i.close("dismiss")},{once:!0})}function d(){i.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",i.style.transform="",i.style.opacity="",i.addEventListener("transitionend",()=>{i.style.transition=""},{once:!0})}return i.addEventListener("pointerdown",a),i.addEventListener("pointermove",o),i.addEventListener("pointerup",c),i.addEventListener("pointercancel",l),()=>{i.removeEventListener("pointerdown",a),i.removeEventListener("pointermove",o),i.removeEventListener("pointerup",c),i.removeEventListener("pointercancel",l)}}function cn(i=document){let t=[];for(let e of i.querySelectorAll('[data-gesture="swipe"]'))t.push(nn(e));for(let e of i.querySelectorAll('[data-gesture="dismiss"]'))t.push(rn(e));for(let e of i.querySelectorAll('[data-gesture="long-press"]'))t.push(an(e,()=>{e.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let e of i.querySelectorAll('dialog[data-gesture="dismiss-down"]'))t.push(on(e));return()=>t.forEach(e=>e())}var Ut,hn=D(()=>{Ut={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};cn()});var Xt={};bt(Xt,{destroyStickyManager:()=>Va,initStickyManager:()=>ti});function et(){let i=document.documentElement;if(!i.hasAttribute("data-sticky"))return;let t=document.querySelector("header");t&&!t.hasAttribute("data-sticky")&&(t.dataset.sticky="",Qe=!0);let e=document.querySelector("header[data-sticky]"),s=e?e.getBoundingClientRect().height:0;i.style.setProperty("--sticky-offset",`${s}px`)}function An(){et()}function ti(){if(Kt)return;Kt=!0,et(),requestAnimationFrame(et),document.fonts?.ready?.then(et),window.addEventListener("resize",et,{passive:!0}),document.addEventListener("toggle",An,!0),Ze=new ResizeObserver(et);let i=document.querySelector("header[data-sticky]");i&&Ze.observe(i)}function Va(){if(Kt){if(Kt=!1,window.removeEventListener("resize",et),document.removeEventListener("toggle",An,!0),Ze?.disconnect(),Qe){let i=document.querySelector("header[data-sticky]");i&&delete i.dataset.sticky,Qe=!1}document.documentElement.style.removeProperty("--sticky-offset")}}var Kt,Ze,Qe,kt=D(()=>{Kt=!1,Qe=!1});var Cn={};bt(Cn,{SoundManager:()=>za});var Sn,ei,za,kn=D(()=>{Sn="vb-sound",ei={enabled:!1,volume:.5},za={_ctx:null,_enabled:!1,_volume:.5,_initialized:!1,init(){if(this._initialized)return this;let i=this._load();return this._enabled=i.enabled,this._volume=i.volume,this._initialized=!0,this},_getContext(){return this._ctx||(this._ctx=new(window.AudioContext||window.webkitAudioContext)),this._ctx.state==="suspended"&&this._ctx.resume(),this._ctx},_load(){try{let i=localStorage.getItem(Sn);return i?{...ei,...JSON.parse(i)}:{...ei}}catch{return{...ei}}},_save(i){try{let t=this._load();localStorage.setItem(Sn,JSON.stringify({...t,...i}))}catch{}},_playTone(i,t,e="sine"){if(!this._enabled)return;let s=this._getContext(),n=s.createOscillator(),r=s.createGain();n.connect(r),r.connect(s.destination),n.frequency.value=i,n.type=e,r.gain.value=this._volume*.3,n.start(),r.gain.exponentialRampToValueAtTime(.01,s.currentTime+t),n.stop(s.currentTime+t)},enable(){this._enabled=!0,this._save({enabled:!0}),this.play("click")},disable(){this._enabled=!1,this._save({enabled:!1})},toggle(){return this._enabled?this.disable():this.enable(),this._enabled},isEnabled(){return this._enabled},setVolume(i){this._volume=Math.max(0,Math.min(1,i)),this._save({volume:this._volume})},getVolume(){return this._volume},play(i){if(this._enabled)switch(i){case"click":this._playTone(800,.1);break;case"success":this._playTone(523,.1),setTimeout(()=>this._playTone(659,.1),100),setTimeout(()=>this._playTone(784,.15),200);break;case"error":this._playTone(200,.15,"sawtooth"),setTimeout(()=>this._playTone(180,.2,"sawtooth"),150);break;case"notification":this._playTone(880,.1),setTimeout(()=>this._playTone(1100,.15),100);break;case"soft":this._playTone(600,.05);break;case"tick":this._playTone(1200,.02,"square");break}},getState(){return{enabled:this._enabled,volume:this._volume}}}});function Ua(i,t){if(!t)return i;let e=i??new URLSearchParams;for(let[s,n]of Object.entries(t))n!=null&&e.set(s,String(n));return e}async function Wa(i){if((i.headers.get("content-type")??"").includes("application/json"))try{return await i.json()}catch{return null}try{return await i.text()}catch{return null}}function xn(i){return i.endsWith("/")?i.slice(0,-1):i}var R,z,it,si=D(()=>{R={baseUrl:"/go",headers:{},services:{}},z=class extends Error{constructor(t,e,s,n){super(`VBService(${s}): ${t} ${n}`),this.name="VBServiceError",this.status=t,this.body=e,this.role=s,this.path=n}};it=class i{static configure(t={}){R={baseUrl:t.baseUrl??R.baseUrl,headers:{...R.headers,...t.headers??{}},services:{...R.services,...t.services??{}}}}static resolve(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");return R.services[t]?xn(R.services[t]):R.baseUrl?`${xn(R.baseUrl)}/${t}`:`/go/${t}`}static _reset(){R={baseUrl:"/go",headers:{},services:{}}}constructor(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");this.role=t}async get(t,e){return this.#e("GET",t,{params:e})}async post(t,e){return this.#e("POST",t,{body:e})}async patch(t,e){return this.#e("PATCH",t,{body:e})}async delete(t){return this.#e("DELETE",t,{})}async#e(t,e,s){let n=i.resolve(this.role),r=e?e.startsWith("/")?e:`/${e}`:"",a=new URL(`${n}${r}`,globalThis.location?.origin??"http://localhost"),o=Ua(a.searchParams,s.params);o&&(a.search=o.toString());let c={method:t,headers:{...R.headers}};s.body!==void 0&&(c.body=JSON.stringify(s.body),c.headers["content-type"]="application/json");let l=a.toString(),h=await fetch(l,c),d=await Wa(h);if(!h.ok)throw new z(h.status,d,this.role,`${r||"/"}`);return d}}});function Zt(i){let t=2166136261;for(let e=0;e<i.length;e++)t^=i.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Ka(){return"hn-"+crypto.randomUUID().slice(0,8)}function Dn(i,t){return getComputedStyle(i).getPropertyValue(`--highlight-${t}`).trim()}function Xa(i){if(rt){Tt++;return}rt=new CSSStyleSheet;let t=i.map(e=>`::highlight(hn-${e}) { background-color: var(--highlight-${e}); text-decoration-line: underline; text-decoration-color: var(--highlight-${e}); text-underline-offset: 2px; }`).join(`
|
|
2
|
+
`);rt.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,rt],Tt=1}function Ja(){Tt--,Tt<=0&&rt&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(i=>i!==rt),rt=null,Tt=0)}function Za(){return C||(C=document.createElement("div"),C.className="hn-toolbar",C.setAttribute("role","toolbar"),C.setAttribute("aria-label","Highlight tools"),C.setAttribute("popover","auto"),C.hidden=!0,document.body.appendChild(C),C.addEventListener("toggle",i=>{i.newState==="closed"&&(C.hidden=!0,Qt=null)}),C)}function ai(i,t,e){let s=Za();s.innerHTML="",Qt=t;let n=t.colors,r=t.element,a=e?.color,o=document.createElement("div");if(o.className="hn-swatches",o.setAttribute("role","group"),o.setAttribute("aria-label","Highlight colors"),n.forEach((c,l)=>{let h=document.createElement("button");h.type="button",h.className="hn-swatch",h.dataset.color=c,h.setAttribute("aria-label",`Highlight ${c}${a===c?" (current)":""}`),h.setAttribute("tabindex",l===0?"0":"-1");let d=Dn(r,c);d&&(h.style.backgroundColor=d),a===c&&h.setAttribute("aria-pressed","true"),h.addEventListener("click",()=>{e?t._changeColor(e.id,c):t._createFromSelection(c),xt()}),o.appendChild(h)}),s.appendChild(o),e){let c=document.createElement("span");c.className="hn-separator",c.setAttribute("aria-hidden","true"),s.appendChild(c);let l=document.createElement("button");l.type="button",l.className="hn-action",l.textContent=e.note?"Edit Note":"Add Note",l.addEventListener("click",()=>{_n(t,e),xt()}),s.appendChild(l);let h=document.createElement("button");h.type="button",h.className="hn-action hn-action-remove",h.textContent="Remove",h.addEventListener("click",()=>{t.removeHighlight(e.id),xt()}),s.appendChild(h)}o.addEventListener("keydown",c=>{let l=[...o.querySelectorAll("button")],h=l.indexOf(document.activeElement);if(h<0)return;let d=-1;if(c.key==="ArrowRight"||c.key==="ArrowDown")c.preventDefault(),d=(h+1)%l.length;else if(c.key==="ArrowLeft"||c.key==="ArrowUp")c.preventDefault(),d=(h-1+l.length)%l.length;else if(c.key==="Escape"){xt();return}d>=0&&(l[h].setAttribute("tabindex","-1"),l[d].setAttribute("tabindex","0"),l[d].focus())}),s.hidden=!1;try{s.showPopover()}catch{}Qa(i),requestAnimationFrame(()=>{let c=s.querySelector(".hn-swatch");c&&c.focus()})}function _n(i,t){nt();let e=i.element,s=st(e,t.startOffset,t.endOffset);if(!s)return;M=document.createElement("div"),M.className="hn-note-panel",M.setAttribute("role","dialog"),M.setAttribute("aria-label","Private note");let n=document.createElement("header");n.className="hn-note-header",n.innerHTML="<small>PRIVATE NOTE</small>",M.appendChild(n);let r=document.createElement("blockquote");r.className="hn-note-quote",r.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,M.appendChild(r);let a=document.createElement("textarea");a.className="hn-note-textarea",a.placeholder="Add a note\u2026",a.value=t.note||"",a.rows=3,a.setAttribute("aria-label","Note for highlighted text"),M.appendChild(a);let o=document.createElement("footer");o.className="hn-note-actions";let c=document.createElement("button");c.type="button",c.className="hn-action hn-action-save",c.textContent="Save",c.addEventListener("click",()=>{i._updateNote(t.id,a.value.trim()),nt()});let l=document.createElement("button");l.type="button",l.className="hn-action",l.textContent="Cancel",l.addEventListener("click",()=>nt()),o.append(c,l),M.appendChild(o),a.addEventListener("keydown",u=>{u.key==="Escape"&&(u.preventDefault(),nt()),u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),i._updateNote(t.id,a.value.trim()),nt())}),e.style.position="relative",e.appendChild(M);let h=s.getClientRects()[0],d=e.getBoundingClientRect();if(h){let u=h.top-d.top;M.style.top=`${u}px`}requestAnimationFrame(()=>{a.focus(),document.addEventListener("pointerdown",qn)})}function qn(i){M&&!M.contains(i.target)&&nt()}function nt(){M&&(document.removeEventListener("pointerdown",qn),M.remove(),M=null)}function Qa(i){C&&requestAnimationFrame(()=>{let t=C.getBoundingClientRect(),e=t.width||200,s=t.height||40,n=i.top-s-Ln,r=i.left+i.width/2-e/2;n<ri&&(n=i.bottom+Ln);let a=window.innerWidth-e-ri;r=Math.max(ri,Math.min(r,a)),C.style.top=`${n}px`,C.style.left=`${r}px`})}function xt(){if(C){try{C.hidePopover()}catch{}C.hidden=!0,Qt=null}}function oi(i){K||(K=document.createElement("div"),K.setAttribute("aria-live","polite"),K.setAttribute("aria-atomic","true"),K.className="hn-sr-only",document.body.appendChild(K)),K.textContent="",requestAnimationFrame(()=>{K.textContent=i})}function Mn(i,t,e){let s=document.createTreeWalker(i,NodeFilter.SHOW_TEXT),n=0;for(;s.nextNode();){if(s.currentNode===t)return n+e;n+=(s.currentNode.textContent??"").length}return-1}function st(i,t,e){let s=document.createTreeWalker(i,NodeFilter.SHOW_TEXT),n=0,r=null,a=0,o=null,c=0;for(;s.nextNode();){let l=s.currentNode,h=(l.textContent??"").length;if(!r&&n+h>t&&(r=l,a=t-n),n+h>=e){o=l,c=e-n;break}n+=h}if(!r||!o)return null;try{let l=document.createRange();return l.setStart(r,Math.min(a,(r.textContent??"").length)),l.setEnd(o,Math.min(c,(o.textContent??"").length)),l}catch{return null}}function di(i){if(ci.has(i))return ci.get(i);let t=new hi(i);return ci.set(i,t),t}function Nn(i=document){i.querySelectorAll(li).forEach(t=>{t.hasAttribute("data-highlights-init")||di(t)})}var li,Tn,Ya,Ln,ri,Ga,rt,Tt,C,Qt,M,K,hi,ci,to,$n=D(()=>{W();li="[data-highlights]",Tn="highlights",Ya=["yellow","green","blue","pink"],Ln=8,ri=8,Ga=typeof CSS<"u"&&"highlights"in CSS;rt=null,Tt=0;C=null,Qt=null;M=null;K=null;hi=class{#e;#t;#i;#n;#s=[];#r=!Ga;#a;#c;#o=!1;#p=[];constructor(t){this.#e=t,this.#n=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#t=e&&e!==""?e:location.pathname;let s=t.dataset.highlightsColors;this.#i=s?s.split(",").map(n=>n.trim()).filter(Boolean):[...Ya],this.#r||Xa(this.#i),this.#m(),this.#n||(this.#a=this.#h.bind(this),this.#c=this.#f.bind(this),t.addEventListener("pointerup",this.#a),t.addEventListener("click",this.#c)),t.setAttribute("data-highlights-init",""),this.#l().then(()=>{this.#o||this.#m()})}get colors(){return[...this.#i]}get element(){return this.#e}getHighlights(){return this.#s.map(t=>({...t}))}removeHighlight(t){let e=this.#s.findIndex(s=>s.id===t);e<0||(this.#s.splice(e,1),this.#u(),this.#m(),this.#y("highlights:removed",{id:t}),oi("Highlight removed"))}clearAll(){this.#s=[],this.#u(),this.#m()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#s})}importHighlights(t){try{let e=typeof t=="string"?JSON.parse(t):t;if(!e.highlights||!Array.isArray(e.highlights))return;this.#s=e.highlights,this.#u(),this.#m()}catch{}}destroy(){if(!this.#o){if(this.#o=!0,this.#a&&this.#e.removeEventListener("pointerup",this.#a),this.#c&&this.#e.removeEventListener("click",this.#c),this.#r)this.#e.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()});else{for(let t of this.#i)CSS.highlights.delete(`hn-${t}`);Ja()}this.#A(),this.#e.removeAttribute("data-highlights-init"),Qt===this&&xt(),nt()}}#h(){requestAnimationFrame(()=>{if(this.#o||this.#e.hasAttribute("data-selection-menu"))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);if(!this.#e.contains(e.commonAncestorContainer))return;let s=e.getBoundingClientRect();ai(s,this,null)})}#f(t){if(this.#e.hasAttribute("data-selection-menu"))return;let e=t.target.closest?.(".hn-margin-annotation");if(e){let n=e.dataset.hnId,r=this.#s.find(a=>a.id===n);if(r){_n(this,r);return}}let s=t.target.closest?.("mark[data-hn-id]");if(s){let n=s.dataset.hnId,r=this.#s.find(a=>a.id===n);if(r){this.#y("highlights:clicked",{id:n});let a=s.getBoundingClientRect();ai(a,this,r);return}}if(!this.#r){let n=this.#d(t.clientX,t.clientY);if(n){this.#y("highlights:clicked",{id:n.id});let r=st(this.#e,n.startOffset,n.endOffset);r&&ai(r.getBoundingClientRect(),this,n)}}}#d(t,e){for(let s of this.#s){let n=st(this.#e,s.startOffset,s.endOffset);if(!n)continue;let r=n.getClientRects();for(let a of r)if(t>=a.left&&t<=a.right&&e>=a.top&&e<=a.bottom)return s}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let s=e.getRangeAt(0);if(!this.#e.contains(s.commonAncestorContainer))return;let n=Mn(this.#e,s.startContainer,s.startOffset),r=Mn(this.#e,s.endContainer,s.endOffset);if(n<0||r<0||n>=r)return;let a=e.toString().trim(),o={id:Ka(),startOffset:n,endOffset:r,text:a,color:t,note:"",created:Date.now()};this.#s.push(o),this.#u(),this.#m(),e.removeAllRanges(),this.#y("highlights:added",{id:o.id,text:a,color:t,note:""}),oi("Highlight added")}_changeColor(t,e){let s=this.#s.find(n=>n.id===t);s&&(s.color=e,this.#u(),this.#m())}_updateNote(t,e){let s=this.#s.find(n=>n.id===t);s&&(s.note=e,this.#u(),this.#b(),this.#y("highlights:note-changed",{id:t,note:e}),oi("Note saved"))}async#l(){let t=await w.get(Tn,this.#t);if(!t||!Array.isArray(t.highlights))return;let e=Zt(this.#e.textContent);t.contentHash&&t.contentHash!==e?(this.#s=t.highlights.filter(s=>{let n=st(this.#e,s.startOffset,s.endOffset);return n?n.toString().trim()===s.text:!1}),this.#u()):this.#s=t.highlights}#u(){let t={version:1,contentHash:Zt(this.#e.textContent),highlights:this.#s};w.set(Tn,this.#t,t).catch(()=>{})}#m(){this.#r?this.#v():this.#g(),this.#b()}#g(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#s){let s=st(this.#e,e.startOffset,e.endOffset);s&&t.has(e.color)&&t.get(e.color).push(s)}for(let[e,s]of t){let n=`hn-${e}`;s.length===0?CSS.highlights.delete(n):CSS.highlights.set(n,new Highlight(...s))}}#v(){this.#e.querySelectorAll("mark[data-hn-id]").forEach(e=>{let s=e.parentNode;for(;e.firstChild;)s.insertBefore(e.firstChild,e);s.removeChild(e)}),this.#e.normalize();let t=[...this.#s].sort((e,s)=>s.startOffset-e.startOffset);for(let e of t){let s=st(this.#e,e.startOffset,e.endOffset);if(!s)continue;let n=Dn(this.#e,e.color),r=document.createElement("mark");r.dataset.hnId=e.id,r.dataset.hnColor=e.color,n&&(r.style.backgroundColor=n,r.style.textDecorationColor=n);try{s.surroundContents(r)}catch{let a=s.extractContents();r.appendChild(a),s.insertNode(r)}}}#A(){for(let t of this.#p)t.remove();this.#p=[]}#b(){if(this.#A(),this.#s.length===0)return;getComputedStyle(this.#e).position==="static"&&(this.#e.style.position="relative");for(let e of this.#s){let s=st(this.#e,e.startOffset,e.endOffset);if(!s)continue;let n=s.getClientRects();if(n.length===0)continue;let r=n[0],a=this.#e.getBoundingClientRect(),o=r.top-a.top,c=document.createElement("span");c.className="hn-margin-annotation",c.dataset.hnId=e.id,c.setAttribute("aria-hidden","true"),c.style.top=`${o}px`,e.note?(c.innerHTML='<span class="hn-note-indicator">*</span> You highlighted',c.classList.add("hn-has-note")):c.textContent="You highlighted",this.#e.appendChild(c),this.#p.push(c)}}#y(t,e={}){this.#e.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}},ci=new WeakMap;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Nn()):Nn();to=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(li)&&di(s),s.querySelectorAll(li).forEach(n=>{n.hasAttribute("data-highlights-init")||di(n)})}});to.observe(document.documentElement,{childList:!0,subtree:!0})});var yi={};bt(yi,{currentHash:()=>gi,initPageWatch:()=>mi,readWatch:()=>te,removeWatch:()=>In,writeWatch:()=>Lt});function On(){return typeof window<"u"&&window.vbPageWatch?.serverSync===!0?!0:document.querySelector('meta[name="vb-page-watch-server"]')?.getAttribute("content")==="true"}async function eo(i){if(!On())return null;try{let t=new it("notify"),e={url:i.url,type:"page-watch",notify:["panel"]},s=await t.post("/subscribe",e);return typeof s?.id=="string"?s.id:null}catch(t){let e=t instanceof z?`${t.status}`:String(t);return console.warn("[page-watch] server subscribe failed; client-only watch in effect.",e),null}}async function io(i){if(!(!i||!On()))try{await new it("notify").delete(`/subscribe/${encodeURIComponent(i)}`)}catch(t){let e=t instanceof z?`${t.status}`:String(t);console.warn("[page-watch] server unsubscribe failed; local state already cleared.",e)}}function so(){return document.querySelector("main")||document.querySelector("article")||document.body}function Mt(){return location.pathname||"/"}function gi(){let i=so();return i?Zt(i.textContent||""):""}function no(){return document.title||Mt()}async function te(){return await w.get(bi,Mt())}async function Lt(i){await w.set(bi,Mt(),i)}async function In(){await w.remove(bi,Mt())}function ui(i,t){i.setAttribute("aria-pressed",t?"true":"false"),i.dataset.watching="",t||delete i.dataset.watching;let e=i.querySelector("icon-wc");e&&e.setAttribute("name",t?"bookmark-check":"bookmark");let s=[...i.childNodes].find(n=>n.nodeType===Node.TEXT_NODE&&(n.textContent||"").trim());s&&!i.hasAttribute("data-watch-label-locked")&&(s.textContent=t?"Watching":"Watch for updates"),i.setAttribute("title",t?"Stop watching this page":"Watch this page for content updates")}async function fi(i){if(i.hasAttribute("data-watch-page-init"))return;i.setAttribute("data-watch-page-init",""),i.setAttribute("type",i.getAttribute("type")||"button");let t=await te();ui(i,!!t),i.addEventListener("click",async e=>{e.preventDefault();let s=await te();if(s)await In(),ui(i,!1),i.dispatchEvent(new CustomEvent("page-watch:remove",{bubbles:!0,composed:!0,detail:{url:s.url,subscriptionId:s.subscriptionId}})),io(s.subscriptionId);else{let n={url:Mt(),title:no(),contentHash:gi(),watchedAt:new Date().toISOString(),lastChecked:new Date().toISOString(),lastChanged:null,subscriptionId:null};await Lt(n),ui(i,!0),i.dispatchEvent(new CustomEvent("page-watch:add",{bubbles:!0,composed:!0,detail:{entry:n}}));let r=await eo(n);r&&await Lt({...n,subscriptionId:r})}})}async function ro(){let i=await te();if(!i)return;let t=gi(),e=new Date().toISOString(),s=i.contentHash,n={...i,lastChecked:e};if(t&&t!==s){n.contentHash=t,n.lastChanged=e,await Lt(n);let r={id:`page-watch:${i.url}:${t}`,type:"watch",title:`Updated: ${i.title}`,body:"Content changed since your last visit.",url:i.url,date:e,read:!1,dismissed:!1,priority:"normal"};document.dispatchEvent(new CustomEvent("notification-wc:new",{bubbles:!0,composed:!0,detail:{notification:r}}))}else await Lt(n)}function mi(i=document){for(let t of i.querySelectorAll(pi))fi(t);ro()}var pi,bi,ao,vi=D(()=>{W();si();$n();pi="[data-watch-page]",bi="watches";document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>mi()):mi();ao=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches?.(pi)&&fi(s),s.querySelectorAll?.(pi).forEach(n=>fi(n))}});ao.observe(document.documentElement,{childList:!0,subtree:!0})});function pe(i){try{if(sessionStorage.getItem("vb_optout")==="1")return!0}catch{}if(navigator.globalPrivacyControl===!0||navigator.doNotTrack==="1")return!0;if(typeof i.consent=="function")try{return i.consent()===!1}catch{return!0}return!1}function Or(i){return i?.closest?.("[data-vb-no-track]")!=null}function Gc(){let{dataset:i}=document.documentElement,t={};for(let e of Object.keys(i)){let s=i[e];s!=null&&s!==""&&(t[e]=s)}return t}function Kc(){let i={};for(let e of document.querySelectorAll('meta[name^="vb:"]')){let s=e.getAttribute("name").slice(3),n=e.getAttribute("content")?.trim();s&&n&&(i[s]=n)}let t=[];for(let e of document.querySelectorAll('meta[name="concept"]')){let s=e.getAttribute("content")?.trim();s&&t.push(s)}return t.length&&(i.concepts=t),i}function Xc(i,t){if(!t?.length)return i;for(let{pattern:e,replace:s}of t)if(e.test(i))return i.replace(e,s);return i}function Jc(i,t){let e=JSON.stringify(t);if(typeof navigator.sendBeacon=="function"){let s=new Blob([e],{type:"application/json"});if(navigator.sendBeacon(i,s))return!0}try{return fetch(i,{method:"POST",body:e,keepalive:!0,headers:{"content-type":"application/json"}}),!0}catch{return!1}}function Ir(i){return`${(A.config?.endpoint??"/api/analytics").replace(/\/+$/,"")}/${i}`}function gs(i,t){let e=A.config,s=Xc(location.pathname+location.search,e.urlMasks),n=typeof e.context=="function"?e.context()??{}:{};return{name:i,ts:Date.now(),site:e.siteId,path:s,referrer:document.referrer||"",context:{...Gc(),...Kc(),...n},props:t??{}}}function fe(i,t){let e=A.config;return!e||e.transport==="disabled"?!1:e.transport==="console"?(console.log("%c[vb:analytics]","color:#0aa;font-weight:600",i,t),!0):Jc(Ir(i),t)}function Pr(){let i=A.config?.sampleRate??1;return i>=1?!0:Math.random()<i}function Br(){if(!A.config||pe(A.config)||document.documentElement.hasAttribute("data-vb-no-track")||!Pr())return;let i=location.pathname+location.search;i!==qr&&(qr=i,fe("hit",gs("page.view",{})))}function Zc(){let i,t=()=>{clearTimeout(i),i=setTimeout(Br,100)},e=history.pushState.bind(history);history.pushState=function(...n){e(...n),t()};let s=history.replaceState.bind(history);history.replaceState=function(...n){s(...n),t()},window.addEventListener("popstate",t)}function Qc(i){let t={};for(let[e,s]of Object.entries(i.dataset)){if(e==="vbEvent"||!e.startsWith("vbEvent"))continue;let n=e.slice(7).replace(/^./,r=>r.toLowerCase());t[n]=s}return t}function tl(i){if(!A.config||pe(A.config))return;let t=i.target.closest?.("[data-vb-event]");if(!t||Or(t))return;let e=t.dataset.vbEvent;e&&g.track(e,Qc(t))}function $r(){let i=document.querySelectorAll('a[href^="http"]');for(let t of i){if(t.hostname===location.hostname||Or(t)||t.hasAttribute("data-vb-analytics-wired"))continue;let e=encodeURIComponent(A.config?.siteId??"default"),s=`${Ir("click")}?site=${e}&from=${encodeURIComponent(location.pathname)}`;t.hasAttribute("ping")||t.setAttribute("ping",s),t.addEventListener("click",()=>{if(pe(A.config))return;let n=navigator.userAgent;/Firefox|Brave/.test(n)&&fe("click",gs("link.outbound",{to:t.hostname,href:t.href}))}),t.setAttribute("data-vb-analytics-wired","")}}function bs(){if(!A.queue.length)return;let i=A.queue.splice(0);fe("events",{site:A.config?.siteId,events:i})}function el(){document.visibilityState==="hidden"&&bs()}function sl(){try{return window.top!==window.self}catch{return!0}}var A,qr,il,g,ot=D(()=>{A={config:null,queue:[]};qr=null;il={endpoint:"/api/analytics",siteId:"default",transport:"disabled",sampleRate:1,consent:null,context:null,urlMasks:null,autoPageView:!0,autoOutboundLinks:!0,autoDeclarative:!0,allowInIframe:!1};g={init(i={}){if(!A.config){if(A.config={...il,...i},sl()&&!A.config.allowInIframe){A.config.transport="disabled",A.config.autoPageView=!1,A.config.autoOutboundLinks=!1,A.config.autoDeclarative=!1;return}A.config.transport==="disabled"&&(A.config.autoOutboundLinks=!1),A.config.autoDeclarative&&document.addEventListener("click",tl,{capture:!0}),A.config.autoOutboundLinks&&($r(),new MutationObserver(()=>$r()).observe(document.body,{childList:!0,subtree:!0})),A.config.autoPageView&&(Br(),Zc()),document.addEventListener("visibilitychange",el),window.addEventListener("pagehide",bs)}},track(i,t={}){A.config&&(pe(A.config)||Pr()&&fe("hit",gs(i,t)))},flush:bs,setConsent(i){try{i?sessionStorage.removeItem("vb_optout"):sessionStorage.setItem("vb_optout","1")}catch{}},get config(){return A.config?{...A.config}:null}}});var dl={};function ol(i,t,e){return i<=t?"good":i<=e?"needs-improvement":"poor"}function me(i,t,e,s,n={}){g.track(i,{value:Math.round(t*1e3)/1e3,rating:ol(t,e,s),...n})}function cl(){let i=null,t=new PerformanceObserver(s=>{let n=s.getEntries();i=n[n.length-1]});try{t.observe({type:"largest-contentful-paint",buffered:!0})}catch{return}let e=()=>{i&&(me("perf.lcp",i.startTime,2500,4e3),i=null)};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()}),window.addEventListener("pagehide",e)}function ll(){let i=0,t=new PerformanceObserver(s=>{for(let n of s.getEntries())n.hadRecentInput||(i+=n.value)});try{t.observe({type:"layout-shift",buffered:!0})}catch{return}let e=()=>{me("perf.cls",i,.1,.25),i=0};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()}),window.addEventListener("pagehide",e)}function hl(){let i=0,t=new PerformanceObserver(s=>{for(let n of s.getEntries())n.duration>i&&(i=n.duration)});try{t.observe({type:"event",durationThreshold:40,buffered:!0})}catch{return}let e=()=>{i!==0&&(me("perf.inp",i,200,500),i=0)};document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&e()}),window.addEventListener("pagehide",e)}function Vr(){try{let[i]=performance.getEntriesByType("navigation");if(!i||!i.responseStart)return;me("perf.ttfb",i.responseStart,800,1800,{navigationType:i.type})}catch{}}var zr=D(()=>{ot();typeof window<"u"&&"PerformanceObserver"in window&&(cl(),ll(),hl(),document.readyState==="complete"?Vr():window.addEventListener("load",Vr,{once:!0}))});var pl={};function ul(i){if(typeof i!="string"||!i)return"";try{let t=new URL(i,location.origin);return t.pathname.split("/").pop()||t.pathname}catch{return i.split("/").pop()??i}}function Ur(i){return typeof i!="string"?String(i??"").slice(0,vs):i.length>vs?i.slice(0,vs):i}var vs,Wr=D(()=>{ot();vs=200;typeof window<"u"&&(window.addEventListener("error",i=>{i.target&&i.target!==window||g.track("error.js_runtime",{message:Ur(i.message),source:ul(i.filename),line:i.lineno??0,col:i.colno??0})}),window.addEventListener("unhandledrejection",i=>{let t=i.reason,e=t instanceof Error?t.message:typeof t=="string"?t:JSON.stringify(t??null);g.track("error.unhandled_promise",{message:Ur(e)})}))});var ml={};function Xr(){let i=window.scrollY+window.innerHeight,t=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0);return t<=0?0:Math.min(100,Math.max(0,Math.round(i/t*100)))}function fl(){clearTimeout(Yr),Yr=setTimeout(()=>{let i=Xr();i>ws&&(ws=i)},500)}function Gr(){It==null&&(It=Date.now())}function Jr(){It!=null&&(Es+=Date.now()-It,It=null)}function Kr(){if(jr)return;jr=!0,Jr();let i=Math.max(ws,Xr());i>0&&g.track("__scroll",{depth:i}),Es>0&&g.track("__attention",{ms:Es})}var ws,It,Es,jr,Yr,Zr=D(()=>{ot();ws=0,It=null,Es=0,jr=!1,Yr=null;typeof window<"u"&&(window.addEventListener("scroll",fl,{passive:!0}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?Gr():(Jr(),Kr())}),window.addEventListener("pagehide",Kr),document.visibilityState==="visible"&&Gr())});var ta={};bt(ta,{WizardController:()=>be,initWizards:()=>Ss});function As(i){if(i.hasAttribute("data-wizard-enhanced"))return;let t=new be(i);i.wizardController=t,i.wizardGoTo=e=>t.goTo(e),i.wizardNext=()=>t.next(),i.wizardPrev=()=>t.prev(),i.wizardReset=()=>t.reset()}function Ss(){document.querySelectorAll("form[data-wizard]").forEach(i=>{As(i)})}function Qr(){new MutationObserver(t=>{for(let e of t)for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.matches("form[data-wizard]")&&As(n),n.querySelectorAll?.("form[data-wizard]:not([data-wizard-enhanced])").forEach(r=>{As(r)})}}).observe(document.documentElement,{childList:!0,subtree:!0})}var be,ea=D(()=>{be=class{#e;#t=[];#i=0;#n=null;#s=null;#r=null;#a=!1;#c="step";#o=null;#p="";#h=0;#f=0;constructor(t){if(!t||!(t instanceof HTMLFormElement))throw new Error("WizardController requires a form element");this.#e=t,this.#d()}#d(){if(this.#t=Array.from(this.#e.querySelectorAll("fieldset[data-wizard-step]")),this.#t.length===0){console.warn("Wizard form has no steps");return}this.#a=this.#e.hasAttribute("data-wizard-history"),this.#c=this.#e.getAttribute("data-wizard-validate")||"step",this.#l(),this.#n=this.#e.querySelector("[data-wizard-progress]"),this.#y(),this.#w(),this.#b(),this.#e.setAttribute("data-wizard-enhanced",""),this.#e.setAttribute("data-wizard-total",String(this.#t.length)),this.#$(),this.#S(),this.#D();let t=()=>{cancelAnimationFrame(this.#h),this.#h=requestAnimationFrame(()=>this.#M())};if(this.#e.addEventListener("change",t),this.#e.addEventListener("input",t),this.#o&&(this.#e.addEventListener("change",()=>this.#m()),this.#e.addEventListener("input",()=>this.#m())),this.#e.addEventListener("submit",e=>this.#A(e)),this.#e.addEventListener("reset",()=>{requestAnimationFrame(()=>this.reset())}),this.#a){let e=this.#q();e!==null&&e>=0&&e<this.#t.length&&(this.#i=e),window.addEventListener("hashchange",()=>{let s=this.#q();s!==null&&s!==this.#i&&this.goTo(s)})}this.#g(),this.#M(),this.#_()}#l(){let t=this.#e.getAttribute("data-wizard-persist");if(t){if(!this.#e.id){console.warn("Wizard persistence requires an id on the form element");return}this.#p=`vb-wizard:${this.#e.id}`,t==="local"?this.#o=localStorage:this.#o=sessionStorage}}#u(){if(!this.#o)return;let t={},e=new FormData(this.#e);for(let[s,n]of e.entries())t[s]!==void 0?(Array.isArray(t[s])||(t[s]=[t[s]]),t[s].push(n)):t[s]=n;try{this.#o.setItem(this.#p,JSON.stringify({step:this.#i,data:t}))}catch{}}#m(){this.#o&&(cancelAnimationFrame(this.#f),this.#f=requestAnimationFrame(()=>this.#u()))}#g(){if(this.#o)try{let t=this.#o.getItem(this.#p);if(!t)return;let e=JSON.parse(t);if(!e||typeof e!="object")return;if(e.data&&typeof e.data=="object")for(let[s,n]of Object.entries(e.data)){let r=this.#e.elements.namedItem(s);if(r)if(r instanceof RadioNodeList)r.value=n;else if(r instanceof HTMLInputElement)if(r.type==="checkbox"){let a=Array.isArray(n)?n:[n];r.checked=a.includes(r.value||"on")}else r.type==="radio"?r.checked=r.value===n:r.value=n;else(r instanceof HTMLSelectElement||r instanceof HTMLTextAreaElement)&&(r.value=n)}typeof e.step=="number"&&e.step>=0&&e.step<this.#t.length&&(this.#i=e.step)}catch{}}#v(){this.#o&&this.#o.removeItem(this.#p)}#A(t){let e=this.#k();this.#i===e.length-1&&(this.#z("wizard:complete"),this.#v())}#b(){this.#s=document.createElement("div"),this.#s.setAttribute("role","status"),this.#s.setAttribute("aria-live","polite"),this.#s.setAttribute("aria-atomic","true"),this.#s.setAttribute("data-wizard-status",""),this.#e.prepend(this.#s)}#y(){let t=this.#e.getAttribute("data-wizard-steps");if(t){this.#r=document.querySelector(t);return}this.#r=this.#e.querySelector("nav.steps")}#w(){if(!this.#r)return;let t=this.#r.querySelector("ol");if(!(!t||t.children.length>0))for(let e of this.#t){let s=e.querySelector("legend"),n=document.createElement("li");n.textContent=s?.textContent||`Step ${this.#t.indexOf(e)+1}`,t.appendChild(n)}}#P(){if(!this.#r)return;let t=Array.from(this.#r.querySelectorAll("ol > li")),e=this.#k(),s=0;for(let n=0;n<this.#t.length;n++){let r=this.#t[n],a=t[s];if(!a)break;if(r.hasAttribute("data-wizard-hidden")){a.setAttribute("hidden","");continue}else a.removeAttribute("hidden");let o=e.indexOf(r);if(a.removeAttribute("data-completed"),a.removeAttribute("aria-current"),a.removeAttribute("aria-disabled"),o<this.#i){a.setAttribute("data-completed",""),this.#N(a,o);let c=a.querySelector("a");if(c){let h=r.querySelector("legend")?.textContent||`Step ${o+1}`;c.setAttribute("aria-label",`Go to ${h} (completed)`)}}else o===this.#i?a.setAttribute("aria-current","step"):a.setAttribute("aria-disabled","true");s++}for(let n of t){if(n.hasAttribute("hidden"))continue;let r=n.querySelector("a, button")||n,a=n.hasAttribute("aria-current");r.setAttribute("tabindex",a?"0":"-1")}}#N(t,e){if(t.hasAttribute("data-wizard-nav-bound"))return;t.setAttribute("data-wizard-nav-bound","");let s=t.querySelector("a, button")||t;s.addEventListener("click",n=>{n.preventDefault(),this.goTo(e)}),s===t&&!t.getAttribute("tabindex")&&(t.setAttribute("tabindex","0"),t.setAttribute("role","button"),t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this.goTo(e))}))}#S(){let t=this.#e.querySelector("[data-wizard-prev]"),e=this.#e.querySelector("[data-wizard-next]");t?.addEventListener("click",s=>{s.preventDefault(),this.prev()}),e?.addEventListener("click",s=>{s.preventDefault(),this.next()})}#$(){if(this.#e.querySelector("[data-wizard-nav]"))return;let t=document.createElement("nav");t.setAttribute("data-wizard-nav","");let e=document.createElement("button");e.type="button",e.setAttribute("data-wizard-prev",""),e.textContent="Back";let s=document.createElement("button");s.type="button",s.setAttribute("data-wizard-next",""),s.textContent="Next";let n=document.createElement("button");n.type="submit",n.textContent="Submit",t.append(e,s,n),this.#e.appendChild(t)}#D(){this.#r&&this.#r.addEventListener("keydown",t=>{let e=Array.from(this.#r.querySelectorAll("ol > li:not([hidden])")),s=t.target.closest("li"),n=e.indexOf(s);if(n===-1)return;let r;switch(t.key){case"ArrowRight":case"ArrowDown":r=Math.min(n+1,e.length-1);break;case"ArrowLeft":case"ArrowUp":r=Math.max(n-1,0);break;case"Home":r=0;break;case"End":r=e.length-1;break;default:return}t.preventDefault();let a=e[n].querySelector("a, button")||e[n],o=e[r].querySelector("a, button")||e[r];a.setAttribute("tabindex","-1"),o.setAttribute("tabindex","0"),o.focus()})}#k(){return this.#t.filter(t=>!t.hasAttribute("data-wizard-hidden"))}#O(){return this.#k()[this.#i]}#_(){let t=this.#k();this.#t.forEach(n=>{n.removeAttribute("data-wizard-active")});let e=t[this.#i];e&&e.setAttribute("data-wizard-active","");let s=this.#i+1;this.#e.setAttribute("data-wizard-current",String(s)),this.#e.setAttribute("data-wizard-total",String(t.length)),this.#i===t.length-1?this.#e.setAttribute("data-wizard-last",""):this.#e.removeAttribute("data-wizard-last"),this.#F(),this.#P(),this.#a&&this.#T(),this.#L(),this.#C()}#F(){if(!this.#n)return;let t=this.#k();this.#n.max=t.length,this.#n.value=this.#i+1}#T(){let t=`#step=${this.#i+1}`;window.location.hash!==t&&history.replaceState(null,"",t)}#q(){let e=window.location.hash.match(/step=(\d+)/);return e?parseInt(e[1],10)-1:null}#L(){if(!this.#s)return;let s=this.#O()?.querySelector("legend")?.textContent||`Step ${this.#i+1}`,n=this.#k();this.#s.textContent=`Now on step ${this.#i+1} of ${n.length}: ${s}`}#x(){if(this.#c==="none")return!0;let t=this.#O();if(!t||t.hasAttribute("data-wizard-optional"))return!0;let e=t.querySelectorAll("input, select, textarea"),s=!0;for(let n of e){let r=n;if(!r.checkValidity()){r.reportValidity(),s=!1;break}}return s}#M(){this.#t.forEach(e=>{let s=e.getAttribute("data-wizard-if");if(!s)return;this.#B(s)?e.removeAttribute("data-wizard-hidden"):e.setAttribute("data-wizard-hidden","")});let t=this.#k();this.#i>=t.length&&(this.#i=Math.max(0,t.length-1)),this.#_()}#B(t){return t.includes("||")?t.split("||").some(e=>this.#B(e.trim())):t.includes("&&")?t.split("&&").every(e=>this.#V(e.trim())):this.#V(t)}#V(t){let e=t.startsWith("!"),s=e?t.slice(1):t;if(s.includes(":")){let[o,c]=s.split(":"),l=c.startsWith("!"),h=l?c.slice(1):c,d=this.#E(o);return l?d!==h:d===h}let a=!!this.#E(s);return e?!a:a}#E(t){let e=this.#e.elements.namedItem(t);return e?e instanceof RadioNodeList?e.value:e instanceof HTMLInputElement?e.type==="checkbox"?e.checked?e.value||"true":"":e.value:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?e.value:"":""}#C(){let t=this.#O();if(!t||!t.hasAttribute("data-wizard-summary"))return;let e=t.querySelectorAll("[data-wizard-field]");if(e.length>0){for(let r of e){let a=r.getAttribute("data-wizard-field");r.textContent=this.#E(a)||"\u2014"}return}let s=t.querySelector("[data-wizard-summary-list]");s||(s=document.createElement("dl"),s.setAttribute("data-wizard-summary-list",""),t.appendChild(s)),s.innerHTML="";let n=new Set;for(let r of this.#t){if(r===t||r.hasAttribute("data-wizard-hidden"))continue;let a=r.querySelectorAll("input, select, textarea");for(let o of a){let c=o.name;if(!c||n.has(c))continue;n.add(c);let l=this.#E(c);if(!l)continue;let h=this.#R(o),d=document.createElement("dt");d.textContent=h||c;let u=document.createElement("dd");u.textContent=l,s.append(d,u)}}}#R(t){if(t.id){let n=this.#e.querySelector(`label[for="${CSS.escape(t.id)}"]`);if(n)return n.textContent.trim()}let e=t.closest("label");if(e){let n=e.cloneNode(!0);n.querySelectorAll("input, select, textarea").forEach(a=>a.remove());let r=n.textContent.trim();if(r)return r}let s=t.closest("form-field");if(s){let n=s.querySelector("label");if(n)return n.textContent.trim()}return""}#z(t,e={}){this.#e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))}goTo(t){let e=this.#k();if(t<0||t>=e.length||t>this.#i&&!this.#x())return!1;let s=this.#i;return this.#i=t,this.#_(),this.#z("wizard:step-change",{from:s,to:t}),this.#m(),!0}next(){let t=this.#k();return this.#i>=t.length-1?!1:this.goTo(this.#i+1)}prev(){return this.#i<=0?!1:this.goTo(this.#i-1)}reset(){this.#i=0,this.#_(),this.#v(),this.#z("wizard:reset")}get currentStep(){return this.#i}get totalSteps(){return this.#k().length}get form(){return this.#e}};typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Ss(),Qr()}):(Ss(),Qr()))});var J=new Map,ge=new Map;var $s=null;function Os(){if(typeof window<"u"&&window.__VB_THEME_BASE)return String(window.__VB_THEME_BASE).replace(/\/$/,"");if($s)return $s;if(typeof document<"u"){let i=document.querySelectorAll('script[src*="vanilla-breeze"]');for(let t of i){let e=t.getAttribute("src");if(e){let s=e.lastIndexOf("/");if(s!==-1)return e.slice(0,s)}}}return"/cdn"}var aa=new Set(["default","a11y-high-contrast","a11y-large-text","a11y-dyslexia","modern","minimal","classic"]),oa=new Set(["kawaii","memphis"]);function ye(i){return oa.has(i)}function ca(i,t){return`${t}/themes/${i}.css`}function Is(i,t){if(!ye(i))return Promise.resolve();if(ge.has(i))return ge.get(i);let e=import(`${t}/packs/${i}.full.js`).catch(()=>{});return ge.set(i,e),e}function la(i,t){let e=Os(),s=()=>{(ye(t)||i.hasAttribute("data-vb-pack"))&&Is(t,e)};return i.getAttribute("data-vb-theme-state")==="error"?Promise.reject(new Error(`Failed to load theme: ${t}`)):i.getAttribute("data-vb-theme-state")==="ready"||i.sheet?(s(),Promise.resolve()):new Promise((n,r)=>{let a=()=>{i.setAttribute("data-vb-theme-state","ready"),c(),s(),n()},o=()=>{i.setAttribute("data-vb-theme-state","error"),J.delete(t),c(),r(new Error(`Failed to load theme: ${t}`))},c=()=>{i.removeEventListener("load",a),i.removeEventListener("error",o)};i.addEventListener("load",a,{once:!0}),i.addEventListener("error",o,{once:!0})})}async function Ft(i){if(!i||aa.has(i))return;if(J.has(i))return J.get(i);if(typeof document<"u"){let s=document.querySelector(`link[data-vb-theme="${i}"]`);if(s){let n=la(s,i);return J.set(i,n),n}}let t=Os(),e=ye(i)?da(i,t):ha(i,t);return J.set(i,e),e}async function ha(i,t){let e=ca(i,t);return new Promise((s,n)=>{let r=document.querySelector(`link[data-vb-theme-preload="${i}"]`);r&&r.remove();let a=document.createElement("link");a.rel="stylesheet",a.href=e,a.setAttribute("data-vb-theme",i),a.setAttribute("data-vb-theme-state","loading"),a.onload=()=>{a.setAttribute("data-vb-theme-state","ready"),s()},a.onerror=()=>{a.setAttribute("data-vb-theme-state","error"),a.remove(),J.delete(i),n(new Error(`Failed to load theme: ${i}`))},document.head.appendChild(a)})}function da(i,t){let e=`${t}/packs/${i}.theme.css`,s=`${t}/packs/${i}.effects.css`;return new Promise((n,r)=>{let a=document.querySelector(`link[data-vb-theme-preload="${i}"]`);a&&a.remove();let o=document.createElement("link");o.rel="stylesheet",o.href=e,o.setAttribute("data-vb-theme",i),o.setAttribute("data-vb-pack",i),o.setAttribute("data-vb-theme-state","loading"),o.onload=()=>{o.setAttribute("data-vb-theme-state","ready");let c=document.createElement("link");c.rel="stylesheet",c.href=s,c.setAttribute("data-vb-pack-effects",i),document.head.appendChild(c),Is(i,t),n()},o.onerror=()=>{o.setAttribute("data-vb-theme-state","error"),o.remove(),J.delete(i),r(new Error(`Failed to load pack: ${i}`))},document.head.appendChild(o)})}var Ps=[{id:"default",name:"Default",swatchBg:"#3b82f6",seeds:{}},{id:"ocean",name:"Ocean",swatchBg:"#0891b2",seeds:{"--hue-primary":200,"--hue-secondary":180,"--hue-accent":45,"--lightness-primary":"50%","--chroma-primary":.15,"--lightness-secondary":"45%","--chroma-secondary":.1,"--lightness-accent":"70%","--chroma-accent":.15},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.12}},{id:"forest",name:"Forest",swatchBg:"#059669",seeds:{"--hue-primary":145,"--hue-secondary":90,"--hue-accent":30,"--lightness-primary":"45%","--chroma-primary":.15,"--lightness-secondary":"55%","--chroma-secondary":.12,"--lightness-accent":"65%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"55%","--chroma-primary":.12}},{id:"sunset",name:"Sunset",swatchBg:"#ea580c",seeds:{"--hue-primary":25,"--hue-secondary":0,"--hue-accent":280,"--lightness-primary":"60%","--chroma-primary":.2,"--lightness-secondary":"55%","--chroma-secondary":.18,"--lightness-accent":"55%","--chroma-accent":.18},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.16}},{id:"rose",name:"Rose",swatchBg:"#e11d48",seeds:{"--hue-primary":350,"--hue-secondary":330,"--hue-accent":200,"--lightness-primary":"55%","--chroma-primary":.18,"--lightness-secondary":"50%","--chroma-secondary":.14,"--lightness-accent":"60%","--chroma-accent":.12},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.14}},{id:"lavender",name:"Lavender",swatchBg:"#a855f7",seeds:{"--hue-primary":280,"--hue-secondary":300,"--hue-accent":60,"--lightness-primary":"55%","--chroma-primary":.14,"--lightness-secondary":"50%","--chroma-secondary":.12,"--lightness-accent":"70%","--chroma-accent":.14},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.12}},{id:"coral",name:"Coral",swatchBg:"#f97316",seeds:{"--hue-primary":15,"--hue-secondary":25,"--hue-accent":180,"--lightness-primary":"60%","--chroma-primary":.18,"--lightness-secondary":"55%","--chroma-secondary":.15,"--lightness-accent":"55%","--chroma-accent":.12},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.15}},{id:"slate",name:"Slate",swatchBg:"#64748b",seeds:{"--hue-primary":220,"--hue-secondary":210,"--hue-accent":45,"--lightness-primary":"48%","--chroma-primary":.1,"--lightness-secondary":"45%","--chroma-secondary":.06,"--lightness-accent":"68%","--chroma-accent":.15},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.08}},{id:"emerald",name:"Emerald",swatchBg:"#10b981",seeds:{"--hue-primary":160,"--hue-secondary":140,"--hue-accent":30,"--lightness-primary":"50%","--chroma-primary":.15,"--lightness-secondary":"48%","--chroma-secondary":.12,"--lightness-accent":"65%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.12}},{id:"amber",name:"Amber",swatchBg:"#f59e0b",seeds:{"--hue-primary":45,"--hue-secondary":30,"--hue-accent":240,"--lightness-primary":"60%","--chroma-primary":.16,"--lightness-secondary":"55%","--chroma-secondary":.15,"--lightness-accent":"52%","--chroma-accent":.14},seedsDark:{"--lightness-primary":"68%","--chroma-primary":.14}},{id:"indigo",name:"Indigo",swatchBg:"#6366f1",seeds:{"--hue-primary":250,"--hue-secondary":270,"--hue-accent":35,"--lightness-primary":"48%","--chroma-primary":.18,"--lightness-secondary":"45%","--chroma-secondary":.14,"--lightness-accent":"68%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"62%","--chroma-primary":.14}}],Bs=[{id:"default",name:"Default",hue:210,shape:"balanced",character:"The default",swatchBg:"#3b82f6",tier:"core"},{id:"modern",name:"Modern",hue:270,shape:"rounded",character:"Vibrant & elevated",swatchBg:"#6366f1",tier:"core"},{id:"minimal",name:"Minimal",hue:240,shape:"sharp",character:"Clean & flat",swatchBg:"#71717a",tier:"core"},{id:"classic",name:"Classic",hue:220,shape:"subtle",character:"Serif & elegant",swatchBg:"#92400e",tier:"core"}],ve=[{id:"swiss",name:"Swiss",icon:"grid-3x3",character:"Precision grid",swatchBg:"#ff3e00",swatchFg:"white",tier:"showcase",category:"Design"},{id:"brutalist",name:"Brutalist",icon:"square",character:"Raw, industrial",swatchBg:"#1a1a1a",swatchFg:"#f5f5f5",tier:"showcase",category:"Design"},{id:"art-deco",name:"Art Deco",icon:"crown",character:"1920s luxury",swatchBg:"#1A1A1A",swatchFg:"#C9A84C",tier:"showcase",category:"Design"},{id:"editorial",name:"Editorial",icon:"newspaper",character:"Magazine elegance",swatchBg:"#1a1a1a",swatchFg:"#c9a227",tier:"showcase",category:"Content"},{id:"genai",name:"GenAI",icon:"sparkles",character:"AI aesthetic",swatchBg:"#1a0a2e",swatchFg:"#a855f7",tier:"showcase",category:"Modern"},{id:"glassmorphism",name:"Glass",icon:"glass-water",character:"Frosted surfaces",swatchBg:"#667eea",swatchFg:"#ffffff",tier:"showcase",category:"Modern"},{id:"startup",name:"Startup",icon:"rocket",character:"SaaS energy",swatchBg:"#4f46e5",swatchFg:"#ffffff",tier:"showcase",category:"Modern"},{id:"organic",name:"Organic",icon:"leaf",character:"Natural, handcrafted",swatchBg:"#2d5016",swatchFg:"#faf5e6",tier:"showcase",category:"Creative"},{id:"rough",name:"Rough",icon:"pencil",character:"Hand-drawn sketch",swatchBg:"#f5f0e8",swatchFg:"#3a3a3a",tier:"showcase",category:"Creative"},{id:"cyber",name:"Cyber",icon:"zap",character:"Neon futuristic",swatchBg:"#0a0a1a",swatchFg:"#00ff88",tier:"showcase",category:"Creative"},{id:"vaporwave",name:"Vaporwave",icon:"radio",character:"Neon dreamy",swatchBg:"#2b0040",swatchFg:"#ff6ad5",tier:"showcase",category:"Aesthetic"},{id:"neumorphism",name:"Neumorph",icon:"circle",character:"Soft embossed",swatchBg:"#e0e0e0",swatchFg:"#a0a0a0",tier:"showcase",category:"Aesthetic"},{id:"bauhaus",name:"Bauhaus",icon:"shapes",character:"Geometric",swatchBg:"#F1FAEE",swatchFg:"#E63946",tier:"showcase",category:"Aesthetic"},{id:"claymorphism",name:"Clay",icon:"circle-dot",character:"Puffy 3D",swatchBg:"#f0f0f5",swatchFg:"#FF6B9D",tier:"showcase",category:"Aesthetic"},{id:"alpha1999",name:"Alpha1999",icon:"orbit",character:"Space retro-fi",swatchBg:"#0a0a14",swatchFg:"#d4880f",tier:"showcase",category:"Signature"},{id:"super2026",name:"Super2026",icon:"triangle",character:"Supergraphic bold",swatchBg:"#f5f0e6",swatchFg:"#c23616",tier:"showcase",category:"Signature"},{id:"magna",name:"Magna",icon:"orbit",character:"Odyssey 2 retro",swatchBg:"#0d0b14",swatchFg:"#f97316",tier:"showcase",category:"Signature"},{id:"win9x",name:"Win9x",icon:"monitor",character:"Classic desktop",swatchBg:"#008080",swatchFg:"#c0c0c0",tier:"showcase",category:"OS Styles"},{id:"nes",name:"NES",icon:"joystick",character:"Console pixels",swatchBg:"#bcbcbc",swatchFg:"#e40521",tier:"showcase",category:"OS Styles"},{id:"8bit",name:"8-Bit",icon:"gamepad-2",character:"Retro pixel art",swatchBg:"#000080",swatchFg:"#ffff00",tier:"showcase",category:"OS Styles"}],we=[{id:"nord",name:"Nord",icon:"snowflake",character:"Arctic calm",swatchBg:"#2E3440",swatchFg:"#81A1C1",tier:"community",category:"Editor Palettes"},{id:"solarized",name:"Solarized",icon:"sun-dim",character:"Engineered precision",swatchBg:"#002B36",swatchFg:"#268BD2",tier:"community",category:"Editor Palettes"},{id:"dracula",name:"Dracula",icon:"moon-star",character:"Dark elegance",swatchBg:"#282A36",swatchFg:"#BD93F9",tier:"community",category:"Editor Palettes"},{id:"catppuccin-mocha",name:"Catppuccin",icon:"coffee",character:"Warm pastels",swatchBg:"#1E1E2E",swatchFg:"#CBA6F7",tier:"community",category:"Editor Palettes"},{id:"catppuccin-latte",name:"Ctp Latte",icon:"coffee",character:"Cozy daytime",swatchBg:"#eff1f5",swatchFg:"#8839ef",tier:"community",category:"Editor Palettes"},{id:"catppuccin-frappe",name:"Ctp Frapp\xE9",icon:"coffee",character:"Cool twilight",swatchBg:"#303446",swatchFg:"#ca9ee6",tier:"community",category:"Editor Palettes"},{id:"catppuccin-macchiato",name:"Ctp Macchiato",icon:"coffee",character:"Deep blue",swatchBg:"#24273a",swatchFg:"#c6a0f6",tier:"community",category:"Editor Palettes"},{id:"gruvbox",name:"Gruvbox",icon:"palette",character:"Retro warmth",swatchBg:"#282828",swatchFg:"#ebdbb2",tier:"community",category:"Editor Palettes"},{id:"tokyo-night",name:"Tokyo Night",icon:"moon",character:"Night-owl vibes",swatchBg:"#1a1b26",swatchFg:"#7aa2f7",tier:"community",category:"Editor Palettes"},{id:"rose-pine",name:"Ros\xE9 Pine",icon:"flower-2",character:"Muted elegance",swatchBg:"#191724",swatchFg:"#ebbcba",tier:"community",category:"Editor Palettes"},{id:"cottagecore",name:"Cottagecore",icon:"flower-2",character:"Pastoral",swatchBg:"#fdf8f0",swatchFg:"#7d8c6d",tier:"community",category:"Niche"},{id:"terminal",name:"Terminal",icon:"terminal",character:"Retro CRT",swatchBg:"#0d1117",swatchFg:"#00ff00",tier:"community",category:"Niche"},{id:"clinical",name:"Clinical",icon:"heart-pulse",character:"Sterile precision",swatchBg:"#ffffff",swatchFg:"#0077b6",tier:"community",category:"Industry"},{id:"financial",name:"Financial",icon:"landmark",character:"Navy + gold",swatchBg:"#1b2a4a",swatchFg:"#c9a84c",tier:"community",category:"Industry"},{id:"government",name:"Government",icon:"shield",character:"Official",swatchBg:"#002868",swatchFg:"#bf0a30",tier:"community",category:"Industry"},{id:"dawn",name:"Dawn",icon:"sunrise",character:"Golden morning",swatchBg:"#fef3e2",swatchFg:"#d4a574",tier:"community",category:"Mood/Time"},{id:"dusk",name:"Dusk",icon:"sunset",character:"Twilight",swatchBg:"#1a1b2e",swatchFg:"#e5a858",tier:"community",category:"Mood/Time"},{id:"midnight",name:"Midnight",icon:"moon",character:"Deep night",swatchBg:"#0d1117",swatchFg:"#58a6ff",tier:"community",category:"Mood/Time"},{id:"high-noon",name:"High Noon",icon:"sun",character:"Maximum bright",swatchBg:"#ffffff",swatchFg:"#e63946",tier:"community",category:"Mood/Time"}],Fs=[{id:"kawaii",name:"Kawaii",icon:"heart",character:"Cute aesthetic",swatchBg:"#ffb7c5",swatchFg:"#ff69b4",tier:"showcase",category:"Packs"},{id:"memphis",name:"Memphis",icon:"star",character:"Bold patterns",swatchBg:"#FFF8F0",swatchFg:"#d03040",tier:"showcase",category:"Packs"}];var yl=[...ve,...we],vl=[...Bs,...ve,...we,...Fs],Z=i=>ve.filter(t=>t.category===i),Rs=[{label:"Style",themes:Bs,tier:"core"},{label:"Design",themes:Z("Design"),tier:"showcase"},{label:"Content",themes:Z("Content"),tier:"showcase"},{label:"Modern",themes:Z("Modern"),tier:"showcase"},{label:"Creative",themes:Z("Creative"),tier:"showcase"},{label:"Aesthetic",themes:Z("Aesthetic"),tier:"showcase"},{label:"Signature",themes:Z("Signature"),tier:"showcase"},{label:"OS Styles",themes:Z("OS Styles"),tier:"showcase"},{label:"Packs",themes:Fs,tier:"showcase"},{label:"More Themes",themes:we,tier:"community"}];W();var Ae="theme",Se="current",ct={mode:"auto",brand:"default",accent:"default",borderStyle:"",iconSet:"",fluid:"",backdrop:"",backdropChrome:"",pageBgType:"",pageBgColor:"",pageBgGradStart:"",pageBgGradEnd:"",pageBgGradDir:""},zs=["--hue-primary","--hue-secondary","--hue-accent","--lightness-primary","--chroma-primary","--lightness-secondary","--chroma-secondary","--lightness-accent","--chroma-accent"],k=null,S={_initPromise:null,async init(){return this._initPromise?this._initPromise:(this._initPromise=(async()=>{let i=await w.get(Ae,Se);k=i?{...ct,...i}:{...ct};try{await Ft(k.brand)}catch{k.brand="default"}return this.apply(k),this._watchSystemPreference(),this._watchRootAttributes(),k})(),this._initPromise)},load(){return k?{...k}:{...ct}},save(i){let t={...k??ct,...i};return k=t,w.set(Ae,Se,t).catch(()=>{}),t},apply({mode:i="auto",brand:t="default",borderStyle:e="",iconSet:s="",fluid:n="",backdrop:r="",backdropChrome:a="",pageBgType:o="",pageBgColor:c="",pageBgGradStart:l="",pageBgGradEnd:h="",pageBgGradDir:d=""}={}){let u=document.documentElement;u.dataset.mode=i==="auto"?this.getEffectiveMode():i;let y=(u.dataset.theme||"").split(" ").filter(q=>q.startsWith("a11y-")),p=t!=="default"?[t,...y]:[...y];p.length?u.dataset.theme=p.join(" "):delete u.dataset.theme;let E=e||this._readCSSHint("--theme-border-style");E&&E!=="clean"?u.dataset.borderStyle=E:delete u.dataset.borderStyle;let v=s||this._readCSSHint("--theme-icon-set");if(v&&v!=="lucide"?u.dataset.iconSet=v:delete u.dataset.iconSet,n?u.dataset.fluid=n:delete u.dataset.fluid,r?u.dataset.backdrop=r:delete u.dataset.backdrop,a&&a!=="card"?u.dataset.backdropChrome=a:delete u.dataset.backdropChrome,o==="color"&&c)u.style.setProperty("--page-bg-color",c),u.style.removeProperty("--page-bg-gradient");else if(o==="gradient"&&l&&h){let q=d||"to bottom";u.style.setProperty("--page-bg-gradient",`linear-gradient(${q}, ${l}, ${h})`),u.style.removeProperty("--page-bg-color")}else u.style.removeProperty("--page-bg-color"),u.style.removeProperty("--page-bg-gradient");let T=this.load().accent||"default";this._applyAccent(T),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{mode:i,brand:t,accent:T,borderStyle:E,iconSet:v,fluid:n,backdrop:r,backdropChrome:a,pageBgType:o,effectiveMode:this.getEffectiveMode()}}))},setMode(i){let t=this.save({mode:i});this.apply(t)},async setBrand(i){try{await Ft(i)}catch(e){console.warn(`[VB] Theme "${i}" failed to load, using default`,e),i="default"}let t=this.save({brand:i});this.apply(t)},setAccent(i){this.save({accent:i}),this._applyAccent(i),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}}))},setBorderStyle(i){let t=this.save({borderStyle:i});this.apply(t)},setIconSet(i){let t=this.save({iconSet:i});this.apply(t)},setFluid(i){let t=this.save({fluid:i});this.apply(t)},setBackdrop(i){let t=this.save({backdrop:i});this.apply(t)},setBackdropChrome(i){let t=this.save({backdropChrome:i});this.apply(t)},setPageBg({type:i="",color:t="",gradStart:e="",gradEnd:s="",gradDir:n=""}={}){let r=this.save({pageBgType:i,pageBgColor:t,pageBgGradStart:e,pageBgGradEnd:s,pageBgGradDir:n});this.apply(r)},getEffectiveMode(){let{mode:i}=this.load();return i!=="auto"?i:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},getState(){let{mode:i,brand:t,accent:e,borderStyle:s,iconSet:n,fluid:r,backdrop:a,backdropChrome:o,pageBgType:c,pageBgColor:l,pageBgGradStart:h,pageBgGradEnd:d,pageBgGradDir:u}=this.load();return{mode:i,brand:t,accent:e,borderStyle:s,iconSet:n,fluid:r,backdrop:a,backdropChrome:o,pageBgType:c,pageBgColor:l,pageBgGradStart:h,pageBgGradEnd:d,pageBgGradDir:u,effectiveMode:this.getEffectiveMode()}},toggleMode(){let t=this.getEffectiveMode()==="dark"?"light":"dark";this.setMode(t)},reset(){k={...ct},w.remove(Ae,Se).catch(()=>{});let i=document.documentElement;i.style.removeProperty("--page-bg-color"),i.style.removeProperty("--page-bg-gradient");for(let t of zs)i.style.removeProperty(t);this.apply(ct)},_readCSSHint(i){return getComputedStyle(document.documentElement).getPropertyValue(i).trim()},_applyAccent(i){let t=document.documentElement,e=Ps.find(s=>s.id===i);for(let s of zs)t.style.removeProperty(s);if(!(!e||!e.seeds||Object.keys(e.seeds).length===0)){for(let[s,n]of Object.entries(e.seeds))t.style.setProperty(s,String(n));if(e.seedsDark&&this.getEffectiveMode()==="dark")for(let[s,n]of Object.entries(e.seedsDark))t.style.setProperty(s,String(n))}},_watchRootAttributes(){this._rootObserver||(this._rootObserver=new MutationObserver(i=>{for(let t of i)t.attributeName==="data-theme"?this._syncFromDataTheme():t.attributeName==="data-mode"&&this._syncFromDataMode()}),this._rootObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-mode"]}))},_syncFromDataTheme(){if(!k)return;let e=(document.documentElement.dataset.theme||"").split(/\s+/).filter(Boolean).find(s=>!s.startsWith("a11y-"))||"default";e!==k.brand&&(k.brand=e,Ft(e).catch(()=>{}),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}})))},_syncFromDataMode(){if(!k)return;let i=document.documentElement.dataset.mode||"auto",t=k.mode==="auto"?this.getEffectiveMode():k.mode;i!==t&&(k.mode=i,window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}})))},_watchSystemPreference(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{let t=this.load();t.mode==="auto"&&this.apply(t)})}};var pa=["layout-text","layout-reel","layout-canvas","dl-item"];pa.forEach(i=>{customElements.get(i)||customElements.define(i,class extends HTMLElement{})});var Tl=window.matchMedia("(prefers-reduced-motion: reduce)");var Us=new Map;function f(i,t,e={}){let s=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:s},r=Us.get(i);if(customElements.get(i)){if(!r||r.priority>=s){r&&r.priority===s&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=s){r.priority===s&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}Us.set(i,n),customElements.define(i,t)}var m=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,n){t.addEventListener(e,s,n),this.#e.push(()=>t.removeEventListener(e,s,n))}setup(){}teardown(){}};var fa=["valueMissing","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","customError"],Ce=class extends m{#e=null;#t=null;#i=!1;setup(){if(this.#e=this.querySelector("input, textarea, select"),this.#t=this.querySelector("output.error")??this.querySelector("output:not(.hint)"),!this.#e)return!1;this.listen(this.#e,"blur",()=>this.validate()),this.listen(this.#e,"input",()=>{this.#i&&this.validate()})}teardown(){this.#e=null,this.#t=null,this.#i=!1}validate(){let t=this.#e;if(!t)return!0;t.validity.customError||t.setCustomValidity("");let e=t.checkValidity();return e?(this.#n(t.value?"valid":null),t.removeAttribute("aria-invalid"),this.#t&&(this.#t.textContent="")):(this.#i=!0,this.#n("invalid"),t.setAttribute("aria-invalid","true"),this.#s(t.validity)),e}setError(t){this.#e&&(this.#e.setCustomValidity(t),this.#i=!0,this.#n("invalid"),this.#e.setAttribute("aria-invalid","true"),this.#t&&(this.#t.textContent=t))}clearError(){this.#e&&(this.#e.setCustomValidity(""),this.#n(null),this.#e.removeAttribute("aria-invalid"),this.#i=!1,this.#t&&(this.#t.textContent=""))}get fieldName(){return this.querySelector("label")?.textContent?.trim()??this.#e?.getAttribute("aria-label")??this.#e?.name??this.#e?.id??"Field"}get input(){return this.#e}#n(t){delete this.dataset.valid,delete this.dataset.invalid,t&&(this.dataset[t]="")}#s(t){if(!this.#t)return;let e=this.#e;for(let s of fa){if(!t[s])continue;let n=`data-message-${s.toLowerCase()}`,r=e.getAttribute(n)??e.validationMessage;this.#t.textContent=r;return}}};f("form-field",Ce);function B(i){return document.startViewTransition?document.startViewTransition(i):i()}var ma=0,ke=class extends m{#e=[];#t=[];#i=!1;#n=0;setup(){if(this.#e=[...this.querySelectorAll(":scope > details")],this.#t=this.#e.map(t=>t.querySelector("summary")),this.#e.length===0)return!1;this.#a(),this.#c(),this.#s()}teardown(){this.#e=[],this.#t=[],this.#i=!1}#s(){if(!this.hasAttribute("transition")||!document.startViewTransition)return;this.#i=!0;let t=++ma,e=this.getAttribute("transition")||"fade",s=e==="slide"?"vt-tabs-slide":e==="scale"?"vt-tabs-scale":"vt-tabs";this.#e.forEach(n=>{let r=n.querySelector(":scope > :not(summary)");r&&(r.style.viewTransitionName=`tabs-${t}`,r.style.viewTransitionClass=s)}),this.#n=this.#e.findIndex(n=>n.open),this.#n===-1&&(this.#n=0)}#r(t){if(t===this.#n)return;let e=t>this.#n?"forward":"backward";document.documentElement.dataset.vtDirection=e,B(()=>{this.#e[t].open=!0}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}#a(){this.#e.forEach((t,e)=>{let s=this.#t[e],n=t.querySelector(":scope > :not(summary)");if(!s||!n)return;let r=s.id||`tab-${crypto.randomUUID().slice(0,8)}`,a=n.id||`panel-${crypto.randomUUID().slice(0,8)}`;s.id=r,s.setAttribute("aria-controls",a),s.setAttribute("tabindex",t.open?"0":"-1"),s.setAttribute("aria-selected",t.open?"true":"false"),n.id=a,n.setAttribute("aria-labelledby",r),this.listen(s,"click",o=>{this.#i&&(o.preventDefault(),this.#r(e))}),this.listen(s,"keydown",o=>this.#h(o,e)),this.listen(t,"toggle",()=>this.#o(e))})}#c(){!this.#e.some(e=>e.open)&&this.#e.length>0&&(this.#e[0].open=!0,this.#p())}#o(t){this.#e[t].open&&(this.#n=t),this.#p(),this.dispatchEvent(new CustomEvent("tab-set:change",{detail:{index:t},bubbles:!0}))}#p(){this.#e.forEach((t,e)=>{let s=this.#t[e];s.setAttribute("tabindex",t.open?"0":"-1"),s.setAttribute("aria-selected",t.open?"true":"false")})}#h(t,e){let{key:s}=t,n;switch(s){case"ArrowRight":n=(e+1)%this.#e.length;break;case"ArrowLeft":n=(e-1+this.#e.length)%this.#e.length;break;case"Home":n=0;break;case"End":n=this.#e.length-1;break;default:return}t.preventDefault(),this.#i?this.#r(n):this.#e[n].open=!0,this.#t[n].focus()}};f("tab-set",ke);var xe=class i extends m{static#e=0;#t;#i=[];#n="Back to content";setup(){this.#t=++i.#e,this.hasAttribute("data-back-label")&&(this.#n=this.getAttribute("data-back-label")??this.#n),this.#s(),this.getAttribute("data-mode")==="sidenotes"?this.#c():this.#r()}#s(){let t=[...document.querySelectorAll("foot-note:not([data-enhanced])")];this.#i=t.filter(e=>this.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}#r(){if(this.#i.length===0)return;let t=document.createElement("ol");this.#i.forEach((e,s)=>{let n=s+1,r=`fnref-${this.#t}-${n}`,a=`fn-${this.#t}-${n}`;this.#a(e,n,r,a);let o=this.#p(e,n,r,a);t.appendChild(o)}),this.appendChild(t)}#a(t,e,s,n){t.setAttribute("data-enhanced",""),t.id=s;let r=t.innerHTML,a=document.createElement("span");a.innerHTML=r;let o=document.createElement("a");o.href=`#${n}`,o.setAttribute("aria-describedby",n),o.textContent=`[${e}]`,t.innerHTML="",t.appendChild(a),t.appendChild(o)}#c(){if(this.#i.length===0)return;let t=[];if(this.#i.forEach((e,s)=>{let n=s+1,r=`fnref-${this.#t}-${n}`,a=`fn-${this.#t}-${n}`;e.getAttribute("data-side")==="false"?(this.#a(e,n,r,a),t.push({ref:e,num:n,refId:r,noteId:a})):this.#o(e,n,r,a)}),t.length>0){let e=document.createElement("ol");for(let{ref:s,num:n,refId:r,noteId:a}of t)e.appendChild(this.#p(s,n,r,a));this.appendChild(e)}else this.hidden=!0}#o(t,e,s,n){let r=t.innerHTML;t.setAttribute("data-enhanced",""),t.setAttribute("data-side",""),t.id=s;let a=document.createElement("a");a.href=`#${n}`,a.setAttribute("aria-describedby",n),a.textContent=`[${e}]`;let o=document.createElement("aside");o.className="sidenote",o.id=n,o.setAttribute("role","note"),o.innerHTML=`<span class="sidenote-number">${e}.</span> ${r}`,t.innerHTML="",t.appendChild(a),t.appendChild(o)}#p(t,e,s,n){let r=document.createElement("li");r.id=n;let a=t.querySelector("span"),o=a?a.innerHTML:"",c=document.createElement("a");return c.href=`#${s}`,c.setAttribute("data-backref",""),c.setAttribute("aria-label",this.#n),c.textContent="\u21A9",r.innerHTML=o+" ",r.appendChild(c),r}},Te=class extends HTMLElement{};f("foot-notes",xe);f("foot-note",Te);var ba=0,Le=class extends m{#e=[];#t=[];#i=[];#n=!1;setup(){if(this.#e=[...this.querySelectorAll(":scope > details")],this.#t=this.#e.map(t=>t.querySelector("summary")),this.#e.length===0)return!1;this.#s(),this.#c(),this.#r()}teardown(){this.#e=[],this.#t=[],this.#i=[],this.#n=!1}#s(){this.#i=this.#e.map(t=>{let e=t.querySelector("summary");if(!e)return null;let s=[...t.children].filter(n=>n!==e);if(s.length===1)return s[0];if(s.length>1){let n=document.createElement("div");for(let r of s)n.appendChild(r);return t.appendChild(n),n}return null})}#r(){if(!this.hasAttribute("transition")||!document.startViewTransition)return;this.#n=!0;let t=++ba,e=this.getAttribute("transition")||"fade",s=e==="slide"?"vt-accordion-slide":e==="scale"?"vt-accordion-scale":"vt-accordion";this.#i.forEach((n,r)=>{n&&(n.style.viewTransitionName=`accordion-${t}-${r}`,n.style.viewTransitionClass=s)})}#a(t){B(()=>{t.open=!t.open})}#c(){this.#e.forEach((t,e)=>{let s=this.#t[e],n=this.#i[e];if(s){if(n){let r=s.id||`accordion-heading-${crypto.randomUUID().slice(0,8)}`,a=n.id||`accordion-panel-${crypto.randomUUID().slice(0,8)}`;s.id=r,n.id=a,s.setAttribute("aria-expanded",t.open?"true":"false"),s.setAttribute("aria-controls",a),n.setAttribute("aria-labelledby",r),n.setAttribute("role","region")}else s.setAttribute("aria-expanded",t.open?"true":"false");this.listen(s,"click",r=>{this.#n&&(r.preventDefault(),this.#a(t))}),this.listen(s,"keydown",r=>this.#p(r,e)),this.listen(t,"toggle",()=>this.#o(t,e))}})}#o(t,e){this.#t[e].setAttribute("aria-expanded",t.open?"true":"false"),this.hasAttribute("single")&&t.open&&this.#e.forEach((n,r)=>{r!==e&&n.open&&(n.open=!1,this.#t[r].setAttribute("aria-expanded","false"))}),this.dispatchEvent(new CustomEvent("accordion-wc:toggle",{detail:{index:e,open:t.open},bubbles:!0}))}#p(t,e){let{key:s}=t,n;switch(s){case"ArrowDown":n=(e+1)%this.#e.length;break;case"ArrowUp":n=(e-1+this.#e.length)%this.#e.length;break;case"Home":n=0;break;case"End":n=this.#e.length-1;break;default:return}t.preventDefault(),this.#t[n].focus()}open(t){t<0||t>=this.#e.length||(this.#n&&!this.#e[t].open?B(()=>{this.#e[t].open=!0}):this.#e[t].open=!0)}close(t){t<0||t>=this.#e.length||(this.#n&&this.#e[t].open?B(()=>{this.#e[t].open=!1}):this.#e[t].open=!1)}toggle(t){t<0||t>=this.#e.length||(this.#n?this.#a(this.#e[t]):this.#e[t].open=!this.#e[t].open)}openAll(){this.hasAttribute("single")||this.#e.forEach(t=>{t.open=!0})}closeAll(){this.#e.forEach(t=>{t.open=!1})}};f("accordion-wc",Le);var Me=class extends m{#e=[];#t=[];static get observedAttributes(){return["position","max"]}setup(){this.setAttribute("role","region"),this.setAttribute("aria-label","Notifications"),this.setAttribute("aria-live","polite")}teardown(){this.#t.forEach(t=>{t._dismissTimer&&clearTimeout(t._dismissTimer)}),this.#e=[],this.#t=[]}show(t){let{message:e,variant:s="info",duration:n=this.#r(),dismissible:r=!0,action:a,onAction:o}=t,c=this.#i({message:e,variant:s,dismissible:r,action:a,onAction:o}),l=this.#a();return this.#t.length>=l?this.#e.push({toast:c,duration:n}):this.#n(c,n),c}#i({message:t,variant:e,dismissible:s,action:n,onAction:r}){let a=document.createElement("div");a.className="toast",a.setAttribute("role",e==="error"||e==="warning"?"alert":"status"),a.setAttribute("data-variant",e);let o={info:"ⓘ",success:"✓",warning:"⚠",error:"✗"};return a.innerHTML=`
|
|
3
3
|
<span class="icon" aria-hidden="true">${o[e]||o.info}</span>
|
|
4
4
|
<span class="message">${this.#c(t)}</span>
|
|
5
5
|
${n?`<button type="button" class="action">${this.#c(n)}</button>`:""}
|
|
6
6
|
${s?'<button type="button" class="close" aria-label="Dismiss">✕</button>':""}
|
|
7
|
-
`,s&&a.querySelector(".close")?.addEventListener("click",()=>{this.#s(a)}),n&&r&&a.querySelector(".action")?.addEventListener("click",()=>{r(),this.#s(a)}),a}#n(t,e){this.appendChild(t),this.#t.push(t),requestAnimationFrame(()=>{t.setAttribute("data-state","visible")}),e>0&&(t._dismissTimer=setTimeout(()=>{this.#s(t)},e)),this.dispatchEvent(new CustomEvent("toast-msg:show",{bubbles:!0,detail:{toast:t}}))}#s(t){if(!this.contains(t))return;t._dismissTimer&&clearTimeout(t._dismissTimer),t.setAttribute("data-state","hiding");let e=()=>{t.removeEventListener("animationend",e),t.remove();let s=this.#t.indexOf(t);if(s>-1&&this.#t.splice(s,1),this.#e.length>0){let{toast:n,duration:r}=this.#e.shift();this.#n(n,r)}this.dispatchEvent(new CustomEvent("toast-msg:hide",{bubbles:!0,detail:{toast:t}}))};t.addEventListener("animationend",e),setTimeout(()=>{this.contains(t)&&e()},300)}dismissAll(){this.#e=[],[...this.#t].forEach(t=>this.#s(t))}#r(){let t=this.getAttribute("duration");return t!==null?parseInt(t,10):5e3}#a(){let t=this.getAttribute("max");return t!==null?parseInt(t,10):5}#c(t){let e=document.createElement("div");return e.textContent=t,e.innerHTML}};f("toast-msg",Me);var Us=CSS.supports("anchor-name","--test"),ma=new Set(["BUTTON","A","AREA"]);function Ws(i){return document.documentElement.hasAttribute("data-interest-polyfill")?!0:"interestForElement"in HTMLButtonElement.prototype?ma.has(i.tagName):!1}var Ne=class extends m{#e;#t;#i;#n;#s=!Us;#r=!1;#a=!1;#c;setup(){this.#r=this.getAttribute("variant")==="card",this.#r?this.#p():this.#o()}#o(){if(this.#e=this.querySelector(":scope > :not(template)"),!this.#e)return;this.#a=Ws(this.#e);let t=this.querySelector(":scope > template[data-tooltip]"),e=this.getAttribute("content"),s=this.#e.getAttribute("title");if(!t&&!e&&!s)return;s&&(this.#c=s,this.#e.removeAttribute("title")),this.#t=document.createElement("div"),this.#t.className="tooltip",this.#t.setAttribute("role","tooltip"),this.#t.setAttribute("popover","hint"),t?this.#t.innerHTML=t.innerHTML:this.#t.textContent=e||s,this.#t.id=`tooltip-${crypto.randomUUID().slice(0,8)}`;let n=this.getAttribute("position")||"top";this.#t.dataset.tooltipPosition=n;let r=document.createElement("span");if(r.className="tooltip-arrow",r.setAttribute("aria-hidden","true"),this.#t.appendChild(r),this.appendChild(this.#t),Us){let a=`--tooltip-anchor-${this.#t.id}`;this.#e.style.anchorName=a,this.#t.style.positionAnchor=a,this.#t.setAttribute("data-anchor","")}this.#a?(this.#e.setAttribute("interestfor",this.#t.id),this.#e.hasAttribute("aria-describedby")||this.#e.setAttribute("aria-describedby",this.#t.id),this.#s&&this.listen(this.#t,"toggle",this.#h)):(this.#e.setAttribute("aria-describedby",this.#t.id),this.listen(this.#e,"mouseenter",this.#f),this.listen(this.#e,"mouseleave",this.#d),this.listen(this.#e,"focus",this.#l),this.listen(this.#e,"blur",this.#u),this.listen(this.#t,"mouseenter",this.#m),this.listen(this.#t,"mouseleave",this.#d))}#p(){this.#e=this.querySelector(":scope > [data-trigger]");let t=this.querySelector(":scope > [data-content]");!this.#e||!t||(this.#a=Ws(this.#e),this.#t=document.createElement("div"),this.#t.className="hover-card",this.#t.setAttribute("popover","manual"),this.#t.id=`hc-${crypto.randomUUID().slice(0,8)}`,this.#t.appendChild(t),t.removeAttribute("data-content"),t.hidden=!1,this.appendChild(this.#t),this.#a?(this.#e.setAttribute("interestfor",this.#t.id),this.listen(this.#t,"toggle",this.#h)):(this.listen(this.#e,"mouseenter",this.#f),this.listen(this.#e,"mouseleave",this.#d),this.listen(this.#e,"focus",this.#l),this.listen(this.#e,"blur",this.#d),this.listen(this.#t,"mouseenter",this.#m),this.listen(this.#t,"mouseleave",this.#d),this.listen(document,"keydown",this.#g)))}teardown(){this.#e&&(this.#a&&this.#e.removeAttribute("interestfor"),this.#c&&(this.#e.setAttribute("title",this.#c),this.#c=void 0)),this.#t&&(this.#t.remove(),this.#t=null),clearTimeout(this.#i),clearTimeout(this.#n)}#h=t=>{t.newState==="open"?(this.#r?this.#A():this.#s&&this.#v(),this.dispatchEvent(new CustomEvent("tool-tip:show",{bubbles:!0}))):this.dispatchEvent(new CustomEvent("tool-tip:hide",{bubbles:!0}))};#f=()=>{clearTimeout(this.#n);let t=this.#r?300:200,e=parseInt(this.getAttribute("delay")||String(t),10);this.#i=setTimeout(()=>this.show(),e)};#d=()=>{clearTimeout(this.#i);let t=this.#r?200:100;this.#n=setTimeout(()=>this.hide(),t)};#l=()=>{clearTimeout(this.#n),this.show()};#u=()=>{clearTimeout(this.#i),this.hide()};#m=()=>{clearTimeout(this.#n)};#g=t=>{t.key==="Escape"&&this.isVisible&&this.hide()};show(){!this.#t||this.isVisible||(this.#t.showPopover(),this.#r?this.#A():this.#s&&this.#v(),this.dispatchEvent(new CustomEvent("tool-tip:show",{bubbles:!0})))}hide(){!this.#t||!this.isVisible||(this.#t.hidePopover(),this.dispatchEvent(new CustomEvent("tool-tip:hide",{bubbles:!0})))}#v(){if(!this.#e||!this.#t)return;let t=this.#e.getBoundingClientRect(),e=this.#t.getBoundingClientRect(),s=this.getAttribute("position")||"top",n=8,r,a;switch(s){case"bottom":r=t.bottom+n,a=t.left+(t.width-e.width)/2;break;case"left":r=t.top+(t.height-e.height)/2,a=t.left-e.width-n;break;case"right":r=t.top+(t.height-e.height)/2,a=t.right+n;break;default:r=t.top-e.height-n,a=t.left+(t.width-e.width)/2;break}let o=8;a=Math.max(o,Math.min(a,window.innerWidth-e.width-o)),r=Math.max(o,Math.min(r,window.innerHeight-e.height-o)),this.#t.style.top=`${r}px`,this.#t.style.left=`${a}px`}#A(){if(!this.#e||!this.#t)return;let t=this.#e.getBoundingClientRect(),e=this.#t.getBoundingClientRect(),s=this.getAttribute("position")||"bottom",n=8,r=8,a,o;o=t.left+(t.width-e.width)/2,o=Math.max(r,Math.min(o,window.innerWidth-e.width-r)),s==="top"?(a=t.top-e.height-n,a<r&&(a=t.bottom+n)):(a=t.bottom+n,a+e.height>window.innerHeight-r&&(a=t.top-e.height-n)),this.#t.style.position="fixed",this.#t.style.top=`${a}px`,this.#t.style.left=`${o}px`}get isVisible(){return this.#t?.matches(":popover-open")??!1}};f("tool-tip",Ne);var F="popover"in HTMLElement.prototype;var De=class extends m{#e;#t;#i=[];#n=-1;#s=!1;#r=!1;#a=null;#c=!1;setup(){if(this.#e=this.querySelector(":scope > [data-trigger]"),this.#e||(this.#e=this.querySelector(":scope > button")),!this.#e||(this.#t=this.querySelector(':scope > menu, :scope > ul[role="menu"]'),!this.#t))return!1;this.#r=this.hasAttribute("hover"),this.#c=F&&!this.#r,this.#c&&this.#t.setAttribute("popover","auto"),this.#e.setAttribute("aria-haspopup","menu"),this.#e.setAttribute("aria-expanded","false"),this.#t.id||(this.#t.id=`dropdown-menu-${crypto.randomUUID().slice(0,8)}`),this.#e.setAttribute("aria-controls",this.#t.id),this.#t.setAttribute("role","menu"),this.#o(),this.#r?(this.listen(this,"mouseenter",this.#h),this.listen(this,"mouseleave",this.#f),this.listen(this.#e,"focus",this.#d),this.listen(this.#e,"blur",this.#l)):this.listen(this.#e,"click",this.#p),this.listen(this.#e,"keydown",this.#u),this.listen(this.#t,"keydown",this.#m),this.#c?this.listen(this.#t,"toggle",this.#A):(this.listen(document,"click",this.#g),this.listen(document,"keydown",this.#v))}teardown(){this.#a&&clearTimeout(this.#a)}#o(){this.#i=Array.from(this.#t.querySelectorAll('button, a, [role="menuitem"]')).filter(t=>!t.disabled&&!t.closest('[role="separator"]')),this.#i.forEach((t,e)=>{t.setAttribute("role","menuitem"),t.setAttribute("tabindex","-1"),t.style.cssText+=";border:none;box-shadow:none;transform:none;border-radius:0;",t.addEventListener("click",this.#b)}),this.#t.querySelectorAll('li:empty, [role="separator"], hr').forEach(t=>{t.setAttribute("role","separator")})}#p=t=>{t.stopPropagation(),this.toggle()};#h=()=>{this.#a&&(clearTimeout(this.#a),this.#a=null),this.open()};#f=()=>{this.#a=setTimeout(()=>{this.close()},100)};#d=()=>{this.#a&&(clearTimeout(this.#a),this.#a=null),this.open()};#l=t=>{this.#t?.contains(t.relatedTarget)||(this.#a=setTimeout(()=>{this.contains(document.activeElement)||this.close()},100))};#u=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.open(),this.#y(0);break;case"ArrowUp":case"Up":t.preventDefault(),this.open(),this.#y(this.#i.length-1);break}};#m=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.#y(this.#n+1);break;case"ArrowUp":case"Up":t.preventDefault(),this.#y(this.#n-1);break;case"Home":t.preventDefault(),this.#y(0);break;case"End":t.preventDefault(),this.#y(this.#i.length-1);break;case"Tab":this.close();break;case"Enter":case" ":t.preventDefault(),this.#n>=0&&this.#i[this.#n].click();break}};#g=t=>{this.#s&&!this.contains(t.target)&&this.close()};#v=t=>{t.key==="Escape"&&this.#s&&(t.preventDefault(),this.close(),this.#e?.focus())};#A=t=>{t.newState==="closed"&&this.#s&&(this.#s=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"),this.#n=-1,this.dispatchEvent(new CustomEvent("drop-down:close",{bubbles:!0})))};#b=t=>{t.defaultPrevented||(this.close(),this.#e?.focus())};#y(t){this.#i.length!==0&&(t<0&&(t=this.#i.length-1),t>=this.#i.length&&(t=0),this.#n=t,this.#i[t].focus())}open(){if(!(this.#s||!this.#t)){if(this.#s=!0,this.setAttribute("open",""),this.#e?.setAttribute("aria-expanded","true"),this.#n=-1,this.#w(),this.#c)try{this.#t.showPopover()}catch{}this.dispatchEvent(new CustomEvent("drop-down:open",{bubbles:!0}))}}close(){if(!(!this.#s||!this.#t)){if(this.#s=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"),this.#n=-1,this.#c)try{this.#t.hidePopover()}catch{}this.dispatchEvent(new CustomEvent("drop-down:close",{bubbles:!0}))}}toggle(){this.#s?this.close():this.open()}#w(){if(!this.#e||!this.#t)return;let t=this.getAttribute("position")||"bottom-start",e=this.hasAttribute("no-flip"),s=this.#e.getBoundingClientRect(),n=this.#t.getBoundingClientRect(),r=window.innerHeight,a=window.innerWidth,o=4;if(this.#c){let c,l;t.startsWith("top")?(c=s.top-n.height-o,!e&&c<0&&(c=s.bottom+o)):(c=s.bottom+o,!e&&c+n.height>r&&(c=s.top-n.height-o)),t.endsWith("end")?(l=s.right-n.width,l<0&&(l=s.left)):(l=s.left,l+n.width>a&&(l=s.right-n.width)),this.#t.style.setProperty("--dropdown-top",`${Math.max(0,c)}px`),this.#t.style.setProperty("--dropdown-left",`${Math.max(0,l)}px`)}else{let c,l;t.startsWith("top")?(c=-n.height-o,!e&&s.top+c<0&&(c=s.height+o)):(c=s.height+o,!e&&s.bottom+n.height+o>r&&(c=-n.height-o)),t.endsWith("end")?(l=s.width-n.width,s.left+l<0&&(l=0)):(l=0,s.left+n.width>a&&(l=s.width-n.width)),this.#t.style.setProperty("--dropdown-top",`${c}px`),this.#t.style.setProperty("--dropdown-left",`${l}px`)}}get isOpen(){return this.#s}};f("drop-down",De);var js=`
|
|
7
|
+
`,s&&a.querySelector(".close")?.addEventListener("click",()=>{this.#s(a)}),n&&r&&a.querySelector(".action")?.addEventListener("click",()=>{r(),this.#s(a)}),a}#n(t,e){this.appendChild(t),this.#t.push(t),requestAnimationFrame(()=>{t.setAttribute("data-state","visible")}),e>0&&(t._dismissTimer=setTimeout(()=>{this.#s(t)},e)),this.dispatchEvent(new CustomEvent("toast-msg:show",{bubbles:!0,detail:{toast:t}}))}#s(t){if(!this.contains(t))return;t._dismissTimer&&clearTimeout(t._dismissTimer),t.setAttribute("data-state","hiding");let e=()=>{t.removeEventListener("animationend",e),t.remove();let s=this.#t.indexOf(t);if(s>-1&&this.#t.splice(s,1),this.#e.length>0){let{toast:n,duration:r}=this.#e.shift();this.#n(n,r)}this.dispatchEvent(new CustomEvent("toast-msg:hide",{bubbles:!0,detail:{toast:t}}))};t.addEventListener("animationend",e),setTimeout(()=>{this.contains(t)&&e()},300)}dismissAll(){this.#e=[],[...this.#t].forEach(t=>this.#s(t))}#r(){let t=this.getAttribute("duration");return t!==null?parseInt(t,10):5e3}#a(){let t=this.getAttribute("max");return t!==null?parseInt(t,10):5}#c(t){let e=document.createElement("div");return e.textContent=t,e.innerHTML}};f("toast-msg",Me);var Ws=CSS.supports("anchor-name","--test"),ga=new Set(["BUTTON","A","AREA"]);function js(i){return document.documentElement.hasAttribute("data-interest-polyfill")?!0:"interestForElement"in HTMLButtonElement.prototype?ga.has(i.tagName):!1}var Ne=class extends m{#e;#t;#i;#n;#s=!Ws;#r=!1;#a=!1;#c;setup(){this.#r=this.getAttribute("variant")==="card",this.#r?this.#p():this.#o()}#o(){if(this.#e=this.querySelector(":scope > :not(template)"),!this.#e)return;this.#a=js(this.#e);let t=this.querySelector(":scope > template[data-tooltip]"),e=this.getAttribute("content"),s=this.#e.getAttribute("title");if(!t&&!e&&!s)return;s&&(this.#c=s,this.#e.removeAttribute("title")),this.#t=document.createElement("div"),this.#t.className="tooltip",this.#t.setAttribute("role","tooltip"),this.#t.setAttribute("popover","hint"),t?this.#t.innerHTML=t.innerHTML:this.#t.textContent=e||s,this.#t.id=`tooltip-${crypto.randomUUID().slice(0,8)}`;let n=this.getAttribute("position")||"top";this.#t.dataset.tooltipPosition=n;let r=document.createElement("span");if(r.className="tooltip-arrow",r.setAttribute("aria-hidden","true"),this.#t.appendChild(r),this.appendChild(this.#t),Ws){let a=`--tooltip-anchor-${this.#t.id}`;this.#e.style.anchorName=a,this.#t.style.positionAnchor=a,this.#t.setAttribute("data-anchor","")}this.#a?(this.#e.setAttribute("interestfor",this.#t.id),this.#e.hasAttribute("aria-describedby")||this.#e.setAttribute("aria-describedby",this.#t.id),this.#s&&this.listen(this.#t,"toggle",this.#h)):(this.#e.setAttribute("aria-describedby",this.#t.id),this.listen(this.#e,"mouseenter",this.#f),this.listen(this.#e,"mouseleave",this.#d),this.listen(this.#e,"focus",this.#l),this.listen(this.#e,"blur",this.#u),this.listen(this.#t,"mouseenter",this.#m),this.listen(this.#t,"mouseleave",this.#d))}#p(){this.#e=this.querySelector(":scope > [data-trigger]");let t=this.querySelector(":scope > [data-content]");!this.#e||!t||(this.#a=js(this.#e),this.#t=document.createElement("div"),this.#t.className="hover-card",this.#t.setAttribute("popover","manual"),this.#t.id=`hc-${crypto.randomUUID().slice(0,8)}`,this.#t.appendChild(t),t.removeAttribute("data-content"),t.hidden=!1,this.appendChild(this.#t),this.#a?(this.#e.setAttribute("interestfor",this.#t.id),this.listen(this.#t,"toggle",this.#h)):(this.listen(this.#e,"mouseenter",this.#f),this.listen(this.#e,"mouseleave",this.#d),this.listen(this.#e,"focus",this.#l),this.listen(this.#e,"blur",this.#d),this.listen(this.#t,"mouseenter",this.#m),this.listen(this.#t,"mouseleave",this.#d),this.listen(document,"keydown",this.#g)))}teardown(){this.#e&&(this.#a&&this.#e.removeAttribute("interestfor"),this.#c&&(this.#e.setAttribute("title",this.#c),this.#c=void 0)),this.#t&&(this.#t.remove(),this.#t=null),clearTimeout(this.#i),clearTimeout(this.#n)}#h=t=>{t.newState==="open"?(this.#r?this.#A():this.#s&&this.#v(),this.dispatchEvent(new CustomEvent("tool-tip:show",{bubbles:!0}))):this.dispatchEvent(new CustomEvent("tool-tip:hide",{bubbles:!0}))};#f=()=>{clearTimeout(this.#n);let t=this.#r?300:200,e=parseInt(this.getAttribute("delay")||String(t),10);this.#i=setTimeout(()=>this.show(),e)};#d=()=>{clearTimeout(this.#i);let t=this.#r?200:100;this.#n=setTimeout(()=>this.hide(),t)};#l=()=>{clearTimeout(this.#n),this.show()};#u=()=>{clearTimeout(this.#i),this.hide()};#m=()=>{clearTimeout(this.#n)};#g=t=>{t.key==="Escape"&&this.isVisible&&this.hide()};show(){!this.#t||this.isVisible||(this.#t.showPopover(),this.#r?this.#A():this.#s&&this.#v(),this.dispatchEvent(new CustomEvent("tool-tip:show",{bubbles:!0})))}hide(){!this.#t||!this.isVisible||(this.#t.hidePopover(),this.dispatchEvent(new CustomEvent("tool-tip:hide",{bubbles:!0})))}#v(){if(!this.#e||!this.#t)return;let t=this.#e.getBoundingClientRect(),e=this.#t.getBoundingClientRect(),s=this.getAttribute("position")||"top",n=8,r,a;switch(s){case"bottom":r=t.bottom+n,a=t.left+(t.width-e.width)/2;break;case"left":r=t.top+(t.height-e.height)/2,a=t.left-e.width-n;break;case"right":r=t.top+(t.height-e.height)/2,a=t.right+n;break;default:r=t.top-e.height-n,a=t.left+(t.width-e.width)/2;break}let o=8;a=Math.max(o,Math.min(a,window.innerWidth-e.width-o)),r=Math.max(o,Math.min(r,window.innerHeight-e.height-o)),this.#t.style.top=`${r}px`,this.#t.style.left=`${a}px`}#A(){if(!this.#e||!this.#t)return;let t=this.#e.getBoundingClientRect(),e=this.#t.getBoundingClientRect(),s=this.getAttribute("position")||"bottom",n=8,r=8,a,o;o=t.left+(t.width-e.width)/2,o=Math.max(r,Math.min(o,window.innerWidth-e.width-r)),s==="top"?(a=t.top-e.height-n,a<r&&(a=t.bottom+n)):(a=t.bottom+n,a+e.height>window.innerHeight-r&&(a=t.top-e.height-n)),this.#t.style.position="fixed",this.#t.style.top=`${a}px`,this.#t.style.left=`${o}px`}get isVisible(){return this.#t?.matches(":popover-open")??!1}};f("tool-tip",Ne);var F="popover"in HTMLElement.prototype;var De=class extends m{#e;#t;#i=[];#n=-1;#s=!1;#r=!1;#a=null;#c=!1;setup(){if(this.#e=this.querySelector(":scope > [data-trigger]"),this.#e||(this.#e=this.querySelector(":scope > button")),!this.#e||(this.#t=this.querySelector(':scope > menu, :scope > ul[role="menu"]'),!this.#t))return!1;this.#r=this.hasAttribute("hover"),this.#c=F&&!this.#r,this.#c&&this.#t.setAttribute("popover","auto"),this.#e.setAttribute("aria-haspopup","menu"),this.#e.setAttribute("aria-expanded","false"),this.#t.id||(this.#t.id=`dropdown-menu-${crypto.randomUUID().slice(0,8)}`),this.#e.setAttribute("aria-controls",this.#t.id),this.#t.setAttribute("role","menu"),this.#o(),this.#r?(this.listen(this,"mouseenter",this.#h),this.listen(this,"mouseleave",this.#f),this.listen(this.#e,"focus",this.#d),this.listen(this.#e,"blur",this.#l)):this.listen(this.#e,"click",this.#p),this.listen(this.#e,"keydown",this.#u),this.listen(this.#t,"keydown",this.#m),this.#c?this.listen(this.#t,"toggle",this.#A):(this.listen(document,"click",this.#g),this.listen(document,"keydown",this.#v))}teardown(){this.#a&&clearTimeout(this.#a)}#o(){this.#i=Array.from(this.#t.querySelectorAll('button, a, [role="menuitem"]')).filter(t=>!t.disabled&&!t.closest('[role="separator"]')),this.#i.forEach((t,e)=>{t.setAttribute("role","menuitem"),t.setAttribute("tabindex","-1"),t.style.cssText+=";border:none;box-shadow:none;transform:none;border-radius:0;",t.addEventListener("click",this.#b)}),this.#t.querySelectorAll('li:empty, [role="separator"], hr').forEach(t=>{t.setAttribute("role","separator")})}#p=t=>{t.stopPropagation(),this.toggle()};#h=()=>{this.#a&&(clearTimeout(this.#a),this.#a=null),this.open()};#f=()=>{this.#a=setTimeout(()=>{this.close()},100)};#d=()=>{this.#a&&(clearTimeout(this.#a),this.#a=null),this.open()};#l=t=>{this.#t?.contains(t.relatedTarget)||(this.#a=setTimeout(()=>{this.contains(document.activeElement)||this.close()},100))};#u=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.open(),this.#y(0);break;case"ArrowUp":case"Up":t.preventDefault(),this.open(),this.#y(this.#i.length-1);break}};#m=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.#y(this.#n+1);break;case"ArrowUp":case"Up":t.preventDefault(),this.#y(this.#n-1);break;case"Home":t.preventDefault(),this.#y(0);break;case"End":t.preventDefault(),this.#y(this.#i.length-1);break;case"Tab":this.close();break;case"Enter":case" ":t.preventDefault(),this.#n>=0&&this.#i[this.#n].click();break}};#g=t=>{this.#s&&!this.contains(t.target)&&this.close()};#v=t=>{t.key==="Escape"&&this.#s&&(t.preventDefault(),this.close(),this.#e?.focus())};#A=t=>{t.newState==="closed"&&this.#s&&(this.#s=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"),this.#n=-1,this.dispatchEvent(new CustomEvent("drop-down:close",{bubbles:!0})))};#b=t=>{t.defaultPrevented||(this.close(),this.#e?.focus())};#y(t){this.#i.length!==0&&(t<0&&(t=this.#i.length-1),t>=this.#i.length&&(t=0),this.#n=t,this.#i[t].focus())}open(){if(!(this.#s||!this.#t)){if(this.#s=!0,this.setAttribute("open",""),this.#e?.setAttribute("aria-expanded","true"),this.#n=-1,this.#w(),this.#c)try{this.#t.showPopover()}catch{}this.dispatchEvent(new CustomEvent("drop-down:open",{bubbles:!0}))}}close(){if(!(!this.#s||!this.#t)){if(this.#s=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"),this.#n=-1,this.#c)try{this.#t.hidePopover()}catch{}this.dispatchEvent(new CustomEvent("drop-down:close",{bubbles:!0}))}}toggle(){this.#s?this.close():this.open()}#w(){if(!this.#e||!this.#t)return;let t=this.getAttribute("position")||"bottom-start",e=this.hasAttribute("no-flip"),s=this.#e.getBoundingClientRect(),n=this.#t.getBoundingClientRect(),r=window.innerHeight,a=window.innerWidth,o=4;if(this.#c){let c,l;t.startsWith("top")?(c=s.top-n.height-o,!e&&c<0&&(c=s.bottom+o)):(c=s.bottom+o,!e&&c+n.height>r&&(c=s.top-n.height-o)),t.endsWith("end")?(l=s.right-n.width,l<0&&(l=s.left)):(l=s.left,l+n.width>a&&(l=s.right-n.width)),this.#t.style.setProperty("--dropdown-top",`${Math.max(0,c)}px`),this.#t.style.setProperty("--dropdown-left",`${Math.max(0,l)}px`)}else{let c,l;t.startsWith("top")?(c=-n.height-o,!e&&s.top+c<0&&(c=s.height+o)):(c=s.height+o,!e&&s.bottom+n.height+o>r&&(c=-n.height-o)),t.endsWith("end")?(l=s.width-n.width,s.left+l<0&&(l=0)):(l=0,s.left+n.width>a&&(l=s.width-n.width)),this.#t.style.setProperty("--dropdown-top",`${c}px`),this.#t.style.setProperty("--dropdown-left",`${l}px`)}}get isOpen(){return this.#s}};f("drop-down",De);var Ys=`
|
|
8
8
|
:host {
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
align-items: center;
|
|
@@ -66,9 +66,9 @@ svg {
|
|
|
66
66
|
display: none;
|
|
67
67
|
}
|
|
68
68
|
`;var gt=new Map,yt=new Map,_e=class i extends HTMLElement{static#e=new Set;static#t=null;static#i(){i.#t||(i.#t=new MutationObserver(t=>{for(let e of t)if(e.attributeName==="data-icon-set")for(let s of i.#e)s.hasAttribute("set")||(s.render(),s.loadIcon())}),i.#t?.observe(document.documentElement,{attributes:!0,attributeFilter:["data-icon-set"]}))}static get observedAttributes(){return["name","set","size","label"]}constructor(){super(),this.attachShadow({mode:"open"})}get name(){return this.getAttribute("name")||""}get set(){return this.getAttribute("set")||document.documentElement.dataset.iconSet||"lucide"}get size(){return this.getAttribute("size")||"md"}get label(){return this.getAttribute("label")}get basePath(){return this.getAttribute("base-path")||document.documentElement.dataset.iconPath||"/cdn/icons"}get iconPath(){return`${this.basePath}/${this.set}/${this.name}.svg`}render(){this.shadowRoot.innerHTML=`
|
|
69
|
-
<style>${
|
|
69
|
+
<style>${Ys}</style>
|
|
70
70
|
<slot></slot>
|
|
71
|
-
`}async loadIcon(){if(!this.name){this.setError("No icon name specified");return}let t=`${this.set}/${this.name}`;if(gt.has(t)){this.displayIcon(gt.get(t));return}try{let e=await this.#n(this.set,t);this.displayIcon(e)}catch(e){let s="lucide";if(this.set!==s){let n=`${s}/${this.name}`;if(gt.has(n)){this.displayIcon(gt.get(n));return}try{let r=await this.#n(s,n);this.displayIcon(r);return}catch{}}this.setError(e.message)}}async#n(t,e){return yt.has(e)||yt.set(e,this.#s(t).then(s=>(gt.set(e,s),yt.delete(e),s)).catch(s=>{throw yt.delete(e),s})),yt.get(e)}async#s(t){let e=`${this.basePath}/${t}/${this.name}.svg`,s=await fetch(e);if(!s.ok)throw new Error(`Icon not found: ${this.name}`);let n=await s.text();if(!n.includes("<svg"))throw new Error(`Invalid SVG: ${this.name}`);return n}displayIcon(t){let n=new DOMParser().parseFromString(t,"image/svg+xml").querySelector("svg");if(!n){this.setError("Invalid SVG content");return}n.removeAttribute("width"),n.removeAttribute("height"),this.label?(n.setAttribute("role","img"),n.setAttribute("aria-label",this.label)):n.setAttribute("aria-hidden","true"),this.removeAttribute("data-error");let r=this.shadowRoot?.querySelector("slot");r&&r.replaceWith(n)}setError(t){this.setAttribute("data-error","true"),console.warn(`icon-wc: ${t}`);let e=this.shadowRoot?.querySelector("slot");e&&(e.textContent="")}connectedCallback(){i.#e.add(this),i.#i(),this.render(),this.loadIcon(),this._onThemeChange=()=>{let t=this.shadowRoot?.querySelector("svg");t&&(t.style.stroke="none",requestAnimationFrame(()=>{t.style.stroke=""}))},window.addEventListener("vb:theme-change",this._onThemeChange),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded"),i.#e.delete(this),this._onThemeChange&&window.removeEventListener("vb:theme-change",this._onThemeChange)}attributeChangedCallback(t,e,s){if(e!==s&&this.isConnected){if(t==="name"||t==="set")this.render(),this.loadIcon();else if(t==="label"){let n=this.shadowRoot?.querySelector("svg");n&&(s?(n.setAttribute("role","img"),n.setAttribute("aria-label",s)):(n.removeAttribute("role"),n.setAttribute("aria-hidden","true")))}}}};f("icon-wc",_e);var qe=class extends m{#e;#t=new WeakSet;setup(){this.#i(),this.#e=new MutationObserver(t=>{for(let e of t)e.type==="childList"&&this.#i()}),this.#e.observe(this,{childList:!0,subtree:!0})}teardown(){this.#e?.disconnect()}#i(){let e=(this.getAttribute("levels")||"h2,h3").split(",").map(n=>n.trim()).join(","),s=this.querySelectorAll(e);for(let n of s)this.#t.has(n)||(this.#n(n),this.#t.add(n))}#n(t){if(t.closest("dialog, [data-toc-ignore]")||t.hasAttribute("data-toc-ignore")||(t.id||(t.id=this.#s(t.textContent)),t.querySelector(".heading-anchor")))return;let e=document.createElement("a");e.className="heading-anchor",e.href=`#${t.id}`,e.setAttribute("aria-label",`Link to ${t.textContent.trim()}`),e.innerHTML='<icon-wc name="link" size="sm"></icon-wc>',e.addEventListener("click",s=>{s.preventDefault(),this.#r(t,e)}),t.appendChild(e),t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1")}#s(t){let e=t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").substring(0,50),s=e,n=1;for(;document.getElementById(s);)s=`${e}-${n}`,n++;return s}async#r(t,e){let s=new URL(window.location.href);s.hash=t.id,window.history.pushState(null,"",s),t.scrollIntoView({behavior:"smooth",block:"start"}),t.focus();try{await navigator.clipboard.writeText(s.href);let n=e.innerHTML;e.innerHTML='<icon-wc name="check" size="sm"></icon-wc>',e.classList.add("copied"),setTimeout(()=>{e.innerHTML=n,e.classList.remove("copied")},1500),this.#a("Link copied to clipboard")}catch{}this.dispatchEvent(new CustomEvent("heading-links:navigate",{bubbles:!0,detail:{id:t.id,url:s.href}}))}#a(t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="sr-only",e.textContent=t,this.appendChild(e),setTimeout(()=>e.remove(),1e3)}};f("heading-links",qe);var $e=class extends m{#e;#t=[];#i=new Map;#n;#s;#r;#a=!1;setup(){requestAnimationFrame(()=>this.#c())}teardown(){this.#e?.disconnect(),clearTimeout(this.#r)}#c(){this.#a=this.#o(),this.#a?this.#p():this.#v(),this.#y(),this.#h(),this.#l()}#o(){return this.querySelector("nav, details")!==null}#p(){this.#s=this.querySelector("details");let t=this.querySelectorAll('a[href^="#"]');for(let e of t){let s=e.getAttribute("href");if(!s)continue;let n=s.slice(1);if(n){let r=document.getElementById(n);r&&(this.#t.push(r),this.#i.set(n,e),e.classList.contains("link")||e.classList.add("link"),e.addEventListener("click",a=>{a.preventDefault(),this.#b(r)}))}}}#h(){this.#n=window.matchMedia("(min-width: 64rem)"),this.listen(this.#n,"change",this.#f),this.listen(window,"resize",this.#d)}#f=t=>{t.matches&&this.#s&&(this.#s.open=!0)};#d=()=>{clearTimeout(this.#r),this.#r=setTimeout(()=>this.#m(),150)};#l(){this.listen(window,"hashchange",this.#u),this.#m()}#u=()=>{this.#m()};#m(){let t=window.location.hash.slice(1);t&&this.#i.has(t)&&this.#g(t)}#g(t){for(let s of this.#i.values())s.classList.remove("active"),s.removeAttribute("aria-current");let e=this.#i.get(t);e&&(e.classList.add("active"),e.setAttribute("aria-current","true"))}#v(){let t=(this.getAttribute("levels")||"h2,h3").split(",").map(h=>h.trim().toLowerCase()),e=this.getAttribute("scope")||"main",s=this.getAttribute("title")||"On this page",n=document.querySelector(e);if(!n||(this.#t=Array.from(n.querySelectorAll(t.join(","))).filter(h=>h.id).filter(h=>!h.hasAttribute("data-toc-ignore")&&!h.closest("[data-toc-ignore]")),this.#t.length===0))return;let r={depth:-1,children:[]},a=[r];for(let h of this.#t){let d=t.indexOf(h.tagName.toLowerCase());for(;a[a.length-1].depth>=d;)a.pop();let u={heading:h,depth:d,children:[]};a[a.length-1].children.push(u),a.push(u)}let o=h=>{let d=document.createElement("ul");d.className="list";for(let u of h){let b=document.createElement("li");b.className="item",b.dataset.level=String(u.depth);let y=document.createElement("a");y.href=`#${u.heading.id}`,y.className="link",y.textContent=this.#A(u.heading),y.addEventListener("click",p=>{p.preventDefault(),this.#b(u.heading)}),b.appendChild(y),u.children.length&&b.appendChild(o(u.children)),d.appendChild(b),this.#i.set(u.heading.id,y)}return d};this.#s=document.createElement("details"),this.#s.className="details",this.#s.open=!0;let c=document.createElement("summary");c.className="summary",c.textContent=s,this.#s.appendChild(c);let l=document.createElement("nav");l.className="nav",l.setAttribute("aria-label",s),l.appendChild(o(r.children)),this.#s.appendChild(l),this.appendChild(this.#s)}#A(t){let e=t.cloneNode(!0);return e.querySelectorAll(".heading-anchor").forEach(n=>n.remove()),e.textContent.trim()}#b(t){let e=new URL(window.location.href);e.hash=t.id,window.history.pushState(null,"",e),t.scrollIntoView({behavior:"smooth",block:"start"}),t.focus(),this.dispatchEvent(new CustomEvent("page-toc:navigate",{bubbles:!0,detail:{id:t.id}}))}#y(){if(this.#t.length===0)return;let t=new Set;this.#e=new IntersectionObserver(e=>{for(let s of e)s.isIntersecting?t.add(s.target.id):t.delete(s.target.id);this.#w(t)},{rootMargin:"-80px 0px -70% 0px",threshold:0});for(let e of this.#t)this.#e.observe(e)}#w(t){for(let e of this.#t)if(t.has(e.id)){this.#g(e.id);return}this.#m()}refresh(){this.#a||(this.innerHTML=""),this.#i.clear(),this.#t=[],this.#e?.disconnect(),this.#c()}};f("page-toc",$e);var Ie=class extends m{#e;#t;#i=[];#n=[];#s=[];#r=-1;#a=null;#c=1;#o=0;#p=null;#h=null;#f=null;#d="";#l=null;#u=null;setup(){if(this.#e=this.querySelector(":scope > table"),!this.#e||(this.#t=this.#e.querySelector("tbody"),!this.#t))return!1;this.#m()}teardown(){this.#g(),this.#i=[],this.#n=[],this.#s=[]}#m(){this.#n=[...this.#t.querySelectorAll(":scope > tr:not([data-expand-content])")],this.#s=[...this.#n],this.#v(),this.#e.hasAttribute("data-filterable")&&this.#$();let t=this.#e.getAttribute("data-paginate");t&&(this.#o=parseInt(t,10),this.#o>0&&this.#I()),this.#_(),this.#T(),this.#C()}#g(){this.#f&&clearTimeout(this.#f),this.#p?.parentElement?.remove(),this.#h?.remove()}#v(){this.#e.querySelectorAll("thead th[data-sort]").forEach((e,s)=>{let n=e.getAttribute("data-sort"),r=this.#A(e);this.#i.push({th:e,sortType:n,columnIndex:r}),e.setAttribute("tabindex","0"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e.dataset.columnIndex=r,this.listen(e,"click",this.#b),this.listen(e,"keydown",this.#y)})}#A(t){return[...t.parentElement.children].indexOf(t)}#b=t=>{let e=t.currentTarget,s=parseInt(e.dataset.columnIndex,10);this.#B(s)};#y=t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();let e=t.currentTarget,s=parseInt(e.dataset.columnIndex,10);this.#B(s)}};#w(t,e,s){let n=this.#s;if(n.length<2)return!0;let r=s==="asc"?1:-1;for(let a=1;a<n.length;a++){let o=this.#S(n[a-1].children[t],e),c=this.#S(n[a].children[t],e);if((typeof o=="string"?o.localeCompare(c)*r:(o-c)*r)>0)return!1}return!0}#B(t){let e=this.#i.find(n=>n.columnIndex===t);if(!e)return;let s;this.#r===t?s=this.#a==="asc"?"desc":"asc":this.#w(t,e.sortType,"asc")?s="desc":s="asc",this.#i.forEach(({th:n})=>{n.setAttribute("aria-sort","none")}),e.th.setAttribute("aria-sort",s==="asc"?"ascending":"descending"),this.#r=t,this.#a=s,this.#N(t,s,e.sortType),this.#c=1,this.#C(),this.dispatchEvent(new CustomEvent("data-table:sort",{detail:{column:t,direction:s,columnName:e.th.textContent.trim()},bubbles:!0}))}#N(t,e,s){let n=e==="asc"?1:-1;this.#s.sort((r,a)=>{let o=r.children[t],c=a.children[t];if(!o||!c)return 0;let l=this.#S(o,s),h=this.#S(c,s),d=0;switch(s){case"number":d=l-h;break;case"date":d=l-h;break;default:d=l.localeCompare(h,void 0,{numeric:!0,sensitivity:"base"});break}return d*n})}#S(t,e){let n=t.getAttribute("data-sort-value")??t.textContent.trim();switch(e){case"number":return parseFloat(n)||0;case"date":return new Date(n).getTime()||0;default:return n.toLowerCase()}}#$(){let t=document.createElement("div");t.setAttribute("data-table-filter","");let e=document.createElement("input");e.type="search",e.setAttribute("data-filter-input",""),e.setAttribute("placeholder","Filter table..."),e.setAttribute("aria-label","Filter table rows"),t.appendChild(e),this.insertBefore(t,this.#e),this.#p=e,this.listen(e,"input",this.#D)}#D=t=>{let e=t.target.value;this.#f&&clearTimeout(this.#f),this.#f=setTimeout(()=>{this.#k(e)},150)};#k(t){if(this.#d=t.toLowerCase().trim(),this.#d===""?this.#s=[...this.#n]:this.#s=this.#n.filter(e=>[...e.children].some(n=>(n.getAttribute("data-filter-value")??n.textContent).toLowerCase().includes(this.#d))),this.#r>=0&&this.#a){let e=this.#i.find(s=>s.columnIndex===this.#r);e&&this.#N(this.#r,this.#a,e.sortType)}this.#c=1,this.#C(),this.dispatchEvent(new CustomEvent("data-table:filter",{detail:{query:this.#d,count:this.#s.length},bubbles:!0}))}#I(){let t=document.createElement("nav");t.setAttribute("data-pagination",""),t.setAttribute("aria-label","Table pagination"),this.appendChild(t),this.#h=t}#_(){this.listen(this.#e,"click",this.#F)}#F=t=>{let e=t.target.closest('[data-action="toggle-expand"]');if(!e)return;let s=e.closest("tr[data-expandable]");if(!s)return;let n=s.hasAttribute("data-state-expanded"),r=s.nextElementSibling;n?(s.removeAttribute("data-state-expanded"),e.setAttribute("aria-expanded","false"),r?.hasAttribute("data-expand-content")&&(r.hidden=!0,r.setAttribute("aria-hidden","true"))):(s.setAttribute("data-state-expanded",""),e.setAttribute("aria-expanded","true"),r?.hasAttribute("data-expand-content")&&(r.hidden=!1,r.removeAttribute("aria-hidden"))),this.dispatchEvent(new CustomEvent("data-table:expand",{detail:{row:s,expanded:!n},bubbles:!0}))};#T(){this.#l=this.#e.querySelector('thead [data-action="select-all"]'),this.#l&&this.listen(this.#l,"change",this.#q),this.listen(this.#t,"change",this.#L),this.#u=this.querySelector("[data-selected-count]"),this.#x()}#q=t=>{let e=t.target.checked;this.#t.querySelectorAll("tr[data-selectable]").forEach(n=>{let r=n.querySelector('[data-action="select-row"]');e?(n.setAttribute("data-state-selected",""),r&&(r.checked=!0)):(n.removeAttribute("data-state-selected"),r&&(r.checked=!1))}),t.target.indeterminate=!1,this.#M(),this.#P()};#L=t=>{let e=t.target.closest('[data-action="select-row"]');if(!e)return;let s=e.closest("tr[data-selectable]");s&&(e.checked?s.setAttribute("data-state-selected",""):s.removeAttribute("data-state-selected"),this.#x(),this.#P())};#x(){if(!this.#l){this.#M();return}let t=this.#t.querySelectorAll("tr[data-selectable]"),e=this.#t.querySelectorAll("tr[data-selectable][data-state-selected]"),s=t.length,n=e.length;n===0?(this.#l.checked=!1,this.#l.indeterminate=!1):n===s?(this.#l.checked=!0,this.#l.indeterminate=!1):(this.#l.checked=!1,this.#l.indeterminate=!0),this.#M()}#M(){let e=this.#t.querySelectorAll("tr[data-selectable][data-state-selected]").length;this.#u&&(this.#u.textContent=e)}#P(){let t=[...this.#t.querySelectorAll("tr[data-selectable][data-state-selected]")];this.dispatchEvent(new CustomEvent("data-table:selection",{detail:{count:t.length,rows:t},bubbles:!0}))}#V(){if(!this.#h||this.#o<=0)return;let t=this.#h,e=Math.ceil(this.#s.length/this.#o);if(t.innerHTML="",e<=1)return;let s=document.createElement("button");s.type="button",s.textContent="Previous",s.setAttribute("data-pagination-prev",""),s.disabled=this.#c===1,s.addEventListener("click",()=>this.goToPage(this.#c-1)),t.appendChild(s),this.#E(e).forEach(a=>{if(a==="..."){let o=document.createElement("span");o.textContent="...",o.setAttribute("data-pagination-ellipsis",""),t.appendChild(o)}else{let o=document.createElement("button");o.type="button",o.textContent=a,o.setAttribute("data-pagination-page",""),a===this.#c&&(o.setAttribute("aria-current","page"),o.setAttribute("data-current","")),o.addEventListener("click",()=>this.goToPage(a)),t.appendChild(o)}});let r=document.createElement("button");r.type="button",r.textContent="Next",r.setAttribute("data-pagination-next",""),r.disabled=this.#c===e,r.addEventListener("click",()=>this.goToPage(this.#c+1)),t.appendChild(r)}#E(t){let e=this.#c,s=[];if(t<=7)for(let n=1;n<=t;n++)s.push(n);else{s.push(1),e>3&&s.push("...");let n=Math.max(2,e-1),r=Math.min(t-1,e+1);for(let a=n;a<=r;a++)s.push(a);e<t-2&&s.push("..."),s.push(t)}return s}#C(){this.#n.forEach(e=>{e.setAttribute("data-state-hidden","")});let t;if(this.#o>0){let e=(this.#c-1)*this.#o,s=e+this.#o;t=this.#s.slice(e,s)}else t=this.#s;t.forEach(e=>{e.removeAttribute("data-state-hidden"),this.#t.appendChild(e);let s=e.nextElementSibling?.hasAttribute?.("data-expand-content")?e.nextElementSibling:this.#R(e);s&&this.#t.appendChild(s)}),this.#s.forEach(e=>{if(e.hasAttribute("data-state-hidden")){this.#t.appendChild(e);let s=this.#R(e);s&&this.#t.appendChild(s)}}),this.#n.forEach(e=>{if(!this.#s.includes(e)){this.#t.appendChild(e);let s=this.#R(e);s&&this.#t.appendChild(s)}}),this.#V()}#R(t){if(!t.hasAttribute("data-expandable"))return null;let e=t.nextElementSibling;return e?.hasAttribute("data-expand-content")?e:null}goToPage(t){let e=Math.ceil(this.#s.length/this.#o),s=Math.max(1,Math.min(t,e));s!==this.#c&&(this.#c=s,this.#C(),this.dispatchEvent(new CustomEvent("data-table:page",{detail:{page:this.#c},bubbles:!0})))}setFilter(t){this.#p&&(this.#p.value=t),this.#k(t)}refresh(){if(this.#n=[...this.#t.querySelectorAll(":scope > tr")],this.#d?this.#k(this.#d):this.#s=[...this.#n],this.#r>=0&&this.#a){let e=this.#i.find(s=>s.columnIndex===this.#r);e&&this.#N(this.#r,this.#a,e.sortType)}let t=Math.max(1,Math.ceil(this.#s.length/this.#o));this.#c>t&&(this.#c=t),this.#C()}get currentPage(){return this.#c}get totalPages(){return this.#o<=0?1:Math.ceil(this.#s.length/this.#o)}get filteredCount(){return this.#s.length}get totalCount(){return this.#n.length}getSelectedRows(){return this.#t?[...this.#t.querySelectorAll("tr[data-selectable][data-state-selected]")]:[]}};f("data-table",Ie);var lt=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),vt={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",shift:"\u21E7",ctrl:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",shift:"Shift",ctrl:"Ctrl"}};function Ys(i){let t=lt?vt.mac:vt.other;return i.split("+").map(e=>{let s=e.trim().toLowerCase();return t[s]??s.toUpperCase()}).join(lt?"":"+")}function Gs(i){let t=i.toLowerCase().split("+").map(s=>s.trim());return{key:t.pop()??"",meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl"),shift:t.includes("shift"),alt:t.includes("alt")}}function Ks(i,t){if(i.key.toLowerCase()!==t.key)return!1;let e,s;return lt?(e=t.meta,s=t.ctrl):(e=!1,s=t.meta||t.ctrl),!(e!==i.metaKey||s!==i.ctrlKey||t.shift!==i.shiftKey||t.alt!==i.altKey)}var ba=new Set(["INPUT","TEXTAREA","SELECT"]),ht=[],Xs=!1;function ga(i){let t=ba.has(i.target.tagName)||i.target.isContentEditable;for(let e of ht)if(!(t&&!e.global)&&Ks(i,e.descriptor)){i.preventDefault(),e.callback(i);return}}function ya(){Xs||(document.addEventListener("keydown",ga),Xs=!0)}function Ht(i,t,e={}){ya();let s=Gs(i),n={combo:i,descriptor:s,callback:t,global:e.global===!0};return ht.find(a=>a.combo===i)&&console.warn(`[hotkey-bind] Shortcut "${i}" already bound. Last-connected-wins.`),ht.unshift(n),function(){let o=ht.indexOf(n);o!==-1&&ht.splice(o,1)}}function Js(){return ht.map(i=>i.combo)}var Oe=class i extends m{static#e=150;static#t=8;#i=null;#n=null;#s=null;#r=null;#a=[];#c=-1;#o=!1;#p=null;#h=null;#f=null;setup(){this.#d(),this.#l()}teardown(){this.#o&&(document.body.style.overflow="",this.removeAttribute("open"),this.#o=!1),this.#f?.(),this.#$()}#d(){this.#i=this.querySelector(":scope > [data-trigger]"),this.#i||(this.#i=this.querySelector(":scope > button")),this.#i||(this.#i=document.createElement("button"),this.#i.setAttribute("data-trigger",""),this.#i.innerHTML=`
|
|
71
|
+
`}async loadIcon(){if(!this.name){this.setError("No icon name specified");return}let t=`${this.set}/${this.name}`;if(gt.has(t)){this.displayIcon(gt.get(t));return}try{let e=await this.#n(this.set,t);this.displayIcon(e)}catch(e){let s="lucide";if(this.set!==s){let n=`${s}/${this.name}`;if(gt.has(n)){this.displayIcon(gt.get(n));return}try{let r=await this.#n(s,n);this.displayIcon(r);return}catch{}}this.setError(e.message)}}async#n(t,e){return yt.has(e)||yt.set(e,this.#s(t).then(s=>(gt.set(e,s),yt.delete(e),s)).catch(s=>{throw yt.delete(e),s})),yt.get(e)}async#s(t){let e=`${this.basePath}/${t}/${this.name}.svg`,s=await fetch(e);if(!s.ok)throw new Error(`Icon not found: ${this.name}`);let n=await s.text();if(!n.includes("<svg"))throw new Error(`Invalid SVG: ${this.name}`);return n}displayIcon(t){let n=new DOMParser().parseFromString(t,"image/svg+xml").querySelector("svg");if(!n){this.setError("Invalid SVG content");return}n.removeAttribute("width"),n.removeAttribute("height"),this.label?(n.setAttribute("role","img"),n.setAttribute("aria-label",this.label)):n.setAttribute("aria-hidden","true"),this.removeAttribute("data-error");let r=this.shadowRoot?.querySelector("slot");r&&r.replaceWith(n)}setError(t){this.setAttribute("data-error","true"),console.warn(`icon-wc: ${t}`);let e=this.shadowRoot?.querySelector("slot");e&&(e.textContent="")}connectedCallback(){i.#e.add(this),i.#i(),this.render(),this.loadIcon(),this._onThemeChange=()=>{let t=this.shadowRoot?.querySelector("svg");t&&(t.style.stroke="none",requestAnimationFrame(()=>{t.style.stroke=""}))},window.addEventListener("vb:theme-change",this._onThemeChange),this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded"),i.#e.delete(this),this._onThemeChange&&window.removeEventListener("vb:theme-change",this._onThemeChange)}attributeChangedCallback(t,e,s){if(e!==s&&this.isConnected){if(t==="name"||t==="set")this.render(),this.loadIcon();else if(t==="label"){let n=this.shadowRoot?.querySelector("svg");n&&(s?(n.setAttribute("role","img"),n.setAttribute("aria-label",s)):(n.removeAttribute("role"),n.setAttribute("aria-hidden","true")))}}}};f("icon-wc",_e);var qe=class extends m{#e;#t=new WeakSet;setup(){this.#i(),this.#e=new MutationObserver(t=>{for(let e of t)e.type==="childList"&&this.#i()}),this.#e.observe(this,{childList:!0,subtree:!0})}teardown(){this.#e?.disconnect()}#i(){let e=(this.getAttribute("levels")||"h2,h3").split(",").map(n=>n.trim()).join(","),s=this.querySelectorAll(e);for(let n of s)this.#t.has(n)||(this.#n(n),this.#t.add(n))}#n(t){if(t.closest("dialog, [data-toc-ignore]")||t.hasAttribute("data-toc-ignore")||(t.id||(t.id=this.#s(t.textContent)),t.querySelector(".heading-anchor")))return;let e=document.createElement("a");e.className="heading-anchor",e.href=`#${t.id}`,e.setAttribute("aria-label",`Link to ${t.textContent.trim()}`),e.innerHTML='<icon-wc name="link" size="sm"></icon-wc>',e.addEventListener("click",s=>{s.preventDefault(),this.#r(t,e)}),t.appendChild(e),t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1")}#s(t){let e=t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").substring(0,50),s=e,n=1;for(;document.getElementById(s);)s=`${e}-${n}`,n++;return s}async#r(t,e){let s=new URL(window.location.href);s.hash=t.id,window.history.pushState(null,"",s),t.scrollIntoView({behavior:"smooth",block:"start"}),t.focus();try{await navigator.clipboard.writeText(s.href);let n=e.innerHTML;e.innerHTML='<icon-wc name="check" size="sm"></icon-wc>',e.classList.add("copied"),setTimeout(()=>{e.innerHTML=n,e.classList.remove("copied")},1500),this.#a("Link copied to clipboard")}catch{}this.dispatchEvent(new CustomEvent("heading-links:navigate",{bubbles:!0,detail:{id:t.id,url:s.href}}))}#a(t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="visually-hidden",e.textContent=t,this.appendChild(e),setTimeout(()=>e.remove(),1e3)}};f("heading-links",qe);var $e=class extends m{#e;#t=[];#i=new Map;#n;#s;#r;#a=!1;setup(){requestAnimationFrame(()=>this.#c())}teardown(){this.#e?.disconnect(),clearTimeout(this.#r)}#c(){this.#a=this.#o(),this.#a?this.#p():this.#v(),this.#y(),this.#h(),this.#l()}#o(){return this.querySelector("nav, details")!==null}#p(){this.#s=this.querySelector("details");let t=this.querySelectorAll('a[href^="#"]');for(let e of t){let s=e.getAttribute("href");if(!s)continue;let n=s.slice(1);if(n){let r=document.getElementById(n);r&&(this.#t.push(r),this.#i.set(n,e),e.classList.contains("link")||e.classList.add("link"),e.addEventListener("click",a=>{a.preventDefault(),this.#b(r)}))}}}#h(){this.#n=window.matchMedia("(min-width: 64rem)"),this.listen(this.#n,"change",this.#f),this.listen(window,"resize",this.#d)}#f=t=>{t.matches&&this.#s&&(this.#s.open=!0)};#d=()=>{clearTimeout(this.#r),this.#r=setTimeout(()=>this.#m(),150)};#l(){this.listen(window,"hashchange",this.#u),this.#m()}#u=()=>{this.#m()};#m(){let t=window.location.hash.slice(1);t&&this.#i.has(t)&&this.#g(t)}#g(t){for(let s of this.#i.values())s.classList.remove("active"),s.removeAttribute("aria-current");let e=this.#i.get(t);e&&(e.classList.add("active"),e.setAttribute("aria-current","true"))}#v(){let t=(this.getAttribute("levels")||"h2,h3").split(",").map(h=>h.trim().toLowerCase()),e=this.getAttribute("scope")||"main",s=this.getAttribute("title")||"On this page",n=document.querySelector(e);if(!n||(this.#t=Array.from(n.querySelectorAll(t.join(","))).filter(h=>h.id).filter(h=>!h.hasAttribute("data-toc-ignore")&&!h.closest("[data-toc-ignore]")),this.#t.length===0))return;let r={depth:-1,children:[]},a=[r];for(let h of this.#t){let d=t.indexOf(h.tagName.toLowerCase());for(;a[a.length-1].depth>=d;)a.pop();let u={heading:h,depth:d,children:[]};a[a.length-1].children.push(u),a.push(u)}let o=h=>{let d=document.createElement("ul");d.className="list";for(let u of h){let b=document.createElement("li");b.className="item",b.dataset.level=String(u.depth);let y=document.createElement("a");y.href=`#${u.heading.id}`,y.className="link",y.textContent=this.#A(u.heading),y.addEventListener("click",p=>{p.preventDefault(),this.#b(u.heading)}),b.appendChild(y),u.children.length&&b.appendChild(o(u.children)),d.appendChild(b),this.#i.set(u.heading.id,y)}return d};this.#s=document.createElement("details"),this.#s.className="details",this.#s.open=!0;let c=document.createElement("summary");c.className="summary",c.textContent=s,this.#s.appendChild(c);let l=document.createElement("nav");l.className="nav",l.setAttribute("aria-label",s),l.appendChild(o(r.children)),this.#s.appendChild(l),this.appendChild(this.#s)}#A(t){let e=t.cloneNode(!0);return e.querySelectorAll(".heading-anchor").forEach(n=>n.remove()),e.textContent.trim()}#b(t){let e=new URL(window.location.href);e.hash=t.id,window.history.pushState(null,"",e),t.scrollIntoView({behavior:"smooth",block:"start"}),t.focus(),this.dispatchEvent(new CustomEvent("page-toc:navigate",{bubbles:!0,detail:{id:t.id}}))}#y(){if(this.#t.length===0)return;let t=new Set;this.#e=new IntersectionObserver(e=>{for(let s of e)s.isIntersecting?t.add(s.target.id):t.delete(s.target.id);this.#w(t)},{rootMargin:"-80px 0px -70% 0px",threshold:0});for(let e of this.#t)this.#e.observe(e)}#w(t){for(let e of this.#t)if(t.has(e.id)){this.#g(e.id);return}this.#m()}refresh(){this.#a||(this.innerHTML=""),this.#i.clear(),this.#t=[],this.#e?.disconnect(),this.#c()}};f("page-toc",$e);var Oe=class extends m{#e;#t;#i=[];#n=[];#s=[];#r=-1;#a=null;#c=1;#o=0;#p=null;#h=null;#f=null;#d="";#l=null;#u=null;setup(){if(this.#e=this.querySelector(":scope > table"),!this.#e||(this.#t=this.#e.querySelector("tbody"),!this.#t))return!1;this.#m()}teardown(){this.#g(),this.#i=[],this.#n=[],this.#s=[]}#m(){this.#n=[...this.#t.querySelectorAll(":scope > tr:not([data-expand-content])")],this.#s=[...this.#n],this.#v(),this.#e.hasAttribute("data-filterable")&&this.#$();let t=this.#e.getAttribute("data-paginate");t&&(this.#o=parseInt(t,10),this.#o>0&&this.#O()),this.#_(),this.#T(),this.#C()}#g(){this.#f&&clearTimeout(this.#f),this.#p?.parentElement?.remove(),this.#h?.remove()}#v(){this.#e.querySelectorAll("thead th[data-sort]").forEach((e,s)=>{let n=e.getAttribute("data-sort"),r=this.#A(e);this.#i.push({th:e,sortType:n,columnIndex:r}),e.setAttribute("tabindex","0"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),e.dataset.columnIndex=r,this.listen(e,"click",this.#b),this.listen(e,"keydown",this.#y)})}#A(t){return[...t.parentElement.children].indexOf(t)}#b=t=>{let e=t.currentTarget,s=parseInt(e.dataset.columnIndex,10);this.#P(s)};#y=t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault();let e=t.currentTarget,s=parseInt(e.dataset.columnIndex,10);this.#P(s)}};#w(t,e,s){let n=this.#s;if(n.length<2)return!0;let r=s==="asc"?1:-1;for(let a=1;a<n.length;a++){let o=this.#S(n[a-1].children[t],e),c=this.#S(n[a].children[t],e);if((typeof o=="string"?o.localeCompare(c)*r:(o-c)*r)>0)return!1}return!0}#P(t){let e=this.#i.find(n=>n.columnIndex===t);if(!e)return;let s;this.#r===t?s=this.#a==="asc"?"desc":"asc":this.#w(t,e.sortType,"asc")?s="desc":s="asc",this.#i.forEach(({th:n})=>{n.setAttribute("aria-sort","none")}),e.th.setAttribute("aria-sort",s==="asc"?"ascending":"descending"),this.#r=t,this.#a=s,this.#N(t,s,e.sortType),this.#c=1,this.#C(),this.dispatchEvent(new CustomEvent("data-table:sort",{detail:{column:t,direction:s,columnName:e.th.textContent.trim()},bubbles:!0}))}#N(t,e,s){let n=e==="asc"?1:-1;this.#s.sort((r,a)=>{let o=r.children[t],c=a.children[t];if(!o||!c)return 0;let l=this.#S(o,s),h=this.#S(c,s),d=0;switch(s){case"number":d=l-h;break;case"date":d=l-h;break;default:d=l.localeCompare(h,void 0,{numeric:!0,sensitivity:"base"});break}return d*n})}#S(t,e){let n=t.getAttribute("data-sort-value")??t.textContent.trim();switch(e){case"number":return parseFloat(n)||0;case"date":return new Date(n).getTime()||0;default:return n.toLowerCase()}}#$(){let t=document.createElement("div");t.setAttribute("data-table-filter","");let e=document.createElement("input");e.type="search",e.setAttribute("data-filter-input",""),e.setAttribute("placeholder","Filter table..."),e.setAttribute("aria-label","Filter table rows"),t.appendChild(e),this.insertBefore(t,this.#e),this.#p=e,this.listen(e,"input",this.#D)}#D=t=>{let e=t.target.value;this.#f&&clearTimeout(this.#f),this.#f=setTimeout(()=>{this.#k(e)},150)};#k(t){if(this.#d=t.toLowerCase().trim(),this.#d===""?this.#s=[...this.#n]:this.#s=this.#n.filter(e=>[...e.children].some(n=>(n.getAttribute("data-filter-value")??n.textContent).toLowerCase().includes(this.#d))),this.#r>=0&&this.#a){let e=this.#i.find(s=>s.columnIndex===this.#r);e&&this.#N(this.#r,this.#a,e.sortType)}this.#c=1,this.#C(),this.dispatchEvent(new CustomEvent("data-table:filter",{detail:{query:this.#d,count:this.#s.length},bubbles:!0}))}#O(){let t=document.createElement("nav");t.setAttribute("data-pagination",""),t.setAttribute("aria-label","Table pagination"),this.appendChild(t),this.#h=t}#_(){this.listen(this.#e,"click",this.#F)}#F=t=>{let e=t.target.closest('[data-action="toggle-expand"]');if(!e)return;let s=e.closest("tr[data-expandable]");if(!s)return;let n=s.hasAttribute("data-state-expanded"),r=s.nextElementSibling;n?(s.removeAttribute("data-state-expanded"),e.setAttribute("aria-expanded","false"),r?.hasAttribute("data-expand-content")&&(r.hidden=!0,r.setAttribute("aria-hidden","true"))):(s.setAttribute("data-state-expanded",""),e.setAttribute("aria-expanded","true"),r?.hasAttribute("data-expand-content")&&(r.hidden=!1,r.removeAttribute("aria-hidden"))),this.dispatchEvent(new CustomEvent("data-table:expand",{detail:{row:s,expanded:!n},bubbles:!0}))};#T(){this.#l=this.#e.querySelector('thead [data-action="select-all"]'),this.#l&&this.listen(this.#l,"change",this.#q),this.listen(this.#t,"change",this.#L),this.#u=this.querySelector("[data-selected-count]"),this.#x()}#q=t=>{let e=t.target.checked;this.#t.querySelectorAll("tr[data-selectable]").forEach(n=>{let r=n.querySelector('[data-action="select-row"]');e?(n.setAttribute("data-state-selected",""),r&&(r.checked=!0)):(n.removeAttribute("data-state-selected"),r&&(r.checked=!1))}),t.target.indeterminate=!1,this.#M(),this.#B()};#L=t=>{let e=t.target.closest('[data-action="select-row"]');if(!e)return;let s=e.closest("tr[data-selectable]");s&&(e.checked?s.setAttribute("data-state-selected",""):s.removeAttribute("data-state-selected"),this.#x(),this.#B())};#x(){if(!this.#l){this.#M();return}let t=this.#t.querySelectorAll("tr[data-selectable]"),e=this.#t.querySelectorAll("tr[data-selectable][data-state-selected]"),s=t.length,n=e.length;n===0?(this.#l.checked=!1,this.#l.indeterminate=!1):n===s?(this.#l.checked=!0,this.#l.indeterminate=!1):(this.#l.checked=!1,this.#l.indeterminate=!0),this.#M()}#M(){let e=this.#t.querySelectorAll("tr[data-selectable][data-state-selected]").length;this.#u&&(this.#u.textContent=e)}#B(){let t=[...this.#t.querySelectorAll("tr[data-selectable][data-state-selected]")];this.dispatchEvent(new CustomEvent("data-table:selection",{detail:{count:t.length,rows:t},bubbles:!0}))}#V(){if(!this.#h||this.#o<=0)return;let t=this.#h,e=Math.ceil(this.#s.length/this.#o);if(t.innerHTML="",e<=1)return;let s=document.createElement("button");s.type="button",s.textContent="Previous",s.setAttribute("data-pagination-prev",""),s.disabled=this.#c===1,s.addEventListener("click",()=>this.goToPage(this.#c-1)),t.appendChild(s),this.#E(e).forEach(a=>{if(a==="..."){let o=document.createElement("span");o.textContent="...",o.setAttribute("data-pagination-ellipsis",""),t.appendChild(o)}else{let o=document.createElement("button");o.type="button",o.textContent=a,o.setAttribute("data-pagination-page",""),a===this.#c&&(o.setAttribute("aria-current","page"),o.setAttribute("data-current","")),o.addEventListener("click",()=>this.goToPage(a)),t.appendChild(o)}});let r=document.createElement("button");r.type="button",r.textContent="Next",r.setAttribute("data-pagination-next",""),r.disabled=this.#c===e,r.addEventListener("click",()=>this.goToPage(this.#c+1)),t.appendChild(r)}#E(t){let e=this.#c,s=[];if(t<=7)for(let n=1;n<=t;n++)s.push(n);else{s.push(1),e>3&&s.push("...");let n=Math.max(2,e-1),r=Math.min(t-1,e+1);for(let a=n;a<=r;a++)s.push(a);e<t-2&&s.push("..."),s.push(t)}return s}#C(){this.#n.forEach(e=>{e.setAttribute("data-state-hidden","")});let t;if(this.#o>0){let e=(this.#c-1)*this.#o,s=e+this.#o;t=this.#s.slice(e,s)}else t=this.#s;t.forEach(e=>{e.removeAttribute("data-state-hidden"),this.#t.appendChild(e);let s=e.nextElementSibling?.hasAttribute?.("data-expand-content")?e.nextElementSibling:this.#R(e);s&&this.#t.appendChild(s)}),this.#s.forEach(e=>{if(e.hasAttribute("data-state-hidden")){this.#t.appendChild(e);let s=this.#R(e);s&&this.#t.appendChild(s)}}),this.#n.forEach(e=>{if(!this.#s.includes(e)){this.#t.appendChild(e);let s=this.#R(e);s&&this.#t.appendChild(s)}}),this.#V()}#R(t){if(!t.hasAttribute("data-expandable"))return null;let e=t.nextElementSibling;return e?.hasAttribute("data-expand-content")?e:null}goToPage(t){let e=Math.ceil(this.#s.length/this.#o),s=Math.max(1,Math.min(t,e));s!==this.#c&&(this.#c=s,this.#C(),this.dispatchEvent(new CustomEvent("data-table:page",{detail:{page:this.#c},bubbles:!0})))}setFilter(t){this.#p&&(this.#p.value=t),this.#k(t)}refresh(){if(this.#n=[...this.#t.querySelectorAll(":scope > tr")],this.#d?this.#k(this.#d):this.#s=[...this.#n],this.#r>=0&&this.#a){let e=this.#i.find(s=>s.columnIndex===this.#r);e&&this.#N(this.#r,this.#a,e.sortType)}let t=Math.max(1,Math.ceil(this.#s.length/this.#o));this.#c>t&&(this.#c=t),this.#C()}get currentPage(){return this.#c}get totalPages(){return this.#o<=0?1:Math.ceil(this.#s.length/this.#o)}get filteredCount(){return this.#s.length}get totalCount(){return this.#n.length}getSelectedRows(){return this.#t?[...this.#t.querySelectorAll("tr[data-selectable][data-state-selected]")]:[]}};f("data-table",Oe);var lt=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),vt={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",shift:"\u21E7",ctrl:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",shift:"Shift",ctrl:"Ctrl"}};function Gs(i){let t=lt?vt.mac:vt.other;return i.split("+").map(e=>{let s=e.trim().toLowerCase();return t[s]??s.toUpperCase()}).join(lt?"":"+")}function Ks(i){let t=i.toLowerCase().split("+").map(s=>s.trim());return{key:t.pop()??"",meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl"),shift:t.includes("shift"),alt:t.includes("alt")}}function Xs(i,t){if(i.key.toLowerCase()!==t.key)return!1;let e,s;return lt?(e=t.meta,s=t.ctrl):(e=!1,s=t.meta||t.ctrl),!(e!==i.metaKey||s!==i.ctrlKey||t.shift!==i.shiftKey||t.alt!==i.altKey)}var ya=new Set(["INPUT","TEXTAREA","SELECT"]),ht=[],Js=!1;function va(i){let t=ya.has(i.target.tagName)||i.target.isContentEditable;for(let e of ht)if(!(t&&!e.global)&&Xs(i,e.descriptor)){i.preventDefault(),e.callback(i);return}}function wa(){Js||(document.addEventListener("keydown",va),Js=!0)}function Ht(i,t,e={}){wa();let s=Ks(i),n={combo:i,descriptor:s,callback:t,global:e.global===!0};return ht.find(a=>a.combo===i)&&console.warn(`[hotkey-bind] Shortcut "${i}" already bound. Last-connected-wins.`),ht.unshift(n),function(){let o=ht.indexOf(n);o!==-1&&ht.splice(o,1)}}function Zs(){return ht.map(i=>i.combo)}var Ie=class i extends m{static#e=150;static#t=8;#i=null;#n=null;#s=null;#r=null;#a=[];#c=-1;#o=!1;#p=null;#h=null;#f=null;setup(){this.#d(),this.#l()}teardown(){this.#o&&(document.body.style.overflow="",this.removeAttribute("open"),this.#o=!1),this.#f?.(),this.#$()}#d(){this.#i=this.querySelector(":scope > [data-trigger]"),this.#i||(this.#i=this.querySelector(":scope > button")),this.#i||(this.#i=document.createElement("button"),this.#i.setAttribute("data-trigger",""),this.#i.innerHTML=`
|
|
72
72
|
<icon-wc name="search" label="Search"></icon-wc>
|
|
73
73
|
`,this.prepend(this.#i)),this.#i.setAttribute("aria-haspopup","dialog"),this.#i.setAttribute("aria-expanded","false"),this.#n=document.createElement("div"),this.#n.className="dialog",this.#n.setAttribute("role","dialog"),this.#n.setAttribute("aria-label","Site search"),this.#n.id=`search-dialog-${crypto.randomUUID().slice(0,8)}`,this.#i.setAttribute("aria-controls",this.#n.id),this.#n.innerHTML=`
|
|
74
74
|
<div class="backdrop"></div>
|
|
@@ -101,7 +101,7 @@ svg {
|
|
|
101
101
|
</span>
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
|
-
`,this.appendChild(this.#n),this.#s=this.#n.querySelector(".input"),this.#r=this.#n.querySelector(".results")}#l(){this.#i.addEventListener("click",this.#u),
|
|
104
|
+
`,this.appendChild(this.#n),this.#s=this.#n.querySelector(".input"),this.#r=this.#n.querySelector(".results")}#l(){this.#i.addEventListener("click",this.#u),Zs().includes("meta+k")||(this.#f=Ht("meta+k",()=>{this.#o?this.close():this.open()},{global:!0})),this.listen(document,"keydown",this.#m),this.#n.querySelector(".backdrop")?.addEventListener("click",()=>this.close()),this.#s.addEventListener("input",this.#g),this.#s.addEventListener("keydown",this.#v),this.#r.addEventListener("click",this.#A)}#u=t=>{t.stopPropagation(),this.open()};#m=t=>{t.key==="Escape"&&this.#o&&(t.preventDefault(),this.close())};#g=()=>{this.#$(),this.#h=setTimeout(()=>{this.#y(this.#s.value)},i.#e)};#v=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),this.#N(this.#c+1);break;case"ArrowUp":t.preventDefault(),this.#N(this.#c-1);break;case"Enter":t.preventDefault(),this.#c>=0&&this.#a[this.#c]&&this.#S(this.#a[this.#c]);break}};#A=t=>{let e=t.target.closest("[data-result-index]");if(e){let s=parseInt(e.dataset.resultIndex,10);this.#a[s]&&this.#S(this.#a[s])}};async#b(){if(!this.#p)try{this.#p=await import("/pagefind/pagefind.js"),await this.#p.options({excerptLength:20})}catch{console.warn("Pagefind not available. Run `npm run search:index` to build the search index."),this.#p=null}}async#y(t){if(!t.trim()){this.#w([]);return}if(await this.#b(),!this.#p){this.#P();return}try{this.#r.innerHTML='<div class="loading">Searching...</div>';let e=await this.#p.search(t),s=await Promise.all(e.results.slice(0,i.#t).map(n=>n.data()));this.#a=s,this.#w(s)}catch(e){console.error("Search error:",e),this.#r.innerHTML='<div class="error">Search error. Please try again.</div>'}}#w(t){if(this.#c=-1,t.length===0){this.#s.value.trim()?this.#r.innerHTML='<div class="empty">No results found</div>':this.#r.innerHTML="";return}this.#r.innerHTML=t.map((e,s)=>`
|
|
105
105
|
<a
|
|
106
106
|
id="search-result-${s}"
|
|
107
107
|
href="${e.url}"
|
|
@@ -113,12 +113,12 @@ svg {
|
|
|
113
113
|
<span class="result-title">${e.meta?.title||"Untitled"}</span>
|
|
114
114
|
<span class="result-excerpt">${e.excerpt||""}</span>
|
|
115
115
|
</a>
|
|
116
|
-
`).join("")}#
|
|
116
|
+
`).join("")}#P(){this.#r.innerHTML=`
|
|
117
117
|
<div class="error">
|
|
118
118
|
Search index not found.<br>
|
|
119
119
|
Run <code>npm run search:index</code> after building.
|
|
120
120
|
</div>
|
|
121
|
-
`}#N(t){if(this.#a.length===0)return;t<0&&(t=this.#a.length-1),t>=this.#a.length&&(t=0);let e=this.#r.querySelector("[data-active]");e&&e.removeAttribute("data-active"),this.#s?.removeAttribute("aria-activedescendant"),this.#c=t;let s=this.#r.querySelector(`[data-result-index="${t}"]`);s&&(s.setAttribute("data-active",""),this.#s?.setAttribute("aria-activedescendant",s.id),s.scrollIntoView({block:"nearest"}))}#S(t){t.url&&(this.close(),window.location.href=t.url)}#$(){this.#h&&(clearTimeout(this.#h),this.#h=null)}open(){this.#o||(this.#o=!0,this.setAttribute("open",""),this.#i?.setAttribute("aria-expanded","true"),document.body.style.overflow="hidden",requestAnimationFrame(()=>{this.#s?.focus(),this.#s?.select()}),this.#b(),this.dispatchEvent(new CustomEvent("site-search:open",{bubbles:!0})))}close(){this.#o&&(this.#o=!1,this.removeAttribute("open"),this.#i?.setAttribute("aria-expanded","false"),document.body.style.overflow="",this.#$(),this.#s.value="",this.#s?.removeAttribute("aria-activedescendant"),this.#a=[],this.#c=-1,this.#r.innerHTML="",this.#i?.focus(),this.dispatchEvent(new CustomEvent("site-search:close",{bubbles:!0})))}get isOpen(){return this.#o}};f("site-search",Oe);function Be(i){if(!i||typeof i!="string")return"";let t=document.createElement("template");return t.innerHTML=i,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(n=>n.remove()),t.content.querySelectorAll("*").forEach(n=>{for(let r of[...n.attributes]){if(r.name.startsWith("on")){n.removeAttribute(r.name);continue}if(["href","src","action","formaction","xlink:href"].includes(r.name)){let a=r.value.trim().toLowerCase();(a.startsWith("javascript:")||a.startsWith("data:text/html"))&&n.removeAttribute(r.name);continue}(r.name==="srcdoc"||r.name==="data"&&n.tagName==="OBJECT")&&n.removeAttribute(r.name)}}),t.innerHTML}var va=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function Zs(i){return!i||typeof i!="string"?!1:va.test(i.trim())}function wt(i,t){if(!Zs(t)){console.warn(`[card-list] Unsafe property path rejected: "${t}"`);return}let s=t.replace(/\[(\d+)\]/g,".$1").split("."),n=i;for(let r of s){if(n==null)return;n=n[r]}return n}function wa(i){return i?i.split(",").map(t=>{let[e,s]=t.split(":").map(n=>n.trim());return{attr:e,path:s}}).filter(({attr:t,path:e})=>t&&e):[]}var Pe=class extends m{#e=null;#t=[];#i="id";static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#e=this.querySelector("template"),!this.#e)return console.warn("[card-list] No template found"),!1;this.#i=this.getAttribute("data-key")||"id";let t=this.getAttribute("data-items");if(t){try{this.#t=JSON.parse(t),this.#s()}catch(s){console.error("[card-list] Invalid JSON in data-items:",s)}return}let e=this.getAttribute("src");e&&this.#n(e)}attributeChangedCallback(t,e,s){if(e!==s)if(t==="data-items"&&s)try{this.#t=JSON.parse(s),this.#s()}catch(n){console.error("[card-list] Invalid JSON in data-items:",n)}else t==="src"&&s?this.#n(s):t==="data-key"&&(this.#i=s||"id",this.#s())}async#n(t){try{this.setAttribute("data-loading","");let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();this.#t=Array.isArray(s)?s:s.items||s.data||[],this.#s()}catch(e){console.error("[card-list] Fetch error:",e),this.setAttribute("data-error",e.message)}finally{this.removeAttribute("data-loading")}}#s(){if(!this.#e)return;this.querySelectorAll(":scope > :not(template)").forEach(s=>s.remove());let e=document.createDocumentFragment();for(let s of this.#t){let n=this.#e.content.cloneNode(!0);this.#r(n,s),e.appendChild(n)}this.appendChild(e),this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#t.length},bubbles:!0}))}#r(t,e){t.querySelectorAll("[data-field]").forEach(s=>{let n=s.getAttribute("data-field"),r=wt(e,n);s.textContent=r??""}),t.querySelectorAll("[data-field-attr]").forEach(s=>{let n=wa(s.getAttribute("data-field-attr"));for(let{attr:r,path:a}of n){if(!Zs(a))continue;let o=wt(e,a);o!=null&&s.setAttribute(r,o)}}),t.querySelectorAll("[data-field-html]").forEach(s=>{let n=s.getAttribute("data-field-html"),r=wt(e,n);s.innerHTML=Be(r)}),t.querySelectorAll("[data-field-if]").forEach(s=>{let n=s.getAttribute("data-field-if");wt(e,n)||s.remove()}),t.querySelectorAll("[data-field-unless]").forEach(s=>{let n=s.getAttribute("data-field-unless");wt(e,n)&&s.remove()})}setItems(t){this.#t=Array.isArray(t)?t:[],this.#s()}getItems(){return[...this.#t]}};f("card-list",Pe);var Ea=0;function zt(i,t){return i.matches("content-swap")?t:`data-${t}`}function Vt(i){i.style.viewTransitionName||(i.style.viewTransitionName=`content-swap-${++Ea}`);let t=i.querySelector(':scope > [data-face="front"]'),e=i.querySelector(':scope > [data-face="back"]');if(!t||!e)return;let s=[];function n(o,c,l,h){o.addEventListener(c,l,h),s.push(()=>o.removeEventListener(c,l,h))}let r=[...i.querySelectorAll("[data-swap]")].filter(o=>o!==i&&o.closest("content-swap, [data-swap]")===i);return r.length===0?(i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.getAttribute("aria-label")||i.setAttribute("aria-label","Toggle content"),n(i,"click",()=>At(i,"pointer")),n(i,"keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),At(i,"keyboard"))})):r.forEach(o=>{n(o,"click",c=>{c.stopPropagation(),At(i,"pointer")}),n(o,"keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),At(i,"keyboard"))})}),en(i,t,e),()=>{for(let o of s)o();s.length=0}}function en(i,t,e){let s=i.hasAttribute(zt(i,"swapped"));t.inert=s,e.inert=!s}function Aa(i){return{front:i.querySelector(':scope > [data-face="front"]'),back:i.querySelector(':scope > [data-face="back"]')}}function Et(i,t,e="api"){let{front:s,back:n}=Aa(i);if(!s||!n)return;let r=zt(i,"swapped");if(t&&i.hasAttribute(r)||!t&&!i.hasAttribute(r))return;P(()=>{t?i.setAttribute(r,""):i.removeAttribute(r),en(i,s,n),Sa(i);let o=t?n:s,c=o.querySelector("[autofocus]");c?c.focus():e==="keyboard"&&Ca(o)})}function At(i,t="api"){Et(i,!i.hasAttribute(zt(i,"swapped")),t)}function Sa(i){i.dispatchEvent(new CustomEvent("content-swap:swap",{detail:{swapped:i.hasAttribute(zt(i,"swapped"))},bubbles:!0}))}function Ca(i){let t=i.querySelector("[data-swap], button, a, input, select, textarea");t&&t.focus()}var Fe=class extends m{#e=null;setup(){this.#e=Vt(this)??null}teardown(){this.#e?.(),this.#e=null}flip(){Et(this,!0)}unflip(){Et(this,!1)}toggle(){At(this)}get flipped(){return this.hasAttribute("swapped")}set flipped(t){Et(this,!!t)}get swapped(){return this.hasAttribute("swapped")}set swapped(t){Et(this,!!t)}};f("content-swap",Fe);function Qs(){document.querySelectorAll("[data-swap]:not(content-swap):not([data-swap-init])").forEach(i=>{i.querySelector(":scope > [data-face]")&&(Vt(i),i.setAttribute("data-swap-init",""))})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Qs):Qs();var tn=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.hasAttribute("data-swap")&&!s.matches("content-swap")&&!s.hasAttribute("data-swap-init")&&s.querySelector(":scope > [data-face]")&&(Vt(s),s.setAttribute("data-swap-init","")),s.querySelectorAll("[data-swap]:not(content-swap):not([data-swap-init])").forEach(n=>{n.querySelector(":scope > [data-face]")&&(Vt(n),n.setAttribute("data-swap-init",""))})}});document.body?tn.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{tn.observe(document.body,{childList:!0,subtree:!0})});var xa=0,Re=class extends m{#e;#t=[];#i;#n;#s;#r;#a;#c=null;#o=0;#p=!1;#h=!1;#f=null;get currentIndex(){return this.#o}get slideCount(){return this.#t.length}get playing(){return this.#c!==null}setup(){let t=[...this.children];if(t.length===0)return!1;if(this.#p=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#h=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#h&&this.removeAttribute("transition"),this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#e=document.createElement("div"),this.#e.className="carousel-track",this.#e.setAttribute("tabindex","0"),this.#e.setAttribute("aria-label","Slides"),t.forEach((r,a)=>{r.setAttribute("role","group"),r.setAttribute("aria-roledescription","slide"),r.setAttribute("aria-label",`${a+1} of ${t.length}`),this.#e.appendChild(r)}),this.#t=[...this.#e.children],this.#i=document.createElement("button"),this.#i.className="carousel-prev",this.#i.setAttribute("aria-label","Previous slide"),this.#i.innerHTML='<icon-wc name="chevron-left" size="sm"></icon-wc>',this.#n=document.createElement("button"),this.#n.className="carousel-next",this.#n.setAttribute("aria-label","Next slide"),this.#n.innerHTML='<icon-wc name="chevron-right" size="sm"></icon-wc>',this.getAttribute("indicators")!=="false"&&(this.#s=document.createElement("div"),this.#s.className="carousel-indicators",this.#s.setAttribute("aria-label","Slide indicators"),this.#t.forEach((r,a)=>{let o=document.createElement("button");o.className="carousel-dot",o.setAttribute("aria-label",`Go to slide ${a+1}`),o.setAttribute("aria-current",a===0?"true":"false"),this.listen(o,"click",()=>this.goTo(a)),this.#s.appendChild(o)})),this.#r=document.createElement("div"),this.#r.className="carousel-live",this.#r.setAttribute("aria-live","polite"),this.#r.setAttribute("aria-atomic","true"),this.appendChild(this.#i),this.appendChild(this.#e),this.appendChild(this.#n),this.#s&&this.appendChild(this.#s),this.appendChild(this.#r),this.listen(this.#i,"click",()=>this.prev()),this.listen(this.#n,"click",()=>this.next()),this.listen(this.#e,"keydown",this.#g),this.#h){let r=++xa,a=this.getAttribute("transition")||"fade",o=a==="slide"?"vt-carousel-slide":a==="scale"?"vt-carousel-scale":"vt-carousel";this.#e.style.viewTransitionName=`carousel-${r}`,this.#e.style.viewTransitionClass=o}this.#h&&Promise.resolve().then(()=>(ln(),cn)).then(({addSwipeListener:r})=>{this.#f=r(this.#e,{threshold:40}),this.listen(this.#e,"swipe-left",()=>this.next()),this.listen(this.#e,"swipe-right",()=>this.prev())}),this.#h||(this.#a=new IntersectionObserver(this.#m,{root:this.#e,threshold:.5}),this.#t.forEach(r=>this.#a.observe(r)));let n=this.#A()??(Number(this.getAttribute("start"))||0);if(this.#h){let r=n>0&&n<this.#t.length?n:0;this.#t.forEach((a,o)=>{a.hidden=o!==r}),this.#l(r)}else n>0&&n<this.#t.length&&this.goTo(n,!1);this.#u(),this.hasAttribute("autoplay")&&!this.#p&&this.#v()}teardown(){this.pause(),this.#a&&(this.#a.disconnect(),this.#a=null),this.#f&&(this.#f(),this.#f=null),this.#t=[],this.#h=!1}next(){let t=this.hasAttribute("loop");this.#o<this.#t.length-1?this.goTo(this.#o+1):t&&this.goTo(0)}prev(){let t=this.hasAttribute("loop");this.#o>0?this.goTo(this.#o-1):t&&this.goTo(this.#t.length-1)}goTo(t,e=!0){if(!(t<0||t>=this.#t.length)){if(this.#h)if(e&&t!==this.#o){let s=t>this.#o?"forward":"backward";document.documentElement.dataset.vtDirection=s,P(()=>{this.#d(t)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#d(t);else{let s=this.#t[t].offsetLeft-this.#e.offsetLeft,n=e&&!this.#p?"smooth":"instant";this.#e.scrollTo({left:s,behavior:n})}this.#l(t)}}#d(t){this.#t.forEach((e,s)=>{e.hidden=s!==t})}play(){if(this.#c||this.#p)return;let t=Number(this.getAttribute("autoplay-delay"))||5e3;this.#c=setInterval(()=>this.next(),t),this.dispatchEvent(new CustomEvent("carousel-wc:play",{bubbles:!0}))}pause(){this.#c&&(clearInterval(this.#c),this.#c=null,this.dispatchEvent(new CustomEvent("carousel-wc:pause",{bubbles:!0})))}reset(){let t=Number(this.getAttribute("start"))||0;this.goTo(t,!1),this.#y()}#l(t){this.#o=t,this.#u(),this.#b(),this.#r&&(this.#r.textContent=`Slide ${t+1} of ${this.#t.length}`),this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:t,slide:this.#t[t]},bubbles:!0}))}#u(){let t=this.hasAttribute("loop"),e=this.#o===0,s=this.#o===this.#t.length-1;if(this.#i&&(this.#i.disabled=!t&&e),this.#n&&(this.#n.disabled=!t&&s),this.#s){let n=this.#s.children;for(let r=0;r<n.length;r++){let a=r===this.#o;n[r].setAttribute("aria-current",a?"true":"false"),a?n[r].setAttribute("data-active",""):n[r].removeAttribute("data-active")}}}#m=t=>{for(let e of t)if(e.isIntersecting){let s=this.#t.indexOf(e.target);s!==-1&&s!==this.#o&&this.#l(s)}};#g=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.prev();break;case"ArrowRight":t.preventDefault(),this.next();break;case"Home":t.preventDefault(),this.goTo(0);break;case"End":t.preventDefault(),this.goTo(this.#t.length-1);break}};#v(){this.play(),this.listen(this,"mouseenter",()=>this.pause()),this.listen(this,"mouseleave",()=>{this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"focusin",()=>this.pause()),this.listen(this,"focusout",t=>{!this.contains(t.relatedTarget)&&this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"touchstart",()=>this.pause(),{passive:!0})}#A(){let t=this.getAttribute("persist");if(!t)return null;try{let e=localStorage.getItem(`carousel:${t}`);return e!==null?Number(e):null}catch{return null}}#b(){let t=this.getAttribute("persist");if(t)try{localStorage.setItem(`carousel:${t}`,String(this.#o))}catch{}}#y(){let t=this.getAttribute("persist");if(t)try{localStorage.removeItem(`carousel:${t}`)}catch{}}};f("carousel-wc",Re);function hn(i,t,e){"role"in ElementInternals.prototype?t.role=e:i.setAttribute("role",e)}var He=class extends m{static formAssociated=!0;#e;#t;#i;#n=[];#s=[];#r=-1;#a=!1;#c=!1;#o="";#p="";#h="";#f;#d;#l=[];constructor(){super(),this.#e=this.attachInternals()}get#u(){return this.hasAttribute("multiple")}setup(){if(this.#t=this.querySelector(":scope > input")||this.querySelector(":scope > .tags-input-area > input"),!this.#t||(this.#i=this.querySelector(":scope > ul, :scope > ol"),!this.#i))return!1;this.#c=F,this.#c&&this.#i.setAttribute("popover","manual"),this.#u&&(this.#f=document.createElement("div"),this.#f.className="tags-input-area",this.insertBefore(this.#f,this.#i),this.#f.appendChild(this.#t),this.#d=document.createElement("div"),this.#d.setAttribute("aria-live","polite"),this.#d.setAttribute("aria-atomic","true"),this.#d.className="sr-only",this.appendChild(this.#d));let t=this.getAttribute("placeholder");t&&!this.#t.getAttribute("placeholder")&&this.#t.setAttribute("placeholder",t);let e=crypto.randomUUID().slice(0,8);if(this.#i.id||(this.#i.id=`combobox-listbox-${e}`),hn(this.#t,this.#e,"combobox"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-autocomplete","list"),this.#t.setAttribute("aria-controls",this.#i.id),this.#t.setAttribute("autocomplete","off"),this.#i.setAttribute("role","listbox"),this.#u&&this.#i.setAttribute("aria-multiselectable","true"),this.#m(),!this.#u){let s=this.getAttribute("value");s&&this.#T(s,!1),this.#h=this.#o}this.listen(this.#t,"input",this.#y),this.listen(this.#t,"keydown",this.#w),this.listen(this.#t,"focus",this.#B),this.listen(this.#t,"click",this.#N),this.listen(this.#i,"click",this.#S),this.listen(this.#i,"pointerdown",this.#$),this.listen(document,"click",this.#D),this.#c&&this.listen(this.#i,"toggle",this.#V),this.#E(),this.#C(),this.#x()}teardown(){window.removeEventListener("scroll",this.#q,{capture:!0}),window.removeEventListener("resize",this.#q)}#m(){this.#n=Array.from(this.#i.querySelectorAll(":scope > li[data-value]")),this.#n.forEach((t,e)=>{t.setAttribute("role","option"),t.setAttribute("aria-selected","false"),t.id||(t.id=`${this.#i.id}-option-${e}`)}),this.#s=[...this.#n]}#g(t,e){if(this.#l.some(o=>o.value===t))return;let s=this.#A();if(s&&this.#l.length>=s)return;this.#l.push({value:t,label:e});let n=document.createElement("span");n.className="tag",n.dataset.value=t,n.textContent=e+" ";let r=document.createElement("button");r.type="button",r.setAttribute("aria-label",`Remove ${e}`),r.innerHTML="×",r.addEventListener("click",o=>{o.stopPropagation(),this.#v(t)}),n.appendChild(r),this.#f.insertBefore(n,this.#t);let a=this.#n.find(o=>o.getAttribute("data-value")===t);a&&a.setAttribute("aria-selected","true"),this.#b(`${e} added`),this.#t.value="",this.#k(""),this.#E(),this.#C(),this.#R(),s&&this.#l.length>=s&&(this.#t.disabled=!0,this.#x())}#v(t){let e=this.#l.findIndex(o=>o.value===t);if(e===-1)return;let s=this.#l.splice(e,1)[0],n=this.#f.querySelector(`.tag[data-value="${CSS.escape(t)}"]`);n&&n.remove();let r=this.#n.find(o=>o.getAttribute("data-value")===t);r&&r.setAttribute("aria-selected","false"),this.#b(`${s.label} removed`),this.#A()&&this.#t.disabled&&(this.#t.disabled=!1),this.#k(this.#t.value.trim()),this.#E(),this.#C(),this.#R(),this.#t.focus()}#A(){let t=this.getAttribute("max");return t?parseInt(t,10):0}#b(t){this.#d&&(this.#d.textContent="",requestAnimationFrame(()=>{this.#d.textContent=t}))}#y=()=>{let t=this.#t.value.trim();if(!this.#u&&this.#o){let e=this.#i.querySelector('[aria-selected="true"]');e&&e.setAttribute("aria-selected","false"),this.#o="",this.#p="",this.removeAttribute("value"),this.#E(),this.#C()}this.#k(t),this.#L()};#w=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),this.#a||this.#L(),this.#I(this.#r+1);break;case"ArrowUp":t.preventDefault(),this.#a||this.#L(),this.#I(this.#r-1);break;case"Home":this.#a&&(t.preventDefault(),this.#I(0));break;case"End":this.#a&&(t.preventDefault(),this.#I(this.#s.length-1));break;case"Enter":if(t.preventDefault(),this.#a&&this.#r>=0&&this.#s[this.#r]){let e=this.#s[this.#r];this.#u?this.#g(e.getAttribute("data-value"),e.textContent.trim()):this.#F(e)}else if(this.#u&&this.hasAttribute("custom")&&this.#t.value.trim()){let e=this.#t.value.trim();this.#g(e,e)}break;case"Backspace":if(this.#u&&!this.#t.value&&this.#l.length>0){let e=this.#l[this.#l.length-1];this.#v(e.value)}break;case",":if(this.#u&&this.hasAttribute("custom")&&this.#t.value.trim()){t.preventDefault();let e=this.#t.value.trim();this.#g(e,e)}break;case"Escape":this.#a&&(t.preventDefault(),t.stopPropagation(),this.#x(),this.#t.focus());break;case"Tab":this.#a&&this.#x();break}};#B=()=>{this.#u?(this.#k(this.#t.value.trim()),this.#L()):(this.#t.value||!this.#o)&&(this.#k(this.#t.value.trim()),this.#L())};#N=()=>{this.#a||(this.#k(this.#t.value.trim()),this.#L())};#S=t=>{let e=t.target.closest("li[data-value]");e&&this.#s.includes(e)&&(this.#u?this.#g(e.getAttribute("data-value"),e.textContent.trim()):this.#F(e))};#$=t=>{t.preventDefault()};#D=t=>{this.#a&&!this.contains(t.target)&&this.#x()};#k(t){let e=this.getAttribute("filter")||"contains",s=t.toLowerCase(),n=this.#u?new Set(this.#l.map(r=>r.value)):null;this.#s=[],this.#n.forEach(r=>{let a=r.getAttribute("data-value"),o=r.textContent.trim().toLowerCase();if(n&&n.has(a)){r.hidden=!0;return}let c;t?e==="startsWith"?c=o.startsWith(s):c=o.includes(s):c=!0,r.hidden=!c,c&&this.#s.push(r)}),this.#r=-1,this.#_()}#I(t){if(this.#s.length===0)return;t<0&&(t=this.#s.length-1),t>=this.#s.length&&(t=0),this.#r>=0&&this.#s[this.#r]&&this.#s[this.#r].removeAttribute("data-active"),this.#r=t;let e=this.#s[t];e.setAttribute("data-active",""),e.scrollIntoView({block:"nearest"}),this.#t.setAttribute("aria-activedescendant",e.id)}#_(){this.#n.forEach(t=>t.removeAttribute("data-active")),this.#t.removeAttribute("aria-activedescendant")}#F(t){let e=t.getAttribute("data-value"),s=t.textContent.trim();this.#n.forEach(n=>n.setAttribute("aria-selected","false")),t.setAttribute("aria-selected","true"),this.#o=e,this.#p=s,this.#t.value=s,this.setAttribute("value",e),this.#E(),this.#C(),this.#x(),this.#t.focus(),this.dispatchEvent(new CustomEvent("combo-box:change",{bubbles:!0,detail:{value:e,label:s}}))}#T(t,e=!0){let s=this.#n.find(n=>n.getAttribute("data-value")===t);s&&(e?this.#F(s):(s.setAttribute("aria-selected","true"),this.#o=t,this.#p=s.textContent.trim(),this.#t.value=this.#p,this.setAttribute("value",t)))}#q=()=>this.#P();#L(){if(!this.#a){if(this.#a=!0,this.setAttribute("open",""),this.#t.setAttribute("aria-expanded","true"),this.#i.hidden=!1,this.#c){this.#P();try{this.#i.showPopover()}catch{}window.addEventListener("scroll",this.#q,{capture:!0,passive:!0}),window.addEventListener("resize",this.#q,{passive:!0})}this.dispatchEvent(new CustomEvent("combo-box:open",{bubbles:!0}))}}#x(){if(!(!this.#a&&this.#i.hidden)){if(this.#a=!1,this.removeAttribute("open"),this.#t.setAttribute("aria-expanded","false"),this.#i.hidden=!0,this.#r=-1,this.#_(),this.#c){try{this.#i.hidePopover()}catch{}window.removeEventListener("scroll",this.#q,{capture:!0}),window.removeEventListener("resize",this.#q)}this.dispatchEvent(new CustomEvent("combo-box:close",{bubbles:!0}))}}get#M(){return this.#u&&this.#f?this.#f:this.#t}#P(){if(!this.#c)return;let t=this.#M;if(!t)return;let e=t.getBoundingClientRect();this.#i.style.setProperty("--combobox-top",`${e.bottom+2}px`),this.#i.style.setProperty("--combobox-left",`${e.left}px`),this.#i.style.setProperty("--combobox-width",`${e.width}px`)}#V=t=>{t.newState==="closed"&&this.#a&&(this.#a=!1,this.removeAttribute("open"),this.#t.setAttribute("aria-expanded","false"),this.#i.hidden=!0,this.#r=-1,this.#_(),this.dispatchEvent(new CustomEvent("combo-box:close",{bubbles:!0})))};#E(){if(this.#u)if(this.#l.length>0){let t=new FormData,e=this.getAttribute("name")||"";for(let s of this.#l)t.append(e,s.value);this.#e.setFormValue(t)}else this.#e.setFormValue(null);else this.#o?this.#e.setFormValue(this.#o,this.#p):this.#e.setFormValue(null)}#C(){this.hasAttribute("required")?this.#u?this.#l.length===0?this.#e.setValidity({valueMissing:!0},"Please select at least one option",this.#t):this.#e.setValidity({}):this.#o?this.#e.setValidity({}):this.#e.setValidity({valueMissing:!0},"Please select an option",this.#t):this.#e.setValidity({})}#R(){this.dispatchEvent(new CustomEvent("combo-box:change",{bubbles:!0,detail:{values:this.#l.map(t=>t.value),labels:this.#l.map(t=>t.label)}}))}formResetCallback(){this.#u?(this.#f.querySelectorAll(".tag").forEach(t=>t.remove()),this.#l=[],this.#t.value="",this.#t.disabled=!1):(this.#o="",this.#p="",this.#t.value="",this.removeAttribute("value")),this.#n.forEach(t=>{t.setAttribute("aria-selected","false"),t.hidden=!1}),this.#s=[...this.#n],this.#r=-1,this.#_(),this.#x(),!this.#u&&this.#h&&this.#T(this.#h,!1),this.#E(),this.#C()}formStateRestoreCallback(t){t&&(this.#u||(this.#T(t,!1),this.#E(),this.#C()))}get value(){return this.#o}set value(t){t?this.#T(t):(this.#n.forEach(e=>e.setAttribute("aria-selected","false")),this.#o="",this.#p="",this.#t.value="",this.removeAttribute("value"),this.#E(),this.#C())}get label(){return this.#p}get values(){return this.#l.map(t=>t.value)}get labels(){return this.#l.map(t=>t.label)}static get observedAttributes(){return["value"]}attributeChangedCallback(t,e,s){t==="value"&&this.#t&&s!==this.#o&&s&&(this.#T(s,!1),this.#E(),this.#C())}};f("combo-box",He);function Ta(){try{let i=new Intl.DateTimeFormat(void 0,{hour:"numeric"}).resolvedOptions();return i.hourCycle==="h12"||i.hourCycle==="h11"?"12h":"24h"}catch{return"12h"}}function $(i){return String(i).padStart(2,"0")}function dt(i){if(!i)return null;let t=i.split(":").map(Number);return{h:t[0]||0,m:t[1]||0,s:t[2]||0}}function St(i,t,e,s){return s?`${$(i)}:${$(t)}:${$(e)}`:`${$(i)}:${$(t)}`}function La(i,t,e,s,n){if(n==="12h"){let r=i>=12?"PM":"AM",a=i%12||12;return s?`${a}:${$(t)}:${$(e)} ${r}`:`${a}:${$(t)} ${r}`}return St(i,t,e,s)}function dn(i){let t=i.trim();if(!t)return null;let e=t.match(/\s*(am|pm|a\.m\.|p\.m\.|a|p)\s*$/i),s=null,n=t;e&&(s=e[1].toLowerCase().replace(/\./g,"").startsWith("p")?"PM":"AM",n=t.slice(0,e.index).trim());let r=n.split(/[:.]/);if(r.length<1||r.length>3)return null;let a=Number(r[0]),o=r.length>1?Number(r[1]):0,c=r.length>2?Number(r[2]):0;if(isNaN(a)||isNaN(o)||isNaN(c)||o<0||o>59||c<0||c>59)return null;let l=a;if(s){if(l<1||l>12)return null;s==="AM"?l=l===12?0:l:l=l===12?12:l+12}else if(l<0||l>23)return null;return{h:l,m:o,s:c}}function Ma(i,t,e){return i>e?t:i<t?e:i}var Ve=class extends m{static formAssociated=!0;#e;#t;#i;#n;#s;#r;#a=[];#c;#o;#p;#h=0;#f=0;#d=0;#l="AM";#u=null;#m=null;#g=60;#v;#A=0;#b=!1;#y;constructor(){super(),this.#e=this.attachInternals()}setup(){if(this.#t=this.querySelector(':scope > input[type="time"]'),!this.#t)return!1;this.#g=Number(this.#t.getAttribute("step"))||60,this.#p=this.#g<60,this.#u=dt(this.#t.getAttribute("min")),this.#m=dt(this.#t.getAttribute("max")),this.#o=this.getAttribute("data-format")||Ta();let t=dt(this.#t.value);t&&(this.#h=t.h,this.#f=t.m,this.#d=t.s),this.#v=this.#t.value,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#t.setAttribute("tabindex","-1"),this.#t.setAttribute("aria-hidden","true"),this.#t.style.cssText="position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;overflow:hidden;",this.#w(),this.#B(),this.#V(),this.#E(),this.#C(),this.#R(),this.listen(document,"click",this.#k),(this.#t.disabled||this.hasAttribute("disabled"))&&(this.setAttribute("data-disabled",""),this.#i.disabled=!0)}#w(){this.#n=document.createElement("div"),this.#n.className="time-trigger",this.#i=document.createElement("input"),this.#i.type="text",this.#i.className="time-input",this.#i.setAttribute("role","combobox"),this.#i.setAttribute("aria-haspopup","listbox"),this.#i.setAttribute("aria-expanded","false"),this.#i.setAttribute("autocomplete","off"),this.#i.setAttribute("placeholder","Type a time\u2026"),this.#n.appendChild(this.#i),this.#s=document.createElement("button"),this.#s.type="button",this.#s.className="time-trigger-icon",this.#s.setAttribute("aria-label","Toggle time spinner"),this.#s.setAttribute("tabindex","-1");let t=document.createElement("icon-wc");t.setAttribute("name","clock"),t.setAttribute("size","sm"),t.setAttribute("aria-hidden","true"),this.#s.appendChild(t),this.#n.appendChild(this.#s),this.appendChild(this.#n),this.listen(this.#s,"click",e=>{e.stopPropagation(),this.#b?this.#D():this.#$(),this.#i.focus()}),this.listen(this.#i,"focus",()=>this.#i.select()),this.listen(this.#i,"keydown",this.#I),this.listen(this.#i,"blur",this.#_)}#B(){this.#y=`tp-${Math.random().toString(36).slice(2,8)}`,this.#r=document.createElement("div"),this.#r.className="time-panel",this.#r.id=this.#y,this.#r.setAttribute("role","group"),this.#r.setAttribute("aria-label","Time spinners"),this.#i.setAttribute("aria-controls",this.#y);let t=this.#o==="12h"?1:0,e=this.#o==="12h"?12:23,s=this.#N("Hours",t,e,1);this.#r.appendChild(s.el),this.#a.push(s),this.#r.appendChild(this.#S());let n=this.#g>=60?Math.max(1,Math.round(this.#g/60)):1,r=this.#N("Minutes",0,59,n);if(this.#r.appendChild(r.el),this.#a.push(r),this.#p){this.#r.appendChild(this.#S());let a=this.#N("Seconds",0,59,this.#g);this.#r.appendChild(a.el),this.#a.push(a)}this.#o==="12h"&&(this.#c=document.createElement("button"),this.#c.type="button",this.#c.className="period-toggle",this.#c.setAttribute("aria-label","Toggle AM/PM"),this.#c.textContent=this.#l,this.#r.appendChild(this.#c),this.listen(this.#c,"click",()=>{this.#l=this.#l==="AM"?"PM":"AM",this.#c.textContent=this.#l,this.#h=this.#z(this.#H(),this.#l),this.#P()}),this.listen(this.#c,"keydown",a=>{a.key==="ArrowLeft"&&(a.preventDefault(),this.#O(this.#a.length-1)),a.key==="Escape"&&(a.preventDefault(),this.#D(),this.#i.focus())})),this.appendChild(this.#r)}#N(t,e,s,n){let r=document.createElement("div");r.className="time-spinner",r.setAttribute("role","spinbutton"),r.setAttribute("aria-label",t),r.setAttribute("aria-valuemin",String(e)),r.setAttribute("aria-valuemax",String(s)),r.setAttribute("tabindex","0");let a=document.createElement("button");a.type="button",a.className="time-inc",a.setAttribute("aria-hidden","true"),a.setAttribute("tabindex","-1"),a.innerHTML="▲";let o=document.createElement("span");o.className="time-value";let c=document.createElement("button");c.type="button",c.className="time-dec",c.setAttribute("aria-hidden","true"),c.setAttribute("tabindex","-1"),c.innerHTML="▼",r.appendChild(a),r.appendChild(o),r.appendChild(c);let l={el:r,valueEl:o,label:t,min:e,max:s,step:n};return this.listen(a,"click",()=>{this.#x(l,n)}),this.listen(c,"click",()=>{this.#x(l,-n)}),this.listen(r,"keydown",h=>{this.#F(h,l)}),this.listen(r,"focus",()=>{this.#A=this.#a.indexOf(l)}),l}#S(){let t=document.createElement("span");return t.className="time-sep",t.setAttribute("aria-hidden","true"),t.textContent=":",t}#$(){this.#b||(this.#b=!0,this.#r.setAttribute("data-open",""),this.#i.setAttribute("aria-expanded","true"))}#D(){this.#b&&(this.#b=!1,this.#r.removeAttribute("data-open"),this.#i.setAttribute("aria-expanded","false"))}#k=t=>{this.#b&&!this.contains(t.target)&&this.#D()};#I=t=>{switch(t.key){case"Enter":{t.preventDefault(),t.stopPropagation();let e=dn(this.#i.value);e&&(this.#h=e.h,this.#f=e.m,this.#d=e.s,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#P()),this.#E(),this.#b&&this.#D();return}case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.#b||this.#$(),requestAnimationFrame(()=>this.#O(0));return;case"Escape":t.preventDefault(),t.stopPropagation(),this.#b&&this.#D(),this.#E();return;case"Tab":this.#b&&this.#D();return}};#_=t=>{if(t.relatedTarget&&this.contains(t.relatedTarget))return;let e=this.#i.value.trim();if(e){let s=dn(e);s&&(this.#h=s.h,this.#f=s.m,this.#d=s.s,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#C(),this.#R(),this.dispatchEvent(new CustomEvent("time-picker:change",{bubbles:!0,detail:{value:St(this.#h,this.#f,this.#d,this.#p),hours:this.#h,minutes:this.#f,seconds:this.#d}})))}this.#E(),this.#b&&this.#D(),this.#t.dispatchEvent(new Event("blur",{bubbles:!0}))};#F=(t,e)=>{let s=this.#a.indexOf(e);switch(t.key){case"ArrowUp":t.preventDefault(),this.#x(e,e.step);break;case"ArrowDown":t.preventDefault(),this.#x(e,-e.step);break;case"ArrowRight":t.preventDefault(),s<this.#a.length-1?this.#O(s+1):this.#c&&this.#c.focus();break;case"ArrowLeft":t.preventDefault(),s>0&&this.#O(s-1);break;case"PageUp":t.preventDefault(),this.#x(e,e.step*(e.label==="Hours"?1:10));break;case"PageDown":t.preventDefault(),this.#x(e,-e.step*(e.label==="Hours"?1:10));break;case"Home":t.preventDefault(),this.#M(e,e.min);break;case"End":t.preventDefault(),this.#M(e,e.max);break;case"Escape":t.preventDefault(),this.#D(),this.#i.focus();break;default:/^\d$/.test(t.key)&&(t.preventDefault(),this.#L(t.key,e))}};#T="";#q=0;#L(t,e){clearTimeout(this.#q),this.#T+=t;let s=Number(this.#T);if(this.#T.length>=2||s*10>e.max){let n=Math.min(Math.max(s,e.min),e.max);this.#M(e,n),this.#T=""}else this.#q=setTimeout(()=>{let n=Number(this.#T),r=Math.min(Math.max(n,e.min),e.max);this.#M(e,r),this.#T=""},800)}#x(t,e){let s;t.label==="Hours"?s=this.#o==="12h"?this.#H():this.#h:t.label==="Minutes"?s=this.#f:s=this.#d;let n=Ma(s+e,t.min,t.max);this.#M(t,n)}#M(t,e){t.label==="Hours"?this.#o==="12h"?this.#h=this.#z(e,this.#l):this.#h=e:t.label==="Minutes"?this.#f=e:this.#d=e,this.#P()}#P(){this.#V(),this.#E(),this.#C(),this.#R(),this.dispatchEvent(new CustomEvent("time-picker:change",{bubbles:!0,detail:{value:St(this.#h,this.#f,this.#d,this.#p),hours:this.#h,minutes:this.#f,seconds:this.#d}}))}#V(){let t=this.#o==="12h"?this.#H():this.#h;this.#a[0].valueEl.textContent=$(t),this.#a[0].el.setAttribute("aria-valuenow",String(t)),this.#a[0].el.setAttribute("aria-valuetext",this.#o==="12h"?`${t} ${this.#l}`:String(t)),this.#a[1].valueEl.textContent=$(this.#f),this.#a[1].el.setAttribute("aria-valuenow",String(this.#f)),this.#p&&this.#a[2]&&(this.#a[2].valueEl.textContent=$(this.#d),this.#a[2].el.setAttribute("aria-valuenow",String(this.#d))),this.#c&&(this.#c.textContent=this.#l)}#E(){this.#h!==void 0&&(this.#i.value=La(this.#h,this.#f,this.#d,this.#p,this.#o))}#C(){let t=St(this.#h,this.#f,this.#d,this.#p);this.#e.setFormValue(t),this.#t.value=t,this.#t.dispatchEvent(new Event("input",{bubbles:!0}))}#R(){if((this.hasAttribute("required")||this.#t.hasAttribute("required"))&&!this.#t.value){this.#e.setValidity({valueMissing:!0},"Please select a time",this.#i||this);return}this.#e.setValidity({})}#z(t,e){return e==="AM"?t===12?0:t:t===12?12:t+12}#H(){if(this.#o==="24h")return this.#h;let t=this.#h%12;return t===0?12:t}#O(t){this.#a[t]?.el.focus()}formResetCallback(){let t=dt(this.#v);t?(this.#h=t.h,this.#f=t.m,this.#d=t.s):(this.#h=0,this.#f=0,this.#d=0),this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#P()}formStateRestoreCallback(t){if(!t)return;let e=dt(t);e&&(this.#h=e.h,this.#f=e.m,this.#d=e.s,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#P())}get value(){return St(this.#h,this.#f,this.#d,this.#p)}set value(t){let e=dt(t);e&&(this.#h=e.h,this.#f=e.m,this.#d=e.s,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#P())}};f("time-picker",Ve);var Na=["Su","Mo","Tu","We","Th","Fr","Sa"],Da=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],We=["january","february","march","april","may","june","july","august","september","october","november","december"];function I(i){let t=i.getFullYear(),e=String(i.getMonth()+1).padStart(2,"0"),s=String(i.getDate()).padStart(2,"0");return`${t}-${e}-${s}`}function O(i){if(!i)return null;let[t,e,s]=i.split("-").map(Number);return new Date(t,e-1,s)}function Wt(i,t){return new Date(i,t+1,0).getDate()}function _a(){try{let i=new Intl.Locale(navigator.language);if(i.weekInfo)return i.weekInfo.firstDay%7}catch{}return 0}function qa(i){try{return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric"}).format(i)}catch{return I(i)}}function jt(i,t){return i&&t&&i.getFullYear()===t.getFullYear()&&i.getMonth()===t.getMonth()&&i.getDate()===t.getDate()}function $a(){let i=new Map;We.forEach((t,e)=>{i.set(t,e),i.set(t.slice(0,3),e)});try{for(let t=0;t<12;t++){let e=new Intl.DateTimeFormat(void 0,{month:"long"}).format(new Date(2e3,t,1)).toLowerCase(),s=new Intl.DateTimeFormat(void 0,{month:"short"}).format(new Date(2e3,t,1)).toLowerCase().replace(".","");i.set(e,t),i.set(s,t)}}catch{}return i}var ze=$a();function Ue(i){let t=i.trim();if(!t)return{date:null,partial:null};if(/^\d{4}-\d{2}-\d{2}$/.test(t)){let a=O(t);return a&&!isNaN(a.getTime())?{date:a,partial:null}:{date:null,partial:null}}if(/^\d{4}\/\d{2}\/\d{2}$/.test(t)){let a=O(t.replace(/\//g,"-"));return a&&!isNaN(a.getTime())?{date:a,partial:null}:{date:null,partial:null}}let e=/^([a-z\u00C0-\u024F]+)\s+(\d{1,2}),?\s+(\d{4})$/i,s=t.match(e);if(s){let a=ze.get(s[1].toLowerCase());if(a!==void 0){let o=new Date(Number(s[3]),a,Number(s[2]));if(!isNaN(o.getTime()))return{date:o,partial:null}}}let n=/^(\d{1,2})\s+([a-z\u00C0-\u024F]+)\s+(\d{4})$/i;if(s=t.match(n),s){let a=ze.get(s[2].toLowerCase());if(a!==void 0){let o=new Date(Number(s[3]),a,Number(s[1]));if(!isNaN(o.getTime()))return{date:o,partial:null}}}let r=/^([a-z\u00C0-\u024F]+)\s+(\d{4})$/i;if(s=t.match(r),s){let a=ze.get(s[1].toLowerCase());if(a!==void 0)return{date:null,partial:{year:Number(s[2]),month:a}}}return{date:null,partial:null}}var je=class extends m{static formAssociated=!0;#e;#t;#i;#n;#s;#r;#a;#c;#o;#p;#h=!1;#f=!1;#d=null;#l=null;#u;#m;#g=null;#v=null;#A=new Map;#b=new Map;#y;#w;constructor(){super(),this.#e=this.attachInternals()}setup(){if(this.#t=this.querySelector(':scope > input[type="date"]'),!this.#t)return!1;this.#g=O(this.#t.getAttribute("min")),this.#v=O(this.#t.getAttribute("max")),this.#w=_a();let t=this.getAttribute("data-disabled-dates");t&&t.split(",").forEach(n=>{let[r,a]=n.trim().split(":");this.#A.set(r,a||null)});let e=this.getAttribute("data-highlight-dates");e&&e.split(",").forEach(n=>{let[r,a]=n.trim().split(":");this.#b.set(r,a||null)}),this.#d=O(this.#t.value),this.#y=this.#t.value;let s=new Date;this.#v&&s>this.#v&&(s=this.#v),this.#g&&s<this.#g&&(s=this.#g),this.#u=this.#d?this.#d.getFullYear():s.getFullYear(),this.#m=this.#d?this.#d.getMonth():s.getMonth(),this.#l=this.#d||s,this.#t.setAttribute("tabindex","-1"),this.#t.setAttribute("aria-hidden","true"),this.#t.style.cssText="position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;overflow:hidden;",this.#B(),this.#N(),this.#T(),this.#H(),this.#O(),this.#f=F,this.#f&&this.#r.setAttribute("popover","manual"),this.listen(document,"click",this.#C),(this.#t.disabled||this.hasAttribute("disabled"))&&(this.setAttribute("data-disabled",""),this.#i.disabled=!0)}teardown(){window.removeEventListener("scroll",this.#M,{capture:!0}),window.removeEventListener("resize",this.#M)}#B(){this.#s=document.createElement("div"),this.#s.className="date-trigger",this.#i=document.createElement("input"),this.#i.type="text",this.#i.className="date-input",this.#i.setAttribute("role","combobox"),this.#i.setAttribute("aria-haspopup","dialog"),this.#i.setAttribute("aria-expanded","false"),this.#i.setAttribute("autocomplete","off"),this.#i.setAttribute("placeholder","Type a date\u2026"),this.#s.appendChild(this.#i),this.#n=document.createElement("button"),this.#n.type="button",this.#n.className="date-trigger-icon",this.#n.setAttribute("aria-label","Toggle calendar"),this.#n.setAttribute("tabindex","-1");let t=document.createElement("icon-wc");t.setAttribute("name","calendar"),t.setAttribute("size","sm"),t.setAttribute("aria-hidden","true"),this.#n.appendChild(t),this.#s.appendChild(this.#n),this.appendChild(this.#s),this.listen(this.#n,"click",e=>{e.stopPropagation(),this.#h?this.#L():this.#q(),this.#i.focus()}),this.listen(this.#i,"focus",()=>this.#i.select()),this.listen(this.#i,"input",this.#P),this.listen(this.#i,"keydown",this.#V),this.listen(this.#i,"blur",this.#E)}#N(){this.#a=`dp-${Math.random().toString(36).slice(2,8)}`,this.#r=document.createElement("div"),this.#r.className="calendar",this.#r.id=this.#a,this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-modal","false"),this.#r.setAttribute("aria-label","Choose date"),this.#r.hidden=!0,this.#i.setAttribute("aria-controls",this.#a);let t=document.createElement("div");t.className="calendar-header";let e=document.createElement("button");e.type="button",e.className="calendar-nav",e.setAttribute("aria-label","Previous month");let s=document.createElement("icon-wc");s.setAttribute("name","chevron-left"),s.setAttribute("size","sm"),s.setAttribute("aria-hidden","true"),e.appendChild(s);let n=document.createElement("span");n.className="calendar-title",n.id=`${this.#a}-title`,n.setAttribute("aria-live","polite"),this.#o=document.createElement("span"),this.#o.className="calendar-month",this.#p=document.createElement("select"),this.#p.className="calendar-year",this.#p.setAttribute("aria-label","Year"),this.#k(),n.appendChild(this.#o),n.appendChild(this.#p);let r=document.createElement("button");r.type="button",r.className="calendar-nav",r.setAttribute("aria-label","Next month");let a=document.createElement("icon-wc");a.setAttribute("name","chevron-right"),a.setAttribute("size","sm"),a.setAttribute("aria-hidden","true"),r.appendChild(a),t.appendChild(e),t.appendChild(n),t.appendChild(r),this.#r.appendChild(t);let o=document.createElement("table");o.setAttribute("role","grid"),o.setAttribute("aria-labelledby",`${this.#a}-title`);let c=document.createElement("thead"),l=document.createElement("tr");for(let h=0;h<7;h++){let d=(this.#w+h)%7,u=document.createElement("th");u.setAttribute("abbr",Da[d]),u.setAttribute("scope","col"),u.textContent=Na[d],l.appendChild(u)}c.appendChild(l),o.appendChild(c),this.#c=document.createElement("tbody"),o.appendChild(this.#c),this.#r.appendChild(o),this.appendChild(this.#r),this.#S(),this.listen(e,"click",()=>this.#I(-1)),this.listen(r,"click",()=>this.#I(1)),this.listen(this.#p,"change",()=>{this.#u=Number(this.#p.value);let h=Wt(this.#u,this.#m),d=Math.min(this.#l.getDate(),h);this.#l=new Date(this.#u,this.#m,d),this.#S()}),this.listen(this.#c,"click",this.#R),this.listen(this.#r,"keydown",this.#z)}#S(){try{this.#o.textContent=new Intl.DateTimeFormat(void 0,{month:"long"}).format(new Date(this.#u,this.#m,1))}catch{this.#o.textContent=We[this.#m].charAt(0).toUpperCase()+We[this.#m].slice(1)}this.#p.querySelector(`option[value="${this.#u}"]`)||this.#k(),this.#p.value=String(this.#u),this.#c.innerHTML="";let t=Wt(this.#u,this.#m),s=(new Date(this.#u,this.#m,1).getDay()-this.#w+7)%7,n=new Date,r=document.createElement("tr");for(let o=0;o<s;o++)r.appendChild(document.createElement("td"));for(let o=1;o<=t;o++){let c=new Date(this.#u,this.#m,o),l=I(c),h=document.createElement("td"),d=document.createElement("button");d.type="button",d.setAttribute("data-date",l),d.textContent=String(o),jt(c,n)&&d.setAttribute("aria-current","date"),jt(c,this.#d)&&d.setAttribute("aria-selected","true");let u=this.#D(c,l);if(u.disabled&&(d.setAttribute("aria-disabled","true"),d.setAttribute("disabled",""),u.reason&&d.setAttribute("data-disabled-reason",u.reason)),this.#b.has(l)){let b=this.#b.get(l);d.setAttribute("data-highlight",b||"")}jt(c,this.#l)?(d.setAttribute("tabindex","0"),jt(c,this.#d)||d.setAttribute("data-focused","")):d.setAttribute("tabindex","-1"),h.appendChild(d),r.appendChild(h),(s+o)%7===0&&(this.#c.appendChild(r),r=document.createElement("tr"))}let a=(s+t)%7;if(a>0){for(let o=a;o<7;o++)r.appendChild(document.createElement("td"));this.#c.appendChild(r)}}#$(t,e){return this.#D(t,e).disabled}#D(t,e){return this.#A.has(e)?{disabled:!0,reason:this.#A.get(e)}:this.#g&&t<this.#g?{disabled:!0,reason:null}:this.#v&&t>this.#v?{disabled:!0,reason:null}:{disabled:!1,reason:null}}#k(){this.#p.innerHTML="";let t=new Date().getFullYear(),e=this.#g?this.#g.getFullYear():t-100,s=this.#v?this.#v.getFullYear():t+10;for(let n=e;n<=s;n++){let r=document.createElement("option");r.value=String(n),r.textContent=String(n),this.#p.appendChild(r)}}#I(t){this.#m+=t,this.#m>11?(this.#m=0,this.#u++):this.#m<0&&(this.#m=11,this.#u--);let e=Wt(this.#u,this.#m),s=Math.min(this.#l.getDate(),e);this.#l=new Date(this.#u,this.#m,s),this.#S(),this.#F(this.#l)}#_(t){let e=I(t);this.#$(t,e)||(this.#d=t,this.#l=t,this.#T(),this.#H(),this.#O(),this.#S(),this.#L(),this.#i.focus(),this.dispatchEvent(new CustomEvent("date-picker:change",{bubbles:!0,detail:{value:e,date:new Date(t)}})))}#F(t){let e=I(t),s=this.#c.querySelector(`[data-date="${e}"]`);s&&(this.#c.querySelectorAll('button[tabindex="0"]').forEach(n=>{n.setAttribute("tabindex","-1")}),s.setAttribute("tabindex","0"),s.focus())}#T(){this.#d?this.#i.value=qa(this.#d):this.#i.value=""}#q(){if(!this.#h){if(this.#h=!0,this.setAttribute("open",""),this.#i.setAttribute("aria-expanded","true"),this.#r.hidden=!1,this.#u=this.#l.getFullYear(),this.#m=this.#l.getMonth(),this.#S(),this.#f){try{this.#r.showPopover()}catch{}this.#x(),window.addEventListener("scroll",this.#M,{capture:!0,passive:!0}),window.addEventListener("resize",this.#M,{passive:!0})}this.dispatchEvent(new CustomEvent("date-picker:open",{bubbles:!0}))}}#L(){if(this.#h){if(this.#h=!1,this.removeAttribute("open"),this.#i.setAttribute("aria-expanded","false"),this.#r.hidden=!0,this.#f){try{this.#r.hidePopover()}catch{}window.removeEventListener("scroll",this.#M,{capture:!0}),window.removeEventListener("resize",this.#M)}this.dispatchEvent(new CustomEvent("date-picker:close",{bubbles:!0}))}}#x(){if(!this.#f)return;let t=this.#s.getBoundingClientRect(),e=this.#r.getBoundingClientRect(),s=4,n=8,r=window.innerHeight,a=window.innerWidth,o=r-t.bottom-n,c=t.top-n,l;o<e.height&&c>o?(l=t.top-e.height-s,this.#r.dataset.placement="top"):(l=t.bottom+s,delete this.#r.dataset.placement);let h=t.left;h+e.width>a-n&&(h=a-e.width-n),h<n&&(h=n),this.#r.style.setProperty("--calendar-top",`${l}px`),this.#r.style.setProperty("--calendar-left",`${h}px`)}#M=()=>{this.#h&&this.#x()};#P=()=>{let t=this.#i.value,{date:e,partial:s}=Ue(t);if(e)this.#l=e,this.#u=e.getFullYear(),this.#m=e.getMonth(),this.#S();else if(s){this.#u=s.year,this.#m=s.month;let n=Wt(s.year,s.month),r=Math.min(this.#l.getDate(),n);this.#l=new Date(s.year,s.month,r),this.#S()}!this.#h&&t.length>0&&this.#q()};#V=t=>{switch(t.key){case"Enter":{t.preventDefault(),t.stopPropagation();let{date:e}=Ue(this.#i.value);e&&!this.#$(e,I(e))&&this.#_(e);return}case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.#h||this.#q(),requestAnimationFrame(()=>this.#F(this.#l));return;case"Escape":t.preventDefault(),t.stopPropagation(),this.#h&&this.#L(),this.#T();return;case"Tab":this.#h&&this.#L();return}};#E=t=>{if(t.relatedTarget&&this.contains(t.relatedTarget))return;let e=this.#i.value.trim();if(e){let{date:s}=Ue(e);s&&!this.#$(s,I(s))&&(this.#d=s,this.#l=s,this.#H(),this.#O(),this.dispatchEvent(new CustomEvent("date-picker:change",{bubbles:!0,detail:{value:I(s),date:new Date(s)}})))}this.#T(),this.#h&&this.#L(),this.#t.dispatchEvent(new Event("blur",{bubbles:!0}))};#C=t=>{this.#h&&!this.contains(t.target)&&this.#L()};#R=t=>{let e=t.target.closest("button[data-date]");!e||e.hasAttribute("disabled")||this.#_(O(e.getAttribute("data-date")))};#z=t=>{if(t.key==="Tab"){this.#L();return}let e=this.#l,s;switch(t.key){case"ArrowRight":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);break;case"ArrowLeft":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()-1);break;case"ArrowDown":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()+7);break;case"ArrowUp":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()-7);break;case"PageDown":t.shiftKey?s=new Date(e.getFullYear()+1,e.getMonth(),e.getDate()):s=new Date(e.getFullYear(),e.getMonth()+1,e.getDate());break;case"PageUp":t.shiftKey?s=new Date(e.getFullYear()-1,e.getMonth(),e.getDate()):s=new Date(e.getFullYear(),e.getMonth()-1,e.getDate());break;case"Home":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay()+this.#w);break;case"End":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()+(6-e.getDay()+this.#w));break;case"Enter":case" ":t.preventDefault(),t.stopPropagation(),this.#_(e);return;case"Escape":t.preventDefault(),t.stopPropagation(),this.#L(),this.#i.focus();return;default:return}t.preventDefault(),t.stopPropagation(),s&&(this.#g&&s<this.#g&&(s=this.#g),this.#v&&s>this.#v&&(s=this.#v),this.#l=s,(s.getMonth()!==this.#m||s.getFullYear()!==this.#u)&&(this.#m=s.getMonth(),this.#u=s.getFullYear(),this.#S()),this.#F(s))};#H(){let t=this.#d?I(this.#d):"";this.#e.setFormValue(t||null),this.#t.value=t,this.#t.dispatchEvent(new Event("input",{bubbles:!0}))}#O(){(this.hasAttribute("required")||this.#t.hasAttribute("required"))&&!this.#d?this.#e.setValidity({valueMissing:!0},"Please select a date",this.#i||this):this.#e.setValidity({})}formResetCallback(){this.#d=O(this.#y);let t=new Date;this.#l=this.#d||t,this.#u=this.#l.getFullYear(),this.#m=this.#l.getMonth(),this.#T(),this.#H(),this.#O(),this.#h&&this.#S()}formStateRestoreCallback(t){t&&(this.#d=O(t),this.#d&&(this.#l=this.#d,this.#u=this.#d.getFullYear(),this.#m=this.#d.getMonth(),this.#T(),this.#H(),this.#O()))}get value(){return this.#d?I(this.#d):""}set value(t){let e=O(t);e&&this.#_(e)}get min(){return this.#g?I(this.#g):""}set min(t){this.#g=t?O(t):null,this.#t&&this.#t.setAttribute("min",t||""),this.#S()}get max(){return this.#v?I(this.#v):""}set max(t){this.#v=t?O(t):null,this.#t&&this.#t.setAttribute("max",t||""),this.#S()}};f("date-picker",je);function Yt(i,t,e){t/=100,e/=100;let s=a=>(a+i/30)%12,n=t*Math.min(e,1-e),r=a=>e-n*Math.max(-1,Math.min(s(a)-3,9-s(a),1));return{r:Math.round(r(0)*255),g:Math.round(r(8)*255),b:Math.round(r(4)*255)}}function Ye(i,t,e){i/=255,t/=255,e/=255;let s=Math.max(i,t,e),n=Math.min(i,t,e),r=(s+n)/2,a=0,o=0;if(s!==n){let c=s-n;switch(o=r>.5?c/(2-s-n):c/(s+n),s){case i:a=((t-e)/c+(t<e?6:0))/6;break;case t:a=((e-i)/c+2)/6;break;case e:a=((i-t)/c+4)/6;break}}return{h:Math.round(a*360),s:Math.round(o*100),l:Math.round(r*100)}}function Ia(i){i=i.replace(/^#/,""),i.length===3&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]);let t=parseInt(i,16);return{r:t>>16&255,g:t>>8&255,b:t&255}}function Oa(i,t,e){return"#"+[i,t,e].map(s=>Math.max(0,Math.min(255,Math.round(s))).toString(16).padStart(2,"0")).join("")}function j(i){let{r:t,g:e,b:s}=Ia(i);return Ye(t,e,s)}function Q(i,t,e){let{r:s,g:n,b:r}=Yt(i,t,e);return Oa(s,n,r)}function B(i,t,e){return Math.max(t,Math.min(e,i))}var Ge=class extends m{static formAssociated=!0;#e;#t;#i;#n;#s;#r;#a;#c;#o;#p;#h;#f;#d;#l;#u;#m;#g;#v=!1;#A=!1;#b=0;#y=100;#w=50;#B;constructor(){super(),this.#e=this.attachInternals()}setup(){if(this.#t=this.querySelector(':scope > input[type="color"]'),!this.#t)return!1;let t=this.#t.value||"#000000";this.#B=t;let e=j(t);this.#b=e.h,this.#y=e.s,this.#w=e.l,this.#t.setAttribute("tabindex","-1"),this.#t.setAttribute("aria-hidden","true"),this.#t.style.cssText="position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;overflow:hidden;",this.#N(),this.#S(),this.#C(),this.#U(),this.#A=F,this.#A&&this.#r.setAttribute("popover","manual"),this.listen(document,"click",this.#W),(this.#t.disabled||this.hasAttribute("disabled"))&&this.setAttribute("data-disabled","")}teardown(){window.removeEventListener("scroll",this.#O,{capture:!0}),window.removeEventListener("resize",this.#O)}#N(){this.#i=document.createElement("button"),this.#i.type="button",this.#i.className="color-trigger",this.#i.setAttribute("aria-haspopup","dialog"),this.#i.setAttribute("aria-expanded","false"),this.#n=document.createElement("span"),this.#n.className="color-swatch",this.#s=document.createElement("span"),this.#s.className="color-hex",this.#i.appendChild(this.#n),this.#i.appendChild(this.#s),this.appendChild(this.#i),this.listen(this.#i,"click",()=>{this.#v?this.#z():this.#R()})}#S(){this.#r=document.createElement("div"),this.#r.className="color-panel",this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-label","Color picker"),this.#a=document.createElement("div"),this.#a.className="color-area",this.#a.setAttribute("role","slider"),this.#a.setAttribute("aria-label","Saturation and lightness"),this.#a.setAttribute("tabindex","0"),this.#c=document.createElement("div"),this.#c.className="color-area-thumb",this.#a.appendChild(this.#c),this.#r.appendChild(this.#a);let t=document.createElement("div");t.className="color-hue-wrap",this.#o=document.createElement("div"),this.#o.className="color-hue",this.#o.setAttribute("role","slider"),this.#o.setAttribute("aria-label","Hue"),this.#o.setAttribute("aria-valuemin","0"),this.#o.setAttribute("aria-valuemax","360"),this.#o.setAttribute("tabindex","0"),this.#p=document.createElement("div"),this.#p.className="color-hue-thumb",this.#o.appendChild(this.#p),t.appendChild(this.#o),this.#r.appendChild(t);let e=document.createElement("div");e.className="color-inputs",this.#h=this.#$("Hex","hex",7),this.#f=this.#D("R","r",0,255),this.#d=this.#D("G","g",0,255),this.#l=this.#D("B","b",0,255),e.appendChild(this.#h.wrapper),e.appendChild(this.#f.wrapper),e.appendChild(this.#d.wrapper),e.appendChild(this.#l.wrapper),this.#r.appendChild(e);let s=this.querySelector(":scope > datalist");if(s){this.#u=document.createElement("div"),this.#u.className="color-swatches",this.#u.setAttribute("role","listbox"),this.#u.setAttribute("aria-label","Preset colors");for(let r of s.querySelectorAll("option[value]")){let a=document.createElement("button");a.type="button",a.setAttribute("role","option"),a.style.background=r.value,a.setAttribute("aria-label",r.textContent||r.value),a.setAttribute("data-color",r.value),this.#u.appendChild(a)}this.#r.appendChild(this.#u),this.listen(this.#u,"click",this.#M)}let n=document.createElement("div");n.className="color-actions","EyeDropper"in window&&(this.#m=document.createElement("button"),this.#m.type="button",this.#m.className="color-eyedropper",this.#m.setAttribute("aria-label","Pick color from screen"),this.#m.textContent="\u{1F4A7}",n.appendChild(this.#m),this.listen(this.#m,"click",this.#P)),this.#g=document.createElement("button"),this.#g.type="button",this.#g.className="color-copy",this.#g.setAttribute("aria-label","Copy hex value"),this.#g.textContent="Copy",n.appendChild(this.#g),this.listen(this.#g,"click",this.#V),this.#r.appendChild(n),this.appendChild(this.#r),this.listen(this.#a,"pointerdown",this.#k),this.listen(this.#a,"keydown",this.#_),this.listen(this.#o,"pointerdown",this.#F),this.listen(this.#o,"keydown",this.#q),this.listen(this.#h.input,"change",this.#L),this.listen(this.#f.input,"change",this.#x),this.listen(this.#d.input,"change",this.#x),this.listen(this.#l.input,"change",this.#x)}#$(t,e,s){let n=document.createElement("label");n.className="color-input-label";let r=document.createElement("span");r.textContent=t;let a=document.createElement("input");return a.type="text",a.setAttribute("data-channel",e),a.setAttribute("maxlength",String(s)),a.setAttribute("spellcheck","false"),a.setAttribute("autocomplete","off"),n.appendChild(r),n.appendChild(a),{wrapper:n,input:a}}#D(t,e,s,n){let r=document.createElement("label");r.className="color-input-label";let a=document.createElement("span");a.textContent=t;let o=document.createElement("input");return o.type="number",o.setAttribute("data-channel",e),o.min=String(s),o.max=String(n),r.appendChild(a),r.appendChild(o),{wrapper:r,input:o}}#k=t=>{t.preventDefault(),this.#a.setPointerCapture(t.pointerId),this.#I(t);let e=n=>this.#I(n),s=n=>{this.#a.releasePointerCapture(n.pointerId),this.#a.removeEventListener("pointermove",e),this.#a.removeEventListener("pointerup",s)};this.#a.addEventListener("pointermove",e),this.#a.addEventListener("pointerup",s)};#I(t){let e=this.#a.getBoundingClientRect(),s=B((t.clientX-e.left)/e.width,0,1),n=B((t.clientY-e.top)/e.height,0,1);this.#y=Math.round(s*100),this.#w=Math.round((1-n)*100),this.#E()}#_=t=>{let e=t.shiftKey?10:1;switch(t.key){case"ArrowRight":t.preventDefault(),this.#y=B(this.#y+e,0,100);break;case"ArrowLeft":t.preventDefault(),this.#y=B(this.#y-e,0,100);break;case"ArrowUp":t.preventDefault(),this.#w=B(this.#w+e,0,100);break;case"ArrowDown":t.preventDefault(),this.#w=B(this.#w-e,0,100);break;default:return}this.#E()};#F=t=>{t.preventDefault(),this.#o.setPointerCapture(t.pointerId),this.#T(t);let e=n=>this.#T(n),s=n=>{this.#o.releasePointerCapture(n.pointerId),this.#o.removeEventListener("pointermove",e),this.#o.removeEventListener("pointerup",s)};this.#o.addEventListener("pointermove",e),this.#o.addEventListener("pointerup",s)};#T(t){let e=this.#o.getBoundingClientRect(),s=B((t.clientX-e.left)/e.width,0,1);this.#b=Math.round(s*360),this.#E()}#q=t=>{let e=t.shiftKey?10:1;switch(t.key){case"ArrowRight":case"ArrowUp":t.preventDefault(),this.#b=(this.#b+e)%361;break;case"ArrowLeft":case"ArrowDown":t.preventDefault(),this.#b=(this.#b-e+361)%361;break;default:return}this.#E()};#L=()=>{let t=this.#h.input.value.trim();if(t.startsWith("#")||(t="#"+t),/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)){let e=j(t);this.#b=e.h,this.#y=e.s,this.#w=e.l,this.#E()}};#x=()=>{let t=B(Number(this.#f.input.value)||0,0,255),e=B(Number(this.#d.input.value)||0,0,255),s=B(Number(this.#l.input.value)||0,0,255),n=Ye(t,e,s);this.#b=n.h,this.#y=n.s,this.#w=n.l,this.#E()};#M=t=>{let e=t.target.closest("button[data-color]");if(!e)return;let s=e.getAttribute("data-color"),n=j(s);this.#b=n.h,this.#y=n.s,this.#w=n.l,this.#E()};#P=async()=>{try{let e=await new EyeDropper().open(),s=j(e.sRGBHex);this.#b=s.h,this.#y=s.s,this.#w=s.l,this.#E()}catch{}};#V=async()=>{let t=Q(this.#b,this.#y,this.#w);try{await navigator.clipboard.writeText(t),this.#g.textContent="Copied!",setTimeout(()=>{this.#g.textContent="Copy"},1500)}catch{}};#E(){this.#C(),this.#U();let t=Q(this.#b,this.#y,this.#w),e=Yt(this.#b,this.#y,this.#w);this.dispatchEvent(new CustomEvent("color-picker:change",{bubbles:!0,detail:{hex:t,rgb:{r:e.r,g:e.g,b:e.b},hsl:{h:this.#b,s:this.#y,l:this.#w}}}))}#C(){let t=Q(this.#b,this.#y,this.#w),e=Yt(this.#b,this.#y,this.#w),s=Q(this.#b,100,50);this.#n.style.background=t,this.#s.textContent=t,this.#a.style.setProperty("--area-hue",s),this.#c.style.insetInlineStart=`${this.#y}%`,this.#c.style.insetBlockStart=`${100-this.#w}%`,this.#c.style.background=t,this.#a.setAttribute("aria-valuetext",`Saturation ${this.#y}%, Lightness ${this.#w}%`),this.#p.style.insetInlineStart=`${this.#b/360*100}%`,this.#o.setAttribute("aria-valuenow",String(this.#b)),this.#o.setAttribute("aria-valuetext",`Hue ${this.#b}\xB0`),this.#h.input.value=t,this.#f.input.value=String(e.r),this.#d.input.value=String(e.g),this.#l.input.value=String(e.b)}#R(){if(!this.#v){if(this.#v=!0,this.setAttribute("open",""),this.#i.setAttribute("aria-expanded","true"),this.#A){this.#H();try{this.#r.showPopover()}catch{}window.addEventListener("scroll",this.#O,{capture:!0,passive:!0}),window.addEventListener("resize",this.#O,{passive:!0})}requestAnimationFrame(()=>this.#a.focus()),this.dispatchEvent(new CustomEvent("color-picker:open",{bubbles:!0}))}}#z(){if(this.#v){if(this.#v=!1,this.removeAttribute("open"),this.#i.setAttribute("aria-expanded","false"),this.#A){try{this.#r.hidePopover()}catch{}window.removeEventListener("scroll",this.#O,{capture:!0}),window.removeEventListener("resize",this.#O)}this.dispatchEvent(new CustomEvent("color-picker:close",{bubbles:!0}))}}#H(){if(!this.#A)return;let t=this.#i.getBoundingClientRect();this.#r.style.setProperty("--panel-top",`${t.bottom+4}px`),this.#r.style.setProperty("--panel-left",`${t.left}px`)}#O=()=>{this.#v&&this.#H()};#W=t=>{this.#v&&!this.contains(t.target)&&this.#z()};#U(){let t=Q(this.#b,this.#y,this.#w);this.#e.setFormValue(t),this.#t.value=t,this.#t.dispatchEvent(new Event("input",{bubbles:!0}))}formResetCallback(){let t=j(this.#B);this.#b=t.h,this.#y=t.s,this.#w=t.l,this.#C(),this.#U()}formStateRestoreCallback(t){if(!t)return;let e=j(t);this.#b=e.h,this.#y=e.s,this.#w=e.l,this.#C(),this.#U()}get value(){return Q(this.#b,this.#y,this.#w)}set value(t){if(!/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t))return;let e=j(t);this.#b=e.h,this.#y=e.s,this.#w=e.l,this.#E()}};f("color-picker",Ge);var Ke=class extends m{#e;#t;#i=[];#n=-1;#s=!1;#r=[];#a=!1;setup(){if(this.#e=this.querySelector(":scope > [data-trigger]"),this.#t=this.querySelector(':scope > menu, :scope > ul[role="menu"]'),!this.#e||!this.#t)return!1;this.#a=F,this.#a&&this.#t.setAttribute("popover","auto"),this.#e?.setAttribute("aria-expanded","false"),this.#t.setAttribute("role","menu"),this.#t.id||(this.#t.id=`ctx-menu-${crypto.randomUUID().slice(0,8)}`),this.#t.querySelectorAll(":scope > li[data-group]").forEach(t=>{t.setAttribute("role","presentation"),t.classList.add("ctx-group-label")}),this.#i=Array.from(this.#t.querySelectorAll('button, a, [role="menuitem"]')).filter(t=>!t.disabled&&!t.hasAttribute("data-disabled")),this.#i.forEach(t=>{t.setAttribute("role","menuitem"),t.setAttribute("tabindex","-1"),t.style.cssText+=";border:none;box-shadow:none;transform:none;border-radius:0;",this.listen(t,"click",this.#h);let e=t.getAttribute("data-shortcut");if(e){let s=document.createElement("kbd");s.className="ctx-kbd",s.textContent=Ys(e),t.appendChild(s);let n=Ht(e,()=>t.click());this.#r.push(n)}}),this.#t.querySelectorAll('li:empty:not([data-group]), [role="separator"], hr').forEach(t=>{t.setAttribute("role","separator")}),this.listen(this.#e,"contextmenu",this.#c),this.listen(this.#t,"keydown",this.#p),this.listen(window,"scroll",this.#m,{capture:!0}),this.#a?this.listen(this.#t,"toggle",this.#u):(this.listen(document,"click",this.#f),this.listen(document,"contextmenu",this.#d),this.listen(document,"keydown",this.#l))}teardown(){this.#r.forEach(t=>t()),this.#r=[]}#c=t=>{t.preventDefault(),this.#o(t.clientX,t.clientY)};#o(t,e){if(this.#s=!0,this.setAttribute("data-open",""),this.#e?.setAttribute("aria-expanded","true"),this.#t.style.setProperty("--ctx-top",`${e}px`),this.#t.style.setProperty("--ctx-left",`${t}px`),this.#a)try{this.#t.showPopover()}catch{}requestAnimationFrame(()=>{let s=this.#t.getBoundingClientRect(),n=t+s.width>window.innerWidth?t-s.width:t,r=e+s.height>window.innerHeight?e-s.height:e;this.#t.style.setProperty("--ctx-top",`${Math.max(0,r)}px`),this.#t.style.setProperty("--ctx-left",`${Math.max(0,n)}px`)}),this.#n=-1,this.#g(0),this.dispatchEvent(new CustomEvent("context-menu:open",{bubbles:!0}))}close(){if(this.#s){if(this.#s=!1,this.removeAttribute("data-open"),this.#e?.setAttribute("aria-expanded","false"),this.#n=-1,this.#a)try{this.#t.hidePopover()}catch{}this.dispatchEvent(new CustomEvent("context-menu:close",{bubbles:!0}))}}#p=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.#g(this.#n+1);break;case"ArrowUp":case"Up":t.preventDefault(),this.#g(this.#n-1);break;case"Home":t.preventDefault(),this.#g(0);break;case"End":t.preventDefault(),this.#g(this.#i.length-1);break;case"Enter":case" ":t.preventDefault(),this.#n>=0&&this.#i[this.#n].click();break;case"Tab":this.close();break}};#h=()=>{this.close(),this.dispatchEvent(new CustomEvent("context-menu:select",{bubbles:!0,detail:{item:this.#i[this.#n]}}))};#f=t=>{this.#s&&!this.#t.contains(t.target)&&this.close()};#d=t=>{this.#s&&!this.#e.contains(t.target)&&this.close()};#l=t=>{t.key==="Escape"&&this.#s&&(t.preventDefault(),this.close())};#u=t=>{t.newState==="closed"&&this.#s&&(this.#s=!1,this.removeAttribute("data-open"),this.#n=-1,this.dispatchEvent(new CustomEvent("context-menu:close",{bubbles:!0})))};#m=()=>{this.#s&&this.close()};#g(t){this.#i.length!==0&&(t<0&&(t=this.#i.length-1),t>=this.#i.length&&(t=0),this.#n=t,this.#i[t].focus())}get isOpen(){return this.#s}};f("context-menu",Ke);var Xe=class extends m{#e;#t;#i=null;#n=!1;setup(){if(this.#n)return;let t=this.getAttribute("src");if(!t)return!1;this.#i===null&&(this.#i=this.innerHTML),this.hasAttribute("lazy")?this.#r():this.#a(t)}teardown(){this.#e?.disconnect(),this.#t?.abort()}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e,s){t==="src"&&s&&e!==s&&this.isConnected&&(this.hasAttribute("lazy")&&!this.#s()?this.#r():this.#a(s))}#s(){let t=this.getBoundingClientRect();return t.top<window.innerHeight+200&&t.bottom>-200}#r(){this.#e?.disconnect(),this.#e=new IntersectionObserver(t=>{for(let e of t)if(e.isIntersecting){this.#e.disconnect();let s=this.getAttribute("src");s&&this.#a(s)}},{rootMargin:"200px"}),this.#e.observe(this)}async#a(t){this.#t?.abort(),this.#t=new AbortController,this.setAttribute("data-loading",""),this.removeAttribute("data-loaded"),this.removeAttribute("data-error");try{let e=await fetch(t,{signal:this.#t.signal});if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);let s=await e.text(),n=this.getAttribute("mode")||"replace";n==="replace"?this.innerHTML=s:n==="append"?this.insertAdjacentHTML("beforeend",s):n==="prepend"&&this.insertAdjacentHTML("afterbegin",s),this.hasAttribute("allow-scripts")?this.querySelectorAll("script").forEach(r=>{let a=document.createElement("script");for(let o of r.attributes)a.setAttribute(o.name,o.value);a.textContent=r.textContent,r.replaceWith(a)}):this.querySelectorAll("script").forEach(r=>r.remove()),this.removeAttribute("data-loading"),this.setAttribute("data-loaded",""),this.#n=!0,this.dispatchEvent(new CustomEvent("include-file:loaded",{bubbles:!0,detail:{src:t,html:s}}))}catch(e){if(e.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),(this.getAttribute("mode")||"replace")==="replace"&&this.#i!==null&&!this.#n&&(this.innerHTML=this.#i),this.dispatchEvent(new CustomEvent("include-file:error",{bubbles:!0,detail:{src:t,error:e.message}}))}}reload(){let t=this.getAttribute("src");t&&this.#a(t)}};f("include-file",Xe);W();var un="environment",pn="preferences",Je={timeOfDay:!1,seasonal:!1},Ba=900*1e3,Y={...Je};function tt(i,t,e){return i+(t-i)*Math.min(1,Math.max(0,e))}var Ct={_timer:null,_baseHues:null,_timeOverride:null,_monthOverride:null,async init(){let i=await w.get(un,pn);Y=i?{...Je,...i}:{...Je},(Y.timeOfDay||Y.seasonal)&&(this._captureBaseHues(),this._update(),this._startLoop()),window.addEventListener("vb:theme-change",()=>{this._hasActiveSource()&&requestAnimationFrame(()=>{this._captureBaseHues(),this._update()})})},load(){return{...Y}},save(i){return Y={...Y,...i},w.set(un,pn,Y).catch(()=>{}),{...Y}},setTimeOverride(i){this._timeOverride=i,this._hasActiveSource()&&this._update()},setMonthOverride(i){this._monthOverride=i,this._hasActiveSource()&&this._update()},setSource(i,t){let e=this.save({[i]:t});t?(this._captureBaseHues(),this._update(),this._startLoop()):this._hasActiveSource(e)?this._update():(this._clearModifiers(),this._stopLoop())},_hasActiveSource(i){let t=i||this.load();return t.timeOfDay||t.seasonal},_captureBaseHues(){let i=document.documentElement;i.style.removeProperty("--hue-primary"),i.style.removeProperty("--hue-secondary"),i.style.removeProperty("--hue-accent");let t=i.getAttribute("data-theme");if(t){let e=`[data-theme~="${t}"]`;for(let s of document.styleSheets)try{for(let n=0;n<s.cssRules.length;n++){let r=s.cssRules[n];if(r.selectorText?.includes(e)&&!r.selectorText.includes("dark")){let a=r.style?.getPropertyValue("--hue-primary");if(a){this._baseHues={primary:parseFloat(a)||260,secondary:parseFloat(r.style.getPropertyValue("--hue-secondary"))||200,accent:parseFloat(r.style.getPropertyValue("--hue-accent"))||30};return}}}}catch{}}this._baseHues={primary:260,secondary:200,accent:30}},_update(){let i=this.load(),t=0;i.timeOfDay&&(t+=this._getTimeOfDayOffset()),i.seasonal&&(t+=this._getSeasonalOffset());let e=document.documentElement;t!==0&&this._baseHues?(e.style.setProperty("--hue-primary",String(this._baseHues.primary+t)),e.style.setProperty("--hue-secondary",String(this._baseHues.secondary+t)),e.style.setProperty("--hue-accent",String(this._baseHues.accent+t*.5))):t===0&&this._clearModifiers()},_clearModifiers(){let i=document.documentElement;i.style.removeProperty("--hue-primary"),i.style.removeProperty("--hue-secondary"),i.style.removeProperty("--hue-accent")},_getTimeOfDayOffset(){let i=this._timeOverride??new Date().getHours()+new Date().getMinutes()/60;return i<5?-20:i<7?tt(-20,20,(i-5)/2):i<10?tt(20,5,(i-7)/3):i<14?tt(5,0,(i-10)/4):i<17?tt(0,-5,(i-14)/3):i<19?tt(-5,15,(i-17)/2):i<21?tt(15,-10,(i-19)/2):tt(-10,-20,(i-21)/8)},_getHemisphere(){return window.__VB_ENV_LOCATION?.hemisphere||"north"},_getSeasonalOffset(){let i=this._monthOverride??new Date().getMonth(),e=this._getHemisphere()==="south"?(i+6)%12:i;return e>=2&&e<=4?5:e>=5&&e<=7?10:e>=8&&e<=10?-5:-10},_startLoop(){this._timer||(this._timer=setInterval(()=>this._update(),Ba))},_stopLoop(){this._timer&&clearInterval(this._timer),this._timer=null}};var Gt=null;function mn(){return"0.1.2-9bbc11a4"}function Pa(){let i=document.querySelectorAll('script[src*="vanilla-breeze"]'),t="/cdn/sw.js";for(let e of i){let s=e.getAttribute("src");if(s){let n=s.lastIndexOf("/");if(n!==-1){t=s.slice(0,n)+"/sw.js";break}}}return t}function bn(){return Gt||(Gt=navigator.serviceWorker?.ready??Promise.reject(new Error("SW not supported"))),Gt}function gn(i){return new Promise((t,e)=>{navigator.serviceWorker?.controller?fn(navigator.serviceWorker.controller,i,t,e):bn().then(s=>{let n=s.active||s.waiting||s.installing;n?fn(n,i,t,e):e(new Error("No active service worker"))}).catch(e)})}function fn(i,t,e,s){let n=new MessageChannel;n.port1.onmessage=r=>e(r.data),n.port1.onmessageerror=()=>s(new Error("Message error")),i.postMessage({type:t},[n.port2]),setTimeout(()=>s(new Error("SW message timeout")),5e3)}async function yn(){return gn("GET_STATUS")}async function vn(){return gn("CLEAR_CACHE")}async function wn(){let i=await bn();return await i.update(),{updated:!!i.waiting}}function Fa(){return typeof window>"u"||!("serviceWorker"in navigator)?!1:window.__VB_SERVICE_WORKER?!0:document.querySelector('meta[name="vb-service-worker"]')?.content==="true"}if(Fa()){let i=Pa();window.addEventListener("load",()=>{Gt=navigator.serviceWorker.register(i).catch(t=>{console.warn("[VB] Service worker registration failed:",t)})})}W();var ut=null,G="settings",Jt={motionFx:!0,sounds:!1},ii=class extends m{#e=null;#t=null;#i=!1;#n=[];#s={...Jt};#r=!1;async setup(){await this.#a(),this.#v(),this.#b(),this.#C(),this.listen(window,"vb:theme-change",this.#E),this.listen(window,"vb:extensions-change",this.#E),this.listen(window,"vb:a11y-themes-change",this.#E)}teardown(){}async#a(){let[t,e,s]=await Promise.all([w.get(G,"a11y"),w.get(G,"extensions"),w.get(G,"sticky")]);this.#n=Array.isArray(t)?t:[],this.#s={...Jt,...e??{}},this.#r=s==="on"}#c(t){return t!==""&&t!==void 0}#o(t){return t==="compact"?"compact":t==="spacious"?"spacious":"default"}#p(t,e){return t?e==="compact"?"compact":e==="spacious"?"spacious":"default":""}#h(){return this.#r}#f(t){return t!==""&&t!==void 0}#d(t){return t==="flush"?"flush":t==="elevated"?"elevated":"default"}#l(t,e){return t?e==="flush"?"flush":e==="elevated"?"elevated":"default":""}#u(t){if(!t)return"card";let e=t.split(/\s+/);for(let s of e)if(s==="stretch"||s==="integrated")return s;return"card"}#m(t){return t?t.split(/\s+/).includes("fixed"):!1}#g(t,e){let s=[];return t&&t!=="card"&&s.push(t),e&&s.push("fixed"),s.join(" ")||"card"}#v(){this.#e=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#e||(this.#e=document.createElement("button"),this.#e.setAttribute("data-trigger",""),this.#e.setAttribute("aria-label","Site settings"),this.#e.className="settings-trigger",this.#e.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>',this.prepend(this.#e)),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.#t=document.createElement("div"),this.#t.className="settings-panel",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label","Site settings");let t=`settings-panel-${crypto.randomUUID().slice(0,8)}`;this.#t.id=t,this.#e.setAttribute("aria-controls",t),this.#t.innerHTML=this.#A(),this.appendChild(this.#t)}#A(){let{mode:t,brand:e,fluid:s,backdrop:n,backdropChrome:r,pageBgType:a,pageBgColor:o,pageBgGradStart:c,pageBgGradEnd:l,pageBgGradDir:h}=S.getState(),d=this.#O(),u=this.#Y(),b=this.#c(s),y=this.#o(s),p=this.#f(n),E=this.#d(n);return`
|
|
121
|
+
`}#N(t){if(this.#a.length===0)return;t<0&&(t=this.#a.length-1),t>=this.#a.length&&(t=0);let e=this.#r.querySelector("[data-active]");e&&e.removeAttribute("data-active"),this.#s?.removeAttribute("aria-activedescendant"),this.#c=t;let s=this.#r.querySelector(`[data-result-index="${t}"]`);s&&(s.setAttribute("data-active",""),this.#s?.setAttribute("aria-activedescendant",s.id),s.scrollIntoView({block:"nearest"}))}#S(t){t.url&&(this.close(),window.location.href=t.url)}#$(){this.#h&&(clearTimeout(this.#h),this.#h=null)}open(){this.#o||(this.#o=!0,this.setAttribute("open",""),this.#i?.setAttribute("aria-expanded","true"),document.body.style.overflow="hidden",requestAnimationFrame(()=>{this.#s?.focus(),this.#s?.select()}),this.#b(),this.dispatchEvent(new CustomEvent("site-search:open",{bubbles:!0})))}close(){this.#o&&(this.#o=!1,this.removeAttribute("open"),this.#i?.setAttribute("aria-expanded","false"),document.body.style.overflow="",this.#$(),this.#s.value="",this.#s?.removeAttribute("aria-activedescendant"),this.#a=[],this.#c=-1,this.#r.innerHTML="",this.#i?.focus(),this.dispatchEvent(new CustomEvent("site-search:close",{bubbles:!0})))}get isOpen(){return this.#o}};f("site-search",Ie);function Pe(i){if(!i||typeof i!="string")return"";let t=document.createElement("template");return t.innerHTML=i,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(n=>n.remove()),t.content.querySelectorAll("*").forEach(n=>{for(let r of[...n.attributes]){if(r.name.startsWith("on")){n.removeAttribute(r.name);continue}if(["href","src","action","formaction","xlink:href"].includes(r.name)){let a=r.value.trim().toLowerCase();(a.startsWith("javascript:")||a.startsWith("data:text/html"))&&n.removeAttribute(r.name);continue}(r.name==="srcdoc"||r.name==="data"&&n.tagName==="OBJECT")&&n.removeAttribute(r.name)}}),t.innerHTML}var Ea=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function Qs(i){return!i||typeof i!="string"?!1:Ea.test(i.trim())}function wt(i,t){if(!Qs(t)){console.warn(`[card-list] Unsafe property path rejected: "${t}"`);return}let s=t.replace(/\[(\d+)\]/g,".$1").split("."),n=i;for(let r of s){if(n==null)return;n=n[r]}return n}function Aa(i){return i?i.split(",").map(t=>{let[e,s]=t.split(":").map(n=>n.trim());return{attr:e,path:s}}).filter(({attr:t,path:e})=>t&&e):[]}var Be=class extends m{#e=null;#t=[];#i="id";static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#e=this.querySelector("template"),!this.#e)return console.warn("[card-list] No template found"),!1;this.#i=this.getAttribute("data-key")||"id";let t=this.getAttribute("data-items");if(t){try{this.#t=JSON.parse(t),this.#s()}catch(s){console.error("[card-list] Invalid JSON in data-items:",s)}return}let e=this.getAttribute("src");e&&this.#n(e)}attributeChangedCallback(t,e,s){if(e!==s)if(t==="data-items"&&s)try{this.#t=JSON.parse(s),this.#s()}catch(n){console.error("[card-list] Invalid JSON in data-items:",n)}else t==="src"&&s?this.#n(s):t==="data-key"&&(this.#i=s||"id",this.#s())}async#n(t){try{this.setAttribute("data-loading","");let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();this.#t=Array.isArray(s)?s:s.items||s.data||[],this.#s()}catch(e){console.error("[card-list] Fetch error:",e),this.setAttribute("data-error",e.message)}finally{this.removeAttribute("data-loading")}}#s(){if(!this.#e)return;this.querySelectorAll(":scope > :not(template)").forEach(s=>s.remove());let e=document.createDocumentFragment();for(let s of this.#t){let n=this.#e.content.cloneNode(!0);this.#r(n,s),e.appendChild(n)}this.appendChild(e),this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#t.length},bubbles:!0}))}#r(t,e){t.querySelectorAll("[data-field]").forEach(s=>{let n=s.getAttribute("data-field"),r=wt(e,n);s.textContent=r??""}),t.querySelectorAll("[data-field-attr]").forEach(s=>{let n=Aa(s.getAttribute("data-field-attr"));for(let{attr:r,path:a}of n){if(!Qs(a))continue;let o=wt(e,a);o!=null&&s.setAttribute(r,o)}}),t.querySelectorAll("[data-field-html]").forEach(s=>{let n=s.getAttribute("data-field-html"),r=wt(e,n);s.innerHTML=Pe(r)}),t.querySelectorAll("[data-field-if]").forEach(s=>{let n=s.getAttribute("data-field-if");wt(e,n)||s.remove()}),t.querySelectorAll("[data-field-unless]").forEach(s=>{let n=s.getAttribute("data-field-unless");wt(e,n)&&s.remove()})}setItems(t){this.#t=Array.isArray(t)?t:[],this.#s()}getItems(){return[...this.#t]}};f("card-list",Be);var Sa=0;function zt(i,t){return i.matches("content-swap")?t:`data-${t}`}function Vt(i){i.style.viewTransitionName||(i.style.viewTransitionName=`content-swap-${++Sa}`);let t=i.querySelector(':scope > [data-face="front"]'),e=i.querySelector(':scope > [data-face="back"]');if(!t||!e)return;let s=[];function n(o,c,l,h){o.addEventListener(c,l,h),s.push(()=>o.removeEventListener(c,l,h))}let r=[...i.querySelectorAll("[data-swap]")].filter(o=>o!==i&&o.closest("content-swap, [data-swap]")===i);return r.length===0?(i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.getAttribute("aria-label")||i.setAttribute("aria-label","Toggle content"),n(i,"click",()=>At(i,"pointer")),n(i,"keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),At(i,"keyboard"))})):r.forEach(o=>{n(o,"click",c=>{c.stopPropagation(),At(i,"pointer")}),n(o,"keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),At(i,"keyboard"))})}),sn(i,t,e),()=>{for(let o of s)o();s.length=0}}function sn(i,t,e){let s=i.hasAttribute(zt(i,"swapped"));t.inert=s,e.inert=!s}function Ca(i){return{front:i.querySelector(':scope > [data-face="front"]'),back:i.querySelector(':scope > [data-face="back"]')}}function Et(i,t,e="api"){let{front:s,back:n}=Ca(i);if(!s||!n)return;let r=zt(i,"swapped");if(t&&i.hasAttribute(r)||!t&&!i.hasAttribute(r))return;B(()=>{t?i.setAttribute(r,""):i.removeAttribute(r),sn(i,s,n),ka(i);let o=t?n:s,c=o.querySelector("[autofocus]");c?c.focus():e==="keyboard"&&xa(o)})}function At(i,t="api"){Et(i,!i.hasAttribute(zt(i,"swapped")),t)}function ka(i){i.dispatchEvent(new CustomEvent("content-swap:swap",{detail:{swapped:i.hasAttribute(zt(i,"swapped"))},bubbles:!0}))}function xa(i){let t=i.querySelector("[data-swap], button, a, input, select, textarea");t&&t.focus()}var Fe=class extends m{#e=null;setup(){this.#e=Vt(this)??null}teardown(){this.#e?.(),this.#e=null}flip(){Et(this,!0)}unflip(){Et(this,!1)}toggle(){At(this)}get flipped(){return this.hasAttribute("swapped")}set flipped(t){Et(this,!!t)}get swapped(){return this.hasAttribute("swapped")}set swapped(t){Et(this,!!t)}};f("content-swap",Fe);function tn(){document.querySelectorAll("[data-swap]:not(content-swap):not([data-swap-init])").forEach(i=>{i.querySelector(":scope > [data-face]")&&(Vt(i),i.setAttribute("data-swap-init",""))})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",tn):tn();var en=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.hasAttribute("data-swap")&&!s.matches("content-swap")&&!s.hasAttribute("data-swap-init")&&s.querySelector(":scope > [data-face]")&&(Vt(s),s.setAttribute("data-swap-init","")),s.querySelectorAll("[data-swap]:not(content-swap):not([data-swap-init])").forEach(n=>{n.querySelector(":scope > [data-face]")&&(Vt(n),n.setAttribute("data-swap-init",""))})}});document.body?en.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{en.observe(document.body,{childList:!0,subtree:!0})});var La=0,Re=class extends m{#e;#t=[];#i;#n;#s;#r;#a;#c=null;#o=0;#p=!1;#h=!1;#f=null;get currentIndex(){return this.#o}get slideCount(){return this.#t.length}get playing(){return this.#c!==null}setup(){let t=[...this.children];if(t.length===0)return!1;if(this.#p=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#h=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#h&&this.removeAttribute("transition"),this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#e=document.createElement("div"),this.#e.className="carousel-track",this.#e.setAttribute("tabindex","0"),this.#e.setAttribute("aria-label","Slides"),t.forEach((r,a)=>{r.setAttribute("role","group"),r.setAttribute("aria-roledescription","slide"),r.setAttribute("aria-label",`${a+1} of ${t.length}`),this.#e.appendChild(r)}),this.#t=[...this.#e.children],this.#i=document.createElement("button"),this.#i.className="carousel-prev",this.#i.setAttribute("aria-label","Previous slide"),this.#i.innerHTML='<icon-wc name="chevron-left" size="sm"></icon-wc>',this.#n=document.createElement("button"),this.#n.className="carousel-next",this.#n.setAttribute("aria-label","Next slide"),this.#n.innerHTML='<icon-wc name="chevron-right" size="sm"></icon-wc>',this.getAttribute("indicators")!=="false"&&(this.#s=document.createElement("div"),this.#s.className="carousel-indicators",this.#s.setAttribute("aria-label","Slide indicators"),this.#t.forEach((r,a)=>{let o=document.createElement("button");o.className="carousel-dot",o.setAttribute("aria-label",`Go to slide ${a+1}`),o.setAttribute("aria-current",a===0?"true":"false"),this.listen(o,"click",()=>this.goTo(a)),this.#s.appendChild(o)})),this.#r=document.createElement("div"),this.#r.className="carousel-live",this.#r.setAttribute("aria-live","polite"),this.#r.setAttribute("aria-atomic","true"),this.appendChild(this.#i),this.appendChild(this.#e),this.appendChild(this.#n),this.#s&&this.appendChild(this.#s),this.appendChild(this.#r),this.listen(this.#i,"click",()=>this.prev()),this.listen(this.#n,"click",()=>this.next()),this.listen(this.#e,"keydown",this.#g),this.#h){let r=++La,a=this.getAttribute("transition")||"fade",o=a==="slide"?"vt-carousel-slide":a==="scale"?"vt-carousel-scale":"vt-carousel";this.#e.style.viewTransitionName=`carousel-${r}`,this.#e.style.viewTransitionClass=o}this.#h&&Promise.resolve().then(()=>(hn(),ln)).then(({addSwipeListener:r})=>{this.#f=r(this.#e,{threshold:40}),this.listen(this.#e,"swipe-left",()=>this.next()),this.listen(this.#e,"swipe-right",()=>this.prev())}),this.#h||(this.#a=new IntersectionObserver(this.#m,{root:this.#e,threshold:.5}),this.#t.forEach(r=>this.#a.observe(r)));let n=this.#A()??(Number(this.getAttribute("start"))||0);if(this.#h){let r=n>0&&n<this.#t.length?n:0;this.#t.forEach((a,o)=>{a.hidden=o!==r}),this.#l(r)}else n>0&&n<this.#t.length&&this.goTo(n,!1);this.#u(),this.hasAttribute("autoplay")&&!this.#p&&this.#v()}teardown(){this.pause(),this.#a&&(this.#a.disconnect(),this.#a=null),this.#f&&(this.#f(),this.#f=null),this.#t=[],this.#h=!1}next(){let t=this.hasAttribute("loop");this.#o<this.#t.length-1?this.goTo(this.#o+1):t&&this.goTo(0)}prev(){let t=this.hasAttribute("loop");this.#o>0?this.goTo(this.#o-1):t&&this.goTo(this.#t.length-1)}goTo(t,e=!0){if(!(t<0||t>=this.#t.length)){if(this.#h)if(e&&t!==this.#o){let s=t>this.#o?"forward":"backward";document.documentElement.dataset.vtDirection=s,B(()=>{this.#d(t)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#d(t);else{let s=this.#t[t].offsetLeft-this.#e.offsetLeft,n=e&&!this.#p?"smooth":"instant";this.#e.scrollTo({left:s,behavior:n})}this.#l(t)}}#d(t){this.#t.forEach((e,s)=>{e.hidden=s!==t})}play(){if(this.#c||this.#p)return;let t=Number(this.getAttribute("autoplay-delay"))||5e3;this.#c=setInterval(()=>this.next(),t),this.dispatchEvent(new CustomEvent("carousel-wc:play",{bubbles:!0}))}pause(){this.#c&&(clearInterval(this.#c),this.#c=null,this.dispatchEvent(new CustomEvent("carousel-wc:pause",{bubbles:!0})))}reset(){let t=Number(this.getAttribute("start"))||0;this.goTo(t,!1),this.#y()}#l(t){this.#o=t,this.#u(),this.#b(),this.#r&&(this.#r.textContent=`Slide ${t+1} of ${this.#t.length}`),this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:t,slide:this.#t[t]},bubbles:!0}))}#u(){let t=this.hasAttribute("loop"),e=this.#o===0,s=this.#o===this.#t.length-1;if(this.#i&&(this.#i.disabled=!t&&e),this.#n&&(this.#n.disabled=!t&&s),this.#s){let n=this.#s.children;for(let r=0;r<n.length;r++){let a=r===this.#o;n[r].setAttribute("aria-current",a?"true":"false"),a?n[r].setAttribute("data-active",""):n[r].removeAttribute("data-active")}}}#m=t=>{for(let e of t)if(e.isIntersecting){let s=this.#t.indexOf(e.target);s!==-1&&s!==this.#o&&this.#l(s)}};#g=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.prev();break;case"ArrowRight":t.preventDefault(),this.next();break;case"Home":t.preventDefault(),this.goTo(0);break;case"End":t.preventDefault(),this.goTo(this.#t.length-1);break}};#v(){this.play(),this.listen(this,"mouseenter",()=>this.pause()),this.listen(this,"mouseleave",()=>{this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"focusin",()=>this.pause()),this.listen(this,"focusout",t=>{!this.contains(t.relatedTarget)&&this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"touchstart",()=>this.pause(),{passive:!0})}#A(){let t=this.getAttribute("persist");if(!t)return null;try{let e=localStorage.getItem(`carousel:${t}`);return e!==null?Number(e):null}catch{return null}}#b(){let t=this.getAttribute("persist");if(t)try{localStorage.setItem(`carousel:${t}`,String(this.#o))}catch{}}#y(){let t=this.getAttribute("persist");if(t)try{localStorage.removeItem(`carousel:${t}`)}catch{}}};f("carousel-wc",Re);function dn(i,t,e){"role"in ElementInternals.prototype?t.role=e:i.setAttribute("role",e)}var He=class extends m{static formAssociated=!0;#e;#t;#i;#n=[];#s=[];#r=-1;#a=!1;#c=!1;#o="";#p="";#h="";#f;#d;#l=[];constructor(){super(),this.#e=this.attachInternals()}get#u(){return this.hasAttribute("multiple")}setup(){if(this.#t=this.querySelector(":scope > input")||this.querySelector(":scope > .tags-input-area > input"),!this.#t||(this.#i=this.querySelector(":scope > ul, :scope > ol"),!this.#i))return!1;this.#c=F,this.#c&&this.#i.setAttribute("popover","manual"),this.#u&&(this.#f=document.createElement("div"),this.#f.className="tags-input-area",this.insertBefore(this.#f,this.#i),this.#f.appendChild(this.#t),this.#d=document.createElement("div"),this.#d.setAttribute("aria-live","polite"),this.#d.setAttribute("aria-atomic","true"),this.#d.className="visually-hidden",this.appendChild(this.#d));let t=this.getAttribute("placeholder");t&&!this.#t.getAttribute("placeholder")&&this.#t.setAttribute("placeholder",t);let e=crypto.randomUUID().slice(0,8);if(this.#i.id||(this.#i.id=`combobox-listbox-${e}`),dn(this.#t,this.#e,"combobox"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-autocomplete","list"),this.#t.setAttribute("aria-controls",this.#i.id),this.#t.setAttribute("autocomplete","off"),this.#i.setAttribute("role","listbox"),this.#u&&this.#i.setAttribute("aria-multiselectable","true"),this.#m(),!this.#u){let s=this.getAttribute("value");s&&this.#T(s,!1),this.#h=this.#o}this.listen(this.#t,"input",this.#y),this.listen(this.#t,"keydown",this.#w),this.listen(this.#t,"focus",this.#P),this.listen(this.#t,"click",this.#N),this.listen(this.#i,"click",this.#S),this.listen(this.#i,"pointerdown",this.#$),this.listen(document,"click",this.#D),this.#c&&this.listen(this.#i,"toggle",this.#V),this.#E(),this.#C(),this.#x()}teardown(){window.removeEventListener("scroll",this.#q,{capture:!0}),window.removeEventListener("resize",this.#q)}#m(){this.#n=Array.from(this.#i.querySelectorAll(":scope > li[data-value]")),this.#n.forEach((t,e)=>{t.setAttribute("role","option"),t.setAttribute("aria-selected","false"),t.id||(t.id=`${this.#i.id}-option-${e}`)}),this.#s=[...this.#n]}#g(t,e){if(this.#l.some(o=>o.value===t))return;let s=this.#A();if(s&&this.#l.length>=s)return;this.#l.push({value:t,label:e});let n=document.createElement("span");n.className="tag",n.dataset.value=t,n.textContent=e+" ";let r=document.createElement("button");r.type="button",r.setAttribute("aria-label",`Remove ${e}`),r.innerHTML="×",r.addEventListener("click",o=>{o.stopPropagation(),this.#v(t)}),n.appendChild(r),this.#f.insertBefore(n,this.#t);let a=this.#n.find(o=>o.getAttribute("data-value")===t);a&&a.setAttribute("aria-selected","true"),this.#b(`${e} added`),this.#t.value="",this.#k(""),this.#E(),this.#C(),this.#R(),s&&this.#l.length>=s&&(this.#t.disabled=!0,this.#x())}#v(t){let e=this.#l.findIndex(o=>o.value===t);if(e===-1)return;let s=this.#l.splice(e,1)[0],n=this.#f.querySelector(`.tag[data-value="${CSS.escape(t)}"]`);n&&n.remove();let r=this.#n.find(o=>o.getAttribute("data-value")===t);r&&r.setAttribute("aria-selected","false"),this.#b(`${s.label} removed`),this.#A()&&this.#t.disabled&&(this.#t.disabled=!1),this.#k(this.#t.value.trim()),this.#E(),this.#C(),this.#R(),this.#t.focus()}#A(){let t=this.getAttribute("max");return t?parseInt(t,10):0}#b(t){this.#d&&(this.#d.textContent="",requestAnimationFrame(()=>{this.#d.textContent=t}))}#y=()=>{let t=this.#t.value.trim();if(!this.#u&&this.#o){let e=this.#i.querySelector('[aria-selected="true"]');e&&e.setAttribute("aria-selected","false"),this.#o="",this.#p="",this.removeAttribute("value"),this.#E(),this.#C()}this.#k(t),this.#L()};#w=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),this.#a||this.#L(),this.#O(this.#r+1);break;case"ArrowUp":t.preventDefault(),this.#a||this.#L(),this.#O(this.#r-1);break;case"Home":this.#a&&(t.preventDefault(),this.#O(0));break;case"End":this.#a&&(t.preventDefault(),this.#O(this.#s.length-1));break;case"Enter":if(t.preventDefault(),this.#a&&this.#r>=0&&this.#s[this.#r]){let e=this.#s[this.#r];this.#u?this.#g(e.getAttribute("data-value"),e.textContent.trim()):this.#F(e)}else if(this.#u&&this.hasAttribute("custom")&&this.#t.value.trim()){let e=this.#t.value.trim();this.#g(e,e)}break;case"Backspace":if(this.#u&&!this.#t.value&&this.#l.length>0){let e=this.#l[this.#l.length-1];this.#v(e.value)}break;case",":if(this.#u&&this.hasAttribute("custom")&&this.#t.value.trim()){t.preventDefault();let e=this.#t.value.trim();this.#g(e,e)}break;case"Escape":this.#a&&(t.preventDefault(),t.stopPropagation(),this.#x(),this.#t.focus());break;case"Tab":this.#a&&this.#x();break}};#P=()=>{this.#u?(this.#k(this.#t.value.trim()),this.#L()):(this.#t.value||!this.#o)&&(this.#k(this.#t.value.trim()),this.#L())};#N=()=>{this.#a||(this.#k(this.#t.value.trim()),this.#L())};#S=t=>{let e=t.target.closest("li[data-value]");e&&this.#s.includes(e)&&(this.#u?this.#g(e.getAttribute("data-value"),e.textContent.trim()):this.#F(e))};#$=t=>{t.preventDefault()};#D=t=>{this.#a&&!this.contains(t.target)&&this.#x()};#k(t){let e=this.getAttribute("filter")||"contains",s=t.toLowerCase(),n=this.#u?new Set(this.#l.map(r=>r.value)):null;this.#s=[],this.#n.forEach(r=>{let a=r.getAttribute("data-value"),o=r.textContent.trim().toLowerCase();if(n&&n.has(a)){r.hidden=!0;return}let c;t?e==="startsWith"?c=o.startsWith(s):c=o.includes(s):c=!0,r.hidden=!c,c&&this.#s.push(r)}),this.#r=-1,this.#_()}#O(t){if(this.#s.length===0)return;t<0&&(t=this.#s.length-1),t>=this.#s.length&&(t=0),this.#r>=0&&this.#s[this.#r]&&this.#s[this.#r].removeAttribute("data-active"),this.#r=t;let e=this.#s[t];e.setAttribute("data-active",""),e.scrollIntoView({block:"nearest"}),this.#t.setAttribute("aria-activedescendant",e.id)}#_(){this.#n.forEach(t=>t.removeAttribute("data-active")),this.#t.removeAttribute("aria-activedescendant")}#F(t){let e=t.getAttribute("data-value"),s=t.textContent.trim();this.#n.forEach(n=>n.setAttribute("aria-selected","false")),t.setAttribute("aria-selected","true"),this.#o=e,this.#p=s,this.#t.value=s,this.setAttribute("value",e),this.#E(),this.#C(),this.#x(),this.#t.focus(),this.dispatchEvent(new CustomEvent("combo-box:change",{bubbles:!0,detail:{value:e,label:s}}))}#T(t,e=!0){let s=this.#n.find(n=>n.getAttribute("data-value")===t);s&&(e?this.#F(s):(s.setAttribute("aria-selected","true"),this.#o=t,this.#p=s.textContent.trim(),this.#t.value=this.#p,this.setAttribute("value",t)))}#q=()=>this.#B();#L(){if(!this.#a){if(this.#a=!0,this.setAttribute("open",""),this.#t.setAttribute("aria-expanded","true"),this.#i.hidden=!1,this.#c){this.#B();try{this.#i.showPopover()}catch{}window.addEventListener("scroll",this.#q,{capture:!0,passive:!0}),window.addEventListener("resize",this.#q,{passive:!0})}this.dispatchEvent(new CustomEvent("combo-box:open",{bubbles:!0}))}}#x(){if(!(!this.#a&&this.#i.hidden)){if(this.#a=!1,this.removeAttribute("open"),this.#t.setAttribute("aria-expanded","false"),this.#i.hidden=!0,this.#r=-1,this.#_(),this.#c){try{this.#i.hidePopover()}catch{}window.removeEventListener("scroll",this.#q,{capture:!0}),window.removeEventListener("resize",this.#q)}this.dispatchEvent(new CustomEvent("combo-box:close",{bubbles:!0}))}}get#M(){return this.#u&&this.#f?this.#f:this.#t}#B(){if(!this.#c)return;let t=this.#M;if(!t)return;let e=t.getBoundingClientRect();this.#i.style.setProperty("--combobox-top",`${e.bottom+2}px`),this.#i.style.setProperty("--combobox-left",`${e.left}px`),this.#i.style.setProperty("--combobox-width",`${e.width}px`)}#V=t=>{t.newState==="closed"&&this.#a&&(this.#a=!1,this.removeAttribute("open"),this.#t.setAttribute("aria-expanded","false"),this.#i.hidden=!0,this.#r=-1,this.#_(),this.dispatchEvent(new CustomEvent("combo-box:close",{bubbles:!0})))};#E(){if(this.#u)if(this.#l.length>0){let t=new FormData,e=this.getAttribute("name")||"";for(let s of this.#l)t.append(e,s.value);this.#e.setFormValue(t)}else this.#e.setFormValue(null);else this.#o?this.#e.setFormValue(this.#o,this.#p):this.#e.setFormValue(null)}#C(){this.hasAttribute("required")?this.#u?this.#l.length===0?this.#e.setValidity({valueMissing:!0},"Please select at least one option",this.#t):this.#e.setValidity({}):this.#o?this.#e.setValidity({}):this.#e.setValidity({valueMissing:!0},"Please select an option",this.#t):this.#e.setValidity({})}#R(){this.dispatchEvent(new CustomEvent("combo-box:change",{bubbles:!0,detail:{values:this.#l.map(t=>t.value),labels:this.#l.map(t=>t.label)}}))}formResetCallback(){this.#u?(this.#f.querySelectorAll(".tag").forEach(t=>t.remove()),this.#l=[],this.#t.value="",this.#t.disabled=!1):(this.#o="",this.#p="",this.#t.value="",this.removeAttribute("value")),this.#n.forEach(t=>{t.setAttribute("aria-selected","false"),t.hidden=!1}),this.#s=[...this.#n],this.#r=-1,this.#_(),this.#x(),!this.#u&&this.#h&&this.#T(this.#h,!1),this.#E(),this.#C()}formStateRestoreCallback(t){t&&(this.#u||(this.#T(t,!1),this.#E(),this.#C()))}get value(){return this.#o}set value(t){t?this.#T(t):(this.#n.forEach(e=>e.setAttribute("aria-selected","false")),this.#o="",this.#p="",this.#t.value="",this.removeAttribute("value"),this.#E(),this.#C())}get label(){return this.#p}get values(){return this.#l.map(t=>t.value)}get labels(){return this.#l.map(t=>t.label)}static get observedAttributes(){return["value"]}attributeChangedCallback(t,e,s){t==="value"&&this.#t&&s!==this.#o&&s&&(this.#T(s,!1),this.#E(),this.#C())}};f("combo-box",He);function Ma(){try{let i=new Intl.DateTimeFormat(void 0,{hour:"numeric"}).resolvedOptions();return i.hourCycle==="h12"||i.hourCycle==="h11"?"12h":"24h"}catch{return"12h"}}function $(i){return String(i).padStart(2,"0")}function dt(i){if(!i)return null;let t=i.split(":").map(Number);return{h:t[0]||0,m:t[1]||0,s:t[2]||0}}function St(i,t,e,s){return s?`${$(i)}:${$(t)}:${$(e)}`:`${$(i)}:${$(t)}`}function Na(i,t,e,s,n){if(n==="12h"){let r=i>=12?"PM":"AM",a=i%12||12;return s?`${a}:${$(t)}:${$(e)} ${r}`:`${a}:${$(t)} ${r}`}return St(i,t,e,s)}function un(i){let t=i.trim();if(!t)return null;let e=t.match(/\s*(am|pm|a\.m\.|p\.m\.|a|p)\s*$/i),s=null,n=t;e&&(s=e[1].toLowerCase().replace(/\./g,"").startsWith("p")?"PM":"AM",n=t.slice(0,e.index).trim());let r=n.split(/[:.]/);if(r.length<1||r.length>3)return null;let a=Number(r[0]),o=r.length>1?Number(r[1]):0,c=r.length>2?Number(r[2]):0;if(isNaN(a)||isNaN(o)||isNaN(c)||o<0||o>59||c<0||c>59)return null;let l=a;if(s){if(l<1||l>12)return null;s==="AM"?l=l===12?0:l:l=l===12?12:l+12}else if(l<0||l>23)return null;return{h:l,m:o,s:c}}function Da(i,t,e){return i>e?t:i<t?e:i}var Ve=class extends m{static formAssociated=!0;#e;#t;#i;#n;#s;#r;#a=[];#c;#o;#p;#h=0;#f=0;#d=0;#l="AM";#u=null;#m=null;#g=60;#v;#A=0;#b=!1;#y;constructor(){super(),this.#e=this.attachInternals()}setup(){if(this.#t=this.querySelector(':scope > input[type="time"]'),!this.#t)return!1;this.#g=Number(this.#t.getAttribute("step"))||60,this.#p=this.#g<60,this.#u=dt(this.#t.getAttribute("min")),this.#m=dt(this.#t.getAttribute("max")),this.#o=this.getAttribute("data-format")||Ma();let t=dt(this.#t.value);t&&(this.#h=t.h,this.#f=t.m,this.#d=t.s),this.#v=this.#t.value,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#t.setAttribute("tabindex","-1"),this.#t.setAttribute("aria-hidden","true"),this.#t.style.cssText="position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;overflow:hidden;",this.#w(),this.#P(),this.#V(),this.#E(),this.#C(),this.#R(),this.listen(document,"click",this.#k),(this.#t.disabled||this.hasAttribute("disabled"))&&(this.setAttribute("data-disabled",""),this.#i.disabled=!0)}#w(){this.#n=document.createElement("div"),this.#n.className="time-trigger",this.#i=document.createElement("input"),this.#i.type="text",this.#i.className="time-input",this.#i.setAttribute("role","combobox"),this.#i.setAttribute("aria-haspopup","listbox"),this.#i.setAttribute("aria-expanded","false"),this.#i.setAttribute("autocomplete","off"),this.#i.setAttribute("placeholder","Type a time\u2026"),this.#n.appendChild(this.#i),this.#s=document.createElement("button"),this.#s.type="button",this.#s.className="time-trigger-icon",this.#s.setAttribute("aria-label","Toggle time spinner"),this.#s.setAttribute("tabindex","-1");let t=document.createElement("icon-wc");t.setAttribute("name","clock"),t.setAttribute("size","sm"),t.setAttribute("aria-hidden","true"),this.#s.appendChild(t),this.#n.appendChild(this.#s),this.appendChild(this.#n),this.listen(this.#s,"click",e=>{e.stopPropagation(),this.#b?this.#D():this.#$(),this.#i.focus()}),this.listen(this.#i,"focus",()=>this.#i.select()),this.listen(this.#i,"keydown",this.#O),this.listen(this.#i,"blur",this.#_)}#P(){this.#y=`tp-${Math.random().toString(36).slice(2,8)}`,this.#r=document.createElement("div"),this.#r.className="time-panel",this.#r.id=this.#y,this.#r.setAttribute("role","group"),this.#r.setAttribute("aria-label","Time spinners"),this.#i.setAttribute("aria-controls",this.#y);let t=this.#o==="12h"?1:0,e=this.#o==="12h"?12:23,s=this.#N("Hours",t,e,1);this.#r.appendChild(s.el),this.#a.push(s),this.#r.appendChild(this.#S());let n=this.#g>=60?Math.max(1,Math.round(this.#g/60)):1,r=this.#N("Minutes",0,59,n);if(this.#r.appendChild(r.el),this.#a.push(r),this.#p){this.#r.appendChild(this.#S());let a=this.#N("Seconds",0,59,this.#g);this.#r.appendChild(a.el),this.#a.push(a)}this.#o==="12h"&&(this.#c=document.createElement("button"),this.#c.type="button",this.#c.className="period-toggle",this.#c.setAttribute("aria-label","Toggle AM/PM"),this.#c.textContent=this.#l,this.#r.appendChild(this.#c),this.listen(this.#c,"click",()=>{this.#l=this.#l==="AM"?"PM":"AM",this.#c.textContent=this.#l,this.#h=this.#z(this.#H(),this.#l),this.#B()}),this.listen(this.#c,"keydown",a=>{a.key==="ArrowLeft"&&(a.preventDefault(),this.#I(this.#a.length-1)),a.key==="Escape"&&(a.preventDefault(),this.#D(),this.#i.focus())})),this.appendChild(this.#r)}#N(t,e,s,n){let r=document.createElement("div");r.className="time-spinner",r.setAttribute("role","spinbutton"),r.setAttribute("aria-label",t),r.setAttribute("aria-valuemin",String(e)),r.setAttribute("aria-valuemax",String(s)),r.setAttribute("tabindex","0");let a=document.createElement("button");a.type="button",a.className="time-inc",a.setAttribute("aria-hidden","true"),a.setAttribute("tabindex","-1"),a.innerHTML="▲";let o=document.createElement("span");o.className="time-value";let c=document.createElement("button");c.type="button",c.className="time-dec",c.setAttribute("aria-hidden","true"),c.setAttribute("tabindex","-1"),c.innerHTML="▼",r.appendChild(a),r.appendChild(o),r.appendChild(c);let l={el:r,valueEl:o,label:t,min:e,max:s,step:n};return this.listen(a,"click",()=>{this.#x(l,n)}),this.listen(c,"click",()=>{this.#x(l,-n)}),this.listen(r,"keydown",h=>{this.#F(h,l)}),this.listen(r,"focus",()=>{this.#A=this.#a.indexOf(l)}),l}#S(){let t=document.createElement("span");return t.className="time-sep",t.setAttribute("aria-hidden","true"),t.textContent=":",t}#$(){this.#b||(this.#b=!0,this.#r.setAttribute("data-open",""),this.#i.setAttribute("aria-expanded","true"))}#D(){this.#b&&(this.#b=!1,this.#r.removeAttribute("data-open"),this.#i.setAttribute("aria-expanded","false"))}#k=t=>{this.#b&&!this.contains(t.target)&&this.#D()};#O=t=>{switch(t.key){case"Enter":{t.preventDefault(),t.stopPropagation();let e=un(this.#i.value);e&&(this.#h=e.h,this.#f=e.m,this.#d=e.s,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#B()),this.#E(),this.#b&&this.#D();return}case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.#b||this.#$(),requestAnimationFrame(()=>this.#I(0));return;case"Escape":t.preventDefault(),t.stopPropagation(),this.#b&&this.#D(),this.#E();return;case"Tab":this.#b&&this.#D();return}};#_=t=>{if(t.relatedTarget&&this.contains(t.relatedTarget))return;let e=this.#i.value.trim();if(e){let s=un(e);s&&(this.#h=s.h,this.#f=s.m,this.#d=s.s,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#C(),this.#R(),this.dispatchEvent(new CustomEvent("time-picker:change",{bubbles:!0,detail:{value:St(this.#h,this.#f,this.#d,this.#p),hours:this.#h,minutes:this.#f,seconds:this.#d}})))}this.#E(),this.#b&&this.#D(),this.#t.dispatchEvent(new Event("blur",{bubbles:!0}))};#F=(t,e)=>{let s=this.#a.indexOf(e);switch(t.key){case"ArrowUp":t.preventDefault(),this.#x(e,e.step);break;case"ArrowDown":t.preventDefault(),this.#x(e,-e.step);break;case"ArrowRight":t.preventDefault(),s<this.#a.length-1?this.#I(s+1):this.#c&&this.#c.focus();break;case"ArrowLeft":t.preventDefault(),s>0&&this.#I(s-1);break;case"PageUp":t.preventDefault(),this.#x(e,e.step*(e.label==="Hours"?1:10));break;case"PageDown":t.preventDefault(),this.#x(e,-e.step*(e.label==="Hours"?1:10));break;case"Home":t.preventDefault(),this.#M(e,e.min);break;case"End":t.preventDefault(),this.#M(e,e.max);break;case"Escape":t.preventDefault(),this.#D(),this.#i.focus();break;default:/^\d$/.test(t.key)&&(t.preventDefault(),this.#L(t.key,e))}};#T="";#q=0;#L(t,e){clearTimeout(this.#q),this.#T+=t;let s=Number(this.#T);if(this.#T.length>=2||s*10>e.max){let n=Math.min(Math.max(s,e.min),e.max);this.#M(e,n),this.#T=""}else this.#q=setTimeout(()=>{let n=Number(this.#T),r=Math.min(Math.max(n,e.min),e.max);this.#M(e,r),this.#T=""},800)}#x(t,e){let s;t.label==="Hours"?s=this.#o==="12h"?this.#H():this.#h:t.label==="Minutes"?s=this.#f:s=this.#d;let n=Da(s+e,t.min,t.max);this.#M(t,n)}#M(t,e){t.label==="Hours"?this.#o==="12h"?this.#h=this.#z(e,this.#l):this.#h=e:t.label==="Minutes"?this.#f=e:this.#d=e,this.#B()}#B(){this.#V(),this.#E(),this.#C(),this.#R(),this.dispatchEvent(new CustomEvent("time-picker:change",{bubbles:!0,detail:{value:St(this.#h,this.#f,this.#d,this.#p),hours:this.#h,minutes:this.#f,seconds:this.#d}}))}#V(){let t=this.#o==="12h"?this.#H():this.#h;this.#a[0].valueEl.textContent=$(t),this.#a[0].el.setAttribute("aria-valuenow",String(t)),this.#a[0].el.setAttribute("aria-valuetext",this.#o==="12h"?`${t} ${this.#l}`:String(t)),this.#a[1].valueEl.textContent=$(this.#f),this.#a[1].el.setAttribute("aria-valuenow",String(this.#f)),this.#p&&this.#a[2]&&(this.#a[2].valueEl.textContent=$(this.#d),this.#a[2].el.setAttribute("aria-valuenow",String(this.#d))),this.#c&&(this.#c.textContent=this.#l)}#E(){this.#h!==void 0&&(this.#i.value=Na(this.#h,this.#f,this.#d,this.#p,this.#o))}#C(){let t=St(this.#h,this.#f,this.#d,this.#p);this.#e.setFormValue(t),this.#t.value=t,this.#t.dispatchEvent(new Event("input",{bubbles:!0}))}#R(){if((this.hasAttribute("required")||this.#t.hasAttribute("required"))&&!this.#t.value){this.#e.setValidity({valueMissing:!0},"Please select a time",this.#i||this);return}this.#e.setValidity({})}#z(t,e){return e==="AM"?t===12?0:t:t===12?12:t+12}#H(){if(this.#o==="24h")return this.#h;let t=this.#h%12;return t===0?12:t}#I(t){this.#a[t]?.el.focus()}formResetCallback(){let t=dt(this.#v);t?(this.#h=t.h,this.#f=t.m,this.#d=t.s):(this.#h=0,this.#f=0,this.#d=0),this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#B()}formStateRestoreCallback(t){if(!t)return;let e=dt(t);e&&(this.#h=e.h,this.#f=e.m,this.#d=e.s,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#B())}get value(){return St(this.#h,this.#f,this.#d,this.#p)}set value(t){let e=dt(t);e&&(this.#h=e.h,this.#f=e.m,this.#d=e.s,this.#o==="12h"&&(this.#l=this.#h>=12?"PM":"AM"),this.#B())}};f("time-picker",Ve);var _a=["Su","Mo","Tu","We","Th","Fr","Sa"],qa=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],We=["january","february","march","april","may","june","july","august","september","october","november","december"];function O(i){let t=i.getFullYear(),e=String(i.getMonth()+1).padStart(2,"0"),s=String(i.getDate()).padStart(2,"0");return`${t}-${e}-${s}`}function I(i){if(!i)return null;let[t,e,s]=i.split("-").map(Number);return new Date(t,e-1,s)}function Wt(i,t){return new Date(i,t+1,0).getDate()}function $a(){try{let i=new Intl.Locale(navigator.language);if(i.weekInfo)return i.weekInfo.firstDay%7}catch{}return 0}function Oa(i){try{return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric"}).format(i)}catch{return O(i)}}function jt(i,t){return i&&t&&i.getFullYear()===t.getFullYear()&&i.getMonth()===t.getMonth()&&i.getDate()===t.getDate()}function Ia(){let i=new Map;We.forEach((t,e)=>{i.set(t,e),i.set(t.slice(0,3),e)});try{for(let t=0;t<12;t++){let e=new Intl.DateTimeFormat(void 0,{month:"long"}).format(new Date(2e3,t,1)).toLowerCase(),s=new Intl.DateTimeFormat(void 0,{month:"short"}).format(new Date(2e3,t,1)).toLowerCase().replace(".","");i.set(e,t),i.set(s,t)}}catch{}return i}var ze=Ia();function Ue(i){let t=i.trim();if(!t)return{date:null,partial:null};if(/^\d{4}-\d{2}-\d{2}$/.test(t)){let a=I(t);return a&&!isNaN(a.getTime())?{date:a,partial:null}:{date:null,partial:null}}if(/^\d{4}\/\d{2}\/\d{2}$/.test(t)){let a=I(t.replace(/\//g,"-"));return a&&!isNaN(a.getTime())?{date:a,partial:null}:{date:null,partial:null}}let e=/^([a-z\u00C0-\u024F]+)\s+(\d{1,2}),?\s+(\d{4})$/i,s=t.match(e);if(s){let a=ze.get(s[1].toLowerCase());if(a!==void 0){let o=new Date(Number(s[3]),a,Number(s[2]));if(!isNaN(o.getTime()))return{date:o,partial:null}}}let n=/^(\d{1,2})\s+([a-z\u00C0-\u024F]+)\s+(\d{4})$/i;if(s=t.match(n),s){let a=ze.get(s[2].toLowerCase());if(a!==void 0){let o=new Date(Number(s[3]),a,Number(s[1]));if(!isNaN(o.getTime()))return{date:o,partial:null}}}let r=/^([a-z\u00C0-\u024F]+)\s+(\d{4})$/i;if(s=t.match(r),s){let a=ze.get(s[1].toLowerCase());if(a!==void 0)return{date:null,partial:{year:Number(s[2]),month:a}}}return{date:null,partial:null}}var je=class extends m{static formAssociated=!0;#e;#t;#i;#n;#s;#r;#a;#c;#o;#p;#h=!1;#f=!1;#d=null;#l=null;#u;#m;#g=null;#v=null;#A=new Map;#b=new Map;#y;#w;constructor(){super(),this.#e=this.attachInternals()}setup(){if(this.#t=this.querySelector(':scope > input[type="date"]'),!this.#t)return!1;this.#g=I(this.#t.getAttribute("min")),this.#v=I(this.#t.getAttribute("max")),this.#w=$a();let t=this.getAttribute("data-disabled-dates");t&&t.split(",").forEach(n=>{let[r,a]=n.trim().split(":");this.#A.set(r,a||null)});let e=this.getAttribute("data-highlight-dates");e&&e.split(",").forEach(n=>{let[r,a]=n.trim().split(":");this.#b.set(r,a||null)}),this.#d=I(this.#t.value),this.#y=this.#t.value;let s=new Date;this.#v&&s>this.#v&&(s=this.#v),this.#g&&s<this.#g&&(s=this.#g),this.#u=this.#d?this.#d.getFullYear():s.getFullYear(),this.#m=this.#d?this.#d.getMonth():s.getMonth(),this.#l=this.#d||s,this.#t.setAttribute("tabindex","-1"),this.#t.setAttribute("aria-hidden","true"),this.#t.style.cssText="position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;overflow:hidden;",this.#P(),this.#N(),this.#T(),this.#H(),this.#I(),this.#f=F,this.#f&&this.#r.setAttribute("popover","manual"),this.listen(document,"click",this.#C),(this.#t.disabled||this.hasAttribute("disabled"))&&(this.setAttribute("data-disabled",""),this.#i.disabled=!0)}teardown(){window.removeEventListener("scroll",this.#M,{capture:!0}),window.removeEventListener("resize",this.#M)}#P(){this.#s=document.createElement("div"),this.#s.className="date-trigger",this.#i=document.createElement("input"),this.#i.type="text",this.#i.className="date-input",this.#i.setAttribute("role","combobox"),this.#i.setAttribute("aria-haspopup","dialog"),this.#i.setAttribute("aria-expanded","false"),this.#i.setAttribute("autocomplete","off"),this.#i.setAttribute("placeholder","Type a date\u2026"),this.#s.appendChild(this.#i),this.#n=document.createElement("button"),this.#n.type="button",this.#n.className="date-trigger-icon",this.#n.setAttribute("aria-label","Toggle calendar"),this.#n.setAttribute("tabindex","-1");let t=document.createElement("icon-wc");t.setAttribute("name","calendar"),t.setAttribute("size","sm"),t.setAttribute("aria-hidden","true"),this.#n.appendChild(t),this.#s.appendChild(this.#n),this.appendChild(this.#s),this.listen(this.#n,"click",e=>{e.stopPropagation(),this.#h?this.#L():this.#q(),this.#i.focus()}),this.listen(this.#i,"focus",()=>this.#i.select()),this.listen(this.#i,"input",this.#B),this.listen(this.#i,"keydown",this.#V),this.listen(this.#i,"blur",this.#E)}#N(){this.#a=`dp-${Math.random().toString(36).slice(2,8)}`,this.#r=document.createElement("div"),this.#r.className="calendar",this.#r.id=this.#a,this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-modal","false"),this.#r.setAttribute("aria-label","Choose date"),this.#r.hidden=!0,this.#i.setAttribute("aria-controls",this.#a);let t=document.createElement("div");t.className="calendar-header";let e=document.createElement("button");e.type="button",e.className="calendar-nav",e.setAttribute("aria-label","Previous month");let s=document.createElement("icon-wc");s.setAttribute("name","chevron-left"),s.setAttribute("size","sm"),s.setAttribute("aria-hidden","true"),e.appendChild(s);let n=document.createElement("span");n.className="calendar-title",n.id=`${this.#a}-title`,n.setAttribute("aria-live","polite"),this.#o=document.createElement("span"),this.#o.className="calendar-month",this.#p=document.createElement("select"),this.#p.className="calendar-year",this.#p.setAttribute("aria-label","Year"),this.#k(),n.appendChild(this.#o),n.appendChild(this.#p);let r=document.createElement("button");r.type="button",r.className="calendar-nav",r.setAttribute("aria-label","Next month");let a=document.createElement("icon-wc");a.setAttribute("name","chevron-right"),a.setAttribute("size","sm"),a.setAttribute("aria-hidden","true"),r.appendChild(a),t.appendChild(e),t.appendChild(n),t.appendChild(r),this.#r.appendChild(t);let o=document.createElement("table");o.setAttribute("role","grid"),o.setAttribute("aria-labelledby",`${this.#a}-title`);let c=document.createElement("thead"),l=document.createElement("tr");for(let h=0;h<7;h++){let d=(this.#w+h)%7,u=document.createElement("th");u.setAttribute("abbr",qa[d]),u.setAttribute("scope","col"),u.textContent=_a[d],l.appendChild(u)}c.appendChild(l),o.appendChild(c),this.#c=document.createElement("tbody"),o.appendChild(this.#c),this.#r.appendChild(o),this.appendChild(this.#r),this.#S(),this.listen(e,"click",()=>this.#O(-1)),this.listen(r,"click",()=>this.#O(1)),this.listen(this.#p,"change",()=>{this.#u=Number(this.#p.value);let h=Wt(this.#u,this.#m),d=Math.min(this.#l.getDate(),h);this.#l=new Date(this.#u,this.#m,d),this.#S()}),this.listen(this.#c,"click",this.#R),this.listen(this.#r,"keydown",this.#z)}#S(){try{this.#o.textContent=new Intl.DateTimeFormat(void 0,{month:"long"}).format(new Date(this.#u,this.#m,1))}catch{this.#o.textContent=We[this.#m].charAt(0).toUpperCase()+We[this.#m].slice(1)}this.#p.querySelector(`option[value="${this.#u}"]`)||this.#k(),this.#p.value=String(this.#u),this.#c.innerHTML="";let t=Wt(this.#u,this.#m),s=(new Date(this.#u,this.#m,1).getDay()-this.#w+7)%7,n=new Date,r=document.createElement("tr");for(let o=0;o<s;o++)r.appendChild(document.createElement("td"));for(let o=1;o<=t;o++){let c=new Date(this.#u,this.#m,o),l=O(c),h=document.createElement("td"),d=document.createElement("button");d.type="button",d.setAttribute("data-date",l),d.textContent=String(o),jt(c,n)&&d.setAttribute("aria-current","date"),jt(c,this.#d)&&d.setAttribute("aria-selected","true");let u=this.#D(c,l);if(u.disabled&&(d.setAttribute("aria-disabled","true"),d.setAttribute("disabled",""),u.reason&&d.setAttribute("data-disabled-reason",u.reason)),this.#b.has(l)){let b=this.#b.get(l);d.setAttribute("data-highlight",b||"")}jt(c,this.#l)?(d.setAttribute("tabindex","0"),jt(c,this.#d)||d.setAttribute("data-focused","")):d.setAttribute("tabindex","-1"),h.appendChild(d),r.appendChild(h),(s+o)%7===0&&(this.#c.appendChild(r),r=document.createElement("tr"))}let a=(s+t)%7;if(a>0){for(let o=a;o<7;o++)r.appendChild(document.createElement("td"));this.#c.appendChild(r)}}#$(t,e){return this.#D(t,e).disabled}#D(t,e){return this.#A.has(e)?{disabled:!0,reason:this.#A.get(e)}:this.#g&&t<this.#g?{disabled:!0,reason:null}:this.#v&&t>this.#v?{disabled:!0,reason:null}:{disabled:!1,reason:null}}#k(){this.#p.innerHTML="";let t=new Date().getFullYear(),e=this.#g?this.#g.getFullYear():t-100,s=this.#v?this.#v.getFullYear():t+10;for(let n=e;n<=s;n++){let r=document.createElement("option");r.value=String(n),r.textContent=String(n),this.#p.appendChild(r)}}#O(t){this.#m+=t,this.#m>11?(this.#m=0,this.#u++):this.#m<0&&(this.#m=11,this.#u--);let e=Wt(this.#u,this.#m),s=Math.min(this.#l.getDate(),e);this.#l=new Date(this.#u,this.#m,s),this.#S(),this.#F(this.#l)}#_(t){let e=O(t);this.#$(t,e)||(this.#d=t,this.#l=t,this.#T(),this.#H(),this.#I(),this.#S(),this.#L(),this.#i.focus(),this.dispatchEvent(new CustomEvent("date-picker:change",{bubbles:!0,detail:{value:e,date:new Date(t)}})))}#F(t){let e=O(t),s=this.#c.querySelector(`[data-date="${e}"]`);s&&(this.#c.querySelectorAll('button[tabindex="0"]').forEach(n=>{n.setAttribute("tabindex","-1")}),s.setAttribute("tabindex","0"),s.focus())}#T(){this.#d?this.#i.value=Oa(this.#d):this.#i.value=""}#q(){if(!this.#h){if(this.#h=!0,this.setAttribute("open",""),this.#i.setAttribute("aria-expanded","true"),this.#r.hidden=!1,this.#u=this.#l.getFullYear(),this.#m=this.#l.getMonth(),this.#S(),this.#f){try{this.#r.showPopover()}catch{}this.#x(),window.addEventListener("scroll",this.#M,{capture:!0,passive:!0}),window.addEventListener("resize",this.#M,{passive:!0})}this.dispatchEvent(new CustomEvent("date-picker:open",{bubbles:!0}))}}#L(){if(this.#h){if(this.#h=!1,this.removeAttribute("open"),this.#i.setAttribute("aria-expanded","false"),this.#r.hidden=!0,this.#f){try{this.#r.hidePopover()}catch{}window.removeEventListener("scroll",this.#M,{capture:!0}),window.removeEventListener("resize",this.#M)}this.dispatchEvent(new CustomEvent("date-picker:close",{bubbles:!0}))}}#x(){if(!this.#f)return;let t=this.#s.getBoundingClientRect(),e=this.#r.getBoundingClientRect(),s=4,n=8,r=window.innerHeight,a=window.innerWidth,o=r-t.bottom-n,c=t.top-n,l;o<e.height&&c>o?(l=t.top-e.height-s,this.#r.dataset.placement="top"):(l=t.bottom+s,delete this.#r.dataset.placement);let h=t.left;h+e.width>a-n&&(h=a-e.width-n),h<n&&(h=n),this.#r.style.setProperty("--calendar-top",`${l}px`),this.#r.style.setProperty("--calendar-left",`${h}px`)}#M=()=>{this.#h&&this.#x()};#B=()=>{let t=this.#i.value,{date:e,partial:s}=Ue(t);if(e)this.#l=e,this.#u=e.getFullYear(),this.#m=e.getMonth(),this.#S();else if(s){this.#u=s.year,this.#m=s.month;let n=Wt(s.year,s.month),r=Math.min(this.#l.getDate(),n);this.#l=new Date(s.year,s.month,r),this.#S()}!this.#h&&t.length>0&&this.#q()};#V=t=>{switch(t.key){case"Enter":{t.preventDefault(),t.stopPropagation();let{date:e}=Ue(this.#i.value);e&&!this.#$(e,O(e))&&this.#_(e);return}case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.#h||this.#q(),requestAnimationFrame(()=>this.#F(this.#l));return;case"Escape":t.preventDefault(),t.stopPropagation(),this.#h&&this.#L(),this.#T();return;case"Tab":this.#h&&this.#L();return}};#E=t=>{if(t.relatedTarget&&this.contains(t.relatedTarget))return;let e=this.#i.value.trim();if(e){let{date:s}=Ue(e);s&&!this.#$(s,O(s))&&(this.#d=s,this.#l=s,this.#H(),this.#I(),this.dispatchEvent(new CustomEvent("date-picker:change",{bubbles:!0,detail:{value:O(s),date:new Date(s)}})))}this.#T(),this.#h&&this.#L(),this.#t.dispatchEvent(new Event("blur",{bubbles:!0}))};#C=t=>{this.#h&&!this.contains(t.target)&&this.#L()};#R=t=>{let e=t.target.closest("button[data-date]");!e||e.hasAttribute("disabled")||this.#_(I(e.getAttribute("data-date")))};#z=t=>{if(t.key==="Tab"){this.#L();return}let e=this.#l,s;switch(t.key){case"ArrowRight":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1);break;case"ArrowLeft":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()-1);break;case"ArrowDown":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()+7);break;case"ArrowUp":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()-7);break;case"PageDown":t.shiftKey?s=new Date(e.getFullYear()+1,e.getMonth(),e.getDate()):s=new Date(e.getFullYear(),e.getMonth()+1,e.getDate());break;case"PageUp":t.shiftKey?s=new Date(e.getFullYear()-1,e.getMonth(),e.getDate()):s=new Date(e.getFullYear(),e.getMonth()-1,e.getDate());break;case"Home":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay()+this.#w);break;case"End":s=new Date(e.getFullYear(),e.getMonth(),e.getDate()+(6-e.getDay()+this.#w));break;case"Enter":case" ":t.preventDefault(),t.stopPropagation(),this.#_(e);return;case"Escape":t.preventDefault(),t.stopPropagation(),this.#L(),this.#i.focus();return;default:return}t.preventDefault(),t.stopPropagation(),s&&(this.#g&&s<this.#g&&(s=this.#g),this.#v&&s>this.#v&&(s=this.#v),this.#l=s,(s.getMonth()!==this.#m||s.getFullYear()!==this.#u)&&(this.#m=s.getMonth(),this.#u=s.getFullYear(),this.#S()),this.#F(s))};#H(){let t=this.#d?O(this.#d):"";this.#e.setFormValue(t||null),this.#t.value=t,this.#t.dispatchEvent(new Event("input",{bubbles:!0}))}#I(){(this.hasAttribute("required")||this.#t.hasAttribute("required"))&&!this.#d?this.#e.setValidity({valueMissing:!0},"Please select a date",this.#i||this):this.#e.setValidity({})}formResetCallback(){this.#d=I(this.#y);let t=new Date;this.#l=this.#d||t,this.#u=this.#l.getFullYear(),this.#m=this.#l.getMonth(),this.#T(),this.#H(),this.#I(),this.#h&&this.#S()}formStateRestoreCallback(t){t&&(this.#d=I(t),this.#d&&(this.#l=this.#d,this.#u=this.#d.getFullYear(),this.#m=this.#d.getMonth(),this.#T(),this.#H(),this.#I()))}get value(){return this.#d?O(this.#d):""}set value(t){let e=I(t);e&&this.#_(e)}get min(){return this.#g?O(this.#g):""}set min(t){this.#g=t?I(t):null,this.#t&&this.#t.setAttribute("min",t||""),this.#S()}get max(){return this.#v?O(this.#v):""}set max(t){this.#v=t?I(t):null,this.#t&&this.#t.setAttribute("max",t||""),this.#S()}};f("date-picker",je);function Yt(i,t,e){t/=100,e/=100;let s=a=>(a+i/30)%12,n=t*Math.min(e,1-e),r=a=>e-n*Math.max(-1,Math.min(s(a)-3,9-s(a),1));return{r:Math.round(r(0)*255),g:Math.round(r(8)*255),b:Math.round(r(4)*255)}}function Ye(i,t,e){i/=255,t/=255,e/=255;let s=Math.max(i,t,e),n=Math.min(i,t,e),r=(s+n)/2,a=0,o=0;if(s!==n){let c=s-n;switch(o=r>.5?c/(2-s-n):c/(s+n),s){case i:a=((t-e)/c+(t<e?6:0))/6;break;case t:a=((e-i)/c+2)/6;break;case e:a=((i-t)/c+4)/6;break}}return{h:Math.round(a*360),s:Math.round(o*100),l:Math.round(r*100)}}function Pa(i){i=i.replace(/^#/,""),i.length===3&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]);let t=parseInt(i,16);return{r:t>>16&255,g:t>>8&255,b:t&255}}function Ba(i,t,e){return"#"+[i,t,e].map(s=>Math.max(0,Math.min(255,Math.round(s))).toString(16).padStart(2,"0")).join("")}function j(i){let{r:t,g:e,b:s}=Pa(i);return Ye(t,e,s)}function Q(i,t,e){let{r:s,g:n,b:r}=Yt(i,t,e);return Ba(s,n,r)}function P(i,t,e){return Math.max(t,Math.min(e,i))}var Ge=class extends m{static formAssociated=!0;#e;#t;#i;#n;#s;#r;#a;#c;#o;#p;#h;#f;#d;#l;#u;#m;#g;#v=!1;#A=!1;#b=0;#y=100;#w=50;#P;constructor(){super(),this.#e=this.attachInternals()}setup(){if(this.#t=this.querySelector(':scope > input[type="color"]'),!this.#t)return!1;let t=this.#t.value||"#000000";this.#P=t;let e=j(t);this.#b=e.h,this.#y=e.s,this.#w=e.l,this.#t.setAttribute("tabindex","-1"),this.#t.setAttribute("aria-hidden","true"),this.#t.style.cssText="position:absolute;opacity:0;pointer-events:none;width:1px;height:1px;overflow:hidden;",this.#N(),this.#S(),this.#C(),this.#U(),this.#A=F,this.#A&&this.#r.setAttribute("popover","manual"),this.listen(document,"click",this.#W),(this.#t.disabled||this.hasAttribute("disabled"))&&this.setAttribute("data-disabled","")}teardown(){window.removeEventListener("scroll",this.#I,{capture:!0}),window.removeEventListener("resize",this.#I)}#N(){this.#i=document.createElement("button"),this.#i.type="button",this.#i.className="color-trigger",this.#i.setAttribute("aria-haspopup","dialog"),this.#i.setAttribute("aria-expanded","false"),this.#n=document.createElement("span"),this.#n.className="color-swatch",this.#s=document.createElement("span"),this.#s.className="color-hex",this.#i.appendChild(this.#n),this.#i.appendChild(this.#s),this.appendChild(this.#i),this.listen(this.#i,"click",()=>{this.#v?this.#z():this.#R()})}#S(){this.#r=document.createElement("div"),this.#r.className="color-panel",this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-label","Color picker"),this.#a=document.createElement("div"),this.#a.className="color-area",this.#a.setAttribute("role","slider"),this.#a.setAttribute("aria-label","Saturation and lightness"),this.#a.setAttribute("tabindex","0"),this.#c=document.createElement("div"),this.#c.className="color-area-thumb",this.#a.appendChild(this.#c),this.#r.appendChild(this.#a);let t=document.createElement("div");t.className="color-hue-wrap",this.#o=document.createElement("div"),this.#o.className="color-hue",this.#o.setAttribute("role","slider"),this.#o.setAttribute("aria-label","Hue"),this.#o.setAttribute("aria-valuemin","0"),this.#o.setAttribute("aria-valuemax","360"),this.#o.setAttribute("tabindex","0"),this.#p=document.createElement("div"),this.#p.className="color-hue-thumb",this.#o.appendChild(this.#p),t.appendChild(this.#o),this.#r.appendChild(t);let e=document.createElement("div");e.className="color-inputs",this.#h=this.#$("Hex","hex",7),this.#f=this.#D("R","r",0,255),this.#d=this.#D("G","g",0,255),this.#l=this.#D("B","b",0,255),e.appendChild(this.#h.wrapper),e.appendChild(this.#f.wrapper),e.appendChild(this.#d.wrapper),e.appendChild(this.#l.wrapper),this.#r.appendChild(e);let s=this.querySelector(":scope > datalist");if(s){this.#u=document.createElement("div"),this.#u.className="color-swatches",this.#u.setAttribute("role","listbox"),this.#u.setAttribute("aria-label","Preset colors");for(let r of s.querySelectorAll("option[value]")){let a=document.createElement("button");a.type="button",a.setAttribute("role","option"),a.style.background=r.value,a.setAttribute("aria-label",r.textContent||r.value),a.setAttribute("data-color",r.value),this.#u.appendChild(a)}this.#r.appendChild(this.#u),this.listen(this.#u,"click",this.#M)}let n=document.createElement("div");n.className="color-actions","EyeDropper"in window&&(this.#m=document.createElement("button"),this.#m.type="button",this.#m.className="color-eyedropper",this.#m.setAttribute("aria-label","Pick color from screen"),this.#m.textContent="\u{1F4A7}",n.appendChild(this.#m),this.listen(this.#m,"click",this.#B)),this.#g=document.createElement("button"),this.#g.type="button",this.#g.className="color-copy",this.#g.setAttribute("aria-label","Copy hex value"),this.#g.textContent="Copy",n.appendChild(this.#g),this.listen(this.#g,"click",this.#V),this.#r.appendChild(n),this.appendChild(this.#r),this.listen(this.#a,"pointerdown",this.#k),this.listen(this.#a,"keydown",this.#_),this.listen(this.#o,"pointerdown",this.#F),this.listen(this.#o,"keydown",this.#q),this.listen(this.#h.input,"change",this.#L),this.listen(this.#f.input,"change",this.#x),this.listen(this.#d.input,"change",this.#x),this.listen(this.#l.input,"change",this.#x)}#$(t,e,s){let n=document.createElement("label");n.className="color-input-label";let r=document.createElement("span");r.textContent=t;let a=document.createElement("input");return a.type="text",a.setAttribute("data-channel",e),a.setAttribute("maxlength",String(s)),a.setAttribute("spellcheck","false"),a.setAttribute("autocomplete","off"),n.appendChild(r),n.appendChild(a),{wrapper:n,input:a}}#D(t,e,s,n){let r=document.createElement("label");r.className="color-input-label";let a=document.createElement("span");a.textContent=t;let o=document.createElement("input");return o.type="number",o.setAttribute("data-channel",e),o.min=String(s),o.max=String(n),r.appendChild(a),r.appendChild(o),{wrapper:r,input:o}}#k=t=>{t.preventDefault(),this.#a.setPointerCapture(t.pointerId),this.#O(t);let e=n=>this.#O(n),s=n=>{this.#a.releasePointerCapture(n.pointerId),this.#a.removeEventListener("pointermove",e),this.#a.removeEventListener("pointerup",s)};this.#a.addEventListener("pointermove",e),this.#a.addEventListener("pointerup",s)};#O(t){let e=this.#a.getBoundingClientRect(),s=P((t.clientX-e.left)/e.width,0,1),n=P((t.clientY-e.top)/e.height,0,1);this.#y=Math.round(s*100),this.#w=Math.round((1-n)*100),this.#E()}#_=t=>{let e=t.shiftKey?10:1;switch(t.key){case"ArrowRight":t.preventDefault(),this.#y=P(this.#y+e,0,100);break;case"ArrowLeft":t.preventDefault(),this.#y=P(this.#y-e,0,100);break;case"ArrowUp":t.preventDefault(),this.#w=P(this.#w+e,0,100);break;case"ArrowDown":t.preventDefault(),this.#w=P(this.#w-e,0,100);break;default:return}this.#E()};#F=t=>{t.preventDefault(),this.#o.setPointerCapture(t.pointerId),this.#T(t);let e=n=>this.#T(n),s=n=>{this.#o.releasePointerCapture(n.pointerId),this.#o.removeEventListener("pointermove",e),this.#o.removeEventListener("pointerup",s)};this.#o.addEventListener("pointermove",e),this.#o.addEventListener("pointerup",s)};#T(t){let e=this.#o.getBoundingClientRect(),s=P((t.clientX-e.left)/e.width,0,1);this.#b=Math.round(s*360),this.#E()}#q=t=>{let e=t.shiftKey?10:1;switch(t.key){case"ArrowRight":case"ArrowUp":t.preventDefault(),this.#b=(this.#b+e)%361;break;case"ArrowLeft":case"ArrowDown":t.preventDefault(),this.#b=(this.#b-e+361)%361;break;default:return}this.#E()};#L=()=>{let t=this.#h.input.value.trim();if(t.startsWith("#")||(t="#"+t),/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)){let e=j(t);this.#b=e.h,this.#y=e.s,this.#w=e.l,this.#E()}};#x=()=>{let t=P(Number(this.#f.input.value)||0,0,255),e=P(Number(this.#d.input.value)||0,0,255),s=P(Number(this.#l.input.value)||0,0,255),n=Ye(t,e,s);this.#b=n.h,this.#y=n.s,this.#w=n.l,this.#E()};#M=t=>{let e=t.target.closest("button[data-color]");if(!e)return;let s=e.getAttribute("data-color"),n=j(s);this.#b=n.h,this.#y=n.s,this.#w=n.l,this.#E()};#B=async()=>{try{let e=await new EyeDropper().open(),s=j(e.sRGBHex);this.#b=s.h,this.#y=s.s,this.#w=s.l,this.#E()}catch{}};#V=async()=>{let t=Q(this.#b,this.#y,this.#w);try{await navigator.clipboard.writeText(t),this.#g.textContent="Copied!",setTimeout(()=>{this.#g.textContent="Copy"},1500)}catch{}};#E(){this.#C(),this.#U();let t=Q(this.#b,this.#y,this.#w),e=Yt(this.#b,this.#y,this.#w);this.dispatchEvent(new CustomEvent("color-picker:change",{bubbles:!0,detail:{hex:t,rgb:{r:e.r,g:e.g,b:e.b},hsl:{h:this.#b,s:this.#y,l:this.#w}}}))}#C(){let t=Q(this.#b,this.#y,this.#w),e=Yt(this.#b,this.#y,this.#w),s=Q(this.#b,100,50);this.#n.style.background=t,this.#s.textContent=t,this.#a.style.setProperty("--area-hue",s),this.#c.style.insetInlineStart=`${this.#y}%`,this.#c.style.insetBlockStart=`${100-this.#w}%`,this.#c.style.background=t,this.#a.setAttribute("aria-valuetext",`Saturation ${this.#y}%, Lightness ${this.#w}%`),this.#p.style.insetInlineStart=`${this.#b/360*100}%`,this.#o.setAttribute("aria-valuenow",String(this.#b)),this.#o.setAttribute("aria-valuetext",`Hue ${this.#b}\xB0`),this.#h.input.value=t,this.#f.input.value=String(e.r),this.#d.input.value=String(e.g),this.#l.input.value=String(e.b)}#R(){if(!this.#v){if(this.#v=!0,this.setAttribute("open",""),this.#i.setAttribute("aria-expanded","true"),this.#A){this.#H();try{this.#r.showPopover()}catch{}window.addEventListener("scroll",this.#I,{capture:!0,passive:!0}),window.addEventListener("resize",this.#I,{passive:!0})}requestAnimationFrame(()=>this.#a.focus()),this.dispatchEvent(new CustomEvent("color-picker:open",{bubbles:!0}))}}#z(){if(this.#v){if(this.#v=!1,this.removeAttribute("open"),this.#i.setAttribute("aria-expanded","false"),this.#A){try{this.#r.hidePopover()}catch{}window.removeEventListener("scroll",this.#I,{capture:!0}),window.removeEventListener("resize",this.#I)}this.dispatchEvent(new CustomEvent("color-picker:close",{bubbles:!0}))}}#H(){if(!this.#A)return;let t=this.#i.getBoundingClientRect();this.#r.style.setProperty("--panel-top",`${t.bottom+4}px`),this.#r.style.setProperty("--panel-left",`${t.left}px`)}#I=()=>{this.#v&&this.#H()};#W=t=>{this.#v&&!this.contains(t.target)&&this.#z()};#U(){let t=Q(this.#b,this.#y,this.#w);this.#e.setFormValue(t),this.#t.value=t,this.#t.dispatchEvent(new Event("input",{bubbles:!0}))}formResetCallback(){let t=j(this.#P);this.#b=t.h,this.#y=t.s,this.#w=t.l,this.#C(),this.#U()}formStateRestoreCallback(t){if(!t)return;let e=j(t);this.#b=e.h,this.#y=e.s,this.#w=e.l,this.#C(),this.#U()}get value(){return Q(this.#b,this.#y,this.#w)}set value(t){if(!/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t))return;let e=j(t);this.#b=e.h,this.#y=e.s,this.#w=e.l,this.#E()}};f("color-picker",Ge);var Ke=class extends m{#e;#t;#i=[];#n=-1;#s=!1;#r=[];#a=!1;setup(){if(this.#e=this.querySelector(":scope > [data-trigger]"),this.#t=this.querySelector(':scope > menu, :scope > ul[role="menu"]'),!this.#e||!this.#t)return!1;this.#a=F,this.#a&&this.#t.setAttribute("popover","auto"),this.#e?.setAttribute("aria-expanded","false"),this.#t.setAttribute("role","menu"),this.#t.id||(this.#t.id=`ctx-menu-${crypto.randomUUID().slice(0,8)}`),this.#t.querySelectorAll(":scope > li[data-group]").forEach(t=>{t.setAttribute("role","presentation"),t.classList.add("ctx-group-label")}),this.#i=Array.from(this.#t.querySelectorAll('button, a, [role="menuitem"]')).filter(t=>!t.disabled&&!t.hasAttribute("data-disabled")),this.#i.forEach(t=>{t.setAttribute("role","menuitem"),t.setAttribute("tabindex","-1"),t.style.cssText+=";border:none;box-shadow:none;transform:none;border-radius:0;",this.listen(t,"click",this.#h);let e=t.getAttribute("data-shortcut");if(e){let s=document.createElement("kbd");s.className="ctx-kbd",s.textContent=Gs(e),t.appendChild(s);let n=Ht(e,()=>t.click());this.#r.push(n)}}),this.#t.querySelectorAll('li:empty:not([data-group]), [role="separator"], hr').forEach(t=>{t.setAttribute("role","separator")}),this.listen(this.#e,"contextmenu",this.#c),this.listen(this.#t,"keydown",this.#p),this.listen(window,"scroll",this.#m,{capture:!0}),this.#a?this.listen(this.#t,"toggle",this.#u):(this.listen(document,"click",this.#f),this.listen(document,"contextmenu",this.#d),this.listen(document,"keydown",this.#l))}teardown(){this.#r.forEach(t=>t()),this.#r=[]}#c=t=>{t.preventDefault(),this.#o(t.clientX,t.clientY)};#o(t,e){if(this.#s=!0,this.setAttribute("data-open",""),this.#e?.setAttribute("aria-expanded","true"),this.#t.style.setProperty("--ctx-top",`${e}px`),this.#t.style.setProperty("--ctx-left",`${t}px`),this.#a)try{this.#t.showPopover()}catch{}requestAnimationFrame(()=>{let s=this.#t.getBoundingClientRect(),n=t+s.width>window.innerWidth?t-s.width:t,r=e+s.height>window.innerHeight?e-s.height:e;this.#t.style.setProperty("--ctx-top",`${Math.max(0,r)}px`),this.#t.style.setProperty("--ctx-left",`${Math.max(0,n)}px`)}),this.#n=-1,this.#g(0),this.dispatchEvent(new CustomEvent("context-menu:open",{bubbles:!0}))}close(){if(this.#s){if(this.#s=!1,this.removeAttribute("data-open"),this.#e?.setAttribute("aria-expanded","false"),this.#n=-1,this.#a)try{this.#t.hidePopover()}catch{}this.dispatchEvent(new CustomEvent("context-menu:close",{bubbles:!0}))}}#p=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.#g(this.#n+1);break;case"ArrowUp":case"Up":t.preventDefault(),this.#g(this.#n-1);break;case"Home":t.preventDefault(),this.#g(0);break;case"End":t.preventDefault(),this.#g(this.#i.length-1);break;case"Enter":case" ":t.preventDefault(),this.#n>=0&&this.#i[this.#n].click();break;case"Tab":this.close();break}};#h=()=>{this.close(),this.dispatchEvent(new CustomEvent("context-menu:select",{bubbles:!0,detail:{item:this.#i[this.#n]}}))};#f=t=>{this.#s&&!this.#t.contains(t.target)&&this.close()};#d=t=>{this.#s&&!this.#e.contains(t.target)&&this.close()};#l=t=>{t.key==="Escape"&&this.#s&&(t.preventDefault(),this.close())};#u=t=>{t.newState==="closed"&&this.#s&&(this.#s=!1,this.removeAttribute("data-open"),this.#n=-1,this.dispatchEvent(new CustomEvent("context-menu:close",{bubbles:!0})))};#m=()=>{this.#s&&this.close()};#g(t){this.#i.length!==0&&(t<0&&(t=this.#i.length-1),t>=this.#i.length&&(t=0),this.#n=t,this.#i[t].focus())}get isOpen(){return this.#s}};f("context-menu",Ke);var Xe=class extends m{#e;#t;#i=null;#n=!1;setup(){if(this.#n)return;let t=this.getAttribute("src");if(!t)return!1;this.#i===null&&(this.#i=this.innerHTML),this.hasAttribute("lazy")?this.#r():this.#a(t)}teardown(){this.#e?.disconnect(),this.#t?.abort()}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e,s){t==="src"&&s&&e!==s&&this.isConnected&&(this.hasAttribute("lazy")&&!this.#s()?this.#r():this.#a(s))}#s(){let t=this.getBoundingClientRect();return t.top<window.innerHeight+200&&t.bottom>-200}#r(){this.#e?.disconnect(),this.#e=new IntersectionObserver(t=>{for(let e of t)if(e.isIntersecting){this.#e.disconnect();let s=this.getAttribute("src");s&&this.#a(s)}},{rootMargin:"200px"}),this.#e.observe(this)}async#a(t){this.#t?.abort(),this.#t=new AbortController,this.setAttribute("data-loading",""),this.removeAttribute("data-loaded"),this.removeAttribute("data-error");try{let e=await fetch(t,{signal:this.#t.signal});if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);let s=await e.text(),n=this.getAttribute("mode")||"replace";n==="replace"?this.innerHTML=s:n==="append"?this.insertAdjacentHTML("beforeend",s):n==="prepend"&&this.insertAdjacentHTML("afterbegin",s),this.hasAttribute("allow-scripts")?this.querySelectorAll("script").forEach(r=>{let a=document.createElement("script");for(let o of r.attributes)a.setAttribute(o.name,o.value);a.textContent=r.textContent,r.replaceWith(a)}):this.querySelectorAll("script").forEach(r=>r.remove()),this.removeAttribute("data-loading"),this.setAttribute("data-loaded",""),this.#n=!0,this.dispatchEvent(new CustomEvent("include-file:loaded",{bubbles:!0,detail:{src:t,html:s}}))}catch(e){if(e.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),(this.getAttribute("mode")||"replace")==="replace"&&this.#i!==null&&!this.#n&&(this.innerHTML=this.#i),this.dispatchEvent(new CustomEvent("include-file:error",{bubbles:!0,detail:{src:t,error:e.message}}))}}reload(){let t=this.getAttribute("src");t&&this.#a(t)}};f("include-file",Xe);W();var pn="environment",fn="preferences",Je={timeOfDay:!1,seasonal:!1},Fa=900*1e3,Y={...Je};function tt(i,t,e){return i+(t-i)*Math.min(1,Math.max(0,e))}var Ct={_timer:null,_baseHues:null,_timeOverride:null,_monthOverride:null,async init(){let i=await w.get(pn,fn);Y=i?{...Je,...i}:{...Je},(Y.timeOfDay||Y.seasonal)&&(this._captureBaseHues(),this._update(),this._startLoop()),window.addEventListener("vb:theme-change",()=>{this._hasActiveSource()&&requestAnimationFrame(()=>{this._captureBaseHues(),this._update()})})},load(){return{...Y}},save(i){return Y={...Y,...i},w.set(pn,fn,Y).catch(()=>{}),{...Y}},setTimeOverride(i){this._timeOverride=i,this._hasActiveSource()&&this._update()},setMonthOverride(i){this._monthOverride=i,this._hasActiveSource()&&this._update()},setSource(i,t){let e=this.save({[i]:t});t?(this._captureBaseHues(),this._update(),this._startLoop()):this._hasActiveSource(e)?this._update():(this._clearModifiers(),this._stopLoop())},_hasActiveSource(i){let t=i||this.load();return t.timeOfDay||t.seasonal},_captureBaseHues(){let i=document.documentElement;i.style.removeProperty("--hue-primary"),i.style.removeProperty("--hue-secondary"),i.style.removeProperty("--hue-accent");let t=i.getAttribute("data-theme");if(t){let e=`[data-theme~="${t}"]`;for(let s of document.styleSheets)try{for(let n=0;n<s.cssRules.length;n++){let r=s.cssRules[n];if(r.selectorText?.includes(e)&&!r.selectorText.includes("dark")){let a=r.style?.getPropertyValue("--hue-primary");if(a){this._baseHues={primary:parseFloat(a)||260,secondary:parseFloat(r.style.getPropertyValue("--hue-secondary"))||200,accent:parseFloat(r.style.getPropertyValue("--hue-accent"))||30};return}}}}catch{}}this._baseHues={primary:260,secondary:200,accent:30}},_update(){let i=this.load(),t=0;i.timeOfDay&&(t+=this._getTimeOfDayOffset()),i.seasonal&&(t+=this._getSeasonalOffset());let e=document.documentElement;t!==0&&this._baseHues?(e.style.setProperty("--hue-primary",String(this._baseHues.primary+t)),e.style.setProperty("--hue-secondary",String(this._baseHues.secondary+t)),e.style.setProperty("--hue-accent",String(this._baseHues.accent+t*.5))):t===0&&this._clearModifiers()},_clearModifiers(){let i=document.documentElement;i.style.removeProperty("--hue-primary"),i.style.removeProperty("--hue-secondary"),i.style.removeProperty("--hue-accent")},_getTimeOfDayOffset(){let i=this._timeOverride??new Date().getHours()+new Date().getMinutes()/60;return i<5?-20:i<7?tt(-20,20,(i-5)/2):i<10?tt(20,5,(i-7)/3):i<14?tt(5,0,(i-10)/4):i<17?tt(0,-5,(i-14)/3):i<19?tt(-5,15,(i-17)/2):i<21?tt(15,-10,(i-19)/2):tt(-10,-20,(i-21)/8)},_getHemisphere(){return window.__VB_ENV_LOCATION?.hemisphere||"north"},_getSeasonalOffset(){let i=this._monthOverride??new Date().getMonth(),e=this._getHemisphere()==="south"?(i+6)%12:i;return e>=2&&e<=4?5:e>=5&&e<=7?10:e>=8&&e<=10?-5:-10},_startLoop(){this._timer||(this._timer=setInterval(()=>this._update(),Fa))},_stopLoop(){this._timer&&clearInterval(this._timer),this._timer=null}};var Gt=null;function bn(){return"0.1.3-9ee452f2"}function Ra(){let i=document.querySelectorAll('script[src*="vanilla-breeze"]'),t="/cdn/sw.js";for(let e of i){let s=e.getAttribute("src");if(s){let n=s.lastIndexOf("/");if(n!==-1){t=s.slice(0,n)+"/sw.js";break}}}return t}function gn(){return Gt||(Gt=navigator.serviceWorker?.ready??Promise.reject(new Error("SW not supported"))),Gt}function yn(i){return new Promise((t,e)=>{navigator.serviceWorker?.controller?mn(navigator.serviceWorker.controller,i,t,e):gn().then(s=>{let n=s.active||s.waiting||s.installing;n?mn(n,i,t,e):e(new Error("No active service worker"))}).catch(e)})}function mn(i,t,e,s){let n=new MessageChannel;n.port1.onmessage=r=>e(r.data),n.port1.onmessageerror=()=>s(new Error("Message error")),i.postMessage({type:t},[n.port2]),setTimeout(()=>s(new Error("SW message timeout")),5e3)}async function vn(){return yn("GET_STATUS")}async function wn(){return yn("CLEAR_CACHE")}async function En(){let i=await gn();return await i.update(),{updated:!!i.waiting}}function Ha(){return typeof window>"u"||!("serviceWorker"in navigator)?!1:window.__VB_SERVICE_WORKER?!0:document.querySelector('meta[name="vb-service-worker"]')?.content==="true"}if(Ha()){let i=Ra();window.addEventListener("load",()=>{Gt=navigator.serviceWorker.register(i).catch(t=>{console.warn("[VB] Service worker registration failed:",t)})})}W();var ut=null,G="settings",Jt={motionFx:!0,sounds:!1},ii=class extends m{#e=null;#t=null;#i=!1;#n=[];#s={...Jt};#r=!1;async setup(){await this.#a(),this.#v(),this.#b(),this.#C(),this.listen(window,"vb:theme-change",this.#E),this.listen(window,"vb:extensions-change",this.#E),this.listen(window,"vb:a11y-themes-change",this.#E)}teardown(){}async#a(){let[t,e,s]=await Promise.all([w.get(G,"a11y"),w.get(G,"extensions"),w.get(G,"sticky")]);this.#n=Array.isArray(t)?t:[],this.#s={...Jt,...e??{}},this.#r=s==="on"}#c(t){return t!==""&&t!==void 0}#o(t){return t==="compact"?"compact":t==="spacious"?"spacious":"default"}#p(t,e){return t?e==="compact"?"compact":e==="spacious"?"spacious":"default":""}#h(){return this.#r}#f(t){return t!==""&&t!==void 0}#d(t){return t==="flush"?"flush":t==="elevated"?"elevated":"default"}#l(t,e){return t?e==="flush"?"flush":e==="elevated"?"elevated":"default":""}#u(t){if(!t)return"card";let e=t.split(/\s+/);for(let s of e)if(s==="stretch"||s==="integrated")return s;return"card"}#m(t){return t?t.split(/\s+/).includes("fixed"):!1}#g(t,e){let s=[];return t&&t!=="card"&&s.push(t),e&&s.push("fixed"),s.join(" ")||"card"}#v(){this.#e=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#e||(this.#e=document.createElement("button"),this.#e.setAttribute("data-trigger",""),this.#e.setAttribute("aria-label","Site settings"),this.#e.className="settings-trigger",this.#e.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>',this.prepend(this.#e)),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.#t=document.createElement("div"),this.#t.className="settings-panel",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label","Site settings");let t=`settings-panel-${crypto.randomUUID().slice(0,8)}`;this.#t.id=t,this.#e.setAttribute("aria-controls",t),this.#t.innerHTML=this.#A(),this.appendChild(this.#t)}#A(){let{mode:t,brand:e,fluid:s,backdrop:n,backdropChrome:r,pageBgType:a,pageBgColor:o,pageBgGradStart:c,pageBgGradEnd:l,pageBgGradDir:h}=S.getState(),d=this.#I(),u=this.#Y(),b=this.#c(s),y=this.#o(s),p=this.#f(n),E=this.#d(n);return`
|
|
122
122
|
<header class="settings-header">
|
|
123
123
|
<strong>Settings</strong>
|
|
124
124
|
<button type="button" class="settings-close" aria-label="Close settings">
|
|
@@ -144,7 +144,7 @@ svg {
|
|
|
144
144
|
|
|
145
145
|
<label class="settings-label" for="settings-theme">Theme</label>
|
|
146
146
|
<select id="settings-theme" name="settings-theme">
|
|
147
|
-
${
|
|
147
|
+
${Rs.map(v=>`
|
|
148
148
|
<optgroup label="${v.label}">
|
|
149
149
|
${v.themes.map(T=>`
|
|
150
150
|
<option value="${T.id}" ${e===T.id?"selected":""}>${T.name}</option>
|
|
@@ -298,7 +298,7 @@ svg {
|
|
|
298
298
|
<details name="settings">
|
|
299
299
|
<summary>System</summary>
|
|
300
300
|
<div class="settings-section system-info">
|
|
301
|
-
<p class="system-version">Vanilla Breeze <code>v${
|
|
301
|
+
<p class="system-version">Vanilla Breeze <code>v${bn()}</code></p>
|
|
302
302
|
<p class="system-sw-status" data-sw-status>Service Worker: <span>checking\u2026</span></p>
|
|
303
303
|
<footer class="system-actions">
|
|
304
304
|
<button type="button" data-action="clear-cache">Clear Cache</button>
|
|
@@ -311,7 +311,7 @@ svg {
|
|
|
311
311
|
<footer class="settings-footer">
|
|
312
312
|
<button type="button" class="settings-reset">Reset to Defaults</button>
|
|
313
313
|
</footer>
|
|
314
|
-
`}#b(){this.#e.addEventListener("click",this.#y),this.listen(document,"click",this.#w),this.listen(document,"keydown",this.#B),this.#t.querySelector(".settings-close")?.addEventListener("click",()=>this.close()),this.#t.querySelectorAll('input[name="settings-mode"]').forEach(t=>{t.addEventListener("change",this.#N)}),this.#t.querySelector("#settings-theme")?.addEventListener("change",this.#S),this.#t.querySelector("input[data-fluid-toggle]")?.addEventListener("change",this.#$),this.#t.querySelectorAll('input[name="settings-density"]').forEach(t=>{t.addEventListener("change",this.#D)}),this.#t.querySelector("input[data-backdrop-toggle]")?.addEventListener("change",this.#k),this.#t.querySelectorAll('input[name="settings-backdrop"]').forEach(t=>{t.addEventListener("change",this.#I)}),this.#t.querySelectorAll('input[name="settings-backdrop-chrome"]').forEach(t=>{t.addEventListener("change",this.#_)}),this.#t.querySelector("input[data-backdrop-fixed]")?.addEventListener("change",this.#F),this.#t.querySelector("input[data-sticky-toggle]")?.addEventListener("change",this.#T),this.#t.querySelector('[name="settings-page-bg"]')?.addEventListener("change",this.#q),this.#t.querySelector('[name="settings-page-bg-color"]')?.addEventListener("input",this.#L),this.#t.querySelector('[name="settings-page-bg-grad-start"]')?.addEventListener("input",this.#L),this.#t.querySelector('[name="settings-page-bg-grad-end"]')?.addEventListener("input",this.#L),this.#t.querySelector('[name="settings-page-bg-grad-dir"]')?.addEventListener("change",this.#L),this.#t.querySelectorAll("input[data-a11y]").forEach(t=>{t.addEventListener("change",this.#x)}),this.#t.querySelectorAll("input[data-ext]").forEach(t=>{t.addEventListener("change",this.#M)}),this.#t.querySelectorAll("input[data-env]").forEach(t=>{t.addEventListener("change",this.#P)}),this.#t.querySelector(".settings-reset")?.addEventListener("click",this.#V),this.#t.querySelector('[data-action="clear-cache"]')?.addEventListener("click",this.#Z),this.#t.querySelector('[data-action="check-update"]')?.addEventListener("click",this.#Q),this.#K()}#y=t=>{t.stopPropagation(),this.toggle()};#w=t=>{this.#i&&!this.contains(t.target)&&this.close()};#B=t=>{t.key==="Escape"&&this.#i&&(t.preventDefault(),this.close(),this.#e?.focus())};#N=t=>{S.setMode(t.target.value)};#S=async t=>{let e=t.target;e.disabled=!0;try{await S.setBrand(e.value),this.#X()}catch{console.warn("[VB] Theme load failed, using default")}finally{e.disabled=!1}};#$=t=>{let e=t.target.checked,s=this.#o(S.getState().fluid)||"default";S.setFluid(this.#p(e,s)),this.#R(e)};#D=t=>{S.setFluid(this.#p(!0,t.target.value))};#k=t=>{let e=t.target.checked,s=this.#d(S.getState().backdrop)||"default";S.setBackdrop(this.#l(e,s)),this.#z(e)};#I=t=>{S.setBackdrop(this.#l(!0,t.target.value))};#_=t=>{let e=this.#m(S.getState().backdropChrome);S.setBackdropChrome(this.#g(t.target.value,e))};#F=t=>{let e=this.#u(S.getState().backdropChrome);S.setBackdropChrome(this.#g(e,t.target.checked))};#T=async t=>{let e=t.target.checked;this.#r=e,await w.set(G,"sticky",e?"on":"off");let s=document.querySelector("header");if(e){document.documentElement.dataset.sticky="",s&&(s.dataset.sticky="");let{initStickyManager:n}=await Promise.resolve().then(()=>(kt(),Xt));n()}else{delete document.documentElement.dataset.sticky,s&&delete s.dataset.sticky;let{destroyStickyManager:n}=await Promise.resolve().then(()=>(kt(),Xt));n()}};#q=t=>{let e=t.target.value;if(this.#H(e),e==="color"){let s=this.#t.querySelector('[name="settings-page-bg-color"]')?.value||"#1a1a2e";S.setPageBg({type:e,color:s})}else if(e==="gradient"){let s=this.#t.querySelector('[name="settings-page-bg-grad-start"]')?.value||"#1a1a2e",n=this.#t.querySelector('[name="settings-page-bg-grad-end"]')?.value||"#16213e",r=this.#t.querySelector('[name="settings-page-bg-grad-dir"]')?.value||"to bottom";S.setPageBg({type:e,gradStart:s,gradEnd:n,gradDir:r})}else S.setPageBg({})};#L=()=>{let t=this.#t.querySelector('[name="settings-page-bg"]')?.value||"";if(t==="color"){let e=this.#t.querySelector('[name="settings-page-bg-color"]')?.value||"";S.setPageBg({type:t,color:e})}else if(t==="gradient"){let e=this.#t.querySelector('[name="settings-page-bg-grad-start"]')?.value||"",s=this.#t.querySelector('[name="settings-page-bg-grad-end"]')?.value||"",n=this.#t.querySelector('[name="settings-page-bg-grad-dir"]')?.value||"to bottom";S.setPageBg({type:t,gradStart:e,gradEnd:s,gradDir:n})}};#x=t=>{let e=t.target.dataset.a11y,s=this.#O();if(t.target.checked&&!s.includes(e))s.push(e);else if(!t.target.checked){let n=s.indexOf(e);n!==-1&&s.splice(n,1)}this.#W(s),this.#U(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:s}))};#M=t=>{let e=t.target.dataset.ext,s=t.target.checked;this.#J(e,s),this.#G()};#P=t=>{let e=t.target.dataset.env,s=t.target.checked;Ct.setSource(e,s)};#V=()=>{confirm("Reset all settings to defaults?")&&(S.reset(),this.#W([]),this.#U(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:[]})),this.#s={...Jt},w.remove(G,"extensions").catch(()=>{}),this.#G(),this.#r=!1,w.remove(G,"sticky").catch(()=>{}),delete document.documentElement.dataset.sticky,Promise.resolve().then(()=>(kt(),Xt)).then(t=>t.destroyStickyManager()).catch(()=>{}),Ct.setSource("timeOfDay",!1),Ct.setSource("seasonal",!1),this.#C())};#E=()=>{this.#C()};#C(){let{mode:t,brand:e,fluid:s,backdrop:n,backdropChrome:r,pageBgType:a,pageBgColor:o,pageBgGradStart:c,pageBgGradEnd:l,pageBgGradDir:h}=S.getState(),d=this.#O(),u=this.#Y(),b=this.#c(s),y=this.#o(s),p=this.#f(n),E=this.#d(n),v=this.#t.querySelector(`input[name="settings-mode"][value="${t}"]`);v&&(v.checked=!0);let T=this.#t.querySelector("#settings-theme");T&&(T.value=e||"default");let q=this.#t.querySelector("input[data-fluid-toggle]");q&&(q.checked=b);let Bt=this.#t.querySelector(`input[name="settings-density"][value="${y}"]`);Bt&&(Bt.checked=!0),this.#R(b);let Ss=this.#t.querySelector("input[data-backdrop-toggle]");Ss&&(Ss.checked=p);let Cs=this.#t.querySelector(`input[name="settings-backdrop"][value="${E}"]`);Cs&&(Cs.checked=!0);let ta=this.#u(r),ks=this.#t.querySelector(`input[name="settings-backdrop-chrome"][value="${ta}"]`);ks&&(ks.checked=!0);let xs=this.#t.querySelector("input[data-backdrop-fixed]");xs&&(xs.checked=this.#m(r)),this.#z(p);let Ts=this.#t.querySelector('[name="settings-page-bg"]');Ts&&(Ts.value=a||"");let Ls=this.#t.querySelector('[name="settings-page-bg-color"]');Ls&&o&&(Ls.value=o);let Ms=this.#t.querySelector('[name="settings-page-bg-grad-start"]');Ms&&c&&(Ms.value=c);let Ns=this.#t.querySelector('[name="settings-page-bg-grad-end"]');Ns&&l&&(Ns.value=l);let Ds=this.#t.querySelector('[name="settings-page-bg-grad-dir"]');Ds&&h&&(Ds.value=h),p&&this.#H(a||""),this.#t.querySelectorAll("input[data-a11y]").forEach(mt=>{let U=mt;U.checked=d.includes(U.dataset.a11y)}),this.#t.querySelectorAll("input[data-ext]").forEach(mt=>{let U=mt,Pt=U.dataset.ext,ia=u[Pt];U.checked=ia??Jt[Pt]});let _s=this.#t.querySelector("input[data-sticky-toggle]");_s&&(_s.checked=this.#h());let ea=this.#j();this.#t.querySelectorAll("input[data-env]").forEach(mt=>{let U=mt,Pt=U.dataset.env;U.checked=ea[Pt]??!1})}#R(t){let e=this.#t.querySelector(".density-row");e&&(e.hidden=!t)}#z(t){if(this.#t.querySelectorAll(".backdrop-row").forEach(e=>{e.hidden=!t}),t){let e=this.#t.querySelector('[name="settings-page-bg"]')?.value||"";this.#H(e)}}#H(t){let e=this.#t.querySelector(".page-bg-color-row"),s=this.#t.querySelector(".page-bg-grad-row"),n=this.#t.querySelector(".page-bg-grad-dir-row");e&&(e.hidden=t!=="color"),s&&(s.hidden=t!=="gradient"),n&&(n.hidden=t!=="gradient")}#O(){return[...this.#n]}#W(t){this.#n=[...t],w.set(G,"a11y",this.#n).catch(()=>{})}#U(){let t=this.#O(),{brand:e}=S.getState(),s=document.documentElement,n=e!=="default"?[e,...t]:[...t];n.length?s.dataset.theme=n.join(" "):delete s.dataset.theme}#X(){this.#U()}#j(){return Ct.load()}#Y(){return{...this.#s}}#J(t,e){this.#s={...this.#s,[t]:e},w.set(G,"extensions",this.#s).catch(()=>{})}async#G(){let t=this.#Y(),e=document.documentElement;t.motionFx?delete e.dataset.motionReduced:e.dataset.motionReduced="",t.sounds?(ut||(ut=(await Promise.resolve().then(()=>(Cn(),Sn))).SoundManager),ut.init(),ut.enable()):ut&&ut.disable(),window.dispatchEvent(new CustomEvent("vb:extensions-change",{detail:t}))}async#K(){let t=this.#t.querySelector("[data-sw-status] span");if(t){if(!("serviceWorker"in navigator)){t.textContent="Not supported";return}try{let s=(await yn()).cachedURLs?.length??0;t.textContent=`Active (${s} cached files)`}catch{t.textContent="Not registered"}}}#Z=async t=>{let e=t.target;e.disabled=!0,e.textContent="Clearing\u2026";try{await vn(),e.textContent="Cleared!",this.#K(),setTimeout(()=>{e.textContent="Clear Cache",e.disabled=!1},2e3)}catch{e.textContent="Failed",setTimeout(()=>{e.textContent="Clear Cache",e.disabled=!1},2e3)}};#Q=async t=>{let e=t.target;e.disabled=!0,e.textContent="Checking\u2026";try{let{updated:s}=await wn();e.textContent=s?"Update available!":"Up to date",setTimeout(()=>{e.textContent="Check for Updates",e.disabled=!1},2e3)}catch{e.textContent="Failed",setTimeout(()=>{e.textContent="Check for Updates",e.disabled=!1},2e3)}};open(){this.#i||(this.#i=!0,this.setAttribute("open",""),this.#e?.setAttribute("aria-expanded","true"),this.#C(),this.#tt())}#tt(){let t=this.getBoundingClientRect(),e=this.#t;e.style.removeProperty("top"),e.style.removeProperty("bottom"),e.style.removeProperty("left"),e.style.removeProperty("right");let s=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,a=t.top,o=r-t.bottom;a<s.height&&o>a?(e.style.top="calc(100% + 8px)",e.style.bottom="auto"):(e.style.bottom="calc(100% + 8px)",e.style.top="auto");let c=n-t.right,l=t.left,h=s.width;t.right<h&&l<c?(e.style.left="0",e.style.right="auto"):(e.style.right="0",e.style.left="auto")}close(){this.#i&&(this.#i=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"))}toggle(){this.#i?this.close():this.open()}};f("settings-panel",ii);W();si();var Ua={update:"package",alert:"alert-triangle",watch:"eye",system:"settings",message:"mail",stewardship:"shield"};function N(i){return String(i??"").replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}var ni=class extends m{#e="panel";#t=null;#i=null;#n=null;#s=null;#r=new Set;#a=[];#c=!1;#o=null;#p=new Set;#h="all";#f=[];setup(){return this.#e=this.getAttribute("mode")==="banner"?"banner":"panel",this.#e==="banner"?this.#d():this.#u()}teardown(){this.#o!=null&&(clearInterval(this.#o),this.#o=null)}async#d(){let t=this.getAttribute("persist");if(t||console.warn("[notification-wc] banner mode requires a persist attribute"),this.dataset.mode="banner",this.dataset.variant=this.getAttribute("variant")||"info",this.dataset.position=this.getAttribute("position")||"top",t){let s=Number(this.getAttribute("expires")??""),n=Number.isFinite(s)&&s>0?s*864e5:void 0,r=await w.get("notifications",t,n?{maxAge:n}:void 0);if(r&&r.dismissed){this.hidden=!0;return}}let e=this.querySelector('[value="dismiss"], [data-dismiss]');e&&(this.#t=e,this.listen(e,"click",this.#l))}#l=async t=>{t.preventDefault();let e=this.getAttribute("persist");e&&await w.set("notifications",e,{dismissed:!0}),this.dispatchEvent(new CustomEvent("notification-wc:dismiss",{bubbles:!0,composed:!0,detail:{id:e}})),this.hidden=!0};async#u(){if(this.dataset.mode="panel",await this.#m(),this.#v(),this.#A(),await this.#N(),this.#B(),this.listen(document,"click",this.#_),this.listen(document,"keydown",this.#F),this.listen(document,"page-watch:add",()=>this.#N()),this.listen(document,"page-watch:remove",()=>this.#N()),this.getAttribute("src")){await this.#M();let t=Number(this.getAttribute("poll"));Number.isFinite(t)&&t>0&&(this.#o=setInterval(()=>this.#M(),t))}}async#m(){let t=this.getAttribute("storage-key")||"notifications",e=await w.get(t,"read-ids");Array.isArray(e)&&(this.#r=new Set(e.filter(s=>typeof s=="string")))}async#g(){let t=this.getAttribute("storage-key")||"notifications";await w.set(t,"read-ids",Array.from(this.#r))}#v(){if(this.#i=this.querySelector(":scope > [data-trigger]"),this.#i){let t=this.#i.querySelector(".notification-badge");t||(t=document.createElement("span"),t.className="notification-badge",t.hidden=!0,this.#i.appendChild(t))}else{let t=document.createElement("button");t.type="button",t.setAttribute("data-trigger",""),t.className="notification-trigger",t.setAttribute("aria-label","Notifications"),t.innerHTML='<icon-wc name="bell" size="sm"></icon-wc><span class="notification-badge" hidden>0</span>',this.#i=t,this.prepend(t)}this.#s=this.#i.querySelector(".notification-badge"),this.#i.setAttribute("aria-haspopup","dialog"),this.#i.setAttribute("aria-expanded","false"),this.listen(this.#i,"click",this.#I)}#A(){this.#n=document.createElement("div"),this.#n.className="notification-panel",this.#n.setAttribute("role","dialog"),this.#n.setAttribute("aria-label","Notifications"),this.#n.hidden=!0;let t=`notification-panel-${crypto.randomUUID().slice(0,8)}`;this.#n.id=t,this.#i?.setAttribute("aria-controls",t),this.#n.innerHTML=`
|
|
314
|
+
`}#b(){this.#e.addEventListener("click",this.#y),this.listen(document,"click",this.#w),this.listen(document,"keydown",this.#P),this.#t.querySelector(".settings-close")?.addEventListener("click",()=>this.close()),this.#t.querySelectorAll('input[name="settings-mode"]').forEach(t=>{t.addEventListener("change",this.#N)}),this.#t.querySelector("#settings-theme")?.addEventListener("change",this.#S),this.#t.querySelector("input[data-fluid-toggle]")?.addEventListener("change",this.#$),this.#t.querySelectorAll('input[name="settings-density"]').forEach(t=>{t.addEventListener("change",this.#D)}),this.#t.querySelector("input[data-backdrop-toggle]")?.addEventListener("change",this.#k),this.#t.querySelectorAll('input[name="settings-backdrop"]').forEach(t=>{t.addEventListener("change",this.#O)}),this.#t.querySelectorAll('input[name="settings-backdrop-chrome"]').forEach(t=>{t.addEventListener("change",this.#_)}),this.#t.querySelector("input[data-backdrop-fixed]")?.addEventListener("change",this.#F),this.#t.querySelector("input[data-sticky-toggle]")?.addEventListener("change",this.#T),this.#t.querySelector('[name="settings-page-bg"]')?.addEventListener("change",this.#q),this.#t.querySelector('[name="settings-page-bg-color"]')?.addEventListener("input",this.#L),this.#t.querySelector('[name="settings-page-bg-grad-start"]')?.addEventListener("input",this.#L),this.#t.querySelector('[name="settings-page-bg-grad-end"]')?.addEventListener("input",this.#L),this.#t.querySelector('[name="settings-page-bg-grad-dir"]')?.addEventListener("change",this.#L),this.#t.querySelectorAll("input[data-a11y]").forEach(t=>{t.addEventListener("change",this.#x)}),this.#t.querySelectorAll("input[data-ext]").forEach(t=>{t.addEventListener("change",this.#M)}),this.#t.querySelectorAll("input[data-env]").forEach(t=>{t.addEventListener("change",this.#B)}),this.#t.querySelector(".settings-reset")?.addEventListener("click",this.#V),this.#t.querySelector('[data-action="clear-cache"]')?.addEventListener("click",this.#Z),this.#t.querySelector('[data-action="check-update"]')?.addEventListener("click",this.#Q),this.#K()}#y=t=>{t.stopPropagation(),this.toggle()};#w=t=>{this.#i&&!this.contains(t.target)&&this.close()};#P=t=>{t.key==="Escape"&&this.#i&&(t.preventDefault(),this.close(),this.#e?.focus())};#N=t=>{S.setMode(t.target.value)};#S=async t=>{let e=t.target;e.disabled=!0;try{await S.setBrand(e.value),this.#X()}catch{console.warn("[VB] Theme load failed, using default")}finally{e.disabled=!1}};#$=t=>{let e=t.target.checked,s=this.#o(S.getState().fluid)||"default";S.setFluid(this.#p(e,s)),this.#R(e)};#D=t=>{S.setFluid(this.#p(!0,t.target.value))};#k=t=>{let e=t.target.checked,s=this.#d(S.getState().backdrop)||"default";S.setBackdrop(this.#l(e,s)),this.#z(e)};#O=t=>{S.setBackdrop(this.#l(!0,t.target.value))};#_=t=>{let e=this.#m(S.getState().backdropChrome);S.setBackdropChrome(this.#g(t.target.value,e))};#F=t=>{let e=this.#u(S.getState().backdropChrome);S.setBackdropChrome(this.#g(e,t.target.checked))};#T=async t=>{let e=t.target.checked;this.#r=e,await w.set(G,"sticky",e?"on":"off");let s=document.querySelector("header");if(e){document.documentElement.dataset.sticky="",s&&(s.dataset.sticky="");let{initStickyManager:n}=await Promise.resolve().then(()=>(kt(),Xt));n()}else{delete document.documentElement.dataset.sticky,s&&delete s.dataset.sticky;let{destroyStickyManager:n}=await Promise.resolve().then(()=>(kt(),Xt));n()}};#q=t=>{let e=t.target.value;if(this.#H(e),e==="color"){let s=this.#t.querySelector('[name="settings-page-bg-color"]')?.value||"#1a1a2e";S.setPageBg({type:e,color:s})}else if(e==="gradient"){let s=this.#t.querySelector('[name="settings-page-bg-grad-start"]')?.value||"#1a1a2e",n=this.#t.querySelector('[name="settings-page-bg-grad-end"]')?.value||"#16213e",r=this.#t.querySelector('[name="settings-page-bg-grad-dir"]')?.value||"to bottom";S.setPageBg({type:e,gradStart:s,gradEnd:n,gradDir:r})}else S.setPageBg({})};#L=()=>{let t=this.#t.querySelector('[name="settings-page-bg"]')?.value||"";if(t==="color"){let e=this.#t.querySelector('[name="settings-page-bg-color"]')?.value||"";S.setPageBg({type:t,color:e})}else if(t==="gradient"){let e=this.#t.querySelector('[name="settings-page-bg-grad-start"]')?.value||"",s=this.#t.querySelector('[name="settings-page-bg-grad-end"]')?.value||"",n=this.#t.querySelector('[name="settings-page-bg-grad-dir"]')?.value||"to bottom";S.setPageBg({type:t,gradStart:e,gradEnd:s,gradDir:n})}};#x=t=>{let e=t.target.dataset.a11y,s=this.#I();if(t.target.checked&&!s.includes(e))s.push(e);else if(!t.target.checked){let n=s.indexOf(e);n!==-1&&s.splice(n,1)}this.#W(s),this.#U(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:s}))};#M=t=>{let e=t.target.dataset.ext,s=t.target.checked;this.#J(e,s),this.#G()};#B=t=>{let e=t.target.dataset.env,s=t.target.checked;Ct.setSource(e,s)};#V=()=>{confirm("Reset all settings to defaults?")&&(S.reset(),this.#W([]),this.#U(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:[]})),this.#s={...Jt},w.remove(G,"extensions").catch(()=>{}),this.#G(),this.#r=!1,w.remove(G,"sticky").catch(()=>{}),delete document.documentElement.dataset.sticky,Promise.resolve().then(()=>(kt(),Xt)).then(t=>t.destroyStickyManager()).catch(()=>{}),Ct.setSource("timeOfDay",!1),Ct.setSource("seasonal",!1),this.#C())};#E=()=>{this.#C()};#C(){let{mode:t,brand:e,fluid:s,backdrop:n,backdropChrome:r,pageBgType:a,pageBgColor:o,pageBgGradStart:c,pageBgGradEnd:l,pageBgGradDir:h}=S.getState(),d=this.#I(),u=this.#Y(),b=this.#c(s),y=this.#o(s),p=this.#f(n),E=this.#d(n),v=this.#t.querySelector(`input[name="settings-mode"][value="${t}"]`);v&&(v.checked=!0);let T=this.#t.querySelector("#settings-theme");T&&(T.value=e||"default");let q=this.#t.querySelector("input[data-fluid-toggle]");q&&(q.checked=b);let Pt=this.#t.querySelector(`input[name="settings-density"][value="${y}"]`);Pt&&(Pt.checked=!0),this.#R(b);let Cs=this.#t.querySelector("input[data-backdrop-toggle]");Cs&&(Cs.checked=p);let ks=this.#t.querySelector(`input[name="settings-backdrop"][value="${E}"]`);ks&&(ks.checked=!0);let ia=this.#u(r),xs=this.#t.querySelector(`input[name="settings-backdrop-chrome"][value="${ia}"]`);xs&&(xs.checked=!0);let Ts=this.#t.querySelector("input[data-backdrop-fixed]");Ts&&(Ts.checked=this.#m(r)),this.#z(p);let Ls=this.#t.querySelector('[name="settings-page-bg"]');Ls&&(Ls.value=a||"");let Ms=this.#t.querySelector('[name="settings-page-bg-color"]');Ms&&o&&(Ms.value=o);let Ns=this.#t.querySelector('[name="settings-page-bg-grad-start"]');Ns&&c&&(Ns.value=c);let Ds=this.#t.querySelector('[name="settings-page-bg-grad-end"]');Ds&&l&&(Ds.value=l);let _s=this.#t.querySelector('[name="settings-page-bg-grad-dir"]');_s&&h&&(_s.value=h),p&&this.#H(a||""),this.#t.querySelectorAll("input[data-a11y]").forEach(mt=>{let U=mt;U.checked=d.includes(U.dataset.a11y)}),this.#t.querySelectorAll("input[data-ext]").forEach(mt=>{let U=mt,Bt=U.dataset.ext,na=u[Bt];U.checked=na??Jt[Bt]});let qs=this.#t.querySelector("input[data-sticky-toggle]");qs&&(qs.checked=this.#h());let sa=this.#j();this.#t.querySelectorAll("input[data-env]").forEach(mt=>{let U=mt,Bt=U.dataset.env;U.checked=sa[Bt]??!1})}#R(t){let e=this.#t.querySelector(".density-row");e&&(e.hidden=!t)}#z(t){if(this.#t.querySelectorAll(".backdrop-row").forEach(e=>{e.hidden=!t}),t){let e=this.#t.querySelector('[name="settings-page-bg"]')?.value||"";this.#H(e)}}#H(t){let e=this.#t.querySelector(".page-bg-color-row"),s=this.#t.querySelector(".page-bg-grad-row"),n=this.#t.querySelector(".page-bg-grad-dir-row");e&&(e.hidden=t!=="color"),s&&(s.hidden=t!=="gradient"),n&&(n.hidden=t!=="gradient")}#I(){return[...this.#n]}#W(t){this.#n=[...t],w.set(G,"a11y",this.#n).catch(()=>{})}#U(){let t=this.#I(),{brand:e}=S.getState(),s=document.documentElement,n=e!=="default"?[e,...t]:[...t];n.length?s.dataset.theme=n.join(" "):delete s.dataset.theme}#X(){this.#U()}#j(){return Ct.load()}#Y(){return{...this.#s}}#J(t,e){this.#s={...this.#s,[t]:e},w.set(G,"extensions",this.#s).catch(()=>{})}async#G(){let t=this.#Y(),e=document.documentElement;t.motionFx?delete e.dataset.motionReduced:e.dataset.motionReduced="",t.sounds?(ut||(ut=(await Promise.resolve().then(()=>(kn(),Cn))).SoundManager),ut.init(),ut.enable()):ut&&ut.disable(),window.dispatchEvent(new CustomEvent("vb:extensions-change",{detail:t}))}async#K(){let t=this.#t.querySelector("[data-sw-status] span");if(t){if(!("serviceWorker"in navigator)){t.textContent="Not supported";return}try{let s=(await vn()).cachedURLs?.length??0;t.textContent=`Active (${s} cached files)`}catch{t.textContent="Not registered"}}}#Z=async t=>{let e=t.target;e.disabled=!0,e.textContent="Clearing\u2026";try{await wn(),e.textContent="Cleared!",this.#K(),setTimeout(()=>{e.textContent="Clear Cache",e.disabled=!1},2e3)}catch{e.textContent="Failed",setTimeout(()=>{e.textContent="Clear Cache",e.disabled=!1},2e3)}};#Q=async t=>{let e=t.target;e.disabled=!0,e.textContent="Checking\u2026";try{let{updated:s}=await En();e.textContent=s?"Update available!":"Up to date",setTimeout(()=>{e.textContent="Check for Updates",e.disabled=!1},2e3)}catch{e.textContent="Failed",setTimeout(()=>{e.textContent="Check for Updates",e.disabled=!1},2e3)}};open(){this.#i||(this.#i=!0,this.setAttribute("open",""),this.#e?.setAttribute("aria-expanded","true"),this.#C(),this.#tt())}#tt(){let t=this.getBoundingClientRect(),e=this.#t;e.style.removeProperty("top"),e.style.removeProperty("bottom"),e.style.removeProperty("left"),e.style.removeProperty("right");let s=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,a=t.top,o=r-t.bottom;a<s.height&&o>a?(e.style.top="calc(100% + 8px)",e.style.bottom="auto"):(e.style.bottom="calc(100% + 8px)",e.style.top="auto");let c=n-t.right,l=t.left,h=s.width;t.right<h&&l<c?(e.style.left="0",e.style.right="auto"):(e.style.right="0",e.style.left="auto")}close(){this.#i&&(this.#i=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"))}toggle(){this.#i?this.close():this.open()}};f("settings-panel",ii);W();si();var ja={update:"package",alert:"alert-triangle",watch:"eye",system:"settings",message:"mail",stewardship:"shield"};function N(i){return String(i??"").replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}var ni=class extends m{#e="panel";#t=null;#i=null;#n=null;#s=null;#r=new Set;#a=[];#c=!1;#o=null;#p=new Set;#h="all";#f=[];setup(){return this.#e=this.getAttribute("mode")==="banner"?"banner":"panel",this.#e==="banner"?this.#d():this.#u()}teardown(){this.#o!=null&&(clearInterval(this.#o),this.#o=null)}async#d(){let t=this.getAttribute("persist");if(t||console.warn("[notification-wc] banner mode requires a persist attribute"),this.dataset.mode="banner",this.dataset.variant=this.getAttribute("variant")||"info",this.dataset.position=this.getAttribute("position")||"top",t){let s=Number(this.getAttribute("expires")??""),n=Number.isFinite(s)&&s>0?s*864e5:void 0,r=await w.get("notifications",t,n?{maxAge:n}:void 0);if(r&&r.dismissed){this.hidden=!0;return}}let e=this.querySelector('[value="dismiss"], [data-dismiss]');e&&(this.#t=e,this.listen(e,"click",this.#l))}#l=async t=>{t.preventDefault();let e=this.getAttribute("persist");e&&await w.set("notifications",e,{dismissed:!0}),this.dispatchEvent(new CustomEvent("notification-wc:dismiss",{bubbles:!0,composed:!0,detail:{id:e}})),this.hidden=!0};async#u(){if(this.dataset.mode="panel",await this.#m(),this.#v(),this.#A(),await this.#N(),this.#P(),this.listen(document,"click",this.#_),this.listen(document,"keydown",this.#F),this.listen(document,"page-watch:add",()=>this.#N()),this.listen(document,"page-watch:remove",()=>this.#N()),this.getAttribute("src")){await this.#M();let t=Number(this.getAttribute("poll"));Number.isFinite(t)&&t>0&&(this.#o=setInterval(()=>this.#M(),t))}}async#m(){let t=this.getAttribute("storage-key")||"notifications",e=await w.get(t,"read-ids");Array.isArray(e)&&(this.#r=new Set(e.filter(s=>typeof s=="string")))}async#g(){let t=this.getAttribute("storage-key")||"notifications";await w.set(t,"read-ids",Array.from(this.#r))}#v(){if(this.#i=this.querySelector(":scope > [data-trigger]"),this.#i){let t=this.#i.querySelector(".notification-badge");t||(t=document.createElement("span"),t.className="notification-badge",t.hidden=!0,this.#i.appendChild(t))}else{let t=document.createElement("button");t.type="button",t.setAttribute("data-trigger",""),t.className="notification-trigger",t.setAttribute("aria-label","Notifications"),t.innerHTML='<icon-wc name="bell" size="sm"></icon-wc><span class="notification-badge" hidden>0</span>',this.#i=t,this.prepend(t)}this.#s=this.#i.querySelector(".notification-badge"),this.#i.setAttribute("aria-haspopup","dialog"),this.#i.setAttribute("aria-expanded","false"),this.listen(this.#i,"click",this.#O)}#A(){this.#n=document.createElement("div"),this.#n.className="notification-panel",this.#n.setAttribute("role","dialog"),this.#n.setAttribute("aria-label","Notifications"),this.#n.hidden=!0;let t=`notification-panel-${crypto.randomUUID().slice(0,8)}`;this.#n.id=t,this.#i?.setAttribute("aria-controls",t),this.#n.innerHTML=`
|
|
315
315
|
<header class="notification-header">
|
|
316
316
|
<strong>Notifications</strong>
|
|
317
317
|
<button type="button" class="notification-mark-all">Mark all read</button>
|
|
@@ -325,7 +325,7 @@ svg {
|
|
|
325
325
|
<footer class="notification-footer" hidden>
|
|
326
326
|
<em>No notifications</em>
|
|
327
327
|
</footer>
|
|
328
|
-
`,this.appendChild(this.#n);let e=this.#n.querySelector(".notification-mark-all");e&&this.listen(e,"click",this.#q);for(let s of this.#n.querySelectorAll('[role="tab"]'))this.listen(s,"click",this.#D);this.#y()}#b(){let t=Array.from(this.querySelectorAll(":scope > article")),e=new Map;for(let s of t){let n=s.getAttribute("data-id")||s.id||`static-${e.size}`,r=s.getAttribute("data-type")||"update",a=s.getAttribute("data-date")||"",o=s.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim()||n,l=s.querySelector("p")?.textContent?.trim()||"",h=s.querySelector("a");e.set(n,{id:n,type:r,date:a,title:o,body:l,url:h?.getAttribute("href")||null,source:"static"})}for(let s of this.#a)if(!(!s||typeof s.id!="string")){if(s.dismissed){e.delete(s.id);continue}e.set(s.id,{...e.get(s.id),...s,source:"dynamic"})}return Array.from(e.values()).sort((s,n)=>{let r=s.date?Date.parse(s.date):0;return(n.date?Date.parse(n.date):0)-r})}#y(){if(!this.#n)return;let t=this.#n.querySelector(".notification-list"),e=this.#n.querySelector(".notification-footer");if(!t)return;let s=this.#b();t.innerHTML=s.map(n=>this.#w(n)).join(""),e&&(e.hidden=s.length>0);for(let n of t.querySelectorAll("[data-notification-id]"))this.listen(n,"click",this.#T);this.#
|
|
328
|
+
`,this.appendChild(this.#n);let e=this.#n.querySelector(".notification-mark-all");e&&this.listen(e,"click",this.#q);for(let s of this.#n.querySelectorAll('[role="tab"]'))this.listen(s,"click",this.#D);this.#y()}#b(){let t=Array.from(this.querySelectorAll(":scope > article")),e=new Map;for(let s of t){let n=s.getAttribute("data-id")||s.id||`static-${e.size}`,r=s.getAttribute("data-type")||"update",a=s.getAttribute("data-date")||"",o=s.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim()||n,l=s.querySelector("p")?.textContent?.trim()||"",h=s.querySelector("a");e.set(n,{id:n,type:r,date:a,title:o,body:l,url:h?.getAttribute("href")||null,source:"static"})}for(let s of this.#a)if(!(!s||typeof s.id!="string")){if(s.dismissed){e.delete(s.id);continue}e.set(s.id,{...e.get(s.id),...s,source:"dynamic"})}return Array.from(e.values()).sort((s,n)=>{let r=s.date?Date.parse(s.date):0;return(n.date?Date.parse(n.date):0)-r})}#y(){if(!this.#n)return;let t=this.#n.querySelector(".notification-list"),e=this.#n.querySelector(".notification-footer");if(!t)return;let s=this.#b();t.innerHTML=s.map(n=>this.#w(n)).join(""),e&&(e.hidden=s.length>0);for(let n of t.querySelectorAll("[data-notification-id]"))this.listen(n,"click",this.#T);this.#P()}#w(t){let e=ja[t.type]||"bell",s=this.#r.has(t.id),n=t.date?new Date(t.date).toLocaleString():"",r=`
|
|
329
329
|
<icon-wc class="notification-type-icon" name="${N(e)}" size="sm"></icon-wc>
|
|
330
330
|
<div class="notification-body">
|
|
331
331
|
<h4>${N(t.title)}</h4>
|
|
@@ -334,7 +334,7 @@ svg {
|
|
|
334
334
|
</div>
|
|
335
335
|
`,a=t.url?"a":"button",o=t.url?`href="${N(t.url)}"`:'type="button"';return`<li role="listitem" data-notification-id="${N(t.id)}" data-type="${N(t.type||"update")}"${s?" data-read":""}>
|
|
336
336
|
<${a} class="notification-row" ${o}>${r}</${a}>
|
|
337
|
-
</li>`}#
|
|
337
|
+
</li>`}#P(){if(!this.#s)return;let e=this.#b().filter(s=>!this.#r.has(s.id)).length;e>0?(this.#s.textContent=String(e),this.#s.hidden=!1,this.#i?.querySelector("icon-wc")?.setAttribute("name","bell-dot")):(this.#s.hidden=!0,this.#i?.querySelector("icon-wc")?.setAttribute("name","bell"))}async#N(){try{this.#f=await w.list("watches")}catch{this.#f=[]}this.#S()}#S(){if(!this.#n)return;let t=this.#n.querySelector(".notification-watch-list"),e=this.#n.querySelector(".notification-tab-count");if(t){if(t.innerHTML=this.#f.map(s=>this.#$(s)).join("")||`<li class="notification-empty"><em>You aren't watching any pages yet. Use the “Watch” button on a page to start.</em></li>`,e){let s=this.#f.length;s>0?(e.textContent=String(s),e.hidden=!1):e.hidden=!0}for(let s of t.querySelectorAll("[data-watch-unwatch]"))this.listen(s,"click",this.#k)}}#$(t){let e=t.data||{},s=e.url||t.key,n=e.title||s,r=e.lastChecked?new Date(e.lastChecked).toLocaleString():"\u2014",a=!!e.lastChanged;return`<li class="notification-watch-item"${a?" data-changed":""}>
|
|
338
338
|
<a class="notification-watch-row" href="${N(s)}">
|
|
339
339
|
<icon-wc class="notification-type-icon" name="eye" size="sm"></icon-wc>
|
|
340
340
|
<div class="notification-body">
|
|
@@ -346,9 +346,9 @@ svg {
|
|
|
346
346
|
<button type="button" class="notification-unwatch" data-watch-unwatch data-watch-key="${N(t.key)}" aria-label="Unwatch ${N(n)}">
|
|
347
347
|
<icon-wc name="x" size="xs"></icon-wc>
|
|
348
348
|
</button>
|
|
349
|
-
</li>`}#D=t=>{let e=t.currentTarget.dataset.tab;if(!e||e===this.#h||(this.#h=e,!this.#n))return;for(let n of this.#n.querySelectorAll('[role="tab"]')){let r=n.dataset.tab===e;n.setAttribute("aria-selected",r?"true":"false")}for(let n of this.#n.querySelectorAll("[data-tab-panel]"))n.hidden=n.dataset.tabPanel!==e;let s=this.#n.querySelector(".notification-footer");s&&(s.hidden=!0)};#k=async t=>{t.preventDefault(),t.stopPropagation();let s=t.currentTarget.getAttribute("data-watch-key");if(!s)return;let n=this.#f.find(r=>r.key===s);await w.remove("watches",s),this.#f=this.#f.filter(r=>r.key!==s),this.#S(),this.dispatchEvent(new CustomEvent("page-watch:remove",{bubbles:!0,composed:!0,detail:{url:n?.data?.url||s,subscriptionId:n?.data?.subscriptionId||null}}))};#
|
|
349
|
+
</li>`}#D=t=>{let e=t.currentTarget.dataset.tab;if(!e||e===this.#h||(this.#h=e,!this.#n))return;for(let n of this.#n.querySelectorAll('[role="tab"]')){let r=n.dataset.tab===e;n.setAttribute("aria-selected",r?"true":"false")}for(let n of this.#n.querySelectorAll("[data-tab-panel]"))n.hidden=n.dataset.tabPanel!==e;let s=this.#n.querySelector(".notification-footer");s&&(s.hidden=!0)};#k=async t=>{t.preventDefault(),t.stopPropagation();let s=t.currentTarget.getAttribute("data-watch-key");if(!s)return;let n=this.#f.find(r=>r.key===s);await w.remove("watches",s),this.#f=this.#f.filter(r=>r.key!==s),this.#S(),this.dispatchEvent(new CustomEvent("page-watch:remove",{bubbles:!0,composed:!0,detail:{url:n?.data?.url||s,subscriptionId:n?.data?.subscriptionId||null}}))};#O=t=>{t.stopPropagation(),this.#c?this.#x():this.#L()};#_=t=>{this.#c&&!this.contains(t.target)&&this.#x()};#F=t=>{t.key==="Escape"&&this.#c&&(t.preventDefault(),this.#x(),this.#i?.focus())};#T=async t=>{let e=t.currentTarget.closest("[data-notification-id]");if(!e)return;let s=e.getAttribute("data-notification-id");s&&(this.#r.has(s)||(this.#r.add(s),e.setAttribute("data-read",""),await this.#g(),this.#P(),this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:s}}))))};#q=async()=>{let t=this.#b();for(let e of t)this.#r.add(e.id);await this.#g(),this.#y();for(let e of t)this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:e.id}}))};#L(){this.#n&&(this.#c=!0,this.#n.hidden=!1,this.#i?.setAttribute("aria-expanded","true"),this.#N(),this.dispatchEvent(new CustomEvent("notification-wc:open",{bubbles:!0,composed:!0})))}#x(){this.#n&&(this.#c=!1,this.#n.hidden=!0,this.#i?.setAttribute("aria-expanded","false"),this.dispatchEvent(new CustomEvent("notification-wc:close",{bubbles:!0,composed:!0})))}async#M(){let t=this.getAttribute("src");if(!t)return;let e,s=0;try{if(t.startsWith("http")||t.startsWith("/")){let c=await fetch(t,{headers:{accept:"application/json"}});if(s=c.status,!c.ok)throw new Error(`${c.status}`);e=await c.json()}else e=await new it(t).get("/")}catch(c){let l=c instanceof z?c.status:s;if(l===404||l===503)return;let h=c instanceof z?`${c.status}`:String(c);console.warn("[notification-wc] failed to fetch",t,h);return}let n=Array.isArray(e)?e:Array.isArray(e?.notifications)?e.notifications:[],r=this.#p,a=r.size===0,o=this.hasAttribute("toast-new")?document.querySelector("toast-msg"):null;for(let c of n)c?.id&&(r.has(c.id)||(this.dispatchEvent(new CustomEvent("notification-wc:new",{bubbles:!0,composed:!0,detail:{notification:c}})),!a&&o&&typeof o.show=="function"&&o.show({message:c.title||c.body||"New notification",variant:c.type==="alert"||c.type==="stewardship"?"warning":"info",duration:5e3})),r.add(c.id));this.#a=n,this.#y()}};f("notification-wc",ni);var Pn="Watch for updates",oo="Watching",wi=class extends m{#e=null;setup(){if(this.hasAttribute("server-sync")){let e=window;e.vbPageWatch={...e.vbPageWatch??{},serverSync:!0}}let t=this.#t();this.dataset.variant=t;for(let e of Array.from(this.children))e.hasAttribute?.("data-watch-page")&&e.remove();this.#e=this.#i(t),this.appendChild(this.#e),this.listen(document,"page-watch:add",this.#n),this.listen(document,"page-watch:remove",this.#n)}teardown(){this.#e&&(this.#e.remove(),this.#e=null)}#t(){let t=this.getAttribute("variant");return t==="compact"||t==="button"?t:"icon"}#i(t){let e=document.createElement("button");e.type="button",e.setAttribute("data-watch-page",""),e.className="ghost",e.setAttribute("aria-label","Watch this page for updates");let s=t==="icon"?"sm":"xs",n=this.getAttribute("label")??Pn;return t==="icon"?e.innerHTML=`<icon-wc name="bookmark" size="${s}"></icon-wc>`:(e.innerHTML=`<icon-wc name="bookmark" size="${s}"></icon-wc><span>${this.#s(n)}</span>`,e.setAttribute("data-watch-label-locked","")),e}#n=async()=>{if(this.#e)try{let{readWatch:t}=await Promise.resolve().then(()=>(vi(),yi)),s=!!await t();this.#e.setAttribute("aria-pressed",s?"true":"false");let n=this.#e.querySelector("icon-wc");n&&n.setAttribute("name",s?"bookmark-check":"bookmark");let r=this.#e.querySelector("span");if(r&&this.#t()!=="icon"){let a=this.getAttribute("label");r.textContent=a||(s?oo:Pn)}this.#e.setAttribute("title",s?"Stop watching this page":"Watch this page for content updates")}catch{}};#s(t){let e=document.createElement("div");return e.textContent=t,e.innerHTML}};f("watch-wc",wi);var at={optout:"vb_optout",sessionCount:"vb_sc",eventQueue:"vb_q"};function co(i){return String(i).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}function lo(i){return typeof i!="number"||i<=0?"\u2014":i<6e4?`${Math.round(i/1e3)}s`:`${Math.floor(i/6e4)}m ${Math.round(i%6e4/1e3)}s`}var Ei=class extends m{setup(){this.#n(),this.listen(this,"click",this.#e)}get isOptedOut(){try{return sessionStorage.getItem(at.optout)==="1"}catch{return!1}}get sessionCounter(){try{let t=sessionStorage.getItem(at.sessionCount);return t?JSON.parse(t):null}catch{return null}}get queuedEvents(){try{let t=sessionStorage.getItem(at.eventQueue);return t?JSON.parse(t):[]}catch{return[]}}get hasSessionData(){return this.sessionCounter!=null||this.queuedEvents.length>0}#e=t=>{let e=t.target?.closest?.("[data-analytics-action]");if(!e||!this.contains(e))return;let s=e.dataset.analyticsAction;s==="clear"&&this.#t(),s==="optout"&&this.#i(),s==="refresh"&&this.#n()};#t(){try{sessionStorage.removeItem(at.sessionCount),sessionStorage.removeItem(at.eventQueue)}catch{}this.dispatchEvent(new CustomEvent("analytics-panel:cleared",{bubbles:!0,composed:!0})),this.#n()}#i(){let t=!this.isOptedOut;try{t?sessionStorage.setItem(at.optout,"1"):sessionStorage.removeItem(at.optout)}catch{}this.dispatchEvent(new CustomEvent(t?"analytics-panel:optout":"analytics-panel:optin",{bubbles:!0,composed:!0})),t?this.#t():this.#n()}#n(){let t=this.getAttribute("title")||"Analytics data",e=this.isOptedOut,s=this.hasSessionData;this.innerHTML=`
|
|
350
350
|
<header class="analytics-panel__header">
|
|
351
|
-
<h3>${
|
|
351
|
+
<h3>${co(t)}</h3>
|
|
352
352
|
<p class="analytics-panel__status" role="status">
|
|
353
353
|
<span class="analytics-panel__dot analytics-panel__dot--${e?"paused":"active"}" aria-hidden="true"></span>
|
|
354
354
|
${e?"Analytics paused for this tab. No data is being collected.":"Analytics active. Only aggregate, device-scoped data is collected."}
|
|
@@ -378,8 +378,8 @@ svg {
|
|
|
378
378
|
No cookies, no cross-site identifiers, no IP address stored.
|
|
379
379
|
Data is cleared automatically when you close this tab.
|
|
380
380
|
</p>
|
|
381
|
-
`}#s(){if(!this.hasSessionData)return'<p class="analytics-panel__empty">No data stored on this device in this session.</p>';let t=this.sessionCounter,e=this.queuedEvents,s=e.find(o=>o?.id==="__scroll"),n=e.find(o=>o?.id==="__attention"),r=e.filter(o=>!o?.id?.startsWith?.("__")).length,a=[];return t?.v!=null&&a.push(`<dt>Pages this session</dt><dd>${t.v}</dd>`),s&&a.push(`<dt>Max scroll depth</dt><dd>${s.params?.depth??"?"}%</dd>`),n&&a.push(`<dt>Active reading time</dt><dd>${
|
|
382
|
-
`),document.head.appendChild(i)}function ee(i){_t(i),Nt(i)}function ki(i){let t=x.get(i);if(t){if(clearTimeout(t.gainedTimer),clearTimeout(t.lostTimer),clearTimeout(t.longPressTimer),t.state!=="none"){let e=H(i);e&&Dt(i,e)}i.classList.remove("interest-source"),x.delete(i),se.delete(i)}}function Pn(i=document){i.querySelectorAll(`[${L}]`).forEach(ee)}var Fn=new MutationObserver(i=>{for(let t of i){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.hasAttribute(L)&&ee(s),s.querySelectorAll(`[${L}]`).forEach(ee)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;x.has(s)&&ki(s),s.querySelectorAll(`[${L}]`).forEach(n=>{x.has(n)&&ki(n)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.hasAttribute(L)?x.has(e)||ee(e):x.has(e)&&ki(e)}}});Rn||(go(),bo(),document.documentElement.setAttribute("data-interest-polyfill",""),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Pn(),Fn.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[L]})}):(Pn(),Fn.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[L]})));if(Rn&&Ti){let i=()=>{document.querySelectorAll(`[${L}]`).forEach(Nt),new MutationObserver(t=>{for(let e of t){for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.hasAttribute(L)&&Nt(n),n.querySelectorAll(`[${L}]`).forEach(Nt)}e.type==="attributes"&&e.target.hasAttribute?.(L)&&Nt(e.target)}}).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[L]})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i()}var Mi="[data-copy], [data-copy-target]";function zn(i=document){i.querySelectorAll(Mi).forEach(Ni)}function Ni(i){if(i.hasAttribute("data-copy-init"))return;i.setAttribute("data-copy-init","");let t;i.addEventListener("click",async()=>{let e=yo(i);if(e)try{await navigator.clipboard.writeText(e),i.dataset.state="copied",clearTimeout(t),t=setTimeout(()=>{delete i.dataset.state},1500),vo("Copied to clipboard",i),i.dispatchEvent(new CustomEvent("copy",{bubbles:!0,detail:{text:e}}))}catch{}})}function yo(i){return i.dataset.copy?i.dataset.copy:i.dataset.copyTarget?document.querySelector(i.dataset.copyTarget)?.textContent??"":""}function vo(i,t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="sr-only",e.textContent=i,t.appendChild(e),setTimeout(()=>e.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>zn()):zn();var wo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Mi)&&Ni(s),s.querySelectorAll(Mi).forEach(n=>Ni(n))}});wo.observe(document.documentElement,{childList:!0,subtree:!0});var Di="kbd[data-hotkey]";function Un(i=document){i.querySelectorAll(Di).forEach(_i)}function _i(i){if(i.hasAttribute("data-hotkey-init"))return;i.setAttribute("data-hotkey-init","");let t=i.dataset.hotkey;if(!t)return;let e=lt?vt.mac:vt.other,s=t.toLowerCase().split("+").map(r=>r.trim()),n=document.createDocumentFragment();s.forEach((r,a)=>{let o=document.createElement("kbd");o.textContent=e[r]??r.toUpperCase(),n.appendChild(o),a<s.length-1&&!lt&&n.appendChild(document.createTextNode("+"))}),i.replaceChildren(n),i.setAttribute("aria-label",i.textContent)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Un()):Un();var Eo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Di)&&_i(s),s.querySelectorAll(Di).forEach(n=>_i(n))}});Eo.observe(document.documentElement,{childList:!0,subtree:!0});function ft(){return document.documentElement.lang||navigator.language||"en"}var qi="data[data-format-number]";function Wn(i=document){i.querySelectorAll(qi).forEach($i)}function $i(i){if(i.hasAttribute("data-format-number-init"))return;i.setAttribute("data-format-number-init","");let t=i.getAttribute("value");if(t==null)return;let e=Number(t);if(isNaN(e))return;i.title||(i.title=i.textContent.trim());let s=i.getAttribute("data-format-number")||"decimal",n=i.getAttribute("data-locale")||ft(),r={};switch(s){case"currency":{r.style="currency",r.currency=i.getAttribute("data-currency")||"USD";break}case"percent":r.style="percent";break;case"compact":r.notation="compact";break;default:break}try{i.textContent=new Intl.NumberFormat(n,r).format(e)}catch{}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Wn()):Wn();var Ao=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(qi)&&$i(s),s.querySelectorAll(qi).forEach(n=>$i(n))}});Ao.observe(document.documentElement,{childList:!0,subtree:!0});var ne="time[data-format-date]",qt=new Map;function jn(i=document){i.querySelectorAll(ne).forEach(Ii)}function Ii(i){if(i.hasAttribute("data-format-date-init"))return;i.setAttribute("data-format-date-init","");let t=i.getAttribute("datetime");if(!t)return;let e=new Date(t);if(isNaN(e.getTime()))return;i.title||(i.title=i.textContent.trim());let s=i.getAttribute("data-format-date")||"medium",n=i.getAttribute("data-locale")||ft();s==="relative"?(i.textContent=Gn(e,n),Kn(i,e,n)):i.textContent=So(e,s,i,n)}function So(i,t,e,s){let n=t||"medium",r=e.getAttribute("data-format-time")||void 0;try{let a={dateStyle:n};return r&&(a.timeStyle=r),new Intl.DateTimeFormat(s,a).format(i)}catch{return e.textContent}}function Gn(i,t){let e=Date.now(),s=Math.round((i.getTime()-e)/1e3),n=Math.abs(s),r=[{unit:"year",seconds:31536e3},{unit:"month",seconds:2592e3},{unit:"week",seconds:604800},{unit:"day",seconds:86400},{unit:"hour",seconds:3600},{unit:"minute",seconds:60},{unit:"second",seconds:1}];for(let{unit:a,seconds:o}of r)if(n>=o){let c=Math.round(s/o);try{return new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(c,a)}catch{let l=Math.abs(c),h=l===1?a:`${a}s`;return c<0?`${l} ${h} ago`:`in ${l} ${h}`}}try{return new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(0,"second")}catch{return"just now"}}function Kn(i,t,e){clearInterval(qt.get(i));let s=Math.abs(Date.now()-t.getTime()),n=36e5,r=864e5,a;s<n?a=6e4:s<r?a=3e5:a=36e5;let o=setInterval(()=>{i.textContent=Gn(t,e),Kn(i,t,e)},a);qt.set(i,o)}function Yn(i){qt.has(i)&&(clearInterval(qt.get(i)),qt.delete(i))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>jn()):jn();var Co=new MutationObserver(i=>{for(let t of i){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ne)&&Ii(s),s.querySelectorAll(ne).forEach(n=>Ii(n))}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;Yn(s),s.querySelectorAll(ne).forEach(Yn)}}});Co.observe(document.documentElement,{childList:!0,subtree:!0});var Bi="data[data-format-bytes]",Oi=["B","KB","MB","GB","TB","PB"];function Xn(i=document){i.querySelectorAll(Bi).forEach(Pi)}function Pi(i){if(i.hasAttribute("data-format-bytes-init"))return;i.setAttribute("data-format-bytes-init","");let t=i.getAttribute("value");if(t==null)return;let e=Number(t);if(isNaN(e)||e<0)return;i.title||(i.title=i.textContent.trim());let s=parseInt(i.getAttribute("data-format-bytes")??"0",10)||0,n=i.getAttribute("data-unit")==="decimal",r=i.getAttribute("data-locale")||ft(),a=n?1e3:1024;if(e===0){i.textContent="0 B";return}let o=Math.min(Math.floor(Math.log(e)/Math.log(a)),Oi.length-1),c=e/Math.pow(a,o);try{let l=new Intl.NumberFormat(r,{minimumFractionDigits:s,maximumFractionDigits:s}).format(c);i.textContent=`${l} ${Oi[o]}`}catch{i.textContent=`${c.toFixed(s)} ${Oi[o]}`}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Xn()):Xn();var ko=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Bi)&&Pi(s),s.querySelectorAll(Bi).forEach(n=>Pi(n))}});ko.observe(document.documentElement,{childList:!0,subtree:!0});var Fi="[data-spoiler]";var Qn=new Set(["SPAN","EM","STRONG","CODE","A","B","I","S","U","SMALL","SUB","SUP","MARK","ABBR","Q","CITE","DFN","SAMP","VAR","KBD","BDI","BDO","DATA","TIME","WBR"]);function Jn(i=document){i.querySelectorAll(Fi).forEach(Ri)}function Ri(i){if(i.hasAttribute("data-spoiler-init"))return;i.setAttribute("data-spoiler-init","");let t=i.getAttribute("data-spoiler")||"blur";i.getAttribute("data-spoiler")||i.setAttribute("data-spoiler","blur");let e=Qn.has(i.tagName),s=e?"span":"div";i.setAttribute("role","group"),i.setAttribute("aria-label","Spoiler");let n=document.createElement(s);for(n.setAttribute("data-spoiler-content",""),n.setAttribute("inert","");i.firstChild;)n.appendChild(i.firstChild);i.appendChild(n);let r=i.getAttribute("data-spoiler-label")||"Reveal spoiler",a;e?(a=document.createElement("span"),a.setAttribute("role","button"),a.setAttribute("tabindex","0")):(a=document.createElement("button"),a.setAttribute("type","button")),a.setAttribute("data-spoiler-trigger",""),a.setAttribute("aria-expanded","false");let o=document.createElement("span");o.setAttribute("data-spoiler-label",""),o.textContent=r,a.appendChild(o),i.appendChild(a),a.addEventListener("click",()=>Zn(i)),e&&a.addEventListener("keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),Zn(i))}),i.addEventListener("keydown",c=>{c.key==="Escape"&&i.hasAttribute("data-spoiler-visible")&&(c.stopPropagation(),re(i))})}function Zn(i){let t=i.getAttribute("data-spoiler-group");t&&document.querySelectorAll(`[data-spoiler-group="${t}"][data-spoiler-visible]`).forEach(n=>{n!==i&&re(n)});let e=i.querySelector("[data-spoiler-content]"),s=i.querySelector("[data-spoiler-trigger]");if(e&&e.removeAttribute("inert"),s&&(s.setAttribute("aria-expanded","true"),s.hidden=!0),i.setAttribute("data-spoiler-visible",""),!i.hasAttribute("data-spoiler-persist")){let n=Qn.has(i.tagName),r;n?(r=document.createElement("span"),r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),re(i))})):(r=document.createElement("button"),r.setAttribute("type","button")),r.setAttribute("data-spoiler-hide",""),r.textContent="Hide",r.addEventListener("click",()=>re(i)),i.appendChild(r)}xo("Spoiler revealed"),i.dispatchEvent(new CustomEvent("spoiler:toggle",{bubbles:!0,detail:{visible:!0}}))}function re(i){if(i.hasAttribute("data-spoiler-persist"))return;let t=i.querySelector("[data-spoiler-content]"),e=i.querySelector("[data-spoiler-trigger]"),s=i.querySelector("[data-spoiler-hide]");t&&t.setAttribute("inert",""),e&&(e.setAttribute("aria-expanded","false"),e.hidden=!1,e.focus()),s&&s.remove(),i.removeAttribute("data-spoiler-visible"),i.dispatchEvent(new CustomEvent("spoiler:toggle",{bubbles:!0,detail:{visible:!1}}))}function xo(i){let t=document.createElement("div");t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:"0"}),t.textContent=i,document.body.appendChild(t),setTimeout(()=>t.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Jn()):Jn();var To=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Fi)&&Ri(s),s.querySelectorAll(Fi).forEach(Ri)}});To.observe(document.documentElement,{childList:!0,subtree:!0});var Hi="[data-splitter]";function tr(i=document){i.querySelectorAll(Hi).forEach(Vi)}function Vi(i){if(i.hasAttribute("data-splitter-init"))return;i.setAttribute("data-splitter-init","");let t=[...i.children];if(t.length<2)return;let e=t[0],s=t[1],n=i.getAttribute("data-splitter")==="vertical",r=Number(e.dataset.min)||10,a=Number(e.dataset.max)||90,o=document.createElement("div");o.className="split-divider",o.setAttribute("role","separator"),o.setAttribute("aria-orientation",n?"vertical":"horizontal"),o.setAttribute("aria-valuenow","50"),o.setAttribute("aria-valuemin",String(r)),o.setAttribute("aria-valuemax",String(a)),o.setAttribute("aria-label","Resize panels"),o.setAttribute("tabindex","0"),i.insertBefore(o,s),e.style.flexBasis="50%",e.style.flexGrow="0",e.style.flexShrink="0",e.style.overflow="auto",s.style.flexGrow="1",s.style.overflow="auto";let c=!1;function l(h){let d=Math.min(a,Math.max(r,h));e.style.flexBasis=`${d}%`,o.setAttribute("aria-valuenow",String(Math.round(d))),i.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:d},bubbles:!0}))}o.addEventListener("pointerdown",h=>{h.preventDefault(),c=!0,o.setPointerCapture(h.pointerId),i.style.userSelect="none"}),o.addEventListener("pointermove",h=>{if(!c)return;let d=i.getBoundingClientRect(),u;n?u=(h.clientY-d.top)/d.height*100:u=(h.clientX-d.left)/d.width*100,l(u)}),o.addEventListener("pointerup",h=>{c=!1,o.releasePointerCapture(h.pointerId),i.style.userSelect=""}),o.addEventListener("keydown",h=>{let d=h.shiftKey?10:1,u=Number(o.getAttribute("aria-valuenow")),b=n?["ArrowUp"]:["ArrowLeft"],y=n?["ArrowDown"]:["ArrowRight"];b.includes(h.key)?(h.preventDefault(),l(u-d)):y.includes(h.key)?(h.preventDefault(),l(u+d)):h.key==="Home"?(h.preventDefault(),l(r)):h.key==="End"&&(h.preventDefault(),l(a))})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>tr()):tr();var Lo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Hi)&&Vi(s),s.querySelectorAll(Hi).forEach(Vi)}});Lo.observe(document.documentElement,{childList:!0,subtree:!0});var zi='input[type="checkbox"][data-switch]';function Ui(i){i.hasAttribute("data-switch-init")||(i.setAttribute("data-switch-init",""),i.setAttribute("role","switch"))}function er(i=document){i.querySelectorAll(zi).forEach(Ui)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>er()):er();var Mo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(zi)&&Ui(s),s.querySelectorAll(zi).forEach(n=>Ui(n))}});Mo.observe(document.documentElement,{childList:!0,subtree:!0});var ae=new Map,Wi=null,oe=!1;function No(i){for(let[t,e]of ae)i.querySelectorAll(t).forEach(e)}function Do(i){if(i.nodeType!==Node.ELEMENT_NODE)return;let t=i;for(let[e,s]of ae)t.matches(e)&&s(t),t.querySelectorAll(e).forEach(s)}function _o(){Wi||(Wi=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes)Do(e)}),Wi.observe(document.documentElement,{childList:!0,subtree:!0}))}function qo(){oe||(oe=!0,No(document))}function _(i,t){ae.set(i,t),_o(),oe||document.readyState!=="loading"?(oe=!0,document.querySelectorAll(i).forEach(t)):ae.size===1&&document.addEventListener("DOMContentLoaded",qo)}var $o="textarea[data-count]";function Io(i){if(i.hasAttribute("data-count-init"))return;i.setAttribute("data-count-init","");let t=i.dataset.count==="words",e=t?parseInt(i.dataset.maxwords??"0",10)||0:i.maxLength>0?i.maxLength:0,s=document.createElement("output");s.className="textarea-counter",s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true");let n=i.closest("form-field");n?n.appendChild(s):i.insertAdjacentElement("afterend",s);function r(){let a=i.value,o=t?a.trim()?a.trim().split(/\s+/).length:0:a.length;if(e>0){s.textContent=`${o} / ${e}`;let c=o/e;s.dataset.state=c>=1?"error":c>=.8?"warning":""}else{let c=t?o===1?"word":"words":o===1?"character":"characters";s.textContent=`${o} ${c}`,s.dataset.state=""}}i.addEventListener("input",r),r()}_($o,Io);var Oo="textarea[data-grow]",Bo=CSS.supports("field-sizing","content");function Po(i){if(i.hasAttribute("data-grow-init"))return;i.setAttribute("data-grow-init","");let t=parseInt(i.dataset.maxRows??"0",10)||0;if(i.style.resize="none",Bo){i.style.fieldSizing="content",t>0&&(i.style.maxBlockSize=`${t}lh`);return}i.style.overflow="hidden";function e(){i.style.blockSize="auto";let s=i.scrollHeight;if(t>0){let n=getComputedStyle(i),r=parseFloat(n.lineHeight)||parseFloat(n.fontSize)*1.2,a=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),o=r*t+a;s>o?(s=o,i.style.overflow="auto"):i.style.overflow="hidden"}i.style.blockSize=s+"px"}i.addEventListener("input",e),i.addEventListener("change",e),e()}_(Oo,Po);var ce="[data-show-when], [data-hide-when]";function ji(i){let t=i.indexOf("=");return t===-1?{name:i,value:null}:{name:i.slice(0,t),value:i.slice(t+1)}}function Fo(i,t){let e=t.querySelectorAll(`[name="${CSS.escape(i)}"]`);if(!e.length)return"";let s=e[0];if(s.type==="radio"){let n=Array.from(e).find(r=>r.checked);return n?n.value:""}return s.type==="checkbox"?s.checked?s.value||"true":"":s.value}function ir(i,t){let e=Fo(i.name,t);return i.value===null?e!=="":e===i.value}function le(i){let t=i.closest("form")||document,e;if(i.dataset.showWhen){let s=ji(i.dataset.showWhen);e=ir(s,t)}else if(i.dataset.hideWhen){let s=ji(i.dataset.hideWhen);e=!ir(s,t)}e?(i.removeAttribute("hidden"),i.removeAttribute("inert")):(i.setAttribute("hidden",""),i.setAttribute("inert",""))}function sr(i=document){let t=i.querySelectorAll(ce);t.forEach(n=>{n.hasAttribute("data-conditional-init")||(n.setAttribute("data-conditional-init",""),le(n))});let e=new Set;t.forEach(n=>{let r=n.closest("form");r&&!r.hasAttribute("data-conditional-listener")&&(r.setAttribute("data-conditional-listener",""),e.add(r))}),(e.size?[...e]:[document]).forEach(n=>{n.addEventListener("change",nr),n.addEventListener("input",nr)})}function nr(i){let t=i.target.name;if(!t)return;(i.target.closest("form")||document).querySelectorAll(ce).forEach(n=>{let r=n.dataset.showWhen||n.dataset.hideWhen||"";ji(r).name===t&&le(n)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>sr()):sr();var Ro=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ce)&&(s.hasAttribute("data-conditional-init")||(s.setAttribute("data-conditional-init",""),le(s))),s.querySelectorAll(ce).forEach(n=>{n.hasAttribute("data-conditional-init")||(n.setAttribute("data-conditional-init",""),le(n))})}});Ro.observe(document.documentElement,{childList:!0,subtree:!0});var Ho='input[type="range"][data-range]';function Vo(i){if(i.hasAttribute("data-range-init"))return;i.setAttribute("data-range-init","");let t=i.dataset.prefix||"",e=i.dataset.suffix||"",s=i.hasAttribute("data-bubble"),n=document.createElement("div");if(n.className="range-wrapper",!i.parentNode)return;i.parentNode.insertBefore(n,i),n.appendChild(i);function r(){let h=parseFloat(i.min)||0,d=parseFloat(i.max)||100,b=(parseFloat(i.value)-h)/(d-h)*100;n.style.setProperty("--range-pct",`${b}%`)}let a;s&&(a=document.createElement("output"),a.className="range-bubble",a.setAttribute("for",i.id||""),n.appendChild(a));function o(){if(!a)return;a.textContent=`${t}${i.value}${e}`;let h=parseFloat(i.min)||0,d=parseFloat(i.max)||100,u=(parseFloat(i.value)-h)/(d-h),b=i.offsetWidth,p=1.25*parseFloat(getComputedStyle(document.documentElement).fontSize),E=i.offsetLeft+p/2+u*(b-p);a.style.insetInlineStart=`${E}px`}if(i.hasAttribute("data-markers")){let h=parseFloat(i.min)||0,d=parseFloat(i.max)||100,u=parseFloat(i.step)||1,b=document.createElement("div");b.className="range-markers";let y=Math.round((d-h)/u);for(let p=0;p<=y;p++)b.appendChild(document.createElement("span"));n.appendChild(b)}let c=i.getAttribute("list");if(c){let h=document.getElementById(c);if(h){let d=document.createElement("div");d.className="range-labels";let u=parseFloat(i.min)||0,b=parseFloat(i.max)||100;requestAnimationFrame(()=>{let y=i.offsetWidth,E=1.25*parseFloat(getComputedStyle(document.documentElement).fontSize);Array.from(h.options).forEach(v=>{let T=document.createElement("span");T.textContent=v.label||v.value;let q=(parseFloat(v.value)-u)/(b-u),Bt=i.offsetLeft+E/2+q*(y-E);T.style.insetInlineStart=`${Bt}px`,d.appendChild(T)})}),n.appendChild(d)}}function l(){r(),o()}i.addEventListener("input",l),l()}_(Ho,Vo);var Yi='input[type="file"][data-upload]';function zo(i){if(i===0)return"0 B";let t=["B","KB","MB","GB"],e=Math.floor(Math.log(i)/Math.log(1024));return`${(i/Math.pow(1024,e)).toFixed(e>0?1:0)} ${t[e]}`}function Gi(i){if(i.hasAttribute("data-upload-init"))return;i.setAttribute("data-upload-init","");let t=i.hasAttribute("multiple"),e=i.getAttribute("accept")||"",s=document.createElement("div");if(s.className="upload-zone",s.setAttribute("role","presentation"),!i.parentNode)return;i.parentNode.insertBefore(s,i),s.appendChild(i);let n=document.createElement("div");n.className="upload-prompt",n.innerHTML=`
|
|
381
|
+
`}#s(){if(!this.hasSessionData)return'<p class="analytics-panel__empty">No data stored on this device in this session.</p>';let t=this.sessionCounter,e=this.queuedEvents,s=e.find(o=>o?.id==="__scroll"),n=e.find(o=>o?.id==="__attention"),r=e.filter(o=>!o?.id?.startsWith?.("__")).length,a=[];return t?.v!=null&&a.push(`<dt>Pages this session</dt><dd>${t.v}</dd>`),s&&a.push(`<dt>Max scroll depth</dt><dd>${s.params?.depth??"?"}%</dd>`),n&&a.push(`<dt>Active reading time</dt><dd>${lo(n.params?.ms)}</dd>`),r>0&&a.push(`<dt>Queued events</dt><dd>${r}</dd>`),`<dl class="analytics-panel__data">${a.join("")}</dl>`}};f("analytics-panel",Ei);var Ai=class extends m{static observedAttributes=["src","src-dark","src-compact","alt","wordmark","height"];#e="";#t=null;#i=null;setup(){this.#e=this.#c(),this.hasAttribute("src-dark")&&this.#s(),this.#a()}teardown(){this.#t?.removeEventListener("change",this.#r),this.#t=null,this.#i?.disconnect(),this.#i=null}attributeChangedCallback(t,e,s){e!==s&&(!this.isConnected||!this.hasAttribute("data-upgraded")||(t==="src-dark"&&(s?this.#s():(this.#t?.removeEventListener("change",this.#r),this.#i?.disconnect())),this.#a()))}#n(){let t=document.documentElement.getAttribute("data-mode");return t==="dark"?!0:t==="light"?!1:this.#t?.matches??!1}#s(){this.#t||(this.#t=matchMedia("(prefers-color-scheme: dark)"),this.#t.addEventListener("change",this.#r)),this.#i||(this.#i=new MutationObserver(this.#r),this.#i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode"]}))}#r=()=>{this.isConnected&&this.#a()};#a(){let t=this.getAttribute("src"),e=this.getAttribute("src-dark"),s=e&&this.#n()?e:t;if(!s){this.#e&&this.querySelector("img")&&(this.replaceChildren(document.createTextNode(this.#e)),this.removeAttribute("aria-label"));return}let n=this.#e||this.getAttribute("alt")||"",r=this.hasAttribute("wordmark"),a=this.getAttribute("height");if(this.querySelector("img")?.getAttribute("src")===s){let l=this.querySelector(".brand-mark-wordmark");if(r&&!l){let h=document.createElement("span");h.className="brand-mark-wordmark",h.textContent=n,this.appendChild(h)}else!r&&l&&l.remove();return}let c=document.createElement("img");if(c.src=s,c.alt=r?"":n,c.decoding="async",a&&(c.height=parseInt(a,10)),r){let l=document.createElement("span");l.className="brand-mark-wordmark",l.textContent=n,this.replaceChildren(c,l)}else this.replaceChildren(c),this.getAttribute("alt")||this.setAttribute("aria-label",n)}#c(){let t="";for(let e of this.childNodes)(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE&&e.tagName!=="IMG")&&(t+=e.textContent);return t.trim()}};f("brand-mark",Ai);var ho="52rem",Si=class extends HTMLElement{#e=null;connectedCallback(){let t=this.getAttribute("breakpoint")||ho;this.#e=matchMedia(`(max-width: ${t})`),this.#e.addEventListener("change",this.#t),this.#t()}disconnectedCallback(){this.#e?.removeEventListener("change",this.#t),this.#e=null}#t=()=>{let t=this.#e?.matches??!1;if(t)this.setAttribute("data-mobile","");else{this.removeAttribute("data-mobile");let s=this.querySelector("[popover]");s?.matches(":popover-open")&&s.hidePopover()}let e=this.closest("header");if(e)for(let s of e.children)s!==this&&s.matches("nav, site-tools")&&(s.style.display=t?"none":"")}};customElements.get("mobile-menu")||customElements.define("mobile-menu",Si);var L="interestfor",Hn="interestForElement"in HTMLButtonElement.prototype,x=new WeakMap,pt=new WeakMap,se=new Set,xi=!1,Ti=CSS.supports?.("anchor-name","--a")??!1;function Bn(i){let t=String(i).trim(),e=t.match(/^([\d.]+)s$/);if(e)return parseFloat(e[1])*1e3;let s=t.match(/^([\d.]+)ms$/);return s?parseFloat(s[1]):parseFloat(t)||0}function Vn(i,t){let e=getComputedStyle(i),s=e.getPropertyValue(t).trim();if(s.toLowerCase()!=="normal")return Bn(s);let n=e.getPropertyValue("--interest-delay").trim();if(n&&n.toLowerCase()!=="normal"){let r=n.split(/\s+/).filter(a=>a.length>0);if(r.length>0){let a=t==="--interest-delay-start"?r[0]:r[1]||r[0];if(a.toLowerCase()!=="normal")return Bn(a)}}return t==="--interest-delay-start"?500:250}var uo=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex="-1"])'].join(","),po="h1,h2,h3,h4,h5,h6,ul,ol,li,table,nav,header,footer,main,aside,article,section,form,blockquote,details,summary,dialog";function Li(i){if(i.getAttribute("popover")?.toLowerCase()!=="hint"||i.querySelector(uo)||i.querySelector(po))return!1;for(let t of i.querySelectorAll("[role]")){let e=t.getAttribute("role").toLowerCase();if(!["presentation","none","generic","image"].includes(e))return!1}return!0}function fo(i,t){Li(t)?i.setAttribute("aria-describedby",t.id):(i.setAttribute("aria-details",t.id),i.setAttribute("aria-expanded","false"),t.hasAttribute("role")||t.setAttribute("role","tooltip"))}function H(i){let t=i.getAttribute(L);return t?document.getElementById(t):null}function ie(i){let t=pt.get(i);return t?.invoker&&x.get(t.invoker)?.state==="full"?t.invoker:null}function _t(i){if(x.has(i))return x.get(i);let t={state:"none",gainedTimer:null,lostTimer:null,longPressTimer:null};x.set(i,t);let e=H(i);return e&&fo(i,e),t}function zn(i,t){if(!i||!t||!i.isConnected||H(i)!==t)return!1;let e=ie(t);if(e){if(e===i)return clearTimeout(x.get(e).lostTimer),!1;if(!Dt(e,t)||!i.isConnected||H(i)!==t)return!1}let s=_t(i);if(s.state!=="none")return!1;let n=new CustomEvent("interest",{bubbles:!1,cancelable:!0,detail:{source:i}});if(t.dispatchEvent(n),t.hasAttribute("popover")){try{t.showPopover()}catch{}bo(i,t)}s.state="full",pt.has(t)||pt.set(t,{});let r=pt.get(t);if(r.invoker=i,t.hasAttribute("popover")){let a=o=>{o.newState==="closed"&&Dt(i,t)};r.toggleListener=a,t.addEventListener("toggle",a)}return se.add(i),i.classList.add("interest-source"),t.classList.add("interest-target"),Li(t)||i.setAttribute("aria-expanded","true"),!0}function Dt(i,t){if(!i||!t||H(i)!==t||ie(t)!==i)return!1;let e=x.get(i);if(!e||e.state==="none")return!1;if(clearTimeout(e.gainedTimer),clearTimeout(e.lostTimer),t.dispatchEvent(new CustomEvent("loseinterest",{bubbles:!1,detail:{source:i}})),t.hasAttribute("popover"))try{t.hidePopover()}catch{}let s=pt.get(t);return s?.toggleListener&&t.removeEventListener("toggle",s.toggleListener),pt.delete(t),se.delete(i),i.classList.remove("interest-source"),t.classList.remove("interest-target"),Li(t)||i.setAttribute("aria-expanded","false"),e.state="none",!0}function mo(i){let t=_t(i);clearTimeout(t.gainedTimer);let e=Vn(i,"--interest-delay-start");t.gainedTimer=setTimeout(()=>{let s=H(i);s&&zn(i,s)},e)}function Ci(i){let t=x.get(i);if(!t)return;clearTimeout(t.lostTimer);let e=Vn(i,"--interest-delay-end");t.lostTimer=setTimeout(()=>{let s=H(i);s&&Dt(i,s)},e)}function Nt(i){if(!Ti)return;let t=i.getAttribute(L),e=t?document.getElementById(t):null;if(!e?.id)return;let s=`--interest-${e.id}`;i.style.anchorName=s,e.style.positionAnchor=s}function bo(i,t){if(Ti)return;let e=i.getBoundingClientRect(),s=t.getBoundingClientRect(),n=8,r=8,a=e.top-s.height-n,o=e.left+(e.width-s.width)/2;a<r&&(a=e.bottom+n),o=Math.max(r,Math.min(o,window.innerWidth-s.width-r)),a=Math.max(r,Math.min(a,window.innerHeight-s.height-r)),t.style.top=`${a}px`,t.style.left=`${o}px`,t.style.margin="0"}function go(i,t){if(xi||!i.isConnected)return;if(!H(i)){let r=i.closest(".interest-target");if(r){let a=ie(r);a&&(t?clearTimeout(x.get(a)?.lostTimer):Ci(a))}return}let s=_t(i),n=ie(i);if(t)clearTimeout(s.lostTimer),n&&clearTimeout(x.get(n)?.lostTimer),mo(i);else if(clearTimeout(s.gainedTimer),s.state!=="none"&&Ci(i),n){let r=x.get(n);r&&clearTimeout(r.gainedTimer),Ci(n)}}function yo(){let i=(s,n)=>{for(let r=s.target;r;r=r.parentElement)go(r,n)};document.body.addEventListener("mouseover",s=>i(s,!0)),document.body.addEventListener("mouseout",s=>i(s,!1)),document.body.addEventListener("focusin",s=>i(s,!0)),document.body.addEventListener("focusout",s=>i(s,!1)),document.body.addEventListener("keydown",s=>{if(s.key==="Escape")for(let n of se){let r=H(n);r&&Dt(n,r)}});let t=500;document.body.addEventListener("touchstart",s=>{xi=!0;let n=s.target.closest(`button[${L}]`);if(!n)return;let r=_t(n);r.longPressTimer=setTimeout(()=>{let a=H(n);a&&zn(n,a),r.longPressTimer=null},t)});let e=s=>{let n=s.target.closest(`button[${L}]`);if(!n)return;let r=x.get(n);r?.longPressTimer&&(clearTimeout(r.longPressTimer),r.longPressTimer=null)};document.body.addEventListener("touchend",s=>{e(s),xi=!1}),document.body.addEventListener("touchmove",e)}function vo(){let i=document.createElement("style");i.textContent=['@property --interest-delay-start { syntax: "normal | <time>"; inherits: false; initial-value: normal; }','@property --interest-delay-end { syntax: "normal | <time>"; inherits: false; initial-value: normal; }','@property --interest-delay { syntax: "*"; inherits: false; initial-value: normal; }'].join(`
|
|
382
|
+
`),document.head.appendChild(i)}function ee(i){_t(i),Nt(i)}function ki(i){let t=x.get(i);if(t){if(clearTimeout(t.gainedTimer),clearTimeout(t.lostTimer),clearTimeout(t.longPressTimer),t.state!=="none"){let e=H(i);e&&Dt(i,e)}i.classList.remove("interest-source"),x.delete(i),se.delete(i)}}function Fn(i=document){i.querySelectorAll(`[${L}]`).forEach(ee)}var Rn=new MutationObserver(i=>{for(let t of i){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.hasAttribute(L)&&ee(s),s.querySelectorAll(`[${L}]`).forEach(ee)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;x.has(s)&&ki(s),s.querySelectorAll(`[${L}]`).forEach(n=>{x.has(n)&&ki(n)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.hasAttribute(L)?x.has(e)||ee(e):x.has(e)&&ki(e)}}});Hn||(vo(),yo(),document.documentElement.setAttribute("data-interest-polyfill",""),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Fn(),Rn.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[L]})}):(Fn(),Rn.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[L]})));if(Hn&&Ti){let i=()=>{document.querySelectorAll(`[${L}]`).forEach(Nt),new MutationObserver(t=>{for(let e of t){for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.hasAttribute(L)&&Nt(n),n.querySelectorAll(`[${L}]`).forEach(Nt)}e.type==="attributes"&&e.target.hasAttribute?.(L)&&Nt(e.target)}}).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[L]})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i()}var Mi="[data-copy], [data-copy-target]";function Un(i=document){i.querySelectorAll(Mi).forEach(Ni)}function Ni(i){if(i.hasAttribute("data-copy-init"))return;i.setAttribute("data-copy-init","");let t;i.addEventListener("click",async()=>{let e=wo(i);if(e)try{await navigator.clipboard.writeText(e),i.dataset.state="copied",clearTimeout(t),t=setTimeout(()=>{delete i.dataset.state},1500),Eo("Copied to clipboard",i),i.dispatchEvent(new CustomEvent("copy",{bubbles:!0,detail:{text:e}}))}catch{}})}function wo(i){return i.dataset.copy?i.dataset.copy:i.dataset.copyTarget?document.querySelector(i.dataset.copyTarget)?.textContent??"":""}function Eo(i,t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="visually-hidden",e.textContent=i,t.appendChild(e),setTimeout(()=>e.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Un()):Un();var Ao=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Mi)&&Ni(s),s.querySelectorAll(Mi).forEach(n=>Ni(n))}});Ao.observe(document.documentElement,{childList:!0,subtree:!0});var Di="kbd[data-hotkey]";function Wn(i=document){i.querySelectorAll(Di).forEach(_i)}function _i(i){if(i.hasAttribute("data-hotkey-init"))return;i.setAttribute("data-hotkey-init","");let t=i.dataset.hotkey;if(!t)return;let e=lt?vt.mac:vt.other,s=t.toLowerCase().split("+").map(r=>r.trim()),n=document.createDocumentFragment();s.forEach((r,a)=>{let o=document.createElement("kbd");o.textContent=e[r]??r.toUpperCase(),n.appendChild(o),a<s.length-1&&!lt&&n.appendChild(document.createTextNode("+"))}),i.replaceChildren(n),i.setAttribute("aria-label",i.textContent)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Wn()):Wn();var So=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Di)&&_i(s),s.querySelectorAll(Di).forEach(n=>_i(n))}});So.observe(document.documentElement,{childList:!0,subtree:!0});function ft(){return document.documentElement.lang||navigator.language||"en"}var qi="data[data-format-number]";function jn(i=document){i.querySelectorAll(qi).forEach($i)}function $i(i){if(i.hasAttribute("data-format-number-init"))return;i.setAttribute("data-format-number-init","");let t=i.getAttribute("value");if(t==null)return;let e=Number(t);if(isNaN(e))return;i.title||(i.title=i.textContent.trim());let s=i.getAttribute("data-format-number")||"decimal",n=i.getAttribute("data-locale")||ft(),r={};switch(s){case"currency":{r.style="currency",r.currency=i.getAttribute("data-currency")||"USD";break}case"percent":r.style="percent";break;case"compact":r.notation="compact";break;default:break}try{i.textContent=new Intl.NumberFormat(n,r).format(e)}catch{}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>jn()):jn();var Co=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(qi)&&$i(s),s.querySelectorAll(qi).forEach(n=>$i(n))}});Co.observe(document.documentElement,{childList:!0,subtree:!0});var ne="time[data-format-date]",qt=new Map;function Yn(i=document){i.querySelectorAll(ne).forEach(Oi)}function Oi(i){if(i.hasAttribute("data-format-date-init"))return;i.setAttribute("data-format-date-init","");let t=i.getAttribute("datetime");if(!t)return;let e=new Date(t);if(isNaN(e.getTime()))return;i.title||(i.title=i.textContent.trim());let s=i.getAttribute("data-format-date")||"medium",n=i.getAttribute("data-locale")||ft();s==="relative"?(i.textContent=Kn(e,n),Xn(i,e,n)):i.textContent=ko(e,s,i,n)}function ko(i,t,e,s){let n=t||"medium",r=e.getAttribute("data-format-time")||void 0;try{let a={dateStyle:n};return r&&(a.timeStyle=r),new Intl.DateTimeFormat(s,a).format(i)}catch{return e.textContent}}function Kn(i,t){let e=Date.now(),s=Math.round((i.getTime()-e)/1e3),n=Math.abs(s),r=[{unit:"year",seconds:31536e3},{unit:"month",seconds:2592e3},{unit:"week",seconds:604800},{unit:"day",seconds:86400},{unit:"hour",seconds:3600},{unit:"minute",seconds:60},{unit:"second",seconds:1}];for(let{unit:a,seconds:o}of r)if(n>=o){let c=Math.round(s/o);try{return new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(c,a)}catch{let l=Math.abs(c),h=l===1?a:`${a}s`;return c<0?`${l} ${h} ago`:`in ${l} ${h}`}}try{return new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(0,"second")}catch{return"just now"}}function Xn(i,t,e){clearInterval(qt.get(i));let s=Math.abs(Date.now()-t.getTime()),n=36e5,r=864e5,a;s<n?a=6e4:s<r?a=3e5:a=36e5;let o=setInterval(()=>{i.textContent=Kn(t,e),Xn(i,t,e)},a);qt.set(i,o)}function Gn(i){qt.has(i)&&(clearInterval(qt.get(i)),qt.delete(i))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Yn()):Yn();var xo=new MutationObserver(i=>{for(let t of i){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ne)&&Oi(s),s.querySelectorAll(ne).forEach(n=>Oi(n))}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;Gn(s),s.querySelectorAll(ne).forEach(Gn)}}});xo.observe(document.documentElement,{childList:!0,subtree:!0});var Pi="data[data-format-bytes]",Ii=["B","KB","MB","GB","TB","PB"];function Jn(i=document){i.querySelectorAll(Pi).forEach(Bi)}function Bi(i){if(i.hasAttribute("data-format-bytes-init"))return;i.setAttribute("data-format-bytes-init","");let t=i.getAttribute("value");if(t==null)return;let e=Number(t);if(isNaN(e)||e<0)return;i.title||(i.title=i.textContent.trim());let s=parseInt(i.getAttribute("data-format-bytes")??"0",10)||0,n=i.getAttribute("data-unit")==="decimal",r=i.getAttribute("data-locale")||ft(),a=n?1e3:1024;if(e===0){i.textContent="0 B";return}let o=Math.min(Math.floor(Math.log(e)/Math.log(a)),Ii.length-1),c=e/Math.pow(a,o);try{let l=new Intl.NumberFormat(r,{minimumFractionDigits:s,maximumFractionDigits:s}).format(c);i.textContent=`${l} ${Ii[o]}`}catch{i.textContent=`${c.toFixed(s)} ${Ii[o]}`}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Jn()):Jn();var To=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Pi)&&Bi(s),s.querySelectorAll(Pi).forEach(n=>Bi(n))}});To.observe(document.documentElement,{childList:!0,subtree:!0});var Fi="[data-spoiler]";var tr=new Set(["SPAN","EM","STRONG","CODE","A","B","I","S","U","SMALL","SUB","SUP","MARK","ABBR","Q","CITE","DFN","SAMP","VAR","KBD","BDI","BDO","DATA","TIME","WBR"]);function Zn(i=document){i.querySelectorAll(Fi).forEach(Ri)}function Ri(i){if(i.hasAttribute("data-spoiler-init"))return;i.setAttribute("data-spoiler-init","");let t=i.getAttribute("data-spoiler")||"blur";i.getAttribute("data-spoiler")||i.setAttribute("data-spoiler","blur");let e=tr.has(i.tagName),s=e?"span":"div";i.setAttribute("role","group"),i.setAttribute("aria-label","Spoiler");let n=document.createElement(s);for(n.setAttribute("data-spoiler-content",""),n.setAttribute("inert","");i.firstChild;)n.appendChild(i.firstChild);i.appendChild(n);let r=i.getAttribute("data-spoiler-label")||"Reveal spoiler",a;e?(a=document.createElement("span"),a.setAttribute("role","button"),a.setAttribute("tabindex","0")):(a=document.createElement("button"),a.setAttribute("type","button")),a.setAttribute("data-spoiler-trigger",""),a.setAttribute("aria-expanded","false");let o=document.createElement("span");o.setAttribute("data-spoiler-label",""),o.textContent=r,a.appendChild(o),i.appendChild(a),a.addEventListener("click",()=>Qn(i)),e&&a.addEventListener("keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),Qn(i))}),i.addEventListener("keydown",c=>{c.key==="Escape"&&i.hasAttribute("data-spoiler-visible")&&(c.stopPropagation(),re(i))})}function Qn(i){let t=i.getAttribute("data-spoiler-group");t&&document.querySelectorAll(`[data-spoiler-group="${t}"][data-spoiler-visible]`).forEach(n=>{n!==i&&re(n)});let e=i.querySelector("[data-spoiler-content]"),s=i.querySelector("[data-spoiler-trigger]");if(e&&e.removeAttribute("inert"),s&&(s.setAttribute("aria-expanded","true"),s.hidden=!0),i.setAttribute("data-spoiler-visible",""),!i.hasAttribute("data-spoiler-persist")){let n=tr.has(i.tagName),r;n?(r=document.createElement("span"),r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),re(i))})):(r=document.createElement("button"),r.setAttribute("type","button")),r.setAttribute("data-spoiler-hide",""),r.textContent="Hide",r.addEventListener("click",()=>re(i)),i.appendChild(r)}Lo("Spoiler revealed"),i.dispatchEvent(new CustomEvent("spoiler:toggle",{bubbles:!0,detail:{visible:!0}}))}function re(i){if(i.hasAttribute("data-spoiler-persist"))return;let t=i.querySelector("[data-spoiler-content]"),e=i.querySelector("[data-spoiler-trigger]"),s=i.querySelector("[data-spoiler-hide]");t&&t.setAttribute("inert",""),e&&(e.setAttribute("aria-expanded","false"),e.hidden=!1,e.focus()),s&&s.remove(),i.removeAttribute("data-spoiler-visible"),i.dispatchEvent(new CustomEvent("spoiler:toggle",{bubbles:!0,detail:{visible:!1}}))}function Lo(i){let t=document.createElement("div");t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:"0"}),t.textContent=i,document.body.appendChild(t),setTimeout(()=>t.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Zn()):Zn();var Mo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Fi)&&Ri(s),s.querySelectorAll(Fi).forEach(Ri)}});Mo.observe(document.documentElement,{childList:!0,subtree:!0});var Hi="[data-splitter]";function er(i=document){i.querySelectorAll(Hi).forEach(Vi)}function Vi(i){if(i.hasAttribute("data-splitter-init"))return;i.setAttribute("data-splitter-init","");let t=[...i.children];if(t.length<2)return;let e=t[0],s=t[1],n=i.getAttribute("data-splitter")==="vertical",r=Number(e.dataset.min)||10,a=Number(e.dataset.max)||90,o=document.createElement("div");o.className="split-divider",o.setAttribute("role","separator"),o.setAttribute("aria-orientation",n?"vertical":"horizontal"),o.setAttribute("aria-valuenow","50"),o.setAttribute("aria-valuemin",String(r)),o.setAttribute("aria-valuemax",String(a)),o.setAttribute("aria-label","Resize panels"),o.setAttribute("tabindex","0"),i.insertBefore(o,s),e.style.flexBasis="50%",e.style.flexGrow="0",e.style.flexShrink="0",e.style.overflow="auto",s.style.flexGrow="1",s.style.overflow="auto";let c=!1;function l(h){let d=Math.min(a,Math.max(r,h));e.style.flexBasis=`${d}%`,o.setAttribute("aria-valuenow",String(Math.round(d))),i.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:d},bubbles:!0}))}o.addEventListener("pointerdown",h=>{h.preventDefault(),c=!0,o.setPointerCapture(h.pointerId),i.style.userSelect="none"}),o.addEventListener("pointermove",h=>{if(!c)return;let d=i.getBoundingClientRect(),u;n?u=(h.clientY-d.top)/d.height*100:u=(h.clientX-d.left)/d.width*100,l(u)}),o.addEventListener("pointerup",h=>{c=!1,o.releasePointerCapture(h.pointerId),i.style.userSelect=""}),o.addEventListener("keydown",h=>{let d=h.shiftKey?10:1,u=Number(o.getAttribute("aria-valuenow")),b=n?["ArrowUp"]:["ArrowLeft"],y=n?["ArrowDown"]:["ArrowRight"];b.includes(h.key)?(h.preventDefault(),l(u-d)):y.includes(h.key)?(h.preventDefault(),l(u+d)):h.key==="Home"?(h.preventDefault(),l(r)):h.key==="End"&&(h.preventDefault(),l(a))})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>er()):er();var No=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Hi)&&Vi(s),s.querySelectorAll(Hi).forEach(Vi)}});No.observe(document.documentElement,{childList:!0,subtree:!0});var zi='input[type="checkbox"][data-switch]';function Ui(i){i.hasAttribute("data-switch-init")||(i.setAttribute("data-switch-init",""),i.setAttribute("role","switch"))}function ir(i=document){i.querySelectorAll(zi).forEach(Ui)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ir()):ir();var Do=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(zi)&&Ui(s),s.querySelectorAll(zi).forEach(n=>Ui(n))}});Do.observe(document.documentElement,{childList:!0,subtree:!0});var ae=new Map,Wi=null,oe=!1;function _o(i){for(let[t,e]of ae)i.querySelectorAll(t).forEach(e)}function qo(i){if(i.nodeType!==Node.ELEMENT_NODE)return;let t=i;for(let[e,s]of ae)t.matches(e)&&s(t),t.querySelectorAll(e).forEach(s)}function $o(){Wi||(Wi=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes)qo(e)}),Wi.observe(document.documentElement,{childList:!0,subtree:!0}))}function Oo(){oe||(oe=!0,_o(document))}function _(i,t){ae.set(i,t),$o(),oe||document.readyState!=="loading"?(oe=!0,document.querySelectorAll(i).forEach(t)):ae.size===1&&document.addEventListener("DOMContentLoaded",Oo)}var Io="textarea[data-count]";function Po(i){if(i.hasAttribute("data-count-init"))return;i.setAttribute("data-count-init","");let t=i.dataset.count==="words",e=t?parseInt(i.dataset.maxwords??"0",10)||0:i.maxLength>0?i.maxLength:0,s=document.createElement("output");s.className="textarea-counter",s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true");let n=i.closest("form-field");n?n.appendChild(s):i.insertAdjacentElement("afterend",s);function r(){let a=i.value,o=t?a.trim()?a.trim().split(/\s+/).length:0:a.length;if(e>0){s.textContent=`${o} / ${e}`;let c=o/e;s.dataset.state=c>=1?"error":c>=.8?"warning":""}else{let c=t?o===1?"word":"words":o===1?"character":"characters";s.textContent=`${o} ${c}`,s.dataset.state=""}}i.addEventListener("input",r),r()}_(Io,Po);var Bo="textarea[data-grow]",Fo=CSS.supports("field-sizing","content");function Ro(i){if(i.hasAttribute("data-grow-init"))return;i.setAttribute("data-grow-init","");let t=parseInt(i.dataset.maxRows??"0",10)||0;if(i.style.resize="none",Fo){i.style.fieldSizing="content",t>0&&(i.style.maxBlockSize=`${t}lh`);return}i.style.overflow="hidden";function e(){i.style.blockSize="auto";let s=i.scrollHeight;if(t>0){let n=getComputedStyle(i),r=parseFloat(n.lineHeight)||parseFloat(n.fontSize)*1.2,a=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),o=r*t+a;s>o?(s=o,i.style.overflow="auto"):i.style.overflow="hidden"}i.style.blockSize=s+"px"}i.addEventListener("input",e),i.addEventListener("change",e),e()}_(Bo,Ro);var ce="[data-show-when], [data-hide-when]";function ji(i){let t=i.indexOf("=");return t===-1?{name:i,value:null}:{name:i.slice(0,t),value:i.slice(t+1)}}function Ho(i,t){let e=t.querySelectorAll(`[name="${CSS.escape(i)}"]`);if(!e.length)return"";let s=e[0];if(s.type==="radio"){let n=Array.from(e).find(r=>r.checked);return n?n.value:""}return s.type==="checkbox"?s.checked?s.value||"true":"":s.value}function sr(i,t){let e=Ho(i.name,t);return i.value===null?e!=="":e===i.value}function le(i){let t=i.closest("form")||document,e;if(i.dataset.showWhen){let s=ji(i.dataset.showWhen);e=sr(s,t)}else if(i.dataset.hideWhen){let s=ji(i.dataset.hideWhen);e=!sr(s,t)}e?(i.removeAttribute("hidden"),i.removeAttribute("inert")):(i.setAttribute("hidden",""),i.setAttribute("inert",""))}function nr(i=document){let t=i.querySelectorAll(ce);t.forEach(n=>{n.hasAttribute("data-conditional-init")||(n.setAttribute("data-conditional-init",""),le(n))});let e=new Set;t.forEach(n=>{let r=n.closest("form");r&&!r.hasAttribute("data-conditional-listener")&&(r.setAttribute("data-conditional-listener",""),e.add(r))}),(e.size?[...e]:[document]).forEach(n=>{n.addEventListener("change",rr),n.addEventListener("input",rr)})}function rr(i){let t=i.target.name;if(!t)return;(i.target.closest("form")||document).querySelectorAll(ce).forEach(n=>{let r=n.dataset.showWhen||n.dataset.hideWhen||"";ji(r).name===t&&le(n)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>nr()):nr();var Vo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ce)&&(s.hasAttribute("data-conditional-init")||(s.setAttribute("data-conditional-init",""),le(s))),s.querySelectorAll(ce).forEach(n=>{n.hasAttribute("data-conditional-init")||(n.setAttribute("data-conditional-init",""),le(n))})}});Vo.observe(document.documentElement,{childList:!0,subtree:!0});var zo='input[type="range"][data-range]';function Uo(i){if(i.hasAttribute("data-range-init"))return;i.setAttribute("data-range-init","");let t=i.dataset.prefix||"",e=i.dataset.suffix||"",s=i.hasAttribute("data-bubble"),n=document.createElement("div");if(n.className="range-wrapper",!i.parentNode)return;i.parentNode.insertBefore(n,i),n.appendChild(i);function r(){let h=parseFloat(i.min)||0,d=parseFloat(i.max)||100,b=(parseFloat(i.value)-h)/(d-h)*100;n.style.setProperty("--range-pct",`${b}%`)}let a;s&&(a=document.createElement("output"),a.className="range-bubble",a.setAttribute("for",i.id||""),n.appendChild(a));function o(){if(!a)return;a.textContent=`${t}${i.value}${e}`;let h=parseFloat(i.min)||0,d=parseFloat(i.max)||100,u=(parseFloat(i.value)-h)/(d-h),b=i.offsetWidth,p=1.25*parseFloat(getComputedStyle(document.documentElement).fontSize),E=i.offsetLeft+p/2+u*(b-p);a.style.insetInlineStart=`${E}px`}if(i.hasAttribute("data-markers")){let h=parseFloat(i.min)||0,d=parseFloat(i.max)||100,u=parseFloat(i.step)||1,b=document.createElement("div");b.className="range-markers";let y=Math.round((d-h)/u);for(let p=0;p<=y;p++)b.appendChild(document.createElement("span"));n.appendChild(b)}let c=i.getAttribute("list");if(c){let h=document.getElementById(c);if(h){let d=document.createElement("div");d.className="range-labels";let u=parseFloat(i.min)||0,b=parseFloat(i.max)||100;requestAnimationFrame(()=>{let y=i.offsetWidth,E=1.25*parseFloat(getComputedStyle(document.documentElement).fontSize);Array.from(h.options).forEach(v=>{let T=document.createElement("span");T.textContent=v.label||v.value;let q=(parseFloat(v.value)-u)/(b-u),Pt=i.offsetLeft+E/2+q*(y-E);T.style.insetInlineStart=`${Pt}px`,d.appendChild(T)})}),n.appendChild(d)}}function l(){r(),o()}i.addEventListener("input",l),l()}_(zo,Uo);var Yi='input[type="file"][data-upload]';function Wo(i){if(i===0)return"0 B";let t=["B","KB","MB","GB"],e=Math.floor(Math.log(i)/Math.log(1024));return`${(i/Math.pow(1024,e)).toFixed(e>0?1:0)} ${t[e]}`}function Gi(i){if(i.hasAttribute("data-upload-init"))return;i.setAttribute("data-upload-init","");let t=i.hasAttribute("multiple"),e=i.getAttribute("accept")||"",s=document.createElement("div");if(s.className="upload-zone",s.setAttribute("role","presentation"),!i.parentNode)return;i.parentNode.insertBefore(s,i),s.appendChild(i);let n=document.createElement("div");n.className="upload-prompt",n.innerHTML=`
|
|
383
383
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
384
384
|
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
|
385
385
|
<polyline points="17 8 12 3 7 8"/>
|
|
@@ -388,11 +388,11 @@ svg {
|
|
|
388
388
|
<span>Drag files here or <button type="button" class="upload-browse">browse</button></span>
|
|
389
389
|
${e?`<small>${e.replace(/\./g,"").toUpperCase().replace(/,/g,", ")}</small>`:""}
|
|
390
390
|
`,s.appendChild(n);let r=document.createElement("ul");r.className="upload-file-list",r.setAttribute("aria-label","Selected files"),s.appendChild(r);let a=n.querySelector(".upload-browse");if(!a)return;a.addEventListener("click",()=>i.click()),s.addEventListener("click",c=>{(c.target===s||c.target===n||c.target.closest(".upload-prompt"))&&i.click()});let o=0;s.addEventListener("dragenter",c=>{c.preventDefault(),o++,s.dataset.dragover=""}),s.addEventListener("dragleave",()=>{o--,o===0&&delete s.dataset.dragover}),s.addEventListener("dragover",c=>{c.preventDefault()}),s.addEventListener("drop",c=>{c.preventDefault(),o=0,delete s.dataset.dragover,c.dataTransfer&&c.dataTransfer.files.length&&(i.files=c.dataTransfer.files,i.dispatchEvent(new Event("change",{bubbles:!0})))}),i.addEventListener("change",()=>{r.innerHTML="";let c=Array.from(i.files??[]);if(c.length===0){r.hidden=!0;return}r.hidden=!1,c.forEach(l=>{let h=document.createElement("li");h.innerHTML=`
|
|
391
|
-
<span class="upload-file-name">${
|
|
392
|
-
<span class="upload-file-size">${
|
|
393
|
-
`,r.appendChild(h)})})}function Uo(i){let t=document.createElement("div");return t.textContent=i,t.innerHTML}function rr(i=document){i.querySelectorAll(Yi).forEach(Gi)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>rr()):rr();var Wo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Yi)&&Gi(s),s.querySelectorAll(Yi).forEach(n=>Gi(n))}});Wo.observe(document.documentElement,{childList:!0,subtree:!0});W();var Xi="form[data-autosave]",Ki="autosave",ar=500,jo=1440*60*1e3;function Ji(i){if(i.hasAttribute("data-autosave-init"))return;i.setAttribute("data-autosave-init","");let t=i.dataset.autosave,e;function s(){let c={},l=i.elements;for(let h of l){let d=h;d.name&&(d.type==="password"||d.type==="file"||(d.type==="checkbox"?c[d.name]=d.checked?"on":"":d.type==="radio"?d.checked&&(c[d.name]=d.value):c[d.name]=d.value))}return c}function n(){w.set(Ki,t,s()).catch(()=>{})}async function r(){let c=await w.get(Ki,t,{maxAge:jo});if(!c)return!1;let l=!1;for(let[h,d]of Object.entries(c)){let u=i.querySelectorAll(`[name="${CSS.escape(h)}"]`);u.forEach(b=>{let y=b;y.type==="checkbox"?y.checked=d==="on":y.type==="radio"?y.checked=y.value===d:y.value=d}),u.length&&(l=!0)}return l}function a(){w.remove(Ki,t).catch(()=>{})}function o(){if(customElements.get("toast-msg")){let c=document.createElement("toast-msg");c.setAttribute("variant","info"),c.setAttribute("duration","3000"),c.textContent="Draft restored",document.body.appendChild(c)}}r().then(c=>{c&&(o(),Array.from(i.elements).forEach(l=>{let h=l;h.name&&h.type!=="password"&&h.type!=="file"&&h.dispatchEvent(new Event("input",{bubbles:!0}))}))}),i.addEventListener("input",()=>{clearTimeout(e),e=setTimeout(n,ar)}),i.addEventListener("change",()=>{clearTimeout(e),e=setTimeout(n,ar)}),i.addEventListener("submit",a),i.addEventListener("reset",()=>{setTimeout(a,0)})}function or(i=document){i.querySelectorAll(Xi).forEach(Ji)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>or()):or();var Yo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Xi)&&Ji(s),s.querySelectorAll(Xi).forEach(Ji)}});Yo.observe(document.documentElement,{childList:!0,subtree:!0});var Go="input[data-mask]",cr={phone:{pattern:"(###) ###-####",accept:/\d/},"credit-card":{pattern:"#### #### #### ####",accept:/\d/},date:{pattern:"##/##/####",accept:/\d/},ssn:{pattern:"###-##-####",accept:/\d/},zip:{pattern:"#####",accept:/\d/}},Ko={"#":/\d/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/};function Xo(i){let t=i.dataset.mask;if(cr[t])return cr[t];if(t==="custom"&&i.dataset.pattern){let e=i.dataset.pattern,s=new Set;for(let r of e)r==="#"?s.add("0-9"):r==="A"?s.add("a-zA-Z"):r==="*"&&s.add("a-zA-Z0-9");let n=s.size>0?new RegExp(`[${[...s].join("")}]`):/./;return{pattern:e,accept:n}}return null}function he(i){return i==="#"||i==="A"||i==="*"}function Jo(i,t){let e=Ko[i];return e?e.test(t):!1}function lr(i,t){let e="",s=0;for(let n=0;n<t.length&&s<i.length;n++){let r=t[n];if(he(r)){for(;s<i.length&&!Jo(r,i[s]);)s++;s<i.length&&(e+=i[s],s++)}else e+=r}return e}function hr(i,t){return i.split("").filter(e=>t.test(e)).join("")}function Zo(i){for(let t of i)if(he(t)&&t!=="#")return!1;return!0}function Qo(i){if(i.hasAttribute("data-mask-init"))return;i.setAttribute("data-mask-init","");let t=Xo(i);if(!t)return;let{pattern:e}=t,s=t.accept;Zo(e)&&!i.getAttribute("inputmode")&&i.setAttribute("inputmode","numeric"),i.getAttribute("maxlength")||i.setAttribute("maxlength",String(e.length));let n=!1;i.addEventListener("compositionstart",()=>{n=!0}),i.addEventListener("compositionend",()=>{n=!1,r()});function r(){if(n)return;let a=i.selectionStart??0,o=0;for(let u=0;u<a&&u<i.value.length;u++)s.test(i.value[u])&&o++;let c=hr(i.value,s),l=lr(c,e);i.value=l,i.dataset.rawValue=c;let h=0,d=l.length;for(let u=0;u<l.length;u++)if(u<e.length&&he(e[u])&&(h++,h===o)){for(d=u+1;d<e.length&&!he(e[d]);)d++;break}i.setSelectionRange(d,d)}if(i.addEventListener("input",r),i.value){let a=hr(i.value,s);i.value=lr(a,e),i.dataset.rawValue=a}}_(Go,Qo);var tc="input[data-accept]",ec={digits:{pattern:"[0-9]",inputmode:"numeric"},alpha:{pattern:"[a-zA-Z]",inputmode:"text"},alphanum:{pattern:"[a-zA-Z0-9]",inputmode:"text"},phone:{pattern:"[0-9+()\\- ]",inputmode:"tel"},date:{pattern:"[0-9/\\-.]",inputmode:"numeric"},hex:{pattern:"[0-9a-fA-F]",inputmode:"text"},currency:{pattern:"[0-9.,]",inputmode:"decimal"},cc:{pattern:"[0-9 \\-]",inputmode:"numeric"}};function ic(i){if(!i)return null;let t=ec[i];if(t)return{regex:new RegExp(t.pattern),inputmode:t.inputmode};if(i.startsWith("["))try{return{regex:new RegExp(i),inputmode:"text"}}catch{return console.warn(`[data-accept] Invalid character class: ${i}`),null}return console.warn(`[data-accept] Unknown preset: ${i}`),null}function sc(i){if(i.hasAttribute("data-accept-init"))return;if(i.setAttribute("data-accept-init",""),i.hasAttribute("data-mask")){console.warn("[data-accept] Conflict: data-mask is also present \u2014 deferring to mask.",i);return}let t=ic(i.dataset.accept);if(!t)return;let{regex:e,inputmode:s}=t;i.dataset.acceptPattern=e.source,i.getAttribute("inputmode")||i.setAttribute("inputmode",s);let n=!1;i.addEventListener("compositionstart",()=>{n=!0}),i.addEventListener("compositionend",()=>{n=!1,r()}),i.addEventListener("beforeinput",a=>{if(n)return;let o=a.data;if(o!=null){if(a.inputType==="insertFromPaste"){let c=o.split("").filter(l=>e.test(l)).join("");if(c===o||(a.preventDefault(),!c))return;document.execCommand("insertText",!1,c)||nc(i,c);return}if(a.inputType==="insertText"||a.inputType==="insertCompositionText"){for(let c of o)if(!e.test(c)){a.preventDefault();return}}}}),i.addEventListener("input",()=>{n||r()});function r(){let a=i.value,o=a.split("").filter(d=>e.test(d)).join("");if(o===a)return;let c=i.selectionStart??0,l=0;for(let d=0;d<c&&d<a.length;d++)e.test(a[d])&&l++;i.value=o;let h=Math.min(l,o.length);i.setSelectionRange(h,h)}if(i.value){let a=i.value.split("").filter(o=>e.test(o)).join("");a!==i.value&&(i.value=a)}}function nc(i,t){let e=i.selectionStart??0,s=i.selectionEnd??0,n=i.value.slice(0,e),r=i.value.slice(s);i.value=n+t+r;let a=e+t.length;i.setSelectionRange(a,a),i.dispatchEvent(new Event("input",{bubbles:!0}))}_(tc,sc);var Zi="fieldset[data-toggle-tags][data-max]";function Qi(i){if(i.hasAttribute("data-toggle-tags-init"))return;i.setAttribute("data-toggle-tags-init","");let t=parseInt(i.dataset.max,10);if(!t||t<1)return;function e(){let s=i.querySelectorAll('input[type="checkbox"]'),n=i.querySelectorAll('input[type="checkbox"]:checked').length;s.forEach(r=>{r.checked||(r.disabled=n>=t)})}i.addEventListener("change",e),e()}function dr(i=document){i.querySelectorAll(Zi).forEach(Qi)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>dr()):dr();var rc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Zi)&&Qi(s),s.querySelectorAll(Zi).forEach(Qi)}});rc.observe(document.documentElement,{childList:!0,subtree:!0});var ac='input[type="number"][data-stepper]',oc='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="5" y1="12" x2="19" y2="12"/></svg>',cc='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>';function lc(i){if(i.hasAttribute("data-stepper-init"))return;i.setAttribute("data-stepper-init","");let t=document.createElement("div");t.className="number-wrapper",i.parentNode.insertBefore(t,i);let e=document.createElement("button");e.type="button",e.className="number-dec",e.innerHTML=oc,e.setAttribute("aria-label","Decrease"),e.tabIndex=-1;let s=document.createElement("button");s.type="button",s.className="number-inc",s.innerHTML=cc,s.setAttribute("aria-label","Increase"),s.tabIndex=-1,t.appendChild(e),t.appendChild(i),t.appendChild(s);function n(a){let o=i.min!==""?parseFloat(i.min):-1/0,c=i.max!==""?parseFloat(i.max):1/0,l=parseFloat(i.step)||1,h=parseFloat(i.value)||0,d=(l.toString().split(".")[1]||"").length,u=parseFloat((h+l*a).toFixed(d)),b=Math.min(Math.max(u,o),c);i.value=b,i.dispatchEvent(new Event("input",{bubbles:!0})),i.dispatchEvent(new Event("change",{bubbles:!0})),r()}function r(){let a=i.min!==""?parseFloat(i.min):-1/0,o=i.max!==""?parseFloat(i.max):1/0,c=parseFloat(i.value)||0;e.disabled=c<=a,s.disabled=c>=o}e.addEventListener("click",()=>n(-1)),s.addEventListener("click",()=>n(1)),i.addEventListener("input",r),r()}_(ac,lc);var ts='input[type="color"][data-color]';function es(i){if(i.hasAttribute("data-color-init")||i.closest("color-picker"))return;i.setAttribute("data-color-init","");let t=document.createElement("div");t.className="color-wrapper",i.parentNode.insertBefore(t,i),t.appendChild(i);let e=document.createElement("button");e.type="button",e.className="color-display";let s=document.createElement("span");s.className="color-swatch";let n=document.createElement("span");n.className="color-hex",e.appendChild(s),e.appendChild(n),t.appendChild(e);function r(){s.style.background=i.value,n.textContent=i.value}e.addEventListener("click",()=>i.click()),i.addEventListener("input",r),r()}function ur(i=document){i.querySelectorAll(ts).forEach(es)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ur()):ur();var hc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ts)&&es(s),s.querySelectorAll(ts).forEach(es)}});hc.observe(document.documentElement,{childList:!0,subtree:!0});var dc=window.matchMedia("(prefers-reduced-motion: reduce)");function pr(){return dc.matches||document.documentElement.hasAttribute("data-motion-reduced")}var fr=0,X={_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_transitionCleanups:new WeakMap,_observer:null,effect(i,t){this._effects.set(i,t),document.querySelectorAll("[data-effect]").forEach(e=>{(e.getAttribute("data-effect")||"").split(/\s+/).includes(i)&&this._initEffect(e,i)})},trigger(i,t){this._triggers.set(i,t)},transition(i,t){this._transitions.set(i,t)},uid(i){return i.id?i.id:(i._vbUid||(fr++,i._vbUid=`vb-${fr}`),i._vbUid)},theme(i,t){this._themes=this._themes||new Map,this._themes.set(i,t)},applyTheme(i,t=document.documentElement){let e=this._themes?.get(i);if(e)for(let[s,n]of Object.entries(e))t.style.setProperty(s,n)},swap(i){return document.startViewTransition?document.startViewTransition(i):i()},observe(i=document){if(i.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),i.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),i.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{for(let s of e){if(s.type==="childList"){for(let n of s.addedNodes)n.nodeType===Node.ELEMENT_NODE&&this._processTree(n);for(let n of s.removedNodes)n.nodeType===Node.ELEMENT_NODE&&this._cleanupTree(n)}if(s.type==="attributes"){let n=s.target;s.attributeName==="data-effect"&&this._reconcileEffects(n),s.attributeName==="data-trigger"&&this._reconcileTrigger(n),s.attributeName==="data-stagger"&&this._processStagger(n),s.attributeName==="data-transition"&&this._processTransition(n)}}});let t=i===document?document.body:i;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]})},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null)},params(i){let t=getComputedStyle(i);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,s=0){let n=t.getPropertyValue(`--vb-${e}`).trim();return n?parseFloat(n):s},getTime(e,s=0){let n=t.getPropertyValue(`--vb-${e}`).trim();if(!n)return s;let r=parseFloat(n);return Number.isFinite(r)?/s\s*$/.test(n)&&!/ms\s*$/.test(n)?r*1e3:r:s},hasClass(e){return i.classList.contains(e)}}},emit(i,t,e={}){i.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:pr,_processTree(i){i.hasAttribute?.("data-effect")&&this._processElement(i),i.hasAttribute?.("data-stagger")&&this._processStagger(i),i.hasAttribute?.("data-transition")&&this._processTransition(i),i.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),i.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),i.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(i){i.hasAttribute?.("data-effect")&&this._cleanupElement(i),i.hasAttribute?.("data-transition")&&this._cleanupTransition(i),i.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),i.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(i){if(i.hasAttribute("data-effect-processed"))return;i.setAttribute("data-effect-processed","");let t=i.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(i,e);this._wireTrigger(i,t)},_initEffect(i,t){let e=this._effects.get(t);if(!e)return;let s=this._instances.get(i);if(s?.has(t))return;pr();let n=e(i);n&&(s||(s=new Map,this._instances.set(i,s)),typeof n=="function"?s.set(t,{cleanup:n}):s.set(t,n))},_wireTrigger(i,t){let e=i.getAttribute("data-trigger");if(!e){this._activateEffects(i);return}let s=e.split(/\s+/).filter(Boolean);for(let n of s){let r=n.indexOf(":"),a=r>-1?n.slice(0,r):n,o=r>-1?n.slice(r+1):null,c=this._triggers.get(a);if(!c)continue;let l=c(i,()=>this._activateEffects(i),o);if(l){let h=this._triggerCleanups.get(i);if(h){let d=h;this._triggerCleanups.set(i,()=>{d(),l()})}else this._triggerCleanups.set(i,l)}}},_activateEffects(i){i.setAttribute("data-effect-active","");let t=this._instances.get(i);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(i){let t=this._instances.get(i);if(t){for(let[,s]of t)s.cleanup&&s.cleanup();this._instances.delete(i)}let e=this._triggerCleanups.get(i);e&&(e(),this._triggerCleanups.delete(i))},_reconcileEffects(i){let t=i.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(i);if(e)for(let[s,n]of e)t.includes(s)||(n.cleanup&&n.cleanup(),e.delete(s));for(let s of t)e?.has(s)||this._initEffect(i,s);i.hasAttribute("data-effect-processed")||(i.setAttribute("data-effect-processed",""),this._wireTrigger(i,t))},_reconcileTrigger(i){let t=this._triggerCleanups.get(i);t&&(t(),this._triggerCleanups.delete(i));let e=i.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(i,e)},_processStagger(i){let t=i.children;for(let e=0;e<t.length;e++)t[e].style.setProperty("--vb-stagger-index",String(e))},_processTransition(i){if(i.hasAttribute("data-transition-processed"))return;i.setAttribute("data-transition-processed","");let t=i.getAttribute("data-transition");if(!t)return;let e=this._transitions.get(t);if(e){let s=e(i);s&&this._transitionCleanups.set(i,s)}else i.style.viewTransitionName=`${t}-${this.uid(i)}`},_cleanupTransition(i){let t=this._transitionCleanups.get(i);t&&(t(),this._transitionCleanups.delete(i)),i.style.viewTransitionName=""}};typeof window<"u"&&(window.VB=X);function uc(i){let t=i.textContent;i.setAttribute("aria-label",t),i.innerHTML="",t.split(/(\s+)/).forEach((s,n)=>{if(/^\s+$/.test(s)){i.appendChild(document.createTextNode(s));return}let r=document.createElement("span");r.className="vb-reveal-chunk",r.textContent=s,r.style.setProperty("--i",String(Math.floor(n/2))),r.setAttribute("aria-hidden","true"),i.appendChild(r)})}function pc(i){let t=i.textContent;i.setAttribute("aria-label",t);let e=document.createElement("div");e.style.cssText=getComputedStyle(i).cssText,e.style.position="absolute",e.style.visibility="hidden",e.style.whiteSpace="normal",document.body.appendChild(e);let s=t.split(/\s+/).filter(Boolean),n=[],r="";s.forEach(a=>{let o=r?r+" "+a:a;e.textContent=o,e.style.width=getComputedStyle(i).width,e.scrollWidth>e.clientWidth&&r?(n.push(r),r=a):r=o}),r&&n.push(r),document.body.removeChild(e),n.length===0&&n.push(t),i.innerHTML="",n.forEach((a,o)=>{let c=document.createElement("span");c.className="vb-reveal-chunk",c.textContent=a,c.style.setProperty("--i",String(o)),c.setAttribute("aria-hidden","true"),i.appendChild(c),o<n.length-1&&i.appendChild(document.createTextNode(" "))})}X.effect("reveal",i=>{if(i.hasAttribute("data-effect-reveal-init")||(i.setAttribute("data-effect-reveal-init",""),X.prefersReducedMotion()))return;let t=i.classList.contains("line")?"line":"word",e=X.params(i),s=e.get("reveal-delay")||"80ms",n=e.get("reveal-duration")||"400ms";return i.style.setProperty("--reveal-delay",s),i.style.setProperty("--reveal-duration",n),t==="line"?pc(i):uc(i),{activate(){i.setAttribute("data-effect-active","")},cleanup(){}}});X.effect("highlight",i=>{if(i.hasAttribute("data-effect-highlight-init"))return;i.setAttribute("data-effect-highlight-init","");let e=getComputedStyle(i).getPropertyValue("--vb-highlight-color").trim();return e&&i.style.setProperty("--highlight-color",e),X.prefersReducedMotion()&&i.setAttribute("data-effect-active",""),{activate(){i.setAttribute("data-effect-active","")},cleanup(){}}});var is="[data-select-all]";function mr(i=document){i.querySelectorAll(is).forEach(ss)}function ss(i){if(i.hasAttribute("data-select-all-init"))return;i.setAttribute("data-select-all-init","");let t=i.dataset.selectAll??"";if(!t)return;function e(){return(i.closest("[data-select-all-scope]")||i.closest("table, form, fieldset")||document).querySelectorAll(t)}function s(){let a=e(),o=a.length,c=0;a.forEach(d=>{d.checked&&c++}),c===0?(i.checked=!1,i.indeterminate=!1):c===o?(i.checked=!0,i.indeterminate=!1):(i.checked=!1,i.indeterminate=!0);let h=(i.closest("[data-select-all-scope]")||i.closest("table, form, fieldset")||document).querySelector("[data-selected-count]");h&&(h.textContent=String(c)),i.dispatchEvent(new CustomEvent("select-all:change",{bubbles:!0,detail:{checked:c,total:o,selected:[...a].filter(d=>d.checked)}}))}let n=!1;i.addEventListener("change",()=>{n=!0;let a=i.checked;e().forEach(c=>{c.checked=a,c.dispatchEvent(new Event("change",{bubbles:!0}))}),n=!1,i.indeterminate=!1,s()}),(i.closest("[data-select-all-scope]")||i.closest("table, form, fieldset")||document).addEventListener("change",a=>{n||a.target!==i&&a.target.matches?.(t)&&s()}),s()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>mr()):mr();var fc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(is)&&ss(s),s.querySelectorAll(is).forEach(n=>ss(n))}});fc.observe(document.documentElement,{childList:!0,subtree:!0});var ns="[data-math], code.language-math";var br=0;window.VBMath=window.VBMath||{equations:[]};function gr(i=document){i.querySelectorAll(ns).forEach(rs)}function mc(i){let t=i.getAttribute("data-math")||"";return new Set(t.split(/\s+/).filter(Boolean))}function rs(i){if(i.hasAttribute("data-math-init"))return;i.setAttribute("data-math-init",""),!i.hasAttribute("data-math")&&i.classList.contains("language-math")&&i.setAttribute("data-math","");let t=mc(i),e=i.getAttribute("data-mathml"),s=i.textContent.trim(),n=t.has("inline");if(!e){i.setAttribute("data-math-state","source");return}let r=n?document.createElement("span"):document.createElement("div");r.setAttribute("data-math-rendered",""),r.innerHTML=e;let a=i.id||null;a&&(r.id=a,i.removeAttribute("id"));let o=r.querySelector("math");o&&!n&&o.setAttribute("display","block");let c=null;t.has("numbered")&&(br++,c=br,r.setAttribute("data-math-numbered",""),r.setAttribute("data-equation-number",String(c)),a&&window.VBMath?.equations.push({id:a,number:c,latex:s})),t.has("copyable")&&(r.setAttribute("data-math-copyable",""),r.style.cursor="copy",r.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(s),gc("Copied to clipboard",r)}catch{}})),i.setAttribute("data-math-state","rendered"),i.insertAdjacentElement("afterend",r);let l=i.closest("pre");l?(l.setAttribute("data-math-state","rendered"),l.hidden=!0):i.hidden=!0,bc(),i.dispatchEvent(new CustomEvent("math:rendered",{bubbles:!0,detail:{latex:s,inline:n,number:c}}))}function bc(){if(document.querySelector("[data-vb-math-font]"))return;let i=document.createElement("link");i.rel="stylesheet",i.href="/fonts/math-fonts.css",i.setAttribute("data-vb-math-font",""),document.head.appendChild(i)}function gc(i,t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="sr-only",e.textContent=i,t.appendChild(e),setTimeout(()=>e.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>gr()):gr();var yc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ns)&&rs(s),s.querySelectorAll(ns).forEach(rs)}});yc.observe(document.documentElement,{childList:!0,subtree:!0});var vc=CSS.supports("anchor-name","--test"),wc=new Set(["BUTTON","A","AREA"]);function Ec(i){return document.documentElement.hasAttribute("data-interest-polyfill")?!0:"interestForElement"in HTMLButtonElement.prototype?wc.has(i.tagName):!1}function as(i,t){if(Ec(i)){i.setAttribute("interestfor",t.id),t.addEventListener("toggle",l=>{l.newState==="open"&&de(i,t)});return}let e=null,s=null,n=t,r=()=>{clearTimeout(s),e=setTimeout(()=>{n.showPopover(),de(i,t)},200)},a=()=>{clearTimeout(e),s=setTimeout(()=>{n.hidePopover()},100)},o=()=>{clearTimeout(s),n.showPopover(),de(i,t)},c=()=>{clearTimeout(e),n.hidePopover()};i.addEventListener("mouseenter",r),i.addEventListener("mouseleave",a),i.addEventListener("focus",o),i.addEventListener("blur",c),t.addEventListener("mouseenter",()=>clearTimeout(s)),t.addEventListener("mouseleave",a)}function os(i,t){if(!vc)return;let e=`--tooltip-anchor-${t.id}`;i.style.anchorName=e,t.style.positionAnchor=e,t.setAttribute("data-anchor","")}function Ac(i){let t=i.getAttribute("title");if(!t)return;i.removeAttribute("title");let e=document.createElement("div");e.setAttribute("role","tooltip"),e.setAttribute("popover","hint"),e.id=`tooltip-${crypto.randomUUID().slice(0,8)}`,e.textContent=t;let s=i.dataset.tooltipPosition||"top";e.dataset.tooltipPosition=s;let n=document.createElement("span");n.className="tooltip-arrow",n.setAttribute("aria-hidden","true"),e.appendChild(n),i.after(e),i.setAttribute("aria-describedby",e.id),os(i,e),as(i,e)}function Sc(i,t){let e=document.getElementById(t);e?.hasAttribute("popover")&&(i.hasAttribute("title")&&i.removeAttribute("title"),i.hasAttribute("aria-describedby")||i.setAttribute("aria-describedby",t),os(i,e),as(i,e))}function yr(i=document){i.querySelectorAll("[data-tooltip]").forEach(t=>{if(t.closest("tool-tip")||t.hasAttribute("data-tooltip-init"))return;t.setAttribute("data-tooltip-init","");let e=t.dataset.tooltip;e?Sc(t,e):Ac(t)}),i.querySelectorAll("[aria-describedby]").forEach(t=>{let e=t.getAttribute("aria-describedby")??"",s=document.getElementById(e);!s?.hasAttribute("popover")||!s.matches('[role="tooltip"]')||t.closest("tool-tip")||t.hasAttribute("data-tooltip-init")||(t.setAttribute("data-tooltip-init",""),os(t,s),as(t,s))}),i.querySelectorAll("[popovertarget]").forEach(t=>{let e=t.getAttribute("popovertarget")??"",s=document.getElementById(e);!s?.hasAttribute("popover")||!s.matches('[role="tooltip"]')||s.hasAttribute("data-tooltip-click-init")||(s.setAttribute("data-tooltip-click-init",""),s.addEventListener("toggle",n=>{n.newState==="open"&&de(t,s)}))})}function de(i,t){if(t.hasAttribute("data-anchor"))return;let e=i.getBoundingClientRect(),s=t.dataset.tooltipPosition||"top",n=8,r=t.getBoundingClientRect(),a,o;switch(s){case"bottom":a=e.bottom+n,o=e.left+(e.width-r.width)/2;break;case"left":a=e.top+(e.height-r.height)/2,o=e.left-r.width-n;break;case"right":a=e.top+(e.height-r.height)/2,o=e.right+n;break;default:a=e.top-r.height-n,o=e.left+(e.width-r.width)/2;break}let c=8;o=Math.max(c,Math.min(o,window.innerWidth-r.width-c)),a=Math.max(c,Math.min(a,window.innerHeight-r.height-c)),t.style.top=`${a}px`,t.style.left=`${o}px`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>yr()):yr();var cs="[data-vt-name]";function ls(i){i.hasAttribute("data-vt-name-init")||(i.setAttribute("data-vt-name-init",""),i.style.viewTransitionName=i.dataset.vtName)}function vr(i=document){i.querySelectorAll(cs).forEach(ls)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>vr()):vr();var Cc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(cs)&&ls(s),s.querySelectorAll(cs).forEach(ls)}});Cc.observe(document.documentElement,{childList:!0,subtree:!0});function wr(i){document.querySelectorAll("browser-window").forEach(t=>{t.setAttribute("mode",i)}),document.querySelectorAll("code-block").forEach(t=>{t.setAttribute("theme",i)})}function Er(){let{effectiveMode:i}=S.getState();wr(i),window.addEventListener("vb:theme-change",e=>{wr(e.detail.effectiveMode)}),new MutationObserver(e=>{let{effectiveMode:s}=S.getState();for(let n of e)for(let r of n.addedNodes){if(r.nodeType!==Node.ELEMENT_NODE)continue;let a=r;a.tagName==="BROWSER-WINDOW"?a.setAttribute("mode",s):a.tagName==="CODE-BLOCK"&&a.setAttribute("theme",s),a.querySelectorAll("browser-window").forEach(o=>{o.setAttribute("mode",s)}),a.querySelectorAll("code-block").forEach(o=>{o.setAttribute("theme",s)})}}).observe(document.body,{childList:!0,subtree:!0})}kt();function It(i){return[...i.querySelectorAll("input, select, textarea")].filter(t=>t.type!=="submit"&&t.type!=="button"&&t.type!=="hidden"&&!("honeypot"in t.dataset))}function Cr(i){return[...i.querySelectorAll("form-field[data-upgraded]")]}function kc(i){return i.labels?.[0]?.textContent?.trim()??i.getAttribute("aria-label")??i.name??i.id}function $t(i,t){let e=i.dataset.match;if(!e)return;let s=t.querySelector(`#${CSS.escape(e)}`)??t.querySelector(`[name="${CSS.escape(e)}"]`);if(s){if(i.setCustomValidity(""),i.value&&s.value&&i.value!==s.value){let n=i.dataset.messageMatch??"Values do not match";i.setCustomValidity(n);let r=Ar(i);r&&(r.textContent=n)}else if(i.validity.valid){let n=Ar(i);n&&(n.textContent="")}}}function Ar(i){let t=i.getAttribute("aria-describedby")?.split(/\s+/)??[];for(let s of t){let n=document.getElementById(s);if(n?.tagName==="OUTPUT"&&n.classList.contains("error"))return n}return i.closest("form-field")?.querySelector("output.error")??null}function Sr(i){let e=[...i.querySelectorAll('input[type="checkbox"]')].filter(o=>o.checked).length,s=parseInt(i.dataset.minChecked??"0",10),n=parseInt(i.dataset.maxChecked??"999",10),r=i.querySelector(":scope > output"),a=null;return e<s&&(a=i.dataset.messageMinChecked??`Select at least ${s}`),e>n&&(a=i.dataset.messageMaxChecked??`Select no more than ${n}`),r&&(r.textContent=a??""),a?i.dataset.invalid="":delete i.dataset.invalid,!a}function kr(i){let t=i.querySelector("[data-form-summary]");if(t)return{el:t,type:"authored"};let e=i.querySelector("output.error-summary");return e?{el:e,type:"legacy"}:null}function ue(i,t,{focus:e=!1}={}){if(!t)return;let s=[];for(let n of It(i))n.validity.valid||s.push({id:n.id||n.name,label:kc(n),message:n.validationMessage});for(let n of i.querySelectorAll("fieldset[data-invalid]")){let r=n.querySelector(":scope > output");s.push({id:n.id||"",label:n.querySelector("legend")?.textContent?.trim()??"Group",message:r?.textContent||"Invalid selection"})}if(s.length===0){xr(t);return}if(t.type==="authored"){let n=t.el.querySelector("[data-summary-list]");if(n){n.innerHTML="";for(let r of s){let a=document.createElement("li"),o=document.createElement("a");o.href=r.id?`#${r.id}`:"#",o.textContent=`${r.label}: ${r.message}`,a.appendChild(o),n.appendChild(a)}}t.el.removeAttribute("hidden"),t.el.dataset.visible=""}else{let n=s.length,r=s.map(a=>`<li><a href="${a.id?`#${a.id}`:"#"}">${a.label}: ${a.message}</a></li>`).join(`
|
|
391
|
+
<span class="upload-file-name">${jo(l.name)}</span>
|
|
392
|
+
<span class="upload-file-size">${Wo(l.size)}</span>
|
|
393
|
+
`,r.appendChild(h)})})}function jo(i){let t=document.createElement("div");return t.textContent=i,t.innerHTML}function ar(i=document){i.querySelectorAll(Yi).forEach(Gi)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ar()):ar();var Yo=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Yi)&&Gi(s),s.querySelectorAll(Yi).forEach(n=>Gi(n))}});Yo.observe(document.documentElement,{childList:!0,subtree:!0});W();var Xi="form[data-autosave]",Ki="autosave",or=500,Go=1440*60*1e3;function Ji(i){if(i.hasAttribute("data-autosave-init"))return;i.setAttribute("data-autosave-init","");let t=i.dataset.autosave,e;function s(){let c={},l=i.elements;for(let h of l){let d=h;d.name&&(d.type==="password"||d.type==="file"||(d.type==="checkbox"?c[d.name]=d.checked?"on":"":d.type==="radio"?d.checked&&(c[d.name]=d.value):c[d.name]=d.value))}return c}function n(){w.set(Ki,t,s()).catch(()=>{})}async function r(){let c=await w.get(Ki,t,{maxAge:Go});if(!c)return!1;let l=!1;for(let[h,d]of Object.entries(c)){let u=i.querySelectorAll(`[name="${CSS.escape(h)}"]`);u.forEach(b=>{let y=b;y.type==="checkbox"?y.checked=d==="on":y.type==="radio"?y.checked=y.value===d:y.value=d}),u.length&&(l=!0)}return l}function a(){w.remove(Ki,t).catch(()=>{})}function o(){if(customElements.get("toast-msg")){let c=document.createElement("toast-msg");c.setAttribute("variant","info"),c.setAttribute("duration","3000"),c.textContent="Draft restored",document.body.appendChild(c)}}r().then(c=>{c&&(o(),Array.from(i.elements).forEach(l=>{let h=l;h.name&&h.type!=="password"&&h.type!=="file"&&h.dispatchEvent(new Event("input",{bubbles:!0}))}))}),i.addEventListener("input",()=>{clearTimeout(e),e=setTimeout(n,or)}),i.addEventListener("change",()=>{clearTimeout(e),e=setTimeout(n,or)}),i.addEventListener("submit",a),i.addEventListener("reset",()=>{setTimeout(a,0)})}function cr(i=document){i.querySelectorAll(Xi).forEach(Ji)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>cr()):cr();var Ko=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Xi)&&Ji(s),s.querySelectorAll(Xi).forEach(Ji)}});Ko.observe(document.documentElement,{childList:!0,subtree:!0});var Xo="input[data-mask]",lr={phone:{pattern:"(###) ###-####",accept:/\d/},"credit-card":{pattern:"#### #### #### ####",accept:/\d/},date:{pattern:"##/##/####",accept:/\d/},ssn:{pattern:"###-##-####",accept:/\d/},zip:{pattern:"#####",accept:/\d/}},Jo={"#":/\d/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/};function Zo(i){let t=i.dataset.mask;if(lr[t])return lr[t];if(t==="custom"&&i.dataset.pattern){let e=i.dataset.pattern,s=new Set;for(let r of e)r==="#"?s.add("0-9"):r==="A"?s.add("a-zA-Z"):r==="*"&&s.add("a-zA-Z0-9");let n=s.size>0?new RegExp(`[${[...s].join("")}]`):/./;return{pattern:e,accept:n}}return null}function he(i){return i==="#"||i==="A"||i==="*"}function Qo(i,t){let e=Jo[i];return e?e.test(t):!1}function hr(i,t){let e="",s=0;for(let n=0;n<t.length&&s<i.length;n++){let r=t[n];if(he(r)){for(;s<i.length&&!Qo(r,i[s]);)s++;s<i.length&&(e+=i[s],s++)}else e+=r}return e}function dr(i,t){return i.split("").filter(e=>t.test(e)).join("")}function tc(i){for(let t of i)if(he(t)&&t!=="#")return!1;return!0}function ec(i){if(i.hasAttribute("data-mask-init"))return;i.setAttribute("data-mask-init","");let t=Zo(i);if(!t)return;let{pattern:e}=t,s=t.accept;tc(e)&&!i.getAttribute("inputmode")&&i.setAttribute("inputmode","numeric"),i.getAttribute("maxlength")||i.setAttribute("maxlength",String(e.length));let n=!1;i.addEventListener("compositionstart",()=>{n=!0}),i.addEventListener("compositionend",()=>{n=!1,r()});function r(){if(n)return;let a=i.selectionStart??0,o=0;for(let u=0;u<a&&u<i.value.length;u++)s.test(i.value[u])&&o++;let c=dr(i.value,s),l=hr(c,e);i.value=l,i.dataset.rawValue=c;let h=0,d=l.length;for(let u=0;u<l.length;u++)if(u<e.length&&he(e[u])&&(h++,h===o)){for(d=u+1;d<e.length&&!he(e[d]);)d++;break}i.setSelectionRange(d,d)}if(i.addEventListener("input",r),i.value){let a=dr(i.value,s);i.value=hr(a,e),i.dataset.rawValue=a}}_(Xo,ec);var ic="input[data-accept]",sc={digits:{pattern:"[0-9]",inputmode:"numeric"},alpha:{pattern:"[a-zA-Z]",inputmode:"text"},alphanum:{pattern:"[a-zA-Z0-9]",inputmode:"text"},phone:{pattern:"[0-9+()\\- ]",inputmode:"tel"},date:{pattern:"[0-9/\\-.]",inputmode:"numeric"},hex:{pattern:"[0-9a-fA-F]",inputmode:"text"},currency:{pattern:"[0-9.,]",inputmode:"decimal"},cc:{pattern:"[0-9 \\-]",inputmode:"numeric"}};function nc(i){if(!i)return null;let t=sc[i];if(t)return{regex:new RegExp(t.pattern),inputmode:t.inputmode};if(i.startsWith("["))try{return{regex:new RegExp(i),inputmode:"text"}}catch{return console.warn(`[data-accept] Invalid character class: ${i}`),null}return console.warn(`[data-accept] Unknown preset: ${i}`),null}function rc(i){if(i.hasAttribute("data-accept-init"))return;if(i.setAttribute("data-accept-init",""),i.hasAttribute("data-mask")){console.warn("[data-accept] Conflict: data-mask is also present \u2014 deferring to mask.",i);return}let t=nc(i.dataset.accept);if(!t)return;let{regex:e,inputmode:s}=t;i.dataset.acceptPattern=e.source,i.getAttribute("inputmode")||i.setAttribute("inputmode",s);let n=!1;i.addEventListener("compositionstart",()=>{n=!0}),i.addEventListener("compositionend",()=>{n=!1,r()}),i.addEventListener("beforeinput",a=>{if(n)return;let o=a.data;if(o!=null){if(a.inputType==="insertFromPaste"){let c=o.split("").filter(l=>e.test(l)).join("");if(c===o||(a.preventDefault(),!c))return;document.execCommand("insertText",!1,c)||ac(i,c);return}if(a.inputType==="insertText"||a.inputType==="insertCompositionText"){for(let c of o)if(!e.test(c)){a.preventDefault();return}}}}),i.addEventListener("input",()=>{n||r()});function r(){let a=i.value,o=a.split("").filter(d=>e.test(d)).join("");if(o===a)return;let c=i.selectionStart??0,l=0;for(let d=0;d<c&&d<a.length;d++)e.test(a[d])&&l++;i.value=o;let h=Math.min(l,o.length);i.setSelectionRange(h,h)}if(i.value){let a=i.value.split("").filter(o=>e.test(o)).join("");a!==i.value&&(i.value=a)}}function ac(i,t){let e=i.selectionStart??0,s=i.selectionEnd??0,n=i.value.slice(0,e),r=i.value.slice(s);i.value=n+t+r;let a=e+t.length;i.setSelectionRange(a,a),i.dispatchEvent(new Event("input",{bubbles:!0}))}_(ic,rc);var Zi="fieldset[data-toggle-tags][data-max]";function Qi(i){if(i.hasAttribute("data-toggle-tags-init"))return;i.setAttribute("data-toggle-tags-init","");let t=parseInt(i.dataset.max,10);if(!t||t<1)return;function e(){let s=i.querySelectorAll('input[type="checkbox"]'),n=i.querySelectorAll('input[type="checkbox"]:checked').length;s.forEach(r=>{r.checked||(r.disabled=n>=t)})}i.addEventListener("change",e),e()}function ur(i=document){i.querySelectorAll(Zi).forEach(Qi)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ur()):ur();var oc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(Zi)&&Qi(s),s.querySelectorAll(Zi).forEach(Qi)}});oc.observe(document.documentElement,{childList:!0,subtree:!0});var cc='input[type="number"][data-stepper]',lc='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="5" y1="12" x2="19" y2="12"/></svg>',hc='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>';function dc(i){if(i.hasAttribute("data-stepper-init"))return;i.setAttribute("data-stepper-init","");let t=document.createElement("div");t.className="number-wrapper",i.parentNode.insertBefore(t,i);let e=document.createElement("button");e.type="button",e.className="number-dec",e.innerHTML=lc,e.setAttribute("aria-label","Decrease"),e.tabIndex=-1;let s=document.createElement("button");s.type="button",s.className="number-inc",s.innerHTML=hc,s.setAttribute("aria-label","Increase"),s.tabIndex=-1,t.appendChild(e),t.appendChild(i),t.appendChild(s);function n(a){let o=i.min!==""?parseFloat(i.min):-1/0,c=i.max!==""?parseFloat(i.max):1/0,l=parseFloat(i.step)||1,h=parseFloat(i.value)||0,d=(l.toString().split(".")[1]||"").length,u=parseFloat((h+l*a).toFixed(d)),b=Math.min(Math.max(u,o),c);i.value=b,i.dispatchEvent(new Event("input",{bubbles:!0})),i.dispatchEvent(new Event("change",{bubbles:!0})),r()}function r(){let a=i.min!==""?parseFloat(i.min):-1/0,o=i.max!==""?parseFloat(i.max):1/0,c=parseFloat(i.value)||0;e.disabled=c<=a,s.disabled=c>=o}e.addEventListener("click",()=>n(-1)),s.addEventListener("click",()=>n(1)),i.addEventListener("input",r),r()}_(cc,dc);var ts='input[type="color"][data-color]';function es(i){if(i.hasAttribute("data-color-init")||i.closest("color-picker"))return;i.setAttribute("data-color-init","");let t=document.createElement("div");t.className="color-wrapper",i.parentNode.insertBefore(t,i),t.appendChild(i);let e=document.createElement("button");e.type="button",e.className="color-display";let s=document.createElement("span");s.className="color-swatch";let n=document.createElement("span");n.className="color-hex",e.appendChild(s),e.appendChild(n),t.appendChild(e);function r(){s.style.background=i.value,n.textContent=i.value}e.addEventListener("click",()=>i.click()),i.addEventListener("input",r),r()}function pr(i=document){i.querySelectorAll(ts).forEach(es)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>pr()):pr();var uc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ts)&&es(s),s.querySelectorAll(ts).forEach(es)}});uc.observe(document.documentElement,{childList:!0,subtree:!0});var pc=window.matchMedia("(prefers-reduced-motion: reduce)");function fr(){return pc.matches||document.documentElement.hasAttribute("data-motion-reduced")}var mr=0,X={_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_transitionCleanups:new WeakMap,_observer:null,effect(i,t){this._effects.set(i,t),document.querySelectorAll("[data-effect]").forEach(e=>{(e.getAttribute("data-effect")||"").split(/\s+/).includes(i)&&this._initEffect(e,i)})},trigger(i,t){this._triggers.set(i,t)},transition(i,t){this._transitions.set(i,t)},uid(i){return i.id?i.id:(i._vbUid||(mr++,i._vbUid=`vb-${mr}`),i._vbUid)},theme(i,t){this._themes=this._themes||new Map,this._themes.set(i,t)},applyTheme(i,t=document.documentElement){let e=this._themes?.get(i);if(e)for(let[s,n]of Object.entries(e))t.style.setProperty(s,n)},swap(i){return document.startViewTransition?document.startViewTransition(i):i()},observe(i=document){if(i.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),i.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),i.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{for(let s of e){if(s.type==="childList"){for(let n of s.addedNodes)n.nodeType===Node.ELEMENT_NODE&&this._processTree(n);for(let n of s.removedNodes)n.nodeType===Node.ELEMENT_NODE&&this._cleanupTree(n)}if(s.type==="attributes"){let n=s.target;s.attributeName==="data-effect"&&this._reconcileEffects(n),s.attributeName==="data-trigger"&&this._reconcileTrigger(n),s.attributeName==="data-stagger"&&this._processStagger(n),s.attributeName==="data-transition"&&this._processTransition(n)}}});let t=i===document?document.body:i;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]})},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null)},params(i){let t=getComputedStyle(i);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,s=0){let n=t.getPropertyValue(`--vb-${e}`).trim();return n?parseFloat(n):s},getTime(e,s=0){let n=t.getPropertyValue(`--vb-${e}`).trim();if(!n)return s;let r=parseFloat(n);return Number.isFinite(r)?/s\s*$/.test(n)&&!/ms\s*$/.test(n)?r*1e3:r:s},hasClass(e){return i.classList.contains(e)}}},emit(i,t,e={}){i.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:fr,_processTree(i){i.hasAttribute?.("data-effect")&&this._processElement(i),i.hasAttribute?.("data-stagger")&&this._processStagger(i),i.hasAttribute?.("data-transition")&&this._processTransition(i),i.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),i.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),i.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(i){i.hasAttribute?.("data-effect")&&this._cleanupElement(i),i.hasAttribute?.("data-transition")&&this._cleanupTransition(i),i.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),i.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(i){if(i.hasAttribute("data-effect-processed"))return;i.setAttribute("data-effect-processed","");let t=i.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(i,e);this._wireTrigger(i,t)},_initEffect(i,t){let e=this._effects.get(t);if(!e)return;let s=this._instances.get(i);if(s?.has(t))return;fr();let n=e(i);n&&(s||(s=new Map,this._instances.set(i,s)),typeof n=="function"?s.set(t,{cleanup:n}):s.set(t,n))},_wireTrigger(i,t){let e=i.getAttribute("data-trigger");if(!e){this._activateEffects(i);return}let s=e.split(/\s+/).filter(Boolean);for(let n of s){let r=n.indexOf(":"),a=r>-1?n.slice(0,r):n,o=r>-1?n.slice(r+1):null,c=this._triggers.get(a);if(!c)continue;let l=c(i,()=>this._activateEffects(i),o);if(l){let h=this._triggerCleanups.get(i);if(h){let d=h;this._triggerCleanups.set(i,()=>{d(),l()})}else this._triggerCleanups.set(i,l)}}},_activateEffects(i){i.setAttribute("data-effect-active","");let t=this._instances.get(i);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(i){let t=this._instances.get(i);if(t){for(let[,s]of t)s.cleanup&&s.cleanup();this._instances.delete(i)}let e=this._triggerCleanups.get(i);e&&(e(),this._triggerCleanups.delete(i))},_reconcileEffects(i){let t=i.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(i);if(e)for(let[s,n]of e)t.includes(s)||(n.cleanup&&n.cleanup(),e.delete(s));for(let s of t)e?.has(s)||this._initEffect(i,s);i.hasAttribute("data-effect-processed")||(i.setAttribute("data-effect-processed",""),this._wireTrigger(i,t))},_reconcileTrigger(i){let t=this._triggerCleanups.get(i);t&&(t(),this._triggerCleanups.delete(i));let e=i.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(i,e)},_processStagger(i){let t=i.children;for(let e=0;e<t.length;e++)t[e].style.setProperty("--vb-stagger-index",String(e))},_processTransition(i){if(i.hasAttribute("data-transition-processed"))return;i.setAttribute("data-transition-processed","");let t=i.getAttribute("data-transition");if(!t)return;let e=this._transitions.get(t);if(e){let s=e(i);s&&this._transitionCleanups.set(i,s)}else i.style.viewTransitionName=`${t}-${this.uid(i)}`},_cleanupTransition(i){let t=this._transitionCleanups.get(i);t&&(t(),this._transitionCleanups.delete(i)),i.style.viewTransitionName=""}};typeof window<"u"&&(window.VB=X);function fc(i){let t=i.textContent;i.setAttribute("aria-label",t),i.innerHTML="",t.split(/(\s+)/).forEach((s,n)=>{if(/^\s+$/.test(s)){i.appendChild(document.createTextNode(s));return}let r=document.createElement("span");r.className="vb-reveal-chunk",r.textContent=s,r.style.setProperty("--i",String(Math.floor(n/2))),r.setAttribute("aria-hidden","true"),i.appendChild(r)})}function mc(i){let t=i.textContent;i.setAttribute("aria-label",t);let e=document.createElement("div");e.style.cssText=getComputedStyle(i).cssText,e.style.position="absolute",e.style.visibility="hidden",e.style.whiteSpace="normal",document.body.appendChild(e);let s=t.split(/\s+/).filter(Boolean),n=[],r="";s.forEach(a=>{let o=r?r+" "+a:a;e.textContent=o,e.style.width=getComputedStyle(i).width,e.scrollWidth>e.clientWidth&&r?(n.push(r),r=a):r=o}),r&&n.push(r),document.body.removeChild(e),n.length===0&&n.push(t),i.innerHTML="",n.forEach((a,o)=>{let c=document.createElement("span");c.className="vb-reveal-chunk",c.textContent=a,c.style.setProperty("--i",String(o)),c.setAttribute("aria-hidden","true"),i.appendChild(c),o<n.length-1&&i.appendChild(document.createTextNode(" "))})}X.effect("reveal",i=>{if(i.hasAttribute("data-effect-reveal-init")||(i.setAttribute("data-effect-reveal-init",""),X.prefersReducedMotion()))return;let t=i.classList.contains("line")?"line":"word",e=X.params(i),s=e.get("reveal-delay")||"80ms",n=e.get("reveal-duration")||"400ms";return i.style.setProperty("--reveal-delay",s),i.style.setProperty("--reveal-duration",n),t==="line"?mc(i):fc(i),{activate(){i.setAttribute("data-effect-active","")},cleanup(){}}});X.effect("highlight",i=>{if(i.hasAttribute("data-effect-highlight-init"))return;i.setAttribute("data-effect-highlight-init","");let e=getComputedStyle(i).getPropertyValue("--vb-highlight-color").trim();return e&&i.style.setProperty("--highlight-color",e),X.prefersReducedMotion()&&i.setAttribute("data-effect-active",""),{activate(){i.setAttribute("data-effect-active","")},cleanup(){}}});var is="[data-select-all]";function br(i=document){i.querySelectorAll(is).forEach(ss)}function ss(i){if(i.hasAttribute("data-select-all-init"))return;i.setAttribute("data-select-all-init","");let t=i.dataset.selectAll??"";if(!t)return;function e(){return(i.closest("[data-select-all-scope]")||i.closest("table, form, fieldset")||document).querySelectorAll(t)}function s(){let a=e(),o=a.length,c=0;a.forEach(d=>{d.checked&&c++}),c===0?(i.checked=!1,i.indeterminate=!1):c===o?(i.checked=!0,i.indeterminate=!1):(i.checked=!1,i.indeterminate=!0);let h=(i.closest("[data-select-all-scope]")||i.closest("table, form, fieldset")||document).querySelector("[data-selected-count]");h&&(h.textContent=String(c)),i.dispatchEvent(new CustomEvent("select-all:change",{bubbles:!0,detail:{checked:c,total:o,selected:[...a].filter(d=>d.checked)}}))}let n=!1;i.addEventListener("change",()=>{n=!0;let a=i.checked;e().forEach(c=>{c.checked=a,c.dispatchEvent(new Event("change",{bubbles:!0}))}),n=!1,i.indeterminate=!1,s()}),(i.closest("[data-select-all-scope]")||i.closest("table, form, fieldset")||document).addEventListener("change",a=>{n||a.target!==i&&a.target.matches?.(t)&&s()}),s()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>br()):br();var bc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(is)&&ss(s),s.querySelectorAll(is).forEach(n=>ss(n))}});bc.observe(document.documentElement,{childList:!0,subtree:!0});var ns="[data-math], code.language-math";var gr=0;window.VBMath=window.VBMath||{equations:[]};function yr(i=document){i.querySelectorAll(ns).forEach(rs)}function gc(i){let t=i.getAttribute("data-math")||"";return new Set(t.split(/\s+/).filter(Boolean))}function rs(i){if(i.hasAttribute("data-math-init"))return;i.setAttribute("data-math-init",""),!i.hasAttribute("data-math")&&i.classList.contains("language-math")&&i.setAttribute("data-math","");let t=gc(i),e=i.getAttribute("data-mathml"),s=i.textContent.trim(),n=t.has("inline");if(!e){i.setAttribute("data-math-state","source");return}let r=n?document.createElement("span"):document.createElement("div");r.setAttribute("data-math-rendered",""),r.innerHTML=e;let a=i.id||null;a&&(r.id=a,i.removeAttribute("id"));let o=r.querySelector("math");o&&!n&&o.setAttribute("display","block");let c=null;t.has("numbered")&&(gr++,c=gr,r.setAttribute("data-math-numbered",""),r.setAttribute("data-equation-number",String(c)),a&&window.VBMath?.equations.push({id:a,number:c,latex:s})),t.has("copyable")&&(r.setAttribute("data-math-copyable",""),r.style.cursor="copy",r.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(s),vc("Copied to clipboard",r)}catch{}})),i.setAttribute("data-math-state","rendered"),i.insertAdjacentElement("afterend",r);let l=i.closest("pre");l?(l.setAttribute("data-math-state","rendered"),l.hidden=!0):i.hidden=!0,yc(),i.dispatchEvent(new CustomEvent("math:rendered",{bubbles:!0,detail:{latex:s,inline:n,number:c}}))}function yc(){if(document.querySelector("[data-vb-math-font]"))return;let i=document.createElement("link");i.rel="stylesheet",i.href="/fonts/math-fonts.css",i.setAttribute("data-vb-math-font",""),document.head.appendChild(i)}function vc(i,t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="visually-hidden",e.textContent=i,t.appendChild(e),setTimeout(()=>e.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>yr()):yr();var wc=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ns)&&rs(s),s.querySelectorAll(ns).forEach(rs)}});wc.observe(document.documentElement,{childList:!0,subtree:!0});var vr="vb:recently-visited",Ec="vb:recently-visited:paused";function Ac(){try{return localStorage.getItem(Ec)==="1"}catch{return!1}}function Sc(){return!!document.querySelector('meta[name="vb:no-track-history"]')}function Cc(){try{let i=localStorage.getItem(vr);if(!i)return[];let t=JSON.parse(i);return Array.isArray(t)?t:[]}catch{return[]}}function kc(i){try{localStorage.setItem(vr,JSON.stringify(i))}catch{}}function xc(i){if(!i)return"";let t=i.slice(1);if(!t)return"";let e=null;try{e=document.getElementById(t)}catch{}return e&&(e.textContent||"").trim().slice(0,80)||t}function as(){if(Ac()||Sc()||location.protocol==="file:"||location.protocol==="about:")return;let i=location.pathname+location.search,t=location.hash,e=(document.title||"").trim();if(!e)return;let s=xc(t),n=Date.now(),r=Cc(),a=i+t;if((r[0]?r[0].url+(r[0].hash||""):"")===a)return;let c=r.filter(l=>l.url+(l.hash||"")!==a);c.unshift({url:i,hash:t,title:e,hashTitle:s,ts:n}),kc(c.slice(0,100))}as();window.addEventListener("pageshow",i=>{i.persisted&&as()});window.addEventListener("hashchange",as);var Tc=CSS.supports("anchor-name","--test"),Lc=new Set(["BUTTON","A","AREA"]);function Mc(i){return document.documentElement.hasAttribute("data-interest-polyfill")?!0:"interestForElement"in HTMLButtonElement.prototype?Lc.has(i.tagName):!1}function os(i,t){if(Mc(i)){i.setAttribute("interestfor",t.id),t.addEventListener("toggle",l=>{l.newState==="open"&&de(i,t)});return}let e=null,s=null,n=t,r=()=>{clearTimeout(s),e=setTimeout(()=>{n.showPopover(),de(i,t)},200)},a=()=>{clearTimeout(e),s=setTimeout(()=>{n.hidePopover()},100)},o=()=>{clearTimeout(s),n.showPopover(),de(i,t)},c=()=>{clearTimeout(e),n.hidePopover()};i.addEventListener("mouseenter",r),i.addEventListener("mouseleave",a),i.addEventListener("focus",o),i.addEventListener("blur",c),t.addEventListener("mouseenter",()=>clearTimeout(s)),t.addEventListener("mouseleave",a)}function cs(i,t){if(!Tc)return;let e=`--tooltip-anchor-${t.id}`;i.style.anchorName=e,t.style.positionAnchor=e,t.setAttribute("data-anchor","")}function Nc(i){let t=i.getAttribute("title");if(!t)return;i.removeAttribute("title");let e=document.createElement("div");e.setAttribute("role","tooltip"),e.setAttribute("popover","hint"),e.id=`tooltip-${crypto.randomUUID().slice(0,8)}`,e.textContent=t;let s=i.dataset.tooltipPosition||"top";e.dataset.tooltipPosition=s;let n=document.createElement("span");n.className="tooltip-arrow",n.setAttribute("aria-hidden","true"),e.appendChild(n),i.after(e),i.setAttribute("aria-describedby",e.id),cs(i,e),os(i,e)}function Dc(i,t){let e=document.getElementById(t);e?.hasAttribute("popover")&&(i.hasAttribute("title")&&i.removeAttribute("title"),i.hasAttribute("aria-describedby")||i.setAttribute("aria-describedby",t),cs(i,e),os(i,e))}function wr(i=document){i.querySelectorAll("[data-tooltip]").forEach(t=>{if(t.closest("tool-tip")||t.hasAttribute("data-tooltip-init"))return;t.setAttribute("data-tooltip-init","");let e=t.dataset.tooltip;e?Dc(t,e):Nc(t)}),i.querySelectorAll("[aria-describedby]").forEach(t=>{let e=t.getAttribute("aria-describedby")??"",s=document.getElementById(e);!s?.hasAttribute("popover")||!s.matches('[role="tooltip"]')||t.closest("tool-tip")||t.hasAttribute("data-tooltip-init")||(t.setAttribute("data-tooltip-init",""),cs(t,s),os(t,s))}),i.querySelectorAll("[popovertarget]").forEach(t=>{let e=t.getAttribute("popovertarget")??"",s=document.getElementById(e);!s?.hasAttribute("popover")||!s.matches('[role="tooltip"]')||s.hasAttribute("data-tooltip-click-init")||(s.setAttribute("data-tooltip-click-init",""),s.addEventListener("toggle",n=>{n.newState==="open"&&de(t,s)}))})}function de(i,t){if(t.hasAttribute("data-anchor"))return;let e=i.getBoundingClientRect(),s=t.dataset.tooltipPosition||"top",n=8,r=t.getBoundingClientRect(),a,o;switch(s){case"bottom":a=e.bottom+n,o=e.left+(e.width-r.width)/2;break;case"left":a=e.top+(e.height-r.height)/2,o=e.left-r.width-n;break;case"right":a=e.top+(e.height-r.height)/2,o=e.right+n;break;default:a=e.top-r.height-n,o=e.left+(e.width-r.width)/2;break}let c=8;o=Math.max(c,Math.min(o,window.innerWidth-r.width-c)),a=Math.max(c,Math.min(a,window.innerHeight-r.height-c)),t.style.top=`${a}px`,t.style.left=`${o}px`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>wr()):wr();var ls="[data-vt-name]";function hs(i){i.hasAttribute("data-vt-name-init")||(i.setAttribute("data-vt-name-init",""),i.style.viewTransitionName=i.dataset.vtName)}function Er(i=document){i.querySelectorAll(ls).forEach(hs)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Er()):Er();var _c=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let s=e;s.matches(ls)&&hs(s),s.querySelectorAll(ls).forEach(hs)}});_c.observe(document.documentElement,{childList:!0,subtree:!0});function Ar(i){document.querySelectorAll("browser-window").forEach(t=>{t.setAttribute("mode",i)}),document.querySelectorAll("code-block").forEach(t=>{t.setAttribute("theme",i)})}function Sr(){let{effectiveMode:i}=S.getState();Ar(i),window.addEventListener("vb:theme-change",e=>{Ar(e.detail.effectiveMode)}),new MutationObserver(e=>{let{effectiveMode:s}=S.getState();for(let n of e)for(let r of n.addedNodes){if(r.nodeType!==Node.ELEMENT_NODE)continue;let a=r;a.tagName==="BROWSER-WINDOW"?a.setAttribute("mode",s):a.tagName==="CODE-BLOCK"&&a.setAttribute("theme",s),a.querySelectorAll("browser-window").forEach(o=>{o.setAttribute("mode",s)}),a.querySelectorAll("code-block").forEach(o=>{o.setAttribute("theme",s)})}}).observe(document.body,{childList:!0,subtree:!0})}kt();function Ot(i){return[...i.querySelectorAll("input, select, textarea")].filter(t=>t.type!=="submit"&&t.type!=="button"&&t.type!=="hidden"&&!("honeypot"in t.dataset))}function xr(i){return[...i.querySelectorAll("form-field[data-upgraded]")]}function qc(i){return i.labels?.[0]?.textContent?.trim()??i.getAttribute("aria-label")??i.name??i.id}function $t(i,t){let e=i.dataset.match;if(!e)return;let s=t.querySelector(`#${CSS.escape(e)}`)??t.querySelector(`[name="${CSS.escape(e)}"]`);if(s){if(i.setCustomValidity(""),i.value&&s.value&&i.value!==s.value){let n=i.dataset.messageMatch??"Values do not match";i.setCustomValidity(n);let r=Cr(i);r&&(r.textContent=n)}else if(i.validity.valid){let n=Cr(i);n&&(n.textContent="")}}}function Cr(i){let t=i.getAttribute("aria-describedby")?.split(/\s+/)??[];for(let s of t){let n=document.getElementById(s);if(n?.tagName==="OUTPUT"&&n.classList.contains("error"))return n}return i.closest("form-field")?.querySelector("output.error")??null}function kr(i){let e=[...i.querySelectorAll('input[type="checkbox"]')].filter(o=>o.checked).length,s=parseInt(i.dataset.minChecked??"0",10),n=parseInt(i.dataset.maxChecked??"999",10),r=i.querySelector(":scope > output"),a=null;return e<s&&(a=i.dataset.messageMinChecked??`Select at least ${s}`),e>n&&(a=i.dataset.messageMaxChecked??`Select no more than ${n}`),r&&(r.textContent=a??""),a?i.dataset.invalid="":delete i.dataset.invalid,!a}function Tr(i){let t=i.querySelector("[data-form-summary]");if(t)return{el:t,type:"authored"};let e=i.querySelector("output.error-summary");return e?{el:e,type:"legacy"}:null}function ue(i,t,{focus:e=!1}={}){if(!t)return;let s=[];for(let n of Ot(i))n.validity.valid||s.push({id:n.id||n.name,label:qc(n),message:n.validationMessage});for(let n of i.querySelectorAll("fieldset[data-invalid]")){let r=n.querySelector(":scope > output");s.push({id:n.id||"",label:n.querySelector("legend")?.textContent?.trim()??"Group",message:r?.textContent||"Invalid selection"})}if(s.length===0){Lr(t);return}if(t.type==="authored"){let n=t.el.querySelector("[data-summary-list]");if(n){n.innerHTML="";for(let r of s){let a=document.createElement("li"),o=document.createElement("a");o.href=r.id?`#${r.id}`:"#",o.textContent=`${r.label}: ${r.message}`,a.appendChild(o),n.appendChild(a)}}t.el.removeAttribute("hidden"),t.el.dataset.visible=""}else{let n=s.length,r=s.map(a=>`<li><a href="${a.id?`#${a.id}`:"#"}">${a.label}: ${a.message}</a></li>`).join(`
|
|
394
394
|
`);t.el.innerHTML=`<p>Please fix ${n} error${n===1?"":"s"}:</p>
|
|
395
395
|
<ul>
|
|
396
396
|
${r}
|
|
397
|
-
</ul>`}e&&t.el.focus()}function xr(i){if(i)if(i.type==="authored"){delete i.el.dataset.visible;let t=i.el.querySelector("[data-summary-list]");t&&i.el.addEventListener("transitionend",()=>{i.el.dataset.visible||(t.innerHTML="")},{once:!0})}else i.el.innerHTML=""}function xc(i){i&&i.el.addEventListener("click",t=>{let e=t.target.closest('a[href^="#"]');if(!e)return;t.preventDefault();let s=e.getAttribute("href").slice(1),n=document.getElementById(s);n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),n.focus())})}function Tc(i){for(let t of It(i))t.focus({preventScroll:!0}),t.blur()}async function Lc(i){let t=i.querySelector('[type="submit"]');i.dataset.submitting="",delete i.dataset.error,t&&t.setAttribute("aria-disabled","true");try{let e=new FormData(i),s=await fetch(i.action,{method:i.method||"post",body:e});if(delete i.dataset.submitting,t&&t.removeAttribute("aria-disabled"),!s.ok){if((s.headers.get("content-type")??"").includes("application/json")){let a=await s.json();if(a.errors){Mc(i,a.errors);return}}throw new Error(`Server error: ${s.status}`)}i.dataset.success="";let n=i.querySelector("[data-form-success]");n&&(n.hidden=!1,n.focus())}catch{delete i.dataset.submitting,t&&t.removeAttribute("aria-disabled"),i.dataset.error="network"}}function Mc(i,t){i.dataset.error="";let e=Cr(i),s=[];for(let n of e){let r=n.querySelector("input, textarea, select");if(!r)continue;let a=t[r.name];a&&(n.setError(a),s.push(n))}if(s.length>0){let n=kr(i);ue(i,n,{focus:!0})}for(let n of e)n.querySelector("input, textarea, select")?.addEventListener("input",()=>n.clearError(),{once:!0})}function hs(i){if(i.hasAttribute("data-vb-enhanced"))return;i.setAttribute("novalidate",""),i.setAttribute("data-vb-enhanced","");let t=kr(i);t&&xc(t);for(let e of It(i))if(e.dataset.match){e.addEventListener("input",()=>$t(e,i)),e.addEventListener("blur",()=>$t(e,i));let s=e.dataset.match,n=i.querySelector(`#${CSS.escape(s)}`)??i.querySelector(`[name="${CSS.escape(s)}"]`);n&&n.addEventListener("input",()=>$t(e,i))}for(let e of i.querySelectorAll("fieldset[data-min-checked], fieldset[data-max-checked]"))e.addEventListener("change",()=>{Sr(e),t&&ue(i,t)});i.addEventListener("submit",e=>{e.preventDefault();let s=Cr(i);for(let o of s)o.validate();for(let o of It(i))o.dataset.match&&$t(o,i);for(let o of i.querySelectorAll("fieldset[data-min-checked], fieldset[data-max-checked]"))Sr(o);if(Tc(i),!(i.checkValidity()&&![...i.querySelectorAll("fieldset[data-invalid]")].length)){if(t)ue(i,t,{focus:!0});else{let o=i.querySelector(":invalid");o&&(o.scrollIntoView({behavior:"smooth",block:"center"}),o.focus())}return}xr(t);let r=new CustomEvent("vb:beforesubmit",{bubbles:!0,cancelable:!0,detail:{form:i}});if(i.dispatchEvent(r),r.defaultPrevented)return;let a=i.dataset.submit??"native";if(a==="fetch")Lc(i);else if(a==="event"){let o=new CustomEvent("vb:submit",{bubbles:!0,cancelable:!0,detail:new FormData(i)});i.dispatchEvent(o)}else i.submit()}),t&&i.addEventListener("input",()=>{requestAnimationFrame(()=>{for(let e of It(i))e.dataset.match&&$t(e,i);ue(i,t)})})}function Tr(){for(let t of document.querySelectorAll("form[data-validate]"))hs(t);new MutationObserver(t=>{for(let e of t)for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.matches?.("form[data-validate]")&&hs(n),n.querySelectorAll?.("form[data-validate]").forEach(r=>hs(r))}}).observe(document.body,{childList:!0,subtree:!0})}var Lr='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/></svg>',Nc='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/><path d="m2 2 20 20"/></svg>';function ds(i){let t=i.querySelector('input[type="password"]');if(!t||i.dataset.enhanced==="password")return;i.dataset.enhanced="password";let e=document.createElement("div");e.className="password-wrapper",t.parentNode.insertBefore(e,t),e.appendChild(t);let s=document.createElement("button");s.type="button",s.className="password-toggle",s.setAttribute("aria-label","Show password"),s.setAttribute("aria-pressed","false"),s.innerHTML=Lr,e.appendChild(s),s.addEventListener("click",()=>{let n=t.type==="password";t.type=n?"text":"password",s.setAttribute("aria-pressed",String(n)),s.setAttribute("aria-label",n?"Hide password":"Show password"),s.innerHTML=n?Nc:Lr})}function us(i){let t=i.querySelector('input[data-type="otp"], input[data-type="pin"]');if(!t||i.dataset.enhanced==="otp")return;i.dataset.enhanced="otp";let e=parseInt(t.dataset.length||"6",10);t.type="hidden",t.removeAttribute("inputmode"),t.removeAttribute("pattern");let s=document.createElement("div");s.className="otp-wrapper",t.parentNode.insertBefore(s,t.nextSibling);let n=[];for(let a=0;a<e;a++){let o=document.createElement("input");o.type="text",o.inputMode="numeric",o.maxLength=1,o.pattern="[0-9]",o.className="otp-digit",o.setAttribute("aria-label",`Digit ${a+1} of ${e}`),n.push(o),s.appendChild(o)}function r(){t.value=n.map(a=>a.value).join(""),t.dispatchEvent(new Event("input",{bubbles:!0}))}n.forEach((a,o)=>{a.addEventListener("input",c=>{let l=c.target.value;if(l&&!/^\d$/.test(l)){c.target.value="";return}l&&o<n.length-1&&n[o+1].focus(),r()}),a.addEventListener("keydown",c=>{c.key==="Backspace"&&!c.target.value&&o>0&&n[o-1].focus(),c.key==="ArrowLeft"&&o>0&&(c.preventDefault(),n[o-1].focus()),c.key==="ArrowRight"&&o<n.length-1&&(c.preventDefault(),n[o+1].focus())}),a.addEventListener("paste",c=>{c.preventDefault();let h=((c.clipboardData||window.clipboardData)?.getData("text")??"").replace(/\D/g,"").slice(0,e).split("");h.forEach((u,b)=>{n[b]&&(n[b].value=u)});let d=n.findIndex(u=>!u.value);d!==-1?n[d].focus():h.length>0&&n[Math.min(h.length-1,e-1)].focus(),r()}),a.addEventListener("focus",()=>{a.select()})}),i.addEventListener("click",a=>{a.target===i&&n[0].focus()})}function ps(i){let t=i.querySelector("input[data-strength]");if(!t||i.dataset.enhanced==="strength")return;i.dataset.enhanced="strength";let e=t.dataset.rules||"length:8",s=Dc(e),n=document.createElement("div");n.className="strength-meter";let r=document.createElement("meter");r.min=0,r.max=s.length,r.low=Math.ceil(s.length*.4),r.high=Math.ceil(s.length*.75),r.optimum=s.length,r.value=0,r.className="xs";let a=document.createElement("span");a.className="strength-label",a.textContent="",n.appendChild(r),n.appendChild(a);let o=document.createElement("ul");o.className="strength-rules",o.setAttribute("aria-label","Password requirements"),s.forEach(l=>{let h=document.createElement("li");h.dataset.rule=l.type,h.textContent=l.label,o.appendChild(h)}),(i.querySelector(".password-wrapper")||t).insertAdjacentElement("afterend",n),n.insertAdjacentElement("afterend",o),t.addEventListener("input",()=>{let l=t.value,h=0;s.forEach((u,b)=>{let y=_c(u,l),p=o.children[b];p.dataset.met=y?"":void 0,y?(p.setAttribute("data-met",""),h++):p.removeAttribute("data-met")}),r.value=h;let d=h/s.length;l.length===0?(a.textContent="",n.dataset.level=""):d<.4?(a.textContent="Weak",n.dataset.level="weak"):d<.75?(a.textContent="Fair",n.dataset.level="fair"):d<1?(a.textContent="Good",n.dataset.level="good"):(a.textContent="Strong",n.dataset.level="strong")})}function Dc(i){return i.split(",").map(t=>{let[e,s]=t.trim().split(":");switch(e){case"length":return{type:e,param:parseInt(s)||8,label:`At least ${s||8} characters`};case"uppercase":return{type:e,label:"One uppercase letter"};case"lowercase":return{type:e,label:"One lowercase letter"};case"number":return{type:e,label:"One number"};case"special":return{type:e,label:"One special character"};default:return{type:e,label:e}}})}function _c(i,t){switch(i.type){case"length":return t.length>=(i.param||8);case"uppercase":return/[A-Z]/.test(t);case"lowercase":return/[a-z]/.test(t);case"number":return/\d/.test(t);case"special":return/[^A-Za-z0-9]/.test(t);default:return!1}}function qc(){document.querySelectorAll('form-field:has(input[type="password"])').forEach(ds)}function $c(){document.querySelectorAll('form-field:has(input[data-type="otp"]), form-field:has(input[data-type="pin"])').forEach(us)}function Ic(){document.querySelectorAll("form-field:has(input[data-strength])").forEach(ps)}function Mr(){qc(),$c(),Ic(),new MutationObserver(t=>{for(let e of t)for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.matches?.('form-field:has(input[type="password"])')&&ds(n),(n.matches?.('form-field:has(input[data-type="otp"])')||n.matches?.('form-field:has(input[data-type="pin"])'))&&us(n),n.matches?.("form-field:has(input[data-strength])")&&ps(n),n.querySelectorAll?.('form-field:has(input[type="password"])')?.forEach(ds),n.querySelectorAll?.('form-field:has(input[data-type="otp"]), form-field:has(input[data-type="pin"])')?.forEach(us),n.querySelectorAll?.("form-field:has(input[data-strength])")?.forEach(ps)}}).observe(document.body,{childList:!0,subtree:!0})}function Oc(i){let t=Date.now(),e=i*7+t%9973&65535;return btoa(JSON.stringify({s:i,t,c:e}))}function Bc(i,t,e){let s=0,n=i.submitAt-(i.firstInteractionAt??i.submitAt),r=t.querySelector("[data-honeypot]");return r&&r.value.trim()&&(s+=80),[...t.querySelectorAll('input[type="text"], input[type="email"], input[type="tel"], textarea')].filter(o=>o.value.trim()&&!("honeypot"in o.dataset)).length>0&&i.keyboardEventCount===0&&(s+=30),i.fieldFocusCount===0&&(s+=40),!e&&!i.mouseMovedInForm&&(s+=20),n<1e3?s+=80:n<3e3&&(s+=50),Math.min(s,100)}function Pc(i){return new Promise((t,e)=>{let s=document.createElement("script");s.src=i,s.async=!0,s.onload=t,s.onerror=e,document.head.appendChild(s)})}async function Fc(i,t){if(!document.querySelector("[data-cf-turnstile-loaded]"))try{await Pc("https://challenges.cloudflare.com/turnstile/v0/api.js"),document.head.dataset.cfTurnstileLoaded="";let e=document.createElement("div");e.className="cf-turnstile",e.dataset.sitekey=t,e.dataset.size="invisible",i.appendChild(e)}catch{}}function fs(i){if(i.hasAttribute("data-bot-enhanced"))return;i.setAttribute("data-bot-enhanced","");let t={fieldFocusCount:0,keyboardEventCount:0,mouseMovedInForm:!1,firstInteractionAt:null,submitAt:null},e=navigator.maxTouchPoints>0;i.addEventListener("focusin",s=>{s.target.matches("input, textarea, select")&&!("honeypot"in s.target.dataset)&&(t.fieldFocusCount++,t.firstInteractionAt??=Date.now())},{capture:!0}),i.addEventListener("keydown",s=>{s.target.matches("input, textarea")&&t.keyboardEventCount++},{capture:!0}),e||i.addEventListener("mousemove",()=>{t.mouseMovedInForm=!0},{once:!0}),i.addEventListener("vb:beforesubmit",s=>{t.submitAt=Date.now();let n=Bc(t,i,e),r=i.querySelector("[data-bot-score-field]");if(r||(r=document.createElement("input"),r.type="hidden",r.name="_vb_score",r.dataset.botScoreField="",i.appendChild(r)),r.value=Oc(n),n>=80){s.preventDefault(),i.dispatchEvent(new CustomEvent("vb:botblocked",{bubbles:!0,detail:{score:n}}));return}n>=60&&i.dataset.turnstileSitekey&&Fc(i,i.dataset.turnstileSitekey)})}function Nr(){for(let t of document.querySelectorAll("form[data-bot-protection]"))fs(t);new MutationObserver(t=>{for(let e of t)for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.matches?.("form[data-bot-protection]")&&fs(n),n.querySelectorAll?.("form[data-bot-protection]").forEach(r=>fs(r))}}).observe(document.body,{childList:!0,subtree:!0})}ot();ot();var Xc=1e3,Br=new Map;function gs(i,t){return e=>{let s=JSON.stringify(e.detail??null),n=Br.get(i),r=Date.now();n&&n.key===s&&r-n.at<Xc||(Br.set(i,{key:s,at:r}),t(e))}}var Jc={"vb:submit":i=>g.track("form.submit_valid",{formId:i.detail?.formId}),"wizard:step-change":i=>g.track("form.wizard_step",{from:i.detail?.from,to:i.detail?.to,direction:i.detail?.direction}),"wizard:complete":i=>g.track("form.wizard_complete",{steps:i.detail?.steps}),"wizard:reset":()=>g.track("form.wizard_reset"),"data-table:sort":i=>g.track("table.sort",{column:i.detail?.column,direction:i.detail?.direction,columnName:i.detail?.columnName}),"data-table:filter":i=>g.track("table.filter",{column:i.detail?.column,hasValue:!!i.detail?.value,length:i.detail?.value?.length??0}),"data-table:page":i=>g.track("table.paginate",{page:i.detail?.page}),"vb:theme-change":gs("vb:theme-change",i=>g.track("ui.theme_change",{theme:i.detail?.brand??i.detail?.theme,mode:i.detail?.mode})),"vb:a11y-themes-change":gs("vb:a11y-themes-change",i=>g.track("ui.a11y_theme",{themes:i.detail})),"vb:extensions-change":gs("vb:extensions-change",i=>g.track("ui.extension_toggle",{extensions:i.detail})),"heading-links:navigate":i=>g.track("docs.anchor_navigate",{id:i.detail?.id}),"page-toc:navigate":i=>g.track("docs.toc_navigate",{id:i.detail?.id}),"site-search:open":()=>g.track("search.open"),"site-search:close":i=>g.track("search.close",{hasQuery:i.detail?.hasQuery}),"theme-composer:change":i=>g.track("theme.compose",{dimension:i.detail?.dimension,source:i.detail?.source,token:i.detail?.token})},Zc={"accordion-wc:toggle":i=>g.track("ui.accordion_toggle",{open:i.detail?.open,index:i.detail?.index}),"tab-set:change":i=>g.track("ui.tab_change",{tab:i.detail?.tab}),"carousel-wc:change":i=>g.track("ui.carousel_slide",{index:i.detail?.index}),"carousel-wc:play":()=>g.track("ui.carousel_play"),"carousel-wc:pause":()=>g.track("ui.carousel_pause"),"data-table:expand":i=>g.track("table.row_expand",{row:i.detail?.row}),"data-table:selection":i=>g.track("table.row_select",{count:i.detail?.count??i.detail?.rows?.length??0}),"theme-picker:open":()=>g.track("ui.theme_picker_open"),"theme-picker:close":()=>g.track("ui.theme_picker_close"),"color-palette:select":i=>g.track("palette.color_select",{name:i.detail?.name,index:i.detail?.index}),"color-palette:change":i=>g.track("palette.color_edit",{name:i.detail?.name,index:i.detail?.index}),"semantic-palette:change":i=>g.track("palette.semantic_change",{role:i.detail?.role}),"token-specimen:change":i=>g.track("tokens.edit",{token:i.detail?.token}),"spacing-specimen:change":i=>g.track("tokens.spacing_edit",{token:i.detail?.token}),"type-specimen:change":i=>g.track("tokens.type_edit",{token:i.detail?.token}),"theme-export:change":i=>g.track("theme.export_format",{format:i.detail?.format})};function Pr(i){for(let[t,e]of Object.entries(i))(t.startsWith("vb:theme-change")||t==="vb:a11y-themes-change"||t==="vb:extensions-change"?window:document).addEventListener(t,e)}function Fr({tiers:i=["tier1","tier2"]}={}){i.includes("tier1")&&Pr(Jc),i.includes("tier2")&&Pr(Zc)}ot();await S.init();document.documentElement.hasAttribute("data-sticky")&&ti();Er();Tr();Mr();Nr();g.init({siteId:globalThis.vbAnalyticsConfig?.siteId??"vb-docs",transport:globalThis.vbAnalyticsConfig?.transport??"console",endpoint:globalThis.vbAnalyticsConfig?.endpoint??"/api/analytics"});Fr();Promise.resolve().then(()=>Hr());Promise.resolve().then(()=>zr());Promise.resolve().then(()=>Xr());document.querySelector("[data-wizard]")&&Promise.resolve().then(()=>(Qr(),Zr));document.querySelector("[data-watch-page], watch-wc")&&Promise.resolve().then(()=>(vi(),yi));export{g as Analytics};
|
|
397
|
+
</ul>`}e&&t.el.focus()}function Lr(i){if(i)if(i.type==="authored"){delete i.el.dataset.visible;let t=i.el.querySelector("[data-summary-list]");t&&i.el.addEventListener("transitionend",()=>{i.el.dataset.visible||(t.innerHTML="")},{once:!0})}else i.el.innerHTML=""}function $c(i){i&&i.el.addEventListener("click",t=>{let e=t.target.closest('a[href^="#"]');if(!e)return;t.preventDefault();let s=e.getAttribute("href").slice(1),n=document.getElementById(s);n&&(n.scrollIntoView({behavior:"smooth",block:"center"}),n.focus())})}function Oc(i){for(let t of Ot(i))t.focus({preventScroll:!0}),t.blur()}async function Ic(i){let t=i.querySelector('[type="submit"]');i.dataset.submitting="",delete i.dataset.error,t&&t.setAttribute("aria-disabled","true");try{let e=new FormData(i),s=await fetch(i.action,{method:i.method||"post",body:e});if(delete i.dataset.submitting,t&&t.removeAttribute("aria-disabled"),!s.ok){if((s.headers.get("content-type")??"").includes("application/json")){let a=await s.json();if(a.errors){Pc(i,a.errors);return}}throw new Error(`Server error: ${s.status}`)}i.dataset.success="";let n=i.querySelector("[data-form-success]");n&&(n.hidden=!1,n.focus())}catch{delete i.dataset.submitting,t&&t.removeAttribute("aria-disabled"),i.dataset.error="network"}}function Pc(i,t){i.dataset.error="";let e=xr(i),s=[];for(let n of e){let r=n.querySelector("input, textarea, select");if(!r)continue;let a=t[r.name];a&&(n.setError(a),s.push(n))}if(s.length>0){let n=Tr(i);ue(i,n,{focus:!0})}for(let n of e)n.querySelector("input, textarea, select")?.addEventListener("input",()=>n.clearError(),{once:!0})}function ds(i){if(i.hasAttribute("data-vb-enhanced"))return;i.setAttribute("novalidate",""),i.setAttribute("data-vb-enhanced","");let t=Tr(i);t&&$c(t);for(let e of Ot(i))if(e.dataset.match){e.addEventListener("input",()=>$t(e,i)),e.addEventListener("blur",()=>$t(e,i));let s=e.dataset.match,n=i.querySelector(`#${CSS.escape(s)}`)??i.querySelector(`[name="${CSS.escape(s)}"]`);n&&n.addEventListener("input",()=>$t(e,i))}for(let e of i.querySelectorAll("fieldset[data-min-checked], fieldset[data-max-checked]"))e.addEventListener("change",()=>{kr(e),t&&ue(i,t)});i.addEventListener("submit",e=>{e.preventDefault();let s=xr(i);for(let o of s)o.validate();for(let o of Ot(i))o.dataset.match&&$t(o,i);for(let o of i.querySelectorAll("fieldset[data-min-checked], fieldset[data-max-checked]"))kr(o);if(Oc(i),!(i.checkValidity()&&![...i.querySelectorAll("fieldset[data-invalid]")].length)){if(t)ue(i,t,{focus:!0});else{let o=i.querySelector(":invalid");o&&(o.scrollIntoView({behavior:"smooth",block:"center"}),o.focus())}return}Lr(t);let r=new CustomEvent("vb:beforesubmit",{bubbles:!0,cancelable:!0,detail:{form:i}});if(i.dispatchEvent(r),r.defaultPrevented)return;let a=i.dataset.submit??"native";if(a==="fetch")Ic(i);else if(a==="event"){let o=new CustomEvent("vb:submit",{bubbles:!0,cancelable:!0,detail:new FormData(i)});i.dispatchEvent(o)}else i.submit()}),t&&i.addEventListener("input",()=>{requestAnimationFrame(()=>{for(let e of Ot(i))e.dataset.match&&$t(e,i);ue(i,t)})})}function Mr(){for(let t of document.querySelectorAll("form[data-validate]"))ds(t);new MutationObserver(t=>{for(let e of t)for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.matches?.("form[data-validate]")&&ds(n),n.querySelectorAll?.("form[data-validate]").forEach(r=>ds(r))}}).observe(document.body,{childList:!0,subtree:!0})}var Nr='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/></svg>',Bc='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/><path d="m2 2 20 20"/></svg>';function us(i){let t=i.querySelector('input[type="password"]');if(!t||i.dataset.enhanced==="password")return;i.dataset.enhanced="password";let e=document.createElement("div");e.className="password-wrapper",t.parentNode.insertBefore(e,t),e.appendChild(t);let s=document.createElement("button");s.type="button",s.className="password-toggle",s.setAttribute("aria-label","Show password"),s.setAttribute("aria-pressed","false"),s.innerHTML=Nr,e.appendChild(s),s.addEventListener("click",()=>{let n=t.type==="password";t.type=n?"text":"password",s.setAttribute("aria-pressed",String(n)),s.setAttribute("aria-label",n?"Hide password":"Show password"),s.innerHTML=n?Bc:Nr})}function ps(i){let t=i.querySelector('input[data-type="otp"], input[data-type="pin"]');if(!t||i.dataset.enhanced==="otp")return;i.dataset.enhanced="otp";let e=parseInt(t.dataset.length||"6",10);t.type="hidden",t.removeAttribute("inputmode"),t.removeAttribute("pattern");let s=document.createElement("div");s.className="otp-wrapper",t.parentNode.insertBefore(s,t.nextSibling);let n=[];for(let a=0;a<e;a++){let o=document.createElement("input");o.type="text",o.inputMode="numeric",o.maxLength=1,o.pattern="[0-9]",o.className="otp-digit",o.setAttribute("aria-label",`Digit ${a+1} of ${e}`),n.push(o),s.appendChild(o)}function r(){t.value=n.map(a=>a.value).join(""),t.dispatchEvent(new Event("input",{bubbles:!0}))}n.forEach((a,o)=>{a.addEventListener("input",c=>{let l=c.target.value;if(l&&!/^\d$/.test(l)){c.target.value="";return}l&&o<n.length-1&&n[o+1].focus(),r()}),a.addEventListener("keydown",c=>{c.key==="Backspace"&&!c.target.value&&o>0&&n[o-1].focus(),c.key==="ArrowLeft"&&o>0&&(c.preventDefault(),n[o-1].focus()),c.key==="ArrowRight"&&o<n.length-1&&(c.preventDefault(),n[o+1].focus())}),a.addEventListener("paste",c=>{c.preventDefault();let h=((c.clipboardData||window.clipboardData)?.getData("text")??"").replace(/\D/g,"").slice(0,e).split("");h.forEach((u,b)=>{n[b]&&(n[b].value=u)});let d=n.findIndex(u=>!u.value);d!==-1?n[d].focus():h.length>0&&n[Math.min(h.length-1,e-1)].focus(),r()}),a.addEventListener("focus",()=>{a.select()})}),i.addEventListener("click",a=>{a.target===i&&n[0].focus()})}function fs(i){let t=i.querySelector("input[data-strength]");if(!t||i.dataset.enhanced==="strength")return;i.dataset.enhanced="strength";let e=t.dataset.rules||"length:8",s=Fc(e),n=document.createElement("div");n.className="strength-meter";let r=document.createElement("meter");r.min=0,r.max=s.length,r.low=Math.ceil(s.length*.4),r.high=Math.ceil(s.length*.75),r.optimum=s.length,r.value=0,r.className="xs";let a=document.createElement("span");a.className="strength-label",a.textContent="",n.appendChild(r),n.appendChild(a);let o=document.createElement("ul");o.className="strength-rules",o.setAttribute("aria-label","Password requirements"),s.forEach(l=>{let h=document.createElement("li");h.dataset.rule=l.type,h.textContent=l.label,o.appendChild(h)}),(i.querySelector(".password-wrapper")||t).insertAdjacentElement("afterend",n),n.insertAdjacentElement("afterend",o),t.addEventListener("input",()=>{let l=t.value,h=0;s.forEach((u,b)=>{let y=Rc(u,l),p=o.children[b];p.dataset.met=y?"":void 0,y?(p.setAttribute("data-met",""),h++):p.removeAttribute("data-met")}),r.value=h;let d=h/s.length;l.length===0?(a.textContent="",n.dataset.level=""):d<.4?(a.textContent="Weak",n.dataset.level="weak"):d<.75?(a.textContent="Fair",n.dataset.level="fair"):d<1?(a.textContent="Good",n.dataset.level="good"):(a.textContent="Strong",n.dataset.level="strong")})}function Fc(i){return i.split(",").map(t=>{let[e,s]=t.trim().split(":");switch(e){case"length":return{type:e,param:parseInt(s)||8,label:`At least ${s||8} characters`};case"uppercase":return{type:e,label:"One uppercase letter"};case"lowercase":return{type:e,label:"One lowercase letter"};case"number":return{type:e,label:"One number"};case"special":return{type:e,label:"One special character"};default:return{type:e,label:e}}})}function Rc(i,t){switch(i.type){case"length":return t.length>=(i.param||8);case"uppercase":return/[A-Z]/.test(t);case"lowercase":return/[a-z]/.test(t);case"number":return/\d/.test(t);case"special":return/[^A-Za-z0-9]/.test(t);default:return!1}}function Hc(){document.querySelectorAll('form-field:has(input[type="password"])').forEach(us)}function Vc(){document.querySelectorAll('form-field:has(input[data-type="otp"]), form-field:has(input[data-type="pin"])').forEach(ps)}function zc(){document.querySelectorAll("form-field:has(input[data-strength])").forEach(fs)}function Dr(){Hc(),Vc(),zc(),new MutationObserver(t=>{for(let e of t)for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.matches?.('form-field:has(input[type="password"])')&&us(n),(n.matches?.('form-field:has(input[data-type="otp"])')||n.matches?.('form-field:has(input[data-type="pin"])'))&&ps(n),n.matches?.("form-field:has(input[data-strength])")&&fs(n),n.querySelectorAll?.('form-field:has(input[type="password"])')?.forEach(us),n.querySelectorAll?.('form-field:has(input[data-type="otp"]), form-field:has(input[data-type="pin"])')?.forEach(ps),n.querySelectorAll?.("form-field:has(input[data-strength])")?.forEach(fs)}}).observe(document.body,{childList:!0,subtree:!0})}function Uc(i){let t=Date.now(),e=i*7+t%9973&65535;return btoa(JSON.stringify({s:i,t,c:e}))}function Wc(i,t,e){let s=0,n=i.submitAt-(i.firstInteractionAt??i.submitAt),r=t.querySelector("[data-honeypot]");return r&&r.value.trim()&&(s+=80),[...t.querySelectorAll('input[type="text"], input[type="email"], input[type="tel"], textarea')].filter(o=>o.value.trim()&&!("honeypot"in o.dataset)).length>0&&i.keyboardEventCount===0&&(s+=30),i.fieldFocusCount===0&&(s+=40),!e&&!i.mouseMovedInForm&&(s+=20),n<1e3?s+=80:n<3e3&&(s+=50),Math.min(s,100)}function jc(i){return new Promise((t,e)=>{let s=document.createElement("script");s.src=i,s.async=!0,s.onload=t,s.onerror=e,document.head.appendChild(s)})}async function Yc(i,t){if(!document.querySelector("[data-cf-turnstile-loaded]"))try{await jc("https://challenges.cloudflare.com/turnstile/v0/api.js"),document.head.dataset.cfTurnstileLoaded="";let e=document.createElement("div");e.className="cf-turnstile",e.dataset.sitekey=t,e.dataset.size="invisible",i.appendChild(e)}catch{}}function ms(i){if(i.hasAttribute("data-bot-enhanced"))return;i.setAttribute("data-bot-enhanced","");let t={fieldFocusCount:0,keyboardEventCount:0,mouseMovedInForm:!1,firstInteractionAt:null,submitAt:null},e=navigator.maxTouchPoints>0;i.addEventListener("focusin",s=>{s.target.matches("input, textarea, select")&&!("honeypot"in s.target.dataset)&&(t.fieldFocusCount++,t.firstInteractionAt??=Date.now())},{capture:!0}),i.addEventListener("keydown",s=>{s.target.matches("input, textarea")&&t.keyboardEventCount++},{capture:!0}),e||i.addEventListener("mousemove",()=>{t.mouseMovedInForm=!0},{once:!0}),i.addEventListener("vb:beforesubmit",s=>{t.submitAt=Date.now();let n=Wc(t,i,e),r=i.querySelector("[data-bot-score-field]");if(r||(r=document.createElement("input"),r.type="hidden",r.name="_vb_score",r.dataset.botScoreField="",i.appendChild(r)),r.value=Uc(n),n>=80){s.preventDefault(),i.dispatchEvent(new CustomEvent("vb:botblocked",{bubbles:!0,detail:{score:n}}));return}n>=60&&i.dataset.turnstileSitekey&&Yc(i,i.dataset.turnstileSitekey)})}function _r(){for(let t of document.querySelectorAll("form[data-bot-protection]"))ms(t);new MutationObserver(t=>{for(let e of t)for(let s of e.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let n=s;n.matches?.("form[data-bot-protection]")&&ms(n),n.querySelectorAll?.("form[data-bot-protection]").forEach(r=>ms(r))}}).observe(document.body,{childList:!0,subtree:!0})}ot();ot();var nl=1e3,Fr=new Map;function ys(i,t){return e=>{let s=JSON.stringify(e.detail??null),n=Fr.get(i),r=Date.now();n&&n.key===s&&r-n.at<nl||(Fr.set(i,{key:s,at:r}),t(e))}}var rl={"vb:submit":i=>g.track("form.submit_valid",{formId:i.detail?.formId}),"wizard:step-change":i=>g.track("form.wizard_step",{from:i.detail?.from,to:i.detail?.to,direction:i.detail?.direction}),"wizard:complete":i=>g.track("form.wizard_complete",{steps:i.detail?.steps}),"wizard:reset":()=>g.track("form.wizard_reset"),"data-table:sort":i=>g.track("table.sort",{column:i.detail?.column,direction:i.detail?.direction,columnName:i.detail?.columnName}),"data-table:filter":i=>g.track("table.filter",{column:i.detail?.column,hasValue:!!i.detail?.value,length:i.detail?.value?.length??0}),"data-table:page":i=>g.track("table.paginate",{page:i.detail?.page}),"vb:theme-change":ys("vb:theme-change",i=>g.track("ui.theme_change",{theme:i.detail?.brand??i.detail?.theme,mode:i.detail?.mode})),"vb:a11y-themes-change":ys("vb:a11y-themes-change",i=>g.track("ui.a11y_theme",{themes:i.detail})),"vb:extensions-change":ys("vb:extensions-change",i=>g.track("ui.extension_toggle",{extensions:i.detail})),"heading-links:navigate":i=>g.track("docs.anchor_navigate",{id:i.detail?.id}),"page-toc:navigate":i=>g.track("docs.toc_navigate",{id:i.detail?.id}),"site-search:open":()=>g.track("search.open"),"site-search:close":i=>g.track("search.close",{hasQuery:i.detail?.hasQuery}),"theme-composer:change":i=>g.track("theme.compose",{dimension:i.detail?.dimension,source:i.detail?.source,token:i.detail?.token})},al={"accordion-wc:toggle":i=>g.track("ui.accordion_toggle",{open:i.detail?.open,index:i.detail?.index}),"tab-set:change":i=>g.track("ui.tab_change",{tab:i.detail?.tab}),"carousel-wc:change":i=>g.track("ui.carousel_slide",{index:i.detail?.index}),"carousel-wc:play":()=>g.track("ui.carousel_play"),"carousel-wc:pause":()=>g.track("ui.carousel_pause"),"data-table:expand":i=>g.track("table.row_expand",{row:i.detail?.row}),"data-table:selection":i=>g.track("table.row_select",{count:i.detail?.count??i.detail?.rows?.length??0}),"theme-picker:open":()=>g.track("ui.theme_picker_open"),"theme-picker:close":()=>g.track("ui.theme_picker_close"),"color-palette:select":i=>g.track("palette.color_select",{name:i.detail?.name,index:i.detail?.index}),"color-palette:change":i=>g.track("palette.color_edit",{name:i.detail?.name,index:i.detail?.index}),"semantic-palette:change":i=>g.track("palette.semantic_change",{role:i.detail?.role}),"token-specimen:change":i=>g.track("tokens.edit",{token:i.detail?.token}),"spacing-specimen:change":i=>g.track("tokens.spacing_edit",{token:i.detail?.token}),"type-specimen:change":i=>g.track("tokens.type_edit",{token:i.detail?.token}),"theme-export:change":i=>g.track("theme.export_format",{format:i.detail?.format})};function Rr(i){for(let[t,e]of Object.entries(i))(t.startsWith("vb:theme-change")||t==="vb:a11y-themes-change"||t==="vb:extensions-change"?window:document).addEventListener(t,e)}function Hr({tiers:i=["tier1","tier2"]}={}){i.includes("tier1")&&Rr(rl),i.includes("tier2")&&Rr(al)}ot();await S.init();document.documentElement.hasAttribute("data-sticky")&&ti();Sr();Mr();Dr();_r();g.init({siteId:globalThis.vbAnalyticsConfig?.siteId??"vb-docs",transport:globalThis.vbAnalyticsConfig?.transport??"console",endpoint:globalThis.vbAnalyticsConfig?.endpoint??"/api/analytics"});Hr();Promise.resolve().then(()=>zr());Promise.resolve().then(()=>Wr());Promise.resolve().then(()=>Zr());document.querySelector("[data-wizard]")&&Promise.resolve().then(()=>(ea(),ta));document.querySelector("[data-watch-page], watch-wc")&&Promise.resolve().then(()=>(vi(),yi));export{g as Analytics};
|
|
398
398
|
//# sourceMappingURL=vanilla-breeze-core.js.map
|