@worm-print-platform/canvas 1.6.2 → 1.6.3

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 (67) hide show
  1. package/README.md +1 -1
  2. package/dist/browser-bundle.d.ts +1 -1
  3. package/dist/canvas.js +22 -1
  4. package/dist/core/default-template.d.ts +1 -1
  5. package/dist/core/element-definitions.d.ts +1 -1
  6. package/dist/core/format.d.ts +1 -1
  7. package/dist/core/h.d.ts +1 -1
  8. package/dist/core/icons.d.ts +1 -1
  9. package/dist/core/plugin.d.ts +1 -1
  10. package/dist/core/store.d.ts +1 -1
  11. package/dist/host-contract.d.ts +1 -1
  12. package/dist/index.cjs +22 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +23 -2
  15. package/dist/print-designer.d.ts +1 -1
  16. package/dist/shell/binding.d.ts +1 -1
  17. package/dist/shell/canvas.d.ts +1 -1
  18. package/dist/shell/code.d.ts +1 -1
  19. package/dist/shell/color-picker.d.ts +1 -1
  20. package/dist/shell/controls.d.ts +1 -1
  21. package/dist/shell/crop-anchor.d.ts +1 -1
  22. package/dist/shell/elements.d.ts +1 -1
  23. package/dist/shell/expression-editor.d.ts +1 -1
  24. package/dist/shell/flow-list.d.ts +1 -1
  25. package/dist/shell/font-select.d.ts +1 -1
  26. package/dist/shell/format-bar.d.ts +1 -1
  27. package/dist/shell/help-content/en-US/advanced-settings.d.ts +1 -1
  28. package/dist/shell/help-content/en-US/changelog.d.ts +1 -1
  29. package/dist/shell/help-content/en-US/faq.d.ts +1 -1
  30. package/dist/shell/help-content/en-US/features.d.ts +1 -1
  31. package/dist/shell/help-content/en-US/getting-started.d.ts +1 -1
  32. package/dist/shell/help-content/en-US/shortcuts.d.ts +1 -1
  33. package/dist/shell/help-content/index.d.ts +1 -1
  34. package/dist/shell/help-content/th-TH/advanced-settings.d.ts +1 -1
  35. package/dist/shell/help-content/th-TH/changelog.d.ts +1 -1
  36. package/dist/shell/help-content/th-TH/faq.d.ts +1 -1
  37. package/dist/shell/help-content/th-TH/features.d.ts +1 -1
  38. package/dist/shell/help-content/th-TH/getting-started.d.ts +1 -1
  39. package/dist/shell/help-content/th-TH/shortcuts.d.ts +1 -1
  40. package/dist/shell/help-content/zh-CN/advanced-settings.d.ts +1 -1
  41. package/dist/shell/help-content/zh-CN/changelog.d.ts +1 -1
  42. package/dist/shell/help-content/zh-CN/faq.d.ts +1 -1
  43. package/dist/shell/help-content/zh-CN/features.d.ts +1 -1
  44. package/dist/shell/help-content/zh-CN/getting-started.d.ts +1 -1
  45. package/dist/shell/help-content/zh-CN/shortcuts.d.ts +1 -1
  46. package/dist/shell/help-modal.d.ts +1 -1
  47. package/dist/shell/page-extras.d.ts +1 -1
  48. package/dist/shell/panels.d.ts +1 -1
  49. package/dist/shell/plugin-ui.d.ts +1 -1
  50. package/dist/shell/prop-group.d.ts +1 -1
  51. package/dist/shell/property-panel.d.ts +1 -1
  52. package/dist/shell/property-search.d.ts +1 -1
  53. package/dist/shell/ruler.d.ts +1 -1
  54. package/dist/shell/table-props.d.ts +1 -1
  55. package/dist/shell/table.d.ts +1 -1
  56. package/dist/shell/toolbar-overflow.d.ts +1 -1
  57. package/dist/shell/toolbar.d.ts +1 -1
  58. package/dist/shell/watermark.d.ts +1 -1
  59. package/dist/test-setup.d.ts +1 -1
  60. package/dist/theme-tokens.d.ts +1 -1
  61. package/dist/version.d.ts +2 -2
  62. package/dist/vue3/PrintDesigner.d.ts +1 -1
  63. package/dist/vue3/PrintHtmlPreview.d.ts +1 -1
  64. package/dist/vue3/index.d.ts +1 -1
  65. package/dist/vue3/previewStyle.d.ts +1 -1
  66. package/dist/vue3/toolbarOverflow.d.ts +1 -1
  67. package/package.json +3 -3
package/dist/canvas.js CHANGED
@@ -293,7 +293,7 @@ Click OK to save, Cancel to go back and edit.
293
293
 
294
294
  {warnings}`,"store.tilingSinglePage":"เมื่อเปิดการจัดเรียงชิ้น อนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","elementGroup.chart":"แผนภูมิ","service.printData.emptyArray":"ข้อมูลการพิมพ์เป็นชุดต้องเป็นอาร์เรย์อ็อบเจกต์ที่ไม่ว่างเปล่า","service.printData.tooMany":"การพิมพ์เป็นชุดรองรับได้มากสุด {max} ชุด ได้ {count} ชุด","service.printData.itemNotObject":"รายการข้อมูลการพิมพ์ชุดที่ {index} ต้องเป็นอ็อบเจกต์","service.printData.notObjectOrArray":"printData ต้องเป็นอ็อบเจกต์หรืออาร์เรย์",...m2,...g2},k2={constants:{"constants.borderStyle.none":"无","constants.borderStyle.solid":"实线","constants.borderStyle.dashed":"虚线","constants.borderStyle.dotted":"点线","constants.borderStyle.double":"双线","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"全等分 241×279.4mm","constants.paper.DOT_HALF.label":"二等分 241×139.7mm","constants.paper.DOT_THIRD.label":"三等分 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"连续纸(自定义宽度)","constants.paper.group.common":"常用纸张","constants.paper.group.dotMatrix":"针式打印纸","constants.paper.group.labels":"标签纸","constants.paper.group.receipt":"小票纸","constants.paper.group.continuous":"连续纸","constants.watermark.density.dense":"密","constants.watermark.density.medium":"中(默认)","constants.watermark.density.loose":"疏","constants.watermark.density.size":"({w}×{h})","constants.label.content":"内容","constants.hint.border.apply":"线型 / 宽度 / 颜色即时生效,这三行显示的就是当前生效规格:已有边框时任改一行都会按新规格铺满四边并清掉单边覆盖;上、下、左、右只给选中的边加框,撤掉一边会把它其余三边落成单边;「无」清除边框,「内部」仅表格单元格可用","constants.hint.border.pending":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","constants.hint.border.multi":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","constants.hint.border.mixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写"}},y2={constants:{"constants.borderStyle.none":"None","constants.borderStyle.solid":"Solid","constants.borderStyle.dashed":"Dashed","constants.borderStyle.dotted":"Dotted","constants.borderStyle.double":"Double","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"Full sheet 241×279.4mm","constants.paper.DOT_HALF.label":"Half sheet 241×139.7mm","constants.paper.DOT_THIRD.label":"Third sheet 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"Continuous paper (custom width)","constants.paper.group.common":"Common","constants.paper.group.dotMatrix":"Dot-matrix","constants.paper.group.labels":"Labels","constants.paper.group.receipt":"Receipt","constants.paper.group.continuous":"Continuous","constants.watermark.density.dense":"Dense","constants.watermark.density.medium":"Medium (default)","constants.watermark.density.loose":"Sparse","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"Content","constants.hint.border.apply":'Line style / width / color apply immediately; these three rows show the effective spec. With an existing border, changing any row fills all four sides and clears per-side overrides. Top / right / bottom / left add a border only to the selected side; removing one turns the other three into per-side borders. "None" clears the border; "Inside" is available for table cells only.',"constants.hint.border.pending":'Line style / width / color are a pending spec: they are prefilled when the selected cells share one border spec. Mixed values show "Mixed"; no border shows "None / 0". Click All / Outside / Inside or tick a side (top / right / bottom / left) to write to the selected cells; "None" clears the border.',"constants.hint.border.multi":'Multi-select does not show a single cell border: line style / width / color act as a batch spec. Click All / Outside / Inside or tick a side to apply to all selected cells; "None" clears the border.',"constants.hint.border.mixed":'The four sides of this cell have different border specs: "Mixed" is shown instead of a false value. Untouched fields fall back to the default (Solid 0.75pt) when you click All / Outside / Inside or tick a side; changing any field writes that value to the batch.'}},v2={constants:{"constants.borderStyle.none":"ไม่มี","constants.borderStyle.solid":"เส้นทึบ","constants.borderStyle.dashed":"เส้นประ","constants.borderStyle.dotted":"เส้นจุด","constants.borderStyle.double":"เส้นคู่","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"แผ่นเต็ม 241×279.4mm","constants.paper.DOT_HALF.label":"แผ่นครึ่ง 241×139.7mm","constants.paper.DOT_THIRD.label":"แผ่นหนึ่งในสาม 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"กระดาษต่อเนื่อง (ความกว้างกำหนดเอง)","constants.paper.group.common":"กระดาษทั่วไป","constants.paper.group.dotMatrix":"กระดาษดอทเมทริกซ์","constants.paper.group.labels":"ฉลาก","constants.paper.group.receipt":"ใบเสร็จ","constants.paper.group.continuous":"กระดาษต่อเนื่อง","constants.watermark.density.dense":"หนาแน่น","constants.watermark.density.medium":"กลาง (ค่าเริ่มต้น)","constants.watermark.density.loose":"ห่าง","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"เนื้อหา","constants.hint.border.apply":'รูปแบบเส้น/ความกว้าง/สีมีผลทันที สามบรรทัดนี้แสดงผลที่มีผลอยู่: เมื่อมีเส้นขอบอยู่แล้ว การเปลี่ยนแถวใดจะเติมสี่ด้านและลบการเขียนทับรายด้าน; บน/ขวา/ล่าง/ซ้ายเพิ่มเส้นเฉพาะด้านที่เลือก การลบด้านหนึ่งจะทำให้สามด้านที่เหลือเป็นเส้นแยก; "ไม่มี" ลบเส้นขอบ "ด้านใน" ใช้สำหรับเซลล์ตารางเท่านั้น',"constants.hint.border.pending":'รูปแบบเส้น/ความกว้าง/สีเป็นค่าที่รอใช้งาน: จะเติมในสามบรรทัดนี้เมื่อเซลล์ที่เลือกมีเส้นขอบสอดคล้องกัน; ค่าที่ไม่ตรงกันแสดง "ผสม" ไม่มีเส้นแสดง "ไม่มี / 0" แก้แล้วคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งจึงเขียนลงเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.multi":'การเลือกหลายรายการไม่แสดงเส้นขอบของเซลล์เดี่ยว: รูปแบบเส้น/ความกว้าง/สีเป็นค่าเขียนเป็นชุด คลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งเพื่อเขียนทุกเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.mixed":'เส้นขอบสี่ด้านของเซลล์นี้ไม่สอดคล้องกัน: รายการ "ผสม" ไม่รายงานค่าผิด; รายการที่ไม่เปลี่ยนใช้ค่าเริ่มต้น (เส้นทึบ 0.75pt) เมื่อคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านเดียว; เปลี่ยนรายการใดจะเขียนค่านั้นเป็นชุด'}},w2={propertyTips:{"propertyTips.ap-long-text-indent":"长文本每段首行空出的宽度,单位「字符」:填 2 即缩进两个汉字宽(中文排版惯例),按 em 落纸——字号被「自动缩小」压小时缩进同步变窄。仅长文本元素生效,写在普通文本上不生效","propertyTips.ap-img-fit":"图片在元素框内的缩放方式:包含=完整显示、可能留白;剪裁=铺满框并按「裁剪锚点」取一块;拉伸=填满框会变形;原始尺寸与缩小不放大。画布与三条出纸链路同一口径(缺省包含)","propertyTips.ap-img-object-position":"取位(仅「剪裁」档有这一行):剪裁把图等比铺满元素框,多出来的那一条边按这里选的位置取舍。先选位置档(贴边/居中/贴另一头),再按百分比微调,0 贴左/贴顶,100 挪到另一头,水平与垂直各自独立;缺省取正中间(保住证件照头顶就选顶部)。其余缩放模式图比框小或刚好铺满,没有可裁的边,所以不出本行","propertyTips.ap-img-fit-scale":"剪裁放大:等比铺满之后把画面再推大这么多,两轴才真的各多出一条边可裁——图与框同比例时不放大就什么都裁不掉。100=不放大(缺省),上限 400;超出框的部分由元素框裁掉。锚点选中的那一点既是取位的钉住点、也是放大的中心,两者共用同一个值。仅「剪裁」档生效,其余缩放模式不出本行","propertyTips.ap-rotate":"元素绕自身中心旋转的角度(度,0~359):出纸时按旋转后外接盒分页与结算,底部放不下自动移页,超出纸面左右缘或顶部会被裁切并给出纸提示。表格、流式列表与表格下方跟随区的元素不支持旋转(这三类不出本行);条码与二维码的任意角度需 385dpi 以上打印头,低分辨率打印机只按 90° 步进出纸","propertyTips.fl-columns":"一行排几个单元,必须由你指定——不随内容自动算列数。填的列数乘单元宽放不下元素框时只给提示、不改你的数,出纸按你填的排","propertyTips.fl-row-height":"每个单元行的最低高度(毫米),与表格行高同一口径:内容比它高时这一行会撑高,不会裁字","propertyTips.fl-gap-x":"相邻单元之间的横向留白(毫米);纵向不留缝,行与行的距离由行高承担","propertyTips.fl-auto-span":"单元内容比一列还宽时,让它占掉两个或更多列位;当前行剩不够放就把整个单元挪到下一行行首(绝不把词切两半)。默认关——开着时出纸栏数由字号与框宽决定","propertyTips.fl-max-span":"跨列的列数上限,最大只能等于「每行列数」:把每行列数改小时,这里会被一并顶回去","propertyTips.fl-layout-mode":"容器高度由谁决定:固定高度=维持设计高度、一框一页,超高裁切(存量模板默认值,输出不变);动态分页=容器高度由内容撑开,内容满页后按行续页,每一页都画完整边框,元素下方的跟随区与表格同一套规则","propertyTips.fl-padding-top":"动态分页模式下容器顶部与第一行内容之间的留白(毫米),仅动态模式生效;每页切片都按它留白并计入分页预算,负值与非法值按 0 处理","propertyTips.fl-padding-right":"动态分页模式下容器右侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.fl-padding-bottom":"动态分页模式下容器底部与最后一行内容之间的留白(毫米),每页切片都按它留白并计入分页预算,仅动态模式生效","propertyTips.fl-padding-left":"动态分页模式下容器左侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.cd-bar-quiet-zone":"条形码左右两端的空白格数(1 格 = 1 条宽):缺省 10,正是一维码码制要求的下限;数值越小白边越窄、同样的框内条越粗(可放大)。填 0 即不留白边,但静区参与「条→空→条」跳变,紧邻文字或表格线时可能扫不出,需实打验证","propertyTips.cd-bar-height":"黑白条本体的目标高度(mm,不含下方文字):折算粒度就是每模块物理宽,所以只能精确到它的整数倍。条宽优先——可用框高装不下时期望条高让位,绝不把条宽挤窄(热敏出纸清晰度靠条宽)。与「最大高度」分工不同:那条限的是整图(含文字)的上限","propertyTips.cd-quiet-zone":"二维码四周留出的空白格数:0 即不留白边、码面等比铺满元素框(此时靠框外的白纸充当静区);数值越大白边越宽、码面在框内越小(缺省 0,需 ISO/IEC 18004 推荐静区时填 4)"}},x2={propertyTips:{"propertyTips.ap-long-text-indent":'First-line indent for each paragraph of a long-text element, in characters: 2 means two Chinese characters wide (a common CJK convention), laid out in em units — it scales down when "Auto shrink" reduces the font size. Applies to long-text elements only; setting it on plain text has no effect.',"propertyTips.ap-img-fit":"How the image is scaled inside the element box. Contain: show the whole image, possibly with blank space. Crop: fill the box and take a region based on the crop anchor. Stretch: fill the box and distort. Original size / Shrink: never enlarge. The canvas and all three print pipelines use the same rule (Contain by default).","propertyTips.ap-img-object-position":"Crop anchor (only shown for Crop mode): cropping scales the image to fill the box, and this picks which extra edge to keep. Choose a position preset (edge / center / opposite edge), then fine-tune with the percentage: 0 aligns left/top, 100 aligns to the other end; horizontal and vertical are independent. The default is centered (choose Top to keep the head in ID photos). Other fit modes have no crop edge, so this row is hidden.","propertyTips.ap-img-fit-scale":"Crop zoom: after filling the box, enlarge the image by this much so both axes gain a crop margin — when image and box have the same aspect ratio, no zoom means nothing can be cropped. 100 = no zoom (default), maximum 400; anything outside the box is clipped by the element frame. The chosen anchor is both the pinning point and the zoom center. Shown for Crop mode only.","propertyTips.ap-rotate":"Rotation of the element about its own center, in degrees (0–359). During printing, pagination and layout use the rotated bounding box: content that does not fit at the bottom moves to the next page, and content beyond the left/right/top paper edges is clipped with a print warning. Tables, flow lists and elements in the follow-up zone below a table do not support rotation (this row is hidden for them); arbitrary angles for barcodes and QR codes require a 385dpi+ print head — lower-resolution printers only output in 90° steps.","propertyTips.fl-columns":"The number of cells per row must be specified by you — it is never inferred from content. If the column count times the cell width does not fit the element box, you get a hint but your value is not changed, and print output follows what you entered.","propertyTips.fl-row-height":"Minimum height of each cell row, in millimetres, using the same rule as table row height: a row grows when its content is taller, and text is never clipped.","propertyTips.fl-gap-x":"Horizontal whitespace between adjacent cells, in millimetres. No vertical gap is inserted; the distance between rows comes from the row height.","propertyTips.fl-auto-span":"When a cell is wider than one column, let it span two or more columns; if the current row has too few columns left, move the whole cell to the start of the next row (never split a word). Off by default — when on, the printed column count depends on font size and box width.","propertyTips.fl-max-span":'Upper limit for column spanning; it can never exceed "Columns per row". Lowering the column count also pushes this value down.',"propertyTips.fl-layout-mode":"What decides the container height. Fixed height: keep the designed height, one box per page, clip overflow (the default for existing templates, output unchanged). Dynamic pagination: the container grows with its content, continues row by row after a page fills, draws a complete border on every page, and follows the same rules as tables for the follow-up zone below the element.","propertyTips.fl-padding-top":"Whitespace between the top of the container and the first content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget. Negative or invalid values are treated as 0.","propertyTips.fl-padding-right":"Whitespace between the right side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.fl-padding-bottom":"Whitespace between the bottom of the container and the last content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget.","propertyTips.fl-padding-left":"Whitespace between the left side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.cd-bar-quiet-zone":"Number of blank modules on each side of a barcode (1 module = 1 bar width): the default of 10 is the minimum required by 1D symbologies. Smaller values narrow the quiet zone and make bars thicker in the same box (they can be enlarged). Setting 0 removes the white margin, but the quiet zone participates in bar-space-bar transitions, so codes next to text or table lines may fail to scan — verify with a real print.","propertyTips.cd-bar-height":'Target height of the black bars themselves, in millimetres (excluding the text below). The granularity is the physical width of one module, so only integer multiples are exact. Bar width takes priority: if the available height cannot fit the desired bar height, the height gives way — bars are never narrowed (thermal print clarity depends on bar width). This differs from "Maximum height", which limits the whole image including text.',"propertyTips.cd-quiet-zone":"Number of blank modules around a QR code: 0 means no white margin and the code scales to fill the element box (the surrounding white paper acts as the quiet zone). Larger values widen the margin and make the code smaller in the box. The default is 0; use 4 for the quiet zone recommended by ISO/IEC 18004."}},P2={propertyTips:{"propertyTips.ap-long-text-indent":'ระยะเว้นบรรทัดแรกของแต่ละย่อหน้าในข้อความยาว หน่วยเป็นอักขระ: ใส่ 2 หมายถึงเว้นสองตัวอักษรจีน (ตามธรรมเนียม CJK) คำนวณเป็นหน่วย em — จะย่อตามเมื่อ "ย่ออัตโนมัติ" ลดขนาดฟอนต์ ใช้เฉพาะองค์ประกอบข้อความยาว การตั้งค่าบนข้อความธรรมดาไม่มีผล',"propertyTips.ap-img-fit":"วิธีปรับขนาดรูปภาพภายในกรอบองค์ประกอบ พอดี: แสดงรูปทั้งหมดอาจมีช่องว่าง ครอบ: เติมกรอบแล้วตัดตามจุดยึดการครอป ดึง: เติมกรอบและบิดเบือน ขนาดต้นฉบับ/ย่อ: ไม่ขยาย พื้นที่ทำงานและทั้งสามไปป์ไลน์การพิมพ์ใช้กฎเดียวกัน (ค่าเริ่มต้นพอดี)","propertyTips.ap-img-object-position":"จุดยึดการครอป (แสดงเฉพาะโหมดครอบ): การครอปปรับรูปให้เติมกรอบ ตัวเลือกนี้เลือกขอบส่วนเกินที่ต้องการคงไว้ เลือกระดับตำแหน่ง (ชิดขอบ/กลาง/ชิดอีกด้าน) แล้วปรับด้วยเปอร์เซ็นต์: 0 ชิดซ้าย/บน 100 ชิดขวา/ล่าง แนวนอนและแนวตั้งอิสระต่อกัน ค่าเริ่มต้นอยู่กึ่งกลาง (เลือก บน เพื่อคงศีรษะในรูปบัตรประจำตัว) โหมดอื่นไม่มีขอบให้ครอปจึงซ่อนบรรทัดนี้","propertyTips.ap-img-fit-scale":"ขยายการครอป: หลังเติมกรอบแล้วขยายภาพอีกมากน้อยเพียงนี้ เพื่อให้ทั้งสองแกนมีขอบให้ครอป — เมื่อรูปและกรอบมีอัตราส่วนเท่ากัน การไม่ขยายจะครอปไม่ได้เลย 100 = ไม่ขยาย (ค่าเริ่มต้น) สูงสุด 400 ส่วนที่เกินกรอบถูกตัดโดยกรอบองค์ประกอบ จุดยึดที่เลือกเป็นทั้งจุดตรึงและศูนย์กลางการขยาย แสดงเฉพาะโหมดครอบ","propertyTips.ap-rotate":"มุมหมุนขององค์ประกอบรอบจุดศูนย์กลางตัวเอง เป็นองศา (0–359) ขณะพิมพ์ การแบ่งหน้าและการจัดวางใช้กล่องล้อมรอบที่หมุนแล้ว: เนื้อหาที่ไม่พอด้านล่างย้ายไปหน้าถัดไป และเนื้อหาที่เกินขอบกระดาษซ้าย/ขวา/บนถูกตัดพร้อมคำเตือน ตาราง รายการแบบไหล และองค์ประกอบในโซนตามหลังตารางไม่รองรับการหมุน (ซ่อนบรรทัดนี้); มุมใดๆ ของบาร์โค้ดและคิวอาร์โค้ดต้องการหัวพิมพ์ 385dpi ขึ้นไป — เครื่องพิมพ์ความละเอียดต่ำกว่าส่งออกได้เฉพาะขั้น 90°","propertyTips.fl-columns":"จำนวนเซลล์ต่อแถวต้องระบุเองเสมอ — ไม่คำนวณจากเนื้อหา หากจำนวนคอลัมน์คูณความกว้างเซลล์ไม่พอดีกับกรอบองค์ประกอบจะมีคำแนะนำแต่ค่าไม่เปลี่ยน และผลการพิมพ์เป็นไปตามที่ป้อน","propertyTips.fl-row-height":"ความสูงขั้นต่ำของแถวเซลล์แต่ละแถว เป็นมิลลิเมตร ใช้กฎเดียวกับความสูงแถวตาราง: แถวจะสูงขึ้นเมื่อเนื้อหาสูงกว่า และข้อความไม่ถูกตัด","propertyTips.fl-gap-x":"ช่องว่างแนวนอนระหว่างเซลล์ที่อยู่ติดกัน เป็นมิลลิเมตร ไม่มีการเว้นช่องแนวตั้ง ระยะระหว่างแถวมาจากความสูงแถว","propertyTips.fl-auto-span":"เมื่อเซลล์กว้างกว่าหนึ่งคอลัมน์ ให้ขยายครอบสองคอลัมน์ขึ้นไป; หากแถวปัจจุบันเหลือคอลัมน์ไม่พอ ย้ายเซลล์ทั้งหมดไปขึ้นต้นแถวถัดไป (ไม่ตัดคำ) ปิดอยู่โดยค่าเริ่มต้น — เมื่อเปิด จำนวนคอลัมน์ที่พิมพ์ขึ้นกับขนาดฟอนต์และความกว้างกรอบ","propertyTips.fl-max-span":'ขีดจำกัดบนของการขยายคอลัมน์ ห้ามเกิน "จำนวนคอลัมน์ต่อแถว" การลดจำนวนคอลัมน์จะดันค่านี้ลงด้วย',"propertyTips.fl-layout-mode":"อะไรเป็นตัวกำหนดความสูงของคอนเทนเนอร์ ความสูงคงที่: คงความสูงที่ออกแบบ หนึ่งกรอบต่อหน้า ตัดส่วนเกิน (ค่าเริ่มต้นของเทมเพลตเดิม ผลไม่เปลี่ยน) การแบ่งหน้าแบบไดนามิก: คอนเทนเนอร์ ขยายตามเนื้อหา ดำเนินต่อเป็นแถวหลังหน้าเต็ม วาดเส้นขอบครบทุกหน้า และปฏิบัติตามกฎเดียวกับตารางสำหรับโซนตามหลังองค์ประกอบ","propertyTips.fl-padding-top":"ช่องว่างระหว่างด้านบนของคอนเทนเนอร์กับแถวเนื้อหาแรกในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า ค่าติดลบหรือไม่ถูกต้องถือเป็น 0","propertyTips.fl-padding-right":"ช่องว่างระหว่างด้านขวาของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.fl-padding-bottom":"ช่องว่างระหว่างด้านล่างของคอนเทนเนอร์กับแถวเนื้อหาสุดท้ายในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า","propertyTips.fl-padding-left":"ช่องว่างระหว่างด้านซ้ายของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.cd-bar-quiet-zone":"จำนวนโมดูลว่างสองข้างของบาร์โค้ด (1 โมดูล = 1 ความกว้างแท่น): ค่าเริ่มต้น 10 คือค่าต่ำสุดที่รหัสแบบหนึ่งมิติต้องการ ค่าที่เล็กลงทำให้โซนเงียบแคบและแท่นหนาขึ้นในกรอบเดียวกัน (สามารถขยายได้) การตั้ง 0 ลบขอบขาว แต่โซนเงียบมีส่วนในการเปลี่ยนแท่น-ช่อง-แท่น รหัสที่อยู่ติดข้อความหรือเส้นตารางอาจสแกนไม่ได้ — ตรวจด้วยการพิมพ์จริง","propertyTips.cd-bar-height":'ความสูงเป้าหมายของแท่นดำเอง เป็นมิลลิเมตร (ไม่รวมข้อความด้านล่าง) ความละเอียดคือความกว้างทางกายภาพของหนึ่งโมดูล จึงแม่นยำเฉพาะจำนวนเต็มเท่านั้น ความกว้างแท่นมีสิทธิ์ก่อน: หากความสูงที่มีไม่พอตามที่ต้องการ ความสูงจะยอมตาม — ไม่เคยทำให้แท่นแคบลง (ความชัดของการพิมพ์ความร้อนขึ้นกับความกว้างแท่น) ต่างจาก "ความสูงสูงสุด" ที่จำกัดทั้งภาพรวมข้อความ',"propertyTips.cd-quiet-zone":"จำนวนโมดูลว่างรอบคิวอาร์โค้ด: 0 หมายถึงไม่มีขอบขาวและรหัสขยายเติมกรอบ (กระดาษขาวรอบนอกทำหน้าที่โซนเงียบ) ค่าที่ใหญ่ขึ้นทำให้ขอบกว้างและรหัสเล็กลงในกรอบ ค่าเริ่มต้น 0 ใช้ 4 สำหรับโซนเงียบตามที่ ISO/IEC 18004 แนะนำ"}};function sn(e){if(typeof e!="string")return"zh-CN";const t=e.trim();return t?/^en([-_]|$)/i.test(t)?"en-US":/^th([-_]|$)/i.test(t)?"th-TH":t:"zh-CN"}function Eh(){try{if(typeof navigator<"u"&&typeof navigator.language=="string")return sn(navigator.language)}catch{}return"zh-CN"}function E2(){const e=Da();return e.init({resources:{"zh-CN":{core:c2,constants:k2.constants,propertyTips:w2.propertyTips},"en-US":{core:h2,constants:y2.constants,propertyTips:x2.propertyTips},"th-TH":{core:b2,constants:v2.constants,propertyTips:P2.propertyTips}},lng:Eh(),fallbackLng:"zh-CN",ns:["core"],defaultNS:"core",keySeparator:!1,nsSeparator:!1,interpolation:{prefix:"{",suffix:"}",escapeValue:!1},returnNull:!1,returnEmptyString:!1,saveMissing:!0,missingKeyHandler:()=>{}}),e}var Qi=E2(),S2=new Set,Sh=new Set,T2=new Set;Qi.on("missingKey",(e,t,r)=>{Qi.exists(r,{lng:"zh-CN"})||S2.add(r)});function Th(){return Eh()}function M2(){return Th()}function ea(e,t){return typeof e=="string"?e:e==null?t:String(e)}function C2(e,t,r){const o=Qi.getFixedT(sn(e),Ch()),n=r?o(t,r):o(t);return ea(n,t)}function lr(e,t){return C2(Th(),e,t)}var Mh=new WeakMap;function _2(e){let t=Mh.get(e);return t||(t=Da(),t.init({resources:{},lng:"zh-CN",fallbackLng:!1,ns:["user"],defaultNS:"user",keySeparator:!1,nsSeparator:!1,interpolation:{prefix:"{",suffix:"}",escapeValue:!1},returnNull:!1,returnEmptyString:!1}),Mh.set(e,t)),t}function ta(e,t){const r=sn(e),o=Qi.getFixedT(r,Ch());if(!t)return(a,s)=>ea(s?o(a,s):o(a),a);const n=_2(t);n.addResourceBundle(r,"user",t,!0,!0);const i=n.getFixedT(r,"user");return(a,s)=>{const p=ea(s?i(a,s):i(a),"");return p!==""&&p!==a?p:ea(s?o(a,s):o(a),a)}}function Ch(){return["user",...T2,"constants","propertyTips","core"]}function _h(e){return Sh.add(e),()=>{Sh.delete(e)}}var Dh=Symbol.for("worm-print-platform.element-ui-registry.v1"),Ah=globalThis;function kl(){const e=Ah[Dh];if(e)return e;const t={entries:new Map,listeners:new Set,nextSeq:0};return Ah[Dh]=t,t}function D2(e){if(e)return kl().entries.get(e)?.ui}function A2(){const e=[...kl().entries.entries()];return e.sort((t,r)=>t[1].seq-r[1].seq),e.map(([t,r])=>({type:t,ui:r.ui}))}function O2(e){const t=kl();return t.listeners.add(e),()=>{t.listeners.delete(e)}}function g(e,t={},r=[]){return{tag:e,props:t,children:r}}var yl="http://www.w3.org/2000/svg",R2=new Set(["draggable","contenteditable","spellcheck"]),I2=new Set(["indeterminate"]);function L2(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="g"}function B2(e){return e instanceof Element&&e.namespaceURI===yl}function rt(e,t){if(typeof e=="string"){const a=document.createTextNode(e);return t.appendChild(a),a}if(e instanceof Node)return t.appendChild(e),e;const{tag:r,props:o,children:n}=e,i=L2(r)||B2(t)?document.createElementNS(yl,r):document.createElement(r);for(const[a,s]of Object.entries(o))if(!(s==null||s===!1))if(a==="class")i.setAttribute("class",String(s));else if(a==="style")typeof s=="string"?i.style.cssText=s:Object.assign(i.style,s);else if(a==="html")i.innerHTML=String(s);else if(a==="text")i.textContent=String(s);else if(a.startsWith("on")&&typeof s=="function")i.addEventListener(a.slice(2).toLowerCase(),s);else if(a==="dataset")for(const[p,l]of Object.entries(s))i.dataset[p]=l;else I2.has(a)?i[a]=!0:typeof s=="boolean"?s&&i.setAttribute(a,R2.has(a)?"true":""):i.setAttribute(a,String(s));for(const a of n)rt(a,i);return t.appendChild(i),i}function Oh(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var N2=yl;function ln(){return{paperSize:"A4",orientation:"portrait",unit:"mm",margins:{top:10,right:10,bottom:10,left:10},header:{height:10,elements:[]},footer:{height:10,elements:[]},elements:[],watermark:{}}}const F2="开启拼版后只能有一个设计页面",Rh=()=>lr("store.tilingSinglePage");function vl(e){const t=(r,o)=>(r??[]).map(n=>{const i={...n.options};return(n.printElementType?.type??n.type)==="table"&&Eo(i),{id:n.id||Xr(),zone:o,options:i,printElementType:{...n.printElementType}}});return{...e,margins:{...e.margins},header:{height:e.header?.height??10,elements:[]},footer:{height:e.footer?.height??10,elements:[]},guides:[...e.guides??[]],elements:[...t(e.elements??[],"content"),...t(e.header?.elements??[],"header"),...t(e.footer?.elements??[],"footer")]}}function Ih(e){const t=e.elements,r=o=>t.filter(n=>(n.zone||"content")===o).map(n=>({id:n.id,type:n.printElementType.type,options:{...n.options},printElementType:{...n.printElementType}}));return{unit:"mm",...e,header:{...e.header,elements:r("header")},footer:{...e.footer,elements:r("footer")},elements:r("content"),guides:[...e.guides??[]]}}function Lh(e){const t=(o,n)=>{const i=vl(B0(o));return i.name||(i.name=`页面 ${n+1}`),i};if(!e)return[t(ln(),0)];const r=Array.isArray(e.pages)?e.pages:[e];return r.length?r.map(t):[t(ln(),0)]}const so=e=>JSON.parse(JSON.stringify(e));class Bh{scale=100;showRuler=!0;showGrid=!0;snapToGrid=!1;showTableGhostBorder=!0;dirty=!1;pages;activePageIndex=0;fields;selectedIds=new Set;previewIds=new Set;tableSelection=null;draggingIds=new Set;adsorbGuides=[];live=new Map;clipboard=[];moveSessionActive=!1;moveTimer=null;dragBefore=null;undoStack=[];redoStack=[];listeners=new Set;align=Oy();group=Ry();constructor(t={}){if(this.pages=Lh(t.initialTemplate),this.fields=t.initialFields??[],t.initialElements?.length){const r=this.pages[0];r.elements=[...r.elements,...t.initialElements]}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(t=!0){t&&(this.dirty=!0);for(const r of[...this.listeners])r()}get templateData(){return this.pages[this.activePageIndex]}set templateData(t){this.pages[this.activePageIndex]=t}get elements(){return this.templateData.elements.map(t=>this.live.get(t.id)??t)}get tilingEnabled(){return this.pages.some(t=>t.tiling?.enabled===!0)}switchPage(t){t<0||t>=this.pages.length||(this.activePageIndex=t,this.resetSelection(),this.emit(!1))}addPage(){if(this.tilingEnabled){window.alert(Rh());return}this.recordHistory();const t=this.pages[this.activePageIndex]??ln();this.pages.push(vl({...ln(),paperSize:t.paperSize,orientation:t.orientation,outputRotation:t.outputRotation,customWidth:t.customWidth,customHeight:t.customHeight,name:this.nextDefaultPageName()})),this.switchPage(this.pages.length-1),this.emit()}nextDefaultPageName(){const t=new Set(this.pages.map(o=>o.name));let r=this.pages.length+1;for(;t.has(`页面 ${r}`);)r++;return`页面 ${r}`}duplicatePage(t){if(this.tilingEnabled){window.alert(Rh());return}this.recordHistory();const r=so(this.pages[t]);r.name=`${r.name??`页面 ${t+1}`} 副本`,r.elements=r.elements.map(o=>({...o,id:Xr()})),this.pages.splice(t+1,0,r),this.switchPage(t+1),this.emit()}deletePage(t){this.pages.length<=1||(this.recordHistory(),this.pages.splice(t,1),this.activePageIndex=Math.max(0,Math.min(this.activePageIndex,this.pages.length-1)),this.resetSelection(),this.emit())}renamePage(t,r){this.recordHistory(),this.pages[t].name=r,this.emit()}movePage(t,r){if(r<0||r>=this.pages.length||t===r)return;this.recordHistory();const[o]=this.pages.splice(t,1);this.pages.splice(r,0,o),this.activePageIndex=r,this.emit()}onSelectionChanged;setSelection(t){this.selectedIds=t,this.onSelectionChanged?.(),this.emit(!1)}select(t){this.setSelection(new Set(t))}selectOne(t,r=!1){if(r){const o=new Set(this.selectedIds);o.has(t)?o.delete(t):o.add(t),this.setSelection(o)}else this.setSelection(new Set([t]))}clearSelection(){this.setSelection(new Set)}selectElement(t,r=!1){if(r){this.selectOne(t,!0);return}this.setSelection(new Set(this.group.getGroupedIds(this.elements,t)))}selectAll(){this.setSelection(new Set(this.elements.map(t=>t.id)))}get selectedElements(){return this.elements.filter(t=>this.selectedIds.has(t.id))}get selectedElement(){const t=this.selectedIds.values().next().value;return t?this.elements.find(r=>r.id===t)??null:null}resetSelection(){this.selectedIds=new Set,this.tableSelection=null,this.onSelectionChanged?.()}setTableSelection(t){this.tableSelection=t,this.emit(!1)}setPreview(t){this.previewIds=t,this.emit(!1)}commitPreview(){this.previewIds=new Set,this.emit(!1)}addGuide(t,r){const o=this.templateData.guides??[];this.templateData.guides=[...o,{id:Xr(),type:t,position:Math.round(r*10)/10}],this.emit()}moveGuide(t,r){const o=this.templateData.guides??[];this.templateData.guides=o.map(n=>n.id===t?{...n,position:Math.round(r*10)/10}:n),this.emit(!1)}removeGuide(t){this.templateData.guides=(this.templateData.guides??[]).filter(r=>r.id!==t),this.emit()}addElement(t,r={},o){const n=ts(t,r);return o&&!this.placeAtDropPoint(n,o)||(this.recordHistory(),this.templateData.elements.push(n),this.select(new Set([n.id])),this.emit()),n}addFieldElement(t,r={},o,n=!1){const i=n?Dy(t):_y(t);return Object.assign(i.options,r),o&&!this.placeAtDropPoint(i,o)||(this.recordHistory(),this.templateData.elements.push(i),this.select(new Set([i.id])),this.emit()),i}placeAtDropPoint(t,r){const o=this.templateData,n=ac(o,r.x,r.y);if(n!=="content"&&!ic(t.printElementType.type))return alert("该元素类型不能放入页眉/页脚"),!1;const i=ss(o)[n];return t.zone=n,t.options.left=r.x-i.left,t.options.top=r.y-i.top,n!=="content"&&ls(t,i),!0}deleteSelected(){this.selectedIds.size&&(this.recordHistory(),this.templateData.elements=this.templateData.elements.filter(t=>!this.selectedIds.has(t.id)),this.selectedIds=new Set,this.emit())}livePatch(t,r){const o=this.templateData.elements.find(i=>i.id===t);if(!o)return;const n=this.live.get(t)??o;this.live.set(t,{...n,options:{...n.options,...r}})}commitLive(){if(!this.live.size)return;this.recordHistory();const t=this.templateData.elements;for(const[r,o]of this.live){const n=t.find(i=>i.id===r);n&&Object.assign(n.options,o.options)}this.live.clear(),this.emit()}dragIds(t){const r=this.templateData.elements.find(o=>o.id===t);return!r||r.options.locked?[]:Array.from(this.group.getGroupedIds(this.elements,t))}discardLive(){this.live.clear()}dragStart(){this.dragBefore=new Map(this.elements.map(t=>[t.id,this.geoSig(t)]))}dragStop(){const t=this.dragBefore;if(!t)return;this.dragBefore=null;let r=!1;for(const o of this.elements){const n=t.get(o.id);!n||n===this.geoSig(o)||o1(o,this.templateData).rejected&&(r=!0)}r&&alert("该元素类型不能放入页眉/页脚"),this.emit()}geoSig(t){return`${t.zone||"content"}:${t.options.left},${t.options.top},${t.options.width},${t.options.height}`}updateElement(t,r,o=!0){o&&this.recordHistory();const n=this.templateData.elements.find(i=>i.id===t);n&&(Object.assign(n.options,r),n.printElementType.type==="table"&&Eo(n.options),this.emit())}updateTemplateData(t){this.recordHistory(),Object.assign(this.templateData,t);for(const r of["paperSize","customWidth","customHeight"])if(r in t)for(const o of this.pages)Object.assign(o,{[r]:t[r]});this.emit()}moveLayer(t){if(!this.selectedIds.size)return;this.recordHistory();const r=this.templateData.elements,o=r.filter(i=>this.selectedIds.has(i.id)),n=r.filter(i=>!this.selectedIds.has(i.id));if(t==="top")this.templateData.elements=[...n,...o];else if(t==="bottom")this.templateData.elements=[...o,...n];else{const i=r.findIndex(p=>this.selectedIds.has(p.id)),a=t==="up"?i+1:i-1;if(a<0||a>=r.length)return;const s=[...r];[s[i],s[a]]=[s[a],s[i]],this.templateData.elements=s}this.emit()}alignSelected(t){this.selectedIds.size<2||(this.recordHistory(),this.align.align(this.elements.filter(r=>this.selectedIds.has(r.id)),t),this.emit())}groupSelected(){this.selectedIds.size<2||(this.recordHistory(),this.templateData.elements=this.group.group(this.elements,this.selectedIds),this.emit())}ungroupSelected(){this.selectedIds.size&&(this.recordHistory(),this.templateData.elements=this.group.ungroup(this.elements,this.selectedIds),this.emit())}copy(){this.clipboard=so(this.selectedElements),this.emit(!1)}cutSelected(){this.copy(),this.deleteSelected()}paste(t=10){if(!this.clipboard.length)return;this.recordHistory();const r=new Map;for(const i of this.clipboard){const a=i.options.groupId;a&&r.set(a,(r.get(a)??0)+1)}const o=new Map;for(const[i,a]of r)o.set(i,a>=2?Au():void 0);const n=this.templateData.elements;for(const i of this.clipboard){const a=so(i);a.id=Xr(),a.options.left+=t,a.options.top+=t,a.options.groupId=a.options.groupId?o.get(a.options.groupId):void 0,n.push(a)}this.emit()}duplicateSelected(){if(this.copy(),!this.clipboard.length)return;this.paste(15);const t=this.templateData.elements;this.selectOne(t[t.length-this.clipboard.length].id)}get hasClipboard(){return this.clipboard.length>0}moveSelected(t,r){const o=this.selectedElements.filter(n=>!n.options.locked);if(o.length){this.moveSessionActive||(this.moveSessionActive=!0,this.recordHistory());for(const n of o)n.options.left+=t,n.options.top+=r;this.moveTimer&&clearTimeout(this.moveTimer),this.moveTimer=setTimeout(()=>{this.moveSessionActive=!1,this.moveTimer=null},300),this.emit()}}cloneElement(t){this.recordHistory(),this.templateData.elements.push(t),this.selectedIds=new Set([t.id]),this.emit()}recordHistory(){this.undoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.undoStack.length>100&&this.undoStack.shift(),this.redoStack=[]}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}undo(){const t=this.undoStack.pop();t&&(this.redoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.pages=t.pages,this.activePageIndex=Math.min(t.activePageIndex,t.pages.length-1),this.resetSelection(),this.emit())}redo(){const t=this.redoStack.pop();t&&(this.undoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.pages=t.pages,this.activePageIndex=Math.min(t.activePageIndex,t.pages.length-1),this.resetSelection(),this.emit())}resetZoom(){this.setScale(100)}setScale(t,r=Vn){this.scale=Math.max(r,Math.round(t)),this.emit(!1)}getTemplateJson(){const t=this.pages.map(Ih),r=t.length===1?t[0]:{version:1,pages:t};return JSON.stringify(r)}loadTemplate(t){this.pages=Lh(t),this.activePageIndex=0,this.resetSelection(),this.recordHistory(),this.emit()}get paperSize(){return ir(this.templateData)}}const Rr=Symbol("mixed"),wl=new Set(["text","longText"]),$2=["top","right","bottom","left"],z2={on:!0,off:!1,mixed:Rr};function Nh(e){const t=Kd(e),r={};for(const o of $2)r[o]=z2[t[o]];return r}const H2=["fontFamily","fontSize","fontWeight","color","textAlign","verticalAlign","textDecoration"];class U2{constructor(t){this.store=t}store;borderStyle="solid";borderWidth=.75;borderColor="#333333";borderMixed={style:!1,width:!1,color:!1};borderDraftKey="";get borderMixedAny(){return this.borderMixed.style||this.borderMixed.width||this.borderMixed.color}painterActive=!1;painterLocked=!1;painterSource=null;painterSnapshot=null;get selectedElements(){return this.store.elements.filter(t=>this.store.selectedIds.has(t.id)&&!t.options.locked)}get tableElement(){const t=this.store.tableSelection;return t?this.store.elements.find(r=>r.id===t.elementId)??null:null}get context(){return this.store.tableSelection&&this.tableElement?"cells":this.selectedElements.length>0||this.store.selectedIds.size>0?"elements":"none"}get targetCells(){const t=this.store.tableSelection,r=this.tableElement?.options.tableRows;if(!t||!r)return[];const o=[];for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=r[n]?.cells[i];a&&!a.merged&&o.push(a)}return o}get textTargets(){return this.selectedElements.filter(t=>wl.has(t.printElementType.type))}get fontEditable(){return this.context==="cells"?this.targetCells.length>0:this.context!=="elements"?!1:this.selectedElements.length>0&&this.textTargets.length===this.selectedElements.length}get styleTargets(){return this.context==="cells"?this.targetCells:this.textTargets.map(t=>t.options)}pick(t){if(!t.length)return;const r=t[0];return t.every(o=>o===r)?r:Rr}hasToken(t,r){return(t??"").split(/\s+/).includes(r)}get values(){const t=this.styleTargets;if(!t.length)return{fontFamily:void 0,fontSize:void 0,color:void 0,backgroundColor:void 0,textAlign:void 0,verticalAlign:void 0,bold:!1,underline:!1,strike:!1};const r=t.map(n=>n.fontWeight==="bold"||n.fontWeight==="bolder"),o=t.map(n=>n.textDecoration);return{fontFamily:this.pick(t.map(n=>n.fontFamily)),fontSize:this.pick(t.map(n=>n.fontSize)),color:this.pick(t.map(n=>n.color)),backgroundColor:this.pick(t.map(n=>n.backgroundColor)),textAlign:this.pick(t.map(n=>this.context==="cells"?n.align:n.textAlign)),verticalAlign:this.pick(t.map(n=>this.context==="cells"?n.valign:n.verticalAlign)),bold:r.every(Boolean)?!0:r.some(Boolean)?Rr:!1,underline:o.map(n=>this.hasToken(n,"underline")).every(Boolean)?!0:o.some(n=>this.hasToken(n,"underline"))?Rr:!1,strike:o.map(n=>this.hasToken(n,"line-through")).every(Boolean)?!0:o.some(n=>this.hasToken(n,"line-through"))?Rr:!1}}commit(){this.store.recordHistory(),this.store.emit()}writeCells(t){const r=this.targetCells;r.length&&(r.forEach(t),this.commit())}applyStyle(t){if(this.context==="cells"){this.writeCells(s=>{"fontFamily"in t&&(s.fontFamily=t.fontFamily),"fontSize"in t&&(s.fontSize=t.fontSize),"color"in t&&(s.color=t.color),"backgroundColor"in t&&(s.backgroundColor=t.backgroundColor),"textAlign"in t&&(s.align=t.textAlign),"verticalAlign"in t&&(s.valign=t.verticalAlign)});return}const r=this.textTargets,o=this.selectedElements,i=["fontFamily","fontSize","color","textAlign","verticalAlign"].some(s=>s in t),a="backgroundColor"in t;!(r.length&&i)&&!(o.length&&a)||(r.forEach(s=>{const p=s.options;"fontFamily"in t&&(p.fontFamily=t.fontFamily),"fontSize"in t&&(p.fontSize=t.fontSize),"color"in t&&(p.color=t.color),"textAlign"in t&&(p.textAlign=t.textAlign),"verticalAlign"in t&&(p.verticalAlign=t.verticalAlign)}),a&&o.forEach(s=>{s.options.backgroundColor=t.backgroundColor}),this.commit())}toggleBold(){if(this.context==="cells"){const o=this.values.bold!==!0;this.writeCells(n=>{n.fontWeight=o?"bold":void 0});return}const t=this.values.bold!==!0,r=this.textTargets;r.length&&(r.forEach(o=>{o.options.fontWeight=t?"bold":"normal"}),this.commit())}toggleDecoration(t){if(this.context==="cells")return;const r=this.textTargets;if(!r.length)return;const o=this.values[t==="underline"?"underline":"strike"]!==!0;r.forEach(n=>{const i=(n.options.textDecoration??"").split(/\s+/).filter(Boolean),a=i.indexOf(t);o&&a<0&&i.push(t),!o&&a>=0&&i.splice(a,1),n.options.textDecoration=i.length?i.join(" "):void 0}),this.commit()}toggleUnderline(){this.toggleDecoration("underline")}toggleStrike(){this.toggleDecoration("line-through")}syncBorderDraft(){if(this.context!=="cells"){this.borderDraftKey&&(this.borderDraftKey="",this.borderStyle="solid",this.borderWidth=.75,this.borderColor="#333333",this.borderMixed={style:!1,width:!1,color:!1});return}const t=this.store.tableSelection,r=this.tableElement?.options.tableRows;if(!t||!r)return;const o=`cells:${t.elementId}:${t.r1}:${t.c1}:${t.r2}:${t.c2}`;if(o===this.borderDraftKey)return;if(this.borderDraftKey=o,La(r,t).mode==="multi"){this.borderStyle="solid",this.borderWidth=.75,this.borderColor="#333333",this.borderMixed={style:!1,width:!1,color:!1};return}const n=ad(r,t);if(n.style===void 0&&n.width===void 0&&n.color===void 0){this.borderMixed={style:!1,width:!1,color:!1},this.borderStyle=null,this.borderWidth=0,this.borderColor="#333333";return}this.borderMixed={style:n.style==="mixed",width:n.width==="mixed",color:n.color==="mixed"},this.borderMixed.style?this.borderStyle=null:n.style===void 0?this.borderStyle="solid":n.style==="none"?this.borderStyle=null:this.borderStyle=n.style,this.borderWidth=this.borderMixed.width?void 0:typeof n.width=="number"?n.width:.75,this.borderColor=this.borderMixed.color?void 0:typeof n.color=="string"?n.color:"#333333"}borderSpec(){const t=this.borderStyle??(this.borderMixed.style?"solid":"none");return{width:this.borderWidth??.75,style:t,color:this.borderColor??"#333333"}}setBorderWidth(t){this.borderWidth=t,this.borderMixed.width=!1}setBorderColor(t){this.borderColor=t,this.borderMixed.color=!1}settleBorderDraft(){this.context==="cells"&&(this.borderMixed.style&&(this.borderStyle="solid",this.borderMixed.style=!1),this.borderMixed.width&&(this.borderWidth=.75,this.borderMixed.width=!1),this.borderMixed.color&&(this.borderColor="#333333",this.borderMixed.color=!1))}toggleBorderStyle(t){const r=this.borderStyle===t?null:t;this.borderMixed.style=!1,this.borderStyle=r,r===null?this.borderWidth=0:this.borderWidth===0&&(this.borderWidth=.75)}applyElementBorder(t,r){const o=this.selectedElements;o.length&&(o.forEach(n=>{Xd(n.options,t,r)}),this.commit())}applyCellBorderPreset(t,r){const o=this.store.tableSelection,n=this.tableElement?.options.tableRows;!o||!n||(nd(n,{r1:o.r1,c1:o.c1,r2:o.r2,c2:o.c2},t,r),this.commit())}applyCellBorderEdges(t,r,o){this.writeCells(n=>{for(const i of t)id(n,i,o?r:null)})}get cellEdges(){if(this.context!=="cells")return null;const t=this.targetCells;return t.length?Nh(t.map(r=>r.borders)):null}toggleCellEdge(t,r){const o=this.cellEdges?.[t]!==!0;this.applyCellBorderEdges([t],r,o)}get elementEdges(){if(this.context!=="elements")return null;const t=this.selectedElements;return t.length?Nh(t.map(r=>$0(r.options))):null}toggleElementEdge(t,r){const o=this.selectedElements;if(!o.length)return;const n=this.elementEdges?.[t]!==!0;o.forEach(i=>is(i.options,t,n,r)),this.commit()}applyBorderPreset(t){const r=this.borderStyle===null;if(this.context==="cells"){const o=r&&!this.borderMixed.style;this.applyCellBorderPreset(o?"none":t,this.borderSpec()),this.settleBorderDraft()}else this.applyElementBorder(r||t==="none"?"none":"all",this.borderSpec())}applyEdge(t){if(this.borderStyle===null&&!this.borderMixed.style){this.context==="cells"?(this.applyCellBorderEdges([t],this.borderSpec(),!1),this.settleBorderDraft()):this.clearElementEdge(t);return}this.context==="cells"?(this.toggleCellEdge(t,this.borderSpec()),this.settleBorderDraft()):this.toggleElementEdge(t,this.borderSpec())}clearElementEdge(t){const r=this.selectedElements;r.length&&(r.forEach(o=>is(o.options,t,!1)),this.commit())}edgeOn(t){return(this.context==="cells"?this.cellEdges:this.elementEdges)?.[t]===!0}get painterCapturable(){return this.selectedElements.length===1}clonePainterBorders(t){if(!t)return;const r={};for(const o of Ao){const n=t[o];n&&(r[o]={...n})}return r}pickPainterSource(t=!1){const r=this.selectedElements[0];if(!r)return!1;const o=r.options,n=r.printElementType.type;return this.painterSnapshot={text:wl.has(n)?Object.fromEntries(H2.map(i=>[i,o[i]])):null,backgroundColor:o.backgroundColor,border:$n(n)?{borderWidth:o.borderWidth,borderStyle:o.borderStyle,borderColor:o.borderColor,borders:this.clonePainterBorders(o.borders)}:null},this.painterSource=r.id,this.painterActive=!0,this.painterLocked=t,!0}cancelPainter(){this.painterActive=!1,this.painterLocked=!1,this.painterSource=null,this.painterSnapshot=null}applyPainter(t){const r=this.painterSnapshot;if(!r||t.options.locked||t.id===this.painterSource)return!1;const o=t.options,n=t.printElementType.type;return r.text&&wl.has(n)&&Object.assign(o,r.text),o.backgroundColor=r.backgroundColor,r.border&&$n(n)&&(o.borderWidth=r.border.borderWidth,o.borderStyle=r.border.borderStyle,o.borderColor=r.border.borderColor,o.borders=this.clonePainterBorders(r.border.borders)),!0}painterSyncSelection(){if(!this.painterActive||!this.painterSnapshot)return;const t=this.selectedElements;if(!t.length){this.cancelPainter();return}let r=!1;t.forEach(o=>{r=this.applyPainter(o)||r}),r&&(this.commit(),this.painterLocked||this.cancelPainter())}handlePainterKeydown(t){if(t.key!=="Escape"||!this.painterActive)return;const r=t.target?.tagName;r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||this.cancelPainter()}}const q2={AlignCenterHorizontal:'<path d="M2 12h20" /><path d="M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4" /><path d="M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4" /><path d="M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1" /><path d="M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1" />',AlignCenterVertical:'<path d="M12 2v20" /><path d="M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4" /><path d="M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4" /><path d="M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1" /><path d="M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1" />',AlignEndHorizontal:'<rect width="6" height="16" x="4" y="2" rx="2" /><rect width="6" height="9" x="14" y="9" rx="2" /><path d="M22 22H2" />',AlignEndVertical:'<rect width="16" height="6" x="2" y="4" rx="2" /><rect width="9" height="6" x="9" y="14" rx="2" /><path d="M22 22V2" />',AlignHorizontalSpaceBetween:'<rect width="6" height="14" x="3" y="5" rx="2" /><rect width="6" height="10" x="15" y="7" rx="2" /><path d="M3 2v20" /><path d="M21 2v20" />',AlignStartHorizontal:'<rect width="6" height="16" x="4" y="6" rx="2" /><rect width="6" height="9" x="14" y="6" rx="2" /><path d="M22 2H2" />',AlignStartVertical:'<rect width="9" height="6" x="6" y="14" rx="2" /><rect width="16" height="6" x="6" y="4" rx="2" /><path d="M2 2v20" />',AlignVerticalSpaceBetween:'<rect width="14" height="6" x="5" y="15" rx="2" /><rect width="10" height="6" x="7" y="3" rx="2" /><path d="M2 21h20" /><path d="M2 3h20" />',ArrowDown:'<path d="M12 5v14" /><path d="m19 12-7 7-7-7" />',ArrowDownToLine:'<path d="M12 17V3" /><path d="m6 11 6 6 6-6" /><path d="M19 21H5" />',ArrowUp:'<path d="m5 12 7-7 7 7" /><path d="M12 19V5" />',ArrowUpToLine:'<path d="M5 3h14" /><path d="m18 13-6-6-6 6" /><path d="M12 7v14" />',Barcode:'<path d="M3 5v14" /><path d="M8 5v14" /><path d="M12 5v14" /><path d="M17 5v14" /><path d="M21 5v14" />',Bold:'<path d="M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" />',ChartArea:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z" />',ChartBar:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M7 16h8" /><path d="M7 11h12" /><path d="M7 6h3" />',ChartColumn:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M18 17V9" /><path d="M13 17V5" /><path d="M8 17v-3" />',ChartLine:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="m19 9-5 5-4-4-3 3" />',ChartPie:'<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /><path d="M21.21 15.89A10 10 0 1 1 8 2.83" />',ChartScatter:'<circle cx="7.5" cy="7.5" r=".5" fill="currentColor" /><circle cx="18.5" cy="5.5" r=".5" fill="currentColor" /><circle cx="11.5" cy="11.5" r=".5" fill="currentColor" /><circle cx="7.5" cy="16.5" r=".5" fill="currentColor" /><circle cx="17.5" cy="14.5" r=".5" fill="currentColor" /><path d="M3 3v16a2 2 0 0 0 2 2h16" />',Check:'<path d="M20 6 9 17l-5-5" />',ChevronDown:'<path d="m6 9 6 6 6-6" />',ChevronsLeft:'<path d="m11 17-5-5 5-5" /><path d="m18 17-5-5 5-5" />',ChevronsRight:'<path d="m6 17 5-5-5-5" /><path d="m13 17 5-5-5-5" />',ChevronsUpDown:'<path d="m7 15 5 5 5-5" /><path d="m7 9 5-5 5 5" />',Circle:'<circle cx="12" cy="12" r="10" />',ClipboardPaste:'<path d="M11 14h10" /><path d="M16 4h2a2 2 0 0 1 2 2v1.344" /><path d="m17 18 4-4-4-4" /><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113" /><rect x="8" y="2" width="8" height="4" rx="1" />',Code:'<path d="m16 18 6-6-6-6" /><path d="m8 6-6 6 6 6" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />',Donut:'<path d="M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3" /><circle cx="12" cy="12" r="3" />',Ellipsis:'<circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /><circle cx="5" cy="12" r="1" />',Eye:'<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /><circle cx="12" cy="12" r="3" />',FileText:'<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /><path d="M14 2v5a1 1 0 0 0 1 1h5" /><path d="M10 9H8" /><path d="M16 13H8" /><path d="M16 17H8" />',Funnel:'<path d="M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" />',Gauge:'<path d="m12 14 4-4" /><path d="M3.34 19a10 10 0 1 1 17.32 0" />',Grid3x3:'<rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" /><path d="M9 3v18" /><path d="M15 3v18" />',Group:'<path d="M3 7V5c0-1.1.9-2 2-2h2" /><path d="M17 3h2c1.1 0 2 .9 2 2v2" /><path d="M21 17v2c0 1.1-.9 2-2 2h-2" /><path d="M7 21H5c-1.1 0-2-.9-2-2v-2" /><rect width="7" height="5" x="7" y="7" rx="1" /><rect width="7" height="5" x="10" y="12" rx="1" />',Image:'<rect width="18" height="18" x="3" y="3" rx="2" ry="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />',Layers:'<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z" /><path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" /><path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" />',List:'<path d="M3 5h.01" /><path d="M3 12h.01" /><path d="M3 19h.01" /><path d="M8 5h13" /><path d="M8 12h13" /><path d="M8 19h13" />',ListTree:'<path d="M8 5h13" /><path d="M13 12h8" /><path d="M13 19h8" /><path d="M3 10a2 2 0 0 0 2 2h3" /><path d="M3 5v12a2 2 0 0 0 2 2h3" />',Maximize:'<path d="M8 3H5a2 2 0 0 0-2 2v3" /><path d="M21 8V5a2 2 0 0 0-2-2h-3" /><path d="M3 16v3a2 2 0 0 0 2 2h3" /><path d="M16 21h3a2 2 0 0 0 2-2v-3" />',Minus:'<path d="M5 12h14" />',PaintBucket:'<path d="M11 7 6 2" /><path d="M18.992 12H2.041" /><path d="M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595" /><path d="m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33" />',Paintbrush:'<path d="m14.622 17.897-10.68-2.913" /><path d="M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z" /><path d="M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15" />',QrCode:'<rect width="5" height="5" x="3" y="3" rx="1" /><rect width="5" height="5" x="16" y="3" rx="1" /><rect width="5" height="5" x="3" y="16" rx="1" /><path d="M21 16h-3a2 2 0 0 0-2 2v3" /><path d="M21 21v.01" /><path d="M12 7v3a2 2 0 0 1-2 2H7" /><path d="M3 12h.01" /><path d="M12 3h.01" /><path d="M12 16v.01" /><path d="M16 12h1" /><path d="M21 12v.01" /><path d="M12 21v-1" />',Radar:'<path d="M19.07 4.93A10 10 0 0 0 6.99 3.34" /><path d="M4 6h.01" /><path d="M2.29 9.62A10 10 0 1 0 21.31 8.35" /><path d="M16.24 7.76A6 6 0 1 0 8.23 16.67" /><path d="M12 18h.01" /><path d="M17.99 11.66A6 6 0 0 1 15.77 16.67" /><circle cx="12" cy="12" r="2" /><path d="m13.41 10.59 5.66-5.66" />',Redo2:'<path d="m15 14 5-5-5-5" /><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" />',RotateCcw:'<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" />',SeparatorVertical:'<path d="M12 3v18" /><path d="m16 16 4-4-4-4" /><path d="m8 8-4 4 4 4" />',Shapes:'<path d="M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z" /><rect x="3" y="14" width="7" height="7" rx="1" /><circle cx="17.5" cy="17.5" r="3.5" />',Square:'<rect width="18" height="18" x="3" y="3" rx="2" />',Strikethrough:'<path d="M16 4H9a3 3 0 0 0-2.83 4" /><path d="M14 12a4 4 0 0 1 0 8H6" /><line x1="4" x2="20" y1="12" y2="12" />',Table:'<path d="M12 3v18" /><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" />',Table2:'<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18" />',TextAlignCenter:'<path d="M21 5H3" /><path d="M17 12H7" /><path d="M19 19H5" />',TextAlignEnd:'<path d="M21 5H3" /><path d="M21 12H9" /><path d="M21 19H7" />',TextAlignJustify:'<path d="M3 5h18" /><path d="M3 12h18" /><path d="M3 19h18" />',TextAlignStart:'<path d="M21 5H3" /><path d="M15 12H3" /><path d="M17 19H3" />',Trash2:'<path d="M10 11v6" /><path d="M14 11v6" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /><path d="M3 6h18" /><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />',Type:'<path d="M12 4v16" /><path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" /><path d="M9 20h6" />',Underline:'<path d="M6 4v6a6 6 0 0 0 12 0V4" /><line x1="4" x2="20" y1="20" y2="20" />',Undo2:'<path d="M9 14 4 9l5-5" /><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11" />',Ungroup:'<rect width="8" height="6" x="5" y="4" rx="1" /><rect width="8" height="6" x="11" y="14" rx="1" />',ZoomIn:'<circle cx="11" cy="11" r="8" /><line x1="21" x2="16.65" y1="21" y2="16.65" /><line x1="11" x2="11" y1="8" y2="14" /><line x1="8" x2="14" y1="11" y2="11" />',ZoomOut:'<circle cx="11" cy="11" r="8" /><line x1="21" x2="16.65" y1="21" y2="16.65" /><line x1="8" x2="14" y1="11" y2="11" />'};function je(e,t=15,r){const o=q2[e];return o?`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}"${r?` class="${r}"`:""} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${o}</svg>`:""}var Ir=null;function xl(e){const t=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;const r=t[1],o=r.length===3?r.split("").map(n=>n+n).join(""):r;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}function Pl(e){const t=xl(e);return t?Fh(t):"#000000"}function Fh({r:e,g:t,b:r}){return`#${[e,t,r].map(o=>Math.round(pn(o/255)*255).toString(16).padStart(2,"0")).join("")}`}function j2(e,t,r){const o=e/255,n=t/255,i=r/255,a=Math.max(o,n,i),s=Math.min(o,n,i),p=a-s;let l=0;return p!==0&&(a===o?l=(n-i)/p%6:a===n?l=(i-o)/p+2:l=(o-n)/p+4,l*=60,l<0&&(l+=360)),{h:l,s:a===0?0:p/a,v:a}}function W2(e,t,r){const o=r*t,n=(e%360+360)%360/60,i=o*(1-Math.abs(n%2-1)),[a,s,p]=n<1?[o,i,0]:n<2?[i,o,0]:n<3?[0,o,i]:n<4?[0,i,o]:n<5?[i,0,o]:[o,0,i],l=r-o;return{r:(a+l)*255,g:(s+l)*255,b:(p+l)*255}}function V2(e){return((Number.isFinite(e)?e:0)%360+360)%360}function pn(e){return Math.min(1,Math.max(0,Number.isFinite(e)?e:0))}function G2(e){const t=e.translator??lr,r=e.title??t("colorPicker.pickColor");return g("button",{type:"button",class:`preset-color-trigger${e.triggerClass?` ${e.triggerClass}`:""}`,"aria-expanded":"false","aria-haspopup":"dialog",title:r,onClick:o=>{const n=o.currentTarget??o.target,i=n.getRootNode();if(!!Ir&&Ir.root===i&&Ir.title===r&&Ir.trigger===n){dn();return}dn(),K2(n,e,t)}},[g("span",{class:"preset-color-swatch",style:e.value?{background:e.value}:{background:"transparent"}})])}function dn(){const e=Ir;e&&(Ir=null,e.teardowns.forEach(t=>t()),e.trigger.setAttribute("aria-expanded","false"),e.panel.remove())}function K2(e,t,r){const o=e.getRootNode(),n=o instanceof ShadowRoot?o:document.body,i={root:o,title:t.title??r("colorPicker.pickColor"),trigger:e,panel:null,clearable:t.clearable!==!1,onChange:t.onChange,model:t.value||void 0,hue:0,saturation:0,value_:0,hexText:"",dragging:!1,current:null,hex:null,area:null,handle:null,hueRange:null,clearBtn:null,translator:r,items:[],teardowns:[]};t.value&&Sl(i,t.value)?i.hexText=Pl(t.value).toUpperCase():i.hexText=t.value?String(t.value):"",i.panel=rt(J2(i),n),i.current=i.panel.querySelector(".picker-current"),i.hex=i.panel.querySelector(".picker-hex"),i.area=i.panel.querySelector(".picker-area"),i.handle=i.panel.querySelector(".picker-handle"),i.hueRange=i.panel.querySelector(".picker-hue"),i.clearBtn=i.panel.querySelector(".picker-clear"),i.items=Array.from(i.panel.querySelectorAll(".preset-color-item")).map((a,s)=>({el:a,color:sc[s]})),ra(i),Y2(i),X2(i),Ir=i,e.setAttribute("aria-expanded","true")}function Y2(e){const t=e.trigger.getBoundingClientRect(),r=190,o=e.panel.offsetHeight||216,n=8,i=Math.max(n,Math.min(t.left,window.innerWidth-r-n)),a=t.bottom+6,s=a+o>window.innerHeight-n?Math.max(n,t.top-o-6):a;e.panel.style.left=`${i}px`,e.panel.style.top=`${s}px`}function X2(e){const t=n=>{const i=Z2(n);i.includes(e.trigger)||i.includes(e.panel)||dn()},r=n=>{n.key==="Escape"&&dn()},o=()=>dn();document.addEventListener("pointerdown",t,!0),document.addEventListener("keydown",r),window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),e.root.addEventListener("scroll",o,!0),e.teardowns.push(()=>document.removeEventListener("pointerdown",t,!0),()=>document.removeEventListener("keydown",r),()=>window.removeEventListener("scroll",o,!0),()=>window.removeEventListener("resize",o),()=>e.root.removeEventListener("scroll",o,!0))}function Z2(e){const t=typeof e.composedPath=="function"?e.composedPath():[];return t.length?t:[e.target]}function J2(e){const t=e.translator;return g("div",{class:"preset-color-panel",role:"dialog","aria-label":t("colorPicker.pickColor"),style:{position:"fixed"},onPointerdown:r=>r.stopPropagation()},[g("div",{class:"picker-preview"},[g("span",{class:"picker-current"}),g("input",{class:"picker-hex",type:"text",maxlength:7,spellcheck:"false","aria-label":t("colorPicker.hexValue"),onInput:r=>ew(e,r.target.value)})]),g("div",{class:"picker-area","aria-label":t("colorPicker.customColor"),tabindex:0,onPointerdown:r=>tw(e,r),onKeydown:r=>rw(e,r)},[g("span",{class:"picker-handle"})]),g("input",{class:"picker-hue",type:"range",min:0,max:360,step:1,"aria-label":t("colorPicker.hue"),onInput:r=>ow(e,Number(r.target.value)),onChange:()=>Tl(e)}),g("div",{class:"picker-heading"},[g("span",{text:t("colorPicker.commonColors")}),e.clearable?g("button",{type:"button",class:"picker-clear",title:t("colorPicker.clear"),onClick:()=>oa(e,void 0)},[g("svg",{viewBox:"0 0 16 16",width:12,height:12,"aria-hidden":"true"},[g("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round",fill:"none"})]),t("colorPicker.clearShort")]):""].filter(Boolean)),g("div",{class:"preset-color-grid"},sc.map(r=>g("button",{type:"button",class:"preset-color-item",style:{background:r},title:r,"aria-label":r,onClick:()=>Q2(e,r)})))])}function El(e){return Fh(W2(e.hue,e.saturation,e.value_))}function ra(e){const t=El(e);e.hex.value!==e.hexText&&(e.hex.value=e.hexText),e.current.className=e.model?"picker-current":"picker-current is-empty",e.model?e.current.style.background=t:e.current.style.removeProperty("background"),e.area.style.setProperty("--picker-hue",`${Math.round(e.hue)}deg`),e.handle.style.left=`${e.saturation*100}%`,e.handle.style.top=`${(1-e.value_)*100}%`,e.handle.style.background=t;const r=String(Math.round(e.hue));e.hueRange.value!==r&&(e.hueRange.value=r),e.clearBtn&&(e.clearBtn.disabled=!e.model);for(const o of e.items)o.el.className=e.model&&o.color.toLowerCase()===e.model.toLowerCase()?"preset-color-item active":"preset-color-item"}function Sl(e,t){const r=xl(t);if(!r)return!1;const o=j2(r.r,r.g,r.b);return e.hue=o.h,e.saturation=o.s,e.value_=o.v,e.hexText=Pl(t).toUpperCase(),!0}function lo(e,t,r,o){e.hue=V2(t),e.saturation=pn(r),e.value_=pn(o),e.hexText=El(e).toUpperCase(),ra(e)}function Tl(e){const t=El(e);e.model=t,ra(e),e.onChange(t)}function oa(e,t){e.model=t,t||(e.hexText=""),ra(e),e.onChange(t)}function Q2(e,t){Sl(e,t),oa(e,t)}function ew(e,t){const r=t.trim();if(!r){e.clearable&&oa(e,void 0);return}xl(r)&&(Sl(e,r),oa(e,Pl(r)))}function tw(e,t){e.dragging=!0,$h(e,t);const r=n=>{e.dragging&&$h(e,n)},o=()=>{e.dragging&&(e.dragging=!1,document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",o),document.removeEventListener("pointercancel",o),Tl(e))};document.addEventListener("pointermove",r),document.addEventListener("pointerup",o),document.addEventListener("pointercancel",o)}function $h(e,t){const r=e.area.getBoundingClientRect();if(!r.width||!r.height)return;const o=pn((t.clientX-r.left)/r.width),n=pn(1-(t.clientY-r.top)/r.height);lo(e,e.hue,o,n)}function rw(e,t){const r=t.shiftKey?.1:.02;let o=!0;t.key==="ArrowLeft"?lo(e,e.hue,e.saturation-r,e.value_):t.key==="ArrowRight"?lo(e,e.hue,e.saturation+r,e.value_):t.key==="ArrowUp"?lo(e,e.hue,e.saturation,e.value_+r):t.key==="ArrowDown"?lo(e,e.hue,e.saturation,e.value_-r):o=!1,o&&(t.preventDefault(),Tl(e))}function ow(e,t){lo(e,t,e.saturation,e.value_)}function m(e,t,r){return e.t?e.t(t,r):lr(t,r)}let po=null;function nw(e,t){const r=po;po=e;try{t()}finally{po=r}}function oe(e,t){return po?po(e,t):lr(e,t)}function Re(e,t,r,o){return g("button",{class:`tb-btn tb-icon${o.on?" on":""}${o.danger?" danger":""}`,type:"button",disabled:!!o.disabled,dataset:{tip:o.tip,...o.test?{test:o.test}:{}},onClick:()=>e.fire(r,o.arg),html:je(t)})}function na(e,t,r,o){const n=e.state.openDd===t,i=()=>{e.state.openDd=n?null:t,e.repaint()};return g("div",{class:"tb-dd"},[g("button",{type:"button",class:`tb-dd-trigger${n?" on":""}`,disabled:!!r.disabled,dataset:{test:r.testId??t,tip:r.tip},onClick:i,html:`${r.icon?je(r.icon):""}${r.text?`<span class="${r.textClass??"tb-btn-text"}">${r.text}</span>`:""}${je("ChevronDown",12,`tb-dd-arrow${n?" up":""}`)}`}),n?g("div",{class:`tb-dd-panel${r.panelClass?` ${r.panelClass}`:""}`},o):""].filter(Boolean))}function ae(e){const t=e.step??1,r=String(t),o=r.indexOf("."),n=o===-1?0:r.length-o-1,i=u=>Number.isFinite(u)?Number(u.toFixed(n)):0,a=u=>{let c=i(u);return e.min!==void 0&&c<e.min&&(c=e.min),e.max!==void 0&&c>e.max&&(c=e.max),c},s=e.value===void 0||e.value===null||!Number.isFinite(e.value)?void 0:i(e.value),p=s??e.min??0,l=u=>{u!==s&&e.onCommit(u)},d=g("input",{class:"pd-input pd-step-input",type:"number",value:s===void 0?"":String(s),min:e.min,max:e.max,step:t,placeholder:e.placeholder,disabled:!!e.disabled,onChange:u=>{const c=u.target,f=(c.value??"").trim();if(f===""){s!==void 0&&(c.value=String(s));return}const h=Number(f);if(!Number.isFinite(h)){c.value=s===void 0?"":String(s);return}const b=a(h);c.value=String(b),l(b)}});return g("div",{class:"pd-stepper"},[g("button",{type:"button",class:"pd-step-btn pd-step-minus",disabled:!!e.disabled||p<=(e.min??-1/0),title:oe("controls.k28"),"aria-label":oe("controls.k29"),text:"−",onClick:()=>l(a(p-t))}),d,g("button",{type:"button",class:"pd-step-btn pd-step-plus",disabled:!!e.disabled||p>=(e.max??1/0),title:oe("controls.k30"),"aria-label":oe("controls.k31"),text:"+",onClick:()=>l(a(p+t))})])}function he(e,t,r,o){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),o??""]),t,r?g("p",{class:"pd-hint",text:r}):""].filter(Boolean))}const Ml=e=>g("button",{class:"pd-help",type:"button","data-tip":e,"aria-label":oe("controls.k32")});function Ge(e,t,r,o){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[e,Ml(r)]),o??""]),t])}function Lr(e){const t=e.base?.[e.propKey],r=e.target?.[e.propKey]!==t,o=e.force===!0||r,n=e.tipOverride??(e.tipValue===void 0?oe("controls.k33"):oe("controls.k34",{v0:e.tipValue,v1:e.tipUnit?" "+e.tipUnit:""})),i=e.force?oe("controls.k35",{v0:n}):n;return g("button",{type:"button",class:`pd-reset-btn${r&&!e.force?" is-dirty":""}`,"data-tip":i,"aria-label":i,html:je("RotateCcw",13),onClick:()=>{o&&(e.write?e.write(t):e.target[e.propKey]=t,e.onReset?.())}})}const $t=e=>g("h3",{class:"pd-divider",text:e});function dt(e,t,r=oe("controls.k36"),o){return G2({value:e,title:r,triggerClass:o,translator:po??lr,onChange:n=>t(n)})}function pr(e,t,r,o,n=!1){return g("div",{class:`pd-radio-group${n?" pd-radio-group--2col":""}`,role:"radiogroup"},t.map(i=>g("label",{class:"pd-radio"},[g("input",{type:"radio",name:e,value:i.value,checked:r===i.value,onChange:()=>o(i.value)}),g("span",{text:i.label})])))}function zh(e,t,r,o={}){const n=document.createElement("select");n.className=o.className??"pd-select",o.width&&(n.style.width=o.width);for(const i of t){const a=document.createElement("option");a.value=i.value,a.textContent=i.label,i.disabled&&(a.disabled=!0),n.appendChild(a)}return n.value=e,t.some(i=>i.value===e)||(n.selectedIndex=-1),n.addEventListener("change",()=>r(n.value)),n}const iw="propertyPanel.k328",aw=()=>oe(iw);function Hh(){const e=[];for(const{plugin:t,kind:r}of fd()){const o=D2(r.type);if(!o)continue;const i=(r.designer??t.designer)?.materialCard;e.push({type:r.type,label:r.label,icon:r.icon??i?.icon??"Shapes",group:i?.group??o.group,ui:o})}return e}function Cl(e){if(e)return Hh().find(t=>t.type===e)}function _l(e){if(!e)return;const t=Cl(e.printElementType.type);if(!t||!t.ui.renderProperty)return;const r=t.ui;if(r.hasProperties)try{if(!r.hasProperties(e))return}catch{return}const o=aw();return{ui:r,label:o,icon:t.icon,searchKeywords:r.searchKeywords?[...r.searchKeywords]:[o,t.label,t.type]}}const ia=Object.freeze([{type:"text",label:oe("elementDefinitions.k553"),icon:"Type",material:!0,propertyGroup:"text",dblEditableField:"formatter",origin:"builtin"},{type:"barcode",label:oe("elementDefinitions.k554"),icon:"Barcode",material:!0,propertyGroup:"code",dblEditableField:"formatter",origin:"builtin"},{type:"qrcode",label:oe("elementDefinitions.k555"),icon:"QrCode",material:!0,propertyGroup:"code",dblEditableField:"formatter",origin:"builtin"},{type:"image",label:oe("elementDefinitions.k556"),icon:"Image",material:!0,propertyGroup:"general",dblEditableField:"src",origin:"builtin"},{type:"table",label:oe("elementDefinitions.k557"),icon:"Table",material:!0,propertyGroup:"table",origin:"builtin"},{type:"longText",label:oe("elementDefinitions.k558"),icon:"TextAlignStart",material:!0,propertyGroup:"text",dblEditableField:"formatter",origin:"builtin"},{type:"flowList",label:oe("elementDefinitions.k559"),icon:"List",material:!0,propertyGroup:"general",dblEditableField:"formatter",origin:"builtin"},{type:"hline",label:oe("elementDefinitions.k560"),icon:"Minus",material:!0,propertyGroup:"general",origin:"builtin"},{type:"vline",label:oe("elementDefinitions.k561"),icon:"SeparatorVertical",material:!0,propertyGroup:"general",origin:"builtin"},{type:"rect",label:oe("elementDefinitions.k562"),icon:"Square",material:!0,propertyGroup:"general",origin:"builtin"},{type:"oval",label:oe("elementDefinitions.k563"),icon:"Circle",material:!0,propertyGroup:"general",origin:"builtin"},{type:"html",label:"HTML",icon:"Code",material:!1,propertyGroup:"general",origin:"builtin"},{type:"pageNumber",label:oe("elementDefinitions.k564"),icon:"Shapes",material:!1,propertyGroup:"general",origin:"builtin"}]),Uh=Symbol.for("worm-print-platform.element-definitions.v1"),qh=globalThis;function Mt(){const e=qh[Uh];if(e)return e;const t={overrides:new Map,builtinRenderers:new Map,rendererOverrides:new Map,listeners:new Set,nextSeq:0,seq:new Map};return qh[Uh]=t,t}function cn(){for(const e of[...Mt().listeners])try{e()}catch{}}function jh(e){const t=Mt();return t.listeners.add(e),()=>{t.listeners.delete(e)}}function sw(){return new Map(ia.map(e=>[e.type,e]))}function lw(e){if(!e?.type||typeof e.type!="string")throw new Error(oe("elementDefinitions.k565"));if(!e.label||typeof e.label!="string")throw new Error(oe("elementDefinitions.k566"));const t=Mt(),r={...e,origin:e.origin??"custom"};return t.overrides.set(r.type,r),t.seq.set(r.type,t.nextSeq++),cn(),()=>{const o=Mt();o.overrides.get(r.type)===r&&(o.overrides.delete(r.type),cn())}}function pw(e,t){if(!e||typeof t!="function")throw new Error(oe("elementDefinitions.k567"));return Mt().rendererOverrides.set(e,t),cn(),()=>{const o=Mt();o.rendererOverrides.get(e)===t&&(o.rendererOverrides.delete(e),cn())}}function Wh(e){const t=Mt();for(const[r,o]of Object.entries(e))t.builtinRenderers.set(r,o);return()=>{const r=Mt();for(const[o,n]of Object.entries(e))r.builtinRenderers.get(o)===n&&r.builtinRenderers.delete(o)}}function dw(e){const t=Cl(e);if(t)return{type:t.type,label:t.label,icon:t.icon,group:t.group,material:!0,propertyGroup:"general",origin:"plugin"}}function dr(e){if(!e)return;const t=Mt(),r=t.overrides.get(e)??sw().get(e)??dw(e);if(!r)return;const o=t.rendererOverrides.get(e)??t.builtinRenderers.get(e);return o?{...r,renderContent:o}:r}function Vh(){const e=Mt(),t=[],r=new Set;for(const n of ia)t.push(dr(n.type)??n),r.add(n.type);const o=[...e.overrides.entries()].filter(([n])=>!r.has(n)).sort((n,i)=>(e.seq.get(n[0])??0)-(e.seq.get(i[0])??0));for(const[n]of o){const i=dr(n);i&&t.push(i),r.add(n)}for(const n of Hh()){if(r.has(n.type))continue;const i=dr(n.type);i&&t.push(i),r.add(n.type)}return t}function Gh(){return Vh().filter(e=>e.material)}function Kh(e){return dr(e)?.propertyGroup??"general"}function Yh(e){return dr(e)?.dblEditableField}function Xh(e){return dr(e)?.icon??"Shapes"}function cw(){const e=Mt();e.overrides.clear(),e.rendererOverrides.clear(),e.seq.clear(),e.nextSeq=0,cn()}const Dl="1.4.0",Zh="print-designer",Al=["template","fields","name","fonts","design-data","theme","theme-config","field-display","lang"],Jh=["is-edit","show-help","show-preview","show-save"],uw=Object.freeze({bubbles:!0,composed:!0}),Ol=["container","toolbar","format-bar","left-panel","canvas-area","property-panel","status-bar","page-tabs"],Qh=["--pd-bg","--pd-surface","--pd-field-bg","--pd-sidebar","--pd-sidebar-hover","--pd-canvas-bg","--pd-paper","--pd-accent","--pd-accent-2","--pd-accent-soft","--pd-accent-secondary","--pd-danger-soft","--pd-ink-green","--pd-text","--pd-text-muted","--pd-text-faint","--pd-border","--pd-border-soft","--pd-input-bg","--pd-hover-tint","--pd-danger","--pd-danger-bg","--pd-danger-border","--pd-menu-text","--pd-menu-hover","--pd-menu-border","--pd-menu-divider","--pd-menu-muted","--pd-menu-disabled","--pd-scrollbar","--pd-scrollbar-thumb","--pd-scrollbar-thumb-hover","--pd-help-field-bg","--pd-help-field-line","--pd-help-field-ink","--pd-help-function-bg","--pd-help-function-line","--pd-help-function-ink","--pd-help-variable-bg","--pd-help-variable-line","--pd-help-variable-ink","--pd-help-conditional-bg","--pd-help-conditional-line","--pd-help-conditional-ink","--pd-handle","--pd-ruler","--pd-ruler-bg","--pd-ruler-cursor","--pd-radius","--pd-shadow-sm","--pd-shadow-md","--pd-shadow-paper","--pd-success","--pd-text-regular","--pd-fill-light"],em=["getTemplateJson","loadTemplate","save","validateTemplate","getGeometryWarnings","setLocale"],tm=["template","fields","fonts","designData","isEdit","showHelp","showPreview","showSave","theme","themeConfig","uploadImage","uploadDesignBackground","fieldDisplay","lang","messages"],Ct=Object.freeze({save:"save",preview:"preview",help:"help",dblclickElement:"dblclick-element",dblclickCell:"dblclick-cell"}),rm=[Ct.save,Ct.preview,Ct.help,Ct.dblclickElement,Ct.dblclickCell];function Rl(){return{version:Dl,tag:Zh,attributes:Al,booleanAttributes:Jh,events:rm,parts:Ol,themeTokens:Qh,methods:em,properties:tm}}const fw={"--pd-bg":"#181a20","--pd-surface":"#1f2229","--pd-field-bg":"#252830","--pd-sidebar":"#1f2229","--pd-sidebar-hover":"#2b2f39","--pd-accent":"#4C8DFF","--pd-accent-2":"#6C9DFF","--pd-accent-soft":"rgba(76, 141, 255, .16)","--pd-accent-secondary":"#ff7a7a","--pd-danger-soft":"rgba(255, 122, 122, .14)","--pd-ink-green":"#6cce5a","--pd-text":"#e6e8ee","--pd-text-muted":"#9aa0ad","--pd-text-faint":"#6f7683","--pd-text-regular":"#c9cdd8","--pd-border":"#3a3f4b","--pd-border-soft":"#2d323c","--pd-input-bg":"#262a33","--pd-hover-tint":"rgba(76, 141, 255, .12)","--pd-fill-light":"#2b2f39","--pd-danger":"#ff6b6b","--pd-danger-bg":"#3a2226","--pd-danger-border":"#6b3535","--pd-success":"#4ade80","--pd-menu-text":"#d6d9e0","--pd-menu-hover":"#2b2f39","--pd-menu-border":"#3a3f4b","--pd-menu-divider":"#2d323c","--pd-menu-muted":"#8b91a0","--pd-menu-disabled":"#555b68","--pd-scrollbar":"rgba(255, 255, 255, .18)","--pd-scrollbar-thumb":"rgba(255, 255, 255, .16)","--pd-scrollbar-thumb-hover":"rgba(255, 255, 255, .3)","--pd-help-field-bg":"#16283a","--pd-help-field-line":"#2c5870","--pd-help-field-ink":"#7cc4f5","--pd-help-function-bg":"#162e22","--pd-help-function-line":"#2c5b3c","--pd-help-function-ink":"#79d69a","--pd-help-variable-bg":"#302c16","--pd-help-variable-line":"#6b5d24","--pd-help-variable-ink":"#d6b25e","--pd-help-conditional-bg":"#301a28","--pd-help-conditional-line":"#6b3454","--pd-help-conditional-ink":"#e58ab5","--pd-shadow-sm":"0 1px 2px rgba(0, 0, 0, .3)","--pd-shadow-md":"0 2px 8px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .5)"};function om(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function hw(e){if(Array.isArray(e))return e}function mw(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,n,i,a,s=[],p=!0,l=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(p=(o=i.call(r)).done)&&(s.push(o.value),s.length!==t);p=!0);}catch(d){l=!0,n=d}finally{try{if(!p&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return s}}function gw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
295
295
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bw(e,t){return hw(e)||mw(e,t)||kw(e,t)||gw()}function kw(e,t){if(e){if(typeof e=="string")return om(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?om(e,t):void 0}}const nm=Object.entries,yw=Object.keys,im=Object.setPrototypeOf,vw=Object.isFrozen,am=Object.getPrototypeOf,sm=Object.getOwnPropertyDescriptor;let We=Object.freeze,Ne=Object.seal,cr=Object.create,lm=typeof Reflect<"u"&&Reflect,aa=lm.apply,Il=lm.construct;We||(We=function(t){return t}),Ne||(Ne=function(t){return t}),aa||(aa=function(t,r){for(var o=arguments.length,n=new Array(o>2?o-2:0),i=2;i<o;i++)n[i-2]=arguments[i];return t.apply(r,n)}),Il||(Il=function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return new t(...o)});const Vt=_e(Array.prototype.forEach),ww=_e(Array.prototype.lastIndexOf),pm=_e(Array.prototype.pop),un=_e(Array.prototype.push),xw=_e(Array.prototype.slice),Pw=_e(Array.prototype.splice),co=Array.isArray,Ll=um(Set),Bl=_e(Set.prototype.add),fn=_e(Set.prototype.has),Br=_e(String.prototype.toLowerCase),Nl=_e(String.prototype.toString),Ew=_e(String.prototype.match),sa=_e(String.prototype.replace),Fl=_e(String.prototype.indexOf),Sw=_e(String.prototype.trim),Tw=_e(Number.prototype.toString),Mw=_e(Boolean.prototype.toString),dm=typeof BigInt>"u"?null:_e(BigInt.prototype.toString),cm=typeof Symbol>"u"?null:_e(Symbol.prototype.toString),Ze=_e(Object.prototype.hasOwnProperty),hn=_e(Object.prototype.toString),Cw=RegExp.prototype.test,Ve=function(t,r){return t instanceof RegExp&&(t.lastIndex=0),aa(Cw,t,[r])},Gt=um(TypeError);function _e(e){return function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return aa(e,t,o)}}function um(e){return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return Il(e,r)}}function be(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Br;if(im&&im(e,null),!co(t))return e;let o=t.length;for(;o--;){let n=t[o];if(typeof n=="string"){const i=r(n);i!==n&&(vw(t)||(t[o]=i),n=i)}e[n]=!0}return e}function _w(e){for(let t=0;t<e.length;t++)Ze(e,t)||(e[t]=null);return e}function la(e){const t=cr(null);for(const o of nm(e)){var r=bw(o,2);const n=r[0],i=r[1];Ze(e,n)&&(co(i)?t[n]=_w(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=la(i):t[n]=i)}return t}function mn(e){const t=cr(null),r=yw(e);let o=r.length;for(;o--;)t[r[o]]=e[r[o]];return t}function Dw(e){switch(typeof e){case"string":return e;case"number":return Tw(e);case"boolean":return Mw(e);case"bigint":return dm?dm(e):"0";case"symbol":return cm?cm(e):"Symbol()";case"undefined":return hn(e);case"function":case"object":{if(e===null)return hn(e);const t=e,r=wt(t,"toString");if(typeof r=="function"){const o=r(t);return typeof o=="string"?o:hn(o)}return hn(e)}default:return hn(e)}}function wt(e,t){for(;e!==null;){const o=sm(e,t);if(o){if(o.get)return _e(o.get);if(typeof o.value=="function")return _e(o.value)}e=am(e)}function r(){return null}return r}function Aw(e,t){for(;e!==null;){const r=sm(e,t);if(r)return r.get?_e(r.get):null;e=am(e)}return null}function Ow(e){if(!e)return!1;try{return Ve(e,""),!0}catch{return!1}}const fm=We(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$l=We(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),zl=We(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Rw=We(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hl=We(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Iw=We(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hm=We(["#text"]),mm=We(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ul=We(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gm=We(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),pa=We(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Lw=Ne(/{{[\w\W]*|^[\w\W]*}}/g),Bw=Ne(/<%[\w\W]*|^[\w\W]*%>/g),Nw=Ne(/\${[\w\W]*/g),Fw=Ne(/{{|}}|\${|<%|%>|&lt;%|%&gt;/),$w=Ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),zw=Ne(/^aria-[\-\w]+$/),bm=Ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hw=Ne(/^(?:\w+script|data):/i),Uw=Ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qw=Ne(/^html$/i),jw=Ne(/^[a-z][.\w]*(-[.\w]+)+$/i),ql=Ne(/<[/\w!]/g),km=Ne(/<[/\w]/g),Ww=Ne(/<\/no(script|embed|frames)/i),ym=Ne(/\/>/i),Vw=Ne(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),Gw=Ne(/^[\r\n\t ]+/),Ie={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},Kw=We(be({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Yw=function(){return typeof window>"u"?null:window},Xw=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const n="data-tt-policy-suffix";r&&r.hasAttribute(n)&&(o=r.getAttribute(n));const i="dompurify"+(o?"#"+o:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},vm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ur=function(t,r,o,n){return Ze(t,r)&&co(t[r])?be(n.base?mn(n.base):{},t[r],n.transform):o},jl=function(t,r,o){const n=Ze(t,r)?t[r]:void 0;return n&&typeof n=="object"?la(n):o};function wm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yw();const t=B=>wm(B);if(t.version="3.4.18",t.removed=[],!e||!e.document||e.document.nodeType!==Ie.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const o=r,n=o.currentScript,i=e.HTMLTemplateElement,a=e.Node,s=e.Element,p=e.NodeFilter,l=e.DOMParser,d=e.trustedTypes,u=s.prototype,c=wt(u,"cloneNode"),f=wt(u,"remove"),h=wt(u,"removeAttributeNode"),b=wt(u,"nextSibling"),k=wt(u,"childNodes"),v=wt(u,"parentNode"),w=wt(u,"shadowRoot"),P=wt(u,"attributes"),E=a&&a.prototype?wt(a.prototype,"nodeType"):null,D=a&&a.prototype?wt(a.prototype,"nodeName"):null,O=a&&a.prototype?wt(a.prototype,"ownerDocument"):null,A=function(y){return E?E(y):y.nodeType},R=function(y){return D?D(y):y.nodeName},_=Aw(u,"namespaceURI"),I=function(y){return _?_(y):y.namespaceURI};if(typeof i=="function"){const B=r.createElement("template");B.content&&B.content.ownerDocument&&(r=B.content.ownerDocument)}let S,N="",F,H=!1,le=0;const M=function(){if(le>0)throw Gt('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ne=function(y){M(),le++;try{return S.createHTML(y)}finally{le--}},Se=function(y){return S&&De?ne(y):y},Pe=function(y){M(),le++;try{return S.createScriptURL(y)}finally{le--}},K=function(){return H||(F=Xw(d,n),H=!0),F},ue=r,me=ue.implementation,we=ue.createNodeIterator,ke=ue.createDocumentFragment,te=ue.getElementsByTagName,Me=o.importNode;let se=vm();t.isSupported=typeof nm=="function"&&typeof v=="function"&&me&&me.createHTMLDocument!==void 0;const Je=Lw,ze=Bw,ve=Nw,Ee=$w,ho=zw,vn=Hw,wn=Uw,xn=jw;let mo=bm,xe=null;const Dt=be({},[...fm,...$l,...zl,...Hl,...hm]);let C=null;const q=be({},[...mm,...Ul,...gm,...pa]);let U=null,V=null,j=null;const J=Object.seal(cr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pe=!0,T=!0,X=!1,ee=!0,ie=!1,ce=!0,Te=!1,Le=!1,Ke=null,ot=null,He=!1,ct=!1,Ce=!1,De=!1,At=!0,Hr=!1;const ut="user-content-";let Ae=!0,qt=!1,xt=null,Qe=!1,Pt=null;const Jt=be({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let hr=null;const $e=be({},["audio","video","img","source","image","track"]);let Ue=null;const Ur=be({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qr="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ft=ye,ht=!1,Pn=null;const mp=be({},[qr,fe,ye],Nl),gp=We(be({},["mi","mo","mn","ms","mtext"]));let bp=null;const dE=We(be({},["annotation-xml"]));let kp=null;const cE=We(cr(null)),uE=be({},["title","style","font","a","script"]);let En=null;const fE=["application/xhtml+xml","text/html"],hE="text/html";let Be=null,wa=null;const mE=r.createElement("form"),Pg=function(y){return y instanceof RegExp||y instanceof Function},yp=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(!y||typeof y!="object")&&(y={}),y=la(y),En=fE.indexOf(y.PARSER_MEDIA_TYPE)===-1?hE:y.PARSER_MEDIA_TYPE,Be=En==="application/xhtml+xml"?Nl:Br,xe=ur(y,"ALLOWED_TAGS",Dt,{transform:Be}),C=ur(y,"ALLOWED_ATTR",q,{transform:Be}),Pn=ur(y,"ALLOWED_NAMESPACES",mp,{transform:Nl}),Ue=ur(y,"ADD_URI_SAFE_ATTR",Ur,{transform:Be,base:Ur}),hr=ur(y,"ADD_DATA_URI_TAGS",$e,{transform:Be,base:$e}),Pt=ur(y,"FORBID_CONTENTS",Jt,{transform:Be}),V=ur(y,"FORBID_TAGS",cr(null),{transform:Be}),j=ur(y,"FORBID_ATTR",cr(null),{transform:Be}),Qe=Ze(y,"USE_PROFILES")?y.USE_PROFILES&&typeof y.USE_PROFILES=="object"?la(y.USE_PROFILES):y.USE_PROFILES:!1,pe=y.ALLOW_ARIA_ATTR!==!1,T=y.ALLOW_DATA_ATTR!==!1,X=y.ALLOW_UNKNOWN_PROTOCOLS||!1,ee=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ie=y.SAFE_FOR_TEMPLATES||!1,ce=y.SAFE_FOR_XML!==!1,Te=y.WHOLE_DOCUMENT||!1,ct=y.RETURN_DOM||!1,Ce=y.RETURN_DOM_FRAGMENT||!1,De=y.RETURN_TRUSTED_TYPE||!1,He=y.FORCE_BODY||!1,At=y.SANITIZE_DOM!==!1,Hr=y.SANITIZE_NAMED_PROPS||!1,Ae=y.KEEP_CONTENT!==!1,qt=y.IN_PLACE||!1,mo=Ow(y.ALLOWED_URI_REGEXP)?y.ALLOWED_URI_REGEXP:bm,ft=typeof y.NAMESPACE=="string"?y.NAMESPACE:ye,bp=jl(y,"MATHML_TEXT_INTEGRATION_POINTS",gp),kp=jl(y,"HTML_INTEGRATION_POINTS",dE);const x=jl(y,"CUSTOM_ELEMENT_HANDLING",cE);if(U=cr(null),Ze(x,"tagNameCheck")&&Pg(x.tagNameCheck)&&(U.tagNameCheck=x.tagNameCheck),Ze(x,"attributeNameCheck")&&Pg(x.attributeNameCheck)&&(U.attributeNameCheck=x.attributeNameCheck),Ze(x,"allowCustomizedBuiltInElements")&&typeof x.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=x.allowCustomizedBuiltInElements),Ne(U),ie&&(T=!1),Ce&&(ct=!0),Qe&&((Ze(y,"ALLOWED_TAGS")||Ze(y,"ALLOWED_ATTR"))&&typeof console<"u"&&typeof console.warn=="function"&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),xe=be({},hm),C=cr(null),Qe.html===!0&&(be(xe,fm),be(C,mm)),Qe.svg===!0&&(be(xe,$l),be(C,Ul),be(C,pa)),Qe.svgFilters===!0&&(be(xe,zl),be(C,Ul),be(C,pa)),Qe.mathMl===!0&&(be(xe,Hl),be(C,gm),be(C,pa))),J.tagCheck=null,J.attributeCheck=null,Ze(y,"ADD_TAGS")&&(typeof y.ADD_TAGS=="function"?J.tagCheck=y.ADD_TAGS:co(y.ADD_TAGS)&&(xe===Dt&&(xe=mn(xe)),be(xe,y.ADD_TAGS,Be))),Ze(y,"ADD_ATTR")&&(typeof y.ADD_ATTR=="function"?J.attributeCheck=y.ADD_ATTR:co(y.ADD_ATTR)&&(C===q&&(C=mn(C)),be(C,y.ADD_ATTR,Be))),Ze(y,"ADD_FORBID_CONTENTS")&&co(y.ADD_FORBID_CONTENTS)&&(Pt===Jt&&(Pt=mn(Pt)),be(Pt,y.ADD_FORBID_CONTENTS,Be)),Ae&&(xe["#text"]=!0),Te&&be(xe,["html","head","body"]),xe.table&&(xe.tbody=!0,delete V.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const L=S;S=y.TRUSTED_TYPES_POLICY;try{N=ne("")}catch(z){throw S=L,z}}else y.TRUSTED_TYPES_POLICY===null?(S=void 0,N=""):(S===void 0&&(S=K()),S&&typeof N=="string"&&(N=ne("")));wa=We(y)},Eg=be({},[...$l,...zl,...Rw]),Sg=be({},[...Hl,...Iw]),gE=function(y,x,L){return x===ye?y==="svg":x===qr?y==="svg"&&(L==="annotation-xml"||bp[L]):!!Eg[y]},bE=function(y,x,L){return x===ye?y==="math":x===fe?y==="math"&&kp[L]:!!Sg[y]},kE=function(y,x,L){return x===fe&&!kp[L]||x===qr&&!bp[L]?!1:!Sg[y]&&(uE[y]||!Eg[y])},yE=function(y){const x=I(y),L=Br(R(y)),z=v(y);let Y=ft,re="template";return z&&A(z)===Ie.element&&(Y=I(z),re=Br(R(z))),Pn[x]?x===fe?gE(L,Y,re):x===qr?bE(L,Y,re):x===ye?kE(L,Y,re):En==="application/xhtml+xml":!1},mr=function(y){un(t.removed,{element:y});try{v(y).removeChild(y)}catch{if(f(y),!v(y))throw Gt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Tg=function(y,x,L){try{h(y,x)}catch{try{y.removeAttribute(L)}catch{}}},vp=function(y){Pp(y);const x=k(y);x&&Vt(xw(x),L=>{try{f(L)}catch{}}),A(y)===Ie.element&&wp(y,!1)},go=function(y,x,L){if(!L)try{L=x.getAttributeNode(y)}catch{L=null}if(un(t.removed,{attribute:L||null,from:x}),L)Tg(x,L,y);else try{x.removeAttribute(y)}catch{}if(y==="is")if(ct||Ce)try{mr(x)}catch{}else try{x.setAttribute(y,"")}catch{}},wp=function(y,x){const L=P(y);if(L)for(let z=L.length-1;z>=0;--z){const Y=L[z],re=Y&&Y.name;typeof re=="string"&&!(x&&C[Be(re)])&&Tg(y,Y,re)}},xp=function(y,x){let L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const z=[y];for(;z.length>0;){const Y=z.pop();if(x(Y)===!1)continue;if(L&&A(Y)===Ie.element){const de=w(Y);bo(de)&&z.push(de)}const re=k(Y);if(re)for(let de=re.length-1;de>=0;--de)z.push(re[de])}},Pp=function(y){xp(y,x=>{A(x)===Ie.element&&wp(x,!0)})},Ep=function(y){const x=[];return xp(y,L=>{x.push(L)},!0),x},vE=function(y,x){const L=Ll();Vt(Ep(y),z=>{A(z)===Ie.element&&Bl(L,z)}),Vt(x,z=>{A(z)===Ie.element&&!fn(L,z)&&wp(z,!0)})},Mg=function(y,x){let L=!1;return Vt(t.removed,z=>{z.element&&(L=L||z.element===y,Pp(z.element))}),vE(y,x),L},wE=8,xE=function(y,x){const L=xt;let z=null;const Y=()=>(z||(z=Ll(),Vt(x,re=>{Bl(z,re)})),z);for(let re=0;;re++){const de=Ep(y),qe=[y];let Qt=!1;if(Vt(de,Rt=>{A(Rt)===Ie.documentFragment?un(qe,Rt):!Qt&&!fn(L,Rt)&&(Qt=fn(Y(),Rt))}),!Qt)return;if(re>=wE)throw Gt("the tree kept changing during in-place sanitization; refusing to return it");Vt(qe,(Rt,mt)=>{PE(Rt,mt>0,y,Y())})}},PE=function(y,x,L,z){const Y=xa(y);let re;for(;re=Y.nextNode();)!fn(z,re)||fn(xt,re)||(x&&Ot(se.uponSanitizeShadowNode,re,null),Cp(re,L))},EE=function(y){xt&&Bl(xt,y)},Cg=function(y,x){return ce?y==="patchsrc"?!0:y==="for"&&x!=="label"&&x!=="output":!1},SE=function(y){ce&&xp(y,x=>{const L=A(x);if(L===Ie.processingInstruction||L===Ie.comment&&Ve(km,x.data)){try{f(x)}catch{}return!1}if(L===Ie.element){const z=x,Y=Be(R(x));try{z.hasAttribute&&z.hasAttribute("patchsrc")&&z.removeAttribute("patchsrc"),z.hasAttribute&&z.hasAttribute("for")&&Cg("for",Y)&&z.removeAttribute("for")}catch{}}return!0})},_g=function(y){let x=null,L=null;if(He)y="<remove></remove>"+y;else{const re=Ew(y,Gw);L=re&&re[0]}En==="application/xhtml+xml"&&ft===ye&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");const z=S?ne(y):y;if(ft===ye)try{x=new l().parseFromString(z,En)}catch{}if(!x||!x.documentElement){x=me.createDocument(ft,"template",null);try{x.documentElement.innerHTML=ht?N:z}catch{}}const Y=x.body||x.documentElement;return y&&L&&Y.insertBefore(r.createTextNode(L),Y.childNodes[0]||null),ft===ye?te.call(x,Te?"html":"body")[0]:Te?x.documentElement:Y},xa=function(y){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const L=O?O(y):y.ownerDocument;return we.call(L||y,y,(x?0:p.SHOW_ELEMENT)|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Sp=function(y){return y=sa(y,Je," "),y=sa(y,ze," "),y=sa(y,ve," "),y},Tp=function(y){var x;Mp(y);const L=(x=y.querySelectorAll)===null||x===void 0?void 0:x.call(y,"template");L&&Vt(L,z=>{bo(z.content)&&Tp(z.content)})},Mp=function(y){y.normalize();const x=xa(y,!0);let L=x.nextNode();for(;L;)L.data=Sp(L.data),L=x.nextNode()},Pa=function(y){const x=D?D(y):null;return typeof x!="string"||Be(x)!=="form"?!1:typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||y.attributes!==P(y)||typeof y.removeAttribute!="function"||typeof y.removeAttributeNode!="function"||typeof y.getAttributeNode!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function"||y.nodeType!==E(y)||y.childNodes!==k(y)},Dg=function(y){if(!E||typeof y!="object"||y===null)return null;try{const x=E(y);return typeof x=="number"?x:null}catch{return null}},bo=function(y){return Dg(y)===Ie.documentFragment},Sn=function(y){return Dg(y)!==null};function Ot(B,y,x){B.length!==0&&Vt(B,L=>{L.call(t,y,x,wa)})}const TE=function(y,x,L){return!!(ce&&L===Ie.element&&y.hasChildNodes()&&!Sn(y.firstElementChild)&&Ve(ql,y.textContent)&&Ve(ql,y.innerHTML)||ce&&Kw[x]&&L===Ie.element&&I(y)===ye&&(Sn(y.firstElementChild)||typeof y.textContent=="string"&&Ve(ql,y.textContent))||L===Ie.processingInstruction||ce&&L===Ie.comment&&Ve(km,y.data))},Ea=function(y,x){if(y instanceof RegExp)return Ve(y,x);if(y instanceof Function){for(var L=arguments.length,z=new Array(L>2?L-2:0),Y=2;Y<L;Y++)z[Y-2]=arguments[Y];return!!y(x,...z)}return!1},ME=function(y,x,L){if(!V[x]&&Rg(x)&&Ea(U.tagNameCheck,x))return!1;if(Ae&&!Pt[x]&&!Pt[Br(x)]){const z=v(y),Y=k(y);if(Y&&z){const re=Y.length;for(let de=re-1;de>=0;--de){const qe=y===L?c(Y[de],!0):Y[de];z.insertBefore(qe,b(y))}}}return mr(y),!0},Ag=function(y,x,L,z){return y.length===0?x:x===L||x===z?mn(x):x},ko=function(y,x){return y===x||v(y)!==null?!1:(qt&&Pp(y),!0)},CE=function(y,x){if(EE(y),Ot(se.beforeSanitizeElements,y,null),ko(y,x))return!0;if(Pa(y))return mr(y),!0;const L=Be(R(y)),z=A(y);if(xe=Ag(se.uponSanitizeElement,xe,Dt,Ke),Ot(se.uponSanitizeElement,y,{tagName:L,allowedTags:xe}),ko(y,x))return!0;if(TE(y,L,z))return mr(y),!0;if(V[L]||!(J.tagCheck instanceof Function&&J.tagCheck(L))&&!xe[L]){const Y=ME(y,L,x);return Y===!1&&(Ot(se.afterSanitizeElements,y,null),ko(y,x))?!0:Y}if(z===Ie.element&&!yE(y)||(L==="noscript"||L==="noembed"||L==="noframes")&&Ve(Ww,y.innerHTML))return mr(y),!0;if(ie&&z===Ie.text){const Y=y.textContent,re=Sp(Y);Y!==re&&(un(t.removed,{element:y.cloneNode()}),y.textContent=re)}return Ot(se.afterSanitizeElements,y,null),ko(y,x)},Og=function(y,x,L){if(j[x]||Cg(x,y)||At&&(x==="id"||x==="name")&&(L in r||L in mE))return!1;const z=C[x]||J.attributeCheck instanceof Function&&J.attributeCheck(x,y);if(T&&Ve(Ee,x)||pe&&Ve(ho,x))return!0;if(!z)return Rg(y)&&Ea(U.tagNameCheck,y)&&Ea(U.attributeNameCheck,x,y)||x==="is"&&U.allowCustomizedBuiltInElements&&Ea(U.tagNameCheck,L);if(Ue[x])return!0;const Y=sa(L,wn,"");return Ve(mo,Y)||(x==="src"||x==="xlink:href"||x==="href")&&y!=="script"&&Fl(L,"data:")===0&&hr[y]||X&&!Ve(vn,Y)?!0:!L},_E=be({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Rg=function(y){return!_E[Br(y)]&&Ve(xn,y)},DE=function(y,x,L,z){if(S&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!L)switch(d.getAttributeType(y,x)){case"TrustedHTML":return ne(z);case"TrustedScriptURL":return Pe(z)}return z},AE=function(y,x,L,z){try{return L?y.setAttributeNS(L,x,z):y.setAttribute(x,z),Pa(y)?(mr(y),!1):!0}catch{return go(x,y),!1}},Ig=function(y,x){return ce&&Ve(Vw,x)?!0:Br(y)==="attributename"&&Fl(x,"href")!==-1},OE=function(y,x){if(Ot(se.beforeSanitizeAttributes,y,null),ko(y,x))return;const L=y.attributes;if(!L||Pa(y))return;C=Ag(se.uponSanitizeAttribute,C,q,ot);const z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0};let Y=L.length;const re=Be(R(y));for(;Y--;){const de=L[Y],qe=de.name,Qt=de.namespaceURI,Rt=de.value,mt=Be(qe),jt=Rt;let Ye=qe==="value"?jt:Sw(jt),Lg=!1;if(z.attrName=mt,z.attrValue=Ye,z.keepAttr=!0,z.forceKeepAttr=void 0,Ot(se.uponSanitizeAttribute,y,z),Ye=z.attrValue,Hr&&(mt==="id"||mt==="name")&&Fl(Ye,ut)!==0&&(go(qe,y,de),Ye=ut+Ye,Lg=!0),Ig(qe,Ye)){go(qe,y,de);continue}if(!z.forceKeepAttr){if(!z.keepAttr){go(qe,y,de);continue}if(!ee&&Ve(ym,Ye)){go(qe,y,de);continue}if(ie&&(Ye=Sp(Ye)),!Og(re,mt,Ye)){go(qe,y,de);continue}Ye=DE(re,mt,Qt,Ye),Ye!==jt&&AE(y,qe,Qt,Ye)&&Lg&&pm(t.removed)}}Ot(se.afterSanitizeAttributes,y,null),ko(y,x)},Cp=function(y,x){CE(y,x),OE(y,x),bo(y.content)&&_p(y.content)},_p=function(y){let x=null;const L=xa(y);for(Ot(se.beforeSanitizeShadowDOM,y,null);x=L.nextNode();)if(Ot(se.uponSanitizeShadowNode,x,null),Cp(x,y),A(x)===Ie.element){const z=w(x);bo(z)&&(Dp(z),_p(z))}ie&&Mp(y),Ot(se.afterSanitizeShadowDOM,y,null)},Dp=function(y){const x=[{node:y,shadow:null}];for(;x.length>0;){const L=x.pop();if(L.shadow){_p(L.shadow);continue}const z=L.node,Y=A(z)===Ie.element,re=k(z);if(re)for(let de=re.length-1;de>=0;--de)x.push({node:re[de],shadow:null});if(Y){const de=D?D(z):null;if(typeof de=="string"&&Be(de)==="template"){const qe=z.content;bo(qe)&&x.push({node:qe,shadow:null})}}if(Y){const de=w(z);bo(de)&&x.push({node:null,shadow:de},{node:de,shadow:null})}}};return t.sanitize=function(B){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,L=null,z=null,Y=null;if(ht=!B,ht&&(B="<!-->"),typeof B!="string"&&!Sn(B)&&(B=Dw(B),typeof B!="string"))throw Gt("dirty is not a string, aborting");if(!t.isSupported)return B;Le?(xe=Ke,C=ot):yp(y),t.removed=[];const re=qt&&typeof B!="string"&&Sn(B);let de=[];const qe=xt;if(re){SE(B);const jt=R(B);if(typeof jt=="string"){const Ye=Be(jt);if(!xe[Ye]||V[Ye])throw vp(B),Gt("root node is forbidden and cannot be sanitized in-place")}if(Pa(B))throw vp(B),Gt("root node is clobbered and cannot be sanitized in-place");de=Ep(B),xt=Ll()}else if(Sn(B))x=_g("<!---->"),L=x.ownerDocument.importNode(B,!0),L.nodeType===Ie.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?x=L:x.appendChild(L),Dp(x);else{if(!ct&&!ie&&!Te&&B.indexOf("<")===-1)return Se(B);if(x=_g(B),!x)return ct?null:De?N:""}x&&He&&mr(x.firstChild);const Qt=re?B:x;try{re&&Dp(B);const jt=xa(Qt);for(;z=jt.nextNode();)Cp(z,Qt);re&&xE(B,de)}catch(jt){throw re&&(vp(B),Mg(B,de)),jt}finally{xt=qe}if(re){if(Mg(B,de))throw Gt("a node selected for removal could not be safely returned; refusing to sanitize in place");return ie&&Tp(B),B}if(ct){if(ie&&Tp(x),Ce)for(Y=ke.call(x.ownerDocument);x.firstChild;)Y.appendChild(x.firstChild);else Y=x;return(C.shadowroot||C.shadowrootmode)&&(Y=Me.call(o,Y,!0)),Y}const Rt=()=>Te?x.outerHTML:x.innerHTML;let mt=Rt();return ie&&Ve(Fw,mt)&&(Mp(x),mt=Rt()),Te&&xe["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&Ve(qw,x.ownerDocument.doctype.name)&&(mt="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
296
- `+mt),Se(mt)},t.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yp(B),Le=!0,Ke=xe,ot=C},t.clearConfig=function(){wa=null,Le=!1,Ke=null,ot=null,S=F,N=""},t.isValidAttribute=function(B,y,x){wa||yp({});const L=Be(B),z=Be(y);return typeof x=="string"&&(Ig(y,x)||!ee&&Ve(ym,x))?!1:Og(L,z,x)},t.addHook=function(B,y){typeof y=="function"&&Ze(se,B)&&un(se[B],y)},t.removeHook=function(B,y){if(Ze(se,B)){if(y!==void 0){const x=ww(se[B],y);return x===-1?void 0:Pw(se[B],x,1)[0]}return pm(se[B])}},t.removeHooks=function(B){Ze(se,B)&&(se[B]=[])},t.removeAllHooks=function(){se=vm()},t}var Zw=wm();const Jw={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Qw(e,t){const r=e.options;return Us(r.formatter,t,String(r.testData||r.title||""))||"1234567890128"}function ex(e){return g("div",{class:"print-qrcode",dataset:{codeId:e.id,codeKind:"qrcode"}})}function tx(e){const t=e.options;return g("div",{class:"print-barcode",dataset:{codeId:e.id,codeKind:"barcode"}},[g("svg",{preserveAspectRatio:Jw[String(t.fit||"contain")]??"xMidYMid meet",style:{maxWidth:"100%",maxHeight:"100%"}})])}function rx(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(r=>!Number.isFinite(r))?null:{width:t[2],height:t[3]}}function ox(e,t,r){const o=e.options,n=Do(o.barWidth),i=qa(o.barQuietZone),a=s=>{js(t,Qw(e,r),{format:String(o.barcodeType||"CODE128"),width:n,height:s*n,displayValue:!o.hideTitle,fontSize:(o.fontSize??Nn)*n,margin:0,marginLeft:i*n,marginRight:i*n,marginTop:0,marginBottom:ja*n});const p=rx(t);return p?{widthUnits:p.width,heightUnits:p.height}:null};try{const s=Va({barHeightMm:o.barHeight,boxWidthMm:Kr(o.width,o.maxWidth),boxHeightMm:Kr(o.height,o.maxHeight),dpi:o.printerDpi,barWidth:o.barWidth,measure:a});t.style.width=s.size?`${s.size.widthMm}mm`:"",t.style.height=s.size?`${s.size.heightMm}mm`:""}catch{t.replaceChildren();return}t.setAttribute("shape-rendering","crispEdges")}function nx(e,t,r){const o=e.options,n=Us(o.formatter,r,String(o.testData||o.title||""))||oe("code.k27");t.replaceChildren();try{const i=ml.render(n,"qrcode",{qrCodeLevel:String(o.qrCodeLevel??"M"),qrQuietZone:typeof o.qrQuietZone=="number"?o.qrQuietZone:void 0}),a=document.createElement("img");a.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`,a.alt="qrcode",a.style.width="100%",a.style.height="100%",a.style.objectFit=String(o.fit||"contain"),a.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",a.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",t.appendChild(a)}catch{}}function ix(e,t,r){for(const o of Array.from(e.querySelectorAll("[data-code-kind]"))){const n=o.dataset.codeId,i=t.find(a=>a.id===n);if(i)if(o.dataset.codeKind==="barcode"){const a=o.querySelector("svg");a&&ox(i,a,r)}else nx(i,o,r)}}const da=new Map;function ax(e){return typeof Node<"u"&&e instanceof Node}function xm(e,t,r){if(Pm(e),typeof t=="string"){r.innerHTML=t;return}if(ax(t)){r.appendChild(t);return}typeof t.node=="string"?r.innerHTML=t.node:r.appendChild(t.node),typeof t.dispose=="function"&&da.set(e,t.dispose)}function Pm(e){const t=da.get(e);if(t){da.delete(e);try{t()}catch{}}}function Em(){for(const e of[...da.keys()])Pm(e)}const sx={header:"table.k450",data:"table.k451",subtotal:"table.k452",summary:"table.k453"},lx=[{value:"header",labelKey:"table.k454"},{value:"data",labelKey:"table.k455"},{value:"subtotal",labelKey:"table.k456"},{value:"summary",labelKey:"table.k457"}],ca=3.7795275591,px=.1,Wl=e=>JSON.parse(JSON.stringify(e)),Sm=new WeakMap;function Kt(e){let t=Sm.get(e);return t||(t={menu:null,menuElId:null,anchor:null,layouts:new Map},Sm.set(e,t)),t}function gn(e,t){return e.templateData.elements.find(r=>r.id===t)??null}function dx(e,t){const r=e.tableSelection;return!r||r.elementId!==t.id?null:e.selectedElement?.id!==t.id?(e.tableSelection=null,null):r}function Tm(e,t,r,o){const n=gn(e,r.id);if(!n)return null;const i=r.options;return{store:e,fire:t,el:r,real:n,options:i,rows:i.tableRows??[],colWidths:i.tableColWidths??[],isSelected:e.selectedIds.has(r.id),selection:dx(e,r),maxTableWidth:Mm(e),designData:o}}function Mm(e){return e.paperSize.width-e.templateData.margins.left-e.templateData.margins.right}function Vl(e){return e.options.tableDefaultFontSize??10}function Cm(e){return e.options.tableDefaultColor??"#333333"}function cx(e,t){let r=0;for(let o=0;o<t;o++)r+=e.rows[o].height;return r}function ux(e,t){return Kt(e.store).layouts.get(e.el.id)?.[t]?.top??cx(e,t)}function fx(e,t){return Kt(e.store).layouts.get(e.el.id)?.[t]?.height??e.rows[t]?.height??0}function hx(e){const t=e.options.dataSource;if(t&&Array.isArray(vt[t]))return vt[t];for(const r of Object.values(vt))if(Array.isArray(r))return r}function _m(e){return e.cellType==="barcode"||e.cellType==="qrcode"}function Dm(e,t){return _m(t)?Us(t.formatter,hx(e)):t.formatter||""}function mx(e,t){const r={designMode:!0,showGhostBorder:e.store.showTableGhostBorder};return{fontFamily:Ts(t.fontFamily??e.options.tableDefaultFontFamily),textAlign:t.align??"left",...t.align==="justify"?{textAlignLast:"justify"}:{},verticalAlign:t.valign??"middle",fontSize:(t.fontSize??Vl(e))+"pt",fontWeight:t.fontWeight??"normal",color:t.color??Cm(e),backgroundColor:t.backgroundColor??"transparent",borderTop:Rn(t.borders?.top,r),borderRight:Rn(t.borders?.right,r),borderBottom:Rn(t.borders?.bottom,r),borderLeft:Rn(t.borders?.left,r),padding:(t.padding??e.options.tableDefaultPadding??1)+"mm",whiteSpace:t.wordWrap??!0?"pre-wrap":"nowrap",overflow:t.wordWrap??!0?"visible":"hidden"}}function gx(e,t,r){const o=e.selection;return[!!o&&t>=o.r1&&t<=o.r2&&r>=o.c1&&r<=o.c2?"cell-selected":"",e.rows[t]?.type==="data"?"row-data-bg":""].filter(Boolean).join(" ")}function Am(e){return Fa(e)}function bx(e){return Am(e)!=="autoHeight"}function kx(e,t){return t.fontSize??Vl(e)}function ua(e,t,r){return Co(e.rows,t,r,e.options.tableDefaultPadding??1)}function yx(e,t,r){return za(e.colWidths,t,r,e.options.tableDefaultPadding??1)}function vx(e,t,r){return{maxHeight:ua(e,r,t)+"mm",overflow:"hidden",...t.wordWrap===!1?{whiteSpace:"nowrap",textOverflow:"ellipsis"}:{}}}function wx(e,t,r){const o={fitBase:String(kx(e,t)),fitMin:String(Mo(t.shrinkMinFontSize)),fitMm:String(ua(e,r,t))};return Am(t)==="shrink"&&(o.fit="shrink"),o}function xx(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(r=>!Number.isFinite(r))?null:{width:t[2],height:t[3]}}const Px={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Ex(e,t,r,o){const n=document.createElement("div");n.className="cell-barcode";const i=document.createElementNS(N2,"svg");n.appendChild(i);const a=Dm(e,o);if(o.cellType==="barcode"){i.setAttribute("preserveAspectRatio",Px[o.fit||"contain"]??"xMidYMid meet");const s=Do(o.barWidth),p=qa(o.barQuietZone),l=c=>{js(i,a,{format:o.barcodeType||"CODE128",width:s,height:c*s,displayValue:o.showBarcodeText!==!1,fontSize:(o.barFontSize??Nn)*s,margin:0,marginLeft:p*s,marginRight:p*s,marginTop:0,marginBottom:ja*s});const f=xx(i);return f?{widthUnits:f.width,heightUnits:f.height}:null};let d=null;try{d=Va({barHeightMm:o.barHeight,boxWidthMm:Kr(yx(e,r,o),o.maxWidth),boxHeightMm:Kr(ua(e,t,o),o.maxHeight),dpi:o.printerDpi,barWidth:o.barWidth,measure:l})}catch{d=null}if(!d){i.style.display="none";const c=document.createElement("span");return c.className="cell-barcode-fallback",c.textContent=a||m(e,"table.k458"),n.appendChild(c),n}const u=d.size;return u?(i.style.width=`${u.widthMm}mm`,i.style.height=`${u.heightMm}mm`):(i.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",i.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%"),i.setAttribute("shape-rendering","crispEdges"),n}if(i.style.display="none",!a)return n;try{const s=ml.render(a,"qrcode",{qrCodeLevel:String(o.qrCodeLevel||"M"),qrQuietZone:typeof o.qrQuietZone=="number"?o.qrQuietZone:void 0}),p=document.createElement("img");p.setAttribute("src",`data:image/svg+xml;charset=utf-8,${encodeURIComponent(s)}`),p.setAttribute("alt","qrcode"),p.style.width="100%",p.style.height="100%",p.style.objectFit=o.fit||"contain",o.objectPosition&&(p.style.objectPosition=o.objectPosition),p.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",p.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",n.appendChild(p)}catch{}return n}function Om(){const e=document.createElement("div");return e.className="image-placeholder",e.textContent=oe("table.k459"),e}function Sx(e,t){const r=e.formatter||"";if(!r)return"";if(!r.includes("{"))return r;const o=t.designData?.length?t.designData[0]:vt;return to(r,o)}function Tx(e,t,r){const o=document.createElement("div");o.className="cell-image";const n=kd(r.fit,ua(e,t,r));n!==void 0&&(o.style.height=`${n}mm`);const i=Sx(r,e);if(!i)return o.appendChild(Om()),o;const a=document.createElement("img");a.setAttribute("src",i),n!==void 0&&(a.style.width="100%",a.style.height="100%"),a.style.objectFit=r.fit||"contain";for(const[s,p]of Object.entries(Ga(r.fit,r.fitScale,r.objectPosition)))a.style[s]=p;return a.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",a.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%",a.addEventListener("error",()=>{a.remove(),o.appendChild(Om())},{once:!0}),o.appendChild(a),o}function Mx(e,t,r,o,n){if(_m(n))return Ex(e,r,o,n);if(n.cellType==="image")return Tx(e,r,n);const i=Dm(e,n),a=()=>t.type==="data"?g("span",{class:"data-placeholder",text:i}):i;return bx(n)?g("div",{class:"cell-fit",style:vx(e,n,r),dataset:wx(e,n,r)},[a()]):a()}function fa(e,t,r){const o={elementId:e.el.id,...Jp(e.rows,t,r)};e.store.setTableSelection(o),e.fire("table-selection-change",{elementId:e.el.id,selection:o})}function Cx(e,t,r,o,n){if(n.button!==0||(e.fire("table-cell-mousedown",{elementId:e.el.id,r:t,c:r,cellId:o,event:n}),!e.isSelected))return;n.stopPropagation();const i=Kt(e.store);n.shiftKey&&e.selection?fa(e,{r:e.selection.r1,c:e.selection.c1},{r:t,c:r}):(i.anchor={r:t,c:r},fa(e,{r:t,c:r},{r:t,c:r})),document.addEventListener("mouseup",()=>{Kt(e.store).anchor=null},{once:!0})}function _x(e,t,r){const o=Kt(e.store).anchor;o&&fa(e,o,{r:t,c:r})}function Gl(e,t){const r=Kt(e);r.menu?.visible&&(r.menu.visible=!1,t("table-menu-close",{elementId:r.menuElId}),e.emit(!1))}function Dx(e,t,r,o){o.preventDefault(),o.stopPropagation(),e.isSelected||e.store.selectOne(e.el.id);const n=e.selection;n&&t>=n.r1&&t<=n.r2&&r>=n.c1&&r<=n.c2||fa(e,{r:t,c:r},{r:t,c:r});const a=Kt(e.store);a.menuElId=e.el.id,a.menu&&(a.menu.x=o.clientX,a.menu.y=o.clientY,a.menu.visible=!0),e.fire("table-cell-contextmenu",{elementId:e.el.id,r:t,c:r,clientX:o.clientX,clientY:o.clientY}),e.store.emit(!1),document.addEventListener("mousedown",()=>Gl(e.store,e.fire),{once:!0})}function Rm(e,t,r){const o=e.reduce((n,i)=>n+i,0)+(e[t]??0);return o>r?oe("table.k460",{v0:Math.round(o*10)/10,v1:r}):null}function Ax(e,t){const r=e.real.options.tableRows??[],o=e.real.options.tableColWidths??[],n=t(Wl(r),Wl(o));return n?(window.alert(n),!1):(e.store.recordHistory(),t(r,o),e.store.setTableSelection(null),Eo(e.real.options),e.store.emit(),!0)}function Yt(e,t,r){Gl(e.store,e.fire);const o=e.selection;if(!o)return;let n=null;switch(t){case"insert-row-above":n=i=>(rd(i,o.r1,"above"),null);break;case"insert-row-below":n=i=>(rd(i,o.r2,"below"),null);break;case"delete-row":n=i=>Sb(i,o.r1);break;case"insert-col-left":n=(i,a)=>{const s=Rm(a,o.c1,e.maxTableWidth);return s||(od(i,a,o.c1,"left"),null)};break;case"insert-col-right":n=(i,a)=>{const s=Rm(a,o.c2,e.maxTableWidth);return s||(od(i,a,o.c2,"right"),null)};break;case"delete-col":n=(i,a)=>Tb(i,a,o.c1);break;case"merge":n=i=>(ed(i,o),null);break;case"split":n=i=>(td(i,o),null);break;case"set-row-type":n=i=>r?Ia(i,o.r1,r):m(e,"table.k461");break}n&&Ax(e,n)&&e.fire(`table-${t}`,{elementId:e.el.id,...r?{type:r}:{}})}function Ox(e){const t=e.selection;if(!t)return!1;for(let r=t.r1;r<=t.r2;r++)for(let o=t.c1;o<=t.c2;o++){const n=e.rows[r]?.cells[o];if(n&&!n.merged&&((n.rowspan??1)>1||(n.colspan??1)>1))return!0}return!1}function Rx(e){const t=e.selection;if(!t)return;const r=Po(e.rows,t.r1,t.c1),o=!e.rows[r.r]?.cells[r.c]?.mergeSameValue;for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=e.rows[n]?.cells[i];a&&!a.merged&&(a.mergeSameValue=o)}e.store.updateElement(e.el.id,{tableRows:e.rows}),Gl(e.store,e.fire)}function Im(e){const t=e.selection;if(!t)return m(e,"table.k462");for(let r=t.r1;r<=t.r2;r++)if(e.rows[r]?.type!=="data")return m(e,"table.k463");return null}function Lm(e,t){const r=e.selection;return r?r.r1!==r.r2?m(e,"table.k465"):Ia(Wl(e.rows),r.r1,t):m(e,"table.k464")}function zt(e,t,r={}){return g("div",{class:`menu-item${r.disabled?" disabled":""}${r.active?" active":""}`,title:r.title||"",text:e,onClick:()=>{r.disabled||t()}})}const Kl=()=>g("div",{class:"menu-divider"});function Ix(e,t,r){const o=Kt(e);if(o.menu=r,!r.visible||!o.menuElId)return"";const n=gn(e,o.menuElId);if(!n||n.printElementType.type!=="table")return"";const i=Tm(e,t,n);if(!i)return"";const a=i.selection?Qp(i.rows,i.selection):m(i,"table.k466"),s=i.selection?i.rows[i.selection.r1]?.type??null:null;return g("div",{class:"table-ctx-menu",style:{left:r.x+"px",top:r.y+"px"},onMousedown:p=>p.stopPropagation()},[zt(m(i,"table.k467"),()=>Yt(i,"insert-row-above")),zt(m(i,"table.k468"),()=>Yt(i,"insert-row-below")),zt(m(i,"table.k469"),()=>Yt(i,"delete-row"),{disabled:i.rows.length<=1}),Kl(),zt(m(i,"table.k470"),()=>Yt(i,"insert-col-left")),zt(m(i,"table.k471"),()=>Yt(i,"insert-col-right")),zt(m(i,"table.k472"),()=>Yt(i,"delete-col"),{disabled:i.colWidths.length<=1}),Kl(),zt(m(i,"table.k473"),()=>Yt(i,"merge"),{disabled:!!a,title:a||""}),zt(m(i,"table.k474"),()=>Yt(i,"split"),{disabled:!Ox(i)}),zt(m(i,"table.k475"),()=>Rx(i),{disabled:!!Im(i),title:Im(i)||"",active:(()=>{const p=i.selection;if(!p)return!1;const l=Po(i.rows,p.r1,p.c1);return i.rows[l.r]?.cells[l.c]?.mergeSameValue===!0})()}),Kl(),g("div",{class:"menu-group-title",text:m(i,"table.k476")}),...lx.map(p=>zt(oe(p.labelKey),()=>Yt(i,"set-row-type",p.value),{disabled:!!Lm(i,p.value),title:Lm(i,p.value)||"",active:s===p.value}))])}let Nr=null;function Bm(){Nr&&(document.removeEventListener("mousemove",Yl),document.removeEventListener("mouseup",Xl),Nr.handle.classList.remove("dragging"),Nr=null)}function Lx(e,t){const r=e.closest(".hiprint-printPaper");return(r&&r.offsetWidth>0?r.getBoundingClientRect().width/r.offsetWidth:0)||(t.scale||100)/100}function Bx(e,t,r){if(r.button!==0)return;const o=r.currentTarget,n=o.closest(".print-table");if(!n)return;Bm();const i=e.real.options.tableColWidths??[];Nr={store:e.store,fire:e.fire,elId:e.real.id,boundary:t,startX:r.clientX,startWidth:i[t-1]??0,scale:Lx(n,e.store),root:n,wrapper:o.closest(".print-element"),handle:o},o.classList.add("dragging"),e.store.recordHistory(),document.addEventListener("mousemove",Yl),document.addEventListener("mouseup",Xl)}function Yl(e){const t=Nr;if(!t)return;const r=gn(t.store,t.elId),o=r?.options.tableColWidths;if(!r||!o)return;const n=(e.clientX-t.startX)/(t.scale*ca),i=t.boundary-1;o[i]=Rb(o,i,t.startWidth+n,Mm(t.store)),Eo(r.options),o.forEach((a,s)=>{const p=t.root.querySelector(`colgroup col:nth-child(${s+1})`);p&&(p.style.width=`${a}mm`)}),t.root.querySelectorAll(".col-resize-handle").forEach((a,s)=>{a.style.left=`${o.slice(0,s+1).reduce((p,l)=>p+l,0)}mm`}),t.wrapper&&(t.wrapper.style.width=`${r.options.width}mm`,t.wrapper.style.height=`${r.options.height}mm`)}function Xl(){document.removeEventListener("mousemove",Yl),document.removeEventListener("mouseup",Xl);const e=Nr;if(!e)return;Nr=null,e.handle.classList.remove("dragging");const t=gn(e.store,e.elId);t&&Eo(t.options),e.store.emit(),e.fire("table-col-resize-end",{elementId:e.elId})}function Nx(e,t,r){const o=r.querySelector("table");if(!o)return;const n=o.offsetHeight;if(n<=0)return;const i=gn(e,t);if(!i)return;let a=!1;const s=n/ca;Math.abs(s-(i.options.height??0))>px&&(i.options.height=Math.round(s*100)/100,a=!0);const p=o.offsetTop,l=Array.from(o.rows).map(u=>({top:(u.offsetTop-p)/ca,height:u.offsetHeight/ca})),d=Kt(e);Fx(d.layouts.get(t),l)||(d.layouts.set(t,l),a=!0),a&&e.emit(!1)}function Fx(e,t){return!e||e.length!==t.length?!1:t.every((r,o)=>{const n=e[o];return Math.round(r.top*10)===Math.round(n.top*10)&&Math.round(r.height*10)===Math.round(n.height*10)})}function $x(e,t){const r=document.createComment("pd-table-measure");return requestAnimationFrame(()=>{if(!r.isConnected)return;const o=r.parentElement;o&&Nx(e,t,o)}),r}function zx(e){return e.isSelected&&!e.real.options.locked&&e.colWidths.length>=1}function Hx(e){return Array.from({length:e.colWidths.length},(t,r)=>r+1)}function Ux(e,t){return e.colWidths.slice(0,t).reduce((r,o)=>r+o,0)}function qx(e,t,r,o){const n=Tm(t,r,e,o);if(!n)return g("div",{class:"print-table"});const i=[g("table",{style:{fontSize:`${Vl(n)}pt`,color:Cm(n)}},[g("colgroup",{},n.colWidths.map(a=>g("col",{style:{width:a+"mm"}}))),g("tbody",{},n.rows.map((a,s)=>g("tr",{style:{height:a.height+"mm"}},a.cells.map((p,l)=>p.merged?"":g("td",{rowspan:p.rowspan||1,colspan:p.colspan||1,class:gx(n,s,l),style:mx(n,p),onMousedown:d=>Cx(n,s,l,p.id,d),onMouseenter:()=>_x(n,s,l),onContextmenu:d=>Dx(n,s,l,d)},[Mx(n,a,s,l,p)])).filter(Boolean))))])];return zx(n)&&i.push(g("div",{class:"col-resize-layer"},Hx(n).map(a=>g("div",{class:"col-resize-handle",role:"separator","aria-label":m(n,"table.k477",{v0:a}),style:{left:Ux(n,a)+"mm"},onMousedown:s=>{s.stopPropagation(),s.preventDefault(),Bx(n,a,s)}})))),n.isSelected&&i.push(g("div",{class:"row-badges"},n.rows.map((a,s)=>g("span",{class:"row-badge",style:{top:ux(n,s)+"mm",height:fx(n,s)+"mm"},text:oe(sx[a.type])})))),i.push($x(t,e.id)),g("div",{class:"print-table design-mode",dataset:{tableId:e.id},onContextmenu:a=>a.preventDefault()},i)}const jx=["flowList.k44","flowList.k45","flowList.k46","flowList.k47","flowList.k48","flowList.k49","flowList.k50"];function Wx(){return jx.map(e=>oe(e))}function Zl(e){return Array.isArray(e)&&e.length>0?e:[]}function Vx(e,t){const r=Bn(e,t)??(t?Object.keys(t).find(n=>Array.isArray(t[n])):void 0);if(r)return Zl(t?.[r]);const o=Bn(e,vt);return o?Zl(vt[o]):[]}function Gx(e,t){const r=e.options,o=typeof r.formatter=="string"?r.formatter:"",n=Zl(t)[0],i=Vx(o,n);if(i.length===0)return Wx();if(!o)return i.map(p=>String(p?.name??JSON.stringify(p)));const a=n??{},s=Bn(o,a)??Object.keys(a).find(p=>Array.isArray(a[p]));return i.map(p=>{try{return to(o,{...a,...p,...s?{[s]:p}:{}})}catch{return o}})}const Kx=3.7795275591,Yx=.1;function Xx(e,t){return e.templateData.elements.find(r=>r.id===t)??null}function Zx(e){const t=e.parentElement;if(!t?.classList.contains("print-element"))return 0;const r=getComputedStyle(t);return(parseFloat(r.borderTopWidth)||0)+(parseFloat(r.borderBottomWidth)||0)}function Jx(e,t,r){const o=r.offsetHeight+Zx(r);if(o<=0)return;const n=Xx(e,t);if(!n)return;const i=o/Kx;Math.abs(i-(n.options.height??0))>Yx&&(n.options.height=Math.round(i*100)/100,e.emit(!1))}function Qx(e,t){const r=document.createComment("pd-flowlist-measure");return requestAnimationFrame(()=>{if(!r.isConnected)return;const o=r.parentElement;o&&Jx(e,t,o)}),r}function eP(e,t,r){const o=e.options,n=bt(o.flowColumns),i=Et(o.flowGapX),a=or(o.flowRowHeight),s=wr(o.flowLayoutMode)==="dynamic",p=Gr(o),l={display:"grid",gridTemplateColumns:`repeat(${n},minmax(0,1fr))`,columnGap:`${i}mm`,gridAutoRows:`minmax(${a}mm,auto)`,width:"100%",...s?{padding:`${p.top}mm ${p.right}mm ${p.bottom}mm ${p.left}mm`,height:"auto",overflow:"visible"}:{height:"100%",overflow:"hidden"},fontSize:`${o.fontSize||12}pt`,fontWeight:o.fontWeight||"normal",color:o.color||"#333",boxSizing:"border-box"};o.fontFamily&&(l.fontFamily=String(o.fontFamily)),o.backgroundColor&&(l.backgroundColor=String(o.backgroundColor));const d=Gx(e,t).map(u=>g("div",{class:"print-flow-cell",text:u}));return s&&r&&d.push(Qx(r,e.id)),g("div",{class:"print-flowlist",style:l},d)}const Nm={top:"flex-start",middle:"center",bottom:"flex-end"},tP={left:"flex-start",center:"center",right:"flex-end"};function rP(e,t){const r=e.options,o=kt(r),n=zn(e.printElementType.type,r),i={};if(n?.all&&(i.border=`${n.all.borderWidth} ${n.all.borderStyle} ${n.all.borderColor}`),n)for(const a of Ao){const s=n.edges[a];s&&(i[`border${a.charAt(0).toUpperCase()}${a.slice(1)}`]=`${s.borderWidth} ${s.borderStyle} ${s.borderColor}`)}return{position:"absolute",left:`${r.left}mm`,top:`${r.top}mm`,width:`${r.width}mm`,height:`${r.height}mm`,...o.top!==0?{marginTop:`${o.top}mm`}:{},...o.right!==0?{marginRight:`${o.right}mm`}:{},...o.bottom!==0?{marginBottom:`${o.bottom}mm`}:{},...o.left!==0?{marginLeft:`${o.left}mm`}:{},zIndex:String(r.zIndex||"auto"),...i,...oP(e,t)}}function oP(e,t){if(t?.has(e.id))return{};const r=Ka(e.printElementType.type,e.options);return r===void 0?{}:{rotate:`${r}deg`}}function Fm(e){const t=e.options,r=e.printElementType.type==="longText",o=Ln(e.printElementType.type,t),n=t.fontSize||12,i=o==="autoHeight",a={fontSize:`${n}pt`,fontWeight:t.fontWeight||"normal",fontFamily:Ts(t.fontFamily),color:t.color||"#333",backgroundColor:t.backgroundColor||"transparent",textAlign:t.textAlign||"left",...t.textAlign==="justify"?{textAlignLast:"justify"}:{},lineHeight:t.lineHeight?`${t.lineHeight}pt`:r?"1.5":"normal",letterSpacing:t.letterSpacing?`${t.letterSpacing}pt`:"normal",width:"100%",height:i?"auto":"100%",boxSizing:"border-box",overflow:i?"visible":"hidden",...r?{wordBreak:"break-all",textIndent:t.longTextIndent?`${t.longTextIndent}em`:"0"}:{textDecoration:t.textDecoration||"none",padding:`${t.contentPaddingTop||0}pt ${t.contentPaddingRight||0}pt ${t.contentPaddingBottom||0}pt ${t.contentPaddingLeft||0}pt`}};bd(t)&&(a.whiteSpace="nowrap",a.textOverflow="ellipsis");const s=gd(t);return s&&(a.whiteSpace=s),t.verticalAlign&&(a.display="flex",t.textAlign==="justify"?(a.flexDirection="column",a.justifyContent=Nm[t.verticalAlign]??"flex-start"):(a.alignItems=Nm[t.verticalAlign]??"flex-start",a.justifyContent=tP[t.textAlign||"left"]??"flex-start")),{style:a,fit:o}}function $m(e){const t=e.options,r=`${t.borderWidth||.75}pt`,o=t.borderStyle||"solid",n=t.borderColor||"#333";return e.printElementType.type==="hline"?{width:"100%",height:"0",borderTop:`${r} ${o} ${n}`,boxSizing:"border-box"}:{width:"0",height:"100%",borderLeft:`${r} ${o} ${n}`,boxSizing:"border-box"}}function zm(e){const t=e.options;return{width:"100%",height:"100%",borderWidth:`${t.borderWidth||1}pt`,borderStyle:t.borderStyle||"solid",borderColor:t.borderColor||"#333",backgroundColor:t.backgroundColor||"transparent",borderRadius:e.printElementType.type==="oval"?"50%":"0",boxSizing:"border-box"}}function nP(e){const t=e.options;return{objectFit:t.fit||"contain",...Ga(t.fit,t.fitScale,t.objectPosition),maxWidth:t.maxWidth?`${t.maxWidth}mm`:"100%",maxHeight:t.maxHeight?`${t.maxHeight}mm`:"100%"}}function Hm(e){const t=e.options,r={fitBase:String(t.fontSize||12),fitMin:String(Mo(t.shrinkMinFontSize))};return Ln(e.printElementType.type,t)==="shrink"&&(r.fit="shrink"),r}Wh({text:e=>{const{style:t}=Fm(e),r=e.options;return g("div",{class:"print-text",style:t,dataset:Hm(e),text:String(r.testData||r.formatter||"")||oe("elements.k41")})},longText:e=>{const{style:t}=Fm(e),r=e.options;return g("div",{class:"print-longtext",style:t,dataset:Hm(e),text:String(r.formatter||"")||oe("elements.k42")})},hline:e=>g("div",{class:"print-line",style:$m(e)}),vline:e=>g("div",{class:"print-line",style:$m(e)}),rect:e=>g("div",{class:"print-shape",style:zm(e)}),oval:e=>g("div",{class:"print-shape",style:zm(e)}),image:(e,t,r)=>{const o=e.options,n=String(o.src??""),i=r?.designData?.length?r.designData[0]:vt,a=n.includes("{")?to(n,i):n;return g("div",{class:"print-image"},[a?g("img",{src:a,style:nP(e)}):g("div",{class:"image-placeholder",text:oe("elements.k43")})])},qrcode:e=>ex(e),barcode:e=>tx(e),html:e=>{const t=e.options,r=String(t.formatter??""),o=r?Zw.sanitize(to(r,{})):'<div style="background:#e0e0e0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:10pt;color:#999">HTML</div>';return g("div",{class:"print-html",html:o})},pageNumber:(e,t)=>{const r=e.options;return g("div",{class:"page-number-element",style:{fontSize:`${r.fontSize||12}pt`,fontWeight:r.fontWeight||"normal",fontFamily:Ts(r.fontFamily),color:r.color||"#333",textAlign:r.textAlign||"left",...r.textAlign==="justify"?{textAlignLast:"justify"}:{}},text:t?r.title||"{pageIndex}/{totalPages}":String(r.title||"")})},table:(e,t,r)=>r?qx(e,r.store,r.fire,r.designData):g("div",{class:"print-table"}),flowList:(e,t,r)=>eP(e,void 0,r?.store)});function iP(e,t,r){const o=e.printElementType.type,n=dr(o)?.renderContent;if(n)return n(e,t,r);const i=Cl(o);if(!i)return g("div",{text:o});const a=document.createElement("div");a.className="plugin-kit-canvas",a.style.width="100%",a.style.height="100%";try{xm(`canvas:${e.id}`,i.ui.renderCanvas({element:e,data:r?.designData?.length?r.designData:[vt],designMode:!0}),a)}catch{a.textContent=String(o)}return a}function Um(e){return`x:${Math.round(e.left)} y:${Math.round(e.top)} ${Math.round(e.width)}×${Math.round(e.height)}mm`}function aP(e,t,r){const o=e.store,n=o.selectedIds.has(t.id),i=o.previewIds.has(t.id),a=t.options,s=t.zone||"content",p=[iP(t,!0,{store:o,fire:e.fire,designData:e.host.designData})];return o.draggingIds.has(t.id)&&p.push(g("div",{class:"drag-preview"})),n&&(p.push(g("div",{class:"resize-handles"},Iy.map(l=>g("div",{class:`resize-handle handle-${l}`,dataset:{point:l,elId:t.id},onMousedown:d=>e.fire("resize-start",{event:d,id:t.id,point:l})})))),p.push(g("div",{class:"selected-indicator"},[g("div",{class:"position-label",text:Um(a)})]))),g("div",{class:["print-element",`type-${t.printElementType.type}`,`zone-${s}`,n?"selected":"",i?"previewed":"",o.draggingIds.has(t.id)?"drag-ghost":"","design-mode",a.locked?"locked":"",a.visible===!1?"hidden":""].filter(Boolean).join(" "),style:rP(t,r),dataset:{elId:t.id},onMousedown:l=>e.fire("element-mousedown",{event:l,id:t.id}),onContextmenu:l=>{l.preventDefault(),l.stopPropagation(),e.fire("contextmenu",{event:l,id:t.id})}},p)}function Jl(e,t){const r=e.margins,o=e.header?.height??10,n=e.footer?.height??10,i=t.width-r.left-r.right;return{header:{left:r.left,top:r.top,width:i,height:o},content:{left:r.left,top:r.top+o,width:i,height:t.height-r.top-r.bottom-o-n},footer:{left:r.left,top:t.height-r.bottom-n,width:i,height:n}}}const sP='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M0 .5H20M.5 0V20" fill="none" stroke="rgba(0,0,0,0.08)" stroke-width="1" stroke-dasharray="4 4"/></svg>';function qm(e,t){return e.type==="vertical"?{left:`${e.position}mm`,top:"0",height:`${t.height}mm`,borderLeftColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}:{top:`${e.position}mm`,left:"0",width:`${t.width}mm`,borderTopColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}}function lP(e,t){const r=qc(e.watermark,[],t);return r?g("div",{class:"watermark-layer",style:{opacity:String(r.opacity)}},r.tiles.map(o=>g("svg",{class:"watermark-tile",width:`${o.widthMm}mm`,height:`${o.heightMm}mm`,viewBox:`0 0 ${r.tileWidthPx} ${r.tileHeightPx}`,style:{left:`${o.leftMm}mm`,top:`${o.topMm}mm`}},[g("text",{x:String(r.tileWidthPx/2),y:String(r.tileHeightPx/2),"font-size":String(r.fontSizePx),fill:r.color,"text-anchor":"middle","dominant-baseline":"middle",transform:`rotate(${r.rotate},${r.tileWidthPx/2},${r.tileHeightPx/2})`,text:r.text})]))):""}function Ql(e,t,r,o,n,i){const a=e.store,s=[];r!=="content"&&s.push(g("span",{class:"zone-label",text:r==="header"?m(e,"canvas.k11"):m(e,"canvas.k12")}));const p=r==="content"?Fd(n):void 0;if(s.push(...n.map(l=>aP(e,l,p))),r!=="content"){const l=r==="header"?"bottom":"top";s.push(g("div",{class:`zone-resize-handle handle-${l}`,dataset:{zone:r},onMousedown:d=>e.fire("zone-resize",{event:d,zone:r})},[t.zoneResizing===r?g("div",{class:"zone-height-tip",text:`${(r==="header"?a.templateData.header.height:a.templateData.footer.height).toFixed(1)}mm`}):""]))}return g("div",{class:`zone-layer zone-${r} design-mode`,style:{position:"absolute",left:`${o.left}mm`,top:`${o.top}mm`,width:`${o.width}mm`,height:`${o.height}mm`},dataset:{zone:r,paperWidth:String(i.width),paperHeight:String(i.height)}},s.filter(Boolean))}function pP(e){const t=e.currentTarget,r=e.dataTransfer?.types??[],o=r.includes("fieldkey"),n=r.includes("elementtype");if(!o&&!n){t.querySelector(".drop-hint")?.remove();return}o&&(e.ctrlKey||e.metaKey)&&(t.dataset.dropLabelIntent="1");const i=n?oe("canvas.k13"):t.dataset.dropLabelIntent?oe("canvas.k14"):oe("canvas.k15");let a=t.querySelector(".drop-hint");a||(a=document.createElement("div"),a.className="drop-hint",t.appendChild(a)),a.textContent=i,a.style.left=`${e.clientX+14}px`,a.style.top=`${e.clientY+18}px`}function jm(e){e&&(e.querySelector(".drop-hint")?.remove(),delete e.dataset.dropLabelIntent)}function dP(e,t){const r=e.store,o=r.templateData,n=yt(o),i=(r.scale||100)/100,a=Jl(o,n),s=u=>r.elements.filter(c=>(c.zone||"content")===u),p=g("div",{class:"hiprint-printPaper-content",dataset:{content:""},style:{padding:`${o.margins.top}mm ${o.margins.right}mm ${o.margins.bottom}mm ${o.margins.left}mm`,position:"relative",boxSizing:"border-box",minHeight:`${n.height}mm`}},[r.showGrid?g("div",{class:"grid-bg",style:{backgroundImage:`url("data:image/svg+xml,${encodeURIComponent(sP)}")`,backgroundSize:"5mm 5mm",backgroundPosition:"0 0"}}):"",...o.watermark&&Object.keys(o.watermark).length?[lP(o,n)]:[],Ql(e,t,"header",a.header,s("header"),n),Ql(e,t,"content",a.content,s("content"),n),Ql(e,t,"footer",a.footer,s("footer"),n),...r.adsorbGuides.map(u=>g("div",{class:`adsorb-guide guide-${u.type}`,style:qm(u,n)})),...(o.guides??[]).map(u=>g("div",{class:`manual-guide guide-${u.type}`,style:{...qm(u,n),"--guide-hit":`${8/i}px`},dataset:{guideId:String(u.id??"")},onMousedown:c=>e.fire("guide-mousedown",{event:c,id:u.id}),onDblclick:c=>{c.preventDefault(),e.fire("guide-remove",u.id)}}))].filter(Boolean)),l=g("div",{class:"hiprint-printPaper",dataset:{test:"paper"},style:{width:`${n.width}mm`,minHeight:`${n.height}mm`,background:o.pageBackground||"var(--pd-paper, #fff)",boxShadow:"var(--pd-shadow-paper, 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08))",overflow:"hidden",position:"relative",transform:`scale(${i})`,transformOrigin:"0 0"}},[...o.designBackground?.src?[g("div",{class:"design-background",style:{width:`${n.width}mm`,height:`${n.height}mm`,left:"0",top:"0",transform:o.designBackground.rotation?`rotate(${o.designBackground.rotation}deg)`:""}},[g("img",{src:o.designBackground.src,draggable:!1,alt:""})])]:[],p]),d=[g("div",{class:"canvas-scroll"},[g("div",{class:"paper-wrapper",style:{width:`${ai(n.width)*i}px`,height:`${ai(n.height)*i}px`,position:"relative"}},[l])])];if(r.showRuler&&d.push(g("div",{class:"ruler-overlay",style:{transform:`translate(${t.scrollX}px, ${t.scrollY}px)`}},[g("div",{class:"ruler-corner"}),g("canvas",{class:"pd-ruler is-horizontal",dataset:{ruler:"horizontal"},style:{width:`${t.geom.viewW}px`,height:"20px"},onMousedown:u=>e.fire("ruler-mousedown",{event:u,orientation:"horizontal"})}),g("canvas",{class:"pd-ruler is-vertical",dataset:{ruler:"vertical"},style:{width:"20px",height:`${t.geom.viewH}px`},onMousedown:u=>e.fire("ruler-mousedown",{event:u,orientation:"vertical"})})])),t.guidePreview&&d.push(g("div",{class:`ruler-guide-preview guide-${t.guidePreview.type}`,style:t.guidePreview.type==="vertical"?{left:`${t.guidePreview.position}px`,top:"0",height:"100%"}:{top:`${t.guidePreview.position}px`,left:"0",width:"100%"}})),t.marquee.visible&&d.push(g("div",{class:"marquee-selection",style:{left:`${t.marquee.x}px`,top:`${t.marquee.y}px`,width:`${t.marquee.w}px`,height:`${t.marquee.h}px`}})),t.contextMenu.visible){const u=t.contextMenu;d.push(g("div",{class:"context-menu",style:{left:`${t.contextMenu.x+t.contextMenu.flipX}px`,top:`${t.contextMenu.y+t.contextMenu.flipY}px`}},t.contextMenu.targetId?[_t(e,u,m(e,"canvas.k16"),"copy"),_t(e,u,m(e,"canvas.k17"),"cut"),_t(e,u,m(e,"canvas.k18"),"paste",!r.hasClipboard),_t(e,u,m(e,"canvas.k19"),"delete"),g("div",{class:"context-menu-sep"}),_t(e,u,m(e,"canvas.k20"),"move-layer",!1,"top"),_t(e,u,m(e,"canvas.k21"),"move-layer",!1,"up"),_t(e,u,m(e,"canvas.k22"),"move-layer",!1,"down"),_t(e,u,m(e,"canvas.k23"),"move-layer",!1,"bottom")]:[_t(e,u,m(e,"canvas.k24"),"paste-at",!r.hasClipboard),_t(e,u,m(e,"canvas.k25"),"select-all"),_t(e,u,m(e,"canvas.k26"),"clear-selection")]))}return g("div",{class:"canvas-area",dataset:{test:"canvas-area"},onDragover:u=>{const c=u;c.preventDefault(),c.dataTransfer&&(c.dataTransfer.dropEffect="copy"),pP(c)},onDragleave:u=>{const c=u.currentTarget,f=u.relatedTarget;(!f||!c.contains(f))&&c.querySelector(".drop-hint")?.remove()},onDrop:u=>{const c=u,f=u.currentTarget,h=f.dataset.dropLabelIntent==="1";jm(f),h&&(c.labelIntent=!0),e.fire("drop",c)},onMousedown:u=>e.fire("canvas-mousedown",u),onMousemove:u=>e.fire("canvas-mousemove",u),onMouseleave:()=>e.fire("canvas-mouseleave"),onWheel:u=>e.fire("wheel",u),onScroll:u=>e.fire("scroll",u),onContextmenu:u=>{u.preventDefault(),e.fire("canvas-contextmenu",u)}},d.filter(Boolean))}function _t(e,t,r,o,n=!1,i){return g("div",{class:`context-menu-item${n?" disabled":""}`,text:r,onClick:()=>{t.visible=!1,n||e.fire(o,i),e.repaint()}})}function cP(e){const t=window.innerHeight;for(let r=e.parentElement;r&&r!==document.body;r=r.parentElement){const o=getComputedStyle(r).overflowY;if(o==="auto"||o==="scroll"||o==="hidden"||o==="clip"){const n=r.getBoundingClientRect();return{top:Math.max(0,n.top),bottom:Math.min(t,n.bottom)}}}return{top:0,bottom:t}}function ha(e){const t=V1(e.fonts),r=e.placeholder??oe("fontSelect.k51"),o=`font-select-list-${e.id}`,n=R=>{const _=R?.trim();return _?Dc(t,_)?.label??_:""},i=R=>{const _=qo(R);return t.find(S=>S.label&&qo(S.label)===_)?.family??R},a=()=>{const R=e.value?.trim();return R?Dc(t,R)?"":R:""},s=R=>{const _=(e.value??"").trim(),I=(F,H,le,M)=>({kind:F,key:H,label:le,value:M,selected:(M??"")===_}),S=R.trim();if(!S){const F=[I("clear","__clear__",r)],H=a();H&&F.push(I("unknown","__unknown__",oe("fontSelect.k52",{v0:H}),H));for(const le of t)F.push(I("font",le.family,Ac(le),le.family));return F}const N=K1(t,S).map(F=>I("font",F.family,Ac(F),F.family));if(!N.length){const F=i(S);N.push(I("free","__free__",oe("fontSelect.k53",{v0:F}),F))}return N},p=document.createElement("div");p.className="font-select";const l=document.createElement("input");l.className="pd-input font-select-input",l.type="text",l.setAttribute("role","combobox"),l.setAttribute("aria-autocomplete","list"),l.setAttribute("aria-controls",o),l.autocomplete="off",l.placeholder=r,l.disabled=!!e.disabled,l.value=n(e.value);const d=document.createElement("ul");d.id=o,d.className="font-select-list",d.setAttribute("role","listbox");const u=e.state.fontOpen?.id===e.id?e.state.fontOpen:null,c={open:!!u&&!e.disabled,query:u?.query??"",highlighted:u?.highlighted??-1};c.open&&(l.value=c.query);const f=()=>{e.state.fontOpen=c.open?{id:e.id,query:c.query,highlighted:c.highlighted}:null};f();const h=()=>{const R=(e.value??"").trim();return s(c.query).findIndex(_=>(_.value??"")===R)},b=()=>{const R=l.getBoundingClientRect(),_=cP(l);d.classList.toggle("is-up",C0({triggerTop:R.top,triggerBottom:R.bottom,overlayHeight:d.getBoundingClientRect().height,boundaryTop:_.top,boundaryBottom:_.bottom})==="up")},k=()=>{if(!c.open){d.isConnected&&d.remove(),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-activedescendant","");return}d.isConnected||p.appendChild(d);const R=s(c.query);d.replaceChildren(...R.map((_,I)=>{const S=document.createElement("li");return S.id=`${o}-${I}`,S.className="font-select-option"+(I===c.highlighted?" is-active":"")+(_.kind==="unknown"||_.kind==="free"?" is-muted":""),S.setAttribute("role","option"),S.setAttribute("aria-selected",String(_.selected)),S.textContent=_.label,S.addEventListener("mousedown",N=>{N.preventDefault(),O(_)}),S})),l.setAttribute("aria-expanded","true"),l.setAttribute("aria-activedescendant",c.highlighted>=0?`${o}-${c.highlighted}`:""),b()},v=()=>{c.open||e.disabled||(c.open=!0,c.query="",c.highlighted=h(),f(),k())},w=()=>{c.open||v()},P=()=>{c.open=!0,c.query=l.value,c.highlighted=s(c.query).length?0:-1,f(),k()},E=R=>{if(!c.open){v();return}const _=s(c.query).length-1;if(_<0)return;c.highlighted=Math.min(Math.max(c.highlighted+R,0),_),f(),k(),d.children[c.highlighted]?.scrollIntoView?.({block:"nearest"})},D=()=>{if(!c.open)return;const R=s(c.query)[c.highlighted];if(R){O(R);return}const _=c.query.trim();if(_){const I=i(_);O({value:I})}},O=R=>{c.open=!1,c.query="",c.highlighted=-1,f(),l.value=n(R.value),k(),e.onChange(R.value)},A=()=>{c.open&&(c.open=!1,c.query="",c.highlighted=-1,f(),l.value=n(e.value),k())};return l.addEventListener("focus",v),l.addEventListener("click",w),l.addEventListener("input",P),l.addEventListener("blur",A),l.addEventListener("keydown",R=>{const _=R;_.key==="ArrowDown"?(_.preventDefault(),E(1)):_.key==="ArrowUp"?(_.preventDefault(),E(-1)):_.key==="Enter"?(_.preventDefault(),D()):_.key==="Escape"&&(_.preventDefault(),A())}),p.append(l),k(),c.open&&(l.focus(),l.setSelectionRange(c.query.length,c.query.length)),p}const uP=[{key:"solid",labelKey:"formatBar.k54",preview:"1.5px solid currentColor"},{key:"dashed",labelKey:"formatBar.k55",preview:"1.5px dashed currentColor"},{key:"dotted",labelKey:"formatBar.k56",preview:"1.5px dotted currentColor"},{key:"double",labelKey:"formatBar.k57",preview:"3px double currentColor"}],fP={left:"TextAlignStart",center:"TextAlignCenter",right:"TextAlignEnd",justify:"TextAlignJustify"};function fr(e,t,r,o,n={}){return g("button",{type:"button",class:`ft-cell-btn${n.on?" on":""}`,dataset:{test:e,tip:t},disabled:!!n.disabled,onClick:o,html:`<svg viewBox="0 0 18 18" width="18" height="18" aria-hidden="true">${r}</svg>`})}const uo='<rect class="g-faint" x="2.5" y="2.5" width="13" height="13" />',Wm='<rect class="g-solid" x="2.5" y="2.5" width="13" height="13" fill="none" />';function hP(e){const t=e.format;t.syncBorderDraft();const r=t.values,o=!t.fontEditable,n=o||t.context==="cells",i=t.context==="none",a=t.context==="cells",s=!t.painterActive&&(t.context==="none"||t.context==="cells"||!t.painterCapturable),p=t.painterActive?m(e,"formatBar.k58"):t.context==="cells"?m(e,"formatBar.k59"):t.context==="none"?m(e,"formatBar.k60"):t.painterCapturable?m(e,"formatBar.k62"):m(e,"formatBar.k61"),l=c=>o?m(e,"formatBar.k63",{v0:c}):c,d=[g("div",{class:"ft-border-panel",dataset:{test:"border-panel"}},[g("div",{class:"ft-border-grid"},[fr("preset-none",m(e,"formatBar.k64"),`${uo}<line class="g-solid" x1="4" y1="14" x2="14" y2="4" />`,()=>t.applyBorderPreset("none")),fr("preset-all",m(e,"formatBar.k65"),`${Wm}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("all")),fr("preset-outer",m(e,"formatBar.k66"),Wm,()=>t.applyBorderPreset("outer")),fr("preset-inner",a?m(e,"formatBar.k67"):m(e,"formatBar.k68"),`${uo}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("inner"),{disabled:!a}),fr("edge-top",m(e,"formatBar.k69"),`${uo}<line class="g-solid" x1="2" y1="3" x2="16" y2="3" />`,()=>t.applyEdge("top"),{on:t.edgeOn("top")}),fr("edge-bottom",m(e,"formatBar.k70"),`${uo}<line class="g-solid" x1="2" y1="15" x2="16" y2="15" />`,()=>t.applyEdge("bottom"),{on:t.edgeOn("bottom")}),fr("edge-left",m(e,"formatBar.k71"),`${uo}<line class="g-solid" x1="3" y1="2" x2="3" y2="16" />`,()=>t.applyEdge("left"),{on:t.edgeOn("left")}),fr("edge-right",m(e,"formatBar.k72"),`${uo}<line class="g-solid" x1="15" y1="2" x2="15" y2="16" />`,()=>t.applyEdge("right"),{on:t.edgeOn("right")})]),g("div",{class:"ft-style-row"},uP.map(c=>g("button",{type:"button",class:`ft-style-btn${t.borderStyle===c.key?" on":""}`,dataset:{test:`style-${c.key}`,tip:t.borderStyle===c.key?m(e,"formatBar.k73",{v0:m(e,c.labelKey)}):m(e,c.labelKey)},onClick:()=>{t.toggleBorderStyle(c.key),e.repaint()}},[g("span",{class:"ft-style-line",style:{borderTop:c.preview}})]))),g("div",{class:"ft-border-style-row"},[g("span",{class:"ft-edge-label",text:m(e,"formatBar.k74")}),g("div",{class:"ft-line-width"},[ae({value:t.borderWidth,min:.25,max:5,step:.25,placeholder:t.borderMixed.width?m(e,"formatBar.k75"):void 0,onCommit:c=>{t.setBorderWidth(c),e.repaint()}})])]),g("div",{class:"ft-border-style-row"},[g("span",{class:"ft-edge-label",text:m(e,"formatBar.k76")}),dt(t.borderColor,c=>{t.setBorderColor(c),e.repaint()},m(e,"formatBar.k77"))]),t.borderMixedAny?g("p",{class:"pd-hint",text:m(e,"formatBar.k78")}):""].filter(Boolean))],u=[g("div",{class:"ft-align-panel",dataset:{test:"align-panel"}},[g("div",{class:"ft-align-row"},[["left",m(e,"formatBar.k79"),"TextAlignStart"],["center",m(e,"formatBar.k80"),"TextAlignCenter"],["right",m(e,"formatBar.k81"),"TextAlignEnd"],["justify",m(e,"formatBar.k82"),"TextAlignJustify"]].map(([c,f,h])=>g("button",{type:"button",class:`ft-cell-btn${r.textAlign===c?" on":""}`,dataset:{test:`align-${c}`,tip:f},disabled:o,onClick:()=>t.applyStyle({textAlign:c}),html:je(h)}))),g("div",{class:"ft-align-row"},[["top",m(e,"formatBar.k83"),"ArrowUpToLine"],["middle",m(e,"formatBar.k84"),"ChevronsUpDown"],["bottom",m(e,"formatBar.k85"),"ArrowDownToLine"]].map(([c,f,h])=>g("button",{type:"button",class:`ft-cell-btn${r.verticalAlign===c?" on":""}`,dataset:{test:`valign-${c}`,tip:f},disabled:o,onClick:()=>t.applyStyle({verticalAlign:c}),html:je(h)})))])];return g("div",{class:"format-toolbar"},[g("div",{class:"tb-ou ft-group",dataset:{unit:"painter"}},[g("button",{type:"button",class:`ft-btn${t.painterActive?" on":""}`,dataset:{test:"format-painter",tip:p},disabled:s,onClick:()=>{t.painterActive?t.cancelPainter():t.pickPainterSource(!1),e.repaint()},onDblclick:()=>{t.pickPainterSource(!0),e.repaint()},html:je("Paintbrush")})]),g("div",{class:"tb-ou ft-group",dataset:{unit:"font"}},[g("div",{class:"ft-font"},[ha({id:"ft-font",state:e.state,fonts:e.host.fonts,value:typeof r.fontFamily=="string"?r.fontFamily:void 0,placeholder:r.fontFamily===Rr?m(e,"formatBar.k86"):m(e,"formatBar.k87"),disabled:o,onChange:c=>t.applyStyle({fontFamily:c})})]),g("div",{class:"ft-size",dataset:{test:"font-size"}},[ae({value:typeof r.fontSize=="number"?r.fontSize:void 0,min:5,max:72,disabled:o,placeholder:r.fontSize===Rr?m(e,"formatBar.k88"):m(e,"formatBar.k89"),onCommit:c=>t.applyStyle({fontSize:c})})])]),g("div",{class:"tb-ou ft-group",dataset:{unit:"style"}},[...[["bold","Bold",m(e,"formatBar.k90"),()=>t.toggleBold()],["underline","Underline",m(e,"formatBar.k91"),()=>t.toggleUnderline()],["strike","Strikethrough",m(e,"formatBar.k92"),()=>t.toggleStrike()]].map(([c,f,h,b])=>g("button",{type:"button",class:`ft-btn${r[c]===!0?" on":""}`,dataset:{test:c,tip:l(h)},disabled:c==="bold"?o:n,onClick:b,html:je(f)}))]),g("div",{class:"tb-ou ft-group",dataset:{unit:"color"}},[g("span",{class:`ft-color-btn${o?" dim":""}`,title:m(e,"formatBar.k93",{v0:o?m(e,"formatBar.fontDisabledHint"):""})},[dt(typeof r.color=="string"?r.color:void 0,c=>t.applyStyle({color:c})),g("span",{class:"ft-glyph",text:"A"})]),g("span",{class:`ft-color-btn${i?" dim":""}`,title:m(e,"formatBar.k94")},[dt(typeof r.backgroundColor=="string"?r.backgroundColor:void 0,c=>t.applyStyle({backgroundColor:c})),g("span",{class:"ft-glyph",html:je("PaintBucket",14)})])]),g("div",{class:"tb-ou ft-group",dataset:{unit:"align"}},[na(e,"align",{icon:fP[String(r.textAlign)]??"TextAlignStart",text:m(e,"formatBar.k95"),textClass:"ft-btn-text",tip:o?m(e,"formatBar.k96"):m(e,"formatBar.k97"),disabled:o,testId:"align-dd"},u)]),g("div",{class:"tb-ou ft-group",dataset:{unit:"border"}},[na(e,"border",{icon:"Grid3x3",text:m(e,"formatBar.k98"),textClass:"ft-btn-text",tip:i?m(e,"formatBar.k99"):m(e,"formatBar.k100"),disabled:i,testId:"border"},d)])])}const mP="1.6.2";ia.filter(e=>e.material).map(e=>({type:e.type,label:e.label,icon:e.icon}));function ma(e,t){return je(e??"Shapes",t)||je("Shapes",t)}function gP(e){const t=e.state;if(t.leftCollapsed)return g("div",{class:"left-panel collapsed"},[g("div",{class:"left-collapsed"},[Vm("ChevronsRight",m(e,"panels.k137"),()=>{t.leftCollapsed=!1,e.repaint()}),...[["elements",m(e,"panels.k138"),"Table2"],["fields",m(e,"panels.k139"),"ListTree"],["layers",m(e,"panels.k140"),"Layers"]].map(([o,n,i])=>g("button",{type:"button",class:`lc-btn${t.leftTab===o?" on":""}`,title:n,html:ma(i,14),onClick:()=>{t.leftTab=o,t.leftCollapsed=!1,e.repaint()}}))])]);const r=(o,n,i="")=>g("div",{class:`pd-tab-pane${i?` ${i}`:""}`,role:"tabpanel",dataset:{pane:`left:${o}`},style:t.leftTab===o?"":{display:"none"}},n);return g("div",{class:"left-panel"},[g("div",{class:"left-head"},[g("span",{class:"left-title",text:m(e,"panels.k141")}),Vm("ChevronsLeft",m(e,"panels.k142"),()=>{t.leftCollapsed=!0,e.repaint()})]),g("div",{class:"pd-tabs left-tabs"},[g("div",{class:"pd-tab-bar",role:"tablist"},[...[["elements",m(e,"panels.k143")],["fields",m(e,"panels.k144")],["layers",m(e,"panels.k145")]].map(([o,n])=>g("button",{type:"button",class:`pd-tab${t.leftTab===o?" active":""}`,text:n,onClick:()=>{t.leftTab=o,e.repaint()}}))]),r("elements",yP(e),"material-grid"),r("fields",[vP(e)]),r("layers",[xP(e)])])])}function Vm(e,t,r){return g("button",{type:"button",class:"collapse-btn",title:t,html:ma(e,14),onClick:r})}const Gm={text:"elementDefinitions.k553",barcode:"elementDefinitions.k554",qrcode:"elementDefinitions.k555",image:"elementDefinitions.k556",table:"elementDefinitions.k557",longText:"elementDefinitions.k558",flowList:"elementDefinitions.k559",hline:"elementDefinitions.k560",vline:"elementDefinitions.k561",rect:"elementDefinitions.k562",oval:"elementDefinitions.k563",pageNumber:"elementDefinitions.k564",barChart:"echarts.series.typeNames.bar",barHChart:"echarts.series.typeNames.barH",lineChart:"echarts.series.typeNames.line",areaChart:"echarts.series.typeNames.area",pieChart:"echarts.series.typeNames.pie",doughnutChart:"echarts.series.typeNames.doughnut",scatterChart:"echarts.series.typeNames.scatter",radarChart:"echarts.series.typeNames.radar",funnelChart:"echarts.series.typeNames.funnel",gaugeChart:"echarts.series.typeNames.gauge"},bP={barChart:"elementGroup.chart"};function kP(e,t,r,o){return g("div",{class:`material-card${u1(o??t)?" material-card--wide":""}`,draggable:!0,dataset:{test:`material-${e}`},onDragstart:n=>{const i=n.dataTransfer;i?.setData("elementType",e),i&&(i.effectAllowed="all")}},[g("span",{class:"material-icon","data-icon":r,html:ma(r,14)}),g("span",{class:"material-label",text:o??t})])}function yP(e){const t=[];let r;for(const o of Gh()){const n=o.group;if(n&&n!==r){const p=bP[o.type];t.push(g("div",{class:"material-group-title",text:p?m(e,p):n}))}n&&(r=n);const i=Gm[o.type],a=i?m(e,i):void 0,s=a&&a!==i?a:void 0;t.push(kP(o.type,o.label,o.icon,s))}return[g("div",{class:"panel-title",text:m(e,"panels.k146")}),...t]}function vP(e){const t=e.state,r=t.fieldDisplay??"both",o=Su(e.store.fields),n=(t.fieldSearch??"").trim().toLowerCase(),i=n?o.map(a=>({...a,fields:a.fields.filter(s=>`${s.fieldLabel}${s.fieldKey}`.toLowerCase().includes(n))})).filter(a=>a.fields.length):o;return g("div",{class:"field-tree-panel"},[g("div",{class:"panel-title",text:m(e,"panels.k147")}),g("input",{class:"pd-input search-input",type:"search",placeholder:m(e,"panels.k148"),"aria-label":m(e,"panels.k149"),value:t.fieldSearch??"",onInput:a=>{t.fieldSearch=a.target.value},onChange:()=>e.repaint()}),g("div",{class:"tree-container"},i.flatMap(a=>{const s=t.collapsedGroups.has(a.key)&&!n,p=a.key?g("div",{class:`field-group-header${a.isList?" is-list":""}`,onClick:()=>{s?t.collapsedGroups.delete(a.key):t.collapsedGroups.add(a.key),e.repaint()}},[g("span",{class:"expand-icon",text:s?"▶":"▼"}),g("span",{class:"node-icon",text:a.isList?"📋":"📁"}),g("span",{class:"group-label",text:a.label,"data-tip":a.label})]):"",l=s?[]:a.fields.map(d=>g("div",{class:"field-row",draggable:!0,"data-tip":m(e,"panels.k150",{v0:d.fieldLabel,v1:d.fieldKey}),style:{paddingLeft:`${a.key?22:8}px`},onDragstart:u=>{const c=u.dataTransfer;c?.setData("fieldKey",d.fieldKey),c&&(c.effectAllowed="all")},onClick:()=>{Tu(d.fieldLabel||d.fieldKey).then(u=>{u&&(t.copiedFieldKey=d.fieldKey,e.repaint(),setTimeout(()=>{t.copiedFieldKey===d.fieldKey&&(t.copiedFieldKey="",e.repaint())},1200))})}},[g("span",{class:"node-icon",text:"📄"}),g("span",{class:"node-meta"},[r!=="key"?g("span",{class:"node-label",text:d.fieldLabel||d.fieldKey}):"",r!=="label"?g("span",{class:`node-key${r==="key"?" is-primary":""}`,text:r==="key"?d.fieldKey:`(${d.fieldKey})`}):""].filter(Boolean)),t.copiedFieldKey===d.fieldKey?g("span",{class:"copy-hint",text:m(e,"panels.k151")}):""].filter(Boolean)));return[p,g("div",{},l.filter(Boolean))].filter(Boolean)})),i.length===0?g("p",{class:"pd-empty",text:m(e,"panels.k152")}):""].filter(Boolean))}function wP(e,t){if(e.options.title)return e.options.title;const r=Gm[e.printElementType.type];return r?m(t,r):e.printElementType.title||e.printElementType.type}function xP(e){const t=e.store,r=[...t.elements].sort((s,p)=>(p.options.zIndex??0)-(s.options.zIndex??0)),o=t.elements.filter(s=>t.selectedIds.has(s.id)),n=o.length>=2,i=o.some(s=>!!s.options.groupId),a=s=>s.zone==="header"?m(e,"panels.k153"):s.zone==="footer"?m(e,"panels.k154"):"";return g("div",{class:"layer-panel"},[g("div",{class:"panel-title",text:m(e,"panels.k155")}),...r.map(s=>{const p=Xh(s.printElementType.type);return g("div",{class:`layer-item${t.selectedIds.has(s.id)?" active":""}`,onClick:l=>t.selectElement(s.id,l.ctrlKey||l.metaKey)},[g("span",{class:"layer-icon","data-icon":p??"Shapes",html:ma(p,12)}),g("span",{class:"layer-name",text:wP(s,e)}),a(s)?g("span",{class:"layer-zone",text:a(s)}):"",g("span",{class:"layer-zindex",text:`z:${s.options.zIndex??0}`})].filter(Boolean))}),r.length?g("div",{class:"layer-actions"},[...[["top",m(e,"panels.k156"),"ArrowUpToLine"],["up",m(e,"panels.k157"),"ArrowUp"],["down",m(e,"panels.k158"),"ArrowDown"],["bottom",m(e,"panels.k159"),"ArrowDownToLine"]].map(([s,p,l])=>g("button",{type:"button",class:"pd-button small",title:p,html:je(l,14),onClick:()=>e.fire("move-layer",s)}))]):"",n||i?g("div",{class:"layer-actions"},[n?g("button",{type:"button",class:"pd-button small",title:m(e,"panels.k160"),html:je("Group",14),onClick:()=>e.fire("group")}):"",i?g("button",{type:"button",class:"pd-button small",title:m(e,"panels.k161"),html:je("Ungroup",14),onClick:()=>e.fire("ungroup")}):""].filter(Boolean)):""].filter(Boolean))}function PP(e){const t=e.store,r=e.state,o=t.pages.length>1,n=t.pages[t.activePageIndex]?.name||m(e,"panels.k162",{v0:t.activePageIndex+1}),i=t.tilingEnabled;return g("div",{class:"page-tabs"},[g("div",{class:"page-tabs-list"},t.pages.map((s,p)=>r.renamingPage===p?g("input",{class:"page-tab-rename",dataset:{test:"page-rename-input"},value:r.renameText??"",onInput:l=>{r.renameText=l.target.value},onBlur:()=>a(),onKeydown:l=>{const d=l;if(d.key==="Enter"){a();return}d.key==="Escape"&&(r.renamingPage=null,e.repaint())}}):g("button",{type:"button",class:`page-tab${p===t.activePageIndex?" active":""}`,dataset:{tip:s.name?m(e,"panels.k163",{v0:s.name}):m(e,"panels.k164")},text:s.name||m(e,"panels.k165",{v0:p+1}),onClick:()=>t.switchPage(p),onDblclick:()=>{r.renamingPage=p,r.renameText=s.name??"",e.repaint()}}))),g("div",{class:"page-tabs-actions"},[g("button",{type:"button",dataset:{test:"add-page",tip:i?m(e,"panels.k166"):m(e,"panels.k167")},disabled:i,text:"+",onClick:()=>e.fire("add-page")}),g("button",{type:"button",dataset:{test:"duplicate-page",tip:i?m(e,"panels.k168"):m(e,"panels.k169",{v0:n})},disabled:i,text:"⧉",onClick:()=>e.fire("duplicate-page")}),g("button",{type:"button",dataset:{test:"delete-page",tip:o?m(e,"panels.k170",{v0:n}):m(e,"panels.k171")},disabled:!o,text:"✕",onClick:()=>e.fire("delete-page")}),g("button",{type:"button",dataset:{test:"move-left",tip:m(e,"panels.k172",{v0:n})},disabled:t.activePageIndex<=0,text:"←",onClick:()=>e.fire("move-page",-1)}),g("button",{type:"button",dataset:{test:"move-right",tip:m(e,"panels.k173",{v0:n})},disabled:t.activePageIndex>=t.pages.length-1,text:"→",onClick:()=>e.fire("move-page",1)})])]);function a(){const s=(r.renameText??"").trim();r.renamingPage!==null&&s&&t.renamePage(r.renamingPage,s),r.renamingPage=null,e.repaint()}}function EP(e){const t=e.store,r=t.templateData,o=ir(r),n=r.orientation==="landscape"?m(e,"panels.k174"):m(e,"panels.k175"),i=Lt[r.paperSize],a=i?m(e,i.labelKey):r.paperSize,s=r.outputRotation,p=`${a} ${n} ${Math.round(o.width)}×${Math.round(o.height)}mm${s?m(e,"panels.paperRotated",{rot:s}):""}`;return g("div",{class:"status-bar"},[g("span",{class:"status-item coord",dataset:{coord:""},style:{display:"none"}}),g("span",{class:"status-item",text:m(e,"panels.k176",{v0:t.scale})}),g("span",{class:"status-item",text:m(e,"panels.statusElements",{count:t.elements.length,selected:t.selectedIds.size?m(e,"panels.statusSelected",{n:t.selectedIds.size}):""})}),g("span",{class:"status-item status-version",text:`v${mP}`}),g("span",{class:"status-item status-paper",text:p})])}const SP=Object.keys(Lt).filter(e=>e!=="CUSTOM"&&!Lt[e]?.continuous);function TP(e){const t=document.createElement("label");t.className="pd-button small upload-label";const r=document.createTextNode(m(e,"pageExtras.k103")),o=document.createElement("input");o.className="visually-hidden",o.type="file",o.accept="image/*",t.append(r,o);const n=i=>{t.className=`pd-button small upload-label${i?" disabled":""}`,o.disabled=i};return o.addEventListener("change",async()=>{const i=o.files?.[0];if(!i)return;if(!i.type.startsWith("image/")){alert(m(e,"pageExtras.k104")),o.value="";return}const a=e.host.uploadDesignBackground;if(!a){alert(m(e,"pageExtras.k105")),o.value="";return}n(!0),r.textContent=m(e,"pageExtras.k106");try{const s=await a(i);s?e.store.updateTemplateData({designBackground:{src:s,rotation:0}}):alert(m(e,"pageExtras.k107"))}catch(s){alert(s instanceof Error?s.message:m(e,"pageExtras.k108"))}finally{r.textContent=m(e,"pageExtras.k109"),n(!e.host.uploadDesignBackground),o.value=""}}),e.host.uploadDesignBackground||n(!0),t}function MP(e){const r=e.store.templateData.designBackground,o=r?.rotation??0;return g("div",{class:"design-background-config"},[$t(m(e,"pageExtras.k110")),g("p",{class:"design-background-tip",text:m(e,"pageExtras.k111")}),r?.src?[g("div",{class:"design-background-path",title:r.src,text:r.src}),g("div",{class:"design-background-actions"},[g("button",{type:"button",class:"pd-button small rotate-btn",text:m(e,"pageExtras.k112",{v0:(o+90)%360}),onClick:()=>e.store.updateTemplateData({designBackground:{...r,rotation:(o+90)%360}})}),g("button",{type:"button",class:"pd-button small remove-btn",text:m(e,"pageExtras.k113"),onClick:()=>e.store.updateTemplateData({designBackground:void 0})})])]:TP(e)].flat())}function CP(e){const t=e.store,r=t.templateData,o=r.tiling,n={...Nt,...o??{},enabled:o?.enabled??!1,sheetMargin:{...Nt.sheetMargin,...o?.sheetMargin??{}}},i=Gn(r.paperSize),a=h=>t.updateTemplateData({tiling:{...n,...h}}),s=h=>Lr({target:n,base:Nt,propKey:h,write:()=>a({[h]:Nt[h]})}),p=h=>Lr({target:n.sheetMargin,base:Nt.sheetMargin,propKey:h,write:()=>l(h,Nt.sheetMargin[h])}),l=(h,b)=>a({sheetMargin:{...n.sheetMargin,[h]:b??0}}),d={...r,tiling:n},u=Fs(d),c=Math.max(hu(d),1);let f="";if(!u.length)try{const h=fu(d),b=Ko(d),k=n.sheetPaperSize==="CUSTOM"?m(e,"pageExtras.k114"):n.sheetPaperSize??"A4",v=n.sheetPaperSize==="CUSTOM"?"":n.sheetOrientation==="landscape"?m(e,"pageExtras.k115"):m(e,"pageExtras.k116");f=m(e,"pageExtras.k117",{v0:k,v1:v,v2:b.width,v3:b.height,v4:h.columns,v5:h.rows,v6:h.perSheet,v7:h.tile.width,v8:h.tile.height})}catch{f=""}return g("div",{class:"tiling-config",dataset:{test:"tiling-config"}},[$t(m(e,"pageExtras.k118")),g("p",{class:"pd-hint",text:m(e,"pageExtras.k119")}),g("div",{class:"pd-field"},[g("label",{class:"tiling-switch"},[g("input",{type:"checkbox",checked:n.enabled===!0,disabled:i,onChange:h=>{if(!h.target.checked){a({enabled:!1});return}a({...Nt,columns:Math.min(Nt.columns,Math.max(c,1))})}}),g("span",{text:m(e,"pageExtras.k120")})]),i?g("p",{class:"pd-hint tiling-error",text:m(e,"pageExtras.k121")}):""].filter(Boolean)),n.enabled&&!i?[he(m(e,"pageExtras.k122"),g("select",{class:"pd-select",style:{width:"100%"},onChange:h=>{const b=h.target.value;if(b!=="CUSTOM"){a({sheetPaperSize:b});return}const k=Ko(d);a({sheetPaperSize:"CUSTOM",sheetCustomWidth:n.sheetCustomWidth??k.width,sheetCustomHeight:n.sheetCustomHeight??k.height})}},[...SP.map(h=>g("option",{value:h,text:m(e,Lt[h]?.labelKey??h),selected:(n.sheetPaperSize??"A4")===h})),g("option",{value:"CUSTOM",text:m(e,"pageExtras.k123"),selected:n.sheetPaperSize==="CUSTOM"})]),void 0,s("sheetPaperSize")),n.sheetPaperSize==="CUSTOM"?he(m(e,"pageExtras.k124"),g("div",{class:"custom-size-grid"},[ae({value:Number(n.sheetCustomWidth??0),min:25,max:2e3,onCommit:h=>a({sheetCustomWidth:h})}),g("span",{class:"custom-size-x",text:"×"}),ae({value:Number(n.sheetCustomHeight??0),min:25,max:2e3,onCommit:h=>a({sheetCustomHeight:h})})])):he(m(e,"pageExtras.k125"),pr("tiling-ori",[{value:"portrait",label:m(e,"pageExtras.k126")},{value:"landscape",label:m(e,"pageExtras.k127")}],n.sheetOrientation==="landscape"?"landscape":"portrait",h=>a({sheetOrientation:h})),void 0,s("sheetOrientation")),$t(m(e,"pageExtras.k128")),g("div",{class:"margin-grid"},[he(m(e,"pageExtras.k129"),ae({value:n.sheetMargin.top??0,min:0,max:100,onCommit:h=>l("top",h)}),void 0,p("top")),he(m(e,"pageExtras.k130"),ae({value:n.sheetMargin.bottom??0,min:0,max:100,onCommit:h=>l("bottom",h)}),void 0,p("bottom")),he(m(e,"pageExtras.k131"),ae({value:n.sheetMargin.left??0,min:0,max:100,onCommit:h=>l("left",h)}),void 0,p("left")),he(m(e,"pageExtras.k132"),ae({value:n.sheetMargin.right??0,min:0,max:100,onCommit:h=>l("right",h)}),void 0,p("right"))]),$t(m(e,"pageExtras.k133")),he(m(e,"pageExtras.k134"),ae({value:n.gapX??0,min:0,max:50,onCommit:h=>a({gapX:h??0})}),void 0,s("gapX")),he(m(e,"pageExtras.k135"),ae({value:n.gapY??0,min:0,max:50,onCommit:h=>a({gapY:h??0})}),void 0,s("gapY")),he(m(e,"pageExtras.k136"),ae({value:n.columns??1,min:1,max:c,onCommit:h=>a({columns:h||1})})),...u.map(h=>g("p",{class:"pd-hint tiling-error",text:h.message})),!u.length&&f?g("p",{class:"pd-hint tiling-summary",text:f}):""]:""].flat().filter(Boolean))}const _P=new Set(cs.map(e=>e.group)),DP={"table-settings":"content"},Km=new Map;function ep(e){const t=e??"";let r=Km.get(t);if(!r){const{groups:o,itemKeys:n}=l1(t);r={groups:o,keys:n,searching:!!t.trim()},Km.set(t,r)}return r}function tp(e){const t=DP[e]??e;return _P.has(t)?t:""}function AP(e,t){const r=ep(e.state.propSearch);if(!r.searching)return!0;const o=tp(t);return!o||r.groups.includes(o)}function OP(e,t){const r=ep(e.state.propSearch);return!r.searching||r.keys.has(t)}function Ym(e,t){const r=e.props.style??{};return e.props.style={...r,display:t?"":"none"},e}function G(e,t,r){const o=r.props.dataset??{};return r.props.dataset={...o,propKey:t},Ym(r,OP(e,t))}function RP(e,t,r){const o=tp(t);if(!o)return r;const n=r.props.dataset??{};return r.props.dataset={...n,propGroup:o},Ym(r,AP(e,t))}function Xm(e,t){const r=ep(t);for(const o of Array.from(e.querySelectorAll("[data-prop-group]"))){const n=tp(o.dataset.propGroup??"");o.style.display=!r.searching||!n||r.groups.includes(n)?"":"none"}for(const o of Array.from(e.querySelectorAll("[data-prop-key]")))o.style.display=!r.searching||r.keys.has(o.dataset.propKey??"")?"":"none"}function IP(e){return g("div",{class:"property-search"},[g("input",{class:"pd-input",type:"search",placeholder:m(e,"propertySearch.k328"),"aria-label":m(e,"propertySearch.k329"),value:e.state.propSearch??"",onInput:t=>{const r=t.target,o=r.value;e.state.propSearch=o,Xm(r.getRootNode(),o)}})])}const LP={Document:"≡",Brush:"◧",Setting:"⚙"};function BP(e,t){try{const r=window.localStorage.getItem(`property-group-${e}`);return r===null?t:r==="true"}catch{return t}}function NP(e,t){try{window.localStorage.setItem(`property-group-${e}`,String(t))}catch{}}function it(e,t,r,o,n,i=!0,a=[]){const s=BP(t,i);return RP(e,t,g("div",{class:`property-group${s?" is-expanded":""}`},[g("div",{class:"group-header",onClick:()=>{NP(t,!s),e.repaint()}},[g("span",{class:"group-icon",text:LP[o]||"•"}),g("span",{class:"group-title",text:r}),...a,g("span",{class:"expand-icon",text:s?"▾":"▸"})]),g("div",{class:"group-content",style:s?"":{display:"none"}},n.filter(Boolean))]))}function ga(e){return g("form",{class:"pd-form",onSubmit:t=>t.preventDefault()},e.filter(Boolean))}function Zm(e){return e.split(".").flatMap(t=>{const r=t.match(/^([^\[]+)((?:\[\d+\])*)$/);if(!r)return[t];const o=r[1],n=[...r[2].matchAll(/\[(\d+)\]/g)].map(i=>Number(i[1]));return[o,...n]})}function Jm(e,t){return Zm(t).reduce((n,i)=>n==null?"":n[i],e)??""}function rp(e,t,r,o){const n=Zm(r),i=n.pop(),a=n.reduce((s,p)=>((s[p]===void 0||s[p]===null)&&(s[p]={}),s[p]),t);a[i]=o||void 0,e.recordHistory(),e.emit()}function FP(e,t){const r=e.store;if(t.printElementType.type==="table"&&r.tableSelection?.elementId===t.id){const{r1:o,c1:n}=r.tableSelection,i=(t.options.tableRows??[])[o];if(i)return Mu(i.type,o,n,t.options.fields?.[0]?.dataSource)}return Cy(t)}function $P(e,t){const r=document.createElement("label");r.className="pd-button small upload-label",rt(g("svg",{class:"pd-icon",viewBox:"0 0 24 24","aria-hidden":"true"},[g("path",{fill:"currentColor",d:"M12 3l4 4h-3v7h-2V7H8zm-7 12h14v5H5Z"})]),r);const o=document.createTextNode(m(e,"binding.k1")),n=document.createElement("input");n.className="visually-hidden",n.type="file",n.accept="image/*",r.append(o,n);const i=p=>{r.className=`pd-button small upload-label${p?" disabled":""}`,n.disabled=p};n.addEventListener("change",async()=>{const p=n.files?.[0];if(!p)return;if(!p.type.startsWith("image/")){alert(m(e,"binding.k2")),n.value="";return}const l=e.host.uploadImage;if(!l){alert(m(e,"binding.k3")),n.value="";return}i(!0),o.textContent=m(e,"binding.k4");try{const d=await l(p);d?rp(e.store,t,"options.src",d):alert(m(e,"binding.k5"))}catch(d){alert(d instanceof Error?d.message:m(e,"binding.k6"))}finally{o.textContent=m(e,"binding.k7"),i(!e.host.uploadImage),n.value=""}}),e.host.uploadImage||i(!0);const a=document.createElement("div");a.className="image-content-upload";const s=document.createElement("p");return s.className="upload-tip",s.textContent=m(e,"binding.k8"),a.append(r,s),a}function zP(e,t){const r=o=>e.fire("open-expression",{elementId:t.id,targetPath:o.targetPath,value:Jm(t,o.targetPath)});return it(e,"binding",m(e,"binding.k9"),"Document",[...FP(e,t).map(o=>he(o.labelKey?m(e,o.labelKey):o.label,g("input",{class:"pd-input",type:"text",value:Jm(t,o.targetPath),placeholder:o.placeholder||m(e,"binding.k10"),onChange:n=>rp(e.store,t,o.targetPath,n.target.value),onDblclick:()=>r(o)}))),t.printElementType.type==="image"?$P(e,t):""].filter(Boolean))}const bn=new Map;function ba(e){return`${Math.round(e*1e4)/1e4}%`}function Qm(e,t){const r=my(t.value),o=r.kind==="custom",n=r.kind==="axes"?r.x:50,i=r.kind==="axes"?r.y:50,a=wy(t.src),s=bn.get(a.src),p={widthMm:t.widthMm,heightMm:t.heightMm,naturalWidth:s?.width,naturalHeight:s?.height,fit:t.fit,scalePct:t.scale},l=gy(p),d=by(p,n,i),u=document.createElement("select");u.className="pd-select",u.style.width="100%";for(const b of Sy(l,n,i)){const k=document.createElement("option");k.value=b.value,k.textContent=b.label,u.appendChild(k)}if(o){const b=document.createElement("option");b.value="custom",b.textContent=m(e,"cropAnchor.k37"),u.appendChild(b)}u.value=o?"custom":`${n},${i}`,u.selectedIndex<0&&(u.selectedIndex=o?u.options.length-1:0),u.addEventListener("change",()=>{if(u.value==="custom")return;const[b,k]=u.value.split(",").map(Number);t.onCommit(yu(b,k))});const c=m(e,`propertyTips.${t.fieldKey}`),f=[g("div",{class:"pd-field",dataset:{field:t.fieldKey}},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[t.label,Ml(c)]),t.resetAnchor??""].filter(Boolean)),u])];f.push(g("div",{class:"pd-field",dataset:{field:"ap-img-fit-scale"}},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[xy(),Ml(m(e,"propertyTips.ap-img-fit-scale"))]),t.resetScale??""].filter(Boolean)),ae({value:t.scale,min:Oo,max:_d,step:5,placeholder:m(e,"cropAnchor.k38"),onCommit:b=>t.onScaleCommit(b>Oo?b:void 0)})]));for(const b of Ey(l,n,i))f.push(g("div",{class:"pd-field",dataset:{field:t.fieldKey}},[g("span",{class:"pd-label",text:b.label}),ae({value:b.value,min:0,max:100,step:1,onCommit:k=>t.onCommit(yu(b.name==="horizontal"?k:n,b.name==="vertical"?k:i))})]));const h=Py(l,o);return h&&f.push(g("p",{class:"pd-crop-note",text:h})),a.isSample&&f.push(g("p",{class:"pd-crop-note",text:vy()})),f.push(g("div",{class:"pd-crop-preview"},[g("img",{class:"pd-crop-thumb",src:a.src,alt:a.isSample?m(e,"cropAnchor.k39"):m(e,"cropAnchor.k40"),onLoad:b=>{const k=b.target;if(!(k.naturalWidth>0&&k.naturalHeight>0))return;const v=bn.get(a.src);v&&v.width===k.naturalWidth&&v.height===k.naturalHeight||(bn.set(a.src,{width:k.naturalWidth,height:k.naturalHeight}),e.repaint())},onError:()=>{bn.has(a.src)&&(bn.delete(a.src),e.repaint())}}),d?g("div",{class:"pd-crop-win",style:{left:ba(d.leftPct),top:ba(d.topPct),width:ba(d.widthPct),height:ba(d.heightPct)}}):""])),g("div",{class:t.containerClass??"pd-crop-anchor"},f)}const Fr=e=>Number(e??0),op=e=>e||void 0;function $r(e,t,r,o,n,i){return g("div",{class:"pd-field"},[g("span",{class:"pd-label",...o?{title:o}:{}},[g("span",{class:"pd-label-t",text:e}),n??""].filter(Boolean)),g("input",{class:"pd-switch",type:"checkbox",checked:t,...i?{disabled:!0}:{},onChange:a=>r(a.target.checked)})])}function eg(e,t,r,o,n=!1,i){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),""].filter(Boolean)),g("select",{class:"pd-select",...n?{style:{width:"100%"}}:{},onChange:a=>o(a.target.value)},r.map(a=>g("option",{value:a.value,text:a.label,selected:a.value===t})))])}function kn(e,t,r,o,n={}){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),n.reset??""].filter(Boolean)),zh(t,r,o,{className:"pd-select",...n.full?{width:"100%"}:{}})])}const fo=e=>g("p",{class:"pd-hint",text:e});function tg(e,t){return e.map(r=>({value:r.value,label:r.labelKey?m(t,r.labelKey):r.label??r.value,...r.disabled?{disabled:!0}:{}}))}const HP="tableProps.k330",UP=[{value:"header",labelKey:"tableProps.k331"},{value:"data",labelKey:"tableProps.k332"},{value:"subtotal",labelKey:"tableProps.k333"},{value:"summary",labelKey:"tableProps.k334"}],qP=[{value:"CODE128",labelKey:"tableProps.k335"},{value:"EAN13",labelKey:"tableProps.k336"},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],jP=[{value:"L",labelKey:"tableProps.k337"},{value:"M",labelKey:"tableProps.k338"},{value:"Q",label:"Q"},{value:"H",labelKey:"tableProps.k339"}],WP=[{value:"clip",labelKey:"tableProps.k340"},{value:"shrink",labelKey:"tableProps.k341"},{value:"autoHeight",labelKey:"tableProps.k342"}],VP={value:"__multi__",labelKey:"tableProps.k343",disabled:!0};function GP(e,t){const r=e.store,o=r.tableSelection,n=t.options.tableRows??[],i=o?n[o.r1]:void 0;if(!o||!i)return it(e,"table-row",m(e,"tableProps.k344"),"Grid",[]);const a=s=>r.updateElement(t.id,s);return it(e,"table-row",m(e,"tableProps.k345"),"Grid",[ga([eg(m(e,"tableProps.k346"),i.type,tg(UP,e),s=>{const p=Ia(n,o.r1,s);if(p){window.alert(p);return}a({tableRows:n})},!0),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k347")}),ae({value:i.height,min:3,max:100,step:.5,onCommit:s=>{i.height=s,a({tableRows:n})}})]),i.type==="header"?$r(m(e,"tableProps.k348"),i.repeatOnPage??!1,s=>{Mb(n,s),a({tableRows:n})},m(e,HP)):""])])}function KP(e,t){const r=e.store,o=t.options,n=d=>r.updateElement(t.id,d),i=o.tableColWidths??[],a=r.paperSize.width-r.templateData.margins.left-r.templateData.margins.right,s=r.fields.filter(d=>d.fieldType==="list").map(d=>({value:d.fieldKey,label:d.fieldLabel})),p=es("table"),l=d=>Lr({target:o,base:p,propKey:d,write:()=>n({[d]:p[d]})});return it(e,"table-settings",m(e,"tableProps.k349"),"Grid",[ga([eg(m(e,"tableProps.k350"),o.dataSource??"",s,d=>n({dataSource:d||void 0}),!0),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k351")}),l("tableDefaultFontFamily")]),ha({id:"table-default-font",state:e.state,fonts:e.host.fonts,value:o.tableDefaultFontFamily,placeholder:m(e,"tableProps.k352"),onChange:d=>n({tableDefaultFontFamily:d||void 0})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k353")}),l("tableDefaultFontSize")]),ae({value:Fr(o.tableDefaultFontSize),min:0,max:72,placeholder:m(e,"tableProps.k354"),onCommit:d=>n({tableDefaultFontSize:op(d)})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k355")}),l("tableDefaultColor")]),dt(o.tableDefaultColor,d=>n({tableDefaultColor:d}),m(e,"tableProps.k356"))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k357")}),l("tableDefaultPadding")]),ae({value:Fr(o.tableDefaultPadding),min:0,max:10,step:.5,placeholder:m(e,"tableProps.k358"),onCommit:d=>n({tableDefaultPadding:op(d)})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k359")}),...i.map((d,u)=>g("div",{class:"col-width-row"},[g("span",{style:{width:"60px"},text:m(e,"tableProps.k360",{v0:u+1})}),ae({value:d,min:5,max:200,onCommit:c=>{const f=i.reduce((h,b,k)=>k===u?h:h+b,0);if(f+c>a){const h=Math.max(5,Math.round((a-f)*10)/10);window.alert(m(e,"tableProps.k361",{v0:a,v1:u+1,v2:h})),i[u]=h}else i[u]=c;n({tableColWidths:i})}})]))])])])}function YP(e,t){const r=e.store,o=t.options,n=t.printElementType.type==="table",i=s=>r.updateElement(t.id,s),a=[];if(n)a.push(G(e,"pg-enabled",$r(m(e,"tableProps.k362"),o.tablePagination?.enabled??!0,s=>i({tablePagination:{enabled:s}}))));else{const s=o.pagination?.pageable??!0,p=o.pagination?.keepWithNext??!1;a.push(G(e,"pg-pageable",$r(m(e,"tableProps.k363"),s,l=>i({pagination:{pageable:l,keepWithNext:p}})))),a.push(G(e,"pg-keep-with-next",$r(m(e,"tableProps.k364"),p,l=>i({pagination:{pageable:s,keepWithNext:l}}))))}return it(e,"pagination",m(e,"tableProps.k365"),"Document",[ga(a)],!1)}const np=new WeakMap,rg=[{value:"top",labelKey:"tableProps.k366"},{value:"right",labelKey:"tableProps.k367"},{value:"bottom",labelKey:"tableProps.k368"},{value:"left",labelKey:"tableProps.k369"}];function XP(e,t){const r=e.store,o=r.tableSelection,n=t.options.tableRows??[];if(!o)return it(e,"table-cell",m(e,"tableProps.k370"),"Menu",[]);const i=Po(n,o.r1,o.c1),a=n[i.r]?.cells[i.c];if(!a)return it(e,"table-cell",m(e,"tableProps.k371"),"Menu",[]);const s=()=>On(n,o),p=La(n,o),l=p.count,d=p.mode==="multi",u=`${t.id}:${o.r1}:${o.c1}:${o.r2}:${o.c2}`,c=np.get(r),f=c?.key===u?c:{key:u,border:{},values:{},edges:{}};c?.key!==u&&np.set(r,f);const h=T=>{np.set(r,{key:u,border:T.border??f.border,values:T.values??f.values,edges:T.edges??f.edges})},b=(T,X)=>{h({border:{...f.border,[T]:X}}),e.repaint()},k=(T,X)=>{s().forEach(T),d&&X&&h({values:{...f.values,...X}}),r.updateElement(t.id,{tableRows:n})},v=(T,X)=>{k(ee=>{ee[T]=X},{[T]:X})},w=T=>d?f.values[T]:a[T],P=T=>d&&T in f.values,E=d?{width:void 0,style:void 0,color:void 0}:ad(n,o),D=!d&&s().some(T=>!!T.borders&&!!(T.borders.top||T.borders.right||T.borders.bottom||T.borders.left)),O=!d&&!D,A={width:O?0:typeof E.width=="number"?E.width:rr.width,style:O?"none":typeof E.style=="string"&&E.style!=="mixed"?E.style:rr.style,color:typeof E.color=="string"&&E.color!=="mixed"?E.color:rr.color,...f.border},R="__mixed__",_={style:!d&&E.style==="mixed",width:!d&&E.width==="mixed",color:!d&&E.color==="mixed"},I=_.style&&!("style"in f.border),S=_.width&&!("width"in f.border),N=_.color&&!("color"in f.border),F=I||S||N,H=I?R:A.style,le=S?void 0:A.width,M=N?void 0:A.color,ne=T=>{const X={style:T};T!=="none"&&le===0?X.width=rr.width:T==="none"&&!D&&(X.width=0),h({border:{...f.border,...X}}),e.repaint()},Se=()=>({...A}),Pe=d?rg.reduce((T,X)=>(T[X.value]=f.edges[X.value]?"on":"off",T),{}):Kd(s().map(T=>T.borders)),K=d?"cellType"in f.values?f.values.cellType??"text":Ab(n,o):a.cellType??"text",ue=K==="barcode",me=K==="qrcode",we=K==="image",ke=K==="text",te=ue&&!!w("printerDpi"),Me=Td(w("printerDpi"),w("barWidth"),e.t??oe),se=d?f.values.textFit:Fa(a),Je=d?"cellType"in f.values?f.values.cellType??"text":"":a.cellType||"text",ze=T=>tg(d?[VP,...T]:T,e),ve=T=>d?m(e,"tableProps.k372"):T,Ee=(T,X)=>d?f.values[T]:X,ho=d?w("barcodeType")??"__multi__":a.barcodeType||"CODE128",vn=d?P("printerDpi")?w("printerDpi")?String(w("printerDpi")):"":"__multi__":a.printerDpi?String(a.printerDpi):"",wn=d?w("qrCodeLevel")??"__multi__":a.qrCodeLevel||"M",xn=d?w("fit")??"__multi__":a.fit||"contain",mo=se??"__multi__",xe=Qp(n,o);let Dt=!0;for(let T=o.r1;T<=o.r2;T++)if(n[T]?.type!=="data"){Dt=!1;break}const C=Dt?"":m(e,"tableProps.k373");let q=!1;for(let T=o.r1;T<=o.r2&&!q;T++)for(let X=o.c1;X<=o.c2&&!q;X++){const ee=n[T]?.cells[X];ee&&!ee.merged&&((ee.rowspan??1)>1||(ee.colspan??1)>1)&&(q=!0)}const U=(T,X,ee,ie={},ce)=>g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:T}),ce??""].filter(Boolean)),ae({value:X,...ie,onCommit:Te=>v(ee,op(Te))})]),V=m(e,"tableProps.k374"),j=T=>Lr({target:a,base:{},propKey:T,tipOverride:V,force:d,write:()=>v(T,void 0)}),J=t.options.tableDefaultPadding??1,pe={width:za(t.options.tableColWidths??[],i.c,a,J),height:Co(n,i.r,a,J)};return it(e,"table-cell",m(e,"tableProps.k375"),"Menu",[ga([d?fo(m(e,"tableProps.k376",{v0:l})):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k377")}),pr("cell-type",[{value:"text",label:m(e,"tableProps.k378")},{value:"barcode",label:m(e,"tableProps.k379")},{value:"qrcode",label:m(e,"tableProps.k380")},{value:"image",label:m(e,"tableProps.k381")}],Je,T=>{const X=T==="text"?void 0:T,ee={cellType:T};T!=="barcode"&&Object.assign(ee,{barcodeType:void 0,showBarcodeText:void 0,printerDpi:void 0,barQuietZone:void 0,barHeight:void 0}),T!=="qrcode"&&Object.assign(ee,{qrCodeLevel:void 0,qrQuietZone:void 0}),k(ie=>{ie.cellType=X,T!=="barcode"&&(ie.barcodeType=void 0,ie.showBarcodeText=void 0,ie.printerDpi=void 0,ie.barQuietZone=void 0,ie.barHeight=void 0),T!=="qrcode"&&(ie.qrCodeLevel=void 0,ie.qrQuietZone=void 0)},ee)})]),ue?kn(m(e,"tableProps.k382"),ho,ze(qP),T=>{T!=="__multi__"&&v("barcodeType",T||void 0)}):"",ue?$r(m(e,"tableProps.k383"),d?f.values.showBarcodeText===!0:a.showBarcodeText!==!1,T=>v("showBarcodeText",T),void 0,j("showBarcodeText")):"",ue?U(m(e,"tableProps.k384"),Ee("barWidth",a.barWidth??2),"barWidth",{min:2,max:8,step:.5,placeholder:ve("")},j("barWidth")):"",ue?fo((te?m(e,"tableProps.k385"):m(e,"tableProps.k386"))+(Me?`。${Me}`:"")):"",ue?Ge(m(e,"tableProps.k387"),ae({value:Ee("barQuietZone",a.barQuietZone),min:0,max:20,placeholder:ve(m(e,"tableProps.k388")),onCommit:T=>v("barQuietZone",T)}),m(e,"propertyTips.cd-bar-quiet-zone"),j("barQuietZone")):"",ue?Ge(m(e,"tableProps.k389"),ae({value:Ee("barHeight",a.barHeight),min:1,max:100,placeholder:ve(m(e,"tableProps.k390")),onCommit:T=>v("barHeight",T??void 0)}),m(e,"propertyTips.cd-bar-height"),j("barHeight")):"",ue?U(m(e,"tableProps.k391"),Ee("barFontSize",a.barFontSize??10),"barFontSize",{min:5,max:24,placeholder:ve(m(e,"tableProps.k392"))},j("barFontSize")):"",ue?kn(m(e,"tableProps.k393"),vn,ze([{value:"",label:m(e,"tableProps.k394")},{value:"203",label:m(e,"tableProps.k395")},{value:"300",label:m(e,"tableProps.k396")},{value:"600",label:m(e,"tableProps.k397")}]),T=>{if(T==="__multi__")return;const X=Number(T);v("printerDpi",X>0?X:void 0)},{reset:j("printerDpi")}):"",ue?fo(m(e,"tableProps.k398")):"",me?kn(m(e,"tableProps.k399"),wn,ze(jP),T=>{T!=="__multi__"&&v("qrCodeLevel",T||void 0)},{reset:j("qrCodeLevel")}):"",me?Ge(m(e,"tableProps.k400"),ae({value:Ee("qrQuietZone",a.qrQuietZone),min:0,max:8,placeholder:ve(m(e,"tableProps.k401")),onCommit:T=>v("qrQuietZone",T)}),m(e,"propertyTips.cd-quiet-zone"),j("qrQuietZone")):"",ue?fo(m(e,"tableProps.k402")):"",me||we?kn(m(e,"tableProps.k403"),xn,ze(Hs(e.t??oe)),T=>{T!=="__multi__"&&v("fit",T)},{reset:j("fit")}):"",we&&!d&&a.fit==="cover"?Qm(e,{fieldKey:"ap-img-object-position",label:m(e,"tableProps.k404"),src:xu(a.formatter),fit:a.fit,containerClass:"pd-cell-anchor",widthMm:pe.width,heightMm:pe.height,scale:a.fitScale,value:a.objectPosition,onCommit:T=>v("objectPosition",T),onScaleCommit:T=>v("fitScale",T),resetAnchor:j("objectPosition"),resetScale:j("fitScale")}):"",ue||me||we?U(m(e,"tableProps.k405"),Ee("maxWidth",Fr(a.maxWidth)),"maxWidth",{min:0,max:200,placeholder:ve(m(e,"tableProps.k406"))},j("maxWidth")):"",ue||me||we?U(m(e,"tableProps.k407"),Ee("maxHeight",Fr(a.maxHeight)),"maxHeight",{min:0,max:200,placeholder:ve(m(e,"tableProps.k408"))},j("maxHeight")):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k409")}),g("input",{class:"pd-input",type:"text",value:d?w("formatter")??"":a.formatter||"",placeholder:d?m(e,"tableProps.k410"):m(e,"tableProps.k411"),onChange:T=>v("formatter",T.target.value||void 0),onDblclick:()=>e.fire("table-cell-dblclick",{elementId:t.id,r:i.r,c:i.c,cellId:a.id})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k412")}),j("align")]),pr("cell-align",[{value:"left",label:m(e,"tableProps.k413")},{value:"center",label:m(e,"tableProps.k414")},{value:"right",label:m(e,"tableProps.k415")},{value:"justify",label:m(e,"tableProps.k416")}],d?f.values.align??"":a.align||"left",T=>v("align",T))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k417")}),j("valign")]),pr("cell-valign",[{value:"top",label:m(e,"tableProps.k418")},{value:"middle",label:m(e,"tableProps.k419")},{value:"bottom",label:m(e,"tableProps.k420")}],d?f.values.valign??"":a.valign||"top",T=>v("valign",T))]),g("div",{class:"cell-style-grid"},[g("div",{class:"pd-field cell-font-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k421")}),j("fontFamily")]),ha({id:"cell-font",state:e.state,fonts:e.host.fonts,value:d?w("fontFamily"):a.fontFamily,placeholder:ve(m(e,"tableProps.k422")),onChange:T=>v("fontFamily",T)})]),U(m(e,"tableProps.k423"),Ee("fontSize",Fr(a.fontSize)),"fontSize",{min:0,max:72,placeholder:ve(m(e,"tableProps.k424"))},j("fontSize")),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k425")}),j("fontWeight")]),g("input",{class:"pd-switch",type:"checkbox",checked:d?f.values.fontWeight==="bold":a.fontWeight==="bold",onChange:T=>v("fontWeight",T.target.checked?"bold":void 0)})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k426")}),j("color")]),dt(d?w("color"):a.color,T=>v("color",T),m(e,"tableProps.k427"))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k428")}),j("backgroundColor")]),dt(d?w("backgroundColor"):a.backgroundColor,T=>v("backgroundColor",T),m(e,"tableProps.k429"))])]),$t(m(e,"tableProps.k430")),g("div",{class:"border-style-row"},[zh(H,[...I?[{value:R,label:m(e,"tableProps.k431"),disabled:!0}]:[],...Yd.map(T=>({...T,label:m(e,T.labelKey)}))],T=>{T!==R&&ne(T)},{width:"90px"}),g("div",{style:{width:"112px",flexShrink:"0"}},[ae({value:le,min:.25,max:5,step:.25,placeholder:d?m(e,"tableProps.k432"):S?m(e,"tableProps.k433"):void 0,onCommit:T=>b("width",T)})]),dt(M,T=>b("color",T),m(e,"tableProps.k434"))]),g("div",{class:"pd-button-group border-presets"},[["all",m(e,"tableProps.k435")],["outer",m(e,"tableProps.k436")],["inner",m(e,"tableProps.k437")],["none",m(e,"tableProps.k438")]].map(([T,X])=>g("button",{type:"button",class:"pd-button small",text:X,onClick:()=>{nd(n,o,A.style==="none"?"none":T,Se()),r.updateElement(t.id,{tableRows:n})}}))),g("div",{class:"pd-checkbox-group"},rg.map(T=>g("label",{class:"pd-checkbox"},[g("input",{type:"checkbox",value:T.value,checked:Pe[T.value]==="on",indeterminate:Pe[T.value]==="mixed",onChange:X=>{const ie=X.target.checked&&A.style!=="none";d&&h({edges:{...f.edges,[T.value]:ie}}),k(ce=>{id(ce,T.value,ie?Se():null)})}}),g("span",{text:m(e,T.labelKey)})]))),fo(m(e,d?_b:F?Db:Cb)),U(m(e,"tableProps.k439"),Ee("padding",Fr(a.padding)),"padding",{min:0,max:10,step:.5,placeholder:ve(m(e,"tableProps.k440"))},j("padding")),$r(m(e,"tableProps.k441"),d?f.values.wordWrap===!0:a.wordWrap??!0,T=>v("wordWrap",T),void 0,j("wordWrap")),ke?kn(m(e,"tableProps.k442"),mo,ze(WP),T=>{T!=="__multi__"&&v("textFit",T)},{full:!0,reset:j("textFit")}):"",ke&&se==="shrink"?U(m(e,"tableProps.k443"),Ee("shrinkMinFontSize",Fr(a.shrinkMinFontSize)),"shrinkMinFontSize",{min:0,max:72,step:.5,placeholder:ve(m(e,"tableProps.k444"))},j("shrinkMinFontSize")):"",g("div",{class:"merge-card"},[g("div",{class:"merge-card-title",text:m(e,"tableProps.k445")}),g("div",{class:"merge-btns"},[g("button",{type:"button",class:"pd-button small",text:m(e,"tableProps.k446"),disabled:!!xe,title:xe||"",onClick:()=>{ed(n,o),r.updateElement(t.id,{tableRows:n})}}),g("button",{type:"button",class:"pd-button small",text:m(e,"tableProps.k447"),disabled:!q,onClick:()=>{td(n,o),r.updateElement(t.id,{tableRows:n})}})]),g("div",{class:"merge-card-divider"}),$r(m(e,"tableProps.k448"),d?f.values.mergeSameValue===!0:a.mergeSameValue===!0,T=>v("mergeSameValue",T),C||void 0,Dt?j("mergeSameValue"):void 0,!Dt),fo(m(e,"tableProps.k449"))])])])}const ip=ek;function ap(e){const t=e.trim();return t?/[{}]/.test(t)||/^[A-Za-z_$][\w$]*\s*\(/.test(t)?!0:/^[A-Za-z_$][\w$]*(\.[\w$]+)+$/.test(t):!1}function ZP(e){return e?e.mode==="binding"?e.binding??"":e.content??"":""}function JP(e){const t=e.store.templateData.watermark,r=ZP(t),o=t?.mode==="binding"||r!==""&&ap(r),n=(()=>{const l=t?.tileWidth??ge.tileWidth,d=t?.tileHeight??ge.tileHeight;for(const[u,c]of Object.entries(ip))if(c.width===l&&c.height===d)return u;return"custom"})(),i=l=>{const d={...t,testData:t?.testData??"",rotate:t?.rotate??ge.rotate,color:t?.color||ge.color,opacity:t?.opacity??ge.opacity,tileWidth:t?.tileWidth??ge.tileWidth,tileHeight:t?.tileHeight??ge.tileHeight};e.store.updateTemplateData({watermark:{...d,...l}})},a=()=>e.fire("open-expression",{elementId:"",targetPath:"watermark.content",value:r}),s={rotate:t?.rotate??ge.rotate,color:t?.color||ge.color,opacity:t?.opacity??ge.opacity,tileWidth:t?.tileWidth??ge.tileWidth,tileHeight:t?.tileHeight??ge.tileHeight},p=l=>Lr({target:s,base:ge,propKey:l,write:()=>i({[l]:ge[l]})});return g("div",{class:"watermark-config"},[$t(m(e,"watermark.k538")),g("form",{class:"pd-form",onSubmit:l=>l.preventDefault()},[g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"watermark.k539")}),g("input",{class:"pd-input",type:"text",value:r,placeholder:m(e,"watermark.k540"),title:m(e,"watermark.k541"),onChange:l=>{const d=l.target.value;i(ap(d)?{mode:"binding",binding:d,content:""}:{mode:"fixed",content:d,binding:""})},onDblclick:a}),g("button",{type:"button",class:"pd-button small",text:m(e,"watermark.k542"),onClick:a})]),o?he(m(e,"watermark.k543"),g("input",{class:"pd-input",type:"text",value:t?.testData??"",placeholder:m(e,"watermark.k544"),onChange:l=>i({testData:l.target.value})})):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k545")}),p("rotate")]),g("input",{type:"range",class:"pd-range",min:-90,max:90,step:5,value:String(t?.rotate??ge.rotate),onChange:l=>i({rotate:Number(l.target.value)})}),g("span",{class:"pd-hint",text:`${t?.rotate??ge.rotate}°`})]),he(m(e,"watermark.k546"),dt(t?.color||ge.color,l=>i({color:l}),m(e,"watermark.k547")),void 0,p("color")),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k548")}),p("opacity")]),g("input",{type:"range",class:"pd-range",min:.05,max:.5,step:.05,value:String(t?.opacity??ge.opacity),onChange:l=>i({opacity:Number(l.target.value)})}),g("span",{class:"pd-hint",text:(t?.opacity??ge.opacity).toFixed(2)})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"watermark.k549")}),g("select",{class:"pd-select",style:{width:"100%"},onChange:l=>{const d=l.target.value,u=ip[d];u&&i({tileWidth:u.width,tileHeight:u.height})}},[...Object.entries(ip).map(([l,d])=>g("option",{value:l,text:`${m(e,d.labelKey)}${m(e,"constants.watermark.density.size",{w:d.width,h:d.height})}`,selected:n===l})),g("option",{value:"custom",text:m(e,"watermark.k550"),selected:n==="custom"})])]),n==="custom"?g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k551")}),p("tileWidth")]),g("input",{type:"number",class:"pd-input",min:ge.minTileWidth,step:10,value:String(t?.tileWidth??ge.tileWidth),onChange:l=>i({tileWidth:Number(l.target.value)})})]):"",n==="custom"?g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k552")}),p("tileHeight")]),g("input",{type:"number",class:"pd-input",min:ge.minTileHeight,step:10,value:String(t?.tileHeight??ge.tileHeight),onChange:l=>i({tileHeight:Number(l.target.value)})})]):""].filter(Boolean))])}function Fe(e,t,r,o,n={},i){return he(t,ae({value:r,...n,onCommit:o}),void 0,i)}function Xt(e,t,r,o,n,i,a){const s=document.createElement("select");s.className="pd-select",s.addEventListener("change",()=>n(s.value));for(const p of o){const l=document.createElement("option");l.value=p.value,l.textContent=p.label,s.appendChild(l)}return s.value=r,o.some(p=>p.value===r)||(s.selectedIndex=-1),i?Ge(t,s,i,a):he(t,s,void 0,a)}function zr(e,t,r,o,n){return he(t,g("input",{type:"checkbox",class:"pd-switch",checked:r,onChange:i=>o(i.target.checked)}),void 0,n)}const QP=[{value:"all",labelKey:"propertyPanel.k177"},{value:"outer",labelKey:"propertyPanel.k178"},{value:"inner",labelKey:"propertyPanel.k179"},{value:"none",labelKey:"propertyPanel.k180"}],e3=[{value:"top",labelKey:"propertyPanel.k181"},{value:"right",labelKey:"propertyPanel.k182"},{value:"bottom",labelKey:"propertyPanel.k183"},{value:"left",labelKey:"propertyPanel.k184"}];function t3(e,t){const r=e.store,o=t.options,n=t.printElementType.type,i=M=>r.updateElement(t.id,M),a=Kh(n),s=a==="text",p=a==="code",l=a==="table",d=l&&r.tableSelection?.elementId===t.id,u=d&&La(t.options.tableRows??[],r.tableSelection).mode==="multi",c=[];u||c.push(zP(e,t));const f=es(n),h=(M,ne)=>{const Se=p1(ne);return Lr({target:o,base:f,propKey:M,tipValue:Se?.value,tipUnit:Se?.unit,write:()=>i({[M]:f[M]})})};d||c.push(it(e,"position-size",m(e,"propertyPanel.k185"),"Location",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[g("div",{class:"position-grid"},[G(e,"ps-left",Fe(e,"X",o.left,M=>i({left:M}),{min:0})),G(e,"ps-top",Fe(e,"Y",o.top,M=>i({top:M}),{min:0})),G(e,"ps-width",Fe(e,"W",o.width,M=>i({width:M}),{min:4})),G(e,"ps-height",Fe(e,"H",o.height,M=>i({height:M}),{min:4}))]),g("h3",{class:"pd-divider",text:m(e,"propertyPanel.k186")}),g("div",{class:"margin-grid"},[G(e,"ps-margin-top",Fe(e,m(e,"propertyPanel.k187"),o.marginTop,M=>i({marginTop:M===0?void 0:M}),{},h("marginTop","ps-margin-top"))),G(e,"ps-margin-right",Fe(e,m(e,"propertyPanel.k188"),o.marginRight,M=>i({marginRight:M===0?void 0:M}),{},h("marginRight","ps-margin-right"))),G(e,"ps-margin-bottom",Fe(e,m(e,"propertyPanel.k189"),o.marginBottom,M=>i({marginBottom:M===0?void 0:M}),{},h("marginBottom","ps-margin-bottom"))),G(e,"ps-margin-left",Fe(e,m(e,"propertyPanel.k190"),o.marginLeft,M=>i({marginLeft:M===0?void 0:M}),{},h("marginLeft","ps-margin-left")))])])]));const b=typeof o.rotate=="number"&&Number.isFinite(o.rotate)&&o.rotate!==0?Ro(o.rotate):void 0,k=M=>i({rotate:M===void 0||M===0?void 0:Ro(M)}),v=g0(n,o),w=Rd(n)||Fd(r.elements).has(t.id),P=w?"":G(e,"ap-rotate",Ge(m(e,"propertyPanel.k191"),g("div",{class:"pd-rotate-row"},[g("button",{type:"button",class:"pd-rotate-btn",title:m(e,"propertyPanel.k192"),"aria-label":m(e,"propertyPanel.k193"),text:"↺",onClick:()=>k((b??0)-90)}),g("div",{class:"pd-rotate-stepper"},[ae({value:b,min:0,max:359,placeholder:"0",disabled:!v,onCommit:M=>k(M)})]),g("button",{type:"button",class:"pd-rotate-btn",title:m(e,"propertyPanel.k194"),"aria-label":m(e,"propertyPanel.k195"),text:"↻",onClick:()=>k((b??0)+90)})]),m(e,"propertyTips.ap-rotate"),h("rotate","ap-rotate"))),E=w||v?"":g("p",{class:"pd-hint pd-rotate-note",text:m0(e.t??oe)});if(c.push(it(e,"appearance",m(e,"propertyPanel.k196"),"Brush",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},s?[G(e,"ap-font-family",he(m(e,"propertyPanel.k197"),ha({id:"prop-font",state:e.state,fonts:e.host.fonts,value:typeof o.fontFamily=="string"?o.fontFamily:void 0,placeholder:m(e,"propertyPanel.k198"),onChange:M=>i({fontFamily:M})}),void 0,h("fontFamily","ap-font-family"))),G(e,"ap-font-size",Fe(e,m(e,"propertyPanel.k199"),o.fontSize,M=>i({fontSize:M}),{min:8,max:72},h("fontSize","ap-font-size"))),G(e,"ap-font-weight",Xt(e,m(e,"propertyPanel.k200"),String(o.fontWeight??""),[{value:"normal",label:m(e,"propertyPanel.k201")},{value:"bold",label:m(e,"propertyPanel.k202")},{value:"bolder",label:m(e,"propertyPanel.k203")},{value:"lighter",label:m(e,"propertyPanel.k204")}],M=>i({fontWeight:M}),void 0,h("fontWeight","ap-font-weight"))),G(e,"ap-align",he(m(e,"propertyPanel.k205"),pr("ta",[{value:"left",label:m(e,"propertyPanel.k206")},{value:"center",label:m(e,"propertyPanel.k207")},{value:"right",label:m(e,"propertyPanel.k208")},{value:"justify",label:m(e,"propertyPanel.k209")}],o.textAlign||"left",M=>i({textAlign:M})),void 0,h("textAlign","ap-align"))),G(e,"ap-vertical-align",he(m(e,"propertyPanel.k210"),pr("va",[{value:"top",label:m(e,"propertyPanel.k211")},{value:"middle",label:m(e,"propertyPanel.k212")},{value:"bottom",label:m(e,"propertyPanel.k213")}],o.verticalAlign||"top",M=>i({verticalAlign:M})),void 0,h("verticalAlign","ap-vertical-align"))),g("div",{class:"color-row"},[G(e,"ap-color",he(m(e,"propertyPanel.k214"),dt(o.color,M=>i({color:M}),m(e,"propertyPanel.k215")),void 0,h("color","ap-color"))),G(e,"ap-bg-color",he(m(e,"propertyPanel.k216"),dt(o.backgroundColor,M=>i({backgroundColor:M}),m(e,"propertyPanel.k217")),void 0,h("backgroundColor","ap-bg-color")))]),G(e,"ap-line-height",Fe(e,m(e,"propertyPanel.k218"),o.lineHeight,M=>i({lineHeight:M||void 0}),{min:0,max:100},h("lineHeight","ap-line-height"))),G(e,"ap-letter-spacing",Fe(e,m(e,"propertyPanel.k219"),o.letterSpacing,M=>i({letterSpacing:M||void 0}),{min:0,max:20,step:.5},h("letterSpacing","ap-letter-spacing"))),G(e,"ap-text-fit",Xt(e,m(e,"propertyPanel.k220"),Ln(n,o),[{value:"clip",label:m(e,"propertyPanel.k221")},{value:"shrink",label:m(e,"propertyPanel.k222")},{value:"autoHeight",label:m(e,"propertyPanel.k223")}],M=>i({textFit:M}),void 0,h("textFit","ap-text-fit"))),o.textFit==="shrink"?G(e,"ap-shrink-min",he(m(e,"propertyPanel.k224"),ae({value:o.shrinkMinFontSize,min:1,max:72,step:.5,placeholder:m(e,"propertyPanel.k225"),onCommit:M=>i({shrinkMinFontSize:M||void 0})}),void 0,h("shrinkMinFontSize","ap-shrink-min"))):"",n==="longText"?G(e,"ap-long-text-indent",Ge(m(e,"propertyPanel.k226"),ae({value:o.longTextIndent,min:0,max:10,placeholder:m(e,"propertyPanel.k227"),onCommit:M=>i({longTextIndent:M||void 0})}),m(e,"propertyTips.ap-long-text-indent"),h("longTextIndent","ap-long-text-indent"))):"",G(e,"ap-word-wrap",zr(e,m(e,"propertyPanel.k228"),o.wordWrap!==!1,M=>i({wordWrap:M?void 0:!1}),h("wordWrap","ap-word-wrap"))),G(e,"ap-keep-line-breaks",zr(e,m(e,"propertyPanel.k229"),o.keepLineBreaks===!0,M=>i({keepLineBreaks:M?!0:void 0}),h("keepLineBreaks","ap-keep-line-breaks"))),P,E]:[n==="image"?G(e,"ap-img-fit",Xt(e,m(e,"propertyPanel.k230"),String(o.fit??"contain"),Hs(e.t??oe),M=>i({fit:M}),m(e,"propertyTips.ap-img-fit"),h("fit","ap-img-fit"))):"",n==="image"&&o.fit==="cover"?G(e,"ap-img-object-position",Qm(e,{fieldKey:"ap-img-object-position",label:m(e,"propertyPanel.k231"),src:xu(o.src),widthMm:Number(o.width)||0,heightMm:Number(o.height)||0,fit:o.fit,scale:o.fitScale,value:o.objectPosition===void 0?void 0:String(o.objectPosition),onCommit:M=>i({objectPosition:M}),onScaleCommit:M=>i({fitScale:M}),resetAnchor:h("objectPosition","ap-img-object-position"),resetScale:h("fitScale","ap-img-fit-scale")})):"",P,E,n==="flowList"?g("p",{class:"pd-empty",text:m(e,"propertyPanel.k232")}):""].filter(Boolean))])),p){const M=n==="barcode",ne=String(o.barcodeType||"CODE128").toUpperCase(),Se=o.printerDpi?String(o.printerDpi):"",Pe=Td(o.printerDpi,o.barWidth,e.t??oe);c.push(it(e,"code",m(e,"propertyPanel.k233"),"Postcard",[g("form",{class:"pd-form",onSubmit:K=>K.preventDefault()},[M?[G(e,"cd-type",Xt(e,m(e,"propertyPanel.k234"),ne,[{value:"CODE128",label:m(e,"propertyPanel.k235")},{value:"EAN13",label:m(e,"propertyPanel.k236")},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],K=>i({barcodeType:K==="CODE128"?void 0:K}))),G(e,"cd-dpi",Xt(e,m(e,"propertyPanel.k237"),Se,[{value:"",label:m(e,"propertyPanel.k238")},{value:"203",label:m(e,"propertyPanel.k239")},{value:"300",label:m(e,"propertyPanel.k240")},{value:"600",label:m(e,"propertyPanel.k241")}],K=>i({printerDpi:Number(K)>0?Number(K):void 0}),void 0,h("printerDpi","cd-dpi"))),G(e,"cd-dpi",g("p",{class:"pd-hint",text:m(e,"propertyPanel.k242")})),G(e,"cd-bar-width",Fe(e,m(e,"propertyPanel.k243"),o.barWidth??2,K=>i({barWidth:K}),{min:2,max:8,step:.5},h("barWidth","cd-bar-width"))),G(e,"cd-bar-width",g("p",{class:"pd-hint",text:(Se?m(e,"propertyPanel.k244"):m(e,"propertyPanel.k245"))+(Pe?`。${Pe}`:"")})),G(e,"cd-bar-quiet-zone",Ge(m(e,"propertyPanel.k246"),ae({value:o.barQuietZone,min:0,max:20,placeholder:m(e,"propertyPanel.k247"),onCommit:K=>i({barQuietZone:K})}),m(e,"propertyTips.cd-bar-quiet-zone"),h("barQuietZone","cd-bar-quiet-zone"))),G(e,"cd-bar-height",Ge(m(e,"propertyPanel.k248"),ae({value:o.barHeight,min:1,max:100,placeholder:m(e,"propertyPanel.k249"),onCommit:K=>i({barHeight:K??void 0})}),m(e,"propertyTips.cd-bar-height"),h("barHeight","cd-bar-height"))),G(e,"cd-show-text",zr(e,m(e,"propertyPanel.k250"),o.hideTitle!==!0,K=>i({hideTitle:K?void 0:!0}),h("hideTitle","cd-show-text"))),G(e,"cd-font-size",he(m(e,"propertyPanel.k251"),ae({value:o.fontSize,min:5,max:24,placeholder:m(e,"propertyPanel.k252"),onCommit:K=>i({fontSize:K||void 0})}),void 0,h("fontSize","cd-font-size")))]:[G(e,"cd-ec-level",Xt(e,m(e,"propertyPanel.k253"),String(o.qrCodeLevel??"M"),[{value:"L",label:m(e,"propertyPanel.k254")},{value:"M",label:m(e,"propertyPanel.k255")},{value:"Q",label:"Q"},{value:"H",label:m(e,"propertyPanel.k256")}],K=>i({qrCodeLevel:K}),void 0,h("qrCodeLevel","cd-ec-level"))),G(e,"cd-quiet-zone",Ge(m(e,"propertyPanel.k257"),ae({value:o.qrQuietZone,min:0,max:8,placeholder:m(e,"propertyPanel.k258"),onCommit:K=>i({qrQuietZone:K})}),m(e,"propertyTips.cd-quiet-zone"),h("qrQuietZone","cd-quiet-zone")))],$t(m(e,"propertyPanel.k259")),M?g("p",{class:"pd-hint",text:m(e,"propertyPanel.k260")}):"",M?"":G(e,"cd-fit",Xt(e,m(e,"propertyPanel.k261"),String(o.fit||"contain"),Hs(e.t??oe),K=>i({fit:K||void 0}),void 0,h("fit","cd-fit"))),G(e,"cd-max-width",he(m(e,"propertyPanel.k262"),ae({value:o.maxWidth,min:1,max:200,placeholder:m(e,"propertyPanel.k263"),onCommit:K=>i({maxWidth:K||void 0})}),void 0,h("maxWidth","cd-max-width"))),G(e,"cd-max-height",he(m(e,"propertyPanel.k264"),ae({value:o.maxHeight,min:1,max:200,placeholder:m(e,"propertyPanel.k265"),onCommit:K=>i({maxHeight:K||void 0})}),void 0,h("maxHeight","cd-max-height")))].flat().filter(Boolean))]))}if(d&&(c.push(GP(e,t)),c.push(XP(e,t))),l&&c.push(KP(e,t)),n==="flowList"){const M=bt(o.flowColumns),ne=or(o.flowRowHeight),Se=Et(o.flowGapX),Pe=xr(o.flowMaxSpan,M),K=r0(o.width??0,Se,o.fontSize??12),ue=wr(o.flowLayoutMode),me=ue==="dynamic",we=Gr(o),ke=(te,Me)=>{i({[te]:typeof Me=="number"&&Number.isFinite(Me)&&Me>0?Me:0})};c.push(it(e,"flowList",m(e,"propertyPanel.k266"),"Grid3x3",[g("form",{class:"pd-form",onSubmit:te=>te.preventDefault()},[G(e,"fl-layout-mode",Xt(e,m(e,"propertyPanel.k267"),ue,[{value:"fixed",label:m(e,"propertyPanel.k268")},{value:"dynamic",label:m(e,"propertyPanel.k269")}],te=>i({flowLayoutMode:te==="dynamic"?"dynamic":"fixed"}),m(e,"propertyTips.fl-layout-mode"))),...me?[G(e,"fl-padding-top",Ge(m(e,"propertyPanel.k270"),ae({value:we.top,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingTop",te)}),m(e,"propertyTips.fl-padding-top"))),G(e,"fl-padding-right",Ge(m(e,"propertyPanel.k271"),ae({value:we.right,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingRight",te)}),m(e,"propertyTips.fl-padding-right"))),G(e,"fl-padding-bottom",Ge(m(e,"propertyPanel.k272"),ae({value:we.bottom,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingBottom",te)}),m(e,"propertyTips.fl-padding-bottom"))),G(e,"fl-padding-left",Ge(m(e,"propertyPanel.k273"),ae({value:we.left,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingLeft",te)}),m(e,"propertyTips.fl-padding-left")))]:[],G(e,"fl-columns",Ge(m(e,"propertyPanel.k274"),ae({value:M,min:1,max:12,onCommit:te=>i({flowColumns:bt(te),flowMaxSpan:xr(o.flowMaxSpan,bt(te))})}),m(e,"propertyTips.fl-columns"))),G(e,"fl-row-height",Ge(m(e,"propertyPanel.k275"),ae({value:ne,min:3,max:100,step:.5,onCommit:te=>i({flowRowHeight:or(te)})}),m(e,"propertyTips.fl-row-height"))),G(e,"fl-gap-x",Ge(m(e,"propertyPanel.k276"),ae({value:Se,min:0,max:50,step:.5,onCommit:te=>i({flowGapX:Et(te)})}),m(e,"propertyTips.fl-gap-x"))),G(e,"fl-auto-span",zr(e,m(e,"propertyPanel.k277"),o.flowAutoSpan===!0,te=>{i(te?{flowAutoSpan:te,flowMaxSpan:Pe}:{flowAutoSpan:te})})),o.flowAutoSpan===!0?G(e,"fl-max-span",Ge(m(e,"propertyPanel.k278"),ae({value:Pe,min:1,max:M,onCommit:te=>i({flowMaxSpan:xr(te,M)})}),m(e,"propertyTips.fl-max-span"))):"",M>K?g("p",{class:"pd-hint",text:m(e,"propertyPanel.k279",{v0:M,v1:K,v2:M})}):""].flat().filter(Boolean))]))}const D=()=>({borderWidth:o.borderWidth,borderStyle:o.borderStyle,borderColor:o.borderColor,borders:o.borders}),O=M=>{const ne=D();Xd(ne,M,Qd(ne)),i(ne)},A=M=>{const ne=D();is(ne,M,!Fo(ne,M)),i(ne)},R=Jd(o),_=R.style==="mixed",I=typeof R.width=="number"?R.width:void 0,S=_||R.style===void 0?"":R.style,N=typeof R.color=="string"?R.color:void 0,F=(M,ne)=>{const Se=D();j0(Se,M,ne),i(Se)},H=Yd.map(M=>({...M,label:m(e,M.labelKey)})),le=_?[{value:"",label:m(e,"propertyPanel.k280")},...H]:H;return c.push(it(e,"border-bg",m(e,"propertyPanel.k281"),"Picture",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[G(e,"bb-border-style",Xt(e,m(e,"propertyPanel.k282"),S,le,M=>F("borderStyle",M))),g("div",{class:"border-row"},[G(e,"bb-border-width",Fe(e,m(e,"propertyPanel.k283"),I,M=>F("borderWidth",M),{min:0,max:20,step:.25,placeholder:R.width==="mixed"?m(e,"propertyPanel.k284"):void 0},h("borderWidth","bb-border-width"))),G(e,"bb-border-color",he(m(e,"propertyPanel.k285"),dt(N,M=>F("borderColor",M),m(e,"propertyPanel.k286")),void 0,h("borderColor","bb-border-color")))]),...$n(n)?[g("div",{class:"pd-button-group border-presets"},QP.map(M=>g("button",{type:"button",class:"pd-button small",text:m(e,M.labelKey),disabled:M.value==="inner",onClick:()=>O(M.value)}))),g("div",{class:"pd-checkbox-group"},e3.map(M=>g("label",{class:"pd-checkbox"},[g("input",{type:"checkbox",checked:Fo(o,M.value),onChange:()=>A(M.value)}),g("span",{text:m(e,M.labelKey)})]))),g("p",{class:"pd-hint",text:m(e,N0)})]:[],G(e,"bb-bg-color",he(m(e,"propertyPanel.k287"),dt(o.backgroundColor,M=>i({backgroundColor:M}),m(e,"propertyPanel.k288")),void 0,h("backgroundColor","bb-bg-color")))])])),c.push(YP(e,t)),c.push(it(e,"advanced",m(e,"propertyPanel.k289"),"Setting",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[g("div",{class:"advanced-row"},[G(e,"ad-locked",zr(e,m(e,"propertyPanel.k290"),!!o.locked,M=>i({locked:M}),h("locked","ad-locked"))),G(e,"ad-fixed",zr(e,m(e,"propertyPanel.k291"),!!o.repeatOnEveryPage,M=>i({repeatOnEveryPage:M}),h("repeatOnEveryPage","ad-fixed"))),G(e,"ad-fixed-position",zr(e,m(e,"propertyPanel.k292"),!!o.fixed,M=>i({fixed:M}),h("fixed","ad-fixed-position")))]),G(e,"ad-z-index",Fe(e,m(e,"propertyPanel.k293"),o.zIndex,M=>i({zIndex:M}),{min:0,max:999},h("zIndex","ad-z-index"))),G(e,"ad-delete",g("div",{class:"pd-field"},[g("button",{type:"button",class:"pd-button danger",text:m(e,"propertyPanel.k294"),onClick:()=>r.deleteSelected()})]))])],!1,[g("button",{type:"button",class:"group-help",title:m(e,"propertyPanel.k295"),"aria-label":m(e,"propertyPanel.k296"),text:"?",onClick:M=>{M.stopPropagation(),e.fire("help","advanced-settings")}})])),g("div",{class:"property-content"},c)}function r3(e){const t=e.store,r=t.templateData,o=p=>t.updateTemplateData(p),n=p=>{const l=r.tiling,d=u=>u===90||u===270;if(l?.enabled&&d(p)!==d(r.outputRotation)){const u=hu({...r,outputRotation:p});o({outputRotation:p,tiling:{...l,columns:Math.max(u,1)}});return}o({outputRotation:p})},i=[];for(const[p,l]of Object.entries(Lt)){const d=m(e,`constants.paper.group.${l.group}`);let u=i.find(c=>c.group===d);u||(u={group:d,items:[]},i.push(u)),u.items.push({key:p,label:m(e,l.labelKey)})}const a=!Lt[r.paperSize],s=Gn(r.paperSize);return g("form",{class:"pd-form",onSubmit:p=>p.preventDefault()},[$t(m(e,"propertyPanel.k298")),he(m(e,"propertyPanel.k299"),g("select",{class:"pd-select",style:{width:"100%"},onChange:p=>o({paperSize:p.target.value})},[...i.map(p=>g("optgroup",{label:p.group},p.items.map(l=>g("option",{value:l.key,text:l.label,selected:r.paperSize===l.key})))),g("option",{value:"CUSTOM",text:m(e,"propertyPanel.k300"),selected:a})])),s||a?he(s?m(e,"propertyPanel.k301"):m(e,"propertyPanel.k302"),g("div",{class:"custom-size-grid"},[ae({value:Number(r.customWidth??0),min:25,max:2e3,onCommit:p=>o({customWidth:p})}),...a?[g("span",{class:"custom-size-x",text:"×"}),ae({value:Number(r.customHeight??0),min:25,max:2e3,onCommit:p=>o({customHeight:p})})]:[]])):"",s?"":he(m(e,"propertyPanel.k303"),pr("ori",[{value:"portrait",label:m(e,"propertyPanel.k304")},{value:"landscape",label:m(e,"propertyPanel.k305")}],r.orientation==="landscape"?"landscape":"portrait",p=>o({orientation:p})),m(e,"propertyPanel.k306")),s?"":he(m(e,"propertyPanel.k307"),pr("rot",[{value:"0",label:"0°"},{value:"90",label:"90°"},{value:"180",label:"180°"},{value:"270",label:"270°"}],String(r.outputRotation??0),p=>n(Number(p)),!0),r.tiling?.enabled?m(e,"propertyPanel.k308"):m(e,"propertyPanel.k309")),he(m(e,"propertyPanel.k310"),g("div",{class:"page-bg-row"},[dt(r.pageBackground,p=>o({pageBackground:p}),m(e,"propertyPanel.k311"),"page-bg-picker")]),void 0,Lr({target:r,base:{pageBackground:void 0},propKey:"pageBackground",write:()=>o({pageBackground:void 0})})),MP(e),t.pages.length>1?"":CP(e),$t(m(e,"propertyPanel.k312")),g("div",{class:"margin-grid"},[Fe(e,m(e,"propertyPanel.k313"),r.margins.top,p=>o({margins:{...r.margins,top:p}}),{min:0,max:50}),Fe(e,m(e,"propertyPanel.k314"),r.margins.bottom,p=>o({margins:{...r.margins,bottom:p}}),{min:0,max:100}),Fe(e,m(e,"propertyPanel.k315"),r.margins.left,p=>o({margins:{...r.margins,left:p}}),{min:0,max:50}),Fe(e,m(e,"propertyPanel.k316"),r.margins.right,p=>o({margins:{...r.margins,right:p}}),{min:0,max:50})]),$t(m(e,"propertyPanel.k317")),Fe(e,m(e,"propertyPanel.k318"),r.header.height??10,p=>o({header:{...r.header,height:p}}),{min:0,max:100,step:.1}),Fe(e,m(e,"propertyPanel.k319"),r.footer.height??10,p=>o({footer:{...r.footer,height:p}}),{min:0,max:100,step:.1}),JP(e)].filter(Boolean))}function o3(e,t,r){const o=(e.state.propSearch??"").trim(),n=!o||lc(o,[...r.searchKeywords,r.label]),i=document.createElement("div");if(i.className="property-content",n)try{xm(`property:${t.id}`,r.ui.renderProperty({element:t,data:e.host.designData?.length?e.host.designData:[vt],fields:e.host.fields??[],update:a=>e.store.updateElement(t.id,a),repaint:()=>e.repaint(),t:e.t??oe}),i)}catch{}return g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:custom"},style:e.state.propTab==="custom"?"":{display:"none"}},[i])}function n3(e){const t=e.store,r=e.state,o=t.selectedElement,n=o?_l(o):void 0;if(r.propCollapsed)return g("div",{class:"property-panel collapsed"},[g("div",{class:"prop-collapsed"},[g("button",{type:"button",class:"pc-btn",title:m(e,"propertyPanel.k320"),text:"«",onClick:()=>{r.propCollapsed=!1,e.repaint()}}),...n?[g("button",{type:"button",class:`pc-btn${r.propTab==="custom"?" on":""}`,title:n.label,html:je(n.icon,14)||je("Shapes",14),onClick:()=>{r.propTab="custom",r.propCollapsed=!1,e.repaint()}})]:[],...[["element",m(e,"propertyPanel.k321"),"▦"],["page",m(e,"propertyPanel.k322"),"▤"]].map(([a,s,p])=>g("button",{type:"button",class:`pc-btn${r.propTab===a?" on":""}`,title:s,text:p,onClick:()=>{r.propTab=a,r.propCollapsed=!1,e.repaint()}}))])]);const i=o?r.propTab==="custom"&&!n?"element":r.propTab:"page";return g("div",{class:"property-panel"},[g("div",{class:"prop-head"},[g("span",{class:"prop-title",text:m(e,"propertyPanel.k323")}),g("button",{type:"button",class:"collapse-btn",title:m(e,"propertyPanel.k324"),text:"»",onClick:()=>{r.propCollapsed=!0,e.repaint()}})]),g("div",{class:"pd-tabs prop-tabs"},[g("div",{class:"pd-tab-bar",role:"tablist"},[...n?[g("button",{type:"button",class:`pd-tab${i==="custom"?" active":""}`,text:n.label,onClick:()=>{r.propTab="custom",e.repaint()}})]:[],g("button",{type:"button",class:`pd-tab${i==="element"?" active":""}`,text:m(e,"propertyPanel.k325"),onClick:()=>{r.propTab="element",e.repaint()}}),g("button",{type:"button",class:`pd-tab${i==="page"?" active":""}`,text:m(e,"propertyPanel.k326"),onClick:()=>{r.propTab="page",e.repaint()}})]),n&&o?o3(e,o,n):"",g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:element"},style:i==="element"?"":{display:"none"}},o?[IP(e),t3(e,o)]:[g("p",{class:"pd-empty",text:m(e,"propertyPanel.k327")})]),g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:page"},style:i==="page"?"":{display:"none"}},[r3(e)])].filter(Boolean))])}var W=lr,i3={Check:'<path d="M20 6 9 17l-5-5" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />'};function a3(e,t=16){return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${i3[e]??""}</svg>`}function ka(e){const t=typeof e=="string"?e.trim().toLowerCase():"";return t==="label"||t==="key"||t==="both"?t:"both"}function sp(){return[{key:"field",text:W("expression.tabField")},{key:"variable",text:W("expression.tabVariable")},{key:"function",text:W("expression.tabFunction")}]}function og(){return{field:W("expression.placeholderField"),variable:W("expression.placeholderVariable"),function:W("expression.placeholderFunction")}}function s3(){return[{name:"SUM",label:W("expression.fnSum"),template:"SUM()"},{name:"AVG",label:W("expression.fnAvg"),template:"AVG()"},{name:"COUNT",label:W("expression.fnCount"),template:"COUNT()"},{name:"MIN",label:W("expression.fnMin"),template:"MIN()"},{name:"MAX",label:W("expression.fnMax"),template:"MAX()"}]}function l3(){return[{name:"ADD",label:W("expression.fnAdd"),template:"ADD()"},{name:"SUB",label:W("expression.fnSub"),template:"SUB()"},{name:"MUL",label:W("expression.fnMul"),template:"MUL()"},{name:"DIV",label:W("expression.fnDiv"),template:"DIV()"},{name:"ROUND",label:W("expression.fnRound"),template:"ROUND()"},{name:"ROUNDUP",label:W("expression.fnRoundUp"),template:"ROUNDUP()"},{name:"ROUNDDOWN",label:W("expression.fnRoundDown"),template:"ROUNDDOWN()"},{name:"ROUNDBANK",label:W("expression.fnRoundBank"),template:"ROUNDBANK()"}]}function p3(){return[{name:"MONEY",label:W("expression.fnMoney"),template:"MONEY()"},{name:"DATE",label:W("expression.fnDate"),template:"DATE()"},{name:"UPPER",label:W("expression.fnUpper"),template:"UPPER()"},{name:"IF",label:W("expression.fnIf"),template:"IF()"}]}function d3(){return[{name:"pageIndex",label:W("expression.varPageIndex"),template:"{pageIndex}"},{name:"totalPages",label:W("expression.varTotalPages"),template:"{totalPages}"},{name:"printDate",label:W("expression.varPrintDate"),template:"{printDate}"},{name:"printTime",label:W("expression.varPrintTime"),template:"{printTime}"}]}function c3(){return[{title:W("expression.groupAggregate"),items:s3()},{title:W("expression.groupMath"),items:l3()},{title:W("expression.groupFormat"),items:p3()}]}var u3="expression.previewEmpty",f3="expression.previewNoValue",lp="expression.previewError";function ng(e,t){if(!e.trim())return W(u3);try{const r={...vt,...t??{},...Qn()},o=to(e,r);return o==null?W(f3):String(o)}catch{return W(lp)}}function ig(e,t){const r=t.trim().toLowerCase();return r?e.filter(o=>o.label.toLowerCase().includes(r)||o.name.toLowerCase().includes(r)):e}function h3(e,t){const r=e.substring(0,t),o=r.lastIndexOf("{"),n=o!==-1&&!r.slice(o+1).includes("}"),i=r.lastIndexOf("("),a=i!==-1&&!r.slice(i+1).includes(")");return{insideBlock:n,insideParens:a}}var m3=e=>/[\u4e00-\u9fff]/.test(e),g3=e=>`字段「${e}」含中文,请用 {${e}} 引用(函数参数内写 ${e});中文可直接在 {} 中使用,无需 data['...'] 方括号`;function b3(e,t){const r=/^\{\s*([^{}]+?)\s*\}$/.exec(e.trim());if(!r)return null;const o=r[1]??"";return t.find(n=>n.fieldKey===o)??null}function pp(e,t,r="both"){return r==="label"?g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-label",text:e})]):r==="key"?g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-key is-primary",text:t})]):g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-label",text:e}),g("span",{class:"ee-item-key",text:t})])}function Ht(e){return e.currentTarget.getRootNode()}function ya(e,t,r){const o=[];return r.forEach((n,i)=>{o.push(n),i<r.length-1&&o.push(g("br"))}),g("div",{class:`ee-help-card ${e}`},[g("div",{class:"ee-help-card-title",text:t}),g("div",{class:"ee-help-card-content"},o)])}function k3(){return g("div",{class:"ee-help-section"},[g("div",{class:"ee-help-title",text:W("expression.k1")}),g("div",{class:"ee-help-grid"},[ya("ee-help-field",W("expression.k2"),[W("expression.k3"),W("expression.k4"),W("expression.k5"),W("expression.k6"),W("expression.k7"),W("expression.k8"),W("expression.k9")]),ya("ee-help-function",W("expression.k10"),[W("expression.k11"),W("expression.k12"),W("expression.k13"),W("expression.k14"),W("expression.k15"),W("expression.k16")]),ya("ee-help-variable",W("expression.k17"),[W("expression.k18"),W("expression.k19"),W("expression.k20")]),ya("ee-help-conditional",W("expression.k21"),[W("expression.k22"),W("expression.k23"),W("expression.k24"),W("expression.k25"),W("expression.k26")])])])}function y3(e,t){W=e.t??lr;const r=ka(e.fieldDisplay),o={activeTab:"field",searchText:"",expression:t.value||"",binding:t.binding,copiedFieldKey:"",keyHint:""},n=(v,w)=>v.querySelector(w),i=v=>{const w=n(v,".ee-preview");if(!w)return;const P=ng(o.expression,e.demoData);w.textContent=P,w.classList.toggle("ee-preview-error",P===W(lp))},a=v=>{const w=n(v,".ee-key-hint");w&&(w.textContent=o.keyHint,w.style.display=o.keyHint?"":"none")},s=()=>{if(o.activeTab==="variable")return ig(d3(),o.searchText).map(P=>g("div",{class:"ee-list-item",onDblclick:E=>{const{insideParens:D}=d(E);u(Ht(E),D?P.template.replace(/^\{|\}$/g,""):P.template,void 0,"")}},[pp(P.label,P.template)]));if(o.activeTab==="function")return c3().map(P=>g("div",{class:"ee-func-group"},[g("div",{class:"ee-func-group-title",text:P.title}),...ig(P.items,o.searchText).map(E=>g("div",{class:"ee-list-item",onDblclick:D=>{const{insideBlock:O}=d(D),A=O?E.template:`{${E.template}}`;u(Ht(D),A,A.indexOf("(")+1,"")}},[pp(E.label,`${E.name}()`)]))]));const v=Ty(Su(e.fields??[]),o.searchText);if(!v.length)return[g("p",{class:"pd-empty",text:W("expression.k27")})];const w=[];for(const P of v){P.key&&w.push(g("div",{class:`ee-field-group${P.isList?" is-list":""}`},[g("span",{class:"ee-field-group-icon",text:P.isList?"📋":"📁"}),g("span",{text:P.label})]));for(const E of P.fields)w.push(g("div",{class:"ee-list-item ee-field-item",style:{paddingLeft:P.key?"22px":"10px"},onDblclick:D=>{const{insideParens:O}=d(D),A=D;if(A.ctrlKey||A.metaKey){const R=E.fieldLabel||E.fieldKey;u(Ht(D),O?`"${R}"`:R,void 0,"");return}u(Ht(D),O?E.fieldKey:`{${E.fieldKey}}`,void 0,m3(E.fieldKey)?g3(E.fieldKey):"")}},[pp(E.fieldLabel||E.fieldKey,E.fieldKey,r),g("button",{type:"button",class:`ee-copy-btn${o.copiedFieldKey===E.fieldKey?" is-copied":""}`,"data-tip":o.copiedFieldKey===E.fieldKey?W("expression.k28"):`复制字段名「${E.fieldLabel}」`,"aria-label":`复制字段名 ${E.fieldLabel}`,html:a3(o.copiedFieldKey===E.fieldKey?"Check":"Copy",13),onClick:D=>{D.stopPropagation(),l(D,E)},onDblclick:D=>D.stopPropagation()})]))}return w},p=v=>{Array.from(v.querySelectorAll(".ee-nav-tab")).forEach((O,A)=>O.classList.toggle("active",sp()[A]?.key===o.activeTab));const P=n(v,".ee-content-search .pd-input");if(P){const O=og()[o.activeTab];P.placeholder!==O&&(P.placeholder=O),P.value!==o.searchText&&(P.value=o.searchText)}const E=n(v,".ee-textarea");E&&E.value!==o.expression&&(E.value=o.expression);const D=n(v,".ee-content-list");if(D){Oh(D);for(const O of s())rt(O,D)}i(v),a(v)};function l(v,w){const P=Ht(v);Tu(w.fieldLabel||w.fieldKey).then(E=>{E&&(o.copiedFieldKey=w.fieldKey,p(P),setTimeout(()=>{o.copiedFieldKey===w.fieldKey&&(o.copiedFieldKey="",p(P))},1200))})}const d=v=>{const P=n(Ht(v),".ee-textarea")?.selectionStart??o.expression.length;return h3(o.expression,P)},u=(v,w,P=w.length,E)=>{E!==void 0&&(o.keyHint=E);const D=n(v,".ee-textarea");if(!D){o.expression+=w,i(v),a(v);return}const O=D.selectionStart??o.expression.length,A=D.selectionEnd??O;o.expression=o.expression.substring(0,O)+w+o.expression.substring(A);const R=O+P;D.value=o.expression,D.focus(),D.selectionStart=D.selectionEnd=R,i(v),a(v)},c=()=>{const v=o.expression;if(o.binding===void 0){e.onApply({formatter:v}),e.onClose();return}const w=b3(v,e.fields??[]);e.onApply(w?{formatter:v,binding:w.fieldKey,title:w.fieldLabel}:{formatter:v}),e.onClose()},f=g("div",{class:"ee-nav"},[g("div",{class:"ee-nav-title",text:W("expression.k29")}),g("div",{class:"ee-nav-tabs"},sp().map((v,w)=>g("div",{class:`ee-nav-tab${o.activeTab===v.key?" active":""}`,text:v.text,onClick:P=>{o.activeTab=sp()[w].key,p(Ht(P))}})))]),h=g("div",{class:"ee-content"},[g("div",{class:"ee-content-search"},[g("input",{class:"pd-input",placeholder:og()[o.activeTab],onInput:v=>{o.searchText=v.target.value,p(Ht(v))}})]),g("div",{class:"ee-content-list"},s())]),b=ng(o.expression,e.demoData),k=g("div",{class:"ee-editor"},[g("div",{class:"ee-editor-section"},[g("div",{class:"ee-editor-title",text:W("expression.k30")}),g("textarea",{class:"ee-textarea",rows:6,placeholder:W("expression.k31"),text:o.expression,onInput:v=>{o.expression=v.target.value,o.keyHint="",i(Ht(v)),a(Ht(v))}}),g("div",{class:"pd-hint ee-key-hint",style:{display:"none",color:"var(--pd-accent, #165DFF)"},text:""})]),g("div",{class:"ee-editor-section"},[g("div",{class:"ee-editor-title",text:W("expression.k32")}),g("div",{class:`ee-preview${b===W(lp)?" ee-preview-error":""}`,text:b})]),k3()]);return g("div",{class:"pd-dialog-overlay",onKeydown:v=>{v.key==="Escape"&&e.onClose()}},[g("section",{class:"pd-dialog pd-dialog-large",role:"dialog","aria-modal":"true","aria-labelledby":"expression-editor-title"},[g("header",{class:"pd-dialog-header"},[g("strong",{id:"expression-editor-title",text:W("expression.k33")}),g("button",{type:"button",class:"pd-close","aria-label":W("expression.k34"),text:"×",onClick:()=>e.onClose()})]),g("div",{class:"expression-editor"},[f,h,k]),g("footer",{class:"pd-dialog-footer"},[g("button",{type:"button",class:"pd-button",text:W("expression.k35"),onClick:()=>e.onClose()}),g("button",{type:"button",class:"pd-button primary",text:W("expression.k36"),onClick:()=>c()})])])])}const v3={id:"getting-started",title:"快速入门",content:`
296
+ `+mt),Se(mt)},t.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yp(B),Le=!0,Ke=xe,ot=C},t.clearConfig=function(){wa=null,Le=!1,Ke=null,ot=null,S=F,N=""},t.isValidAttribute=function(B,y,x){wa||yp({});const L=Be(B),z=Be(y);return typeof x=="string"&&(Ig(y,x)||!ee&&Ve(ym,x))?!1:Og(L,z,x)},t.addHook=function(B,y){typeof y=="function"&&Ze(se,B)&&un(se[B],y)},t.removeHook=function(B,y){if(Ze(se,B)){if(y!==void 0){const x=ww(se[B],y);return x===-1?void 0:Pw(se[B],x,1)[0]}return pm(se[B])}},t.removeHooks=function(B){Ze(se,B)&&(se[B]=[])},t.removeAllHooks=function(){se=vm()},t}var Zw=wm();const Jw={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Qw(e,t){const r=e.options;return Us(r.formatter,t,String(r.testData||r.title||""))||"1234567890128"}function ex(e){return g("div",{class:"print-qrcode",dataset:{codeId:e.id,codeKind:"qrcode"}})}function tx(e){const t=e.options;return g("div",{class:"print-barcode",dataset:{codeId:e.id,codeKind:"barcode"}},[g("svg",{preserveAspectRatio:Jw[String(t.fit||"contain")]??"xMidYMid meet",style:{maxWidth:"100%",maxHeight:"100%"}})])}function rx(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(r=>!Number.isFinite(r))?null:{width:t[2],height:t[3]}}function ox(e,t,r){const o=e.options,n=Do(o.barWidth),i=qa(o.barQuietZone),a=s=>{js(t,Qw(e,r),{format:String(o.barcodeType||"CODE128"),width:n,height:s*n,displayValue:!o.hideTitle,fontSize:(o.fontSize??Nn)*n,margin:0,marginLeft:i*n,marginRight:i*n,marginTop:0,marginBottom:ja*n});const p=rx(t);return p?{widthUnits:p.width,heightUnits:p.height}:null};try{const s=Va({barHeightMm:o.barHeight,boxWidthMm:Kr(o.width,o.maxWidth),boxHeightMm:Kr(o.height,o.maxHeight),dpi:o.printerDpi,barWidth:o.barWidth,measure:a});t.style.width=s.size?`${s.size.widthMm}mm`:"",t.style.height=s.size?`${s.size.heightMm}mm`:""}catch{t.replaceChildren();return}t.setAttribute("shape-rendering","crispEdges")}function nx(e,t,r){const o=e.options,n=Us(o.formatter,r,String(o.testData||o.title||""))||oe("code.k27");t.replaceChildren();try{const i=ml.render(n,"qrcode",{qrCodeLevel:String(o.qrCodeLevel??"M"),qrQuietZone:typeof o.qrQuietZone=="number"?o.qrQuietZone:void 0}),a=document.createElement("img");a.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`,a.alt="qrcode",a.style.width="100%",a.style.height="100%",a.style.objectFit=String(o.fit||"contain"),a.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",a.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",t.appendChild(a)}catch{}}function ix(e,t,r){for(const o of Array.from(e.querySelectorAll("[data-code-kind]"))){const n=o.dataset.codeId,i=t.find(a=>a.id===n);if(i)if(o.dataset.codeKind==="barcode"){const a=o.querySelector("svg");a&&ox(i,a,r)}else nx(i,o,r)}}const da=new Map;function ax(e){return typeof Node<"u"&&e instanceof Node}function xm(e,t,r){if(Pm(e),typeof t=="string"){r.innerHTML=t;return}if(ax(t)){r.appendChild(t);return}typeof t.node=="string"?r.innerHTML=t.node:r.appendChild(t.node),typeof t.dispose=="function"&&da.set(e,t.dispose)}function Pm(e){const t=da.get(e);if(t){da.delete(e);try{t()}catch{}}}function Em(){for(const e of[...da.keys()])Pm(e)}const sx={header:"table.k450",data:"table.k451",subtotal:"table.k452",summary:"table.k453"},lx=[{value:"header",labelKey:"table.k454"},{value:"data",labelKey:"table.k455"},{value:"subtotal",labelKey:"table.k456"},{value:"summary",labelKey:"table.k457"}],ca=3.7795275591,px=.1,Wl=e=>JSON.parse(JSON.stringify(e)),Sm=new WeakMap;function Kt(e){let t=Sm.get(e);return t||(t={menu:null,menuElId:null,anchor:null,layouts:new Map},Sm.set(e,t)),t}function gn(e,t){return e.templateData.elements.find(r=>r.id===t)??null}function dx(e,t){const r=e.tableSelection;return!r||r.elementId!==t.id?null:e.selectedElement?.id!==t.id?(e.tableSelection=null,null):r}function Tm(e,t,r,o){const n=gn(e,r.id);if(!n)return null;const i=r.options;return{store:e,fire:t,el:r,real:n,options:i,rows:i.tableRows??[],colWidths:i.tableColWidths??[],isSelected:e.selectedIds.has(r.id),selection:dx(e,r),maxTableWidth:Mm(e),designData:o}}function Mm(e){return e.paperSize.width-e.templateData.margins.left-e.templateData.margins.right}function Vl(e){return e.options.tableDefaultFontSize??10}function Cm(e){return e.options.tableDefaultColor??"#333333"}function cx(e,t){let r=0;for(let o=0;o<t;o++)r+=e.rows[o].height;return r}function ux(e,t){return Kt(e.store).layouts.get(e.el.id)?.[t]?.top??cx(e,t)}function fx(e,t){return Kt(e.store).layouts.get(e.el.id)?.[t]?.height??e.rows[t]?.height??0}function hx(e){const t=e.options.dataSource;if(t)return Array.isArray(vt[t])?vt[t]:void 0;for(const r of Object.values(vt))if(Array.isArray(r))return r}function _m(e){return e.cellType==="barcode"||e.cellType==="qrcode"}function Dm(e,t){return _m(t)?Us(t.formatter,hx(e)):t.formatter||""}function mx(e,t){const r={designMode:!0,showGhostBorder:e.store.showTableGhostBorder};return{fontFamily:Ts(t.fontFamily??e.options.tableDefaultFontFamily),textAlign:t.align??"left",...t.align==="justify"?{textAlignLast:"justify"}:{},verticalAlign:t.valign??"middle",fontSize:(t.fontSize??Vl(e))+"pt",fontWeight:t.fontWeight??"normal",color:t.color??Cm(e),backgroundColor:t.backgroundColor??"transparent",borderTop:Rn(t.borders?.top,r),borderRight:Rn(t.borders?.right,r),borderBottom:Rn(t.borders?.bottom,r),borderLeft:Rn(t.borders?.left,r),padding:(t.padding??e.options.tableDefaultPadding??1)+"mm",whiteSpace:t.wordWrap??!0?"pre-wrap":"nowrap",overflow:t.wordWrap??!0?"visible":"hidden"}}function gx(e,t,r){const o=e.selection;return[!!o&&t>=o.r1&&t<=o.r2&&r>=o.c1&&r<=o.c2?"cell-selected":"",e.rows[t]?.type==="data"?"row-data-bg":""].filter(Boolean).join(" ")}function Am(e){return Fa(e)}function bx(e){return Am(e)!=="autoHeight"}function kx(e,t){return t.fontSize??Vl(e)}function ua(e,t,r){return Co(e.rows,t,r,e.options.tableDefaultPadding??1)}function yx(e,t,r){return za(e.colWidths,t,r,e.options.tableDefaultPadding??1)}function vx(e,t,r){return{maxHeight:ua(e,r,t)+"mm",overflow:"hidden",...t.wordWrap===!1?{whiteSpace:"nowrap",textOverflow:"ellipsis"}:{}}}function wx(e,t,r){const o={fitBase:String(kx(e,t)),fitMin:String(Mo(t.shrinkMinFontSize)),fitMm:String(ua(e,r,t))};return Am(t)==="shrink"&&(o.fit="shrink"),o}function xx(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(r=>!Number.isFinite(r))?null:{width:t[2],height:t[3]}}const Px={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Ex(e,t,r,o){const n=document.createElement("div");n.className="cell-barcode";const i=document.createElementNS(N2,"svg");n.appendChild(i);const a=Dm(e,o);if(o.cellType==="barcode"){i.setAttribute("preserveAspectRatio",Px[o.fit||"contain"]??"xMidYMid meet");const s=Do(o.barWidth),p=qa(o.barQuietZone),l=c=>{js(i,a,{format:o.barcodeType||"CODE128",width:s,height:c*s,displayValue:o.showBarcodeText!==!1,fontSize:(o.barFontSize??Nn)*s,margin:0,marginLeft:p*s,marginRight:p*s,marginTop:0,marginBottom:ja*s});const f=xx(i);return f?{widthUnits:f.width,heightUnits:f.height}:null};let d=null;try{d=Va({barHeightMm:o.barHeight,boxWidthMm:Kr(yx(e,r,o),o.maxWidth),boxHeightMm:Kr(ua(e,t,o),o.maxHeight),dpi:o.printerDpi,barWidth:o.barWidth,measure:l})}catch{d=null}if(!d){i.style.display="none";const c=document.createElement("span");return c.className="cell-barcode-fallback",c.textContent=a||m(e,"table.k458"),n.appendChild(c),n}const u=d.size;return u?(i.style.width=`${u.widthMm}mm`,i.style.height=`${u.heightMm}mm`):(i.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",i.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%"),i.setAttribute("shape-rendering","crispEdges"),n}if(i.style.display="none",!a)return n;try{const s=ml.render(a,"qrcode",{qrCodeLevel:String(o.qrCodeLevel||"M"),qrQuietZone:typeof o.qrQuietZone=="number"?o.qrQuietZone:void 0}),p=document.createElement("img");p.setAttribute("src",`data:image/svg+xml;charset=utf-8,${encodeURIComponent(s)}`),p.setAttribute("alt","qrcode"),p.style.width="100%",p.style.height="100%",p.style.objectFit=o.fit||"contain",o.objectPosition&&(p.style.objectPosition=o.objectPosition),p.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",p.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",n.appendChild(p)}catch{}return n}function Om(){const e=document.createElement("div");return e.className="image-placeholder",e.textContent=oe("table.k459"),e}function Sx(e,t){const r=e.formatter||"";if(!r)return"";if(!r.includes("{"))return r;const o=t.designData?.length?t.designData[0]:vt;return to(r,o)}function Tx(e,t,r){const o=document.createElement("div");o.className="cell-image";const n=kd(r.fit,ua(e,t,r));n!==void 0&&(o.style.height=`${n}mm`);const i=Sx(r,e);if(!i)return o.appendChild(Om()),o;const a=document.createElement("img");a.setAttribute("src",i),n!==void 0&&(a.style.width="100%",a.style.height="100%"),a.style.objectFit=r.fit||"contain";for(const[s,p]of Object.entries(Ga(r.fit,r.fitScale,r.objectPosition)))a.style[s]=p;return a.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",a.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%",a.addEventListener("error",()=>{a.remove(),o.appendChild(Om())},{once:!0}),o.appendChild(a),o}function Mx(e,t,r,o,n){if(_m(n))return Ex(e,r,o,n);if(n.cellType==="image")return Tx(e,r,n);const i=Dm(e,n),a=()=>t.type==="data"?g("span",{class:"data-placeholder",text:i}):i;return bx(n)?g("div",{class:"cell-fit",style:vx(e,n,r),dataset:wx(e,n,r)},[a()]):a()}function fa(e,t,r){const o={elementId:e.el.id,...Jp(e.rows,t,r)};e.store.setTableSelection(o),e.fire("table-selection-change",{elementId:e.el.id,selection:o})}function Cx(e,t,r,o,n){if(n.button!==0||(e.fire("table-cell-mousedown",{elementId:e.el.id,r:t,c:r,cellId:o,event:n}),!e.isSelected))return;n.stopPropagation();const i=Kt(e.store);n.shiftKey&&e.selection?fa(e,{r:e.selection.r1,c:e.selection.c1},{r:t,c:r}):(i.anchor={r:t,c:r},fa(e,{r:t,c:r},{r:t,c:r})),document.addEventListener("mouseup",()=>{Kt(e.store).anchor=null},{once:!0})}function _x(e,t,r){const o=Kt(e.store).anchor;o&&fa(e,o,{r:t,c:r})}function Gl(e,t){const r=Kt(e);r.menu?.visible&&(r.menu.visible=!1,t("table-menu-close",{elementId:r.menuElId}),e.emit(!1))}function Dx(e,t,r,o){o.preventDefault(),o.stopPropagation(),e.isSelected||e.store.selectOne(e.el.id);const n=e.selection;n&&t>=n.r1&&t<=n.r2&&r>=n.c1&&r<=n.c2||fa(e,{r:t,c:r},{r:t,c:r});const a=Kt(e.store);a.menuElId=e.el.id,a.menu&&(a.menu.x=o.clientX,a.menu.y=o.clientY,a.menu.visible=!0),e.fire("table-cell-contextmenu",{elementId:e.el.id,r:t,c:r,clientX:o.clientX,clientY:o.clientY}),e.store.emit(!1),document.addEventListener("mousedown",()=>Gl(e.store,e.fire),{once:!0})}function Rm(e,t,r){const o=e.reduce((n,i)=>n+i,0)+(e[t]??0);return o>r?oe("table.k460",{v0:Math.round(o*10)/10,v1:r}):null}function Ax(e,t){const r=e.real.options.tableRows??[],o=e.real.options.tableColWidths??[],n=t(Wl(r),Wl(o));return n?(window.alert(n),!1):(e.store.recordHistory(),t(r,o),e.store.setTableSelection(null),Eo(e.real.options),e.store.emit(),!0)}function Yt(e,t,r){Gl(e.store,e.fire);const o=e.selection;if(!o)return;let n=null;switch(t){case"insert-row-above":n=i=>(rd(i,o.r1,"above"),null);break;case"insert-row-below":n=i=>(rd(i,o.r2,"below"),null);break;case"delete-row":n=i=>Sb(i,o.r1);break;case"insert-col-left":n=(i,a)=>{const s=Rm(a,o.c1,e.maxTableWidth);return s||(od(i,a,o.c1,"left"),null)};break;case"insert-col-right":n=(i,a)=>{const s=Rm(a,o.c2,e.maxTableWidth);return s||(od(i,a,o.c2,"right"),null)};break;case"delete-col":n=(i,a)=>Tb(i,a,o.c1);break;case"merge":n=i=>(ed(i,o),null);break;case"split":n=i=>(td(i,o),null);break;case"set-row-type":n=i=>r?Ia(i,o.r1,r):m(e,"table.k461");break}n&&Ax(e,n)&&e.fire(`table-${t}`,{elementId:e.el.id,...r?{type:r}:{}})}function Ox(e){const t=e.selection;if(!t)return!1;for(let r=t.r1;r<=t.r2;r++)for(let o=t.c1;o<=t.c2;o++){const n=e.rows[r]?.cells[o];if(n&&!n.merged&&((n.rowspan??1)>1||(n.colspan??1)>1))return!0}return!1}function Rx(e){const t=e.selection;if(!t)return;const r=Po(e.rows,t.r1,t.c1),o=!e.rows[r.r]?.cells[r.c]?.mergeSameValue;for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=e.rows[n]?.cells[i];a&&!a.merged&&(a.mergeSameValue=o)}e.store.updateElement(e.el.id,{tableRows:e.rows}),Gl(e.store,e.fire)}function Im(e){const t=e.selection;if(!t)return m(e,"table.k462");for(let r=t.r1;r<=t.r2;r++)if(e.rows[r]?.type!=="data")return m(e,"table.k463");return null}function Lm(e,t){const r=e.selection;return r?r.r1!==r.r2?m(e,"table.k465"):Ia(Wl(e.rows),r.r1,t):m(e,"table.k464")}function zt(e,t,r={}){return g("div",{class:`menu-item${r.disabled?" disabled":""}${r.active?" active":""}`,title:r.title||"",text:e,onClick:()=>{r.disabled||t()}})}const Kl=()=>g("div",{class:"menu-divider"});function Ix(e,t,r){const o=Kt(e);if(o.menu=r,!r.visible||!o.menuElId)return"";const n=gn(e,o.menuElId);if(!n||n.printElementType.type!=="table")return"";const i=Tm(e,t,n);if(!i)return"";const a=i.selection?Qp(i.rows,i.selection):m(i,"table.k466"),s=i.selection?i.rows[i.selection.r1]?.type??null:null;return g("div",{class:"table-ctx-menu",style:{left:r.x+"px",top:r.y+"px"},onMousedown:p=>p.stopPropagation()},[zt(m(i,"table.k467"),()=>Yt(i,"insert-row-above")),zt(m(i,"table.k468"),()=>Yt(i,"insert-row-below")),zt(m(i,"table.k469"),()=>Yt(i,"delete-row"),{disabled:i.rows.length<=1}),Kl(),zt(m(i,"table.k470"),()=>Yt(i,"insert-col-left")),zt(m(i,"table.k471"),()=>Yt(i,"insert-col-right")),zt(m(i,"table.k472"),()=>Yt(i,"delete-col"),{disabled:i.colWidths.length<=1}),Kl(),zt(m(i,"table.k473"),()=>Yt(i,"merge"),{disabled:!!a,title:a||""}),zt(m(i,"table.k474"),()=>Yt(i,"split"),{disabled:!Ox(i)}),zt(m(i,"table.k475"),()=>Rx(i),{disabled:!!Im(i),title:Im(i)||"",active:(()=>{const p=i.selection;if(!p)return!1;const l=Po(i.rows,p.r1,p.c1);return i.rows[l.r]?.cells[l.c]?.mergeSameValue===!0})()}),Kl(),g("div",{class:"menu-group-title",text:m(i,"table.k476")}),...lx.map(p=>zt(oe(p.labelKey),()=>Yt(i,"set-row-type",p.value),{disabled:!!Lm(i,p.value),title:Lm(i,p.value)||"",active:s===p.value}))])}let Nr=null;function Bm(){Nr&&(document.removeEventListener("mousemove",Yl),document.removeEventListener("mouseup",Xl),Nr.handle.classList.remove("dragging"),Nr=null)}function Lx(e,t){const r=e.closest(".hiprint-printPaper");return(r&&r.offsetWidth>0?r.getBoundingClientRect().width/r.offsetWidth:0)||(t.scale||100)/100}function Bx(e,t,r){if(r.button!==0)return;const o=r.currentTarget,n=o.closest(".print-table");if(!n)return;Bm();const i=e.real.options.tableColWidths??[];Nr={store:e.store,fire:e.fire,elId:e.real.id,boundary:t,startX:r.clientX,startWidth:i[t-1]??0,scale:Lx(n,e.store),root:n,wrapper:o.closest(".print-element"),handle:o},o.classList.add("dragging"),e.store.recordHistory(),document.addEventListener("mousemove",Yl),document.addEventListener("mouseup",Xl)}function Yl(e){const t=Nr;if(!t)return;const r=gn(t.store,t.elId),o=r?.options.tableColWidths;if(!r||!o)return;const n=(e.clientX-t.startX)/(t.scale*ca),i=t.boundary-1;o[i]=Rb(o,i,t.startWidth+n,Mm(t.store)),Eo(r.options),o.forEach((a,s)=>{const p=t.root.querySelector(`colgroup col:nth-child(${s+1})`);p&&(p.style.width=`${a}mm`)}),t.root.querySelectorAll(".col-resize-handle").forEach((a,s)=>{a.style.left=`${o.slice(0,s+1).reduce((p,l)=>p+l,0)}mm`}),t.wrapper&&(t.wrapper.style.width=`${r.options.width}mm`,t.wrapper.style.height=`${r.options.height}mm`)}function Xl(){document.removeEventListener("mousemove",Yl),document.removeEventListener("mouseup",Xl);const e=Nr;if(!e)return;Nr=null,e.handle.classList.remove("dragging");const t=gn(e.store,e.elId);t&&Eo(t.options),e.store.emit(),e.fire("table-col-resize-end",{elementId:e.elId})}function Nx(e,t,r){const o=r.querySelector("table");if(!o)return;const n=o.offsetHeight;if(n<=0)return;const i=gn(e,t);if(!i)return;let a=!1;const s=n/ca;Math.abs(s-(i.options.height??0))>px&&(i.options.height=Math.round(s*100)/100,a=!0);const p=o.offsetTop,l=Array.from(o.rows).map(u=>({top:(u.offsetTop-p)/ca,height:u.offsetHeight/ca})),d=Kt(e);Fx(d.layouts.get(t),l)||(d.layouts.set(t,l),a=!0),a&&e.emit(!1)}function Fx(e,t){return!e||e.length!==t.length?!1:t.every((r,o)=>{const n=e[o];return Math.round(r.top*10)===Math.round(n.top*10)&&Math.round(r.height*10)===Math.round(n.height*10)})}function $x(e,t){const r=document.createComment("pd-table-measure");return requestAnimationFrame(()=>{if(!r.isConnected)return;const o=r.parentElement;o&&Nx(e,t,o)}),r}function zx(e){return e.isSelected&&!e.real.options.locked&&e.colWidths.length>=1}function Hx(e){return Array.from({length:e.colWidths.length},(t,r)=>r+1)}function Ux(e,t){return e.colWidths.slice(0,t).reduce((r,o)=>r+o,0)}function qx(e,t,r,o){const n=Tm(t,r,e,o);if(!n)return g("div",{class:"print-table"});const i=[g("table",{style:{fontSize:`${Vl(n)}pt`,color:Cm(n)}},[g("colgroup",{},n.colWidths.map(a=>g("col",{style:{width:a+"mm"}}))),g("tbody",{},n.rows.map((a,s)=>g("tr",{style:{height:a.height+"mm"}},a.cells.map((p,l)=>p.merged?"":g("td",{rowspan:p.rowspan||1,colspan:p.colspan||1,class:gx(n,s,l),style:mx(n,p),onMousedown:d=>Cx(n,s,l,p.id,d),onMouseenter:()=>_x(n,s,l),onContextmenu:d=>Dx(n,s,l,d)},[Mx(n,a,s,l,p)])).filter(Boolean))))])];return zx(n)&&i.push(g("div",{class:"col-resize-layer"},Hx(n).map(a=>g("div",{class:"col-resize-handle",role:"separator","aria-label":m(n,"table.k477",{v0:a}),style:{left:Ux(n,a)+"mm"},onMousedown:s=>{s.stopPropagation(),s.preventDefault(),Bx(n,a,s)}})))),n.isSelected&&i.push(g("div",{class:"row-badges"},n.rows.map((a,s)=>g("span",{class:"row-badge",style:{top:ux(n,s)+"mm",height:fx(n,s)+"mm"},text:oe(sx[a.type])})))),i.push($x(t,e.id)),g("div",{class:"print-table design-mode",dataset:{tableId:e.id},onContextmenu:a=>a.preventDefault()},i)}const jx=["flowList.k44","flowList.k45","flowList.k46","flowList.k47","flowList.k48","flowList.k49","flowList.k50"];function Wx(){return jx.map(e=>oe(e))}function Zl(e){return Array.isArray(e)&&e.length>0?e:[]}function Vx(e,t){const r=Bn(e,t)??(t?Object.keys(t).find(n=>Array.isArray(t[n])):void 0);if(r)return Zl(t?.[r]);const o=Bn(e,vt);return o?Zl(vt[o]):[]}function Gx(e,t){const r=e.options,o=typeof r.formatter=="string"?r.formatter:"",n=Zl(t)[0],i=Vx(o,n);if(i.length===0)return Wx();if(!o)return i.map(p=>String(p?.name??JSON.stringify(p)));const a=n??{},s=Bn(o,a)??Object.keys(a).find(p=>Array.isArray(a[p]));return i.map(p=>{try{return to(o,{...a,...p,...s?{[s]:p}:{}})}catch{return o}})}const Kx=3.7795275591,Yx=.1;function Xx(e,t){return e.templateData.elements.find(r=>r.id===t)??null}function Zx(e){const t=e.parentElement;if(!t?.classList.contains("print-element"))return 0;const r=getComputedStyle(t);return(parseFloat(r.borderTopWidth)||0)+(parseFloat(r.borderBottomWidth)||0)}function Jx(e,t,r){const o=r.offsetHeight+Zx(r);if(o<=0)return;const n=Xx(e,t);if(!n)return;const i=o/Kx;Math.abs(i-(n.options.height??0))>Yx&&(n.options.height=Math.round(i*100)/100,e.emit(!1))}function Qx(e,t){const r=document.createComment("pd-flowlist-measure");return requestAnimationFrame(()=>{if(!r.isConnected)return;const o=r.parentElement;o&&Jx(e,t,o)}),r}function eP(e,t,r){const o=e.options,n=bt(o.flowColumns),i=Et(o.flowGapX),a=or(o.flowRowHeight),s=wr(o.flowLayoutMode)==="dynamic",p=Gr(o),l={display:"grid",gridTemplateColumns:`repeat(${n},minmax(0,1fr))`,columnGap:`${i}mm`,gridAutoRows:`minmax(${a}mm,auto)`,width:"100%",...s?{padding:`${p.top}mm ${p.right}mm ${p.bottom}mm ${p.left}mm`,height:"auto",overflow:"visible"}:{height:"100%",overflow:"hidden"},fontSize:`${o.fontSize||12}pt`,fontWeight:o.fontWeight||"normal",color:o.color||"#333",boxSizing:"border-box"};o.fontFamily&&(l.fontFamily=String(o.fontFamily)),o.backgroundColor&&(l.backgroundColor=String(o.backgroundColor));const d=Gx(e,t).map(u=>g("div",{class:"print-flow-cell",text:u}));return s&&r&&d.push(Qx(r,e.id)),g("div",{class:"print-flowlist",style:l},d)}const Nm={top:"flex-start",middle:"center",bottom:"flex-end"},tP={left:"flex-start",center:"center",right:"flex-end"};function rP(e,t){const r=e.options,o=kt(r),n=zn(e.printElementType.type,r),i={};if(n?.all&&(i.border=`${n.all.borderWidth} ${n.all.borderStyle} ${n.all.borderColor}`),n)for(const a of Ao){const s=n.edges[a];s&&(i[`border${a.charAt(0).toUpperCase()}${a.slice(1)}`]=`${s.borderWidth} ${s.borderStyle} ${s.borderColor}`)}return{position:"absolute",left:`${r.left}mm`,top:`${r.top}mm`,width:`${r.width}mm`,height:`${r.height}mm`,...o.top!==0?{marginTop:`${o.top}mm`}:{},...o.right!==0?{marginRight:`${o.right}mm`}:{},...o.bottom!==0?{marginBottom:`${o.bottom}mm`}:{},...o.left!==0?{marginLeft:`${o.left}mm`}:{},zIndex:String(r.zIndex||"auto"),...i,...oP(e,t)}}function oP(e,t){if(t?.has(e.id))return{};const r=Ka(e.printElementType.type,e.options);return r===void 0?{}:{rotate:`${r}deg`}}function Fm(e){const t=e.options,r=e.printElementType.type==="longText",o=Ln(e.printElementType.type,t),n=t.fontSize||12,i=o==="autoHeight",a={fontSize:`${n}pt`,fontWeight:t.fontWeight||"normal",fontFamily:Ts(t.fontFamily),color:t.color||"#333",backgroundColor:t.backgroundColor||"transparent",textAlign:t.textAlign||"left",...t.textAlign==="justify"?{textAlignLast:"justify"}:{},lineHeight:t.lineHeight?`${t.lineHeight}pt`:r?"1.5":"normal",letterSpacing:t.letterSpacing?`${t.letterSpacing}pt`:"normal",width:"100%",height:i?"auto":"100%",boxSizing:"border-box",overflow:i?"visible":"hidden",...r?{wordBreak:"break-all",textIndent:t.longTextIndent?`${t.longTextIndent}em`:"0"}:{textDecoration:t.textDecoration||"none",padding:`${t.contentPaddingTop||0}pt ${t.contentPaddingRight||0}pt ${t.contentPaddingBottom||0}pt ${t.contentPaddingLeft||0}pt`}};bd(t)&&(a.whiteSpace="nowrap",a.textOverflow="ellipsis");const s=gd(t);return s&&(a.whiteSpace=s),t.verticalAlign&&(a.display="flex",t.textAlign==="justify"?(a.flexDirection="column",a.justifyContent=Nm[t.verticalAlign]??"flex-start"):(a.alignItems=Nm[t.verticalAlign]??"flex-start",a.justifyContent=tP[t.textAlign||"left"]??"flex-start")),{style:a,fit:o}}function $m(e){const t=e.options,r=`${t.borderWidth||.75}pt`,o=t.borderStyle||"solid",n=t.borderColor||"#333";return e.printElementType.type==="hline"?{width:"100%",height:"0",borderTop:`${r} ${o} ${n}`,boxSizing:"border-box"}:{width:"0",height:"100%",borderLeft:`${r} ${o} ${n}`,boxSizing:"border-box"}}function zm(e){const t=e.options;return{width:"100%",height:"100%",borderWidth:`${t.borderWidth||1}pt`,borderStyle:t.borderStyle||"solid",borderColor:t.borderColor||"#333",backgroundColor:t.backgroundColor||"transparent",borderRadius:e.printElementType.type==="oval"?"50%":"0",boxSizing:"border-box"}}function nP(e){const t=e.options;return{objectFit:t.fit||"contain",...Ga(t.fit,t.fitScale,t.objectPosition),maxWidth:t.maxWidth?`${t.maxWidth}mm`:"100%",maxHeight:t.maxHeight?`${t.maxHeight}mm`:"100%"}}function Hm(e){const t=e.options,r={fitBase:String(t.fontSize||12),fitMin:String(Mo(t.shrinkMinFontSize))};return Ln(e.printElementType.type,t)==="shrink"&&(r.fit="shrink"),r}Wh({text:e=>{const{style:t}=Fm(e),r=e.options;return g("div",{class:"print-text",style:t,dataset:Hm(e),text:String(r.testData||r.formatter||"")||oe("elements.k41")})},longText:e=>{const{style:t}=Fm(e),r=e.options;return g("div",{class:"print-longtext",style:t,dataset:Hm(e),text:String(r.formatter||"")||oe("elements.k42")})},hline:e=>g("div",{class:"print-line",style:$m(e)}),vline:e=>g("div",{class:"print-line",style:$m(e)}),rect:e=>g("div",{class:"print-shape",style:zm(e)}),oval:e=>g("div",{class:"print-shape",style:zm(e)}),image:(e,t,r)=>{const o=e.options,n=String(o.src??""),i=r?.designData?.length?r.designData[0]:vt,a=n.includes("{")?to(n,i):n;return g("div",{class:"print-image"},[a?g("img",{src:a,style:nP(e)}):g("div",{class:"image-placeholder",text:oe("elements.k43")})])},qrcode:e=>ex(e),barcode:e=>tx(e),html:e=>{const t=e.options,r=String(t.formatter??""),o=r?Zw.sanitize(to(r,{})):'<div style="background:#e0e0e0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:10pt;color:#999">HTML</div>';return g("div",{class:"print-html",html:o})},pageNumber:(e,t)=>{const r=e.options;return g("div",{class:"page-number-element",style:{fontSize:`${r.fontSize||12}pt`,fontWeight:r.fontWeight||"normal",fontFamily:Ts(r.fontFamily),color:r.color||"#333",textAlign:r.textAlign||"left",...r.textAlign==="justify"?{textAlignLast:"justify"}:{}},text:t?r.title||"{pageIndex}/{totalPages}":String(r.title||"")})},table:(e,t,r)=>r?qx(e,r.store,r.fire,r.designData):g("div",{class:"print-table"}),flowList:(e,t,r)=>eP(e,void 0,r?.store)});function iP(e,t,r){const o=e.printElementType.type,n=dr(o)?.renderContent;if(n)return n(e,t,r);const i=Cl(o);if(!i)return g("div",{text:o});const a=document.createElement("div");a.className="plugin-kit-canvas",a.style.width="100%",a.style.height="100%";try{xm(`canvas:${e.id}`,i.ui.renderCanvas({element:e,data:r?.designData?.length?r.designData:[vt],designMode:!0}),a)}catch{a.textContent=String(o)}return a}function Um(e){return`x:${Math.round(e.left)} y:${Math.round(e.top)} ${Math.round(e.width)}×${Math.round(e.height)}mm`}function aP(e,t,r){const o=e.store,n=o.selectedIds.has(t.id),i=o.previewIds.has(t.id),a=t.options,s=t.zone||"content",p=[iP(t,!0,{store:o,fire:e.fire,designData:e.host.designData})];return o.draggingIds.has(t.id)&&p.push(g("div",{class:"drag-preview"})),n&&(p.push(g("div",{class:"resize-handles"},Iy.map(l=>g("div",{class:`resize-handle handle-${l}`,dataset:{point:l,elId:t.id},onMousedown:d=>e.fire("resize-start",{event:d,id:t.id,point:l})})))),p.push(g("div",{class:"selected-indicator"},[g("div",{class:"position-label",text:Um(a)})]))),g("div",{class:["print-element",`type-${t.printElementType.type}`,`zone-${s}`,n?"selected":"",i?"previewed":"",o.draggingIds.has(t.id)?"drag-ghost":"","design-mode",a.locked?"locked":"",a.visible===!1?"hidden":""].filter(Boolean).join(" "),style:rP(t,r),dataset:{elId:t.id},onMousedown:l=>e.fire("element-mousedown",{event:l,id:t.id}),onContextmenu:l=>{l.preventDefault(),l.stopPropagation(),e.fire("contextmenu",{event:l,id:t.id})}},p)}function Jl(e,t){const r=e.margins,o=e.header?.height??10,n=e.footer?.height??10,i=t.width-r.left-r.right;return{header:{left:r.left,top:r.top,width:i,height:o},content:{left:r.left,top:r.top+o,width:i,height:t.height-r.top-r.bottom-o-n},footer:{left:r.left,top:t.height-r.bottom-n,width:i,height:n}}}const sP='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M0 .5H20M.5 0V20" fill="none" stroke="rgba(0,0,0,0.08)" stroke-width="1" stroke-dasharray="4 4"/></svg>';function qm(e,t){return e.type==="vertical"?{left:`${e.position}mm`,top:"0",height:`${t.height}mm`,borderLeftColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}:{top:`${e.position}mm`,left:"0",width:`${t.width}mm`,borderTopColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}}function lP(e,t){const r=qc(e.watermark,[],t);return r?g("div",{class:"watermark-layer",style:{opacity:String(r.opacity)}},r.tiles.map(o=>g("svg",{class:"watermark-tile",width:`${o.widthMm}mm`,height:`${o.heightMm}mm`,viewBox:`0 0 ${r.tileWidthPx} ${r.tileHeightPx}`,style:{left:`${o.leftMm}mm`,top:`${o.topMm}mm`}},[g("text",{x:String(r.tileWidthPx/2),y:String(r.tileHeightPx/2),"font-size":String(r.fontSizePx),fill:r.color,"text-anchor":"middle","dominant-baseline":"middle",transform:`rotate(${r.rotate},${r.tileWidthPx/2},${r.tileHeightPx/2})`,text:r.text})]))):""}function Ql(e,t,r,o,n,i){const a=e.store,s=[];r!=="content"&&s.push(g("span",{class:"zone-label",text:r==="header"?m(e,"canvas.k11"):m(e,"canvas.k12")}));const p=r==="content"?Fd(n):void 0;if(s.push(...n.map(l=>aP(e,l,p))),r!=="content"){const l=r==="header"?"bottom":"top";s.push(g("div",{class:`zone-resize-handle handle-${l}`,dataset:{zone:r},onMousedown:d=>e.fire("zone-resize",{event:d,zone:r})},[t.zoneResizing===r?g("div",{class:"zone-height-tip",text:`${(r==="header"?a.templateData.header.height:a.templateData.footer.height).toFixed(1)}mm`}):""]))}return g("div",{class:`zone-layer zone-${r} design-mode`,style:{position:"absolute",left:`${o.left}mm`,top:`${o.top}mm`,width:`${o.width}mm`,height:`${o.height}mm`},dataset:{zone:r,paperWidth:String(i.width),paperHeight:String(i.height)}},s.filter(Boolean))}function pP(e){const t=e.currentTarget,r=e.dataTransfer?.types??[],o=r.includes("fieldkey"),n=r.includes("elementtype");if(!o&&!n){t.querySelector(".drop-hint")?.remove();return}o&&(e.ctrlKey||e.metaKey)&&(t.dataset.dropLabelIntent="1");const i=n?oe("canvas.k13"):t.dataset.dropLabelIntent?oe("canvas.k14"):oe("canvas.k15");let a=t.querySelector(".drop-hint");a||(a=document.createElement("div"),a.className="drop-hint",t.appendChild(a)),a.textContent=i,a.style.left=`${e.clientX+14}px`,a.style.top=`${e.clientY+18}px`}function jm(e){e&&(e.querySelector(".drop-hint")?.remove(),delete e.dataset.dropLabelIntent)}function dP(e,t){const r=e.store,o=r.templateData,n=yt(o),i=(r.scale||100)/100,a=Jl(o,n),s=u=>r.elements.filter(c=>(c.zone||"content")===u),p=g("div",{class:"hiprint-printPaper-content",dataset:{content:""},style:{padding:`${o.margins.top}mm ${o.margins.right}mm ${o.margins.bottom}mm ${o.margins.left}mm`,position:"relative",boxSizing:"border-box",minHeight:`${n.height}mm`}},[r.showGrid?g("div",{class:"grid-bg",style:{backgroundImage:`url("data:image/svg+xml,${encodeURIComponent(sP)}")`,backgroundSize:"5mm 5mm",backgroundPosition:"0 0"}}):"",...o.watermark&&Object.keys(o.watermark).length?[lP(o,n)]:[],Ql(e,t,"header",a.header,s("header"),n),Ql(e,t,"content",a.content,s("content"),n),Ql(e,t,"footer",a.footer,s("footer"),n),...r.adsorbGuides.map(u=>g("div",{class:`adsorb-guide guide-${u.type}`,style:qm(u,n)})),...(o.guides??[]).map(u=>g("div",{class:`manual-guide guide-${u.type}`,style:{...qm(u,n),"--guide-hit":`${8/i}px`},dataset:{guideId:String(u.id??"")},onMousedown:c=>e.fire("guide-mousedown",{event:c,id:u.id}),onDblclick:c=>{c.preventDefault(),e.fire("guide-remove",u.id)}}))].filter(Boolean)),l=g("div",{class:"hiprint-printPaper",dataset:{test:"paper"},style:{width:`${n.width}mm`,minHeight:`${n.height}mm`,background:o.pageBackground||"var(--pd-paper, #fff)",boxShadow:"var(--pd-shadow-paper, 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08))",overflow:"hidden",position:"relative",transform:`scale(${i})`,transformOrigin:"0 0"}},[...o.designBackground?.src?[g("div",{class:"design-background",style:{width:`${n.width}mm`,height:`${n.height}mm`,left:"0",top:"0",transform:o.designBackground.rotation?`rotate(${o.designBackground.rotation}deg)`:""}},[g("img",{src:o.designBackground.src,draggable:!1,alt:""})])]:[],p]),d=[g("div",{class:"canvas-scroll"},[g("div",{class:"paper-wrapper",style:{width:`${ai(n.width)*i}px`,height:`${ai(n.height)*i}px`,position:"relative"}},[l])])];if(r.showRuler&&d.push(g("div",{class:"ruler-overlay",style:{transform:`translate(${t.scrollX}px, ${t.scrollY}px)`}},[g("div",{class:"ruler-corner"}),g("canvas",{class:"pd-ruler is-horizontal",dataset:{ruler:"horizontal"},style:{width:`${t.geom.viewW}px`,height:"20px"},onMousedown:u=>e.fire("ruler-mousedown",{event:u,orientation:"horizontal"})}),g("canvas",{class:"pd-ruler is-vertical",dataset:{ruler:"vertical"},style:{width:"20px",height:`${t.geom.viewH}px`},onMousedown:u=>e.fire("ruler-mousedown",{event:u,orientation:"vertical"})})])),t.guidePreview&&d.push(g("div",{class:`ruler-guide-preview guide-${t.guidePreview.type}`,style:t.guidePreview.type==="vertical"?{left:`${t.guidePreview.position}px`,top:"0",height:"100%"}:{top:`${t.guidePreview.position}px`,left:"0",width:"100%"}})),t.marquee.visible&&d.push(g("div",{class:"marquee-selection",style:{left:`${t.marquee.x}px`,top:`${t.marquee.y}px`,width:`${t.marquee.w}px`,height:`${t.marquee.h}px`}})),t.contextMenu.visible){const u=t.contextMenu;d.push(g("div",{class:"context-menu",style:{left:`${t.contextMenu.x+t.contextMenu.flipX}px`,top:`${t.contextMenu.y+t.contextMenu.flipY}px`}},t.contextMenu.targetId?[_t(e,u,m(e,"canvas.k16"),"copy"),_t(e,u,m(e,"canvas.k17"),"cut"),_t(e,u,m(e,"canvas.k18"),"paste",!r.hasClipboard),_t(e,u,m(e,"canvas.k19"),"delete"),g("div",{class:"context-menu-sep"}),_t(e,u,m(e,"canvas.k20"),"move-layer",!1,"top"),_t(e,u,m(e,"canvas.k21"),"move-layer",!1,"up"),_t(e,u,m(e,"canvas.k22"),"move-layer",!1,"down"),_t(e,u,m(e,"canvas.k23"),"move-layer",!1,"bottom")]:[_t(e,u,m(e,"canvas.k24"),"paste-at",!r.hasClipboard),_t(e,u,m(e,"canvas.k25"),"select-all"),_t(e,u,m(e,"canvas.k26"),"clear-selection")]))}return g("div",{class:"canvas-area",dataset:{test:"canvas-area"},onDragover:u=>{const c=u;c.preventDefault(),c.dataTransfer&&(c.dataTransfer.dropEffect="copy"),pP(c)},onDragleave:u=>{const c=u.currentTarget,f=u.relatedTarget;(!f||!c.contains(f))&&c.querySelector(".drop-hint")?.remove()},onDrop:u=>{const c=u,f=u.currentTarget,h=f.dataset.dropLabelIntent==="1";jm(f),h&&(c.labelIntent=!0),e.fire("drop",c)},onMousedown:u=>e.fire("canvas-mousedown",u),onMousemove:u=>e.fire("canvas-mousemove",u),onMouseleave:()=>e.fire("canvas-mouseleave"),onWheel:u=>e.fire("wheel",u),onScroll:u=>e.fire("scroll",u),onContextmenu:u=>{u.preventDefault(),e.fire("canvas-contextmenu",u)}},d.filter(Boolean))}function _t(e,t,r,o,n=!1,i){return g("div",{class:`context-menu-item${n?" disabled":""}`,text:r,onClick:()=>{t.visible=!1,n||e.fire(o,i),e.repaint()}})}function cP(e){const t=window.innerHeight;for(let r=e.parentElement;r&&r!==document.body;r=r.parentElement){const o=getComputedStyle(r).overflowY;if(o==="auto"||o==="scroll"||o==="hidden"||o==="clip"){const n=r.getBoundingClientRect();return{top:Math.max(0,n.top),bottom:Math.min(t,n.bottom)}}}return{top:0,bottom:t}}function ha(e){const t=V1(e.fonts),r=e.placeholder??oe("fontSelect.k51"),o=`font-select-list-${e.id}`,n=R=>{const _=R?.trim();return _?Dc(t,_)?.label??_:""},i=R=>{const _=qo(R);return t.find(S=>S.label&&qo(S.label)===_)?.family??R},a=()=>{const R=e.value?.trim();return R?Dc(t,R)?"":R:""},s=R=>{const _=(e.value??"").trim(),I=(F,H,le,M)=>({kind:F,key:H,label:le,value:M,selected:(M??"")===_}),S=R.trim();if(!S){const F=[I("clear","__clear__",r)],H=a();H&&F.push(I("unknown","__unknown__",oe("fontSelect.k52",{v0:H}),H));for(const le of t)F.push(I("font",le.family,Ac(le),le.family));return F}const N=K1(t,S).map(F=>I("font",F.family,Ac(F),F.family));if(!N.length){const F=i(S);N.push(I("free","__free__",oe("fontSelect.k53",{v0:F}),F))}return N},p=document.createElement("div");p.className="font-select";const l=document.createElement("input");l.className="pd-input font-select-input",l.type="text",l.setAttribute("role","combobox"),l.setAttribute("aria-autocomplete","list"),l.setAttribute("aria-controls",o),l.autocomplete="off",l.placeholder=r,l.disabled=!!e.disabled,l.value=n(e.value);const d=document.createElement("ul");d.id=o,d.className="font-select-list",d.setAttribute("role","listbox");const u=e.state.fontOpen?.id===e.id?e.state.fontOpen:null,c={open:!!u&&!e.disabled,query:u?.query??"",highlighted:u?.highlighted??-1};c.open&&(l.value=c.query);const f=()=>{e.state.fontOpen=c.open?{id:e.id,query:c.query,highlighted:c.highlighted}:null};f();const h=()=>{const R=(e.value??"").trim();return s(c.query).findIndex(_=>(_.value??"")===R)},b=()=>{const R=l.getBoundingClientRect(),_=cP(l);d.classList.toggle("is-up",C0({triggerTop:R.top,triggerBottom:R.bottom,overlayHeight:d.getBoundingClientRect().height,boundaryTop:_.top,boundaryBottom:_.bottom})==="up")},k=()=>{if(!c.open){d.isConnected&&d.remove(),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-activedescendant","");return}d.isConnected||p.appendChild(d);const R=s(c.query);d.replaceChildren(...R.map((_,I)=>{const S=document.createElement("li");return S.id=`${o}-${I}`,S.className="font-select-option"+(I===c.highlighted?" is-active":"")+(_.kind==="unknown"||_.kind==="free"?" is-muted":""),S.setAttribute("role","option"),S.setAttribute("aria-selected",String(_.selected)),S.textContent=_.label,S.addEventListener("mousedown",N=>{N.preventDefault(),O(_)}),S})),l.setAttribute("aria-expanded","true"),l.setAttribute("aria-activedescendant",c.highlighted>=0?`${o}-${c.highlighted}`:""),b()},v=()=>{c.open||e.disabled||(c.open=!0,c.query="",c.highlighted=h(),f(),k())},w=()=>{c.open||v()},P=()=>{c.open=!0,c.query=l.value,c.highlighted=s(c.query).length?0:-1,f(),k()},E=R=>{if(!c.open){v();return}const _=s(c.query).length-1;if(_<0)return;c.highlighted=Math.min(Math.max(c.highlighted+R,0),_),f(),k(),d.children[c.highlighted]?.scrollIntoView?.({block:"nearest"})},D=()=>{if(!c.open)return;const R=s(c.query)[c.highlighted];if(R){O(R);return}const _=c.query.trim();if(_){const I=i(_);O({value:I})}},O=R=>{c.open=!1,c.query="",c.highlighted=-1,f(),l.value=n(R.value),k(),e.onChange(R.value)},A=()=>{c.open&&(c.open=!1,c.query="",c.highlighted=-1,f(),l.value=n(e.value),k())};return l.addEventListener("focus",v),l.addEventListener("click",w),l.addEventListener("input",P),l.addEventListener("blur",A),l.addEventListener("keydown",R=>{const _=R;_.key==="ArrowDown"?(_.preventDefault(),E(1)):_.key==="ArrowUp"?(_.preventDefault(),E(-1)):_.key==="Enter"?(_.preventDefault(),D()):_.key==="Escape"&&(_.preventDefault(),A())}),p.append(l),k(),c.open&&(l.focus(),l.setSelectionRange(c.query.length,c.query.length)),p}const uP=[{key:"solid",labelKey:"formatBar.k54",preview:"1.5px solid currentColor"},{key:"dashed",labelKey:"formatBar.k55",preview:"1.5px dashed currentColor"},{key:"dotted",labelKey:"formatBar.k56",preview:"1.5px dotted currentColor"},{key:"double",labelKey:"formatBar.k57",preview:"3px double currentColor"}],fP={left:"TextAlignStart",center:"TextAlignCenter",right:"TextAlignEnd",justify:"TextAlignJustify"};function fr(e,t,r,o,n={}){return g("button",{type:"button",class:`ft-cell-btn${n.on?" on":""}`,dataset:{test:e,tip:t},disabled:!!n.disabled,onClick:o,html:`<svg viewBox="0 0 18 18" width="18" height="18" aria-hidden="true">${r}</svg>`})}const uo='<rect class="g-faint" x="2.5" y="2.5" width="13" height="13" />',Wm='<rect class="g-solid" x="2.5" y="2.5" width="13" height="13" fill="none" />';function hP(e){const t=e.format;t.syncBorderDraft();const r=t.values,o=!t.fontEditable,n=o||t.context==="cells",i=t.context==="none",a=t.context==="cells",s=!t.painterActive&&(t.context==="none"||t.context==="cells"||!t.painterCapturable),p=t.painterActive?m(e,"formatBar.k58"):t.context==="cells"?m(e,"formatBar.k59"):t.context==="none"?m(e,"formatBar.k60"):t.painterCapturable?m(e,"formatBar.k62"):m(e,"formatBar.k61"),l=c=>o?m(e,"formatBar.k63",{v0:c}):c,d=[g("div",{class:"ft-border-panel",dataset:{test:"border-panel"}},[g("div",{class:"ft-border-grid"},[fr("preset-none",m(e,"formatBar.k64"),`${uo}<line class="g-solid" x1="4" y1="14" x2="14" y2="4" />`,()=>t.applyBorderPreset("none")),fr("preset-all",m(e,"formatBar.k65"),`${Wm}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("all")),fr("preset-outer",m(e,"formatBar.k66"),Wm,()=>t.applyBorderPreset("outer")),fr("preset-inner",a?m(e,"formatBar.k67"):m(e,"formatBar.k68"),`${uo}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("inner"),{disabled:!a}),fr("edge-top",m(e,"formatBar.k69"),`${uo}<line class="g-solid" x1="2" y1="3" x2="16" y2="3" />`,()=>t.applyEdge("top"),{on:t.edgeOn("top")}),fr("edge-bottom",m(e,"formatBar.k70"),`${uo}<line class="g-solid" x1="2" y1="15" x2="16" y2="15" />`,()=>t.applyEdge("bottom"),{on:t.edgeOn("bottom")}),fr("edge-left",m(e,"formatBar.k71"),`${uo}<line class="g-solid" x1="3" y1="2" x2="3" y2="16" />`,()=>t.applyEdge("left"),{on:t.edgeOn("left")}),fr("edge-right",m(e,"formatBar.k72"),`${uo}<line class="g-solid" x1="15" y1="2" x2="15" y2="16" />`,()=>t.applyEdge("right"),{on:t.edgeOn("right")})]),g("div",{class:"ft-style-row"},uP.map(c=>g("button",{type:"button",class:`ft-style-btn${t.borderStyle===c.key?" on":""}`,dataset:{test:`style-${c.key}`,tip:t.borderStyle===c.key?m(e,"formatBar.k73",{v0:m(e,c.labelKey)}):m(e,c.labelKey)},onClick:()=>{t.toggleBorderStyle(c.key),e.repaint()}},[g("span",{class:"ft-style-line",style:{borderTop:c.preview}})]))),g("div",{class:"ft-border-style-row"},[g("span",{class:"ft-edge-label",text:m(e,"formatBar.k74")}),g("div",{class:"ft-line-width"},[ae({value:t.borderWidth,min:.25,max:5,step:.25,placeholder:t.borderMixed.width?m(e,"formatBar.k75"):void 0,onCommit:c=>{t.setBorderWidth(c),e.repaint()}})])]),g("div",{class:"ft-border-style-row"},[g("span",{class:"ft-edge-label",text:m(e,"formatBar.k76")}),dt(t.borderColor,c=>{t.setBorderColor(c),e.repaint()},m(e,"formatBar.k77"))]),t.borderMixedAny?g("p",{class:"pd-hint",text:m(e,"formatBar.k78")}):""].filter(Boolean))],u=[g("div",{class:"ft-align-panel",dataset:{test:"align-panel"}},[g("div",{class:"ft-align-row"},[["left",m(e,"formatBar.k79"),"TextAlignStart"],["center",m(e,"formatBar.k80"),"TextAlignCenter"],["right",m(e,"formatBar.k81"),"TextAlignEnd"],["justify",m(e,"formatBar.k82"),"TextAlignJustify"]].map(([c,f,h])=>g("button",{type:"button",class:`ft-cell-btn${r.textAlign===c?" on":""}`,dataset:{test:`align-${c}`,tip:f},disabled:o,onClick:()=>t.applyStyle({textAlign:c}),html:je(h)}))),g("div",{class:"ft-align-row"},[["top",m(e,"formatBar.k83"),"ArrowUpToLine"],["middle",m(e,"formatBar.k84"),"ChevronsUpDown"],["bottom",m(e,"formatBar.k85"),"ArrowDownToLine"]].map(([c,f,h])=>g("button",{type:"button",class:`ft-cell-btn${r.verticalAlign===c?" on":""}`,dataset:{test:`valign-${c}`,tip:f},disabled:o,onClick:()=>t.applyStyle({verticalAlign:c}),html:je(h)})))])];return g("div",{class:"format-toolbar"},[g("div",{class:"tb-ou ft-group",dataset:{unit:"painter"}},[g("button",{type:"button",class:`ft-btn${t.painterActive?" on":""}`,dataset:{test:"format-painter",tip:p},disabled:s,onClick:()=>{t.painterActive?t.cancelPainter():t.pickPainterSource(!1),e.repaint()},onDblclick:()=>{t.pickPainterSource(!0),e.repaint()},html:je("Paintbrush")})]),g("div",{class:"tb-ou ft-group",dataset:{unit:"font"}},[g("div",{class:"ft-font"},[ha({id:"ft-font",state:e.state,fonts:e.host.fonts,value:typeof r.fontFamily=="string"?r.fontFamily:void 0,placeholder:r.fontFamily===Rr?m(e,"formatBar.k86"):m(e,"formatBar.k87"),disabled:o,onChange:c=>t.applyStyle({fontFamily:c})})]),g("div",{class:"ft-size",dataset:{test:"font-size"}},[ae({value:typeof r.fontSize=="number"?r.fontSize:void 0,min:5,max:72,disabled:o,placeholder:r.fontSize===Rr?m(e,"formatBar.k88"):m(e,"formatBar.k89"),onCommit:c=>t.applyStyle({fontSize:c})})])]),g("div",{class:"tb-ou ft-group",dataset:{unit:"style"}},[...[["bold","Bold",m(e,"formatBar.k90"),()=>t.toggleBold()],["underline","Underline",m(e,"formatBar.k91"),()=>t.toggleUnderline()],["strike","Strikethrough",m(e,"formatBar.k92"),()=>t.toggleStrike()]].map(([c,f,h,b])=>g("button",{type:"button",class:`ft-btn${r[c]===!0?" on":""}`,dataset:{test:c,tip:l(h)},disabled:c==="bold"?o:n,onClick:b,html:je(f)}))]),g("div",{class:"tb-ou ft-group",dataset:{unit:"color"}},[g("span",{class:`ft-color-btn${o?" dim":""}`,title:m(e,"formatBar.k93",{v0:o?m(e,"formatBar.fontDisabledHint"):""})},[dt(typeof r.color=="string"?r.color:void 0,c=>t.applyStyle({color:c})),g("span",{class:"ft-glyph",text:"A"})]),g("span",{class:`ft-color-btn${i?" dim":""}`,title:m(e,"formatBar.k94")},[dt(typeof r.backgroundColor=="string"?r.backgroundColor:void 0,c=>t.applyStyle({backgroundColor:c})),g("span",{class:"ft-glyph",html:je("PaintBucket",14)})])]),g("div",{class:"tb-ou ft-group",dataset:{unit:"align"}},[na(e,"align",{icon:fP[String(r.textAlign)]??"TextAlignStart",text:m(e,"formatBar.k95"),textClass:"ft-btn-text",tip:o?m(e,"formatBar.k96"):m(e,"formatBar.k97"),disabled:o,testId:"align-dd"},u)]),g("div",{class:"tb-ou ft-group",dataset:{unit:"border"}},[na(e,"border",{icon:"Grid3x3",text:m(e,"formatBar.k98"),textClass:"ft-btn-text",tip:i?m(e,"formatBar.k99"):m(e,"formatBar.k100"),disabled:i,testId:"border"},d)])])}const mP="1.6.3";ia.filter(e=>e.material).map(e=>({type:e.type,label:e.label,icon:e.icon}));function ma(e,t){return je(e??"Shapes",t)||je("Shapes",t)}function gP(e){const t=e.state;if(t.leftCollapsed)return g("div",{class:"left-panel collapsed"},[g("div",{class:"left-collapsed"},[Vm("ChevronsRight",m(e,"panels.k137"),()=>{t.leftCollapsed=!1,e.repaint()}),...[["elements",m(e,"panels.k138"),"Table2"],["fields",m(e,"panels.k139"),"ListTree"],["layers",m(e,"panels.k140"),"Layers"]].map(([o,n,i])=>g("button",{type:"button",class:`lc-btn${t.leftTab===o?" on":""}`,title:n,html:ma(i,14),onClick:()=>{t.leftTab=o,t.leftCollapsed=!1,e.repaint()}}))])]);const r=(o,n,i="")=>g("div",{class:`pd-tab-pane${i?` ${i}`:""}`,role:"tabpanel",dataset:{pane:`left:${o}`},style:t.leftTab===o?"":{display:"none"}},n);return g("div",{class:"left-panel"},[g("div",{class:"left-head"},[g("span",{class:"left-title",text:m(e,"panels.k141")}),Vm("ChevronsLeft",m(e,"panels.k142"),()=>{t.leftCollapsed=!0,e.repaint()})]),g("div",{class:"pd-tabs left-tabs"},[g("div",{class:"pd-tab-bar",role:"tablist"},[...[["elements",m(e,"panels.k143")],["fields",m(e,"panels.k144")],["layers",m(e,"panels.k145")]].map(([o,n])=>g("button",{type:"button",class:`pd-tab${t.leftTab===o?" active":""}`,text:n,onClick:()=>{t.leftTab=o,e.repaint()}}))]),r("elements",yP(e),"material-grid"),r("fields",[vP(e)]),r("layers",[xP(e)])])])}function Vm(e,t,r){return g("button",{type:"button",class:"collapse-btn",title:t,html:ma(e,14),onClick:r})}const Gm={text:"elementDefinitions.k553",barcode:"elementDefinitions.k554",qrcode:"elementDefinitions.k555",image:"elementDefinitions.k556",table:"elementDefinitions.k557",longText:"elementDefinitions.k558",flowList:"elementDefinitions.k559",hline:"elementDefinitions.k560",vline:"elementDefinitions.k561",rect:"elementDefinitions.k562",oval:"elementDefinitions.k563",pageNumber:"elementDefinitions.k564",barChart:"echarts.series.typeNames.bar",barHChart:"echarts.series.typeNames.barH",lineChart:"echarts.series.typeNames.line",areaChart:"echarts.series.typeNames.area",pieChart:"echarts.series.typeNames.pie",doughnutChart:"echarts.series.typeNames.doughnut",scatterChart:"echarts.series.typeNames.scatter",radarChart:"echarts.series.typeNames.radar",funnelChart:"echarts.series.typeNames.funnel",gaugeChart:"echarts.series.typeNames.gauge"},bP={barChart:"elementGroup.chart"};function kP(e,t,r,o){return g("div",{class:`material-card${u1(o??t)?" material-card--wide":""}`,draggable:!0,dataset:{test:`material-${e}`},onDragstart:n=>{const i=n.dataTransfer;i?.setData("elementType",e),i&&(i.effectAllowed="all")}},[g("span",{class:"material-icon","data-icon":r,html:ma(r,14)}),g("span",{class:"material-label",text:o??t})])}function yP(e){const t=[];let r;for(const o of Gh()){const n=o.group;if(n&&n!==r){const p=bP[o.type];t.push(g("div",{class:"material-group-title",text:p?m(e,p):n}))}n&&(r=n);const i=Gm[o.type],a=i?m(e,i):void 0,s=a&&a!==i?a:void 0;t.push(kP(o.type,o.label,o.icon,s))}return[g("div",{class:"panel-title",text:m(e,"panels.k146")}),...t]}function vP(e){const t=e.state,r=t.fieldDisplay??"both",o=Su(e.store.fields),n=(t.fieldSearch??"").trim().toLowerCase(),i=n?o.map(a=>({...a,fields:a.fields.filter(s=>`${s.fieldLabel}${s.fieldKey}`.toLowerCase().includes(n))})).filter(a=>a.fields.length):o;return g("div",{class:"field-tree-panel"},[g("div",{class:"panel-title",text:m(e,"panels.k147")}),g("input",{class:"pd-input search-input",type:"search",placeholder:m(e,"panels.k148"),"aria-label":m(e,"panels.k149"),value:t.fieldSearch??"",onInput:a=>{t.fieldSearch=a.target.value},onChange:()=>e.repaint()}),g("div",{class:"tree-container"},i.flatMap(a=>{const s=t.collapsedGroups.has(a.key)&&!n,p=a.key?g("div",{class:`field-group-header${a.isList?" is-list":""}`,onClick:()=>{s?t.collapsedGroups.delete(a.key):t.collapsedGroups.add(a.key),e.repaint()}},[g("span",{class:"expand-icon",text:s?"▶":"▼"}),g("span",{class:"node-icon",text:a.isList?"📋":"📁"}),g("span",{class:"group-label",text:a.label,"data-tip":a.label})]):"",l=s?[]:a.fields.map(d=>g("div",{class:"field-row",draggable:!0,"data-tip":m(e,"panels.k150",{v0:d.fieldLabel,v1:d.fieldKey}),style:{paddingLeft:`${a.key?22:8}px`},onDragstart:u=>{const c=u.dataTransfer;c?.setData("fieldKey",d.fieldKey),c&&(c.effectAllowed="all")},onClick:()=>{Tu(d.fieldLabel||d.fieldKey).then(u=>{u&&(t.copiedFieldKey=d.fieldKey,e.repaint(),setTimeout(()=>{t.copiedFieldKey===d.fieldKey&&(t.copiedFieldKey="",e.repaint())},1200))})}},[g("span",{class:"node-icon",text:"📄"}),g("span",{class:"node-meta"},[r!=="key"?g("span",{class:"node-label",text:d.fieldLabel||d.fieldKey}):"",r!=="label"?g("span",{class:`node-key${r==="key"?" is-primary":""}`,text:r==="key"?d.fieldKey:`(${d.fieldKey})`}):""].filter(Boolean)),t.copiedFieldKey===d.fieldKey?g("span",{class:"copy-hint",text:m(e,"panels.k151")}):""].filter(Boolean)));return[p,g("div",{},l.filter(Boolean))].filter(Boolean)})),i.length===0?g("p",{class:"pd-empty",text:m(e,"panels.k152")}):""].filter(Boolean))}function wP(e,t){if(e.options.title)return e.options.title;const r=Gm[e.printElementType.type];return r?m(t,r):e.printElementType.title||e.printElementType.type}function xP(e){const t=e.store,r=[...t.elements].sort((s,p)=>(p.options.zIndex??0)-(s.options.zIndex??0)),o=t.elements.filter(s=>t.selectedIds.has(s.id)),n=o.length>=2,i=o.some(s=>!!s.options.groupId),a=s=>s.zone==="header"?m(e,"panels.k153"):s.zone==="footer"?m(e,"panels.k154"):"";return g("div",{class:"layer-panel"},[g("div",{class:"panel-title",text:m(e,"panels.k155")}),...r.map(s=>{const p=Xh(s.printElementType.type);return g("div",{class:`layer-item${t.selectedIds.has(s.id)?" active":""}`,onClick:l=>t.selectElement(s.id,l.ctrlKey||l.metaKey)},[g("span",{class:"layer-icon","data-icon":p??"Shapes",html:ma(p,12)}),g("span",{class:"layer-name",text:wP(s,e)}),a(s)?g("span",{class:"layer-zone",text:a(s)}):"",g("span",{class:"layer-zindex",text:`z:${s.options.zIndex??0}`})].filter(Boolean))}),r.length?g("div",{class:"layer-actions"},[...[["top",m(e,"panels.k156"),"ArrowUpToLine"],["up",m(e,"panels.k157"),"ArrowUp"],["down",m(e,"panels.k158"),"ArrowDown"],["bottom",m(e,"panels.k159"),"ArrowDownToLine"]].map(([s,p,l])=>g("button",{type:"button",class:"pd-button small",title:p,html:je(l,14),onClick:()=>e.fire("move-layer",s)}))]):"",n||i?g("div",{class:"layer-actions"},[n?g("button",{type:"button",class:"pd-button small",title:m(e,"panels.k160"),html:je("Group",14),onClick:()=>e.fire("group")}):"",i?g("button",{type:"button",class:"pd-button small",title:m(e,"panels.k161"),html:je("Ungroup",14),onClick:()=>e.fire("ungroup")}):""].filter(Boolean)):""].filter(Boolean))}function PP(e){const t=e.store,r=e.state,o=t.pages.length>1,n=t.pages[t.activePageIndex]?.name||m(e,"panels.k162",{v0:t.activePageIndex+1}),i=t.tilingEnabled;return g("div",{class:"page-tabs"},[g("div",{class:"page-tabs-list"},t.pages.map((s,p)=>r.renamingPage===p?g("input",{class:"page-tab-rename",dataset:{test:"page-rename-input"},value:r.renameText??"",onInput:l=>{r.renameText=l.target.value},onBlur:()=>a(),onKeydown:l=>{const d=l;if(d.key==="Enter"){a();return}d.key==="Escape"&&(r.renamingPage=null,e.repaint())}}):g("button",{type:"button",class:`page-tab${p===t.activePageIndex?" active":""}`,dataset:{tip:s.name?m(e,"panels.k163",{v0:s.name}):m(e,"panels.k164")},text:s.name||m(e,"panels.k165",{v0:p+1}),onClick:()=>t.switchPage(p),onDblclick:()=>{r.renamingPage=p,r.renameText=s.name??"",e.repaint()}}))),g("div",{class:"page-tabs-actions"},[g("button",{type:"button",dataset:{test:"add-page",tip:i?m(e,"panels.k166"):m(e,"panels.k167")},disabled:i,text:"+",onClick:()=>e.fire("add-page")}),g("button",{type:"button",dataset:{test:"duplicate-page",tip:i?m(e,"panels.k168"):m(e,"panels.k169",{v0:n})},disabled:i,text:"⧉",onClick:()=>e.fire("duplicate-page")}),g("button",{type:"button",dataset:{test:"delete-page",tip:o?m(e,"panels.k170",{v0:n}):m(e,"panels.k171")},disabled:!o,text:"✕",onClick:()=>e.fire("delete-page")}),g("button",{type:"button",dataset:{test:"move-left",tip:m(e,"panels.k172",{v0:n})},disabled:t.activePageIndex<=0,text:"←",onClick:()=>e.fire("move-page",-1)}),g("button",{type:"button",dataset:{test:"move-right",tip:m(e,"panels.k173",{v0:n})},disabled:t.activePageIndex>=t.pages.length-1,text:"→",onClick:()=>e.fire("move-page",1)})])]);function a(){const s=(r.renameText??"").trim();r.renamingPage!==null&&s&&t.renamePage(r.renamingPage,s),r.renamingPage=null,e.repaint()}}function EP(e){const t=e.store,r=t.templateData,o=ir(r),n=r.orientation==="landscape"?m(e,"panels.k174"):m(e,"panels.k175"),i=Lt[r.paperSize],a=i?m(e,i.labelKey):r.paperSize,s=r.outputRotation,p=`${a} ${n} ${Math.round(o.width)}×${Math.round(o.height)}mm${s?m(e,"panels.paperRotated",{rot:s}):""}`;return g("div",{class:"status-bar"},[g("span",{class:"status-item coord",dataset:{coord:""},style:{display:"none"}}),g("span",{class:"status-item",text:m(e,"panels.k176",{v0:t.scale})}),g("span",{class:"status-item",text:m(e,"panels.statusElements",{count:t.elements.length,selected:t.selectedIds.size?m(e,"panels.statusSelected",{n:t.selectedIds.size}):""})}),g("span",{class:"status-item status-version",text:`v${mP}`}),g("span",{class:"status-item status-paper",text:p})])}const SP=Object.keys(Lt).filter(e=>e!=="CUSTOM"&&!Lt[e]?.continuous);function TP(e){const t=document.createElement("label");t.className="pd-button small upload-label";const r=document.createTextNode(m(e,"pageExtras.k103")),o=document.createElement("input");o.className="visually-hidden",o.type="file",o.accept="image/*",t.append(r,o);const n=i=>{t.className=`pd-button small upload-label${i?" disabled":""}`,o.disabled=i};return o.addEventListener("change",async()=>{const i=o.files?.[0];if(!i)return;if(!i.type.startsWith("image/")){alert(m(e,"pageExtras.k104")),o.value="";return}const a=e.host.uploadDesignBackground;if(!a){alert(m(e,"pageExtras.k105")),o.value="";return}n(!0),r.textContent=m(e,"pageExtras.k106");try{const s=await a(i);s?e.store.updateTemplateData({designBackground:{src:s,rotation:0}}):alert(m(e,"pageExtras.k107"))}catch(s){alert(s instanceof Error?s.message:m(e,"pageExtras.k108"))}finally{r.textContent=m(e,"pageExtras.k109"),n(!e.host.uploadDesignBackground),o.value=""}}),e.host.uploadDesignBackground||n(!0),t}function MP(e){const r=e.store.templateData.designBackground,o=r?.rotation??0;return g("div",{class:"design-background-config"},[$t(m(e,"pageExtras.k110")),g("p",{class:"design-background-tip",text:m(e,"pageExtras.k111")}),r?.src?[g("div",{class:"design-background-path",title:r.src,text:r.src}),g("div",{class:"design-background-actions"},[g("button",{type:"button",class:"pd-button small rotate-btn",text:m(e,"pageExtras.k112",{v0:(o+90)%360}),onClick:()=>e.store.updateTemplateData({designBackground:{...r,rotation:(o+90)%360}})}),g("button",{type:"button",class:"pd-button small remove-btn",text:m(e,"pageExtras.k113"),onClick:()=>e.store.updateTemplateData({designBackground:void 0})})])]:TP(e)].flat())}function CP(e){const t=e.store,r=t.templateData,o=r.tiling,n={...Nt,...o??{},enabled:o?.enabled??!1,sheetMargin:{...Nt.sheetMargin,...o?.sheetMargin??{}}},i=Gn(r.paperSize),a=h=>t.updateTemplateData({tiling:{...n,...h}}),s=h=>Lr({target:n,base:Nt,propKey:h,write:()=>a({[h]:Nt[h]})}),p=h=>Lr({target:n.sheetMargin,base:Nt.sheetMargin,propKey:h,write:()=>l(h,Nt.sheetMargin[h])}),l=(h,b)=>a({sheetMargin:{...n.sheetMargin,[h]:b??0}}),d={...r,tiling:n},u=Fs(d),c=Math.max(hu(d),1);let f="";if(!u.length)try{const h=fu(d),b=Ko(d),k=n.sheetPaperSize==="CUSTOM"?m(e,"pageExtras.k114"):n.sheetPaperSize??"A4",v=n.sheetPaperSize==="CUSTOM"?"":n.sheetOrientation==="landscape"?m(e,"pageExtras.k115"):m(e,"pageExtras.k116");f=m(e,"pageExtras.k117",{v0:k,v1:v,v2:b.width,v3:b.height,v4:h.columns,v5:h.rows,v6:h.perSheet,v7:h.tile.width,v8:h.tile.height})}catch{f=""}return g("div",{class:"tiling-config",dataset:{test:"tiling-config"}},[$t(m(e,"pageExtras.k118")),g("p",{class:"pd-hint",text:m(e,"pageExtras.k119")}),g("div",{class:"pd-field"},[g("label",{class:"tiling-switch"},[g("input",{type:"checkbox",checked:n.enabled===!0,disabled:i,onChange:h=>{if(!h.target.checked){a({enabled:!1});return}a({...Nt,columns:Math.min(Nt.columns,Math.max(c,1))})}}),g("span",{text:m(e,"pageExtras.k120")})]),i?g("p",{class:"pd-hint tiling-error",text:m(e,"pageExtras.k121")}):""].filter(Boolean)),n.enabled&&!i?[he(m(e,"pageExtras.k122"),g("select",{class:"pd-select",style:{width:"100%"},onChange:h=>{const b=h.target.value;if(b!=="CUSTOM"){a({sheetPaperSize:b});return}const k=Ko(d);a({sheetPaperSize:"CUSTOM",sheetCustomWidth:n.sheetCustomWidth??k.width,sheetCustomHeight:n.sheetCustomHeight??k.height})}},[...SP.map(h=>g("option",{value:h,text:m(e,Lt[h]?.labelKey??h),selected:(n.sheetPaperSize??"A4")===h})),g("option",{value:"CUSTOM",text:m(e,"pageExtras.k123"),selected:n.sheetPaperSize==="CUSTOM"})]),void 0,s("sheetPaperSize")),n.sheetPaperSize==="CUSTOM"?he(m(e,"pageExtras.k124"),g("div",{class:"custom-size-grid"},[ae({value:Number(n.sheetCustomWidth??0),min:25,max:2e3,onCommit:h=>a({sheetCustomWidth:h})}),g("span",{class:"custom-size-x",text:"×"}),ae({value:Number(n.sheetCustomHeight??0),min:25,max:2e3,onCommit:h=>a({sheetCustomHeight:h})})])):he(m(e,"pageExtras.k125"),pr("tiling-ori",[{value:"portrait",label:m(e,"pageExtras.k126")},{value:"landscape",label:m(e,"pageExtras.k127")}],n.sheetOrientation==="landscape"?"landscape":"portrait",h=>a({sheetOrientation:h})),void 0,s("sheetOrientation")),$t(m(e,"pageExtras.k128")),g("div",{class:"margin-grid"},[he(m(e,"pageExtras.k129"),ae({value:n.sheetMargin.top??0,min:0,max:100,onCommit:h=>l("top",h)}),void 0,p("top")),he(m(e,"pageExtras.k130"),ae({value:n.sheetMargin.bottom??0,min:0,max:100,onCommit:h=>l("bottom",h)}),void 0,p("bottom")),he(m(e,"pageExtras.k131"),ae({value:n.sheetMargin.left??0,min:0,max:100,onCommit:h=>l("left",h)}),void 0,p("left")),he(m(e,"pageExtras.k132"),ae({value:n.sheetMargin.right??0,min:0,max:100,onCommit:h=>l("right",h)}),void 0,p("right"))]),$t(m(e,"pageExtras.k133")),he(m(e,"pageExtras.k134"),ae({value:n.gapX??0,min:0,max:50,onCommit:h=>a({gapX:h??0})}),void 0,s("gapX")),he(m(e,"pageExtras.k135"),ae({value:n.gapY??0,min:0,max:50,onCommit:h=>a({gapY:h??0})}),void 0,s("gapY")),he(m(e,"pageExtras.k136"),ae({value:n.columns??1,min:1,max:c,onCommit:h=>a({columns:h||1})})),...u.map(h=>g("p",{class:"pd-hint tiling-error",text:h.message})),!u.length&&f?g("p",{class:"pd-hint tiling-summary",text:f}):""]:""].flat().filter(Boolean))}const _P=new Set(cs.map(e=>e.group)),DP={"table-settings":"content"},Km=new Map;function ep(e){const t=e??"";let r=Km.get(t);if(!r){const{groups:o,itemKeys:n}=l1(t);r={groups:o,keys:n,searching:!!t.trim()},Km.set(t,r)}return r}function tp(e){const t=DP[e]??e;return _P.has(t)?t:""}function AP(e,t){const r=ep(e.state.propSearch);if(!r.searching)return!0;const o=tp(t);return!o||r.groups.includes(o)}function OP(e,t){const r=ep(e.state.propSearch);return!r.searching||r.keys.has(t)}function Ym(e,t){const r=e.props.style??{};return e.props.style={...r,display:t?"":"none"},e}function G(e,t,r){const o=r.props.dataset??{};return r.props.dataset={...o,propKey:t},Ym(r,OP(e,t))}function RP(e,t,r){const o=tp(t);if(!o)return r;const n=r.props.dataset??{};return r.props.dataset={...n,propGroup:o},Ym(r,AP(e,t))}function Xm(e,t){const r=ep(t);for(const o of Array.from(e.querySelectorAll("[data-prop-group]"))){const n=tp(o.dataset.propGroup??"");o.style.display=!r.searching||!n||r.groups.includes(n)?"":"none"}for(const o of Array.from(e.querySelectorAll("[data-prop-key]")))o.style.display=!r.searching||r.keys.has(o.dataset.propKey??"")?"":"none"}function IP(e){return g("div",{class:"property-search"},[g("input",{class:"pd-input",type:"search",placeholder:m(e,"propertySearch.k328"),"aria-label":m(e,"propertySearch.k329"),value:e.state.propSearch??"",onInput:t=>{const r=t.target,o=r.value;e.state.propSearch=o,Xm(r.getRootNode(),o)}})])}const LP={Document:"≡",Brush:"◧",Setting:"⚙"};function BP(e,t){try{const r=window.localStorage.getItem(`property-group-${e}`);return r===null?t:r==="true"}catch{return t}}function NP(e,t){try{window.localStorage.setItem(`property-group-${e}`,String(t))}catch{}}function it(e,t,r,o,n,i=!0,a=[]){const s=BP(t,i);return RP(e,t,g("div",{class:`property-group${s?" is-expanded":""}`},[g("div",{class:"group-header",onClick:()=>{NP(t,!s),e.repaint()}},[g("span",{class:"group-icon",text:LP[o]||"•"}),g("span",{class:"group-title",text:r}),...a,g("span",{class:"expand-icon",text:s?"▾":"▸"})]),g("div",{class:"group-content",style:s?"":{display:"none"}},n.filter(Boolean))]))}function ga(e){return g("form",{class:"pd-form",onSubmit:t=>t.preventDefault()},e.filter(Boolean))}function Zm(e){return e.split(".").flatMap(t=>{const r=t.match(/^([^\[]+)((?:\[\d+\])*)$/);if(!r)return[t];const o=r[1],n=[...r[2].matchAll(/\[(\d+)\]/g)].map(i=>Number(i[1]));return[o,...n]})}function Jm(e,t){return Zm(t).reduce((n,i)=>n==null?"":n[i],e)??""}function rp(e,t,r,o){const n=Zm(r),i=n.pop(),a=n.reduce((s,p)=>((s[p]===void 0||s[p]===null)&&(s[p]={}),s[p]),t);a[i]=o||void 0,e.recordHistory(),e.emit()}function FP(e,t){const r=e.store;if(t.printElementType.type==="table"&&r.tableSelection?.elementId===t.id){const{r1:o,c1:n}=r.tableSelection,i=(t.options.tableRows??[])[o];if(i)return Mu(i.type,o,n,t.options.fields?.[0]?.dataSource)}return Cy(t)}function $P(e,t){const r=document.createElement("label");r.className="pd-button small upload-label",rt(g("svg",{class:"pd-icon",viewBox:"0 0 24 24","aria-hidden":"true"},[g("path",{fill:"currentColor",d:"M12 3l4 4h-3v7h-2V7H8zm-7 12h14v5H5Z"})]),r);const o=document.createTextNode(m(e,"binding.k1")),n=document.createElement("input");n.className="visually-hidden",n.type="file",n.accept="image/*",r.append(o,n);const i=p=>{r.className=`pd-button small upload-label${p?" disabled":""}`,n.disabled=p};n.addEventListener("change",async()=>{const p=n.files?.[0];if(!p)return;if(!p.type.startsWith("image/")){alert(m(e,"binding.k2")),n.value="";return}const l=e.host.uploadImage;if(!l){alert(m(e,"binding.k3")),n.value="";return}i(!0),o.textContent=m(e,"binding.k4");try{const d=await l(p);d?rp(e.store,t,"options.src",d):alert(m(e,"binding.k5"))}catch(d){alert(d instanceof Error?d.message:m(e,"binding.k6"))}finally{o.textContent=m(e,"binding.k7"),i(!e.host.uploadImage),n.value=""}}),e.host.uploadImage||i(!0);const a=document.createElement("div");a.className="image-content-upload";const s=document.createElement("p");return s.className="upload-tip",s.textContent=m(e,"binding.k8"),a.append(r,s),a}function zP(e,t){const r=o=>e.fire("open-expression",{elementId:t.id,targetPath:o.targetPath,value:Jm(t,o.targetPath)});return it(e,"binding",m(e,"binding.k9"),"Document",[...FP(e,t).map(o=>he(o.labelKey?m(e,o.labelKey):o.label,g("input",{class:"pd-input",type:"text",value:Jm(t,o.targetPath),placeholder:o.placeholder||m(e,"binding.k10"),onChange:n=>rp(e.store,t,o.targetPath,n.target.value),onDblclick:()=>r(o)}))),t.printElementType.type==="image"?$P(e,t):""].filter(Boolean))}const bn=new Map;function ba(e){return`${Math.round(e*1e4)/1e4}%`}function Qm(e,t){const r=my(t.value),o=r.kind==="custom",n=r.kind==="axes"?r.x:50,i=r.kind==="axes"?r.y:50,a=wy(t.src),s=bn.get(a.src),p={widthMm:t.widthMm,heightMm:t.heightMm,naturalWidth:s?.width,naturalHeight:s?.height,fit:t.fit,scalePct:t.scale},l=gy(p),d=by(p,n,i),u=document.createElement("select");u.className="pd-select",u.style.width="100%";for(const b of Sy(l,n,i)){const k=document.createElement("option");k.value=b.value,k.textContent=b.label,u.appendChild(k)}if(o){const b=document.createElement("option");b.value="custom",b.textContent=m(e,"cropAnchor.k37"),u.appendChild(b)}u.value=o?"custom":`${n},${i}`,u.selectedIndex<0&&(u.selectedIndex=o?u.options.length-1:0),u.addEventListener("change",()=>{if(u.value==="custom")return;const[b,k]=u.value.split(",").map(Number);t.onCommit(yu(b,k))});const c=m(e,`propertyTips.${t.fieldKey}`),f=[g("div",{class:"pd-field",dataset:{field:t.fieldKey}},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[t.label,Ml(c)]),t.resetAnchor??""].filter(Boolean)),u])];f.push(g("div",{class:"pd-field",dataset:{field:"ap-img-fit-scale"}},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[xy(),Ml(m(e,"propertyTips.ap-img-fit-scale"))]),t.resetScale??""].filter(Boolean)),ae({value:t.scale,min:Oo,max:_d,step:5,placeholder:m(e,"cropAnchor.k38"),onCommit:b=>t.onScaleCommit(b>Oo?b:void 0)})]));for(const b of Ey(l,n,i))f.push(g("div",{class:"pd-field",dataset:{field:t.fieldKey}},[g("span",{class:"pd-label",text:b.label}),ae({value:b.value,min:0,max:100,step:1,onCommit:k=>t.onCommit(yu(b.name==="horizontal"?k:n,b.name==="vertical"?k:i))})]));const h=Py(l,o);return h&&f.push(g("p",{class:"pd-crop-note",text:h})),a.isSample&&f.push(g("p",{class:"pd-crop-note",text:vy()})),f.push(g("div",{class:"pd-crop-preview"},[g("img",{class:"pd-crop-thumb",src:a.src,alt:a.isSample?m(e,"cropAnchor.k39"):m(e,"cropAnchor.k40"),onLoad:b=>{const k=b.target;if(!(k.naturalWidth>0&&k.naturalHeight>0))return;const v=bn.get(a.src);v&&v.width===k.naturalWidth&&v.height===k.naturalHeight||(bn.set(a.src,{width:k.naturalWidth,height:k.naturalHeight}),e.repaint())},onError:()=>{bn.has(a.src)&&(bn.delete(a.src),e.repaint())}}),d?g("div",{class:"pd-crop-win",style:{left:ba(d.leftPct),top:ba(d.topPct),width:ba(d.widthPct),height:ba(d.heightPct)}}):""])),g("div",{class:t.containerClass??"pd-crop-anchor"},f)}const Fr=e=>Number(e??0),op=e=>e||void 0;function $r(e,t,r,o,n,i){return g("div",{class:"pd-field"},[g("span",{class:"pd-label",...o?{title:o}:{}},[g("span",{class:"pd-label-t",text:e}),n??""].filter(Boolean)),g("input",{class:"pd-switch",type:"checkbox",checked:t,...i?{disabled:!0}:{},onChange:a=>r(a.target.checked)})])}function eg(e,t,r,o,n=!1,i){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),""].filter(Boolean)),g("select",{class:"pd-select",...n?{style:{width:"100%"}}:{},onChange:a=>o(a.target.value)},r.map(a=>g("option",{value:a.value,text:a.label,selected:a.value===t})))])}function kn(e,t,r,o,n={}){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),n.reset??""].filter(Boolean)),zh(t,r,o,{className:"pd-select",...n.full?{width:"100%"}:{}})])}const fo=e=>g("p",{class:"pd-hint",text:e});function tg(e,t){return e.map(r=>({value:r.value,label:r.labelKey?m(t,r.labelKey):r.label??r.value,...r.disabled?{disabled:!0}:{}}))}const HP="tableProps.k330",UP=[{value:"header",labelKey:"tableProps.k331"},{value:"data",labelKey:"tableProps.k332"},{value:"subtotal",labelKey:"tableProps.k333"},{value:"summary",labelKey:"tableProps.k334"}],qP=[{value:"CODE128",labelKey:"tableProps.k335"},{value:"EAN13",labelKey:"tableProps.k336"},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],jP=[{value:"L",labelKey:"tableProps.k337"},{value:"M",labelKey:"tableProps.k338"},{value:"Q",label:"Q"},{value:"H",labelKey:"tableProps.k339"}],WP=[{value:"clip",labelKey:"tableProps.k340"},{value:"shrink",labelKey:"tableProps.k341"},{value:"autoHeight",labelKey:"tableProps.k342"}],VP={value:"__multi__",labelKey:"tableProps.k343",disabled:!0};function GP(e,t){const r=e.store,o=r.tableSelection,n=t.options.tableRows??[],i=o?n[o.r1]:void 0;if(!o||!i)return it(e,"table-row",m(e,"tableProps.k344"),"Grid",[]);const a=s=>r.updateElement(t.id,s);return it(e,"table-row",m(e,"tableProps.k345"),"Grid",[ga([eg(m(e,"tableProps.k346"),i.type,tg(UP,e),s=>{const p=Ia(n,o.r1,s);if(p){window.alert(p);return}a({tableRows:n})},!0),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k347")}),ae({value:i.height,min:3,max:100,step:.5,onCommit:s=>{i.height=s,a({tableRows:n})}})]),i.type==="header"?$r(m(e,"tableProps.k348"),i.repeatOnPage??!1,s=>{Mb(n,s),a({tableRows:n})},m(e,HP)):""])])}function KP(e,t){const r=e.store,o=t.options,n=d=>r.updateElement(t.id,d),i=o.tableColWidths??[],a=r.paperSize.width-r.templateData.margins.left-r.templateData.margins.right,s=r.fields.filter(d=>d.fieldType==="list").map(d=>({value:d.fieldKey,label:d.fieldLabel})),p=es("table"),l=d=>Lr({target:o,base:p,propKey:d,write:()=>n({[d]:p[d]})});return it(e,"table-settings",m(e,"tableProps.k349"),"Grid",[ga([eg(m(e,"tableProps.k350"),o.dataSource??"",s,d=>n({dataSource:d||void 0}),!0),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k351")}),l("tableDefaultFontFamily")]),ha({id:"table-default-font",state:e.state,fonts:e.host.fonts,value:o.tableDefaultFontFamily,placeholder:m(e,"tableProps.k352"),onChange:d=>n({tableDefaultFontFamily:d||void 0})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k353")}),l("tableDefaultFontSize")]),ae({value:Fr(o.tableDefaultFontSize),min:0,max:72,placeholder:m(e,"tableProps.k354"),onCommit:d=>n({tableDefaultFontSize:op(d)})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k355")}),l("tableDefaultColor")]),dt(o.tableDefaultColor,d=>n({tableDefaultColor:d}),m(e,"tableProps.k356"))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k357")}),l("tableDefaultPadding")]),ae({value:Fr(o.tableDefaultPadding),min:0,max:10,step:.5,placeholder:m(e,"tableProps.k358"),onCommit:d=>n({tableDefaultPadding:op(d)})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k359")}),...i.map((d,u)=>g("div",{class:"col-width-row"},[g("span",{style:{width:"60px"},text:m(e,"tableProps.k360",{v0:u+1})}),ae({value:d,min:5,max:200,onCommit:c=>{const f=i.reduce((h,b,k)=>k===u?h:h+b,0);if(f+c>a){const h=Math.max(5,Math.round((a-f)*10)/10);window.alert(m(e,"tableProps.k361",{v0:a,v1:u+1,v2:h})),i[u]=h}else i[u]=c;n({tableColWidths:i})}})]))])])])}function YP(e,t){const r=e.store,o=t.options,n=t.printElementType.type==="table",i=s=>r.updateElement(t.id,s),a=[];if(n)a.push(G(e,"pg-enabled",$r(m(e,"tableProps.k362"),o.tablePagination?.enabled??!0,s=>i({tablePagination:{enabled:s}}))));else{const s=o.pagination?.pageable??!0,p=o.pagination?.keepWithNext??!1;a.push(G(e,"pg-pageable",$r(m(e,"tableProps.k363"),s,l=>i({pagination:{pageable:l,keepWithNext:p}})))),a.push(G(e,"pg-keep-with-next",$r(m(e,"tableProps.k364"),p,l=>i({pagination:{pageable:s,keepWithNext:l}}))))}return it(e,"pagination",m(e,"tableProps.k365"),"Document",[ga(a)],!1)}const np=new WeakMap,rg=[{value:"top",labelKey:"tableProps.k366"},{value:"right",labelKey:"tableProps.k367"},{value:"bottom",labelKey:"tableProps.k368"},{value:"left",labelKey:"tableProps.k369"}];function XP(e,t){const r=e.store,o=r.tableSelection,n=t.options.tableRows??[];if(!o)return it(e,"table-cell",m(e,"tableProps.k370"),"Menu",[]);const i=Po(n,o.r1,o.c1),a=n[i.r]?.cells[i.c];if(!a)return it(e,"table-cell",m(e,"tableProps.k371"),"Menu",[]);const s=()=>On(n,o),p=La(n,o),l=p.count,d=p.mode==="multi",u=`${t.id}:${o.r1}:${o.c1}:${o.r2}:${o.c2}`,c=np.get(r),f=c?.key===u?c:{key:u,border:{},values:{},edges:{}};c?.key!==u&&np.set(r,f);const h=T=>{np.set(r,{key:u,border:T.border??f.border,values:T.values??f.values,edges:T.edges??f.edges})},b=(T,X)=>{h({border:{...f.border,[T]:X}}),e.repaint()},k=(T,X)=>{s().forEach(T),d&&X&&h({values:{...f.values,...X}}),r.updateElement(t.id,{tableRows:n})},v=(T,X)=>{k(ee=>{ee[T]=X},{[T]:X})},w=T=>d?f.values[T]:a[T],P=T=>d&&T in f.values,E=d?{width:void 0,style:void 0,color:void 0}:ad(n,o),D=!d&&s().some(T=>!!T.borders&&!!(T.borders.top||T.borders.right||T.borders.bottom||T.borders.left)),O=!d&&!D,A={width:O?0:typeof E.width=="number"?E.width:rr.width,style:O?"none":typeof E.style=="string"&&E.style!=="mixed"?E.style:rr.style,color:typeof E.color=="string"&&E.color!=="mixed"?E.color:rr.color,...f.border},R="__mixed__",_={style:!d&&E.style==="mixed",width:!d&&E.width==="mixed",color:!d&&E.color==="mixed"},I=_.style&&!("style"in f.border),S=_.width&&!("width"in f.border),N=_.color&&!("color"in f.border),F=I||S||N,H=I?R:A.style,le=S?void 0:A.width,M=N?void 0:A.color,ne=T=>{const X={style:T};T!=="none"&&le===0?X.width=rr.width:T==="none"&&!D&&(X.width=0),h({border:{...f.border,...X}}),e.repaint()},Se=()=>({...A}),Pe=d?rg.reduce((T,X)=>(T[X.value]=f.edges[X.value]?"on":"off",T),{}):Kd(s().map(T=>T.borders)),K=d?"cellType"in f.values?f.values.cellType??"text":Ab(n,o):a.cellType??"text",ue=K==="barcode",me=K==="qrcode",we=K==="image",ke=K==="text",te=ue&&!!w("printerDpi"),Me=Td(w("printerDpi"),w("barWidth"),e.t??oe),se=d?f.values.textFit:Fa(a),Je=d?"cellType"in f.values?f.values.cellType??"text":"":a.cellType||"text",ze=T=>tg(d?[VP,...T]:T,e),ve=T=>d?m(e,"tableProps.k372"):T,Ee=(T,X)=>d?f.values[T]:X,ho=d?w("barcodeType")??"__multi__":a.barcodeType||"CODE128",vn=d?P("printerDpi")?w("printerDpi")?String(w("printerDpi")):"":"__multi__":a.printerDpi?String(a.printerDpi):"",wn=d?w("qrCodeLevel")??"__multi__":a.qrCodeLevel||"M",xn=d?w("fit")??"__multi__":a.fit||"contain",mo=se??"__multi__",xe=Qp(n,o);let Dt=!0;for(let T=o.r1;T<=o.r2;T++)if(n[T]?.type!=="data"){Dt=!1;break}const C=Dt?"":m(e,"tableProps.k373");let q=!1;for(let T=o.r1;T<=o.r2&&!q;T++)for(let X=o.c1;X<=o.c2&&!q;X++){const ee=n[T]?.cells[X];ee&&!ee.merged&&((ee.rowspan??1)>1||(ee.colspan??1)>1)&&(q=!0)}const U=(T,X,ee,ie={},ce)=>g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:T}),ce??""].filter(Boolean)),ae({value:X,...ie,onCommit:Te=>v(ee,op(Te))})]),V=m(e,"tableProps.k374"),j=T=>Lr({target:a,base:{},propKey:T,tipOverride:V,force:d,write:()=>v(T,void 0)}),J=t.options.tableDefaultPadding??1,pe={width:za(t.options.tableColWidths??[],i.c,a,J),height:Co(n,i.r,a,J)};return it(e,"table-cell",m(e,"tableProps.k375"),"Menu",[ga([d?fo(m(e,"tableProps.k376",{v0:l})):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k377")}),pr("cell-type",[{value:"text",label:m(e,"tableProps.k378")},{value:"barcode",label:m(e,"tableProps.k379")},{value:"qrcode",label:m(e,"tableProps.k380")},{value:"image",label:m(e,"tableProps.k381")}],Je,T=>{const X=T==="text"?void 0:T,ee={cellType:T};T!=="barcode"&&Object.assign(ee,{barcodeType:void 0,showBarcodeText:void 0,printerDpi:void 0,barQuietZone:void 0,barHeight:void 0}),T!=="qrcode"&&Object.assign(ee,{qrCodeLevel:void 0,qrQuietZone:void 0}),k(ie=>{ie.cellType=X,T!=="barcode"&&(ie.barcodeType=void 0,ie.showBarcodeText=void 0,ie.printerDpi=void 0,ie.barQuietZone=void 0,ie.barHeight=void 0),T!=="qrcode"&&(ie.qrCodeLevel=void 0,ie.qrQuietZone=void 0)},ee)})]),ue?kn(m(e,"tableProps.k382"),ho,ze(qP),T=>{T!=="__multi__"&&v("barcodeType",T||void 0)}):"",ue?$r(m(e,"tableProps.k383"),d?f.values.showBarcodeText===!0:a.showBarcodeText!==!1,T=>v("showBarcodeText",T),void 0,j("showBarcodeText")):"",ue?U(m(e,"tableProps.k384"),Ee("barWidth",a.barWidth??2),"barWidth",{min:2,max:8,step:.5,placeholder:ve("")},j("barWidth")):"",ue?fo((te?m(e,"tableProps.k385"):m(e,"tableProps.k386"))+(Me?`。${Me}`:"")):"",ue?Ge(m(e,"tableProps.k387"),ae({value:Ee("barQuietZone",a.barQuietZone),min:0,max:20,placeholder:ve(m(e,"tableProps.k388")),onCommit:T=>v("barQuietZone",T)}),m(e,"propertyTips.cd-bar-quiet-zone"),j("barQuietZone")):"",ue?Ge(m(e,"tableProps.k389"),ae({value:Ee("barHeight",a.barHeight),min:1,max:100,placeholder:ve(m(e,"tableProps.k390")),onCommit:T=>v("barHeight",T??void 0)}),m(e,"propertyTips.cd-bar-height"),j("barHeight")):"",ue?U(m(e,"tableProps.k391"),Ee("barFontSize",a.barFontSize??10),"barFontSize",{min:5,max:24,placeholder:ve(m(e,"tableProps.k392"))},j("barFontSize")):"",ue?kn(m(e,"tableProps.k393"),vn,ze([{value:"",label:m(e,"tableProps.k394")},{value:"203",label:m(e,"tableProps.k395")},{value:"300",label:m(e,"tableProps.k396")},{value:"600",label:m(e,"tableProps.k397")}]),T=>{if(T==="__multi__")return;const X=Number(T);v("printerDpi",X>0?X:void 0)},{reset:j("printerDpi")}):"",ue?fo(m(e,"tableProps.k398")):"",me?kn(m(e,"tableProps.k399"),wn,ze(jP),T=>{T!=="__multi__"&&v("qrCodeLevel",T||void 0)},{reset:j("qrCodeLevel")}):"",me?Ge(m(e,"tableProps.k400"),ae({value:Ee("qrQuietZone",a.qrQuietZone),min:0,max:8,placeholder:ve(m(e,"tableProps.k401")),onCommit:T=>v("qrQuietZone",T)}),m(e,"propertyTips.cd-quiet-zone"),j("qrQuietZone")):"",ue?fo(m(e,"tableProps.k402")):"",me||we?kn(m(e,"tableProps.k403"),xn,ze(Hs(e.t??oe)),T=>{T!=="__multi__"&&v("fit",T)},{reset:j("fit")}):"",we&&!d&&a.fit==="cover"?Qm(e,{fieldKey:"ap-img-object-position",label:m(e,"tableProps.k404"),src:xu(a.formatter),fit:a.fit,containerClass:"pd-cell-anchor",widthMm:pe.width,heightMm:pe.height,scale:a.fitScale,value:a.objectPosition,onCommit:T=>v("objectPosition",T),onScaleCommit:T=>v("fitScale",T),resetAnchor:j("objectPosition"),resetScale:j("fitScale")}):"",ue||me||we?U(m(e,"tableProps.k405"),Ee("maxWidth",Fr(a.maxWidth)),"maxWidth",{min:0,max:200,placeholder:ve(m(e,"tableProps.k406"))},j("maxWidth")):"",ue||me||we?U(m(e,"tableProps.k407"),Ee("maxHeight",Fr(a.maxHeight)),"maxHeight",{min:0,max:200,placeholder:ve(m(e,"tableProps.k408"))},j("maxHeight")):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k409")}),g("input",{class:"pd-input",type:"text",value:d?w("formatter")??"":a.formatter||"",placeholder:d?m(e,"tableProps.k410"):m(e,"tableProps.k411"),onChange:T=>v("formatter",T.target.value||void 0),onDblclick:()=>e.fire("table-cell-dblclick",{elementId:t.id,r:i.r,c:i.c,cellId:a.id})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k412")}),j("align")]),pr("cell-align",[{value:"left",label:m(e,"tableProps.k413")},{value:"center",label:m(e,"tableProps.k414")},{value:"right",label:m(e,"tableProps.k415")},{value:"justify",label:m(e,"tableProps.k416")}],d?f.values.align??"":a.align||"left",T=>v("align",T))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k417")}),j("valign")]),pr("cell-valign",[{value:"top",label:m(e,"tableProps.k418")},{value:"middle",label:m(e,"tableProps.k419")},{value:"bottom",label:m(e,"tableProps.k420")}],d?f.values.valign??"":a.valign||"top",T=>v("valign",T))]),g("div",{class:"cell-style-grid"},[g("div",{class:"pd-field cell-font-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k421")}),j("fontFamily")]),ha({id:"cell-font",state:e.state,fonts:e.host.fonts,value:d?w("fontFamily"):a.fontFamily,placeholder:ve(m(e,"tableProps.k422")),onChange:T=>v("fontFamily",T)})]),U(m(e,"tableProps.k423"),Ee("fontSize",Fr(a.fontSize)),"fontSize",{min:0,max:72,placeholder:ve(m(e,"tableProps.k424"))},j("fontSize")),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k425")}),j("fontWeight")]),g("input",{class:"pd-switch",type:"checkbox",checked:d?f.values.fontWeight==="bold":a.fontWeight==="bold",onChange:T=>v("fontWeight",T.target.checked?"bold":void 0)})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k426")}),j("color")]),dt(d?w("color"):a.color,T=>v("color",T),m(e,"tableProps.k427"))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k428")}),j("backgroundColor")]),dt(d?w("backgroundColor"):a.backgroundColor,T=>v("backgroundColor",T),m(e,"tableProps.k429"))])]),$t(m(e,"tableProps.k430")),g("div",{class:"border-style-row"},[zh(H,[...I?[{value:R,label:m(e,"tableProps.k431"),disabled:!0}]:[],...Yd.map(T=>({...T,label:m(e,T.labelKey)}))],T=>{T!==R&&ne(T)},{width:"90px"}),g("div",{style:{width:"112px",flexShrink:"0"}},[ae({value:le,min:.25,max:5,step:.25,placeholder:d?m(e,"tableProps.k432"):S?m(e,"tableProps.k433"):void 0,onCommit:T=>b("width",T)})]),dt(M,T=>b("color",T),m(e,"tableProps.k434"))]),g("div",{class:"pd-button-group border-presets"},[["all",m(e,"tableProps.k435")],["outer",m(e,"tableProps.k436")],["inner",m(e,"tableProps.k437")],["none",m(e,"tableProps.k438")]].map(([T,X])=>g("button",{type:"button",class:"pd-button small",text:X,onClick:()=>{nd(n,o,A.style==="none"?"none":T,Se()),r.updateElement(t.id,{tableRows:n})}}))),g("div",{class:"pd-checkbox-group"},rg.map(T=>g("label",{class:"pd-checkbox"},[g("input",{type:"checkbox",value:T.value,checked:Pe[T.value]==="on",indeterminate:Pe[T.value]==="mixed",onChange:X=>{const ie=X.target.checked&&A.style!=="none";d&&h({edges:{...f.edges,[T.value]:ie}}),k(ce=>{id(ce,T.value,ie?Se():null)})}}),g("span",{text:m(e,T.labelKey)})]))),fo(m(e,d?_b:F?Db:Cb)),U(m(e,"tableProps.k439"),Ee("padding",Fr(a.padding)),"padding",{min:0,max:10,step:.5,placeholder:ve(m(e,"tableProps.k440"))},j("padding")),$r(m(e,"tableProps.k441"),d?f.values.wordWrap===!0:a.wordWrap??!0,T=>v("wordWrap",T),void 0,j("wordWrap")),ke?kn(m(e,"tableProps.k442"),mo,ze(WP),T=>{T!=="__multi__"&&v("textFit",T)},{full:!0,reset:j("textFit")}):"",ke&&se==="shrink"?U(m(e,"tableProps.k443"),Ee("shrinkMinFontSize",Fr(a.shrinkMinFontSize)),"shrinkMinFontSize",{min:0,max:72,step:.5,placeholder:ve(m(e,"tableProps.k444"))},j("shrinkMinFontSize")):"",g("div",{class:"merge-card"},[g("div",{class:"merge-card-title",text:m(e,"tableProps.k445")}),g("div",{class:"merge-btns"},[g("button",{type:"button",class:"pd-button small",text:m(e,"tableProps.k446"),disabled:!!xe,title:xe||"",onClick:()=>{ed(n,o),r.updateElement(t.id,{tableRows:n})}}),g("button",{type:"button",class:"pd-button small",text:m(e,"tableProps.k447"),disabled:!q,onClick:()=>{td(n,o),r.updateElement(t.id,{tableRows:n})}})]),g("div",{class:"merge-card-divider"}),$r(m(e,"tableProps.k448"),d?f.values.mergeSameValue===!0:a.mergeSameValue===!0,T=>v("mergeSameValue",T),C||void 0,Dt?j("mergeSameValue"):void 0,!Dt),fo(m(e,"tableProps.k449"))])])])}const ip=ek;function ap(e){const t=e.trim();return t?/[{}]/.test(t)||/^[A-Za-z_$][\w$]*\s*\(/.test(t)?!0:/^[A-Za-z_$][\w$]*(\.[\w$]+)+$/.test(t):!1}function ZP(e){return e?e.mode==="binding"?e.binding??"":e.content??"":""}function JP(e){const t=e.store.templateData.watermark,r=ZP(t),o=t?.mode==="binding"||r!==""&&ap(r),n=(()=>{const l=t?.tileWidth??ge.tileWidth,d=t?.tileHeight??ge.tileHeight;for(const[u,c]of Object.entries(ip))if(c.width===l&&c.height===d)return u;return"custom"})(),i=l=>{const d={...t,testData:t?.testData??"",rotate:t?.rotate??ge.rotate,color:t?.color||ge.color,opacity:t?.opacity??ge.opacity,tileWidth:t?.tileWidth??ge.tileWidth,tileHeight:t?.tileHeight??ge.tileHeight};e.store.updateTemplateData({watermark:{...d,...l}})},a=()=>e.fire("open-expression",{elementId:"",targetPath:"watermark.content",value:r}),s={rotate:t?.rotate??ge.rotate,color:t?.color||ge.color,opacity:t?.opacity??ge.opacity,tileWidth:t?.tileWidth??ge.tileWidth,tileHeight:t?.tileHeight??ge.tileHeight},p=l=>Lr({target:s,base:ge,propKey:l,write:()=>i({[l]:ge[l]})});return g("div",{class:"watermark-config"},[$t(m(e,"watermark.k538")),g("form",{class:"pd-form",onSubmit:l=>l.preventDefault()},[g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"watermark.k539")}),g("input",{class:"pd-input",type:"text",value:r,placeholder:m(e,"watermark.k540"),title:m(e,"watermark.k541"),onChange:l=>{const d=l.target.value;i(ap(d)?{mode:"binding",binding:d,content:""}:{mode:"fixed",content:d,binding:""})},onDblclick:a}),g("button",{type:"button",class:"pd-button small",text:m(e,"watermark.k542"),onClick:a})]),o?he(m(e,"watermark.k543"),g("input",{class:"pd-input",type:"text",value:t?.testData??"",placeholder:m(e,"watermark.k544"),onChange:l=>i({testData:l.target.value})})):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k545")}),p("rotate")]),g("input",{type:"range",class:"pd-range",min:-90,max:90,step:5,value:String(t?.rotate??ge.rotate),onChange:l=>i({rotate:Number(l.target.value)})}),g("span",{class:"pd-hint",text:`${t?.rotate??ge.rotate}°`})]),he(m(e,"watermark.k546"),dt(t?.color||ge.color,l=>i({color:l}),m(e,"watermark.k547")),void 0,p("color")),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k548")}),p("opacity")]),g("input",{type:"range",class:"pd-range",min:.05,max:.5,step:.05,value:String(t?.opacity??ge.opacity),onChange:l=>i({opacity:Number(l.target.value)})}),g("span",{class:"pd-hint",text:(t?.opacity??ge.opacity).toFixed(2)})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"watermark.k549")}),g("select",{class:"pd-select",style:{width:"100%"},onChange:l=>{const d=l.target.value,u=ip[d];u&&i({tileWidth:u.width,tileHeight:u.height})}},[...Object.entries(ip).map(([l,d])=>g("option",{value:l,text:`${m(e,d.labelKey)}${m(e,"constants.watermark.density.size",{w:d.width,h:d.height})}`,selected:n===l})),g("option",{value:"custom",text:m(e,"watermark.k550"),selected:n==="custom"})])]),n==="custom"?g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k551")}),p("tileWidth")]),g("input",{type:"number",class:"pd-input",min:ge.minTileWidth,step:10,value:String(t?.tileWidth??ge.tileWidth),onChange:l=>i({tileWidth:Number(l.target.value)})})]):"",n==="custom"?g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k552")}),p("tileHeight")]),g("input",{type:"number",class:"pd-input",min:ge.minTileHeight,step:10,value:String(t?.tileHeight??ge.tileHeight),onChange:l=>i({tileHeight:Number(l.target.value)})})]):""].filter(Boolean))])}function Fe(e,t,r,o,n={},i){return he(t,ae({value:r,...n,onCommit:o}),void 0,i)}function Xt(e,t,r,o,n,i,a){const s=document.createElement("select");s.className="pd-select",s.addEventListener("change",()=>n(s.value));for(const p of o){const l=document.createElement("option");l.value=p.value,l.textContent=p.label,s.appendChild(l)}return s.value=r,o.some(p=>p.value===r)||(s.selectedIndex=-1),i?Ge(t,s,i,a):he(t,s,void 0,a)}function zr(e,t,r,o,n){return he(t,g("input",{type:"checkbox",class:"pd-switch",checked:r,onChange:i=>o(i.target.checked)}),void 0,n)}const QP=[{value:"all",labelKey:"propertyPanel.k177"},{value:"outer",labelKey:"propertyPanel.k178"},{value:"inner",labelKey:"propertyPanel.k179"},{value:"none",labelKey:"propertyPanel.k180"}],e3=[{value:"top",labelKey:"propertyPanel.k181"},{value:"right",labelKey:"propertyPanel.k182"},{value:"bottom",labelKey:"propertyPanel.k183"},{value:"left",labelKey:"propertyPanel.k184"}];function t3(e,t){const r=e.store,o=t.options,n=t.printElementType.type,i=M=>r.updateElement(t.id,M),a=Kh(n),s=a==="text",p=a==="code",l=a==="table",d=l&&r.tableSelection?.elementId===t.id,u=d&&La(t.options.tableRows??[],r.tableSelection).mode==="multi",c=[];u||c.push(zP(e,t));const f=es(n),h=(M,ne)=>{const Se=p1(ne);return Lr({target:o,base:f,propKey:M,tipValue:Se?.value,tipUnit:Se?.unit,write:()=>i({[M]:f[M]})})};d||c.push(it(e,"position-size",m(e,"propertyPanel.k185"),"Location",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[g("div",{class:"position-grid"},[G(e,"ps-left",Fe(e,"X",o.left,M=>i({left:M}),{min:0})),G(e,"ps-top",Fe(e,"Y",o.top,M=>i({top:M}),{min:0})),G(e,"ps-width",Fe(e,"W",o.width,M=>i({width:M}),{min:4})),G(e,"ps-height",Fe(e,"H",o.height,M=>i({height:M}),{min:4}))]),g("h3",{class:"pd-divider",text:m(e,"propertyPanel.k186")}),g("div",{class:"margin-grid"},[G(e,"ps-margin-top",Fe(e,m(e,"propertyPanel.k187"),o.marginTop,M=>i({marginTop:M===0?void 0:M}),{},h("marginTop","ps-margin-top"))),G(e,"ps-margin-right",Fe(e,m(e,"propertyPanel.k188"),o.marginRight,M=>i({marginRight:M===0?void 0:M}),{},h("marginRight","ps-margin-right"))),G(e,"ps-margin-bottom",Fe(e,m(e,"propertyPanel.k189"),o.marginBottom,M=>i({marginBottom:M===0?void 0:M}),{},h("marginBottom","ps-margin-bottom"))),G(e,"ps-margin-left",Fe(e,m(e,"propertyPanel.k190"),o.marginLeft,M=>i({marginLeft:M===0?void 0:M}),{},h("marginLeft","ps-margin-left")))])])]));const b=typeof o.rotate=="number"&&Number.isFinite(o.rotate)&&o.rotate!==0?Ro(o.rotate):void 0,k=M=>i({rotate:M===void 0||M===0?void 0:Ro(M)}),v=g0(n,o),w=Rd(n)||Fd(r.elements).has(t.id),P=w?"":G(e,"ap-rotate",Ge(m(e,"propertyPanel.k191"),g("div",{class:"pd-rotate-row"},[g("button",{type:"button",class:"pd-rotate-btn",title:m(e,"propertyPanel.k192"),"aria-label":m(e,"propertyPanel.k193"),text:"↺",onClick:()=>k((b??0)-90)}),g("div",{class:"pd-rotate-stepper"},[ae({value:b,min:0,max:359,placeholder:"0",disabled:!v,onCommit:M=>k(M)})]),g("button",{type:"button",class:"pd-rotate-btn",title:m(e,"propertyPanel.k194"),"aria-label":m(e,"propertyPanel.k195"),text:"↻",onClick:()=>k((b??0)+90)})]),m(e,"propertyTips.ap-rotate"),h("rotate","ap-rotate"))),E=w||v?"":g("p",{class:"pd-hint pd-rotate-note",text:m0(e.t??oe)});if(c.push(it(e,"appearance",m(e,"propertyPanel.k196"),"Brush",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},s?[G(e,"ap-font-family",he(m(e,"propertyPanel.k197"),ha({id:"prop-font",state:e.state,fonts:e.host.fonts,value:typeof o.fontFamily=="string"?o.fontFamily:void 0,placeholder:m(e,"propertyPanel.k198"),onChange:M=>i({fontFamily:M})}),void 0,h("fontFamily","ap-font-family"))),G(e,"ap-font-size",Fe(e,m(e,"propertyPanel.k199"),o.fontSize,M=>i({fontSize:M}),{min:8,max:72},h("fontSize","ap-font-size"))),G(e,"ap-font-weight",Xt(e,m(e,"propertyPanel.k200"),String(o.fontWeight??""),[{value:"normal",label:m(e,"propertyPanel.k201")},{value:"bold",label:m(e,"propertyPanel.k202")},{value:"bolder",label:m(e,"propertyPanel.k203")},{value:"lighter",label:m(e,"propertyPanel.k204")}],M=>i({fontWeight:M}),void 0,h("fontWeight","ap-font-weight"))),G(e,"ap-align",he(m(e,"propertyPanel.k205"),pr("ta",[{value:"left",label:m(e,"propertyPanel.k206")},{value:"center",label:m(e,"propertyPanel.k207")},{value:"right",label:m(e,"propertyPanel.k208")},{value:"justify",label:m(e,"propertyPanel.k209")}],o.textAlign||"left",M=>i({textAlign:M})),void 0,h("textAlign","ap-align"))),G(e,"ap-vertical-align",he(m(e,"propertyPanel.k210"),pr("va",[{value:"top",label:m(e,"propertyPanel.k211")},{value:"middle",label:m(e,"propertyPanel.k212")},{value:"bottom",label:m(e,"propertyPanel.k213")}],o.verticalAlign||"top",M=>i({verticalAlign:M})),void 0,h("verticalAlign","ap-vertical-align"))),g("div",{class:"color-row"},[G(e,"ap-color",he(m(e,"propertyPanel.k214"),dt(o.color,M=>i({color:M}),m(e,"propertyPanel.k215")),void 0,h("color","ap-color"))),G(e,"ap-bg-color",he(m(e,"propertyPanel.k216"),dt(o.backgroundColor,M=>i({backgroundColor:M}),m(e,"propertyPanel.k217")),void 0,h("backgroundColor","ap-bg-color")))]),G(e,"ap-line-height",Fe(e,m(e,"propertyPanel.k218"),o.lineHeight,M=>i({lineHeight:M||void 0}),{min:0,max:100},h("lineHeight","ap-line-height"))),G(e,"ap-letter-spacing",Fe(e,m(e,"propertyPanel.k219"),o.letterSpacing,M=>i({letterSpacing:M||void 0}),{min:0,max:20,step:.5},h("letterSpacing","ap-letter-spacing"))),G(e,"ap-text-fit",Xt(e,m(e,"propertyPanel.k220"),Ln(n,o),[{value:"clip",label:m(e,"propertyPanel.k221")},{value:"shrink",label:m(e,"propertyPanel.k222")},{value:"autoHeight",label:m(e,"propertyPanel.k223")}],M=>i({textFit:M}),void 0,h("textFit","ap-text-fit"))),o.textFit==="shrink"?G(e,"ap-shrink-min",he(m(e,"propertyPanel.k224"),ae({value:o.shrinkMinFontSize,min:1,max:72,step:.5,placeholder:m(e,"propertyPanel.k225"),onCommit:M=>i({shrinkMinFontSize:M||void 0})}),void 0,h("shrinkMinFontSize","ap-shrink-min"))):"",n==="longText"?G(e,"ap-long-text-indent",Ge(m(e,"propertyPanel.k226"),ae({value:o.longTextIndent,min:0,max:10,placeholder:m(e,"propertyPanel.k227"),onCommit:M=>i({longTextIndent:M||void 0})}),m(e,"propertyTips.ap-long-text-indent"),h("longTextIndent","ap-long-text-indent"))):"",G(e,"ap-word-wrap",zr(e,m(e,"propertyPanel.k228"),o.wordWrap!==!1,M=>i({wordWrap:M?void 0:!1}),h("wordWrap","ap-word-wrap"))),G(e,"ap-keep-line-breaks",zr(e,m(e,"propertyPanel.k229"),o.keepLineBreaks===!0,M=>i({keepLineBreaks:M?!0:void 0}),h("keepLineBreaks","ap-keep-line-breaks"))),P,E]:[n==="image"?G(e,"ap-img-fit",Xt(e,m(e,"propertyPanel.k230"),String(o.fit??"contain"),Hs(e.t??oe),M=>i({fit:M}),m(e,"propertyTips.ap-img-fit"),h("fit","ap-img-fit"))):"",n==="image"&&o.fit==="cover"?G(e,"ap-img-object-position",Qm(e,{fieldKey:"ap-img-object-position",label:m(e,"propertyPanel.k231"),src:xu(o.src),widthMm:Number(o.width)||0,heightMm:Number(o.height)||0,fit:o.fit,scale:o.fitScale,value:o.objectPosition===void 0?void 0:String(o.objectPosition),onCommit:M=>i({objectPosition:M}),onScaleCommit:M=>i({fitScale:M}),resetAnchor:h("objectPosition","ap-img-object-position"),resetScale:h("fitScale","ap-img-fit-scale")})):"",P,E,n==="flowList"?g("p",{class:"pd-empty",text:m(e,"propertyPanel.k232")}):""].filter(Boolean))])),p){const M=n==="barcode",ne=String(o.barcodeType||"CODE128").toUpperCase(),Se=o.printerDpi?String(o.printerDpi):"",Pe=Td(o.printerDpi,o.barWidth,e.t??oe);c.push(it(e,"code",m(e,"propertyPanel.k233"),"Postcard",[g("form",{class:"pd-form",onSubmit:K=>K.preventDefault()},[M?[G(e,"cd-type",Xt(e,m(e,"propertyPanel.k234"),ne,[{value:"CODE128",label:m(e,"propertyPanel.k235")},{value:"EAN13",label:m(e,"propertyPanel.k236")},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],K=>i({barcodeType:K==="CODE128"?void 0:K}))),G(e,"cd-dpi",Xt(e,m(e,"propertyPanel.k237"),Se,[{value:"",label:m(e,"propertyPanel.k238")},{value:"203",label:m(e,"propertyPanel.k239")},{value:"300",label:m(e,"propertyPanel.k240")},{value:"600",label:m(e,"propertyPanel.k241")}],K=>i({printerDpi:Number(K)>0?Number(K):void 0}),void 0,h("printerDpi","cd-dpi"))),G(e,"cd-dpi",g("p",{class:"pd-hint",text:m(e,"propertyPanel.k242")})),G(e,"cd-bar-width",Fe(e,m(e,"propertyPanel.k243"),o.barWidth??2,K=>i({barWidth:K}),{min:2,max:8,step:.5},h("barWidth","cd-bar-width"))),G(e,"cd-bar-width",g("p",{class:"pd-hint",text:(Se?m(e,"propertyPanel.k244"):m(e,"propertyPanel.k245"))+(Pe?`。${Pe}`:"")})),G(e,"cd-bar-quiet-zone",Ge(m(e,"propertyPanel.k246"),ae({value:o.barQuietZone,min:0,max:20,placeholder:m(e,"propertyPanel.k247"),onCommit:K=>i({barQuietZone:K})}),m(e,"propertyTips.cd-bar-quiet-zone"),h("barQuietZone","cd-bar-quiet-zone"))),G(e,"cd-bar-height",Ge(m(e,"propertyPanel.k248"),ae({value:o.barHeight,min:1,max:100,placeholder:m(e,"propertyPanel.k249"),onCommit:K=>i({barHeight:K??void 0})}),m(e,"propertyTips.cd-bar-height"),h("barHeight","cd-bar-height"))),G(e,"cd-show-text",zr(e,m(e,"propertyPanel.k250"),o.hideTitle!==!0,K=>i({hideTitle:K?void 0:!0}),h("hideTitle","cd-show-text"))),G(e,"cd-font-size",he(m(e,"propertyPanel.k251"),ae({value:o.fontSize,min:5,max:24,placeholder:m(e,"propertyPanel.k252"),onCommit:K=>i({fontSize:K||void 0})}),void 0,h("fontSize","cd-font-size")))]:[G(e,"cd-ec-level",Xt(e,m(e,"propertyPanel.k253"),String(o.qrCodeLevel??"M"),[{value:"L",label:m(e,"propertyPanel.k254")},{value:"M",label:m(e,"propertyPanel.k255")},{value:"Q",label:"Q"},{value:"H",label:m(e,"propertyPanel.k256")}],K=>i({qrCodeLevel:K}),void 0,h("qrCodeLevel","cd-ec-level"))),G(e,"cd-quiet-zone",Ge(m(e,"propertyPanel.k257"),ae({value:o.qrQuietZone,min:0,max:8,placeholder:m(e,"propertyPanel.k258"),onCommit:K=>i({qrQuietZone:K})}),m(e,"propertyTips.cd-quiet-zone"),h("qrQuietZone","cd-quiet-zone")))],$t(m(e,"propertyPanel.k259")),M?g("p",{class:"pd-hint",text:m(e,"propertyPanel.k260")}):"",M?"":G(e,"cd-fit",Xt(e,m(e,"propertyPanel.k261"),String(o.fit||"contain"),Hs(e.t??oe),K=>i({fit:K||void 0}),void 0,h("fit","cd-fit"))),G(e,"cd-max-width",he(m(e,"propertyPanel.k262"),ae({value:o.maxWidth,min:1,max:200,placeholder:m(e,"propertyPanel.k263"),onCommit:K=>i({maxWidth:K||void 0})}),void 0,h("maxWidth","cd-max-width"))),G(e,"cd-max-height",he(m(e,"propertyPanel.k264"),ae({value:o.maxHeight,min:1,max:200,placeholder:m(e,"propertyPanel.k265"),onCommit:K=>i({maxHeight:K||void 0})}),void 0,h("maxHeight","cd-max-height")))].flat().filter(Boolean))]))}if(d&&(c.push(GP(e,t)),c.push(XP(e,t))),l&&c.push(KP(e,t)),n==="flowList"){const M=bt(o.flowColumns),ne=or(o.flowRowHeight),Se=Et(o.flowGapX),Pe=xr(o.flowMaxSpan,M),K=r0(o.width??0,Se,o.fontSize??12),ue=wr(o.flowLayoutMode),me=ue==="dynamic",we=Gr(o),ke=(te,Me)=>{i({[te]:typeof Me=="number"&&Number.isFinite(Me)&&Me>0?Me:0})};c.push(it(e,"flowList",m(e,"propertyPanel.k266"),"Grid3x3",[g("form",{class:"pd-form",onSubmit:te=>te.preventDefault()},[G(e,"fl-layout-mode",Xt(e,m(e,"propertyPanel.k267"),ue,[{value:"fixed",label:m(e,"propertyPanel.k268")},{value:"dynamic",label:m(e,"propertyPanel.k269")}],te=>i({flowLayoutMode:te==="dynamic"?"dynamic":"fixed"}),m(e,"propertyTips.fl-layout-mode"))),...me?[G(e,"fl-padding-top",Ge(m(e,"propertyPanel.k270"),ae({value:we.top,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingTop",te)}),m(e,"propertyTips.fl-padding-top"))),G(e,"fl-padding-right",Ge(m(e,"propertyPanel.k271"),ae({value:we.right,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingRight",te)}),m(e,"propertyTips.fl-padding-right"))),G(e,"fl-padding-bottom",Ge(m(e,"propertyPanel.k272"),ae({value:we.bottom,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingBottom",te)}),m(e,"propertyTips.fl-padding-bottom"))),G(e,"fl-padding-left",Ge(m(e,"propertyPanel.k273"),ae({value:we.left,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingLeft",te)}),m(e,"propertyTips.fl-padding-left")))]:[],G(e,"fl-columns",Ge(m(e,"propertyPanel.k274"),ae({value:M,min:1,max:12,onCommit:te=>i({flowColumns:bt(te),flowMaxSpan:xr(o.flowMaxSpan,bt(te))})}),m(e,"propertyTips.fl-columns"))),G(e,"fl-row-height",Ge(m(e,"propertyPanel.k275"),ae({value:ne,min:3,max:100,step:.5,onCommit:te=>i({flowRowHeight:or(te)})}),m(e,"propertyTips.fl-row-height"))),G(e,"fl-gap-x",Ge(m(e,"propertyPanel.k276"),ae({value:Se,min:0,max:50,step:.5,onCommit:te=>i({flowGapX:Et(te)})}),m(e,"propertyTips.fl-gap-x"))),G(e,"fl-auto-span",zr(e,m(e,"propertyPanel.k277"),o.flowAutoSpan===!0,te=>{i(te?{flowAutoSpan:te,flowMaxSpan:Pe}:{flowAutoSpan:te})})),o.flowAutoSpan===!0?G(e,"fl-max-span",Ge(m(e,"propertyPanel.k278"),ae({value:Pe,min:1,max:M,onCommit:te=>i({flowMaxSpan:xr(te,M)})}),m(e,"propertyTips.fl-max-span"))):"",M>K?g("p",{class:"pd-hint",text:m(e,"propertyPanel.k279",{v0:M,v1:K,v2:M})}):""].flat().filter(Boolean))]))}const D=()=>({borderWidth:o.borderWidth,borderStyle:o.borderStyle,borderColor:o.borderColor,borders:o.borders}),O=M=>{const ne=D();Xd(ne,M,Qd(ne)),i(ne)},A=M=>{const ne=D();is(ne,M,!Fo(ne,M)),i(ne)},R=Jd(o),_=R.style==="mixed",I=typeof R.width=="number"?R.width:void 0,S=_||R.style===void 0?"":R.style,N=typeof R.color=="string"?R.color:void 0,F=(M,ne)=>{const Se=D();j0(Se,M,ne),i(Se)},H=Yd.map(M=>({...M,label:m(e,M.labelKey)})),le=_?[{value:"",label:m(e,"propertyPanel.k280")},...H]:H;return c.push(it(e,"border-bg",m(e,"propertyPanel.k281"),"Picture",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[G(e,"bb-border-style",Xt(e,m(e,"propertyPanel.k282"),S,le,M=>F("borderStyle",M))),g("div",{class:"border-row"},[G(e,"bb-border-width",Fe(e,m(e,"propertyPanel.k283"),I,M=>F("borderWidth",M),{min:0,max:20,step:.25,placeholder:R.width==="mixed"?m(e,"propertyPanel.k284"):void 0},h("borderWidth","bb-border-width"))),G(e,"bb-border-color",he(m(e,"propertyPanel.k285"),dt(N,M=>F("borderColor",M),m(e,"propertyPanel.k286")),void 0,h("borderColor","bb-border-color")))]),...$n(n)?[g("div",{class:"pd-button-group border-presets"},QP.map(M=>g("button",{type:"button",class:"pd-button small",text:m(e,M.labelKey),disabled:M.value==="inner",onClick:()=>O(M.value)}))),g("div",{class:"pd-checkbox-group"},e3.map(M=>g("label",{class:"pd-checkbox"},[g("input",{type:"checkbox",checked:Fo(o,M.value),onChange:()=>A(M.value)}),g("span",{text:m(e,M.labelKey)})]))),g("p",{class:"pd-hint",text:m(e,N0)})]:[],G(e,"bb-bg-color",he(m(e,"propertyPanel.k287"),dt(o.backgroundColor,M=>i({backgroundColor:M}),m(e,"propertyPanel.k288")),void 0,h("backgroundColor","bb-bg-color")))])])),c.push(YP(e,t)),c.push(it(e,"advanced",m(e,"propertyPanel.k289"),"Setting",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[g("div",{class:"advanced-row"},[G(e,"ad-locked",zr(e,m(e,"propertyPanel.k290"),!!o.locked,M=>i({locked:M}),h("locked","ad-locked"))),G(e,"ad-fixed",zr(e,m(e,"propertyPanel.k291"),!!o.repeatOnEveryPage,M=>i({repeatOnEveryPage:M}),h("repeatOnEveryPage","ad-fixed"))),G(e,"ad-fixed-position",zr(e,m(e,"propertyPanel.k292"),!!o.fixed,M=>i({fixed:M}),h("fixed","ad-fixed-position")))]),G(e,"ad-z-index",Fe(e,m(e,"propertyPanel.k293"),o.zIndex,M=>i({zIndex:M}),{min:0,max:999},h("zIndex","ad-z-index"))),G(e,"ad-delete",g("div",{class:"pd-field"},[g("button",{type:"button",class:"pd-button danger",text:m(e,"propertyPanel.k294"),onClick:()=>r.deleteSelected()})]))])],!1,[g("button",{type:"button",class:"group-help",title:m(e,"propertyPanel.k295"),"aria-label":m(e,"propertyPanel.k296"),text:"?",onClick:M=>{M.stopPropagation(),e.fire("help","advanced-settings")}})])),g("div",{class:"property-content"},c)}function r3(e){const t=e.store,r=t.templateData,o=p=>t.updateTemplateData(p),n=p=>{const l=r.tiling,d=u=>u===90||u===270;if(l?.enabled&&d(p)!==d(r.outputRotation)){const u=hu({...r,outputRotation:p});o({outputRotation:p,tiling:{...l,columns:Math.max(u,1)}});return}o({outputRotation:p})},i=[];for(const[p,l]of Object.entries(Lt)){const d=m(e,`constants.paper.group.${l.group}`);let u=i.find(c=>c.group===d);u||(u={group:d,items:[]},i.push(u)),u.items.push({key:p,label:m(e,l.labelKey)})}const a=!Lt[r.paperSize],s=Gn(r.paperSize);return g("form",{class:"pd-form",onSubmit:p=>p.preventDefault()},[$t(m(e,"propertyPanel.k298")),he(m(e,"propertyPanel.k299"),g("select",{class:"pd-select",style:{width:"100%"},onChange:p=>o({paperSize:p.target.value})},[...i.map(p=>g("optgroup",{label:p.group},p.items.map(l=>g("option",{value:l.key,text:l.label,selected:r.paperSize===l.key})))),g("option",{value:"CUSTOM",text:m(e,"propertyPanel.k300"),selected:a})])),s||a?he(s?m(e,"propertyPanel.k301"):m(e,"propertyPanel.k302"),g("div",{class:"custom-size-grid"},[ae({value:Number(r.customWidth??0),min:25,max:2e3,onCommit:p=>o({customWidth:p})}),...a?[g("span",{class:"custom-size-x",text:"×"}),ae({value:Number(r.customHeight??0),min:25,max:2e3,onCommit:p=>o({customHeight:p})})]:[]])):"",s?"":he(m(e,"propertyPanel.k303"),pr("ori",[{value:"portrait",label:m(e,"propertyPanel.k304")},{value:"landscape",label:m(e,"propertyPanel.k305")}],r.orientation==="landscape"?"landscape":"portrait",p=>o({orientation:p})),m(e,"propertyPanel.k306")),s?"":he(m(e,"propertyPanel.k307"),pr("rot",[{value:"0",label:"0°"},{value:"90",label:"90°"},{value:"180",label:"180°"},{value:"270",label:"270°"}],String(r.outputRotation??0),p=>n(Number(p)),!0),r.tiling?.enabled?m(e,"propertyPanel.k308"):m(e,"propertyPanel.k309")),he(m(e,"propertyPanel.k310"),g("div",{class:"page-bg-row"},[dt(r.pageBackground,p=>o({pageBackground:p}),m(e,"propertyPanel.k311"),"page-bg-picker")]),void 0,Lr({target:r,base:{pageBackground:void 0},propKey:"pageBackground",write:()=>o({pageBackground:void 0})})),MP(e),t.pages.length>1?"":CP(e),$t(m(e,"propertyPanel.k312")),g("div",{class:"margin-grid"},[Fe(e,m(e,"propertyPanel.k313"),r.margins.top,p=>o({margins:{...r.margins,top:p}}),{min:0,max:50}),Fe(e,m(e,"propertyPanel.k314"),r.margins.bottom,p=>o({margins:{...r.margins,bottom:p}}),{min:0,max:100}),Fe(e,m(e,"propertyPanel.k315"),r.margins.left,p=>o({margins:{...r.margins,left:p}}),{min:0,max:50}),Fe(e,m(e,"propertyPanel.k316"),r.margins.right,p=>o({margins:{...r.margins,right:p}}),{min:0,max:50})]),$t(m(e,"propertyPanel.k317")),Fe(e,m(e,"propertyPanel.k318"),r.header.height??10,p=>o({header:{...r.header,height:p}}),{min:0,max:100,step:.1}),Fe(e,m(e,"propertyPanel.k319"),r.footer.height??10,p=>o({footer:{...r.footer,height:p}}),{min:0,max:100,step:.1}),JP(e)].filter(Boolean))}function o3(e,t,r){const o=(e.state.propSearch??"").trim(),n=!o||lc(o,[...r.searchKeywords,r.label]),i=document.createElement("div");if(i.className="property-content",n)try{xm(`property:${t.id}`,r.ui.renderProperty({element:t,data:e.host.designData?.length?e.host.designData:[vt],fields:e.host.fields??[],update:a=>e.store.updateElement(t.id,a),repaint:()=>e.repaint(),t:e.t??oe}),i)}catch{}return g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:custom"},style:e.state.propTab==="custom"?"":{display:"none"}},[i])}function n3(e){const t=e.store,r=e.state,o=t.selectedElement,n=o?_l(o):void 0;if(r.propCollapsed)return g("div",{class:"property-panel collapsed"},[g("div",{class:"prop-collapsed"},[g("button",{type:"button",class:"pc-btn",title:m(e,"propertyPanel.k320"),text:"«",onClick:()=>{r.propCollapsed=!1,e.repaint()}}),...n?[g("button",{type:"button",class:`pc-btn${r.propTab==="custom"?" on":""}`,title:n.label,html:je(n.icon,14)||je("Shapes",14),onClick:()=>{r.propTab="custom",r.propCollapsed=!1,e.repaint()}})]:[],...[["element",m(e,"propertyPanel.k321"),"▦"],["page",m(e,"propertyPanel.k322"),"▤"]].map(([a,s,p])=>g("button",{type:"button",class:`pc-btn${r.propTab===a?" on":""}`,title:s,text:p,onClick:()=>{r.propTab=a,r.propCollapsed=!1,e.repaint()}}))])]);const i=o?r.propTab==="custom"&&!n?"element":r.propTab:"page";return g("div",{class:"property-panel"},[g("div",{class:"prop-head"},[g("span",{class:"prop-title",text:m(e,"propertyPanel.k323")}),g("button",{type:"button",class:"collapse-btn",title:m(e,"propertyPanel.k324"),text:"»",onClick:()=>{r.propCollapsed=!0,e.repaint()}})]),g("div",{class:"pd-tabs prop-tabs"},[g("div",{class:"pd-tab-bar",role:"tablist"},[...n?[g("button",{type:"button",class:`pd-tab${i==="custom"?" active":""}`,text:n.label,onClick:()=>{r.propTab="custom",e.repaint()}})]:[],g("button",{type:"button",class:`pd-tab${i==="element"?" active":""}`,text:m(e,"propertyPanel.k325"),onClick:()=>{r.propTab="element",e.repaint()}}),g("button",{type:"button",class:`pd-tab${i==="page"?" active":""}`,text:m(e,"propertyPanel.k326"),onClick:()=>{r.propTab="page",e.repaint()}})]),n&&o?o3(e,o,n):"",g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:element"},style:i==="element"?"":{display:"none"}},o?[IP(e),t3(e,o)]:[g("p",{class:"pd-empty",text:m(e,"propertyPanel.k327")})]),g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:page"},style:i==="page"?"":{display:"none"}},[r3(e)])].filter(Boolean))])}var W=lr,i3={Check:'<path d="M20 6 9 17l-5-5" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />'};function a3(e,t=16){return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${i3[e]??""}</svg>`}function ka(e){const t=typeof e=="string"?e.trim().toLowerCase():"";return t==="label"||t==="key"||t==="both"?t:"both"}function sp(){return[{key:"field",text:W("expression.tabField")},{key:"variable",text:W("expression.tabVariable")},{key:"function",text:W("expression.tabFunction")}]}function og(){return{field:W("expression.placeholderField"),variable:W("expression.placeholderVariable"),function:W("expression.placeholderFunction")}}function s3(){return[{name:"SUM",label:W("expression.fnSum"),template:"SUM()"},{name:"AVG",label:W("expression.fnAvg"),template:"AVG()"},{name:"COUNT",label:W("expression.fnCount"),template:"COUNT()"},{name:"MIN",label:W("expression.fnMin"),template:"MIN()"},{name:"MAX",label:W("expression.fnMax"),template:"MAX()"}]}function l3(){return[{name:"ADD",label:W("expression.fnAdd"),template:"ADD()"},{name:"SUB",label:W("expression.fnSub"),template:"SUB()"},{name:"MUL",label:W("expression.fnMul"),template:"MUL()"},{name:"DIV",label:W("expression.fnDiv"),template:"DIV()"},{name:"ROUND",label:W("expression.fnRound"),template:"ROUND()"},{name:"ROUNDUP",label:W("expression.fnRoundUp"),template:"ROUNDUP()"},{name:"ROUNDDOWN",label:W("expression.fnRoundDown"),template:"ROUNDDOWN()"},{name:"ROUNDBANK",label:W("expression.fnRoundBank"),template:"ROUNDBANK()"}]}function p3(){return[{name:"MONEY",label:W("expression.fnMoney"),template:"MONEY()"},{name:"DATE",label:W("expression.fnDate"),template:"DATE()"},{name:"UPPER",label:W("expression.fnUpper"),template:"UPPER()"},{name:"IF",label:W("expression.fnIf"),template:"IF()"}]}function d3(){return[{name:"pageIndex",label:W("expression.varPageIndex"),template:"{pageIndex}"},{name:"totalPages",label:W("expression.varTotalPages"),template:"{totalPages}"},{name:"printDate",label:W("expression.varPrintDate"),template:"{printDate}"},{name:"printTime",label:W("expression.varPrintTime"),template:"{printTime}"}]}function c3(){return[{title:W("expression.groupAggregate"),items:s3()},{title:W("expression.groupMath"),items:l3()},{title:W("expression.groupFormat"),items:p3()}]}var u3="expression.previewEmpty",f3="expression.previewNoValue",lp="expression.previewError";function ng(e,t){if(!e.trim())return W(u3);try{const r={...vt,...t??{},...Qn()},o=to(e,r);return o==null?W(f3):String(o)}catch{return W(lp)}}function ig(e,t){const r=t.trim().toLowerCase();return r?e.filter(o=>o.label.toLowerCase().includes(r)||o.name.toLowerCase().includes(r)):e}function h3(e,t){const r=e.substring(0,t),o=r.lastIndexOf("{"),n=o!==-1&&!r.slice(o+1).includes("}"),i=r.lastIndexOf("("),a=i!==-1&&!r.slice(i+1).includes(")");return{insideBlock:n,insideParens:a}}var m3=e=>/[\u4e00-\u9fff]/.test(e),g3=e=>`字段「${e}」含中文,请用 {${e}} 引用(函数参数内写 ${e});中文可直接在 {} 中使用,无需 data['...'] 方括号`;function b3(e,t){const r=/^\{\s*([^{}]+?)\s*\}$/.exec(e.trim());if(!r)return null;const o=r[1]??"";return t.find(n=>n.fieldKey===o)??null}function pp(e,t,r="both"){return r==="label"?g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-label",text:e})]):r==="key"?g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-key is-primary",text:t})]):g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-label",text:e}),g("span",{class:"ee-item-key",text:t})])}function Ht(e){return e.currentTarget.getRootNode()}function ya(e,t,r){const o=[];return r.forEach((n,i)=>{o.push(n),i<r.length-1&&o.push(g("br"))}),g("div",{class:`ee-help-card ${e}`},[g("div",{class:"ee-help-card-title",text:t}),g("div",{class:"ee-help-card-content"},o)])}function k3(){return g("div",{class:"ee-help-section"},[g("div",{class:"ee-help-title",text:W("expression.k1")}),g("div",{class:"ee-help-grid"},[ya("ee-help-field",W("expression.k2"),[W("expression.k3"),W("expression.k4"),W("expression.k5"),W("expression.k6"),W("expression.k7"),W("expression.k8"),W("expression.k9")]),ya("ee-help-function",W("expression.k10"),[W("expression.k11"),W("expression.k12"),W("expression.k13"),W("expression.k14"),W("expression.k15"),W("expression.k16")]),ya("ee-help-variable",W("expression.k17"),[W("expression.k18"),W("expression.k19"),W("expression.k20")]),ya("ee-help-conditional",W("expression.k21"),[W("expression.k22"),W("expression.k23"),W("expression.k24"),W("expression.k25"),W("expression.k26")])])])}function y3(e,t){W=e.t??lr;const r=ka(e.fieldDisplay),o={activeTab:"field",searchText:"",expression:t.value||"",binding:t.binding,copiedFieldKey:"",keyHint:""},n=(v,w)=>v.querySelector(w),i=v=>{const w=n(v,".ee-preview");if(!w)return;const P=ng(o.expression,e.demoData);w.textContent=P,w.classList.toggle("ee-preview-error",P===W(lp))},a=v=>{const w=n(v,".ee-key-hint");w&&(w.textContent=o.keyHint,w.style.display=o.keyHint?"":"none")},s=()=>{if(o.activeTab==="variable")return ig(d3(),o.searchText).map(P=>g("div",{class:"ee-list-item",onDblclick:E=>{const{insideParens:D}=d(E);u(Ht(E),D?P.template.replace(/^\{|\}$/g,""):P.template,void 0,"")}},[pp(P.label,P.template)]));if(o.activeTab==="function")return c3().map(P=>g("div",{class:"ee-func-group"},[g("div",{class:"ee-func-group-title",text:P.title}),...ig(P.items,o.searchText).map(E=>g("div",{class:"ee-list-item",onDblclick:D=>{const{insideBlock:O}=d(D),A=O?E.template:`{${E.template}}`;u(Ht(D),A,A.indexOf("(")+1,"")}},[pp(E.label,`${E.name}()`)]))]));const v=Ty(Su(e.fields??[]),o.searchText);if(!v.length)return[g("p",{class:"pd-empty",text:W("expression.k27")})];const w=[];for(const P of v){P.key&&w.push(g("div",{class:`ee-field-group${P.isList?" is-list":""}`},[g("span",{class:"ee-field-group-icon",text:P.isList?"📋":"📁"}),g("span",{text:P.label})]));for(const E of P.fields)w.push(g("div",{class:"ee-list-item ee-field-item",style:{paddingLeft:P.key?"22px":"10px"},onDblclick:D=>{const{insideParens:O}=d(D),A=D;if(A.ctrlKey||A.metaKey){const R=E.fieldLabel||E.fieldKey;u(Ht(D),O?`"${R}"`:R,void 0,"");return}u(Ht(D),O?E.fieldKey:`{${E.fieldKey}}`,void 0,m3(E.fieldKey)?g3(E.fieldKey):"")}},[pp(E.fieldLabel||E.fieldKey,E.fieldKey,r),g("button",{type:"button",class:`ee-copy-btn${o.copiedFieldKey===E.fieldKey?" is-copied":""}`,"data-tip":o.copiedFieldKey===E.fieldKey?W("expression.k28"):`复制字段名「${E.fieldLabel}」`,"aria-label":`复制字段名 ${E.fieldLabel}`,html:a3(o.copiedFieldKey===E.fieldKey?"Check":"Copy",13),onClick:D=>{D.stopPropagation(),l(D,E)},onDblclick:D=>D.stopPropagation()})]))}return w},p=v=>{Array.from(v.querySelectorAll(".ee-nav-tab")).forEach((O,A)=>O.classList.toggle("active",sp()[A]?.key===o.activeTab));const P=n(v,".ee-content-search .pd-input");if(P){const O=og()[o.activeTab];P.placeholder!==O&&(P.placeholder=O),P.value!==o.searchText&&(P.value=o.searchText)}const E=n(v,".ee-textarea");E&&E.value!==o.expression&&(E.value=o.expression);const D=n(v,".ee-content-list");if(D){Oh(D);for(const O of s())rt(O,D)}i(v),a(v)};function l(v,w){const P=Ht(v);Tu(w.fieldLabel||w.fieldKey).then(E=>{E&&(o.copiedFieldKey=w.fieldKey,p(P),setTimeout(()=>{o.copiedFieldKey===w.fieldKey&&(o.copiedFieldKey="",p(P))},1200))})}const d=v=>{const P=n(Ht(v),".ee-textarea")?.selectionStart??o.expression.length;return h3(o.expression,P)},u=(v,w,P=w.length,E)=>{E!==void 0&&(o.keyHint=E);const D=n(v,".ee-textarea");if(!D){o.expression+=w,i(v),a(v);return}const O=D.selectionStart??o.expression.length,A=D.selectionEnd??O;o.expression=o.expression.substring(0,O)+w+o.expression.substring(A);const R=O+P;D.value=o.expression,D.focus(),D.selectionStart=D.selectionEnd=R,i(v),a(v)},c=()=>{const v=o.expression;if(o.binding===void 0){e.onApply({formatter:v}),e.onClose();return}const w=b3(v,e.fields??[]);e.onApply(w?{formatter:v,binding:w.fieldKey,title:w.fieldLabel}:{formatter:v}),e.onClose()},f=g("div",{class:"ee-nav"},[g("div",{class:"ee-nav-title",text:W("expression.k29")}),g("div",{class:"ee-nav-tabs"},sp().map((v,w)=>g("div",{class:`ee-nav-tab${o.activeTab===v.key?" active":""}`,text:v.text,onClick:P=>{o.activeTab=sp()[w].key,p(Ht(P))}})))]),h=g("div",{class:"ee-content"},[g("div",{class:"ee-content-search"},[g("input",{class:"pd-input",placeholder:og()[o.activeTab],onInput:v=>{o.searchText=v.target.value,p(Ht(v))}})]),g("div",{class:"ee-content-list"},s())]),b=ng(o.expression,e.demoData),k=g("div",{class:"ee-editor"},[g("div",{class:"ee-editor-section"},[g("div",{class:"ee-editor-title",text:W("expression.k30")}),g("textarea",{class:"ee-textarea",rows:6,placeholder:W("expression.k31"),text:o.expression,onInput:v=>{o.expression=v.target.value,o.keyHint="",i(Ht(v)),a(Ht(v))}}),g("div",{class:"pd-hint ee-key-hint",style:{display:"none",color:"var(--pd-accent, #165DFF)"},text:""})]),g("div",{class:"ee-editor-section"},[g("div",{class:"ee-editor-title",text:W("expression.k32")}),g("div",{class:`ee-preview${b===W(lp)?" ee-preview-error":""}`,text:b})]),k3()]);return g("div",{class:"pd-dialog-overlay",onKeydown:v=>{v.key==="Escape"&&e.onClose()}},[g("section",{class:"pd-dialog pd-dialog-large",role:"dialog","aria-modal":"true","aria-labelledby":"expression-editor-title"},[g("header",{class:"pd-dialog-header"},[g("strong",{id:"expression-editor-title",text:W("expression.k33")}),g("button",{type:"button",class:"pd-close","aria-label":W("expression.k34"),text:"×",onClick:()=>e.onClose()})]),g("div",{class:"expression-editor"},[f,h,k]),g("footer",{class:"pd-dialog-footer"},[g("button",{type:"button",class:"pd-button",text:W("expression.k35"),onClick:()=>e.onClose()}),g("button",{type:"button",class:"pd-button primary",text:W("expression.k36"),onClick:()=>c()})])])])}const v3={id:"getting-started",title:"快速入门",content:`
297
297
  <h2>界面布局</h2>
298
298
  <p>打印模板设计器采用三栏布局:</p>
299
299
  <ul>
@@ -757,6 +757,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
757
757
  <p><strong>提示</strong>:水印配置保存在模板 JSON 的 <code>watermark</code> 字段中,仅对当前模板生效。</p>
758
758
  </blockquote>
759
759
  `},S3={id:"changelog",title:"更新记录",content:`
760
+ <h2>V1.6.3<small>(2026-11-24)</small></h2>
761
+
762
+ <h3>修复</h3>
763
+ <ul>
764
+ <li><strong>数据绑定串用</strong>:表格 demo 数据源缺失时不再回退到第一个数组;图表显式绑定数据源缺失时保持占位,字段下拉不再混入示例字段,避免条码与图表显示未绑定数据。</li>
765
+ </ul>
766
+
760
767
  <h2>V1.6.2<small>(2026-11-23)</small></h2>
761
768
 
762
769
  <h3>修复</h3>
@@ -1552,6 +1559,13 @@ to keep a number of decimals use <code>ROUND</code> (half up), <code>ROUNDUP</co
1552
1559
  <h2>Can I use charts and other custom elements?</h2>
1553
1560
  <p>Yes. Optional plugins such as the ECharts chart pack register extra element types. Once installed, they appear in the asset panel and provide a "Custom Properties" tab when selected.</p>
1554
1561
  `},A3={id:"changelog",title:"Release Notes",content:`
1562
+ <h2>V1.6.3<small>(2026-11-24)</small></h2>
1563
+
1564
+ <h3>Fixed</h3>
1565
+ <ul>
1566
+ <li><strong>Data-binding fallbacks</strong>: table demo data sources no longer fall back to the first array when missing; charts keep the placeholder when an explicitly bound data source is absent, and field pickers no longer mix in sample-data fields.</li>
1567
+ </ul>
1568
+
1555
1569
  <h2>V1.6.2<small>(2026-11-23)</small></h2>
1556
1570
 
1557
1571
  <h3>Fixed</h3>
@@ -2064,6 +2078,13 @@ to keep a number of decimals use <code>ROUND</code> (half up), <code>ROUNDUP</co
2064
2078
  <h2>ฉันสามารถใช้แผนภูมิและองค์ประกอบกำหนดเองอื่นได้หรือไม่?</h2>
2065
2079
  <p>ได้ ปลั๊กอินเสริมเช่นชุดแผนภูมิ ECharts จะลงทะเบียนประเภทองค์ประกอบเพิ่มเติม เมื่อติดตั้งแล้วจะปรากฏในแผงทรัพยากรและมีแท็บ "คุณสมบัติที่กำหนดเอง" เมื่อเลือก</p>
2066
2080
  `},N3={id:"changelog",title:"บันทึกการเปิดตัว",content:`
2081
+ <h2>V1.6.3<small>(2026-11-24)</small></h2>
2082
+
2083
+ <h3>แก้ไข</h3>
2084
+ <ul>
2085
+ <li><strong>การผูกข้อมูล</strong>: ตารางเดโมไม่กลับไปใช้อาร์เรย์ตัวแรกเมื่อไม่พบแหล่งข้อมูลที่ระบุ แผนภูมิคงตัวยึดตำแหน่งเมื่อแหล่งข้อมูลที่ผูกไว้ขาดหาย และรายการฟิลด์ไม่ผสมฟิลด์จากข้อมูลตัวอย่างอีกต่อไป</li>
2086
+ </ul>
2087
+
2067
2088
  <h2>V1.6.2<small>(2026-11-23)</small></h2>
2068
2089
 
2069
2090
  <h3>แก้ไข</h3>