kui-vue 5.2.3 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/dist/index.js +2 -2
  2. package/es/index.js +3386 -358
  3. package/es/locale/de.js +7 -1
  4. package/es/locale/el.js +7 -1
  5. package/es/locale/en.js +7 -1
  6. package/es/locale/fr.js +7 -1
  7. package/es/locale/it.js +7 -1
  8. package/es/locale/ja.js +7 -1
  9. package/es/locale/ko.js +7 -1
  10. package/es/locale/ru.js +7 -1
  11. package/es/locale/th.js +7 -1
  12. package/es/locale/uk.js +7 -1
  13. package/es/locale/vi.js +7 -1
  14. package/es/locale/zh-CN.js +7 -1
  15. package/es/locale/zh-TW.js +7 -1
  16. package/lib/index.js +2 -2
  17. package/lib/locale/de.js +2 -2
  18. package/lib/locale/el.js +2 -2
  19. package/lib/locale/en.js +2 -2
  20. package/lib/locale/fr.js +2 -2
  21. package/lib/locale/it.js +2 -2
  22. package/lib/locale/ja.js +2 -2
  23. package/lib/locale/ko.js +2 -2
  24. package/lib/locale/ru.js +2 -2
  25. package/lib/locale/th.js +2 -2
  26. package/lib/locale/uk.js +2 -2
  27. package/lib/locale/vi.js +2 -2
  28. package/lib/locale/zh-CN.js +2 -2
  29. package/lib/locale/zh-TW.js +2 -2
  30. package/package.json +17 -15
  31. package/style/index.css +2 -2
  32. package/types/avatar/avatar-group.d.ts +1 -1
  33. package/types/color-picker/index.d.ts +1 -1
  34. package/types/components.d.ts +6 -2
  35. package/types/date-picker/index.d.ts +1 -1
  36. package/types/descriptions/descriptions-item.d.ts +1 -1
  37. package/types/descriptions/{Descriptions.d.ts → descriptions.d.ts} +1 -1
  38. package/types/divider/index.d.ts +1 -1
  39. package/types/drawer/index.d.ts +1 -1
  40. package/types/dropdown/dropdown-button.d.ts +1 -1
  41. package/types/dropdown/{Dropdown.d.ts → dropdown.d.ts} +1 -1
  42. package/types/empty/index.d.ts +1 -1
  43. package/types/flex/index.d.ts +1 -1
  44. package/types/global.d.ts +8 -4
  45. package/types/input/input-box.d.ts +1 -1
  46. package/types/input/input-group.d.ts +1 -1
  47. package/types/input/{Input.d.ts → input.d.ts} +3 -1
  48. package/types/input/{TextArea.d.ts → textarea.d.ts} +2 -1
  49. package/types/input-number/index.d.ts +1 -1
  50. package/types/layout/index.d.ts +2 -2
  51. package/types/loading/index.d.ts +1 -1
  52. package/types/locale/de.d.ts +6 -0
  53. package/types/locale/el.d.ts +6 -0
  54. package/types/locale/en.d.ts +6 -0
  55. package/types/locale/fr.d.ts +6 -0
  56. package/types/locale/it.d.ts +6 -0
  57. package/types/locale/ja.d.ts +6 -0
  58. package/types/locale/ko.d.ts +6 -0
  59. package/types/locale/ru.d.ts +6 -0
  60. package/types/locale/th.d.ts +6 -0
  61. package/types/locale/uk.d.ts +6 -0
  62. package/types/locale/vi.d.ts +6 -0
  63. package/types/locale/zh-CN.d.ts +6 -0
  64. package/types/locale/zh-TW.d.ts +6 -0
  65. package/types/menu/menu-group.d.ts +1 -1
  66. package/types/menu/menu-item.d.ts +1 -1
  67. package/types/menu/{Menu.d.ts → menu.d.ts} +1 -1
  68. package/types/menu/sub-menu.d.ts +1 -1
  69. package/types/message/index.d.ts +2 -0
  70. package/types/modal/{Modal.d.ts → modal.d.ts} +1 -1
  71. package/types/notice/content.d.ts +3 -0
  72. package/types/page/index.d.ts +1 -1
  73. package/types/popconfirm/index.d.ts +1 -1
  74. package/types/poptip/index.d.ts +1 -1
  75. package/types/progress/index.d.ts +1 -1
  76. package/types/qrcode/index.d.ts +165 -0
  77. package/types/radio/radio-button.d.ts +1 -1
  78. package/types/radio/radio-group.d.ts +1 -1
  79. package/types/radio/{Radio.d.ts → radio.d.ts} +1 -1
  80. package/types/rate/index.d.ts +1 -1
  81. package/types/rate/star.d.ts +1 -1
  82. package/types/row-col/{Col.d.ts → col.d.ts} +1 -1
  83. package/types/row-col/{Row.d.ts → row.d.ts} +1 -1
  84. package/types/select/{Option.d.ts → option.d.ts} +1 -1
  85. package/types/select/{Select.d.ts → select.d.ts} +1 -1
  86. package/types/slider/index.d.ts +1 -1
  87. package/types/space/index.d.ts +1 -1
  88. package/types/spin/index.d.ts +1 -1
  89. package/types/stat-card/stat-card.d.ts +1 -1
  90. package/types/stat-card/stat-number.d.ts +1 -1
  91. package/types/switch/index.d.ts +1 -1
  92. package/types/table/index.d.ts +1 -1
  93. package/types/tabs/tab-panel.d.ts +1 -1
  94. package/types/tabs/{Tabs.d.ts → tabs.d.ts} +1 -1
  95. package/types/tag/index.d.ts +1 -1
  96. package/types/time-line/timeline-item.d.ts +1 -1
  97. package/types/time-line/timeline.d.ts +1 -1
  98. package/types/tooltip/index.d.ts +1 -1
  99. package/types/tree/index.d.ts +1 -1
  100. package/types/tree-select/index.d.ts +1 -1
  101. package/types/upload/file-list.d.ts +1 -1
  102. package/types/upload/index.d.ts +1 -1
  103. package/types/upload/selector.d.ts +1 -1
  104. package/types/watermark/index.d.ts +197 -0
  105. package/vetur/attributes.json +149 -37
  106. package/vetur/tags.json +52 -18
  107. package/vetur/web-types.json +282 -68
  108. package/types/affix/Affix.d.ts +0 -15
  109. package/types/alert/Alert.d.ts +0 -19
  110. package/types/anchor/AnchorLink.d.ts +0 -12
  111. package/types/avatar/AvatarGroup.d.ts +0 -13
  112. package/types/backtop/BackTop.d.ts +0 -16
  113. package/types/badge/Badge.d.ts +0 -18
  114. package/types/breadcrumb/BreadcrumbItem.d.ts +0 -12
  115. package/types/button/ButtonGroup.d.ts +0 -12
  116. package/types/card/Card.d.ts +0 -14
  117. package/types/carousel/CarouselItem.d.ts +0 -9
  118. package/types/checkbox/CheckboxGroup.d.ts +0 -19
  119. package/types/collapse/CollapsePanel.d.ts +0 -12
  120. package/types/color-picker/ColorPicker.d.ts +0 -28
  121. package/types/date-picker/DatePicker.d.ts +0 -46
  122. package/types/descriptions/DescriptionsItem.d.ts +0 -16
  123. package/types/divider/Divider.d.ts +0 -16
  124. package/types/drawer/Drawer.d.ts +0 -35
  125. package/types/dropdown/DropdownButton.d.ts +0 -19
  126. package/types/empty/Empty.d.ts +0 -13
  127. package/types/flex/Flex.d.ts +0 -15
  128. package/types/form/FormItem.d.ts +0 -15
  129. package/types/grid/GridItem.d.ts +0 -18
  130. package/types/icon/Icon.d.ts +0 -15
  131. package/types/image/ImageGroup.d.ts +0 -11
  132. package/types/image/KImage.d.ts +0 -20
  133. package/types/input/InputGroup.d.ts +0 -16
  134. package/types/input-number/InputNumber.d.ts +0 -32
  135. package/types/layout/sider.d.ts +0 -11
  136. package/types/loading/loading.d.ts +0 -9
  137. package/types/menu/MenuDivider.d.ts +0 -9
  138. package/types/menu/MenuGroup.d.ts +0 -11
  139. package/types/menu/MenuItem.d.ts +0 -15
  140. package/types/menu/SubMenu.d.ts +0 -14
  141. package/types/page/Page.d.ts +0 -27
  142. package/types/popconfirm/Popconfirm.d.ts +0 -19
  143. package/types/poptip/Poptip.d.ts +0 -19
  144. package/types/progress/Progress.d.ts +0 -31
  145. package/types/radio/RadioButton.d.ts +0 -19
  146. package/types/radio/RadioGroup.d.ts +0 -20
  147. package/types/rate/Rate.d.ts +0 -24
  148. package/types/skeleton/SkeletonAvatar.d.ts +0 -17
  149. package/types/skeleton/SkeletonButton.d.ts +0 -18
  150. package/types/skeleton/SkeletonImage.d.ts +0 -16
  151. package/types/skeleton/SkeletonText.d.ts +0 -16
  152. package/types/slider/Slider.d.ts +0 -29
  153. package/types/space/Space.d.ts +0 -17
  154. package/types/spin/Spin.d.ts +0 -18
  155. package/types/stat-card/StatCard.d.ts +0 -20
  156. package/types/stat-card/StatNumber.d.ts +0 -20
  157. package/types/switch/Switch.d.ts +0 -19
  158. package/types/table/Table.d.ts +0 -29
  159. package/types/tabs/TabPanel.d.ts +0 -15
  160. package/types/tag/Tag.d.ts +0 -18
  161. package/types/timeline/TimeLine.d.ts +0 -12
  162. package/types/timeline/TimeLineItem.d.ts +0 -14
  163. package/types/tooltip/Tooltip.d.ts +0 -20
  164. package/types/tree/Tree.d.ts +0 -28
  165. package/types/tree-select/TreeSelect.d.ts +0 -46
  166. package/types/upload/Upload.d.ts +0 -37
  167. /package/types/anchor/{Anchor.d.ts → anchor.d.ts} +0 -0
  168. /package/types/avatar/{Avatar.d.ts → avatar.d.ts} +0 -0
  169. /package/types/breadcrumb/{Breadcrumb.d.ts → breadcrumb.d.ts} +0 -0
  170. /package/types/button/{Button.d.ts → button.d.ts} +0 -0
  171. /package/types/carousel/{Carousel.d.ts → carousel.d.ts} +0 -0
  172. /package/types/checkbox/{Checkbox.d.ts → checkbox.d.ts} +0 -0
  173. /package/types/collapse/{Collapse.d.ts → collapse.d.ts} +0 -0
  174. /package/types/form/{Form.d.ts → form.d.ts} +0 -0
  175. /package/types/grid/{Grid.d.ts → grid.d.ts} +0 -0
  176. /package/types/skeleton/{Skeleton.d.ts → skeleton.d.ts} +0 -0
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * kui-vue v5.2.3
2
+ * kui-vue v5.3.1
3
3
  * Copyright 2017-present, kui-vue.
4
4
  * All rights reserved.
5
5
  * Homepage: https://k-ui.cn
@@ -663,8 +663,10 @@ var Avatar = /* @__PURE__ */ defineComponent({
663
663
  if (innerRef.value && rootRef.value) {
664
664
  const max = rootRef.value.offsetWidth - 8;
665
665
  const innerWidth = innerRef.value.offsetWidth || innerRef.value.scrollWidth;
666
- if (innerWidth > 0 && innerWidth > max) textStyles.value = { transform: `scale(${Math.min(max / innerWidth, 1)}) translateX(-50%)` };
667
- else textStyles.value = { transform: "scale(1) translateX(-50%)" };
666
+ if (innerWidth > 0 && innerWidth > max) {
667
+ const scale = Math.min(max / innerWidth, 1);
668
+ textStyles.value = { transform: `scale(${scale}) translateX(-50%)` };
669
+ } else textStyles.value = { transform: "scale(1) translateX(-50%)" };
668
670
  }
669
671
  };
670
672
  onMounted(() => {
@@ -771,6 +773,8 @@ var toggleContainerScroll = (target, lock) => {
771
773
  }
772
774
  }
773
775
  };
776
+ //#endregion
777
+ //#region components/avatar/avatar-group.tsx
774
778
  var AvatarGroup = /* @__PURE__ */ defineComponent({
775
779
  name: "AvatarGroup",
776
780
  props: {
@@ -876,7 +880,8 @@ var BackTop = /* @__PURE__ */ defineComponent({
876
880
  setup(props, { emit, slots }) {
877
881
  const visible = ref(false);
878
882
  const onScroll = () => {
879
- visible.value = (document.body.scrollTop || document.documentElement.scrollTop || window.scrollY) >= props.height;
883
+ const scrollTop = document.body.scrollTop || document.documentElement.scrollTop || window.scrollY;
884
+ visible.value = scrollTop >= props.height;
880
885
  };
881
886
  const handleClick = (e) => {
882
887
  emit("click", e);
@@ -1181,7 +1186,8 @@ var Carousel = /* @__PURE__ */ defineComponent({
1181
1186
  return result;
1182
1187
  };
1183
1188
  const children = computed(() => {
1184
- return flatten(slots.default?.() || []);
1189
+ const raw = slots.default?.() || [];
1190
+ return flatten(raw);
1185
1191
  });
1186
1192
  watch(() => props.modelValue, (val) => {
1187
1193
  currentIndex.value = val;
@@ -3885,6 +3891,10 @@ function setPlacement({ refSelection, refPopper, currentPlacement, position = nu
3885
3891
  calcLeft = rect.left + (rect.width - pickerW) / 2;
3886
3892
  originX = "center";
3887
3893
  }
3894
+ if (calcLeft < 0) calcLeft = 0;
3895
+ else if (calcLeft + pickerW > clientWidth) calcLeft = clientWidth - pickerW;
3896
+ if (calcTop < 0) calcTop = 0;
3897
+ else if (calcTop + pickerH > clientHeight) calcTop = clientHeight - pickerH;
3888
3898
  top.value = calcTop + scrollTop;
3889
3899
  left.value = calcLeft + scrollLeft;
3890
3900
  transOrigin.value = `${originX} ${originY}`;
@@ -3923,7 +3933,8 @@ var alpha_default = /* @__PURE__ */ defineComponent({
3923
3933
  ctx.fillRect(0, 0, width, height);
3924
3934
  };
3925
3935
  const updatePos = () => {
3926
- dotPos.value = Color(props.modelValue).alpha() * 190 - 7;
3936
+ const a = Color(props.modelValue).alpha();
3937
+ dotPos.value = a * 190 - 7;
3927
3938
  };
3928
3939
  const handleMove = (e) => {
3929
3940
  const canvas = refPaint.value;
@@ -4036,7 +4047,21 @@ var hue_default = /* @__PURE__ */ defineComponent({
4036
4047
  //#endregion
4037
4048
  //#region node_modules/.pnpm/big.js@7.0.1/node_modules/big.js/big.mjs
4038
4049
  /************************************** EDITABLE DEFAULTS *****************************************/
4039
- var DP = 20, RM = 1, MAX_DP = 1e6, MAX_POWER = 1e6, NE = -7, PE = 21, STRICT = false, NAME = "[big.js] ", INVALID = NAME + "Invalid ", INVALID_DP = INVALID + "decimal places", INVALID_RM = INVALID + "rounding mode", DIV_BY_ZERO = NAME + "Division by zero", P = {}, UNDEFINED = void 0, NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
4050
+ var DP = 20;
4051
+ var RM = 1;
4052
+ var MAX_DP = 1e6;
4053
+ var MAX_POWER = 1e6;
4054
+ var NE = -7;
4055
+ var PE = 21;
4056
+ var STRICT = false;
4057
+ var NAME = "[big.js] ";
4058
+ var INVALID = NAME + "Invalid ";
4059
+ var INVALID_DP = INVALID + "decimal places";
4060
+ var INVALID_RM = INVALID + "rounding mode";
4061
+ var DIV_BY_ZERO = NAME + "Division by zero";
4062
+ var P = {};
4063
+ var UNDEFINED = void 0;
4064
+ var NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
4040
4065
  function _Big_() {
4041
4066
  function Big(n) {
4042
4067
  var x = this;
@@ -4325,7 +4350,7 @@ P.plus = P.add = function(y) {
4325
4350
  };
4326
4351
  P.pow = function(n) {
4327
4352
  var x = this, one = new x.constructor("1"), y = one, isneg = n < 0;
4328
- if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) throw Error(INVALID + "exponent");
4353
+ if (n !== ~~n || n < -1e6 || n > MAX_POWER) throw Error(INVALID + "exponent");
4329
4354
  if (isneg) n = -n;
4330
4355
  for (;;) {
4331
4356
  if (n & 1) y = y.times(x);
@@ -4341,7 +4366,7 @@ P.prec = function(sd, rm) {
4341
4366
  };
4342
4367
  P.round = function(dp, rm) {
4343
4368
  if (dp === UNDEFINED) dp = 0;
4344
- else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) throw Error(INVALID_DP);
4369
+ else if (dp !== ~~dp || dp < -1e6 || dp > MAX_DP) throw Error(INVALID_DP);
4345
4370
  return round(new this.constructor(this), dp + this.e + 1, rm);
4346
4371
  };
4347
4372
  P.sqrt = function() {
@@ -4554,6 +4579,8 @@ var input_box_default = /* @__PURE__ */ defineComponent({
4554
4579
  };
4555
4580
  }
4556
4581
  });
4582
+ //#endregion
4583
+ //#region components/input/input-group.tsx
4557
4584
  var InputGroup = /* @__PURE__ */ defineComponent({
4558
4585
  name: "InputGroup",
4559
4586
  props: {
@@ -4621,6 +4648,12 @@ var Input = /* @__PURE__ */ defineComponent({
4621
4648
  default: true
4622
4649
  },
4623
4650
  size: { type: String },
4651
+ value: { type: [
4652
+ String,
4653
+ Number,
4654
+ Array,
4655
+ Object
4656
+ ] },
4624
4657
  modelValue: { type: [
4625
4658
  String,
4626
4659
  Number,
@@ -4653,13 +4686,12 @@ var Input = /* @__PURE__ */ defineComponent({
4653
4686
  default: "input"
4654
4687
  },
4655
4688
  onSearch: { type: Function },
4656
- maxlength: Number,
4657
4689
  onIconClick: { type: Function },
4658
4690
  onClear: { type: Function },
4659
4691
  onChange: { type: Function }
4660
4692
  },
4661
4693
  setup(props, { slots, emit, attrs, expose }) {
4662
- const currentValue = ref(props.modelValue);
4694
+ const currentValue = ref(props.modelValue ?? props.value);
4663
4695
  const focused = ref(false);
4664
4696
  const showPassword = ref(false);
4665
4697
  const inputRef = ref();
@@ -4797,9 +4829,17 @@ var Input = /* @__PURE__ */ defineComponent({
4797
4829
  };
4798
4830
  }
4799
4831
  });
4832
+ //#endregion
4833
+ //#region components/input/textarea.tsx
4800
4834
  var TextArea = /* @__PURE__ */ defineComponent({
4801
4835
  name: "TextArea",
4802
4836
  props: {
4837
+ value: [
4838
+ String,
4839
+ Number,
4840
+ Object,
4841
+ Array
4842
+ ],
4803
4843
  modelValue: [
4804
4844
  String,
4805
4845
  Number,
@@ -4821,7 +4861,7 @@ var TextArea = /* @__PURE__ */ defineComponent({
4821
4861
  onChange: { type: Function }
4822
4862
  },
4823
4863
  setup(props, { attrs, emit }) {
4824
- const currentValue = ref(props.modelValue);
4864
+ const currentValue = ref(props.modelValue ?? props.value);
4825
4865
  watch(() => props.modelValue, (v) => {
4826
4866
  currentValue.value = v;
4827
4867
  });
@@ -4850,6 +4890,8 @@ var TextArea = /* @__PURE__ */ defineComponent({
4850
4890
  };
4851
4891
  }
4852
4892
  });
4893
+ //#endregion
4894
+ //#region components/input-number/index.tsx
4853
4895
  var InputNumber = /* @__PURE__ */ defineComponent({
4854
4896
  inheritAttrs: false,
4855
4897
  name: "InputNumber",
@@ -4921,7 +4963,8 @@ var InputNumber = /* @__PURE__ */ defineComponent({
4921
4963
  const clampedStr = clamp(String(parsed));
4922
4964
  innerValue.value = clampedStr;
4923
4965
  userInput.value = null;
4924
- emitValue(clampedStr === "" ? void 0 : Number(clampedStr));
4966
+ const output = clampedStr === "" ? void 0 : Number(clampedStr);
4967
+ emitValue(output);
4925
4968
  };
4926
4969
  const handleInput = (val) => {
4927
4970
  userInput.value = val;
@@ -4948,7 +4991,8 @@ var InputNumber = /* @__PURE__ */ defineComponent({
4948
4991
  const stepAction = (type) => {
4949
4992
  if (props.disabled || props.readonly) return;
4950
4993
  const current = isValidBig(innerValue.value) ? innerValue.value : 0;
4951
- triggerUpdate((type === "up" ? new Big(current).plus(props.step) : new Big(current).minus(props.step)).toFixed());
4994
+ const next = type === "up" ? new Big(current).plus(props.step) : new Big(current).minus(props.step);
4995
+ triggerUpdate(next.toFixed());
4952
4996
  };
4953
4997
  return () => {
4954
4998
  const inputProps = {
@@ -4993,6 +5037,8 @@ var InputNumber = /* @__PURE__ */ defineComponent({
4993
5037
  };
4994
5038
  }
4995
5039
  });
5040
+ //#endregion
5041
+ //#region components/select/option.tsx
4996
5042
  var Option = /* @__PURE__ */ defineComponent({
4997
5043
  name: "Option",
4998
5044
  props: {
@@ -5035,6 +5081,8 @@ var Option = /* @__PURE__ */ defineComponent({
5035
5081
  };
5036
5082
  }
5037
5083
  });
5084
+ //#endregion
5085
+ //#region components/empty/index.tsx
5038
5086
  var Empty = /* @__PURE__ */ defineComponent({
5039
5087
  name: "Empty",
5040
5088
  props: {
@@ -5073,6 +5121,8 @@ var Empty = /* @__PURE__ */ defineComponent({
5073
5121
  };
5074
5122
  }
5075
5123
  });
5124
+ //#endregion
5125
+ //#region components/select/select.tsx
5076
5126
  var Select = /* @__PURE__ */ defineComponent({
5077
5127
  name: "Select",
5078
5128
  directives: {
@@ -5310,12 +5360,16 @@ var Select = /* @__PURE__ */ defineComponent({
5310
5360
  nextTick(() => {
5311
5361
  visible.value = true;
5312
5362
  emit("openChange", true);
5313
- updatePosition();
5363
+ nextTick(() => {
5364
+ updatePosition();
5365
+ });
5314
5366
  });
5315
5367
  } else {
5316
5368
  visible.value = true;
5317
5369
  emit("openChange", true);
5318
- updatePosition();
5370
+ nextTick(() => {
5371
+ updatePosition();
5372
+ });
5319
5373
  }
5320
5374
  emit("search", e);
5321
5375
  }, 500);
@@ -5844,6 +5898,8 @@ var presets_default = /* @__PURE__ */ defineComponent({
5844
5898
  };
5845
5899
  }
5846
5900
  });
5901
+ //#endregion
5902
+ //#region components/color-picker/index.tsx
5847
5903
  var ColorPicker = /* @__PURE__ */ defineComponent({
5848
5904
  name: "ColorPicker",
5849
5905
  directives: {
@@ -5929,11 +5985,15 @@ var ColorPicker = /* @__PURE__ */ defineComponent({
5929
5985
  document.addEventListener("click", outsideClick);
5930
5986
  nextTick(() => {
5931
5987
  openChange(true);
5932
- updatePopPosition();
5988
+ nextTick(() => {
5989
+ updatePopPosition();
5990
+ });
5933
5991
  });
5934
5992
  } else {
5935
5993
  openChange(true);
5936
- updatePopPosition();
5994
+ nextTick(() => {
5995
+ updatePopPosition();
5996
+ });
5937
5997
  }
5938
5998
  else openChange(false);
5939
5999
  };
@@ -5956,20 +6016,23 @@ var ColorPicker = /* @__PURE__ */ defineComponent({
5956
6016
  emit("change", value);
5957
6017
  };
5958
6018
  const onUpdateRGB = ({ r, g, b }) => {
5959
- onUpdate(Color({
6019
+ const color = Color({
5960
6020
  r,
5961
6021
  g,
5962
6022
  b,
5963
6023
  alpha: currentAlpha.value
5964
- }).rgb());
6024
+ });
6025
+ onUpdate(color.rgb());
5965
6026
  };
5966
6027
  const onUpdateHue = (hue) => {
5967
6028
  currentHue.value = hue;
5968
- onUpdate(Color(currentColor.value).hue(hue).rgb());
6029
+ const value = Color(currentColor.value).hue(hue).rgb();
6030
+ onUpdate(value);
5969
6031
  };
5970
6032
  const onUpdateAlpha = (a) => {
5971
6033
  currentAlpha.value = a;
5972
- onUpdate(Color(currentColor.value).alpha(a).rgb());
6034
+ const value = Color(currentColor.value).alpha(a).rgb();
6035
+ onUpdate(value);
5973
6036
  };
5974
6037
  const onUpdateMode = (mode) => {
5975
6038
  currentMode.value = mode;
@@ -6669,11 +6732,15 @@ var DatePicker = /* @__PURE__ */ defineComponent({
6669
6732
  document.addEventListener("click", handleClickOutside);
6670
6733
  nextTick(() => {
6671
6734
  updatePanelState();
6672
- updatePosition();
6735
+ nextTick(() => {
6736
+ updatePosition();
6737
+ });
6673
6738
  });
6674
6739
  } else {
6675
6740
  updatePanelState();
6676
- updatePosition();
6741
+ nextTick(() => {
6742
+ updatePosition();
6743
+ });
6677
6744
  }
6678
6745
  };
6679
6746
  const handleClickOutside = (e) => {
@@ -6915,7 +6982,8 @@ var DatePicker = /* @__PURE__ */ defineComponent({
6915
6982
  "class": "k-picker-time-col",
6916
6983
  "ref": (el) => timeColRefs.value[type] = el
6917
6984
  }, [Array.from({ length: max }).map((_, i) => {
6918
- const isDisabled = checkTimeDisabled(activeDate.set(type, i));
6985
+ const tempDate = activeDate.set(type, i);
6986
+ const isDisabled = checkTimeDisabled(tempDate);
6919
6987
  return createVNode("li", {
6920
6988
  "key": i,
6921
6989
  "class": [
@@ -7136,6 +7204,8 @@ var DatePicker = /* @__PURE__ */ defineComponent({
7136
7204
  };
7137
7205
  }
7138
7206
  });
7207
+ //#endregion
7208
+ //#region components/descriptions/descriptions-item.tsx
7139
7209
  var DescriptionsItem = /* @__PURE__ */ defineComponent({
7140
7210
  name: "DescriptionsItem",
7141
7211
  props: {
@@ -7290,6 +7360,8 @@ var Descriptions = /* @__PURE__ */ defineComponent({
7290
7360
  };
7291
7361
  }
7292
7362
  });
7363
+ //#endregion
7364
+ //#region components/drawer/index.tsx
7293
7365
  var Drawer = /* @__PURE__ */ defineComponent({
7294
7366
  name: "Drawer",
7295
7367
  directives: { transfer },
@@ -7449,6 +7521,8 @@ var Drawer = /* @__PURE__ */ defineComponent({
7449
7521
  };
7450
7522
  }
7451
7523
  });
7524
+ //#endregion
7525
+ //#region components/dropdown/dropdown.tsx
7452
7526
  var Dropdown = /* @__PURE__ */ defineComponent({
7453
7527
  name: "Dropdown",
7454
7528
  directives: {
@@ -7533,12 +7607,16 @@ var Dropdown = /* @__PURE__ */ defineComponent({
7533
7607
  nextTick(() => {
7534
7608
  openChange(true);
7535
7609
  emit("update:show", true);
7536
- updatePosition(e);
7610
+ nextTick(() => {
7611
+ updatePosition(e);
7612
+ });
7537
7613
  });
7538
7614
  } else {
7539
7615
  emit("update:show", true);
7540
- updatePosition(e);
7541
7616
  openChange(true);
7617
+ nextTick(() => {
7618
+ updatePosition(e);
7619
+ });
7542
7620
  }
7543
7621
  else {
7544
7622
  openChange(false);
@@ -7649,6 +7727,8 @@ var trigger_default = /* @__PURE__ */ defineComponent({
7649
7727
  };
7650
7728
  }
7651
7729
  });
7730
+ //#endregion
7731
+ //#region components/dropdown/dropdown-button.tsx
7652
7732
  var DropdownButton = /* @__PURE__ */ defineComponent({
7653
7733
  name: "DropdownButton",
7654
7734
  props: {
@@ -7693,6 +7773,8 @@ var DropdownButton = /* @__PURE__ */ defineComponent({
7693
7773
  };
7694
7774
  }
7695
7775
  });
7776
+ //#endregion
7777
+ //#region components/divider/index.tsx
7696
7778
  var Divider = /* @__PURE__ */ defineComponent({
7697
7779
  name: "Divider",
7698
7780
  props: {
@@ -7847,13 +7929,14 @@ var Form = /* @__PURE__ */ defineComponent({
7847
7929
  provide("Form", form);
7848
7930
  return () => {
7849
7931
  const { layout, size, name } = props;
7932
+ const classes = ["k-form", {
7933
+ [`k-form-${layout}`]: layout,
7934
+ "k-form-lg": size === "large",
7935
+ "k-form-sm": size === "small"
7936
+ }];
7850
7937
  return createVNode("form", {
7851
7938
  "ref": formRef,
7852
- "class": ["k-form", {
7853
- [`k-form-${layout}`]: layout,
7854
- "k-form-lg": size === "large",
7855
- "k-form-sm": size === "small"
7856
- }],
7939
+ "class": classes,
7857
7940
  "id": name,
7858
7941
  "onSubmit": onSubmit,
7859
7942
  "onReset": reset,
@@ -7862,6 +7945,8 @@ var Form = /* @__PURE__ */ defineComponent({
7862
7945
  };
7863
7946
  }
7864
7947
  });
7948
+ //#endregion
7949
+ //#region components/row-col/col.tsx
7865
7950
  var Col = /* @__PURE__ */ defineComponent({
7866
7951
  name: "Col",
7867
7952
  props: {
@@ -7906,6 +7991,8 @@ var Col = /* @__PURE__ */ defineComponent({
7906
7991
  };
7907
7992
  }
7908
7993
  });
7994
+ //#endregion
7995
+ //#region components/row-col/row.tsx
7909
7996
  var Row = /* @__PURE__ */ defineComponent({
7910
7997
  name: "Row",
7911
7998
  props: {
@@ -8106,6 +8193,8 @@ var FormItem = /* @__PURE__ */ defineComponent({
8106
8193
  };
8107
8194
  }
8108
8195
  });
8196
+ //#endregion
8197
+ //#region components/flex/index.tsx
8109
8198
  var Flex = /* @__PURE__ */ defineComponent({
8110
8199
  name: "Flex",
8111
8200
  props: {
@@ -8358,6 +8447,8 @@ var getMousePoint = () => {
8358
8447
  y: 0
8359
8448
  };
8360
8449
  };
8450
+ //#endregion
8451
+ //#region components/tooltip/index.tsx
8361
8452
  var Tooltip = /* @__PURE__ */ defineComponent({
8362
8453
  name: "Tooltip",
8363
8454
  directives: { transfer },
@@ -8425,12 +8516,16 @@ var Tooltip = /* @__PURE__ */ defineComponent({
8425
8516
  rendered.value = true;
8426
8517
  nextTick(() => {
8427
8518
  updateShow(true);
8428
- updatePosition();
8519
+ nextTick(() => {
8520
+ updatePosition();
8521
+ });
8429
8522
  });
8430
8523
  } else {
8431
8524
  clearTimeout(showTimer.value);
8432
8525
  updateShow(true);
8433
- updatePosition();
8526
+ nextTick(() => {
8527
+ updatePosition();
8528
+ });
8434
8529
  }
8435
8530
  };
8436
8531
  const hide = () => {
@@ -8595,6 +8690,8 @@ var getPosition = (e) => {
8595
8690
  }
8596
8691
  return [clientX, clientY];
8597
8692
  };
8693
+ //#endregion
8694
+ //#region components/slider/index.tsx
8598
8695
  var Slider = /* @__PURE__ */ defineComponent({
8599
8696
  name: "Slider",
8600
8697
  props: {
@@ -8646,7 +8743,10 @@ var Slider = /* @__PURE__ */ defineComponent({
8646
8743
  return val;
8647
8744
  };
8648
8745
  const formatValue = (val) => {
8649
- if (props.range) return sortValue((Array.isArray(val) ? [...val] : [props.min, props.min]).map((v) => getClosestStep(v, props)));
8746
+ if (props.range) {
8747
+ const arr = Array.isArray(val) ? [...val] : [props.min, props.min];
8748
+ return sortValue(arr.map((v) => getClosestStep(v, props)));
8749
+ }
8650
8750
  return getClosestStep(val, props);
8651
8751
  };
8652
8752
  const updateSize = () => {
@@ -9125,7 +9225,7 @@ var ImagePreview = /* @__PURE__ */ defineComponent({
9125
9225
  });
9126
9226
  onMounted(() => {
9127
9227
  if (typeof window !== "undefined") {
9128
- const touch = "ontouchstart" in window || navigator.maxTouchPoints > 0 || window.TouchEvent !== void 0;
9228
+ const touch = "ontouchstart" in window || navigator.maxTouchPoints > 0 || window.matchMedia && window.matchMedia("(pointer: coarse)").matches;
9129
9229
  state.touch = touch;
9130
9230
  const event = touch ? "touchstart" : "mousedown";
9131
9231
  document.addEventListener(event, mousedown, { passive: false });
@@ -9371,7 +9471,7 @@ var KImage = /* @__PURE__ */ defineComponent({
9371
9471
  const showPreview = (e) => {
9372
9472
  const { origin, src } = props;
9373
9473
  if (!src && !origin || showPlaceholder.value || loading.value) return;
9374
- show({
9474
+ const options = {
9375
9475
  onClose: () => {
9376
9476
  emit("close");
9377
9477
  setTimeout(() => {
@@ -9384,7 +9484,8 @@ var KImage = /* @__PURE__ */ defineComponent({
9384
9484
  src: origin || src,
9385
9485
  showPanel: props.showPanel,
9386
9486
  type: props.type
9387
- }, slots);
9487
+ };
9488
+ show(options, slots);
9388
9489
  e.preventDefault();
9389
9490
  };
9390
9491
  const reload = () => {
@@ -9526,6 +9627,8 @@ Layout.Header = Header;
9526
9627
  Layout.Footer = Footer;
9527
9628
  Layout.Content = Content;
9528
9629
  Layout.Sider = Sider;
9630
+ //#endregion
9631
+ //#region components/loading/index.tsx
9529
9632
  var LoadingComponent = /* @__PURE__ */ defineComponent({
9530
9633
  name: "LoadingBar",
9531
9634
  props: { height: {
@@ -9638,6 +9741,8 @@ var loading = {
9638
9741
  loadInstance?.destroy?.();
9639
9742
  }
9640
9743
  };
9744
+ //#endregion
9745
+ //#region components/menu/menu-item.tsx
9641
9746
  var MenuItem = /* @__PURE__ */ defineComponent({
9642
9747
  name: "MenuItem",
9643
9748
  props: {
@@ -9690,6 +9795,8 @@ var MenuItem = /* @__PURE__ */ defineComponent({
9690
9795
  };
9691
9796
  }
9692
9797
  });
9798
+ //#endregion
9799
+ //#region components/menu/sub-menu.tsx
9693
9800
  var SubMenu = /* @__PURE__ */ defineComponent({
9694
9801
  name: "SubMenu",
9695
9802
  directives: { transfer },
@@ -9721,7 +9828,8 @@ var SubMenu = /* @__PURE__ */ defineComponent({
9721
9828
  const rendered = ref(false);
9722
9829
  onMounted(() => {
9723
9830
  nextTick(() => {
9724
- minWidth.value = `${refSelection.value?.offsetWidth}px`;
9831
+ const width = refSelection.value?.offsetWidth;
9832
+ minWidth.value = `${width}px`;
9725
9833
  if (openKeys.value.indexOf(key) >= 0) updatePosition();
9726
9834
  });
9727
9835
  });
@@ -9879,6 +9987,8 @@ var RecursiveMenu = /* @__PURE__ */ defineComponent({
9879
9987
  };
9880
9988
  }
9881
9989
  });
9990
+ //#endregion
9991
+ //#region components/menu/menu.tsx
9882
9992
  var Menu = /* @__PURE__ */ defineComponent({
9883
9993
  name: "Menu",
9884
9994
  props: {
@@ -9988,6 +10098,8 @@ var MenuDivider = /* @__PURE__ */ defineComponent({
9988
10098
  };
9989
10099
  }
9990
10100
  });
10101
+ //#endregion
10102
+ //#region components/menu/menu-group.tsx
9991
10103
  var MenuGroup = /* @__PURE__ */ defineComponent({
9992
10104
  name: "MenuGroup",
9993
10105
  props: { title: {
@@ -10013,7 +10125,8 @@ var content_default = /* @__PURE__ */ defineComponent({
10013
10125
  noticeType: {
10014
10126
  type: String,
10015
10127
  default: "message"
10016
- }
10128
+ },
10129
+ grouping: String
10017
10130
  },
10018
10131
  setup(props, { emit }) {
10019
10132
  const onClose = () => {
@@ -10074,7 +10187,19 @@ var container_default = /* @__PURE__ */ defineComponent({
10074
10187
  setup(ps, { expose }) {
10075
10188
  const options = ref([]);
10076
10189
  const show = (option) => {
10077
- let { duration = 3.5, onClose, closable, noticeType } = option;
10190
+ let { duration = 3.5, onClose, closable, noticeType, grouping } = option;
10191
+ if (grouping) {
10192
+ const existingItem = options.value.find((item) => item.grouping === grouping);
10193
+ if (existingItem) {
10194
+ existingItem.content = option.content;
10195
+ existingItem.type = option.type;
10196
+ if (option.icon !== void 0) existingItem.icon = option.icon;
10197
+ if (option.color !== void 0) existingItem.color = option.color;
10198
+ clearTimeout(existingItem.__timer);
10199
+ if (duration > 0) existingItem.__timer = setTimeout(existingItem.__callback, duration * 1e3);
10200
+ return existingItem.__callback;
10201
+ }
10202
+ }
10078
10203
  const key = getUuid();
10079
10204
  let timer = void 0;
10080
10205
  let callback = () => {
@@ -10086,7 +10211,9 @@ var container_default = /* @__PURE__ */ defineComponent({
10086
10211
  if (closable === true && noticeType == "message" || noticeType == "notice") option.onClose = () => callback();
10087
10212
  options.value.push({
10088
10213
  ...option,
10089
- key
10214
+ key,
10215
+ __timer: timer,
10216
+ __callback: callback
10090
10217
  });
10091
10218
  return callback;
10092
10219
  };
@@ -10404,7 +10531,7 @@ var Modal = /* @__PURE__ */ defineComponent({
10404
10531
  "tabindex": "0"
10405
10532
  }, [contents]);
10406
10533
  }
10407
- const style = {
10534
+ const style = props.maximized ? null : {
10408
10535
  width: typeof width === "number" ? `${width}px` : width,
10409
10536
  top: `${currentTop.value}px`,
10410
10537
  left: `${left.value}px`
@@ -10626,6 +10753,8 @@ var notice = {
10626
10753
  });
10627
10754
  }
10628
10755
  };
10756
+ //#endregion
10757
+ //#region components/page/index.tsx
10629
10758
  var Page = /* @__PURE__ */ defineComponent({
10630
10759
  name: "Page",
10631
10760
  props: {
@@ -10792,7 +10921,7 @@ var Page = /* @__PURE__ */ defineComponent({
10792
10921
  };
10793
10922
  const renderSize = () => {
10794
10923
  let prop = {
10795
- value: defaultPageSize.value,
10924
+ modelValue: defaultPageSize.value,
10796
10925
  size: props.size,
10797
10926
  clearable: false,
10798
10927
  theme: props.theme,
@@ -10865,6 +10994,8 @@ var Page = /* @__PURE__ */ defineComponent({
10865
10994
  };
10866
10995
  }
10867
10996
  });
10997
+ //#endregion
10998
+ //#region components/poptip/index.tsx
10868
10999
  var Poptip = /* @__PURE__ */ defineComponent({
10869
11000
  name: "Poptip",
10870
11001
  directives: { transfer },
@@ -10941,12 +11072,16 @@ var Poptip = /* @__PURE__ */ defineComponent({
10941
11072
  document.addEventListener("click", outsideClick);
10942
11073
  nextTick(() => {
10943
11074
  updateShow(true);
10944
- updatePosition();
11075
+ nextTick(() => {
11076
+ updatePosition();
11077
+ });
10945
11078
  });
10946
11079
  } else {
10947
11080
  clearTimeout(showTimer.value);
10948
11081
  updateShow(true);
10949
- updatePosition();
11082
+ nextTick(() => {
11083
+ updatePosition();
11084
+ });
10950
11085
  }
10951
11086
  };
10952
11087
  const hide = () => {
@@ -11021,6 +11156,8 @@ var Poptip = /* @__PURE__ */ defineComponent({
11021
11156
  };
11022
11157
  }
11023
11158
  });
11159
+ //#endregion
11160
+ //#region components/popconfirm/index.tsx
11024
11161
  var Popconfirm = /* @__PURE__ */ defineComponent({
11025
11162
  name: "Popconfirm",
11026
11163
  directives: { transfer },
@@ -11098,12 +11235,16 @@ var Popconfirm = /* @__PURE__ */ defineComponent({
11098
11235
  document.addEventListener("click", outsideClick);
11099
11236
  nextTick(() => {
11100
11237
  updateShow(true);
11101
- updatePosition();
11238
+ nextTick(() => {
11239
+ updatePosition();
11240
+ });
11102
11241
  });
11103
11242
  } else {
11104
11243
  clearTimeout(showTimer.value);
11105
11244
  updateShow(true);
11106
- updatePosition();
11245
+ nextTick(() => {
11246
+ updatePosition();
11247
+ });
11107
11248
  }
11108
11249
  };
11109
11250
  const ok = () => {
@@ -11181,6 +11322,8 @@ var Popconfirm = /* @__PURE__ */ defineComponent({
11181
11322
  };
11182
11323
  }
11183
11324
  });
11325
+ //#endregion
11326
+ //#region components/progress/index.tsx
11184
11327
  var Progress = /* @__PURE__ */ defineComponent({
11185
11328
  name: "Progress",
11186
11329
  props: {
@@ -11318,110 +11461,2757 @@ var Progress = /* @__PURE__ */ defineComponent({
11318
11461
  };
11319
11462
  }
11320
11463
  });
11321
- var Radio = /* @__PURE__ */ defineComponent({
11322
- name: "Radio",
11323
- props: {
11324
- modelValue: {
11325
- type: [
11326
- Boolean,
11327
- String,
11328
- Number
11329
- ],
11330
- default: false
11464
+ //#endregion
11465
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js
11466
+ var require_can_promise = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11467
+ module.exports = function() {
11468
+ return typeof Promise === "function" && Promise.prototype && Promise.prototype.then;
11469
+ };
11470
+ }));
11471
+ //#endregion
11472
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js
11473
+ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
11474
+ var toSJISFunction;
11475
+ var CODEWORDS_COUNT = [
11476
+ 0,
11477
+ 26,
11478
+ 44,
11479
+ 70,
11480
+ 100,
11481
+ 134,
11482
+ 172,
11483
+ 196,
11484
+ 242,
11485
+ 292,
11486
+ 346,
11487
+ 404,
11488
+ 466,
11489
+ 532,
11490
+ 581,
11491
+ 655,
11492
+ 733,
11493
+ 815,
11494
+ 901,
11495
+ 991,
11496
+ 1085,
11497
+ 1156,
11498
+ 1258,
11499
+ 1364,
11500
+ 1474,
11501
+ 1588,
11502
+ 1706,
11503
+ 1828,
11504
+ 1921,
11505
+ 2051,
11506
+ 2185,
11507
+ 2323,
11508
+ 2465,
11509
+ 2611,
11510
+ 2761,
11511
+ 2876,
11512
+ 3034,
11513
+ 3196,
11514
+ 3362,
11515
+ 3532,
11516
+ 3706
11517
+ ];
11518
+ /**
11519
+ * Returns the QR Code size for the specified version
11520
+ *
11521
+ * @param {Number} version QR Code version
11522
+ * @return {Number} size of QR code
11523
+ */
11524
+ exports.getSymbolSize = function getSymbolSize(version) {
11525
+ if (!version) throw new Error("\"version\" cannot be null or undefined");
11526
+ if (version < 1 || version > 40) throw new Error("\"version\" should be in range from 1 to 40");
11527
+ return version * 4 + 17;
11528
+ };
11529
+ /**
11530
+ * Returns the total number of codewords used to store data and EC information.
11531
+ *
11532
+ * @param {Number} version QR Code version
11533
+ * @return {Number} Data length in bits
11534
+ */
11535
+ exports.getSymbolTotalCodewords = function getSymbolTotalCodewords(version) {
11536
+ return CODEWORDS_COUNT[version];
11537
+ };
11538
+ /**
11539
+ * Encode data with Bose-Chaudhuri-Hocquenghem
11540
+ *
11541
+ * @param {Number} data Value to encode
11542
+ * @return {Number} Encoded value
11543
+ */
11544
+ exports.getBCHDigit = function(data) {
11545
+ let digit = 0;
11546
+ while (data !== 0) {
11547
+ digit++;
11548
+ data >>>= 1;
11549
+ }
11550
+ return digit;
11551
+ };
11552
+ exports.setToSJISFunction = function setToSJISFunction(f) {
11553
+ if (typeof f !== "function") throw new Error("\"toSJISFunc\" is not a valid function.");
11554
+ toSJISFunction = f;
11555
+ };
11556
+ exports.isKanjiModeEnabled = function() {
11557
+ return typeof toSJISFunction !== "undefined";
11558
+ };
11559
+ exports.toSJIS = function toSJIS(kanji) {
11560
+ return toSJISFunction(kanji);
11561
+ };
11562
+ }));
11563
+ //#endregion
11564
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js
11565
+ var require_error_correction_level = /* @__PURE__ */ __commonJSMin(((exports) => {
11566
+ exports.L = { bit: 1 };
11567
+ exports.M = { bit: 0 };
11568
+ exports.Q = { bit: 3 };
11569
+ exports.H = { bit: 2 };
11570
+ function fromString(string) {
11571
+ if (typeof string !== "string") throw new Error("Param is not a string");
11572
+ switch (string.toLowerCase()) {
11573
+ case "l":
11574
+ case "low": return exports.L;
11575
+ case "m":
11576
+ case "medium": return exports.M;
11577
+ case "q":
11578
+ case "quartile": return exports.Q;
11579
+ case "h":
11580
+ case "high": return exports.H;
11581
+ default: throw new Error("Unknown EC Level: " + string);
11582
+ }
11583
+ }
11584
+ exports.isValid = function isValid(level) {
11585
+ return level && typeof level.bit !== "undefined" && level.bit >= 0 && level.bit < 4;
11586
+ };
11587
+ exports.from = function from(value, defaultValue) {
11588
+ if (exports.isValid(value)) return value;
11589
+ try {
11590
+ return fromString(value);
11591
+ } catch (e) {
11592
+ return defaultValue;
11593
+ }
11594
+ };
11595
+ }));
11596
+ //#endregion
11597
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js
11598
+ var require_bit_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11599
+ function BitBuffer() {
11600
+ this.buffer = [];
11601
+ this.length = 0;
11602
+ }
11603
+ BitBuffer.prototype = {
11604
+ get: function(index) {
11605
+ const bufIndex = Math.floor(index / 8);
11606
+ return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) === 1;
11331
11607
  },
11332
- value: { type: [
11333
- String,
11334
- Number,
11335
- Boolean
11336
- ] },
11337
- label: { type: String },
11338
- checked: Boolean,
11339
- disabled: Boolean,
11340
- theme: {
11341
- type: String,
11342
- default: "fill"
11608
+ put: function(num, length) {
11609
+ for (let i = 0; i < length; i++) this.putBit((num >>> length - i - 1 & 1) === 1);
11343
11610
  },
11344
- size: { type: String },
11345
- onChange: Function
11346
- },
11347
- setup(props, { slots, emit }) {
11348
- const isChecked = ref(props.modelValue || props.checked);
11349
- watch(() => props.modelValue, (v) => {
11350
- isChecked.value = v;
11351
- });
11352
- watch(() => props.checked, (v) => {
11353
- isChecked.value = v;
11354
- });
11355
- const emitValue = (checked) => {
11356
- isChecked.value = checked;
11357
- emit("change", {
11358
- checked,
11359
- value: props.value,
11360
- label: props.label || slots.default?.()
11361
- });
11362
- emit("update:modelValue", checked);
11363
- emit("update:checked", checked);
11364
- };
11365
- const onChange = (e) => {
11366
- if (props.disabled || isChecked.value) return;
11367
- e.stopPropagation();
11368
- e.preventDefault();
11369
- const checked = e.target.checked;
11370
- emitValue(checked);
11371
- };
11372
- const triggerCheck = (e) => {
11373
- if (e.code == "Space") {
11374
- e.preventDefault();
11375
- e.stopPropagation();
11376
- if (props.disabled || isChecked.value) return;
11377
- emitValue(!isChecked.value);
11378
- }
11379
- };
11380
- return () => {
11381
- const classes = ["k-radio", {
11382
- ["k-radio-fill"]: props.theme == "fill",
11383
- ["k-radio-disabled"]: props.disabled,
11384
- ["k-radio-checked"]: isChecked.value,
11385
- ["k-radio-lg"]: props.size === "large",
11386
- ["k-radio-sm"]: props.size === "small"
11387
- }];
11388
- const labelNode = props.label || slots.default?.();
11389
- return createVNode("label", {
11390
- "class": classes,
11391
- "tabindex": props.disabled ? void 0 : 0,
11392
- "onKeydown": triggerCheck
11393
- }, [createVNode("span", { "class": "k-radio-symbol" }, [createVNode("input", {
11394
- "type": "radio",
11395
- "tabindex": "-1",
11396
- "class": "k-radio-input",
11397
- "disabled": props.disabled,
11398
- "onChange": onChange,
11399
- "checked": isChecked.value
11400
- }, null)]), labelNode ? createVNode("span", { "class": "k-radio-label" }, [labelNode]) : null]);
11401
- };
11611
+ getLengthInBits: function() {
11612
+ return this.length;
11613
+ },
11614
+ putBit: function(bit) {
11615
+ const bufIndex = Math.floor(this.length / 8);
11616
+ if (this.buffer.length <= bufIndex) this.buffer.push(0);
11617
+ if (bit) this.buffer[bufIndex] |= 128 >>> this.length % 8;
11618
+ this.length++;
11619
+ }
11620
+ };
11621
+ module.exports = BitBuffer;
11622
+ }));
11623
+ //#endregion
11624
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js
11625
+ var require_bit_matrix = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11626
+ /**
11627
+ * Helper class to handle QR Code symbol modules
11628
+ *
11629
+ * @param {Number} size Symbol size
11630
+ */
11631
+ function BitMatrix(size) {
11632
+ if (!size || size < 1) throw new Error("BitMatrix size must be defined and greater than 0");
11633
+ this.size = size;
11634
+ this.data = new Uint8Array(size * size);
11635
+ this.reservedBit = new Uint8Array(size * size);
11402
11636
  }
11403
- });
11637
+ /**
11638
+ * Set bit value at specified location
11639
+ * If reserved flag is set, this bit will be ignored during masking process
11640
+ *
11641
+ * @param {Number} row
11642
+ * @param {Number} col
11643
+ * @param {Boolean} value
11644
+ * @param {Boolean} reserved
11645
+ */
11646
+ BitMatrix.prototype.set = function(row, col, value, reserved) {
11647
+ const index = row * this.size + col;
11648
+ this.data[index] = value;
11649
+ if (reserved) this.reservedBit[index] = true;
11650
+ };
11651
+ /**
11652
+ * Returns bit value at specified location
11653
+ *
11654
+ * @param {Number} row
11655
+ * @param {Number} col
11656
+ * @return {Boolean}
11657
+ */
11658
+ BitMatrix.prototype.get = function(row, col) {
11659
+ return this.data[row * this.size + col];
11660
+ };
11661
+ /**
11662
+ * Applies xor operator at specified location
11663
+ * (used during masking process)
11664
+ *
11665
+ * @param {Number} row
11666
+ * @param {Number} col
11667
+ * @param {Boolean} value
11668
+ */
11669
+ BitMatrix.prototype.xor = function(row, col, value) {
11670
+ this.data[row * this.size + col] ^= value;
11671
+ };
11672
+ /**
11673
+ * Check if bit at specified location is reserved
11674
+ *
11675
+ * @param {Number} row
11676
+ * @param {Number} col
11677
+ * @return {Boolean}
11678
+ */
11679
+ BitMatrix.prototype.isReserved = function(row, col) {
11680
+ return this.reservedBit[row * this.size + col];
11681
+ };
11682
+ module.exports = BitMatrix;
11683
+ }));
11404
11684
  //#endregion
11405
- //#region components/radio/radio-button.tsx
11406
- function _isSlot$2(s) {
11407
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
11408
- }
11409
- var RadioButton = /* @__PURE__ */ defineComponent({
11410
- name: "RadioButton",
11411
- props: {
11412
- modelValue: {
11413
- type: [Boolean],
11414
- default: false
11415
- },
11416
- label: { type: String },
11417
- value: { type: [String, Number] },
11418
- theme: String,
11419
- disabled: Boolean,
11420
- checked: Boolean,
11421
- icon: Array,
11422
- size: { type: String },
11423
- shape: { type: String },
11424
- onChange: Function
11685
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js
11686
+ var require_alignment_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
11687
+ /**
11688
+ * Alignment pattern are fixed reference pattern in defined positions
11689
+ * in a matrix symbology, which enables the decode software to re-synchronise
11690
+ * the coordinate mapping of the image modules in the event of moderate amounts
11691
+ * of distortion of the image.
11692
+ *
11693
+ * Alignment patterns are present only in QR Code symbols of version 2 or larger
11694
+ * and their number depends on the symbol version.
11695
+ */
11696
+ var getSymbolSize = require_utils$1().getSymbolSize;
11697
+ /**
11698
+ * Calculate the row/column coordinates of the center module of each alignment pattern
11699
+ * for the specified QR Code version.
11700
+ *
11701
+ * The alignment patterns are positioned symmetrically on either side of the diagonal
11702
+ * running from the top left corner of the symbol to the bottom right corner.
11703
+ *
11704
+ * Since positions are simmetrical only half of the coordinates are returned.
11705
+ * Each item of the array will represent in turn the x and y coordinate.
11706
+ * @see {@link getPositions}
11707
+ *
11708
+ * @param {Number} version QR Code version
11709
+ * @return {Array} Array of coordinate
11710
+ */
11711
+ exports.getRowColCoords = function getRowColCoords(version) {
11712
+ if (version === 1) return [];
11713
+ const posCount = Math.floor(version / 7) + 2;
11714
+ const size = getSymbolSize(version);
11715
+ const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2;
11716
+ const positions = [size - 7];
11717
+ for (let i = 1; i < posCount - 1; i++) positions[i] = positions[i - 1] - intervals;
11718
+ positions.push(6);
11719
+ return positions.reverse();
11720
+ };
11721
+ /**
11722
+ * Returns an array containing the positions of each alignment pattern.
11723
+ * Each array's element represent the center point of the pattern as (x, y) coordinates
11724
+ *
11725
+ * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}
11726
+ * and filtering out the items that overlaps with finder pattern
11727
+ *
11728
+ * @example
11729
+ * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.
11730
+ * The alignment patterns, therefore, are to be centered on (row, column)
11731
+ * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).
11732
+ * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns
11733
+ * and are not therefore used for alignment patterns.
11734
+ *
11735
+ * let pos = getPositions(7)
11736
+ * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]
11737
+ *
11738
+ * @param {Number} version QR Code version
11739
+ * @return {Array} Array of coordinates
11740
+ */
11741
+ exports.getPositions = function getPositions(version) {
11742
+ const coords = [];
11743
+ const pos = exports.getRowColCoords(version);
11744
+ const posLength = pos.length;
11745
+ for (let i = 0; i < posLength; i++) for (let j = 0; j < posLength; j++) {
11746
+ if (i === 0 && j === 0 || i === 0 && j === posLength - 1 || i === posLength - 1 && j === 0) continue;
11747
+ coords.push([pos[i], pos[j]]);
11748
+ }
11749
+ return coords;
11750
+ };
11751
+ }));
11752
+ //#endregion
11753
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js
11754
+ var require_finder_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
11755
+ var getSymbolSize = require_utils$1().getSymbolSize;
11756
+ var FINDER_PATTERN_SIZE = 7;
11757
+ /**
11758
+ * Returns an array containing the positions of each finder pattern.
11759
+ * Each array's element represent the top-left point of the pattern as (x, y) coordinates
11760
+ *
11761
+ * @param {Number} version QR Code version
11762
+ * @return {Array} Array of coordinates
11763
+ */
11764
+ exports.getPositions = function getPositions(version) {
11765
+ const size = getSymbolSize(version);
11766
+ return [
11767
+ [0, 0],
11768
+ [size - FINDER_PATTERN_SIZE, 0],
11769
+ [0, size - FINDER_PATTERN_SIZE]
11770
+ ];
11771
+ };
11772
+ }));
11773
+ //#endregion
11774
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js
11775
+ var require_mask_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
11776
+ /**
11777
+ * Data mask pattern reference
11778
+ * @type {Object}
11779
+ */
11780
+ exports.Patterns = {
11781
+ PATTERN000: 0,
11782
+ PATTERN001: 1,
11783
+ PATTERN010: 2,
11784
+ PATTERN011: 3,
11785
+ PATTERN100: 4,
11786
+ PATTERN101: 5,
11787
+ PATTERN110: 6,
11788
+ PATTERN111: 7
11789
+ };
11790
+ /**
11791
+ * Weighted penalty scores for the undesirable features
11792
+ * @type {Object}
11793
+ */
11794
+ var PenaltyScores = {
11795
+ N1: 3,
11796
+ N2: 3,
11797
+ N3: 40,
11798
+ N4: 10
11799
+ };
11800
+ /**
11801
+ * Check if mask pattern value is valid
11802
+ *
11803
+ * @param {Number} mask Mask pattern
11804
+ * @return {Boolean} true if valid, false otherwise
11805
+ */
11806
+ exports.isValid = function isValid(mask) {
11807
+ return mask != null && mask !== "" && !isNaN(mask) && mask >= 0 && mask <= 7;
11808
+ };
11809
+ /**
11810
+ * Returns mask pattern from a value.
11811
+ * If value is not valid, returns undefined
11812
+ *
11813
+ * @param {Number|String} value Mask pattern value
11814
+ * @return {Number} Valid mask pattern or undefined
11815
+ */
11816
+ exports.from = function from(value) {
11817
+ return exports.isValid(value) ? parseInt(value, 10) : void 0;
11818
+ };
11819
+ /**
11820
+ * Find adjacent modules in row/column with the same color
11821
+ * and assign a penalty value.
11822
+ *
11823
+ * Points: N1 + i
11824
+ * i is the amount by which the number of adjacent modules of the same color exceeds 5
11825
+ */
11826
+ exports.getPenaltyN1 = function getPenaltyN1(data) {
11827
+ const size = data.size;
11828
+ let points = 0;
11829
+ let sameCountCol = 0;
11830
+ let sameCountRow = 0;
11831
+ let lastCol = null;
11832
+ let lastRow = null;
11833
+ for (let row = 0; row < size; row++) {
11834
+ sameCountCol = sameCountRow = 0;
11835
+ lastCol = lastRow = null;
11836
+ for (let col = 0; col < size; col++) {
11837
+ let module$1 = data.get(row, col);
11838
+ if (module$1 === lastCol) sameCountCol++;
11839
+ else {
11840
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
11841
+ lastCol = module$1;
11842
+ sameCountCol = 1;
11843
+ }
11844
+ module$1 = data.get(col, row);
11845
+ if (module$1 === lastRow) sameCountRow++;
11846
+ else {
11847
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
11848
+ lastRow = module$1;
11849
+ sameCountRow = 1;
11850
+ }
11851
+ }
11852
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
11853
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
11854
+ }
11855
+ return points;
11856
+ };
11857
+ /**
11858
+ * Find 2x2 blocks with the same color and assign a penalty value
11859
+ *
11860
+ * Points: N2 * (m - 1) * (n - 1)
11861
+ */
11862
+ exports.getPenaltyN2 = function getPenaltyN2(data) {
11863
+ const size = data.size;
11864
+ let points = 0;
11865
+ for (let row = 0; row < size - 1; row++) for (let col = 0; col < size - 1; col++) {
11866
+ const last = data.get(row, col) + data.get(row, col + 1) + data.get(row + 1, col) + data.get(row + 1, col + 1);
11867
+ if (last === 4 || last === 0) points++;
11868
+ }
11869
+ return points * PenaltyScores.N2;
11870
+ };
11871
+ /**
11872
+ * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,
11873
+ * preceded or followed by light area 4 modules wide
11874
+ *
11875
+ * Points: N3 * number of pattern found
11876
+ */
11877
+ exports.getPenaltyN3 = function getPenaltyN3(data) {
11878
+ const size = data.size;
11879
+ let points = 0;
11880
+ let bitsCol = 0;
11881
+ let bitsRow = 0;
11882
+ for (let row = 0; row < size; row++) {
11883
+ bitsCol = bitsRow = 0;
11884
+ for (let col = 0; col < size; col++) {
11885
+ bitsCol = bitsCol << 1 & 2047 | data.get(row, col);
11886
+ if (col >= 10 && (bitsCol === 1488 || bitsCol === 93)) points++;
11887
+ bitsRow = bitsRow << 1 & 2047 | data.get(col, row);
11888
+ if (col >= 10 && (bitsRow === 1488 || bitsRow === 93)) points++;
11889
+ }
11890
+ }
11891
+ return points * PenaltyScores.N3;
11892
+ };
11893
+ /**
11894
+ * Calculate proportion of dark modules in entire symbol
11895
+ *
11896
+ * Points: N4 * k
11897
+ *
11898
+ * k is the rating of the deviation of the proportion of dark modules
11899
+ * in the symbol from 50% in steps of 5%
11900
+ */
11901
+ exports.getPenaltyN4 = function getPenaltyN4(data) {
11902
+ let darkCount = 0;
11903
+ const modulesCount = data.data.length;
11904
+ for (let i = 0; i < modulesCount; i++) darkCount += data.data[i];
11905
+ return Math.abs(Math.ceil(darkCount * 100 / modulesCount / 5) - 10) * PenaltyScores.N4;
11906
+ };
11907
+ /**
11908
+ * Return mask value at given position
11909
+ *
11910
+ * @param {Number} maskPattern Pattern reference value
11911
+ * @param {Number} i Row
11912
+ * @param {Number} j Column
11913
+ * @return {Boolean} Mask value
11914
+ */
11915
+ function getMaskAt(maskPattern, i, j) {
11916
+ switch (maskPattern) {
11917
+ case exports.Patterns.PATTERN000: return (i + j) % 2 === 0;
11918
+ case exports.Patterns.PATTERN001: return i % 2 === 0;
11919
+ case exports.Patterns.PATTERN010: return j % 3 === 0;
11920
+ case exports.Patterns.PATTERN011: return (i + j) % 3 === 0;
11921
+ case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0;
11922
+ case exports.Patterns.PATTERN101: return i * j % 2 + i * j % 3 === 0;
11923
+ case exports.Patterns.PATTERN110: return (i * j % 2 + i * j % 3) % 2 === 0;
11924
+ case exports.Patterns.PATTERN111: return (i * j % 3 + (i + j) % 2) % 2 === 0;
11925
+ default: throw new Error("bad maskPattern:" + maskPattern);
11926
+ }
11927
+ }
11928
+ /**
11929
+ * Apply a mask pattern to a BitMatrix
11930
+ *
11931
+ * @param {Number} pattern Pattern reference number
11932
+ * @param {BitMatrix} data BitMatrix data
11933
+ */
11934
+ exports.applyMask = function applyMask(pattern, data) {
11935
+ const size = data.size;
11936
+ for (let col = 0; col < size; col++) for (let row = 0; row < size; row++) {
11937
+ if (data.isReserved(row, col)) continue;
11938
+ data.xor(row, col, getMaskAt(pattern, row, col));
11939
+ }
11940
+ };
11941
+ /**
11942
+ * Returns the best mask pattern for data
11943
+ *
11944
+ * @param {BitMatrix} data
11945
+ * @return {Number} Mask pattern reference number
11946
+ */
11947
+ exports.getBestMask = function getBestMask(data, setupFormatFunc) {
11948
+ const numPatterns = Object.keys(exports.Patterns).length;
11949
+ let bestPattern = 0;
11950
+ let lowerPenalty = Infinity;
11951
+ for (let p = 0; p < numPatterns; p++) {
11952
+ setupFormatFunc(p);
11953
+ exports.applyMask(p, data);
11954
+ const penalty = exports.getPenaltyN1(data) + exports.getPenaltyN2(data) + exports.getPenaltyN3(data) + exports.getPenaltyN4(data);
11955
+ exports.applyMask(p, data);
11956
+ if (penalty < lowerPenalty) {
11957
+ lowerPenalty = penalty;
11958
+ bestPattern = p;
11959
+ }
11960
+ }
11961
+ return bestPattern;
11962
+ };
11963
+ }));
11964
+ //#endregion
11965
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js
11966
+ var require_error_correction_code = /* @__PURE__ */ __commonJSMin(((exports) => {
11967
+ var ECLevel = require_error_correction_level();
11968
+ var EC_BLOCKS_TABLE = [
11969
+ 1,
11970
+ 1,
11971
+ 1,
11972
+ 1,
11973
+ 1,
11974
+ 1,
11975
+ 1,
11976
+ 1,
11977
+ 1,
11978
+ 1,
11979
+ 2,
11980
+ 2,
11981
+ 1,
11982
+ 2,
11983
+ 2,
11984
+ 4,
11985
+ 1,
11986
+ 2,
11987
+ 4,
11988
+ 4,
11989
+ 2,
11990
+ 4,
11991
+ 4,
11992
+ 4,
11993
+ 2,
11994
+ 4,
11995
+ 6,
11996
+ 5,
11997
+ 2,
11998
+ 4,
11999
+ 6,
12000
+ 6,
12001
+ 2,
12002
+ 5,
12003
+ 8,
12004
+ 8,
12005
+ 4,
12006
+ 5,
12007
+ 8,
12008
+ 8,
12009
+ 4,
12010
+ 5,
12011
+ 8,
12012
+ 11,
12013
+ 4,
12014
+ 8,
12015
+ 10,
12016
+ 11,
12017
+ 4,
12018
+ 9,
12019
+ 12,
12020
+ 16,
12021
+ 4,
12022
+ 9,
12023
+ 16,
12024
+ 16,
12025
+ 6,
12026
+ 10,
12027
+ 12,
12028
+ 18,
12029
+ 6,
12030
+ 10,
12031
+ 17,
12032
+ 16,
12033
+ 6,
12034
+ 11,
12035
+ 16,
12036
+ 19,
12037
+ 6,
12038
+ 13,
12039
+ 18,
12040
+ 21,
12041
+ 7,
12042
+ 14,
12043
+ 21,
12044
+ 25,
12045
+ 8,
12046
+ 16,
12047
+ 20,
12048
+ 25,
12049
+ 8,
12050
+ 17,
12051
+ 23,
12052
+ 25,
12053
+ 9,
12054
+ 17,
12055
+ 23,
12056
+ 34,
12057
+ 9,
12058
+ 18,
12059
+ 25,
12060
+ 30,
12061
+ 10,
12062
+ 20,
12063
+ 27,
12064
+ 32,
12065
+ 12,
12066
+ 21,
12067
+ 29,
12068
+ 35,
12069
+ 12,
12070
+ 23,
12071
+ 34,
12072
+ 37,
12073
+ 12,
12074
+ 25,
12075
+ 34,
12076
+ 40,
12077
+ 13,
12078
+ 26,
12079
+ 35,
12080
+ 42,
12081
+ 14,
12082
+ 28,
12083
+ 38,
12084
+ 45,
12085
+ 15,
12086
+ 29,
12087
+ 40,
12088
+ 48,
12089
+ 16,
12090
+ 31,
12091
+ 43,
12092
+ 51,
12093
+ 17,
12094
+ 33,
12095
+ 45,
12096
+ 54,
12097
+ 18,
12098
+ 35,
12099
+ 48,
12100
+ 57,
12101
+ 19,
12102
+ 37,
12103
+ 51,
12104
+ 60,
12105
+ 19,
12106
+ 38,
12107
+ 53,
12108
+ 63,
12109
+ 20,
12110
+ 40,
12111
+ 56,
12112
+ 66,
12113
+ 21,
12114
+ 43,
12115
+ 59,
12116
+ 70,
12117
+ 22,
12118
+ 45,
12119
+ 62,
12120
+ 74,
12121
+ 24,
12122
+ 47,
12123
+ 65,
12124
+ 77,
12125
+ 25,
12126
+ 49,
12127
+ 68,
12128
+ 81
12129
+ ];
12130
+ var EC_CODEWORDS_TABLE = [
12131
+ 7,
12132
+ 10,
12133
+ 13,
12134
+ 17,
12135
+ 10,
12136
+ 16,
12137
+ 22,
12138
+ 28,
12139
+ 15,
12140
+ 26,
12141
+ 36,
12142
+ 44,
12143
+ 20,
12144
+ 36,
12145
+ 52,
12146
+ 64,
12147
+ 26,
12148
+ 48,
12149
+ 72,
12150
+ 88,
12151
+ 36,
12152
+ 64,
12153
+ 96,
12154
+ 112,
12155
+ 40,
12156
+ 72,
12157
+ 108,
12158
+ 130,
12159
+ 48,
12160
+ 88,
12161
+ 132,
12162
+ 156,
12163
+ 60,
12164
+ 110,
12165
+ 160,
12166
+ 192,
12167
+ 72,
12168
+ 130,
12169
+ 192,
12170
+ 224,
12171
+ 80,
12172
+ 150,
12173
+ 224,
12174
+ 264,
12175
+ 96,
12176
+ 176,
12177
+ 260,
12178
+ 308,
12179
+ 104,
12180
+ 198,
12181
+ 288,
12182
+ 352,
12183
+ 120,
12184
+ 216,
12185
+ 320,
12186
+ 384,
12187
+ 132,
12188
+ 240,
12189
+ 360,
12190
+ 432,
12191
+ 144,
12192
+ 280,
12193
+ 408,
12194
+ 480,
12195
+ 168,
12196
+ 308,
12197
+ 448,
12198
+ 532,
12199
+ 180,
12200
+ 338,
12201
+ 504,
12202
+ 588,
12203
+ 196,
12204
+ 364,
12205
+ 546,
12206
+ 650,
12207
+ 224,
12208
+ 416,
12209
+ 600,
12210
+ 700,
12211
+ 224,
12212
+ 442,
12213
+ 644,
12214
+ 750,
12215
+ 252,
12216
+ 476,
12217
+ 690,
12218
+ 816,
12219
+ 270,
12220
+ 504,
12221
+ 750,
12222
+ 900,
12223
+ 300,
12224
+ 560,
12225
+ 810,
12226
+ 960,
12227
+ 312,
12228
+ 588,
12229
+ 870,
12230
+ 1050,
12231
+ 336,
12232
+ 644,
12233
+ 952,
12234
+ 1110,
12235
+ 360,
12236
+ 700,
12237
+ 1020,
12238
+ 1200,
12239
+ 390,
12240
+ 728,
12241
+ 1050,
12242
+ 1260,
12243
+ 420,
12244
+ 784,
12245
+ 1140,
12246
+ 1350,
12247
+ 450,
12248
+ 812,
12249
+ 1200,
12250
+ 1440,
12251
+ 480,
12252
+ 868,
12253
+ 1290,
12254
+ 1530,
12255
+ 510,
12256
+ 924,
12257
+ 1350,
12258
+ 1620,
12259
+ 540,
12260
+ 980,
12261
+ 1440,
12262
+ 1710,
12263
+ 570,
12264
+ 1036,
12265
+ 1530,
12266
+ 1800,
12267
+ 570,
12268
+ 1064,
12269
+ 1590,
12270
+ 1890,
12271
+ 600,
12272
+ 1120,
12273
+ 1680,
12274
+ 1980,
12275
+ 630,
12276
+ 1204,
12277
+ 1770,
12278
+ 2100,
12279
+ 660,
12280
+ 1260,
12281
+ 1860,
12282
+ 2220,
12283
+ 720,
12284
+ 1316,
12285
+ 1950,
12286
+ 2310,
12287
+ 750,
12288
+ 1372,
12289
+ 2040,
12290
+ 2430
12291
+ ];
12292
+ /**
12293
+ * Returns the number of error correction block that the QR Code should contain
12294
+ * for the specified version and error correction level.
12295
+ *
12296
+ * @param {Number} version QR Code version
12297
+ * @param {Number} errorCorrectionLevel Error correction level
12298
+ * @return {Number} Number of error correction blocks
12299
+ */
12300
+ exports.getBlocksCount = function getBlocksCount(version, errorCorrectionLevel) {
12301
+ switch (errorCorrectionLevel) {
12302
+ case ECLevel.L: return EC_BLOCKS_TABLE[(version - 1) * 4 + 0];
12303
+ case ECLevel.M: return EC_BLOCKS_TABLE[(version - 1) * 4 + 1];
12304
+ case ECLevel.Q: return EC_BLOCKS_TABLE[(version - 1) * 4 + 2];
12305
+ case ECLevel.H: return EC_BLOCKS_TABLE[(version - 1) * 4 + 3];
12306
+ default: return;
12307
+ }
12308
+ };
12309
+ /**
12310
+ * Returns the number of error correction codewords to use for the specified
12311
+ * version and error correction level.
12312
+ *
12313
+ * @param {Number} version QR Code version
12314
+ * @param {Number} errorCorrectionLevel Error correction level
12315
+ * @return {Number} Number of error correction codewords
12316
+ */
12317
+ exports.getTotalCodewordsCount = function getTotalCodewordsCount(version, errorCorrectionLevel) {
12318
+ switch (errorCorrectionLevel) {
12319
+ case ECLevel.L: return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0];
12320
+ case ECLevel.M: return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1];
12321
+ case ECLevel.Q: return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2];
12322
+ case ECLevel.H: return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3];
12323
+ default: return;
12324
+ }
12325
+ };
12326
+ }));
12327
+ //#endregion
12328
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js
12329
+ var require_galois_field = /* @__PURE__ */ __commonJSMin(((exports) => {
12330
+ var EXP_TABLE = /* @__PURE__ */ new Uint8Array(512);
12331
+ var LOG_TABLE = /* @__PURE__ */ new Uint8Array(256);
12332
+ (function initTables() {
12333
+ let x = 1;
12334
+ for (let i = 0; i < 255; i++) {
12335
+ EXP_TABLE[i] = x;
12336
+ LOG_TABLE[x] = i;
12337
+ x <<= 1;
12338
+ if (x & 256) x ^= 285;
12339
+ }
12340
+ for (let i = 255; i < 512; i++) EXP_TABLE[i] = EXP_TABLE[i - 255];
12341
+ })();
12342
+ /**
12343
+ * Returns log value of n inside Galois Field
12344
+ *
12345
+ * @param {Number} n
12346
+ * @return {Number}
12347
+ */
12348
+ exports.log = function log(n) {
12349
+ if (n < 1) throw new Error("log(" + n + ")");
12350
+ return LOG_TABLE[n];
12351
+ };
12352
+ /**
12353
+ * Returns anti-log value of n inside Galois Field
12354
+ *
12355
+ * @param {Number} n
12356
+ * @return {Number}
12357
+ */
12358
+ exports.exp = function exp(n) {
12359
+ return EXP_TABLE[n];
12360
+ };
12361
+ /**
12362
+ * Multiplies two number inside Galois Field
12363
+ *
12364
+ * @param {Number} x
12365
+ * @param {Number} y
12366
+ * @return {Number}
12367
+ */
12368
+ exports.mul = function mul(x, y) {
12369
+ if (x === 0 || y === 0) return 0;
12370
+ return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]];
12371
+ };
12372
+ }));
12373
+ //#endregion
12374
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js
12375
+ var require_polynomial = /* @__PURE__ */ __commonJSMin(((exports) => {
12376
+ var GF = require_galois_field();
12377
+ /**
12378
+ * Multiplies two polynomials inside Galois Field
12379
+ *
12380
+ * @param {Uint8Array} p1 Polynomial
12381
+ * @param {Uint8Array} p2 Polynomial
12382
+ * @return {Uint8Array} Product of p1 and p2
12383
+ */
12384
+ exports.mul = function mul(p1, p2) {
12385
+ const coeff = new Uint8Array(p1.length + p2.length - 1);
12386
+ for (let i = 0; i < p1.length; i++) for (let j = 0; j < p2.length; j++) coeff[i + j] ^= GF.mul(p1[i], p2[j]);
12387
+ return coeff;
12388
+ };
12389
+ /**
12390
+ * Calculate the remainder of polynomials division
12391
+ *
12392
+ * @param {Uint8Array} divident Polynomial
12393
+ * @param {Uint8Array} divisor Polynomial
12394
+ * @return {Uint8Array} Remainder
12395
+ */
12396
+ exports.mod = function mod(divident, divisor) {
12397
+ let result = new Uint8Array(divident);
12398
+ while (result.length - divisor.length >= 0) {
12399
+ const coeff = result[0];
12400
+ for (let i = 0; i < divisor.length; i++) result[i] ^= GF.mul(divisor[i], coeff);
12401
+ let offset = 0;
12402
+ while (offset < result.length && result[offset] === 0) offset++;
12403
+ result = result.slice(offset);
12404
+ }
12405
+ return result;
12406
+ };
12407
+ /**
12408
+ * Generate an irreducible generator polynomial of specified degree
12409
+ * (used by Reed-Solomon encoder)
12410
+ *
12411
+ * @param {Number} degree Degree of the generator polynomial
12412
+ * @return {Uint8Array} Buffer containing polynomial coefficients
12413
+ */
12414
+ exports.generateECPolynomial = function generateECPolynomial(degree) {
12415
+ let poly = new Uint8Array([1]);
12416
+ for (let i = 0; i < degree; i++) poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]));
12417
+ return poly;
12418
+ };
12419
+ }));
12420
+ //#endregion
12421
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js
12422
+ var require_reed_solomon_encoder = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12423
+ var Polynomial = require_polynomial();
12424
+ function ReedSolomonEncoder(degree) {
12425
+ this.genPoly = void 0;
12426
+ this.degree = degree;
12427
+ if (this.degree) this.initialize(this.degree);
12428
+ }
12429
+ /**
12430
+ * Initialize the encoder.
12431
+ * The input param should correspond to the number of error correction codewords.
12432
+ *
12433
+ * @param {Number} degree
12434
+ */
12435
+ ReedSolomonEncoder.prototype.initialize = function initialize(degree) {
12436
+ this.degree = degree;
12437
+ this.genPoly = Polynomial.generateECPolynomial(this.degree);
12438
+ };
12439
+ /**
12440
+ * Encodes a chunk of data
12441
+ *
12442
+ * @param {Uint8Array} data Buffer containing input data
12443
+ * @return {Uint8Array} Buffer containing encoded data
12444
+ */
12445
+ ReedSolomonEncoder.prototype.encode = function encode(data) {
12446
+ if (!this.genPoly) throw new Error("Encoder not initialized");
12447
+ const paddedData = new Uint8Array(data.length + this.degree);
12448
+ paddedData.set(data);
12449
+ const remainder = Polynomial.mod(paddedData, this.genPoly);
12450
+ const start = this.degree - remainder.length;
12451
+ if (start > 0) {
12452
+ const buff = new Uint8Array(this.degree);
12453
+ buff.set(remainder, start);
12454
+ return buff;
12455
+ }
12456
+ return remainder;
12457
+ };
12458
+ module.exports = ReedSolomonEncoder;
12459
+ }));
12460
+ //#endregion
12461
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js
12462
+ var require_version_check = /* @__PURE__ */ __commonJSMin(((exports) => {
12463
+ /**
12464
+ * Check if QR Code version is valid
12465
+ *
12466
+ * @param {Number} version QR Code version
12467
+ * @return {Boolean} true if valid version, false otherwise
12468
+ */
12469
+ exports.isValid = function isValid(version) {
12470
+ return !isNaN(version) && version >= 1 && version <= 40;
12471
+ };
12472
+ }));
12473
+ //#endregion
12474
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js
12475
+ var require_regex = /* @__PURE__ */ __commonJSMin(((exports) => {
12476
+ var numeric = "[0-9]+";
12477
+ var alphanumeric = "[A-Z $%*+\\-./:]+";
12478
+ var kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
12479
+ kanji = kanji.replace(/u/g, "\\u");
12480
+ var byte = "(?:(?![A-Z0-9 $%*+\\-./:]|" + kanji + ")(?:.|[\r\n]))+";
12481
+ exports.KANJI = new RegExp(kanji, "g");
12482
+ exports.BYTE_KANJI = /* @__PURE__ */ new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
12483
+ exports.BYTE = new RegExp(byte, "g");
12484
+ exports.NUMERIC = new RegExp(numeric, "g");
12485
+ exports.ALPHANUMERIC = new RegExp(alphanumeric, "g");
12486
+ var TEST_KANJI = new RegExp("^" + kanji + "$");
12487
+ var TEST_NUMERIC = /* @__PURE__ */ new RegExp("^[0-9]+$");
12488
+ var TEST_ALPHANUMERIC = /* @__PURE__ */ new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
12489
+ exports.testKanji = function testKanji(str) {
12490
+ return TEST_KANJI.test(str);
12491
+ };
12492
+ exports.testNumeric = function testNumeric(str) {
12493
+ return TEST_NUMERIC.test(str);
12494
+ };
12495
+ exports.testAlphanumeric = function testAlphanumeric(str) {
12496
+ return TEST_ALPHANUMERIC.test(str);
12497
+ };
12498
+ }));
12499
+ //#endregion
12500
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js
12501
+ var require_mode = /* @__PURE__ */ __commonJSMin(((exports) => {
12502
+ var VersionCheck = require_version_check();
12503
+ var Regex = require_regex();
12504
+ /**
12505
+ * Numeric mode encodes data from the decimal digit set (0 - 9)
12506
+ * (byte values 30HEX to 39HEX).
12507
+ * Normally, 3 data characters are represented by 10 bits.
12508
+ *
12509
+ * @type {Object}
12510
+ */
12511
+ exports.NUMERIC = {
12512
+ id: "Numeric",
12513
+ bit: 1,
12514
+ ccBits: [
12515
+ 10,
12516
+ 12,
12517
+ 14
12518
+ ]
12519
+ };
12520
+ /**
12521
+ * Alphanumeric mode encodes data from a set of 45 characters,
12522
+ * i.e. 10 numeric digits (0 - 9),
12523
+ * 26 alphabetic characters (A - Z),
12524
+ * and 9 symbols (SP, $, %, *, +, -, ., /, :).
12525
+ * Normally, two input characters are represented by 11 bits.
12526
+ *
12527
+ * @type {Object}
12528
+ */
12529
+ exports.ALPHANUMERIC = {
12530
+ id: "Alphanumeric",
12531
+ bit: 2,
12532
+ ccBits: [
12533
+ 9,
12534
+ 11,
12535
+ 13
12536
+ ]
12537
+ };
12538
+ /**
12539
+ * In byte mode, data is encoded at 8 bits per character.
12540
+ *
12541
+ * @type {Object}
12542
+ */
12543
+ exports.BYTE = {
12544
+ id: "Byte",
12545
+ bit: 4,
12546
+ ccBits: [
12547
+ 8,
12548
+ 16,
12549
+ 16
12550
+ ]
12551
+ };
12552
+ /**
12553
+ * The Kanji mode efficiently encodes Kanji characters in accordance with
12554
+ * the Shift JIS system based on JIS X 0208.
12555
+ * The Shift JIS values are shifted from the JIS X 0208 values.
12556
+ * JIS X 0208 gives details of the shift coded representation.
12557
+ * Each two-byte character value is compacted to a 13-bit binary codeword.
12558
+ *
12559
+ * @type {Object}
12560
+ */
12561
+ exports.KANJI = {
12562
+ id: "Kanji",
12563
+ bit: 8,
12564
+ ccBits: [
12565
+ 8,
12566
+ 10,
12567
+ 12
12568
+ ]
12569
+ };
12570
+ /**
12571
+ * Mixed mode will contain a sequences of data in a combination of any of
12572
+ * the modes described above
12573
+ *
12574
+ * @type {Object}
12575
+ */
12576
+ exports.MIXED = { bit: -1 };
12577
+ /**
12578
+ * Returns the number of bits needed to store the data length
12579
+ * according to QR Code specifications.
12580
+ *
12581
+ * @param {Mode} mode Data mode
12582
+ * @param {Number} version QR Code version
12583
+ * @return {Number} Number of bits
12584
+ */
12585
+ exports.getCharCountIndicator = function getCharCountIndicator(mode, version) {
12586
+ if (!mode.ccBits) throw new Error("Invalid mode: " + mode);
12587
+ if (!VersionCheck.isValid(version)) throw new Error("Invalid version: " + version);
12588
+ if (version >= 1 && version < 10) return mode.ccBits[0];
12589
+ else if (version < 27) return mode.ccBits[1];
12590
+ return mode.ccBits[2];
12591
+ };
12592
+ /**
12593
+ * Returns the most efficient mode to store the specified data
12594
+ *
12595
+ * @param {String} dataStr Input data string
12596
+ * @return {Mode} Best mode
12597
+ */
12598
+ exports.getBestModeForData = function getBestModeForData(dataStr) {
12599
+ if (Regex.testNumeric(dataStr)) return exports.NUMERIC;
12600
+ else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC;
12601
+ else if (Regex.testKanji(dataStr)) return exports.KANJI;
12602
+ else return exports.BYTE;
12603
+ };
12604
+ /**
12605
+ * Return mode name as string
12606
+ *
12607
+ * @param {Mode} mode Mode object
12608
+ * @returns {String} Mode name
12609
+ */
12610
+ exports.toString = function toString(mode) {
12611
+ if (mode && mode.id) return mode.id;
12612
+ throw new Error("Invalid mode");
12613
+ };
12614
+ /**
12615
+ * Check if input param is a valid mode object
12616
+ *
12617
+ * @param {Mode} mode Mode object
12618
+ * @returns {Boolean} True if valid mode, false otherwise
12619
+ */
12620
+ exports.isValid = function isValid(mode) {
12621
+ return mode && mode.bit && mode.ccBits;
12622
+ };
12623
+ /**
12624
+ * Get mode object from its name
12625
+ *
12626
+ * @param {String} string Mode name
12627
+ * @returns {Mode} Mode object
12628
+ */
12629
+ function fromString(string) {
12630
+ if (typeof string !== "string") throw new Error("Param is not a string");
12631
+ switch (string.toLowerCase()) {
12632
+ case "numeric": return exports.NUMERIC;
12633
+ case "alphanumeric": return exports.ALPHANUMERIC;
12634
+ case "kanji": return exports.KANJI;
12635
+ case "byte": return exports.BYTE;
12636
+ default: throw new Error("Unknown mode: " + string);
12637
+ }
12638
+ }
12639
+ /**
12640
+ * Returns mode from a value.
12641
+ * If value is not a valid mode, returns defaultValue
12642
+ *
12643
+ * @param {Mode|String} value Encoding mode
12644
+ * @param {Mode} defaultValue Fallback value
12645
+ * @return {Mode} Encoding mode
12646
+ */
12647
+ exports.from = function from(value, defaultValue) {
12648
+ if (exports.isValid(value)) return value;
12649
+ try {
12650
+ return fromString(value);
12651
+ } catch (e) {
12652
+ return defaultValue;
12653
+ }
12654
+ };
12655
+ }));
12656
+ //#endregion
12657
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js
12658
+ var require_version = /* @__PURE__ */ __commonJSMin(((exports) => {
12659
+ var Utils = require_utils$1();
12660
+ var ECCode = require_error_correction_code();
12661
+ var ECLevel = require_error_correction_level();
12662
+ var Mode = require_mode();
12663
+ var VersionCheck = require_version_check();
12664
+ var G18 = 7973;
12665
+ var G18_BCH = Utils.getBCHDigit(G18);
12666
+ function getBestVersionForDataLength(mode, length, errorCorrectionLevel) {
12667
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) return currentVersion;
12668
+ }
12669
+ function getReservedBitsCount(mode, version) {
12670
+ return Mode.getCharCountIndicator(mode, version) + 4;
12671
+ }
12672
+ function getTotalBitsFromDataArray(segments, version) {
12673
+ let totalBits = 0;
12674
+ segments.forEach(function(data) {
12675
+ const reservedBits = getReservedBitsCount(data.mode, version);
12676
+ totalBits += reservedBits + data.getBitsLength();
12677
+ });
12678
+ return totalBits;
12679
+ }
12680
+ function getBestVersionForMixedData(segments, errorCorrectionLevel) {
12681
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) if (getTotalBitsFromDataArray(segments, currentVersion) <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) return currentVersion;
12682
+ }
12683
+ /**
12684
+ * Returns version number from a value.
12685
+ * If value is not a valid version, returns defaultValue
12686
+ *
12687
+ * @param {Number|String} value QR Code version
12688
+ * @param {Number} defaultValue Fallback value
12689
+ * @return {Number} QR Code version number
12690
+ */
12691
+ exports.from = function from(value, defaultValue) {
12692
+ if (VersionCheck.isValid(value)) return parseInt(value, 10);
12693
+ return defaultValue;
12694
+ };
12695
+ /**
12696
+ * Returns how much data can be stored with the specified QR code version
12697
+ * and error correction level
12698
+ *
12699
+ * @param {Number} version QR Code version (1-40)
12700
+ * @param {Number} errorCorrectionLevel Error correction level
12701
+ * @param {Mode} mode Data mode
12702
+ * @return {Number} Quantity of storable data
12703
+ */
12704
+ exports.getCapacity = function getCapacity(version, errorCorrectionLevel, mode) {
12705
+ if (!VersionCheck.isValid(version)) throw new Error("Invalid QR Code version");
12706
+ if (typeof mode === "undefined") mode = Mode.BYTE;
12707
+ const dataTotalCodewordsBits = (Utils.getSymbolTotalCodewords(version) - ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)) * 8;
12708
+ if (mode === Mode.MIXED) return dataTotalCodewordsBits;
12709
+ const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version);
12710
+ switch (mode) {
12711
+ case Mode.NUMERIC: return Math.floor(usableBits / 10 * 3);
12712
+ case Mode.ALPHANUMERIC: return Math.floor(usableBits / 11 * 2);
12713
+ case Mode.KANJI: return Math.floor(usableBits / 13);
12714
+ case Mode.BYTE:
12715
+ default: return Math.floor(usableBits / 8);
12716
+ }
12717
+ };
12718
+ /**
12719
+ * Returns the minimum version needed to contain the amount of data
12720
+ *
12721
+ * @param {Segment} data Segment of data
12722
+ * @param {Number} [errorCorrectionLevel=H] Error correction level
12723
+ * @param {Mode} mode Data mode
12724
+ * @return {Number} QR Code version
12725
+ */
12726
+ exports.getBestVersionForData = function getBestVersionForData(data, errorCorrectionLevel) {
12727
+ let seg;
12728
+ const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M);
12729
+ if (Array.isArray(data)) {
12730
+ if (data.length > 1) return getBestVersionForMixedData(data, ecl);
12731
+ if (data.length === 0) return 1;
12732
+ seg = data[0];
12733
+ } else seg = data;
12734
+ return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl);
12735
+ };
12736
+ /**
12737
+ * Returns version information with relative error correction bits
12738
+ *
12739
+ * The version information is included in QR Code symbols of version 7 or larger.
12740
+ * It consists of an 18-bit sequence containing 6 data bits,
12741
+ * with 12 error correction bits calculated using the (18, 6) Golay code.
12742
+ *
12743
+ * @param {Number} version QR Code version
12744
+ * @return {Number} Encoded version info bits
12745
+ */
12746
+ exports.getEncodedBits = function getEncodedBits(version) {
12747
+ if (!VersionCheck.isValid(version) || version < 7) throw new Error("Invalid QR Code version");
12748
+ let d = version << 12;
12749
+ while (Utils.getBCHDigit(d) - G18_BCH >= 0) d ^= G18 << Utils.getBCHDigit(d) - G18_BCH;
12750
+ return version << 12 | d;
12751
+ };
12752
+ }));
12753
+ //#endregion
12754
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js
12755
+ var require_format_info = /* @__PURE__ */ __commonJSMin(((exports) => {
12756
+ var Utils = require_utils$1();
12757
+ var G15 = 1335;
12758
+ var G15_MASK = 21522;
12759
+ var G15_BCH = Utils.getBCHDigit(G15);
12760
+ /**
12761
+ * Returns format information with relative error correction bits
12762
+ *
12763
+ * The format information is a 15-bit sequence containing 5 data bits,
12764
+ * with 10 error correction bits calculated using the (15, 5) BCH code.
12765
+ *
12766
+ * @param {Number} errorCorrectionLevel Error correction level
12767
+ * @param {Number} mask Mask pattern
12768
+ * @return {Number} Encoded format information bits
12769
+ */
12770
+ exports.getEncodedBits = function getEncodedBits(errorCorrectionLevel, mask) {
12771
+ const data = errorCorrectionLevel.bit << 3 | mask;
12772
+ let d = data << 10;
12773
+ while (Utils.getBCHDigit(d) - G15_BCH >= 0) d ^= G15 << Utils.getBCHDigit(d) - G15_BCH;
12774
+ return (data << 10 | d) ^ G15_MASK;
12775
+ };
12776
+ }));
12777
+ //#endregion
12778
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js
12779
+ var require_numeric_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12780
+ var Mode = require_mode();
12781
+ function NumericData(data) {
12782
+ this.mode = Mode.NUMERIC;
12783
+ this.data = data.toString();
12784
+ }
12785
+ NumericData.getBitsLength = function getBitsLength(length) {
12786
+ return 10 * Math.floor(length / 3) + (length % 3 ? length % 3 * 3 + 1 : 0);
12787
+ };
12788
+ NumericData.prototype.getLength = function getLength() {
12789
+ return this.data.length;
12790
+ };
12791
+ NumericData.prototype.getBitsLength = function getBitsLength() {
12792
+ return NumericData.getBitsLength(this.data.length);
12793
+ };
12794
+ NumericData.prototype.write = function write(bitBuffer) {
12795
+ let i, group, value;
12796
+ for (i = 0; i + 3 <= this.data.length; i += 3) {
12797
+ group = this.data.substr(i, 3);
12798
+ value = parseInt(group, 10);
12799
+ bitBuffer.put(value, 10);
12800
+ }
12801
+ const remainingNum = this.data.length - i;
12802
+ if (remainingNum > 0) {
12803
+ group = this.data.substr(i);
12804
+ value = parseInt(group, 10);
12805
+ bitBuffer.put(value, remainingNum * 3 + 1);
12806
+ }
12807
+ };
12808
+ module.exports = NumericData;
12809
+ }));
12810
+ //#endregion
12811
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js
12812
+ var require_alphanumeric_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12813
+ var Mode = require_mode();
12814
+ /**
12815
+ * Array of characters available in alphanumeric mode
12816
+ *
12817
+ * As per QR Code specification, to each character
12818
+ * is assigned a value from 0 to 44 which in this case coincides
12819
+ * with the array index
12820
+ *
12821
+ * @type {Array}
12822
+ */
12823
+ var ALPHA_NUM_CHARS = [
12824
+ "0",
12825
+ "1",
12826
+ "2",
12827
+ "3",
12828
+ "4",
12829
+ "5",
12830
+ "6",
12831
+ "7",
12832
+ "8",
12833
+ "9",
12834
+ "A",
12835
+ "B",
12836
+ "C",
12837
+ "D",
12838
+ "E",
12839
+ "F",
12840
+ "G",
12841
+ "H",
12842
+ "I",
12843
+ "J",
12844
+ "K",
12845
+ "L",
12846
+ "M",
12847
+ "N",
12848
+ "O",
12849
+ "P",
12850
+ "Q",
12851
+ "R",
12852
+ "S",
12853
+ "T",
12854
+ "U",
12855
+ "V",
12856
+ "W",
12857
+ "X",
12858
+ "Y",
12859
+ "Z",
12860
+ " ",
12861
+ "$",
12862
+ "%",
12863
+ "*",
12864
+ "+",
12865
+ "-",
12866
+ ".",
12867
+ "/",
12868
+ ":"
12869
+ ];
12870
+ function AlphanumericData(data) {
12871
+ this.mode = Mode.ALPHANUMERIC;
12872
+ this.data = data;
12873
+ }
12874
+ AlphanumericData.getBitsLength = function getBitsLength(length) {
12875
+ return 11 * Math.floor(length / 2) + 6 * (length % 2);
12876
+ };
12877
+ AlphanumericData.prototype.getLength = function getLength() {
12878
+ return this.data.length;
12879
+ };
12880
+ AlphanumericData.prototype.getBitsLength = function getBitsLength() {
12881
+ return AlphanumericData.getBitsLength(this.data.length);
12882
+ };
12883
+ AlphanumericData.prototype.write = function write(bitBuffer) {
12884
+ let i;
12885
+ for (i = 0; i + 2 <= this.data.length; i += 2) {
12886
+ let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45;
12887
+ value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1]);
12888
+ bitBuffer.put(value, 11);
12889
+ }
12890
+ if (this.data.length % 2) bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6);
12891
+ };
12892
+ module.exports = AlphanumericData;
12893
+ }));
12894
+ //#endregion
12895
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js
12896
+ var require_byte_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12897
+ var Mode = require_mode();
12898
+ function ByteData(data) {
12899
+ this.mode = Mode.BYTE;
12900
+ if (typeof data === "string") this.data = new TextEncoder().encode(data);
12901
+ else this.data = new Uint8Array(data);
12902
+ }
12903
+ ByteData.getBitsLength = function getBitsLength(length) {
12904
+ return length * 8;
12905
+ };
12906
+ ByteData.prototype.getLength = function getLength() {
12907
+ return this.data.length;
12908
+ };
12909
+ ByteData.prototype.getBitsLength = function getBitsLength() {
12910
+ return ByteData.getBitsLength(this.data.length);
12911
+ };
12912
+ ByteData.prototype.write = function(bitBuffer) {
12913
+ for (let i = 0, l = this.data.length; i < l; i++) bitBuffer.put(this.data[i], 8);
12914
+ };
12915
+ module.exports = ByteData;
12916
+ }));
12917
+ //#endregion
12918
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js
12919
+ var require_kanji_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12920
+ var Mode = require_mode();
12921
+ var Utils = require_utils$1();
12922
+ function KanjiData(data) {
12923
+ this.mode = Mode.KANJI;
12924
+ this.data = data;
12925
+ }
12926
+ KanjiData.getBitsLength = function getBitsLength(length) {
12927
+ return length * 13;
12928
+ };
12929
+ KanjiData.prototype.getLength = function getLength() {
12930
+ return this.data.length;
12931
+ };
12932
+ KanjiData.prototype.getBitsLength = function getBitsLength() {
12933
+ return KanjiData.getBitsLength(this.data.length);
12934
+ };
12935
+ KanjiData.prototype.write = function(bitBuffer) {
12936
+ let i;
12937
+ for (i = 0; i < this.data.length; i++) {
12938
+ let value = Utils.toSJIS(this.data[i]);
12939
+ if (value >= 33088 && value <= 40956) value -= 33088;
12940
+ else if (value >= 57408 && value <= 60351) value -= 49472;
12941
+ else throw new Error("Invalid SJIS character: " + this.data[i] + "\nMake sure your charset is UTF-8");
12942
+ value = (value >>> 8 & 255) * 192 + (value & 255);
12943
+ bitBuffer.put(value, 13);
12944
+ }
12945
+ };
12946
+ module.exports = KanjiData;
12947
+ }));
12948
+ //#endregion
12949
+ //#region node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js
12950
+ var require_dijkstra = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12951
+ /******************************************************************************
12952
+ * Created 2008-08-19.
12953
+ *
12954
+ * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.
12955
+ *
12956
+ * Copyright (C) 2008
12957
+ * Wyatt Baldwin <self@wyattbaldwin.com>
12958
+ * All rights reserved
12959
+ *
12960
+ * Licensed under the MIT license.
12961
+ *
12962
+ * http://www.opensource.org/licenses/mit-license.php
12963
+ *
12964
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12965
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12966
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12967
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12968
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12969
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
12970
+ * THE SOFTWARE.
12971
+ *****************************************************************************/
12972
+ var dijkstra = {
12973
+ single_source_shortest_paths: function(graph, s, d) {
12974
+ var predecessors = {};
12975
+ var costs = {};
12976
+ costs[s] = 0;
12977
+ var open = dijkstra.PriorityQueue.make();
12978
+ open.push(s, 0);
12979
+ var closest, u, v, cost_of_s_to_u, adjacent_nodes, cost_of_e, cost_of_s_to_u_plus_cost_of_e, cost_of_s_to_v, first_visit;
12980
+ while (!open.empty()) {
12981
+ closest = open.pop();
12982
+ u = closest.value;
12983
+ cost_of_s_to_u = closest.cost;
12984
+ adjacent_nodes = graph[u] || {};
12985
+ for (v in adjacent_nodes) if (adjacent_nodes.hasOwnProperty(v)) {
12986
+ cost_of_e = adjacent_nodes[v];
12987
+ cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;
12988
+ cost_of_s_to_v = costs[v];
12989
+ first_visit = typeof costs[v] === "undefined";
12990
+ if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {
12991
+ costs[v] = cost_of_s_to_u_plus_cost_of_e;
12992
+ open.push(v, cost_of_s_to_u_plus_cost_of_e);
12993
+ predecessors[v] = u;
12994
+ }
12995
+ }
12996
+ }
12997
+ if (typeof d !== "undefined" && typeof costs[d] === "undefined") {
12998
+ var msg = [
12999
+ "Could not find a path from ",
13000
+ s,
13001
+ " to ",
13002
+ d,
13003
+ "."
13004
+ ].join("");
13005
+ throw new Error(msg);
13006
+ }
13007
+ return predecessors;
13008
+ },
13009
+ extract_shortest_path_from_predecessor_list: function(predecessors, d) {
13010
+ var nodes = [];
13011
+ var u = d;
13012
+ while (u) {
13013
+ nodes.push(u);
13014
+ predecessors[u];
13015
+ u = predecessors[u];
13016
+ }
13017
+ nodes.reverse();
13018
+ return nodes;
13019
+ },
13020
+ find_path: function(graph, s, d) {
13021
+ var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);
13022
+ return dijkstra.extract_shortest_path_from_predecessor_list(predecessors, d);
13023
+ },
13024
+ /**
13025
+ * A very naive priority queue implementation.
13026
+ */
13027
+ PriorityQueue: {
13028
+ make: function(opts) {
13029
+ var T = dijkstra.PriorityQueue, t = {}, key;
13030
+ opts = opts || {};
13031
+ for (key in T) if (T.hasOwnProperty(key)) t[key] = T[key];
13032
+ t.queue = [];
13033
+ t.sorter = opts.sorter || T.default_sorter;
13034
+ return t;
13035
+ },
13036
+ default_sorter: function(a, b) {
13037
+ return a.cost - b.cost;
13038
+ },
13039
+ /**
13040
+ * Add a new item to the queue and ensure the highest priority element
13041
+ * is at the front of the queue.
13042
+ */
13043
+ push: function(value, cost) {
13044
+ var item = {
13045
+ value,
13046
+ cost
13047
+ };
13048
+ this.queue.push(item);
13049
+ this.queue.sort(this.sorter);
13050
+ },
13051
+ /**
13052
+ * Return the highest priority element in the queue.
13053
+ */
13054
+ pop: function() {
13055
+ return this.queue.shift();
13056
+ },
13057
+ empty: function() {
13058
+ return this.queue.length === 0;
13059
+ }
13060
+ }
13061
+ };
13062
+ if (typeof module !== "undefined") module.exports = dijkstra;
13063
+ }));
13064
+ //#endregion
13065
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js
13066
+ var require_segments = /* @__PURE__ */ __commonJSMin(((exports) => {
13067
+ var Mode = require_mode();
13068
+ var NumericData = require_numeric_data();
13069
+ var AlphanumericData = require_alphanumeric_data();
13070
+ var ByteData = require_byte_data();
13071
+ var KanjiData = require_kanji_data();
13072
+ var Regex = require_regex();
13073
+ var Utils = require_utils$1();
13074
+ var dijkstra = require_dijkstra();
13075
+ /**
13076
+ * Returns UTF8 byte length
13077
+ *
13078
+ * @param {String} str Input string
13079
+ * @return {Number} Number of byte
13080
+ */
13081
+ function getStringByteLength(str) {
13082
+ return unescape(encodeURIComponent(str)).length;
13083
+ }
13084
+ /**
13085
+ * Get a list of segments of the specified mode
13086
+ * from a string
13087
+ *
13088
+ * @param {Mode} mode Segment mode
13089
+ * @param {String} str String to process
13090
+ * @return {Array} Array of object with segments data
13091
+ */
13092
+ function getSegments(regex, mode, str) {
13093
+ const segments = [];
13094
+ let result;
13095
+ while ((result = regex.exec(str)) !== null) segments.push({
13096
+ data: result[0],
13097
+ index: result.index,
13098
+ mode,
13099
+ length: result[0].length
13100
+ });
13101
+ return segments;
13102
+ }
13103
+ /**
13104
+ * Extracts a series of segments with the appropriate
13105
+ * modes from a string
13106
+ *
13107
+ * @param {String} dataStr Input string
13108
+ * @return {Array} Array of object with segments data
13109
+ */
13110
+ function getSegmentsFromString(dataStr) {
13111
+ const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr);
13112
+ const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr);
13113
+ let byteSegs;
13114
+ let kanjiSegs;
13115
+ if (Utils.isKanjiModeEnabled()) {
13116
+ byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr);
13117
+ kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr);
13118
+ } else {
13119
+ byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr);
13120
+ kanjiSegs = [];
13121
+ }
13122
+ return numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs).sort(function(s1, s2) {
13123
+ return s1.index - s2.index;
13124
+ }).map(function(obj) {
13125
+ return {
13126
+ data: obj.data,
13127
+ mode: obj.mode,
13128
+ length: obj.length
13129
+ };
13130
+ });
13131
+ }
13132
+ /**
13133
+ * Returns how many bits are needed to encode a string of
13134
+ * specified length with the specified mode
13135
+ *
13136
+ * @param {Number} length String length
13137
+ * @param {Mode} mode Segment mode
13138
+ * @return {Number} Bit length
13139
+ */
13140
+ function getSegmentBitsLength(length, mode) {
13141
+ switch (mode) {
13142
+ case Mode.NUMERIC: return NumericData.getBitsLength(length);
13143
+ case Mode.ALPHANUMERIC: return AlphanumericData.getBitsLength(length);
13144
+ case Mode.KANJI: return KanjiData.getBitsLength(length);
13145
+ case Mode.BYTE: return ByteData.getBitsLength(length);
13146
+ }
13147
+ }
13148
+ /**
13149
+ * Merges adjacent segments which have the same mode
13150
+ *
13151
+ * @param {Array} segs Array of object with segments data
13152
+ * @return {Array} Array of object with segments data
13153
+ */
13154
+ function mergeSegments(segs) {
13155
+ return segs.reduce(function(acc, curr) {
13156
+ const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null;
13157
+ if (prevSeg && prevSeg.mode === curr.mode) {
13158
+ acc[acc.length - 1].data += curr.data;
13159
+ return acc;
13160
+ }
13161
+ acc.push(curr);
13162
+ return acc;
13163
+ }, []);
13164
+ }
13165
+ /**
13166
+ * Generates a list of all possible nodes combination which
13167
+ * will be used to build a segments graph.
13168
+ *
13169
+ * Nodes are divided by groups. Each group will contain a list of all the modes
13170
+ * in which is possible to encode the given text.
13171
+ *
13172
+ * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.
13173
+ * The group for '12345' will contain then 3 objects, one for each
13174
+ * possible encoding mode.
13175
+ *
13176
+ * Each node represents a possible segment.
13177
+ *
13178
+ * @param {Array} segs Array of object with segments data
13179
+ * @return {Array} Array of object with segments data
13180
+ */
13181
+ function buildNodes(segs) {
13182
+ const nodes = [];
13183
+ for (let i = 0; i < segs.length; i++) {
13184
+ const seg = segs[i];
13185
+ switch (seg.mode) {
13186
+ case Mode.NUMERIC:
13187
+ nodes.push([
13188
+ seg,
13189
+ {
13190
+ data: seg.data,
13191
+ mode: Mode.ALPHANUMERIC,
13192
+ length: seg.length
13193
+ },
13194
+ {
13195
+ data: seg.data,
13196
+ mode: Mode.BYTE,
13197
+ length: seg.length
13198
+ }
13199
+ ]);
13200
+ break;
13201
+ case Mode.ALPHANUMERIC:
13202
+ nodes.push([seg, {
13203
+ data: seg.data,
13204
+ mode: Mode.BYTE,
13205
+ length: seg.length
13206
+ }]);
13207
+ break;
13208
+ case Mode.KANJI:
13209
+ nodes.push([seg, {
13210
+ data: seg.data,
13211
+ mode: Mode.BYTE,
13212
+ length: getStringByteLength(seg.data)
13213
+ }]);
13214
+ break;
13215
+ case Mode.BYTE: nodes.push([{
13216
+ data: seg.data,
13217
+ mode: Mode.BYTE,
13218
+ length: getStringByteLength(seg.data)
13219
+ }]);
13220
+ }
13221
+ }
13222
+ return nodes;
13223
+ }
13224
+ /**
13225
+ * Builds a graph from a list of nodes.
13226
+ * All segments in each node group will be connected with all the segments of
13227
+ * the next group and so on.
13228
+ *
13229
+ * At each connection will be assigned a weight depending on the
13230
+ * segment's byte length.
13231
+ *
13232
+ * @param {Array} nodes Array of object with segments data
13233
+ * @param {Number} version QR Code version
13234
+ * @return {Object} Graph of all possible segments
13235
+ */
13236
+ function buildGraph(nodes, version) {
13237
+ const table = {};
13238
+ const graph = { start: {} };
13239
+ let prevNodeIds = ["start"];
13240
+ for (let i = 0; i < nodes.length; i++) {
13241
+ const nodeGroup = nodes[i];
13242
+ const currentNodeIds = [];
13243
+ for (let j = 0; j < nodeGroup.length; j++) {
13244
+ const node = nodeGroup[j];
13245
+ const key = "" + i + j;
13246
+ currentNodeIds.push(key);
13247
+ table[key] = {
13248
+ node,
13249
+ lastCount: 0
13250
+ };
13251
+ graph[key] = {};
13252
+ for (let n = 0; n < prevNodeIds.length; n++) {
13253
+ const prevNodeId = prevNodeIds[n];
13254
+ if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {
13255
+ graph[prevNodeId][key] = getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - getSegmentBitsLength(table[prevNodeId].lastCount, node.mode);
13256
+ table[prevNodeId].lastCount += node.length;
13257
+ } else {
13258
+ if (table[prevNodeId]) table[prevNodeId].lastCount = node.length;
13259
+ graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + 4 + Mode.getCharCountIndicator(node.mode, version);
13260
+ }
13261
+ }
13262
+ }
13263
+ prevNodeIds = currentNodeIds;
13264
+ }
13265
+ for (let n = 0; n < prevNodeIds.length; n++) graph[prevNodeIds[n]].end = 0;
13266
+ return {
13267
+ map: graph,
13268
+ table
13269
+ };
13270
+ }
13271
+ /**
13272
+ * Builds a segment from a specified data and mode.
13273
+ * If a mode is not specified, the more suitable will be used.
13274
+ *
13275
+ * @param {String} data Input data
13276
+ * @param {Mode | String} modesHint Data mode
13277
+ * @return {Segment} Segment
13278
+ */
13279
+ function buildSingleSegment(data, modesHint) {
13280
+ let mode;
13281
+ const bestMode = Mode.getBestModeForData(data);
13282
+ mode = Mode.from(modesHint, bestMode);
13283
+ if (mode !== Mode.BYTE && mode.bit < bestMode.bit) throw new Error("\"" + data + "\" cannot be encoded with mode " + Mode.toString(mode) + ".\n Suggested mode is: " + Mode.toString(bestMode));
13284
+ if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) mode = Mode.BYTE;
13285
+ switch (mode) {
13286
+ case Mode.NUMERIC: return new NumericData(data);
13287
+ case Mode.ALPHANUMERIC: return new AlphanumericData(data);
13288
+ case Mode.KANJI: return new KanjiData(data);
13289
+ case Mode.BYTE: return new ByteData(data);
13290
+ }
13291
+ }
13292
+ /**
13293
+ * Builds a list of segments from an array.
13294
+ * Array can contain Strings or Objects with segment's info.
13295
+ *
13296
+ * For each item which is a string, will be generated a segment with the given
13297
+ * string and the more appropriate encoding mode.
13298
+ *
13299
+ * For each item which is an object, will be generated a segment with the given
13300
+ * data and mode.
13301
+ * Objects must contain at least the property "data".
13302
+ * If property "mode" is not present, the more suitable mode will be used.
13303
+ *
13304
+ * @param {Array} array Array of objects with segments data
13305
+ * @return {Array} Array of Segments
13306
+ */
13307
+ exports.fromArray = function fromArray(array) {
13308
+ return array.reduce(function(acc, seg) {
13309
+ if (typeof seg === "string") acc.push(buildSingleSegment(seg, null));
13310
+ else if (seg.data) acc.push(buildSingleSegment(seg.data, seg.mode));
13311
+ return acc;
13312
+ }, []);
13313
+ };
13314
+ /**
13315
+ * Builds an optimized sequence of segments from a string,
13316
+ * which will produce the shortest possible bitstream.
13317
+ *
13318
+ * @param {String} data Input string
13319
+ * @param {Number} version QR Code version
13320
+ * @return {Array} Array of segments
13321
+ */
13322
+ exports.fromString = function fromString(data, version) {
13323
+ const graph = buildGraph(buildNodes(getSegmentsFromString(data, Utils.isKanjiModeEnabled())), version);
13324
+ const path = dijkstra.find_path(graph.map, "start", "end");
13325
+ const optimizedSegs = [];
13326
+ for (let i = 1; i < path.length - 1; i++) optimizedSegs.push(graph.table[path[i]].node);
13327
+ return exports.fromArray(mergeSegments(optimizedSegs));
13328
+ };
13329
+ /**
13330
+ * Splits a string in various segments with the modes which
13331
+ * best represent their content.
13332
+ * The produced segments are far from being optimized.
13333
+ * The output of this function is only used to estimate a QR Code version
13334
+ * which may contain the data.
13335
+ *
13336
+ * @param {string} data Input string
13337
+ * @return {Array} Array of segments
13338
+ */
13339
+ exports.rawSplit = function rawSplit(data) {
13340
+ return exports.fromArray(getSegmentsFromString(data, Utils.isKanjiModeEnabled()));
13341
+ };
13342
+ }));
13343
+ //#endregion
13344
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js
13345
+ var require_qrcode = /* @__PURE__ */ __commonJSMin(((exports) => {
13346
+ var Utils = require_utils$1();
13347
+ var ECLevel = require_error_correction_level();
13348
+ var BitBuffer = require_bit_buffer();
13349
+ var BitMatrix = require_bit_matrix();
13350
+ var AlignmentPattern = require_alignment_pattern();
13351
+ var FinderPattern = require_finder_pattern();
13352
+ var MaskPattern = require_mask_pattern();
13353
+ var ECCode = require_error_correction_code();
13354
+ var ReedSolomonEncoder = require_reed_solomon_encoder();
13355
+ var Version = require_version();
13356
+ var FormatInfo = require_format_info();
13357
+ var Mode = require_mode();
13358
+ var Segments = require_segments();
13359
+ /**
13360
+ * QRCode for JavaScript
13361
+ *
13362
+ * modified by Ryan Day for nodejs support
13363
+ * Copyright (c) 2011 Ryan Day
13364
+ *
13365
+ * Licensed under the MIT license:
13366
+ * http://www.opensource.org/licenses/mit-license.php
13367
+ *
13368
+ //---------------------------------------------------------------------
13369
+ // QRCode for JavaScript
13370
+ //
13371
+ // Copyright (c) 2009 Kazuhiko Arase
13372
+ //
13373
+ // URL: http://www.d-project.com/
13374
+ //
13375
+ // Licensed under the MIT license:
13376
+ // http://www.opensource.org/licenses/mit-license.php
13377
+ //
13378
+ // The word "QR Code" is registered trademark of
13379
+ // DENSO WAVE INCORPORATED
13380
+ // http://www.denso-wave.com/qrcode/faqpatent-e.html
13381
+ //
13382
+ //---------------------------------------------------------------------
13383
+ */
13384
+ /**
13385
+ * Add finder patterns bits to matrix
13386
+ *
13387
+ * @param {BitMatrix} matrix Modules matrix
13388
+ * @param {Number} version QR Code version
13389
+ */
13390
+ function setupFinderPattern(matrix, version) {
13391
+ const size = matrix.size;
13392
+ const pos = FinderPattern.getPositions(version);
13393
+ for (let i = 0; i < pos.length; i++) {
13394
+ const row = pos[i][0];
13395
+ const col = pos[i][1];
13396
+ for (let r = -1; r <= 7; r++) {
13397
+ if (row + r <= -1 || size <= row + r) continue;
13398
+ for (let c = -1; c <= 7; c++) {
13399
+ if (col + c <= -1 || size <= col + c) continue;
13400
+ if (r >= 0 && r <= 6 && (c === 0 || c === 6) || c >= 0 && c <= 6 && (r === 0 || r === 6) || r >= 2 && r <= 4 && c >= 2 && c <= 4) matrix.set(row + r, col + c, true, true);
13401
+ else matrix.set(row + r, col + c, false, true);
13402
+ }
13403
+ }
13404
+ }
13405
+ }
13406
+ /**
13407
+ * Add timing pattern bits to matrix
13408
+ *
13409
+ * Note: this function must be called before {@link setupAlignmentPattern}
13410
+ *
13411
+ * @param {BitMatrix} matrix Modules matrix
13412
+ */
13413
+ function setupTimingPattern(matrix) {
13414
+ const size = matrix.size;
13415
+ for (let r = 8; r < size - 8; r++) {
13416
+ const value = r % 2 === 0;
13417
+ matrix.set(r, 6, value, true);
13418
+ matrix.set(6, r, value, true);
13419
+ }
13420
+ }
13421
+ /**
13422
+ * Add alignment patterns bits to matrix
13423
+ *
13424
+ * Note: this function must be called after {@link setupTimingPattern}
13425
+ *
13426
+ * @param {BitMatrix} matrix Modules matrix
13427
+ * @param {Number} version QR Code version
13428
+ */
13429
+ function setupAlignmentPattern(matrix, version) {
13430
+ const pos = AlignmentPattern.getPositions(version);
13431
+ for (let i = 0; i < pos.length; i++) {
13432
+ const row = pos[i][0];
13433
+ const col = pos[i][1];
13434
+ for (let r = -2; r <= 2; r++) for (let c = -2; c <= 2; c++) if (r === -2 || r === 2 || c === -2 || c === 2 || r === 0 && c === 0) matrix.set(row + r, col + c, true, true);
13435
+ else matrix.set(row + r, col + c, false, true);
13436
+ }
13437
+ }
13438
+ /**
13439
+ * Add version info bits to matrix
13440
+ *
13441
+ * @param {BitMatrix} matrix Modules matrix
13442
+ * @param {Number} version QR Code version
13443
+ */
13444
+ function setupVersionInfo(matrix, version) {
13445
+ const size = matrix.size;
13446
+ const bits = Version.getEncodedBits(version);
13447
+ let row, col, mod;
13448
+ for (let i = 0; i < 18; i++) {
13449
+ row = Math.floor(i / 3);
13450
+ col = i % 3 + size - 8 - 3;
13451
+ mod = (bits >> i & 1) === 1;
13452
+ matrix.set(row, col, mod, true);
13453
+ matrix.set(col, row, mod, true);
13454
+ }
13455
+ }
13456
+ /**
13457
+ * Add format info bits to matrix
13458
+ *
13459
+ * @param {BitMatrix} matrix Modules matrix
13460
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
13461
+ * @param {Number} maskPattern Mask pattern reference value
13462
+ */
13463
+ function setupFormatInfo(matrix, errorCorrectionLevel, maskPattern) {
13464
+ const size = matrix.size;
13465
+ const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern);
13466
+ let i, mod;
13467
+ for (i = 0; i < 15; i++) {
13468
+ mod = (bits >> i & 1) === 1;
13469
+ if (i < 6) matrix.set(i, 8, mod, true);
13470
+ else if (i < 8) matrix.set(i + 1, 8, mod, true);
13471
+ else matrix.set(size - 15 + i, 8, mod, true);
13472
+ if (i < 8) matrix.set(8, size - i - 1, mod, true);
13473
+ else if (i < 9) matrix.set(8, 15 - i - 1 + 1, mod, true);
13474
+ else matrix.set(8, 15 - i - 1, mod, true);
13475
+ }
13476
+ matrix.set(size - 8, 8, 1, true);
13477
+ }
13478
+ /**
13479
+ * Add encoded data bits to matrix
13480
+ *
13481
+ * @param {BitMatrix} matrix Modules matrix
13482
+ * @param {Uint8Array} data Data codewords
13483
+ */
13484
+ function setupData(matrix, data) {
13485
+ const size = matrix.size;
13486
+ let inc = -1;
13487
+ let row = size - 1;
13488
+ let bitIndex = 7;
13489
+ let byteIndex = 0;
13490
+ for (let col = size - 1; col > 0; col -= 2) {
13491
+ if (col === 6) col--;
13492
+ while (true) {
13493
+ for (let c = 0; c < 2; c++) if (!matrix.isReserved(row, col - c)) {
13494
+ let dark = false;
13495
+ if (byteIndex < data.length) dark = (data[byteIndex] >>> bitIndex & 1) === 1;
13496
+ matrix.set(row, col - c, dark);
13497
+ bitIndex--;
13498
+ if (bitIndex === -1) {
13499
+ byteIndex++;
13500
+ bitIndex = 7;
13501
+ }
13502
+ }
13503
+ row += inc;
13504
+ if (row < 0 || size <= row) {
13505
+ row -= inc;
13506
+ inc = -inc;
13507
+ break;
13508
+ }
13509
+ }
13510
+ }
13511
+ }
13512
+ /**
13513
+ * Create encoded codewords from data input
13514
+ *
13515
+ * @param {Number} version QR Code version
13516
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
13517
+ * @param {ByteData} data Data input
13518
+ * @return {Uint8Array} Buffer containing encoded codewords
13519
+ */
13520
+ function createData(version, errorCorrectionLevel, segments) {
13521
+ const buffer = new BitBuffer();
13522
+ segments.forEach(function(data) {
13523
+ buffer.put(data.mode.bit, 4);
13524
+ buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version));
13525
+ data.write(buffer);
13526
+ });
13527
+ const dataTotalCodewordsBits = (Utils.getSymbolTotalCodewords(version) - ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)) * 8;
13528
+ if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) buffer.put(0, 4);
13529
+ while (buffer.getLengthInBits() % 8 !== 0) buffer.putBit(0);
13530
+ const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8;
13531
+ for (let i = 0; i < remainingByte; i++) buffer.put(i % 2 ? 17 : 236, 8);
13532
+ return createCodewords(buffer, version, errorCorrectionLevel);
13533
+ }
13534
+ /**
13535
+ * Encode input data with Reed-Solomon and return codewords with
13536
+ * relative error correction bits
13537
+ *
13538
+ * @param {BitBuffer} bitBuffer Data to encode
13539
+ * @param {Number} version QR Code version
13540
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
13541
+ * @return {Uint8Array} Buffer containing encoded codewords
13542
+ */
13543
+ function createCodewords(bitBuffer, version, errorCorrectionLevel) {
13544
+ const totalCodewords = Utils.getSymbolTotalCodewords(version);
13545
+ const dataTotalCodewords = totalCodewords - ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
13546
+ const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel);
13547
+ const blocksInGroup1 = ecTotalBlocks - totalCodewords % ecTotalBlocks;
13548
+ const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks);
13549
+ const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks);
13550
+ const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1;
13551
+ const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1;
13552
+ const rs = new ReedSolomonEncoder(ecCount);
13553
+ let offset = 0;
13554
+ const dcData = new Array(ecTotalBlocks);
13555
+ const ecData = new Array(ecTotalBlocks);
13556
+ let maxDataSize = 0;
13557
+ const buffer = new Uint8Array(bitBuffer.buffer);
13558
+ for (let b = 0; b < ecTotalBlocks; b++) {
13559
+ const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2;
13560
+ dcData[b] = buffer.slice(offset, offset + dataSize);
13561
+ ecData[b] = rs.encode(dcData[b]);
13562
+ offset += dataSize;
13563
+ maxDataSize = Math.max(maxDataSize, dataSize);
13564
+ }
13565
+ const data = new Uint8Array(totalCodewords);
13566
+ let index = 0;
13567
+ let i, r;
13568
+ for (i = 0; i < maxDataSize; i++) for (r = 0; r < ecTotalBlocks; r++) if (i < dcData[r].length) data[index++] = dcData[r][i];
13569
+ for (i = 0; i < ecCount; i++) for (r = 0; r < ecTotalBlocks; r++) data[index++] = ecData[r][i];
13570
+ return data;
13571
+ }
13572
+ /**
13573
+ * Build QR Code symbol
13574
+ *
13575
+ * @param {String} data Input string
13576
+ * @param {Number} version QR Code version
13577
+ * @param {ErrorCorretionLevel} errorCorrectionLevel Error level
13578
+ * @param {MaskPattern} maskPattern Mask pattern
13579
+ * @return {Object} Object containing symbol data
13580
+ */
13581
+ function createSymbol(data, version, errorCorrectionLevel, maskPattern) {
13582
+ let segments;
13583
+ if (Array.isArray(data)) segments = Segments.fromArray(data);
13584
+ else if (typeof data === "string") {
13585
+ let estimatedVersion = version;
13586
+ if (!estimatedVersion) {
13587
+ const rawSegments = Segments.rawSplit(data);
13588
+ estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel);
13589
+ }
13590
+ segments = Segments.fromString(data, estimatedVersion || 40);
13591
+ } else throw new Error("Invalid data");
13592
+ const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel);
13593
+ if (!bestVersion) throw new Error("The amount of data is too big to be stored in a QR Code");
13594
+ if (!version) version = bestVersion;
13595
+ else if (version < bestVersion) throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + bestVersion + ".\n");
13596
+ const dataBits = createData(version, errorCorrectionLevel, segments);
13597
+ const modules = new BitMatrix(Utils.getSymbolSize(version));
13598
+ setupFinderPattern(modules, version);
13599
+ setupTimingPattern(modules);
13600
+ setupAlignmentPattern(modules, version);
13601
+ setupFormatInfo(modules, errorCorrectionLevel, 0);
13602
+ if (version >= 7) setupVersionInfo(modules, version);
13603
+ setupData(modules, dataBits);
13604
+ if (isNaN(maskPattern)) maskPattern = MaskPattern.getBestMask(modules, setupFormatInfo.bind(null, modules, errorCorrectionLevel));
13605
+ MaskPattern.applyMask(maskPattern, modules);
13606
+ setupFormatInfo(modules, errorCorrectionLevel, maskPattern);
13607
+ return {
13608
+ modules,
13609
+ version,
13610
+ errorCorrectionLevel,
13611
+ maskPattern,
13612
+ segments
13613
+ };
13614
+ }
13615
+ /**
13616
+ * QR Code
13617
+ *
13618
+ * @param {String | Array} data Input data
13619
+ * @param {Object} options Optional configurations
13620
+ * @param {Number} options.version QR Code version
13621
+ * @param {String} options.errorCorrectionLevel Error correction level
13622
+ * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis
13623
+ */
13624
+ exports.create = function create(data, options) {
13625
+ if (typeof data === "undefined" || data === "") throw new Error("No input text");
13626
+ let errorCorrectionLevel = ECLevel.M;
13627
+ let version;
13628
+ let mask;
13629
+ if (typeof options !== "undefined") {
13630
+ errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M);
13631
+ version = Version.from(options.version);
13632
+ mask = MaskPattern.from(options.maskPattern);
13633
+ if (options.toSJISFunc) Utils.setToSJISFunction(options.toSJISFunc);
13634
+ }
13635
+ return createSymbol(data, version, errorCorrectionLevel, mask);
13636
+ };
13637
+ }));
13638
+ //#endregion
13639
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js
13640
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
13641
+ function hex2rgba(hex) {
13642
+ if (typeof hex === "number") hex = hex.toString();
13643
+ if (typeof hex !== "string") throw new Error("Color should be defined as hex string");
13644
+ let hexCode = hex.slice().replace("#", "").split("");
13645
+ if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) throw new Error("Invalid hex color: " + hex);
13646
+ if (hexCode.length === 3 || hexCode.length === 4) hexCode = Array.prototype.concat.apply([], hexCode.map(function(c) {
13647
+ return [c, c];
13648
+ }));
13649
+ if (hexCode.length === 6) hexCode.push("F", "F");
13650
+ const hexValue = parseInt(hexCode.join(""), 16);
13651
+ return {
13652
+ r: hexValue >> 24 & 255,
13653
+ g: hexValue >> 16 & 255,
13654
+ b: hexValue >> 8 & 255,
13655
+ a: hexValue & 255,
13656
+ hex: "#" + hexCode.slice(0, 6).join("")
13657
+ };
13658
+ }
13659
+ exports.getOptions = function getOptions(options) {
13660
+ if (!options) options = {};
13661
+ if (!options.color) options.color = {};
13662
+ const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin;
13663
+ const width = options.width && options.width >= 21 ? options.width : void 0;
13664
+ const scale = options.scale || 4;
13665
+ return {
13666
+ width,
13667
+ scale: width ? 4 : scale,
13668
+ margin,
13669
+ color: {
13670
+ dark: hex2rgba(options.color.dark || "#000000ff"),
13671
+ light: hex2rgba(options.color.light || "#ffffffff")
13672
+ },
13673
+ type: options.type,
13674
+ rendererOpts: options.rendererOpts || {}
13675
+ };
13676
+ };
13677
+ exports.getScale = function getScale(qrSize, opts) {
13678
+ return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale;
13679
+ };
13680
+ exports.getImageWidth = function getImageWidth(qrSize, opts) {
13681
+ const scale = exports.getScale(qrSize, opts);
13682
+ return Math.floor((qrSize + opts.margin * 2) * scale);
13683
+ };
13684
+ exports.qrToImageData = function qrToImageData(imgData, qr, opts) {
13685
+ const size = qr.modules.size;
13686
+ const data = qr.modules.data;
13687
+ const scale = exports.getScale(size, opts);
13688
+ const symbolSize = Math.floor((size + opts.margin * 2) * scale);
13689
+ const scaledMargin = opts.margin * scale;
13690
+ const palette = [opts.color.light, opts.color.dark];
13691
+ for (let i = 0; i < symbolSize; i++) for (let j = 0; j < symbolSize; j++) {
13692
+ let posDst = (i * symbolSize + j) * 4;
13693
+ let pxColor = opts.color.light;
13694
+ if (i >= scaledMargin && j >= scaledMargin && i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {
13695
+ const iSrc = Math.floor((i - scaledMargin) / scale);
13696
+ const jSrc = Math.floor((j - scaledMargin) / scale);
13697
+ pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0];
13698
+ }
13699
+ imgData[posDst++] = pxColor.r;
13700
+ imgData[posDst++] = pxColor.g;
13701
+ imgData[posDst++] = pxColor.b;
13702
+ imgData[posDst] = pxColor.a;
13703
+ }
13704
+ };
13705
+ }));
13706
+ //#endregion
13707
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js
13708
+ var require_canvas = /* @__PURE__ */ __commonJSMin(((exports) => {
13709
+ var Utils = require_utils();
13710
+ function clearCanvas(ctx, canvas, size) {
13711
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
13712
+ if (!canvas.style) canvas.style = {};
13713
+ canvas.height = size;
13714
+ canvas.width = size;
13715
+ canvas.style.height = size + "px";
13716
+ canvas.style.width = size + "px";
13717
+ }
13718
+ function getCanvasElement() {
13719
+ try {
13720
+ return document.createElement("canvas");
13721
+ } catch (e) {
13722
+ throw new Error("You need to specify a canvas element");
13723
+ }
13724
+ }
13725
+ exports.render = function render(qrData, canvas, options) {
13726
+ let opts = options;
13727
+ let canvasEl = canvas;
13728
+ if (typeof opts === "undefined" && (!canvas || !canvas.getContext)) {
13729
+ opts = canvas;
13730
+ canvas = void 0;
13731
+ }
13732
+ if (!canvas) canvasEl = getCanvasElement();
13733
+ opts = Utils.getOptions(opts);
13734
+ const size = Utils.getImageWidth(qrData.modules.size, opts);
13735
+ const ctx = canvasEl.getContext("2d");
13736
+ const image = ctx.createImageData(size, size);
13737
+ Utils.qrToImageData(image.data, qrData, opts);
13738
+ clearCanvas(ctx, canvasEl, size);
13739
+ ctx.putImageData(image, 0, 0);
13740
+ return canvasEl;
13741
+ };
13742
+ exports.renderToDataURL = function renderToDataURL(qrData, canvas, options) {
13743
+ let opts = options;
13744
+ if (typeof opts === "undefined" && (!canvas || !canvas.getContext)) {
13745
+ opts = canvas;
13746
+ canvas = void 0;
13747
+ }
13748
+ if (!opts) opts = {};
13749
+ const canvasEl = exports.render(qrData, canvas, opts);
13750
+ const type = opts.type || "image/png";
13751
+ const rendererOpts = opts.rendererOpts || {};
13752
+ return canvasEl.toDataURL(type, rendererOpts.quality);
13753
+ };
13754
+ }));
13755
+ //#endregion
13756
+ //#region node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js
13757
+ var require_svg_tag = /* @__PURE__ */ __commonJSMin(((exports) => {
13758
+ var Utils = require_utils();
13759
+ function getColorAttrib(color, attrib) {
13760
+ const alpha = color.a / 255;
13761
+ const str = attrib + "=\"" + color.hex + "\"";
13762
+ return alpha < 1 ? str + " " + attrib + "-opacity=\"" + alpha.toFixed(2).slice(1) + "\"" : str;
13763
+ }
13764
+ function svgCmd(cmd, x, y) {
13765
+ let str = cmd + x;
13766
+ if (typeof y !== "undefined") str += " " + y;
13767
+ return str;
13768
+ }
13769
+ function qrToPath(data, size, margin) {
13770
+ let path = "";
13771
+ let moveBy = 0;
13772
+ let newRow = false;
13773
+ let lineLength = 0;
13774
+ for (let i = 0; i < data.length; i++) {
13775
+ const col = Math.floor(i % size);
13776
+ const row = Math.floor(i / size);
13777
+ if (!col && !newRow) newRow = true;
13778
+ if (data[i]) {
13779
+ lineLength++;
13780
+ if (!(i > 0 && col > 0 && data[i - 1])) {
13781
+ path += newRow ? svgCmd("M", col + margin, .5 + row + margin) : svgCmd("m", moveBy, 0);
13782
+ moveBy = 0;
13783
+ newRow = false;
13784
+ }
13785
+ if (!(col + 1 < size && data[i + 1])) {
13786
+ path += svgCmd("h", lineLength);
13787
+ lineLength = 0;
13788
+ }
13789
+ } else moveBy++;
13790
+ }
13791
+ return path;
13792
+ }
13793
+ exports.render = function render(qrData, options, cb) {
13794
+ const opts = Utils.getOptions(options);
13795
+ const size = qrData.modules.size;
13796
+ const data = qrData.modules.data;
13797
+ const qrcodesize = size + opts.margin * 2;
13798
+ const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + " d=\"M0 0h" + qrcodesize + "v" + qrcodesize + "H0z\"/>";
13799
+ const path = "<path " + getColorAttrib(opts.color.dark, "stroke") + " d=\"" + qrToPath(data, size, opts.margin) + "\"/>";
13800
+ const viewBox = "viewBox=\"0 0 " + qrcodesize + " " + qrcodesize + "\"";
13801
+ const svgTag = "<svg xmlns=\"http://www.w3.org/2000/svg\" " + (!opts.width ? "" : "width=\"" + opts.width + "\" height=\"" + opts.width + "\" ") + viewBox + " shape-rendering=\"crispEdges\">" + bg + path + "</svg>\n";
13802
+ if (typeof cb === "function") cb(null, svgTag);
13803
+ return svgTag;
13804
+ };
13805
+ }));
13806
+ //#endregion
13807
+ //#region components/spin/index.tsx
13808
+ var import_browser = (/* @__PURE__ */ __commonJSMin(((exports) => {
13809
+ var canPromise = require_can_promise();
13810
+ var QRCode = require_qrcode();
13811
+ var CanvasRenderer = require_canvas();
13812
+ var SvgRenderer = require_svg_tag();
13813
+ function renderCanvas(renderFunc, canvas, text, opts, cb) {
13814
+ const args = [].slice.call(arguments, 1);
13815
+ const argsNum = args.length;
13816
+ const isLastArgCb = typeof args[argsNum - 1] === "function";
13817
+ if (!isLastArgCb && !canPromise()) throw new Error("Callback required as last argument");
13818
+ if (isLastArgCb) {
13819
+ if (argsNum < 2) throw new Error("Too few arguments provided");
13820
+ if (argsNum === 2) {
13821
+ cb = text;
13822
+ text = canvas;
13823
+ canvas = opts = void 0;
13824
+ } else if (argsNum === 3) if (canvas.getContext && typeof cb === "undefined") {
13825
+ cb = opts;
13826
+ opts = void 0;
13827
+ } else {
13828
+ cb = opts;
13829
+ opts = text;
13830
+ text = canvas;
13831
+ canvas = void 0;
13832
+ }
13833
+ } else {
13834
+ if (argsNum < 1) throw new Error("Too few arguments provided");
13835
+ if (argsNum === 1) {
13836
+ text = canvas;
13837
+ canvas = opts = void 0;
13838
+ } else if (argsNum === 2 && !canvas.getContext) {
13839
+ opts = text;
13840
+ text = canvas;
13841
+ canvas = void 0;
13842
+ }
13843
+ return new Promise(function(resolve, reject) {
13844
+ try {
13845
+ resolve(renderFunc(QRCode.create(text, opts), canvas, opts));
13846
+ } catch (e) {
13847
+ reject(e);
13848
+ }
13849
+ });
13850
+ }
13851
+ try {
13852
+ const data = QRCode.create(text, opts);
13853
+ cb(null, renderFunc(data, canvas, opts));
13854
+ } catch (e) {
13855
+ cb(e);
13856
+ }
13857
+ }
13858
+ exports.create = QRCode.create;
13859
+ exports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render);
13860
+ exports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL);
13861
+ exports.toString = renderCanvas.bind(null, function(data, _, opts) {
13862
+ return SvgRenderer.render(data, opts);
13863
+ });
13864
+ })))();
13865
+ var Spin = /* @__PURE__ */ defineComponent({
13866
+ name: "Spin",
13867
+ props: {
13868
+ modelValue: {
13869
+ type: Boolean,
13870
+ default: true
13871
+ },
13872
+ delay: {
13873
+ type: Number,
13874
+ default: 500
13875
+ },
13876
+ size: { type: String },
13877
+ mode: {
13878
+ type: String,
13879
+ default: "rotate"
13880
+ }
13881
+ },
13882
+ setup(props, { slots }) {
13883
+ const spinning = ref(props.modelValue);
13884
+ let timer;
13885
+ watch(() => props.modelValue, (nv) => {
13886
+ if (nv) spinning.value = nv;
13887
+ else {
13888
+ clearTimeout(timer);
13889
+ timer = setTimeout(() => {
13890
+ spinning.value = nv;
13891
+ }, props.delay);
13892
+ }
13893
+ });
13894
+ return () => {
13895
+ let { mode, size } = props;
13896
+ const classes = [{
13897
+ [`k-spin-loading`]: spinning.value,
13898
+ [`k-spin-${mode}`]: mode && spinning.value
13899
+ }];
13900
+ const children = slots.default?.();
13901
+ const root = ["k-spin", {
13902
+ [`k-spin-lg`]: size == "large",
13903
+ [`k-spin-sm`]: size == "small",
13904
+ [`k-spin-only`]: children == null
13905
+ }];
13906
+ const spin = createVNode("div", { "class": classes }, null);
13907
+ return createVNode("div", { "class": root }, [[spin, children]]);
13908
+ };
13909
+ }
13910
+ });
13911
+ //#endregion
13912
+ //#region components/qrcode/index.tsx
13913
+ var QRCode = /* @__PURE__ */ defineComponent({
13914
+ name: "QRCode",
13915
+ props: {
13916
+ value: {
13917
+ type: String,
13918
+ required: true
13919
+ },
13920
+ size: {
13921
+ type: Number,
13922
+ default: 160
13923
+ },
13924
+ colorDark: {
13925
+ type: String,
13926
+ default: "var(--kui-color-reverse)"
13927
+ },
13928
+ colorLight: {
13929
+ type: String,
13930
+ default: "var(--kui-color-bg)"
13931
+ },
13932
+ bordered: {
13933
+ type: Boolean,
13934
+ default: true
13935
+ },
13936
+ status: {
13937
+ type: String,
13938
+ default: "active"
13939
+ },
13940
+ logo: {
13941
+ type: String,
13942
+ default: ""
13943
+ },
13944
+ logoSize: { type: Number },
13945
+ margin: {
13946
+ type: Number,
13947
+ default: 0
13948
+ },
13949
+ logoRadius: {
13950
+ type: Number,
13951
+ default: 4
13952
+ },
13953
+ logoBorder: {
13954
+ type: Boolean,
13955
+ default: true
13956
+ },
13957
+ errorLevel: {
13958
+ type: String,
13959
+ default: "M"
13960
+ }
13961
+ },
13962
+ emits: ["refresh"],
13963
+ setup(props, { emit, slots, expose }) {
13964
+ const canvasRef = ref(null);
13965
+ let rootObserver = null;
13966
+ const injectedLocale = inject("locale", zh_CN_default);
13967
+ const locale = computed(() => {
13968
+ return injectedLocale instanceof Object && "value" in injectedLocale ? injectedLocale.value : injectedLocale;
13969
+ });
13970
+ const initThemeObserver = () => {
13971
+ const rootEl = document.documentElement;
13972
+ rootObserver = new MutationObserver((mutations) => {
13973
+ for (const mutation of mutations) if (mutation.type === "attributes" && mutation.attributeName === "theme-mode") {
13974
+ drawQRCode();
13975
+ break;
13976
+ }
13977
+ });
13978
+ rootObserver.observe(rootEl, {
13979
+ attributes: true,
13980
+ attributeFilter: ["theme-mode"]
13981
+ });
13982
+ };
13983
+ const parseCssVariable = (colorStr) => {
13984
+ if (colorStr.trim().startsWith("var(")) {
13985
+ const tempDiv = document.createElement("div");
13986
+ tempDiv.style.color = colorStr;
13987
+ document.body.appendChild(tempDiv);
13988
+ let computedColor = window.getComputedStyle(tempDiv).color;
13989
+ computedColor = Color(computedColor).hex();
13990
+ document.body.removeChild(tempDiv);
13991
+ return computedColor || "#000000";
13992
+ }
13993
+ return colorStr;
13994
+ };
13995
+ const drawQRCode = async () => {
13996
+ if (!canvasRef.value) return;
13997
+ const canvas = canvasRef.value;
13998
+ const ctx = canvas.getContext("2d");
13999
+ if (!ctx) return;
14000
+ const { size, value, logo, logoRadius, logoBorder, errorLevel } = props;
14001
+ const ratio = window.devicePixelRatio || 1;
14002
+ canvas.width = size * ratio;
14003
+ canvas.height = size * ratio;
14004
+ ctx.scale(ratio, ratio);
14005
+ try {
14006
+ const realDark = parseCssVariable(props.colorDark);
14007
+ const realLight = parseCssVariable(props.colorLight);
14008
+ const options = {
14009
+ width: size,
14010
+ margin: props.margin,
14011
+ color: {
14012
+ dark: realDark,
14013
+ light: realLight
14014
+ },
14015
+ errorCorrectionLevel: errorLevel
14016
+ };
14017
+ const memCanvas = document.createElement("canvas");
14018
+ await (0, import_browser.toCanvas)(memCanvas, value || " ", options);
14019
+ ctx.drawImage(memCanvas, 0, 0, size, size);
14020
+ if (logo) {
14021
+ const img = new Image();
14022
+ img.crossOrigin = "anonymous";
14023
+ img.src = logo;
14024
+ img.onload = () => {
14025
+ const computedLogoSize = props.logoSize || size * .22;
14026
+ const x = (size - computedLogoSize) / 2;
14027
+ const y = (size - computedLogoSize) / 2;
14028
+ ctx.save();
14029
+ if (logoBorder) {
14030
+ ctx.fillStyle = realLight;
14031
+ const borderSize = computedLogoSize + 6;
14032
+ const bx = (size - borderSize) / 2;
14033
+ const by = (size - borderSize) / 2;
14034
+ ctx.beginPath();
14035
+ ctx.roundRect(bx, by, borderSize, borderSize, logoRadius + 2);
14036
+ ctx.fill();
14037
+ }
14038
+ ctx.beginPath();
14039
+ ctx.roundRect(x, y, computedLogoSize, computedLogoSize, logoRadius);
14040
+ ctx.clip();
14041
+ ctx.drawImage(img, x, y, computedLogoSize, computedLogoSize);
14042
+ ctx.restore();
14043
+ };
14044
+ }
14045
+ } catch (err) {
14046
+ console.error("二维码生成失败: ", err);
14047
+ }
14048
+ };
14049
+ const download = (fileName = "qrcode.png") => {
14050
+ if (!canvasRef.value) return;
14051
+ const url = canvasRef.value.toDataURL("image/png");
14052
+ const a = document.createElement("a");
14053
+ a.download = fileName;
14054
+ a.href = url;
14055
+ a.click();
14056
+ };
14057
+ watch(() => [
14058
+ props.value,
14059
+ props.size,
14060
+ props.colorDark,
14061
+ props.colorLight,
14062
+ props.logo,
14063
+ props.status,
14064
+ props.margin,
14065
+ props.errorLevel
14066
+ ], () => {
14067
+ if (props.status === "active") drawQRCode();
14068
+ }, { deep: true });
14069
+ expose({ download });
14070
+ onMounted(() => {
14071
+ drawQRCode();
14072
+ initThemeObserver();
14073
+ });
14074
+ onBeforeUnmount(() => {
14075
+ if (rootObserver) rootObserver.disconnect();
14076
+ });
14077
+ const renderMask = () => {
14078
+ if (props.status === "active") return null;
14079
+ return createVNode("div", { "class": "k-qrcode-mask" }, [
14080
+ props.status === "loading" && createVNode("div", { "class": "k-qrcode-loading-wrapper" }, [slots.loading ? slots.loading() : [createVNode(Spin, { "size": "small" }, null), createVNode("span", null, [locale.value?.k.qrcode.loading])]]),
14081
+ props.status === "expired" && createVNode("div", {
14082
+ "class": "k-qrcode-expired-wrapper",
14083
+ "onClick": () => emit("refresh")
14084
+ }, [slots.expired ? slots.expired() : createVNode(Fragment, null, [createVNode("div", { "class": "k-qrcode-expired" }, [locale.value?.k.qrcode.expired]), createVNode(Button, {
14085
+ "size": "small",
14086
+ "type": "text"
14087
+ }, { default: () => [locale.value?.k.qrcode.refresh] })])]),
14088
+ props.status === "scanned" && createVNode("div", { "class": "k-qrcode-scanned-wrapper" }, [slots.scanned ? slots.scanned() : createVNode(Fragment, null, [locale.value?.k.qrcode.scanned])])
14089
+ ]);
14090
+ };
14091
+ return () => {
14092
+ return createVNode("div", {
14093
+ "style": {
14094
+ width: `${props.size}px`,
14095
+ height: `${props.size}px`
14096
+ },
14097
+ "class": ["k-qrcode", { "k-qrcode-borderless": props.bordered === false }]
14098
+ }, [createVNode("canvas", {
14099
+ "ref": canvasRef,
14100
+ "style": {
14101
+ width: `${props.size}px`,
14102
+ height: `${props.size}px`,
14103
+ display: "block"
14104
+ }
14105
+ }, null), renderMask()]);
14106
+ };
14107
+ }
14108
+ });
14109
+ //#endregion
14110
+ //#region components/radio/radio.tsx
14111
+ var Radio = /* @__PURE__ */ defineComponent({
14112
+ name: "Radio",
14113
+ props: {
14114
+ modelValue: {
14115
+ type: [
14116
+ Boolean,
14117
+ String,
14118
+ Number
14119
+ ],
14120
+ default: false
14121
+ },
14122
+ value: { type: [
14123
+ String,
14124
+ Number,
14125
+ Boolean
14126
+ ] },
14127
+ label: { type: String },
14128
+ checked: Boolean,
14129
+ disabled: Boolean,
14130
+ theme: {
14131
+ type: String,
14132
+ default: "fill"
14133
+ },
14134
+ size: { type: String },
14135
+ onChange: Function
14136
+ },
14137
+ setup(props, { slots, emit }) {
14138
+ const isChecked = ref(props.modelValue || props.checked);
14139
+ watch(() => props.modelValue, (v) => {
14140
+ isChecked.value = v;
14141
+ });
14142
+ watch(() => props.checked, (v) => {
14143
+ isChecked.value = v;
14144
+ });
14145
+ const emitValue = (checked) => {
14146
+ isChecked.value = checked;
14147
+ emit("change", {
14148
+ checked,
14149
+ value: props.value,
14150
+ label: props.label || slots.default?.()
14151
+ });
14152
+ emit("update:modelValue", checked);
14153
+ emit("update:checked", checked);
14154
+ };
14155
+ const onChange = (e) => {
14156
+ if (props.disabled || isChecked.value) return;
14157
+ e.stopPropagation();
14158
+ e.preventDefault();
14159
+ const checked = e.target.checked;
14160
+ emitValue(checked);
14161
+ };
14162
+ const triggerCheck = (e) => {
14163
+ if (e.code == "Space") {
14164
+ e.preventDefault();
14165
+ e.stopPropagation();
14166
+ if (props.disabled || isChecked.value) return;
14167
+ emitValue(!isChecked.value);
14168
+ }
14169
+ };
14170
+ return () => {
14171
+ const classes = ["k-radio", {
14172
+ ["k-radio-fill"]: props.theme == "fill",
14173
+ ["k-radio-disabled"]: props.disabled,
14174
+ ["k-radio-checked"]: isChecked.value,
14175
+ ["k-radio-lg"]: props.size === "large",
14176
+ ["k-radio-sm"]: props.size === "small"
14177
+ }];
14178
+ const labelNode = props.label || slots.default?.();
14179
+ return createVNode("label", {
14180
+ "class": classes,
14181
+ "tabindex": props.disabled ? void 0 : 0,
14182
+ "onKeydown": triggerCheck
14183
+ }, [createVNode("span", { "class": "k-radio-symbol" }, [createVNode("input", {
14184
+ "type": "radio",
14185
+ "tabindex": "-1",
14186
+ "class": "k-radio-input",
14187
+ "disabled": props.disabled,
14188
+ "onChange": onChange,
14189
+ "checked": isChecked.value
14190
+ }, null)]), labelNode ? createVNode("span", { "class": "k-radio-label" }, [labelNode]) : null]);
14191
+ };
14192
+ }
14193
+ });
14194
+ //#endregion
14195
+ //#region components/radio/radio-button.tsx
14196
+ function _isSlot$2(s) {
14197
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
14198
+ }
14199
+ var RadioButton = /* @__PURE__ */ defineComponent({
14200
+ name: "RadioButton",
14201
+ props: {
14202
+ modelValue: {
14203
+ type: [Boolean],
14204
+ default: false
14205
+ },
14206
+ label: { type: String },
14207
+ value: { type: [String, Number] },
14208
+ theme: String,
14209
+ disabled: Boolean,
14210
+ checked: Boolean,
14211
+ icon: Array,
14212
+ size: { type: String },
14213
+ shape: { type: String },
14214
+ onChange: Function
11425
14215
  },
11426
14216
  setup(props, { slots, emit, attrs }) {
11427
14217
  const isChecked = ref(props.modelValue || props.checked);
@@ -11458,6 +14248,8 @@ var RadioButton = /* @__PURE__ */ defineComponent({
11458
14248
  };
11459
14249
  }
11460
14250
  });
14251
+ //#endregion
14252
+ //#region components/radio/radio-group.tsx
11461
14253
  var RadioGroup = /* @__PURE__ */ defineComponent({
11462
14254
  name: "RadioGroup",
11463
14255
  props: {
@@ -11654,6 +14446,8 @@ var star_default = /* @__PURE__ */ defineComponent({
11654
14446
  };
11655
14447
  }
11656
14448
  });
14449
+ //#endregion
14450
+ //#region components/rate/index.tsx
11657
14451
  var Rate = /* @__PURE__ */ defineComponent({
11658
14452
  name: "Rate",
11659
14453
  props: {
@@ -11694,8 +14488,10 @@ var Rate = /* @__PURE__ */ defineComponent({
11694
14488
  const update = (t, index, percent) => {
11695
14489
  if (t === "M") {
11696
14490
  if (cleared.value) return;
11697
- if (props.allowHalf) tempValue.value = index - (percent < .5 ? .5 : 0);
11698
- else tempValue.value = index;
14491
+ if (props.allowHalf) {
14492
+ const value = index - (percent < .5 ? .5 : 0);
14493
+ tempValue.value = value;
14494
+ } else tempValue.value = index;
11699
14495
  } else {
11700
14496
  let value = index - (props.allowHalf ? percent < .5 ? .5 : 0 : 0);
11701
14497
  value = parseFloat(value.toFixed(2));
@@ -12447,6 +15243,8 @@ var CountUpNumber = /* @__PURE__ */ defineComponent({
12447
15243
  }, null);
12448
15244
  }
12449
15245
  });
15246
+ //#endregion
15247
+ //#region components/stat-card/stat-number.tsx
12450
15248
  var StatNumber = /* @__PURE__ */ defineComponent({
12451
15249
  name: "StatNumber",
12452
15250
  props: {
@@ -12500,6 +15298,8 @@ var StatNumber = /* @__PURE__ */ defineComponent({
12500
15298
  };
12501
15299
  }
12502
15300
  });
15301
+ //#endregion
15302
+ //#region components/stat-card/stat-card.tsx
12503
15303
  var StatCard = /* @__PURE__ */ defineComponent({
12504
15304
  name: "StatCard",
12505
15305
  props: {
@@ -12541,6 +15341,8 @@ var StatCard = /* @__PURE__ */ defineComponent({
12541
15341
  };
12542
15342
  }
12543
15343
  });
15344
+ //#endregion
15345
+ //#region components/space/index.tsx
12544
15346
  var Space = /* @__PURE__ */ defineComponent({
12545
15347
  name: "Space",
12546
15348
  props: {
@@ -12606,117 +15408,197 @@ var Space = /* @__PURE__ */ defineComponent({
12606
15408
  };
12607
15409
  }
12608
15410
  });
12609
- var Spin = /* @__PURE__ */ defineComponent({
12610
- name: "Spin",
15411
+ //#endregion
15412
+ //#region components/switch/index.tsx
15413
+ var Switch = /* @__PURE__ */ defineComponent({
15414
+ name: "KSwitch",
12611
15415
  props: {
12612
- modelValue: {
15416
+ checked: {
12613
15417
  type: Boolean,
12614
- default: true
15418
+ default: false
12615
15419
  },
12616
- delay: {
12617
- type: Number,
12618
- default: 500
15420
+ valueType: {
15421
+ type: String,
15422
+ default: "boolean"
12619
15423
  },
15424
+ modelValue: { type: [
15425
+ String,
15426
+ Number,
15427
+ Boolean
15428
+ ] },
15429
+ type: String,
15430
+ disabled: Boolean,
15431
+ loading: Boolean,
12620
15432
  size: { type: String },
12621
- mode: {
12622
- type: String,
12623
- default: "rotate"
12624
- }
15433
+ trueText: String,
15434
+ falseText: String,
15435
+ onChange: Function
12625
15436
  },
12626
- setup(props, { slots }) {
12627
- const spinning = ref(props.modelValue);
12628
- let timer;
15437
+ setup(props, { slots, emit }) {
15438
+ const isChecked = ref(props.modelValue || props.checked);
12629
15439
  watch(() => props.modelValue, (nv) => {
12630
- if (nv) spinning.value = nv;
12631
- else {
12632
- clearTimeout(timer);
12633
- timer = setTimeout(() => {
12634
- spinning.value = nv;
12635
- }, props.delay);
12636
- }
15440
+ isChecked.value = nv == 1;
15441
+ });
15442
+ watch(() => props.checked, (nv) => {
15443
+ isChecked.value = nv;
12637
15444
  });
15445
+ const change = () => {
15446
+ if (props.disabled) return false;
15447
+ const checked = !isChecked.value;
15448
+ isChecked.value = checked;
15449
+ const value = getValueWithType(checked, props.valueType);
15450
+ emit("update:modelValue", value);
15451
+ emit("update:checked", checked);
15452
+ emit("change", value);
15453
+ };
12638
15454
  return () => {
12639
- let { mode, size } = props;
12640
- const classes = [{
12641
- [`k-spin-loading`]: spinning.value,
12642
- [`k-spin-${mode}`]: mode && spinning.value
12643
- }];
12644
- const children = slots.default?.();
12645
- const root = ["k-spin", {
12646
- [`k-spin-lg`]: size == "large",
12647
- [`k-spin-sm`]: size == "small",
12648
- [`k-spin-only`]: children == null
15455
+ const { type, trueText, falseText, disabled, loading, size } = props;
15456
+ const classes = ["k-switch", {
15457
+ ["k-switch-checked"]: isChecked.value,
15458
+ ["k-switch-disabled"]: disabled || loading,
15459
+ [`k-switch-${type}`]: !!type,
15460
+ ["k-switch-sm"]: props.size == "small"
12649
15461
  }];
12650
- const spin = createVNode("div", { "class": classes }, null);
12651
- return createVNode("div", { "class": root }, [[spin, children]]);
15462
+ const children = slots.checked?.() || trueText || slots.unchecked?.() || falseText;
15463
+ const loadNode = loading ? createVNode(Icon, {
15464
+ "spin": true,
15465
+ "type": Loading,
15466
+ "class": "k-switch-loading"
15467
+ }, null) : null;
15468
+ const textNode = size != "small" && children ? createVNode("span", { "class": "k-switch-inner" }, [isChecked.value ? slots.checked?.() || trueText : slots.unchecked?.() || falseText]) : null;
15469
+ return createVNode("button", {
15470
+ "class": classes,
15471
+ "onClick": change,
15472
+ "disabled": disabled || loading,
15473
+ "type": "button"
15474
+ }, [textNode, loadNode]);
15475
+ };
15476
+ }
15477
+ });
15478
+ var Splitter = /* @__PURE__ */ defineComponent({
15479
+ name: "Splitter",
15480
+ props: {
15481
+ direction: {
15482
+ type: String,
15483
+ default: "horizontal"
15484
+ },
15485
+ onResize: Function,
15486
+ onResizeEnd: Function,
15487
+ onResizeStart: Function
15488
+ },
15489
+ setup(props, { slots, emit }) {
15490
+ const containerRef = ref(null);
15491
+ const isDragging = ref(false);
15492
+ const activeResizerIndex = ref(null);
15493
+ const panelSizes = ref([]);
15494
+ const minSizes = ref([]);
15495
+ const maxSizes = ref([]);
15496
+ const parseToPx = (val, total) => {
15497
+ if (val === void 0 || val === null || val === "") return null;
15498
+ const s = String(val).trim();
15499
+ if (s.endsWith("%")) return parseFloat(s) / 100 * total;
15500
+ if (s.endsWith("px")) return parseFloat(s);
15501
+ if (!isNaN(Number(s))) return parseFloat(s) / 100 * total;
15502
+ return null;
15503
+ };
15504
+ const initSizes = () => {
15505
+ if (!containerRef.value) return;
15506
+ const rect = containerRef.value.getBoundingClientRect();
15507
+ const children = slots.default?.() || [];
15508
+ const totalSize = (props.direction === "horizontal" ? rect.width : rect.height) - (children.length - 1) * 4;
15509
+ minSizes.value = children.map((c) => parseToPx(c.props?.min, totalSize) ?? 0);
15510
+ maxSizes.value = children.map((c) => parseToPx(c.props?.max, totalSize) ?? totalSize);
15511
+ const rawSizes = children.map((c) => parseToPx(c.props?.size, totalSize));
15512
+ const definedSum = rawSizes.reduce((acc, s) => (acc ?? 0) + (s ?? 0), 0) || 0;
15513
+ const undefinedCount = rawSizes.filter((s) => s === null).length;
15514
+ const spare = Math.max(0, totalSize - definedSum);
15515
+ const autoSize = undefinedCount > 0 ? spare / undefinedCount : 0;
15516
+ panelSizes.value = rawSizes.map((s) => s ?? autoSize);
15517
+ };
15518
+ const onMouseDown = (index) => {
15519
+ isDragging.value = true;
15520
+ activeResizerIndex.value = index;
15521
+ document.addEventListener("mousemove", onMouseMove);
15522
+ document.addEventListener("mouseup", onMouseUp);
15523
+ document.body.style.cursor = props.direction === "horizontal" ? "col-resize" : "row-resize";
15524
+ document.body.classList.add("k-splitter-dragging");
15525
+ emitSize("resizeStart");
15526
+ };
15527
+ const emitSize = (type) => {
15528
+ emit(type, panelSizes.value.map((x) => parseFloat(x.toFixed(3))));
15529
+ };
15530
+ const onMouseMove = (e) => {
15531
+ if (!isDragging.value || activeResizerIndex.value === null || !containerRef.value) return;
15532
+ const rect = containerRef.value.getBoundingClientRect();
15533
+ const idx = activeResizerIndex.value;
15534
+ const children = slots.default?.() || [];
15535
+ const resizerWidth = 4;
15536
+ const totalResizersWidth = (children.length - 1) * resizerWidth;
15537
+ const totalAvailableSize = (props.direction === "horizontal" ? rect.width : rect.height) - totalResizersWidth;
15538
+ const resizersBefore = idx * resizerWidth;
15539
+ let currentPos = (props.direction === "horizontal" ? e.clientX - rect.left : e.clientY - rect.top) - resizersBefore;
15540
+ currentPos = Math.max(0, Math.min(totalAvailableSize, currentPos));
15541
+ const pairTotal = panelSizes.value[idx] + panelSizes.value[idx + 1];
15542
+ const offset = panelSizes.value.slice(0, idx).reduce((a, b) => a + b, 0);
15543
+ let newSizeIdx = currentPos - offset;
15544
+ newSizeIdx = Math.max(minSizes.value[idx], Math.min(maxSizes.value[idx], newSizeIdx));
15545
+ const maxAllowed = pairTotal - minSizes.value[idx + 1];
15546
+ newSizeIdx = Math.min(newSizeIdx, maxAllowed);
15547
+ panelSizes.value[idx] = newSizeIdx;
15548
+ panelSizes.value[idx + 1] = pairTotal - newSizeIdx;
15549
+ emitSize("resize");
15550
+ };
15551
+ const onMouseUp = () => {
15552
+ isDragging.value = false;
15553
+ activeResizerIndex.value = null;
15554
+ document.removeEventListener("mousemove", onMouseMove);
15555
+ document.removeEventListener("mouseup", onMouseUp);
15556
+ document.body.style.cursor = "";
15557
+ document.body.classList.remove("k-splitter-dragging");
15558
+ emitSize("resizeEnd");
15559
+ };
15560
+ let ob = null;
15561
+ onMounted(() => {
15562
+ initSizes();
15563
+ ob = new ResizeObserver(() => initSizes());
15564
+ if (containerRef.value) ob.observe(containerRef.value);
15565
+ });
15566
+ onUnmounted(() => ob?.disconnect());
15567
+ return () => {
15568
+ const children = slots.default?.() || [];
15569
+ return createVNode("div", {
15570
+ "ref": containerRef,
15571
+ "class": ["k-splitter", `is-${props.direction}`]
15572
+ }, [children.map((child, index) => {
15573
+ const isLast = index === children.length - 1;
15574
+ return createVNode(Fragment, null, [createVNode("div", {
15575
+ "class": "k-splitter-item",
15576
+ "style": {
15577
+ flexBasis: `${panelSizes.value[index]}px`,
15578
+ flexGrow: 0,
15579
+ flexShrink: 0
15580
+ }
15581
+ }, [child]), !isLast && createVNode("div", {
15582
+ "class": "k-splitter-resizer",
15583
+ "onMousedown": () => onMouseDown(index)
15584
+ }, null)]);
15585
+ })]);
12652
15586
  };
12653
15587
  }
12654
15588
  });
12655
- var Switch = /* @__PURE__ */ defineComponent({
12656
- name: "KSwitch",
15589
+ var SplitterPanel = /* @__PURE__ */ defineComponent({
15590
+ name: "SplitterPanel",
12657
15591
  props: {
12658
- checked: {
12659
- type: Boolean,
12660
- default: false
12661
- },
12662
- valueType: {
12663
- type: String,
12664
- default: "boolean"
12665
- },
12666
- modelValue: { type: [
12667
- String,
12668
- Number,
12669
- Boolean
12670
- ] },
12671
- type: String,
12672
- disabled: Boolean,
12673
- loading: Boolean,
12674
- size: { type: String },
12675
- trueText: String,
12676
- falseText: String,
12677
- onChange: Function
15592
+ size: { type: [Number, String] },
15593
+ min: { type: [Number, String] },
15594
+ max: { type: [Number, String] }
12678
15595
  },
12679
- setup(props, { slots, emit }) {
12680
- const isChecked = ref(props.modelValue || props.checked);
12681
- watch(() => props.modelValue, (nv) => {
12682
- isChecked.value = nv == 1;
12683
- });
12684
- watch(() => props.checked, (nv) => {
12685
- isChecked.value = nv;
12686
- });
12687
- const change = () => {
12688
- if (props.disabled) return false;
12689
- const checked = !isChecked.value;
12690
- isChecked.value = checked;
12691
- const value = getValueWithType(checked, props.valueType);
12692
- emit("update:modelValue", value);
12693
- emit("update:checked", checked);
12694
- emit("change", value);
12695
- };
12696
- return () => {
12697
- const { type, trueText, falseText, disabled, loading, size } = props;
12698
- const classes = ["k-switch", {
12699
- ["k-switch-checked"]: isChecked.value,
12700
- ["k-switch-disabled"]: disabled || loading,
12701
- [`k-switch-${type}`]: !!type,
12702
- ["k-switch-sm"]: props.size == "small"
12703
- }];
12704
- const children = slots.checked?.() || trueText || slots.unchecked?.() || falseText;
12705
- const loadNode = loading ? createVNode(Icon, {
12706
- "spin": true,
12707
- "type": Loading,
12708
- "class": "k-switch-loading"
12709
- }, null) : null;
12710
- const textNode = size != "small" && children ? createVNode("span", { "class": "k-switch-inner" }, [isChecked.value ? slots.checked?.() || trueText : slots.unchecked?.() || falseText]) : null;
12711
- return createVNode("button", {
12712
- "class": classes,
12713
- "onClick": change,
12714
- "disabled": disabled || loading,
12715
- "type": "button"
12716
- }, [textNode, loadNode]);
12717
- };
15596
+ setup(_, { slots }) {
15597
+ return () => createVNode("div", { "class": "k-splitter-panel" }, [slots.default?.()]);
12718
15598
  }
12719
15599
  });
15600
+ //#endregion
15601
+ //#region components/table/index.tsx
12720
15602
  var Table = /* @__PURE__ */ defineComponent({
12721
15603
  name: "Table",
12722
15604
  props: {
@@ -13123,6 +16005,8 @@ var Table = /* @__PURE__ */ defineComponent({
13123
16005
  };
13124
16006
  }
13125
16007
  });
16008
+ //#endregion
16009
+ //#region components/tabs/tab-panel.tsx
13126
16010
  var TabPanel = /* @__PURE__ */ defineComponent({
13127
16011
  name: "TabPanel",
13128
16012
  props: {
@@ -13142,6 +16026,8 @@ var TabPanel = /* @__PURE__ */ defineComponent({
13142
16026
  };
13143
16027
  }
13144
16028
  });
16029
+ //#endregion
16030
+ //#region components/tabs/tabs.tsx
13145
16031
  var Tabs = /* @__PURE__ */ defineComponent({
13146
16032
  name: "Tabs",
13147
16033
  props: {
@@ -13247,7 +16133,8 @@ var Tabs = /* @__PURE__ */ defineComponent({
13247
16133
  };
13248
16134
  const updateIndex = () => {
13249
16135
  nextTick(() => {
13250
- currentIndex.value = getChildren(slots.default?.())?.map((p) => p.key).indexOf(defaultActiveKey.value);
16136
+ const nodes = getChildren(slots.default?.());
16137
+ currentIndex.value = nodes?.map((p) => p.key).indexOf(defaultActiveKey.value);
13251
16138
  resetActivePosition();
13252
16139
  updateInkBarPosition();
13253
16140
  });
@@ -13338,6 +16225,8 @@ var Tabs = /* @__PURE__ */ defineComponent({
13338
16225
  };
13339
16226
  }
13340
16227
  });
16228
+ //#endregion
16229
+ //#region components/time-line/timeline.tsx
13341
16230
  var TimeLine = /* @__PURE__ */ defineComponent({
13342
16231
  name: "TimeLine",
13343
16232
  props: { mode: {
@@ -13358,6 +16247,8 @@ var TimeLine = /* @__PURE__ */ defineComponent({
13358
16247
  };
13359
16248
  }
13360
16249
  });
16250
+ //#endregion
16251
+ //#region components/time-line/timeline-item.tsx
13361
16252
  var TimeLineItem = /* @__PURE__ */ defineComponent({
13362
16253
  name: "TimeLineItem",
13363
16254
  props: {
@@ -13925,6 +16816,8 @@ var Tree = /* @__PURE__ */ defineComponent({
13925
16816
  };
13926
16817
  }
13927
16818
  });
16819
+ //#endregion
16820
+ //#region components/tree-select/index.tsx
13928
16821
  var TreeSelect = /* @__PURE__ */ defineComponent({
13929
16822
  name: "TreeSelect",
13930
16823
  directives: {
@@ -14137,13 +17030,17 @@ var TreeSelect = /* @__PURE__ */ defineComponent({
14137
17030
  document.addEventListener("click", outsideClick);
14138
17031
  nextTick(() => {
14139
17032
  openChange(true);
14140
- updatePosition();
14141
- showQuery();
17033
+ nextTick(() => {
17034
+ updatePosition();
17035
+ showQuery();
17036
+ });
14142
17037
  });
14143
17038
  } else {
14144
17039
  openChange(show || !visible.value);
14145
17040
  if (visible.value) {
14146
- updatePosition();
17041
+ nextTick(() => {
17042
+ updatePosition();
17043
+ });
14147
17044
  showQuery();
14148
17045
  } else clearQuery();
14149
17046
  }
@@ -14365,6 +17262,8 @@ var TreeSelect = /* @__PURE__ */ defineComponent({
14365
17262
  };
14366
17263
  }
14367
17264
  });
17265
+ //#endregion
17266
+ //#region components/tag/index.tsx
14368
17267
  var Tag = /* @__PURE__ */ defineComponent({
14369
17268
  name: "Tag",
14370
17269
  props: {
@@ -14430,20 +17329,20 @@ var Tag = /* @__PURE__ */ defineComponent({
14430
17329
  }
14431
17330
  });
14432
17331
  //#endregion
14433
- //#region node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/stringify.js
17332
+ //#region node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/stringify.js
14434
17333
  var byteToHex = [];
14435
17334
  for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
14436
17335
  function unsafeStringify(arr, offset = 0) {
14437
17336
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
14438
17337
  }
14439
17338
  //#endregion
14440
- //#region node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/rng.js
14441
- var rnds8 = new Uint8Array(16);
17339
+ //#region node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/rng.js
17340
+ var rnds8 = /* @__PURE__ */ new Uint8Array(16);
14442
17341
  function rng() {
14443
17342
  return crypto.getRandomValues(rnds8);
14444
17343
  }
14445
17344
  //#endregion
14446
- //#region node_modules/.pnpm/uuid@14.0.0/node_modules/uuid/dist/v4.js
17345
+ //#region node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/v4.js
14447
17346
  function v4(options, buf, offset) {
14448
17347
  if (!buf && !options && crypto.randomUUID) return crypto.randomUUID();
14449
17348
  return _v4(options, buf, offset);
@@ -14628,6 +17527,8 @@ var selector_default = /* @__PURE__ */ defineComponent({
14628
17527
  };
14629
17528
  }
14630
17529
  });
17530
+ //#endregion
17531
+ //#region components/upload/index.tsx
14631
17532
  var Upload = /* @__PURE__ */ defineComponent({
14632
17533
  name: "Upload",
14633
17534
  props: {
@@ -14855,128 +17756,253 @@ var Upload = /* @__PURE__ */ defineComponent({
14855
17756
  };
14856
17757
  }
14857
17758
  });
14858
- var Splitter = /* @__PURE__ */ defineComponent({
14859
- name: "Splitter",
17759
+ //#endregion
17760
+ //#region components/watermark/index.tsx
17761
+ var Watermark = /* @__PURE__ */ defineComponent({
17762
+ name: "Watermark",
14860
17763
  props: {
14861
- direction: {
17764
+ content: {
17765
+ type: [String, Array],
17766
+ default: ""
17767
+ },
17768
+ image: {
14862
17769
  type: String,
14863
- default: "horizontal"
17770
+ default: ""
14864
17771
  },
14865
- onResize: Function,
14866
- onResizeEnd: Function,
14867
- onResizeStart: Function
17772
+ width: {
17773
+ type: Number,
17774
+ default: 240
17775
+ },
17776
+ height: {
17777
+ type: Number,
17778
+ default: 189
17779
+ },
17780
+ rotate: {
17781
+ type: Number,
17782
+ default: -22
17783
+ },
17784
+ zIndex: {
17785
+ type: Number,
17786
+ default: 999
17787
+ },
17788
+ fullscreen: {
17789
+ type: Boolean,
17790
+ default: false
17791
+ },
17792
+ antiTamper: {
17793
+ type: Boolean,
17794
+ default: true
17795
+ },
17796
+ font: {
17797
+ type: Object,
17798
+ default: () => ({
17799
+ color: "rgba(128, 128, 128, 0.15)",
17800
+ fontSize: 15,
17801
+ fontWeight: "normal",
17802
+ fontFamily: "sans-serif",
17803
+ fontStyle: "normal"
17804
+ })
17805
+ },
17806
+ gap: {
17807
+ type: Array,
17808
+ default: () => [40, 40]
17809
+ },
17810
+ offset: {
17811
+ type: Array,
17812
+ default: () => [20, 20]
17813
+ },
17814
+ layout: {
17815
+ type: String,
17816
+ default: "stagger"
17817
+ }
14868
17818
  },
14869
- setup(props, { slots, emit }) {
17819
+ setup(props, { slots }) {
14870
17820
  const containerRef = ref(null);
14871
- const isDragging = ref(false);
14872
- const activeResizerIndex = ref(null);
14873
- const panelSizes = ref([]);
14874
- const minSizes = ref([]);
14875
- const maxSizes = ref([]);
14876
- const parseToPx = (val, total) => {
14877
- if (val === void 0 || val === null || val === "") return null;
14878
- const s = String(val).trim();
14879
- if (s.endsWith("%")) return parseFloat(s) / 100 * total;
14880
- if (s.endsWith("px")) return parseFloat(s);
14881
- if (!isNaN(Number(s))) return parseFloat(s) / 100 * total;
14882
- return null;
14883
- };
14884
- const initSizes = () => {
14885
- if (!containerRef.value) return;
14886
- const rect = containerRef.value.getBoundingClientRect();
14887
- const children = slots.default?.() || [];
14888
- const totalSize = (props.direction === "horizontal" ? rect.width : rect.height) - (children.length - 1) * 4;
14889
- minSizes.value = children.map((c) => parseToPx(c.props?.min, totalSize) ?? 0);
14890
- maxSizes.value = children.map((c) => parseToPx(c.props?.max, totalSize) ?? totalSize);
14891
- const rawSizes = children.map((c) => parseToPx(c.props?.size, totalSize));
14892
- const definedSum = rawSizes.reduce((acc, s) => (acc ?? 0) + (s ?? 0), 0) || 0;
14893
- const undefinedCount = rawSizes.filter((s) => s === null).length;
14894
- const spare = Math.max(0, totalSize - definedSum);
14895
- const autoSize = undefinedCount > 0 ? spare / undefinedCount : 0;
14896
- panelSizes.value = rawSizes.map((s) => s ?? autoSize);
17821
+ const watermarkRef = ref(null);
17822
+ let parentObserver = null;
17823
+ let selfObserver = null;
17824
+ let base64Url = ref("");
17825
+ const createWatermarkBase64 = () => {
17826
+ return new Promise((resolve) => {
17827
+ const canvas = document.createElement("canvas");
17828
+ const ratio = window.devicePixelRatio || 1;
17829
+ const cellW = props.width + props.gap[0];
17830
+ const cellH = props.height + props.gap[1];
17831
+ const offsetX = props.offset?.[0] ?? 0;
17832
+ const offsetY = props.offset?.[1] ?? 0;
17833
+ const isStagger = props.layout === "stagger";
17834
+ const canvasWidth = isStagger ? cellW * 2 : cellW;
17835
+ const canvasHeight = isStagger ? cellH * 2 : cellH;
17836
+ canvas.width = canvasWidth * ratio;
17837
+ canvas.height = canvasHeight * ratio;
17838
+ const ctx = canvas.getContext("2d");
17839
+ if (!ctx) return resolve("");
17840
+ ctx.scale(ratio, ratio);
17841
+ const drawSingleCell = (ctx, centerX, centerY, imgObj) => {
17842
+ ctx.save();
17843
+ ctx.translate(centerX, centerY);
17844
+ ctx.rotate(props.rotate * Math.PI / 180);
17845
+ if (imgObj) ctx.drawImage(imgObj, -props.width / 2, -props.height / 2, props.width, props.height);
17846
+ else drawTextWatermark(ctx);
17847
+ ctx.restore();
17848
+ };
17849
+ const renderAllCells = (imgObj) => {
17850
+ if (isStagger) {
17851
+ drawSingleCell(ctx, cellW / 2 + offsetX, cellH / 2 + offsetY, imgObj);
17852
+ drawSingleCell(ctx, cellW + cellW / 2 + offsetX, cellH / 2 + offsetY, imgObj);
17853
+ drawSingleCell(ctx, 0 + offsetX, cellH + cellH / 2 + offsetY, imgObj);
17854
+ drawSingleCell(ctx, cellW + offsetX, cellH + cellH / 2 + offsetY, imgObj);
17855
+ drawSingleCell(ctx, cellW * 2 + offsetX, cellH + cellH / 2 + offsetY, imgObj);
17856
+ } else drawSingleCell(ctx, cellW / 2 + offsetX, cellH / 2 + offsetY, imgObj);
17857
+ resolve(canvas.toDataURL());
17858
+ };
17859
+ if (props.image) {
17860
+ const img = new Image();
17861
+ img.crossOrigin = "anonymous";
17862
+ img.src = props.image;
17863
+ img.onload = () => {
17864
+ renderAllCells(img);
17865
+ };
17866
+ img.onerror = () => {
17867
+ renderAllCells();
17868
+ };
17869
+ } else renderAllCells();
17870
+ });
14897
17871
  };
14898
- const onMouseDown = (index) => {
14899
- isDragging.value = true;
14900
- activeResizerIndex.value = index;
14901
- document.addEventListener("mousemove", onMouseMove);
14902
- document.addEventListener("mouseup", onMouseUp);
14903
- document.body.style.cursor = props.direction === "horizontal" ? "col-resize" : "row-resize";
14904
- document.body.classList.add("k-splitter-dragging");
14905
- emitSize("resizeStart");
17872
+ const drawTextWatermark = (ctx) => {
17873
+ const globalFont = {
17874
+ color: "rgba(128, 128, 128, 0.15)",
17875
+ fontSize: 15,
17876
+ fontWeight: "normal",
17877
+ fontStyle: "normal",
17878
+ fontFamily: "sans-serif",
17879
+ ...props.font
17880
+ };
17881
+ const contents = (Array.isArray(props.content) ? props.content : [props.content || ""]).map((item) => {
17882
+ if (typeof item === "string") return { text: item };
17883
+ return item;
17884
+ });
17885
+ ctx.textAlign = "center";
17886
+ ctx.textBaseline = "middle";
17887
+ let totalHeight = 0;
17888
+ const lineHeights = contents.map((item) => {
17889
+ return (item.fontSize || globalFont.fontSize) + 8;
17890
+ });
17891
+ totalHeight = lineHeights.reduce((a, b) => a + b, 0);
17892
+ let currentY = -totalHeight / 2;
17893
+ contents.forEach((item, index) => {
17894
+ const fSize = item.fontSize || globalFont.fontSize;
17895
+ const fWeight = item.fontWeight || globalFont.fontWeight;
17896
+ const fStyle = item.fontStyle || globalFont.fontStyle;
17897
+ const fColor = item.color || globalFont.color;
17898
+ ctx.font = `${fStyle} ${fWeight} ${fSize}px ${globalFont.fontFamily}`;
17899
+ ctx.fillStyle = fColor;
17900
+ const yOffset = currentY + lineHeights[index] / 2;
17901
+ ctx.fillText(item.text, 0, yOffset);
17902
+ currentY += lineHeights[index];
17903
+ });
14906
17904
  };
14907
- const emitSize = (type) => {
14908
- emit(type, panelSizes.value.map((x) => parseFloat(x.toFixed(3))));
17905
+ const renderWatermark = async () => {
17906
+ base64Url.value = await createWatermarkBase64();
17907
+ const targetContainer = props.fullscreen ? document.body : containerRef.value;
17908
+ if (!targetContainer) return;
17909
+ disconnectObservers();
17910
+ if (watermarkRef.value && watermarkRef.value.parentNode) watermarkRef.value.parentNode.removeChild(watermarkRef.value);
17911
+ const wmWrapper = document.createElement("div");
17912
+ const wmStyle = {
17913
+ position: props.fullscreen ? "fixed" : "absolute",
17914
+ left: "0",
17915
+ top: "0",
17916
+ width: "100%",
17917
+ height: "100%",
17918
+ pointerEvents: "none",
17919
+ zIndex: props.zIndex.toString(),
17920
+ margin: "0",
17921
+ padding: "0"
17922
+ };
17923
+ Object.assign(wmWrapper.style, wmStyle);
17924
+ wmWrapper.setAttribute("data-wm-root", "true");
17925
+ const shadowRoot = wmWrapper.attachShadow({ mode: "closed" });
17926
+ const wmInner = document.createElement("div");
17927
+ const cellW = props.width + props.gap[0];
17928
+ const cellH = props.height + props.gap[1];
17929
+ const isStagger = props.layout === "stagger";
17930
+ const innerStyle = {
17931
+ width: "100%",
17932
+ height: "100%",
17933
+ backgroundSize: `${isStagger ? cellW * 2 : cellW}px ${isStagger ? cellH * 2 : cellH}px`,
17934
+ backgroundImage: `url(${base64Url.value})`,
17935
+ backgroundRepeat: "repeat",
17936
+ pointerEvents: "none"
17937
+ };
17938
+ Object.assign(wmInner.style, innerStyle);
17939
+ shadowRoot.appendChild(wmInner);
17940
+ targetContainer.appendChild(wmWrapper);
17941
+ watermarkRef.value = wmWrapper;
17942
+ if (props.antiTamper) nextTick(() => {
17943
+ initAntiTamper(targetContainer, wmWrapper);
17944
+ });
14909
17945
  };
14910
- const onMouseMove = (e) => {
14911
- if (!isDragging.value || activeResizerIndex.value === null || !containerRef.value) return;
14912
- const rect = containerRef.value.getBoundingClientRect();
14913
- const idx = activeResizerIndex.value;
14914
- const children = slots.default?.() || [];
14915
- const resizerWidth = 4;
14916
- const totalResizersWidth = (children.length - 1) * resizerWidth;
14917
- const totalAvailableSize = (props.direction === "horizontal" ? rect.width : rect.height) - totalResizersWidth;
14918
- const resizersBefore = idx * resizerWidth;
14919
- let currentPos = (props.direction === "horizontal" ? e.clientX - rect.left : e.clientY - rect.top) - resizersBefore;
14920
- currentPos = Math.max(0, Math.min(totalAvailableSize, currentPos));
14921
- const pairTotal = panelSizes.value[idx] + panelSizes.value[idx + 1];
14922
- const offset = panelSizes.value.slice(0, idx).reduce((a, b) => a + b, 0);
14923
- let newSizeIdx = currentPos - offset;
14924
- newSizeIdx = Math.max(minSizes.value[idx], Math.min(maxSizes.value[idx], newSizeIdx));
14925
- const maxAllowed = pairTotal - minSizes.value[idx + 1];
14926
- newSizeIdx = Math.min(newSizeIdx, maxAllowed);
14927
- panelSizes.value[idx] = newSizeIdx;
14928
- panelSizes.value[idx + 1] = pairTotal - newSizeIdx;
14929
- emitSize("resize");
17946
+ const initAntiTamper = (parent, self) => {
17947
+ parentObserver = new MutationObserver((mutations) => {
17948
+ for (const mutation of mutations) if (Array.from(mutation.removedNodes).includes(self)) {
17949
+ renderWatermark();
17950
+ break;
17951
+ }
17952
+ });
17953
+ parentObserver.observe(parent, { childList: true });
17954
+ selfObserver = new MutationObserver((mutations) => {
17955
+ for (const mutation of mutations) if (mutation.type === "attributes") {
17956
+ renderWatermark();
17957
+ break;
17958
+ }
17959
+ });
17960
+ selfObserver.observe(self, {
17961
+ attributes: true,
17962
+ attributeFilter: [
17963
+ "style",
17964
+ "class",
17965
+ "id",
17966
+ "hidden"
17967
+ ]
17968
+ });
14930
17969
  };
14931
- const onMouseUp = () => {
14932
- isDragging.value = false;
14933
- activeResizerIndex.value = null;
14934
- document.removeEventListener("mousemove", onMouseMove);
14935
- document.removeEventListener("mouseup", onMouseUp);
14936
- document.body.style.cursor = "";
14937
- document.body.classList.remove("k-splitter-dragging");
14938
- emitSize("resizeEnd");
17970
+ const disconnectObservers = () => {
17971
+ if (parentObserver) parentObserver.disconnect();
17972
+ if (selfObserver) selfObserver.disconnect();
14939
17973
  };
14940
- let ob = null;
14941
- onMounted(() => {
14942
- initSizes();
14943
- ob = new ResizeObserver(() => initSizes());
14944
- if (containerRef.value) ob.observe(containerRef.value);
17974
+ watch(() => [
17975
+ props.content,
17976
+ props.image,
17977
+ props.width,
17978
+ props.height,
17979
+ props.rotate,
17980
+ props.gap,
17981
+ props.offset,
17982
+ props.font,
17983
+ props.layout
17984
+ ], () => {
17985
+ renderWatermark();
17986
+ }, { deep: true });
17987
+ onMounted(() => renderWatermark());
17988
+ onBeforeUnmount(() => {
17989
+ disconnectObservers();
17990
+ if (watermarkRef.value && watermarkRef.value.parentNode) watermarkRef.value.parentNode.removeChild(watermarkRef.value);
14945
17991
  });
14946
- onUnmounted(() => ob?.disconnect());
14947
17992
  return () => {
14948
- const children = slots.default?.() || [];
17993
+ if (props.fullscreen) return slots.default ? slots.default() : null;
14949
17994
  return createVNode("div", {
14950
17995
  "ref": containerRef,
14951
- "class": ["k-splitter", `is-${props.direction}`]
14952
- }, [children.map((child, index) => {
14953
- const isLast = index === children.length - 1;
14954
- return createVNode(Fragment, null, [createVNode("div", {
14955
- "class": "k-splitter-item",
14956
- "style": {
14957
- flexBasis: `${panelSizes.value[index]}px`,
14958
- flexGrow: 0,
14959
- flexShrink: 0
14960
- }
14961
- }, [child]), !isLast && createVNode("div", {
14962
- "class": "k-splitter-resizer",
14963
- "onMousedown": () => onMouseDown(index)
14964
- }, null)]);
14965
- })]);
17996
+ "style": {
17997
+ position: "relative",
17998
+ width: "100%",
17999
+ height: "100%"
18000
+ },
18001
+ "class": "k-watermark-container"
18002
+ }, [slots.default?.()]);
14966
18003
  };
14967
18004
  }
14968
18005
  });
14969
- var SplitterPanel = /* @__PURE__ */ defineComponent({
14970
- name: "SplitterPanel",
14971
- props: {
14972
- size: { type: [Number, String] },
14973
- min: { type: [Number, String] },
14974
- max: { type: [Number, String] }
14975
- },
14976
- setup(_, { slots }) {
14977
- return () => createVNode("div", { "class": "k-splitter-panel" }, [slots.default?.()]);
14978
- }
14979
- });
14980
18006
  //#endregion
14981
18007
  //#region components/utils/theme.ts
14982
18008
  var THEME_KEY = "theme-mode";
@@ -15080,6 +18106,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
15080
18106
  Popconfirm: () => Popconfirm,
15081
18107
  Poptip: () => Poptip,
15082
18108
  Progress: () => Progress,
18109
+ QRCode: () => QRCode,
15083
18110
  Radio: () => Radio,
15084
18111
  RadioButton: () => RadioButton,
15085
18112
  RadioGroup: () => RadioGroup,
@@ -15111,6 +18138,7 @@ var components_exports = /* @__PURE__ */ __exportAll({
15111
18138
  Tree: () => Tree,
15112
18139
  TreeSelect: () => TreeSelect,
15113
18140
  Upload: () => Upload,
18141
+ Watermark: () => Watermark,
15114
18142
  loading: () => loading,
15115
18143
  message: () => message,
15116
18144
  modal: () => modal,
@@ -15149,4 +18177,4 @@ var UI = {
15149
18177
  var install = UI.install;
15150
18178
  var version = UI.version;
15151
18179
  //#endregion
15152
- export { Affix, Alert, Anchor, AnchorLink, Avatar, AvatarGroup, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Col, Collapse, CollapsePanel, ColorPicker, ConfigProvider, Content, DatePicker, Descriptions, DescriptionsItem, Divider, Drawer, Dropdown, DropdownButton, Empty, Flex, Footer, Form, FormItem, Grid, GridItem, Header, Icon, ImageGroup, Input, InputGroup, InputNumber, KImage, Switch as KSwitch, Layout, Menu, MenuDivider, MenuGroup, MenuItem, modal_default as Modal, Option, Page, Popconfirm, Poptip, Progress, Radio, RadioButton, RadioGroup, Rate, Row, Select, Sider, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonText, Slider, Space, Spin, Splitter, SplitterPanel, StatCard, StatNumber, SubMenu, TabPanel, Table, Tabs, Tag, TextArea, TimeLine, TimeLineItem, Tooltip, Tree, TreeSelect, Upload, UI as default, install, loading, message, modal, notice, Theme as theme, version };
18180
+ export { Affix, Alert, Anchor, AnchorLink, Avatar, AvatarGroup, BackTop, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, Card, Carousel, CarouselItem, Checkbox, CheckboxGroup, Col, Collapse, CollapsePanel, ColorPicker, ConfigProvider, Content, DatePicker, Descriptions, DescriptionsItem, Divider, Drawer, Dropdown, DropdownButton, Empty, Flex, Footer, Form, FormItem, Grid, GridItem, Header, Icon, ImageGroup, Input, InputGroup, InputNumber, KImage, Switch as KSwitch, Layout, Menu, MenuDivider, MenuGroup, MenuItem, modal_default as Modal, Option, Page, Popconfirm, Poptip, Progress, QRCode, Radio, RadioButton, RadioGroup, Rate, Row, Select, Sider, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonText, Slider, Space, Spin, Splitter, SplitterPanel, StatCard, StatNumber, SubMenu, TabPanel, Table, Tabs, Tag, TextArea, TimeLine, TimeLineItem, Tooltip, Tree, TreeSelect, Upload, Watermark, UI as default, install, loading, message, modal, notice, Theme as theme, version };