vanilla-breeze 0.3.0 → 0.4.0
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/README.md +33 -4
- package/dist/cdn/components/activity-feed.js +1 -1
- package/dist/cdn/components/audio-player.js +2 -2
- package/dist/cdn/components/carousel-wc.js +1 -1
- package/dist/cdn/components/comment-box.js +16 -16
- package/dist/cdn/components/comment-thread.js +20 -20
- package/dist/cdn/components/comment-wc.js +1 -1
- package/dist/cdn/components/content-lens.js +1 -1
- package/dist/cdn/components/context-menu.js +1 -1
- package/dist/cdn/components/diagram-wc.js +1 -1
- package/dist/cdn/components/drop-down.js +1 -1
- package/dist/cdn/components/image-gallery.js +1 -1
- package/dist/cdn/components/manifest.json +44 -20
- package/dist/cdn/components/reaction-bar.js +1 -1
- package/dist/cdn/components/score-card.js +2 -2
- package/dist/cdn/components/settings-panel.js +15 -15
- package/dist/cdn/components/site-search.js +1 -1
- package/dist/cdn/components/social-embed.js +1 -1
- package/dist/cdn/components/tab-set.js +1 -1
- package/dist/cdn/components/theme-picker.js +45 -45
- package/dist/cdn/components/time-index.js +2 -2
- package/dist/cdn/components/time-picker.js +1 -1
- package/dist/cdn/components/version-switcher.js +1 -1
- package/dist/cdn/packs/effects.full.js +1 -1
- package/dist/cdn/packs/journal.effects.css +1 -1
- package/dist/cdn/packs/journal.full.css +1 -1
- package/dist/cdn/packs/kawaii.effects.css +1 -1
- package/dist/cdn/packs/kawaii.full.css +2 -2
- package/dist/cdn/packs/kawaii.full.js +4 -4
- package/dist/cdn/packs/kawaii.theme.css +1 -1
- package/dist/cdn/packs/manifest.json +11 -11
- package/dist/cdn/packs/memphis.full.css +1 -1
- package/dist/cdn/packs/memphis.theme.css +1 -1
- package/dist/cdn/packs/ui.full.css +1 -1
- package/dist/cdn/packs/ui.full.js +52 -52
- package/dist/cdn/themes/8bit.css +1 -1
- package/dist/cdn/themes/8bit.tokens.json +4 -4
- package/dist/cdn/themes/alpha1999-dark.tokens.json +4 -4
- package/dist/cdn/themes/alpha1999.css +1 -1
- package/dist/cdn/themes/alpha1999.tokens.json +4 -4
- package/dist/cdn/themes/anthropic.css +1 -1
- package/dist/cdn/themes/anthropic.tokens.json +4 -4
- package/dist/cdn/themes/art-deco-dark.tokens.json +4 -4
- package/dist/cdn/themes/art-deco.css +1 -1
- package/dist/cdn/themes/art-deco.tokens.json +4 -4
- package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
- package/dist/cdn/themes/bauhaus.css +1 -1
- package/dist/cdn/themes/bauhaus.tokens.json +4 -4
- package/dist/cdn/themes/brutalist-dark.tokens.json +4 -4
- package/dist/cdn/themes/brutalist.css +1 -1
- package/dist/cdn/themes/brutalist.tokens.json +4 -4
- package/dist/cdn/themes/catalog/atlassian.tokens.json +2 -2
- package/dist/cdn/themes/catalog/bootstrap.tokens.json +2 -2
- package/dist/cdn/themes/catalog/carbon.tokens.json +2 -2
- package/dist/cdn/themes/catalog/catppuccin-mocha.tokens.json +2 -2
- package/dist/cdn/themes/catalog/govuk.tokens.json +2 -2
- package/dist/cdn/themes/catalog/manifest.json +1 -1
- package/dist/cdn/themes/catalog/material.tokens.json +2 -2
- package/dist/cdn/themes/catalog/salesforce.tokens.json +2 -2
- package/dist/cdn/themes/catalog/tailwind.tokens.json +2 -2
- package/dist/cdn/themes/catppuccin-frappe.css +1 -1
- package/dist/cdn/themes/catppuccin-frappe.tokens.json +4 -4
- package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +4 -4
- package/dist/cdn/themes/catppuccin-latte.css +1 -1
- package/dist/cdn/themes/catppuccin-latte.tokens.json +4 -4
- package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
- package/dist/cdn/themes/catppuccin-macchiato.tokens.json +4 -4
- package/dist/cdn/themes/catppuccin-mocha.css +1 -1
- package/dist/cdn/themes/catppuccin-mocha.tokens.json +4 -4
- package/dist/cdn/themes/classic-dark.tokens.json +4 -4
- package/dist/cdn/themes/classic.css +1 -1
- package/dist/cdn/themes/classic.tokens.json +4 -4
- package/dist/cdn/themes/claymorphism-dark.tokens.json +10 -10
- package/dist/cdn/themes/claymorphism.css +1 -1
- package/dist/cdn/themes/claymorphism.tokens.json +10 -10
- package/dist/cdn/themes/clinical-dark.tokens.json +4 -4
- package/dist/cdn/themes/clinical.css +1 -1
- package/dist/cdn/themes/clinical.tokens.json +4 -4
- package/dist/cdn/themes/cottagecore-dark.tokens.json +4 -4
- package/dist/cdn/themes/cottagecore.css +1 -1
- package/dist/cdn/themes/cottagecore.tokens.json +4 -4
- package/dist/cdn/themes/cyber.css +1 -1
- package/dist/cdn/themes/cyber.tokens.json +4 -5
- package/dist/cdn/themes/dawn-dark.tokens.json +4 -4
- package/dist/cdn/themes/dawn.css +1 -1
- package/dist/cdn/themes/dawn.tokens.json +4 -4
- package/dist/cdn/themes/dracula.css +1 -1
- package/dist/cdn/themes/dracula.tokens.json +4 -4
- package/dist/cdn/themes/dusk.css +1 -1
- package/dist/cdn/themes/dusk.tokens.json +4 -4
- package/dist/cdn/themes/editorial-dark.tokens.json +3 -3
- package/dist/cdn/themes/editorial.css +1 -1
- package/dist/cdn/themes/editorial.tokens.json +4 -4
- package/dist/cdn/themes/financial-dark.tokens.json +4 -4
- package/dist/cdn/themes/financial.css +1 -1
- package/dist/cdn/themes/financial.tokens.json +4 -4
- package/dist/cdn/themes/genai.css +1 -1
- package/dist/cdn/themes/genai.tokens.json +4 -4
- package/dist/cdn/themes/glassmorphism-dark.tokens.json +4 -4
- package/dist/cdn/themes/glassmorphism.css +1 -1
- package/dist/cdn/themes/glassmorphism.tokens.json +4 -4
- package/dist/cdn/themes/government-dark.tokens.json +4 -4
- package/dist/cdn/themes/government.css +1 -1
- package/dist/cdn/themes/government.tokens.json +4 -4
- package/dist/cdn/themes/gruvbox-dark.tokens.json +4 -4
- package/dist/cdn/themes/gruvbox.css +1 -1
- package/dist/cdn/themes/gruvbox.tokens.json +4 -4
- package/dist/cdn/themes/high-noon-dark.tokens.json +4 -4
- package/dist/cdn/themes/high-noon.css +1 -1
- package/dist/cdn/themes/high-noon.tokens.json +4 -4
- package/dist/cdn/themes/ibm.css +1 -1
- package/dist/cdn/themes/ibm.tokens.json +6 -6
- package/dist/cdn/themes/journal-dark.tokens.json +4 -4
- package/dist/cdn/themes/journal.css +1 -1
- package/dist/cdn/themes/journal.tokens.json +4 -4
- package/dist/cdn/themes/kawaii-dark.tokens.json +4 -4
- package/dist/cdn/themes/kawaii.css +1 -1
- package/dist/cdn/themes/kawaii.tokens.json +4 -4
- package/dist/cdn/themes/magna-dark.tokens.json +4 -4
- package/dist/cdn/themes/magna.css +1 -1
- package/dist/cdn/themes/magna.tokens.json +4 -4
- package/dist/cdn/themes/manifest.json +48 -48
- package/dist/cdn/themes/mcdonalds.css +1 -1
- package/dist/cdn/themes/mcdonalds.tokens.json +4 -4
- package/dist/cdn/themes/midnight.css +1 -1
- package/dist/cdn/themes/midnight.tokens.json +4 -4
- package/dist/cdn/themes/minimal-dark.tokens.json +4 -4
- package/dist/cdn/themes/minimal.css +1 -1
- package/dist/cdn/themes/minimal.tokens.json +4 -4
- package/dist/cdn/themes/modern-dark.tokens.json +4 -4
- package/dist/cdn/themes/modern.css +1 -1
- package/dist/cdn/themes/modern.tokens.json +4 -4
- package/dist/cdn/themes/nes-dark.tokens.json +4 -4
- package/dist/cdn/themes/nes.css +1 -1
- package/dist/cdn/themes/nes.tokens.json +4 -4
- package/dist/cdn/themes/neumorphism-dark.tokens.json +10 -10
- package/dist/cdn/themes/neumorphism.css +1 -1
- package/dist/cdn/themes/neumorphism.tokens.json +10 -10
- package/dist/cdn/themes/nord-dark.tokens.json +4 -4
- package/dist/cdn/themes/nord.css +1 -1
- package/dist/cdn/themes/nord.tokens.json +4 -4
- package/dist/cdn/themes/organic-dark.tokens.json +4 -4
- package/dist/cdn/themes/organic.css +1 -1
- package/dist/cdn/themes/organic.tokens.json +4 -4
- package/dist/cdn/themes/rose-pine-dark.tokens.json +4 -4
- package/dist/cdn/themes/rose-pine.css +1 -1
- package/dist/cdn/themes/rose-pine.tokens.json +4 -4
- package/dist/cdn/themes/rough-dark.tokens.json +4 -5
- package/dist/cdn/themes/rough.css +1 -1
- package/dist/cdn/themes/rough.tokens.json +5 -6
- package/dist/cdn/themes/solarized-dark.tokens.json +4 -4
- package/dist/cdn/themes/solarized.css +1 -1
- package/dist/cdn/themes/solarized.tokens.json +4 -4
- package/dist/cdn/themes/starbucks.css +1 -1
- package/dist/cdn/themes/starbucks.tokens.json +4 -4
- package/dist/cdn/themes/startup-dark.tokens.json +4 -4
- package/dist/cdn/themes/startup.css +1 -1
- package/dist/cdn/themes/startup.tokens.json +4 -4
- package/dist/cdn/themes/super2026-dark.tokens.json +4 -4
- package/dist/cdn/themes/super2026.css +1 -1
- package/dist/cdn/themes/super2026.tokens.json +4 -4
- package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
- package/dist/cdn/themes/swiss.css +1 -1
- package/dist/cdn/themes/swiss.tokens.json +4 -4
- package/dist/cdn/themes/terminal.css +1 -1
- package/dist/cdn/themes/terminal.tokens.json +4 -4
- package/dist/cdn/themes/tokyo-night-dark.tokens.json +4 -4
- package/dist/cdn/themes/tokyo-night.css +1 -1
- package/dist/cdn/themes/tokyo-night.tokens.json +4 -4
- package/dist/cdn/themes/vaporwave-dark.tokens.json +4 -4
- package/dist/cdn/themes/vaporwave.css +1 -1
- package/dist/cdn/themes/vaporwave.tokens.json +4 -4
- package/dist/cdn/themes/win9x-dark.tokens.json +4 -4
- package/dist/cdn/themes/win9x.css +1 -1
- package/dist/cdn/themes/win9x.tokens.json +4 -4
- package/dist/cdn/vanilla-breeze-charts.css +1 -1
- package/dist/cdn/vanilla-breeze-core.css +1 -1
- package/dist/cdn/vanilla-breeze-core.js +62 -62
- package/dist/cdn/vanilla-breeze-dev.css +1 -1
- package/dist/cdn/vanilla-breeze-extras.js +19 -19
- package/dist/cdn/vanilla-breeze-labs.css +1 -1
- package/dist/cdn/vanilla-breeze.css +1 -1
- package/dist/cdn/vanilla-breeze.js +170 -170
- package/package.json +5 -8
- package/dist/cdn/components/accessibility-specimen.js +0 -11
- package/dist/cdn/components/adr-wc.js +0 -403
- package/dist/cdn/components/breakpoint-specimen.js +0 -26
- package/dist/cdn/components/burndown-chart.js +0 -2
- package/dist/cdn/components/capacity-plan.js +0 -25
- package/dist/cdn/components/color-palette.js +0 -16
- package/dist/cdn/components/component-sampler.js +0 -45
- package/dist/cdn/components/empathy-map.js +0 -582
- package/dist/cdn/components/font-pairer.js +0 -108
- package/dist/cdn/components/gantt-chart.js +0 -2
- package/dist/cdn/components/gradient-builder.js +0 -52
- package/dist/cdn/components/impact-effort.js +0 -2
- package/dist/cdn/components/iron-triangle.js +0 -2
- package/dist/cdn/components/kanban-board.js +0 -2
- package/dist/cdn/components/layout-specimen.js +0 -35
- package/dist/cdn/components/motion-specimen.js +0 -21
- package/dist/cdn/components/palette-generator.js +0 -15
- package/dist/cdn/components/product-roadmap.js +0 -3
- package/dist/cdn/components/quadrant-grid.js +0 -3
- package/dist/cdn/components/quality-target.js +0 -12
- package/dist/cdn/components/requirement-card.js +0 -122
- package/dist/cdn/components/review-surface.js +0 -535
- package/dist/cdn/components/risk-register.js +0 -25
- package/dist/cdn/components/semantic-palette.js +0 -30
- package/dist/cdn/components/spacing-specimen.js +0 -6
- package/dist/cdn/components/story-map.js +0 -2
- package/dist/cdn/components/theme-catalog.js +0 -28
- package/dist/cdn/components/theme-export.js +0 -26
- package/dist/cdn/components/theme-import.js +0 -44
- package/dist/cdn/components/token-specimen.js +0 -26
- package/dist/cdn/components/traceability-matrix.js +0 -3
- package/dist/cdn/components/type-specimen.js +0 -19
- package/dist/cdn/components/user-journey.js +0 -366
- package/dist/cdn/components/user-persona.js +0 -402
- package/dist/cdn/components/user-story.js +0 -411
- package/dist/cdn/components/work-item.js +0 -447
- package/dist/cdn/packs/design-system.full.css +0 -2
- package/dist/cdn/packs/design-system.full.js +0 -175
- package/dist/cdn/packs/ux-planning.full.css +0 -2
- package/dist/cdn/packs/ux-planning.full.js +0 -3160
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{for(var e in t)Ui(r,e,{get:t[e],enumerable:!0})};function Ke(r,t,e){let i=Math.pow(2,e),s=r*Math.PI/180,n=(t+180)/360*i,o=(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i,a=Math.floor(n),l=Math.floor(o),c=Math.round((n-a)*256),h=Math.round((o-l)*256);return{tileX:a,tileY:l,pixelX:c,pixelY:h}}function Xe(r,t,e){let i=256*Math.pow(2,e),s=r/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:s}}function rt(r,t,e,i,s){if(s)return s.replace("{z}",String(t)).replace("{x}",String(e)).replace("{y}",String(i));switch(r){case"carto-light":return`https://basemaps.cartocdn.com/light_all/${t}/${e}/${i}.png`;case"carto-dark":return`https://basemaps.cartocdn.com/dark_all/${t}/${e}/${i}.png`;default:return`https://tile.openstreetmap.org/${t}/${e}/${i}.png`}}var Lt=At(()=>{});var Je={};Ue(Je,{MapInteraction:()=>Mt});var Mt,Ye=At(()=>{Lt();Mt=class{#t;#e;#i;#s;#n;#r;#o=0;#a=0;#c=15;#l=1;#h=19;#f=0;#d=0;#p=new Map;#u=null;#b=0;#w=0;#m=!1;#g=0;#v=0;constructor({shadow:t,host:e,lat:i,lng:s,zoom:n,provider:o,tileUrl:a,onDeactivate:l}){this.#t=t,this.#e=e,this.#s=o,this.#n=a||"",this.#r=l,this.#c=n,this.#i=t.querySelector('[part="tiles"]'),this.#u=t.querySelector('[part="marker"]');let c=256*Math.pow(2,n),h=i*Math.PI/180;this.#o=(s+180)/360*c,this.#a=(1-Math.log(Math.tan(h)+1/Math.cos(h))/Math.PI)/2*c,this.#b=this.#o,this.#w=this.#a,this.#f=this.#e.offsetWidth||400,this.#d=this.#e.offsetHeight||300,this.#i.innerHTML="",this.#i.style.transform="",this.#u&&(this.#u.style.position="absolute",this.#u.style.top="",this.#u.style.left="",this.#i.appendChild(this.#u)),this.#y(),this.#E()}#y(){this.#i.addEventListener("pointerdown",this.#k),this.#i.addEventListener("wheel",this.#A,{passive:!1}),this.#e.addEventListener("keydown",this.#j)}#k=t=>{t.button===0&&(t.preventDefault(),this.#m=!0,this.#g=t.clientX,this.#v=t.clientY,this.#i.setPointerCapture(t.pointerId),this.#i.setAttribute("data-dragging",""),this.#i.addEventListener("pointermove",this.#C),this.#i.addEventListener("pointerup",this.#x))};#C=t=>{if(!this.#m)return;let e=t.clientX-this.#g,i=t.clientY-this.#v;this.#g=t.clientX,this.#v=t.clientY,this.#o-=e,this.#a-=i,this.#T(),this.#E()};#x=t=>{this.#m=!1,this.#i.releasePointerCapture(t.pointerId),this.#i.removeAttribute("data-dragging"),this.#i.removeEventListener("pointermove",this.#C),this.#i.removeEventListener("pointerup",this.#x),this.#L()};#A=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#l,Math.min(this.#h,this.#c+e)));if(i===this.#c)return;let s=this.#e.getBoundingClientRect(),n=t.clientX-s.left,o=t.clientY-s.top;this.#S(i,n,o)};#j=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.#o-=80,this.#T(),this.#E(),this.#L();break;case"ArrowRight":t.preventDefault(),this.#o+=80,this.#T(),this.#E(),this.#L();break;case"ArrowUp":t.preventDefault(),this.#a-=80,this.#T(),this.#E(),this.#L();break;case"ArrowDown":t.preventDefault(),this.#a+=80,this.#T(),this.#E(),this.#L();break;case"+":case"=":t.preventDefault(),this.#S(this.#c+1,this.#f/2,this.#d/2);break;case"-":t.preventDefault(),this.#S(this.#c-1,this.#f/2,this.#d/2);break;case"Escape":t.preventDefault(),this.#r();break}};#S(t,e,i){if(t=Math.max(this.#l,Math.min(this.#h,t)),t===this.#c)return;let s=this.#o-this.#f/2,n=this.#a-this.#d/2,o=s+e,a=n+i,l=Math.pow(2,t-this.#c);this.#o=o*l-e+this.#f/2,this.#a=a*l-i+this.#d/2,this.#b*=l,this.#w*=l,this.#c=t,this.#P(),this.#T(),this.#E(),this.#L()}#T(){let t=256*Math.pow(2,this.#c);this.#o=(this.#o%t+t)%t,this.#a=Math.max(this.#d/2,Math.min(t-this.#d/2,this.#a))}#E(){let t=-(this.#o-this.#f/2),e=-(this.#a-this.#d/2);this.#i.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#_(),this.#N(),this.#$()}#_(){let t=this.#c,e=Math.pow(2,t),i=this.#o-this.#f/2,s=this.#a-this.#d/2,n=i+this.#f,o=s+this.#d,a=Math.floor(i/256)-1,l=Math.max(0,Math.floor(s/256)-1),c=Math.ceil(n/256)+1,h=Math.min(e,Math.ceil(o/256)+1);for(let u=l;u<h;u++)for(let d=a;d<c;d++){let f=(d%e+e)%e,g=`${t}/${f}/${u}`;this.#p.has(g)||this.#M(t,d,u,f)}}#M(t,e,i,s){let n=`${t}/${s}/${i}`;if(this.#p.has(n))return;let o=e*256,a=i*256,l=document.createElement("img");l.src=rt(this.#s,t,s,i,this.#n),l.alt="",l.draggable=!1,l.style.left=o+"px",l.style.top=a+"px",l.style.width="256px",l.style.height="256px",l._wx=o,l._wy=a,this.#p.set(n,l),this.#i.appendChild(l)}#N(){let t=this.#o-this.#f/2,e=this.#a-this.#d/2,i=512;for(let[s,n]of this.#p){let o=n._wx,a=n._wy;(o+256<t-i||o>t+this.#f+i||a+256<e-i||a>e+this.#d+i)&&(n.remove(),this.#p.delete(s))}}#$(){if(!this.#u)return;let t=this.#u.offsetWidth||32;this.#u.style.left=`${Math.round(this.#b-t/2)}px`,this.#u.style.top=`${Math.round(this.#w-t)}px`,this.#u.style.transform=""}#L(){let{lat:t,lng:e}=Xe(this.#o,this.#a,this.#c);this.#e.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#c}}))}#P(){for(let t of this.#p.values())t.remove();this.#p.clear()}destroy(){if(this.#i.removeEventListener("pointerdown",this.#k),this.#i.removeEventListener("wheel",this.#A),this.#e.removeEventListener("keydown",this.#j),this.#i.removeEventListener("pointermove",this.#C),this.#i.removeEventListener("pointerup",this.#x),this.#u&&this.#u.parentNode===this.#i){let t=this.#t.querySelector('[part="container"]');t&&(t.insertBefore(this.#u,this.#i.nextSibling),this.#u.style.position="",this.#u.style.left="",this.#u.style.top="",this.#u.style.transform="")}this.#P(),this.#e.removeAttribute("data-interactive-active")}}});var Rt={};Ue(Rt,{EMOJI_ALIASES:()=>Ze,EMOJI_GROUPS:()=>Xi,EMOJI_GROUP_ICONS:()=>Yi,EMOJI_GROUP_LABELS:()=>Ji,EMOJI_MAP:()=>K,getByGroup:()=>Qi,resolveEmoji:()=>Zi,searchEmoji:()=>ts});function Qe(r){for(let[t,e,i,s]of r){if(K.has(t))continue;let n={shortcode:t,emoji:e,name:i,keywords:[],group:s};K.set(t,n),ot.push(n)}}function Zi(r){let t=K.get(r);if(t)return t;let e=Ze.get(r);return e&&K.get(e)||null}function Qi(r){let t=nt.filter(i=>i.group===r),e=ot.filter(i=>i.group===r);return e.length>0?t.concat(e):t}function ts(r){let t=r.toLowerCase().trim(),e=ot.length>0?nt.concat(ot):nt;return t?e.filter(i=>i.shortcode.includes(t)||i.name.toLowerCase().includes(t)||i.keywords&&i.keywords.some(s=>s.includes(t))):e}var nt,K,Ze,Xi,Ji,Yi,ot,jt=At(()=>{nt=[{shortcode:"smile",emoji:"\u{1F604}",name:"Smiling Face with Open Mouth",keywords:["happy","joy","laugh"],group:"smileys"},{shortcode:"grinning",emoji:"\u{1F600}",name:"Grinning Face",keywords:["happy","smile"],group:"smileys"},{shortcode:"laughing",emoji:"\u{1F606}",name:"Grinning Squinting Face",keywords:["happy","laugh"],group:"smileys"},{shortcode:"sweat_smile",emoji:"\u{1F605}",name:"Grinning Face with Sweat",keywords:["hot","relief"],group:"smileys"},{shortcode:"rofl",emoji:"\u{1F923}",name:"Rolling on the Floor Laughing",keywords:["lol","funny"],group:"smileys"},{shortcode:"joy",emoji:"\u{1F602}",name:"Face with Tears of Joy",keywords:["happy","cry","laugh"],group:"smileys"},{shortcode:"slightly_smiling_face",emoji:"\u{1F642}",name:"Slightly Smiling Face",keywords:["smile"],group:"smileys"},{shortcode:"upside_down_face",emoji:"\u{1F643}",name:"Upside-Down Face",keywords:["sarcasm","silly"],group:"smileys"},{shortcode:"wink",emoji:"\u{1F609}",name:"Winking Face",keywords:["flirt","joke"],group:"smileys"},{shortcode:"blush",emoji:"\u{1F60A}",name:"Smiling Face with Smiling Eyes",keywords:["happy","shy"],group:"smileys"},{shortcode:"innocent",emoji:"\u{1F607}",name:"Smiling Face with Halo",keywords:["angel","good"],group:"smileys"},{shortcode:"heart_eyes",emoji:"\u{1F60D}",name:"Smiling Face with Heart-Eyes",keywords:["love","crush"],group:"smileys"},{shortcode:"star_struck",emoji:"\u{1F929}",name:"Star-Struck",keywords:["wow","amazing"],group:"smileys"},{shortcode:"kissing_heart",emoji:"\u{1F618}",name:"Face Blowing a Kiss",keywords:["love","kiss"],group:"smileys"},{shortcode:"yum",emoji:"\u{1F60B}",name:"Face Savoring Food",keywords:["delicious","tasty"],group:"smileys"},{shortcode:"stuck_out_tongue",emoji:"\u{1F61B}",name:"Face with Tongue",keywords:["playful","silly"],group:"smileys"},{shortcode:"stuck_out_tongue_winking_eye",emoji:"\u{1F61C}",name:"Winking Face with Tongue",keywords:["silly","playful"],group:"smileys"},{shortcode:"zany_face",emoji:"\u{1F92A}",name:"Zany Face",keywords:["crazy","wild"],group:"smileys"},{shortcode:"hugs",emoji:"\u{1F917}",name:"Hugging Face",keywords:["hug","warm"],group:"smileys"},{shortcode:"thinking",emoji:"\u{1F914}",name:"Thinking Face",keywords:["hmm","consider"],group:"smileys"},{shortcode:"shushing_face",emoji:"\u{1F92B}",name:"Shushing Face",keywords:["quiet","secret"],group:"smileys"},{shortcode:"smirk",emoji:"\u{1F60F}",name:"Smirking Face",keywords:["sly","suggestive"],group:"smileys"},{shortcode:"unamused",emoji:"\u{1F612}",name:"Unamused Face",keywords:["bored","unimpressed"],group:"smileys"},{shortcode:"roll_eyes",emoji:"\u{1F644}",name:"Face with Rolling Eyes",keywords:["annoyed","whatever"],group:"smileys"},{shortcode:"grimacing",emoji:"\u{1F62C}",name:"Grimacing Face",keywords:["awkward","nervous"],group:"smileys"},{shortcode:"relieved",emoji:"\u{1F60C}",name:"Relieved Face",keywords:["calm","peaceful"],group:"smileys"},{shortcode:"pensive",emoji:"\u{1F614}",name:"Pensive Face",keywords:["sad","thoughtful"],group:"smileys"},{shortcode:"sleepy",emoji:"\u{1F62A}",name:"Sleepy Face",keywords:["tired","sleep"],group:"smileys"},{shortcode:"sleeping",emoji:"\u{1F634}",name:"Sleeping Face",keywords:["zzz","sleep"],group:"smileys"},{shortcode:"mask",emoji:"\u{1F637}",name:"Face with Medical Mask",keywords:["sick","health"],group:"smileys"},{shortcode:"nerd_face",emoji:"\u{1F913}",name:"Nerd Face",keywords:["geek","smart"],group:"smileys"},{shortcode:"sunglasses",emoji:"\u{1F60E}",name:"Smiling Face with Sunglasses",keywords:["cool","chill"],group:"smileys"},{shortcode:"confused",emoji:"\u{1F615}",name:"Confused Face",keywords:["puzzled","unsure"],group:"smileys"},{shortcode:"worried",emoji:"\u{1F61F}",name:"Worried Face",keywords:["anxious","concern"],group:"smileys"},{shortcode:"cry",emoji:"\u{1F622}",name:"Crying Face",keywords:["sad","tear"],group:"smileys"},{shortcode:"sob",emoji:"\u{1F62D}",name:"Loudly Crying Face",keywords:["sad","cry"],group:"smileys"},{shortcode:"angry",emoji:"\u{1F620}",name:"Angry Face",keywords:["mad","annoyed"],group:"smileys"},{shortcode:"rage",emoji:"\u{1F92C}",name:"Face with Symbols on Mouth",keywords:["angry","swear"],group:"smileys"},{shortcode:"exploding_head",emoji:"\u{1F92F}",name:"Exploding Head",keywords:["mind blown","shocked"],group:"smileys"},{shortcode:"flushed",emoji:"\u{1F633}",name:"Flushed Face",keywords:["embarrassed","shocked"],group:"smileys"},{shortcode:"scream",emoji:"\u{1F631}",name:"Face Screaming in Fear",keywords:["scared","horror"],group:"smileys"},{shortcode:"skull",emoji:"\u{1F480}",name:"Skull",keywords:["dead","death"],group:"smileys"},{shortcode:"clown_face",emoji:"\u{1F921}",name:"Clown Face",keywords:["joke","funny"],group:"smileys"},{shortcode:"ghost",emoji:"\u{1F47B}",name:"Ghost",keywords:["halloween","spooky"],group:"smileys"},{shortcode:"wave",emoji:"\u{1F44B}",name:"Waving Hand",keywords:["hello","goodbye"],group:"people"},{shortcode:"raised_hand",emoji:"\u270B",name:"Raised Hand",keywords:["stop","high five"],group:"people"},{shortcode:"ok_hand",emoji:"\u{1F44C}",name:"OK Hand",keywords:["perfect","nice"],group:"people"},{shortcode:"thumbsup",emoji:"\u{1F44D}",name:"Thumbs Up",keywords:["approve","good","yes"],group:"people"},{shortcode:"thumbsdown",emoji:"\u{1F44E}",name:"Thumbs Down",keywords:["disapprove","bad","no"],group:"people"},{shortcode:"clap",emoji:"\u{1F44F}",name:"Clapping Hands",keywords:["applause","bravo"],group:"people"},{shortcode:"raised_hands",emoji:"\u{1F64C}",name:"Raising Hands",keywords:["celebration","hooray"],group:"people"},{shortcode:"pray",emoji:"\u{1F64F}",name:"Folded Hands",keywords:["thanks","please","hope"],group:"people"},{shortcode:"handshake",emoji:"\u{1F91D}",name:"Handshake",keywords:["deal","agreement"],group:"people"},{shortcode:"point_up",emoji:"\u261D\uFE0F",name:"Index Pointing Up",keywords:["attention","important"],group:"people"},{shortcode:"point_right",emoji:"\u{1F449}",name:"Backhand Index Pointing Right",keywords:["direction","this"],group:"people"},{shortcode:"point_left",emoji:"\u{1F448}",name:"Backhand Index Pointing Left",keywords:["direction","that"],group:"people"},{shortcode:"point_down",emoji:"\u{1F447}",name:"Backhand Index Pointing Down",keywords:["direction","below"],group:"people"},{shortcode:"v",emoji:"\u270C\uFE0F",name:"Victory Hand",keywords:["peace","two"],group:"people"},{shortcode:"crossed_fingers",emoji:"\u{1F91E}",name:"Crossed Fingers",keywords:["luck","hope"],group:"people"},{shortcode:"muscle",emoji:"\u{1F4AA}",name:"Flexed Biceps",keywords:["strong","power"],group:"people"},{shortcode:"writing_hand",emoji:"\u270D\uFE0F",name:"Writing Hand",keywords:["write","note"],group:"people"},{shortcode:"eyes",emoji:"\u{1F440}",name:"Eyes",keywords:["look","see","watch"],group:"people"},{shortcode:"brain",emoji:"\u{1F9E0}",name:"Brain",keywords:["smart","think","mind"],group:"people"},{shortcode:"speaking_head",emoji:"\u{1F5E3}\uFE0F",name:"Speaking Head",keywords:["talk","announce"],group:"people"},{shortcode:"baby",emoji:"\u{1F476}",name:"Baby",keywords:["child","newborn"],group:"people"},{shortcode:"person_shrugging",emoji:"\u{1F937}",name:"Person Shrugging",keywords:["dunno","whatever"],group:"people"},{shortcode:"person_facepalming",emoji:"\u{1F926}",name:"Person Facepalming",keywords:["frustration","disbelief"],group:"people"},{shortcode:"person_raising_hand",emoji:"\u{1F64B}",name:"Person Raising Hand",keywords:["question","volunteer"],group:"people"},{shortcode:"ninja",emoji:"\u{1F977}",name:"Ninja",keywords:["stealth","hidden"],group:"people"},{shortcode:"dog",emoji:"\u{1F436}",name:"Dog Face",keywords:["puppy","pet"],group:"animals"},{shortcode:"cat",emoji:"\u{1F431}",name:"Cat Face",keywords:["kitten","pet"],group:"animals"},{shortcode:"mouse",emoji:"\u{1F42D}",name:"Mouse Face",keywords:["rodent"],group:"animals"},{shortcode:"rabbit",emoji:"\u{1F430}",name:"Rabbit Face",keywords:["bunny","easter"],group:"animals"},{shortcode:"fox",emoji:"\u{1F98A}",name:"Fox",keywords:["clever","sly"],group:"animals"},{shortcode:"bear",emoji:"\u{1F43B}",name:"Bear",keywords:["teddy","nature"],group:"animals"},{shortcode:"unicorn",emoji:"\u{1F984}",name:"Unicorn",keywords:["magic","fantasy"],group:"animals"},{shortcode:"bee",emoji:"\u{1F41D}",name:"Honeybee",keywords:["honey","buzz"],group:"animals"},{shortcode:"butterfly",emoji:"\u{1F98B}",name:"Butterfly",keywords:["pretty","nature"],group:"animals"},{shortcode:"turtle",emoji:"\u{1F422}",name:"Turtle",keywords:["slow","shell"],group:"animals"},{shortcode:"snake",emoji:"\u{1F40D}",name:"Snake",keywords:["reptile"],group:"animals"},{shortcode:"whale",emoji:"\u{1F433}",name:"Spouting Whale",keywords:["ocean","sea"],group:"animals"},{shortcode:"dolphin",emoji:"\u{1F42C}",name:"Dolphin",keywords:["ocean","smart"],group:"animals"},{shortcode:"eagle",emoji:"\u{1F985}",name:"Eagle",keywords:["bird","freedom"],group:"animals"},{shortcode:"owl",emoji:"\u{1F989}",name:"Owl",keywords:["wise","night"],group:"animals"},{shortcode:"penguin",emoji:"\u{1F427}",name:"Penguin",keywords:["cold","linux"],group:"animals"},{shortcode:"octopus",emoji:"\u{1F419}",name:"Octopus",keywords:["ocean","tentacle"],group:"animals"},{shortcode:"seedling",emoji:"\u{1F331}",name:"Seedling",keywords:["plant","grow"],group:"animals"},{shortcode:"evergreen_tree",emoji:"\u{1F332}",name:"Evergreen Tree",keywords:["nature","pine"],group:"animals"},{shortcode:"sunflower",emoji:"\u{1F33B}",name:"Sunflower",keywords:["flower","yellow"],group:"animals"},{shortcode:"rose",emoji:"\u{1F339}",name:"Rose",keywords:["flower","love"],group:"animals"},{shortcode:"apple",emoji:"\u{1F34E}",name:"Red Apple",keywords:["fruit","healthy"],group:"food"},{shortcode:"banana",emoji:"\u{1F34C}",name:"Banana",keywords:["fruit","yellow"],group:"food"},{shortcode:"grapes",emoji:"\u{1F347}",name:"Grapes",keywords:["fruit","wine"],group:"food"},{shortcode:"watermelon",emoji:"\u{1F349}",name:"Watermelon",keywords:["fruit","summer"],group:"food"},{shortcode:"avocado",emoji:"\u{1F951}",name:"Avocado",keywords:["guacamole","healthy"],group:"food"},{shortcode:"pizza",emoji:"\u{1F355}",name:"Pizza",keywords:["food","italian"],group:"food"},{shortcode:"hamburger",emoji:"\u{1F354}",name:"Hamburger",keywords:["burger","fast food"],group:"food"},{shortcode:"taco",emoji:"\u{1F32E}",name:"Taco",keywords:["mexican","food"],group:"food"},{shortcode:"sushi",emoji:"\u{1F363}",name:"Sushi",keywords:["japanese","fish"],group:"food"},{shortcode:"cookie",emoji:"\u{1F36A}",name:"Cookie",keywords:["sweet","biscuit"],group:"food"},{shortcode:"cake",emoji:"\u{1F382}",name:"Birthday Cake",keywords:["birthday","celebration"],group:"food"},{shortcode:"ice_cream",emoji:"\u{1F366}",name:"Soft Ice Cream",keywords:["dessert","cold"],group:"food"},{shortcode:"chocolate_bar",emoji:"\u{1F36B}",name:"Chocolate Bar",keywords:["sweet","candy"],group:"food"},{shortcode:"popcorn",emoji:"\u{1F37F}",name:"Popcorn",keywords:["movie","snack"],group:"food"},{shortcode:"coffee",emoji:"\u2615",name:"Hot Beverage",keywords:["tea","drink","morning"],group:"food"},{shortcode:"beer",emoji:"\u{1F37A}",name:"Beer Mug",keywords:["drink","bar"],group:"food"},{shortcode:"wine_glass",emoji:"\u{1F377}",name:"Wine Glass",keywords:["drink","alcohol"],group:"food"},{shortcode:"cocktail",emoji:"\u{1F378}",name:"Cocktail Glass",keywords:["drink","martini"],group:"food"},{shortcode:"hot_pepper",emoji:"\u{1F336}\uFE0F",name:"Hot Pepper",keywords:["spicy","chili"],group:"food"},{shortcode:"egg",emoji:"\u{1F95A}",name:"Egg",keywords:["breakfast","food"],group:"food"},{shortcode:"earth_americas",emoji:"\u{1F30E}",name:"Globe Americas",keywords:["world","planet"],group:"travel"},{shortcode:"earth_europe",emoji:"\u{1F30D}",name:"Globe Europe-Africa",keywords:["world","planet"],group:"travel"},{shortcode:"sun",emoji:"\u2600\uFE0F",name:"Sun",keywords:["weather","bright","warm"],group:"travel"},{shortcode:"moon",emoji:"\u{1F319}",name:"Crescent Moon",keywords:["night","sleep"],group:"travel"},{shortcode:"star",emoji:"\u2B50",name:"Star",keywords:["favorite","rating"],group:"travel"},{shortcode:"star2",emoji:"\u{1F31F}",name:"Glowing Star",keywords:["sparkle","shine"],group:"travel"},{shortcode:"cloud",emoji:"\u2601\uFE0F",name:"Cloud",keywords:["weather","sky"],group:"travel"},{shortcode:"rainbow",emoji:"\u{1F308}",name:"Rainbow",keywords:["colorful","weather"],group:"travel"},{shortcode:"snowflake",emoji:"\u2744\uFE0F",name:"Snowflake",keywords:["cold","winter"],group:"travel"},{shortcode:"zap",emoji:"\u26A1",name:"High Voltage",keywords:["lightning","electric","fast"],group:"travel"},{shortcode:"fire",emoji:"\u{1F525}",name:"Fire",keywords:["hot","flame","lit"],group:"travel"},{shortcode:"ocean",emoji:"\u{1F30A}",name:"Water Wave",keywords:["sea","wave","surf"],group:"travel"},{shortcode:"airplane",emoji:"\u2708\uFE0F",name:"Airplane",keywords:["travel","flight"],group:"travel"},{shortcode:"rocket",emoji:"\u{1F680}",name:"Rocket",keywords:["launch","space","fast"],group:"travel"},{shortcode:"car",emoji:"\u{1F697}",name:"Automobile",keywords:["drive","vehicle"],group:"travel"},{shortcode:"house",emoji:"\u{1F3E0}",name:"House",keywords:["home","building"],group:"travel"},{shortcode:"tent",emoji:"\u26FA",name:"Tent",keywords:["camping","outdoor"],group:"travel"},{shortcode:"mountain",emoji:"\u26F0\uFE0F",name:"Mountain",keywords:["nature","hike"],group:"travel"},{shortcode:"desert_island",emoji:"\u{1F3DD}\uFE0F",name:"Desert Island",keywords:["beach","vacation"],group:"travel"},{shortcode:"volcano",emoji:"\u{1F30B}",name:"Volcano",keywords:["eruption","nature"],group:"travel"},{shortcode:"soccer",emoji:"\u26BD",name:"Soccer Ball",keywords:["football","sport"],group:"activities"},{shortcode:"basketball",emoji:"\u{1F3C0}",name:"Basketball",keywords:["sport","hoop"],group:"activities"},{shortcode:"tennis",emoji:"\u{1F3BE}",name:"Tennis",keywords:["sport","ball"],group:"activities"},{shortcode:"video_game",emoji:"\u{1F3AE}",name:"Video Game",keywords:["gaming","controller"],group:"activities"},{shortcode:"dart",emoji:"\u{1F3AF}",name:"Bullseye",keywords:["target","goal"],group:"activities"},{shortcode:"trophy",emoji:"\u{1F3C6}",name:"Trophy",keywords:["winner","champion"],group:"activities"},{shortcode:"medal",emoji:"\u{1F947}",name:"Gold Medal",keywords:["first","winner"],group:"activities"},{shortcode:"tada",emoji:"\u{1F389}",name:"Party Popper",keywords:["celebration","party"],group:"activities"},{shortcode:"confetti_ball",emoji:"\u{1F38A}",name:"Confetti Ball",keywords:["party","celebration"],group:"activities"},{shortcode:"balloon",emoji:"\u{1F388}",name:"Balloon",keywords:["party","birthday"],group:"activities"},{shortcode:"art",emoji:"\u{1F3A8}",name:"Artist Palette",keywords:["paint","creative"],group:"activities"},{shortcode:"musical_note",emoji:"\u{1F3B5}",name:"Musical Note",keywords:["music","song"],group:"activities"},{shortcode:"microphone",emoji:"\u{1F3A4}",name:"Microphone",keywords:["sing","karaoke"],group:"activities"},{shortcode:"guitar",emoji:"\u{1F3B8}",name:"Guitar",keywords:["music","rock"],group:"activities"},{shortcode:"dice",emoji:"\u{1F3B2}",name:"Game Die",keywords:["chance","random"],group:"activities"},{shortcode:"bulb",emoji:"\u{1F4A1}",name:"Light Bulb",keywords:["idea","bright"],group:"objects"},{shortcode:"computer",emoji:"\u{1F4BB}",name:"Laptop",keywords:["tech","work"],group:"objects"},{shortcode:"keyboard",emoji:"\u2328\uFE0F",name:"Keyboard",keywords:["type","computer"],group:"objects"},{shortcode:"phone",emoji:"\u{1F4F1}",name:"Mobile Phone",keywords:["cell","call"],group:"objects"},{shortcode:"camera",emoji:"\u{1F4F7}",name:"Camera",keywords:["photo","picture"],group:"objects"},{shortcode:"tv",emoji:"\u{1F4FA}",name:"Television",keywords:["watch","screen"],group:"objects"},{shortcode:"battery",emoji:"\u{1F50B}",name:"Battery",keywords:["charge","power"],group:"objects"},{shortcode:"electric_plug",emoji:"\u{1F50C}",name:"Electric Plug",keywords:["power","connect"],group:"objects"},{shortcode:"mag",emoji:"\u{1F50D}",name:"Magnifying Glass Left",keywords:["search","find"],group:"objects"},{shortcode:"lock",emoji:"\u{1F512}",name:"Locked",keywords:["security","private"],group:"objects"},{shortcode:"unlock",emoji:"\u{1F513}",name:"Unlocked",keywords:["open","access"],group:"objects"},{shortcode:"key",emoji:"\u{1F511}",name:"Key",keywords:["access","password"],group:"objects"},{shortcode:"hammer",emoji:"\u{1F528}",name:"Hammer",keywords:["tool","build"],group:"objects"},{shortcode:"wrench",emoji:"\u{1F527}",name:"Wrench",keywords:["tool","fix"],group:"objects"},{shortcode:"gear",emoji:"\u2699\uFE0F",name:"Gear",keywords:["settings","config"],group:"objects"},{shortcode:"link",emoji:"\u{1F517}",name:"Link",keywords:["chain","url"],group:"objects"},{shortcode:"paperclip",emoji:"\u{1F4CE}",name:"Paperclip",keywords:["attach","clip"],group:"objects"},{shortcode:"scissors",emoji:"\u2702\uFE0F",name:"Scissors",keywords:["cut","snip"],group:"objects"},{shortcode:"pen",emoji:"\u{1F58A}\uFE0F",name:"Pen",keywords:["write","sign"],group:"objects"},{shortcode:"pencil",emoji:"\u270F\uFE0F",name:"Pencil",keywords:["write","draw"],group:"objects"},{shortcode:"book",emoji:"\u{1F4D6}",name:"Open Book",keywords:["read","study"],group:"objects"},{shortcode:"memo",emoji:"\u{1F4DD}",name:"Memo",keywords:["note","write"],group:"objects"},{shortcode:"package",emoji:"\u{1F4E6}",name:"Package",keywords:["box","delivery"],group:"objects"},{shortcode:"mailbox",emoji:"\u{1F4EC}",name:"Open Mailbox with Raised Flag",keywords:["mail","letter"],group:"objects"},{shortcode:"bell",emoji:"\u{1F514}",name:"Bell",keywords:["notification","alert"],group:"objects"},{shortcode:"red_heart",emoji:"\u2764\uFE0F",name:"Red Heart",keywords:["love","valentine"],group:"symbols"},{shortcode:"orange_heart",emoji:"\u{1F9E1}",name:"Orange Heart",keywords:["love"],group:"symbols"},{shortcode:"yellow_heart",emoji:"\u{1F49B}",name:"Yellow Heart",keywords:["love","friendship"],group:"symbols"},{shortcode:"green_heart",emoji:"\u{1F49A}",name:"Green Heart",keywords:["love","nature"],group:"symbols"},{shortcode:"blue_heart",emoji:"\u{1F499}",name:"Blue Heart",keywords:["love","trust"],group:"symbols"},{shortcode:"purple_heart",emoji:"\u{1F49C}",name:"Purple Heart",keywords:["love"],group:"symbols"},{shortcode:"broken_heart",emoji:"\u{1F494}",name:"Broken Heart",keywords:["sad","breakup"],group:"symbols"},{shortcode:"sparkles",emoji:"\u2728",name:"Sparkles",keywords:["shine","magic","new"],group:"symbols"},{shortcode:"hundred",emoji:"\u{1F4AF}",name:"Hundred Points",keywords:["perfect","score"],group:"symbols"},{shortcode:"boom",emoji:"\u{1F4A5}",name:"Collision",keywords:["explosion","impact"],group:"symbols"},{shortcode:"speech_balloon",emoji:"\u{1F4AC}",name:"Speech Balloon",keywords:["talk","chat","message"],group:"symbols"},{shortcode:"thought_balloon",emoji:"\u{1F4AD}",name:"Thought Balloon",keywords:["think","dream"],group:"symbols"},{shortcode:"check_mark",emoji:"\u2705",name:"Check Mark Button",keywords:["done","yes","complete"],group:"symbols"},{shortcode:"x",emoji:"\u274C",name:"Cross Mark",keywords:["no","wrong","delete"],group:"symbols"},{shortcode:"warning",emoji:"\u26A0\uFE0F",name:"Warning",keywords:["caution","alert"],group:"symbols"},{shortcode:"no_entry",emoji:"\u26D4",name:"No Entry",keywords:["stop","forbidden"],group:"symbols"},{shortcode:"question",emoji:"\u2753",name:"Question Mark",keywords:["help","what"],group:"symbols"},{shortcode:"exclamation",emoji:"\u2757",name:"Exclamation Mark",keywords:["important","attention"],group:"symbols"},{shortcode:"arrow_right",emoji:"\u27A1\uFE0F",name:"Right Arrow",keywords:["next","forward"],group:"symbols"},{shortcode:"arrow_left",emoji:"\u2B05\uFE0F",name:"Left Arrow",keywords:["back","previous"],group:"symbols"},{shortcode:"arrow_up",emoji:"\u2B06\uFE0F",name:"Up Arrow",keywords:["above"],group:"symbols"},{shortcode:"arrow_down",emoji:"\u2B07\uFE0F",name:"Down Arrow",keywords:["below"],group:"symbols"},{shortcode:"recycle",emoji:"\u267B\uFE0F",name:"Recycling Symbol",keywords:["environment","green"],group:"symbols"},{shortcode:"infinity",emoji:"\u267E\uFE0F",name:"Infinity",keywords:["forever","loop"],group:"symbols"},{shortcode:"checkered_flag",emoji:"\u{1F3C1}",name:"Chequered Flag",keywords:["finish","race"],group:"flags"},{shortcode:"triangular_flag",emoji:"\u{1F6A9}",name:"Triangular Flag",keywords:["red flag","warning"],group:"flags"},{shortcode:"white_flag",emoji:"\u{1F3F3}\uFE0F",name:"White Flag",keywords:["surrender","peace"],group:"flags"},{shortcode:"rainbow_flag",emoji:"\u{1F3F3}\uFE0F\u200D\u{1F308}",name:"Rainbow Flag",keywords:["pride","lgbtq"],group:"flags"},{shortcode:"pirate_flag",emoji:"\u{1F3F4}\u200D\u2620\uFE0F",name:"Pirate Flag",keywords:["jolly roger","skull"],group:"flags"},{shortcode:"flag_us",emoji:"\u{1F1FA}\u{1F1F8}",name:"Flag: United States",keywords:["usa","america"],group:"flags"},{shortcode:"flag_gb",emoji:"\u{1F1EC}\u{1F1E7}",name:"Flag: United Kingdom",keywords:["uk","britain"],group:"flags"},{shortcode:"flag_fr",emoji:"\u{1F1EB}\u{1F1F7}",name:"Flag: France",keywords:["french"],group:"flags"},{shortcode:"flag_de",emoji:"\u{1F1E9}\u{1F1EA}",name:"Flag: Germany",keywords:["german"],group:"flags"},{shortcode:"flag_jp",emoji:"\u{1F1EF}\u{1F1F5}",name:"Flag: Japan",keywords:["japanese"],group:"flags"},{shortcode:"flag_kr",emoji:"\u{1F1F0}\u{1F1F7}",name:"Flag: South Korea",keywords:["korean"],group:"flags"},{shortcode:"flag_br",emoji:"\u{1F1E7}\u{1F1F7}",name:"Flag: Brazil",keywords:["brazilian"],group:"flags"},{shortcode:"flag_in",emoji:"\u{1F1EE}\u{1F1F3}",name:"Flag: India",keywords:["indian"],group:"flags"},{shortcode:"flag_ca",emoji:"\u{1F1E8}\u{1F1E6}",name:"Flag: Canada",keywords:["canadian","maple"],group:"flags"},{shortcode:"flag_au",emoji:"\u{1F1E6}\u{1F1FA}",name:"Flag: Australia",keywords:["australian"],group:"flags"}],K=new Map(nt.map(r=>[r.shortcode,r])),Ze=new Map([["+1","thumbsup"],["-1","thumbsdown"],["heart","red_heart"],["thumbs_up","thumbsup"],["thumbs_down","thumbsdown"],["grin","grinning"],["laughing_crying","joy"],["lol","rofl"],["smiley","smile"],["cool","sunglasses"],["nerd","nerd_face"],["kiss","kissing_heart"],["hug","hugs"],["think","thinking"],["sad","cry"],["mad","angry"],["shrug","person_shrugging"],["facepalm","person_facepalming"],["raised_fist","muscle"],["pray_hands","pray"],["hi","wave"],["bye","wave"],["lightning","zap"],["flame","fire"],["hot","fire"],["bomb","boom"],["idea","bulb"],["laptop","computer"],["search","mag"],["party","tada"],["celebrate","tada"],["congrats","tada"],["check","check_mark"],["done","check_mark"],["yes","check_mark"],["no","x"],["wrong","x"],["love","red_heart"],["star_eyes","star_struck"],["mindblown","exploding_head"],["poop","skull"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),Xi=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],Ji={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},Yi={smileys:"\u{1F600}",people:"\u{1F44B}",animals:"\u{1F436}",food:"\u{1F355}",travel:"\u{1F30D}",activities:"\u{1F389}",objects:"\u{1F4A1}",symbols:"\u2764\uFE0F",flags:"\u{1F3C1}"},ot=[];globalThis.__vbEmojiRegister=Qe;globalThis.__vbEmojiExtended&&(Qe(globalThis.__vbEmojiExtended),delete globalThis.__vbEmojiExtended)});var pn=window.matchMedia("(prefers-reduced-motion: reduce)");var Ve=new Map;function p(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=Ve.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}Ve.set(r,s),customElements.define(r,t)}var m=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}};var Et=class extends m{#t=null;#e=null;#i=!1;#s=null;#n=null;#r=null;#o=null;#a=null;#c=null;#l=null;#h=null;#f=null;setup(){if(this.#t=this.querySelector("audio"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;return this.#d(),t&&(this.#u(),this.#b(),this.#w()),this.#k(),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#f=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#f),!0}teardown(){this.#t&&this.#t.setAttribute("controls","")}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.dispatchEvent(new CustomEvent("audio-player:src-changed",{detail:{src:e,source:"property"},bubbles:!0})))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#d(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
1
|
+
var Wi=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{for(var e in t)Wi(r,e,{get:t[e],enumerable:!0})};function Ke(r,t,e){let i=Math.pow(2,e),s=r*Math.PI/180,n=(t+180)/360*i,o=(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i,a=Math.floor(n),l=Math.floor(o),c=Math.round((n-a)*256),h=Math.round((o-l)*256);return{tileX:a,tileY:l,pixelX:c,pixelY:h}}function Xe(r,t,e){let i=256*Math.pow(2,e),s=r/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:s}}function rt(r,t,e,i,s){if(s)return s.replace("{z}",String(t)).replace("{x}",String(e)).replace("{y}",String(i));switch(r){case"carto-light":return`https://basemaps.cartocdn.com/light_all/${t}/${e}/${i}.png`;case"carto-dark":return`https://basemaps.cartocdn.com/dark_all/${t}/${e}/${i}.png`;default:return`https://tile.openstreetmap.org/${t}/${e}/${i}.png`}}var Lt=At(()=>{});var Je={};Ue(Je,{MapInteraction:()=>Mt});var Mt,Ye=At(()=>{Lt();Mt=class{#t;#e;#i;#s;#n;#r;#o=0;#a=0;#c=15;#l=1;#h=19;#f=0;#d=0;#p=new Map;#u=null;#b=0;#w=0;#m=!1;#g=0;#v=0;constructor({shadow:t,host:e,lat:i,lng:s,zoom:n,provider:o,tileUrl:a,onDeactivate:l}){this.#t=t,this.#e=e,this.#s=o,this.#n=a||"",this.#r=l,this.#c=n,this.#i=t.querySelector('[part="tiles"]'),this.#u=t.querySelector('[part="marker"]');let c=256*Math.pow(2,n),h=i*Math.PI/180;this.#o=(s+180)/360*c,this.#a=(1-Math.log(Math.tan(h)+1/Math.cos(h))/Math.PI)/2*c,this.#b=this.#o,this.#w=this.#a,this.#f=this.#e.offsetWidth||400,this.#d=this.#e.offsetHeight||300,this.#i.innerHTML="",this.#i.style.transform="",this.#u&&(this.#u.style.position="absolute",this.#u.style.top="",this.#u.style.left="",this.#i.appendChild(this.#u)),this.#y(),this.#E()}#y(){this.#i.addEventListener("pointerdown",this.#k),this.#i.addEventListener("wheel",this.#A,{passive:!1}),this.#e.addEventListener("keydown",this.#j)}#k=t=>{t.button===0&&(t.preventDefault(),this.#m=!0,this.#g=t.clientX,this.#v=t.clientY,this.#i.setPointerCapture(t.pointerId),this.#i.setAttribute("data-dragging",""),this.#i.addEventListener("pointermove",this.#C),this.#i.addEventListener("pointerup",this.#x))};#C=t=>{if(!this.#m)return;let e=t.clientX-this.#g,i=t.clientY-this.#v;this.#g=t.clientX,this.#v=t.clientY,this.#o-=e,this.#a-=i,this.#T(),this.#E()};#x=t=>{this.#m=!1,this.#i.releasePointerCapture(t.pointerId),this.#i.removeAttribute("data-dragging"),this.#i.removeEventListener("pointermove",this.#C),this.#i.removeEventListener("pointerup",this.#x),this.#L()};#A=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#l,Math.min(this.#h,this.#c+e)));if(i===this.#c)return;let s=this.#e.getBoundingClientRect(),n=t.clientX-s.left,o=t.clientY-s.top;this.#S(i,n,o)};#j=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.#o-=80,this.#T(),this.#E(),this.#L();break;case"ArrowRight":t.preventDefault(),this.#o+=80,this.#T(),this.#E(),this.#L();break;case"ArrowUp":t.preventDefault(),this.#a-=80,this.#T(),this.#E(),this.#L();break;case"ArrowDown":t.preventDefault(),this.#a+=80,this.#T(),this.#E(),this.#L();break;case"+":case"=":t.preventDefault(),this.#S(this.#c+1,this.#f/2,this.#d/2);break;case"-":t.preventDefault(),this.#S(this.#c-1,this.#f/2,this.#d/2);break;case"Escape":t.preventDefault(),this.#r();break}};#S(t,e,i){if(t=Math.max(this.#l,Math.min(this.#h,t)),t===this.#c)return;let s=this.#o-this.#f/2,n=this.#a-this.#d/2,o=s+e,a=n+i,l=Math.pow(2,t-this.#c);this.#o=o*l-e+this.#f/2,this.#a=a*l-i+this.#d/2,this.#b*=l,this.#w*=l,this.#c=t,this.#P(),this.#T(),this.#E(),this.#L()}#T(){let t=256*Math.pow(2,this.#c);this.#o=(this.#o%t+t)%t,this.#a=Math.max(this.#d/2,Math.min(t-this.#d/2,this.#a))}#E(){let t=-(this.#o-this.#f/2),e=-(this.#a-this.#d/2);this.#i.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#_(),this.#N(),this.#$()}#_(){let t=this.#c,e=Math.pow(2,t),i=this.#o-this.#f/2,s=this.#a-this.#d/2,n=i+this.#f,o=s+this.#d,a=Math.floor(i/256)-1,l=Math.max(0,Math.floor(s/256)-1),c=Math.ceil(n/256)+1,h=Math.min(e,Math.ceil(o/256)+1);for(let u=l;u<h;u++)for(let d=a;d<c;d++){let f=(d%e+e)%e,g=`${t}/${f}/${u}`;this.#p.has(g)||this.#M(t,d,u,f)}}#M(t,e,i,s){let n=`${t}/${s}/${i}`;if(this.#p.has(n))return;let o=e*256,a=i*256,l=document.createElement("img");l.src=rt(this.#s,t,s,i,this.#n),l.alt="",l.draggable=!1,l.style.left=o+"px",l.style.top=a+"px",l.style.width="256px",l.style.height="256px",l._wx=o,l._wy=a,this.#p.set(n,l),this.#i.appendChild(l)}#N(){let t=this.#o-this.#f/2,e=this.#a-this.#d/2,i=512;for(let[s,n]of this.#p){let o=n._wx,a=n._wy;(o+256<t-i||o>t+this.#f+i||a+256<e-i||a>e+this.#d+i)&&(n.remove(),this.#p.delete(s))}}#$(){if(!this.#u)return;let t=this.#u.offsetWidth||32;this.#u.style.left=`${Math.round(this.#b-t/2)}px`,this.#u.style.top=`${Math.round(this.#w-t)}px`,this.#u.style.transform=""}#L(){let{lat:t,lng:e}=Xe(this.#o,this.#a,this.#c);this.#e.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#c}}))}#P(){for(let t of this.#p.values())t.remove();this.#p.clear()}destroy(){if(this.#i.removeEventListener("pointerdown",this.#k),this.#i.removeEventListener("wheel",this.#A),this.#e.removeEventListener("keydown",this.#j),this.#i.removeEventListener("pointermove",this.#C),this.#i.removeEventListener("pointerup",this.#x),this.#u&&this.#u.parentNode===this.#i){let t=this.#t.querySelector('[part="container"]');t&&(t.insertBefore(this.#u,this.#i.nextSibling),this.#u.style.position="",this.#u.style.left="",this.#u.style.top="",this.#u.style.transform="")}this.#P(),this.#e.removeAttribute("data-interactive-active")}}});var Rt={};Ue(Rt,{EMOJI_ALIASES:()=>Ze,EMOJI_GROUPS:()=>Yi,EMOJI_GROUP_ICONS:()=>Qi,EMOJI_GROUP_LABELS:()=>Zi,EMOJI_MAP:()=>K,getByGroup:()=>es,resolveEmoji:()=>ts,searchEmoji:()=>is});function Qe(r){for(let[t,e,i,s]of r){if(K.has(t))continue;let n={shortcode:t,emoji:e,name:i,keywords:[],group:s};K.set(t,n),ot.push(n)}}function ts(r){let t=K.get(r);if(t)return t;let e=Ze.get(r);return e&&K.get(e)||null}function es(r){let t=nt.filter(i=>i.group===r),e=ot.filter(i=>i.group===r);return e.length>0?t.concat(e):t}function is(r){let t=r.toLowerCase().trim(),e=ot.length>0?nt.concat(ot):nt;return t?e.filter(i=>i.shortcode.includes(t)||i.name.toLowerCase().includes(t)||i.keywords&&i.keywords.some(s=>s.includes(t))):e}var nt,K,Ze,Yi,Zi,Qi,ot,jt=At(()=>{nt=[{shortcode:"smile",emoji:"\u{1F604}",name:"Smiling Face with Open Mouth",keywords:["happy","joy","laugh"],group:"smileys"},{shortcode:"grinning",emoji:"\u{1F600}",name:"Grinning Face",keywords:["happy","smile"],group:"smileys"},{shortcode:"laughing",emoji:"\u{1F606}",name:"Grinning Squinting Face",keywords:["happy","laugh"],group:"smileys"},{shortcode:"sweat_smile",emoji:"\u{1F605}",name:"Grinning Face with Sweat",keywords:["hot","relief"],group:"smileys"},{shortcode:"rofl",emoji:"\u{1F923}",name:"Rolling on the Floor Laughing",keywords:["lol","funny"],group:"smileys"},{shortcode:"joy",emoji:"\u{1F602}",name:"Face with Tears of Joy",keywords:["happy","cry","laugh"],group:"smileys"},{shortcode:"slightly_smiling_face",emoji:"\u{1F642}",name:"Slightly Smiling Face",keywords:["smile"],group:"smileys"},{shortcode:"upside_down_face",emoji:"\u{1F643}",name:"Upside-Down Face",keywords:["sarcasm","silly"],group:"smileys"},{shortcode:"wink",emoji:"\u{1F609}",name:"Winking Face",keywords:["flirt","joke"],group:"smileys"},{shortcode:"blush",emoji:"\u{1F60A}",name:"Smiling Face with Smiling Eyes",keywords:["happy","shy"],group:"smileys"},{shortcode:"innocent",emoji:"\u{1F607}",name:"Smiling Face with Halo",keywords:["angel","good"],group:"smileys"},{shortcode:"heart_eyes",emoji:"\u{1F60D}",name:"Smiling Face with Heart-Eyes",keywords:["love","crush"],group:"smileys"},{shortcode:"star_struck",emoji:"\u{1F929}",name:"Star-Struck",keywords:["wow","amazing"],group:"smileys"},{shortcode:"kissing_heart",emoji:"\u{1F618}",name:"Face Blowing a Kiss",keywords:["love","kiss"],group:"smileys"},{shortcode:"yum",emoji:"\u{1F60B}",name:"Face Savoring Food",keywords:["delicious","tasty"],group:"smileys"},{shortcode:"stuck_out_tongue",emoji:"\u{1F61B}",name:"Face with Tongue",keywords:["playful","silly"],group:"smileys"},{shortcode:"stuck_out_tongue_winking_eye",emoji:"\u{1F61C}",name:"Winking Face with Tongue",keywords:["silly","playful"],group:"smileys"},{shortcode:"zany_face",emoji:"\u{1F92A}",name:"Zany Face",keywords:["crazy","wild"],group:"smileys"},{shortcode:"hugs",emoji:"\u{1F917}",name:"Hugging Face",keywords:["hug","warm"],group:"smileys"},{shortcode:"thinking",emoji:"\u{1F914}",name:"Thinking Face",keywords:["hmm","consider"],group:"smileys"},{shortcode:"shushing_face",emoji:"\u{1F92B}",name:"Shushing Face",keywords:["quiet","secret"],group:"smileys"},{shortcode:"smirk",emoji:"\u{1F60F}",name:"Smirking Face",keywords:["sly","suggestive"],group:"smileys"},{shortcode:"unamused",emoji:"\u{1F612}",name:"Unamused Face",keywords:["bored","unimpressed"],group:"smileys"},{shortcode:"roll_eyes",emoji:"\u{1F644}",name:"Face with Rolling Eyes",keywords:["annoyed","whatever"],group:"smileys"},{shortcode:"grimacing",emoji:"\u{1F62C}",name:"Grimacing Face",keywords:["awkward","nervous"],group:"smileys"},{shortcode:"relieved",emoji:"\u{1F60C}",name:"Relieved Face",keywords:["calm","peaceful"],group:"smileys"},{shortcode:"pensive",emoji:"\u{1F614}",name:"Pensive Face",keywords:["sad","thoughtful"],group:"smileys"},{shortcode:"sleepy",emoji:"\u{1F62A}",name:"Sleepy Face",keywords:["tired","sleep"],group:"smileys"},{shortcode:"sleeping",emoji:"\u{1F634}",name:"Sleeping Face",keywords:["zzz","sleep"],group:"smileys"},{shortcode:"mask",emoji:"\u{1F637}",name:"Face with Medical Mask",keywords:["sick","health"],group:"smileys"},{shortcode:"nerd_face",emoji:"\u{1F913}",name:"Nerd Face",keywords:["geek","smart"],group:"smileys"},{shortcode:"sunglasses",emoji:"\u{1F60E}",name:"Smiling Face with Sunglasses",keywords:["cool","chill"],group:"smileys"},{shortcode:"confused",emoji:"\u{1F615}",name:"Confused Face",keywords:["puzzled","unsure"],group:"smileys"},{shortcode:"worried",emoji:"\u{1F61F}",name:"Worried Face",keywords:["anxious","concern"],group:"smileys"},{shortcode:"cry",emoji:"\u{1F622}",name:"Crying Face",keywords:["sad","tear"],group:"smileys"},{shortcode:"sob",emoji:"\u{1F62D}",name:"Loudly Crying Face",keywords:["sad","cry"],group:"smileys"},{shortcode:"angry",emoji:"\u{1F620}",name:"Angry Face",keywords:["mad","annoyed"],group:"smileys"},{shortcode:"rage",emoji:"\u{1F92C}",name:"Face with Symbols on Mouth",keywords:["angry","swear"],group:"smileys"},{shortcode:"exploding_head",emoji:"\u{1F92F}",name:"Exploding Head",keywords:["mind blown","shocked"],group:"smileys"},{shortcode:"flushed",emoji:"\u{1F633}",name:"Flushed Face",keywords:["embarrassed","shocked"],group:"smileys"},{shortcode:"scream",emoji:"\u{1F631}",name:"Face Screaming in Fear",keywords:["scared","horror"],group:"smileys"},{shortcode:"skull",emoji:"\u{1F480}",name:"Skull",keywords:["dead","death"],group:"smileys"},{shortcode:"clown_face",emoji:"\u{1F921}",name:"Clown Face",keywords:["joke","funny"],group:"smileys"},{shortcode:"ghost",emoji:"\u{1F47B}",name:"Ghost",keywords:["halloween","spooky"],group:"smileys"},{shortcode:"wave",emoji:"\u{1F44B}",name:"Waving Hand",keywords:["hello","goodbye"],group:"people"},{shortcode:"raised_hand",emoji:"\u270B",name:"Raised Hand",keywords:["stop","high five"],group:"people"},{shortcode:"ok_hand",emoji:"\u{1F44C}",name:"OK Hand",keywords:["perfect","nice"],group:"people"},{shortcode:"thumbsup",emoji:"\u{1F44D}",name:"Thumbs Up",keywords:["approve","good","yes"],group:"people"},{shortcode:"thumbsdown",emoji:"\u{1F44E}",name:"Thumbs Down",keywords:["disapprove","bad","no"],group:"people"},{shortcode:"clap",emoji:"\u{1F44F}",name:"Clapping Hands",keywords:["applause","bravo"],group:"people"},{shortcode:"raised_hands",emoji:"\u{1F64C}",name:"Raising Hands",keywords:["celebration","hooray"],group:"people"},{shortcode:"pray",emoji:"\u{1F64F}",name:"Folded Hands",keywords:["thanks","please","hope"],group:"people"},{shortcode:"handshake",emoji:"\u{1F91D}",name:"Handshake",keywords:["deal","agreement"],group:"people"},{shortcode:"point_up",emoji:"\u261D\uFE0F",name:"Index Pointing Up",keywords:["attention","important"],group:"people"},{shortcode:"point_right",emoji:"\u{1F449}",name:"Backhand Index Pointing Right",keywords:["direction","this"],group:"people"},{shortcode:"point_left",emoji:"\u{1F448}",name:"Backhand Index Pointing Left",keywords:["direction","that"],group:"people"},{shortcode:"point_down",emoji:"\u{1F447}",name:"Backhand Index Pointing Down",keywords:["direction","below"],group:"people"},{shortcode:"v",emoji:"\u270C\uFE0F",name:"Victory Hand",keywords:["peace","two"],group:"people"},{shortcode:"crossed_fingers",emoji:"\u{1F91E}",name:"Crossed Fingers",keywords:["luck","hope"],group:"people"},{shortcode:"muscle",emoji:"\u{1F4AA}",name:"Flexed Biceps",keywords:["strong","power"],group:"people"},{shortcode:"writing_hand",emoji:"\u270D\uFE0F",name:"Writing Hand",keywords:["write","note"],group:"people"},{shortcode:"eyes",emoji:"\u{1F440}",name:"Eyes",keywords:["look","see","watch"],group:"people"},{shortcode:"brain",emoji:"\u{1F9E0}",name:"Brain",keywords:["smart","think","mind"],group:"people"},{shortcode:"speaking_head",emoji:"\u{1F5E3}\uFE0F",name:"Speaking Head",keywords:["talk","announce"],group:"people"},{shortcode:"baby",emoji:"\u{1F476}",name:"Baby",keywords:["child","newborn"],group:"people"},{shortcode:"person_shrugging",emoji:"\u{1F937}",name:"Person Shrugging",keywords:["dunno","whatever"],group:"people"},{shortcode:"person_facepalming",emoji:"\u{1F926}",name:"Person Facepalming",keywords:["frustration","disbelief"],group:"people"},{shortcode:"person_raising_hand",emoji:"\u{1F64B}",name:"Person Raising Hand",keywords:["question","volunteer"],group:"people"},{shortcode:"ninja",emoji:"\u{1F977}",name:"Ninja",keywords:["stealth","hidden"],group:"people"},{shortcode:"dog",emoji:"\u{1F436}",name:"Dog Face",keywords:["puppy","pet"],group:"animals"},{shortcode:"cat",emoji:"\u{1F431}",name:"Cat Face",keywords:["kitten","pet"],group:"animals"},{shortcode:"mouse",emoji:"\u{1F42D}",name:"Mouse Face",keywords:["rodent"],group:"animals"},{shortcode:"rabbit",emoji:"\u{1F430}",name:"Rabbit Face",keywords:["bunny","easter"],group:"animals"},{shortcode:"fox",emoji:"\u{1F98A}",name:"Fox",keywords:["clever","sly"],group:"animals"},{shortcode:"bear",emoji:"\u{1F43B}",name:"Bear",keywords:["teddy","nature"],group:"animals"},{shortcode:"unicorn",emoji:"\u{1F984}",name:"Unicorn",keywords:["magic","fantasy"],group:"animals"},{shortcode:"bee",emoji:"\u{1F41D}",name:"Honeybee",keywords:["honey","buzz"],group:"animals"},{shortcode:"butterfly",emoji:"\u{1F98B}",name:"Butterfly",keywords:["pretty","nature"],group:"animals"},{shortcode:"turtle",emoji:"\u{1F422}",name:"Turtle",keywords:["slow","shell"],group:"animals"},{shortcode:"snake",emoji:"\u{1F40D}",name:"Snake",keywords:["reptile"],group:"animals"},{shortcode:"whale",emoji:"\u{1F433}",name:"Spouting Whale",keywords:["ocean","sea"],group:"animals"},{shortcode:"dolphin",emoji:"\u{1F42C}",name:"Dolphin",keywords:["ocean","smart"],group:"animals"},{shortcode:"eagle",emoji:"\u{1F985}",name:"Eagle",keywords:["bird","freedom"],group:"animals"},{shortcode:"owl",emoji:"\u{1F989}",name:"Owl",keywords:["wise","night"],group:"animals"},{shortcode:"penguin",emoji:"\u{1F427}",name:"Penguin",keywords:["cold","linux"],group:"animals"},{shortcode:"octopus",emoji:"\u{1F419}",name:"Octopus",keywords:["ocean","tentacle"],group:"animals"},{shortcode:"seedling",emoji:"\u{1F331}",name:"Seedling",keywords:["plant","grow"],group:"animals"},{shortcode:"evergreen_tree",emoji:"\u{1F332}",name:"Evergreen Tree",keywords:["nature","pine"],group:"animals"},{shortcode:"sunflower",emoji:"\u{1F33B}",name:"Sunflower",keywords:["flower","yellow"],group:"animals"},{shortcode:"rose",emoji:"\u{1F339}",name:"Rose",keywords:["flower","love"],group:"animals"},{shortcode:"apple",emoji:"\u{1F34E}",name:"Red Apple",keywords:["fruit","healthy"],group:"food"},{shortcode:"banana",emoji:"\u{1F34C}",name:"Banana",keywords:["fruit","yellow"],group:"food"},{shortcode:"grapes",emoji:"\u{1F347}",name:"Grapes",keywords:["fruit","wine"],group:"food"},{shortcode:"watermelon",emoji:"\u{1F349}",name:"Watermelon",keywords:["fruit","summer"],group:"food"},{shortcode:"avocado",emoji:"\u{1F951}",name:"Avocado",keywords:["guacamole","healthy"],group:"food"},{shortcode:"pizza",emoji:"\u{1F355}",name:"Pizza",keywords:["food","italian"],group:"food"},{shortcode:"hamburger",emoji:"\u{1F354}",name:"Hamburger",keywords:["burger","fast food"],group:"food"},{shortcode:"taco",emoji:"\u{1F32E}",name:"Taco",keywords:["mexican","food"],group:"food"},{shortcode:"sushi",emoji:"\u{1F363}",name:"Sushi",keywords:["japanese","fish"],group:"food"},{shortcode:"cookie",emoji:"\u{1F36A}",name:"Cookie",keywords:["sweet","biscuit"],group:"food"},{shortcode:"cake",emoji:"\u{1F382}",name:"Birthday Cake",keywords:["birthday","celebration"],group:"food"},{shortcode:"ice_cream",emoji:"\u{1F366}",name:"Soft Ice Cream",keywords:["dessert","cold"],group:"food"},{shortcode:"chocolate_bar",emoji:"\u{1F36B}",name:"Chocolate Bar",keywords:["sweet","candy"],group:"food"},{shortcode:"popcorn",emoji:"\u{1F37F}",name:"Popcorn",keywords:["movie","snack"],group:"food"},{shortcode:"coffee",emoji:"\u2615",name:"Hot Beverage",keywords:["tea","drink","morning"],group:"food"},{shortcode:"beer",emoji:"\u{1F37A}",name:"Beer Mug",keywords:["drink","bar"],group:"food"},{shortcode:"wine_glass",emoji:"\u{1F377}",name:"Wine Glass",keywords:["drink","alcohol"],group:"food"},{shortcode:"cocktail",emoji:"\u{1F378}",name:"Cocktail Glass",keywords:["drink","martini"],group:"food"},{shortcode:"hot_pepper",emoji:"\u{1F336}\uFE0F",name:"Hot Pepper",keywords:["spicy","chili"],group:"food"},{shortcode:"egg",emoji:"\u{1F95A}",name:"Egg",keywords:["breakfast","food"],group:"food"},{shortcode:"earth_americas",emoji:"\u{1F30E}",name:"Globe Americas",keywords:["world","planet"],group:"travel"},{shortcode:"earth_europe",emoji:"\u{1F30D}",name:"Globe Europe-Africa",keywords:["world","planet"],group:"travel"},{shortcode:"sun",emoji:"\u2600\uFE0F",name:"Sun",keywords:["weather","bright","warm"],group:"travel"},{shortcode:"moon",emoji:"\u{1F319}",name:"Crescent Moon",keywords:["night","sleep"],group:"travel"},{shortcode:"star",emoji:"\u2B50",name:"Star",keywords:["favorite","rating"],group:"travel"},{shortcode:"star2",emoji:"\u{1F31F}",name:"Glowing Star",keywords:["sparkle","shine"],group:"travel"},{shortcode:"cloud",emoji:"\u2601\uFE0F",name:"Cloud",keywords:["weather","sky"],group:"travel"},{shortcode:"rainbow",emoji:"\u{1F308}",name:"Rainbow",keywords:["colorful","weather"],group:"travel"},{shortcode:"snowflake",emoji:"\u2744\uFE0F",name:"Snowflake",keywords:["cold","winter"],group:"travel"},{shortcode:"zap",emoji:"\u26A1",name:"High Voltage",keywords:["lightning","electric","fast"],group:"travel"},{shortcode:"fire",emoji:"\u{1F525}",name:"Fire",keywords:["hot","flame","lit"],group:"travel"},{shortcode:"ocean",emoji:"\u{1F30A}",name:"Water Wave",keywords:["sea","wave","surf"],group:"travel"},{shortcode:"airplane",emoji:"\u2708\uFE0F",name:"Airplane",keywords:["travel","flight"],group:"travel"},{shortcode:"rocket",emoji:"\u{1F680}",name:"Rocket",keywords:["launch","space","fast"],group:"travel"},{shortcode:"car",emoji:"\u{1F697}",name:"Automobile",keywords:["drive","vehicle"],group:"travel"},{shortcode:"house",emoji:"\u{1F3E0}",name:"House",keywords:["home","building"],group:"travel"},{shortcode:"tent",emoji:"\u26FA",name:"Tent",keywords:["camping","outdoor"],group:"travel"},{shortcode:"mountain",emoji:"\u26F0\uFE0F",name:"Mountain",keywords:["nature","hike"],group:"travel"},{shortcode:"desert_island",emoji:"\u{1F3DD}\uFE0F",name:"Desert Island",keywords:["beach","vacation"],group:"travel"},{shortcode:"volcano",emoji:"\u{1F30B}",name:"Volcano",keywords:["eruption","nature"],group:"travel"},{shortcode:"soccer",emoji:"\u26BD",name:"Soccer Ball",keywords:["football","sport"],group:"activities"},{shortcode:"basketball",emoji:"\u{1F3C0}",name:"Basketball",keywords:["sport","hoop"],group:"activities"},{shortcode:"tennis",emoji:"\u{1F3BE}",name:"Tennis",keywords:["sport","ball"],group:"activities"},{shortcode:"video_game",emoji:"\u{1F3AE}",name:"Video Game",keywords:["gaming","controller"],group:"activities"},{shortcode:"dart",emoji:"\u{1F3AF}",name:"Bullseye",keywords:["target","goal"],group:"activities"},{shortcode:"trophy",emoji:"\u{1F3C6}",name:"Trophy",keywords:["winner","champion"],group:"activities"},{shortcode:"medal",emoji:"\u{1F947}",name:"Gold Medal",keywords:["first","winner"],group:"activities"},{shortcode:"tada",emoji:"\u{1F389}",name:"Party Popper",keywords:["celebration","party"],group:"activities"},{shortcode:"confetti_ball",emoji:"\u{1F38A}",name:"Confetti Ball",keywords:["party","celebration"],group:"activities"},{shortcode:"balloon",emoji:"\u{1F388}",name:"Balloon",keywords:["party","birthday"],group:"activities"},{shortcode:"art",emoji:"\u{1F3A8}",name:"Artist Palette",keywords:["paint","creative"],group:"activities"},{shortcode:"musical_note",emoji:"\u{1F3B5}",name:"Musical Note",keywords:["music","song"],group:"activities"},{shortcode:"microphone",emoji:"\u{1F3A4}",name:"Microphone",keywords:["sing","karaoke"],group:"activities"},{shortcode:"guitar",emoji:"\u{1F3B8}",name:"Guitar",keywords:["music","rock"],group:"activities"},{shortcode:"dice",emoji:"\u{1F3B2}",name:"Game Die",keywords:["chance","random"],group:"activities"},{shortcode:"bulb",emoji:"\u{1F4A1}",name:"Light Bulb",keywords:["idea","bright"],group:"objects"},{shortcode:"computer",emoji:"\u{1F4BB}",name:"Laptop",keywords:["tech","work"],group:"objects"},{shortcode:"keyboard",emoji:"\u2328\uFE0F",name:"Keyboard",keywords:["type","computer"],group:"objects"},{shortcode:"phone",emoji:"\u{1F4F1}",name:"Mobile Phone",keywords:["cell","call"],group:"objects"},{shortcode:"camera",emoji:"\u{1F4F7}",name:"Camera",keywords:["photo","picture"],group:"objects"},{shortcode:"tv",emoji:"\u{1F4FA}",name:"Television",keywords:["watch","screen"],group:"objects"},{shortcode:"battery",emoji:"\u{1F50B}",name:"Battery",keywords:["charge","power"],group:"objects"},{shortcode:"electric_plug",emoji:"\u{1F50C}",name:"Electric Plug",keywords:["power","connect"],group:"objects"},{shortcode:"mag",emoji:"\u{1F50D}",name:"Magnifying Glass Left",keywords:["search","find"],group:"objects"},{shortcode:"lock",emoji:"\u{1F512}",name:"Locked",keywords:["security","private"],group:"objects"},{shortcode:"unlock",emoji:"\u{1F513}",name:"Unlocked",keywords:["open","access"],group:"objects"},{shortcode:"key",emoji:"\u{1F511}",name:"Key",keywords:["access","password"],group:"objects"},{shortcode:"hammer",emoji:"\u{1F528}",name:"Hammer",keywords:["tool","build"],group:"objects"},{shortcode:"wrench",emoji:"\u{1F527}",name:"Wrench",keywords:["tool","fix"],group:"objects"},{shortcode:"gear",emoji:"\u2699\uFE0F",name:"Gear",keywords:["settings","config"],group:"objects"},{shortcode:"link",emoji:"\u{1F517}",name:"Link",keywords:["chain","url"],group:"objects"},{shortcode:"paperclip",emoji:"\u{1F4CE}",name:"Paperclip",keywords:["attach","clip"],group:"objects"},{shortcode:"scissors",emoji:"\u2702\uFE0F",name:"Scissors",keywords:["cut","snip"],group:"objects"},{shortcode:"pen",emoji:"\u{1F58A}\uFE0F",name:"Pen",keywords:["write","sign"],group:"objects"},{shortcode:"pencil",emoji:"\u270F\uFE0F",name:"Pencil",keywords:["write","draw"],group:"objects"},{shortcode:"book",emoji:"\u{1F4D6}",name:"Open Book",keywords:["read","study"],group:"objects"},{shortcode:"memo",emoji:"\u{1F4DD}",name:"Memo",keywords:["note","write"],group:"objects"},{shortcode:"package",emoji:"\u{1F4E6}",name:"Package",keywords:["box","delivery"],group:"objects"},{shortcode:"mailbox",emoji:"\u{1F4EC}",name:"Open Mailbox with Raised Flag",keywords:["mail","letter"],group:"objects"},{shortcode:"bell",emoji:"\u{1F514}",name:"Bell",keywords:["notification","alert"],group:"objects"},{shortcode:"red_heart",emoji:"\u2764\uFE0F",name:"Red Heart",keywords:["love","valentine"],group:"symbols"},{shortcode:"orange_heart",emoji:"\u{1F9E1}",name:"Orange Heart",keywords:["love"],group:"symbols"},{shortcode:"yellow_heart",emoji:"\u{1F49B}",name:"Yellow Heart",keywords:["love","friendship"],group:"symbols"},{shortcode:"green_heart",emoji:"\u{1F49A}",name:"Green Heart",keywords:["love","nature"],group:"symbols"},{shortcode:"blue_heart",emoji:"\u{1F499}",name:"Blue Heart",keywords:["love","trust"],group:"symbols"},{shortcode:"purple_heart",emoji:"\u{1F49C}",name:"Purple Heart",keywords:["love"],group:"symbols"},{shortcode:"broken_heart",emoji:"\u{1F494}",name:"Broken Heart",keywords:["sad","breakup"],group:"symbols"},{shortcode:"sparkles",emoji:"\u2728",name:"Sparkles",keywords:["shine","magic","new"],group:"symbols"},{shortcode:"hundred",emoji:"\u{1F4AF}",name:"Hundred Points",keywords:["perfect","score"],group:"symbols"},{shortcode:"boom",emoji:"\u{1F4A5}",name:"Collision",keywords:["explosion","impact"],group:"symbols"},{shortcode:"speech_balloon",emoji:"\u{1F4AC}",name:"Speech Balloon",keywords:["talk","chat","message"],group:"symbols"},{shortcode:"thought_balloon",emoji:"\u{1F4AD}",name:"Thought Balloon",keywords:["think","dream"],group:"symbols"},{shortcode:"check_mark",emoji:"\u2705",name:"Check Mark Button",keywords:["done","yes","complete"],group:"symbols"},{shortcode:"x",emoji:"\u274C",name:"Cross Mark",keywords:["no","wrong","delete"],group:"symbols"},{shortcode:"warning",emoji:"\u26A0\uFE0F",name:"Warning",keywords:["caution","alert"],group:"symbols"},{shortcode:"no_entry",emoji:"\u26D4",name:"No Entry",keywords:["stop","forbidden"],group:"symbols"},{shortcode:"question",emoji:"\u2753",name:"Question Mark",keywords:["help","what"],group:"symbols"},{shortcode:"exclamation",emoji:"\u2757",name:"Exclamation Mark",keywords:["important","attention"],group:"symbols"},{shortcode:"arrow_right",emoji:"\u27A1\uFE0F",name:"Right Arrow",keywords:["next","forward"],group:"symbols"},{shortcode:"arrow_left",emoji:"\u2B05\uFE0F",name:"Left Arrow",keywords:["back","previous"],group:"symbols"},{shortcode:"arrow_up",emoji:"\u2B06\uFE0F",name:"Up Arrow",keywords:["above"],group:"symbols"},{shortcode:"arrow_down",emoji:"\u2B07\uFE0F",name:"Down Arrow",keywords:["below"],group:"symbols"},{shortcode:"recycle",emoji:"\u267B\uFE0F",name:"Recycling Symbol",keywords:["environment","green"],group:"symbols"},{shortcode:"infinity",emoji:"\u267E\uFE0F",name:"Infinity",keywords:["forever","loop"],group:"symbols"},{shortcode:"checkered_flag",emoji:"\u{1F3C1}",name:"Chequered Flag",keywords:["finish","race"],group:"flags"},{shortcode:"triangular_flag",emoji:"\u{1F6A9}",name:"Triangular Flag",keywords:["red flag","warning"],group:"flags"},{shortcode:"white_flag",emoji:"\u{1F3F3}\uFE0F",name:"White Flag",keywords:["surrender","peace"],group:"flags"},{shortcode:"rainbow_flag",emoji:"\u{1F3F3}\uFE0F\u200D\u{1F308}",name:"Rainbow Flag",keywords:["pride","lgbtq"],group:"flags"},{shortcode:"pirate_flag",emoji:"\u{1F3F4}\u200D\u2620\uFE0F",name:"Pirate Flag",keywords:["jolly roger","skull"],group:"flags"},{shortcode:"flag_us",emoji:"\u{1F1FA}\u{1F1F8}",name:"Flag: United States",keywords:["usa","america"],group:"flags"},{shortcode:"flag_gb",emoji:"\u{1F1EC}\u{1F1E7}",name:"Flag: United Kingdom",keywords:["uk","britain"],group:"flags"},{shortcode:"flag_fr",emoji:"\u{1F1EB}\u{1F1F7}",name:"Flag: France",keywords:["french"],group:"flags"},{shortcode:"flag_de",emoji:"\u{1F1E9}\u{1F1EA}",name:"Flag: Germany",keywords:["german"],group:"flags"},{shortcode:"flag_jp",emoji:"\u{1F1EF}\u{1F1F5}",name:"Flag: Japan",keywords:["japanese"],group:"flags"},{shortcode:"flag_kr",emoji:"\u{1F1F0}\u{1F1F7}",name:"Flag: South Korea",keywords:["korean"],group:"flags"},{shortcode:"flag_br",emoji:"\u{1F1E7}\u{1F1F7}",name:"Flag: Brazil",keywords:["brazilian"],group:"flags"},{shortcode:"flag_in",emoji:"\u{1F1EE}\u{1F1F3}",name:"Flag: India",keywords:["indian"],group:"flags"},{shortcode:"flag_ca",emoji:"\u{1F1E8}\u{1F1E6}",name:"Flag: Canada",keywords:["canadian","maple"],group:"flags"},{shortcode:"flag_au",emoji:"\u{1F1E6}\u{1F1FA}",name:"Flag: Australia",keywords:["australian"],group:"flags"}],K=new Map(nt.map(r=>[r.shortcode,r])),Ze=new Map([["+1","thumbsup"],["-1","thumbsdown"],["heart","red_heart"],["thumbs_up","thumbsup"],["thumbs_down","thumbsdown"],["grin","grinning"],["laughing_crying","joy"],["lol","rofl"],["smiley","smile"],["cool","sunglasses"],["nerd","nerd_face"],["kiss","kissing_heart"],["hug","hugs"],["think","thinking"],["sad","cry"],["mad","angry"],["shrug","person_shrugging"],["facepalm","person_facepalming"],["raised_fist","muscle"],["pray_hands","pray"],["hi","wave"],["bye","wave"],["lightning","zap"],["flame","fire"],["hot","fire"],["bomb","boom"],["idea","bulb"],["laptop","computer"],["search","mag"],["party","tada"],["celebrate","tada"],["congrats","tada"],["check","check_mark"],["done","check_mark"],["yes","check_mark"],["no","x"],["wrong","x"],["love","red_heart"],["star_eyes","star_struck"],["mindblown","exploding_head"],["poop","skull"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),Yi=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],Zi={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},Qi={smileys:"\u{1F600}",people:"\u{1F44B}",animals:"\u{1F436}",food:"\u{1F355}",travel:"\u{1F30D}",activities:"\u{1F389}",objects:"\u{1F4A1}",symbols:"\u2764\uFE0F",flags:"\u{1F3C1}"},ot=[];globalThis.__vbEmojiRegister=Qe;globalThis.__vbEmojiExtended&&(Qe(globalThis.__vbEmojiExtended),delete globalThis.__vbEmojiExtended)});var fn=window.matchMedia("(prefers-reduced-motion: reduce)");var Ve=new Map;function p(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=Ve.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}Ve.set(r,s),customElements.define(r,t)}var m=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}};var Et=class extends m{#t=null;#e=null;#i=!1;#s=null;#n=null;#r=null;#o=null;#a=null;#c=null;#l=null;#h=null;#f=null;setup(){if(this.#t=this.querySelector("audio"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;return this.#d(),t&&(this.#u(),this.#b(),this.#w()),this.#k(),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#f=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#f),!0}teardown(){this.#t&&this.#t.setAttribute("controls","")}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.dispatchEvent(new CustomEvent("audio-player:src-changed",{detail:{src:e,source:"property"},bubbles:!0})))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#d(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
2
2
|
<style>${this.#p()}</style>
|
|
3
3
|
<div part="player" class="player">
|
|
4
4
|
<div part="controls" class="controls" role="group" aria-label="Audio controls">
|
|
@@ -189,7 +189,7 @@ var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{
|
|
|
189
189
|
border-radius: var(--radius-full, 50%);
|
|
190
190
|
background: var(--_accent);
|
|
191
191
|
border: var(--border-width-medium, 2px) solid var(--_bg);
|
|
192
|
-
box-shadow: var(--shadow-
|
|
192
|
+
box-shadow: var(--shadow-s, 0 1px 3px oklch(0% 0 0 / 0.2));
|
|
193
193
|
cursor: pointer;
|
|
194
194
|
margin-top: -4px;
|
|
195
195
|
transition: transform var(--duration-fast, 100ms) var(--ease-default, ease);
|
|
@@ -205,7 +205,7 @@ var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{
|
|
|
205
205
|
border-radius: var(--radius-full, 50%);
|
|
206
206
|
background: var(--_accent);
|
|
207
207
|
border: var(--border-width-medium, 2px) solid var(--_bg);
|
|
208
|
-
box-shadow: var(--shadow-
|
|
208
|
+
box-shadow: var(--shadow-s, 0 1px 3px oklch(0% 0 0 / 0.2));
|
|
209
209
|
cursor: pointer;
|
|
210
210
|
}
|
|
211
211
|
|
|
@@ -336,7 +336,7 @@ var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{
|
|
|
336
336
|
transform: none;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
`}#u(){this.#t.addEventListener("timeupdate",()=>this.#v()),this.#t.addEventListener("loadedmetadata",()=>this.#y()),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#n.setAttribute("aria-label","Pause"),this.#x("audio-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#n.setAttribute("aria-label","Play"),this.#x("audio-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#n.setAttribute("aria-label","Play");let t=this.#e?.querySelector("li[data-audio-active]");t&&t.setAttribute("data-audio-played",""),this.#e&&this.#g(),this.#x("audio-player:ended",{src:this.#t.currentSrc})})}#b(){this.#n.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#r.addEventListener("input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#r.value)/100*this.#t.duration)}),this.#r.addEventListener("pointerdown",()=>this.setState("scrub-active",!0));let t=()=>this.setState("scrub-active",!1);this.#r.addEventListener("pointerup",t),this.#r.addEventListener("pointercancel",t),this.#a.addEventListener("input",()=>{this.#t.volume=Number(this.#a.value),this.#t.muted=!1,this.removeAttribute("muted"),this.#a.style.setProperty("--_vol",this.#a.value)});let e=this.shadowRoot?.querySelector(".mute-btn");e&&(e.addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#a.style.setProperty("--_vol",this.#t.muted?"0":this.#a.value)}),this.addEventListener("keydown",i=>{let s=i.target;if(!(s?.tagName==="INPUT"||s?.tagName==="TEXTAREA"))switch(i.key){case" ":i.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":i.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10);break;case"ArrowRight":i.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10);break;case"m":case"M":this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#a.style.setProperty("--_vol",this.#t.muted?"0":this.#a.value);break}}),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"))}#w(){this.#e&&this.#e.addEventListener("click",t=>{let i=t.target?.closest("a[href]");i&&(t.preventDefault(),this.#m(i.href,i.closest("li")))})}#m(t,e){if(!this.#e)return;this.#e.querySelectorAll("li").forEach(s=>s.removeAttribute("data-audio-active")),e&&e.setAttribute("data-audio-active",""),this.#t.src=t,this.#t.play().catch(()=>{}),this.#k(),this.#x("audio-player:track-change",{src:t,title:e?.querySelector("a")?.textContent??""})}#g(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-audio-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#m(o.href,n)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#m(s.href,t[i])}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#m(s.href,t[0])}}#v(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#c.textContent=this.#C(t),this.#r.value=String(i),this.#o.style.width=`${i}%`}#y(){let t=this.#t.duration||0;this.#l.textContent=this.#C(t)}#k(){if(!this.#h)return;if(this.#e){let e=this.#e.querySelector("li[data-audio-active] a");if(e){this.#h.textContent=e.textContent;return}}let t=this.#t.currentSrc||this.#t.querySelector("source")?.src||"";if(t){let e=t.split("/").pop().split("?")[0];this.#h.textContent=e.replace(/\.[^.]+$/,"").replace(/[-_]/g," ")}}#C(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60).toString().padStart(2,"0");return`${e}:${i}`}#x(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};p("audio-player",Et);var St=new Map;function
|
|
339
|
+
`}#u(){this.#t.addEventListener("timeupdate",()=>this.#v()),this.#t.addEventListener("loadedmetadata",()=>this.#y()),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#n.setAttribute("aria-label","Pause"),this.#x("audio-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#n.setAttribute("aria-label","Play"),this.#x("audio-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#n.setAttribute("aria-label","Play");let t=this.#e?.querySelector("li[data-audio-active]");t&&t.setAttribute("data-audio-played",""),this.#e&&this.#g(),this.#x("audio-player:ended",{src:this.#t.currentSrc})})}#b(){this.#n.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#r.addEventListener("input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#r.value)/100*this.#t.duration)}),this.#r.addEventListener("pointerdown",()=>this.setState("scrub-active",!0));let t=()=>this.setState("scrub-active",!1);this.#r.addEventListener("pointerup",t),this.#r.addEventListener("pointercancel",t),this.#a.addEventListener("input",()=>{this.#t.volume=Number(this.#a.value),this.#t.muted=!1,this.removeAttribute("muted"),this.#a.style.setProperty("--_vol",this.#a.value)});let e=this.shadowRoot?.querySelector(".mute-btn");e&&(e.addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#a.style.setProperty("--_vol",this.#t.muted?"0":this.#a.value)}),this.addEventListener("keydown",i=>{let s=i.target;if(!(s?.tagName==="INPUT"||s?.tagName==="TEXTAREA"))switch(i.key){case" ":i.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":i.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10);break;case"ArrowRight":i.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10);break;case"m":case"M":this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#a.style.setProperty("--_vol",this.#t.muted?"0":this.#a.value);break}}),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"))}#w(){this.#e&&this.#e.addEventListener("click",t=>{let i=t.target?.closest("a[href]");i&&(t.preventDefault(),this.#m(i.href,i.closest("li")))})}#m(t,e){if(!this.#e)return;this.#e.querySelectorAll("li").forEach(s=>s.removeAttribute("data-audio-active")),e&&e.setAttribute("data-audio-active",""),this.#t.src=t,this.#t.play().catch(()=>{}),this.#k(),this.#x("audio-player:track-change",{src:t,title:e?.querySelector("a")?.textContent??""})}#g(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-audio-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#m(o.href,n)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#m(s.href,t[i])}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#m(s.href,t[0])}}#v(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#c.textContent=this.#C(t),this.#r.value=String(i),this.#o.style.width=`${i}%`}#y(){let t=this.#t.duration||0;this.#l.textContent=this.#C(t)}#k(){if(!this.#h)return;if(this.#e){let e=this.#e.querySelector("li[data-audio-active] a");if(e){this.#h.textContent=e.textContent;return}}let t=this.#t.currentSrc||this.#t.querySelector("source")?.src||"";if(t){let e=t.split("/").pop().split("?")[0];this.#h.textContent=e.replace(/\.[^.]+$/,"").replace(/[-_]/g," ")}}#C(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60).toString().padStart(2,"0");return`${e}:${i}`}#x(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};p("audio-player",Et);var St=new Map;function Gi(){if(!St.has("default"))try{St.set("default",new AudioContext)}catch{return null}return St.get("default")}var Ct=new WeakMap;function Ki(r,t){if(Ct.has(r))return Ct.get(r);let e=t.createMediaElementSource(r);return Ct.set(r,e),e}var Tt=class extends m{#t=null;#e=null;#i=null;#s=null;#n=null;#r=null;#o=null;#a=null;#c=!0;#l=!1;#h=!1;#f=null;static get observedAttributes(){return["for","data-mode","data-fft-size"]}setup(){this.#h=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let t=!this.shadowRoot;this.#d(),this.#p(),t&&(this.#k(),this.#C()),this.#f=()=>{let e=this.shadowRoot?.querySelector("canvas");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#f)}teardown(){this.#w(),this.#a?.disconnect()}attributeChangedCallback(t){t==="for"&&this.#p()}#d(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
340
340
|
<style>
|
|
341
341
|
:host {
|
|
342
342
|
display: block;
|
|
@@ -354,7 +354,7 @@ var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{
|
|
|
354
354
|
}
|
|
355
355
|
</style>
|
|
356
356
|
<canvas aria-hidden="true"></canvas>
|
|
357
|
-
`,this.#t=t.querySelector("canvas")}#p(){let t=this.getAttribute("for");t&&(this.#i=document.getElementById(t),!(!this.#i||this.#i.tagName!=="AUDIO")&&(this.#l||this.#i.addEventListener("play",()=>this.#u(),{once:!0})))}#u(){if(this.#l||(this.#l=!0,this.#s=
|
|
357
|
+
`,this.#t=t.querySelector("canvas")}#p(){let t=this.getAttribute("for");t&&(this.#i=document.getElementById(t),!(!this.#i||this.#i.tagName!=="AUDIO")&&(this.#l||this.#i.addEventListener("play",()=>this.#u(),{once:!0})))}#u(){if(this.#l||(this.#l=!0,this.#s=Gi(),!this.#s))return;this.#s.state==="suspended"&&this.#s.resume();let t=parseInt(this.getAttribute("data-fft-size")||"256",10);this.#n=this.#s.createAnalyser(),this.#n.fftSize=t,this.#n.smoothingTimeConstant=.8,this.#r=Ki(this.#i,this.#s),this.#r.connect(this.#n),this.#n.connect(this.#s.destination),this.#b()}#b(){if(this.#h)return;let t=()=>{if(!this.#c||this.#h){this.#o=null;return}this.#o=requestAnimationFrame(t),this.#m()};this.#o=requestAnimationFrame(t)}#w(){this.#o&&(cancelAnimationFrame(this.#o),this.#o=null)}#m(){let t=this.#t,e=t.getContext("2d");if(!e)return;let i=t.width=t.offsetWidth*(window.devicePixelRatio||1),s=t.height=t.offsetHeight*(window.devicePixelRatio||1),n=getComputedStyle(this),o=n.getPropertyValue("--_color").trim()||"oklch(55% 0.2 260)",a=n.getPropertyValue("--_bg").trim();if(e.clearRect(0,0,i,s),a&&a!=="transparent"&&(e.fillStyle=a,e.fillRect(0,0,i,s)),!this.#n)return;let l=this.getAttribute("data-mode")||"bars",c=this.#n.frequencyBinCount,h=new Uint8Array(c);l==="waveform"?(this.#n.getByteTimeDomainData(h),this.#v(e,i,s,o,h)):l==="circle"?(this.#n.getByteFrequencyData(h),this.#y(e,i,s,o,h)):(this.#n.getByteFrequencyData(h),this.#g(e,i,s,o,h))}#g(t,e,i,s,n){let o=Math.min(n.length,64),a=e/o-1;t.fillStyle=s;for(let l=0;l<o;l++){let h=n[l]/255*i,u=l*(e/o);t.fillRect(u,i-h,a,h)}}#v(t,e,i,s,n){let o=e/n.length;t.strokeStyle=s,t.lineWidth=2,t.beginPath();for(let a=0;a<n.length;a++){let c=n[a]/128*i/2;a===0?t.moveTo(0,c):t.lineTo(a*o,c)}t.stroke()}#y(t,e,i,s,n){let o=e/2,a=i/2,l=Math.min(e,i)*.25,c=n.length;t.strokeStyle=s,t.lineWidth=2,t.beginPath();for(let h=0;h<c;h++){let u=h/c*Math.PI*2,d=n[h]/255*(l*.8),f=l+d,g=o+f*Math.cos(u),w=a+f*Math.sin(u);h===0?t.moveTo(g,w):t.lineTo(g,w)}t.closePath(),t.stroke()}#k(){this.#a=new IntersectionObserver(([t])=>{this.#c=t.isIntersecting,this.#c&&this.#l&&!this.#o&&!this.#h&&this.#b()}),this.#a.observe(this)}#C(){window.matchMedia("(prefers-reduced-motion: reduce)").addEventListener("change",t=>{this.#h=t.matches,t.matches?this.#w():this.#l&&this.#c&&this.#b()})}};p("audio-visualizer",Tt);var We=[.5,.75,1,1.25,1.5,2],Xi=3e3,_t=class extends m{#t=null;#e=null;#i=!1;#s=null;#n=null;#r=null;#o=null;#a=null;#c=null;#l=null;#h=null;#f=null;#d=null;#p=null;#u=null;#b=null;#w=null;#m=null;#g=2;#v=null;#y=null;setup(){if(this.#t=this.querySelector("video"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;return this.#k(),t&&(this.#x(),this.#A(),this.#E(),this.#j()),this.hasAttribute("muted")&&(this.#t.muted=!0,this.setAttribute("muted","")),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#S(),this.#v=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#v),this.#y=()=>{let e=!!document.fullscreenElement;this.toggleAttribute("data-fullscreen",e),this.#u.setAttribute("aria-label",e?"Exit fullscreen":"Fullscreen"),this.#R("video-player:fullscreen",{active:e})},this.listen(document,"fullscreenchange",this.#y),this.setAttribute("state","idle"),!0}teardown(){this.#t&&this.#t.setAttribute("controls",""),this.#m!=null&&clearTimeout(this.#m)}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.dispatchEvent(new CustomEvent("video-player:src-changed",{detail:{src:e,source:"property"},bubbles:!0})))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#k(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
|
|
358
358
|
<style>${this.#C()}</style>
|
|
359
359
|
<div part="player" class="player">
|
|
360
360
|
<slot></slot>
|
|
@@ -864,7 +864,7 @@ var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{
|
|
|
864
864
|
cursor: auto;
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
|
-
`}#x(){this.#t.addEventListener("timeupdate",()=>this.#$()),this.#t.addEventListener("loadedmetadata",()=>this.#L()),this.#t.addEventListener("progress",()=>this.#P()),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#n.setAttribute("aria-label","Pause"),this.#q("Playing"),this.#R("video-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#n.setAttribute("aria-label","Play"),this.#S(),this.#q("Paused"),this.#R("video-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#n.setAttribute("aria-label","Play"),this.#S();let t=this.#e?.querySelector("li[data-video-active]");t&&t.setAttribute("data-video-played",""),this.#e&&this.#N(),this.#q("Ended"),this.#R("video-player:ended",{src:this.#t.currentSrc})}),this.#t.addEventListener("waiting",()=>{this.#i&&(this.setAttribute("state","buffering"),this.#q("Buffering"))}),this.#t.addEventListener("playing",()=>{this.getAttribute("state")==="buffering"&&this.setAttribute("state","playing")})}#A(){this.#r.addEventListener("click",n=>{n.stopPropagation(),this.#t.play().catch(()=>{})}),(this.shadowRoot?.querySelector(".player")).addEventListener("click",n=>{n.target.closest(".controls")||n.target.closest(".play-overlay")||(this.#i?this.#t.pause():this.#t.play().catch(()=>{}))}),this.#n.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#o.addEventListener("input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#o.value)/100*this.#t.duration)}),(this.shadowRoot?.querySelector(".skip-back-btn")).addEventListener("click",()=>{this.#t.currentTime=Math.max(0,this.#t.currentTime-10)}),(this.shadowRoot?.querySelector(".skip-forward-btn")).addEventListener("click",()=>{this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10)}),this.#l.addEventListener("input",()=>{this.#t.volume=Number(this.#l.value),this.#t.muted=!1,this.removeAttribute("muted"),this.#l.style.setProperty("--_vol",this.#l.value)}),(this.shadowRoot?.querySelector(".mute-btn")).addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#l.style.setProperty("--_vol",this.#t.muted?"0":this.#l.value)}),this.#d.addEventListener("click",()=>{this.#g=(this.#g+1)%We.length;let n=We[this.#g];this.#t.playbackRate=n;let o=this.#d.querySelector("span");o.textContent=`${n}x`,this.#d.setAttribute("aria-label",`Playback speed ${n}x`),this.#R("video-player:speed",{rate:n})}),this.#p.addEventListener("click",()=>{let n=this.#z();if(!n)return;let o=n.mode==="showing";n.mode=o?"hidden":"showing";let a=!o;this.toggleAttribute("captions",a),this.#p.setAttribute("aria-pressed",String(a)),this.#R("video-player:captions",{active:a,label:n.label})}),this.#u.addEventListener("click",()=>this.#B()),this.addEventListener("keydown",n=>this.#H(n)),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}#j(){let t=this.shadowRoot?.querySelector(".player"),e=()=>{this.#S(),this.#m!=null&&clearTimeout(this.#m),this.#i&&(this.#m=setTimeout(()=>this.#T(),
|
|
867
|
+
`}#x(){this.#t.addEventListener("timeupdate",()=>this.#$()),this.#t.addEventListener("loadedmetadata",()=>this.#L()),this.#t.addEventListener("progress",()=>this.#P()),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#n.setAttribute("aria-label","Pause"),this.#q("Playing"),this.#R("video-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#n.setAttribute("aria-label","Play"),this.#S(),this.#q("Paused"),this.#R("video-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#n.setAttribute("aria-label","Play"),this.#S();let t=this.#e?.querySelector("li[data-video-active]");t&&t.setAttribute("data-video-played",""),this.#e&&this.#N(),this.#q("Ended"),this.#R("video-player:ended",{src:this.#t.currentSrc})}),this.#t.addEventListener("waiting",()=>{this.#i&&(this.setAttribute("state","buffering"),this.#q("Buffering"))}),this.#t.addEventListener("playing",()=>{this.getAttribute("state")==="buffering"&&this.setAttribute("state","playing")})}#A(){this.#r.addEventListener("click",n=>{n.stopPropagation(),this.#t.play().catch(()=>{})}),(this.shadowRoot?.querySelector(".player")).addEventListener("click",n=>{n.target.closest(".controls")||n.target.closest(".play-overlay")||(this.#i?this.#t.pause():this.#t.play().catch(()=>{}))}),this.#n.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#o.addEventListener("input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#o.value)/100*this.#t.duration)}),(this.shadowRoot?.querySelector(".skip-back-btn")).addEventListener("click",()=>{this.#t.currentTime=Math.max(0,this.#t.currentTime-10)}),(this.shadowRoot?.querySelector(".skip-forward-btn")).addEventListener("click",()=>{this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10)}),this.#l.addEventListener("input",()=>{this.#t.volume=Number(this.#l.value),this.#t.muted=!1,this.removeAttribute("muted"),this.#l.style.setProperty("--_vol",this.#l.value)}),(this.shadowRoot?.querySelector(".mute-btn")).addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#l.style.setProperty("--_vol",this.#t.muted?"0":this.#l.value)}),this.#d.addEventListener("click",()=>{this.#g=(this.#g+1)%We.length;let n=We[this.#g];this.#t.playbackRate=n;let o=this.#d.querySelector("span");o.textContent=`${n}x`,this.#d.setAttribute("aria-label",`Playback speed ${n}x`),this.#R("video-player:speed",{rate:n})}),this.#p.addEventListener("click",()=>{let n=this.#z();if(!n)return;let o=n.mode==="showing";n.mode=o?"hidden":"showing";let a=!o;this.toggleAttribute("captions",a),this.#p.setAttribute("aria-pressed",String(a)),this.#R("video-player:captions",{active:a,label:n.label})}),this.#u.addEventListener("click",()=>this.#B()),this.addEventListener("keydown",n=>this.#H(n)),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}#j(){let t=this.shadowRoot?.querySelector(".player"),e=()=>{this.#S(),this.#m!=null&&clearTimeout(this.#m),this.#i&&(this.#m=setTimeout(()=>this.#T(),Xi))};t.addEventListener("mousemove",e),t.addEventListener("mouseenter",e),t.addEventListener("mouseleave",()=>{this.#i&&(this.#m!=null&&clearTimeout(this.#m),this.#m=setTimeout(()=>this.#T(),500))}),t.addEventListener("touchstart",()=>{this.hasAttribute("controls")?this.#T():e()},{passive:!0}),this.#s.addEventListener("mouseenter",()=>{this.#m!=null&&clearTimeout(this.#m),this.#S()}),this.#s.addEventListener("focusin",()=>{this.#m!=null&&clearTimeout(this.#m),this.#S()})}#S(){this.setAttribute("controls","")}#T(){this.removeAttribute("controls")}#E(){this.#e&&this.#e.addEventListener("click",t=>{let e=t.target.closest("a[href]");e&&(t.preventDefault(),this.#_(e.href,e.closest("li"),e))})}#_(t,e,i){this.#e.querySelectorAll("li").forEach(a=>a.removeAttribute("data-video-active")),e&&e.setAttribute("data-video-active",""),this.#t.src=t;let n=i?.getAttribute("data-poster");n&&(this.#t.poster=n);let o=i?.getAttribute("data-captions");this.#M(o),this.#t.play().catch(()=>{}),this.#R("video-player:track-change",{src:t,title:i?.textContent??""})}#M(t){if(this.#t.querySelectorAll("track[data-dynamic]").forEach(s=>s.remove()),t){let s=document.createElement("track");s.kind="captions",s.src=t,s.default=!0,s.setAttribute("data-dynamic",""),this.#t.appendChild(s),this.hasAttribute("captions")&&(s.track.mode="showing")}let i=this.#t.querySelector('track[kind="captions"], track[kind="subtitles"]');this.#p.hidden=!i}#N(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-video-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#_(o.href,n,o)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#_(s.href,t[i],s)}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#_(s.href,t[0],s)}}#$(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#h.textContent=this.#D(t),this.#o.value=String(i),this.#o.setAttribute("aria-valuetext",this.#O(t)),this.#a.style.width=`${i}%`}#L(){let t=this.#t.duration||0;this.#f.textContent=this.#D(t)}#P(){let t=this.#t.buffered,e=this.#t.duration||0;if(t.length>0&&e){let i=t.end(t.length-1);this.#c.style.width=`${i/e*100}%`}}#B(){document.fullscreenElement?document.exitFullscreen():this.requestFullscreen().catch(()=>{this.#t.requestFullscreen?.().catch(()=>{})})}#z(){let t=this.#t.textTracks;for(let e=0;e<t.length;e++)if(t[e].kind==="captions"||t[e].kind==="subtitles")return t[e];return null}#H(t){if(!(t.target.tagName==="INPUT"||t.target.tagName==="TEXTAREA"))switch(t.key){case" ":case"k":case"K":t.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":t.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10),this.#S();break;case"ArrowRight":t.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10),this.#S();break;case"ArrowUp":t.preventDefault(),this.#t.volume=Math.min(1,this.#t.volume+.05),this.#l.value=String(this.#t.volume),this.#l.style.setProperty("--_vol",String(this.#t.volume)),this.#S();break;case"ArrowDown":t.preventDefault(),this.#t.volume=Math.max(0,this.#t.volume-.05),this.#l.value=String(this.#t.volume),this.#l.style.setProperty("--_vol",String(this.#t.volume)),this.#S();break;case"m":case"M":this.#t.muted=!this.#t.muted,this.toggleAttribute("muted",this.#t.muted),this.#l.style.setProperty("--_vol",this.#t.muted?"0":this.#l.value);break;case"f":case"F":this.#B();break;case"c":case"C":this.#p.click();break;case"Escape":document.fullscreenElement&&document.exitFullscreen();break}}#D(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/3600),i=Math.floor(t%3600/60),s=Math.floor(t%60);return e>0?`${e}:${String(i).padStart(2,"0")}:${String(s).padStart(2,"0")}`:`${i}:${String(s).padStart(2,"0")}`}#O(t){if(!Number.isFinite(t))return"0 seconds";let e=Math.floor(t/3600),i=Math.floor(t%3600/60),s=Math.floor(t%60),n=[];return e>0&&n.push(`${e} hour${e!==1?"s":""}`),i>0&&n.push(`${i} minute${i!==1?"s":""}`),n.push(`${s} second${s!==1?"s":""}`),n.join(" ")}#q(t){this.#w&&(this.#w.textContent=t)}#R(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};p("video-player",_t);var Ge=`
|
|
868
868
|
:host {
|
|
869
869
|
display: block;
|
|
870
870
|
position: relative;
|
|
@@ -1048,10 +1048,10 @@ var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{
|
|
|
1048
1048
|
text-align: center;
|
|
1049
1049
|
padding: 1rem;
|
|
1050
1050
|
}
|
|
1051
|
-
`;Lt();function
|
|
1051
|
+
`;Lt();function Ji(r){return`<svg viewBox="0 0 24 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1052
1052
|
<path d="M12 0C5.373 0 0 5.373 0 12c0 9 12 24 12 24s12-15 12-24C24 5.373 18.627 0 12 0z" fill="${r}"/>
|
|
1053
1053
|
<circle cx="12" cy="12" r="5" fill="white" opacity="0.9"/>
|
|
1054
|
-
</svg>`}var Nt=class extends m{static get observedAttributes(){return["lat","lng","zoom","marker","marker-color","provider","tile-url","interactive","static-only","src","place"]}#t=null;#e=!1;constructor(){super(),this.attachShadow({mode:"open"})}get lat(){return parseFloat(this.getAttribute("lat")??"")}get lng(){return parseFloat(this.getAttribute("lng")??"")}get zoom(){let t=parseInt(this.getAttribute("zoom")??"",10);return t>=1&&t<=19?t:15}get showMarker(){return this.getAttribute("marker")!=="false"}get markerColor(){return this.getAttribute("marker-color")||"#e74c3c"}get provider(){return this.getAttribute("provider")||"osm"}get tileUrl(){return this.getAttribute("tile-url")||""}get interactive(){let t=this.getAttribute("interactive");return t==="eager"||t==="none"?t:"click"}get staticOnly(){return this.hasAttribute("static-only")}#i(){let t=parseFloat(this.getAttribute("lat")??""),e=parseFloat(this.getAttribute("lng")??"");if(!isNaN(t)&&!isNaN(e))return{lat:t,lng:e};let i=this.getAttribute("src");if(i){let a=this.#s(i);if(a)return a}let s=this.querySelector("address[data-lat][data-lng]");if(s){let a=parseFloat(s.dataset.lat??""),l=parseFloat(s.dataset.lng??"");if(!isNaN(a)&&!isNaN(l))return{lat:a,lng:l}}let n=this.getAttribute("place");if(n){let a=this.#n(n);if(a)return a}let o=document.querySelector('meta[name="geo.position"]');if(o){let l=(o.getAttribute("content")||"").split(";");if(l.length===2){let c=parseFloat(l[0]),h=parseFloat(l[1]);if(!isNaN(c)&&!isNaN(h))return{lat:c,lng:h}}}return null}#s(t){let e=document.getElementById(t);if(!e)return null;if(e.tagName==="ADDRESS"&&e.dataset.lat&&e.dataset.lng){let i=parseFloat(e.dataset.lat),s=parseFloat(e.dataset.lng);if(!isNaN(i)&&!isNaN(s))return{lat:i,lng:s}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#r(e):null}#n(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let i of e)try{let s=JSON.parse(i.textContent);if(s.name===t){let n=s.geo;if(n){let o=parseFloat(n.latitude),a=parseFloat(n.longitude);if(!isNaN(o)&&!isNaN(a))return{lat:o,lng:a}}}}catch{}return null}#r(t){try{let i=JSON.parse(t.textContent).geo;if(i){let s=parseFloat(i.latitude),n=parseFloat(i.longitude);if(!isNaN(s)&&!isNaN(n))return{lat:s,lng:n}}}catch{}return null}setup(){this.render(),this.loadTiles(),this.#o()}attributeChangedCallback(t,e,i){e!==i&&this.isConnected&&(this.#t&&this.#l(),this.render(),this.loadTiles(),this.#o())}teardown(){this.#t&&(this.#t.destroy(),this.#t=null)}get data(){return{lat:isNaN(this.lat)?void 0:this.lat,lng:isNaN(this.lng)?void 0:this.lng,zoom:this.zoom,marker:this.showMarker,markerColor:this.markerColor}}set data(t){if(!t||typeof t!="object")return;let e=this.data;e.lat===t.lat&&e.lng===t.lng&&e.zoom===t.zoom||(t.lat!=null&&this.setAttribute("lat",String(t.lat)),t.lng!=null&&this.setAttribute("lng",String(t.lng)),t.zoom!=null&&this.setAttribute("zoom",String(t.zoom)),t.marker!=null&&this.setAttribute("marker",t.marker?"true":"false"),t.markerColor&&this.setAttribute("marker-color",t.markerColor),this.dispatchEvent(new CustomEvent("geo-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}get markers(){let t=this.#i();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN,s=!isNaN(e)&&!isNaN(i);this.children.length>0?this.setAttribute("data-has-caption",""):this.removeAttribute("data-has-caption");let o=s?`Map of ${e.toFixed(4)}, ${i.toFixed(4)}`:"Map",a=this.showMarker&&s?`<div part="marker" aria-hidden="true">${
|
|
1054
|
+
</svg>`}var Nt=class extends m{static get observedAttributes(){return["lat","lng","zoom","marker","marker-color","provider","tile-url","interactive","static-only","src","place"]}#t=null;#e=!1;constructor(){super(),this.attachShadow({mode:"open"})}get lat(){return parseFloat(this.getAttribute("lat")??"")}get lng(){return parseFloat(this.getAttribute("lng")??"")}get zoom(){let t=parseInt(this.getAttribute("zoom")??"",10);return t>=1&&t<=19?t:15}get showMarker(){return this.getAttribute("marker")!=="false"}get markerColor(){return this.getAttribute("marker-color")||"#e74c3c"}get provider(){return this.getAttribute("provider")||"osm"}get tileUrl(){return this.getAttribute("tile-url")||""}get interactive(){let t=this.getAttribute("interactive");return t==="eager"||t==="none"?t:"click"}get staticOnly(){return this.hasAttribute("static-only")}#i(){let t=parseFloat(this.getAttribute("lat")??""),e=parseFloat(this.getAttribute("lng")??"");if(!isNaN(t)&&!isNaN(e))return{lat:t,lng:e};let i=this.getAttribute("src");if(i){let a=this.#s(i);if(a)return a}let s=this.querySelector("address[data-lat][data-lng]");if(s){let a=parseFloat(s.dataset.lat??""),l=parseFloat(s.dataset.lng??"");if(!isNaN(a)&&!isNaN(l))return{lat:a,lng:l}}let n=this.getAttribute("place");if(n){let a=this.#n(n);if(a)return a}let o=document.querySelector('meta[name="geo.position"]');if(o){let l=(o.getAttribute("content")||"").split(";");if(l.length===2){let c=parseFloat(l[0]),h=parseFloat(l[1]);if(!isNaN(c)&&!isNaN(h))return{lat:c,lng:h}}}return null}#s(t){let e=document.getElementById(t);if(!e)return null;if(e.tagName==="ADDRESS"&&e.dataset.lat&&e.dataset.lng){let i=parseFloat(e.dataset.lat),s=parseFloat(e.dataset.lng);if(!isNaN(i)&&!isNaN(s))return{lat:i,lng:s}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#r(e):null}#n(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let i of e)try{let s=JSON.parse(i.textContent);if(s.name===t){let n=s.geo;if(n){let o=parseFloat(n.latitude),a=parseFloat(n.longitude);if(!isNaN(o)&&!isNaN(a))return{lat:o,lng:a}}}}catch{}return null}#r(t){try{let i=JSON.parse(t.textContent).geo;if(i){let s=parseFloat(i.latitude),n=parseFloat(i.longitude);if(!isNaN(s)&&!isNaN(n))return{lat:s,lng:n}}}catch{}return null}setup(){this.render(),this.loadTiles(),this.#o()}attributeChangedCallback(t,e,i){e!==i&&this.isConnected&&(this.#t&&this.#l(),this.render(),this.loadTiles(),this.#o())}teardown(){this.#t&&(this.#t.destroy(),this.#t=null)}get data(){return{lat:isNaN(this.lat)?void 0:this.lat,lng:isNaN(this.lng)?void 0:this.lng,zoom:this.zoom,marker:this.showMarker,markerColor:this.markerColor}}set data(t){if(!t||typeof t!="object")return;let e=this.data;e.lat===t.lat&&e.lng===t.lng&&e.zoom===t.zoom||(t.lat!=null&&this.setAttribute("lat",String(t.lat)),t.lng!=null&&this.setAttribute("lng",String(t.lng)),t.zoom!=null&&this.setAttribute("zoom",String(t.zoom)),t.marker!=null&&this.setAttribute("marker",t.marker?"true":"false"),t.markerColor&&this.setAttribute("marker-color",t.markerColor),this.dispatchEvent(new CustomEvent("geo-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}get markers(){let t=this.#i();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN,s=!isNaN(e)&&!isNaN(i);this.children.length>0?this.setAttribute("data-has-caption",""):this.removeAttribute("data-has-caption");let o=s?`Map of ${e.toFixed(4)}, ${i.toFixed(4)}`:"Map",a=this.showMarker&&s?`<div part="marker" aria-hidden="true">${Ji(this.markerColor)}</div>`:"",c=s&&this.interactive!=="none"&&!this.staticOnly?'<div part="overlay"><button part="activate" aria-label="Activate interactive map" tabindex="0">Click to interact</button></div>':"";this.shadowRoot.innerHTML=`
|
|
1055
1055
|
<style>${Ge}</style>
|
|
1056
1056
|
<div part="container">
|
|
1057
1057
|
<div part="tiles" role="img" aria-label="${o}"></div>
|
|
@@ -1062,12 +1062,12 @@ var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{
|
|
|
1062
1062
|
<a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">© OpenStreetMap</a>
|
|
1063
1063
|
</div>
|
|
1064
1064
|
</div>
|
|
1065
|
-
`}loadTiles(){let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i)){this.handleError("Missing or invalid lat/lng coordinates");return}let s=this.zoom,n=this.provider,{tileX:o,tileY:a,pixelX:l,pixelY:c}=Ke(e,i,s),h=this.shadowRoot.querySelector('[part="tiles"]');if(!h)return;h.innerHTML="";let u=this,d=u.offsetWidth||400,f=u.offsetHeight||300,g=Math.round(d/2-256-l),w=Math.round(f/2-256-c);h.style.transform=`translate(${g}px, ${w}px)`;let x=0,_=0,O=9;for(let V=-1;V<=1;V++)for(let W=-1;W<=1;W++){let G=o+W,$=a+V,Hi=rt(n,s,G,$,this.tileUrl),P=document.createElement("img");P.src=Hi,P.alt="",P.loading="lazy",P.draggable=!1,P.addEventListener("load",()=>{x++,x+_===O&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:s}}))}),P.addEventListener("error",()=>{_++,_===O?this.handleError("Failed to load map tiles"):x+_===O&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:s}}))}),h.appendChild(P)}}#o(){let t=this.shadowRoot.querySelector('[part="overlay"]');if(!t)return;let e=t.querySelector('[part="activate"]');t.addEventListener("mouseenter",()=>this.#a(),{once:!0}),e&&e.addEventListener("focus",()=>this.#a(),{once:!0}),e&&e.addEventListener("click",()=>this.#c()),this.interactive==="eager"&&requestAnimationFrame(()=>this.#c())}#a(){if(this.#e)return;let t=this.tileUrl;if(t)try{let n=new URL(t,location.origin);if(n.origin===location.origin){this.#e=!0;return}this.#e=!0;let o=document.createElement("link");o.rel="preconnect",o.href=n.origin,o.crossOrigin="",document.head.appendChild(o);return}catch{}this.#e=!0;let e=this.provider,i;e==="carto-light"||e==="carto-dark"?i="https://basemaps.cartocdn.com":i="https://tile.openstreetmap.org";let s=document.createElement("link");s.rel="preconnect",s.href=i,s.crossOrigin="",document.head.appendChild(s)}async#c(){if(this.#t)return;let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i))return;let{MapInteraction:s}=await Promise.resolve().then(()=>(Ye(),Je));this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.focus(),this.setAttribute("data-interactive-active",""),this.#t=new s({shadow:this.shadowRoot,host:this,lat:e,lng:i,zoom:this.zoom,provider:this.provider,tileUrl:this.tileUrl,onDeactivate:()=>this.#l()}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:e,lng:i,zoom:this.zoom}}))}#l(){this.#t&&(this.#t.destroy(),this.#t=null,this.removeAttribute("data-interactive-active"),this.render(),this.loadTiles(),this.#o())}handleError(t){let e=this.shadowRoot.querySelector('[part="container"]');e&&(e.setAttribute("data-state","error"),e.setAttribute("data-error",t)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};p("geo-map",Nt);var at=null;async function es(){return at||(at=await Promise.resolve().then(()=>(jt(),Rt)),at)}var $t=8,is=150,ti="vb-emoji-recent",Pt=class extends m{#t;#e;#i;#s;#n;#r=!1;#o=[];#a=-1;#c=null;#l="";#h=null;#f=!1;#d=null;#p=null;setup(){return this.#u(),!0}async#u(){this.#h=await es(),this.#f||(this.#b(),this.#f=!0),this.#t&&this.listen(this.#t,"click",this.#y),this.listen(document,"click",this.#k),this.listen(document,"keydown",this.#C)}teardown(){this.#c&&(clearTimeout(this.#c),this.setState("search-pending",!1))}#b(){this.#t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#t||(this.#t=document.createElement("button"),this.#t.type="button",this.#t.textContent="\u{1F600}",this.#t.setAttribute("data-trigger",""),this.prepend(this.#t)),this.#t.setAttribute("aria-haspopup","dialog"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-label",this.#t.getAttribute("aria-label")||"Open emoji picker"),this.#w()}#w(){this.#e=document.createElement("div"),this.#e.classList.add("picker"),this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label","Emoji picker"),this.#e.hidden=!0,this.#i=document.createElement("input"),this.#i.type="search",this.#i.placeholder="Search emoji\u2026",this.#i.setAttribute("aria-label","Search emoji"),this.#i.addEventListener("input",this.#x),this.#i.addEventListener("keydown",this.#A),this.#e.appendChild(this.#i),this.#n=document.createElement("nav"),this.#n.classList.add("categories"),this.#n.setAttribute("role","tablist"),this.#n.setAttribute("aria-label","Emoji categories");for(let t of this.#h.EMOJI_GROUPS){let e=document.createElement("button");e.type="button",e.setAttribute("role","tab"),e.setAttribute("aria-selected",t===this.#h.EMOJI_GROUPS[0]?"true":"false"),e.setAttribute("data-group",t),e.setAttribute("aria-label",this.#h.EMOJI_GROUP_LABELS[t]),e.title=this.#h.EMOJI_GROUP_LABELS[t],e.textContent=this.#h.EMOJI_GROUP_ICONS[t],e.addEventListener("click",this.#j),this.#n.appendChild(e)}this.#e.appendChild(this.#n),this.#s=document.createElement("div"),this.#s.classList.add("grid"),this.#s.setAttribute("role","grid"),this.#s.setAttribute("aria-label","Emoji"),this.#s.addEventListener("keydown",this.#S),this.#e.appendChild(this.#s),this.appendChild(this.#e),this.#m()}#m(t=null){this.#s.innerHTML="",this.#o=[],this.#a=-1;let e=this.#N();if(!this.#l&&e.length>0){let s=document.createElement("div");s.classList.add("group-label"),s.textContent="Recently Used",s.setAttribute("data-group-heading","recent"),this.#s.appendChild(s);for(let n of e){let o=this.#h.EMOJI_MAP.get(n);o&&this.#g(o)}}let i=t||null;if(i)if(i.length===0){let s=document.createElement("div");s.classList.add("no-results"),s.textContent="No emoji found",this.#s.appendChild(s)}else for(let s of i)this.#g(s);else for(let s of this.#h.EMOJI_GROUPS){let n=document.createElement("div");n.classList.add("group-label"),n.textContent=this.#h.EMOJI_GROUP_LABELS[s],n.setAttribute("data-group-heading",s),this.#s.appendChild(n);let o=this.#h.getByGroup(s);for(let a of o)this.#g(a)}}#g(t){let e=document.createElement("button");e.type="button",e.setAttribute("role","gridcell"),e.setAttribute("tabindex","-1"),e.setAttribute("data-shortcode",t.shortcode),e.title=`${t.name} :${t.shortcode}:`,e.textContent=t.emoji,e.addEventListener("click",this.#T),this.#s.appendChild(e),this.#o.push(e)}#v(){let t=this.getAttribute("for");if(!t)return;let e=document.getElementById(t);if(e){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"){let i=e;this.#d={start:i.selectionStart??i.value.length,end:i.selectionEnd??i.value.length},this.#p=null}else if(e.isContentEditable){let i=window.getSelection();i&&i.rangeCount>0&&(this.#p=i.getRangeAt(0).cloneRange()),this.#d=null}}}#y=t=>{t.stopPropagation(),this.toggle()};#k=t=>{this.#r&&!this.contains(t.target)&&this.close()};#C=t=>{t.key==="Escape"&&this.#r&&(t.preventDefault(),this.close(),this.#t?.focus())};#x=()=>{this.#c&&clearTimeout(this.#c),this.setState("search-pending",!0),this.#c=setTimeout(()=>{if(this.setState("search-pending",!1),this.#l=this.#i.value.trim(),this.#l){let t=this.#h.searchEmoji(this.#l);this.#m(t)}else this.#m()},is)};#A=t=>{t.key==="ArrowDown"&&(t.preventDefault(),this.#o.length>0&&this.#E(0))};#j=t=>{let e=t.currentTarget.getAttribute("data-group");for(let s of this.#n.querySelectorAll('[role="tab"]'))s.setAttribute("aria-selected",s===t.currentTarget?"true":"false");this.#l&&(this.#i.value="",this.#l="",this.#m());let i=this.#s.querySelector(`[data-group-heading="${e}"]`);i&&i.scrollIntoView({block:"start",behavior:"smooth"})};#S=t=>{let e=this.#o.length;if(e!==0)switch(t.key){case"ArrowRight":t.preventDefault(),this.#E(this.#a+1);break;case"ArrowLeft":t.preventDefault(),this.#E(this.#a-1);break;case"ArrowDown":t.preventDefault(),this.#E(this.#a+$t);break;case"ArrowUp":t.preventDefault(),this.#a<$t?(this.#i.focus(),this.#a=-1):this.#E(this.#a-$t);break;case"Home":t.preventDefault(),this.#E(0);break;case"End":t.preventDefault(),this.#E(e-1);break;case"Enter":case" ":t.preventDefault(),this.#a>=0&&this.#o[this.#a].click();break;case"Tab":this.close();break}};#T=t=>{let e=t.currentTarget.getAttribute("data-shortcode"),i=this.#h.EMOJI_MAP.get(e);i&&(this.#$(e),this.#_(i),this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:i.shortcode,emoji:i.emoji,name:i.name,keywords:i.keywords}})),this.close(),this.#M())};#E(t){let e=this.#o.length;e!==0&&(t<0&&(t=0),t>=e&&(t=e-1),this.#a=t,this.#o[t].focus())}#_(t){let e=this.getAttribute("for");if(!e)return;let i=document.getElementById(e);if(i){if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"){let s=i,n=this.#d?.start??s.value.length,o=this.#d?.end??n,a=s.value.slice(0,n),l=s.value.slice(o);s.value=a+t.emoji+l;let c=n+t.emoji.length;s.setSelectionRange(c,c),this.#d={start:c,end:c},i.dispatchEvent(new Event("input",{bubbles:!0}))}else if(i.isContentEditable){i.focus();let s=window.getSelection();if(s&&this.#p){s.removeAllRanges(),s.addRange(this.#p);let n=s.getRangeAt(0);n.deleteContents();let o=document.createTextNode(t.emoji);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),s.removeAllRanges(),s.addRange(n),this.#p=n.cloneRange()}else if(s){let n=document.createRange();n.selectNodeContents(i),n.collapse(!1);let o=document.createTextNode(t.emoji);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),s.removeAllRanges(),s.addRange(n)}}}}#M(){let t=this.getAttribute("for");if(!t)return;let e=document.getElementById(t);e&&e.focus()}#N(){try{return JSON.parse(localStorage.getItem(ti)||"[]")}catch{return[]}}#$(t){let e=parseInt(this.getAttribute("recent-limit")??"24",10)||24,i=this.#N();i=i.filter(s=>s!==t),i.unshift(t),i.length>e&&(i.length=e);try{localStorage.setItem(ti,JSON.stringify(i))}catch{}}open(){this.#r||(this.#v(),this.#r=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#i.value="",this.#l="",this.#m(),requestAnimationFrame(()=>{this.#i.focus()}),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0})))}close(){this.#r&&(this.#r=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#e.hidden=!0,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0})))}toggle(){this.#r?this.close():this.open()}get isOpen(){return this.#r}};p("emoji-picker",Pt);var Bt=class r extends m{#t=null;#e=null;#i=!1;#s=null;setup(){this.setAttribute("role","list"),this.#i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#r(),this.#a(),this.#p(),this.#n()}teardown(){this.#t&&(this.#t.remove(),this.#t=null),r.#A?.source===this&&(r.#A=null)}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")||"vertical"}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#n(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("aria-grabbed")||t.setAttribute("aria-grabbed","false")}#r(){this.#t=document.createElement("div"),this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.#t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);",this.prepend(this.#t)}#o(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#a(){this.listen(this,"pointerdown",t=>{this.#s=t.target}),this.listen(this,"dragstart",this.#c.bind(this)),this.listen(this,"dragover",this.#l.bind(this)),this.listen(this,"dragleave",this.#h.bind(this)),this.listen(this,"drop",this.#f.bind(this)),this.listen(this,"dragend",this.#d.bind(this))}#c(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let i=e.querySelector("[data-drag-handle]");if(i&&!i.contains(this.#s)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#g(e);r.#A={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#l(t){let e=r.#A;if(!e||(this.group||e.source.group)&&this.group!==e.source.group)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over","");let i=this.orientation==="horizontal"?t.clientX:t.clientY;this.#C(i)}#h(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#x())}#f(t){t.preventDefault(),this.removeAttribute("data-drag-over"),this.#x();let e=r.#A;if(!e)return;let{item:i,source:s,originalIndex:n}=e,o=this.orientation==="horizontal"?t.clientX:t.clientY,a=this.#k(o);if(s===this){this.#v(i,a),this.#y();let l=this.#g(i);this.#b(i),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:i,itemId:i.dataset.id,oldIndex:n,newIndex:l,order:this.sortedOrder}}))}else this.#v(i,a),this.#y(),s.#y(),this.#b(i),this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:i,itemId:i.dataset.id,fromSurface:s,toSurface:this,newIndex:this.#g(i),fromOrder:s.sortedOrder,toOrder:this.sortedOrder}}))}#d(){let t=r.#A;t?.item&&t.item.removeAttribute("data-dragging"),this.removeAttribute("data-drag-over"),this.#x(),r.#A=null,this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#p(){this.listen(this,"keydown",this.#u.bind(this))}#u(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let i=e.getAttribute("aria-grabbed")==="true",s=this.orientation==="horizontal",n=s?"ArrowLeft":"ArrowUp",o=s?"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){if(t.preventDefault(),i){e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#y(),this.#b(e);let c=this.#g(e),h=this.draggableChildren;this.#o(`${this.#m(e)}, dropped at position ${c+1} of ${h.length}`),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,oldIndex:this.#e,newIndex:c,order:this.sortedOrder}})),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null}else{this.#e=this.#g(e),e.setAttribute("aria-grabbed","true"),this.setAttribute("data-reorder-mode","");let c=this.draggableChildren;this.#o(`${this.#m(e)}, grabbed. Position ${this.#e+1} of ${c.length}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}return}if(!i&&(t.key===n||t.key===o)){t.preventDefault();let c=this.draggableChildren,h=c.indexOf(e),u=t.key===n?Math.max(0,h-1):Math.min(c.length-1,h+1);u!==h&&c[u].focus();return}if(i&&(t.key===n||t.key===o)){t.preventDefault();let c=this.draggableChildren,h=c.indexOf(e),u=t.key===n?Math.max(0,h-1):Math.min(c.length-1,h+1);u!==h&&(this.#v(e,u),e.focus(),this.#o(`Position ${u+1} of ${c.length}`));return}let a=s?"ArrowUp":"ArrowLeft",l=s?"ArrowDown":"ArrowRight";if(i&&(t.key===a||t.key===l)){if(t.preventDefault(),!this.group)return;let c=t.key===l?1:-1,h=this.#w(c);if(!h)return;h.appendChild(e),h.#y(),this.#y(),h.#b(e),e.focus();let u=h.getAttribute("aria-label")||"next surface";h.#o(`Moved to ${u}`),h.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,fromSurface:this,toSurface:h,newIndex:h.draggableChildren.indexOf(e),fromOrder:this.sortedOrder,toOrder:h.sortedOrder}})),this.removeAttribute("data-reorder-mode"),h.setAttribute("data-reorder-mode",""),this.#e=null;return}if(i&&t.key==="Escape"){t.preventDefault(),e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#e!=null&&(this.#v(e,this.#e),e.focus()),this.#o("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null;return}!i&&t.key==="Escape"&&(t.preventDefault(),e.blur())}#b(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#w(t){if(!this.group)return null;let e=[...document.querySelectorAll(`drag-surface[group="${this.group}"]`)];if(e.length<2)return null;e.sort((n,o)=>{let a=n.getBoundingClientRect(),l=o.getBoundingClientRect();return a.left-l.left||a.top-l.top});let i=e.indexOf(this);return e[i+t]||null}#m(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#g(t){return this.draggableChildren.indexOf(t)}#v(t,e){let s=this.draggableChildren.filter(n=>n!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#y(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#k(t){let e=this.orientation==="horizontal",i=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<i.length;s++){let n=i[s].getBoundingClientRect(),o=e?n.left+n.width/2:n.top+n.height/2;if(t<o)return s}return i.length}#C(t){this.#x();let e=this.orientation==="horizontal",i=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<i.length;s++){let n=i[s].getBoundingClientRect(),o=e?n.left+n.width/2:n.top+n.height/2;if(t<o){i[s].setAttribute("data-drop-target","before");return}}i.length>0&&i[i.length-1].setAttribute("data-drop-target","after")}#x(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#A=null};p("drag-surface",Bt);var It=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),ei={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",shift:"\u21E7",ctrl:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",shift:"Shift",ctrl:"Ctrl"}};function X(r){let t=It?ei.mac:ei.other;return r.split("+").map(e=>{let i=e.trim().toLowerCase();return t[i]??i.toUpperCase()}).join(It?"":"+")}function ii(r){let t=r.toLowerCase().split("+").map(i=>i.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 si(r,t){if(r.key.toLowerCase()!==t.key)return!1;let e,i;return It?(e=t.meta,i=t.ctrl):(e=!1,i=t.meta||t.ctrl),!(e!==r.metaKey||i!==r.ctrlKey||t.shift!==r.shiftKey||t.alt!==r.altKey)}var ss=new Set(["INPUT","TEXTAREA","SELECT"]),J=[],ri=!1;function rs(r){let t=ss.has(r.target.tagName)||r.target.isContentEditable;for(let e of J)if(!(t&&!e.global)&&si(r,e.descriptor)){r.preventDefault(),e.callback(r);return}}function ns(){ri||(document.addEventListener("keydown",rs),ri=!0)}function F(r,t,e={}){ns();let i=ii(r),s={combo:r,descriptor:i,callback:t,global:e.global===!0};return J.find(o=>o.combo===r)&&console.warn(`[hotkey-bind] Shortcut "${r}" already bound. Last-connected-wins.`),J.unshift(s),function(){let a=J.indexOf(s);a!==-1&&J.splice(a,1)}}var qt=class extends m{#t;#e;#i;#s=[];#n=-1;#r=[];#o=null;#a=[];setup(){this.#c(),this.#l(),this.hasAttribute("discover")&&this.#b()}teardown(){this.#o?.()}get commands(){let t=[];for(let e of this.#r){let i=e.getAttribute("label")||"";for(let s of e.querySelectorAll("command-item"))t.push({value:s.getAttribute("value")||"",label:s.textContent.trim(),hotkey:s.getAttribute("data-hotkey")||void 0,group:i||void 0})}return t}set commands(t){let e=Array.isArray(t)?t:[],i=new Map;for(let s of e){let n=s.group||"";i.has(n)||i.set(n,[]),i.get(n).push(s)}for(let s of[...this.children])(s.tagName==="COMMAND-GROUP"||s.tagName==="COMMAND-ITEM")&&s.remove();for(let[s,n]of i){let o=document.createElement("command-group");s&&o.setAttribute("label",s);for(let a of n){let l=document.createElement("command-item");if(a.value&&l.setAttribute("value",a.value),a.hotkey&&l.setAttribute("data-hotkey",a.hotkey),a.icon){let c=document.createElement("span");c.setAttribute("slot","icon"),c.innerHTML=a.icon,l.appendChild(c)}l.appendChild(document.createTextNode(a.label||a.value||"")),o.appendChild(l)}this.appendChild(o)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("command-palette:commands-changed",{detail:{commands:e,source:"property"},bubbles:!0}))}#c(){this.#t=document.createElement("dialog"),this.#t.className="command-dialog",this.#t.addEventListener("click",i=>{i.target===this.#t&&this.close()});let t=document.createElement("div");t.className="command-search",this.#e=document.createElement("input"),this.#e.type="search",this.#e.placeholder=this.getAttribute("placeholder")||"Type a command...",this.#e.setAttribute("aria-label","Search commands"),this.#e.autocomplete="off",this.#e.addEventListener("input",this.#h),this.#e.addEventListener("keydown",this.#f),t.appendChild(this.#e),this.#i=document.createElement("div"),this.#i.className="command-list",this.#i.setAttribute("role","listbox"),this.#r=Array.from(this.querySelectorAll("command-group")),this.#r.forEach(i=>{let s=document.createElement("div");s.className="command-group-header",s.textContent=i.getAttribute("label")||"",s.setAttribute("role","presentation");let n=Array.from(i.querySelectorAll("command-item"));this.#i.appendChild(s),n.forEach(o=>{let a=document.createElement("button");a.className="command-option",a.setAttribute("role","option"),a.dataset.value=o.getAttribute("value")||"",a.dataset.searchText=o.textContent.toLowerCase().trim();let l=o.querySelector('[slot="icon"]');if(l){let u=document.createElement("span");u.className="command-icon",u.appendChild(l.cloneNode(!0)),a.appendChild(u)}let c=document.createElement("span");c.className="command-label",c.textContent=o.textContent.trim(),a.appendChild(c);let h=o.getAttribute("data-hotkey");if(h){let u=document.createElement("kbd");u.className="command-kbd",u.textContent=X(h),a.appendChild(u)}a.addEventListener("click",()=>{this.#u(a.dataset.value)}),this.#i.appendChild(a),this.#s.push({btn:a,header:s,group:i})})});let e=document.createElement("div");e.className="command-empty",e.textContent="No results found.",e.hidden=!0,this.#i.appendChild(e),this.#t.appendChild(t),this.#t.appendChild(this.#i),this.appendChild(this.#t)}#l(){let t=this.getAttribute("hotkey")||"meta+k";this.#o=F(t,()=>{this.#t.open?this.close():this.open()},{global:!0})}#h=()=>{let t=this.#e.value.toLowerCase().trim(),e=0,i=new Set;this.#s.forEach(({btn:n,header:o})=>{let a=!t||n.dataset.searchText.includes(t);n.hidden=!a,a&&(e++,i.add(o))}),this.#i.querySelectorAll(".command-group-header").forEach(n=>{n.hidden=!i.has(n)});let s=this.#i.querySelector(".command-empty");s&&(s.hidden=e>0),this.#n=-1,e>0&&this.#p(0)};#f=t=>{let e=this.#d();switch(t.key){case"ArrowDown":t.preventDefault(),this.#p(this.#n+1);break;case"ArrowUp":t.preventDefault(),this.#p(this.#n-1);break;case"Enter":t.preventDefault(),this.#n>=0&&e[this.#n]&&e[this.#n].btn.click();break;case"Escape":t.preventDefault(),this.close();break}};#d(){return this.#s.filter(({btn:t})=>!t.hidden)}#p(t){let e=this.#d();if(e.length===0)return;e.forEach(({btn:s})=>s.removeAttribute("data-active")),t<0&&(t=e.length-1),t>=e.length&&(t=0),this.#n=t;let{btn:i}=e[t];i.setAttribute("data-active",""),i.scrollIntoView({block:"nearest"})}#u(t){this.close(),this.dispatchEvent(new CustomEvent("command-palette:select",{bubbles:!0,detail:{value:t}}))}#b(){this.listen(document,"vb:command-registry-change",this.#w)}#w=()=>{this.#t?.open&&(this.#m(),this.#h())};#m(){if(!this.hasAttribute("discover"))return;let{getRegisteredCommands:t,scanAutoDiscoverable:e}=window.__commandRegistry||{};if(!t)return;this.#s=this.#s.filter(n=>!n.discovered),this.#a.forEach(n=>n.remove()),this.#a=[];let i=this.#i.querySelector(".command-empty"),s=t();for(let[n,o]of s){let a=document.createElement("div");a.className="command-group-header",a.textContent=n,a.setAttribute("role","presentation"),this.#i.insertBefore(a,i),this.#a.push(a);for(let l of o){if(this.contains(l.element))continue;let c=this.#g(l.label,l.icon,l.shortcut);c.dataset.value=`__discovered:${l.label}`,c.addEventListener("click",()=>{this.close(),l.element.click()}),this.#i.insertBefore(c,i),this.#s.push({btn:c,header:a,group:null,discovered:!0})}}if(this.getAttribute("discover")==="auto"&&e){let n=e(),o=new Map;for(let a of n){let l=o.get(a.group)||[];l.push(a),o.set(a.group,l)}for(let[a,l]of o){let c=document.createElement("div");c.className="command-group-header",c.textContent=a,c.setAttribute("role","presentation"),this.#i.insertBefore(c,i),this.#a.push(c);for(let h of l){if(this.contains(h.element))continue;let u=this.#g(h.label,h.icon,h.shortcut);u.dataset.value=`__auto:${h.label}`,u.dataset.auto="",u.addEventListener("click",()=>{this.close(),h.action?h.action():h.element.click()}),this.#i.insertBefore(u,i),this.#s.push({btn:u,header:c,group:null,discovered:!0})}}}}#g(t,e,i){let s=document.createElement("button");if(s.className="command-option",s.setAttribute("role","option"),s.dataset.searchText=t.toLowerCase(),e){let o=document.createElement("span");o.className="command-icon";let a=document.createElement("icon-wc");a.setAttribute("name",e),o.appendChild(a),s.appendChild(o)}let n=document.createElement("span");if(n.className="command-label",n.textContent=t,s.appendChild(n),i){let o=document.createElement("kbd");o.className="command-kbd",o.textContent=X(i),s.appendChild(o)}return s}open(){this.#t.open||(this.#m(),this.#t.showModal(),this.#e.value="",this.#h(),this.#e.focus(),this.dispatchEvent(new CustomEvent("command-palette:open",{bubbles:!0})))}close(){this.#t.open&&(this.#t.close(),this.dispatchEvent(new CustomEvent("command-palette:close",{bubbles:!0})))}get isOpen(){return this.#t?.open??!1}},Dt=class extends HTMLElement{},Ot=class extends HTMLElement{};p("command-palette",qt);p("command-group",Dt);p("command-item",Ot);var Ft=class extends m{#t;#e=null;setup(){this.#i(),this.#e=F("shift+?",()=>{this.#t.open?this.#t.close():this.#s()})}teardown(){this.#e?.(),this.#e=null,this.#t?.remove(),this.#t=null}get shortcuts(){return this.__shortcuts||null}set shortcuts(t){this.__shortcuts=t&&typeof t=="object"?t:null,this.dispatchEvent(new CustomEvent("short-cuts:shortcuts-changed",{detail:{shortcuts:this.__shortcuts,source:"property"},bubbles:!0}))}#i(){this.#t=document.createElement("dialog"),this.#t.className="shortcut-dialog",this.#t.addEventListener("click",t=>{t.target===this.#t&&this.#t.close()}),this.appendChild(this.#t)}#s(){this.#t.innerHTML="";let t=document.createElement("div");t.className="shortcut-header",t.innerHTML="<h2>Keyboard Shortcuts</h2>",this.#t.appendChild(t);let e=document.createElement("div");e.className="shortcut-body";let{getRegisteredCommands:i}=window.__commandRegistry||{},s=new Map;if(s.set("General",[{label:"Show keyboard shortcuts",shortcut:"shift+?"}]),i)for(let[o,a]of i())for(let l of a){if(!l.shortcut)continue;let c=s.get(o)||[];c.push({label:l.label,shortcut:l.shortcut}),s.set(o,c)}let{getHotkeyActions:n}=window.__hotkeyActionRegistry||{};if(n)for(let[o,a]of n()){let l=s.get(o)||[];for(let c of a)l.push({label:c.label,shortcut:c.shortcut});s.set(o,l)}for(let[o,a]of s){let l=document.createElement("div");l.className="shortcut-group";let c=document.createElement("div");c.className="shortcut-group-header",c.textContent=o,l.appendChild(c);for(let h of a){let u=document.createElement("div");u.className="shortcut-row";let d=document.createElement("span");d.className="shortcut-label",d.textContent=h.label;let f=document.createElement("kbd");f.className="shortcut-kbd",f.textContent=X(h.shortcut),u.appendChild(d),u.appendChild(f),l.appendChild(u)}e.appendChild(l)}this.#t.appendChild(e),this.#t.showModal()}};p("short-cuts",Ft);var zt=class extends m{#t;#e=!1;setup(){let t=[...this.children];if(t.length<2)return!1;t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children will be ignored.");let e=this.getAttribute("position"),i=e!==null?Number(e):50,s=Math.min(100,Math.max(0,isNaN(i)?50:i));return this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-label","Comparison slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow",String(Math.round(s))),this.#t.setAttribute("tabindex","0"),this.appendChild(this.#t),this.#o(s),this.listen(this.#t,"pointerdown",this.#i),this.listen(this.#t,"keydown",this.#r),!0}teardown(){this.#t&&(this.#t.remove(),this.#t=null),this.#e=!1}#i=t=>{t.preventDefault(),this.#e=!0,this.#t.setPointerCapture(t.pointerId),this.#t.addEventListener("pointermove",this.#s),this.#t.addEventListener("pointerup",this.#n)};#s=t=>{if(!this.#e)return;let e=this.getBoundingClientRect(),i=t.clientX-e.left,s=Math.min(100,Math.max(0,i/e.width*100));this.#o(s)};#n=t=>{this.#e=!1,this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#s),this.#t.removeEventListener("pointerup",this.#n)};#r=t=>{let e=t.shiftKey?10:1,i=Number(this.#t.getAttribute("aria-valuenow"));t.key==="ArrowLeft"||t.key==="ArrowDown"?(t.preventDefault(),this.#o(Math.max(0,i-e))):(t.key==="ArrowRight"||t.key==="ArrowUp")&&(t.preventDefault(),this.#o(Math.min(100,i+e)))};#o(t){let e=Math.round(t);this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(e)),this.#t.style.left=`${t}%`),this.setAttribute("position",String(e)),this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:t},bubbles:!0}))}get position(){return Number(this.getAttribute("position"))||0}set position(t){let e=Math.min(100,Math.max(0,Number(t)||0));this.#o(e)}};p("compare-surface",zt);function os(){let r=globalThis.localStorage;if(!r)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return r.getItem(t)},async setRaw(t,e){r.setItem(t,e)},async removeRaw(t){r.removeItem(t)},async keys(t){let e=[];for(let i=0;i<r.length;i++){let s=r.key(i);s&&s.startsWith(t)&&e.push(s)}return e}}}var lt=null;function N(){return lt||(lt=os()),lt}function Ht(r,t){if(typeof r!="string"||!r)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:${r}:${t}`}function ni(r){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${r}:`}function oi(r){try{let t=JSON.parse(r);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var A={configure(r={}){lt=r.backend??null},async set(r,t,e){let i={data:e,timestamp:Date.now()};await N().setRaw(Ht(r,t),JSON.stringify(i))},async get(r,t,e){let i=await N().getRaw(Ht(r,t));if(i==null)return null;let s=oi(i);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(r,t){await N().removeRaw(Ht(r,t))},async list(r){let t=ni(r),e=await N().keys(t),i=[];for(let s of e){let n=await N().getRaw(s);if(n==null)continue;let o=oi(n);o&&i.push({key:s.slice(t.length),data:o.data,timestamp:o.timestamp})}return i},async clear(r){let t=ni(r),e=await N().keys(t);for(let i of e)await N().removeRaw(i)},async clearAll(){let r=await N().keys("vb:");for(let t of r)await N().removeRaw(t)},async setMany(r,t){for(let[e,i]of t)await A.set(r,e,i)}};var Ut=class extends m{#t;#e;#i;#s=50;#n=!1;#r=50;get#o(){return this.getAttribute("direction")==="vertical"}get#a(){let t=this.getAttribute("min"),e=Number(t);return t!==null&&!isNaN(e)?e:10}get#c(){let t=this.getAttribute("max"),e=Number(t);return t!==null&&!isNaN(e)?e:90}get position(){return this.#s}set position(t){this.#m(Number(t))}get collapsed(){return this.#n}set collapsed(t){t?this.#b():this.#w()}reset(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:50;this.#n=!1,this.#m(i),this.#y()}setup(){let t=[...this.children].filter(e=>!e.classList.contains("split-divider"));return t.length<2?!1:(this.#e=t[0],this.#i=t[1],this.#l(),!0)}async#l(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:null,s=await this.#g(),n=i??s??50;return this.#t=document.createElement("div"),this.#t.className="split-divider",this.#t.setAttribute("role","separator"),this.#t.setAttribute("aria-orientation",this.#o?"vertical":"horizontal"),this.#t.setAttribute("aria-valuenow",String(Math.round(n))),this.#t.setAttribute("aria-valuemin",String(this.#a)),this.#t.setAttribute("aria-valuemax",String(this.#c)),this.#t.setAttribute("aria-label","Resize panels"),this.#t.setAttribute("tabindex","0"),this.insertBefore(this.#t,this.#i),this.#m(n),this.listen(this.#t,"pointerdown",this.#h),this.listen(this.#t,"keydown",this.#p),this.hasAttribute("collapsible")&&this.listen(this.#t,"dblclick",this.#u),!0}teardown(){this.#t&&(this.#t.remove(),this.#t=null)}#h=t=>{t.preventDefault(),this.setState("divider-dragging",!0),this.#t.setPointerCapture(t.pointerId),this.#t.addEventListener("pointermove",this.#f),this.#t.addEventListener("pointerup",this.#d)};#f=t=>{if(!this.matches(":state(divider-dragging)"))return;let e=this.getBoundingClientRect(),i;this.#o?i=(t.clientY-e.top)/e.height*100:i=(t.clientX-e.left)/e.width*100,this.#n&&(this.#n=!1),this.#m(i)};#d=t=>{this.setState("divider-dragging",!1),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#f),this.#t.removeEventListener("pointerup",this.#d),this.#v()};#p=t=>{let e=t.shiftKey?10:1,i=this.#s,s=this.#o?["ArrowUp"]:["ArrowLeft"],n=this.#o?["ArrowDown"]:["ArrowRight"];s.includes(t.key)?(t.preventDefault(),this.#m(i-e),this.#v()):n.includes(t.key)?(t.preventDefault(),this.#m(i+e),this.#v()):t.key==="Home"?(t.preventDefault(),this.#m(this.#a),this.#v()):t.key==="End"&&(t.preventDefault(),this.#m(this.#c),this.#v())};#u=()=>{this.#n?this.#w():this.#b(),this.#v()};#b(){this.#r=this.#s,this.#n=!0,this.#e.style.flexBasis="0%",this.#e.style.overflow="hidden",this.#t.setAttribute("aria-valuenow","0"),this.#s=0,this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0},bubbles:!0}))}#w(){this.#n=!1,this.#e.style.overflow="auto",this.#m(this.#r),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1},bubbles:!0}))}#m(t){let e=this.#n?0:Math.min(this.#c,Math.max(this.#a,t));this.#s=e,this.#e.style.flexBasis=`${e}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#i.style.flexGrow="1",this.#i.style.overflow="auto",this.#t.setAttribute("aria-valuenow",String(Math.round(e))),this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:e},bubbles:!0}))}async#g(){let t=this.getAttribute("persist");if(!t)return null;let e=await A.get("layout",`split:${t}`);return typeof e=="number"?e:null}#v(){let t=this.getAttribute("persist");t&&A.set("layout",`split:${t}`,Math.round(this.#s)).catch(()=>{})}#y(){let t=this.getAttribute("persist");t&&A.remove("layout",`split:${t}`).catch(()=>{})}};p("split-surface",Ut);var Wt="[data-copy], [data-copy-target], [data-paste-target]",li="Copied to clipboard",as="Pasted from clipboard",Vt=new WeakMap;async function Y(r,t={}){if(r==null||r==="")return!1;let{button:e,announceMessage:i=li,duration:s=1500}=t;try{await navigator.clipboard.writeText(r)}catch{return!1}return Kt({button:e,duration:s,announceMessage:i,eventDetail:{text:r}}),!0}async function ci(r,t={}){let{text:e,html:i,blob:s}=r??{};if(!e&&!i&&!s)return!1;let{button:n,announceMessage:o=li,duration:a=1500}=t;if(typeof ClipboardItem<"u"&&typeof navigator.clipboard?.write=="function"){let c={};e&&(c["text/plain"]=new Blob([e],{type:"text/plain"})),i&&(c["text/html"]=new Blob([i],{type:"text/html"})),s&&(c[s.type]=s);try{return await navigator.clipboard.write([new ClipboardItem(c)]),Kt({button:n,duration:a,announceMessage:o,eventDetail:{payload:r}}),!0}catch{}}return e?Y(e,t):!1}function Kt({button:r,duration:t,announceMessage:e,eventDetail:i,state:s="copied",eventName:n="copy"}){if(r){r.dataset.state=s;let o=Vt.get(r);o&&clearTimeout(o),Vt.set(r,setTimeout(()=>{delete r.dataset.state,Vt.delete(r)},t)),r.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:i}))}hs(e,r??document.body)}async function ls(r,t={}){let{button:e,announceMessage:i=as,duration:s=1500}=t,n;try{n=await navigator.clipboard.readText()}catch{return null}return r&&("value"in r&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)?r.value=n:r.textContent=n,r.dispatchEvent(new Event("input",{bubbles:!0}))),Kt({button:e,duration:s,announceMessage:i,eventDetail:{text:n},state:"pasted",eventName:"paste"}),n}function ai(r=document){r.querySelectorAll(Wt).forEach(Gt)}function Gt(r){r.hasAttribute("data-copy-init")||(r.setAttribute("data-copy-init",""),r.addEventListener("click",()=>{if(r.dataset.pasteTarget){let e=document.querySelector(r.dataset.pasteTarget);if(!e)return;ls(e,{button:r});return}let t=cs(r);t&&Y(t,{button:r})}))}function cs(r){if(r.dataset.copy)return r.dataset.copy;if(r.dataset.copyTarget){let t=document.querySelector(r.dataset.copyTarget);if(!t)return"";let e=r.dataset.copyAttr;return e?t.getAttribute(e)??"":t.textContent??""}return""}function hs(r,t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="visually-hidden",e.textContent=r,t.appendChild(e),setTimeout(()=>e.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ai()):ai();var us=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(Wt)&&Gt(i),i.querySelectorAll(Wt).forEach(s=>Gt(s))}});us.observe(document.documentElement,{childList:!0,subtree:!0});var Xt=class extends m{#t;#e=null;setup(){this.#e===null&&(this.#e=this.getAttribute("value")||this.textContent.trim());let t=this.#e;if(!t)return!1;let e=parseInt(this.getAttribute("size")??"200",10)||200,i=parseInt(this.getAttribute("error-correction")??"1",10)||1;return this.#t=document.createElement("canvas"),this.#t.width=e,this.#t.height=e,this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`QR code: ${t}`),this.#i(t,e,i),!0}static get observedAttributes(){return["value","size"]}attributeChangedCallback(t,e,i){if(!this.#t||!this.isConnected)return;t==="value"&&i&&(this.#e=i);let s=this.#e||this.getAttribute("value")||"";if(!s)return;let n=parseInt(this.getAttribute("size")??"200",10)||200,o=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t.width=n,this.#t.height=n,this.#t.setAttribute("aria-label",`QR code: ${s}`),this.#i(s,n,o)}#i(t,e,i){let s=ps(t,i),n=this.#t.getContext("2d"),o=s.length,a=e/o,l=getComputedStyle(this),c=this.getAttribute("color")||l.color||"#000",h=this.getAttribute("background")||"transparent";n.clearRect(0,0,e,e),h!=="transparent"&&(n.fillStyle=h,n.fillRect(0,0,e,e)),n.fillStyle=c;for(let d=0;d<o;d++)for(let f=0;f<o;f++)s[d][f]&&n.fillRect(Math.round(f*a),Math.round(d*a),Math.ceil(a),Math.ceil(a));this.textContent="",this.appendChild(this.#t);let u=document.createElement("span");u.className="visually-hidden",u.textContent=t,this.appendChild(u)}toDataURL(t="image/png"){return this.#t?.toDataURL(t)??""}async copy({button:t}={}){if(!this.#t)return!1;let e=this.#e||this.getAttribute("value")||"",i=await new Promise(s=>this.#t.toBlob(s,"image/png"));return ci({text:e,blob:i||void 0},{button:t,announceMessage:"QR code copied"})}},ct=[[[26,7],[44,10],[70,15],[100,20],[134,26],[172,18],[196,20],[242,24],[292,30],[346,18]],[[26,10],[44,16],[70,26],[100,18],[134,24],[172,16],[196,18],[242,22],[292,22],[346,26]],[[26,13],[44,22],[70,18],[100,26],[134,18],[172,24],[196,18],[242,22],[292,20],[346,28]],[[26,17],[44,28],[70,22],[100,16],[134,22],[172,28],[196,26],[242,26],[292,24],[346,28]]],ds=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,52]];function ps(r,t=1){let e=new TextEncoder().encode(r),i=ms(e.length,t),s=ct[t][i-1][0],n=ct[t][i-1][1],o=s-n,a=fs(e,i,o),l=gs(a,o,n),c=i*4+17,h=Array.from({length:c},()=>new Uint8Array(c)),u=Array.from({length:c},()=>new Uint8Array(c));return vs(h,u,c),ys(h,u,i),ws(h,u,c),ks(u,c),xs(h,u,l,c),Ls(h,u,c,t)}function ms(r,t){for(let e=1;e<=10;e++){let i=ct[t][e-1][0],s=ct[t][e-1][1],n=i-s,o=e<=9?8:16,a=Math.ceil((4+o)/8);if(r<=n-a)return e}return 10}function fs(r,t,e){let i=[],s=(u,d)=>{for(let f=d-1;f>=0;f--)i.push(u>>f&1)};s(4,4);let n=t<=9?8:16;s(r.length,n);for(let u of r)s(u,8);let o=e*8,a=Math.min(4,o-i.length);for(s(0,a);i.length%8!==0;)i.push(0);let l=[236,17],c=0;for(;i.length<o;)s(l[c%2],8),c++;let h=[];for(let u=0;u<i.length;u+=8){let d=0;for(let f=0;f<8;f++)d=d<<1|(i[u+f]||0);h.push(d)}return h}function gs(r,t,e){let i=bs(e),s=new Uint8Array(t+e);for(let o=0;o<t;o++)s[o]=r[o];for(let o=0;o<t;o++){let a=s[o];if(a===0)continue;let l=ht[a];for(let c=0;c<i.length;c++)s[o+c]^=Z[(l+ht[i[c]])%255]}let n=[...r.slice(0,t)];for(let o=0;o<e;o++)n.push(s[t+o]);return n}var Z=new Uint8Array(512),ht=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)Z[e]=t,ht[t]=e,t<<=1,t>=256&&(t^=285);for(let e=255;e<512;e++)Z[e]=Z[e-255]})();function bs(r){let t=new Uint8Array([1]);for(let e=0;e<r;e++){let i=new Uint8Array(t.length+1),s=e;for(let n=0;n<t.length;n++)i[n]^=t[n],i[n+1]^=Z[(ht[t[n]]+s)%255];t=i}return t}function vs(r,t,e){let i=[[0,0],[e-7,0],[0,e-7]];for(let[s,n]of i){for(let o=0;o<7;o++)for(let a=0;a<7;a++){let l=o===0||o===6||a===0||a===6||o>=2&&o<=4&&a>=2&&a<=4;r[s+o][n+a]=l?1:0,t[s+o][n+a]=1}for(let o=-1;o<=7;o++)for(let[a,l]of[[o,-1],[o,7],[-1,o],[7,o]]){let c=s+a,h=n+l;c>=0&&c<e&&h>=0&&h<e&&(r[c][h]=0,t[c][h]=1)}}}function ys(r,t,e){if(e<2)return;let i=ds[e-1];for(let s of i)for(let n of i)if(!t[s][n])for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++){let l=Math.abs(o)===2||Math.abs(a)===2||o===0&&a===0;r[s+o][n+a]=l?1:0,t[s+o][n+a]=1}}function ws(r,t,e){for(let i=8;i<e-8;i++){let s=i%2===0?1:0;t[6][i]||(r[6][i]=s,t[6][i]=1),t[i][6]||(r[i][6]=s,t[i][6]=1)}}function ks(r,t){for(let e=0;e<=8;e++)e<t&&(r[8][e]=1),e<t&&(r[e][8]=1);for(let e=0;e<=7;e++)r[8][t-1-e]=1,r[t-1-e][8]=1;r[t-8][8]=1}function xs(r,t,e,i){let s=[];for(let a of e)for(let l=7;l>=0;l--)s.push(a>>l&1);let n=0,o=!0;for(let a=i-1;a>=1;a-=2){a===6&&(a=5);let l=o?Array.from({length:i},(c,h)=>i-1-h):Array.from({length:i},(c,h)=>h);for(let c of l)for(let h of[a,a-1])h<0||h>=i||t[c][h]||(r[c][h]=n<s.length?s[n]:0,n++);o=!o}}var As=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107];function Es(r,t){let i=[1,0,3,2][r]*8+t;return As[i]}var Ss=[(r,t)=>(r+t)%2===0,r=>r%2===0,(r,t)=>t%3===0,(r,t)=>(r+t)%3===0,(r,t)=>(Math.floor(r/2)+Math.floor(t/3))%2===0,(r,t)=>r*t%2+r*t%3===0,(r,t)=>(r*t%2+r*t%3)%2===0,(r,t)=>((r+t)%2+r*t%3)%2===0];function Cs(r,t,e,i){let s=r.map(o=>new Uint8Array(o)),n=Ss[i];for(let o=0;o<e;o++)for(let a=0;a<e;a++)!t[o][a]&&n(o,a)&&(s[o][a]^=1);return s}function Ts(r,t,e,i){let s=Es(e,i),n=[[0,8],[1,8],[2,8],[3,8],[4,8],[5,8],[7,8],[8,8],[8,7],[8,5],[8,4],[8,3],[8,2],[8,1],[8,0]];for(let a=0;a<15;a++){let[l,c]=n[a];r[l][c]=s>>14-a&1}let o=[[8,t-1],[8,t-2],[8,t-3],[8,t-4],[8,t-5],[8,t-6],[8,t-7],[8,t-8],[t-7,8],[t-6,8],[t-5,8],[t-4,8],[t-3,8],[t-2,8],[t-1,8]];for(let a=0;a<15;a++){let[l,c]=o[a];r[l][c]=s>>14-a&1}r[t-8][8]=1}function _s(r,t){let e=0;for(let i=0;i<t;i++){let s=1;for(let n=1;n<t;n++)r[i][n]===r[i][n-1]?(s++,s===5?e+=3:s>5&&(e+=1)):s=1}for(let i=0;i<t;i++){let s=1;for(let n=1;n<t;n++)r[n][i]===r[n-1][i]?(s++,s===5?e+=3:s>5&&(e+=1)):s=1}for(let i=0;i<t-1;i++)for(let s=0;s<t-1;s++){let n=r[i][s];n===r[i][s+1]&&n===r[i+1][s]&&n===r[i+1][s+1]&&(e+=3)}return e}function Ls(r,t,e,i){let s=1/0,n=null;for(let o=0;o<8;o++){let a=Cs(r,t,e,o);Ts(a,e,i,o);let l=_s(a,e);l<s&&(s=l,n=a)}return n}p("qr-code",Xt);var Jt=class extends m{#t;#e;#i;#s=!1;#n=0;#r=0;#o=0;#a=!1;#c=!1;get activated(){return this.#a}get#l(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}setup(){this.#c||(this.#h(),this.#c=!0),this.listen(this.#t,"pointerdown",this.#f),this.listen(this.#t,"keydown",this.#u),this.listen(this.#t,"transitionend",this.#b)}#h(){this.#i=document.createElement("div"),this.#i.className="slide-track",this.#e=document.createElement("span"),this.#e.className="slide-label",this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t=document.createElement("div"),this.#t.className="slide-handle",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow","0"),this.#t.setAttribute("aria-label",this.getAttribute("label")||"Slide to confirm"),this.#t.setAttribute("tabindex","0"),this.#t.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#i.append(this.#e,this.#t),this.textContent="",this.appendChild(this.#i),this.#g(0)}reset(){this.#a=!1,this.removeAttribute("data-activated"),this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t.removeAttribute("aria-disabled"),this.#t.setAttribute("tabindex","0"),this.#g(0),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}#f=t=>{if(!this.#a){if(t.preventDefault(),this.hasAttribute("transitioning")){let e=this.#t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=parseFloat(getComputedStyle(this.#i).getPropertyValue("--_handle-inset")||"0"),n=this.#t.offsetWidth,o=i.width-n-s*2,a=e.left-i.left-s;this.removeAttribute("transitioning"),this.#n=o>0?Math.max(0,Math.min(100,a/o*100)):0,this.#g(this.#n)}this.#s=!0,this.#r=t.clientX,this.#o=this.#n,this.#t.setPointerCapture(t.pointerId),this.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#d),this.#t.addEventListener("pointerup",this.#p),this.#t.addEventListener("pointercancel",this.#p)}};#d=t=>{if(!this.#s)return;let e=this.#i.getBoundingClientRect().width-this.#t.offsetWidth;if(e<=0)return;let s=(t.clientX-this.#r)/e*100,n=Math.min(100,Math.max(0,this.#o+s));this.#g(n)};#p=t=>{this.#s&&(this.#s=!1,this.removeAttribute("data-dragging"),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#d),this.#t.removeEventListener("pointerup",this.#p),this.#t.removeEventListener("pointercancel",this.#p),this.#n>=this.#l?this.#w():this.#m())};#u=t=>{if(this.#a)return;let e=t.shiftKey?20:5;t.key==="ArrowRight"?(t.preventDefault(),this.#g(Math.min(100,this.#n+e))):t.key==="ArrowLeft"?(t.preventDefault(),this.#g(Math.max(0,this.#n-e))):t.key==="End"?(t.preventDefault(),this.#w()):t.key==="Home"&&(t.preventDefault(),this.#g(0)),t.key==="ArrowRight"&&this.#n>=this.#l&&this.#w()};#b=()=>{this.removeAttribute("transitioning")};#w(){this.#a=!0,this.#g(100),this.setAttribute("data-activated",""),this.#e.textContent=this.getAttribute("activated-label")||"Confirmed!",this.#t.setAttribute("aria-disabled","true"),this.#t.removeAttribute("tabindex"),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0}))}#m(){this.setAttribute("transitioning",""),this.#g(0),setTimeout(()=>{this.hasAttribute("transitioning")&&this.removeAttribute("transitioning")},500)}#g(t){this.#n=t,this.style.setProperty("--_slide-position",String(t)),this.#t.setAttribute("aria-valuenow",String(Math.round(t)))}};p("slide-accept",Jt);var Yt=class extends m{#t=null;static get observedAttributes(){return["position"]}get#e(){return this.getAttribute("persist")||"banner"}get#i(){let t=this.getAttribute("expires");return t==="0"||t==="never"?0:t?parseInt(t,10):365}get#s(){let t=this.#i;return t>0?t*864e5:void 0}setup(){return this.#t=this.querySelector("dialog"),this.#t?(this.getAttribute("trigger")&&this.listen(document,"click",this.#l),this.#n(),!0):!1}async#n(){if(await this.#h()){this.getAttribute("trigger")?this.hidden=!0:this.remove();return}this.#r()}#r(){(this.getAttribute("position")||"bottom")==="center"?(this.#t.showModal(),this.#t.addEventListener("cancel",this.#a)):this.#t.show(),this.addEventListener("click",this.#c)}#o(){this.#t.removeEventListener("cancel",this.#a),this.removeEventListener("click",this.#c),this.#t.close(),this.getAttribute("trigger")?this.hidden=!0:this.remove()}#a=t=>{t.preventDefault()};#c=async t=>{let e=t.target.closest("button[value]");if(!e)return;let i=e.value;if(!["accept","reject","save"].includes(i))return;let s=[...this.querySelectorAll('input[type="checkbox"]')],n={};i==="accept"?s.forEach(o=>{n[o.name]=!0}):i==="reject"?s.forEach(o=>{n[o.name]=!!o.disabled}):s.forEach(o=>{n[o.name]=o.checked}),await this.#f({preferences:n,action:i}),this.dispatchEvent(new CustomEvent("consent-banner:change",{bubbles:!0,detail:{preferences:n,action:i}})),this.#o()};#l=async t=>{let e=this.getAttribute("trigger");if(!e||!t.target.closest(e))return;t.preventDefault();let s=await this.#h();if(s?.preferences)for(let[n,o]of Object.entries(s.preferences)){let a=this.querySelector(`input[type="checkbox"][name="${CSS.escape(n)}"]`);a&&!a.disabled&&(a.checked=o)}this.hidden=!1,this.#r()};async#h(){let t=this.#s;return await A.get("consent",this.#e,t?{maxAge:t}:void 0)}async#f(t){await A.set("consent",this.#e,t)}static async reset(t="banner"){await A.remove("consent",t)}static async getConsent(t="banner"){return await A.get("consent",t)}};p("consent-banner",Yt);var Zt=class extends m{#t=null;#e=null;#i=[];#s="";#n=0;#r=null;#o=null;#a=null;#c=null;#l=!1;#h=!1;#f=0;#d=null;#p=null;#u=null;#b=null;#w=null;#m=null;#g=null;#v=!1;#y=null;#k=null;static get observedAttributes(){return["speed","voice","for"]}attributeChangedCallback(t,e,i){if(e!==i&&(t==="for"&&(this.stop(),this.#P()),(t==="speed"||t==="voice")&&this.#l&&this.#O(),t==="speed")){let s=this.#F(parseFloat(i)||1);this.#w&&(this.#w.value=String(s)),this.#m&&(this.#m.textContent=`${s}\xD7`)}}setup(){return"speechSynthesis"in window?(this.getAttribute("variant")==="icon"?this.#j():this.#C(),this.#P(),this.#J(),this.#c=this.#G(),this.#c.then(t=>this.#tt(t)),this.listen(window,"beforeunload",this.#et),!0):(this.style.display="none",!1)}teardown(){this.stop(),this.#Y(),this.#k&&(this.#k.remove(),this.#k=null),this.#y&&(this.#y.remove(),this.#y=null)}play(){if(this.#h){this.resume();return}this.#l||this.#D(0)}pause(){!this.#l||this.#h||(speechSynthesis.pause(),this.#h=!0,this.#X(!0),this.#I("text-reader:pause"))}resume(){this.#h&&(speechSynthesis.resume(),this.#h=!1,this.#X(!1),this.#I("text-reader:resume"))}stop(){speechSynthesis.cancel(),this.#U(),this.#I("text-reader:stop")}get voices(){return this.#c||this.#G()}get speaking(){return this.#l}get paused(){return this.#h}get progress(){return this.#s.length?Math.min(this.#n/this.#s.length,1):0}#C(){let t=document.createElement("div");t.setAttribute("part","controls"),t.setAttribute("role","group"),t.setAttribute("aria-label","Article reader");let e=this.#x("play",this.getAttribute("label-play")||"Play","\u25B6");e.addEventListener("click",()=>this.play());let i=this.#x("pause",this.getAttribute("label-pause")||"Pause","\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#x("stop",this.getAttribute("label-stop")||"Stop","\u23F9");s.disabled=!0,s.addEventListener("click",()=>this.stop());let n=document.createElement("select");n.setAttribute("aria-label","Voice");let o=document.createElement("option");o.textContent="Loading voices\u2026",n.append(o),n.addEventListener("change",()=>{this.#l&&this.#O()});let a=document.createElement("label");a.setAttribute("data-speed-group","");let l=document.createElement("span");l.setAttribute("data-speed-value","");let c=this.#F(parseFloat(this.getAttribute("speed")??"1")||1);l.textContent=`${c}\xD7`;let h=document.createElement("input");h.type="range",h.min="0.5",h.max="2",h.step="0.1",h.value=String(c),h.setAttribute("aria-label","Speed"),h.addEventListener("input",()=>{let u=parseFloat(h.value);l.textContent=`${u}\xD7`,this.#l&&this.#O()}),a.append(l,h),this.#A("icon-play",e),this.#A("icon-pause",i),this.#A("icon-stop",s),t.append(e,i,s,n,a),this.prepend(t),this.#g=t,this.#d=e,this.#p=i,this.#u=s,this.#b=n,this.#w=h,this.#m=l}#x(t,e,i){let s=document.createElement("button");return s.type="button",s.setAttribute("part",`button ${t}`),s.setAttribute("aria-label",e),s.textContent=i,s}#A(t,e){let i=this.querySelector(`[slot="${t}"]`);i&&(i.removeAttribute("slot"),e.textContent="",e.append(i))}#j(){this.#v=!0;for(let i of this.querySelectorAll(':scope > [part="trigger"]'))i.remove();let t=document.createElement("button");t.type="button",t.setAttribute("part","trigger"),t.setAttribute("aria-label","Article reader"),t.setAttribute("aria-pressed","false");let e=this.querySelector('[slot="icon-trigger"]');if(e)e.removeAttribute("slot"),t.append(e);else{let i=document.createElement("icon-wc");i.setAttribute("name","volume-2"),i.setAttribute("aria-hidden","true"),t.append(i)}t.addEventListener("click",()=>this.#T()),this.append(t),this.#y=t,this.#S()}#S(){let t=document.createElement("div");t.setAttribute("data-text-reader-toolbar",""),t.setAttribute("role","group"),t.setAttribute("aria-label","Reader controls"),t.hidden=!0;let e=this.#x("play",this.getAttribute("label-play")||"Play","\u25B6");e.addEventListener("click",()=>this.play());let i=this.#x("pause",this.getAttribute("label-pause")||"Pause","\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#x("stop",this.getAttribute("label-stop")||"Stop","\u23F9");s.addEventListener("click",()=>this.stop());let n=this.#x("speed-down","Slower","\u2212");n.addEventListener("click",()=>this.#N(-.1));let o=document.createElement("span");o.setAttribute("data-speed-value","");let a=this.#F(parseFloat(this.getAttribute("speed")??"1")||1);o.textContent=`${a}\xD7`;let l=this.#x("speed-up","Faster","+");l.addEventListener("click",()=>this.#N(.1)),this.#A("icon-play",e),this.#A("icon-pause",i),this.#A("icon-stop",s),t.append(e,i,s,n,o,l),document.body.append(t),this.#d=e,this.#p=i,this.#u=s,this.#m=o,this.#k=t,this.listen(document,"pointerdown",this.#$),this.listen(document,"keydown",this.#L)}#T(){if(!this.#l){this.play();return}this.#k?.hidden&&this.#E(),this.#h?this.resume():this.pause()}#E(){if(!this.#k||!this.#y)return;let t=this.#k;t.hidden=!1,t.style.visibility="hidden",requestAnimationFrame(()=>{this.#M(),t.style.visibility=""})}#_(){this.#k&&(this.#k.hidden=!0)}#M(){let t=this.#k,e=this.#y;if(!t||!e)return;let i=e.getBoundingClientRect(),s=t.offsetWidth,n=t.offsetHeight,o=8,a=8,l=i.top-n-o;l<a&&(l=i.bottom+o);let c=i.left+i.width/2-s/2,h=window.innerWidth-s-a;c=Math.max(a,Math.min(c,h)),t.style.top=`${l}px`,t.style.left=`${c}px`}#N(t){let e=parseFloat(this.getAttribute("speed")??"1")||1,i=this.#F(e+t);this.setAttribute("speed",String(i))}#$=t=>{!this.#k||this.#k.hidden||this.#k.contains(t.target)||this.#y?.contains(t.target)||this.#_()};#L=t=>{t.key==="Escape"&&this.#k&&!this.#k.hidden&&this.#_()};#P(){let t=this.getAttribute("for");if(!t){console.warn('<text-reader>: missing "for" attribute'),this.#B();return}if(this.#t=document.getElementById(t),!this.#t){console.warn(`<text-reader>: no element found with id="${t}"`),this.#B();return}this.#H(),this.#z()}#B(){this.#d&&(this.#d.disabled=!0),this.#u&&(this.#u.disabled=!0)}#z(){this.#d&&(this.#d.disabled=!1)}#H(){let t=this.#t;if(!t)return;let e=this.getAttribute("selectors")||"p,li",i=[...t.querySelectorAll(e)],s=o=>o.closest("pre")||o.closest("code")||o.closest('[aria-hidden="true"]');this.#i=[];let n=0;for(let o of i){if(s(o))continue;let a=o.textContent.trim();a&&(this.#i.push({element:o,text:a,speechStart:n,speechEnd:n+a.length}),n+=a.length+1)}this.#s=this.#i.map(o=>o.text).join(" ")}#D(t){if(!this.#s)return;let e=t>0?this.#s.slice(t):this.#s;if(!e.trim())return;let i=e.replace(/[<>]/g," "),s=new SpeechSynthesisUtterance(i);s.rate=this.#F(parseFloat(this.#w?.value??this.getAttribute("speed")??"1")||1);let n=this.#b?.selectedOptions[0];if(n?.dataset.voiceUri){let o=speechSynthesis.getVoices().find(a=>a.voiceURI===n.dataset.voiceUri);o&&(s.voice=o)}s.onboundary=o=>{if(o.name!=="word")return;let a=t+o.charIndex;this.#n=a;let l=o.charLength;if(!l){let h=this.#s.slice(a).match(/^\S+/);l=h?h[0].length:1}this.#Z(a,l),this.#I("text-reader:word",{word:this.#s.slice(a,a+l),charIndex:a,element:this.#W(a)?.element})},s.onend=()=>{let o=Date.now()-this.#f;this.#U(),this.#I("text-reader:end",{duration:o})},s.onerror=o=>{o.error==="interrupted"||o.error==="canceled"||(console.warn("<text-reader>: SpeechSynthesisUtterance error:",o.error),this.#U(),this.#I("text-reader:error",{error:o.error}))},this.#e=s,this.#l=!0,this.#h=!1,this.#f=Date.now(),this.#n=t,this.#K(!0),speechSynthesis.cancel(),speechSynthesis.speak(s),this.#q(),this.#I("text-reader:play",{voice:s.voice?.name,speed:s.rate})}#O(){let t=this.#n;speechSynthesis.cancel(),this.#R(),requestAnimationFrame(()=>this.#D(t))}#q(){this.#R(),this.#r=setInterval(()=>{if(!speechSynthesis.speaking){this.#R();return}speechSynthesis.pause(),speechSynthesis.resume()},1e4)}#R(){this.#r&&clearInterval(this.#r),this.#r=null}#J(){if(!CSS.highlights)return;let t=new CSSStyleSheet;t.replaceSync(`
|
|
1065
|
+
`}loadTiles(){let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i)){this.handleError("Missing or invalid lat/lng coordinates");return}let s=this.zoom,n=this.provider,{tileX:o,tileY:a,pixelX:l,pixelY:c}=Ke(e,i,s),h=this.shadowRoot.querySelector('[part="tiles"]');if(!h)return;h.innerHTML="";let u=this,d=u.offsetWidth||400,f=u.offsetHeight||300,g=Math.round(d/2-256-l),w=Math.round(f/2-256-c);h.style.transform=`translate(${g}px, ${w}px)`;let x=0,_=0,O=9;for(let V=-1;V<=1;V++)for(let W=-1;W<=1;W++){let G=o+W,$=a+V,Vi=rt(n,s,G,$,this.tileUrl),P=document.createElement("img");P.src=Vi,P.alt="",P.loading="lazy",P.draggable=!1,P.addEventListener("load",()=>{x++,x+_===O&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:s}}))}),P.addEventListener("error",()=>{_++,_===O?this.handleError("Failed to load map tiles"):x+_===O&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:s}}))}),h.appendChild(P)}}#o(){let t=this.shadowRoot.querySelector('[part="overlay"]');if(!t)return;let e=t.querySelector('[part="activate"]');t.addEventListener("mouseenter",()=>this.#a(),{once:!0}),e&&e.addEventListener("focus",()=>this.#a(),{once:!0}),e&&e.addEventListener("click",()=>this.#c()),this.interactive==="eager"&&requestAnimationFrame(()=>this.#c())}#a(){if(this.#e)return;let t=this.tileUrl;if(t)try{let n=new URL(t,location.origin);if(n.origin===location.origin){this.#e=!0;return}this.#e=!0;let o=document.createElement("link");o.rel="preconnect",o.href=n.origin,o.crossOrigin="",document.head.appendChild(o);return}catch{}this.#e=!0;let e=this.provider,i;e==="carto-light"||e==="carto-dark"?i="https://basemaps.cartocdn.com":i="https://tile.openstreetmap.org";let s=document.createElement("link");s.rel="preconnect",s.href=i,s.crossOrigin="",document.head.appendChild(s)}async#c(){if(this.#t)return;let t=this.#i(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i))return;let{MapInteraction:s}=await Promise.resolve().then(()=>(Ye(),Je));this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.focus(),this.setAttribute("data-interactive-active",""),this.#t=new s({shadow:this.shadowRoot,host:this,lat:e,lng:i,zoom:this.zoom,provider:this.provider,tileUrl:this.tileUrl,onDeactivate:()=>this.#l()}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:e,lng:i,zoom:this.zoom}}))}#l(){this.#t&&(this.#t.destroy(),this.#t=null,this.removeAttribute("data-interactive-active"),this.render(),this.loadTiles(),this.#o())}handleError(t){let e=this.shadowRoot.querySelector('[part="container"]');e&&(e.setAttribute("data-state","error"),e.setAttribute("data-error",t)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};p("geo-map",Nt);var at=null;async function ss(){return at||(at=await Promise.resolve().then(()=>(jt(),Rt)),at)}var $t=8,rs=150,ti="vb-emoji-recent",Pt=class extends m{#t;#e;#i;#s;#n;#r=!1;#o=[];#a=-1;#c=null;#l="";#h=null;#f=!1;#d=null;#p=null;setup(){return this.#u(),!0}async#u(){this.#h=await ss(),this.#f||(this.#b(),this.#f=!0),this.#t&&this.listen(this.#t,"click",this.#y),this.listen(document,"click",this.#k),this.listen(document,"keydown",this.#C)}teardown(){this.#c&&(clearTimeout(this.#c),this.setState("search-pending",!1))}#b(){this.#t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#t||(this.#t=document.createElement("button"),this.#t.type="button",this.#t.textContent="\u{1F600}",this.#t.setAttribute("data-trigger",""),this.prepend(this.#t)),this.#t.setAttribute("aria-haspopup","dialog"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-label",this.#t.getAttribute("aria-label")||"Open emoji picker"),this.#w()}#w(){this.#e=document.createElement("div"),this.#e.classList.add("picker"),this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label","Emoji picker"),this.#e.hidden=!0,this.#i=document.createElement("input"),this.#i.type="search",this.#i.placeholder="Search emoji\u2026",this.#i.setAttribute("aria-label","Search emoji"),this.#i.addEventListener("input",this.#x),this.#i.addEventListener("keydown",this.#A),this.#e.appendChild(this.#i),this.#n=document.createElement("nav"),this.#n.classList.add("categories"),this.#n.setAttribute("role","tablist"),this.#n.setAttribute("aria-label","Emoji categories");for(let t of this.#h.EMOJI_GROUPS){let e=document.createElement("button");e.type="button",e.setAttribute("role","tab"),e.setAttribute("aria-selected",t===this.#h.EMOJI_GROUPS[0]?"true":"false"),e.setAttribute("data-group",t),e.setAttribute("aria-label",this.#h.EMOJI_GROUP_LABELS[t]),e.title=this.#h.EMOJI_GROUP_LABELS[t],e.textContent=this.#h.EMOJI_GROUP_ICONS[t],e.addEventListener("click",this.#j),this.#n.appendChild(e)}this.#e.appendChild(this.#n),this.#s=document.createElement("div"),this.#s.classList.add("grid"),this.#s.setAttribute("role","grid"),this.#s.setAttribute("aria-label","Emoji"),this.#s.addEventListener("keydown",this.#S),this.#e.appendChild(this.#s),this.appendChild(this.#e),this.#m()}#m(t=null){this.#s.innerHTML="",this.#o=[],this.#a=-1;let e=this.#N();if(!this.#l&&e.length>0){let s=document.createElement("div");s.classList.add("group-label"),s.textContent="Recently Used",s.setAttribute("data-group-heading","recent"),this.#s.appendChild(s);for(let n of e){let o=this.#h.EMOJI_MAP.get(n);o&&this.#g(o)}}let i=t||null;if(i)if(i.length===0){let s=document.createElement("div");s.classList.add("no-results"),s.textContent="No emoji found",this.#s.appendChild(s)}else for(let s of i)this.#g(s);else for(let s of this.#h.EMOJI_GROUPS){let n=document.createElement("div");n.classList.add("group-label"),n.textContent=this.#h.EMOJI_GROUP_LABELS[s],n.setAttribute("data-group-heading",s),this.#s.appendChild(n);let o=this.#h.getByGroup(s);for(let a of o)this.#g(a)}}#g(t){let e=document.createElement("button");e.type="button",e.setAttribute("role","gridcell"),e.setAttribute("tabindex","-1"),e.setAttribute("data-shortcode",t.shortcode),e.title=`${t.name} :${t.shortcode}:`,e.textContent=t.emoji,e.addEventListener("click",this.#T),this.#s.appendChild(e),this.#o.push(e)}#v(){let t=this.getAttribute("for");if(!t)return;let e=document.getElementById(t);if(e){if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"){let i=e;this.#d={start:i.selectionStart??i.value.length,end:i.selectionEnd??i.value.length},this.#p=null}else if(e.isContentEditable){let i=window.getSelection();i&&i.rangeCount>0&&(this.#p=i.getRangeAt(0).cloneRange()),this.#d=null}}}#y=t=>{t.stopPropagation(),this.toggle()};#k=t=>{this.#r&&!this.contains(t.target)&&this.close()};#C=t=>{t.key==="Escape"&&this.#r&&(t.preventDefault(),this.close(),this.#t?.focus())};#x=()=>{this.#c&&clearTimeout(this.#c),this.setState("search-pending",!0),this.#c=setTimeout(()=>{if(this.setState("search-pending",!1),this.#l=this.#i.value.trim(),this.#l){let t=this.#h.searchEmoji(this.#l);this.#m(t)}else this.#m()},rs)};#A=t=>{t.key==="ArrowDown"&&(t.preventDefault(),this.#o.length>0&&this.#E(0))};#j=t=>{let e=t.currentTarget.getAttribute("data-group");for(let s of this.#n.querySelectorAll('[role="tab"]'))s.setAttribute("aria-selected",s===t.currentTarget?"true":"false");this.#l&&(this.#i.value="",this.#l="",this.#m());let i=this.#s.querySelector(`[data-group-heading="${e}"]`);i&&i.scrollIntoView({block:"start",behavior:"smooth"})};#S=t=>{let e=this.#o.length;if(e!==0)switch(t.key){case"ArrowRight":t.preventDefault(),this.#E(this.#a+1);break;case"ArrowLeft":t.preventDefault(),this.#E(this.#a-1);break;case"ArrowDown":t.preventDefault(),this.#E(this.#a+$t);break;case"ArrowUp":t.preventDefault(),this.#a<$t?(this.#i.focus(),this.#a=-1):this.#E(this.#a-$t);break;case"Home":t.preventDefault(),this.#E(0);break;case"End":t.preventDefault(),this.#E(e-1);break;case"Enter":case" ":t.preventDefault(),this.#a>=0&&this.#o[this.#a].click();break;case"Tab":this.close();break}};#T=t=>{let e=t.currentTarget.getAttribute("data-shortcode"),i=this.#h.EMOJI_MAP.get(e);i&&(this.#$(e),this.#_(i),this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:i.shortcode,emoji:i.emoji,name:i.name,keywords:i.keywords}})),this.close(),this.#M())};#E(t){let e=this.#o.length;e!==0&&(t<0&&(t=0),t>=e&&(t=e-1),this.#a=t,this.#o[t].focus())}#_(t){let e=this.getAttribute("for");if(!e)return;let i=document.getElementById(e);if(i){if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"){let s=i,n=this.#d?.start??s.value.length,o=this.#d?.end??n,a=s.value.slice(0,n),l=s.value.slice(o);s.value=a+t.emoji+l;let c=n+t.emoji.length;s.setSelectionRange(c,c),this.#d={start:c,end:c},i.dispatchEvent(new Event("input",{bubbles:!0}))}else if(i.isContentEditable){i.focus();let s=window.getSelection();if(s&&this.#p){s.removeAllRanges(),s.addRange(this.#p);let n=s.getRangeAt(0);n.deleteContents();let o=document.createTextNode(t.emoji);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),s.removeAllRanges(),s.addRange(n),this.#p=n.cloneRange()}else if(s){let n=document.createRange();n.selectNodeContents(i),n.collapse(!1);let o=document.createTextNode(t.emoji);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),s.removeAllRanges(),s.addRange(n)}}}}#M(){let t=this.getAttribute("for");if(!t)return;let e=document.getElementById(t);e&&e.focus()}#N(){try{return JSON.parse(localStorage.getItem(ti)||"[]")}catch{return[]}}#$(t){let e=parseInt(this.getAttribute("recent-limit")??"24",10)||24,i=this.#N();i=i.filter(s=>s!==t),i.unshift(t),i.length>e&&(i.length=e);try{localStorage.setItem(ti,JSON.stringify(i))}catch{}}open(){this.#r||(this.#v(),this.#r=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#i.value="",this.#l="",this.#m(),requestAnimationFrame(()=>{this.#i.focus()}),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0})))}close(){this.#r&&(this.#r=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#e.hidden=!0,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0})))}toggle(){this.#r?this.close():this.open()}get isOpen(){return this.#r}};p("emoji-picker",Pt);var Bt=class r extends m{#t=null;#e=null;#i=!1;#s=null;setup(){this.setAttribute("role","list"),this.#i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#r(),this.#a(),this.#p(),this.#n()}teardown(){this.#t&&(this.#t.remove(),this.#t=null),r.#A?.source===this&&(r.#A=null)}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")||"vertical"}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#n(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("aria-grabbed")||t.setAttribute("aria-grabbed","false")}#r(){this.#t=document.createElement("div"),this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.#t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);",this.prepend(this.#t)}#o(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#a(){this.listen(this,"pointerdown",t=>{this.#s=t.target}),this.listen(this,"dragstart",this.#c.bind(this)),this.listen(this,"dragover",this.#l.bind(this)),this.listen(this,"dragleave",this.#h.bind(this)),this.listen(this,"drop",this.#f.bind(this)),this.listen(this,"dragend",this.#d.bind(this))}#c(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let i=e.querySelector("[data-drag-handle]");if(i&&!i.contains(this.#s)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#g(e);r.#A={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#l(t){let e=r.#A;if(!e||(this.group||e.source.group)&&this.group!==e.source.group)return;t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over","");let i=this.orientation==="horizontal"?t.clientX:t.clientY;this.#C(i)}#h(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#x())}#f(t){t.preventDefault(),this.removeAttribute("data-drag-over"),this.#x();let e=r.#A;if(!e)return;let{item:i,source:s,originalIndex:n}=e,o=this.orientation==="horizontal"?t.clientX:t.clientY,a=this.#k(o);if(s===this){this.#v(i,a),this.#y();let l=this.#g(i);this.#b(i),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:i,itemId:i.dataset.id,oldIndex:n,newIndex:l,order:this.sortedOrder}}))}else this.#v(i,a),this.#y(),s.#y(),this.#b(i),this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:i,itemId:i.dataset.id,fromSurface:s,toSurface:this,newIndex:this.#g(i),fromOrder:s.sortedOrder,toOrder:this.sortedOrder}}))}#d(){let t=r.#A;t?.item&&t.item.removeAttribute("data-dragging"),this.removeAttribute("data-drag-over"),this.#x(),r.#A=null,this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#p(){this.listen(this,"keydown",this.#u.bind(this))}#u(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let i=e.getAttribute("aria-grabbed")==="true",s=this.orientation==="horizontal",n=s?"ArrowLeft":"ArrowUp",o=s?"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){if(t.preventDefault(),i){e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#y(),this.#b(e);let c=this.#g(e),h=this.draggableChildren;this.#o(`${this.#m(e)}, dropped at position ${c+1} of ${h.length}`),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,oldIndex:this.#e,newIndex:c,order:this.sortedOrder}})),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null}else{this.#e=this.#g(e),e.setAttribute("aria-grabbed","true"),this.setAttribute("data-reorder-mode","");let c=this.draggableChildren;this.#o(`${this.#m(e)}, grabbed. Position ${this.#e+1} of ${c.length}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}return}if(!i&&(t.key===n||t.key===o)){t.preventDefault();let c=this.draggableChildren,h=c.indexOf(e),u=t.key===n?Math.max(0,h-1):Math.min(c.length-1,h+1);u!==h&&c[u].focus();return}if(i&&(t.key===n||t.key===o)){t.preventDefault();let c=this.draggableChildren,h=c.indexOf(e),u=t.key===n?Math.max(0,h-1):Math.min(c.length-1,h+1);u!==h&&(this.#v(e,u),e.focus(),this.#o(`Position ${u+1} of ${c.length}`));return}let a=s?"ArrowUp":"ArrowLeft",l=s?"ArrowDown":"ArrowRight";if(i&&(t.key===a||t.key===l)){if(t.preventDefault(),!this.group)return;let c=t.key===l?1:-1,h=this.#w(c);if(!h)return;h.appendChild(e),h.#y(),this.#y(),h.#b(e),e.focus();let u=h.getAttribute("aria-label")||"next surface";h.#o(`Moved to ${u}`),h.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,fromSurface:this,toSurface:h,newIndex:h.draggableChildren.indexOf(e),fromOrder:this.sortedOrder,toOrder:h.sortedOrder}})),this.removeAttribute("data-reorder-mode"),h.setAttribute("data-reorder-mode",""),this.#e=null;return}if(i&&t.key==="Escape"){t.preventDefault(),e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#e!=null&&(this.#v(e,this.#e),e.focus()),this.#o("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null;return}!i&&t.key==="Escape"&&(t.preventDefault(),e.blur())}#b(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#w(t){if(!this.group)return null;let e=[...document.querySelectorAll(`drag-surface[group="${this.group}"]`)];if(e.length<2)return null;e.sort((n,o)=>{let a=n.getBoundingClientRect(),l=o.getBoundingClientRect();return a.left-l.left||a.top-l.top});let i=e.indexOf(this);return e[i+t]||null}#m(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#g(t){return this.draggableChildren.indexOf(t)}#v(t,e){let s=this.draggableChildren.filter(n=>n!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#y(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#k(t){let e=this.orientation==="horizontal",i=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<i.length;s++){let n=i[s].getBoundingClientRect(),o=e?n.left+n.width/2:n.top+n.height/2;if(t<o)return s}return i.length}#C(t){this.#x();let e=this.orientation==="horizontal",i=this.draggableChildren.filter(s=>!s.hasAttribute("data-dragging"));for(let s=0;s<i.length;s++){let n=i[s].getBoundingClientRect(),o=e?n.left+n.width/2:n.top+n.height/2;if(t<o){i[s].setAttribute("data-drop-target","before");return}}i.length>0&&i[i.length-1].setAttribute("data-drop-target","after")}#x(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#A=null};p("drag-surface",Bt);var It=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),ei={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",shift:"\u21E7",ctrl:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",shift:"Shift",ctrl:"Ctrl"}};function X(r){let t=It?ei.mac:ei.other;return r.split("+").map(e=>{let i=e.trim().toLowerCase();return t[i]??i.toUpperCase()}).join(It?"":"+")}function ii(r){let t=r.toLowerCase().split("+").map(i=>i.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 si(r,t){if(r.key.toLowerCase()!==t.key)return!1;let e,i;return It?(e=t.meta,i=t.ctrl):(e=!1,i=t.meta||t.ctrl),!(e!==r.metaKey||i!==r.ctrlKey||t.shift!==r.shiftKey||t.alt!==r.altKey)}var ns=new Set(["INPUT","TEXTAREA","SELECT"]),J=[],ri=!1;function os(r){let t=ns.has(r.target.tagName)||r.target.isContentEditable;for(let e of J)if(!(t&&!e.global)&&si(r,e.descriptor)){r.preventDefault(),e.callback(r);return}}function as(){ri||(document.addEventListener("keydown",os),ri=!0)}function F(r,t,e={}){as();let i=ii(r),s={combo:r,descriptor:i,callback:t,global:e.global===!0};return J.find(o=>o.combo===r)&&console.warn(`[hotkey-bind] Shortcut "${r}" already bound. Last-connected-wins.`),J.unshift(s),function(){let a=J.indexOf(s);a!==-1&&J.splice(a,1)}}var qt=class extends m{#t;#e;#i;#s=[];#n=-1;#r=[];#o=null;#a=[];setup(){this.#c(),this.#l(),this.hasAttribute("discover")&&this.#b()}teardown(){this.#o?.()}get commands(){let t=[];for(let e of this.#r){let i=e.getAttribute("label")||"";for(let s of e.querySelectorAll("command-item"))t.push({value:s.getAttribute("value")||"",label:s.textContent.trim(),hotkey:s.getAttribute("data-hotkey")||void 0,group:i||void 0})}return t}set commands(t){let e=Array.isArray(t)?t:[],i=new Map;for(let s of e){let n=s.group||"";i.has(n)||i.set(n,[]),i.get(n).push(s)}for(let s of[...this.children])(s.tagName==="COMMAND-GROUP"||s.tagName==="COMMAND-ITEM")&&s.remove();for(let[s,n]of i){let o=document.createElement("command-group");s&&o.setAttribute("label",s);for(let a of n){let l=document.createElement("command-item");if(a.value&&l.setAttribute("value",a.value),a.hotkey&&l.setAttribute("data-hotkey",a.hotkey),a.icon){let c=document.createElement("span");c.setAttribute("slot","icon"),c.innerHTML=a.icon,l.appendChild(c)}l.appendChild(document.createTextNode(a.label||a.value||"")),o.appendChild(l)}this.appendChild(o)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("command-palette:commands-changed",{detail:{commands:e,source:"property"},bubbles:!0}))}#c(){this.#t=document.createElement("dialog"),this.#t.className="command-dialog",this.#t.addEventListener("click",i=>{i.target===this.#t&&this.close()});let t=document.createElement("div");t.className="command-search",this.#e=document.createElement("input"),this.#e.type="search",this.#e.placeholder=this.getAttribute("placeholder")||"Type a command...",this.#e.setAttribute("aria-label","Search commands"),this.#e.autocomplete="off",this.#e.addEventListener("input",this.#h),this.#e.addEventListener("keydown",this.#f),t.appendChild(this.#e),this.#i=document.createElement("div"),this.#i.className="command-list",this.#i.setAttribute("role","listbox"),this.#r=Array.from(this.querySelectorAll("command-group")),this.#r.forEach(i=>{let s=document.createElement("div");s.className="command-group-header",s.textContent=i.getAttribute("label")||"",s.setAttribute("role","presentation");let n=Array.from(i.querySelectorAll("command-item"));this.#i.appendChild(s),n.forEach(o=>{let a=document.createElement("button");a.className="command-option",a.setAttribute("role","option"),a.dataset.value=o.getAttribute("value")||"",a.dataset.searchText=o.textContent.toLowerCase().trim();let l=o.querySelector('[slot="icon"]');if(l){let u=document.createElement("span");u.className="command-icon",u.appendChild(l.cloneNode(!0)),a.appendChild(u)}let c=document.createElement("span");c.className="command-label",c.textContent=o.textContent.trim(),a.appendChild(c);let h=o.getAttribute("data-hotkey");if(h){let u=document.createElement("kbd");u.className="command-kbd",u.textContent=X(h),a.appendChild(u)}a.addEventListener("click",()=>{this.#u(a.dataset.value)}),this.#i.appendChild(a),this.#s.push({btn:a,header:s,group:i})})});let e=document.createElement("div");e.className="command-empty",e.textContent="No results found.",e.hidden=!0,this.#i.appendChild(e),this.#t.appendChild(t),this.#t.appendChild(this.#i),this.appendChild(this.#t)}#l(){let t=this.getAttribute("hotkey")||"meta+k";this.#o=F(t,()=>{this.#t.open?this.close():this.open()},{global:!0})}#h=()=>{let t=this.#e.value.toLowerCase().trim(),e=0,i=new Set;this.#s.forEach(({btn:n,header:o})=>{let a=!t||n.dataset.searchText.includes(t);n.hidden=!a,a&&(e++,i.add(o))}),this.#i.querySelectorAll(".command-group-header").forEach(n=>{n.hidden=!i.has(n)});let s=this.#i.querySelector(".command-empty");s&&(s.hidden=e>0),this.#n=-1,e>0&&this.#p(0)};#f=t=>{let e=this.#d();switch(t.key){case"ArrowDown":t.preventDefault(),this.#p(this.#n+1);break;case"ArrowUp":t.preventDefault(),this.#p(this.#n-1);break;case"Enter":t.preventDefault(),this.#n>=0&&e[this.#n]&&e[this.#n].btn.click();break;case"Escape":t.preventDefault(),this.close();break}};#d(){return this.#s.filter(({btn:t})=>!t.hidden)}#p(t){let e=this.#d();if(e.length===0)return;e.forEach(({btn:s})=>s.removeAttribute("data-active")),t<0&&(t=e.length-1),t>=e.length&&(t=0),this.#n=t;let{btn:i}=e[t];i.setAttribute("data-active",""),i.scrollIntoView({block:"nearest"})}#u(t){this.close(),this.dispatchEvent(new CustomEvent("command-palette:select",{bubbles:!0,detail:{value:t}}))}#b(){this.listen(document,"vb:command-registry-change",this.#w)}#w=()=>{this.#t?.open&&(this.#m(),this.#h())};#m(){if(!this.hasAttribute("discover"))return;let{getRegisteredCommands:t,scanAutoDiscoverable:e}=window.__commandRegistry||{};if(!t)return;this.#s=this.#s.filter(n=>!n.discovered),this.#a.forEach(n=>n.remove()),this.#a=[];let i=this.#i.querySelector(".command-empty"),s=t();for(let[n,o]of s){let a=document.createElement("div");a.className="command-group-header",a.textContent=n,a.setAttribute("role","presentation"),this.#i.insertBefore(a,i),this.#a.push(a);for(let l of o){if(this.contains(l.element))continue;let c=this.#g(l.label,l.icon,l.shortcut);c.dataset.value=`__discovered:${l.label}`,c.addEventListener("click",()=>{this.close(),l.element.click()}),this.#i.insertBefore(c,i),this.#s.push({btn:c,header:a,group:null,discovered:!0})}}if(this.getAttribute("discover")==="auto"&&e){let n=e(),o=new Map;for(let a of n){let l=o.get(a.group)||[];l.push(a),o.set(a.group,l)}for(let[a,l]of o){let c=document.createElement("div");c.className="command-group-header",c.textContent=a,c.setAttribute("role","presentation"),this.#i.insertBefore(c,i),this.#a.push(c);for(let h of l){if(this.contains(h.element))continue;let u=this.#g(h.label,h.icon,h.shortcut);u.dataset.value=`__auto:${h.label}`,u.dataset.auto="",u.addEventListener("click",()=>{this.close(),h.action?h.action():h.element.click()}),this.#i.insertBefore(u,i),this.#s.push({btn:u,header:c,group:null,discovered:!0})}}}}#g(t,e,i){let s=document.createElement("button");if(s.className="command-option",s.setAttribute("role","option"),s.dataset.searchText=t.toLowerCase(),e){let o=document.createElement("span");o.className="command-icon";let a=document.createElement("icon-wc");a.setAttribute("name",e),o.appendChild(a),s.appendChild(o)}let n=document.createElement("span");if(n.className="command-label",n.textContent=t,s.appendChild(n),i){let o=document.createElement("kbd");o.className="command-kbd",o.textContent=X(i),s.appendChild(o)}return s}open(){this.#t.open||(this.#m(),this.#t.showModal(),this.#e.value="",this.#h(),this.#e.focus(),this.dispatchEvent(new CustomEvent("command-palette:open",{bubbles:!0})))}close(){this.#t.open&&(this.#t.close(),this.dispatchEvent(new CustomEvent("command-palette:close",{bubbles:!0})))}get isOpen(){return this.#t?.open??!1}},Dt=class extends HTMLElement{},Ot=class extends HTMLElement{};p("command-palette",qt);p("command-group",Dt);p("command-item",Ot);var Ft=class extends m{#t;#e=null;setup(){this.#i(),this.#e=F("shift+?",()=>{this.#t.open?this.#t.close():this.#s()})}teardown(){this.#e?.(),this.#e=null,this.#t?.remove(),this.#t=null}get shortcuts(){return this.__shortcuts||null}set shortcuts(t){this.__shortcuts=t&&typeof t=="object"?t:null,this.dispatchEvent(new CustomEvent("short-cuts:shortcuts-changed",{detail:{shortcuts:this.__shortcuts,source:"property"},bubbles:!0}))}#i(){this.#t=document.createElement("dialog"),this.#t.className="shortcut-dialog",this.#t.addEventListener("click",t=>{t.target===this.#t&&this.#t.close()}),this.appendChild(this.#t)}#s(){this.#t.innerHTML="";let t=document.createElement("div");t.className="shortcut-header",t.innerHTML="<h2>Keyboard Shortcuts</h2>",this.#t.appendChild(t);let e=document.createElement("div");e.className="shortcut-body";let{getRegisteredCommands:i}=window.__commandRegistry||{},s=new Map;if(s.set("General",[{label:"Show keyboard shortcuts",shortcut:"shift+?"}]),i)for(let[o,a]of i())for(let l of a){if(!l.shortcut)continue;let c=s.get(o)||[];c.push({label:l.label,shortcut:l.shortcut}),s.set(o,c)}let{getHotkeyActions:n}=window.__hotkeyActionRegistry||{};if(n)for(let[o,a]of n()){let l=s.get(o)||[];for(let c of a)l.push({label:c.label,shortcut:c.shortcut});s.set(o,l)}for(let[o,a]of s){let l=document.createElement("div");l.className="shortcut-group";let c=document.createElement("div");c.className="shortcut-group-header",c.textContent=o,l.appendChild(c);for(let h of a){let u=document.createElement("div");u.className="shortcut-row";let d=document.createElement("span");d.className="shortcut-label",d.textContent=h.label;let f=document.createElement("kbd");f.className="shortcut-kbd",f.textContent=X(h.shortcut),u.appendChild(d),u.appendChild(f),l.appendChild(u)}e.appendChild(l)}this.#t.appendChild(e),this.#t.showModal()}};p("short-cuts",Ft);var zt=class extends m{#t;#e=!1;setup(){let t=[...this.children];if(t.length<2)return!1;t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children will be ignored.");let e=this.getAttribute("position"),i=e!==null?Number(e):50,s=Math.min(100,Math.max(0,isNaN(i)?50:i));return this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-label","Comparison slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow",String(Math.round(s))),this.#t.setAttribute("tabindex","0"),this.appendChild(this.#t),this.#o(s),this.listen(this.#t,"pointerdown",this.#i),this.listen(this.#t,"keydown",this.#r),!0}teardown(){this.#t&&(this.#t.remove(),this.#t=null),this.#e=!1}#i=t=>{t.preventDefault(),this.#e=!0,this.#t.setPointerCapture(t.pointerId),this.#t.addEventListener("pointermove",this.#s),this.#t.addEventListener("pointerup",this.#n)};#s=t=>{if(!this.#e)return;let e=this.getBoundingClientRect(),i=t.clientX-e.left,s=Math.min(100,Math.max(0,i/e.width*100));this.#o(s)};#n=t=>{this.#e=!1,this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#s),this.#t.removeEventListener("pointerup",this.#n)};#r=t=>{let e=t.shiftKey?10:1,i=Number(this.#t.getAttribute("aria-valuenow"));t.key==="ArrowLeft"||t.key==="ArrowDown"?(t.preventDefault(),this.#o(Math.max(0,i-e))):(t.key==="ArrowRight"||t.key==="ArrowUp")&&(t.preventDefault(),this.#o(Math.min(100,i+e)))};#o(t){let e=Math.round(t);this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(e)),this.#t.style.left=`${t}%`),this.setAttribute("position",String(e)),this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:t},bubbles:!0}))}get position(){return Number(this.getAttribute("position"))||0}set position(t){let e=Math.min(100,Math.max(0,Number(t)||0));this.#o(e)}};p("compare-surface",zt);function ls(){let r=globalThis.localStorage;if(!r)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return r.getItem(t)},async setRaw(t,e){r.setItem(t,e)},async removeRaw(t){r.removeItem(t)},async keys(t){let e=[];for(let i=0;i<r.length;i++){let s=r.key(i);s&&s.startsWith(t)&&e.push(s)}return e}}}var lt=null;function N(){return lt||(lt=ls()),lt}function Ht(r,t){if(typeof r!="string"||!r)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:${r}:${t}`}function ni(r){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${r}:`}function oi(r){try{let t=JSON.parse(r);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var A={configure(r={}){lt=r.backend??null},async set(r,t,e){let i={data:e,timestamp:Date.now()};await N().setRaw(Ht(r,t),JSON.stringify(i))},async get(r,t,e){let i=await N().getRaw(Ht(r,t));if(i==null)return null;let s=oi(i);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(r,t){await N().removeRaw(Ht(r,t))},async list(r){let t=ni(r),e=await N().keys(t),i=[];for(let s of e){let n=await N().getRaw(s);if(n==null)continue;let o=oi(n);o&&i.push({key:s.slice(t.length),data:o.data,timestamp:o.timestamp})}return i},async clear(r){let t=ni(r),e=await N().keys(t);for(let i of e)await N().removeRaw(i)},async clearAll(){let r=await N().keys("vb:");for(let t of r)await N().removeRaw(t)},async setMany(r,t){for(let[e,i]of t)await A.set(r,e,i)}};var Ut=class extends m{#t;#e;#i;#s=50;#n=!1;#r=50;get#o(){return this.getAttribute("direction")==="vertical"}get#a(){let t=this.getAttribute("min"),e=Number(t);return t!==null&&!isNaN(e)?e:10}get#c(){let t=this.getAttribute("max"),e=Number(t);return t!==null&&!isNaN(e)?e:90}get position(){return this.#s}set position(t){this.#m(Number(t))}get collapsed(){return this.#n}set collapsed(t){t?this.#b():this.#w()}reset(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:50;this.#n=!1,this.#m(i),this.#y()}setup(){let t=[...this.children].filter(e=>!e.classList.contains("split-divider"));return t.length<2?!1:(this.#e=t[0],this.#i=t[1],this.#l(),!0)}async#l(){let t=this.getAttribute("position"),e=Number(t),i=t!==null&&!isNaN(e)?e:null,s=await this.#g(),n=i??s??50;return this.#t=document.createElement("div"),this.#t.className="split-divider",this.#t.setAttribute("role","separator"),this.#t.setAttribute("aria-orientation",this.#o?"vertical":"horizontal"),this.#t.setAttribute("aria-valuenow",String(Math.round(n))),this.#t.setAttribute("aria-valuemin",String(this.#a)),this.#t.setAttribute("aria-valuemax",String(this.#c)),this.#t.setAttribute("aria-label","Resize panels"),this.#t.setAttribute("tabindex","0"),this.insertBefore(this.#t,this.#i),this.#m(n),this.listen(this.#t,"pointerdown",this.#h),this.listen(this.#t,"keydown",this.#p),this.hasAttribute("collapsible")&&this.listen(this.#t,"dblclick",this.#u),!0}teardown(){this.#t&&(this.#t.remove(),this.#t=null)}#h=t=>{t.preventDefault(),this.setState("divider-dragging",!0),this.#t.setPointerCapture(t.pointerId),this.#t.addEventListener("pointermove",this.#f),this.#t.addEventListener("pointerup",this.#d)};#f=t=>{if(!this.matches(":state(divider-dragging)"))return;let e=this.getBoundingClientRect(),i;this.#o?i=(t.clientY-e.top)/e.height*100:i=(t.clientX-e.left)/e.width*100,this.#n&&(this.#n=!1),this.#m(i)};#d=t=>{this.setState("divider-dragging",!1),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#f),this.#t.removeEventListener("pointerup",this.#d),this.#v()};#p=t=>{let e=t.shiftKey?10:1,i=this.#s,s=this.#o?["ArrowUp"]:["ArrowLeft"],n=this.#o?["ArrowDown"]:["ArrowRight"];s.includes(t.key)?(t.preventDefault(),this.#m(i-e),this.#v()):n.includes(t.key)?(t.preventDefault(),this.#m(i+e),this.#v()):t.key==="Home"?(t.preventDefault(),this.#m(this.#a),this.#v()):t.key==="End"&&(t.preventDefault(),this.#m(this.#c),this.#v())};#u=()=>{this.#n?this.#w():this.#b(),this.#v()};#b(){this.#r=this.#s,this.#n=!0,this.#e.style.flexBasis="0%",this.#e.style.overflow="hidden",this.#t.setAttribute("aria-valuenow","0"),this.#s=0,this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0},bubbles:!0}))}#w(){this.#n=!1,this.#e.style.overflow="auto",this.#m(this.#r),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1},bubbles:!0}))}#m(t){let e=this.#n?0:Math.min(this.#c,Math.max(this.#a,t));this.#s=e,this.#e.style.flexBasis=`${e}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#i.style.flexGrow="1",this.#i.style.overflow="auto",this.#t.setAttribute("aria-valuenow",String(Math.round(e))),this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:e},bubbles:!0}))}async#g(){let t=this.getAttribute("persist");if(!t)return null;let e=await A.get("layout",`split:${t}`);return typeof e=="number"?e:null}#v(){let t=this.getAttribute("persist");t&&A.set("layout",`split:${t}`,Math.round(this.#s)).catch(()=>{})}#y(){let t=this.getAttribute("persist");t&&A.remove("layout",`split:${t}`).catch(()=>{})}};p("split-surface",Ut);var Wt="[data-copy], [data-copy-target], [data-paste-target]",li="Copied to clipboard",cs="Pasted from clipboard",Vt=new WeakMap;async function Y(r,t={}){if(r==null||r==="")return!1;let{button:e,announceMessage:i=li,duration:s=1500}=t;try{await navigator.clipboard.writeText(r)}catch{return!1}return Kt({button:e,duration:s,announceMessage:i,eventDetail:{text:r}}),!0}async function ci(r,t={}){let{text:e,html:i,blob:s}=r??{};if(!e&&!i&&!s)return!1;let{button:n,announceMessage:o=li,duration:a=1500}=t;if(typeof ClipboardItem<"u"&&typeof navigator.clipboard?.write=="function"){let c={};e&&(c["text/plain"]=new Blob([e],{type:"text/plain"})),i&&(c["text/html"]=new Blob([i],{type:"text/html"})),s&&(c[s.type]=s);try{return await navigator.clipboard.write([new ClipboardItem(c)]),Kt({button:n,duration:a,announceMessage:o,eventDetail:{payload:r}}),!0}catch{}}return e?Y(e,t):!1}function Kt({button:r,duration:t,announceMessage:e,eventDetail:i,state:s="copied",eventName:n="copy"}){if(r){r.dataset.state=s;let o=Vt.get(r);o&&clearTimeout(o),Vt.set(r,setTimeout(()=>{delete r.dataset.state,Vt.delete(r)},t)),r.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:i}))}ds(e,r??document.body)}async function hs(r,t={}){let{button:e,announceMessage:i=cs,duration:s=1500}=t,n;try{n=await navigator.clipboard.readText()}catch{return null}return r&&("value"in r&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)?r.value=n:r.textContent=n,r.dispatchEvent(new Event("input",{bubbles:!0}))),Kt({button:e,duration:s,announceMessage:i,eventDetail:{text:n},state:"pasted",eventName:"paste"}),n}function ai(r=document){r.querySelectorAll(Wt).forEach(Gt)}function Gt(r){r.hasAttribute("data-copy-init")||(r.setAttribute("data-copy-init",""),r.addEventListener("click",()=>{if(r.dataset.pasteTarget){let e=document.querySelector(r.dataset.pasteTarget);if(!e)return;hs(e,{button:r});return}let t=us(r);t&&Y(t,{button:r})}))}function us(r){if(r.dataset.copy)return r.dataset.copy;if(r.dataset.copyTarget){let t=document.querySelector(r.dataset.copyTarget);if(!t)return"";let e=r.dataset.copyAttr;return e?t.getAttribute(e)??"":t.textContent??""}return""}function ds(r,t){let e=document.createElement("div");e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.className="visually-hidden",e.textContent=r,t.appendChild(e),setTimeout(()=>e.remove(),1e3)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ai()):ai();var ps=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(Wt)&&Gt(i),i.querySelectorAll(Wt).forEach(s=>Gt(s))}});ps.observe(document.documentElement,{childList:!0,subtree:!0});var Xt=class extends m{#t;#e=null;setup(){this.#e===null&&(this.#e=this.getAttribute("value")||this.textContent.trim());let t=this.#e;if(!t)return!1;let e=parseInt(this.getAttribute("size")??"200",10)||200,i=parseInt(this.getAttribute("error-correction")??"1",10)||1;return this.#t=document.createElement("canvas"),this.#t.width=e,this.#t.height=e,this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`QR code: ${t}`),this.#i(t,e,i),!0}static get observedAttributes(){return["value","size"]}attributeChangedCallback(t,e,i){if(!this.#t||!this.isConnected)return;t==="value"&&i&&(this.#e=i);let s=this.#e||this.getAttribute("value")||"";if(!s)return;let n=parseInt(this.getAttribute("size")??"200",10)||200,o=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t.width=n,this.#t.height=n,this.#t.setAttribute("aria-label",`QR code: ${s}`),this.#i(s,n,o)}#i(t,e,i){let s=fs(t,i),n=this.#t.getContext("2d"),o=s.length,a=e/o,l=getComputedStyle(this),c=this.getAttribute("color")||l.color||"#000",h=this.getAttribute("background")||"transparent";n.clearRect(0,0,e,e),h!=="transparent"&&(n.fillStyle=h,n.fillRect(0,0,e,e)),n.fillStyle=c;for(let d=0;d<o;d++)for(let f=0;f<o;f++)s[d][f]&&n.fillRect(Math.round(f*a),Math.round(d*a),Math.ceil(a),Math.ceil(a));this.textContent="",this.appendChild(this.#t);let u=document.createElement("span");u.className="visually-hidden",u.textContent=t,this.appendChild(u)}toDataURL(t="image/png"){return this.#t?.toDataURL(t)??""}async copy({button:t}={}){if(!this.#t)return!1;let e=this.#e||this.getAttribute("value")||"",i=await new Promise(s=>this.#t.toBlob(s,"image/png"));return ci({text:e,blob:i||void 0},{button:t,announceMessage:"QR code copied"})}},ct=[[[26,7],[44,10],[70,15],[100,20],[134,26],[172,18],[196,20],[242,24],[292,30],[346,18]],[[26,10],[44,16],[70,26],[100,18],[134,24],[172,16],[196,18],[242,22],[292,22],[346,26]],[[26,13],[44,22],[70,18],[100,26],[134,18],[172,24],[196,18],[242,22],[292,20],[346,28]],[[26,17],[44,28],[70,22],[100,16],[134,22],[172,28],[196,26],[242,26],[292,24],[346,28]]],ms=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,52]];function fs(r,t=1){let e=new TextEncoder().encode(r),i=gs(e.length,t),s=ct[t][i-1][0],n=ct[t][i-1][1],o=s-n,a=bs(e,i,o),l=vs(a,o,n),c=i*4+17,h=Array.from({length:c},()=>new Uint8Array(c)),u=Array.from({length:c},()=>new Uint8Array(c));return ws(h,u,c),ks(h,u,i),xs(h,u,c),As(u,c),Es(h,u,l,c),Ns(h,u,c,t)}function gs(r,t){for(let e=1;e<=10;e++){let i=ct[t][e-1][0],s=ct[t][e-1][1],n=i-s,o=e<=9?8:16,a=Math.ceil((4+o)/8);if(r<=n-a)return e}return 10}function bs(r,t,e){let i=[],s=(u,d)=>{for(let f=d-1;f>=0;f--)i.push(u>>f&1)};s(4,4);let n=t<=9?8:16;s(r.length,n);for(let u of r)s(u,8);let o=e*8,a=Math.min(4,o-i.length);for(s(0,a);i.length%8!==0;)i.push(0);let l=[236,17],c=0;for(;i.length<o;)s(l[c%2],8),c++;let h=[];for(let u=0;u<i.length;u+=8){let d=0;for(let f=0;f<8;f++)d=d<<1|(i[u+f]||0);h.push(d)}return h}function vs(r,t,e){let i=ys(e),s=new Uint8Array(t+e);for(let o=0;o<t;o++)s[o]=r[o];for(let o=0;o<t;o++){let a=s[o];if(a===0)continue;let l=ht[a];for(let c=0;c<i.length;c++)s[o+c]^=Z[(l+ht[i[c]])%255]}let n=[...r.slice(0,t)];for(let o=0;o<e;o++)n.push(s[t+o]);return n}var Z=new Uint8Array(512),ht=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)Z[e]=t,ht[t]=e,t<<=1,t>=256&&(t^=285);for(let e=255;e<512;e++)Z[e]=Z[e-255]})();function ys(r){let t=new Uint8Array([1]);for(let e=0;e<r;e++){let i=new Uint8Array(t.length+1),s=e;for(let n=0;n<t.length;n++)i[n]^=t[n],i[n+1]^=Z[(ht[t[n]]+s)%255];t=i}return t}function ws(r,t,e){let i=[[0,0],[e-7,0],[0,e-7]];for(let[s,n]of i){for(let o=0;o<7;o++)for(let a=0;a<7;a++){let l=o===0||o===6||a===0||a===6||o>=2&&o<=4&&a>=2&&a<=4;r[s+o][n+a]=l?1:0,t[s+o][n+a]=1}for(let o=-1;o<=7;o++)for(let[a,l]of[[o,-1],[o,7],[-1,o],[7,o]]){let c=s+a,h=n+l;c>=0&&c<e&&h>=0&&h<e&&(r[c][h]=0,t[c][h]=1)}}}function ks(r,t,e){if(e<2)return;let i=ms[e-1];for(let s of i)for(let n of i)if(!t[s][n])for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++){let l=Math.abs(o)===2||Math.abs(a)===2||o===0&&a===0;r[s+o][n+a]=l?1:0,t[s+o][n+a]=1}}function xs(r,t,e){for(let i=8;i<e-8;i++){let s=i%2===0?1:0;t[6][i]||(r[6][i]=s,t[6][i]=1),t[i][6]||(r[i][6]=s,t[i][6]=1)}}function As(r,t){for(let e=0;e<=8;e++)e<t&&(r[8][e]=1),e<t&&(r[e][8]=1);for(let e=0;e<=7;e++)r[8][t-1-e]=1,r[t-1-e][8]=1;r[t-8][8]=1}function Es(r,t,e,i){let s=[];for(let a of e)for(let l=7;l>=0;l--)s.push(a>>l&1);let n=0,o=!0;for(let a=i-1;a>=1;a-=2){a===6&&(a=5);let l=o?Array.from({length:i},(c,h)=>i-1-h):Array.from({length:i},(c,h)=>h);for(let c of l)for(let h of[a,a-1])h<0||h>=i||t[c][h]||(r[c][h]=n<s.length?s[n]:0,n++);o=!o}}var Ss=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107];function Cs(r,t){let i=[1,0,3,2][r]*8+t;return Ss[i]}var Ts=[(r,t)=>(r+t)%2===0,r=>r%2===0,(r,t)=>t%3===0,(r,t)=>(r+t)%3===0,(r,t)=>(Math.floor(r/2)+Math.floor(t/3))%2===0,(r,t)=>r*t%2+r*t%3===0,(r,t)=>(r*t%2+r*t%3)%2===0,(r,t)=>((r+t)%2+r*t%3)%2===0];function _s(r,t,e,i){let s=r.map(o=>new Uint8Array(o)),n=Ts[i];for(let o=0;o<e;o++)for(let a=0;a<e;a++)!t[o][a]&&n(o,a)&&(s[o][a]^=1);return s}function Ls(r,t,e,i){let s=Cs(e,i),n=[[0,8],[1,8],[2,8],[3,8],[4,8],[5,8],[7,8],[8,8],[8,7],[8,5],[8,4],[8,3],[8,2],[8,1],[8,0]];for(let a=0;a<15;a++){let[l,c]=n[a];r[l][c]=s>>14-a&1}let o=[[8,t-1],[8,t-2],[8,t-3],[8,t-4],[8,t-5],[8,t-6],[8,t-7],[8,t-8],[t-7,8],[t-6,8],[t-5,8],[t-4,8],[t-3,8],[t-2,8],[t-1,8]];for(let a=0;a<15;a++){let[l,c]=o[a];r[l][c]=s>>14-a&1}r[t-8][8]=1}function Ms(r,t){let e=0;for(let i=0;i<t;i++){let s=1;for(let n=1;n<t;n++)r[i][n]===r[i][n-1]?(s++,s===5?e+=3:s>5&&(e+=1)):s=1}for(let i=0;i<t;i++){let s=1;for(let n=1;n<t;n++)r[n][i]===r[n-1][i]?(s++,s===5?e+=3:s>5&&(e+=1)):s=1}for(let i=0;i<t-1;i++)for(let s=0;s<t-1;s++){let n=r[i][s];n===r[i][s+1]&&n===r[i+1][s]&&n===r[i+1][s+1]&&(e+=3)}return e}function Ns(r,t,e,i){let s=1/0,n=null;for(let o=0;o<8;o++){let a=_s(r,t,e,o);Ls(a,e,i,o);let l=Ms(a,e);l<s&&(s=l,n=a)}return n}p("qr-code",Xt);var Jt=class extends m{#t;#e;#i;#s=!1;#n=0;#r=0;#o=0;#a=!1;#c=!1;get activated(){return this.#a}get#l(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}setup(){this.#c||(this.#h(),this.#c=!0),this.listen(this.#t,"pointerdown",this.#f),this.listen(this.#t,"keydown",this.#u),this.listen(this.#t,"transitionend",this.#b)}#h(){this.#i=document.createElement("div"),this.#i.className="slide-track",this.#e=document.createElement("span"),this.#e.className="slide-label",this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t=document.createElement("div"),this.#t.className="slide-handle",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-valuenow","0"),this.#t.setAttribute("aria-label",this.getAttribute("label")||"Slide to confirm"),this.#t.setAttribute("tabindex","0"),this.#t.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#i.append(this.#e,this.#t),this.textContent="",this.appendChild(this.#i),this.#g(0)}reset(){this.#a=!1,this.removeAttribute("data-activated"),this.#e.textContent=this.getAttribute("label")||"Slide to confirm",this.#t.removeAttribute("aria-disabled"),this.#t.setAttribute("tabindex","0"),this.#g(0),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}#f=t=>{if(!this.#a){if(t.preventDefault(),this.hasAttribute("transitioning")){let e=this.#t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=parseFloat(getComputedStyle(this.#i).getPropertyValue("--_handle-inset")||"0"),n=this.#t.offsetWidth,o=i.width-n-s*2,a=e.left-i.left-s;this.removeAttribute("transitioning"),this.#n=o>0?Math.max(0,Math.min(100,a/o*100)):0,this.#g(this.#n)}this.#s=!0,this.#r=t.clientX,this.#o=this.#n,this.#t.setPointerCapture(t.pointerId),this.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#d),this.#t.addEventListener("pointerup",this.#p),this.#t.addEventListener("pointercancel",this.#p)}};#d=t=>{if(!this.#s)return;let e=this.#i.getBoundingClientRect().width-this.#t.offsetWidth;if(e<=0)return;let s=(t.clientX-this.#r)/e*100,n=Math.min(100,Math.max(0,this.#o+s));this.#g(n)};#p=t=>{this.#s&&(this.#s=!1,this.removeAttribute("data-dragging"),this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#d),this.#t.removeEventListener("pointerup",this.#p),this.#t.removeEventListener("pointercancel",this.#p),this.#n>=this.#l?this.#w():this.#m())};#u=t=>{if(this.#a)return;let e=t.shiftKey?20:5;t.key==="ArrowRight"?(t.preventDefault(),this.#g(Math.min(100,this.#n+e))):t.key==="ArrowLeft"?(t.preventDefault(),this.#g(Math.max(0,this.#n-e))):t.key==="End"?(t.preventDefault(),this.#w()):t.key==="Home"&&(t.preventDefault(),this.#g(0)),t.key==="ArrowRight"&&this.#n>=this.#l&&this.#w()};#b=()=>{this.removeAttribute("transitioning")};#w(){this.#a=!0,this.#g(100),this.setAttribute("data-activated",""),this.#e.textContent=this.getAttribute("activated-label")||"Confirmed!",this.#t.setAttribute("aria-disabled","true"),this.#t.removeAttribute("tabindex"),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0}))}#m(){this.setAttribute("transitioning",""),this.#g(0),setTimeout(()=>{this.hasAttribute("transitioning")&&this.removeAttribute("transitioning")},500)}#g(t){this.#n=t,this.style.setProperty("--_slide-position",String(t)),this.#t.setAttribute("aria-valuenow",String(Math.round(t)))}};p("slide-accept",Jt);var Yt=class extends m{#t=null;static get observedAttributes(){return["position"]}get#e(){return this.getAttribute("persist")||"banner"}get#i(){let t=this.getAttribute("expires");return t==="0"||t==="never"?0:t?parseInt(t,10):365}get#s(){let t=this.#i;return t>0?t*864e5:void 0}setup(){return this.#t=this.querySelector("dialog"),this.#t?(this.getAttribute("trigger")&&this.listen(document,"click",this.#l),this.#n(),!0):!1}async#n(){if(await this.#h()){this.getAttribute("trigger")?this.hidden=!0:this.remove();return}this.#r()}#r(){(this.getAttribute("position")||"bottom")==="center"?(this.#t.showModal(),this.#t.addEventListener("cancel",this.#a)):this.#t.show(),this.addEventListener("click",this.#c)}#o(){this.#t.removeEventListener("cancel",this.#a),this.removeEventListener("click",this.#c),this.#t.close(),this.getAttribute("trigger")?this.hidden=!0:this.remove()}#a=t=>{t.preventDefault()};#c=async t=>{let e=t.target.closest("button[value]");if(!e)return;let i=e.value;if(!["accept","reject","save"].includes(i))return;let s=[...this.querySelectorAll('input[type="checkbox"]')],n={};i==="accept"?s.forEach(o=>{n[o.name]=!0}):i==="reject"?s.forEach(o=>{n[o.name]=!!o.disabled}):s.forEach(o=>{n[o.name]=o.checked}),await this.#f({preferences:n,action:i}),this.dispatchEvent(new CustomEvent("consent-banner:change",{bubbles:!0,detail:{preferences:n,action:i}})),this.#o()};#l=async t=>{let e=this.getAttribute("trigger");if(!e||!t.target.closest(e))return;t.preventDefault();let s=await this.#h();if(s?.preferences)for(let[n,o]of Object.entries(s.preferences)){let a=this.querySelector(`input[type="checkbox"][name="${CSS.escape(n)}"]`);a&&!a.disabled&&(a.checked=o)}this.hidden=!1,this.#r()};async#h(){let t=this.#s;return await A.get("consent",this.#e,t?{maxAge:t}:void 0)}async#f(t){await A.set("consent",this.#e,t)}static async reset(t="banner"){await A.remove("consent",t)}static async getConsent(t="banner"){return await A.get("consent",t)}};p("consent-banner",Yt);var Zt=class extends m{#t=null;#e=null;#i=[];#s="";#n=0;#r=null;#o=null;#a=null;#c=null;#l=!1;#h=!1;#f=0;#d=null;#p=null;#u=null;#b=null;#w=null;#m=null;#g=null;#v=!1;#y=null;#k=null;static get observedAttributes(){return["speed","voice","for"]}attributeChangedCallback(t,e,i){if(e!==i&&(t==="for"&&(this.stop(),this.#P()),(t==="speed"||t==="voice")&&this.#l&&this.#O(),t==="speed")){let s=this.#F(parseFloat(i)||1);this.#w&&(this.#w.value=String(s)),this.#m&&(this.#m.textContent=`${s}\xD7`)}}setup(){return"speechSynthesis"in window?(this.getAttribute("variant")==="icon"?this.#j():this.#C(),this.#P(),this.#J(),this.#c=this.#G(),this.#c.then(t=>this.#tt(t)),this.listen(window,"beforeunload",this.#et),!0):(this.style.display="none",!1)}teardown(){this.stop(),this.#Y(),this.#k&&(this.#k.remove(),this.#k=null),this.#y&&(this.#y.remove(),this.#y=null)}play(){if(this.#h){this.resume();return}this.#l||this.#D(0)}pause(){!this.#l||this.#h||(speechSynthesis.pause(),this.#h=!0,this.#X(!0),this.#I("text-reader:pause"))}resume(){this.#h&&(speechSynthesis.resume(),this.#h=!1,this.#X(!1),this.#I("text-reader:resume"))}stop(){speechSynthesis.cancel(),this.#U(),this.#I("text-reader:stop")}get voices(){return this.#c||this.#G()}get speaking(){return this.#l}get paused(){return this.#h}get progress(){return this.#s.length?Math.min(this.#n/this.#s.length,1):0}#C(){let t=document.createElement("div");t.setAttribute("part","controls"),t.setAttribute("role","group"),t.setAttribute("aria-label","Article reader");let e=this.#x("play",this.getAttribute("label-play")||"Play","\u25B6");e.addEventListener("click",()=>this.play());let i=this.#x("pause",this.getAttribute("label-pause")||"Pause","\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#x("stop",this.getAttribute("label-stop")||"Stop","\u23F9");s.disabled=!0,s.addEventListener("click",()=>this.stop());let n=document.createElement("select");n.setAttribute("aria-label","Voice");let o=document.createElement("option");o.textContent="Loading voices\u2026",n.append(o),n.addEventListener("change",()=>{this.#l&&this.#O()});let a=document.createElement("label");a.setAttribute("data-speed-group","");let l=document.createElement("span");l.setAttribute("data-speed-value","");let c=this.#F(parseFloat(this.getAttribute("speed")??"1")||1);l.textContent=`${c}\xD7`;let h=document.createElement("input");h.type="range",h.min="0.5",h.max="2",h.step="0.1",h.value=String(c),h.setAttribute("aria-label","Speed"),h.addEventListener("input",()=>{let u=parseFloat(h.value);l.textContent=`${u}\xD7`,this.#l&&this.#O()}),a.append(l,h),this.#A("icon-play",e),this.#A("icon-pause",i),this.#A("icon-stop",s),t.append(e,i,s,n,a),this.prepend(t),this.#g=t,this.#d=e,this.#p=i,this.#u=s,this.#b=n,this.#w=h,this.#m=l}#x(t,e,i){let s=document.createElement("button");return s.type="button",s.setAttribute("part",`button ${t}`),s.setAttribute("aria-label",e),s.textContent=i,s}#A(t,e){let i=this.querySelector(`[slot="${t}"]`);i&&(i.removeAttribute("slot"),e.textContent="",e.append(i))}#j(){this.#v=!0;for(let i of this.querySelectorAll(':scope > [part="trigger"]'))i.remove();let t=document.createElement("button");t.type="button",t.setAttribute("part","trigger"),t.setAttribute("aria-label","Article reader"),t.setAttribute("aria-pressed","false");let e=this.querySelector('[slot="icon-trigger"]');if(e)e.removeAttribute("slot"),t.append(e);else{let i=document.createElement("icon-wc");i.setAttribute("name","volume-2"),i.setAttribute("aria-hidden","true"),t.append(i)}t.addEventListener("click",()=>this.#T()),this.append(t),this.#y=t,this.#S()}#S(){let t=document.createElement("div");t.setAttribute("data-text-reader-toolbar",""),t.setAttribute("role","group"),t.setAttribute("aria-label","Reader controls"),t.hidden=!0;let e=this.#x("play",this.getAttribute("label-play")||"Play","\u25B6");e.addEventListener("click",()=>this.play());let i=this.#x("pause",this.getAttribute("label-pause")||"Pause","\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#x("stop",this.getAttribute("label-stop")||"Stop","\u23F9");s.addEventListener("click",()=>this.stop());let n=this.#x("speed-down","Slower","\u2212");n.addEventListener("click",()=>this.#N(-.1));let o=document.createElement("span");o.setAttribute("data-speed-value","");let a=this.#F(parseFloat(this.getAttribute("speed")??"1")||1);o.textContent=`${a}\xD7`;let l=this.#x("speed-up","Faster","+");l.addEventListener("click",()=>this.#N(.1)),this.#A("icon-play",e),this.#A("icon-pause",i),this.#A("icon-stop",s),t.append(e,i,s,n,o,l),document.body.append(t),this.#d=e,this.#p=i,this.#u=s,this.#m=o,this.#k=t,this.listen(document,"pointerdown",this.#$),this.listen(document,"keydown",this.#L)}#T(){if(!this.#l){this.play();return}this.#k?.hidden&&this.#E(),this.#h?this.resume():this.pause()}#E(){if(!this.#k||!this.#y)return;let t=this.#k;t.hidden=!1,t.style.visibility="hidden",requestAnimationFrame(()=>{this.#M(),t.style.visibility=""})}#_(){this.#k&&(this.#k.hidden=!0)}#M(){let t=this.#k,e=this.#y;if(!t||!e)return;let i=e.getBoundingClientRect(),s=t.offsetWidth,n=t.offsetHeight,o=8,a=8,l=i.top-n-o;l<a&&(l=i.bottom+o);let c=i.left+i.width/2-s/2,h=window.innerWidth-s-a;c=Math.max(a,Math.min(c,h)),t.style.top=`${l}px`,t.style.left=`${c}px`}#N(t){let e=parseFloat(this.getAttribute("speed")??"1")||1,i=this.#F(e+t);this.setAttribute("speed",String(i))}#$=t=>{!this.#k||this.#k.hidden||this.#k.contains(t.target)||this.#y?.contains(t.target)||this.#_()};#L=t=>{t.key==="Escape"&&this.#k&&!this.#k.hidden&&this.#_()};#P(){let t=this.getAttribute("for");if(!t){console.warn('<text-reader>: missing "for" attribute'),this.#B();return}if(this.#t=document.getElementById(t),!this.#t){console.warn(`<text-reader>: no element found with id="${t}"`),this.#B();return}this.#H(),this.#z()}#B(){this.#d&&(this.#d.disabled=!0),this.#u&&(this.#u.disabled=!0)}#z(){this.#d&&(this.#d.disabled=!1)}#H(){let t=this.#t;if(!t)return;let e=this.getAttribute("selectors")||"p,li",i=[...t.querySelectorAll(e)],s=o=>o.closest("pre")||o.closest("code")||o.closest('[aria-hidden="true"]');this.#i=[];let n=0;for(let o of i){if(s(o))continue;let a=o.textContent.trim();a&&(this.#i.push({element:o,text:a,speechStart:n,speechEnd:n+a.length}),n+=a.length+1)}this.#s=this.#i.map(o=>o.text).join(" ")}#D(t){if(!this.#s)return;let e=t>0?this.#s.slice(t):this.#s;if(!e.trim())return;let i=e.replace(/[<>]/g," "),s=new SpeechSynthesisUtterance(i);s.rate=this.#F(parseFloat(this.#w?.value??this.getAttribute("speed")??"1")||1);let n=this.#b?.selectedOptions[0];if(n?.dataset.voiceUri){let o=speechSynthesis.getVoices().find(a=>a.voiceURI===n.dataset.voiceUri);o&&(s.voice=o)}s.onboundary=o=>{if(o.name!=="word")return;let a=t+o.charIndex;this.#n=a;let l=o.charLength;if(!l){let h=this.#s.slice(a).match(/^\S+/);l=h?h[0].length:1}this.#Z(a,l),this.#I("text-reader:word",{word:this.#s.slice(a,a+l),charIndex:a,element:this.#W(a)?.element})},s.onend=()=>{let o=Date.now()-this.#f;this.#U(),this.#I("text-reader:end",{duration:o})},s.onerror=o=>{o.error==="interrupted"||o.error==="canceled"||(console.warn("<text-reader>: SpeechSynthesisUtterance error:",o.error),this.#U(),this.#I("text-reader:error",{error:o.error}))},this.#e=s,this.#l=!0,this.#h=!1,this.#f=Date.now(),this.#n=t,this.#K(!0),speechSynthesis.cancel(),speechSynthesis.speak(s),this.#q(),this.#I("text-reader:play",{voice:s.voice?.name,speed:s.rate})}#O(){let t=this.#n;speechSynthesis.cancel(),this.#R(),requestAnimationFrame(()=>this.#D(t))}#q(){this.#R(),this.#r=setInterval(()=>{if(!speechSynthesis.speaking){this.#R();return}speechSynthesis.pause(),speechSynthesis.resume()},1e4)}#R(){this.#r&&clearInterval(this.#r),this.#r=null}#J(){if(!CSS.highlights)return;let t=new CSSStyleSheet;t.replaceSync(`
|
|
1066
1066
|
::highlight(text-reader-word) {
|
|
1067
1067
|
background-color: var(--text-reader-highlight, Mark);
|
|
1068
1068
|
color: var(--text-reader-highlight-text, MarkText);
|
|
1069
1069
|
}
|
|
1070
|
-
`),this.#o=t,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}#Y(){let t=this.#o;t&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==t),this.#o=null),this.#V()}#Z(t,e){if(!CSS.highlights||this.getAttribute("highlight")==="false")return;let i=this.#W(t);if(!i)return;let s=t-i.speechStart,n=this.#Q(i.element,s,e);if(!n)return;let o=new Highlight(n);if(CSS.highlights.set("text-reader-word",o),this.#a=o,this.getAttribute("scroll")!=="false"){let a=n.getBoundingClientRect(),l=window.innerHeight;(a.top<0||a.bottom>l)&&i.element.scrollIntoView({behavior:"smooth",block:"nearest"})}}#V(){CSS.highlights&&CSS.highlights.delete("text-reader-word"),this.#a=null}#W(t){let e=this.#i,i=0,s=e.length-1;for(;i<=s;){let n=i+s>>>1,o=e[n];if(t<o.speechStart)s=n-1;else if(t>=o.speechEnd)i=n+1;else return o}return null}#Q(t,e,i){let s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),n=0;for(;s.nextNode();){let o=s.currentNode,a=o.textContent??"";if(!a.trim())continue;let l=a.length;if(n+l>e){let c=e-n,h=document.createRange();h.setStart(o,Math.min(c,l));let u=c+i;return u<=l?h.setEnd(o,u):h.setEnd(o,l),h}n+=l}return null}async#G(){let t=speechSynthesis.getVoices();return t.length>0?t:new Promise(e=>{let i=()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())};speechSynthesis.addEventListener("voiceschanged",i),setTimeout(()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())},3e3)})}#tt(t){if(!this.#b||!t.length)return;let e=this.#b;e.innerHTML="";let i=document.documentElement.lang||"en",s=t.filter(l=>l.lang.startsWith(i)),n=t.filter(l=>!l.lang.startsWith(i)),o=[...s,...n],a=this.getAttribute("voice");for(let l of o){let c=document.createElement("option");c.textContent=`${l.name} (${l.lang})`,c.dataset.voiceUri=l.voiceURI,a&&l.voiceURI===a&&(c.selected=!0),e.append(c)}if(!a){let l=s.find(c=>c.default)||s[0];if(l){let c=[...e.options].find(h=>h.dataset.voiceUri===l.voiceURI);c&&(c.selected=!0)}}}#K(t){!this.#d||!this.#p||!this.#u||(t?(this.#d.hidden=!0,this.#p.hidden=!1,this.#u.disabled=!1):(this.#d.hidden=!1,this.#p.hidden=!0,this.#u.disabled=!0),this.#v&&(this.#y&&this.#y.setAttribute("aria-pressed",String(t)),t?this.#E():this.#_()))}#X(t){!this.#d||!this.#p||(this.#d.hidden=!t,this.#p.hidden=t)}#U(){this.#l=!1,this.#h=!1,this.#n=0,this.#e=null,this.#R(),this.#V(),this.#K(!1)}#F(t){return Math.round(Math.max(.5,Math.min(2,t))*10)/10}#I(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}#et=()=>{speechSynthesis.cancel()}};p("text-reader",Zt);function Qt(r){if(!r||typeof r!="string")return"";let t=document.createElement("template");return t.innerHTML=r,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(s=>s.remove()),t.content.querySelectorAll("*").forEach(s=>{for(let n of[...s.attributes]){if(n.name.startsWith("on")){s.removeAttribute(n.name);continue}if(["href","src","action","formaction","xlink:href"].includes(n.name)){let o=n.value.trim().toLowerCase();(o.startsWith("javascript:")||o.startsWith("data:text/html"))&&s.removeAttribute(n.name);continue}(n.name==="srcdoc"||n.name==="data"&&s.tagName==="OBJECT")&&s.removeAttribute(n.name)}}),t.innerHTML}function hi({newItems:r,nodes:t,keyOf:e,renderItem:i,containerFor:s}){let n=[],o=[],a=[],l=new Set;for(let h of r)l.add(e(h));for(let[h,u]of[...t])l.has(h)||(u.remove(),t.delete(h),a.push(h));let c=new Map;for(let h of r){let u=e(h),d=t.get(u)||null,f=s(h,d);c.has(f)||c.set(f,[]),c.get(f)?.push({item:h,key:u,existing:d})}for(let[h,u]of c)for(let d=0;d<u.length;d++){let{item:f,key:g,existing:w}=u[d],x=w;x?(x.parentElement!==h||h.children[d]!==x)&&o.push(g):(x=i(f),t.set(g,x),n.push(g));let _=h.children[d];_!==x&&h.insertBefore(x,_||null)}return{added:n,moved:o,removed:a}}var te=class extends m{#t=null;#e=null;#i=null;#s=new Map;#n=null;#r=new Map;setup(){this.#o(),this.#a(),this.#h(),this.#c(),this.#g(),this.#f()}teardown(){}#o(){this.#t=this.querySelector(":scope > chat-thread"),this.#e=this.querySelector(":scope > chat-input"),this.#i=this.querySelector(":scope > header select[data-model-select]")}#a(){let t=this.querySelector(":scope > script[data-participants]");if(t)try{let e=JSON.parse(t.textContent);this.#s=new Map(Object.entries(e))}catch{console.warn("[chat-window] Invalid participant JSON")}}#c(){if(this.#t)for(let t of this.#t.querySelectorAll("chat-message[data-from]"))this.#l(t)}#l(t){let e=t.getAttribute("data-from");if(!e)return;let i=this.#s.get(e);i?.name?t.setAttribute("data-from-label",i.name):t.hasAttribute("data-from-label")||t.setAttribute("data-from-label",e)}#h(){if(!this.#i)return;let t=this.getAttribute("model");t?this.#i.value=t:this.#i.value&&this.setAttribute("model",this.#i.value)}#f(){this.listen(this,"chat-input:send",this.#d),this.#i&&this.listen(this.#i,"change",this.#p)}#d=async t=>{t.stopPropagation();let{message:e}=t.detail;if(!e||!this.#t)return;let i=this.#u("user",e,"user");this.#t.appendChild(i),this.#v(),this.#g();let s=this.#m(),n=this.#b(s);this.#t.appendChild(n),this.#v(),this.#e&&(this.#e.disabled=!0);let o=this.getAttribute("endpoint");if(o)try{let a=await this.#y(o,e);this.#w(n,a)}catch(a){this.#w(n,"<p>Sorry, something went wrong.</p>"),n.setAttribute("data-status","error"),this.dispatchEvent(new CustomEvent("chat-window:error",{bubbles:!0,detail:{error:a.message,status:a.status??0}}))}else this.dispatchEvent(new CustomEvent("chat-window:send",{bubbles:!0,detail:{message:e,typingElement:n}}));this.#e&&(this.#e.disabled=!1,this.#e.focus()),this.#v()};#p=()=>{let t=this.#i.value;this.setAttribute("model",t),this.dispatchEvent(new CustomEvent("chat-window:model-change",{bubbles:!0,detail:{model:t}}))};#u(t,e,i){let s=document.createElement("chat-message");s.setAttribute("data-role",t),i&&(s.setAttribute("data-from",i),this.#l(s));let n=document.createElement("chat-bubble");if(e.includes("<"))n.innerHTML=Qt(e);else{let o=document.createElement("p");o.textContent=e,n.appendChild(o)}return s.appendChild(n),s}#b(t){let e=document.createElement("chat-message");if(e.setAttribute("data-role","agent"),e.setAttribute("data-status","typing"),t){e.setAttribute("data-from",t),this.#l(e);let o=this.#s.get(t)?.name??t;e.setAttribute("aria-label",`${o} is typing`)}else e.setAttribute("aria-label","Agent is typing");let i=this.getAttribute("model");i&&e.setAttribute("data-model",i);let s=document.createElement("chat-bubble");return e.appendChild(s),e}#w(t,e){let i=t.querySelector("chat-bubble");i&&(i.innerHTML=Qt(e)),t.removeAttribute("data-status"),t.removeAttribute("aria-label")}#m(){for(let[t,e]of this.#s)if(e.role==="agent")return t;return null}#g(){if(!this.#t)return;this.#t.querySelector("chat-message")!==null?(this.#n&&(this.#n.remove(),this.#n=null),this.#t.hidden=!1):(this.#t.hidden=!0,this.#n||(this.#n=document.createElement("p"),this.#n.setAttribute("data-chat-empty",""),this.#n.textContent=this.getAttribute("empty-message")||"Send a message to start.",this.#t.insertAdjacentElement("afterend",this.#n)))}#v(){this.#t&&requestAnimationFrame(()=>{this.#t.scrollTop=this.#t.scrollHeight})}scrollToBottom(){this.#v()}async#y(t,e){let i={message:e,model:this.getAttribute("model")||void 0},s=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!s.ok){let o=new Error(`Chat request failed: ${s.status}`);throw o.status=s.status,o}let n=await s.json();return n.html??n.message??n.content??""}get model(){return this.getAttribute("model")??""}set model(t){this.setAttribute("model",t),this.#i&&(this.#i.value=t)}get participants(){return this.#s}set participants(t){this.#s=t instanceof Map?t:new Map(Object.entries(t)),this.#c()}clearThread(){if(this.#t){for(;this.#t.firstChild;)this.#t.removeChild(this.#t.firstChild);this.#g()}}appendMessage(t,e,i){if(!this.#t)return;let s=this.#u(t,e,i);this.#t.appendChild(s),this.#v(),this.#g()}get messages(){return this.#t?[...this.#t.querySelectorAll(':scope > chat-message:not([data-status="typing"])')].map(t=>({id:t.id||t.getAttribute("data-id")||void 0,role:t.getAttribute("data-role")||"user",content:t.querySelector("chat-bubble")?.innerHTML||"",from:t.getAttribute("data-from")||void 0})):[]}set messages(t){if(!this.#t)return;let e=Array.isArray(t)?t:[];hi({newItems:e,nodes:this.#r,keyOf:i=>i.id??i.role+":"+i.content,renderItem:i=>{let s=this.#u(i.role||"user",i.content||"",i.from);return i.id&&(s.id=i.id),s},containerFor:()=>this.#t}),this.#g(),this.#v(),this.dispatchEvent(new CustomEvent("chat-window:messages-changed",{detail:{messages:e,source:"property"},bubbles:!0}))}};p("chat-window",te);var ee=class extends m{static formAssociated=!0;#t;#e;#i;#s;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}setup(){return this.#e=this.querySelector(":scope > textarea, :scope textarea[data-grow]"),this.#i=this.querySelector("[data-send]"),this.#e?(this.listen(this.#e,"keydown",this.#n),this.listen(this.#e,"input",this.#r),this.#i&&this.listen(this.#i,"click",this.#o),this.#c(),this.#l(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>this.#e.focus()),!0):!1}teardown(){clearTimeout(this.#s)}#n=t=>{switch(t.key){case"Enter":t.shiftKey||(t.preventDefault(),this.#a());break;case"Escape":t.preventDefault(),this.reset();break}};#r=()=>{this.#c(),this.#l(),clearTimeout(this.#s),this.#s=setTimeout(()=>{this.dispatchEvent(new CustomEvent("chat-input:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))},100)};#o=t=>{t.preventDefault(),this.#a()};#a(){let t=this.value.trim(),e=parseInt(this.getAttribute("minlength")??"1",10)||1;t.length<e||this.disabled||(this.dispatchEvent(new CustomEvent("chat-input:send",{bubbles:!0,detail:{message:t,from:null,model:null}})),this.reset())}#c(){let t=this.value;t?this.#t.setFormValue(t):this.#t.setFormValue(null)}#l(){let t=this.value,e=parseInt(this.getAttribute("maxlength")??"4000",10)||4e3;t.length>e?this.#t.setValidity({tooLong:!0},`Message exceeds ${e} characters`,this.#e):this.#t.setValidity({})}formResetCallback(){this.reset()}formStateRestoreCallback(t){!t||!this.#e||(this.#e.value=t,this.#c(),this.#l())}get value(){return this.#e?.value??""}set value(t){if(!this.#e)return;let e=t==null?"":String(t);this.#e.value!==e&&(this.#e.value=e,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#c(),this.#l(),this.dispatchEvent(new CustomEvent("chat-input:change",{bubbles:!0,detail:{value:e,source:"api"}})))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?(this.setAttribute("disabled",""),this.#e&&(this.#e.disabled=!0),this.#i&&(this.#i.disabled=!0)):(this.removeAttribute("disabled"),this.#e&&(this.#e.disabled=!1),this.#i&&(this.#i.disabled=!1))}focus(){this.#e?.focus()}reset(){this.#e&&(this.#e.value="",this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#c(),this.#l())}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,i){if(t==="disabled"){let s=i!==null;this.#e&&(this.#e.disabled=s),this.#i&&(this.#i.disabled=s)}}};p("chat-input",ee);var ut="http://www.w3.org/2000/svg";function Ms(r){return r.trim().split(/[\s,]+/).map(Number)}function Ns(r,t){let e=Ms(t);switch(r){case"rect":{let[i,s,n,o]=e;return{type:"rect",x:i,y:s,width:n-i,height:o-s}}case"circle":{let[i,s,n]=e;return{type:"circle",cx:i,cy:s,r:n}}case"poly":{let i=[];for(let s=0;s<e.length;s+=2)i.push([e[s],e[s+1]]);return{type:"poly",points:i}}default:return null}}function Rs(r){if(!r)return null;switch(r.type){case"rect":{let t=document.createElementNS(ut,"rect");return t.setAttribute("x",String(r.x)),t.setAttribute("y",String(r.y)),t.setAttribute("width",String(r.width)),t.setAttribute("height",String(r.height)),t}case"circle":{let t=document.createElementNS(ut,"circle");return t.setAttribute("cx",String(r.cx)),t.setAttribute("cy",String(r.cy)),t.setAttribute("r",String(r.r)),t}case"poly":{let t=document.createElementNS(ut,"polygon");return t.setAttribute("points",r.points.map(e=>e.join(",")).join(" ")),t}default:return null}}function js(r){if(!r)return{x:0,y:0,width:0,height:0};switch(r.type){case"rect":return{x:r.x,y:r.y,width:r.width,height:r.height};case"circle":return{x:r.cx-r.r,y:r.cy-r.r,width:r.r*2,height:r.r*2};case"poly":{let t=100,e=100,i=0,s=0;for(let[n,o]of r.points)n<t&&(t=n),o<e&&(e=o),n>i&&(i=n),o>s&&(s=o);return{x:t,y:e,width:i-t,height:s-e}}default:return{x:0,y:0,width:0,height:0}}}var ie=class extends HTMLElement{get shape(){return this.getAttribute("shape")||"rect"}get coords(){return this.getAttribute("coords")||""}get label(){return this.getAttribute("label")||""}get href(){return this.getAttribute("href")}get target(){return this.getAttribute("target")||""}get tooltipMode(){return this.getAttribute("tooltip")||"hover"}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}},se=class extends m{#t=null;#e=null;#i=null;#s=[];#n=[];#r=null;#o=null;#a=null;setup(){if(this.#t=this.querySelector(":scope > img"),!this.#t){let t=this.getAttribute("src"),e=this.getAttribute("alt");if(t)this.#t=document.createElement("img"),this.#t.src=t,this.#t.alt=e||"",this.prepend(this.#t);else return!1}return this.#t.classList.add("image-map-img"),this.#t.complete?this.#c():this.#t.addEventListener("load",()=>this.#c(),{once:!0}),!0}teardown(){this.#o?.disconnect(),this.#h(),this.#e?.remove(),this.#i?.remove();for(let t of this.#n)t.anchor?.remove();this.#n=[],this.#s=[]}get regions(){return[...this.querySelectorAll(":scope > map-area")].map(t=>({shape:t.getAttribute("shape")||void 0,coords:t.getAttribute("coords")||void 0,label:t.getAttribute("label")||t.textContent?.trim()||void 0,href:t.getAttribute("href")||void 0,target:t.getAttribute("target")||void 0}))}set regions(t){let e=Array.isArray(t)?t:[];for(let i of[...this.querySelectorAll(":scope > map-area")])i.remove();for(let i of e){let s=document.createElement("map-area");i.shape&&s.setAttribute("shape",i.shape),i.coords&&s.setAttribute("coords",i.coords),i.label&&s.setAttribute("label",i.label),i.href&&s.setAttribute("href",i.href),i.target&&s.setAttribute("target",i.target),this.appendChild(s)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("image-map:regions-changed",{detail:{regions:e,source:"property"},bubbles:!0}))}#c(){let t=[...this.querySelectorAll(":scope > map-area")];if(t.length===0){this.setAttribute("data-upgraded","");return}this.#e=document.createElementNS(ut,"svg"),this.#e.setAttribute("viewBox","0 0 100 100"),this.#e.setAttribute("preserveAspectRatio","none"),this.#e.setAttribute("aria-hidden","true"),this.#e.classList.add("image-map-overlay"),this.#i=document.createElement("div"),this.#i.className="image-map-tooltip",this.#i.setAttribute("role","tooltip"),this.#i.setAttribute("aria-live","polite"),this.#i.id=`imap-tip-${crypto.randomUUID().slice(0,8)}`;for(let e of t){let i=e,s=i.shape,n=i.coords,o=Ns(s,n),a=Rs(o);if(!a)continue;let l=js(o),c=i.href?document.createElement("a"):document.createElement("button");i.href&&(c.href=i.href,i.target&&(c.target=i.target)),c.className="image-map-anchor",c.setAttribute("aria-label",i.label),c.setAttribute("aria-describedby",this.#i.id),c.textContent=i.label,c.style.left=`${l.x}%`,c.style.top=`${l.y}%`,c.style.width=`${l.width}%`,c.style.height=`${l.height}%`,i.disabled&&(a.setAttribute("data-disabled",""),c.setAttribute("tabindex","-1"),c.setAttribute("aria-disabled","true"));let h=e.innerHTML,u={area:e,parsed:o,svgShape:a,anchor:c,contentHTML:h};if(!i.disabled){let d=i.tooltipMode;this.listen(a,"pointerenter",()=>{d==="hover"&&this.#l(u),a.setAttribute("data-hover",""),this.#p("image-map:area-enter",i)}),this.listen(a,"pointerleave",()=>{d==="hover"&&this.#h(),a.removeAttribute("data-hover"),this.#p("image-map:area-leave",i)}),this.listen(a,"click",()=>{d==="click"&&(this.#r===u?this.#h():this.#l(u)),this.#p("image-map:area-activate",i),i.href&&d!=="click"&&(i.target==="_blank"?window.open(i.href,"_blank","noopener"):window.location.href=i.href)}),this.listen(a,"touchstart",f=>{d==="hover"&&(this.#a!==u?(f.preventDefault(),this.#a=u,this.#l(u)):this.#a=null)},{passive:!1}),this.listen(c,"focus",()=>{this.#l(u),a.setAttribute("data-hover","")}),this.listen(c,"blur",()=>{this.#h(),a.removeAttribute("data-hover")})}this.#e.appendChild(a),this.#n.push(u),this.#s.push(c)}this.appendChild(this.#e);for(let e of this.#s)this.appendChild(e);this.appendChild(this.#i),this.listen(this,"keydown",this.#d),this.#o=new ResizeObserver(()=>{this.#r&&this.#f(this.#r.svgShape)}),this.#o.observe(this.#t),this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.#t.alt||"Image map"),this.setAttribute("data-upgraded","")}#l(t){this.#i&&(this.#r=t,this.#i.innerHTML=t.contentHTML,this.#i.setAttribute("data-visible",""),this.#f(t.svgShape))}#h(){this.#i&&(this.#r=null,this.#i.removeAttribute("data-visible"))}#f(t){if(!this.#i||!t)return;let e=t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=8,n=8,o=window.innerWidth,a=window.innerHeight,l,c,h=e.top-i.height-s;h>=n?(l=h,c=e.left+(e.width-i.width)/2):e.bottom+s+i.height<=a-n?(l=e.bottom+s,c=e.left+(e.width-i.width)/2):e.right+s+i.width<=o-n?(l=e.top+(e.height-i.height)/2,c=e.right+s):(l=e.top+(e.height-i.height)/2,c=e.left-i.width-s),c=Math.max(n,Math.min(c,o-i.width-n)),l=Math.max(n,Math.min(l,a-i.height-n)),this.#i.style.top=`${l}px`,this.#i.style.left=`${c}px`}#d=t=>{let e=this.#s.filter(s=>!s.hasAttribute("aria-disabled")),i=e.indexOf(document.activeElement);switch(t.key){case"ArrowDown":case"ArrowRight":{t.preventDefault();let s=i<e.length-1?i+1:0;e[s]?.focus();break}case"ArrowUp":case"ArrowLeft":{t.preventDefault();let s=i>0?i-1:e.length-1;e[s]?.focus();break}case"Escape":this.#h(),this.#a=null;break}};#p(t,e){this.dispatchEvent(new CustomEvent(t,{detail:{area:e},bubbles:!0}))}};p("map-area",ie);p("image-map",se);var $s='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',Ps={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},re=class extends m{#t;#e;setup(){return this.#t=this.getAttribute("video-id"),this.#e=this.getAttribute("title")??"Play video",this.#t?(this.hasAttribute("autoplay")?this.#a():this.#n(),!0):(console.warn("youtube-player: missing required video-id attribute"),!1)}#i(){let t=new URLSearchParams({autoplay:"1"}),e=this.getAttribute("start");e&&t.set("start",e);let i=this.getAttribute("list");return i&&t.set("list",i),this.getAttribute("params")&&new URLSearchParams(this.getAttribute("params")||"").forEach((s,n)=>t.set(n,s)),`https://www.youtube-nocookie.com/embed/${this.#t}?${t}`}#s(){let t=this.getAttribute("thumbnail")??"hq";return`https://i.ytimg.com/vi/${this.#t}/${Ps[t]??"hqdefault"}.jpg`}#n(){this.setAttribute("state","ready"),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",`Play ${this.#e}`),this.innerHTML=`<img src="${this.#s()}" alt="" loading="lazy" decoding="async"><button type="button" aria-label="Play ${this.#e}">${$s}</button>`,this.addEventListener("click",this.#r,{once:!0}),this.addEventListener("keydown",this.#o)}#r=()=>{this.removeEventListener("keydown",this.#o),this.#a()};#o=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.removeEventListener("click",this.#r),this.#a())};#a(){this.setAttribute("state","active"),this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label"),this.innerHTML=`<iframe src="${this.#i()}" title="${this.#e}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"></iframe>`,this.querySelector("iframe")?.focus()}};p("youtube-player",re);var dt=CSS.supports("anchor-name","--x"),ui=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=class extends HTMLElement{get target(){return this.dataset.target??""}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}},oe=class r extends m{#t=[];#e=0;#i=!1;#s=null;#n=null;#r=null;#o=null;#a=null;#c=null;#l=null;#h=null;static#f=null;static observedAttributes=["data-step"];setup(){if(this.#t=[...this.querySelectorAll("tour-step")],this.#t.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target?.closest?.(`[data-tour="${this.id}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#P();e?.complete||e?.skipped?this.setAttribute("data-complete",""):setTimeout(()=>this.start(e?.step??0),400)}return!0}teardown(){this.#i&&this.stop()}attributeChangedCallback(t,e,i){if(t==="data-step"&&this.#i&&e!==null){let s=parseInt(i,10);!Number.isNaN(s)&&s!==this.#e&&this.#v(s)}}start(t=0){r.#f&&r.#f!==this&&r.#f.stop(),this.#a=document.activeElement,this.#i=!0,r.#f=this,this.#d(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#M("tour:start",{step:t}),this.#v(t)}stop(){this.#E(),this.#i=!1,this.removeAttribute("data-active"),r.#f===this&&(r.#f=null)}next(){!this.#i||this.#r?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting")||(this.#e<this.#t.length-1?this.#v(this.#e+1,"next"):this.#T())}prev(){this.#i&&this.#e>0&&this.#v(this.#e-1,"prev")}goto(t){this.#i&&t>=0&&t<this.#t.length&&this.#v(t)}skip(){!this.#i||(this.dataset.mode??"passive")==="forced"||(this.#M("tour:skip",{step:this.#e}),this.#L({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#B(),this.removeAttribute("data-complete"),this.dataset.step="0"}#d(){this.#s=document.createElement("div"),this.#s.className="page-tour-backdrop",this.#s.setAttribute("aria-hidden","true"),this.#s.addEventListener("click",()=>{(this.dataset.mode??"passive")!=="forced"&&this.skip()}),this.#n=document.createElement("div"),this.#n.className="page-tour-spotlight",this.#n.setAttribute("aria-hidden","true"),this.#r=document.createElement("div"),this.#r.className="page-tour-card",this.#r.setAttribute("popover","manual"),this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-modal","true"),this.#r.setAttribute("aria-label",this.dataset.title??"Page Tour"),this.#r.addEventListener("keydown",t=>this.#k(t)),this.#r.addEventListener("click",t=>this.#x(t)),this.#o=document.createElement("div"),this.#o.setAttribute("aria-live","polite"),this.#o.setAttribute("aria-atomic","true"),this.#o.className="visually-hidden",this.#o.id=`page-tour-announcer-${crypto.randomUUID().slice(0,8)}`,this.append(this.#s,this.#n,this.#r,this.#o),this.#r.showPopover(),requestAnimationFrame(()=>{this.#s?.setAttribute("data-visible","")})}#p(t){if(!this.#n)return;let e=parseInt(this.dataset.spotlightPadding??"",10)||8,i=t.getBoundingClientRect();Object.assign(this.#n.style,{top:`${i.top-e}px`,left:`${i.left-e}px`,width:`${i.width+e*2}px`,height:`${i.height+e*2}px`})}#u(t,e){if(this.#r){if(dt){this.#b(t,e);return}this.#w(t,e)}}#b(t,e){if(!this.#r)return;let i="--tour-target";t.style.anchorName=i,this.#r.style.positionAnchor=i,this.#r.style.position="fixed",this.#r.style.top="",this.#r.style.left="",this.#r.style.bottom="",this.#r.style.right="";let s="var(--tour-card-offset, 0.75rem)";switch(e==="auto"?this.#m(t):e){case"bottom":this.#r.style.top="anchor(bottom)",this.#r.style.left="anchor(center)",this.#r.style.translate="0 calc("+s+")";break;case"top":this.#r.style.bottom="anchor(top)",this.#r.style.left="anchor(center)",this.#r.style.translate="0 calc(-1 * "+s+")";break;case"right":this.#r.style.left="anchor(right)",this.#r.style.top="anchor(center)",this.#r.style.translate=s+" 0";break;case"left":this.#r.style.right="anchor(left)",this.#r.style.top="anchor(center)",this.#r.style.translate="calc(-1 * "+s+") 0";break}}#w(t,e){if(!this.#r)return;let i=t.getBoundingClientRect(),s=12,n=8,o=e==="auto"?this.#m(t):e;this.#r.style.position="fixed",this.#r.style.visibility="hidden",this.#r.style.top="0",this.#r.style.left="0",this.#r.style.translate="";let a=this.#r.getBoundingClientRect();this.#r.style.visibility="";let l=0,c=0,h=parseInt(this.dataset.spotlightPadding??"",10)||8;switch(o){case"bottom":l=i.bottom+h+s,c=i.left+(i.width-a.width)/2;break;case"top":l=i.top-h-s-a.height,c=i.left+(i.width-a.width)/2;break;case"right":l=i.top+(i.height-a.height)/2,c=i.right+h+s;break;case"left":l=i.top+(i.height-a.height)/2,c=i.left-h-s-a.width;break}c=Math.max(n,Math.min(c,window.innerWidth-a.width-n)),l=Math.max(n,Math.min(l,window.innerHeight-a.height-n)),Object.assign(this.#r.style,{top:`${l}px`,left:`${c}px`,translate:""})}#m(t){let e=t.getBoundingClientRect(),i=window.innerWidth,n=window.innerHeight-e.bottom,o=e.top,a=i-e.right,l=e.left,c=Math.max(n,o,a,l);return c===n?"bottom":c===o?"top":c===a?"right":"left"}#g(t,e){if(!this.#r)return;let i=this.#t.length,s=e===i-1,n=e===0,a=(this.dataset.mode??"passive")!=="forced",l=t.action!=="none";this.#r.innerHTML=`
|
|
1070
|
+
`),this.#o=t,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}#Y(){let t=this.#o;t&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==t),this.#o=null),this.#V()}#Z(t,e){if(!CSS.highlights||this.getAttribute("highlight")==="false")return;let i=this.#W(t);if(!i)return;let s=t-i.speechStart,n=this.#Q(i.element,s,e);if(!n)return;let o=new Highlight(n);if(CSS.highlights.set("text-reader-word",o),this.#a=o,this.getAttribute("scroll")!=="false"){let a=n.getBoundingClientRect(),l=window.innerHeight;(a.top<0||a.bottom>l)&&i.element.scrollIntoView({behavior:"smooth",block:"nearest"})}}#V(){CSS.highlights&&CSS.highlights.delete("text-reader-word"),this.#a=null}#W(t){let e=this.#i,i=0,s=e.length-1;for(;i<=s;){let n=i+s>>>1,o=e[n];if(t<o.speechStart)s=n-1;else if(t>=o.speechEnd)i=n+1;else return o}return null}#Q(t,e,i){let s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),n=0;for(;s.nextNode();){let o=s.currentNode,a=o.textContent??"";if(!a.trim())continue;let l=a.length;if(n+l>e){let c=e-n,h=document.createRange();h.setStart(o,Math.min(c,l));let u=c+i;return u<=l?h.setEnd(o,u):h.setEnd(o,l),h}n+=l}return null}async#G(){let t=speechSynthesis.getVoices();return t.length>0?t:new Promise(e=>{let i=()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())};speechSynthesis.addEventListener("voiceschanged",i),setTimeout(()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())},3e3)})}#tt(t){if(!this.#b||!t.length)return;let e=this.#b;e.innerHTML="";let i=document.documentElement.lang||"en",s=t.filter(l=>l.lang.startsWith(i)),n=t.filter(l=>!l.lang.startsWith(i)),o=[...s,...n],a=this.getAttribute("voice");for(let l of o){let c=document.createElement("option");c.textContent=`${l.name} (${l.lang})`,c.dataset.voiceUri=l.voiceURI,a&&l.voiceURI===a&&(c.selected=!0),e.append(c)}if(!a){let l=s.find(c=>c.default)||s[0];if(l){let c=[...e.options].find(h=>h.dataset.voiceUri===l.voiceURI);c&&(c.selected=!0)}}}#K(t){!this.#d||!this.#p||!this.#u||(t?(this.#d.hidden=!0,this.#p.hidden=!1,this.#u.disabled=!1):(this.#d.hidden=!1,this.#p.hidden=!0,this.#u.disabled=!0),this.#v&&(this.#y&&this.#y.setAttribute("aria-pressed",String(t)),t?this.#E():this.#_()))}#X(t){!this.#d||!this.#p||(this.#d.hidden=!t,this.#p.hidden=t)}#U(){this.#l=!1,this.#h=!1,this.#n=0,this.#e=null,this.#R(),this.#V(),this.#K(!1)}#F(t){return Math.round(Math.max(.5,Math.min(2,t))*10)/10}#I(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}#et=()=>{speechSynthesis.cancel()}};p("text-reader",Zt);function Qt(r){if(!r||typeof r!="string")return"";let t=document.createElement("template");return t.innerHTML=r,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(s=>s.remove()),t.content.querySelectorAll("*").forEach(s=>{for(let n of[...s.attributes]){if(n.name.startsWith("on")){s.removeAttribute(n.name);continue}if(["href","src","action","formaction","xlink:href"].includes(n.name)){let o=n.value.trim().toLowerCase();(o.startsWith("javascript:")||o.startsWith("data:text/html"))&&s.removeAttribute(n.name);continue}(n.name==="srcdoc"||n.name==="data"&&s.tagName==="OBJECT")&&s.removeAttribute(n.name)}}),t.innerHTML}function hi({newItems:r,nodes:t,keyOf:e,renderItem:i,containerFor:s}){let n=[],o=[],a=[],l=new Set;for(let h of r)l.add(e(h));for(let[h,u]of[...t])l.has(h)||(u.remove(),t.delete(h),a.push(h));let c=new Map;for(let h of r){let u=e(h),d=t.get(u)||null,f=s(h,d);c.has(f)||c.set(f,[]),c.get(f)?.push({item:h,key:u,existing:d})}for(let[h,u]of c)for(let d=0;d<u.length;d++){let{item:f,key:g,existing:w}=u[d],x=w;x?(x.parentElement!==h||h.children[d]!==x)&&o.push(g):(x=i(f),t.set(g,x),n.push(g));let _=h.children[d];_!==x&&h.insertBefore(x,_||null)}return{added:n,moved:o,removed:a}}var te=class extends m{#t=null;#e=null;#i=null;#s=new Map;#n=null;#r=new Map;setup(){this.#o(),this.#a(),this.#h(),this.#c(),this.#g(),this.#f()}teardown(){}#o(){this.#t=this.querySelector(":scope > chat-thread"),this.#e=this.querySelector(":scope > chat-input"),this.#i=this.querySelector(":scope > header select[data-model-select]")}#a(){let t=this.querySelector(":scope > script[data-participants]");if(t)try{let e=JSON.parse(t.textContent);this.#s=new Map(Object.entries(e))}catch{console.warn("[chat-window] Invalid participant JSON")}}#c(){if(this.#t)for(let t of this.#t.querySelectorAll("chat-message[data-from]"))this.#l(t)}#l(t){let e=t.getAttribute("data-from");if(!e)return;let i=this.#s.get(e);i?.name?t.setAttribute("data-from-label",i.name):t.hasAttribute("data-from-label")||t.setAttribute("data-from-label",e)}#h(){if(!this.#i)return;let t=this.getAttribute("model");t?this.#i.value=t:this.#i.value&&this.setAttribute("model",this.#i.value)}#f(){this.listen(this,"chat-input:send",this.#d),this.#i&&this.listen(this.#i,"change",this.#p)}#d=async t=>{t.stopPropagation();let{message:e}=t.detail;if(!e||!this.#t)return;let i=this.#u("user",e,"user");this.#t.appendChild(i),this.#v(),this.#g();let s=this.#m(),n=this.#b(s);this.#t.appendChild(n),this.#v(),this.#e&&(this.#e.disabled=!0);let o=this.getAttribute("endpoint");if(o)try{let a=await this.#y(o,e);this.#w(n,a)}catch(a){this.#w(n,"<p>Sorry, something went wrong.</p>"),n.setAttribute("data-status","error"),this.dispatchEvent(new CustomEvent("chat-window:error",{bubbles:!0,detail:{error:a.message,status:a.status??0}}))}else this.dispatchEvent(new CustomEvent("chat-window:send",{bubbles:!0,detail:{message:e,typingElement:n}}));this.#e&&(this.#e.disabled=!1,this.#e.focus()),this.#v()};#p=()=>{let t=this.#i.value;this.setAttribute("model",t),this.dispatchEvent(new CustomEvent("chat-window:model-change",{bubbles:!0,detail:{model:t}}))};#u(t,e,i){let s=document.createElement("chat-message");s.setAttribute("data-role",t),i&&(s.setAttribute("data-from",i),this.#l(s));let n=document.createElement("chat-bubble");if(e.includes("<"))n.innerHTML=Qt(e);else{let o=document.createElement("p");o.textContent=e,n.appendChild(o)}return s.appendChild(n),s}#b(t){let e=document.createElement("chat-message");if(e.setAttribute("data-role","agent"),e.setAttribute("data-status","typing"),t){e.setAttribute("data-from",t),this.#l(e);let o=this.#s.get(t)?.name??t;e.setAttribute("aria-label",`${o} is typing`)}else e.setAttribute("aria-label","Agent is typing");let i=this.getAttribute("model");i&&e.setAttribute("data-model",i);let s=document.createElement("chat-bubble");return e.appendChild(s),e}#w(t,e){let i=t.querySelector("chat-bubble");i&&(i.innerHTML=Qt(e)),t.removeAttribute("data-status"),t.removeAttribute("aria-label")}#m(){for(let[t,e]of this.#s)if(e.role==="agent")return t;return null}#g(){if(!this.#t)return;this.#t.querySelector("chat-message")!==null?(this.#n&&(this.#n.remove(),this.#n=null),this.#t.hidden=!1):(this.#t.hidden=!0,this.#n||(this.#n=document.createElement("p"),this.#n.setAttribute("data-chat-empty",""),this.#n.textContent=this.getAttribute("empty-message")||"Send a message to start.",this.#t.insertAdjacentElement("afterend",this.#n)))}#v(){this.#t&&requestAnimationFrame(()=>{this.#t.scrollTop=this.#t.scrollHeight})}scrollToBottom(){this.#v()}async#y(t,e){let i={message:e,model:this.getAttribute("model")||void 0},s=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!s.ok){let o=new Error(`Chat request failed: ${s.status}`);throw o.status=s.status,o}let n=await s.json();return n.html??n.message??n.content??""}get model(){return this.getAttribute("model")??""}set model(t){this.setAttribute("model",t),this.#i&&(this.#i.value=t)}get participants(){return this.#s}set participants(t){this.#s=t instanceof Map?t:new Map(Object.entries(t)),this.#c()}clearThread(){if(this.#t){for(;this.#t.firstChild;)this.#t.removeChild(this.#t.firstChild);this.#g()}}appendMessage(t,e,i){if(!this.#t)return;let s=this.#u(t,e,i);this.#t.appendChild(s),this.#v(),this.#g()}get messages(){return this.#t?[...this.#t.querySelectorAll(':scope > chat-message:not([data-status="typing"])')].map(t=>({id:t.id||t.getAttribute("data-id")||void 0,role:t.getAttribute("data-role")||"user",content:t.querySelector("chat-bubble")?.innerHTML||"",from:t.getAttribute("data-from")||void 0})):[]}set messages(t){if(!this.#t)return;let e=Array.isArray(t)?t:[];hi({newItems:e,nodes:this.#r,keyOf:i=>i.id??i.role+":"+i.content,renderItem:i=>{let s=this.#u(i.role||"user",i.content||"",i.from);return i.id&&(s.id=i.id),s},containerFor:()=>this.#t}),this.#g(),this.#v(),this.dispatchEvent(new CustomEvent("chat-window:messages-changed",{detail:{messages:e,source:"property"},bubbles:!0}))}};p("chat-window",te);var ee=class extends m{static formAssociated=!0;#t;#e;#i;#s;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}setup(){return this.#e=this.querySelector(":scope > textarea, :scope textarea[data-grow]"),this.#i=this.querySelector("[data-send]"),this.#e?(this.listen(this.#e,"keydown",this.#n),this.listen(this.#e,"input",this.#r),this.#i&&this.listen(this.#i,"click",this.#o),this.#c(),this.#l(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>this.#e.focus()),!0):!1}teardown(){clearTimeout(this.#s)}#n=t=>{switch(t.key){case"Enter":t.shiftKey||(t.preventDefault(),this.#a());break;case"Escape":t.preventDefault(),this.reset();break}};#r=()=>{this.#c(),this.#l(),clearTimeout(this.#s),this.#s=setTimeout(()=>{this.dispatchEvent(new CustomEvent("chat-input:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))},100)};#o=t=>{t.preventDefault(),this.#a()};#a(){let t=this.value.trim(),e=parseInt(this.getAttribute("minlength")??"1",10)||1;t.length<e||this.disabled||(this.dispatchEvent(new CustomEvent("chat-input:send",{bubbles:!0,detail:{message:t,from:null,model:null}})),this.reset())}#c(){let t=this.value;t?this.#t.setFormValue(t):this.#t.setFormValue(null)}#l(){let t=this.value,e=parseInt(this.getAttribute("maxlength")??"4000",10)||4e3;t.length>e?this.#t.setValidity({tooLong:!0},`Message exceeds ${e} characters`,this.#e):this.#t.setValidity({})}formResetCallback(){this.reset()}formStateRestoreCallback(t){!t||!this.#e||(this.#e.value=t,this.#c(),this.#l())}get value(){return this.#e?.value??""}set value(t){if(!this.#e)return;let e=t==null?"":String(t);this.#e.value!==e&&(this.#e.value=e,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#c(),this.#l(),this.dispatchEvent(new CustomEvent("chat-input:change",{bubbles:!0,detail:{value:e,source:"api"}})))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?(this.setAttribute("disabled",""),this.#e&&(this.#e.disabled=!0),this.#i&&(this.#i.disabled=!0)):(this.removeAttribute("disabled"),this.#e&&(this.#e.disabled=!1),this.#i&&(this.#i.disabled=!1))}focus(){this.#e?.focus()}reset(){this.#e&&(this.#e.value="",this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#c(),this.#l())}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,i){if(t==="disabled"){let s=i!==null;this.#e&&(this.#e.disabled=s),this.#i&&(this.#i.disabled=s)}}};p("chat-input",ee);var ut="http://www.w3.org/2000/svg";function Rs(r){return r.trim().split(/[\s,]+/).map(Number)}function js(r,t){let e=Rs(t);switch(r){case"rect":{let[i,s,n,o]=e;return{type:"rect",x:i,y:s,width:n-i,height:o-s}}case"circle":{let[i,s,n]=e;return{type:"circle",cx:i,cy:s,r:n}}case"poly":{let i=[];for(let s=0;s<e.length;s+=2)i.push([e[s],e[s+1]]);return{type:"poly",points:i}}default:return null}}function $s(r){if(!r)return null;switch(r.type){case"rect":{let t=document.createElementNS(ut,"rect");return t.setAttribute("x",String(r.x)),t.setAttribute("y",String(r.y)),t.setAttribute("width",String(r.width)),t.setAttribute("height",String(r.height)),t}case"circle":{let t=document.createElementNS(ut,"circle");return t.setAttribute("cx",String(r.cx)),t.setAttribute("cy",String(r.cy)),t.setAttribute("r",String(r.r)),t}case"poly":{let t=document.createElementNS(ut,"polygon");return t.setAttribute("points",r.points.map(e=>e.join(",")).join(" ")),t}default:return null}}function Ps(r){if(!r)return{x:0,y:0,width:0,height:0};switch(r.type){case"rect":return{x:r.x,y:r.y,width:r.width,height:r.height};case"circle":return{x:r.cx-r.r,y:r.cy-r.r,width:r.r*2,height:r.r*2};case"poly":{let t=100,e=100,i=0,s=0;for(let[n,o]of r.points)n<t&&(t=n),o<e&&(e=o),n>i&&(i=n),o>s&&(s=o);return{x:t,y:e,width:i-t,height:s-e}}default:return{x:0,y:0,width:0,height:0}}}var ie=class extends HTMLElement{get shape(){return this.getAttribute("shape")||"rect"}get coords(){return this.getAttribute("coords")||""}get label(){return this.getAttribute("label")||""}get href(){return this.getAttribute("href")}get target(){return this.getAttribute("target")||""}get tooltipMode(){return this.getAttribute("tooltip")||"hover"}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}},se=class extends m{#t=null;#e=null;#i=null;#s=[];#n=[];#r=null;#o=null;#a=null;setup(){if(this.#t=this.querySelector(":scope > img"),!this.#t){let t=this.getAttribute("src"),e=this.getAttribute("alt");if(t)this.#t=document.createElement("img"),this.#t.src=t,this.#t.alt=e||"",this.prepend(this.#t);else return!1}return this.#t.classList.add("image-map-img"),this.#t.complete?this.#c():this.#t.addEventListener("load",()=>this.#c(),{once:!0}),!0}teardown(){this.#o?.disconnect(),this.#h(),this.#e?.remove(),this.#i?.remove();for(let t of this.#n)t.anchor?.remove();this.#n=[],this.#s=[]}get regions(){return[...this.querySelectorAll(":scope > map-area")].map(t=>({shape:t.getAttribute("shape")||void 0,coords:t.getAttribute("coords")||void 0,label:t.getAttribute("label")||t.textContent?.trim()||void 0,href:t.getAttribute("href")||void 0,target:t.getAttribute("target")||void 0}))}set regions(t){let e=Array.isArray(t)?t:[];for(let i of[...this.querySelectorAll(":scope > map-area")])i.remove();for(let i of e){let s=document.createElement("map-area");i.shape&&s.setAttribute("shape",i.shape),i.coords&&s.setAttribute("coords",i.coords),i.label&&s.setAttribute("label",i.label),i.href&&s.setAttribute("href",i.href),i.target&&s.setAttribute("target",i.target),this.appendChild(s)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("image-map:regions-changed",{detail:{regions:e,source:"property"},bubbles:!0}))}#c(){let t=[...this.querySelectorAll(":scope > map-area")];if(t.length===0){this.setAttribute("data-upgraded","");return}this.#e=document.createElementNS(ut,"svg"),this.#e.setAttribute("viewBox","0 0 100 100"),this.#e.setAttribute("preserveAspectRatio","none"),this.#e.setAttribute("aria-hidden","true"),this.#e.classList.add("image-map-overlay"),this.#i=document.createElement("div"),this.#i.className="image-map-tooltip",this.#i.setAttribute("role","tooltip"),this.#i.setAttribute("aria-live","polite"),this.#i.id=`imap-tip-${crypto.randomUUID().slice(0,8)}`;for(let e of t){let i=e,s=i.shape,n=i.coords,o=js(s,n),a=$s(o);if(!a)continue;let l=Ps(o),c=i.href?document.createElement("a"):document.createElement("button");i.href&&(c.href=i.href,i.target&&(c.target=i.target)),c.className="image-map-anchor",c.setAttribute("aria-label",i.label),c.setAttribute("aria-describedby",this.#i.id),c.textContent=i.label,c.style.left=`${l.x}%`,c.style.top=`${l.y}%`,c.style.width=`${l.width}%`,c.style.height=`${l.height}%`,i.disabled&&(a.setAttribute("data-disabled",""),c.setAttribute("tabindex","-1"),c.setAttribute("aria-disabled","true"));let h=e.innerHTML,u={area:e,parsed:o,svgShape:a,anchor:c,contentHTML:h};if(!i.disabled){let d=i.tooltipMode;this.listen(a,"pointerenter",()=>{d==="hover"&&this.#l(u),a.setAttribute("data-hover",""),this.#p("image-map:area-enter",i)}),this.listen(a,"pointerleave",()=>{d==="hover"&&this.#h(),a.removeAttribute("data-hover"),this.#p("image-map:area-leave",i)}),this.listen(a,"click",()=>{d==="click"&&(this.#r===u?this.#h():this.#l(u)),this.#p("image-map:area-activate",i),i.href&&d!=="click"&&(i.target==="_blank"?window.open(i.href,"_blank","noopener"):window.location.href=i.href)}),this.listen(a,"touchstart",f=>{d==="hover"&&(this.#a!==u?(f.preventDefault(),this.#a=u,this.#l(u)):this.#a=null)},{passive:!1}),this.listen(c,"focus",()=>{this.#l(u),a.setAttribute("data-hover","")}),this.listen(c,"blur",()=>{this.#h(),a.removeAttribute("data-hover")})}this.#e.appendChild(a),this.#n.push(u),this.#s.push(c)}this.appendChild(this.#e);for(let e of this.#s)this.appendChild(e);this.appendChild(this.#i),this.listen(this,"keydown",this.#d),this.#o=new ResizeObserver(()=>{this.#r&&this.#f(this.#r.svgShape)}),this.#o.observe(this.#t),this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.#t.alt||"Image map"),this.setAttribute("data-upgraded","")}#l(t){this.#i&&(this.#r=t,this.#i.innerHTML=t.contentHTML,this.#i.setAttribute("data-visible",""),this.#f(t.svgShape))}#h(){this.#i&&(this.#r=null,this.#i.removeAttribute("data-visible"))}#f(t){if(!this.#i||!t)return;let e=t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=8,n=8,o=window.innerWidth,a=window.innerHeight,l,c,h=e.top-i.height-s;h>=n?(l=h,c=e.left+(e.width-i.width)/2):e.bottom+s+i.height<=a-n?(l=e.bottom+s,c=e.left+(e.width-i.width)/2):e.right+s+i.width<=o-n?(l=e.top+(e.height-i.height)/2,c=e.right+s):(l=e.top+(e.height-i.height)/2,c=e.left-i.width-s),c=Math.max(n,Math.min(c,o-i.width-n)),l=Math.max(n,Math.min(l,a-i.height-n)),this.#i.style.top=`${l}px`,this.#i.style.left=`${c}px`}#d=t=>{let e=this.#s.filter(s=>!s.hasAttribute("aria-disabled")),i=e.indexOf(document.activeElement);switch(t.key){case"ArrowDown":case"ArrowRight":{t.preventDefault();let s=i<e.length-1?i+1:0;e[s]?.focus();break}case"ArrowUp":case"ArrowLeft":{t.preventDefault();let s=i>0?i-1:e.length-1;e[s]?.focus();break}case"Escape":this.#h(),this.#a=null;break}};#p(t,e){this.dispatchEvent(new CustomEvent(t,{detail:{area:e},bubbles:!0}))}};p("map-area",ie);p("image-map",se);var Bs='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',Is={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},re=class extends m{#t;#e;setup(){return this.#t=this.getAttribute("video-id"),this.#e=this.getAttribute("title")??"Play video",this.#t?(this.hasAttribute("autoplay")?this.#a():this.#n(),!0):(console.warn("youtube-player: missing required video-id attribute"),!1)}#i(){let t=new URLSearchParams({autoplay:"1"}),e=this.getAttribute("start");e&&t.set("start",e);let i=this.getAttribute("list");return i&&t.set("list",i),this.getAttribute("params")&&new URLSearchParams(this.getAttribute("params")||"").forEach((s,n)=>t.set(n,s)),`https://www.youtube-nocookie.com/embed/${this.#t}?${t}`}#s(){let t=this.getAttribute("thumbnail")??"hq";return`https://i.ytimg.com/vi/${this.#t}/${Is[t]??"hqdefault"}.jpg`}#n(){this.setAttribute("state","ready"),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",`Play ${this.#e}`),this.innerHTML=`<img src="${this.#s()}" alt="" loading="lazy" decoding="async"><button type="button" aria-label="Play ${this.#e}">${Bs}</button>`,this.addEventListener("click",this.#r,{once:!0}),this.addEventListener("keydown",this.#o)}#r=()=>{this.removeEventListener("keydown",this.#o),this.#a()};#o=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.removeEventListener("click",this.#r),this.#a())};#a(){this.setAttribute("state","active"),this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label"),this.innerHTML=`<iframe src="${this.#i()}" title="${this.#e}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"></iframe>`,this.querySelector("iframe")?.focus()}};p("youtube-player",re);var dt=CSS.supports("anchor-name","--x"),ui=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=class extends HTMLElement{get target(){return this.dataset.target??""}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}},oe=class r extends m{#t=[];#e=0;#i=!1;#s=null;#n=null;#r=null;#o=null;#a=null;#c=null;#l=null;#h=null;static#f=null;static observedAttributes=["data-step"];setup(){if(this.#t=[...this.querySelectorAll("tour-step")],this.#t.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target?.closest?.(`[data-tour="${this.id}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#P();e?.complete||e?.skipped?this.setAttribute("data-complete",""):setTimeout(()=>this.start(e?.step??0),400)}return!0}teardown(){this.#i&&this.stop()}attributeChangedCallback(t,e,i){if(t==="data-step"&&this.#i&&e!==null){let s=parseInt(i,10);!Number.isNaN(s)&&s!==this.#e&&this.#v(s)}}start(t=0){r.#f&&r.#f!==this&&r.#f.stop(),this.#a=document.activeElement,this.#i=!0,r.#f=this,this.#d(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#M("tour:start",{step:t}),this.#v(t)}stop(){this.#E(),this.#i=!1,this.removeAttribute("data-active"),r.#f===this&&(r.#f=null)}next(){!this.#i||this.#r?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting")||(this.#e<this.#t.length-1?this.#v(this.#e+1,"next"):this.#T())}prev(){this.#i&&this.#e>0&&this.#v(this.#e-1,"prev")}goto(t){this.#i&&t>=0&&t<this.#t.length&&this.#v(t)}skip(){!this.#i||(this.dataset.mode??"passive")==="forced"||(this.#M("tour:skip",{step:this.#e}),this.#L({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#B(),this.removeAttribute("data-complete"),this.dataset.step="0"}#d(){this.#s=document.createElement("div"),this.#s.className="page-tour-backdrop",this.#s.setAttribute("aria-hidden","true"),this.#s.addEventListener("click",()=>{(this.dataset.mode??"passive")!=="forced"&&this.skip()}),this.#n=document.createElement("div"),this.#n.className="page-tour-spotlight",this.#n.setAttribute("aria-hidden","true"),this.#r=document.createElement("div"),this.#r.className="page-tour-card",this.#r.setAttribute("popover","manual"),this.#r.setAttribute("role","dialog"),this.#r.setAttribute("aria-modal","true"),this.#r.setAttribute("aria-label",this.dataset.title??"Page Tour"),this.#r.addEventListener("keydown",t=>this.#k(t)),this.#r.addEventListener("click",t=>this.#x(t)),this.#o=document.createElement("div"),this.#o.setAttribute("aria-live","polite"),this.#o.setAttribute("aria-atomic","true"),this.#o.className="visually-hidden",this.#o.id=`page-tour-announcer-${crypto.randomUUID().slice(0,8)}`,this.append(this.#s,this.#n,this.#r,this.#o),this.#r.showPopover(),requestAnimationFrame(()=>{this.#s?.setAttribute("data-visible","")})}#p(t){if(!this.#n)return;let e=parseInt(this.dataset.spotlightPadding??"",10)||8,i=t.getBoundingClientRect();Object.assign(this.#n.style,{top:`${i.top-e}px`,left:`${i.left-e}px`,width:`${i.width+e*2}px`,height:`${i.height+e*2}px`})}#u(t,e){if(this.#r){if(dt){this.#b(t,e);return}this.#w(t,e)}}#b(t,e){if(!this.#r)return;let i="--tour-target";t.style.anchorName=i,this.#r.style.positionAnchor=i,this.#r.style.position="fixed",this.#r.style.top="",this.#r.style.left="",this.#r.style.bottom="",this.#r.style.right="";let s="var(--tour-card-offset, 0.75rem)";switch(e==="auto"?this.#m(t):e){case"bottom":this.#r.style.top="anchor(bottom)",this.#r.style.left="anchor(center)",this.#r.style.translate="0 calc("+s+")";break;case"top":this.#r.style.bottom="anchor(top)",this.#r.style.left="anchor(center)",this.#r.style.translate="0 calc(-1 * "+s+")";break;case"right":this.#r.style.left="anchor(right)",this.#r.style.top="anchor(center)",this.#r.style.translate=s+" 0";break;case"left":this.#r.style.right="anchor(left)",this.#r.style.top="anchor(center)",this.#r.style.translate="calc(-1 * "+s+") 0";break}}#w(t,e){if(!this.#r)return;let i=t.getBoundingClientRect(),s=12,n=8,o=e==="auto"?this.#m(t):e;this.#r.style.position="fixed",this.#r.style.visibility="hidden",this.#r.style.top="0",this.#r.style.left="0",this.#r.style.translate="";let a=this.#r.getBoundingClientRect();this.#r.style.visibility="";let l=0,c=0,h=parseInt(this.dataset.spotlightPadding??"",10)||8;switch(o){case"bottom":l=i.bottom+h+s,c=i.left+(i.width-a.width)/2;break;case"top":l=i.top-h-s-a.height,c=i.left+(i.width-a.width)/2;break;case"right":l=i.top+(i.height-a.height)/2,c=i.right+h+s;break;case"left":l=i.top+(i.height-a.height)/2,c=i.left-h-s-a.width;break}c=Math.max(n,Math.min(c,window.innerWidth-a.width-n)),l=Math.max(n,Math.min(l,window.innerHeight-a.height-n)),Object.assign(this.#r.style,{top:`${l}px`,left:`${c}px`,translate:""})}#m(t){let e=t.getBoundingClientRect(),i=window.innerWidth,n=window.innerHeight-e.bottom,o=e.top,a=i-e.right,l=e.left,c=Math.max(n,o,a,l);return c===n?"bottom":c===o?"top":c===a?"right":"left"}#g(t,e){if(!this.#r)return;let i=this.#t.length,s=e===i-1,n=e===0,a=(this.dataset.mode??"passive")!=="forced",l=t.action!=="none";this.#r.innerHTML=`
|
|
1071
1071
|
<div class="page-tour-progress" aria-hidden="true">
|
|
1072
1072
|
${this.#t.map((c,h)=>`
|
|
1073
1073
|
<span class="page-tour-pip" ${h===e?"data-active":""} ${h<e?"data-visited":""}></span>
|
|
@@ -1104,11 +1104,11 @@ var Ui=Object.defineProperty;var At=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ue=(r,t)=>{
|
|
|
1104
1104
|
</button>
|
|
1105
1105
|
</nav>
|
|
1106
1106
|
</footer>
|
|
1107
|
-
`}#v(t,e="next"){if(this.#l?.abort(),this.#l=null,this.#e!==t){let h=this.#t[this.#e],u=h?document.querySelector(h.target):null;u&&(dt&&(u.style.anchorName=""),u.removeAttribute("data-tour-target"))}this.#j(),this.#e=t;let i=this.#t[t],s=document.querySelector(i.target);if(!s){console.warn(`[page-tour] Target "${i.target}" not found, skipping step ${t}`),e==="next"&&t<this.#t.length-1?this.#v(t+1,"next"):e==="prev"&&t>0&&this.#v(t-1,"prev");return}s.setAttribute("data-tour-target","");let n=ui()?"instant":i.scrollBehavior;i.scrollBehavior!=="none"&&s.scrollIntoView({block:"nearest",behavior:n});let o=()=>{this.#p(s),this.#u(s,i.placement)};o(),setTimeout(o,ui()?0:300),this.#g(i,t);let a=this.#r;a&&(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus()),requestAnimationFrame(()=>{let h=this.#r?.querySelector(".page-tour-content h3, .page-tour-content h2, .page-tour-content h4")??null;h?(h.hasAttribute("tabindex")||h.setAttribute("tabindex","-1"),h.focus()):(this.#r?.querySelector('[data-action="next"]')??null)?.focus()});let c=i.querySelector("h3, h2, h4")?.textContent??`Step ${t+1}`;this.#_(`Step ${t+1} of ${this.#t.length}: ${c}`),this.dataset.step=String(t),i.action!=="none"&&this.#y(i),this.#A(s),this.#L({step:t}),this.#i&&this.#M("tour:step",{step:t,target:s,direction:e})}#y(t){let e=document.querySelector(t.target);if(!e)return;let i=this.#r?.querySelector('[data-action="next"]')??null,s=new AbortController;this.#l=s;let o={click:"click",focus:"focus",input:"input",change:"change"}[t.action];o?e.addEventListener(o,()=>{i?.removeAttribute("data-waiting"),this.#r?.querySelector(".page-tour-action-hint")?.remove(),i?.focus(),this.#M("tour:action",{step:this.#e,action:t.action}),s.abort()},{signal:s.signal,once:!0}):t.action==="custom"&&this.addEventListener("tour:action",()=>{i?.removeAttribute("data-waiting"),this.#r?.querySelector(".page-tour-action-hint")?.remove(),i?.focus(),s.abort()},{signal:s.signal,once:!0})}#k(t){let e=this.dataset.mode??"passive",s=this.#t[this.#e]?.action!=="none",o=this.#r?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting");switch(t.key){case"Escape":e!=="forced"&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":t.preventDefault(),s&&o||this.next();break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.prev();break;case"Home":t.preventDefault(),this.goto(0);break;case"End":t.preventDefault(),this.goto(this.#t.length-1);break;case"Tab":this.#C(t,s&&o);break}}#C(t,e){if(!this.#r)return;let i=[...this.#r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(c=>!c.disabled&&c.offsetParent!==null),s=[];if(e){let c=this.#t[this.#e],h=document.querySelector(c.target);h&&(s=(h.matches("input, select, textarea, button, [href], [tabindex]")?[h]:[...h.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')]).filter(d=>!d.disabled&&d.offsetParent!==null))}let n=[...i,...s];if(n.length===0)return;let o=n[0],a=n[n.length-1],l=document.activeElement;t.shiftKey?(l===o||l&&!n.includes(l))&&(t.preventDefault(),a.focus()):(l===a||l&&!n.includes(l))&&(t.preventDefault(),o.focus())}#x(t){let e=t.target.closest("[data-action]");if(!e)return;switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#A(t){this.#c=new ResizeObserver(()=>{this.#S(t)}),this.#c.observe(t),this.listen(window,"scroll",()=>this.#S(t),{passive:!0})}#j(){this.#c&&(this.#c.disconnect(),this.#c=null),this.#h&&(cancelAnimationFrame(this.#h),this.#h=null)}#S(t){this.#h||(this.#h=requestAnimationFrame(()=>{if(this.#h=null,!this.#i)return;this.#p(t);let e=this.#t[this.#e];dt||this.#w(t,e.placement)}))}#T(){this.#M("tour:complete",{steps:this.#t.length}),this.#L({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#E(){this.#l?.abort(),this.#l=null,this.#j();let t=this.#t[this.#e],e=t?document.querySelector(t.target):null;e&&(dt&&(e.style.anchorName=""),e.removeAttribute("data-tour-target")),this.#s?.remove(),this.#n?.remove(),this.#r?.hidePopover?.(),this.#r?.remove(),this.#o?.remove(),this.#s=null,this.#n=null,this.#r=null,this.#o=null;let i=this.#a;i&&typeof i.focus=="function"&&(i.focus(),this.#a=null)}#_(t){this.#o&&(this.#o.textContent="",requestAnimationFrame(()=>{this.#o&&(this.#o.textContent=t)}))}#M(t,e){let i=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:i,detail:e}))}#N(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#$(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#L(t){let e=this.#N();if(!e)return;let i=this.#$(),s={};try{s=JSON.parse(e.getItem(i)??"null")??{}}catch{}e.setItem(i,JSON.stringify({...s,...t}))}#P(){let t=this.#N();if(!t)return null;try{return JSON.parse(t.getItem(this.#$())??"null")}catch{return null}}#B(){let t=this.#N();t&&t.removeItem(this.#$())}};p("page-tour",oe);p("tour-step",ne);function he(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var q=he();function vi(r){q=r}var B={exec:()=>null};function b(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(k.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var Bs=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),k={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},Is=/^(?:[ \t]*(?:\n|$))+/,qs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ds=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,it=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Os=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ue=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,yi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wi=b(yi).replace(/bull/g,ue).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Fs=b(yi).replace(/bull/g,ue).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),de=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zs=/^[^\n]+/,pe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Hs=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Us=b(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ue).getRegex(),bt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",me=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vs=b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",me).replace("tag",bt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ki=b(de).replace("hr",it).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt).getRegex(),Ws=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ki).getRegex(),fe={blockquote:Ws,code:qs,def:Hs,fences:Ds,heading:Os,hr:it,html:Vs,lheading:wi,list:Us,newline:Is,paragraph:ki,table:B,text:zs},di=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",it).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt).getRegex(),Gs={...fe,lheading:Fs,table:di,paragraph:b(de).replace("hr",it).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",di).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt).getRegex()},Ks={...fe,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:B,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(de).replace("hr",it).replace("heading",` *#{1,6} *[^
|
|
1108
|
-
]`).replace("lheading",wi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},
|
|
1107
|
+
`}#v(t,e="next"){if(this.#l?.abort(),this.#l=null,this.#e!==t){let h=this.#t[this.#e],u=h?document.querySelector(h.target):null;u&&(dt&&(u.style.anchorName=""),u.removeAttribute("data-tour-target"))}this.#j(),this.#e=t;let i=this.#t[t],s=document.querySelector(i.target);if(!s){console.warn(`[page-tour] Target "${i.target}" not found, skipping step ${t}`),e==="next"&&t<this.#t.length-1?this.#v(t+1,"next"):e==="prev"&&t>0&&this.#v(t-1,"prev");return}s.setAttribute("data-tour-target","");let n=ui()?"instant":i.scrollBehavior;i.scrollBehavior!=="none"&&s.scrollIntoView({block:"nearest",behavior:n});let o=()=>{this.#p(s),this.#u(s,i.placement)};o(),setTimeout(o,ui()?0:300),this.#g(i,t);let a=this.#r;a&&(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus()),requestAnimationFrame(()=>{let h=this.#r?.querySelector(".page-tour-content h3, .page-tour-content h2, .page-tour-content h4")??null;h?(h.hasAttribute("tabindex")||h.setAttribute("tabindex","-1"),h.focus()):(this.#r?.querySelector('[data-action="next"]')??null)?.focus()});let c=i.querySelector("h3, h2, h4")?.textContent??`Step ${t+1}`;this.#_(`Step ${t+1} of ${this.#t.length}: ${c}`),this.dataset.step=String(t),i.action!=="none"&&this.#y(i),this.#A(s),this.#L({step:t}),this.#i&&this.#M("tour:step",{step:t,target:s,direction:e})}#y(t){let e=document.querySelector(t.target);if(!e)return;let i=this.#r?.querySelector('[data-action="next"]')??null,s=new AbortController;this.#l=s;let o={click:"click",focus:"focus",input:"input",change:"change"}[t.action];o?e.addEventListener(o,()=>{i?.removeAttribute("data-waiting"),this.#r?.querySelector(".page-tour-action-hint")?.remove(),i?.focus(),this.#M("tour:action",{step:this.#e,action:t.action}),s.abort()},{signal:s.signal,once:!0}):t.action==="custom"&&this.addEventListener("tour:action",()=>{i?.removeAttribute("data-waiting"),this.#r?.querySelector(".page-tour-action-hint")?.remove(),i?.focus(),s.abort()},{signal:s.signal,once:!0})}#k(t){let e=this.dataset.mode??"passive",s=this.#t[this.#e]?.action!=="none",o=this.#r?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting");switch(t.key){case"Escape":e!=="forced"&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":t.preventDefault(),s&&o||this.next();break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.prev();break;case"Home":t.preventDefault(),this.goto(0);break;case"End":t.preventDefault(),this.goto(this.#t.length-1);break;case"Tab":this.#C(t,s&&o);break}}#C(t,e){if(!this.#r)return;let i=[...this.#r.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(c=>!c.disabled&&c.offsetParent!==null),s=[];if(e){let c=this.#t[this.#e],h=document.querySelector(c.target);h&&(s=(h.matches("input, select, textarea, button, [href], [tabindex]")?[h]:[...h.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')]).filter(d=>!d.disabled&&d.offsetParent!==null))}let n=[...i,...s];if(n.length===0)return;let o=n[0],a=n[n.length-1],l=document.activeElement;t.shiftKey?(l===o||l&&!n.includes(l))&&(t.preventDefault(),a.focus()):(l===a||l&&!n.includes(l))&&(t.preventDefault(),o.focus())}#x(t){let e=t.target.closest("[data-action]");if(!e)return;switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#A(t){this.#c=new ResizeObserver(()=>{this.#S(t)}),this.#c.observe(t),this.listen(window,"scroll",()=>this.#S(t),{passive:!0})}#j(){this.#c&&(this.#c.disconnect(),this.#c=null),this.#h&&(cancelAnimationFrame(this.#h),this.#h=null)}#S(t){this.#h||(this.#h=requestAnimationFrame(()=>{if(this.#h=null,!this.#i)return;this.#p(t);let e=this.#t[this.#e];dt||this.#w(t,e.placement)}))}#T(){this.#M("tour:complete",{steps:this.#t.length}),this.#L({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#E(){this.#l?.abort(),this.#l=null,this.#j();let t=this.#t[this.#e],e=t?document.querySelector(t.target):null;e&&(dt&&(e.style.anchorName=""),e.removeAttribute("data-tour-target")),this.#s?.remove(),this.#n?.remove(),this.#r?.hidePopover?.(),this.#r?.remove(),this.#o?.remove(),this.#s=null,this.#n=null,this.#r=null,this.#o=null;let i=this.#a;i&&typeof i.focus=="function"&&(i.focus(),this.#a=null)}#_(t){this.#o&&(this.#o.textContent="",requestAnimationFrame(()=>{this.#o&&(this.#o.textContent=t)}))}#M(t,e){let i=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:i,detail:e}))}#N(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#$(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#L(t){let e=this.#N();if(!e)return;let i=this.#$(),s={};try{s=JSON.parse(e.getItem(i)??"null")??{}}catch{}e.setItem(i,JSON.stringify({...s,...t}))}#P(){let t=this.#N();if(!t)return null;try{return JSON.parse(t.getItem(this.#$())??"null")}catch{return null}}#B(){let t=this.#N();t&&t.removeItem(this.#$())}};p("page-tour",oe);p("tour-step",ne);function he(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var q=he();function vi(r){q=r}var B={exec:()=>null};function b(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(k.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var qs=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),k={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},Ds=/^(?:[ \t]*(?:\n|$))+/,Os=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,it=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ue=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,yi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wi=b(yi).replace(/bull/g,ue).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Hs=b(yi).replace(/bull/g,ue).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),de=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Us=/^[^\n]+/,pe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Vs=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ws=b(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ue).getRegex(),bt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",me=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Gs=b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",me).replace("tag",bt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ki=b(de).replace("hr",it).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt).getRegex(),Ks=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ki).getRegex(),fe={blockquote:Ks,code:Os,def:Vs,fences:Fs,heading:zs,hr:it,html:Gs,lheading:wi,list:Ws,newline:Ds,paragraph:ki,table:B,text:Us},di=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",it).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt).getRegex(),Xs={...fe,lheading:Hs,table:di,paragraph:b(de).replace("hr",it).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",di).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bt).getRegex()},Js={...fe,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:B,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(de).replace("hr",it).replace("heading",` *#{1,6} *[^
|
|
1108
|
+
]`).replace("lheading",wi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ys=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xi=/^( {2,}|\\)\n(?!\s*$)/,Qs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,z=/[\p{P}\p{S}]/u,vt=/[\s\p{P}\p{S}]/u,ge=/[^\s\p{P}\p{S}]/u,tr=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,vt).getRegex(),Ai=/(?!~)[\p{P}\p{S}]/u,er=/(?!~)[\s\p{P}\p{S}]/u,ir=/(?:[^\s\p{P}\p{S}]|~)/u,sr=b(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",qs?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ei=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,rr=b(Ei,"u").replace(/punct/g,z).getRegex(),nr=b(Ei,"u").replace(/punct/g,Ai).getRegex(),Si="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",or=b(Si,"gu").replace(/notPunctSpace/g,ge).replace(/punctSpace/g,vt).replace(/punct/g,z).getRegex(),ar=b(Si,"gu").replace(/notPunctSpace/g,ir).replace(/punctSpace/g,er).replace(/punct/g,Ai).getRegex(),lr=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ge).replace(/punctSpace/g,vt).replace(/punct/g,z).getRegex(),cr=b(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,z).getRegex(),hr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ur=b(hr,"gu").replace(/notPunctSpace/g,ge).replace(/punctSpace/g,vt).replace(/punct/g,z).getRegex(),dr=b(/\\(punct)/,"gu").replace(/punct/g,z).getRegex(),pr=b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),mr=b(me).replace("(?:-->|$)","-->").getRegex(),fr=b("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",mr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,gr=b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",mt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ci=b(/^!?\[(label)\]\[(ref)\]/).replace("label",mt).replace("ref",pe).getRegex(),Ti=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",pe).getRegex(),br=b("reflink|nolink(?!\\()","g").replace("reflink",Ci).replace("nolink",Ti).getRegex(),pi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,be={_backpedal:B,anyPunctuation:dr,autolink:pr,blockSkip:sr,br:xi,code:Zs,del:B,delLDelim:B,delRDelim:B,emStrongLDelim:rr,emStrongRDelimAst:or,emStrongRDelimUnd:lr,escape:Ys,link:gr,nolink:Ti,punctuation:tr,reflink:Ci,reflinkSearch:br,tag:fr,text:Qs,url:B},vr={...be,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",mt).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",mt).getRegex()},ae={...be,emStrongRDelimAst:ar,emStrongLDelim:nr,delLDelim:cr,delRDelim:ur,url:b(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",pi).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:b(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",pi).getRegex()},yr={...ae,br:b(xi).replace("{2,}","*").getRegex(),text:b(ae.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},pt={normal:fe,gfm:Xs,pedantic:Js},Q={normal:be,gfm:ae,breaks:yr,pedantic:vr},wr={"&":"&","<":"<",">":">",'"':""","'":"'"},mi=r=>wr[r];function L(r,t){if(t){if(k.escapeTest.test(r))return r.replace(k.escapeReplace,mi)}else if(k.escapeTestNoEncode.test(r))return r.replace(k.escapeReplaceNoEncode,mi);return r}function fi(r){try{r=encodeURI(r).replace(k.percentDecode,"%")}catch{return null}return r}function gi(r,t){let e=r.replace(k.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=e.split(k.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(k.slashPipe,"|");return i}function tt(r,t,e){let i=r.length;if(i===0)return"";let s=0;for(;s<i;){let n=r.charAt(i-s-1);if(n===t&&!e)s++;else if(n!==t&&e)s++;else break}return r.slice(0,i-s)}function kr(r,t){if(r.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<r.length;i++)if(r[i]==="\\")i++;else if(r[i]===t[0])e++;else if(r[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function xr(r,t=0){let e=t,i="";for(let s of r)if(s===" "){let n=4-e%4;i+=" ".repeat(n),e+=n}else i+=s,e++;return i}function bi(r,t,e,i,s){let n=t.href,o=t.title||null,a=r[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:e,href:n,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function Ar(r,t,e){let i=r.match(e.other.indentCodeCompensation);if(i===null)return t;let s=i[1];return t.split(`
|
|
1109
1109
|
`).map(n=>{let o=n.match(e.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=s.length?n.slice(s.length):n}).join(`
|
|
1110
1110
|
`)}var ft=class{options;rules;lexer;constructor(r){this.options=r||q}space(r){let t=this.rules.block.newline.exec(r);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(r){let t=this.rules.block.code.exec(r);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:tt(e,`
|
|
1111
|
-
`)}}}fences(r){let t=this.rules.block.fences.exec(r);if(t){let e=t[0],i=
|
|
1111
|
+
`)}}}fences(r){let t=this.rules.block.fences.exec(r);if(t){let e=t[0],i=Ar(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(r){let t=this.rules.block.heading.exec(r);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let i=tt(e,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(e=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(r){let t=this.rules.block.hr.exec(r);if(t)return{type:"hr",raw:tt(t[0],`
|
|
1112
1112
|
`)}}blockquote(r){let t=this.rules.block.blockquote.exec(r);if(t){let e=tt(t[0],`
|
|
1113
1113
|
`).split(`
|
|
1114
1114
|
`),i="",s="",n=[];for(;e.length>0;){let o=!1,a=[],l;for(l=0;l<e.length;l++)if(this.rules.other.blockquoteStart.test(e[l]))a.push(e[l]),o=!0;else if(!o)a.push(e[l]);else break;e=e.slice(l);let c=a.join(`
|
|
@@ -1120,7 +1120,7 @@ ${h}`:h;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
1120
1120
|
`),w=this.blockquote(g);n[n.length-1]=w,i=i.substring(0,i.length-f.raw.length)+w.raw,s=s.substring(0,s.length-f.text.length)+w.text;break}else if(d?.type==="list"){let f=d,g=f.raw+`
|
|
1121
1121
|
`+e.join(`
|
|
1122
1122
|
`),w=this.list(g);n[n.length-1]=w,i=i.substring(0,i.length-d.raw.length)+w.raw,s=s.substring(0,s.length-f.raw.length)+w.raw,e=g.substring(n.at(-1).raw.length).split(`
|
|
1123
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:n,text:s}}}list(r){let t=this.rules.block.list.exec(r);if(t){let e=t[1].trim(),i=e.length>1,s={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let n=this.rules.other.listItemRegex(e),o=!1;for(;r;){let l=!1,c="",h="";if(!(t=n.exec(r))||this.rules.block.hr.test(r))break;c=t[0],r=r.substring(c.length);let u=
|
|
1123
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:n,text:s}}}list(r){let t=this.rules.block.list.exec(r);if(t){let e=t[1].trim(),i=e.length>1,s={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let n=this.rules.other.listItemRegex(e),o=!1;for(;r;){let l=!1,c="",h="";if(!(t=n.exec(r))||this.rules.block.hr.test(r))break;c=t[0],r=r.substring(c.length);let u=xr(t[2].split(`
|
|
1124
1124
|
`,1)[0],t[1].length),d=r.split(`
|
|
1125
1125
|
`,1)[0],f=!u.trim(),g=0;if(this.options.pedantic?(g=2,h=u.trimStart()):f?g=t[1].length+1:(g=u.search(this.rules.other.nonSpaceChar),g=g>4?1:g,h=u.slice(g),g+=t[1].length),f&&this.rules.other.blankLine.test(d)&&(c+=d+`
|
|
1126
1126
|
`,r=r.substring(d.length+1),l=!0),!l){let w=this.rules.other.nextBulletRegex(g),x=this.rules.other.hrRegex(g),_=this.rules.other.fencesBeginRegex(g),O=this.rules.other.headingBeginRegex(g),V=this.rules.other.htmlBeginRegex(g),W=this.rules.other.blockquoteBeginRegex(g);for(;r;){let G=r.split(`
|
|
@@ -1129,7 +1129,7 @@ ${h}`:h;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
1129
1129
|
`+d}f=!d.trim(),c+=G+`
|
|
1130
1130
|
`,r=r.substring(G.length+1),u=$.slice(g)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),s.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),s.raw+=c}let a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let h={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=h.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=h.raw+l.tokens[0].raw,l.tokens[0].text=h.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(h)):l.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):l.tokens.unshift(h)}}if(!s.loose){let c=l.tokens.filter(u=>u.type==="space"),h=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=h}}if(s.loose)for(let l of s.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return s}}html(r){let t=this.rules.block.html.exec(r);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(r){let t=this.rules.block.def.exec(r);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:s}}}table(r){let t=this.rules.block.table.exec(r);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=gi(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
1131
1131
|
`):[],n={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<e.length;o++)n.header.push({text:e[o],tokens:this.lexer.inline(e[o]),header:!0,align:n.align[o]});for(let o of s)n.rows.push(gi(o,n.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:n.align[l]})));return n}}lheading(r){let t=this.rules.block.lheading.exec(r);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(r){let t=this.rules.block.paragraph.exec(r);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
1132
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(r){let t=this.rules.block.text.exec(r);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(r){let t=this.rules.inline.escape.exec(r);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(r){let t=this.rules.inline.tag.exec(r);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(r){let t=this.rules.inline.link.exec(r);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let n=tt(e.slice(0,-1),"\\");if((e.length-n.length)%2===0)return}else{let n=
|
|
1132
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(r){let t=this.rules.block.text.exec(r);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(r){let t=this.rules.inline.escape.exec(r);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(r){let t=this.rules.inline.tag.exec(r);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(r){let t=this.rules.inline.link.exec(r);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let n=tt(e.slice(0,-1),"\\");if((e.length-n.length)%2===0)return}else{let n=kr(t[2],"()");if(n===-2)return;if(n>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(i);n&&(i=n[1],s=n[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i=i.slice(1):i=i.slice(1,-1)),bi(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(r,t){let e;if((e=this.rules.inline.reflink.exec(r))||(e=this.rules.inline.nolink.exec(r))){let i=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[i.toLowerCase()];if(!s){let n=e[0].charAt(0);return{type:"text",raw:n,text:n}}return bi(e,s,e[0],this.lexer,this.rules)}}emStrong(r,t,e=""){let i=this.rules.inline.emStrongLDelim.exec(r);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!e||this.rules.inline.punctuation.exec(e))){let s=[...i[0]].length-1,n,o,a=s,l=0,c=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*r.length+s);(i=c.exec(t))!==null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(o=[...n].length,i[3]||i[4]){a+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...i[0]][0].length,u=r.slice(0,s+i.index+h+o);if(Math.min(s,o)%2){let f=u.slice(1,-1);return{type:"em",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}let d=u.slice(2,-2);return{type:"strong",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(r){let t=this.rules.inline.code.exec(r);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),s=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&s&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(r){let t=this.rules.inline.br.exec(r);if(t)return{type:"br",raw:t[0]}}del(r,t,e=""){let i=this.rules.inline.delLDelim.exec(r);if(i&&(!i[1]||!e||this.rules.inline.punctuation.exec(e))){let s=[...i[0]].length-1,n,o,a=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*r.length+s);(i=l.exec(t))!==null;){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n||(o=[...n].length,o!==s))continue;if(i[3]||i[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...i[0]][0].length,h=r.slice(0,s+i.index+c+o),u=h.slice(s,-s);return{type:"del",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(r){let t=this.rules.inline.autolink.exec(r);if(t){let e,i;return t[2]==="@"?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(r){let t;if(t=this.rules.inline.url.exec(r)){let e,i;if(t[2]==="@")e=t[0],i="mailto:"+e;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);e=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(r){let t=this.rules.inline.text.exec(r);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},S=class le{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||q,this.options.tokenizer=this.options.tokenizer||new ft,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:k,block:pt.normal,inline:Q.normal};this.options.pedantic?(e.block=pt.pedantic,e.inline=Q.pedantic):this.options.gfm&&(e.block=pt.gfm,this.options.breaks?e.inline=Q.breaks:e.inline=Q.gfm),this.tokenizer.rules=e}static get rules(){return{block:pt,inline:Q}}static lex(t,e){return new le(e).lex(t)}static lexInline(t,e){return new le(e).inlineTokens(t)}lex(t){t=t.replace(k.carriageReturn,`
|
|
1133
1133
|
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],i=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(k.tabCharGlobal," ").replace(k.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},t,e))?(t=t.substring(s.raw.length),e.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let o=e.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
|
|
1134
1134
|
`:e.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let o=e.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
1135
1135
|
`)?"":`
|
|
@@ -1161,9 +1161,9 @@ ${this.parser.parse(r)}</blockquote>
|
|
|
1161
1161
|
`}tablerow({text:r}){return`<tr>
|
|
1162
1162
|
${r}</tr>
|
|
1163
1163
|
`}tablecell(r){let t=this.parser.parseInline(r.tokens),e=r.header?"th":"td";return(r.align?`<${e} align="${r.align}">`:`<${e}>`)+t+`</${e}>
|
|
1164
|
-
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${L(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:t,tokens:e}){let i=this.parser.parseInline(e),s=fi(r);if(s===null)return i;r=s;let n='<a href="'+r+'"';return t&&(n+=' title="'+L(t)+'"'),n+=">"+i+"</a>",n}image({href:r,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let s=fi(r);if(s===null)return L(e);r=s;let n=`<img src="${r}" alt="${L(e)}"`;return t&&(n+=` title="${L(t)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:L(r.text)}},ve=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},C=class ce{options;renderer;textRenderer;constructor(t){this.options=t||q,this.options.renderer=this.options.renderer||new gt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ve}static parse(t,e){return new ce(e).parse(t)}static parseInline(t,e){return new ce(e).parseInline(t)}parse(t){this.renderer.parser=this;let e="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=s,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){e+=a||"";continue}}let n=s;switch(n.type){case"space":{e+=this.renderer.space(n);break}case"hr":{e+=this.renderer.hr(n);break}case"heading":{e+=this.renderer.heading(n);break}case"code":{e+=this.renderer.code(n);break}case"table":{e+=this.renderer.table(n);break}case"blockquote":{e+=this.renderer.blockquote(n);break}case"list":{e+=this.renderer.list(n);break}case"checkbox":{e+=this.renderer.checkbox(n);break}case"html":{e+=this.renderer.html(n);break}case"def":{e+=this.renderer.def(n);break}case"paragraph":{e+=this.renderer.paragraph(n);break}case"text":{e+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return e}parseInline(t,e=this.renderer){this.renderer.parser=this;let i="";for(let s=0;s<t.length;s++){let n=t[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=a||"";continue}}let o=n;switch(o.type){case"escape":{i+=e.text(o);break}case"html":{i+=e.html(o);break}case"link":{i+=e.link(o);break}case"image":{i+=e.image(o);break}case"checkbox":{i+=e.checkbox(o);break}case"strong":{i+=e.strong(o);break}case"em":{i+=e.em(o);break}case"codespan":{i+=e.codespan(o);break}case"br":{i+=e.br(o);break}case"del":{i+=e.del(o);break}case"text":{i+=e.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}},et=class{options;block;constructor(r){this.options=r||q}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?S.lex:S.lexInline}provideParser(r=this.block){return r?C.parse:C.parseInline}},
|
|
1165
|
-
Please report this to https://github.com/markedjs/marked.`,r){let i="<p>An error occurred:</p><pre>"+L(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},I=new xr;function v(r,t){return I.parse(r,t)}v.options=v.setOptions=function(r){return I.setOptions(r),v.defaults=I.defaults,vi(v.defaults),v};v.getDefaults=he;v.defaults=q;v.use=function(...r){return I.use(...r),v.defaults=I.defaults,vi(v.defaults),v};v.walkTokens=function(r,t){return I.walkTokens(r,t)};v.parseInline=I.parseInline;v.Parser=C;v.parser=C.parse;v.Renderer=gt;v.TextRenderer=ve;v.Lexer=S;v.lexer=S.lex;v.Tokenizer=ft;v.Hooks=et;v.parse=v;var Fo=v.options,zo=v.setOptions,Ho=v.use,Uo=v.walkTokens,Vo=v.parseInline;var Wo=C.parse,Go=S.lex;var ye=class extends m{#t=null;#e=null;#i=null;#s=null;#n=null;static get observedAttributes(){return["src"]}setup(){this.#o()}teardown(){this.#e?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(t,e,i){t==="src"&&i&&e!==i&&this.isConnected&&this.#o()}get parser(){return this.#t}set parser(t){this.#t=typeof t=="function"?t:null}get markdown(){return this.#s??this.#n??""}set markdown(t){let e=t==null?null:String(t);this.#s!==e&&(this.#s=e,this.#o())}async render(){await this.#o()}async reload(){this.getAttribute("src")&&await this.#o()}#r(){if(this.getAttribute("src"))return null;let t=this.querySelector('script[type="text/markdown"]');if(t)return t.textContent;let e=this.querySelector("template[data-md]");if(e)return e.content.textContent;let i=this.querySelector(":scope > pre");return i?i.textContent:null}async#o(){let t=this.getAttribute("src"),e;if(this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),t){this.#e?.abort(),this.#e=new AbortController,this.setAttribute("data-loading",""),this.#l("markdown-viewer:fetch",{src:t});try{let n=await fetch(t,{signal:this.#e.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);e=await n.text()}catch(n){if(n.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#l("markdown-viewer:error",{error:n.message});return}this.removeAttribute("data-loading")}else this.#s!=null?e=this.#s:e=this.#r();if(e==null)return;this.#n=e;let i;try{i=await(await this.#a())(e)}catch(n){this.setAttribute("data-error",""),this.#l("markdown-viewer:error",{error:n.message});return}this.#i||(this.#i=document.createElement("div"),this.#i.className="md-content",this.#i.setAttribute("part","content"),this.appendChild(this.#i)),this.#i.innerHTML=i,this.#c(),this.setAttribute("data-rendered","");let s=this.getAttribute("ping");if(s&&navigator.sendBeacon?.(s,JSON.stringify({src:t||"inline"})),this.#l("markdown-viewer:rendered",{src:t,node:this.#i}),this.hasAttribute("highlight"))for(let n of this.#i.querySelectorAll('pre > code[class*="language-"]')){let o=n.className.match(/language-(\S+)/)?.[1]||"";this.#l("markdown-viewer:highlight",{node:n,language:o})}}async#a(){return this.#t?this.#t:t=>v.parse(t,{gfm:!0})}#c(){if(!this.#i)return;let t=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;t&&(this.#i.dataset.theme=t)}#l(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};p("markdown-viewer",ye);var we=class extends m{#t=null;#e=null;#i=null;#s=null;#n="";#r=null;static get observedAttributes(){return["name","placeholder","rows"]}setup(){this.#o(),this.#a(),this.#l()}teardown(){this.#r!==null&&clearTimeout(this.#r),this.removeAttribute("data-editing")}attributeChangedCallback(t,e,i){!this.#t||e===i||(t==="name"&&(this.#t.name=i||""),t==="placeholder"&&(this.#t.placeholder=i||""),t==="rows"&&(this.#t.rows=parseInt(i,10)||10))}get value(){return this.#t?.value??""}set value(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.value!==e&&(this.#t.value=e,this.#l(),this.dispatchEvent(new CustomEvent("markdown-editor:change",{detail:{value:e,source:"api"},bubbles:!0})))}get textarea(){return this.#t}#o(){let e=this.querySelector("textarea")?.value||"";this.#i=document.createElement("section"),this.#i.className="md-editor-pane",this.#i.setAttribute("aria-label","Markdown source"),this.#s=document.createElement("section"),this.#s.className="md-preview-pane",this.#s.setAttribute("aria-label","Rendered preview"),this.#s.setAttribute("aria-live","polite"),this.#t=document.createElement("textarea"),this.#t.className="md-editor-input",this.#t.value=e,this.#t.name=this.getAttribute("name")||"",this.#t.placeholder=this.getAttribute("placeholder")||"Write markdown here...",this.#t.rows=parseInt(this.getAttribute("rows")??"",10)||10,this.#t.setAttribute("spellcheck","true"),this.#e=document.createElement("markdown-viewer"),this.hasAttribute("highlight")&&this.#e.setAttribute("highlight","");let i=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;i&&(this.#e.dataset.theme=i),this.#i.appendChild(this.#t),this.#s.appendChild(this.#e),this.innerHTML="",this.appendChild(this.#i),this.appendChild(this.#s),this.#n=e}#a(){let t=this.#t;t&&(this.listen(t,"input",()=>{this.#h("markdown-editor:input",{value:t.value}),this.#c()}),this.listen(t,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(t,"blur",()=>{this.removeAttribute("data-editing"),t.value!==this.#n&&(this.#n=t.value,this.#h("markdown-editor:change",{value:t.value}))}),this.hasAttribute("data-tab-indent")&&this.listen(t,"keydown",e=>{let i=e;if(i.key==="Tab"&&!i.shiftKey&&!i.ctrlKey&&!i.metaKey){i.preventDefault();let{selectionStart:s,selectionEnd:n}=t;t.setRangeText(" ",s,n,"end"),t.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#c(){this.#r!==null&&clearTimeout(this.#r),this.#r=setTimeout(()=>this.#l(),150)}#l(){if(!this.#e)return;let t=this.#t?.value||"";if(!t.trim()){let i=this.#e.querySelector(".md-content");i&&(i.innerHTML="");return}let e=this.#e.querySelector('script[type="text/markdown"]');e||(e=document.createElement("script"),e.type="text/markdown",this.#e.prepend(e)),e.textContent=t,this.#e.removeAttribute("data-rendered"),this.#e.render?.()}#h(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};p("markdown-editor",we);var Ar=0,ke=class extends m{#t=null;#e=null;#i=null;#s=!1;#n=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#r(),this.#o();let t=this.dataset.breakpoint||"48rem";this.#i=matchMedia(`(max-width: ${t})`),this.#a(this.#i),this.listen(this.#i,"change",e=>this.#a(e)),this.#n=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&this.#s&&this.#h()}),this.#n.observe(this,{childList:!0})}teardown(){this.#n?.disconnect(),this.#n=null,this.#s&&this.#l(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null}get tools(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-page-tools-internal"))}#r(){if((this.dataset.orientation||"auto")!=="auto")return;let i=(this.dataset.position||"sticky")==="inline"?"horizontal":"vertical";this.dataset.resolvedOrientation=i}#o(){let t=`pt-${++Ar}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0,this.#t.innerHTML=`<icon-wc name="${e}" size="md"></icon-wc>`,this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.#e.hidden=!0,this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"toggle",s=>{s.newState==="closed"&&this.#t?.focus()})}#a(t){t.matches??t?this.#c():this.#l()}#c(){if(this.#s||!this.#t||!this.#e)return;this.#s=!0;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#t.hidden=!1,this.#e.hidden=!1,this.dataset.collapsed=""}#l(){if(!this.#s||!this.#t||!this.#e)return;this.#s=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover?.();let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.#e.hidden=!0,delete this.dataset.collapsed}#h(){if(!this.#e)return;let t=this.tools;for(let e of t)this.#e.appendChild(e)}};p("page-tools",ke);var xe=class extends m{#t;#e;#i=null;setup(){this.#i===null&&(this.#i=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#i,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&this.setAttribute("role","group");let i=this.getAttribute("variant")||"icon";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="print-trigger",this.#t.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#t.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#t.appendChild(o)}if(this.listen(this.#t,"click",this.#s),this.append(this.#t),e){let o=document.createElement("label");this.#e=document.createElement("input"),this.#e.type="checkbox";let a=document.createElement("span");a.textContent="Print without VB styles",o.append(this.#e,a),this.append(o)}}teardown(){this.#t=null,this.#e=null}#s=()=>{let t=this.#e?.checked;if(t&&document.documentElement.setAttribute("data-print-raw",""),window.print(),t){let e=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",e),clearTimeout(i)};window.addEventListener("afterprint",e,{once:!0});let i=setTimeout(e,5e3)}}};p("print-page",xe);var Ae=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${E(r)}&text=${E(t)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${E(r)}&text=${E(t)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:r})=>`https://www.facebook.com/sharer/sharer.php?u=${E(r)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:r})=>`https://www.linkedin.com/sharing/share-offsite/?url=${E(r)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://wa.me/?text=${E(`${t} ${r}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://t.me/share/url?url=${E(r)}&text=${E(t)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://bsky.app/intent/compose?text=${E(`${t} ${r}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:r,title:t},e="mastodon.social")=>`https://${e}/share?text=${E(`${t} ${r}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:r,title:t,text:e})=>`mailto:?subject=${E(t)}&body=${E(`${e}
|
|
1164
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${L(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:t,tokens:e}){let i=this.parser.parseInline(e),s=fi(r);if(s===null)return i;r=s;let n='<a href="'+r+'"';return t&&(n+=' title="'+L(t)+'"'),n+=">"+i+"</a>",n}image({href:r,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let s=fi(r);if(s===null)return L(e);r=s;let n=`<img src="${r}" alt="${L(e)}"`;return t&&(n+=` title="${L(t)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:L(r.text)}},ve=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},C=class ce{options;renderer;textRenderer;constructor(t){this.options=t||q,this.options.renderer=this.options.renderer||new gt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ve}static parse(t,e){return new ce(e).parse(t)}static parseInline(t,e){return new ce(e).parseInline(t)}parse(t){this.renderer.parser=this;let e="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=s,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){e+=a||"";continue}}let n=s;switch(n.type){case"space":{e+=this.renderer.space(n);break}case"hr":{e+=this.renderer.hr(n);break}case"heading":{e+=this.renderer.heading(n);break}case"code":{e+=this.renderer.code(n);break}case"table":{e+=this.renderer.table(n);break}case"blockquote":{e+=this.renderer.blockquote(n);break}case"list":{e+=this.renderer.list(n);break}case"checkbox":{e+=this.renderer.checkbox(n);break}case"html":{e+=this.renderer.html(n);break}case"def":{e+=this.renderer.def(n);break}case"paragraph":{e+=this.renderer.paragraph(n);break}case"text":{e+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return e}parseInline(t,e=this.renderer){this.renderer.parser=this;let i="";for(let s=0;s<t.length;s++){let n=t[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=a||"";continue}}let o=n;switch(o.type){case"escape":{i+=e.text(o);break}case"html":{i+=e.html(o);break}case"link":{i+=e.link(o);break}case"image":{i+=e.image(o);break}case"checkbox":{i+=e.checkbox(o);break}case"strong":{i+=e.strong(o);break}case"em":{i+=e.em(o);break}case"codespan":{i+=e.codespan(o);break}case"br":{i+=e.br(o);break}case"del":{i+=e.del(o);break}case"text":{i+=e.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}},et=class{options;block;constructor(r){this.options=r||q}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?S.lex:S.lexInline}provideParser(r=this.block){return r?C.parse:C.parseInline}},Er=class{defaults=he();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=C;Renderer=gt;TextRenderer=ve;Lexer=S;Tokenizer=ft;Hooks=et;constructor(...r){this.use(...r)}walkTokens(r,t){let e=[];for(let i of r)switch(e=e.concat(t.call(this,i)),i.type){case"table":{let s=i;for(let n of s.header)e=e.concat(this.walkTokens(n.tokens,t));for(let n of s.rows)for(let o of n)e=e.concat(this.walkTokens(o.tokens,t));break}case"list":{let s=i;e=e.concat(this.walkTokens(s.items,t));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(n=>{let o=s[n].flat(1/0);e=e.concat(this.walkTokens(o,t))}):s.tokens&&(e=e.concat(this.walkTokens(s.tokens,t)))}}return e}use(...r){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(e=>{let i={...e};if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let n=t.renderers[s.name];n?t.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=t[s.level];n?n.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),e.renderer){let s=this.defaults.renderer||new gt(this.defaults);for(let n in e.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=e.renderer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h||""}}i.renderer=s}if(e.tokenizer){let s=this.defaults.tokenizer||new ft(this.defaults);for(let n in e.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=e.tokenizer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.tokenizer=s}if(e.hooks){let s=this.defaults.hooks||new et;for(let n in e.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=e.hooks[o],l=s[o];et.passThroughHooks.has(n)?s[o]=c=>{if(this.defaults.async&&et.passThroughHooksRespectAsync.has(n))return(async()=>{let u=await a.call(s,c);return l.call(s,u)})();let h=a.call(s,c);return l.call(s,h)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,c);return u===!1&&(u=await l.apply(s,c)),u})();let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.hooks=s}if(e.walkTokens){let s=this.defaults.walkTokens,n=e.walkTokens;i.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,t){return S.lex(r,t??this.defaults)}parser(r,t){return C.parse(r,t??this.defaults)}parseMarkdown(r){return(t,e)=>{let i={...e},s={...this.defaults,...i},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=r),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(r):r?S.lex:S.lexInline)(o,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(r):r?C.parse:C.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(n);try{s.hooks&&(t=s.hooks.preprocess(t));let o=(s.hooks?s.hooks.provideLexer(r):r?S.lex:S.lexInline)(t,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(r):r?C.parse:C.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(r,t){return e=>{if(e.message+=`
|
|
1165
|
+
Please report this to https://github.com/markedjs/marked.`,r){let i="<p>An error occurred:</p><pre>"+L(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},I=new Er;function v(r,t){return I.parse(r,t)}v.options=v.setOptions=function(r){return I.setOptions(r),v.defaults=I.defaults,vi(v.defaults),v};v.getDefaults=he;v.defaults=q;v.use=function(...r){return I.use(...r),v.defaults=I.defaults,vi(v.defaults),v};v.walkTokens=function(r,t){return I.walkTokens(r,t)};v.parseInline=I.parseInline;v.Parser=C;v.parser=C.parse;v.Renderer=gt;v.TextRenderer=ve;v.Lexer=S;v.lexer=S.lex;v.Tokenizer=ft;v.Hooks=et;v.parse=v;var Ho=v.options,Uo=v.setOptions,Vo=v.use,Wo=v.walkTokens,Go=v.parseInline;var Ko=C.parse,Xo=S.lex;var ye=class extends m{#t=null;#e=null;#i=null;#s=null;#n=null;static get observedAttributes(){return["src"]}setup(){this.#o()}teardown(){this.#e?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(t,e,i){t==="src"&&i&&e!==i&&this.isConnected&&this.#o()}get parser(){return this.#t}set parser(t){this.#t=typeof t=="function"?t:null}get markdown(){return this.#s??this.#n??""}set markdown(t){let e=t==null?null:String(t);this.#s!==e&&(this.#s=e,this.#o())}async render(){await this.#o()}async reload(){this.getAttribute("src")&&await this.#o()}#r(){if(this.getAttribute("src"))return null;let t=this.querySelector('script[type="text/markdown"]');if(t)return t.textContent;let e=this.querySelector("template[data-md]");if(e)return e.content.textContent;let i=this.querySelector(":scope > pre");return i?i.textContent:null}async#o(){let t=this.getAttribute("src"),e;if(this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),t){this.#e?.abort(),this.#e=new AbortController,this.setAttribute("data-loading",""),this.#l("markdown-viewer:fetch",{src:t});try{let n=await fetch(t,{signal:this.#e.signal});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);e=await n.text()}catch(n){if(n.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#l("markdown-viewer:error",{error:n.message});return}this.removeAttribute("data-loading")}else this.#s!=null?e=this.#s:e=this.#r();if(e==null)return;this.#n=e;let i;try{i=await(await this.#a())(e)}catch(n){this.setAttribute("data-error",""),this.#l("markdown-viewer:error",{error:n.message});return}this.#i||(this.#i=document.createElement("div"),this.#i.className="md-content",this.#i.setAttribute("part","content"),this.appendChild(this.#i)),this.#i.innerHTML=i,this.#c(),this.setAttribute("data-rendered","");let s=this.getAttribute("ping");if(s&&navigator.sendBeacon?.(s,JSON.stringify({src:t||"inline"})),this.#l("markdown-viewer:rendered",{src:t,node:this.#i}),this.hasAttribute("highlight"))for(let n of this.#i.querySelectorAll('pre > code[class*="language-"]')){let o=n.className.match(/language-(\S+)/)?.[1]||"";this.#l("markdown-viewer:highlight",{node:n,language:o})}}async#a(){return this.#t?this.#t:t=>v.parse(t,{gfm:!0})}#c(){if(!this.#i)return;let t=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;t&&(this.#i.dataset.theme=t)}#l(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};p("markdown-viewer",ye);var we=class extends m{#t=null;#e=null;#i=null;#s=null;#n="";#r=null;static get observedAttributes(){return["name","placeholder","rows"]}setup(){this.#o(),this.#a(),this.#l()}teardown(){this.#r!==null&&clearTimeout(this.#r),this.removeAttribute("data-editing")}attributeChangedCallback(t,e,i){!this.#t||e===i||(t==="name"&&(this.#t.name=i||""),t==="placeholder"&&(this.#t.placeholder=i||""),t==="rows"&&(this.#t.rows=parseInt(i,10)||10))}get value(){return this.#t?.value??""}set value(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.value!==e&&(this.#t.value=e,this.#l(),this.dispatchEvent(new CustomEvent("markdown-editor:change",{detail:{value:e,source:"api"},bubbles:!0})))}get textarea(){return this.#t}#o(){let e=this.querySelector("textarea")?.value||"";this.#i=document.createElement("section"),this.#i.className="md-editor-pane",this.#i.setAttribute("aria-label","Markdown source"),this.#s=document.createElement("section"),this.#s.className="md-preview-pane",this.#s.setAttribute("aria-label","Rendered preview"),this.#s.setAttribute("aria-live","polite"),this.#t=document.createElement("textarea"),this.#t.className="md-editor-input",this.#t.value=e,this.#t.name=this.getAttribute("name")||"",this.#t.placeholder=this.getAttribute("placeholder")||"Write markdown here...",this.#t.rows=parseInt(this.getAttribute("rows")??"",10)||10,this.#t.setAttribute("spellcheck","true"),this.#e=document.createElement("markdown-viewer"),this.hasAttribute("highlight")&&this.#e.setAttribute("highlight","");let i=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;i&&(this.#e.dataset.theme=i),this.#i.appendChild(this.#t),this.#s.appendChild(this.#e),this.innerHTML="",this.appendChild(this.#i),this.appendChild(this.#s),this.#n=e}#a(){let t=this.#t;t&&(this.listen(t,"input",()=>{this.#h("markdown-editor:input",{value:t.value}),this.#c()}),this.listen(t,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(t,"blur",()=>{this.removeAttribute("data-editing"),t.value!==this.#n&&(this.#n=t.value,this.#h("markdown-editor:change",{value:t.value}))}),this.hasAttribute("data-tab-indent")&&this.listen(t,"keydown",e=>{let i=e;if(i.key==="Tab"&&!i.shiftKey&&!i.ctrlKey&&!i.metaKey){i.preventDefault();let{selectionStart:s,selectionEnd:n}=t;t.setRangeText(" ",s,n,"end"),t.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#c(){this.#r!==null&&clearTimeout(this.#r),this.#r=setTimeout(()=>this.#l(),150)}#l(){if(!this.#e)return;let t=this.#t?.value||"";if(!t.trim()){let i=this.#e.querySelector(".md-content");i&&(i.innerHTML="");return}let e=this.#e.querySelector('script[type="text/markdown"]');e||(e=document.createElement("script"),e.type="text/markdown",this.#e.prepend(e)),e.textContent=t,this.#e.removeAttribute("data-rendered"),this.#e.render?.()}#h(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};p("markdown-editor",we);var Sr=0,ke=class extends m{#t=null;#e=null;#i=null;#s=!1;#n=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#r(),this.#o();let t=this.dataset.breakpoint||"48rem";this.#i=matchMedia(`(max-width: ${t})`),this.#a(this.#i),this.listen(this.#i,"change",e=>this.#a(e)),this.#n=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&this.#s&&this.#h()}),this.#n.observe(this,{childList:!0})}teardown(){this.#n?.disconnect(),this.#n=null,this.#s&&this.#l(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null}get tools(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-page-tools-internal"))}#r(){if((this.dataset.orientation||"auto")!=="auto")return;let i=(this.dataset.position||"sticky")==="inline"?"horizontal":"vertical";this.dataset.resolvedOrientation=i}#o(){let t=`pt-${++Sr}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0,this.#t.innerHTML=`<icon-wc name="${e}" size="md"></icon-wc>`,this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.#e.hidden=!0,this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"toggle",s=>{s.newState==="closed"&&this.#t?.focus()})}#a(t){t.matches??t?this.#c():this.#l()}#c(){if(this.#s||!this.#t||!this.#e)return;this.#s=!0;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#t.hidden=!1,this.#e.hidden=!1,this.dataset.collapsed=""}#l(){if(!this.#s||!this.#t||!this.#e)return;this.#s=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover?.();let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.#e.hidden=!0,delete this.dataset.collapsed}#h(){if(!this.#e)return;let t=this.tools;for(let e of t)this.#e.appendChild(e)}};p("page-tools",ke);var xe=class extends m{#t;#e;#i=null;setup(){this.#i===null&&(this.#i=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#i,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&this.setAttribute("role","group");let i=this.getAttribute("variant")||"icon";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="print-trigger",this.#t.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#t.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#t.appendChild(o)}if(this.listen(this.#t,"click",this.#s),this.append(this.#t),e){let o=document.createElement("label");this.#e=document.createElement("input"),this.#e.type="checkbox";let a=document.createElement("span");a.textContent="Print without VB styles",o.append(this.#e,a),this.append(o)}}teardown(){this.#t=null,this.#e=null}#s=()=>{let t=this.#e?.checked;if(t&&document.documentElement.setAttribute("data-print-raw",""),window.print(),t){let e=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",e),clearTimeout(i)};window.addEventListener("afterprint",e,{once:!0});let i=setTimeout(e,5e3)}}};p("print-page",xe);var Ae=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${E(r)}&text=${E(t)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${E(r)}&text=${E(t)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:r})=>`https://www.facebook.com/sharer/sharer.php?u=${E(r)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:r})=>`https://www.linkedin.com/sharing/share-offsite/?url=${E(r)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://wa.me/?text=${E(`${t} ${r}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://t.me/share/url?url=${E(r)}&text=${E(t)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://bsky.app/intent/compose?text=${E(`${t} ${r}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:r,title:t},e="mastodon.social")=>`https://${e}/share?text=${E(`${t} ${r}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:r,title:t,text:e})=>`mailto:?subject=${E(t)}&body=${E(`${e}
|
|
1166
1166
|
|
|
1167
|
-
${r}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),Ee="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function E(r){return encodeURIComponent(r)}var Se=class extends m{#t;#e;#i;#s="";#n=null;#r=null;get url(){return this.#t}set url(t){this.#t=t}get title(){return this.#e??""}set title(t){this.#e=t}get text(){return this.#i}set text(t){this.#i=t}setup(){if(this.#o(),this.#a(),this.closest("selection-menu")){this.#c(),this.setAttribute("data-tier-resolved","selection");return}this.#s==="native"?this.#l():this.#s==="hidden"?this.style.display="none":this.children.length>0?this.#f():this.#h(),this.setAttribute("data-tier-resolved",this.#s)}teardown(){this.removeAttribute("data-tier-resolved"),this.#n&&(clearTimeout(this.#n),this.#n=null),this.#r&&(this.#r.removeEventListener("click",this.#u),this.#r.remove(),this.#r=null),this.querySelector(".share-trigger")?.remove()}async share(){this.#s==="native"&&await this.#p()}#o(){this.#t=this.getAttribute("url")||document.querySelector('link[rel="canonical"]')?.getAttribute("href")||location.href,this.#e=this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title,this.#i=this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||""}#a(){let t=this.getAttribute("tier");if(t==="platforms"||t==="native"){t==="native"&&!navigator.share?this.#s="hidden":this.#s=t;return}if((this.getAttribute("platforms")||Ee)==="native-only"){this.#s=typeof navigator.share=="function"?"native":"hidden";return}this.#s=typeof navigator.share=="function"?"native":"platforms"}#c(){let t=document.createElement("button");t.type="button",t.setAttribute("aria-label","Share selection");let e=document.createElement("icon-wc");e.setAttribute("name","share-2"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e),t.addEventListener("click",()=>{let i=this.closest("selection-menu"),n=i?.getSelection?.()?.text||window.getSelection()?.toString()||"";n&&navigator.share?navigator.share({text:`"${n}" \u2014 ${location.href}`}).catch(()=>{}):n&&Y(`"${n}" \u2014 ${location.href}`,{button:t,announceMessage:"Selection copied"}),i?.dismiss?.()}),this.appendChild(t)}#l(){let t=this.getAttribute("label")||"Share",e=document.createElement("button");e.type="button",e.className="share-trigger",e.setAttribute("aria-label","Share this page"),e.innerHTML=`<icon-wc name="share-2" size="sm" aria-hidden="true"></icon-wc><span class="share-label">${t}</span>`,e.addEventListener("click",this.#d),this.appendChild(e)}#h(){let t=(this.getAttribute("platforms")||Ee).split(",").map(e=>e.trim()).filter(Boolean);this.#r=document.createElement("nav"),this.#r.setAttribute("aria-label","Share this page");for(let e of t){let i=Ae.get(e);if(!i)continue;let s=document.createElement("button");s.type="button",s.dataset.platform=e,s.setAttribute("aria-label",e==="copy"?"Copy link":`Share on ${i.label}`);let n=i.iconSet?` set="${i.iconSet}"`:"";s.innerHTML=`<icon-wc name="${i.iconName}" size="sm"${n} aria-hidden="true"></icon-wc><span class="share-label">${i.label}</span>`,this.#r.appendChild(s)}this.#r.addEventListener("click",this.#u),this.appendChild(this.#r)}#f(){if(this.querySelector("nav"))this.#r=this.querySelector("nav");else{let i=document.createElement("nav");for(i.setAttribute("aria-label","Share this page");this.firstChild;)i.appendChild(this.firstChild);this.appendChild(i),this.#r=i}let t=this.querySelectorAll("a[data-platform]");for(let i of t){let s=i.getAttribute("href")||"";i.setAttribute("href",s.replace(/\{url\}/g,encodeURIComponent(this.#t||"")).replace(/\{title\}/g,encodeURIComponent(this.#e||"")).replace(/\{text\}/g,encodeURIComponent(this.#i||"")))}let e=this.querySelectorAll('[data-platform="copy"]');for(let i of e)i.addEventListener("click",this.#b);this.#r.addEventListener("click",this.#u)}#d=async()=>{await this.#p()};async#p(){let t={url:this.#t||"",title:this.#e||"",text:this.#i||""};this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(t))throw new Error("Payload not shareable");await navigator.share(t),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0}))}catch(e){e.name!=="AbortError"&&this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:e},bubbles:!0}))}}#u=t=>{let e=t.target.closest("[data-platform]");if(!e)return;let i=e.dataset.platform;if(i==="copy"){this.#b(t,e);return}if(e.tagName==="A"||!i)return;let s=Ae.get(i);if(!s)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:i},bubbles:!0}));let n={url:this.#t||"",title:this.#e||"",text:this.#i||""};if(i==="email")location.href=s.buildUrl(n);else if(i==="mastodon"){let o=this.getAttribute("mastodon-instance")||"mastodon.social",a=s.buildUrl(n,o);window.open(a,"_blank","noopener,noreferrer")}else window.open(s.buildUrl(n),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:i},bubbles:!0}))};#b=async(t,e)=>{let i=e||t?.target?.closest('[data-platform="copy"]');if(!i)return;if(!await Y(this.#t||"",{button:i,announceMessage:"Link copied to clipboard",duration:2e3})){this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy"},bubbles:!0}));return}let n=i.querySelector(".share-label"),o=n?.textContent;n&&(n.textContent="Copied!"),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0})),this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>{n&&o&&(n.textContent=o),this.#n=null},2e3)}};p("share-wc",Se);var
|
|
1168
|
-
`);D.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,D],st=1}function Mr(){st--,st<=0&&D&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==D),D=null,st=0)}var R=null;function Te(r){R||(R=document.createElement("div"),R.setAttribute("aria-live","polite"),R.setAttribute("aria-atomic","true"),R.className="hn-sr-only",document.body.appendChild(R)),R.textContent="",requestAnimationFrame(()=>{R.textContent=r})}function Mi(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0;for(;i.nextNode();){if(i.currentNode===t)return s+e;s+=(i.currentNode.textContent??"").length}return-1}function H(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0,n=null,o=0,a=null,l=0;for(;i.nextNode();){let c=i.currentNode,h=(c.textContent??"").length;if(!n&&s+h>t&&(n=c,o=t-s),s+h>=e){a=c,l=e-s;break}s+=h}if(!n||!a)return null;try{let c=document.createRange();return c.setStart(n,Math.min(o,(n.textContent??"").length)),c.setEnd(a,Math.min(l,(a.textContent??"").length)),c}catch{return null}}var Me=class{#t;#e;#i;#s;#n=[];#r=!Cr;#o;#a;#c=!1;#l=[];constructor(t){this.#t=t,this.#s=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#e=e&&e!==""?e:location.pathname;let i=t.dataset.highlightsColors;this.#i=i?i.split(",").map(s=>s.trim()).filter(Boolean):[...Sr],this.#r||Lr(this.#i),this.#b(),this.#s||(this.#o=this.#h.bind(this),this.#a=this.#f.bind(this),t.addEventListener("pointerup",this.#o),t.addEventListener("click",this.#a)),t.setAttribute("data-highlights-init",""),this.#p().then(()=>{this.#c||this.#b()})}get colors(){return[...this.#i]}get element(){return this.#t}getHighlights(){return this.#n.map(t=>({...t}))}removeHighlight(t){let e=this.#n.findIndex(i=>i.id===t);e<0||(this.#n.splice(e,1),this.#u(),this.#b(),this.#y("highlights:removed",{id:t}),Te("Highlight removed"))}clearAll(){this.#n=[],this.#u(),this.#b()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#n})}importHighlights(t){try{let e=typeof t=="string"?JSON.parse(t):t;if(!e.highlights||!Array.isArray(e.highlights))return;this.#n=e.highlights,this.#u(),this.#b()}catch{}}destroy(){if(!this.#c){if(this.#c=!0,this.#o&&this.#t.removeEventListener("pointerup",this.#o),this.#a&&this.#t.removeEventListener("click",this.#a),this.#r)this.#t.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}`);Mr()}this.#g(),this.#t.removeAttribute("data-highlights-init")}}#h(){requestAnimationFrame(()=>{if(this.#c)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);this.#t.contains(e.commonAncestorContainer)&&this.#y("highlights:selected",{text:t.toString().trim(),rect:e.getBoundingClientRect()})})}#f(t){let e=t.target.closest?.(".hn-margin-annotation");if(e){let s=e.dataset.hnId,n=this.#n.find(o=>o.id===s);if(n){this.#y("highlights:clicked",{id:s,highlight:{...n}}),this.#y("highlights:request-note",{id:s,highlight:{...n},controller:this});return}}let i=t.target.closest?.("mark[data-hn-id]");if(i){let s=i.dataset.hnId,n=this.#n.find(o=>o.id===s);if(n){this.#y("highlights:clicked",{id:s,highlight:{...n}});return}}if(!this.#r){let s=this.#d(t.clientX,t.clientY);s&&this.#y("highlights:clicked",{id:s.id,highlight:{...s}})}}findHighlightRect(t){let e=this.#n.find(n=>n.id===t);if(!e)return null;let i=H(this.#t,e.startOffset,e.endOffset);if(!i)return null;let s=i.getClientRects();return s.length?s[0]:null}#d(t,e){for(let i of this.#n){let s=H(this.#t,i.startOffset,i.endOffset);if(!s)continue;let n=s.getClientRects();for(let o of n)if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)return i}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let i=e.getRangeAt(0);if(!this.#t.contains(i.commonAncestorContainer))return;let s=Mi(this.#t,i.startContainer,i.startOffset),n=Mi(this.#t,i.endContainer,i.endOffset);if(s<0||n<0||s>=n)return;let o=e.toString().trim(),a={id:Tr(),startOffset:s,endOffset:n,text:o,color:t,note:"",created:Date.now()};this.#n.push(a),this.#u(),this.#b(),e.removeAllRanges(),this.#y("highlights:added",{id:a.id,text:o,color:t,note:""}),Te("Highlight added")}_changeColor(t,e){let i=this.#n.find(s=>s.id===t);i&&(i.color=e,this.#u(),this.#b())}_updateNote(t,e){let i=this.#n.find(s=>s.id===t);i&&(i.note=e,this.#u(),this.#v(),this.#y("highlights:note-changed",{id:t,note:e}),Te("Note saved"))}async#p(){let t=await A.get(_i,this.#e);if(!t||!Array.isArray(t.highlights))return;let e=Li(this.#t.textContent);t.contentHash&&t.contentHash!==e?(this.#n=t.highlights.filter(i=>{let s=H(this.#t,i.startOffset,i.endOffset);return s?s.toString().trim()===i.text:!1}),this.#u()):this.#n=t.highlights}#u(){let t={version:1,contentHash:Li(this.#t.textContent),highlights:this.#n};A.set(_i,this.#e,t).catch(()=>{})}#b(){this.#r?this.#m():this.#w(),this.#v()}#w(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#n){let i=H(this.#t,e.startOffset,e.endOffset);i&&t.has(e.color)&&t.get(e.color).push(i)}for(let[e,i]of t){let s=`hn-${e}`;i.length===0?CSS.highlights.delete(s):CSS.highlights.set(s,new Highlight(...i))}}#m(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let i=e.parentNode;for(;e.firstChild;)i.insertBefore(e.firstChild,e);i.removeChild(e)}),this.#t.normalize();let t=[...this.#n].sort((e,i)=>i.startOffset-e.startOffset);for(let e of t){let i=H(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=_r(this.#t,e.color),n=document.createElement("mark");n.dataset.hnId=e.id,n.dataset.hnColor=e.color,s&&(n.style.backgroundColor=s,n.style.textDecorationColor=s);try{i.surroundContents(n)}catch{let o=i.extractContents();n.appendChild(o),i.insertNode(n)}}}#g(){for(let t of this.#l)t.remove();this.#l=[]}#v(){if(this.#g(),this.#n.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");for(let e of this.#n){let i=H(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=i.getClientRects();if(s.length===0)continue;let n=s[0],o=this.#t.getBoundingClientRect(),a=n.top-o.top,l=document.createElement("span");l.className="hn-margin-annotation",l.dataset.hnId=e.id,l.setAttribute("aria-hidden","true"),l.style.top=`${a}px`,e.note?(l.innerHTML='<span class="hn-note-indicator">*</span> You highlighted',l.classList.add("hn-has-note")):l.textContent="You highlighted",this.#t.appendChild(l),this.#l.push(l)}}#y(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}},_e=new WeakMap;function M(r){if(_e.has(r))return _e.get(r);let t=new Me(r);return _e.set(r,t),t}function Ni(r=document){r.querySelectorAll(Le).forEach(t=>{t.hasAttribute("data-highlights-init")||M(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Ni()):Ni();var Nr=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(Le)&&M(i),i.querySelectorAll(Le).forEach(s=>{s.hasAttribute("data-highlights-init")||M(s)})}});Nr.observe(document.documentElement,{childList:!0,subtree:!0});var Rr=["yellow","green","blue","pink"],Ne=class extends m{#t=null;#e="yellow";#i=!1;#s=null;setup(){this.#i=!!this.closest("selection-menu"),this.#i?this.#n():this.#a()}teardown(){this.#t?.destroy(),this.#t=null,this.#s?.remove(),this.#s=null}#n(){let t=this.#l(),e=document.createElement("button");e.type="button",e.setAttribute("aria-label","Highlight selection");let i=document.createElement("icon-wc");i.setAttribute("name","highlighter"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i),e.addEventListener("click",n=>{n.stopPropagation(),this.#r()}),this.appendChild(e),this.#s=document.createElement("div"),this.#s.className="highlight-color-dropdown",this.#s.setAttribute("role","group"),this.#s.setAttribute("aria-label","Highlight color"),this.#s.hidden=!0;let s=this.#s;t.forEach(n=>{let o=document.createElement("button");o.type="button",o.className="highlight-color-swatch",o.dataset.color=n,o.setAttribute("aria-label",`${n}`),o.setAttribute("aria-pressed",n===this.#e?"true":"false"),o.style.backgroundColor=`var(--highlight-${n})`,o.addEventListener("click",a=>{a.stopPropagation(),this.#e=n,s.querySelectorAll(".highlight-color-swatch").forEach(l=>l.setAttribute("aria-pressed",l.dataset.color===n?"true":"false")),s.hidden=!0,this.#o()}),s.appendChild(o)}),this.appendChild(s)}#r(){this.#s&&(this.#s.hidden=!this.#s.hidden)}#o(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection?.();if(!e)return;let i=e.target;if(i.hasAttribute("data-highlights-init"))this.#t||(this.#t=M(i));else{let s=this.getAttribute("storage-key")||"";i.setAttribute("data-highlights",s),this.hasAttribute("colors")&&i.setAttribute("data-highlights-colors",this.getAttribute("colors")??""),this.#t=M(i)}this.#t?._createFromSelection(this.#e),t.dismiss?.()}#a(){let t=this.#c();if(!t)return!1;let e=this.getAttribute("storage-key")||"";return t.setAttribute("data-highlights",e),this.hasAttribute("colors")&&t.setAttribute("data-highlights-colors",this.getAttribute("colors")??""),this.hasAttribute("readonly")&&t.setAttribute("data-highlights-readonly",""),this.#t=M(t),!0}#c(){let t=this.getAttribute("for");return t?document.getElementById(t):this.firstElementChild}#l(){let t=this.getAttribute("colors");return t?t.split(",").map(e=>e.trim()).filter(Boolean):[...Rr]}getHighlights(){return this.#t?.getHighlights()??[]}removeHighlight(t){this.#t?.removeHighlight(t)}clearAll(){this.#t?.clearAll()}exportHighlights(){return this.#t?.exportHighlights()??'{"version":1,"highlights":[]}'}importHighlights(t){this.#t?.importHighlights(t)}};p("highlight-wc",Ne);var Re=CSS.supports("anchor-name","--x"),jr=CSS.supports("position-area","bottom"),$r=0,je=class extends m{#t=null;#e=null;#i=null;#s=null;setup(){this.id||(this.id=`pop-over-${++$r}`);let t=this.dataset.mode||"auto";this.hasAttribute("popover")||this.setAttribute("popover",t),this.#n(),this.#r(),this.#i=e=>{let i=e.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${i}`,{detail:{state:e.newState},bubbles:!0,composed:!0})),!Re&&e.newState==="open"&&this.#t&&this.#a()},this.listen(this,"beforetoggle",this.#i),Re||(this.#s=()=>{this.matches(":popover-open")&&this.#t&&this.#a()},this.listen(window,"resize",this.#s),this.listen(window,"scroll",this.#s,{capture:!0,passive:!0}))}show(){this.matches(":popover-open")||this.showPopover()}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#n(){let t=this.dataset.anchor;t?this.#t=document.getElementById(t)||document.querySelector(t):this.#t=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#r(){if(!(!this.#t||!Re)&&(this.#e=`--pop-over-anchor-${this.id}`,this.#t.style.setProperty("anchor-name",this.#e),this.style.setProperty("position-anchor",this.#e),this.setAttribute("data-anchor-name",this.#e||""),!jr)){let t=this.dataset.position||"bottom";this.#o(t)}}#o(t){let e="var(--_pop-over-offset, var(--size-xs))",i={top:{bottom:`calc(anchor(top) + ${e})`,left:"anchor(left)"},bottom:{top:`calc(anchor(bottom) + ${e})`,left:"anchor(left)"},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},s=t.split("-")[0],n=i[s]||i.bottom;Object.entries(n).forEach(([o,a])=>this.style.setProperty(o,a))}#a(){if(!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#c(),s,n;switch(e.split("-")[0]){case"top":s=t.top-this.offsetHeight-i,n=t.left;break;case"left":s=t.top,n=t.left-this.offsetWidth-i;break;case"right":s=t.top,n=t.right+i;break;default:s=t.bottom+i,n=t.left;break}e.endsWith("-end")&&(e.startsWith("top")||e.startsWith("bottom")?n=t.right-this.offsetWidth:s=t.bottom-this.offsetHeight),this.style.position="fixed",this.style.top=`${Math.round(s)}px`,this.style.left=`${Math.round(n)}px`,this.style.margin="0"}#c(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset]??t.xs}};p("pop-over",je);var Ri=8,$e=8,Pr=0,Pe=class extends m{#t=null;#e=new Set;#i=!1;#s;setup(){let t=this.querySelector(":scope > pop-over[data-selection-menu-host]");if(t)this.#s=t;else{this.#s=document.createElement("pop-over"),this.#s.setAttribute("data-selection-menu-host",""),this.#s.dataset.mode="manual",this.#s.id=`selection-menu-${++Pr}`;let e=[...this.children];for(let i of e)i!==this.#s&&this.#s.appendChild(i);this.appendChild(this.#s)}this.hidden=!1,this.#n(),this.listen(document,"pointerup",this.#r),this.listen(document,"pointerdown",this.#l),this.listen(document,"keydown",this.#h),this.id&&new MutationObserver(()=>this.#n()).observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]})}getSelection(){return this.#t?{...this.#t}:null}dismiss(){this.#c()}get actions(){return[...(this.#s||this).children].map(e=>({tag:e.tagName.toLowerCase(),attrs:Object.fromEntries([...e.attributes].map(i=>[i.name,i.value])),html:e.innerHTML||void 0}))}set actions(t){let e=Array.isArray(t)?t:[],i=this.#s||this;for(;i.firstChild;)i.firstChild.remove();for(let s of e){if(s instanceof Element){i.appendChild(s);continue}if(!s?.tag)continue;let n=document.createElement(s.tag);if(s.attrs)for(let[o,a]of Object.entries(s.attrs))a==null||a===!1||n.setAttribute(o,a===!0?"":String(a));s.html&&(n.innerHTML=s.html),i.appendChild(n)}this.dispatchEvent(new CustomEvent("selection-menu:actions-changed",{detail:{actions:this.actions,source:"property"},bubbles:!0}))}#n(){this.#e.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#e.add(e),e.hasAttribute("data-selection-menu")||e.setAttribute("data-selection-menu",this.id||""))}this.id&&document.querySelectorAll(`[data-selection-menu="${this.id}"]`).forEach(e=>{this.#e.add(e)})}#r=()=>{requestAnimationFrame(()=>{this.isConnected&&this.#o()})};#o(){let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0),i=e.commonAncestorContainer,s=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,n=null;for(let a of this.#e)if(a.contains(s)){n=a;break}if(!n)return;let o=t.toString().trim();this.#t={range:e.cloneRange(),text:o,target:n},this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#t.range,text:o,target:n},bubbles:!0})),this.#a(e.getBoundingClientRect())}#a(t){this.#s&&(this.#s.show(),this.#i=!0,requestAnimationFrame(()=>{let e=this.#s.getBoundingClientRect(),i=e.width||200,s=e.height||40,n=t.top-s-Ri,o=t.left+t.width/2-i/2;n<$e&&(n=t.bottom+Ri);let a=window.innerWidth-i-$e;o=Math.max($e,Math.min(o,a)),this.#s.style.top=`${n}px`,this.#s.style.left=`${o}px`}))}#c(){this.#s&&this.#s.hide(),this.#i=!1,this.#t=null,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0}))}#l=t=>{this.#i&&(this.#s?.contains(t.target)||this.contains(t.target)||this.#c())};#h=t=>{t.key==="Escape"&&this.#i&&this.#c()}};p("selection-menu",Pe);var ji=!1,Be=new Set,Ie=class extends m{#t=!1;#e=null;setup(){this.#t=!!this.closest("selection-menu");let t=document.createElement("button");t.type="button",t.setAttribute("aria-label",this.#t?"Add private note":"View notes");let e=document.createElement("icon-wc");e.setAttribute("name","sticky-note"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e),this.#t?t.addEventListener("click",()=>this.#i()):t.addEventListener("click",()=>this.#s()),this.appendChild(t),Be.add(this),ji||(ji=!0,document.addEventListener("highlights:request-note",Br))}teardown(){Be.delete(this),this.#o()}openFor(t,e){this.#n(t,e)}#i(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let i=e.target;i.hasAttribute("data-highlights-init")||i.setAttribute("data-highlights","");let s=M(i),n=s.getHighlights(),o=null;for(let a of n)if(e.text&&a.text&&e.text.includes(a.text.slice(0,20))){o=a;break}if(!o){s._createFromSelection("yellow");let a=s.getHighlights();o=a[a.length-1]}o&&this.#n(o,s),t.dismiss()}#s(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let i=M(e),s=i.getHighlights(),n=s.filter(o=>o.note);n.length>0?this.#n(n[0],i):s.length>0&&this.#n(s[0],i)}#n(t,e){this.#o();let i=e.element,s=document.createElement("div");s.className="hn-note-panel",s.setAttribute("role","dialog"),s.setAttribute("aria-label","Private note");let n=document.createElement("header");n.className="hn-note-header";let o=document.createElement("small");o.textContent="PRIVATE NOTE",n.appendChild(o),s.appendChild(n);let a=document.createElement("blockquote");a.className="hn-note-quote",a.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,s.appendChild(a);let l=document.createElement("textarea");l.className="hn-note-textarea",l.placeholder="Add a note\u2026",l.value=t.note||"",l.rows=3,l.setAttribute("aria-label","Note for highlighted text"),s.appendChild(l);let c=document.createElement("footer");c.className="hn-note-actions";let h=document.createElement("button");h.type="button",h.className="hn-action hn-action-save",h.textContent="Save",h.addEventListener("click",()=>{e._updateNote(t.id,l.value.trim()),this.#o()});let u=document.createElement("button");if(u.type="button",u.className="hn-action",u.textContent="Cancel",u.addEventListener("click",()=>this.#o()),c.append(h,u),s.appendChild(c),l.addEventListener("keydown",d=>{d.key==="Escape"&&(d.preventDefault(),this.#o()),d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),e._updateNote(t.id,l.value.trim()),this.#o())}),getComputedStyle(i).position==="static"&&(i.style.position="relative"),i.appendChild(s),typeof e.findHighlightRect=="function"){let d=e.findHighlightRect(t.id);if(d){let f=i.getBoundingClientRect();s.style.top=`${d.top-f.top}px`}}this.#e=s,requestAnimationFrame(()=>{l.focus(),document.addEventListener("pointerdown",this.#r)})}#r=t=>{this.#e&&!this.#e.contains(t.target)&&this.#o()};#o(){this.#e&&(document.removeEventListener("pointerdown",this.#r),this.#e.remove(),this.#e=null)}};function Br(r){let{highlight:t,controller:e}=r.detail||{};if(!t||!e)return;let i=Be.values().next().value;i&&i.openFor(t,e)}p("note-wc",Ie);var qe=class extends m{setup(){let t=document.createElement("button");t.type="button";let e=document.createElement("icon-wc");e.setAttribute("name","message-circle"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e);let i=this.closest("selection-menu")?.getAttribute("for"),s=this.closest("review-surface")||(i?document.querySelector(`review-surface[for="${i}"]`):null);s?(t.setAttribute("aria-label","Add comment"),t.addEventListener("click",()=>this.#t(s))):(t.setAttribute("aria-label","Comments not available"),t.style.opacity="0.4",t.setAttribute("title","Wrap content in <review-surface> to enable comments")),this.appendChild(t)}#t(t){let e=this.closest("selection-menu");if(!e)return;let i=e.getSelection();if(!i)return;let s=i.range.getBoundingClientRect(),n=t.getBoundingClientRect(),o=(s.left+s.width/2-n.left)/n.width*100,a=(s.top-n.top)/n.height*100;typeof t.addPin=="function"&&t.addPin({x:o,y:a,text:i.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:i.text,x:o,y:a},bubbles:!0})),e.dismiss()}};p("comment-wc",qe);var De='track[kind="chapters"][data-chapter-list]';function $i(r=document){r.querySelectorAll(De).forEach(t=>Oe(t))}function Oe(r){if(r.hasAttribute("data-chapter-list-init"))return;r.setAttribute("data-chapter-list-init","");let t=r.parentElement;if(!t||t.tagName!=="VIDEO")return;let e=r.track;e.mode==="disabled"&&(e.mode="hidden"),r.readyState>=2?Pi(t,e):r.addEventListener("load",()=>Pi(t,e),{once:!0})}function Pi(r,t){let e=t.cues;if(!e||e.length===0)return;let i=document.createElement("nav");i.setAttribute("aria-label","Video chapters"),i.classList.add("chapter-list");let s=document.createElement("ol");for(let o of e){let a=document.createElement("li"),l=document.createElement("button");l.type="button";let c=document.createElement("span");c.textContent=o.text;let h=document.createElement("time");h.textContent=Ir(o.startTime),h.setAttribute("datetime",qr(o.startTime)),l.appendChild(c),l.appendChild(h),l.addEventListener("click",()=>{r.currentTime=o.startTime,r.paused&&r.play()}),a.appendChild(l),s.appendChild(a)}i.appendChild(s),r.insertAdjacentElement("afterend",i);let n=null;r.addEventListener("timeupdate",()=>{let o=r.currentTime,a=-1;for(let l=0;l<e.length;l++)if(o>=e[l].startTime&&o<e[l].endTime){a=l;break}n&&n.removeAttribute("data-active"),a>=0?(n=s.children[a],n.setAttribute("data-active","")):n=null})}function Ir(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return t>0?`${t}:${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${e}:${String(i).padStart(2,"0")}`}function qr(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return`PT${t?t+"H":""}${e?e+"M":""}${i}S`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>$i()):$i();var Dr=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches?.(De)&&Oe(i),i.querySelectorAll?.(De).forEach(s=>Oe(s))}});Dr.observe(document.documentElement,{childList:!0,subtree:!0});var U="[data-command], [commandfor]",Or="Page Actions",T=new Map;function yt(r){if(T.has(r)||r.hasAttribute("data-command-init"))return;r.setAttribute("data-command-init","");let t=r.getAttribute("data-command")||r.textContent.trim();if(!t)return;let e=r.getAttribute("data-command-group")||Or,i=r.getAttribute("data-command-icon")||null,s=r.getAttribute("data-shortcut")||null,n=null;s&&(n=F(s,()=>r.click()));let o={element:r,label:t,group:e,icon:i,shortcut:s,unbind:n};T.set(r,o),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"add",entry:o}}))}function Fe(r){let t=T.get(r);t&&(t.unbind?.(),T.delete(r),r.removeAttribute("data-command-init"),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"remove",element:r}})))}function Fr(){let r=new Map;for(let t of T.values()){if(t.element.hidden||t.element.closest("[hidden]"))continue;let e=r.get(t.group)||[];e.push(t),r.set(t.group,e)}return r}function Bi(r=document){r.querySelectorAll(U).forEach(yt)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Bi()):Bi();var zr=new MutationObserver(r=>{for(let t of r){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(U)&&yt(i),i.querySelectorAll(U).forEach(yt)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;T.has(i)&&Fe(i),i.querySelectorAll(U).forEach(s=>{T.has(s)&&Fe(s)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.matches(U)&&!T.has(e)?yt(e):!e.matches(U)&&T.has(e)&&Fe(e)}}});zr.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-command","commandfor"]});function Hr(){let r='footer, aside, dialog, [hidden], [aria-hidden="true"]',e=[];return document.querySelectorAll("nav a[href]").forEach(i=>{if(i.closest(r)||T.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:s,group:"Navigation",icon:null,shortcut:null,auto:!0,action:null})}),document.querySelectorAll("h2[id], h3[id]").forEach(i=>{if(i.closest(r)||T.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:`Jump to: ${s}`,group:"On This Page",icon:null,shortcut:null,auto:!0,action:()=>i.scrollIntoView({behavior:"smooth"})})}),e}window.__commandRegistry={getRegisteredCommands:Fr,scanAutoDiscoverable:Hr};var Ur=window.matchMedia("(prefers-reduced-motion: reduce)");function Ii(){return Ur.matches||document.documentElement.hasAttribute("data-motion-reduced")}var qi=0,Vr=new Map([["vb-fade-in","entrance"],["vb-slide-up","entrance"],["vb-pop","entrance"],["vb-slide-in-ltr","entrance"],["vb-slide-in-rtl","entrance"],["vb-fade-slide-up","entrance"],["vb-shadow-lift","entrance"],["vb-fade-out","exit"],["vb-collapse","exit"],["vb-slide-out-ltr","exit"],["vb-slide-out-rtl","exit"],["vb-shake","attention"],["vb-pulse","attention"],["vb-bounce","attention"],["vb-blink","attention"],["vb-neon-pulse","decoration"],["vb-3d-shift","decoration"],["vb-outline-glow-pulse","decoration"],["vb-rainbow","decoration"],["vb-gradient-flow","decoration"],["vb-shimmer","decoration"],["vb-shimmer-gradient","decoration"],["vb-glow","decoration"],["vb-float","decoration"]]),y={_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_transitionCleanups:new WeakMap,_keyframePhase:Vr,_observer:null,_animationEndHandler:null,effect(r,t){this._effects.set(r,t),document.querySelectorAll("[data-effect]").forEach(e=>{(e.getAttribute("data-effect")||"").split(/\s+/).includes(r)&&this._initEffect(e,r)})},trigger(r,t){this._triggers.set(r,t)},transition(r,t){this._transitions.set(r,t)},uid(r){return r.id?r.id:(r._vbUid||(qi++,r._vbUid=`vb-${qi}`),r._vbUid)},theme(r,t){this._themes=this._themes||new Map,this._themes.set(r,t)},applyTheme(r,t=document.documentElement){let e=this._themes?.get(r);if(e)for(let[i,s]of Object.entries(e))t.style.setProperty(i,s)},swap(r){if(!document.startViewTransition){r(),queueMicrotask(()=>this._dispatchVtDone(document.body));return}let t=document.startViewTransition(r);return t.updateCallbackDone.then(()=>{this._dispatchVtDone(document.body)}).catch(()=>{}),t},_dispatchVtDone(r){r.querySelectorAll('[data-trigger~="vt"]').forEach(t=>{this.emit(t,"vb:vt-update-done",{})})},activate(r){this._activateEffects(r)},deactivate(r){r.hasAttribute("data-effect-active")&&(r.removeAttribute("data-effect-active"),this.emit(r,"vb:phase-change",{active:!1}))},onPhaseEnd(r,t,e){let i=s=>{s.detail?.phase===t&&e(s.detail)};return r.addEventListener("vb:effect-phase-end",i),()=>r.removeEventListener("vb:effect-phase-end",i)},registerKeyframe(r,t){this._keyframePhase.set(r,t)},observe(r=document){if(r.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),r.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),r.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{for(let i of e){if(i.type==="childList"){for(let s of i.addedNodes)s.nodeType===Node.ELEMENT_NODE&&this._processTree(s);for(let s of i.removedNodes)s.nodeType===Node.ELEMENT_NODE&&this._cleanupTree(s)}if(i.type==="attributes"){let s=i.target;i.attributeName==="data-effect"&&this._reconcileEffects(s),i.attributeName==="data-trigger"&&this._reconcileTrigger(s),i.attributeName==="data-stagger"&&this._processStagger(s),i.attributeName==="data-transition"&&this._processTransition(s)}}});let t=r===document?document.body:r;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]}),this._animationEndHandler||(this._animationEndHandler=e=>{let i=e.target;if(!(i instanceof Element)||!i.hasAttribute("data-effect"))return;let s=this._keyframePhase.get(e.animationName);s&&this.emit(i,"vb:effect-phase-end",{phase:s,animationName:e.animationName})},document.addEventListener("animationend",this._animationEndHandler))},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null),this._animationEndHandler&&(document.removeEventListener("animationend",this._animationEndHandler),this._animationEndHandler=null)},params(r){let t=getComputedStyle(r);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();return s?parseFloat(s):i},getTime(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();if(!s)return i;let n=parseFloat(s);return Number.isFinite(n)?/s\s*$/.test(s)&&!/ms\s*$/.test(s)?n*1e3:n:i},hasClass(e){return r.classList.contains(e)}}},emit(r,t,e={}){r.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:Ii,_processTree(r){r.hasAttribute?.("data-effect")&&this._processElement(r),r.hasAttribute?.("data-stagger")&&this._processStagger(r),r.hasAttribute?.("data-transition")&&this._processTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),r.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(r){r.hasAttribute?.("data-effect")&&this._cleanupElement(r),r.hasAttribute?.("data-transition")&&this._cleanupTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(r){if(r.hasAttribute("data-effect-processed"))return;r.setAttribute("data-effect-processed","");let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(r,e);this._wireTrigger(r,t)},_initEffect(r,t){let e=this._effects.get(t);if(!e)return;let i=this._instances.get(r);if(i?.has(t))return;Ii();let s=e(r);s&&(i||(i=new Map,this._instances.set(r,i)),typeof s=="function"?i.set(t,{cleanup:s}):i.set(t,s))},_wireTrigger(r,t){let e=r.getAttribute("data-trigger");if(!e){this._activateEffects(r);return}let i=e.split(/\s+/).filter(Boolean);for(let s of i){let n=s.indexOf(":"),o=n>-1?s.slice(0,n):s,a=n>-1?s.slice(n+1):null,l=this._triggers.get(o);if(!l)continue;let c=l(r,()=>this._activateEffects(r),a);if(c){let h=this._triggerCleanups.get(r);if(h){let u=h;this._triggerCleanups.set(r,()=>{u(),c()})}else this._triggerCleanups.set(r,c)}}},_activateEffects(r){r.setAttribute("data-effect-active",""),this.emit(r,"vb:phase-change",{active:!0});let t=this._instances.get(r);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(r){let t=this._instances.get(r);if(t){for(let[,i]of t)i.cleanup&&i.cleanup();this._instances.delete(r)}let e=this._triggerCleanups.get(r);e&&(e(),this._triggerCleanups.delete(r))},_reconcileEffects(r){let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(r);if(e)for(let[i,s]of e)t.includes(i)||(s.cleanup&&s.cleanup(),e.delete(i));for(let i of t)e?.has(i)||this._initEffect(r,i);r.hasAttribute("data-effect-processed")||(r.setAttribute("data-effect-processed",""),this._wireTrigger(r,t))},_reconcileTrigger(r){let t=this._triggerCleanups.get(r);t&&(t(),this._triggerCleanups.delete(r));let e=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(r,e)},_processStagger(r){let t=r.getAttribute("data-stagger")||"",e=r.children,i=e.length,s;if(t==="reverse")s=Array.from({length:i},(n,o)=>i-1-o);else if(t==="random"){let n=this._hashString(this.uid(r));s=Array.from({length:i},(a,l)=>l);let o=n;for(let a=i-1;a>0;a--){o^=o<<13,o^=o>>>17,o^=o<<5;let l=Math.abs(o)%(a+1);[s[a],s[l]]=[s[l],s[a]]}}else if(t==="grid"){let n=[];for(let o=0;o<i;o++){let a=getComputedStyle(e[o]),l=parseInt(a.gridRowStart,10),c=parseInt(a.gridColumnStart,10);n.push({i:o,dist:Number.isFinite(l)&&Number.isFinite(c)?l-1+(c-1):o})}n.sort((o,a)=>o.dist-a.dist),s=new Array(i),n.forEach((o,a)=>{s[o.i]=a})}else s=Array.from({length:i},(n,o)=>o);for(let n=0;n<i;n++)e[n].style.setProperty("--vb-stagger-index",String(s[n]))},_hashString(r){let t=5381;for(let e=0;e<r.length;e++)t=(t<<5)+t^r.charCodeAt(e);return t|0},_processTransition(r){if(r.hasAttribute("data-transition-processed"))return;r.setAttribute("data-transition-processed","");let t=r.getAttribute("data-transition");if(!t)return;let e=t.indexOf(":"),i=e>-1?t.slice(0,e):t,s=e>-1?t.slice(e+1):null,n=this._transitions.get(i);if(n){let o=n(r,s);o&&this._transitionCleanups.set(r,o)}else r.style.viewTransitionName=`${t}-${this.uid(r)}`},_cleanupTransition(r){let t=this._transitionCleanups.get(r);t&&(t(),this._transitionCleanups.delete(r)),r.style.viewTransitionName=""}};typeof window<"u"&&(window.VB=y);y.effect("glitch",r=>{r.hasAttribute("data-effect-glitch-init")||(r.setAttribute("data-effect-glitch-init",""),r.setAttribute("data-glitch-text",r.textContent))});function Wr(r){let t=r.textContent;r.setAttribute("aria-label",t),r.innerHTML="",t.split(/(\s+)/).forEach((i,s)=>{if(/^\s+$/.test(i)){r.appendChild(document.createTextNode(i));return}let n=document.createElement("span");n.className="vb-blur-chunk",n.textContent=i,n.style.setProperty("--i",String(Math.floor(s/2))),n.setAttribute("aria-hidden","true"),r.appendChild(n)})}function Gr(r){let t=r.textContent;r.setAttribute("aria-label",t);let e=t.split(/\s+/).filter(Boolean),i=[],s="",n=r.offsetWidth,o=document.createElement("span");o.style.visibility="hidden",o.style.position="absolute",o.style.font=getComputedStyle(r).font,document.body.appendChild(o),e.forEach(a=>{let l=s?s+" "+a:a;o.textContent=l,o.offsetWidth>n&&s?(i.push(s),s=a):s=l}),s&&i.push(s),document.body.removeChild(o),i.length===0&&i.push(t),r.innerHTML="",i.forEach((a,l)=>{let c=document.createElement("span");c.className="vb-blur-chunk",c.textContent=a,c.style.setProperty("--i",String(l)),c.setAttribute("aria-hidden","true"),r.appendChild(c),l<i.length-1&&r.appendChild(document.createTextNode(" "))})}y.effect("blur-reveal",r=>{if(r.hasAttribute("data-effect-blur-reveal-init")||(r.setAttribute("data-effect-blur-reveal-init",""),y.prefersReducedMotion()))return;let t=r.classList.contains("line")?"line":"word",e=y.params(r).get("blur-reveal-delay")||"80ms";return r.style.setProperty("--blur-delay",e),t==="line"?Gr(r):Wr(r),{activate(){r.setAttribute("data-effect-active","")},cleanup(){}}});function Kr(r,t,e,i){let s=0;function n(){s<=t.length?(r.firstChild.textContent=t.slice(0,s),s++,setTimeout(n,e)):i&&i()}n()}function Xr(r,t,e){let i=r.firstChild.textContent,s=i.length;function n(){s>=0?(r.firstChild.textContent=i.slice(0,s),s--,setTimeout(n,t/2)):e&&e()}n()}function Jr(r){let t=r.getAttribute("data-typewriter-text"),e=y.params(r),i=e.getTime("typewriter-speed",50),s=e.getTime("typewriter-delay",0),o=r.classList.contains("loop")?2e3:null;r.textContent="";let a=document.createTextNode("");if(r.appendChild(a),!r.classList.contains("no-cursor")){let h=document.createElement("span");h.className="vb-typewriter-cursor",h.textContent="|",h.setAttribute("aria-hidden","true"),r.appendChild(h)}function c(){Kr(r,t,i,()=>{o!==null&&setTimeout(()=>{Xr(r,i,()=>{setTimeout(c,400)})},o)})}setTimeout(c,s)}y.effect("typewriter",r=>{if(r.hasAttribute("data-effect-typewriter-init"))return;r.setAttribute("data-effect-typewriter-init","");let t=r.textContent.trim();if(r.setAttribute("data-typewriter-text",t),r.setAttribute("aria-label",t),!y.prefersReducedMotion())return r.textContent="",{activate(){Jr(r)},cleanup(){}}});var Di="!<>-_\\/[]{}=+*^?#";function Oi(r){return r[Math.floor(Math.random()*r.length)]}function Yr(r){let t=r.getAttribute("data-scramble-text"),e=y.params(r),i=e.getTime("scramble-duration",1500),s=e.get("scramble-chars")||Di,n=e.getTime("scramble-speed",30),o=t.length,a=0,l=Math.ceil(i/n);function c(){let h=a/l,u=Math.floor(h*o),d="";for(let f=0;f<o;f++)f<u?d+=t[f]:t[f]===" "?d+=" ":d+=Oi(s);r.textContent=d,a++,a<=l?setTimeout(c,n):r.textContent=t}c()}y.effect("scramble",r=>{if(r.hasAttribute("data-effect-scramble-init"))return;r.setAttribute("data-effect-scramble-init","");let t=r.textContent.trim();if(r.setAttribute("data-scramble-text",t),r.setAttribute("aria-label",t),y.prefersReducedMotion())return;let e=y.params(r).get("scramble-chars")||Di;return r.textContent=t.replace(/\S/g,()=>Oi(e)),{activate(){Yr(r)},cleanup(){}}});y.effect("animate-image",r=>{if(r.hasAttribute("data-effect-animate-image-init"))return;r.setAttribute("data-effect-animate-image-init","");let t=r,e=document.createElement("div");if(e.className="animate-image-wrapper",!t.parentNode)return;t.parentNode.insertBefore(e,t),e.appendChild(t);let i=document.createElement("button");i.type="button",i.className="animate-image-toggle",i.setAttribute("aria-label","Pause animation"),e.appendChild(i);let s=t.src,n=null,o=!1;function a(){let u=document.createElement("canvas");u.width=t.naturalWidth||t.width,u.height=t.naturalHeight||t.height;let d=u.getContext("2d");if(d){d.drawImage(t,0,0);try{n=u.toDataURL("image/png")}catch{n=null}}}function l(){o||(o=!0,t.setAttribute("data-animate-image-paused",""),i.setAttribute("aria-label","Play animation"),i.classList.add("paused"),n&&(t.src=n))}function c(){o&&(o=!1,t.removeAttribute("data-animate-image-paused"),i.setAttribute("aria-label","Pause animation"),i.classList.remove("paused"),t.src=s)}i.addEventListener("click",()=>o?c():l()),t.complete&&t.naturalWidth?a():t.addEventListener("load",a,{once:!0});let h=window.matchMedia("(prefers-reduced-motion: reduce)");return(h.matches||document.documentElement.dataset.motionReduced!==void 0)&&(t.complete?(a(),l()):t.addEventListener("load",()=>{a(),l()},{once:!0})),h.addEventListener("change",u=>{u.matches&&l()}),t.hasAttribute("data-animate-image-paused")&&(t.complete?(a(),o=!1,l()):t.addEventListener("load",()=>{a(),o=!1,l()},{once:!0})),{cleanup(){e.parentNode&&(e.parentNode.insertBefore(t,e),e.remove())}}});var wt=new Map,ze=null,kt=!1;function Zr(r){for(let[t,e]of wt)r.querySelectorAll(t).forEach(e)}function Qr(r){if(r.nodeType!==Node.ELEMENT_NODE)return;let t=r;for(let[e,i]of wt)t.matches(e)&&i(t),t.querySelectorAll(e).forEach(i)}function tn(){ze||(ze=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes)Qr(e)}),ze.observe(document.documentElement,{childList:!0,subtree:!0}))}function en(){kt||(kt=!0,Zr(document))}function Fi(r,t){wt.set(r,t),tn(),kt||document.readyState!=="loading"?(kt=!0,document.querySelectorAll(r).forEach(t)):wt.size===1&&document.addEventListener("DOMContentLoaded",en)}var xt=null;async function sn(){if(xt)return;xt=(await Promise.resolve().then(()=>(jt(),Rt))).resolveEmoji}var rn="[data-emoji]",j=/:([a-z0-9_+-]+):/g,nn=new Set(["SCRIPT","STYLE","CODE","PRE","TEXTAREA"]),on=new Set(["INPUT","TEXTAREA"]),an=100;function ln(r){if(r.hasAttribute("data-emoji-init"))return;if(r.setAttribute("data-emoji-init",""),on.has(r.tagName)){cn(r);return}let t=r.getAttribute("data-emoji-unknown")||"keep";if(zi(r,t),r.getAttribute("data-emoji-scan")==="observe"){let e=null;new MutationObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{zi(r,t),e=null},an)}).observe(r,{childList:!0,subtree:!0,characterData:!0})}}function cn(r){let t=!1;r.addEventListener("compositionstart",()=>{t=!0}),r.addEventListener("compositionend",()=>{t=!1,He(r)}),r.addEventListener("input",()=>{t||He(r)}),r.value&&j.test(r.value)&&(j.lastIndex=0,He(r))}function He(r){let t=r.value;j.lastIndex=0;let e,i="",s=0,n=0,o=r.selectionStart??t.length,a=!1;for(;(e=j.exec(t))!==null;){let c=e[0],h=e[1],u=xt(h);if(i+=t.slice(s,e.index),u){i+=u.emoji,a=!0;let d=e.index+c.length;o>=d?n+=c.length-u.emoji.length:o>e.index&&(n+=o-e.index-u.emoji.length)}else i+=c;s=e.index+c.length}if(!a)return;i+=t.slice(s),r.value=i;let l=Math.max(0,o-n);r.setSelectionRange(l,l)}function zi(r,t){let e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(s){let n=s.parentElement;return!n||nn.has(n.tagName)||n.isContentEditable||n.hasAttribute("data-emoji-processed")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];for(;e.nextNode();)j.test(e.currentNode.textContent??"")&&i.push(e.currentNode),j.lastIndex=0;for(let s of i)hn(s,t)}function hn(r,t){let e=r.textContent;j.lastIndex=0;let i,s=0,n=[],o=!1;for(;(i=j.exec(e))!==null;){let a=i[1],l=xt(a);i.index>s&&n.push(e.slice(s,i.index)),l?(n.push(l.emoji),o=!0):t==="strip"?o=!0:n.push(i[0]),s=i.index+i[0].length}o&&(s<e.length&&n.push(e.slice(s)),r.textContent=n.join(""))}function un(r){sn().then(()=>ln(r))}Fi(rn,un);
|
|
1167
|
+
${r}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),Ee="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function E(r){return encodeURIComponent(r)}var Se=class extends m{#t;#e;#i;#s="";#n=null;#r=null;get url(){return this.#t}set url(t){this.#t=t}get title(){return this.#e??""}set title(t){this.#e=t}get text(){return this.#i}set text(t){this.#i=t}setup(){if(this.#o(),this.#a(),this.closest("selection-menu")){this.#c(),this.setAttribute("data-tier-resolved","selection");return}this.#s==="native"?this.#l():this.#s==="hidden"?this.style.display="none":this.children.length>0?this.#f():this.#h(),this.setAttribute("data-tier-resolved",this.#s)}teardown(){this.removeAttribute("data-tier-resolved"),this.#n&&(clearTimeout(this.#n),this.#n=null),this.#r&&(this.#r.removeEventListener("click",this.#u),this.#r.remove(),this.#r=null),this.querySelector(".share-trigger")?.remove()}async share(){this.#s==="native"&&await this.#p()}#o(){this.#t=this.getAttribute("url")||document.querySelector('link[rel="canonical"]')?.getAttribute("href")||location.href,this.#e=this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title,this.#i=this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||""}#a(){let t=this.getAttribute("tier");if(t==="platforms"||t==="native"){t==="native"&&!navigator.share?this.#s="hidden":this.#s=t;return}if((this.getAttribute("platforms")||Ee)==="native-only"){this.#s=typeof navigator.share=="function"?"native":"hidden";return}this.#s=typeof navigator.share=="function"?"native":"platforms"}#c(){let t=document.createElement("button");t.type="button",t.setAttribute("aria-label","Share selection");let e=document.createElement("icon-wc");e.setAttribute("name","share-2"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e),t.addEventListener("click",()=>{let i=this.closest("selection-menu"),n=i?.getSelection?.()?.text||window.getSelection()?.toString()||"";n&&navigator.share?navigator.share({text:`"${n}" \u2014 ${location.href}`}).catch(()=>{}):n&&Y(`"${n}" \u2014 ${location.href}`,{button:t,announceMessage:"Selection copied"}),i?.dismiss?.()}),this.appendChild(t)}#l(){let t=this.getAttribute("label")||"Share",e=document.createElement("button");e.type="button",e.className="share-trigger",e.setAttribute("aria-label","Share this page"),e.innerHTML=`<icon-wc name="share-2" size="sm" aria-hidden="true"></icon-wc><span class="share-label">${t}</span>`,e.addEventListener("click",this.#d),this.appendChild(e)}#h(){let t=(this.getAttribute("platforms")||Ee).split(",").map(e=>e.trim()).filter(Boolean);this.#r=document.createElement("nav"),this.#r.setAttribute("aria-label","Share this page");for(let e of t){let i=Ae.get(e);if(!i)continue;let s=document.createElement("button");s.type="button",s.dataset.platform=e,s.setAttribute("aria-label",e==="copy"?"Copy link":`Share on ${i.label}`);let n=i.iconSet?` set="${i.iconSet}"`:"";s.innerHTML=`<icon-wc name="${i.iconName}" size="sm"${n} aria-hidden="true"></icon-wc><span class="share-label">${i.label}</span>`,this.#r.appendChild(s)}this.#r.addEventListener("click",this.#u),this.appendChild(this.#r)}#f(){if(this.querySelector("nav"))this.#r=this.querySelector("nav");else{let i=document.createElement("nav");for(i.setAttribute("aria-label","Share this page");this.firstChild;)i.appendChild(this.firstChild);this.appendChild(i),this.#r=i}let t=this.querySelectorAll("a[data-platform]");for(let i of t){let s=i.getAttribute("href")||"";i.setAttribute("href",s.replace(/\{url\}/g,encodeURIComponent(this.#t||"")).replace(/\{title\}/g,encodeURIComponent(this.#e||"")).replace(/\{text\}/g,encodeURIComponent(this.#i||"")))}let e=this.querySelectorAll('[data-platform="copy"]');for(let i of e)i.addEventListener("click",this.#b);this.#r.addEventListener("click",this.#u)}#d=async()=>{await this.#p()};async#p(){let t={url:this.#t||"",title:this.#e||"",text:this.#i||""};this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(t))throw new Error("Payload not shareable");await navigator.share(t),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0}))}catch(e){e.name!=="AbortError"&&this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:e},bubbles:!0}))}}#u=t=>{let e=t.target.closest("[data-platform]");if(!e)return;let i=e.dataset.platform;if(i==="copy"){this.#b(t,e);return}if(e.tagName==="A"||!i)return;let s=Ae.get(i);if(!s)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:i},bubbles:!0}));let n={url:this.#t||"",title:this.#e||"",text:this.#i||""};if(i==="email")location.href=s.buildUrl(n);else if(i==="mastodon"){let o=this.getAttribute("mastodon-instance")||"mastodon.social",a=s.buildUrl(n,o);window.open(a,"_blank","noopener,noreferrer")}else window.open(s.buildUrl(n),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:i},bubbles:!0}))};#b=async(t,e)=>{let i=e||t?.target?.closest('[data-platform="copy"]');if(!i)return;if(!await Y(this.#t||"",{button:i,announceMessage:"Link copied to clipboard",duration:2e3})){this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy"},bubbles:!0}));return}let n=i.querySelector(".share-label"),o=n?.textContent;n&&(n.textContent="Copied!"),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0})),this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>{n&&o&&(n.textContent=o),this.#n=null},2e3)}};p("share-wc",Se);var Cr="Home",Ce=class extends m{#t={};setup(){this.hasAttribute("role")||this.setAttribute("role","navigation"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Breadcrumb"),this.hasAttribute("data-from-pathname")?this.#e():this.#s(),this.#n(),this.#r()}get labels(){return{...this.#t}}set labels(t){!t||typeof t!="object"||(this.#t={...t},this.hasAttribute("data-from-pathname")&&(this.#e(),this.#n(),this.#r()))}#e(){let e=window.location.pathname.split("/").filter(Boolean),i=document.createElement("ol"),s=document.createElement("li"),n=document.createElement("a");n.href="/",n.textContent=this.#t["/"]||this.#t.home||Cr,s.appendChild(n),i.appendChild(s);let o="";e.forEach((l,c)=>{o+=`/${l}`;let h=c===e.length-1,u=document.createElement("li"),d=`${o}/`,f=this.#t[d]||this.#t[o]||this.#t[l]||h&&this.dataset.currentLabel||this.#i(l);if(h){let g=document.createElement("span");g.setAttribute("aria-current","page"),g.textContent=f,u.appendChild(g)}else{let g=document.createElement("a");g.href=d,g.textContent=f,u.appendChild(g)}i.appendChild(u)});let a=this.querySelector(":scope > ol");a?a.replaceWith(i):this.prepend(i)}#i(t){return t.replace(/[-_]+/g," ").replace(/\w\S*/g,e=>e[0].toUpperCase()+e.slice(1))}#s(){if(this.querySelector(":scope > ol"))return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(e.length===0)return;let i=document.createElement("ol");e.forEach(s=>{let n=document.createElement("li");n.appendChild(s),i.appendChild(n)}),this.prepend(i)}#n(){let t=this.querySelectorAll(":scope > ol > li");t.length!==0&&t.forEach((e,i)=>{let s=i===t.length-1,n=e.querySelector("a, span");n&&(s?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"))})}#r(){if(this.dataset.jsonld==="off")return;let t=Array.from(this.querySelectorAll(":scope > ol > li"));if(t.length===0)return;let i={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((n,o)=>{let a=n.querySelector("a, span"),l=a?.textContent?.trim()||"",c=a?.getAttribute("href"),h=c?new URL(c,window.location.origin).href:void 0;return{"@type":"ListItem",position:o+1,name:l,...h?{item:h}:{}}})},s=this.querySelector(':scope > script[type="application/ld+json"]');s||(s=document.createElement("script"),s.type="application/ld+json",this.appendChild(s)),s.textContent=JSON.stringify(i)}};p("bread-crumb",Ce);var Le="[data-highlights]",_i="highlights",Tr=["yellow","green","blue","pink"];var _r=typeof CSS<"u"&&"highlights"in CSS;function Li(r){let t=2166136261;for(let e=0;e<r.length;e++)t^=r.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Lr(){return"hn-"+crypto.randomUUID().slice(0,8)}function Mr(r,t){return getComputedStyle(r).getPropertyValue(`--highlight-${t}`).trim()}var D=null,st=0;function Nr(r){if(D){st++;return}D=new CSSStyleSheet;let t=r.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(`
|
|
1168
|
+
`);D.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,D],st=1}function Rr(){st--,st<=0&&D&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r!==D),D=null,st=0)}var R=null;function Te(r){R||(R=document.createElement("div"),R.setAttribute("aria-live","polite"),R.setAttribute("aria-atomic","true"),R.className="hn-sr-only",document.body.appendChild(R)),R.textContent="",requestAnimationFrame(()=>{R.textContent=r})}function Mi(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0;for(;i.nextNode();){if(i.currentNode===t)return s+e;s+=(i.currentNode.textContent??"").length}return-1}function H(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0,n=null,o=0,a=null,l=0;for(;i.nextNode();){let c=i.currentNode,h=(c.textContent??"").length;if(!n&&s+h>t&&(n=c,o=t-s),s+h>=e){a=c,l=e-s;break}s+=h}if(!n||!a)return null;try{let c=document.createRange();return c.setStart(n,Math.min(o,(n.textContent??"").length)),c.setEnd(a,Math.min(l,(a.textContent??"").length)),c}catch{return null}}var Me=class{#t;#e;#i;#s;#n=[];#r=!_r;#o;#a;#c=!1;#l=[];constructor(t){this.#t=t,this.#s=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#e=e&&e!==""?e:location.pathname;let i=t.dataset.highlightsColors;this.#i=i?i.split(",").map(s=>s.trim()).filter(Boolean):[...Tr],this.#r||Nr(this.#i),this.#b(),this.#s||(this.#o=this.#h.bind(this),this.#a=this.#f.bind(this),t.addEventListener("pointerup",this.#o),t.addEventListener("click",this.#a)),t.setAttribute("data-highlights-init",""),this.#p().then(()=>{this.#c||this.#b()})}get colors(){return[...this.#i]}get element(){return this.#t}getHighlights(){return this.#n.map(t=>({...t}))}removeHighlight(t){let e=this.#n.findIndex(i=>i.id===t);e<0||(this.#n.splice(e,1),this.#u(),this.#b(),this.#y("highlights:removed",{id:t}),Te("Highlight removed"))}clearAll(){this.#n=[],this.#u(),this.#b()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#n})}importHighlights(t){try{let e=typeof t=="string"?JSON.parse(t):t;if(!e.highlights||!Array.isArray(e.highlights))return;this.#n=e.highlights,this.#u(),this.#b()}catch{}}destroy(){if(!this.#c){if(this.#c=!0,this.#o&&this.#t.removeEventListener("pointerup",this.#o),this.#a&&this.#t.removeEventListener("click",this.#a),this.#r)this.#t.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}`);Rr()}this.#g(),this.#t.removeAttribute("data-highlights-init")}}#h(){requestAnimationFrame(()=>{if(this.#c)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);this.#t.contains(e.commonAncestorContainer)&&this.#y("highlights:selected",{text:t.toString().trim(),rect:e.getBoundingClientRect()})})}#f(t){let e=t.target.closest?.(".hn-margin-annotation");if(e){let s=e.dataset.hnId,n=this.#n.find(o=>o.id===s);if(n){this.#y("highlights:clicked",{id:s,highlight:{...n}}),this.#y("highlights:request-note",{id:s,highlight:{...n},controller:this});return}}let i=t.target.closest?.("mark[data-hn-id]");if(i){let s=i.dataset.hnId,n=this.#n.find(o=>o.id===s);if(n){this.#y("highlights:clicked",{id:s,highlight:{...n}});return}}if(!this.#r){let s=this.#d(t.clientX,t.clientY);s&&this.#y("highlights:clicked",{id:s.id,highlight:{...s}})}}findHighlightRect(t){let e=this.#n.find(n=>n.id===t);if(!e)return null;let i=H(this.#t,e.startOffset,e.endOffset);if(!i)return null;let s=i.getClientRects();return s.length?s[0]:null}#d(t,e){for(let i of this.#n){let s=H(this.#t,i.startOffset,i.endOffset);if(!s)continue;let n=s.getClientRects();for(let o of n)if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)return i}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let i=e.getRangeAt(0);if(!this.#t.contains(i.commonAncestorContainer))return;let s=Mi(this.#t,i.startContainer,i.startOffset),n=Mi(this.#t,i.endContainer,i.endOffset);if(s<0||n<0||s>=n)return;let o=e.toString().trim(),a={id:Lr(),startOffset:s,endOffset:n,text:o,color:t,note:"",created:Date.now()};this.#n.push(a),this.#u(),this.#b(),e.removeAllRanges(),this.#y("highlights:added",{id:a.id,text:o,color:t,note:""}),Te("Highlight added")}_changeColor(t,e){let i=this.#n.find(s=>s.id===t);i&&(i.color=e,this.#u(),this.#b())}_updateNote(t,e){let i=this.#n.find(s=>s.id===t);i&&(i.note=e,this.#u(),this.#v(),this.#y("highlights:note-changed",{id:t,note:e}),Te("Note saved"))}async#p(){let t=await A.get(_i,this.#e);if(!t||!Array.isArray(t.highlights))return;let e=Li(this.#t.textContent);t.contentHash&&t.contentHash!==e?(this.#n=t.highlights.filter(i=>{let s=H(this.#t,i.startOffset,i.endOffset);return s?s.toString().trim()===i.text:!1}),this.#u()):this.#n=t.highlights}#u(){let t={version:1,contentHash:Li(this.#t.textContent),highlights:this.#n};A.set(_i,this.#e,t).catch(()=>{})}#b(){this.#r?this.#m():this.#w(),this.#v()}#w(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#n){let i=H(this.#t,e.startOffset,e.endOffset);i&&t.has(e.color)&&t.get(e.color).push(i)}for(let[e,i]of t){let s=`hn-${e}`;i.length===0?CSS.highlights.delete(s):CSS.highlights.set(s,new Highlight(...i))}}#m(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let i=e.parentNode;for(;e.firstChild;)i.insertBefore(e.firstChild,e);i.removeChild(e)}),this.#t.normalize();let t=[...this.#n].sort((e,i)=>i.startOffset-e.startOffset);for(let e of t){let i=H(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=Mr(this.#t,e.color),n=document.createElement("mark");n.dataset.hnId=e.id,n.dataset.hnColor=e.color,s&&(n.style.backgroundColor=s,n.style.textDecorationColor=s);try{i.surroundContents(n)}catch{let o=i.extractContents();n.appendChild(o),i.insertNode(n)}}}#g(){for(let t of this.#l)t.remove();this.#l=[]}#v(){if(this.#g(),this.#n.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");for(let e of this.#n){let i=H(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=i.getClientRects();if(s.length===0)continue;let n=s[0],o=this.#t.getBoundingClientRect(),a=n.top-o.top,l=document.createElement("span");l.className="hn-margin-annotation",l.dataset.hnId=e.id,l.setAttribute("aria-hidden","true"),l.style.top=`${a}px`,e.note?(l.innerHTML='<span class="hn-note-indicator">*</span> You highlighted',l.classList.add("hn-has-note")):l.textContent="You highlighted",this.#t.appendChild(l),this.#l.push(l)}}#y(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}},_e=new WeakMap;function M(r){if(_e.has(r))return _e.get(r);let t=new Me(r);return _e.set(r,t),t}function Ni(r=document){r.querySelectorAll(Le).forEach(t=>{t.hasAttribute("data-highlights-init")||M(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Ni()):Ni();var jr=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(Le)&&M(i),i.querySelectorAll(Le).forEach(s=>{s.hasAttribute("data-highlights-init")||M(s)})}});jr.observe(document.documentElement,{childList:!0,subtree:!0});var $r=["yellow","green","blue","pink"],Ne=class extends m{#t=null;#e="yellow";#i=!1;#s=null;setup(){this.#i=!!this.closest("selection-menu"),this.#i?this.#n():this.#a()}teardown(){this.#t?.destroy(),this.#t=null,this.#s?.remove(),this.#s=null}#n(){let t=this.#l(),e=document.createElement("button");e.type="button",e.setAttribute("aria-label","Highlight selection");let i=document.createElement("icon-wc");i.setAttribute("name","highlighter"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i),e.addEventListener("click",n=>{n.stopPropagation(),this.#r()}),this.appendChild(e),this.#s=document.createElement("div"),this.#s.className="highlight-color-dropdown",this.#s.setAttribute("role","group"),this.#s.setAttribute("aria-label","Highlight color"),this.#s.hidden=!0;let s=this.#s;t.forEach(n=>{let o=document.createElement("button");o.type="button",o.className="highlight-color-swatch",o.dataset.color=n,o.setAttribute("aria-label",`${n}`),o.setAttribute("aria-pressed",n===this.#e?"true":"false"),o.style.backgroundColor=`var(--highlight-${n})`,o.addEventListener("click",a=>{a.stopPropagation(),this.#e=n,s.querySelectorAll(".highlight-color-swatch").forEach(l=>l.setAttribute("aria-pressed",l.dataset.color===n?"true":"false")),s.hidden=!0,this.#o()}),s.appendChild(o)}),this.appendChild(s)}#r(){this.#s&&(this.#s.hidden=!this.#s.hidden)}#o(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection?.();if(!e)return;let i=e.target;if(i.hasAttribute("data-highlights-init"))this.#t||(this.#t=M(i));else{let s=this.getAttribute("storage-key")||"";i.setAttribute("data-highlights",s),this.hasAttribute("colors")&&i.setAttribute("data-highlights-colors",this.getAttribute("colors")??""),this.#t=M(i)}this.#t?._createFromSelection(this.#e),t.dismiss?.()}#a(){let t=this.#c();if(!t)return!1;let e=this.getAttribute("storage-key")||"";return t.setAttribute("data-highlights",e),this.hasAttribute("colors")&&t.setAttribute("data-highlights-colors",this.getAttribute("colors")??""),this.hasAttribute("readonly")&&t.setAttribute("data-highlights-readonly",""),this.#t=M(t),!0}#c(){let t=this.getAttribute("for");return t?document.getElementById(t):this.firstElementChild}#l(){let t=this.getAttribute("colors");return t?t.split(",").map(e=>e.trim()).filter(Boolean):[...$r]}getHighlights(){return this.#t?.getHighlights()??[]}removeHighlight(t){this.#t?.removeHighlight(t)}clearAll(){this.#t?.clearAll()}exportHighlights(){return this.#t?.exportHighlights()??'{"version":1,"highlights":[]}'}importHighlights(t){this.#t?.importHighlights(t)}};p("highlight-wc",Ne);var Re=CSS.supports("anchor-name","--x"),Pr=CSS.supports("position-area","bottom"),Br=0,je=class extends m{#t=null;#e=null;#i=null;#s=null;setup(){this.id||(this.id=`pop-over-${++Br}`);let t=this.dataset.mode||"auto";this.hasAttribute("popover")||this.setAttribute("popover",t),this.#n(),this.#r(),this.#i=e=>{let i=e.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${i}`,{detail:{state:e.newState},bubbles:!0,composed:!0})),!Re&&e.newState==="open"&&this.#t&&this.#a()},this.listen(this,"beforetoggle",this.#i),Re||(this.#s=()=>{this.matches(":popover-open")&&this.#t&&this.#a()},this.listen(window,"resize",this.#s),this.listen(window,"scroll",this.#s,{capture:!0,passive:!0}))}show(){this.matches(":popover-open")||this.showPopover()}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#n(){let t=this.dataset.anchor;t?this.#t=document.getElementById(t)||document.querySelector(t):this.#t=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#r(){if(!(!this.#t||!Re)&&(this.#e=`--pop-over-anchor-${this.id}`,this.#t.style.setProperty("anchor-name",this.#e),this.style.setProperty("position-anchor",this.#e),this.setAttribute("data-anchor-name",this.#e||""),!Pr)){let t=this.dataset.position||"bottom";this.#o(t)}}#o(t){let e="var(--_pop-over-offset, var(--size-xs))",i={top:{bottom:`calc(anchor(top) + ${e})`,left:"anchor(left)"},bottom:{top:`calc(anchor(bottom) + ${e})`,left:"anchor(left)"},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},s=t.split("-")[0],n=i[s]||i.bottom;Object.entries(n).forEach(([o,a])=>this.style.setProperty(o,a))}#a(){if(!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#c(),s,n;switch(e.split("-")[0]){case"top":s=t.top-this.offsetHeight-i,n=t.left;break;case"left":s=t.top,n=t.left-this.offsetWidth-i;break;case"right":s=t.top,n=t.right+i;break;default:s=t.bottom+i,n=t.left;break}e.endsWith("-end")&&(e.startsWith("top")||e.startsWith("bottom")?n=t.right-this.offsetWidth:s=t.bottom-this.offsetHeight),this.style.position="fixed",this.style.top=`${Math.round(s)}px`,this.style.left=`${Math.round(n)}px`,this.style.margin="0"}#c(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset]??t.xs}};p("pop-over",je);var Ri=8,$e=8,Ir=0,Pe=class extends m{#t=null;#e=new Set;#i=!1;#s;setup(){let t=this.querySelector(":scope > pop-over[data-selection-menu-host]");if(t)this.#s=t;else{this.#s=document.createElement("pop-over"),this.#s.setAttribute("data-selection-menu-host",""),this.#s.dataset.mode="manual",this.#s.id=`selection-menu-${++Ir}`;let e=[...this.children];for(let i of e)i!==this.#s&&this.#s.appendChild(i);this.appendChild(this.#s)}this.hidden=!1,this.#n(),this.listen(document,"pointerup",this.#r),this.listen(document,"pointerdown",this.#l),this.listen(document,"keydown",this.#h),this.id&&new MutationObserver(()=>this.#n()).observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]})}getSelection(){return this.#t?{...this.#t}:null}dismiss(){this.#c()}get actions(){return[...(this.#s||this).children].map(e=>({tag:e.tagName.toLowerCase(),attrs:Object.fromEntries([...e.attributes].map(i=>[i.name,i.value])),html:e.innerHTML||void 0}))}set actions(t){let e=Array.isArray(t)?t:[],i=this.#s||this;for(;i.firstChild;)i.firstChild.remove();for(let s of e){if(s instanceof Element){i.appendChild(s);continue}if(!s?.tag)continue;let n=document.createElement(s.tag);if(s.attrs)for(let[o,a]of Object.entries(s.attrs))a==null||a===!1||n.setAttribute(o,a===!0?"":String(a));s.html&&(n.innerHTML=s.html),i.appendChild(n)}this.dispatchEvent(new CustomEvent("selection-menu:actions-changed",{detail:{actions:this.actions,source:"property"},bubbles:!0}))}#n(){this.#e.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#e.add(e),e.hasAttribute("data-selection-menu")||e.setAttribute("data-selection-menu",this.id||""))}this.id&&document.querySelectorAll(`[data-selection-menu="${this.id}"]`).forEach(e=>{this.#e.add(e)})}#r=()=>{requestAnimationFrame(()=>{this.isConnected&&this.#o()})};#o(){let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0),i=e.commonAncestorContainer,s=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,n=null;for(let a of this.#e)if(a.contains(s)){n=a;break}if(!n)return;let o=t.toString().trim();this.#t={range:e.cloneRange(),text:o,target:n},this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#t.range,text:o,target:n},bubbles:!0})),this.#a(e.getBoundingClientRect())}#a(t){this.#s&&(this.#s.show(),this.#i=!0,requestAnimationFrame(()=>{let e=this.#s.getBoundingClientRect(),i=e.width||200,s=e.height||40,n=t.top-s-Ri,o=t.left+t.width/2-i/2;n<$e&&(n=t.bottom+Ri);let a=window.innerWidth-i-$e;o=Math.max($e,Math.min(o,a)),this.#s.style.top=`${n}px`,this.#s.style.left=`${o}px`}))}#c(){this.#s&&this.#s.hide(),this.#i=!1,this.#t=null,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0}))}#l=t=>{this.#i&&(this.#s?.contains(t.target)||this.contains(t.target)||this.#c())};#h=t=>{t.key==="Escape"&&this.#i&&this.#c()}};p("selection-menu",Pe);var ji=!1,Be=new Set,Ie=class extends m{#t=!1;#e=null;setup(){this.#t=!!this.closest("selection-menu");let t=document.createElement("button");t.type="button",t.setAttribute("aria-label",this.#t?"Add private note":"View notes");let e=document.createElement("icon-wc");e.setAttribute("name","sticky-note"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e),this.#t?t.addEventListener("click",()=>this.#i()):t.addEventListener("click",()=>this.#s()),this.appendChild(t),Be.add(this),ji||(ji=!0,document.addEventListener("highlights:request-note",qr))}teardown(){Be.delete(this),this.#o()}openFor(t,e){this.#n(t,e)}#i(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let i=e.target;i.hasAttribute("data-highlights-init")||i.setAttribute("data-highlights","");let s=M(i),n=s.getHighlights(),o=null;for(let a of n)if(e.text&&a.text&&e.text.includes(a.text.slice(0,20))){o=a;break}if(!o){s._createFromSelection("yellow");let a=s.getHighlights();o=a[a.length-1]}o&&this.#n(o,s),t.dismiss()}#s(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let i=M(e),s=i.getHighlights(),n=s.filter(o=>o.note);n.length>0?this.#n(n[0],i):s.length>0&&this.#n(s[0],i)}#n(t,e){this.#o();let i=e.element,s=document.createElement("div");s.className="hn-note-panel",s.setAttribute("role","dialog"),s.setAttribute("aria-label","Private note");let n=document.createElement("header");n.className="hn-note-header";let o=document.createElement("small");o.textContent="PRIVATE NOTE",n.appendChild(o),s.appendChild(n);let a=document.createElement("blockquote");a.className="hn-note-quote",a.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,s.appendChild(a);let l=document.createElement("textarea");l.className="hn-note-textarea",l.placeholder="Add a note\u2026",l.value=t.note||"",l.rows=3,l.setAttribute("aria-label","Note for highlighted text"),s.appendChild(l);let c=document.createElement("footer");c.className="hn-note-actions";let h=document.createElement("button");h.type="button",h.className="hn-action hn-action-save",h.textContent="Save",h.addEventListener("click",()=>{e._updateNote(t.id,l.value.trim()),this.#o()});let u=document.createElement("button");if(u.type="button",u.className="hn-action",u.textContent="Cancel",u.addEventListener("click",()=>this.#o()),c.append(h,u),s.appendChild(c),l.addEventListener("keydown",d=>{d.key==="Escape"&&(d.preventDefault(),this.#o()),d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),e._updateNote(t.id,l.value.trim()),this.#o())}),getComputedStyle(i).position==="static"&&(i.style.position="relative"),i.appendChild(s),typeof e.findHighlightRect=="function"){let d=e.findHighlightRect(t.id);if(d){let f=i.getBoundingClientRect();s.style.top=`${d.top-f.top}px`}}this.#e=s,requestAnimationFrame(()=>{l.focus(),document.addEventListener("pointerdown",this.#r)})}#r=t=>{this.#e&&!this.#e.contains(t.target)&&this.#o()};#o(){this.#e&&(document.removeEventListener("pointerdown",this.#r),this.#e.remove(),this.#e=null)}};function qr(r){let{highlight:t,controller:e}=r.detail||{};if(!t||!e)return;let i=Be.values().next().value;i&&i.openFor(t,e)}p("note-wc",Ie);var qe=class extends m{setup(){if(this.querySelector(":scope > button"))return;let t=document.createElement("button");t.type="button";let e=document.createElement("icon-wc");e.setAttribute("name","message-circle"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e);let i=this.closest("selection-menu")?.getAttribute("for"),s=this.closest("review-surface")||(i?document.querySelector(`review-surface[for="${i}"]`):null);s?(t.setAttribute("aria-label","Add comment"),t.addEventListener("click",()=>this.#t(s))):(t.setAttribute("aria-label","Comments not available"),t.style.opacity="0.4",t.setAttribute("title","Wrap content in <review-surface> to enable comments")),this.appendChild(t)}#t(t){let e=this.closest("selection-menu");if(!e)return;let i=e.getSelection();if(!i)return;let s=i.range.getBoundingClientRect(),n=t.getBoundingClientRect(),o=(s.left+s.width/2-n.left)/n.width*100,a=(s.top-n.top)/n.height*100;typeof t.addPin=="function"&&t.addPin({x:o,y:a,text:i.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:i.text,x:o,y:a},bubbles:!0})),e.dismiss()}};p("comment-wc",qe);var De='track[kind="chapters"][data-chapter-list]';function $i(r=document){r.querySelectorAll(De).forEach(t=>Oe(t))}function Oe(r){if(r.hasAttribute("data-chapter-list-init"))return;r.setAttribute("data-chapter-list-init","");let t=r.parentElement;if(!t||t.tagName!=="VIDEO")return;let e=r.track;e.mode==="disabled"&&(e.mode="hidden"),r.readyState>=2?Pi(t,e):r.addEventListener("load",()=>Pi(t,e),{once:!0})}function Pi(r,t){let e=t.cues;if(!e||e.length===0)return;let i=document.createElement("nav");i.setAttribute("aria-label","Video chapters"),i.classList.add("chapter-list");let s=document.createElement("ol");for(let o of e){let a=document.createElement("li"),l=document.createElement("button");l.type="button";let c=document.createElement("span");c.textContent=o.text;let h=document.createElement("time");h.textContent=Dr(o.startTime),h.setAttribute("datetime",Or(o.startTime)),l.appendChild(c),l.appendChild(h),l.addEventListener("click",()=>{r.currentTime=o.startTime,r.paused&&r.play()}),a.appendChild(l),s.appendChild(a)}i.appendChild(s),r.insertAdjacentElement("afterend",i);let n=null;r.addEventListener("timeupdate",()=>{let o=r.currentTime,a=-1;for(let l=0;l<e.length;l++)if(o>=e[l].startTime&&o<e[l].endTime){a=l;break}n&&n.removeAttribute("data-active"),a>=0?(n=s.children[a],n.setAttribute("data-active","")):n=null})}function Dr(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return t>0?`${t}:${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${e}:${String(i).padStart(2,"0")}`}function Or(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return`PT${t?t+"H":""}${e?e+"M":""}${i}S`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>$i()):$i();var Fr=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches?.(De)&&Oe(i),i.querySelectorAll?.(De).forEach(s=>Oe(s))}});Fr.observe(document.documentElement,{childList:!0,subtree:!0});var U="[data-command], [commandfor]",zr="Page Actions",T=new Map;function yt(r){if(T.has(r)||r.hasAttribute("data-command-init"))return;r.setAttribute("data-command-init","");let t=r.getAttribute("data-command")||r.textContent.trim();if(!t)return;let e=r.getAttribute("data-command-group")||zr,i=r.getAttribute("data-command-icon")||null,s=r.getAttribute("data-shortcut")||null,n=null;s&&(n=F(s,()=>r.click()));let o={element:r,label:t,group:e,icon:i,shortcut:s,unbind:n};T.set(r,o),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"add",entry:o}}))}function Fe(r){let t=T.get(r);t&&(t.unbind?.(),T.delete(r),r.removeAttribute("data-command-init"),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"remove",element:r}})))}function Hr(){let r=new Map;for(let t of T.values()){if(t.element.hidden||t.element.closest("[hidden]"))continue;let e=r.get(t.group)||[];e.push(t),r.set(t.group,e)}return r}function Bi(r=document){r.querySelectorAll(U).forEach(yt)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Bi()):Bi();var Ur=new MutationObserver(r=>{for(let t of r){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(U)&&yt(i),i.querySelectorAll(U).forEach(yt)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;T.has(i)&&Fe(i),i.querySelectorAll(U).forEach(s=>{T.has(s)&&Fe(s)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.matches(U)&&!T.has(e)?yt(e):!e.matches(U)&&T.has(e)&&Fe(e)}}});Ur.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-command","commandfor"]});function Vr(){let r='footer, aside, dialog, [hidden], [aria-hidden="true"]',e=[];return document.querySelectorAll("nav a[href]").forEach(i=>{if(i.closest(r)||T.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:s,group:"Navigation",icon:null,shortcut:null,auto:!0,action:null})}),document.querySelectorAll("h2[id], h3[id]").forEach(i=>{if(i.closest(r)||T.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:`Jump to: ${s}`,group:"On This Page",icon:null,shortcut:null,auto:!0,action:()=>i.scrollIntoView({behavior:"smooth"})})}),e}window.__commandRegistry={getRegisteredCommands:Hr,scanAutoDiscoverable:Vr};var Wr=window.matchMedia("(prefers-reduced-motion: reduce)");function Ii(){return Wr.matches||document.documentElement.hasAttribute("data-motion-reduced")}var qi=0,Gr=new Map([["vb-fade-in","entrance"],["vb-slide-up","entrance"],["vb-pop","entrance"],["vb-slide-in-ltr","entrance"],["vb-slide-in-rtl","entrance"],["vb-fade-slide-up","entrance"],["vb-shadow-lift","entrance"],["vb-fade-out","exit"],["vb-collapse","exit"],["vb-slide-out-ltr","exit"],["vb-slide-out-rtl","exit"],["vb-shake","attention"],["vb-pulse","attention"],["vb-bounce","attention"],["vb-blink","attention"],["vb-neon-pulse","decoration"],["vb-3d-shift","decoration"],["vb-outline-glow-pulse","decoration"],["vb-rainbow","decoration"],["vb-gradient-flow","decoration"],["vb-shimmer","decoration"],["vb-shimmer-gradient","decoration"],["vb-glow","decoration"],["vb-float","decoration"]]),Di="__vbEffectsRuntime",Oi=globalThis,y=Oi[Di]??{_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_wiredTriggers:new WeakMap,_transitionCleanups:new WeakMap,_keyframePhase:Gr,_observer:null,_animationEndHandler:null,_autoBooted:!1,effect(r,t){this._effects.set(r,t),document.querySelectorAll("[data-effect]").forEach(e=>{if(!(e.getAttribute("data-effect")||"").split(/\s+/).includes(r))return;let s=!this._instances.get(e)?.has(r);this._initEffect(e,r),s&&e.hasAttribute("data-effect-active")&&this._instances.get(e)?.get(r)?.activate?.()})},trigger(r,t){this._triggers.set(r,t),document.querySelectorAll("[data-effect-processed][data-trigger]").forEach(e=>{let i=e.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(e,i)})},transition(r,t){this._transitions.set(r,t)},uid(r){return r.id?r.id:(r._vbUid||(qi++,r._vbUid=`vb-${qi}`),r._vbUid)},theme(r,t){this._themes=this._themes||new Map,this._themes.set(r,t)},applyTheme(r,t=document.documentElement){let e=this._themes?.get(r);if(e)for(let[i,s]of Object.entries(e))t.style.setProperty(i,s)},swap(r){if(!document.startViewTransition){r(),queueMicrotask(()=>this._dispatchVtDone(document.body));return}let t=document.startViewTransition(r);return t.updateCallbackDone.then(()=>{this._dispatchVtDone(document.body)}).catch(()=>{}),t},_dispatchVtDone(r){r.querySelectorAll('[data-trigger~="vt"]').forEach(t=>{this.emit(t,"vb:vt-update-done",{})})},activate(r){this._activateEffects(r)},deactivate(r){r.hasAttribute("data-effect-active")&&(r.removeAttribute("data-effect-active"),this.emit(r,"vb:phase-change",{active:!1}))},onPhaseEnd(r,t,e){let i=s=>{s.detail?.phase===t&&e(s.detail)};return r.addEventListener("vb:effect-phase-end",i),()=>r.removeEventListener("vb:effect-phase-end",i)},registerKeyframe(r,t){this._keyframePhase.set(r,t)},observe(r=document){if(r.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),r.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),r.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{for(let i of e){if(i.type==="childList"){for(let s of i.addedNodes)s.nodeType===Node.ELEMENT_NODE&&this._processTree(s);for(let s of i.removedNodes)s.nodeType===Node.ELEMENT_NODE&&(s.isConnected||this._cleanupTree(s))}if(i.type==="attributes"){let s=i.target;i.attributeName==="data-effect"&&this._reconcileEffects(s),i.attributeName==="data-trigger"&&this._reconcileTrigger(s),i.attributeName==="data-stagger"&&this._processStagger(s),i.attributeName==="data-transition"&&this._processTransition(s)}}});let t=r===document?document.body:r;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]}),this._animationEndHandler||(this._animationEndHandler=e=>{let i=e.target;if(!(i instanceof Element)||!i.hasAttribute("data-effect"))return;let s=this._keyframePhase.get(e.animationName);s&&this.emit(i,"vb:effect-phase-end",{phase:s,animationName:e.animationName})},document.addEventListener("animationend",this._animationEndHandler))},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null),this._animationEndHandler&&(document.removeEventListener("animationend",this._animationEndHandler),this._animationEndHandler=null)},params(r){let t=getComputedStyle(r);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();return s?parseFloat(s):i},getTime(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();if(!s)return i;let n=parseFloat(s);return Number.isFinite(n)?/s\s*$/.test(s)&&!/ms\s*$/.test(s)?n*1e3:n:i},hasClass(e){return r.classList.contains(e)}}},emit(r,t,e={}){r.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:Ii,_processTree(r){r.hasAttribute?.("data-effect")&&this._processElement(r),r.hasAttribute?.("data-stagger")&&this._processStagger(r),r.hasAttribute?.("data-transition")&&this._processTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),r.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(r){r.hasAttribute?.("data-effect")&&this._cleanupElement(r),r.hasAttribute?.("data-transition")&&this._cleanupTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(r){if(r.hasAttribute("data-effect-processed"))return;r.setAttribute("data-effect-processed","");let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(r,e);this._wireTrigger(r,t)},_initEffect(r,t){let e=this._effects.get(t);if(!e)return;let i=this._instances.get(r);if(i?.has(t))return;Ii();let s=e(r);s&&(i||(i=new Map,this._instances.set(r,i)),typeof s=="function"?i.set(t,{cleanup:s}):i.set(t,s))},_wireTrigger(r,t){let e=r.getAttribute("data-trigger");if(!e){this._activateEffects(r);return}let i=e.split(/\s+/).filter(Boolean);this._wiredTriggers??=new WeakMap;let s=this._wiredTriggers.get(r);s||(s=new Set,this._wiredTriggers.set(r,s));for(let n of i){if(s.has(n))continue;let o=n.indexOf(":"),a=o>-1?n.slice(0,o):n,l=o>-1?n.slice(o+1):null,c=this._triggers.get(a);if(!c)continue;s.add(n);let h=c(r,()=>this._activateEffects(r),l);if(h){let u=this._triggerCleanups.get(r);if(u){let d=u;this._triggerCleanups.set(r,()=>{d(),h()})}else this._triggerCleanups.set(r,h)}}},_activateEffects(r){r.setAttribute("data-effect-active",""),this.emit(r,"vb:phase-change",{active:!0});let t=this._instances.get(r);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(r){let t=this._instances.get(r);if(t){for(let[,i]of t)i.cleanup&&i.cleanup();this._instances.delete(r)}let e=this._triggerCleanups.get(r);e&&(e(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r)},_reconcileEffects(r){let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(r);if(e)for(let[i,s]of e)t.includes(i)||(s.cleanup&&s.cleanup(),e.delete(i));for(let i of t)e?.has(i)||this._initEffect(r,i);r.hasAttribute("data-effect-processed")||(r.setAttribute("data-effect-processed",""),this._wireTrigger(r,t))},_reconcileTrigger(r){let t=this._triggerCleanups.get(r);t&&(t(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r);let e=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(r,e)},_processStagger(r){let t=r.getAttribute("data-stagger")||"",e=r.children,i=e.length,s;if(t==="reverse")s=Array.from({length:i},(n,o)=>i-1-o);else if(t==="random"){let n=this._hashString(this.uid(r));s=Array.from({length:i},(a,l)=>l);let o=n;for(let a=i-1;a>0;a--){o^=o<<13,o^=o>>>17,o^=o<<5;let l=Math.abs(o)%(a+1);[s[a],s[l]]=[s[l],s[a]]}}else if(t==="grid"){let n=[];for(let o=0;o<i;o++){let a=getComputedStyle(e[o]),l=parseInt(a.gridRowStart,10),c=parseInt(a.gridColumnStart,10);n.push({i:o,dist:Number.isFinite(l)&&Number.isFinite(c)?l-1+(c-1):o})}n.sort((o,a)=>o.dist-a.dist),s=new Array(i),n.forEach((o,a)=>{s[o.i]=a})}else s=Array.from({length:i},(n,o)=>o);for(let n=0;n<i;n++)e[n].style.setProperty("--vb-stagger-index",String(s[n]))},_hashString(r){let t=5381;for(let e=0;e<r.length;e++)t=(t<<5)+t^r.charCodeAt(e);return t|0},_processTransition(r){if(r.hasAttribute("data-transition-processed"))return;r.setAttribute("data-transition-processed","");let t=r.getAttribute("data-transition");if(!t)return;let e=t.indexOf(":"),i=e>-1?t.slice(0,e):t,s=e>-1?t.slice(e+1):null,n=this._transitions.get(i);if(n){let o=n(r,s);o&&this._transitionCleanups.set(r,o)}else r.style.viewTransitionName=`${t}-${this.uid(r)}`},_cleanupTransition(r){let t=this._transitionCleanups.get(r);t&&(t(),this._transitionCleanups.delete(r)),r.style.viewTransitionName=""}};Oi[Di]=y;typeof window<"u"&&(window.VB=y);typeof document<"u"&&!y._autoBooted&&(y._autoBooted=!0,document.body?y.observe():document.addEventListener("DOMContentLoaded",()=>y.observe(),{once:!0}));y.effect("glitch",r=>{r.hasAttribute("data-effect-glitch-init")||(r.setAttribute("data-effect-glitch-init",""),r.setAttribute("data-glitch-text",r.textContent))});function Kr(r){let t=r.textContent;r.setAttribute("aria-label",t),r.innerHTML="",t.split(/(\s+)/).forEach((i,s)=>{if(/^\s+$/.test(i)){r.appendChild(document.createTextNode(i));return}let n=document.createElement("span");n.className="vb-blur-chunk",n.textContent=i,n.style.setProperty("--i",String(Math.floor(s/2))),n.setAttribute("aria-hidden","true"),r.appendChild(n)})}function Xr(r){let t=r.textContent;r.setAttribute("aria-label",t);let e=t.split(/\s+/).filter(Boolean),i=[],s="",n=r.offsetWidth,o=document.createElement("span");o.style.visibility="hidden",o.style.position="absolute",o.style.font=getComputedStyle(r).font,document.body.appendChild(o),e.forEach(a=>{let l=s?s+" "+a:a;o.textContent=l,o.offsetWidth>n&&s?(i.push(s),s=a):s=l}),s&&i.push(s),document.body.removeChild(o),i.length===0&&i.push(t),r.innerHTML="",i.forEach((a,l)=>{let c=document.createElement("span");c.className="vb-blur-chunk",c.textContent=a,c.style.setProperty("--i",String(l)),c.setAttribute("aria-hidden","true"),r.appendChild(c),l<i.length-1&&r.appendChild(document.createTextNode(" "))})}y.effect("blur-reveal",r=>{if(r.hasAttribute("data-effect-blur-reveal-init")||(r.setAttribute("data-effect-blur-reveal-init",""),y.prefersReducedMotion()))return;let t=r.classList.contains("line")?"line":"word",e=y.params(r).get("blur-reveal-delay")||"80ms";return r.style.setProperty("--blur-delay",e),t==="line"?Xr(r):Kr(r),{activate(){r.setAttribute("data-effect-active","")},cleanup(){}}});function Jr(r,t,e,i){let s=0;function n(){s<=t.length?(r.firstChild.textContent=t.slice(0,s),s++,setTimeout(n,e)):i&&i()}n()}function Yr(r,t,e){let i=r.firstChild.textContent,s=i.length;function n(){s>=0?(r.firstChild.textContent=i.slice(0,s),s--,setTimeout(n,t/2)):e&&e()}n()}function Zr(r){let t=r.getAttribute("data-typewriter-text"),e=y.params(r),i=e.getTime("typewriter-speed",50),s=e.getTime("typewriter-delay",0),o=r.classList.contains("loop")?2e3:null;r.textContent="";let a=document.createTextNode("");if(r.appendChild(a),!r.classList.contains("no-cursor")){let h=document.createElement("span");h.className="vb-typewriter-cursor",h.textContent="|",h.setAttribute("aria-hidden","true"),r.appendChild(h)}function c(){Jr(r,t,i,()=>{o!==null&&setTimeout(()=>{Yr(r,i,()=>{setTimeout(c,400)})},o)})}setTimeout(c,s)}y.effect("typewriter",r=>{if(r.hasAttribute("data-effect-typewriter-init"))return;r.setAttribute("data-effect-typewriter-init","");let t=r.textContent.trim();if(r.setAttribute("data-typewriter-text",t),r.setAttribute("aria-label",t),!y.prefersReducedMotion())return r.textContent="",{activate(){Zr(r)},cleanup(){}}});var Fi="!<>-_\\/[]{}=+*^?#";function zi(r){return r[Math.floor(Math.random()*r.length)]}function Qr(r){let t=r.getAttribute("data-scramble-text"),e=y.params(r),i=e.getTime("scramble-duration",1500),s=e.get("scramble-chars")||Fi,n=e.getTime("scramble-speed",30),o=t.length,a=0,l=Math.ceil(i/n);function c(){let h=a/l,u=Math.floor(h*o),d="";for(let f=0;f<o;f++)f<u?d+=t[f]:t[f]===" "?d+=" ":d+=zi(s);r.textContent=d,a++,a<=l?setTimeout(c,n):r.textContent=t}c()}y.effect("scramble",r=>{if(r.hasAttribute("data-effect-scramble-init"))return;r.setAttribute("data-effect-scramble-init","");let t=r.textContent.trim();if(r.setAttribute("data-scramble-text",t),r.setAttribute("aria-label",t),y.prefersReducedMotion())return;let e=y.params(r).get("scramble-chars")||Fi;return r.textContent=t.replace(/\S/g,()=>zi(e)),{activate(){Qr(r)},cleanup(){}}});y.effect("animate-image",r=>{if(r.hasAttribute("data-effect-animate-image-init"))return;r.setAttribute("data-effect-animate-image-init","");let t=r,e=document.createElement("div");if(e.className="animate-image-wrapper",!t.parentNode)return;t.parentNode.insertBefore(e,t),e.appendChild(t);let i=document.createElement("button");i.type="button",i.className="animate-image-toggle",i.setAttribute("aria-label","Pause animation"),e.appendChild(i);let s=t.src,n=null,o=!1;function a(){let u=document.createElement("canvas");u.width=t.naturalWidth||t.width,u.height=t.naturalHeight||t.height;let d=u.getContext("2d");if(d){d.drawImage(t,0,0);try{n=u.toDataURL("image/png")}catch{n=null}}}function l(){o||(o=!0,t.setAttribute("data-animate-image-paused",""),i.setAttribute("aria-label","Play animation"),i.classList.add("paused"),n&&(t.src=n))}function c(){o&&(o=!1,t.removeAttribute("data-animate-image-paused"),i.setAttribute("aria-label","Pause animation"),i.classList.remove("paused"),t.src=s)}i.addEventListener("click",()=>o?c():l()),t.complete&&t.naturalWidth?a():t.addEventListener("load",a,{once:!0});let h=window.matchMedia("(prefers-reduced-motion: reduce)");return(h.matches||document.documentElement.dataset.motionReduced!==void 0)&&(t.complete?(a(),l()):t.addEventListener("load",()=>{a(),l()},{once:!0})),h.addEventListener("change",u=>{u.matches&&l()}),t.hasAttribute("data-animate-image-paused")&&(t.complete?(a(),o=!1,l()):t.addEventListener("load",()=>{a(),o=!1,l()},{once:!0})),{cleanup(){e.parentNode&&(e.parentNode.insertBefore(t,e),e.remove())}}});var wt=new Map,ze=null,kt=!1;function tn(r){for(let[t,e]of wt)r.querySelectorAll(t).forEach(e)}function en(r){if(r.nodeType!==Node.ELEMENT_NODE)return;let t=r;for(let[e,i]of wt)t.matches(e)&&i(t),t.querySelectorAll(e).forEach(i)}function sn(){ze||(ze=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes)en(e)}),ze.observe(document.documentElement,{childList:!0,subtree:!0}))}function rn(){kt||(kt=!0,tn(document))}function Hi(r,t){wt.set(r,t),sn(),kt||document.readyState!=="loading"?(kt=!0,document.querySelectorAll(r).forEach(t)):wt.size===1&&document.addEventListener("DOMContentLoaded",rn)}var xt=null;async function nn(){if(xt)return;xt=(await Promise.resolve().then(()=>(jt(),Rt))).resolveEmoji}var on="[data-emoji]",j=/:([a-z0-9_+-]+):/g,an=new Set(["SCRIPT","STYLE","CODE","PRE","TEXTAREA"]),ln=new Set(["INPUT","TEXTAREA"]),cn=100;function hn(r){if(r.hasAttribute("data-emoji-init"))return;if(r.setAttribute("data-emoji-init",""),ln.has(r.tagName)){un(r);return}let t=r.getAttribute("data-emoji-unknown")||"keep";if(Ui(r,t),r.getAttribute("data-emoji-scan")==="observe"){let e=null;new MutationObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{Ui(r,t),e=null},cn)}).observe(r,{childList:!0,subtree:!0,characterData:!0})}}function un(r){let t=!1;r.addEventListener("compositionstart",()=>{t=!0}),r.addEventListener("compositionend",()=>{t=!1,He(r)}),r.addEventListener("input",()=>{t||He(r)}),r.value&&j.test(r.value)&&(j.lastIndex=0,He(r))}function He(r){let t=r.value;j.lastIndex=0;let e,i="",s=0,n=0,o=r.selectionStart??t.length,a=!1;for(;(e=j.exec(t))!==null;){let c=e[0],h=e[1],u=xt(h);if(i+=t.slice(s,e.index),u){i+=u.emoji,a=!0;let d=e.index+c.length;o>=d?n+=c.length-u.emoji.length:o>e.index&&(n+=o-e.index-u.emoji.length)}else i+=c;s=e.index+c.length}if(!a)return;i+=t.slice(s),r.value=i;let l=Math.max(0,o-n);r.setSelectionRange(l,l)}function Ui(r,t){let e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(s){let n=s.parentElement;return!n||an.has(n.tagName)||n.isContentEditable||n.hasAttribute("data-emoji-processed")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];for(;e.nextNode();)j.test(e.currentNode.textContent??"")&&i.push(e.currentNode),j.lastIndex=0;for(let s of i)dn(s,t)}function dn(r,t){let e=r.textContent;j.lastIndex=0;let i,s=0,n=[],o=!1;for(;(i=j.exec(e))!==null;){let a=i[1],l=xt(a);i.index>s&&n.push(e.slice(s,i.index)),l?(n.push(l.emoji),o=!0):t==="strip"?o=!0:n.push(i[0]),s=i.index+i[0].length}o&&(s<e.length&&n.push(e.slice(s)),r.textContent=n.join(""))}function pn(r){nn().then(()=>hn(r))}Hi(on,pn);
|
|
1169
1169
|
//# sourceMappingURL=vanilla-breeze-extras.js.map
|