@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.
- package/FONT-LICENSE.txt +93 -0
- package/README.md +184 -3
- package/dist/assets/11st-D7qGO5e4.webp +0 -0
- package/dist/assets/UPNG-CPfdwFSy.js +2298 -0
- package/dist/assets/adjust-card-B63b81iV.webp +0 -0
- package/dist/assets/adjust-final.worker-C2JbTvv5.js +6945 -0
- package/dist/assets/amazon-CjTtpZTq.webp +0 -0
- package/dist/assets/ascii_art-B4UGbtGs.webp +0 -0
- package/dist/assets/auction-j26eVUQO.webp +0 -0
- package/dist/assets/background-DGdZUdkL.webp +0 -0
- package/dist/assets/background-card-wK7DRpvM.png +0 -0
- package/dist/assets/body-CUFdRg8w.webp +0 -0
- package/dist/assets/bounded-cutout.worker-BZR6mbaI.js +9615 -0
- package/dist/assets/brand-mark-card-cFUeDeO2.webp +0 -0
- package/dist/assets/buyma-dAxYNjow.webp +0 -0
- package/dist/assets/codec.worker-7W6hmsm6.js +7349 -0
- package/dist/assets/contour_lines-C_CqrgV1.webp +0 -0
- package/dist/assets/creema-B1tWyCPx.webp +0 -0
- package/dist/assets/crop-final.worker-Owin7TvX.js +7035 -0
- package/dist/assets/cutout-CzMvV5An.webp +0 -0
- package/dist/assets/cutout-card-CN4gNFBz.png +0 -0
- package/dist/assets/cutout.worker-DyH6Prbn.js +3894 -0
- package/dist/assets/depop-CkVC5Fn1.webp +0 -0
- package/dist/assets/dewrinkle-kFzP6LqD.webp +0 -0
- package/dist/assets/dither-CcxmO2e6.webp +0 -0
- package/dist/assets/douyin-CP_HwBDF.webp +0 -0
- package/dist/assets/download.worker-DnGSB6P_.js +17779 -0
- package/dist/assets/duotone-Cdg_3fQf.webp +0 -0
- package/dist/assets/ebay-CxLfrRAf.webp +0 -0
- package/dist/assets/edit-Cv-txfZm.webp +0 -0
- package/dist/assets/effect.worker-qu1eCcII.js +9227 -0
- package/dist/assets/engraving-BENh1O2O.webp +0 -0
- package/dist/assets/etsy-CSvz9GpY.webp +0 -0
- package/dist/assets/expand-C60VE9nK.webp +0 -0
- package/dist/assets/facebook-Ca2nJJiQ.webp +0 -0
- package/dist/assets/film_stock-Bqauwcq4.webp +0 -0
- package/dist/assets/final.worker-BnzJ3N5C.js +7035 -0
- package/dist/assets/final.worker-Csc1zoYS.js +7054 -0
- package/dist/assets/final.worker-DzBFT9xk.js +6922 -0
- package/dist/assets/final.worker-XpgKnlaz.js +7217 -0
- package/dist/assets/flatlay-CPiVmlAa.webp +0 -0
- package/dist/assets/flatlay-fold-B-CRYy87.webp +0 -0
- package/dist/assets/flatlay-open-Dzas8okC.webp +0 -0
- package/dist/assets/g-market-DXuYK_JH.webp +0 -0
- package/dist/assets/ghost-BCEAx_Zx.webp +0 -0
- package/dist/assets/ghost-front-WFgA4sUo.webp +0 -0
- package/dist/assets/ghost-three-quarter-Rt8cXj34.webp +0 -0
- package/dist/assets/gif-CObOIITx.js +303 -0
- package/dist/assets/glass_tiles-3IXP-Hmg.webp +0 -0
- package/dist/assets/glitch_art-D1i3qben.webp +0 -0
- package/dist/assets/glitch_blur-C4q_9zyq.webp +0 -0
- package/dist/assets/glow-Bv9EHBU5.webp +0 -0
- package/dist/assets/gradient_map-BR-UVYMP.webp +0 -0
- package/dist/assets/halftone-CWdKu2_6.webp +0 -0
- package/dist/assets/holo_sticker-BQDikLg2.webp +0 -0
- package/dist/assets/idus-7diqRNPs.webp +0 -0
- package/dist/assets/imagetracer.worker-CgunQTPG.js +7096 -0
- package/dist/assets/instagram-Bf0IVidT.webp +0 -0
- package/dist/assets/kakao-talk-Df79L_Mv.webp +0 -0
- package/dist/assets/kaleidoscope-BxqMZuWo.webp +0 -0
- package/dist/assets/karrot-BXFPhDwt.webp +0 -0
- package/dist/assets/kaufland-BDDy6e0C.webp +0 -0
- package/dist/assets/lazada-ConR4e1O.webp +0 -0
- package/dist/assets/lens_flare-DgyiAv_j.webp +0 -0
- package/dist/assets/light_leak-kUdpoFuC.webp +0 -0
- package/dist/assets/line-Dr1j___B.webp +0 -0
- package/dist/assets/linkedin-4s_9Wh03.webp +0 -0
- package/dist/assets/lo_fi-DSdl3yY_.webp +0 -0
- package/dist/assets/logo-preparation.worker-D9oa7SME.js +420 -0
- package/dist/assets/mercado-libre-C8CskEiS.webp +0 -0
- package/dist/assets/mercari-jp-DHj7nz4O.webp +0 -0
- package/dist/assets/metadata.worker-B_9_BgN1.js +6456 -0
- package/dist/assets/mirror_collage-JtSKCeSh.webp +0 -0
- package/dist/assets/model-BbeF-fsf.webp +0 -0
- package/dist/assets/model-BjWhieit.webp +0 -0
- package/dist/assets/momo-BWXO_8Df.webp +0 -0
- package/dist/assets/motion_blur-B8YUHeSg.webp +0 -0
- package/dist/assets/naver-xQKL8lWg.webp +0 -0
- package/dist/assets/nuvemshop-DPt6rnA-.webp +0 -0
- package/dist/assets/olx-B87gp-Il.webp +0 -0
- package/dist/assets/orient-card-Da0ii6mX.webp +0 -0
- package/dist/assets/orient-final.worker-CdF5Y5zD.js +6909 -0
- package/dist/assets/orientation-preview.worker-B7uFzz3J.js +6865 -0
- package/dist/assets/ort.bundle.min-CreFV8V1.js +9311 -0
- package/dist/assets/ort.webgpu.bundle.min-CAudaHZO.js +9311 -0
- package/dist/assets/otto-market-DWZyNKJn.webp +0 -0
- package/dist/assets/paper_texture-CXphyIrs.webp +0 -0
- package/dist/assets/pinterest-ByZqih2J.webp +0 -0
- package/dist/assets/polish-DFy6LNG7.webp +0 -0
- package/dist/assets/poshmark-DnZi2vA1.webp +0 -0
- package/dist/assets/posterize-SpLVGq1s.webp +0 -0
- package/dist/assets/preview.worker-DcrCKKWl.js +380 -0
- package/dist/assets/qoo10-C1pq81Jx.webp +0 -0
- package/dist/assets/rakuten-ulYog1hL.webp +0 -0
- package/dist/assets/recolor-mBX7vdFT.webp +0 -0
- package/dist/assets/resize-DVEAl0Um.webp +0 -0
- package/dist/assets/runtime-0663b902fb3937883a34.wasm +0 -0
- package/dist/assets/runtime-355a5c80c7bfdf8737de.mjs +2817 -0
- package/dist/assets/runtime-49871f5a4409519797e1.wasm +0 -0
- package/dist/assets/runtime-74cf72f9a2b7befc115a.mjs +2817 -0
- package/dist/assets/shadow-card-DTZEH60r.png +0 -0
- package/dist/assets/shopee-Bxfei6sj.webp +0 -0
- package/dist/assets/shopify-wVaBafcF.webp +0 -0
- package/dist/assets/shopline-DMoaJ7Bh.webp +0 -0
- package/dist/assets/sparkle-CD5GSGip.webp +0 -0
- package/dist/assets/ssg-DQoFx5u5.webp +0 -0
- package/dist/assets/staging-CIc8pQJ6.webp +0 -0
- package/dist/assets/standard-cutout.worker-BYLzdpR-.js +1261 -0
- package/dist/assets/text-DQW2mBGp.webp +0 -0
- package/dist/assets/textured_glass-D2coxp7n.webp +0 -0
- package/dist/assets/tga-VGxWDes0.js +752 -0
- package/dist/assets/tilt_shift-BKs46yeX.webp +0 -0
- package/dist/assets/transformers.web-DB57cIO5.js +28891 -0
- package/dist/assets/tritone-CcR4qizk.webp +0 -0
- package/dist/assets/upscale-BrLadyUk.webp +0 -0
- package/dist/assets/upscale-creative-DnZnQufJ.webp +0 -0
- package/dist/assets/upscale-crisp-Ckdmbsnn.webp +0 -0
- package/dist/assets/vinted-1QDsxvC6.webp +0 -0
- package/dist/assets/watercolor-CV67zYNE.webp +0 -0
- package/dist/assets/watermark-CpPrxaT5.webp +0 -0
- package/dist/assets/wave_distortion-CV5jVfK4.webp +0 -0
- package/dist/assets/whatsapp-CWJxqzR6.webp +0 -0
- package/dist/assets/worker-DfrCFP3O.js +55 -0
- package/dist/assets/xerox_noise-CbbHY1S1.webp +0 -0
- package/dist/assets/youtube-DS12d5mi.webp +0 -0
- package/dist/assets/zalando-CenfWOwz.webp +0 -0
- package/dist/browser-adapter.d.ts +4 -0
- package/dist/browser-cutout-capability.d.ts +4 -0
- package/dist/browser-cutout-resources.d.ts +3 -0
- package/dist/browser-local-capabilities.d.ts +5 -0
- package/dist/capabilities.d.ts +18 -0
- package/dist/chunks/AdjustToolPanel-BELqYSUR.js +195 -0
- package/dist/chunks/BackgroundToolPanel-Dy_l8KFl.js +41 -0
- package/dist/chunks/BatchMaterials-niGKrga3.js +806 -0
- package/dist/chunks/BatchModeChoices-BRqn6zNI.js +111 -0
- package/dist/chunks/BatchOutputColorPicker-CCvmIF-b.js +75 -0
- package/dist/chunks/BatchReferenceFields-C4t7OSTw.js +316 -0
- package/dist/chunks/BeautifyToolPanel-Dc-ddaBC.js +215 -0
- package/dist/chunks/BrandMarkToolPanel-FKxXth_3.js +1179 -0
- package/dist/chunks/ContentTrimControl-BQfigZPq.js +297 -0
- package/dist/chunks/CropToolPanel-BhSuHkYm.js +218 -0
- package/dist/chunks/CutoutToolPanel-BfaZZSE_.js +73 -0
- package/dist/chunks/DisclosureToolPanel-B_oc5fld.js +76 -0
- package/dist/chunks/ExpandToolPanel-D_ZODTUZ.js +67 -0
- package/dist/chunks/ImageEffectsToolPanel-BRLPIt4q.js +966 -0
- package/dist/chunks/IpAuditToolPanel-DfY-mBSe.js +96 -0
- package/dist/chunks/ListingToolPanel-B9Yh3LBK.js +783 -0
- package/dist/chunks/MaterialSelectionPlate-DhioUjdW.js +30 -0
- package/dist/chunks/MetadataToolPanel-KVrtb3K0.js +104 -0
- package/dist/chunks/OrientToolPanel-BTrwaWBm.js +161 -0
- package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js +102 -0
- package/dist/chunks/ResizeToolPanel-Ch_-WR74.js +1178 -0
- package/dist/chunks/RetouchToolPanel-BTS33Dsd.js +350 -0
- package/dist/chunks/ShadowToolPanel-DxJE4eyV.js +254 -0
- package/dist/chunks/SvgExportToolPanel-RHmuQARH.js +219 -0
- package/dist/chunks/TranslationToolPanel-B_qTA1hM.js +125 -0
- package/dist/chunks/UpscaleToolPanel-D0H-j2Tr.js +127 -0
- package/dist/chunks/engine-D-T-1RSx.js +69 -0
- package/dist/chunks/entry-DK9FjQZ_.js +42946 -0
- package/dist/chunks/gpu-CScw5MNG.js +231 -0
- package/dist/chunks/hosted-resources-COzZ7nZY.js +8196 -0
- package/dist/chunks/loader-circle-UFoEem2a.js +16 -0
- package/dist/chunks/motionFeatures-D4miwXxc.js +4405 -0
- package/dist/chunks/search-BjTSm1KS.js +18 -0
- package/dist/chunks/standard-cutout-vPpP6xBc.js +45 -0
- package/dist/chunks/static-logo-2F9ORZWc.js +34 -0
- package/dist/config.d.ts +66 -0
- package/dist/contracts.d.ts +272 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +13 -0
- package/dist/node/catalog.mjs +45 -0
- package/dist/node/cli.mjs +11 -0
- package/dist/node/index.d.mts +20 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/prepare.mjs +114 -0
- package/dist/node/vite.mjs +46 -0
- package/dist/processing.d.ts +1 -0
- package/dist/processing.js +12105 -0
- package/dist/remote-contracts.d.ts +114 -0
- package/dist/resource-contracts.d.ts +40 -0
- package/dist/resources/cutout/9ae2e5375a34fa413530954dc20d085d175faffc86108c13619220d0557f80bf.json +1 -0
- package/dist/resources/cutout/f119dabecc64bc436d3d08425dde96ec2598fd40541eba97d8d53a4e8bbdcaea.json +1 -0
- package/dist/resources/cutout/resources.json +195 -0
- package/dist/resources/cutout/sources.json +294 -0
- package/dist/resources.json +1191 -0
- package/dist/service-contracts.d.ts +43 -0
- package/dist/slots.d.ts +21 -0
- package/dist/style.css +1 -0
- package/dist/types/batch/api.d.ts +89 -0
- package/dist/types/batch/cutout-output.d.ts +2 -0
- package/dist/types/batch/features/background/engine.d.mts +12 -0
- package/dist/types/batch/features/basic-edit/contracts.d.ts +87 -0
- package/dist/types/batch/features/basic-edit/engine.d.mts +96 -0
- package/dist/types/batch/features/brand-mark/contracts.d.ts +84 -0
- package/dist/types/batch/features/brand-mark/engine.d.mts +68 -0
- package/dist/types/batch/features/export-compression/contracts.d.ts +44 -0
- package/dist/types/batch/features/export-compression/gifenc.d.ts +33 -0
- package/dist/types/batch/features/export-compression/plan.d.ts +45 -0
- package/dist/types/batch/features/export-compression/presentation.d.ts +70 -0
- package/dist/types/batch/features/export-compression/upng.d.ts +6 -0
- package/dist/types/batch/features/final-image/resize.d.mts +15 -0
- package/dist/types/batch/features/image-effects/contracts.d.ts +58 -0
- package/dist/types/batch/features/image-effects/gpu-pixel-runtime.d.ts +15 -0
- package/dist/types/batch/features/image-effects/photo-audit.d.ts +21 -0
- package/dist/types/batch/features/image-effects/photo-v7-cpu.d.ts +9 -0
- package/dist/types/batch/features/image-effects/profiles-v4.d.ts +157 -0
- package/dist/types/batch/features/image-effects/profiles-v5.d.ts +20 -0
- package/dist/types/batch/features/image-effects/profiles-v6.d.ts +14 -0
- package/dist/types/batch/features/image-effects/profiles-v7.d.ts +53 -0
- package/dist/types/batch/features/image-effects/profiles-v8.d.ts +113 -0
- package/dist/types/batch/features/image-effects/profiles-v9.d.ts +20 -0
- package/dist/types/batch/features/image-translation/params.d.ts +257 -0
- package/dist/types/batch/features/listing-remake/transport.d.ts +21 -0
- package/dist/types/batch/features/metadata/bytes.d.mts +13 -0
- package/dist/types/batch/features/metadata/containers.d.mts +20 -0
- package/dist/types/batch/features/metadata/declaration.d.mts +5 -0
- package/dist/types/batch/features/metadata/engine.d.mts +9 -0
- package/dist/types/batch/features/metadata/exchange.d.mts +48 -0
- package/dist/types/batch/features/shadow/contracts.d.ts +43 -0
- package/dist/types/batch/features/shadow/engine.d.mts +33 -0
- package/dist/types/batch/features/svg-export/download-contract.d.ts +33 -0
- package/dist/types/batch/features/svg-export/download-prepare.d.ts +2 -0
- package/dist/types/batch/features/svg-export/download.d.ts +7 -0
- package/dist/types/batch/features/svg-export/imagetracer.d.ts +6 -0
- package/dist/types/batch/features/svg-export/optimizer.d.ts +2 -0
- package/dist/types/batch/ids.d.ts +1 -0
- package/dist/types/batch/model.d.ts +317 -0
- package/dist/types/batch/public/config.d.ts +66 -0
- package/dist/types/batch/public/contracts.d.ts +272 -0
- package/dist/types/batch/public/remote-contracts.d.ts +114 -0
- package/dist/types/batch/public/resource-contracts.d.ts +40 -0
- package/dist/types/batch/public/service-contracts.d.ts +43 -0
- package/dist/types/batch/queue.d.ts +34 -0
- package/dist/types/batch/receipts.d.ts +85 -0
- package/dist/types/batch/retention.d.ts +13 -0
- package/dist/types/onnxruntime-web.d.ts +5 -0
- package/dist/types/plugins/cutout/core/hosted-resources.d.ts +11 -0
- package/dist/types/processing.d.ts +18 -0
- package/dist/types/shared/svg-security.d.mts +4 -0
- package/dist/types/workspace-worker.d.ts +2 -0
- package/package.json +95 -6
|
@@ -0,0 +1,966 @@
|
|
|
1
|
+
import { defineComponent as oe, ref as F, computed as L, watch as ke, onMounted as ie, onBeforeUnmount as xe, openBlock as o, createElementBlock as r, createElementVNode as f, toDisplayString as _, unref as l, normalizeStyle as Z, withModifiers as j, Fragment as H, renderList as z, createCommentVNode as $, useId as we, createVNode as Y, normalizeClass as W, createBlock as Q, nextTick as _e, withCtx as me, resolveDynamicComponent as Ve, Teleport as Ae, withDirectives as De, createTextVNode as Oe, withKeys as ae, vShow as Ke } from "vue";
|
|
2
|
+
import { F as re, aA as Ee, _ as se, aj as Ce, S as Re, a4 as He, aW as Be, aX as Fe, aY as Ge, aZ as ze, a_ as ve, a$ as Ne, G as Xe, R as Ye, b0 as Ue, b1 as pe, b2 as qe, b3 as je, b4 as J, b5 as We, b6 as Ze } from "./entry-DK9FjQZ_.js";
|
|
3
|
+
import { u as Je, a as Qe, c as be, _ as et } from "./PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js";
|
|
4
|
+
import { S as tt } from "./search-BjTSm1KS.js";
|
|
5
|
+
const at = ["light", "material", "art", "color", "distortion"], nt = {
|
|
6
|
+
light_leak: "light",
|
|
7
|
+
motion_blur: "light",
|
|
8
|
+
textured_glass: "material",
|
|
9
|
+
holo_sticker: "material",
|
|
10
|
+
halftone: "art",
|
|
11
|
+
engraving: "art",
|
|
12
|
+
xerox_noise: "art",
|
|
13
|
+
ascii_art: "art",
|
|
14
|
+
duotone: "color",
|
|
15
|
+
posterize: "color",
|
|
16
|
+
lo_fi: "color",
|
|
17
|
+
glitch_art: "distortion",
|
|
18
|
+
glitch_blur: "distortion",
|
|
19
|
+
sparkle: "light",
|
|
20
|
+
glow: "light",
|
|
21
|
+
lens_flare: "light",
|
|
22
|
+
tilt_shift: "light",
|
|
23
|
+
paper_texture: "material",
|
|
24
|
+
glass_tiles: "material",
|
|
25
|
+
watercolor: "art",
|
|
26
|
+
dither: "art",
|
|
27
|
+
contour_lines: "art",
|
|
28
|
+
film_stock: "color",
|
|
29
|
+
gradient_map: "color",
|
|
30
|
+
tritone: "color",
|
|
31
|
+
kaleidoscope: "distortion",
|
|
32
|
+
mirror_collage: "distortion",
|
|
33
|
+
wave_distortion: "distortion"
|
|
34
|
+
};
|
|
35
|
+
function U(a) {
|
|
36
|
+
return nt[a];
|
|
37
|
+
}
|
|
38
|
+
function le(a, D, d) {
|
|
39
|
+
const s = d * Math.PI / 180;
|
|
40
|
+
return 50 + 100 * ((a.x - D.width / 2) * Math.sin(s) + (a.y - D.height / 2) * Math.cos(s)) / Math.min(D.width, D.height);
|
|
41
|
+
}
|
|
42
|
+
function lt(a, D, d, s) {
|
|
43
|
+
const g = [
|
|
44
|
+
{ x: 0, y: 0 },
|
|
45
|
+
{ x: a.width, y: 0 },
|
|
46
|
+
{ x: a.width, y: a.height },
|
|
47
|
+
{ x: 0, y: a.height }
|
|
48
|
+
], O = (x) => le(x, a, D);
|
|
49
|
+
function m(x, M, y) {
|
|
50
|
+
const C = [];
|
|
51
|
+
for (const [p, w] of x.entries()) {
|
|
52
|
+
const I = x[(p + x.length - 1) % x.length];
|
|
53
|
+
if (!I) continue;
|
|
54
|
+
const E = O(I) - M, P = O(w) - M, S = y ? E >= 0 : E <= 0, B = y ? P >= 0 : P <= 0;
|
|
55
|
+
if (S !== B) {
|
|
56
|
+
const R = E / (E - P);
|
|
57
|
+
C.push({ x: I.x + (w.x - I.x) * R, y: I.y + (w.y - I.y) * R });
|
|
58
|
+
}
|
|
59
|
+
B && C.push(w);
|
|
60
|
+
}
|
|
61
|
+
return C;
|
|
62
|
+
}
|
|
63
|
+
function k(x, M = 0.5) {
|
|
64
|
+
const y = [];
|
|
65
|
+
for (const [w, I] of g.entries()) {
|
|
66
|
+
const E = g[(w + 1) % g.length];
|
|
67
|
+
if (!E) continue;
|
|
68
|
+
const P = O(I) - x, S = O(E) - x;
|
|
69
|
+
if (Math.abs(P) < 1e-8 && y.push(I), P * S < 0) {
|
|
70
|
+
const B = P / (P - S);
|
|
71
|
+
y.push({ x: I.x + (E.x - I.x) * B, y: I.y + (E.y - I.y) * B });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const C = y[0], p = y.find((w) => C && Math.hypot(w.x - C.x, w.y - C.y) > 1e-6);
|
|
75
|
+
return C && p ? {
|
|
76
|
+
start: C,
|
|
77
|
+
end: p,
|
|
78
|
+
handle: {
|
|
79
|
+
x: C.x + (p.x - C.x) * M,
|
|
80
|
+
y: C.y + (p.y - C.y) * M
|
|
81
|
+
}
|
|
82
|
+
} : void 0;
|
|
83
|
+
}
|
|
84
|
+
const K = d - s / 2, v = d + s / 2;
|
|
85
|
+
return {
|
|
86
|
+
band: m(m(g, K, !0), v, !1),
|
|
87
|
+
before: m(g, K, !1),
|
|
88
|
+
after: m(g, v, !0),
|
|
89
|
+
center: k(d),
|
|
90
|
+
edges: [{ side: -1, line: k(K, 0.25) }, { side: 1, line: k(v, 0.75) }]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function ne(a) {
|
|
94
|
+
return a.map((D) => `${D.x},${D.y}`).join(" ");
|
|
95
|
+
}
|
|
96
|
+
const ot = { class: "direct-controls" }, it = { class: "direct-caption" }, rt = ["data-direct-preview"], st = ["src"], ct = ["viewBox"], ut = ["points"], dt = ["points"], ft = ["points", "tabindex", "aria-disabled", "aria-label", "aria-valuenow"], gt = ["x1", "y1", "x2", "y2"], yt = ["cx", "cy", "data-width-side", "tabindex", "aria-disabled", "aria-label", "aria-valuenow", "onPointerdown"], ht = ["x1", "y1", "x2", "y2"], mt = ["cx", "cy", "tabindex", "aria-disabled", "aria-label", "aria-valuenow"], vt = ["tabindex", "aria-disabled", "aria-label", "aria-valuenow", "aria-valuetext"], pt = ["aria-label"], bt = ["data-tilt-direction", "aria-pressed", "disabled", "onClick"], kt = /* @__PURE__ */ oe({
|
|
97
|
+
__name: "ImageEffectsDirectControl",
|
|
98
|
+
props: {
|
|
99
|
+
effectId: {},
|
|
100
|
+
center: {},
|
|
101
|
+
width: {},
|
|
102
|
+
angle: {},
|
|
103
|
+
lightX: {},
|
|
104
|
+
lightY: {},
|
|
105
|
+
readonly: { type: Boolean },
|
|
106
|
+
imageSource: {},
|
|
107
|
+
imageWidth: {},
|
|
108
|
+
imageHeight: {}
|
|
109
|
+
},
|
|
110
|
+
emits: ["change"],
|
|
111
|
+
setup(a, { emit: D }) {
|
|
112
|
+
const { ui: d } = re(), s = a, g = D, O = F(), m = F({ width: 320, height: 180 }), k = F(16 / 9), K = L(
|
|
113
|
+
() => s.imageSource && s.imageWidth && s.imageHeight ? s.imageWidth / s.imageHeight : k.value
|
|
114
|
+
), v = L(() => lt(m.value, s.angle, s.center, s.width)), x = L(
|
|
115
|
+
() => ["ns-resize", "nwse-resize", "ew-resize", "nesw-resize"][(Math.round(s.angle / 45) % 4 + 4) % 4]
|
|
116
|
+
), M = L(
|
|
117
|
+
() => s.imageSource ?? Ee(`tool-cards/magic-v3/${s.effectId}.webp`)
|
|
118
|
+
);
|
|
119
|
+
let y, C;
|
|
120
|
+
const p = (n) => Math.round(Math.min(100, Math.max(0, n)));
|
|
121
|
+
function w() {
|
|
122
|
+
const n = O.value?.getBoundingClientRect();
|
|
123
|
+
n && n.width > 0 && n.height > 0 && (m.value = { width: n.width, height: n.height });
|
|
124
|
+
}
|
|
125
|
+
function I(n) {
|
|
126
|
+
n.target instanceof HTMLImageElement && n.target.naturalHeight && (k.value = n.target.naturalWidth / n.target.naturalHeight), w();
|
|
127
|
+
}
|
|
128
|
+
function E(n) {
|
|
129
|
+
const h = O.value?.getBoundingClientRect();
|
|
130
|
+
return { x: n.clientX - (h?.left ?? 0), y: n.clientY - (h?.top ?? 0) };
|
|
131
|
+
}
|
|
132
|
+
function P() {
|
|
133
|
+
const n = y;
|
|
134
|
+
y = void 0, n?.target.hasPointerCapture?.(n.pointerId) && n.target.releasePointerCapture(n.pointerId);
|
|
135
|
+
}
|
|
136
|
+
function S(n, h, c = 1) {
|
|
137
|
+
if (s.readonly || y && y.pointerId !== n.pointerId || n.button !== void 0 && n.button !== 0 || !(n.currentTarget instanceof Element))
|
|
138
|
+
return;
|
|
139
|
+
P(), w();
|
|
140
|
+
const T = { pointerId: n.pointerId, target: n.currentTarget, start: E(n) };
|
|
141
|
+
h === "center" ? y = { ...T, kind: h, value: s.center } : h === "width" ? y = { ...T, kind: h, side: c, value: s.width } : y = { ...T, kind: h, x: s.lightX, y: s.lightY }, n.preventDefault(), n.currentTarget.setPointerCapture?.(n.pointerId);
|
|
142
|
+
}
|
|
143
|
+
function B(n) {
|
|
144
|
+
if (!y || n.pointerId !== y.pointerId || s.readonly) return;
|
|
145
|
+
const h = E(n);
|
|
146
|
+
if (y.kind === "light")
|
|
147
|
+
g("change", {
|
|
148
|
+
lightX: p(y.x + 100 * (h.x - y.start.x) / m.value.width),
|
|
149
|
+
lightY: p(y.y + 100 * (h.y - y.start.y) / m.value.height)
|
|
150
|
+
});
|
|
151
|
+
else {
|
|
152
|
+
const c = le(h, m.value, s.angle) - le(y.start, m.value, s.angle);
|
|
153
|
+
y.kind === "center" ? g("change", { center: p(y.value + c) }) : g("change", { width: p(y.value + y.side * c * 2) });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function R(n) {
|
|
157
|
+
y?.pointerId === n.pointerId && P();
|
|
158
|
+
}
|
|
159
|
+
function b(n) {
|
|
160
|
+
if (s.readonly) return;
|
|
161
|
+
const h = s.angle * Math.PI / 180, c = {
|
|
162
|
+
ArrowLeft: -Math.sin(h),
|
|
163
|
+
ArrowRight: Math.sin(h),
|
|
164
|
+
ArrowUp: -Math.cos(h),
|
|
165
|
+
ArrowDown: Math.cos(h)
|
|
166
|
+
};
|
|
167
|
+
let T = s.center;
|
|
168
|
+
if (n.key === "Home") T = 0;
|
|
169
|
+
else if (n.key === "End") T = 100;
|
|
170
|
+
else if (n.key in c)
|
|
171
|
+
T += (c[n.key] ?? 0) * (n.shiftKey ? 10 : 1);
|
|
172
|
+
else return;
|
|
173
|
+
n.preventDefault(), g("change", { center: p(T) });
|
|
174
|
+
}
|
|
175
|
+
function V(n) {
|
|
176
|
+
if (s.readonly) return;
|
|
177
|
+
const h = n.shiftKey ? 10 : 1;
|
|
178
|
+
let c = s.width;
|
|
179
|
+
if (n.key === "Home") c = 0;
|
|
180
|
+
else if (n.key === "End") c = 100;
|
|
181
|
+
else if (n.key === "ArrowLeft" || n.key === "ArrowDown") c -= h;
|
|
182
|
+
else if (n.key === "ArrowRight" || n.key === "ArrowUp") c += h;
|
|
183
|
+
else return;
|
|
184
|
+
n.preventDefault(), g("change", { width: p(c) });
|
|
185
|
+
}
|
|
186
|
+
function A(n) {
|
|
187
|
+
if (s.readonly) return;
|
|
188
|
+
const h = n.shiftKey ? 10 : 1;
|
|
189
|
+
let c = s.lightX, T = s.lightY;
|
|
190
|
+
if (n.key === "ArrowLeft") c -= h;
|
|
191
|
+
else if (n.key === "ArrowRight") c += h;
|
|
192
|
+
else if (n.key === "ArrowUp") T -= h;
|
|
193
|
+
else if (n.key === "ArrowDown") T += h;
|
|
194
|
+
else if (n.key === "Home") c = T = 0;
|
|
195
|
+
else if (n.key === "End") c = T = 100;
|
|
196
|
+
else return;
|
|
197
|
+
n.preventDefault(), g("change", { lightX: p(c), lightY: p(T) });
|
|
198
|
+
}
|
|
199
|
+
return ke(() => [s.effectId, s.readonly, s.imageSource, s.angle], P), ie(() => {
|
|
200
|
+
w(), typeof ResizeObserver < "u" && O.value && (C = new ResizeObserver(w), C.observe(O.value)), window.addEventListener("pointermove", B), window.addEventListener("pointerup", R), window.addEventListener("pointercancel", R), window.addEventListener("blur", P);
|
|
201
|
+
}), xe(() => {
|
|
202
|
+
P(), C?.disconnect(), window.removeEventListener("pointermove", B), window.removeEventListener("pointerup", R), window.removeEventListener("pointercancel", R), window.removeEventListener("blur", P);
|
|
203
|
+
}), (n, h) => (o(), r("div", ot, [
|
|
204
|
+
f("p", it, _(l(d)(`tools.image_effects.direct.${a.imageSource ? "sourceGuide" : "referenceGuide"}`)), 1),
|
|
205
|
+
f("div", {
|
|
206
|
+
ref_key: "preview",
|
|
207
|
+
ref: O,
|
|
208
|
+
class: "magic-direct-preview",
|
|
209
|
+
"data-direct-preview": a.effectId,
|
|
210
|
+
style: Z({ aspectRatio: K.value }),
|
|
211
|
+
onLostpointercapture: R
|
|
212
|
+
}, [
|
|
213
|
+
f("img", {
|
|
214
|
+
src: M.value,
|
|
215
|
+
alt: "",
|
|
216
|
+
onLoad: I
|
|
217
|
+
}, null, 40, st),
|
|
218
|
+
a.effectId === "tilt_shift" ? (o(), r("svg", {
|
|
219
|
+
key: 0,
|
|
220
|
+
class: "tilt-overlay",
|
|
221
|
+
viewBox: `0 0 ${m.value.width} ${m.value.height}`,
|
|
222
|
+
preserveAspectRatio: "none"
|
|
223
|
+
}, [
|
|
224
|
+
f("polygon", {
|
|
225
|
+
points: l(ne)(v.value.before),
|
|
226
|
+
class: "tilt-outside"
|
|
227
|
+
}, null, 8, ut),
|
|
228
|
+
f("polygon", {
|
|
229
|
+
points: l(ne)(v.value.after),
|
|
230
|
+
class: "tilt-outside"
|
|
231
|
+
}, null, 8, dt),
|
|
232
|
+
f("polygon", {
|
|
233
|
+
points: l(ne)(v.value.band),
|
|
234
|
+
class: "tilt-shift-band",
|
|
235
|
+
"data-direct-control": "tilt-shift-band",
|
|
236
|
+
role: "slider",
|
|
237
|
+
tabindex: a.readonly ? -1 : 0,
|
|
238
|
+
"aria-disabled": a.readonly,
|
|
239
|
+
"aria-label": l(d)("tools.image_effects.direct.focusBand"),
|
|
240
|
+
"aria-valuemin": "0",
|
|
241
|
+
"aria-valuemax": "100",
|
|
242
|
+
"aria-valuenow": a.center,
|
|
243
|
+
onPointerdown: h[0] || (h[0] = j((c) => S(c, "center"), ["stop"])),
|
|
244
|
+
onKeydown: b
|
|
245
|
+
}, null, 40, ft),
|
|
246
|
+
(o(!0), r(H, null, z(v.value.edges, (c) => (o(), r(H, {
|
|
247
|
+
key: c.side
|
|
248
|
+
}, [
|
|
249
|
+
c.line ? (o(), r("line", {
|
|
250
|
+
key: 0,
|
|
251
|
+
x1: c.line.start.x,
|
|
252
|
+
y1: c.line.start.y,
|
|
253
|
+
x2: c.line.end.x,
|
|
254
|
+
y2: c.line.end.y,
|
|
255
|
+
class: "tilt-edge"
|
|
256
|
+
}, null, 8, gt)) : $("", !0),
|
|
257
|
+
c.line ? (o(), r("circle", {
|
|
258
|
+
key: 1,
|
|
259
|
+
cx: c.line.handle.x,
|
|
260
|
+
cy: c.line.handle.y,
|
|
261
|
+
r: "7",
|
|
262
|
+
class: "tilt-width-handle",
|
|
263
|
+
style: Z({ cursor: x.value }),
|
|
264
|
+
"data-width-side": c.side,
|
|
265
|
+
"data-direct-control": "tilt-width",
|
|
266
|
+
role: "slider",
|
|
267
|
+
tabindex: a.readonly ? -1 : 0,
|
|
268
|
+
"aria-disabled": a.readonly,
|
|
269
|
+
"aria-label": l(d)("tools.image_effects.field.width"),
|
|
270
|
+
"aria-valuemin": "0",
|
|
271
|
+
"aria-valuemax": "100",
|
|
272
|
+
"aria-valuenow": a.width,
|
|
273
|
+
onPointerdown: j((T) => S(T, "width", c.side), ["stop"]),
|
|
274
|
+
onKeydown: V
|
|
275
|
+
}, null, 44, yt)) : $("", !0)
|
|
276
|
+
], 64))), 128)),
|
|
277
|
+
v.value.center ? (o(), r("line", {
|
|
278
|
+
key: 0,
|
|
279
|
+
x1: v.value.center.start.x,
|
|
280
|
+
y1: v.value.center.start.y,
|
|
281
|
+
x2: v.value.center.end.x,
|
|
282
|
+
y2: v.value.center.end.y,
|
|
283
|
+
class: "tilt-center-line"
|
|
284
|
+
}, null, 8, ht)) : $("", !0),
|
|
285
|
+
v.value.center ? (o(), r("circle", {
|
|
286
|
+
key: 1,
|
|
287
|
+
cx: v.value.center.handle.x,
|
|
288
|
+
cy: v.value.center.handle.y,
|
|
289
|
+
r: "8",
|
|
290
|
+
class: "tilt-center-handle",
|
|
291
|
+
"data-direct-control": "tilt-center",
|
|
292
|
+
role: "slider",
|
|
293
|
+
tabindex: a.readonly ? -1 : 0,
|
|
294
|
+
"aria-disabled": a.readonly,
|
|
295
|
+
"aria-label": l(d)("tools.image_effects.field.center"),
|
|
296
|
+
"aria-valuemin": "0",
|
|
297
|
+
"aria-valuemax": "100",
|
|
298
|
+
"aria-valuenow": a.center,
|
|
299
|
+
onPointerdown: h[1] || (h[1] = j((c) => S(c, "center"), ["stop"])),
|
|
300
|
+
onKeydown: b
|
|
301
|
+
}, null, 40, mt)) : $("", !0)
|
|
302
|
+
], 8, ct)) : (o(), r("div", {
|
|
303
|
+
key: 1,
|
|
304
|
+
class: "lens-flare-point",
|
|
305
|
+
"data-direct-control": "lens-flare-point",
|
|
306
|
+
role: "slider",
|
|
307
|
+
tabindex: a.readonly ? -1 : 0,
|
|
308
|
+
"aria-disabled": a.readonly,
|
|
309
|
+
"aria-label": l(d)("tools.image_effects.direct.lightPoint"),
|
|
310
|
+
"aria-valuemin": "0",
|
|
311
|
+
"aria-valuemax": "100",
|
|
312
|
+
"aria-valuenow": a.lightX,
|
|
313
|
+
"aria-valuetext": `${a.lightX}%, ${a.lightY}%`,
|
|
314
|
+
style: Z({ left: `${a.lightX}%`, top: `${a.lightY}%` }),
|
|
315
|
+
onPointerdown: h[2] || (h[2] = j((c) => S(c, "light"), ["stop"])),
|
|
316
|
+
onKeydown: A
|
|
317
|
+
}, null, 44, vt))
|
|
318
|
+
], 44, rt),
|
|
319
|
+
a.effectId === "tilt_shift" ? (o(), r("div", {
|
|
320
|
+
key: 0,
|
|
321
|
+
class: "tilt-shift-direction",
|
|
322
|
+
role: "group",
|
|
323
|
+
"aria-label": l(d)("tools.image_effects.direct.rotation")
|
|
324
|
+
}, [
|
|
325
|
+
(o(), r(H, null, z([
|
|
326
|
+
{ id: "horizontal", angle: 0 },
|
|
327
|
+
{ id: "diagonal", angle: 45 },
|
|
328
|
+
{ id: "vertical", angle: 90 }
|
|
329
|
+
], (c) => f("button", {
|
|
330
|
+
key: c.id,
|
|
331
|
+
"data-tilt-direction": c.id,
|
|
332
|
+
type: "button",
|
|
333
|
+
"aria-pressed": a.angle === c.angle,
|
|
334
|
+
disabled: a.readonly,
|
|
335
|
+
onClick: (T) => g("change", { angle: c.angle })
|
|
336
|
+
}, _(l(d)(`tools.image_effects.direct.${c.id}`)), 9, bt)), 64))
|
|
337
|
+
], 8, pt)) : $("", !0)
|
|
338
|
+
]));
|
|
339
|
+
}
|
|
340
|
+
}), xt = /* @__PURE__ */ se(kt, [["__scopeId", "data-v-6fffb6d4"]]), wt = ["for"], _t = { class: "magic-picker-input" }, Et = ["id", "value", "placeholder", "aria-expanded", "aria-controls", "aria-activedescendant"], Ct = ["aria-label"], It = ["aria-label", "aria-expanded"], $t = ["id", "aria-label"], Pt = ["id", "data-category", "aria-selected", "onClick"], Lt = /* @__PURE__ */ oe({
|
|
341
|
+
__name: "ImageEffectsGalleryPicker",
|
|
342
|
+
props: {
|
|
343
|
+
modelValue: {},
|
|
344
|
+
counts: {},
|
|
345
|
+
delegateEscape: { type: Boolean }
|
|
346
|
+
},
|
|
347
|
+
emits: ["update:modelValue"],
|
|
348
|
+
setup(a, { expose: D, emit: d }) {
|
|
349
|
+
const { ui: s } = re(), g = a, O = d, m = F(), k = F(), K = F(), v = F(!1), x = F(-1), M = we(), y = ["all", ...at], C = L(
|
|
350
|
+
() => g.modelValue.kind === "query" ? g.modelValue.text : s(`tools.image_effects.category.${g.modelValue.id}`)
|
|
351
|
+
);
|
|
352
|
+
function p() {
|
|
353
|
+
v.value = !1, x.value = -1;
|
|
354
|
+
}
|
|
355
|
+
function w() {
|
|
356
|
+
x.value = -1, v.value = !0;
|
|
357
|
+
}
|
|
358
|
+
function I() {
|
|
359
|
+
w(), k.value?.select();
|
|
360
|
+
}
|
|
361
|
+
async function E(b) {
|
|
362
|
+
O("update:modelValue", { kind: "category", id: b }), await _e(), k.value?.focus(), k.value?.select(), p();
|
|
363
|
+
}
|
|
364
|
+
function P(b) {
|
|
365
|
+
if (!(b.target instanceof HTMLInputElement)) return;
|
|
366
|
+
const V = b.target.value;
|
|
367
|
+
O("update:modelValue", { kind: "query", text: V }), w();
|
|
368
|
+
}
|
|
369
|
+
function S(b) {
|
|
370
|
+
if (!(b.isComposing || b.keyCode === 229) && !(b.target !== k.value && b.key !== "Escape"))
|
|
371
|
+
if (b.key === "Escape" && v.value && !g.delegateEscape)
|
|
372
|
+
b.preventDefault(), b.stopPropagation(), p();
|
|
373
|
+
else if (b.key === "ArrowDown" || b.key === "ArrowUp")
|
|
374
|
+
b.preventDefault(), v.value = !0, x.value = b.key === "ArrowDown" ? (x.value + 1) % y.length : x.value <= 0 ? y.length - 1 : x.value - 1;
|
|
375
|
+
else if (b.key === "Enter" && v.value) {
|
|
376
|
+
b.preventDefault();
|
|
377
|
+
const V = y[x.value];
|
|
378
|
+
V !== void 0 ? E(V) : p();
|
|
379
|
+
} else b.key === "Tab" && p();
|
|
380
|
+
}
|
|
381
|
+
function B(b) {
|
|
382
|
+
(!(b.relatedTarget instanceof Node) || !m.value?.contains(b.relatedTarget)) && p();
|
|
383
|
+
}
|
|
384
|
+
function R(b) {
|
|
385
|
+
(!(b.target instanceof Node) || !m.value?.contains(b.target)) && p();
|
|
386
|
+
}
|
|
387
|
+
return D({
|
|
388
|
+
focusControl: () => K.value?.focus({ preventScroll: !0 }),
|
|
389
|
+
hasOverlay: () => v.value,
|
|
390
|
+
dismissOverlay() {
|
|
391
|
+
return v.value ? (p(), !0) : !1;
|
|
392
|
+
}
|
|
393
|
+
}), ie(() => document.addEventListener("pointerdown", R)), xe(() => document.removeEventListener("pointerdown", R)), (b, V) => (o(), r("div", {
|
|
394
|
+
ref_key: "root",
|
|
395
|
+
ref: m,
|
|
396
|
+
class: "magic-gallery-picker",
|
|
397
|
+
onFocusout: B,
|
|
398
|
+
onKeydown: S
|
|
399
|
+
}, [
|
|
400
|
+
f("label", {
|
|
401
|
+
class: "visually-hidden",
|
|
402
|
+
for: `${l(M)}-input`
|
|
403
|
+
}, _(l(s)("tools.image_effects.gallery.filter")), 9, wt),
|
|
404
|
+
f("div", _t, [
|
|
405
|
+
Y(l(tt), {
|
|
406
|
+
class: "magic-picker-search",
|
|
407
|
+
size: 15,
|
|
408
|
+
"aria-hidden": "true"
|
|
409
|
+
}),
|
|
410
|
+
f("input", {
|
|
411
|
+
id: `${l(M)}-input`,
|
|
412
|
+
ref_key: "inputElement",
|
|
413
|
+
ref: k,
|
|
414
|
+
role: "combobox",
|
|
415
|
+
value: C.value,
|
|
416
|
+
autocomplete: "off",
|
|
417
|
+
placeholder: l(s)("tools.image_effects.gallery.searchPlaceholder"),
|
|
418
|
+
"aria-autocomplete": "list",
|
|
419
|
+
"aria-haspopup": "listbox",
|
|
420
|
+
"aria-expanded": v.value,
|
|
421
|
+
"aria-controls": `${l(M)}-list`,
|
|
422
|
+
"aria-activedescendant": v.value && x.value >= 0 ? `${l(M)}-option-${x.value}` : void 0,
|
|
423
|
+
onFocus: I,
|
|
424
|
+
onInput: P
|
|
425
|
+
}, null, 40, Et),
|
|
426
|
+
a.modelValue.kind === "query" ? (o(), r("button", {
|
|
427
|
+
key: 0,
|
|
428
|
+
type: "button",
|
|
429
|
+
"aria-label": l(s)("tools.image_effects.gallery.clear"),
|
|
430
|
+
onClick: V[0] || (V[0] = (A) => E("all"))
|
|
431
|
+
}, [
|
|
432
|
+
Y(l(Ce), {
|
|
433
|
+
size: 14,
|
|
434
|
+
"aria-hidden": "true"
|
|
435
|
+
})
|
|
436
|
+
], 8, Ct)) : $("", !0),
|
|
437
|
+
f("button", {
|
|
438
|
+
ref_key: "categoryButton",
|
|
439
|
+
ref: K,
|
|
440
|
+
type: "button",
|
|
441
|
+
"aria-label": l(s)("tools.image_effects.gallery.category"),
|
|
442
|
+
"aria-expanded": v.value,
|
|
443
|
+
onClick: V[1] || (V[1] = (A) => v.value ? p() : w())
|
|
444
|
+
}, [
|
|
445
|
+
Y(l(Re), {
|
|
446
|
+
size: 15,
|
|
447
|
+
"aria-hidden": "true"
|
|
448
|
+
})
|
|
449
|
+
], 8, It)
|
|
450
|
+
]),
|
|
451
|
+
v.value ? (o(), r("div", {
|
|
452
|
+
key: 0,
|
|
453
|
+
id: `${l(M)}-list`,
|
|
454
|
+
role: "listbox",
|
|
455
|
+
"aria-label": l(s)("tools.image_effects.gallery.category"),
|
|
456
|
+
class: "magic-picker-list"
|
|
457
|
+
}, [
|
|
458
|
+
(o(), r(H, null, z(y, (A, n) => f("button", {
|
|
459
|
+
id: `${l(M)}-option-${n}`,
|
|
460
|
+
key: A,
|
|
461
|
+
type: "button",
|
|
462
|
+
role: "option",
|
|
463
|
+
"data-category": A,
|
|
464
|
+
"aria-selected": a.modelValue.kind === "category" && a.modelValue.id === A,
|
|
465
|
+
class: W({ active: x.value === n }),
|
|
466
|
+
tabindex: "-1",
|
|
467
|
+
onPointerdown: V[2] || (V[2] = j(() => {
|
|
468
|
+
}, ["prevent"])),
|
|
469
|
+
onClick: (h) => E(A)
|
|
470
|
+
}, [
|
|
471
|
+
f("span", null, _(l(s)(`tools.image_effects.category.${A}`)), 1),
|
|
472
|
+
f("small", null, _(a.counts[A]), 1),
|
|
473
|
+
a.modelValue.kind === "category" && a.modelValue.id === A ? (o(), Q(l(He), {
|
|
474
|
+
key: 0,
|
|
475
|
+
size: 13,
|
|
476
|
+
"aria-hidden": "true"
|
|
477
|
+
})) : $("", !0)
|
|
478
|
+
], 42, Pt)), 64))
|
|
479
|
+
], 8, $t)) : $("", !0)
|
|
480
|
+
], 544));
|
|
481
|
+
}
|
|
482
|
+
}), Tt = /* @__PURE__ */ se(Lt, [["__scopeId", "data-v-17c73189"]]), Mt = { class: "effects-panel" }, St = ["data-view", "aria-label"], Vt = {
|
|
483
|
+
key: 0,
|
|
484
|
+
class: "magic-gallery-grid"
|
|
485
|
+
}, At = ["disabled", "aria-pressed", "onClick"], Dt = ["src"], Ot = {
|
|
486
|
+
key: 1,
|
|
487
|
+
class: "magic-no-results",
|
|
488
|
+
role: "status"
|
|
489
|
+
}, Kt = ["aria-label"], Rt = {
|
|
490
|
+
key: 0,
|
|
491
|
+
class: "magic-parameter-heading"
|
|
492
|
+
}, Ht = ["disabled", "aria-label", "title"], Bt = ["aria-label", "title"], Ft = { class: "magic-parameter-body" }, Gt = ["aria-label"], zt = { class: "direct-control-label" }, Nt = ["data-strength-preset", "disabled", "onClick"], Xt = ["disabled"], Yt = {
|
|
493
|
+
key: 0,
|
|
494
|
+
class: "effect-field",
|
|
495
|
+
"data-field": "glassType"
|
|
496
|
+
}, Ut = ["value", "aria-label"], qt = ["value"], jt = ["data-field"], Wt = ["aria-label"], Zt = ["aria-pressed", "onClick"], Jt = ["data-field"], Qt = ["aria-label", "value", "onInput"], ea = ["aria-label"], ta = ["name", "value", "checked", "onChange", "onClick", "onKeydown"], aa = ["value", "aria-label", "onChange"], na = ["value"], la = ["checked", "aria-label", "onChange"], oa = ["aria-label", "value", "onChange"], ia = { value: "transparent" }, ra = { value: "color" }, sa = ["aria-label", "value", "onInput"], ca = ["aria-label", "min", "max", "step", "value", "onInput"], ua = ["aria-label", "min", "max", "step", "value", "onInput"], da = {
|
|
497
|
+
key: 0,
|
|
498
|
+
class: "field-unit"
|
|
499
|
+
}, fa = ["aria-label", "value"], ga = {
|
|
500
|
+
key: 2,
|
|
501
|
+
role: "alert",
|
|
502
|
+
class: "hint"
|
|
503
|
+
}, ya = { class: "effect-note" }, ha = /* @__PURE__ */ oe({
|
|
504
|
+
__name: "ImageEffectsToolPanel",
|
|
505
|
+
props: {
|
|
506
|
+
context: {}
|
|
507
|
+
},
|
|
508
|
+
setup(a, { expose: D }) {
|
|
509
|
+
const { ui: d } = re(), s = qe(d), g = a, O = we(), m = Je(() => g.context), k = L(() => m.value.imageEffects.effectId), K = L(
|
|
510
|
+
() => Be(g.context.entryId) && g.context.entryId === k.value ? g.context.entryId : void 0
|
|
511
|
+
), v = L(() => Fe(m.value.imageEffects)), x = L(() => Ge(m.value.imageEffects)), M = L(() => x.value.params), y = Qe(() => g.context, "imageEffects"), C = je(), p = L(
|
|
512
|
+
() => C.filter((t) => g.context.entryAllowed?.(t.entryId) !== !1)
|
|
513
|
+
), w = F({
|
|
514
|
+
kind: "category",
|
|
515
|
+
id: "all"
|
|
516
|
+
}), I = F(), E = F(), P = F();
|
|
517
|
+
let S;
|
|
518
|
+
function B() {
|
|
519
|
+
const t = P.value?.contains(document.activeElement);
|
|
520
|
+
if (!g.context.presentation?.setOpen(!1)) return !1;
|
|
521
|
+
if (t) {
|
|
522
|
+
const u = S?.isConnected && !S.matches(":disabled") ? S : I.value?.querySelector("button.selected:not(:disabled)");
|
|
523
|
+
u ? u.focus({ preventScroll: !0 }) : E.value?.focusControl();
|
|
524
|
+
}
|
|
525
|
+
return !0;
|
|
526
|
+
}
|
|
527
|
+
D({
|
|
528
|
+
blocksShortcuts: () => !!E.value?.hasOverlay?.(),
|
|
529
|
+
hasOverlay: () => !!E.value?.hasOverlay?.() || !!g.context.presentation?.open,
|
|
530
|
+
dismissOverlay: () => E.value?.dismissOverlay?.() || (g.context.presentation?.open ? B() : !1)
|
|
531
|
+
});
|
|
532
|
+
const R = L(() => {
|
|
533
|
+
const t = w.value;
|
|
534
|
+
if (t.kind === "category")
|
|
535
|
+
return p.value.filter(
|
|
536
|
+
(e) => t.id === "all" || U(e.entryId) === t.id
|
|
537
|
+
);
|
|
538
|
+
const u = t.text.trim().toLocaleLowerCase();
|
|
539
|
+
return p.value.filter(
|
|
540
|
+
(e) => `${d(e.titleKey)} ${e.entryId}`.toLocaleLowerCase().includes(u)
|
|
541
|
+
);
|
|
542
|
+
}), b = {
|
|
543
|
+
all: p.value.length,
|
|
544
|
+
light: p.value.filter((t) => U(t.entryId) === "light").length,
|
|
545
|
+
material: p.value.filter((t) => U(t.entryId) === "material").length,
|
|
546
|
+
art: p.value.filter((t) => U(t.entryId) === "art").length,
|
|
547
|
+
color: p.value.filter((t) => U(t.entryId) === "color").length,
|
|
548
|
+
distortion: p.value.filter((t) => U(t.entryId) === "distortion").length
|
|
549
|
+
};
|
|
550
|
+
ke(
|
|
551
|
+
() => g.context.entryId,
|
|
552
|
+
() => {
|
|
553
|
+
V();
|
|
554
|
+
}
|
|
555
|
+
), ie(V);
|
|
556
|
+
async function V() {
|
|
557
|
+
await _e(), I.value?.querySelector("button.selected")?.scrollIntoView?.({ block: "nearest", inline: "nearest" });
|
|
558
|
+
}
|
|
559
|
+
const A = L(
|
|
560
|
+
() => ze(m.value.imageEffects).map((t) => ({
|
|
561
|
+
...t,
|
|
562
|
+
value: Pe(t.key)
|
|
563
|
+
}))
|
|
564
|
+
), n = F(), h = L(() => A.value.some((t) => t.kind === "material")), c = L(
|
|
565
|
+
() => k.value === "duotone" && A.value.some((t) => t.kind === "palette") ? A.value.filter((t) => t.key === "shadowColor" || t.key === "highlightColor") : []
|
|
566
|
+
), T = L(
|
|
567
|
+
() => A.value.filter(
|
|
568
|
+
(t) => !c.value.includes(t) && !(h.value && t.key === "edgeColor") && !(v.value !== null && t.key === "pattern")
|
|
569
|
+
)
|
|
570
|
+
), ce = L(
|
|
571
|
+
() => String(m.value.imageEffects.params.edgeColor ?? ve)
|
|
572
|
+
);
|
|
573
|
+
function Ie() {
|
|
574
|
+
const t = n.value;
|
|
575
|
+
if (g.context.readonly || !t) return;
|
|
576
|
+
const u = J(m.value.imageEffects, "edgeMaterial", "custom");
|
|
577
|
+
m.value.imageEffects.params.edgeMaterial !== "custom" && y.value(u), t.value = String(u.params.edgeColor ?? ve), typeof t.showPicker == "function" ? t.showPicker() : t.click();
|
|
578
|
+
}
|
|
579
|
+
function $e(t) {
|
|
580
|
+
if (g.context.readonly || !(t.target instanceof HTMLInputElement)) return;
|
|
581
|
+
const u = J(m.value.imageEffects, "edgeMaterial", "custom");
|
|
582
|
+
y.value(J(u, "edgeColor", t.target.value));
|
|
583
|
+
}
|
|
584
|
+
function N(t) {
|
|
585
|
+
const u = k.value === "dither" && t === "pattern" ? "ditherPattern" : k.value === "film_stock" && t === "preset" ? "filmPreset" : t;
|
|
586
|
+
return d(`tools.image_effects.field.${u}`);
|
|
587
|
+
}
|
|
588
|
+
function Pe(t) {
|
|
589
|
+
const u = m.value.imageEffects.params[t];
|
|
590
|
+
return typeof u == "number" || typeof u == "string" || typeof u == "boolean" ? u : void 0;
|
|
591
|
+
}
|
|
592
|
+
function ue(t) {
|
|
593
|
+
const u = We.find((e) => e.id === t);
|
|
594
|
+
return u ? `linear-gradient(90deg, ${u.colors.join(", ")})` : void 0;
|
|
595
|
+
}
|
|
596
|
+
const ee = L(() => {
|
|
597
|
+
try {
|
|
598
|
+
return {
|
|
599
|
+
snapshot: Ne(m.value.imageEffects),
|
|
600
|
+
error: ""
|
|
601
|
+
};
|
|
602
|
+
} catch (t) {
|
|
603
|
+
return {
|
|
604
|
+
snapshot: void 0,
|
|
605
|
+
error: s(
|
|
606
|
+
t instanceof Error ? t.message : String(t),
|
|
607
|
+
"invalidParams"
|
|
608
|
+
)
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
function Le(t, u) {
|
|
613
|
+
g.context.selectEntry?.(t) === !0 && u.currentTarget instanceof HTMLElement && (S = u.currentTarget);
|
|
614
|
+
}
|
|
615
|
+
function X(t, u) {
|
|
616
|
+
te({ [t]: u });
|
|
617
|
+
}
|
|
618
|
+
function te(t) {
|
|
619
|
+
if (g.context.readonly) return;
|
|
620
|
+
const u = m.value.imageEffects;
|
|
621
|
+
let e = u;
|
|
622
|
+
for (const [i, G] of Object.entries(t))
|
|
623
|
+
e.params[i] !== G && (e = J(e, i, G));
|
|
624
|
+
e !== u && y.value(e);
|
|
625
|
+
}
|
|
626
|
+
function Te(t) {
|
|
627
|
+
if (g.context.readonly || !(t.target instanceof HTMLSelectElement)) return;
|
|
628
|
+
const u = t.target.value, e = pe.find((i) => i === u);
|
|
629
|
+
e && y.value(Ze(m.value.imageEffects, e));
|
|
630
|
+
}
|
|
631
|
+
function de() {
|
|
632
|
+
g.context.readonly || g.context.resetDraft({
|
|
633
|
+
imageEffects: x.value
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
const Me = {
|
|
637
|
+
sparkle: { subtle: 25, balanced: 55, bold: 85 },
|
|
638
|
+
glow: { subtle: 25, balanced: 55, bold: 85 },
|
|
639
|
+
lens_flare: { subtle: 20, balanced: 50, bold: 80 },
|
|
640
|
+
tilt_shift: { subtle: 25, balanced: 55, bold: 85 }
|
|
641
|
+
};
|
|
642
|
+
function fe(t) {
|
|
643
|
+
return t === "lens_flare" || t === "tilt_shift";
|
|
644
|
+
}
|
|
645
|
+
function ge(t) {
|
|
646
|
+
if (t === "sparkle" || t === "glow" || fe(t)) return Me[t];
|
|
647
|
+
}
|
|
648
|
+
const ye = L(() => {
|
|
649
|
+
const t = ge(k.value);
|
|
650
|
+
return t ? ["subtle", "balanced", "bold"].map((u) => ({ id: u, value: t[u] ?? 0 })) : [];
|
|
651
|
+
}), he = L(
|
|
652
|
+
() => fe(k.value) ? k.value : void 0
|
|
653
|
+
);
|
|
654
|
+
function q(t, u = 0) {
|
|
655
|
+
const e = m.value.imageEffects.params[t];
|
|
656
|
+
return typeof e == "number" && Number.isFinite(e) ? e : u;
|
|
657
|
+
}
|
|
658
|
+
function Se(t) {
|
|
659
|
+
if (g.context.readonly) return;
|
|
660
|
+
const u = ge(k.value);
|
|
661
|
+
if (!u) return;
|
|
662
|
+
const e = u[t];
|
|
663
|
+
if (e === void 0) return;
|
|
664
|
+
const i = { strength: e };
|
|
665
|
+
k.value === "glow" && (i.radius = t === "subtle" ? 8 : t === "balanced" ? 16 : 24), k.value === "lens_flare" && (i.size = t === "subtle" ? 30 : t === "balanced" ? 55 : 80), k.value === "tilt_shift" && (i.width = t === "subtle" ? 25 : t === "balanced" ? 45 : 70), te(i);
|
|
666
|
+
}
|
|
667
|
+
return (t, u) => (o(), Q(Xe, {
|
|
668
|
+
context: a.context,
|
|
669
|
+
layout: "contained",
|
|
670
|
+
changed: !!K.value && !a.context.presentation && l(be)(l(m).imageEffects.params, M.value),
|
|
671
|
+
onReset: de
|
|
672
|
+
}, {
|
|
673
|
+
default: me(() => [
|
|
674
|
+
f("div", Mt, [
|
|
675
|
+
Y(Tt, {
|
|
676
|
+
ref_key: "picker",
|
|
677
|
+
ref: E,
|
|
678
|
+
modelValue: w.value,
|
|
679
|
+
"onUpdate:modelValue": u[0] || (u[0] = (e) => w.value = e),
|
|
680
|
+
counts: b,
|
|
681
|
+
"delegate-escape": !!a.context.presentation
|
|
682
|
+
}, null, 8, ["modelValue", "delegate-escape"]),
|
|
683
|
+
f("div", {
|
|
684
|
+
ref_key: "gallery",
|
|
685
|
+
ref: I,
|
|
686
|
+
class: "magic-gallery",
|
|
687
|
+
"data-view": w.value.kind === "category" ? w.value.id : "query",
|
|
688
|
+
"aria-label": l(d)("tools.image_effects.effectLabel")
|
|
689
|
+
}, [
|
|
690
|
+
R.value.length ? (o(), r("div", Vt, [
|
|
691
|
+
(o(!0), r(H, null, z(R.value, (e) => (o(), r("button", {
|
|
692
|
+
key: e.entryId,
|
|
693
|
+
type: "button",
|
|
694
|
+
class: W({ selected: e.entryId === K.value }),
|
|
695
|
+
disabled: a.context.readonly,
|
|
696
|
+
"aria-pressed": e.entryId === K.value,
|
|
697
|
+
onClick: (i) => Le(e.entryId, i)
|
|
698
|
+
}, [
|
|
699
|
+
f("img", {
|
|
700
|
+
src: l(Ee)(`tool-cards/magic-v3/${e.entryId}.webp`),
|
|
701
|
+
alt: "",
|
|
702
|
+
loading: "lazy"
|
|
703
|
+
}, null, 8, Dt),
|
|
704
|
+
f("span", null, _(l(d)(e.titleKey)), 1)
|
|
705
|
+
], 10, At))), 128))
|
|
706
|
+
])) : (o(), r("div", Ot, [
|
|
707
|
+
f("p", null, _(l(d)("tools.image_effects.gallery.noResults")), 1),
|
|
708
|
+
f("button", {
|
|
709
|
+
type: "button",
|
|
710
|
+
onClick: u[1] || (u[1] = (e) => w.value = { kind: "category", id: "all" })
|
|
711
|
+
}, _(l(d)("tools.image_effects.gallery.clear")), 1)
|
|
712
|
+
]))
|
|
713
|
+
], 8, St),
|
|
714
|
+
(o(), Q(Ve(a.context.presentation ? Ae : "div"), {
|
|
715
|
+
to: a.context.presentation?.target
|
|
716
|
+
}, {
|
|
717
|
+
default: me(() => [
|
|
718
|
+
K.value ? De((o(), r("section", {
|
|
719
|
+
key: 0,
|
|
720
|
+
ref_key: "parameterFrame",
|
|
721
|
+
ref: P,
|
|
722
|
+
class: W(["magic-parameters", { "magic-parameters-floating": !!a.context.presentation }]),
|
|
723
|
+
"aria-label": l(d)(`tools.image_effects.${k.value}.title`)
|
|
724
|
+
}, [
|
|
725
|
+
a.context.presentation ? (o(), r("header", Rt, [
|
|
726
|
+
f("h2", null, _(l(d)(`tools.image_effects.${k.value}.title`)), 1),
|
|
727
|
+
a.context.resetAllowed !== !1 ? (o(), r("button", {
|
|
728
|
+
key: 0,
|
|
729
|
+
type: "button",
|
|
730
|
+
class: "magic-parameter-reset",
|
|
731
|
+
disabled: a.context.readonly || !l(be)(l(m).imageEffects.params, M.value),
|
|
732
|
+
"aria-label": l(d)("common.toolPanel_cc611e20"),
|
|
733
|
+
title: l(d)("common.toolPanel_cc611e20"),
|
|
734
|
+
onClick: de
|
|
735
|
+
}, [
|
|
736
|
+
Y(l(Ye), { size: 16 })
|
|
737
|
+
], 8, Ht)) : $("", !0),
|
|
738
|
+
f("button", {
|
|
739
|
+
type: "button",
|
|
740
|
+
class: "magic-parameter-close",
|
|
741
|
+
"aria-label": l(d)("common.toolPanel_08c744de"),
|
|
742
|
+
title: l(d)("common.toolPanel_08c744de"),
|
|
743
|
+
onClick: B
|
|
744
|
+
}, [
|
|
745
|
+
Y(l(Ce), { size: 18 })
|
|
746
|
+
], 8, Bt)
|
|
747
|
+
])) : $("", !0),
|
|
748
|
+
f("div", Ft, [
|
|
749
|
+
ye.value.length ? (o(), r("div", {
|
|
750
|
+
key: 0,
|
|
751
|
+
class: "strength-presets",
|
|
752
|
+
role: "group",
|
|
753
|
+
"aria-label": l(d)("tools.image_effects.strengthPresets")
|
|
754
|
+
}, [
|
|
755
|
+
f("span", zt, _(l(d)("tools.image_effects.strengthPresets")), 1),
|
|
756
|
+
(o(!0), r(H, null, z(ye.value, (e) => (o(), r("button", {
|
|
757
|
+
key: e.id,
|
|
758
|
+
type: "button",
|
|
759
|
+
"data-strength-preset": e.id,
|
|
760
|
+
disabled: a.context.readonly,
|
|
761
|
+
onClick: (i) => Se(e.id)
|
|
762
|
+
}, _(l(d)(`tools.image_effects.strengthPreset.${e.id}`)), 9, Nt))), 128))
|
|
763
|
+
], 8, Gt)) : $("", !0),
|
|
764
|
+
he.value ? (o(), Q(xt, {
|
|
765
|
+
key: 1,
|
|
766
|
+
"effect-id": he.value,
|
|
767
|
+
center: q("center", 50),
|
|
768
|
+
width: q("width", 40),
|
|
769
|
+
angle: q("angle"),
|
|
770
|
+
"light-x": q("lightX", 50),
|
|
771
|
+
"light-y": q("lightY", 50),
|
|
772
|
+
readonly: a.context.readonly,
|
|
773
|
+
"image-source": a.context.view.currentImageSource?.url,
|
|
774
|
+
"image-width": a.context.view.currentWidth,
|
|
775
|
+
"image-height": a.context.view.currentHeight,
|
|
776
|
+
onChange: te
|
|
777
|
+
}, null, 8, ["effect-id", "center", "width", "angle", "light-x", "light-y", "readonly", "image-source", "image-width", "image-height"])) : $("", !0),
|
|
778
|
+
f("fieldset", {
|
|
779
|
+
class: "effect-fields",
|
|
780
|
+
disabled: a.context.readonly
|
|
781
|
+
}, [
|
|
782
|
+
f("legend", null, [
|
|
783
|
+
Oe(_(l(d)(`tools.image_effects.${k.value}.title`)) + " ", 1),
|
|
784
|
+
f("small", null, "V" + _(l(m).imageEffects.effectVersion ?? l(Ue)(k.value)), 1)
|
|
785
|
+
]),
|
|
786
|
+
v.value !== null ? (o(), r("label", Yt, [
|
|
787
|
+
f("span", null, _(l(d)("tools.image_effects.field.glassType")), 1),
|
|
788
|
+
f("select", {
|
|
789
|
+
value: v.value,
|
|
790
|
+
"aria-label": l(d)("tools.image_effects.field.glassType"),
|
|
791
|
+
onChange: Te
|
|
792
|
+
}, [
|
|
793
|
+
(o(!0), r(H, null, z(l(pe), (e) => (o(), r("option", {
|
|
794
|
+
key: e,
|
|
795
|
+
value: e
|
|
796
|
+
}, _(l(d)(`tools.image_effects.option.${e}`)), 9, qt))), 128))
|
|
797
|
+
], 40, Ut)
|
|
798
|
+
])) : $("", !0),
|
|
799
|
+
(o(!0), r(H, null, z(T.value, (e) => (o(), r("div", {
|
|
800
|
+
key: e.key,
|
|
801
|
+
class: "effect-field",
|
|
802
|
+
"data-field": e.key
|
|
803
|
+
}, [
|
|
804
|
+
f("span", null, _(N(e.key)), 1),
|
|
805
|
+
e.kind === "palette" ? (o(), r("div", {
|
|
806
|
+
key: 0,
|
|
807
|
+
class: "palette-grid",
|
|
808
|
+
role: "group",
|
|
809
|
+
"aria-label": N(e.key)
|
|
810
|
+
}, [
|
|
811
|
+
(o(!0), r(H, null, z(e.options, (i) => (o(), r("button", {
|
|
812
|
+
key: i,
|
|
813
|
+
type: "button",
|
|
814
|
+
"aria-pressed": e.value === i,
|
|
815
|
+
class: W({ selected: e.value === i }),
|
|
816
|
+
onClick: (G) => X(e.key, i)
|
|
817
|
+
}, [
|
|
818
|
+
ue(i) ? (o(), r("span", {
|
|
819
|
+
key: 0,
|
|
820
|
+
class: "palette-swatch",
|
|
821
|
+
style: Z({ background: ue(i) }),
|
|
822
|
+
"aria-hidden": "true"
|
|
823
|
+
}, null, 4)) : $("", !0),
|
|
824
|
+
f("span", null, _(l(d)(`tools.image_effects.palette.${i}`)), 1)
|
|
825
|
+
], 10, Zt))), 128)),
|
|
826
|
+
(o(!0), r(H, null, z(c.value, (i) => (o(), r("label", {
|
|
827
|
+
key: i.key,
|
|
828
|
+
class: "palette-custom-color",
|
|
829
|
+
"data-field": i.key
|
|
830
|
+
}, [
|
|
831
|
+
f("input", {
|
|
832
|
+
type: "color",
|
|
833
|
+
"aria-label": l(d)(`tools.image_effects.field.${i.key}`),
|
|
834
|
+
value: String(i.value),
|
|
835
|
+
onInput: (G) => X(i.key, G.target.value),
|
|
836
|
+
onKeydown: u[2] || (u[2] = ae((G) => !a.context.presentation && G.stopPropagation(), ["esc"]))
|
|
837
|
+
}, null, 40, Qt),
|
|
838
|
+
f("span", null, _(l(d)(`tools.image_effects.field.${i.key}`)), 1)
|
|
839
|
+
], 8, Jt))), 128))
|
|
840
|
+
], 8, Wt)) : e.kind === "material" ? (o(), r("div", {
|
|
841
|
+
key: 1,
|
|
842
|
+
class: "material-options",
|
|
843
|
+
role: "radiogroup",
|
|
844
|
+
"aria-label": N(e.key)
|
|
845
|
+
}, [
|
|
846
|
+
(o(!0), r(H, null, z(e.options, (i) => (o(), r("label", {
|
|
847
|
+
key: i,
|
|
848
|
+
class: "material-option"
|
|
849
|
+
}, [
|
|
850
|
+
f("input", {
|
|
851
|
+
type: "radio",
|
|
852
|
+
name: l(O),
|
|
853
|
+
value: i,
|
|
854
|
+
checked: e.value === i,
|
|
855
|
+
onChange: (G) => X(e.key, i),
|
|
856
|
+
onClick: (G) => i === "custom" && Ie(),
|
|
857
|
+
onKeydown: ae((G) => !a.context.presentation && i === "custom" && G.stopPropagation(), ["esc"])
|
|
858
|
+
}, null, 40, ta),
|
|
859
|
+
f("span", {
|
|
860
|
+
class: W(["material-swatch", `material-swatch-${i}`]),
|
|
861
|
+
"aria-hidden": "true"
|
|
862
|
+
}, [
|
|
863
|
+
i === "custom" ? (o(), r("span", {
|
|
864
|
+
key: 0,
|
|
865
|
+
class: "material-custom-center",
|
|
866
|
+
style: Z({
|
|
867
|
+
background: ce.value
|
|
868
|
+
})
|
|
869
|
+
}, null, 4)) : $("", !0)
|
|
870
|
+
], 2),
|
|
871
|
+
f("span", null, _(l(d)(`tools.image_effects.option.${i}`)), 1)
|
|
872
|
+
]))), 128))
|
|
873
|
+
], 8, ea)) : e.kind === "select" ? (o(), r("select", {
|
|
874
|
+
key: 2,
|
|
875
|
+
value: typeof e.value == "boolean" ? void 0 : e.value ?? e.options?.[0],
|
|
876
|
+
"aria-label": N(e.key),
|
|
877
|
+
onChange: (i) => X(e.key, i.target.value)
|
|
878
|
+
}, [
|
|
879
|
+
(o(!0), r(H, null, z(e.options, (i) => (o(), r("option", {
|
|
880
|
+
key: i,
|
|
881
|
+
value: i
|
|
882
|
+
}, _(l(d)(`tools.image_effects.option.${i}`)), 9, na))), 128))
|
|
883
|
+
], 40, aa)) : e.kind === "boolean" ? (o(), r("input", {
|
|
884
|
+
key: 3,
|
|
885
|
+
type: "checkbox",
|
|
886
|
+
checked: e.value === !0,
|
|
887
|
+
"aria-label": N(e.key),
|
|
888
|
+
onChange: (i) => X(e.key, i.target.checked)
|
|
889
|
+
}, null, 40, la)) : e.kind === "color" ? (o(), r(H, { key: 4 }, [
|
|
890
|
+
e.key === "background" ? (o(), r("select", {
|
|
891
|
+
key: 0,
|
|
892
|
+
"aria-label": N(e.key),
|
|
893
|
+
value: e.value === "transparent" ? "transparent" : "color",
|
|
894
|
+
onChange: (i) => X(
|
|
895
|
+
e.key,
|
|
896
|
+
i.target.value === "transparent" ? "transparent" : "#ffffff"
|
|
897
|
+
)
|
|
898
|
+
}, [
|
|
899
|
+
f("option", ia, _(l(d)("tools.image_effects.transparent")), 1),
|
|
900
|
+
f("option", ra, _(l(d)("tools.image_effects.solidColor")), 1)
|
|
901
|
+
], 40, oa)) : $("", !0),
|
|
902
|
+
e.value !== "transparent" ? (o(), r("input", {
|
|
903
|
+
key: 1,
|
|
904
|
+
type: "color",
|
|
905
|
+
"aria-label": N(e.key),
|
|
906
|
+
value: typeof e.value == "boolean" ? void 0 : e.value,
|
|
907
|
+
onInput: (i) => X(e.key, i.target.value)
|
|
908
|
+
}, null, 40, sa)) : $("", !0)
|
|
909
|
+
], 64)) : (o(), r(H, { key: 5 }, [
|
|
910
|
+
f("input", {
|
|
911
|
+
type: "range",
|
|
912
|
+
"aria-label": N(e.key),
|
|
913
|
+
min: e.min,
|
|
914
|
+
max: e.max,
|
|
915
|
+
step: e.step,
|
|
916
|
+
value: typeof e.value == "boolean" ? void 0 : e.value,
|
|
917
|
+
onInput: (i) => X(e.key, Number(i.target.value))
|
|
918
|
+
}, null, 40, ca),
|
|
919
|
+
f("input", {
|
|
920
|
+
type: "number",
|
|
921
|
+
"aria-label": N(e.key),
|
|
922
|
+
min: e.min,
|
|
923
|
+
max: e.max,
|
|
924
|
+
step: e.step,
|
|
925
|
+
value: typeof e.value == "boolean" ? void 0 : e.value,
|
|
926
|
+
onInput: (i) => X(e.key, Number(i.target.value))
|
|
927
|
+
}, null, 40, ua),
|
|
928
|
+
e.unit ? (o(), r("span", da, _(e.unit), 1)) : $("", !0)
|
|
929
|
+
], 64))
|
|
930
|
+
], 8, jt))), 128)),
|
|
931
|
+
h.value ? (o(), r("input", {
|
|
932
|
+
key: 1,
|
|
933
|
+
ref_key: "customEdgePicker",
|
|
934
|
+
ref: n,
|
|
935
|
+
type: "color",
|
|
936
|
+
class: "material-color-picker",
|
|
937
|
+
tabindex: "-1",
|
|
938
|
+
"aria-label": l(d)("tools.image_effects.field.edgeColor"),
|
|
939
|
+
value: ce.value,
|
|
940
|
+
onInput: $e,
|
|
941
|
+
onKeydown: u[3] || (u[3] = ae((e) => !a.context.presentation && e.stopPropagation(), ["esc"]))
|
|
942
|
+
}, null, 40, fa)) : $("", !0)
|
|
943
|
+
], 8, Xt),
|
|
944
|
+
ee.value.error ? (o(), r("p", ga, _(ee.value.error), 1)) : $("", !0),
|
|
945
|
+
f("p", ya, _(l(d)("tools.image_effects.panelNote")), 1)
|
|
946
|
+
]),
|
|
947
|
+
Y(et, {
|
|
948
|
+
context: a.context,
|
|
949
|
+
available: !0,
|
|
950
|
+
ready: !!K.value && !!ee.value.snapshot
|
|
951
|
+
}, null, 8, ["context", "ready"])
|
|
952
|
+
], 10, Kt)), [
|
|
953
|
+
[Ke, !a.context.presentation || a.context.presentation.open]
|
|
954
|
+
]) : $("", !0)
|
|
955
|
+
]),
|
|
956
|
+
_: 1
|
|
957
|
+
}, 8, ["to"]))
|
|
958
|
+
])
|
|
959
|
+
]),
|
|
960
|
+
_: 1
|
|
961
|
+
}, 8, ["context", "changed"]));
|
|
962
|
+
}
|
|
963
|
+
}), ka = /* @__PURE__ */ se(ha, [["__scopeId", "data-v-4fd94c0d"]]);
|
|
964
|
+
export {
|
|
965
|
+
ka as default
|
|
966
|
+
};
|