@luzmo/lucero 2.7.1 → 2.9.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 (367) hide show
  1. package/components/accordion/index.cjs +1 -1
  2. package/components/accordion/index.js +1 -1
  3. package/components/{accordion-BJLsCC-2.js → accordion-C9cVd8A8.js} +1 -1
  4. package/components/{accordion-OQ0RoC_7.cjs → accordion-DulsAsi7.cjs} +1 -1
  5. package/components/action-bar/index.cjs +1 -1
  6. package/components/action-bar/index.js +1 -1
  7. package/components/{action-bar-Dyt2tyjr.cjs → action-bar-BjTUUATD.cjs} +1 -1
  8. package/components/{action-bar-B-Y-gJ8B.js → action-bar-XpNzXzkl.js} +4 -4
  9. package/components/action-button/index.cjs +1 -1
  10. package/components/action-button/index.js +1 -1
  11. package/components/{action-button-CL4ZlryE.cjs → action-button-Cz4jSv__.cjs} +1 -1
  12. package/components/{action-button-BB3ZZFNN.js → action-button-LmKtPKfe.js} +1 -1
  13. package/components/action-group/index.cjs +1 -1
  14. package/components/action-group/index.js +1 -1
  15. package/components/{action-group-HECoPCas.js → action-group-CPxKx_oR.js} +1 -1
  16. package/components/{action-group-Doll-3Bf.cjs → action-group-DBxQJRLs.cjs} +1 -1
  17. package/components/action-menu/index.cjs +1 -1
  18. package/components/action-menu/index.js +1 -1
  19. package/components/{action-menu-DphCCjvX.cjs → action-menu-BFy0mEyu.cjs} +1 -1
  20. package/components/{action-menu-Bv9EA7__.js → action-menu-CT0OYS56.js} +3 -3
  21. package/components/avatar/index.cjs +1 -1
  22. package/components/avatar/index.js +1 -1
  23. package/components/{avatar-CVRQDsx6.js → avatar-BEk23sDA.js} +1 -1
  24. package/components/{avatar-DFzJbtId.cjs → avatar-C9EAInfy.cjs} +1 -1
  25. package/components/badge/index.cjs +1 -1
  26. package/components/badge/index.js +1 -1
  27. package/components/{badge-DzElGOcl.cjs → badge-CPpKOWh2.cjs} +1 -1
  28. package/components/{badge-BSfzmBRf.js → badge-bODlaAG_.js} +1 -1
  29. package/components/button/index.cjs +1 -1
  30. package/components/button/index.js +2 -2
  31. package/components/{button-CpaltgRZ.js → button-5jzMIMLW.js} +3 -3
  32. package/components/{button-BGEWdRbY.cjs → button-CjgL13CD.cjs} +1 -1
  33. package/components/button-group/index.cjs +1 -1
  34. package/components/button-group/index.js +1 -1
  35. package/components/{button-group-DMsT6N0P.js → button-group-B59rXxDn.js} +1 -1
  36. package/components/{button-group-C23OtGC0.cjs → button-group-DxMfPmBg.cjs} +1 -1
  37. package/components/calendar/index.cjs +1 -1
  38. package/components/calendar/index.js +1 -1
  39. package/components/{calendar-BqyGW8gU.cjs → calendar-4h_Fe-mw.cjs} +1 -1
  40. package/components/{calendar-D4x5gp_0.js → calendar-5V1hrKWy.js} +2 -2
  41. package/components/chat-message/index.cjs +1 -1
  42. package/components/chat-message/index.js +1 -1
  43. package/components/{chat-message-5gP_qbiz.js → chat-message--nzqHl6e.js} +1 -1
  44. package/components/{chat-message-Dn5GKsSD.cjs → chat-message-BzSel33p.cjs} +1 -1
  45. package/components/chat-message-group/index.cjs +1 -1
  46. package/components/chat-message-group/index.js +1 -1
  47. package/components/{chat-message-group-Bp4mshBY.js → chat-message-group-BIXlrlYi.js} +1 -1
  48. package/components/{chat-message-group-CJddlS85.cjs → chat-message-group-DLkSlQah.cjs} +1 -1
  49. package/components/checkbox/checkbox.d.ts +2 -0
  50. package/components/checkbox/index.cjs +1 -1
  51. package/components/checkbox/index.js +1 -1
  52. package/components/{checkbox-NSSgVzJg.cjs → checkbox-CFQqGnDX.cjs} +1 -1
  53. package/components/{checkbox-fW7WI915.js → checkbox-D884zXBt.js} +1 -1
  54. package/components/{close-button-7zS6PUzh.js → close-button-Bw8knwnc.js} +1 -1
  55. package/components/{close-button-B06i2hJn.cjs → close-button-DhHKKvHu.cjs} +1 -1
  56. package/components/color-area/index.cjs +1 -1
  57. package/components/color-area/index.js +1 -1
  58. package/components/{color-area-CFBE-rG3.cjs → color-area-Dnq-HQ-1.cjs} +1 -1
  59. package/components/{color-area-GGa8KJyd.js → color-area-QSGfRi4o.js} +2 -2
  60. package/components/color-field/index.cjs +1 -1
  61. package/components/color-field/index.js +1 -1
  62. package/components/{color-field-l-aJ6O4a.cjs → color-field-B-GC4H0K.cjs} +1 -1
  63. package/components/{color-field-BZljmVHt.js → color-field-vmTnlDec.js} +1 -1
  64. package/components/color-menu/index.cjs +1 -1
  65. package/components/color-menu/index.js +1 -1
  66. package/components/{color-menu-C56xj5Oe.cjs → color-menu-DGWGb0iH.cjs} +1 -1
  67. package/components/{color-menu-CEtmpeN7.js → color-menu-DthtTlKd.js} +7 -7
  68. package/components/color-palette/index.cjs +1 -1
  69. package/components/color-palette/index.js +1 -1
  70. package/components/{color-palette-D5NZDz5I.cjs → color-palette-C4Y8VU9j.cjs} +1 -1
  71. package/components/{color-palette-UU7Feiwh.js → color-palette-UnwRum-W.js} +1 -1
  72. package/components/color-palette-group/index.cjs +1 -1
  73. package/components/color-palette-group/index.js +1 -1
  74. package/components/{color-palette-group-DhGh0Db8.cjs → color-palette-group-BiPNlMgu.cjs} +1 -1
  75. package/components/{color-palette-group-CwmC9iR1.js → color-palette-group-jhNz9Gto.js} +1 -1
  76. package/components/color-picker/index.cjs +1 -1
  77. package/components/color-picker/index.js +1 -1
  78. package/components/{color-picker-CLGNQIkK.cjs → color-picker-Bu0IOUj-.cjs} +1 -1
  79. package/components/{color-picker-BDqJodTR.js → color-picker-DbAIgjDv.js} +4 -4
  80. package/components/color-slider/index.cjs +1 -1
  81. package/components/color-slider/index.js +1 -1
  82. package/components/{color-slider-DNd_ZrD6.js → color-slider-BGnaMhIf.js} +1 -1
  83. package/components/{color-slider-IYBn2DL7.cjs → color-slider-BuhOIoUI.cjs} +1 -1
  84. package/components/date-range-picker/index.cjs +1 -1
  85. package/components/date-range-picker/index.js +1 -1
  86. package/components/{date-range-picker-DyJdcFiA.cjs → date-range-picker-B7J_RFW6.cjs} +1 -1
  87. package/components/{date-range-picker-CoCz3uDz.js → date-range-picker-BilkNV82.js} +4 -4
  88. package/components/date-time-picker/index.cjs +1 -1
  89. package/components/date-time-picker/index.js +1 -1
  90. package/components/{date-time-picker-CEEeMXGn.cjs → date-time-picker-BNUIfpzG.cjs} +1 -1
  91. package/components/{date-time-picker-CsgO17tA.js → date-time-picker-DOsLR0EN.js} +4 -4
  92. package/components/divider/index.cjs +1 -1
  93. package/components/divider/index.js +1 -1
  94. package/components/{divider-fWGUxO6A.cjs → divider-BS5chsgx.cjs} +1 -1
  95. package/components/{divider-Bt0NIqfu.js → divider-CJRCMeKA.js} +1 -1
  96. package/components/field-label/index.cjs +1 -1
  97. package/components/field-label/index.js +1 -1
  98. package/components/{field-label-B3IsGUTv.cjs → field-label-61lILUqu.cjs} +1 -1
  99. package/components/{field-label-DOUnHwwh.js → field-label-B_VLKIJn.js} +1 -1
  100. package/components/index.cjs +1 -1
  101. package/components/index.js +72 -71
  102. package/components/infield-button/index.cjs +1 -1
  103. package/components/infield-button/index.js +1 -1
  104. package/components/{infield-button-uD1GqTLW.cjs → infield-button-B0qcV4gq.cjs} +1 -1
  105. package/components/{infield-button-CeE_JxR6.js → infield-button-CcaKuxAs.js} +1 -1
  106. package/components/{interaction-BjXWVy_C.cjs → interaction--DdZDJnw.cjs} +1 -1
  107. package/components/{interaction-BpCLJ1OV.js → interaction-DF63SBSQ.js} +1 -1
  108. package/components/menu/index.cjs +1 -1
  109. package/components/menu/index.js +1 -1
  110. package/components/{menu-f2S0m6h9.js → menu-CM-ZA_ZM.js} +1 -1
  111. package/components/{menu-CoJ5oERs.cjs → menu-tDMNLuND.cjs} +1 -1
  112. package/components/multi-language-field/index.cjs +1 -1
  113. package/components/multi-language-field/index.js +1 -1
  114. package/components/{multi-language-field-SZObnneZ.js → multi-language-field-B6Ne8_Yw.js} +2 -2
  115. package/components/{multi-language-field-nJmWDtPL.cjs → multi-language-field-C5C5yS94.cjs} +1 -1
  116. package/components/notice/index.cjs +1 -1
  117. package/components/notice/index.js +1 -1
  118. package/components/{notice-CrLVNmqL.js → notice-62Wpb7BH.js} +2 -2
  119. package/components/{notice-f0p0TiGw.cjs → notice-DrrmwMlw.cjs} +1 -1
  120. package/components/number-field/index.cjs +1 -1
  121. package/components/number-field/index.js +1 -1
  122. package/components/{number-field-BEt0cfcB.js → number-field-CMM5MC2R.js} +2 -2
  123. package/components/{number-field-DrarDCm4.cjs → number-field-N6nInW0X.cjs} +1 -1
  124. package/components/options/index.cjs +1 -1
  125. package/components/options/index.js +1 -1
  126. package/components/{options-BH_Y3UB6.cjs → options-CsRLHwaY.cjs} +1 -1
  127. package/components/{options-BiA2h1-i.js → options-DtJTjiP8.js} +2 -2
  128. package/components/{pending-state-A6NrvaQj.cjs → pending-state-CQuz9Qiv.cjs} +1 -1
  129. package/components/{pending-state-BuYmUP6G.js → pending-state-KsPO-6Ei.js} +1 -1
  130. package/components/permission-box/index.cjs +18 -0
  131. package/components/permission-box/index.d.ts +9 -0
  132. package/components/permission-box/index.js +19 -0
  133. package/components/permission-box/permission-box.d.ts +157 -0
  134. package/components/permission-box/types.d.ts +73 -0
  135. package/components/permission-box-BsmcqGnU.cjs +176 -0
  136. package/components/permission-box-yUZKSyS9.js +405 -0
  137. package/components/picker/index.cjs +1 -1
  138. package/components/picker/index.js +1 -1
  139. package/components/picker-button/index.cjs +1 -1
  140. package/components/picker-button/index.js +1 -1
  141. package/components/{picker-button-BWDfzx38.cjs → picker-button-CEo39nlA.cjs} +1 -1
  142. package/components/{picker-button-BhfY9gyk.js → picker-button-svME8NW2.js} +1 -1
  143. package/components/{picker-Dd25S3rP.cjs → picker-h0nO2GgS.cjs} +1 -1
  144. package/components/{picker-JhsRAtSd.js → picker-nWTz5f1J.js} +5 -5
  145. package/components/popover/index.cjs +1 -1
  146. package/components/popover/index.js +1 -1
  147. package/components/{popover-CFzz83f8.cjs → popover-6Qy-GpJj.cjs} +1 -1
  148. package/components/{popover-CWrRLzOL.js → popover-BdoJqBC5.js} +1 -1
  149. package/components/progress-bar/index.cjs +1 -1
  150. package/components/progress-bar/index.js +1 -1
  151. package/components/{progress-bar-D6wIZV5l.js → progress-bar-Bc5zjNDp.js} +1 -1
  152. package/components/{progress-bar-9Qg0PYAq.cjs → progress-bar-BsBnhg4r.cjs} +1 -1
  153. package/components/progress-circle/index.cjs +1 -1
  154. package/components/progress-circle/index.js +1 -1
  155. package/components/{progress-circle-DcGKwBTC.js → progress-circle-C5UOMP96.js} +1 -1
  156. package/components/{progress-circle-C_9UZs2Y.cjs → progress-circle-D-JW7zZS.cjs} +1 -1
  157. package/components/progress-steps/index.cjs +1 -1
  158. package/components/progress-steps/index.js +1 -1
  159. package/components/{progress-steps-Byem5ieS.js → progress-steps-BwV4fEcH.js} +1 -1
  160. package/components/{progress-steps-5MhpnGKv.cjs → progress-steps-l0tbGl3P.cjs} +1 -1
  161. package/components/prompt-box/index.cjs +1 -1
  162. package/components/prompt-box/index.js +1 -1
  163. package/components/{prompt-box-B1rmo4DX.cjs → prompt-box-B3gDbsQo.cjs} +1 -1
  164. package/components/{prompt-box-CL0ld3Na.js → prompt-box-BUMtyCsa.js} +4 -4
  165. package/components/question-box/index.cjs +1 -1
  166. package/components/question-box/index.js +1 -1
  167. package/components/question-box/question-box-templates.d.ts +1 -1
  168. package/components/{question-box-DmTWFlRn.cjs → question-box-C7oXNWje.cjs} +59 -59
  169. package/components/{question-box-CxzEveid.js → question-box-wYSFkVoP.js} +171 -179
  170. package/components/radio/index.cjs +1 -1
  171. package/components/radio/index.js +1 -1
  172. package/components/{radio-CyxICbLM.js → radio-B_oHwHgO.js} +1 -1
  173. package/components/{radio-Dd-GgUMm.cjs → radio-DJmITM2m.cjs} +1 -1
  174. package/components/search/index.cjs +1 -1
  175. package/components/search/index.js +1 -1
  176. package/components/{search-1KUNWKWg.cjs → search-CXuXsgJt.cjs} +1 -1
  177. package/components/{search-_NUUJLz0.js → search-Dl5y1IqM.js} +2 -2
  178. package/components/select/index.cjs +1 -1
  179. package/components/select/index.js +1 -1
  180. package/components/{select-ChM3Zfxd.cjs → select-Dm7rf5Un.cjs} +1 -1
  181. package/components/{select-8gtm46qA.js → select-lS54kKFO.js} +6 -6
  182. package/components/{sized-mixin-CSajkMro.cjs → sized-mixin-BqV6ywDw.cjs} +1 -1
  183. package/components/{sized-mixin-BmxIAuoH.js → sized-mixin-Cb-47MjG.js} +17 -1
  184. package/components/slider/index.cjs +1 -1
  185. package/components/slider/index.js +1 -1
  186. package/components/{slider-B1cCAj1x.cjs → slider-B9rBCFmR.cjs} +1 -1
  187. package/components/{slider-CD-aGN9I.js → slider-BDLAmlBf.js} +3 -3
  188. package/components/split-view/controllers/pane-visibility-controller.d.ts +22 -0
  189. package/components/split-view/controllers/size-memory-controller.d.ts +28 -0
  190. package/components/split-view/index.cjs +1 -1
  191. package/components/split-view/index.d.ts +1 -0
  192. package/components/split-view/index.js +1 -1
  193. package/components/split-view/split-view-model.d.ts +2 -0
  194. package/components/split-view/split-view.d.ts +85 -7
  195. package/components/split-view-Dr0Bef6i.cjs +45 -0
  196. package/components/split-view-akatWAkc.js +565 -0
  197. package/components/status-light/index.cjs +1 -1
  198. package/components/status-light/index.js +1 -1
  199. package/components/{status-light-Do6z53mM.cjs → status-light-CtETRd_o.cjs} +1 -1
  200. package/components/{status-light-DqHhhZed.js → status-light-kt3QBqrC.js} +1 -1
  201. package/components/swatch/index.cjs +1 -1
  202. package/components/swatch/index.js +1 -1
  203. package/components/{swatch-DiNMN-SZ.cjs → swatch-BX6GGDBs.cjs} +1 -1
  204. package/components/{swatch-BBVsuSAV.js → swatch-bXSCI96I.js} +1 -1
  205. package/components/switch/index.cjs +1 -1
  206. package/components/switch/index.js +1 -1
  207. package/components/{switch-DMhCYTgq.cjs → switch-CnnJrKpy.cjs} +1 -1
  208. package/components/{switch-BBtewLDD.js → switch-Do9jl9ur.js} +1 -1
  209. package/components/table/index.cjs +1 -1
  210. package/components/table/index.js +1 -1
  211. package/components/{table-Bf-00FYb.cjs → table-CF5do4qb.cjs} +1 -1
  212. package/components/{table-CfFwBCp1.js → table-FWX6kbpt.js} +2 -2
  213. package/components/tabs/index.cjs +1 -1
  214. package/components/tabs/index.js +1 -1
  215. package/components/{tabs-Dkt0B_-A.js → tabs-CODc4EYJ.js} +2 -2
  216. package/components/{tabs-B0WHKMuF.cjs → tabs-sIusiEWI.cjs} +1 -1
  217. package/components/tags/index.cjs +1 -1
  218. package/components/tags/index.js +1 -1
  219. package/components/{tags-Be4yrNPw.js → tags-BEfsznJy.js} +3 -3
  220. package/components/{tags-CHDNXpxh.cjs → tags-CWJqZufu.cjs} +1 -1
  221. package/components/text-field/index.cjs +1 -1
  222. package/components/text-field/index.js +2 -2
  223. package/components/{text-field-CBsx1CVo.js → text-field-5Ilezggg.js} +1 -1
  224. package/components/{text-field-CZixBD87.cjs → text-field-8IQu5JLQ.cjs} +1 -1
  225. package/components/{text-field-DwvDSctG.cjs → text-field-CLUvzUDH.cjs} +1 -1
  226. package/components/{text-field-SNbvQYOj.js → text-field-Cn51A87k.js} +2 -2
  227. package/components/toast/index.cjs +1 -1
  228. package/components/toast/index.js +1 -1
  229. package/components/{toast-CXZUVaYz.js → toast-B6x2SjM8.js} +1 -1
  230. package/components/{toast-B6yesIcI.cjs → toast-CpOVCCix.cjs} +1 -1
  231. package/components/tooltip/index.cjs +1 -1
  232. package/components/tooltip/index.js +1 -1
  233. package/components/{tooltip-BE01O3Sg.cjs → tooltip-CjfQup1K.cjs} +1 -1
  234. package/components/{tooltip-g2jd5Wsv.js → tooltip-ElTGebA9.js} +1 -1
  235. package/components/top-nav/index.cjs +1 -1
  236. package/components/top-nav/index.js +1 -1
  237. package/components/{top-nav-B0E1K_zf.cjs → top-nav-BG6vbFst.cjs} +1 -1
  238. package/components/{top-nav-DiUCsUpZ.js → top-nav-BMFB1WB0.js} +1 -1
  239. package/components/utils.cjs +1 -1
  240. package/components/utils.js +8 -8
  241. package/custom-elements.json +1 -1
  242. package/index.d.ts +1 -0
  243. package/package.json +7 -1
  244. package/standalone/accordion.js +3 -3
  245. package/standalone/action-bar.js +4 -4
  246. package/standalone/action-button.js +1 -1
  247. package/standalone/action-group.js +1 -1
  248. package/standalone/action-menu.js +6 -6
  249. package/standalone/avatar.js +5 -5
  250. package/standalone/badge.js +1 -1
  251. package/standalone/button-group.js +1 -1
  252. package/standalone/button.js +1 -1
  253. package/standalone/calendar.js +1 -1
  254. package/standalone/chat-message-group.js +2 -2
  255. package/standalone/chat-message.js +3 -3
  256. package/standalone/checkbox.js +1 -1
  257. package/standalone/chunks/{action-button-C946JGIA.js → action-button-CFXQ66x-.js} +1 -1
  258. package/standalone/chunks/{action-group-DlClwXLO.js → action-group-CX3Dg0Bu.js} +2 -2
  259. package/standalone/chunks/{badge-DPFbBRCY.js → badge-C1_QvLsq.js} +1 -1
  260. package/standalone/chunks/{button-COqfQNJv.js → button-DFVs4O1S.js} +1 -1
  261. package/standalone/chunks/{button-BhSe7abg.js → button-PsWOoEKo.js} +1 -1
  262. package/standalone/chunks/{button-base-DLYrzCSm.js → button-base-BuAaSi-H.js} +2 -2
  263. package/standalone/chunks/{calendar-BVrT8uqP.js → calendar-C8QpCEII.js} +5 -5
  264. package/standalone/chunks/{checkbox-4PoS7Uft.js → checkbox-DYjPiIwY.js} +1 -1
  265. package/standalone/chunks/{checkbox-mixin-HnfmivU3.js → checkbox-mixin-BRuj7--C.js} +2 -2
  266. package/standalone/chunks/{clear-button-qIMg8hR4.js → clear-button-BfZbJISP.js} +1 -1
  267. package/standalone/chunks/{close-button-DEiL5kEh.js → close-button-DdAb7Vyz.js} +1 -1
  268. package/standalone/chunks/color-area-B_G8a0NX.js +66 -0
  269. package/standalone/chunks/{color-field-BKDaLJQo.js → color-field-DlZIotvM.js} +1 -1
  270. package/standalone/chunks/{color-handle-DO7dxFGx.js → color-handle-h3fYn_2h.js} +1 -1
  271. package/standalone/chunks/{color-loupe-_dC69K1Z.js → color-loupe-ceV5LQbI.js} +1 -1
  272. package/standalone/chunks/{color-menu-6LhE-qWn.js → color-menu-CGxmlgwZ.js} +2 -2
  273. package/standalone/chunks/{color-slider-MSADvkPC.js → color-slider-Uv4iIRws.js} +2 -2
  274. package/standalone/chunks/{divider-vAjIOfo1.js → divider-BLhmxGvJ.js} +1 -1
  275. package/standalone/chunks/{field-group-C1oDgW9m.js → field-group-Pc_Pu61V.js} +1 -1
  276. package/standalone/chunks/{field-label-Djcst_hn.js → field-label-CYs6sh7M.js} +3 -3
  277. package/standalone/chunks/icon-CYZJZELU.js +2 -0
  278. package/standalone/chunks/{infield-button-B8EkjwP9.js → infield-button-umqY7wh3.js} +1 -1
  279. package/standalone/chunks/interaction-CII_biy8.js +2 -0
  280. package/standalone/chunks/lucero-runtime-BkqJ2L5f.js +18 -0
  281. package/standalone/chunks/luzmoCheck-BQw4HZFw.js +2 -0
  282. package/standalone/chunks/{manage-help-text-DO3PkWgh.js → manage-help-text-CrQxXqBH.js} +1 -1
  283. package/standalone/chunks/{menu-DtUgXalL.js → menu-BQ1vUHja.js} +6 -6
  284. package/standalone/chunks/{number-field-aOOuxxRh.js → number-field-Cujj8njt.js} +2 -2
  285. package/standalone/chunks/{observe-slot-presence-BxmG6A0m.js → observe-slot-presence-CITwnhtc.js} +1 -1
  286. package/standalone/chunks/{options-CPaX-OWy.js → options-BlDY_bJv.js} +12 -12
  287. package/standalone/chunks/{overlay-CgQMEmrM.js → overlay-Bcwu868u.js} +6 -6
  288. package/standalone/chunks/{pending-state-DnTXKvtm.js → pending-state-BbjpQDWR.js} +1 -1
  289. package/standalone/chunks/{picker-5IvNnimu.js → picker-BOuknvzl.js} +7 -7
  290. package/standalone/chunks/{picker-button-BIqlIkET.js → picker-button-B7gJZHYC.js} +1 -1
  291. package/standalone/chunks/{popover-Ca-FBqiU.js → popover-Dum9nObN.js} +2 -2
  292. package/standalone/chunks/progress-circle-CZodXLYe.js +17 -0
  293. package/standalone/chunks/property-BsZepKFj.js +2 -0
  294. package/standalone/chunks/{radio-BJ3RhyUD.js → radio-fCBCSuw9.js} +2 -2
  295. package/standalone/chunks/{segments-factory-DWNY1AUE.js → segments-factory-PfCggJk6.js} +1 -1
  296. package/standalone/chunks/{skeleton-loader-CymPdQl3.js → skeleton-loader-zvitohC5.js} +1 -1
  297. package/standalone/chunks/swatch-BL10VQ4z.js +33 -0
  298. package/standalone/chunks/{template-property-CyrkVY0Q.js → template-property-BeYccnca.js} +1 -1
  299. package/standalone/chunks/{text-field-C4D5FNRe.js → text-field-KnOMaj3Y.js} +1 -1
  300. package/standalone/chunks/{text-field-DwD97PEo.js → text-field-pIdOTrtY.js} +15 -15
  301. package/standalone/chunks/tooltip-CYQLlhx8.js +41 -0
  302. package/standalone/clear-button.js +1 -1
  303. package/standalone/close-button.js +1 -1
  304. package/standalone/color-area.js +1 -1
  305. package/standalone/color-field.js +1 -1
  306. package/standalone/color-handle.js +1 -1
  307. package/standalone/color-loupe.js +1 -1
  308. package/standalone/color-menu.js +1 -1
  309. package/standalone/color-palette-group.js +3 -3
  310. package/standalone/color-palette.js +1 -1
  311. package/standalone/color-picker.js +2 -2
  312. package/standalone/color-slider.js +1 -1
  313. package/standalone/date-range-picker.js +7 -7
  314. package/standalone/date-time-picker.js +8 -8
  315. package/standalone/divider.js +1 -1
  316. package/standalone/field-group.js +1 -1
  317. package/standalone/field-label.js +1 -1
  318. package/standalone/icon.js +1 -1
  319. package/standalone/infield-button.js +1 -1
  320. package/standalone/label.js +1 -1
  321. package/standalone/lit.js +1 -1
  322. package/standalone/manifest.json +46 -44
  323. package/standalone/menu.js +1 -1
  324. package/standalone/multi-language-field.js +1 -1
  325. package/standalone/notice.js +2 -2
  326. package/standalone/number-field.js +1 -1
  327. package/standalone/options.js +1 -1
  328. package/standalone/overlay.js +1 -1
  329. package/standalone/permission-box.js +178 -0
  330. package/standalone/picker-button.js +1 -1
  331. package/standalone/picker.js +1 -1
  332. package/standalone/popover.js +1 -1
  333. package/standalone/progress-bar.js +2 -2
  334. package/standalone/progress-circle.js +1 -1
  335. package/standalone/progress-steps.js +2 -2
  336. package/standalone/prompt-box.js +3 -3
  337. package/standalone/question-box.js +33 -33
  338. package/standalone/radio.js +1 -1
  339. package/standalone/search.js +2 -2
  340. package/standalone/select.js +9 -9
  341. package/standalone/skeleton-loader.js +1 -1
  342. package/standalone/slider.js +11 -11
  343. package/standalone/split-view.js +5 -3
  344. package/standalone/status-light.js +1 -1
  345. package/standalone/swatch.js +1 -1
  346. package/standalone/switch.js +1 -1
  347. package/standalone/table.js +24 -24
  348. package/standalone/tabs.js +7 -7
  349. package/standalone/tags.js +2 -2
  350. package/standalone/text-field.js +1 -1
  351. package/standalone/toast.js +1 -1
  352. package/standalone/tooltip.js +1 -1
  353. package/standalone/top-nav.js +10 -10
  354. package/standalone/utils.js +1 -1
  355. package/styles/mixins/tests/visually-hidden.test.d.ts +1 -0
  356. package/utils/reactive-controllers/interaction.d.ts +5 -1
  357. package/utils/sized-mixin.d.ts +8 -0
  358. package/components/split-view-DDwpoN2O.js +0 -357
  359. package/components/split-view-DNVlr5VD.cjs +0 -43
  360. package/standalone/chunks/color-area-D-AVcZza.js +0 -66
  361. package/standalone/chunks/icon-D69mOw1X.js +0 -2
  362. package/standalone/chunks/interaction-BQyflxg-.js +0 -2
  363. package/standalone/chunks/lucero-runtime-DMlHjBe_.js +0 -18
  364. package/standalone/chunks/progress-circle-CFtVq9Ou.js +0 -17
  365. package/standalone/chunks/property-BsDbx7Z2.js +0 -2
  366. package/standalone/chunks/swatch-zFOV4NtM.js +0 -33
  367. package/standalone/chunks/tooltip-B-j8PrNl.js +0 -41
@@ -15,7 +15,7 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./sized-mixin-CSajkMro.cjs");require("./icon-BlbMP3mJ.cjs"),require("./action-button-CL4ZlryE.cjs");const n=require("./overlay-DAOyrYJL.cjs");require("./button-BGEWdRbY.cjs"),require("./text-field-CZixBD87.cjs"),require("./skeleton-loader-CEca0cqz.cjs");const r=require("./voice-recorder-B1tBrGTV.cjs");let i=require("lit"),a=require("lit/decorators.js"),o=require("@luzmo/icons");var s=class{constructor(e){this._attachments=[],this._idCounter=0,this._host=e,e.addController(this)}hostConnected(){}hostDisconnected(){this._revokeAllPreviewUrls()}get attachments(){return this._attachments}get hasAttachments(){return this._attachments.length>0}get imageAttachments(){return this._attachments.filter(e=>this._isImageFile(e.file))}get fileAttachments(){return this._attachments.filter(e=>!this._isImageFile(e.file))}addFiles(e){if(this._host.disabled||this._host.readonly||this._host.pending)return[];let t=[];for(let n of e){if(this._isImageFile(n)&&!this._host.allowImages||!this._isImageFile(n)&&!this._host.allowFiles||!this._isFileTypeAccepted(n))continue;let e=this._generateId(),r={file:n,id:e};this._isImageFile(n)&&(r.previewUrl=URL.createObjectURL(n)),this._attachments=[...this._attachments,r],t.push(e)}return t.length>0&&(this._dispatchChange(),this._host.requestUpdate()),t}removeAttachment(e){let t=this._attachments.find(t=>t.id===e);t&&(t.previewUrl&&URL.revokeObjectURL(t.previewUrl),this._attachments=this._attachments.filter(t=>t.id!==e),this._dispatchChange(),this._host.requestUpdate())}setAttachmentLoading(e,t){let n=this._attachments.findIndex(t=>t.id===e);if(n===-1)return;let r=this._attachments[n];!!r.loading!==t&&(this._attachments=[...this._attachments.slice(0,n),{...r,loading:t},...this._attachments.slice(n+1)],this._dispatchChange(),this._host.requestUpdate())}clearAttachments(){this._revokeAllPreviewUrls(),this._attachments=[],this._dispatchChange(),this._host.requestUpdate()}getAttachments(){return[...this._attachments]}handlePastedImages(e){if(!this._host.allowImages||this._host.disabled||this._host.readonly||this._host.pending||!e)return!1;let t=[];for(let n of e.items)if(n.type.startsWith(`image/`)){let e=n.getAsFile();e&&t.push(e)}return t.length>0&&(this.addFiles(t),!0)}getAcceptAttribute(){if(this._host.acceptedFileTypes.length>0)return this._host.acceptedFileTypes.join(`,`);let e=[];return this._host.allowImages&&e.push(`image/*`),this._host.allowFiles&&e.push(`*/*`),e.join(`,`)}isImageFile(e){return this._isImageFile(e)}_isImageFile(e){return e.type.startsWith(`image/`)}_isFileTypeAccepted(e){if(this._host.acceptedFileTypes.length===0)return!0;let t=e.name.toLowerCase(),n=e.type.toLowerCase();for(let e of this._host.acceptedFileTypes){let r=e.toLowerCase();if(r.endsWith(`/*`)){let e=r.slice(0,-2);if(n.startsWith(e+`/`))return!0}else if(n===r)return!0;else if(r.startsWith(`.`)&&t.endsWith(r))return!0}return!1}_generateId(){return`attachment-${++this._idCounter}-${Date.now()}`}_revokeAllPreviewUrls(){for(let e of this._attachments)e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}_dispatchChange(){this._host.dispatchEvent(new CustomEvent(`luzmo-attachments-change`,{bubbles:!0,composed:!0,detail:{attachments:this._attachments}}))}},c=class{constructor(e){this._voiceRecorder=null,this.isRecording=!1,this.duration=0,this.audioLevel=0,this.shouldFocusFinishButton=!1,this._host=e,e.addController(this)}hostConnected(){}hostDisconnected(){this._destroy()}async start(e){r.t.isSupported()?this.isRecording?this.stop():(this.shouldFocusFinishButton=e,this._init(),this._voiceRecorder&&(await this._voiceRecorder.startRecording()&&(this.isRecording=!0,this.duration=0,this.audioLevel=0,this._host.requestUpdate()),this._host.dispatchEvent(new CustomEvent(`luzmo-record`,{bubbles:!0,composed:!0,detail:{isRecording:this.isRecording}})))):this._host.dispatchEvent(new CustomEvent(`luzmo-record-error`,{bubbles:!0,composed:!0,detail:{error:`Voice recording is not supported in this browser`}}))}stop(){this._voiceRecorder?.stopRecording()}cancel(){this._voiceRecorder?.cancelRecording(),this.isRecording=!1,this.duration=0,this.audioLevel=0,this._host.requestUpdate(),this._host.dispatchEvent(new CustomEvent(`luzmo-record-cancel`,{bubbles:!0,composed:!0}))}formatDuration(){return r.t.formatDuration(this.duration)}static isSupported(){return r.t.isSupported()}_init(){this._voiceRecorder||(this._voiceRecorder=new r.t({maxDuration:3e5}),this._voiceRecorder.onStart(()=>{this.isRecording=!0,this._host.requestUpdate()}).onStop(e=>{this.isRecording=!1,this.duration=0,this.audioLevel=0,this._host.requestUpdate(),this._host.dispatchEvent(new CustomEvent(`luzmo-recording-complete`,{bubbles:!0,composed:!0,detail:{audioBlob:e.audioBlob,duration:e.duration,mimeType:e.mimeType}}))}).onError(e=>{this.isRecording=!1,this.duration=0,this.audioLevel=0,this._host.requestUpdate(),this._host.dispatchEvent(new CustomEvent(`luzmo-record-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}).onAudioLevel(e=>{this.audioLevel=e,this._host.requestUpdate()}).onDurationUpdate(e=>{this.duration=e,this._host.requestUpdate()}))}_destroy(){this._voiceRecorder&&=(this._voiceRecorder.destroy(),null),this.isRecording=!1,this.duration=0,this.audioLevel=0}};function l(e,t){let n=document.createRange();return n.setStart(e,t),n.collapse(!0),n}function u(e,t,n){let r=e.getBoundingClientRect(),i=t-r.left,a=n-r.top;return i*i+a*a}function d(e,t,n,r){let i=0,a=t;for(;a-i>1;){let t=i+a>>>1,r=document.createRange();r.setStart(e,t),r.collapse(!0),r.getBoundingClientRect().left<n?i=t:a=t}let o=l(e,i),s=u(o,n,r),c=l(e,a),d=u(c,n,r);return d<s&&(o=c,s=d),{range:o,distSq:s}}function f(e,t,n,r){let i=null,a=1/0;for(let[o,s]of e.childNodes.entries())if(s!==r){if(s.nodeType===Node.TEXT_NODE){let e=(s.textContent??``).length;if(e===0)continue;let r=d(s,e,t,n);r.distSq<a&&(a=r.distSq,i=r.range)}else if(s.nodeType===Node.ELEMENT_NODE){let r=s.getBoundingClientRect();if(r.width===0&&r.height===0)continue;let c=r.left+r.width/2,u=l(e,o),d=l(e,o+1),f=t<c?u:d,p=n-(r.top+r.height/2),m=t<c?t-r.left:t-r.right,h=m*m+p*p;h<a&&(a=h,i=f)}}if(!i){let t=document.createRange();return t.selectNodeContents(e),t.collapse(!1),t}return i}function p(e,t,n,r,i){if(Number.isNaN(n)||Number.isNaN(r))return null;let a=null,o=e;if(o?.caretPositionFromPoint){let e=o.caretPositionFromPoint(n,r);e&&(a=l(e.offsetNode,e.offset))}else o?.caretRangeFromPoint&&(a=o.caretRangeFromPoint(n,r));if(!a){if(`caretPositionFromPoint`in document){let e=document.caretPositionFromPoint(n,r);e&&(a=l(e.offsetNode,e.offset))}else`caretRangeFromPoint`in document&&(a=document.caretRangeFromPoint(n,r))}return a&&t.contains(a.startContainer)||(a=f(t,n,r,i)),a}function m(e){if(e){let t=e.getSelection?.();if(t&&t.rangeCount>0)return t.getRangeAt(0)}let t=document.getSelection();if(!t||t.rangeCount===0)return null;let n=t.getRangeAt(0);if(!e||e.contains(n.startContainer))return n;let r=t;if(e&&r.getComposedRanges)try{let t=r.getComposedRanges(e);if(t.length>0){let e=t[0],n=document.createRange();return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}}catch{}return null}function h(e,t){let n=document.getSelection();if(n)try{n.setBaseAndExtent(e,t,e,t)}catch{let r=document.createRange();r.setStart(e,t),r.collapse(!0),n.removeAllRanges(),n.addRange(r)}}function g(e){return e===` `||e===`
18
+ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./sized-mixin-BqV6ywDw.cjs");require("./icon-BlbMP3mJ.cjs"),require("./action-button-Cz4jSv__.cjs");const n=require("./overlay-DAOyrYJL.cjs");require("./button-CjgL13CD.cjs"),require("./text-field-8IQu5JLQ.cjs"),require("./skeleton-loader-CEca0cqz.cjs");const r=require("./voice-recorder-B1tBrGTV.cjs");let i=require("lit"),a=require("lit/decorators.js"),o=require("@luzmo/icons");var s=class{constructor(e){this._attachments=[],this._idCounter=0,this._host=e,e.addController(this)}hostConnected(){}hostDisconnected(){this._revokeAllPreviewUrls()}get attachments(){return this._attachments}get hasAttachments(){return this._attachments.length>0}get imageAttachments(){return this._attachments.filter(e=>this._isImageFile(e.file))}get fileAttachments(){return this._attachments.filter(e=>!this._isImageFile(e.file))}addFiles(e){if(this._host.disabled||this._host.readonly||this._host.pending)return[];let t=[];for(let n of e){if(this._isImageFile(n)&&!this._host.allowImages||!this._isImageFile(n)&&!this._host.allowFiles||!this._isFileTypeAccepted(n))continue;let e=this._generateId(),r={file:n,id:e};this._isImageFile(n)&&(r.previewUrl=URL.createObjectURL(n)),this._attachments=[...this._attachments,r],t.push(e)}return t.length>0&&(this._dispatchChange(),this._host.requestUpdate()),t}removeAttachment(e){let t=this._attachments.find(t=>t.id===e);t&&(t.previewUrl&&URL.revokeObjectURL(t.previewUrl),this._attachments=this._attachments.filter(t=>t.id!==e),this._dispatchChange(),this._host.requestUpdate())}setAttachmentLoading(e,t){let n=this._attachments.findIndex(t=>t.id===e);if(n===-1)return;let r=this._attachments[n];!!r.loading!==t&&(this._attachments=[...this._attachments.slice(0,n),{...r,loading:t},...this._attachments.slice(n+1)],this._dispatchChange(),this._host.requestUpdate())}clearAttachments(){this._revokeAllPreviewUrls(),this._attachments=[],this._dispatchChange(),this._host.requestUpdate()}getAttachments(){return[...this._attachments]}handlePastedImages(e){if(!this._host.allowImages||this._host.disabled||this._host.readonly||this._host.pending||!e)return!1;let t=[];for(let n of e.items)if(n.type.startsWith(`image/`)){let e=n.getAsFile();e&&t.push(e)}return t.length>0&&(this.addFiles(t),!0)}getAcceptAttribute(){if(this._host.acceptedFileTypes.length>0)return this._host.acceptedFileTypes.join(`,`);let e=[];return this._host.allowImages&&e.push(`image/*`),this._host.allowFiles&&e.push(`*/*`),e.join(`,`)}isImageFile(e){return this._isImageFile(e)}_isImageFile(e){return e.type.startsWith(`image/`)}_isFileTypeAccepted(e){if(this._host.acceptedFileTypes.length===0)return!0;let t=e.name.toLowerCase(),n=e.type.toLowerCase();for(let e of this._host.acceptedFileTypes){let r=e.toLowerCase();if(r.endsWith(`/*`)){let e=r.slice(0,-2);if(n.startsWith(e+`/`))return!0}else if(n===r)return!0;else if(r.startsWith(`.`)&&t.endsWith(r))return!0}return!1}_generateId(){return`attachment-${++this._idCounter}-${Date.now()}`}_revokeAllPreviewUrls(){for(let e of this._attachments)e.previewUrl&&URL.revokeObjectURL(e.previewUrl)}_dispatchChange(){this._host.dispatchEvent(new CustomEvent(`luzmo-attachments-change`,{bubbles:!0,composed:!0,detail:{attachments:this._attachments}}))}},c=class{constructor(e){this._voiceRecorder=null,this.isRecording=!1,this.duration=0,this.audioLevel=0,this.shouldFocusFinishButton=!1,this._host=e,e.addController(this)}hostConnected(){}hostDisconnected(){this._destroy()}async start(e){r.t.isSupported()?this.isRecording?this.stop():(this.shouldFocusFinishButton=e,this._init(),this._voiceRecorder&&(await this._voiceRecorder.startRecording()&&(this.isRecording=!0,this.duration=0,this.audioLevel=0,this._host.requestUpdate()),this._host.dispatchEvent(new CustomEvent(`luzmo-record`,{bubbles:!0,composed:!0,detail:{isRecording:this.isRecording}})))):this._host.dispatchEvent(new CustomEvent(`luzmo-record-error`,{bubbles:!0,composed:!0,detail:{error:`Voice recording is not supported in this browser`}}))}stop(){this._voiceRecorder?.stopRecording()}cancel(){this._voiceRecorder?.cancelRecording(),this.isRecording=!1,this.duration=0,this.audioLevel=0,this._host.requestUpdate(),this._host.dispatchEvent(new CustomEvent(`luzmo-record-cancel`,{bubbles:!0,composed:!0}))}formatDuration(){return r.t.formatDuration(this.duration)}static isSupported(){return r.t.isSupported()}_init(){this._voiceRecorder||(this._voiceRecorder=new r.t({maxDuration:3e5}),this._voiceRecorder.onStart(()=>{this.isRecording=!0,this._host.requestUpdate()}).onStop(e=>{this.isRecording=!1,this.duration=0,this.audioLevel=0,this._host.requestUpdate(),this._host.dispatchEvent(new CustomEvent(`luzmo-recording-complete`,{bubbles:!0,composed:!0,detail:{audioBlob:e.audioBlob,duration:e.duration,mimeType:e.mimeType}}))}).onError(e=>{this.isRecording=!1,this.duration=0,this.audioLevel=0,this._host.requestUpdate(),this._host.dispatchEvent(new CustomEvent(`luzmo-record-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}).onAudioLevel(e=>{this.audioLevel=e,this._host.requestUpdate()}).onDurationUpdate(e=>{this.duration=e,this._host.requestUpdate()}))}_destroy(){this._voiceRecorder&&=(this._voiceRecorder.destroy(),null),this.isRecording=!1,this.duration=0,this.audioLevel=0}};function l(e,t){let n=document.createRange();return n.setStart(e,t),n.collapse(!0),n}function u(e,t,n){let r=e.getBoundingClientRect(),i=t-r.left,a=n-r.top;return i*i+a*a}function d(e,t,n,r){let i=0,a=t;for(;a-i>1;){let t=i+a>>>1,r=document.createRange();r.setStart(e,t),r.collapse(!0),r.getBoundingClientRect().left<n?i=t:a=t}let o=l(e,i),s=u(o,n,r),c=l(e,a),d=u(c,n,r);return d<s&&(o=c,s=d),{range:o,distSq:s}}function f(e,t,n,r){let i=null,a=1/0;for(let[o,s]of e.childNodes.entries())if(s!==r){if(s.nodeType===Node.TEXT_NODE){let e=(s.textContent??``).length;if(e===0)continue;let r=d(s,e,t,n);r.distSq<a&&(a=r.distSq,i=r.range)}else if(s.nodeType===Node.ELEMENT_NODE){let r=s.getBoundingClientRect();if(r.width===0&&r.height===0)continue;let c=r.left+r.width/2,u=l(e,o),d=l(e,o+1),f=t<c?u:d,p=n-(r.top+r.height/2),m=t<c?t-r.left:t-r.right,h=m*m+p*p;h<a&&(a=h,i=f)}}if(!i){let t=document.createRange();return t.selectNodeContents(e),t.collapse(!1),t}return i}function p(e,t,n,r,i){if(Number.isNaN(n)||Number.isNaN(r))return null;let a=null,o=e;if(o?.caretPositionFromPoint){let e=o.caretPositionFromPoint(n,r);e&&(a=l(e.offsetNode,e.offset))}else o?.caretRangeFromPoint&&(a=o.caretRangeFromPoint(n,r));if(!a){if(`caretPositionFromPoint`in document){let e=document.caretPositionFromPoint(n,r);e&&(a=l(e.offsetNode,e.offset))}else`caretRangeFromPoint`in document&&(a=document.caretRangeFromPoint(n,r))}return a&&t.contains(a.startContainer)||(a=f(t,n,r,i)),a}function m(e){if(e){let t=e.getSelection?.();if(t&&t.rangeCount>0)return t.getRangeAt(0)}let t=document.getSelection();if(!t||t.rangeCount===0)return null;let n=t.getRangeAt(0);if(!e||e.contains(n.startContainer))return n;let r=t;if(e&&r.getComposedRanges)try{let t=r.getComposedRanges(e);if(t.length>0){let e=t[0],n=document.createRange();return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}}catch{}return null}function h(e,t){let n=document.getSelection();if(n)try{n.setBaseAndExtent(e,t,e,t)}catch{let r=document.createRange();r.setStart(e,t),r.collapse(!0),n.removeAllRanges(),n.addRange(r)}}function g(e){return e===` `||e===`
19
19
  `||e===`\xA0`}function ee(e){let t=m(e);if(!t||!t.collapsed)return!1;let n=t.startContainer,r=t.startOffset;if(n.nodeType===Node.TEXT_NODE){if(r>=2)return g(n.textContent?.charAt(r-2)??``);let e=n.previousSibling;if(!e||e.nodeType===Node.ELEMENT_NODE&&e.classList?.contains(`element-badge`))return!0;let t=e.textContent??``;return t.length===0||g(t.at(-1)??``)}if(n.nodeType===Node.ELEMENT_NODE){if(r===0)return!0;let e=n.childNodes[r-1];if(!e||e.nodeType===Node.ELEMENT_NODE&&e.classList?.contains(`element-badge`))return!0;if(e.nodeType===Node.TEXT_NODE){let t=e.textContent??``;return t.length===0||g(t.at(-1)??``)}}return!1}function te(e,t){let n=m(e);if(!n){if(!t)return null;let e=t.getBoundingClientRect();return{x:e.left,y:e.bottom}}let r=n.cloneRange();r.collapse(!0);let i=r.startContainer,a=r.startOffset;if(i.nodeType===Node.TEXT_NODE&&a>0){let e=document.createRange();e.setStart(i,a-1),e.setEnd(i,a);let t=e.getBoundingClientRect();if(t.width>0||t.height>0)return{x:t.left,y:t.bottom}}let o=r.getBoundingClientRect();if(o.width===0&&o.height===0&&o.x===0){if(t){let e=t.getBoundingClientRect();return{x:e.left,y:e.bottom}}return null}return{x:o.left,y:o.bottom}}function _(e,t){let n=m(e);if(!n||!n.collapsed)return null;let r=n.startContainer,i=n.startOffset;if(r.nodeType!==Node.TEXT_NODE)return null;let a=(r.textContent??``).slice(0,Math.max(0,i)),o=a.lastIndexOf(t);return o===-1?null:a.slice(Math.max(0,o+1))}function v(e,t){if(e.focus(),!t)return;let n=e.querySelector(`[data-element-id="${t}"]`);if(!n)return;let r=n.nextSibling;if(r&&r.nodeType===Node.TEXT_NODE){let e=r.textContent??``,t=e.indexOf(` `);h(r,t===-1?e.length:t+1);return}let i=document.getSelection();if(!i)return;let a=document.createRange();a.setStartAfter(n),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}function ne(e,t,n,r){let i=m(e);if(i){let e=i.startContainer,r=i.startOffset;if(e.nodeType===Node.TEXT_NODE&&t.contains(e)){let t=e.textContent??``,i=t.slice(0,Math.max(0,r)).lastIndexOf(n);if(i!==-1){e.textContent=t.slice(0,Math.max(0,i))+t.slice(Math.max(0,r)),h(e,i);return}}}let a=n+(r??``),o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),s;for(;s=o.nextNode();){let e=s.textContent??``,n=e.lastIndexOf(a);if(n!==-1){s.textContent=e.slice(0,Math.max(0,n))+e.slice(Math.max(0,n+a.length)),t.focus(),h(s,n);return}}}var y=`application/x-luzmo-element`,b=class{constructor(e){this._elements=new Map,this._idCounter=0,this._dragCaret=null,this.isDragOver=!1,this.richInputElement=null,this.handleRichInput=()=>{this.syncValue(),this._host.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))},this.handleRichPaste=e=>{if(e.preventDefault(),this._cannotEditRichContent())return;if(this._host.allowImages&&e.clipboardData&&this._host.handlePastedImages(e.clipboardData)){e.stopPropagation();return}let t=e.clipboardData?.getData(`text/plain`)??``;if(t){let e=m(this._host.shadowRoot);if(e){e.deleteContents(),e.insertNode(document.createTextNode(t)),e.collapse(!1);let n=document.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}this.syncValue(),this._host.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))}},this.handleRichDragOver=e=>{this._cannotEditRichContent()||e.dataTransfer?.types.includes(`application/x-luzmo-element`)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),this.isDragOver=!0,this._host.requestUpdate(),this._positionCaretAtPoint(e.clientX,e.clientY),this._showDragCaret(e.clientX,e.clientY))},this.handleRichDragLeave=e=>{let t=e.relatedTarget;t&&this.richInputElement?.contains(t)||(this.isDragOver=!1,this._hideDragCaret(),this._host.requestUpdate())},this.handleRichDrop=e=>{if(e.preventDefault(),this.isDragOver=!1,this._hideDragCaret(),this._cannotEditRichContent()){this._host.requestUpdate();return}let t=e.dataTransfer?.getData(y);if(!t)this._host.requestUpdate();else try{let n=JSON.parse(t);if(n.elementType&&n.label){this.richInputElement?.focus();let t=this.richInputElement?p(this._host.shadowRoot,this.richInputElement,e.clientX,e.clientY,this._dragCaret):null;this._insertElementAtRange(n.elementType,n.label,n.data??null,void 0,t)}this._host.requestUpdate()}catch{this._host.requestUpdate()}},this._host=e,e.addController(this)}hostConnected(){}hostDisconnected(){}get elements(){return this._elements}get elementCount(){return this._elements.size}getSegments(){return!this._host.allowElements||!this.richInputElement?[{type:`text`,value:this._host.value}]:this._parseSegments()}setSegments(e){this._host.allowElements?(this._elements.clear(),this._host.updateComplete.then(()=>{if(this.richInputElement){this.richInputElement.innerHTML=``;for(let t of e)if(t.type===`text`&&t.value)this.richInputElement.append(document.createTextNode(t.value));else if(t.type===`element`&&t.value){let e={...t.value};e.id||=this._generateId(),this._elements.set(e.id,e),this.richInputElement.append(this._createBadgeNode(e))}this.syncValue()}})):this._host.value=this._segmentsToPlainText(e)}insertElement(e,t,n,r){return this._insertElementAtRange(e,t,n,r,null)}_insertElementAtRange(e,t,n,r,i){if(this._cannotEditRichContent()||this._host.acceptedElementTypes.length>0&&!this._host.acceptedElementTypes.includes(e)||!this.richInputElement)return``;let a=this._generateId(),o={id:a,elementType:e,label:t,data:n,icon:r};this._elements.set(a,o);let s=this._createBadgeNode(o),c=this.richInputElement,l=!1,u=i===null?this._getSelectionRange():i;if(u&&c.contains(u.commonAncestorContainer)){u.deleteContents(),u.insertNode(s);let e=s.previousSibling;if(e?.nodeType===Node.TEXT_NODE){let t=e.previousSibling;t?.classList?.contains(`element-badge`)&&this._ensureSpaceAfter(t)}this._ensureSpaceAfter(s),v(c,a),l=!0}return l||(c.append(s),this._ensureSpaceAfter(s),v(c,a)),this.syncValue(),this._host.dispatchEvent(new CustomEvent(`luzmo-element-inserted`,{bubbles:!0,composed:!0,detail:{element:o}})),a}_getSelectionRange(){return m(this._host.shadowRoot)}removeElement(e){let t=this._elements.get(e);if(!t)return;this._elements.delete(e);let n=this.richInputElement?.querySelector(`[data-element-id="${e}"]`);if(n){let e=n.nextSibling;if(n.remove(),e&&e.nodeType===Node.TEXT_NODE){let t=(e.textContent??``).replaceAll(`​`,``);t?e.textContent=t:e.remove()}this.syncValue()}this._host.dispatchEvent(new CustomEvent(`luzmo-element-removed`,{bubbles:!0,composed:!0,detail:{element:t}}))}getElements(){return[...this._elements.values()]}clearElements(){this._elements.clear(),this.richInputElement&&(this.richInputElement.innerHTML=``)}handleBadgeDelete(e){let t=m(this._host.shadowRoot);if(!t||!t.collapsed)return!1;let n=e===`Backspace`?this._findBadgeBefore(t.startContainer,t.startOffset):e===`Delete`?this._findBadgeAfter(t.startContainer,t.startOffset):null;return n?.dataset.elementId?(this.removeElement(n.dataset.elementId),!0):!1}_findBadgeBefore(e,t){if(e.nodeType===Node.ELEMENT_NODE){let n=e.childNodes[t-1];if(n?.classList?.contains(`element-badge`))return n}else if(e.nodeType===Node.TEXT_NODE){if(t===0){let t=e.previousSibling;if(t?.classList?.contains(`element-badge`))return t}else{let n=(e.textContent??``).slice(0,t);if(/^[\u200B\uFEFF]*$/.test(n)){let t=e.previousSibling;if(t?.classList?.contains(`element-badge`))return t}}}return null}_findBadgeAfter(e,t){if(e.nodeType===Node.ELEMENT_NODE){let n=e.childNodes[t];if(n?.classList?.contains(`element-badge`))return n}else if(e.nodeType===Node.TEXT_NODE){let n=e.textContent??``;if(t===n.length){let t=e.nextSibling;if(t?.classList?.contains(`element-badge`))return t}else{let r=n.slice(t);if(/^[\u200B\uFEFF]*$/.test(r)){let t=e.nextSibling;if(t?.classList?.contains(`element-badge`))return t}}}return null}_segmentsToPlainText(e){return e.map(e=>e.type===`text`?e.value??``:e.value?.label??``).join(``)}_cannotEditRichContent(){return!this._host.allowElements||this._host.disabled||this._host.readonly||this._host.pending}_cleanupSemanticallyEmptyRichInput(e){let t=this.richInputElement;if(!t)return;let n=this._elements.size===0&&e.trim().length===0,r=this._dragCaret?.parentNode===t;n&&!r&&t.innerHTML!==``&&(t.innerHTML=``,this._host.value=``)}syncValue(){if(!this.richInputElement)return;let e=this._parseSegments(),t=this._segmentsToPlainText(e);this._host.value=t,this._cleanupSemanticallyEmptyRichInput(t),this._host.requestUpdate()}_parseSegments(){if(!this.richInputElement)return[];let e=[];for(let t of this.richInputElement.childNodes)if(t.nodeType===Node.TEXT_NODE){let n=(t.textContent??``).replaceAll(`​`,``);n&&e.push({type:`text`,value:n})}else if(t.nodeType===Node.ELEMENT_NODE){let n=t;if(n.classList.contains(`drag-caret`))continue;if(n.classList.contains(`element-badge`)){let t=n.dataset.elementId??``,r=this._elements.get(t);r&&e.push({type:`element`,value:{...r}})}else if(n.tagName===`BR`)e.push({type:`text`,value:`
20
20
  `});else{let t=n.textContent??``;t&&e.push({type:`text`,value:t})}}return e}_createBadgeNode(e){let t=document.createElement(`span`);if(t.className=`element-badge`,t.setAttribute(`contenteditable`,`false`),t.dataset.elementId=e.id,t.dataset.elementType=e.elementType,e.icon){let n=document.createElement(`luzmo-icon`);n.icon=e.icon,n.setAttribute(`size`,`xxs`),n.className=`element-badge-icon`,t.append(n)}let n=document.createElement(`span`);n.className=`element-badge-label`,n.textContent=e.label,t.append(n);let r=document.createElement(`button`);return r.type=`button`,r.setAttribute(`role`,`button`),r.tabIndex=-1,r.className=`element-badge-remove`,r.setAttribute(`contenteditable`,`false`),r.setAttribute(`aria-label`,`Remove ${e.label}`),r.textContent=`×`,r.addEventListener(`click`,t=>{t.preventDefault(),t.stopPropagation(),this.removeElement(e.id)}),t.append(r),t}_ensureSpaceAfter(e){let t=e.nextSibling;if(t&&t.nodeType===Node.TEXT_NODE&&t.textContent){let e=t.textContent;if(e.startsWith(`​`)&&e.length>1)return;if(e.startsWith(` `)){t.textContent=`​`+e;return}if(/^\u200B+$/.test(e)){t.textContent=e+` `;return}}e.parentNode?.insertBefore(document.createTextNode(`​ `),t??null)}_showDragCaret(e,t){if(!this.richInputElement){this._hideDragCaret();return}let n=p(this._host.shadowRoot,this.richInputElement,e,t,this._dragCaret);if(!n){this._hideDragCaret();return}let r=n.getBoundingClientRect(),i=this.richInputElement.getBoundingClientRect(),a=r.left-i.left+this.richInputElement.scrollLeft,o=r.top-i.top+this.richInputElement.scrollTop,s=r.height;if(s===0){let e=getComputedStyle(this.richInputElement);s=Number.parseFloat(e.lineHeight)||Number.parseFloat(e.fontSize)||16,o=t-i.top+this.richInputElement.scrollTop-s/2}this._dragCaret||(this._dragCaret=document.createElement(`div`),this._dragCaret.className=`drag-caret`);let c=this._dragCaret;c.style.position=`absolute`,c.style.top=`${o}px`,c.style.left=`${a}px`,c.style.height=`${s}px`,c.parentNode||(this.richInputElement.style.position=`relative`,this.richInputElement.append(c))}_hideDragCaret(){this._dragCaret?.remove()}_generateId(){return`el-${++this._idCounter}-${Date.now()}`}_positionCaretAtPoint(e,t){if(!this.richInputElement)return;let n=p(this._host.shadowRoot,this.richInputElement,e,t,this._dragCaret);if(n){let e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}}},x=class{constructor(e){this._triggers=[],this.activeTrigger=null,this.searchString=``,this.virtualElement=null,this.highlightedIndex=0,this.pointerMovedSinceKeyNav=!0,this.hoveredIndex=-1,this.filteredOptions=[],this.richInputElement=null,this.handleOverlayClosed=()=>{this.close()},this.handleOverlayKeydown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.close(),this.richInputElement?.focus())},this.handlePointerMove=()=>{this.pointerMovedSinceKeyNav=!0},this._handleTriggerSelect=e=>{if(!this.activeTrigger)return;let{elementType:t,label:n,data:r,icon:i}=e.detail;this.selectOption({label:n,value:n,data:r,icon:i,elementType:t})},this._handleDocumentPointerDown=e=>{let t=e.composedPath(),n=this._host.shadowRoot?.querySelector(`luzmo-overlay[part="trigger-menu-overlay"]`);n&&t.includes(n)||this.richInputElement&&t.includes(this.richInputElement)||(this.close(),this.richInputElement?.focus())},this._host=e,e.addController(this)}hostConnected(){this._host.addEventListener(`luzmo-trigger-select`,this._handleTriggerSelect)}hostDisconnected(){document.removeEventListener(`pointerdown`,this._handleDocumentPointerDown,!0),this._host.removeEventListener(`luzmo-trigger-select`,this._handleTriggerSelect)}get triggers(){return this._triggers}set triggers(e){this._triggers=e,this.activeTrigger&&this._updateFilteredOptions()}get activeConfig(){if(this.activeTrigger)return this._triggers.find(e=>e.key===this.activeTrigger)}get hasTriggers(){return this._triggers.length>0}getSlotName(e){return this._triggers.find(t=>t.key===e)?.slotName}get allSlotNames(){return this._triggers.map(e=>e.slotName).filter(e=>!!e)}handleInput(e){if(this.activeTrigger){let e=_(this._host.shadowRoot,this.activeTrigger)??this._extractTriggerSearchFromContent(this.activeTrigger);e===null?this.close():(this.searchString=e,this._updateFilteredOptions(),this.highlightedIndex=this._findSelectableIndex(0,1),this._dispatchChange(!0),this._host.requestUpdate(),document.dispatchEvent(new Event(`luzmo-update-overlays`)))}else this._detectTrigger(e)}open(e){if(!this._triggers.find(t=>t.key===e))return;let t=te(this._host.shadowRoot,this.richInputElement);if(!t)return;this.activeTrigger=e,this.searchString=``,this._updateFilteredOptions(),this.highlightedIndex=this._findSelectableIndex(0,1);let r=this.richInputElement?.getBoundingClientRect().top??t.y;this.virtualElement?this.virtualElement.updateBoundingClientRect(t.x,t.y,r):this.virtualElement=new n.v(t.x,t.y,r),this._dispatchChange(!0),this._host.requestUpdate(),requestAnimationFrame(()=>{document.addEventListener(`pointerdown`,this._handleDocumentPointerDown,!0)})}close(){if(this.activeTrigger===null)return;document.removeEventListener(`pointerdown`,this._handleDocumentPointerDown,!0);let e=this.activeTrigger;this.activeTrigger=null,this.searchString=``,this.filteredOptions=[],this.highlightedIndex=0,this.hoveredIndex=-1,this._host.dispatchEvent(new CustomEvent(`luzmo-trigger-change`,{bubbles:!0,composed:!0,detail:{trigger:e,open:!1,searchString:``}})),this._host.requestUpdate()}handleKeydown(e){return this.activeTrigger?e.key===`Escape`?(e.preventDefault(),this.close(),this.richInputElement?.focus(),!0):e.key===`Tab`?(this.close(),!1):e.key===`ArrowDown`?(e.preventDefault(),this._moveHighlight(1),!0):e.key===`ArrowUp`?(e.preventDefault(),this._moveHighlight(-1),!0):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),this._selectHighlighted(),!0):!1}_detectTrigger(e){if(this._host.disabled||this._host.readonly||this._host.pending)return;let t=e?.data??``;t.length===1&&this._isTriggerKey(t)&&ee(this._host.shadowRoot)&&this.open(t)}_extractTriggerSearchFromContent(e){let t=this.richInputElement?.textContent??``;if(!t)return null;let n=t.lastIndexOf(e);if(n===-1)return null;let r=t.slice(n+1);return r.includes(` `)||r.includes(`
21
21
  `)?null:r}_isTriggerKey(e){return this._triggers.some(t=>t.key===e)}_updateFilteredOptions(){let e=this.activeConfig;if(!e?.options){this.filteredOptions=[];return}if(e.lazy||!this.searchString){this.filteredOptions=e.options;return}let t=this.searchString.toLowerCase(),n=[],r=null;for(let i of e.options)i.header?r=i:(i.label.toLowerCase().includes(t)||(i.description?.toLowerCase().includes(t)??!1))&&(r&&=(n.push(r),null),n.push(i));this.filteredOptions=n}_findSelectableIndex(e,t){let n=this.filteredOptions.length;if(n===0)return-1;let r=(e%n+n)%n;for(let e=0;e<n;e++){if(!this.filteredOptions[r].header)return r;r=((r+t)%n+n)%n}return-1}_moveHighlight(e){let t=this.filteredOptions.length;if(t===0)return;let n=(this.highlightedIndex+e+t)%t;n=this._findSelectableIndex(n,e),n!==-1&&(this.pointerMovedSinceKeyNav=!1,this.hoveredIndex=-1,this.highlightedIndex=n,this._host.requestUpdate(),requestAnimationFrame(()=>{this._host.shadowRoot?.querySelector(`.trigger-option.highlighted`)?.scrollIntoView({block:`nearest`})}))}_selectHighlighted(){let e=this.filteredOptions[this.highlightedIndex];e?this.selectOption(e):this.close()}selectOption(e){if(!this.activeTrigger||!this.richInputElement)return;let t=this.activeTrigger,n=this.richInputElement,r=this._host.shadowRoot;ne(r,n,t,this.searchString);let i=e.elementType??t,a=this._host.insertElement(i,e.label,e.data??null,e.icon);v(n,a),this.close(),this._host.updateComplete.then(()=>{requestAnimationFrame(()=>{v(n,a)})})}_dispatchChange(e){this.activeTrigger&&this._host.dispatchEvent(new CustomEvent(`luzmo-trigger-change`,{bubbles:!0,composed:!0,detail:{trigger:this.activeTrigger,open:e,searchString:this.searchString}}))}},S=!1,C=0;function w(){S=!0}function T(){S=!1}function re(){document.addEventListener(`keydown`,w,!0),document.addEventListener(`mousedown`,T,!0),document.addEventListener(`pointerdown`,T,!0)}function E(){document.removeEventListener(`keydown`,w,!0),document.removeEventListener(`mousedown`,T,!0),document.removeEventListener(`pointerdown`,T,!0)}function D(){C===0&&typeof window<`u`&&re(),C++}function O(){C--,C<=0&&(C=0,E())}function k(){return S}function A(e,t,n){return i.html`
@@ -17,12 +17,12 @@
17
17
  * */
18
18
  import "./tokens.js";
19
19
  import { n as e, t } from "./decorate-CpKsOs9z.js";
20
- import { n } from "./sized-mixin-BmxIAuoH.js";
20
+ import { n } from "./sized-mixin-Cb-47MjG.js";
21
21
  import "./icon-DADJww_a.js";
22
- import "./action-button-BB3ZZFNN.js";
22
+ import "./action-button-LmKtPKfe.js";
23
23
  import { v as r } from "./overlay-D_Xfq92b.js";
24
- import "./button-CpaltgRZ.js";
25
- import "./text-field-SNbvQYOj.js";
24
+ import "./button-5jzMIMLW.js";
25
+ import "./text-field-Cn51A87k.js";
26
26
  import "./skeleton-loader-tin9y3xc.js";
27
27
  import { t as i } from "./voice-recorder-BXY_l_78.js";
28
28
  import { html as a, nothing as o, unsafeCSS as s } from "lit";
@@ -15,4 +15,4 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../tokens.cjs");const e=require("../question-box-DmTWFlRn.cjs");exports.DEFAULT_QUESTION_BOX_LABELS=e.a,exports.LuzmoQuestionBox=e.t,exports.QUESTION_BOX_OTHER_VALUE=e.o,exports.questionBoxOtherKey=e.s,exports.questionsToRequestedSchema=e.n,exports.requestedSchemaToQuestions=e.r,exports.toElicitationContent=e.i;
18
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../tokens.cjs");const e=require("../question-box-C7oXNWje.cjs");exports.DEFAULT_QUESTION_BOX_LABELS=e.a,exports.LuzmoQuestionBox=e.t,exports.QUESTION_BOX_OTHER_VALUE=e.o,exports.questionBoxOtherKey=e.s,exports.questionsToRequestedSchema=e.n,exports.requestedSchemaToQuestions=e.r,exports.toElicitationContent=e.i;
@@ -16,4 +16,4 @@
16
16
  * SOFTWARE.
17
17
  * */
18
18
  import "../tokens.js";
19
- export { a as DEFAULT_QUESTION_BOX_LABELS, t as LuzmoQuestionBox, o as QUESTION_BOX_OTHER_VALUE, s as questionBoxOtherKey, n as questionsToRequestedSchema, r as requestedSchemaToQuestions, i as toElicitationContent } from "../question-box-CxzEveid.js";
19
+ export { a as DEFAULT_QUESTION_BOX_LABELS, t as LuzmoQuestionBox, o as QUESTION_BOX_OTHER_VALUE, s as questionBoxOtherKey, n as questionsToRequestedSchema, r as requestedSchemaToQuestions, i as toElicitationContent } from "../question-box-wYSFkVoP.js";
@@ -1,5 +1,5 @@
1
1
  import { nothing, TemplateResult } from 'lit';
2
- import type { ElementSize } from '../../utils/sized-mixin';
2
+ import { type ElementSize } from '../../utils/sized-mixin';
3
3
  import { type QuestionBoxLabels, type QuestionBoxOption, type QuestionBoxOptionIndicator, type QuestionBoxQuestion, type QuestionBoxValue } from './types';
4
4
  /**
5
5
  * Listeners the templates bind. Every entry is a stable field on the host, so
@@ -15,7 +15,7 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./sized-mixin-CSajkMro.cjs"),n=require("./roving-tabindex-BUFR8hPH.cjs");require("./icon-BlbMP3mJ.cjs");const r=require("./language-resolution-B7D3hQ6_.cjs");require("./action-button-CL4ZlryE.cjs"),require("./badge-DzElGOcl.cjs"),require("./button-BGEWdRbY.cjs"),require("./checkbox-NSSgVzJg.cjs"),require("./field-group/index.cjs"),require("./text-field-CZixBD87.cjs"),require("./radio-Dd-GgUMm.cjs");let i=require("lit"),a=require("lit/decorators.js"),o=require("@luzmo/icons"),s=require("lit/directives/if-defined.js"),c=require("lit/directives/repeat.js"),l=require("lit/directives/keyed.js");var u=`:host{font-family:var(--question-box-font-family);font-size:var(--question-box-font-size);color:var(--highcontrast-question-box-color,var(--question-box-color));box-sizing:border-box;inline-size:100%;max-inline-size:var(--luzmo-question-box-max-inline-size,var(--question-box-max-inline-size));display:block}:host([disabled]){pointer-events:none}.card{gap:var(--question-box-gap);padding:var(--question-box-padding);box-sizing:border-box;border-width:var(--question-box-border-width);border-style:solid;border-color:var(--highcontrast-question-box-border-color,var(--question-box-border-color));border-radius:var(--question-box-border-radius);background-color:var(--highcontrast-question-box-background-color,var(--question-box-background-color));flex-direction:column;display:flex}.header{justify-content:space-between;align-items:flex-start;gap:var(--question-box-header-gap);display:flex}.header-actions,.step-navigation{align-items:center;display:flex}.header-actions{gap:var(--question-box-header-actions-gap);min-block-size:0;block-size:max(var(--question-box-title-font-size) * var(--question-box-title-line-height), var(--question-box-header-control-size) - 2 * (var(--question-box-padding) - var(--question-box-header-actions-inset)));flex-shrink:0;margin-inline-start:auto;overflow:visible}.step-navigation{gap:var(--question-box-copy-gap)}.heading{gap:var(--question-box-heading-copy-gap);flex-direction:column;min-inline-size:0;display:flex}.progress{font-size:var(--question-box-progress-font-size);color:var(--question-box-muted-color);margin:0}.title{font-size:var(--question-box-title-font-size);font-weight:var(--luzmo-font-weight-bold);line-height:var(--question-box-title-line-height);margin:0}.title:focus,.summary-heading:focus{outline:none}.title:focus-visible,.summary-heading:focus-visible{-webkit-text-decoration-color:var(--question-box-focus-ring-color);text-decoration-color:var(--question-box-focus-ring-color);text-decoration-line:underline;text-decoration-thickness:var(--question-box-focus-ring-width);text-underline-offset:var(--question-box-focus-ring-gap);outline:none}.description{color:var(--question-box-muted-color);font-size:inherit;margin:0;margin-block-start:var(--question-box-heading-copy-offset);line-height:1.4}.close{flex-shrink:0}.body{gap:var(--question-box-option-gap);max-block-size:var(--luzmo-question-box-body-max-block-size,var(--question-box-body-max-block-size));padding-block:var(--question-box-body-focus-inset);margin-block:calc(var(--question-box-body-focus-inset) * -1);flex-direction:column;display:flex;overflow:hidden auto}.body::-webkit-scrollbar{width:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width));height:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width))}.body::-webkit-scrollbar-track{background:var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background));border-radius:var(--luzmo-question-box-scrollbar-track-border-radius,var(--question-box-scrollbar-track-border-radius))}.body::-webkit-scrollbar-thumb{background:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background));border-radius:var(--luzmo-question-box-scrollbar-thumb-border-radius,var(--question-box-scrollbar-thumb-border-radius))}.body::-webkit-scrollbar-thumb:hover{background:var(--luzmo-question-box-scrollbar-thumb-hover-background,var(--question-box-scrollbar-thumb-hover-background))}.body{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background)) var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background))}.options{box-sizing:border-box;flex-direction:column;inline-size:100%;min-inline-size:0;display:flex}.options--descriptive luzmo-radio,.options--descriptive luzmo-checkbox,.options--descriptive .other-option-answer{padding-block:var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block))}.body:has(.options--descriptive){margin-block:calc(var(--question-box-option-padding-block) - var(--question-box-body-focus-inset) - var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block)))}luzmo-radio,luzmo-checkbox{box-sizing:border-box;inline-size:100%;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));border-radius:var(--luzmo-border-radius-s);align-items:center;display:flex}luzmo-radio:hover,luzmo-checkbox:hover{background-color:var(--question-box-option-hover-background)}.other-option-row{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));inline-size:100%;max-inline-size:100%;display:flex}.other-option-answer{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;min-inline-size:0;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-radius:var(--luzmo-border-radius-s);flex:1;display:flex}.other-option-answer:hover{background-color:var(--question-box-option-hover-background)}luzmo-radio.other-option,luzmo-checkbox.other-option{border:0;flex:none;min-block-size:auto;inline-size:auto;padding:0}luzmo-radio.other-option{--luzmo-radio-button-top-to-control:0px}luzmo-radio.numbered-option{--luzmo-radio-button-control-size:0px;--luzmo-radio-button-top-to-control:0px;--luzmo-radio-text-to-control:0px;--luzmo-radio-border-width:0px;--luzmo-radio-focus-indicator-width:0px}luzmo-checkbox.numbered-option{--luzmo-checkbox-control-size:0px;--luzmo-checkbox-text-to-control:0px;--luzmo-checkbox-top-to-text:0px;--luzmo-checkbox-border-width:0px;--luzmo-checkbox-selected-border-width:0px;--luzmo-checkbox-focus-indicator-width:0px}luzmo-radio.numbered-option::part(control),luzmo-checkbox.numbered-option::part(control){display:none}luzmo-radio.other-option:hover,luzmo-checkbox.other-option:hover{background-color:#0000}.other-field{inline-size:auto;min-inline-size:0;max-inline-size:100%;min-block-size:var(--question-box-other-field-min-block-size);font-size:var(--question-box-other-field-font-size);--luzmo-text-field-width:100%;--luzmo-text-field-height:var(--question-box-other-field-min-block-size);--luzmo-text-field-background-color:transparent;--luzmo-text-field-background-color-disabled:transparent;--luzmo-text-field-placeholder-font-size:var(--question-box-other-field-font-size);--luzmo-text-field-border-width:0px;--luzmo-text-field-spacing-inline:0px;--luzmo-text-field-spacing-block-start:0px;--luzmo-text-field-spacing-block-end:0px;flex:1;justify-content:center}.other-primary{flex:none}.other-actions{box-sizing:border-box;justify-content:flex-end;align-items:center;gap:var(--question-box-copy-gap-detailed);inline-size:100%;padding-inline:var(--question-box-option-padding-inline);margin-block-start:var(--question-box-copy-gap-detailed);display:flex}.selected-count{font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.other-actions .selected-count{min-inline-size:0;margin-inline-end:auto}.other-actions luzmo-button{flex:none}.status-error{--luzmo-helptext-font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size));--luzmo-helptext-min-height:0;--luzmo-helptext-top-to-text:0;--luzmo-helptext-bottom-to-text:0}.visually-hidden{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.option-content{align-items:flex-start;gap:var(--question-box-option-gap);inline-size:100%;display:flex}.option-number{forced-color-adjust:none;inline-size:var(--question-box-option-number-size);block-size:var(--question-box-option-number-size);box-sizing:border-box;border:var(--luzmo-border-width) solid var(--highcontrast-question-box-option-number-border-color,var(--question-box-option-number-border-color));border-radius:var(--luzmo-border-radius);color:var(--highcontrast-question-box-option-number-color,var(--question-box-option-number-color));background-color:var(--highcontrast-question-box-option-number-background,var(--question-box-option-number-background));transition:color var(--luzmo-animation-duration) ease-in-out, border-color var(--luzmo-animation-duration) ease-in-out, background-color var(--luzmo-animation-duration) ease-in-out;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}luzmo-radio[checked] .option-number,luzmo-checkbox[checked] .option-number{color:var(--highcontrast-question-box-option-number-selected-color,var(--question-box-option-number-selected-color));border-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background));background-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background))}luzmo-radio[data-focus-visible] .option-number,luzmo-checkbox[data-focus-visible] .option-number,.option-number--focused{outline:var(--luzmo-question-box-focus-ring-width,var(--question-box-focus-ring-width)) solid var(--highcontrast-question-box-focus-ring-color,var(--luzmo-question-box-focus-ring-color,var(--question-box-focus-ring-color)));outline-offset:var(--luzmo-question-box-focus-ring-gap,var(--question-box-focus-ring-gap))}luzmo-radio[disabled] .option-number,luzmo-checkbox[disabled] .option-number{opacity:.5}.option-copy{gap:var(--question-box-copy-gap);flex-direction:column;flex:1;min-inline-size:0;display:flex}.option-edit luzmo-icon{color:inherit}.option-heading{align-items:center;gap:var(--question-box-recommended-gap);min-block-size:var(--question-box-option-number-size);flex-wrap:wrap;display:flex}.option-text{align-items:baseline;gap:var(--question-box-recommended-gap);flex-wrap:wrap;min-inline-size:0;display:flex}.option-description{color:var(--question-box-muted-color);line-height:1.4}.option-hint{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.footer{justify-content:space-between;align-items:center;gap:var(--question-box-option-gap);flex-wrap:wrap;display:flex}.status{color:var(--question-box-muted-color);font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;margin-inline-start:auto;display:flex}:host([dir=rtl]) .step-navigation luzmo-icon{transform:scaleX(-1)}.resolved{gap:var(--question-box-summary-gap)}.summary-actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;display:flex}.summary{gap:var(--question-box-option-gap);flex-direction:column;display:flex}.summary-heading{font-size:var(--question-box-title-font-size);line-height:var(--question-box-title-line-height);margin:0}.summary-row{gap:var(--question-box-copy-gap);flex-direction:column;display:flex}.summary-title{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.summary-answer{font-weight:var(--luzmo-font-weight-bold)}@media (prefers-reduced-motion:reduce){.option-number{transition-duration:0s}}@media (forced-colors:active){:host{--highcontrast-question-box-border-color:CanvasText;--highcontrast-question-box-background-color:Canvas;--highcontrast-question-box-color:CanvasText;--highcontrast-question-box-focus-ring-color:Highlight;--highcontrast-question-box-option-number-border-color:ButtonText;--highcontrast-question-box-option-number-color:ButtonText;--highcontrast-question-box-option-number-background:Canvas;--highcontrast-question-box-option-number-selected-background:Highlight;--highcontrast-question-box-option-number-selected-color:HighlightText}}:host{--question-box-font-family:var(--luzmo-font-family);--question-box-font-size:var(--luzmo-font-size-m);--question-box-color:var(--luzmo-font-color);--question-box-muted-color:color-mix(in srgb, var(--luzmo-font-color) 80%, var(--luzmo-background-color));--question-box-background-color:var(--luzmo-background-color);--question-box-border-color:var(--luzmo-border-color);--question-box-border-width:var(--luzmo-border-width);--question-box-border-radius:var(--luzmo-border-radius-l);--question-box-padding:var(--luzmo-spacing-5);--question-box-gap:var(--luzmo-spacing-4);--question-box-header-gap:var(--luzmo-spacing-3);--question-box-header-actions-gap:var(--luzmo-spacing-2);--question-box-header-actions-inset:var(--luzmo-spacing-2);--question-box-header-control-size:var(--luzmo-component-height);--question-box-max-inline-size:40rem;--question-box-body-max-block-size:24rem;--question-box-title-font-size:var(--question-box-font-size);--question-box-title-line-height:1.3;--question-box-progress-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-s);--question-box-option-min-block-size:var(--luzmo-component-height);--question-box-option-hover-background:var(--luzmo-background-color-hover);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-descriptive-option-padding-block:var(--question-box-option-padding-block);--question-box-option-padding-block:var(--luzmo-spacing-1);--question-box-option-padding-inline:var(--luzmo-spacing-3);--question-box-option-gap:var(--luzmo-spacing-3);--question-box-heading-copy-gap:0px;--question-box-heading-copy-offset:calc(var(--question-box-font-size) * -.25);--question-box-copy-gap:var(--luzmo-spacing-1);--question-box-copy-gap-detailed:var(--luzmo-spacing-2);--question-box-recommended-gap:var(--luzmo-spacing-2);--question-box-summary-gap:var(--luzmo-spacing-4);--question-box-body-focus-inset:calc(var(--luzmo-indicator-gap) + var(--luzmo-indicator-width));--question-box-focus-ring-width:var(--luzmo-indicator-width);--question-box-focus-ring-gap:var(--luzmo-indicator-gap);--question-box-focus-ring-color:var(--luzmo-indicator-color);--question-box-divider-width:0px;--question-box-option-number-background:var(--luzmo-background-color);--question-box-option-number-border-color:var(--luzmo-border-color);--question-box-option-number-color:var(--luzmo-font-color);--question-box-option-number-selected-background:var(--luzmo-primary);--question-box-option-number-selected-color:var(--luzmo-primary-inverse-color);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size);--question-box-divider-color:var(--luzmo-border-color);--question-box-scrollbar-width:var(--luzmo-scrollbar-size);--question-box-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--question-box-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--question-box-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--question-box-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--question-box-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background)}:host([size=s]){--question-box-padding:var(--luzmo-spacing-4);--question-box-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-xs);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-s);--question-box-option-min-block-size:var(--luzmo-component-height-s);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=l]){--question-box-font-size:var(--luzmo-font-size-l);--question-box-selected-count-font-size:var(--luzmo-font-size-m);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-l);--question-box-option-min-block-size:var(--luzmo-component-height-l);--question-box-option-number-size:var(--luzmo-component-height-s);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=xl]){--question-box-font-size:var(--luzmo-font-size-xl);--question-box-selected-count-font-size:var(--luzmo-font-size-l);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-xl);--question-box-option-min-block-size:var(--luzmo-component-height-xl);--question-box-option-number-size:var(--luzmo-component-height);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}`,d=`__other__`,f={continue:`Next`,back:`Back`,submit:`Submit`,skip:`Skip`,change:`Change`,close:`Close`,other:`Something else`,otherPlaceholder:`Something else`,recommended:`Recommended`,answerTitle:`Answer`,answersTitle:`Answers`,progress:`{current} of {total}`,selectedCount:`{count} selected`,selectedCountOne:`{count} selected`,recommendedSuffix:`{label} ({recommended})`,answer:`{answer}`,requiredSelectionDescription:`Choose one or more options.`,selectionRangeDescription:`Choose between {min} and {max} options.`,minSelectedError:`Choose at least {min} options.`,maxSelectedError:`Choose at most {max} options.`,otherRequiredError:`Enter a value for this option.`},p=e=>`${e}Other`,m=e=>!!e.other||e.options.length===0,h=e=>typeof e.other==`object`&&e.other?e.other:{},g=e=>Object.fromEntries(Object.entries(e)),_=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})},v=(e,t)=>{let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n){let n=e[r],i=t[r];if(Array.isArray(n)||Array.isArray(i)){if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length||n.some((e,t)=>e!==i[t]))return!1}else if(n!==i)return!1}return!0},y=e=>{let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n},b=e=>{let t=new Set(e.options.map(e=>e.value));return m(e)&&t.add(d),t},x=(e,t)=>{let n=t[e.id];return e.type===`single`?typeof n==`string`&&n?[n]:[]:Array.isArray(n)?y(n):[]},S=(e,t)=>x(e,t).includes(d),C=e=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0));return{...f,...t}},w=(e,t)=>{let n=e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`{${e}}`,r);return n},T=e=>{let t=new Set;for(let n of e){if(!n.id)throw TypeError(`luzmo-question-box: every question needs an id.`);if(t.has(n.id))throw TypeError(`luzmo-question-box: duplicate question id "${n.id}".`);t.add(n.id);let r=p(n.id);if(e.some(e=>e.id===r))throw TypeError(`luzmo-question-box: question id "${r}" collides with Other text for "${n.id}".`);if(n.type!==`multiple`&&(n.minSelected!==void 0||n.maxSelected!==void 0))throw TypeError(`luzmo-question-box: minSelected and maxSelected only apply to multiple-choice question "${n.id}".`);for(let[e,t]of[[`minSelected`,n.minSelected],[`maxSelected`,n.maxSelected]])if(t!==void 0&&(!Number.isInteger(t)||t<0))throw TypeError(`luzmo-question-box: ${e} must be a non-negative integer on "${n.id}".`);let i=n.minSelected??+!!n.required;if(n.maxSelected!==void 0&&i>n.maxSelected)throw TypeError(`luzmo-question-box: minSelected cannot exceed maxSelected on "${n.id}".`);let a=n.options.filter(e=>!e.disabled).length+ +!!m(n);if(n.type===`multiple`&&i>a)throw TypeError(`luzmo-question-box: minSelected exceeds the available options on "${n.id}".`);let o=new Set;for(let e of n.options){if(!e.value)throw TypeError(`luzmo-question-box: option values cannot be empty on "${n.id}".`);if(e.value===`__other__`)throw TypeError(`luzmo-question-box: "${d}" is reserved on "${n.id}".`);if(o.has(e.value))throw TypeError(`luzmo-question-box: duplicate option value "${e.value}" on "${n.id}".`);o.add(e.value)}}},ee=(e,t)=>{let n=Object.fromEntries([]);for(let r of e){let e=b(r),i=t[r.id],a=Object.hasOwn(t,r.id);if(r.type===`single`)typeof i==`string`&&e.has(i)?_(n,r.id,i):!a&&typeof r.default==`string`&&(e.has(r.default)||r.options.length===0)&&_(n,r.id,r.options.length===0?d:r.default);else{let t=[...r.options.map(e=>e.value),...m(r)?[d]:[]],o=y(Array.isArray(i)?i.filter(t=>e.has(t)):[]);if(o.length>0)_(n,r.id,t.filter(e=>o.includes(e)));else if(!a&&Array.isArray(r.default)){let i=y(r.default.filter(t=>e.has(t)));i.length>0&&_(n,r.id,t.filter(e=>i.includes(e)))}}let o=p(r.id),s=t[o];typeof s==`string`?_(n,o,s):!a&&r.options.length===0&&typeof r.default==`string`&&_(n,o,r.default)}return n},E=e=>e.minSelected??+!!e.required,D=(e,t)=>{let n=E(e),r=e.maxSelected;return n>0&&r!==void 0?w(t.selectionRangeDescription,{min:String(n),max:String(r)}):n===1?t.requiredSelectionDescription:n>1?w(t.minSelectedError,{min:String(n)}):r===void 0?void 0:w(t.maxSelectedError,{max:String(r)})},O=(e,t)=>{let n=x(e,t),r=E(e),i=e.maxSelected;if(n.length<r)return r<=1?`missing`:`minimum`;if(i!==void 0&&n.length>i)return`maximum`;if(S(e,t)&&!String(t[p(e.id)]??``).trim())return`otherText`},k=(e,t)=>O(e,t)!==void 0,A=(e,t,n)=>{switch(O(e,t)){case`minimum`:return w(n.minSelectedError,{min:String(E(e))});case`maximum`:return w(n.maxSelectedError,{max:String(e.maxSelected)});case`otherText`:return n.otherRequiredError;default:return}},j=(e,t,n,r,i)=>{if(i||t.disabled)return!0;if(e.type!==`multiple`||n)return!1;let a=e.maxSelected;return a!==void 0&&x(e,r).length>=a},M=(e,t)=>w(e===1?t.selectedCountOne:t.selectedCount,{count:String(e)}),N,P=(e,t)=>{try{return N?.language!==t&&(N={language:t,formatter:new Intl.ListFormat(t,{style:`narrow`,type:`conjunction`})}),N.formatter.format(e)}catch{return e.join(`, `)}},te=(e,t)=>e.recommended?w(t.recommendedSuffix,{label:e.label,recommended:t.recommended}):e.label,ne=e=>{let t=e.options.map(e=>({const:e.value,title:e.label}));return m(e)&&e.options.length>0&&t.push({const:d,title:typeof e.other==`object`&&e.other.label||f.other}),t},re=e=>{let t={type:`string`};return typeof e.other==`object`&&e.other.label&&(t.title=e.other.label),t},ie=e=>{let t=[],n=[];for(let r of e){if(r.options.length===0){let e={type:`string`};r.title&&(e.title=r.title),r.description&&(e.description=r.description),typeof r.default==`string`&&(e.default=r.default),t.push([r.id,e]),r.required&&n.push(r.id);continue}let e=ne(r);if(r.type===`single`){let n={type:`string`,oneOf:e};r.title&&(n.title=r.title),r.description&&(n.description=r.description),typeof r.default==`string`&&r.options.some(e=>e.value===r.default)&&(n.default=r.default),t.push([r.id,n])}else{let n={type:`array`,items:{anyOf:e}};r.title&&(n.title=r.title),r.description&&(n.description=r.description);let i=r.minSelected??(r.required?1:void 0);if(i!==void 0&&(n.minItems=i),r.maxSelected!==void 0&&(n.maxItems=r.maxSelected),Array.isArray(r.default)){let t=new Set(e.map(e=>e.const)),i=r.default.filter(e=>t.has(e));i.length>0&&(n.default=i)}t.push([r.id,n])}r.required&&n.push(r.id),m(r)&&t.push([p(r.id),re(r)])}let r=Object.fromEntries(t);return n.length>0?{type:`object`,properties:r,required:n}:{type:`object`,properties:r}},ae=(e,t)=>String(t[p(e.id)]??``).trim(),F=(e,t)=>{let n=[];for(let r of e){let e=ae(r,t);if(r.options.length===0){e&&n.push([r.id,e]);continue}let i=x(r,t);r.type===`single`?i[0]&&n.push([r.id,i[0]]):i.length>0&&n.push([r.id,[...i]]),m(r)&&S(r,t)&&e&&n.push([p(r.id),e])}return Object.fromEntries(n)},I=e=>!!e&&typeof e==`object`&&!Array.isArray(e),L=e=>I(e)?e:{},R=e=>{let t=e.oneOf??e.items?.anyOf;if(Array.isArray(t)){let e=[],n=new Set;for(let r of t)I(r)&&typeof r.const==`string`&&r.const&&!n.has(r.const)&&(n.add(r.const),e.push({value:r.const,label:typeof r.title==`string`&&r.title?r.title:r.const}));return{declared:!0,options:e}}let n=e.enum??e.items?.enum;if(Array.isArray(n)){let t=e.enumNames??e.items?.enumNames,r=new Set,i=[];for(let[e,a]of n.entries()){if(typeof a!=`string`||!a||r.has(a))continue;r.add(a);let n=t?.[e];i.push({value:a,label:typeof n==`string`&&n?n:a})}return{declared:!0,options:i}}return{declared:!1,options:[]}},z=e=>p(e),B=e=>e.format!==void 0||e.minLength!==void 0||e.maxLength!==void 0||e.pattern!==void 0,V=e=>e.type===`string`&&!R(e).declared&&!B(e),H=e=>{if(e.type!==`object`||!e.properties)return[];let t=e.properties,n=new Set(e.required??[]),r=new Set;for(let e of Object.keys(t)){let n=z(e),i=R(L(t[e])),a=L(t[n]);n in t&&V(a)&&i.options.some(e=>e.value===`__other__`)&&r.add(n)}let i=[];for(let[e,a]of Object.entries(t)){if(r.has(e))continue;let o=L(a),s=R(o),c=s.options.some(e=>e.value===d),l=z(e);if(c&&!r.has(l))continue;let u=s.options.filter(e=>e.value!==d);if(o.type===`number`||o.type===`integer`||o.type===`boolean`||o.type!==`string`&&o.type!==`array`||s.declared&&s.options.length===0||o.type===`array`&&!s.declared||o.type===`string`&&!s.declared&&B(o))continue;let f={id:e,type:o.type===`array`?`multiple`:`single`,title:o.title||e,options:u};if(o.description&&(f.description=o.description),n.has(e)&&(f.required=!0),o.type===`array`?(o.minItems!==void 0&&(f.minSelected=o.minItems),o.maxItems!==void 0&&(f.maxSelected=o.maxItems),Array.isArray(o.default)&&o.default.length>0&&(f.default=o.default)):typeof o.default==`string`&&(f.default=o.default),c&&l in t){let e=L(t[l]);f.other=!e.title||{label:e.title}}i.push(f)}return i};function U(e){switch(e){case`s`:return`xs`;case`m`:return`s`;case`l`:return`m`;default:return`l`}}function W(e){switch(e){case`m`:return`xs`;case`l`:return`s`;case`xl`:case`xxl`:return`m`;default:return`xxs`}}function G(e){return e.step>=e.questions.length-1}function K(e,t){return e.disabled?!0:e.readonly?G(e):e.questionInvalid(t)}function q(e,t){let n=e.selectedValues(t);return n.length===0?``:P(n.map(n=>{if(n===`__other__`)return String(e.value[p(t.id)]??e.copy.other);let r=t.options.find(e=>e.value===n);return r?te(r,e.copy):n}),e.language)}function oe(e,t){let n=q(e,t),r=e.copy.answer.split(`{answer}`).map((e,t)=>i.html`${t>0?i.html`<span class="summary-answer">${n}</span>`:i.nothing}${e}`);return i.html`<span class="summary-value">${r}</span>`}function se(e){let t=e.copy,n=e.questions.reduce((t,n)=>t+e.selectedValues(n).length,0);return i.html`
18
+ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./sized-mixin-BqV6ywDw.cjs"),n=require("./roving-tabindex-BUFR8hPH.cjs");require("./icon-BlbMP3mJ.cjs");const r=require("./language-resolution-B7D3hQ6_.cjs");require("./action-button-Cz4jSv__.cjs"),require("./badge-CPpKOWh2.cjs"),require("./button-CjgL13CD.cjs"),require("./checkbox-CFQqGnDX.cjs"),require("./field-group/index.cjs"),require("./text-field-8IQu5JLQ.cjs"),require("./radio-DJmITM2m.cjs");let i=require("lit"),a=require("lit/decorators.js"),o=require("@luzmo/icons"),s=require("lit/directives/if-defined.js"),c=require("lit/directives/repeat.js"),l=require("lit/directives/keyed.js");var u=`:host{font-family:var(--question-box-font-family);font-size:var(--question-box-font-size);color:var(--highcontrast-question-box-color,var(--question-box-color));box-sizing:border-box;inline-size:100%;max-inline-size:var(--luzmo-question-box-max-inline-size,var(--question-box-max-inline-size));display:block}:host([disabled]){pointer-events:none}.card{gap:var(--question-box-gap);padding:var(--question-box-padding);box-sizing:border-box;border-width:var(--question-box-border-width);border-style:solid;border-color:var(--highcontrast-question-box-border-color,var(--question-box-border-color));border-radius:var(--question-box-border-radius);background-color:var(--highcontrast-question-box-background-color,var(--question-box-background-color));flex-direction:column;display:flex}.header{justify-content:space-between;align-items:flex-start;gap:var(--question-box-header-gap);display:flex}.header-actions,.step-navigation{align-items:center;display:flex}.header-actions{gap:var(--question-box-header-actions-gap);min-block-size:0;block-size:max(var(--question-box-title-font-size) * var(--question-box-title-line-height), var(--question-box-header-control-size) - 2 * (var(--question-box-padding) - var(--question-box-header-actions-inset)));flex-shrink:0;margin-inline-start:auto;overflow:visible}.step-navigation{gap:var(--question-box-copy-gap)}.heading{gap:var(--question-box-heading-copy-gap);flex-direction:column;min-inline-size:0;display:flex}.progress{font-size:var(--question-box-progress-font-size);color:var(--question-box-muted-color);margin:0}.title{font-size:var(--question-box-title-font-size);font-weight:var(--luzmo-font-weight-bold);line-height:var(--question-box-title-line-height);margin:0}.title:focus,.summary-heading:focus{outline:none}.title:focus-visible,.summary-heading:focus-visible{-webkit-text-decoration-color:var(--question-box-focus-ring-color);text-decoration-color:var(--question-box-focus-ring-color);text-decoration-line:underline;text-decoration-thickness:var(--question-box-focus-ring-width);text-underline-offset:var(--question-box-focus-ring-gap);outline:none}.description{color:var(--question-box-muted-color);font-size:inherit;margin:0;margin-block-start:var(--question-box-heading-copy-offset);line-height:1.4}.close{flex-shrink:0}.body{gap:var(--question-box-option-gap);max-block-size:var(--luzmo-question-box-body-max-block-size,var(--question-box-body-max-block-size));padding-block:var(--question-box-body-focus-inset);margin-block:calc(var(--question-box-body-focus-inset) * -1);flex-direction:column;display:flex;overflow:hidden auto}.body::-webkit-scrollbar{width:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width));height:var(--luzmo-question-box-scrollbar-width,var(--question-box-scrollbar-width))}.body::-webkit-scrollbar-track{background:var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background));border-radius:var(--luzmo-question-box-scrollbar-track-border-radius,var(--question-box-scrollbar-track-border-radius))}.body::-webkit-scrollbar-thumb{background:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background));border-radius:var(--luzmo-question-box-scrollbar-thumb-border-radius,var(--question-box-scrollbar-thumb-border-radius))}.body::-webkit-scrollbar-thumb:hover{background:var(--luzmo-question-box-scrollbar-thumb-hover-background,var(--question-box-scrollbar-thumb-hover-background))}.body{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-question-box-scrollbar-thumb-background,var(--question-box-scrollbar-thumb-background)) var(--luzmo-question-box-scrollbar-track-background,var(--question-box-scrollbar-track-background))}.options{box-sizing:border-box;flex-direction:column;inline-size:100%;min-inline-size:0;display:flex}.options--descriptive luzmo-radio,.options--descriptive luzmo-checkbox,.options--descriptive .other-option-answer{padding-block:var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block))}.body:has(.options--descriptive){margin-block:calc(var(--question-box-option-padding-block) - var(--question-box-body-focus-inset) - var(--luzmo-question-box-descriptive-option-padding-block,var(--question-box-descriptive-option-padding-block)))}luzmo-radio,luzmo-checkbox{box-sizing:border-box;inline-size:100%;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));border-radius:var(--luzmo-border-radius-s);align-items:center;display:flex}luzmo-radio:hover,luzmo-checkbox:hover{background-color:var(--question-box-option-hover-background)}.other-option-row{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;border-block-end-width:var(--luzmo-question-box-divider-width,var(--question-box-divider-width));border-block-end-style:solid;border-block-end-color:var(--luzmo-question-box-divider-color,var(--question-box-divider-color));inline-size:100%;max-inline-size:100%;display:flex}.other-option-answer{align-items:center;gap:var(--question-box-option-gap);box-sizing:border-box;min-inline-size:0;min-block-size:var(--question-box-option-min-block-size);padding-block:var(--question-box-option-padding-block);padding-inline:var(--question-box-option-padding-inline);border-radius:var(--luzmo-border-radius-s);flex:1;display:flex}.other-option-answer:hover{background-color:var(--question-box-option-hover-background)}luzmo-radio.other-option,luzmo-checkbox.other-option{border:0;flex:none;min-block-size:auto;inline-size:auto;padding:0}luzmo-radio.other-option{--luzmo-radio-button-top-to-control:0px}luzmo-radio.numbered-option{--luzmo-radio-button-control-size:0px;--luzmo-radio-button-top-to-control:0px;--luzmo-radio-text-to-control:0px;--luzmo-radio-border-width:0px;--luzmo-radio-focus-indicator-width:0px}luzmo-checkbox.numbered-option{--luzmo-checkbox-control-size:0px;--luzmo-checkbox-text-to-control:0px;--luzmo-checkbox-top-to-text:0px;--luzmo-checkbox-border-width:0px;--luzmo-checkbox-selected-border-width:0px;--luzmo-checkbox-focus-indicator-width:0px}luzmo-radio.numbered-option::part(control),luzmo-checkbox.numbered-option::part(control){display:none}luzmo-radio.other-option:hover,luzmo-checkbox.other-option:hover{background-color:#0000}.other-field{inline-size:auto;min-inline-size:0;max-inline-size:100%;min-block-size:var(--question-box-other-field-min-block-size);font-size:var(--question-box-other-field-font-size);--luzmo-text-field-width:100%;--luzmo-text-field-height:var(--question-box-other-field-min-block-size);--luzmo-text-field-background-color:transparent;--luzmo-text-field-background-color-disabled:transparent;--luzmo-text-field-placeholder-font-size:var(--question-box-other-field-font-size);--luzmo-text-field-border-width:0px;--luzmo-text-field-spacing-inline:0px;--luzmo-text-field-spacing-block-start:0px;--luzmo-text-field-spacing-block-end:0px;flex:1;justify-content:center}.other-primary{flex:none}.other-actions{box-sizing:border-box;justify-content:flex-end;align-items:center;gap:var(--question-box-copy-gap-detailed);inline-size:100%;padding-inline:var(--question-box-option-padding-inline);margin-block-start:var(--question-box-copy-gap-detailed);display:flex}.selected-count{font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.other-actions .selected-count{min-inline-size:0;margin-inline-end:auto}.other-actions luzmo-button{flex:none}.status-error{--luzmo-helptext-font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size));--luzmo-helptext-min-height:0;--luzmo-helptext-top-to-text:0;--luzmo-helptext-bottom-to-text:0}.visually-hidden{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.option-content{align-items:flex-start;gap:var(--question-box-option-gap);inline-size:100%;display:flex}.option-number{forced-color-adjust:none;inline-size:var(--question-box-option-number-size);block-size:var(--question-box-option-number-size);box-sizing:border-box;border:var(--luzmo-border-width) solid var(--highcontrast-question-box-option-number-border-color,var(--question-box-option-number-border-color));border-radius:var(--luzmo-border-radius);color:var(--highcontrast-question-box-option-number-color,var(--question-box-option-number-color));background-color:var(--highcontrast-question-box-option-number-background,var(--question-box-option-number-background));transition:color var(--luzmo-animation-duration) ease-in-out, border-color var(--luzmo-animation-duration) ease-in-out, background-color var(--luzmo-animation-duration) ease-in-out;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}luzmo-radio[checked] .option-number,luzmo-checkbox[checked] .option-number{color:var(--highcontrast-question-box-option-number-selected-color,var(--question-box-option-number-selected-color));border-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background));background-color:var(--highcontrast-question-box-option-number-selected-background,var(--question-box-option-number-selected-background))}luzmo-radio[data-focus-visible] .option-number,luzmo-checkbox[data-focus-visible] .option-number,.option-number--focused{outline:var(--luzmo-question-box-focus-ring-width,var(--question-box-focus-ring-width)) solid var(--highcontrast-question-box-focus-ring-color,var(--luzmo-question-box-focus-ring-color,var(--question-box-focus-ring-color)));outline-offset:var(--luzmo-question-box-focus-ring-gap,var(--question-box-focus-ring-gap))}luzmo-radio[disabled] .option-number,luzmo-checkbox[disabled] .option-number{opacity:.5}.option-copy{gap:var(--question-box-copy-gap);flex-direction:column;flex:1;min-inline-size:0;display:flex}.option-edit luzmo-icon{color:inherit}.option-heading{align-items:center;gap:var(--question-box-recommended-gap);min-block-size:var(--question-box-option-number-size);flex-wrap:wrap;display:flex}.option-text{align-items:baseline;gap:var(--question-box-recommended-gap);flex-wrap:wrap;min-inline-size:0;display:flex}.option-description{color:var(--question-box-muted-color);line-height:1.4}.option-hint{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.footer{justify-content:space-between;align-items:center;gap:var(--question-box-option-gap);flex-wrap:wrap;display:flex}.status{color:var(--question-box-muted-color);font-size:var(--luzmo-question-box-selected-count-font-size,var(--question-box-selected-count-font-size))}.actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;margin-inline-start:auto;display:flex}:host([dir=rtl]) .step-navigation luzmo-icon{transform:scaleX(-1)}.resolved{gap:var(--question-box-summary-gap)}.summary-actions{justify-content:flex-end;gap:var(--question-box-recommended-gap);flex-wrap:wrap;display:flex}.summary{gap:var(--question-box-option-gap);flex-direction:column;display:flex}.summary-heading{font-size:var(--question-box-title-font-size);line-height:var(--question-box-title-line-height);margin:0}.summary-row{gap:var(--question-box-copy-gap);flex-direction:column;display:flex}.summary-title{color:var(--question-box-muted-color);font-size:var(--luzmo-font-size-s)}.summary-answer{font-weight:var(--luzmo-font-weight-bold)}@media (prefers-reduced-motion:reduce){.option-number{transition-duration:0s}}@media (forced-colors:active){:host{--highcontrast-question-box-border-color:CanvasText;--highcontrast-question-box-background-color:Canvas;--highcontrast-question-box-color:CanvasText;--highcontrast-question-box-focus-ring-color:Highlight;--highcontrast-question-box-option-number-border-color:ButtonText;--highcontrast-question-box-option-number-color:ButtonText;--highcontrast-question-box-option-number-background:Canvas;--highcontrast-question-box-option-number-selected-background:Highlight;--highcontrast-question-box-option-number-selected-color:HighlightText}}:host{--question-box-font-family:var(--luzmo-font-family);--question-box-font-size:var(--luzmo-font-size-m);--question-box-color:var(--luzmo-font-color);--question-box-muted-color:color-mix(in srgb, var(--luzmo-font-color) 80%, var(--luzmo-background-color));--question-box-background-color:var(--luzmo-background-color);--question-box-border-color:var(--luzmo-border-color);--question-box-border-width:var(--luzmo-border-width);--question-box-border-radius:var(--luzmo-border-radius-l);--question-box-padding:var(--luzmo-spacing-5);--question-box-gap:var(--luzmo-spacing-4);--question-box-header-gap:var(--luzmo-spacing-3);--question-box-header-actions-gap:var(--luzmo-spacing-2);--question-box-header-actions-inset:var(--luzmo-spacing-2);--question-box-header-control-size:var(--luzmo-component-height);--question-box-max-inline-size:40rem;--question-box-body-max-block-size:24rem;--question-box-title-font-size:var(--question-box-font-size);--question-box-title-line-height:1.3;--question-box-progress-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-s);--question-box-option-min-block-size:var(--luzmo-component-height);--question-box-option-hover-background:var(--luzmo-background-color-hover);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-descriptive-option-padding-block:var(--question-box-option-padding-block);--question-box-option-padding-block:var(--luzmo-spacing-1);--question-box-option-padding-inline:var(--luzmo-spacing-3);--question-box-option-gap:var(--luzmo-spacing-3);--question-box-heading-copy-gap:0px;--question-box-heading-copy-offset:calc(var(--question-box-font-size) * -.25);--question-box-copy-gap:var(--luzmo-spacing-1);--question-box-copy-gap-detailed:var(--luzmo-spacing-2);--question-box-recommended-gap:var(--luzmo-spacing-2);--question-box-summary-gap:var(--luzmo-spacing-4);--question-box-body-focus-inset:calc(var(--luzmo-indicator-gap) + var(--luzmo-indicator-width));--question-box-focus-ring-width:var(--luzmo-indicator-width);--question-box-focus-ring-gap:var(--luzmo-indicator-gap);--question-box-focus-ring-color:var(--luzmo-indicator-color);--question-box-divider-width:0px;--question-box-option-number-background:var(--luzmo-background-color);--question-box-option-number-border-color:var(--luzmo-border-color);--question-box-option-number-color:var(--luzmo-font-color);--question-box-option-number-selected-background:var(--luzmo-primary);--question-box-option-number-selected-color:var(--luzmo-primary-inverse-color);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size);--question-box-divider-color:var(--luzmo-border-color);--question-box-scrollbar-width:var(--luzmo-scrollbar-size);--question-box-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--question-box-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--question-box-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--question-box-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--question-box-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background)}:host([size=s]){--question-box-padding:var(--luzmo-spacing-4);--question-box-font-size:var(--luzmo-font-size-s);--question-box-selected-count-font-size:var(--luzmo-font-size-xs);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-s);--question-box-option-min-block-size:var(--luzmo-component-height-s);--question-box-option-number-size:var(--luzmo-component-height-xs);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=l]){--question-box-font-size:var(--luzmo-font-size-l);--question-box-selected-count-font-size:var(--luzmo-font-size-m);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-l);--question-box-option-min-block-size:var(--luzmo-component-height-l);--question-box-option-number-size:var(--luzmo-component-height-s);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}:host([size=xl]){--question-box-font-size:var(--luzmo-font-size-xl);--question-box-selected-count-font-size:var(--luzmo-font-size-l);--question-box-title-font-size:var(--question-box-font-size);--question-box-header-control-size:var(--luzmo-component-height-xl);--question-box-option-min-block-size:var(--luzmo-component-height-xl);--question-box-option-number-size:var(--luzmo-component-height);--question-box-other-field-min-block-size:var(--question-box-option-min-block-size);--question-box-other-field-font-size:var(--question-box-font-size)}`,d=`__other__`,f={continue:`Next`,back:`Back`,submit:`Submit`,skip:`Skip`,change:`Change`,close:`Close`,other:`Something else`,otherPlaceholder:`Something else`,recommended:`Recommended`,answerTitle:`Answer`,answersTitle:`Answers`,progress:`{current} of {total}`,selectedCount:`{count} selected`,selectedCountOne:`{count} selected`,recommendedSuffix:`{label} ({recommended})`,answer:`{answer}`,requiredSelectionDescription:`Choose one or more options.`,selectionRangeDescription:`Choose between {min} and {max} options.`,minSelectedError:`Choose at least {min} options.`,maxSelectedError:`Choose at most {max} options.`,otherRequiredError:`Enter a value for this option.`},p=e=>`${e}Other`,m=e=>!!e.other||e.options.length===0,h=e=>typeof e.other==`object`&&e.other?e.other:{},g=e=>Object.fromEntries(Object.entries(e)),_=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})},v=(e,t)=>{let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n){let n=e[r],i=t[r];if(Array.isArray(n)||Array.isArray(i)){if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length||n.some((e,t)=>e!==i[t]))return!1}else if(n!==i)return!1}return!0},y=e=>{let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n},b=e=>{let t=new Set(e.options.map(e=>e.value));return m(e)&&t.add(d),t},x=(e,t)=>{let n=t[e.id];return e.type===`single`?typeof n==`string`&&n?[n]:[]:Array.isArray(n)?y(n):[]},S=(e,t)=>x(e,t).includes(d),C=e=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0));return{...f,...t}},w=(e,t)=>{let n=e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`{${e}}`,r);return n},T=e=>{let t=new Set;for(let n of e){if(!n.id)throw TypeError(`luzmo-question-box: every question needs an id.`);if(t.has(n.id))throw TypeError(`luzmo-question-box: duplicate question id "${n.id}".`);t.add(n.id);let r=p(n.id);if(e.some(e=>e.id===r))throw TypeError(`luzmo-question-box: question id "${r}" collides with Other text for "${n.id}".`);if(n.type!==`multiple`&&(n.minSelected!==void 0||n.maxSelected!==void 0))throw TypeError(`luzmo-question-box: minSelected and maxSelected only apply to multiple-choice question "${n.id}".`);for(let[e,t]of[[`minSelected`,n.minSelected],[`maxSelected`,n.maxSelected]])if(t!==void 0&&(!Number.isInteger(t)||t<0))throw TypeError(`luzmo-question-box: ${e} must be a non-negative integer on "${n.id}".`);let i=n.minSelected??+!!n.required;if(n.maxSelected!==void 0&&i>n.maxSelected)throw TypeError(`luzmo-question-box: minSelected cannot exceed maxSelected on "${n.id}".`);let a=n.options.filter(e=>!e.disabled).length+ +!!m(n);if(n.type===`multiple`&&i>a)throw TypeError(`luzmo-question-box: minSelected exceeds the available options on "${n.id}".`);let o=new Set;for(let e of n.options){if(!e.value)throw TypeError(`luzmo-question-box: option values cannot be empty on "${n.id}".`);if(e.value===`__other__`)throw TypeError(`luzmo-question-box: "${d}" is reserved on "${n.id}".`);if(o.has(e.value))throw TypeError(`luzmo-question-box: duplicate option value "${e.value}" on "${n.id}".`);o.add(e.value)}}},E=(e,t)=>{let n=Object.fromEntries([]);for(let r of e){let e=b(r),i=t[r.id],a=Object.hasOwn(t,r.id);if(r.type===`single`)typeof i==`string`&&e.has(i)?_(n,r.id,i):!a&&typeof r.default==`string`&&(e.has(r.default)||r.options.length===0)&&_(n,r.id,r.options.length===0?d:r.default);else{let t=[...r.options.map(e=>e.value),...m(r)?[d]:[]],o=y(Array.isArray(i)?i.filter(t=>e.has(t)):[]);if(o.length>0)_(n,r.id,t.filter(e=>o.includes(e)));else if(!a&&Array.isArray(r.default)){let i=y(r.default.filter(t=>e.has(t)));i.length>0&&_(n,r.id,t.filter(e=>i.includes(e)))}}let o=p(r.id),s=t[o];typeof s==`string`?_(n,o,s):!a&&r.options.length===0&&typeof r.default==`string`&&_(n,o,r.default)}return n},D=e=>e.minSelected??+!!e.required,O=(e,t)=>{let n=D(e),r=e.maxSelected;return n>0&&r!==void 0?w(t.selectionRangeDescription,{min:String(n),max:String(r)}):n===1?t.requiredSelectionDescription:n>1?w(t.minSelectedError,{min:String(n)}):r===void 0?void 0:w(t.maxSelectedError,{max:String(r)})},k=(e,t)=>{let n=x(e,t),r=D(e),i=e.maxSelected;if(n.length<r)return r<=1?`missing`:`minimum`;if(i!==void 0&&n.length>i)return`maximum`;if(S(e,t)&&!String(t[p(e.id)]??``).trim())return`otherText`},A=(e,t)=>k(e,t)!==void 0,j=(e,t,n)=>{switch(k(e,t)){case`minimum`:return w(n.minSelectedError,{min:String(D(e))});case`maximum`:return w(n.maxSelectedError,{max:String(e.maxSelected)});case`otherText`:return n.otherRequiredError;default:return}},M=(e,t,n,r,i)=>{if(i||t.disabled)return!0;if(e.type!==`multiple`||n)return!1;let a=e.maxSelected;return a!==void 0&&x(e,r).length>=a},N=(e,t)=>w(e===1?t.selectedCountOne:t.selectedCount,{count:String(e)}),P,ee=(e,t)=>{try{return P?.language!==t&&(P={language:t,formatter:new Intl.ListFormat(t,{style:`narrow`,type:`conjunction`})}),P.formatter.format(e)}catch{return e.join(`, `)}},te=(e,t)=>e.recommended?w(t.recommendedSuffix,{label:e.label,recommended:t.recommended}):e.label,ne=e=>{let t=e.options.map(e=>({const:e.value,title:e.label}));return m(e)&&e.options.length>0&&t.push({const:d,title:typeof e.other==`object`&&e.other.label||f.other}),t},re=e=>{let t={type:`string`};return typeof e.other==`object`&&e.other.label&&(t.title=e.other.label),t},ie=e=>{let t=[],n=[];for(let r of e){if(r.options.length===0){let e={type:`string`};r.title&&(e.title=r.title),r.description&&(e.description=r.description),typeof r.default==`string`&&(e.default=r.default),t.push([r.id,e]),r.required&&n.push(r.id);continue}let e=ne(r);if(r.type===`single`){let n={type:`string`,oneOf:e};r.title&&(n.title=r.title),r.description&&(n.description=r.description),typeof r.default==`string`&&r.options.some(e=>e.value===r.default)&&(n.default=r.default),t.push([r.id,n])}else{let n={type:`array`,items:{anyOf:e}};r.title&&(n.title=r.title),r.description&&(n.description=r.description);let i=r.minSelected??(r.required?1:void 0);if(i!==void 0&&(n.minItems=i),r.maxSelected!==void 0&&(n.maxItems=r.maxSelected),Array.isArray(r.default)){let t=new Set(e.map(e=>e.const)),i=r.default.filter(e=>t.has(e));i.length>0&&(n.default=i)}t.push([r.id,n])}r.required&&n.push(r.id),m(r)&&t.push([p(r.id),re(r)])}let r=Object.fromEntries(t);return n.length>0?{type:`object`,properties:r,required:n}:{type:`object`,properties:r}},ae=(e,t)=>String(t[p(e.id)]??``).trim(),F=(e,t)=>{let n=[];for(let r of e){let e=ae(r,t);if(r.options.length===0){e&&n.push([r.id,e]);continue}let i=x(r,t);r.type===`single`?i[0]&&n.push([r.id,i[0]]):i.length>0&&n.push([r.id,[...i]]),m(r)&&S(r,t)&&e&&n.push([p(r.id),e])}return Object.fromEntries(n)},I=e=>!!e&&typeof e==`object`&&!Array.isArray(e),L=e=>I(e)?e:{},R=e=>{let t=e.oneOf??e.items?.anyOf;if(Array.isArray(t)){let e=[],n=new Set;for(let r of t)I(r)&&typeof r.const==`string`&&r.const&&!n.has(r.const)&&(n.add(r.const),e.push({value:r.const,label:typeof r.title==`string`&&r.title?r.title:r.const}));return{declared:!0,options:e}}let n=e.enum??e.items?.enum;if(Array.isArray(n)){let t=e.enumNames??e.items?.enumNames,r=new Set,i=[];for(let[e,a]of n.entries()){if(typeof a!=`string`||!a||r.has(a))continue;r.add(a);let n=t?.[e];i.push({value:a,label:typeof n==`string`&&n?n:a})}return{declared:!0,options:i}}return{declared:!1,options:[]}},z=e=>p(e),B=e=>e.format!==void 0||e.minLength!==void 0||e.maxLength!==void 0||e.pattern!==void 0,V=e=>e.type===`string`&&!R(e).declared&&!B(e),H=e=>{if(e.type!==`object`||!e.properties)return[];let t=e.properties,n=new Set(e.required??[]),r=new Set;for(let e of Object.keys(t)){let n=z(e),i=R(L(t[e])),a=L(t[n]);n in t&&V(a)&&i.options.some(e=>e.value===`__other__`)&&r.add(n)}let i=[];for(let[e,a]of Object.entries(t)){if(r.has(e))continue;let o=L(a),s=R(o),c=s.options.some(e=>e.value===d),l=z(e);if(c&&!r.has(l))continue;let u=s.options.filter(e=>e.value!==d);if(o.type===`number`||o.type===`integer`||o.type===`boolean`||o.type!==`string`&&o.type!==`array`||s.declared&&s.options.length===0||o.type===`array`&&!s.declared||o.type===`string`&&!s.declared&&B(o))continue;let f={id:e,type:o.type===`array`?`multiple`:`single`,title:o.title||e,options:u};if(o.description&&(f.description=o.description),n.has(e)&&(f.required=!0),o.type===`array`?(o.minItems!==void 0&&(f.minSelected=o.minItems),o.maxItems!==void 0&&(f.maxSelected=o.maxItems),Array.isArray(o.default)&&o.default.length>0&&(f.default=o.default)):typeof o.default==`string`&&(f.default=o.default),c&&l in t){let e=L(t[l]);f.other=!e.title||{label:e.title}}i.push(f)}return i};function U(e){switch(e){case`m`:return`xs`;case`l`:return`s`;case`xl`:case`xxl`:return`m`;default:return`xxs`}}function W(e){return e.step>=e.questions.length-1}function G(e,t){return e.disabled?!0:e.readonly?W(e):e.questionInvalid(t)}function K(e,t){let n=e.selectedValues(t);return n.length===0?``:ee(n.map(n=>{if(n===`__other__`)return String(e.value[p(t.id)]??e.copy.other);let r=t.options.find(e=>e.value===n);return r?te(r,e.copy):n}),e.language)}function q(e,t){let n=K(e,t),r=e.copy.answer.split(`{answer}`).map((e,t)=>i.html`${t>0?i.html`<span class="summary-answer">${n}</span>`:i.nothing}${e}`);return i.html`<span class="summary-value">${r}</span>`}function oe(e){let t=e.copy,n=e.questions.reduce((t,n)=>t+e.selectedValues(n).length,0);return i.html`
19
19
  <div class="card resolved">
20
20
  <div class="summary">
21
21
  <h2 class="summary-heading" id="resolved-title" tabindex="-1">
@@ -24,7 +24,7 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
24
24
  ${(0,c.repeat)(e.questions,e=>e.id,t=>i.html`
25
25
  <div class="summary-row">
26
26
  <span class="summary-title">${t.title}</span>
27
- ${oe(e,t)}
27
+ ${q(e,t)}
28
28
  </div>
29
29
  `)}
30
30
  </div>
@@ -54,34 +54,34 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
54
54
  `}
55
55
  </div>
56
56
  </div>
57
- `}function J(e,t,n){let r=e.optionIndicator===`letters`&&n<26?String.fromCharCode(65+n):String(n+1);return i.html`
57
+ `}function J(e,n,r){let a=e.optionIndicator===`letters`&&r<26?String.fromCharCode(65+r):String(r+1);return i.html`
58
58
  <span
59
- class=${t.description?`option-content option-content--detailed`:`option-content`}
59
+ class=${n.description?`option-content option-content--detailed`:`option-content`}
60
60
  >
61
- <span class="option-number" aria-hidden="true">${r}</span>
61
+ <span class="option-number" aria-hidden="true">${a}</span>
62
62
  <span class="option-copy">
63
63
  <span class="option-heading">
64
64
  <span class="option-text">
65
- <span class="option-label">${t.label}</span>
66
- ${t.hint?i.html`<span class="option-hint">${t.hint}</span>`:i.nothing}
65
+ <span class="option-label">${n.label}</span>
66
+ ${n.hint?i.html`<span class="option-hint">${n.hint}</span>`:i.nothing}
67
67
  </span>
68
- ${t.recommended?i.html`<luzmo-badge
68
+ ${n.recommended?i.html`<luzmo-badge
69
69
  class="recommended-label"
70
70
  dir=${e.dir}
71
71
  variant="neutral"
72
72
  treatment="subtle"
73
- size=${U(e.size)}
73
+ size=${t.r(e.size)}
74
74
  >${e.copy.recommended}</luzmo-badge
75
75
  >`:i.nothing}
76
76
  </span>
77
- ${t.description?i.html`<span class="option-description"
78
- >${t.description}</span
77
+ ${n.description?i.html`<span class="option-description"
78
+ >${n.description}</span
79
79
  >`:i.nothing}
80
80
  </span>
81
81
  </span>
82
82
  `}function Y(e,t){return e.disabledReason?i.html`<span class="visually-hidden" id="option-reason-${t}"
83
83
  >${e.disabledReason}</span
84
- >`:i.nothing}function ce(e,t){return t?i.html`
84
+ >`:i.nothing}function se(e,t){return t?i.html`
85
85
  <luzmo-help-text
86
86
  id="question-error"
87
87
  dir=${e.dir}
@@ -96,17 +96,17 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
96
96
  dir=${e.dir}
97
97
  variant="negative"
98
98
  >${n}</luzmo-help-text
99
- >`:M(e.selectedValues(t).length,e.copy)}</span
99
+ >`:N(e.selectedValues(t).length,e.copy)}</span
100
100
  >
101
- `}function le(e,t){return i.html`
101
+ `}function ce(e,n){return i.html`
102
102
  <div class="other-actions">
103
- ${X(e,t)}
103
+ ${X(e,n)}
104
104
  ${e.hideSkip?i.nothing:i.html`
105
105
  <luzmo-button
106
106
  id="other-skip-button"
107
107
  dir=${e.dir}
108
108
  variant="primary"
109
- size=${U(e.size)}
109
+ size=${t.r(e.size)}
110
110
  quiet
111
111
  ?disabled=${e.disabled||e.readonly}
112
112
  @click=${e.handlers.skip}
@@ -119,13 +119,13 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
119
119
  class="other-primary"
120
120
  variant="primary"
121
121
  treatment="outline"
122
- size=${U(e.size)}
123
- ?disabled=${K(e,t)}
122
+ size=${t.r(e.size)}
123
+ ?disabled=${G(e,n)}
124
124
  @click=${e.handlers.primary}
125
- >${G(e)?e.copy.submit:e.copy.continue}</luzmo-button
125
+ >${W(e)?e.copy.submit:e.copy.continue}</luzmo-button
126
126
  >
127
127
  </div>
128
- `}function ue(e,t){return e.isOtherSelected(t)&&String(e.value[p(t.id)]??``).trim().length>0}function Z(e,t){let n=h(t),r=p(t.id),a=e.isOtherSelected(t),o=e.optionDisabled(t,{value:d,label:n.label||e.copy.other},a),s=e.showError&&a&&!!e.questionError(t);return i.html`
128
+ `}function le(e,t){return e.isOtherSelected(t)&&String(e.value[p(t.id)]??``).trim().length>0}function Z(e,t){let n=h(t),r=p(t.id),a=e.isOtherSelected(t),o=e.optionDisabled(t,{value:d,label:n.label||e.copy.other},a),s=e.showError&&a&&!!e.questionError(t);return i.html`
129
129
  <luzmo-text-field
130
130
  id="other-field"
131
131
  dir=${e.dir}
@@ -145,19 +145,19 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
145
145
  @input=${e.handlers.otherInput}
146
146
  @change=${e.handlers.otherChange}
147
147
  ></luzmo-text-field>
148
- `}function Q(e,t){let n=ue(e,t);return t.type===`multiple`||e.hideSkip&&!n?i.nothing:i.html`
148
+ `}function ue(e,n){let r=le(e,n);return n.type===`multiple`||e.hideSkip&&!r?i.nothing:i.html`
149
149
  <luzmo-button
150
150
  id="other-row-action"
151
151
  dir=${e.dir}
152
152
  class="other-primary"
153
153
  variant="primary"
154
154
  treatment="outline"
155
- size=${U(e.size)}
156
- ?disabled=${n?K(e,t):e.disabled||e.readonly}
157
- @click=${n?e.handlers.primary:e.handlers.skip}
158
- >${n?G(e)?e.copy.submit:e.copy.continue:e.copy.skip}</luzmo-button
155
+ size=${t.r(e.size)}
156
+ ?disabled=${r?G(e,n):e.disabled||e.readonly}
157
+ @click=${r?e.handlers.primary:e.handlers.skip}
158
+ >${r?W(e)?e.copy.submit:e.copy.continue:e.copy.skip}</luzmo-button
159
159
  >
160
- `}function de(e,t,n){let r=e.selectedValues(t)[0]??``,a=t.options.some(e=>e.description)?`options options--descriptive`:`options`;return i.html`
160
+ `}function Q(e,t,n){let r=e.selectedValues(t)[0]??``,a=t.options.some(e=>e.description)?`options options--descriptive`:`options`;return i.html`
161
161
  <luzmo-radio-group
162
162
  id="options"
163
163
  dir=${e.dir}
@@ -210,19 +210,19 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
210
210
  <luzmo-icon
211
211
  block
212
212
  dir=${e.dir}
213
- .size=${W(e.size)}
213
+ .size=${U(e.size)}
214
214
  .icon=${o.luzmoPencil}
215
215
  ></luzmo-icon>
216
216
  </span>
217
217
  </luzmo-radio>
218
218
  ${Z(e,t)}
219
219
  </div>
220
- ${Q(e,t)}
220
+ ${ue(e,t)}
221
221
  </div>
222
222
  `:i.nothing}
223
- ${ce(e,n)}
223
+ ${se(e,n)}
224
224
  </luzmo-radio-group>
225
- `}function fe(e,t,n){let r=new Set(e.selectedValues(t)),a=e.isOtherSelected(t),l=t.options.some(e=>e.description)?`options options--descriptive`:`options`,u=D(t,e.copy);return i.html`
225
+ `}function de(e,t,n){let r=new Set(e.selectedValues(t)),a=e.isOtherSelected(t),l=t.options.some(e=>e.description)?`options options--descriptive`:`options`,u=O(t,e.copy);return i.html`
226
226
  ${u?i.html`<span class="visually-hidden" id="selection-requirement"
227
227
  >${u}</span
228
228
  >`:i.nothing}
@@ -274,7 +274,7 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
274
274
  <luzmo-icon
275
275
  block
276
276
  dir=${e.dir}
277
- .size=${W(e.size)}
277
+ .size=${U(e.size)}
278
278
  .icon=${o.luzmoPencil}
279
279
  ></luzmo-icon>
280
280
  </span>
@@ -285,28 +285,28 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
285
285
  ${Z(e,t)}
286
286
  </div>
287
287
  </div>
288
- ${le(e,t)}
288
+ ${ce(e,t)}
289
289
  `:i.nothing}
290
290
  </luzmo-field-group>
291
- `}function pe(e,t){let n=e.copy,r=w(n.progress,{current:String(e.step+1),total:String(e.questions.length)});return i.html`
291
+ `}function fe(e,n){let r=e.copy,a=w(r.progress,{current:String(e.step+1),total:String(e.questions.length)});return i.html`
292
292
  <header class="header">
293
293
  <div class="heading">
294
294
  <h2 class="title" id="question-title" tabindex="-1">
295
- ${t.title}
295
+ ${n.title}
296
296
  </h2>
297
- ${t.description?i.html`<p class="description" id="question-description">
298
- ${t.description}
297
+ ${n.description?i.html`<p class="description" id="question-description">
298
+ ${n.description}
299
299
  </p>`:i.nothing}
300
300
  </div>
301
301
  <div class="header-actions">
302
302
  ${e.questions.length>1?i.html`
303
- <nav class="step-navigation" aria-label=${r}>
303
+ <nav class="step-navigation" aria-label=${a}>
304
304
  <luzmo-action-button
305
305
  id="back-button"
306
306
  dir=${e.dir}
307
307
  quiet
308
- size=${U(e.size)}
309
- label=${n.back}
308
+ size=${t.r(e.size)}
309
+ label=${r.back}
310
310
  ?disabled=${e.disabled||e.step===0}
311
311
  @click=${e.handlers.back}
312
312
  >
@@ -314,28 +314,28 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
314
314
  <luzmo-icon
315
315
  block
316
316
  dir=${e.dir}
317
- .size=${U(e.size)}
317
+ .size=${t.r(e.size)}
318
318
  .icon=${o.luzmoAngleLeft}
319
319
  ></luzmo-icon>
320
320
  </div>
321
321
  </luzmo-action-button>
322
322
  <p class="progress" id="progress" aria-live="polite">
323
- ${r}
323
+ ${a}
324
324
  </p>
325
325
  <luzmo-action-button
326
326
  id="continue-button"
327
327
  dir=${e.dir}
328
328
  quiet
329
- size=${U(e.size)}
330
- label=${n.continue}
331
- ?disabled=${K(e,t)||G(e)}
329
+ size=${t.r(e.size)}
330
+ label=${r.continue}
331
+ ?disabled=${G(e,n)||W(e)}
332
332
  @click=${e.handlers.primary}
333
333
  >
334
334
  <div slot="icon">
335
335
  <luzmo-icon
336
336
  block
337
337
  dir=${e.dir}
338
- .size=${U(e.size)}
338
+ .size=${t.r(e.size)}
339
339
  .icon=${o.luzmoAngleRight}
340
340
  ></luzmo-icon>
341
341
  </div>
@@ -347,7 +347,7 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
347
347
  id="close-button"
348
348
  dir=${e.dir}
349
349
  class="close"
350
- label=${n.close}
350
+ label=${r.close}
351
351
  size=${e.size}
352
352
  ?disabled=${e.disabled}
353
353
  @click=${e.handlers.cancel}
@@ -355,9 +355,9 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
355
355
  `}
356
356
  </div>
357
357
  </header>
358
- `}function me(e,t){let n=e.copy;return i.html`
358
+ `}function pe(e,n){let r=e.copy;return i.html`
359
359
  <footer class="footer">
360
- <div class="status">${X(e,t)}</div>
360
+ <div class="status">${X(e,n)}</div>
361
361
  <div class="actions">
362
362
  ${e.hideSkip?i.nothing:i.html`
363
363
  <luzmo-button
@@ -365,37 +365,37 @@ require("./tokens.cjs");const e=require("./decorate-SO02l0A6.cjs"),t=require("./
365
365
  dir=${e.dir}
366
366
  variant="primary"
367
367
  treatment="outline"
368
- size=${U(e.size)}
368
+ size=${t.r(e.size)}
369
369
  ?disabled=${e.disabled||e.readonly}
370
370
  @click=${e.handlers.skip}
371
- >${n.skip}</luzmo-button
371
+ >${r.skip}</luzmo-button
372
372
  >
373
373
  `}
374
- ${G(e)&&t.type===`multiple`?i.html`
374
+ ${W(e)&&n.type===`multiple`?i.html`
375
375
  <luzmo-button
376
376
  id="submit-button"
377
377
  dir=${e.dir}
378
378
  variant="primary"
379
379
  treatment="outline"
380
- size=${U(e.size)}
381
- ?disabled=${K(e,t)}
380
+ size=${t.r(e.size)}
381
+ ?disabled=${G(e,n)}
382
382
  @click=${e.handlers.primary}
383
- >${n.submit}</luzmo-button
383
+ >${r.submit}</luzmo-button
384
384
  >
385
385
  `:i.nothing}
386
386
  </div>
387
387
  </footer>
388
- `}function he(e){if(e.questions.length===0)return i.nothing;if(e.resolved)return se(e);let t=e.questions[e.step];if(!t)return i.nothing;let n=e.showError?e.questionError(t):void 0,r=!m(t)&&(t.type===`multiple`||!e.hideSkip),a=[e.questions.length>1?`progress`:``,t.description?`question-description`:``,n?`question-error`:``].filter(Boolean).join(` `)||void 0;return i.html`
388
+ `}function me(e){if(e.questions.length===0)return i.nothing;if(e.resolved)return oe(e);let t=e.questions[e.step];if(!t)return i.nothing;let n=e.showError?e.questionError(t):void 0,r=!m(t)&&(t.type===`multiple`||!e.hideSkip),a=[e.questions.length>1?`progress`:``,t.description?`question-description`:``,n?`question-error`:``].filter(Boolean).join(` `)||void 0;return i.html`
389
389
  <div class="card" @click=${e.handlers.contentClick}>
390
- ${pe(e,t)}
390
+ ${fe(e,t)}
391
391
  <div
392
392
  class="body"
393
393
  role="group"
394
394
  aria-labelledby="question-title"
395
395
  aria-describedby=${(0,s.ifDefined)(a)}
396
396
  >
397
- ${(0,l.keyed)(t.id,t.type===`single`?de(e,t,n):fe(e,t,n))}
397
+ ${(0,l.keyed)(t.id,t.type===`single`?Q(e,t,n):de(e,t,n))}
398
398
  </div>
399
- ${r?me(e,t):i.nothing}
399
+ ${r?pe(e,t):i.nothing}
400
400
  </div>
401
- `}var $=class extends t.n(e.n,{validSizes:[`s`,`m`,`l`,`xl`]}){constructor(...e){super(...e),this.questions=[],this.value={},this.labels={},this.dir=`ltr`,this.disabled=!1,this.readonly=!1,this.hideClose=!1,this.hideSkip=!1,this.showChange=!1,this._optionIndicator=`numbers`,this._step=0,this._resolved=!1,this._submitted=!1,this._showError=!1,this.languageResolver=new r.t(this),this._radioChangeAdvanced=!1,this.multipleChoiceRoving=new n.t(this,{direction:`vertical`,elements:()=>[...this.shadowRoot?.querySelectorAll(`luzmo-field-group#options luzmo-checkbox[data-option-index]`)??[]],focusInIndex:e=>{let t=e.findIndex(e=>e.checked&&!e.disabled);return t===-1?e.findIndex(e=>!e.disabled):t},isFocusableElement:e=>!e.disabled,listenerScope:()=>this.shadowRoot?.querySelector(`luzmo-field-group#options`)}),this.handleKeydown=e=>{if(this.disabled)return;let t=e.composedPath(),n=this.shadowRoot?.activeElement;if(e.key!==`Escape`&&this.otherField&&(t.includes(this.otherField)||n===this.otherField))return;let r=this.focusedOptionForEvent(e),i=this.currentQuestion;if(i?.type===`multiple`&&r&&this.multipleChoiceRoving.acceptsEventCode(e.code)&&!e.defaultPrevented){let t=this.multipleChoiceRoving.elements.indexOf(r);t!==-1&&(this.multipleChoiceRoving.currentIndex=t),this.multipleChoiceRoving.hostContainsFocus(),this.multipleChoiceRoving.handleKeydown(e);return}if(!this.readonly&&e.code===`Space`&&r&&!r.hasAttribute(`disabled`)){e.preventDefault();return}let a=this.optionIndicator===`letters`&&/^[a-z]$/i.test(e.key)?e.key.toUpperCase().charCodeAt(0)-65:this.optionIndicator===`numbers`&&/^[1-9]$/.test(e.key)?Number(e.key)-1:-1,o=!this.readonly&&r&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&a>=0?this.shadowRoot?.querySelector(`[data-option-index="${a}"]:not([disabled])`):void 0;if(o){e.preventDefault();let t=o.getAttribute(`value`)??o.dataset.value;if(i?.type===`single`&&t!==`__other__`&&this.selectedValues(i)[0]===t){this.advanceAfterSingleSelection();return}o.click()}else e.key===`Escape`&&(e.preventDefault(),!this.disabled&&this.cancel())},this.handleKeyup=e=>{if(this.disabled||this.readonly||e.code!==`Space`)return;let t=this.focusedOptionForEvent(e);t&&!t.hasAttribute(`disabled`)&&(e.preventDefault(),t.click())},this.handleFocusIn=e=>{let t=this.focusedOptionForEvent(e);this.markKeyboardFocus(t&&this.optionShowsKeyboardFocus(t)?t:void 0)},this.handleContentClick=e=>{this.disabled||e.composedPath().some(e=>e instanceof Element&&e.matches(`a[href], button, input, select, textarea, [contenteditable="true"], [data-option-index], #other-field, luzmo-action-button, luzmo-button, luzmo-close-button`))||this.focusOptions()},this.handleFocusOut=()=>{requestAnimationFrame(()=>{let e=this.shadowRoot?.activeElement;e instanceof HTMLElement&&e.dataset.optionIndex!==void 0||this.markKeyboardFocus()})},this.handleCancelClick=e=>{e.preventDefault(),this.cancel()},this.handleSkip=e=>{e.preventDefault(),!(this.disabled||this.readonly)&&this.emitResult(`decline`)},this.handleBack=e=>{e.preventDefault(),!(this.disabled||this._step===0)&&(this._showError=!1,--this._step,this.updateComplete.then(()=>this.moveFocus(this.questionTitle)))},this.handlePrimary=()=>{let e=this.currentQuestion;e&&!this.disabled&&(!this.readonly&&this.questionInvalid(e)?(this._showError=!0,this.focusOptions()):(this._showError=!1,this._step<this.questions.length-1?(this._step+=1,this.updateComplete.then(()=>this.moveFocus(this.questionTitle))):this.readonly||this.acceptFlow()))},this.handleChange=()=>{this._resolved=!1,this._submitted=!1,this._showError=!1,this.updateComplete.then(()=>this.focusOptions())},this.handleRadioChange=e=>{if(e.stopPropagation(),this.disabled||this.readonly)return;let t=this.currentQuestion;if(!t)return;let n=e.target.value||e.currentTarget.selected;n&&(n===`__other__`&&!String(this.value[p(t.id)]??``).trim()?(this.requestUpdate(),this.updateComplete.then(()=>this.moveFocus(this.otherField))):(this.commitAnswer(t.id,n,!0),n!==`__other__`&&(this._radioChangeAdvanced=!0,this.advanceAfterSingleSelection(),queueMicrotask(()=>{this._radioChangeAdvanced=!1}))))},this.handleRadioClick=e=>{if(this._radioChangeAdvanced||this.disabled||this.readonly)return;let t=this.currentQuestion,n=e.currentTarget;t?.type===`single`&&n.value!==`__other__`&&this.selectedValues(t)[0]===n.value&&this.advanceAfterSingleSelection()},this.handleCheckboxChange=e=>{if(e.stopPropagation(),this.disabled||this.readonly)return;let t=this.currentQuestion;if(!t)return;let n=e.currentTarget,r=n.dataset.value;if(!r)return;let i=new Set(this.selectedValues(t));if(r===`__other__`&&n.checked&&!String(this.value[p(t.id)]??``).trim()){n.checked=!1,this.moveFocus(this.otherField);return}n.checked?i.add(r):i.delete(r);let a=[...t.options.map(e=>e.value),...m(t)?[d]:[]].filter(e=>i.has(e));this.commitAnswer(t.id,y(a),!0),r===`__other__`&&n.checked&&this.updateComplete.then(()=>this.moveFocus(this.otherField))},this.handleOtherInput=e=>{if(e.stopPropagation(),this.disabled||this.readonly)return;let t=this.currentQuestion;if(!t)return;let n=e.currentTarget;this.commitOther(t,n.value,!1)},this.handleOtherChange=e=>{if(e.stopPropagation(),this.disabled||this.readonly)return;let t=this.currentQuestion;if(!t)return;let n=e.currentTarget;this.commitOther(t,n.value,!0)},this.handleOtherKeydown=e=>{if(e.key!==`Enter`||e.shiftKey||e.isComposing||this.disabled||this.readonly)return;e.preventDefault();let t=this.currentQuestion;t&&String(this.value[p(t.id)]??``).trim()&&this.handlePrimary()}}static get styles(){let e=super.styles;return[...Array.isArray(e)?e:e?[e]:[],(0,i.unsafeCSS)(u)]}get optionIndicator(){return this._optionIndicator}set optionIndicator(e){let t=this._optionIndicator;this._optionIndicator=e===`letters`?`letters`:`numbers`,this.requestUpdate(`optionIndicator`,t)}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this.handleKeydown),this.addEventListener(`keyup`,this.handleKeyup),this.addEventListener(`focusin`,this.handleFocusIn)}attributeChangedCallback(e,t,n){e===`option-indicator`&&n!==null&&n!==`numbers`&&n!==`letters`?this.setAttribute(`option-indicator`,`numbers`):super.attributeChangedCallback(e,t,n)}disconnectedCallback(){this.removeEventListener(`keydown`,this.handleKeydown),this.removeEventListener(`keyup`,this.handleKeyup),this.removeEventListener(`focusin`,this.handleFocusIn),super.disconnectedCallback()}focus(){this._resolved?this.moveFocus(this.resolvedTitle):this.focusOptions()}checkValidity(){return this.questions.every(e=>!this.questionInvalid(e))}submit(){this.disabled||this.readonly||this._submitted||this.acceptFlow()}reset(){this._resolved=!1,this._submitted=!1,this._showError=!1,this._step=0,this.value={}}cancel(){this.emitResult(`cancel`)}willUpdate(e){if(super.willUpdate(e),e.has(`questions`)||e.has(`value`)){if(e.has(`questions`)){T(this.questions);let t=(e.get(`questions`)??[]).map(e=>e.id),n=this.questions.map(e=>e.id);t.join(`\0`)!==n.join(`\0`)&&(this._step=0,this._resolved=!1,this._submitted=!1,this._showError=!1)}let t=ee(this.questions,this.value);v(t,this.value)||(this.value=t)}e.has(`questions`)&&(this._step=Math.min(this._step,Math.max(0,this.questions.length-1)))}updated(e){super.updated(e),(e.has(`questions`)||e.has(`size`)||e.has(`disabled`)||e.has(`readonly`)||e.has(`_step`)||e.has(`_resolved`))&&this.multipleChoiceRoving.clearElementCache()}render(){return he(this.renderContext)}get renderContext(){return{questions:this.questions,value:this.value,copy:this.copy,step:this._step,resolved:this._resolved,submitted:this._submitted,showError:this._showError,disabled:this.disabled,readonly:this.readonly,hideClose:this.hideClose,hideSkip:this.hideSkip,showChange:this.showChange,optionIndicator:this.optionIndicator,size:this.size,dir:this.dir,language:this.languageResolver.language,selectedValues:e=>this.selectedValues(e),isOtherSelected:e=>this.isOtherSelected(e),questionError:e=>this.questionError(e),questionInvalid:e=>this.questionInvalid(e),optionDisabled:(e,t,n)=>this.optionDisabled(e,t,n),handlers:this.renderHandlers}}get renderHandlers(){return{contentClick:this.handleContentClick,back:this.handleBack,primary:this.handlePrimary,skip:this.handleSkip,cancel:this.handleCancelClick,change:this.handleChange,radioChange:this.handleRadioChange,radioClick:this.handleRadioClick,checkboxChange:this.handleCheckboxChange,otherInput:this.handleOtherInput,otherChange:this.handleOtherChange,otherKeydown:this.handleOtherKeydown,focusIn:this.handleFocusIn,focusOut:this.handleFocusOut}}get copy(){return C(this.labels)}get currentQuestion(){return this.questions[this._step]}optionShowsKeyboardFocus(e){let t=e=>{if(!e)return!1;try{return e.matches(`:focus-visible`)||e.matches(`.focus-visible`)}catch{return e.matches(`.focus-visible`)}};return t(e)||t(e.shadowRoot?.activeElement)||this.hasVisibleFocusInTree()}markKeyboardFocus(e){this.shadowRoot?.querySelectorAll(`[data-focus-visible]`).forEach(e=>delete e.dataset.focusVisible),this.shadowRoot?.querySelectorAll(`.option-number--focused`).forEach(e=>e.classList.remove(`option-number--focused`)),e&&(e.dataset.focusVisible=``,e.querySelector(`.option-number`)?.classList.add(`option-number--focused`))}focusedOptionForEvent(e){let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.dataset.optionIndex!==void 0);if(t)return t;let n=this.shadowRoot?.activeElement;return n instanceof HTMLElement&&n.dataset.optionIndex!==void 0?n:void 0}moveFocus(e){if(e)try{e.focus()}catch{try{HTMLElement.prototype.focus.call(e)}catch{return}}}focusOptions(){let e=this.optionsGroup;if(!e){this.moveFocus(this.questionTitle);return}let t=this.currentQuestion,n=t?.type===`single`?this.selectedValues(t)[0]:void 0,r=n?e.querySelector(`luzmo-radio[value="${CSS.escape(n)}"]:not([disabled])`):void 0,i=e.querySelector(`[data-option-index]:not([disabled])`);this.moveFocus(r??i??e)}advanceAfterSingleSelection(){this._step<this.questions.length-1?(this._step+=1,this.updateComplete.then(()=>this.moveFocus(this.questionTitle))):(this._resolved=!0,this._submitted=!1,this.updateComplete.then(()=>this.focus()))}acceptFlow(){let e=this.questions.findIndex(e=>this.questionInvalid(e));e===-1?(this._showError=!1,this._resolved=!0,this._submitted=!0,this.emitResult(`accept`,F(this.questions,this.value)),this.updateComplete.then(()=>this.focus())):(this._step=e,this._showError=!0,this.updateComplete.then(()=>this.focusOptions()))}commitAnswer(e,t,n){let r=g(this.value);_(r,e,t),this.assignValue(r,n)}commitOther(e,t,n){let r=g(this.value);_(r,p(e.id),t);let i=t.trim().length>0;if(e.type===`single`)i?_(r,e.id,d):r[e.id]===`__other__`&&_(r,e.id,``);else{let t=new Set(this.selectedValues(e));i?t.add(d):t.delete(d),_(r,e.id,[...e.options.map(e=>e.value),d].filter(e=>t.has(e)))}this.assignValue(r,n)}assignValue(e,t){v(e,this.value)||(this.value=e,this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))),t&&this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))}emitResult(e,t){let n=e===`accept`?{action:e,content:t}:{action:e};e===`accept`?this.dispatchEvent(new CustomEvent(`luzmo-submit`,{detail:n,bubbles:!0,composed:!0})):e===`decline`?this.dispatchEvent(new CustomEvent(`luzmo-decline`,{detail:n,bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent(`luzmo-cancel`,{detail:n,bubbles:!0,composed:!0}))}selectedValues(e){return x(e,this.value)}isOtherSelected(e){return S(e,this.value)}questionError(e){return A(e,this.value,this.copy)}questionInvalid(e){return k(e,this.value)}optionDisabled(e,t,n){return j(e,t,n,this.value,this.disabled)}};e.t([(0,a.property)({attribute:!1})],$.prototype,`questions`,void 0),e.t([(0,a.property)({attribute:!1})],$.prototype,`value`,void 0),e.t([(0,a.property)({attribute:!1})],$.prototype,`labels`,void 0),e.t([(0,a.property)({reflect:!0})],$.prototype,`dir`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0,attribute:`hide-close`})],$.prototype,`hideClose`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0,attribute:`hide-skip`})],$.prototype,`hideSkip`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0,attribute:`show-change`})],$.prototype,`showChange`,void 0),e.t([(0,a.property)({reflect:!0,attribute:`option-indicator`})],$.prototype,`optionIndicator`,null),e.t([(0,a.state)()],$.prototype,`_step`,void 0),e.t([(0,a.state)()],$.prototype,`_resolved`,void 0),e.t([(0,a.state)()],$.prototype,`_submitted`,void 0),e.t([(0,a.state)()],$.prototype,`_showError`,void 0),e.t([(0,a.query)(`#question-title`)],$.prototype,`questionTitle`,void 0),e.t([(0,a.query)(`#other-field`)],$.prototype,`otherField`,void 0),e.t([(0,a.query)(`#options`)],$.prototype,`optionsGroup`,void 0),e.t([(0,a.query)(`#resolved-title`)],$.prototype,`resolvedTitle`,void 0),typeof customElements<`u`&&!customElements.get(`luzmo-question-box`)&&customElements.define(`luzmo-question-box`,$),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
401
+ `}var $=class extends t.n(e.n,{validSizes:[`s`,`m`,`l`,`xl`]}){constructor(...e){super(...e),this.questions=[],this.value={},this.labels={},this.dir=`ltr`,this.disabled=!1,this.readonly=!1,this.hideClose=!1,this.hideSkip=!1,this.showChange=!1,this._optionIndicator=`numbers`,this._step=0,this._resolved=!1,this._submitted=!1,this._showError=!1,this.languageResolver=new r.t(this),this._radioChangeAdvanced=!1,this.multipleChoiceRoving=new n.t(this,{direction:`vertical`,elements:()=>[...this.shadowRoot?.querySelectorAll(`luzmo-field-group#options luzmo-checkbox[data-option-index]`)??[]],focusInIndex:e=>{let t=e.findIndex(e=>e.checked&&!e.disabled);return t===-1?e.findIndex(e=>!e.disabled):t},isFocusableElement:e=>!e.disabled,listenerScope:()=>this.shadowRoot?.querySelector(`luzmo-field-group#options`)}),this.handleKeydown=e=>{if(this.disabled)return;let t=e.composedPath(),n=this.shadowRoot?.activeElement;if(e.key!==`Escape`&&this.otherField&&(t.includes(this.otherField)||n===this.otherField))return;let r=this.focusedOptionForEvent(e),i=this.currentQuestion;if(i?.type===`multiple`&&r&&this.multipleChoiceRoving.acceptsEventCode(e.code)&&!e.defaultPrevented){let t=this.multipleChoiceRoving.elements.indexOf(r);t!==-1&&(this.multipleChoiceRoving.currentIndex=t),this.multipleChoiceRoving.hostContainsFocus(),this.multipleChoiceRoving.handleKeydown(e);return}if(!this.readonly&&e.code===`Space`&&r&&!r.hasAttribute(`disabled`)){e.preventDefault();return}let a=this.optionIndicator===`letters`&&/^[a-z]$/i.test(e.key)?e.key.toUpperCase().charCodeAt(0)-65:this.optionIndicator===`numbers`&&/^[1-9]$/.test(e.key)?Number(e.key)-1:-1,o=!this.readonly&&r&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&a>=0?this.shadowRoot?.querySelector(`[data-option-index="${a}"]:not([disabled])`):void 0;if(o){e.preventDefault();let t=o.getAttribute(`value`)??o.dataset.value;if(i?.type===`single`&&t!==`__other__`&&this.selectedValues(i)[0]===t){this.advanceAfterSingleSelection();return}o.click()}else e.key===`Escape`&&(e.preventDefault(),!this.disabled&&this.cancel())},this.handleKeyup=e=>{if(this.disabled||this.readonly||e.code!==`Space`)return;let t=this.focusedOptionForEvent(e);t&&!t.hasAttribute(`disabled`)&&(e.preventDefault(),t.click())},this.handleFocusIn=e=>{let t=this.focusedOptionForEvent(e);this.markKeyboardFocus(t&&this.optionShowsKeyboardFocus(t)?t:void 0)},this.handleContentClick=e=>{this.disabled||e.composedPath().some(e=>e instanceof Element&&e.matches(`a[href], button, input, select, textarea, [contenteditable="true"], [data-option-index], #other-field, luzmo-action-button, luzmo-button, luzmo-close-button`))||this.focusOptions()},this.handleFocusOut=()=>{requestAnimationFrame(()=>{let e=this.shadowRoot?.activeElement;e instanceof HTMLElement&&e.dataset.optionIndex!==void 0||this.markKeyboardFocus()})},this.handleCancelClick=e=>{e.preventDefault(),this.cancel()},this.handleSkip=e=>{e.preventDefault(),!(this.disabled||this.readonly)&&this.emitResult(`decline`)},this.handleBack=e=>{e.preventDefault(),!(this.disabled||this._step===0)&&(this._showError=!1,--this._step,this.updateComplete.then(()=>this.moveFocus(this.questionTitle)))},this.handlePrimary=()=>{let e=this.currentQuestion;e&&!this.disabled&&(!this.readonly&&this.questionInvalid(e)?(this._showError=!0,this.focusOptions()):(this._showError=!1,this._step<this.questions.length-1?(this._step+=1,this.updateComplete.then(()=>this.moveFocus(this.questionTitle))):this.readonly||this.acceptFlow()))},this.handleChange=()=>{this._resolved=!1,this._submitted=!1,this._showError=!1,this.updateComplete.then(()=>this.focusOptions())},this.handleRadioChange=e=>{if(e.stopPropagation(),this.disabled||this.readonly)return;let t=this.currentQuestion;if(!t)return;let n=e.target.value||e.currentTarget.selected;n&&(n===`__other__`&&!String(this.value[p(t.id)]??``).trim()?(this.requestUpdate(),this.updateComplete.then(()=>this.moveFocus(this.otherField))):(this.commitAnswer(t.id,n,!0),n!==`__other__`&&(this._radioChangeAdvanced=!0,this.advanceAfterSingleSelection(),queueMicrotask(()=>{this._radioChangeAdvanced=!1}))))},this.handleRadioClick=e=>{if(this._radioChangeAdvanced||this.disabled||this.readonly)return;let t=this.currentQuestion,n=e.currentTarget;t?.type===`single`&&n.value!==`__other__`&&this.selectedValues(t)[0]===n.value&&this.advanceAfterSingleSelection()},this.handleCheckboxChange=e=>{if(e.stopPropagation(),this.disabled||this.readonly)return;let t=this.currentQuestion;if(!t)return;let n=e.currentTarget,r=n.dataset.value;if(!r)return;let i=new Set(this.selectedValues(t));if(r===`__other__`&&n.checked&&!String(this.value[p(t.id)]??``).trim()){n.checked=!1,this.moveFocus(this.otherField);return}n.checked?i.add(r):i.delete(r);let a=[...t.options.map(e=>e.value),...m(t)?[d]:[]].filter(e=>i.has(e));this.commitAnswer(t.id,y(a),!0),r===`__other__`&&n.checked&&this.updateComplete.then(()=>this.moveFocus(this.otherField))},this.handleOtherInput=e=>{if(e.stopPropagation(),this.disabled||this.readonly)return;let t=this.currentQuestion;if(!t)return;let n=e.currentTarget;this.commitOther(t,n.value,!1)},this.handleOtherChange=e=>{if(e.stopPropagation(),this.disabled||this.readonly)return;let t=this.currentQuestion;if(!t)return;let n=e.currentTarget;this.commitOther(t,n.value,!0)},this.handleOtherKeydown=e=>{if(e.key!==`Enter`||e.shiftKey||e.isComposing||this.disabled||this.readonly)return;e.preventDefault();let t=this.currentQuestion;t&&String(this.value[p(t.id)]??``).trim()&&this.handlePrimary()}}static get styles(){let e=super.styles;return[...Array.isArray(e)?e:e?[e]:[],(0,i.unsafeCSS)(u)]}get optionIndicator(){return this._optionIndicator}set optionIndicator(e){let t=this._optionIndicator;this._optionIndicator=e===`letters`?`letters`:`numbers`,this.requestUpdate(`optionIndicator`,t)}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this.handleKeydown),this.addEventListener(`keyup`,this.handleKeyup),this.addEventListener(`focusin`,this.handleFocusIn)}attributeChangedCallback(e,t,n){e===`option-indicator`&&n!==null&&n!==`numbers`&&n!==`letters`?this.setAttribute(`option-indicator`,`numbers`):super.attributeChangedCallback(e,t,n)}disconnectedCallback(){this.removeEventListener(`keydown`,this.handleKeydown),this.removeEventListener(`keyup`,this.handleKeyup),this.removeEventListener(`focusin`,this.handleFocusIn),super.disconnectedCallback()}focus(){this._resolved?this.moveFocus(this.resolvedTitle):this.focusOptions()}checkValidity(){return this.questions.every(e=>!this.questionInvalid(e))}submit(){this.disabled||this.readonly||this._submitted||this.acceptFlow()}reset(){this._resolved=!1,this._submitted=!1,this._showError=!1,this._step=0,this.value={}}cancel(){this.emitResult(`cancel`)}willUpdate(e){if(super.willUpdate(e),e.has(`questions`)||e.has(`value`)){if(e.has(`questions`)){T(this.questions);let t=(e.get(`questions`)??[]).map(e=>e.id),n=this.questions.map(e=>e.id);t.join(`\0`)!==n.join(`\0`)&&(this._step=0,this._resolved=!1,this._submitted=!1,this._showError=!1)}let t=E(this.questions,this.value);v(t,this.value)||(this.value=t)}e.has(`questions`)&&(this._step=Math.min(this._step,Math.max(0,this.questions.length-1)))}updated(e){super.updated(e),(e.has(`questions`)||e.has(`size`)||e.has(`disabled`)||e.has(`readonly`)||e.has(`_step`)||e.has(`_resolved`))&&this.multipleChoiceRoving.clearElementCache()}render(){return me(this.renderContext)}get renderContext(){return{questions:this.questions,value:this.value,copy:this.copy,step:this._step,resolved:this._resolved,submitted:this._submitted,showError:this._showError,disabled:this.disabled,readonly:this.readonly,hideClose:this.hideClose,hideSkip:this.hideSkip,showChange:this.showChange,optionIndicator:this.optionIndicator,size:this.size,dir:this.dir,language:this.languageResolver.language,selectedValues:e=>this.selectedValues(e),isOtherSelected:e=>this.isOtherSelected(e),questionError:e=>this.questionError(e),questionInvalid:e=>this.questionInvalid(e),optionDisabled:(e,t,n)=>this.optionDisabled(e,t,n),handlers:this.renderHandlers}}get renderHandlers(){return{contentClick:this.handleContentClick,back:this.handleBack,primary:this.handlePrimary,skip:this.handleSkip,cancel:this.handleCancelClick,change:this.handleChange,radioChange:this.handleRadioChange,radioClick:this.handleRadioClick,checkboxChange:this.handleCheckboxChange,otherInput:this.handleOtherInput,otherChange:this.handleOtherChange,otherKeydown:this.handleOtherKeydown,focusIn:this.handleFocusIn,focusOut:this.handleFocusOut}}get copy(){return C(this.labels)}get currentQuestion(){return this.questions[this._step]}optionShowsKeyboardFocus(e){let t=e=>{if(!e)return!1;try{return e.matches(`:focus-visible`)||e.matches(`.focus-visible`)}catch{return e.matches(`.focus-visible`)}};return t(e)||t(e.shadowRoot?.activeElement)||this.hasVisibleFocusInTree()}markKeyboardFocus(e){this.shadowRoot?.querySelectorAll(`[data-focus-visible]`).forEach(e=>delete e.dataset.focusVisible),this.shadowRoot?.querySelectorAll(`.option-number--focused`).forEach(e=>e.classList.remove(`option-number--focused`)),e&&(e.dataset.focusVisible=``,e.querySelector(`.option-number`)?.classList.add(`option-number--focused`))}focusedOptionForEvent(e){let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.dataset.optionIndex!==void 0);if(t)return t;let n=this.shadowRoot?.activeElement;return n instanceof HTMLElement&&n.dataset.optionIndex!==void 0?n:void 0}moveFocus(e){if(e)try{e.focus()}catch{try{HTMLElement.prototype.focus.call(e)}catch{return}}}focusOptions(){let e=this.optionsGroup;if(!e){this.moveFocus(this.questionTitle);return}let t=this.currentQuestion,n=t?.type===`single`?this.selectedValues(t)[0]:void 0,r=n?e.querySelector(`luzmo-radio[value="${CSS.escape(n)}"]:not([disabled])`):void 0,i=e.querySelector(`[data-option-index]:not([disabled])`);this.moveFocus(r??i??e)}advanceAfterSingleSelection(){this._step<this.questions.length-1?(this._step+=1,this.updateComplete.then(()=>this.moveFocus(this.questionTitle))):(this._resolved=!0,this._submitted=!1,this.updateComplete.then(()=>this.focus()))}acceptFlow(){let e=this.questions.findIndex(e=>this.questionInvalid(e));e===-1?(this._showError=!1,this._resolved=!0,this._submitted=!0,this.emitResult(`accept`,F(this.questions,this.value)),this.updateComplete.then(()=>this.focus())):(this._step=e,this._showError=!0,this.updateComplete.then(()=>this.focusOptions()))}commitAnswer(e,t,n){let r=g(this.value);_(r,e,t),this.assignValue(r,n)}commitOther(e,t,n){let r=g(this.value);_(r,p(e.id),t);let i=t.trim().length>0;if(e.type===`single`)i?_(r,e.id,d):r[e.id]===`__other__`&&_(r,e.id,``);else{let t=new Set(this.selectedValues(e));i?t.add(d):t.delete(d),_(r,e.id,[...e.options.map(e=>e.value),d].filter(e=>t.has(e)))}this.assignValue(r,n)}assignValue(e,t){v(e,this.value)||(this.value=e,this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))),t&&this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))}emitResult(e,t){let n=e===`accept`?{action:e,content:t}:{action:e};e===`accept`?this.dispatchEvent(new CustomEvent(`luzmo-submit`,{detail:n,bubbles:!0,composed:!0})):e===`decline`?this.dispatchEvent(new CustomEvent(`luzmo-decline`,{detail:n,bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent(`luzmo-cancel`,{detail:n,bubbles:!0,composed:!0}))}selectedValues(e){return x(e,this.value)}isOtherSelected(e){return S(e,this.value)}questionError(e){return j(e,this.value,this.copy)}questionInvalid(e){return A(e,this.value)}optionDisabled(e,t,n){return M(e,t,n,this.value,this.disabled)}};e.t([(0,a.property)({attribute:!1})],$.prototype,`questions`,void 0),e.t([(0,a.property)({attribute:!1})],$.prototype,`value`,void 0),e.t([(0,a.property)({attribute:!1})],$.prototype,`labels`,void 0),e.t([(0,a.property)({reflect:!0})],$.prototype,`dir`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0,attribute:`hide-close`})],$.prototype,`hideClose`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0,attribute:`hide-skip`})],$.prototype,`hideSkip`,void 0),e.t([(0,a.property)({type:Boolean,reflect:!0,attribute:`show-change`})],$.prototype,`showChange`,void 0),e.t([(0,a.property)({reflect:!0,attribute:`option-indicator`})],$.prototype,`optionIndicator`,null),e.t([(0,a.state)()],$.prototype,`_step`,void 0),e.t([(0,a.state)()],$.prototype,`_resolved`,void 0),e.t([(0,a.state)()],$.prototype,`_submitted`,void 0),e.t([(0,a.state)()],$.prototype,`_showError`,void 0),e.t([(0,a.query)(`#question-title`)],$.prototype,`questionTitle`,void 0),e.t([(0,a.query)(`#other-field`)],$.prototype,`otherField`,void 0),e.t([(0,a.query)(`#options`)],$.prototype,`optionsGroup`,void 0),e.t([(0,a.query)(`#resolved-title`)],$.prototype,`resolvedTitle`,void 0),typeof customElements<`u`&&!customElements.get(`luzmo-question-box`)&&customElements.define(`luzmo-question-box`,$),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});