@poe-platform/safe-bash 0.1.806 → 0.1.807

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 (856) hide show
  1. package/README.md +4 -0
  2. package/dist/image-ast/portable.d.ts +8 -0
  3. package/dist/image-ast/portable.js +2 -0
  4. package/dist/safe-bash/chunks/{chunk-KRA6WK4Z.js → chunk-3Y54SR4R.js} +6 -6
  5. package/dist/safe-bash/chunks/{chunk-OYJI4L4J.js → chunk-PPAA3LJS.js} +1 -1
  6. package/dist/safe-bash/chunks/{chunk-SCROOJV7.js → chunk-XZ2Y4RWC.js} +2 -2
  7. package/dist/safe-bash/command-chunks/{biff-AU4VGVMD-6EQ64QPG.js → biff-YBHP7ZES-M7TU7NA5.js} +1211 -1205
  8. package/dist/safe-bash/command-chunks/chunk-2A6TBB4F.js +14 -0
  9. package/dist/safe-bash/command-chunks/chunk-2AF7J6FE.js +372 -0
  10. package/dist/safe-bash/command-chunks/{chunk-AITNVBXO.js → chunk-2ANW3FXH.js} +4 -4
  11. package/dist/safe-bash/command-chunks/chunk-2B6XWO6A.js +730 -0
  12. package/dist/safe-bash/command-chunks/chunk-2BKOSQD3.js +11 -0
  13. package/dist/safe-bash/command-chunks/chunk-2EUH5B6A.js +127 -0
  14. package/dist/safe-bash/command-chunks/chunk-2FOLUJLI.js +400 -0
  15. package/dist/safe-bash/command-chunks/{chunk-CZLX3KVF.js → chunk-2GILUQJY.js} +4 -6
  16. package/dist/safe-bash/command-chunks/chunk-2HHGDJ7J.js +280 -0
  17. package/dist/safe-bash/command-chunks/chunk-2NE2GPSF.js +546 -0
  18. package/dist/safe-bash/command-chunks/chunk-2P7BLWWI.js +272 -0
  19. package/dist/safe-bash/command-chunks/chunk-2PSVE7I5.js +101 -0
  20. package/dist/safe-bash/command-chunks/chunk-2UUFZMOH.js +503 -0
  21. package/dist/safe-bash/command-chunks/chunk-2VGAC6S6.js +393 -0
  22. package/dist/safe-bash/command-chunks/chunk-2W54TAGI.js +162 -0
  23. package/dist/safe-bash/command-chunks/chunk-326A5G42.js +328 -0
  24. package/dist/safe-bash/command-chunks/chunk-36KIT4DU.js +218 -0
  25. package/dist/safe-bash/command-chunks/chunk-3CHQG25N.js +455 -0
  26. package/dist/safe-bash/command-chunks/chunk-3JQ3RF2O.js +72 -0
  27. package/dist/safe-bash/command-chunks/chunk-3MLJWSYL.js +92 -0
  28. package/dist/safe-bash/command-chunks/{chunk-ASYR2LU7.js → chunk-3RQCLLQA.js} +5 -5
  29. package/dist/safe-bash/command-chunks/chunk-3SEQG5JH.js +521 -0
  30. package/dist/safe-bash/command-chunks/chunk-3SWT2KYH.js +78 -0
  31. package/dist/safe-bash/command-chunks/chunk-3VETFXYR.js +170 -0
  32. package/dist/safe-bash/command-chunks/chunk-3W6PTHHB.js +65 -0
  33. package/dist/safe-bash/command-chunks/chunk-457CU3IC.js +8 -0
  34. package/dist/safe-bash/command-chunks/chunk-45BW6MGM.js +250 -0
  35. package/dist/safe-bash/command-chunks/chunk-47MFDPH4.js +419 -0
  36. package/dist/safe-bash/command-chunks/chunk-4ATHODCG.js +444 -0
  37. package/dist/safe-bash/command-chunks/chunk-4DJICIFV.js +227 -0
  38. package/dist/safe-bash/command-chunks/chunk-4FNQPK7C.js +385 -0
  39. package/dist/safe-bash/command-chunks/chunk-4LXDJES2.js +65 -0
  40. package/dist/safe-bash/command-chunks/chunk-4QRXKUD2.js +662 -0
  41. package/dist/safe-bash/command-chunks/chunk-4QYNOBWZ.js +455 -0
  42. package/dist/safe-bash/command-chunks/{chunk-MWNWT6HG.js → chunk-4XFFIKA3.js} +5 -5
  43. package/dist/safe-bash/command-chunks/chunk-5AU5ENL5.js +180 -0
  44. package/dist/safe-bash/command-chunks/chunk-5DFZAJHL.js +324 -0
  45. package/dist/safe-bash/command-chunks/chunk-5GEFJROP.js +270 -0
  46. package/dist/safe-bash/command-chunks/chunk-5HWX4XYW.js +263 -0
  47. package/dist/safe-bash/command-chunks/chunk-5LKNP4IF.js +872 -0
  48. package/dist/safe-bash/command-chunks/chunk-5OEHUIVE.js +240 -0
  49. package/dist/safe-bash/command-chunks/chunk-6EHVFKM7.js +171 -0
  50. package/dist/safe-bash/command-chunks/chunk-6JTPLJ3B.js +155 -0
  51. package/dist/safe-bash/command-chunks/chunk-6KLUPQ65.js +496 -0
  52. package/dist/safe-bash/command-chunks/chunk-6NS5RXQ7.js +285 -0
  53. package/dist/safe-bash/command-chunks/chunk-6PJIQEH4.js +3472 -0
  54. package/dist/safe-bash/command-chunks/chunk-763ECQWB.js +566 -0
  55. package/dist/safe-bash/command-chunks/chunk-7DADVPKN.js +23 -0
  56. package/dist/safe-bash/command-chunks/chunk-7LEADSSA.js +164 -0
  57. package/dist/safe-bash/command-chunks/chunk-7MMSBVUP.js +732 -0
  58. package/dist/safe-bash/command-chunks/chunk-7OXNWLSL.js +35 -0
  59. package/dist/safe-bash/command-chunks/chunk-7PZASWL6.js +354 -0
  60. package/dist/safe-bash/command-chunks/{chunk-ZBR3UH4P.js → chunk-7QH3WAMQ.js} +2 -2
  61. package/dist/safe-bash/command-chunks/{chunk-CB3HTIDK.js → chunk-7SOE7XIS.js} +11 -11
  62. package/dist/safe-bash/command-chunks/chunk-7Y3ZQ6FE.js +56 -0
  63. package/dist/safe-bash/command-chunks/chunk-A2YEQYCC.js +289 -0
  64. package/dist/safe-bash/command-chunks/chunk-A3XE767Q.js +502 -0
  65. package/dist/safe-bash/command-chunks/{chunk-MWY75E3F.js → chunk-A6LCBGE6.js} +187 -187
  66. package/dist/safe-bash/command-chunks/{chunk-HFUL6E5I.js → chunk-A7CE4EIU.js} +33 -151
  67. package/dist/safe-bash/command-chunks/chunk-A7EMM3SB.js +297 -0
  68. package/dist/safe-bash/command-chunks/{chunk-G3YO3JIN.js → chunk-ABH5FMMA.js} +1 -1
  69. package/dist/safe-bash/command-chunks/chunk-AEJZEGW7.js +1376 -0
  70. package/dist/safe-bash/command-chunks/chunk-AELXRNM6.js +207 -0
  71. package/dist/safe-bash/command-chunks/chunk-AEZIPWRI.js +260 -0
  72. package/dist/safe-bash/command-chunks/{chunk-AHD3CGAY.js → chunk-AFPXADZG.js} +4 -4
  73. package/dist/safe-bash/command-chunks/chunk-AIOB34IX.js +201 -0
  74. package/dist/safe-bash/command-chunks/chunk-AJEYCC4X.js +262 -0
  75. package/dist/safe-bash/command-chunks/chunk-ALMHXDKZ.js +321 -0
  76. package/dist/safe-bash/command-chunks/chunk-AQ6RTM2M.js +309 -0
  77. package/dist/safe-bash/command-chunks/chunk-AQNFEGMZ.js +481 -0
  78. package/dist/safe-bash/command-chunks/{chunk-2AKKYY5G.js → chunk-ASZ4EMKE.js} +1 -1
  79. package/dist/safe-bash/command-chunks/chunk-AYJGINE5.js +144 -0
  80. package/dist/safe-bash/command-chunks/{chunk-MRFW2E6B.js → chunk-B4UWZCQR.js} +1 -1
  81. package/dist/safe-bash/command-chunks/chunk-BDYKJTBQ.js +43 -0
  82. package/dist/safe-bash/command-chunks/chunk-BERVTMQB.js +41 -0
  83. package/dist/safe-bash/command-chunks/chunk-BZOY2UMP.js +275 -0
  84. package/dist/safe-bash/command-chunks/{chunk-W47KIMSP.js → chunk-C2EYJT4S.js} +1 -1
  85. package/dist/safe-bash/command-chunks/chunk-CK5Q6RDE.js +342 -0
  86. package/dist/safe-bash/command-chunks/chunk-CKEODJVT.js +992 -0
  87. package/dist/safe-bash/command-chunks/{chunk-Z7UIOPHJ.js → chunk-DCMSPMMD.js} +1 -1
  88. package/dist/safe-bash/command-chunks/chunk-DE66JRWJ.js +352 -0
  89. package/dist/safe-bash/command-chunks/chunk-DKNNYPOI.js +409 -0
  90. package/dist/safe-bash/command-chunks/chunk-DV745GFU.js +294 -0
  91. package/dist/safe-bash/command-chunks/chunk-DXX2Z2QA.js +33 -0
  92. package/dist/safe-bash/command-chunks/chunk-E7AYF54A.js +473 -0
  93. package/dist/safe-bash/command-chunks/chunk-EDSFQJAU.js +159 -0
  94. package/dist/safe-bash/command-chunks/{chunk-UQ3KEUCF.js → chunk-ESD5ZD74.js} +7 -1
  95. package/dist/safe-bash/command-chunks/chunk-EUXUCRCI.js +1739 -0
  96. package/dist/safe-bash/command-chunks/chunk-F2ORFLCH.js +3669 -0
  97. package/dist/safe-bash/command-chunks/chunk-FANIWOBM.js +311 -0
  98. package/dist/safe-bash/command-chunks/chunk-FOO3AXFK.js +47 -0
  99. package/dist/safe-bash/command-chunks/chunk-FRZ5P5AB.js +131 -0
  100. package/dist/safe-bash/command-chunks/chunk-FZSQMMYV.js +276 -0
  101. package/dist/safe-bash/command-chunks/{chunk-P6NUIMMX.js → chunk-G5F2VSQ7.js} +1 -1
  102. package/dist/safe-bash/command-chunks/chunk-GGOZXIGH.js +299 -0
  103. package/dist/safe-bash/command-chunks/chunk-GIESJLR2.js +241 -0
  104. package/dist/safe-bash/command-chunks/chunk-GLPIFP7N.js +385 -0
  105. package/dist/safe-bash/command-chunks/chunk-GZ2N24A2.js +342 -0
  106. package/dist/safe-bash/command-chunks/chunk-H2NWPMNW.js +216 -0
  107. package/dist/safe-bash/command-chunks/chunk-HHLVI2CB.js +3949 -0
  108. package/dist/safe-bash/command-chunks/chunk-HJDE7ZNV.js +82 -0
  109. package/dist/safe-bash/command-chunks/chunk-HOAM3F5I.js +124 -0
  110. package/dist/safe-bash/command-chunks/chunk-HPKUFWHW.js +482 -0
  111. package/dist/safe-bash/command-chunks/chunk-HPMVMOD2.js +109 -0
  112. package/dist/safe-bash/command-chunks/chunk-HQAHDJPX.js +8 -0
  113. package/dist/safe-bash/command-chunks/chunk-HR2Y6YEP.js +12 -0
  114. package/dist/safe-bash/command-chunks/chunk-HUNXIAOL.js +62 -0
  115. package/dist/safe-bash/command-chunks/chunk-I4JWZOSP.js +244 -0
  116. package/dist/safe-bash/command-chunks/chunk-I6AMDG2T.js +85 -0
  117. package/dist/safe-bash/command-chunks/chunk-IB2Q5CL3.js +288 -0
  118. package/dist/safe-bash/command-chunks/chunk-IFNLDOJ4.js +316 -0
  119. package/dist/safe-bash/command-chunks/chunk-IKHBXETN.js +174 -0
  120. package/dist/safe-bash/command-chunks/chunk-IOSWG5JS.js +228 -0
  121. package/dist/safe-bash/command-chunks/chunk-IQFRPIXH.js +317 -0
  122. package/dist/safe-bash/command-chunks/chunk-IR6ZKAUH.js +582 -0
  123. package/dist/safe-bash/command-chunks/chunk-IW7PEB4I.js +297 -0
  124. package/dist/safe-bash/command-chunks/chunk-JGGRMERW.js +36 -0
  125. package/dist/safe-bash/command-chunks/chunk-JHAY3KYC.js +520 -0
  126. package/dist/safe-bash/command-chunks/{chunk-UO25D4WG.js → chunk-JITDS55R.js} +22 -22
  127. package/dist/safe-bash/command-chunks/chunk-JJK3CU7Z.js +6 -0
  128. package/dist/safe-bash/command-chunks/{chunk-XKZWUMH4.js → chunk-JN7GNI2C.js} +1 -1
  129. package/dist/safe-bash/command-chunks/chunk-JQ3EJKHF.js +160 -0
  130. package/dist/safe-bash/command-chunks/chunk-JQE256UO.js +292 -0
  131. package/dist/safe-bash/command-chunks/chunk-JQZ3BXWY.js +382 -0
  132. package/dist/safe-bash/command-chunks/{chunk-7DLR4HCC.js → chunk-JWSOFSGI.js} +22 -22
  133. package/dist/safe-bash/command-chunks/chunk-K3CDZMUN.js +168 -0
  134. package/dist/safe-bash/command-chunks/{chunk-SUYSZJI3.js → chunk-K5COUQAQ.js} +4 -4
  135. package/dist/safe-bash/command-chunks/chunk-K7HUXUN2.js +489 -0
  136. package/dist/safe-bash/command-chunks/chunk-KB3CY3QO.js +62 -0
  137. package/dist/safe-bash/command-chunks/chunk-KCBVOYAY.js +92 -0
  138. package/dist/safe-bash/command-chunks/chunk-KD25ICP4.js +366 -0
  139. package/dist/safe-bash/command-chunks/chunk-KDKQ5D55.js +180 -0
  140. package/dist/safe-bash/command-chunks/chunk-KNKDUEDW.js +521 -0
  141. package/dist/safe-bash/command-chunks/chunk-KR2PQ7GD.js +174 -0
  142. package/dist/safe-bash/command-chunks/chunk-KS6WUDPM.js +153 -0
  143. package/dist/safe-bash/command-chunks/{chunk-XFHUSZBM.js → chunk-KUGV3SSL.js} +5 -5
  144. package/dist/safe-bash/command-chunks/chunk-L2JAP5KO.js +249 -0
  145. package/dist/safe-bash/command-chunks/chunk-L2KEA6SN.js +271 -0
  146. package/dist/safe-bash/command-chunks/chunk-L3WY5ASN.js +526 -0
  147. package/dist/safe-bash/command-chunks/chunk-L4XEXXVQ.js +399 -0
  148. package/dist/safe-bash/command-chunks/chunk-LDTUZIJK.js +90 -0
  149. package/dist/safe-bash/command-chunks/chunk-LHDB4QO5.js +479 -0
  150. package/dist/safe-bash/command-chunks/chunk-LHL6RWGJ.js +548 -0
  151. package/dist/safe-bash/command-chunks/chunk-LHRXDH45.js +164 -0
  152. package/dist/safe-bash/command-chunks/chunk-LQOKYG3O.js +153 -0
  153. package/dist/safe-bash/command-chunks/chunk-LRDME6WV.js +12 -0
  154. package/dist/safe-bash/command-chunks/chunk-LWVDJB5S.js +305 -0
  155. package/dist/safe-bash/command-chunks/chunk-M57GLLK4.js +27 -0
  156. package/dist/safe-bash/command-chunks/chunk-MAHX3IW3.js +108 -0
  157. package/dist/safe-bash/command-chunks/{chunk-LQZSR6DT.js → chunk-MDV7W5AS.js} +2 -2
  158. package/dist/safe-bash/command-chunks/chunk-MG7AJD5E.js +168 -0
  159. package/dist/safe-bash/command-chunks/chunk-MHJ3DQUE.js +213 -0
  160. package/dist/safe-bash/command-chunks/chunk-MLGNBD7V.js +552 -0
  161. package/dist/safe-bash/command-chunks/chunk-MN2M33JK.js +237 -0
  162. package/dist/safe-bash/command-chunks/chunk-MOL3TRBT.js +32 -0
  163. package/dist/safe-bash/command-chunks/chunk-MQFXMBGD.js +75 -0
  164. package/dist/safe-bash/command-chunks/chunk-MQPWE22J.js +171 -0
  165. package/dist/safe-bash/command-chunks/chunk-MQU6Q75R.js +523 -0
  166. package/dist/safe-bash/command-chunks/chunk-MWAAMNAM.js +353 -0
  167. package/dist/safe-bash/command-chunks/chunk-MZ4BTMTI.js +240 -0
  168. package/dist/safe-bash/command-chunks/chunk-N4DY4FPA.js +679 -0
  169. package/dist/safe-bash/command-chunks/chunk-N74TJL6X.js +183 -0
  170. package/dist/safe-bash/command-chunks/chunk-NA5Q4V2H.js +304 -0
  171. package/dist/safe-bash/command-chunks/chunk-NSM366N6.js +22 -0
  172. package/dist/safe-bash/command-chunks/chunk-NY4ZPV3N.js +523 -0
  173. package/dist/safe-bash/command-chunks/chunk-NYBF2BVE.js +17 -0
  174. package/dist/safe-bash/command-chunks/chunk-OBK24KGM.js +24 -0
  175. package/dist/safe-bash/command-chunks/{chunk-GDAS4LY7.js → chunk-OEKLEUUW.js} +4 -4
  176. package/dist/safe-bash/command-chunks/chunk-OGWJD5QP.js +404 -0
  177. package/dist/safe-bash/command-chunks/chunk-OIPATOZW.js +154 -0
  178. package/dist/safe-bash/command-chunks/chunk-OP6J3OLL.js +243 -0
  179. package/dist/safe-bash/command-chunks/chunk-OTTMIB3C.js +266 -0
  180. package/dist/safe-bash/command-chunks/{chunk-OZHPB4KD.js → chunk-OU4VE5CR.js} +12 -12
  181. package/dist/safe-bash/command-chunks/chunk-P42REFYL.js +228 -0
  182. package/dist/safe-bash/command-chunks/{chunk-YJ3TFZB2.js → chunk-PQOAM5SC.js} +1 -1
  183. package/dist/safe-bash/command-chunks/chunk-PQOIOVF2.js +444 -0
  184. package/dist/safe-bash/command-chunks/chunk-PRQEVUNE.js +205 -0
  185. package/dist/safe-bash/command-chunks/{chunk-W5OR7COJ.js → chunk-PVLPWVRH.js} +21 -21
  186. package/dist/safe-bash/command-chunks/{chunk-BNG4ZMZ3.js → chunk-PXL4NBYP.js} +1 -78
  187. package/dist/safe-bash/command-chunks/chunk-Q6W5FRZG.js +41 -0
  188. package/dist/safe-bash/command-chunks/{chunk-KLCHCSIV.js → chunk-QGD64UHJ.js} +1 -1
  189. package/dist/safe-bash/command-chunks/chunk-QHS7PDG3.js +188 -0
  190. package/dist/safe-bash/command-chunks/chunk-QXCSASIE.js +151 -0
  191. package/dist/safe-bash/command-chunks/chunk-QYCBVKFT.js +255 -0
  192. package/dist/safe-bash/command-chunks/chunk-R4TYL2G6.js +1529 -0
  193. package/dist/safe-bash/command-chunks/chunk-RAXJVM4U.js +625 -0
  194. package/dist/safe-bash/command-chunks/chunk-RBFZYSZZ.js +207 -0
  195. package/dist/safe-bash/command-chunks/chunk-RJHVJZ4H.js +185 -0
  196. package/dist/safe-bash/command-chunks/chunk-RKPPUYZE.js +213 -0
  197. package/dist/safe-bash/command-chunks/chunk-RMJNV6Q7.js +23 -0
  198. package/dist/safe-bash/command-chunks/{chunk-MR2RLUPV.js → chunk-RQHQCJMV.js} +11 -9
  199. package/dist/safe-bash/command-chunks/chunk-RR6QQ25D.js +71 -0
  200. package/dist/safe-bash/command-chunks/{chunk-JW3KIZU6.js → chunk-RUXY7GN5.js} +1 -1
  201. package/dist/safe-bash/command-chunks/chunk-RZC7QHL6.js +112 -0
  202. package/dist/safe-bash/command-chunks/chunk-RZJRR4UJ.js +1677 -0
  203. package/dist/safe-bash/command-chunks/chunk-S4OBYRNI.js +639 -0
  204. package/dist/safe-bash/command-chunks/{chunk-DQNDEWCI.js → chunk-S65T5JJO.js} +12 -12
  205. package/dist/safe-bash/command-chunks/chunk-S6PPBBXX.js +77 -0
  206. package/dist/safe-bash/command-chunks/chunk-SCG4LK5U.js +265 -0
  207. package/dist/safe-bash/command-chunks/chunk-SDTC2BLK.js +143 -0
  208. package/dist/safe-bash/command-chunks/chunk-SEK43FRN.js +357 -0
  209. package/dist/safe-bash/command-chunks/chunk-SH45NZ2P.js +194 -0
  210. package/dist/safe-bash/command-chunks/chunk-SM733XRT.js +250 -0
  211. package/dist/safe-bash/command-chunks/chunk-SSRGI476.js +116 -0
  212. package/dist/safe-bash/command-chunks/chunk-SUUD352U.js +127 -0
  213. package/dist/safe-bash/command-chunks/{chunk-B5F2KQYA.js → chunk-SWUVHT7G.js} +1 -1
  214. package/dist/safe-bash/command-chunks/chunk-TBAH4XGI.js +38 -0
  215. package/dist/safe-bash/command-chunks/chunk-TBVWTZTR.js +469 -0
  216. package/dist/safe-bash/command-chunks/chunk-TGHQGJNR.js +144 -0
  217. package/dist/safe-bash/command-chunks/{chunk-Q6JLT2EY.js → chunk-TL3KDYEM.js} +8 -110
  218. package/dist/safe-bash/command-chunks/chunk-TVAEX4WQ.js +473 -0
  219. package/dist/safe-bash/command-chunks/chunk-TZ2J6LGM.js +163 -0
  220. package/dist/safe-bash/command-chunks/chunk-UICO7H6S.js +186 -0
  221. package/dist/safe-bash/command-chunks/chunk-UJTJFMIN.js +501 -0
  222. package/dist/safe-bash/command-chunks/chunk-UMWWCLBG.js +109 -0
  223. package/dist/safe-bash/command-chunks/chunk-UPXFSGQG.js +134 -0
  224. package/dist/safe-bash/command-chunks/chunk-UWUYSXYT.js +272 -0
  225. package/dist/safe-bash/command-chunks/{chunk-5FMXQUDY.js → chunk-UZOGSYJP.js} +1 -1
  226. package/dist/safe-bash/command-chunks/chunk-V3RGA5PS.js +125 -0
  227. package/dist/safe-bash/command-chunks/chunk-VEUQWV2V.js +287 -0
  228. package/dist/safe-bash/command-chunks/chunk-VGKYTZT5.js +161 -0
  229. package/dist/safe-bash/command-chunks/chunk-VQUEIEVP.js +410 -0
  230. package/dist/safe-bash/command-chunks/chunk-VU3YUC3U.js +169 -0
  231. package/dist/safe-bash/command-chunks/chunk-W32KW66B.js +27 -0
  232. package/dist/safe-bash/command-chunks/chunk-W543LSYH.js +899 -0
  233. package/dist/safe-bash/command-chunks/chunk-W5YFDYHO.js +387 -0
  234. package/dist/safe-bash/command-chunks/chunk-W6DV2CLS.js +267 -0
  235. package/dist/safe-bash/command-chunks/chunk-WAKYUXVQ.js +215 -0
  236. package/dist/safe-bash/command-chunks/chunk-WGOL3MM6.js +125 -0
  237. package/dist/safe-bash/command-chunks/{chunk-N2A7V3WY.js → chunk-WHNYT34N.js} +3 -3
  238. package/dist/safe-bash/command-chunks/chunk-WOZCIRJ5.js +169 -0
  239. package/dist/safe-bash/command-chunks/chunk-WVB6ONZS.js +232 -0
  240. package/dist/safe-bash/command-chunks/chunk-WVESNAND.js +25 -0
  241. package/dist/safe-bash/command-chunks/chunk-XDEA3TL5.js +322 -0
  242. package/dist/safe-bash/command-chunks/chunk-XFEUWSYG.js +357 -0
  243. package/dist/safe-bash/command-chunks/chunk-XFMJ4RMS.js +2849 -0
  244. package/dist/safe-bash/command-chunks/chunk-XH6DXJHX.js +196 -0
  245. package/dist/safe-bash/command-chunks/chunk-XNJ67APB.js +6 -0
  246. package/dist/safe-bash/command-chunks/chunk-XP6BHGZ6.js +227 -0
  247. package/dist/safe-bash/command-chunks/chunk-XXFHTGV2.js +142 -0
  248. package/dist/safe-bash/command-chunks/chunk-Y5GI5PVT.js +139 -0
  249. package/dist/safe-bash/command-chunks/chunk-Y6KHC3JB.js +177 -0
  250. package/dist/safe-bash/command-chunks/{chunk-2UWPMSME.js → chunk-Y72LPXST.js} +8 -8
  251. package/dist/safe-bash/command-chunks/chunk-YDRWQZNB.js +69 -0
  252. package/dist/safe-bash/command-chunks/{chunk-P4OJBL2B.js → chunk-YFZ6FPIC.js} +1 -1
  253. package/dist/safe-bash/command-chunks/chunk-YH4DC4RP.js +171 -0
  254. package/dist/safe-bash/command-chunks/chunk-YH7KKMMN.js +463 -0
  255. package/dist/safe-bash/command-chunks/{chunk-MN3BB4WW.js → chunk-YP3WWV5N.js} +4 -4
  256. package/dist/safe-bash/command-chunks/chunk-YPVBU7QF.js +2817 -0
  257. package/dist/safe-bash/command-chunks/chunk-YQYVEVUE.js +1621 -0
  258. package/dist/safe-bash/command-chunks/chunk-YRNBIU5U.js +175 -0
  259. package/dist/safe-bash/command-chunks/chunk-Z7ESJVFP.js +10 -0
  260. package/dist/safe-bash/command-chunks/chunk-ZTAFAHY3.js +653 -0
  261. package/dist/safe-bash/command-chunks/chunk-ZXKOMB24.js +85 -0
  262. package/dist/safe-bash/command-chunks/{clipboard-XCSQACOK-SHFXT53F.js → clipboard-6SDGQGC3-TVJ3CG7A.js} +4 -4
  263. package/dist/safe-bash/command-chunks/{command-engine-4TEGTXCQ.js → command-engine-KMLHVFMA.js} +356 -316
  264. package/dist/safe-bash/command-chunks/{engine-QDC5VCGO-LYAAFESF.js → engine-EOYR2WTY-KUFLFTDE.js} +2 -4
  265. package/dist/safe-bash/command-chunks/{gnumeric-OCFH63UT-YI7SG7TN.js → gnumeric-ABKSRBZJ-MPIIPXKP.js} +3 -3
  266. package/dist/safe-bash/command-chunks/inspection-command-ULEU7ZVV.js +7 -0
  267. package/dist/safe-bash/command-chunks/model-store-JUFU3RSW.js +54 -0
  268. package/dist/safe-bash/command-chunks/pdf-22JDKKAR-UDWNSWYB.js +338 -0
  269. package/dist/safe-bash/command-chunks/{pptx-XG3YSXWZ-XAG36NAB.js → pptx-YDKHIGCD-H7FU4VMJ.js} +2 -2
  270. package/dist/safe-bash/commands/bc/index.browser.js +2 -2
  271. package/dist/safe-bash/commands/diffpdf/index.d.ts +2 -0
  272. package/dist/safe-bash/commands/diffpdf/index.js +2 -0
  273. package/dist/safe-bash/commands/dot/index.d.ts +2 -0
  274. package/dist/safe-bash/commands/dot/index.js +2 -0
  275. package/dist/safe-bash/commands/llm/collections.browser.js +6 -0
  276. package/dist/safe-bash/commands/llm/collections.d.ts +2 -0
  277. package/dist/safe-bash/commands/llm/collections.js +2 -0
  278. package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
  279. package/dist/safe-bash/commands/rsvg-convert/index.d.ts +2 -0
  280. package/dist/safe-bash/commands/rsvg-convert/index.js +2 -0
  281. package/dist/safe-bash/commands/safejs/io.d.ts +1 -1
  282. package/dist/safe-bash/commands/safejs/io.js +1 -1
  283. package/dist/safe-bash/commands/safejs/options.d.ts +1 -1
  284. package/dist/safe-bash/commands/safejs/options.js +1 -1
  285. package/dist/safe-bash/commands/safejs/render.d.ts +1 -1
  286. package/dist/safe-bash/commands/safejs/render.js +1 -1
  287. package/dist/safe-bash/commands/safejs/runtime.d.ts +1 -1
  288. package/dist/safe-bash/commands/safejs/runtime.js +1 -1
  289. package/dist/safe-bash/commands/safejs/types.d.ts +1 -1
  290. package/dist/safe-bash/commands/safejs/types.js +1 -1
  291. package/dist/safe-bash/commands/wdiff/index.d.ts +2 -0
  292. package/dist/safe-bash/commands/wdiff/index.js +2 -0
  293. package/dist/safe-bash/core.d.ts +4 -0
  294. package/dist/safe-bash/core.js +4 -0
  295. package/dist/safe-bash/full-core.browser.js +59 -35
  296. package/dist/safe-bash/optional-host.browser.js +7 -7
  297. package/dist/safe-bash/plugins/index.browser.js +7 -7
  298. package/dist/safe-bash/registry-entry.browser.js +6 -6
  299. package/dist/safe-bash/search.browser.js +2 -2
  300. package/dist/safe-bash/shell-entry.browser.js +3 -3
  301. package/dist/safe-bash-checksum-engine/index.js +83 -40
  302. package/dist/safe-bash-checksum-engine/md5.d.ts +2 -0
  303. package/dist/safe-bash-checksum-engine/md5.js +7 -0
  304. package/dist/safe-bash-command-awk/awk-inspection.js +2 -2
  305. package/dist/safe-bash-command-awk/awk-runtime.js +2 -2
  306. package/dist/safe-bash-command-awk/awk.js +7 -7
  307. package/dist/safe-bash-command-awk/index.js +7 -7
  308. package/dist/safe-bash-command-chmod/command.js +1 -1
  309. package/dist/safe-bash-command-chmod/index.js +1 -1
  310. package/dist/safe-bash-command-csvkit/index.js +6 -6
  311. package/dist/safe-bash-command-diff/index.js +3 -3
  312. package/dist/safe-bash-command-diffpdf/LICENSE +21 -0
  313. package/dist/safe-bash-command-diffpdf/index.d.ts +12 -0
  314. package/dist/safe-bash-command-diffpdf/index.js +107 -0
  315. package/dist/safe-bash-command-docx/command.d.ts +36 -0
  316. package/dist/{safe-bash-docx-engine → safe-bash-command-docx}/discovery.d.ts +4 -4
  317. package/dist/safe-bash-command-docx/index.js +1 -1
  318. package/dist/{safe-bash-docx-engine → safe-bash-command-docx}/inspection-command.d.ts +6 -6
  319. package/dist/safe-bash-command-docx/sdk.d.ts +4 -0
  320. package/dist/safe-bash-command-docx/sdk.js +24 -0
  321. package/dist/safe-bash-command-dot/LICENSE +21 -0
  322. package/dist/safe-bash-command-dot/index.d.ts +14 -0
  323. package/dist/safe-bash-command-dot/index.js +1298 -0
  324. package/dist/safe-bash-command-du/arguments.d.ts +1 -1
  325. package/dist/safe-bash-command-du/arguments.js +1 -1
  326. package/dist/safe-bash-command-du/du.js +2 -2
  327. package/dist/safe-bash-command-du/index.js +2 -2
  328. package/dist/safe-bash-command-factor/command.js +2 -2
  329. package/dist/safe-bash-command-factor/index.js +2 -2
  330. package/dist/safe-bash-command-ffmpeg/index.js +16 -16
  331. package/dist/safe-bash-command-imagemagick/index.js +21 -53
  332. package/dist/safe-bash-command-llm/collections-embed.d.ts +23 -0
  333. package/dist/safe-bash-command-llm/collections.d.ts +38 -0
  334. package/dist/safe-bash-command-llm/collections.js +423 -0
  335. package/dist/safe-bash-command-llm/command.js +4 -2
  336. package/dist/safe-bash-command-llm/index.js +12 -8
  337. package/dist/safe-bash-command-llm/openai.js +4 -3
  338. package/dist/safe-bash-command-llm/providers/index.js +6 -4
  339. package/dist/safe-bash-command-llm/providers/openai.js +4 -3
  340. package/dist/safe-bash-command-node/commands/node/browser.js +9 -12
  341. package/dist/safe-bash-command-node/commands/node/buffer.js +2 -2
  342. package/dist/safe-bash-command-node/commands/node/default-runtime.js +9 -12
  343. package/dist/safe-bash-command-node/commands/node/filesystem.js +3 -3
  344. package/dist/safe-bash-command-node/commands/node/safejs.js +9 -12
  345. package/dist/safe-bash-command-node/commands/node/source-maps.js +2 -2
  346. package/dist/safe-bash-command-node/commands/node/timers.js +3 -3
  347. package/dist/safe-bash-command-node/commands/safejs/io.d.ts +1 -35
  348. package/dist/safe-bash-command-node/commands/safejs/io.js +3 -7
  349. package/dist/safe-bash-command-node/commands/safejs/options.d.ts +2 -22
  350. package/dist/safe-bash-command-node/commands/safejs/options.js +1 -1
  351. package/dist/safe-bash-command-node/commands/safejs/render.d.ts +1 -1
  352. package/dist/safe-bash-command-node/commands/safejs/render.js +3 -5
  353. package/dist/safe-bash-command-node/commands/safejs/runtime.d.ts +2 -25
  354. package/dist/safe-bash-command-node/commands/safejs/runtime.js +1 -7
  355. package/dist/safe-bash-command-node/commands/safejs/types.d.ts +2 -85
  356. package/dist/safe-bash-command-node/commands/safejs/types.js +1 -1
  357. package/dist/safe-bash-command-node/integrations/safejs/filesystem.d.ts +2 -5
  358. package/dist/safe-bash-command-node/integrations/safejs/filesystem.js +3 -3
  359. package/dist/safe-bash-command-node/integrations/safejs/shell.js +1 -1
  360. package/dist/safe-bash-command-node/integrations/safejs/values.d.ts +1 -7
  361. package/dist/safe-bash-command-node/integrations/safejs/values.js +1 -1
  362. package/dist/safe-bash-command-openssl/index.js +15452 -420
  363. package/dist/safe-bash-command-pandoc/command.js +1 -1
  364. package/dist/safe-bash-command-pandoc/index.js +1 -1
  365. package/dist/safe-bash-command-patch/index.js +5 -5
  366. package/dist/safe-bash-command-patch/patch.js +4 -4
  367. package/dist/safe-bash-command-playwright-cli/index.js +25 -25
  368. package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +8 -8
  369. package/dist/safe-bash-command-playwright-cli/playwright/controller.js +16 -16
  370. package/dist/safe-bash-command-playwright-cli/playwright/index.js +25 -25
  371. package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +4 -4
  372. package/dist/{safe-bash-pptx-engine → safe-bash-command-pptx}/command-engine.d.ts +5 -13
  373. package/dist/safe-bash-command-pptx/engine.d.ts +4 -0
  374. package/dist/safe-bash-command-pptx/engine.js +37 -0
  375. package/dist/safe-bash-command-pptx/index.js +1 -1
  376. package/dist/safe-bash-command-python/executor.js +15 -15
  377. package/dist/safe-bash-command-python/index.js +15 -15
  378. package/dist/safe-bash-command-python/jspi.js +4 -4
  379. package/dist/safe-bash-command-qrencode/index.js +1 -4
  380. package/dist/safe-bash-command-rsvg-convert/LICENSE +21 -0
  381. package/dist/safe-bash-command-rsvg-convert/index.d.ts +13 -0
  382. package/dist/safe-bash-command-rsvg-convert/index.js +84 -0
  383. package/dist/safe-bash-command-safejs/LICENSE +21 -0
  384. package/dist/safe-bash-command-safejs/filesystem.d.ts +5 -0
  385. package/dist/safe-bash-command-safejs/filesystem.js +7 -0
  386. package/dist/safe-bash-command-safejs/index.d.ts +4 -0
  387. package/dist/safe-bash-command-safejs/index.js +19 -0
  388. package/dist/safe-bash-command-safejs/io.d.ts +35 -0
  389. package/dist/safe-bash-command-safejs/io.js +12 -0
  390. package/dist/safe-bash-command-safejs/options.d.ts +22 -0
  391. package/dist/safe-bash-command-safejs/options.js +11 -0
  392. package/dist/safe-bash-command-safejs/render.d.ts +1 -0
  393. package/dist/safe-bash-command-safejs/render.js +9 -0
  394. package/dist/safe-bash-command-safejs/runtime.d.ts +25 -0
  395. package/dist/safe-bash-command-safejs/runtime.js +13 -0
  396. package/dist/safe-bash-command-safejs/types.d.ts +85 -0
  397. package/dist/safe-bash-command-safejs/types.js +7 -0
  398. package/dist/safe-bash-command-safejs/values.d.ts +7 -0
  399. package/dist/safe-bash-command-safejs/values.js +19 -0
  400. package/dist/safe-bash-command-sips/index.js +1 -14
  401. package/dist/safe-bash-command-ssconvert/index.js +413 -546
  402. package/dist/safe-bash-command-ssconvert/rendering/chart/axis.d.ts +1 -26
  403. package/dist/safe-bash-command-ssconvert/rendering/chart/error-bar.d.ts +1 -39
  404. package/dist/safe-bash-command-ssconvert/rendering/chart/layout.d.ts +1 -24
  405. package/dist/safe-bash-command-ssconvert/rendering/chart/line.d.ts +1 -23
  406. package/dist/safe-bash-command-ssconvert/rendering/chart/marker.d.ts +1 -35
  407. package/dist/safe-bash-command-ssconvert/rendering/chart/pie.d.ts +1 -32
  408. package/dist/safe-bash-command-ssconvert/rendering/images/index.d.ts +1 -26
  409. package/dist/safe-bash-command-ssconvert/rendering/print/header-footer.d.ts +1 -16
  410. package/dist/safe-bash-command-ssconvert/rendering/print/layout.d.ts +1 -65
  411. package/dist/safe-bash-command-ssconvert/rendering/print/pagination.d.ts +1 -34
  412. package/dist/safe-bash-command-tar/create.js +4 -4
  413. package/dist/safe-bash-command-tar/extract.js +4 -4
  414. package/dist/safe-bash-command-tar/index.js +16 -14
  415. package/dist/safe-bash-command-tar/modes.js +6 -6
  416. package/dist/safe-bash-command-tar/options.d.ts +3 -1
  417. package/dist/safe-bash-command-tar/options.js +1 -1
  418. package/dist/safe-bash-command-unzip/index.js +4 -4
  419. package/dist/safe-bash-command-wdiff/LICENSE +21 -0
  420. package/dist/safe-bash-command-wdiff/index.d.ts +12 -0
  421. package/dist/safe-bash-command-wdiff/index.js +123 -0
  422. package/dist/safe-bash-compression-engine/bounded-codec.js +2 -2
  423. package/dist/safe-bash-compression-engine/codec-loader.js +1 -1
  424. package/dist/safe-bash-compression-engine/files.js +5 -5
  425. package/dist/safe-bash-compression-engine/index.js +4 -4
  426. package/dist/safe-bash-compression-engine/operand.js +5 -5
  427. package/dist/safe-bash-compression-engine/stream.js +4 -4
  428. package/dist/safe-bash-compression-engine/zstd-decode.js +3 -3
  429. package/dist/safe-bash-contracts/escaping.js +2 -2
  430. package/dist/safe-bash-contracts/index.js +15 -15
  431. package/dist/safe-bash-docx-engine/admission.js +31 -0
  432. package/dist/safe-bash-docx-engine/ancillary-resources.js +38 -0
  433. package/dist/safe-bash-docx-engine/archive.js +24 -0
  434. package/dist/safe-bash-docx-engine/argument-json.js +25 -0
  435. package/dist/safe-bash-docx-engine/batch-operations.d.ts +7 -0
  436. package/dist/safe-bash-docx-engine/batch-operations.js +95 -0
  437. package/dist/safe-bash-docx-engine/batch-result-schema.d.ts +2 -0
  438. package/dist/safe-bash-docx-engine/batch-result-schema.js +145 -0
  439. package/dist/safe-bash-docx-engine/batch.js +106 -0
  440. package/dist/safe-bash-docx-engine/bookmarks.js +43 -0
  441. package/dist/safe-bash-docx-engine/budget.js +18 -0
  442. package/dist/safe-bash-docx-engine/charts.js +35 -0
  443. package/dist/safe-bash-docx-engine/command-option-rules.d.ts +1 -0
  444. package/dist/safe-bash-docx-engine/command-option-rules.js +24 -0
  445. package/dist/safe-bash-docx-engine/command-properties.d.ts +1 -0
  446. package/dist/safe-bash-docx-engine/command-properties.js +18 -0
  447. package/dist/safe-bash-docx-engine/command-selection.d.ts +1 -0
  448. package/dist/safe-bash-docx-engine/command-selection.js +15 -0
  449. package/dist/safe-bash-docx-engine/comments.js +53 -0
  450. package/dist/safe-bash-docx-engine/control-bindings.js +45 -0
  451. package/dist/safe-bash-docx-engine/control-repeat.js +46 -0
  452. package/dist/safe-bash-docx-engine/controls.js +52 -0
  453. package/dist/safe-bash-docx-engine/create.js +36 -0
  454. package/dist/safe-bash-docx-engine/diagrams.js +43 -0
  455. package/dist/safe-bash-docx-engine/diff.js +33 -0
  456. package/dist/safe-bash-docx-engine/discovery-result-schema.d.ts +72 -0
  457. package/dist/safe-bash-docx-engine/discovery-result-schema.js +36 -0
  458. package/dist/safe-bash-docx-engine/document-properties.js +43 -0
  459. package/dist/safe-bash-docx-engine/equations.js +53 -0
  460. package/dist/safe-bash-docx-engine/extract.js +40 -0
  461. package/dist/safe-bash-docx-engine/fields.js +48 -0
  462. package/dist/safe-bash-docx-engine/font-inventory.js +40 -0
  463. package/dist/safe-bash-docx-engine/font-resources.js +33 -0
  464. package/dist/safe-bash-docx-engine/image-batch-operations.d.ts +4 -0
  465. package/dist/safe-bash-docx-engine/image-batch-operations.js +35 -0
  466. package/dist/safe-bash-docx-engine/image-insertion.js +46 -0
  467. package/dist/safe-bash-docx-engine/image-layout.js +43 -0
  468. package/dist/safe-bash-docx-engine/image-replacement.js +48 -0
  469. package/dist/safe-bash-docx-engine/images.js +49 -0
  470. package/dist/safe-bash-docx-engine/index.d.ts +1 -3
  471. package/dist/safe-bash-docx-engine/index.js +369 -19350
  472. package/dist/safe-bash-docx-engine/inspection.js +49 -0
  473. package/dist/safe-bash-docx-engine/invocation.d.ts +50 -0
  474. package/dist/safe-bash-docx-engine/invocation.js +66 -0
  475. package/dist/safe-bash-docx-engine/io-errors.js +11 -0
  476. package/dist/safe-bash-docx-engine/io.js +29 -0
  477. package/dist/safe-bash-docx-engine/links.js +47 -0
  478. package/dist/safe-bash-docx-engine/lists.js +46 -0
  479. package/dist/safe-bash-docx-engine/location-token.js +27 -0
  480. package/dist/safe-bash-docx-engine/locations.js +39 -0
  481. package/dist/safe-bash-docx-engine/model-context.js +15 -0
  482. package/dist/safe-bash-docx-engine/model-errors.js +13 -0
  483. package/dist/safe-bash-docx-engine/notes.js +48 -0
  484. package/dist/safe-bash-docx-engine/objects.js +49 -0
  485. package/dist/safe-bash-docx-engine/operation-json-schema.js +21 -0
  486. package/dist/safe-bash-docx-engine/operation-schema.js +29 -0
  487. package/dist/safe-bash-docx-engine/pack-uri-batch-operations.d.ts +3 -0
  488. package/dist/safe-bash-docx-engine/pack-uri-batch-operations.js +15 -0
  489. package/dist/safe-bash-docx-engine/pack.js +38 -0
  490. package/dist/safe-bash-docx-engine/package-view-batch-operations.d.ts +4 -0
  491. package/dist/safe-bash-docx-engine/package-view-batch-operations.js +47 -0
  492. package/dist/safe-bash-docx-engine/package-xml.js +25 -0
  493. package/dist/safe-bash-docx-engine/pandoc-adapter.js +55 -6
  494. package/dist/safe-bash-docx-engine/paragraph-edit.js +52 -0
  495. package/dist/safe-bash-docx-engine/part-provider.js +18 -0
  496. package/dist/safe-bash-docx-engine/property-values.js +46 -0
  497. package/dist/safe-bash-docx-engine/publication.js +40 -0
  498. package/dist/safe-bash-docx-engine/removal.js +44 -0
  499. package/dist/safe-bash-docx-engine/revision-decisions.js +46 -0
  500. package/dist/safe-bash-docx-engine/revision-edit.js +43 -0
  501. package/dist/safe-bash-docx-engine/revisions.js +42 -0
  502. package/dist/safe-bash-docx-engine/run-format.js +43 -0
  503. package/dist/safe-bash-docx-engine/sanitize.js +59 -0
  504. package/dist/safe-bash-docx-engine/sections.js +47 -0
  505. package/dist/safe-bash-docx-engine/settings.js +36 -0
  506. package/dist/safe-bash-docx-engine/shape-edit.js +47 -0
  507. package/dist/safe-bash-docx-engine/signatures.js +42 -0
  508. package/dist/safe-bash-docx-engine/simple-selection.d.ts +1 -1
  509. package/dist/safe-bash-docx-engine/stories.js +48 -0
  510. package/dist/safe-bash-docx-engine/structure-model-batch-operations.d.ts +3 -0
  511. package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +64 -0
  512. package/dist/safe-bash-docx-engine/style-model-batch-operations.js +57 -0
  513. package/dist/safe-bash-docx-engine/style-model-result-schema.d.ts +4 -0
  514. package/dist/safe-bash-docx-engine/style-model-result-schema.js +76 -0
  515. package/dist/safe-bash-docx-engine/styles.js +44 -0
  516. package/dist/safe-bash-docx-engine/table-edit.js +52 -0
  517. package/dist/safe-bash-docx-engine/table-read.js +38 -0
  518. package/dist/safe-bash-docx-engine/template.js +45 -0
  519. package/dist/safe-bash-docx-engine/text-replace.js +47 -0
  520. package/dist/safe-bash-docx-engine/text-resource-read.js +42 -0
  521. package/dist/safe-bash-docx-engine/text.js +36 -0
  522. package/dist/safe-bash-docx-engine/validation.js +30 -0
  523. package/dist/safe-bash-docx-engine/xml-parts.js +48 -0
  524. package/dist/safe-bash-markdown-engine/index.js +3 -3
  525. package/dist/safe-bash-network-engine/aggregate.js +3 -3
  526. package/dist/safe-bash-network-engine/args.js +3 -3
  527. package/dist/safe-bash-network-engine/body.js +4 -4
  528. package/dist/safe-bash-network-engine/decode.js +3 -3
  529. package/dist/safe-bash-network-engine/fetch-transport.js +3 -3
  530. package/dist/safe-bash-network-engine/index.js +3 -3
  531. package/dist/safe-bash-network-engine/output.js +3 -3
  532. package/dist/safe-bash-network-engine/platform-portable.js +3 -3
  533. package/dist/safe-bash-network-engine/shared.js +2 -2
  534. package/dist/safe-bash-network-engine/transfer.js +20 -20
  535. package/dist/safe-bash-pptx-engine/bytes.d.ts +1 -4
  536. package/dist/safe-bash-pptx-engine/bytes.js +2 -11
  537. package/dist/safe-bash-pptx-engine/index.d.ts +1 -103
  538. package/dist/safe-bash-pptx-engine/index.js +1 -662
  539. package/dist/safe-bash-presentation-engine/LICENSE +21 -0
  540. package/dist/safe-bash-presentation-engine/accessibility.js +43 -0
  541. package/dist/safe-bash-presentation-engine/animation-editing.js +29 -0
  542. package/dist/safe-bash-presentation-engine/animations.js +23 -0
  543. package/dist/safe-bash-presentation-engine/backgrounds.js +26 -0
  544. package/dist/safe-bash-presentation-engine/bytes.d.ts +4 -0
  545. package/dist/safe-bash-presentation-engine/bytes.js +13 -0
  546. package/dist/safe-bash-presentation-engine/chart-editing.js +60 -0
  547. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-enums.d.ts +2 -2
  548. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-object-operations.d.ts +1 -1
  549. package/dist/safe-bash-presentation-engine/chart-object-operations.js +35 -0
  550. package/dist/safe-bash-presentation-engine/charts.js +41 -0
  551. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/color-enums.d.ts +5 -5
  552. package/dist/safe-bash-presentation-engine/command-placeholder.js +64 -0
  553. package/dist/safe-bash-presentation-engine/comments.js +32 -0
  554. package/dist/safe-bash-presentation-engine/connector-operations.js +50 -0
  555. package/dist/safe-bash-presentation-engine/connectors.js +49 -0
  556. package/dist/safe-bash-presentation-engine/content-types.js +9 -0
  557. package/dist/safe-bash-presentation-engine/contracts.js +0 -0
  558. package/dist/safe-bash-presentation-engine/creation.js +15 -0
  559. package/dist/safe-bash-presentation-engine/diff.js +40 -0
  560. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/drawing-enums.d.ts +20 -20
  561. package/dist/safe-bash-presentation-engine/drawing-format.js +44 -0
  562. package/dist/safe-bash-presentation-engine/drawing-operations.js +41 -0
  563. package/dist/safe-bash-presentation-engine/drawing-schema.d.ts +1549 -0
  564. package/dist/safe-bash-presentation-engine/drawing-schema.js +33 -0
  565. package/dist/safe-bash-presentation-engine/equations.js +30 -0
  566. package/dist/safe-bash-presentation-engine/errors.js +23 -0
  567. package/dist/safe-bash-presentation-engine/fields.js +32 -0
  568. package/dist/safe-bash-presentation-engine/font-metrics.js +12 -0
  569. package/dist/safe-bash-presentation-engine/image-extraction.js +29 -0
  570. package/dist/safe-bash-presentation-engine/image-formatting.js +43 -0
  571. package/dist/safe-bash-presentation-engine/image-insertion.js +26 -0
  572. package/dist/safe-bash-presentation-engine/image-metadata.d.ts +9 -0
  573. package/dist/safe-bash-presentation-engine/image-metadata.js +9 -0
  574. package/dist/safe-bash-presentation-engine/image-replacement.js +30 -0
  575. package/dist/safe-bash-presentation-engine/image-value.js +15 -0
  576. package/dist/safe-bash-presentation-engine/images.js +30 -0
  577. package/dist/safe-bash-presentation-engine/index.d.ts +100 -0
  578. package/dist/safe-bash-presentation-engine/index.js +791 -0
  579. package/dist/safe-bash-presentation-engine/layouts.js +31 -0
  580. package/dist/safe-bash-presentation-engine/length.js +21 -0
  581. package/dist/safe-bash-presentation-engine/links.js +33 -0
  582. package/dist/safe-bash-presentation-engine/masters.js +54 -0
  583. package/dist/safe-bash-presentation-engine/media-editing.js +35 -0
  584. package/dist/safe-bash-presentation-engine/media-extraction.js +24 -0
  585. package/dist/safe-bash-presentation-engine/media.js +23 -0
  586. package/dist/safe-bash-presentation-engine/memberships.js +24 -0
  587. package/dist/safe-bash-presentation-engine/notes.js +27 -0
  588. package/dist/safe-bash-presentation-engine/ole-enum.js +10 -0
  589. package/dist/safe-bash-presentation-engine/ole-insertion.js +29 -0
  590. package/dist/safe-bash-presentation-engine/opaque-objects.js +21 -0
  591. package/dist/safe-bash-presentation-engine/package-reader.js +13 -0
  592. package/dist/safe-bash-presentation-engine/package-tools.js +25 -0
  593. package/dist/safe-bash-presentation-engine/package-uri.d.ts +13 -0
  594. package/dist/safe-bash-presentation-engine/package-uri.js +16 -0
  595. package/dist/safe-bash-presentation-engine/package-writer.js +13 -0
  596. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/presentation-model.d.ts +1 -1
  597. package/dist/safe-bash-presentation-engine/presentation-model.js +63 -0
  598. package/dist/safe-bash-presentation-engine/presentation-settings.js +25 -0
  599. package/dist/safe-bash-presentation-engine/properties.js +37 -0
  600. package/dist/safe-bash-presentation-engine/publication.d.ts +10 -0
  601. package/dist/safe-bash-presentation-engine/publication.js +0 -0
  602. package/dist/safe-bash-presentation-engine/relationships.js +16 -0
  603. package/dist/safe-bash-presentation-engine/resource-limits.js +8 -0
  604. package/dist/safe-bash-presentation-engine/sanitize.js +24 -0
  605. package/dist/safe-bash-presentation-engine/selector-schema.js +7 -0
  606. package/dist/safe-bash-presentation-engine/selectors.js +26 -0
  607. package/dist/safe-bash-presentation-engine/shape-groups.js +47 -0
  608. package/dist/safe-bash-presentation-engine/shape-operations.js +48 -0
  609. package/dist/safe-bash-presentation-engine/shape-path-operations.js +44 -0
  610. package/dist/safe-bash-presentation-engine/shape-paths.js +31 -0
  611. package/dist/safe-bash-presentation-engine/shape-presets.js +11 -0
  612. package/dist/safe-bash-presentation-engine/shape-selection.js +43 -0
  613. package/dist/safe-bash-presentation-engine/shape-transforms.js +28 -0
  614. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-types.d.ts +1 -1
  615. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shapes.d.ts +1 -1
  616. package/dist/safe-bash-presentation-engine/shapes.js +66 -0
  617. package/dist/safe-bash-presentation-engine/slide-copy.js +24 -0
  618. package/dist/safe-bash-presentation-engine/slide-import.js +27 -0
  619. package/dist/safe-bash-presentation-engine/slide-merge-split.js +33 -0
  620. package/dist/safe-bash-presentation-engine/slide-model.js +74 -0
  621. package/dist/safe-bash-presentation-engine/slide-removal.js +25 -0
  622. package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +17 -0
  623. package/dist/safe-bash-presentation-engine/slides.js +26 -0
  624. package/dist/safe-bash-presentation-engine/table-operations.js +51 -0
  625. package/dist/safe-bash-presentation-engine/table-spans.js +42 -0
  626. package/dist/safe-bash-presentation-engine/tables.js +45 -0
  627. package/dist/safe-bash-presentation-engine/tags.js +25 -0
  628. package/dist/safe-bash-presentation-engine/template-bindings.js +44 -0
  629. package/dist/safe-bash-presentation-engine/template-repeat.js +51 -0
  630. package/dist/safe-bash-presentation-engine/text-fitting.js +39 -0
  631. package/dist/safe-bash-presentation-engine/text-frames.js +52 -0
  632. package/dist/safe-bash-presentation-engine/text-paragraphs.js +58 -0
  633. package/dist/safe-bash-presentation-engine/text-reading.js +23 -0
  634. package/dist/safe-bash-presentation-engine/text-replacement.js +24 -0
  635. package/dist/safe-bash-presentation-engine/text-runs.js +45 -0
  636. package/dist/safe-bash-presentation-engine/themes.js +31 -0
  637. package/dist/safe-bash-presentation-engine/transitions.js +27 -0
  638. package/dist/safe-bash-presentation-engine/validation.js +14 -0
  639. package/dist/safe-bash-presentation-engine/xml-parts.js +25 -0
  640. package/dist/safe-bash-presentation-engine/xml-view.js +8 -0
  641. package/dist/safe-bash-presentation-engine/xml.js +8 -0
  642. package/dist/safe-bash-sqlite-engine/sqlite-edit-snapshot.d.ts +15 -0
  643. package/dist/safe-bash-sqlite-engine/sqlite-finalization.d.ts +7 -0
  644. package/dist/safe-bash-sqlite-engine/sqlite-pages.d.ts +18 -0
  645. package/dist/safe-bash-sqlite-engine/sqlite-record-read.d.ts +8 -0
  646. package/dist/safe-bash-sqlite-engine/sqlite-record-write.d.ts +20 -0
  647. package/dist/safe-bash-sqlite-engine/storage.d.ts +2 -0
  648. package/dist/safe-bash-sqlite-engine/storage.js +236 -55
  649. package/dist/safe-bash-svg-engine/LICENSE +21 -0
  650. package/dist/safe-bash-svg-engine/index.d.ts +8 -0
  651. package/dist/safe-bash-svg-engine/index.js +477 -0
  652. package/dist/safe-bash-zip-engine/index.js +3 -3
  653. package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
  654. package/dist/safe-bash-zip-engine/zip/sfx.js +3 -3
  655. package/dist/safe-bash-zip-engine/zip-format.js +3 -3
  656. package/dist/safe-playwright-cloudflare/browser-provider.generated.js +55 -18
  657. package/dist/safe-playwright-cloudflare/browser-run-code-guest.generated.js +1 -1
  658. package/dist/spreadsheet-engine/datasource.js +4 -1
  659. package/dist/spreadsheet-engine/formulas/functions/math.js +3 -1
  660. package/dist/spreadsheet-engine/rendering/chart/axis.d.ts +26 -0
  661. package/dist/spreadsheet-engine/rendering/chart/axis.js +61 -0
  662. package/dist/spreadsheet-engine/rendering/chart/error-bar.d.ts +39 -0
  663. package/dist/spreadsheet-engine/rendering/chart/error-bar.js +59 -0
  664. package/dist/spreadsheet-engine/rendering/chart/layout.d.ts +24 -0
  665. package/dist/spreadsheet-engine/rendering/chart/layout.js +54 -0
  666. package/dist/spreadsheet-engine/rendering/chart/line.d.ts +23 -0
  667. package/dist/spreadsheet-engine/rendering/chart/line.js +56 -0
  668. package/dist/spreadsheet-engine/rendering/chart/marker.d.ts +35 -0
  669. package/dist/spreadsheet-engine/rendering/chart/marker.js +52 -0
  670. package/dist/spreadsheet-engine/rendering/chart/pie.d.ts +32 -0
  671. package/dist/spreadsheet-engine/rendering/chart/pie.js +47 -0
  672. package/dist/{safe-bash-command-ssconvert → spreadsheet-engine}/rendering/images/codecs.d.ts +0 -1
  673. package/dist/spreadsheet-engine/rendering/images/codecs.js +253 -0
  674. package/dist/spreadsheet-engine/rendering/images/index.d.ts +26 -0
  675. package/dist/spreadsheet-engine/rendering/images/index.js +144 -0
  676. package/dist/spreadsheet-engine/rendering/images/profile-raster.d.ts +4 -0
  677. package/dist/spreadsheet-engine/rendering/images/profile-raster.js +72 -0
  678. package/dist/spreadsheet-engine/rendering/images/scene.d.ts +3 -0
  679. package/dist/spreadsheet-engine/rendering/images/scene.js +34 -0
  680. package/dist/spreadsheet-engine/rendering/print/cell-style.d.ts +10 -0
  681. package/dist/spreadsheet-engine/rendering/print/cell-style.js +52 -0
  682. package/dist/spreadsheet-engine/rendering/print/font-normalization-data.d.ts +43 -0
  683. package/dist/spreadsheet-engine/rendering/print/font-normalization-data.js +1558 -0
  684. package/dist/spreadsheet-engine/rendering/print/font-normalization.d.ts +3 -0
  685. package/dist/spreadsheet-engine/rendering/print/font-normalization.js +113 -0
  686. package/dist/spreadsheet-engine/rendering/print/font-shaping.d.ts +18 -0
  687. package/dist/spreadsheet-engine/rendering/print/font-shaping.js +271 -0
  688. package/dist/spreadsheet-engine/rendering/print/harfbuzz/data.d.ts +1 -0
  689. package/dist/spreadsheet-engine/rendering/print/harfbuzz/data.js +2 -0
  690. package/dist/spreadsheet-engine/rendering/print/header-footer.d.ts +16 -0
  691. package/dist/spreadsheet-engine/rendering/print/header-footer.js +92 -0
  692. package/dist/spreadsheet-engine/rendering/print/layout.d.ts +65 -0
  693. package/dist/spreadsheet-engine/rendering/print/layout.js +75 -0
  694. package/dist/spreadsheet-engine/rendering/print/pagination.d.ts +34 -0
  695. package/dist/spreadsheet-engine/rendering/print/pagination.js +126 -0
  696. package/dist/spreadsheet-engine/rendering/print/settings.d.ts +42 -0
  697. package/dist/spreadsheet-engine/rendering/print/settings.js +159 -0
  698. package/dist/spreadsheet-format-xls/biff-metadata.js +3 -3
  699. package/dist/spreadsheet-format-xls/biff-write-metadata.d.ts +1 -1
  700. package/dist/spreadsheet-format-xls/biff-write-metadata.js +20 -3
  701. package/dist/spreadsheet-format-xls/biff-write.js +1 -1
  702. package/package.json +239 -12
  703. package/third-party/spreadsheet-engine/scripts/harfbuzz/README.md +39 -0
  704. package/third-party/spreadsheet-engine/scripts/harfbuzz/allocator.cc +18 -0
  705. package/third-party/spreadsheet-engine/scripts/harfbuzz/build.mjs +94 -0
  706. package/third-party/spreadsheet-engine/scripts/harfbuzz/completion.patch +98 -0
  707. package/third-party/spreadsheet-engine/scripts/harfbuzz/config-override.h +19 -0
  708. package/third-party/spreadsheet-engine/scripts/harfbuzz/exports.json +29 -0
  709. package/third-party/spreadsheet-engine/scripts/harfbuzz/sources.json +274 -0
  710. package/third-party/spreadsheet-engine/scripts/harfbuzz/verify.d.mts +10 -0
  711. package/third-party/spreadsheet-engine/scripts/harfbuzz/verify.mjs +96 -0
  712. package/third-party/spreadsheet-engine/scripts/harfbuzz/verify.test.mjs +60 -0
  713. package/third-party/spreadsheet-engine/src/rendering/images/NOTICE.md +22 -0
  714. package/third-party/spreadsheet-engine/src/rendering/print/NOTICE.md +30 -0
  715. package/third-party/spreadsheet-engine/src/rendering/print/font-normalization-NOTICE.md +64 -0
  716. package/third-party/spreadsheet-engine/src/rendering/print/font-normalization-data.ts +1558 -0
  717. package/third-party/spreadsheet-engine/src/rendering/print/font-normalization.ts +91 -0
  718. package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/EMSCRIPTEN-LICENSE.txt +102 -0
  719. package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/HARFBUZZ-LICENSE.txt +42 -0
  720. package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/LIBCXX-LICENSE.txt +311 -0
  721. package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/LIBCXXABI-LICENSE.txt +311 -0
  722. package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/MUSL-LICENSE.txt +193 -0
  723. package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/NOTICE.md +41 -0
  724. package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/data.ts +2 -0
  725. package/dist/safe-bash/command-chunks/chunk-C5TUE2FE.js +0 -169
  726. package/dist/safe-bash/command-chunks/chunk-CVKW2YIC.js +0 -13631
  727. package/dist/safe-bash/command-chunks/chunk-JBGGUHQY.js +0 -17617
  728. package/dist/safe-bash/command-chunks/chunk-S4R2JDPL.js +0 -35
  729. package/dist/safe-bash/command-chunks/chunk-TU5IFVCX.js +0 -33708
  730. package/dist/safe-bash/command-chunks/chunk-TUWGIF22.js +0 -328
  731. package/dist/safe-bash/command-chunks/data-2FJOPYXA-PDKMLCGR.js +0 -8
  732. package/dist/safe-bash/command-chunks/index.browser-2NLML6H4.js +0 -269
  733. package/dist/safe-bash/command-chunks/model-store-EEI3QS4G.js +0 -10
  734. package/dist/safe-bash/command-chunks/pdf-M2GFAR2A-FCJMJCAP.js +0 -683
  735. package/dist/safe-bash-command-ssconvert/rendering/images/formats.d.ts +0 -2
  736. package/dist/safe-bash-docx-engine/command.d.ts +0 -65
  737. package/dist/safe-bash/chunks/{chunk-4T4RQYRI.js → chunk-5HRGBHZH.js} +10 -10
  738. package/dist/safe-bash/chunks/{chunk-QUS6X4MS.js → chunk-EOQMDRTY.js} +0 -0
  739. package/dist/safe-bash/command-chunks/{chunk-2L3JKGUH.js → chunk-4LYZBDZF.js} +4 -4
  740. package/dist/safe-bash/command-chunks/{chunk-EMMSXKEJ.js → chunk-4Q4R3VZU.js} +0 -0
  741. package/dist/safe-bash/command-chunks/{chunk-5RLK2QSY.js → chunk-7JEIWA3A.js} +5 -5
  742. package/dist/safe-bash/command-chunks/{chunk-AV6N7DDA.js → chunk-DDYPQAXN.js} +3 -3
  743. package/dist/safe-bash/command-chunks/{chunk-OOB7YCFQ.js → chunk-FMJKCVSQ.js} +3 -3
  744. package/dist/safe-bash/command-chunks/{chunk-FUL2C4EX.js → chunk-HFKS6AET.js} +3 -3
  745. package/dist/safe-bash/command-chunks/{chunk-2M3WUEDX.js → chunk-J6K5Q53O.js} +10 -10
  746. package/dist/safe-bash/command-chunks/{chunk-ATWMLV75.js → chunk-RJXZYDSN.js} +7 -7
  747. package/dist/safe-bash/command-chunks/{chunk-JD3NSHFT.js → chunk-TVGIJ56E.js} +3 -3
  748. package/dist/safe-bash/command-chunks/{chunk-3I33KPQH.js → chunk-X2HVVMTW.js} +6 -6
  749. package/dist/safe-bash/command-chunks/{odf-UKSXPNOZ-NCL5P7YL.js → odf-UKSXPNOZ-BV2LCKTB.js} +0 -0
  750. package/dist/{safe-bash/command-chunks/chunk-3SVT5VB7.js → safe-bash-docx-engine/operation-types.js} +0 -0
  751. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/accessibility.d.ts +0 -0
  752. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/animation-editing.d.ts +0 -0
  753. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/animations.d.ts +0 -0
  754. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/backgrounds.d.ts +0 -0
  755. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-data-model.d.ts +0 -0
  756. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-editing.d.ts +0 -0
  757. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-font-operations.d.ts +0 -0
  758. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-model-axes.d.ts +0 -0
  759. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-model-core.d.ts +0 -0
  760. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-model-series.d.ts +0 -0
  761. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-model.d.ts +0 -0
  762. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-objects.d.ts +0 -0
  763. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-workbook.d.ts +0 -0
  764. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/charts.d.ts +0 -0
  765. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/command-placeholder.d.ts +0 -0
  766. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/comments.d.ts +0 -0
  767. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/connector-operations.d.ts +0 -0
  768. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/connectors-model.d.ts +0 -0
  769. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/connectors.d.ts +0 -0
  770. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/content-types.d.ts +0 -0
  771. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/contracts.d.ts +0 -0
  772. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/creation.d.ts +0 -0
  773. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/diagram-resources.d.ts +0 -0
  774. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/diff.d.ts +0 -0
  775. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/drawing-format.d.ts +0 -0
  776. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/drawing-operations.d.ts +0 -0
  777. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/equations.d.ts +0 -0
  778. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/errors.d.ts +0 -0
  779. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/fields.d.ts +0 -0
  780. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/font-metrics.d.ts +0 -0
  781. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/freeform-builder.d.ts +0 -0
  782. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/group-model.d.ts +0 -0
  783. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-extraction.d.ts +0 -0
  784. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-formatting.d.ts +0 -0
  785. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-insertion.d.ts +0 -0
  786. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-replacement.d.ts +0 -0
  787. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-value.d.ts +0 -0
  788. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/images.d.ts +0 -0
  789. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/inventory.d.ts +0 -0
  790. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/language-enum.d.ts +0 -0
  791. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/layouts.d.ts +0 -0
  792. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/length.d.ts +0 -0
  793. package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/links-model.d.ts +4 -4
  794. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/links.d.ts +0 -0
  795. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/masters.d.ts +0 -0
  796. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/media-editing.d.ts +0 -0
  797. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/media-enum.d.ts +0 -0
  798. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/media-extraction.d.ts +0 -0
  799. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/media.d.ts +0 -0
  800. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/memberships.d.ts +0 -0
  801. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/modern-comments.d.ts +0 -0
  802. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/notes.d.ts +0 -0
  803. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/ole-enum.d.ts +0 -0
  804. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/ole-insertion.d.ts +0 -0
  805. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/opaque-objects.d.ts +0 -0
  806. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/package-reader.d.ts +0 -0
  807. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/package-tools.d.ts +0 -0
  808. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/package-view.d.ts +0 -0
  809. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/package-writer.d.ts +0 -0
  810. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/paragraph-alignment.d.ts +0 -0
  811. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/presentation-settings.d.ts +0 -0
  812. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/properties.d.ts +0 -0
  813. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/relationships.d.ts +0 -0
  814. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/resource-limits.d.ts +0 -0
  815. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/sanitize.d.ts +0 -0
  816. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/selector-schema.d.ts +0 -0
  817. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/selectors.d.ts +0 -0
  818. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-adjustments.d.ts +0 -0
  819. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-groups.d.ts +0 -0
  820. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-operations.d.ts +0 -0
  821. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-path-operations.d.ts +0 -0
  822. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-paths.d.ts +0 -0
  823. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-placeholder-types.d.ts +0 -0
  824. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-presets.d.ts +0 -0
  825. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-selection.d.ts +0 -0
  826. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-transforms.d.ts +0 -0
  827. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-copy.d.ts +0 -0
  828. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-import.d.ts +0 -0
  829. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-layout-model.d.ts +0 -0
  830. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-merge-split.d.ts +0 -0
  831. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-model.d.ts +0 -0
  832. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-removal.d.ts +0 -0
  833. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-transfer-budget.d.ts +0 -0
  834. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slides.d.ts +0 -0
  835. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/table-operations.d.ts +0 -0
  836. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/table-spans.d.ts +0 -0
  837. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/tables-model.d.ts +0 -0
  838. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/tables.d.ts +0 -0
  839. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/tags.d.ts +0 -0
  840. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/template-bindings.d.ts +0 -0
  841. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/template-repeat.d.ts +0 -0
  842. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-fitting.d.ts +0 -0
  843. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-frame-enums.d.ts +0 -0
  844. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-frames.d.ts +0 -0
  845. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-paragraphs.d.ts +0 -0
  846. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-reading.d.ts +0 -0
  847. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-replacement.d.ts +0 -0
  848. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-run-color.d.ts +0 -0
  849. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-runs.d.ts +0 -0
  850. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-style-resolution.d.ts +0 -0
  851. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/themes.d.ts +0 -0
  852. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/transitions.d.ts +0 -0
  853. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/validation.d.ts +0 -0
  854. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/xml-parts.d.ts +0 -0
  855. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/xml-view.d.ts +0 -0
  856. /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/xml.d.ts +0 -0
@@ -0,0 +1,730 @@
1
+ import {
2
+ assertOutsideFields,
3
+ parseFields
4
+ } from "./chunk-6EHVFKM7.js";
5
+ import {
6
+ openDocumentLocations
7
+ } from "./chunk-LHDB4QO5.js";
8
+ import {
9
+ DocumentArchiveEditor
10
+ } from "./chunk-MAHX3IW3.js";
11
+ import {
12
+ validateDocxInvocation
13
+ } from "./chunk-DE66JRWJ.js";
14
+ import {
15
+ pathContains
16
+ } from "./chunk-IR6ZKAUH.js";
17
+ import {
18
+ assertDocumentEditable,
19
+ publishDocumentArchive
20
+ } from "./chunk-HPKUFWHW.js";
21
+ import {
22
+ DocumentPackage
23
+ } from "./chunk-GLPIFP7N.js";
24
+ import {
25
+ UnsupportedEditError,
26
+ activeXmlChildren,
27
+ assertOutsideRevisionRanges,
28
+ containsRevision,
29
+ nativeElementSourceTokens,
30
+ nativeScalarTextSource,
31
+ nativeXmlTriviaSource,
32
+ xmlValue
33
+ } from "./chunk-YPVBU7QF.js";
34
+ import {
35
+ parseStoredDateTime,
36
+ storedBooleanValue
37
+ } from "./chunk-VEUQWV2V.js";
38
+ import {
39
+ SelectionError,
40
+ closedRecord,
41
+ encodeGeneratedLocation
42
+ } from "./chunk-LQOKYG3O.js";
43
+ import {
44
+ relativePartTarget
45
+ } from "./chunk-WAKYUXVQ.js";
46
+ import {
47
+ InvalidValueError,
48
+ archiveSettings
49
+ } from "./chunk-IQFRPIXH.js";
50
+ import {
51
+ crc32
52
+ } from "./chunk-XIC45QAG.js";
53
+ import {
54
+ createCompressionCodec
55
+ } from "./chunk-GEDRBQGT.js";
56
+
57
+ // packages/safe-bash-docx-engine/src/control-picture.ts
58
+ function unsupported(message = "The picture control has no verified occurrence structure.") {
59
+ throw new UnsupportedEditError(message);
60
+ }
61
+ function u32(bytes, offset) {
62
+ return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getUint32(offset);
63
+ }
64
+ function adler(bytes) {
65
+ let a = 1, b = 0;
66
+ for (const byte of bytes) {
67
+ a = (a + byte) % 65521;
68
+ b = (b + a) % 65521;
69
+ }
70
+ return (b << 16 | a) >>> 0;
71
+ }
72
+ async function admitControlPng(input, context, profile = "picture-control") {
73
+ const { limits, signal, budget } = archiveSettings(context);
74
+ if (!(input instanceof Uint8Array) || input.length > limits.maxEntryBytes) throw new InvalidValueError("Expected bounded PNG bytes.");
75
+ budget.charge("work", input.length);
76
+ budget.charge("retainedBytes", input.length);
77
+ const bytes = new Uint8Array(input);
78
+ if (bytes.length < 57 || ![137, 80, 78, 71, 13, 10, 26, 10].every((byte, i) => bytes[i] === byte)) unsupported("Expected an admitted PNG picture.");
79
+ let offset = 8, width = 0, height = 0, channels = 0, depth = 0, interlace = 0, ended = false, sawData = false, closedData = false, sawPalette = false;
80
+ const data = [];
81
+ let compressedLength = 0;
82
+ while (offset < bytes.length) {
83
+ budget.charge("work", 1);
84
+ if (offset + 12 > bytes.length) unsupported("Truncated PNG chunk.");
85
+ const length = u32(bytes, offset);
86
+ if (length > bytes.length - offset - 12) unsupported("Invalid PNG chunk length.");
87
+ const type = String.fromCharCode(...bytes.subarray(offset + 4, offset + 8));
88
+ if ([...type].some((c) => !(c >= "A" && c <= "Z") && !(c >= "a" && c <= "z")) || type[2] >= "a" || crc32(bytes.subarray(offset + 4, offset + 8 + length)) !== u32(bytes, offset + 8 + length)) unsupported("Invalid PNG chunk type or checksum.");
89
+ const payload2 = bytes.subarray(offset + 8, offset + 8 + length);
90
+ if (type === "IHDR") {
91
+ if (offset !== 8 || length !== 13) unsupported("Invalid PNG header order.");
92
+ width = u32(payload2, 0);
93
+ height = u32(payload2, 4);
94
+ depth = payload2[8];
95
+ interlace = payload2[12];
96
+ const color = payload2[9], depths = { 0: [1, 2, 4, 8, 16], 2: [8, 16], 3: [1, 2, 4, 8], 4: [8, 16], 6: [8, 16] };
97
+ channels = { 0: 1, 2: 3, 3: 1, 4: 2, 6: 4 }[color] ?? 0;
98
+ if (!width || !height || !depths[color]?.includes(depth) || payload2[10] !== 0 || payload2[11] !== 0 || ![0, 1].includes(interlace) || profile === "picture-control" && (depth !== 8 || ![2, 6].includes(color) || interlace !== 0)) unsupported("Unsupported PNG pixel profile.");
99
+ } else if (!width) unsupported("Missing PNG header.");
100
+ else if (type === "IDAT") {
101
+ if (closedData) unsupported("PNG data chunks must be contiguous.");
102
+ data.push(payload2);
103
+ compressedLength += payload2.length;
104
+ sawData = true;
105
+ } else if (type === "IEND") {
106
+ if (length !== 0 || !sawData || offset + 12 !== bytes.length) unsupported("Invalid PNG end marker.");
107
+ ended = true;
108
+ } else {
109
+ if (sawData) closedData = true;
110
+ if (type[0] >= "A" && type[0] <= "Z" && type !== "PLTE") unsupported("Unsupported PNG critical chunk.");
111
+ if (type === "PLTE") {
112
+ if (sawPalette || sawData || length === 0 || length > 768 || length % 3 !== 0) unsupported("Invalid PNG palette.");
113
+ sawPalette = true;
114
+ }
115
+ }
116
+ offset += length + 12;
117
+ }
118
+ if (!ended || compressedLength < 6) unsupported("Incomplete PNG payload.");
119
+ const passes = interlace ? [[0, 0, 8, 8], [4, 0, 8, 8], [0, 4, 4, 8], [2, 0, 4, 4], [0, 2, 2, 4], [1, 0, 2, 2], [0, 1, 1, 2]] : [[0, 0, 1, 1]];
120
+ const scanlines = passes.map(([x, y, dx, dy]) => {
121
+ const columns = Math.max(0, Math.ceil((width - x) / dx)), rows = Math.max(0, Math.ceil((height - y) / dy));
122
+ return { rows: columns ? rows : 0, stride: 1 + Math.ceil(columns * channels * depth / 8) };
123
+ });
124
+ const expected = scanlines.reduce((total, pass) => total + pass.rows * pass.stride, 0);
125
+ if (!Number.isSafeInteger(expected) || expected > limits.maxEntryBytes) unsupported("PNG expanded pixel limit exceeded.");
126
+ budget.check("expandedPackage", expected);
127
+ budget.charge("retainedBytes", compressedLength + expected);
128
+ budget.charge("work", expected);
129
+ const compressed = new Uint8Array(compressedLength);
130
+ offset = 0;
131
+ for (const chunk of data) {
132
+ compressed.set(chunk, offset);
133
+ offset += chunk.length;
134
+ }
135
+ if ((compressed[0] & 15) !== 8 || compressed[0] >> 4 > 7 || (compressed[0] * 256 + compressed[1]) % 31 !== 0 || compressed[1] & 32) unsupported("Invalid PNG zlib header.");
136
+ const payload = compressed.subarray(2, -4);
137
+ const codec = createCompressionCodec();
138
+ const reader = new codec.CodecReader({ async *[Symbol.asyncIterator]() {
139
+ yield payload;
140
+ } }, signal);
141
+ const raw = new Uint8Array(expected);
142
+ offset = 0;
143
+ try {
144
+ for await (const chunk of codec.codec(reader, { mode: "inflate-raw", chunkSize: limits.chunkSize }, signal)) {
145
+ budget.check("work", 0);
146
+ if (chunk.length > expected - offset) unsupported("PNG expanded pixel length exceeded.");
147
+ raw.set(chunk, offset);
148
+ offset += chunk.length;
149
+ }
150
+ if (await reader.chunk() !== void 0) unsupported("Trailing PNG compressed pixel data.");
151
+ } catch (error) {
152
+ budget.check("work", 0);
153
+ if (error instanceof UnsupportedEditError) throw error;
154
+ unsupported("Invalid PNG compressed pixels.");
155
+ } finally {
156
+ await reader.close();
157
+ }
158
+ if (offset !== expected || adler(raw) !== u32(compressed, compressed.length - 4)) unsupported("PNG pixel length or checksum mismatch.");
159
+ offset = 0;
160
+ for (const pass of scanlines) for (let row = 0; row < pass.rows; row++) {
161
+ if (raw[offset] > 4) unsupported("Invalid PNG row filter.");
162
+ offset += pass.stride;
163
+ }
164
+ return bytes;
165
+ }
166
+ async function acquireControlPng(input, context) {
167
+ const { limits, signal, budget } = archiveSettings(context);
168
+ let bytes;
169
+ const maxBytes = Math.min(limits.maxEntryBytes, budget.limits.embeddedMediaBytes - budget.usage.embeddedMediaBytes);
170
+ if (input.kind === "bytes") {
171
+ const base64 = input.base64;
172
+ if (typeof base64 !== "string" || base64.length > Math.ceil(limits.maxEntryBytes / 3) * 4 || base64.length % 4 !== 0 || [...base64].some((c) => !"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".includes(c))) throw new InvalidValueError("Expected bounded canonical base64 picture.");
173
+ const padding = base64.endsWith("==") ? 2 : base64.endsWith("=") ? 1 : 0, length = base64.length / 4 * 3 - padding;
174
+ if (length > limits.maxEntryBytes) throw new InvalidValueError("Picture input exceeds the entry limit.");
175
+ budget.check("embeddedMediaBytes", budget.usage.embeddedMediaBytes + length);
176
+ budget.charge("retainedBytes", length * 3);
177
+ budget.charge("work", base64.length);
178
+ let binary;
179
+ try {
180
+ binary = atob(base64);
181
+ if (btoa(binary) !== base64) throw new Error();
182
+ } catch {
183
+ throw new InvalidValueError("Expected canonical base64 picture.");
184
+ }
185
+ bytes = Uint8Array.from(binary, (c) => c.charCodeAt(0));
186
+ } else if (input.kind === "vfs") {
187
+ const resolver = context.binaryResolver;
188
+ if (!resolver || resolver.capability !== input.capability) unsupported("Picture VFS input requires a matching explicit capability.");
189
+ if (maxBytes === 0) budget.check("embeddedMediaBytes", budget.usage.embeddedMediaBytes + 1);
190
+ const source = await resolver.open(input.path, { signal, maxBytes });
191
+ const chunks = [];
192
+ let total = 0;
193
+ for await (const chunk of source) {
194
+ budget.check("work", 0);
195
+ if (!(chunk instanceof Uint8Array)) throw new InvalidValueError("Expected picture byte fragments.");
196
+ total += chunk.length;
197
+ if (total > limits.maxEntryBytes) unsupported("Picture input exceeds the entry limit.");
198
+ budget.check("embeddedMediaBytes", budget.usage.embeddedMediaBytes + total);
199
+ budget.charge("retainedBytes", chunk.length ? chunk.length + 64 : 0);
200
+ budget.charge("work", chunk.length + 1);
201
+ if (chunk.length) chunks.push(new Uint8Array(chunk));
202
+ }
203
+ budget.check("work", 0);
204
+ budget.charge("retainedBytes", total);
205
+ bytes = new Uint8Array(total);
206
+ let offset = 0;
207
+ for (const chunk of chunks) {
208
+ bytes.set(chunk, offset);
209
+ offset += chunk.length;
210
+ }
211
+ } else throw new InvalidValueError("Expected explicit picture binary input.");
212
+ budget.charge("embeddedMediaBytes", bytes.length);
213
+ return admitControlPng(bytes, { limits, signal, budget });
214
+ }
215
+ function occurrence(content, budget) {
216
+ let drawing, blip;
217
+ let drawings = 0, blips = 0, forbidden = false;
218
+ const chain = [];
219
+ budget.charge("retainedBytes", 32);
220
+ const stack = [{ node: content, next: 0 }];
221
+ while (stack.length) {
222
+ const frame = stack[stack.length - 1], node2 = frame.node;
223
+ if (frame.next === 0) {
224
+ budget.charge("work", 1);
225
+ if (node2.namespace === content.namespace && node2.localName === "drawing") {
226
+ drawings++;
227
+ drawing = node2;
228
+ }
229
+ if (["http://schemas.openxmlformats.org/drawingml/2006/main", "http://purl.oclc.org/ooxml/drawingml/main"].includes(node2.namespace) && node2.localName === "blip") {
230
+ blips++;
231
+ if (blips === 1) {
232
+ blip = node2;
233
+ budget.charge("retainedBytes", Math.min(7, stack.length) * 8);
234
+ for (let i = Math.max(0, stack.length - 7); i < stack.length; i++) chain.push(stack[i].node);
235
+ }
236
+ }
237
+ if (["AlternateContent", "imagedata", "object", "pict"].includes(node2.localName)) forbidden = true;
238
+ }
239
+ if (frame.next < node2.children.length) {
240
+ budget.charge("retainedBytes", 32);
241
+ stack.push({ node: node2.children[frame.next++], next: 0 });
242
+ } else stack.pop();
243
+ }
244
+ if (drawings !== 1 || blips !== 1 || forbidden) unsupported();
245
+ const node = blip;
246
+ budget.charge("work", node.attributes.length);
247
+ budget.charge("retainedBytes", node.attributes.length * 8);
248
+ const embeds = node.attributes.filter((attribute) => ["http://schemas.openxmlformats.org/officeDocument/2006/relationships", "http://purl.oclc.org/ooxml/officeDocument/relationships"].includes(attribute.namespace) && attribute.localName === "embed");
249
+ if (chain.length !== 7 || chain[0] !== drawing || !["inline", "anchor"].includes(chain[1].localName) || !["http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing", "http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing"].includes(chain[1].namespace) || chain[2].namespace !== node.namespace || chain[2].localName !== "graphic" || chain[3].namespace !== node.namespace || chain[3].localName !== "graphicData" || !["http://schemas.openxmlformats.org/drawingml/2006/picture", "http://purl.oclc.org/ooxml/drawingml/picture"].includes(chain[4].namespace) || chain[4].localName !== "pic" || chain[5].namespace !== chain[4].namespace || chain[5].localName !== "blipFill" || chain[3].attributes.find((attribute) => attribute.localName === "uri" && attribute.namespace === "")?.value !== chain[4].namespace || ["extent", "docPr"].some((name) => chain[1].children.filter((child) => child.namespace === chain[1].namespace && child.localName === name).length !== 1)) unsupported();
250
+ if (embeds.length !== 1 || node.children.length || node.attributes.some((attribute) => attribute.localName === "link")) unsupported();
251
+ return { node, id: embeds[0].value, namespace: embeds[0].namespace };
252
+ }
253
+ function readControlPicture(archive, owner, content, context) {
254
+ const { limits, budget } = archiveSettings(context);
255
+ const target = occurrence(content, budget);
256
+ const pkg = new DocumentPackage(archive, limits, budget);
257
+ const edge = pkg.relationships(owner).find((edge2) => edge2.rId === target.id);
258
+ if (!edge || !edge.reltype.endsWith("/image")) unsupported();
259
+ return { relationshipId: edge.rId, target: edge.is_external ? edge.target_ref : edge.target_part.partname, external: edge.is_external, contentType: edge.is_external ? null : edge.target_part.content_type };
260
+ }
261
+ var staged = /* @__PURE__ */ new WeakMap();
262
+ function replaceControlPicture(editor, archive, owner, content, bytes, context) {
263
+ const { limits, budget } = archiveSettings(context);
264
+ const pkg = new DocumentPackage(archive, limits, budget);
265
+ const target = occurrence(content, budget);
266
+ const edge = pkg.relationships(owner).find((edge2) => edge2.rId === target.id);
267
+ if (!edge || edge.is_external || !edge.reltype.endsWith("/image") || !edge.target_part.content_type.toLowerCase().startsWith("image/")) unsupported();
268
+ const additions = staged.get(editor) ?? [];
269
+ let ordinal = 1;
270
+ let media;
271
+ do {
272
+ media = `/word/media/control-picture-${ordinal++}.png`;
273
+ } while (pkg.parts.some((part) => part.partname === media) || additions.some((item) => item.media === media));
274
+ const taken = /* @__PURE__ */ new Set([...pkg.relationships(owner).map((edge2) => edge2.rId), ...additions.filter((item) => item.owner === owner).map((item) => item.id)]);
275
+ ordinal = 1;
276
+ while (taken.has(`rId${ordinal}`)) ordinal++;
277
+ const id = `rId${ordinal}`;
278
+ editor.xml(owner.slice(1)).setAttribute(target.node, { namespace: target.namespace, localName: "embed" }, id);
279
+ additions.push({ owner, id, media, bytes, reltype: edge.reltype });
280
+ staged.set(editor, additions);
281
+ }
282
+ function finishControlPictures(editor, archive, context) {
283
+ const additions = staged.get(editor) ?? [];
284
+ if (!additions.length) return editor.snapshot();
285
+ const { budget } = archiveSettings(context);
286
+ for (const owner of new Set(additions.map((item) => item.owner))) {
287
+ const slash = owner.lastIndexOf("/");
288
+ const relname = owner.slice(1, slash + 1) + "_rels/" + owner.slice(slash + 1) + ".rels";
289
+ const xml = editor.xml(relname);
290
+ const prefix2 = xml.root.name.includes(":") ? xml.root.name.slice(0, xml.root.name.indexOf(":") + 1) : "";
291
+ for (const item of additions.filter((item2) => item2.owner === owner)) xml.insertChildren(xml.root, `<${prefix2}Relationship Id="${item.id}" Type="${xmlValue(item.reltype)}" Target="${xmlValue(relativePartTarget(owner, item.media))}"/>`);
292
+ }
293
+ const types = editor.xml("[Content_Types].xml");
294
+ const prefix = types.root.name.includes(":") ? types.root.name.slice(0, types.root.name.indexOf(":") + 1) : "";
295
+ for (const item of additions) types.insertChildren(types.root, `<${prefix}Override PartName="${item.media}" ContentType="image/png"/>`);
296
+ budget.charge("retainedBytes", additions.reduce((n, item) => n + item.bytes.length, 0));
297
+ const dirty = new Set(editor.dirtyParts);
298
+ return { comment: new Uint8Array(archive.comment), members: [
299
+ ...archive.members.map((member) => ({ ...member, bytes: dirty.has(member.name) ? editor.xml(member.name).serialize() : new Uint8Array(member.bytes), modified: new Date(member.modified) })),
300
+ ...additions.map((item) => ({ name: item.media.slice(1), bytes: new Uint8Array(item.bytes), directory: false, modified: new Date(archive.members[0].modified) }))
301
+ ] };
302
+ }
303
+
304
+ // packages/safe-bash-docx-engine/src/controls.ts
305
+ var w14 = "http://schemas.microsoft.com/office/word/2010/wordml";
306
+ var w15 = "http://schemas.microsoft.com/office/word/2012/wordml";
307
+ function attr(node, name, namespace = node?.namespace) {
308
+ return node?.attributes.find((attribute) => attribute.namespace === namespace && attribute.localName === name)?.value ?? null;
309
+ }
310
+ function controlChildren(xml, budget) {
311
+ const all = activeXmlChildren(xml, budget);
312
+ return { all, one(node, name, namespace = node.namespace) {
313
+ const result = all(node).filter((element) => element.namespace === namespace && element.localName === name);
314
+ if (result.length > 1) throw new UnsupportedEditError("Repeated control properties are unsupported.");
315
+ return result[0];
316
+ } };
317
+ }
318
+ function walk(node, budget) {
319
+ budget.charge("retainedBytes", 192);
320
+ const result = [], pending = [node];
321
+ while (pending.length) {
322
+ const current = pending.pop();
323
+ budget.charge("work", 1);
324
+ budget.charge("retainedBytes", 8);
325
+ result.push(current);
326
+ budget.charge("retainedBytes", current.children.length * 8);
327
+ for (let index = current.children.length - 1; index >= 0; index--) pending.push(current.children[index]);
328
+ }
329
+ return result;
330
+ }
331
+ function owners(root, path) {
332
+ const result = [root];
333
+ for (const index of path) result.push(result.at(-1).children[index]);
334
+ return result;
335
+ }
336
+ function logicalText(content, children, budget) {
337
+ budget.charge("retainedBytes", 192);
338
+ const pending = [content], chunks = [];
339
+ let length = 0;
340
+ while (pending.length) {
341
+ const node = pending.pop();
342
+ const text = typeof node === "string" ? node : node.namespace !== content.namespace ? void 0 : node.localName === "t" ? node.text : node.localName === "tab" ? " " : ["br", "cr"].includes(node.localName) ? "\n" : void 0;
343
+ if (text !== void 0) {
344
+ budget.charge("work", text.length);
345
+ budget.charge("retainedBytes", 8);
346
+ chunks.push(text);
347
+ length += text.length;
348
+ continue;
349
+ }
350
+ const nested = children(node);
351
+ const separated = node.localName === "sdtContent" && nested.every((n) => n.localName === "p");
352
+ budget.charge("retainedBytes", nested.length * (separated ? 16 : 8));
353
+ for (let index = nested.length - 1; index >= 0; index--) {
354
+ pending.push(nested[index]);
355
+ if (separated && index > 0) pending.push("\n");
356
+ }
357
+ }
358
+ budget.charge("retainedBytes", length * 2);
359
+ return chunks.join("");
360
+ }
361
+ function inspectControlSnapshot(node, location, archive, context, xml) {
362
+ const budget = archiveSettings(context).budget;
363
+ const { one: child, all: children } = controlChildren(xml, budget);
364
+ let kind = "unsupported", value = null, reason = null;
365
+ let properties, content;
366
+ const choices = [];
367
+ try {
368
+ properties = child(node, "sdtPr");
369
+ content = child(node, "sdtContent");
370
+ if (!properties || !content) throw new UnsupportedEditError("A control requires one properties and content owner.");
371
+ if (children(properties).some((owner) => owner.namespace === node.namespace && ["docPartObj", "docPartList", "citation", "bibliography", "equation", "group"].includes(owner.localName) || owner.namespace === w14 && ["repeatingSection", "repeatingSectionItem"].includes(owner.localName))) throw new UnsupportedEditError("This stored control type has no verified scalar semantics.");
372
+ const kinds = children(properties).filter((n) => n.namespace === node.namespace && ["text", "richText", "dropDownList", "comboBox", "date", "picture"].includes(n.localName) || n.namespace === w14 && n.localName === "checkbox" || n.namespace === w15 && ["repeatingSection", "repeatingSectionItem"].includes(n.localName));
373
+ if (kinds.length > 1) throw new UnsupportedEditError("Conflicting control types are unsupported.");
374
+ const type = kinds[0];
375
+ const names = { text: "plain-text", checkbox: "checkbox", dropDownList: "dropdown", comboBox: "combo-box", date: "date", picture: "picture", richText: "rich-text", repeatingSection: "repeating-section", repeatingSectionItem: "repeating-item" };
376
+ kind = type ? names[type.localName] : "rich-text";
377
+ value = logicalText(content, children, budget);
378
+ if (["repeating-section", "repeating-item"].includes(kind)) value = null;
379
+ if (kind === "checkbox") {
380
+ value = null;
381
+ const checked = attr(child(type, "checked", w14), "val", w14);
382
+ if (!["0", "1", "true", "false"].includes(checked ?? "")) throw new UnsupportedEditError("Malformed checkbox state.");
383
+ value = checked === "1" || checked === "true";
384
+ }
385
+ if (kind === "dropdown" || kind === "combo-box") {
386
+ for (const item of children(type)) {
387
+ if (item.namespace !== node.namespace || item.localName !== "listItem") throw new UnsupportedEditError("Unsupported choice declaration.");
388
+ const stored = attr(item, "value"), label = attr(item, "displayText");
389
+ if (stored === null || label === null || choices.some((choice) => choice.value === stored)) throw new UnsupportedEditError("Choice values must be distinct declared values.");
390
+ choices.push({ value: stored, label });
391
+ }
392
+ }
393
+ if (kind === "date") value = attr(type, "fullDate");
394
+ if (kind === "picture") {
395
+ value = null;
396
+ value = readControlPicture(archive, location.value.part, content, context);
397
+ }
398
+ } catch (error) {
399
+ if (!(error instanceof UnsupportedEditError)) throw error;
400
+ reason = error.message;
401
+ }
402
+ const metadata = { id: null, tag: null, alias: null, lock: "unknown" };
403
+ let placeholder = false, binding = null;
404
+ if (properties) for (const field of ["id", "tag", "alias", "lock", "dataBinding", "showingPlcHdr"]) {
405
+ try {
406
+ const descriptor = child(properties, field);
407
+ if (field === "dataBinding") {
408
+ if (descriptor) binding = { storeItemId: attr(descriptor, "storeItemID"), xpath: attr(descriptor, "xpath"), prefixMappings: attr(descriptor, "prefixMappings") };
409
+ } else if (field === "showingPlcHdr") {
410
+ const stored = attr(descriptor, "val"), state = descriptor ? stored === null ? true : storedBooleanValue(stored) : false;
411
+ if (state === null) throw new UnsupportedEditError("Malformed control placeholder state.");
412
+ placeholder = state;
413
+ } else if (field === "lock") metadata.lock = attr(descriptor, "val") ?? "unlocked";
414
+ else metadata[field] = attr(descriptor, "val");
415
+ } catch (error) {
416
+ if (!(error instanceof UnsupportedEditError)) throw error;
417
+ reason ??= error.message;
418
+ }
419
+ }
420
+ return {
421
+ location,
422
+ kind,
423
+ ...metadata,
424
+ placeholder,
425
+ binding,
426
+ value,
427
+ choices,
428
+ support: reason === null ? "supported" : "unsupported",
429
+ reason
430
+ };
431
+ }
432
+ async function openControlInventory(input, options, context) {
433
+ const settings = archiveSettings(context);
434
+ const document = await openDocumentLocations(input, settings);
435
+ const archive = document.snapshot();
436
+ const query = { ...options.scope ? { scope: options.scope } : {}, ...options.section ? { section: options.section } : {} };
437
+ let owner = options.select ? document.resolve(options.select) : void 0;
438
+ if (owner?.value.range) throw new UnsupportedEditError("Control selection requires a whole owner.");
439
+ if (options.comment !== void 0 || options.note !== void 0) owner = document.at("story", options.comment ?? options.note, { scope: options.comment !== void 0 ? "comments" : options.scope });
440
+ for (const kind of ["table", "cell", "paragraph", "run", "image", "link", "bookmark", "field"]) if (options[kind] !== void 0) {
441
+ if (kind === "cell") owner = document.cell(owner.token, options.cell);
442
+ else owner = document.at(kind, options[kind], owner ? { owner: owner.token } : query);
443
+ }
444
+ let selected = document.list("control", owner ? { owner: owner.token } : query);
445
+ if (options.control !== void 0) {
446
+ const item = selected[options.control - 1];
447
+ if (!item) throw new SelectionError("missing-selection");
448
+ selected = [item];
449
+ }
450
+ if (options.select && !selected.length) throw new SelectionError("missing-selection");
451
+ const editor = new DocumentArchiveEditor(archive, {}, void 0, settings.budget);
452
+ return { document, archive, editor, items: selected.map((location) => {
453
+ const xml = editor.xml(location.value.part.slice(1));
454
+ return inspectControlSnapshot(owners(xml.root, location.value.path).at(-1), location, archive, settings, xml);
455
+ }) };
456
+ }
457
+ async function inspectDocumentControls(input, options = {}, context) {
458
+ const settings = archiveSettings(context);
459
+ const invocation = validateDocxInvocation({ operation: "controls.list", inputs: ["document"], options }, settings.budget);
460
+ const opts = invocation.options;
461
+ const budget = settings.budget.lower(Object.fromEntries((opts.limit ?? []).map((item) => [item.name, item.value])));
462
+ const result = await openControlInventory(input, opts, { ...settings, budget });
463
+ return { items: result.items };
464
+ }
465
+ function opening(node) {
466
+ return `<${node.name}${node.attributes.map((a) => ` ${a.name}="${xmlValue(a.value)}"`).join("")}>`;
467
+ }
468
+ function retainedControlTrivia(xml, node, budget) {
469
+ budget.charge("retainedBytes", 192);
470
+ const pending = [node], chunks = [];
471
+ while (pending.length) {
472
+ const token = pending.pop();
473
+ budget.charge("work", 1);
474
+ if (token.kind === "element") {
475
+ budget.charge("retainedBytes", token.content.length * 8);
476
+ for (let index = token.content.length - 1; index >= 0; index--) pending.push(token.content[index]);
477
+ } else if (token.kind === "comment" || token.kind === "processing-instruction") {
478
+ budget.charge("retainedBytes", 8);
479
+ chunks.push(xml[nativeXmlTriviaSource](token));
480
+ }
481
+ }
482
+ return chunks.join("");
483
+ }
484
+ function textReplacement(xml, content, text, budget, font) {
485
+ const { one: child } = controlChildren(xml, budget);
486
+ const w = content.namespace;
487
+ const nodes = walk(content, budget);
488
+ if (nodes.some((node) => node.namespace !== w || !["sdtContent", "p", "pPr", "r", "rPr", "t", "tab", "br", "cr"].includes(node.localName) && !nodes.some((owner) => ["pPr", "rPr"].includes(owner.localName) && walk(owner, budget).includes(node)))) throw new UnsupportedEditError("Only ordinary text containers support scalar filling.");
489
+ if (content.children.some((n) => !["r", "p"].includes(n.localName)) || content.children.some((n) => n.localName === "p") && content.children.some((n) => n.localName !== "p")) throw new UnsupportedEditError("Mixed text containers are unsupported.");
490
+ const first = nodes.find((n) => n.namespace === w && n.localName === "r");
491
+ const prefix = content.name.includes(":") ? content.name.slice(0, content.name.indexOf(":") + 1) : "";
492
+ const name = (local) => prefix + local;
493
+ const properties = first && child(first, "rPr");
494
+ let propertyXml = properties ? xml.sourceXml(properties) : "";
495
+ if (font) {
496
+ const fonts = properties && child(properties, "rFonts");
497
+ const fontName = fonts?.name ?? name("rFonts");
498
+ const retained = fonts?.attributes.filter((attribute) => attribute.namespace !== w || !["ascii", "hAnsi", "eastAsia", "cs", "asciiTheme", "hAnsiTheme", "eastAsiaTheme", "cstheme"].includes(attribute.localName)).map((attribute) => ` ${attribute.name}="${xmlValue(attribute.value)}"`).join("") ?? "";
499
+ const inner2 = fonts ? xml.sourceXml(fonts, /* @__PURE__ */ new Map(), true) : "";
500
+ const fontXml = `<${fontName}${retained}${["ascii", "hAnsi", "eastAsia", "cs"].map((local) => ` ${prefix}${local}="${xmlValue(font)}"`).join("")}${inner2 ? ">" + inner2 + `</${fontName}>` : "/>"}`;
501
+ propertyXml = properties ? opening(properties) + xml.sourceXml(properties, fonts ? /* @__PURE__ */ new Map([[fonts, fontXml]]) : /* @__PURE__ */ new Map(), true) + (fonts ? "" : fontXml) + `</${properties.name}>` : `<${name("rPr")}>${fontXml}</${name("rPr")}>`;
502
+ }
503
+ const firstLeaf = first?.children.find((node) => node.localName === "t") ?? first?.children.find((node) => node !== properties);
504
+ const textLeaf = firstLeaf?.localName === "t" ? firstLeaf : void 0;
505
+ const textName = textLeaf?.name ?? name("t");
506
+ const textAttributes = textLeaf?.attributes.filter((attribute) => !(attribute.namespace === "http://www.w3.org/XML/1998/namespace" && attribute.localName === "space")).map((attribute) => ` ${attribute.name}="${xmlValue(attribute.value)}"`).join("") ?? "";
507
+ let value = "", fragment = "", firstText, firstTextMarkup = "";
508
+ const flush = () => {
509
+ if (fragment) {
510
+ const markup = `<${textName}${textAttributes} xml:space="preserve">${xmlValue(fragment)}</${textName}>`;
511
+ if (!value) {
512
+ firstText = fragment;
513
+ firstTextMarkup = markup;
514
+ }
515
+ value += markup;
516
+ fragment = "";
517
+ }
518
+ };
519
+ for (const char of text) {
520
+ if (char === " " || char === "\n") {
521
+ flush();
522
+ value += `<${name(char === " " ? "tab" : "br")}/>`;
523
+ } else fragment += char;
524
+ }
525
+ flush();
526
+ let firstOpening = first ? opening(first) : "";
527
+ if (first) {
528
+ const inheritance = /* @__PURE__ */ new Map();
529
+ const collect = (owner, inherited) => {
530
+ const next = new Map(inherited);
531
+ for (const attribute of owner.attributes) if (attribute.namespace === "http://www.w3.org/XML/1998/namespace") {
532
+ if (!["lang", "space"].includes(attribute.localName) && owner !== content && owner !== first) throw new UnsupportedEditError("Moving a run with unsupported inherited XML semantics is unsupported.");
533
+ if (["lang", "space"].includes(attribute.localName)) next.set(attribute.localName, attribute.value);
534
+ }
535
+ if (owner === first) {
536
+ for (const [key, value2] of next) inheritance.set(key, value2);
537
+ return true;
538
+ }
539
+ return owner.children.some((child2) => collect(child2, next));
540
+ };
541
+ collect(content, /* @__PURE__ */ new Map());
542
+ const namespaces = [...first.namespaces].filter(([prefix2]) => prefix2 !== "xml" && !first.attributes.some((attribute) => attribute.namespace === "http://www.w3.org/2000/xmlns/" && (prefix2 ? attribute.localName === prefix2 : attribute.name === "xmlns"))).map(([prefix2, uri]) => ` ${prefix2 ? "xmlns:" + prefix2 : "xmlns"}="${xmlValue(uri)}"`).join("");
543
+ const lifted = [...inheritance].filter(([name2]) => !first.attributes.some((attribute) => attribute.namespace === "http://www.w3.org/XML/1998/namespace" && attribute.localName === name2)).map(([name2, value2]) => ` xml:${name2}="${xmlValue(value2)}"`).join("");
544
+ firstOpening = firstOpening.slice(0, -1) + namespaces + lifted + ">";
545
+ }
546
+ let run;
547
+ if (first) {
548
+ const replacements2 = /* @__PURE__ */ new Map();
549
+ let filled = false;
550
+ for (const node of first.children) {
551
+ if (node === properties) replacements2.set(node, propertyXml);
552
+ else if (node === firstLeaf) {
553
+ replacements2.set(node, node === textLeaf ? xml[nativeScalarTextSource](node, firstText ?? "", { preserveSpace: true }) + value.slice(firstTextMarkup.length) : value + retainedControlTrivia(xml, node, budget));
554
+ filled = true;
555
+ } else replacements2.set(node, retainedControlTrivia(xml, node, budget));
556
+ }
557
+ run = firstOpening + (properties ? "" : propertyXml) + xml.sourceXml(first, replacements2, true) + (filled ? "" : value) + `</${first.name}>`;
558
+ } else run = `<${name("r")}>${propertyXml}${value}</${name("r")}>`;
559
+ const paragraph = content.children[0]?.localName === "p" ? content.children[0] : void 0;
560
+ const pPr = paragraph && child(paragraph, "pPr");
561
+ const replacements = /* @__PURE__ */ new Map();
562
+ for (const node of content.children) {
563
+ if (node.localName === "p") {
564
+ const nested = new Map(node.children.map((element) => [element, element === first ? run : element === pPr ? xml.sourceXml(element) : retainedControlTrivia(xml, element, budget)]));
565
+ replacements.set(node, xml.sourceXml(node, nested, true));
566
+ } else replacements.set(node, node === first ? run : retainedControlTrivia(xml, node, budget));
567
+ }
568
+ const inner = xml.sourceXml(content, replacements, true) + (first ? "" : run);
569
+ return opening(content) + (paragraph ? opening(paragraph) + inner + `</${paragraph.name}>` : inner) + `</${content.name}>`;
570
+ }
571
+ function prepareControlPlaceholder(xml, node, item, context) {
572
+ const { budget } = archiveSettings(context), { one: child } = controlChildren(xml, budget);
573
+ const properties = child(node, "sdtPr"), content = child(node, "sdtContent");
574
+ if (!properties || !content || item.support !== "supported" || !["plain-text", "rich-text", "checkbox", "dropdown", "combo-box", "date"].includes(item.kind)) throw new UnsupportedEditError("A placeholder requires an admitted scalar control.");
575
+ let scalar;
576
+ if (item.kind === "checkbox") scalar = prepareControlValue(xml, node, item, { checked: false }, context, false);
577
+ else {
578
+ if (item.kind === "date") prepareControlValue(xml, node, item, { date: "2000-01-01" }, context);
579
+ const replacement = textReplacement(xml, content, "", budget);
580
+ scalar = () => xml.replaceElement(content, replacement);
581
+ }
582
+ const current = item.kind === "date" ? child(properties, "date") : item.kind === "dropdown" ? child(properties, "dropDownList") : item.kind === "combo-box" ? child(properties, "comboBox") : void 0;
583
+ let currentXml;
584
+ if (current && current.attributes.some((attribute) => attribute.namespace === node.namespace && ["fullDate", "lastValue"].includes(attribute.localName))) currentXml = `<${current.name}${current.attributes.filter((attribute) => attribute.namespace !== node.namespace || !["fullDate", "lastValue"].includes(attribute.localName)).map((attribute) => ` ${attribute.name}="${xmlValue(attribute.value)}"`).join("")}>${xml.sourceXml(current, /* @__PURE__ */ new Map(), true)}</${current.name}>`;
585
+ const existing = child(properties, "showingPlcHdr");
586
+ const prefix = properties.name.includes(":") ? properties.name.slice(0, properties.name.indexOf(":") + 1) : "";
587
+ const replacements = /* @__PURE__ */ new Map();
588
+ if (current && currentXml !== void 0) replacements.set(current, currentXml);
589
+ if (existing && !item.placeholder && item.kind !== "checkbox") {
590
+ const state = existing.attributes.find((attribute) => attribute.namespace === node.namespace && attribute.localName === "val");
591
+ const [head, tail] = xml[nativeElementSourceTokens](existing, state);
592
+ replacements.set(existing, head + xml.sourceXml(existing, /* @__PURE__ */ new Map(), true) + tail);
593
+ }
594
+ const propertyXml = opening(properties) + xml.sourceXml(properties, replacements, true) + (existing ? "" : `<${prefix}showingPlcHdr/>`) + `</${properties.name}>`;
595
+ return () => {
596
+ scalar();
597
+ if (item.kind !== "checkbox" && (!existing || currentXml !== void 0 || !item.placeholder)) xml.replaceElement(properties, propertyXml);
598
+ };
599
+ }
600
+ function prepareControlValue(xml, node, item, values, context, clearPlaceholder = true) {
601
+ const { budget } = archiveSettings(context);
602
+ const { text, checked, choice, date } = values;
603
+ const { one: child } = controlChildren(xml, budget);
604
+ const properties = child(node, "sdtPr"), content = child(node, "sdtContent");
605
+ if (!properties || !content || item.support !== "supported" || walk(content, budget).some((n) => n.namespace === node.namespace && n.localName === "sdt")) throw new UnsupportedEditError("Scalar filling requires an admitted leaf control.");
606
+ for (const owner of walk(content, budget)) {
607
+ budget.charge("work", owner.children.length + owner.attributes.length + 1);
608
+ if (!xml.compatibility.canEdit(owner) || owner.attributes.some((attribute) => attribute.namespace !== "http://www.w3.org/2000/xmlns/" && !xml.compatibility.canEdit(attribute))) throw new UnsupportedEditError("Affected control content is opaque.");
609
+ }
610
+ const stages = [];
611
+ const placeholder = child(properties, "showingPlcHdr");
612
+ let value, font;
613
+ if (["plain-text", "rich-text"].includes(item.kind) && text !== void 0) value = text;
614
+ else if (["dropdown", "combo-box"].includes(item.kind) && choice !== void 0) {
615
+ const declaration = item.choices.find((item2) => item2.value === choice);
616
+ if (!declaration) throw new InvalidValueError("Expected a declared control choice value.");
617
+ value = declaration.label;
618
+ } else if (item.kind === "checkbox" && checked !== void 0) {
619
+ const checkbox = child(properties, "checkbox", w14);
620
+ if (walk(checkbox, budget).some((owner) => !xml.compatibility.canEdit(owner) || owner.attributes.some((attribute) => attribute.namespace !== "http://www.w3.org/2000/xmlns/" && !xml.compatibility.canEdit(attribute)))) throw new UnsupportedEditError("Checkbox metadata includes unsupported elements or attributes.");
621
+ for (const name of ["checkedState", "uncheckedState"]) {
622
+ const state2 = child(checkbox, name, w14), glyph2 = attr(state2, "val", w14), font2 = attr(state2, "font", w14);
623
+ if (!glyph2 || glyph2.length > 6 || [...glyph2].some((c) => !"0123456789abcdefABCDEF".includes(c)) || !font2 || font2.trim() !== font2 || [...font2].some((c) => c.codePointAt(0) < 32)) throw new UnsupportedEditError("Checkbox requires both declared glyph and font mappings.");
624
+ const code2 = Number.parseInt(glyph2, 16);
625
+ if (code2 === 0 || code2 > 1114111 || code2 >= 55296 && code2 <= 57343) throw new UnsupportedEditError("Invalid checkbox Unicode glyph.");
626
+ }
627
+ const state = child(checkbox, checked ? "checkedState" : "uncheckedState", w14);
628
+ const glyph = attr(state, "val", w14);
629
+ font = attr(state, "font", w14) ?? void 0;
630
+ if (!glyph || glyph.length > 6 || [...glyph].some((c) => !"0123456789abcdefABCDEF".includes(c)) || !font || font.trim() !== font) throw new UnsupportedEditError("Checkbox requires a declared glyph and font.");
631
+ const code = Number.parseInt(glyph, 16);
632
+ if (code === 0 || code > 1114111 || code >= 55296 && code <= 57343) throw new UnsupportedEditError("Invalid checkbox Unicode glyph.");
633
+ value = String.fromCodePoint(code);
634
+ const current = child(checkbox, "checked", w14);
635
+ stages.push(() => xml.setAttribute(current, { namespace: w14, localName: "val" }, checked ? "1" : "0"));
636
+ } else if (item.kind === "date" && date !== void 0) {
637
+ const stored = child(properties, "date");
638
+ const format = attr(child(stored, "dateFormat"), "val") ?? "yyyy-MM-dd", language = attr(child(stored, "lid"), "val"), calendar = attr(child(stored, "calendar"), "val");
639
+ if (!["yyyy-MM-dd", "MM-dd-yyyy", "dd/MM/yyyy"].includes(format) || language !== null && !["en-US", "en-GB"].includes(language) || calendar !== null && calendar !== "gregorian") throw new UnsupportedEditError("Stored date formatting has no deterministic support.");
640
+ if (date.length !== 10 || date[4] !== "-" || date[7] !== "-" || [...date].some((c, index) => index !== 4 && index !== 7 && !"0123456789".includes(c))) throw new InvalidValueError("Expected a Gregorian date yyyy-MM-dd.");
641
+ const canonical = date + "T00:00:00Z";
642
+ parseStoredDateTime(canonical, "xsd");
643
+ value = format === "MM-dd-yyyy" ? date.slice(5, 7) + "-" + date.slice(8) + "-" + date.slice(0, 4) : format === "dd/MM/yyyy" ? date.slice(8) + "/" + date.slice(5, 7) + "/" + date.slice(0, 4) : date;
644
+ if (attr(stored, "fullDate") !== null) stages.push(() => xml.setAttribute(stored, { namespace: node.namespace, localName: "fullDate" }, canonical));
645
+ else {
646
+ const prefix = stored.name.includes(":") ? stored.name.slice(0, stored.name.indexOf(":") + 1) : "";
647
+ const replacement = opening(stored).slice(0, -1) + ` ${prefix}fullDate="${canonical}">` + xml.sourceXml(stored, /* @__PURE__ */ new Map(), true) + `</${stored.name}>`;
648
+ stages.push(() => xml.replaceElement(stored, replacement));
649
+ }
650
+ } else throw new UnsupportedEditError("The explicit value does not match the control type.");
651
+ if (value !== void 0) {
652
+ const replacement = textReplacement(xml, content, value, budget, font);
653
+ stages.push(() => xml.replaceElement(content, replacement));
654
+ }
655
+ if (placeholder && clearPlaceholder) {
656
+ const trivia = retainedControlTrivia(xml, placeholder, budget);
657
+ stages.push(() => xml.replaceElement(placeholder, trivia));
658
+ }
659
+ return () => {
660
+ for (const stage of stages) stage();
661
+ };
662
+ }
663
+ async function editDocumentControls(input, options, context) {
664
+ const settings = archiveSettings(context);
665
+ const { input: identity, ...args } = options;
666
+ closedRecord(options, [...Object.keys(args), "input"]);
667
+ const invocation = validateDocxInvocation({ operation: "controls.set", inputs: [identity?.path ?? "document"], options: args }, settings.budget);
668
+ const opts = invocation.options;
669
+ const budget = settings.budget.lower(Object.fromEntries((opts.limit ?? []).map((item) => [item.name, item.value])));
670
+ const { output, inPlace, force, dryRun, json, all, allowEmpty, text, checked, choice, date, file, ...selectors } = opts;
671
+ delete selectors.limit;
672
+ const result = await openControlInventory(input, selectors, { ...settings, budget });
673
+ assertDocumentEditable(result.archive, { ...settings, budget }, result.archive);
674
+ const chosen = result.document.select(result.items.map((item) => item.location), { ...all === void 0 ? {} : { all }, ...allowEmpty === void 0 ? {} : { allowEmpty } }, "mutation");
675
+ const stages = [];
676
+ let picture;
677
+ for (const location of chosen) {
678
+ budget.charge("work", 1);
679
+ const item = result.items.find((item2) => item2.location.token === location.token);
680
+ const xml = result.editor.xml(location.value.part.slice(1));
681
+ const ancestors = owners(xml.root, location.value.path);
682
+ const node = ancestors.at(-1);
683
+ const { one: child } = controlChildren(xml, budget);
684
+ if (item.support !== "supported" || item.binding || item.lock !== "unlocked" || result.document.references(location.token).length > 1) throw new UnsupportedEditError("This control is unsupported, bound, locked or shared.");
685
+ for (const owner of ancestors.slice(0, -1)) if (owner.namespace === node.namespace && owner.localName === "sdt") {
686
+ const ancestor = inspectControlSnapshot(owner, item.location, result.archive, { ...settings, budget }, xml);
687
+ if (ancestor.support !== "supported" || ancestor.kind === "unsupported") throw new UnsupportedEditError("Control ancestors require verified admission.");
688
+ const ancestorPr = child(owner, "sdtPr");
689
+ if (!ancestorPr || attr(child(ancestorPr, "lock"), "val") && attr(child(ancestorPr, "lock"), "val") !== "unlocked" || child(ancestorPr, "dataBinding")) throw new UnsupportedEditError("Control ancestors must be admitted, unlocked and unbound.");
690
+ }
691
+ const properties = child(node, "sdtPr"), content = child(node, "sdtContent");
692
+ if (containsRevision(node) || ancestors.slice(0, -1).some((owner) => ["ins", "del", "moveFrom", "moveTo"].includes(owner.localName))) throw new UnsupportedEditError("Control filling cannot cross revision owners.");
693
+ const story = result.document.list("story", { scope: "all-stories" }).filter((owner) => owner.value.story === location.value.story && pathContains(owner.value.path, location.value.path)).sort((a, b) => b.value.path.length - a.value.path.length)[0];
694
+ if (!story) throw new UnsupportedEditError("Controls require an admitted story owner.");
695
+ assertOutsideFields(parseFields(ancestors[story.value.path.length], story.value.path, budget, xml.compatibility.content), location.value.path);
696
+ assertOutsideRevisionRanges(xml.root, node, budget, xml.compatibility.branches);
697
+ if (walk(content, budget).some((n) => n.namespace === node.namespace && n.localName === "sdt")) throw new UnsupportedEditError("Scalar filling cannot erase nested controls.");
698
+ if (item.kind === "picture" && file !== void 0) {
699
+ if (!item.value || typeof item.value !== "object" || item.value.external || !item.value.contentType?.toLowerCase().startsWith("image/")) throw new UnsupportedEditError("Only an existing internal picture occurrence supports filling.");
700
+ picture ??= await acquireControlPng(file, { ...context, budget });
701
+ stages.push(() => replaceControlPicture(result.editor, result.archive, location.value.part, content, picture, { ...settings, budget }));
702
+ } else stages.push(prepareControlValue(xml, node, item, { ...text === void 0 ? {} : { text }, ...checked === void 0 ? {} : { checked }, ...choice === void 0 ? {} : { choice }, ...date === void 0 ? {} : { date } }, { ...settings, budget }));
703
+ if (item.kind === "picture") {
704
+ const placeholder = child(properties, "showingPlcHdr");
705
+ if (placeholder) {
706
+ const trivia = retainedControlTrivia(xml, placeholder, budget);
707
+ stages.push(() => xml.replaceElement(placeholder, trivia));
708
+ }
709
+ }
710
+ }
711
+ const changes = chosen.map((before) => {
712
+ const value = { ...before.value, generation: 1 };
713
+ return { kind: "replace", before, after: { ...before, value, token: encodeGeneratedLocation(value) } };
714
+ });
715
+ const prospective = { changed: chosen.length > 0, changes, output: dryRun ? null : { path: inPlace ? identity?.path ?? null : output ?? null, bytes: Math.min(settings.limits.maxArchiveBytes, Number.MAX_SAFE_INTEGER), sha256: "0".repeat(64) }, dryRun: dryRun ?? false };
716
+ budget.check("serializedOutput", new TextEncoder().encode(JSON.stringify({ version: 1, operation: "controls.set", ok: true, data: prospective, affected: changes.length, locations: changes.map((change) => change.after), warnings: [], errors: [] }) + "\n").length);
717
+ for (const stage of stages) stage();
718
+ const published = await publishDocumentArchive(finishControlPictures(result.editor, result.archive, { ...settings, budget }), { ...identity ? { input: identity } : {}, ...output === void 0 ? {} : { output }, ...inPlace === void 0 ? {} : { inPlace }, ...force === void 0 ? {} : { force }, ...dryRun === void 0 ? {} : { dryRun }, ...json === void 0 ? {} : { json } }, { ...context, budget }, result.archive);
719
+ return { ...prospective, output: published.published.length ? { path: published.published[0].path, bytes: published.published[0].bytes, sha256: published.archiveSha256 } : null };
720
+ }
721
+
722
+ export {
723
+ admitControlPng,
724
+ inspectControlSnapshot,
725
+ openControlInventory,
726
+ inspectDocumentControls,
727
+ prepareControlPlaceholder,
728
+ prepareControlValue,
729
+ editDocumentControls
730
+ };