@layers-app/editor 2.2.33 → 2.2.34

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 (226) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +6 -3
  3. package/dist/index.js +2 -2
  4. package/dist/{layers.B7ZGht99.js → layers.-7NO3sF0.js} +1 -1
  5. package/dist/{layers.DXO6zPOT.js → layers.1DmF4tKt.js} +1 -1
  6. package/dist/{layers.Sxz4W1rS.js → layers.62aKpKqc.js} +2 -2
  7. package/dist/{layers.DCU_gz3n.js → layers.7l5HzIov.js} +4 -4
  8. package/dist/{layers.BQ62mXQV.js → layers.9ZVT7HEz.js} +1 -1
  9. package/dist/{layers.Bm8YVBPc.js → layers.AXHCU5nZ.js} +1 -1
  10. package/dist/{layers.DWIw7AEA.js → layers.AjNdDNFi.js} +1 -1
  11. package/dist/{layers.BtvK_dP4.js → layers.B-yLZhdx.js} +2 -2
  12. package/dist/{layers.CjaMyaMT.js → layers.B7zxy-qY.js} +1 -1
  13. package/dist/{layers.DD6EJ608.js → layers.BAqL5adT.js} +1 -1
  14. package/dist/{layers.eXPrhKAF.js → layers.BCCATU39.js} +1 -1
  15. package/dist/{layers.BeuT3Z6s.js → layers.BCKQBx6j.js} +1 -1
  16. package/dist/layers.BCTgoLn8.js +423 -0
  17. package/dist/{layers.D5pHuIcl.js → layers.BD1n0O70.js} +1 -1
  18. package/dist/{layers.D6wj3xX3.js → layers.BD9JE30u.js} +1 -1
  19. package/dist/{layers.C3yGX5kz.js → layers.BDqmK_in.js} +1 -1
  20. package/dist/{layers.BxCyq8BY.js → layers.BFA_dxG4.js} +4186 -4135
  21. package/dist/layers.BGkyERg0.js +51 -0
  22. package/dist/{layers.Chq7Hknv.js → layers.BKsoMVRg.js} +1 -1
  23. package/dist/{layers.Cquqy0_l.js → layers.BLvE586B.js} +3 -3
  24. package/dist/{layers.CDr-Ndxm.js → layers.BNvvWwdW.js} +3 -3
  25. package/dist/{layers.Ce2kTtLV.js → layers.BOr6pOMY.js} +5 -5
  26. package/dist/layers.BPKFvBh7.js +1184 -0
  27. package/dist/{layers.PbMdplyR.js → layers.BR_cJiAm.js} +3 -3
  28. package/dist/{layers.BSJW-g4y.js → layers.BRhHvV3E.js} +1 -1
  29. package/dist/{layers.5BubRYdE.js → layers.BRuo9c7v.js} +1 -1
  30. package/dist/{layers.CtX3T5Fj.js → layers.BTmINjFN.js} +1 -1
  31. package/dist/{layers.b-pAfczX.js → layers.BUJGUIMm.js} +1 -1
  32. package/dist/layers.BV_xbv4c.js +1 -0
  33. package/dist/{layers.mzkQHlwt.js → layers.BVpxB-tC.js} +1 -1
  34. package/dist/{layers.BBn22rJB.js → layers.BXU8Rjxi.js} +1 -1
  35. package/dist/{layers.U_V-_zTv.js → layers.BXZ_aU2D.js} +1 -1
  36. package/dist/{layers.Dj4wQqGv.js → layers.BYnb6pit.js} +1 -1
  37. package/dist/{layers.BS2DF3jG.js → layers.BYqkZC5T.js} +2 -2
  38. package/dist/{layers.Bpuo8oxW.js → layers.BZX2DmB-.js} +10 -10
  39. package/dist/layers.BbbH0QJR.js +712 -0
  40. package/dist/layers.Bbvds-w9.js +425 -0
  41. package/dist/{layers.CZUMmsmb.js → layers.BdnXtWWH.js} +1 -1
  42. package/dist/{layers.Bb65TKkX.js → layers.Be9rsJXO.js} +4 -4
  43. package/dist/{layers.C_IvrzZ3.js → layers.BgOa2ZQq.js} +1 -1
  44. package/dist/{layers.DbgQNlgz.js → layers.BgzMxr1R.js} +6 -6
  45. package/dist/{layers.11zS3nH-.js → layers.BgznhpFe.js} +1 -1
  46. package/dist/{layers.BlNwjDtW.js → layers.Bhny7kih.js} +1 -1
  47. package/dist/{layers.B7K7JjK6.js → layers.BiJ8hfRt.js} +3 -3
  48. package/dist/{layers.BXvq0BXI.js → layers.Bj4UROcQ.js} +1 -1
  49. package/dist/{layers.BbLRQr0P.js → layers.Bjvhih6Z.js} +1 -1
  50. package/dist/{layers.DxvJY5-b.js → layers.BkjycMjL.js} +11 -11
  51. package/dist/{layers.e5Ps2fZd.js → layers.BlBJySZS.js} +1 -1
  52. package/dist/{layers.BRsFXwxT.js → layers.BpPbVKn9.js} +1 -1
  53. package/dist/{layers.BmOv9-A8.js → layers.Bpj0YhCa.js} +1 -1
  54. package/dist/{layers.BSYT_xKG.js → layers.Bsd4mdzA.js} +1 -1
  55. package/dist/{layers.DGAtI7hW.js → layers.BtZSenNp.js} +1 -1
  56. package/dist/{layers.Vg7ThVpg.js → layers.BtyXMKri.js} +4 -4
  57. package/dist/{layers.CvfC23nG.js → layers.BvpDBLNz.js} +1 -1
  58. package/dist/{layers.ByaVvbf5.js → layers.BxKHZrG2.js} +1 -1
  59. package/dist/{layers.R191BWlP.js → layers.Bxvn4sbr.js} +1 -1
  60. package/dist/{layers.LFoN5hbI.js → layers.Bxy_fQLQ.js} +1 -1
  61. package/dist/{layers.DwuoyzsD.js → layers.BxyxeOxS.js} +1 -1
  62. package/dist/{layers.C9iKbwsR.js → layers.BzqhyIgD.js} +1 -1
  63. package/dist/{layers.Aysg2cVS.js → layers.BzuXgEEf.js} +1 -1
  64. package/dist/{layers.B_mtSFPo.js → layers.C-kxmGbz.js} +1 -1
  65. package/dist/{layers.Dqi7h2Q7.js → layers.C0pSljYJ.js} +4 -4
  66. package/dist/{layers.lDO2-gLK.js → layers.C2W7aEaa.js} +1 -1
  67. package/dist/{layers.CxdbNQGd.js → layers.C35E8Mfl.js} +310 -319
  68. package/dist/{layers.BkMwXL1z.js → layers.C3SW8Mdg.js} +1 -1
  69. package/dist/{layers.0Vi7zUwD.js → layers.C3wYFtpx.js} +1 -1
  70. package/dist/{layers.Bq8-wPMJ.js → layers.C4FXVRG5.js} +7 -7
  71. package/dist/{layers.DbxX3LlX.js → layers.C6Db73al.js} +1 -1
  72. package/dist/{layers.D7S2g3Zn.js → layers.C8uU26O0.js} +4 -4
  73. package/dist/{layers.C4o1L5D0.js → layers.CAHRW1Dn.js} +1 -1
  74. package/dist/{layers.Ba1gGwv3.js → layers.CAcJLldS.js} +1 -1
  75. package/dist/{layers.CMvDkweV.js → layers.CAqA8_We.js} +1 -1
  76. package/dist/layers.CB1oizMw.js +10148 -0
  77. package/dist/{layers.CX12MXEe.js → layers.CCT1j2K2.js} +1 -1
  78. package/dist/layers.CCYdlqAu.js +108 -0
  79. package/dist/{layers.B3Xn8e8g.js → layers.CEPj5BrP.js} +1 -1
  80. package/dist/{layers.DIaVm5OR.js → layers.CFnNEB1b.js} +1 -1
  81. package/dist/{layers.XcqUuTv-.js → layers.CGupETfI.js} +1 -1
  82. package/dist/{layers.at9fgK8S.js → layers.CH6jkyJ8.js} +1 -1
  83. package/dist/{layers.B0EBevXo.js → layers.CHVlBk6o.js} +1 -1
  84. package/dist/{layers.ByZcKR8e.js → layers.CHXLBBQE.js} +1 -1
  85. package/dist/{layers.mbXQF9Os.js → layers.CJ-PV-3b.js} +1 -1
  86. package/dist/{layers.33-ahpjw.js → layers.CK1vtY0y.js} +1 -1
  87. package/dist/{layers.D_RjtdPH.js → layers.CLKjJ9e8.js} +1 -1
  88. package/dist/{layers.0o_mcXuK.js → layers.CM7Bxaav.js} +1 -1
  89. package/dist/{layers.BvP1NTU-.js → layers.CMETmVLL.js} +1 -1
  90. package/dist/{layers.Dl6IzyRf.js → layers.CQaKvOrk.js} +1 -1
  91. package/dist/{layers.Dm2am7m_.js → layers.CWqTmJU_.js} +1 -1
  92. package/dist/{layers.B8KrIHaa.js → layers.CXA8nzgs.js} +1 -1
  93. package/dist/{layers.BNP2qpAB.js → layers.C_IPZu_J.js} +213 -207
  94. package/dist/{layers.Bi-UML1o.js → layers.C_P7Qtde.js} +1 -1
  95. package/dist/{layers.BXFVPf3f.js → layers.C_ozR_5i.js} +1 -1
  96. package/dist/{layers.Cekz1TKm.js → layers.CedaYHze.js} +1 -1
  97. package/dist/layers.Cf6xfpQ2.js +1 -0
  98. package/dist/{layers.DXLaHTQo.js → layers.CfY_Q0EV.js} +2 -2
  99. package/dist/{layers.Cw-BKEkX.js → layers.CgKDJMSQ.js} +1 -1
  100. package/dist/{layers.D9CUHPyt.js → layers.CgxFsNV3.js} +1 -1
  101. package/dist/{layers.D47XXHli.js → layers.CjHxh0pS.js} +1 -1
  102. package/dist/{layers.Bm5jy63e.js → layers.CjqLPuxF.js} +1 -1
  103. package/dist/{layers.Bd_nrKhY.js → layers.Clc0Yi4b.js} +1 -1
  104. package/dist/{layers.CVrH8v9R.js → layers.CnE67W86.js} +1 -1
  105. package/dist/{layers.DDV4XMRB.js → layers.CnYoN798.js} +3 -3
  106. package/dist/{layers.BgvfS9e4.js → layers.CoP_rm5t.js} +1 -1
  107. package/dist/{layers.CNhs-lcF.js → layers.Cp-EYA4J.js} +1 -1
  108. package/dist/{layers.Ci_sdUkp.js → layers.CqGiRa65.js} +1 -1
  109. package/dist/{layers.BZGx2EQn.js → layers.CrSJTUx1.js} +1 -1
  110. package/dist/layers.CvJkDLhe.js +7 -0
  111. package/dist/{layers.Dqj5gM19.js → layers.CvPG6pNZ.js} +1 -1
  112. package/dist/{layers.CtEmey_v.js → layers.Cw2zMz-9.js} +1 -1
  113. package/dist/{layers.CkdxYWbh.js → layers.Cw5haeZS.js} +1 -1
  114. package/dist/{layers.BPONxlKU.js → layers.CwQ4VeLb.js} +1 -1
  115. package/dist/{layers.62q8eKLk.js → layers.CxIPKZpn.js} +1 -1
  116. package/dist/{layers.CO1-Yxt9.js → layers.CxpsxX-s.js} +1 -1
  117. package/dist/{layers.BZSHd7TE.js → layers.Cz9txP0z.js} +2 -2
  118. package/dist/{layers.CTPHWlO-.js → layers.CzG7CSOt.js} +1 -1
  119. package/dist/layers.CzMOc4SJ.js +1 -0
  120. package/dist/{layers.WopHkBbN.js → layers.D12uenvh.js} +1 -1
  121. package/dist/{layers.Uu3zEI5p.js → layers.D47f0O9z.js} +1 -1
  122. package/dist/{layers.BGudEvx4.js → layers.D4ezQ9mn.js} +1 -1
  123. package/dist/{layers.DxIGjs1i.js → layers.D63-tSZu.js} +1 -1
  124. package/dist/{layers.B9LiF-px.js → layers.D6eeEZEZ.js} +1 -1
  125. package/dist/{layers.BWDgxW7G.js → layers.DBsqXxWn.js} +3 -3
  126. package/dist/{layers.PQK6INWS.js → layers.DG4aenEn.js} +4 -4
  127. package/dist/{layers.BrvE_IQV.js → layers.DGwVREuq.js} +1 -1
  128. package/dist/{layers.sdJH36mL.js → layers.DLTYGpnh.js} +1 -1
  129. package/dist/{layers.Nyijtn5O.js → layers.DLtOvFyl.js} +1 -1
  130. package/dist/{layers.Bhpr_gru.js → layers.DNZnclNw.js} +1 -1
  131. package/dist/{layers.CF0Qnb16.js → layers.DNdccQ3X.js} +1 -1
  132. package/dist/{layers.DFmzvD4t.js → layers.DOQIVEl2.js} +1 -1
  133. package/dist/{layers.D3Qsn1GG.js → layers.DQlbk8ru.js} +1 -1
  134. package/dist/{layers.DfgnJnK3.js → layers.DSMqpyrY.js} +1 -1
  135. package/dist/{layers.oMWGVo9J.js → layers.DSxaM_C_.js} +1 -1
  136. package/dist/{layers.BJAJy6Po.js → layers.DVDHpSTN.js} +1 -1
  137. package/dist/{layers.npsKwKgz.js → layers.DWX8mo3k.js} +1 -1
  138. package/dist/{layers.C1mC-Ib9.js → layers.DXMZ96_T.js} +1 -1
  139. package/dist/{layers.DbZmzcSW.js → layers.DYJSR0rr.js} +1 -1
  140. package/dist/{layers.P_AztHHy.js → layers.DYq0dsDx.js} +1 -1
  141. package/dist/layers.DZkrdPR-.js +8 -0
  142. package/dist/{layers.DG9Ae4Nk.js → layers.DbYCZCPK.js} +1 -1
  143. package/dist/{layers.CA20VztZ.js → layers.DfMii-8O.js} +1 -1
  144. package/dist/layers.Dfw5f73c.js +6 -0
  145. package/dist/{layers.ClA8-0p3.js → layers.Dgg-2PYF.js} +1 -1
  146. package/dist/{layers.DVs7W7v6.js → layers.DhI7ib32.js} +1 -1
  147. package/dist/{layers.Bn532tCf.js → layers.DhU-Ev5I.js} +1 -1
  148. package/dist/{layers.wCa1U247.js → layers.DhY1IflE.js} +2 -2
  149. package/dist/{layers.2XFe00xm.js → layers.DiEL5C_V.js} +1 -1
  150. package/dist/{layers.BuQXpzXw.js → layers.DiYXWt2i.js} +1 -1
  151. package/dist/{layers.BK9trDCg.js → layers.DjJX6jBF.js} +1 -1
  152. package/dist/{layers.B35se_4u.js → layers.Djb5nbBe.js} +1 -1
  153. package/dist/{layers.Dj2lCoEF.js → layers.DlumEQc1.js} +1 -1
  154. package/dist/{layers.13V4lYeA.js → layers.DmIJgOCO.js} +1 -1
  155. package/dist/{layers.DRZpDMta.js → layers.DmksjS0_.js} +1 -1
  156. package/dist/{layers.Bu2QbA9d.js → layers.DouXhXft.js} +1 -1
  157. package/dist/{layers.eWKubsts.js → layers.DqCmK10P.js} +1 -1
  158. package/dist/{layers.DIy_oHY5.js → layers.DqEXy-_5.js} +5 -5
  159. package/dist/layers.DqFFNjH9.js +1 -0
  160. package/dist/{layers.DssscBzR.js → layers.DsJNv5i0.js} +6 -6
  161. package/dist/{layers.DttYVy_J.js → layers.DtiXHHJE.js} +1 -1
  162. package/dist/{layers.DxMIO39H.js → layers.Duw020QK.js} +1 -1
  163. package/dist/{layers.DQ2o8OqN.js → layers.Dz9rzIZb.js} +2 -6
  164. package/dist/{layers.No_qWfWQ.js → layers.EpemsQIr.js} +1 -1
  165. package/dist/{layers.BhBHJgBL.js → layers.Ezc4BeM9.js} +1 -1
  166. package/dist/{layers.CjUqUdmp.js → layers.GkmikDwG.js} +1 -1
  167. package/dist/{layers.Bgn6a2GG.js → layers.I7_mCvr7.js} +1 -1
  168. package/dist/{layers.DYHEpyal.js → layers.IEJ1HpP5.js} +1 -1
  169. package/dist/{layers.CnHCpdR5.js → layers.JQxQPRfx.js} +8 -8
  170. package/dist/{layers.Cu7ksl8C.js → layers.LUu6j3Ux.js} +1 -1
  171. package/dist/{layers.B25SxzTP.js → layers.MVi3qlKo.js} +1 -1
  172. package/dist/{layers.B_ZNAibm.js → layers.MXiN6Q8E.js} +1 -1
  173. package/dist/{layers.sX-N6f-X.js → layers.MYz_EovV.js} +1 -1
  174. package/dist/{layers.CIfLRc4G.js → layers.MecBxGYC.js} +1 -1
  175. package/dist/{layers.CGthUzwK.js → layers.N0rnhoxR.js} +3 -3
  176. package/dist/{layers.DSdw9iBY.js → layers.NW-uOSQC.js} +1 -1
  177. package/dist/{layers.BHVbbVM3.js → layers.Qu9Vw2Ca.js} +1 -1
  178. package/dist/{layers.DDhgxtUI.js → layers.RuKKxMMT.js} +1 -1
  179. package/dist/{layers.B62DUynq.js → layers.SUWnLpc6.js} +1 -1
  180. package/dist/layers.S_MGsLpp.js +1 -0
  181. package/dist/layers.UmQE8CTg.js +16 -0
  182. package/dist/{layers.UQsTY2_f.js → layers.VJkeXPgm.js} +1 -1
  183. package/dist/{layers.rAwleLb5.js → layers.VXzWyF0X.js} +1 -1
  184. package/dist/{layers.BwQjqL4U.js → layers.VjeHIZx1.js} +1 -1
  185. package/dist/{layers.aeMx-dZy.js → layers.VpNxXdcm.js} +27021 -24987
  186. package/dist/{layers.B2D2pRUZ.js → layers.WW3y04TX.js} +1 -1
  187. package/dist/{layers.C_PCtlGp.js → layers.WaVtVndO.js} +1 -1
  188. package/dist/{layers.CyJ3zCcJ.js → layers.XqS0_cuC.js} +3 -3
  189. package/dist/layers.ZwEr5VSd.js +1 -0
  190. package/dist/layers._kmgifnq.js +198 -0
  191. package/dist/{layers.lGJA4sX0.js → layers._tpJNvcR.js} +1 -1
  192. package/dist/{layers.BatZPdTA.js → layers.aeIKIrBQ.js} +1 -1
  193. package/dist/{layers.FrBuDYti.js → layers.bbO_Culg.js} +4 -4
  194. package/dist/{layers.Bu9UI0rm.js → layers.d7A5PqJD.js} +8829 -8493
  195. package/dist/{layers.Bc54JKn0.js → layers.dgvnhsDC.js} +3 -3
  196. package/dist/{layers.C4wJUWfs.js → layers.eLjrRbzd.js} +118 -118
  197. package/dist/{layers.CP9cLYnb.js → layers.iBgiL6_n.js} +1 -1
  198. package/dist/{layers.DS8PUgx8.js → layers.lLesHlwQ.js} +1 -1
  199. package/dist/{layers.D2dhgTvn.js → layers.t-25wP24.js} +3 -3
  200. package/dist/{layers.BxIRTiwp.js → layers.t74ubzfQ.js} +1 -1
  201. package/dist/{layers.jZkrHvXr.js → layers.uI9EVZI8.js} +1 -1
  202. package/dist/{layers.Dx1HmmK6.js → layers.vd5USe0a.js} +1 -1
  203. package/dist/{layers.BZ4HlzSD.js → layers.vuVHRMIE.js} +1 -1
  204. package/dist/{layers.DqVYkmLW.js → layers.wdKTCbrw.js} +22 -22
  205. package/dist/{layers.BiO_NsMf.js → layers.xV-eFixu.js} +1 -1
  206. package/dist/{layers.6H2zyV_l.js → layers.xwOmSsDt.js} +1 -1
  207. package/dist/{layers.CSZz7L5U.js → layers.yNYFjN-_.js} +3 -3
  208. package/package.json +80 -80
  209. package/dist/layers.BE-8PTGn.js +0 -8
  210. package/dist/layers.BLb2sMQb.js +0 -6
  211. package/dist/layers.BmsYkqws.js +0 -198
  212. package/dist/layers.CCHSBu9E.js +0 -1
  213. package/dist/layers.CPW4oOZw.js +0 -51
  214. package/dist/layers.CSh0QIjy.js +0 -96
  215. package/dist/layers.CSyRuyoI.js +0 -425
  216. package/dist/layers.CXTiBlTx.js +0 -1
  217. package/dist/layers.ChjnQ95y.js +0 -423
  218. package/dist/layers.DH9xWpi3.js +0 -702
  219. package/dist/layers.DHpF5Ivu.js +0 -1
  220. package/dist/layers.DW_caqJl.js +0 -1
  221. package/dist/layers.DYp6gKLZ.js +0 -1
  222. package/dist/layers.Dy2EPrL7.js +0 -6
  223. package/dist/layers.PZJQajYh.js +0 -16
  224. package/dist/layers.RKJPLzHI.js +0 -907
  225. package/dist/layers.RzXeW7Uk.js +0 -8590
  226. package/dist/layers.oOixTye-.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),s=require("react"),M=require("react-i18next"),O=require("@lexical/react/LexicalComposerContext"),b=require("@mantine/core"),I=require("lexical"),t=require("./layers.RKJPLzHI.js"),q=require("@layers-app/shared"),ne=require("@lexical/react/useLexicalEditable"),$=require("@mantine/hooks");require("@lexical/react/LexicalDecoratorBlockNode");require("@lexical/utils");require("@lexical/mark");require("@lexical/code");require("@lexical/selection");require("react-dom");require("@lexical/react/LexicalErrorBoundary");require("@lexical/react/LexicalBlockWithAlignableContents");require("@mantine/notifications");function ie(e,i){const n=document.createElement("a");n.href=e,n.download=i,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove()}function z(e){try{const n=new URL(e,window.location.origin).pathname.split("/").pop()||"image";return n.includes(".")?n:`${n}.png`}catch{return"image"}}async function R(e,i){const n=await fetch(e);if(!n.ok)throw new Error("fetch failed");const r=await n.blob(),c=URL.createObjectURL(r);try{ie(c,i)}finally{setTimeout(()=>URL.revokeObjectURL(c),0)}}function X({opened:e,onOpenChange:i,t:n,onDownload:r,onDelete:c}){return o.jsxs(b.Menu,{opened:e,onChange:i,transitionProps:t.animationMenu,shadow:"md",position:"bottom-start",offset:4,withinPortal:!0,closeOnItemClick:!0,children:[o.jsx(b.Menu.Target,{children:o.jsx(t.ActionIcon,{label:n("editor.toolbar.more"),icon:t.K1,iconColor:"var(--mantine-color-gray-text)","aria-label":n("editor.toolbar.more")})}),o.jsxs(b.Menu.Dropdown,{p:4,w:164,onMouseDown:l=>l.preventDefault(),children:[o.jsx(b.Menu.Item,{leftSection:o.jsx(b.Flex,{align:"center",justify:"center",c:"gray.6",children:o.jsx(t.HugeiconsIcon,{icon:t.Tm,size:16})}),onClick:l=>{l.stopPropagation(),r()},children:n("editor.gallery.download")}),o.jsx(b.Menu.Item,{color:"red",leftSection:o.jsx(b.Flex,{align:"center",justify:"center",c:"red.6",children:o.jsx(t.HugeiconsIcon,{icon:t.lg,size:16})}),onClick:l=>{l.stopPropagation(),c()},children:n("editor.contextMenu.delete")})]})]})}const Y=({t:e,src:i,setShown:n,id:r})=>{const[c,{open:l,close:h}]=$.useDisclosure(!1),u=s.useMemo(()=>[{id:!r||r==="0"?"":r,Url:i??"",contentType:"image/*",originalFileName:"",fileSize:0,storageType:"",storagePath:"",fileName:"",parentType:"",parentId:"",ownerId:"",createdAt:new Date,updatedAt:new Date,version:0,deleted:!1,deletedAt:new Date}],[i,r]),m=p=>{p?l():h()};return o.jsxs(o.Fragment,{children:[o.jsx(q.AttachmentsGalleryModal,{opened:c,onOpenChange:m,attachments:u}),o.jsx(t.ActionIcon,{label:e("editor.image.preview"),icon:t.gn,iconColor:"var(--mantine-color-gray-text)","aria-label":e("editor.image.preview"),onClick:()=>{n(!1),l()}})]})},ae=({nodeKey:e,src:i})=>{const[n]=O.useLexicalComposerContext(),r=ne.useLexicalEditable(),[c,l]=s.useState(!1),[h,u]=s.useState(!1),{t:m}=M.useTranslation(),p=s.useCallback(()=>{n.update(()=>{const w=I.$getNodeByKey(e);t.$isImageNode(w)&&w.remove()})},[n,e]),y=s.useCallback(async()=>{if(i)try{await R(i,z(i))}catch{}},[i]);return o.jsxs("div",{className:`media-actions ${r?"":"media-actions--readonly"}`,children:[o.jsx(Y,{t:m,src:i,setShown:()=>{}}),r&&o.jsxs(o.Fragment,{children:[o.jsx(t.NodeAlignmentMenu,{opened:c,setOpened:l,t:m,editor:n,nodeKey:e,setShown:()=>{}}),o.jsx(X,{opened:h,onOpenChange:u,t:m,onDownload:()=>void y(),onDelete:p})]})]})},re=()=>{};function se({nodeKey:e,src:i,id:n}){const{t:r}=M.useTranslation(),[c]=O.useLexicalComposerContext(),[l,h]=s.useState(!1),[u,m]=s.useState(!1),p=s.useCallback(()=>{m(!1),c.update(()=>{const w=I.$getNodeByKey(e);if(!t.$isImageNode(w))return;const j=w.getParent();t.$isImageOverlayWrapperNode(j)?j.remove():w.remove()})},[c,e]),y=s.useCallback(async()=>{if(i)try{await R(i,z(i))}catch{}},[i]);return o.jsxs("div",{className:"media-actions visible",style:{position:"absolute",top:10,right:10,zIndex:10,pointerEvents:"auto",display:"flex",gap:4},onClick:w=>w.stopPropagation(),children:[o.jsx(Y,{t:r,src:i,setShown:re,id:n}),o.jsx(t.NodeAlignmentMenu,{opened:l,setOpened:h,t:r,editor:c,nodeKey:e}),o.jsx(X,{opened:u,onOpenChange:m,t:r,onDownload:()=>void y(),onDelete:p})]})}function le({nodeKey:e,src:i,id:n}){const{t:r}=M.useTranslation(),[c]=O.useLexicalComposerContext(),[l,{open:h,close:u}]=$.useDisclosure(!1),[m,{open:p,close:y}]=$.useDisclosure(!1),w=s.useMemo(()=>[{id:!n||n==="0"?"":n,Url:i??"",contentType:"image/*",originalFileName:"",fileSize:0,storageType:"",storagePath:"",fileName:"",parentType:"",parentId:"",ownerId:"",createdAt:new Date,updatedAt:new Date,version:0,deleted:!1,deletedAt:new Date}],[i,n]),j=()=>{u(),p()},S=s.useCallback(async()=>{if(u(),!!i)try{await R(i,z(i))}catch{}},[i,u]),v=s.useCallback(()=>{u(),c.update(()=>{const d=I.$getNodeByKey(e);t.$isImageNode(d)&&d.remove()})},[c,e,u]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"image-touch-actions",style:{position:"absolute",top:8,right:8,zIndex:10,pointerEvents:"auto"},onClick:d=>d.stopPropagation(),children:o.jsx(t.ActionIcon,{label:r("editor.toolbar.more"),icon:t.O1,iconColor:"var(--mantine-color-gray-text)","aria-label":r("editor.toolbar.more"),onClick:h})}),o.jsx(q.AttachmentsGalleryModal,{opened:m,onOpenChange:d=>d?p():y(),attachments:w}),o.jsx(t.MobileDrawer,{opened:l,onClose:u,title:r("editor.image.mobileActions"),children:o.jsxs(b.Stack,{gap:4,p:0,children:[o.jsx(b.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:j,leftSection:o.jsx(t.HugeiconsIcon,{icon:t.gn,size:16,color:"var(--mantine-color-dimmed)"}),children:r("editor.image.previewFullScreen")}),o.jsx(b.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:()=>void S(),leftSection:o.jsx(t.HugeiconsIcon,{icon:t.Tm,size:16,color:"var(--mantine-color-dimmed)"}),children:r("editor.gallery.download")}),o.jsx(b.Button,{type:"button",variant:"subtle",color:"red",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:v,leftSection:o.jsx(t.HugeiconsIcon,{icon:t.lg,size:16,color:"var(--mantine-color-red-6)"}),children:r("editor.actions.delete")})]})})]})}const K=e=>{const{width:i,height:n,isLoading:r,isError:c,src:l,id:h,altText:u,imageRef:m,maxWidth:p}=e;return o.jsxs("div",{className:"media-wrapper",style:{width:i,height:n,display:"inline-flex",position:"relative"},children:[o.jsx(b.LoadingOverlay,{visible:r,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),o.jsx(ce,{className:null,src:l,altText:u,imageRef:m,width:"inherit",height:"inherit",maxWidth:p||"auto",id:h}),t.IS_TOUCH_DEVICE&&o.jsx(le,{nodeKey:e.nodeKey,src:l,id:h}),t.IS_TOUCH_TABLET&&o.jsx(se,{nodeKey:e.nodeKey,src:l,id:h}),t.IS_HOVER_CAPABLE&&!t.IS_TOUCH_DEVICE&&!t.IS_TOUCH_TABLET&&o.jsx(ae,{nodeKey:e.nodeKey,src:l})]})};function ce({altText:e,className:i,imageRef:n,src:r,width:c,height:l,maxWidth:h,id:u}){const[m,p]=s.useState(!1);return o.jsx("img",{className:`${i||void 0} ${m?"":"loading"}`,src:r,alt:e,ref:n,style:{height:l,maxWidth:h,width:c},onLoad:()=>{r.includes("splash")?setTimeout(()=>{p(!0)},100):p(!0)},draggable:"false","data-id":u})}function de(e){const{disable:i}=s.useContext(t.Context);return i&&t.ImageNode.isPlaceholderSrc(e.src)?null:o.jsx(ue,{...e})}function ue({src:e,altText:i,nodeKey:n,width:r,height:c,maxWidth:l,showCaption:h,caption:u,id:m,create:p,alignment:y,imagePickerTab:w}){var V,G;const j=s.useRef(null),[S,v]=s.useState(!0),[d]=O.useLexicalComposerContext(),[N,k]=s.useState(!0),[C,P]=s.useState({width:0,height:0}),{start:W}=t.useCancelUpload(),[ge,L]=s.useState(0),{fetchUploadMedia:D,fetchDeleteMedia:H,maxFileSize:me,imperativeHandleRef:A,disable:Z}=s.useContext(t.Context),T=t.mediaMap.has(e)&&(((V=t.mediaMap.get(e))==null?void 0:V.mediaNodeKeys.length)===0||((G=t.mediaMap.get(e))==null?void 0:G.mediaNodeKeys.length)===void 0||e.trim()===""),{t:E}=M.useTranslation(),[he,J]=s.useState(0);s.useEffect(()=>d.registerDecoratorListener(()=>{J(a=>a+1)}),[T]),s.useEffect(()=>{if(!e||e.startsWith("data:image/")||!e.trim()){v(!1);return}const a=new Image;a.src=e,a.onload=()=>v(!1),a.onerror=()=>{v(!1)}},[e,T]);const Q=(a,f)=>{d.update(()=>{I.$setSelection(null);const g=I.$getNodeByKey(n);t.$isImageNode(g)&&g.setWidthAndHeight(a,f)})},{historyState:B}=t.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:F}}=t.useSettings();function ee(a){return a.endsWith(".svg")||a.includes("image/svg+xml")}function te(a){return new Promise((f,g)=>{if(ee(a)){f(0);return}const x=new Image;x.src=a,x.onload=()=>{f(x.width)},x.onerror=()=>{g(new Error("Failed to load image"))}})}s.useEffect(()=>{let a=r,f=c,g=100;(e.includes("unsplash")?e.trim():!T&&e.trim()||e.includes("upload-src-editor"))&&e!=="upload"&&te(e).then(x=>{typeof a=="number"&&a<g&&x<g?(k(!0),P({width:a,height:f})):x<g?(k(!0),P({width:"auto",height:"auto"})):(P({width:x,height:x}),k(!1))}).catch(x=>{console.warn("Ошибка при загрузке изображения:",x.message)})},[e,T]),s.useEffect(()=>{C.width&&C.height&&N&&d.update(()=>{const a=I.$getNodeByKey(n);t.$isImageNode(a)&&a.setWidthAndHeight(C.width,C.height)})},[C.width,C.height,N]);const oe=s.useCallback(a=>t.$writeImagePickerTabToNode(d,n,a),[d,n]),U=s.useCallback((a,f)=>{v(!1),d.update(()=>{const g=I.$getNodeByKey(n);t.$isImageNode(g)&&(g.setSrc(a),g.setId(f))})},[d,n]),_=s.useCallback(a=>{v(!0);const f=W();D&&D(a[0],(g,x)=>{U(g,x),L(0)},g=>{g&&q.showErrorNotification({message:E("editor.gallery.errorFile")}),L(0),U(e.startsWith("blob:")?"upload":"","")},f,g=>{L(g)})},[D,W,E,U,e]);return s.useEffect(()=>d.registerCommand(t.UPLOAD_IMAGE_COMMAND,a=>!e.startsWith("blob:")&&e!=="upload"||a.targetNodeKey!==n?!1:(_(a.files),!0),I.COMMAND_PRIORITY_LOW),[d,_,n,e]),!e||e==="upload"?o.jsx(b.Box,{"data-editor-image-picker-drop-root":!0,w:"100%",children:o.jsx(t.ImagePicker,{inline:!0,nodeKey:n,defaultTabValue:w,onWriteTabToNode:oe,uploading:!1,onUpload:a=>{!D||!a.length||_(a)},popoverProps:{opened:!0,position:"bottom",zIndex:t.EDITOR_UI_MIN_Z_INDEX},onChange:a=>{d.update(()=>{const f=I.$getNodeByKey(n);t.$isImageNode(f)&&f.setSrc(a)})}})}):N?o.jsx(K,{width:C.width,height:C.height,isLoading:S,isError:!1,isIcon:N,src:e,id:m,editor:d,nodeKey:n,fetchDeleteMedia:H,altText:i,imageRef:j,maxWidth:l,showCaption:h,caption:u,isCollabActive:!1,historyState:B,showNestedEditorTreeView:F,t:E}):o.jsx(t.ResizableContainer,{editor:d,isIcon:N,width:t.parseContainerSize(r),height:t.parseContainerSize(c),initialWidth:C.width||"",initialHeight:C.height||"",onResizeEnd:Q,alignment:y,disable:Z,onRegisterDecoratorEnter:a=>{A!=null&&A.current&&(A.current.decoratorEnterAction=a)},onActivate:()=>d.dispatchCommand(t.ON_CHANGE_COMMAND,"show_menu"),children:o.jsx(K,{width:"inherit",height:"inherit",isLoading:S,isError:!1,isIcon:N,src:e,id:m,editor:d,nodeKey:n,fetchDeleteMedia:H,altText:i,imageRef:j,maxWidth:l,showCaption:h,caption:u,isCollabActive:!1,historyState:B,showNestedEditorTreeView:F,t:E})})}exports.default=de;
@@ -1,51 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./layers.CSh0QIjy.js"),pt=require("./layers.BLd2spTm.js");require("lodash-es");const _t=require("./layers.Cyzu9PKQ.js");require("./layers.BmsYkqws.js");require("lodash-es/memoize.js");require("lodash-es/merge.js");require("lodash-es/isEmpty.js");const gt=require("./layers.DD6EJ608.js"),Et=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function mt(t){return typeof t=="string"&&Et.test(t)}const M=[];for(let t=0;t<256;++t)M.push((t+256).toString(16).slice(1));function kt(t,e=0){return M[t[e+0]]+M[t[e+1]]+M[t[e+2]]+M[t[e+3]]+"-"+M[t[e+4]]+M[t[e+5]]+"-"+M[t[e+6]]+M[t[e+7]]+"-"+M[t[e+8]]+M[t[e+9]]+"-"+M[t[e+10]]+M[t[e+11]]+M[t[e+12]]+M[t[e+13]]+M[t[e+14]]+M[t[e+15]]}function xt(t){if(!mt(t))throw TypeError("Invalid UUID");let e;const r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}function Ot(t){t=unescape(encodeURIComponent(t));const e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}const Rt="6ba7b810-9dad-11d1-80b4-00c04fd430c8",bt="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Nt(t,e,r){function u(c,p,f,o){var h;if(typeof c=="string"&&(c=Ot(c)),typeof p=="string"&&(p=xt(p)),((h=p)===null||h===void 0?void 0:h.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let _=new Uint8Array(16+c.length);if(_.set(p),_.set(c,p.length),_=r(_),_[6]=_[6]&15|e,_[8]=_[8]&63|128,f){o=o||0;for(let m=0;m<16;++m)f[o+m]=_[m];return f}return kt(_)}try{u.name=t}catch{}return u.DNS=Rt,u.URL=bt,u}function Tt(t,e,r,u){switch(t){case 0:return e&r^~e&u;case 1:return e^r^u;case 2:return e&r^e&u^r&u;case 3:return e^r^u}}function et(t,e){return t<<e|t>>>32-e}function At(t){const e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){const f=unescape(encodeURIComponent(t));t=[];for(let o=0;o<f.length;++o)t.push(f.charCodeAt(o))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const u=t.length/4+2,c=Math.ceil(u/16),p=new Array(c);for(let f=0;f<c;++f){const o=new Uint32Array(16);for(let h=0;h<16;++h)o[h]=t[f*64+h*4]<<24|t[f*64+h*4+1]<<16|t[f*64+h*4+2]<<8|t[f*64+h*4+3];p[f]=o}p[c-1][14]=(t.length-1)*8/Math.pow(2,32),p[c-1][14]=Math.floor(p[c-1][14]),p[c-1][15]=(t.length-1)*8&4294967295;for(let f=0;f<c;++f){const o=new Uint32Array(80);for(let y=0;y<16;++y)o[y]=p[f][y];for(let y=16;y<80;++y)o[y]=et(o[y-3]^o[y-8]^o[y-14]^o[y-16],1);let h=r[0],_=r[1],m=r[2],k=r[3],O=r[4];for(let y=0;y<80;++y){const T=Math.floor(y/20),D=et(h,5)+Tt(T,_,m,k)+O+e[T]+o[y]>>>0;O=k,k=m,m=et(_,30)>>>0,_=h,h=D}r[0]=r[0]+h>>>0,r[1]=r[1]+_>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+k>>>0,r[4]=r[4]+O>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}const Mt=Nt("v5",80,At);var rt=(function(){var t=function(w,n,a,l){for(a=a||{},l=w.length;l--;a[w[l]]=n);return a},e=[6,8,10,20,22,24,26,27,28],r=[1,10],u=[1,11],c=[1,12],p=[1,13],f=[1,14],o=[1,15],h=[1,21],_=[1,22],m=[1,23],k=[1,24],O=[1,25],y=[6,8,10,13,15,18,19,20,22,24,26,27,28,41,42,43,44,45],T=[1,34],D=[27,28,46,47],F=[41,42,43,44,45],W=[17,34],P=[1,54],A=[1,53],S=[17,34,36,38],R={trace:function(){},yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,":":13,role:14,BLOCK_START:15,attributes:16,BLOCK_STOP:17,SQS:18,SQE:19,title:20,title_value:21,acc_title:22,acc_title_value:23,acc_descr:24,acc_descr_value:25,acc_descr_multiline_value:26,ALPHANUM:27,ENTITY_NAME:28,attribute:29,attributeType:30,attributeName:31,attributeKeyTypeList:32,attributeComment:33,ATTRIBUTE_WORD:34,attributeKeyType:35,COMMA:36,ATTRIBUTE_KEY:37,COMMENT:38,cardinality:39,relType:40,ZERO_OR_ONE:41,ZERO_OR_MORE:42,ONE_OR_MORE:43,ONLY_ONE:44,MD_PARENT:45,NON_IDENTIFYING:46,IDENTIFYING:47,WORD:48,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:":",15:"BLOCK_START",17:"BLOCK_STOP",18:"SQS",19:"SQE",20:"title",21:"title_value",22:"acc_title",23:"acc_title_value",24:"acc_descr",25:"acc_descr_value",26:"acc_descr_multiline_value",27:"ALPHANUM",28:"ENTITY_NAME",34:"ATTRIBUTE_WORD",36:"COMMA",37:"ATTRIBUTE_KEY",38:"COMMENT",41:"ZERO_OR_ONE",42:"ZERO_OR_MORE",43:"ONE_OR_MORE",44:"ONLY_ONE",45:"MD_PARENT",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,4],[9,3],[9,1],[9,7],[9,6],[9,4],[9,2],[9,2],[9,2],[9,1],[11,1],[11,1],[16,1],[16,2],[29,2],[29,3],[29,3],[29,4],[30,1],[31,1],[32,1],[32,3],[35,1],[33,1],[12,3],[39,1],[39,1],[39,1],[39,1],[39,1],[40,1],[40,1],[14,1],[14,1],[14,1]],performAction:function(n,a,l,d,g,i,V){var s=i.length-1;switch(g){case 1:break;case 2:this.$=[];break;case 3:i[s-1].push(i[s]),this.$=i[s-1];break;case 4:case 5:this.$=i[s];break;case 6:case 7:this.$=[];break;case 8:d.addEntity(i[s-4]),d.addEntity(i[s-2]),d.addRelationship(i[s-4],i[s],i[s-2],i[s-3]);break;case 9:d.addEntity(i[s-3]),d.addAttributes(i[s-3],i[s-1]);break;case 10:d.addEntity(i[s-2]);break;case 11:d.addEntity(i[s]);break;case 12:d.addEntity(i[s-6],i[s-4]),d.addAttributes(i[s-6],i[s-1]);break;case 13:d.addEntity(i[s-5],i[s-3]);break;case 14:d.addEntity(i[s-3],i[s-1]);break;case 15:case 16:this.$=i[s].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=i[s].trim(),d.setAccDescription(this.$);break;case 19:case 43:this.$=i[s];break;case 20:case 41:case 42:this.$=i[s].replace(/"/g,"");break;case 21:case 29:this.$=[i[s]];break;case 22:i[s].push(i[s-1]),this.$=i[s];break;case 23:this.$={attributeType:i[s-1],attributeName:i[s]};break;case 24:this.$={attributeType:i[s-2],attributeName:i[s-1],attributeKeyTypeList:i[s]};break;case 25:this.$={attributeType:i[s-2],attributeName:i[s-1],attributeComment:i[s]};break;case 26:this.$={attributeType:i[s-3],attributeName:i[s-2],attributeKeyTypeList:i[s-1],attributeComment:i[s]};break;case 27:case 28:case 31:this.$=i[s];break;case 30:i[s-2].push(i[s]),this.$=i[s-2];break;case 32:this.$=i[s].replace(/"/g,"");break;case 33:this.$={cardA:i[s],relType:i[s-1],cardB:i[s-2]};break;case 34:this.$=d.Cardinality.ZERO_OR_ONE;break;case 35:this.$=d.Cardinality.ZERO_OR_MORE;break;case 36:this.$=d.Cardinality.ONE_OR_MORE;break;case 37:this.$=d.Cardinality.ONLY_ONE;break;case 38:this.$=d.Cardinality.MD_PARENT;break;case 39:this.$=d.Identification.NON_IDENTIFYING;break;case 40:this.$=d.Identification.IDENTIFYING;break}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,20:r,22:u,24:c,26:p,27:f,28:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:16,11:9,20:r,22:u,24:c,26:p,27:f,28:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,11],{12:17,39:20,15:[1,18],18:[1,19],41:h,42:_,43:m,44:k,45:O}),{21:[1,26]},{23:[1,27]},{25:[1,28]},t(e,[2,18]),t(y,[2,19]),t(y,[2,20]),t(e,[2,4]),{11:29,27:f,28:o},{16:30,17:[1,31],29:32,30:33,34:T},{11:35,27:f,28:o},{40:36,46:[1,37],47:[1,38]},t(D,[2,34]),t(D,[2,35]),t(D,[2,36]),t(D,[2,37]),t(D,[2,38]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),{13:[1,39]},{17:[1,40]},t(e,[2,10]),{16:41,17:[2,21],29:32,30:33,34:T},{31:42,34:[1,43]},{34:[2,27]},{19:[1,44]},{39:45,41:h,42:_,43:m,44:k,45:O},t(F,[2,39]),t(F,[2,40]),{14:46,27:[1,49],28:[1,48],48:[1,47]},t(e,[2,9]),{17:[2,22]},t(W,[2,23],{32:50,33:51,35:52,37:P,38:A}),t([17,34,37,38],[2,28]),t(e,[2,14],{15:[1,55]}),t([27,28],[2,33]),t(e,[2,8]),t(e,[2,41]),t(e,[2,42]),t(e,[2,43]),t(W,[2,24],{33:56,36:[1,57],38:A}),t(W,[2,25]),t(S,[2,29]),t(W,[2,32]),t(S,[2,31]),{16:58,17:[1,59],29:32,30:33,34:T},t(W,[2,26]),{35:60,37:P},{17:[1,61]},t(e,[2,13]),t(S,[2,30]),t(e,[2,12])],defaultActions:{34:[2,27],41:[2,22]},parseError:function(n,a){if(a.recoverable)this.trace(n);else{var l=new Error(n);throw l.hash=a,l}},parse:function(n){var a=this,l=[0],d=[],g=[null],i=[],V=this.table,s="",X=0,nt=0,dt=2,at=1,ut=i.slice.call(arguments,1),N=Object.create(this.lexer),H={yy:{}};for(var j in this.yy)Object.prototype.hasOwnProperty.call(this.yy,j)&&(H.yy[j]=this.yy[j]);N.setInput(n,H.yy),H.yy.lexer=N,H.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var J=N.yylloc;i.push(J);var ft=N.options&&N.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yt(){var Z;return Z=d.pop()||N.lex()||at,typeof Z!="number"&&(Z instanceof Array&&(d=Z,Z=d.pop()),Z=a.symbols_[Z]||Z),Z}for(var I,z,v,$,K={},Q,Y,st,q;;){if(z=l[l.length-1],this.defaultActions[z]?v=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=yt()),v=V[z]&&V[z][I]),typeof v>"u"||!v.length||!v[0]){var tt="";q=[];for(Q in V[z])this.terminals_[Q]&&Q>dt&&q.push("'"+this.terminals_[Q]+"'");N.showPosition?tt="Parse error on line "+(X+1)+`:
2
- `+N.showPosition()+`
3
- Expecting `+q.join(", ")+", got '"+(this.terminals_[I]||I)+"'":tt="Parse error on line "+(X+1)+": Unexpected "+(I==at?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(tt,{text:N.match,token:this.terminals_[I]||I,line:N.yylineno,loc:J,expected:q})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+I);switch(v[0]){case 1:l.push(I),g.push(N.yytext),i.push(N.yylloc),l.push(v[1]),I=null,nt=N.yyleng,s=N.yytext,X=N.yylineno,J=N.yylloc;break;case 2:if(Y=this.productions_[v[1]][1],K.$=g[g.length-Y],K._$={first_line:i[i.length-(Y||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(Y||1)].first_column,last_column:i[i.length-1].last_column},ft&&(K._$.range=[i[i.length-(Y||1)].range[0],i[i.length-1].range[1]]),$=this.performAction.apply(K,[s,nt,X,H.yy,v[1],g,i].concat(ut)),typeof $<"u")return $;Y&&(l=l.slice(0,-1*Y*2),g=g.slice(0,-1*Y),i=i.slice(0,-1*Y)),l.push(this.productions_[v[1]][0]),g.push(K.$),i.push(K._$),st=V[l[l.length-2]][l[l.length-1]],l.push(st);break;case 3:return!0}}return!0}},b=(function(){var w={EOF:1,parseError:function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},setInput:function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var a=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var g=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
- `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
5
- `+a+"^"},test_match:function(n,a){var l,d,g;if(this.options.backtrack_lexer&&(g={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(g.yylloc.range=this.yylloc.range.slice(0))),d=n[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],l=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var i in g)this[i]=g[i];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,a,l,d;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),i=0;i<g.length;i++)if(l=this._input.match(this.rules[g[i]]),l&&(!a||l[0].length>a[0].length)){if(a=l,d=i,this.options.backtrack_lexer){if(n=this.test_match(l,g[i]),n!==!1)return n;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(n=this.test_match(a,g[d]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return a||this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(a,l,d,g){switch(d){case 0:return this.begin("acc_title"),22;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),24;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 10;case 8:break;case 9:return 8;case 10:return 28;case 11:return 48;case 12:return 4;case 13:return this.begin("block"),15;case 14:return 36;case 15:break;case 16:return 37;case 17:return 34;case 18:return 34;case 19:return 38;case 20:break;case 21:return this.popState(),17;case 22:return l.yytext[0];case 23:return 18;case 24:return 19;case 25:return 41;case 26:return 43;case 27:return 43;case 28:return 43;case 29:return 41;case 30:return 41;case 31:return 42;case 32:return 42;case 33:return 42;case 34:return 42;case 35:return 42;case 36:return 43;case 37:return 42;case 38:return 43;case 39:return 44;case 40:return 44;case 41:return 44;case 42:return 44;case 43:return 41;case 44:return 42;case 45:return 43;case 46:return 45;case 47:return 46;case 48:return 47;case 49:return 47;case 50:return 46;case 51:return 46;case 52:return 46;case 53:return 27;case 54:return l.yytext[0];case 55:return 6}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:,)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:(.*?)[~](.*?)*[~])/i,/^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[14,15,16,17,18,19,20,21,22],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],inclusive:!0}}};return w})();R.lexer=b;function L(){this.yy={}}return L.prototype=R,R.Parser=L,new L})();rt.parser=rt;const St=rt;let U={},it=[];const wt={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},It={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},lt=function(t,e=void 0){return U[t]===void 0?(U[t]={attributes:[],alias:e},E.log$1.info("Added new entity :",t)):U[t]&&!U[t].alias&&e&&(U[t].alias=e,E.log$1.info(`Add alias '${e}' to entity '${t}'`)),U[t]},Dt=()=>U,vt=function(t,e){let r=lt(t),u;for(u=e.length-1;u>=0;u--)r.attributes.push(e[u]),E.log$1.debug("Added attribute ",e[u].attributeName)},Lt=function(t,e,r,u){let c={entityA:t,roleA:e,entityB:r,relSpec:u};it.push(c),E.log$1.debug("Added new relationship :",c)},Bt=()=>it,Ct=function(){U={},it=[],E.clear()},Pt={Cardinality:wt,Identification:It,getConfig:()=>E.getConfig().er,addEntity:lt,addAttributes:vt,getEntities:Dt,addRelationship:Lt,getRelationships:Bt,clear:Ct,setAccTitle:E.setAccTitle,getAccTitle:E.getAccTitle,setAccDescription:E.setAccDescription,getAccDescription:E.getAccDescription,setDiagramTitle:E.setDiagramTitle,getDiagramTitle:E.getDiagramTitle},B={ONLY_ONE_START:"ONLY_ONE_START",ONLY_ONE_END:"ONLY_ONE_END",ZERO_OR_ONE_START:"ZERO_OR_ONE_START",ZERO_OR_ONE_END:"ZERO_OR_ONE_END",ONE_OR_MORE_START:"ONE_OR_MORE_START",ONE_OR_MORE_END:"ONE_OR_MORE_END",ZERO_OR_MORE_START:"ZERO_OR_MORE_START",ZERO_OR_MORE_END:"ZERO_OR_MORE_END",MD_PARENT_END:"MD_PARENT_END",MD_PARENT_START:"MD_PARENT_START"},Yt=function(t,e){let r;t.append("defs").append("marker").attr("id",B.MD_PARENT_START).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",B.MD_PARENT_END).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",B.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",B.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),r=t.append("defs").append("marker").attr("id",B.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),r=t.append("defs").append("marker").attr("id",B.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",B.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",B.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),r=t.append("defs").append("marker").attr("id",B.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),r=t.append("defs").append("marker").attr("id",B.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},C={ERMarkers:B,insertMarkers:Yt},Zt=/[^\dA-Za-z](\W)*/g;let x={},G=new Map;const Ft=function(t){const e=Object.keys(t);for(const r of e)x[r]=t[r]},Wt=(t,e,r)=>{const u=x.entityPadding/3,c=x.entityPadding/3,p=x.fontSize*.85,f=e.node().getBBox(),o=[];let h=!1,_=!1,m=0,k=0,O=0,y=0,T=f.height+u*2,D=1;r.forEach(A=>{A.attributeKeyTypeList!==void 0&&A.attributeKeyTypeList.length>0&&(h=!0),A.attributeComment!==void 0&&(_=!0)}),r.forEach(A=>{const S=`${e.node().id}-attr-${D}`;let R=0;const b=E.parseGenericTypes(A.attributeType),L=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",E.getConfig().fontFamily).style("font-size",p+"px").text(b),w=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",E.getConfig().fontFamily).style("font-size",p+"px").text(A.attributeName),n={};n.tn=L,n.nn=w;const a=L.node().getBBox(),l=w.node().getBBox();if(m=Math.max(m,a.width),k=Math.max(k,l.width),R=Math.max(a.height,l.height),h){const d=A.attributeKeyTypeList!==void 0?A.attributeKeyTypeList.join(","):"",g=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",E.getConfig().fontFamily).style("font-size",p+"px").text(d);n.kn=g;const i=g.node().getBBox();O=Math.max(O,i.width),R=Math.max(R,i.height)}if(_){const d=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",E.getConfig().fontFamily).style("font-size",p+"px").text(A.attributeComment||"");n.cn=d;const g=d.node().getBBox();y=Math.max(y,g.width),R=Math.max(R,g.height)}n.height=R,o.push(n),T+=R+u*2,D+=1});let F=4;h&&(F+=2),_&&(F+=2);const W=m+k+O+y,P={width:Math.max(x.minEntityWidth,Math.max(f.width+x.entityPadding*2,W+c*F)),height:r.length>0?T:Math.max(x.minEntityHeight,f.height+x.entityPadding*2)};if(r.length>0){const A=Math.max(0,(P.width-W-c*F)/(F/2));e.attr("transform","translate("+P.width/2+","+(u+f.height/2)+")");let S=f.height+u*2,R="attributeBoxOdd";o.forEach(b=>{const L=S+u+b.height/2;b.tn.attr("transform","translate("+c+","+L+")");const w=t.insert("rect","#"+b.tn.node().id).classed(`er ${R}`,!0).attr("x",0).attr("y",S).attr("width",m+c*2+A).attr("height",b.height+u*2),n=parseFloat(w.attr("x"))+parseFloat(w.attr("width"));b.nn.attr("transform","translate("+(n+c)+","+L+")");const a=t.insert("rect","#"+b.nn.node().id).classed(`er ${R}`,!0).attr("x",n).attr("y",S).attr("width",k+c*2+A).attr("height",b.height+u*2);let l=parseFloat(a.attr("x"))+parseFloat(a.attr("width"));if(h){b.kn.attr("transform","translate("+(l+c)+","+L+")");const d=t.insert("rect","#"+b.kn.node().id).classed(`er ${R}`,!0).attr("x",l).attr("y",S).attr("width",O+c*2+A).attr("height",b.height+u*2);l=parseFloat(d.attr("x"))+parseFloat(d.attr("width"))}_&&(b.cn.attr("transform","translate("+(l+c)+","+L+")"),t.insert("rect","#"+b.cn.node().id).classed(`er ${R}`,"true").attr("x",l).attr("y",S).attr("width",y+c*2+A).attr("height",b.height+u*2)),S+=b.height+u*2,R=R==="attributeBoxOdd"?"attributeBoxEven":"attributeBoxOdd"})}else P.height=Math.max(x.minEntityHeight,T),e.attr("transform","translate("+P.width/2+","+P.height/2+")");return P},Ut=function(t,e,r){const u=Object.keys(e);let c;return u.forEach(function(p){const f=Xt(p,"entity");G.set(p,f);const o=t.append("g").attr("id",f);c=c===void 0?f:c;const h="text-"+f,_=o.append("text").classed("er entityLabel",!0).attr("id",h).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",E.getConfig().fontFamily).style("font-size",x.fontSize+"px").text(e[p].alias??p),{width:m,height:k}=Wt(o,_,e[p].attributes),y=o.insert("rect","#"+h).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",m).attr("height",k).node().getBBox();r.setNode(f,{width:y.width,height:y.height,shape:"rect",id:f})}),c},Ht=function(t,e){e.nodes().forEach(function(r){r!==void 0&&e.node(r)!==void 0&&t.select("#"+r).attr("transform","translate("+(e.node(r).x-e.node(r).width/2)+","+(e.node(r).y-e.node(r).height/2)+" )")})},ht=function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")},zt=function(t,e){return t.forEach(function(r){e.setEdge(G.get(r.entityA),G.get(r.entityB),{relationship:r},ht(r))}),t};let ot=0;const Kt=function(t,e,r,u,c){ot++;const p=r.edge(G.get(e.entityA),G.get(e.entityB),ht(e)),f=gt.line().x(function(T){return T.x}).y(function(T){return T.y}).curve(E.curveBasis),o=t.insert("path","#"+u).classed("er relationshipLine",!0).attr("d",f(p.points)).style("stroke",x.stroke).style("fill","none");e.relSpec.relType===c.db.Identification.NON_IDENTIFYING&&o.attr("stroke-dasharray","8,8");let h="";switch(x.arrowMarkerAbsolute&&(h=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,h=h.replace(/\(/g,"\\("),h=h.replace(/\)/g,"\\)")),e.relSpec.cardA){case c.db.Cardinality.ZERO_OR_ONE:o.attr("marker-end","url("+h+"#"+C.ERMarkers.ZERO_OR_ONE_END+")");break;case c.db.Cardinality.ZERO_OR_MORE:o.attr("marker-end","url("+h+"#"+C.ERMarkers.ZERO_OR_MORE_END+")");break;case c.db.Cardinality.ONE_OR_MORE:o.attr("marker-end","url("+h+"#"+C.ERMarkers.ONE_OR_MORE_END+")");break;case c.db.Cardinality.ONLY_ONE:o.attr("marker-end","url("+h+"#"+C.ERMarkers.ONLY_ONE_END+")");break;case c.db.Cardinality.MD_PARENT:o.attr("marker-end","url("+h+"#"+C.ERMarkers.MD_PARENT_END+")");break}switch(e.relSpec.cardB){case c.db.Cardinality.ZERO_OR_ONE:o.attr("marker-start","url("+h+"#"+C.ERMarkers.ZERO_OR_ONE_START+")");break;case c.db.Cardinality.ZERO_OR_MORE:o.attr("marker-start","url("+h+"#"+C.ERMarkers.ZERO_OR_MORE_START+")");break;case c.db.Cardinality.ONE_OR_MORE:o.attr("marker-start","url("+h+"#"+C.ERMarkers.ONE_OR_MORE_START+")");break;case c.db.Cardinality.ONLY_ONE:o.attr("marker-start","url("+h+"#"+C.ERMarkers.ONLY_ONE_START+")");break;case c.db.Cardinality.MD_PARENT:o.attr("marker-start","url("+h+"#"+C.ERMarkers.MD_PARENT_START+")");break}const _=o.node().getTotalLength(),m=o.node().getPointAtLength(_*.5),k="rel"+ot,y=t.append("text").classed("er relationshipLabel",!0).attr("id",k).attr("x",m.x).attr("y",m.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",E.getConfig().fontFamily).style("font-size",x.fontSize+"px").text(e.roleA).node().getBBox();t.insert("rect","#"+k).classed("er relationshipLabelBox",!0).attr("x",m.x-y.width/2).attr("y",m.y-y.height/2).attr("width",y.width).attr("height",y.height)},Vt=function(t,e,r,u){x=E.getConfig().er,E.log$1.info("Drawing ER diagram");const c=E.getConfig().securityLevel;let p;c==="sandbox"&&(p=E.select("#i"+e));const o=(c==="sandbox"?E.select(p.nodes()[0].contentDocument.body):E.select("body")).select(`[id='${e}']`);C.insertMarkers(o,x);let h;h=new pt.Graph({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:x.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}});const _=Ut(o,u.db.getEntities(),h),m=zt(u.db.getRelationships(),h);_t.layout(h),Ht(o,h),m.forEach(function(D){Kt(o,D,h,_,u)});const k=x.diagramPadding;E.utils.insertTitle(o,"entityTitleText",x.titleTopMargin,u.db.getDiagramTitle());const O=o.node().getBBox(),y=O.width+k*2,T=O.height+k*2;E.configureSvgSize(o,T,y,x.useMaxWidth),o.attr("viewBox",`${O.x-k} ${O.y-k} ${y} ${T}`)},Gt="28e9f9db-3c8d-5aa5-9faf-44286ae5937c";function Xt(t="",e=""){const r=t.replace(Zt,"");return`${ct(e)}${ct(r)}${Mt(t,Gt)}`}function ct(t=""){return t.length>0?`${t}-`:""}const Qt={setConf:Ft,draw:Vt},qt=t=>`
7
- .entityBox {
8
- fill: ${t.mainBkg};
9
- stroke: ${t.nodeBorder};
10
- }
11
-
12
- .attributeBoxOdd {
13
- fill: ${t.attributeBackgroundColorOdd};
14
- stroke: ${t.nodeBorder};
15
- }
16
-
17
- .attributeBoxEven {
18
- fill: ${t.attributeBackgroundColorEven};
19
- stroke: ${t.nodeBorder};
20
- }
21
-
22
- .relationshipLabelBox {
23
- fill: ${t.tertiaryColor};
24
- opacity: 0.7;
25
- background-color: ${t.tertiaryColor};
26
- rect {
27
- opacity: 0.5;
28
- }
29
- }
30
-
31
- .relationshipLine {
32
- stroke: ${t.lineColor};
33
- }
34
-
35
- .entityTitleText {
36
- text-anchor: middle;
37
- font-size: 18px;
38
- fill: ${t.textColor};
39
- }
40
- #MD_PARENT_START {
41
- fill: #f5f5f5 !important;
42
- stroke: ${t.lineColor} !important;
43
- stroke-width: 1;
44
- }
45
- #MD_PARENT_END {
46
- fill: #f5f5f5 !important;
47
- stroke: ${t.lineColor} !important;
48
- stroke-width: 1;
49
- }
50
-
51
- `,jt=qt,Jt={parser:St,db:Pt,renderer:Qt,styles:jt};exports.diagram=Jt;