vanilla-breeze 0.4.1 → 0.6.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.
Files changed (282) hide show
  1. package/custom-elements.json +23012 -11383
  2. package/dist/cdn/components/accordion-wc.js +1 -1
  3. package/dist/cdn/components/activity-feed.js +1 -1
  4. package/dist/cdn/components/ai-chat.js +9 -6
  5. package/dist/cdn/components/ai-summary.js +4 -2
  6. package/dist/cdn/components/analytics-panel.js +19 -21
  7. package/dist/cdn/components/audio-player.js +17 -7
  8. package/dist/cdn/components/audio-visualizer.js +3 -3
  9. package/dist/cdn/components/author-index.js +2 -2
  10. package/dist/cdn/components/brand-mark.js +1 -1
  11. package/dist/cdn/components/bread-crumb.js +1 -1
  12. package/dist/cdn/components/calendar-wc.js +2 -2
  13. package/dist/cdn/components/card-list.js +1 -1
  14. package/dist/cdn/components/carousel-wc.js +1 -1
  15. package/dist/cdn/components/change-set.js +1 -11
  16. package/dist/cdn/components/chart-wc.js +32 -32
  17. package/dist/cdn/components/chat-input.js +1 -1
  18. package/dist/cdn/components/chat-window.js +1 -1
  19. package/dist/cdn/components/color-picker.js +1 -1
  20. package/dist/cdn/components/combo-box.js +1 -1
  21. package/dist/cdn/components/command-palette.js +1 -1
  22. package/dist/cdn/components/comment-box.js +50 -49
  23. package/dist/cdn/components/comment-thread.js +50 -49
  24. package/dist/cdn/components/comment-wc.js +1 -1
  25. package/dist/cdn/components/compare-surface.js +1 -1
  26. package/dist/cdn/components/consent-banner.js +1 -1
  27. package/dist/cdn/components/content-lens.js +1 -1
  28. package/dist/cdn/components/content-swap.js +1 -1
  29. package/dist/cdn/components/context-menu.js +1 -1
  30. package/dist/cdn/components/data-table.js +1 -1
  31. package/dist/cdn/components/date-picker.js +1 -1
  32. package/dist/cdn/components/day-view.js +1 -1
  33. package/dist/cdn/components/diagram-wc.js +2 -2
  34. package/dist/cdn/components/drag-surface.js +1 -1
  35. package/dist/cdn/components/drop-down.js +1 -1
  36. package/dist/cdn/components/emoji-picker.js +1 -1
  37. package/dist/cdn/components/flow-diagram.js +1 -1
  38. package/dist/cdn/components/foot-notes.js +1 -1
  39. package/dist/cdn/components/form-field.js +1 -1
  40. package/dist/cdn/components/geo-map.js +170 -54
  41. package/dist/cdn/components/glossary-index.js +1 -1
  42. package/dist/cdn/components/glossary-wc.js +1 -1
  43. package/dist/cdn/components/heading-links.js +1 -1
  44. package/dist/cdn/components/highlight-wc.js +6 -2
  45. package/dist/cdn/components/icon-wc.js +11 -10
  46. package/dist/cdn/components/image-gallery.js +1 -1
  47. package/dist/cdn/components/image-map.js +1 -1
  48. package/dist/cdn/components/include-file.js +1 -1
  49. package/dist/cdn/components/manifest.json +101 -101
  50. package/dist/cdn/components/markdown-editor.js +60 -1
  51. package/dist/cdn/components/markdown-viewer.js +50 -49
  52. package/dist/cdn/components/nav-bar.js +1 -1
  53. package/dist/cdn/components/note-wc.js +6 -2
  54. package/dist/cdn/components/notification-wc.js +33 -32
  55. package/dist/cdn/components/page-info.js +6 -72
  56. package/dist/cdn/components/page-stats.js +1 -1
  57. package/dist/cdn/components/page-toc.js +1 -1
  58. package/dist/cdn/components/page-tools.js +1 -1
  59. package/dist/cdn/components/page-tour.js +1 -38
  60. package/dist/cdn/components/pager-wc.js +1 -1
  61. package/dist/cdn/components/poll-wc.js +1 -1
  62. package/dist/cdn/components/pop-over.js +1 -1
  63. package/dist/cdn/components/popularity-index.js +1 -8
  64. package/dist/cdn/components/print-page.js +1 -1
  65. package/dist/cdn/components/progress-tracker.js +1 -1
  66. package/dist/cdn/components/qr-code.js +1 -1
  67. package/dist/cdn/components/reaction-bar.js +1 -1
  68. package/dist/cdn/components/reader-view.js +25 -25
  69. package/dist/cdn/components/reading-progress.js +1 -1
  70. package/dist/cdn/components/recently-visited.js +1 -26
  71. package/dist/cdn/components/score-card.js +21 -5
  72. package/dist/cdn/components/selection-menu.js +1 -1
  73. package/dist/cdn/components/settings-panel.js +88 -142
  74. package/dist/cdn/components/share-wc.js +2 -2
  75. package/dist/cdn/components/short-cuts.js +1 -1
  76. package/dist/cdn/components/site-index.js +1 -10
  77. package/dist/cdn/components/site-map.js +1 -1
  78. package/dist/cdn/components/site-search.js +1 -51
  79. package/dist/cdn/components/slide-accept.js +1 -1
  80. package/dist/cdn/components/social-embed.js +1 -1
  81. package/dist/cdn/components/split-surface.js +1 -1
  82. package/dist/cdn/components/star-rating.js +1 -1
  83. package/dist/cdn/components/status-wc.js +1 -1
  84. package/dist/cdn/components/stepper-wc.js +1 -1
  85. package/dist/cdn/components/tab-set.js +1 -1
  86. package/dist/cdn/components/text-reader.js +2 -2
  87. package/dist/cdn/components/theme-picker.js +84 -81
  88. package/dist/cdn/components/time-index.js +1 -11
  89. package/dist/cdn/components/time-picker.js +1 -1
  90. package/dist/cdn/components/toast-msg.js +6 -6
  91. package/dist/cdn/components/tool-tip.js +1 -1
  92. package/dist/cdn/components/topic-map.js +6 -3
  93. package/dist/cdn/components/trust-filter.js +1 -3
  94. package/dist/cdn/components/version-switcher.js +5 -15
  95. package/dist/cdn/components/video-player.js +67 -9
  96. package/dist/cdn/components/watch-wc.js +6 -2
  97. package/dist/cdn/components/week-view.js +1 -1
  98. package/dist/cdn/components/youtube-player.js +1 -1
  99. package/dist/cdn/emoji-extended.js +2 -0
  100. package/dist/cdn/fonts/atkinson-hyperlegible-OFL.txt +93 -0
  101. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-italic.woff2 +0 -0
  102. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-normal.woff2 +0 -0
  103. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-italic.woff2 +0 -0
  104. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-normal.woff2 +0 -0
  105. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-italic.woff2 +0 -0
  106. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2 +0 -0
  107. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-italic.woff2 +0 -0
  108. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2 +0 -0
  109. package/dist/cdn/fonts/latinmodern-math-GUST-LICENSE.txt +30 -0
  110. package/dist/cdn/fonts/latinmodern-math.woff2 +0 -0
  111. package/dist/cdn/fonts/math-fonts.css +14 -0
  112. package/dist/cdn/packs/effects.full.css +1 -1
  113. package/dist/cdn/packs/effects.full.js +1 -1
  114. package/dist/cdn/packs/fonts-display.full.css +1 -1
  115. package/dist/cdn/packs/fonts-display.theme.css +1 -1
  116. package/dist/cdn/packs/icons.bundle.js +1 -1
  117. package/dist/cdn/packs/icons.full.css +1 -1
  118. package/dist/cdn/packs/icons.theme.css +1 -1
  119. package/dist/cdn/packs/journal.effects.css +1 -1
  120. package/dist/cdn/packs/journal.full.css +1 -1
  121. package/dist/cdn/packs/kawaii.effects.css +1 -1
  122. package/dist/cdn/packs/kawaii.full.css +2 -2
  123. package/dist/cdn/packs/kawaii.full.js +6 -6
  124. package/dist/cdn/packs/kawaii.theme.css +1 -1
  125. package/dist/cdn/packs/manifest.json +17 -17
  126. package/dist/cdn/packs/memphis.full.css +1 -1
  127. package/dist/cdn/packs/memphis.theme.css +1 -1
  128. package/dist/cdn/packs/ui.full.css +1 -1
  129. package/dist/cdn/packs/ui.full.js +88 -85
  130. package/dist/cdn/themes/8bit.css +1 -1
  131. package/dist/cdn/themes/8bit.tokens.json +1 -1
  132. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  133. package/dist/cdn/themes/alpha1999.css +1 -1
  134. package/dist/cdn/themes/alpha1999.tokens.json +1 -1
  135. package/dist/cdn/themes/art-deco-dark.tokens.json +33 -1
  136. package/dist/cdn/themes/art-deco.css +1 -1
  137. package/dist/cdn/themes/art-deco.tokens.json +23 -1
  138. package/dist/cdn/themes/bauhaus-dark.tokens.json +23 -1
  139. package/dist/cdn/themes/bauhaus.css +1 -1
  140. package/dist/cdn/themes/bauhaus.tokens.json +1 -1
  141. package/dist/cdn/themes/brutalist-dark.tokens.json +33 -1
  142. package/dist/cdn/themes/brutalist.css +1 -1
  143. package/dist/cdn/themes/brutalist.tokens.json +23 -1
  144. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  145. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  146. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  147. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  148. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  149. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  150. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  151. package/dist/cdn/themes/catppuccin-mocha.css +1 -1
  152. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  153. package/dist/cdn/themes/classic-dark.tokens.json +1 -1
  154. package/dist/cdn/themes/classic.css +1 -1
  155. package/dist/cdn/themes/classic.tokens.json +1 -1
  156. package/dist/cdn/themes/claymorphism-dark.tokens.json +33 -1
  157. package/dist/cdn/themes/claymorphism.css +1 -1
  158. package/dist/cdn/themes/claymorphism.tokens.json +24 -1
  159. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  160. package/dist/cdn/themes/clinical.css +1 -1
  161. package/dist/cdn/themes/clinical.tokens.json +1 -1
  162. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  163. package/dist/cdn/themes/cottagecore.css +1 -1
  164. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  165. package/dist/cdn/themes/cyber.css +1 -1
  166. package/dist/cdn/themes/cyber.tokens.json +1 -1
  167. package/dist/cdn/themes/dawn-dark.tokens.json +33 -1
  168. package/dist/cdn/themes/dawn.css +1 -1
  169. package/dist/cdn/themes/dawn.tokens.json +23 -1
  170. package/dist/cdn/themes/dracula.css +1 -1
  171. package/dist/cdn/themes/dracula.tokens.json +1 -1
  172. package/dist/cdn/themes/dusk.css +1 -1
  173. package/dist/cdn/themes/dusk.tokens.json +1 -1
  174. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  175. package/dist/cdn/themes/editorial.css +1 -1
  176. package/dist/cdn/themes/editorial.tokens.json +1 -1
  177. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  178. package/dist/cdn/themes/financial.css +1 -1
  179. package/dist/cdn/themes/financial.tokens.json +1 -1
  180. package/dist/cdn/themes/genai.css +1 -1
  181. package/dist/cdn/themes/genai.tokens.json +1 -1
  182. package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
  183. package/dist/cdn/themes/glassmorphism.css +1 -1
  184. package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
  185. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  186. package/dist/cdn/themes/government.css +1 -1
  187. package/dist/cdn/themes/government.tokens.json +1 -1
  188. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  189. package/dist/cdn/themes/gruvbox.css +1 -1
  190. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  191. package/dist/cdn/themes/high-noon-dark.tokens.json +23 -1
  192. package/dist/cdn/themes/high-noon.css +1 -1
  193. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  194. package/dist/cdn/themes/journal-dark.tokens.json +36 -2
  195. package/dist/cdn/themes/journal.css +1 -1
  196. package/dist/cdn/themes/journal.tokens.json +26 -2
  197. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  198. package/dist/cdn/themes/kawaii.css +1 -1
  199. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  200. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  201. package/dist/cdn/themes/magna.css +1 -1
  202. package/dist/cdn/themes/magna.tokens.json +1 -1
  203. package/dist/cdn/themes/manifest.json +44 -68
  204. package/dist/cdn/themes/midnight.css +1 -1
  205. package/dist/cdn/themes/midnight.tokens.json +1 -1
  206. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  207. package/dist/cdn/themes/minimal.css +1 -1
  208. package/dist/cdn/themes/minimal.tokens.json +1 -1
  209. package/dist/cdn/themes/modern-dark.tokens.json +1 -1
  210. package/dist/cdn/themes/modern.css +1 -1
  211. package/dist/cdn/themes/modern.tokens.json +1 -1
  212. package/dist/cdn/themes/nes-dark.tokens.json +7 -2
  213. package/dist/cdn/themes/nes.css +1 -1
  214. package/dist/cdn/themes/nes.tokens.json +1 -1
  215. package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
  216. package/dist/cdn/themes/neumorphism.css +1 -1
  217. package/dist/cdn/themes/neumorphism.tokens.json +1 -1
  218. package/dist/cdn/themes/nord-dark.tokens.json +33 -1
  219. package/dist/cdn/themes/nord.css +1 -1
  220. package/dist/cdn/themes/nord.tokens.json +23 -1
  221. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  222. package/dist/cdn/themes/organic.css +1 -1
  223. package/dist/cdn/themes/organic.tokens.json +1 -1
  224. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  225. package/dist/cdn/themes/rose-pine.css +1 -1
  226. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  227. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  228. package/dist/cdn/themes/rough.css +1 -1
  229. package/dist/cdn/themes/rough.tokens.json +1 -1
  230. package/dist/cdn/themes/solarized-dark.tokens.json +23 -1
  231. package/dist/cdn/themes/solarized.css +1 -1
  232. package/dist/cdn/themes/solarized.tokens.json +23 -1
  233. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  234. package/dist/cdn/themes/startup.css +1 -1
  235. package/dist/cdn/themes/startup.tokens.json +1 -1
  236. package/dist/cdn/themes/super2026-dark.tokens.json +33 -1
  237. package/dist/cdn/themes/super2026.css +1 -1
  238. package/dist/cdn/themes/super2026.tokens.json +23 -1
  239. package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
  240. package/dist/cdn/themes/swiss.css +1 -1
  241. package/dist/cdn/themes/swiss.tokens.json +1 -1
  242. package/dist/cdn/themes/terminal.css +1 -1
  243. package/dist/cdn/themes/terminal.tokens.json +1 -1
  244. package/dist/cdn/themes/tokyo-night-dark.tokens.json +33 -1
  245. package/dist/cdn/themes/tokyo-night.css +1 -1
  246. package/dist/cdn/themes/tokyo-night.tokens.json +23 -1
  247. package/dist/cdn/themes/vaporwave-dark.tokens.json +33 -1
  248. package/dist/cdn/themes/vaporwave.css +1 -1
  249. package/dist/cdn/themes/vaporwave.tokens.json +23 -1
  250. package/dist/cdn/themes/win9x-dark.tokens.json +20 -5
  251. package/dist/cdn/themes/win9x.css +1 -1
  252. package/dist/cdn/themes/win9x.tokens.json +3 -1
  253. package/dist/cdn/vanilla-breeze-autoload.js +553 -0
  254. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  255. package/dist/cdn/vanilla-breeze-charts.js +32 -32
  256. package/dist/cdn/vanilla-breeze-core.css +1 -1
  257. package/dist/cdn/vanilla-breeze-core.js +183 -281
  258. package/dist/cdn/vanilla-breeze-dev.css +1 -1
  259. package/dist/cdn/vanilla-breeze-dev.js +1 -1
  260. package/dist/cdn/vanilla-breeze-extras.js +286 -134
  261. package/dist/cdn/vanilla-breeze.css +1 -1
  262. package/dist/cdn/vanilla-breeze.js +574 -656
  263. package/dist/cdn/view-transitions.css +2 -0
  264. package/package.json +17 -9
  265. package/dist/cdn/themes/amber.css +0 -2
  266. package/dist/cdn/themes/anthropic.css +0 -2
  267. package/dist/cdn/themes/anthropic.tokens.json +0 -564
  268. package/dist/cdn/themes/coral.css +0 -2
  269. package/dist/cdn/themes/emerald.css +0 -2
  270. package/dist/cdn/themes/forest.css +0 -2
  271. package/dist/cdn/themes/ibm.css +0 -2
  272. package/dist/cdn/themes/ibm.tokens.json +0 -568
  273. package/dist/cdn/themes/indigo.css +0 -2
  274. package/dist/cdn/themes/lavender.css +0 -2
  275. package/dist/cdn/themes/mcdonalds.css +0 -2
  276. package/dist/cdn/themes/mcdonalds.tokens.json +0 -533
  277. package/dist/cdn/themes/ocean.css +0 -2
  278. package/dist/cdn/themes/rose.css +0 -2
  279. package/dist/cdn/themes/slate.css +0 -2
  280. package/dist/cdn/themes/starbucks.css +0 -2
  281. package/dist/cdn/themes/starbucks.tokens.json +0 -593
  282. package/dist/cdn/themes/sunset.css +0 -2
@@ -1,2 +1,2 @@
1
- var p=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function b(o,t,e={}){let r=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:r},n=g.get(o);if(customElements.get(o)){if(!n||n.priority>=r){n&&n.priority===r&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=r){n.priority===r&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}g.set(o,i),customElements.define(o,t)}var h=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,r,i){t.addEventListener(e,r,i),this.#t.push(()=>t.removeEventListener(e,r,i))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{e?r.add(t):r.delete(t)}catch{let i=`--${t}`;e?r.add(i):r.delete(i)}}_adoptInternals(t){this.#e||(this.#e=t)}};var f=class o extends h{#t=null;#e=null;#c=!1;#l=null;setup(){this.setAttribute("role","list"),this.#c=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#f(),this.#g(),this.#E(),this.#h()}teardown(){this.#t&&(this.#t.remove(),this.#t=null),o.#r?.source===this&&(o.#r=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)}#h(){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")}#f(){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)}#n(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#g(){this.listen(this,"pointerdown",t=>{this.#l=t.target}),this.listen(this,"dragstart",this.#b.bind(this)),this.listen(this,"dragover",this.#p.bind(this)),this.listen(this,"dragleave",this.#m.bind(this)),this.listen(this,"drop",this.#v.bind(this)),this.listen(this,"dragend",this.#A.bind(this))}#b(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let r=e.querySelector("[data-drag-handle]");if(r&&!r.contains(this.#l)){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 i=this.#s(e);o.#r={item:e,source:this,originalIndex:i},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#p(t){let e=o.#r;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 r=this.orientation==="horizontal"?t.clientX:t.clientY;this.#C(r)}#m(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#d())}#v(t){t.preventDefault(),this.removeAttribute("data-drag-over"),this.#d();let e=o.#r;if(!e)return;let{item:r,source:i,originalIndex:n}=e,d=this.orientation==="horizontal"?t.clientX:t.clientY,u=this.#x(d);if(i===this){this.#a(r,u),this.#i();let c=this.#s(r);this.#o(r),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:r,itemId:r.dataset.id,oldIndex:n,newIndex:c,order:this.sortedOrder}}))}else this.#a(r,u),this.#i(),i.#i(),this.#o(r),this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:r,itemId:r.dataset.id,fromSurface:i,toSurface:this,newIndex:this.#s(r),fromOrder:i.sortedOrder,toOrder:this.sortedOrder}}))}#A(){let t=o.#r;t?.item&&t.item.removeAttribute("data-dragging"),this.removeAttribute("data-drag-over"),this.#d(),o.#r=null,this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#E(){this.listen(this,"keydown",this.#y.bind(this))}#y(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this||this.hasAttribute("disabled"))return;let r=e.getAttribute("aria-grabbed")==="true",i=this.orientation==="horizontal",n=i?"ArrowLeft":"ArrowUp",d=i?"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){if(t.preventDefault(),r){e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#i(),this.#o(e);let a=this.#s(e),s=this.draggableChildren;this.#n(`${this.#u(e)}, dropped at position ${a+1} of ${s.length}`),this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,oldIndex:this.#e,newIndex:a,order:this.sortedOrder}})),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null}else{this.#e=this.#s(e),e.setAttribute("aria-grabbed","true"),this.setAttribute("data-reorder-mode","");let a=this.draggableChildren;this.#n(`${this.#u(e)}, grabbed. Position ${this.#e+1} of ${a.length}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}return}if(!r&&(t.key===n||t.key===d)){t.preventDefault();let a=this.draggableChildren,s=a.indexOf(e),l=t.key===n?Math.max(0,s-1):Math.min(a.length-1,s+1);l!==s&&a[l].focus();return}if(r&&(t.key===n||t.key===d)){t.preventDefault();let a=this.draggableChildren,s=a.indexOf(e),l=t.key===n?Math.max(0,s-1):Math.min(a.length-1,s+1);l!==s&&(this.#a(e,l),e.focus(),this.#n(`Position ${l+1} of ${a.length}`));return}let u=i?"ArrowUp":"ArrowLeft",c=i?"ArrowDown":"ArrowRight";if(r&&(t.key===u||t.key===c)){if(t.preventDefault(),!this.group)return;let a=t.key===c?1:-1,s=this.#w(a);if(!s)return;s.appendChild(e),s.#i(),this.#i(),s.#o(e),e.focus();let l=s.getAttribute("aria-label")||"next surface";s.#n(`Moved to ${l}`),s.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:e,itemId:e.dataset.id,fromSurface:this,toSurface:s,newIndex:s.draggableChildren.indexOf(e),fromOrder:this.sortedOrder,toOrder:s.sortedOrder}})),this.removeAttribute("data-reorder-mode"),s.setAttribute("data-reorder-mode",""),this.#e=null;return}if(r&&t.key==="Escape"){t.preventDefault(),e.setAttribute("aria-grabbed","false"),this.removeAttribute("data-reorder-mode"),this.#e!=null&&(this.#a(e,this.#e),e.focus()),this.#n("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0})),this.#e=null;return}!r&&t.key==="Escape"&&(t.preventDefault(),e.blur())}#o(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,d)=>{let u=n.getBoundingClientRect(),c=d.getBoundingClientRect();return u.left-c.left||u.top-c.top});let r=e.indexOf(this);return e[r+t]||null}#u(t){return t.dataset.id||t.textContent.trim().slice(0,40)}#s(t){return this.draggableChildren.indexOf(t)}#a(t,e){let i=this.draggableChildren.filter(n=>n!==t)[e]||null;i?this.insertBefore(t,i):this.appendChild(t)}#i(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#x(t){let e=this.orientation==="horizontal",r=this.draggableChildren.filter(i=>!i.hasAttribute("data-dragging"));for(let i=0;i<r.length;i++){let n=r[i].getBoundingClientRect(),d=e?n.left+n.width/2:n.top+n.height/2;if(t<d)return i}return r.length}#C(t){this.#d();let e=this.orientation==="horizontal",r=this.draggableChildren.filter(i=>!i.hasAttribute("data-dragging"));for(let i=0;i<r.length;i++){let n=r[i].getBoundingClientRect(),d=e?n.left+n.width/2:n.top+n.height/2;if(t<d){r[i].setAttribute("data-drop-target","before");return}}r.length>0&&r[r.length-1].setAttribute("data-drop-target","after")}#d(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#r=null};b("drag-surface",f);export{f as DragSurface};
1
+ var I=window.matchMedia("(prefers-reduced-motion: reduce)");var x=new Map;function C(n,t,e={}){let r=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:r},s=x.get(n);if(customElements.get(n)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}x.set(n,i),customElements.define(n,t)}var y=class extends HTMLElement{#r=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}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.#r)t();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,r,i){t.addEventListener(e,r,i),this.#r.push(()=>t.removeEventListener(e,r,i))}_reinit(){for(let t of this.#r)t();this.#r=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let r=this.#t.states;try{e?r.add(t):r.delete(t)}catch{let i=`--${t}`;e?r.add(i):r.delete(i)}}_adoptInternals(t){this.#t||(this.#t=t)}#e(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#e()?.validity}get validationMessage(){return this.#e()?.validationMessage??""}get willValidate(){return this.#e()?.willValidate??!1}get form(){return this.#e()?.form??null}checkValidity(){return this.#e()?.checkValidity()??!0}reportValidity(){return this.#e()?.reportValidity()??!0}};var g="data-drag-surface-controls",k="data-drag-surface-live",w=class n extends y{static observedAttributes=["disabled","data-move-controls","orientation","group","aria-label"];#r=null;#t=null;#e=null;#y=null;#f=null;setup(){this.setAttribute("role","list"),n.#c.add(this),this.#M(),this.#T(),this.#B(),this.listen(this,"click",this.#K.bind(this)),this.#E(),this.#w(),this.#f=new MutationObserver(()=>this.#I()),this.#f.observe(this,{childList:!0}),n.#d()}teardown(){this.#f?.disconnect(),this.#f=null,this.#r&&(this.#r.remove(),this.#r=null),this.#t&&this.#a(this.#t,!1),this.#t=null,this.#e=null,this.removeAttribute("data-reorder-mode"),this.removeAttribute("data-drag-over"),this.#v(),this.#$(),n.#c.delete(this),n.#s?.source===this&&(n.#s=null),n.#d()}attributeChangedCallback(t,e,r){e===r||!this.hasAttribute("data-upgraded")||(t==="disabled"&&this.#w(),n.#d())}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")==="horizontal"?"horizontal":"vertical"}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#E(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")}#I(){this.#E(),this.#t&&this.#t.parentElement!==this&&(this.#a(this.#t,!1),this.#t=null,this.#e=null,this.removeAttribute("data-reorder-mode")),n.#d()}#w(){this.disabled?(this.setAttribute("aria-disabled","true"),this.#t&&this.#b()):this.removeAttribute("aria-disabled")}#M(){let t=document.createElement("span");t.setAttribute(k,""),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this.after(t),this.#r=t}#n(t){let e=this.#r;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#T(){this.listen(this,"pointerdown",t=>{this.#y=t.target}),this.listen(this,"dragstart",this.#O.bind(this)),this.listen(this,"dragover",this.#L.bind(this)),this.listen(this,"dragleave",this.#q.bind(this)),this.listen(this,"drop",this.#N.bind(this)),this.listen(this,"dragend",this.#R.bind(this))}#O(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this)return;if(this.disabled){t.preventDefault();return}let r=e.querySelector("[data-drag-handle]");if(r&&!r.contains(this.#y)){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 i=this.#i(e);n.#s={item:e,source:this,originalIndex:i},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#x(t){return this.disabled?!1:this.group||t.group?this.group===t.group:t===this}#L(t){let e=n.#s;!e||!this.#x(e.source)||(t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over",""),this.#U(t.clientX,t.clientY))}#q(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#v())}#N(t){let e=n.#s;if(!e||!this.#x(e.source))return;t.preventDefault();let{item:r,source:i,originalIndex:s}=e,a=this.#H(t.clientX,t.clientY);n.#C(),i===this?(this.#u(r,a),this.#o(),this.#l(r),this.#m(r,s)):(this.#u(r,a),this.#o(),i.#o(),this.#l(r),this.#D(r,i))}#R(){let t=n.#s;n.#C(),n.#s=null,(t?.source??this).dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}static#C(){n.#s?.item.removeAttribute("data-dragging");for(let t of n.#c)t.removeAttribute("data-drag-over"),t.#v()}#B(){this.listen(this,"keydown",this.#V.bind(this)),this.listen(this,"focusout",this.#F.bind(this))}#z(t){let e=t.closest('[draggable="true"]');if(!e||e.parentElement!==this)return null;if(t===e)return e;let r=e.querySelector("[data-drag-handle]");return r&&r===t?e:null}#V(t){let e=this.#z(t.target);if(!e||this.disabled||t.altKey||t.ctrlKey||t.metaKey)return;let r=t.target,i=this.#t===e,s=this.orientation==="horizontal",a=this.#A(),o=s?a?"ArrowRight":"ArrowLeft":"ArrowUp",d=s?a?"ArrowLeft":"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){t.preventDefault(),i?this.#G(e):this.#j(e);return}if(t.key===o||t.key===d){t.preventDefault();let l=this.draggableChildren,u=l.indexOf(e),c=t.key===o?Math.max(0,u-1):Math.min(l.length-1,u+1);if(c===u)return;if(!i){l[c].focus();return}this.#u(e,c),r.focus(),this.#n(`Position ${c+1} of ${l.length}`);return}let h=s?"ArrowUp":"ArrowLeft",v=s?"ArrowDown":"ArrowRight";if(i&&(t.key===h||t.key===v)){t.preventDefault();let l=this.#g(t.key===v?1:-1);if(!l)return;this.#t=null,this.#e=null,this.removeAttribute("data-reorder-mode"),this.#S(l,e),r.focus(),l.#t=e,l.#e=l.#i(e),l.setAttribute("data-reorder-mode",""),l.#n(`Moved to ${l.#p()}`);return}t.key==="Escape"&&(t.preventDefault(),i?this.#b():e.blur())}#F(){setTimeout(()=>{let t=this.#t;t&&!t.contains(document.activeElement)&&this.#b()},0)}#j(t){this.#t&&this.#t!==t&&this.#b(),this.#e=this.#i(t),this.#t=t,this.#a(t,!0),this.setAttribute("data-reorder-mode","");let e=this.draggableChildren.length;this.#n(`${this.#h(t)}, grabbed. Position ${this.#e+1} of ${e}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#G(t){let e=this.#e;this.#t=null,this.#e=null,this.#a(t,!1),this.removeAttribute("data-reorder-mode"),this.#o(),this.#l(t);let r=this.#i(t);this.#n(`${this.#h(t)}, dropped at position ${r+1} of ${this.draggableChildren.length}`),this.#m(t,e),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#b(){let t=this.#t;if(!t)return;let e=this.#e;if(this.#t=null,this.#e=null,this.#a(t,!1),this.removeAttribute("data-reorder-mode"),e!=null&&t.parentElement===this&&this.#i(t)!==e){let r=t.contains(document.activeElement)?document.activeElement:null;this.#u(t,e),r?.focus()}this.#n("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#a(t,e){t.toggleAttribute("data-grabbed",e);let r=t.querySelector("[data-drag-handle]");r&&(r.localName==="button"||r.getAttribute("role")==="button")&&r.setAttribute("aria-pressed",String(e)),e?t.hasAttribute("aria-description")||(t.setAttribute("aria-description","Grabbed"),t.setAttribute("data-drag-surface-description","")):t.hasAttribute("data-drag-surface-description")&&(t.removeAttribute("aria-description"),t.removeAttribute("data-drag-surface-description"))}static#d(){for(let t of n.#c)t.#P()}#$(){for(let t of this.querySelectorAll(`:scope > [draggable="true"] > [${g}]`))t.remove()}#P(){if(!this.isConnected)return;if(!this.hasAttribute("data-move-controls")){this.#$();return}let t=this.draggableChildren,e=this.orientation==="horizontal",r=this.#A(),i=this.disabled,s=this.#g(-1),a=this.#g(1),o=e?r?"right":"left":"up",d=e?r?"left":"right":"down",h={up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192"},v=e?h.up:h.left,l=e?h.down:h.right;t.forEach((u,c)=>{let b=u.querySelector(`:scope > [${g}]`);if(!b){b=document.createElement("span"),b.setAttribute(g,"");for(let E of["prev","next","to-prev","to-next"]){let f=document.createElement("button");f.type="button",f.className="ghost small",f.dataset.move=E,b.append(f)}u.append(b)}let m=this.#h(u),A=(E,f,$,S,D=!1)=>{let p=b.querySelector(`[data-move="${E}"]`);p.textContent!==f&&(p.textContent=f),p.setAttribute("aria-label",$),p.setAttribute("aria-disabled",String(S)),p.hidden=D};A("prev",h[o],`Move ${m} ${o}`,i||c===0),A("next",h[d],`Move ${m} ${d}`,i||c===t.length-1),A("to-prev",v,s?`Move ${m} to ${s.#p()}`:"",i,!s),A("to-next",l,a?`Move ${m} to ${a.#p()}`:"",i,!a)})}#K(t){let e=t.target.closest(`[${g}] > button[data-move]`);if(!e)return;let r=e.closest('[draggable="true"]');if(!r||r.parentElement!==this||(t.preventDefault(),this.disabled||e.getAttribute("aria-disabled")==="true"))return;this.#t&&(this.#a(this.#t,!1),this.#t=null,this.#e=null,this.removeAttribute("data-reorder-mode"));let i=e.dataset.move,s=this;if(i==="prev"||i==="next"){let o=this.#i(r),d=o+(i==="prev"?-1:1);if(d<0||d>=this.draggableChildren.length)return;this.#u(r,d),this.#o(),this.#l(r),this.#n(`${this.#h(r)}, moved to position ${d+1} of ${this.draggableChildren.length}`),this.#m(r,o)}else{let o=this.#g(i==="to-next"?1:-1);if(!o)return;this.#S(o,r),o.#n(`${o.#h(r)}, moved to ${o.#p()}`),s=o}n.#d();let a=r.querySelector(`[${g}] > [data-move="${i}"]`);a&&!a.hidden?a.focus():s.isConnected&&r.focus()}#S(t,e){t.appendChild(e),t.#o(),this.#o(),t.#l(e),t.#D(e,this)}#m(t,e){this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,oldIndex:e,newIndex:this.#i(t),order:this.sortedOrder}}))}#D(t,e){this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,fromSurface:e,toSurface:this,newIndex:this.#i(t),fromOrder:e.sortedOrder,toOrder:this.sortedOrder}}))}#l(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#g(t){if(!this.group)return null;let e=[...n.#c].filter(s=>s===this||s.group===this.group&&s.isConnected&&!s.disabled);if(e.length<2)return null;let r=this.orientation==="horizontal",i=new Map(e.map(s=>[s,s.getBoundingClientRect()]));return e.sort((s,a)=>{let o=i.get(s),d=i.get(a);return r?o.top-d.top||o.left-d.left:o.left-d.left||o.top-d.top}),e[e.indexOf(this)+t]||null}#A(){return getComputedStyle(this).direction==="rtl"}#p(){let t=this.getAttribute("aria-label");if(t)return t;let e=this.getAttribute("aria-labelledby");if(e){let r=e.split(/\s+/).map(i=>document.getElementById(i)?.textContent.trim()).filter(Boolean).join(" ");if(r)return r}return"another list"}#h(t){let e=t.getAttribute("aria-label");if(e)return e;let r=t.cloneNode(!0);for(let s of r.querySelectorAll(`[${g}], [aria-hidden="true"], [data-drag-handle]:not(:has(*))`))s.remove();return r.textContent.replace(/\s+/g," ").trim().slice(0,40)||t.dataset.id||"Item"}#i(t){return this.draggableChildren.indexOf(t)}#u(t,e){let i=this.draggableChildren.filter(s=>s!==t)[e]||null;i?this.insertBefore(t,i):this.appendChild(t)}#o(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#k(t,e){let r=this.orientation==="horizontal",i=r&&this.#A(),s=this.draggableChildren.filter(a=>!a.hasAttribute("data-dragging"));for(let a=0;a<s.length;a++){let o=s[a].getBoundingClientRect(),d;if(r?i?d=t>o.left+o.width/2:d=t<o.left+o.width/2:d=e<o.top+o.height/2,d)return{index:a,children:s}}return{index:s.length,children:s}}#H(t,e){return this.#k(t,e).index}#U(t,e){this.#v();let{index:r,children:i}=this.#k(t,e);r<i.length?i[r].setAttribute("data-drop-target","before"):i.length>0&&i[i.length-1].setAttribute("data-drop-target","after")}#v(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#c=new Set;static#s=null};C("drag-surface",w);export{w as DragSurface};
2
2
  //# sourceMappingURL=drag-surface.js.map
@@ -1,2 +1,2 @@
1
- var a=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,s,e,i){t.addEventListener(s,e,i),this.#t.push(()=>t.removeEventListener(s,e,i))}setup(){}teardown(){}setState(t,s){this.#e||(this.#e=this.attachInternals());let e=this.#e.states;try{s?e.add(t):e.delete(t)}catch{let i=`--${t}`;s?e.add(i):e.delete(i)}}_adoptInternals(t){this.#e||(this.#e=t)}};var v=window.matchMedia("(prefers-reduced-motion: reduce)");var p=new Map;function h(r,t,s={}){let e=s.priority??10,i={impl:t,bundle:s.bundle,contract:s.contract,priority:e},o=p.get(r);if(customElements.get(r)){if(!o||o.priority>=e){o&&o.priority===e&&o.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${s.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${s.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=e){o.priority===e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${o.bundle}". Skipping "${s.bundle}" (first wins at equal priority).`);return}p.set(r,i),customElements.define(r,t)}var l=CSS.supports("anchor-name","--x"),m=CSS.supports("position-area","bottom"),b=0,c=class extends a{#t=null;#e=null;#s=null;#i=null;setup(){this.id||(this.id=`pop-over-${++b}`);let t=this.dataset.mode||"auto";this.hasAttribute("popover")||this.setAttribute("popover",t),this.#n(),this.#r(),this.#s=s=>{let e=s.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${e}`,{detail:{state:s.newState},bubbles:!0,composed:!0})),!l&&s.newState==="open"&&this.#t&&this.#o()},this.listen(this,"beforetoggle",this.#s),l||(this.#i=()=>{this.matches(":popover-open")&&this.#t&&this.#o()},this.listen(window,"resize",this.#i),this.listen(window,"scroll",this.#i,{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||!l)&&(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||""),!m)){let t=this.dataset.position||"bottom";this.#a(t)}}#a(t){let s="var(--_pop-over-offset, var(--size-xs))",e={top:{bottom:`calc(anchor(top) + ${s})`,left:"anchor(left)"},bottom:{top:`calc(anchor(bottom) + ${s})`,left:"anchor(left)"},left:{right:`calc(anchor(left) + ${s})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${s})`,top:"anchor(top)"}},i=t.split("-")[0],o=e[i]||e.bottom;Object.entries(o).forEach(([n,f])=>this.style.setProperty(n,f))}#o(){if(!this.#t)return;let t=this.#t.getBoundingClientRect(),s=this.dataset.position||"bottom",e=this.#l(),i,o;switch(s.split("-")[0]){case"top":i=t.top-this.offsetHeight-e,o=t.left;break;case"left":i=t.top,o=t.left-this.offsetWidth-e;break;case"right":i=t.top,o=t.right+e;break;default:i=t.bottom+e,o=t.left;break}s.endsWith("-end")&&(s.startsWith("top")||s.startsWith("bottom")?o=t.right-this.offsetWidth:i=t.bottom-this.offsetHeight),this.style.position="fixed",this.style.top=`${Math.round(i)}px`,this.style.left=`${Math.round(o)}px`,this.style.margin="0"}#l(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset]??t.xs}};h("pop-over",c);var d=0,u=class extends a{#t;#e;#s;#i=[];#n=-1;#r=!1;#a=!1;#o=null;setup(){let t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button");if(!t)return!1;this.#t=t;let s=this.querySelector('menu, ul[role="menu"]');if(!s)return!1;this.#e=s,this.#a=this.hasAttribute("hover"),this.#t.id||(this.#t.id=`dropdown-trigger-${++d}`);let e=this.querySelector(":scope > pop-over[data-dropdown-host]");return e?this.#s=e:(this.#s=document.createElement("pop-over"),this.#s.setAttribute("data-dropdown-host",""),this.#s.id=`dropdown-${++d}`,this.#s.dataset.mode=this.#a?"manual":"auto",this.#s.dataset.position=this.getAttribute("position")||"bottom-start",this.#s.dataset.anchor=this.#t.id,this.#s.appendChild(this.#e),this.appendChild(this.#s)),this.#s.dataset.mode=this.#a?"manual":"auto",this.#s.dataset.position=this.getAttribute("position")||"bottom-start",this.#s.dataset.anchor=this.#t.id,this.#e.parentElement!==this.#s&&this.#s.appendChild(this.#e),this.#t.setAttribute("aria-haspopup","menu"),this.#t.setAttribute("aria-expanded","false"),this.#e.id||(this.#e.id=`dropdown-menu-${++d}`),this.#t.setAttribute("aria-controls",this.#e.id),this.#e.setAttribute("role","menu"),this.#l(),this.#a?(this.listen(this,"mouseenter",this.#d),this.listen(this,"mouseleave",this.#u),this.listen(this.#t,"focus",this.#p),this.listen(this.#t,"blur",this.#f)):this.listen(this.#t,"click",this.#c),this.listen(this.#t,"keydown",this.#m),this.listen(this.#e,"keydown",this.#b),this.listen(this.#s,"pop-over:hide",this.#w),this.listen(this.#s,"pop-over:show",this.#y),this.#a&&this.listen(document,"keydown",this.#g),!0}teardown(){this.#o&&clearTimeout(this.#o)}get items(){if(!this.#e)return[];let t=[];for(let s of this.#e.querySelectorAll(":scope > li")){if(s.matches('[role="separator"]')||s.querySelector("hr")){t.push({separator:!0});continue}let e=s.querySelector('button, a, [role="menuitem"]');e&&t.push({label:e.textContent.trim().replace(/\s+/g," "),value:e.getAttribute("data-value")||void 0,href:e.tagName==="A"?e.getAttribute("href"):void 0,disabled:e.disabled||e.hasAttribute("data-disabled")||void 0})}return t}set items(t){let s=Array.isArray(t)?t:[],e=this.querySelector('menu, ul[role="menu"]');for(e||(e=document.createElement("menu"),this.appendChild(e));e.firstChild;)e.firstChild.remove();for(let i of s){let o=document.createElement("li");if(i.separator)o.setAttribute("role","separator");else{let n=i.href?document.createElement("a"):document.createElement("button");i.href&&n.setAttribute("href",i.href),i.value&&n.setAttribute("data-value",i.value),i.disabled&&(n.tagName==="BUTTON"?n.disabled=!0:n.setAttribute("data-disabled","")),n.textContent=i.label||"",o.appendChild(n)}e.appendChild(o)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("drop-down:items-changed",{detail:{items:s,source:"property"},bubbles:!0}))}#l(){this.#i=Array.from(this.#e.querySelectorAll('button, a, [role="menuitem"]')).filter(t=>!t.disabled&&!t.closest('[role="separator"]')),this.#i.forEach(t=>{t.setAttribute("role","menuitem"),t.setAttribute("tabindex","-1"),t.addEventListener("click",this.#v)}),this.#e.querySelectorAll('li:empty, [role="separator"], hr').forEach(t=>{t.setAttribute("role","separator")})}#c=t=>{t.stopPropagation(),this.toggle()};#d=()=>{this.#o&&(clearTimeout(this.#o),this.#o=null,this.setState("hover-grace-pending",!1)),this.open()};#u=()=>{this.setState("hover-grace-pending",!0),this.#o=setTimeout(()=>{this.setState("hover-grace-pending",!1),this.close()},100)};#p=()=>{this.#o&&(clearTimeout(this.#o),this.#o=null,this.setState("hover-grace-pending",!1)),this.open()};#f=t=>{this.#e?.contains(t.relatedTarget)||(this.setState("hover-grace-pending",!0),this.#o=setTimeout(()=>{this.setState("hover-grace-pending",!1),this.contains(document.activeElement)||this.close()},100))};#m=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.open(),this.#h(0);break;case"ArrowUp":case"Up":t.preventDefault(),this.open(),this.#h(this.#i.length-1);break}};#b=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.#h(this.#n+1);break;case"ArrowUp":case"Up":t.preventDefault(),this.#h(this.#n-1);break;case"Home":t.preventDefault(),this.#h(0);break;case"End":t.preventDefault(),this.#h(this.#i.length-1);break;case"Tab":this.close();break;case"Enter":case" ":t.preventDefault(),this.#n>=0&&this.#i[this.#n].click();break}};#g=t=>{t.key==="Escape"&&this.#r&&(t.preventDefault(),this.close(),this.#t?.focus())};#v=t=>{t.defaultPrevented||(this.close(),this.#t?.focus())};#y=()=>{this.#r||(this.#r=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#n=-1,this.dispatchEvent(new CustomEvent("drop-down:open",{bubbles:!0})))};#w=()=>{this.#r&&(this.#r=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#n=-1,this.dispatchEvent(new CustomEvent("drop-down:close",{bubbles:!0})))};#h(t){this.#i.length!==0&&(t<0&&(t=this.#i.length-1),t>=this.#i.length&&(t=0),this.#n=t,this.#i[t].focus())}open(){this.#r||!this.#s||this.#s.show()}close(){!this.#r||!this.#s||this.#s.hide()}toggle(){this.#r?this.close():this.open()}get isOpen(){return this.#r}};h("drop-down",u);export{u as DropDown};
1
+ var u=class extends HTMLElement{#t=[];#s;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}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))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#s||(this.#s=this.attachInternals());let i=this.#s.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#s||(this.#s=t)}#e(){return this.constructor.formAssociated&&this.#s?this.#s:null}get validity(){return this.#e()?.validity}get validationMessage(){return this.#e()?.validationMessage??""}get willValidate(){return this.#e()?.willValidate??!1}get form(){return this.#e()?.form??null}checkValidity(){return this.#e()?.checkValidity()??!0}reportValidity(){return this.#e()?.reportValidity()??!0}};var H=window.matchMedia("(prefers-reduced-motion: reduce)");var C=new Map;function p(o,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},r=C.get(o);if(customElements.get(o)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}C.set(o,s),customElements.define(o,t)}var f=CSS.supports("anchor-name","--x"),T=CSS.supports("position-area","bottom"),q=(()=>{let o=document.createElement("span");return o.setAttribute("popover","hint"),o.popover==="hint"})(),D=["auto","manual","hint"];function I(o){let t=D.includes(o||"")?o:"auto";return t==="hint"&&!q?"auto":t}var N=["top","bottom","left","right","inset-inline-start","inset-inline-end"],O=["position","top","left","right","bottom","margin"],P=8,V=0,B=0;function $(o){return!o||o==="none"?[]:o.split(",").map(t=>t.trim()).filter(Boolean)}var v=class extends u{static get observedAttributes(){return["data-mode","data-anchor","data-position"]}#t=null;#s=null;#e=`--pop-over-anchor-${++B}`;#i=!1;#r=!1;#n=!1;setup(){if(this.id||(this.id=`pop-over-${++V}`),(!this.hasAttribute("popover")||this.#i)&&this.#o(),this.#u(),this.#a(),this.listen(this,"beforetoggle",t=>{let e=t.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${e}`,{detail:{state:t.newState},bubbles:!0,composed:!0})),!f&&t.newState==="open"&&this.#t&&queueMicrotask(()=>{this.matches(":popover-open")&&this.#h()})}),!f){let t=()=>{this.matches(":popover-open")&&this.#t&&this.#h()};this.listen(window,"resize",t),this.listen(window,"scroll",t,{capture:!0,passive:!0})}}teardown(){this.#d(),this.#r&&(N.forEach(t=>this.style.removeProperty(t)),this.#r=!1),this.#n&&(O.forEach(t=>this.style.removeProperty(t)),this.#n=!1),this.#t=null}attributeChangedCallback(t,e,i){if(e!==i){if(!this.hasAttribute("data-upgraded")){t==="data-mode"&&this.hasAttribute("popover")&&!this.isConnected&&(this.#i=!0);return}if(t==="data-mode"){this.#o();return}this._reinit()}}#o(){let t=I(this.dataset.mode);this.getAttribute("popover")!==t&&this.setAttribute("popover",t),this.#i=!0}show(){this.matches(":popover-open")||(this.showPopover(),!f&&this.#t&&this.matches(":popover-open")&&this.#h())}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#u(){let t=this.dataset.anchor;if(t){let e=document.getElementById(t);if(!e)try{e=document.querySelector(t)}catch{e=null}this.#t=e}else this.#t=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#a(){if(!this.#t||!f)return;let t=this.#t,e=t.style.getPropertyValue("anchor-name"),i=$(e||getComputedStyle(t).getPropertyValue("anchor-name"));i.includes(this.#e)||i.push(this.#e),t.style.setProperty("anchor-name",i.join(", ")),this.#s=this.#e,this.style.setProperty("position-anchor",this.#e),this.setAttribute("data-anchor-name",this.#e),T||this.#p(this.dataset.position||"bottom")}#d(){if(this.#t&&this.#s){let t=$(this.#t.style.getPropertyValue("anchor-name")).filter(e=>e!==this.#s);t.length?this.#t.style.setProperty("anchor-name",t.join(", ")):this.#t.style.removeProperty("anchor-name")}this.#s=null,this.style.getPropertyValue("position-anchor")&&this.style.removeProperty("position-anchor"),this.hasAttribute("data-anchor-name")&&this.removeAttribute("data-anchor-name")}#p(t){let e="var(--_pop-over-offset, var(--size-xs))",i=t.endsWith("-end")?{"inset-inline-end":"anchor(end)"}:{"inset-inline-start":"anchor(start)"},s={top:{bottom:`calc(anchor(top) + ${e})`,...i},bottom:{top:`calc(anchor(bottom) + ${e})`,...i},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},r=t.split("-")[0],n=s[r]||s.bottom;Object.entries(n).forEach(([h,a])=>this.style.setProperty(h,a)),this.#r=!0}#h(){if(!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#l(),s=document.documentElement.clientWidth,r=document.documentElement.clientHeight;this.style.position="fixed",this.style.margin="0",this.style.right="auto",this.style.bottom="auto",this.#n=!0;let n=this.offsetWidth,h=this.offsetHeight,a=e.split("-")[0];["top","bottom","left","right"].includes(a)||(a="bottom");let b={top:t.top-i,bottom:r-t.bottom-i,left:t.left-i,right:s-t.right-i},E={top:"bottom",bottom:"top",left:"right",right:"left"},x=a==="top"||a==="bottom"?h:n;b[a]<x&&b[E[a]]>b[a]&&(a=E[a]);let l,c;switch(a){case"top":l=t.top-h-i,c=t.left;break;case"left":l=t.top,c=t.left-n-i;break;case"right":l=t.top,c=t.right+i;break;default:l=t.bottom+i,c=t.left;break}if(a==="top"||a==="bottom"){let g=getComputedStyle(this).direction==="rtl";c=e.endsWith("-end")!==g?t.right-n:t.left}else e.endsWith("-end")&&(l=t.bottom-h);let k=(g,S,M)=>Math.max(P,Math.min(g,M-S-P));c=k(c,n,s),l=k(l,h,r),this.style.top=`${Math.round(l)}px`,this.style.left=`${Math.round(c)}px`}#l(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset||""]??t.xs}};p("pop-over",v);var y=0,d='button, a, [role="menuitem"]',m='menu, ul[role="menu"]',L=500;function A(o){return o.hasAttribute("data-disabled")||o.getAttribute("aria-disabled")==="true"||!!o.disabled}var w=class extends u{#t;#s;#e;#i;#r=[];#n=-1;#o=!1;#u=!1;#a=null;#d="";#p=!1;#h=!1;#l=null;#f(){return this.querySelector(`:scope > :is(${m}), :scope > pop-over[data-dropdown-host] > :is(${m})`)}setup(){let t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button:not([data-dropdown-toggle])");if(!t)return!1;this.#t=t;let e=this.#f();if(!e)return!1;this.#e=e,this.#u=this.hasAttribute("hover"),this.#t.id||(this.#t.id=`dropdown-trigger-${++y}`);let i=this.querySelector(":scope > pop-over[data-dropdown-host]");return i?this.#i=i:(this.#i=document.createElement("pop-over"),this.#i.setAttribute("data-dropdown-host",""),this.#i.id=`dropdown-${++y}`,this.#i.dataset.mode=this.#u?"manual":"auto",this.#i.dataset.position=this.getAttribute("position")||"bottom-start",this.#i.dataset.anchor=this.#t.id,this.#i.appendChild(this.#e),this.appendChild(this.#i)),this.#i.dataset.mode=this.#u?"manual":"auto",this.#i.dataset.position=this.getAttribute("position")||"bottom-start",this.#i.dataset.anchor=this.#t.id,this.#e.parentElement!==this.#i&&this.#i.appendChild(this.#e),this.#e.id||(this.#e.id=`dropdown-menu-${++y}`),this.#u?this.#y():this.#v(),this.listen(this.#e,"click",this.#P,{capture:!0}),this.listen(this.#e,"click",this.#$),this.listen(this.#i,"pop-over:hide",this.#O),this.listen(this.#i,"pop-over:show",this.#N),!0}#v(){this.#s=this.#t,this.querySelector(":scope > button[data-dropdown-toggle]")?.remove(),this.#t.setAttribute("aria-haspopup","menu"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-controls",this.#e.id),this.#e.setAttribute("role","menu"),this.#A(),this.listen(this.#t,"pointerdown",this.#w),this.listen(this.#t,"click",this.#E),this.listen(this.#t,"keydown",this.#k),this.listen(this.#e,"keydown",this.#S)}#y(){let t=this.#t;if(this.#t.localName==="a"){if(t=this.querySelector(":scope > button[data-dropdown-toggle]"),t||(t=document.createElement("button"),t.setAttribute("type","button"),t.setAttribute("data-dropdown-toggle",""),this.#t.after(t)),!t.hasAttribute("aria-label")&&!t.textContent.trim()){let e=this.#t.textContent.trim().replace(/\s+/g," ");t.setAttribute("aria-label",`${e} submenu`)}this.#t.removeAttribute("aria-haspopup"),this.#t.removeAttribute("aria-expanded"),this.#t.removeAttribute("aria-controls")}t&&(this.#s=t,t.removeAttribute("aria-haspopup"),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-controls",this.#e.id),this.#e.removeAttribute("role"),this.#e.querySelectorAll(':scope > li[role="none"]').forEach(e=>e.removeAttribute("role")),this.#r=this.#m(),this.#r.forEach(e=>{e.getAttribute("role")==="menuitem"&&e.removeAttribute("role"),e.getAttribute("tabindex")==="-1"&&e.removeAttribute("tabindex"),e.hasAttribute("data-disabled")&&e.setAttribute("aria-disabled","true")}),this.#b(),this.listen(t,"click",this.#x),this.listen(this,"pointerenter",this.#M),this.listen(this,"pointerleave",this.#T),this.listen(this,"focusout",this.#q),this.listen(document,"keydown",this.#D),this.listen(document,"pointerdown",this.#I))}teardown(){this.#a&&clearTimeout(this.#a),this.#a=null,this.#l&&clearTimeout(this.#l),this.#l=null,this.#d="",this.#o&&this.#i?.hide?.(),this.#o=!1,this.#h=!1,this.#n=-1,this.removeAttribute("open"),this.#s?.setAttribute("aria-expanded","false")}get items(){let t=this.#e||this.#f();if(!t)return[];let e=[];for(let i of t.querySelectorAll(":scope > li")){if(i.matches('[role="separator"]')||i.querySelector(":scope > hr")){e.push({separator:!0});continue}let s=i.querySelector(d);s&&e.push({label:s.textContent.trim().replace(/\s+/g," "),value:s.getAttribute("data-value")||void 0,href:s.tagName==="A"?s.getAttribute("href"):void 0,disabled:A(s)||void 0})}return e}set items(t){let e=Array.isArray(t)?t:[],i=this.#e||this.#f();for(i||(i=document.createElement("menu"),this.appendChild(i));i.firstChild;)i.firstChild.remove();for(let s of e){let r=document.createElement("li");if(s.separator)r.setAttribute("role","separator");else{let n=s.href?document.createElement("a"):document.createElement("button");s.href?n.setAttribute("href",s.href):n.setAttribute("type","button"),s.value&&n.setAttribute("data-value",s.value),s.disabled&&(n.setAttribute("data-disabled",""),n.setAttribute("aria-disabled","true")),n.textContent=s.label||"",r.appendChild(n)}i.appendChild(r)}this._reinit(),this.dispatchEvent(new CustomEvent("drop-down:items-changed",{detail:{items:e,source:"property"},bubbles:!0}))}#m(){return Array.from(this.#e.querySelectorAll(d)).filter(t=>t.closest(m)===this.#e&&!t.closest('[role="separator"]'))}#b(){this.#e.querySelectorAll(':scope > li:empty, :scope > [role="separator"], :scope > hr').forEach(t=>{t.setAttribute("role","separator")})}#A(){let t=this.#m();t.forEach(e=>{e.setAttribute("role","menuitem"),e.setAttribute("tabindex","-1"),e.hasAttribute("data-disabled")&&e.setAttribute("aria-disabled","true")}),this.#r=t.filter(e=>!e.disabled),this.#e.querySelectorAll(":scope > li").forEach(e=>{e.querySelector(`:scope > :is(${d})`)&&e.setAttribute("role","none")}),this.#b()}#w=()=>{this.#p=this.#o};#E=t=>{let e=this.#p;if(this.#p=!1,!(t.detail!==0&&e&&!this.#o)){if(t.detail===0&&!this.#o){this.open(),this.#c(0);return}this.toggle()}};#k=t=>{switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.open(),this.#c(0);break;case"ArrowUp":case"Up":t.preventDefault(),this.open(),this.#c(this.#r.length-1);break}};#S=t=>{if(!(t.defaultPrevented||t.target.closest?.(m)!==this.#e))switch(t.key){case"ArrowDown":case"Down":t.preventDefault(),this.#c(this.#n+1);break;case"ArrowUp":case"Up":t.preventDefault(),this.#c(this.#n-1);break;case"Home":t.preventDefault(),this.#c(0);break;case"End":t.preventDefault(),this.#c(this.#r.length-1);break;case"Escape":t.preventDefault(),this.close(),this.#s?.focus();break;case"Tab":this.close();break;case"Enter":case" ":{t.preventDefault();let i=this.#r[this.#n];i&&!A(i)&&i.click();break}default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&this.#C(t.key)}};#C(t){this.#l&&clearTimeout(this.#l),this.#l=setTimeout(()=>{this.#d=""},L),this.#d+=t.toLowerCase();let e=this.#d,i=[...e].every(n=>n===e[0])?e[0]:e,s=this.#r.length,r=i.length>1?0:1;for(let n=0;n<s;n++){let h=(this.#n+r+n+s)%s;if(this.#r[h].textContent.trim().toLowerCase().startsWith(i)){this.#c(h);return}}}#P=t=>{let e=t.target.closest?.(d);e&&this.#r.includes(e)&&A(e)&&(t.preventDefault(),t.stopPropagation())};#$=t=>{let e=t.target.closest?.(d);!e||!this.#r.includes(e)||e.closest("drop-down")===this&&(t.defaultPrevented||(this.dispatchEvent(new CustomEvent("drop-down:select",{bubbles:!0,detail:{item:e,value:e.getAttribute("data-value")||void 0}})),this.close(),this.#s?.focus()))};#x=t=>{if(this.#g(),t.detail!==0&&this.#h&&this.#o){this.#h=!1;return}this.toggle()};#g(){this.#a&&(clearTimeout(this.#a),this.#a=null,this.setState("hover-grace-pending",!1))}#M=t=>{t.pointerType==="mouse"&&(this.#g(),this.#o||(this.open(),this.#h=!0))};#T=t=>{t.pointerType!=="mouse"||!this.#o||this.contains(document.activeElement)&&document.activeElement!==this.#s&&document.activeElement!==this.#t||(this.setState("hover-grace-pending",!0),this.#a=setTimeout(()=>{this.#a=null,this.setState("hover-grace-pending",!1),this.close()},100))};#q=t=>{let e=t.relatedTarget;e&&this.contains(e)||!e&&this.matches(":hover")||this.close()};#D=t=>{if(t.key!=="Escape"||!this.#o)return;let e=this.contains(document.activeElement);t.preventDefault(),this.close(),e&&this.#s?.focus()};#I=t=>{if(!this.#o)return;t.composedPath().includes(this)||this.close()};#N=t=>{t.target!==this.#i||this.#o||(this.#o=!0,this.setAttribute("open",""),this.#s?.setAttribute("aria-expanded","true"),this.#n=-1,this.dispatchEvent(new CustomEvent("drop-down:open",{bubbles:!0})))};#O=t=>{t.target!==this.#i||!this.#o||(this.#o=!1,this.#h=!1,this.removeAttribute("open"),this.#s?.setAttribute("aria-expanded","false"),this.#n=-1,this.#e?.contains(document.activeElement)&&this.#s?.focus(),this.dispatchEvent(new CustomEvent("drop-down:close",{bubbles:!0})))};#c(t){this.#r.length!==0&&(t<0&&(t=this.#r.length-1),t>=this.#r.length&&(t=0),this.#n=t,this.#r[t].focus())}open(){this.#o||!this.#i||this.#i.show()}close(){!this.#o||!this.#i||this.#i.hide()}toggle(){this.#o?this.close():this.open()}get isOpen(){return this.#o}};p("drop-down",w);export{w as DropDown};
2
2
  //# sourceMappingURL=drop-down.js.map
@@ -1,2 +1,2 @@
1
- var E=Object.defineProperty;var S=(i,e)=>()=>(i&&(e=i(i=0)),e);var A=(i,e)=>{for(var o in e)E(i,o,{get:e[o],enumerable:!0})};var b={};A(b,{EMOJI_ALIASES:()=>k,EMOJI_GROUPS:()=>F,EMOJI_GROUP_ICONS:()=>M,EMOJI_GROUP_LABELS:()=>C,EMOJI_MAP:()=>n,getByGroup:()=>T,resolveEmoji:()=>x,searchEmoji:()=>R});function f(i){for(let[e,o,t,r]of i){if(n.has(e))continue;let s={shortcode:e,emoji:o,name:t,keywords:[],group:r};n.set(e,s),m.push(s)}}function x(i){let e=n.get(i);if(e)return e;let o=k.get(i);return o&&n.get(o)||null}function T(i){let e=l.filter(t=>t.group===i),o=m.filter(t=>t.group===i);return o.length>0?e.concat(o):e}function R(i){let e=i.toLowerCase().trim(),o=m.length>0?l.concat(m):l;return e?o.filter(t=>t.shortcode.includes(e)||t.name.toLowerCase().includes(e)||t.keywords&&t.keywords.some(r=>r.includes(e))):o}var l,n,k,F,C,M,m,j=S(()=>{l=[{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"}],n=new Map(l.map(i=>[i.shortcode,i])),k=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"]]),F=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],C={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},M={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}"},m=[];globalThis.__vbEmojiRegister=f;globalThis.__vbEmojiExtended&&(f(globalThis.__vbEmojiExtended),delete globalThis.__vbEmojiExtended)});var P=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function w(i,e,o={}){let t=o.priority??10,r={impl:e,bundle:o.bundle,contract:o.contract,priority:t},s=y.get(i);if(customElements.get(i)){if(!s||s.priority>=t){s&&s.priority===t&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${o.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${o.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=t){s.priority===t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}". Skipping "${o.bundle}" (first wins at equal priority).`);return}y.set(i,r),customElements.define(i,e)}var c=class extends HTMLElement{#e=[];#o;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 e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,o,t,r){e.addEventListener(o,t,r),this.#e.push(()=>e.removeEventListener(o,t,r))}setup(){}teardown(){}setState(e,o){this.#o||(this.#o=this.attachInternals());let t=this.#o.states;try{o?t.add(e):t.delete(e)}catch{let r=`--${e}`;o?t.add(r):t.delete(r)}}_adoptInternals(e){this.#o||(this.#o=e)}};var h=null;async function B(){return h||(h=await Promise.resolve().then(()=>(j(),b)),h)}var p=8,O=150,v="vb-emoji-recent",g=class extends c{#e;#o;#t;#r;#n;#a=!1;#d=[];#i=-1;#m=null;#c="";#s=null;#y=!1;#h=null;#u=null;setup(){return this.#k(),!0}async#k(){this.#s=await B(),this.#y||(this.#f(),this.#y=!0),this.#e&&this.listen(this.#e,"click",this.#v),this.listen(document,"click",this.#_),this.listen(document,"keydown",this.#E)}teardown(){this.#m&&(clearTimeout(this.#m),this.setState("search-pending",!1))}#f(){this.#e=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#e||(this.#e=document.createElement("button"),this.#e.type="button",this.#e.textContent="\u{1F600}",this.#e.setAttribute("data-trigger",""),this.prepend(this.#e)),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.#e.setAttribute("aria-label",this.#e.getAttribute("aria-label")||"Open emoji picker"),this.#b()}#b(){this.#o=document.createElement("div"),this.#o.classList.add("picker"),this.#o.setAttribute("role","dialog"),this.#o.setAttribute("aria-label","Emoji picker"),this.#o.hidden=!0,this.#t=document.createElement("input"),this.#t.type="search",this.#t.placeholder="Search emoji\u2026",this.#t.setAttribute("aria-label","Search emoji"),this.#t.addEventListener("input",this.#S),this.#t.addEventListener("keydown",this.#A),this.#o.appendChild(this.#t),this.#n=document.createElement("nav"),this.#n.classList.add("categories"),this.#n.setAttribute("role","tablist"),this.#n.setAttribute("aria-label","Emoji categories");for(let e of this.#s.EMOJI_GROUPS){let o=document.createElement("button");o.type="button",o.setAttribute("role","tab"),o.setAttribute("aria-selected",e===this.#s.EMOJI_GROUPS[0]?"true":"false"),o.setAttribute("data-group",e),o.setAttribute("aria-label",this.#s.EMOJI_GROUP_LABELS[e]),o.title=this.#s.EMOJI_GROUP_LABELS[e],o.textContent=this.#s.EMOJI_GROUP_ICONS[e],o.addEventListener("click",this.#F),this.#n.appendChild(o)}this.#o.appendChild(this.#n),this.#r=document.createElement("div"),this.#r.classList.add("grid"),this.#r.setAttribute("role","grid"),this.#r.setAttribute("aria-label","Emoji"),this.#r.addEventListener("keydown",this.#C),this.#o.appendChild(this.#r),this.appendChild(this.#o),this.#p()}#p(e=null){this.#r.innerHTML="",this.#d=[],this.#i=-1;let o=this.#w();if(!this.#c&&o.length>0){let r=document.createElement("div");r.classList.add("group-label"),r.textContent="Recently Used",r.setAttribute("data-group-heading","recent"),this.#r.appendChild(r);for(let s of o){let a=this.#s.EMOJI_MAP.get(s);a&&this.#g(a)}}let t=e||null;if(t)if(t.length===0){let r=document.createElement("div");r.classList.add("no-results"),r.textContent="No emoji found",this.#r.appendChild(r)}else for(let r of t)this.#g(r);else for(let r of this.#s.EMOJI_GROUPS){let s=document.createElement("div");s.classList.add("group-label"),s.textContent=this.#s.EMOJI_GROUP_LABELS[r],s.setAttribute("data-group-heading",r),this.#r.appendChild(s);let a=this.#s.getByGroup(r);for(let u of a)this.#g(u)}}#g(e){let o=document.createElement("button");o.type="button",o.setAttribute("role","gridcell"),o.setAttribute("tabindex","-1"),o.setAttribute("data-shortcode",e.shortcode),o.title=`${e.name} :${e.shortcode}:`,o.textContent=e.emoji,o.addEventListener("click",this.#M),this.#r.appendChild(o),this.#d.push(o)}#j(){let e=this.getAttribute("for");if(!e)return;let o=document.getElementById(e);if(o){if(o.tagName==="INPUT"||o.tagName==="TEXTAREA"){let t=o;this.#h={start:t.selectionStart??t.value.length,end:t.selectionEnd??t.value.length},this.#u=null}else if(o.isContentEditable){let t=window.getSelection();t&&t.rangeCount>0&&(this.#u=t.getRangeAt(0).cloneRange()),this.#h=null}}}#v=e=>{e.stopPropagation(),this.toggle()};#_=e=>{this.#a&&!this.contains(e.target)&&this.close()};#E=e=>{e.key==="Escape"&&this.#a&&(e.preventDefault(),this.close(),this.#e?.focus())};#S=()=>{this.#m&&clearTimeout(this.#m),this.setState("search-pending",!0),this.#m=setTimeout(()=>{if(this.setState("search-pending",!1),this.#c=this.#t.value.trim(),this.#c){let e=this.#s.searchEmoji(this.#c);this.#p(e)}else this.#p()},O)};#A=e=>{e.key==="ArrowDown"&&(e.preventDefault(),this.#d.length>0&&this.#l(0))};#F=e=>{let o=e.currentTarget.getAttribute("data-group");for(let r of this.#n.querySelectorAll('[role="tab"]'))r.setAttribute("aria-selected",r===e.currentTarget?"true":"false");this.#c&&(this.#t.value="",this.#c="",this.#p());let t=this.#r.querySelector(`[data-group-heading="${o}"]`);t&&t.scrollIntoView({block:"start",behavior:"smooth"})};#C=e=>{let o=this.#d.length;if(o!==0)switch(e.key){case"ArrowRight":e.preventDefault(),this.#l(this.#i+1);break;case"ArrowLeft":e.preventDefault(),this.#l(this.#i-1);break;case"ArrowDown":e.preventDefault(),this.#l(this.#i+p);break;case"ArrowUp":e.preventDefault(),this.#i<p?(this.#t.focus(),this.#i=-1):this.#l(this.#i-p);break;case"Home":e.preventDefault(),this.#l(0);break;case"End":e.preventDefault(),this.#l(o-1);break;case"Enter":case" ":e.preventDefault(),this.#i>=0&&this.#d[this.#i].click();break;case"Tab":this.close();break}};#M=e=>{let o=e.currentTarget.getAttribute("data-shortcode"),t=this.#s.EMOJI_MAP.get(o);t&&(this.#R(o),this.#x(t),this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:t.shortcode,emoji:t.emoji,name:t.name,keywords:t.keywords}})),this.close(),this.#T())};#l(e){let o=this.#d.length;o!==0&&(e<0&&(e=0),e>=o&&(e=o-1),this.#i=e,this.#d[e].focus())}#x(e){let o=this.getAttribute("for");if(!o)return;let t=document.getElementById(o);if(t){if(t.tagName==="INPUT"||t.tagName==="TEXTAREA"){let r=t,s=this.#h?.start??r.value.length,a=this.#h?.end??s,u=r.value.slice(0,s),_=r.value.slice(a);r.value=u+e.emoji+_;let d=s+e.emoji.length;r.setSelectionRange(d,d),this.#h={start:d,end:d},t.dispatchEvent(new Event("input",{bubbles:!0}))}else if(t.isContentEditable){t.focus();let r=window.getSelection();if(r&&this.#u){r.removeAllRanges(),r.addRange(this.#u);let s=r.getRangeAt(0);s.deleteContents();let a=document.createTextNode(e.emoji);s.insertNode(a),s.setStartAfter(a),s.collapse(!0),r.removeAllRanges(),r.addRange(s),this.#u=s.cloneRange()}else if(r){let s=document.createRange();s.selectNodeContents(t),s.collapse(!1);let a=document.createTextNode(e.emoji);s.insertNode(a),s.setStartAfter(a),s.collapse(!0),r.removeAllRanges(),r.addRange(s)}}}}#T(){let e=this.getAttribute("for");if(!e)return;let o=document.getElementById(e);o&&o.focus()}#w(){try{return JSON.parse(localStorage.getItem(v)||"[]")}catch{return[]}}#R(e){let o=parseInt(this.getAttribute("recent-limit")??"24",10)||24,t=this.#w();t=t.filter(r=>r!==e),t.unshift(e),t.length>o&&(t.length=o);try{localStorage.setItem(v,JSON.stringify(t))}catch{}}open(){this.#a||(this.#j(),this.#a=!0,this.setAttribute("open",""),this.#e?.setAttribute("aria-expanded","true"),this.#o.hidden=!1,this.#t.value="",this.#c="",this.#p(),requestAnimationFrame(()=>{this.#t.focus()}),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0})))}close(){this.#a&&(this.#a=!1,this.removeAttribute("open"),this.#e?.setAttribute("aria-expanded","false"),this.#o.hidden=!0,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0})))}toggle(){this.#a?this.close():this.open()}get isOpen(){return this.#a}};w("emoji-picker",g);export{g as EmojiPicker};
1
+ var T=Object.defineProperty;var R=(n,e)=>()=>(n&&(e=n(n=0)),e);var I=(n,e)=>{for(var o in e)T(n,o,{get:e[o],enumerable:!0})};var A={};I(A,{EMOJI_ALIASES:()=>_,EMOJI_GROUPS:()=>B,EMOJI_GROUP_ICONS:()=>O,EMOJI_GROUP_LABELS:()=>P,EMOJI_MAP:()=>m,EXTENDED_EVENT:()=>L,EXTENDED_REGISTRY:()=>S,extendedCount:()=>H,getByGroup:()=>N,resolveEmoji:()=>G,searchEmoji:()=>D});function y(){for(;E<v.length;){let n=v[E++];for(let[e,o,t,s]of n){if(m.has(e))continue;let r={shortcode:e,emoji:o,name:t,keywords:[],group:s};m.set(e,r),u.push(r)}}}function H(){return y(),u.length}function G(n){y();let e=m.get(n);if(e)return e;let o=_.get(n);return o&&m.get(o)||null}function N(n){y();let e=g.filter(t=>t.group===n),o=u.filter(t=>t.group===n);return o.length>0?e.concat(o):e}function D(n){y();let e=n.toLowerCase().trim(),o=u.length>0?g.concat(u):g;return e?o.filter(t=>t.shortcode.includes(e)||t.name.toLowerCase().includes(e)||t.keywords&&t.keywords.some(s=>s.includes(e))):o}var g,m,_,B,P,O,S,L,v,E,u,C=R(()=>{g=[{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"}],m=new Map(g.map(n=>[n.shortcode,n])),_=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"],["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"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),B=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],P={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},O={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}"},S=Symbol.for("vanilla-breeze.emoji-extended"),L="vb:emoji-extended",v=globalThis[S]??=[],E=0,u=[]});var W=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;function b(n,e,o={}){let t=o.priority??10,s={impl:e,bundle:o.bundle,contract:o.contract,priority:t},r=k.get(n);if(customElements.get(n)){if(!r||r.priority>=t){r&&r.priority===t&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${o.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${o.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=t){r.priority===t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}". Skipping "${o.bundle}" (first wins at equal priority).`);return}k.set(n,s),customElements.define(n,e)}var p=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}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 e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,o,t,s){e.addEventListener(o,t,s),this.#t.push(()=>e.removeEventListener(o,t,s))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,o){this.#e||(this.#e=this.attachInternals());let t=this.#e.states;try{o?t.add(e):t.delete(e)}catch{let s=`--${e}`;o?t.add(s):t.delete(s)}}_adoptInternals(e){this.#e||(this.#e=e)}#o(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#o()?.validity}get validationMessage(){return this.#o()?.validationMessage??""}get willValidate(){return this.#o()?.willValidate??!1}get form(){return this.#o()?.form??null}checkValidity(){return this.#o()?.checkValidity()??!0}reportValidity(){return this.#o()?.reportValidity()??!0}};var j="popover"in HTMLElement.prototype;var x=null;function $(){return x??=Promise.resolve().then(()=>(C(),A)),x}var q=150,F="vb-emoji-recent",d=8,M=4,U=0,z={Trigger:"Open emoji picker",Dialog:"Emoji picker",Search:"Search emoji",Placeholder:"Search emoji\u2026",Categories:"Emoji categories",Emoji:"Emoji",Recent:"Recently used",Empty:"No emoji found",Results:"{count} emoji found"},f=class extends p{#t=null;#e;#o;#i;#s;#h;#p;#g;#b=new Map;#j=new WeakMap;#n=null;#r=!1;#m=!1;#C=!1;#x=!1;#P=-1;#F=0;#d=null;#O;#L=()=>{};#l=null;#y="";#c=null;#f=null;#v=new Set;#w=!1;#k=null;#E=null;constructor(){super(),this.#O=new Promise(e=>{this.#L=e})}get ready(){return this.#O}get isOpen(){return this.#r}setup(){if(this.#C)return!1;this.#C=!0,this.#J(),this.listen(this,"click",this.#oe),this.listen(this,"keydown",this.#ie),this.listen(this,"focusout",this.#se),this.listen(this,"focusin",this.#re);let e=++this.#F;return $().then(o=>{if(e!==this.#F||!this.isConnected)return;this.#c=o,this.#m||this.#K(),this.listen(document,"click",this.#te),this.listen(document,o.EXTENDED_EVENT,this.#ae),this.setAttribute("data-upgraded",""),this.#L(),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("emoji-picker:upgraded",{bubbles:!0}))});let t=this.#d;this.#d=null,t==="open"&&this.open()}).catch(o=>{console.error("[emoji-picker] failed to load emoji data",o)}),!1}teardown(){this.#F++,this.#C=!1,this.#d=null,this.#l&&(clearTimeout(this.#l),this.#l=null,this.setState("search-pending",!1)),this.#r&&this.close()}#a(e,o){return this.dataset[`label${e}`]||o||z[e]||""}#_(e){if(e==="recent")return this.#a("Recent");let o=e.charAt(0).toUpperCase()+e.slice(1);return this.#a(o,this.#c.EMOJI_GROUP_LABELS[e]||e)}#J(){let e=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button");e||(e=document.createElement("button"),e.type="button",e.textContent="\u{1F600}",e.setAttribute("data-trigger",""),this.prepend(e)),this.#t=e,e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded",String(this.#r)),!e.hasAttribute("aria-label")&&!/\p{L}/u.test(e.textContent||"")&&e.setAttribute("aria-label",this.#a("Trigger"))}#K(){let e=`emoji-picker-${++U}`;this.#e=document.createElement("div"),this.#e.className="picker",this.#e.id=`${e}-panel`,this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label",this.#a("Dialog")),this.#e.hidden=!0,this.#w=j,this.#w&&this.#e.setAttribute("popover","manual"),this.#t?.setAttribute("aria-controls",this.#e.id),this.#o=document.createElement("input"),this.#o.type="search",this.#o.placeholder=this.#a("Placeholder"),this.#o.autocomplete="off",this.#o.spellcheck=!1,this.#o.setAttribute("aria-label",this.#a("Search")),this.#o.setAttribute("aria-controls",`${e}-listbox`),this.#o.addEventListener("input",this.#ne),this.#i=document.createElement("div"),this.#i.className="categories",this.#i.setAttribute("role","toolbar"),this.#i.setAttribute("aria-label",this.#a("Categories")),this.#c.EMOJI_GROUPS.forEach((o,t)=>{let s=document.createElement("button");s.type="button",s.dataset.group=o,s.tabIndex=t===0?0:-1,s.setAttribute("aria-label",this.#_(o)),s.title=this.#_(o),s.textContent=this.#c.EMOJI_GROUP_ICONS[o],this.#i.appendChild(s)}),this.#s=document.createElement("div"),this.#s.className="grid",this.#s.id=`${e}-listbox`,this.#s.setAttribute("role","listbox"),this.#s.setAttribute("aria-label",this.#a("Emoji")),this.#g=this.#H("recent"),this.#s.appendChild(this.#g);for(let o of this.#c.EMOJI_GROUPS){let t=this.#H(o);this.#b.set(o,t),this.#s.appendChild(t)}this.#h=document.createElement("p"),this.#h.className="no-results",this.#h.textContent=this.#a("Empty"),this.#h.hidden=!0,this.#p=document.createElement("p"),this.#p.className="status",this.#p.setAttribute("role","status"),this.#e.append(this.#o,this.#i,this.#s,this.#h,this.#p),this.appendChild(this.#e),this.#M(),this.#m=!0}#H(e){let o=document.createElement("div");return o.className="group",o.dataset.group=e,o.setAttribute("role","group"),o.setAttribute("aria-label",this.#_(e)),o}#G(e){let o=document.createElement("span");return o.className="group-label",o.setAttribute("aria-hidden","true"),o.textContent=this.#_(e),o}#N(e){let o=document.createElement("button");return o.type="button",o.setAttribute("role","option"),o.tabIndex=-1,o.dataset.shortcode=e.shortcode,o.setAttribute("aria-label",e.name),o.title=`:${e.shortcode}:`,o.textContent=e.emoji,o}#M(){let e=new Map;for(let o of this.#c.EMOJI_GROUPS){let t=this.#b.get(o),s=[this.#G(o)];for(let r of this.#c.getByGroup(o)){let i=e.get(r.emoji);if(i){i.aliases.push(r.shortcode);continue}let a=this.#N(r),l={entry:r,aliases:[]};e.set(r.emoji,l),this.#j.set(a,l),s.push(a)}t.replaceChildren(...s)}this.#P=this.#c.extendedCount(),this.#n=null}#X(){let e=[];for(let o of this.#V()){let t=this.#c.resolveEmoji(o);if(!t)continue;let s=this.#N(t);this.#j.set(s,{entry:t,aliases:[]}),e.push(s)}e.length&&e.unshift(this.#G("recent")),this.#g.replaceChildren(...e),this.#n=null}#Y(e,o){let{entry:t,aliases:s}=e;return t.shortcode.includes(o)||t.name.toLowerCase().includes(o)||(t.keywords?.some(r=>r.includes(o))??!1)||s.some(r=>r.includes(o))}#S(){let e=this.#y.toLowerCase(),o=0;this.#g.hidden=!!e||this.#g.childElementCount===0;for(let t of this.#b.values()){let s=!1;for(let r of t.querySelectorAll('[role="option"]')){let i=this.#j.get(r),a=!e||(i?this.#Y(i,e):!1);r.hidden=!a,a&&(s=!0,o++)}t.hidden=!s}this.#h.hidden=o>0,this.#p.textContent=e?o>0?this.#a("Results").replace("{count}",String(o)):this.#a("Empty"):"",(!this.#n||!this.#T(this.#n))&&this.#u(this.#R()[0]??null,!1)}#T(e){return e.isConnected&&!e.hidden&&!e.parentElement.hidden}#R(){return[...this.#s.querySelectorAll('[role="option"]')].filter(e=>this.#T(e))}#u(e,o){this.#n&&this.#n!==e&&(this.#n.tabIndex=-1),this.#n=e,e&&(e.tabIndex=0,o&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest"})))}#I(e,o){if(e){for(let t of this.#i.querySelectorAll("button"))t.tabIndex=t===e?0:-1;o&&e.focus()}}#D(e){let o;for(let t of this.#i.querySelectorAll("button"))t.dataset.group===e?(t.setAttribute("aria-current","true"),o=t):t.removeAttribute("aria-current");o&&!this.#i.contains(document.activeElement)&&this.#I(o,!1)}#$(){if(this.#f?.disconnect(),this.#v.clear(),!(typeof IntersectionObserver>"u")){this.#f=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting?this.#v.add(t.target):this.#v.delete(t.target);let o=[...this.#s.children].find(t=>this.#v.has(t));this.#D(o?.dataset.group)},{root:this.#s,rootMargin:"-2px 0px -75% 0px"});for(let e of this.#s.children)this.#f.observe(e)}}#B(){return getComputedStyle(this).direction==="rtl"}#q(e,o,t){let s=e[o].getBoundingClientRect(),r=s.left+s.width/2,i=null,a=null,l=1/0;for(let c=o+t;c>=0&&c<e.length;c+=t){let h=e[c].getBoundingClientRect();if(i===null){if(Math.abs(h.top-s.top)<=M)continue;i=h.top}else if(Math.abs(h.top-i)>M)break;let w=Math.abs(h.left+h.width/2-r);w<l&&(l=w,a=e[c])}return a}#Q(e,o){let t=this.#R(),s=t.indexOf(e);if(s<0)return!1;let r=this.#B(),i=null;switch(o){case"ArrowRight":i=t[r?s-1:s+1];break;case"ArrowLeft":i=t[r?s+1:s-1];break;case"ArrowDown":i=this.#q(t,s,1);break;case"ArrowUp":if(i=this.#q(t,s,-1),!i)return this.#o.focus(),!0;break;case"Home":i=t[0];break;case"End":i=t[t.length-1];break;case"PageDown":{i=t.slice(s+1).find(l=>l.parentElement!==e.parentElement)??t[t.length-1];break}case"PageUp":{let a=t.find(l=>l.parentElement===e.parentElement);if(a&&a!==e)i=a;else{let l=t[s-1]?.parentElement;i=l?t.find(c=>c.parentElement===l):t[0]}break}default:return!1}return i&&this.#u(i,!0),!0}#Z(e,o){let t=[...this.#i.querySelectorAll("button")],s=t.indexOf(e),r=this.#B(),i=-1;if(o==="ArrowRight")i=r?s-1:s+1;else if(o==="ArrowLeft")i=r?s+1:s-1;else if(o==="Home")i=0;else if(o==="End")i=t.length-1;else return!1;return i=(i+t.length)%t.length,this.#I(t[i],!0),!0}#U(){let e=this.getAttribute("for");return e?document.getElementById(e):null}#ee(){let e=this.#U();if(this.#k=null,this.#E=null,!!e){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){let o=null,t=null;try{o=e.selectionStart,t=e.selectionEnd}catch{}o!==null&&t!==null&&(this.#k={start:o,end:t})}else if(e.isContentEditable){let o=window.getSelection();if(o&&o.rangeCount>0){let t=o.getRangeAt(0);e.contains(t.commonAncestorContainer)&&(this.#E=t.cloneRange())}}}}#oe=e=>{let o=e.target.closest?.("button");if(!(!o||!this.contains(o))){if(o===this.#t){this.toggle();return}this.#m&&(o.parentElement===this.#i?this.#le(o):o.getAttribute("role")==="option"&&this.#ce(o))}};#te=e=>{this.#r&&!this.contains(e.target)&&this.close()};#se=e=>{if(!this.#r||this.#x)return;let o=e.relatedTarget;o&&!this.contains(o)&&this.close()};#re=e=>{let o=e.target;o.getAttribute?.("role")==="option"&&o!==this.#n&&this.#u(o,!1)};#ie=e=>{if(!this.#r)return;if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.close(),this.#t?.focus();return}let o=e.target;if(e.altKey||e.metaKey)return;let t=!1;if(o===this.#o){if(e.key==="ArrowDown"){let s=this.#n&&this.#T(this.#n)?this.#n:this.#R()[0];s&&this.#u(s,!0),t=!0}}else o.parentElement===this.#i?t=this.#Z(o,e.key):o.getAttribute("role")==="option"&&(t=this.#Q(o,e.key));t&&e.preventDefault()};#ne=()=>{this.#l&&clearTimeout(this.#l),this.setState("search-pending",!0),this.#l=setTimeout(()=>{this.#l=null,this.setState("search-pending",!1),this.#y=this.#o.value.trim(),this.#S(),this.#s.scrollTop=0},q)};#ae=()=>{this.#r&&(this.#M(),this.#S(),this.#$())};#le(e){let o=e.dataset.group||"";this.#y&&(this.#l&&(clearTimeout(this.#l),this.#l=null),this.setState("search-pending",!1),this.#o.value="",this.#y="",this.#S()),this.#I(e,!1),this.#D(o);let t=this.#b.get(o);if(!t)return;let s=matchMedia("(prefers-reduced-motion: reduce)").matches;this.#s.scrollTo({top:t.offsetTop,behavior:s?"auto":"smooth"});let r=t.querySelector('[role="option"]:not([hidden])');r&&this.#u(r,!1)}#ce(e){let o=this.#j.get(e);if(!o)return;let{entry:t}=o;this.#u(e,!1),this.#x=!0;try{this.#he(t.shortcode);let s=this.#de(t.emoji);this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:t.shortcode,emoji:t.emoji,name:t.name,keywords:t.keywords}})),this.close(),s||this.#t?.focus()}finally{this.#x=!1}}#de(e){let o=this.#U();if(!o)return!1;if(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement){o.focus();let t=this.#k;if(t)try{o.setSelectionRange(t.start,t.end)}catch{}if(!this.#z(e)){let s=o.value.length;try{o.setRangeText(e,t?.start??s,t?.end??s,"end")}catch{o.value+=e}o.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:e}))}try{let s=o.selectionEnd;this.#k=s===null?null:{start:s,end:s}}catch{this.#k=null}return!0}if(o.isContentEditable){o.focus();let t=window.getSelection();if(!t)return!0;let s=this.#E;if((!s||!o.contains(s.commonAncestorContainer))&&(s=document.createRange(),s.selectNodeContents(o),s.collapse(!1)),t.removeAllRanges(),t.addRange(s),!this.#z(e)){let r=t.getRangeAt(0);r.deleteContents();let i=document.createTextNode(e);r.insertNode(i),r.setStartAfter(i),r.collapse(!0),t.removeAllRanges(),t.addRange(r),o.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:e}))}return this.#E=t.rangeCount?t.getRangeAt(0).cloneRange():null,!0}return!1}#z(e){try{return document.execCommand("insertText",!1,e)}catch{return!1}}#V(){try{let e=JSON.parse(localStorage.getItem(F)||"[]");return Array.isArray(e)?e:[]}catch{return[]}}#he(e){let o=parseInt(this.getAttribute("recent-limit")??"24",10)||24,t=this.#V();t=t.filter(s=>s!==e),t.unshift(e),t.length>o&&(t.length=o);try{localStorage.setItem(F,JSON.stringify(t))}catch{}}#W(){if(!this.#w||!this.#r||!this.#t)return;let e=this.#t.getBoundingClientRect(),o=this.#e.offsetWidth,t=this.#e.offsetHeight,s=document.documentElement.clientWidth,r=document.documentElement.clientHeight,i=this.#B()?e.right-o:e.left;i=Math.max(d,Math.min(i,s-o-d));let a=e.bottom+4;a+t>r-d&&e.top-t-4>=d&&(a=e.top-t-4),a=Math.max(d,Math.min(a,r-t-d)),this.#e.style.setProperty("--picker-top",`${Math.round(a)}px`),this.#e.style.setProperty("--picker-left",`${Math.round(i)}px`)}#A=e=>{e.type==="scroll"&&this.#e.contains(e.target)||this.#W()};open(){if(!this.#m){this.#d="open";return}if(!(this.#r||!this.isConnected)){if(this.#ee(),this.#c.extendedCount()!==this.#P&&this.#M(),this.#X(),this.#o.value="",this.#y="",this.#S(),this.#r=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#w){try{this.#e.showPopover()}catch{}this.#W(),window.addEventListener("scroll",this.#A,{capture:!0,passive:!0}),window.addEventListener("resize",this.#A,{passive:!0})}this.#s.scrollTop=0,this.#$(),this.#o.focus(),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0}))}}close(){if(!this.#m){this.#d=null;return}if(this.#r){if(this.#r=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#w){try{this.#e.hidePopover()}catch{}window.removeEventListener("scroll",this.#A,{capture:!0}),window.removeEventListener("resize",this.#A)}this.#e.hidden=!0,this.#f?.disconnect(),this.#f=null,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0}))}}toggle(){if(!this.#m){this.#d=this.#d==="open"?null:"open";return}this.#r?this.close():this.open()}};b("emoji-picker",f);export{f as EmojiPicker};
2
2
  //# sourceMappingURL=emoji-picker.js.map
@@ -1,2 +1,2 @@
1
- var y=window.matchMedia("(prefers-reduced-motion: reduce)");var p=new Map;function b(c,e,s={}){let t=s.priority??10,n={impl:e,bundle:s.bundle,contract:s.contract,priority:t},i=p.get(c);if(customElements.get(c)){if(!i||i.priority>=t){i&&i.priority===t&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${s.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${s.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=t){i.priority===t&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${i.bundle}". Skipping "${s.bundle}" (first wins at equal priority).`);return}p.set(c,n),customElements.define(c,e)}var m=class extends HTMLElement{#t=[];#s;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 e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,s,t,n){e.addEventListener(s,t,n),this.#t.push(()=>e.removeEventListener(s,t,n))}setup(){}teardown(){}setState(e,s){this.#s||(this.#s=this.attachInternals());let t=this.#s.states;try{s?t.add(e):t.delete(e)}catch{let n=`--${e}`;s?t.add(n):t.delete(n)}}_adoptInternals(e){this.#s||(this.#s=e)}};var f=class c extends m{static get observedAttributes(){return["src","title","compact"]}#t=null;#s=null;#e=null;#n=0;#i=[];setup(){let e=this.querySelector(":scope > ol");if(!e)return!1;let s=this.#a(e);if(s.length===0)return!1;this.#i=s,e.style.display="none",e.setAttribute("aria-hidden","true");let t=this.getAttribute("title");t&&(this.#s=document.createElement("h2"),this.#s.className="fd-title",this.#s.textContent=t,this.insertBefore(this.#s,e)),this.#t=document.createElement("div"),this.#t.className="fd-container",this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`Flow diagram${t?": "+t:""}`),this.#n=0,this.#o(s,this.#t);let n=document.createElement("div");return n.className="fd-summary",n.textContent=`${this.#n} step${this.#n!==1?"s":""}`,this.#t.appendChild(n),this.insertBefore(this.#t,e),this.#e=document.createElement("div"),this.#e.className="fd-live",this.#e.setAttribute("role","status"),this.#e.setAttribute("aria-live","polite"),this.#e.setAttribute("aria-atomic","true"),this.appendChild(this.#e),this.listen(this.#t,"click",i=>{let o=i.target.closest(".fd-node-shape");if(!o)return;let a=o.closest(".fd-node")?.dataset.type||"action",l=o.textContent?.trim()||"";this.#m(`Selected: ${l}`),this.dispatchEvent(new CustomEvent("flow-diagram:select",{bubbles:!0,detail:{type:a,text:l}}))}),this.dispatchEvent(new CustomEvent("flow-diagram:ready",{bubbles:!0,detail:{nodeCount:this.#n}})),!0}teardown(){this.#s&&(this.#s.remove(),this.#s=null),this.#t&&(this.#t.remove(),this.#t=null),this.#e&&(this.#e.remove(),this.#e=null);let e=this.querySelector("ol");e&&(e.style.display="",e.removeAttribute("aria-hidden")),this.#n=0}static#d=0;attributeChangedCallback(e,s,t){s===t||!this.isConnected||(e==="src"?this._loadSrc(t):this.hasAttribute("data-upgraded")&&this.#r())}#r(){let e=()=>{this.teardown(),this.removeAttribute("data-upgraded"),this.setup()};if(this.hasAttribute("data-upgraded")&&"startViewTransition"in document&&!matchMedia("(prefers-reduced-motion: reduce)").matches){let s=`fd-vt-${++c.#d}`;this.style.viewTransitionName=s,document.startViewTransition(e).finished.finally(()=>{this.style.viewTransitionName=""})}else e()}get steps(){return this.#i}set steps(e){let s=Array.isArray(e)?e:[];this.#i=s,this.#s&&(this.#s.remove(),this.#s=null),this.#t&&(this.#t.remove(),this.#t=null),this.#e&&(this.#e.remove(),this.#e=null);let t=this.querySelector(":scope > ol");if(t||(t=document.createElement("ol"),t.style.display="none",t.setAttribute("aria-hidden","true"),this.appendChild(t)),s.length===0){this.dispatchEvent(new CustomEvent("flow-diagram:steps-changed",{detail:{steps:s,source:"property"},bubbles:!0}));return}let n=this.getAttribute("title");n&&(this.#s=document.createElement("h2"),this.#s.className="fd-title",this.#s.textContent=n,this.insertBefore(this.#s,t)),this.#t=document.createElement("div"),this.#t.className="fd-container",this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`Flow diagram${n?": "+n:""}`),this.#n=0,this.#o(s,this.#t);let i=document.createElement("div");i.className="fd-summary",i.textContent=`${this.#n} step${this.#n!==1?"s":""}`,this.#t.appendChild(i),this.insertBefore(this.#t,t),this.#e=document.createElement("div"),this.#e.className="fd-live",this.#e.setAttribute("role","status"),this.#e.setAttribute("aria-live","polite"),this.#e.setAttribute("aria-atomic","true"),this.appendChild(this.#e),this.dispatchEvent(new CustomEvent("flow-diagram:steps-changed",{detail:{steps:s,source:"property"},bubbles:!0}))}#a(e){let s=[];for(let t of e.querySelectorAll(":scope > li")){let n=this.#h(t);n&&s.push(n)}return s}#h(e){let s=e.dataset.type||"action",t=e.dataset.annotation||"",n=[],i=e.querySelectorAll(":scope > ol > li[data-branch]");if(i.length>0)for(let r of i){let a=r.dataset.branch||"",l=r.querySelector(":scope > ol"),d=l?this.#a(l):[];n.push({label:a,steps:d})}let o="";for(let r of e.childNodes)(r.nodeType===Node.TEXT_NODE||r.nodeType===Node.ELEMENT_NODE&&r.tagName!=="OL")&&(o+=r.textContent);return o=o.trim(),{type:s,text:o,annotation:t,branches:n}}#o(e,s){for(let t=0;t<e.length;t++){let n=e[t];t>0&&s.appendChild(this.#c());let i=this.#u(n);if(s.appendChild(i),n.branches.length>0){let o=document.createElement("div");o.className="fd-branches",o.setAttribute("data-branch-count",String(n.branches.length));let r=document.createElement("div");r.className="fd-split-line",r.setAttribute("aria-hidden","true"),o.appendChild(r);let a=document.createElement("div");a.className="fd-branch-columns";let l=(50/n.branches.length).toFixed(2);a.style.setProperty("--fd-inset",`${l}%`);for(let d of n.branches){let h=document.createElement("div");h.className="fd-branch",h.appendChild(this.#c());let u=document.createElement("span");u.className="fd-branch-label",u.textContent=d.label,u.setAttribute("data-branch",d.label.toLowerCase()),h.appendChild(u),this.#o(d.steps,h),a.appendChild(h)}o.appendChild(a),s.appendChild(o)}}}#u(e){this.#n++;let s=document.createElement("div");s.className="fd-node",s.dataset.type=e.type;let t=document.createElement("div");if(t.className="fd-node-shape",t.setAttribute("tabindex","0"),t.setAttribute("role","img"),t.setAttribute("aria-label",`${e.type}: ${e.text}`),t.textContent=e.text,s.appendChild(t),e.annotation){let n=document.createElement("div");n.className="fd-annotation",n.textContent=e.annotation,s.appendChild(n)}return s}#c(e){let s=document.createElement("div");s.className="fd-connector",s.setAttribute("aria-hidden","true");let t=document.createElement("div");if(t.className="fd-connector-line",s.appendChild(t),e){let i=document.createElement("span");i.className="fd-connector-label",i.textContent=e,s.appendChild(i)}let n=document.createElement("div");return n.className="fd-connector-arrow",s.appendChild(n),s}async _loadSrc(e){if(e)try{let s=await fetch(e);if(!s.ok)throw new Error(`HTTP ${s.status}`);let t=await s.json();for(;this.firstChild;)this.firstChild.remove();t.title&&this.setAttribute("title",t.title);let n=document.createElement("ol");this.#l(t.steps||[],n),this.appendChild(n),this.#r()}catch(s){console.warn(`[flow-diagram] Failed to load src="${e}":`,s)}}#l(e,s){for(let t of e){let n=document.createElement("li");if(t.type&&(n.dataset.type=t.type),t.annotation&&(n.dataset.annotation=t.annotation),n.textContent=t.text||"",t.branches&&t.branches.length>0){let i=document.createElement("ol");for(let o of t.branches){let r=document.createElement("li");r.dataset.branch=o.label||"";let a=document.createElement("ol");this.#l(o.steps||[],a),r.appendChild(a),i.appendChild(r)}n.appendChild(i)}s.appendChild(n)}}#m(e){this.#e&&(this.#e.textContent="",requestAnimationFrame(()=>{this.#e&&(this.#e.textContent=e)}))}};b("flow-diagram",f);export{f as FlowDiagram};
1
+ var S=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function E(a,t,n={}){let e=n.priority??10,s={impl:t,bundle:n.bundle,contract:n.contract,priority:e},i=g.get(a);if(customElements.get(a)){if(!i||i.priority>=e){i&&i.priority===e&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=e){i.priority===e&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${i.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}g.set(a,s),customElements.define(a,t)}var f=class extends HTMLElement{#e=[];#n;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}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.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,n,e,s){t.addEventListener(n,e,s),this.#e.push(()=>t.removeEventListener(n,e,s))}_reinit(){for(let t of this.#e)t();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,n){this.#n||(this.#n=this.attachInternals());let e=this.#n.states;try{n?e.add(t):e.delete(t)}catch{let s=`--${t}`;n?e.add(s):e.delete(s)}}_adoptInternals(t){this.#n||(this.#n=t)}#t(){return this.constructor.formAssociated&&this.#n?this.#n:null}get validity(){return this.#t()?.validity}get validationMessage(){return this.#t()?.validationMessage??""}get willValidate(){return this.#t()?.willValidate??!1}get form(){return this.#t()?.form??null}checkValidity(){return this.#t()?.checkValidity()??!0}reportValidity(){return this.#t()?.reportValidity()??!0}};var A=0;function w(a,t,n="vb-vt"){if(!a?.isConnected||typeof document>"u"||!("startViewTransition"in document)||matchMedia("(prefers-reduced-motion: reduce)").matches)return t(),null;let e=`${n}-${++A}`;a.style.viewTransitionName=e;let s=document.startViewTransition(t);return s.finished.finally(()=>{a.style.viewTransitionName===e&&(a.style.viewTransitionName="")}),s}var v={start:"Start",action:"Action",decision:"Decision",process:"Process",wait:"Wait",end:"End"},C={one:"{count} step",other:"{count} steps"},x=0;function p(a){if(!Array.isArray(a))return[];let t=[];for(let n of a){if(typeof n=="string"){t.push({type:"action",text:n,annotation:"",branches:[]});continue}if(!n||typeof n!="object")continue;let e=n,s=Array.isArray(e.branches)?e.branches.filter(i=>i&&typeof i=="object").map(i=>({label:String(i.label??""),steps:p(i.steps)})):[];t.push({type:typeof e.type=="string"&&e.type.trim()?e.type.trim():"action",text:String(e.text??""),annotation:e.annotation?String(e.annotation):"",branches:s})}return t}function m(a,t){for(let n of a){let e=document.createElement("li");if(e.dataset.type=n.type,n.annotation&&(e.dataset.annotation=n.annotation),e.textContent=n.text,n.branches.length>0){let s=document.createElement("ol");for(let i of n.branches){let r=document.createElement("li");r.dataset.branch=i.label;let o=document.createElement("ol");m(i.steps,o),r.appendChild(o),s.appendChild(r)}e.appendChild(s)}t.appendChild(e)}}var b=class extends f{static get observedAttributes(){return["src","data-title","data-heading-level","data-label"]}#e=null;#n=null;#t=null;#s=0;#r=[];#i=null;#a=`fd-${++x}`;setup(){let t=this.querySelector(":scope > ol");if(!t){let o=this.getAttribute("src");return o&&this._loadSrc(o),!1}let n=this.#l(t);if(n.length===0)return!1;this.#r=n;let e=this.dataset.title;if(e){let o=Math.min(6,Math.max(1,parseInt(this.dataset.headingLevel||"2",10)||2));this.#e=document.createElement(`h${o}`),this.#e.className="fd-title",this.#e.id=`${this.#a}-title`,this.#e.textContent=e,this.insertBefore(this.#e,t)}let s=document.createElement("figure");s.className="fd-container",this.#e?s.setAttribute("aria-labelledby",this.#e.id):s.setAttribute("aria-label",this.#c("","Flow diagram")),this.#n=s,this.#s=0,s.appendChild(this.#d(n));let i=document.createElement("p");i.className="fd-summary",i.textContent=this.#m(this.#s),s.appendChild(i),this.insertBefore(s,t);let r=s.querySelector(".fd-node-shape");return r&&r.setAttribute("tabindex","0"),this.#t=document.createElement("p"),this.#t.className="fd-live",this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.appendChild(this.#t),this.listen(s,"click",o=>{let l=o.target.closest(".fd-node-shape");if(!l)return;this.#u(l,!1);let c=l.dataset.type||"action",d=l.dataset.text||"";this.#E(this.#c("selected","Selected: {text}").replaceAll("{text}",d)),this.dispatchEvent(new CustomEvent("flow-diagram:select",{bubbles:!0,detail:{type:c,text:d}}))}),this.listen(s,"keydown",o=>this.#g(o)),this.dispatchEvent(new CustomEvent("flow-diagram:ready",{bubbles:!0,detail:{nodeCount:this.#s}})),!0}teardown(){this.#e&&(this.#e.remove(),this.#e=null),this.#n&&(this.#n.remove(),this.#n=null),this.#t&&(this.#t.remove(),this.#t=null),this.#s=0}attributeChangedCallback(t,n,e){n===e||!this.isConnected||this.#i||(t==="src"?this._loadSrc(e):this.hasAttribute("data-upgraded")&&this.#o())}#o(){let t=()=>{this._reinit()};this.hasAttribute("data-upgraded")?w(this,t,"fd-vt"):t()}get steps(){return this.#r}set steps(t){let n=p(t);this.#r=n;let e=document.createElement("ol");m(n,e);let s=this.querySelector(":scope > ol");s?s.replaceWith(e):this.appendChild(e),this._reinit(),this.dispatchEvent(new CustomEvent("flow-diagram:steps-changed",{detail:{steps:this.#r,source:"property"},bubbles:!0}))}#c(t,n){return this.getAttribute(t?`data-label-${t}`:"data-label")??n}#f(){return this.closest("[lang]")?.getAttribute("lang")||"en"}#p(t){return this.getAttribute(`data-label-type-${t}`)??v[t]??t}#m(t){let n=this.#f(),e="other",s=String(t);try{e=new Intl.PluralRules(n).select(t),s=new Intl.NumberFormat(n).format(t)}catch{}return(this.getAttribute(`data-label-steps-${e}`)??C[e]??this.getAttribute("data-label-steps-other")??C.other).replaceAll("{count}",s)}#l(t){let n=[];for(let e of t.querySelectorAll(":scope > li"))n.push(this.#b(e));return n}#b(t){let n=(t.dataset.type||"").trim()||"action",e=t.dataset.annotation||"",s=[];for(let r of t.querySelectorAll(":scope > ol > li[data-branch]")){let o=r.dataset.branch||"",l=r.querySelector(":scope > ol");s.push({label:o,steps:l?this.#l(l):[]})}let i="";for(let r of t.childNodes)(r.nodeType===Node.TEXT_NODE||r.nodeType===Node.ELEMENT_NODE&&r.tagName!=="OL")&&(i+=r.textContent);return{type:n,text:i.trim().replace(/\s+/g," "),annotation:e,branches:s}}#d(t){let n=document.createElement("ol");return n.className="fd-flow",t.forEach((e,s)=>n.appendChild(this.#y(e,s>0))),n}#y(t,n){this.#s++;let e=this.#s,s=document.createElement("li");s.className="fd-node",s.dataset.type=t.type,n&&s.appendChild(this.#h());let i=document.createElement("span");i.className="fd-step";let r=document.createElement("button");r.type="button",r.className="fd-node-shape",r.tabIndex=-1,r.dataset.type=t.type,r.dataset.text=t.text;let o=document.createElement("span");if(o.className="fd-type",o.textContent=`${this.#p(t.type)}: `,r.append(o,t.text),i.appendChild(r),t.annotation){let c=document.createElement("small");c.className="fd-annotation",c.id=`${this.#a}-ann-${e}`,c.textContent=t.annotation,r.setAttribute("aria-describedby",c.id),i.appendChild(c)}s.appendChild(i);let l=Array.isArray(t.branches)?t.branches:[];if(l.length>0){let c=document.createElement("ul");c.className="fd-branches",c.dataset.branchCount=String(l.length);for(let d of l){let h=document.createElement("li");h.className="fd-branch",h.appendChild(this.#h());let u=document.createElement("span");u.className="fd-branch-label",u.textContent=d.label,u.dataset.branch=d.label.toLowerCase(),h.appendChild(u);let y=Array.isArray(d.steps)?d.steps:[];y.length&&h.appendChild(this.#d(y)),c.appendChild(h)}s.appendChild(c)}return s}#h(){let t=document.createElement("span");t.className="fd-connector",t.setAttribute("aria-hidden","true");let n=document.createElement("span");n.className="fd-connector-line";let e=document.createElement("span");return e.className="fd-connector-arrow",t.append(n,e),t}#u(t,n){if(this.#n){for(let e of this.#n.querySelectorAll(".fd-node-shape"))e.setAttribute("tabindex",e===t?"0":"-1");n&&t.focus()}}#g(t){let n=t.target;if(!this.#n||!n.classList?.contains("fd-node-shape"))return;let e=[...this.#n.querySelectorAll(".fd-node-shape")],s=e.indexOf(n),i=getComputedStyle(this).direction==="rtl",r=-1;switch(t.key){case"ArrowDown":r=s+1;break;case"ArrowUp":r=s-1;break;case"ArrowRight":r=i?s-1:s+1;break;case"ArrowLeft":r=i?s+1:s-1;break;case"Home":r=0;break;case"End":r=e.length-1;break;default:return}t.preventDefault(),r=Math.max(0,Math.min(e.length-1,r)),this.#u(e[r],!0)}async _loadSrc(t){if(!(!t||this.#i===t)){this.#i=t;try{let n=await fetch(t);if(!n.ok)throw new Error(`HTTP ${n.status}`);let e=await n.json();if(this.getAttribute("src")!==t)return;let s=document.createElement("ol");m(p(e?.steps),s);let i=this.querySelector(":scope > ol");i?i.replaceWith(s):this.appendChild(s),typeof e?.title=="string"&&(this.dataset.title=e.title)}catch(n){console.warn(`[flow-diagram] Failed to load src="${t}":`,n);return}finally{this.#i===t&&(this.#i=null)}this.isConnected&&this.#o()}}#E(t){this.#t&&(this.#t.textContent="",requestAnimationFrame(()=>{this.#t&&(this.#t.textContent=t)}))}};E("flow-diagram",b);export{b as FlowDiagram};
2
2
  //# sourceMappingURL=flow-diagram.js.map
@@ -1,2 +1,2 @@
1
- var p=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function l(c,e,t={}){let i=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:i},n=f.get(c);if(customElements.get(c)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}f.set(c,s),customElements.define(c,e)}var d=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 e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,s){e.addEventListener(t,i,s),this.#t.push(()=>e.removeEventListener(t,i,s))}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{t?i.add(e):i.delete(e)}catch{let s=`--${e}`;t?i.add(s):i.delete(s)}}_adoptInternals(e){this.#e||(this.#e=e)}};var u=class c extends d{static#t=0;#e;#n=[];#s="Back to content";setup(){this.#e=++c.#t,this.hasAttribute("data-back-label")&&(this.#s=this.getAttribute("data-back-label")??this.#s),this.#r(),this.getAttribute("data-mode")==="sidenotes"?this.#a():this.#c()}#r(){let e=[...document.querySelectorAll("foot-note:not([data-enhanced])")];this.#n=e.filter(t=>this.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}#c(){if(this.#n.length===0)return;let e=document.createElement("ol");this.#n.forEach((t,i)=>{let s=i+1,n=`fnref-${this.#e}-${s}`,o=`fn-${this.#e}-${s}`;this.#i(t,s,n,o);let r=this.#o(t,s,n,o);e.appendChild(r)}),this.appendChild(e)}#i(e,t,i,s){e.setAttribute("data-enhanced",""),e.id=i;let n=e.innerHTML,o=document.createElement("span");o.innerHTML=n;let r=document.createElement("a");r.href=`#${s}`,r.setAttribute("aria-describedby",s),r.textContent=`[${t}]`,e.innerHTML="",e.appendChild(o),e.appendChild(r)}#a(){if(this.#n.length===0)return;let e=[];if(this.#n.forEach((t,i)=>{let s=i+1,n=`fnref-${this.#e}-${s}`,o=`fn-${this.#e}-${s}`;t.getAttribute("data-side")==="false"?(this.#i(t,s,n,o),e.push({ref:t,num:s,refId:n,noteId:o})):this.#d(t,s,n,o)}),e.length>0){let t=document.createElement("ol");for(let{ref:i,num:s,refId:n,noteId:o}of e)t.appendChild(this.#o(i,s,n,o));this.appendChild(t)}else this.hidden=!0}#d(e,t,i,s){let n=e.innerHTML;e.setAttribute("data-enhanced",""),e.setAttribute("data-side",""),e.id=i;let o=document.createElement("a");o.href=`#${s}`,o.setAttribute("aria-describedby",s),o.textContent=`[${t}]`;let r=document.createElement("aside");r.className="sidenote",r.id=s,r.setAttribute("role","note"),r.innerHTML=`<span class="sidenote-number">${t}.</span> ${n}`,e.innerHTML="",e.appendChild(o),e.appendChild(r)}#o(e,t,i,s){let n=document.createElement("li");n.id=s;let o=e.querySelector("span"),r=o?o.innerHTML:"",a=document.createElement("a");return a.href=`#${i}`,a.setAttribute("data-backref",""),a.setAttribute("aria-label",this.#s),a.textContent="\u21A9",n.innerHTML=r+" ",n.appendChild(a),n}},h=class extends HTMLElement{};l("foot-notes",u);l("foot-note",h);export{h as FootNote,u as FootNotes};
1
+ var S=window.matchMedia("(prefers-reduced-motion: reduce)");var b=new Map;function u(o,e,i={}){let t=i.priority??10,n={impl:e,bundle:i.bundle,contract:i.contract,priority:t},s=b.get(o);if(customElements.get(o)){if(!s||s.priority>=t){s&&s.priority===t&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=t){s.priority===t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}b.set(o,n),customElements.define(o,e)}var l=class extends HTMLElement{#i=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}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 e of this.#i)e();this.#i=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,i,t,n){e.addEventListener(i,t,n),this.#i.push(()=>e.removeEventListener(i,t,n))}_reinit(){for(let e of this.#i)e();this.#i=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,i){this.#e||(this.#e=this.attachInternals());let t=this.#e.states;try{i?t.add(e):t.delete(e)}catch{let n=`--${e}`;i?t.add(n):t.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#t(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#t()?.validity}get validationMessage(){return this.#t()?.validationMessage??""}get willValidate(){return this.#t()?.willValidate??!1}get form(){return this.#t()?.form??null}checkValidity(){return this.#t()?.checkValidity()??!0}reportValidity(){return this.#t()?.reportValidity()??!0}};var y=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function v(o,e){let t=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===e;t||(location.hash=e);let n=o;typeof n.focus=="function"&&(n.tabIndex<0&&!n.hasAttribute("tabindex")&&n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0})),(t||!n.matches?.(":target"))&&n.scrollIntoView({behavior:y()?"auto":"smooth",block:"start"})}function h(o){let e=o;if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=(e.target instanceof Element?e.target:null)?.closest('a[href^="#"]');if(!t)return!1;let n=t.getAttribute("target");if(n&&n!=="_self"||t.hasAttribute("download"))return!1;let s=(t.getAttribute("href")??"").slice(1);if(!s)return!1;let r=s;try{r=decodeURIComponent(s)}catch{}let a=t.ownerDocument.getElementById(r);return a?(e.preventDefault(),v(a,r),!0):!1}var E="Back to content",A="Footnote {n}",w="Notes",g="\u21A9\uFE0E",$=120,C=150,f=o=>String.fromCharCode(97+o%26)+(o>=26?String(Math.floor(o/26)):""),p=class o extends l{static observedAttributes=["data-mode","data-label-back","data-label-ref","data-label-heading","data-preview"];static#i=0;#e=0;#t=[];#a=[];#c=null;#l=!1;#n=null;#s=null;#r;#d;attributeChangedCallback(e,i,t){i===t||!this.hasAttribute("data-upgraded")||this._reinit()}setup(){this.#e||(this.#e=++o.#i),this.listen(this,"click",h),this.listen(document,"keydown",n=>{n.key==="Escape"&&this.#n?.matches(":popover-open")&&this.#o()});let e=this.#m(this.#p());if(e.length===0)return;let i=this.getAttribute("data-mode")==="sidenotes";for(let n of e)n.side=i&&n.source.getAttribute("data-side")!=="false",this.#b(n);let t=e.filter(n=>!n.side);for(let n of e)n.side&&this.#y(n),n.refs.forEach((s,r)=>this.#g(s,n,r));t.length?this.#v(t):this.hidden||(this.hidden=!0,this.#l=!0)}teardown(){clearTimeout(this.#r),clearTimeout(this.#d),this.#o();for(let{ref:e,original:i}of this.#t)e.replaceChildren(...i),e.removeAttribute("data-enhanced");this.#t=[];for(let e of this.#a)e.remove();this.#a=[],this.#n=null,this.#s=null,this.#c&&(this.#c.el.removeAttribute("id"),this.#c=null),this.#l&&(this.hidden=!1,this.#l=!1)}#p(){return[...document.querySelectorAll("foot-note:not([data-enhanced])")].filter(e=>this.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}#m(e){let i=new Set(e),t=new Map,n=[];for(let s of e){let r=s,a=s.getAttribute("data-ref");if(a){let d=document.getElementById(a);d&&i.has(d)&&!d.hasAttribute("data-ref")?r=d:console.warn(`[foot-notes] data-ref="${a}" does not name a <foot-note> collected by this <foot-notes>; rendering it as its own note.`)}let c=t.get(r);if(!c){let d=n.length+1;c={source:r,num:d,noteId:`fn-${this.#e}-${d}`,refs:[],content:[],side:!1},t.set(r,c),n.push(c)}c.refs.push(s)}return n}#b(e){let i=new Set([e.source,...e.refs]);for(let t of i){let n=[...t.childNodes];this.#t.push({ref:t,original:n}),t===e.source&&(e.content=n),t.replaceChildren()}}#u(e,i){return this.getAttribute(e)||i}#g(e,i,t){let n=document.createElement("a");n.id=this.#h(i,t),n.href=`#${i.noteId}`,n.setAttribute("role","doc-noteref"),n.setAttribute("aria-label",this.#u("data-label-ref",A).replaceAll("{n}",String(i.num))),n.textContent=String(i.num),e.setAttribute("data-enhanced",""),i.side&&e===i.source?e.prepend(n):e.append(n),this.listen(n,"click",s=>{this.#o(),h(s)}),!i.side&&this.getAttribute("data-preview")!=="false"&&this.#A(n,i)}#h(e,i){let t=`fnref-${this.#e}-${e.num}`;return i===0?t:`${t}-${f(i)}`}#y(e){let i=document.createElement("aside");i.className="sidenote",i.id=e.noteId,i.setAttribute("role","note");let t=document.createElement("span");t.className="sidenote-number",t.textContent=`${e.num}.`,i.append(t," ",...e.content),e.source.append(i)}#v(e){let i=document.createElement("section");i.setAttribute("role","doc-endnotes");let t=this.querySelector(":scope > :is(h1, h2, h3, h4, h5, h6)");if(t)t.id||(t.id=`fnh-${this.#e}`,this.#c={el:t,id:t.id}),i.setAttribute("aria-labelledby",t.id);else{let s=document.createElement("h2");s.id=`fnh-${this.#e}`,s.className="visually-hidden",s.textContent=this.#u("data-label-heading",w),i.setAttribute("aria-labelledby",s.id),i.append(s)}let n=document.createElement("ol");for(let s of e)n.append(this.#E(s));i.append(n),this.append(i),this.#a.push(i)}#E(e){let i=document.createElement("li");i.id=e.noteId,i.append(...e.content," ");let t=this.#u("data-label-back",E),n=e.refs.length>1;return e.refs.forEach((s,r)=>{let a=document.createElement("a");a.href=`#${this.#h(e,r)}`,a.setAttribute("data-backref",""),a.setAttribute("role","doc-backlink"),n?(a.setAttribute("aria-label",`${t} (${f(r)})`),a.textContent=`${g}${f(r)}`):(a.setAttribute("aria-label",t),a.textContent=g),r>0&&i.append(" "),i.append(a)}),i}#A(e,i){typeof HTMLElement.prototype.showPopover=="function"&&(this.listen(e,"pointerenter",t=>{t.pointerType!=="touch"&&(clearTimeout(this.#d),clearTimeout(this.#r),this.#r=setTimeout(()=>this.#f(e,i),$))}),this.listen(e,"pointerleave",()=>{clearTimeout(this.#r),!(e===document.activeElement&&e.matches(":focus-visible"))&&(this.#d=setTimeout(()=>this.#o(),C))}),this.listen(e,"focus",()=>{e.matches(":focus-visible")&&this.#f(e,i)}),this.listen(e,"blur",()=>this.#o()))}#w(){if(this.#n)return this.#n;let e=document.createElement("aside");return e.className="fn-preview",e.setAttribute("popover","manual"),e.setAttribute("aria-hidden","true"),e.inert=!0,this.append(e),this.#a.push(e),this.#n=e,e}#f(e,i){if(clearTimeout(this.#d),!e.isConnected||this.hidden)return;let t=this.#w(),n=document.createElement("span");n.className="fn-preview-number",n.textContent=`${i.num}.`;let s=i.content.map(r=>r.cloneNode(!0));t.replaceChildren(n," ",...s);for(let r of t.querySelectorAll("[id]"))r.removeAttribute("id");this.#s?.removeAttribute("data-preview-anchor"),e.setAttribute("data-preview-anchor",""),this.#s=e,t.matches(":popover-open")||t.showPopover(),this.#$(t,e)}#o(){clearTimeout(this.#r);let e=this.#n;e?.matches(":popover-open")&&e.hidePopover(),this.#s?.removeAttribute("data-preview-anchor"),this.#s=null}#$(e,i){if(typeof CSS<"u"&&CSS.supports?.("position-area: top"))return;let t=i.getBoundingClientRect(),n=6,s=e.offsetWidth,r=e.offsetHeight,a=t.top-r-n;a<n&&(a=t.bottom+n);let c=Math.max(n,Math.min(t.left+t.width/2-s/2,innerWidth-s-n));e.style.inset="auto",e.style.top=`${a}px`,e.style.left=`${c}px`}},m=class extends HTMLElement{};u("foot-notes",p);u("foot-note",m);export{m as FootNote,p as FootNotes};
2
2
  //# sourceMappingURL=foot-notes.js.map
@@ -1,2 +1,2 @@
1
- var c=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function u(s,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},r=l.get(s);if(customElements.get(s)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(s,n),customElements.define(s,t)}var o=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,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}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 n=`--${t}`;e?i.add(n):i.delete(n)}}_adoptInternals(t){this.#e||(this.#e=t)}};var d=["valueMissing","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","customError"],a=class extends o{#t=null;#e=null;#i=!1;setup(){return this.#t=this.querySelector("input, textarea, select"),this.#e=this.querySelector("output.error")??this.querySelector("output:not(.hint)"),this.#t?(this.listen(this.#t,"blur",()=>this.validate()),this.listen(this.#t,"input",()=>{this.#i&&this.validate()}),!0):!1}teardown(){this.#t=null,this.#e=null,this.#i=!1}validate(){let t=this.#t;if(!t)return!0;t.validity.customError||t.setCustomValidity("");let e=t.checkValidity();return e?(this.#r(t.value?"valid":null),t.removeAttribute("aria-invalid"),this.#e&&(this.#e.textContent="")):(this.#i=!0,this.#r("invalid"),t.setAttribute("aria-invalid","true"),this.#s(t.validity)),e}setError(t){this.#t&&(this.#t.setCustomValidity(t),this.#i=!0,this.#r("invalid"),this.#t.setAttribute("aria-invalid","true"),this.#e&&(this.#e.textContent=t))}clearError(){this.#t&&(this.#t.setCustomValidity(""),this.#r(null),this.#t.removeAttribute("aria-invalid"),this.#i=!1,this.#e&&(this.#e.textContent=""))}get fieldName(){return this.querySelector("label")?.textContent?.trim()??this.#t?.getAttribute("aria-label")??this.#t?.name??this.#t?.id??"Field"}get input(){return this.#t}#r(t){delete this.dataset.valid,delete this.dataset.invalid,t&&(this.dataset[t]="")}#s(t){if(!this.#e)return;let e=this.#t;if(!(!e||!this.#e))for(let i of d){if(!t[i])continue;let n=`data-message-${i.toLowerCase()}`,r=e.getAttribute(n)??e.validationMessage;this.#e.textContent=r;return}}};u("form-field",a);export{a as FormField};
1
+ var A=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function m(r,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=f.get(r);if(customElements.get(r)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}f.set(r,n),customElements.define(r,t)}var c=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}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,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}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 n=`--${t}`;e?i.add(n):i.delete(n)}}_adoptInternals(t){this.#e||(this.#e=t)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};var g=["valueMissing","badInput","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","customError"],y='input:not([type="hidden"]):not(.otp-digit), textarea, select',b="output.hint, output.textarea-counter",v="Please check this field.",E=0;function p(r){return r.localName.includes("-")?!!customElements.get(r.localName)?.formAssociated:!1}function a(r){return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement}var u=class extends c{#t=null;#e=[];#i=null;#r=!1;#s="";#n;#d=`ff-${++E}`;setup(){if(this.#b(),this.#t=this.#y(),this.#i=this.querySelector("output.error")??this.querySelector("output:not(.hint):not(.textarea-counter)"),!this.#t)return!1;this.#i&&this.#n===void 0&&(this.#n=this.#i.textContent?.trim()??"",this.hasAttribute("data-invalid")||(this.#i.textContent=""));let t=this.#t;this.#e=[],t instanceof HTMLInputElement&&t.type==="radio"&&(this.#e=this.#v(t));let e=this.#e.length?this.#e:[t];for(let i of e)this.listen(i,"input",this.#o),this.listen(i,"change",this.#o),this.listen(i,"invalid",this.#g);return a(t)||this.listen(t,`${t.localName}:change`,this.#o),this.listen(this,"focusout",i=>{let n=i.relatedTarget;n instanceof Node&&this.contains(n)||this.validate()}),this.#l(this.hasAttribute("data-invalid")),!0}teardown(){this.#t=null,this.#e=[],this.#i=null}validate({show:t=!0}={}){if(!this.#t)return!0;let{valid:e,message:i}=this.#E();return t&&(e?(this.#c(this.#p()?"valid":null),this.#u("")):(this.#r=!0,this.#c("invalid"),this.#u(i)),this.#l(!e)),e}setError(t){if(!this.#t)return;this.#s=t;let e=this.#h();e&&e.setCustomValidity(t),this.validate()}clearError(){this.#t&&(this.#f(),this.#r=!1,this.#c(null),this.#u(""),this.#l(!1))}get fieldName(){return this.querySelector("label, legend")?.textContent?.trim()||this.#t?.getAttribute?.("aria-label")||this.#t?.getAttribute?.("name")||this.#t?.id||"Field"}get input(){return this.#t}#o=()=>{this.#s&&this.#f(),this.#r&&this.validate()};#a=!1;#g=()=>{if(!this.#a){this.#a=!0;try{this.validate()}finally{this.#a=!1}}};#y(){for(let t of this.querySelectorAll("*"))if(p(t))return t;return this.querySelector(y)}#b(){for(let t of this.querySelectorAll(":not(:defined)"))t.localName.includes("-")&&customElements.whenDefined(t.localName).then(()=>{!this.isConnected||!this.contains(t)||this.#t===t||p(t)&&this._reinit()})}#v(t){return t.name?(t.form?[...t.form.elements]:[...t.getRootNode().querySelectorAll('input[type="radio"]')].filter(i=>!i.form)).filter(i=>i instanceof HTMLInputElement&&i.type==="radio"&&i.name===t.name):[t]}#h(){let t=this.#t;return t&&a(t)?t:null}#f(){let t=this.#h();t&&t.validity.customError&&t.validationMessage===this.#s&&t.setCustomValidity(""),this.#s=""}#E(){let t=this.#t;if(this.#s)return{valid:!1,message:this.#s};let e=t.validity;if(e)return e.valid?{valid:!0,message:""}:{valid:!1,message:this.#m(e)};let i=t.matches(":invalid");return{valid:!i,message:i?this.#m(null):""}}#m(t){let e=this.#t,i=a(e),n=s=>e.getAttribute(`data-message-${s.toLowerCase()}`)??(i?null:this.getAttribute(`data-message-${s.toLowerCase()}`));if(t)for(let s of g){if(!t[s])continue;let o=n(s);if(o)return o;if((s==="customError"||!i)&&e.validationMessage)return e.validationMessage;break}else if(!this.#p()){let s=n("valueMissing");if(s)return s}return this.#n||e.validationMessage||this.getAttribute("data-message-invalid")||v}#p(){let t=this.#t;if(this.#e.length)return this.#e.some(i=>i.checked);if(t instanceof HTMLInputElement&&t.type==="checkbox")return t.checked;let e=t.value;return Array.isArray(e)?e.length>0:!a(t)&&e===0?!1:e!=null&&String(e)!==""}#A(){let t=this.#t,e=this.querySelector('.otp-wrapper[role="group"]');return e?[e]:this.#e.length?this.#e.filter(i=>this.contains(i)):a(t)?[t]:[t.querySelector('[role="combobox"], fieldset, input:not([type="hidden"]):not([aria-hidden="true"]), textarea, select')??t]}#l(t){let e=[...this.querySelectorAll(b)];e.forEach((o,l)=>{o.id||(o.id=`${this.#d}-hint${l?`-${l}`:""}`)});let i=this.#i;i&&!i.id&&(i.id=`${this.#d}-error`);let n=new Set([...e.map(o=>o.id),...i?[i.id]:[]]),s=[...e.map(o=>o.id),...t&&i?[i.id]:[]];for(let o of this.#A()){let l=(o.getAttribute("aria-describedby")??"").split(/\s+/).filter(h=>h&&!n.has(h)),d=[...new Set([...l,...s])];d.length?o.setAttribute("aria-describedby",d.join(" ")):o.removeAttribute("aria-describedby"),t?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid")}}#c(t){delete this.dataset.valid,delete this.dataset.invalid,t&&(this.dataset[t]="")}#u(t){this.#i&&(this.#i.textContent=t)}};m("form-field",u);export{u as FormField};
2
2
  //# sourceMappingURL=form-field.js.map