@prolibu-suite/cobalt-core 0.10.1 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/custom-elements.json +107 -27
  2. package/dist/cjs/co-accordion.cjs.entry.js +32 -3
  3. package/dist/cjs/co-avatar.cjs.entry.js +1 -1
  4. package/dist/cjs/co-button.cjs.entry.js +1 -1
  5. package/dist/cjs/co-calendar_3.cjs.entry.js +7 -3
  6. package/dist/cjs/co-chip_2.cjs.entry.js +8 -6
  7. package/dist/cjs/co-column-picker.cjs.entry.js +1 -1
  8. package/dist/cjs/co-combobox.cjs.entry.js +1 -1
  9. package/dist/cjs/co-command-search.cjs.entry.js +1 -1
  10. package/dist/cjs/co-date-range-picker.cjs.entry.js +3 -1
  11. package/dist/cjs/co-emoji-picker.cjs.entry.js +1 -1
  12. package/dist/cjs/co-file-type-tile.cjs.entry.js +23 -7
  13. package/dist/cjs/co-number-field.cjs.entry.js +25 -4
  14. package/dist/cjs/co-overlay.cjs.entry.js +34 -3
  15. package/dist/cjs/co-phone-field.cjs.entry.js +5 -5
  16. package/dist/cjs/co-provider-logo_2.cjs.entry.js +1 -1
  17. package/dist/cjs/co-rich-text-editor.cjs.entry.js +30 -10
  18. package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +5 -2
  19. package/dist/cjs/co-rich-text-viewer.cjs.entry.js +19 -3
  20. package/dist/cjs/co-row.cjs.entry.js +2 -2
  21. package/dist/cjs/co-select.cjs.entry.js +8 -8
  22. package/dist/cjs/co-separator.cjs.entry.js +1 -1
  23. package/dist/cjs/co-sidebar-nav.cjs.entry.js +1 -1
  24. package/dist/cjs/co-sidebar.cjs.entry.js +2 -2
  25. package/dist/cjs/co-slider.cjs.entry.js +2 -2
  26. package/dist/cjs/co-switch.cjs.entry.js +3 -3
  27. package/dist/cjs/co-tab-group.cjs.entry.js +2 -2
  28. package/dist/cjs/co-tab.cjs.entry.js +2 -2
  29. package/dist/cjs/co-tags-field.cjs.entry.js +5 -5
  30. package/dist/cjs/co-textarea.cjs.entry.js +4 -4
  31. package/dist/cjs/co-time-field.cjs.entry.js +1 -1
  32. package/dist/cjs/co-toggle-button-group.cjs.entry.js +2 -2
  33. package/dist/cjs/co-toggle-button.cjs.entry.js +2 -2
  34. package/dist/cjs/co-tooltip.cjs.entry.js +2 -2
  35. package/dist/cjs/co-video.cjs.entry.js +2 -2
  36. package/dist/cjs/cobalt.cjs.js +1 -1
  37. package/dist/cjs/{index-BYwrR87Z.js → index-2kMmd5-a.js} +6717 -6654
  38. package/dist/cjs/index-MDAnKsze.js +8 -8
  39. package/dist/cjs/loader.cjs.js +1 -1
  40. package/dist/cjs/{normalizeText-B-v-XPKf.js → normalizeText-D9rlJWZa.js} +29 -18
  41. package/dist/cjs/{toolbar-config-BSGas-Wl.js → toolbar-config-CYACt9hh.js} +13 -1
  42. package/dist/cobalt/cobalt.esm.js +1 -1
  43. package/dist/cobalt/p-07416e31.entry.js +1 -0
  44. package/dist/cobalt/{p-2fba312b.entry.js → p-0c004735.entry.js} +1 -1
  45. package/dist/cobalt/{p-16954cea.entry.js → p-11c5ce78.entry.js} +1 -1
  46. package/dist/cobalt/{p-c465d619.entry.js → p-1861fe41.entry.js} +1 -1
  47. package/dist/cobalt/p-1cc818ca.entry.js +1 -0
  48. package/dist/cobalt/p-216a63ee.entry.js +1 -0
  49. package/dist/cobalt/p-24196410.entry.js +1 -0
  50. package/dist/cobalt/{p-5e4973a6.entry.js → p-292b0389.entry.js} +1 -1
  51. package/dist/cobalt/{p-b5bba7fe.entry.js → p-2c9dba2f.entry.js} +1 -1
  52. package/dist/cobalt/{p-789c4b3e.entry.js → p-39a50e7f.entry.js} +1 -1
  53. package/dist/cobalt/p-39dc4ec8.entry.js +1 -0
  54. package/dist/cobalt/{p-3c4f7026.entry.js → p-3d31c575.entry.js} +1 -1
  55. package/dist/cobalt/{p-37f5036b.entry.js → p-49834b8e.entry.js} +1 -1
  56. package/dist/cobalt/p-5c756787.entry.js +1 -0
  57. package/dist/cobalt/{p-27a7e549.entry.js → p-67f3b9d6.entry.js} +1 -1
  58. package/dist/cobalt/{p-9cf738ed.entry.js → p-6a4f3179.entry.js} +1 -1
  59. package/dist/cobalt/{p-6c82a892.entry.js → p-6dd220e0.entry.js} +1 -1
  60. package/dist/cobalt/{p-93fe45fd.entry.js → p-71cbc53c.entry.js} +1 -1
  61. package/dist/cobalt/{p-e371ec7a.entry.js → p-72e52af7.entry.js} +1 -1
  62. package/dist/cobalt/{p-d3344187.entry.js → p-7b5c555c.entry.js} +1 -1
  63. package/dist/cobalt/{p-148d4aa6.entry.js → p-8530ad16.entry.js} +1 -1
  64. package/dist/cobalt/{p-a325ea0c.entry.js → p-8a74bf7d.entry.js} +1 -1
  65. package/dist/cobalt/p-8e05b979.entry.js +1 -0
  66. package/dist/cobalt/{p-7e8e6907.entry.js → p-8ebc0c12.entry.js} +1 -1
  67. package/dist/cobalt/p-99a655f6.entry.js +1 -0
  68. package/dist/{components/p-DOL2zACE.js → cobalt/p-BAYo-RBt.js} +1 -1
  69. package/dist/cobalt/p-Ba_v-MzM.js +1 -0
  70. package/dist/cobalt/{p-Bryf3-Js.js → p-CJW9H3Gi.js} +1 -1
  71. package/dist/cobalt/p-a1b422ca.entry.js +1 -0
  72. package/dist/cobalt/{p-354d5089.entry.js → p-ade07307.entry.js} +1 -1
  73. package/dist/cobalt/{p-383a998e.entry.js → p-b437eff6.entry.js} +1 -1
  74. package/dist/cobalt/p-b698188c.entry.js +1 -0
  75. package/dist/cobalt/p-bde32f8b.entry.js +1 -0
  76. package/dist/cobalt/{p-95cfcb34.entry.js → p-c30b4cb5.entry.js} +1 -1
  77. package/dist/cobalt/p-ee149fd2.entry.js +1 -0
  78. package/dist/cobalt/{p-fd150cc6.entry.js → p-f7eb1a40.entry.js} +1 -1
  79. package/dist/cobalt/{p-16f8cee6.entry.js → p-f9a7b7c6.entry.js} +1 -1
  80. package/dist/collection/components/co-accordion/co-accordion.css +9 -2
  81. package/dist/collection/components/co-accordion/co-accordion.js +35 -4
  82. package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
  83. package/dist/collection/components/co-avatar/co-avatar.css +22 -1
  84. package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
  85. package/dist/collection/components/co-button/co-button.css +9 -0
  86. package/dist/collection/components/co-calendar/co-calendar.css +10 -4
  87. package/dist/collection/components/co-calendar/co-calendar.js +6 -2
  88. package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
  89. package/dist/collection/components/co-combobox/co-combobox.js +1 -1
  90. package/dist/collection/components/co-command-search/co-command-search.js +1 -1
  91. package/dist/collection/components/co-data-table/co-data-table.js +1 -1
  92. package/dist/collection/components/co-date-range-picker/co-date-range-picker.css +13 -0
  93. package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +4 -2
  94. package/dist/collection/components/co-file-type-tile/co-file-type-tile.js +4 -43
  95. package/dist/collection/components/co-file-type-tile/co-file-type-tile.utils.js +55 -0
  96. package/dist/collection/components/co-number-field/co-number-field.js +25 -4
  97. package/dist/collection/components/co-option-list/co-option-list.js +8 -6
  98. package/dist/collection/components/co-overlay/backdropDismiss.js +12 -0
  99. package/dist/collection/components/co-overlay/co-overlay.js +22 -3
  100. package/dist/collection/components/co-phone-field/co-phone-field.js +5 -5
  101. package/dist/collection/components/co-popover/co-popover.js +1 -1
  102. package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
  103. package/dist/collection/components/co-ref-field/co-ref-field.js +4 -4
  104. package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.css +22 -0
  105. package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +48 -8
  106. package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.css +52 -0
  107. package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.js +25 -2
  108. package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.css +5 -0
  109. package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.js +17 -1
  110. package/dist/collection/components/co-row/co-row.js +2 -2
  111. package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
  112. package/dist/collection/components/co-select/co-select.js +9 -9
  113. package/dist/collection/components/co-separator/co-separator.js +1 -1
  114. package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
  115. package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
  116. package/dist/collection/components/co-skeleton/co-skeleton.js +1 -1
  117. package/dist/collection/components/co-slider/co-slider.js +2 -2
  118. package/dist/collection/components/co-switch/co-switch.js +3 -3
  119. package/dist/collection/components/co-tab/co-tab.js +2 -2
  120. package/dist/collection/components/co-tab-group/co-tab-group.js +2 -2
  121. package/dist/collection/components/co-tags-field/co-tags-field.js +5 -5
  122. package/dist/collection/components/co-textarea/co-textarea.js +4 -4
  123. package/dist/collection/components/co-time-field/co-time-field.js +1 -1
  124. package/dist/collection/components/co-toast/co-toast.js +2 -2
  125. package/dist/collection/components/co-toggle-button/co-toggle-button.js +2 -2
  126. package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +2 -2
  127. package/dist/collection/components/co-tooltip/co-tooltip.js +2 -2
  128. package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
  129. package/dist/collection/components/co-video/co-video.js +2 -2
  130. package/dist/collection/utils/normalizeText.js +43 -0
  131. package/dist/components/co-accordion.js +1 -1
  132. package/dist/components/co-autocomplete.js +1 -1
  133. package/dist/components/co-avatar-group.js +1 -1
  134. package/dist/components/co-avatar.js +1 -1
  135. package/dist/components/co-button.js +1 -1
  136. package/dist/components/co-calendar-month.js +1 -1
  137. package/dist/components/co-calendar-timegrid.js +1 -1
  138. package/dist/components/co-calendar.js +1 -1
  139. package/dist/components/co-column-picker.js +1 -1
  140. package/dist/components/co-combobox.js +1 -1
  141. package/dist/components/co-command-search.js +1 -1
  142. package/dist/components/co-data-table.js +1 -1
  143. package/dist/components/co-date-picker.js +1 -1
  144. package/dist/components/co-date-range-picker.js +1 -1
  145. package/dist/components/co-date-range.js +1 -1
  146. package/dist/components/co-date-time-picker.js +1 -1
  147. package/dist/components/co-drawer.js +1 -1
  148. package/dist/components/co-drive-card.js +1 -1
  149. package/dist/components/co-emoji-picker.js +1 -1
  150. package/dist/components/co-event-calendar.js +1 -1
  151. package/dist/components/co-file-field.js +1 -1
  152. package/dist/components/co-file-type-tile.js +1 -1
  153. package/dist/components/co-lightbox.js +1 -1
  154. package/dist/components/co-list-item.js +1 -1
  155. package/dist/components/co-modal.js +1 -1
  156. package/dist/components/co-number-field.js +1 -1
  157. package/dist/components/co-option-list.js +1 -1
  158. package/dist/components/co-overlay.js +1 -1
  159. package/dist/components/co-phone-field.js +1 -1
  160. package/dist/components/co-ref-field.js +1 -1
  161. package/dist/components/co-rich-text-editor.js +1 -1
  162. package/dist/components/co-rich-text-toolbar.js +1 -1
  163. package/dist/components/co-rich-text-viewer.js +1 -1
  164. package/dist/components/co-row.js +1 -1
  165. package/dist/components/co-select.js +1 -1
  166. package/dist/components/co-separator.js +1 -1
  167. package/dist/components/co-sidebar-nav.js +1 -1
  168. package/dist/components/co-sidebar.js +1 -1
  169. package/dist/components/co-skeleton.js +1 -1
  170. package/dist/components/co-slider.js +1 -1
  171. package/dist/components/co-switch.js +1 -1
  172. package/dist/components/co-tab-group.js +1 -1
  173. package/dist/components/co-tab.js +1 -1
  174. package/dist/components/co-tags-field.js +1 -1
  175. package/dist/components/co-textarea.js +1 -1
  176. package/dist/components/co-time-field.js +1 -1
  177. package/dist/components/co-toggle-button-group.js +1 -1
  178. package/dist/components/co-toggle-button.js +1 -1
  179. package/dist/components/co-tooltip.js +1 -1
  180. package/dist/components/co-video.js +1 -1
  181. package/dist/components/{p-CLsAo0-A.js → p-2EOI1nrz.js} +1 -1
  182. package/dist/{cobalt/p-DOL2zACE.js → components/p-BAYo-RBt.js} +1 -1
  183. package/dist/components/p-BJh68Jqe.js +1 -0
  184. package/dist/components/p-Ba_v-MzM.js +1 -0
  185. package/dist/components/p-BhCVadcA.js +1 -0
  186. package/dist/components/p-BrAFTkAn.js +1 -0
  187. package/dist/components/{p-zuhal3IZ.js → p-Bsh0JMGf.js} +1 -1
  188. package/dist/components/{p-Bryf3-Js.js → p-CJW9H3Gi.js} +1 -1
  189. package/dist/components/p-CWCYYQrF.js +1 -0
  190. package/dist/components/p-D7Lhxz7L.js +1 -0
  191. package/dist/components/{p-B9xitpGU.js → p-DFlJMEJ-.js} +1 -1
  192. package/dist/components/{p-De7w9k6_.js → p-DTPYZwaZ.js} +1 -1
  193. package/dist/components/{p-DSnJWzQw.js → p-Dc_Kbari.js} +1 -1
  194. package/dist/components/{p-D2ldYZo1.js → p-Dcg4krSX.js} +1 -1
  195. package/dist/components/{p-DTi2O4O8.js → p-DvR45CLa.js} +1 -1
  196. package/dist/components/{p-DDV_bRcU.js → p-Nt4JJxbL.js} +1 -1
  197. package/dist/components/{p-DxtNejr2.js → p-P4HlMBlL.js} +1 -1
  198. package/dist/components/p-cndRd_-U.js +1 -0
  199. package/dist/components/{p-D3mVYO-G.js → p-uxdXViMV.js} +1 -1
  200. package/dist/esm/co-accordion.entry.js +32 -3
  201. package/dist/esm/co-avatar.entry.js +1 -1
  202. package/dist/esm/co-button.entry.js +1 -1
  203. package/dist/esm/co-calendar_3.entry.js +7 -3
  204. package/dist/esm/co-chip_2.entry.js +8 -6
  205. package/dist/esm/co-column-picker.entry.js +1 -1
  206. package/dist/esm/co-combobox.entry.js +1 -1
  207. package/dist/esm/co-command-search.entry.js +1 -1
  208. package/dist/esm/co-date-range-picker.entry.js +3 -1
  209. package/dist/esm/co-emoji-picker.entry.js +1 -1
  210. package/dist/esm/co-file-type-tile.entry.js +23 -7
  211. package/dist/esm/co-number-field.entry.js +25 -4
  212. package/dist/esm/co-overlay.entry.js +34 -3
  213. package/dist/esm/co-phone-field.entry.js +5 -5
  214. package/dist/esm/co-provider-logo_2.entry.js +1 -1
  215. package/dist/esm/co-rich-text-editor.entry.js +30 -10
  216. package/dist/esm/co-rich-text-toolbar.entry.js +5 -2
  217. package/dist/esm/co-rich-text-viewer.entry.js +19 -3
  218. package/dist/esm/co-row.entry.js +2 -2
  219. package/dist/esm/co-select.entry.js +8 -8
  220. package/dist/esm/co-separator.entry.js +1 -1
  221. package/dist/esm/co-sidebar-nav.entry.js +1 -1
  222. package/dist/esm/co-sidebar.entry.js +2 -2
  223. package/dist/esm/co-slider.entry.js +2 -2
  224. package/dist/esm/co-switch.entry.js +3 -3
  225. package/dist/esm/co-tab-group.entry.js +2 -2
  226. package/dist/esm/co-tab.entry.js +2 -2
  227. package/dist/esm/co-tags-field.entry.js +5 -5
  228. package/dist/esm/co-textarea.entry.js +4 -4
  229. package/dist/esm/co-time-field.entry.js +1 -1
  230. package/dist/esm/co-toggle-button-group.entry.js +2 -2
  231. package/dist/esm/co-toggle-button.entry.js +2 -2
  232. package/dist/esm/co-tooltip.entry.js +2 -2
  233. package/dist/esm/co-video.entry.js +2 -2
  234. package/dist/esm/cobalt.js +1 -1
  235. package/dist/esm/{index-68iUQp5j.js → index-BBIYyvq-.js} +6717 -6654
  236. package/dist/esm/index-DH5lfRNj.js +8 -8
  237. package/dist/esm/loader.js +1 -1
  238. package/dist/esm/{normalizeText-CQY6Ul7q.js → normalizeText-Ba_v-MzM.js} +29 -18
  239. package/dist/esm/{toolbar-config-DOL2zACE.js → toolbar-config-BAYo-RBt.js} +13 -1
  240. package/dist/types/components/co-accordion/co-accordion.d.ts +11 -2
  241. package/dist/types/components/co-file-type-tile/co-file-type-tile.utils.d.ts +12 -0
  242. package/dist/types/components/co-number-field/co-number-field.d.ts +7 -0
  243. package/dist/types/components/co-overlay/backdropDismiss.d.ts +10 -0
  244. package/dist/types/components/co-overlay/co-overlay.d.ts +4 -0
  245. package/dist/types/components/co-rich-text-editor/co-rich-text-editor.d.ts +7 -0
  246. package/dist/types/components/co-rich-text-toolbar/co-rich-text-toolbar.d.ts +4 -1
  247. package/dist/types/components.d.ts +41 -11
  248. package/dist/types/utils/normalizeText.d.ts +13 -0
  249. package/package.json +4 -4
  250. package/dist/cobalt/p-239c5c5f.entry.js +0 -1
  251. package/dist/cobalt/p-2a30c143.entry.js +0 -1
  252. package/dist/cobalt/p-2f0f3bb1.entry.js +0 -1
  253. package/dist/cobalt/p-5adf117c.entry.js +0 -1
  254. package/dist/cobalt/p-5ca394b1.entry.js +0 -1
  255. package/dist/cobalt/p-66b11b38.entry.js +0 -1
  256. package/dist/cobalt/p-CQY6Ul7q.js +0 -1
  257. package/dist/cobalt/p-b0c4fc71.entry.js +0 -1
  258. package/dist/cobalt/p-be34e447.entry.js +0 -1
  259. package/dist/cobalt/p-c124e82b.entry.js +0 -1
  260. package/dist/cobalt/p-d9d9e8ae.entry.js +0 -1
  261. package/dist/cobalt/p-e8a2f993.entry.js +0 -1
  262. package/dist/cobalt/p-eb8691f2.entry.js +0 -1
  263. package/dist/components/p-CBTGN490.js +0 -1
  264. package/dist/components/p-CFFDmGPS.js +0 -1
  265. package/dist/components/p-CQY6Ul7q.js +0 -1
  266. package/dist/components/p-DoHLTC0n.js +0 -1
  267. package/dist/components/p-HxVRXXXC.js +0 -1
  268. package/dist/components/p-vby0ITbe.js +0 -1
  269. package/dist/components/p-wjt4IAGZ.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e,p as a,H as t,c as r,h as s}from"./index.js";import{g as o}from"./p-jYd9gu_c.js";import{d as i}from"./p-DNJAIVfI.js";import{a as c,b as n,t as d,p as l,i as h,c as u,s as f,d as _,g as m,e as b,f as g,h as y}from"./p-e5KibEs8.js";const v=a(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coSelect=r(this,"coSelect",7),this.coRangeSelect=r(this,"coRangeSelect",7),this.mode="single",this.locale="es-CO",this.firstDayOfWeek=1,this.hoverDay=null,this.view="days",this.shouldFocusGrid=!1,this.handleDayHover=e=>{"range"===this.mode&&(this.hoverDay=e)},this.handlePrev=()=>this.step(-1),this.handleNext=()=>this.step(1),this.toggleView=()=>{this.view="days"===this.view?"months":"months"===this.view?"years":"days"},this.handleGridKeyDown=e=>{const a=this.focused;let t=!0;switch(e.key){case"ArrowLeft":this.moveFocus(n(a,-1));break;case"ArrowRight":this.moveFocus(n(a,1));break;case"ArrowUp":this.moveFocus(n(a,-7));break;case"ArrowDown":this.moveFocus(n(a,7));break;case"Home":this.moveFocus(p(a,this.firstDayOfWeek));break;case"End":this.moveFocus(n(p(a,this.firstDayOfWeek),6));break;case"PageUp":this.moveFocus(c(a,e.shiftKey?-12:-1));break;case"PageDown":this.moveFocus(c(a,e.shiftKey?12:1));break;case"Enter":case" ":this.selectDay(a);break;default:t=!1}t&&(e.preventDefault(),e.stopPropagation())}}componentWillLoad(){var e;const a=null!==(e=this.anchorValue)&&void 0!==e?e:d(),t=l(a);this.viewYear=t.year,this.viewMonth=t.month,this.focused=this.initialFocus()}onValueChange(){if(!this.selectedValue)return;const e=l(this.selectedValue);this.viewYear=e.year,this.viewMonth=e.month,this.focused=this.selectedValue}async focusGrid(){this.shouldFocusGrid=!0,this.focusFocusedCell()}get selectedValue(){return h(this.value)?this.value:null}get rangeStartV(){return h(this.rangeStart)?this.rangeStart:null}get rangeEndV(){return h(this.rangeEnd)?this.rangeEnd:null}get anchorValue(){return"range"===this.mode?this.rangeStartV:this.selectedValue}get disabledOpts(){return{min:this.min,max:this.max,disabledDates:x(this.disabledDates),disabledDaysOfWeek:w(this.disabledDaysOfWeek)}}isDayDisabled(e){return u(e,this.disabledOpts)}initialFocus(){const e=this.anchorValue;if(e&&!this.isDayDisabled(e))return e;const a=d(),t=l(a);if(t.year===this.viewYear&&t.month===this.viewMonth&&!this.isDayDisabled(a))return a;const r=`${String(this.viewYear).padStart(4,"0")}-${String(this.viewMonth).padStart(2,"0")}-01`;let s=r;for(let e=0;e<31;e++){const e=l(s);if(!e||e.month!==this.viewMonth)break;if(!this.isDayDisabled(s))return s;s=n(s,1)}return r}selectDay(e){this.isDayDisabled(e)||(this.focused=e,"range"===this.mode?this.selectRangeDay(e):this.coSelect.emit(e))}selectRangeDay(e){const a=this.rangeStartV;let t;t=!a||a&&this.rangeEndV?{start:e,end:null}:_(e,a)<0?{start:e,end:a}:{start:a,end:e},this.coRangeSelect.emit(t)}moveFocus(e){this.focused=e;const a=l(e);a.year===this.viewYear&&a.month===this.viewMonth||(this.viewYear=a.year,this.viewMonth=a.month),this.shouldFocusGrid=!0}step(e){if("days"===this.view){const a=c(`${this.viewYear}-${String(this.viewMonth).padStart(2,"0")}-01`,e),t=l(a);this.viewYear=t.year,this.viewMonth=t.month}else this.viewYear+="months"===this.view?e:10*e}selectMonth(e){this.viewMonth=e,this.view="days"}selectYear(e){this.viewYear=e,this.view="months"}get decadeStart(){return 10*Math.floor(this.viewYear/10)}get selectedYM(){const e="range"===this.mode?this.rangeStartV:this.selectedValue;if(!e)return null;const a=l(e);return{year:a.year,month:a.month}}isMonthDisabled(e,a){const t=`${String(e).padStart(4,"0")}-${String(a).padStart(2,"0")}-01`,r=n(f(c(t,1)),-1);return!!(this.min&&_(r,this.min)<0)||!!(this.max&&_(t,this.max)>0)}isYearDisabled(e){const a=`${String(e).padStart(4,"0")}-01-01`,t=`${String(e).padStart(4,"0")}-12-31`;return!!(this.min&&_(t,this.min)<0)||!!(this.max&&_(a,this.max)>0)}componentDidRender(){this.shouldFocusGrid&&(this.shouldFocusGrid=!1,this.focusFocusedCell())}focusFocusedCell(){var e;const a=null===(e=this.el.shadowRoot)||void 0===e?void 0:e.querySelector(`[data-date="${this.focused}"]`);null==a||a.focus()}rangeFlags(e){const a=this.rangeStartV,t=this.rangeEndV;if(!a)return{isStart:!1,isEnd:!1,inRange:!1};const r=null!=t?t:this.hoverDay&&!t?this.hoverDay:null;if(!r)return{isStart:0===_(e,a),isEnd:!1,inRange:!1};const s=_(a,r)<=0?a:r,o=_(a,r)<=0?r:a;return{isStart:0===_(e,s),isEnd:0===_(e,o),inRange:_(e,s)>0&&_(e,o)<0}}dayClass(e,a,t){const r=0===_(e,d());if("range"===this.mode){const{isStart:s,isEnd:o,inRange:i}=this.rangeFlags(e);return{"co-calendar__day":!0,"co-calendar__day--outside":!a,"co-calendar__day--today":r&&!(s||o)&&!i,"co-calendar__day--range-start":s,"co-calendar__day--range-end":o,"co-calendar__day--in-range":i,"co-calendar__day--disabled":t}}const s=this.selectedValue,o=!!s&&0===_(e,s);return{"co-calendar__day":!0,"co-calendar__day--outside":!a,"co-calendar__day--today":r&&!o,"co-calendar__day--selected":o,"co-calendar__day--disabled":t}}headerTitle(){return"months"===this.view?String(this.viewYear):"years"===this.view?`${this.decadeStart}–${this.decadeStart+9}`:m(this.viewYear,this.viewMonth,this.locale,"long")}renderDays(e){const a=m(this.viewYear,this.viewMonth,this.locale,"long"),t=b(this.locale,this.firstDayOfWeek,"short"),r=b(this.locale,this.firstDayOfWeek,"long"),o=g(this.viewYear,this.viewMonth,this.firstDayOfWeek).filter((e=>e.some((e=>e.inMonth))));return s("div",{class:"co-calendar__grid",part:"grid",role:"grid","aria-label":a,onKeyDown:this.handleGridKeyDown},s("div",{class:"co-calendar__row co-calendar__row--dow",role:"row"},t.map(((e,a)=>s("span",{class:"co-calendar__dow",role:"columnheader","aria-label":r[a]},e)))),o.map((e=>s("div",{class:"co-calendar__row",role:"row"},e.map((e=>{const a=this.isDayDisabled(e.value),t=0===_(e.value,this.focused),r=0===_(e.value,d());let o;if("range"===this.mode){const{isStart:a,isEnd:t}=this.rangeFlags(e.value);o=a||t}else{const a=this.selectedValue;o=!!a&&0===_(e.value,a)}const i=l(e.value).day;return s("button",{type:"button",role:"gridcell","data-date":e.value,class:this.dayClass(e.value,e.inMonth,a),tabIndex:t?0:-1,"aria-selected":o?"true":"false","aria-current":r?"date":void 0,"aria-disabled":a?"true":void 0,"aria-label":y(e.value,this.locale),onClick:()=>this.selectDay(e.value),onMouseEnter:()=>this.handleDayHover(e.value),onMouseLeave:()=>this.handleDayHover(null)},i)}))))))}renderMonths(){const e=this.selectedYM,a=new Date;return s("div",{class:"co-calendar__panel",part:"grid"},Array.from({length:12},((t,r)=>{const o=r+1,i=new Intl.DateTimeFormat(this.locale,{month:"short"}).format(new Date(this.viewYear,r,1)),c=this.isMonthDisabled(this.viewYear,o),n=!!e&&e.year===this.viewYear&&e.month===o,d=a.getFullYear()===this.viewYear&&a.getMonth()===r;return s("button",{type:"button",class:{"co-calendar__cell":!0,"co-calendar__cell--selected":n,"co-calendar__cell--today":d&&!n,"co-calendar__cell--disabled":c},disabled:c,"aria-current":d?"date":void 0,onClick:()=>this.selectMonth(o)},i)})))}renderYears(){const e=this.selectedYM,a=(new Date).getFullYear(),t=this.decadeStart-1;return s("div",{class:"co-calendar__panel",part:"grid"},Array.from({length:12},((r,o)=>{const i=t+o,c=this.isYearDisabled(i),n=!!e&&e.year===i,d=a===i;return s("button",{type:"button",class:{"co-calendar__cell":!0,"co-calendar__cell--muted":i<this.decadeStart||i>this.decadeStart+9,"co-calendar__cell--selected":n,"co-calendar__cell--today":d&&!n,"co-calendar__cell--disabled":c},disabled:c,"aria-current":d?"date":void 0,onClick:()=>this.selectYear(i)},i)})))}render(){var e,a;const t=o(this.locale);return s("div",{key:"3b9f57fa8513746cb3133d80d574a0fafbc8b31e",class:"co-calendar",part:"root"},s("div",{key:"6b3b0f8d1c582abbbf04c8b936486bd1e3fedaec",class:"co-calendar__header",part:"header"},s("button",{key:"57f854f84162a5b09119385339c9993ee25cef72",type:"button",class:"co-calendar__nav",onClick:this.handlePrev,"aria-label":null!==(e=this.prevMonthLabel)&&void 0!==e?e:t.prevMonth},s("co-icon",{key:"772ec0dfb48dfee33d506549e68ab7598ec0cf00",name:"caret-left",size:16})),s("button",{key:"b9f3851082fbbe2d5f696dd0a51c442410b15fa1",type:"button",class:"co-calendar__title","aria-live":"polite",onClick:this.toggleView},this.headerTitle(),s("co-icon",{key:"3f660d39a851c97f299e6a6cc8c0ad8b5ed4ee7f",name:"caret-down",size:12,class:"co-calendar__title-caret"})),s("button",{key:"6ac9d1af5f3dc36a34e94e129ab2db313dee74d2",type:"button",class:"co-calendar__nav",onClick:this.handleNext,"aria-label":null!==(a=this.nextMonthLabel)&&void 0!==a?a:t.nextMonth},s("co-icon",{key:"c8c962be3435e108f81968f6dde5f6f481c40733",name:"caret-right",size:16}))),"days"===this.view&&this.renderDays(t),"months"===this.view&&this.renderMonths(),"years"===this.view&&this.renderYears())}get el(){return this}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return":host{display:inline-block;font-family:var(--co-font-family-primary);--co-calendar-day-size:36px}:host([data-touch]){--co-calendar-day-size:44px}.co-calendar{display:flex;flex-direction:column;gap:var(--co-spacing-sm);width:var(--co-calendar-width, max-content)}.co-calendar__header{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs)}.co-calendar__month{font-size:var(--co-font-size-14);font-weight:600;color:var(--co-semantic-text-default);text-transform:capitalize}.co-calendar__title{display:inline-flex;align-items:center;gap:var(--co-spacing-xxs);background:none;border:0;cursor:pointer;font-family:inherit;font-size:var(--co-font-size-14);font-weight:600;color:var(--co-semantic-text-default);text-transform:capitalize;padding:var(--co-spacing-xxs) var(--co-spacing-sm);border-radius:var(--co-border-radius-xs)}.co-calendar__title:hover{background:var(--co-semantic-surface-hover)}.co-calendar__title:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:1px}.co-calendar__title-caret{color:var(--co-semantic-text-muted)}.co-calendar__panel{display:grid;grid-template-columns:repeat(3, 1fr);gap:var(--co-spacing-xs);width:var(--co-calendar-width, calc(var(--co-calendar-day-size) * 7 + 12px));padding-top:var(--co-spacing-xs)}.co-calendar__cell{height:calc(var(--co-calendar-day-size) + 8px);display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid transparent;border-radius:var(--co-border-radius-xs);font-family:inherit;font-size:var(--co-font-size-14);color:var(--co-semantic-text-default);cursor:pointer;text-transform:capitalize;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), color var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-calendar__cell:hover:not(.co-calendar__cell--disabled):not(.co-calendar__cell--selected){background:var(--co-semantic-surface-hover)}.co-calendar__cell:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:1px}.co-calendar__cell--muted{color:var(--co-semantic-text-muted)}.co-calendar__cell--today{border-color:var(--co-semantic-surface-primary);font-weight:600}.co-calendar__cell--selected{background:var(--co-semantic-surface-primary);border-color:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-weight:600}.co-calendar__cell--disabled{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-calendar__nav{background:none;border:0;cursor:pointer;padding:var(--co-spacing-xs);border-radius:var(--co-border-radius-xxs);display:inline-flex;align-items:center;color:var(--co-semantic-text-default)}.co-calendar__nav:hover{background:var(--co-semantic-surface-hover)}.co-calendar__nav:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:1px}.co-calendar__grid{display:flex;flex-direction:column;gap:2px}.co-calendar__row{display:grid;grid-template-columns:repeat(7, var(--co-calendar-col, var(--co-calendar-day-size)));gap:2px}.co-calendar__row--dow{margin-bottom:2px}.co-calendar__dow{height:24px;display:inline-flex;align-items:center;justify-content:center;font-size:var(--co-font-size-10, 10px);font-weight:600;color:var(--co-semantic-text-muted);text-transform:uppercase;letter-spacing:0.04em}.co-calendar__day{width:var(--co-calendar-day-width, var(--co-calendar-day-size));height:var(--co-calendar-day-size);display:inline-flex;align-items:center;justify-content:center;background:none;border:1px solid transparent;border-radius:var(--co-border-radius-xs);font-size:var(--co-font-size-14);font-family:inherit;color:var(--co-semantic-text-default);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), color var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-calendar__day:hover:not(.co-calendar__day--disabled):not(.co-calendar__day--selected){background:var(--co-semantic-surface-hover)}.co-calendar__day:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:1px}.co-calendar__day--outside{color:var(--co-semantic-text-muted)}.co-calendar__day--today{border-color:var(--co-semantic-surface-primary);font-weight:600}.co-calendar__day--selected{background:var(--co-semantic-surface-primary);border-color:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-weight:600}.co-calendar__day--disabled{color:var(--co-semantic-text-disabled);cursor:not-allowed;pointer-events:none}.co-calendar__day--in-range{background:color-mix(in srgb, var(--co-semantic-surface-primary) 8%, transparent);border-radius:0;color:var(--co-semantic-text-default)}.co-calendar__day--range-start,.co-calendar__day--range-end{background:var(--co-semantic-surface-primary);border-color:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-weight:600}.co-calendar__day--range-start:not(.co-calendar__day--range-end){border-top-right-radius:0;border-bottom-right-radius:0}.co-calendar__day--range-end:not(.co-calendar__day--range-start){border-top-left-radius:0;border-bottom-left-radius:0}"}},[1,"co-calendar",{mode:[1],value:[1],rangeStart:[1,"range-start"],rangeEnd:[1,"range-end"],min:[1],max:[1],disabledDates:[1,"disabled-dates"],disabledDaysOfWeek:[1,"disabled-days-of-week"],locale:[1],firstDayOfWeek:[2,"first-day-of-week"],prevMonthLabel:[1,"prev-month-label"],nextMonthLabel:[1,"next-month-label"],viewYear:[32],viewMonth:[32],focused:[32],hoverDay:[32],view:[32],focusGrid:[64]},void 0,{value:[{onValueChange:0}]}]);function p(e,a){const t=l(e);if(!t)return e;const r=new Date(t.year,t.month-1,t.day).getDay();return n(e,-(r-a+7)%7)}function x(e){if(Array.isArray(e))return e;if("string"==typeof e&&e.trim()){const a=e.trim();try{const e=JSON.parse(a);if(Array.isArray(e))return e.map(String)}catch(e){}return a.split(",").map((e=>e.trim())).filter(Boolean)}return[]}function w(e){if(Array.isArray(e))return e;if("string"==typeof e&&e.trim()){const a=e.trim();try{const e=JSON.parse(a);if(Array.isArray(e))return e.map(Number).filter((e=>!Number.isNaN(e)))}catch(e){}return a.split(",").map((e=>Number(e.trim()))).filter((e=>!Number.isNaN(e)))}return[]}function k(){"undefined"!=typeof customElements&&["co-calendar","co-icon"].forEach((a=>{switch(a){case"co-calendar":customElements.get(e(a))||customElements.define(e(a),v);break;case"co-icon":customElements.get(e(a))||i()}}))}k();export{v as C,k as d}
@@ -0,0 +1 @@
1
+ import{t as o,p as t,H as i,c as r,h as e}from"./index.js";import{h as s}from"./p-Ba_v-MzM.js";import{i as a}from"./p-DqyWGweA.js";import{d as n}from"./p-Dcg4krSX.js";import{d as l}from"./p-DNJAIVfI.js";import{d as c}from"./p-BH184F0X.js";import{d}from"./p-Bsh0JMGf.js";function h(o){let t=o;if("string"==typeof o)try{t=JSON.parse(o)}catch(o){return[]}return Array.isArray(t)?t:[]}function p(o,t,i){const r=[];if(i.forEach(((o,t)=>{o.disabled||r.push(t)})),0===r.length)return-1;const e=r.indexOf(o);return-1===e?1===t?r[0]:r[r.length-1]:r[(e+t+r.length)%r.length]}function v(o,t,i){return t>0?{hasMore:o<t,remaining:Math.max(0,t-o)}:{hasMore:i,remaining:0}}const b=34,f=t(class extends i{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.coSearch=r(this,"coSearch",1),this.coChange=r(this,"coChange",1),this.coLoadMore=r(this,"coLoadMore",1),this.coClearSelection=r(this,"coClearSelection",1),this.coRemoveItem=r(this,"coRemoveItem",1),this.coReorder=r(this,"coReorder",1),this.coPinToggle=r(this,"coPinToggle",1),this.coListReorder=r(this,"coListReorder",1),this.items="[]",this.value="",this.selectedItems="[]",this.multiple=!1,this.selectedFirst=!1,this.selectedAffordance="check",this.removableItems=!1,this.reorderable=!1,this.pinnable=!1,this.listReorderable=!1,this.searchable=!1,this.searchPlaceholder="Search…",this.searchDebounce=350,this.initialTerm="",this.loading=!1,this.total=0,this.hasMore=!1,this.emptyMessage="No results found",this.clearOptionLabel="",this.virtual=!1,this.highlightMatches=!1,this.highlightTerm="",this.avatarShape="circle",this.suffixAlign="inline",this.autoHighlight=!1,this.term="",this.activeIndex=-1,this.scrollTop=0,this.armedKey="",this.dragKey="",this.overKey="",this.dropAfter=!1,this.lastFillLen=-1,this.sortSnapshot=new Set,this.displaySnapshot=[],this.previewOrder=[],this.onRootKeyDown=o=>{var t,r;if("Enter"===o.key){const e=(null===(t=o.composedPath)||void 0===t?void 0:t.call(o)[0])||o.target;if(e instanceof i&&(null===(r=e.closest)||void 0===r?void 0:r.call(e,"button:not(.co-option-list__option), co-list-footer")))return}this.processKey(o.key)&&o.preventDefault()},this.onSearchInput=o=>{const t=o.target.value,i=!!this.term&&!t;this.term=t,this.activeIndex=-1,this.lastFillLen=-1,i&&this.takeSnapshot(),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>this.coSearch.emit(t)),this.searchDebounce)},this.onPtrMove=o=>{const t=this.ptrDrag;if(!t)return;if(!t.started){if(Math.abs(o.clientY-t.startY)<3)return;t.started=!0,this.dragKey=t.id,this.previewOrder=t.originOrder,this.el.style.userSelect="none",this.sortSnapshot.has(t.id)||this.applyPreview([...t.originOrder])}o.preventDefault();const i=this.previewOrder.length;t.desiredTop=Math.max(t.blockTop,Math.min(t.blockTop+(i-1)*t.pitch,o.clientY-t.grabDY)),this.positionLifted();const r=this.previewOrder.indexOf(t.id),e=Math.max(0,Math.min(i-1,Math.round((t.desiredTop-t.blockTop)/t.pitch)));if(e!==r&&-1!==r){const o=[...this.previewOrder];o.splice(e,0,o.splice(r,1)[0]),this.applyPreview(o)}},this.onPtrUp=()=>{const o=this.ptrDrag;if(this.removePtrListeners(),this.ptrDrag=void 0,!o||!o.started)return;const t=o=>{o.stopPropagation(),o.preventDefault()};if(window.addEventListener("click",t,!0),setTimeout((()=>window.removeEventListener("click",t,!0)),0),this.settleLifted(o),this.previewOrder.length&&this.previewOrder.join(" ")!==o.originOrder.join(" ")){const t=new Map(this.displaySnapshot.map((o=>[o._id,o])));this.coReorder.emit({value:this.previewOrder,item:t.get(o.id)})}this.previewOrder=[]},this.onPtrKey=o=>{var t;if("Escape"!==o.key||!this.ptrDrag)return;o.stopPropagation(),o.preventDefault();const i=this.ptrDrag;if(this.removePtrListeners(),this.ptrDrag=void 0,i.started){if(this.displaySnapshot!==i.originDisplay){this.pendingFlip={tops:this.captureRowTops(),movedId:i.id,spring:!0};const o=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.querySelector(`.co-option-list__option[data-id="${CSS.escape(i.id)}"]`);o&&(o.style.transition="none",o.style.transform=""),this.displaySnapshot=i.originDisplay,this.sortSnapshot=i.originSort,this.dragKey="",this.el.style.userSelect=""}else this.settleLifted(i);this.previewOrder=[]}},this.handleRowDragEnd=()=>{this.resetDragState()},this.handleRowDragLeave=(o,t)=>{this.overKey!==t||o.currentTarget.contains(o.relatedTarget)||(this.overKey="")},this.disarmDrag=()=>{this.armedKey&&!this.dragKey&&(this.armedKey="")},this.onNativeScroll=o=>{const t=o.target;this.scrollTop=t.scrollTop,this.maybeLoadMore(t.scrollTop,t.clientHeight,t.scrollHeight)}}get parsedItems(){return h(this.items)}get selectedIds(){return function(o){if(!o)return[];try{const t=JSON.parse(o);return Array.isArray(t)?t:[o]}catch(t){return[o]}}(this.value)}get orderedItems(){return this.selectedFirst?function(o,t,i,r){var e;if(0===t.size)return o;const s=new Map(o.map((o=>[o._id,o]))),a=[];if(r)for(const i of o)t.has(i._id)&&a.push(i);else{const o=new Map(i.map((o=>[o._id,o])));for(const i of t){const t=null!==(e=s.get(i))&&void 0!==e?e:o.get(i);t&&a.push(t)}}const n=o.filter((o=>!t.has(o._id)));return[...a,...n]}(this.parsedItems,this.sortSnapshot,this.displaySnapshot,!!this.term):this.parsedItems}get effectiveHighlightTerm(){return this.highlightMatches?this.searchable?this.term:this.highlightTerm:""}componentWillLoad(){this.term=this.initialTerm||"",this.takeSnapshot(),this.autoHighlight&&(this.activeIndex=p(-1,1,this.orderedItems))}componentDidRender(){this.optionsEl&&!this.osInstance&&(this.osInstance=a(this.optionsEl,(o=>{this.scrollTop=o.scrollTop,this.maybeLoadMore(o.scrollTop,o.clientHeight,o.scrollHeight)}))),this.fillViewport(),this.runFlip(),this.positionLifted()}connectedCallback(){window.addEventListener("mouseup",this.disarmDrag)}disconnectedCallback(){var o;this.debounceTimer&&clearTimeout(this.debounceTimer),null===(o=this.osInstance)||void 0===o||o.destroy(),this.osInstance=void 0,window.removeEventListener("mouseup",this.disarmDrag),this.removePtrListeners()}onItemsChange(){this.autoHighlight?this.activeIndex=p(-1,1,this.orderedItems):this.activeIndex>=this.orderedItems.length&&(this.activeIndex=-1);const o=Math.max(0,this.orderedItems.length*b-272);this.scrollTop>this.orderedItems.length*b&&(this.scrollTop=o)}onValueChange(){var o;if(!this.selectedFirst)return;const t=this.activeIndex>=0?null===(o=this.orderedItems[this.activeIndex])||void 0===o?void 0:o._id:void 0;this.pendingFlip={tops:this.captureRowTops(),movedId:"",spring:!1},this.takeSnapshot(),this.activeIndex=t?this.orderedItems.findIndex((o=>o._id===t)):-1}async snapshotOrder(){this.takeSnapshot()}async focusSearch(){var o,t;for(let i=0;i<20;i++){if(null===(o=this.searchInputEl)||void 0===o||o.focus(),this.searchInputEl&&(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)===this.searchInputEl)return;await new Promise((o=>requestAnimationFrame((()=>o()))))}}async scrollToSelected(){var o,t,i,r;const e=function(o,t){const i=new Set(t);return o.findIndex((o=>i.has(o._id)&&!o.disabled))}(this.orderedItems,this.selectedIds);if(-1!==e){this.activeIndex=e;for(let s=0;s<20;s++){const s=null!==(t=null===(o=this.osInstance)||void 0===o?void 0:o.elements().viewport)&&void 0!==t?t:this.optionsEl;if(s&&s.clientHeight>0){if(this.virtual){const o=e*b;let t=s.scrollTop;o<t?t=o:o+b>t+s.clientHeight&&(t=o+b-s.clientHeight),this.scrollTop=t,s.scrollTop=t}else null===(r=null===(i=this.el.shadowRoot)||void 0===i?void 0:i.getElementById(`co-optlist-${e}`))||void 0===r||r.scrollIntoView({block:"nearest"});return}await new Promise((o=>requestAnimationFrame((()=>o()))))}}}async handleKey(o){return this.processKey(o.key)}takeSnapshot(){this.sortSnapshot=new Set(this.selectedIds);const o=new Map;for(const t of h(this.selectedItems))o.set(t._id,t);for(const t of this.parsedItems)o.has(t._id)||o.set(t._id,t);this.displaySnapshot=this.selectedIds.map((t=>o.get(t))).filter(Boolean)}processKey(o){const t=this.orderedItems;switch(o){case"ArrowDown":return this.activeIndex=p(this.activeIndex,1,t),this.scrollActiveIntoView(),!0;case"ArrowUp":return this.activeIndex=p(this.activeIndex,-1,t),this.scrollActiveIntoView(),!0;case"Enter":{if(this.loading)return!0;const o=t[this.activeIndex];return!(!o||o.disabled||(this.pick(o),0))}default:return!1}}deselectItem(o){if(this.multiple){const t=this.selectedIds.filter((t=>t!==o._id));this.coChange.emit({value:t,item:o})}else this.coChange.emit({value:null,item:o})}pick(o){if(this.multiple){const t=this.selectedIds,i=t.indexOf(o._id)>=0?t.filter((t=>t!==o._id)):[...t,o._id];this.coChange.emit({value:i,item:o})}else this.coChange.emit({value:o._id,item:o})}get listDragActive(){return this.listReorderable&&!(this.reorderable&&this.selectedFirst)}dragOrderIds(){return this.orderedItems.map((o=>o._id))}handleRowDragStart(o,t){this.armedKey===t?(this.dragKey=t,o.dataTransfer&&(o.dataTransfer.effectAllowed="move",o.dataTransfer.setData("text/plain",t))):o.preventDefault()}handleRowDragOver(o,t){if(!this.dragKey||this.dragKey===t)return;o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="move"),this.overKey=t;const i=this.dragOrderIds();this.dropAfter=i.indexOf(this.dragKey)<i.indexOf(t)}applyPreview(o){this.pendingFlip={tops:this.captureRowTops(),movedId:this.dragKey,spring:!1};const t=new Map(this.orderedItems.map((o=>[o._id,o])));for(const o of this.displaySnapshot)t.has(o._id)||t.set(o._id,o);this.sortSnapshot=new Set(o),this.displaySnapshot=o.map((o=>t.get(o))).filter(Boolean),this.previewOrder=o}startPointerDrag(o,t){var i;if(0!==o.button||this.ptrDrag)return;const r=function(o,t){const i=new Set(t);return o.filter((o=>i.has(o._id))).map((o=>o._id))}(this.orderedItems,this.selectedIds);if(!r.includes(t))return;const e=o.currentTarget.closest(".co-option-list__option");if(!e)return;o.preventDefault(),o.stopPropagation();const s=e.getBoundingClientRect(),a=null===(i=this.el.shadowRoot)||void 0===i?void 0:i.querySelectorAll(".co-option-list__option[data-id]"),n=null==a?void 0:a[0],l=a&&a.length>=2?a[1].getBoundingClientRect().top-a[0].getBoundingClientRect().top:s.height||b,c=n?this.orderedItems.findIndex((o=>o._id===n.dataset.id)):0,d=n?n.getBoundingClientRect().top-Math.max(0,c)*l:s.top;this.ptrDrag={id:t,grabDY:o.clientY-s.top,blockTop:d,pitch:l,originOrder:r,originDisplay:this.displaySnapshot,originSort:this.sortSnapshot,desiredTop:s.top,startY:o.clientY,started:!1},window.addEventListener("pointermove",this.onPtrMove),window.addEventListener("pointerup",this.onPtrUp),window.addEventListener("keydown",this.onPtrKey,!0)}positionLifted(){var o;const t=this.ptrDrag;if(!t||!t.started)return;const i=null===(o=this.el.shadowRoot)||void 0===o?void 0:o.querySelector(`.co-option-list__option[data-id="${CSS.escape(t.id)}"]`);if(!i)return;const r=this.previewOrder.indexOf(t.id);if(-1===r)return;const e=t.blockTop+r*t.pitch;i.style.transition="none",i.style.transform=`translateY(${t.desiredTop-e}px) scale(1.02)`}settleLifted(o){var t;const i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.querySelector(`.co-option-list__option[data-id="${CSS.escape(o.id)}"]`),r=()=>{this.dragKey="",this.el.style.userSelect=""};i?(i.style.transition="transform var(--co-motion-duration-base) var(--co-motion-ease-spring)",i.style.transform="",i.addEventListener("transitionend",(()=>{i.style.transition="",r()}),{once:!0})):r()}removePtrListeners(){window.removeEventListener("pointermove",this.onPtrMove),window.removeEventListener("pointerup",this.onPtrUp),window.removeEventListener("keydown",this.onPtrKey,!0)}handleRowDrop(o,t){o.preventDefault(),o.stopPropagation();const i=this.dragKey,r=this.dragOrderIds();if(this.resetDragState(),i===t||!r.includes(i)||!r.includes(t))return;const e=new Map(this.orderedItems.map((o=>[o._id,o]))),s=function(o,t,i,r){return r(t)||r(i)?o:function(o,t,i){if(t===i)return o;const r=o.indexOf(t),e=o.indexOf(i);if(-1===r||-1===e)return o;const s=[...o];return s.splice(e,0,s.splice(r,1)[0]),s}(o,t,i)}(r,i,t,(o=>{var t;return!!(null===(t=e.get(o))||void 0===t?void 0:t.pinned)}));s!==r&&this.coListReorder.emit({value:s,item:e.get(i)})}captureRowTops(){var o;const t=new Map;return null===(o=this.el.shadowRoot)||void 0===o||o.querySelectorAll(".co-option-list__option[data-id]").forEach((o=>t.set(o.dataset.id,o.getBoundingClientRect().top))),t}runFlip(){var o,t,i;if(!this.pendingFlip)return;const{tops:r,movedId:e,spring:s}=this.pendingFlip;this.pendingFlip=void 0;const a=Array.from(null!==(t=null===(o=this.el.shadowRoot)||void 0===o?void 0:o.querySelectorAll(".co-option-list__option[data-id]"))&&void 0!==t?t:[]),n=(null===(i=this.ptrDrag)||void 0===i?void 0:i.started)?this.ptrDrag.id:null;for(const o of a)o.dataset.id!==n&&(o.style.transition="none",o.style.transform="");const l=[];for(const o of a){const t=o.dataset.id;if(t===n)continue;const i=r.get(t);if(void 0===i)continue;const a=i-o.getBoundingClientRect().top;a&&l.push({row:o,delta:a,spring:s&&t===e})}for(const{row:o,delta:t}of l)o.style.transform=`translateY(${t}px)`;for(const o of a){if(o.dataset.id===n)continue;const t=l.find((t=>t.row===o));t?(o.style.transition="transform var(--co-motion-duration-base) "+(t.spring?"var(--co-motion-ease-spring)":"var(--co-motion-ease-out)"),o.style.transform="",o.addEventListener("transitionend",(()=>{o.style.transition=""}),{once:!0})):o.style.transition=""}}resetDragState(){this.armedKey="",this.dragKey="",this.overKey="",this.dropAfter=!1}maybeLoadMore(o,t,i){if(this.loading)return;const{hasMore:r}=v(this.parsedItems.length,this.total,this.hasMore);r&&o+t>=i-40&&this.coLoadMore.emit()}fillViewport(){var o,t;const i=this.parsedItems.length;if(this.loading||0===i||i===this.lastFillLen)return;const{hasMore:r}=v(i,this.total,this.hasMore);if(!r)return;const e=null!==(t=null===(o=this.osInstance)||void 0===o?void 0:o.elements().viewport)&&void 0!==t?t:this.optionsEl;e&&0!==e.clientHeight&&e.scrollHeight-e.clientHeight<=40&&(this.lastFillLen=i,this.coLoadMore.emit())}scrollActiveIntoView(){requestAnimationFrame((()=>{var o,t;null===(t=null===(o=this.el.shadowRoot)||void 0===o?void 0:o.getElementById(`co-optlist-${this.activeIndex}`))||void 0===t||t.scrollIntoView({block:"nearest"})}))}renderLeading(o){return o.image||o.avatar?e("co-avatar",{class:"co-option-list__avatar",type:o.image?"image":"text",src:o.image,text:o.avatar,color:o.color,size:"xxs",shape:this.avatarShape}):o.color?e("span",{class:"co-option-list__dot",style:{backgroundColor:o.color}}):o.icon?e("co-icon",{name:o.icon,size:16,class:"co-option-list__icon"}):null}renderLabelText(o){const t=this.effectiveHighlightTerm,i=t?s(o,t):null;return i?i.map((o=>o.match?e("span",{class:"co-option-list__match"},o.text):o.text)):o}renderBadge(o){const t=e("span",{class:"co-option-list__badge",style:o.color?{backgroundColor:o.color,color:"var(--co-color-base-blanco, #fff)"}:void 0},o.label);return o.tooltip?e("co-tooltip",{class:"co-option-list__badge-tip",content:o.tooltip},t):t}renderRow(o,t,i){const r=i.includes(o._id),s=!this.listDragActive&&this.reorderable&&this.selectedFirst&&r&&!this.term,a=this.listDragActive&&!o.pinned&&!this.term;return e("div",{class:{"co-option-list__option":!0,"co-option-list__option--selected":r,"co-option-list__option--active":t===this.activeIndex,"co-option-list__option--disabled":!!o.disabled,"co-option-list__option--dragging":this.listDragActive&&this.dragKey===o._id,"co-option-list__option--lifted":!this.listDragActive&&this.dragKey===o._id,"co-option-list__option--drop-before":this.listDragActive&&this.overKey===o._id&&!this.dropAfter,"co-option-list__option--drop-after":this.listDragActive&&this.overKey===o._id&&this.dropAfter},key:o._id,id:`co-optlist-${t}`,"data-id":o._id,role:"option","aria-selected":r?"true":"false","aria-disabled":o.disabled?"true":"false",draggable:a&&this.armedKey===o._id,onClick:()=>!o.disabled&&this.pick(o),onMouseEnter:()=>{this.activeIndex=t},onDragStart:a?t=>this.handleRowDragStart(t,o._id):void 0,onDragOver:a?t=>this.handleRowDragOver(t,o._id):void 0,onDrop:a?t=>this.handleRowDrop(t,o._id):void 0,onDragEnd:a?this.handleRowDragEnd:void 0,onDragLeave:a?t=>this.handleRowDragLeave(t,o._id):void 0},(s||a)&&e("span",{class:"co-option-list__drag-handle",part:"drag-handle",title:"Drag to reorder",onMouseDown:a?()=>this.armedKey=o._id:void 0,onPointerDown:s?t=>this.startPointerDrag(t,o._id):void 0,onClick:o=>o.stopPropagation()},e("co-icon",{name:"dots-six-vertical",size:16})),this.renderLeading(o),e("div",{class:"co-option-list__text"},e("span",{class:"co-option-list__title"},e("span",{class:"co-option-list__label",style:o.labelColor?{color:o.labelColor,fontWeight:"600"}:void 0},this.renderLabelText(o.label)),o.suffix&&"end"!==this.suffixAlign&&e("span",{class:"co-option-list__suffix"},"- ",o.suffix),o.badge&&this.renderBadge(o.badge)),o.description&&e("span",{class:"co-option-list__desc"},o.description)),o.suffix&&"end"===this.suffixAlign&&e("span",{class:"co-option-list__suffix co-option-list__suffix--end"},o.suffix),this.pinnable&&e("button",{class:{"co-option-list__pin":!0,"co-option-list__pin--active":!!o.pinned},type:"button",tabIndex:-1,"aria-label":o.pinned?`Unpin ${o.label}`:`Pin ${o.label}`,"aria-pressed":o.pinned?"true":"false",onClick:t=>{t.stopPropagation(),this.coPinToggle.emit({item:o})}},e("co-icon",{name:"push-pin",size:16,weight:o.pinned?"fill":"regular"})),r&&this.removableItems&&this.multiple&&e("button",{class:"co-option-list__row-action",type:"button",tabIndex:-1,"aria-label":`Remove ${o.label}`,onClick:t=>{t.stopPropagation(),this.coRemoveItem.emit(o._id)}},e("co-icon",{name:"x-circle",size:16,weight:"fill"})),r&&!this.removableItems&&"deselect"===this.selectedAffordance&&e("button",{class:"co-option-list__row-action",type:"button",tabIndex:-1,"aria-label":`Deselect ${o.label}`,onClick:t=>{t.stopPropagation(),this.deselectItem(o)}},e("co-icon",{name:"x-circle",size:16,weight:"fill"})),r&&!this.removableItems&&"check"===this.selectedAffordance&&e("co-icon",{name:"check",size:16,class:"co-option-list__check"}))}renderVirtual(o,t){const{totalHeight:i,startIdx:r,endIdx:s,offsetY:a}=function(o,t){const i=t*b,r=Math.max(0,Math.floor(o/b)-3);return{totalHeight:i,startIdx:r,endIdx:Math.min(t,r+8+6),offsetY:r*b}}(this.scrollTop,o.length);return e("div",{class:"co-option-list__spacer",style:{height:`${i}px`,position:"relative"}},e("div",{style:{position:"absolute",top:`${a}px`,left:"0",right:"0"}},o.slice(r,s).map(((o,i)=>this.renderRow(o,r+i,t)))))}render(){const o=this.orderedItems,t=this.selectedIds,{hasMore:i,remaining:r}=v(this.parsedItems.length,this.total,this.hasMore),s=!!this.clearOptionLabel&&t.length>0;return e("div",{key:"30f39e9cfe2472f1083768b6e974aa48672e63d0",class:"co-option-list",onKeyDown:this.onRootKeyDown},this.searchable&&e("div",{key:"f1c125c141ca8ceebae5c1ed0c786919c31805b3",class:"co-option-list__search",part:"search"},e("co-icon",{key:"d56810ca205984e7b2c56546930ce25ca70fda68",name:"magnifying-glass",size:16}),e("input",{key:"a85b35debe7b14c604a3262c7c04ee3b9ca41a6a",class:"co-option-list__search-input",type:"text",placeholder:this.searchPlaceholder,value:this.term,onInput:this.onSearchInput,ref:o=>this.searchInputEl=o,role:"combobox","aria-expanded":"true","aria-autocomplete":"list"})),e("div",{key:"ea5eecc218a228e07dd05d8f963518b4a8e0039f",class:"co-option-list__options",part:"options",role:"listbox","aria-multiselectable":this.multiple?"true":"false",ref:o=>this.optionsEl=o,onScroll:this.onNativeScroll},e("div",{key:"b27071cb3d629022fa6e926050fdc17b2051ef98",class:"co-option-list__inner"},s&&e("button",{key:"443791f8ee2d1f05a16c4002573264acf0a8de1b",class:"co-option-list__clear-row",type:"button",onClick:()=>this.coClearSelection.emit()},e("co-icon",{key:"ebe7e65669ff9eb76922ef76e21b9209658a444f",name:"x-circle",size:14}),e("span",{key:"82d2bcceb41ec5370e60ea9e25af91a2cbf11e70"},this.clearOptionLabel)),this.loading&&0===o.length&&e("div",{key:"9f60fedc78ee66d198623a5e3ac9b0f1569ddef4",class:"co-option-list__loading"},e("co-loader",{key:"ab7b1947e03af880cc608bef8639d7dc882a53b7",size:"sm"})),!this.loading&&0===o.length&&e("div",{key:"6b0870e6c5b2c25e2854431a28a2d6b56253ecf2",class:"co-option-list__empty"},e("co-icon",{key:"302d71e23e0d56104dfd04948201630ddbb4b078",name:"magnifying-glass",size:20}),e("span",{key:"fc580f9a50974ab22a7b648dbbe4ca17340094d8"},this.emptyMessage)),o.length>0&&this.virtual?this.renderVirtual(o,t):function(o){const t=[];let i,r=0;for(const e of o)e.group&&e.group!==i&&t.push({kind:"header",label:e.group}),i=e.group,t.push({kind:"item",item:e,index:r}),r++;return t}(o).map((o=>"header"===o.kind?e("div",{class:"co-option-list__group",role:"presentation"},o.label):this.renderRow(o.item,o.index,t))),this.loading&&o.length>0&&e("div",{key:"606a674960e4d16198ef36de4686de91ad742dde",class:"co-option-list__loading-more"},e("co-loader",{key:"933613b7b606399cd9eea3f877a4b2c77f269785",size:"sm"})),!this.loading&&i&&r>0&&e("div",{key:"6a6220513b6db222b57155c54afa805519e4b1b8",class:"co-option-list__more"},r," more results"))),e("slot",{key:"4d952742c39335d9f19c2e45f58ae6be3306857d",name:"footer"}))}get el(){return this}static get watchers(){return{items:[{onItemsChange:0}],value:[{onValueChange:0}]}}static get style(){return".os-size-observer,.os-size-observer-listener{scroll-behavior:auto !important;direction:inherit;pointer-events:none;overflow:hidden;visibility:hidden;box-sizing:border-box}.os-size-observer,.os-size-observer-listener,.os-size-observer-listener-item,.os-size-observer-listener-item-final{writing-mode:horizontal-tb;position:absolute;left:0;top:0}.os-size-observer{z-index:-1;contain:strict;display:flex;flex-direction:row;flex-wrap:nowrap;padding:inherit;border:inherit;box-sizing:inherit;margin:-133px;top:0;right:0;bottom:0;left:0;transform:scale(0.1)}.os-size-observer::before{content:\"\";flex:none;box-sizing:inherit;padding:10px;width:10px;height:10px}.os-size-observer-appear{animation:os-size-observer-appear-animation 1ms forwards}.os-size-observer-listener{box-sizing:border-box;position:relative;flex:auto;padding:inherit;border:inherit;margin:-133px;transform:scale(calc(1 / 0.1))}.os-size-observer-listener.ltr{margin-right:-266px;margin-left:0}.os-size-observer-listener.rtl{margin-left:-266px;margin-right:0}.os-size-observer-listener:empty::before{content:\"\";width:100%;height:100%}.os-size-observer-listener:empty::before,.os-size-observer-listener>.os-size-observer-listener-item{display:block;position:relative;padding:inherit;border:inherit;box-sizing:content-box;flex:auto}.os-size-observer-listener-scroll{box-sizing:border-box;display:flex}.os-size-observer-listener-item{right:0;bottom:0;overflow:hidden;direction:ltr;flex:none}.os-size-observer-listener-item-final{transition:none}@keyframes os-size-observer-appear-animation{from{cursor:auto}to{cursor:none}}.os-trinsic-observer{flex:none;box-sizing:border-box;position:relative;max-width:0px;max-height:1px;padding:0;margin:0;border:none;overflow:hidden;z-index:-1;height:0;top:calc(100% + 1px);contain:strict}.os-trinsic-observer:not(:empty){height:calc(100% + 1px);top:-1px}.os-trinsic-observer:not(:empty)>.os-size-observer{width:1000%;height:1000%;min-height:1px;min-width:1px}html[data-overlayscrollbars-body]{overflow:hidden}html[data-overlayscrollbars-body],html[data-overlayscrollbars-body]>body{width:100%;height:100%;margin:0}html[data-overlayscrollbars-body]>body{overflow:visible;margin:0}[data-overlayscrollbars]{position:relative}[data-overlayscrollbars~=host],[data-overlayscrollbars-padding]{display:flex;align-items:stretch !important;flex-direction:row !important;flex-wrap:nowrap !important;scroll-behavior:auto !important}[data-overlayscrollbars-padding],[data-overlayscrollbars-viewport]:not([data-overlayscrollbars]){box-sizing:inherit;position:relative;flex:auto;height:auto;width:100%;min-width:0;padding:0;margin:0;border:none;z-index:0}[data-overlayscrollbars-viewport]:not([data-overlayscrollbars]){--os-vaw:0;--os-vah:0;outline:none}[data-overlayscrollbars-viewport]:not([data-overlayscrollbars]):focus{outline:none}[data-overlayscrollbars-viewport][data-overlayscrollbars-viewport~=arrange]::before{content:\"\";position:absolute;pointer-events:none;z-index:-1;min-width:1px;min-height:1px;width:var(--os-vaw);height:var(--os-vah)}[data-overlayscrollbars~=host],[data-overlayscrollbars-padding]{overflow:hidden !important}[data-overlayscrollbars~=host][data-overlayscrollbars~=noClipping],[data-overlayscrollbars-padding~=noClipping]{overflow:visible !important}[data-overlayscrollbars-viewport]{--os-viewport-overflow-x:hidden;--os-viewport-overflow-y:hidden;overflow-x:var(--os-viewport-overflow-x);overflow-y:var(--os-viewport-overflow-y)}[data-overlayscrollbars-viewport~=overflowXVisible]{--os-viewport-overflow-x:visible}[data-overlayscrollbars-viewport~=overflowXHidden]{--os-viewport-overflow-x:hidden}[data-overlayscrollbars-viewport~=overflowXScroll]{--os-viewport-overflow-x:scroll}[data-overlayscrollbars-viewport~=overflowYVisible]{--os-viewport-overflow-y:visible}[data-overlayscrollbars-viewport~=overflowYHidden]{--os-viewport-overflow-y:hidden}[data-overlayscrollbars-viewport~=overflowYScroll]{--os-viewport-overflow-y:scroll}[data-overlayscrollbars-viewport~=overflowImportant]{overflow-x:var(--os-viewport-overflow-x) !important;overflow-y:var(--os-viewport-overflow-y) !important}[data-overlayscrollbars-viewport~=noContent]:not(#osFakeId){font-size:0 !important;line-height:0 !important}[data-overlayscrollbars-viewport~=noContent]:not(#osFakeId)::before,[data-overlayscrollbars-viewport~=noContent]:not(#osFakeId)::after,[data-overlayscrollbars-viewport~=noContent]:not(#osFakeId)>*:not(#osFakeId){display:none !important;position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border-width:0 !important}[data-overlayscrollbars-viewport~=measuring],[data-overlayscrollbars-viewport~=scrolling]{scroll-behavior:auto !important;scroll-snap-type:none !important}[data-overlayscrollbars-viewport~=measuring][data-overlayscrollbars-viewport~=overflowXVisible]{overflow-x:hidden !important}[data-overlayscrollbars-viewport~=measuring][data-overlayscrollbars-viewport~=overflowYVisible]{overflow-y:hidden !important}[data-overlayscrollbars-content]{box-sizing:inherit}[data-overlayscrollbars-contents]:not(#osFakeId):not([data-overlayscrollbars-padding]):not([data-overlayscrollbars-viewport]):not([data-overlayscrollbars-content]){display:contents}[data-overlayscrollbars-grid],[data-overlayscrollbars-grid] [data-overlayscrollbars-padding]{display:grid;grid-template:1fr/1fr}[data-overlayscrollbars-grid]>[data-overlayscrollbars-padding],[data-overlayscrollbars-grid]>[data-overlayscrollbars-viewport],[data-overlayscrollbars-grid]>[data-overlayscrollbars-padding]>[data-overlayscrollbars-viewport]{height:auto !important;width:auto !important}@property --os-scroll-percent{syntax:\"<number>\";inherits:true;initial-value:0}@property --os-viewport-percent{syntax:\"<number>\";inherits:true;initial-value:0}.os-scrollbar{--os-viewport-percent:0;--os-scroll-percent:0;--os-scroll-direction:0;--os-scroll-percent-directional:calc( var(--os-scroll-percent) - (var(--os-scroll-percent) + (1 - var(--os-scroll-percent)) * -1) * var(--os-scroll-direction) )}.os-scrollbar{contain:size layout;contain:size layout style;transition:opacity 0.15s, visibility 0.15s, top 0.15s, right 0.15s, bottom 0.15s, left 0.15s;pointer-events:none;position:absolute;opacity:0;visibility:hidden}body>.os-scrollbar{position:fixed;z-index:99999}.os-scrollbar-transitionless{transition:none !important}.os-scrollbar-track{position:relative;padding:0 !important;border:none !important}.os-scrollbar-handle{position:absolute}.os-scrollbar-track,.os-scrollbar-handle{pointer-events:none;width:100%;height:100%}.os-scrollbar.os-scrollbar-track-interactive .os-scrollbar-track,.os-scrollbar.os-scrollbar-handle-interactive .os-scrollbar-handle{pointer-events:auto;touch-action:none}.os-scrollbar-horizontal{bottom:0;left:0}.os-scrollbar-vertical{top:0;right:0}.os-scrollbar-rtl.os-scrollbar-horizontal{right:0}.os-scrollbar-rtl.os-scrollbar-vertical{right:auto;left:0}.os-scrollbar-visible{opacity:1;visibility:visible}.os-scrollbar-auto-hide.os-scrollbar-auto-hide-hidden{opacity:0;visibility:hidden}.os-scrollbar-interaction.os-scrollbar-visible{opacity:1;visibility:visible}.os-scrollbar-unusable,.os-scrollbar-unusable *,.os-scrollbar-wheel,.os-scrollbar-wheel *{pointer-events:none !important}.os-scrollbar-unusable .os-scrollbar-handle{opacity:0 !important;transition:none !important}.os-scrollbar-horizontal .os-scrollbar-handle{bottom:0;left:calc(var(--os-scroll-percent-directional) * 100%);transform:translateX(calc(var(--os-scroll-percent-directional) * -100%));width:calc(var(--os-viewport-percent) * 100%)}.os-scrollbar-vertical .os-scrollbar-handle{right:0;top:calc(var(--os-scroll-percent-directional) * 100%);transform:translateY(calc(var(--os-scroll-percent-directional) * -100%));height:calc(var(--os-viewport-percent) * 100%)}@supports (container-type: size){.os-scrollbar-track{container-type:size}.os-scrollbar-horizontal .os-scrollbar-handle{left:auto;transform:translateX(calc(var(--os-scroll-percent-directional) * 100cqw + var(--os-scroll-percent-directional) * -100%))}.os-scrollbar-vertical .os-scrollbar-handle{top:auto;transform:translateY(calc(var(--os-scroll-percent-directional) * 100cqh + var(--os-scroll-percent-directional) * -100%))}.os-scrollbar-rtl.os-scrollbar-horizontal .os-scrollbar-handle{right:auto;left:0}}.os-scrollbar-rtl.os-scrollbar-vertical .os-scrollbar-handle{right:auto;left:0}.os-scrollbar.os-scrollbar-horizontal.os-scrollbar-cornerless,.os-scrollbar.os-scrollbar-horizontal.os-scrollbar-cornerless.os-scrollbar-rtl{left:0;right:0}.os-scrollbar.os-scrollbar-vertical.os-scrollbar-cornerless,.os-scrollbar.os-scrollbar-vertical.os-scrollbar-cornerless.os-scrollbar-rtl{top:0;bottom:0}@media print{.os-scrollbar{display:none}}.os-scrollbar{--os-size:0;--os-padding-perpendicular:0;--os-padding-axis:0;--os-track-border-radius:0;--os-track-bg:none;--os-track-bg-hover:none;--os-track-bg-active:none;--os-track-border:none;--os-track-border-hover:none;--os-track-border-active:none;--os-handle-border-radius:0;--os-handle-bg:none;--os-handle-bg-hover:none;--os-handle-bg-active:none;--os-handle-border:none;--os-handle-border-hover:none;--os-handle-border-active:none;--os-handle-min-size:33px;--os-handle-max-size:none;--os-handle-perpendicular-size:100%;--os-handle-perpendicular-size-hover:100%;--os-handle-perpendicular-size-active:100%;--os-handle-interactive-area-offset:0}.os-scrollbar-track{border:var(--os-track-border);border-radius:var(--os-track-border-radius);background:var(--os-track-bg);transition:opacity 0.15s, background-color 0.15s, border-color 0.15s}.os-scrollbar-track:hover{border:var(--os-track-border-hover);background:var(--os-track-bg-hover)}.os-scrollbar-track:active{border:var(--os-track-border-active);background:var(--os-track-bg-active)}.os-scrollbar-handle{border:var(--os-handle-border);border-radius:var(--os-handle-border-radius);background:var(--os-handle-bg)}.os-scrollbar-handle:hover{border:var(--os-handle-border-hover);background:var(--os-handle-bg-hover)}.os-scrollbar-handle:active{border:var(--os-handle-border-active);background:var(--os-handle-bg-active)}.os-scrollbar-track:before,.os-scrollbar-handle:before{content:\"\";position:absolute;left:0;right:0;top:0;bottom:0;display:block}.os-scrollbar-horizontal{padding:var(--os-padding-perpendicular) var(--os-padding-axis);right:var(--os-size);height:var(--os-size)}.os-scrollbar-horizontal.os-scrollbar-rtl{left:var(--os-size);right:0}.os-scrollbar-horizontal .os-scrollbar-track:before{top:calc(var(--os-padding-perpendicular) * -1);bottom:calc(var(--os-padding-perpendicular) * -1)}.os-scrollbar-horizontal .os-scrollbar-handle{min-width:var(--os-handle-min-size);max-width:var(--os-handle-max-size);height:var(--os-handle-perpendicular-size);transition:opacity 0.15s, background-color 0.15s, border-color 0.15s, height 0.15s}.os-scrollbar-horizontal .os-scrollbar-handle:before{top:calc((var(--os-padding-perpendicular) + var(--os-handle-interactive-area-offset)) * -1);bottom:calc(var(--os-padding-perpendicular) * -1)}.os-scrollbar-horizontal:hover .os-scrollbar-handle{height:var(--os-handle-perpendicular-size-hover)}.os-scrollbar-horizontal:active .os-scrollbar-handle{height:var(--os-handle-perpendicular-size-active)}.os-scrollbar-vertical{padding:var(--os-padding-axis) var(--os-padding-perpendicular);bottom:var(--os-size);width:var(--os-size)}.os-scrollbar-vertical .os-scrollbar-track:before{left:calc(var(--os-padding-perpendicular) * -1);right:calc(var(--os-padding-perpendicular) * -1)}.os-scrollbar-vertical .os-scrollbar-handle{min-height:var(--os-handle-min-size);max-height:var(--os-handle-max-size);width:var(--os-handle-perpendicular-size);transition:opacity 0.15s, background-color 0.15s, border-color 0.15s, width 0.15s}.os-scrollbar-vertical .os-scrollbar-handle:before{left:calc((var(--os-padding-perpendicular) + var(--os-handle-interactive-area-offset)) * -1);right:calc(var(--os-padding-perpendicular) * -1)}.os-scrollbar-vertical.os-scrollbar-rtl .os-scrollbar-handle:before{right:calc((var(--os-padding-perpendicular) + var(--os-handle-interactive-area-offset)) * -1);left:calc(var(--os-padding-perpendicular) * -1)}.os-scrollbar-vertical:hover .os-scrollbar-handle{width:var(--os-handle-perpendicular-size-hover)}.os-scrollbar-vertical:active .os-scrollbar-handle{width:var(--os-handle-perpendicular-size-active)}[data-overlayscrollbars-viewport~=measuring]>.os-scrollbar,.os-theme-none.os-scrollbar{display:none !important}.os-theme-dark,.os-theme-light{box-sizing:border-box;--os-size:10px;--os-padding-perpendicular:2px;--os-padding-axis:2px;--os-track-border-radius:10px;--os-handle-interactive-area-offset:4px;--os-handle-border-radius:10px}.os-theme-dark{--os-handle-bg:rgba(0, 0, 0, 0.44);--os-handle-bg-hover:rgba(0, 0, 0, 0.55);--os-handle-bg-active:rgba(0, 0, 0, 0.66)}.os-theme-light{--os-handle-bg:rgba(255, 255, 255, 0.44);--os-handle-bg-hover:rgba(255, 255, 255, 0.55);--os-handle-bg-active:rgba(255, 255, 255, 0.66)}[data-overlayscrollbars-initialize]:not([data-overlayscrollbars-viewport]),[data-overlayscrollbars-viewport~=scrollbarHidden],html[data-overlayscrollbars-viewport~=scrollbarHidden]>body{scrollbar-width:none !important}[data-overlayscrollbars-initialize]:not([data-overlayscrollbars-viewport])::-webkit-scrollbar,[data-overlayscrollbars-initialize]:not([data-overlayscrollbars-viewport])::-webkit-scrollbar-corner,[data-overlayscrollbars-viewport~=scrollbarHidden]::-webkit-scrollbar,[data-overlayscrollbars-viewport~=scrollbarHidden]::-webkit-scrollbar-corner,html[data-overlayscrollbars-viewport~=scrollbarHidden]>body::-webkit-scrollbar,html[data-overlayscrollbars-viewport~=scrollbarHidden]>body::-webkit-scrollbar-corner{-webkit-appearance:none !important;appearance:none !important;display:none !important;width:0 !important;height:0 !important}[data-overlayscrollbars-initialize]:not([data-overlayscrollbars]):not(html):not(body){overflow:auto}:host{display:block;font-family:var(--co-font-family-primary, 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)}.co-option-list{display:flex;flex-direction:column;min-width:0}.co-option-list__search{display:flex;align-items:center;gap:var(--co-spacing-sm, 6px);height:32px;box-sizing:border-box;margin:var(--co-spacing-md, 12px) var(--co-spacing-md, 12px) 0;padding:0 var(--co-spacing-sm2, 8px) 0 var(--co-spacing-xs, 4px);border:1px solid var(--co-semantic-border-subtle, rgba(31, 28, 27, 0.08));border-radius:var(--co-border-radius-xs, 8px);color:var(--co-semantic-text-muted, #888888)}.co-option-list__search:focus-within{border-color:var(--co-semantic-border-focus, rgba(31, 28, 27, 0.25))}.co-option-list__search co-icon{flex-shrink:0;width:24px;display:flex;align-items:center;justify-content:center;opacity:0.7}.co-option-list__search-input{flex:1;min-width:0;border:0;outline:none;background:transparent;padding:0;font-family:var(--co-font-family-primary, 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--co-font-size-14, 14px);font-weight:500;letter-spacing:var(--co-font-letter-spacing-body, -0.03em);line-height:1;color:var(--co-semantic-text-default, #1f1c1b)}.co-option-list__search-input::placeholder{color:var(--co-semantic-text-muted, #888888)}.co-option-list__options{max-height:var(--co-option-list-max-height, 280px);overflow-y:auto;overflow-x:hidden;padding:var(--co-spacing-md, 12px)}.co-option-list__inner{display:flex;flex-direction:column;gap:var(--co-spacing-xxs, 2px);min-width:0}.os-scrollbar.os-theme-co{--os-size:10px;--os-padding-perpendicular:2px;--os-padding-axis:2px;--os-track-bg:transparent;--os-handle-border-radius:var(--co-border-radius-full, 9999px);--os-handle-bg:var(--co-color-opacity-negro-16, rgba(31, 28, 27, 0.16));--os-handle-bg-hover:var(--co-color-opacity-negro-25, rgba(31, 28, 27, 0.25));--os-handle-bg-active:var(--co-color-opacity-negro-50, rgba(31, 28, 27, 0.5));--os-handle-min-size:24px}.co-option-list__option{display:flex;align-items:center;gap:var(--co-spacing-sm2, 8px);min-width:0;min-height:var(--co-option-list-item-min-height, 32px);box-sizing:border-box;padding:var(--co-option-list-item-padding-y, var(--co-spacing-xs, 4px)) var(--co-spacing-sm2, 8px) var(--co-option-list-item-padding-y, var(--co-spacing-xs, 4px)) var(--co-spacing-xs, 4px);border-radius:var(--co-border-radius-xs, 8px);cursor:pointer;font-size:var(--co-font-size-14, 14px);letter-spacing:var(--co-font-letter-spacing-body, -0.03em);color:var(--co-semantic-text-default, #1f1c1b);transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), opacity var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-option-list__spacer .co-option-list__option{height:32px;margin-bottom:var(--co-spacing-xxs, 2px)}.co-option-list__option--active{background:var(--co-semantic-surface-hover, rgba(31, 28, 27, 0.04))}.co-option-list__option--selected{background:var(--co-semantic-surface-hover, rgba(31, 28, 27, 0.04))}.co-option-list__option--disabled{opacity:0.5;cursor:not-allowed}.co-option-list__avatar,.co-option-list__icon{flex-shrink:0}.co-option-list__icon{margin:0 var(--co-spacing-xs, 4px)}.co-option-list__dot{flex-shrink:0;width:10px;height:10px;margin:0 7px;border-radius:var(--co-border-radius-full, 9999px)}.co-option-list__text{display:flex;flex-direction:column;gap:var(--co-option-list-text-gap, var(--co-spacing-xxs, 2px));flex:1;min-width:0}.co-option-list__title{display:flex;align-items:center;gap:var(--co-spacing-xs, 4px);min-width:0}.co-option-list__label{font-weight:400;line-height:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-option-list__suffix{color:var(--co-semantic-text-secondary, #585858);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1}.co-option-list__suffix--end{flex-shrink:0;margin-left:auto;text-align:right;white-space:nowrap;font-size:var(--co-font-size-13, 13px);color:var(--co-semantic-text-default, #1f1c1b);font-variant-numeric:tabular-nums}.co-option-list__badge{flex-shrink:0;padding:0 var(--co-spacing-xs, 4px);border-radius:var(--co-border-radius-full, 9999px);background:var(--co-semantic-surface-hover, rgba(31, 28, 27, 0.04));color:var(--co-semantic-text-default, #1f1c1b);font-size:var(--co-font-size-10, 10px);font-weight:600;line-height:16px}.co-option-list__badge-tip{display:inline-flex;align-items:center;flex-shrink:0}.co-option-list__desc{font-size:var(--co-font-size-12, 12px);color:var(--co-semantic-text-muted, #888888);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-option-list__match{color:var(--co-color-primary-azul, #2563eb);font-weight:700}.co-option-list__check{flex-shrink:0;color:var(--co-semantic-text-default, #1f1c1b)}.co-option-list__row-action{flex-shrink:0;display:inline-flex;align-items:center;border:0;background:transparent;padding:0;cursor:pointer;color:var(--co-semantic-text-muted, #888888);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-option-list__row-action:hover{color:var(--co-semantic-text-default, #1f1c1b)}.co-option-list__pin{flex-shrink:0;display:flex;align-items:center;justify-content:center;border:0;padding:var(--co-spacing-xxs, 2px);background:transparent;cursor:pointer;border-radius:var(--co-border-radius-xxs, 4px);color:var(--co-semantic-text-muted, #888888)}.co-option-list__pin:hover{color:var(--co-semantic-text-default, #1f1c1b)}.co-option-list__pin--active{color:var(--co-semantic-text-default, #1f1c1b)}.co-option-list__drag-handle{display:inline-flex;align-items:center;cursor:grab;color:var(--co-semantic-text-muted);margin-right:var(--co-spacing-xs);flex:0 0 auto}.co-option-list__drag-handle:active{cursor:grabbing}.co-option-list__drag-handle{touch-action:none}.co-option-list__option--dragging{opacity:0.5}.co-option-list__option--lifted{position:relative;z-index:2;background:var(--co-semantic-surface-page, #fff);box-shadow:var(--co-shadow-lg);cursor:grabbing}.co-option-list__option--drop-before{box-shadow:inset 0 2px 0 0 var(--co-semantic-border-focus)}.co-option-list__option--drop-after{box-shadow:inset 0 -2px 0 0 var(--co-semantic-border-focus)}.co-option-list__group{padding:var(--co-spacing-sm2, 8px) var(--co-spacing-xs, 4px) var(--co-spacing-xs, 4px);font-family:var(--co-font-family-mono, 'Geist Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace);font-size:var(--co-font-size-10, 10px);font-weight:400;text-transform:uppercase;letter-spacing:var(--co-font-letter-spacing-overline, 0.08em);line-height:1.1;color:var(--co-semantic-text-default, #1f1c1b)}.co-option-list__clear-row{display:flex;align-items:center;gap:var(--co-spacing-sm2, 8px);width:100%;min-height:32px;box-sizing:border-box;border:0;background:transparent;padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm2, 8px);border-radius:var(--co-border-radius-xs, 8px);cursor:pointer;text-align:left;font-family:var(--co-font-family-primary, 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);font-size:var(--co-font-size-14, 14px);letter-spacing:var(--co-font-letter-spacing-body, -0.03em);color:var(--co-semantic-text-secondary, #585858)}.co-option-list__clear-row:hover{background:var(--co-semantic-surface-hover, rgba(31, 28, 27, 0.04))}.co-option-list__loading,.co-option-list__loading-more{display:flex;justify-content:center;padding:var(--co-spacing-sm, 6px)}.co-option-list__empty{display:flex;align-items:center;gap:var(--co-spacing-sm2, 8px);padding:var(--co-spacing-md, 12px) var(--co-spacing-xs, 4px);font-size:var(--co-font-size-14, 14px);color:var(--co-semantic-text-muted, #888888)}.co-option-list__more{padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm, 6px);font-size:var(--co-font-size-12, 12px);color:var(--co-semantic-text-muted, #888888);text-align:center}.co-option-list__option:focus-visible,.co-option-list__clear-row:focus-visible{outline:2px solid var(--co-semantic-border-focus, rgba(31, 28, 27, 0.25));outline-offset:-2px}"}},[257,"co-option-list",{items:[1],value:[1],selectedItems:[1,"selected-items"],multiple:[4],selectedFirst:[4,"selected-first"],selectedAffordance:[1,"selected-affordance"],removableItems:[4,"removable-items"],reorderable:[4],pinnable:[4],listReorderable:[4,"list-reorderable"],searchable:[516],searchPlaceholder:[1,"search-placeholder"],searchDebounce:[2,"search-debounce"],initialTerm:[1,"initial-term"],loading:[4],total:[2],hasMore:[4,"has-more"],emptyMessage:[1,"empty-message"],clearOptionLabel:[1,"clear-option-label"],virtual:[516],highlightMatches:[4,"highlight-matches"],highlightTerm:[1,"highlight-term"],avatarShape:[1,"avatar-shape"],suffixAlign:[513,"suffix-align"],autoHighlight:[4,"auto-highlight"],term:[32],activeIndex:[32],scrollTop:[32],armedKey:[32],dragKey:[32],overKey:[32],dropAfter:[32],displaySnapshot:[32],snapshotOrder:[64],focusSearch:[64],scrollToSelected:[64],handleKey:[64]},void 0,{items:[{onItemsChange:0}],value:[{onValueChange:0}]}]);function g(){"undefined"!=typeof customElements&&["co-option-list","co-avatar","co-icon","co-loader","co-tooltip"].forEach((t=>{switch(t){case"co-option-list":customElements.get(o(t))||customElements.define(o(t),f);break;case"co-avatar":customElements.get(o(t))||n();break;case"co-icon":customElements.get(o(t))||l();break;case"co-loader":customElements.get(o(t))||c();break;case"co-tooltip":customElements.get(o(t))||d()}}))}g();export{f as C,g as d}
@@ -1 +1 @@
1
- import{t as i,p as t,H as e,c as o,h as s,a as r}from"./index.js";import{d as a}from"./p-DNJAIVfI.js";const n={es:{play:"Reproducir",pause:"Pausar",mute:"Silenciar",unmute:"Activar sonido",volume:"Volumen",fullscreen:"Pantalla completa",exitFullscreen:"Salir de pantalla completa",speed:"Velocidad",pip:"Imagen en imagen",exitPip:"Salir de imagen en imagen",download:"Descargar",seek:"Buscar",normal:"Normal",error:"Error al reproducir el video",retry:"Reintentar",player:"Reproductor de video"},en:{play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",volume:"Volume",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",speed:"Speed",pip:"Picture in picture",exitPip:"Exit picture in picture",download:"Download",seek:"Seek",normal:"Normal",error:"Error playing video",retry:"Retry",player:"Video player"},pt:{play:"Reproduzir",pause:"Pausar",mute:"Silenciar",unmute:"Ativar som",volume:"Volume",fullscreen:"Tela cheia",exitFullscreen:"Sair da tela cheia",speed:"Velocidade",pip:"Imagem em imagem",exitPip:"Sair de imagem em imagem",download:"Baixar",seek:"Buscar",normal:"Normal",error:"Erro ao reproduzir o vídeo",retry:"Tentar novamente",player:"Reprodutor de vídeo"}},h={1:{es:"La carga del video fue interrumpida",en:"Video loading was aborted",pt:"O carregamento do vídeo foi interrompido"},2:{es:"Error de red al cargar el video",en:"Network error while loading video",pt:"Erro de rede ao carregar o vídeo"},3:{es:"Error al decodificar el video",en:"Error decoding video",pt:"Erro ao decodificar o vídeo"},4:{es:"Formato de video no soportado",en:"Video format not supported",pt:"Formato de vídeo não suportado"}},c=t(class extends e{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.coPlay=o(this,"coPlay",7),this.coPause=o(this,"coPause",7),this.coEnded=o(this,"coEnded",7),this.coReady=o(this,"coReady",7),this.coError=o(this,"coError",7),this.coTimeUpdate=o(this,"coTimeUpdate",3),this.coSeeked=o(this,"coSeeked",7),this.coVolumeChange=o(this,"coVolumeChange",7),this.coFullscreenChange=o(this,"coFullscreenChange",7),this.coPlaybackRateChange=o(this,"coPlaybackRateChange",7),this.coPipChange=o(this,"coPipChange",7),this.coDownload=o(this,"coDownload",7),this.coThresholdReached=o(this,"coThresholdReached",7),this.src="",this.poster="",this.type="",this.preload="metadata",this.autoplay=!1,this.loop=!1,this.muted=!1,this.volume=1,this.currentTime=0,this.playbackRate=1,this.playbackRates="[0.5, 0.75, 1, 1.25, 1.5, 2]",this.controls=!0,this.showPlay=!0,this.showVolume=!0,this.showProgress=!0,this.showTime=!0,this.showFullscreen=!0,this.showSpeed=!1,this.showPip=!1,this.showDownload=!1,this.allowDownload=!1,this.aspectRatio="16:9",this.rounded="lg",this.controlsAutoHide=!0,this.controlsAutoHideDelay=3e3,this.disabled=!1,this.watchThreshold=0,this.locale="es",this.isPlaying=!1,this.internalCurrentTime=0,this.duration=0,this.buffered=0,this.volumeLevel=1,this.isMuted=!1,this.isFullscreen=!1,this.internalPlaybackRate=1,this.isLoading=!0,this.showControlBar=!0,this.hasError=!1,this.errorMessage="",this.showSpeedMenu=!1,this.isPip=!1,this.thresholdFired=!1,this.hasStarted=!1,this.isSeeking=!1,this.showVolumeSlider=!1,this.lastTimeUpdateEmit=0,this.parsedRates=[.5,.75,1,1.25,1.5,2],this.seekFromTime=0,this.externalTimeUpdate=!1,this.resetControlsTimer=()=>{this.controlsAutoHide&&this.controls&&(this.showControlBar=!0,this.controlsTimer&&clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout((()=>{this.isPlaying&&!this.showSpeedMenu&&(this.showControlBar=!1)}),this.controlsAutoHideDelay))},this.handleContainerMouseMove=()=>{this.resetControlsTimer()},this.handleContainerMouseLeave=()=>{this.isPlaying&&this.controlsAutoHide&&(this.showControlBar=!1,this.showSpeedMenu=!1)},this.handleContainerTouchStart=()=>{this.controlsAutoHide&&(this.showControlBar&&this.isPlaying?this.showControlBar=!1:this.resetControlsTimer())},this.onLoadedMetadata=()=>{this.videoEl&&(this.duration=this.videoEl.duration,this.hasError=!1,this.coReady.emit({duration:this.duration,width:this.videoEl.videoWidth,height:this.videoEl.videoHeight}),this.currentTime>0&&this.currentTime<this.duration&&(this.videoEl.currentTime=this.currentTime))},this.onPlay=()=>{this.isPlaying=!0,this.hasStarted=!0,this.coPlay.emit(),this.resetControlsTimer()},this.onPause=()=>{this.isPlaying=!1,this.showControlBar=!0,this.coPause.emit(),this.controlsTimer&&clearTimeout(this.controlsTimer)},this.onEnded=()=>{this.isPlaying=!1,this.showControlBar=!0,this.coEnded.emit()},this.onTimeUpdate=()=>{if(!this.videoEl||this.isSeeking)return;this.internalCurrentTime=this.videoEl.currentTime,this.externalTimeUpdate=!0,this.currentTime=this.videoEl.currentTime;const i=performance.now();if(i-this.lastTimeUpdateEmit>250){this.lastTimeUpdateEmit=i;const t=this.duration>0?Math.round(this.internalCurrentTime/this.duration*100):0;this.coTimeUpdate.emit({currentTime:this.internalCurrentTime,duration:this.duration,progressPercent:t}),this.watchThreshold>0&&!this.thresholdFired&&t>=this.watchThreshold&&(this.thresholdFired=!0,this.coThresholdReached.emit({threshold:this.watchThreshold,currentTime:this.internalCurrentTime,duration:this.duration}))}},this.onWaiting=()=>{this.isLoading=!0},this.onCanPlay=()=>{this.isLoading=!1},this.onError=()=>{var i,t;if(!(null===(i=this.videoEl)||void 0===i?void 0:i.error))return;const e=this.videoEl.error.code,o=(null===(t=h[e])||void 0===t?void 0:t[this.locale])||this.t.error;this.hasError=!0,this.errorMessage=o,this.isLoading=!1,this.coError.emit({code:e,message:o})},this.onProgress=()=>{if(!this.videoEl||this.duration<=0)return;const i=this.videoEl.buffered;i.length>0&&(this.buffered=i.end(i.length-1)/this.duration*100)},this.onNativeVolumeChange=()=>{this.videoEl&&(this.volumeLevel=this.videoEl.volume,this.isMuted=this.videoEl.muted,this.volume=this.videoEl.volume,this.muted=this.videoEl.muted,this.coVolumeChange.emit({volume:this.volumeLevel,muted:this.isMuted}))},this.onNativeRateChange=()=>{this.videoEl&&(this.internalPlaybackRate=this.videoEl.playbackRate,this.playbackRate=this.videoEl.playbackRate,this.coPlaybackRateChange.emit({rate:this.internalPlaybackRate}))},this.handlePlayClick=()=>{!this.disabled&&this.videoEl&&(this.isPlaying?this.videoEl.pause():this.videoEl.play().catch((()=>{})))},this.handleBigPlayClick=()=>{this.disabled||this.handlePlayClick()},this.handleMuteClick=()=>{!this.disabled&&this.videoEl&&(this.videoEl.muted=!this.videoEl.muted)},this.isDraggingVolume=!1,this.handleVolumeMouseEnter=()=>{this.showVolumeSlider=!0},this.handleVolumeMouseLeave=()=>{this.isDraggingVolume||(this.showVolumeSlider=!1)},this.handleProgressPointerDown=i=>{if(this.disabled||!this.videoEl)return;i.preventDefault(),this.isSeeking=!0,this.seekFromTime=this.videoEl.currentTime,this.seekFromPointerEvent(i);const t=i=>this.seekFromPointerEvent(i),e=()=>{this.videoEl&&this.coSeeked.emit({from:this.seekFromTime,to:this.videoEl.currentTime}),this.isSeeking=!1,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",e)};document.addEventListener("pointermove",t),document.addEventListener("pointerup",e)},this.handleVolumePointerDown=i=>{if(this.disabled||!this.videoEl)return;i.preventDefault(),i.stopPropagation(),this.isDraggingVolume=!0,this.showVolumeSlider=!0,this.setVolumeFromPointerEvent(i);const t=i=>this.setVolumeFromPointerEvent(i),e=()=>{this.isDraggingVolume=!1,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",e)};document.addEventListener("pointermove",t),document.addEventListener("pointerup",e)},this.handleSpeedClick=i=>{i.stopPropagation(),this.showSpeedMenu=!this.showSpeedMenu},this.handleSpeedSelect=i=>{!this.disabled&&this.videoEl&&(this.videoEl.playbackRate=i,this.showSpeedMenu=!1)},this.handleFullscreenClick=()=>{if(!this.disabled)if(document.fullscreenElement||document.webkitFullscreenElement)document.exitFullscreen?document.exitFullscreen().catch((()=>{})):document.webkitExitFullscreen&&document.webkitExitFullscreen();else{const i=this.el;i.requestFullscreen?i.requestFullscreen().catch((()=>{})):i.webkitRequestFullscreen?i.webkitRequestFullscreen():this.videoEl&&this.videoEl.webkitEnterFullscreen&&this.videoEl.webkitEnterFullscreen()}},this.handleFullscreenChange=()=>{const i=document.fullscreenElement||document.webkitFullscreenElement;this.isFullscreen=i===this.el,this.coFullscreenChange.emit({fullscreen:this.isFullscreen})},this.handlePipClick=async()=>{if(!this.disabled&&this.videoEl)try{this.isPip?await document.exitPictureInPicture():await this.videoEl.requestPictureInPicture()}catch(i){}},this.handleEnterPip=()=>{this.isPip=!0,this.coPipChange.emit({pip:!0})},this.handleLeavePip=()=>{this.isPip=!1,this.coPipChange.emit({pip:!1})},this.handleDownloadClick=()=>{if(!this.allowDownload||!this.src)return;this.coDownload.emit({src:this.src});const i=document.createElement("a");i.href=this.src,i.download="",i.target="_blank",i.rel="noopener",document.body.appendChild(i),i.click(),document.body.removeChild(i)},this.handleRetryClick=()=>{this.videoEl&&(this.hasError=!1,this.errorMessage="",this.isLoading=!0,this.videoEl.load())},this.handleKeyDown=i=>{var t,e;if(this.disabled||!this.videoEl)return;const o=null===(e=null===(t=i.target)||void 0===t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase();if("input"!==o&&"textarea"!==o)switch(i.key){case" ":case"k":case"K":i.preventDefault(),this.handlePlayClick();break;case"ArrowRight":i.preventDefault(),this.videoEl.currentTime=Math.min(this.duration,this.videoEl.currentTime+5);break;case"ArrowLeft":i.preventDefault(),this.videoEl.currentTime=Math.max(0,this.videoEl.currentTime-5);break;case"ArrowUp":i.preventDefault(),this.videoEl.volume=Math.min(1,this.videoEl.volume+.1);break;case"ArrowDown":i.preventDefault(),this.videoEl.volume=Math.max(0,this.videoEl.volume-.1);break;case"m":case"M":i.preventDefault(),this.handleMuteClick();break;case"f":case"F":i.preventDefault(),this.handleFullscreenClick();break;case"Escape":this.showSpeedMenu&&(i.preventDefault(),this.showSpeedMenu=!1)}},this.handleVideoAreaClick=()=>{this.disabled||(this.handlePlayClick(),this.resetControlsTimer())}}get t(){return n[this.locale]||n.es}get progressPercent(){return this.duration<=0?0:this.internalCurrentTime/this.duration*100}get pipSupported(){return"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}onSrcChange(){this.resetState()}onMutedChange(){this.videoEl&&(this.videoEl.muted=this.muted),this.isMuted=this.muted}onVolumeChange(){const i=Math.max(0,Math.min(1,this.volume));this.videoEl&&(this.videoEl.volume=i),this.volumeLevel=i}onCurrentTimeChange(){this.externalTimeUpdate?this.externalTimeUpdate=!1:this.videoEl&&Math.abs(this.videoEl.currentTime-this.currentTime)>.5&&(this.videoEl.currentTime=this.currentTime)}onPlaybackRateChange(){this.videoEl&&(this.videoEl.playbackRate=this.playbackRate),this.internalPlaybackRate=this.playbackRate}onPlaybackRatesChange(){this.parseRates()}componentWillLoad(){var i,t;this.parseRates(),this.volumeLevel=Math.max(0,Math.min(1,null!==(i=this.volume)&&void 0!==i?i:1)),this.isMuted=null!==(t=this.muted)&&void 0!==t&&t,this.internalPlaybackRate=this.playbackRate||1}componentDidLoad(){this.videoEl&&(this.bindVideoEvents(),this.videoEl.volume=this.volumeLevel,this.videoEl.muted=this.isMuted,this.videoEl.playbackRate=this.internalPlaybackRate,this.videoEl.readyState>=1&&this.onLoadedMetadata(),this.videoEl.readyState>=3&&this.onCanPlay(),this.autoplay&&this.muted&&this.videoEl.play().catch((()=>{}))),document.addEventListener("fullscreenchange",this.handleFullscreenChange),document.addEventListener("webkitfullscreenchange",this.handleFullscreenChange)}disconnectedCallback(){this.controlsTimer&&clearTimeout(this.controlsTimer),document.removeEventListener("fullscreenchange",this.handleFullscreenChange),document.removeEventListener("webkitfullscreenchange",this.handleFullscreenChange),this.videoEl&&(this.videoEl.removeEventListener("loadedmetadata",this.onLoadedMetadata),this.videoEl.removeEventListener("play",this.onPlay),this.videoEl.removeEventListener("pause",this.onPause),this.videoEl.removeEventListener("ended",this.onEnded),this.videoEl.removeEventListener("timeupdate",this.onTimeUpdate),this.videoEl.removeEventListener("waiting",this.onWaiting),this.videoEl.removeEventListener("canplay",this.onCanPlay),this.videoEl.removeEventListener("error",this.onError),this.videoEl.removeEventListener("progress",this.onProgress),this.videoEl.removeEventListener("volumechange",this.onNativeVolumeChange),this.videoEl.removeEventListener("ratechange",this.onNativeRateChange),this.videoEl.removeEventListener("enterpictureinpicture",this.handleEnterPip),this.videoEl.removeEventListener("leavepictureinpicture",this.handleLeavePip))}async play(){var i;await(null===(i=this.videoEl)||void 0===i?void 0:i.play())}async pause(){var i;null===(i=this.videoEl)||void 0===i||i.pause()}async togglePlay(){var i,t;this.isPlaying?null===(i=this.videoEl)||void 0===i||i.pause():await(null===(t=this.videoEl)||void 0===t?void 0:t.play())}async seek(i){this.videoEl&&(this.videoEl.currentTime=i)}async setVolume(i){const t=Math.max(0,Math.min(1,i));this.volume=t,this.videoEl&&(this.videoEl.volume=t),this.volumeLevel=t}async toggleMute(){this.handleMuteClick()}async toggleFullscreen(){this.handleFullscreenClick()}async togglePip(){this.handlePipClick()}parseRates(){try{const i=JSON.parse(this.playbackRates);Array.isArray(i)&&(this.parsedRates=i.filter((i=>"number"==typeof i&&i>0)).sort(((i,t)=>i-t)))}catch(i){this.parsedRates=[.5,.75,1,1.25,1.5,2]}}resetState(){this.isPlaying=!1,this.internalCurrentTime=0,this.duration=0,this.buffered=0,this.hasError=!1,this.errorMessage="",this.thresholdFired=!1,this.hasStarted=!1,this.isLoading=!0,this.showSpeedMenu=!1}bindVideoEvents(){this.videoEl&&(this.videoEl.addEventListener("loadedmetadata",this.onLoadedMetadata),this.videoEl.addEventListener("play",this.onPlay),this.videoEl.addEventListener("pause",this.onPause),this.videoEl.addEventListener("ended",this.onEnded),this.videoEl.addEventListener("timeupdate",this.onTimeUpdate),this.videoEl.addEventListener("waiting",this.onWaiting),this.videoEl.addEventListener("canplay",this.onCanPlay),this.videoEl.addEventListener("error",this.onError),this.videoEl.addEventListener("progress",this.onProgress),this.videoEl.addEventListener("volumechange",this.onNativeVolumeChange),this.videoEl.addEventListener("ratechange",this.onNativeRateChange),this.videoEl.addEventListener("enterpictureinpicture",this.handleEnterPip),this.videoEl.addEventListener("leavepictureinpicture",this.handleLeavePip))}formatTime(i){if(!isFinite(i)||i<0)return"0:00";const t=Math.floor(i/3600),e=Math.floor(i%3600/60),o=Math.floor(i%60);return t>0?`${t}:${e.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${e}:${o.toString().padStart(2,"0")}`}seekFromPointerEvent(i){if(!this.progressTrackEl||!this.videoEl)return;const t=this.progressTrackEl.getBoundingClientRect(),e=Math.max(0,Math.min(1,(i.clientX-t.left)/t.width))*this.duration;this.videoEl.currentTime=e,this.internalCurrentTime=e}setVolumeFromPointerEvent(i){if(!this.volumeTrackEl||!this.videoEl)return;const t=this.volumeTrackEl.getBoundingClientRect(),e=Math.max(0,Math.min(1,(i.clientX-t.left)/t.width));this.videoEl.volume=e,e>0&&this.videoEl.muted&&(this.videoEl.muted=!1)}renderBigPlayButton(){return this.isPlaying||this.hasError||this.isLoading?null:s("button",{class:"co-video__big-play",part:"big-play",onClick:this.handleBigPlayClick,"aria-label":this.t.play,tabindex:"-1"},s("div",{class:"co-video__big-play-circle"},s("co-icon",{name:"play",size:32,weight:"fill"})))}renderPoster(){return!this.poster||this.hasStarted?null:s("div",{class:"co-video__poster",part:"poster",style:{backgroundImage:`url(${this.poster})`}})}renderLoader(){return!this.isLoading||this.hasError?null:s("div",{class:"co-video__loader"},s("div",{class:"co-video__spinner"}))}renderError(){return this.hasError?s("div",{class:"co-video__error"},s("co-icon",{name:"warning-circle",size:48,weight:"regular"}),s("p",{class:"co-video__error-text"},this.errorMessage||this.t.error),s("button",{class:"co-video__error-retry",onClick:this.handleRetryClick},s("co-icon",{name:"arrow-clockwise",size:16,weight:"bold"}),this.t.retry)):null}renderProgressBar(){if(!this.showProgress)return null;const i=this.progressPercent,t=this.buffered;return s("div",{class:"co-video__progress",part:"progress",role:"slider","aria-label":this.t.seek,"aria-valuenow":Math.round(this.internalCurrentTime),"aria-valuemin":0,"aria-valuemax":Math.round(this.duration),tabindex:0,ref:i=>this.progressTrackEl=i,onPointerDown:this.handleProgressPointerDown},s("div",{class:"co-video__progress-track"},s("div",{class:"co-video__progress-buffered",style:{width:`${t}%`}}),s("div",{class:"co-video__progress-played",style:{width:`${i}%`}})),s("div",{class:"co-video__progress-thumb",style:{left:`${i}%`}}))}renderVolumeControl(){if(!this.showVolume)return null;const i=this.isMuted?0:100*this.volumeLevel;return s("div",{class:"co-video__volume",onMouseEnter:this.handleVolumeMouseEnter,onMouseLeave:this.handleVolumeMouseLeave},s("button",{class:"co-video__btn",onClick:this.handleMuteClick,"aria-label":this.isMuted?this.t.unmute:this.t.mute},s("co-icon",{name:this.isMuted||0===this.volumeLevel?"speaker-x":this.volumeLevel<.5?"speaker-low":"speaker-high",size:20,weight:"fill"})),s("div",{class:{"co-video__volume-slider-wrap":!0,"co-video__volume-slider-wrap--visible":this.showVolumeSlider}},s("div",{class:"co-video__volume-slider",onPointerDown:this.handleVolumePointerDown,role:"slider","aria-label":this.t.volume,"aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100},s("div",{class:"co-video__volume-track",ref:i=>this.volumeTrackEl=i},s("div",{class:"co-video__volume-fill",style:{width:`${i}%`}}),s("div",{class:"co-video__volume-thumb",style:{left:`${i}%`}})))))}renderSpeedMenu(){return this.showSpeed?s("div",{class:"co-video__speed-wrap"},s("button",{class:"co-video__btn co-video__btn--speed",onClick:this.handleSpeedClick,"aria-label":this.t.speed,"aria-haspopup":"listbox","aria-expanded":this.showSpeedMenu?"true":"false"},s("span",{class:"co-video__speed-label"},1===this.internalPlaybackRate?"1x":`${this.internalPlaybackRate}x`)),this.showSpeedMenu&&s("div",{class:"co-video__speed-menu",role:"listbox","aria-label":this.t.speed},this.parsedRates.map((i=>s("button",{class:{"co-video__speed-option":!0,"co-video__speed-option--active":i===this.internalPlaybackRate},role:"option","aria-selected":i===this.internalPlaybackRate?"true":"false",onClick:()=>this.handleSpeedSelect(i)},s("span",null,1===i?this.t.normal:`${i}x`),i===this.internalPlaybackRate&&s("co-icon",{name:"check",size:14,weight:"bold"})))))):null}renderControls(){return this.controls?s("div",{class:{"co-video__controls":!0,"co-video__controls--hidden":!this.showControlBar},part:"controls",onClick:i=>i.stopPropagation()},this.renderProgressBar(),s("div",{class:"co-video__toolbar",part:"toolbar"},s("div",{class:"co-video__toolbar-left"},this.showPlay&&s("button",{class:"co-video__btn",onClick:this.handlePlayClick,"aria-label":this.isPlaying?this.t.pause:this.t.play},s("co-icon",{name:this.isPlaying?"pause":"play",size:20,weight:"fill"})),this.renderVolumeControl(),this.showTime&&s("span",{class:"co-video__time","aria-live":"off"},this.formatTime(this.internalCurrentTime)," / ",this.formatTime(this.duration))),s("div",{class:"co-video__toolbar-right"},this.renderSpeedMenu(),this.showPip&&this.pipSupported&&s("button",{class:"co-video__btn",onClick:this.handlePipClick,"aria-label":this.isPip?this.t.exitPip:this.t.pip},s("co-icon",{name:"picture-in-picture",size:20,weight:this.isPip?"fill":"regular"})),this.showDownload&&s("button",{class:{"co-video__btn":!0,"co-video__btn--disabled":!this.allowDownload},onClick:this.handleDownloadClick,"aria-label":this.t.download,disabled:!this.allowDownload},s("co-icon",{name:"download-simple",size:20,weight:"regular"})),this.showFullscreen&&s("button",{class:"co-video__btn",onClick:this.handleFullscreenClick,"aria-label":this.isFullscreen?this.t.exitFullscreen:this.t.fullscreen},s("co-icon",{name:this.isFullscreen?"corners-in":"corners-out",size:20,weight:"regular"}))))):null}render(){const i=`co-video--${this.aspectRatio.replace(":","-")}`;return s(r,{key:"61eac04c652cdce63bd06c3103e632ee4bd2d791"},s("div",{key:"52180564b673a7d1ce91922636fc333242f8043d",class:{"co-video":!0,[i]:!0,[`co-video--rounded-${this.rounded}`]:!0,"co-video--disabled":this.disabled,"co-video--fullscreen":this.isFullscreen,"co-video--playing":this.isPlaying},part:"container",ref:i=>this.containerEl=i,role:"region","aria-label":this.t.player,tabindex:0,onKeyDown:this.handleKeyDown,onMouseMove:this.handleContainerMouseMove,onMouseLeave:this.handleContainerMouseLeave,onTouchStart:this.handleContainerTouchStart},s("video",{key:"8351b12f368bc6a4903aca40665ec5fb0f559592",ref:i=>this.videoEl=i,class:"co-video__native",part:"video",src:this.src||void 0,poster:void 0,preload:this.preload,loop:this.loop,playsinline:!0,tabindex:-1,controlsList:this.allowDownload?void 0:"nodownload"}),this.renderPoster(),this.renderLoader(),this.renderBigPlayButton(),this.renderError(),s("div",{key:"a0bd076367f9a65bf1c023c6cf5ef37a3314565d",class:"co-video__click-area",onClick:this.handleVideoAreaClick}),this.renderControls()))}get el(){return this}static get watchers(){return{src:[{onSrcChange:0}],muted:[{onMutedChange:0}],volume:[{onVolumeChange:0}],currentTime:[{onCurrentTimeChange:0}],playbackRate:[{onPlaybackRateChange:0}],playbackRates:[{onPlaybackRatesChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);--co-video-controls-bg:linear-gradient(transparent, rgba(0, 0, 0, 0.75));--co-video-controls-color:#fff;--co-video-progress-height:4px;--co-video-progress-height-hover:8px;--co-video-accent:var(--co-color-base-blanco);--co-video-buffered:rgba(255, 255, 255, 0.25);--co-video-btn-hover:rgba(255, 255, 255, 0.16)}.co-video{position:relative;width:100%;background:#000;overflow:hidden;outline:none;user-select:none;-webkit-user-select:none}.co-video:focus-visible{outline:2px solid var(--co-semantic-border-focus-ring);outline-offset:2px}.co-video--16-9{aspect-ratio:16 / 9}.co-video--4-3{aspect-ratio:4 / 3}.co-video--1-1{aspect-ratio:1 / 1}.co-video--21-9{aspect-ratio:21 / 9}.co-video--auto{height:100%}.co-video--rounded-none{border-radius:0}.co-video--rounded-sm{border-radius:var(--co-border-radius-xs)}.co-video--rounded-md{border-radius:var(--co-border-radius-sm)}.co-video--rounded-lg{border-radius:var(--co-border-radius-lg)}.co-video--rounded-xl{border-radius:var(--co-border-radius-xl)}:host(:fullscreen){width:100%;height:100%}:host(:fullscreen) .co-video{border-radius:0 !important;aspect-ratio:unset;width:100%;height:100%}.co-video--disabled{opacity:0.5;pointer-events:none}.co-video__native{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}.co-video__click-area{position:absolute;inset:0;z-index:1;cursor:pointer}.co-video__poster{position:absolute;inset:0;z-index:1;background-size:cover;background-position:center;background-repeat:no-repeat}.co-video__loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:3;pointer-events:none}.co-video__spinner{width:40px;height:40px;border:3px solid rgba(255, 255, 255, 0.15);border-top-color:#fff;border-radius:50%;animation:co-video-spin 0.7s linear infinite}@keyframes co-video-spin{to{transform:rotate(360deg)}}.co-video__big-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:2;cursor:pointer;background:transparent;border:none;padding:0;color:#fff}.co-video__big-play-circle{width:72px;height:72px;border-radius:var(--co-border-radius-full);background:rgba(0, 0, 0, 0.5);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out), background var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-video__big-play:hover .co-video__big-play-circle{transform:scale(1.1);background:rgba(0, 0, 0, 0.7)}.co-video__error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--co-spacing-md);z-index:4;background:rgba(0, 0, 0, 0.85);color:#fff}.co-video__error-text{font-size:var(--co-font-size-14);color:rgba(255, 255, 255, 0.7);margin:0;text-align:center;padding:0 var(--co-spacing-xl)}.co-video__error-retry{display:inline-flex;align-items:center;gap:var(--co-spacing-xs);padding:var(--co-spacing-sm2) var(--co-spacing-lg);border:1px solid rgba(255, 255, 255, 0.3);border-radius:var(--co-border-radius-full);background:transparent;color:#fff;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-video__error-retry:hover{background:rgba(255, 255, 255, 0.1);border-color:rgba(255, 255, 255, 0.5)}.co-video__controls{position:absolute;bottom:0;left:0;right:0;background:var(--co-video-controls-bg);padding:var(--co-spacing-3xl) var(--co-spacing-lg) var(--co-spacing-md);z-index:5;opacity:1;transition:opacity var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-video__controls--hidden{opacity:0;pointer-events:none}.co-video__progress{position:relative;width:100%;height:var(--co-video-progress-height);cursor:pointer;transition:height var(--co-motion-duration-fast) var(--co-motion-ease-out);margin-bottom:var(--co-spacing-sm);outline:none;touch-action:none}.co-video__progress:hover,.co-video__progress:focus-visible{height:var(--co-video-progress-height-hover)}.co-video__progress:focus-visible{outline:2px solid var(--co-semantic-border-focus-ring);outline-offset:4px;border-radius:var(--co-border-radius-full)}.co-video__progress-track{position:absolute;inset:0;background:rgba(255, 255, 255, 0.2);border-radius:var(--co-border-radius-full);overflow:hidden}.co-video__progress-buffered{position:absolute;top:0;left:0;height:100%;background:var(--co-video-buffered);border-radius:var(--co-border-radius-full);transition:width var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-video__progress-played{position:absolute;top:0;left:0;height:100%;background:var(--co-video-accent);border-radius:var(--co-border-radius-full)}.co-video__progress-thumb{position:absolute;top:50%;width:14px;height:14px;border-radius:var(--co-border-radius-full);background:var(--co-video-accent);transform:translate(-50%, -50%) scale(0);transition:transform var(--co-motion-duration-fast) var(--co-motion-ease-out);pointer-events:none}.co-video__progress:hover .co-video__progress-thumb{transform:translate(-50%, -50%) scale(1)}.co-video__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm)}.co-video__toolbar-left,.co-video__toolbar-right{display:flex;align-items:center;gap:var(--co-spacing-sm)}.co-video__btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;background:transparent;color:var(--co-video-controls-color);cursor:pointer;border-radius:var(--co-border-radius-xs);padding:0;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-video__btn:hover{background:var(--co-video-btn-hover)}.co-video__btn:focus-visible{outline:2px solid #fff;outline-offset:2px}.co-video__btn--disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-video__time{font-size:var(--co-font-size-12);color:var(--co-video-controls-color);white-space:nowrap;padding:0 var(--co-spacing-xs);font-variant-numeric:tabular-nums}.co-video__volume{display:flex;align-items:center;position:relative}.co-video__volume-slider-wrap{width:0;overflow:hidden;transition:width var(--co-motion-duration-base) var(--co-motion-ease-out), opacity var(--co-motion-duration-base) var(--co-motion-ease-out);opacity:0}.co-video__volume-slider-wrap--visible{width:96px;opacity:1;overflow:visible}.co-video__volume-slider{width:96px;height:20px;display:flex;align-items:center;cursor:pointer;touch-action:none;padding:0 10px}.co-video__volume-track{position:relative;width:100%;height:4px;background:rgba(255, 255, 255, 0.2);border-radius:var(--co-border-radius-full)}.co-video__volume-fill{position:absolute;top:0;left:0;height:100%;background:var(--co-video-accent);border-radius:var(--co-border-radius-full)}.co-video__volume-thumb{position:absolute;top:50%;width:12px;height:12px;border-radius:var(--co-border-radius-full);background:var(--co-video-accent);transform:translate(-50%, -50%);pointer-events:none}.co-video__speed-wrap{position:relative}.co-video__btn--speed{width:auto;padding:0 var(--co-spacing-sm)}.co-video__speed-label{font-family:var(--co-font-family-primary);font-size:var(--co-font-size-13, 13px);font-weight:500;color:var(--co-video-controls-color)}.co-video__speed-menu{position:absolute;bottom:100%;right:0;margin-bottom:var(--co-spacing-xs);background:rgba(20, 20, 20, 0.92);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:var(--co-border-radius-sm);padding:var(--co-spacing-xs) 0;min-width:130px;box-shadow:var(--co-shadow-lg);z-index:10}.co-video__speed-option{display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--co-spacing-sm) var(--co-spacing-lg);color:#fff;font-size:var(--co-font-size-14);font-family:var(--co-font-family-primary);cursor:pointer;background:transparent;border:none;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);text-align:left}.co-video__speed-option:hover{background:rgba(255, 255, 255, 0.08)}.co-video__speed-option--active{font-weight:600}@media (max-width: 480px){.co-video__volume-slider-wrap{display:none}.co-video__toolbar{gap:var(--co-spacing-xxs)}.co-video__btn{width:32px;height:32px}.co-video__big-play-circle{width:56px;height:56px}.co-video__time{font-size:var(--co-font-size-11, 11px)}.co-video__controls{padding:var(--co-spacing-2xl) var(--co-spacing-sm2) var(--co-spacing-sm)}}"}},[1,"co-video",{src:[1],poster:[1],type:[1],preload:[1],autoplay:[4],loop:[4],muted:[1028],volume:[1026],currentTime:[1026,"current-time"],playbackRate:[1026,"playback-rate"],playbackRates:[1,"playback-rates"],controls:[4],showPlay:[4,"show-play"],showVolume:[4,"show-volume"],showProgress:[4,"show-progress"],showTime:[4,"show-time"],showFullscreen:[4,"show-fullscreen"],showSpeed:[4,"show-speed"],showPip:[4,"show-pip"],showDownload:[4,"show-download"],allowDownload:[4,"allow-download"],aspectRatio:[1,"aspect-ratio"],rounded:[1],controlsAutoHide:[4,"controls-auto-hide"],controlsAutoHideDelay:[2,"controls-auto-hide-delay"],disabled:[4],watchThreshold:[2,"watch-threshold"],locale:[1],isPlaying:[32],internalCurrentTime:[32],duration:[32],buffered:[32],volumeLevel:[32],isMuted:[32],isFullscreen:[32],internalPlaybackRate:[32],isLoading:[32],showControlBar:[32],hasError:[32],errorMessage:[32],showSpeedMenu:[32],isPip:[32],thresholdFired:[32],hasStarted:[32],isSeeking:[32],showVolumeSlider:[32],play:[64],pause:[64],togglePlay:[64],seek:[64],setVolume:[64],toggleMute:[64],toggleFullscreen:[64],togglePip:[64]},void 0,{src:[{onSrcChange:0}],muted:[{onMutedChange:0}],volume:[{onVolumeChange:0}],currentTime:[{onCurrentTimeChange:0}],playbackRate:[{onPlaybackRateChange:0}],playbackRates:[{onPlaybackRatesChange:0}]}]);function d(){"undefined"!=typeof customElements&&["co-video","co-icon"].forEach((t=>{switch(t){case"co-video":customElements.get(i(t))||customElements.define(i(t),c);break;case"co-icon":customElements.get(i(t))||a()}}))}d();export{c as C,d}
1
+ import{t as i,p as t,H as e,c as o,h as s,a as r}from"./index.js";import{d as a}from"./p-DNJAIVfI.js";const n={es:{play:"Reproducir",pause:"Pausar",mute:"Silenciar",unmute:"Activar sonido",volume:"Volumen",fullscreen:"Pantalla completa",exitFullscreen:"Salir de pantalla completa",speed:"Velocidad",pip:"Imagen en imagen",exitPip:"Salir de imagen en imagen",download:"Descargar",seek:"Buscar",normal:"Normal",error:"Error al reproducir el video",retry:"Reintentar",player:"Reproductor de video"},en:{play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute",volume:"Volume",fullscreen:"Fullscreen",exitFullscreen:"Exit fullscreen",speed:"Speed",pip:"Picture in picture",exitPip:"Exit picture in picture",download:"Download",seek:"Seek",normal:"Normal",error:"Error playing video",retry:"Retry",player:"Video player"},pt:{play:"Reproduzir",pause:"Pausar",mute:"Silenciar",unmute:"Ativar som",volume:"Volume",fullscreen:"Tela cheia",exitFullscreen:"Sair da tela cheia",speed:"Velocidade",pip:"Imagem em imagem",exitPip:"Sair de imagem em imagem",download:"Baixar",seek:"Buscar",normal:"Normal",error:"Erro ao reproduzir o vídeo",retry:"Tentar novamente",player:"Reprodutor de vídeo"}},h={1:{es:"La carga del video fue interrumpida",en:"Video loading was aborted",pt:"O carregamento do vídeo foi interrompido"},2:{es:"Error de red al cargar el video",en:"Network error while loading video",pt:"Erro de rede ao carregar o vídeo"},3:{es:"Error al decodificar el video",en:"Error decoding video",pt:"Erro ao decodificar o vídeo"},4:{es:"Formato de video no soportado",en:"Video format not supported",pt:"Formato de vídeo não suportado"}},c=t(class extends e{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.coPlay=o(this,"coPlay",7),this.coPause=o(this,"coPause",7),this.coEnded=o(this,"coEnded",7),this.coReady=o(this,"coReady",7),this.coError=o(this,"coError",7),this.coTimeUpdate=o(this,"coTimeUpdate",3),this.coSeeked=o(this,"coSeeked",7),this.coVolumeChange=o(this,"coVolumeChange",7),this.coFullscreenChange=o(this,"coFullscreenChange",7),this.coPlaybackRateChange=o(this,"coPlaybackRateChange",7),this.coPipChange=o(this,"coPipChange",7),this.coDownload=o(this,"coDownload",7),this.coThresholdReached=o(this,"coThresholdReached",7),this.src="",this.poster="",this.type="",this.preload="metadata",this.autoplay=!1,this.loop=!1,this.muted=!1,this.volume=1,this.currentTime=0,this.playbackRate=1,this.playbackRates="[0.5, 0.75, 1, 1.25, 1.5, 2]",this.controls=!0,this.showPlay=!0,this.showVolume=!0,this.showProgress=!0,this.showTime=!0,this.showFullscreen=!0,this.showSpeed=!1,this.showPip=!1,this.showDownload=!1,this.allowDownload=!1,this.aspectRatio="16:9",this.rounded="lg",this.controlsAutoHide=!0,this.controlsAutoHideDelay=3e3,this.disabled=!1,this.watchThreshold=0,this.locale="es",this.isPlaying=!1,this.internalCurrentTime=0,this.duration=0,this.buffered=0,this.volumeLevel=1,this.isMuted=!1,this.isFullscreen=!1,this.internalPlaybackRate=1,this.isLoading=!0,this.showControlBar=!0,this.hasError=!1,this.errorMessage="",this.showSpeedMenu=!1,this.isPip=!1,this.thresholdFired=!1,this.hasStarted=!1,this.isSeeking=!1,this.showVolumeSlider=!1,this.lastTimeUpdateEmit=0,this.parsedRates=[.5,.75,1,1.25,1.5,2],this.seekFromTime=0,this.externalTimeUpdate=!1,this.resetControlsTimer=()=>{this.controlsAutoHide&&this.controls&&(this.showControlBar=!0,this.controlsTimer&&clearTimeout(this.controlsTimer),this.controlsTimer=setTimeout((()=>{this.isPlaying&&!this.showSpeedMenu&&(this.showControlBar=!1)}),this.controlsAutoHideDelay))},this.handleContainerMouseMove=()=>{this.resetControlsTimer()},this.handleContainerMouseLeave=()=>{this.isPlaying&&this.controlsAutoHide&&(this.showControlBar=!1,this.showSpeedMenu=!1)},this.handleContainerTouchStart=()=>{this.controlsAutoHide&&(this.showControlBar&&this.isPlaying?this.showControlBar=!1:this.resetControlsTimer())},this.onLoadedMetadata=()=>{this.videoEl&&(this.duration=this.videoEl.duration,this.hasError=!1,this.coReady.emit({duration:this.duration,width:this.videoEl.videoWidth,height:this.videoEl.videoHeight}),this.currentTime>0&&this.currentTime<this.duration&&(this.videoEl.currentTime=this.currentTime))},this.onPlay=()=>{this.isPlaying=!0,this.hasStarted=!0,this.coPlay.emit(),this.resetControlsTimer()},this.onPause=()=>{this.isPlaying=!1,this.showControlBar=!0,this.coPause.emit(),this.controlsTimer&&clearTimeout(this.controlsTimer)},this.onEnded=()=>{this.isPlaying=!1,this.showControlBar=!0,this.coEnded.emit()},this.onTimeUpdate=()=>{if(!this.videoEl||this.isSeeking)return;this.internalCurrentTime=this.videoEl.currentTime,this.externalTimeUpdate=!0,this.currentTime=this.videoEl.currentTime;const i=performance.now();if(i-this.lastTimeUpdateEmit>250){this.lastTimeUpdateEmit=i;const t=this.duration>0?Math.round(this.internalCurrentTime/this.duration*100):0;this.coTimeUpdate.emit({currentTime:this.internalCurrentTime,duration:this.duration,progressPercent:t}),this.watchThreshold>0&&!this.thresholdFired&&t>=this.watchThreshold&&(this.thresholdFired=!0,this.coThresholdReached.emit({threshold:this.watchThreshold,currentTime:this.internalCurrentTime,duration:this.duration}))}},this.onWaiting=()=>{this.isLoading=!0},this.onCanPlay=()=>{this.isLoading=!1},this.onError=()=>{var i,t;if(!(null===(i=this.videoEl)||void 0===i?void 0:i.error))return;const e=this.videoEl.error.code,o=(null===(t=h[e])||void 0===t?void 0:t[this.locale])||this.t.error;this.hasError=!0,this.errorMessage=o,this.isLoading=!1,this.coError.emit({code:e,message:o})},this.onProgress=()=>{if(!this.videoEl||this.duration<=0)return;const i=this.videoEl.buffered;i.length>0&&(this.buffered=i.end(i.length-1)/this.duration*100)},this.onNativeVolumeChange=()=>{this.videoEl&&(this.volumeLevel=this.videoEl.volume,this.isMuted=this.videoEl.muted,this.volume=this.videoEl.volume,this.muted=this.videoEl.muted,this.coVolumeChange.emit({volume:this.volumeLevel,muted:this.isMuted}))},this.onNativeRateChange=()=>{this.videoEl&&(this.internalPlaybackRate=this.videoEl.playbackRate,this.playbackRate=this.videoEl.playbackRate,this.coPlaybackRateChange.emit({rate:this.internalPlaybackRate}))},this.handlePlayClick=()=>{!this.disabled&&this.videoEl&&(this.isPlaying?this.videoEl.pause():this.videoEl.play().catch((()=>{})))},this.handleBigPlayClick=()=>{this.disabled||this.handlePlayClick()},this.handleMuteClick=()=>{!this.disabled&&this.videoEl&&(this.videoEl.muted=!this.videoEl.muted)},this.isDraggingVolume=!1,this.handleVolumeMouseEnter=()=>{this.showVolumeSlider=!0},this.handleVolumeMouseLeave=()=>{this.isDraggingVolume||(this.showVolumeSlider=!1)},this.handleProgressPointerDown=i=>{if(this.disabled||!this.videoEl)return;i.preventDefault(),this.isSeeking=!0,this.seekFromTime=this.videoEl.currentTime,this.seekFromPointerEvent(i);const t=i=>this.seekFromPointerEvent(i),e=()=>{this.videoEl&&this.coSeeked.emit({from:this.seekFromTime,to:this.videoEl.currentTime}),this.isSeeking=!1,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",e)};document.addEventListener("pointermove",t),document.addEventListener("pointerup",e)},this.handleVolumePointerDown=i=>{if(this.disabled||!this.videoEl)return;i.preventDefault(),i.stopPropagation(),this.isDraggingVolume=!0,this.showVolumeSlider=!0,this.setVolumeFromPointerEvent(i);const t=i=>this.setVolumeFromPointerEvent(i),e=()=>{this.isDraggingVolume=!1,document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",e)};document.addEventListener("pointermove",t),document.addEventListener("pointerup",e)},this.handleSpeedClick=i=>{i.stopPropagation(),this.showSpeedMenu=!this.showSpeedMenu},this.handleSpeedSelect=i=>{!this.disabled&&this.videoEl&&(this.videoEl.playbackRate=i,this.showSpeedMenu=!1)},this.handleFullscreenClick=()=>{if(!this.disabled)if(document.fullscreenElement||document.webkitFullscreenElement)document.exitFullscreen?document.exitFullscreen().catch((()=>{})):document.webkitExitFullscreen&&document.webkitExitFullscreen();else{const i=this.el;i.requestFullscreen?i.requestFullscreen().catch((()=>{})):i.webkitRequestFullscreen?i.webkitRequestFullscreen():this.videoEl&&this.videoEl.webkitEnterFullscreen&&this.videoEl.webkitEnterFullscreen()}},this.handleFullscreenChange=()=>{const i=document.fullscreenElement||document.webkitFullscreenElement;this.isFullscreen=i===this.el,this.coFullscreenChange.emit({fullscreen:this.isFullscreen})},this.handlePipClick=async()=>{if(!this.disabled&&this.videoEl)try{this.isPip?await document.exitPictureInPicture():await this.videoEl.requestPictureInPicture()}catch(i){}},this.handleEnterPip=()=>{this.isPip=!0,this.coPipChange.emit({pip:!0})},this.handleLeavePip=()=>{this.isPip=!1,this.coPipChange.emit({pip:!1})},this.handleDownloadClick=()=>{if(!this.allowDownload||!this.src)return;this.coDownload.emit({src:this.src});const i=document.createElement("a");i.href=this.src,i.download="",i.target="_blank",i.rel="noopener",document.body.appendChild(i),i.click(),document.body.removeChild(i)},this.handleRetryClick=()=>{this.videoEl&&(this.hasError=!1,this.errorMessage="",this.isLoading=!0,this.videoEl.load())},this.handleKeyDown=i=>{var t,e;if(this.disabled||!this.videoEl)return;const o=null===(e=null===(t=i.target)||void 0===t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase();if("input"!==o&&"textarea"!==o)switch(i.key){case" ":case"k":case"K":i.preventDefault(),this.handlePlayClick();break;case"ArrowRight":i.preventDefault(),this.videoEl.currentTime=Math.min(this.duration,this.videoEl.currentTime+5);break;case"ArrowLeft":i.preventDefault(),this.videoEl.currentTime=Math.max(0,this.videoEl.currentTime-5);break;case"ArrowUp":i.preventDefault(),this.videoEl.volume=Math.min(1,this.videoEl.volume+.1);break;case"ArrowDown":i.preventDefault(),this.videoEl.volume=Math.max(0,this.videoEl.volume-.1);break;case"m":case"M":i.preventDefault(),this.handleMuteClick();break;case"f":case"F":i.preventDefault(),this.handleFullscreenClick();break;case"Escape":this.showSpeedMenu&&(i.preventDefault(),this.showSpeedMenu=!1)}},this.handleVideoAreaClick=()=>{this.disabled||(this.handlePlayClick(),this.resetControlsTimer())}}get t(){return n[this.locale]||n.es}get progressPercent(){return this.duration<=0?0:this.internalCurrentTime/this.duration*100}get pipSupported(){return"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}onSrcChange(){this.resetState()}onMutedChange(){this.videoEl&&(this.videoEl.muted=this.muted),this.isMuted=this.muted}onVolumeChange(){const i=Math.max(0,Math.min(1,this.volume));this.videoEl&&(this.videoEl.volume=i),this.volumeLevel=i}onCurrentTimeChange(){this.externalTimeUpdate?this.externalTimeUpdate=!1:this.videoEl&&Math.abs(this.videoEl.currentTime-this.currentTime)>.5&&(this.videoEl.currentTime=this.currentTime)}onPlaybackRateChange(){this.videoEl&&(this.videoEl.playbackRate=this.playbackRate),this.internalPlaybackRate=this.playbackRate}onPlaybackRatesChange(){this.parseRates()}componentWillLoad(){var i,t;this.parseRates(),this.volumeLevel=Math.max(0,Math.min(1,null!==(i=this.volume)&&void 0!==i?i:1)),this.isMuted=null!==(t=this.muted)&&void 0!==t&&t,this.internalPlaybackRate=this.playbackRate||1}componentDidLoad(){this.videoEl&&(this.bindVideoEvents(),this.videoEl.volume=this.volumeLevel,this.videoEl.muted=this.isMuted,this.videoEl.playbackRate=this.internalPlaybackRate,this.videoEl.readyState>=1&&this.onLoadedMetadata(),this.videoEl.readyState>=3&&this.onCanPlay(),this.autoplay&&this.muted&&this.videoEl.play().catch((()=>{}))),document.addEventListener("fullscreenchange",this.handleFullscreenChange),document.addEventListener("webkitfullscreenchange",this.handleFullscreenChange)}disconnectedCallback(){this.controlsTimer&&clearTimeout(this.controlsTimer),document.removeEventListener("fullscreenchange",this.handleFullscreenChange),document.removeEventListener("webkitfullscreenchange",this.handleFullscreenChange),this.videoEl&&(this.videoEl.removeEventListener("loadedmetadata",this.onLoadedMetadata),this.videoEl.removeEventListener("play",this.onPlay),this.videoEl.removeEventListener("pause",this.onPause),this.videoEl.removeEventListener("ended",this.onEnded),this.videoEl.removeEventListener("timeupdate",this.onTimeUpdate),this.videoEl.removeEventListener("waiting",this.onWaiting),this.videoEl.removeEventListener("canplay",this.onCanPlay),this.videoEl.removeEventListener("error",this.onError),this.videoEl.removeEventListener("progress",this.onProgress),this.videoEl.removeEventListener("volumechange",this.onNativeVolumeChange),this.videoEl.removeEventListener("ratechange",this.onNativeRateChange),this.videoEl.removeEventListener("enterpictureinpicture",this.handleEnterPip),this.videoEl.removeEventListener("leavepictureinpicture",this.handleLeavePip))}async play(){var i;await(null===(i=this.videoEl)||void 0===i?void 0:i.play())}async pause(){var i;null===(i=this.videoEl)||void 0===i||i.pause()}async togglePlay(){var i,t;this.isPlaying?null===(i=this.videoEl)||void 0===i||i.pause():await(null===(t=this.videoEl)||void 0===t?void 0:t.play())}async seek(i){this.videoEl&&(this.videoEl.currentTime=i)}async setVolume(i){const t=Math.max(0,Math.min(1,i));this.volume=t,this.videoEl&&(this.videoEl.volume=t),this.volumeLevel=t}async toggleMute(){this.handleMuteClick()}async toggleFullscreen(){this.handleFullscreenClick()}async togglePip(){this.handlePipClick()}parseRates(){try{const i=JSON.parse(this.playbackRates);Array.isArray(i)&&(this.parsedRates=i.filter((i=>"number"==typeof i&&i>0)).sort(((i,t)=>i-t)))}catch(i){this.parsedRates=[.5,.75,1,1.25,1.5,2]}}resetState(){this.isPlaying=!1,this.internalCurrentTime=0,this.duration=0,this.buffered=0,this.hasError=!1,this.errorMessage="",this.thresholdFired=!1,this.hasStarted=!1,this.isLoading=!0,this.showSpeedMenu=!1}bindVideoEvents(){this.videoEl&&(this.videoEl.addEventListener("loadedmetadata",this.onLoadedMetadata),this.videoEl.addEventListener("play",this.onPlay),this.videoEl.addEventListener("pause",this.onPause),this.videoEl.addEventListener("ended",this.onEnded),this.videoEl.addEventListener("timeupdate",this.onTimeUpdate),this.videoEl.addEventListener("waiting",this.onWaiting),this.videoEl.addEventListener("canplay",this.onCanPlay),this.videoEl.addEventListener("error",this.onError),this.videoEl.addEventListener("progress",this.onProgress),this.videoEl.addEventListener("volumechange",this.onNativeVolumeChange),this.videoEl.addEventListener("ratechange",this.onNativeRateChange),this.videoEl.addEventListener("enterpictureinpicture",this.handleEnterPip),this.videoEl.addEventListener("leavepictureinpicture",this.handleLeavePip))}formatTime(i){if(!isFinite(i)||i<0)return"0:00";const t=Math.floor(i/3600),e=Math.floor(i%3600/60),o=Math.floor(i%60);return t>0?`${t}:${e.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${e}:${o.toString().padStart(2,"0")}`}seekFromPointerEvent(i){if(!this.progressTrackEl||!this.videoEl)return;const t=this.progressTrackEl.getBoundingClientRect(),e=Math.max(0,Math.min(1,(i.clientX-t.left)/t.width))*this.duration;this.videoEl.currentTime=e,this.internalCurrentTime=e}setVolumeFromPointerEvent(i){if(!this.volumeTrackEl||!this.videoEl)return;const t=this.volumeTrackEl.getBoundingClientRect(),e=Math.max(0,Math.min(1,(i.clientX-t.left)/t.width));this.videoEl.volume=e,e>0&&this.videoEl.muted&&(this.videoEl.muted=!1)}renderBigPlayButton(){return this.isPlaying||this.hasError||this.isLoading?null:s("button",{class:"co-video__big-play",part:"big-play",onClick:this.handleBigPlayClick,"aria-label":this.t.play,tabindex:"-1"},s("div",{class:"co-video__big-play-circle"},s("co-icon",{name:"play",size:32,weight:"fill"})))}renderPoster(){return!this.poster||this.hasStarted?null:s("div",{class:"co-video__poster",part:"poster",style:{backgroundImage:`url(${this.poster})`}})}renderLoader(){return!this.isLoading||this.hasError?null:s("div",{class:"co-video__loader"},s("div",{class:"co-video__spinner"}))}renderError(){return this.hasError?s("div",{class:"co-video__error"},s("co-icon",{name:"warning-circle",size:48,weight:"regular"}),s("p",{class:"co-video__error-text"},this.errorMessage||this.t.error),s("button",{class:"co-video__error-retry",onClick:this.handleRetryClick},s("co-icon",{name:"arrow-clockwise",size:16,weight:"bold"}),this.t.retry)):null}renderProgressBar(){if(!this.showProgress)return null;const i=this.progressPercent,t=this.buffered;return s("div",{class:"co-video__progress",part:"progress",role:"slider","aria-label":this.t.seek,"aria-valuenow":Math.round(this.internalCurrentTime),"aria-valuemin":0,"aria-valuemax":Math.round(this.duration),tabindex:0,ref:i=>this.progressTrackEl=i,onPointerDown:this.handleProgressPointerDown},s("div",{class:"co-video__progress-track"},s("div",{class:"co-video__progress-buffered",style:{width:`${t}%`}}),s("div",{class:"co-video__progress-played",style:{width:`${i}%`}})),s("div",{class:"co-video__progress-thumb",style:{left:`${i}%`}}))}renderVolumeControl(){if(!this.showVolume)return null;const i=this.isMuted?0:100*this.volumeLevel;return s("div",{class:"co-video__volume",onMouseEnter:this.handleVolumeMouseEnter,onMouseLeave:this.handleVolumeMouseLeave},s("button",{class:"co-video__btn",onClick:this.handleMuteClick,"aria-label":this.isMuted?this.t.unmute:this.t.mute},s("co-icon",{name:this.isMuted||0===this.volumeLevel?"speaker-x":this.volumeLevel<.5?"speaker-low":"speaker-high",size:20,weight:"fill"})),s("div",{class:{"co-video__volume-slider-wrap":!0,"co-video__volume-slider-wrap--visible":this.showVolumeSlider}},s("div",{class:"co-video__volume-slider",onPointerDown:this.handleVolumePointerDown,role:"slider","aria-label":this.t.volume,"aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100},s("div",{class:"co-video__volume-track",ref:i=>this.volumeTrackEl=i},s("div",{class:"co-video__volume-fill",style:{width:`${i}%`}}),s("div",{class:"co-video__volume-thumb",style:{left:`${i}%`}})))))}renderSpeedMenu(){return this.showSpeed?s("div",{class:"co-video__speed-wrap"},s("button",{class:"co-video__btn co-video__btn--speed",onClick:this.handleSpeedClick,"aria-label":this.t.speed,"aria-haspopup":"listbox","aria-expanded":this.showSpeedMenu?"true":"false"},s("span",{class:"co-video__speed-label"},1===this.internalPlaybackRate?"1x":`${this.internalPlaybackRate}x`)),this.showSpeedMenu&&s("div",{class:"co-video__speed-menu",role:"listbox","aria-label":this.t.speed},this.parsedRates.map((i=>s("button",{class:{"co-video__speed-option":!0,"co-video__speed-option--active":i===this.internalPlaybackRate},role:"option","aria-selected":i===this.internalPlaybackRate?"true":"false",onClick:()=>this.handleSpeedSelect(i)},s("span",null,1===i?this.t.normal:`${i}x`),i===this.internalPlaybackRate&&s("co-icon",{name:"check",size:14,weight:"bold"})))))):null}renderControls(){return this.controls?s("div",{class:{"co-video__controls":!0,"co-video__controls--hidden":!this.showControlBar},part:"controls",onClick:i=>i.stopPropagation()},this.renderProgressBar(),s("div",{class:"co-video__toolbar",part:"toolbar"},s("div",{class:"co-video__toolbar-left"},this.showPlay&&s("button",{class:"co-video__btn",onClick:this.handlePlayClick,"aria-label":this.isPlaying?this.t.pause:this.t.play},s("co-icon",{name:this.isPlaying?"pause":"play",size:20,weight:"fill"})),this.renderVolumeControl(),this.showTime&&s("span",{class:"co-video__time","aria-live":"off"},this.formatTime(this.internalCurrentTime)," / ",this.formatTime(this.duration))),s("div",{class:"co-video__toolbar-right"},this.renderSpeedMenu(),this.showPip&&this.pipSupported&&s("button",{class:"co-video__btn",onClick:this.handlePipClick,"aria-label":this.isPip?this.t.exitPip:this.t.pip},s("co-icon",{name:"picture-in-picture",size:20,weight:this.isPip?"fill":"regular"})),this.showDownload&&s("button",{class:{"co-video__btn":!0,"co-video__btn--disabled":!this.allowDownload},onClick:this.handleDownloadClick,"aria-label":this.t.download,disabled:!this.allowDownload},s("co-icon",{name:"download-simple",size:20,weight:"regular"})),this.showFullscreen&&s("button",{class:"co-video__btn",onClick:this.handleFullscreenClick,"aria-label":this.isFullscreen?this.t.exitFullscreen:this.t.fullscreen},s("co-icon",{name:this.isFullscreen?"corners-in":"corners-out",size:20,weight:"regular"}))))):null}render(){const i=`co-video--${this.aspectRatio.replace(":","-")}`;return s(r,{key:"7547fe3cb220159ae7cb0d9bb890348ac8a62264"},s("div",{key:"efb33e16e1ce3f8312de4532528f217bcfd619be",class:{"co-video":!0,[i]:!0,[`co-video--rounded-${this.rounded}`]:!0,"co-video--disabled":this.disabled,"co-video--fullscreen":this.isFullscreen,"co-video--playing":this.isPlaying},part:"container",ref:i=>this.containerEl=i,role:"region","aria-label":this.t.player,tabindex:0,onKeyDown:this.handleKeyDown,onMouseMove:this.handleContainerMouseMove,onMouseLeave:this.handleContainerMouseLeave,onTouchStart:this.handleContainerTouchStart},s("video",{key:"14bf786bae4288e2eeb8171893bec70cb3dd0fc8",ref:i=>this.videoEl=i,class:"co-video__native",part:"video",src:this.src||void 0,poster:void 0,preload:this.preload,loop:this.loop,playsinline:!0,tabindex:-1,controlsList:this.allowDownload?void 0:"nodownload"}),this.renderPoster(),this.renderLoader(),this.renderBigPlayButton(),this.renderError(),s("div",{key:"2e8b0cc3e3dbbb63aaebb44510ba43785de04fd4",class:"co-video__click-area",onClick:this.handleVideoAreaClick}),this.renderControls()))}get el(){return this}static get watchers(){return{src:[{onSrcChange:0}],muted:[{onMutedChange:0}],volume:[{onVolumeChange:0}],currentTime:[{onCurrentTimeChange:0}],playbackRate:[{onPlaybackRateChange:0}],playbackRates:[{onPlaybackRatesChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);--co-video-controls-bg:linear-gradient(transparent, rgba(0, 0, 0, 0.75));--co-video-controls-color:#fff;--co-video-progress-height:4px;--co-video-progress-height-hover:8px;--co-video-accent:var(--co-color-base-blanco);--co-video-buffered:rgba(255, 255, 255, 0.25);--co-video-btn-hover:rgba(255, 255, 255, 0.16)}.co-video{position:relative;width:100%;background:#000;overflow:hidden;outline:none;user-select:none;-webkit-user-select:none}.co-video:focus-visible{outline:2px solid var(--co-semantic-border-focus-ring);outline-offset:2px}.co-video--16-9{aspect-ratio:16 / 9}.co-video--4-3{aspect-ratio:4 / 3}.co-video--1-1{aspect-ratio:1 / 1}.co-video--21-9{aspect-ratio:21 / 9}.co-video--auto{height:100%}.co-video--rounded-none{border-radius:0}.co-video--rounded-sm{border-radius:var(--co-border-radius-xs)}.co-video--rounded-md{border-radius:var(--co-border-radius-sm)}.co-video--rounded-lg{border-radius:var(--co-border-radius-lg)}.co-video--rounded-xl{border-radius:var(--co-border-radius-xl)}:host(:fullscreen){width:100%;height:100%}:host(:fullscreen) .co-video{border-radius:0 !important;aspect-ratio:unset;width:100%;height:100%}.co-video--disabled{opacity:0.5;pointer-events:none}.co-video__native{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}.co-video__click-area{position:absolute;inset:0;z-index:1;cursor:pointer}.co-video__poster{position:absolute;inset:0;z-index:1;background-size:cover;background-position:center;background-repeat:no-repeat}.co-video__loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:3;pointer-events:none}.co-video__spinner{width:40px;height:40px;border:3px solid rgba(255, 255, 255, 0.15);border-top-color:#fff;border-radius:50%;animation:co-video-spin 0.7s linear infinite}@keyframes co-video-spin{to{transform:rotate(360deg)}}.co-video__big-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:2;cursor:pointer;background:transparent;border:none;padding:0;color:#fff}.co-video__big-play-circle{width:72px;height:72px;border-radius:var(--co-border-radius-full);background:rgba(0, 0, 0, 0.5);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out), background var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-video__big-play:hover .co-video__big-play-circle{transform:scale(1.1);background:rgba(0, 0, 0, 0.7)}.co-video__error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--co-spacing-md);z-index:4;background:rgba(0, 0, 0, 0.85);color:#fff}.co-video__error-text{font-size:var(--co-font-size-14);color:rgba(255, 255, 255, 0.7);margin:0;text-align:center;padding:0 var(--co-spacing-xl)}.co-video__error-retry{display:inline-flex;align-items:center;gap:var(--co-spacing-xs);padding:var(--co-spacing-sm2) var(--co-spacing-lg);border:1px solid rgba(255, 255, 255, 0.3);border-radius:var(--co-border-radius-full);background:transparent;color:#fff;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-video__error-retry:hover{background:rgba(255, 255, 255, 0.1);border-color:rgba(255, 255, 255, 0.5)}.co-video__controls{position:absolute;bottom:0;left:0;right:0;background:var(--co-video-controls-bg);padding:var(--co-spacing-3xl) var(--co-spacing-lg) var(--co-spacing-md);z-index:5;opacity:1;transition:opacity var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-video__controls--hidden{opacity:0;pointer-events:none}.co-video__progress{position:relative;width:100%;height:var(--co-video-progress-height);cursor:pointer;transition:height var(--co-motion-duration-fast) var(--co-motion-ease-out);margin-bottom:var(--co-spacing-sm);outline:none;touch-action:none}.co-video__progress:hover,.co-video__progress:focus-visible{height:var(--co-video-progress-height-hover)}.co-video__progress:focus-visible{outline:2px solid var(--co-semantic-border-focus-ring);outline-offset:4px;border-radius:var(--co-border-radius-full)}.co-video__progress-track{position:absolute;inset:0;background:rgba(255, 255, 255, 0.2);border-radius:var(--co-border-radius-full);overflow:hidden}.co-video__progress-buffered{position:absolute;top:0;left:0;height:100%;background:var(--co-video-buffered);border-radius:var(--co-border-radius-full);transition:width var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-video__progress-played{position:absolute;top:0;left:0;height:100%;background:var(--co-video-accent);border-radius:var(--co-border-radius-full)}.co-video__progress-thumb{position:absolute;top:50%;width:14px;height:14px;border-radius:var(--co-border-radius-full);background:var(--co-video-accent);transform:translate(-50%, -50%) scale(0);transition:transform var(--co-motion-duration-fast) var(--co-motion-ease-out);pointer-events:none}.co-video__progress:hover .co-video__progress-thumb{transform:translate(-50%, -50%) scale(1)}.co-video__toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm)}.co-video__toolbar-left,.co-video__toolbar-right{display:flex;align-items:center;gap:var(--co-spacing-sm)}.co-video__btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;background:transparent;color:var(--co-video-controls-color);cursor:pointer;border-radius:var(--co-border-radius-xs);padding:0;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-video__btn:hover{background:var(--co-video-btn-hover)}.co-video__btn:focus-visible{outline:2px solid #fff;outline-offset:2px}.co-video__btn--disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-video__time{font-size:var(--co-font-size-12);color:var(--co-video-controls-color);white-space:nowrap;padding:0 var(--co-spacing-xs);font-variant-numeric:tabular-nums}.co-video__volume{display:flex;align-items:center;position:relative}.co-video__volume-slider-wrap{width:0;overflow:hidden;transition:width var(--co-motion-duration-base) var(--co-motion-ease-out), opacity var(--co-motion-duration-base) var(--co-motion-ease-out);opacity:0}.co-video__volume-slider-wrap--visible{width:96px;opacity:1;overflow:visible}.co-video__volume-slider{width:96px;height:20px;display:flex;align-items:center;cursor:pointer;touch-action:none;padding:0 10px}.co-video__volume-track{position:relative;width:100%;height:4px;background:rgba(255, 255, 255, 0.2);border-radius:var(--co-border-radius-full)}.co-video__volume-fill{position:absolute;top:0;left:0;height:100%;background:var(--co-video-accent);border-radius:var(--co-border-radius-full)}.co-video__volume-thumb{position:absolute;top:50%;width:12px;height:12px;border-radius:var(--co-border-radius-full);background:var(--co-video-accent);transform:translate(-50%, -50%);pointer-events:none}.co-video__speed-wrap{position:relative}.co-video__btn--speed{width:auto;padding:0 var(--co-spacing-sm)}.co-video__speed-label{font-family:var(--co-font-family-primary);font-size:var(--co-font-size-13, 13px);font-weight:500;color:var(--co-video-controls-color)}.co-video__speed-menu{position:absolute;bottom:100%;right:0;margin-bottom:var(--co-spacing-xs);background:rgba(20, 20, 20, 0.92);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:var(--co-border-radius-sm);padding:var(--co-spacing-xs) 0;min-width:130px;box-shadow:var(--co-shadow-lg);z-index:10}.co-video__speed-option{display:flex;align-items:center;justify-content:space-between;width:100%;padding:var(--co-spacing-sm) var(--co-spacing-lg);color:#fff;font-size:var(--co-font-size-14);font-family:var(--co-font-family-primary);cursor:pointer;background:transparent;border:none;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);text-align:left}.co-video__speed-option:hover{background:rgba(255, 255, 255, 0.08)}.co-video__speed-option--active{font-weight:600}@media (max-width: 480px){.co-video__volume-slider-wrap{display:none}.co-video__toolbar{gap:var(--co-spacing-xxs)}.co-video__btn{width:32px;height:32px}.co-video__big-play-circle{width:56px;height:56px}.co-video__time{font-size:var(--co-font-size-11, 11px)}.co-video__controls{padding:var(--co-spacing-2xl) var(--co-spacing-sm2) var(--co-spacing-sm)}}"}},[1,"co-video",{src:[1],poster:[1],type:[1],preload:[1],autoplay:[4],loop:[4],muted:[1028],volume:[1026],currentTime:[1026,"current-time"],playbackRate:[1026,"playback-rate"],playbackRates:[1,"playback-rates"],controls:[4],showPlay:[4,"show-play"],showVolume:[4,"show-volume"],showProgress:[4,"show-progress"],showTime:[4,"show-time"],showFullscreen:[4,"show-fullscreen"],showSpeed:[4,"show-speed"],showPip:[4,"show-pip"],showDownload:[4,"show-download"],allowDownload:[4,"allow-download"],aspectRatio:[1,"aspect-ratio"],rounded:[1],controlsAutoHide:[4,"controls-auto-hide"],controlsAutoHideDelay:[2,"controls-auto-hide-delay"],disabled:[4],watchThreshold:[2,"watch-threshold"],locale:[1],isPlaying:[32],internalCurrentTime:[32],duration:[32],buffered:[32],volumeLevel:[32],isMuted:[32],isFullscreen:[32],internalPlaybackRate:[32],isLoading:[32],showControlBar:[32],hasError:[32],errorMessage:[32],showSpeedMenu:[32],isPip:[32],thresholdFired:[32],hasStarted:[32],isSeeking:[32],showVolumeSlider:[32],play:[64],pause:[64],togglePlay:[64],seek:[64],setVolume:[64],toggleMute:[64],toggleFullscreen:[64],togglePip:[64]},void 0,{src:[{onSrcChange:0}],muted:[{onMutedChange:0}],volume:[{onVolumeChange:0}],currentTime:[{onCurrentTimeChange:0}],playbackRate:[{onPlaybackRateChange:0}],playbackRates:[{onPlaybackRatesChange:0}]}]);function d(){"undefined"!=typeof customElements&&["co-video","co-icon"].forEach((t=>{switch(t){case"co-video":customElements.get(i(t))||customElements.define(i(t),c);break;case"co-icon":customElements.get(i(t))||a()}}))}d();export{c as C,d}
@@ -1 +1 @@
1
- import{t as o,p as t,H as r,h as a}from"./index.js";import{d as c}from"./p-DNJAIVfI.js";const s={l:20,m:18,s:16,xs:14},n=t(class extends r{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.variant="primary",this.shape="rounded",this.size="m",this.elevated=!1,this.surface="light",this.disabled=!1,this.iconWeight="regular",this.type="button",this.handleClick=()=>{if(!this.disabled){if("submit"===this.type){const o=this.el.closest("form");if(o)return void o.requestSubmit()}if("reset"===this.type){const o=this.el.closest("form");o&&o.reset()}}}}render(){var o,t;const r=null!==(t=null!==(o=this.iconSize)&&void 0!==o?o:s[this.size])&&void 0!==t?t:18,c={};return this.color&&(c.background=this.color),this.textColor&&(c.color=this.textColor),a("button",{key:"651f8d079c09cf21d076aa20564a462a15ca8c4a",class:{"co-button":!0,[`co-button--${this.variant}`]:!0,[`co-button--${this.shape}`]:!0,[`co-button--${this.size}`]:!0,[`co-button--surface-${this.surface}`]:!0,"co-button--elevated":this.elevated,"co-button--disabled":this.disabled},style:Object.keys(c).length?c:void 0,type:this.type,disabled:this.disabled,"aria-label":this.ariaLabelText||void 0,onClick:this.handleClick,part:"button"},this.iconLeft?a("co-icon",{name:this.iconLeft,weight:this.iconWeight,size:r}):null,a("slot",{key:"b8c5b230a473fe4a57aa087533186e410db64bed"},this.label),this.iconRight?a("co-icon",{name:this.iconRight,weight:this.iconWeight,size:r}):null)}get el(){return this}static get style(){return':host{display:inline-flex}:host([disabled]){pointer-events:none}.co-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid transparent;outline:none;font-family:var(--co-font-family-primary);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;-webkit-font-smoothing:antialiased;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border-color:color-mix(in srgb, var(--co-semantic-on-primary) 28%, transparent)}.co-button--secondary{background:color-mix(in srgb, var(--co-button-bg, var(--co-semantic-surface-secondary)) 55%, transparent);color:var(--co-button-color, var(--co-semantic-on-secondary));border-color:var(--co-button-border, var(--co-semantic-border-subtle))}.co-button--stroke{background:color-mix(in srgb, var(--co-semantic-surface-secondary) 25%, transparent);color:var(--co-semantic-text-default);border-color:var(--co-semantic-border-default)}.co-button--ghost{background:transparent;color:var(--co-semantic-text-default);border-color:transparent;-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger{background:var(--co-semantic-status-error);color:var(--co-color-base-blanco);border-color:transparent}.co-button--success{background:var(--co-semantic-status-success);color:var(--co-color-base-blanco);border-color:transparent}.co-button--rounded.co-button--l{padding:var(--co-spacing-xl) var(--co-spacing-2xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--m{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-16);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--s{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-14);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--xs{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-12);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--l{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-border-radius-lg)}.co-button--square.co-button--m{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-16);border-radius:var(--co-border-radius-sm)}.co-button--square.co-button--s{padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-14);border-radius:var(--co-border-radius-xs)}.co-button--square.co-button--xs{padding:var(--co-spacing-sm) var(--co-spacing-sm2);gap:var(--co-spacing-xs);font-size:var(--co-font-size-12);border-radius:var(--co-spacing-sm)}.co-button--disabled,.co-button:disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-button--primary:hover:not(:disabled){opacity:0.88}.co-button--secondary:hover:not(:disabled),.co-button--stroke:hover:not(:disabled){background:var(--co-semantic-surface-hover)}.co-button--ghost:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-hover) 60%, transparent);-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--danger:hover:not(:disabled),.co-button--success:hover:not(:disabled){opacity:0.88}.co-button:active:not(:disabled){transform:scale(0.97);transition-duration:var(--co-motion-duration-instant)}.co-button--primary{transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-slow) var(--co-motion-ease-spring)}.co-button--secondary.co-button--elevated{box-shadow:var(--co-shadow-sm, 0 1px 2px 0 rgba(26, 26, 26, 0.04)), inset 0 0 0 1px var(--co-color-opacity-negro-8)}.co-button--ghost.co-button--surface-dark,.co-button--stroke.co-button--surface-dark{color:var(--co-color-base-blanco, #fff)}.co-button--ghost.co-button--surface-dark:hover:not(:disabled),.co-button--stroke.co-button--surface-dark:hover:not(:disabled){background:var(--co-color-opacity-blanco-16);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger.co-button--surface-dark:hover:not(:disabled){opacity:1;background:color-mix(in srgb, var(--co-semantic-status-error) 84%, var(--co-color-base-blanco, #fff))}.co-button--danger.co-button--surface-dark:focus-visible{box-shadow:0 0 0 2px color-mix(in srgb, var(--co-color-base-blanco, #fff) 45%, transparent)}::slotted([slot="icon-left"]),::slotted([slot="icon-right"]){display:inline-flex;flex-shrink:0}@supports not (background: color-mix(in srgb, red, transparent)){.co-button--primary{background:var(--co-semantic-surface-primary)}.co-button--secondary{background:var(--co-semantic-surface-secondary)}.co-button--stroke{background:transparent}}'}},[257,"co-button",{variant:[1],shape:[513],size:[1],elevated:[4],surface:[1],disabled:[516],label:[1],ariaLabelText:[1,"aria-label-text"],iconLeft:[1,"icon-left"],iconRight:[1,"icon-right"],iconWeight:[1,"icon-weight"],type:[1],color:[1],textColor:[1,"text-color"],iconSize:[2,"icon-size"]}]);function e(){"undefined"!=typeof customElements&&["co-button","co-icon"].forEach((t=>{switch(t){case"co-button":customElements.get(o(t))||customElements.define(o(t),n);break;case"co-icon":customElements.get(o(t))||c()}}))}e();export{n as C,e as d}
1
+ import{t as o,p as t,H as r,h as a}from"./index.js";import{d as c}from"./p-DNJAIVfI.js";const s={l:20,m:18,s:16,xs:14},n=t(class extends r{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.variant="primary",this.shape="rounded",this.size="m",this.elevated=!1,this.surface="light",this.disabled=!1,this.iconWeight="regular",this.type="button",this.handleClick=()=>{if(!this.disabled){if("submit"===this.type){const o=this.el.closest("form");if(o)return void o.requestSubmit()}if("reset"===this.type){const o=this.el.closest("form");o&&o.reset()}}}}render(){var o,t;const r=null!==(t=null!==(o=this.iconSize)&&void 0!==o?o:s[this.size])&&void 0!==t?t:18,c={};return this.color&&(c.background=this.color),this.textColor&&(c.color=this.textColor),a("button",{key:"651f8d079c09cf21d076aa20564a462a15ca8c4a",class:{"co-button":!0,[`co-button--${this.variant}`]:!0,[`co-button--${this.shape}`]:!0,[`co-button--${this.size}`]:!0,[`co-button--surface-${this.surface}`]:!0,"co-button--elevated":this.elevated,"co-button--disabled":this.disabled},style:Object.keys(c).length?c:void 0,type:this.type,disabled:this.disabled,"aria-label":this.ariaLabelText||void 0,onClick:this.handleClick,part:"button"},this.iconLeft?a("co-icon",{name:this.iconLeft,weight:this.iconWeight,size:r}):null,a("slot",{key:"b8c5b230a473fe4a57aa087533186e410db64bed"},this.label),this.iconRight?a("co-icon",{name:this.iconRight,weight:this.iconWeight,size:r}):null)}get el(){return this}static get style(){return':host{display:inline-flex}:host([disabled]){pointer-events:none}.co-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid transparent;outline:none;font-family:var(--co-font-family-primary);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;-webkit-font-smoothing:antialiased;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border-color:color-mix(in srgb, var(--co-semantic-on-primary) 28%, transparent)}.co-button--secondary{background:color-mix(in srgb, var(--co-button-bg, var(--co-semantic-surface-secondary)) 55%, transparent);color:var(--co-button-color, var(--co-semantic-on-secondary));border-color:var(--co-button-border, var(--co-semantic-border-subtle))}.co-button--stroke{background:color-mix(in srgb, var(--co-semantic-surface-secondary) 25%, transparent);color:var(--co-semantic-text-default);border-color:var(--co-semantic-border-default)}.co-button--ghost{background:transparent;color:var(--co-semantic-text-default);border-color:transparent;-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger{background:var(--co-semantic-status-error);color:var(--co-color-base-blanco);border-color:transparent}.co-button--success{background:var(--co-semantic-status-success);color:var(--co-color-base-blanco);border-color:transparent}.co-button--rounded.co-button--l{padding:var(--co-spacing-xl) var(--co-spacing-2xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--m{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-16);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--s{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-14);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--xs{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-12);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--l{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-border-radius-lg)}.co-button--square.co-button--m{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-16);border-radius:var(--co-border-radius-sm)}.co-button--square.co-button--s{padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-14);border-radius:var(--co-border-radius-xs)}.co-button--square.co-button--xs{padding:var(--co-spacing-sm) var(--co-spacing-sm2);gap:var(--co-spacing-xs);font-size:var(--co-font-size-12);border-radius:var(--co-spacing-sm)}.co-button--disabled,.co-button:disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-button--primary:hover:not(:disabled){opacity:0.88}.co-button--secondary:hover:not(:disabled),.co-button--stroke:hover:not(:disabled){background:var(--co-semantic-surface-hover)}.co-button--ghost:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-hover) 60%, transparent);-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--danger:hover:not(:disabled),.co-button--success:hover:not(:disabled){opacity:0.88}.co-button:active:not(:disabled){transform:scale(0.97);transition-duration:var(--co-motion-duration-instant)}.co-button--primary{transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-slow) var(--co-motion-ease-spring)}.co-button--secondary.co-button--elevated{box-shadow:var(--co-shadow-sm, 0 1px 2px 0 rgba(26, 26, 26, 0.04)), inset 0 0 0 1px var(--co-color-opacity-negro-8)}.co-button--ghost.co-button--surface-dark,.co-button--stroke.co-button--surface-dark{color:var(--co-color-base-blanco, #fff)}.co-button--ghost.co-button--surface-dark:hover:not(:disabled),.co-button--stroke.co-button--surface-dark:hover:not(:disabled){background:var(--co-color-opacity-blanco-16);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger.co-button--surface-dark:hover:not(:disabled){opacity:1;background:color-mix(in srgb, var(--co-semantic-status-error) 84%, var(--co-color-base-blanco, #fff))}.co-button--danger.co-button--surface-dark:focus-visible{box-shadow:0 0 0 2px color-mix(in srgb, var(--co-color-base-blanco, #fff) 45%, transparent)}::slotted([slot="icon-left"]),::slotted([slot="icon-right"]){display:inline-flex;flex-shrink:0}.co-button>co-icon{margin-block:-1px}@supports not (background: color-mix(in srgb, red, transparent)){.co-button--primary{background:var(--co-semantic-surface-primary)}.co-button--secondary{background:var(--co-semantic-surface-secondary)}.co-button--stroke{background:transparent}}'}},[257,"co-button",{variant:[1],shape:[513],size:[1],elevated:[4],surface:[1],disabled:[516],label:[1],ariaLabelText:[1,"aria-label-text"],iconLeft:[1,"icon-left"],iconRight:[1,"icon-right"],iconWeight:[1,"icon-weight"],type:[1],color:[1],textColor:[1,"text-color"],iconSize:[2,"icon-size"]}]);function e(){"undefined"!=typeof customElements&&["co-button","co-icon"].forEach((t=>{switch(t){case"co-button":customElements.get(o(t))||customElements.define(o(t),n);break;case"co-icon":customElements.get(o(t))||c()}}))}e();export{n as C,e as d}
@@ -1 +1 @@
1
- import{t,p as i,H as o,c as e,h as s}from"./index.js";import{l as a}from"./p-jYd9gu_c.js";import{d as n}from"./p-DNJAIVfI.js";import{d as r}from"./p-B9xitpGU.js";const c={es:{close:"Cerrar visor",prevImage:"Imagen anterior",nextImage:"Imagen siguiente",zoomIn:"Acercar",zoomOut:"Alejar",zoomReset:"Restablecer zoom",openOriginal:"Abrir original",counter:"{i} de {n}"},en:{close:"Close viewer",prevImage:"Previous image",nextImage:"Next image",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomReset:"Reset zoom",openOriginal:"Open original",counter:"{i} of {n}"},pt:{close:"Fechar visualizador",prevImage:"Imagem anterior",nextImage:"Próxima imagem",zoomIn:"Aproximar",zoomOut:"Afastar",zoomReset:"Redefinir zoom",openOriginal:"Abrir original",counter:"{i} de {n}"}},h=1.15,l=i(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coClose=e(this,"coClose",3),this.coChange=e(this,"coChange",3),this.images="[]",this.startIndex=0,this.open=!1,this.index=0,this.scale=1,this.tx=0,this.ty=0,this.dragging=!1,this.lastImagesStr="",this.lastParsed=[],this.dragStart={x:0,y:0,tx:0,ty:0},this.pendingFocus=!1,this.syncTopLayer=t=>{t&&(this.rootEl=t);const i=this.rootEl;if(i&&"function"==typeof i.showPopover)if(this.open){clearTimeout(this.demoteTimer);try{i.matches(":popover-open")||i.showPopover()}catch(t){}}else i.matches(":popover-open")&&(clearTimeout(this.demoteTimer),this.demoteTimer=setTimeout((()=>{try{i.hidePopover()}catch(t){}}),220))},this.handleKey=t=>{if(this.open){if("Escape"===t.key)return this.escapeBelongsToPlayer()||(this.requestClose(),t.preventDefault()),void t.stopPropagation();if("Tab"!==t.key){if(!this.isFocusInPlayer()){switch(t.key){case"ArrowLeft":this.goTo(-1);break;case"ArrowRight":this.goTo(1);break;case"+":case"=":if(this.isVideoSlide)return;this.zoomAt(this.scale*h,0,0);break;case"-":if(this.isVideoSlide)return;this.zoomAt(this.scale/h,0,0);break;case"0":if(this.isVideoSlide)return;this.resetView();break;default:return}t.preventDefault(),t.stopPropagation()}}else this.trapTab(t)}},this.requestClose=()=>{this.coClose.emit()},this.mountPlayer=t=>{t&&t!==this.playerEl&&(this.playerEl=t,this.tryAutoplay())},this.handlePlayerReady=t=>{var i;const{width:o,height:e}=t.detail||{};o&&e&&(null===(i=this.playerEl)||void 0===i||i.style.setProperty("--co-lb-ar",String(o/e)))},this.handleWheel=t=>{t.preventDefault();const[i,o]=this.stagePoint(t);this.zoomAt(this.scale*(t.deltaY<0?h:1/h),i,o)},this.handleDblClick=t=>{const[i,o]=this.stagePoint(t);this.zoomAt(this.scale>1?1:2.5,i,o)},this.handlePointerDown=t=>{var i;this.scale<=1||(t.preventDefault(),this.dragging=!0,this.dragStart={x:t.clientX,y:t.clientY,tx:this.tx,ty:this.ty},null===(i=this.imgEl)||void 0===i||i.setPointerCapture(t.pointerId))},this.handlePointerMove=t=>{if(!this.dragging)return;const i=this.dragStart.tx+(t.clientX-this.dragStart.x),o=this.dragStart.ty+(t.clientY-this.dragStart.y);[this.tx,this.ty]=this.clampPan(i,o,this.scale)},this.handlePointerUp=t=>{var i;this.dragging&&(this.dragging=!1,null===(i=this.imgEl)||void 0===i||i.releasePointerCapture(t.pointerId))},this.openOriginal=()=>{const t=this.parsedImages[this.index];(null==t?void 0:t.src)&&window.open(t.src,"_blank","noopener")},this.stop=t=>t.stopPropagation()}get activeItem(){return this.parsedImages[this.index]}get isVideoSlide(){var t;return"video"===(null===(t=this.activeItem)||void 0===t?void 0:t.kind)}get parsedImages(){const t=this.images;if("string"!=typeof t||!t.trim())return[];if(t===this.lastImagesStr)return this.lastParsed;let i=[];try{const o=JSON.parse(t);Array.isArray(o)&&(i=o.filter((t=>t&&t.src)))}catch(t){}return this.lastImagesStr=t,this.lastParsed=i,i}componentWillLoad(){this.index=this.clampIndex(this.startIndex),this.pendingAutoplay=this.open}connectedCallback(){this.open&&this.attachKeyListener()}disconnectedCallback(){this.detachKeyListener(),this.pauseVideo(),clearTimeout(this.demoteTimer)}componentDidRender(){var t;this.pendingFocus&&(this.pendingFocus=!1,null===(t=this.closeBtnEl)||void 0===t||t.focus())}onOpenChange(t){var i,o,e;this.syncTopLayer(),t?(this.index=this.clampIndex(this.startIndex),this.resetView(),this.preloadNeighbors(),this.attachKeyListener(),this.pendingAutoplay=!0,this.tryAutoplay(),this.previouslyFocused=null!==(i=document.activeElement)&&void 0!==i?i:void 0,this.pendingFocus=!0):(this.detachKeyListener(),this.pauseVideo(),this.pendingAutoplay=!1,null===(e=null===(o=this.previouslyFocused)||void 0===o?void 0:o.focus)||void 0===e||e.call(o),this.previouslyFocused=void 0)}onStartIndexChange(t){this.open&&(this.index=this.clampIndex(t),this.resetView())}onImagesChange(){this.index=this.clampIndex(this.index)}attachKeyListener(){window.addEventListener("keydown",this.handleKey,{capture:!0})}detachKeyListener(){window.removeEventListener("keydown",this.handleKey,{capture:!0})}focusables(){var t,i;return Array.from(null!==(i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.querySelectorAll("button, co-video"))&&void 0!==i?i:[]).flatMap((t=>{var i,o;return"CO-VIDEO"===t.tagName?Array.from(null!==(o=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll('button:not([tabindex="-1"]), [tabindex="0"]'))&&void 0!==o?o:[]):[t]}))}deepActive(){var t,i,o;let e=null!==(i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)&&void 0!==i?i:null;for(;null===(o=null==e?void 0:e.shadowRoot)||void 0===o?void 0:o.activeElement;)e=e.shadowRoot.activeElement;return e}escapeBelongsToPlayer(){var t,i;const o=document;return!(!o.fullscreenElement&&!o.webkitFullscreenElement&&!(null===(i=null===(t=this.playerEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector(".co-video__speed-menu")))}isFocusInPlayer(){var t;const i=this.playerEl;return!!i&&(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)===i}trapTab(t){const i=this.focusables();if(0===i.length)return;t.preventDefault(),t.stopPropagation();const o=t.shiftKey?-1:1,e=i.indexOf(this.deepActive());(e<0?i[o>0?0:i.length-1]:i[(e+o+i.length)%i.length]).focus()}clampIndex(t){const i=this.parsedImages.length;return 0===i?0:Math.min(Math.max(0,t),i-1)}resetView(){this.scale=1,this.tx=0,this.ty=0,this.dragging=!1}goTo(t){const i=this.parsedImages.length;i<2||(this.pauseVideo(),this.pendingAutoplay=!1,this.index=(this.index+t+i)%i,this.resetView(),this.coChange.emit(this.index),this.preloadNeighbors())}preloadNeighbors(){const t=this.parsedImages;if(!(t.length<2))for(const i of[1,-1]){const o=t[(this.index+i+t.length)%t.length];if(!o)continue;const e="video"===o.kind?o.poster:o.src;e&&((new Image).src=e)}}tryAutoplay(){var t;if(!this.pendingAutoplay||!this.open)return;if(!this.isVideoSlide)return void(this.pendingAutoplay=!1);const i=this.playerEl;i&&(this.pendingAutoplay=!1,Promise.resolve(null===(t=i.componentOnReady)||void 0===t?void 0:t.call(i)).then((()=>{var t;if(this.open&&this.playerEl===i&&this.isVideoSlide)return null===(t=i.play)||void 0===t?void 0:t.call(i)})).catch((()=>{})))}pauseVideo(){var t,i;try{const o=null===(i=null===(t=this.playerEl)||void 0===t?void 0:t.pause)||void 0===i?void 0:i.call(t);o&&"function"==typeof o.catch&&o.catch((()=>{}))}catch(t){}}clampPan(t,i,o){const e=this.stageEl,s=this.imgEl;if(!e||!s)return[t,i];const a=Math.max(0,(s.offsetWidth*o-e.clientWidth)/2),n=Math.max(0,(s.offsetHeight*o-e.clientHeight)/2);return[Math.min(Math.max(t,-a),a),Math.min(Math.max(i,-n),n)]}zoomAt(t,i,o){const e=this.scale,s=Math.min(Math.max(t,1),8);if(s===e)return;const a=s/e;let n=i-(i-this.tx)*a,r=o-(o-this.ty)*a;1===s?(n=0,r=0):[n,r]=this.clampPan(n,r,s),this.scale=s,this.tx=n,this.ty=r}stagePoint(t){var i;const o=null===(i=this.stageEl)||void 0===i?void 0:i.getBoundingClientRect();return o?[t.clientX-o.left-o.width/2,t.clientY-o.top-o.height/2]:[0,0]}render(){const t=c[a(this.locale)],i=this.parsedImages,o=i[this.index],e=i.length>1,n="video"===(null==o?void 0:o.kind),r=t.counter.replace("{i}",String(this.index+1)).replace("{n}",String(i.length));return s("div",{key:"1a3c29e98fd491c92b82ba9d9296588609cdd006",class:{"co-lightbox":!0,"co-lightbox--open":this.open},part:"overlay",role:"dialog","aria-modal":"true","aria-label":null==o?void 0:o.alt,popover:"manual",ref:this.syncTopLayer,onClick:this.requestClose},o&&s("div",{key:"cc9e9db83ef082deab744f259c4da63a58eb0c3b",class:"co-lightbox__toolbar",part:"toolbar",onClick:this.stop},s("span",{key:"ab3fa42e21008407f2cab377566a1793a96a8a50",class:"co-lightbox__caption",title:o.alt},o.alt),!n&&s("div",{key:"af8761111e7c5e0e7a838d8e69971cc2863ee9d4",class:"co-lightbox__zoom"},s("button",{key:"e73628b4fd25fa7c3ed9ca947fccd196e6433f84",class:"co-lightbox__btn",type:"button","aria-label":t.zoomOut,title:t.zoomOut,onClick:()=>this.zoomAt(this.scale/h,0,0)},s("co-icon",{key:"371f4edc5141561b348ce36a8791fb81500248fa",name:"minus",size:16})),s("button",{key:"e07adc772687ef65d97db5669ed235749e43c034",class:"co-lightbox__btn co-lightbox__zoom-value",type:"button","aria-label":t.zoomReset,title:t.zoomReset,onClick:()=>this.resetView()},Math.round(100*this.scale),"%"),s("button",{key:"29ed305a4f464e38c4b4ef331dbbfc35aa6fdc95",class:"co-lightbox__btn",type:"button","aria-label":t.zoomIn,title:t.zoomIn,onClick:()=>this.zoomAt(this.scale*h,0,0)},s("co-icon",{key:"6b56559a4dad36bee62545deb426734450f64f58",name:"plus",size:16}))),s("button",{key:"53099c4e3dec82cfc9087e89916154ef4a8845f6",class:"co-lightbox__btn",type:"button","aria-label":t.openOriginal,title:t.openOriginal,onClick:this.openOriginal},s("co-icon",{key:"de160ed313ba0559cd1523f9f73fad7e3b167848",name:"arrow-square-out",size:16})),s("button",{key:"d1658ff7b8d0fc22f1a489c0138a16077304a165",class:"co-lightbox__btn",part:"close",type:"button","aria-label":t.close,title:t.close,ref:t=>this.closeBtnEl=t,onClick:this.requestClose},s("co-icon",{key:"fcbcbbf6001e67199b6ec7b99bde5f9f24537ca0",name:"x",size:16}))),o&&s("div",{key:"39cef6c2bd1bf3fe9f641778b48b618a62f1b5f8",class:"co-lightbox__stage",ref:t=>this.stageEl=t,onWheel:n?void 0:this.handleWheel},n?s("co-video",{class:"co-lightbox__video",part:"video",key:`video-${this.index}`,ref:this.mountPlayer,src:o.src,poster:o.poster||"",aspectRatio:"auto",rounded:"none",controlsAutoHide:!1,showSpeed:!0,showPip:!0,locale:a(this.locale),onCoReady:this.handlePlayerReady,onClick:this.stop}):s("img",{class:{"co-lightbox__img":!0,"co-lightbox__img--zoomed":this.scale>1,"co-lightbox__img--dragging":this.dragging},part:"image",ref:t=>this.imgEl=t,src:o.src,alt:o.alt||"",draggable:!1,style:{transform:`translate(${this.tx}px, ${this.ty}px) scale(${this.scale})`},onClick:this.stop,onDblClick:this.handleDblClick,onPointerDown:this.handlePointerDown,onPointerMove:this.handlePointerMove,onPointerUp:this.handlePointerUp,onPointerCancel:this.handlePointerUp})),o&&e&&s("button",{key:"a161402e30021374f608755ea0a5dc6ccee0e99a",class:"co-lightbox__nav co-lightbox__nav--prev",part:"prev",type:"button","aria-label":t.prevImage,title:t.prevImage,onClick:t=>{t.stopPropagation(),this.goTo(-1)}},s("co-icon",{key:"649171d5330299b3ccb368bb0b434c643157c3f5",name:"caret-left",size:24})),o&&e&&s("button",{key:"5cc5d07467e1ecf9c27094947ce421c28c35472d",class:"co-lightbox__nav co-lightbox__nav--next",part:"next",type:"button","aria-label":t.nextImage,title:t.nextImage,onClick:t=>{t.stopPropagation(),this.goTo(1)}},s("co-icon",{key:"d9d32607a6b4350009db5c1719987aa8afcbb007",name:"caret-right",size:24})),o&&e&&s("div",{key:"a23f10a2c9d82c4295285feeedfbe0d9016f4db0",class:"co-lightbox__counter",part:"counter",onClick:this.stop},r))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}],startIndex:[{onStartIndexChange:0}],images:[{onImagesChange:0}]}}static get style(){return":host{display:contents;font-family:var(--co-font-family-primary)}.co-lightbox{position:fixed;inset:0;margin:0;border:0;padding:0;width:auto;height:auto;overflow:visible;color:inherit;z-index:1100;display:flex;align-items:center;justify-content:center;background:var(--co-color-opacity-negro-80);opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-lightbox--open{opacity:1;pointer-events:auto}.co-lightbox__toolbar{position:absolute;top:0;left:0;right:0;z-index:2;display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-md) var(--co-spacing-lg);background:linear-gradient(var(--co-color-opacity-negro-50), transparent)}.co-lightbox__caption{flex:1;min-width:0;color:var(--co-color-base-blanco);font-size:var(--co-font-size-14);line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-lightbox__zoom{display:flex;align-items:center;gap:var(--co-spacing-xxs);padding:0 var(--co-spacing-xs);border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8)}.co-lightbox__btn{display:flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:0 var(--co-spacing-xs);border:none;border-radius:var(--co-border-radius-full);background:transparent;color:var(--co-color-base-blanco);font-family:inherit;font-size:var(--co-font-size-13, 13px);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-lightbox__btn:hover{background:var(--co-color-opacity-blanco-16)}.co-lightbox__zoom-value{min-width:48px;font-variant-numeric:tabular-nums}.co-lightbox__stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}.co-lightbox__img{max-width:calc(100vw - var(--co-spacing-5xl) * 2);max-height:calc(100vh - var(--co-spacing-5xl) * 2);border-radius:var(--co-border-radius-xs);user-select:none;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-lightbox__video{--co-lb-ar:1.7778;flex:0 0 auto;width:auto;aspect-ratio:var(--co-lb-ar);height:min( calc(100vh - var(--co-spacing-5xl) * 2), calc((100vw - var(--co-spacing-5xl) * 2) / var(--co-lb-ar)), calc(1200px / var(--co-lb-ar)) );border-radius:var(--co-border-radius-xs);overflow:hidden}.co-lightbox__img--zoomed{cursor:grab}.co-lightbox__img--dragging{cursor:grabbing;transition:none}.co-lightbox__nav{position:absolute;top:50%;transform:translateY(-50%);z-index:2;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:none;border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8);color:var(--co-color-base-blanco);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-lightbox__nav:hover{background:var(--co-color-opacity-blanco-25)}.co-lightbox__nav--prev{left:var(--co-spacing-lg)}.co-lightbox__nav--next{right:var(--co-spacing-lg)}.co-lightbox__counter{position:absolute;bottom:var(--co-spacing-lg);left:50%;transform:translateX(-50%);z-index:2;padding:var(--co-spacing-xs) var(--co-spacing-md);border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8);color:var(--co-color-base-blanco);font-size:var(--co-font-size-13, 13px);font-variant-numeric:tabular-nums}"}},[1,"co-lightbox",{images:[1],startIndex:[2,"start-index"],open:[1540],locale:[1],index:[32],scale:[32],tx:[32],ty:[32],dragging:[32]},void 0,{open:[{onOpenChange:0}],startIndex:[{onStartIndexChange:0}],images:[{onImagesChange:0}]}]);function d(){"undefined"!=typeof customElements&&["co-lightbox","co-icon","co-video"].forEach((i=>{switch(i){case"co-lightbox":customElements.get(t(i))||customElements.define(t(i),l);break;case"co-icon":customElements.get(t(i))||n();break;case"co-video":customElements.get(t(i))||r()}}))}d();export{l as C,d}
1
+ import{t,p as i,H as o,c as e,h as s}from"./index.js";import{l as a}from"./p-jYd9gu_c.js";import{d as n}from"./p-DNJAIVfI.js";import{d as r}from"./p-DFlJMEJ-.js";const c={es:{close:"Cerrar visor",prevImage:"Imagen anterior",nextImage:"Imagen siguiente",zoomIn:"Acercar",zoomOut:"Alejar",zoomReset:"Restablecer zoom",openOriginal:"Abrir original",counter:"{i} de {n}"},en:{close:"Close viewer",prevImage:"Previous image",nextImage:"Next image",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomReset:"Reset zoom",openOriginal:"Open original",counter:"{i} of {n}"},pt:{close:"Fechar visualizador",prevImage:"Imagem anterior",nextImage:"Próxima imagem",zoomIn:"Aproximar",zoomOut:"Afastar",zoomReset:"Redefinir zoom",openOriginal:"Abrir original",counter:"{i} de {n}"}},h=1.15,l=i(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coClose=e(this,"coClose",3),this.coChange=e(this,"coChange",3),this.images="[]",this.startIndex=0,this.open=!1,this.index=0,this.scale=1,this.tx=0,this.ty=0,this.dragging=!1,this.lastImagesStr="",this.lastParsed=[],this.dragStart={x:0,y:0,tx:0,ty:0},this.pendingFocus=!1,this.syncTopLayer=t=>{t&&(this.rootEl=t);const i=this.rootEl;if(i&&"function"==typeof i.showPopover)if(this.open){clearTimeout(this.demoteTimer);try{i.matches(":popover-open")||i.showPopover()}catch(t){}}else i.matches(":popover-open")&&(clearTimeout(this.demoteTimer),this.demoteTimer=setTimeout((()=>{try{i.hidePopover()}catch(t){}}),220))},this.handleKey=t=>{if(this.open){if("Escape"===t.key)return this.escapeBelongsToPlayer()||(this.requestClose(),t.preventDefault()),void t.stopPropagation();if("Tab"!==t.key){if(!this.isFocusInPlayer()){switch(t.key){case"ArrowLeft":this.goTo(-1);break;case"ArrowRight":this.goTo(1);break;case"+":case"=":if(this.isVideoSlide)return;this.zoomAt(this.scale*h,0,0);break;case"-":if(this.isVideoSlide)return;this.zoomAt(this.scale/h,0,0);break;case"0":if(this.isVideoSlide)return;this.resetView();break;default:return}t.preventDefault(),t.stopPropagation()}}else this.trapTab(t)}},this.requestClose=()=>{this.coClose.emit()},this.mountPlayer=t=>{t&&t!==this.playerEl&&(this.playerEl=t,this.tryAutoplay())},this.handlePlayerReady=t=>{var i;const{width:o,height:e}=t.detail||{};o&&e&&(null===(i=this.playerEl)||void 0===i||i.style.setProperty("--co-lb-ar",String(o/e)))},this.handleWheel=t=>{t.preventDefault();const[i,o]=this.stagePoint(t);this.zoomAt(this.scale*(t.deltaY<0?h:1/h),i,o)},this.handleDblClick=t=>{const[i,o]=this.stagePoint(t);this.zoomAt(this.scale>1?1:2.5,i,o)},this.handlePointerDown=t=>{var i;this.scale<=1||(t.preventDefault(),this.dragging=!0,this.dragStart={x:t.clientX,y:t.clientY,tx:this.tx,ty:this.ty},null===(i=this.imgEl)||void 0===i||i.setPointerCapture(t.pointerId))},this.handlePointerMove=t=>{if(!this.dragging)return;const i=this.dragStart.tx+(t.clientX-this.dragStart.x),o=this.dragStart.ty+(t.clientY-this.dragStart.y);[this.tx,this.ty]=this.clampPan(i,o,this.scale)},this.handlePointerUp=t=>{var i;this.dragging&&(this.dragging=!1,null===(i=this.imgEl)||void 0===i||i.releasePointerCapture(t.pointerId))},this.openOriginal=()=>{const t=this.parsedImages[this.index];(null==t?void 0:t.src)&&window.open(t.src,"_blank","noopener")},this.stop=t=>t.stopPropagation()}get activeItem(){return this.parsedImages[this.index]}get isVideoSlide(){var t;return"video"===(null===(t=this.activeItem)||void 0===t?void 0:t.kind)}get parsedImages(){const t=this.images;if("string"!=typeof t||!t.trim())return[];if(t===this.lastImagesStr)return this.lastParsed;let i=[];try{const o=JSON.parse(t);Array.isArray(o)&&(i=o.filter((t=>t&&t.src)))}catch(t){}return this.lastImagesStr=t,this.lastParsed=i,i}componentWillLoad(){this.index=this.clampIndex(this.startIndex),this.pendingAutoplay=this.open}connectedCallback(){this.open&&this.attachKeyListener()}disconnectedCallback(){this.detachKeyListener(),this.pauseVideo(),clearTimeout(this.demoteTimer)}componentDidRender(){var t;this.pendingFocus&&(this.pendingFocus=!1,null===(t=this.closeBtnEl)||void 0===t||t.focus())}onOpenChange(t){var i,o,e;this.syncTopLayer(),t?(this.index=this.clampIndex(this.startIndex),this.resetView(),this.preloadNeighbors(),this.attachKeyListener(),this.pendingAutoplay=!0,this.tryAutoplay(),this.previouslyFocused=null!==(i=document.activeElement)&&void 0!==i?i:void 0,this.pendingFocus=!0):(this.detachKeyListener(),this.pauseVideo(),this.pendingAutoplay=!1,null===(e=null===(o=this.previouslyFocused)||void 0===o?void 0:o.focus)||void 0===e||e.call(o),this.previouslyFocused=void 0)}onStartIndexChange(t){this.open&&(this.index=this.clampIndex(t),this.resetView())}onImagesChange(){this.index=this.clampIndex(this.index)}attachKeyListener(){window.addEventListener("keydown",this.handleKey,{capture:!0})}detachKeyListener(){window.removeEventListener("keydown",this.handleKey,{capture:!0})}focusables(){var t,i;return Array.from(null!==(i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.querySelectorAll("button, co-video"))&&void 0!==i?i:[]).flatMap((t=>{var i,o;return"CO-VIDEO"===t.tagName?Array.from(null!==(o=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll('button:not([tabindex="-1"]), [tabindex="0"]'))&&void 0!==o?o:[]):[t]}))}deepActive(){var t,i,o;let e=null!==(i=null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)&&void 0!==i?i:null;for(;null===(o=null==e?void 0:e.shadowRoot)||void 0===o?void 0:o.activeElement;)e=e.shadowRoot.activeElement;return e}escapeBelongsToPlayer(){var t,i;const o=document;return!(!o.fullscreenElement&&!o.webkitFullscreenElement&&!(null===(i=null===(t=this.playerEl)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector(".co-video__speed-menu")))}isFocusInPlayer(){var t;const i=this.playerEl;return!!i&&(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.activeElement)===i}trapTab(t){const i=this.focusables();if(0===i.length)return;t.preventDefault(),t.stopPropagation();const o=t.shiftKey?-1:1,e=i.indexOf(this.deepActive());(e<0?i[o>0?0:i.length-1]:i[(e+o+i.length)%i.length]).focus()}clampIndex(t){const i=this.parsedImages.length;return 0===i?0:Math.min(Math.max(0,t),i-1)}resetView(){this.scale=1,this.tx=0,this.ty=0,this.dragging=!1}goTo(t){const i=this.parsedImages.length;i<2||(this.pauseVideo(),this.pendingAutoplay=!1,this.index=(this.index+t+i)%i,this.resetView(),this.coChange.emit(this.index),this.preloadNeighbors())}preloadNeighbors(){const t=this.parsedImages;if(!(t.length<2))for(const i of[1,-1]){const o=t[(this.index+i+t.length)%t.length];if(!o)continue;const e="video"===o.kind?o.poster:o.src;e&&((new Image).src=e)}}tryAutoplay(){var t;if(!this.pendingAutoplay||!this.open)return;if(!this.isVideoSlide)return void(this.pendingAutoplay=!1);const i=this.playerEl;i&&(this.pendingAutoplay=!1,Promise.resolve(null===(t=i.componentOnReady)||void 0===t?void 0:t.call(i)).then((()=>{var t;if(this.open&&this.playerEl===i&&this.isVideoSlide)return null===(t=i.play)||void 0===t?void 0:t.call(i)})).catch((()=>{})))}pauseVideo(){var t,i;try{const o=null===(i=null===(t=this.playerEl)||void 0===t?void 0:t.pause)||void 0===i?void 0:i.call(t);o&&"function"==typeof o.catch&&o.catch((()=>{}))}catch(t){}}clampPan(t,i,o){const e=this.stageEl,s=this.imgEl;if(!e||!s)return[t,i];const a=Math.max(0,(s.offsetWidth*o-e.clientWidth)/2),n=Math.max(0,(s.offsetHeight*o-e.clientHeight)/2);return[Math.min(Math.max(t,-a),a),Math.min(Math.max(i,-n),n)]}zoomAt(t,i,o){const e=this.scale,s=Math.min(Math.max(t,1),8);if(s===e)return;const a=s/e;let n=i-(i-this.tx)*a,r=o-(o-this.ty)*a;1===s?(n=0,r=0):[n,r]=this.clampPan(n,r,s),this.scale=s,this.tx=n,this.ty=r}stagePoint(t){var i;const o=null===(i=this.stageEl)||void 0===i?void 0:i.getBoundingClientRect();return o?[t.clientX-o.left-o.width/2,t.clientY-o.top-o.height/2]:[0,0]}render(){const t=c[a(this.locale)],i=this.parsedImages,o=i[this.index],e=i.length>1,n="video"===(null==o?void 0:o.kind),r=t.counter.replace("{i}",String(this.index+1)).replace("{n}",String(i.length));return s("div",{key:"1a3c29e98fd491c92b82ba9d9296588609cdd006",class:{"co-lightbox":!0,"co-lightbox--open":this.open},part:"overlay",role:"dialog","aria-modal":"true","aria-label":null==o?void 0:o.alt,popover:"manual",ref:this.syncTopLayer,onClick:this.requestClose},o&&s("div",{key:"cc9e9db83ef082deab744f259c4da63a58eb0c3b",class:"co-lightbox__toolbar",part:"toolbar",onClick:this.stop},s("span",{key:"ab3fa42e21008407f2cab377566a1793a96a8a50",class:"co-lightbox__caption",title:o.alt},o.alt),!n&&s("div",{key:"af8761111e7c5e0e7a838d8e69971cc2863ee9d4",class:"co-lightbox__zoom"},s("button",{key:"e73628b4fd25fa7c3ed9ca947fccd196e6433f84",class:"co-lightbox__btn",type:"button","aria-label":t.zoomOut,title:t.zoomOut,onClick:()=>this.zoomAt(this.scale/h,0,0)},s("co-icon",{key:"371f4edc5141561b348ce36a8791fb81500248fa",name:"minus",size:16})),s("button",{key:"e07adc772687ef65d97db5669ed235749e43c034",class:"co-lightbox__btn co-lightbox__zoom-value",type:"button","aria-label":t.zoomReset,title:t.zoomReset,onClick:()=>this.resetView()},Math.round(100*this.scale),"%"),s("button",{key:"29ed305a4f464e38c4b4ef331dbbfc35aa6fdc95",class:"co-lightbox__btn",type:"button","aria-label":t.zoomIn,title:t.zoomIn,onClick:()=>this.zoomAt(this.scale*h,0,0)},s("co-icon",{key:"6b56559a4dad36bee62545deb426734450f64f58",name:"plus",size:16}))),s("button",{key:"53099c4e3dec82cfc9087e89916154ef4a8845f6",class:"co-lightbox__btn",type:"button","aria-label":t.openOriginal,title:t.openOriginal,onClick:this.openOriginal},s("co-icon",{key:"de160ed313ba0559cd1523f9f73fad7e3b167848",name:"arrow-square-out",size:16})),s("button",{key:"d1658ff7b8d0fc22f1a489c0138a16077304a165",class:"co-lightbox__btn",part:"close",type:"button","aria-label":t.close,title:t.close,ref:t=>this.closeBtnEl=t,onClick:this.requestClose},s("co-icon",{key:"fcbcbbf6001e67199b6ec7b99bde5f9f24537ca0",name:"x",size:16}))),o&&s("div",{key:"39cef6c2bd1bf3fe9f641778b48b618a62f1b5f8",class:"co-lightbox__stage",ref:t=>this.stageEl=t,onWheel:n?void 0:this.handleWheel},n?s("co-video",{class:"co-lightbox__video",part:"video",key:`video-${this.index}`,ref:this.mountPlayer,src:o.src,poster:o.poster||"",aspectRatio:"auto",rounded:"none",controlsAutoHide:!1,showSpeed:!0,showPip:!0,locale:a(this.locale),onCoReady:this.handlePlayerReady,onClick:this.stop}):s("img",{class:{"co-lightbox__img":!0,"co-lightbox__img--zoomed":this.scale>1,"co-lightbox__img--dragging":this.dragging},part:"image",ref:t=>this.imgEl=t,src:o.src,alt:o.alt||"",draggable:!1,style:{transform:`translate(${this.tx}px, ${this.ty}px) scale(${this.scale})`},onClick:this.stop,onDblClick:this.handleDblClick,onPointerDown:this.handlePointerDown,onPointerMove:this.handlePointerMove,onPointerUp:this.handlePointerUp,onPointerCancel:this.handlePointerUp})),o&&e&&s("button",{key:"a161402e30021374f608755ea0a5dc6ccee0e99a",class:"co-lightbox__nav co-lightbox__nav--prev",part:"prev",type:"button","aria-label":t.prevImage,title:t.prevImage,onClick:t=>{t.stopPropagation(),this.goTo(-1)}},s("co-icon",{key:"649171d5330299b3ccb368bb0b434c643157c3f5",name:"caret-left",size:24})),o&&e&&s("button",{key:"5cc5d07467e1ecf9c27094947ce421c28c35472d",class:"co-lightbox__nav co-lightbox__nav--next",part:"next",type:"button","aria-label":t.nextImage,title:t.nextImage,onClick:t=>{t.stopPropagation(),this.goTo(1)}},s("co-icon",{key:"d9d32607a6b4350009db5c1719987aa8afcbb007",name:"caret-right",size:24})),o&&e&&s("div",{key:"a23f10a2c9d82c4295285feeedfbe0d9016f4db0",class:"co-lightbox__counter",part:"counter",onClick:this.stop},r))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}],startIndex:[{onStartIndexChange:0}],images:[{onImagesChange:0}]}}static get style(){return":host{display:contents;font-family:var(--co-font-family-primary)}.co-lightbox{position:fixed;inset:0;margin:0;border:0;padding:0;width:auto;height:auto;overflow:visible;color:inherit;z-index:1100;display:flex;align-items:center;justify-content:center;background:var(--co-color-opacity-negro-80);opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-lightbox--open{opacity:1;pointer-events:auto}.co-lightbox__toolbar{position:absolute;top:0;left:0;right:0;z-index:2;display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-md) var(--co-spacing-lg);background:linear-gradient(var(--co-color-opacity-negro-50), transparent)}.co-lightbox__caption{flex:1;min-width:0;color:var(--co-color-base-blanco);font-size:var(--co-font-size-14);line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-lightbox__zoom{display:flex;align-items:center;gap:var(--co-spacing-xxs);padding:0 var(--co-spacing-xs);border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8)}.co-lightbox__btn{display:flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:0 var(--co-spacing-xs);border:none;border-radius:var(--co-border-radius-full);background:transparent;color:var(--co-color-base-blanco);font-family:inherit;font-size:var(--co-font-size-13, 13px);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-lightbox__btn:hover{background:var(--co-color-opacity-blanco-16)}.co-lightbox__zoom-value{min-width:48px;font-variant-numeric:tabular-nums}.co-lightbox__stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}.co-lightbox__img{max-width:calc(100vw - var(--co-spacing-5xl) * 2);max-height:calc(100vh - var(--co-spacing-5xl) * 2);border-radius:var(--co-border-radius-xs);user-select:none;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-lightbox__video{--co-lb-ar:1.7778;flex:0 0 auto;width:auto;aspect-ratio:var(--co-lb-ar);height:min( calc(100vh - var(--co-spacing-5xl) * 2), calc((100vw - var(--co-spacing-5xl) * 2) / var(--co-lb-ar)), calc(1200px / var(--co-lb-ar)) );border-radius:var(--co-border-radius-xs);overflow:hidden}.co-lightbox__img--zoomed{cursor:grab}.co-lightbox__img--dragging{cursor:grabbing;transition:none}.co-lightbox__nav{position:absolute;top:50%;transform:translateY(-50%);z-index:2;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:none;border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8);color:var(--co-color-base-blanco);cursor:pointer;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-lightbox__nav:hover{background:var(--co-color-opacity-blanco-25)}.co-lightbox__nav--prev{left:var(--co-spacing-lg)}.co-lightbox__nav--next{right:var(--co-spacing-lg)}.co-lightbox__counter{position:absolute;bottom:var(--co-spacing-lg);left:50%;transform:translateX(-50%);z-index:2;padding:var(--co-spacing-xs) var(--co-spacing-md);border-radius:var(--co-border-radius-full);background:var(--co-color-opacity-blanco-8);color:var(--co-color-base-blanco);font-size:var(--co-font-size-13, 13px);font-variant-numeric:tabular-nums}"}},[1,"co-lightbox",{images:[1],startIndex:[2,"start-index"],open:[1540],locale:[1],index:[32],scale:[32],tx:[32],ty:[32],dragging:[32]},void 0,{open:[{onOpenChange:0}],startIndex:[{onStartIndexChange:0}],images:[{onImagesChange:0}]}]);function d(){"undefined"!=typeof customElements&&["co-lightbox","co-icon","co-video"].forEach((i=>{switch(i){case"co-lightbox":customElements.get(t(i))||customElements.define(t(i),l);break;case"co-icon":customElements.get(t(i))||n();break;case"co-video":customElements.get(t(i))||r()}}))}d();export{l as C,d}
@@ -1 +1 @@
1
- import{t as a,p as t,H as r,h as o}from"./index.js";import{i as e}from"./p-BRbgGqLw.js";import{d as i}from"./p-DNJAIVfI.js";import{d as s}from"./p-zuhal3IZ.js";const c={xl:80,lg:64,md:56,sm:48,xs:32,xxs:24},n={xl:32,lg:28,md:24,sm:20,xs:16,xxs:12},l={xl:"var(--co-font-size-26)",lg:"var(--co-font-size-22)",md:"var(--co-font-size-18)",sm:"var(--co-font-size-16)",xs:"var(--co-font-size-12)",xxs:"var(--co-font-size-10)"},v=t(class extends r{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.type="text",this.size="md",this.icon="user",this.iconWeight="regular",this.shape="circle",this.imgFailed=!1,this.handleImgError=()=>{this.imgFailed=!0}}render(){var a,t,r,i,s,v,L;const h=null!==(a=c[this.size])&&void 0!==a?a:56,m=null!==(t=n[this.size])&&void 0!==t?t:24,d=null!==(r=l[this.size])&&void 0!==r?r:"var(--co-font-size-18)",p="image"===this.type&&this.src&&!this.imgFailed,u="icon"===this.type||"image"===this.type&&!p&&!this.text,g="text"===this.type?this.text:"image"===this.type&&null!==(s=null!==(i=this.alt)&&void 0!==i?i:this.text)&&void 0!==s?s:this.icon,f=o("div",{class:{"co-avatar":!0,[`co-avatar--${this.size}`]:!0,[`co-avatar--${this.type}`]:!0,"co-avatar--square":"square"===this.shape,"co-avatar--light":!!this.color&&e(this.color)},style:Object.assign(Object.assign({width:`var(--co-avatar-size, ${h}px)`,height:`var(--co-avatar-size, ${h}px)`,fontSize:d},this.color?{background:this.color}:{}),this.ringColor?{"--co-avatar-border-color":this.ringColor,"--co-avatar-border-width":"2px"}:{}),part:"avatar",role:"img","aria-label":g},p?o("img",{class:"co-avatar__img",src:this.src,alt:null!==(L=null!==(v=this.alt)&&void 0!==v?v:this.text)&&void 0!==L?L:"",onError:this.handleImgError}):u?o("co-icon",{name:this.icon,weight:this.iconWeight,size:m}):o("span",{class:"co-avatar__text"},this.text));return this.name?o("co-tooltip",{content:this.name},f):f}static get style(){return":host{display:inline-flex;--co-avatar-squircle:url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M100 50L99.94 68.06L99.75 73.81L99.44 77.94L99.01 81.26L98.44 84.05L97.74 86.46L96.91 88.57L95.94 90.43L94.81 92.07L93.53 93.53L92.07 94.81L90.43 95.94L88.57 96.91L86.46 97.74L84.05 98.44L81.26 99.01L77.94 99.44L73.81 99.75L68.06 99.94L50 100L31.94 99.94L26.19 99.75L22.06 99.44L18.74 99.01L15.95 98.44L13.54 97.74L11.43 96.91L9.57 95.94L7.93 94.81L6.47 93.53L5.19 92.07L4.06 90.43L3.09 88.57L2.26 86.46L1.56 84.05L0.99 81.26L0.56 77.94L0.25 73.81L0.06 68.06L0 50L0.06 31.94L0.25 26.19L0.56 22.06L0.99 18.74L1.56 15.95L2.26 13.54L3.09 11.43L4.06 9.57L5.19 7.93L6.47 6.47L7.93 5.19L9.57 4.06L11.43 3.09L13.54 2.26L15.95 1.56L18.74 0.99L22.06 0.56L26.19 0.25L31.94 0.06L50 0L68.06 0.06L73.81 0.25L77.94 0.56L81.26 0.99L84.05 1.56L86.46 2.26L88.57 3.09L90.43 4.06L92.07 5.19L93.53 6.47L94.81 7.93L95.94 9.57L96.91 11.43L97.74 13.54L98.44 15.95L99.01 18.74L99.44 22.06L99.75 26.19L99.94 31.94Z' fill='%23fff'/></svg>\")}.co-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-family:var(--co-font-family-primary);font-weight:600;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);overflow:hidden;flex-shrink:0;user-select:none;-webkit-font-smoothing:antialiased}.co-avatar::after{content:'';position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 0 var(--co-avatar-border-width, 1px) var(--co-avatar-border-color, transparent)}.co-avatar__text{text-transform:uppercase}.co-avatar__img{width:100%;height:100%;object-fit:cover;display:block}.co-avatar--square{border-radius:0;-webkit-mask:var(--co-avatar-squircle) center / 100% 100% no-repeat;mask:var(--co-avatar-squircle) center / 100% 100% no-repeat}.co-avatar--square::after{--co-avatar-bw:var(--co-avatar-border-width, 1px);box-shadow:none;background:var(--co-avatar-border-color, transparent);-webkit-mask:var(--co-avatar-squircle) center / 100% 100% no-repeat, var(--co-avatar-squircle) center / calc(100% - 2 * var(--co-avatar-bw)) calc(100% - 2 * var(--co-avatar-bw)) no-repeat;-webkit-mask-composite:xor;mask:var(--co-avatar-squircle) center / 100% 100% no-repeat, var(--co-avatar-squircle) center / calc(100% - 2 * var(--co-avatar-bw)) calc(100% - 2 * var(--co-avatar-bw)) no-repeat;mask-composite:exclude}.co-avatar--light{color:rgba(0, 0, 0, 0.87)}co-tooltip{display:inline-flex;align-items:center;line-height:0}"}},[1,"co-avatar",{type:[1],size:[1],text:[1],src:[1],alt:[1],icon:[1],iconWeight:[1,"icon-weight"],shape:[1],color:[1],ringColor:[513,"ring-color"],name:[1],imgFailed:[32]}]);function L(){"undefined"!=typeof customElements&&["co-avatar","co-icon","co-tooltip"].forEach((t=>{switch(t){case"co-avatar":customElements.get(a(t))||customElements.define(a(t),v);break;case"co-icon":customElements.get(a(t))||i();break;case"co-tooltip":customElements.get(a(t))||s()}}))}L();export{v as C,L as d}
1
+ import{t as a,p as t,H as r,h as o}from"./index.js";import{i as e}from"./p-BRbgGqLw.js";import{d as i}from"./p-DNJAIVfI.js";import{d as s}from"./p-Bsh0JMGf.js";const c={xl:80,lg:64,md:56,sm:48,xs:32,xxs:24},n={xl:32,lg:28,md:24,sm:20,xs:16,xxs:12},l={xl:"var(--co-font-size-26)",lg:"var(--co-font-size-22)",md:"var(--co-font-size-18)",sm:"var(--co-font-size-16)",xs:"var(--co-font-size-12)",xxs:"var(--co-font-size-10)"},v=t(class extends r{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.type="text",this.size="md",this.icon="user",this.iconWeight="regular",this.shape="circle",this.imgFailed=!1,this.handleImgError=()=>{this.imgFailed=!0}}render(){var a,t,r,i,s,v,L;const h=null!==(a=c[this.size])&&void 0!==a?a:56,m=null!==(t=n[this.size])&&void 0!==t?t:24,d=null!==(r=l[this.size])&&void 0!==r?r:"var(--co-font-size-18)",p="image"===this.type&&this.src&&!this.imgFailed,u="icon"===this.type||"image"===this.type&&!p&&!this.text,x="text"===this.type?this.text:"image"===this.type&&null!==(s=null!==(i=this.alt)&&void 0!==i?i:this.text)&&void 0!==s?s:this.icon,f=o("div",{class:{"co-avatar":!0,[`co-avatar--${this.size}`]:!0,[`co-avatar--${this.type}`]:!0,"co-avatar--square":"square"===this.shape,"co-avatar--light":!!this.color&&e(this.color)},style:Object.assign(Object.assign({width:`var(--co-avatar-size, ${h}px)`,height:`var(--co-avatar-size, ${h}px)`,fontSize:d},this.color?{background:this.color}:{}),this.ringColor?{"--co-avatar-border-color":this.ringColor,"--co-avatar-border-width":"2px"}:{}),part:"avatar",role:"img","aria-label":x},p?o("img",{class:"co-avatar__img",src:this.src,alt:null!==(L=null!==(v=this.alt)&&void 0!==v?v:this.text)&&void 0!==L?L:"",onError:this.handleImgError}):u?o("co-icon",{name:this.icon,weight:this.iconWeight,size:m}):o("span",{class:"co-avatar__text"},this.text));return this.name?o("co-tooltip",{content:this.name},f):f}static get style(){return":host{display:inline-flex;--co-avatar-squircle:url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M100 50L99.94 68.06L99.75 73.81L99.44 77.94L99.01 81.26L98.44 84.05L97.74 86.46L96.91 88.57L95.94 90.43L94.81 92.07L93.53 93.53L92.07 94.81L90.43 95.94L88.57 96.91L86.46 97.74L84.05 98.44L81.26 99.01L77.94 99.44L73.81 99.75L68.06 99.94L50 100L31.94 99.94L26.19 99.75L22.06 99.44L18.74 99.01L15.95 98.44L13.54 97.74L11.43 96.91L9.57 95.94L7.93 94.81L6.47 93.53L5.19 92.07L4.06 90.43L3.09 88.57L2.26 86.46L1.56 84.05L0.99 81.26L0.56 77.94L0.25 73.81L0.06 68.06L0 50L0.06 31.94L0.25 26.19L0.56 22.06L0.99 18.74L1.56 15.95L2.26 13.54L3.09 11.43L4.06 9.57L5.19 7.93L6.47 6.47L7.93 5.19L9.57 4.06L11.43 3.09L13.54 2.26L15.95 1.56L18.74 0.99L22.06 0.56L26.19 0.25L31.94 0.06L50 0L68.06 0.06L73.81 0.25L77.94 0.56L81.26 0.99L84.05 1.56L86.46 2.26L88.57 3.09L90.43 4.06L92.07 5.19L93.53 6.47L94.81 7.93L95.94 9.57L96.91 11.43L97.74 13.54L98.44 15.95L99.01 18.74L99.44 22.06L99.75 26.19L99.94 31.94Z' fill='%23fff'/></svg>\")}.co-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-family:var(--co-font-family-primary);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);overflow:hidden;flex-shrink:0;user-select:none;-webkit-font-smoothing:antialiased}.co-avatar::after{content:'';position:absolute;inset:0;pointer-events:none;border-radius:inherit;box-shadow:inset 0 0 0 var(--co-avatar-border-width, 1px) var(--co-avatar-border-color, transparent)}.co-avatar__text{text-transform:uppercase}.co-avatar--xxs .co-avatar__text,.co-avatar--xs .co-avatar__text,.co-avatar--sm .co-avatar__text,.co-avatar--md .co-avatar__text{transform:translateY(0.5px)}.co-avatar__img{width:100%;height:100%;object-fit:cover;display:block}.co-avatar--square{border-radius:0;-webkit-mask:var(--co-avatar-squircle) center / 100% 100% no-repeat;mask:var(--co-avatar-squircle) center / 100% 100% no-repeat}.co-avatar--square::after{--co-avatar-bw:var(--co-avatar-border-width, 1px);box-shadow:none;background:var(--co-avatar-border-color, transparent);-webkit-mask:var(--co-avatar-squircle) center / 100% 100% no-repeat, var(--co-avatar-squircle) center / calc(100% - 2 * var(--co-avatar-bw)) calc(100% - 2 * var(--co-avatar-bw)) no-repeat;-webkit-mask-composite:xor;mask:var(--co-avatar-squircle) center / 100% 100% no-repeat, var(--co-avatar-squircle) center / calc(100% - 2 * var(--co-avatar-bw)) calc(100% - 2 * var(--co-avatar-bw)) no-repeat;mask-composite:exclude}.co-avatar--light{color:rgba(0, 0, 0, 0.87)}co-tooltip{display:inline-flex;align-items:center;line-height:0}"}},[1,"co-avatar",{type:[1],size:[1],text:[1],src:[1],alt:[1],icon:[1],iconWeight:[1,"icon-weight"],shape:[1],color:[1],ringColor:[513,"ring-color"],name:[1],imgFailed:[32]}]);function L(){"undefined"!=typeof customElements&&["co-avatar","co-icon","co-tooltip"].forEach((t=>{switch(t){case"co-avatar":customElements.get(a(t))||customElements.define(a(t),v);break;case"co-icon":customElements.get(a(t))||i();break;case"co-tooltip":customElements.get(a(t))||s()}}))}L();export{v as C,L as d}
@@ -1 +1 @@
1
- import{t,p as i,H as e,c as s,h as o}from"./index.js";import{g as n}from"./p-jYd9gu_c.js";import{d as r}from"./p-DNJAIVfI.js";const a=new Map,l=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coInput=s(this,"coInput",7),this.coCommit=s(this,"coCommit",7),this.coEscape=s(this,"coEscape",7),this.value=null,this.hour12=!0,this.locale="es-CO",this.disabled=!1,this.pageStep=15,this.hour24=null,this.minute=null,this.focused=null,this.buffer="",this.onSegKeyDown=t=>i=>{var e;if(this.disabled)return;const s=i.key;if("Enter"!==s){if("Escape"===s)return i.preventDefault(),void this.coEscape.emit();if("ArrowUp"===s||"ArrowDown"===s)return i.preventDefault(),this.buffer="",void this.stepSegment(t,"ArrowUp"===s?1:-1);if("PageUp"===s||"PageDown"===s){i.preventDefault(),this.buffer="";const t=Math.max(1,Math.round(this.pageStep))*("PageUp"===s?1:-1),o=((null!==(e=this.minutesOfDay())&&void 0!==e?e:540)+t+1440)%1440;return this.hour24=Math.floor(o/60),this.minute=o%60,void this.emitDraft()}if("ArrowLeft"!==s&&"ArrowRight"!==s){if("Backspace"===s||"Delete"===s)return i.preventDefault(),this.buffer="",void("hour"===t?(this.hour24=null,this.coInput.emit(null)):"minute"===t&&(this.minute=null,this.coInput.emit(null)));if("period"===t&&this.hour12&&/^[ap]$/i.test(s)){i.preventDefault();const t="p"===s.toLowerCase();return null==this.hour24?this.hour24=t?21:9:t!==this.isPm&&(this.hour24=(this.hour24+12)%24),null==this.minute&&(this.minute=0),void this.emitDraft()}/^\d$/.test(s)&&"period"!==t&&(i.preventDefault(),this.typeDigit(t,Number(s)))}else{i.preventDefault(),this.buffer="";const e=this.hour12?["hour","minute","period"]:["hour","minute"],o=e.indexOf(t)+("ArrowRight"===s?1:-1),n=e[Math.max(0,Math.min(e.length-1,o))];n!==t&&this.focusSegment(n)}}else{i.preventDefault();const t=this.minutesOfDay();null!=t&&this.coCommit.emit(t)}},this.onStepperClick=t=>i=>{var e;i.preventDefault(),this.disabled||(this.buffer="",this.stepSegment(null!==(e=this.focused)&&void 0!==e?e:"hour",t))}}componentWillLoad(){this.syncFromValue(this.value)}syncFromValue(t){if(null==t||!Number.isFinite(t))return this.buffer="",this.hour24=null,void(this.minute=null);const i=Math.max(0,Math.min(1439,Math.round(t)));this.minutesOfDay()!==i&&(this.buffer="",this.hour24=Math.floor(i/60),this.minute=i%60)}async focusInput(){var t;null===(t=this.hourEl)||void 0===t||t.focus()}minutesOfDay(){return null==this.hour24||null==this.minute?null:60*this.hour24+this.minute}get isPm(){var t;return(null!==(t=this.hour24)&&void 0!==t?t:0)>=12}displayHour(){return null==this.hour24?null:this.hour12?this.hour24%12||12:this.hour24}emitDraft(){const t=this.minutesOfDay();null!=t&&this.coInput.emit(t)}setDisplayHour(t){if(this.hour12){const i=t%12;this.hour24=this.isPm?i+12:i}else this.hour24=Math.max(0,Math.min(23,t));null==this.minute&&(this.minute=0),this.emitDraft()}stepSegment(t,i){var e,s,o;if("hour"===t){const t=null!==(e=this.hour24)&&void 0!==e?e:9;this.hour24=(t+i+24)%24,null==this.minute&&(this.minute=0)}else if("minute"===t){const t=null!==(s=this.minute)&&void 0!==s?s:0;this.minute=(t+i+60)%60,null==this.hour24&&(this.hour24=9)}else this.hour24=((null!==(o=this.hour24)&&void 0!==o?o:9)+12)%24,null==this.minute&&(this.minute=0);this.emitDraft()}typeDigit(t,i){this.buffer+=String(i);const e=Number(this.buffer);if("hour"===t){e>(this.hour12?12:23)&&(this.buffer=String(i));const t=Number(this.buffer);this.hour12?t>=1&&this.setDisplayHour(t):2===this.buffer.length||t>2?(this.hour24=Math.min(23,t),null==this.minute&&(this.minute=0),this.emitDraft()):t>0&&(this.hour24=t,null==this.minute&&(this.minute=0),this.emitDraft()),(2===this.buffer.length||(this.hour12?10*t>12:10*t>23))&&this.advanceFrom("hour")}else if("minute"===t){e>59&&(this.buffer=String(i));const t=Number(this.buffer);this.minute=t,null==this.hour24&&(this.hour24=9),this.emitDraft(),(2===this.buffer.length||t>5)&&this.advanceFrom("minute")}}advanceFrom(t){this.buffer="";const i=this.hour12?["hour","minute","period"]:["hour","minute"],e=i.indexOf(t),s=i[e+1];s&&this.focusSegment(s)}focusSegment(t){var i;null===(i=this.el.shadowRoot.querySelector(`.co-time-field__seg--${t}`))||void 0===i||i.focus()}renderSeg(t,i){const e="hour"===t?i.hourLabel:"minute"===t?i.minuteLabel:i.dayPeriodLabel;let s,n=null,r=0,l=59;if("hour"===t){const t=this.displayHour();s=null==t?"––":String(t).padStart(2,"0"),n=t,r=this.hour12?1:0,l=this.hour12?12:23}else if("minute"===t)s=null==this.minute?"––":String(this.minute).padStart(2,"0"),n=this.minute;else{const t=null==this.hour24,{am:i,pm:e}=function(t){var i,e,s,o;const n=a.get(t);if(n)return n;const r=new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}),l={am:null!==(e=null===(i=r.formatToParts(new Date(2e3,0,1,9,0)).find((t=>"dayPeriod"===t.type)))||void 0===i?void 0:i.value)&&void 0!==e?e:"AM",pm:null!==(o=null===(s=r.formatToParts(new Date(2e3,0,1,21,0)).find((t=>"dayPeriod"===t.type)))||void 0===s?void 0:s.value)&&void 0!==o?o:"PM"};return a.set(t,l),l}(this.locale);s=this.isPm?e:i,n=t?null:this.isPm?1:0,r=0,l=1}const c="hour"===t&&null==this.hour24||"minute"===t&&null==this.minute||"period"===t&&null==this.hour24;return o("span",{ref:"hour"===t?t=>this.hourEl=t:void 0,class:{"co-time-field__seg":!0,[`co-time-field__seg--${t}`]:!0,"co-time-field__seg--empty":c},role:"spinbutton",tabIndex:this.disabled?-1:0,"aria-label":e,"aria-valuemin":String(r),"aria-valuemax":String(l),"aria-valuenow":null==n?void 0:String(n),"aria-valuetext":c?void 0:s,"aria-disabled":this.disabled?"true":void 0,onKeyDown:this.onSegKeyDown(t),onFocus:()=>{this.focused=t,this.buffer=""},onBlur:()=>{this.focused===t&&(this.focused=null)}},s)}render(){const t=n(this.locale);return o("div",{key:"e9feeca94b48ef78597c8a8aeb56e147cc639cac",class:{"co-time-field":!0,"co-time-field--disabled":this.disabled},role:"group","aria-label":this.fieldLabel||t.timeFieldLabel},o("span",{key:"a1b992c5bbb5dfd2dfec4aedadf7f432a218a36c",class:"co-time-field__segs"},this.renderSeg("hour",t),o("span",{key:"dbc63905e7c40a17e01dd2a7e69b914c9d5359e3",class:"co-time-field__sep","aria-hidden":"true"},":"),this.renderSeg("minute",t),this.hour12&&this.renderSeg("period",t)),o("span",{key:"b48347646ac193984b5d247709280ef00569c5d8",class:"co-time-field__steppers"},o("button",{key:"594b11fc3e26a3a6f72becbb6eed0896304dd773",type:"button",tabIndex:-1,"aria-hidden":"true",onMouseDown:t=>t.preventDefault(),onClick:this.onStepperClick(1)},o("co-icon",{key:"d7467c53e0e863633c5efc0ce1574e43f2f317ad",name:"caret-up",size:10})),o("button",{key:"c8a0e2aeeb202d09d7f6b96fadc10c96d2cd5b7c",type:"button",tabIndex:-1,"aria-hidden":"true",onMouseDown:t=>t.preventDefault(),onClick:this.onStepperClick(-1)},o("co-icon",{key:"4358757b857d4011f0b05dcb14b82f35057c7e64",name:"caret-down",size:10}))))}get el(){return this}static get watchers(){return{value:[{syncFromValue:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);letter-spacing:var(--co-font-letter-spacing-body)}.co-time-field{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-xs);min-height:32px;padding:3px var(--co-spacing-sm) 3px var(--co-spacing-sm2);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);box-sizing:border-box;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-time-field:focus-within{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-time-field--disabled{background:var(--co-semantic-surface-disabled);border-color:transparent;pointer-events:none}.co-time-field__segs{display:inline-flex;align-items:center;gap:1px}.co-time-field__seg{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:24px;padding:0 3px;border-radius:var(--co-border-radius-xxs);font-size:var(--co-font-size-14);font-variant-numeric:tabular-nums;color:var(--co-semantic-text-default);box-sizing:border-box;cursor:default;user-select:none;outline:none}.co-time-field__seg:focus{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-weight:600}.co-time-field__seg--period{margin-left:var(--co-spacing-xs);font-size:var(--co-font-size-13)}.co-time-field__seg--empty{color:var(--co-semantic-text-muted)}.co-time-field__sep{color:var(--co-semantic-text-muted)}.co-time-field__steppers{display:inline-flex;flex-direction:column}.co-time-field__steppers button{display:inline-flex;align-items:center;justify-content:center;width:20px;height:12px;padding:0;border:0;background:transparent;color:var(--co-semantic-text-muted);cursor:pointer}.co-time-field__steppers button:hover{color:var(--co-semantic-text-default)}:host([data-touch]) .co-time-field{min-height:44px;padding:var(--co-spacing-sm) var(--co-spacing-sm2)}:host([data-touch]) .co-time-field__seg{min-width:34px;height:32px;font-size:var(--co-font-size-16)}"}},[1,"co-time-field",{value:[2],hour12:[4,"hour-1-2"],locale:[1],disabled:[4],pageStep:[2,"page-step"],fieldLabel:[1,"field-label"],hour24:[32],minute:[32],focused:[32],focusInput:[64]},void 0,{value:[{syncFromValue:0}]}]);function c(){"undefined"!=typeof customElements&&["co-time-field","co-icon"].forEach((i=>{switch(i){case"co-time-field":customElements.get(t(i))||customElements.define(t(i),l);break;case"co-icon":customElements.get(t(i))||r()}}))}c();export{l as C,c as d}
1
+ import{t,p as i,H as e,c as s,h as o}from"./index.js";import{g as n}from"./p-jYd9gu_c.js";import{d as r}from"./p-DNJAIVfI.js";const a=new Map,l=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coInput=s(this,"coInput",7),this.coCommit=s(this,"coCommit",7),this.coEscape=s(this,"coEscape",7),this.value=null,this.hour12=!0,this.locale="es-CO",this.disabled=!1,this.pageStep=15,this.hour24=null,this.minute=null,this.focused=null,this.buffer="",this.onSegKeyDown=t=>i=>{var e;if(this.disabled)return;const s=i.key;if("Enter"!==s){if("Escape"===s)return i.preventDefault(),void this.coEscape.emit();if("ArrowUp"===s||"ArrowDown"===s)return i.preventDefault(),this.buffer="",void this.stepSegment(t,"ArrowUp"===s?1:-1);if("PageUp"===s||"PageDown"===s){i.preventDefault(),this.buffer="";const t=Math.max(1,Math.round(this.pageStep))*("PageUp"===s?1:-1),o=((null!==(e=this.minutesOfDay())&&void 0!==e?e:540)+t+1440)%1440;return this.hour24=Math.floor(o/60),this.minute=o%60,void this.emitDraft()}if("ArrowLeft"!==s&&"ArrowRight"!==s){if("Backspace"===s||"Delete"===s)return i.preventDefault(),this.buffer="",void("hour"===t?(this.hour24=null,this.coInput.emit(null)):"minute"===t&&(this.minute=null,this.coInput.emit(null)));if("period"===t&&this.hour12&&/^[ap]$/i.test(s)){i.preventDefault();const t="p"===s.toLowerCase();return null==this.hour24?this.hour24=t?21:9:t!==this.isPm&&(this.hour24=(this.hour24+12)%24),null==this.minute&&(this.minute=0),void this.emitDraft()}/^\d$/.test(s)&&"period"!==t&&(i.preventDefault(),this.typeDigit(t,Number(s)))}else{i.preventDefault(),this.buffer="";const e=this.hour12?["hour","minute","period"]:["hour","minute"],o=e.indexOf(t)+("ArrowRight"===s?1:-1),n=e[Math.max(0,Math.min(e.length-1,o))];n!==t&&this.focusSegment(n)}}else{i.preventDefault();const t=this.minutesOfDay();null!=t&&this.coCommit.emit(t)}},this.onStepperClick=t=>i=>{var e;i.preventDefault(),this.disabled||(this.buffer="",this.stepSegment(null!==(e=this.focused)&&void 0!==e?e:"hour",t))}}componentWillLoad(){this.syncFromValue(this.value)}syncFromValue(t){if(null==t||!Number.isFinite(t))return this.buffer="",this.hour24=null,void(this.minute=null);const i=Math.max(0,Math.min(1439,Math.round(t)));this.minutesOfDay()!==i&&(this.buffer="",this.hour24=Math.floor(i/60),this.minute=i%60)}async focusInput(){var t;null===(t=this.hourEl)||void 0===t||t.focus()}minutesOfDay(){return null==this.hour24||null==this.minute?null:60*this.hour24+this.minute}get isPm(){var t;return(null!==(t=this.hour24)&&void 0!==t?t:0)>=12}displayHour(){return null==this.hour24?null:this.hour12?this.hour24%12||12:this.hour24}emitDraft(){const t=this.minutesOfDay();null!=t&&this.coInput.emit(t)}setDisplayHour(t){if(this.hour12){const i=t%12;this.hour24=this.isPm?i+12:i}else this.hour24=Math.max(0,Math.min(23,t));null==this.minute&&(this.minute=0),this.emitDraft()}stepSegment(t,i){var e,s,o;if("hour"===t){const t=null!==(e=this.hour24)&&void 0!==e?e:9;this.hour24=(t+i+24)%24,null==this.minute&&(this.minute=0)}else if("minute"===t){const t=null!==(s=this.minute)&&void 0!==s?s:0;this.minute=(t+i+60)%60,null==this.hour24&&(this.hour24=9)}else this.hour24=((null!==(o=this.hour24)&&void 0!==o?o:9)+12)%24,null==this.minute&&(this.minute=0);this.emitDraft()}typeDigit(t,i){this.buffer+=String(i);const e=Number(this.buffer);if("hour"===t){e>(this.hour12?12:23)&&(this.buffer=String(i));const t=Number(this.buffer);this.hour12?t>=1&&this.setDisplayHour(t):2===this.buffer.length||t>2?(this.hour24=Math.min(23,t),null==this.minute&&(this.minute=0),this.emitDraft()):t>0&&(this.hour24=t,null==this.minute&&(this.minute=0),this.emitDraft()),(2===this.buffer.length||(this.hour12?10*t>12:10*t>23))&&this.advanceFrom("hour")}else if("minute"===t){e>59&&(this.buffer=String(i));const t=Number(this.buffer);this.minute=t,null==this.hour24&&(this.hour24=9),this.emitDraft(),(2===this.buffer.length||t>5)&&this.advanceFrom("minute")}}advanceFrom(t){this.buffer="";const i=this.hour12?["hour","minute","period"]:["hour","minute"],e=i.indexOf(t),s=i[e+1];s&&this.focusSegment(s)}focusSegment(t){var i;null===(i=this.el.shadowRoot.querySelector(`.co-time-field__seg--${t}`))||void 0===i||i.focus()}renderSeg(t,i){const e="hour"===t?i.hourLabel:"minute"===t?i.minuteLabel:i.dayPeriodLabel;let s,n=null,r=0,l=59;if("hour"===t){const t=this.displayHour();s=null==t?"––":String(t).padStart(2,"0"),n=t,r=this.hour12?1:0,l=this.hour12?12:23}else if("minute"===t)s=null==this.minute?"––":String(this.minute).padStart(2,"0"),n=this.minute;else{const t=null==this.hour24,{am:i,pm:e}=function(t){var i,e,s,o;const n=a.get(t);if(n)return n;const r=new Intl.DateTimeFormat(t,{hour:"numeric",hour12:!0}),l={am:null!==(e=null===(i=r.formatToParts(new Date(2e3,0,1,9,0)).find((t=>"dayPeriod"===t.type)))||void 0===i?void 0:i.value)&&void 0!==e?e:"AM",pm:null!==(o=null===(s=r.formatToParts(new Date(2e3,0,1,21,0)).find((t=>"dayPeriod"===t.type)))||void 0===s?void 0:s.value)&&void 0!==o?o:"PM"};return a.set(t,l),l}(this.locale);s=this.isPm?e:i,n=t?null:this.isPm?1:0,r=0,l=1}const h="hour"===t&&null==this.hour24||"minute"===t&&null==this.minute||"period"===t&&null==this.hour24;return o("span",{ref:"hour"===t?t=>this.hourEl=t:void 0,class:{"co-time-field__seg":!0,[`co-time-field__seg--${t}`]:!0,"co-time-field__seg--empty":h},role:"spinbutton",tabIndex:this.disabled?-1:0,"aria-label":e,"aria-valuemin":String(r),"aria-valuemax":String(l),"aria-valuenow":null==n?void 0:String(n),"aria-valuetext":h?void 0:s,"aria-disabled":this.disabled?"true":void 0,onKeyDown:this.onSegKeyDown(t),onFocus:()=>{this.focused=t,this.buffer=""},onBlur:()=>{this.focused===t&&(this.focused=null)}},s)}render(){const t=n(this.locale);return o("div",{key:"782a8fbbbd967cb652ef4ea7d8aea0e2cc273a4b",class:{"co-time-field":!0,"co-time-field--disabled":this.disabled},role:"group","aria-label":this.fieldLabel||t.timeFieldLabel},o("span",{key:"1f46be0e62e2515d70e079193c1107cfcff35d11",class:"co-time-field__segs"},this.renderSeg("hour",t),o("span",{key:"9eb83d59c644c113dab23b4af0521a719e43a497",class:"co-time-field__sep","aria-hidden":"true"},":"),this.renderSeg("minute",t),this.hour12&&this.renderSeg("period",t)),o("span",{key:"e18183e6e92530649a24d0f05bd8f7acb4403a47",class:"co-time-field__steppers"},o("button",{key:"9a78bb64915a9e83bcbe2b9bf024c239fdefc44c",type:"button",tabIndex:-1,"aria-hidden":"true",onMouseDown:t=>t.preventDefault(),onClick:this.onStepperClick(1)},o("co-icon",{key:"bbc82c66044327c5c631d9dd601b5232cebb8d75",name:"caret-up",size:10})),o("button",{key:"a20091c8d3aeb118111014f9dc20d6fd517d276c",type:"button",tabIndex:-1,"aria-hidden":"true",onMouseDown:t=>t.preventDefault(),onClick:this.onStepperClick(-1)},o("co-icon",{key:"cefec7ee6a579373324c4fc20552bf09a9764aa4",name:"caret-down",size:10}))))}get el(){return this}static get watchers(){return{value:[{syncFromValue:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);letter-spacing:var(--co-font-letter-spacing-body)}.co-time-field{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-xs);min-height:32px;padding:3px var(--co-spacing-sm) 3px var(--co-spacing-sm2);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);box-sizing:border-box;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-time-field:focus-within{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-time-field--disabled{background:var(--co-semantic-surface-disabled);border-color:transparent;pointer-events:none}.co-time-field__segs{display:inline-flex;align-items:center;gap:1px}.co-time-field__seg{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:24px;padding:0 3px;border-radius:var(--co-border-radius-xxs);font-size:var(--co-font-size-14);font-variant-numeric:tabular-nums;color:var(--co-semantic-text-default);box-sizing:border-box;cursor:default;user-select:none;outline:none}.co-time-field__seg:focus{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-weight:600}.co-time-field__seg--period{margin-left:var(--co-spacing-xs);font-size:var(--co-font-size-13)}.co-time-field__seg--empty{color:var(--co-semantic-text-muted)}.co-time-field__sep{color:var(--co-semantic-text-muted)}.co-time-field__steppers{display:inline-flex;flex-direction:column}.co-time-field__steppers button{display:inline-flex;align-items:center;justify-content:center;width:20px;height:12px;padding:0;border:0;background:transparent;color:var(--co-semantic-text-muted);cursor:pointer}.co-time-field__steppers button:hover{color:var(--co-semantic-text-default)}:host([data-touch]) .co-time-field{min-height:44px;padding:var(--co-spacing-sm) var(--co-spacing-sm2)}:host([data-touch]) .co-time-field__seg{min-width:34px;height:32px;font-size:var(--co-font-size-16)}"}},[1,"co-time-field",{value:[2],hour12:[4,"hour-1-2"],locale:[1],disabled:[4],pageStep:[2,"page-step"],fieldLabel:[1,"field-label"],hour24:[32],minute:[32],focused:[32],focusInput:[64]},void 0,{value:[{syncFromValue:0}]}]);function h(){"undefined"!=typeof customElements&&["co-time-field","co-icon"].forEach((i=>{switch(i){case"co-time-field":customElements.get(t(i))||customElements.define(t(i),l);break;case"co-icon":customElements.get(t(i))||r()}}))}h();export{l as C,h as d}
@@ -1 +1 @@
1
- import{t as e,p as t,H as s,c as o,h as i}from"./index.js";const n=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coRevealEnd=o(this,"coRevealEnd",7),this.variant="rect",this.width="100%",this.height="",this.revealed=!1,this.revealEndEmitted=!1,this.handleTransitionEnd=e=>{this.revealed&&"opacity"===e.propertyName&&this.emitRevealEnd()}}onRevealedChange(e){clearTimeout(this.revealFallbackTimer),e?(this.revealEndEmitted=!1,this.revealFallbackTimer=setTimeout((()=>this.emitRevealEnd()),400)):this.revealEndEmitted=!1}disconnectedCallback(){clearTimeout(this.revealFallbackTimer)}emitRevealEnd(){clearTimeout(this.revealFallbackTimer),this.revealEndEmitted||(this.revealEndEmitted=!0,this.coRevealEnd.emit())}render(){const e={width:this.width};return this.height&&(e.height=this.height),i("div",{key:"45da8e989feca14de295c7b83bfd8f5e196a9734",class:{"co-skeleton":!0,[`co-skeleton--${this.variant}`]:!0,"co-skeleton--revealed":this.revealed},part:"skeleton",style:e,"aria-hidden":"true",onTransitionEnd:this.handleTransitionEnd})}static get watchers(){return{revealed:[{onRevealedChange:0}]}}static get style(){return":host{display:block}.co-skeleton{height:1em;border-radius:var(--co-border-radius-xs);background:linear-gradient( 90deg, var(--co-semantic-surface-secondary) 0%, var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.04)) 50%, var(--co-semantic-surface-secondary) 100% );background-size:200% 100%;animation:co-skeleton-sweep 1.2s ease-in-out infinite}.co-skeleton--text{border-radius:var(--co-border-radius-xxs)}.co-skeleton--circle{border-radius:var(--co-border-radius-full)}.co-skeleton{transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-in-out)}.co-skeleton--revealed{opacity:0;pointer-events:none;animation:none}@keyframes co-skeleton-sweep{0%{background-position:200% 0}100%{background-position:-200% 0}}@media (prefers-reduced-motion: reduce){.co-skeleton{animation:none}}"}},[1,"co-skeleton",{variant:[513],width:[1],height:[1],revealed:[516]},void 0,{revealed:[{onRevealedChange:0}]}]);function a(){"undefined"!=typeof customElements&&["co-skeleton"].forEach((t=>{"co-skeleton"===t&&(customElements.get(e(t))||customElements.define(e(t),n))}))}a();export{n as C,a as d}
1
+ import{t as e,p as t,H as s,c as o,h as i}from"./index.js";const n=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coRevealEnd=o(this,"coRevealEnd",7),this.variant="rect",this.width="100%",this.height="",this.revealed=!1,this.revealEndEmitted=!1,this.handleTransitionEnd=e=>{this.revealed&&"opacity"===e.propertyName&&this.emitRevealEnd()}}onRevealedChange(e){clearTimeout(this.revealFallbackTimer),e?(this.revealEndEmitted=!1,this.revealFallbackTimer=setTimeout((()=>this.emitRevealEnd()),400)):this.revealEndEmitted=!1}disconnectedCallback(){clearTimeout(this.revealFallbackTimer)}emitRevealEnd(){clearTimeout(this.revealFallbackTimer),this.revealEndEmitted||(this.revealEndEmitted=!0,this.coRevealEnd.emit())}render(){const e={width:this.width};return this.height&&(e.height=this.height),i("div",{key:"744fb805939c99587c4d0b72355da54d1f5aad43",class:{"co-skeleton":!0,[`co-skeleton--${this.variant}`]:!0,"co-skeleton--revealed":this.revealed},part:"skeleton",style:e,"aria-hidden":"true",onTransitionEnd:this.handleTransitionEnd})}static get watchers(){return{revealed:[{onRevealedChange:0}]}}static get style(){return":host{display:block}.co-skeleton{height:1em;border-radius:var(--co-border-radius-xs);background:linear-gradient( 90deg, var(--co-semantic-surface-secondary) 0%, var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.04)) 50%, var(--co-semantic-surface-secondary) 100% );background-size:200% 100%;animation:co-skeleton-sweep 1.2s ease-in-out infinite}.co-skeleton--text{border-radius:var(--co-border-radius-xxs)}.co-skeleton--circle{border-radius:var(--co-border-radius-full)}.co-skeleton{transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-in-out)}.co-skeleton--revealed{opacity:0;pointer-events:none;animation:none}@keyframes co-skeleton-sweep{0%{background-position:200% 0}100%{background-position:-200% 0}}@media (prefers-reduced-motion: reduce){.co-skeleton{animation:none}}"}},[1,"co-skeleton",{variant:[513],width:[1],height:[1],revealed:[516]},void 0,{revealed:[{onRevealedChange:0}]}]);function a(){"undefined"!=typeof customElements&&["co-skeleton"].forEach((t=>{"co-skeleton"===t&&(customElements.get(e(t))||customElements.define(e(t),n))}))}a();export{n as C,a as d}