@baseline-ui/core 3.2.0 → 3.2.1

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 (195) hide show
  1. package/dist/Accordion.mjs +1 -1
  2. package/dist/ActionButton.css +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/Actionable.mjs +1 -1
  7. package/dist/AlertDialog.css +1 -1
  8. package/dist/AlertDialog.mjs +1 -1
  9. package/dist/AudioPlayer.css +1 -1
  10. package/dist/AudioPlayer.mjs +1 -1
  11. package/dist/ButtonSelect.css +1 -1
  12. package/dist/ButtonSelect.mjs +1 -1
  13. package/dist/Calendar.css +1 -1
  14. package/dist/Calendar.mjs +1 -1
  15. package/dist/Checkbox.mjs +1 -1
  16. package/dist/Code.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/Disclosure.mjs +1 -1
  27. package/dist/Drawer.mjs +1 -1
  28. package/dist/Editor.css +1 -1
  29. package/dist/Editor.mjs +1 -1
  30. package/dist/FileInput.css +1 -1
  31. package/dist/FileInput.mjs +1 -1
  32. package/dist/FileList.mjs +1 -1
  33. package/dist/FileUploader.css +1 -1
  34. package/dist/FileUploader.mjs +1 -1
  35. package/dist/FreehandCanvas.css +1 -1
  36. package/dist/FreehandCanvas.mjs +1 -1
  37. package/dist/GridList.mjs +1 -1
  38. package/dist/ImageDropZone.css +1 -1
  39. package/dist/ImageDropZone.mjs +1 -1
  40. package/dist/ImageGallery.css +1 -1
  41. package/dist/ImageGallery.mjs +1 -1
  42. package/dist/InlineAlert.css +1 -1
  43. package/dist/InlineAlert.mjs +1 -1
  44. package/dist/InlineToolbar.mjs +1 -1
  45. package/dist/Kbd.mjs +1 -1
  46. package/dist/ListBox.mjs +1 -1
  47. package/dist/Markdown.mjs +1 -1
  48. package/dist/Menu.css +1 -1
  49. package/dist/Menu.mjs +1 -1
  50. package/dist/Modal.mjs +1 -1
  51. package/dist/NumberInput.mjs +1 -1
  52. package/dist/Pagination.mjs +1 -1
  53. package/dist/PointPicker.mjs +1 -1
  54. package/dist/Popover.mjs +1 -1
  55. package/dist/Preview.mjs +1 -1
  56. package/dist/ProgressBar.mjs +1 -1
  57. package/dist/RadioGroup.mjs +1 -1
  58. package/dist/Reaction.mjs +1 -1
  59. package/dist/ScrollControlButton.mjs +1 -1
  60. package/dist/SearchInput.mjs +1 -1
  61. package/dist/Select.css +1 -1
  62. package/dist/Select.mjs +1 -1
  63. package/dist/Slider.css +1 -1
  64. package/dist/Slider.mjs +1 -1
  65. package/dist/StatusCard.mjs +1 -1
  66. package/dist/Stepper.mjs +1 -1
  67. package/dist/Table.mjs +1 -1
  68. package/dist/Tabs.mjs +1 -1
  69. package/dist/Tag.mjs +1 -1
  70. package/dist/TagGroup.mjs +1 -1
  71. package/dist/TaggedPagination.mjs +1 -1
  72. package/dist/Text.mjs +1 -1
  73. package/dist/TextInput.mjs +1 -1
  74. package/dist/TimeField.mjs +1 -1
  75. package/dist/Toast.css +1 -1
  76. package/dist/Toast.mjs +1 -1
  77. package/dist/ToggleButton.css +1 -1
  78. package/dist/ToggleButton.mjs +1 -1
  79. package/dist/ToggleIconButton.mjs +1 -1
  80. package/dist/Toolbar.css +1 -1
  81. package/dist/Toolbar.mjs +1 -1
  82. package/dist/Tooltip.mjs +1 -1
  83. package/dist/TreeView.mjs +1 -1
  84. package/dist/UNSAFE_ListBox.mjs +1 -1
  85. package/dist/{chunk-4NYPVKDO.mjs → chunk-2HMLSXNO.mjs} +1 -1
  86. package/dist/chunk-2NO2ITVE.mjs +10 -0
  87. package/dist/chunk-3BL5D3CA.mjs +10 -0
  88. package/dist/chunk-3JL2TJZL.mjs +10 -0
  89. package/dist/chunk-3L7GTQXK.mjs +10 -0
  90. package/dist/{chunk-42B24XCP.mjs → chunk-47I3USMC.mjs} +1 -1
  91. package/dist/chunk-4DTPDMSQ.mjs +10 -0
  92. package/dist/{chunk-WDJ4GXWF.mjs → chunk-4I4TIV2G.mjs} +1 -1
  93. package/dist/chunk-4MRHG5IU.mjs +10 -0
  94. package/dist/{chunk-JBMVWRHN.mjs → chunk-4SBMUWOY.mjs} +2 -2
  95. package/dist/{chunk-HFVJXZBG.mjs → chunk-4TAUFBXO.mjs} +2 -2
  96. package/dist/{chunk-LQMY6TXS.mjs → chunk-55YEATL7.mjs} +1 -1
  97. package/dist/{chunk-75722G3R.mjs → chunk-5TDFLLMX.mjs} +2 -2
  98. package/dist/{chunk-KG5PDPBK.mjs → chunk-6DGD7BZA.mjs} +1 -1
  99. package/dist/{chunk-ECPG4S5O.mjs → chunk-6DU65N7Q.mjs} +1 -1
  100. package/dist/{chunk-LLVFPC5Q.mjs → chunk-6Y6BYHT4.mjs} +1 -1
  101. package/dist/chunk-7OCDKTTZ.mjs +10 -0
  102. package/dist/{chunk-X3NOIEDZ.mjs → chunk-7VHON5HL.mjs} +1 -1
  103. package/dist/{chunk-EV24JU64.mjs → chunk-AL3FICFA.mjs} +2 -2
  104. package/dist/{chunk-GZ5ZWXIC.mjs → chunk-BZTAFNPW.mjs} +1 -1
  105. package/dist/{chunk-P5GO3XIS.mjs → chunk-C3W4WN2O.mjs} +1 -1
  106. package/dist/chunk-DAN5WASP.mjs +10 -0
  107. package/dist/{chunk-Y45SV547.mjs → chunk-DSSMBDVA.mjs} +1 -1
  108. package/dist/chunk-EADUR7IC.mjs +10 -0
  109. package/dist/chunk-F2O4AP7P.mjs +10 -0
  110. package/dist/chunk-G3K2DXNP.mjs +10 -0
  111. package/dist/{chunk-L452ID76.mjs → chunk-GLT45FXJ.mjs} +1 -1
  112. package/dist/{chunk-7HZ5JFYX.mjs → chunk-GS4C6CYA.mjs} +2 -2
  113. package/dist/{chunk-WOVAT6U4.mjs → chunk-H2E7GKGB.mjs} +1 -1
  114. package/dist/{chunk-7GJMJTRL.mjs → chunk-H4ZIN7W3.mjs} +1 -1
  115. package/dist/{chunk-XVBOKL6D.mjs → chunk-HDVWQ6RL.mjs} +1 -1
  116. package/dist/{chunk-NCADIC3I.mjs → chunk-IE3E4KQ6.mjs} +1 -1
  117. package/dist/{chunk-5ODZPQL2.mjs → chunk-J7RVOP5G.mjs} +1 -1
  118. package/dist/{chunk-77BAFSDX.mjs → chunk-JF4BWG7T.mjs} +2 -2
  119. package/dist/chunk-K6MB234H.mjs +10 -0
  120. package/dist/{chunk-DRIHXAP3.mjs → chunk-KAVZW4RV.mjs} +2 -2
  121. package/dist/{chunk-TDOAVBKD.mjs → chunk-KLNQ24LT.mjs} +2 -2
  122. package/dist/{chunk-RJWPSJX2.mjs → chunk-LRZ6BQFQ.mjs} +1 -1
  123. package/dist/{chunk-WXWGGDTG.mjs → chunk-LTIDSWDM.mjs} +2 -2
  124. package/dist/{chunk-VXB5SVQC.mjs → chunk-MAJ74VNE.mjs} +1 -1
  125. package/dist/{chunk-5PIO6M4F.mjs → chunk-MFNWPTNI.mjs} +2 -2
  126. package/dist/{chunk-DF3BVX5Z.mjs → chunk-MNAD5FJH.mjs} +1 -1
  127. package/dist/chunk-N53SGN23.mjs +10 -0
  128. package/dist/{chunk-5ULL6IBX.mjs → chunk-NVS22MIQ.mjs} +1 -1
  129. package/dist/{chunk-4FTKS25Q.mjs → chunk-ODDEW5IV.mjs} +2 -2
  130. package/dist/{chunk-N4UAXVES.mjs → chunk-OFWPRDTC.mjs} +2 -2
  131. package/dist/{chunk-YT36W3OS.mjs → chunk-OHZK2ZDA.mjs} +2 -2
  132. package/dist/{chunk-26T2EPFD.mjs → chunk-PDWICYVZ.mjs} +2 -2
  133. package/dist/{chunk-3CWP2VCB.mjs → chunk-PFKPY3N7.mjs} +1 -1
  134. package/dist/{chunk-5DOFIGHJ.mjs → chunk-Q4BSQC65.mjs} +2 -2
  135. package/dist/{chunk-RF4E6MLM.mjs → chunk-QKKV24WQ.mjs} +1 -1
  136. package/dist/chunk-QQGK5M66.mjs +10 -0
  137. package/dist/chunk-RBZ7SIZR.mjs +10 -0
  138. package/dist/{chunk-HLDCVJXD.mjs → chunk-RILRXWGE.mjs} +1 -1
  139. package/dist/{chunk-J7EAQSKX.mjs → chunk-RM2Y4D2M.mjs} +1 -1
  140. package/dist/{chunk-T3AMYEKR.mjs → chunk-RRB5F4E4.mjs} +2 -2
  141. package/dist/{chunk-PJM4COF5.mjs → chunk-RWHDD6Z7.mjs} +2 -2
  142. package/dist/{chunk-2JANDORZ.mjs → chunk-RZEGMPV2.mjs} +1 -1
  143. package/dist/chunk-SNQDFFKP.mjs +10 -0
  144. package/dist/chunk-T2XIDX6U.mjs +10 -0
  145. package/dist/{chunk-BW4VAHXR.mjs → chunk-TBDKTTIY.mjs} +2 -2
  146. package/dist/chunk-TDPODC62.mjs +10 -0
  147. package/dist/{chunk-WSCZ34XO.mjs → chunk-TNU3YDGL.mjs} +2 -2
  148. package/dist/chunk-TPNZG6FA.mjs +10 -0
  149. package/dist/{chunk-JB3O4ABN.mjs → chunk-TVENHRYC.mjs} +1 -1
  150. package/dist/chunk-UCQJ6FJO.mjs +10 -0
  151. package/dist/{chunk-F6JQN7YM.mjs → chunk-ULCYKB34.mjs} +1 -1
  152. package/dist/{chunk-DXP33KAB.mjs → chunk-UOMNE4F4.mjs} +2 -2
  153. package/dist/{chunk-NPJX2CEI.mjs → chunk-VDSLDZLT.mjs} +1 -1
  154. package/dist/{chunk-XJGQXVMR.mjs → chunk-VJ3SWDRJ.mjs} +2 -2
  155. package/dist/chunk-W3ZGXUFP.mjs +10 -0
  156. package/dist/{chunk-VHDXSFQC.mjs → chunk-WA35CT3D.mjs} +1 -1
  157. package/dist/chunk-WICBTAMY.mjs +10 -0
  158. package/dist/chunk-WN6FAICZ.mjs +10 -0
  159. package/dist/{chunk-PBFIKNYZ.mjs → chunk-WRQ4FPJE.mjs} +1 -1
  160. package/dist/{chunk-CSPZMYVG.mjs → chunk-XCL4K4MY.mjs} +1 -1
  161. package/dist/{chunk-IDEAEEBP.mjs → chunk-XIXHGXIN.mjs} +2 -2
  162. package/dist/{chunk-U2ODAIZG.mjs → chunk-XZSDCUID.mjs} +1 -1
  163. package/dist/{chunk-5YYWD7PK.mjs → chunk-ZAMDRHQY.mjs} +1 -1
  164. package/dist/{chunk-K3S22PMF.mjs → chunk-ZFLLIBX5.mjs} +2 -2
  165. package/dist/{chunk-LLAMYDGW.mjs → chunk-ZP4YB5RP.mjs} +2 -2
  166. package/dist/index.css +1 -1
  167. package/dist/index.d.ts +2 -2
  168. package/dist/index.js +13 -13
  169. package/dist/index.mjs +1 -1
  170. package/package.json +4 -4
  171. package/sbom.json +6 -6
  172. package/dist/chunk-2WAKHFPS.mjs +0 -10
  173. package/dist/chunk-3NQY5GPQ.mjs +0 -10
  174. package/dist/chunk-44OUOGJ4.mjs +0 -10
  175. package/dist/chunk-4N6CLPAY.mjs +0 -10
  176. package/dist/chunk-AMQX3KZR.mjs +0 -10
  177. package/dist/chunk-BKDQLDOK.mjs +0 -10
  178. package/dist/chunk-BXSJTXXY.mjs +0 -10
  179. package/dist/chunk-CIIO5D3X.mjs +0 -10
  180. package/dist/chunk-E6VOSF6Z.mjs +0 -10
  181. package/dist/chunk-ELXWR5TS.mjs +0 -10
  182. package/dist/chunk-FJ2JRD3H.mjs +0 -10
  183. package/dist/chunk-HWUESZY2.mjs +0 -10
  184. package/dist/chunk-I4WMXV4T.mjs +0 -10
  185. package/dist/chunk-IW4GXU75.mjs +0 -10
  186. package/dist/chunk-J3MJZQUJ.mjs +0 -10
  187. package/dist/chunk-J6TYT6BF.mjs +0 -10
  188. package/dist/chunk-K4N7GVEI.mjs +0 -10
  189. package/dist/chunk-NHD7I3X2.mjs +0 -10
  190. package/dist/chunk-QY3O34WX.mjs +0 -10
  191. package/dist/chunk-ROHLZINC.mjs +0 -10
  192. package/dist/chunk-UVVONIZB.mjs +0 -10
  193. package/dist/chunk-WC2NUASA.mjs +0 -10
  194. package/dist/chunk-ZREX7XOO.mjs +0 -10
  195. /package/dist/{chunk-EZXMEGV7.mjs → chunk-G6VX4SU6.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import {b as b$1,a as a$8}from'./chunk-77BAFSDX.mjs';import {a,b as b$4,c}from'./chunk-L452ID76.mjs';import {a as a$c}from'./chunk-3NQY5GPQ.mjs';import {n,p}from'./chunk-75722G3R.mjs';import {a as a$7}from'./chunk-HWUESZY2.mjs';import {b,c as c$1}from'./chunk-GX2IOGYR.mjs';import {b as b$2}from'./chunk-J3MJZQUJ.mjs';import {a as a$b}from'./chunk-O7XK2WIX.mjs';import {a as a$6}from'./chunk-JB3O4ABN.mjs';import {a as a$5}from'./chunk-F6JQN7YM.mjs';import {b as b$3}from'./chunk-WWSGOGLA.mjs';import {a as a$3}from'./chunk-66CUIXA6.mjs';import {a as a$1}from'./chunk-X3AXUU3H.mjs';import {a as a$9}from'./chunk-RSKKEGJZ.mjs';import {a as a$2}from'./chunk-3FYY26ED.mjs';import {a as a$a}from'./chunk-RT4LMB6X.mjs';import {a as a$4}from'./chunk-4QEH5CGK.mjs';import {CaretDownIcon}from'@baseline-ui/icons/8';import pe,{useMemo,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
1
+ import {b as b$1,a as a$8}from'./chunk-JF4BWG7T.mjs';import {a,b as b$4,c}from'./chunk-GLT45FXJ.mjs';import {a as a$c}from'./chunk-UCQJ6FJO.mjs';import {n,p}from'./chunk-5TDFLLMX.mjs';import {a as a$7}from'./chunk-3L7GTQXK.mjs';import {b,c as c$1}from'./chunk-GX2IOGYR.mjs';import {b as b$2}from'./chunk-WN6FAICZ.mjs';import {a as a$b}from'./chunk-O7XK2WIX.mjs';import {a as a$6}from'./chunk-TVENHRYC.mjs';import {a as a$5}from'./chunk-ULCYKB34.mjs';import {b as b$3}from'./chunk-WWSGOGLA.mjs';import {a as a$3}from'./chunk-66CUIXA6.mjs';import {a as a$1}from'./chunk-X3AXUU3H.mjs';import {a as a$9}from'./chunk-RSKKEGJZ.mjs';import {a as a$2}from'./chunk-3FYY26ED.mjs';import {a as a$a}from'./chunk-RT4LMB6X.mjs';import {a as a$4}from'./chunk-4QEH5CGK.mjs';import {CaretDownIcon}from'@baseline-ui/icons/8';import pe,{useMemo,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
2
2
  * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
3
  *
4
4
  * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
@@ -7,4 +7,4 @@ import {b as b$1,a as a$8}from'./chunk-77BAFSDX.mjs';import {a,b as b$4,c}from'.
7
7
  * This notice may not be removed from this file.
8
8
  *
9
9
  */
10
- var ie="_1sexph00",se="_1sexph02",le="_1sexph01 _1yep5z6189 _1yep5z618a _1yep5z618b _1yep5z61al _1yep5z61am _1yep5z61an _1yep5z61br _1yep5z61bs _1yep5z61bt _1yep5z619f _1yep5z619g _1yep5z619h _1yep5z61sg _1yep5z61sh _1yep5z61si";function ce(m,n){return typeof m=="function"?m(n):m}var ue=pe.forwardRef(({className:m,style:n,items:d,"data-block-id":p,"data-block-class":S,hideLabel:i,size:v="md",isDisabled:a$c,excludeFromTabOrder:y,onButtonPress:x,onButtonAction:_,isSelected:K,defaultSelected:e,onButtonSelectionChange:t,collection:fe,moreAriaLabel:H,optionStyle:P,optionClassName:L,triggerClassName:A,triggerStyle:V,tooltipProps:I,buttonBehaviour:T="toggle",...s},be)=>{let{formatMessage:O}=b(),o=a({...s,collection:fe,defaultValue:s.defaultSelectedKey||d?.[0]?.id,children:void 0,selectionMode:"single",validationState:s.validationState==="error"?"invalid":"valid"}),u=useMemo(()=>typeof T=="function"?T(o.value):T,[T,o.value]),[l,D]=a$1(K,!!e,c=>{t?.({isSelected:c,selectedKey:o.value});}),{hoverProps:ve,isHovered:ye}=a$2({isDisabled:a$c}),ge=useMemo(()=>{let c=o.collection.getItem(o.value);if(!c)return null;let f=c?.textValue||c?.["aria-label"],b=c.value;a$3(b,"ButtonSelect: selectedItem.value is not populated. Ensure ListOption passes value={item} to AriaOption.");let g=b?.icon,k=u==="toggle",Se=a$c||o.disabledKeys.has(o.value),z={size:v,...k&&{isSelected:l},onPress:_e=>{k&&D(!l),x?.(_e),_?.({isSelected:k?!l:false,selectedKey:o.value,buttonBehaviour:u});},isDisabled:Se,excludeFromTabOrder:y,className:a$4(typeof L=="function"?L(b,{isButton:true,isSelected:l}):L,"BaselineUI-ButtonSelect-Button"),style:typeof P=="function"?P(b,{isButton:true,isSelected:l}):P};return i&&g?jsx(a$5,{variant:"inverse",size:"sm",includeArrow:false,text:f,placement:"bottom start",offset:4,...ce(I,"button"),children:u==="action"?jsx(a$6,{icon:g,"aria-label":f,variant:"toolbar",...z}):jsx(a$7,{icon:g,"aria-label":f,variant:"toolbar",...z})}):u==="toggle"?jsx(b$1,{iconStart:g,label:f,variant:"toolbar",...z}):jsx(b$2,{label:f,variant:"toolbar",...z})},[o.collection,o.value,o.disabledKeys,u,a$c,v,l,y,L,P,i,x,_,D,I]),R=s["aria-label"],xe=useCallback(({buttonProps:c,ref:f})=>{delete c["aria-labelledby"];let b=H||(R?O(de.moreWithLabel,{label:R}):O(de.more));return jsx(a$5,{variant:"inverse",size:"sm",includeArrow:false,text:b,placement:"bottom start",offset:4,...ce(I,"select"),children:jsx(b$3,{...c,children:jsx(a$6,{"aria-label":b,ref:f,icon:CaretDownIcon,variant:"toolbar",size:v,className:({isFocusVisible:g})=>a$4(a$8({isSelected:l&&u==="toggle",isFocusVisible:g}),le,A,"BaselineUI-ButtonSelect-Trigger"),style:V,isDisabled:a$c,excludeFromTabOrder:y})})})},[R,u,y,O,l,a$c,H,v,I,A,V]),Be=a$9({"data-block-id":p,"data-block-class":S,"data-hovered":ye,"data-selected":l,"data-disabled":a$c,"data-expanded":o.isOpen,"data-button-behaviour":u}),C=a$a(be),he=useMemo(()=>({state:o,popoverAnchorRef:C}),[o,C]);return jsx(b$4.Provider,{value:he,children:jsxs(a$b,{...ve,role:"group",display:"inline-flex",flexDirection:"row",alignItems:"center",className:a$4(ie,"BaselineUI-ButtonSelect",m),"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"],"aria-describedby":s["aria-describedby"],"aria-details":s["aria-details"],style:n,ref:C,...Be,children:[ge,jsx(c,{isDisabled:a$c,placement:"bottom start",items:d,...s,variant:"ghost",renderTrigger:xe,className:a$4(se,"BaselineUI-ButtonSelect-Select")})]})})});ue.displayName="ButtonSelectCore";var me=pe.forwardRef(({onPress:m,optionStyle:n$1,optionClassName:d,onSelectionChange:p$1,onOptionPress:S,...i},v)=>{let a=useCallback((e,t)=>{S?.(e,t),i.selectedKey===t&&p$1?.(t);},[S,p$1,i.selectedKey]),y=useCallback(e=>{e&&p$1?.(e);},[p$1]),x=useCallback((e,t)=>{(e.key==="Enter"||e.key===" ")&&i.selectedKey===t&&p$1?.(t);},[p$1,i.selectedKey]),_=useMemo(()=>({onPress:a,onKeyDown:x}),[a,x]),K=useMemo(()=>({renderOption:(e,t)=>jsx(n,{...t,item:e}),optionStyle:(e,t)=>typeof n$1=="function"?n$1(e,{isButton:false,isSelected:t.isSelected}):n$1,optionClassName:(e,t)=>typeof d=="function"?d(e,{isButton:false,isSelected:t.isSelected}):d}),[n$1,d]);return jsx(p.Provider,{value:_,children:jsx(a$c,{items:i.items,listBoxProps:K,children:e=>jsx(ue,{collection:e,onButtonPress:m,onSelectionChange:y,optionStyle:n$1,optionClassName:d,...i,ref:v})})})});me.displayName="ButtonSelect";var de=c$1({more:{id:"bui.buttonSelect.more",defaultMessage:"More"},moreWithLabel:{id:"bui.buttonSelect.moreWithLabel",defaultMessage:"More {label}"}});export{me as a};
10
+ var ie="_1sexph00",se="_1sexph02",le="_1sexph01 _1yep5z6195 _1yep5z6196 _1yep5z6197 _1yep5z61bh _1yep5z61bi _1yep5z61bj _1yep5z61cn _1yep5z61co _1yep5z61cp _1yep5z61ab _1yep5z61ac _1yep5z61ad _1yep5z61ts _1yep5z61tt _1yep5z61tu";function ce(m,n){return typeof m=="function"?m(n):m}var ue=pe.forwardRef(({className:m,style:n,items:d,"data-block-id":p,"data-block-class":S,hideLabel:i,size:v="md",isDisabled:a$c,excludeFromTabOrder:y,onButtonPress:x,onButtonAction:_,isSelected:K,defaultSelected:e,onButtonSelectionChange:t,collection:fe,moreAriaLabel:H,optionStyle:P,optionClassName:L,triggerClassName:A,triggerStyle:V,tooltipProps:I,buttonBehaviour:T="toggle",...s},be)=>{let{formatMessage:O}=b(),o=a({...s,collection:fe,defaultValue:s.defaultSelectedKey||d?.[0]?.id,children:void 0,selectionMode:"single",validationState:s.validationState==="error"?"invalid":"valid"}),u=useMemo(()=>typeof T=="function"?T(o.value):T,[T,o.value]),[l,D]=a$1(K,!!e,c=>{t?.({isSelected:c,selectedKey:o.value});}),{hoverProps:ve,isHovered:ye}=a$2({isDisabled:a$c}),ge=useMemo(()=>{let c=o.collection.getItem(o.value);if(!c)return null;let f=c?.textValue||c?.["aria-label"],b=c.value;a$3(b,"ButtonSelect: selectedItem.value is not populated. Ensure ListOption passes value={item} to AriaOption.");let g=b?.icon,k=u==="toggle",Se=a$c||o.disabledKeys.has(o.value),z={size:v,...k&&{isSelected:l},onPress:_e=>{k&&D(!l),x?.(_e),_?.({isSelected:k?!l:false,selectedKey:o.value,buttonBehaviour:u});},isDisabled:Se,excludeFromTabOrder:y,className:a$4(typeof L=="function"?L(b,{isButton:true,isSelected:l}):L,"BaselineUI-ButtonSelect-Button"),style:typeof P=="function"?P(b,{isButton:true,isSelected:l}):P};return i&&g?jsx(a$5,{variant:"inverse",size:"sm",includeArrow:false,text:f,placement:"bottom start",offset:4,...ce(I,"button"),children:u==="action"?jsx(a$6,{icon:g,"aria-label":f,variant:"toolbar",...z}):jsx(a$7,{icon:g,"aria-label":f,variant:"toolbar",...z})}):u==="toggle"?jsx(b$1,{iconStart:g,label:f,variant:"toolbar",...z}):jsx(b$2,{label:f,variant:"toolbar",...z})},[o.collection,o.value,o.disabledKeys,u,a$c,v,l,y,L,P,i,x,_,D,I]),R=s["aria-label"],xe=useCallback(({buttonProps:c,ref:f})=>{delete c["aria-labelledby"];let b=H||(R?O(de.moreWithLabel,{label:R}):O(de.more));return jsx(a$5,{variant:"inverse",size:"sm",includeArrow:false,text:b,placement:"bottom start",offset:4,...ce(I,"select"),children:jsx(b$3,{...c,children:jsx(a$6,{"aria-label":b,ref:f,icon:CaretDownIcon,variant:"toolbar",size:v,className:({isFocusVisible:g})=>a$4(a$8({isSelected:l&&u==="toggle",isFocusVisible:g}),le,A,"BaselineUI-ButtonSelect-Trigger"),style:V,isDisabled:a$c,excludeFromTabOrder:y})})})},[R,u,y,O,l,a$c,H,v,I,A,V]),Be=a$9({"data-block-id":p,"data-block-class":S,"data-hovered":ye,"data-selected":l,"data-disabled":a$c,"data-expanded":o.isOpen,"data-button-behaviour":u}),C=a$a(be),he=useMemo(()=>({state:o,popoverAnchorRef:C}),[o,C]);return jsx(b$4.Provider,{value:he,children:jsxs(a$b,{...ve,role:"group",display:"inline-flex",flexDirection:"row",alignItems:"center",className:a$4(ie,"BaselineUI-ButtonSelect",m),"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"],"aria-describedby":s["aria-describedby"],"aria-details":s["aria-details"],style:n,ref:C,...Be,children:[ge,jsx(c,{isDisabled:a$c,placement:"bottom start",items:d,...s,variant:"ghost",renderTrigger:xe,className:a$4(se,"BaselineUI-ButtonSelect-Select")})]})})});ue.displayName="ButtonSelectCore";var me=pe.forwardRef(({onPress:m,optionStyle:n$1,optionClassName:d,onSelectionChange:p$1,onOptionPress:S,...i},v)=>{let a=useCallback((e,t)=>{S?.(e,t),i.selectedKey===t&&p$1?.(t);},[S,p$1,i.selectedKey]),y=useCallback(e=>{e&&p$1?.(e);},[p$1]),x=useCallback((e,t)=>{(e.key==="Enter"||e.key===" ")&&i.selectedKey===t&&p$1?.(t);},[p$1,i.selectedKey]),_=useMemo(()=>({onPress:a,onKeyDown:x}),[a,x]),K=useMemo(()=>({renderOption:(e,t)=>jsx(n,{...t,item:e}),optionStyle:(e,t)=>typeof n$1=="function"?n$1(e,{isButton:false,isSelected:t.isSelected}):n$1,optionClassName:(e,t)=>typeof d=="function"?d(e,{isButton:false,isSelected:t.isSelected}):d}),[n$1,d]);return jsx(p.Provider,{value:_,children:jsx(a$c,{items:i.items,listBoxProps:K,children:e=>jsx(ue,{collection:e,onButtonPress:m,onSelectionChange:y,optionStyle:n$1,optionClassName:d,...i,ref:v})})})});me.displayName="ButtonSelect";var de=c$1({more:{id:"bui.buttonSelect.more",defaultMessage:"More"},moreWithLabel:{id:"bui.buttonSelect.moreWithLabel",defaultMessage:"More {label}"}});export{me as a};
@@ -1,4 +1,4 @@
1
- import {a as a$5,b as b$2,e}from'./chunk-5ULL6IBX.mjs';import {a as a$1}from'./chunk-YS3Y5KGV.mjs';import {a as a$4}from'./chunk-RSKKEGJZ.mjs';import {a as a$2}from'./chunk-K6X2BHPP.mjs';import {f}from'./chunk-Y4DRSGEJ.mjs';import {a as a$3}from'./chunk-3FYY26ED.mjs';import {b as b$1,c}from'./chunk-TZ4MVY4E.mjs';import {a,b}from'./chunk-AUOQSTS5.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import {ArrowDownCircleFilledIcon}from'@baseline-ui/icons/16';import {AnimatePresence,motion}from'motion/react';import s,{useCallback,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
1
+ import {a as a$5,b as b$2,e}from'./chunk-NVS22MIQ.mjs';import {a as a$1}from'./chunk-YS3Y5KGV.mjs';import {a as a$4}from'./chunk-RSKKEGJZ.mjs';import {a as a$2}from'./chunk-K6X2BHPP.mjs';import {f}from'./chunk-Y4DRSGEJ.mjs';import {a as a$3}from'./chunk-3FYY26ED.mjs';import {b as b$1,c}from'./chunk-TZ4MVY4E.mjs';import {a,b}from'./chunk-AUOQSTS5.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import {ArrowDownCircleFilledIcon}from'@baseline-ui/icons/16';import {AnimatePresence,motion}from'motion/react';import s,{useCallback,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
2
2
  * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
3
  *
4
4
  * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
@@ -7,4 +7,4 @@ import {a as a$5,b as b$2,e}from'./chunk-5ULL6IBX.mjs';import {a as a$1}from'./c
7
7
  * This notice may not be removed from this file.
8
8
  *
9
9
  */
10
- var k="_8kqf970 _1yep5z6po _1yep5z6pp _1yep5z6pq _1yep5z6m6 _1yep5z6m7 _1yep5z6m8 _1yep5z6oi _1yep5z6oj _1yep5z6ok _1yep5z614v _1yep5z614w _1yep5z614x _1yep5z6154 _1yep5z6155 _1yep5z6156 _1yep5z615m _1yep5z615n _1yep5z615o _1yep5z6z9 _1yep5z6vi _1yep5z6vj _1yep5z6vk _1yep5z617s _1yep5z6101";var x=2,H=s.forwardRef(({className:L,style:A,hideForKeyboard:T,scrollRef:o,label:F,delay:i=1500,smoothScroll:I=true,"data-block-id":q,"data-block-class":R},N)=>{let e$1=s.useRef(null),D=f(),[M,c$1]=s.useState(false),r=useCallback(()=>{let t=o?.current||a(e$1.current).body;return b(t).getComputedStyle(t).flexDirection==="column-reverse"?t.scrollTop+x>=0:t.scrollTop+t.clientHeight+x>=t.scrollHeight},[o]),[O,p]=s.useState(r),{buttonProps:X,isPressed:Y}=a$1({onPress:()=>{let t=o?.current||a(e$1.current).body;t.scrollTo({top:t.scrollHeight,behavior:I?"smooth":"auto"});}},e$1),{focusProps:U,isFocused:V,isFocusVisible:m}=a$2(),{hoverProps:j,isHovered:u}=a$3({}),W=a$4({"data-block-id":q,"data-block-class":R,"data-pressed":Y,"data-focus-visible":m,"data-hovered":u,"data-focused":V});return useEffect(()=>{p(r());},[r]),useEffect(()=>{let t=o?.current||a(e$1.current).body,y="onscrollend"in b(t),l=()=>{setTimeout(()=>{c$1(false),p(r());},i);},d=()=>{c$1(true),y||l();};return t.addEventListener("scroll",d),t.addEventListener("scrollend",l),()=>{t.removeEventListener("scroll",d),t.removeEventListener("scrollend",l);}},[o,i,r]),jsx(AnimatePresence,{initial:false,children:(!T||D!=="keyboard")&&!M&&!O?jsxs(motion.button,{initial:{opacity:0,transform:"translateX(-50%) translateY(10px)"},animate:{opacity:1,transform:"translateX(-50%) translateY(0)"},exit:{opacity:0,transform:"translateX(-50%) translateY(10px)"},transition:{duration:.3},...c(X,U,j,W),className:a$6(k,b$2({isFocusVisible:m,variant:"high-contrast",isHovered:u}),e({variant:"high-contrast"}),"BaselineUI-ScrollControlButton",L),style:A,ref:b$1(N,e$1),children:[jsx(ArrowDownCircleFilledIcon,{size:16,className:a$5({variant:"high-contrast"})}),F]}):null})});H.displayName="ScrollControlButton";export{H as a};
10
+ var P="_8kqf970 _1yep5z6q4 _1yep5z6q5 _1yep5z6q6 _1yep5z6mm _1yep5z6mn _1yep5z6mo _1yep5z6oy _1yep5z6oz _1yep5z6p0 _1yep5z615r _1yep5z615s _1yep5z615t _1yep5z6160 _1yep5z6161 _1yep5z6162 _1yep5z616i _1yep5z616j _1yep5z616k _1yep5z6zp _1yep5z6vy _1yep5z6vz _1yep5z6w0 _1yep5z618o _1yep5z610h";var w=2,H=s.forwardRef(({className:L,style:q,hideForKeyboard:A,scrollRef:o,label:T,delay:i=1500,smoothScroll:F=true,"data-block-id":I,"data-block-class":R},N)=>{let e$1=s.useRef(null),D=f(),[M,c$1]=s.useState(false),r=useCallback(()=>{let t=o?.current||a(e$1.current).body;return b(t).getComputedStyle(t).flexDirection==="column-reverse"?t.scrollTop+w>=0:t.scrollTop+t.clientHeight+w>=t.scrollHeight},[o]),[O,p]=s.useState(r),{buttonProps:X,isPressed:Y}=a$1({onPress:()=>{let t=o?.current||a(e$1.current).body;t.scrollTo({top:t.scrollHeight,behavior:F?"smooth":"auto"});}},e$1),{focusProps:U,isFocused:V,isFocusVisible:m}=a$2(),{hoverProps:W,isHovered:u}=a$3({}),j=a$4({"data-block-id":I,"data-block-class":R,"data-pressed":Y,"data-focus-visible":m,"data-hovered":u,"data-focused":V});return useEffect(()=>{p(r());},[r]),useEffect(()=>{let t=o?.current||a(e$1.current).body,y="onscrollend"in b(t),l=()=>{setTimeout(()=>{c$1(false),p(r());},i);},d=()=>{c$1(true),y||l();};return t.addEventListener("scroll",d),t.addEventListener("scrollend",l),()=>{t.removeEventListener("scroll",d),t.removeEventListener("scrollend",l);}},[o,i,r]),jsx(AnimatePresence,{initial:false,children:(!A||D!=="keyboard")&&!M&&!O?jsxs(motion.button,{initial:{opacity:0,transform:"translateX(-50%) translateY(10px)"},animate:{opacity:1,transform:"translateX(-50%) translateY(0)"},exit:{opacity:0,transform:"translateX(-50%) translateY(10px)"},transition:{duration:.3},...c(X,U,W,j),className:a$6(P,b$2({isFocusVisible:m,variant:"high-contrast",isHovered:u}),e({variant:"high-contrast"}),"BaselineUI-ScrollControlButton",L),style:q,ref:b$1(N,e$1),children:[jsx(ArrowDownCircleFilledIcon,{size:16,className:a$5({variant:"high-contrast"})}),T]}):null})});H.displayName="ScrollControlButton";export{H as a};
@@ -1,4 +1,4 @@
1
- import {a as a$q}from'./chunk-JI4SJ53O.mjs';import {b as b$a}from'./chunk-GKODQS6E.mjs';import {a as a$8}from'./chunk-LLAMYDGW.mjs';import {b as b$3}from'./chunk-HI44JQA7.mjs';import {a as a$o}from'./chunk-3UH5CQQF.mjs';import {a as a$r}from'./chunk-IHLJTHGQ.mjs';import {b as b$6,a as a$m}from'./chunk-RF4E6MLM.mjs';import {a as a$c}from'./chunk-5IC46G5J.mjs';import {b as b$4}from'./chunk-Y45SV547.mjs';import {f}from'./chunk-3NQY5GPQ.mjs';import {a as a$j}from'./chunk-5BAHJXOI.mjs';import {b as b$8,c as c$2}from'./chunk-X3NOIEDZ.mjs';import {a as a$6}from'./chunk-EU75HMPG.mjs';import {a as a$k}from'./chunk-NGZRN4SF.mjs';import {a as a$p}from'./chunk-RJWPSJX2.mjs';import {a as a$g}from'./chunk-HWUESZY2.mjs';import {a as a$h}from'./chunk-ECPG4S5O.mjs';import {a as a$i}from'./chunk-5PIO6M4F.mjs';import {b as b$9,e}from'./chunk-DF3BVX5Z.mjs';import {b as b$7,f as f$1}from'./chunk-AKES5B6C.mjs';import {a as a$n}from'./chunk-2WAKHFPS.mjs';import {a as a$a}from'./chunk-NSC53QWT.mjs';import {a as a$d}from'./chunk-CGFLGZL4.mjs';import {c as c$1,b as b$1}from'./chunk-GX2IOGYR.mjs';import {b as b$b}from'./chunk-J3MJZQUJ.mjs';import {a as a$9}from'./chunk-O7XK2WIX.mjs';import {a as a$b}from'./chunk-JB3O4ABN.mjs';import {a as a$l}from'./chunk-TDXALNX3.mjs';import {b as b$5,j as j$1}from'./chunk-4NYPVKDO.mjs';import {a as a$1}from'./chunk-X3AXUU3H.mjs';import {a as a$4}from'./chunk-RSKKEGJZ.mjs';import {a as a$2}from'./chunk-K6X2BHPP.mjs';import {a as a$e}from'./chunk-BGMVPFYK.mjs';import {a as a$3}from'./chunk-3FYY26ED.mjs';import {d}from'./chunk-MRJFGHFW.mjs';import {b,c}from'./chunk-TZ4MVY4E.mjs';import {c as c$3}from'./chunk-JDLUGVXG.mjs';import {a as a$7,b as b$2,g,e as e$1}from'./chunk-AUOQSTS5.mjs';import {a as a$f}from'./chunk-HXTAOYOD.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$5}from'./chunk-4QEH5CGK.mjs';import {BoldIcon,ItalicIcon,UnderlineIcon,ArrowUpCircleFilledIcon,AtIcon,XCircleFilledIcon,LinkIcon,XIcon}from'@baseline-ui/icons/20';import {layoutSprinkleValues,sprinkles}from'@baseline-ui/tokens';import mt,{useCallback,useImperativeHandle,useEffect,useRef,useState,useMemo,useLayoutEffect,useId,useContext,Fragment as Fragment$1}from'react';import {useGranularLayoutEffect}from'granular-hooks';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Hr from'just-camel-case';import {QuestionmarkCircleIcon,TextIcon,HighlightTextIcon}from'@baseline-ui/icons/24';import*as jo from'dompurify';import Qr from'just-kebab-case';import {createPortal}from'react-dom';/**
1
+ import {a as a$q}from'./chunk-JI4SJ53O.mjs';import {b as b$a}from'./chunk-GKODQS6E.mjs';import {a as a$8}from'./chunk-ZP4YB5RP.mjs';import {b as b$3}from'./chunk-HI44JQA7.mjs';import {a as a$o}from'./chunk-3UH5CQQF.mjs';import {a as a$r}from'./chunk-IHLJTHGQ.mjs';import {b as b$6,a as a$m}from'./chunk-QKKV24WQ.mjs';import {a as a$c}from'./chunk-5IC46G5J.mjs';import {b as b$4}from'./chunk-DSSMBDVA.mjs';import {f}from'./chunk-UCQJ6FJO.mjs';import {a as a$j}from'./chunk-5BAHJXOI.mjs';import {b as b$8,c as c$2}from'./chunk-7VHON5HL.mjs';import {a as a$6}from'./chunk-EU75HMPG.mjs';import {a as a$k}from'./chunk-NGZRN4SF.mjs';import {a as a$p}from'./chunk-LRZ6BQFQ.mjs';import {a as a$g}from'./chunk-3L7GTQXK.mjs';import {a as a$h}from'./chunk-6DU65N7Q.mjs';import {a as a$i}from'./chunk-MFNWPTNI.mjs';import {b as b$9,e}from'./chunk-MNAD5FJH.mjs';import {b as b$7,f as f$1}from'./chunk-AKES5B6C.mjs';import {a as a$n}from'./chunk-SNQDFFKP.mjs';import {a as a$a}from'./chunk-NSC53QWT.mjs';import {a as a$d}from'./chunk-CGFLGZL4.mjs';import {c as c$1,b as b$1}from'./chunk-GX2IOGYR.mjs';import {b as b$b}from'./chunk-WN6FAICZ.mjs';import {a as a$9}from'./chunk-O7XK2WIX.mjs';import {a as a$b}from'./chunk-TVENHRYC.mjs';import {a as a$l}from'./chunk-TDXALNX3.mjs';import {b as b$5,j as j$1}from'./chunk-2HMLSXNO.mjs';import {a as a$1}from'./chunk-X3AXUU3H.mjs';import {a as a$4}from'./chunk-RSKKEGJZ.mjs';import {a as a$2}from'./chunk-K6X2BHPP.mjs';import {a as a$e}from'./chunk-BGMVPFYK.mjs';import {a as a$3}from'./chunk-3FYY26ED.mjs';import {d}from'./chunk-MRJFGHFW.mjs';import {b,c}from'./chunk-TZ4MVY4E.mjs';import {c as c$3}from'./chunk-JDLUGVXG.mjs';import {a as a$7,b as b$2,g,e as e$1}from'./chunk-AUOQSTS5.mjs';import {a as a$f}from'./chunk-HXTAOYOD.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$5}from'./chunk-4QEH5CGK.mjs';import {BoldIcon,ItalicIcon,UnderlineIcon,ArrowUpCircleFilledIcon,AtIcon,XCircleFilledIcon,LinkIcon,XIcon}from'@baseline-ui/icons/20';import {layoutSprinkleValues,sprinkles}from'@baseline-ui/tokens';import mt,{useCallback,useImperativeHandle,useEffect,useRef,useState,useMemo,useLayoutEffect,useId,useContext,Fragment as Fragment$1}from'react';import {useGranularLayoutEffect}from'granular-hooks';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Hr from'just-camel-case';import {QuestionmarkCircleIcon,TextIcon,HighlightTextIcon}from'@baseline-ui/icons/24';import*as jo from'dompurify';import Qr from'just-kebab-case';import {createPortal}from'react-dom';/**
2
2
  * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
3
  *
4
4
  * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
@@ -7,7 +7,7 @@ import {a as a$q}from'./chunk-JI4SJ53O.mjs';import {b as b$a}from'./chunk-GKODQS
7
7
  * This notice may not be removed from this file.
8
8
  *
9
9
  */
10
- var xo="f6jv6bm",bo="_1yep5z64u _1yep5z64v _1yep5z64w _1yep5z676 _1yep5z677 _1yep5z678 _1yep5z6js _1yep5z6jt _1yep5z6ju",Be="_1yep5z689 _1yep5z68a _1yep5z68b _1yep5z65x _1yep5z65y _1yep5z65z",yo=a({defaultClassName:"f6jv6b0 _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6g1",variantClassNames:{isInline:{true:"f6jv6b1"},isMinimal:{true:"_1yep5z6154 _1yep5z6155 _1yep5z6156 _1yep5z6vo _1yep5z6vp _1yep5z6vq _1yep5z615m _1yep5z615n _1yep5z615o",false:"_1yep5z6157 _1yep5z6158 _1yep5z6159"}},defaultVariants:{},compoundVariants:[[{isInline:true,isMinimal:false},"_1yep5z61ir _1yep5z61is _1yep5z61it _1yep5z61jf _1yep5z61jg _1yep5z61jh _1yep5z61k3 _1yep5z61k4 _1yep5z61k5 _1yep5z61kr _1yep5z61ks _1yep5z61kt _1yep5z61u7 _1yep5z61u5 _1yep5z61pa"]]}),ot=a({defaultClassName:"f6jv6b4 _1yep5z69 _1yep5z6a _1yep5z6b _1yep5z62l _1yep5z62m _1yep5z62n _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z6e3 _1yep5z6eu _1yep5z6lq",variantClassNames:{isDisabled:{true:"f6jv6b5 _1yep5z6111"}},defaultVariants:{},compoundVariants:[]}),Eo="f6jv6b6",vo="f6jv6bj _1yep5z6wr _1yep5z6ws _1yep5z6wt _1yep5z6xf _1yep5z6xg _1yep5z6xh _1yep5z6y3 _1yep5z6y4 _1yep5z6y5 _1yep5z6yr _1yep5z6ys _1yep5z6yt",Ro="f6jv6bk";var To="f6jv6bn _1yep5z63l _1yep5z63m _1yep5z63n _1yep5z619 _1yep5z61a _1yep5z61b _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6iv _1yep5z6iw _1yep5z6ix _1yep5z6ly _1yep5z6lt _1yep5z6lr _1yep5z6hx _1yep5z6eu",ko=a({defaultClassName:"f6jv6bg _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z63 _1yep5z64 _1yep5z65 _1yep5z62f _1yep5z62g _1yep5z62h _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j1 _1yep5z6j2 _1yep5z6j3 _1yep5z6jj _1yep5z6jk _1yep5z6jl _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6lq _1yep5z6la _1yep5z6ld _1yep5z6lp",variantClassNames:{isHovered:{true:"_1yep5z6126"},isDisabled:{true:"_1yep5z6zd"}},defaultVariants:{},compoundVariants:[]}),Co="_1yep5z6jy _1yep5z6jz _1yep5z6k0",Mo="f6jv6bf f6jv6bb _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6ip _1yep5z6iq _1yep5z6ir _1yep5z6eu _1yep5z6e3 _1yep5z6ln",Lo=a({defaultClassName:"f6jv6bc _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j1 _1yep5z6j2 _1yep5z6j3 _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6k4 _1yep5z6k5 _1yep5z6k6",variantClassNames:{isInline:{true:"_1yep5z6pr _1yep5z6ps _1yep5z6pt _1yep5z6184 _1yep5z6182 _1yep5z6137",false:"_1yep5z6pu _1yep5z6pv _1yep5z6pw _1yep5z6x6 _1yep5z6x7 _1yep5z6x8 _1yep5z6xu _1yep5z6xv _1yep5z6xw _1yep5z6yi _1yep5z6yj _1yep5z6yk _1yep5z6z6 _1yep5z6z7 _1yep5z6z8"}},defaultVariants:{},compoundVariants:[]}),So="f6jv6bl",zo="f6jv6bb _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6ip _1yep5z6iq _1yep5z6ir _1yep5z6eu",_t=a({defaultClassName:"f6jv6b7",variantClassNames:{isInline:{true:"f6jv6b8",false:"f6jv6b9"}},defaultVariants:{},compoundVariants:[]}),It="f6jv6ba _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j1 _1yep5z6j2 _1yep5z6j3 _1yep5z6jj _1yep5z6jk _1yep5z6jl",rt="f6jv6bo";var Nt=mt.forwardRef(({value:t,defaultValue:e,onChange:n,placeholder:o,spellCheck:r,textBoxRef:i,isInline:l,isMinimal:s,isDisabled:a,editableContentAriaLabel:c$1,editorHandle:u,autoFocus:d,saveOnEnter:f,onSave:p},g)=>{let m=mt.useRef(null),[k,L]=a$1(t,e||"",n),K=useCallback(b=>{L(b.currentTarget.value||"");},[L]),C=useCallback(b=>{(f&&b.key==="Enter"&&!b.shiftKey||(b.ctrlKey||b.metaKey)&&b.key==="Enter")&&(b.preventDefault(),p());},[f,p]);useImperativeHandle(g,()=>({clear:()=>{L("");}}));let A=useCallback(b=>{b.currentTarget.style.height="16px",b.currentTarget.style.height=b.currentTarget.scrollHeight+"px";},[]);useGranularLayoutEffect(()=>{let b=m.current;b&&(b.style.height="16px",b.style.height=b.scrollHeight+"px");},[s],[k]),useImperativeHandle(u,()=>({setCaretPosition:b=>{m.current&&(m.current.focus(),m.current.setSelectionRange(b,b));},focus:()=>{m.current&&m.current.focus();}}));let S=d===true||d==="start"||d==="end",M=typeof d=="string"?d:void 0;useEffect(()=>{if(M&&m.current){let b=M==="start"?0:M==="end"?m.current.value.length:void 0;b!==void 0&&m.current.setSelectionRange(b,b);}},[M]);let{focusProps:V,isFocused:W,isFocusVisible:q}=a$2(),{hoverProps:h,isHovered:y}=a$3({}),O=a$4({"data-focus-visible":q,"data-hovered":y,"data-focused":W});return jsx("textarea",{...c(V,h,O),ref:b(m,i),className:a$5({[ot()]:!s,[_t({isInline:l})]:!s,[zo]:!s,[Mo]:s},"BaselineUI-Editor-PlainEditorEditingArea"),autoFocus:S,onChange:K,disabled:a,onInput:A,value:k,placeholder:o,spellCheck:r,"aria-label":c$1,onKeyDown:C})});Nt.displayName="PlainEditor";var Io=[["Toolbar Focus","Alt+F10"],["Bold","Ctrl+B"],["Italic","Ctrl+I"],["Underline","Ctrl+U"],["Select All","Ctrl+A"],["Cut","Ctrl+X"],["Copy","Ctrl+C"],["Paste","Ctrl+V"],["Undo","Ctrl+Z"],["Redo","Ctrl+Shift+Z"],["Submit","Ctrl+Enter"],["Open Help Dialog","Ctrl+Shift+H"]],{dialog:{row:it}}=layoutSprinkleValues,No=({isOpen:t,onClose:e$1,toolbarFocusLabel:n,helpLabel:o,closeLabel:r,actionLabel:i,shortcutLabel:l,boldLabel:s,italicLabel:a,underlineLabel:c,selectAllLabel:u,cutLabel:d,copyLabel:f,pasteLabel:p,undoLabel:g,redoLabel:m,openHelpDialogLabel:k,submitLabel:L})=>{let{formatMessage:K}=b$1(),C=c$3(),A={toolbarFocus:n,help:o,close:r,action:i,shortcut:l,bold:s,italic:a,underline:c,selectAll:u,cut:d,copy:f,paste:p,undo:g,redo:m,openHelpDialog:k,submit:L},S=M=>A[M]??K(Kr[M]);return jsx(b$9,{isOpen:t,onOpenChange:M=>{M||e$1();},children:jsx(e,{enableDrawer:"auto",style:{zIndex:999999},children:jsxs(a$i,{"aria-labelledby":C,className:vo,drawerBackground:"subtle",children:[jsxs(a$9,{paddingLeft:it.padding.horizontal.lg,paddingRight:it.padding.horizontal.sm,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",backgroundColor:"background.primary.subtle",className:Ro,children:[jsx(a$n,{id:C,elementType:"h3",type:"title",size:"md",children:S("help")}),jsx(a$b,{icon:XIcon,size:"md",variant:"secondary","aria-label":S("close"),"data-testid":"editor-help-dialog-close-button",onPress:e$1})]}),jsx(a$a,{className:So}),jsxs(a$9,{paddingX:it.padding.horizontal.lg,role:"table","aria-labelledby":C,backgroundColor:"background.primary.subtle",children:[jsx("div",{role:"rowgroup",children:jsxs(a$9,{role:"row",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingY:it.padding.vertical.md,color:"text.primary",children:[jsx("h6",{className:sprinkles({typography:"heading.h6.semibold"}),role:"columnheader",children:S("action")}),jsx("h6",{className:sprinkles({typography:"heading.h6.semibold"}),role:"columnheader",style:{textTransform:"capitalize"},children:S("shortcut")})]})}),jsx("div",{role:"rowgroup",children:Io.map(([M,V],W)=>jsxs(Fragment$1,{children:[jsxs(a$9,{role:"row",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingY:it.padding.vertical.xs,style:{minHeight:40},children:[jsx(a$n,{type:"subtitle",size:"sm",role:"cell",children:S(Hr(M))}),jsx(a$n,{elementType:"kbd",type:"subtitle",size:"sm",role:"cell",children:a$o(V,true)})]}),W!==Io.length-1&&jsx(a$a,{})]},M))})]})]})})})},Kr=c$1({toolbarFocus:{id:"bui.editor.toolbarFocus",defaultMessage:"Toolbar Focus"},help:{id:"bui.editor.help",defaultMessage:"Help"},close:{id:"bui.editor.close",defaultMessage:"Close"},action:{id:"bui.editor.action",defaultMessage:"Action"},shortcut:{id:"bui.editor.shortcut",defaultMessage:"Shortcut"},bold:{id:"bui.editor.bold",defaultMessage:"Bold"},italic:{id:"bui.editor.italic",defaultMessage:"Italic"},underline:{id:"bui.editor.underline",defaultMessage:"Underline"},selectAll:{id:"bui.editor.selectAll",defaultMessage:"Select All"},cut:{id:"bui.editor.cut",defaultMessage:"Cut"},copy:{id:"bui.editor.copy",defaultMessage:"Copy"},paste:{id:"bui.editor.paste",defaultMessage:"Paste"},undo:{id:"bui.editor.undo",defaultMessage:"Undo"},redo:{id:"bui.editor.redo",defaultMessage:"Redo"},openHelpDialog:{id:"bui.editor.openHelpDialog",defaultMessage:"Open Help Dialog"},submit:{id:"bui.editor.submit",defaultMessage:"Submit"}});var Fr=a$6("#ffffff00").toString("hexa"),an=[{label:"Red",color:"#ff0000"},{label:"Green",color:"#00ff00"},{label:"Blue",color:"#0000ff"},{label:"Yellow",color:"#ffff00"},{label:"Cyan",color:"#00ffff"},{label:"Magenta",color:"#ff00ff"},{label:"Black",color:"#000000"},{label:"White",color:"#ffffff"},{label:"Gray",color:"#808080"},{label:"Orange",color:"#ffa500"},{label:"Brown",color:"#a52a2a"},{label:"Purple",color:"#800080"}];[...an,{label:"Transparent",color:Fr}];var je="p",Z="a",se="mention",ye="mention_input";function cn(t,e){return typeof t=="object"&&t!==null&&"type"in t&&t.type===e}function x(t){return typeof t=="object"&&t!==null&&"text"in t&&!("type"in t)}function T(t){return cn(t,Z)}function ue(t){return cn(t,se)}function fe(t){return cn(t,ye)}function J(t){return ue(t)||fe(t)}function Ke(){return [{type:je,children:[{text:""}]}]}function wt(t,e){return t.bold===e.bold&&t.italic===e.italic&&t.underline===e.underline&&b$a(t.color,e.color)&&b$a(t.backgroundColor,e.backgroundColor)}function At(t,e){let n=false;for(let i=0;i<t.length;i++){let l=t[i];if(l.text===""&&!(e&&t.length===1)){n=true;break}if(i>0&&wt(t[i-1],l)){n=true;break}}if(!n)return t;let o=t.filter(i=>i.text!==""),r=[];for(let i of o){let l=r.at(-1);l!==void 0&&wt(l,i)?r[r.length-1]={...l,text:l.text+i.text}:r.push(i);}return r}function Ur(t){let e=(i,l)=>i===0&&l===t.length||i>0&&J(t[i-1]),n=false,o=-1;for(let i=0;i<=t.length;i++){let l=t[i],s=i<t.length&&x(l);if(s&&o===-1)o=i;else if(!s&&o!==-1){let a=t.slice(o,i);if(At(a,e(o,i))!==a){n=true;break}o=-1;}}if(!n)return t;let r=[];o=-1;for(let i=0;i<=t.length;i++){let l=t[i],s=i<t.length&&x(l);if(s&&o===-1)o=i;else if(!s&&o!==-1){let a=t.slice(o,i),c=At(a,e(o,i));for(let u of c)r.push(u);o=-1;}!s&&i<t.length&&r.push(l);}return r}function Vr(t){let e=false;for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];if(T(r)&&T(i)&&r.url===i.url){e=true;break}}if(!e)return t;let n=[];for(let o of t){let r=n.at(-1);if(T(o)&&r!==void 0&&T(r)&&r.url===o.url){let i=At([...r.children,...o.children],false);n[n.length-1]={...r,children:i};}else n.push(o);}return n}function Wr(t){let e=At(t.children,t.children.length===1);return e.reduce((o,r)=>o+r.text,"")===""?null:e===t.children?t:{...t,children:e}}function qr(t){let e=false,n=[];for(let a of t)if(T(a)){let c=Wr(a);c===null?e=true:(n.push(c),c!==a&&(e=true));}else n.push(a);let o=e?n:t,r=Ur(o),i=Vr(r),l=(a,c)=>J(a[c])&&(c===a.length-1||!x(a[c+1])),s=i;if(i.some((a,c)=>l(i,c))){s=[];for(let[a,c]of i.entries())s.push(c),l(i,a)&&s.push({text:""});}return s.length===0?[{text:""}]:s===o&&!e?t:s}function D(t){if(t.length===0)return Ke();let e=false,n=t.map(o=>{let r=qr(o.children);return r===o.children?o:(e=true,{...o,children:r})});return e?n:t}function j(t){if(x(t))return t.text.length;switch(t.type){case Z:{let e=0;for(let n=0;n<t.children.length;n++)e+=t.children[n].text.length;return e}case se:return t.displayName.length;case ye:return t.children[0].text.length;default:return t}}function Fe(t){if(t.length===0)return 0;let e=t.length-1;for(let n of t)for(let o of n.children)e+=j(o);return e}var $r=1,un=3;function st(t){return t.nodeType===$r}function Ue(t,e){return t.tagName.toLowerCase()===e}function Gr(t){if(!st(t))return false;let e=t.tagName.toLowerCase();return e==="p"||e==="div"}function Xr(t){return st(t)&&t.querySelector("p, div")!==null}var Yr=new RegExp("["+String.fromCodePoint(8203)+String.fromCodePoint(65279)+"]","g"),Zr=String.fromCodePoint(160);function Me(t){return t.replaceAll(Yr,"").replaceAll(Zr," ")}function Ao(t,e){let n={...e},o=t.tagName.toLowerCase();(o==="b"||o==="strong")&&(n.bold=true),(o==="i"||o==="em")&&(n.italic=true),o==="u"&&(n.underline=true);let r=t.style;if(r){let i=r.fontWeight;(i==="bold"||Number.parseInt(i,10)>=600&&i!=="")&&(n.bold=true),r.fontStyle==="italic"&&(n.italic=true),r.textDecoration?.includes("underline")&&(n.underline=true);let l=r.color;l&&(n.color=l);let s=r.backgroundColor;s&&(n.backgroundColor=s);}return n}function Ot(t,e,n,o){for(let r=0;r<t.childNodes.length;r++){let i=t.childNodes[r];if(i.nodeType===un){let s=i.nodeValue??"",a=Me(s);a.length>0&&o.push(Bo(a,e));continue}if(!st(i))continue;if(Ue(i,"span")&&i.dataset.userId!==void 0){let s=i.dataset.userId??"",a=i.textContent??"",c=a.startsWith("@")?a.slice(1):a;o.push({type:se,value:s,displayName:c,children:[{text:""}]});continue}if(Ue(i,"span")&&i.dataset.mentionAnchor!==void 0){let s=i.textContent??"";o.push({type:ye,children:[{text:s}]});continue}if(Ue(i,"a")){{let s=i.getAttribute("href")??"",a=[];Oo(i,e,a);let c=fn(a);c.some(d=>d.text.length>0)&&o.push({type:Z,url:s,children:c});}continue}if(Ue(i,"br")){o.push({text:"\0BR\0"});continue}let l=Ao(i,e);Ot(i,l,n,o);}}function Oo(t,e,n){for(let o=0;o<t.childNodes.length;o++){let r=t.childNodes[o];if(r.nodeType===un){let l=r.nodeValue??"",s=Me(l);s.length>0&&n.push(Bo(s,e));continue}if(!st(r))continue;if(Ue(r,"br")){n.push({text:"\0BR\0"});continue}let i=Ao(r,e);Oo(r,i,n);}}function Bo(t,e){let n={text:t};return e.bold&&(n.bold=true),e.italic&&(n.italic=true),e.underline&&(n.underline=true),e.color&&(n.color=e.color),e.backgroundColor&&(n.backgroundColor=e.backgroundColor),n}var Ho="\0BR\0";function fn(t){let e=[...t];if(e.length===1&&dn(e[0]))return [{text:""}];let n=e.length,o=0;for(;o<n&&dn(e[n-1-o]);)o+=1;let r=o>=2?o-1:0;n-=o;let i=[];for(let l=0;l<n;l++){let s=e[l];dn(s)?wo(i):i.push(s);}for(let l=0;l<r;l++)wo(i);return i}function dn(t){return "text"in t&&t.text===Ho}function wo(t){let e=t.at(-1);e!==void 0&&"text"in e&&!("type"in e)?e.text+=`
10
+ var xo="f6jv6bm",bo="_1yep5z64u _1yep5z64v _1yep5z64w _1yep5z676 _1yep5z677 _1yep5z678 _1yep5z6k8 _1yep5z6k9 _1yep5z6ka",Be="_1yep5z689 _1yep5z68a _1yep5z68b _1yep5z65x _1yep5z65y _1yep5z65z",yo=a({defaultClassName:"f6jv6b0 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6g9",variantClassNames:{isInline:{true:"f6jv6b1"},isMinimal:{true:"_1yep5z6160 _1yep5z6161 _1yep5z6162 _1yep5z6w4 _1yep5z6w5 _1yep5z6w6 _1yep5z616i _1yep5z616j _1yep5z616k",false:"_1yep5z6163 _1yep5z6164 _1yep5z6165"}},defaultVariants:{},compoundVariants:[[{isInline:true,isMinimal:false},"_1yep5z61jn _1yep5z61jo _1yep5z61jp _1yep5z61kb _1yep5z61kc _1yep5z61kd _1yep5z61kz _1yep5z61l0 _1yep5z61l1 _1yep5z61ln _1yep5z61lo _1yep5z61lp _1yep5z61vj _1yep5z61vh _1yep5z61qi"]]}),ot=a({defaultClassName:"f6jv6b4 _1yep5z69 _1yep5z6a _1yep5z6b _1yep5z62l _1yep5z62m _1yep5z62n _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z6e3 _1yep5z6ey _1yep5z6m6",variantClassNames:{isDisabled:{true:"f6jv6b5 _1yep5z611l"}},defaultVariants:{},compoundVariants:[]}),Eo="f6jv6b6",vo="f6jv6bj _1yep5z6x7 _1yep5z6x8 _1yep5z6x9 _1yep5z6xv _1yep5z6xw _1yep5z6xx _1yep5z6yj _1yep5z6yk _1yep5z6yl _1yep5z6z7 _1yep5z6z8 _1yep5z6z9",Ro="f6jv6bk";var To="f6jv6bn _1yep5z63l _1yep5z63m _1yep5z63n _1yep5z619 _1yep5z61a _1yep5z61b _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6jb _1yep5z6jc _1yep5z6jd _1yep5z6me _1yep5z6m9 _1yep5z6m7 _1yep5z6id _1yep5z6ey",ko=a({defaultClassName:"f6jv6bg _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z63 _1yep5z64 _1yep5z65 _1yep5z62f _1yep5z62g _1yep5z62h _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6m6 _1yep5z6lq _1yep5z6lt _1yep5z6m5",variantClassNames:{isHovered:{true:"_1yep5z612u"},isDisabled:{true:"_1yep5z6zt"}},defaultVariants:{},compoundVariants:[]}),Co="_1yep5z6ke _1yep5z6kf _1yep5z6kg",Mo="f6jv6bf f6jv6bb _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6j5 _1yep5z6j6 _1yep5z6j7 _1yep5z6ey _1yep5z6e3 _1yep5z6m3",Lo=a({defaultClassName:"f6jv6bc _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6kk _1yep5z6kl _1yep5z6km",variantClassNames:{isInline:{true:"_1yep5z6q7 _1yep5z6q8 _1yep5z6q9 _1yep5z6190 _1yep5z618y _1yep5z613z",false:"_1yep5z6qa _1yep5z6qb _1yep5z6qc _1yep5z6xm _1yep5z6xn _1yep5z6xo _1yep5z6ya _1yep5z6yb _1yep5z6yc _1yep5z6yy _1yep5z6yz _1yep5z6z0 _1yep5z6zm _1yep5z6zn _1yep5z6zo"}},defaultVariants:{},compoundVariants:[]}),So="f6jv6bl",zo="f6jv6bb _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6j5 _1yep5z6j6 _1yep5z6j7 _1yep5z6ey",_t=a({defaultClassName:"f6jv6b7",variantClassNames:{isInline:{true:"f6jv6b8",false:"f6jv6b9"}},defaultVariants:{},compoundVariants:[]}),It="f6jv6ba _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1",rt="f6jv6bo";var Nt=mt.forwardRef(({value:t,defaultValue:e,onChange:n,placeholder:o,spellCheck:r,textBoxRef:i,isInline:l,isMinimal:s,isDisabled:a,editableContentAriaLabel:c$1,editorHandle:u,autoFocus:d,saveOnEnter:f,onSave:p},g)=>{let m=mt.useRef(null),[k,L]=a$1(t,e||"",n),K=useCallback(b=>{L(b.currentTarget.value||"");},[L]),C=useCallback(b=>{(f&&b.key==="Enter"&&!b.shiftKey||(b.ctrlKey||b.metaKey)&&b.key==="Enter")&&(b.preventDefault(),p());},[f,p]);useImperativeHandle(g,()=>({clear:()=>{L("");}}));let A=useCallback(b=>{b.currentTarget.style.height="16px",b.currentTarget.style.height=b.currentTarget.scrollHeight+"px";},[]);useGranularLayoutEffect(()=>{let b=m.current;b&&(b.style.height="16px",b.style.height=b.scrollHeight+"px");},[s],[k]),useImperativeHandle(u,()=>({setCaretPosition:b=>{m.current&&(m.current.focus(),m.current.setSelectionRange(b,b));},focus:()=>{m.current&&m.current.focus();}}));let S=d===true||d==="start"||d==="end",M=typeof d=="string"?d:void 0;useEffect(()=>{if(M&&m.current){let b=M==="start"?0:M==="end"?m.current.value.length:void 0;b!==void 0&&m.current.setSelectionRange(b,b);}},[M]);let{focusProps:V,isFocused:W,isFocusVisible:q}=a$2(),{hoverProps:h,isHovered:y}=a$3({}),O=a$4({"data-focus-visible":q,"data-hovered":y,"data-focused":W});return jsx("textarea",{...c(V,h,O),ref:b(m,i),className:a$5({[ot()]:!s,[_t({isInline:l})]:!s,[zo]:!s,[Mo]:s},"BaselineUI-Editor-PlainEditorEditingArea"),autoFocus:S,onChange:K,disabled:a,onInput:A,value:k,placeholder:o,spellCheck:r,"aria-label":c$1,onKeyDown:C})});Nt.displayName="PlainEditor";var Io=[["Toolbar Focus","Alt+F10"],["Bold","Ctrl+B"],["Italic","Ctrl+I"],["Underline","Ctrl+U"],["Select All","Ctrl+A"],["Cut","Ctrl+X"],["Copy","Ctrl+C"],["Paste","Ctrl+V"],["Undo","Ctrl+Z"],["Redo","Ctrl+Shift+Z"],["Submit","Ctrl+Enter"],["Open Help Dialog","Ctrl+Shift+H"]],{dialog:{row:it}}=layoutSprinkleValues,No=({isOpen:t,onClose:e$1,toolbarFocusLabel:n,helpLabel:o,closeLabel:r,actionLabel:i,shortcutLabel:l,boldLabel:s,italicLabel:a,underlineLabel:c,selectAllLabel:u,cutLabel:d,copyLabel:f,pasteLabel:p,undoLabel:g,redoLabel:m,openHelpDialogLabel:k,submitLabel:L})=>{let{formatMessage:K}=b$1(),C=c$3(),A={toolbarFocus:n,help:o,close:r,action:i,shortcut:l,bold:s,italic:a,underline:c,selectAll:u,cut:d,copy:f,paste:p,undo:g,redo:m,openHelpDialog:k,submit:L},S=M=>A[M]??K(Kr[M]);return jsx(b$9,{isOpen:t,onOpenChange:M=>{M||e$1();},children:jsx(e,{enableDrawer:"auto",style:{zIndex:999999},children:jsxs(a$i,{"aria-labelledby":C,className:vo,drawerBackground:"subtle",children:[jsxs(a$9,{paddingLeft:it.padding.horizontal.lg,paddingRight:it.padding.horizontal.sm,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",backgroundColor:"background.primary.subtle",className:Ro,children:[jsx(a$n,{id:C,elementType:"h3",type:"title",size:"md",children:S("help")}),jsx(a$b,{icon:XIcon,size:"md",variant:"secondary","aria-label":S("close"),"data-testid":"editor-help-dialog-close-button",onPress:e$1})]}),jsx(a$a,{className:So}),jsxs(a$9,{paddingX:it.padding.horizontal.lg,role:"table","aria-labelledby":C,backgroundColor:"background.primary.subtle",children:[jsx("div",{role:"rowgroup",children:jsxs(a$9,{role:"row",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingY:it.padding.vertical.md,color:"text.primary",children:[jsx("h6",{className:sprinkles({typography:"heading.h6.semibold"}),role:"columnheader",children:S("action")}),jsx("h6",{className:sprinkles({typography:"heading.h6.semibold"}),role:"columnheader",style:{textTransform:"capitalize"},children:S("shortcut")})]})}),jsx("div",{role:"rowgroup",children:Io.map(([M,V],W)=>jsxs(Fragment$1,{children:[jsxs(a$9,{role:"row",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingY:it.padding.vertical.xs,style:{minHeight:40},children:[jsx(a$n,{type:"subtitle",size:"sm",role:"cell",children:S(Hr(M))}),jsx(a$n,{elementType:"kbd",type:"subtitle",size:"sm",role:"cell",children:a$o(V,true)})]}),W!==Io.length-1&&jsx(a$a,{})]},M))})]})]})})})},Kr=c$1({toolbarFocus:{id:"bui.editor.toolbarFocus",defaultMessage:"Toolbar Focus"},help:{id:"bui.editor.help",defaultMessage:"Help"},close:{id:"bui.editor.close",defaultMessage:"Close"},action:{id:"bui.editor.action",defaultMessage:"Action"},shortcut:{id:"bui.editor.shortcut",defaultMessage:"Shortcut"},bold:{id:"bui.editor.bold",defaultMessage:"Bold"},italic:{id:"bui.editor.italic",defaultMessage:"Italic"},underline:{id:"bui.editor.underline",defaultMessage:"Underline"},selectAll:{id:"bui.editor.selectAll",defaultMessage:"Select All"},cut:{id:"bui.editor.cut",defaultMessage:"Cut"},copy:{id:"bui.editor.copy",defaultMessage:"Copy"},paste:{id:"bui.editor.paste",defaultMessage:"Paste"},undo:{id:"bui.editor.undo",defaultMessage:"Undo"},redo:{id:"bui.editor.redo",defaultMessage:"Redo"},openHelpDialog:{id:"bui.editor.openHelpDialog",defaultMessage:"Open Help Dialog"},submit:{id:"bui.editor.submit",defaultMessage:"Submit"}});var Fr=a$6("#ffffff00").toString("hexa"),an=[{label:"Red",color:"#ff0000"},{label:"Green",color:"#00ff00"},{label:"Blue",color:"#0000ff"},{label:"Yellow",color:"#ffff00"},{label:"Cyan",color:"#00ffff"},{label:"Magenta",color:"#ff00ff"},{label:"Black",color:"#000000"},{label:"White",color:"#ffffff"},{label:"Gray",color:"#808080"},{label:"Orange",color:"#ffa500"},{label:"Brown",color:"#a52a2a"},{label:"Purple",color:"#800080"}];[...an,{label:"Transparent",color:Fr}];var je="p",Z="a",se="mention",ye="mention_input";function cn(t,e){return typeof t=="object"&&t!==null&&"type"in t&&t.type===e}function x(t){return typeof t=="object"&&t!==null&&"text"in t&&!("type"in t)}function T(t){return cn(t,Z)}function ue(t){return cn(t,se)}function fe(t){return cn(t,ye)}function J(t){return ue(t)||fe(t)}function Ke(){return [{type:je,children:[{text:""}]}]}function wt(t,e){return t.bold===e.bold&&t.italic===e.italic&&t.underline===e.underline&&b$a(t.color,e.color)&&b$a(t.backgroundColor,e.backgroundColor)}function At(t,e){let n=false;for(let i=0;i<t.length;i++){let l=t[i];if(l.text===""&&!(e&&t.length===1)){n=true;break}if(i>0&&wt(t[i-1],l)){n=true;break}}if(!n)return t;let o=t.filter(i=>i.text!==""),r=[];for(let i of o){let l=r.at(-1);l!==void 0&&wt(l,i)?r[r.length-1]={...l,text:l.text+i.text}:r.push(i);}return r}function Ur(t){let e=(i,l)=>i===0&&l===t.length||i>0&&J(t[i-1]),n=false,o=-1;for(let i=0;i<=t.length;i++){let l=t[i],s=i<t.length&&x(l);if(s&&o===-1)o=i;else if(!s&&o!==-1){let a=t.slice(o,i);if(At(a,e(o,i))!==a){n=true;break}o=-1;}}if(!n)return t;let r=[];o=-1;for(let i=0;i<=t.length;i++){let l=t[i],s=i<t.length&&x(l);if(s&&o===-1)o=i;else if(!s&&o!==-1){let a=t.slice(o,i),c=At(a,e(o,i));for(let u of c)r.push(u);o=-1;}!s&&i<t.length&&r.push(l);}return r}function Vr(t){let e=false;for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];if(T(r)&&T(i)&&r.url===i.url){e=true;break}}if(!e)return t;let n=[];for(let o of t){let r=n.at(-1);if(T(o)&&r!==void 0&&T(r)&&r.url===o.url){let i=At([...r.children,...o.children],false);n[n.length-1]={...r,children:i};}else n.push(o);}return n}function Wr(t){let e=At(t.children,t.children.length===1);return e.reduce((o,r)=>o+r.text,"")===""?null:e===t.children?t:{...t,children:e}}function qr(t){let e=false,n=[];for(let a of t)if(T(a)){let c=Wr(a);c===null?e=true:(n.push(c),c!==a&&(e=true));}else n.push(a);let o=e?n:t,r=Ur(o),i=Vr(r),l=(a,c)=>J(a[c])&&(c===a.length-1||!x(a[c+1])),s=i;if(i.some((a,c)=>l(i,c))){s=[];for(let[a,c]of i.entries())s.push(c),l(i,a)&&s.push({text:""});}return s.length===0?[{text:""}]:s===o&&!e?t:s}function D(t){if(t.length===0)return Ke();let e=false,n=t.map(o=>{let r=qr(o.children);return r===o.children?o:(e=true,{...o,children:r})});return e?n:t}function j(t){if(x(t))return t.text.length;switch(t.type){case Z:{let e=0;for(let n=0;n<t.children.length;n++)e+=t.children[n].text.length;return e}case se:return t.displayName.length;case ye:return t.children[0].text.length;default:return t}}function Fe(t){if(t.length===0)return 0;let e=t.length-1;for(let n of t)for(let o of n.children)e+=j(o);return e}var $r=1,un=3;function st(t){return t.nodeType===$r}function Ue(t,e){return t.tagName.toLowerCase()===e}function Gr(t){if(!st(t))return false;let e=t.tagName.toLowerCase();return e==="p"||e==="div"}function Xr(t){return st(t)&&t.querySelector("p, div")!==null}var Yr=new RegExp("["+String.fromCodePoint(8203)+String.fromCodePoint(65279)+"]","g"),Zr=String.fromCodePoint(160);function Me(t){return t.replaceAll(Yr,"").replaceAll(Zr," ")}function Ao(t,e){let n={...e},o=t.tagName.toLowerCase();(o==="b"||o==="strong")&&(n.bold=true),(o==="i"||o==="em")&&(n.italic=true),o==="u"&&(n.underline=true);let r=t.style;if(r){let i=r.fontWeight;(i==="bold"||Number.parseInt(i,10)>=600&&i!=="")&&(n.bold=true),r.fontStyle==="italic"&&(n.italic=true),r.textDecoration?.includes("underline")&&(n.underline=true);let l=r.color;l&&(n.color=l);let s=r.backgroundColor;s&&(n.backgroundColor=s);}return n}function Ot(t,e,n,o){for(let r=0;r<t.childNodes.length;r++){let i=t.childNodes[r];if(i.nodeType===un){let s=i.nodeValue??"",a=Me(s);a.length>0&&o.push(Bo(a,e));continue}if(!st(i))continue;if(Ue(i,"span")&&i.dataset.userId!==void 0){let s=i.dataset.userId??"",a=i.textContent??"",c=a.startsWith("@")?a.slice(1):a;o.push({type:se,value:s,displayName:c,children:[{text:""}]});continue}if(Ue(i,"span")&&i.dataset.mentionAnchor!==void 0){let s=i.textContent??"";o.push({type:ye,children:[{text:s}]});continue}if(Ue(i,"a")){{let s=i.getAttribute("href")??"",a=[];Oo(i,e,a);let c=fn(a);c.some(d=>d.text.length>0)&&o.push({type:Z,url:s,children:c});}continue}if(Ue(i,"br")){o.push({text:"\0BR\0"});continue}let l=Ao(i,e);Ot(i,l,n,o);}}function Oo(t,e,n){for(let o=0;o<t.childNodes.length;o++){let r=t.childNodes[o];if(r.nodeType===un){let l=r.nodeValue??"",s=Me(l);s.length>0&&n.push(Bo(s,e));continue}if(!st(r))continue;if(Ue(r,"br")){n.push({text:"\0BR\0"});continue}let i=Ao(r,e);Oo(r,i,n);}}function Bo(t,e){let n={text:t};return e.bold&&(n.bold=true),e.italic&&(n.italic=true),e.underline&&(n.underline=true),e.color&&(n.color=e.color),e.backgroundColor&&(n.backgroundColor=e.backgroundColor),n}var Ho="\0BR\0";function fn(t){let e=[...t];if(e.length===1&&dn(e[0]))return [{text:""}];let n=e.length,o=0;for(;o<n&&dn(e[n-1-o]);)o+=1;let r=o>=2?o-1:0;n-=o;let i=[];for(let l=0;l<n;l++){let s=e[l];dn(s)?wo(i):i.push(s);}for(let l=0;l<r;l++)wo(i);return i}function dn(t){return "text"in t&&t.text===Ho}function wo(t){let e=t.at(-1);e!==void 0&&"text"in e&&!("type"in e)?e.text+=`
11
11
  `:t.push({text:`
12
12
  `});}function Jr(t){let e=[];Ot(t,{},false,e);let n=fn(e);return {type:je,children:n.length>0?n:[{text:""}]}}function Bt(t){let e=t.childNodes;if(e.length===0)return Ke();let n=[],o=[];function r(){if(o.length===0)return;let l=fn(o);n.push({type:je,children:l.length>0?l:[{text:""}]}),o=[];}function i(l){for(let s of l)if(Gr(s))r(),n.push(Jr(s));else if(s.nodeType===un){let a=s.nodeValue??"",c=Me(a);c.trim().length>0&&o.push({text:c});}else st(s)&&(Ue(s,"br")?o.push({text:Ho}):Xr(s)?(r(),i(s.childNodes)):Ot(s,{},false,o));}return i(e),r(),n.length===0?Ke():D(n)}function ei(t){return Object.entries(t).map(([e,n])=>`${Qr(e)}:${n}`).filter(([,e])=>!!e).join(";")}function Ko(t){return "text"in t}function lt(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}function le(t){let e=t.trim(),n=e.replaceAll(/[\u0000- ]/g,""),o=/^([a-z][a-z0-9+.-]*):/i.exec(n);if(!o)return e;let r=o[1].toLowerCase();return new Set(["javascript","data","vbscript"]).has(r)?"":e}function Fo(t,e){if(!(e.mac?e.metaKey:e.ctrlKey))return {isLinkClick:false,url:null};let o=t?.closest?.("a")??null;if(!o)return {isLinkClick:false,url:null};let r=le(o.getAttribute("href")??"");return {isLinkClick:true,url:r===""?null:r}}function ti(t){return t.text.includes(`
13
13
  `)?t.text.split(`
@@ -7,4 +7,4 @@ import {a as a$2}from'./chunk-CHTLOFCT.mjs';import {a as a$6}from'./chunk-DRYSJS
7
7
  * This notice may not be removed from this file.
8
8
  *
9
9
  */
10
- var k="_1yep5z6iv _1yep5z6iw _1yep5z6ix",x=a({defaultClassName:"_9b1tml0",variantClassNames:{isSelected:{true:"_9b1tml1",false:"_9b1tml2"},isDisabled:{true:"z9nup82"},isHovered:{true:"_9b1tml4"},isFocusVisible:{true:"_9b1tml5"},isReadOnly:{true:"_9b1tml6"}},defaultVariants:{},compoundVariants:[[{isSelected:true,isFocusVisible:true,isReadOnly:false},"_9b1tml7"],[{isSelected:true,isHovered:true,isDisabled:false,isReadOnly:false},"_9b1tml8"],[{isSelected:false,isHovered:true,isDisabled:false,isReadOnly:false},"_9b1tml9"],[{isSelected:true,isDisabled:true},"_9b1tmla"],[{isSelected:true,isReadOnly:true},"_9b1tmlb"]]}),R=a({defaultClassName:"_9b1tmlf _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6jj _1yep5z6jk _1yep5z6jl _1yep5z6eu _1yep5z6la _1yep5z6e9",variantClassNames:{isSelected:{true:"_9b1tmlg"},size:{sm:"_9b1tmlh",md:"_9b1tmli"},isDisabled:{true:"_9b1tmlj"},isReadOnly:{true:"_1yep5z610x"}},defaultVariants:{},compoundVariants:[[{isSelected:true,isDisabled:false,isReadOnly:false},"_1yep5z61n6"],[{isSelected:true,isDisabled:true},"_1yep5z61n6"],[{isSelected:false,isDisabled:true},"_1yep5z61n4"]]}),z=a({defaultClassName:"_9b1tmlc",variantClassNames:{isDisabled:{true:"_9b1tmld"},isReadOnly:{true:"_9b1tmle"}},defaultVariants:{},compoundVariants:[]});var S=C.forwardRef(({className:N,count:V,style:P,size:i="md",icon:D,"data-block-id":H,"data-block-class":I,...a},O)=>{let l={isRequired:false},T=D||(i==="md"?CheckmarkIcon:CheckmarkIcon$1);!a["aria-label"]&&!a["aria-labelledby"]&&console.warn("You must provide either an `aria-label` or `aria-labelledby` prop to the `Reaction` component.");let s=C.useRef(null),n=a$1({...a,...l}),{inputProps:w,isPressed:F,isDisabled:r,isReadOnly:t,isSelected:d}=a$2({...a,...l},n,s),{focusProps:M,isFocused:j,isFocusVisible:c}=a$3(),{hoverProps:A,isHovered:b$1}=a$4({}),B=a$5({"data-block-id":H,"data-block-class":I,"data-focused":j,"data-focus-visible":c,"data-disabled":r,"data-hovered":b$1,"data-pressed":F,"data-selected":d});return jsxs("label",{ref:O,style:P,className:a$7(k,"BaselineUI-Reaction",N),...B,children:[jsx(b,{children:jsx("input",{...w,...M,ref:s})}),jsxs("div",{...A,className:x({isSelected:d,isFocusVisible:c,isHovered:b$1,isReadOnly:t,isDisabled:r}),children:[jsx("div",{className:z({isDisabled:r,isReadOnly:t}),children:jsx(T,{size:i==="md"?20:16})}),jsx("div",{className:R({isSelected:n.isSelected,isDisabled:r,isReadOnly:t,size:i}),children:jsx(a$6,{value:V})})]})]})});S.displayName="Reaction";export{S as a};
10
+ var k="_1yep5z6jb _1yep5z6jc _1yep5z6jd",R=a({defaultClassName:"_9b1tml0",variantClassNames:{isSelected:{true:"_9b1tml1",false:"_9b1tml2"},isDisabled:{true:"z9nup82"},isHovered:{true:"_9b1tml4"},isFocusVisible:{true:"_9b1tml5"},isReadOnly:{true:"_9b1tml6"}},defaultVariants:{},compoundVariants:[[{isSelected:true,isFocusVisible:true,isReadOnly:false},"_9b1tml7"],[{isSelected:true,isHovered:true,isDisabled:false,isReadOnly:false},"_9b1tml8"],[{isSelected:false,isHovered:true,isDisabled:false,isReadOnly:false},"_9b1tml9"],[{isSelected:true,isDisabled:true},"_9b1tmla"],[{isSelected:true,isReadOnly:true},"_9b1tmlb"]]}),x=a({defaultClassName:"_9b1tmlf _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6ey _1yep5z6lq _1yep5z6e9",variantClassNames:{isSelected:{true:"_9b1tmlg"},size:{sm:"_9b1tmlh",md:"_9b1tmli"},isDisabled:{true:"_9b1tmlj"},isReadOnly:{true:"_1yep5z611h"}},defaultVariants:{},compoundVariants:[[{isSelected:true,isDisabled:false,isReadOnly:false},"_1yep5z61o6"],[{isSelected:true,isDisabled:true},"_1yep5z61o6"],[{isSelected:false,isDisabled:true},"_1yep5z61o4"]]}),z=a({defaultClassName:"_9b1tmlc",variantClassNames:{isDisabled:{true:"_9b1tmld"},isReadOnly:{true:"_9b1tmle"}},defaultVariants:{},compoundVariants:[]});var S=C.forwardRef(({className:N,count:V,style:P,size:t="md",icon:D,"data-block-id":H,"data-block-class":I,...a},O)=>{let l={isRequired:false},T=D||(t==="md"?CheckmarkIcon:CheckmarkIcon$1);!a["aria-label"]&&!a["aria-labelledby"]&&console.warn("You must provide either an `aria-label` or `aria-labelledby` prop to the `Reaction` component.");let s=C.useRef(null),d=a$1({...a,...l}),{inputProps:j,isPressed:F,isDisabled:r,isReadOnly:i,isSelected:c}=a$2({...a,...l},d,s),{focusProps:w,isFocused:M,isFocusVisible:n}=a$3(),{hoverProps:q,isHovered:b$1}=a$4({}),A=a$5({"data-block-id":H,"data-block-class":I,"data-focused":M,"data-focus-visible":n,"data-disabled":r,"data-hovered":b$1,"data-pressed":F,"data-selected":c});return jsxs("label",{ref:O,style:P,className:a$7(k,"BaselineUI-Reaction",N),...A,children:[jsx(b,{children:jsx("input",{...j,...w,ref:s})}),jsxs("div",{...q,className:R({isSelected:c,isFocusVisible:n,isHovered:b$1,isReadOnly:i,isDisabled:r}),children:[jsx("div",{className:z({isDisabled:r,isReadOnly:i}),children:jsx(T,{size:t==="md"?20:16})}),jsx("div",{className:x({isSelected:d.isSelected,isDisabled:r,isReadOnly:i,size:t}),children:jsx(a$6,{value:V})})]})]})});S.displayName="Reaction";export{S as a};
@@ -1,4 +1,4 @@
1
- import {c}from'./chunk-L3SNGDBH.mjs';import {b}from'./chunk-PAQQ7MQG.mjs';import {a as a$2}from'./chunk-O7XK2WIX.mjs';import {a as a$5}from'./chunk-JB3O4ABN.mjs';import {a as a$4}from'./chunk-F6JQN7YM.mjs';import {b as b$1}from'./chunk-WWSGOGLA.mjs';import {e}from'./chunk-KUEDQO7P.mjs';import {b as b$2}from'./chunk-N2XGJKZG.mjs';import {a as a$1}from'./chunk-66CUIXA6.mjs';import {a}from'./chunk-RT4LMB6X.mjs';import {t}from'./chunk-MRJFGHFW.mjs';import {c as c$1}from'./chunk-TZ4MVY4E.mjs';import {a as a$7}from'./chunk-KEVERVHK.mjs';import {a as a$6}from'./chunk-JDLUGVXG.mjs';import {e as e$1,g}from'./chunk-AUOQSTS5.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import j,{useMemo,useState,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
1
+ import {c}from'./chunk-L3SNGDBH.mjs';import {b}from'./chunk-PAQQ7MQG.mjs';import {a as a$2}from'./chunk-O7XK2WIX.mjs';import {a as a$5}from'./chunk-TVENHRYC.mjs';import {a as a$4}from'./chunk-ULCYKB34.mjs';import {b as b$1}from'./chunk-WWSGOGLA.mjs';import {e}from'./chunk-KUEDQO7P.mjs';import {b as b$2}from'./chunk-N2XGJKZG.mjs';import {a as a$1}from'./chunk-66CUIXA6.mjs';import {a}from'./chunk-RT4LMB6X.mjs';import {t}from'./chunk-MRJFGHFW.mjs';import {c as c$1}from'./chunk-TZ4MVY4E.mjs';import {a as a$7}from'./chunk-KEVERVHK.mjs';import {a as a$6}from'./chunk-JDLUGVXG.mjs';import {e as e$1,g}from'./chunk-AUOQSTS5.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import j,{useMemo,useState,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
2
2
  * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
3
  *
4
4
  * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
@@ -7,4 +7,4 @@ import {c}from'./chunk-L3SNGDBH.mjs';import {b}from'./chunk-PAQQ7MQG.mjs';import
7
7
  * This notice may not be removed from this file.
8
8
  *
9
9
  */
10
- var _={none:"toolbar",single:"radiogroup",multiple:"toolbar"};function P(e$2,o,r){let{isDisabled:i,orientation:n="horizontal"}=e$2,[c,p]=useState(false);a$6(()=>{p(!!(r.current&&r.current.parentElement?.closest('[role="toolbar"]')));},[r]),[...o.collection.getKeys()].some(t=>!o.disabledKeys.has(t))||(i=true);let{direction:a}=b$2(),s=e(r),l=a==="rtl"&&n==="horizontal",A=t=>{if(e$1(t.currentTarget,g(t)))switch(t.key){case "ArrowRight":case "ArrowDown":t.preventDefault(),t.stopPropagation(),t.key==="ArrowRight"&&l?s.focusPrevious({wrap:true}):s.focusNext({wrap:true});break;case "ArrowLeft":case "ArrowUp":t.preventDefault(),t.stopPropagation(),t.key==="ArrowLeft"&&l?s.focusNext({wrap:true}):s.focusPrevious({wrap:true});break}},u=_[o.selectionManager.selectionMode];return c&&u==="toolbar"&&(u="group"),{actionGroupProps:{...a$7(e$2,{labelable:true}),role:u,"aria-orientation":u==="toolbar"?n:void 0,"aria-disabled":i,onKeyDown:A}}}var z={none:void 0,single:"radio",multiple:"checkbox"};function x(e,o,r){let i=o.selectionManager.selectionMode,n={role:z[i]};if(i!=="none"){let m=o.selectionManager.isSelected(e.key);n["aria-checked"]=m;}let c=e.key===o.selectionManager.focusedKey,p=t(()=>{c&&o.selectionManager.setFocusedKey(null);});return useEffect(()=>()=>{p();},[]),{buttonProps:c$1(n,{tabIndex:c||o.selectionManager.focusedKey==null?0:-1,onFocus(){o.selectionManager.setFocusedKey(e.key);},onPress(){o.selectionManager.select(e.key);}})}}var F="_1yep5z6f5",N="_1dc3b8m0";var B=j.forwardRef(({className:e,selectionMode:o,style:r,"data-block-id":i,"data-block-class":n,tooltipProps:c$1,icon:p,renderActionItem:m,...a$4},s)=>{let l=a(s),A=c(),u=b({...a$4,selectionMode:o,suppressTextValueWarning:true,children:A}),{actionGroupProps:t}=P({...a$4,selectionMode:o,children:A},u,l),I=[...u.collection].map(g=>(a$1(g.value),jsx(V,{item:g,state:u,isDisabled:a$4.isDisabled,onAction:a$4.onAction,tooltipProps:c$1,renderActionItem:m},g.key)));return p?jsxs(a$2,{...t,display:"flex",flexDirection:"row",gap:"md",alignItems:"center",className:a$3("BaselineUI-ActionGroup",e),"data-block-id":i,"data-block-class":n,style:r,ref:l,children:[jsx(p,{"aria-hidden":"true",size:24,className:F}),jsx(a$2,{display:"flex",flexDirection:"row",gap:"xs",flex:1,children:I})]}):jsx(a$2,{...t,display:"flex",flexDirection:"row",gap:"xs",className:a$3("BaselineUI-ActionGroup",e),"data-block-id":i,"data-block-class":n,style:r,ref:l,children:I})});B.displayName="ActionGroup";var V=({item:e,state:o,tooltipProps:r,renderActionItem:i,onAction:n,isDisabled:c})=>{let{buttonProps:p}=x({key:e.key},o),m=c||o.selectionManager.isDisabled(e.key),a=o.selectionManager.isSelected(e.key);a$1(e.value);let{icon:s}=e.value;a$1(s);let l=useMemo(()=>(a$1(e.value),typeof r=="function"?r(e.value):r),[r,e.value]);return jsx(b$1,{...c$1(p,{onPress:()=>{n?.(e.key);}}),children:jsx(a$4,{text:e.textValue,size:"sm",variant:"inverse",includeArrow:false,offset:4,...l,children:i?.(e,{isSelected:a,isDisabled:m})||jsx(a$5,{variant:"tertiary",icon:s,"aria-label":e.textValue,size:"sm",isDisabled:m,className:a$3({[N]:a},"BaselineUI-ActionGroup-Item")})})})};export{B as a,V as b};
10
+ var _={none:"toolbar",single:"radiogroup",multiple:"toolbar"};function P(e$2,o,r){let{isDisabled:i,orientation:n="horizontal"}=e$2,[c,p]=useState(false);a$6(()=>{p(!!(r.current&&r.current.parentElement?.closest('[role="toolbar"]')));},[r]),[...o.collection.getKeys()].some(t=>!o.disabledKeys.has(t))||(i=true);let{direction:a}=b$2(),s=e(r),l=a==="rtl"&&n==="horizontal",A=t=>{if(e$1(t.currentTarget,g(t)))switch(t.key){case "ArrowRight":case "ArrowDown":t.preventDefault(),t.stopPropagation(),t.key==="ArrowRight"&&l?s.focusPrevious({wrap:true}):s.focusNext({wrap:true});break;case "ArrowLeft":case "ArrowUp":t.preventDefault(),t.stopPropagation(),t.key==="ArrowLeft"&&l?s.focusNext({wrap:true}):s.focusPrevious({wrap:true});break}},u=_[o.selectionManager.selectionMode];return c&&u==="toolbar"&&(u="group"),{actionGroupProps:{...a$7(e$2,{labelable:true}),role:u,"aria-orientation":u==="toolbar"?n:void 0,"aria-disabled":i,onKeyDown:A}}}var z={none:void 0,single:"radio",multiple:"checkbox"};function x(e,o,r){let i=o.selectionManager.selectionMode,n={role:z[i]};if(i!=="none"){let m=o.selectionManager.isSelected(e.key);n["aria-checked"]=m;}let c=e.key===o.selectionManager.focusedKey,p=t(()=>{c&&o.selectionManager.setFocusedKey(null);});return useEffect(()=>()=>{p();},[]),{buttonProps:c$1(n,{tabIndex:c||o.selectionManager.focusedKey==null?0:-1,onFocus(){o.selectionManager.setFocusedKey(e.key);},onPress(){o.selectionManager.select(e.key);}})}}var F="_1yep5z6f9",N="_1dc3b8m0";var B=j.forwardRef(({className:e,selectionMode:o,style:r,"data-block-id":i,"data-block-class":n,tooltipProps:c$1,icon:p,renderActionItem:m,...a$4},s)=>{let l=a(s),A=c(),u=b({...a$4,selectionMode:o,suppressTextValueWarning:true,children:A}),{actionGroupProps:t}=P({...a$4,selectionMode:o,children:A},u,l),I=[...u.collection].map(g=>(a$1(g.value),jsx(V,{item:g,state:u,isDisabled:a$4.isDisabled,onAction:a$4.onAction,tooltipProps:c$1,renderActionItem:m},g.key)));return p?jsxs(a$2,{...t,display:"flex",flexDirection:"row",gap:"md",alignItems:"center",className:a$3("BaselineUI-ActionGroup",e),"data-block-id":i,"data-block-class":n,style:r,ref:l,children:[jsx(p,{"aria-hidden":"true",size:24,className:F}),jsx(a$2,{display:"flex",flexDirection:"row",gap:"xs",flex:1,children:I})]}):jsx(a$2,{...t,display:"flex",flexDirection:"row",gap:"xs",className:a$3("BaselineUI-ActionGroup",e),"data-block-id":i,"data-block-class":n,style:r,ref:l,children:I})});B.displayName="ActionGroup";var V=({item:e,state:o,tooltipProps:r,renderActionItem:i,onAction:n,isDisabled:c})=>{let{buttonProps:p}=x({key:e.key},o),m=c||o.selectionManager.isDisabled(e.key),a=o.selectionManager.isSelected(e.key);a$1(e.value);let{icon:s}=e.value;a$1(s);let l=useMemo(()=>(a$1(e.value),typeof r=="function"?r(e.value):r),[r,e.value]);return jsx(b$1,{...c$1(p,{onPress:()=>{n?.(e.key);}}),children:jsx(a$4,{text:e.textValue,size:"sm",variant:"inverse",includeArrow:false,offset:4,...l,children:i?.(e,{isSelected:a,isDisabled:m})||jsx(a$5,{variant:"tertiary",icon:s,"aria-label":e.textValue,size:"sm",isDisabled:m,className:a$3({[N]:a},"BaselineUI-ActionGroup-Item")})})})};export{B as a,V as b};
@@ -1,4 +1,4 @@
1
- import {c}from'./chunk-75722G3R.mjs';import {a,d,b as b$3}from'./chunk-O66FNQSB.mjs';import {b as b$1}from'./chunk-246VHB32.mjs';import {c as c$1}from'./chunk-OC42IZG2.mjs';import {b as b$4,a as a$b}from'./chunk-PAQQ7MQG.mjs';import {b as b$2}from'./chunk-DECHIERQ.mjs';import {a as a$6}from'./chunk-F2X474RV.mjs';import {a as a$1}from'./chunk-EX2LI2CV.mjs';import {c as c$2,d as d$1}from'./chunk-W6QO7FPZ.mjs';import {c as c$4}from'./chunk-I3YGB2BE.mjs';import {b}from'./chunk-WL27JGVG.mjs';import {a as a$a}from'./chunk-4PYEGHW5.mjs';import {a as a$5}from'./chunk-JJG67M2S.mjs';import {c as c$3}from'./chunk-6IRWW75G.mjs';import {a as a$4}from'./chunk-D3IZ4HBL.mjs';import {a as a$8}from'./chunk-RXSYDMT6.mjs';import {a as a$9}from'./chunk-X3AXUU3H.mjs';import {a as a$3}from'./chunk-545KDVGI.mjs';import {n,h}from'./chunk-MRJFGHFW.mjs';import {a as a$2,c as c$5}from'./chunk-TZ4MVY4E.mjs';import {c as c$6}from'./chunk-JDLUGVXG.mjs';import {f,a as a$7,e,g}from'./chunk-AUOQSTS5.mjs';import {useRef,useMemo,useEffect,useState,useCallback}from'react';/**
1
+ import {c}from'./chunk-5TDFLLMX.mjs';import {a,d,b as b$3}from'./chunk-O66FNQSB.mjs';import {b as b$1}from'./chunk-246VHB32.mjs';import {c as c$1}from'./chunk-OC42IZG2.mjs';import {b as b$4,a as a$b}from'./chunk-PAQQ7MQG.mjs';import {b as b$2}from'./chunk-DECHIERQ.mjs';import {a as a$6}from'./chunk-F2X474RV.mjs';import {a as a$1}from'./chunk-EX2LI2CV.mjs';import {c as c$2,d as d$1}from'./chunk-W6QO7FPZ.mjs';import {c as c$4}from'./chunk-I3YGB2BE.mjs';import {b}from'./chunk-WL27JGVG.mjs';import {a as a$a}from'./chunk-4PYEGHW5.mjs';import {a as a$5}from'./chunk-JJG67M2S.mjs';import {c as c$3}from'./chunk-6IRWW75G.mjs';import {a as a$4}from'./chunk-D3IZ4HBL.mjs';import {a as a$8}from'./chunk-RXSYDMT6.mjs';import {a as a$9}from'./chunk-X3AXUU3H.mjs';import {a as a$3}from'./chunk-545KDVGI.mjs';import {n,h}from'./chunk-MRJFGHFW.mjs';import {a as a$2,c as c$5}from'./chunk-TZ4MVY4E.mjs';import {c as c$6}from'./chunk-JDLUGVXG.mjs';import {f,a as a$7,e,g}from'./chunk-AUOQSTS5.mjs';import {useRef,useMemo,useEffect,useState,useCallback}from'react';/**
2
2
  * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
3
  *
4
4
  * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
@@ -0,0 +1,10 @@
1
+ import {c as c$1}from'./chunk-2NO2ITVE.mjs';import {a as a$5}from'./chunk-TVENHRYC.mjs';import {a as a$3}from'./chunk-66CUIXA6.mjs';import {a as a$4}from'./chunk-RSKKEGJZ.mjs';import {a as a$1}from'./chunk-K6X2BHPP.mjs';import {a as a$2}from'./chunk-3FYY26ED.mjs';import {d}from'./chunk-AQYBKDT2.mjs';import {c}from'./chunk-TZ4MVY4E.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import {TrashIcon}from'@baseline-ui/icons/16';import G 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 H="_1vm2oh49 _1yep5z6iw _1yep5z6ix _1yep5z6iy _1yep5z6gc",o="_1vm2oh48 _1yep5z6m4 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv _1yep5z6kk _1yep5z6kl _1yep5z6km",N=a({defaultClassName:"_1vm2oh40 mnnh5s1 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6m9 _1yep5z6m7 _1yep5z6is _1yep5z6ma _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6lq _1yep5z6m5 _1yep5z6it _1yep5z6iu _1yep5z6iv",variantClassNames:{accent:{theme:"_1vm2oh41",positive:"_1vm2oh42"},isInline:{true:"mnnh5s2 _1yep5z6x1 _1yep5z6x2 _1yep5z6x3 _1yep5z6xp _1yep5z6xq _1yep5z6xr _1yep5z6yd _1yep5z6ye _1yep5z6yf _1yep5z6z1 _1yep5z6z2 _1yep5z6z3 _1yep5z613z _1yep5z618y _1yep5z6190",false:"_1yep5z6135"},isFocusVisible:{true:"_1yep5z614b _1yep5z618s _1yep5z618q _1yep5z614w _1yep5z618t"},isDisabled:{true:"mnnh5s8 z9nup82 _1yep5z6zt"},isHovered:{true:"_1vm2oh47"}},defaultVariants:{},compoundVariants:[[{accent:"positive",isInline:true},"_1yep5z61pm"],[{accent:"theme",isInline:true},"_1yep5z61pb"],[{accent:"positive",isInline:false},"_1yep5z61po"],[{accent:"theme",isInline:false},"_1yep5z61pd"],[{isFocusVisible:true,isInline:true},"_1yep5z61rf _1yep5z61v9 _1yep5z61vb _1yep5z61vc"],[{isHovered:true,isInline:true},"_1yep5z61vc _1yep5z61rf _1yep5z61v9 _1yep5z61vb"],[{isHovered:true,isInline:false,accent:"positive"},"_1yep5z61pn"],[{isHovered:true,isInline:false,accent:"theme"},"_1yep5z61pf"],[{isHovered:true,isInline:true,accent:"theme"},"_1yep5z61pc"]]});var F=G.forwardRef(({className:V,style:g,isDisabled:e,isInline:a=true,imageAlt:y,imageSrc:r,svgSrc:p,textValue:t,textStyle:B,onPress:R,onDelete:n,deleteAriaLabel:T,addAriaLabel:_,accent:q="positive","data-block-id":M,"data-block-class":E,...z},U)=>{let{focusProps:m,isFocused:Y,isFocusVisible:l}=a$1({within:true}),{isHovered:v,hoverProps:u}=a$2({isDisabled:e}),{pressProps:c$2}=d({isDisabled:e,onPress:R});a$3(r||p||t,"Preview must have content. You must provide either an `imageSrc`, `svgSrc`, or `textValue` prop.");let f=a$4({"data-hovered":v,"data-focus-visible":l,"data-focused":Y,"data-disabled":e});return jsxs("div",{...z,className:a$6(N({isInline:a,isFocusVisible:l,isDisabled:e,isHovered:v,accent:q}),"BaselineUI-Preview",V),"data-block-id":M,"data-block-class":E,"aria-label":z["aria-label"]||y||t,style:g,ref:U,children:[typeof p=="string"?jsx("button",{disabled:e,...c(u,m,c$2,f),className:o,"aria-label":_,dangerouslySetInnerHTML:{__html:p}}):jsxs("button",{...c(u,m,c$2,f),disabled:e,style:B,"aria-label":_,className:o,children:[r?jsx("img",{src:r,alt:y,className:c$1({isInline:a,isDisabled:e})}):null,!!p&&typeof p=="object"&&p,t]}),n?jsx(a$5,{isDisabled:e,className:H,"aria-label":T,size:"xs",icon:TrashIcon,onPress:n}):null]})});F.displayName="Preview";export{F as a};
@@ -0,0 +1,10 @@
1
+ import {a}from'./chunk-FXCHST4Z.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 _=a({defaultClassName:"_16vugd0b _1yep5z6ez _1yep5z6dy",variantClassNames:{isDisabled:{true:"_1yep5z611l"}},defaultVariants:{},compoundVariants:[]}),t=a({defaultClassName:"_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6it _1yep5z6iu _1yep5z6iv z9nup88",variantClassNames:{labelPosition:{end:"_1yep5z6160 _1yep5z6161 _1yep5z6162 _1yep5z6w1 _1yep5z6w2 _1yep5z6w3",start:"_1yep5z6166 _1yep5z6167 _1yep5z6168 _1yep5z617i _1yep5z617j _1yep5z617k"}},defaultVariants:{},compoundVariants:[]}),i=a({defaultClassName:"_16vugd03 _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6mh _1yep5z6mf _1yep5z6hi _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6fc _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv _1yep5z6m5 _1yep5z6lq _1yep5z6m0",variantClassNames:{isIndeterminate:{true:"_1yep5z618x _1yep5z6130"},isSelected:{true:"_16vugd05"},isFocusVisible:{true:"_16vugd06"},isHovered:{true:"_1yep5z6142"},isDisabled:{true:"_16vugd08 _1yep5z6146"},isReadOnly:{true:"_16vugd09 _1yep5z611s _1yep5z6190 _1yep5z618y _1yep5z6146"},hasError:{true:"_1yep5z613e _1yep5z6190 _1yep5z618y"}},defaultVariants:{},compoundVariants:[[{isSelected:true,isDisabled:false,isReadOnly:false},"_1yep5z61pj"],[{isSelected:true,isDisabled:false,isReadOnly:false,hasError:false},"_1yep5z61vg"],[{isSelected:true,isDisabled:true},"_1yep5z61pt _1yep5z61of"],[{isSelected:true,isDisabled:true,hasError:false},"_1yep5z61vg"],[{isHovered:true,isSelected:true,isReadOnly:false},"_1yep5z61pp _1yep5z61of"],[{isHovered:true,isSelected:true,isReadOnly:false,hasError:false},"_1yep5z61vg"],[{isHovered:true,isSelected:false,isIndeterminate:true,isReadOnly:false},"_1yep5z61pp _1yep5z61of"],[{isHovered:true,isSelected:false,isIndeterminate:true,isReadOnly:false,hasError:false},"_1yep5z61vg"]]});export{_ as a,t as b,i as c};
@@ -7,4 +7,4 @@ import {a}from'./chunk-4QEH5CGK.mjs';import z from'react';import {jsx}from'react
7
7
  * This notice may not be removed from this file.
8
8
  *
9
9
  */
10
- var o="_1ltpw2m2 _1yep5z64u _1yep5z64v _1yep5z64w _1yep5z676 _1yep5z677 _1yep5z678 _1yep5z68c _1yep5z68d _1yep5z68e _1yep5z660 _1yep5z661 _1yep5z662 _1yep5z6ev _1yep5z6ip _1yep5z6iq _1yep5z6ir _1yep5z6k4 _1yep5z6k5 _1yep5z6k6 _1ltpw2m0",p="_1ltpw2m1 _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6m1 _1yep5z6lz _1yep5z6h3 _1yep5z6g1 _1yep5z6id _1yep5z6ie _1yep5z6if _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j4 _1yep5z6j5 _1yep5z6j6";var t=z.forwardRef(({className:_,style:l,children:y},a$1)=>jsx("pre",{className:a(p,"BaselineUI-Code",_),style:l,ref:a$1,children:jsx("code",{className:o,children:y})}));t.displayName="Code";export{t as a};
10
+ var o="_1ltpw2m2 _1yep5z64u _1yep5z64v _1yep5z64w _1yep5z676 _1yep5z677 _1yep5z678 _1yep5z68c _1yep5z68d _1yep5z68e _1yep5z660 _1yep5z661 _1yep5z662 _1yep5z6ez _1yep5z6j5 _1yep5z6j6 _1yep5z6j7 _1yep5z6kk _1yep5z6kl _1yep5z6km _1ltpw2m0",p="_1ltpw2m1 _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6mh _1yep5z6mf _1yep5z6hf _1yep5z6g9 _1yep5z6it _1yep5z6iu _1yep5z6iv _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm";var t=z.forwardRef(({className:_,style:l,children:y},a$1)=>jsx("pre",{className:a(p,"BaselineUI-Code",_),style:l,ref:a$1,children:jsx("code",{className:o,children:y})}));t.displayName="Code";export{t as a};
@@ -1,4 +1,4 @@
1
- import {a}from'./chunk-IW4GXU75.mjs';import {jsx}from'react/jsx-runtime';/**
1
+ import {a}from'./chunk-WICBTAMY.mjs';import {jsx}from'react/jsx-runtime';/**
2
2
  * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
3
  *
4
4
  * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
@@ -1,4 +1,4 @@
1
- import {a as a$e}from'./chunk-JBXZ6ZHP.mjs';import {a as a$6}from'./chunk-63KRQW56.mjs';import {a as a$2}from'./chunk-UCNHDT36.mjs';import {a as a$b}from'./chunk-HI44JQA7.mjs';import {a as a$d}from'./chunk-2WAKHFPS.mjs';import {a as a$c}from'./chunk-O7XK2WIX.mjs';import {a as a$a}from'./chunk-THRAJMLX.mjs';import {a as a$4}from'./chunk-FOEGHU3P.mjs';import {a as a$8}from'./chunk-TDXALNX3.mjs';import {a as a$9,b as b$2}from'./chunk-RSKKEGJZ.mjs';import {a as a$5}from'./chunk-K6X2BHPP.mjs';import {a as a$f}from'./chunk-BGMVPFYK.mjs';import {a as a$7}from'./chunk-YB3KW7JC.mjs';import {d}from'./chunk-AQYBKDT2.mjs';import {b,c}from'./chunk-TZ4MVY4E.mjs';import {c as c$1}from'./chunk-JDLUGVXG.mjs';import {a as a$3,b as b$1}from'./chunk-AUOQSTS5.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$1}from'./chunk-4QEH5CGK.mjs';import _,{useContext,useMemo,useRef,useCallback,useEffect,useImperativeHandle,useState}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {PlusIcon}from'@baseline-ui/icons/12';import {themeVars}from'@baseline-ui/tokens';import {useGranularEffect}from'granular-hooks';import Ze from'just-camel-case';import*as st from'comlink';/**
1
+ import {a as a$e}from'./chunk-JBXZ6ZHP.mjs';import {a as a$6}from'./chunk-63KRQW56.mjs';import {a as a$2}from'./chunk-UCNHDT36.mjs';import {a as a$b}from'./chunk-HI44JQA7.mjs';import {a as a$d}from'./chunk-SNQDFFKP.mjs';import {a as a$c}from'./chunk-O7XK2WIX.mjs';import {a as a$a}from'./chunk-THRAJMLX.mjs';import {a as a$4}from'./chunk-FOEGHU3P.mjs';import {a as a$8}from'./chunk-TDXALNX3.mjs';import {a as a$9,b as b$2}from'./chunk-RSKKEGJZ.mjs';import {a as a$5}from'./chunk-K6X2BHPP.mjs';import {a as a$f}from'./chunk-BGMVPFYK.mjs';import {a as a$7}from'./chunk-YB3KW7JC.mjs';import {d}from'./chunk-AQYBKDT2.mjs';import {b,c}from'./chunk-TZ4MVY4E.mjs';import {c as c$1}from'./chunk-JDLUGVXG.mjs';import {a as a$3,b as b$1}from'./chunk-AUOQSTS5.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$1}from'./chunk-4QEH5CGK.mjs';import z,{useContext,useMemo,useRef,useCallback,useEffect,useImperativeHandle,useState}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {PlusIcon}from'@baseline-ui/icons/12';import {themeVars}from'@baseline-ui/tokens';import {useGranularEffect}from'granular-hooks';import Ze from'just-camel-case';import*as st from'comlink';/**
2
2
  * Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
3
3
  *
4
4
  * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
@@ -7,5 +7,5 @@ import {a as a$e}from'./chunk-JBXZ6ZHP.mjs';import {a as a$6}from'./chunk-63KRQW
7
7
  * This notice may not be removed from this file.
8
8
  *
9
9
  */
10
- var bt={node:null,setNode:()=>{},coordinates:null,setCoordinates:()=>{},displayId:void 0,setDisplayId:()=>{},boundsRef:{current:null},isDisabled:false,cursorNode:null,setCursorNode:()=>{},children:null,setChildren:()=>{}},p=_.createContext(bt),ke=_.memo(({children:e,isDisabled:t=false})=>{let[n,r]=_.useState(null),[a,i]=_.useState(null),[o,d]=_.useState(null),s=_.useRef(null),[l,g]=_.useState(null),[f,k]=_.useState(),c=_.useMemo(()=>({node:n,setNode:r,coordinates:l,setCoordinates:g,displayId:f,setDisplayId:k,boundsRef:s,isDisabled:t,cursorNode:a,setCursorNode:i,children:o,setChildren:d}),[n,l,f,g,r,s,t,a,i,o,d]);return jsx(p.Provider,{value:c,children:e})});ke.displayName="PointPicker";var ze="m0xg2me";var Ee="m0xg2md _1yep5z6ig _1yep5z6ih _1yep5z6ii _1yep5z6m1 _1yep5z6m0 _1yep5z6hc",_e="m0xg2mj",Re="_1yep5z6f6",Ie="m0xg2mk m0xg2mj",De=a({defaultClassName:"m0xg2m0",variantClassNames:{isDisabled:{true:"m0xg2m1",false:"m0xg2m2"},isIndicatorVisible:{true:"m0xg2m3",false:"m0xg2m4"}},defaultVariants:{},compoundVariants:[[{isDisabled:false,isIndicatorVisible:true},"m0xg2m5"],[{isDisabled:false,isIndicatorVisible:false},"m0xg2m6"]]}),Me="m0xg2m8",Ne="m0xg2mb",X="m0xg2ma _1yep5z6hd _1yep5z6lz",Ae="m0xg2m9 _1yep5z6iy _1yep5z6iz _1yep5z6j0 _1yep5z6h4 _1yep5z6lz _1yep5z6id _1yep5z6ie _1yep5z6if",Te="m0xg2m7",Le="m0xg2mc",Se="m0xg2mf";var W=a$1(Ee,"BaselineUI-PointPicker-GridLine"),zt=({coordinates:e})=>jsxs(Fragment,{children:[jsx("div",{className:W,"data-grid-line-type":"vertical",style:{height:e.y-5,transform:`translate(${e.x}px, 0) translate(-1px, 0) scaleX(0.5)`}}),jsx("div",{className:W,"data-grid-line-type":"vertical",style:{height:`calc(100% - ${e.y+4}px)`,transform:`translate(${e.x}px, ${e.y+5}px) translate(-1px, 0) scaleX(0.5)`}})]}),Et=({coordinates:e})=>jsxs(Fragment,{children:[jsx("div",{className:W,"data-grid-line-type":"horizontal",style:{width:e.x-5,transform:`translate(0, ${e.y}px) translate(0, -1px) scaleY(0.5)`}}),jsx("div",{className:W,"data-grid-line-type":"horizontal",style:{width:`calc(100% - ${e.x+4}px)`,transform:`translate(${e.x+5}px, ${e.y}px) translate(0, -1px) scaleY(0.5)`}})]}),Oe=({gridLines:e})=>{let{isDisabled:t,boundsRef:n,coordinates:r}=useContext(p),a=useMemo(()=>{let i=typeof e=="function"?e({coordinates:r,boundingRect:n.current}):e;return typeof i=="boolean"?i?r:void 0:i?.coordinates},[e,r,n]);return a&&!t?jsxs(Fragment,{children:[jsx(zt,{coordinates:a}),jsx(Et,{coordinates:a})]}):null};function He({coordinates:e,setCoordinates:t,boundsRef:n,onKeyDown:r,onKeyUp:a}){let{isDisabled:i}=useContext(p);return a$f({isDisabled:i,onKeyDown:o=>{r?.(o);let d=o.shiftKey?10:1,s=n.current;if(!s||!e)return;let l;switch(o.key){case "ArrowRight":{o.preventDefault(),l={x:a$e(e.x+d,0,s.width),y:a$e(e.y,0,s.height)};break}case "ArrowLeft":{o.preventDefault(),l={x:a$e(e.x-d,0,s.width),y:a$e(e.y,0,s.height)};break}case "ArrowDown":{o.preventDefault(),l={x:a$e(e.x,0,s.width),y:a$e(e.y+d,0,s.height)};break}case "ArrowUp":{o.preventDefault(),l={x:a$e(e.x,0,s.width),y:a$e(e.y-d,0,s.height)};break}case "Home":{o.preventDefault(),l={x:0,y:a$e(e.y,0,s.height)};break}case "End":{o.preventDefault(),l={x:s.width,y:a$e(e.y,0,s.height)};break}case "PageUp":{o.preventDefault(),l={x:a$e(e.x,0,s.width),y:0};break}case "PageDown":{o.preventDefault(),l={x:a$e(e.x,0,s.width),y:s.height};break}default:{o.continuePropagation();return}}l&&t(l);},onKeyUp:a})}function Ue(){let{node:e,coordinates:t}=useContext(p);return useMemo(()=>{if(!e||!t)return {x:0,y:0};let{left:n,top:r}=e.getBoundingClientRect();return {x:t.x+n,y:t.y+r}},[t,e])}var{color:Be}=themeVars,$e=_.forwardRef(({modality:e},t)=>e==="keyboard"?jsxs("svg",{width:92,height:92,viewBox:"0 0 92 92",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,className:_e,children:[jsxs("g",{filter:"url(#filter0_d_11407_457970)",children:[jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49 43V4h-6v39H4v6h39v39h6V49h39v-6H49zm38 5H48v39h-4V48H5v-4h39V5h4v39h39v4zm-5 28v6h-6v6h12V76h-6zm5 11H77v-4h6v-6h4v10zm-77-5v-6H4v12h12v-6h-6zm5 5H5V77h4v6h6v4zM76 4v6h6v6h6V4H76zm11 11h-4V9h-6V5h10v10zM4 4v12h6v-6h6V4H4zm11 5H9v6H5V5h10v4z",fill:Be.background.positive.subtle}),jsx("path",{d:"M48 44v4h39v-4H48zm-4 4v39h4V48h-4zM5 44v4h39v-4H5zM44 5v39h4V5h-4zm39 72v6h-6v4h10V77h-4zM9 83v-6H5v10h10v-4H9zM77 5v4h6v6h4V5H77zM5 5v10h4V9h6V5H5z",fill:Be.background.positive.interactive.enabled})]}),jsx("defs",{children:jsxs("filter",{id:"filter0_d_11407_457970",x:0,y:0,width:92,height:92,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsx("feOffset",{}),jsx("feGaussianBlur",{stdDeviation:2}),jsx("feComposite",{in2:"hardAlpha",operator:"out"}),jsx("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0"}),jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_11407_457970"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_11407_457970",result:"shape"})]})})]}):jsx(PlusIcon,{className:Ie,ref:t}));$e.displayName="PointPickerIndicatorIcon";var Tt=({trailingElement:e})=>{let{cursorNode:t}=useContext(p),[n,r]=useState({width:0,height:0});return useEffect(()=>{if(!t)return;let a=t.getBoundingClientRect();r(a);let i=new ResizeObserver(o=>{r({width:o[0].contentRect.width,height:o[0].contentRect.height});});return i.observe(t),()=>{i.disconnect();}},[t]),e?jsx(a$c,{position:"absolute",style:{left:0,top:0,zIndex:0,transform:`translate(${n.width/2}px, ${n.height/2}px)`},className:"BaselineUI-PointPickerContent-TrailingElement",children:e}):null},J=_.forwardRef(({renderTrailingElement:e,renderCursor:t},n)=>{let{coordinates:r,isDisabled:a,node:i}=useContext(p),o=a$2({ownerDocument:a$3(i)}),d=!!(r&&!a),s=useMemo(()=>e?.(),[e]),l=Ue(),g=useMemo(()=>{if(!r)return null;let f=t?.({coordinates:r,modality:o});return f===void 0?jsx($e,{modality:o}):f},[t,r,o]);return d?jsxs(a$4,{style:{left:l.x,top:l.y},className:a$1(Te,"BaselineUI-PointPickerContent-Cursor"),ref:n,children:[g,s?jsx(Tt,{trailingElement:s}):null]}):null});J.displayName="PointPickerIndicator";var Ke=_.forwardRef(({children:e,className:t,style:n,"data-block-id":r,"data-block-class":a,onFocusChange:i,onBlur:o,onFocus:d$1,onKeyDown:s,onKeyUp:l,gridLines:g=true,elementHandle:f,onMove:k,onPress:c$1,onPressStart:P,onPressEnd:b$1,renderTrailingElement:C,renderCursor:z},M)=>{let{setNode:w,node:E,coordinates:x,setCoordinates:R,displayId:G,boundsRef:I,isDisabled:h,setCursorNode:at,setChildren:j}=useContext(p),S=useRef(null),ae=useRef(null),le=a$2({ownerDocument:a$3(E)}),N=useCallback(u=>{R(u??null),k?.({coordinates:u,boundingRect:I.current});},[R,k,I]);useEffect(()=>{if(!h)return j(e),()=>{j(null);}},[e,h,j]),useEffect(()=>{let u=S.current;if(!u||h)return;let ce=()=>{let D=u.getBoundingClientRect();I.current=D;},H=D=>{let O=I.current;if(!O)return;let xt="clientX"in D?D.clientX:D.touches[0].clientX,vt="clientY"in D?D.clientY:D.touches[0].clientY,Pt={x:a$e(xt-O.left,0,O.width),y:a$e(vt-O.top,0,O.height)};N(Pt);},ue=()=>{N(null);};return u.addEventListener("mousemove",H),u.addEventListener("touchmove",H),u.addEventListener("mouseenter",ce),u.addEventListener("mouseleave",ue),()=>{u.removeEventListener("mousemove",H),u.removeEventListener("touchmove",H),u.removeEventListener("mouseenter",ce),u.removeEventListener("mouseleave",ue);}},[I,h,N]);let{pressProps:lt}=d({isDisabled:h,onPress:u=>{u.pointerType==="keyboard"?x&&c$1?.({...u,x:x.x,y:x.y}):c$1?.(u);},onPressStart:P,onPressEnd:b$1}),{focusProps:ct,isFocusVisible:ut,isFocused:dt}=a$5();a$6({ref:ae,isDisabled:h}),useImperativeHandle(f,()=>({focus:()=>{h||S.current?.focus();}}));let{focusProps:mt}=a$7({isDisabled:h,onFocusChange:i,onFocus:d$1,onBlur:o});function pt(){le==="keyboard"&&setTimeout(()=>{let u=S.current?.getBoundingClientRect();u&&(I.current=u,N({x:a$e(u.width/2,0,u.width),y:a$e(u.height/2,0,u.height)}));},0);}function ft(){N(null);}let{keyboardProps:ht}=He({coordinates:x,setCoordinates:N,boundsRef:I,onKeyDown:s,onKeyUp:l});a$8({isDisabled:h,ref:S,onInteractOutside:()=>{N(null);}});let yt=!!(x&&!h),gt=a$9({"data-focus-visible":ut,"data-focused":dt,"data-disabled":h,"data-block-id":r,"data-block-class":a,"data-active":x&&!h,"data-modality":le});return jsxs(Fragment,{children:[jsx(J,{renderTrailingElement:C,renderCursor:z,ref:at}),jsxs("div",{...c(ct,mt,{onFocus:pt,onBlur:ft},h?{}:c(ht,lt)),ref:b(M,S,w),className:a$1(De({isDisabled:!!h,isIndicatorVisible:!!yt}),"BaselineUI-PointPicker-Content",t),tabIndex:h?void 0:0,style:n,"aria-controls":G,"data-testid":"point-picker-content",...gt,children:[jsx(Oe,{gridLines:g}),jsx("div",{className:ze,ref:ae,children:e})]})]})});Ke.displayName="PointPickerContent";function Xe(e,t,n){let[r,a]=useState(0),i=o=>{a(o),n();};return useGranularEffect(()=>{if(!e||t==="trailing")return;let o=new ResizeObserver(d=>{i(d[0].contentRect.width);});return i(e.getBoundingClientRect().width),o.observe(e),()=>{o.disconnect();}},[e,t],[n]),r}function jt(e,t){return t==="indicator"?e:e?.querySelector(".BaselineUI-PointPickerContent-TrailingElement")??null}var ee=_.forwardRef(({children:e,className:t,crossOffset:n,offset:r,placement:a="bottom start",anchorElement:i="indicator"},o)=>{let d=useRef(null),{cursorNode:s,coordinates:l}=useContext(p),g=Xe(s,i,()=>{c();}),f=jt(s,i),{overlayProps:k,updatePosition:c}=a$a({overlayRef:d,placement:a,targetRef:{get current(){return f}},crossOffset:n??g,offset:r});return useGranularEffect(()=>{c();},[l,n,r],[c]),l?jsx(a$4,{className:a$1(Se,t),ref:o,children:jsx("div",{ref:d,...k,children:e})}):null});ee.displayName="Floater";var tt=8,Xt=7,qt=7,te=_.memo(({children:e,scale:t,renderMagnifierContent:n})=>{let r=useRef(null),{coordinates:a,boundsRef:i,node:o}=useContext(p),d=useRef([]);a$6({ref:r}),useEffect(()=>{if(!r.current||n)return;let g=r.current.querySelectorAll("canvas"),f=[],k=r.current.ownerDocument;for(let c of g){let P=c.getContext("2d");if(!P)continue;let b=c.clientWidth,C=c.clientHeight,z=c.width,M=c.height,w=P.getImageData(0,0,z,M);f.push({el:c,width:z,height:M,image:w});let E=k.createElement("canvas");E.width=z,E.height=M;let x=E.getContext("2d");x&&x.drawImage(c,0,0),c.width=b*t,c.height=C*t,c.style.width=`${b}px`,c.style.height=`${C}px`,P.scale(t,t),P.drawImage(E,0,0,b,C);}return d.current=f,()=>{for(let{el:c,width:P,height:b,image:C}of d.current)c.width=P,c.height=b,c.getContext("2d")?.putImageData(C,0,0);}},[o,t,n]);let s=useMemo(()=>n?n({coordinates:a,boundingRect:i.current,children:e}):e?_.cloneElement(e,{key:"magnifier-content"}):null,[n,a,i,e]),l=useMemo(()=>!i.current||!a?null:{x:a.x/i.current.width,y:a.y/i.current.height},[i,a]);return l?jsx("div",{style:{left:0,transform:`scale(${t}) translate(calc(-${l.x*100}% + ${tt*Xt/(2*t)}px), calc(-${l.y*100}% + ${tt*qt/(2*t)}px))`},className:a$1(Le,"BaselineUI-PointPickerDisplay-Magnifier"),children:jsx("div",{style:Jt(o),ref:r,inert:"true",children:s})}):null});te.displayName="Magnifier";function Zt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],a=e.getPropertyValue(r);a&&t.push([r,a]);}for(let n of e)if(n.startsWith("--")){let r=e.getPropertyValue(n);r&&t.push([n,r]);}return Object.fromEntries(t)}function Jt(e){if(!e)return {};let n=b$1(e).getComputedStyle(e),r=e.getBoundingClientRect(),a={...Zt(n),position:"static",margin:"0px",left:"0px",top:"0px",transform:"none","-webkit-text-fill-color":"inherit","-webkit-text-stroke-color":"inherit",width:`${r.width}px`,height:`${r.height}px`,interactivity:"inert"};return Object.fromEntries(Object.entries(a).map(([i,o])=>i.startsWith("--")?[i,o]:i.startsWith("-")?[a$b(Ze(i)),o]:[Ze(i),o]))}var nn=7,rn=7,on={scale:2},sn={crossOffset:void 0,offset:void 0,placement:"bottom start",anchorElement:"indicator"},rt=_.forwardRef(({className:e,style:t,description:n,magnifier:r=true,"data-block-id":a,"data-block-class":i,floating:o=false,renderMagnifierContent:d},s)=>{let{coordinates:l,boundsRef:g,setDisplayId:f,isDisabled:k,children:c,cursorNode:P}=useContext(p),b=c$1(),C=useMemo(()=>b$2(r,on),[r]),z=useMemo(()=>typeof n=="function"?n({coordinates:l?{x:l.x,y:l.y}:null,boundingRect:g.current}):n,[n,l,g]),M=!k&&!!C&&l,w=useMemo(()=>b$2(o,sn),[o]);useEffect(()=>((!w||w&&P)&&f(b),()=>{f(void 0);}),[P,b,f,w]);let E=jsxs(a$c,{ref:w?void 0:s,className:a$1(Me,"BaselineUI-PointPicker-Display",e),backgroundColor:"background.primary.subtle",boxShadow:"medium",borderRadius:"sm",outlineWidth:1,outlineColor:"border.medium",outlineOffset:-1,outlineStyle:"solid",paddingY:"md",paddingLeft:"md",paddingRight:z?.length?"xl":"md",display:"flex",flexDirection:"row",gap:"lg",alignItems:"center",style:t,id:b,"data-block-id":a,"data-block-class":i,"data-variant":w?"floating":"auto","data-testid":"point-picker-display",children:[C?jsxs("div",{className:Ae,children:[M?jsx(te,{scale:C.scale,renderMagnifierContent:d,children:c}):null,Array.from({length:nn*rn}).map((x,R)=>R===24?jsx("div",{className:a$1(X,Ne)},R):jsx("div",{className:X},R))]}):null,z?.length?jsx(a$c,{display:"flex",gap:"lg",flexDirection:"column",children:z?.map(({label:x,icon:R},G)=>jsxs(a$c,{display:"flex",gap:"md",flexDirection:"row",color:"text.secondary",alignItems:"center",children:[jsx(R,{size:12,className:Re}),jsx(a$d,{type:"label",size:"sm",children:x})]},x+G))}):null]});return w?jsx(ee,{ref:s,...w,className:"BaselineUI-PointPicker-Floater",children:E}):E});rt.displayName="PointPickerDisplay";function ie(e){let t=new Blob([e],{type:"text/javascript"}),n=URL.createObjectURL(t),r=new Worker(n);return URL.revokeObjectURL(n),r}function oe(){return ie('var Y=Object.defineProperty;var Z=(n,t,e)=>t in n?Y(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var M=(n,t,e)=>Z(n,typeof t!="symbol"?t+"":t,e);var F=Symbol("Comlink.proxy"),J=Symbol("Comlink.endpoint"),Q=Symbol("Comlink.releaseProxy"),z=Symbol("Comlink.finalizer"),T=Symbol("Comlink.thrown"),B=n=>typeof n=="object"&&n!==null||typeof n=="function",q={canHandle:n=>B(n)&&n[F],serialize(n){let{port1:t,port2:e}=new MessageChannel;return U(n,t),[e,[e]]},deserialize(n){return n.start(),et(n)}},X={canHandle:n=>B(n)&&T in n,serialize({value:n}){let t;return n instanceof Error?t={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:t={isError:!1,value:n},[t,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},H=new Map([["proxy",q],["throw",X]]);function tt(n,t){for(let e of n)if(t===e||e==="*"||e instanceof RegExp&&e.test(t))return!0;return!1}function U(n,t=globalThis,e=["*"]){t.addEventListener("message",function r(s){if(!s||!s.data)return;if(!tt(e,s.origin)){console.warn(`Invalid origin \'${s.origin}\' for comlink proxy`);return}let{id:o,type:c,path:u}=Object.assign({path:[]},s.data),i=(s.data.argumentList||[]).map(m),a;try{let l=u.slice(0,-1).reduce((f,y)=>f[y],n),h=u.reduce((f,y)=>f[y],n);switch(c){case"GET":a=h;break;case"SET":l[u.slice(-1)[0]]=m(s.data.value),a=!0;break;case"APPLY":a=h.apply(l,i);break;case"CONSTRUCT":{let f=new h(...i);a=at(f)}break;case"ENDPOINT":{let{port1:f,port2:y}=new MessageChannel;U(n,y),a=ot(f,[f])}break;case"RELEASE":a=void 0;break;default:return}}catch(l){a={value:l,[T]:0}}Promise.resolve(a).catch(l=>({value:l,[T]:0})).then(l=>{let[h,f]=_(l);t.postMessage(Object.assign(Object.assign({},h),{id:o}),f),c==="RELEASE"&&(t.removeEventListener("message",r),V(t),z in n&&typeof n[z]=="function"&&n[z]())}).catch(l=>{let[h,f]=_({value:new TypeError("Unserializable return value"),[T]:0});t.postMessage(Object.assign(Object.assign({},h),{id:o}),f)})}),t.start&&t.start()}function nt(n){return n.constructor.name==="MessagePort"}function V(n){nt(n)&&n.close()}function et(n,t){let e=new Map;return n.addEventListener("message",function(s){let{data:o}=s;if(!o||!o.id)return;let c=e.get(o.id);if(c)try{c(o)}finally{e.delete(o.id)}}),I(n,e,[],t)}function S(n){if(n)throw new Error("Proxy has been released and is not useable")}function $(n){return A(n,new Map,{type:"RELEASE"}).then(()=>{V(n)})}var P=new WeakMap,R="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{let t=(P.get(n)||0)-1;P.set(n,t),t===0&&$(n)});function rt(n,t){let e=(P.get(t)||0)+1;P.set(t,e),R&&R.register(n,t,n)}function st(n){R&&R.unregister(n)}function I(n,t,e=[],r=function(){}){let s=!1,o=new Proxy(r,{get(c,u){if(S(s),u===Q)return()=>{st(o),$(n),t.clear(),s=!0};if(u==="then"){if(e.length===0)return{then:()=>o};let i=A(n,t,{type:"GET",path:e.map(a=>a.toString())}).then(m);return i.then.bind(i)}return I(n,t,[...e,u])},set(c,u,i){S(s);let[a,l]=_(i);return A(n,t,{type:"SET",path:[...e,u].map(h=>h.toString()),value:a},l).then(m)},apply(c,u,i){S(s);let a=e[e.length-1];if(a===J)return A(n,t,{type:"ENDPOINT"}).then(m);if(a==="bind")return I(n,t,e.slice(0,-1));let[l,h]=D(i);return A(n,t,{type:"APPLY",path:e.map(f=>f.toString()),argumentList:l},h).then(m)},construct(c,u){S(s);let[i,a]=D(u);return A(n,t,{type:"CONSTRUCT",path:e.map(l=>l.toString()),argumentList:i},a).then(m)}});return rt(o,n),o}function it(n){return Array.prototype.concat.apply([],n)}function D(n){let t=n.map(_);return[t.map(e=>e[0]),it(t.map(e=>e[1]))]}var W=new WeakMap;function ot(n,t){return W.set(n,t),n}function at(n){return Object.assign(n,{[F]:!0})}function _(n){for(let[t,e]of H)if(e.canHandle(n)){let[r,s]=e.serialize(n);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:n},W.get(n)||[]]}function m(n){switch(n.type){case"HANDLER":return H.get(n.name).deserialize(n.value);case"RAW":return n.value}}function A(n,t,e,r){return new Promise(s=>{let o=ct();t.set(o,s),n.start&&n.start(),n.postMessage(Object.assign({id:o},e),r)})}function ct(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var G=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],L=1,x=8,d=new Uint32Array(96),C=class n{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[e,r]=new Uint8Array(t,0,2);if(e!==219)throw new Error("Data does not appear to be in a KDBush format.");let s=r>>4;if(s!==L)throw new Error(`Got v${s} data when expected v${L}.`);let o=G[r&15];if(!o)throw new Error("Unrecognized array type.");let[c]=new Uint16Array(t,2,1),[u]=new Uint32Array(t,4,1);return new n(u,c,o,void 0,t)}constructor(t,e=64,r=Float64Array,s=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let c=G.indexOf(this.ArrayType),u=t*2*this.ArrayType.BYTES_PER_ELEMENT,i=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-i%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${r}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,x,t),this.coords=new r(o,x+i+a,t*2),this._pos=t*2,this._finished=!0;else{let l=this.data=new s(x+u+i+a);this.ids=new this.IndexArrayType(l,x,t),this.coords=new r(l,x+i+a,t*2),this._pos=0,this._finished=!1,new Uint8Array(l,0,2).set([219,(L<<4)+c]),new Uint16Array(l,2,1)[0]=e,new Uint32Array(l,4,1)[0]=t}}add(t,e){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return N(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:c,nodeSize:u}=this;d[0]=0,d[1]=o.length-1,d[2]=0;let i=3,a=[];for(;i>0;){let l=d[--i],h=d[--i],f=d[--i];if(h-f<=u){for(let g=f;g<=h;g++){let E=c[2*g],k=c[2*g+1];E>=t&&E<=r&&k>=e&&k<=s&&a.push(o[g])}continue}let y=f+h>>1,w=c[2*y],p=c[2*y+1];w>=t&&w<=r&&p>=e&&p<=s&&a.push(o[y]),(l===0?t<=w:e<=p)&&(d[i++]=f,d[i++]=y-1,d[i++]=1-l),(l===0?r>=w:s>=p)&&(d[i++]=y+1,d[i++]=h,d[i++]=1-l)}return a}within(t,e,r){let s=[];return this.withinInto(t,e,r,s),s}withinInto(t,e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:c,nodeSize:u}=this;d[0]=0,d[1]=o.length-1,d[2]=0;let i=3,a=0,l=r*r;for(;i>0;){let h=d[--i],f=d[--i],y=d[--i];if(f-y<=u){for(let E=y;E<=f;E++)j(c[2*E],c[2*E+1],t,e)<=l&&(s[a++]=o[E]);continue}let w=y+f>>1,p=c[2*w],g=c[2*w+1];j(p,g,t,e)<=l&&(s[a++]=o[w]),(h===0?t-r<=p:e-r<=g)&&(d[i++]=y,d[i++]=w-1,d[i++]=1-h),(h===0?t+r>=p:e+r>=g)&&(d[i++]=w+1,d[i++]=f,d[i++]=1-h)}return a}};function N(n,t,e,r,s,o){if(s-r<=e)return;let c=r+s>>1;K(n,t,c,r,s,o),N(n,t,e,r,c-1,1-o),N(n,t,e,c+1,s,1-o)}function K(n,t,e,r,s,o){for(;s>r;){if(s-r>600){let a=s-r+1,l=e-r+1,h=Math.log(a),f=.5*Math.exp(2*h/3),y=.5*Math.sqrt(h*f*(a-f)/a)*(l-a/2<0?-1:1),w=Math.max(r,Math.floor(e-l*f/a+y)),p=Math.min(s,Math.floor(e+(a-l)*f/a+y));K(n,t,e,w,p,o)}let c=t[2*e+o],u=r,i=s;for(b(n,t,r,e),t[2*s+o]>c&&b(n,t,r,s);u<i;){for(b(n,t,u,i),u++,i--;t[2*u+o]<c;)u++;for(;t[2*i+o]>c;)i--}t[2*r+o]===c?b(n,t,r,i):(i++,b(n,t,i,s)),i<=e&&(r=i+1),e<=i&&(s=i-1)}}function b(n,t,e,r){O(n,e,r),O(t,2*e,2*r),O(t,2*e+1,2*r+1)}function O(n,t,e){let r=n[t];n[t]=n[e],n[e]=r}function j(n,t,e,r){let s=n-e,o=t-r;return s*s+o*o}var v=class{constructor(){M(this,"index",null);M(this,"xCoords",null);M(this,"yCoords",null)}buildIndex(t){this.clear(),this.xCoords=new Float64Array(t.length),this.yCoords=new Float64Array(t.length);for(let[r,s]of t.entries())this.xCoords[r]=s.x,this.yCoords[r]=s.y;let e=new C(t.length);for(let r=0;r<t.length;r++)e.add(this.xCoords[r],this.yCoords[r]);return e.finish(),this.index=e,e.data}clear(){this.index=null,this.xCoords=null,this.yCoords=null}findNearestPoint(t,e,r){if(!this.index||!this.xCoords||!this.yCoords)return null;let s=this.index.within(t,e,r);if(s.length===0)return null;let o=s[0],c=1/0;for(let u of s){let i=t-this.xCoords[u],a=e-this.yCoords[u],l=i*i+a*a;l<c&&(c=l,o=u)}return{x:this.xCoords[o],y:this.yCoords[o]}}findPointsInRadius(t,e,r){if(!this.index||!this.xCoords||!this.yCoords)return[];let s=this.index.within(t,e,r),o=Array.from({length:s.length});for(let[c,u]of s.entries())o[c]={x:this.xCoords[u],y:this.yCoords[u]};return o}};U(new v);\n/*! Bundled license information:\n\ncomlink/dist/esm/comlink.mjs:\n (**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n *)\n*/\n')}function ln({snapPoints:e,snapRadius:t=50}){let n=useRef(null),r=useRef(null),a=useMemo(()=>{let s=new oe;return r.current=s,st.wrap(s)},[]);useEffect(()=>()=>{r.current&&(r.current.terminate(),r.current=null);},[]);let i=useCallback(async()=>{e&&(n.current=await a.buildIndex(e));},[e,a]);useEffect(()=>{e&&e.length>0&&i();},[e,i]);let o=useCallback(async s=>e?(n.current||await i(),a.findNearestPoint(s.x,s.y,t)):null,[e,t,i,a]),d=useCallback(async s=>e?(n.current||await i(),a.findPointsInRadius(s.x,s.y,t)):[],[e,t,i,a]);return {findNearestPoint:o,findPointsInRadius:d}}
10
+ var bt={node:null,setNode:()=>{},coordinates:null,setCoordinates:()=>{},displayId:void 0,setDisplayId:()=>{},boundsRef:{current:null},isDisabled:false,cursorNode:null,setCursorNode:()=>{},children:null,setChildren:()=>{}},p=z.createContext(bt),ke=z.memo(({children:e,isDisabled:t=false})=>{let[n,r]=z.useState(null),[a,o]=z.useState(null),[i,d]=z.useState(null),s=z.useRef(null),[l,x]=z.useState(null),[f,k]=z.useState(),c=z.useMemo(()=>({node:n,setNode:r,coordinates:l,setCoordinates:x,displayId:f,setDisplayId:k,boundsRef:s,isDisabled:t,cursorNode:a,setCursorNode:o,children:i,setChildren:d}),[n,l,f,x,r,s,t,a,o,i,d]);return jsx(p.Provider,{value:c,children:e})});ke.displayName="PointPicker";var Ee="m0xg2me";var _e="m0xg2md _1yep5z6iw _1yep5z6ix _1yep5z6iy _1yep5z6mh _1yep5z6mg _1yep5z6ho",ze="m0xg2mj",Re="_1yep5z6fa",Ie="m0xg2mk m0xg2mj",De=a({defaultClassName:"m0xg2m0",variantClassNames:{isDisabled:{true:"m0xg2m1",false:"m0xg2m2"},isIndicatorVisible:{true:"m0xg2m3",false:"m0xg2m4"}},defaultVariants:{},compoundVariants:[[{isDisabled:false,isIndicatorVisible:true},"m0xg2m5"],[{isDisabled:false,isIndicatorVisible:false},"m0xg2m6"]]}),Me="m0xg2m8",Ne="m0xg2mb",X="m0xg2ma _1yep5z6hp _1yep5z6mf",Ae="m0xg2m9 _1yep5z6je _1yep5z6jf _1yep5z6jg _1yep5z6hg _1yep5z6mf _1yep5z6it _1yep5z6iu _1yep5z6iv",Te="m0xg2m7",Le="m0xg2mc",Se="m0xg2mf";var W=a$1(_e,"BaselineUI-PointPicker-GridLine"),Et=({coordinates:e})=>jsxs(Fragment,{children:[jsx("div",{className:W,"data-grid-line-type":"vertical",style:{height:e.y-5,transform:`translate(${e.x}px, 0) translate(-1px, 0) scaleX(0.5)`}}),jsx("div",{className:W,"data-grid-line-type":"vertical",style:{height:`calc(100% - ${e.y+4}px)`,transform:`translate(${e.x}px, ${e.y+5}px) translate(-1px, 0) scaleX(0.5)`}})]}),_t=({coordinates:e})=>jsxs(Fragment,{children:[jsx("div",{className:W,"data-grid-line-type":"horizontal",style:{width:e.x-5,transform:`translate(0, ${e.y}px) translate(0, -1px) scaleY(0.5)`}}),jsx("div",{className:W,"data-grid-line-type":"horizontal",style:{width:`calc(100% - ${e.x+4}px)`,transform:`translate(${e.x+5}px, ${e.y}px) translate(0, -1px) scaleY(0.5)`}})]}),Oe=({gridLines:e})=>{let{isDisabled:t,boundsRef:n,coordinates:r}=useContext(p),a=useMemo(()=>{let o=typeof e=="function"?e({coordinates:r,boundingRect:n.current}):e;return typeof o=="boolean"?o?r:void 0:o?.coordinates},[e,r,n]);return a&&!t?jsxs(Fragment,{children:[jsx(Et,{coordinates:a}),jsx(_t,{coordinates:a})]}):null};function He({coordinates:e,setCoordinates:t,boundsRef:n,onKeyDown:r,onKeyUp:a}){let{isDisabled:o}=useContext(p);return a$f({isDisabled:o,onKeyDown:i=>{r?.(i);let d=i.shiftKey?10:1,s=n.current;if(!s||!e)return;let l;switch(i.key){case "ArrowRight":{i.preventDefault(),l={x:a$e(e.x+d,0,s.width),y:a$e(e.y,0,s.height)};break}case "ArrowLeft":{i.preventDefault(),l={x:a$e(e.x-d,0,s.width),y:a$e(e.y,0,s.height)};break}case "ArrowDown":{i.preventDefault(),l={x:a$e(e.x,0,s.width),y:a$e(e.y+d,0,s.height)};break}case "ArrowUp":{i.preventDefault(),l={x:a$e(e.x,0,s.width),y:a$e(e.y-d,0,s.height)};break}case "Home":{i.preventDefault(),l={x:0,y:a$e(e.y,0,s.height)};break}case "End":{i.preventDefault(),l={x:s.width,y:a$e(e.y,0,s.height)};break}case "PageUp":{i.preventDefault(),l={x:a$e(e.x,0,s.width),y:0};break}case "PageDown":{i.preventDefault(),l={x:a$e(e.x,0,s.width),y:s.height};break}default:{i.continuePropagation();return}}l&&t(l);},onKeyUp:a})}function Ue(){let{node:e,coordinates:t}=useContext(p);return useMemo(()=>{if(!e||!t)return {x:0,y:0};let{left:n,top:r}=e.getBoundingClientRect();return {x:t.x+n,y:t.y+r}},[t,e])}var{color:Be}=themeVars,$e=z.forwardRef(({modality:e},t)=>e==="keyboard"?jsxs("svg",{width:92,height:92,viewBox:"0 0 92 92",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,className:ze,children:[jsxs("g",{filter:"url(#filter0_d_11407_457970)",children:[jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49 43V4h-6v39H4v6h39v39h6V49h39v-6H49zm38 5H48v39h-4V48H5v-4h39V5h4v39h39v4zm-5 28v6h-6v6h12V76h-6zm5 11H77v-4h6v-6h4v10zm-77-5v-6H4v12h12v-6h-6zm5 5H5V77h4v6h6v4zM76 4v6h6v6h6V4H76zm11 11h-4V9h-6V5h10v10zM4 4v12h6v-6h6V4H4zm11 5H9v6H5V5h10v4z",fill:Be.background.positive.subtle}),jsx("path",{d:"M48 44v4h39v-4H48zm-4 4v39h4V48h-4zM5 44v4h39v-4H5zM44 5v39h4V5h-4zm39 72v6h-6v4h10V77h-4zM9 83v-6H5v10h10v-4H9zM77 5v4h6v6h4V5H77zM5 5v10h4V9h6V5H5z",fill:Be.background.positive.interactive.enabled})]}),jsx("defs",{children:jsxs("filter",{id:"filter0_d_11407_457970",x:0,y:0,width:92,height:92,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsx("feOffset",{}),jsx("feGaussianBlur",{stdDeviation:2}),jsx("feComposite",{in2:"hardAlpha",operator:"out"}),jsx("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0"}),jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_11407_457970"}),jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_11407_457970",result:"shape"})]})})]}):jsx(PlusIcon,{className:Ie,ref:t}));$e.displayName="PointPickerIndicatorIcon";var Tt=({trailingElement:e})=>{let{cursorNode:t}=useContext(p),[n,r]=useState({width:0,height:0});return useEffect(()=>{if(!t)return;let a=t.getBoundingClientRect();r(a);let o=new ResizeObserver(i=>{r({width:i[0].contentRect.width,height:i[0].contentRect.height});});return o.observe(t),()=>{o.disconnect();}},[t]),e?jsx(a$c,{position:"absolute",style:{left:0,top:0,zIndex:0,transform:`translate(${n.width/2}px, ${n.height/2}px)`},className:"BaselineUI-PointPickerContent-TrailingElement",children:e}):null},J=z.forwardRef(({renderTrailingElement:e,renderCursor:t},n)=>{let{coordinates:r,isDisabled:a,node:o}=useContext(p),i=a$2({ownerDocument:a$3(o)}),d=!!(r&&!a),s=useMemo(()=>e?.(),[e]),l=Ue(),x=useMemo(()=>{if(!r)return null;let f=t?.({coordinates:r,modality:i});return f===void 0?jsx($e,{modality:i}):f},[t,r,i]);return d?jsxs(a$4,{style:{left:l.x,top:l.y},className:a$1(Te,"BaselineUI-PointPickerContent-Cursor"),ref:n,children:[x,s?jsx(Tt,{trailingElement:s}):null]}):null});J.displayName="PointPickerIndicator";var Ke=z.forwardRef(({children:e,className:t,style:n,"data-block-id":r,"data-block-class":a,onFocusChange:o,onBlur:i,onFocus:d$1,onKeyDown:s,onKeyUp:l,gridLines:x=true,elementHandle:f,onMove:k,onPress:c$1,onPressStart:P,onPressEnd:b$1,renderTrailingElement:w,renderCursor:E},M)=>{let{setNode:C,node:_,coordinates:g,setCoordinates:R,displayId:G,boundsRef:I,isDisabled:h,setCursorNode:at,setChildren:j}=useContext(p),S=useRef(null),ae=useRef(null),le=a$2({ownerDocument:a$3(_)}),N=useCallback(u=>{R(u??null),k?.({coordinates:u,boundingRect:I.current});},[R,k,I]);useEffect(()=>{if(!h)return j(e),()=>{j(null);}},[e,h,j]),useEffect(()=>{let u=S.current;if(!u||h)return;let ce=()=>{let D=u.getBoundingClientRect();I.current=D;},H=D=>{let O=I.current;if(!O)return;let gt="clientX"in D?D.clientX:D.touches[0].clientX,vt="clientY"in D?D.clientY:D.touches[0].clientY,Pt={x:a$e(gt-O.left,0,O.width),y:a$e(vt-O.top,0,O.height)};N(Pt);},ue=()=>{N(null);};return u.addEventListener("mousemove",H),u.addEventListener("touchmove",H),u.addEventListener("mouseenter",ce),u.addEventListener("mouseleave",ue),()=>{u.removeEventListener("mousemove",H),u.removeEventListener("touchmove",H),u.removeEventListener("mouseenter",ce),u.removeEventListener("mouseleave",ue);}},[I,h,N]);let{pressProps:lt}=d({isDisabled:h,onPress:u=>{u.pointerType==="keyboard"?g&&c$1?.({...u,x:g.x,y:g.y}):c$1?.(u);},onPressStart:P,onPressEnd:b$1}),{focusProps:ct,isFocusVisible:ut,isFocused:dt}=a$5();a$6({ref:ae,isDisabled:h}),useImperativeHandle(f,()=>({focus:()=>{h||S.current?.focus();}}));let{focusProps:mt}=a$7({isDisabled:h,onFocusChange:o,onFocus:d$1,onBlur:i});function pt(){le==="keyboard"&&setTimeout(()=>{let u=S.current?.getBoundingClientRect();u&&(I.current=u,N({x:a$e(u.width/2,0,u.width),y:a$e(u.height/2,0,u.height)}));},0);}function ft(){N(null);}let{keyboardProps:ht}=He({coordinates:g,setCoordinates:N,boundsRef:I,onKeyDown:s,onKeyUp:l});a$8({isDisabled:h,ref:S,onInteractOutside:()=>{N(null);}});let yt=!!(g&&!h),xt=a$9({"data-focus-visible":ut,"data-focused":dt,"data-disabled":h,"data-block-id":r,"data-block-class":a,"data-active":g&&!h,"data-modality":le});return jsxs(Fragment,{children:[jsx(J,{renderTrailingElement:w,renderCursor:E,ref:at}),jsxs("div",{...c(ct,mt,{onFocus:pt,onBlur:ft},h?{}:c(ht,lt)),ref:b(M,S,C),className:a$1(De({isDisabled:!!h,isIndicatorVisible:!!yt}),"BaselineUI-PointPicker-Content",t),tabIndex:h?void 0:0,style:n,"aria-controls":G,"data-testid":"point-picker-content",...xt,children:[jsx(Oe,{gridLines:x}),jsx("div",{className:Ee,ref:ae,children:e})]})]})});Ke.displayName="PointPickerContent";function Xe(e,t,n){let[r,a]=useState(0),o=i=>{a(i),n();};return useGranularEffect(()=>{if(!e||t==="trailing")return;let i=new ResizeObserver(d=>{o(d[0].contentRect.width);});return o(e.getBoundingClientRect().width),i.observe(e),()=>{i.disconnect();}},[e,t],[n]),r}function jt(e,t){return t==="indicator"?e:e?.querySelector(".BaselineUI-PointPickerContent-TrailingElement")??null}var ee=z.forwardRef(({children:e,className:t,crossOffset:n,offset:r,placement:a="bottom start",anchorElement:o="indicator"},i)=>{let d=useRef(null),{cursorNode:s,coordinates:l}=useContext(p),x=Xe(s,o,()=>{c();}),f=jt(s,o),{overlayProps:k,updatePosition:c}=a$a({overlayRef:d,placement:a,targetRef:{get current(){return f}},crossOffset:n??x,offset:r});return useGranularEffect(()=>{c();},[l,n,r],[c]),l?jsx(a$4,{className:a$1(Se,t),ref:i,children:jsx("div",{ref:d,...k,children:e})}):null});ee.displayName="Floater";var tt=8,Xt=7,qt=7,te=z.memo(({children:e,scale:t,renderMagnifierContent:n})=>{let r=useRef(null),{coordinates:a,boundsRef:o,node:i}=useContext(p),d=useRef([]);a$6({ref:r}),useEffect(()=>{if(!r.current||n)return;let x=r.current.querySelectorAll("canvas"),f=[],k=r.current.ownerDocument;for(let c of x){let P=c.getContext("2d");if(!P)continue;let b=c.clientWidth,w=c.clientHeight,E=c.width,M=c.height,C=P.getImageData(0,0,E,M);f.push({el:c,width:E,height:M,image:C});let _=k.createElement("canvas");_.width=E,_.height=M;let g=_.getContext("2d");g&&g.drawImage(c,0,0),c.width=b*t,c.height=w*t,c.style.width=`${b}px`,c.style.height=`${w}px`,P.scale(t,t),P.drawImage(_,0,0,b,w);}return d.current=f,()=>{for(let{el:c,width:P,height:b,image:w}of d.current)c.width=P,c.height=b,c.getContext("2d")?.putImageData(w,0,0);}},[i,t,n]);let s=useMemo(()=>n?n({coordinates:a,boundingRect:o.current,children:e}):e?z.cloneElement(e,{key:"magnifier-content"}):null,[n,a,o,e]),l=useMemo(()=>!o.current||!a?null:{x:a.x/o.current.width,y:a.y/o.current.height},[o,a]);return l?jsx("div",{style:{left:0,transform:`scale(${t}) translate(calc(-${l.x*100}% + ${tt*Xt/(2*t)}px), calc(-${l.y*100}% + ${tt*qt/(2*t)}px))`},className:a$1(Le,"BaselineUI-PointPickerDisplay-Magnifier"),children:jsx("div",{style:Jt(i),ref:r,inert:"true",children:s})}):null});te.displayName="Magnifier";function Zt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],a=e.getPropertyValue(r);a&&t.push([r,a]);}for(let n of e)if(n.startsWith("--")){let r=e.getPropertyValue(n);r&&t.push([n,r]);}return Object.fromEntries(t)}function Jt(e){if(!e)return {};let n=b$1(e).getComputedStyle(e),r=e.getBoundingClientRect(),a={...Zt(n),position:"static",margin:"0px",left:"0px",top:"0px",transform:"none","-webkit-text-fill-color":"inherit","-webkit-text-stroke-color":"inherit",width:`${r.width}px`,height:`${r.height}px`,interactivity:"inert"};return Object.fromEntries(Object.entries(a).map(([o,i])=>o.startsWith("--")?[o,i]:o.startsWith("-")?[a$b(Ze(o)),i]:[Ze(o),i]))}var nn=7,rn=7,on={scale:2},sn={crossOffset:void 0,offset:void 0,placement:"bottom start",anchorElement:"indicator"},rt=z.forwardRef(({className:e,style:t,description:n,magnifier:r=true,"data-block-id":a,"data-block-class":o,floating:i=false,renderMagnifierContent:d},s)=>{let{coordinates:l,boundsRef:x,setDisplayId:f,isDisabled:k,children:c,cursorNode:P}=useContext(p),b=c$1(),w=useMemo(()=>b$2(r,on),[r]),E=useMemo(()=>typeof n=="function"?n({coordinates:l?{x:l.x,y:l.y}:null,boundingRect:x.current}):n,[n,l,x]),M=!k&&!!w&&l,C=useMemo(()=>b$2(i,sn),[i]);useEffect(()=>((!C||C&&P)&&f(b),()=>{f(void 0);}),[P,b,f,C]);let _=jsxs(a$c,{ref:C?void 0:s,className:a$1(Me,"BaselineUI-PointPicker-Display",e),backgroundColor:"background.primary.subtle",boxShadow:"medium",borderRadius:"sm",outlineWidth:1,outlineColor:"border.medium",outlineOffset:-1,outlineStyle:"solid",paddingY:"md",paddingLeft:"md",paddingRight:E?.length?"xl":"md",display:"flex",flexDirection:"row",gap:"lg",alignItems:"center",style:t,id:b,"data-block-id":a,"data-block-class":o,"data-variant":C?"floating":"auto","data-testid":"point-picker-display",children:[w?jsxs("div",{className:Ae,children:[M?jsx(te,{scale:w.scale,renderMagnifierContent:d,children:c}):null,Array.from({length:nn*rn}).map((g,R)=>R===24?jsx("div",{className:a$1(X,Ne)},R):jsx("div",{className:X},R))]}):null,E?.length?jsx(a$c,{display:"flex",gap:"lg",flexDirection:"column",children:E?.map(({label:g,icon:R},G)=>jsxs(a$c,{display:"flex",gap:"md",flexDirection:"row",color:"text.secondary",alignItems:"center",children:[jsx(R,{size:12,className:Re}),jsx(a$d,{type:"label",size:"sm",children:g})]},g+G))}):null]});return C?jsx(ee,{ref:s,...C,className:"BaselineUI-PointPicker-Floater",children:_}):_});rt.displayName="PointPickerDisplay";function oe(e){let t=new Blob([e],{type:"text/javascript"}),n=URL.createObjectURL(t),r=new Worker(n);return URL.revokeObjectURL(n),r}function ie(){return oe('var Y=Object.defineProperty;var Z=(n,t,e)=>t in n?Y(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var M=(n,t,e)=>Z(n,typeof t!="symbol"?t+"":t,e);var F=Symbol("Comlink.proxy"),J=Symbol("Comlink.endpoint"),Q=Symbol("Comlink.releaseProxy"),z=Symbol("Comlink.finalizer"),T=Symbol("Comlink.thrown"),B=n=>typeof n=="object"&&n!==null||typeof n=="function",q={canHandle:n=>B(n)&&n[F],serialize(n){let{port1:t,port2:e}=new MessageChannel;return U(n,t),[e,[e]]},deserialize(n){return n.start(),et(n)}},X={canHandle:n=>B(n)&&T in n,serialize({value:n}){let t;return n instanceof Error?t={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:t={isError:!1,value:n},[t,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},H=new Map([["proxy",q],["throw",X]]);function tt(n,t){for(let e of n)if(t===e||e==="*"||e instanceof RegExp&&e.test(t))return!0;return!1}function U(n,t=globalThis,e=["*"]){t.addEventListener("message",function r(s){if(!s||!s.data)return;if(!tt(e,s.origin)){console.warn(`Invalid origin \'${s.origin}\' for comlink proxy`);return}let{id:o,type:c,path:u}=Object.assign({path:[]},s.data),i=(s.data.argumentList||[]).map(m),a;try{let l=u.slice(0,-1).reduce((f,y)=>f[y],n),h=u.reduce((f,y)=>f[y],n);switch(c){case"GET":a=h;break;case"SET":l[u.slice(-1)[0]]=m(s.data.value),a=!0;break;case"APPLY":a=h.apply(l,i);break;case"CONSTRUCT":{let f=new h(...i);a=at(f)}break;case"ENDPOINT":{let{port1:f,port2:y}=new MessageChannel;U(n,y),a=ot(f,[f])}break;case"RELEASE":a=void 0;break;default:return}}catch(l){a={value:l,[T]:0}}Promise.resolve(a).catch(l=>({value:l,[T]:0})).then(l=>{let[h,f]=_(l);t.postMessage(Object.assign(Object.assign({},h),{id:o}),f),c==="RELEASE"&&(t.removeEventListener("message",r),V(t),z in n&&typeof n[z]=="function"&&n[z]())}).catch(l=>{let[h,f]=_({value:new TypeError("Unserializable return value"),[T]:0});t.postMessage(Object.assign(Object.assign({},h),{id:o}),f)})}),t.start&&t.start()}function nt(n){return n.constructor.name==="MessagePort"}function V(n){nt(n)&&n.close()}function et(n,t){let e=new Map;return n.addEventListener("message",function(s){let{data:o}=s;if(!o||!o.id)return;let c=e.get(o.id);if(c)try{c(o)}finally{e.delete(o.id)}}),I(n,e,[],t)}function S(n){if(n)throw new Error("Proxy has been released and is not useable")}function $(n){return A(n,new Map,{type:"RELEASE"}).then(()=>{V(n)})}var P=new WeakMap,R="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{let t=(P.get(n)||0)-1;P.set(n,t),t===0&&$(n)});function rt(n,t){let e=(P.get(t)||0)+1;P.set(t,e),R&&R.register(n,t,n)}function st(n){R&&R.unregister(n)}function I(n,t,e=[],r=function(){}){let s=!1,o=new Proxy(r,{get(c,u){if(S(s),u===Q)return()=>{st(o),$(n),t.clear(),s=!0};if(u==="then"){if(e.length===0)return{then:()=>o};let i=A(n,t,{type:"GET",path:e.map(a=>a.toString())}).then(m);return i.then.bind(i)}return I(n,t,[...e,u])},set(c,u,i){S(s);let[a,l]=_(i);return A(n,t,{type:"SET",path:[...e,u].map(h=>h.toString()),value:a},l).then(m)},apply(c,u,i){S(s);let a=e[e.length-1];if(a===J)return A(n,t,{type:"ENDPOINT"}).then(m);if(a==="bind")return I(n,t,e.slice(0,-1));let[l,h]=D(i);return A(n,t,{type:"APPLY",path:e.map(f=>f.toString()),argumentList:l},h).then(m)},construct(c,u){S(s);let[i,a]=D(u);return A(n,t,{type:"CONSTRUCT",path:e.map(l=>l.toString()),argumentList:i},a).then(m)}});return rt(o,n),o}function it(n){return Array.prototype.concat.apply([],n)}function D(n){let t=n.map(_);return[t.map(e=>e[0]),it(t.map(e=>e[1]))]}var W=new WeakMap;function ot(n,t){return W.set(n,t),n}function at(n){return Object.assign(n,{[F]:!0})}function _(n){for(let[t,e]of H)if(e.canHandle(n)){let[r,s]=e.serialize(n);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:n},W.get(n)||[]]}function m(n){switch(n.type){case"HANDLER":return H.get(n.name).deserialize(n.value);case"RAW":return n.value}}function A(n,t,e,r){return new Promise(s=>{let o=ct();t.set(o,s),n.start&&n.start(),n.postMessage(Object.assign({id:o},e),r)})}function ct(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var G=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],L=1,x=8,d=new Uint32Array(96),C=class n{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[e,r]=new Uint8Array(t,0,2);if(e!==219)throw new Error("Data does not appear to be in a KDBush format.");let s=r>>4;if(s!==L)throw new Error(`Got v${s} data when expected v${L}.`);let o=G[r&15];if(!o)throw new Error("Unrecognized array type.");let[c]=new Uint16Array(t,2,1),[u]=new Uint32Array(t,4,1);return new n(u,c,o,void 0,t)}constructor(t,e=64,r=Float64Array,s=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let c=G.indexOf(this.ArrayType),u=t*2*this.ArrayType.BYTES_PER_ELEMENT,i=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-i%8)%8;if(c<0)throw new Error(`Unexpected typed array class: ${r}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,x,t),this.coords=new r(o,x+i+a,t*2),this._pos=t*2,this._finished=!0;else{let l=this.data=new s(x+u+i+a);this.ids=new this.IndexArrayType(l,x,t),this.coords=new r(l,x+i+a,t*2),this._pos=0,this._finished=!1,new Uint8Array(l,0,2).set([219,(L<<4)+c]),new Uint16Array(l,2,1)[0]=e,new Uint32Array(l,4,1)[0]=t}}add(t,e){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return N(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:c,nodeSize:u}=this;d[0]=0,d[1]=o.length-1,d[2]=0;let i=3,a=[];for(;i>0;){let l=d[--i],h=d[--i],f=d[--i];if(h-f<=u){for(let g=f;g<=h;g++){let E=c[2*g],k=c[2*g+1];E>=t&&E<=r&&k>=e&&k<=s&&a.push(o[g])}continue}let y=f+h>>1,w=c[2*y],p=c[2*y+1];w>=t&&w<=r&&p>=e&&p<=s&&a.push(o[y]),(l===0?t<=w:e<=p)&&(d[i++]=f,d[i++]=y-1,d[i++]=1-l),(l===0?r>=w:s>=p)&&(d[i++]=y+1,d[i++]=h,d[i++]=1-l)}return a}within(t,e,r){let s=[];return this.withinInto(t,e,r,s),s}withinInto(t,e,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:c,nodeSize:u}=this;d[0]=0,d[1]=o.length-1,d[2]=0;let i=3,a=0,l=r*r;for(;i>0;){let h=d[--i],f=d[--i],y=d[--i];if(f-y<=u){for(let E=y;E<=f;E++)j(c[2*E],c[2*E+1],t,e)<=l&&(s[a++]=o[E]);continue}let w=y+f>>1,p=c[2*w],g=c[2*w+1];j(p,g,t,e)<=l&&(s[a++]=o[w]),(h===0?t-r<=p:e-r<=g)&&(d[i++]=y,d[i++]=w-1,d[i++]=1-h),(h===0?t+r>=p:e+r>=g)&&(d[i++]=w+1,d[i++]=f,d[i++]=1-h)}return a}};function N(n,t,e,r,s,o){if(s-r<=e)return;let c=r+s>>1;K(n,t,c,r,s,o),N(n,t,e,r,c-1,1-o),N(n,t,e,c+1,s,1-o)}function K(n,t,e,r,s,o){for(;s>r;){if(s-r>600){let a=s-r+1,l=e-r+1,h=Math.log(a),f=.5*Math.exp(2*h/3),y=.5*Math.sqrt(h*f*(a-f)/a)*(l-a/2<0?-1:1),w=Math.max(r,Math.floor(e-l*f/a+y)),p=Math.min(s,Math.floor(e+(a-l)*f/a+y));K(n,t,e,w,p,o)}let c=t[2*e+o],u=r,i=s;for(b(n,t,r,e),t[2*s+o]>c&&b(n,t,r,s);u<i;){for(b(n,t,u,i),u++,i--;t[2*u+o]<c;)u++;for(;t[2*i+o]>c;)i--}t[2*r+o]===c?b(n,t,r,i):(i++,b(n,t,i,s)),i<=e&&(r=i+1),e<=i&&(s=i-1)}}function b(n,t,e,r){O(n,e,r),O(t,2*e,2*r),O(t,2*e+1,2*r+1)}function O(n,t,e){let r=n[t];n[t]=n[e],n[e]=r}function j(n,t,e,r){let s=n-e,o=t-r;return s*s+o*o}var v=class{constructor(){M(this,"index",null);M(this,"xCoords",null);M(this,"yCoords",null)}buildIndex(t){this.clear(),this.xCoords=new Float64Array(t.length),this.yCoords=new Float64Array(t.length);for(let[r,s]of t.entries())this.xCoords[r]=s.x,this.yCoords[r]=s.y;let e=new C(t.length);for(let r=0;r<t.length;r++)e.add(this.xCoords[r],this.yCoords[r]);return e.finish(),this.index=e,e.data}clear(){this.index=null,this.xCoords=null,this.yCoords=null}findNearestPoint(t,e,r){if(!this.index||!this.xCoords||!this.yCoords)return null;let s=this.index.within(t,e,r);if(s.length===0)return null;let o=s[0],c=1/0;for(let u of s){let i=t-this.xCoords[u],a=e-this.yCoords[u],l=i*i+a*a;l<c&&(c=l,o=u)}return{x:this.xCoords[o],y:this.yCoords[o]}}findPointsInRadius(t,e,r){if(!this.index||!this.xCoords||!this.yCoords)return[];let s=this.index.within(t,e,r),o=Array.from({length:s.length});for(let[c,u]of s.entries())o[c]={x:this.xCoords[u],y:this.yCoords[u]};return o}};U(new v);\n/*! Bundled license information:\n\ncomlink/dist/esm/comlink.mjs:\n (**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n *)\n*/\n')}function ln({snapPoints:e,snapRadius:t=50}){let n=useRef(null),r=useRef(null),a=useMemo(()=>{let s=new ie;return r.current=s,st.wrap(s)},[]);useEffect(()=>()=>{r.current&&(r.current.terminate(),r.current=null);},[]);let o=useCallback(async()=>{e&&(n.current=await a.buildIndex(e));},[e,a]);useEffect(()=>{e&&e.length>0&&o();},[e,o]);let i=useCallback(async s=>e?(n.current||await o(),a.findNearestPoint(s.x,s.y,t)):null,[e,t,o,a]),d=useCallback(async s=>e?(n.current||await o(),a.findPointsInRadius(s.x,s.y,t)):[],[e,t,o,a]);return {findNearestPoint:i,findPointsInRadius:d}}
11
11
  export{ke as a,Ke as b,rt as c,ln as d};