warqadui 0.0.46 → 0.0.48

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.
package/dist/index.mjs CHANGED
@@ -4821,6 +4821,1429 @@ var storage = {
4821
4821
  return keys;
4822
4822
  }
4823
4823
  };
4824
+
4825
+ // src/hooks/uploads/useAntdImageUpload.tsx
4826
+ import { useState as useState18 } from "react";
4827
+
4828
+ // ../../node_modules/@ant-design/icons/es/components/Context.js
4829
+ import { createContext as createContext5 } from "react";
4830
+ var IconContext = /* @__PURE__ */ createContext5({});
4831
+ var Context_default = IconContext;
4832
+
4833
+ // ../../node_modules/@ant-design/icons/es/components/AntdIcon.js
4834
+ import * as React14 from "react";
4835
+ import { clsx as clsx2 } from "clsx";
4836
+
4837
+ // ../../node_modules/@ant-design/fast-color/es/presetColors.js
4838
+ var presetColors_default = {
4839
+ aliceblue: "9ehhb",
4840
+ antiquewhite: "9sgk7",
4841
+ aqua: "1ekf",
4842
+ aquamarine: "4zsno",
4843
+ azure: "9eiv3",
4844
+ beige: "9lhp8",
4845
+ bisque: "9zg04",
4846
+ black: "0",
4847
+ blanchedalmond: "9zhe5",
4848
+ blue: "73",
4849
+ blueviolet: "5e31e",
4850
+ brown: "6g016",
4851
+ burlywood: "8ouiv",
4852
+ cadetblue: "3qba8",
4853
+ chartreuse: "4zshs",
4854
+ chocolate: "87k0u",
4855
+ coral: "9yvyo",
4856
+ cornflowerblue: "3xael",
4857
+ cornsilk: "9zjz0",
4858
+ crimson: "8l4xo",
4859
+ cyan: "1ekf",
4860
+ darkblue: "3v",
4861
+ darkcyan: "rkb",
4862
+ darkgoldenrod: "776yz",
4863
+ darkgray: "6mbhl",
4864
+ darkgreen: "jr4",
4865
+ darkgrey: "6mbhl",
4866
+ darkkhaki: "7ehkb",
4867
+ darkmagenta: "5f91n",
4868
+ darkolivegreen: "3bzfz",
4869
+ darkorange: "9yygw",
4870
+ darkorchid: "5z6x8",
4871
+ darkred: "5f8xs",
4872
+ darksalmon: "9441m",
4873
+ darkseagreen: "5lwgf",
4874
+ darkslateblue: "2th1n",
4875
+ darkslategray: "1ugcv",
4876
+ darkslategrey: "1ugcv",
4877
+ darkturquoise: "14up",
4878
+ darkviolet: "5rw7n",
4879
+ deeppink: "9yavn",
4880
+ deepskyblue: "11xb",
4881
+ dimgray: "442g9",
4882
+ dimgrey: "442g9",
4883
+ dodgerblue: "16xof",
4884
+ firebrick: "6y7tu",
4885
+ floralwhite: "9zkds",
4886
+ forestgreen: "1cisi",
4887
+ fuchsia: "9y70f",
4888
+ gainsboro: "8m8kc",
4889
+ ghostwhite: "9pq0v",
4890
+ goldenrod: "8j4f4",
4891
+ gold: "9zda8",
4892
+ gray: "50i2o",
4893
+ green: "pa8",
4894
+ greenyellow: "6senj",
4895
+ grey: "50i2o",
4896
+ honeydew: "9eiuo",
4897
+ hotpink: "9yrp0",
4898
+ indianred: "80gnw",
4899
+ indigo: "2xcoy",
4900
+ ivory: "9zldc",
4901
+ khaki: "9edu4",
4902
+ lavenderblush: "9ziet",
4903
+ lavender: "90c8q",
4904
+ lawngreen: "4vk74",
4905
+ lemonchiffon: "9zkct",
4906
+ lightblue: "6s73a",
4907
+ lightcoral: "9dtog",
4908
+ lightcyan: "8s1rz",
4909
+ lightgoldenrodyellow: "9sjiq",
4910
+ lightgray: "89jo3",
4911
+ lightgreen: "5nkwg",
4912
+ lightgrey: "89jo3",
4913
+ lightpink: "9z6wx",
4914
+ lightsalmon: "9z2ii",
4915
+ lightseagreen: "19xgq",
4916
+ lightskyblue: "5arju",
4917
+ lightslategray: "4nwk9",
4918
+ lightslategrey: "4nwk9",
4919
+ lightsteelblue: "6wau6",
4920
+ lightyellow: "9zlcw",
4921
+ lime: "1edc",
4922
+ limegreen: "1zcxe",
4923
+ linen: "9shk6",
4924
+ magenta: "9y70f",
4925
+ maroon: "4zsow",
4926
+ mediumaquamarine: "40eju",
4927
+ mediumblue: "5p",
4928
+ mediumorchid: "79qkz",
4929
+ mediumpurple: "5r3rv",
4930
+ mediumseagreen: "2d9ip",
4931
+ mediumslateblue: "4tcku",
4932
+ mediumspringgreen: "1di2",
4933
+ mediumturquoise: "2uabw",
4934
+ mediumvioletred: "7rn9h",
4935
+ midnightblue: "z980",
4936
+ mintcream: "9ljp6",
4937
+ mistyrose: "9zg0x",
4938
+ moccasin: "9zfzp",
4939
+ navajowhite: "9zest",
4940
+ navy: "3k",
4941
+ oldlace: "9wq92",
4942
+ olive: "50hz4",
4943
+ olivedrab: "472ub",
4944
+ orange: "9z3eo",
4945
+ orangered: "9ykg0",
4946
+ orchid: "8iu3a",
4947
+ palegoldenrod: "9bl4a",
4948
+ palegreen: "5yw0o",
4949
+ paleturquoise: "6v4ku",
4950
+ palevioletred: "8k8lv",
4951
+ papayawhip: "9zi6t",
4952
+ peachpuff: "9ze0p",
4953
+ peru: "80oqn",
4954
+ pink: "9z8wb",
4955
+ plum: "8nba5",
4956
+ powderblue: "6wgdi",
4957
+ purple: "4zssg",
4958
+ rebeccapurple: "3zk49",
4959
+ red: "9y6tc",
4960
+ rosybrown: "7cv4f",
4961
+ royalblue: "2jvtt",
4962
+ saddlebrown: "5fmkz",
4963
+ salmon: "9rvci",
4964
+ sandybrown: "9jn1c",
4965
+ seagreen: "1tdnb",
4966
+ seashell: "9zje6",
4967
+ sienna: "6973h",
4968
+ silver: "7ir40",
4969
+ skyblue: "5arjf",
4970
+ slateblue: "45e4t",
4971
+ slategray: "4e100",
4972
+ slategrey: "4e100",
4973
+ snow: "9zke2",
4974
+ springgreen: "1egv",
4975
+ steelblue: "2r1kk",
4976
+ tan: "87yx8",
4977
+ teal: "pds",
4978
+ thistle: "8ggk8",
4979
+ tomato: "9yqfb",
4980
+ turquoise: "2j4r4",
4981
+ violet: "9b10u",
4982
+ wheat: "9ld4j",
4983
+ white: "9zldr",
4984
+ whitesmoke: "9lhpx",
4985
+ yellow: "9zl6o",
4986
+ yellowgreen: "61fzm"
4987
+ };
4988
+
4989
+ // ../../node_modules/@ant-design/fast-color/es/FastColor.js
4990
+ var round = Math.round;
4991
+ function splitColorStr(str, parseNum) {
4992
+ const match = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [];
4993
+ const numList = match.map((item) => parseFloat(item));
4994
+ for (let i = 0; i < 3; i += 1) {
4995
+ numList[i] = parseNum(numList[i] || 0, match[i] || "", i);
4996
+ }
4997
+ if (match[3]) {
4998
+ numList[3] = match[3].includes("%") ? numList[3] / 100 : numList[3];
4999
+ } else {
5000
+ numList[3] = 1;
5001
+ }
5002
+ return numList;
5003
+ }
5004
+ var parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
5005
+ function limitRange(value, max) {
5006
+ const mergedMax = max || 255;
5007
+ if (value > mergedMax) {
5008
+ return mergedMax;
5009
+ }
5010
+ if (value < 0) {
5011
+ return 0;
5012
+ }
5013
+ return value;
5014
+ }
5015
+ var FastColor = class _FastColor {
5016
+ /**
5017
+ * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
5018
+ */
5019
+ isValid = true;
5020
+ /**
5021
+ * Red, R in RGB
5022
+ */
5023
+ r = 0;
5024
+ /**
5025
+ * Green, G in RGB
5026
+ */
5027
+ g = 0;
5028
+ /**
5029
+ * Blue, B in RGB
5030
+ */
5031
+ b = 0;
5032
+ /**
5033
+ * Alpha/Opacity, A in RGBA/HSLA
5034
+ */
5035
+ a = 1;
5036
+ // HSV privates
5037
+ _h;
5038
+ _hsl_s;
5039
+ _hsv_s;
5040
+ _l;
5041
+ _v;
5042
+ // intermediate variables to calculate HSL/HSV
5043
+ _max;
5044
+ _min;
5045
+ _brightness;
5046
+ constructor(input) {
5047
+ function matchFormat(str) {
5048
+ return str[0] in input && str[1] in input && str[2] in input;
5049
+ }
5050
+ if (!input) {
5051
+ } else if (typeof input === "string") {
5052
+ let matchPrefix2 = function(prefix) {
5053
+ return trimStr.startsWith(prefix);
5054
+ };
5055
+ var matchPrefix = matchPrefix2;
5056
+ const trimStr = input.trim();
5057
+ if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
5058
+ this.fromHexString(trimStr);
5059
+ } else if (matchPrefix2("rgb")) {
5060
+ this.fromRgbString(trimStr);
5061
+ } else if (matchPrefix2("hsl")) {
5062
+ this.fromHslString(trimStr);
5063
+ } else if (matchPrefix2("hsv") || matchPrefix2("hsb")) {
5064
+ this.fromHsvString(trimStr);
5065
+ } else {
5066
+ const presetColor = presetColors_default[trimStr.toLowerCase()];
5067
+ if (presetColor) {
5068
+ this.fromHexString(
5069
+ // Convert 36 hex to 16 hex
5070
+ parseInt(presetColor, 36).toString(16).padStart(6, "0")
5071
+ );
5072
+ }
5073
+ }
5074
+ } else if (input instanceof _FastColor) {
5075
+ this.r = input.r;
5076
+ this.g = input.g;
5077
+ this.b = input.b;
5078
+ this.a = input.a;
5079
+ this._h = input._h;
5080
+ this._hsl_s = input._hsl_s;
5081
+ this._hsv_s = input._hsv_s;
5082
+ this._l = input._l;
5083
+ this._v = input._v;
5084
+ } else if (matchFormat("rgb")) {
5085
+ this.r = limitRange(input.r);
5086
+ this.g = limitRange(input.g);
5087
+ this.b = limitRange(input.b);
5088
+ this.a = typeof input.a === "number" ? limitRange(input.a, 1) : 1;
5089
+ } else if (matchFormat("hsl")) {
5090
+ this.fromHsl(input);
5091
+ } else if (matchFormat("hsv")) {
5092
+ this.fromHsv(input);
5093
+ } else {
5094
+ throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(input));
5095
+ }
5096
+ }
5097
+ // ======================= Setter =======================
5098
+ setR(value) {
5099
+ return this._sc("r", value);
5100
+ }
5101
+ setG(value) {
5102
+ return this._sc("g", value);
5103
+ }
5104
+ setB(value) {
5105
+ return this._sc("b", value);
5106
+ }
5107
+ setA(value) {
5108
+ return this._sc("a", value, 1);
5109
+ }
5110
+ setHue(value) {
5111
+ const hsv = this.toHsv();
5112
+ hsv.h = value;
5113
+ return this._c(hsv);
5114
+ }
5115
+ // ======================= Getter =======================
5116
+ /**
5117
+ * Returns the perceived luminance of a color, from 0-1.
5118
+ * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
5119
+ */
5120
+ getLuminance() {
5121
+ function adjustGamma(raw) {
5122
+ const val = raw / 255;
5123
+ return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
5124
+ }
5125
+ const R = adjustGamma(this.r);
5126
+ const G = adjustGamma(this.g);
5127
+ const B = adjustGamma(this.b);
5128
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
5129
+ }
5130
+ getHue() {
5131
+ if (typeof this._h === "undefined") {
5132
+ const delta = this.getMax() - this.getMin();
5133
+ if (delta === 0) {
5134
+ this._h = 0;
5135
+ } else {
5136
+ this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
5137
+ }
5138
+ }
5139
+ return this._h;
5140
+ }
5141
+ /**
5142
+ * @deprecated should use getHSVSaturation or getHSLSaturation instead
5143
+ */
5144
+ getSaturation() {
5145
+ return this.getHSVSaturation();
5146
+ }
5147
+ getHSVSaturation() {
5148
+ if (typeof this._hsv_s === "undefined") {
5149
+ const delta = this.getMax() - this.getMin();
5150
+ if (delta === 0) {
5151
+ this._hsv_s = 0;
5152
+ } else {
5153
+ this._hsv_s = delta / this.getMax();
5154
+ }
5155
+ }
5156
+ return this._hsv_s;
5157
+ }
5158
+ getHSLSaturation() {
5159
+ if (typeof this._hsl_s === "undefined") {
5160
+ const delta = this.getMax() - this.getMin();
5161
+ if (delta === 0) {
5162
+ this._hsl_s = 0;
5163
+ } else {
5164
+ const l = this.getLightness();
5165
+ this._hsl_s = delta / 255 / (1 - Math.abs(2 * l - 1));
5166
+ }
5167
+ }
5168
+ return this._hsl_s;
5169
+ }
5170
+ getLightness() {
5171
+ if (typeof this._l === "undefined") {
5172
+ this._l = (this.getMax() + this.getMin()) / 510;
5173
+ }
5174
+ return this._l;
5175
+ }
5176
+ getValue() {
5177
+ if (typeof this._v === "undefined") {
5178
+ this._v = this.getMax() / 255;
5179
+ }
5180
+ return this._v;
5181
+ }
5182
+ /**
5183
+ * Returns the perceived brightness of the color, from 0-255.
5184
+ * Note: this is not the b of HSB
5185
+ * @see http://www.w3.org/TR/AERT#color-contrast
5186
+ */
5187
+ getBrightness() {
5188
+ if (typeof this._brightness === "undefined") {
5189
+ this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3;
5190
+ }
5191
+ return this._brightness;
5192
+ }
5193
+ // ======================== Func ========================
5194
+ darken(amount = 10) {
5195
+ const h = this.getHue();
5196
+ const s = this.getSaturation();
5197
+ let l = this.getLightness() - amount / 100;
5198
+ if (l < 0) {
5199
+ l = 0;
5200
+ }
5201
+ return this._c({
5202
+ h,
5203
+ s,
5204
+ l,
5205
+ a: this.a
5206
+ });
5207
+ }
5208
+ lighten(amount = 10) {
5209
+ const h = this.getHue();
5210
+ const s = this.getSaturation();
5211
+ let l = this.getLightness() + amount / 100;
5212
+ if (l > 1) {
5213
+ l = 1;
5214
+ }
5215
+ return this._c({
5216
+ h,
5217
+ s,
5218
+ l,
5219
+ a: this.a
5220
+ });
5221
+ }
5222
+ /**
5223
+ * Mix the current color a given amount with another color, from 0 to 100.
5224
+ * 0 means no mixing (return current color).
5225
+ */
5226
+ mix(input, amount = 50) {
5227
+ const color = this._c(input);
5228
+ const p = amount / 100;
5229
+ const calc = (key) => (color[key] - this[key]) * p + this[key];
5230
+ const rgba = {
5231
+ r: round(calc("r")),
5232
+ g: round(calc("g")),
5233
+ b: round(calc("b")),
5234
+ a: round(calc("a") * 100) / 100
5235
+ };
5236
+ return this._c(rgba);
5237
+ }
5238
+ /**
5239
+ * Mix the color with pure white, from 0 to 100.
5240
+ * Providing 0 will do nothing, providing 100 will always return white.
5241
+ */
5242
+ tint(amount = 10) {
5243
+ return this.mix({
5244
+ r: 255,
5245
+ g: 255,
5246
+ b: 255,
5247
+ a: 1
5248
+ }, amount);
5249
+ }
5250
+ /**
5251
+ * Mix the color with pure black, from 0 to 100.
5252
+ * Providing 0 will do nothing, providing 100 will always return black.
5253
+ */
5254
+ shade(amount = 10) {
5255
+ return this.mix({
5256
+ r: 0,
5257
+ g: 0,
5258
+ b: 0,
5259
+ a: 1
5260
+ }, amount);
5261
+ }
5262
+ onBackground(background) {
5263
+ const bg = this._c(background);
5264
+ const alpha = this.a + bg.a * (1 - this.a);
5265
+ const calc = (key) => {
5266
+ return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
5267
+ };
5268
+ return this._c({
5269
+ r: calc("r"),
5270
+ g: calc("g"),
5271
+ b: calc("b"),
5272
+ a: alpha
5273
+ });
5274
+ }
5275
+ // ======================= Status =======================
5276
+ isDark() {
5277
+ return this.getBrightness() < 128;
5278
+ }
5279
+ isLight() {
5280
+ return this.getBrightness() >= 128;
5281
+ }
5282
+ // ======================== MISC ========================
5283
+ equals(other) {
5284
+ return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
5285
+ }
5286
+ clone() {
5287
+ return this._c(this);
5288
+ }
5289
+ // ======================= Format =======================
5290
+ toHexString() {
5291
+ let hex = "#";
5292
+ const rHex = (this.r || 0).toString(16);
5293
+ hex += rHex.length === 2 ? rHex : "0" + rHex;
5294
+ const gHex = (this.g || 0).toString(16);
5295
+ hex += gHex.length === 2 ? gHex : "0" + gHex;
5296
+ const bHex = (this.b || 0).toString(16);
5297
+ hex += bHex.length === 2 ? bHex : "0" + bHex;
5298
+ if (typeof this.a === "number" && this.a >= 0 && this.a < 1) {
5299
+ const aHex = round(this.a * 255).toString(16);
5300
+ hex += aHex.length === 2 ? aHex : "0" + aHex;
5301
+ }
5302
+ return hex;
5303
+ }
5304
+ /** CSS support color pattern */
5305
+ toHsl() {
5306
+ return {
5307
+ h: this.getHue(),
5308
+ s: this.getHSLSaturation(),
5309
+ l: this.getLightness(),
5310
+ a: this.a
5311
+ };
5312
+ }
5313
+ /** CSS support color pattern */
5314
+ toHslString() {
5315
+ const h = this.getHue();
5316
+ const s = round(this.getHSLSaturation() * 100);
5317
+ const l = round(this.getLightness() * 100);
5318
+ return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
5319
+ }
5320
+ /** Same as toHsb */
5321
+ toHsv() {
5322
+ return {
5323
+ h: this.getHue(),
5324
+ s: this.getHSVSaturation(),
5325
+ v: this.getValue(),
5326
+ a: this.a
5327
+ };
5328
+ }
5329
+ toRgb() {
5330
+ return {
5331
+ r: this.r,
5332
+ g: this.g,
5333
+ b: this.b,
5334
+ a: this.a
5335
+ };
5336
+ }
5337
+ toRgbString() {
5338
+ return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
5339
+ }
5340
+ toString() {
5341
+ return this.toRgbString();
5342
+ }
5343
+ // ====================== Privates ======================
5344
+ /** Return a new FastColor object with one channel changed */
5345
+ _sc(rgb, value, max) {
5346
+ const clone = this.clone();
5347
+ clone[rgb] = limitRange(value, max);
5348
+ return clone;
5349
+ }
5350
+ _c(input) {
5351
+ return new this.constructor(input);
5352
+ }
5353
+ getMax() {
5354
+ if (typeof this._max === "undefined") {
5355
+ this._max = Math.max(this.r, this.g, this.b);
5356
+ }
5357
+ return this._max;
5358
+ }
5359
+ getMin() {
5360
+ if (typeof this._min === "undefined") {
5361
+ this._min = Math.min(this.r, this.g, this.b);
5362
+ }
5363
+ return this._min;
5364
+ }
5365
+ fromHexString(trimStr) {
5366
+ const withoutPrefix = trimStr.replace("#", "");
5367
+ function connectNum(index1, index2) {
5368
+ return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
5369
+ }
5370
+ if (withoutPrefix.length < 6) {
5371
+ this.r = connectNum(0);
5372
+ this.g = connectNum(1);
5373
+ this.b = connectNum(2);
5374
+ this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
5375
+ } else {
5376
+ this.r = connectNum(0, 1);
5377
+ this.g = connectNum(2, 3);
5378
+ this.b = connectNum(4, 5);
5379
+ this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
5380
+ }
5381
+ }
5382
+ fromHsl({
5383
+ h: _h,
5384
+ s,
5385
+ l,
5386
+ a
5387
+ }) {
5388
+ const h = (_h % 360 + 360) % 360;
5389
+ this._h = h;
5390
+ this._hsl_s = s;
5391
+ this._l = l;
5392
+ this.a = typeof a === "number" ? a : 1;
5393
+ if (s <= 0) {
5394
+ const rgb = round(l * 255);
5395
+ this.r = rgb;
5396
+ this.g = rgb;
5397
+ this.b = rgb;
5398
+ return;
5399
+ }
5400
+ let r = 0, g = 0, b = 0;
5401
+ const huePrime = h / 60;
5402
+ const chroma = (1 - Math.abs(2 * l - 1)) * s;
5403
+ const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
5404
+ if (huePrime >= 0 && huePrime < 1) {
5405
+ r = chroma;
5406
+ g = secondComponent;
5407
+ } else if (huePrime >= 1 && huePrime < 2) {
5408
+ r = secondComponent;
5409
+ g = chroma;
5410
+ } else if (huePrime >= 2 && huePrime < 3) {
5411
+ g = chroma;
5412
+ b = secondComponent;
5413
+ } else if (huePrime >= 3 && huePrime < 4) {
5414
+ g = secondComponent;
5415
+ b = chroma;
5416
+ } else if (huePrime >= 4 && huePrime < 5) {
5417
+ r = secondComponent;
5418
+ b = chroma;
5419
+ } else if (huePrime >= 5 && huePrime < 6) {
5420
+ r = chroma;
5421
+ b = secondComponent;
5422
+ }
5423
+ const lightnessModification = l - chroma / 2;
5424
+ this.r = round((r + lightnessModification) * 255);
5425
+ this.g = round((g + lightnessModification) * 255);
5426
+ this.b = round((b + lightnessModification) * 255);
5427
+ }
5428
+ fromHsv({
5429
+ h: _h,
5430
+ s,
5431
+ v,
5432
+ a
5433
+ }) {
5434
+ const h = (_h % 360 + 360) % 360;
5435
+ this._h = h;
5436
+ this._hsv_s = s;
5437
+ this._v = v;
5438
+ this.a = typeof a === "number" ? a : 1;
5439
+ const vv = round(v * 255);
5440
+ this.r = vv;
5441
+ this.g = vv;
5442
+ this.b = vv;
5443
+ if (s <= 0) {
5444
+ return;
5445
+ }
5446
+ const hh = h / 60;
5447
+ const i = Math.floor(hh);
5448
+ const ff = hh - i;
5449
+ const p = round(v * (1 - s) * 255);
5450
+ const q = round(v * (1 - s * ff) * 255);
5451
+ const t = round(v * (1 - s * (1 - ff)) * 255);
5452
+ switch (i) {
5453
+ case 0:
5454
+ this.g = t;
5455
+ this.b = p;
5456
+ break;
5457
+ case 1:
5458
+ this.r = q;
5459
+ this.b = p;
5460
+ break;
5461
+ case 2:
5462
+ this.r = p;
5463
+ this.b = t;
5464
+ break;
5465
+ case 3:
5466
+ this.r = p;
5467
+ this.g = q;
5468
+ break;
5469
+ case 4:
5470
+ this.r = t;
5471
+ this.g = p;
5472
+ break;
5473
+ case 5:
5474
+ default:
5475
+ this.g = p;
5476
+ this.b = q;
5477
+ break;
5478
+ }
5479
+ }
5480
+ fromHsvString(trimStr) {
5481
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
5482
+ this.fromHsv({
5483
+ h: cells[0],
5484
+ s: cells[1],
5485
+ v: cells[2],
5486
+ a: cells[3]
5487
+ });
5488
+ }
5489
+ fromHslString(trimStr) {
5490
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
5491
+ this.fromHsl({
5492
+ h: cells[0],
5493
+ s: cells[1],
5494
+ l: cells[2],
5495
+ a: cells[3]
5496
+ });
5497
+ }
5498
+ fromRgbString(trimStr) {
5499
+ const cells = splitColorStr(trimStr, (num, txt) => (
5500
+ // Convert percentage to number. e.g. 50% -> 128
5501
+ txt.includes("%") ? round(num / 100 * 255) : num
5502
+ ));
5503
+ this.r = cells[0];
5504
+ this.g = cells[1];
5505
+ this.b = cells[2];
5506
+ this.a = cells[3];
5507
+ }
5508
+ };
5509
+
5510
+ // ../../node_modules/@ant-design/colors/es/generate.js
5511
+ var hueStep = 2;
5512
+ var saturationStep = 0.16;
5513
+ var saturationStep2 = 0.05;
5514
+ var brightnessStep1 = 0.05;
5515
+ var brightnessStep2 = 0.15;
5516
+ var lightColorCount = 5;
5517
+ var darkColorCount = 4;
5518
+ var darkColorMap = [{
5519
+ index: 7,
5520
+ amount: 15
5521
+ }, {
5522
+ index: 6,
5523
+ amount: 25
5524
+ }, {
5525
+ index: 5,
5526
+ amount: 30
5527
+ }, {
5528
+ index: 5,
5529
+ amount: 45
5530
+ }, {
5531
+ index: 5,
5532
+ amount: 65
5533
+ }, {
5534
+ index: 5,
5535
+ amount: 85
5536
+ }, {
5537
+ index: 4,
5538
+ amount: 90
5539
+ }, {
5540
+ index: 3,
5541
+ amount: 95
5542
+ }, {
5543
+ index: 2,
5544
+ amount: 97
5545
+ }, {
5546
+ index: 1,
5547
+ amount: 98
5548
+ }];
5549
+ function getHue(hsv, i, light) {
5550
+ let hue;
5551
+ if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
5552
+ hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
5553
+ } else {
5554
+ hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
5555
+ }
5556
+ if (hue < 0) {
5557
+ hue += 360;
5558
+ } else if (hue >= 360) {
5559
+ hue -= 360;
5560
+ }
5561
+ return hue;
5562
+ }
5563
+ function getSaturation(hsv, i, light) {
5564
+ if (hsv.h === 0 && hsv.s === 0) {
5565
+ return hsv.s;
5566
+ }
5567
+ let saturation;
5568
+ if (light) {
5569
+ saturation = hsv.s - saturationStep * i;
5570
+ } else if (i === darkColorCount) {
5571
+ saturation = hsv.s + saturationStep;
5572
+ } else {
5573
+ saturation = hsv.s + saturationStep2 * i;
5574
+ }
5575
+ if (saturation > 1) {
5576
+ saturation = 1;
5577
+ }
5578
+ if (light && i === lightColorCount && saturation > 0.1) {
5579
+ saturation = 0.1;
5580
+ }
5581
+ if (saturation < 0.06) {
5582
+ saturation = 0.06;
5583
+ }
5584
+ return Math.round(saturation * 100) / 100;
5585
+ }
5586
+ function getValue(hsv, i, light) {
5587
+ let value;
5588
+ if (light) {
5589
+ value = hsv.v + brightnessStep1 * i;
5590
+ } else {
5591
+ value = hsv.v - brightnessStep2 * i;
5592
+ }
5593
+ value = Math.max(0, Math.min(1, value));
5594
+ return Math.round(value * 100) / 100;
5595
+ }
5596
+ function generate(color, opts = {}) {
5597
+ const patterns = [];
5598
+ const pColor = new FastColor(color);
5599
+ const hsv = pColor.toHsv();
5600
+ for (let i = lightColorCount; i > 0; i -= 1) {
5601
+ const c = new FastColor({
5602
+ h: getHue(hsv, i, true),
5603
+ s: getSaturation(hsv, i, true),
5604
+ v: getValue(hsv, i, true)
5605
+ });
5606
+ patterns.push(c);
5607
+ }
5608
+ patterns.push(pColor);
5609
+ for (let i = 1; i <= darkColorCount; i += 1) {
5610
+ const c = new FastColor({
5611
+ h: getHue(hsv, i),
5612
+ s: getSaturation(hsv, i),
5613
+ v: getValue(hsv, i)
5614
+ });
5615
+ patterns.push(c);
5616
+ }
5617
+ if (opts.theme === "dark") {
5618
+ return darkColorMap.map(({
5619
+ index,
5620
+ amount
5621
+ }) => new FastColor(opts.backgroundColor || "#141414").mix(patterns[index], amount).toHexString());
5622
+ }
5623
+ return patterns.map((c) => c.toHexString());
5624
+ }
5625
+
5626
+ // ../../node_modules/@ant-design/colors/es/presets.js
5627
+ var red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
5628
+ red.primary = red[5];
5629
+ var volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
5630
+ volcano.primary = volcano[5];
5631
+ var orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
5632
+ orange.primary = orange[5];
5633
+ var gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
5634
+ gold.primary = gold[5];
5635
+ var yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
5636
+ yellow.primary = yellow[5];
5637
+ var lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
5638
+ lime.primary = lime[5];
5639
+ var green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
5640
+ green.primary = green[5];
5641
+ var cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
5642
+ cyan.primary = cyan[5];
5643
+ var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
5644
+ blue.primary = blue[5];
5645
+ var geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
5646
+ geekblue.primary = geekblue[5];
5647
+ var purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
5648
+ purple.primary = purple[5];
5649
+ var magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
5650
+ magenta.primary = magenta[5];
5651
+ var grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
5652
+ grey.primary = grey[5];
5653
+ var redDark = ["#2a1215", "#431418", "#58181c", "#791a1f", "#a61d24", "#d32029", "#e84749", "#f37370", "#f89f9a", "#fac8c3"];
5654
+ redDark.primary = redDark[5];
5655
+ var volcanoDark = ["#2b1611", "#441d12", "#592716", "#7c3118", "#aa3e19", "#d84a1b", "#e87040", "#f3956a", "#f8b692", "#fad4bc"];
5656
+ volcanoDark.primary = volcanoDark[5];
5657
+ var orangeDark = ["#2b1d11", "#442a11", "#593815", "#7c4a15", "#aa6215", "#d87a16", "#e89a3c", "#f3b765", "#f8cf8d", "#fae3b7"];
5658
+ orangeDark.primary = orangeDark[5];
5659
+ var goldDark = ["#2b2111", "#443111", "#594214", "#7c5914", "#aa7714", "#d89614", "#e8b339", "#f3cc62", "#f8df8b", "#faedb5"];
5660
+ goldDark.primary = goldDark[5];
5661
+ var yellowDark = ["#2b2611", "#443b11", "#595014", "#7c6e14", "#aa9514", "#d8bd14", "#e8d639", "#f3ea62", "#f8f48b", "#fafab5"];
5662
+ yellowDark.primary = yellowDark[5];
5663
+ var limeDark = ["#1f2611", "#2e3c10", "#3e4f13", "#536d13", "#6f9412", "#8bbb11", "#a9d134", "#c9e75d", "#e4f88b", "#f0fab5"];
5664
+ limeDark.primary = limeDark[5];
5665
+ var greenDark = ["#162312", "#1d3712", "#274916", "#306317", "#3c8618", "#49aa19", "#6abe39", "#8fd460", "#b2e58b", "#d5f2bb"];
5666
+ greenDark.primary = greenDark[5];
5667
+ var cyanDark = ["#112123", "#113536", "#144848", "#146262", "#138585", "#13a8a8", "#33bcb7", "#58d1c9", "#84e2d8", "#b2f1e8"];
5668
+ cyanDark.primary = cyanDark[5];
5669
+ var blueDark = ["#111a2c", "#112545", "#15325b", "#15417e", "#1554ad", "#1668dc", "#3c89e8", "#65a9f3", "#8dc5f8", "#b7dcfa"];
5670
+ blueDark.primary = blueDark[5];
5671
+ var geekblueDark = ["#131629", "#161d40", "#1c2755", "#203175", "#263ea0", "#2b4acb", "#5273e0", "#7f9ef3", "#a8c1f8", "#d2e0fa"];
5672
+ geekblueDark.primary = geekblueDark[5];
5673
+ var purpleDark = ["#1a1325", "#24163a", "#301c4d", "#3e2069", "#51258f", "#642ab5", "#854eca", "#ab7ae0", "#cda8f0", "#ebd7fa"];
5674
+ purpleDark.primary = purpleDark[5];
5675
+ var magentaDark = ["#291321", "#40162f", "#551c3b", "#75204f", "#a02669", "#cb2b83", "#e0529c", "#f37fb7", "#f8a8cc", "#fad2e3"];
5676
+ magentaDark.primary = magentaDark[5];
5677
+ var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"];
5678
+ greyDark.primary = greyDark[5];
5679
+
5680
+ // ../../node_modules/@ant-design/icons/es/components/IconBase.js
5681
+ import * as React13 from "react";
5682
+
5683
+ // ../../node_modules/@rc-component/util/es/Dom/canUseDom.js
5684
+ function canUseDom() {
5685
+ return !!(typeof window !== "undefined" && window.document && window.document.createElement);
5686
+ }
5687
+
5688
+ // ../../node_modules/@rc-component/util/es/Dom/contains.js
5689
+ function contains(root, n) {
5690
+ if (!root) {
5691
+ return false;
5692
+ }
5693
+ if (root.contains) {
5694
+ return root.contains(n);
5695
+ }
5696
+ let node = n;
5697
+ while (node) {
5698
+ if (node === root) {
5699
+ return true;
5700
+ }
5701
+ node = node.parentNode;
5702
+ }
5703
+ return false;
5704
+ }
5705
+
5706
+ // ../../node_modules/@rc-component/util/es/Dom/dynamicCSS.js
5707
+ var APPEND_ORDER = "data-rc-order";
5708
+ var APPEND_PRIORITY = "data-rc-priority";
5709
+ var MARK_KEY = `rc-util-key`;
5710
+ var containerCache = /* @__PURE__ */ new Map();
5711
+ function getMark({
5712
+ mark
5713
+ } = {}) {
5714
+ if (mark) {
5715
+ return mark.startsWith("data-") ? mark : `data-${mark}`;
5716
+ }
5717
+ return MARK_KEY;
5718
+ }
5719
+ function getContainer(option) {
5720
+ if (option.attachTo) {
5721
+ return option.attachTo;
5722
+ }
5723
+ const head = document.querySelector("head");
5724
+ return head || document.body;
5725
+ }
5726
+ function getOrder(prepend) {
5727
+ if (prepend === "queue") {
5728
+ return "prependQueue";
5729
+ }
5730
+ return prepend ? "prepend" : "append";
5731
+ }
5732
+ function findStyles(container) {
5733
+ return Array.from((containerCache.get(container) || container).children).filter((node) => node.tagName === "STYLE");
5734
+ }
5735
+ function injectCSS(css, option = {}) {
5736
+ if (!canUseDom()) {
5737
+ return null;
5738
+ }
5739
+ const {
5740
+ csp,
5741
+ prepend,
5742
+ priority = 0
5743
+ } = option;
5744
+ const mergedOrder = getOrder(prepend);
5745
+ const isPrependQueue = mergedOrder === "prependQueue";
5746
+ const styleNode = document.createElement("style");
5747
+ styleNode.setAttribute(APPEND_ORDER, mergedOrder);
5748
+ if (isPrependQueue && priority) {
5749
+ styleNode.setAttribute(APPEND_PRIORITY, `${priority}`);
5750
+ }
5751
+ if (csp?.nonce) {
5752
+ styleNode.nonce = csp?.nonce;
5753
+ }
5754
+ styleNode.innerHTML = css;
5755
+ const container = getContainer(option);
5756
+ const {
5757
+ firstChild
5758
+ } = container;
5759
+ if (prepend) {
5760
+ if (isPrependQueue) {
5761
+ const existStyle = (option.styles || findStyles(container)).filter((node) => {
5762
+ if (!["prepend", "prependQueue"].includes(node.getAttribute(APPEND_ORDER))) {
5763
+ return false;
5764
+ }
5765
+ const nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
5766
+ return priority >= nodePriority;
5767
+ });
5768
+ if (existStyle.length) {
5769
+ container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
5770
+ return styleNode;
5771
+ }
5772
+ }
5773
+ container.insertBefore(styleNode, firstChild);
5774
+ } else {
5775
+ container.appendChild(styleNode);
5776
+ }
5777
+ return styleNode;
5778
+ }
5779
+ function findExistNode(key, option = {}) {
5780
+ let {
5781
+ styles
5782
+ } = option;
5783
+ styles ||= findStyles(getContainer(option));
5784
+ return styles.find((node) => node.getAttribute(getMark(option)) === key);
5785
+ }
5786
+ function syncRealContainer(container, option) {
5787
+ const cachedRealContainer = containerCache.get(container);
5788
+ if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
5789
+ const placeholderStyle = injectCSS("", option);
5790
+ const {
5791
+ parentNode
5792
+ } = placeholderStyle;
5793
+ containerCache.set(container, parentNode);
5794
+ container.removeChild(placeholderStyle);
5795
+ }
5796
+ }
5797
+ function updateCSS(css, key, originOption = {}) {
5798
+ const container = getContainer(originOption);
5799
+ const styles = findStyles(container);
5800
+ const option = {
5801
+ ...originOption,
5802
+ styles
5803
+ };
5804
+ syncRealContainer(container, option);
5805
+ const existNode = findExistNode(key, option);
5806
+ if (existNode) {
5807
+ if (option.csp?.nonce && existNode.nonce !== option.csp?.nonce) {
5808
+ existNode.nonce = option.csp?.nonce;
5809
+ }
5810
+ if (existNode.innerHTML !== css) {
5811
+ existNode.innerHTML = css;
5812
+ }
5813
+ return existNode;
5814
+ }
5815
+ const newNode = injectCSS(css, option);
5816
+ newNode.setAttribute(getMark(option), key);
5817
+ return newNode;
5818
+ }
5819
+
5820
+ // ../../node_modules/@rc-component/util/es/Dom/shadow.js
5821
+ function getRoot(ele) {
5822
+ return ele?.getRootNode?.();
5823
+ }
5824
+ function inShadow(ele) {
5825
+ return getRoot(ele) instanceof ShadowRoot;
5826
+ }
5827
+ function getShadowRoot(ele) {
5828
+ return inShadow(ele) ? getRoot(ele) : null;
5829
+ }
5830
+
5831
+ // ../../node_modules/@rc-component/util/es/warning.js
5832
+ var warned = {};
5833
+ var preWarningFns = [];
5834
+ var preMessage = (fn) => {
5835
+ preWarningFns.push(fn);
5836
+ };
5837
+ function warning(valid, message) {
5838
+ if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
5839
+ const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "warning"), message);
5840
+ if (finalMessage) {
5841
+ console.error(`Warning: ${finalMessage}`);
5842
+ }
5843
+ }
5844
+ }
5845
+ function note(valid, message) {
5846
+ if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
5847
+ const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? "", "note"), message);
5848
+ if (finalMessage) {
5849
+ console.warn(`Note: ${finalMessage}`);
5850
+ }
5851
+ }
5852
+ }
5853
+ function resetWarned() {
5854
+ warned = {};
5855
+ }
5856
+ function call(method, valid, message) {
5857
+ if (!valid && !warned[message]) {
5858
+ method(false, message);
5859
+ warned[message] = true;
5860
+ }
5861
+ }
5862
+ function warningOnce(valid, message) {
5863
+ call(warning, valid, message);
5864
+ }
5865
+ function noteOnce(valid, message) {
5866
+ call(note, valid, message);
5867
+ }
5868
+ warningOnce.preMessage = preMessage;
5869
+ warningOnce.resetWarned = resetWarned;
5870
+ warningOnce.noteOnce = noteOnce;
5871
+
5872
+ // ../../node_modules/@ant-design/icons/es/utils.js
5873
+ import React12, { useContext as useContext5, useEffect as useEffect13 } from "react";
5874
+ function camelCase(input) {
5875
+ return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
5876
+ }
5877
+ function warning2(valid, message) {
5878
+ warningOnce(valid, `[@ant-design/icons] ${message}`);
5879
+ }
5880
+ function isIconDefinition(target) {
5881
+ return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
5882
+ }
5883
+ function normalizeAttrs(attrs = {}) {
5884
+ return Object.keys(attrs).reduce((acc, key) => {
5885
+ const val = attrs[key];
5886
+ switch (key) {
5887
+ case "class":
5888
+ acc.className = val;
5889
+ delete acc.class;
5890
+ break;
5891
+ default:
5892
+ delete acc[key];
5893
+ acc[camelCase(key)] = val;
5894
+ }
5895
+ return acc;
5896
+ }, {});
5897
+ }
5898
+ function generate2(node, key, rootProps) {
5899
+ if (!rootProps) {
5900
+ return /* @__PURE__ */ React12.createElement(node.tag, {
5901
+ key,
5902
+ ...normalizeAttrs(node.attrs)
5903
+ }, (node.children || []).map((child, index) => generate2(child, `${key}-${node.tag}-${index}`)));
5904
+ }
5905
+ return /* @__PURE__ */ React12.createElement(node.tag, {
5906
+ key,
5907
+ ...normalizeAttrs(node.attrs),
5908
+ ...rootProps
5909
+ }, (node.children || []).map((child, index) => generate2(child, `${key}-${node.tag}-${index}`)));
5910
+ }
5911
+ function getSecondaryColor(primaryColor) {
5912
+ return generate(primaryColor)[0];
5913
+ }
5914
+ function normalizeTwoToneColors(twoToneColor) {
5915
+ if (!twoToneColor) {
5916
+ return [];
5917
+ }
5918
+ return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
5919
+ }
5920
+ var iconStyles = `
5921
+ .anticon {
5922
+ display: inline-flex;
5923
+ align-items: center;
5924
+ color: inherit;
5925
+ font-style: normal;
5926
+ line-height: 0;
5927
+ text-align: center;
5928
+ text-transform: none;
5929
+ vertical-align: -0.125em;
5930
+ text-rendering: optimizeLegibility;
5931
+ -webkit-font-smoothing: antialiased;
5932
+ -moz-osx-font-smoothing: grayscale;
5933
+ }
5934
+
5935
+ .anticon > * {
5936
+ line-height: 1;
5937
+ }
5938
+
5939
+ .anticon svg {
5940
+ display: inline-block;
5941
+ vertical-align: inherit;
5942
+ }
5943
+
5944
+ .anticon::before {
5945
+ display: none;
5946
+ }
5947
+
5948
+ .anticon .anticon-icon {
5949
+ display: block;
5950
+ }
5951
+
5952
+ .anticon[tabindex] {
5953
+ cursor: pointer;
5954
+ }
5955
+
5956
+ .anticon-spin::before,
5957
+ .anticon-spin {
5958
+ display: inline-block;
5959
+ -webkit-animation: loadingCircle 1s infinite linear;
5960
+ animation: loadingCircle 1s infinite linear;
5961
+ }
5962
+
5963
+ @-webkit-keyframes loadingCircle {
5964
+ 100% {
5965
+ -webkit-transform: rotate(360deg);
5966
+ transform: rotate(360deg);
5967
+ }
5968
+ }
5969
+
5970
+ @keyframes loadingCircle {
5971
+ 100% {
5972
+ -webkit-transform: rotate(360deg);
5973
+ transform: rotate(360deg);
5974
+ }
5975
+ }
5976
+ `;
5977
+ var useInsertStyles = (eleRef) => {
5978
+ const {
5979
+ csp,
5980
+ prefixCls,
5981
+ layer
5982
+ } = useContext5(Context_default);
5983
+ let mergedStyleStr = iconStyles;
5984
+ if (prefixCls) {
5985
+ mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
5986
+ }
5987
+ if (layer) {
5988
+ mergedStyleStr = `@layer ${layer} {
5989
+ ${mergedStyleStr}
5990
+ }`;
5991
+ }
5992
+ useEffect13(() => {
5993
+ const ele = eleRef.current;
5994
+ const shadowRoot = getShadowRoot(ele);
5995
+ updateCSS(mergedStyleStr, "@ant-design-icons", {
5996
+ prepend: !layer,
5997
+ csp,
5998
+ attachTo: shadowRoot
5999
+ });
6000
+ }, []);
6001
+ };
6002
+
6003
+ // ../../node_modules/@ant-design/icons/es/components/IconBase.js
6004
+ var twoToneColorPalette = {
6005
+ primaryColor: "#333",
6006
+ secondaryColor: "#E6E6E6",
6007
+ calculated: false
6008
+ };
6009
+ function setTwoToneColors({
6010
+ primaryColor,
6011
+ secondaryColor
6012
+ }) {
6013
+ twoToneColorPalette.primaryColor = primaryColor;
6014
+ twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
6015
+ twoToneColorPalette.calculated = !!secondaryColor;
6016
+ }
6017
+ function getTwoToneColors() {
6018
+ return {
6019
+ ...twoToneColorPalette
6020
+ };
6021
+ }
6022
+ var IconBase = (props) => {
6023
+ const {
6024
+ icon,
6025
+ className,
6026
+ onClick,
6027
+ style,
6028
+ primaryColor,
6029
+ secondaryColor,
6030
+ ...restProps
6031
+ } = props;
6032
+ const svgRef = React13.useRef(null);
6033
+ let colors = twoToneColorPalette;
6034
+ if (primaryColor) {
6035
+ colors = {
6036
+ primaryColor,
6037
+ secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
6038
+ };
6039
+ }
6040
+ useInsertStyles(svgRef);
6041
+ warning2(isIconDefinition(icon), `icon should be icon definiton, but got ${icon}`);
6042
+ if (!isIconDefinition(icon)) {
6043
+ return null;
6044
+ }
6045
+ let target = icon;
6046
+ if (target && typeof target.icon === "function") {
6047
+ target = {
6048
+ ...target,
6049
+ icon: target.icon(colors.primaryColor, colors.secondaryColor)
6050
+ };
6051
+ }
6052
+ return generate2(target.icon, `svg-${target.name}`, {
6053
+ className,
6054
+ onClick,
6055
+ style,
6056
+ "data-icon": target.name,
6057
+ width: "1em",
6058
+ height: "1em",
6059
+ fill: "currentColor",
6060
+ "aria-hidden": "true",
6061
+ ...restProps,
6062
+ ref: svgRef
6063
+ });
6064
+ };
6065
+ IconBase.displayName = "IconReact";
6066
+ IconBase.getTwoToneColors = getTwoToneColors;
6067
+ IconBase.setTwoToneColors = setTwoToneColors;
6068
+ var IconBase_default = IconBase;
6069
+
6070
+ // ../../node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js
6071
+ function setTwoToneColor(twoToneColor) {
6072
+ const [primaryColor, secondaryColor] = normalizeTwoToneColors(twoToneColor);
6073
+ return IconBase_default.setTwoToneColors({
6074
+ primaryColor,
6075
+ secondaryColor
6076
+ });
6077
+ }
6078
+ function getTwoToneColor() {
6079
+ const colors = IconBase_default.getTwoToneColors();
6080
+ if (!colors.calculated) {
6081
+ return colors.primaryColor;
6082
+ }
6083
+ return [colors.primaryColor, colors.secondaryColor];
6084
+ }
6085
+
6086
+ // ../../node_modules/@ant-design/icons/es/components/AntdIcon.js
6087
+ function _extends() {
6088
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
6089
+ for (var i = 1; i < arguments.length; i++) {
6090
+ var source = arguments[i];
6091
+ for (var key in source) {
6092
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
6093
+ target[key] = source[key];
6094
+ }
6095
+ }
6096
+ }
6097
+ return target;
6098
+ };
6099
+ return _extends.apply(this, arguments);
6100
+ }
6101
+ setTwoToneColor(blue.primary);
6102
+ var Icon = /* @__PURE__ */ React14.forwardRef((props, ref) => {
6103
+ const {
6104
+ // affect outter <i>...</i>
6105
+ className,
6106
+ // affect inner <svg>...</svg>
6107
+ icon,
6108
+ spin,
6109
+ rotate,
6110
+ tabIndex,
6111
+ onClick,
6112
+ // other
6113
+ twoToneColor,
6114
+ ...restProps
6115
+ } = props;
6116
+ const {
6117
+ prefixCls = "anticon",
6118
+ rootClassName
6119
+ } = React14.useContext(Context_default);
6120
+ const classString = clsx2(rootClassName, prefixCls, {
6121
+ [`${prefixCls}-${icon.name}`]: !!icon.name,
6122
+ [`${prefixCls}-spin`]: !!spin || icon.name === "loading"
6123
+ }, className);
6124
+ let iconTabIndex = tabIndex;
6125
+ if (iconTabIndex === void 0 && onClick) {
6126
+ iconTabIndex = -1;
6127
+ }
6128
+ const svgStyle = rotate ? {
6129
+ msTransform: `rotate(${rotate}deg)`,
6130
+ transform: `rotate(${rotate}deg)`
6131
+ } : void 0;
6132
+ const [primaryColor, secondaryColor] = normalizeTwoToneColors(twoToneColor);
6133
+ return /* @__PURE__ */ React14.createElement("span", _extends({
6134
+ role: "img",
6135
+ "aria-label": icon.name
6136
+ }, restProps, {
6137
+ ref,
6138
+ tabIndex: iconTabIndex,
6139
+ onClick,
6140
+ className: classString
6141
+ }), /* @__PURE__ */ React14.createElement(IconBase_default, {
6142
+ icon,
6143
+ primaryColor,
6144
+ secondaryColor,
6145
+ style: svgStyle
6146
+ }));
6147
+ });
6148
+ Icon.getTwoToneColor = getTwoToneColor;
6149
+ Icon.setTwoToneColor = setTwoToneColor;
6150
+ if (process.env.NODE_ENV !== "production") {
6151
+ Icon.displayName = "AntdIcon";
6152
+ }
6153
+ var AntdIcon_default = Icon;
6154
+
6155
+ // ../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js
6156
+ import * as React15 from "react";
6157
+
6158
+ // ../../node_modules/@ant-design/icons-svg/es/asn/PlusOutlined.js
6159
+ var PlusOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
6160
+ var PlusOutlined_default = PlusOutlined;
6161
+
6162
+ // ../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js
6163
+ function _extends2() {
6164
+ _extends2 = Object.assign ? Object.assign.bind() : function(target) {
6165
+ for (var i = 1; i < arguments.length; i++) {
6166
+ var source = arguments[i];
6167
+ for (var key in source) {
6168
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
6169
+ target[key] = source[key];
6170
+ }
6171
+ }
6172
+ }
6173
+ return target;
6174
+ };
6175
+ return _extends2.apply(this, arguments);
6176
+ }
6177
+ var PlusOutlined2 = (props, ref) => /* @__PURE__ */ React15.createElement(AntdIcon_default, _extends2({}, props, {
6178
+ ref,
6179
+ icon: PlusOutlined_default
6180
+ }));
6181
+ var RefIcon = /* @__PURE__ */ React15.forwardRef(PlusOutlined2);
6182
+ if (process.env.NODE_ENV !== "production") {
6183
+ RefIcon.displayName = "PlusOutlined";
6184
+ }
6185
+ var PlusOutlined_default2 = RefIcon;
6186
+
6187
+ // src/hooks/uploads/useAntdImageUpload.tsx
6188
+ import { Image, Upload } from "antd";
6189
+ import { Fragment as Fragment7, jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
6190
+ var getBase64 = (file) => new Promise((resolve, reject) => {
6191
+ const reader = new FileReader();
6192
+ reader.readAsDataURL(file);
6193
+ reader.onload = () => resolve(reader.result);
6194
+ reader.onerror = (error) => reject(error);
6195
+ });
6196
+ var useAntdImageUpload = ({ length = 1 }) => {
6197
+ const [fileList, setFileList] = useState18([]);
6198
+ const [previewOpen, setPreviewOpen] = useState18(false);
6199
+ const [previewImage, setPreviewImage] = useState18("");
6200
+ const handlePreview = async (file) => {
6201
+ if (!file.url && !file.preview) {
6202
+ file.preview = await getBase64(file.originFileObj);
6203
+ }
6204
+ setPreviewImage(file.url || file.preview);
6205
+ setPreviewOpen(true);
6206
+ };
6207
+ const handleChange = ({ fileList: newFileList }) => {
6208
+ setFileList(
6209
+ newFileList.map((f) => ({
6210
+ ...f,
6211
+ status: "done"
6212
+ // mark done immediately
6213
+ }))
6214
+ );
6215
+ };
6216
+ const ImageBox = () => /* @__PURE__ */ jsxs22(Fragment7, { children: [
6217
+ /* @__PURE__ */ jsx30(
6218
+ Upload,
6219
+ {
6220
+ listType: "picture-card",
6221
+ fileList,
6222
+ onPreview: handlePreview,
6223
+ onChange: handleChange,
6224
+ beforeUpload: () => false,
6225
+ children: fileList.length >= length ? null : /* @__PURE__ */ jsxs22("button", { style: { border: 0, background: "none" }, type: "button", children: [
6226
+ /* @__PURE__ */ jsx30(PlusOutlined_default2, {}),
6227
+ /* @__PURE__ */ jsx30("div", { style: { marginTop: 8 }, children: "Upload" })
6228
+ ] })
6229
+ }
6230
+ ),
6231
+ previewImage && /* @__PURE__ */ jsx30(
6232
+ Image,
6233
+ {
6234
+ style: { display: "none" },
6235
+ preview: {
6236
+ visible: previewOpen,
6237
+ onVisibleChange: (visible) => setPreviewOpen(visible),
6238
+ afterOpenChange: (visible) => !visible && setPreviewImage("")
6239
+ },
6240
+ src: previewImage
6241
+ }
6242
+ )
6243
+ ] });
6244
+ return { ImageBox, fileList, setFileList };
6245
+ };
6246
+ var useAntdImageUpload_default = useAntdImageUpload;
4824
6247
  export {
4825
6248
  Badge,
4826
6249
  Branding,
@@ -4864,6 +6287,7 @@ export {
4864
6287
  generatePdf,
4865
6288
  storage,
4866
6289
  useA4DataView_default as useA4StatementView,
6290
+ useAntdImageUpload_default as useAntdImageUpload,
4867
6291
  useApis_default as useApi,
4868
6292
  useModal,
4869
6293
  useSearchApiContext,