@baseline-ui/core 3.10.0 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/Accordion.css +1 -1
  2. package/dist/Accordion.mjs +1 -1
  3. package/dist/ActionButton.mjs +1 -1
  4. package/dist/ActionGroup.mjs +1 -1
  5. package/dist/ActionIconButton.mjs +1 -1
  6. package/dist/AlertDialog.css +1 -1
  7. package/dist/AlertDialog.mjs +1 -1
  8. package/dist/AudioPlayer.css +1 -1
  9. package/dist/AudioPlayer.mjs +1 -1
  10. package/dist/Avatar.css +1 -1
  11. package/dist/Avatar.mjs +1 -1
  12. package/dist/Breadcrumbs.mjs +1 -1
  13. package/dist/ButtonSelect.css +1 -1
  14. package/dist/ButtonSelect.mjs +1 -1
  15. package/dist/Calendar.css +1 -1
  16. package/dist/Calendar.mjs +1 -1
  17. package/dist/ColorInput.css +1 -1
  18. package/dist/ColorInput.mjs +1 -1
  19. package/dist/ColorSwatch.mjs +1 -1
  20. package/dist/ColorSwatchPicker.mjs +1 -1
  21. package/dist/ComboBox.css +1 -1
  22. package/dist/ComboBox.mjs +1 -1
  23. package/dist/DateField.css +1 -1
  24. package/dist/DateField.mjs +1 -1
  25. package/dist/Dialog.mjs +1 -1
  26. package/dist/Drawer.mjs +1 -1
  27. package/dist/Editor.css +1 -1
  28. package/dist/Editor.mjs +1 -1
  29. package/dist/FileInput.css +1 -1
  30. package/dist/FileInput.mjs +1 -1
  31. package/dist/FileList.mjs +1 -1
  32. package/dist/FileUploader.mjs +1 -1
  33. package/dist/FrameProvider.mjs +1 -1
  34. package/dist/FreehandCanvas.mjs +1 -1
  35. package/dist/GridList.mjs +1 -1
  36. package/dist/I18nProvider.mjs +1 -1
  37. package/dist/ImageDropZone.mjs +1 -1
  38. package/dist/ImageGallery.css +1 -1
  39. package/dist/ImageGallery.mjs +1 -1
  40. package/dist/InlineAlert.mjs +1 -1
  41. package/dist/InlineToolbar.mjs +2 -2
  42. package/dist/ListBox.mjs +1 -1
  43. package/dist/Menu.mjs +1 -1
  44. package/dist/MessageFormat.mjs +1 -1
  45. package/dist/Modal.mjs +1 -1
  46. package/dist/NumberInput.css +1 -1
  47. package/dist/NumberInput.mjs +1 -1
  48. package/dist/Pagination.mjs +1 -1
  49. package/dist/PointPicker.mjs +1 -1
  50. package/dist/Popover.mjs +1 -1
  51. package/dist/Portal.mjs +1 -1
  52. package/dist/Preview.css +1 -1
  53. package/dist/Preview.mjs +1 -1
  54. package/dist/ProgressBar.css +1 -1
  55. package/dist/ProgressBar.mjs +1 -1
  56. package/dist/RadioGroup.css +1 -1
  57. package/dist/RadioGroup.mjs +1 -1
  58. package/dist/ScrollControlButton.mjs +1 -1
  59. package/dist/SearchInput.mjs +1 -1
  60. package/dist/Select.css +1 -1
  61. package/dist/Select.mjs +1 -1
  62. package/dist/Slider.css +1 -1
  63. package/dist/Slider.mjs +1 -1
  64. package/dist/Stepper.mjs +1 -1
  65. package/dist/Table.mjs +1 -1
  66. package/dist/Tabs.mjs +1 -1
  67. package/dist/Tag.mjs +1 -1
  68. package/dist/TagGroup.mjs +1 -1
  69. package/dist/TaggedPagination.mjs +1 -1
  70. package/dist/TextInput.css +1 -1
  71. package/dist/TextInput.mjs +1 -1
  72. package/dist/ThemeProvider.mjs +1 -1
  73. package/dist/TimeField.css +1 -1
  74. package/dist/TimeField.mjs +1 -1
  75. package/dist/Toast.mjs +1 -1
  76. package/dist/ToggleButton.mjs +1 -1
  77. package/dist/ToggleIconButton.mjs +1 -1
  78. package/dist/Toolbar.mjs +1 -1
  79. package/dist/Tooltip.mjs +1 -1
  80. package/dist/TreeView.css +1 -1
  81. package/dist/TreeView.mjs +1 -1
  82. package/dist/UNSAFE_ListBox.mjs +1 -1
  83. package/dist/VideoPlayer.css +10 -0
  84. package/dist/VideoPlayer.mjs +1 -0
  85. package/dist/Virtualizer.mjs +1 -1
  86. package/dist/{chunk-A52PIXOO.mjs → chunk-2FKVQSXF.mjs} +1 -1
  87. package/dist/{chunk-QPWBJW2X.mjs → chunk-4ATAOS5R.mjs} +1 -1
  88. package/dist/{chunk-5B6263RO.mjs → chunk-4JSIG3XV.mjs} +16 -16
  89. package/dist/chunk-5GTM4EJO.mjs +10 -0
  90. package/dist/{chunk-6IK2TDLH.mjs → chunk-5I4MVN7X.mjs} +1 -1
  91. package/dist/chunk-5OWMDF6S.mjs +10 -0
  92. package/dist/{chunk-UXAMVDQ4.mjs → chunk-5TRRBR6N.mjs} +1 -1
  93. package/dist/{chunk-S2MA4MRM.mjs → chunk-5Z4XSXFW.mjs} +1 -1
  94. package/dist/{chunk-QVXIFV7W.mjs → chunk-65J43PGI.mjs} +1 -1
  95. package/dist/{chunk-HOZPCWCF.mjs → chunk-667TGPFX.mjs} +1 -1
  96. package/dist/{chunk-ACHYZYVA.mjs → chunk-6VKDP37C.mjs} +1 -1
  97. package/dist/{chunk-UBLCUHRL.mjs → chunk-7GXVKCFC.mjs} +1 -1
  98. package/dist/chunk-7P6YVPSY.mjs +10 -0
  99. package/dist/chunk-7YHC33LQ.mjs +10 -0
  100. package/dist/{chunk-JGKBJHX2.mjs → chunk-ABMYMS6P.mjs} +2 -2
  101. package/dist/chunk-AQGAGABL.mjs +10 -0
  102. package/dist/{chunk-LJM26E7W.mjs → chunk-BNTMAM3S.mjs} +1 -1
  103. package/dist/{chunk-HVSDXCZP.mjs → chunk-CFU5AQZ4.mjs} +1 -1
  104. package/dist/{chunk-EPWWEFTP.mjs → chunk-D4P3YVSV.mjs} +1 -1
  105. package/dist/chunk-DD2TRFO4.mjs +10 -0
  106. package/dist/{chunk-HOG4QRLG.mjs → chunk-EEW7GTPE.mjs} +1 -1
  107. package/dist/{chunk-7EOAYPSZ.mjs → chunk-EOOQLRV5.mjs} +1 -1
  108. package/dist/{chunk-6VKIT2PF.mjs → chunk-FDFERRJ3.mjs} +2 -2
  109. package/dist/{chunk-QYU7CWJD.mjs → chunk-FKMXBSV2.mjs} +1 -1
  110. package/dist/{chunk-G2RVM2KB.mjs → chunk-FOCVZZPT.mjs} +1 -1
  111. package/dist/{chunk-LGE4377M.mjs → chunk-G5JW7B2K.mjs} +1 -1
  112. package/dist/chunk-G67TAFNZ.mjs +10 -0
  113. package/dist/chunk-GJYCSAXU.mjs +10 -0
  114. package/dist/{chunk-AANAI2XF.mjs → chunk-GW2COPW6.mjs} +1 -1
  115. package/dist/{chunk-QMFL5BMI.mjs → chunk-GZS3IPK5.mjs} +1 -1
  116. package/dist/{chunk-L7GYT3MC.mjs → chunk-HN2XJOQL.mjs} +1 -1
  117. package/dist/{chunk-CWPFUB7B.mjs → chunk-IRTS2NKL.mjs} +2 -2
  118. package/dist/chunk-IX5XTUKY.mjs +10 -0
  119. package/dist/{chunk-GJVQMTGA.mjs → chunk-J5OHLCGT.mjs} +1 -1
  120. package/dist/{chunk-TUSG5ZRW.mjs → chunk-JVBUNQEI.mjs} +1 -1
  121. package/dist/{chunk-VOWLLVPD.mjs → chunk-JY4FZPOK.mjs} +1 -1
  122. package/dist/{chunk-DP76DMVO.mjs → chunk-KF6Q3PUU.mjs} +1 -1
  123. package/dist/{chunk-S3LWWMMQ.mjs → chunk-KPNRHAG6.mjs} +1 -1
  124. package/dist/{chunk-IQ3Z6ZO2.mjs → chunk-LDF2ZF7V.mjs} +1 -1
  125. package/dist/{chunk-GAKWWL3Y.mjs → chunk-LM3YM7P3.mjs} +1 -1
  126. package/dist/{chunk-64Y62MDR.mjs → chunk-LQ54FC6R.mjs} +1 -1
  127. package/dist/chunk-MM7BYXUH.mjs +11 -0
  128. package/dist/{chunk-ZZGRLSEK.mjs → chunk-N5BFSM4K.mjs} +1 -1
  129. package/dist/{chunk-3P25UGHE.mjs → chunk-NEJXDGP5.mjs} +1 -1
  130. package/dist/{chunk-YI5VNFT4.mjs → chunk-NHVS56EF.mjs} +1 -1
  131. package/dist/{chunk-24WOG72O.mjs → chunk-NNGNZKM5.mjs} +1 -1
  132. package/dist/chunk-NPU6O7FH.mjs +10 -0
  133. package/dist/{chunk-QMSBDXK6.mjs → chunk-NVMFITUK.mjs} +1 -1
  134. package/dist/chunk-O55OXQQW.mjs +10 -0
  135. package/dist/{chunk-JQSZFPWJ.mjs → chunk-OC3YS6SE.mjs} +1 -1
  136. package/dist/{chunk-LZOXWIAS.mjs → chunk-OMGTKXQP.mjs} +1 -1
  137. package/dist/chunk-OQSEPK4W.mjs +10 -0
  138. package/dist/chunk-OTJ22ZQT.mjs +10 -0
  139. package/dist/chunk-OXTTKEGF.mjs +10 -0
  140. package/dist/{chunk-CBQO7JUC.mjs → chunk-Q2JOERVZ.mjs} +1 -1
  141. package/dist/{chunk-G2IYZES5.mjs → chunk-QARYQDRQ.mjs} +1 -1
  142. package/dist/{chunk-OWXMAVXI.mjs → chunk-QRHVS6JA.mjs} +1 -1
  143. package/dist/{chunk-C6TD53KY.mjs → chunk-RCX7NNM3.mjs} +1 -1
  144. package/dist/{chunk-AU3GNNEG.mjs → chunk-RD5DYYWA.mjs} +1 -1
  145. package/dist/{chunk-ZY3ZKJVD.mjs → chunk-RE7M6EBB.mjs} +1 -1
  146. package/dist/{chunk-6RN7DKRF.mjs → chunk-RIX32JXL.mjs} +1 -1
  147. package/dist/chunk-RTKSIESZ.mjs +10 -0
  148. package/dist/{chunk-AFJ3QV2Q.mjs → chunk-SKKISVY6.mjs} +1 -1
  149. package/dist/{chunk-WSDEMATI.mjs → chunk-U6252C5R.mjs} +1 -1
  150. package/dist/chunk-U6K54GAE.mjs +10 -0
  151. package/dist/{chunk-RM64ROGL.mjs → chunk-UJWWCOY3.mjs} +2 -2
  152. package/dist/{chunk-P3RRGPNM.mjs → chunk-ULARAZ62.mjs} +1 -1
  153. package/dist/chunk-W4SU2CES.mjs +10 -0
  154. package/dist/{chunk-JYWJE6L5.mjs → chunk-WBLMAN7U.mjs} +1 -1
  155. package/dist/{chunk-IIYP5UE7.mjs → chunk-X6RWEBD6.mjs} +1 -1
  156. package/dist/{chunk-GZTF5YE3.mjs → chunk-XBIE4AD2.mjs} +1 -1
  157. package/dist/chunk-XVLQWX2M.mjs +10 -0
  158. package/dist/chunk-XY5S6U26.mjs +11 -0
  159. package/dist/{chunk-EGSNIMDP.mjs → chunk-YJF3BHGB.mjs} +1 -1
  160. package/dist/{chunk-U6W7D7TT.mjs → chunk-ZAYG54JO.mjs} +1 -1
  161. package/dist/{chunk-UC6WAEPH.mjs → chunk-ZLG42OHF.mjs} +1 -1
  162. package/dist/{chunk-HOV7MM7M.mjs → chunk-ZTMBDIZH.mjs} +1 -1
  163. package/dist/hooks/useI18n.mjs +1 -1
  164. package/dist/hooks/useIsTouchDevice.mjs +1 -1
  165. package/dist/hooks/useLiveInteractionModality.mjs +1 -1
  166. package/dist/hooks/useLocalStorage.mjs +1 -1
  167. package/dist/hooks/useMedia.mjs +1 -1
  168. package/dist/hooks/useMediaQuery.mjs +1 -0
  169. package/dist/hooks/usePortalContainer.mjs +1 -1
  170. package/dist/index.css +1 -1
  171. package/dist/index.d.ts +183 -36
  172. package/dist/index.js +22 -22
  173. package/dist/index.mjs +1 -1
  174. package/dist/messageIds.mjs +1 -1
  175. package/intl/ar.json +18 -1
  176. package/intl/cs.json +18 -1
  177. package/intl/cy.json +18 -1
  178. package/intl/da.json +18 -1
  179. package/intl/de.json +18 -1
  180. package/intl/el.json +18 -1
  181. package/intl/en-GB.json +18 -1
  182. package/intl/en.json +18 -1
  183. package/intl/es.json +18 -1
  184. package/intl/fi.json +18 -1
  185. package/intl/fr-CA.json +18 -1
  186. package/intl/fr.json +18 -1
  187. package/intl/he.json +18 -1
  188. package/intl/hr.json +18 -1
  189. package/intl/id.json +18 -1
  190. package/intl/it.json +18 -1
  191. package/intl/ja.json +18 -1
  192. package/intl/ko.json +18 -1
  193. package/intl/ms.json +18 -1
  194. package/intl/nb-NO.json +18 -1
  195. package/intl/nl.json +18 -1
  196. package/intl/pl.json +18 -1
  197. package/intl/pt-PT.json +18 -1
  198. package/intl/pt.json +18 -1
  199. package/intl/ru.json +18 -1
  200. package/intl/sk.json +18 -1
  201. package/intl/sl.json +18 -1
  202. package/intl/sv.json +18 -1
  203. package/intl/th.json +18 -1
  204. package/intl/tr.json +18 -1
  205. package/intl/uk.json +18 -1
  206. package/intl/zh-Hans.json +18 -1
  207. package/intl/zh-Hant.json +18 -1
  208. package/messages.json +68 -0
  209. package/package.json +4 -4
  210. package/sbom.json +6 -6
  211. package/dist/chunk-23OLSA2X.mjs +0 -10
  212. package/dist/chunk-2CFMM7MZ.mjs +0 -10
  213. package/dist/chunk-2KRVQJDA.mjs +0 -10
  214. package/dist/chunk-2TMQUHHU.mjs +0 -10
  215. package/dist/chunk-5YV74V36.mjs +0 -10
  216. package/dist/chunk-A455VRNY.mjs +0 -10
  217. package/dist/chunk-AYBI4SQV.mjs +0 -10
  218. package/dist/chunk-CMM5JW7L.mjs +0 -10
  219. package/dist/chunk-CPX5CB4L.mjs +0 -10
  220. package/dist/chunk-GHKMHXQ3.mjs +0 -10
  221. package/dist/chunk-LNEOOIXS.mjs +0 -10
  222. package/dist/chunk-MQCTOCK2.mjs +0 -10
  223. package/dist/chunk-OJIOLYTM.mjs +0 -11
  224. package/dist/chunk-Q5SN5AQT.mjs +0 -10
  225. package/dist/chunk-SUJD4QFW.mjs +0 -10
  226. package/dist/chunk-TDRN6VLD.mjs +0 -10
  227. package/dist/chunk-W4DOEGYH.mjs +0 -10
  228. /package/dist/{chunk-XF65LVBQ.mjs → chunk-JFS73ERR.mjs} +0 -0
@@ -1,10 +0,0 @@
1
- import {a as a$m}from'./chunk-WDWBYTJG.mjs';import {a as a$a}from'./chunk-Q7BJGV4I.mjs';import {a as a$3}from'./chunk-SVV6DLJH.mjs';import {a as a$c,b as b$4}from'./chunk-BJHDL2HH.mjs';import {b as b$5,c as c$3}from'./chunk-OY57K37D.mjs';import {a as a$2}from'./chunk-KT4FTBJ2.mjs';import {a as a$7,b as b$3,g,d,e as e$1,f,h as h$2}from'./chunk-FFPJBDWH.mjs';import {a as a$g}from'./chunk-SL5Q4NLV.mjs';import {b as b$1}from'./chunk-I4F5NJUI.mjs';import {i,l,p,j,n,k,h as h$1,d as d$1,g as g$2,a as a$i}from'./chunk-4Y5IKZSW.mjs';import {a as a$n}from'./chunk-YI5VNFT4.mjs';import {a as a$o}from'./chunk-QMP72J5L.mjs';import {c as c$2,b as b$7}from'./chunk-JYWJE6L5.mjs';import {a as a$k}from'./chunk-DIL5HL6K.mjs';import {a as a$l}from'./chunk-L7GYT3MC.mjs';import {a as a$6}from'./chunk-TZSRU3GG.mjs';import {a}from'./chunk-USMC34OO.mjs';import {b as b$6}from'./chunk-KG2EHFYA.mjs';import {b}from'./chunk-N2XGJKZG.mjs';import {a as a$b}from'./chunk-I5YPTKMM.mjs';import {a as a$d}from'./chunk-NQIZ3U7Q.mjs';import {e,c,h,b as b$2,a as a$e}from'./chunk-EKRT3PPK.mjs';import {k as k$1,l as l$1}from'./chunk-JANI446W.mjs';import {a as a$j}from'./chunk-BPXZ6J5G.mjs';import {a as a$1}from'./chunk-FPM5UJRF.mjs';import {a as a$4}from'./chunk-ELW6SXDM.mjs';import {a as a$9}from'./chunk-LRFFL765.mjs';import {a as a$8}from'./chunk-RT4LMB6X.mjs';import {g as g$1,c as c$1,f as f$1}from'./chunk-V2C4UDOC.mjs';import {a as a$5}from'./chunk-SVIYLH7R.mjs';import {a as a$f}from'./chunk-JQQGRJ5J.mjs';import {a as a$h}from'./chunk-4QEH5CGK.mjs';import _t,{createContext,forwardRef,useRef,useEffect,useContext,useState,useMemo,useCallback,isValidElement}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {ChevronRightIcon}from'@baseline-ui/icons/8';import {DragIndicatorIcon}from'@baseline-ui/icons/12';import {themeVars,sprinkles}from'@baseline-ui/tokens';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- function De(r,o,e){let{gridProps:t}=b$5(r,o,e);return t.role="treegrid",{gridProps:t}}var xt={"ar-AE":{collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"},"bg-BG":{collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"},"cs-CZ":{collapse:"Sbalit",expand:"Rozt\xE1hnout"},"da-DK":{collapse:"Skjul",expand:"Udvid"},"de-DE":{collapse:"Reduzieren",expand:"Erweitern"},"el-GR":{collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"},"en-US":{expand:"Expand",collapse:"Collapse"},"es-ES":{collapse:"Contraer",expand:"Expandir"},"et-EE":{collapse:"Ahenda",expand:"Laienda"},"fi-FI":{collapse:"Pienenn\xE4",expand:"Laajenna"},"fr-FR":{collapse:"R\xE9duire",expand:"D\xE9velopper"},"he-IL":{collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"},"hr-HR":{collapse:"Sa\u017Emi",expand:"Pro\u0161iri"},"hu-HU":{collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"},"it-IT":{collapse:"Comprimi",expand:"Espandi"},"ja-JP":{collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"},"ko-KR":{collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"},"lt-LT":{collapse:"Sutraukti",expand:"I\u0161skleisti"},"lv-LV":{collapse:"Sak\u013Caut",expand:"Izv\u0113rst"},"nb-NO":{collapse:"Skjul",expand:"Utvid"},"nl-NL":{collapse:"Samenvouwen",expand:"Uitvouwen"},"pl-PL":{collapse:"Zwi\u0144",expand:"Rozwi\u0144"},"pt-BR":{collapse:"Recolher",expand:"Expandir"},"pt-PT":{collapse:"Colapsar",expand:"Expandir"},"ro-RO":{collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"},"ru-RU":{collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"},"sk-SK":{collapse:"Zbali\u0165",expand:"Rozbali\u0165"},"sl-SI":{collapse:"Strni",expand:"Raz\u0161iri"},"sr-SP":{collapse:" Skupi",expand:"Pro\u0161iri"},"sv-SE":{collapse:"D\xF6lj",expand:"Expandera"},"tr-TR":{collapse:"Daralt",expand:"Geni\u015Flet"},"uk-UA":{collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"},"zh-CN":{collapse:"\u6298\u53E0",expand:"\u6269\u5C55"},"zh-TW":{collapse:"\u6536\u5408",expand:"\u5C55\u958B"}};function ce(r,o,e){let{node:t}=r,n=c$3(r,o,e),a=n.rowProps["aria-expanded"]===true,s=b$6(xt,"@react-aria/tree"),c=a$j({"aria-label":a?s.format("collapse"):s.format("expand"),"aria-labelledby":n.rowProps.id}),p={onPress:()=>{n.isDisabled||(o.toggleKey(t.key),o.selectionManager.setFocused(true),o.selectionManager.setFocusedKey(t.key));},excludeFromTabOrder:true,preventFocusOnPress:true,"data-react-aria-prevent-focus":true,...c};return {...n,expandButtonProps:p}}var he=class r extends g$2{expandedKeys=new Set;withExpandedKeys(o,e){let t=this.clone();return t.expandedKeys=e,r.cloneAncestorSections(e,o,t),r.cloneAncestorSections(o,e,t),t.frozen=this.frozen,t}static cloneAncestorSections(o,e,t){for(let n of o)if(!e.has(n)){let a=n;for(;a!=null;){let s=t.getItem(a);if(s?.type==="section"){t.keyMap.set(a,s.clone());break}else a=s?.parentKey??null;}}}*[Symbol.iterator](){let o=this.getFirstKey(),e=o!=null?this.getItem(o):null;for(;e;)if(yield e,e.type==="section")e=e.nextKey!=null?this.getItem(e.nextKey):null;else {let t=this.getKeyAfter(e.key);e=t!=null?this.getItem(t):null;}}getLastKey(){let o=this.lastKey;if(o==null)return null;let e=this.getItem(o);for(;e?.lastChildKey!=null&&(e.type!=="item"||this.expandedKeys.has(e.key));)e=this.getItem(e.lastChildKey);return e?.key}getKeyAfter(o){let e=this.getItem(o);if(!e)return null;if((this.expandedKeys.has(e.key)||e.type!=="item")&&e.firstChildKey!=null)return e.firstChildKey;for(;e;){if(e.nextKey!=null)return e.nextKey;if(e.parentKey!=null)e=this.getItem(e.parentKey);else return null}return null}getKeyBefore(o){let e=this.getItem(o);if(!e)return null;if(e.prevKey!=null){for(e=this.getItem(e.prevKey);e&&(e.type!=="item"||this.expandedKeys.has(e.key))&&e.lastChildKey!=null;)e=this.getItem(e.lastChildKey);return e?.key??null}return e.parentKey}getChildren(o){let e=this;return {*[Symbol.iterator](){let t=e.getItem(o),n=t?.firstChildKey!=null?e.getItem(t.firstChildKey):null;if(t&&t.type==="section"&&n)for(;n&&n.key!==t.nextKey;){yield e.getItem(n.key);let a=e.getKeyAfter(n.key);n=a!=null?e.getItem(a):null;}else for(;n;)yield n,n=n.nextKey!=null?e.getItem(n.nextKey):null;}}}getTextValue(o){let e=this.getItem(o);return e?e.textValue:""}},ht=createContext(null),ye=createContext(null),we=forwardRef(function(o,e$1){return [o,e$1]=e(o,e$1,ht),jsx(i,{content:jsx(l,{...o}),createCollection:()=>new he,children:t=>jsx(Bt,{props:o,collection:t,treeRef:e$1})})}),bt={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Bt({props:r,collection:o,treeRef:e}){let{dragAndDropHooks:t}=r,{direction:n}=b(),a$8=a({usage:"search",sensitivity:"base"}),s=!!t?.useDraggableCollectionState,c$1=!!t?.useDroppableCollectionState,p$1=useRef(s),D=useRef(c$1);useEffect(()=>{p$1.current!==s&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),D.current!==c$1&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");},[s,c$1]);let{selectionMode:g$2="none",expandedKeys:S,defaultExpandedKeys:m,onExpandedChange:h$1,disabledBehavior:x="all"}=r,{CollectionRoot:P,isVirtualized:I,layoutDelegate:b$4,dropTargetDelegate:k}=useContext(p),[T,L]=a$1(S?new Set(S):void 0,m?new Set(m):new Set,h$1),[C,N]=useState(o),[E,v]=useState(T),[K,M]=useState(()=>o.withExpandedKeys(E,T));(!Wt(E,T)||o!==C)&&(M(o.withExpandedKeys(E,T)),N(o),v(T));let l=a$2({...r,selectionMode:g$2,expandedKeys:T,onExpandedChange:L,collection:K,children:void 0,disabledBehavior:x}),{gridProps:i}=De({...r,isVirtualized:I,layoutDelegate:b$4},l,e),y,u,f,A=false,j=null,_=useRef(null);if(s&&t){y=t.useDraggableCollectionState({collection:l.collection,selectionManager:l.selectionManager,preview:t.renderDragPreview?_:void 0}),t.useDraggableCollection({},y,e);let re=t.DragPreview;j=t.renderDragPreview?jsx(re,{ref:_,children:t.renderDragPreview}):null;}let[J]=useState(()=>new a$3);if(c$1&&t){u=t.useDroppableCollectionState({collection:l.collection,selectionManager:l.selectionManager});let re=t.dropTargetDelegate||k||new t.ListDropTargetDelegate(l.collection,e,{direction:n});J.setup(re,l,n);let ge=new b$1({collection:l.collection,collator:a$8,ref:e,disabledKeys:l.selectionManager.disabledKeys,disabledBehavior:l.selectionManager.disabledBehavior,direction:n,layoutDelegate:b$4});f=t.useDroppableCollection({keyboardDelegate:ge,dropTargetDelegate:J,onDropActivate:B=>{if(B.target.type==="item"){let w=B.target.key,$=l.collection.getItem(w),Ot=T.has(w);$&&$.hasChildNodes&&(!Ot||t?.isVirtualDragging?.())&&l.toggleKey(w);}},onKeyDown:B=>{let w=u?.target;if(w&&w.type==="item"&&w.dropPosition==="on"){let $=l.collection.getItem(w.key);(B.key===bt.expand[n]&&$?.hasChildNodes&&!l.expandedKeys.has(w.key)||B.key===bt.collapse[n]&&$?.hasChildNodes&&l.expandedKeys.has(w.key))&&l.toggleKey(w.key);}}},u,e),A=u.isDropTarget({type:"root"});}let ee=!!(s&&!y?.isDisabled),{focusProps:te,isFocused:U,isFocusVisible:X}=a$4(),V={isEmpty:l.collection.size===0,isFocused:U,isFocusVisible:X,isDropTarget:A,selectionMode:l.selectionManager.selectionMode,allowsDragging:!!ee,state:l},Ht=c({...r,children:void 0,defaultClassName:"react-aria-Tree",values:V}),Ke=null;if(l.collection.size===0&&r.renderEmptyState){let{isEmpty:re,...ge}=V,B=r.renderEmptyState({...ge});Ke=jsx("div",{role:"row",style:{display:"contents"},...{"aria-level":1},children:jsx("div",{role:"gridcell",style:{display:"contents"},children:B})});}let Nt=a$5(r,{global:true});return jsxs(Fragment,{children:[jsx(a$6,{children:jsxs(h.div,{...g$1(Nt,Ht,i,te,f?.collectionProps),ref:e,slot:r.slot||void 0,"data-empty":l.collection.size===0||void 0,"data-focused":U||void 0,"data-drop-target":A||void 0,"data-focus-visible":X||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode,"data-allows-dragging":!!ee||void 0,children:[jsxs(b$2,{values:[[ye,l],[a$7,{dragAndDropHooks:t,dragState:y,dropState:u}],[b$3,{render:Ft}]],children:[c$1&&jsx(Ut,{}),jsx(g,{children:jsx(P,{collection:l.collection,persistedKeys:e$1(l.selectionManager,t,u),scrollRef:e,renderDropIndicator:d(t,u)})})]}),Ke]})}),j]})}var Pe=class extends a$i{static type="content"},Re=j(Pe,function(o){let e=useContext(Pt),t=c({children:o.children,values:e});return jsx(p.Provider,{value:n,children:t.children})}),Pt=createContext(null),Ie=class extends a$i{static type="item"},Se=k(Ie,(r,o,e)=>{let t=useContext(ye);o=a$8(o);let{dragAndDropHooks:n,dragState:a,dropState:s}=useContext(a$7),c$2=a&&!(a.isDisabled||a.selectionManager.isDisabled(e.key)),{rowProps:p,gridCellProps:D,expandButtonProps:g,descriptionProps:S,...m}=ce({node:e,shouldSelectOnPressUp:!!a,focusMode:r.focusMode,allowsArrowNavigation:r.allowsArrowNavigation},t,o),h$3=p["aria-expanded"]===true,x=r.hasChildItems||[...t.collection.getChildren(e.key)].length>1,P=p["aria-level"]||1,{hoverProps:I,isHovered:b}=a$9({isDisabled:!m.allowsSelection&&!m.hasAction&&!c$2,onHoverStart:r.onHoverStart,onHoverChange:r.onHoverChange,onHoverEnd:r.onHoverEnd}),{isFocusVisible:k,focusProps:T}=a$4(),{isFocusVisible:L,focusProps:C}=a$4({within:true}),{checkboxProps:N}=a$a({key:e.key},t),E=null;a&&n&&(E=n.useDraggableItem({key:e.key,hasDragButton:true},a,o));let v=null,K=useRef(null),M=useRef(null),l=useRef(null),{visuallyHiddenProps:i}=a$b();s&&n&&(v=n.useDropIndicator({target:{type:"item",key:e.key,dropPosition:"on"},activateButtonRef:l},s,M));let y=a&&a.isDragging(e.key),u=v?.isDropTarget,f$1=t.selectionManager.selectionMode,A=t.selectionManager.selectionBehavior,j=_t.useMemo(()=>({...m,isHovered:b,isFocusVisible:k,isExpanded:h$3,hasChildItems:x,level:P,selectionMode:f$1,selectionBehavior:A,isFocusVisibleWithin:L,state:t,id:e.key,allowsDragging:!!a,isDragging:y,isDropTarget:u}),[m,b,k,h$3,x,P,L,t,e.key,a,y,u,A,f$1]),_=c({...r,id:void 0,children:e.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":P},values:j});useEffect(()=>{!e.textValue&&process.env.NODE_ENV!=="production"&&console.warn("A `textValue` prop is required for <TreeItem> elements in order to support accessibility features such as type to select.");},[e.textValue]),useEffect(()=>{x&&!K.current&&process.env.NODE_ENV!=="production"&&console.warn("Expandable tree items must contain a expand button so screen reader users can expand/collapse the item.");},[]);let J=useRef(null);useEffect(()=>{a&&!J.current&&process.env.NODE_ENV!=="production"&&console.warn('Draggable items in a Tree must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.');},[]);let ee=h$1({items:t.collection.getChildren(e.key),children:V=>{switch(V.type){case "content":return V.render(V);case "loader":case "item":return jsx(Fragment,{});default:throw new Error("Unsupported element type in TreeRow: "+V.type)}}}),te=c$1(),U=a$5(r,{global:true});delete U.id,delete U.onClick;let X=f(E,n,o);return jsxs(Fragment,{children:[v&&!v.isHidden&&jsx("div",{role:"row","aria-level":p["aria-level"],"aria-expanded":p["aria-expanded"],"aria-label":v.dropIndicatorProps["aria-label"],children:jsxs("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"},children:[jsx("div",{role:"button",...i,...v.dropIndicatorProps,ref:M}),p["aria-expanded"]!=null?jsx("div",{role:"button",...i,id:te,"aria-label":g["aria-label"],"aria-labelledby":`${te} ${p.id}`,tabIndex:-1,ref:l}):null]})}),jsx(h.div,{...g$1(U,p,T,I,C,X.itemProps),..._,ref:o,"data-expanded":x&&h$3||void 0,"data-has-child-items":x||void 0,"data-level":P,"data-selected":m.isSelected||void 0,"data-disabled":m.isDisabled||void 0,"data-hovered":b||void 0,"data-focused":m.isFocused||void 0,"data-focus-visible":k||void 0,"data-pressed":m.isPressed||void 0,"data-selection-mode":t.selectionManager.selectionMode==="none"?void 0:t.selectionManager.selectionMode,"data-allows-dragging":!!a||void 0,"data-dragging":y||void 0,"data-drop-target":u||void 0,children:jsx("div",{...D,style:{display:"contents"},children:jsx(b$2,{values:[[a$c,{slots:{[a$e]:{},selection:N}}],[b$4,{slots:{[a$e]:{},selection:N}}],[a$d,{slots:{[a$e]:{},chevron:{...g,ref:K},drag:{...X.dragButtonProps,ref:J}}}],[Pt,{...j}],[h$2,{isSelected:m.isSelected}]],children:ee})})})]})});j(d$1,function(o,e,t){let{isVirtualized:n}=useContext(p),a=useContext(ye),{isLoading:s,onLoadMore:c$1,scrollOffset:p$1,...D}=o,g=useRef(null),S=useMemo(()=>({onLoadMore:c$1,collection:a?.collection,sentinelRef:g,scrollOffset:p$1}),[c$1,p$1,a?.collection]);k$1(S,g),e=a$8(e);let{rowProps:m,gridCellProps:h$1}=ce({node:t},a,e),x=m["aria-level"]||1,P={role:"row","aria-level":m["aria-level"]},I=c({...D,id:void 0,children:t.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:x}}),b={};return n&&(b={display:"contents"}),jsxs(Fragment,{children:[jsx("div",{style:{position:"relative",width:0,height:0},inert:l$1(true),children:jsx("div",{"data-testid":"loadMoreSentinel",ref:g,style:{position:"absolute",height:1,width:1}})}),s&&I.children&&jsx(h.div,{ref:e,...g$1(a$5(o),P),...I,"data-level":x,children:jsx("div",{...h$1,style:b,children:I.children})})]})});function Ft(r,o){o=a$8(o);let{dragAndDropHooks:e,dropState:t}=useContext(a$7),n=useRef(null),{dropIndicatorProps:a,isHidden:s,isDropTarget:c}=e.useDropIndicator(r,t,n);if(s)return null;let p=t&&r.target.type==="item"?(t.collection.getItem(r.target.key)?.level||0)+1:1;return jsx(jt,{...r,dropIndicatorProps:a,isDropTarget:c,ref:o,buttonRef:n,level:p})}function Gt(r,o){let{dropIndicatorProps:e,isDropTarget:t,buttonRef:n,level:a,...s}=r,{visuallyHiddenProps:c$1}=a$b(),p=c({...s,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":a},values:{isDropTarget:t}});return jsx(h.div,{...p,role:"row","aria-level":a,ref:o,"data-drop-target":t||void 0,children:jsxs("div",{role:"gridcell",children:[jsx("div",{...c$1,role:"button",...e,ref:n}),p.children]})})}var jt=forwardRef(Gt);function Ut(){let{dragAndDropHooks:r,dropState:o}=useContext(a$7),e=useRef(null),{dropIndicatorProps:t}=r.useDropIndicator({target:{type:"root"}},o,e),n=o.isDropTarget({type:"root"}),{visuallyHiddenProps:a}=a$b();return !n&&t["aria-hidden"]?null:jsx("div",{role:"row","aria-hidden":t["aria-hidden"],style:{position:"absolute"},children:jsx("div",{role:"gridcell",children:jsx("div",{role:"button",...a,...t,ref:e})})})}function Wt(r,o){if(r.size!==o.size)return false;for(let e of r)if(!o.has(e))return false;return true}var It=({actionsPosition:r,onPrimaryAction:o,onSecondaryAction:e,primaryActionIcon:t,secondaryActionIcon:n,primaryActionAriaLabel:a,secondaryActionAriaLabel:s,expandLabel:c,collapseLabel:p,onRename:D,renameLabel:g,renderItemTitle:S,renderItem:m})=>Object.values({actionsPosition:r,onPrimaryAction:o,onSecondaryAction:e,primaryActionIcon:t,secondaryActionIcon:n,primaryActionAriaLabel:a,secondaryActionAriaLabel:s,expandLabel:c,collapseLabel:p,onRename:D,renameLabel:g,renderItemTitle:S,renderItem:m});var Ct="_10dw1p98",wt="_10dw1p96",Rt=["_10dw1p9b","_10dw1p9c"],St="_10dw1p97",Et=a$f({defaultClassName:"_10dw1p90 _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z69f _1yep5z69g _1yep5z69h _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6m6 _1yep5z6lt _1yep5z6lq",variantClassNames:{isSelected:{true:"_1yep5z612u"},isHovered:{true:"_10dw1p92"},isRenaming:{true:"_10dw1p93"},isDropTarget:{true:"_1yep5z612t _1yep5z614w _1yep5z618s _1yep5z618q _1yep5z618t"},isFocusVisible:{true:"_1yep5z614w _1yep5z618s _1yep5z618q _1yep5z618t"}},defaultVariants:{},compoundVariants:[[{isHovered:true,isSelected:false,isRenaming:false},"_1yep5z61pc _1yep5z61rl _1yep5z61va _1yep5z61v9 _1yep5z61vd"]]}),Lt="_10dw1p99";function Kt(r,o){let e=r;if(typeof r=="function"&&!r.prototype?.isReactComponent){let t=r(o);e=isValidElement(t)?r:t;}if(e)return "unselected"in e?e.unselected:e}var Le=({item:r,id:o,value:e,...t})=>{let{onPrimaryAction:n,onSecondaryAction:a,actionsPosition:s,primaryActionIcon:c,secondaryActionIcon:p,primaryActionAriaLabel:D,secondaryActionAriaLabel:g,expandLabel:S,collapseLabel:m,onRename:h,renameLabel:x,renderItemTitle:P,renderItem:I}=t,{formatMessage:b}=b$7(),{renamingKey:k,setRenamingKey:T}=useContext(Me),L=k===r.id,C=!!r.children?.length,N=r.icon,E=!!h,v=useRef(false),K=useMemo(()=>{let i=Kt(c,r.id),y=Kt(p,r.id),u=typeof D=="function"?D(r.id):D,f=typeof g=="function"?g(r.id):g;return i||y?jsxs(a$k,{display:"flex",flexDirection:"row",style:s==="end"?{marginInlineStart:"auto"}:void 0,children:[i?jsx(a$l,{icon:i,"aria-label":u,size:"sm",excludeFromTabOrder:true,variant:"secondary",onPress:()=>{n?.(r.id);},tooltip:true}):null,y?jsx(a$l,{icon:y,"aria-label":f,size:"sm",excludeFromTabOrder:true,variant:"secondary",onPress:()=>{a?.(r.id);},tooltip:true}):null]}):null},[s,c,r.id,p,D,g,n,a]),M=useCallback(i=>{a$m(i)||(i.key==="Enter"?(v.current=true,h?.({key:r.id,value:i.target.value}),T(null)):i.key==="Escape"&&(v.current=true,T(null)));},[r.id,h,T]),l$1=useCallback(()=>P?P(r):r.label,[P,r]);return jsxs(Se,{id:r.id,value:r,textValue:r.label,"data-key":r.id,className:I?a$h(wt,"BaselineUI-TreeView-Row"):i=>a$h(St,Et({isHovered:i.isHovered,isSelected:i.isSelected,isFocusVisible:i.isFocusVisible,isRenaming:L,isDropTarget:i.isDropTarget}),"BaselineUI-TreeView-Row"),children:[jsx(Re,{children:i=>{let y=i.allowsDragging?jsx(a$l,{slot:"drag",icon:DragIndicatorIcon,size:"xs",variant:"secondary",className:"BaselineUI-TreeView-DragHandle","data-testid":"tree-view-drag-handle"}):null;if(I){let f=I(r,{level:i.level,isExpanded:i.isExpanded,hasChildItems:i.hasChildItems,isSelected:i.isSelected,isFocusVisible:i.isFocusVisible,isFocusVisibleWithin:i.isFocusVisibleWithin,isHovered:i.isHovered,isPressed:i.isPressed,isDropTarget:!!i.isDropTarget,isDragging:!!i.isDragging,toggleExpanded:()=>{i.state.toggleKey(i.id);}});return y?jsxs(a$k,{display:"flex",flexDirection:"row",alignItems:"center",children:[y,jsx("div",{style:{flex:1,minWidth:0},children:f})]}):f}let u=i.level-1;return jsxs(Fragment,{children:[y,s==="start"?K:null,jsxs(a$k,{display:"flex",flexDirection:"row",alignItems:"center",children:[jsxs(a$k,{display:"flex",padding:"sm",flexDirection:"row",alignItems:"center",gap:"md",style:{marginInlineStart:`calc(${u*2} * ${themeVars.spacing.lg})`},children:[jsx(a$l,{icon:ChevronRightIcon,size:"xxs",variant:"secondary",onPress:()=>{i.state.toggleKey(i.id);},"aria-label":i.isExpanded?m??b(Ee.collapse):S??b(Ee.expand),style:{visibility:C?"visible":"hidden"},className:a$h(Ct,"BaselineUI-TreeView-ExpansionToggle")}),N?jsx(N,{size:16,style:{color:themeVars.color.icon.interactive.disabled}}):null]}),jsxs(a$k,{paddingLeft:"sm",paddingY:L?"none":"md",display:"flex",flexDirection:"column",gap:"xs",onDoubleClick:f=>{E&&(f.stopPropagation(),f.preventDefault(),T(r.id));},children:[L?jsx("div",{onClick:f=>{f.stopPropagation();},children:jsx(a$n,{defaultValue:r.label,autoFocus:true,onFocus:()=>{v.current=false;},onBlur:f=>{if(v.current){v.current=false;return}h?.({key:r.id,value:f.target.value}),T(null);},"aria-label":x??b(Ee.rename),onKeyDown:M,className:"BaselineUI-TreeView-RenameInput"})}):jsx(a$o,{type:"label",size:"sm",className:a$h(sprinkles.compoundVariants({color:"text.primary"}),"BaselineUI-TreeView-Title"),children:l$1()}),r.description?jsx(a$o,{type:"helper",size:"sm",className:"BaselineUI-TreeView-Description",children:r.description}):null]})]}),s==="end"?K:null]})}}),jsx(l,{items:r.children,children:i=>jsx(Le,{item:i,...t})})]})},Ee=c$2({expand:{id:"bui.treeView.expand",defaultMessage:"Expand"},collapse:{id:"bui.treeView.collapse",defaultMessage:"Collapse"},rename:{id:"bui.treeView.rename",defaultMessage:"Rename"}});var Me=createContext({renamingKey:null,setRenamingKey:()=>{}}),At=_t.forwardRef(({className:r,style:o,"data-block-id":e,"data-block-class":t,items:n,onPrimaryAction:a,onSecondaryAction:s,primaryActionIcon:c,secondaryActionIcon:p,primaryActionAriaLabel:D,secondaryActionAriaLabel:g,actionsPosition:S="start",expandLabel:m,collapseLabel:h,onRename:x,renameLabel:P,onAction:I,renderItemTitle:b,dragAndDropHooks:k,keyboardNavigationBehavior:T,renderItem:L,...C},N)=>{let E=useRef(null);a$g({ref:E,isDisabled:!k});let[v,K]=useState(null),M=L!==void 0,l=S==="start"?[c,p].filter(Boolean).length:0;useEffect(()=>{let u=E.current;if(!u||!x||M)return;let f=A=>{if(A.key==="F2"){let _=u.querySelector("[data-focused='true']")?.dataset.key;_&&(A.preventDefault(),A.stopPropagation(),K(_));}};return u.addEventListener("keydown",f),()=>{u.removeEventListener("keydown",f);}},[x,M]);let i=useMemo(()=>({renamingKey:v,setRenamingKey:K}),[v]),y={actionsPosition:S,onPrimaryAction:a,onSecondaryAction:s,primaryActionIcon:c,secondaryActionIcon:p,primaryActionAriaLabel:D,secondaryActionAriaLabel:g,expandLabel:m,collapseLabel:h,onRename:x,renameLabel:P,renderItemTitle:b,renderItem:L};return jsx(Me.Provider,{value:i,children:jsx(we,{ref:f$1(N,E),items:n.children||[],selectionMode:"multiple",expandedKeys:C.expandedKeys,defaultExpandedKeys:C.defaultExpandedKeys,onExpandedChange:C.onExpandedChange,selectedKeys:C.selectedKeys,disallowEmptySelection:C.disallowEmptySelection,onAction:I,dragAndDropHooks:k,keyboardNavigationBehavior:T,"aria-label":C["aria-label"],"aria-labelledby":C["aria-labelledby"],"data-block-id":e,"data-block-class":t,style:o,className:a$h(r,!M&&Lt,!M&&Rt[l-1],"BaselineUI-TreeView"),dependencies:It(y),children:u=>jsx(Le,{item:u,...y})})})});At.displayName="TreeView";export{At as a};
@@ -1,10 +0,0 @@
1
- import {a as a$4}from'./chunk-4CMATAQ2.mjs';import {a as a$2}from'./chunk-2MS356Q7.mjs';import {c as c$1}from'./chunk-6RN7DKRF.mjs';import {e,f,d,h,g}from'./chunk-XF65LVBQ.mjs';import {b}from'./chunk-P3RRGPNM.mjs';import {a as a$5}from'./chunk-DIL5HL6K.mjs';import {a as a$3}from'./chunk-3K6XNSYE.mjs';import {a as a$1}from'./chunk-ELW6SXDM.mjs';import {c}from'./chunk-V2C4UDOC.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import j from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var H="_1hgzo20",O=a({defaultClassName:"_1hgzo22 _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6ey _1yep5z6dy",variantClassNames:{isPlaceholder:{true:"_1hgzo23"},isDisabled:{true:"_1hgzo24"}},defaultVariants:{},compoundVariants:[]}),W="_1hgzo21 _1yep5z69c _1yep5z69d _1yep5z69e";var ge="Choose file",Ie="No file chosen";function he(t,d){return t.length===0?d:t.length===1?t[0].name:`${t.length} files`}var k=j.forwardRef(({className:t,style:d$1,label:c$2,buttonLabel:q=ge,placeholder:$=Ie,description:f$1,errorMessage:s,warningMessage:y,validationState:G,labelPosition:n="top",isDisabled:o,autoFocus:J,buttonStyle:K,buttonClassName:Q,onValueChange:X,onSelect:Y,acceptedFileTypes:Z,allowsMultiple:ee,defaultCamera:te,acceptDirectory:ne,"aria-label":g$1,"aria-describedby":oe,...ae},ie)=>{let[I,re]=j.useState([]),h$1=c(),v=c(),F=c(),_=c(),z=c(),b$1=c(),{isFocusVisible:se,focusProps:le}=a$1({within:true}),a=s?"error":G,u=a==="warning"&&!!y,pe=s?_:u?z:f$1?F:void 0,l=c$1({description:s||u?void 0:f$1,errorMessage:s,warningMessage:u?y:void 0,descriptionProps:{id:F},errorMessageProps:{id:_},warningMessageProps:{id:z},labelPosition:n,isDisabled:o}),x=i=>i.filter(Boolean).join(" ")||void 0,de=g$1?void 0:x([c$2?h$1:void 0,v]),ce=x([oe,pe,b$1]),ue=i=>{let w=i?[...i]:[];re(w),X?.(w),Y?.(i);},me=he(I,$),fe=I.length===0,N=a$2({validationState:a}),ye=a$3({"data-disabled":o,"data-validation-state":a});return jsx(a$4,{acceptedFileTypes:Z,allowsMultiple:ee,defaultCamera:te,acceptDirectory:ne,onSelect:ue,children:jsxs("div",{ref:ie,...ae,...ye,className:a$6("BaselineUI-FileInput",g({labelPosition:n}),t),style:d$1,children:[c$2||n==="start"&&l?jsxs("div",{className:f({labelPosition:n,hasMessage:!!l}),children:[jsx(a$5,{id:h$1,elementType:"span",className:e,children:c$2}),n==="start"&&l]}):null,jsxs("div",{...le,className:a$6(h({validationState:a,isDisabled:o,variant:"primary",isFocused:se,isHovered:false,isReadOnly:false}),W),children:[jsx(b,{id:v,label:q,variant:"primary",size:"sm",autoFocus:J,isDisabled:o,"aria-label":g$1,"aria-labelledby":de,"aria-describedby":ce,style:K,className:a$6(H,Q)}),jsx("span",{id:b$1,className:O({isPlaceholder:fe,isDisabled:o}),children:me}),N?jsx(N,{className:d({validationState:a}),size:16}):null]}),n==="top"&&l]})})});k.displayName="FileInput";export{k as a};
@@ -1,10 +0,0 @@
1
- import {c,b}from'./chunk-JYWJE6L5.mjs';import {a}from'./chunk-JJG67M2S.mjs';import m,{useEffect,useCallback}from'react';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- function H(t,i){let{playingLabel:a$1,pausedLabel:r}=i??{},{formatMessage:n,locale:o}=b(),[T,f]=m.useState(false),[D,s]=m.useState(0),[c,v]=m.useState(0),[E,P]=m.useState(false);useEffect(()=>{if(!t.current)return;let e=t.current,u=()=>{f(false),s(0);},L=()=>{!E&&e.duration>0&&s(e.currentTime*100/e.duration);},p=()=>{v(e.duration);},d=()=>{f(!e.paused);},M=()=>{d(),s(0),v(0);};return e.readyState>=1&&p(),e.addEventListener("playing",d),e.addEventListener("pause",d),e.addEventListener("emptied",M),e.addEventListener("ended",u),e.addEventListener("timeupdate",L),e.addEventListener("loadedmetadata",p),()=>{e.removeEventListener("playing",d),e.removeEventListener("pause",d),e.removeEventListener("emptied",M),e.removeEventListener("ended",u),e.removeEventListener("timeupdate",L),e.removeEventListener("loadedmetadata",p);}},[E,t]);let I=useCallback(()=>{let e=t.current;e&&(e.paused?e.play().then(()=>{a(a$1??n(S.playing),"polite");},u=>{if(u?.name!=="AbortError")throw u}):(e.pause(),a(r??n(S.paused),"polite")));},[n,r,a$1,t]),A=useCallback(e=>{t.current&&Number.isFinite(t.current.duration)&&t.current.duration>0?(t.current.currentTime=e*t.current.duration/100,a(k(t.current.currentTime,o.locale),"assertive")):s(0);},[o.locale,t]);return {isPlaying:T,progress:D,duration:c,togglePlay:I,seek:A,setProgress:s,formattedCurrentTime:t.current?.currentTime?g(t.current?.currentTime):"00:00",formattedDuration:Number.isFinite(c)&&c>0?g(c):"00:00",setIsSliderDragging:P}}var S=c({playing:{id:"bui.useMedia.playing",defaultMessage:"Playing"},paused:{id:"bui.useMedia.paused",defaultMessage:"Paused"}});function k(t,i){if(!("DurationFormat"in Intl))return g(t);let a=Math.floor(t/3600),r=Math.floor(t%3600/60),n=t%60,o={...a&&{hours:a},...r&&{minutes:r},seconds:Math.floor(n)};return new Intl.DurationFormat(i,{style:"long"}).format(o)}function g(t){let i=Math.floor(t/3600),a=Math.floor(t%3600/60),r=Math.floor(t%60),n=[a,r].map(o=>o.toString().padStart(2,"0")).join(":");return i?`${i}:${n}`:n}export{H as a,k as b};
@@ -1,10 +0,0 @@
1
- import {a as a$1}from'./chunk-Y6PZKRST.mjs';import {b,a,g,d,h}from'./chunk-TYOEGCPS.mjs';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var C=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function H(i){return i.dataset.liveAnnouncer==="true"||i.dataset.reactAriaTopLayer!==void 0}var E=new WeakMap,n=[];function _(i,l){let s=b(i?.[0]),O=l instanceof s.Element?{root:l}:l,b$1=O?.root??a(i?.[0]).body,g$1=O?.shouldUseInert&&C,d$1=new Set(i),a$2=new Set,y=e=>g$1&&e instanceof s.HTMLElement?e.inert:e.getAttribute("aria-hidden")==="true",L=(e,t)=>{g$1&&e instanceof s.HTMLElement?e.inert=t:t?e.setAttribute("aria-hidden","true"):(e.removeAttribute("aria-hidden"),e instanceof s.HTMLElement&&(e.inert=false));},h$1=new Set;if(g()){let e=b$1.getRootNode();for(let t of i){let r=t.getRootNode();for(;d(r)&&r!==e;)h$1.add(r),r=r.host.getRootNode();}}let v=e=>{for(let o of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))d$1.add(o);let t=o=>{if(a$2.has(o)||d$1.has(o)||o.parentElement&&a$2.has(o.parentElement)&&o.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let A of d$1)if(h(o,A))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},r=a$1(a(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),f=t(e);if(f===NodeFilter.FILTER_ACCEPT&&T(e),f!==NodeFilter.FILTER_REJECT){let o=r.nextNode();for(;o!=null;)T(o),o=r.nextNode();}},T=e=>{let t=E.get(e)??0;y(e)&&t===0||(t===0&&L(e,true),a$2.add(e),E.set(e,t+1));};n.length&&n[n.length-1].disconnect(),v(b$1);let c=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.target.isConnected&&![...d$1,...a$2].some(r=>h(r,t.target)))for(let r of t.addedNodes)(r instanceof s.HTMLElement||r instanceof s.SVGElement)&&H(r)?d$1.add(r):r instanceof s.Element&&v(r);if(g()){for(let r of h$1)if(!r.isConnected){c.disconnect();break}}}});c.observe(b$1,{childList:true,subtree:true});let m=new Map;if(g())for(let e of h$1){let t=new MutationObserver(r=>{for(let f of r)if(f.type==="childList"){if(f.target.isConnected&&![...d$1,...a$2].some(o=>h(o,f.target)))for(let o of f.addedNodes)(o instanceof s.HTMLElement||o instanceof s.SVGElement)&&H(o)?d$1.add(o):o instanceof s.Element&&v(o);if(g()){for(let o of h$1)if(!o.isConnected){c.disconnect();break}}}});t.observe(e,{childList:true,subtree:true}),m.set(t,e);}let w={visibleNodes:d$1,hiddenNodes:a$2,observe(){c.observe(b$1,{childList:true,subtree:true});for(let[e,t]of m)e.observe(t,{childList:true,subtree:true});},disconnect(){c.disconnect();for(let e of m.keys())e.disconnect();}};return n.push(w),()=>{if(c.disconnect(),g())for(let e of m.keys())e.disconnect();for(let e of a$2){let t=E.get(e);t!=null&&(t===1?(L(e,false),E.delete(e)):E.set(e,t-1));}w===n[n.length-1]?(n.pop(),n.length&&n[n.length-1].observe()):n.splice(n.indexOf(w),1);}}function x(i){let l=n[n.length-1];if(l&&!l.visibleNodes.has(i))return l.visibleNodes.add(i),()=>{l.visibleNodes.delete(i);}}export{_ as a,x as b};
@@ -1,10 +0,0 @@
1
- import {a as a$5}from'./chunk-JZXLV6JU.mjs';import {a as a$2}from'./chunk-PTL6NSYA.mjs';import {b,c as c$1}from'./chunk-JYWJE6L5.mjs';import {a as a$3}from'./chunk-DIL5HL6K.mjs';import {a as a$4}from'./chunk-L7GYT3MC.mjs';import {a as a$1}from'./chunk-FPM5UJRF.mjs';import {c}from'./chunk-V2C4UDOC.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import {CaretLeftIcon,CaretRightIcon}from'@baseline-ui/icons/24';import {useGranularEffect}from'granular-hooks';import Y,{useCallback,useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var U=a({defaultClassName:"_1bwul1t8 _1yep5z6m6 _1yep5z6me _1yep5z6ey _1yep5z6g9",variantClassNames:{size:{xs:"_1bwul1t9 _1yep5z6q7 _1yep5z6q8 _1yep5z6q9 _1yep5z6nv _1yep5z6nw _1yep5z6nx _1yep5z610e",sm:"_1bwul1ta _1yep5z6qa _1yep5z6qb _1yep5z6qc _1yep5z6ny _1yep5z6nz _1yep5z6o0 _1yep5z610h",md:"_1bwul1tb _1yep5z6qa _1yep5z6qb _1yep5z6qc _1yep5z6ny _1yep5z6nz _1yep5z6o0 _1yep5z610k"}},defaultVariants:{},compoundVariants:[]}),E=a({defaultClassName:"_1bwul1t3 _1yep5z6ez",variantClassNames:{size:{xs:"_1yep5z610e",sm:"_1yep5z610h",md:"_1yep5z610k"},isDisabled:{true:"_1yep5z611l"}},defaultVariants:{},compoundVariants:[]}),G={xs:"_1bwul1t0",sm:"_1bwul1t1",md:"_1bwul1t2"};var J=Y.forwardRef(({className:Q,style:X,size:p="md",isDisabled:i,decrementAriaLabel:Z,incrementAriaLabel:j,"data-block-id":V,"data-block-class":ee,label:te,onChange:F,onBlur:k,onKeyDown:B,minValue:o=Number.NEGATIVE_INFINITY,maxValue:n=Number.POSITIVE_INFINITY,defaultValue:ne,value:ae,description:w=g=>Number.isFinite(n)?`${g} / ${n}`:`${g}`,onInputChange:re,onChangeSuccess:ie,step:y=1,valueToLabelMap:u,isDecrementButtonDisabled:oe,isIncrementButtonDisabled:se,...d},de)=>{let g=b(),le=Y.useRef(null),q=c(),O=c(),a=useCallback(e=>u?u.get(e)??e.toString():e.toString(),[u]),S=useCallback(e=>{if(u){let D=[...u.entries()].find(([,me])=>me===e);if(D)return D[0]}let r=e.trim();return /^-?\d+$/.test(r)?Number(r):Number.NaN},[u]),[t,c$1]=a$1(ae,ne??1,ie),[b$1,m]=useState(a(t)??""),z=t<=o||i||oe,P=t>=n||i||se,f=useCallback(e=>{if(!e){m(a(t));return}if(e===a(t))return;let r=S(e);if(r!==t&&F?.(e),Number.isNaN(r)){m(a(t)??"");return}r>=o&&r<=n&&!i&&!d.isReadOnly?(c$1(r),m(a(r))):m(a(t));},[F,S,o,n,i,d.isReadOnly,a,t,c$1]),_=useCallback(e=>e>=o&&e<=n,[o,n]),pe=useCallback(e=>{f(b$1),k?.(e);},[b$1,f,k]),h=useCallback(()=>{if(P)return;let e=Math.min(t+y,n);_(e)&&c$1(e);},[t,P,_,n,c$1,y]),x=useCallback(()=>{if(z)return;let e=Math.max(t-y,o);_(e)&&c$1(e);},[t,z,_,o,c$1,y]),ue=useCallback(e=>{if(d.isReadOnly)e.continuePropagation();else switch(e.key){case "Enter":{f(b$1);break}case "ArrowUp":{h();break}case "ArrowDown":{x();break}default:e.continuePropagation();}B?.(e);},[d.isReadOnly,B,f,b$1,h,x]);useGranularEffect(()=>{m(a(t));},[t],[a]);let v=typeof w=="function"?w(t):w,{inputProps:ce}=a$2({...d,value:b$1?.toString(),isDisabled:i,onBlur:pe,onChange:e=>{m(e),re?.(e);},onKeyDown:ue,"aria-labelledby":q,"aria-describedby":v?O:void 0},le);return jsxs(a$3,{className:a$6(G[p],Q),display:"flex",flexDirection:"row",alignItems:"center","data-block-id":V,"data-block-class":ee,style:X,ref:de,"data-disabled":i||void 0,children:[jsx("span",{id:q,className:E({size:p,isDisabled:i}),children:te}),jsxs(a$3,{display:"flex",flexDirection:"row",borderRadius:"sm",borderColor:"border.subtle",borderStyle:"solid",borderWidth:1,style:{height:"inherit"},children:[jsx(a$4,{icon:CaretLeftIcon,elementType:"div",size:p,variant:"secondary",style:{height:"100%"},className:"BaselineUI-TaggedPagination-DecrementButton",isExcludedFromRovingFocus:true,isDisabled:z||d.isReadOnly,excludeFromTabOrder:true,onPress:x,"aria-label":Z||g.formatMessage(L.prevPage),tooltip:true}),jsx(a$5,{orientation:"vertical"}),jsx("input",{...ce,className:U({size:p}),min:o,max:n}),jsx(a$5,{orientation:"vertical"}),jsx(a$4,{icon:CaretRightIcon,elementType:"div",size:p,variant:"secondary",style:{height:"100%"},className:"BaselineUI-TaggedPagination-IncrementButton",isExcludedFromRovingFocus:true,isDisabled:P||d.isReadOnly,excludeFromTabOrder:true,onPress:h,"aria-label":j||g.formatMessage(L.nextPage),tooltip:true})]}),v?jsx("span",{id:O,className:E({size:p,isDisabled:i}),children:v}):null]})});J.displayName="TaggedPagination";var L=c$1({nextPage:{defaultMessage:"Next Page",id:"bui.taggedPagination.nextPage"},prevPage:{defaultMessage:"Previous Page",id:"bui.taggedPagination.prevPage"}});export{J as a};
@@ -1,10 +0,0 @@
1
- import {a as a$c}from'./chunk-5HXTXIE5.mjs';import {a as a$3}from'./chunk-WJBURR7M.mjs';import {d,a as a$b,c as c$2,b as b$3}from'./chunk-5MUEJ5WI.mjs';import {a as a$a}from'./chunk-RO5ZRU3Y.mjs';import {a as a$5}from'./chunk-PPGEEMZ2.mjs';import {a as a$7}from'./chunk-QMP72J5L.mjs';import {a}from'./chunk-EJGGWOY5.mjs';import {b,c as c$3}from'./chunk-JYWJE6L5.mjs';import {b as b$2}from'./chunk-P3RRGPNM.mjs';import {a as a$8}from'./chunk-L7GYT3MC.mjs';import {b as b$1}from'./chunk-I5YPTKMM.mjs';import {a as a$4}from'./chunk-2VY4FAOY.mjs';import {a as a$1}from'./chunk-ELW6SXDM.mjs';import {a as a$2}from'./chunk-LRFFL765.mjs';import {j}from'./chunk-AIG23SN5.mjs';import {a as a$6}from'./chunk-2MNK24YJ.mjs';import {c as c$1,f,g as g$1}from'./chunk-V2C4UDOC.mjs';import {a as a$9}from'./chunk-4QEH5CGK.mjs';import {UndoIcon,RedoIcon}from'@baseline-ui/icons/16';import {useGranularEffect}from'granular-hooks';import {getStroke}from'perfect-freehand';import c,{useState,useCallback,useMemo,useRef}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- function he({line:t,options:r}){let a=useRef([]),m=useMemo(()=>{let i=Math.ceil(t.length/g),l;for(let n=0;n<i;n++)if(!(!(n===i-1)&&!!a.current[n])){let P=t.slice(n*g-(n>0?1:0),n*g+g);l=a$c(getStroke(P.map(([k,v,d])=>({x:k,y:v,pressure:d})),r)),P.length>=(n>0?g+1:g)&&(a.current[n]=l);}return l},[t,r]);return [...a.current,m]}var g=180;var tt={size:1,thinning:0,smoothing:0,streamline:0,easing:t=>t,start:{taper:0,easing:t=>t,cap:true},end:{taper:0,easing:t=>t,cap:true},simulatePressure:false},Ce=c.forwardRef(({className:t,style:r,canvasClassName:a$c,canvasStyle:m,isBound:i=true,strokeWidth:l=2,strokeColor:n="#3A87FD",onChange:C,defaultValue:B,onChangeEnd:P,enableHistory:k=false,isInline:v=true,isDisabled:d$1,placeholder:D,clearLabel:M,undoLabel:Fe,redoLabel:Se,footerClassName:ye,canvasRef:Re,value:V,footerStyle:Ee,"data-block-id":De,"data-block-class":Me,"aria-label":I,description:we="This is a canvas for drawing using a mouse or touch input.",...u},Oe)=>{let x=b(),Le=c.useRef(null),[h,F]=c.useState(V||B||[]),G=c.useMemo(()=>({...tt,...Object.fromEntries(Object.entries(u).filter(([,e])=>e!==void 0))}),[u]),[f$1,K]=c.useState(),W=c$1(),{labelProps:He,fieldProps:Te}=a({...u,"aria-label":I===void 0&&!u.label&&!u["aria-labelledby"]?"Drawing canvas":I,labelElementType:"span"}),{isFocusVisible:Ue,focusProps:Ne}=a$1({within:true}),{hoverProps:ze,isHovered:Be}=a$2({isDisabled:d$1}),{undo:_,redo:A,canRedo:w,canUndo:O,push:X}=a$3(h,{onAction:e=>{e&&(F(e),P?.(e));},isDisabled:!k}),{keyboardProps:Ve}=j({onKeyDown:e=>{e.key==="Backspace"?j$1():e.key==="z"&&(e.metaKey||e.ctrlKey)&&(e.shiftKey?w&&A():O&&_());}}),[Ie,Y]=useState(false),xe=useCallback(e=>{let p=e.currentTarget.getBoundingClientRect();K(p),e.target.setPointerCapture(e.pointerId);let b=[e.clientX-p.x,e.clientY-p.y,e.pressure];F(s=>[...s,[b]]),Y(true);},[]),Ge=useCallback(e=>{if(e.buttons!==1||!f$1)return;let b=be(e.nativeEvent).map(s=>[i?a$4(s.clientX-f$1.left,0,f$1.width):s.clientX-f$1.left,i?a$4(s.clientY-f$1.top,0,f$1.height):s.clientY-f$1.top,s.pressure]);F(s=>{let H=[...s];return H[s.length-1]=[...H[s.length-1],...b],H});},[f$1,i]),Ke=()=>{f$1&&(P?.(h),X(h),Y(false),K(void 0));};useGranularEffect(()=>{C?.(h);},[h],[C]);let j$1=()=>{F([]),X([]);},Z=c.useRef(null),q=c.useRef(null),L=c.useRef(null),We=a$5(!O,()=>q.current?.focus()),_e=a$5(!w,()=>Z.current?.focus()),J=!!D&&!h.length,Ae=a$5(J,()=>{L.current&&a$6(L.current);});return jsxs("div",{ref:f(Le,Oe),className:a$9(b$3,"BaselineUI-FreehandCanvas",t),style:r,"aria-disabled":d$1,"data-block-id":De,"data-block-class":Me,children:[u.label||k?jsxs("div",{className:d({isInline:v}),children:[u.label?jsx(a$7,{type:"label",size:"sm",...He,children:u.label}):jsx("span",{}),k?jsxs("div",{children:[jsx(a$8,{variant:"secondary",size:"sm",ref:Z,onFocusChange:We,isDisabled:!O||d$1,icon:UndoIcon,onPress:_,"aria-label":Fe||x.formatMessage(ge.undo)}),jsx(a$8,{variant:"secondary",size:"sm",ref:q,onFocusChange:_e,isDisabled:!w||d$1,icon:RedoIcon,onPress:A,"aria-label":Se||x.formatMessage(ge.redo)})]}):null]}):null,jsxs("div",{role:"application",...g$1(Ne,Ve,ze,Te),tabIndex:d$1?void 0:0,className:a$9(a$a({isInline:v,isHovered:Be}),a$b({isFocusVisible:Ue,isInline:v,isDisabled:!!d$1}),a$c),"aria-describedby":[W,u["aria-describedby"]].filter(Boolean).join(" "),style:m,ref:f(L,Re),children:[jsx(b$1,{children:jsx("div",{id:W,children:we})}),jsx("svg",{width:m?.width||"100%",height:m?.height||"100%",onPointerDown:xe,onPointerMove:Ge,onPointerUp:Ke,children:(V||h).map((e,p,b)=>p<b.length-1||!Ie?jsx(Pe,{line:e,options:G,strokeColor:n,strokeWidth:l},p):jsx(ke,{line:e,options:G,strokeColor:n,strokeWidth:l},p))})]}),D||M?jsx("div",{style:Ee,className:a$9(c$2({isInline:v,isDisabled:d$1}),ye),children:!J&&M?jsx(b$2,{size:"sm",variant:"ghost",label:M,onFocusChange:Ae,isDisabled:d$1,onPress:j$1}):jsx(b$2,{size:"sm",variant:"ghost",label:D,isDisabled:true})}):null]})});Ce.displayName="FreehandCanvas";var Pe=c.memo(({line:t,options:r,strokeColor:a,strokeWidth:m})=>{let i=useMemo(()=>a$c(getStroke(t.map(([l,n,C])=>({x:l,y:n,pressure:C})),r)),[t,r]);return jsx("path",{d:i,stroke:a,strokeWidth:m})});Pe.displayName="Stroke";var ke=c.memo(({line:t,options:r,strokeColor:a,strokeWidth:m})=>{let i=he({line:t,options:r});return jsx(Fragment,{children:i.map((l,n)=>jsx("path",{d:l,stroke:a,strokeWidth:m},n))})});ke.displayName="SplitStroke";function be(t){if(typeof t.getCoalescedEvents=="function"){let r=t.getCoalescedEvents();return r.length>0?r.flatMap(a=>be(a)):[t]}return [t]}var ge=c$3({undo:{defaultMessage:"Undo",id:"bui.freehandCanvas.undo"},redo:{defaultMessage:"Redo",id:"bui.freehandCanvas.redo"}});export{Ce as a};
@@ -1,10 +0,0 @@
1
- import {i}from'./chunk-QDMG3P5Z.mjs';import {a as a$1}from'./chunk-EYKQGC4O.mjs';import {a as a$5}from'./chunk-HPUUQKKH.mjs';import {a as a$2}from'./chunk-TQMBJFQC.mjs';import {a as a$3}from'./chunk-ELW6SXDM.mjs';import {a as a$4}from'./chunk-LRFFL765.mjs';import {g,f,e}from'./chunk-V2C4UDOC.mjs';import {a}from'./chunk-TYOEGCPS.mjs';import R,{useState,useEffect,useContext}from'react';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- function M(t,e){let o=t?.getRootNode();return (o&&"getElementById"in o?o:a(t)).getElementById(e)}function H(t,e){let o=e.split(/\s+/).filter(Boolean).map(n=>M(t,n)?.textContent).filter(n=>!!n);return o.length>0?o.join(" "):void 0}function d(t,e$1,o){let{isSelected:n}=e$1,{isPressed:s,buttonProps:r}=a$2({...t,onPress:e(e$1.toggle,t.onPress)},o);return {isPressed:s,isSelected:n,isDisabled:t.isDisabled||false,buttonProps:g(r,{"aria-pressed":n})}}function Z({tooltip:t,"aria-label":e,"aria-labelledby":o},n){let[s,r]=useState(e||"");useEffect(()=>{o?r(H(n.current,o)??e??""):e&&r(e);},[o,n,e]);let{tooltipProps:i}=a$1({label:s,tooltip:t});return {tooltipProps:i}}var _=t=>{let e=R.useRef(null),{ref:o,...n}=useContext(i),{buttonProps:s,isPressed:r}=a$2(g(t,n),e),{isFocusVisible:i$1,isFocused:l,focusProps:p}=a$3(),{hoverProps:c,isHovered:a}=a$4({isDisabled:t.isDisabled});return {buttonProps:g(a$5(t.elementType,t.isDisabled),s,p,c),isPressed:r,ref:f(e,o||null),isFocusVisible:i$1,isFocused:l,isHovered:a,uiStateOptions:{isHovered:a,isFocused:l,isPressed:r,isDisabled:t.isDisabled,isFocusVisible:i$1}}},$=(t,e)=>{let o=R.useRef(null),{ref:n,...s}=useContext(i),{buttonProps:r,isPressed:i$1}=d(g(t,s),e,o);(r.role==="radio"||r.role==="checkbox")&&(r["aria-pressed"]=void 0);let{isFocusVisible:l,isFocused:p,focusProps:c}=a$3(),{hoverProps:a,isHovered:A}=a$4({isDisabled:t.isDisabled});return {buttonProps:g(a$5(t.elementType,t.isDisabled),r,c,a),isPressed:i$1,ref:f(o,n||null),isFocusVisible:l,isFocused:p,isHovered:A,uiStateOptions:{isHovered:A,isFocused:p,isPressed:i$1,isDisabled:t.isDisabled,isFocusVisible:l,isSelected:e.isSelected}}};export{M as a,Z as b,_ as c,$ as d};
@@ -1,10 +0,0 @@
1
- import {a as a$4}from'./chunk-HVSDXCZP.mjs';import {a as a$d}from'./chunk-LGE4377M.mjs';import {a as a$f}from'./chunk-C6TD53KY.mjs';import {a as a$3,b}from'./chunk-DNZMQ7EA.mjs';import {a as a$2}from'./chunk-XDTKLQJB.mjs';import {a as a$g}from'./chunk-UC6WAEPH.mjs';import {c as c$1}from'./chunk-6RN7DKRF.mjs';import {b as b$4}from'./chunk-P3RRGPNM.mjs';import {a as a$c}from'./chunk-DIL5HL6K.mjs';import {a as a$e}from'./chunk-WSDEMATI.mjs';import {a as a$1}from'./chunk-RPIUPWPO.mjs';import {a as a$h}from'./chunk-TZSRU3GG.mjs';import {b as b$1}from'./chunk-N2XGJKZG.mjs';import {b as b$2}from'./chunk-I5YPTKMM.mjs';import {b as b$3,j as j$1}from'./chunk-QDMG3P5Z.mjs';import {a as a$b}from'./chunk-EYKQGC4O.mjs';import {a as a$a}from'./chunk-FPM5UJRF.mjs';import {a as a$8}from'./chunk-3K6XNSYE.mjs';import {a as a$6}from'./chunk-ELW6SXDM.mjs';import {a as a$7}from'./chunk-LRFFL765.mjs';import {j}from'./chunk-AIG23SN5.mjs';import {a as a$9}from'./chunk-RT4LMB6X.mjs';import {c,f,g}from'./chunk-V2C4UDOC.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$5}from'./chunk-4QEH5CGK.mjs';import A from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {sprinkles}from'@baseline-ui/tokens';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var ne="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z6m3",me="_14uvjig2 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69i _1yep5z69j _1yep5z69k",ue="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6kz _1yep5z6l0 _1yep5z6l1 _1yep5z6jz _1yep5z6k0 _1yep5z6k1",ye=a({defaultClassName:"_14uvjig0 _1yep5z6dy _1yep5z6ez",variantClassNames:{hasNumberInput:{false:"_1yep5z6p1 _1yep5z6p2 _1yep5z6p3"}},defaultVariants:{},compoundVariants:[]}),ce=a({defaultClassName:"_14uvjiga _1yep5z6b0 _1yep5z6b1 _1yep5z6b2 _1yep5z6bo _1yep5z6bp _1yep5z6bq _1yep5z6cc _1yep5z6cd _1yep5z6ce _1yep5z6d0 _1yep5z6d1 _1yep5z6d2 _1yep5z6gh _1yep5z6m5 _1yep5z6lq",variantClassNames:{active:{true:"_14uvjigb _1yep5z6136 _1yep5z618x _1yep5z618p"},isDisabled:{true:"_14uvjigc _1yep5z613a"},isReadOnly:{true:"_1yep5z615l _1yep5z615m _1yep5z615n"},isFocusVisible:{true:"_14uvjige _1yep5z6136 _1yep5z6189"},isHovered:{true:"_14uvjigf _1yep5z6136"}},defaultVariants:{},compoundVariants:[]}),fe="z9nup8a _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv",be="_14uvjig3 z9nup87 _1yep5z6gd _1yep5z6m3",_e=a({defaultClassName:"_14uvjig4 _1yep5z6gh _1yep5z6iw _1yep5z6ix _1yep5z6iy _1yep5z6m4",variantClassNames:{active:{true:"_1yep5z6136"},isFocusVisible:{true:"_1yep5z6136"},isDisabled:{true:"_1yep5z613a"},isHovered:{true:"_1yep5z6136"}},defaultVariants:{},compoundVariants:[]});var N=A.forwardRef(({className:g,style:v,onChange:i,onChangeEnd:p,numberFormatOptions:o,isDisabled:r,step:h,minValue:d,maxValue:S,value:u,"aria-label":s,"aria-labelledby":e,"aria-details":n,"aria-describedby":m,"data-block-id":y,"data-block-class":I,defaultValue:T,isReadOnly:c$2,label:f$1,description:x,id:j,includeNumberInput:b,numberInputClassName:k,numberInputStyle:he},Se)=>{let H=A.useRef(null),F=c(),O={onChange:i===void 0?void 0:z=>{i(z[0]);},isDisabled:r||c$2,step:h,minValue:d,maxValue:S,onChangeEnd:p===void 0?void 0:z=>{p(z[0]);},value:u===void 0?void 0:[u],defaultValue:T===void 0?void 0:[T],"aria-label":s,"aria-labelledby":e,"aria-details":n,"aria-describedby":[x?F:void 0,m].filter(Boolean).join(" ")||void 0,id:j,label:f$1},xe=a$1(o),_=a$2({...O,numberFormatter:xe}),{trackProps:je,groupProps:ke,labelProps:L}=a$3(O,_,H),U=jsx(a$4,{variant:"ghost",showStepper:false,className:k,"aria-label":s,"aria-labelledby":L.id,isDisabled:r,isReadOnly:c$2,value:_.getThumbValue(0),formatOptions:o,onChange:z=>{Number.isNaN(z)||(_.setThumbDragging(0,true),_.setThumbValue(0,z),_.setThumbDragging(0,false));},style:{width:60,textAlign:"right",flexShrink:0,...he}});return jsxs("div",{...ke,style:v,"data-block-id":y,"data-block-class":I,className:a$5(ne,"BaselineUI-Slider",g),children:[f$1?jsxs("div",{className:ue,children:[jsx("label",{...L,className:a$5(ye({hasNumberInput:!!b}),"BaselineUI-Slider-Label"),children:f$1}),b?U:null]}):null,jsxs("div",{className:me,children:[jsx("div",{...je,className:a$5(be,"BaselineUI-Slider-Track"),ref:f(H,Se),"data-testid":"track",children:jsx(Pe,{state:_,trackRef:H,isDisabled:r,isReadOnly:c$2})}),b&&!f$1?U:null]}),c$1({description:x,descriptionProps:{id:F},errorMessageProps:{},isDisabled:r})]})});N.displayName="Slider";function Pe({state:g$1,trackRef:v,isDisabled:i,isReadOnly:p}){let o=A.useRef(null),{thumbProps:r,inputProps:h,isDragging:d}=b({trackRef:v,inputRef:o},g$1),{focusProps:S,isFocused:u,isFocusVisible:s}=a$6(),{hoverProps:e,isHovered:n}=a$7({isDisabled:i}),{direction:m}=b$1(),y=a$8({"data-disabled":i,"data-readonly":p,"data-hovered":n,"data-focus-visible":s,"data-dragging":d,"data-focused":u});return jsxs(Fragment,{children:[jsx("div",{className:a$5(_e({isDisabled:i,isFocusVisible:s,active:d,isHovered:n}),"BaselineUI-Slider-TrackHighlight"),style:{width:m==="rtl"?`calc(100% - ${r.style?.left})`:r.style?.left},"data-testid":"track-highlight"}),jsxs("div",{...g(r,e,y),className:a$5(fe,"BaselineUI-Slider-ThumbHandle"),"data-testid":"thumb",children:[jsx("div",{className:a$5(ce({isDisabled:i,isFocusVisible:s,active:d,isReadOnly:p,isHovered:n}),"BaselineUI-Slider-Thumb")}),jsx(b$2,{children:jsx("input",{ref:o,...g(h,S)})})]})]})}var ve=A.forwardRef(({className:g,style:v,onChange:i,"data-block-id":p,icon:o,formatValue:r=m=>m,tooltip:h=true,iconTooltip:d=true,popoverContentProps:S,isDisabled:u,onTriggerPress:s,...e},n)=>{let m=a$9(n),[y,I]=a$a(e.value,e.defaultValue||0,i),[T,c]=A.useState(false),{keyboardProps:f}=j({onKeyDown:k=>{k.key==="Enter"||k.key==="Escape"?c(false):k.continuePropagation();}}),{tooltipProps:x}=a$b({label:e["aria-label"],tooltip:h}),j$2=r(y||0),b=x?.isDisabled||e["aria-label"]?`${e["aria-label"]}, ${j$2}`:j$2.toString();return jsxs(a$c,{display:"flex",flexDirection:"row",gap:"md",paddingX:"md",alignItems:"center",className:a$5("BaselineUI-IconSlider",g),"data-block-id":p,style:v,ref:m,children:[o?jsx(a$d,{icon:o,label:e["aria-label"],tooltip:d,"aria-hidden":"true",size:24,isFocusable:false,className:sprinkles({color:"icon.primary"})}):null,jsxs(b$3,{type:"dialog",isOpen:T,onOpenChange:c,children:[jsx(j$1,{children:jsx(a$e,{...x,children:jsx(b$4,{label:j$2,variant:"popover","aria-label":b,isDisabled:u,style:{fontVariantNumeric:"tabular-nums",minWidth:68,justifyContent:"space-between"},onPressStart:s})})}),jsx(a$f,{placement:"bottom start",...S,children:jsx(a$g,{size:"content","aria-label":b,children:jsx(a$h,{autoFocus:true,children:jsx(a$c,{paddingY:"sm",paddingX:"lg",marginY:"md",style:{width:215},...f,children:jsx(N,{...e,onChange:I,value:y})})})})})]})]})});ve.displayName="IconSlider";export{N as a,ve as b};
@@ -1,10 +0,0 @@
1
- import {a as a$k}from'./chunk-SUJD4QFW.mjs';import {a as a$m}from'./chunk-HOG4QRLG.mjs';import {c as c$1}from'./chunk-U6W7D7TT.mjs';import {c as c$3}from'./chunk-7EOAYPSZ.mjs';import {I,j,f as f$1,e,p,F,A,H,i,B,s,C,G,z,h,g as g$1,m,q,D,E,t,l,v,y,u,a as a$n,w,d,c as c$5,x,k,b as b$7,o,n,r}from'./chunk-W4DOEGYH.mjs';import {a as a$7,b as b$6,c as c$4,d as d$1}from'./chunk-FCKJCFMD.mjs';import {a as a$p}from'./chunk-HVSDXCZP.mjs';import {a as a$i}from'./chunk-LGE4377M.mjs';import {a as a$c}from'./chunk-C6TD53KY.mjs';import {a as a$d}from'./chunk-UC6WAEPH.mjs';import {b as b$4,e as e$1}from'./chunk-G2RVM2KB.mjs';import {a as a$e}from'./chunk-JZXLV6JU.mjs';import {b as b$1,c as c$2}from'./chunk-JYWJE6L5.mjs';import {b as b$3}from'./chunk-P3RRGPNM.mjs';import {a as a$h}from'./chunk-DIL5HL6K.mjs';import {a as a$l}from'./chunk-L7GYT3MC.mjs';import {a as a$g}from'./chunk-WSDEMATI.mjs';import {a as a$a}from'./chunk-V3DTS6FF.mjs';import {a as a$o}from'./chunk-4EAXDHSV.mjs';import {a as a$j}from'./chunk-JOK6I52O.mjs';import {b as b$2}from'./chunk-N2XGJKZG.mjs';import {b}from'./chunk-I5YPTKMM.mjs';import {b as b$5,j as j$1}from'./chunk-QDMG3P5Z.mjs';import {a as a$9}from'./chunk-AB7LDKP2.mjs';import {a as a$f}from'./chunk-EYKQGC4O.mjs';import {a as a$8}from'./chunk-22VRCVTH.mjs';import {a as a$6}from'./chunk-66CUIXA6.mjs';import {a as a$b}from'./chunk-FPM5UJRF.mjs';import {a as a$5}from'./chunk-HPUUQKKH.mjs';import {a as a$1}from'./chunk-TQMBJFQC.mjs';import {a as a$3}from'./chunk-3K6XNSYE.mjs';import {a as a$2}from'./chunk-ELW6SXDM.mjs';import {a}from'./chunk-LRFFL765.mjs';import {c,f,g}from'./chunk-V2C4UDOC.mjs';import {j as j$2}from'./chunk-TYOEGCPS.mjs';import {a as a$4}from'./chunk-4QEH5CGK.mjs';import io,{useCallback,useMemo,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {TextIcon,PlusIcon,MinusIcon}from'@baseline-ui/icons/20';import {sprinkles}from'@baseline-ui/tokens';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var no=io.forwardRef(({color:o,colorLabel:e,colorName:l,isIndeterminate:r,indeterminateIcon:t,noneLabel:s,...a$5},n)=>{let i=io.useRef(null),{hoverProps:c$1,isHovered:m}=a({isDisabled:a$5.isDisabled}),{buttonProps:d,isPressed:g$1}=a$1(a$5,i),{isFocused:f$2,isFocusVisible:b$1,focusProps:B}=a$2(),S=a$3({"data-block-id":a$5["data-block-id"],"data-focused":f$2,"data-focus-visible":b$1,"data-disabled":a$5.isDisabled,"data-hovered":m,"data-pressed":g$1}),F=c(),I$1=c(),h=!!e||typeof l=="string";return jsxs("button",{...g(d,c$1,B,S),style:a$5.style,className:a$4(f$1({isHovered:m,isFocusVisible:b$1||a$5.isOpen,isDisabled:a$5.isDisabled,labelPosition:a$5.labelPosition}),"BaselineUI-ColorInputButton",a$5.className),ref:f(n,i),id:F,"aria-labelledby":[a$5["aria-labelledby"]||F,h&&I$1].filter(Boolean).join(" "),children:[jsx(I,{color:o?.toString("hexa"),isIndeterminate:r,indeterminateIcon:t,noneLabel:s}),e?jsx("div",{className:j,id:I$1,"aria-hidden":"true",children:l}):h&&jsx(b,{id:I$1,"aria-hidden":"true",children:l})]})});no.displayName="ColorInputButton";var Fo=io.forwardRef(({className:o,style:e$1,icon:l,elementType:r="button",...t},s)=>{let a$6=io.useRef(null),{hoverProps:n,isHovered:i}=a({isDisabled:t.isDisabled}),{buttonProps:c,isPressed:m}=a$1({...t,elementType:r},a$6),{isFocusVisible:d,focusProps:g$1}=a$2(),f$1=a$3({"data-block-id":t["data-block-id"],"data-focused":d,"data-focus-visible":d,"data-disabled":t.isDisabled,"data-hovered":i,"data-pressed":m});return jsxs(r,{...g(a$5(r,t.isDisabled),c,n,g$1,f$1),ref:f(s,a$6),style:e$1,className:a$4(p({isHovered:i||m||t.isOpen,isFocusVisible:d,isDisabled:t.isDisabled}),"BaselineUI-IconColorInputButton","BaselineUI-IconColorInput-Button",o),children:[jsx(l,{size:16}),jsx("div",{className:e,style:{backgroundColor:t.color||void 0}})]})});Fo.displayName="IconColorInputButton";var Wo=io.forwardRef(({setColor:o,color:e,triggerRef:l,autoFocus:r,presets:t,state:s$1,isIndeterminate:a,colorPresetsLabel:n},i$1)=>{let{formatMessage:c}=b$1(),m=useCallback(d=>{if(d instanceof Set&&d.size){let g=[...d][0],f=t.find(b=>b.id===g);a$6(f,"Preset not found"),o(f.id===F?null:a$7(f.id).toFormat(A)),s$1.close();}},[s$1,t,o]);return jsx("div",{className:a$4(s,"BaselineUI-ColorInput-Presets"),style:{minWidth:l.current?.offsetWidth},ref:i$1,children:jsx(c$1,{autoFocus:r,items:t,layout:"grid","aria-label":n??c(ft.colorPresets),className:i,renderOption:H,selectionMode:"single",selectedKeys:a?[]:[e?.toString(B)||F],onSelectionChange:m,shouldSelectOnPressUp:true,escapeKeyBehavior:"none"})})});Wo.displayName="ColorPresetList";var ft=c$2({colorPresets:{defaultMessage:"Color Presets",id:"bui.colorInput.colorPresets"}});var Xe=({value:o,...e})=>{let l=io.useRef(null),r=io.useRef(null),t=io.useRef(null),s=b$6({...e,value:o}),{colorAreaProps:a,xInputProps:n,yInputProps:i,thumbProps:c}=a$n({...e,value:o,inputXRef:l,inputYRef:r,containerRef:t},s);useEffect(()=>{l.current?.focus();},[]);let{focusProps:m,isFocusVisible:d$1}=a$2();return jsx("div",{ref:t,...a,className:a$4(d,"BaselineUI-ColorInput-ColorArea"),children:jsxs("div",{...c,className:a$4(w({isFocusVisible:d$1}),"BaselineUI-ColorInput-ColorAreaThumb"),style:{...c.style,transform:"translate(-50%, -50%)",backgroundColor:C(o)?.withChannelValue("alpha",1).toString("css")},children:[jsx("input",{ref:l,...n,...m}),jsx("input",{ref:r,...i,...m})]})})};var Ye=({color:o$1,setColor:e,allowAlpha:l,...r})=>{let t=d$1({value:o$1,onChange:d=>{e(C(d)?.toFormat(A).withChannelValue("alpha",o$1.getChannelValue("alpha")??1)||z);}}),s=io.useRef(null),{inputProps:a$1}=b$7({...r,"aria-label":"Hex"},t,s),{focusProps:n$1,isFocused:i}=a$2({isTextInput:true}),{hoverProps:c,isHovered:m}=a({});return jsxs("div",{className:a$4(n,"BaselineUI-ColorInput-FieldInput"),"data-color-mode":l?"hexa":"hex",children:[jsx("input",{...g(a$1,n$1,c),ref:s,className:o({isFocused:i,isHovered:m,allowAlpha:l})}),l?jsx($e,{color:o$1,setColor:e}):null]})},qe=({color:o,setColor:e,allowAlpha:l})=>{let r$1=o.toFormat("rgba"),{locale:t}=b$2();return jsxs("div",{className:a$4(n,"BaselineUI-ColorInput-FieldInput"),"data-color-mode":l?"rgba":"rgb",children:[jsx(a$p,{"aria-label":o.getChannelName("red",t),value:r$1.getChannelValue("red"),showStepper:false,className:r,onChange:s=>{e(r$1.withChannelValue("red",s).toFormat(A));},step:1,minValue:0,maxValue:255}),jsx(a$p,{"aria-label":o.getChannelName("green",t),value:r$1.getChannelValue("green"),showStepper:false,className:r,onChange:s=>{e(r$1.withChannelValue("green",s).toFormat(A));},step:1,minValue:0,maxValue:255}),jsx(a$p,{"aria-label":o.getChannelName("blue",t),value:r$1.getChannelValue("blue"),showStepper:false,className:r,onChange:s=>{e(r$1.withChannelValue("blue",s).toFormat(A));},step:1,minValue:0,maxValue:255}),l?jsx($e,{color:o,setColor:e}):null]})},yt={style:"percent",maximumFractionDigits:0},$e=({color:o,setColor:e})=>{let{locale:l}=b$2(),r$1=useCallback(t=>{e(o.withChannelValue("alpha",t));},[o,e]);return jsx(a$p,{"aria-label":o.getChannelName("alpha",l),value:o.getChannelValue("alpha"),formatOptions:yt,className:r,showStepper:false,onChange:r$1,minValue:0,maxValue:1})};var qo=({channel:o,...e})=>{let{locale:l}=b$2(),r=c$4({...e,channel:o,locale:l}),t=io.useRef(null),s=io.useRef(null),{trackProps:a,thumbProps:n,inputProps:i}=c$5({...e,channel:o,trackRef:t,inputRef:s,"aria-label":r.value.getChannelName(o,l)},r),{focusProps:c,isFocusVisible:m}=a$2();return jsxs("div",{className:a$4(k,{[a$o({size:"xs"})]:o==="alpha"},"BaselineUI-ColorInput-ColorSlider"),"data-channel":o,...a,ref:t,children:[o==="alpha"&&jsx("div",{className:x}),jsx("div",{className:k,style:a.style}),jsxs("div",{className:a$4(w({isFocusVisible:m}),"BaselineUI-ColorInput-ColorSliderThumb"),...n,children:[jsx("div",{className:x,style:{backgroundColor:"#ffffff"}}),jsx("div",{style:{backgroundColor:r.getDisplayColor().toString("css"),height:8},className:k}),jsx(b,{children:jsx("input",{ref:s,...i,...c})})]})]})};var xo=({color:o,setColor:e,allowAlpha:l,colorFormatLabel:r,onChangeEnd:t})=>{let[s,a]=io.useState("hex"),{formatMessage:n}=b$1();return jsxs(Fragment,{children:[jsx(Xe,{value:o,xChannel:"saturation",yChannel:"lightness",onChange:e,onChangeEnd:t}),jsxs("div",{className:v,children:[jsx(qo,{channel:"hue",value:o,onChange:e,onChangeEnd:t}),l?jsx(qo,{channel:"alpha",value:o,onChange:e,onChangeEnd:t}):null]}),jsxs("div",{className:a$4(v,sprinkles.variants({paddingTop:"none",gap:"sm"})),children:[jsx(c$3,{label:r??n(Pt.colorFormat),labelPosition:"start",variant:"ghost",items:y,selectedKey:s,onSelectionChange:i=>{a(i);}}),s==="hex"&&jsx(Ye,{color:o,setColor:i=>{e(i),t?.(i);},allowAlpha:l}),s==="rgb"&&jsx(qe,{color:o,setColor:i=>{e(i),t?.(i);},allowAlpha:l})]})]})},Pt=c$2({colorFormat:{defaultMessage:"Color Format",id:"bui.colorInput.colorFormat"}});var Ze=({color:o,setColor:e,storePickedColorKey:l$1,addColorButtonLabel:r,removeColorButtonLabel:t$1,customColorsLabel:s$1,addLabel:a,cancelLabel:n,newColorLabel:i$1,colorFormatLabel:c$2,pickerMode:m$1,allowAlpha:d,isIndeterminate:g,state:f})=>{let{locale:b}=b$2(),{formatMessage:B$1}=b$1(),S=io.useRef(null),F=a$j(S.current),[I,h]=a$k(l$1,[]),v=io.useMemo(()=>Array.isArray(I)?I.filter(p=>Ft(p)):[],[I]),O=io.useRef(null),[K,Mo]=io.useState(o),uo=io.useMemo(()=>v.map(p=>({id:p,label:a$7(p).getColorName(b),description:p})),[v,b]),W=useCallback(()=>{let p=m$1==="active"?o:K;if(v.includes(p.toString(B))){O.current?.querySelector(`[data-key='${p.toString(B)}']`)?.classList.add(t);return}h([...v,p.toString(B)]);},[v,o,h,K,m$1]);useEffect(()=>{let p=O.current;function y(Q){Q.animationName===u&&j$2(Q)?.classList.remove(t);}return p?.addEventListener("animationend",y),()=>{p?.removeEventListener("animationend",y);}},[]);let w=c(),J=jsx(a$l,{ref:S,variant:"secondary",size:"md","aria-label":r,icon:PlusIcon,onPress:m$1==="active"?W:void 0}),co=useCallback(p=>jsxs(a$d,{size:"content",className:m({includesCustomColorPicker:true}),style:{paddingBlockEnd:0},"aria-label":i$1??B$1(Jo.newColor),children:[jsx(xo,{color:K,setColor:Mo,allowAlpha:d,colorFormatLabel:c$2}),jsx(a$e,{}),jsx(a$h,{padding:"lg",display:"flex",flexDirection:"row-reverse",children:jsxs(a$h,{display:"inline-flex",gap:"lg",children:[jsx(b$3,{label:n??B$1(Jo.cancel),size:"sm",variant:"secondary",onPress:p}),jsx(b$3,{label:a??B$1(Jo.add),variant:"primary",onPress:()=>{W(),p();},size:"sm"})]})})]}),[K,W,B$1,d,i$1,c$2,n,a]),Oo=useCallback(p=>{a$6(p instanceof Set,"Key must be a set");let y=[...p][0];y&&(e(a$7(y).toFormat(A)),m$1==="lazy"&&f.close());},[e,m$1,f]);return jsxs(Fragment,{children:[jsx(a$e,{}),jsxs("div",{className:a$4(l,"BaselineUI-ColorInput-CustomColors"),children:[jsx("span",{id:w,children:s$1}),jsxs(a$h,{display:"flex",children:[!!v.length&&v.includes(o.toString(B))&&jsx(a$l,{variant:"secondary",size:"md",elementType:"div",icon:MinusIcon,"aria-label":t$1,onPress:()=>{h(v.filter(p=>p!==o.toString(B)));}}),m$1==="active"&&J,m$1==="lazy"&&(F==="mobile"?jsxs(b$4,{children:[jsx(a$m,{children:J}),jsx(e$1,{style:{zIndex:1e5},children:({close:p})=>co(p)})]}):jsxs(b$5,{type:"dialog",children:[jsx(j$1,{children:J}),jsx(a$c,{placement:"right top",className:q,offset:6,children:({close:p})=>co(p)})]}))]})]}),!!v.length&&jsx(c$1,{items:uo,layout:"grid","aria-labelledby":w,className:a$4(i,s,sprinkles.variants({paddingTop:"xs"}),"BaselineUI-ColorInput-CustomColorsListBox"),renderOption:H,ref:O,autoFocus:false,selectionMode:"single",selectedKeys:g?[]:[o.toString(B)],onSelectionChange:Oo,shouldSelectOnPressUp:true})]})},Jo=c$2({newColor:{defaultMessage:"New Custom Color",id:"bui.colorInput.newColor"},cancel:{defaultMessage:"Cancel",id:"bui.colorInput.cancel"},add:{defaultMessage:"Add",id:"bui.colorInput.add"}});function Ft(o){if(typeof o!="string")return false;try{return a$7(o),!0}catch{return false}}function ot({colorLabel:o,color:e,presets:l,isIndeterminate:r,indeterminateLabel:t,transparentLabel:s}){let{formatMessage:a}=b$1(),{locale:n}=b$2(),i=useMemo(()=>r?{id:"indeterminate",label:t??a(je.indeterminate)}:l.find(d=>d.id===F?!e:e?D(e,a$7(d.id)):false),[l,e,r,a,t]),c=useMemo(()=>{if(typeof o=="function")return o?.(e,{isIndeterminate:!!r});if(typeof o=="boolean")return E(e,i,s??a(je.transparent));throw new TypeError("`colorLabel` must be a function or a boolean")},[e,o,a,i,r,s]),m=useMemo(()=>{if(i?.label)return i.label;e?.getColorName(n);},[e,n,i?.label]);return {colorName:c,humanReadableName:m}}var je=c$2({transparent:{defaultMessage:"Transparent",id:"bui.colorInput.transparent"},indeterminate:{defaultMessage:"Indeterminate",id:"bui.colorInput.indeterminate"}});var Ao=io.forwardRef(({className:o,style:e,allowRemoval:l,allowAlpha:r=true,presets:t,labelPosition:s="top",colorLabel:a=true,includePicker:n=true,onChange:i,onChangeEnd:c$1,defaultValue:m$1,storePickedColorKey:d="baselinePickedColor",value:g$2,addColorButtonLabel:f,removeColorButtonLabel:b,customColorsLabel:B,addLabel:S,cancelLabel:F$1,newColorLabel:I,colorFormatLabel:h$1,colorPresetsLabel:v,noColorLabel:O,indeterminateLabel:K,transparentLabel:Mo,onTriggerPress:uo,renderTriggerButton:W,pickerMode:w="active",offset:J=2,placement:co=s==="start"?"bottom end":"bottom start","data-block-id":Oo,"data-block-class":p,isIndeterminate:y,indeterminateIcon:Q,...N},lt)=>{let Z=io.useRef(null),at=io.useRef(null),X=a$8(N),{triggerProps:oe,overlayProps:st}=a$9({type:"listbox"},X,Z),nt=a$a(N.portalContainer),[Y,wo]=a$b(g$2===void 0?void 0:C(g$2),C(m$1),P=>i?.(P?.toFormat("rgba")||null)),{formatMessage:j}=b$1(),Do=useMemo(()=>G(O??j(To.noColor),t),[t,j,O]),fo=c(),{colorName:ee}=ot({colorLabel:a||true,color:Y,presets:Do,isIndeterminate:y,indeterminateLabel:K,transparentLabel:Mo}),it=a?ee:false,te=useMemo(()=>Do.filter(P=>l||P.id!==F),[Do,l]),mt=f||j(To.addColor),pt=b||j(To.removeColor),ut=B||j(To.customColors),re=jsx(Ze,{color:Y||z,setColor:P=>{wo(P),c$1?.(P?.toFormat("rgba")||null);},storePickedColorKey:d,addColorButtonLabel:mt,removeColorButtonLabel:pt,customColorsLabel:ut,addLabel:S,cancelLabel:F$1,newColorLabel:I,colorFormatLabel:h$1,pickerMode:w,allowAlpha:r,isIndeterminate:!!y,state:X});return jsxs(Fragment,{children:[jsxs("div",{className:a$4({[g$1]:s==="start"},"BaselineUI-ColorInput-Trigger",o),"data-block-id":Oo,"data-block-class":p,style:e,ref:lt,children:[N.label?jsx("label",{id:fo,className:h({labelPosition:s}),children:N.label}):null,W?W({isOpen:X.isOpen,color:Y,ref:Z,colorName:it,triggerProps:g(oe,{onPress:uo}),labelId:fo,isIndeterminate:y,indeterminateIcon:Q,noneLabel:O}):jsx(no,{...g(oe,{onPress:uo,...N.label?{"aria-labelledby":fo}:{"aria-label":N["aria-label"]}}),ref:Z,isOpen:X.isOpen,isDisabled:N.isDisabled,labelPosition:s,color:Y,colorLabel:a,colorName:ee,isIndeterminate:y,indeterminateIcon:Q,noneLabel:O})]}),jsx(a$c,{...N,portalContainer:nt,placement:co,state:X,offset:J,className:a$4(q,"BaselineUI-ColorInput-Popover"),triggerRef:Z,overlayProps:st,children:jsxs(a$d,{size:"content",className:m({includesCustomColorPicker:n}),ref:at,"aria-labelledby":N.label?fo:void 0,"aria-label":N["aria-label"],children:[n&&w==="active"?jsxs(Fragment,{children:[jsx(xo,{color:Y||z,setColor:wo,allowAlpha:r,colorFormatLabel:h$1,onChangeEnd:P=>{c$1?.(P?.toFormat("rgba")||null);}}),re]}):null,!!te.length&&jsxs(Fragment,{children:[n&&w==="active"?jsx(a$e,{}):null,jsx(Wo,{autoFocus:n&&w==="active"?false:"first",state:X,triggerRef:Z,presets:te,colorPresetsLabel:v,color:Y,setColor:P=>{wo(P),c$1?.(P?.toFormat("rgba")||null);},isIndeterminate:!!y})]}),n&&w==="lazy"?re:null]})})]})});Ao.displayName="ColorInput";var To=c$2({addColor:{defaultMessage:"Add Color",id:"bui.colorInput.addColor"},removeColor:{defaultMessage:"Remove Color",id:"bui.colorInput.removeColor"},customColors:{defaultMessage:"Custom Colors",id:"bui.colorInput.customColors"},noColor:{defaultMessage:"None",id:"bui.colorInput.noColor"}});var rt=io.forwardRef(({className:o,style:e,icon:l,variant:r="standard","data-block-id":t,tooltip:s=true,iconTooltip:a=true,...n},i)=>{let c=io.useRef(null),{tooltipProps:m}=a$f({label:n["aria-label"],tooltip:s}),d=useCallback(({isOpen:g,color:f,ref:b,colorName:B,triggerProps:S,isIndeterminate:F,indeterminateIcon:I,noneLabel:h})=>jsx(a$g,{...m,children:r==="standard"?jsx(no,{...S,"aria-label":n["aria-label"],ref:b,isOpen:g,isDisabled:n.isDisabled,color:f,colorLabel:false,colorName:B,isIndeterminate:F,indeterminateIcon:I,noneLabel:h}):jsx(Fo,{...S,isOpen:g,icon:TextIcon,color:f?.toString("hexa"),ref:b,isDisabled:n.isDisabled,"aria-label":n["aria-label"],isIndeterminate:F,indeterminateIcon:I})}),[n,m,r]);return jsxs(a$h,{display:"flex",flexDirection:"row",gap:"md",paddingX:r==="standard"?"md":"none",alignItems:"center",className:a$4("BaselineUI-IconColorInput",o),"data-block-id":t,style:e,ref:f(i,c),children:[r==="standard"&&l?jsx(a$i,{icon:l,label:n["aria-label"],tooltip:a,"aria-hidden":"true",size:24,isFocusable:false,className:sprinkles({color:"icon.primary"})}):null,jsx(Ao,{...n,renderTriggerButton:d})]})});rt.displayName="IconColorInput";export{Fo as a,Ao as b,rt as c};
@@ -1,10 +0,0 @@
1
- import {b as b$1}from'./chunk-4EAXDHSV.mjs';import {a as a$2}from'./chunk-2UUKKXBD.mjs';import {a}from'./chunk-JOK6I52O.mjs';import {a as a$1}from'./chunk-5IC46G5J.mjs';import {b}from'./chunk-N2XGJKZG.mjs';import {g}from'./chunk-V2C4UDOC.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import {MotionConfig,MotionGlobalConfig}from'motion/react';export{MotionGlobalConfig as f}from'motion/react';import {lightTheme,themes,themeVars}from'@baseline-ui/tokens';import {assignInlineVars}from'@vanilla-extract/dynamic';import X,{createContext,useMemo,useEffect,useState}from'react';import {jsx}from'react/jsx-runtime';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- function v(r=typeof window>"u"?void 0:window){let[u,s]=useState("light"),[i,a]=useState(false),[l,n]=useState(false),[p,m]=useState(false);return useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-color-scheme: dark)"),t=o=>{s(o.matches?"dark":"light");};return s(e.matches?"dark":"light"),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-contrast: more)"),t=o=>{a(o.matches);};return a(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-reduced-motion: reduce)"),t=o=>{n(o.matches);};return n(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),useEffect(()=>{if(!r)return;let e=r.matchMedia("(prefers-reduced-transparency: reduce)"),t=o=>{m(o.matches);};return m(e.matches),e.addEventListener("change",t),()=>{e.removeEventListener("change",t);}},[r]),{colorScheme:u,highContrast:i,reducedMotion:l,transparency:p}}var A=createContext({theme:lightTheme,setTheme:()=>{},shouldHandleVirtualKeyboard:true,reducedMotion:"user",minTouchTargetSize:24});var I="var(--hj25q10)";var h={LIGHT:themes.base.light,DARK:themes.base.dark},S=X.forwardRef(({theme:r="system",children:u,setTheme:s,onThemeChange:i,className:a$4,style:l,UNSAFE_domProps:n,"data-block-id":p,"data-block-class":m,reducedMotion:e="user",shouldHandleVirtualKeyboard:t=true,minTouchTargetSize:o=24},V)=>{let{direction:P}=b(),{colorScheme:g$1,reducedMotion:D,highContrast:G,transparency:N}=v(),f=useMemo(()=>{switch(r){case "system":return g$1==="light"?h.LIGHT:h.DARK;case "light":return h.LIGHT;case "dark":return h.DARK;default:return r}},[g$1,r]),{name:K,...z}=f,B=a(),q={"data-theme":K,"data-block-id":p,"data-block-class":m,"data-reduced-motion":e==="user"?D:e==="always","data-high-contrast":G,"data-transparency":N,"data-device":B},F=useMemo(()=>({theme:f,setTheme:y=>{s?.(y),i?.(y);},shouldHandleVirtualKeyboard:t,reducedMotion:e,minTouchTargetSize:o}),[f,s,i,t,e,o]);return useEffect(()=>{s&&a$1("ThemeProvider:setTheme","ThemeProvider: The `setTheme` prop is deprecated and will be removed in a future version of Baseline UI. Use the `onThemeChange` prop instead.");},[s]),jsx(A.Provider,{value:F,children:jsx(MotionConfig,{reducedMotion:e,children:jsx("div",{...g(n,q),className:a$3(b$1,"BaselineUI-ThemeProvider",a$4),style:{...assignInlineVars(themeVars,z),...assignInlineVars({[a$2]:P==="rtl"?"-1":"1",[I]:`${o}px`}),...l},dir:P,ref:V,children:u})})})});S.displayName="ThemeProvider";function Pe(){MotionGlobalConfig.skipAnimations=true;}function ge(){MotionGlobalConfig.skipAnimations=false;}export{v as a,A as b,S as c,Pe as d,ge as e};
@@ -1,11 +0,0 @@
1
- import {a}from'./chunk-5YV74V36.mjs';import {a as a$3}from'./chunk-GHKMHXQ3.mjs';import {a as a$2}from'./chunk-ACHYZYVA.mjs';import {b,c}from'./chunk-JYWJE6L5.mjs';import {b as b$1}from'./chunk-I5YPTKMM.mjs';import {a as a$1}from'./chunk-3K6XNSYE.mjs';import {a as a$4}from'./chunk-4QEH5CGK.mjs';import {PauseIcon,PlayIcon}from'@baseline-ui/icons/24';import i from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var P="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69o _1yep5z69p _1yep5z69q",h="rta2n91 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69o _1yep5z69p _1yep5z69q _1yep5z610h _1yep5z6w1 _1yep5z6w2 _1yep5z6w3 _1yep5z618m _1yep5z611i",k="rta2n90";var j=i.forwardRef(({className:T,style:I,size:x="lg",sources:d,playLabel:A,pauseLabel:S,audioTimelineLabel:C,playingLabel:B,pausedLabel:M,"data-block-id":w,"data-block-class":U,...R},H)=>{let t=i.useRef(null),{isPlaying:r,progress:N,duration:V,togglePlay:E,seek:D,formattedDuration:q,formattedCurrentTime:K,setProgress:L,setIsSliderDragging:p}=a(t,{playingLabel:B,pausedLabel:M}),{formatMessage:s}=b(),o=d.map(({url:e,type:n})=>`${n}|${e}`).join(`
11
- `),u=i.useRef(o);i.useEffect(()=>{u.current!==o&&(u.current=o,t.current?.load());},[o]);let $=a$1({"data-block-id":w,"data-block-class":U,"data-state":r?"playing":"paused","data-loaded":V>0});return jsxs("div",{...$,...R,className:a$4(P,"BaselineUI-AudioPlayer",T),role:"group",style:I,ref:H,children:[jsx(b$1,{children:jsx("audio",{ref:t,children:d.map(({url:e,type:n})=>jsx("source",{src:e,type:n},e))})}),jsx(a$2,{icon:r?PauseIcon:PlayIcon,variant:"toolbar",isSelected:r,size:x,"aria-label":r?S??s(l.pause):A??s(l.play),style:{borderRadius:"50%"},onPress:E}),jsxs("div",{className:h,children:[jsx("span",{"aria-hidden":true,children:K}),jsx(a$3,{"aria-label":C??s(l.audioTimeline),value:N,minValue:0,maxValue:100,className:k,onChange:e=>{L(e),p(true);},onChangeEnd:e=>{D(e),p(false);}}),jsx("span",{"aria-hidden":true,children:q})]})]})});j.displayName="AudioPlayer";var l=c({play:{id:"bui.audioPlayer.play",defaultMessage:"Play"},pause:{id:"bui.audioPlayer.pause",defaultMessage:"Pause"},audioTimeline:{id:"bui.audioPlayer.audioTimeline",defaultMessage:"Audio timeline"}});export{j as a};
@@ -1,10 +0,0 @@
1
- import {a as a$3}from'./chunk-CWPFUB7B.mjs';import {a as a$f}from'./chunk-NV7KQVPE.mjs';import {a as a$g}from'./chunk-4FN6UAXD.mjs';import {f as f$1,b as b$3,i,g as g$1,a as a$c,h,c as c$2,e as e$1,d}from'./chunk-VPN55UVA.mjs';import {a as a$b}from'./chunk-NMSOOQB2.mjs';import {a as a$a}from'./chunk-EPWWEFTP.mjs';import {q}from'./chunk-OYE6VSTU.mjs';import {c as c$1}from'./chunk-FFPJBDWH.mjs';import {p}from'./chunk-4Y5IKZSW.mjs';import {a as a$9}from'./chunk-QYU7CWJD.mjs';import {a as a$8,b as b$4}from'./chunk-KCHAWPUN.mjs';import {b as b$2,e}from'./chunk-G2RVM2KB.mjs';import {b}from'./chunk-3EFE2WAJ.mjs';import {b as b$1,c}from'./chunk-JYWJE6L5.mjs';import {a as a$e}from'./chunk-DIL5HL6K.mjs';import {a as a$d}from'./chunk-L7GYT3MC.mjs';import {a as a$4}from'./chunk-WSDEMATI.mjs';import {a as a$6}from'./chunk-5IC46G5J.mjs';import {a as a$7}from'./chunk-FPM5UJRF.mjs';import {a}from'./chunk-TQMBJFQC.mjs';import {a as a$1}from'./chunk-LRFFL765.mjs';import {a as a$5}from'./chunk-RT4LMB6X.mjs';import {f,g}from'./chunk-V2C4UDOC.mjs';import {a as a$2}from'./chunk-4QEH5CGK.mjs';import {sprinkles}from'@baseline-ui/tokens';import Z,{useRef,useLayoutEffect,useState,useContext,useEffect,useCallback,useMemo}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {XIcon}from'@baseline-ui/icons/12';import {useReducedMotion,motion}from'motion/react';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var We=t=>a$a({getItems:(e,r)=>r.map(i=>({"text/plain":i.label})),renderDropIndicator(e){return jsx(c$1,{target:e,className:({isDropTarget:r})=>a$2(a$b({isDropTarget:r}),"BaselineUI-DropIndicator")})},...t});function Y(t,e){return t.find(r=>r.id===e)}function $e(t,e,r){let i=[...t],l=i.filter(o=>r.has(o.id)),n=i.filter(o=>!r.has(o.id)),s=n.findIndex(o=>o.id===e);return n.flatMap((o,p)=>p===s?[...l,o]:o)}function Xe(t,e,r){let i=[...t],l=i.filter(o=>r.has(o.id)),n=i.filter(o=>!r.has(o.id)),s=n.findIndex(o=>o.id===e);return n.flatMap((o,p)=>p===s?[o,...l]:o)}function oe(t){return t.map(e=>({id:e.id,label:e.label,data:{src:e.src,alt:e.alt}}))}function K(t){return t.map(e=>({id:e.id,label:e.label,src:e.data?.src,alt:e.data?.alt}))}var H={src:"src",alt:"alt"},T={sm:102,md:170};function je(t,e){let r=Y(t,e);return {[H.src]:r?.data?.src||"",[H.alt]:r?.data?.alt||"",key:String(e)}}function qe(t){let e=t[H.src];return e?{src:String(e),alt:t[H.alt]?String(t[H.alt]):""}:null}function Je({fit:t,imageDimensions:e,item:r,isSelected:i}){let l={display:"block",objectFit:t},n=typeof e=="function"?r?e(r,{isSelected:i}):void 0:e;if(!n)return l;let s=typeof n.width=="string"?T[n.width]:n.width;return l.width=s,l.aspectRatio="height"in n?`${s} / ${n.height}`:n.aspectRatio.toString(),l}var Ye=Z.forwardRef(({className:t,children:e,style:r,isDisabled:i,onTruncatedChange:l,onHoverChange:n},s)=>{let o=useRef(null),{buttonProps:p}=a({elementType:"span",isDisabled:i},o);useLayoutEffect(()=>{o.current&&l?.(o.current.scrollWidth>o.current.clientWidth);},[e,l]);let{hoverProps:I}=a$1({isDisabled:i,onHoverChange:n});return jsx(b,{elementType:"span",slot:"label",...g(p,I),className:a$2(t,"BaselineUI-AdaptiveText"),tabIndex:-1,ref:f(o,s),style:r,role:void 0,children:e})});Ye.displayName="Label";var ie=Z.memo(Z.forwardRef(({children:t,isOpen:e,isDisabled:r,...i},l)=>{let[n,s]=useState(false),[o,p]=useState(false),I=a$3(),A=r||!o||I;return jsx(a$4,{text:t,variant:"inverse",includeArrow:false,size:"sm",placement:"bottom start",isOpen:(n||e)&&o,isDisabled:A,children:jsx(Ye,{...i,isDisabled:A,onTruncatedChange:p,onHoverChange:s,ref:l,children:t})})}));ie.displayName="AdaptiveText";var It=t=>t.replaceAll(/["\\\n\r\f]/g,e=>`\\${e.codePointAt(0).toString(16)} `),vt=({fit:t,item:e,deleteElement:r,loadingLabel:i})=>{let{formatMessage:l}=b$1(),{isLoading:n,imgProps:s}=a$f({src:e.data?.src,alt:e.data?.alt||""});return jsxs("div",{className:e$1,children:[n?jsx(a$g,{"aria-label":i??l(_.loading)}):jsx("div",{role:"img",className:d({isLoading:n}),"aria-label":s.alt||"",style:{backgroundImage:s.src?`url("${It(s.src)}")`:void 0,backgroundSize:t}}),r]})},Ze=({item:t,options:{isFocusVisible:e,isSelected:r,isFocused:i,isDisabled:l,isPressed:n},fit:s="contain",onDelete:o,className:p,imageClassName:I,imageLabelClassName:A,imageDimensions:O,style:z,layoutTransition:L=true,deleteLabel:U,loadingLabel:F,renderImage:W=(w,{deleteElement:k})=>jsx(vt,{item:w,deleteElement:k,fit:s,loadingLabel:F})})=>{let{formatMessage:w}=b$1(),k=o?jsx("div",{className:a$c,children:jsx(a$d,{"aria-label":U??w(_.delete),size:"xs",icon:XIcon,onPress:()=>{o(t.id);},isDisabled:l,UNSAFE_isVisuallyInteractiveOnly:true,"data-testid":"image-gallery-delete-button"})}):null,v=K([t])[0],R=useCallback(C=>{let y={},c=typeof C=="function"?C(v,{isSelected:r}):C;return c&&(y.width=typeof c.width=="string"?T[c.width]:c.width,y.aspectRatio="height"in c?`${y.width} / ${c.height}`:c?.aspectRatio?.toString()),y},[v,r]),x=useMemo(()=>({isFocusVisible:e,isSelected:r,isFocused:i,isDisabled:l,isPressed:n}),[e,r,i,l,n]),B=!useReducedMotion()&&(typeof L=="boolean"?L:true),b=typeof L=="object"?L:void 0,$=R(O),X=B?motion.div:"div";return jsxs(X,{...B?{layout:"position",initial:false,transition:b}:{},className:a$2(c$2,a$8(p,v,x)),style:b$4(z,v,x),children:[jsx(a$e,{display:"flex",flexDirection:"column",flex:1,justifyContent:"center",alignItems:"center",flexGrow:0,children:jsx("div",{className:a$2(g$1({isFocusVisible:e,isSelected:r,isLoading:true}),a$8(I,v,x)),style:$,"data-image-key":t.id,children:W(t,{deleteElement:k??void 0,onDelete:o})})}),jsx(ie,{className:a$2(h({isFocusVisible:e,isSelected:r}),A),style:{maxWidth:$.width},isOpen:e,children:t.label})]})};var V={keys:[],isAll:false};function Pt(t,e){return t==="all"?true:"has"in t&&typeof t.has=="function"?t.has(e):[...t].includes(e)}var tt=Z.forwardRef(({className:t,style:e$1,fit:r="cover",onReorder:i$1,"data-block-id":l,"data-block-class":n,onDelete:s,imageWidth:o,aspectRatio:p$1,items:I,defaultItems:A=[],onKeyDown:O,imageContainerClassName:z,imageClassName:L,labelClassName:U,onListChange:F,renderImage:W,layoutTransition:w,imageDimensions:k,imageContainerStyle:v,deleteConfirmationTitle:R="Are you sure you want to delete this item?",deleteLabel:x,cancelLabel:le,loadingLabel:B,...b},$)=>{let{isVirtualized:X}=useContext(p),C=a$5($),[y,c]=useState(V),S=y.keys,{formatMessage:me}=b$1(),ce=o??T.sm,de=p$1??3/4,pe=o!==void 0||p$1!==void 0;useEffect(()=>{pe&&a$6("ImageGallery:deprecatedSizing","ImageGallery: aspectRatio and imageWidth are deprecated. Use imageDimensions instead.");},[pe]);let ee=Z.useMemo(()=>k??{width:ce,aspectRatio:de},[k,ce,de]),[h,j]=a$7(b.selectedKeys,b.defaultSelectedKeys??[],b.onSelectionChange),rt=Z.useMemo(()=>I?oe(I):void 0,[I]),ot=Z.useMemo(()=>oe(A),[]),[u,N]=a$7(rt,ot,F?a=>{F?.(K(a));}:void 0),at=useCallback(a=>{let m=a.target.key,d=a.keys;if(a.target.dropPosition==="before"){let f=$e(u,m,d);N(f);}else if(a.target.dropPosition==="after"){let f=Xe(u,m,d);N(f);}i$1?.(a);},[u,i$1,N]),{dragAndDropHooks:nt}=We({onReorder:at,isDisabled:!i$1,renderDragPreview:a=>jsx(i,{items:a,containerClassName:".BaselineUI-ImageGallery",previewClassName:g$1(),itemDataAttribute:"data-image-key",showCount:true,renderFallback:m=>{let d=qe(m);if(!d)return null;let f=Y(u,m.key),q=f?K([f])[0]:void 0;return jsx("img",{...d,style:Je({fit:r,imageDimensions:ee,item:q,isSelected:Pt(h,m.key)})})}}),getItems:a=>[...a].map(m=>je(u,m)),renderDropIndicator(a){return jsx(c$1,{target:a,className:a$2(b$3({isVirtualized:!!X}),"BaselineUI-DropIndicator")})}}),it=useCallback(()=>{if(s&&S.length){if(y.isAll)j(new Set);else if(h!=="all"){let a=[...h],m=a.filter(d=>!S.includes(d));m.length!==a.length&&j(new Set(m));}N(u.filter(a=>!S.includes(a.id))),s(S),c(V);}},[S,y.isAll,u,s,h,N,j]),st=useCallback((a,m)=>{let d={id:a.id,label:a.label,src:a.data?.src,alt:a.data?.alt};return jsx(Ze,{item:a,options:m,fit:r,onDelete:s?f=>{m.isDisabled||c({keys:[f],isAll:false});}:void 0,renderImage:W,className:a$8(z,d,m),imageClassName:L,imageLabelClassName:U,imageDimensions:ee,style:v,layoutTransition:w,deleteLabel:x,loadingLabel:B},a.id)},[r,s,W,z,L,U,ee,v,w,x,B]);return useEffect(()=>{let a=C.current;if(!a)return;let m=d=>{if(O?.(d),d.key==="Backspace"||d.key==="Delete"){if(!s)return;let f=new Set(b.disabledKeys);if(h==="all"){c({keys:u.map(G=>G.id).filter(G=>!f.has(G)),isAll:true});return}let q=[...h];if(q.length){let G=q.filter(lt=>!f.has(lt));G.length&&c({keys:G,isAll:false});return}let te=d.target.closest("[data-key]");if(!te||!a.contains(te))return;let fe=te.dataset.key;if(f.has(fe))return;c({keys:[fe],isAll:false});}};return a.addEventListener("keydown",m),()=>{a.removeEventListener("keydown",m);}},[C,s,O,h,u,b.disabledKeys]),jsxs(Fragment,{children:[jsx(q,{...b,ref:C,style:e$1,className:a$2(f$1,"BaselineUI-ImageGallery",t),"data-block-id":l,"data-block-class":n,selectedKeys:h,items:u,dragAndDropHooks:nt,layout:"grid",orientation:"vertical",renderOption:st,onSelectionChange:j,optionClassName:i$1&&!X?sprinkles({marginLeft:"sm"}):void 0}),jsx(b$2,{isOpen:!![...S].length,onOpenChange:a=>{a||c(V);},children:jsx(e,{isDismissable:true,children:jsx(a$9,{showCloseButton:false,title:typeof R=="function"?R(y.isAll?"all":new Set(S)):R,primaryActionLabel:x??me(_.delete),cancelLabel:le??me(_.cancel),onCancel:()=>{c(V);},onPrimaryAction:it,autoFocusButton:"cancel"})})})]})});tt.displayName="ImageGallery";var _=c({delete:{id:"bui.imageGallery.delete",defaultMessage:"Delete"},cancel:{id:"bui.imageGallery.cancel",defaultMessage:"Cancel"},loading:{id:"bui.imageGallery.loading",defaultMessage:"Loading"}});export{tt as a};
@@ -1,10 +0,0 @@
1
- import {a}from'./chunk-V2C4UDOC.mjs';import {b}from'./chunk-RMUV6NJJ.mjs';import {useState,useRef}from'react';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- function u(r,e){try{let t=window.localStorage.getItem(r);return t?JSON.parse(t):e}catch(t){return console.log(t),e}}function h(r,e){let t=b(),[a$1,S]=useState(()=>t?e:u(r,e)),s=useRef(a$1),n=useRef(t);return a(()=>{if(!t&&n.current){n.current=false;let o=u(r,e);s.current=o,S(o);}},[e,t,r]),[a$1,o=>{try{n.current&&(n.current=!1,s.current=u(r,e));let c=typeof o=="function"?o(s.current):o;s.current=c,S(c),window.localStorage.setItem(r,JSON.stringify(c));}catch(c){console.log(c);}}]}export{h as a};
@@ -1,10 +0,0 @@
1
- /**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var e=["bui.alertDialog.close","bui.audioPlayer.audioTimeline","bui.audioPlayer.pause","bui.audioPlayer.play","bui.buttonSelect.more","bui.buttonSelect.moreWithLabel","bui.calendar.nextMonth","bui.calendar.nextYear","bui.calendar.previousMonth","bui.calendar.previousYear","bui.calendar.selectMonth","bui.calendar.selectYear","bui.colorInput.add","bui.colorInput.addColor","bui.colorInput.cancel","bui.colorInput.colorFormat","bui.colorInput.colorPresets","bui.colorInput.customColors","bui.colorInput.indeterminate","bui.colorInput.newColor","bui.colorInput.noColor","bui.colorInput.removeColor","bui.colorInput.transparent","bui.colorSwatch.none","bui.dateField.openCalendar","bui.drawer.close","bui.editor.action","bui.editor.addLink","bui.editor.backgroundColor","bui.editor.bold","bui.editor.cancel","bui.editor.close","bui.editor.copy","bui.editor.cut","bui.editor.editLink","bui.editor.fontColor","bui.editor.help","bui.editor.italic","bui.editor.linkAnnotation","bui.editor.mention","bui.editor.openHelpDialog","bui.editor.paste","bui.editor.redo","bui.editor.removeLink","bui.editor.save","bui.editor.selectAll","bui.editor.shortcut","bui.editor.submit","bui.editor.toolbarFocus","bui.editor.underline","bui.editor.undo","bui.fileList.loading","bui.fileList.removeHint","bui.freehandCanvas.redo","bui.freehandCanvas.undo","bui.imageDropZone.selectImage","bui.imageGallery.cancel","bui.imageGallery.delete","bui.imageGallery.loading","bui.inlineAlert.close","bui.pagination.goToPage","bui.pagination.nextPage","bui.pagination.pageXofY","bui.pagination.prevPage","bui.select.clear","bui.select.more","bui.select.search","bui.select.selectAll","bui.stepper.completed","bui.stepper.label","bui.stepper.step","bui.table.loading","bui.tag.remove","bui.taggedPagination.nextPage","bui.taggedPagination.prevPage","bui.toolbar.more","bui.treeView.collapse","bui.treeView.expand","bui.treeView.rename","bui.useMedia.paused","bui.useMedia.playing"],i={close:["bui.alertDialog.close","bui.drawer.close","bui.editor.close","bui.inlineAlert.close"],audioTimeline:["bui.audioPlayer.audioTimeline"],pause:["bui.audioPlayer.pause"],play:["bui.audioPlayer.play"],more:["bui.buttonSelect.more","bui.select.more","bui.toolbar.more"],moreWithLabel:["bui.buttonSelect.moreWithLabel"],nextMonth:["bui.calendar.nextMonth"],nextYear:["bui.calendar.nextYear"],previousMonth:["bui.calendar.previousMonth"],previousYear:["bui.calendar.previousYear"],selectMonth:["bui.calendar.selectMonth"],selectYear:["bui.calendar.selectYear"],add:["bui.colorInput.add"],addColor:["bui.colorInput.addColor"],cancel:["bui.colorInput.cancel","bui.editor.cancel","bui.imageGallery.cancel"],colorFormat:["bui.colorInput.colorFormat"],colorPresets:["bui.colorInput.colorPresets"],customColors:["bui.colorInput.customColors"],indeterminate:["bui.colorInput.indeterminate"],newColor:["bui.colorInput.newColor"],noColor:["bui.colorInput.noColor"],removeColor:["bui.colorInput.removeColor"],transparent:["bui.colorInput.transparent"],none:["bui.colorSwatch.none"],openCalendar:["bui.dateField.openCalendar"],action:["bui.editor.action"],addLink:["bui.editor.addLink"],backgroundColor:["bui.editor.backgroundColor"],bold:["bui.editor.bold"],copy:["bui.editor.copy"],cut:["bui.editor.cut"],editLink:["bui.editor.editLink"],fontColor:["bui.editor.fontColor"],help:["bui.editor.help"],italic:["bui.editor.italic"],linkAnnotation:["bui.editor.linkAnnotation"],mention:["bui.editor.mention"],openHelpDialog:["bui.editor.openHelpDialog"],paste:["bui.editor.paste"],redo:["bui.editor.redo","bui.freehandCanvas.redo"],removeLink:["bui.editor.removeLink"],save:["bui.editor.save"],selectAll:["bui.editor.selectAll","bui.select.selectAll"],shortcut:["bui.editor.shortcut"],submit:["bui.editor.submit"],toolbarFocus:["bui.editor.toolbarFocus"],underline:["bui.editor.underline"],undo:["bui.editor.undo","bui.freehandCanvas.undo"],loading:["bui.fileList.loading","bui.imageGallery.loading","bui.table.loading"],removeHint:["bui.fileList.removeHint"],selectImage:["bui.imageDropZone.selectImage"],delete:["bui.imageGallery.delete"],goToPage:["bui.pagination.goToPage"],nextPage:["bui.pagination.nextPage","bui.taggedPagination.nextPage"],pageXofY:["bui.pagination.pageXofY"],prevPage:["bui.pagination.prevPage","bui.taggedPagination.prevPage"],clear:["bui.select.clear"],search:["bui.select.search"],completed:["bui.stepper.completed"],label:["bui.stepper.label"],step:["bui.stepper.step"],remove:["bui.tag.remove"],collapse:["bui.treeView.collapse"],expand:["bui.treeView.expand"],rename:["bui.treeView.rename"],paused:["bui.useMedia.paused"],playing:["bui.useMedia.playing"]};export{e as a,i as b};
@@ -1,10 +0,0 @@
1
- import {a as a$1,e}from'./chunk-FCKJCFMD.mjs';import {a as a$g,b as b$4}from'./chunk-DNZMQ7EA.mjs';import {a as a$j}from'./chunk-NIAMDJYU.mjs';import {a as a$h}from'./chunk-YYOOJMQZ.mjs';import {b,c}from'./chunk-JYWJE6L5.mjs';import {c as c$2}from'./chunk-W6QO7FPZ.mjs';import {a as a$5}from'./chunk-DIL5HL6K.mjs';import {a as a$7}from'./chunk-WSDEMATI.mjs';import {a as a$i}from'./chunk-RKPWFZB4.mjs';import {a as a$c}from'./chunk-RGWXVYDG.mjs';import {b as b$2}from'./chunk-KG2EHFYA.mjs';import {b as b$1}from'./chunk-N2XGJKZG.mjs';import {a as a$f}from'./chunk-I5YPTKMM.mjs';import {a as a$4}from'./chunk-EYKQGC4O.mjs';import {a as a$e}from'./chunk-BPXZ6J5G.mjs';import {a as a$k}from'./chunk-66CUIXA6.mjs';import {a as a$b}from'./chunk-5NVCSLXT.mjs';import {a as a$3}from'./chunk-3K6XNSYE.mjs';import {d}from'./chunk-PV4E7XDP.mjs';import {b as b$3,a as a$d}from'./chunk-2PTLJDIT.mjs';import {a as a$2}from'./chunk-LRFFL765.mjs';import {j}from'./chunk-AIG23SN5.mjs';import {a as a$a,h,l}from'./chunk-2MNK24YJ.mjs';import {g,c as c$1}from'./chunk-V2C4UDOC.mjs';import {a as a$8}from'./chunk-SVIYLH7R.mjs';import {a as a$9}from'./chunk-6ZQE5SHE.mjs';import {b as b$5}from'./chunk-TYOEGCPS.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import {HelpIcon}from'@baseline-ui/icons/16';import Mr,{useMemo,useState,useCallback,useRef}from'react';import {flushSync}from'react-dom';import {themeVars}from'@baseline-ui/tokens';import {jsx,jsxs}from'react/jsx-runtime';/**
2
- * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
- *
4
- * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
5
- * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
6
- * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
7
- * This notice may not be removed from this file.
8
- *
9
- */
10
- var ne={"ar-AE":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"\u0623\u062F\u0627\u0629 \u0627\u0646\u062A\u0642\u0627\u0621 \u0627\u0644\u0644\u0648\u0646",colorSwatch:"\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u0623\u0644\u0648\u0627\u0646",transparent:"\u0634\u0641\u0627\u0641",twoDimensionalSlider:"\u0645\u064F\u0646\u0632\u0644\u0642 2D"},"bg-BG":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"\u0421\u0440\u0435\u0434\u0441\u0442\u0432\u043E \u0437\u0430 \u0438\u0437\u0431\u0438\u0440\u0430\u043D\u0435 \u043D\u0430 \u0446\u0432\u044F\u0442",colorSwatch:"\u0446\u0432\u0435\u0442\u043D\u0430 \u043C\u043E\u0441\u0442\u0440\u0430",transparent:"\u043F\u0440\u043E\u0437\u0440\u0430\u0447\u0435\u043D",twoDimensionalSlider:"2D \u043F\u043B\u044A\u0437\u0433\u0430\u0447"},"cs-CZ":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"V\xFDb\u011Br barvy",colorSwatch:"barevn\xFD vzorek",transparent:"pr\u016Fhledn\xFD",twoDimensionalSlider:"2D posuvn\xEDk"},"da-DK":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Farvev\xE6lger",colorSwatch:"farvepr\xF8ve",transparent:"gennemsigtig",twoDimensionalSlider:"2D-skyder"},"de-DE":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Farbw\xE4hler",colorSwatch:"Farbfeld",transparent:"transparent",twoDimensionalSlider:"2D-Schieberegler"},"el-GR":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"\u0395\u03C0\u03B9\u03BB\u03BF\u03B3\u03AD\u03B1\u03C2 \u03C7\u03C1\u03C9\u03BC\u03AC\u03C4\u03C9\u03BD",colorSwatch:"\u03C7\u03C1\u03C9\u03BC\u03B1\u03C4\u03B9\u03BA\u03CC \u03B4\u03B5\u03AF\u03B3\u03BC\u03B1",transparent:"\u03B4\u03B9\u03B1\u03C6\u03B1\u03BD\u03AD\u03C2",twoDimensionalSlider:"\u03A1\u03C5\u03B8\u03BC\u03B9\u03C3\u03C4\u03B9\u03BA\u03CC 2D"},"en-US":{colorPicker:"Color picker",twoDimensionalSlider:"2D slider",colorNameAndValue:e=>`${e.name}: ${e.value}`,colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorSwatch:"color swatch",transparent:"transparent"},"es-ES":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Selector de color",colorSwatch:"muestra de color",transparent:"transparente",twoDimensionalSlider:"Regulador 2D"},"et-EE":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"V\xE4rvivalija",colorSwatch:"v\xE4rvin\xE4idis",transparent:"l\xE4bipaistev",twoDimensionalSlider:"2D-liugur"},"fi-FI":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"V\xE4rimuokkain",colorSwatch:"v\xE4rimalli",transparent:"l\xE4pin\xE4kyv\xE4",twoDimensionalSlider:"2D-liukus\xE4\xE4din"},"fr-FR":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}\xA0: ${e.value}`,colorPicker:"S\xE9lecteur de couleurs",colorSwatch:"\xC9chantillon de couleurs",transparent:"Transparent",twoDimensionalSlider:"Curseur\xA02D"},"he-IL":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"\u05D1\u05D5\u05D7\u05E8 \u05D4\u05E6\u05D1\u05E2\u05D9\u05DD",colorSwatch:"\u05D3\u05D5\u05D2\u05DE\u05D9\u05EA \u05E6\u05D1\u05E2",transparent:"\u05E9\u05E7\u05D5\u05E3",twoDimensionalSlider:"\u05DE\u05D7\u05D5\u05D5\u05DF \u05D3\u05D5 \u05DE\u05D9\u05DE\u05D3\u05D9"},"hr-HR":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Odabir boje",colorSwatch:"uzorak boje",transparent:"transparentno",twoDimensionalSlider:"2D kliza\u010D"},"hu-HU":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Sz\xEDnv\xE1laszt\xF3",colorSwatch:"sz\xEDnt\xE1r",transparent:"\xE1tl\xE1tsz\xF3",twoDimensionalSlider:"2D-cs\xFAszka"},"it-IT":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Selettore colore",colorSwatch:"campione di colore",transparent:"trasparente",twoDimensionalSlider:"Cursore 2D"},"ja-JP":{colorInputLabel:e=>`${e.label}\u3001${e.channelLabel}`,colorNameAndValue:e=>`${e.name} : ${e.value}`,colorPicker:"\u30AB\u30E9\u30FC\u30D4\u30C3\u30AB\u30FC",colorSwatch:"\u30AB\u30E9\u30FC\u30B9\u30A6\u30A9\u30C3\u30C1",transparent:"\u900F\u660E",twoDimensionalSlider:"2D \u30B9\u30E9\u30A4\u30C0\u30FC"},"ko-KR":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"\uC0C9\uC0C1 \uD53C\uCEE4",colorSwatch:"\uC0C9\uC0C1 \uACAC\uBCF8",transparent:"\uD22C\uBA85\uB3C4",twoDimensionalSlider:"2D \uC2AC\uB77C\uC774\uB354"},"lt-LT":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Spalv\u0173 parinkiklis",colorSwatch:"spalv\u0173 pavyzdys",transparent:"skaidrus",twoDimensionalSlider:"2D slankiklis"},"lv-LV":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Kr\u0101su atlas\u012Bt\u0101js",colorSwatch:"kr\u0101su paraugs",transparent:"caursp\u012Bd\u012Bgs",twoDimensionalSlider:"2D sl\u012Bdnis"},"nb-NO":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Fargevelger",colorSwatch:"fargekart",transparent:"gjennomsiktig",twoDimensionalSlider:"2D-glidebryter"},"nl-NL":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Kleurkiezer",colorSwatch:"kleurstaal",transparent:"transparant",twoDimensionalSlider:"2D-schuifregelaar"},"pl-PL":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Pr\xF3bnik kolor\xF3w",colorSwatch:"pr\xF3bka koloru",transparent:"przezroczysty",twoDimensionalSlider:"Suwak 2D"},"pt-BR":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Seletor de cores",colorSwatch:"amostra de cores",transparent:"transparente",twoDimensionalSlider:"Controle deslizante 2D"},"pt-PT":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Seletor de cores",colorSwatch:"amostra de cor",transparent:"transparente",twoDimensionalSlider:"Controle deslizante 2D"},"ro-RO":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Selector de culori",colorSwatch:"specimen de culoare",transparent:"transparent",twoDimensionalSlider:"Glisor 2D"},"ru-RU":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"\u041F\u0430\u043B\u0438\u0442\u0440\u0430 \u0446\u0432\u0435\u0442\u043E\u0432",colorSwatch:"\u0446\u0432\u0435\u0442\u043E\u0432\u043E\u0439 \u043E\u0431\u0440\u0430\u0437\u0435\u0446",transparent:"\u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u044B\u0439",twoDimensionalSlider:"\u041F\u043E\u043B\u0437\u0443\u043D\u043E\u043A 2D"},"sk-SK":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"V\xFDber farieb",colorSwatch:"vzorkovn\xEDk farieb",transparent:"transparentn\xFD",twoDimensionalSlider:"2D jazdec"},"sl-SI":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Izbirnik barv",colorSwatch:"barvna paleta",transparent:"prozorno",twoDimensionalSlider:"2D drsnik"},"sr-SP":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Bira\u010D boja",colorSwatch:"Uzorak boje",transparent:"providno",twoDimensionalSlider:"2D kliza\u010D"},"sv-SE":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"F\xE4rgv\xE4ljaren",colorSwatch:"f\xE4rgruta",transparent:"genomskinlig",twoDimensionalSlider:"2D-reglage"},"tr-TR":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"Renk Se\xE7ici",colorSwatch:"renk \xF6rne\u011Fi",transparent:"saydam",twoDimensionalSlider:"2D s\xFCrg\xFC"},"uk-UA":{colorInputLabel:e=>`${e.label}, ${e.channelLabel}`,colorNameAndValue:e=>`${e.name}: ${e.value}`,colorPicker:"\u041F\u0430\u043B\u0456\u0442\u0440\u0430 \u043A\u043E\u043B\u044C\u043E\u0440\u0456\u0432",colorSwatch:"\u0437\u0440\u0430\u0437\u043E\u043A \u043A\u043E\u043B\u044C\u043E\u0440\u0443",transparent:"\u043F\u0440\u043E\u0437\u043E\u0440\u0438\u0439",twoDimensionalSlider:"\u041F\u043E\u0432\u0437\u0443\u043D\u043E\u043A 2D"},"zh-CN":{colorInputLabel:e=>`${e.label}\u3001${e.channelLabel}`,colorNameAndValue:e=>`${e.name}\uFF1A${e.value}`,colorPicker:"\u62FE\u8272\u5668",colorSwatch:"\u989C\u8272\u8272\u677F",transparent:"\u900F\u660E",twoDimensionalSlider:"2D \u6ED1\u5757"},"zh-TW":{colorInputLabel:e=>`${e.label}\uFF0C${e.channelLabel}`,colorNameAndValue:e=>`${e.name}\uFF1A${e.value}`,colorPicker:"\u6AA2\u8272\u5668",colorSwatch:"\u8272\u7968",transparent:"\u900F\u660E",twoDimensionalSlider:"2D \u6ED1\u687F"}};var Ye=e=>[0,60,120,180,240,300,360].map(r=>e.withChannelValue("hue",r).toString("css")).join(", "),Je=e=>`${e.withChannelValue("saturation",0)}, transparent`,wr={hue:Ye,saturation:Je,lightness:()=>"black, transparent, white"},Ar={hue:Ye,saturation:Je,brightness:()=>"black, transparent"};function Ze({direction:e,state:r,zChannel:l,xChannel:t,yChannel:a}){return useMemo(()=>{let y=e==="rtl"?"left":"right",C={},g=r.value.getChannelValue(l);switch(r.value.getColorSpace()){case "rgb":{let i=a$1("rgb(0, 0, 0)");C={background:[`linear-gradient(to ${y}, ${i.withChannelValue(t,0)}, ${i.withChannelValue(t,255)})`,`linear-gradient(to top, ${i.withChannelValue(a,0)}, ${i.withChannelValue(a,255)})`,i.withChannelValue(l,g)].join(","),backgroundBlendMode:"screen"};break}case "hsl":{let i=r.value.getColorChannels(),s=a$1("hsl(0, 100%, 50%)").withChannelValue(l,g),c=i.filter(n=>n!==l).map(n=>`linear-gradient(to ${n===t?y:"top"}, ${wr[n](s)})`).reverse();l==="hue"&&c.push(s.toString("css")),C={background:c.join(", ")};break}case "hsb":{let i=r.value.getColorChannels(),s=a$1("hsb(0, 100%, 100%)").withChannelValue(l,g),c=i.filter(n=>n!==l).map(n=>`linear-gradient(to ${n===t?y:"top"}, ${Ar[n](s)})`).reverse();l==="hue"&&c.push(s.toString("css")),C={background:c.join(", ")};break}}let{x:f,y:d}=r.getThumbPosition();e==="rtl"&&(f=1-f);let z={forcedColorAdjust:"none"};return {colorAreaStyleProps:{style:{position:"relative",touchAction:"none",...z,...C}},thumbStyleProps:{style:{position:"absolute",left:`${f*100}%`,top:`${d*100}%`,transform:"translate(-50%, -50%)",touchAction:"none",...z}}}},[e,r,l,t,a])}function er(e,r){let{isDisabled:l$1,inputXRef:t,inputYRef:a,containerRef:u,"aria-label":y,xName:C,yName:g$1,form:f}=e,d=b$2(ne,"@react-aria/color"),{addGlobalListener:z,removeGlobalListener:i}=a$9(),{direction:s,locale:c}=b$1(),[n,v]=useState(null),b=useCallback((o=t)=>{o.current&&a$a(o.current);},[t]);a$b(t,r.defaultValue,r.setValue);let[S,h$1]=useState(false),[I,x]=useState(false),{xChannel:_,yChannel:m,zChannel:A}=r.channels,j$1=r.xChannelStep,N=r.yChannelStep,k=useRef(null),O=(o,p,w)=>{r.setDragging(true),h$1(true),o(),r.setDragging(false),b(p),v(w);},{keyboardProps:$}=j({shortcuts:{PageUp:()=>O(()=>{r.incrementY(r.yChannelPageStep);},a,"y"),PageDown:()=>O(()=>{r.decrementY(r.yChannelPageStep);},a,"y"),Home:()=>O(()=>{s==="rtl"?r.incrementX(r.xChannelPageStep):r.decrementX(r.xChannelPageStep);},t,"x"),End:()=>O(()=>{s==="rtl"?r.decrementX(r.xChannelPageStep):r.incrementX(r.xChannelPageStep);},t,"x")},allowRepeats:true}),J={onMoveStart(){k.current=null,r.setDragging(true);},onMove({deltaX:o,deltaY:p,pointerType:w,shiftKey:Z}){let{incrementX:U,decrementX:se,incrementY:ce,decrementY:T,xChannelPageStep:q,xChannelStep:B,yChannelPageStep:ke,yChannelStep:Pe,getThumbPosition:Sr,setColorFromPoint:gr}=r;k.current==null&&(k.current=Sr());let{width:xr,height:kr}=u.current?.getBoundingClientRect()||{width:0,height:0},we=o!==0||p!==0;if(w==="keyboard"){let Ae=Z&&q>B?q:B,$e=Z&&ke>Pe?ke:Pe;o>0&&s==="ltr"||o<0&&s==="rtl"?U(Ae):o<0&&s==="ltr"||o>0&&s==="rtl"?se(Ae):p>0?T($e):p<0&&ce($e),h$1(we),n=we&&Math.abs(p)>Math.abs(o)?"y":"x",v(n);}else k.current.x+=(s==="rtl"?-1:1)*o/xr,k.current.y+=p/kr,gr(k.current.x,k.current.y);},onMoveEnd(){M.current=false,r.setDragging(false),b(n==="x"?t:a);}},{moveProps:sr}=a$c(J),{focusWithinProps:cr}=b$3({onFocusWithinChange:o=>{o||(h$1(false),x(false));}}),F=useRef(void 0),M=useRef(false),{moveProps:dr}=a$c({onMoveStart(){M.current&&J.onMoveStart();},onMove(o){M.current&&J.onMove(o);},onMoveEnd(){M.current&&J.onMoveEnd();}}),pe=o=>{let p=b$5(u.current);r.isDragging||(F.current=o,h$1(false),b(),r.setDragging(true),typeof PointerEvent<"u"?z(p,"pointerup",R,false):(z(p,"mouseup",R,false),z(p,"touchend",R,false)));},R=o=>{let p=b$5(u.current);(o.pointerId??o.changedTouches?.[0].identifier)===F.current&&(h$1(false),b(),r.setDragging(false),F.current=void 0,M.current=false,typeof PointerEvent<"u"?i(p,"pointerup",R,false):(i(p,"mouseup",R,false),i(p,"touchend",R,false)));},ue=(o,p,w,Z)=>{let U=o.getBoundingClientRect(),{width:se,height:ce}=U,T=(w-U.x)/se,q=(Z-U.y)/ce;s==="rtl"&&(T=1-T);let B=b$5(u.current);T>=0&&T<=1&&q>=0&&q<=1&&!r.isDragging&&F.current===void 0&&(M.current=true,h$1(false),F.current=p,r.setColorFromPoint(T,q),b(),r.setDragging(true),typeof PointerEvent<"u"?z(B,"pointerup",E,false):(z(B,"mouseup",E,false),z(B,"touchend",E,false)));},E=o=>{let p=o.pointerId??o.changedTouches?.[0].identifier;if(M.current&&p===F.current){M.current=false,h$1(false),F.current=void 0,r.setDragging(false),b();let w=b$5(u.current);typeof PointerEvent<"u"?i(w,"pointerup",E,false):(i(w,"mouseup",E,false),i(w,"touchend",E,false));}},mr=l$1?{}:g({...typeof PointerEvent<"u"?{onPointerDown:o=>{o.pointerType==="mouse"&&(o.button!==0||o.altKey||o.ctrlKey||o.metaKey)||ue(o.currentTarget,o.pointerId,o.clientX,o.clientY);}}:{onMouseDown:o=>{o.button!==0||o.altKey||o.ctrlKey||o.metaKey||ue(o.currentTarget,void 0,o.clientX,o.clientY);},onTouchStart:o=>{ue(o.currentTarget,o.changedTouches[0].identifier,o.changedTouches[0].clientX,o.changedTouches[0].clientY);}}},dr),yr=l$1?{}:g({...typeof PointerEvent<"u"?{onPointerDown:o=>{o.pointerType==="mouse"&&(o.button!==0||o.altKey||o.ctrlKey||o.metaKey)||pe(o.pointerId);}}:{onMouseDown:o=>{o.button!==0||o.altKey||o.ctrlKey||o.metaKey||pe(void 0);},onTouchStart:o=>{pe(o.changedTouches[0].identifier);}}},cr,$,sr),{focusProps:br}=a$d({onFocus:()=>{v("x");}}),{focusProps:_r}=a$d({onFocus:()=>{v("y");}}),ve=o=>{let{target:p}=o;x(true),p===t.current?r.setXValue(parseFloat(p.value)):p===a.current&&r.setYValue(parseFloat(p.value));},W=h()||l(),P=r.getDisplayColor(),Se=useCallback(o=>`${I||S?d.format("colorNameAndValue",{name:P.getChannelName(o,c),value:P.formatChannelValue(o,c)}):[d.format("colorNameAndValue",{name:P.getChannelName(o,c),value:P.formatChannelValue(o,c)}),d.format("colorNameAndValue",{name:P.getChannelName(o===m?_:m,c),value:P.formatChannelValue(o===m?_:m,c)}),d.format("colorNameAndValue",{name:P.getChannelName(A,c),value:P.formatChannelValue(A,c)})].join(", ")}, ${P.getColorName(c)}`,[c,P,d,I,S,_,m,A]),H=d.format("colorPicker"),fr=a$e({...e,"aria-label":y?d.format("colorInputLabel",{label:y,channelLabel:H}):H}),zr=a$e({...e,"aria-label":y?d.format("colorInputLabel",{label:y,channelLabel:H}):H}),hr=a$e({...e,"aria-label":y?`${y}, ${H}`:void 0},W?H:void 0),ge=d.format("twoDimensionalSlider"),{visuallyHiddenProps:xe}=a$f({style:{opacity:"0.0001",width:"100%",height:"100%",pointerEvents:"none"}}),{colorAreaStyleProps:Cr,thumbStyleProps:vr}=Ze({direction:s,state:r,xChannel:_,yChannel:m,zChannel:A});return {colorAreaProps:{...hr,...mr,...Cr,role:"group"},thumbProps:{...yr,...vr,role:"presentation"},xInputProps:{...fr,...xe,...br,type:"range",min:r.value.getChannelRange(_).minValue,max:r.value.getChannelRange(_).maxValue,step:j$1,"aria-roledescription":ge,"aria-valuetext":Se(_),"aria-orientation":"horizontal","aria-describedby":e["aria-describedby"],"aria-details":e["aria-details"],disabled:l$1,value:r.value.getChannelValue(_),name:C,form:f,tabIndex:W||!n||n==="x"?void 0:-1,"aria-hidden":W||!n||n==="x"||S?void 0:"true",onChange:ve},yInputProps:{...zr,...xe,..._r,type:"range",min:r.value.getChannelRange(m).minValue,max:r.value.getChannelRange(m).maxValue,step:N,"aria-roledescription":ge,"aria-valuetext":Se(m),"aria-orientation":"vertical","aria-describedby":e["aria-describedby"],"aria-details":e["aria-details"],disabled:l$1,value:r.value.getChannelValue(m),name:g$1,form:f,tabIndex:W||n==="y"?void 0:-1,"aria-hidden":W||n==="y"||S?void 0:"true",onChange:ve}}}function rr(e,r){let{trackRef:l,inputRef:t,orientation:a,channel:u,"aria-label":y,name:C,form:g$1}=e,{locale:f,direction:d}=b$1();!e.label&&!y&&!e["aria-labelledby"]&&(y=r.value.getChannelName(u,f));let{groupProps:z,trackProps:i,labelProps:s,outputProps:c}=a$g({...e,"aria-label":y},r,l),{inputProps:n,thumbProps:v}=b$4({index:0,orientation:a,isDisabled:e.isDisabled,name:C,form:g$1,trackRef:l,inputRef:t},r),b=r.getDisplayColor(),S=()=>{let x;switch(a==="vertical"?x="top":d==="ltr"?x="right":x="left",u){case "hue":{let _=[0,60,120,180,240,300,360].map(m=>b.withChannelValue("hue",m).toString("css")).join(", ");return `linear-gradient(to ${x}, ${_})`}case "lightness":{let _=r.getThumbMinValue(0),m=r.getThumbMaxValue(0),A=b.withChannelValue(u,_).toString("css"),j=b.withChannelValue(u,(m-_)/2).toString("css"),N=b.withChannelValue(u,m).toString("css");return `linear-gradient(to ${x}, ${A}, ${j}, ${N})`}case "saturation":case "brightness":case "red":case "green":case "blue":case "alpha":{let _=b.withChannelValue(u,r.getThumbMinValue(0)).toString("css"),m=b.withChannelValue(u,r.getThumbMaxValue(0)).toString("css");return `linear-gradient(to ${x}, ${_}, ${m})`}default:throw new Error("Unknown color channel: "+u)}},h={forcedColorAdjust:"none"};u==="hue"?n["aria-valuetext"]+=`, ${b.getHueName(f)}`:u!=="alpha"&&(n["aria-valuetext"]+=`, ${b.getColorName(f)}`);let{visuallyHiddenProps:I}=a$f({style:{opacity:"0.0001",width:"100%",height:"100%",pointerEvents:"none"}});return {trackProps:{...g(z,i),style:{...i.style,...h,background:S()}},inputProps:{...n,style:{...n.style,...I.style}},thumbProps:{...v,style:{...v.style,...h}},labelProps:s,outputProps:c}}function or(e,r,l){let{isDisabled:t,isReadOnly:a,isRequired:u,isWheelDisabled:y,validationBehavior:C="aria",onKeyDown:g$1,onKeyUp:f}=e,{colorValue:d,inputValue:z,increment:i,decrement:s,incrementToMax:c,decrementToMin:n,commit:v,commitValidation:b}=r,S=c$1(),{spinButtonProps:h}=a$h({isDisabled:t,isReadOnly:a,isRequired:u,maxValue:16777215,minValue:0,onIncrement:i,onIncrementToMax:c,onDecrement:s,onDecrementToMin:n,value:d?d.toHexInt():void 0,textValue:d?d.toString("hex"):void 0}),[I,x]=useState(false),{focusWithinProps:_}=b$3({isDisabled:t,onFocusWithinChange:x}),m=useCallback($=>{Math.abs($.deltaY)<=Math.abs($.deltaX)||($.deltaY>0?i():$.deltaY<0&&s());},[s,i]);a$i({onScroll:m,isDisabled:y||t||a||!I},l);let{keyboardProps:j$1}=j({isDisabled:t||a,shortcuts:{Enter:()=>(flushSync(()=>{v();}),b(),{shouldPreventDefault:false})},onKeyDown:g$1,onKeyUp:f}),N=$=>{r.validate($)&&r.setInputValue($);},{inputProps:k,...O}=a$j({...e,id:S,value:z,defaultValue:"!",validate:void 0,[c$2]:r,type:"text",autoComplete:"off",onChange:N,onKeyDown:void 0,onKeyUp:void 0},r,l);return a$b(l,r.defaultColorValue,r.setColorValue),k=g(j$1,k,h,_,{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false",onBlur:v}),C==="native"&&(k["aria-required"]=void 0),{inputProps:k,...O}}function ie(e){let{color:r,colorName:l}=e,t=r||"#fff0",a=useMemo(()=>typeof t=="string"?a$1(t):t,[t]),{locale:u}=b$1(),y=a$8(e,{labelable:true}),C=b$2(ne,"@react-aria/color"),g=c$1(e.id);return l||(l=a.getChannelValue("alpha")===0?C.format("transparent"):a.getColorName(u)),{colorSwatchProps:{...y,role:"img","aria-roledescription":C.format("colorSwatch"),"aria-label":[l,e["aria-label"]||""].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]?`${g} ${e["aria-labelledby"]}`:void 0,id:g,style:{backgroundColor:a.toString("css"),forcedColorAdjust:"none"}},color:a||null}}var nl="_1dbkl53 _1yep5z6al _1yep5z6am _1yep5z6an _1yep5z6b9 _1yep5z6ba _1yep5z6bb _1yep5z6m3",il="_1dbkl5e",pl=a({defaultClassName:"_1dbkl54 _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62i _1yep5z62j _1yep5z62k _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6me _1yep5z6m6 _1yep5z69i _1yep5z69j _1yep5z69k _1yep5z6ey _1yep5z6m5 _1yep5z6dy",variantClassNames:{isHovered:{true:"_1dbkl55"},isFocusVisible:{true:"_1dbkl56"},isDisabled:{true:"z9nup82 _1yep5z611l"},labelPosition:{top:"_1dbkl58",start:"_1dbkl59"}},defaultVariants:{},compoundVariants:[]}),ul="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kz _1yep5z6l0 _1yep5z6l1",sl=a({defaultClassName:"_1dbkl50 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6dy _1yep5z6ez",variantClassNames:{labelPosition:{top:"_1yep5z6oy _1yep5z6oz _1yep5z6p0",start:"_1dbkl52"}},defaultVariants:{},compoundVariants:[]}),cl="_1dbkl5l _1yep5z6je _1yep5z6jf _1yep5z6jg _1yep5z69f _1yep5z69g _1yep5z69h",dl="_1dbkl5f z9nup86",ml="_1dbkl5m _1yep5z6b0 _1yep5z6b1 _1yep5z6b2 _1yep5z6bo _1yep5z6bp _1yep5z6bq _1yep5z6cc _1yep5z6cd _1yep5z6ce _1yep5z6d0 _1yep5z6d1 _1yep5z6d2 _1yep5z6it _1yep5z6iu _1yep5z6iv",lr="_1dbkl5k _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62i _1yep5z62j _1yep5z62k _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6m6",yl="_1yep5z63r _1yep5z63s _1yep5z63t _1yep5z619 _1yep5z61a _1yep5z61b _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6kz _1yep5z6l0 _1yep5z6l1 _1yep5z6dy _1yep5z6ez _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6jz _1yep5z6k0 _1yep5z6k1",bl=a({defaultClassName:"_1dbkl5h _1dbkl5g _1yep5z63 _1yep5z64 _1yep5z65 _1yep5z62f _1yep5z62g _1yep5z62h _1yep5z6g9",variantClassNames:{includesCustomColorPicker:{true:"_1yep5z6nm _1yep5z6nn _1yep5z6no"}},defaultVariants:{},compoundVariants:[]}),_l="_1dbkl5v _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj",fl=a({defaultClassName:"_1dbkl5q _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62i _1yep5z62j _1yep5z62k _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6br _1yep5z6bs _1yep5z6bt _1yep5z6d3 _1yep5z6d4 _1yep5z6d5 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6mf _1yep5z6hg _1yep5z6m6 _1yep5z6ey _1yep5z6dy",variantClassNames:{isFocused:{true:"_1dbkl5r _1yep5z613w"},isHovered:{true:"_1dbkl5s"},allowAlpha:{false:"_1yep5z6xp _1yep5z6xq _1yep5z6xr _1yep5z6z1 _1yep5z6z2 _1yep5z6z3 _1yep5z618m"}},defaultVariants:{},compoundVariants:[[{isHovered:true,isFocused:false},"_1yep5z61qj"]]}),zl=a({defaultClassName:"_1dbkl5a _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62c _1yep5z62d _1yep5z62e _1yep5z63i _1yep5z63j _1yep5z63k _1yep5z616 _1yep5z617 _1yep5z618 _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z69c _1yep5z69d _1yep5z69e _1yep5z6f9 _1yep5z6m5 _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6lq _1yep5z6lt",variantClassNames:{isHovered:{true:"_1yep5z612u"},isFocusVisible:{true:"_1yep5z618s _1yep5z618q _1yep5z618t _1yep5z614w"},isDisabled:{true:"_1yep5z611u"}},defaultVariants:{},compoundVariants:[]}),hl="_1dbkl5g",Cl="_1dbkl5u",vl="_1dbkl5j _1yep5z69 _1yep5z6a _1yep5z6b _1yep5z62l _1yep5z62m _1yep5z62n _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z69f _1yep5z69g _1yep5z69h",Sl="_1dbkl5x",gl="_1dbkl5w",xl="_1yep5z69 _1yep5z6a _1yep5z6b _1yep5z62l _1yep5z62m _1yep5z62n _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z69l _1yep5z69m _1yep5z69n",kl=a({defaultClassName:"_1dbkl5n _1yep5z6b0 _1yep5z6b1 _1yep5z6b2 _1yep5z6bo _1yep5z6bp _1yep5z6bq _1yep5z6cc _1yep5z6cd _1yep5z6ce _1yep5z6d0 _1yep5z6d1 _1yep5z6d2 _1yep5z6ma _1yep5z6iw _1yep5z6ix _1yep5z6iy _1yep5z6mf _1yep5z6mi",variantClassNames:{isFocusVisible:{true:"_1dbkl5o _1yep5z618q _1yep5z614w _1yep5z618s"}},defaultVariants:{},compoundVariants:[]}),Pl="z9nup83 z9nup85 _1yep5z6b0 _1yep5z6b1 _1yep5z6b2 _1yep5z6bo _1yep5z6bp _1yep5z6bq _1yep5z6cc _1yep5z6cd _1yep5z6ce _1yep5z6d0 _1yep5z6d1 _1yep5z6d2 _1yep5z6lw _1yep5z6lx _1yep5z6lz _1yep5z6ly _1yep5z6iw _1yep5z6ix _1yep5z6iy";var jl=[{id:"hex",label:"HEX"},{id:"rgb",label:"RGB"}],Nl=a$1("#000000").toFormat("hsla"),fe="hsla",ze="hexa";function jr(e){if(typeof document>"u")return "#000000";let r=document.createElement("canvas").getContext("2d");return a$k(r,"Failed to get canvas context"),r.fillStyle=e,r.fillStyle}function Ml(e$1){if(typeof e$1=="string")try{return e(e$1).toFormat(fe)}catch{return a$1(jr(e$1)).toFormat(fe)}else if(e$1)return e$1.toFormat(fe);return null}function Fl(e,r){return e?.getChannelValue("alpha")?r?.toString(ze)===e.toString(ze):!r?.getChannelValue("alpha")}function Tl(e,r,l){return r?.label?r.label:e?.getChannelValue("alpha")===0?l:e?.toString("rgba")}var he="NONE";function Ol(e$1,r){let l=r?.map(a=>({id:e(a.color).toString(ze),label:a.label}))||[],t={id:he,label:e$1};return [...l,t]}var Rl=(e,{optionProps:r,isFocusVisible:l,isSelected:t},a)=>(a$k(e.value&&"label"in e.value,"Item must have label"),jsx("li",{...r,ref:a,className:lr,children:jsx(Ce,{color:e.value.id,isFocusVisible:l,isSelected:t,"aria-label":e.value.label,isInteractive:true})})),ar=(e,r=4)=>{let l=e.getChannelValue("alpha")===0,t=`repeating-conic-gradient(transparent 0% 25%, ${themeVars.color.background.secondary.medium} 25% 50%)`;return {backgroundImage:l?t:`linear-gradient(${e.toString("hexa")}, ${e.toString("hexa")}), ${t}`,backgroundSize:`${r}px ${r}px`}};var nr=a({defaultClassName:"_1344e9q0 _1yep5z6b0 _1yep5z6b1 _1yep5z6b2 _1yep5z6bo _1yep5z6bp _1yep5z6bq _1yep5z6cc _1yep5z6cd _1yep5z6ce _1yep5z6d0 _1yep5z6d1 _1yep5z6d2 _1yep5z6it _1yep5z6iu _1yep5z6iv _1yep5z6m0 _1yep5z6is _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv z9nup8a",variantClassNames:{isFocusVisible:{true:"_1344e9q1"},isDisabled:{true:"_1344e9q2"},removeBlendMode:{true:"_1344e9q3"},isSelected:{true:"_1yep5z618s _1yep5z618q _1yep5z614w _1yep5z618v"},isHovered:{true:"_1344e9q5"}},defaultVariants:{},compoundVariants:[[{isSelected:false,isFocusVisible:true},"_1344e9q6"],[{isSelected:true,isFocusVisible:true},"_1344e9q7 _1yep5z61vb _1yep5z61v9 _1yep5z61rf _1yep5z61ve"],[{isSelected:true,isDisabled:true},"_1yep5z61vb _1yep5z61v9 _1yep5z61rf _1yep5z61ve _1yep5z61rp"],[{isHovered:true,isSelected:false},"_1yep5z61ve _1yep5z61vb _1yep5z61v9 _1yep5z61rj"]]}),ir="_1yep5z6fa",pr="_1344e9q9 _1yep5z6fp";var Ce=Mr.forwardRef(({color:e$1,isFocusVisible:r,isSelected:l,isInteractive:t,isDisabled:a,style:u,className:y,id:C,tooltip:g$1,isIndeterminate:f,indeterminateIcon:d$1=HelpIcon,noneLabel:z,"data-block-id":i,"data-block-class":s,...c},n)=>{let v=e$1&&e$1!==he&&(typeof e$1=="string"?e(e$1):e$1),{formatMessage:b$1}=b(),S=!v,{colorSwatchProps:h}=ie({color:S?"#000000":v}),{hoverProps:I,isHovered:x}=a$2({isDisabled:a||!t}),_=a$3({"data-focus-visible":r,"data-selected":l,"data-hovered":x,"data-block-id":i,"data-block-class":s,"data-disabled":a,"data-interactive":t,"data-indeterminate":f}),m=S?z??b$1(ur.none):h["aria-label"],A=c["aria-label"]??m,{tooltipProps:j}=a$4({tooltip:g$1,label:A}),N=jsx("div",{...g(I,_,S?{}:h),style:u,"aria-label":S?z??b$1(ur.none):h["aria-label"],role:"img",className:a$6(nr({removeBlendMode:S,isFocusVisible:r,isDisabled:!!a,isSelected:!!l,isHovered:x}),"BaselineUI-ColorSwatch",y),ref:n,id:C,...c,children:jsxs(a$5,{display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"full",height:"full",width:"full",opacity:a?"medium":void 0,style:v&&!f?ar(v,4):void 0,children:[S&&!f?jsx("div",{className:pr}):null,f&&d$1?jsx(d$1,{role:"presentation",size:16,className:ir,"aria-hidden":"true"}):null]})});return j&&!a?jsx(a$7,{...j,children:jsx(d,{children:N})}):N});Ce.displayName="ColorSwatch";var ur=c({none:{id:"bui.colorSwatch.none",defaultMessage:"None"}});export{fe as A,ze as B,Ml as C,Fl as D,Tl as E,he as F,Ol as G,Rl as H,Ce as I,er as a,or as b,rr as c,nl as d,il as e,pl as f,ul as g,sl as h,cl as i,dl as j,ml as k,yl as l,bl as m,_l as n,fl as o,zl as p,hl as q,Cl as r,vl as s,Sl as t,gl as u,xl as v,kl as w,Pl as x,jl as y,Nl as z};
File without changes