vue-data-ui 2.11.2 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/{Arrow-OttzfahM.js → Arrow-DDRsdhZn.js} +1 -1
  2. package/dist/{BaseIcon-CpIcYACc.js → BaseIcon-CPSasvwJ.js} +1 -1
  3. package/dist/{ColorPicker-BnsG9Qeu.js → ColorPicker-Bu3ocoLc.js} +3 -3
  4. package/dist/{DataTable-CJOtzfgn.js → DataTable-64MQdfSC.js} +2 -2
  5. package/dist/{Legend-DKQ4psNY.js → Legend-DQGaC-7K.js} +2 -2
  6. package/dist/{PackageVersion-D-aPPO0L.js → PackageVersion-BZmn5l24.js} +1 -1
  7. package/dist/{PenAndPaper-D9g_r8-6.js → PenAndPaper-BGTby4ih.js} +3 -3
  8. package/dist/{Shape-DLjaeo5U.js → Shape-CrvsxzqI.js} +1 -1
  9. package/dist/{Slicer-DuqI_UVS.js → Slicer-Jxw9aXXo.js} +2 -2
  10. package/dist/{Title-DIYoufYR.js → Title-CbtqUCDq.js} +1 -1
  11. package/dist/{Tooltip-BFz2yelJ.js → Tooltip-BW22mERF.js} +1 -1
  12. package/dist/{dom-to-png-BB-m1MuD.js → dom-to-png-mqrqFtQK.js} +1 -1
  13. package/dist/{img-Cyr1eIO7.js → img-Y8EW2l65.js} +1 -1
  14. package/dist/{index-d3erwTWB.js → index-k-TENgkl.js} +1 -1
  15. package/dist/{pdf-BQRTRQlZ.js → pdf-z0T-YjDO.js} +1 -1
  16. package/dist/style.css +1 -1
  17. package/dist/{useNestedProp-BqKuhIvF.js → useNestedProp-BQzXvt0H.js} +1 -1
  18. package/dist/{usePrinter-CHrKIDM7.js → usePrinter-B3U6P71r.js} +3 -3
  19. package/dist/{vue-data-ui-BRKcN5_z.js → vue-data-ui-BwwD2u_u.js} +63 -63
  20. package/dist/vue-data-ui.js +1 -1
  21. package/dist/{vue-ui-3d-bar-BIw7nTYA.js → vue-ui-3d-bar-Bx_MIxW7.js} +9 -9
  22. package/dist/{vue-ui-accordion-BJyaBDyF.js → vue-ui-accordion-BvG2cZf1.js} +3 -3
  23. package/dist/{vue-ui-age-pyramid-Dn_061NF.js → vue-ui-age-pyramid-CDKy2P9O.js} +10 -10
  24. package/dist/{vue-ui-annotator-Y65oZVga.js → vue-ui-annotator-BAJTr6FD.js} +2 -2
  25. package/dist/{vue-ui-bullet-B5mjXy0q.js → vue-ui-bullet-Dje2wg8I.js} +8 -8
  26. package/dist/{vue-ui-candlestick-BIC2-GAV.js → vue-ui-candlestick-fX576D5A.js} +11 -11
  27. package/dist/{vue-ui-carousel-table-CnvQ0CeQ.js → vue-ui-carousel-table-CmObt9aO.js} +4 -4
  28. package/dist/{vue-ui-chestnut-IsRTDol2.js → vue-ui-chestnut-PBM9zTQ-.js} +8 -8
  29. package/dist/{vue-ui-chord-iSsr3a59.js → vue-ui-chord-B-0byToI.js} +14 -14
  30. package/dist/{vue-ui-circle-pack-CS2l9IXg.js → vue-ui-circle-pack-rbvrpRAc.js} +9 -9
  31. package/dist/{vue-ui-cursor-Cq9lPDB7.js → vue-ui-cursor-TKh5iDDp.js} +2 -2
  32. package/dist/{vue-ui-dashboard-7Cm-15oc.js → vue-ui-dashboard-C82YUwLA.js} +62 -62
  33. package/dist/{vue-ui-digits-BecNI-j7.js → vue-ui-digits-CvBJi0Tq.js} +2 -2
  34. package/dist/{vue-ui-donut-D_bFxovZ.js → vue-ui-donut-C4j70CI7.js} +12 -12
  35. package/dist/{vue-ui-donut-evolution-C8dlmVur.js → vue-ui-donut-evolution-DMqXUt12.js} +11 -11
  36. package/dist/{vue-ui-dumbbell-Ds41wAQh.js → vue-ui-dumbbell-DpO9YGBE.js} +10 -10
  37. package/dist/{vue-ui-flow-CqdSvk4_.js → vue-ui-flow-CUfqW31t.js} +11 -11
  38. package/dist/{vue-ui-funnel-CNDgAWjp.js → vue-ui-funnel-BfduqCYK.js} +9 -9
  39. package/dist/{vue-ui-galaxy-DzUAHZ4G.js → vue-ui-galaxy-DPar-E51.js} +11 -11
  40. package/dist/{vue-ui-gauge-Cj-4ZhyL.js → vue-ui-gauge-CcjDaq63.js} +7 -7
  41. package/dist/{vue-ui-gizmo-CCS3u0qr.js → vue-ui-gizmo-B_ym3int.js} +3 -3
  42. package/dist/{vue-ui-heatmap-CBRd8kvj.js → vue-ui-heatmap-DI-_vOk9.js} +10 -10
  43. package/dist/{vue-ui-history-plot-4XT22zB_.js → vue-ui-history-plot-BsArezyK.js} +11 -11
  44. package/dist/{vue-ui-kpi-B-lBgRvZ.js → vue-ui-kpi-BpWcYF6b.js} +3 -3
  45. package/dist/{vue-ui-mini-loader-_ksyazrb.js → vue-ui-mini-loader-BGa_4ML-.js} +2 -2
  46. package/dist/{vue-ui-molecule-Db_QmLY6.js → vue-ui-molecule-DX2iIPZk.js} +11 -11
  47. package/dist/{vue-ui-mood-radar-Y_CGEC1L.js → vue-ui-mood-radar-Cg5i5Gja.js} +11 -11
  48. package/dist/{vue-ui-nested-donuts-DosW9Sfg.js → vue-ui-nested-donuts-DYU9w0VR.js} +11 -11
  49. package/dist/{vue-ui-onion-CQwIVcfN.js → vue-ui-onion-MVnP5IPP.js} +11 -11
  50. package/dist/{vue-ui-parallel-coordinate-plot-Cdu0SvMZ.js → vue-ui-parallel-coordinate-plot-BUO5USbO.js} +12 -12
  51. package/dist/{vue-ui-quadrant-B8H5sBMi.js → vue-ui-quadrant-DvCdsNT3.js} +12 -12
  52. package/dist/{vue-ui-quick-chart-ClB6jwSV.js → vue-ui-quick-chart-Coq_TT4K.js} +9 -9
  53. package/dist/{vue-ui-radar-BTluZs04.js → vue-ui-radar-ksmA1eNa.js} +12 -12
  54. package/dist/{vue-ui-rating-CTNYeoXO.js → vue-ui-rating-BjNei1jK.js} +2 -2
  55. package/dist/{vue-ui-relation-circle-CdHhoGcO.js → vue-ui-relation-circle-Dz27DBjO.js} +7 -7
  56. package/dist/{vue-ui-ridgeline-Dr6UOfwb.js → vue-ui-ridgeline-DvACw7ca.js} +12 -12
  57. package/dist/{vue-ui-rings-N2mHKtLh.js → vue-ui-rings-3U2BWSD-.js} +12 -12
  58. package/dist/{vue-ui-scatter-BcJRyqbE.js → vue-ui-scatter-CzCxAM-H.js} +12 -12
  59. package/dist/{vue-ui-skeleton-BOtCpAcY.js → vue-ui-skeleton-LOBxYAj5.js} +3 -3
  60. package/dist/{vue-ui-smiley-BPqpTUTh.js → vue-ui-smiley-B5x0f6IE.js} +2 -2
  61. package/dist/{vue-ui-spark-trend-BXo8mbxJ.js → vue-ui-spark-trend-BJL392y-.js} +5 -5
  62. package/dist/{vue-ui-sparkbar-DEsL52nJ.js → vue-ui-sparkbar-CYTCFFZ4.js} +4 -4
  63. package/dist/{vue-ui-sparkgauge-DkawMq8d.js → vue-ui-sparkgauge-CtgQ7eqo.js} +4 -4
  64. package/dist/{vue-ui-sparkhistogram-D8ZCXl7m.js → vue-ui-sparkhistogram-Drd-nNZL.js} +5 -5
  65. package/dist/{vue-ui-sparkline-D8LYPXpr.js → vue-ui-sparkline-RMyEJzSC.js} +4 -4
  66. package/dist/{vue-ui-sparkstackbar-DzeVCG0H.js → vue-ui-sparkstackbar-xwahpmeL.js} +5 -5
  67. package/dist/{vue-ui-stackbar-DQ9CcKUd.js → vue-ui-stackbar-BOhzD5_W.js} +13 -13
  68. package/dist/{vue-ui-strip-plot-C6gcQLMI.js → vue-ui-strip-plot-jus4xcWs.js} +11 -11
  69. package/dist/{vue-ui-table-D7azsjo3.js → vue-ui-table-BCArkzoU.js} +3 -3
  70. package/dist/{vue-ui-table-heatmap-DINNMAyX.js → vue-ui-table-heatmap-sT80xAnB.js} +4 -4
  71. package/dist/{vue-ui-table-sparkline-BrYh6fVq.js → vue-ui-table-sparkline-B9G42V97.js} +5 -5
  72. package/dist/{vue-ui-thermometer-J0A6MZy_.js → vue-ui-thermometer-CMqRiRxw.js} +7 -7
  73. package/dist/{vue-ui-timer-CI8zPXh3.js → vue-ui-timer-DLXveBI_.js} +5 -5
  74. package/dist/{vue-ui-tiremarks-BuNik_Pf.js → vue-ui-tiremarks-BP2_KcUJ.js} +7 -7
  75. package/dist/{vue-ui-treemap-oUtdOGWu.js → vue-ui-treemap-CNHi1E6G.js} +12 -12
  76. package/dist/{vue-ui-vertical-bar-2bHPN2lr.js → vue-ui-vertical-bar-kpSssDOU.js} +12 -12
  77. package/dist/{vue-ui-waffle-BuISvHw-.js → vue-ui-waffle-Br8t4XKd.js} +12 -12
  78. package/dist/{vue-ui-wheel-CSy7_x22.js → vue-ui-wheel-D80M81Bf.js} +7 -7
  79. package/dist/{vue-ui-word-cloud-DEpoSRMP.js → vue-ui-word-cloud-w4Qq_dqB.js} +10 -10
  80. package/dist/{vue-ui-world-Cy1VBlK3.js → vue-ui-world-CDSH4faH.js} +11 -11
  81. package/dist/{vue-ui-xy-PaM6vcjk.js → vue-ui-xy-CCHnnV7y.js} +16 -16
  82. package/dist/{vue-ui-xy-canvas-CSyX_xLO.js → vue-ui-xy-canvas-TJ6MbOBd.js} +12 -12
  83. package/package.json +1 -2
  84. package/dist/Arrow-CogAJvGp.cjs +0 -1
  85. package/dist/BaseIcon-DY-33nfj.cjs +0 -1
  86. package/dist/ColorPicker-CrMLe8x_.cjs +0 -1
  87. package/dist/DataTable-CNCnRrD-.cjs +0 -1
  88. package/dist/Legend-ieOu_fKK.cjs +0 -1
  89. package/dist/PackageVersion-BxSGdh6L.cjs +0 -1
  90. package/dist/PenAndPaper-ByAFuR-l.cjs +0 -1
  91. package/dist/Shape-BQIcurpe.cjs +0 -1
  92. package/dist/Slicer-FXxFjXOP.cjs +0 -1
  93. package/dist/Title-D62pPwLz.cjs +0 -1
  94. package/dist/Tooltip-C_H6-uAa.cjs +0 -9
  95. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +0 -1
  96. package/dist/dom-to-png-B3SeX1JP.cjs +0 -3
  97. package/dist/img-Bl4Pt1QH.cjs +0 -1
  98. package/dist/index-Cn2tUOoX.cjs +0 -9
  99. package/dist/pdf-BQABl7QG.cjs +0 -1
  100. package/dist/useChartAccessibility-Cm7nkzTG.cjs +0 -1
  101. package/dist/useNestedProp-C8955nsn.cjs +0 -1
  102. package/dist/usePanZoom-PXRi2Rwx.cjs +0 -1
  103. package/dist/usePrinter-BrH80VBz.cjs +0 -1
  104. package/dist/useResponsive-BBkmXXaa.cjs +0 -1
  105. package/dist/useUserOptionState-BgepsfED.cjs +0 -1
  106. package/dist/vue-data-ui-BbzW2_-6.cjs +0 -9
  107. package/dist/vue-data-ui.cjs +0 -1
  108. package/dist/vue-ui-3d-bar-WFymJ4EL.cjs +0 -19
  109. package/dist/vue-ui-accordion-7GoAZx3k.cjs +0 -1
  110. package/dist/vue-ui-age-pyramid-DGpLdvsL.cjs +0 -1
  111. package/dist/vue-ui-annotator-ypStRKCB.cjs +0 -371
  112. package/dist/vue-ui-bullet-C_Ppz5nn.cjs +0 -34
  113. package/dist/vue-ui-candlestick-BrDk_pc_.cjs +0 -2
  114. package/dist/vue-ui-carousel-table-BTxtBHvb.cjs +0 -1
  115. package/dist/vue-ui-chestnut-D_NZDyDN.cjs +0 -6
  116. package/dist/vue-ui-chord-CZ66gJ7w.cjs +0 -16
  117. package/dist/vue-ui-circle-pack-lGkj98rL.cjs +0 -1
  118. package/dist/vue-ui-cursor-YZyc0ARl.cjs +0 -1
  119. package/dist/vue-ui-dashboard-jP2U4qtK.cjs +0 -1
  120. package/dist/vue-ui-digits-C5PfeED6.cjs +0 -1
  121. package/dist/vue-ui-donut-BM9i2XHJ.cjs +0 -1
  122. package/dist/vue-ui-donut-evolution-Oga32kTV.cjs +0 -1
  123. package/dist/vue-ui-dumbbell-ClzXgan7.cjs +0 -9
  124. package/dist/vue-ui-flow-Bp1oqzTj.cjs +0 -3
  125. package/dist/vue-ui-funnel-y3hN7BGU.cjs +0 -1
  126. package/dist/vue-ui-galaxy-D5vKPiFH.cjs +0 -1
  127. package/dist/vue-ui-gauge-57ahTSbZ.cjs +0 -1
  128. package/dist/vue-ui-gizmo-D5_kCO9e.cjs +0 -1
  129. package/dist/vue-ui-heatmap-B8sfOhVF.cjs +0 -1
  130. package/dist/vue-ui-history-plot-DQVpKlp1.cjs +0 -1
  131. package/dist/vue-ui-kpi-DjI1yXtc.cjs +0 -1
  132. package/dist/vue-ui-mini-loader-BpAnNEHG.cjs +0 -1
  133. package/dist/vue-ui-molecule-BqpYPmrd.cjs +0 -1
  134. package/dist/vue-ui-mood-radar-DI_FioVr.cjs +0 -1
  135. package/dist/vue-ui-nested-donuts-B0rJlEH0.cjs +0 -17
  136. package/dist/vue-ui-onion-CEHc9oKt.cjs +0 -5
  137. package/dist/vue-ui-parallel-coordinate-plot-C1sxm3Nr.cjs +0 -8
  138. package/dist/vue-ui-pattern-CT3p_iOg.cjs +0 -1
  139. package/dist/vue-ui-quadrant-DM3Afg_i.cjs +0 -1
  140. package/dist/vue-ui-quick-chart-ClJi48bc.cjs +0 -15
  141. package/dist/vue-ui-radar-f0QY_Mal.cjs +0 -1
  142. package/dist/vue-ui-rating-B71_TxmN.cjs +0 -1
  143. package/dist/vue-ui-relation-circle-DHOG2jKh.cjs +0 -1
  144. package/dist/vue-ui-ridgeline-CxhklaLX.cjs +0 -1
  145. package/dist/vue-ui-rings-DoGxh2qe.cjs +0 -2
  146. package/dist/vue-ui-scatter-BnRkkP5Z.cjs +0 -1
  147. package/dist/vue-ui-skeleton-Mcoev-5q.cjs +0 -41
  148. package/dist/vue-ui-smiley-Ch9trBZA.cjs +0 -2
  149. package/dist/vue-ui-spark-trend-PqEN-rL8.cjs +0 -1
  150. package/dist/vue-ui-sparkbar-DnRQFo63.cjs +0 -1
  151. package/dist/vue-ui-sparkgauge-C0E5Sojk.cjs +0 -1
  152. package/dist/vue-ui-sparkhistogram-Bqtsbb3w.cjs +0 -1
  153. package/dist/vue-ui-sparkline-BTruGe7A.cjs +0 -1
  154. package/dist/vue-ui-sparkstackbar-DeXUgBIH.cjs +0 -1
  155. package/dist/vue-ui-stackbar-CaFp42Tn.cjs +0 -6
  156. package/dist/vue-ui-strip-plot-DzNU6VRW.cjs +0 -1
  157. package/dist/vue-ui-table-DP2ZaGWa.cjs +0 -14
  158. package/dist/vue-ui-table-heatmap-B2gZkAqm.cjs +0 -1
  159. package/dist/vue-ui-table-sparkline-CgN2nMYT.cjs +0 -1
  160. package/dist/vue-ui-thermometer-DgZfQbR2.cjs +0 -1
  161. package/dist/vue-ui-timer-ClM5FpoU.cjs +0 -64
  162. package/dist/vue-ui-tiremarks-19Krsd1f.cjs +0 -1
  163. package/dist/vue-ui-treemap-DvmJ1MOU.cjs +0 -1
  164. package/dist/vue-ui-vertical-bar-RT-SM-us.cjs +0 -4
  165. package/dist/vue-ui-waffle-BSKRUJbJ.cjs +0 -1
  166. package/dist/vue-ui-wheel-DfBVkT9x.cjs +0 -1
  167. package/dist/vue-ui-word-cloud-BlfCmzD-.cjs +0 -1
  168. package/dist/vue-ui-world-EgFhVXSY.cjs +0 -19
  169. package/dist/vue-ui-xy-aQEDcKbT.cjs +0 -3
  170. package/dist/vue-ui-xy-canvas-C6-sYgU_.cjs +0 -9
@@ -1,371 +0,0 @@
1
- "use strict";var I=Object.create;var b=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var f=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of C(o))!x.call(e,l)&&l!==s&&b(e,l,{get:()=>o[l],enumerable:!(n=F(o,l))||n.enumerable});return e};var k=(e,o,s)=>(s=e!=null?I(S(e)):{},f(o||!e||!e.__esModule?b(s,"default",{value:e,enumerable:!0}):s,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-Cn2tUOoX.cjs"),g=require("./dom-to-png-B3SeX1JP.cjs"),i=require("vue"),m=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),p={props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{shapes:[],lastSelectedShape:void 0}}}},data(){return{activeShape:void 0,strokeSize:1,currentPointer:{start:{x:0,y:0},end:{x:0,end:0}},currentTarget:void 0,hoveredShapeId:void 0,isBold:!1,isBulletTextMode:!1,isDash:!1,isDeleteMode:!1,isDrawing:!1,isDrawingNewShape:!0,isDrawMode:!1,isItalic:!1,isMouseDown:!1,isMoveMode:!1,isPrinting:!1,isResizeMode:!1,isSelectMode:!1,isSummaryOpen:!1,isTextMode:!1,isUnderline:!1,isWriting:!1,lastSelectedShape:this.dataset.lastSelectedShape,pointerDownId:-1,pointerPosition:{x:0,y:0},preventEdit:!0,selectedGroup:[],shapes:this.dataset.shapes?this.dataset.shapes:[],shapesOrder:[],step:Math.round(Math.random())*1e5,svgHeight:1e3,svgWidth:1e3,options:{arrow:{color:"grey",filled:!0},circle:{color:"grey",filled:!1,radius:3,strokeWidth:2},rect:{color:"grey",filled:!1,strokeWidth:2,height:12,width:12}},selectedColor:"#000000",showCaret:!1,sizeRatio:1,slottedSvg:void 0,sourceWidth:1,sourceHeight:1,textAlign:"start",textFont:20,transparency:100,transparencyCodes:u.opacity}},watch:{shapes:{handler(e){e.length===0&&(this.lastSelectedShape=void 0)}}},computed:{FINAL_CONFIG(){const e=u.useConfig().vue_ui_annotator;if(!Object.keys(this.config||{}).length)return e;const o=this.treeShake({defaultConfig:e,userConfig:this.config});return this.convertConfigColors(o)},canSelect(){return this.shapes.filter(e=>!["line","group"].includes(e.type)).length>1},colorTransparency(){return this.transparencyCodes[this.transparency>98?98:this.transparency]},cursorClass(){switch(!0){case this.isDeleteMode:return"default";case this.isMoveMode:return"move";case this.isTextMode:return"text";case this.isResizeMode:return"se-resize";default:return""}},records(){return this.shapes},userShapes(){return this.records.map(e=>{switch(!0){case(e&&e.type==="arrow"):const o=e.strokeWidth>3?5:10,s=e.strokeWidth>3?2.5:5;return`
2
- <defs>
3
- <marker
4
- id="${e.id}"
5
- markerWidth="${o}"
6
- markerHeight="${o}"
7
- refX="0"
8
- refY="${s}"
9
- orient="auto"
10
- >
11
- <polygon
12
- points="0 0,${o} ${s}, 0 ${o}"
13
- fill="${e.color}"
14
- />
15
- </marker>
16
- </defs>
17
- ${this.includeSelectionIndicator(e)}
18
- <g id="${e.id}">
19
- <path
20
- style="stroke-linecap: round !important; ${e.isDash?`stroke-dasharray: ${e.strokeWidth*3}`:""}"
21
- stroke="${e.color}"
22
- id="${e.id}"
23
- d="M${e.x},${e.y} ${e.endX},${e.endY}"
24
- stroke-width="${e.strokeWidth}"
25
- marker-end="url(#${e.id})"
26
- />
27
- </g>
28
- <g id="${e.id}">
29
- <rect
30
- id="${e.id}"
31
- x="${e.x-10}"
32
- y="${e.y-10}"
33
- height="20"
34
- width="20"
35
- fill="rgba(0,0,0,0.3)"
36
- style="display:${this.isResizeMode||this.isMoveMode?"initial":"none"}; rx:1 !important; ry:1 !important;"
37
- />
38
- </g>
39
- ${this.includeDeleteButton(e)}
40
- </g>
41
- `;case(e&&e.type==="circle"):return`
42
- <g id="${e.id}">
43
- ${this.includeSelectionIndicator(e)}
44
- <circle
45
- id="${e.id}"
46
- cx="${e.x}"
47
- cy="${e.y}"
48
- r="${e.circleRadius?e.circleRadius:Number.MIN_VALUE}"
49
- fill="${e.isFilled?e.color+e.alpha:"rgba(255,255,255,0.001)"}"
50
- stroke="${e.color+e.alpha}"
51
- stroke-width="${e.strokeWidth}"
52
- style="${e.isDash?`stroke-dasharray: ${e.strokeWidth*3}`:""}"
53
- >
54
- </circle>
55
- </g>
56
-
57
- ${this.includeDeleteButton(e)}`;case(e&&e.type==="group"):return`<g id="${e.id}">
58
- <rect
59
- id="${this.isResizeMode?"":e.id}"
60
- x="${e.x}"
61
- y="${e.y}"
62
- fill="transparent"
63
- height="${e.rectHeight}"
64
- width="${e.rectWidth}"
65
- stroke="grey"
66
- stroke-width="1"
67
- style="rx:1 !important; ry:1 !important; ${e.isDash?`stroke-dasharray: ${e.strokeWidth*3}`:""}; display:${this.isSelectMode||this.isDeleteMode||this.hoveredShapeId&&this.hoveredShapeId===e.id?"initial":"none"};"
68
- />
69
- <g id="${e.id}">
70
- ${e.content?e.content:""}
71
- </g>
72
- ${this.includeDeleteButton(e)}
73
- </g> `;case(e&&e.type==="rect"):return`<g id="${e.id}">
74
- ${this.includeSelectionIndicator(e)}
75
- <rect
76
- id="${this.isResizeMode?"":e.id}"
77
- x="${e.x}"
78
- y="${e.y}"
79
- fill="${e.isFilled?e.color+e.alpha:"rgba(255,255,255,0.001)"}"
80
- height="${e.rectHeight}"
81
- width="${e.rectWidth}"
82
- stroke="${e.color+e.alpha}"
83
- stroke-width="${e.strokeWidth}"
84
- style="rx:1 !important; ry:1 !important; ${e.isDash?`stroke-dasharray: ${e.strokeWidth*3}`:""}"
85
- />
86
- <rect id="${e.id}"
87
- x="${e.x+e.rectWidth}"
88
- y="${e.y+e.rectHeight}"
89
- height="20"
90
- width="20"
91
- fill="rgba(0,0,0,0.3)"
92
- style="display:${this.isResizeMode?"initial":"none"}; rx:1 !important; ry:1 !important;"
93
- />
94
- ${this.includeDeleteButton(e)}
95
- </g> `;case(e&&e.type==="line"):return`
96
- <g id="${e.id}">
97
- <path
98
- id="${e.id}"
99
- d="M${e.path?e.path:""}"
100
- style="stroke:${e.color+e.alpha} !important; fill:none; stroke-width:${e.strokeWidth} !important; stroke-linecap: round !important; stroke-linejoin: round !important;"
101
- />
102
- ${this.includeDeleteButton(e)}
103
- </g>
104
- `;case(e&&e.type==="text"):const n=e.textContent.split("‎"),l=[];for(let t=0;t<n.length;t+=1)l.push(`
105
- ${e.isBulletTextMode?`<tspan x="${e.x-e.fontSize}" y="${e.y+e.fontSize*t}" id="${e.id}" font-size="${e.fontSize/2}">⬤</tspan>`:""}
106
- <tspan id="${e.id}" x="${e.x}" y="${e.y+e.fontSize*t}">
107
- ${n[t]}
108
- </tspan>`);return`
109
- ${this.includeSelectionIndicator(e)}
110
- ${this.computeTextElement(e,l,e.isBulletTextMode)}
111
- `}})}},mounted(){const e=this.$refs.drawSvgContainer;let o=!1;this.walkTheDOM(e,l=>{if(!o&&["DIV","svg","section","canvas"].includes(l.tagName)){this.slottedSvg=l,o=!0;return}});const s=this.slottedSvg.getBoundingClientRect();this.sizeRatio=s.height/s.width,this.svgWidth=1e3,this.svgHeight=this.sizeRatio*1e3,this.sourceWidth=s.width,this.sourceHeight=s.height,new ResizeObserver(l=>{l.forEach(t=>{this.sourceWidth=t.contentRect.width,this.sourceHeight=t.contentRect.height,this.sizeRatio=t.contentRect.height/t.contentRect.width,this.svgHeight=this.sizeRatio*1e3})}).observe(this.slottedSvg),window.addEventListener("keydown",l=>{this.write(l)})},destroyed(){window.removeEventListener("keydown",e=>{this.write(e)})},methods:{treeShake:u.treeShake,convertConfigColors:u.convertConfigColors,bringShapeTo(e){const o=this.shapes.find(s=>s.id===this.lastSelectedShape.id);switch(!0){case e==="front":this.shapes=this.shapes.filter(s=>s.id!==o.id),this.shapes.push(o);break;case e==="back":this.shapes=this.shapes.filter(s=>s.id!==o.id),this.shapes=[o,...this.shapes];break;default:return}},clickSvg(e){if(this.isDeleteMode)return;this.deleteEmptyTextElement(),this.isTextMode?(this.isWriting=!0,this.showCaret=!0):(this.isWriting=!1,this.showCaret=!1,this.isTextMode=!1);let o=`text_${Math.random()*1e4}_${Math.random()*99999}`;if(this.isWriting){this.shapes.push({id:o,type:"text",lines:0,x:this.pointerPosition.x,y:this.pointerPosition.y,textContent:"",fontSize:this.copy(this.textFont),textAlign:this.copy(this.textAlign),isBold:this.copy(this.isBold),isItalic:this.copy(this.isItalic),isUnderline:this.copy(this.isUnderline),color:this.copy(this.selectedColor),isBulletTextMode:this.copy(this.isBulletTextMode)}),this.currentTarget=this.shapes.at(-1),this.lastSelectedShape=this.shapes.at(-1);return}const s=()=>{this.isDash=this.shapes.find(l=>l.id===e.target.id).isDash},n=()=>{this.strokeSize=this.shapes.find(l=>l.id===e.target.id).strokeWidth};if(this.isSelectMode=!1,e.target.id.includes("arrow")){this.activeShape="arrow",s(),n();return}if(e.target.id.includes("circle")){this.activeShape="circle",this.options.circle.filled=this.shapes.find(l=>l.id===e.target.id).isFilled,s(),n();return}if(e.target.id.includes("rect")){this.activeShape="rect",this.options.rect.filled=this.shapes.find(l=>l.id===e.target.id).isFilled,s(),n();return}if(e.target.id.includes("line")){this.activeShape="line",n();return}if(e.target.id.includes("text")){this.isTextMode=!0,this.isWriting=!0,this.showCaret=!0;const l=this.shapes.find(t=>t.id===e.target.id);l&&l.textAlign&&(this.textAlign=this.shapes.find(t=>t.id===e.target.id).textAlign),l&&(this.isBulletTextMode=this.shapes.find(t=>t.id===e.target.id).isBulletTextMode);return}},copyPaste(){const e={...this.lastSelectedShape,id:`${this.lastSelectedShape.id}_copy`,x:this.lastSelectedShape.x-100<0?1:this.lastSelectedShape.x-100,y:this.lastSelectedShape.y-100<0?1:this.lastSelectedShape.y-100};this.shapes.push(e)},includeDeleteButton(e,o=!1){switch(!0){case e.type==="circle":return`
112
- <g id="${e.id}" style="display:${this.isDeleteMode?"initial":"none"};">
113
- <circle id="${e.id}" cx="${e.x}" cy="${e.y}" r="12" fill="red"/>
114
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x-4}" y1="${e.y-4}" x2="${e.x+4}" y2="${e.y+4}"/>
115
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x+4}" y1="${e.y-4}" x2="${e.x-4}" y2="${e.y+4}"/>
116
- </g>
117
- `;case e.type==="text":let s,n=[-8,-12,-4,-12,-4];switch(!0){case e.textAlign==="start":o?s=[-20,-24,-16,-16,-24]:s=[-16,-20,-12,-12,-20];break;case e.textAlign==="middle":s=[0,-4,4,4,-4],n=[-32,-36,-28,-36,-28];break;case e.textAlign==="end":s=[16,20,12,12,20];break;default:s=[0,0,0];break}return`
118
- <g id="${e.id}" style="display:${this.isDeleteMode?"initial":"none"};">
119
- <circle id="${e.id}" cx="${e.x+s[0]}" cy="${e.y+n[0]}" r="12" fill="red"/>
120
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x+s[1]}" y1="${e.y+n[1]}" x2="${e.x+s[2]}" y2="${e.y+n[2]}"/>
121
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x+s[3]}" y1="${e.y+n[3]}" x2="${e.x+s[4]}" y2="${e.y+n[4]}"/>
122
- </g>
123
- `;default:return`
124
- <g id="${e.id}" style="display:${this.isDeleteMode?"initial":"none"};">
125
- <circle id="${e.id}" cx="${e.x-4}" cy="${e.y-4}" r="12" fill="red"/>
126
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x-8}" y1="${e.y-8}" x2="${e.x}" y2="${e.y}"/>
127
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x}" y1="${e.y-8}" x2="${e.x-8}" y2="${e.y}"/>
128
- </g>
129
- `}},includeSelectionIndicator(e){if(e)switch(!0){case e.type==="rect":return`
130
- <rect
131
- id="${e.id}"
132
- style="stroke-dasharray: 10; display:${this.hoveredShapeId&&this.hoveredShapeId===e.id?"initial":"none"}"
133
- x="${e.x-20}"
134
- y="${e.y-20}"
135
- height="${e.rectHeight+40}"
136
- width="${e.rectWidth+40}"
137
- fill="transparent"
138
- stroke="grey"
139
- />
140
- `;case e.type==="circle":return`
141
- <rect
142
- id="${e.id}"
143
- style="stroke-dasharray: 10; display:${this.hoveredShapeId&&this.hoveredShapeId===e.id?"initial":"none"}"
144
- x="${e.x-e.circleRadius-20}"
145
- y="${e.y-e.circleRadius-20}"
146
- height="${e.circleRadius*2+40}"
147
- width="${e.circleRadius*2+40}"
148
- fill="transparent"
149
- stroke="grey"
150
- />
151
- `;case e.type==="arrow":const o=e.endX-e.x>0,s=e.endY-e.y>0;return`
152
- <rect
153
- id="${e.id}"
154
- style="stroke-dasharray: 10; display:${this.hoveredShapeId&&this.hoveredShapeId===e.id?"initial":"none"}"
155
- x="${o?e.x-20:e.endX-20}"
156
- y="${s?e.y-20:e.endY-20}"
157
- height="${s?e.endY-e.y+40:e.y-e.endY+40}"
158
- width="${o?e.endX-e.x+40:e.x-e.endX+40}"
159
- fill="transparent"
160
- stroke="grey"
161
- />
162
- `;case e.type==="text":const n=Array.from(document.getElementsByTagName("text")).find(c=>c.id===e.id);if(!n)return;const{x:l,y:t,width:r,height:d}=n.getBBox();return`
163
- <rect
164
- id="${e.id}"
165
- style="stroke-dasharray: 10; display:${this.hoveredShapeId&&this.hoveredShapeId===e.id?"initial":"none"}"
166
- x="${l-20}"
167
- y="${t-20}"
168
- height="${d+40}"
169
- width="${r+40}"
170
- fill="transparent"
171
- stroke="grey"
172
- />
173
- `;default:return""}},allowEditAndHoverShapes(e){e.preventDefault(),this.preventEdit=!1,e.target&&e.target.id&&(this.hoveredShapeId=e.target.id)},setSelectedTextAlignTo(e){!this.lastSelectedShape||this.lastSelectedShape.type!=="text"||(this.lastSelectedShape.textAlign=e)},undoLastShape(){this.lastSelectedShape=void 0,this.shapes=this.shapes.slice(0,-1)},write(e){if(this.preventEdit)return;e.preventDefault();const o=e.keyCode;if(!this.isWriting)return;this.showCaret=!0;let s;if(this.lastSelectedShape.type==="text"?s=this.shapes.find(l=>l.id===this.lastSelectedShape.id):s=this.shapes.at(-1),this.currentTarget=s,s.type!=="text")return;this.currentTarget.isBold=this.copy(this.isBold),this.currentTarget.isItalic=this.copy(this.isItalic),this.currentTarget.isUnderline=this.copy(this.isUnderline);const n=[16,17,18,20,27,33,34,35,36,37,38,39,40,45,91,112,113,114,115,116,117,118,119,120,121,122,123,221,255,"Unidentified"];switch(!0){case o===8:s.textContent=s.textContent.slice(0,-1);break;case o===9:s.textContent+="&nbsp; &nbsp; &nbsp; &nbsp;";break;case o===13:s.lines+=1,s.textContent+="‎";return;case n.includes(o):return;default:s.textContent+=e.key}},groupShapes(){if(this.selectedGroup=[],this.activeShape!=="group"){this.isSelectMode=!1,this.shapes=this.shapes.filter(o=>o.type!=="group");return}const e=this.shapes.at(-1);if(this.shapes.forEach(o=>{if(o.type!=="group")switch(!0){case o.type==="arrow":const s=o.x<=o.endX&&o.y<=o.endY&&e.x<=o.x&&e.y<=o.y&&e.x+e.rectWidth>=o.endX&&e.y+e.rectHeight>=o.endY,n=o.endY<o.y&&o.x<o.endX&&e.x<=o.x&&e.y<=o.y&&e.x+e.rectWidth>=o.endX&&e.y+e.rectHeight>=o.y,l=o.x>o.endX&&o.y<o.endY&&e.x<=o.endX&&e.y<=o.endY&&e.x+e.rectWidth>=o.x&&e.y+e.rectHeight>=o.endY,t=o.x>o.endX&&o.y>o.endY&&e.x<=o.endX&&e.y<=o.endY&&e.x+e.rectWidth>=o.x&&e.y+e.rectHeight>=o.y;(s||n||l||t)&&this.selectedGroup.push(o);break;case o.type==="circle":e.x<=o.x+o.circleRadius&&e.y<=o.y+o.circleRadius&&o.x+o.circleRadius<=e.x+e.rectWidth&&o.y+o.circleRadius<=e.y+e.rectHeight&&this.selectedGroup.push(o);break;case o.type==="rect":e.x<=o.x&&e.y<=o.y&&o.x<=e.x+e.rectWidth&&o.y<=e.y+e.rectHeight&&o.x+o.rectWidth<=e.x+e.rectWidth&&o.y+o.rectHeight<=e.y+e.rectHeight&&o.rectWidth<=e.rectWidth&&o.rectHeight<=e.rectHeight&&this.selectedGroup.push(o);break;case o.type==="text":e.x<=o.x&&e.y<=o.y&&this.selectedGroup.push(o);break}}),this.selectedGroup=this.selectedGroup.map(o=>({...o,id:e.id,oldId:o.id,diffX:o.x-e.x,diffY:o.y-e.y,diffEndX:o.endX?o.endX-e.x:0,diffEndY:o.endY?o.endY-e.y:0})),e.source=this.selectedGroup,this.selectedGroup.length>1){const o=this.copy(this.selectedGroup).map(s=>s.oldId);this.shapes=this.shapes.filter(s=>!o.includes(s.id)),this.selectedGroup.forEach(s=>{switch(!0){case s.type==="circle":e.content+=`
174
- <circle
175
- id="${s.id}"
176
- cx="${s.x}"
177
- cy="${s.y}"
178
- r="${s.circleRadius?s.circleRadius:Number.MIN_VALUE}"
179
- fill="${s.isFilled?s.color+s.alpha:"rgba(255,255,255,0.001)"}"
180
- stroke="${s.color+s.alpha}"
181
- stroke-width="${s.strokeWidth}"
182
- style="${s.isDash?`stroke-dasharray: ${s.strokeWidth*3}`:""}"
183
- />
184
- `;break;case s.type==="rect":e.content+=`
185
- <rect
186
- id="${this.isResizeMode?"":s.id}"
187
- x="${s.x}"
188
- y="${s.y}"
189
- fill="${s.isFilled?s.color+s.alpha:"rgba(255,255,255,0.001)"}"
190
- height="${s.rectHeight}"
191
- width="${s.rectWidth}"
192
- stroke="${s.color+s.alpha}"
193
- stroke-width="${s.strokeWidth}"
194
- style="rx:1 !important; ry:1 !important; ${s.isDash?`stroke-dasharray: ${s.strokeWidth*3}`:""}"
195
- />
196
- `;break;case s.type==="arrow":const n=s.strokeWidth>3?5:10,l=s.strokeWidth>3?2.5:5,t=Date.now();e.content+=`
197
- <g id="${s.id}">
198
- <defs>
199
- <marker
200
- id="${t}"
201
- markerWidth="${n}"
202
- markerHeight="${n}"
203
- refX="0"
204
- refY="${l}"
205
- orient="auto"
206
- >
207
- <polygon
208
- points="0 0,${n} ${l}, 0 ${n}"
209
- fill="${s.color}"
210
- />
211
- </marker>
212
- </defs>
213
-
214
- <path
215
- style="stroke-linecap: round !important; ${s.isDash?`stroke-dasharray: ${s.strokeWidth*3}`:""}"
216
- stroke="${s.color}"
217
- id="${s.id}"
218
- d="M${s.x},${s.y} ${s.endX},${s.endY}"
219
- stroke-width="${s.strokeWidth}"
220
- marker-end="url(#${t})"
221
- />
222
- </g>
223
- `;break;case s.type==="text":const r=s.textContent.split("‎"),d=[];for(let c=0;c<r.length;c+=1)d.push(`
224
- ${s.isBulletTextMode?`<tspan x="${s.x-s.fontSize}" y="${s.y+s.fontSize*c}" id="${s.id}" font-size="${s.fontSize/2}">⬤</tspan>`:""}
225
- <tspan id="${s.id}" x="${s.x}" y="${s.y+s.fontSize*c}">
226
- ${r[c]}
227
- </tspan>`);e.content+=`
228
- ${this.computeTextElement(s,d,s.isBulletTextMode)}
229
- `;break}})}else this.shapes=this.shapes.filter(o=>o.id!==e.id)},moveGroup(e){e.content="",e.x=this.copy(this.pointerPosition.x)-e.rectWidth/2,e.y=this.copy(this.pointerPosition.y)-e.rectHeight/2,e.source.forEach(o=>{switch(!0){case o.type==="circle":e.content+=`
230
- <circle
231
- id="${o.id}"
232
- cx="${this.copy(this.pointerPosition.x)+o.diffX-e.rectWidth/2}"
233
- cy="${this.copy(this.pointerPosition.y)+o.diffY-e.rectHeight/2}"
234
- r="${o.circleRadius?o.circleRadius:Number.MIN_VALUE}"
235
- fill="${o.isFilled?o.color+o.alpha:"rgba(255,255,255,0.001)"}"
236
- stroke="${o.color+o.alpha}"
237
- stroke-width="${o.strokeWidth}"
238
- style="${o.isDash?`stroke-dasharray: ${o.strokeWidth*3}`:""}"
239
- />
240
- `;break;case o.type==="rect":e.content+=`
241
- <rect
242
- id="${this.isResizeMode?"":o.id}"
243
- x="${this.copy(this.pointerPosition.x)+o.diffX-e.rectWidth/2}"
244
- y="${this.copy(this.pointerPosition.y)+o.diffY-e.rectHeight/2}"
245
- fill="${o.isFilled?o.color+o.alpha:"rgba(255,255,255,0.001)"}"
246
- height="${o.rectHeight}"
247
- width="${o.rectWidth}"
248
- stroke="${o.color+o.alpha}"
249
- stroke-width="${o.strokeWidth}"
250
- style="rx:1 !important; ry:1 !important; ${o.isDash?`stroke-dasharray: ${o.strokeWidth*3}`:""}"
251
- />
252
- `;break;case o.type==="arrow":const s=o.strokeWidth>3?5:10,n=o.strokeWidth>3?2.5:5,l=Date.now();e.content+=`
253
- <g id="${o.id}">
254
- <defs>
255
- <marker
256
- id="${l}"
257
- markerWidth="${s}"
258
- markerHeight="${s}"
259
- refX="0"
260
- refY="${n}"
261
- orient="auto"
262
- >
263
- <polygon
264
- points="0 0,${s} ${n}, 0 ${s}"
265
- fill="${o.color}"
266
- />
267
- </marker>
268
- </defs>
269
-
270
- <path
271
- style="stroke-linecap: round !important; ${o.isDash?`stroke-dasharray: ${o.strokeWidth*3}`:""}"
272
- stroke="${o.color}"
273
- id="${o.id}"
274
- d="M${this.copy(this.pointerPosition.x)+o.diffX-e.rectWidth/2},${this.copy(this.pointerPosition.y)+o.diffY-e.rectHeight/2} ${this.copy(this.pointerPosition.x)+o.diffEndX-e.rectWidth/2},${this.copy(this.pointerPosition.y)+o.diffEndY-e.rectHeight/2}"
275
- stroke-width="${o.strokeWidth}"
276
- marker-end="url(#${l})"
277
- />
278
- </g>
279
- `;break;case o.type==="text":const t=o.textContent.split("‎"),r=[];for(let d=0;d<t.length;d+=1)r.push(`
280
- ${o.isBulletTextMode?`<tspan x="${this.copy(this.pointerPosition.x)+o.diffX-o.fontSize-e.rectWidth/2}" y="${this.copy(this.pointerPosition.y)+o.diffY+o.fontSize*d-e.rectHeight/2}" id="${o.id}" font-size="${o.fontSize/2}">⬤</tspan>`:""}
281
- <tspan id="${o.id}" x="${this.copy(this.pointerPosition.x)+o.diffX-e.rectWidth/2}" y="${this.copy(this.pointerPosition.y)+o.diffY+o.fontSize*d-e.rectHeight/2}">
282
- ${t[d]}
283
- </tspan>`);e.content+=`
284
- ${this.computeTextElement(o,r,o.isBulletTextMode)}
285
- `;break}})},chooseAction(e){switch(e.preventDefault(),this.isMouseDown=!0,!0){case this.isDrawMode:this.drawDown();break}},chooseMove(e){switch(e.preventDefault(),e.target.localName!=="svg"&&(this.currentTarget=e.target),!0){case(this.isMoveMode&&this.isMouseDown):this.moveDown();break;case(this.isResizeMode&&this.isMouseDown):this.resize();break}},computeCaretPosition(e){switch(!0){case e.textAlign==="middle":return`<path stroke="black" stroke-width="2" d="M${e.x},${e.y-e.fontSize} ${e.x},${e.y-e.fontSize-15}" /> <path stroke="black" stroke-width="2" d="M${e.x-3},${e.y-e.fontSize-5} ${e.x},${e.y-e.fontSize} ${e.x+3},${e.y-e.fontSize-5}"/>`;case e.textAlign==="start":const o=e.isBulletTextMode?e.fontSize:0;return`<path d="M${e.x-20-o},${e.y-e.fontSize/6} ${e.x-5-o},${e.y-e.fontSize/6}" stroke="black" stroke-width="2" />
286
- <path d="M${e.x-10-o},${e.y-e.fontSize/3} ${e.x-5-o},${e.y-e.fontSize/6} ${e.x-10-o},${e.y}" stroke="black" stroke-width="2">`;case e.textAlign==="end":return`<path d="M${e.x+20},${e.y-e.fontSize/6} ${e.x+5},${e.y-e.fontSize/6}" stroke="black" stroke-width="2" />
287
- <path d="M${e.x+10},${e.y-e.fontSize/3} ${e.x+5},${e.y-e.fontSize/6} ${e.x+10},${e.y}" stroke="black" stroke-width="2">`;default:return""}},computeTextElement(e,o,s=!1){switch(!0){case e.textAlign==="start":return`
288
- <g id="${e.id}">
289
- <rect
290
- id="${e.id}"
291
- style="display:${this.lastSelectedShape&&this.lastSelectedShape.id===e.id?"initial":"none"};"
292
- x="${e.x}"
293
- y="${e.y-50}"
294
- height="${e.lines===0||e.lines===1?e.fontSize*4:e.fontSize*2*e.lines}"
295
- width="100"
296
- fill="rgba(0,0,0,0)"
297
- />
298
- <text
299
- style="user-select:none; height:100px;"
300
- id="${e.id}"
301
- x="${e.x}"
302
- y="${e.y}"
303
- text-anchor="${e.textAlign}"
304
- font-size="${e.fontSize}"
305
- fill="${e.color}"
306
- font-weight="${e.isBold?"bold":"normal"}"
307
- font-style="${e.isItalic?"italic":"normal"}"
308
- text-decoration="${e.isUnderline?"underline":"none"}"
309
- >
310
- ${o.join("")}
311
- </text>
312
- ${this.showCaret&&this.lastSelectedShape&&this.lastSelectedShape.id===e.id?this.computeCaretPosition(e):""}
313
- ${this.includeDeleteButton(e,s)}
314
- </g>
315
- `;case e.textAlign==="middle":return`
316
- <g id="${e.id}">
317
- <rect
318
- id="${e.id}"
319
- style="display:${this.lastSelectedShape&&this.lastSelectedShape.id===e.id?"initial":"none"};"
320
- x="${e.x-50}"
321
- y="${e.y-50}"
322
- height="${e.lines===0||e.lines===1?e.fontSize*4:e.fontSize*2*e.lines}"
323
- width="100"
324
- fill="rgba(0,0,0,0)"
325
- />
326
- <text
327
- style="user-select:none; height:100px;"
328
- id="${e.id}"
329
- x="${e.x}"
330
- y="${e.y}"
331
- text-anchor="${e.textAlign}"
332
- font-size="${e.fontSize}"
333
- fill="${e.color}"
334
- font-weight="${e.isBold?"bold":"normal"}"
335
- font-style="${e.isItalic?"italic":"normal"}"
336
- text-decoration="${e.isUnderline?"underline":"none"}"
337
- >
338
- ${o.join("")}
339
- </text>
340
- ${this.showCaret&&this.lastSelectedShape&&this.lastSelectedShape.id===e.id?this.computeCaretPosition(e):""}
341
- ${this.includeDeleteButton(e)}
342
- </g>
343
- `;case e.textAlign==="end":return`
344
- <g id="${e.id}">
345
- <rect
346
- id="${e.id}"
347
- style="display:${this.lastSelectedShape&&this.lastSelectedShape.id===e.id?"initial":"none"};"
348
- x="${e.x-100}"
349
- y="${e.y-50}"
350
- height="${e.lines===0||e.lines===1?e.fontSize*4:e.fontSize*2*e.lines}"
351
- width="100"
352
- fill="rgba(0,0,0,0)"
353
- />
354
- <text
355
- style="user-select:none; height:100px;"
356
- id="${e.id}"
357
- x="${e.x}"
358
- y="${e.y}"
359
- text-anchor="${e.textAlign}"
360
- font-size="${e.fontSize}"
361
- fill="${e.color}"
362
- font-weight="${e.isBold?"bold":"normal"}"
363
- font-style="${e.isItalic?"italic":"normal"}"
364
- text-decoration="${e.isUnderline?"underline":"none"}"
365
- >
366
- ${o.join("")}
367
- </text>
368
- ${this.showCaret&&this.lastSelectedShape&&this.lastSelectedShape.id===e.id?this.computeCaretPosition(e):""}
369
- ${this.includeDeleteButton(e)}
370
- </g>
371
- `;default:return""}},copy(e){return JSON.parse(JSON.stringify(e))},clickShape(e){const o=e.target.id;switch(!0){case this.isDeleteMode:this.shapes=[...this.shapes].filter(s=>s.id!==o),this.lastSelectedShape=void 0;break;default:this.lastSelectedShape=this.shapes.find(s=>s.id===o);break}},deleteEmptyTextElement(){!this.lastSelectedShape||!this.lastSelectedShape.id.includes("text")||this.lastSelectedShape.textContent===""&&(this.shapes=this.shapes.filter(e=>e.id!==this.lastSelectedShape.id),this.lastSelectedShape=this.shapes.at(-1))},drawUp(e=!1){if(!this.activeShape||!this.isDrawing)return;this.currentPointer.end={x:this.pointerPosition.x,y:this.pointerPosition.y};let o;this.shapes.length>0&&this.currentTarget&&(o=[...this.shapes].find(d=>d.id===this.currentTarget.id));let s,n,l;o&&(s=o.x-this.currentPointer.end.x,n=o.y-this.currentPointer.end.y,l=Math.sqrt(s*s+n*n));let t,r;e?(t=Math.max(this.currentPointer.end.x,o.x),r=Math.min(this.currentPointer.end.x,o.x),Math.max(this.currentPointer.end.y,o.y),Math.min(this.currentPointer.end.y,o.y)):(t=Math.max(this.currentPointer.end.x,this.currentPointer.start.x),r=Math.min(this.currentPointer.end.x,this.currentPointer.start.x),Math.max(this.currentPointer.end.y,this.currentPointer.start.y),Math.min(this.currentPointer.end.y,this.currentPointer.start.y)),this.$nextTick(()=>{switch(!0){case this.activeShape==="arrow":this.shapes.at(-1).endX=this.currentPointer.end.x,this.shapes.at(-1).endY=this.currentPointer.end.y;break;case this.activeShape==="circle":const d=20;this.shapes.at(-1).circleRadius=this.isDrawingNewShape?this.copy(t-r)+d:l+d;break;case this.activeShape==="line":this.shapes.at(-1).path+=` ${this.pointerPosition.x} ${this.pointerPosition.y} `;break;case["rect","group"].includes(this.activeShape):const c=20;this.shapes.at(-1).rectWidth=this.copy(this.currentPointer.end.x-this.shapes.at(-1).x)>0?this.copy(this.currentPointer.end.x-this.shapes.at(-1).x):c,this.shapes.at(-1).rectHeight=this.copy(this.currentPointer.end.y-this.shapes.at(-1).y)>0?this.copy(this.currentPointer.end.y-this.shapes.at(-1).y):c}})},drawDown(){if(this.isDrawing=!0,!this.activeShape&&!this.isSelectMode||!this.isDrawing)return;this.isDrawingNewShape=!0,this.currentPointer.start={x:this.pointerPosition.x,y:this.pointerPosition.y};let e=`${this.isSelectMode?"group":this.activeShape}_${Math.random()*1e4}_${Date.now()}`;switch(!0){case this.activeShape==="arrow":this.shapes.push({id:e,x:this.pointerPosition.x,y:this.pointerPosition.y,endX:this.pointerPosition.x,endY:this.pointerPosition.y,type:this.activeShape,color:this.copy(this.selectedColor),strokeWidth:this.copy(Math.abs(this.strokeSize)),isDash:this.copy(this.isDash)}),this.lastSelectedShape=this.shapes.at(-1);break;case this.activeShape==="circle":this.shapes.push({alpha:this.options.circle.filled?this.colorTransparency:"",id:e,color:this.copy(this.selectedColor),isFilled:this.copy(this.options.circle.filled),circleRadius:this.copy(this.options.circle.radius),circleStrokeWidth:this.copy(this.options.circle.strokeWidth),type:this.activeShape,x:this.pointerPosition.x,y:this.pointerPosition.y,strokeWidth:this.copy(Math.abs(this.strokeSize)),isDash:this.copy(this.isDash)}),this.lastSelectedShape=this.shapes.at(-1);break;case this.activeShape==="line":this.shapes.push({alpha:this.copy(this.colorTransparency),id:e,x:this.pointerPosition.x,y:this.pointerPosition.y,type:this.activeShape,color:this.copy(this.selectedColor),strokeWidth:this.copy(Math.abs(this.strokeSize)),isDash:this.copy(this.isDash),path:`${this.pointerPosition.x} ${this.pointerPosition.y}`}),this.lastSelectedShape=this.shapes.at(-1);break;case this.activeShape==="rect":this.shapes.push({alpha:this.options.rect.filled?this.colorTransparency:"",id:e,color:this.copy(this.selectedColor),isFilled:this.copy(this.options.rect.filled),rectStrokeWidth:this.copy(this.options.rect.strokeWidth),rectHeight:this.copy(this.options.rect.height),rectWidth:this.copy(this.options.rect.width),type:this.activeShape,x:this.pointerPosition.x,y:this.pointerPosition.y,strokeWidth:this.copy(Math.abs(this.strokeSize)),isDash:this.copy(this.isDash)}),this.lastSelectedShape=this.shapes.at(-1);break;case this.activeShape==="group":this.shapes.push({alpha:1,id:`group_${Math.random()*1e4}_${Date.now()}`,x:this.pointerPosition.x,y:this.pointerPosition.y,isFilled:!1,rectHeight:this.copy(this.options.rect.height),rectWidth:this.copy(this.options.rect.width),rectStrokeWidth:1,type:"group",color:"grey",strokeWidth:1,isDash:!0,content:""});break}if((this.pointerDownId!==-1||!this.isDrawing)&&(clearInterval(this.pointerDownId),this.pointerDownId=-1),this.pointerDownId===-1&&this.isDrawing){this.pointerDownId=setInterval(this.drawUp,1);return}},move(e){if(!(!e||!e.id||e.type==="line"))switch(this.lastSelectedShape=e,!0){case e.type==="arrow":e.x=this.copy(this.pointerPosition.x),e.y=this.copy(this.pointerPosition.y);break;case e.type==="circle":e.x=this.copy(this.pointerPosition.x),e.y=this.copy(this.pointerPosition.y);break;case e.type==="group":this.moveGroup(e);break;case e.type==="rect":e.x=this.copy(this.pointerPosition.x-e.rectWidth/2),e.y=this.copy(this.pointerPosition.y-e.rectHeight/2);break;case e.type==="text":const o=Array.from(document.getElementsByTagName("text")).find(r=>r.id===e.id);if(!o)return;const{x:s,y:n,width:l,height:t}=o.getBBox();e.textAlign==="start"&&(e.x=this.copy(this.pointerPosition.x-l/2)),e.textAlign==="middle"&&(e.x=this.copy(this.pointerPosition.x)),e.textAlign==="end"&&(e.x=this.copy(this.pointerPosition.x+l/2)),e.lines>1?e.y=this.copy(this.pointerPosition.y-t/3):e.y=this.copy(this.pointerPosition.y+e.fontSize/2);break}},moveDown(){if(!this.currentTarget||!this.currentTarget.id)return;const e=this.currentTarget.id,o=this.shapes.find(s=>s.id===e);this.shapes=this.shapes.filter(s=>s.id!==e),this.shapes.push(o),this.pointerDownId===-1&&e&&this.move(o)},print(){this.isPrinting=!0,this.isDeleteMode=!1,this.isMoveMode=!1,this.isResizeMode=!1,this.isTextMode=!1,this.isWriting=!1,this.isSelectMode=!1,this.activeShape=void 0,this.showCaret=!1,this.$nextTick(async()=>{const e=this.$refs.drawSvgContainer;this.walkTheDOM(e,o=>{o&&o.nodeType===1&&(o.setAttribute("font-family","Helvetica"),o.style.fontFamily="Helvetica")});try{let o;try{o=(await import("jspdf")).default}catch{throw new Error("jspdf is not installed. Run npm install jspdf")}const s=await g.domToPng({container:e,scale:2}),n=new Image;n.src=s,n.onload=()=>{const l={width:595.28,height:841.89},t=n.width,r=n.height,d=t/l.width*l.height,c=l.width,y=c/t*r,a=new o("","pt","a4");let N=0,h=r;if(h<d)a.addImage(s,"PNG",0,0,c,y,"","FAST");else for(;h>0;)a.addImage(s,"PNG",0,N,c,y,"","FAST"),h-=d,N-=l.height,h>0&&a.addPage();a.save(`${new Date().toLocaleDateString()}_annotations.pdf`)}}catch(o){console.error("Error generating image:",o)}finally{this.isPrinting=!1,this.walkTheDOM(e,o=>{o&&o.nodeType===1&&(o.setAttribute("font-family",this.FINAL_CONFIG.style.fontFamily),o.style.fontFamily=this.FINAL_CONFIG.style.fontFamily)})}})},resetDraw(){this.isDrawing=!1,this.isMouseDown=!1,this.pointerDownId=-1,this.isSelectMode&&this.groupShapes(),clearInterval(this.pointerDownId)},resize(){this.isDrawingNewShape=!1;const e=this.currentTarget.id;if(!e)return;this.isDrawing=!0;const o=this.shapes.find(s=>s.id===e);this.activeShape=o.type,this.shapes=this.shapes.filter(s=>s.id!==e),this.shapes.push(o),this.drawUp(!0)},setFillOfSelectedRect(){!this.lastSelectedShape||!this.lastSelectedShape.id.includes("rect")||(this.lastSelectedShape.isFilled=!this.lastSelectedShape.isFilled)},setFillOfSelectedCircle(){!this.lastSelectedShape||!this.lastSelectedShape.id.includes("circle")||(this.lastSelectedShape.isFilled=!this.lastSelectedShape.isFilled)},setColorOfSelectedShape(){this.lastSelectedShape&&(this.lastSelectedShape.color=this.copy(this.selectedColor),!["arrow","text"].includes(this.lastSelectedShape.id)&&(this.lastSelectedShape.alpha=this.copy(this.colorTransparency)))},setSelectedShapeToDash(){!this.lastSelectedShape||this.lastSelectedShape.type==="text"||(this.lastSelectedShape.isDash=this.copy(this.isDash))},setTransparencyOfSelectedShape(){!this.lastSelectedShape||["arrow","text"].includes(this.lastSelectedShape.id)||(this.lastSelectedShape.alpha=this.copy(this.colorTransparency))},setStrokeWidthOfSelectedShape(){!this.lastSelectedShape||!["arrow","circle","rect","line"].includes(this.lastSelectedShape.type)||(this.lastSelectedShape.strokeWidth=this.copy(Math.abs(this.strokeSize)))},setCurrentStyleOfSelectedText(){!this.lastSelectedShape||this.lastSelectedShape.type!=="text"||(this.lastSelectedShape.isBold=this.copy(this.isBold),this.lastSelectedShape.isItalic=this.copy(this.isItalic),this.lastSelectedShape.isUnderline=this.copy(this.isUnderline),this.lastSelectedShape.fontSize=this.copy(this.textFont),this.lastSelectedShape.isBulletTextMode=this.copy(this.isBulletTextMode))},setPointer(e){e.preventDefault();const s=this.$refs.mainSvg.getBoundingClientRect();let n,l;e.touches&&e.touches.length>0?(n=e.touches[0].clientX,l=e.touches[0].clientY):(n=e.clientX,l=e.clientY),this.pointerPosition.x=(n-s.left)/s.width*this.svgWidth,this.pointerPosition.y=(l-s.top)/s.height*this.svgHeight},setShapeTo(e){if(this.showCaret=!1,this.deleteEmptyTextElement(),e===this.activeShape){this.activeShape=void 0,this.isDrawMode=!1;return}this.isDrawMode=!0,this.isDeleteMode=!1,this.isMoveMode=!1,this.isResizeMode=!1,this.isTextMode=!1,this.activeShape=e},toggleSummary(){this.isSummaryOpen=!this.isSummaryOpen,this.isSummaryOpen||(this.isMoveMode=!1,this.isResizeMode=!1,this.isTextMode=!1,this.isWriting=!1,this.activeShape=void 0,this.showCaret=!1,this.isDeleteMode=!1,this.isWriting=!1),this.$emit("toggleOpenState",{isOpen:this.isSummaryOpen})},walkTheDOM(e,o){for(o(e),e=e.firstChild;e;)this.walkTheDOM(e,o),e=e.nextSibling},save(){this.$emit("saveAnnotations",{shapes:this.shapes,lastSelectedShape:this.lastSelectedShape})}}},v={class:"vue-ui-annotator"},w={"data-dom-to-png-ignore":""},A={class:"tool-selection",style:{"margin-top":"24px"}},M=["disabled"],O=["disabled"],L=["disabled"],G=["disabled"],_={style:{width:"80%"},viewBox:"0 0 24 24"},z=["disabled"],T={style:{width:"80%"},viewBox:"0 0 24 24"},B=["disabled"],D={style:{width:"80%"},viewBox:"0 0 24 24"},V=["disabled"],E=["disabled"],R={class:"tool-selection",style:{"margin-top":"6px"}},H={viewBox:"0 0 12 12",style:{width:"100%"}},W=["fill"],P={key:0,class:"tool-input"},X={for:"circleFill"},U=["checked"],Y={viewBox:"0 0 12 12",style:{width:"100%"}},j=["fill"],q={key:1,class:"tool-input"},J={for:"rectFill"},Z=["checked"],K={viewBox:"0 0 24 24",style:{width:"100%"}},Q=["stroke"],$={key:2},ee={style:{display:"flex","flex-direction":"column","align-items":"center","justify-content":"center"}},te={for:"textFont",style:{"font-size":"0.7em"}},oe={key:3},ie={style:{display:"flex","flex-direction":"column","align-items":"center","justify-content":"center"}},le={for:"dashStyle",style:{"font-size":"0.7em"}},se={viewBox:"0 0 24 24",height:"24",width:"24",style:{"margin-bottom":"-5px","margin-top":"-10px"}},re=["checked"],ne={style:{width:"80%"},viewBox:"0 0 24 24",fill:"currentColor"},de={key:4},ce={style:{display:"flex","flex-direction":"column","align-items":"center","justify-content":"center"}},ae={for:"textFont",style:{"font-size":"0.7em"}},he={key:5},ue={key:6},ye=["disabled"],Ne={key:7},be=["disabled"],Ie={key:8},Fe={key:9},Ce={key:10},Se={key:11},xe={style:{display:"flex","flex-direction":"column","align-items":"center","justify-content":"center"},class:"tooltip"},fe={style:{display:"flex","flex-direction":"column","align-items":"start","justify-content":"center"}},ke={for:"colorTransparency",style:{"font-size":"0.7em"}},ge={class:"annotator annotator__wrapper",ref:"drawSvgContainer",style:{position:"relative"}},me=["viewBox","width","height"],pe=["id","innerHTML"],ve=["height","viewBox","width"],we=["cx","cy"];function Ae(e,o,s,n,l,t){return i.openBlock(),i.createElementBlock("div",v,[i.createElementVNode("div",w,[i.createElementVNode("details",{class:"vue-ui-annotator-summary",onToggle:o[36]||(o[36]=(...r)=>t.toggleSummary&&t.toggleSummary(...r)),style:i.normalizeStyle(`${l.isSummaryOpen?"padding-bottom: 12px":""}; background: ${t.FINAL_CONFIG.style.backgroundColor}; color:${t.FINAL_CONFIG.style.color}; ${t.FINAL_CONFIG.style.fixedTools&&l.isSummaryOpen?"position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;":""}`)},[i.createElementVNode("summary",null,i.toDisplayString(t.FINAL_CONFIG.translations.title),1),i.createElementVNode("div",A,[i.createElementVNode("button",{disabled:l.shapes.length===0,style:i.normalizeStyle({background:l.isMoveMode?t.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:l.isMoveMode?t.FINAL_CONFIG.style.buttons.controls.selected.border:t.FINAL_CONFIG.style.buttons.controls.border,color:l.isMoveMode?t.FINAL_CONFIG.style.buttons.controls.selected.color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isMoveMode,tooltip:!0}),onClick:o[0]||(o[0]=r=>{t.deleteEmptyTextElement(),l.isMoveMode=!l.isMoveMode,l.activeShape=void 0,l.isDeleteMode=!1,l.isDrawMode=!1,l.isResizeMode=!1,l.isSelectMode=!1,l.isTextMode=!1,l.isWriting=!1,l.showCaret=!1})},[o[46]||(o[46]=i.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M18 9l3 3l-3 3" data-v-633bc577></path><path d="M15 12h6" data-v-633bc577></path><path d="M6 9l-3 3l3 3" data-v-633bc577></path><path d="M3 12h6" data-v-633bc577></path><path d="M9 18l3 3l3 -3" data-v-633bc577></path><path d="M12 15v6" data-v-633bc577></path><path d="M15 6l-3 -3l-3 3" data-v-633bc577></path><path d="M12 3v6" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipMove),5)):i.createCommentVNode("",!0)],14,M),i.createElementVNode("button",{disabled:l.shapes.length===0||l.activeShape==="line",style:i.normalizeStyle({background:l.isResizeMode?t.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:l.isResizeMode?t.FINAL_CONFIG.style.buttons.controls.selected.border:t.FINAL_CONFIG.style.buttons.controls.border,color:l.isResizeMode?t.FINAL_CONFIG.style.buttons.controls.selected.color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isResizeMode,tooltip:!0}),onClick:o[1]||(o[1]=r=>{t.deleteEmptyTextElement(),l.isResizeMode=!l.isResizeMode,l.isMoveMode=!1,l.isDeleteMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.isTextMode=!1,l.isWriting=!1,l.activeShape=void 0,l.showCaret=!1})},[o[47]||(o[47]=i.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80%",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),i.createElementVNode("path",{d:"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1"}),i.createElementVNode("path",{d:"M4 12h7a1 1 0 0 1 1 1v7"})],-1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipResize),5)):i.createCommentVNode("",!0)],14,O),i.createElementVNode("button",{disabled:l.shapes.length===0,style:i.normalizeStyle({background:l.isDeleteMode?t.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:l.isDeleteMode?t.FINAL_CONFIG.style.buttons.controls.selected.border:t.FINAL_CONFIG.style.buttons.controls.border,color:l.isDeleteMode?t.FINAL_CONFIG.style.buttons.controls.selected.color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isDeleteMode,tooltip:!0}),onClick:o[2]||(o[2]=r=>{t.deleteEmptyTextElement(),l.isDeleteMode=!l.isDeleteMode,l.isMoveMode=!1,l.isResizeMode=!1,l.isSelectMode=!1,l.isTextMode=!1,l.isWriting=!1,l.activeShape=void 0,l.showCaret=!1})},[o[48]||(o[48]=i.createStaticVNode('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M4 7l16 0" data-v-633bc577></path><path d="M10 11l0 6" data-v-633bc577></path><path d="M14 11l0 6" data-v-633bc577></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" data-v-633bc577></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipDelete),5)):i.createCommentVNode("",!0)],14,L),i.createElementVNode("button",{disabled:!t.canSelect,style:i.normalizeStyle({background:l.isSelectMode?t.FINAL_CONFIG.style.buttons.controls.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:l.isSelectMode?t.FINAL_CONFIG.style.buttons.controls.selected.border:t.FINAL_CONFIG.style.buttons.controls.border,color:l.isSelectMode?t.FINAL_CONFIG.style.buttons.controls.selected.color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isSelectMode,tooltip:!0}),onClick:o[3]||(o[3]=r=>{t.deleteEmptyTextElement(),t.setShapeTo("group"),l.isSelectMode=!l.isSelectMode,l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isTextMode=!1,l.isWriting=!1,l.activeShape="group",l.showCaret=!1})},[(i.openBlock(),i.createElementBlock("svg",_,o[49]||(o[49]=[i.createElementVNode("path",{fill:"currentColor",d:"M1,1V5H2V19H1V23H5V22H19V23H23V19H22V5H23V1H19V2H5V1M5,4H19V5H20V19H19V20H5V19H4V5H5M6,6V14H9V18H18V9H14V6M8,8H12V12H8M14,11H16V16H11V14H14"},null,-1)]))),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipGroup),5)):i.createCommentVNode("",!0)],14,G),i.createElementVNode("button",{disabled:l.shapes.length===0,style:i.normalizeStyle({background:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:t.FINAL_CONFIG.style.buttons.controls.border,color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,tooltip:!0}),onClick:o[4]||(o[4]=r=>{l.isResizeMode=!1,l.isMoveMode=!0,l.isDeleteMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.isTextMode=!1,l.isWriting=!1,l.showCaret=!1,t.bringShapeTo("front")})},[(i.openBlock(),i.createElementBlock("svg",T,o[50]||(o[50]=[i.createElementVNode("path",{fill:"currentColor",d:"M2,2H11V6H9V4H4V9H6V11H2V2M22,13V22H13V18H15V20H20V15H18V13H22M8,8H16V16H8V8Z"},null,-1)]))),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipBringToFront),5)):i.createCommentVNode("",!0)],12,z),i.createElementVNode("button",{disabled:l.shapes.length===0,style:i.normalizeStyle({background:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:t.FINAL_CONFIG.style.buttons.controls.border,color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,tooltip:!0}),onClick:o[5]||(o[5]=r=>{l.isResizeMode=!1,l.isMoveMode=!0,l.isDeleteMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.isTextMode=!1,l.isWriting=!1,l.showCaret=!1,t.bringShapeTo("back")})},[(i.openBlock(),i.createElementBlock("svg",D,o[51]||(o[51]=[i.createElementVNode("path",{fill:"currentColor",d:"M2,2H11V11H2V2M9,4H4V9H9V4M22,13V22H13V13H22M15,20H20V15H15V20M16,8V11H13V8H16M11,16H8V13H11V16Z"},null,-1)]))),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipBringToBack),5)):i.createCommentVNode("",!0)],12,B),i.createElementVNode("button",{disabled:l.shapes.length===0||l.activeShape==="line",style:i.normalizeStyle({background:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:t.FINAL_CONFIG.style.buttons.controls.border,color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,tooltip:!0}),onClick:o[6]||(o[6]=r=>{t.deleteEmptyTextElement(),l.isResizeMode=!1,l.isMoveMode=!0,l.isDeleteMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.isTextMode=!1,l.isWriting=!1,l.showCaret=!1,t.copyPaste()})},[o[52]||(o[52]=i.createElementVNode("svg",{width:"80%",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),i.createElementVNode("path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"}),i.createElementVNode("path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2"})],-1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipDuplicate),5)):i.createCommentVNode("",!0)],12,V),i.createElementVNode("button",{disabled:l.shapes.length===0,style:i.normalizeStyle({background:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:t.FINAL_CONFIG.style.buttons.controls.border,color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,"button-tool--one-shot":!0,tooltip:!0}),onClick:o[7]||(o[7]=r=>{l.isResizeMode=!1,l.isMoveMode=!1,l.isDeleteMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.isTextMode=!1,l.isWriting=!1,l.activeShape=void 0,l.showCaret=!1,t.undoLastShape()})},[o[53]||(o[53]=i.createElementVNode("svg",{width:"80%",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),i.createElementVNode("path",{d:"M9 14l-4 -4l4 -4"}),i.createElementVNode("path",{d:"M5 10h11a4 4 0 1 1 0 8h-1"})],-1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipUndo),5)):i.createCommentVNode("",!0)],12,E),t.FINAL_CONFIG.style.showPrint?(i.openBlock(),i.createElementBlock("button",{key:0,style:i.normalizeStyle({background:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:t.FINAL_CONFIG.style.buttons.controls.border,color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,tooltip:!0}),onClick:o[8]||(o[8]=(...r)=>t.print&&t.print(...r))},[o[54]||(o[54]=i.createStaticVNode('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2" data-v-633bc577></path><path d="M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4" data-v-633bc577></path><path d="M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipPdf),5)):i.createCommentVNode("",!0)],4)):i.createCommentVNode("",!0),t.FINAL_CONFIG.style.showSave?(i.openBlock(),i.createElementBlock("button",{key:1,style:i.normalizeStyle({background:t.FINAL_CONFIG.style.buttons.controls.backgroundColor,border:t.FINAL_CONFIG.style.buttons.controls.border,color:t.FINAL_CONFIG.style.buttons.controls.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),class:i.normalizeClass({"button-tool":!0,tooltip:!0}),onClick:o[9]||(o[9]=(...r)=>t.save&&t.save(...r))},[o[55]||(o[55]=i.createStaticVNode('<svg width="100%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2" data-v-633bc577></path><path d="M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" data-v-633bc577></path><path d="M14 4l0 4l-6 0l0 -4" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipSave),5)):i.createCommentVNode("",!0)],4)):i.createCommentVNode("",!0)]),i.createElementVNode("div",R,[i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.activeShape==="circle",tooltip:!0}),style:i.normalizeStyle({background:l.activeShape==="circle"?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.activeShape==="circle"?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.activeShape==="circle"?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[10]||(o[10]=r=>{t.setShapeTo("circle"),l.isSelectMode=!1})},[(i.openBlock(),i.createElementBlock("svg",H,[i.createElementVNode("circle",{cx:6,cy:6,r:"4",fill:l.options.circle.filled?(l.activeShape==="circle",l.selectedColor+t.colorTransparency):"none",stroke:"currentColor"},null,8,W)])),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeCircle),5)):i.createCommentVNode("",!0)],6),l.activeShape==="circle"?(i.openBlock(),i.createElementBlock("div",P,[i.createElementVNode("label",X,i.toDisplayString(t.FINAL_CONFIG.translations.filled),1),i.withDirectives(i.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":o[11]||(o[11]=r=>l.options.circle.filled=r),onChange:o[12]||(o[12]=(...r)=>t.setFillOfSelectedCircle&&t.setFillOfSelectedCircle(...r)),checked:l.options.circle.filled},null,40,U),[[i.vModelCheckbox,l.options.circle.filled]])])):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.activeShape==="rect",tooltip:!0}),style:i.normalizeStyle({background:l.activeShape==="rect"?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.activeShape==="rect"?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.activeShape==="rect"?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[13]||(o[13]=r=>{t.setShapeTo("rect"),l.isSelectMode=!1})},[(i.openBlock(),i.createElementBlock("svg",Y,[i.createElementVNode("rect",{x:"3",y:"3",style:{rx:"0 !important",ry:"0 !important"},height:"6",width:"6",fill:l.options.rect.filled?(l.activeShape==="rect",l.selectedColor+t.colorTransparency):"none",stroke:"currentColor"},null,8,j)])),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeRect),5)):i.createCommentVNode("",!0)],6),l.activeShape==="rect"?(i.openBlock(),i.createElementBlock("div",q,[i.createElementVNode("label",J,i.toDisplayString(t.FINAL_CONFIG.translations.filled),1),i.withDirectives(i.createElementVNode("input",{id:"rectFill",type:"checkbox","onUpdate:modelValue":o[14]||(o[14]=r=>l.options.rect.filled=r),onChange:o[15]||(o[15]=(...r)=>t.setFillOfSelectedRect&&t.setFillOfSelectedRect(...r)),checked:l.options.rect.filled},null,40,Z),[[i.vModelCheckbox,l.options.rect.filled]])])):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.activeShape==="arrow",tooltip:!0}),style:i.normalizeStyle({background:l.activeShape==="arrow"?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.activeShape==="arrow"?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.activeShape==="arrow"?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[16]||(o[16]=r=>{t.setShapeTo("arrow"),l.isSelectMode=!1})},[(i.openBlock(),i.createElementBlock("svg",K,[i.createElementVNode("path",{stroke:l.options.arrow.filled?l.activeShape==="arrow"?"white":"grey":"none","stroke-width":"2",d:"M5,19 19,5 14,5 19,10.5 19,5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Q)])),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeArrow),5)):i.createCommentVNode("",!0)],6),i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.activeShape==="line",tooltip:!0}),style:i.normalizeStyle({background:l.activeShape==="line"?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.activeShape==="line"?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.activeShape==="line"?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[17]||(o[17]=r=>{t.setShapeTo("line"),l.isSelectMode=!1})},[o[56]||(o[56]=i.createElementVNode("svg",{width:"80%",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),i.createElementVNode("path",{d:"M3 15c2 3 4 4 7 4s7 -3 7 -7s-3 -7 -6 -7s-5 1.5 -5 4s2 5 6 5s8.408 -2.453 10 -5"})],-1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeFreehand),5)):i.createCommentVNode("",!0)],6),["arrow","circle","rect","line"].includes(l.activeShape)?(i.openBlock(),i.createElementBlock("div",$,[i.createElementVNode("div",ee,[i.createElementVNode("label",te,i.toDisplayString(t.FINAL_CONFIG.translations.thickness),1),i.withDirectives(i.createElementVNode("input",{id:"textFont",type:"number","onUpdate:modelValue":o[18]||(o[18]=r=>l.strokeSize=r),onInput:o[19]||(o[19]=(...r)=>t.setStrokeWidthOfSelectedShape&&t.setStrokeWidthOfSelectedShape(...r)),style:{padding:"0 4px",width:"40px",border:"1px solid #dadada","border-radius":"3px"}},null,544),[[i.vModelText,l.strokeSize]])])])):i.createCommentVNode("",!0),["arrow","circle","rect"].includes(l.activeShape)?(i.openBlock(),i.createElementBlock("div",oe,[i.createElementVNode("div",ie,[i.createElementVNode("label",le,i.toDisplayString(t.FINAL_CONFIG.translations.dashedLines),1),(i.openBlock(),i.createElementBlock("svg",se,o[57]||(o[57]=[i.createElementVNode("line",{x1:"0",x2:"24",y1:"12",y2:"12","stroke-width":"2",stroke:"black","stroke-dasharray":"3"},null,-1)]))),i.withDirectives(i.createElementVNode("input",{id:"dashStyle",name:"dashStyle",type:"checkbox","onUpdate:modelValue":o[20]||(o[20]=r=>l.isDash=r),onChange:o[21]||(o[21]=(...r)=>t.setSelectedShapeToDash&&t.setSelectedShapeToDash(...r)),checked:l.isDash},null,40,re),[[i.vModelCheckbox,l.isDash]])])])):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isTextMode,tooltip:!0}),style:i.normalizeStyle({background:l.isTextMode?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.isTextMode?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.isTextMode?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[22]||(o[22]=r=>{t.deleteEmptyTextElement(),l.isTextMode=!l.isTextMode,l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isSelectMode=!1,l.isDrawMode=!1,l.activeShape=void 0})},[(i.openBlock(),i.createElementBlock("svg",ne,o[58]||(o[58]=[i.createElementVNode("path",{d:"M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z"},null,-1)]))),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeText),5)):i.createCommentVNode("",!0)],6),l.isTextMode?(i.openBlock(),i.createElementBlock("div",de,[i.createElementVNode("div",ce,[i.createElementVNode("label",ae,i.toDisplayString(t.FINAL_CONFIG.translations.fontSize),1),i.withDirectives(i.createElementVNode("input",{id:"textFont",type:"number","onUpdate:modelValue":o[23]||(o[23]=r=>l.textFont=r),onInput:o[24]||(o[24]=(...r)=>t.setCurrentStyleOfSelectedText&&t.setCurrentStyleOfSelectedText(...r)),style:{padding:"0 4px",width:"40px",border:"1px solid #dadada","border-radius":"3px"}},null,544),[[i.vModelText,l.textFont]])])])):i.createCommentVNode("",!0),l.isTextMode?(i.openBlock(),i.createElementBlock("div",he,[i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.textAlign==="start",tooltip:!0}),style:i.normalizeStyle({background:l.textAlign==="start"?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.textAlign==="start"?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.textAlign==="start"?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[25]||(o[25]=r=>{l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.activeShape=void 0,l.textAlign="start",t.setSelectedTextAlignTo("start")})},[o[59]||(o[59]=i.createStaticVNode('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M4 6l16 0" data-v-633bc577></path><path d="M4 12l10 0" data-v-633bc577></path><path d="M4 18l14 0" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeTextLeft),5)):i.createCommentVNode("",!0)],6)])):i.createCommentVNode("",!0),l.isTextMode?(i.openBlock(),i.createElementBlock("div",ue,[i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.textAlign==="middle",tooltip:!0}),style:i.normalizeStyle({background:l.textAlign==="middle"?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.textAlign==="middle"?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.textAlign==="middle"?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),disabled:l.isBulletTextMode,onClick:o[26]||(o[26]=r=>{l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.activeShape=void 0,l.textAlign="middle",t.setSelectedTextAlignTo("middle")})},[o[60]||(o[60]=i.createStaticVNode('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M4 6l16 0" data-v-633bc577></path><path d="M8 12l8 0" data-v-633bc577></path><path d="M6 18l12 0" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeTextCenter),5)):i.createCommentVNode("",!0)],14,ye)])):i.createCommentVNode("",!0),l.isTextMode?(i.openBlock(),i.createElementBlock("div",Ne,[i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.textAlign==="end",tooltip:!0}),style:i.normalizeStyle({background:l.textAlign==="end"?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.textAlign==="end"?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.textAlign==="end"?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),disabled:l.isBulletTextMode,onClick:o[27]||(o[27]=r=>{l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.activeShape=void 0,l.textAlign="end",t.setSelectedTextAlignTo("end")})},[o[61]||(o[61]=i.createStaticVNode('<svg width="80%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M4 6l16 0" data-v-633bc577></path><path d="M10 12l10 0" data-v-633bc577></path><path d="M6 18l14 0" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeTextRight),5)):i.createCommentVNode("",!0)],14,be)])):i.createCommentVNode("",!0),l.isTextMode?(i.openBlock(),i.createElementBlock("div",Ie,[i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isBulletTextMode,tooltip:!0}),style:i.normalizeStyle({background:l.isBulletTextMode?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.isBulletTextMode?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.isBulletTextMode?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[28]||(o[28]=r=>{l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.activeShape=void 0,l.isBulletTextMode=!l.isBulletTextMode,l.textAlign="start",t.setSelectedTextAlignTo("start"),t.setCurrentStyleOfSelectedText()})},[o[62]||(o[62]=i.createStaticVNode('<svg width="100%" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M9 6l11 0" data-v-633bc577></path><path d="M9 12l11 0" data-v-633bc577></path><path d="M9 18l11 0" data-v-633bc577></path><path d="M5 6l0 .01" data-v-633bc577></path><path d="M5 12l0 .01" data-v-633bc577></path><path d="M5 18l0 .01" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeTextBullet),5)):i.createCommentVNode("",!0)],6)])):i.createCommentVNode("",!0),l.isTextMode?(i.openBlock(),i.createElementBlock("div",Fe,[i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isBold,tooltip:!0}),style:i.normalizeStyle({background:l.isBold?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.isBold?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.isBold?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[29]||(o[29]=r=>{l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.activeShape=void 0,l.isBold=!l.isBold,t.setCurrentStyleOfSelectedText()})},[o[63]||(o[63]=i.createElementVNode("svg",{width:"100%",viewBox:"0 0 24 24","stroke-width":"3",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),i.createElementVNode("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}),i.createElementVNode("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"})],-1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeTextBold),5)):i.createCommentVNode("",!0)],6)])):i.createCommentVNode("",!0),l.isTextMode?(i.openBlock(),i.createElementBlock("div",Ce,[i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isItalic,tooltip:!0}),style:i.normalizeStyle({background:l.isItalic?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.isItalic?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.isItalic?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[30]||(o[30]=r=>{l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.activeShape=void 0,l.isItalic=!l.isItalic,t.setCurrentStyleOfSelectedText()})},[o[64]||(o[64]=i.createStaticVNode('<svg width="100%" height="44" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" data-v-633bc577><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-633bc577></path><path d="M11 5l6 0" data-v-633bc577></path><path d="M7 19l6 0" data-v-633bc577></path><path d="M14 5l-4 14" data-v-633bc577></path></svg>',1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeTextItalic),5)):i.createCommentVNode("",!0)],6)])):i.createCommentVNode("",!0),l.isTextMode?(i.openBlock(),i.createElementBlock("div",Se,[i.createElementVNode("button",{class:i.normalizeClass({"button-tool":!0,"button-tool--selected":l.isUnderline,tooltip:!0}),style:i.normalizeStyle({background:l.isUnderline?t.FINAL_CONFIG.style.buttons.shapes.selected.backgroundColor:t.FINAL_CONFIG.style.buttons.shapes.backgroundColor,border:l.isUnderline?t.FINAL_CONFIG.style.buttons.shapes.selected.border:t.FINAL_CONFIG.style.buttons.shapes.border,color:l.isUnderline?t.FINAL_CONFIG.style.buttons.shapes.selected.color:t.FINAL_CONFIG.style.buttons.shapes.color,borderRadius:`${t.FINAL_CONFIG.style.buttons.borderRadius}px`}),onClick:o[31]||(o[31]=r=>{l.isDeleteMode=!1,l.isMoveMode=!1,l.isResizeMode=!1,l.isDrawMode=!1,l.isSelectMode=!1,l.activeShape=void 0,l.isUnderline=!l.isUnderline,t.setCurrentStyleOfSelectedText()})},[o[65]||(o[65]=i.createElementVNode("svg",{width:"100%",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),i.createElementVNode("path",{d:"M7 5v5a5 5 0 0 0 10 0v-5"}),i.createElementVNode("path",{d:"M5 19h14"})],-1)),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeTextUnderline),5)):i.createCommentVNode("",!0)],6)])):i.createCommentVNode("",!0),i.createElementVNode("div",xe,[i.withDirectives(i.createElementVNode("input",{type:"color",id:"colorPicker",name:"colorPicker","onUpdate:modelValue":o[32]||(o[32]=r=>l.selectedColor=r),onInput:o[33]||(o[33]=(...r)=>t.setColorOfSelectedShape&&t.setColorOfSelectedShape(...r)),style:i.normalizeStyle(`height: 30px; width: 30px; border-radius: ${t.FINAL_CONFIG.style.buttons.borderRadius}px; cursor: pointer`)},null,36),[[i.vModelText,l.selectedColor]]),t.FINAL_CONFIG.style.showTooltips?(i.openBlock(),i.createElementBlock("span",{key:0,class:"tooltiptext",style:i.normalizeStyle({backgroundColor:t.FINAL_CONFIG.style.tooltips.backgroundColor,color:t.FINAL_CONFIG.style.tooltips.color,border:t.FINAL_CONFIG.style.tooltips.border,borderRadius:`${t.FINAL_CONFIG.style.tooltips.borderRadius}px`,boxShadow:t.FINAL_CONFIG.style.tooltips.boxShadow})},i.toDisplayString(t.FINAL_CONFIG.translations.tooltipShapeColor),5)):i.createCommentVNode("",!0)]),i.createElementVNode("div",fe,[i.createElementVNode("label",ke,i.toDisplayString(t.FINAL_CONFIG.translations.colorAlpha)+": "+i.toDisplayString(l.transparency>98?100:l.transparency)+" % ",1),i.withDirectives(i.createElementVNode("input",{id:"colorTransparency",name:"colorTransparency",type:"range","onUpdate:modelValue":o[34]||(o[34]=r=>l.transparency=r),onInput:o[35]||(o[35]=(...r)=>t.setTransparencyOfSelectedShape&&t.setTransparencyOfSelectedShape(...r)),min:0,max:100,style:{width:"100px"}},null,544),[[i.vModelText,l.transparency]])])])],36)]),i.createElementVNode("div",ge,[i.renderSlot(e.$slots,"default",{},void 0,!0),l.isSummaryOpen?(i.openBlock(),i.createElementBlock("svg",{id:"annotatorSvg",key:l.step,ref:"mainSvg",class:i.normalizeClass({draw:!0,"draw--free":l.activeShape==="line"}),style:i.normalizeStyle([`cursor:${t.cursorClass}; font-family: Helvetica; z-index: 100000000;`,{position:"absolute",top:"0",left:"0"}]),viewBox:`0 0 ${l.svgWidth} ${l.svgHeight}`,width:l.sourceWidth,height:l.sourceHeight,onPointerdown:o[38]||(o[38]=r=>t.chooseAction(r)),onPointerup:o[39]||(o[39]=(...r)=>t.resetDraw&&t.resetDraw(...r)),onTouchend:o[40]||(o[40]=(...r)=>t.resetDraw&&t.resetDraw(...r)),onTouchstart:o[41]||(o[41]=r=>{t.setPointer(r),t.clickSvg(r)}),onPointermove:o[42]||(o[42]=r=>{t.setPointer(r),t.chooseMove(r)}),onPointerout:o[43]||(o[43]=r=>{l.preventEdit=!0,l.hoveredShapeId=void 0}),onPointerover:o[44]||(o[44]=r=>t.allowEditAndHoverShapes(r)),onClick:o[45]||(o[45]=r=>t.clickSvg(r))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.userShapes,(r,d)=>(i.openBlock(),i.createElementBlock("g",{key:`shape_${d}`,id:r.id,innerHTML:r,onClick:o[37]||(o[37]=c=>{t.clickShape(c),l.isMoveMode=!1})},null,8,pe))),128))],46,me)):i.createCommentVNode("",!0),l.isPrinting?(i.openBlock(),i.createElementBlock("svg",{key:1,style:{position:"absolute",top:"0",left:"0"},height:l.sourceHeight,viewBox:`0 0 ${l.svgWidth} ${l.svgHeight}`,width:l.sourceWidth},[i.createElementVNode("circle",{class:"animated-circle-print",cx:l.svgWidth/2,cy:l.svgHeight/2,r:"50",stroke:"#6376DD","stroke-width":"10",fill:"none"},null,8,we)],8,ve)):i.createCommentVNode("",!0)],512)])}const Me=m._export_sfc(p,[["render",Ae],["__scopeId","data-v-633bc577"]]);exports.default=Me;
@@ -1,34 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Cn2tUOoX.cjs"),F=require("./useNestedProp-C8955nsn.cjs"),J=require("./Title-D62pPwLz.cjs"),K=require("./Legend-ieOu_fKK.cjs"),I=require("./usePrinter-BrH80VBz.cjs"),Q=require("./PackageVersion-BxSGdh6L.cjs"),Z=require("./PenAndPaper-ByAFuR-l.cjs"),ee=require("./vue-ui-skeleton-Mcoev-5q.cjs"),te=require("./useUserOptionState-BgepsfED.cjs"),ae=require("./useChartAccessibility-Cm7nkzTG.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=["id"],oe={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},se=["xmlns","viewBox"],ne=["width","height"],ue={key:1},ie=["x","y","height","width","fill","stroke"],ce=["x","y","height","width","rx","fill","stroke","stroke-width"],de=["x","y","height","width","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ve=["x","y","height","width","rx","fill","stroke","stroke-width"],me={key:3},ge=["x","y","fill","font-size","font-weight"],fe={key:4},ye=["x1","x2","y1","y2","stroke"],pe={key:5,class:"vue-data-ui-watermark"},ke={class:"vue-ui-bullet-legend-item",dir:"auto"},be={style:{"margin-right":"2px"}},we={key:7,ref:"source",dir:"auto"},Be={__name:"vue-ui-bullet",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(z,{expose:H}){const{vue_ui_bullet:T}=s.useConfig(),n=z,w=e.ref(null),q=e.ref(null),B=e.ref(0),M=e.ref(null),U=e.ref(0),h=e.computed({get:()=>n.dataset.hasOwnProperty("value"),set:a=>a}),v=e.computed(()=>n.dataset.segments?Array.isArray(n.dataset.segments)?n.dataset.segments.length?!0:(console.warn(`VueUiBullet: dataset segments is empty. Provide segments with this datastructure:
2
-
3
- segments: [
4
- {
5
- name: string;
6
- from: number;
7
- to: number;
8
- color?: string;
9
- },
10
- {...}
11
- ]
12
- `),h.value=!1,!1):(console.warn(`VueUiBullet: dataset segments must be an array of objects with this datastructure:
13
-
14
- segments: [
15
- {
16
- name: string;
17
- from: number;
18
- to: number;
19
- color?: string;
20
- },
21
- {...}
22
- ]
23
- `),h.value=!1,!1):(console.warn(`VueUiBullet: dataset segments is empty. Provide segments with this datastructure:
24
-
25
- segments: [
26
- {
27
- name: string;
28
- from: number;
29
- to: number;
30
- color?: string;
31
- },
32
- {...}
33
- ]
34
- `),h.value=!1,!1));e.onMounted(C);function C(){s.objectIsEmpty(n.dataset)?s.error({componentName:"VueUiBullet",type:"dataset"}):v.value?n.dataset.segments.forEach((a,o)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","from","to"]}).forEach(l=>{h.value=!1,s.error({componentName:"VueUiBullet segment",type:"datasetSerieAttribute",property:l,index:o})})}):h.value=!1,t.value.style.chart.animation.show&&P(n.dataset.value||0)}const y=e.ref(s.createUid());function x(){const a=F.useNestedProp({userConfig:n.config,defaultConfig:T});return a.theme?{...F.useNestedProp({userConfig:s.themes.vue_ui_bullet[a.theme]||n.config,defaultConfig:a})}:a}const t=e.computed({get:()=>x(),set:a=>a}),{userOptionsVisible:p,setUserOptionsVisibility:_,keepUserOptionState:L}=te.useUserOptionState({config:t.value}),{svgRef:S}=ae.useChartAccessibility({config:t.value.style.chart.title});e.watch(()=>n.config,a=>{t.value=x(),p.value=!t.value.userOptions.showOnChartHover,C(),B.value+=1},{deep:!0});const r=e.computed(()=>{const a=t.value.style.chart.height,o=t.value.style.chart.width,l=t.value.style.chart.padding.left,d=o-t.value.style.chart.padding.right,f=t.value.style.chart.padding.top,c=a-t.value.style.chart.padding.bottom;return{height:a,width:o,left:l,right:d,top:f,bottom:c,chartWidth:d-l,chartHeight:c-f}}),R=e.computed(()=>{if(!v.value)return[];const a=[];for(let o=0;o<n.dataset.segments.length;o+=1)a.push(s.lightenHexColor(t.value.style.chart.segments.baseColor,o/n.dataset.segments.length));return a}),k=e.computed(()=>v.value?{min:Math.min(...n.dataset.segments.map(a=>a.from)),max:Math.max(...n.dataset.segments.map(a=>a.to))}:{min:0,max:1}),u=e.ref(D());e.watch(()=>n.dataset,a=>{t.value.style.chart.animation.show?P(a.value||0):u.value=a.value||0},{deep:!0});function D(){return t.value.style.chart.animation.show?k.value.min:n.dataset.value||0}const N=e.ref(null);function P(a){const o=Math.abs(a-u.value)/t.value.style.chart.animation.animationFrames;function l(){u.value<a?u.value=Math.min(u.value+o,a):u.value>a&&(u.value=Math.max(u.value-o,a)),u.value!==a&&(N.value=requestAnimationFrame(l))}l()}e.onBeforeUnmount(()=>{cancelAnimationFrame(N.value)});const i=e.computed(()=>{if(!v.value)return[];const a=s.calculateNiceScale(k.value.min,k.value.max,t.value.style.chart.segments.ticks.divisions),o=a.min>=0?0:Math.abs(a.min),l={x:r.value.left+(n.dataset.target+o)/(a.max+o)*r.value.chartWidth-t.value.style.chart.target.width/2},d={width:(u.value+o)/(a.max+o)*r.value.chartWidth},f=a.ticks.map(c=>({value:c,y:r.value.bottom+t.value.style.chart.segments.dataLabels.fontSize+3+t.value.style.chart.segments.dataLabels.offsetY,x:r.value.left+(c+o)/(a.max+o)*r.value.chartWidth}));return{scale:a,target:l,value:d,ticks:f,chunks:n.dataset.segments.map((c,Y)=>({...c,color:c.color?s.convertColorToHex(c.color):R.value[Y],x:r.value.left+r.value.chartWidth*((c.from+o)/(a.max+o)),y:r.value.top,height:r.value.chartHeight,width:r.value.chartWidth*(Math.abs(c.to-c.from)/(a.max+o))}))}}),E=e.computed(()=>!i.value||!i.value.chunks||!i.value.chunks.length?[]:i.value.chunks.map(a=>{const o=s.applyDataLabel(t.value.style.chart.segments.dataLabels.formatter,a.from,s.dataLabel({p:t.value.style.chart.segments.dataLabels.prefix,v:a.from,s:t.value.style.chart.segments.dataLabels.suffix,r:t.value.style.chart.segments.dataLabels.rounding})),l=s.applyDataLabel(t.value.style.chart.segments.dataLabels.formatter,a.to,s.dataLabel({p:t.value.style.chart.segments.dataLabels.prefix,v:a.to,s:t.value.style.chart.segments.dataLabels.suffix,r:t.value.style.chart.segments.dataLabels.rounding}));return{...a,shape:"square",value:`${o} - ${l}`}})),W=e.computed(()=>({cy:"bullet-div-legend",backgroundColor:"transparent",color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:6,fontWeight:t.value.style.chart.legend.bold?"bold":""})),{isPrinting:$,isImaging:V,generatePdf:O,generateImage:A}=I.usePrinter({elementId:`bullet_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-bullet",options:t.value.userOptions.print}),j=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),m=e.ref(!1);function G(a){m.value=a,U.value+=1}function X(){return i.value}const g=e.ref(!1);function b(){g.value=!g.value}return H({getData:X,generatePdf:O,generateImage:A,toggleAnnotator:b}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"bulletChart",ref:w,class:e.normalizeClass(`vue-ui-bullet ${m.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%;background:${t.value.style.chart.backgroundColor}`),id:`bullet_${y.value}`,onMouseenter:o[0]||(o[0]=()=>e.unref(_)(!0)),onMouseleave:o[1]||(o[1]=()=>e.unref(_)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Z._sfc_main,{key:0,svgRef:e.unref(S),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:g.value,onClose:b},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("div",oe,null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:q,style:"width:100%;background:transparent;"},[(e.openBlock(),e.createBlock(J._sfc_main,{lineHeight:"1.3rem",key:`title_${B.value}`,config:{title:{cy:"bullet-div-title",...t.value.style.chart.title},subtitle:{cy:"bullet-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&h.value&&(e.unref(L)||e.unref(p))?(e.openBlock(),e.createBlock(I.UserOptions,{key:3,ref:"details",backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref($),isImaging:e.unref(V),uid:y.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:!1,hasTable:!1,hasLabel:!1,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:m.value,chartElement:w.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:g.value,onToggleFullscreen:G,onGeneratePdf:e.unref(O),onGenerateImage:e.unref(A),onToggleAnnotator:b,style:e.normalizeStyle({visibility:e.unref(L)?e.unref(p)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:d})=>[e.renderSlot(a.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:d})),void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:d})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:d})),void 0,!0)]),key:"3"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:d})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:d})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:S,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":m.value,"vue-data-ui-fulscreen--off":!m.value,"vue-ui-bullet-svg":!0}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`width: 100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Q._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:r.value.width,height:r.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,ne)):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("g",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.chunks,l=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:l.color,"stroke-width":1,stroke:t.value.style.chart.backgroundColor},null,8,ie))),256)),t.value.style.chart.target.onTop?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,x:i.value.target.x,y:r.value.top+(r.value.chartHeight-r.value.chartHeight*t.value.style.chart.target.heightRatio)/2,height:r.value.chartHeight*t.value.style.chart.target.heightRatio,width:t.value.style.chart.target.width,rx:t.value.style.chart.target.rounded?t.value.style.chart.target.width/2:0,fill:t.value.style.chart.target.color,stroke:t.value.style.chart.target.stroke,"stroke-width":t.value.style.chart.target.strokeWidth},null,8,ce)),e.createElementVNode("rect",{x:r.value.left,y:r.value.top+(r.value.chartHeight-r.value.chartHeight*t.value.style.chart.valueBar.heightRatio)/2,height:r.value.chartHeight*t.value.style.chart.valueBar.heightRatio,width:i.value.value.width,fill:t.value.style.chart.valueBar.color,stroke:t.value.style.chart.valueBar.stroke,"stroke-width":t.value.style.chart.valueBar.strokeWidth},null,8,de),t.value.style.chart.valueBar.label.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:r.value.left+i.value.value.width,y:r.value.top-6+t.value.style.chart.valueBar.label.offsetY,"font-size":t.value.style.chart.valueBar.label.fontSize,"font-weight":t.value.style.chart.valueBar.label.bold?"bold":"normal",fill:t.value.style.chart.valueBar.label.color,"text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.segments.dataLabels.formatter,u.value,e.unref(s.dataLabel)({p:t.value.style.chart.segments.dataLabels.prefix,v:u.value,s:t.value.style.chart.segments.dataLabels.suffix,r:t.value.style.chart.segments.dataLabels.rounding}))),9,he)):e.createCommentVNode("",!0),t.value.style.chart.target.onTop?(e.openBlock(),e.createElementBlock("rect",{key:2,x:i.value.target.x,y:r.value.top+(r.value.chartHeight-r.value.chartHeight*t.value.style.chart.target.heightRatio)/2,height:r.value.chartHeight*t.value.style.chart.target.heightRatio,width:t.value.style.chart.target.width,rx:t.value.style.chart.target.rounded?t.value.style.chart.target.width/2:0,fill:t.value.style.chart.target.color,stroke:t.value.style.chart.target.stroke,"stroke-width":t.value.style.chart.target.strokeWidth},null,8,ve)):e.createCommentVNode("",!0),t.value.style.chart.segments.dataLabels.show?(e.openBlock(),e.createElementBlock("g",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,l=>(e.openBlock(),e.createElementBlock("text",{x:l.x,y:l.y,"text-anchor":"middle",fill:t.value.style.chart.segments.dataLabels.color,"font-size":t.value.style.chart.segments.dataLabels.fontSize+"px","font-weight":t.value.style.chart.segments.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.segments.dataLabels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.segments.dataLabels.prefix,v:l.value,s:t.value.style.chart.segments.dataLabels.suffix,r:t.value.style.chart.segments.dataLabels.rounding}))),9,ge))),256))])):e.createCommentVNode("",!0),t.value.style.chart.segments.dataLabels.show&&t.value.style.chart.segments.ticks.show?(e.openBlock(),e.createElementBlock("g",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.ticks,l=>(e.openBlock(),e.createElementBlock("line",{x1:l.x,x2:l.x,y1:r.value.bottom,y2:r.value.bottom+3,stroke:t.value.style.chart.segments.ticks.stroke,"stroke-width":1,"stroke-linecap":"round"},null,8,ye))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:r.value},void 0,!0)],14,se)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref($)||e.unref(V)})),void 0,!0)])):e.createCommentVNode("",!0),h.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ee.default,{key:6,config:{type:"bullet",style:{backgroundColor:t.value.style.chart.backgroundColor,bullet:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:M},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(K.Legend,{key:0,clickable:!1,legendSet:E.value,config:W.value},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",ke,[e.createElementVNode("span",be,e.toDisplayString(l.name)+":",1),e.createElementVNode("span",null,e.toDisplayString(l.value),1)])]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:E.value},void 0,!0)],512),a.$slots.source?(e.openBlock(),e.createElementBlock("div",we,[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],46,re))}},Ce=le._export_sfc(Be,[["__scopeId","data-v-e444b500"]]);exports.default=Ce;