@beeintel/batch-image 0.0.0-stage → 1.0.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 (241) hide show
  1. package/FONT-LICENSE.txt +93 -0
  2. package/README.md +184 -3
  3. package/dist/assets/11st-D7qGO5e4.webp +0 -0
  4. package/dist/assets/UPNG-CPfdwFSy.js +2298 -0
  5. package/dist/assets/adjust-card-B63b81iV.webp +0 -0
  6. package/dist/assets/adjust-final.worker-C2JbTvv5.js +6945 -0
  7. package/dist/assets/amazon-CjTtpZTq.webp +0 -0
  8. package/dist/assets/ascii_art-B4UGbtGs.webp +0 -0
  9. package/dist/assets/auction-j26eVUQO.webp +0 -0
  10. package/dist/assets/background-DGdZUdkL.webp +0 -0
  11. package/dist/assets/background-card-wK7DRpvM.png +0 -0
  12. package/dist/assets/body-CUFdRg8w.webp +0 -0
  13. package/dist/assets/bounded-cutout.worker-BZR6mbaI.js +9615 -0
  14. package/dist/assets/brand-mark-card-cFUeDeO2.webp +0 -0
  15. package/dist/assets/buyma-dAxYNjow.webp +0 -0
  16. package/dist/assets/codec.worker-7W6hmsm6.js +7349 -0
  17. package/dist/assets/contour_lines-C_CqrgV1.webp +0 -0
  18. package/dist/assets/creema-B1tWyCPx.webp +0 -0
  19. package/dist/assets/crop-final.worker-Owin7TvX.js +7035 -0
  20. package/dist/assets/cutout-CzMvV5An.webp +0 -0
  21. package/dist/assets/cutout-card-CN4gNFBz.png +0 -0
  22. package/dist/assets/cutout.worker-DyH6Prbn.js +3894 -0
  23. package/dist/assets/depop-CkVC5Fn1.webp +0 -0
  24. package/dist/assets/dewrinkle-kFzP6LqD.webp +0 -0
  25. package/dist/assets/dither-CcxmO2e6.webp +0 -0
  26. package/dist/assets/douyin-CP_HwBDF.webp +0 -0
  27. package/dist/assets/download.worker-DnGSB6P_.js +17779 -0
  28. package/dist/assets/duotone-Cdg_3fQf.webp +0 -0
  29. package/dist/assets/ebay-CxLfrRAf.webp +0 -0
  30. package/dist/assets/edit-Cv-txfZm.webp +0 -0
  31. package/dist/assets/effect.worker-qu1eCcII.js +9227 -0
  32. package/dist/assets/engraving-BENh1O2O.webp +0 -0
  33. package/dist/assets/etsy-CSvz9GpY.webp +0 -0
  34. package/dist/assets/expand-C60VE9nK.webp +0 -0
  35. package/dist/assets/facebook-Ca2nJJiQ.webp +0 -0
  36. package/dist/assets/film_stock-Bqauwcq4.webp +0 -0
  37. package/dist/assets/final.worker-BnzJ3N5C.js +7035 -0
  38. package/dist/assets/final.worker-Csc1zoYS.js +7054 -0
  39. package/dist/assets/final.worker-DzBFT9xk.js +6922 -0
  40. package/dist/assets/final.worker-XpgKnlaz.js +7217 -0
  41. package/dist/assets/flatlay-CPiVmlAa.webp +0 -0
  42. package/dist/assets/flatlay-fold-B-CRYy87.webp +0 -0
  43. package/dist/assets/flatlay-open-Dzas8okC.webp +0 -0
  44. package/dist/assets/g-market-DXuYK_JH.webp +0 -0
  45. package/dist/assets/ghost-BCEAx_Zx.webp +0 -0
  46. package/dist/assets/ghost-front-WFgA4sUo.webp +0 -0
  47. package/dist/assets/ghost-three-quarter-Rt8cXj34.webp +0 -0
  48. package/dist/assets/gif-CObOIITx.js +303 -0
  49. package/dist/assets/glass_tiles-3IXP-Hmg.webp +0 -0
  50. package/dist/assets/glitch_art-D1i3qben.webp +0 -0
  51. package/dist/assets/glitch_blur-C4q_9zyq.webp +0 -0
  52. package/dist/assets/glow-Bv9EHBU5.webp +0 -0
  53. package/dist/assets/gradient_map-BR-UVYMP.webp +0 -0
  54. package/dist/assets/halftone-CWdKu2_6.webp +0 -0
  55. package/dist/assets/holo_sticker-BQDikLg2.webp +0 -0
  56. package/dist/assets/idus-7diqRNPs.webp +0 -0
  57. package/dist/assets/imagetracer.worker-CgunQTPG.js +7096 -0
  58. package/dist/assets/instagram-Bf0IVidT.webp +0 -0
  59. package/dist/assets/kakao-talk-Df79L_Mv.webp +0 -0
  60. package/dist/assets/kaleidoscope-BxqMZuWo.webp +0 -0
  61. package/dist/assets/karrot-BXFPhDwt.webp +0 -0
  62. package/dist/assets/kaufland-BDDy6e0C.webp +0 -0
  63. package/dist/assets/lazada-ConR4e1O.webp +0 -0
  64. package/dist/assets/lens_flare-DgyiAv_j.webp +0 -0
  65. package/dist/assets/light_leak-kUdpoFuC.webp +0 -0
  66. package/dist/assets/line-Dr1j___B.webp +0 -0
  67. package/dist/assets/linkedin-4s_9Wh03.webp +0 -0
  68. package/dist/assets/lo_fi-DSdl3yY_.webp +0 -0
  69. package/dist/assets/logo-preparation.worker-D9oa7SME.js +420 -0
  70. package/dist/assets/mercado-libre-C8CskEiS.webp +0 -0
  71. package/dist/assets/mercari-jp-DHj7nz4O.webp +0 -0
  72. package/dist/assets/metadata.worker-B_9_BgN1.js +6456 -0
  73. package/dist/assets/mirror_collage-JtSKCeSh.webp +0 -0
  74. package/dist/assets/model-BbeF-fsf.webp +0 -0
  75. package/dist/assets/model-BjWhieit.webp +0 -0
  76. package/dist/assets/momo-BWXO_8Df.webp +0 -0
  77. package/dist/assets/motion_blur-B8YUHeSg.webp +0 -0
  78. package/dist/assets/naver-xQKL8lWg.webp +0 -0
  79. package/dist/assets/nuvemshop-DPt6rnA-.webp +0 -0
  80. package/dist/assets/olx-B87gp-Il.webp +0 -0
  81. package/dist/assets/orient-card-Da0ii6mX.webp +0 -0
  82. package/dist/assets/orient-final.worker-CdF5Y5zD.js +6909 -0
  83. package/dist/assets/orientation-preview.worker-B7uFzz3J.js +6865 -0
  84. package/dist/assets/ort.bundle.min-CreFV8V1.js +9311 -0
  85. package/dist/assets/ort.webgpu.bundle.min-CAudaHZO.js +9311 -0
  86. package/dist/assets/otto-market-DWZyNKJn.webp +0 -0
  87. package/dist/assets/paper_texture-CXphyIrs.webp +0 -0
  88. package/dist/assets/pinterest-ByZqih2J.webp +0 -0
  89. package/dist/assets/polish-DFy6LNG7.webp +0 -0
  90. package/dist/assets/poshmark-DnZi2vA1.webp +0 -0
  91. package/dist/assets/posterize-SpLVGq1s.webp +0 -0
  92. package/dist/assets/preview.worker-DcrCKKWl.js +380 -0
  93. package/dist/assets/qoo10-C1pq81Jx.webp +0 -0
  94. package/dist/assets/rakuten-ulYog1hL.webp +0 -0
  95. package/dist/assets/recolor-mBX7vdFT.webp +0 -0
  96. package/dist/assets/resize-DVEAl0Um.webp +0 -0
  97. package/dist/assets/runtime-0663b902fb3937883a34.wasm +0 -0
  98. package/dist/assets/runtime-355a5c80c7bfdf8737de.mjs +2817 -0
  99. package/dist/assets/runtime-49871f5a4409519797e1.wasm +0 -0
  100. package/dist/assets/runtime-74cf72f9a2b7befc115a.mjs +2817 -0
  101. package/dist/assets/shadow-card-DTZEH60r.png +0 -0
  102. package/dist/assets/shopee-Bxfei6sj.webp +0 -0
  103. package/dist/assets/shopify-wVaBafcF.webp +0 -0
  104. package/dist/assets/shopline-DMoaJ7Bh.webp +0 -0
  105. package/dist/assets/sparkle-CD5GSGip.webp +0 -0
  106. package/dist/assets/ssg-DQoFx5u5.webp +0 -0
  107. package/dist/assets/staging-CIc8pQJ6.webp +0 -0
  108. package/dist/assets/standard-cutout.worker-BYLzdpR-.js +1261 -0
  109. package/dist/assets/text-DQW2mBGp.webp +0 -0
  110. package/dist/assets/textured_glass-D2coxp7n.webp +0 -0
  111. package/dist/assets/tga-VGxWDes0.js +752 -0
  112. package/dist/assets/tilt_shift-BKs46yeX.webp +0 -0
  113. package/dist/assets/transformers.web-DB57cIO5.js +28891 -0
  114. package/dist/assets/tritone-CcR4qizk.webp +0 -0
  115. package/dist/assets/upscale-BrLadyUk.webp +0 -0
  116. package/dist/assets/upscale-creative-DnZnQufJ.webp +0 -0
  117. package/dist/assets/upscale-crisp-Ckdmbsnn.webp +0 -0
  118. package/dist/assets/vinted-1QDsxvC6.webp +0 -0
  119. package/dist/assets/watercolor-CV67zYNE.webp +0 -0
  120. package/dist/assets/watermark-CpPrxaT5.webp +0 -0
  121. package/dist/assets/wave_distortion-CV5jVfK4.webp +0 -0
  122. package/dist/assets/whatsapp-CWJxqzR6.webp +0 -0
  123. package/dist/assets/worker-DfrCFP3O.js +55 -0
  124. package/dist/assets/xerox_noise-CbbHY1S1.webp +0 -0
  125. package/dist/assets/youtube-DS12d5mi.webp +0 -0
  126. package/dist/assets/zalando-CenfWOwz.webp +0 -0
  127. package/dist/browser-adapter.d.ts +4 -0
  128. package/dist/browser-cutout-capability.d.ts +4 -0
  129. package/dist/browser-cutout-resources.d.ts +3 -0
  130. package/dist/browser-local-capabilities.d.ts +5 -0
  131. package/dist/capabilities.d.ts +18 -0
  132. package/dist/chunks/AdjustToolPanel-BELqYSUR.js +195 -0
  133. package/dist/chunks/BackgroundToolPanel-Dy_l8KFl.js +41 -0
  134. package/dist/chunks/BatchMaterials-niGKrga3.js +806 -0
  135. package/dist/chunks/BatchModeChoices-BRqn6zNI.js +111 -0
  136. package/dist/chunks/BatchOutputColorPicker-CCvmIF-b.js +75 -0
  137. package/dist/chunks/BatchReferenceFields-C4t7OSTw.js +316 -0
  138. package/dist/chunks/BeautifyToolPanel-Dc-ddaBC.js +215 -0
  139. package/dist/chunks/BrandMarkToolPanel-FKxXth_3.js +1179 -0
  140. package/dist/chunks/ContentTrimControl-BQfigZPq.js +297 -0
  141. package/dist/chunks/CropToolPanel-BhSuHkYm.js +218 -0
  142. package/dist/chunks/CutoutToolPanel-BfaZZSE_.js +73 -0
  143. package/dist/chunks/DisclosureToolPanel-B_oc5fld.js +76 -0
  144. package/dist/chunks/ExpandToolPanel-D_ZODTUZ.js +67 -0
  145. package/dist/chunks/ImageEffectsToolPanel-BRLPIt4q.js +966 -0
  146. package/dist/chunks/IpAuditToolPanel-DfY-mBSe.js +96 -0
  147. package/dist/chunks/ListingToolPanel-B9Yh3LBK.js +783 -0
  148. package/dist/chunks/MaterialSelectionPlate-DhioUjdW.js +30 -0
  149. package/dist/chunks/MetadataToolPanel-KVrtb3K0.js +104 -0
  150. package/dist/chunks/OrientToolPanel-BTrwaWBm.js +161 -0
  151. package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js +102 -0
  152. package/dist/chunks/ResizeToolPanel-Ch_-WR74.js +1178 -0
  153. package/dist/chunks/RetouchToolPanel-BTS33Dsd.js +350 -0
  154. package/dist/chunks/ShadowToolPanel-DxJE4eyV.js +254 -0
  155. package/dist/chunks/SvgExportToolPanel-RHmuQARH.js +219 -0
  156. package/dist/chunks/TranslationToolPanel-B_qTA1hM.js +125 -0
  157. package/dist/chunks/UpscaleToolPanel-D0H-j2Tr.js +127 -0
  158. package/dist/chunks/engine-D-T-1RSx.js +69 -0
  159. package/dist/chunks/entry-DK9FjQZ_.js +42946 -0
  160. package/dist/chunks/gpu-CScw5MNG.js +231 -0
  161. package/dist/chunks/hosted-resources-COzZ7nZY.js +8196 -0
  162. package/dist/chunks/loader-circle-UFoEem2a.js +16 -0
  163. package/dist/chunks/motionFeatures-D4miwXxc.js +4405 -0
  164. package/dist/chunks/search-BjTSm1KS.js +18 -0
  165. package/dist/chunks/standard-cutout-vPpP6xBc.js +45 -0
  166. package/dist/chunks/static-logo-2F9ORZWc.js +34 -0
  167. package/dist/config.d.ts +66 -0
  168. package/dist/contracts.d.ts +272 -0
  169. package/dist/index.d.ts +23 -0
  170. package/dist/index.js +13 -0
  171. package/dist/node/catalog.mjs +45 -0
  172. package/dist/node/cli.mjs +11 -0
  173. package/dist/node/index.d.mts +20 -0
  174. package/dist/node/index.mjs +2 -0
  175. package/dist/node/prepare.mjs +114 -0
  176. package/dist/node/vite.mjs +46 -0
  177. package/dist/processing.d.ts +1 -0
  178. package/dist/processing.js +12105 -0
  179. package/dist/remote-contracts.d.ts +114 -0
  180. package/dist/resource-contracts.d.ts +40 -0
  181. package/dist/resources/cutout/9ae2e5375a34fa413530954dc20d085d175faffc86108c13619220d0557f80bf.json +1 -0
  182. package/dist/resources/cutout/f119dabecc64bc436d3d08425dde96ec2598fd40541eba97d8d53a4e8bbdcaea.json +1 -0
  183. package/dist/resources/cutout/resources.json +195 -0
  184. package/dist/resources/cutout/sources.json +294 -0
  185. package/dist/resources.json +1191 -0
  186. package/dist/service-contracts.d.ts +43 -0
  187. package/dist/slots.d.ts +21 -0
  188. package/dist/style.css +1 -0
  189. package/dist/types/batch/api.d.ts +89 -0
  190. package/dist/types/batch/cutout-output.d.ts +2 -0
  191. package/dist/types/batch/features/background/engine.d.mts +12 -0
  192. package/dist/types/batch/features/basic-edit/contracts.d.ts +87 -0
  193. package/dist/types/batch/features/basic-edit/engine.d.mts +96 -0
  194. package/dist/types/batch/features/brand-mark/contracts.d.ts +84 -0
  195. package/dist/types/batch/features/brand-mark/engine.d.mts +68 -0
  196. package/dist/types/batch/features/export-compression/contracts.d.ts +44 -0
  197. package/dist/types/batch/features/export-compression/gifenc.d.ts +33 -0
  198. package/dist/types/batch/features/export-compression/plan.d.ts +45 -0
  199. package/dist/types/batch/features/export-compression/presentation.d.ts +70 -0
  200. package/dist/types/batch/features/export-compression/upng.d.ts +6 -0
  201. package/dist/types/batch/features/final-image/resize.d.mts +15 -0
  202. package/dist/types/batch/features/image-effects/contracts.d.ts +58 -0
  203. package/dist/types/batch/features/image-effects/gpu-pixel-runtime.d.ts +15 -0
  204. package/dist/types/batch/features/image-effects/photo-audit.d.ts +21 -0
  205. package/dist/types/batch/features/image-effects/photo-v7-cpu.d.ts +9 -0
  206. package/dist/types/batch/features/image-effects/profiles-v4.d.ts +157 -0
  207. package/dist/types/batch/features/image-effects/profiles-v5.d.ts +20 -0
  208. package/dist/types/batch/features/image-effects/profiles-v6.d.ts +14 -0
  209. package/dist/types/batch/features/image-effects/profiles-v7.d.ts +53 -0
  210. package/dist/types/batch/features/image-effects/profiles-v8.d.ts +113 -0
  211. package/dist/types/batch/features/image-effects/profiles-v9.d.ts +20 -0
  212. package/dist/types/batch/features/image-translation/params.d.ts +257 -0
  213. package/dist/types/batch/features/listing-remake/transport.d.ts +21 -0
  214. package/dist/types/batch/features/metadata/bytes.d.mts +13 -0
  215. package/dist/types/batch/features/metadata/containers.d.mts +20 -0
  216. package/dist/types/batch/features/metadata/declaration.d.mts +5 -0
  217. package/dist/types/batch/features/metadata/engine.d.mts +9 -0
  218. package/dist/types/batch/features/metadata/exchange.d.mts +48 -0
  219. package/dist/types/batch/features/shadow/contracts.d.ts +43 -0
  220. package/dist/types/batch/features/shadow/engine.d.mts +33 -0
  221. package/dist/types/batch/features/svg-export/download-contract.d.ts +33 -0
  222. package/dist/types/batch/features/svg-export/download-prepare.d.ts +2 -0
  223. package/dist/types/batch/features/svg-export/download.d.ts +7 -0
  224. package/dist/types/batch/features/svg-export/imagetracer.d.ts +6 -0
  225. package/dist/types/batch/features/svg-export/optimizer.d.ts +2 -0
  226. package/dist/types/batch/ids.d.ts +1 -0
  227. package/dist/types/batch/model.d.ts +317 -0
  228. package/dist/types/batch/public/config.d.ts +66 -0
  229. package/dist/types/batch/public/contracts.d.ts +272 -0
  230. package/dist/types/batch/public/remote-contracts.d.ts +114 -0
  231. package/dist/types/batch/public/resource-contracts.d.ts +40 -0
  232. package/dist/types/batch/public/service-contracts.d.ts +43 -0
  233. package/dist/types/batch/queue.d.ts +34 -0
  234. package/dist/types/batch/receipts.d.ts +85 -0
  235. package/dist/types/batch/retention.d.ts +13 -0
  236. package/dist/types/onnxruntime-web.d.ts +5 -0
  237. package/dist/types/plugins/cutout/core/hosted-resources.d.ts +11 -0
  238. package/dist/types/processing.d.ts +18 -0
  239. package/dist/types/shared/svg-security.d.mts +4 -0
  240. package/dist/types/workspace-worker.d.ts +2 -0
  241. package/package.json +95 -6
@@ -0,0 +1,111 @@
1
+ import { defineComponent as L, openBlock as a, createElementBlock as s, createElementVNode as o, toDisplayString as b, unref as r, Fragment as h, renderList as m, createCommentVNode as g } from "vue";
2
+ import { F as B, D as M, _ as v } from "./entry-DK9FjQZ_.js";
3
+ const C = { class: "batch-mode-choices" }, V = { class: "mode-label" }, A = ["aria-label"], D = ["aria-label", "aria-pressed", "disabled", "onClick", "onKeydown"], E = ["src"], I = {
4
+ key: 1,
5
+ viewBox: "0 0 120 76",
6
+ "aria-hidden": "true"
7
+ }, N = {
8
+ fill: "#f3f5ed",
9
+ stroke: "#899774",
10
+ "stroke-width": "1.4"
11
+ }, S = ["y"], F = ["y"], H = { key: 2 }, K = /* @__PURE__ */ L({
12
+ __name: "BatchModeChoices",
13
+ props: {
14
+ modelValue: {},
15
+ label: {},
16
+ options: {},
17
+ disabled: { type: Boolean }
18
+ },
19
+ emits: ["update:modelValue"],
20
+ setup(i, { emit: k }) {
21
+ const { ui: R, uiText: d, batchI18n: x } = B(), { displayState: w } = M(), u = i, p = k;
22
+ function f(n) {
23
+ !u.disabled && !n.disabled && p("update:modelValue", n.value);
24
+ }
25
+ function _(n, t) {
26
+ if (!["ArrowLeft", "ArrowRight"].includes(n.key)) return;
27
+ n.preventDefault(), n.stopPropagation();
28
+ const e = (n.key === "ArrowRight" ? 1 : -1) * (w.value.direction === "rtl" ? -1 : 1), l = u.options.indexOf(t);
29
+ for (let c = l + e; c >= 0 && c < u.options.length; c += e) {
30
+ const y = u.options[c];
31
+ if (!(y.disabled || u.disabled)) {
32
+ f(y), n.currentTarget.parentElement?.querySelectorAll("button")[c]?.focus();
33
+ break;
34
+ }
35
+ }
36
+ }
37
+ return (n, t) => (a(), s("section", C, [
38
+ o("span", V, b(r(d)(i.label)), 1),
39
+ o("div", {
40
+ class: "mode-options",
41
+ role: "group",
42
+ "aria-label": r(d)(i.label)
43
+ }, [
44
+ (a(!0), s(h, null, m(i.options, (e) => (a(), s("button", {
45
+ key: e.value,
46
+ type: "button",
47
+ "aria-label": r(d)(i.label) + (r(x).global.locale.value === "zh-CN" ? ":" : ": ") + r(d)(e.label),
48
+ "aria-pressed": i.modelValue === e.value,
49
+ disabled: i.disabled || e.disabled,
50
+ onClick: (l) => f(e),
51
+ onKeydown: (l) => _(l, e)
52
+ }, [
53
+ e.image ? (a(), s("img", {
54
+ key: 0,
55
+ src: e.image,
56
+ alt: ""
57
+ }, null, 8, E)) : e.flow ? (a(), s("svg", I, [
58
+ o("g", N, [
59
+ e.flow === "one-to-many" ? (a(), s(h, { key: 0 }, [
60
+ t[0] || (t[0] = o("rect", {
61
+ x: "8",
62
+ y: "26",
63
+ width: "25",
64
+ height: "26",
65
+ rx: "4"
66
+ }, null, -1)),
67
+ (a(), s(h, null, m([5, 28, 51], (l) => o("rect", {
68
+ key: l,
69
+ x: "87",
70
+ y: l,
71
+ width: "25",
72
+ height: "20",
73
+ rx: "3"
74
+ }, null, 8, S)), 64)),
75
+ t[1] || (t[1] = o("path", {
76
+ d: "M39 39H76M65 31L77 39L65 47M83 15L77 39L83 61",
77
+ fill: "none"
78
+ }, null, -1))
79
+ ], 64)) : (a(), s(h, { key: 1 }, [
80
+ (a(), s(h, null, m([5, 28, 51], (l) => o("rect", {
81
+ key: l,
82
+ x: "8",
83
+ y: l,
84
+ width: "25",
85
+ height: "20",
86
+ rx: "3"
87
+ }, null, 8, F)), 64)),
88
+ t[2] || (t[2] = o("rect", {
89
+ x: "87",
90
+ y: "26",
91
+ width: "25",
92
+ height: "26",
93
+ rx: "4"
94
+ }, null, -1)),
95
+ t[3] || (t[3] = o("path", {
96
+ d: "M39 15L45 39L39 61M46 39H77M65 31L77 39L65 47",
97
+ fill: "none"
98
+ }, null, -1))
99
+ ], 64))
100
+ ])
101
+ ])) : g("", !0),
102
+ o("strong", null, b(r(d)(e.label)), 1),
103
+ e.description ? (a(), s("small", H, b(r(d)(e.description)), 1)) : g("", !0)
104
+ ], 40, D))), 128))
105
+ ], 8, A)
106
+ ]));
107
+ }
108
+ }), z = /* @__PURE__ */ v(K, [["__scopeId", "data-v-aed5bfa1"]]);
109
+ export {
110
+ z as B
111
+ };
@@ -0,0 +1,75 @@
1
+ import { defineComponent as _, ref as p, computed as b, watch as w, openBlock as P, createElementBlock as V, unref as o, createElementVNode as s, normalizeClass as h, normalizeStyle as B } from "vue";
2
+ import { F as y, _ as g } from "./entry-DK9FjQZ_.js";
3
+ const $ = ["aria-label"], I = ["title", "aria-label", "aria-pressed", "disabled"], S = ["title", "aria-label", "aria-pressed", "disabled"], z = ["data-selected", "title"], E = ["aria-label", "value", "disabled"], L = /* @__PURE__ */ _({
4
+ __name: "BatchOutputColorPicker",
5
+ props: {
6
+ modelValue: {},
7
+ disabled: { type: Boolean }
8
+ },
9
+ emits: ["update:modelValue"],
10
+ setup(i, { emit: v }) {
11
+ const { ui: l, uiText: O } = y(), a = i, C = v, n = (t) => /^#[0-9a-f]{6}$/i.test(t), c = p(a.modelValue), u = p(n(a.modelValue) ? a.modelValue : "#ffffff"), d = b(() => a.modelValue.toLowerCase()), k = b(() => n(d.value) && d.value !== "#ffffff");
12
+ w(
13
+ () => a.modelValue,
14
+ (t) => {
15
+ c.value = t, n(t) && t.toLowerCase() !== "#ffffff" && (u.value = t);
16
+ }
17
+ );
18
+ function r(t) {
19
+ !a.disabled && c.value !== t && (c.value = t, C("update:modelValue", t));
20
+ }
21
+ function f(t) {
22
+ const e = t.target.value;
23
+ !a.disabled && n(e) && (u.value = e, r(e));
24
+ }
25
+ return (t, e) => (P(), V("div", {
26
+ class: "output-color-swatches",
27
+ role: "group",
28
+ "aria-label": o(l)("common.outputColorPicker_1f1b490a")
29
+ }, [
30
+ s("button", {
31
+ type: "button",
32
+ class: "output-swatch transparent",
33
+ title: o(l)("common.outputColorPicker_a7c8ce08"),
34
+ "aria-label": o(l)("common.outputColorPicker_a7c8ce08"),
35
+ "aria-pressed": d.value === "transparent",
36
+ disabled: i.disabled,
37
+ onClick: e[0] || (e[0] = (m) => r("transparent"))
38
+ }, [...e[3] || (e[3] = [
39
+ s("span", null, null, -1)
40
+ ])], 8, I),
41
+ s("button", {
42
+ type: "button",
43
+ class: "output-swatch white",
44
+ title: o(l)("common.outputColorPicker_99a9258d"),
45
+ "aria-label": o(l)("common.outputColorPicker_99a9258d"),
46
+ "aria-pressed": d.value === "#ffffff",
47
+ disabled: i.disabled,
48
+ onClick: e[1] || (e[1] = (m) => r("#ffffff"))
49
+ }, [...e[4] || (e[4] = [
50
+ s("span", null, null, -1)
51
+ ])], 8, S),
52
+ s("label", {
53
+ class: h(["output-swatch custom-swatch", { disabled: i.disabled }]),
54
+ "data-selected": k.value,
55
+ title: o(l)("common.outputColorPicker_91d3d418", { p0: u.value })
56
+ }, [
57
+ s("span", {
58
+ style: B({ backgroundColor: u.value })
59
+ }, null, 4),
60
+ s("input", {
61
+ type: "color",
62
+ "aria-label": o(l)("common.outputColorPicker_79e6325f"),
63
+ value: u.value,
64
+ disabled: i.disabled,
65
+ onClick: e[2] || (e[2] = (m) => r(u.value)),
66
+ onInput: f,
67
+ onChange: f
68
+ }, null, 40, E)
69
+ ], 10, z)
70
+ ], 8, $));
71
+ }
72
+ }), N = /* @__PURE__ */ g(L, [["__scopeId", "data-v-cf9564ca"]]);
73
+ export {
74
+ N as B
75
+ };
@@ -0,0 +1,316 @@
1
+ import { defineComponent as x, inject as ee, ref as R, computed as P, watch as B, onUnmounted as ae, openBlock as m, createElementBlock as v, unref as a, normalizeClass as te, createElementVNode as n, toDisplayString as u, Fragment as T, renderList as A, createCommentVNode as y, createVNode as V, createTextVNode as L, nextTick as M } from "vue";
2
+ import { J as S, aQ as le, F as re, aa as ne, aR as oe, aw as se, aj as ce, ah as ie, ay as ue, _ as de } from "./entry-DK9FjQZ_.js";
3
+ import { L as fe } from "./loader-circle-UFoEem2a.js";
4
+ /**
5
+ * @license @lucide/vue v1.47.0 - ISC
6
+ *
7
+ * This source code is licensed under the ISC license.
8
+ * See the LICENSE file in the root directory of this source tree.
9
+ */
10
+ const me = {
11
+ name: "arrow-down",
12
+ size: 24,
13
+ node: [
14
+ ["path", { d: "M12 5v14", key: "s699le" }],
15
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
16
+ ]
17
+ }, ve = S(me);
18
+ /**
19
+ * @license @lucide/vue v1.47.0 - ISC
20
+ *
21
+ * This source code is licensed under the ISC license.
22
+ * See the LICENSE file in the root directory of this source tree.
23
+ */
24
+ const be = {
25
+ name: "arrow-up",
26
+ size: 24,
27
+ node: [
28
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
29
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
30
+ ]
31
+ }, pe = S(be), he = ["aria-label"], ge = { class: "retouch-reference-heading" }, we = { class: "hint" }, ye = ["aria-label", "disabled"], ke = { class: "retouch-reference-list" }, Fe = { class: "retouch-reference-title" }, Re = ["src", "alt"], Ve = { class: "reference-number" }, _e = ["aria-label", "disabled", "onClick"], Ce = ["title"], Le = { class: "reference-settings" }, Ue = { class: "reference-order" }, Ie = ["aria-label", "disabled", "onClick"], Ee = ["aria-label", "disabled", "onClick"], Ne = { key: 0 }, Oe = ["aria-label", "value", "disabled", "onChange"], $e = { value: "" }, ze = ["value"], De = ["aria-label", "value", "disabled", "placeholder", "onInput"], je = {
32
+ key: 0,
33
+ class: "reference-pending",
34
+ role: "status"
35
+ }, Pe = {
36
+ key: 1,
37
+ class: "reference-add"
38
+ }, Be = ["aria-label", "disabled"], Te = { class: "reference-upload-copy" }, Ae = {
39
+ key: 0,
40
+ class: "tool-note",
41
+ role: "alert"
42
+ }, Me = ["aria-label", "disabled"], Se = {
43
+ key: 1,
44
+ role: "alert",
45
+ class: "retouch-error"
46
+ }, qe = /* @__PURE__ */ x({
47
+ __name: "BatchReferenceFields",
48
+ props: {
49
+ modelValue: {},
50
+ writer: { type: Boolean },
51
+ candidates: { default: () => [] },
52
+ roles: { default: () => [] },
53
+ defaultRoleLabel: { default: "" },
54
+ maxCount: { default: le },
55
+ title: { default: "共用参考图" },
56
+ description: { default: "整批共用同一组。每张待改图为图 1,参考依顺序为图 2–11;用途可选,具体修改以文字要求为准。" },
57
+ numberOffset: { default: 2 },
58
+ uploadLabel: { default: "上传参考图" },
59
+ confirmLabel: { default: "确认当前参考集合" },
60
+ purposePlaceholder: { default: "例如:只参考颜色,不复制商品" }
61
+ },
62
+ emits: ["update:modelValue", "busy"],
63
+ setup(t, { emit: q }) {
64
+ const { ui: i, uiText: f } = re(), { uploadLocal: W } = ne(), X = ee(
65
+ oe,
66
+ (e) => W(e, e.name)
67
+ ), o = t, I = q, H = se(() => o.modelValue.references), E = R(), d = R(0), p = R(""), J = P(() => p.value ? i({
68
+ capacity: "common.referenceFields_5f066788",
69
+ format: "common.referenceFields_7bf5d70a",
70
+ upload: "common.referenceFields_dc2e4820"
71
+ }[p.value], {
72
+ p0: p.value === "capacity" ? o.maxCount : f(o.title)
73
+ }) : ""), _ = R(!1), h = R(/* @__PURE__ */ new Map());
74
+ let w = !1, k = 0;
75
+ const F = (e) => `${e.assetId}:${e.assetVersionId}`, C = P(
76
+ () => Math.max(0, o.maxCount - o.modelValue.references.length - d.value)
77
+ );
78
+ B(d, (e) => I("busy", e > 0), { immediate: !0 }), B(
79
+ () => o.writer,
80
+ (e) => {
81
+ e || k++;
82
+ }
83
+ );
84
+ function g(e) {
85
+ !o.writer || w || I("update:modelValue", {
86
+ references: o.modelValue.references,
87
+ referenceUploadNeedsReview: o.modelValue.referenceUploadNeedsReview,
88
+ ...e
89
+ });
90
+ }
91
+ function N(e, s) {
92
+ g({
93
+ references: o.modelValue.references.map(
94
+ (l, r) => r === e ? { ...l, ...s } : l
95
+ )
96
+ });
97
+ }
98
+ function O(e, s) {
99
+ const l = [...o.modelValue.references], r = e + s;
100
+ r < 0 || r >= l.length || ([l[e], l[r]] = [l[r], l[e]], g({ references: l }));
101
+ }
102
+ function K(e) {
103
+ if (!o.writer) return;
104
+ const s = o.modelValue.references[e];
105
+ if (!s) return;
106
+ const l = F(s), r = h.value.get(l);
107
+ o.modelValue.references.some((c, b) => b !== e && F(c) === l) || (r && URL.revokeObjectURL(r), h.value.delete(l)), g({ references: o.modelValue.references.filter((c, b) => b !== e) });
108
+ }
109
+ function $(e) {
110
+ return H.get(e) || h.value.get(F(e)) || "";
111
+ }
112
+ async function Q(e) {
113
+ const s = e.target, l = [...s.files ?? []];
114
+ s.value = "", await U(l);
115
+ }
116
+ function G(e) {
117
+ e.dataTransfer?.types.includes("Files") && (e.preventDefault(), e.stopPropagation(), _.value = o.writer && !d.value && !!C.value);
118
+ }
119
+ async function Y(e) {
120
+ e.dataTransfer?.types.includes("Files") && (e.preventDefault(), e.stopPropagation(), _.value = !1, await U([...e.dataTransfer.files ?? []]));
121
+ }
122
+ function Z(e) {
123
+ const s = ue(e);
124
+ s.length && (e.preventDefault(), e.stopPropagation(), U(s));
125
+ }
126
+ async function U(e) {
127
+ if (!e.length || !o.writer || d.value) return;
128
+ if (p.value = "", e.length > C.value) {
129
+ p.value = "capacity";
130
+ return;
131
+ }
132
+ if (e.some(
133
+ (c) => !["image/png", "image/jpeg", "image/webp"].includes(c.type) || !c.size || c.size > 25 * 1024 * 1024
134
+ )) {
135
+ p.value = "format";
136
+ return;
137
+ }
138
+ const s = !!o.modelValue.referenceUploadNeedsReview, l = k;
139
+ let r = !1;
140
+ g({ referenceUploadNeedsReview: !0 }), d.value = e.length;
141
+ try {
142
+ for (const c of e) {
143
+ if (w || !o.writer || l !== k) return;
144
+ try {
145
+ const b = await X(c);
146
+ if (w || !o.writer || l !== k) return;
147
+ if (!b.assetId || !b.assetVersionId || !/^[a-fA-F0-9]{64}$/.test(b.sha256))
148
+ throw new Error("Invalid upload receipt");
149
+ const z = {
150
+ assetId: b.assetId,
151
+ assetVersionId: b.assetVersionId,
152
+ sha256: b.sha256,
153
+ name: c.name
154
+ }, D = F(z), j = h.value.get(D);
155
+ j && URL.revokeObjectURL(j), h.value.set(D, URL.createObjectURL(c)), g({ references: [...o.modelValue.references, z] }), await M();
156
+ } catch {
157
+ r = !0, w || (p.value = "upload");
158
+ } finally {
159
+ d.value--;
160
+ }
161
+ }
162
+ await M(), !w && o.writer && l === k && !r && !s && g({ referenceUploadNeedsReview: !1 });
163
+ } finally {
164
+ d.value = 0;
165
+ }
166
+ }
167
+ return ae(() => {
168
+ w = !0;
169
+ for (const e of h.value.values()) URL.revokeObjectURL(e);
170
+ h.value.clear();
171
+ }), (e, s) => (m(), v("section", {
172
+ tabindex: "0",
173
+ onPaste: Z,
174
+ class: te(["retouch-references", { dragging: _.value }]),
175
+ "aria-label": a(f)(t.title),
176
+ onDragover: G,
177
+ onDragleave: s[2] || (s[2] = (l) => _.value = !1),
178
+ onDrop: Y
179
+ }, [
180
+ n("div", ge, [
181
+ n("strong", null, u(a(f)(t.title)), 1),
182
+ n("span", null, u(t.modelValue.references.length) + " / " + u(t.maxCount), 1)
183
+ ]),
184
+ n("p", we, u(a(f)(t.description)), 1),
185
+ n("input", {
186
+ ref_key: "fileInput",
187
+ ref: E,
188
+ type: "file",
189
+ accept: "image/png,image/jpeg,image/webp",
190
+ multiple: "",
191
+ class: "retouch-file-input",
192
+ "aria-label": a(f)(t.uploadLabel),
193
+ disabled: !t.writer || d.value > 0 || !C.value,
194
+ onChange: Q
195
+ }, null, 40, ye),
196
+ n("ol", ke, [
197
+ (m(!0), v(T, null, A(t.modelValue.references, (l, r) => (m(), v("li", {
198
+ key: `${F(l)}:${r}`,
199
+ class: "retouch-reference batch-reference"
200
+ }, [
201
+ n("div", Fe, [
202
+ $(l) ? (m(), v("img", {
203
+ key: 0,
204
+ src: $(l),
205
+ alt: l.name,
206
+ loading: "lazy"
207
+ }, null, 8, Re)) : y("", !0),
208
+ n("strong", Ve, u(a(i)("common.referenceFields_d7084142", { p0: r + t.numberOffset })), 1),
209
+ n("button", {
210
+ type: "button",
211
+ "aria-label": a(i)("common.referenceFields_405c85b2", { p0: r + t.numberOffset }),
212
+ disabled: !t.writer,
213
+ onClick: (c) => K(r)
214
+ }, [
215
+ V(a(ce), { size: 14 })
216
+ ], 8, _e)
217
+ ]),
218
+ n("small", {
219
+ class: "reference-name",
220
+ title: l.name
221
+ }, u(l.name), 9, Ce),
222
+ n("details", Le, [
223
+ n("summary", null, u(a(i)("common.referenceFields_75359a48")), 1),
224
+ n("div", Ue, [
225
+ n("button", {
226
+ type: "button",
227
+ "aria-label": a(i)("common.referenceFields_8aa5f1b3", { p0: r + t.numberOffset }),
228
+ disabled: !t.writer || r === 0 || d.value > 0,
229
+ onClick: (c) => O(r, -1)
230
+ }, [
231
+ V(a(pe), { size: 14 }),
232
+ L(u(a(i)("common.referenceFields_708c9687")), 1)
233
+ ], 8, Ie),
234
+ n("button", {
235
+ type: "button",
236
+ "aria-label": a(i)("common.referenceFields_18e2d946", { p0: r + t.numberOffset }),
237
+ disabled: !t.writer || r === t.modelValue.references.length - 1 || d.value > 0,
238
+ onClick: (c) => O(r, 1)
239
+ }, [
240
+ V(a(ve), { size: 14 }),
241
+ L(u(a(i)("common.referenceFields_c0714215")), 1)
242
+ ], 8, Ee)
243
+ ]),
244
+ t.roles.length ? (m(), v("label", Ne, [
245
+ L(u(a(i)("common.referenceFields_76335454")), 1),
246
+ n("select", {
247
+ "aria-label": a(i)("common.referenceFields_1e100229", { p0: r + t.numberOffset }),
248
+ value: l.role ?? "",
249
+ disabled: !t.writer,
250
+ onChange: (c) => N(r, {
251
+ role: c.target.value || void 0
252
+ })
253
+ }, [
254
+ n("option", $e, u(t.defaultRoleLabel ? a(i)("common.referenceFields_0acbcb84", {
255
+ p0: a(f)(t.defaultRoleLabel)
256
+ }) : a(i)("common.referenceFields_f91a63a1")), 1),
257
+ (m(!0), v(T, null, A(t.roles, (c) => (m(), v("option", {
258
+ key: c.value,
259
+ value: c.value
260
+ }, u(a(f)(c.label)), 9, ze))), 128))
261
+ ], 40, Oe)
262
+ ])) : y("", !0),
263
+ n("label", null, [
264
+ L(u(a(i)("common.referenceFields_d59f7895")), 1),
265
+ n("input", {
266
+ "aria-label": a(i)("common.referenceFields_17d29b80", { p0: r + t.numberOffset }),
267
+ value: l.purpose,
268
+ disabled: !t.writer,
269
+ maxlength: "500",
270
+ placeholder: a(f)(t.purposePlaceholder),
271
+ onInput: (c) => N(r, { purpose: c.target.value })
272
+ }, null, 40, De)
273
+ ])
274
+ ])
275
+ ]))), 128)),
276
+ d.value ? (m(), v("li", je, [
277
+ V(a(fe), { size: 22 }),
278
+ n("span", null, u(a(i)("common.referenceFields_d8690492", { p0: d.value })), 1)
279
+ ])) : y("", !0),
280
+ !d.value && C.value ? (m(), v("li", Pe, [
281
+ n("button", {
282
+ type: "button",
283
+ class: "retouch-add-card",
284
+ "aria-label": a(i)("common.referenceFields_bdb86a11", { p0: a(f)(t.title) }),
285
+ disabled: !t.writer,
286
+ onClick: s[0] || (s[0] = (l) => E.value?.click())
287
+ }, [
288
+ V(a(ie), { size: 25 }),
289
+ n("span", Te, [
290
+ n("strong", null, u(a(i)("common.app_9f0d4e46")), 1),
291
+ n("small", null, u(a(i)("common.referenceFields_e4eea1f1")), 1)
292
+ ])
293
+ ], 8, Be)
294
+ ])) : y("", !0)
295
+ ]),
296
+ t.modelValue.referenceUploadNeedsReview && !d.value ? (m(), v("div", Ae, [
297
+ n("p", null, u(a(i)("common.referenceFields_20637ce7", {
298
+ p0: a(f)(t.title),
299
+ p1: t.modelValue.references.length
300
+ })), 1),
301
+ n("button", {
302
+ type: "button",
303
+ "aria-label": a(f)(t.confirmLabel),
304
+ disabled: !t.writer || d.value > 0,
305
+ onClick: s[1] || (s[1] = (l) => {
306
+ g({ referenceUploadNeedsReview: !1 }), p.value = "";
307
+ })
308
+ }, u(a(i)("common.referenceFields_850fe99f")), 9, Me)
309
+ ])) : y("", !0),
310
+ p.value ? (m(), v("p", Se, u(J.value), 1)) : y("", !0)
311
+ ], 42, he));
312
+ }
313
+ }), Je = /* @__PURE__ */ de(qe, [["__scopeId", "data-v-677a7f55"]]);
314
+ export {
315
+ Je as B
316
+ };