pixedi 1.2.1 → 1.4.0

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/lib/index.js CHANGED
@@ -1,21 +1,43 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._button_snd36_1{cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#0000;border:1px solid #0000;border-radius:4px;justify-content:center;align-items:center;gap:8px;height:32px;padding:0 8px;font-family:inherit;font-size:14px;font-weight:500;transition:background-color .2s,border-color .2s,opacity .2s;display:inline-flex}._button_snd36_1:disabled{pointer-events:none;opacity:.5}._button_snd36_1 svg{flex-shrink:0;width:16px;height:16px}._default_snd36_32{background-color:var(--primary);color:var(--primary-foreground)}._default_snd36_32:hover{opacity:.9}._outline_snd36_39{border-color:var(--border);background-color:var(--background);color:var(--foreground)}._outline_snd36_39:hover{background-color:var(--secondary)}._ghost_snd36_47{color:var(--foreground);padding:0 8px}._ghost_snd36_47:hover{background-color:var(--secondary)}._rect_snd36_54{width:32px;height:32px}:host{height:100%;display:block}:host *{box-sizing:border-box}._root_kw2xl_8{width:100%;height:100%;font-size:16px;font-family:var(--font-sans);--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Helvetica, Arial, sans-serif;--color-white:#fff;--color-white-fade:color-mix(in srgb, var(--color-white) 30%, transparent);--color-black:#000;--color-transparent:transparent;--color-red:oklch(63.7% .237 25.331);--color-green:oklch(76.8% .188 151.716);--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(75.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--accent-blue:oklch(60.9% .221 251.687);--accent-blue-light:oklch(96% .02 250);--accent-blue-fade:color-mix(in srgb, var(--accent-blue) 60%, transparent);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 50%, transparent);--overlay-bg-white:color-mix(in srgb, var(--color-white) 80%, transparent);position:relative}._root_kw2xl_8[data-theme=dark]{--background:oklch(24.5% 0 0);--foreground:oklch(78.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(24.5% 0 0);--muted-foreground:oklch(50% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--accent-blue-light:oklch(25% .06 250);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 75%, transparent)}._root_kw2xl_8 h1,._root_kw2xl_8 h2,._root_kw2xl_8 h3,._root_kw2xl_8 h4,._root_kw2xl_8 h5,._root_kw2xl_8 h6{color:var(--foreground);margin:0;font-weight:600}._textRed_kw2xl_73{color:var(--color-red)}._bgRed_kw2xl_76{background-color:var(--color-red)}._bgGreen_kw2xl_79{background-color:var(--color-green)}._textGreen_kw2xl_82{color:var(--color-green)}._mask_kw2xl_85{background-color:var(--overlay-bg)}._semibold_kw2xl_88{letter-spacing:.4px;font-weight:600}._bold_kw2xl_92{letter-spacing:.4px;font-weight:700}._system_kw2xl_96{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_kw2xl_105{width:100%;height:100%;min-height:480px;position:relative}._main_kw2xl_111{background-color:var(--background);grid-template-rows:auto 1fr;display:grid;position:absolute;inset:0;overflow:hidden}._grid_kw2xl_119{grid-template-columns:1fr auto;min-height:0;display:grid;position:relative;overflow:hidden}._button_gf7m5_1{border:1px solid var(--border);background-color:var(--background);color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;border-radius:4px;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:12px;font-family:inherit;font-size:12px;transition:all .2s;display:inline-flex}._button_gf7m5_1:hover:not([aria-pressed=true]){background-color:var(--secondary)}._button_gf7m5_1[aria-pressed=true]{border-color:var(--accent-blue);background-color:var(--accent-blue-light);color:var(--foreground)}._button_gf7m5_1 svg{flex-shrink:0;width:20px;height:20px}._button_gf7m5_1 span{white-space:nowrap}._separator_rqskq_1{background-color:var(--border);box-sizing:border-box;border:none;flex-shrink:0;display:block}._separator_rqskq_1[data-orientation=horizontal]{width:100%;height:1px}._separator_rqskq_1[data-orientation=vertical]{align-self:stretch;width:1px;height:100%;margin:0}._wrapper_12rgt_1{box-sizing:border-box;width:100%;position:relative}._trigger_12rgt_6{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--border);cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:4px;outline:none;justify-content:space-between;align-items:center;padding:0 8px 0 10px;font-family:inherit;font-size:14px;transition:border-color .2s;display:flex}._trigger_12rgt_6:hover,._trigger_12rgt_6:focus{border-color:var(--muted-foreground)}._triggerArrow_12rgt_29{width:16px;height:16px;color:var(--muted-foreground);transition:transform .2s}._wrapper_12rgt_1[data-state=open] ._triggerArrow_12rgt_29{transform:rotate(180deg)}._content_12rgt_38{background-color:var(--background);border:1px solid var(--border);z-index:50;box-sizing:border-box;border-radius:4px;width:100%;max-height:282px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow-y:auto;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}._content_12rgt_38::-webkit-scrollbar{width:4px}._content_12rgt_38::-webkit-scrollbar-track{background:0 0}._content_12rgt_38::-webkit-scrollbar-thumb{background-color:var(--border);border-radius:10px}._wrapper_12rgt_1[data-state=closed] ._content_12rgt_38{display:none}._groupLabel_12rgt_68{color:var(--muted-foreground);-webkit-user-select:none;user-select:none;padding:8px 10px;font-size:12px;font-weight:500}._item_12rgt_75{width:100%;color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;background:0 0;border-radius:4px;justify-content:space-between;align-items:center;padding:4px 10px;display:flex}._item_12rgt_75:hover{background-color:var(--secondary)}._itemLeft_12rgt_91{font-size:14px;font-weight:400}._itemAddon_12rgt_95{align-items:center;gap:8px;display:flex}._itemAddon_12rgt_95>span{color:var(--muted-foreground);font-size:12px}._itemAddon_12rgt_95>svg{font-size:14px}._itemAddon_12rgt_95>b{flex-shrink:0;width:16px;height:16px}._itemRightContainer_12rgt_112{align-items:center;gap:8px;display:flex}._itemRight_12rgt_112{color:var(--muted-foreground);font-size:14px}._itemCheck_12rgt_121{width:16px;height:16px;color:var(--foreground);flex-shrink:0}._input_j55nq_1{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--input);box-sizing:border-box;border-radius:4px;outline:none;padding:0 8px;font-family:inherit;font-size:14px;line-height:normal;transition:border-color .2s,box-shadow .2s;display:block}._input_j55nq_1:hover:not(:disabled):not(:focus){border-color:var(--muted-foreground)}._input_j55nq_1:focus{box-shadow:0 0 0 1px var(--ring)}._input_j55nq_1:disabled{cursor:not-allowed;opacity:.5;background-color:var(--secondary)}._input_j55nq_1::placeholder{color:var(--muted-foreground);opacity:1}._numberClean_j55nq_34::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._numberClean_j55nq_34::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._numberClean_j55nq_34[type=number]{-moz-appearance:textfield}._container_14vsv_1{position:relative}._legend_14vsv_4{color:var(--muted-foreground);background:var(--background);margin-left:8px;padding:0 4px;font-size:12px;position:absolute;top:-9px}._suffix_14vsv_13{color:var(--muted-foreground);pointer-events:none;-webkit-user-select:none;user-select:none;font-size:14px;position:absolute;bottom:2px;right:8px}._group_qpue1_1{margin-left:4px;display:flex}._group_qpue1_1 ._save_qpue1_6{width:36px;color:var(--color-green);border-top-right-radius:0;border-bottom-right-radius:0}._group_qpue1_1 ._close_qpue1_13{width:36px;color:var(--color-red);border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}._sliderContainer_1ntcm_1{cursor:pointer;touch-action:none;--slider-progress:0%;align-items:center;width:100%;height:24px;display:flex;position:relative}._sliderContainer_1ntcm_1._disabled_1ntcm_12{pointer-events:none;cursor:not-allowed;opacity:.5}._sliderTrack_1ntcm_18{background-color:color-mix(in oklch, var(--muted-foreground) 65%, transparent);border-radius:2px;width:100%;height:2px;position:relative}._sliderRange_1ntcm_30{background-color:var(--primary);height:100%;width:var(--slider-progress);border-radius:2px;position:absolute}._sliderThumb_1ntcm_38{background-color:var(--background);border:2px solid var(--primary);pointer-events:none;border-radius:50%;width:12px;height:13px;transition:transform .1s,box-shadow .1s;position:absolute;top:50%;transform:translate(-50%,-50%)}._hiddenInput_1ntcm_53{opacity:0;cursor:pointer;z-index:1;width:100%;height:100%;margin:0;position:absolute;top:0;left:0}._sliderContainer_1ntcm_1:not(._disabled_1ntcm_12):hover ._sliderThumb_1ntcm_38{transform:translate(-50%,-50%)scale(1.1)}._header_msw8l_1{box-sizing:border-box;background-color:var(--background);border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;height:48px;padding:0 8px;display:flex}._tools_msw8l_11{gap:8px;display:flex}._history_msw8l_15{align-items:center;gap:8px;display:flex}._historyText_msw8l_20{color:var(--muted-foreground);font-size:14px}._resize_11cwi_1{background-color:var(--background);border-radius:4px;flex-direction:column;gap:2px;padding:8px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._slider_11cwi_14{width:80%;margin:0 auto -4px}._border_11cwi_18{border-bottom:1px solid var(--border);width:60px;margin:12px auto 4px;display:inline-block}._tools_11cwi_24{align-items:center;gap:6px;margin-top:16px;display:flex}._toolsLock_11cwi_30{width:12px;height:12px;color:var(--muted-foreground)}._preview_dvanl_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._rotate_dvanl_12{box-sizing:border-box;width:100%;height:100%;transition:all .2s linear;position:absolute;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}._flip_dvanl_24{box-sizing:border-box;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._image_dvanl_32{max-width:none;max-height:none;transition:all .2s linear;display:block;position:absolute}._wrapper_13nh3_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._box_13nh3_9{cursor:move;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;border:1px solid var(--color-white-fade);position:absolute}._tools_13nh3_18{background-color:var(--background);box-sizing:border-box;border:1px solid var(--border);border-radius:4px;align-items:center;padding:4px 4px 4px 8px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}._toolsInfo_13nh3_34{-webkit-user-select:none;user-select:none;min-width:54px;margin-top:-2px;display:inline-block}._toolsInfoLabel_13nh3_41{color:var(--muted-foreground);font-size:12px;line-height:12px}._toolsInfoValue_13nh3_46{color:var(--foreground);font-size:14px;line-height:14px}._linesBox_13nh3_51{pointer-events:none;position:absolute;inset:2px}._line_13nh3_51{border:1px dashed var(--color-white);opacity:.5;position:absolute}._lineV_13nh3_61{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._lineH_13nh3_69{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._pointer_13nh3_77{box-sizing:border-box;width:14px;height:14px;position:absolute}._pointerTopLeft_13nh3_83{border-top:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nwse-resize;top:-6px;left:-6px}._pointerTopRight_13nh3_90{border-top:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nesw-resize;top:-6px;right:-6px}._pointerBottomRight_13nh3_97{border-bottom:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nwse-resize;bottom:-6px;right:-6px}._pointerBottomLeft_13nh3_104{border-bottom:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nesw-resize;bottom:-6px;left:-6px}._mobileBorder_13nh3_111{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._mobilePointer_13nh3_117{background-color:var(--overlay-bg-white);border:3px solid var(--accent-blue);box-sizing:border-box;border-radius:50%;width:32px;height:32px;position:absolute;bottom:-16px;right:-16px}._flip_17ic5_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_17ic5_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_17ic5_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._rotate_gkt07_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_gkt07_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_gkt07_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_xffug_1{box-sizing:border-box;width:100%;height:100%;margin:0 auto;padding:16px;position:relative}._sidebar_8qtha_1{z-index:10;width:0;transition:transform .15s ease-out;position:relative}@media (width>=768px){._sidebar_8qtha_1{width:320px;transition:none}}._settings_8qtha_11{border-radius:50%;width:40px;height:40px;position:absolute;top:8px;right:8px;box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a}@media (width>=768px){._settings_8qtha_11{display:none}}._container_8qtha_25{box-sizing:border-box;border-left:1px solid var(--border);position:absolute;inset:0}._content_8qtha_31{background-color:var(--background);box-sizing:border-box;flex-direction:column;width:320px;height:100%;padding:16px;display:flex;position:absolute;top:0;left:0;overflow-y:auto}@media (width<=767px){._content_8qtha_31{padding-top:48px}}._closeBtn_8qtha_47{position:absolute;top:8px;right:8px}._separator_8qtha_52{margin-top:20px;margin-bottom:12px}._resize_8qtha_56{justify-content:space-between;align-items:center;display:flex}._resizeIcon_8qtha_61{align-items:center;gap:8px;display:flex}._resizeSize_8qtha_66{color:var(--muted-foreground);font-size:14px}._crop_8qtha_70{flex-direction:column;gap:8px;display:flex}._ratio_8qtha_75{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}._sidebarPreset_8qtha_80{flex-direction:column;gap:8px;display:flex}._flipRotate_8qtha_85{grid-template-columns:repeat(2,1fr);gap:8px;display:grid}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
- import { createContext as e, forwardRef as t, useContext as n, useEffect as r, useLayoutEffect as i, useMemo as a, useRef as o, useState as s } from "react";
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._button_1vpzl_1{cursor:pointer;white-space:nowrap;-webkit-user-select:none;user-select:none;box-sizing:border-box;background-color:#0000;border:1px solid #0000;border-radius:4px;justify-content:center;align-items:center;gap:8px;height:32px;padding:0 8px;font-family:inherit;font-size:14px;font-weight:500;transition:background-color .2s,border-color .2s,opacity .2s;display:inline-flex}._button_1vpzl_1:disabled{pointer-events:none;opacity:.5}._button_1vpzl_1 svg{flex-shrink:0;width:16px;height:16px}._default_1vpzl_35{background-color:var(--primary);color:var(--primary-foreground)}._default_1vpzl_35:hover{opacity:.9}._outline_1vpzl_44{border-color:var(--border);background-color:var(--background);color:var(--foreground)}._outline_1vpzl_44:hover{background-color:var(--secondary)}._ghost_1vpzl_54{color:var(--foreground);padding:0 8px}._ghost_1vpzl_54:hover{background-color:var(--secondary)}._rect_1vpzl_63{width:32px;height:32px}._separator_gp8ff_1{background-color:var(--border);box-sizing:border-box;border:none;flex-shrink:0;display:block}._separator_gp8ff_1[data-orientation=horizontal]{width:100%;height:1px}._separator_gp8ff_1[data-orientation=vertical]{align-self:stretch;width:1px;height:100%;margin:0}._wrapper_1aw0m_1{box-sizing:border-box;width:100%;position:relative}._trigger_1aw0m_6{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--border);cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:4px;outline:none;justify-content:space-between;align-items:center;padding:0 8px 0 10px;font-family:inherit;font-size:14px;transition:border-color .2s;display:flex}._trigger_1aw0m_6:hover,._trigger_1aw0m_6:focus{border-color:var(--muted-foreground)}._triggerArrow_1aw0m_31{width:16px;height:16px;color:var(--muted-foreground);transition:transform .2s}._wrapper_1aw0m_1[data-state=open] ._triggerArrow_1aw0m_31{transform:rotate(180deg)}._content_1aw0m_40{background-color:var(--background);border:1px solid var(--border);z-index:50;box-sizing:border-box;border-radius:4px;width:100%;max-height:282px;padding:4px;position:absolute;top:calc(100% + 4px);left:0;overflow-y:auto;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}._content_1aw0m_40::-webkit-scrollbar{width:4px}._content_1aw0m_40::-webkit-scrollbar-track{background:0 0}._content_1aw0m_40::-webkit-scrollbar-thumb{background-color:var(--border);border-radius:10px}._wrapper_1aw0m_1[data-state=closed] ._content_1aw0m_40{display:none}._groupLabel_1aw0m_74{color:var(--muted-foreground);-webkit-user-select:none;user-select:none;padding:8px 10px;font-size:12px;font-weight:500}._item_1aw0m_81{width:100%;color:var(--foreground);cursor:pointer;-webkit-user-select:none;user-select:none;box-sizing:border-box;background:0 0;border-radius:4px;justify-content:space-between;align-items:center;padding:4px 10px;display:flex}._item_1aw0m_81:hover{background-color:var(--secondary)}._itemLeft_1aw0m_98{font-size:14px;font-weight:400}._itemAddon_1aw0m_102{align-items:center;gap:8px;display:flex}._itemAddon_1aw0m_102 span{color:var(--muted-foreground);font-size:12px}._itemAddon_1aw0m_102 svg{font-size:14px}._itemAddon_1aw0m_102 b{flex-shrink:0;width:16px;height:16px}._itemRightContainer_1aw0m_122{align-items:center;gap:8px;display:flex}._itemRight_1aw0m_122{color:var(--muted-foreground);font-size:14px}._itemCheck_1aw0m_131{width:16px;height:16px;color:var(--foreground);flex-shrink:0}:host{height:100%;display:block}:host *{box-sizing:border-box}._root_c6gk7_8{width:100%;height:100%;font-size:16px;font-family:var(--font-sans);--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, Helvetica, Arial, sans-serif;--font-mono:"Courier New", Courier, monospace;--color-white:#fff;--color-white-fade:color-mix(in srgb, var(--color-white) 40%, transparent);--color-black:#000;--color-red:oklch(63.7% .237 25.331);--color-green:oklch(76.8% .188 151.716);--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(75.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--accent-blue:oklch(60.9% .221 251.687);--accent-blue-light:oklch(96% .02 250);--accent-blue-fade:color-mix(in srgb, var(--accent-blue) 60%, transparent);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 50%, transparent);--overlay-bg-white:color-mix(in srgb, var(--color-white) 80%, transparent);position:relative}._root_c6gk7_8[data-theme=dark]{--background:oklch(24.5% 0 0);--foreground:oklch(78.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(24.5% 0 0);--muted-foreground:oklch(50% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--accent-blue-light:oklch(25% .06 250);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--overlay-bg:color-mix(in srgb, var(--color-black) 75%, transparent)}._root_c6gk7_8 h1,._root_c6gk7_8 h2,._root_c6gk7_8 h3,._root_c6gk7_8 h4,._root_c6gk7_8 h5,._root_c6gk7_8 h6{color:var(--foreground);margin:0;font-weight:600}._textRed_c6gk7_73{color:var(--color-red)}._bgRed_c6gk7_76{background-color:var(--color-red)}._bgGreen_c6gk7_79{background-color:var(--color-green)}._textGreen_c6gk7_82{color:var(--color-green)}._mask_c6gk7_85{background-color:var(--overlay-bg)}._semibold_c6gk7_88{letter-spacing:.4px;font-weight:600}._bold_c6gk7_92{letter-spacing:.4px;font-weight:700}._system_c6gk7_96{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_c6gk7_106{width:100%;height:100%;min-height:480px;position:relative;overflow:hidden}._grid_c6gk7_113{grid-template:"header header"48px"sidebar frame"minmax(0,1fr)"sidebar infobar"32px/48px 1fr;height:100%;display:grid;position:relative}._grid_c6gk7_113._mobile_c6gk7_124{grid-template-columns:0 1fr}._gridNoInfobar_c6gk7_128{grid-template:"header header"48px"sidebar frame"1fr/48px 1fr;height:100%;display:grid;position:relative}._gridNoInfobar_c6gk7_128._mobile_c6gk7_124{grid-template-columns:0 1fr}._input_kyavx_1{width:100%;height:32px;color:var(--foreground);background-color:var(--background);border:1px solid var(--input);box-sizing:border-box;border-radius:4px;outline:none;padding:0 8px;font-family:inherit;font-size:14px;line-height:normal;transition:border-color .2s,box-shadow .2s;display:block}._input_kyavx_1:hover:not(:disabled):not(:focus){border-color:var(--muted-foreground)}._input_kyavx_1:focus{box-shadow:0 0 0 1px var(--ring)}._input_kyavx_1:disabled{cursor:not-allowed;opacity:.5;background-color:var(--secondary)}._input_kyavx_1::placeholder{color:var(--muted-foreground);opacity:1}._numberClean_kyavx_39::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._numberClean_kyavx_39::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._numberClean_kyavx_39[type=number]{-moz-appearance:textfield}._container_14vsv_1{position:relative}._legend_14vsv_4{color:var(--muted-foreground);background:var(--background);margin-left:8px;padding:0 4px;font-size:12px;position:absolute;top:-9px}._suffix_14vsv_13{color:var(--muted-foreground);pointer-events:none;-webkit-user-select:none;user-select:none;font-size:14px;position:absolute;bottom:2px;right:8px}._group_1e7jm_1{margin-left:4px;display:flex}._save_1e7jm_6{width:36px;color:var(--color-green);border-top-right-radius:0;border-bottom-right-radius:0}._close_1e7jm_13{width:36px;color:var(--color-red);border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}._tooltip_gohf2_1{position:relative}._container_gohf2_5{gap:0;display:flex}._container_gohf2_5[data-orientation=vertical]{flex-direction:column}._container_gohf2_5 [data-tooltip]{pointer-events:auto}._popup_gohf2_18{top:var(--tooltip-y,0px);left:var(--tooltip-x,0px);background-color:var(--foreground);color:var(--background);z-index:999;pointer-events:none;opacity:var(--tooltip-opacity,0);width:var(--tooltip-w,auto);height:var(--tooltip-h,auto);transition:opacity var(--tooltip-fade,.2s);border-radius:4px;font-size:14px;position:absolute;transform:translate(-50%,-100%);box-shadow:0 2px 8px #0000001a}._popup_gohf2_18:before{content:"";background-color:inherit;width:10px;height:10px;position:absolute;bottom:-3px;left:50%;transform:translate(-50%)rotate(45deg)}._popup_gohf2_18[data-orientation=vertical]{transform:translateY(-50%)}._popup_gohf2_18[data-orientation=vertical]:before{content:"";background-color:inherit;width:10px;height:10px;position:absolute;top:50%;left:-3px;transform:translateY(-50%)rotate(45deg)}._popup_gohf2_18._animated_gohf2_62{transition:left var(--tooltip-slide,.4s), top var(--tooltip-slide,.4s), width var(--tooltip-slide,.4s), height var(--tooltip-slide,.4s), opacity var(--tooltip-fade,.2s)}._mask_gohf2_71{border-radius:inherit;width:100%;height:100%;overflow:hidden}._track_gohf2_78{width:max-content;height:max-content;transform:translateX(calc(-1 * var(--tooltip-offset,0px)));display:flex}._track_gohf2_78[data-orientation=vertical]{transform:translateY(calc(-1 * var(--tooltip-offset,0px)));flex-direction:column}._animated_gohf2_62 ._track_gohf2_78{transition:transform var(--tooltip-slide,.4s)}._title_gohf2_94{min-width:var(--tooltip-item-w,auto);max-width:var(--tooltip-item-w,none);min-height:var(--tooltip-item-h,32px);max-height:var(--tooltip-item-h,none);white-space:nowrap;box-sizing:border-box;flex:none;justify-content:center;align-items:center;padding:0 10px;display:flex}._header_1yueu_1{box-sizing:border-box;background-color:var(--background);border-bottom:1px solid var(--border);grid-area:header;justify-content:space-between;align-items:center;height:48px;padding:0 8px;display:flex}._left_1yueu_12{align-items:center;gap:0;display:flex}._sidebarToggle_1yueu_17{border-right:solid 1px var(--border);cursor:pointer;justify-content:center;align-items:center;width:48px;height:48px;transition:all .2s;display:none;position:relative;left:-8px}._sidebarToggle_1yueu_17._mobile_1yueu_29{display:flex}._sidebarIcon_1yueu_33{stroke-width:1.6px;width:18px;height:18px}._tools_1yueu_38{gap:8px;display:flex}._history_1yueu_42{align-items:center;gap:6px;display:flex}._historyText_1yueu_47{color:var(--muted-foreground);font-size:14px;font-family:var(--font-mono)}._sidebar_1j9gh_1{background:var(--background);border-right:1px solid var(--border);z-index:10;grid-area:sidebar;width:48px;position:relative}._sidebar_1j9gh_1._mobile_1j9gh_9{transition:transform .2s ease-out;transform:translate(-110%);box-shadow:0 2px 8px #0000001a}._sidebar_1j9gh_1._mobile_1j9gh_9._open_1j9gh_14{transform:translate(0%)}._wrapper_1j9gh_19{flex-direction:column;display:flex}._item_1j9gh_23{cursor:pointer;justify-content:center;align-items:center;height:48px;transition:all .2s;display:flex;position:relative}._item_1j9gh_23 svg{width:16px;height:16px}._item_1j9gh_23:hover{background-color:var(--accent)}._item_1j9gh_23._selected_1j9gh_41{color:var(--accent-blue);background-color:var(--accent)}._item_1j9gh_23._selected_1j9gh_41:before{content:"";background-color:var(--accent-blue);width:2px;position:absolute;top:0;bottom:0;left:0}._infobar_ofe91_1{background:var(--muted);font-family:var(--font-mono);grid-area:infobar;justify-content:space-between;align-items:center;padding:0 16px;font-size:14px;display:flex}._resize_s127g_1{background-color:var(--background);border-radius:4px;align-items:center;gap:6px;padding:15px 8px 8px;display:flex;position:absolute;bottom:24px;left:50%;overflow:hidden;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._toolsLock_s127g_15{width:12px;height:12px;color:var(--muted-foreground)}._indicatorWrapper_s127g_20{justify-content:center;width:100%;height:1px;display:flex;position:absolute;top:0;left:0}._indicator_s127g_20{background:var(--accent-blue);opacity:.6;border-radius:2px;width:30%;height:100%;transition:width .2s}._preview_dvanl_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._rotate_dvanl_12{box-sizing:border-box;width:100%;height:100%;transition:all .2s linear;position:absolute;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}._flip_dvanl_24{box-sizing:border-box;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._image_dvanl_32{max-width:none;max-height:none;transition:all .2s linear;display:block;position:absolute}._wrapper_1yhyo_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._box_1yhyo_9{cursor:move;box-sizing:border-box;-webkit-user-select:none;user-select:none;touch-action:none;border:1px solid var(--color-white-fade);position:absolute}._tools_1yhyo_18{background-color:var(--background);box-sizing:border-box;border:1px solid var(--border);border-radius:4px;align-items:center;gap:6px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}._toolsInfo_1yhyo_35{-webkit-user-select:none;user-select:none;min-width:54px;margin-top:-2px;display:inline-block}._toolsInfoLabel_1yhyo_42{color:var(--muted-foreground);font-size:12px;line-height:12px}._toolsInfoValue_1yhyo_47{color:var(--foreground);font-size:14px;line-height:14px}._linesBox_1yhyo_52{pointer-events:none;position:absolute;inset:1px}._line_1yhyo_52{border:1px dashed var(--color-white);opacity:.5;position:absolute}._lineV_1yhyo_62{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._lineH_1yhyo_70{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._pointer_1yhyo_78{box-sizing:border-box;width:14px;height:14px;position:absolute}._pointerTopLeft_1yhyo_84{border-top:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nwse-resize;top:-6px;left:-6px}._pointerTopRight_1yhyo_91{border-top:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nesw-resize;top:-6px;right:-6px}._pointerBottomRight_1yhyo_98{border-bottom:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nwse-resize;bottom:-6px;right:-6px}._pointerBottomLeft_1yhyo_105{border-bottom:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nesw-resize;bottom:-6px;left:-6px}._mobileBorder_1yhyo_112{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._mobilePointer_1yhyo_118{background-color:var(--overlay-bg-white);border:3px solid var(--accent-blue);box-sizing:border-box;border-radius:50%;width:32px;height:32px;position:absolute;bottom:-16px;right:-16px}._info_1yhyo_129{height:16px;font-family:var(--font-mono);color:#000;background-color:var(--color-white-fade);box-sizing:border-box;align-items:center;padding:0 6px;font-size:12px;display:flex;position:absolute}._info_1yhyo_129 b{font-weight:600;transform:translateY(1px)}._infoX_1yhyo_146{border-left:solid 2px var(--accent-blue);top:-12px;left:16px}._infoY_1yhyo_151{transform-origin:100%;border-right:solid 2px var(--accent-blue);top:8px;right:calc(100% + 4px);transform:rotate(-90deg)}._infoW_1yhyo_158{border-right:solid 2px var(--accent-blue);bottom:-12px;right:16px}._infoH_1yhyo_163{transform-origin:0%;border-left:solid 2px var(--accent-blue);bottom:8px;left:calc(100% + 4px);transform:rotate(-90deg)}._group_1yhyo_170{flex-shrink:0;width:max-content;display:flex}._group_1yhyo_170 button{color:var(--foreground);border-radius:0}._group_1yhyo_170 button._active_1yhyo_179{color:var(--accent-blue);background:var(--muted)}._group_1yhyo_170 button:not(:first-child){margin-left:-1px}._group_1yhyo_170 button:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._group_1yhyo_170 button:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}._preset_1rbuc_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._select_1rbuc_14{width:210px}._flip_17ic5_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_17ic5_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_17ic5_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._rotate_gkt07_1{background-color:var(--background);border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:24px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._btnH_gkt07_14{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_gkt07_20{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_15mog_1{box-sizing:border-box;grid-area:frame;width:100%;height:100%;margin:0 auto;position:relative;overflow:hidden}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
+ import { Children as e, createContext as t, forwardRef as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
3
3
  //#region \0rolldown/runtime.js
4
- var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), l = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
4
+ var d = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), f = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
5
5
  if (typeof require < "u") return require.apply(this, arguments);
6
6
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
7
- }), u = {
7
+ }), p = {
8
+ sm: 480,
9
+ md: 768,
10
+ lg: 1024,
11
+ xl: 1280
12
+ }, m = {
13
+ INITIAL: "initial",
14
+ RESIZE: "resize",
15
+ CROP: "crop",
16
+ PRESET_CROP: "presetCrop",
17
+ FLIP: "flip",
18
+ ROTATE: "rotate",
19
+ FILTERS: "filters"
20
+ }, h = {
21
+ tools: [
22
+ "resize",
23
+ "crop",
24
+ "presetCrop",
25
+ "flip",
26
+ "rotate",
27
+ "filters"
28
+ ],
29
+ infobar: !0,
8
30
  quality: .85,
9
31
  saveAsWEBP: !1,
10
32
  exportAs: "blob"
11
- }, d = (e, t, n, r, i, a, o) => ({
33
+ }, g = (e, t, n, r, i, a, o) => ({
12
34
  history: {
13
35
  pointer: 0,
14
36
  items: [{
15
37
  width: t,
16
38
  height: n,
17
39
  action: {
18
- name: "initial",
40
+ name: m.INITIAL,
19
41
  args: null
20
42
  }
21
43
  }]
@@ -27,7 +49,7 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
27
49
  sidebar: !1,
28
50
  settings: o,
29
51
  isAlpha: a
30
- }), f = e(void 0), p = /* @__PURE__ */ c(((e) => {
52
+ }), _ = t(void 0), v = /* @__PURE__ */ d(((e) => {
31
53
  var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
32
54
  function r(e, n, r) {
33
55
  var i = null;
@@ -42,19 +64,19 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
42
64
  };
43
65
  }
44
66
  e.Fragment = n, e.jsx = r, e.jsxs = r;
45
- })), m = /* @__PURE__ */ c(((e) => {
67
+ })), y = /* @__PURE__ */ d(((e) => {
46
68
  process.env.NODE_ENV !== "production" && (function() {
47
69
  function t(e) {
48
70
  if (e == null) return null;
49
- if (typeof e == "function") return e.$$typeof === ne ? null : e.displayName || e.name || null;
71
+ if (typeof e == "function") return e.$$typeof === k ? null : e.displayName || e.name || null;
50
72
  if (typeof e == "string") return e;
51
73
  switch (e) {
52
74
  case v: return "Fragment";
53
75
  case b: return "Profiler";
54
76
  case y: return "StrictMode";
55
77
  case w: return "Suspense";
56
- case ee: return "SuspenseList";
57
- case te: return "Activity";
78
+ case T: return "SuspenseList";
79
+ case O: return "Activity";
58
80
  }
59
81
  if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
60
82
  case _: return "Portal";
@@ -63,8 +85,8 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
63
85
  case C:
64
86
  var n = e.render;
65
87
  return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
66
- case T: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
67
- case E:
88
+ case E: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
89
+ case D:
68
90
  n = e._payload, e = e._init;
69
91
  try {
70
92
  return t(e(n));
@@ -90,7 +112,7 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
90
112
  }
91
113
  function i(e) {
92
114
  if (e === v) return "<>";
93
- if (typeof e == "object" && e && e.$$typeof === E) return "<...>";
115
+ if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
94
116
  try {
95
117
  var n = t(e);
96
118
  return n ? "<" + n + ">" : "<...>";
@@ -99,14 +121,14 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
99
121
  }
100
122
  }
101
123
  function a() {
102
- var e = D.A;
124
+ var e = A.A;
103
125
  return e === null ? null : e.getOwner();
104
126
  }
105
127
  function o() {
106
128
  return Error("react-stack-top-frame");
107
129
  }
108
130
  function s(e) {
109
- if (O.call(e, "key")) {
131
+ if (ee.call(e, "key")) {
110
132
  var t = Object.getOwnPropertyDescriptor(e, "key").get;
111
133
  if (t && t.isReactWarning) return !1;
112
134
  }
@@ -114,18 +136,18 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
114
136
  }
115
137
  function c(e, t) {
116
138
  function n() {
117
- ie || (ie = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
139
+ M || (M = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
118
140
  }
119
141
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
120
142
  get: n,
121
143
  configurable: !0
122
144
  });
123
145
  }
124
- function u() {
146
+ function l() {
125
147
  var e = t(this.type);
126
- return ae[e] || (ae[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
148
+ return ne[e] || (ne[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
127
149
  }
128
- function d(e, t, n, r, i, a) {
150
+ function u(e, t, n, r, i, a) {
129
151
  var o = n.ref;
130
152
  return e = {
131
153
  $$typeof: g,
@@ -138,7 +160,7 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
138
160
  value: null
139
161
  }) : Object.defineProperty(e, "ref", {
140
162
  enumerable: !1,
141
- get: u
163
+ get: l
142
164
  }), e._store = {}, Object.defineProperty(e._store, "validated", {
143
165
  configurable: !1,
144
166
  enumerable: !1,
@@ -161,56 +183,56 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
161
183
  value: a
162
184
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
163
185
  }
164
- function f(e, n, i, o, l, u) {
186
+ function d(e, n, i, o, l, d) {
165
187
  var f = n.children;
166
- if (f !== void 0) if (o) if (re(f)) {
188
+ if (f !== void 0) if (o) if (te(f)) {
167
189
  for (o = 0; o < f.length; o++) p(f[o]);
168
190
  Object.freeze && Object.freeze(f);
169
191
  } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
170
192
  else p(f);
171
- if (O.call(n, "key")) {
193
+ if (ee.call(n, "key")) {
172
194
  f = t(e);
173
195
  var m = Object.keys(n).filter(function(e) {
174
196
  return e !== "key";
175
197
  });
176
- o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ce[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), ce[f + o] = !0);
198
+ o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", ie[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), ie[f + o] = !0);
177
199
  }
178
200
  if (f = null, i !== void 0 && (r(i), f = "" + i), s(n) && (r(n.key), f = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
179
201
  else i = n;
180
- return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, i, a(), l, u);
202
+ return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, f, i, a(), l, d);
181
203
  }
182
204
  function p(e) {
183
- m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === E && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
205
+ m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
184
206
  }
185
207
  function m(e) {
186
208
  return typeof e == "object" && !!e && e.$$typeof === g;
187
209
  }
188
- var h = l("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), te = Symbol.for("react.activity"), ne = Symbol.for("react.client.reference"), D = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, re = Array.isArray, k = console.createTask ? console.createTask : function() {
210
+ var h = f("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), A = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, te = Array.isArray, j = console.createTask ? console.createTask : function() {
189
211
  return null;
190
212
  };
191
213
  h = { react_stack_bottom_frame: function(e) {
192
214
  return e();
193
215
  } };
194
- var ie, ae = {}, oe = h.react_stack_bottom_frame.bind(h, o)(), se = k(i(o)), ce = {};
216
+ var M, ne = {}, re = h.react_stack_bottom_frame.bind(h, o)(), N = j(i(o)), ie = {};
195
217
  e.Fragment = v, e.jsx = function(e, t, n) {
196
- var r = 1e4 > D.recentlyCreatedOwnerStacks++;
197
- return f(e, t, n, !1, r ? Error("react-stack-top-frame") : oe, r ? k(i(e)) : se);
218
+ var r = 1e4 > A.recentlyCreatedOwnerStacks++;
219
+ return d(e, t, n, !1, r ? Error("react-stack-top-frame") : re, r ? j(i(e)) : N);
198
220
  }, e.jsxs = function(e, t, n) {
199
- var r = 1e4 > D.recentlyCreatedOwnerStacks++;
200
- return f(e, t, n, !0, r ? Error("react-stack-top-frame") : oe, r ? k(i(e)) : se);
221
+ var r = 1e4 > A.recentlyCreatedOwnerStacks++;
222
+ return d(e, t, n, !0, r ? Error("react-stack-top-frame") : re, r ? j(i(e)) : N);
201
223
  };
202
224
  })();
203
- })), h = (/* @__PURE__ */ c(((e, t) => {
204
- process.env.NODE_ENV === "production" ? t.exports = p() : t.exports = m();
205
- })))(), g = ({ children: e, mimeType: t, width: n, height: i, originalBlob: c, previewUrl: l, isAlpha: u, settings: p }) => {
206
- let [m, g] = s(d(t, n, i, c, l, u, p)), _ = o(null);
207
- r(() => () => {
208
- _.current &&= (URL.revokeObjectURL(_.current), null);
225
+ })), b = (/* @__PURE__ */ d(((e, t) => {
226
+ process.env.NODE_ENV === "production" ? t.exports = v() : t.exports = y();
227
+ })))(), x = ({ children: e, mimeType: t, width: n, height: r, originalBlob: i, previewUrl: a, isAlpha: s, settings: d }) => {
228
+ let [f, p] = u(g(t, n, r, i, a, s, d)), h = l(null);
229
+ o(() => () => {
230
+ h.current &&= (URL.revokeObjectURL(h.current), null);
209
231
  }, []);
210
- let v = (e) => g((t) => ({
232
+ let v = (e) => p((t) => ({
211
233
  ...t,
212
234
  currentAction: e
213
- })), y = (e) => g((t) => {
235
+ })), y = (e) => p((t) => {
214
236
  let n = t.history.pointer + 1, r = [...t.history.items.slice(0, n), e];
215
237
  return {
216
238
  ...t,
@@ -220,79 +242,79 @@ var c = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
220
242
  pointer: n
221
243
  }
222
244
  };
223
- }), b = () => {
224
- let { items: e, pointer: t } = m.history;
245
+ }), x = () => {
246
+ let { items: e, pointer: t } = f.history;
225
247
  return e.at(t) ?? e.at(0) ?? {
226
248
  width: 0,
227
249
  height: 0,
228
250
  action: {
229
- name: "initial",
251
+ name: m.INITIAL,
230
252
  args: null
231
253
  }
232
254
  };
233
- }, x = () => {
234
- let { items: e, pointer: t } = m.history;
255
+ }, S = () => {
256
+ let { items: e, pointer: t } = f.history;
235
257
  if (e.length === 0 || t < 0) return 0;
236
- let n = e.slice(0, t + 1).findLast((e) => e.action.name === "rotate");
237
- return n?.action.name === "rotate" ? n.action.args.degrees : 0;
238
- }, S = () => g((e) => ({
258
+ let n = e.slice(0, t + 1).findLast((e) => e.action.name === m.ROTATE);
259
+ return n?.action.name === m.ROTATE ? n.action.args.degrees : 0;
260
+ }, C = () => p((e) => ({
239
261
  ...e,
240
262
  history: {
241
263
  items: [e.history.items[0]],
242
264
  pointer: 0
243
265
  }
244
- })), C = () => g((e) => e.history.pointer <= 0 ? e : {
266
+ })), w = () => p((e) => e.history.pointer <= 0 ? e : {
245
267
  ...e,
246
268
  history: {
247
269
  ...e.history,
248
270
  pointer: e.history.pointer - 1
249
271
  }
250
- }), w = () => g((e) => e.history.pointer >= e.history.items.length - 1 ? e : {
272
+ }), T = () => p((e) => e.history.pointer >= e.history.items.length - 1 ? e : {
251
273
  ...e,
252
274
  history: {
253
275
  ...e.history,
254
276
  pointer: e.history.pointer + 1
255
277
  }
256
- }), ee = (e) => g((t) => ({
278
+ }), E = (e) => p((t) => ({
257
279
  ...t,
258
280
  sidebar: e
259
- })), T = a(() => new EventTarget(), []), E = (e) => {
260
- _.current && URL.revokeObjectURL(_.current), _.current = URL.createObjectURL(e.previewBlob), g(d(e.mimeType, e.width, e.height, e.newBlob, _.current, e.isAlpha, p));
281
+ })), D = c(() => new EventTarget(), []), O = (e) => {
282
+ h.current && URL.revokeObjectURL(h.current), h.current = URL.createObjectURL(e.previewBlob), p(g(e.mimeType, e.width, e.height, e.newBlob, h.current, e.isAlpha, d));
261
283
  };
262
- return /* @__PURE__ */ (0, h.jsx)(f, {
284
+ return /* @__PURE__ */ (0, b.jsx)(_, {
263
285
  value: {
264
- ...m,
265
- setImage: E,
286
+ ...f,
287
+ setImage: O,
266
288
  setCurrentAction: v,
267
- getLastHistoryItem: b,
268
- getLastRotation: x,
289
+ getLastHistoryItem: x,
290
+ getLastRotation: S,
269
291
  addToHistory: y,
270
- resetHistory: S,
271
- undo: C,
272
- redo: w,
273
- setSidebar: ee,
274
- eventBus: T
292
+ resetHistory: C,
293
+ undo: w,
294
+ redo: T,
295
+ setSidebar: E,
296
+ eventBus: D
275
297
  },
276
298
  children: e
277
299
  });
278
- }, _ = "(function(){let e=async e=>{let{width:t,height:n}=e,r=Math.min(1,1920/Math.max(t,n)),i=Math.round(t*r),a=Math.round(n*r),o=new OffscreenCanvas(i,a),s=o.getContext(`2d`);if(!s)throw Error(`Failed to get 2D context for preview canvas`);return s.drawImage(e,0,0,i,a),o.convertToBlob({type:`image/webp`,quality:.85})};function t(e){let t=new OffscreenCanvas(e.width,e.height),n=t.getContext(`2d`);if(!n)throw Error(`Failed to create 2D context for canvas.`);n.drawImage(e,0,0);try{let e=n.getImageData(0,0,t.width,t.height).data;for(let t=3;t<e.length;t+=4)if(e[t]<255)return!0;return!1}catch(e){throw Error(`Error reading pixels: ${e}`,{cause:e})}}self.onmessage=async n=>{let r=``;try{let i;if(n.data instanceof Blob)i=n.data;else{let e=n.data.trim();!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&!e.startsWith(`blob:`)&&!e.startsWith(`data:`)&&(r=`image/png`,e=`data:${r};base64,${e}`);let t=await fetch(e);if(!t.ok)throw Error(`HTTP error! Status: ${t.status}`);i=await t.blob()}let a=i.type||r||`image/unknown`,o=await createImageBitmap(i),{width:s,height:c}=o,l=await e(o),u=t(o);o.close(),self.postMessage({success:!0,originalBlob:i,previewBlob:l,mimeType:a,width:s,height:c,isAlpha:u})}catch(e){self.postMessage({success:!1,error:e instanceof Error?e.message:`An error occurred during image loader worker execution.`})}}})();", v = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", _], { type: "text/javascript;charset=utf-8" });
279
- function y(e) {
300
+ }, S = "(function(){let e=async e=>{let{width:t,height:n}=e,r=Math.min(1,1920/Math.max(t,n)),i=Math.round(t*r),a=Math.round(n*r),o=new OffscreenCanvas(i,a),s=o.getContext(`2d`);if(!s)throw Error(`Failed to get 2D context for preview canvas`);return s.drawImage(e,0,0,i,a),o.convertToBlob({type:`image/webp`,quality:.85})};function t(e){let t=new OffscreenCanvas(e.width,e.height),n=t.getContext(`2d`);if(!n)throw Error(`Failed to create 2D context for canvas.`);n.drawImage(e,0,0);try{let e=n.getImageData(0,0,t.width,t.height).data;for(let t=3;t<e.length;t+=4)if(e[t]<255)return!0;return!1}catch(e){throw Error(`Error reading pixels: ${e}`,{cause:e})}}self.onmessage=async n=>{let r=``;try{let i;if(n.data instanceof Blob)i=n.data;else{let e=n.data.trim();!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&!e.startsWith(`blob:`)&&!e.startsWith(`data:`)&&(r=`image/png`,e=`data:${r};base64,${e}`);let t=await fetch(e);if(!t.ok)throw Error(`HTTP error! Status: ${t.status}`);i=await t.blob()}let a=i.type||r||`image/unknown`,o=await createImageBitmap(i),{width:s,height:c}=o,l=await e(o),u=t(o);o.close(),self.postMessage({success:!0,originalBlob:i,previewBlob:l,mimeType:a,width:s,height:c,isAlpha:u})}catch(e){self.postMessage({success:!1,error:e instanceof Error?e.message:`An error occurred during image loader worker execution.`})}}})();", C = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", S], { type: "text/javascript;charset=utf-8" });
301
+ function w(e) {
280
302
  let t;
281
303
  try {
282
- if (t = v && (self.URL || self.webkitURL).createObjectURL(v), !t) throw "";
304
+ if (t = C && (self.URL || self.webkitURL).createObjectURL(C), !t) throw "";
283
305
  let n = new Worker(t, { name: e?.name });
284
306
  return n.addEventListener("error", () => {
285
307
  (self.URL || self.webkitURL).revokeObjectURL(t);
286
308
  }), n;
287
309
  } catch {
288
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(_), { name: e?.name });
310
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(S), { name: e?.name });
289
311
  }
290
312
  }
291
313
  //#endregion
292
314
  //#region src/shared/components/Pixedi/hooks/useImageLoader.tsx
293
- var b = (e) => {
294
- let [t, n] = s({
295
- loading: !0,
315
+ var T = ({ src: e, skip: t = !1 }) => {
316
+ let [n, r] = u({
317
+ loading: !t,
296
318
  error: "",
297
319
  width: 0,
298
320
  height: 0,
@@ -300,13 +322,13 @@ var b = (e) => {
300
322
  originalBlob: null,
301
323
  previewUrl: "",
302
324
  isAlpha: !1
303
- }), i = o(null);
304
- return r(() => {
305
- if (!e) return;
306
- let t = new y();
307
- return t.postMessage(e), t.onmessage = (e) => {
325
+ }), i = l(null);
326
+ return o(() => {
327
+ if (!e || t) return;
328
+ let n = new w();
329
+ return n.postMessage(e), n.onmessage = (e) => {
308
330
  let t = e.data;
309
- t.success ? (i.current && URL.revokeObjectURL(i.current), i.current = URL.createObjectURL(t.previewBlob), n({
331
+ t.success ? (i.current && URL.revokeObjectURL(i.current), i.current = URL.createObjectURL(t.previewBlob), r({
310
332
  loading: !1,
311
333
  error: "",
312
334
  mimeType: t.mimeType,
@@ -315,50 +337,38 @@ var b = (e) => {
315
337
  originalBlob: t.originalBlob,
316
338
  previewUrl: i.current,
317
339
  isAlpha: t.isAlpha
318
- })) : n((e) => ({
340
+ })) : r((e) => ({
319
341
  ...e,
320
342
  loading: !1,
321
343
  error: t.error || "Error processing image."
322
344
  }));
323
345
  }, () => {
324
- t.terminate(), i.current &&= (URL.revokeObjectURL(i.current), null);
346
+ n.terminate(), i.current &&= (URL.revokeObjectURL(i.current), null);
325
347
  };
326
- }, [e]), t;
327
- }, x = () => {
348
+ }, [t, e]), n;
349
+ }, E = () => {
328
350
  if (typeof window > "u" || !window.navigator) return null;
329
351
  let e = window.navigator.userAgent.toLowerCase();
330
352
  return /android/.test(e) ? "android" : /iphone|ipad|ipod/.test(e) ? "ios" : /windows phone/.test(e) ? "windows-phone" : /blackberry|bb10/.test(e) ? "blackberry" : /opera mini/.test(e) ? "opera-mini" : /mobile/.test(e) ? "mobile" : null;
331
- }, S = () => {
332
- let [e] = s(() => x());
353
+ }, D = () => {
354
+ let [e] = u(() => E());
333
355
  return e;
334
- }, C = {
335
- sm: 640,
336
- md: 768,
337
- lg: 1024,
338
- xl: 1280
339
- }, w = {
340
- INITIAL: "initial",
341
- RESIZE: "resize",
342
- CROP: "crop",
343
- PRESET_CROP: "presetCrop",
344
- FLIP: "flip",
345
- ROTATE: "rotate",
346
- FILTERS: "filters"
347
356
  };
348
357
  //#endregion
349
358
  //#region src/shared/components/Pixedi/hooks/useBellow.tsx
350
- function ee(e) {
351
- let [t, n] = s(() => window.innerWidth < C[e]);
352
- return r(() => {
353
- function t() {
354
- n(window.innerWidth < C[e]);
355
- }
356
- return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
357
- }, [e]), t;
359
+ function O(e, t) {
360
+ let [n, r] = u(!0);
361
+ return o(() => {
362
+ if (!t) return;
363
+ let n = new ResizeObserver(([t]) => {
364
+ t && r(t.contentRect.width < p[e]);
365
+ });
366
+ return n.observe(t), () => n.disconnect();
367
+ }, [e, t]), n;
358
368
  }
359
369
  //#endregion
360
370
  //#region src/shared/components/Pixedi/assets/icons.tsx
361
- var T = {
371
+ var k = {
362
372
  xmlns: "http://w3.org",
363
373
  width: "24",
364
374
  height: "24",
@@ -368,58 +378,50 @@ var T = {
368
378
  strokeWidth: "2",
369
379
  strokeLinecap: "round",
370
380
  strokeLinejoin: "round"
371
- }, E = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
372
- ...T,
381
+ }, A = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
382
+ ...k,
373
383
  ...e,
374
- children: /* @__PURE__ */ (0, h.jsx)("path", { d: "M20 6 9 17l-5-5" })
375
- }), te = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
376
- ...T,
384
+ children: /* @__PURE__ */ (0, b.jsx)("path", { d: "M20 6 9 17l-5-5" })
385
+ }), ee = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
386
+ ...k,
377
387
  ...e,
378
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "m6 6 12 12" })]
379
- }), ne = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
380
- ...T,
388
+ children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "m6 6 12 12" })]
389
+ }), te = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
390
+ ...k,
381
391
  ...e,
382
- children: [/* @__PURE__ */ (0, h.jsx)("rect", {
392
+ children: [/* @__PURE__ */ (0, b.jsx)("rect", {
383
393
  width: "18",
384
394
  height: "11",
385
395
  x: "3",
386
396
  y: "11",
387
397
  rx: "2",
388
398
  ry: "2"
389
- }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
390
- }), D = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
391
- ...T,
392
- ...e,
393
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M19 12H5" })]
394
- }), O = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
395
- ...T,
399
+ }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
400
+ }), j = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
401
+ ...k,
396
402
  ...e,
397
- children: /* @__PURE__ */ (0, h.jsx)("path", { d: "m6 9 6 6 6-6" })
398
- }), re = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
399
- ...T,
403
+ children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M19 12H5" })]
404
+ }), M = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
405
+ ...k,
400
406
  ...e,
401
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
402
- }), k = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
403
- ...T,
407
+ children: /* @__PURE__ */ (0, b.jsx)("path", { d: "m6 9 6 6 6-6" })
408
+ }), ne = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
409
+ ...k,
404
410
  ...e,
405
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
406
- }), ie = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
407
- ...T,
411
+ children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
412
+ }), re = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
413
+ ...k,
408
414
  ...e,
409
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }), /* @__PURE__ */ (0, h.jsx)("circle", {
410
- cx: "12",
411
- cy: "12",
412
- r: "3"
413
- })]
414
- }), ae = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
415
- ...T,
415
+ children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
416
+ }), N = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
417
+ ...k,
416
418
  ...e,
417
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
418
- }), oe = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
419
- ...T,
419
+ children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
420
+ }), ie = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
421
+ ...k,
420
422
  ...e,
421
423
  children: [
422
- /* @__PURE__ */ (0, h.jsx)("rect", {
424
+ /* @__PURE__ */ (0, b.jsx)("rect", {
423
425
  width: "18",
424
426
  height: "18",
425
427
  x: "3",
@@ -427,32 +429,52 @@ var T = {
427
429
  rx: "2",
428
430
  ry: "2"
429
431
  }),
430
- /* @__PURE__ */ (0, h.jsx)("circle", {
432
+ /* @__PURE__ */ (0, b.jsx)("circle", {
431
433
  cx: "9",
432
434
  cy: "9",
433
435
  r: "2"
434
436
  }),
435
- /* @__PURE__ */ (0, h.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
437
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
436
438
  ]
437
- }), se = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
438
- ...T,
439
+ }), ae = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
440
+ ...k,
439
441
  ...e,
440
- children: /* @__PURE__ */ (0, h.jsx)("rect", {
442
+ children: /* @__PURE__ */ (0, b.jsx)("rect", {
441
443
  width: "18",
442
444
  height: "18",
443
445
  x: "3",
444
446
  y: "3",
445
447
  rx: "2"
446
448
  })
447
- }), ce = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
448
- ...T,
449
+ }), oe = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
450
+ ...k,
451
+ ...e,
452
+ children: /* @__PURE__ */ (0, b.jsx)("rect", {
453
+ width: "20",
454
+ height: "12",
455
+ x: "2",
456
+ y: "6",
457
+ rx: "2"
458
+ })
459
+ }), se = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
460
+ ...k,
461
+ ...e,
462
+ children: /* @__PURE__ */ (0, b.jsx)("rect", {
463
+ width: "20",
464
+ height: "15",
465
+ x: "2",
466
+ y: "4.5",
467
+ rx: "2"
468
+ })
469
+ }), ce = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
470
+ ...k,
449
471
  ...e,
450
472
  children: [
451
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
452
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
453
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
454
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
455
- /* @__PURE__ */ (0, h.jsx)("rect", {
473
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
474
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
475
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
476
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }),
477
+ /* @__PURE__ */ (0, b.jsx)("rect", {
456
478
  width: "10",
457
479
  height: "8",
458
480
  x: "7",
@@ -460,42 +482,93 @@ var T = {
460
482
  rx: "1"
461
483
  })
462
484
  ]
463
- }), le = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
464
- ...T,
485
+ }), le = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
486
+ ...k,
465
487
  ...e,
466
488
  children: [
467
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
468
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" }),
469
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 20v2" }),
470
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 14v2" }),
471
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 8v2" }),
472
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M12 2v2" })
489
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
490
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3" }),
491
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M12 20v2" }),
492
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M12 14v2" }),
493
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M12 8v2" }),
494
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M12 2v2" })
473
495
  ]
474
- }), ue = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
475
- ...T,
496
+ }), ue = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
497
+ ...k,
476
498
  ...e,
477
499
  children: [
478
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
479
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" }),
480
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M4 12H2" }),
481
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M10 12H8" }),
482
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M16 12h-2" }),
483
- /* @__PURE__ */ (0, h.jsx)("path", { d: "M22 12h-2" })
500
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
501
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3" }),
502
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M4 12H2" }),
503
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M10 12H8" }),
504
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M16 12h-2" }),
505
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M22 12h-2" })
506
+ ]
507
+ }), de = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
508
+ ...k,
509
+ ...e,
510
+ children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M21 3v5h-5" })]
511
+ }), fe = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
512
+ ...k,
513
+ ...e,
514
+ children: [/* @__PURE__ */ (0, b.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ (0, b.jsx)("path", { d: "M3 3v5h5" })]
515
+ }), pe = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
516
+ ...k,
517
+ ...e,
518
+ children: [
519
+ /* @__PURE__ */ (0, b.jsx)("rect", {
520
+ width: "7",
521
+ height: "7",
522
+ x: "3",
523
+ y: "3",
524
+ rx: "1"
525
+ }),
526
+ /* @__PURE__ */ (0, b.jsx)("rect", {
527
+ width: "7",
528
+ height: "7",
529
+ x: "3",
530
+ y: "14",
531
+ rx: "1"
532
+ }),
533
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M14 4h7" }),
534
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M14 9h7" }),
535
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M14 15h7" }),
536
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M14 20h7" })
484
537
  ]
485
- }), de = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
486
- ...T,
538
+ }), me = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
539
+ ...k,
487
540
  ...e,
488
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M21 3v5h-5" })]
489
- }), fe = (e) => /* @__PURE__ */ (0, h.jsxs)("svg", {
490
- ...T,
541
+ children: [
542
+ /* @__PURE__ */ (0, b.jsx)("rect", {
543
+ width: "18",
544
+ height: "18",
545
+ x: "3",
546
+ y: "3",
547
+ rx: "2"
548
+ }),
549
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M9 3v18" }),
550
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "m14 9 3 3-3 3" })
551
+ ]
552
+ }), he = (e) => /* @__PURE__ */ (0, b.jsxs)("svg", {
553
+ ...k,
491
554
  ...e,
492
- children: [/* @__PURE__ */ (0, h.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ (0, h.jsx)("path", { d: "M3 3v5h5" })]
493
- }), pe = (e) => /* @__PURE__ */ (0, h.jsx)("svg", {
494
- ...T,
555
+ children: [
556
+ /* @__PURE__ */ (0, b.jsx)("rect", {
557
+ width: "18",
558
+ height: "18",
559
+ x: "3",
560
+ y: "3",
561
+ rx: "2"
562
+ }),
563
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "M9 3v18" }),
564
+ /* @__PURE__ */ (0, b.jsx)("path", { d: "m16 15-3-3 3-3" })
565
+ ]
566
+ }), ge = (e) => /* @__PURE__ */ (0, b.jsx)("svg", {
567
+ ...k,
495
568
  ...e,
496
- children: /* @__PURE__ */ (0, h.jsx)("path", {
569
+ children: /* @__PURE__ */ (0, b.jsx)("path", {
497
570
  d: "M21 12a9 9 0 1 1-6.219-8.56",
498
- children: /* @__PURE__ */ (0, h.jsx)("animateTransform", {
571
+ children: /* @__PURE__ */ (0, b.jsx)("animateTransform", {
499
572
  attributeType: "xml",
500
573
  attributeName: "transform",
501
574
  type: "rotate",
@@ -505,218 +578,300 @@ var T = {
505
578
  repeatCount: "indefinite"
506
579
  })
507
580
  })
508
- }), A = () => {
509
- let e = n(f);
581
+ }), P = () => {
582
+ let e = a(_);
510
583
  if (!e) throw Error("usePixediContext must be used within an PixediProvider");
511
584
  return e;
512
- }, j = {
513
- button: "_button_snd36_1",
514
- default: "_default_snd36_32",
515
- outline: "_outline_snd36_39",
516
- ghost: "_ghost_snd36_47",
517
- rect: "_rect_snd36_54"
518
- }, M = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, h.jsx)("button", {
585
+ }, F = {
586
+ button: "_button_1vpzl_1",
587
+ default: "_default_1vpzl_35",
588
+ outline: "_outline_1vpzl_44",
589
+ ghost: "_ghost_1vpzl_54",
590
+ rect: "_rect_1vpzl_63"
591
+ }, I = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, b.jsx)("button", {
519
592
  ref: r,
520
- className: `${j.button} ${j[t]} ${e}`.trim(),
593
+ className: `${F.button} ${F[t]} ${e}`.trim(),
521
594
  ...i,
522
595
  children: n
523
- }), N = {
524
- root: "_root_kw2xl_8",
525
- textRed: "_textRed_kw2xl_73",
526
- bgRed: "_bgRed_kw2xl_76",
527
- bgGreen: "_bgGreen_kw2xl_79",
528
- textGreen: "_textGreen_kw2xl_82",
529
- mask: "_mask_kw2xl_85",
530
- semibold: "_semibold_kw2xl_88",
531
- bold: "_bold_kw2xl_92",
532
- system: "_system_kw2xl_96",
533
- wrapper: "_wrapper_kw2xl_105",
534
- main: "_main_kw2xl_111",
535
- grid: "_grid_kw2xl_119"
536
- }, me = { button: "_button_gf7m5_1" }, P = ({ className: e = "", active: t = !1, icon: n, label: r, ref: i, ...a }) => /* @__PURE__ */ (0, h.jsxs)("button", {
537
- ref: i,
538
- type: "button",
539
- "aria-pressed": t,
540
- className: `${me.button} ${e}`.trim(),
541
- ...a,
542
- children: [n, /* @__PURE__ */ (0, h.jsx)("span", {
543
- className: N.semibold,
544
- children: r
545
- })]
546
- }), he = { separator: "_separator_rqskq_1" }, F = t(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, h.jsx)("hr", {
596
+ }), _e = { separator: "_separator_gp8ff_1" }, ve = n(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, b.jsx)("hr", {
547
597
  ref: r,
548
598
  role: "separator",
549
599
  "aria-orientation": t,
550
600
  "data-orientation": t,
551
- className: `${he.separator} ${e}`.trim(),
601
+ className: `${_e.separator} ${e}`.trim(),
552
602
  ...n
553
603
  }));
554
- F.displayName = "Separator";
555
- var I = {
556
- wrapper: "_wrapper_12rgt_1",
557
- trigger: "_trigger_12rgt_6",
558
- triggerArrow: "_triggerArrow_12rgt_29",
559
- content: "_content_12rgt_38",
560
- groupLabel: "_groupLabel_12rgt_68",
561
- item: "_item_12rgt_75",
562
- itemLeft: "_itemLeft_12rgt_91",
563
- itemAddon: "_itemAddon_12rgt_95",
564
- itemRightContainer: "_itemRightContainer_12rgt_112",
565
- itemRight: "_itemRight_12rgt_112",
566
- itemCheck: "_itemCheck_12rgt_121"
567
- }, ge = ({ items: e, value: t, onChange: n, placeholder: c = "Select an option", className: l = "", renderOption: u }) => {
568
- let [d, f] = s(!1), p = o(null), m = o(null), g = o(null), _ = a(() => {
604
+ ve.displayName = "Separator";
605
+ var L = {
606
+ wrapper: "_wrapper_1aw0m_1",
607
+ trigger: "_trigger_1aw0m_6",
608
+ triggerArrow: "_triggerArrow_1aw0m_31",
609
+ content: "_content_1aw0m_40",
610
+ groupLabel: "_groupLabel_1aw0m_74",
611
+ item: "_item_1aw0m_81",
612
+ itemLeft: "_itemLeft_1aw0m_98",
613
+ itemAddon: "_itemAddon_1aw0m_102",
614
+ itemRightContainer: "_itemRightContainer_1aw0m_122",
615
+ itemRight: "_itemRight_1aw0m_122",
616
+ itemCheck: "_itemCheck_1aw0m_131"
617
+ }, R = {
618
+ root: "_root_c6gk7_8",
619
+ textRed: "_textRed_c6gk7_73",
620
+ bgRed: "_bgRed_c6gk7_76",
621
+ bgGreen: "_bgGreen_c6gk7_79",
622
+ textGreen: "_textGreen_c6gk7_82",
623
+ mask: "_mask_c6gk7_85",
624
+ semibold: "_semibold_c6gk7_88",
625
+ bold: "_bold_c6gk7_92",
626
+ system: "_system_c6gk7_96",
627
+ wrapper: "_wrapper_c6gk7_106",
628
+ grid: "_grid_c6gk7_113",
629
+ mobile: "_mobile_c6gk7_124",
630
+ gridNoInfobar: "_gridNoInfobar_c6gk7_128"
631
+ }, ye = (e) => {
632
+ let t = 0, n = window.innerHeight;
633
+ for (let r = e.parentElement; r; r = r.parentElement) {
634
+ let { overflow: e, overflowY: i } = getComputedStyle(r);
635
+ if (e === "visible" && i === "visible") continue;
636
+ let a = r.getBoundingClientRect();
637
+ t = Math.max(t, a.top), n = Math.min(n, a.bottom);
638
+ }
639
+ return {
640
+ top: t,
641
+ bottom: n
642
+ };
643
+ }, be = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option", className: i = "", renderOption: a }) => {
644
+ let [d, f] = u(!1), p = l(null), m = l(null), h = l(null), g = c(() => {
569
645
  let t = (e) => e.reduce((e, n) => n.options ? [...e, ...t(n.options.map((e) => ({
570
646
  ...e,
571
647
  fullName: `${n.label} ${e.label}`
572
648
  })))] : [...e, n], []);
573
649
  return t(e);
574
650
  }, [e]).find((e) => e.value === t);
575
- r(() => {
651
+ o(() => {
576
652
  let e = (e) => {
577
653
  p.current && !e.composedPath().includes(p.current) && f(!1);
578
654
  };
579
655
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
580
- }, []), i(() => {
581
- if (!d || !m.current || !g.current) return;
582
- let e = p.current?.closest(`.${N.main}`)?.getBoundingClientRect(), t = m.current.getBoundingClientRect(), n = g.current.getBoundingClientRect(), r = (e?.bottom ?? window.innerHeight) - 16, i = t.bottom + n.height + 4, a = "calc(100% + 4px)";
583
- i > r && (a = `calc(100% + 4px - ${i - r}px)`), g.current.style.top = a;
656
+ }, []), s(() => {
657
+ let e = p.current, t = m.current, n = h.current;
658
+ if (!d || !e || !t || !n) return;
659
+ n.style.removeProperty("top"), n.style.removeProperty("max-height");
660
+ let { top: r, bottom: i } = ye(e), a = e.getBoundingClientRect().top, o = t.getBoundingClientRect(), s = n.offsetHeight, c = i - 8 - o.bottom - 4, l = o.top - 4 - r - 8, u = o.bottom + 4, f = 0;
661
+ s > c && (s <= l ? u = o.top - 4 - s : l > c ? (f = Math.max(l, 0), u = o.top - 4 - f) : f = Math.max(c, 0)), f && (n.style.maxHeight = `${f}px`), n.style.top = `${u - a}px`;
584
662
  }, [d, e]);
585
- let v = (e) => {
663
+ let _ = (e) => {
586
664
  n(e), f(!1);
587
665
  };
588
- return /* @__PURE__ */ (0, h.jsxs)("div", {
666
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
589
667
  ref: p,
590
- className: `${I.wrapper} ${l}`.trim(),
668
+ className: `${L.wrapper} ${i}`.trim(),
591
669
  "data-state": d ? "open" : "closed",
592
- children: [/* @__PURE__ */ (0, h.jsxs)("button", {
670
+ children: [/* @__PURE__ */ (0, b.jsxs)("button", {
593
671
  ref: m,
594
672
  type: "button",
595
- className: I.trigger,
673
+ className: L.trigger,
596
674
  onClick: () => f(!d),
597
- children: [/* @__PURE__ */ (0, h.jsx)("span", { children: _ ? _.fullName : c }), /* @__PURE__ */ (0, h.jsx)(O, { className: I.triggerArrow })]
598
- }), /* @__PURE__ */ (0, h.jsx)("div", {
599
- ref: g,
600
- className: I.content,
601
- children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, h.jsxs)("div", { children: [/* @__PURE__ */ (0, h.jsx)("div", {
602
- className: `${I.groupLabel} ${N.semibold}`,
675
+ children: [/* @__PURE__ */ (0, b.jsx)("span", { children: g ? g.fullName : r }), /* @__PURE__ */ (0, b.jsx)(M, { className: L.triggerArrow })]
676
+ }), /* @__PURE__ */ (0, b.jsx)("div", {
677
+ ref: h,
678
+ className: L.content,
679
+ children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, b.jsxs)("div", { children: [/* @__PURE__ */ (0, b.jsx)("div", {
680
+ className: `${L.groupLabel} ${R.semibold}`,
603
681
  children: e.label
604
- }), e.options.map((e) => /* @__PURE__ */ (0, h.jsxs)("div", {
605
- className: I.item,
606
- onClick: () => v(e.value),
607
- children: [u ? u(e) : /* @__PURE__ */ (0, h.jsx)("span", {
608
- className: I.itemLeft,
682
+ }), e.options.map((e) => /* @__PURE__ */ (0, b.jsxs)("div", {
683
+ className: L.item,
684
+ onClick: () => _(e.value),
685
+ children: [a ? a(e) : /* @__PURE__ */ (0, b.jsx)("span", {
686
+ className: L.itemLeft,
609
687
  children: e.label
610
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
611
- className: I.itemAddon,
688
+ }), /* @__PURE__ */ (0, b.jsxs)("div", {
689
+ className: L.itemAddon,
612
690
  children: [
613
- e.rightLabel && /* @__PURE__ */ (0, h.jsx)("span", { children: e.rightLabel }),
614
- t === e.value && /* @__PURE__ */ (0, h.jsx)(E, { className: I.itemCheck }),
615
- t !== e.value && /* @__PURE__ */ (0, h.jsx)("b", {})
691
+ e.rightLabel && /* @__PURE__ */ (0, b.jsx)("span", { children: e.rightLabel }),
692
+ t === e.value && /* @__PURE__ */ (0, b.jsx)(A, { className: L.itemCheck }),
693
+ t !== e.value && /* @__PURE__ */ (0, b.jsx)("b", {})
616
694
  ]
617
695
  })]
618
- }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, h.jsxs)("div", {
619
- className: I.item,
620
- onClick: () => v(e.value),
621
- children: [u ? u(e) : /* @__PURE__ */ (0, h.jsx)("span", {
622
- className: I.itemLeft,
696
+ }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, b.jsxs)("div", {
697
+ className: L.item,
698
+ onClick: () => _(e.value),
699
+ children: [a ? a(e) : /* @__PURE__ */ (0, b.jsx)("span", {
700
+ className: L.itemLeft,
623
701
  children: e.label
624
- }), t === e.value && /* @__PURE__ */ (0, h.jsx)(E, { className: I.itemCheck })]
702
+ }), t === e.value && /* @__PURE__ */ (0, b.jsx)(A, { className: L.itemCheck })]
625
703
  }, e.value))
626
704
  })]
627
705
  });
628
- }, _e = {
629
- input: "_input_j55nq_1",
630
- numberClean: "_numberClean_j55nq_34"
631
- }, ve = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
632
- let a = t === "number" && n ? _e.numberClean : "";
633
- return /* @__PURE__ */ (0, h.jsx)("input", {
706
+ }, xe = {
707
+ input: "_input_kyavx_1",
708
+ numberClean: "_numberClean_kyavx_39"
709
+ }, Se = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
710
+ let a = t === "number" && n ? xe.numberClean : "";
711
+ return /* @__PURE__ */ (0, b.jsx)("input", {
634
712
  ref: r,
635
713
  type: t,
636
- className: `${_e.input} ${a} ${e}`.trim(),
714
+ className: `${xe.input} ${a} ${e}`.trim(),
637
715
  ...i
638
716
  });
639
- }, ye = {
717
+ }, Ce = {
640
718
  container: "_container_14vsv_1",
641
719
  legend: "_legend_14vsv_4",
642
720
  suffix: "_suffix_14vsv_13"
643
- }, be = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, h.jsxs)("div", {
644
- className: `${ye.container} ${t}`.trim(),
721
+ }, we = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, b.jsxs)("div", {
722
+ className: `${Ce.container} ${t}`.trim(),
645
723
  style: n,
646
724
  children: [
647
- /* @__PURE__ */ (0, h.jsx)("span", {
648
- className: ye.legend,
725
+ /* @__PURE__ */ (0, b.jsx)("span", {
726
+ className: Ce.legend,
649
727
  children: e
650
728
  }),
651
- /* @__PURE__ */ (0, h.jsx)(ve, {
729
+ /* @__PURE__ */ (0, b.jsx)(Se, {
652
730
  ref: r,
653
731
  type: "number",
654
732
  ...i
655
733
  }),
656
- /* @__PURE__ */ (0, h.jsx)("span", {
657
- className: ye.suffix,
734
+ /* @__PURE__ */ (0, b.jsx)("span", {
735
+ className: Ce.suffix,
658
736
  children: "px"
659
737
  })
660
738
  ]
661
- }), xe = {
662
- group: "_group_qpue1_1",
663
- save: "_save_qpue1_6",
664
- close: "_close_qpue1_13"
665
- }, L = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, h.jsxs)("div", {
666
- className: xe.group,
667
- children: [/* @__PURE__ */ (0, h.jsx)(M, {
739
+ }), Te = {
740
+ group: "_group_1e7jm_1",
741
+ save: "_save_1e7jm_6",
742
+ close: "_close_1e7jm_13"
743
+ }, z = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, b.jsxs)("div", {
744
+ className: Te.group,
745
+ children: [/* @__PURE__ */ (0, b.jsx)(I, {
668
746
  variant: "outline",
669
- className: xe.save,
747
+ className: Te.save,
748
+ "aria-label": "Save",
670
749
  disabled: r || n,
671
750
  onClick: e,
672
- children: n ? /* @__PURE__ */ (0, h.jsx)(pe, {}) : /* @__PURE__ */ (0, h.jsx)(E, {})
673
- }), /* @__PURE__ */ (0, h.jsx)(M, {
751
+ children: n ? /* @__PURE__ */ (0, b.jsx)(ge, {}) : /* @__PURE__ */ (0, b.jsx)(A, {})
752
+ }), /* @__PURE__ */ (0, b.jsx)(I, {
674
753
  variant: "outline",
675
- className: xe.close,
754
+ className: Te.close,
755
+ "aria-label": "Close",
676
756
  disabled: n,
677
757
  onClick: t,
678
- children: /* @__PURE__ */ (0, h.jsx)(te, {})
758
+ children: /* @__PURE__ */ (0, b.jsx)(ee, {})
679
759
  })]
680
- }), R = {
681
- sliderContainer: "_sliderContainer_1ntcm_1",
682
- disabled: "_disabled_1ntcm_12",
683
- sliderTrack: "_sliderTrack_1ntcm_18",
684
- sliderRange: "_sliderRange_1ntcm_30",
685
- sliderThumb: "_sliderThumb_1ntcm_38",
686
- hiddenInput: "_hiddenInput_1ntcm_53"
687
- }, Se = ({ min: e, max: t, value: n, step: r = 1, disabled: i = !1, onChange: o, className: s, ...c }) => {
688
- let l = a(() => {
689
- let r = t - e;
690
- return r <= 0 ? 0 : (n - e) / r * 100;
691
- }, [
692
- n,
693
- e,
694
- t
695
- ]);
696
- return /* @__PURE__ */ (0, h.jsxs)("div", {
697
- className: `${R.sliderContainer} ${i ? R.disabled : ""} ${s || ""}`,
698
- style: { "--slider-progress": `${l}%` },
699
- children: [/* @__PURE__ */ (0, h.jsxs)("div", {
700
- className: R.sliderTrack,
701
- children: [/* @__PURE__ */ (0, h.jsx)("div", { className: R.sliderRange }), /* @__PURE__ */ (0, h.jsx)("div", {
702
- className: R.sliderThumb,
703
- style: { left: `${l}%` }
704
- })]
705
- }), /* @__PURE__ */ (0, h.jsx)("input", {
706
- type: "range",
707
- min: e,
708
- max: t,
709
- step: r,
710
- value: n,
711
- disabled: i,
712
- onChange: (e) => {
713
- i || o(Number(e.target.value));
714
- },
715
- className: R.hiddenInput,
716
- ...c
760
+ }), B = {
761
+ tooltip: "_tooltip_gohf2_1",
762
+ container: "_container_gohf2_5",
763
+ popup: "_popup_gohf2_18",
764
+ animated: "_animated_gohf2_62",
765
+ mask: "_mask_gohf2_71",
766
+ track: "_track_gohf2_78",
767
+ title: "_title_gohf2_94"
768
+ }, Ee = (t, n = "horizontal") => {
769
+ let [i, a] = u(null), [d, f] = u(null), [p, m] = u(!1), [h, g] = u(!1), [_, v] = u([]), y = l(null), b = l(null), x = l([]), S = n === "vertical", C = c(() => {
770
+ let n = [];
771
+ return e.forEach(t, (e) => {
772
+ if (r(e)) {
773
+ let { "data-tooltip": t } = e.props;
774
+ t && n.push(t);
775
+ }
776
+ }), n;
777
+ }, [t]), w = C.join("\0"), T = C.length;
778
+ s(() => {
779
+ let e = () => {
780
+ let e = x.current.slice(0, T).map((e) => ({
781
+ w: e?.offsetWidth ?? 0,
782
+ h: e?.offsetHeight ?? 0
783
+ }));
784
+ v((t) => t.length === e.length && t.every((t, n) => t.w === e[n].w && t.h === e[n].h) ? t : e);
785
+ };
786
+ e();
787
+ let t = b.current;
788
+ if (!t || typeof ResizeObserver > "u") return;
789
+ let n = new ResizeObserver(e);
790
+ return n.observe(t), () => n.disconnect();
791
+ }, [w, T]), o(() => {
792
+ if (!p || h) return;
793
+ let e = 0, t = requestAnimationFrame(() => {
794
+ e = requestAnimationFrame(() => g(!0));
795
+ });
796
+ return () => {
797
+ cancelAnimationFrame(t), cancelAnimationFrame(e);
798
+ };
799
+ }, [p, h]);
800
+ let E = (e) => {
801
+ let t = e.target.closest("[data-tooltip]");
802
+ if (!t) {
803
+ m(!1);
804
+ return;
805
+ }
806
+ let n = t.parentElement;
807
+ if (!n) return;
808
+ let r = Array.from(n.children).indexOf(t);
809
+ if (r === -1 || p && r === i) return;
810
+ let o = y.current?.getBoundingClientRect();
811
+ if (!o) return;
812
+ let s = t.getBoundingClientRect(), c = S ? {
813
+ x: s.right - o.left + 4,
814
+ y: s.top - o.top + s.height / 2
815
+ } : {
816
+ x: s.left - o.left + s.width / 2,
817
+ y: s.top - o.top - 8
818
+ };
819
+ p || g(!1), f(c), a(r), m(!0);
820
+ }, D = () => m(!1), O = i ?? 0, k = _[O], A = _.slice(0, O).reduce((e, t) => e + (S ? t.h : t.w), 0);
821
+ return {
822
+ containerRef: y,
823
+ trackRef: b,
824
+ titleRefs: x,
825
+ titles: C,
826
+ isVertical: S,
827
+ isVisible: p,
828
+ isAnimated: h,
829
+ cssVars: {
830
+ "--tooltip-x": d ? `${d.x}px` : "0px",
831
+ "--tooltip-y": d ? `${d.y}px` : "0px",
832
+ "--tooltip-opacity": p ? "1" : "0",
833
+ "--tooltip-w": k?.w ? `${k.w}px` : "auto",
834
+ "--tooltip-h": k?.h ? `${k.h}px` : "auto",
835
+ "--tooltip-offset": `${A}px`
836
+ },
837
+ handleMouseMove: E,
838
+ handleMouseLeave: D
839
+ };
840
+ }, V = ({ children: e, orientation: t = "horizontal", className: n = "", classNameTitle: r = "" }) => {
841
+ let { containerRef: i, trackRef: a, titleRefs: o, titles: s, isVertical: c, isAnimated: l, cssVars: u, handleMouseMove: d, handleMouseLeave: f } = Ee(e, t);
842
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
843
+ ref: i,
844
+ onMouseMove: d,
845
+ onMouseLeave: f,
846
+ onBlur: f,
847
+ className: B.tooltip,
848
+ style: u,
849
+ children: [/* @__PURE__ */ (0, b.jsx)("div", {
850
+ "data-orientation": c ? "vertical" : "horizontal",
851
+ className: B.container,
852
+ children: e
853
+ }), /* @__PURE__ */ (0, b.jsx)("div", {
854
+ "aria-hidden": "true",
855
+ "data-orientation": c ? "vertical" : "horizontal",
856
+ className: `${B.popup} ${l ? B.animated : ""} ${n}`,
857
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
858
+ className: B.mask,
859
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
860
+ ref: a,
861
+ "data-orientation": c ? "vertical" : "horizontal",
862
+ className: B.track,
863
+ children: s.map((e, t) => /* @__PURE__ */ (0, b.jsx)("div", {
864
+ ref: (e) => {
865
+ o.current[t] = e;
866
+ },
867
+ className: `${B.title} ${r}`,
868
+ children: e
869
+ }, t))
870
+ })
871
+ })
717
872
  })]
718
873
  });
719
- }, Ce = 1920, we = .85, Te = [
874
+ }, De = 1920, Oe = .85, ke = [
720
875
  {
721
876
  label: "Facebook",
722
877
  value: "facebook",
@@ -819,13 +974,13 @@ var I = {
819
974
  }
820
975
  ]
821
976
  }
822
- ], z = 32, Ee = (e, t, n, r, i, a, o, s, c, l) => {
977
+ ], H = 32, Ae = (e, t, n, r, i, a, o, s, c, l) => {
823
978
  let { x: u, y: d, w: f, h: p } = c;
824
979
  if (e) {
825
980
  let e = o - c.w - c.x;
826
- u += i - n, u < 0 && (u = 0), f = o - u - e, f < z && (f = z, u = o - e - z);
981
+ u += i - n, u < 0 && (u = 0), f = o - u - e, f < H && (f = H, u = o - e - H);
827
982
  let t = s - p - d;
828
- d += a - r, d < 0 && (d = 0), p = s - d - t, p < z && (p = z, d = s - t - z);
983
+ d += a - r, d < 0 && (d = 0), p = s - d - t, p < H && (p = H, d = s - t - H);
829
984
  } else {
830
985
  if (t >= 1) {
831
986
  let e = i - n, r = Math.round(e / t);
@@ -834,7 +989,7 @@ var I = {
834
989
  let e = a - r, n = Math.round(e * t);
835
990
  f -= n, p -= e, u += n, d += e;
836
991
  }
837
- if (u < 0 || d < 0 || f < z || p < z) return l;
992
+ if (u < 0 || d < 0 || f < H || p < H) return l;
838
993
  }
839
994
  return {
840
995
  x: u,
@@ -842,12 +997,12 @@ var I = {
842
997
  w: f,
843
998
  h: p
844
999
  };
845
- }, De = (e, t, n, r, i, a, o, s, c, l) => {
1000
+ }, je = (e, t, n, r, i, a, o, s, c, l) => {
846
1001
  let { x: u } = c, { y: d, w: f, h: p } = c;
847
1002
  if (e) {
848
- f += i - n, f + u > o && (f = o - u), f < z && (f = z);
1003
+ f += i - n, f + u > o && (f = o - u), f < H && (f = H);
849
1004
  let e = s - p - d;
850
- d += a - r, d < 0 && (d = 0), p = s - d - e, p < z && (p = z, d = s - e - z);
1005
+ d += a - r, d < 0 && (d = 0), p = s - d - e, p < H && (p = H, d = s - e - H);
851
1006
  } else {
852
1007
  if (t > 1) {
853
1008
  let e = i - n, r = Math.round(e / t);
@@ -856,7 +1011,7 @@ var I = {
856
1011
  let e = a - r, n = Math.round(e * t);
857
1012
  f -= n, p -= e, d += e;
858
1013
  }
859
- if (f + u > o || d < 0 || f < z || p < z) return l;
1014
+ if (f + u > o || d < 0 || f < H || p < H) return l;
860
1015
  }
861
1016
  return {
862
1017
  x: u,
@@ -864,12 +1019,12 @@ var I = {
864
1019
  w: f,
865
1020
  h: p
866
1021
  };
867
- }, Oe = (e, t, n, r, i, a, o, s, c, l) => {
1022
+ }, Me = (e, t, n, r, i, a, o, s, c, l) => {
868
1023
  let { y: u } = c, { x: d, w: f, h: p } = c;
869
1024
  if (e) {
870
- p += a - r, p + u > s && (p = s - u), p < z && (p = z);
1025
+ p += a - r, p + u > s && (p = s - u), p < H && (p = H);
871
1026
  let e = o - c.w - c.x;
872
- d += i - n, d < 0 && (d = 0), f = o - d - e, f < z && (f = z, d = o - e - z);
1027
+ d += i - n, d < 0 && (d = 0), f = o - d - e, f < H && (f = H, d = o - e - H);
873
1028
  } else {
874
1029
  if (t >= 1) {
875
1030
  let e = i - n, r = Math.round(e / t);
@@ -878,7 +1033,7 @@ var I = {
878
1033
  let e = a - r, n = Math.round(e * t);
879
1034
  f += n, p += e, d -= n;
880
1035
  }
881
- if (p + u > s || d < 0 || f < z || p < z) return l;
1036
+ if (p + u > s || d < 0 || f < H || p < H) return l;
882
1037
  }
883
1038
  return {
884
1039
  x: d,
@@ -886,9 +1041,9 @@ var I = {
886
1041
  w: f,
887
1042
  h: p
888
1043
  };
889
- }, ke = (e, t, n, r, i, a, o, s, c, l) => {
1044
+ }, Ne = (e, t, n, r, i, a, o, s, c, l) => {
890
1045
  let { x: u, y: d } = c, { w: f, h: p } = c;
891
- if (e) f += i - n, f + u > o && (f = o - u), f < z && (f = z), p += a - r, p + d > s && (p = s - d), p < z && (p = z);
1046
+ if (e) f += i - n, f + u > o && (f = o - u), f < H && (f = H), p += a - r, p + d > s && (p = s - d), p < H && (p = H);
892
1047
  else {
893
1048
  if (t >= 1) {
894
1049
  let e = i - n, r = Math.round(e / t);
@@ -897,7 +1052,7 @@ var I = {
897
1052
  let e = a - r, n = Math.round(e * t);
898
1053
  f += n, p += e;
899
1054
  }
900
- if (p + d > s || f + u > o || f < z || p < z) return l;
1055
+ if (p + d > s || f + u > o || f < H || p < H) return l;
901
1056
  }
902
1057
  return {
903
1058
  x: u,
@@ -905,30 +1060,34 @@ var I = {
905
1060
  w: f,
906
1061
  h: p
907
1062
  };
908
- }, Ae = (e, t, n, r, i, a, o, s, c) => {
909
- let l = e === "tl" || e === "bl", u = e === "tl" || e === "tr", d = c.x + c.w, f = c.y + c.h, p = i - n, m = a - r, h = t >= 1 ? c.w + (l ? -p : p) : (c.h + (u ? -m : m)) * t, g = l ? d : o - c.x, _ = u ? f : s - c.y, v = Math.min(g, _ * t), y = Math.max(z, z * t), b = Math.min(Math.max(h, y), v), x = b / t;
1063
+ }, Pe = (e, t, n, r, i, a, o, s, c) => {
1064
+ let l = e === "tl" || e === "bl", u = e === "tl" || e === "tr", d = c.x + c.w, f = c.y + c.h, p = i - n, m = a - r, h = t >= 1 ? c.w + (l ? -p : p) : (c.h + (u ? -m : m)) * t, g = l ? d : o - c.x, _ = u ? f : s - c.y, v = Math.min(g, _ * t), y = Math.max(H, H * t), b = Math.min(Math.max(h, y), v), x = b / t;
910
1065
  return {
911
1066
  x: l ? d - b : c.x,
912
1067
  y: u ? f - x : c.y,
913
1068
  w: b,
914
1069
  h: x
915
1070
  };
916
- }, je = (e, t, n, r, i, a, o, s, c, l, u) => t ? e === "tl" ? Ee(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? De(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? Oe(t, n, r, i, a, o, s, c, l, u) : e === "br" ? ke(t, n, r, i, a, o, s, c, l, u) : {
1071
+ }, Fe = (e, t, n, r, i, a, o, s, c, l, u) => t ? e === "tl" ? Ae(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? je(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? Me(t, n, r, i, a, o, s, c, l, u) : e === "br" ? Ne(t, n, r, i, a, o, s, c, l, u) : {
917
1072
  x: 0,
918
1073
  y: 0,
919
1074
  w: 0,
920
1075
  h: 0
921
- } : Ae(e, n, r, i, a, o, s, c, l), Me = (e, t, n) => {
1076
+ } : Pe(e, n, r, i, a, o, s, c, l), U = (e, t, n) => {
922
1077
  let r = .12, i = t / n, a = 0, o = 0;
923
1078
  e === 1 && (a = (i > 1 ? n : t) * (1 - r * 2), o = a), e > 1 && (i > e ? (o = n * (1 - r * 2), a = o * e) : (a = t * (1 - r * 2), o = a / e)), e < 1 && (i > e ? (o = n * (1 - r * 2), a = o * e) : (a = t * (1 - r * 2), o = a / e));
924
- let s = a / t * 100, c = o / n * 100;
1079
+ let s = a / t * 100, c = o / n * 100, l = (t - a) / 2 / t * 100, u = (n - o) / 2 / n * 100;
925
1080
  return {
926
- x: (t - a) / 2 / t * 100,
927
- y: (n - o) / 2 / n * 100,
1081
+ x: l,
1082
+ y: u,
928
1083
  w: s,
929
- h: c
1084
+ h: c,
1085
+ xP: Math.round(l / 100 * t),
1086
+ yP: Math.round(u / 100 * n),
1087
+ wP: Math.round(s / 100 * t),
1088
+ hP: Math.round(c / 100 * n)
930
1089
  };
931
- }, Ne = (e, t, n, r) => {
1090
+ }, Ie = (e, t, n, r) => {
932
1091
  let i = e.w / 100 * n, a = e.h / 100 * r;
933
1092
  t >= 1 ? a = i / t : i = a * t;
934
1093
  let o = i / n * 100, s = a / r * 100, c = Math.max(o / (100 - e.x), s / (100 - e.y), 1);
@@ -937,21 +1096,21 @@ var I = {
937
1096
  w: o,
938
1097
  h: s
939
1098
  };
940
- }, B = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, Pe = (e, t, n, r) => B(n) === B(r) ? {
1099
+ }, W = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, Le = (e, t, n, r) => W(n) === W(r) ? {
941
1100
  width: e,
942
1101
  height: t
943
1102
  } : {
944
1103
  width: t,
945
1104
  height: e
946
- }, Fe = async (e) => {
947
- let { width: t, height: n } = e, r = Math.min(1, Ce / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
1105
+ }, Re = async (e) => {
1106
+ let { width: t, height: n } = e, r = Math.min(1, De / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
948
1107
  if (!s) throw Error("Failed to get 2D context for preview canvas");
949
1108
  return s.drawImage(e, 0, 0, i, a), o.convertToBlob({
950
1109
  type: "image/webp",
951
- quality: we
1110
+ quality: Oe
952
1111
  });
953
1112
  };
954
- function Ie(e) {
1113
+ function ze(e) {
955
1114
  let t = new OffscreenCanvas(e.width, e.height), n = t.getContext("2d");
956
1115
  if (!n) throw Error("Failed to create 2D context for canvas.");
957
1116
  n.drawImage(e, 0, 0);
@@ -965,14 +1124,14 @@ function Ie(e) {
965
1124
  }
966
1125
  //#endregion
967
1126
  //#region src/shared/components/Pixedi/utils/imageProcessor.ts
968
- var Le = (e) => new Promise((t, n) => {
1127
+ var Be = (e) => new Promise((t, n) => {
969
1128
  let r = new FileReader();
970
1129
  r.onloadend = () => {
971
1130
  let e = r.result;
972
1131
  typeof e == "string" ? t(e) : n(/* @__PURE__ */ Error("Failed to read blob as base64"));
973
1132
  }, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("FileReader error")), r.readAsDataURL(e);
974
1133
  });
975
- async function Re(e) {
1134
+ async function Ve(e) {
976
1135
  let t = await createImageBitmap(e), n = e.type || "image/png", r = n === "image/gif" ? "image/png" : n, i = document.createElement("canvas"), a = i.getContext("2d", { alpha: !0 });
977
1136
  i.width = t.width, i.height = t.height, a?.drawImage(t, 0, 0), t.close();
978
1137
  let o = () => {
@@ -1007,7 +1166,7 @@ async function Re(e) {
1007
1166
  }, a, t) : i.toBlob((t) => {
1008
1167
  t ? e(t) : o(/* @__PURE__ */ Error("Failed to encode image as image/png"));
1009
1168
  }, "image/png");
1010
- }), s = await createImageBitmap(o), c = await Fe(s), { width: l, height: u } = s, d = Ie(s);
1169
+ }), s = await createImageBitmap(o), c = await Re(s), { width: l, height: u } = s, d = ze(s);
1011
1170
  return s.close(), {
1012
1171
  newBlob: o,
1013
1172
  previewBlob: c,
@@ -1021,17 +1180,17 @@ async function Re(e) {
1021
1180
  }
1022
1181
  //#endregion
1023
1182
  //#region src/shared/components/Pixedi/utils/preview.ts
1024
- var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0][0] + e[0][1] * t[1][0], e[0][0] * t[0][1] + e[0][1] * t[1][1]], [e[1][0] * t[0][0] + e[1][1] * t[1][0], e[1][0] * t[0][1] + e[1][1] * t[1][1]]], Be = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, Ve = (e) => {
1025
- switch (Be(e)) {
1183
+ var G = (e, t, n) => Math.max(t, Math.min(n, e)), He = (e, t) => [[e[0][0] * t[0][0] + e[0][1] * t[1][0], e[0][0] * t[0][1] + e[0][1] * t[1][1]], [e[1][0] * t[0][0] + e[1][1] * t[1][0], e[1][0] * t[0][1] + e[1][1] * t[1][1]]], Ue = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, We = (e) => {
1184
+ switch (Ue(e)) {
1026
1185
  case 90: return [[0, -1], [1, 0]];
1027
1186
  case 180: return [[-1, 0], [0, -1]];
1028
1187
  case 270: return [[0, 1], [-1, 0]];
1029
1188
  default: return [[1, 0], [0, 1]];
1030
1189
  }
1031
- }, He = (e, t) => [[e ? -1 : 1, 0], [0, t ? -1 : 1]], Ue = (e, t, n) => ze(He(t, n), Ve(-e)), We = (e) => [+(e[0][0] < 0 || e[0][1] < 0), +(e[1][0] < 0 || e[1][1] < 0)], H = (e, t, n) => {
1032
- let r = We(e);
1190
+ }, Ge = (e, t) => [[e ? -1 : 1, 0], [0, t ? -1 : 1]], Ke = (e, t, n) => He(Ge(t, n), We(-e)), qe = (e) => [+(e[0][0] < 0 || e[0][1] < 0), +(e[1][0] < 0 || e[1][1] < 0)], K = (e, t, n) => {
1191
+ let r = qe(e);
1033
1192
  return [e[0][0] * t + e[0][1] * n + r[0], e[1][0] * t + e[1][1] * n + r[1]];
1034
- }, Ge = (e) => {
1193
+ }, Je = (e) => {
1035
1194
  let t = 1, n = 1, r = {
1036
1195
  x: 0,
1037
1196
  y: 0,
@@ -1040,18 +1199,18 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1040
1199
  }, i = 0, a = !1, o = !1;
1041
1200
  for (let s = 0; s < e.length; s++) {
1042
1201
  let c = e[s];
1043
- if (c.action.name === "initial") t = c.width, n = c.height, r = {
1202
+ if (c.action.name === m.INITIAL) t = c.width, n = c.height, r = {
1044
1203
  x: 0,
1045
1204
  y: 0,
1046
1205
  w: 1,
1047
1206
  h: 1
1048
1207
  }, i = 0, a = !1, o = !1;
1049
- else if (c.action.name === "crop") {
1050
- let e = (c.action.args.x ?? 0) / 100, t = (c.action.args.y ?? 0) / 100, n = (c.action.args.w ?? 100) / 100, s = (c.action.args.h ?? 100) / 100, l = Ue(i, a, o), u = [
1051
- H(l, e, t),
1052
- H(l, e + n, t),
1053
- H(l, e, t + s),
1054
- H(l, e + n, t + s)
1208
+ else if (c.action.name === m.CROP) {
1209
+ let e = (c.action.args.x ?? 0) / 100, t = (c.action.args.y ?? 0) / 100, n = (c.action.args.w ?? 100) / 100, s = (c.action.args.h ?? 100) / 100, l = Ke(i, a, o), u = [
1210
+ K(l, e, t),
1211
+ K(l, e + n, t),
1212
+ K(l, e, t + s),
1213
+ K(l, e + n, t + s)
1055
1214
  ], d = Math.min(...u.map((e) => e[0])), f = Math.max(...u.map((e) => e[0])), p = Math.min(...u.map((e) => e[1])), m = Math.max(...u.map((e) => e[1]));
1056
1215
  r = {
1057
1216
  x: r.x + d * r.w,
@@ -1060,11 +1219,11 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1060
1219
  h: r.h * (m - p)
1061
1220
  };
1062
1221
  } else if (c.action.name === "flip") {
1063
- let e = B(i), t = e ? c.action.args.vertical : c.action.args.horizontal, n = e ? c.action.args.horizontal : c.action.args.vertical;
1222
+ let e = W(i), t = e ? c.action.args.vertical : c.action.args.horizontal, n = e ? c.action.args.horizontal : c.action.args.vertical;
1064
1223
  t && (a = !a), n && (o = !o);
1065
1224
  } else c.action.name === "rotate" && (i = c.action.args.degrees);
1066
1225
  }
1067
- let s = r.w * t, c = r.h * n, l = B(i), u = l ? c : s, d = l ? s : c, f = e.at(-1)?.width || 0, p = e.at(-1)?.height || 0;
1226
+ let s = r.w * t, c = r.h * n, l = W(i), u = l ? c : s, d = l ? s : c, f = e.at(-1)?.width || 0, p = e.at(-1)?.height || 0;
1068
1227
  return {
1069
1228
  box: r,
1070
1229
  boxWidth: s,
@@ -1079,13 +1238,13 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1079
1238
  flipH: a,
1080
1239
  flipV: o
1081
1240
  };
1082
- }, Ke = (e) => {
1083
- let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = Ge(e), d = V(t.x, 0, 1), f = V(t.y, 0, 1), p = {
1241
+ }, Ye = (e) => {
1242
+ let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = Je(e), d = G(t.x, 0, 1), f = G(t.y, 0, 1), p = {
1084
1243
  x: d,
1085
1244
  y: f,
1086
- w: V(t.w, 0, 1 - d),
1087
- h: V(t.h, 0, 1 - f)
1088
- }, m = Be(i);
1245
+ w: G(t.w, 0, 1 - d),
1246
+ h: G(t.h, 0, 1 - f)
1247
+ }, m = Ue(i);
1089
1248
  return {
1090
1249
  ...p.x === 0 && p.y === 0 && p.w === 1 && p.h === 1 ? {} : { crop: {
1091
1250
  x: Math.round(s * t.x),
@@ -1103,18 +1262,18 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1103
1262
  height: o
1104
1263
  } } : {}
1105
1264
  };
1106
- }, qe = (e) => {
1107
- let [t, n] = s(!1), { setImage: r, settings: i, history: a, originalBlob: o, setCurrentAction: c, resetHistory: l } = A();
1265
+ }, Xe = (e) => {
1266
+ let [t, n] = u(!1), { setImage: r, settings: i, history: a, originalBlob: o, setCurrentAction: s, resetHistory: c } = P();
1108
1267
  return {
1109
1268
  save: async () => {
1110
1269
  if (!o) return;
1111
1270
  n(!0);
1112
- let t = Ke(a.items.slice(0, a.pointer + 1));
1271
+ let t = Ye(a.items.slice(0, a.pointer + 1));
1113
1272
  try {
1114
- let n = await Re(o);
1273
+ let n = await Ve(o);
1115
1274
  t.crop && n.crop(t.crop.x, t.crop.y, t.crop.w, t.crop.h), t.flip && n.flip(t.flip.horizontal, t.flip.vertical), t.rotate && n.rotate(t.rotate.degrees), t.resize && n.resize(t.resize.width, t.resize.height);
1116
1275
  let { newBlob: a, previewBlob: s, mimeType: c, width: l, height: u, isAlpha: d } = await n.get(i), f = "";
1117
- i.exportAs === "base64" && (f = await Le(a)), await e(f || a), r({
1276
+ i.exportAs === "base64" && (f = await Be(a)), await e(f || a), r({
1118
1277
  newBlob: a,
1119
1278
  previewBlob: s,
1120
1279
  mimeType: c,
@@ -1129,418 +1288,608 @@ var V = (e, t, n) => Math.max(t, Math.min(n, e)), ze = (e, t) => [[e[0][0] * t[0
1129
1288
  }
1130
1289
  },
1131
1290
  reset: () => {
1132
- c(null), l();
1291
+ s(null), c();
1133
1292
  },
1134
1293
  isSaving: t
1135
1294
  };
1136
- }, U = {
1137
- header: "_header_msw8l_1",
1138
- tools: "_tools_msw8l_11",
1139
- history: "_history_msw8l_15",
1140
- historyText: "_historyText_msw8l_20"
1141
- }, Je = ({ onBack: e, onSave: t }) => {
1142
- let { save: n, reset: r, isSaving: i } = qe(t), { history: a, undo: o, redo: s } = A(), c = a.items.length > 1 && !i, l = a.pointer === 0, u = a.pointer === a.items.length - 1, d = a.items.length < 2 || i, f = d || a.pointer === 0;
1143
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1144
- className: U.header,
1145
- children: [/* @__PURE__ */ (0, h.jsx)(M, {
1146
- variant: "ghost",
1147
- className: j.rect,
1148
- onClick: e,
1149
- children: /* @__PURE__ */ (0, h.jsx)(D, {})
1150
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
1151
- className: U.tools,
1295
+ }, q = {
1296
+ header: "_header_1yueu_1",
1297
+ left: "_left_1yueu_12",
1298
+ sidebarToggle: "_sidebarToggle_1yueu_17",
1299
+ mobile: "_mobile_1yueu_29",
1300
+ sidebarIcon: "_sidebarIcon_1yueu_33",
1301
+ tools: "_tools_1yueu_38",
1302
+ history: "_history_1yueu_42",
1303
+ historyText: "_historyText_1yueu_47"
1304
+ }, Ze = ({ onBack: e, onSave: t, isMobile: n }) => {
1305
+ let { save: r, reset: i, isSaving: a } = Xe(t), { sidebar: o, history: s, undo: c, redo: l, setSidebar: u, setCurrentAction: d } = P(), f = s.items.length > 1 && !a, p = s.pointer === 0, m = s.pointer === s.items.length - 1, h = s.items.length < 2 || a, g = h || s.pointer === 0;
1306
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
1307
+ className: q.header,
1308
+ children: [/* @__PURE__ */ (0, b.jsxs)("div", {
1309
+ className: q.left,
1310
+ children: [/* @__PURE__ */ (0, b.jsx)("div", {
1311
+ className: `${q.sidebarToggle} ${n ? q.mobile : ""}`,
1312
+ onClick: () => {
1313
+ u(!o);
1314
+ },
1315
+ children: o ? /* @__PURE__ */ (0, b.jsx)(he, { className: q.sidebarIcon }) : /* @__PURE__ */ (0, b.jsx)(me, { className: q.sidebarIcon })
1316
+ }), /* @__PURE__ */ (0, b.jsx)(I, {
1317
+ variant: "ghost",
1318
+ className: F.rect,
1319
+ onClick: e,
1320
+ children: /* @__PURE__ */ (0, b.jsx)(j, {})
1321
+ })]
1322
+ }), /* @__PURE__ */ (0, b.jsxs)("div", {
1323
+ className: q.tools,
1152
1324
  children: [
1153
- c && /* @__PURE__ */ (0, h.jsxs)("div", {
1154
- className: U.history,
1325
+ f && /* @__PURE__ */ (0, b.jsxs)("div", {
1326
+ className: q.history,
1155
1327
  children: [
1156
- /* @__PURE__ */ (0, h.jsx)(M, {
1328
+ /* @__PURE__ */ (0, b.jsx)(I, {
1157
1329
  variant: "outline",
1158
- disabled: l,
1159
- className: j.rect,
1160
- onClick: o,
1161
- children: /* @__PURE__ */ (0, h.jsx)(re, {})
1330
+ disabled: p,
1331
+ className: F.rect,
1332
+ onClick: () => {
1333
+ c(), d(null);
1334
+ },
1335
+ children: /* @__PURE__ */ (0, b.jsx)(ne, {})
1162
1336
  }),
1163
- /* @__PURE__ */ (0, h.jsxs)("div", {
1164
- className: U.historyText,
1337
+ /* @__PURE__ */ (0, b.jsxs)("div", {
1338
+ className: q.historyText,
1165
1339
  children: [
1166
- a.pointer + 1,
1340
+ s.pointer + 1,
1167
1341
  "/",
1168
- a.items.length
1342
+ s.items.length
1169
1343
  ]
1170
1344
  }),
1171
- /* @__PURE__ */ (0, h.jsx)(M, {
1345
+ /* @__PURE__ */ (0, b.jsx)(I, {
1172
1346
  variant: "outline",
1173
- disabled: u,
1174
- className: j.rect,
1175
- onClick: s,
1176
- children: /* @__PURE__ */ (0, h.jsx)(k, {})
1347
+ disabled: m,
1348
+ className: F.rect,
1349
+ onClick: () => {
1350
+ l(), d(null);
1351
+ },
1352
+ children: /* @__PURE__ */ (0, b.jsx)(re, {})
1177
1353
  })
1178
1354
  ]
1179
1355
  }),
1180
- /* @__PURE__ */ (0, h.jsx)(M, {
1356
+ /* @__PURE__ */ (0, b.jsx)(I, {
1181
1357
  variant: "outline",
1182
- disabled: d,
1183
- onClick: r,
1358
+ disabled: h,
1359
+ onClick: i,
1184
1360
  children: "Reset"
1185
1361
  }),
1186
- /* @__PURE__ */ (0, h.jsxs)(M, {
1187
- disabled: f,
1188
- onClick: n,
1189
- children: [i ? /* @__PURE__ */ (0, h.jsx)(pe, {}) : /* @__PURE__ */ (0, h.jsx)(E, {}), "Save"]
1362
+ /* @__PURE__ */ (0, b.jsxs)(I, {
1363
+ disabled: g,
1364
+ onClick: r,
1365
+ children: [a ? /* @__PURE__ */ (0, b.jsx)(ge, {}) : /* @__PURE__ */ (0, b.jsx)(A, {}), "Save"]
1190
1366
  })
1191
1367
  ]
1192
1368
  })]
1193
1369
  });
1194
- }, Ye = (e, t) => {
1370
+ }, Qe = {
1371
+ [m.RESIZE]: {
1372
+ icon: /* @__PURE__ */ (0, b.jsx)(ce, {}),
1373
+ label: "Resize"
1374
+ },
1375
+ [m.CROP]: {
1376
+ icon: /* @__PURE__ */ (0, b.jsx)(N, {}),
1377
+ label: "Crop"
1378
+ },
1379
+ [m.PRESET_CROP]: {
1380
+ icon: /* @__PURE__ */ (0, b.jsx)(pe, {}),
1381
+ label: "Presets"
1382
+ },
1383
+ [m.FLIP]: {
1384
+ icon: /* @__PURE__ */ (0, b.jsx)(le, {}),
1385
+ label: "Flip"
1386
+ },
1387
+ [m.ROTATE]: {
1388
+ icon: /* @__PURE__ */ (0, b.jsx)(de, {}),
1389
+ label: "Rotate"
1390
+ }
1391
+ }, $e = (e) => Qe[e] ?? null, et = () => {
1392
+ let { settings: e, currentAction: t, getLastRotation: n, getLastHistoryItem: r, setCurrentAction: i, setSidebar: a } = P(), o = e?.tools || [], s = t?.name, { width: c, height: l } = r();
1393
+ return { click: (e) => {
1394
+ if (o.includes(e) && s === e) {
1395
+ i(null);
1396
+ return;
1397
+ }
1398
+ switch (e) {
1399
+ case m.RESIZE:
1400
+ i({
1401
+ name: m.RESIZE,
1402
+ args: {
1403
+ width: c,
1404
+ height: l
1405
+ }
1406
+ });
1407
+ break;
1408
+ case m.CROP:
1409
+ i({
1410
+ name: m.CROP,
1411
+ args: {
1412
+ id: "freeform",
1413
+ ratio: c / l,
1414
+ isFree: !0
1415
+ }
1416
+ });
1417
+ break;
1418
+ case m.PRESET_CROP:
1419
+ i({
1420
+ name: m.PRESET_CROP,
1421
+ args: {
1422
+ id: "facebook-post",
1423
+ ratio: 1200 / 630,
1424
+ isFree: !1,
1425
+ preset: {
1426
+ width: 1200,
1427
+ height: 630
1428
+ }
1429
+ }
1430
+ });
1431
+ break;
1432
+ case m.FLIP:
1433
+ i({
1434
+ name: m.FLIP,
1435
+ args: {
1436
+ horizontal: !1,
1437
+ vertical: !1
1438
+ }
1439
+ });
1440
+ break;
1441
+ case m.ROTATE:
1442
+ i({
1443
+ name: m.ROTATE,
1444
+ args: { degrees: n() }
1445
+ });
1446
+ break;
1447
+ }
1448
+ a(!1);
1449
+ } };
1450
+ }, J = {
1451
+ sidebar: "_sidebar_1j9gh_1",
1452
+ mobile: "_mobile_1j9gh_9",
1453
+ open: "_open_1j9gh_14",
1454
+ wrapper: "_wrapper_1j9gh_19",
1455
+ item: "_item_1j9gh_23",
1456
+ selected: "_selected_1j9gh_41"
1457
+ }, tt = ({ isMobile: e }) => {
1458
+ let { settings: t, sidebar: n, currentAction: r } = P(), i = t?.tools || [], a = r?.name, { click: o } = et();
1459
+ return /* @__PURE__ */ (0, b.jsx)("nav", {
1460
+ className: `${J.sidebar} ${e ? J.mobile : ""} ${e && n ? J.open : ""}`,
1461
+ children: /* @__PURE__ */ (0, b.jsx)(V, {
1462
+ orientation: "vertical",
1463
+ className: J.tooltip,
1464
+ children: i.map((e) => {
1465
+ let t = $e(e);
1466
+ if (!t) return null;
1467
+ let { icon: n, label: r } = t;
1468
+ return /* @__PURE__ */ (0, b.jsx)("div", {
1469
+ className: `${J.item} ${a === e ? J.selected : ""}`,
1470
+ onClick: () => o(e),
1471
+ "data-tooltip": r,
1472
+ "aria-label": r,
1473
+ children: n
1474
+ }, e);
1475
+ })
1476
+ })
1477
+ });
1478
+ }, nt = { infobar: "_infobar_ofe91_1" }, rt = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(2)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`, it = () => {
1479
+ let { originalBlob: e, getLastHistoryItem: t } = P(), { width: n, height: r } = t();
1480
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
1481
+ className: nt.infobar,
1482
+ children: [/* @__PURE__ */ (0, b.jsx)("div", {
1483
+ className: nt.filesize,
1484
+ children: e ? rt(e.size) : "0 B"
1485
+ }), /* @__PURE__ */ (0, b.jsxs)("div", {
1486
+ className: nt.sizes,
1487
+ children: [
1488
+ n,
1489
+ " / ",
1490
+ r
1491
+ ]
1492
+ })]
1493
+ });
1494
+ }, at = (e, t) => {
1195
1495
  let n = new CustomEvent("crop-update", { detail: t });
1196
1496
  e.dispatchEvent(n);
1197
- }, Xe = (e, t) => {
1497
+ }, ot = (e, t) => {
1198
1498
  let n = new CustomEvent("clip-path-update", { detail: t });
1199
1499
  e.dispatchEvent(n);
1200
- }, W = (e, t) => {
1500
+ }, st = (e, t) => {
1201
1501
  let n = new CustomEvent("resize-update", { detail: t });
1202
1502
  e.dispatchEvent(n);
1203
- }, G = {
1204
- resize: "_resize_11cwi_1",
1205
- slider: "_slider_11cwi_14",
1206
- border: "_border_11cwi_18",
1207
- tools: "_tools_11cwi_24",
1208
- toolsLock: "_toolsLock_11cwi_30"
1209
- }, K = 10, q = 200, J = (e, t, n) => (e < K && (e = K), e > q && (e = q), {
1210
- updatedScale: e,
1211
- updatedWidth: Math.round(e / 100 * t),
1212
- updatedHeight: Math.round(e / 100 * n)
1213
- }), Ze = () => {
1214
- let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: i, eventBus: a } = A(), { width: c, height: l } = e(), [u, d] = s(c), [f, p] = s(l), [m, g] = s(100), _ = o(0), v = S(), y = (e) => {
1215
- let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(e, c, l);
1216
- d(n), p(r), g(t), W(a, t);
1217
- }, b = (e) => {
1218
- let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(parseInt(e.target?.value ?? "1") / c * 100, c, l);
1219
- d(n), p(r), g(t), W(a, t);
1220
- }, x = (e) => {
1221
- let { updatedScale: t, updatedWidth: n, updatedHeight: r } = J(parseInt(e.target.value) / l * 100, c, l);
1222
- p(r), d(n), g(t), W(a, t);
1223
- }, C = () => {
1224
- W(a, 100), t(null), i(!0);
1225
- }, w = () => {
1226
- n({
1227
- width: u,
1228
- height: f,
1229
- action: {
1230
- name: "resize",
1231
- args: {
1232
- width: u,
1233
- height: f
1234
- }
1235
- }
1236
- }), W(a, 100), i(!0);
1503
+ }, ct = 15, lt = 200, ut = 2, dt = (e, t, n) => {
1504
+ let r = Math.min(lt, Math.max(ct, e));
1505
+ return {
1506
+ scale: r,
1507
+ width: Math.round(r / 100 * t),
1508
+ height: Math.round(r / 100 * n)
1237
1509
  };
1238
- return r(() => {
1239
- let e = Math.round(u / c * 100), t = (e) => {
1240
- let { updatedHeight: t, updatedWidth: n } = J(e, c, l);
1241
- p(t), d(n), g(e), W(a, e);
1242
- }, n = (n) => {
1243
- let r = Math.sign(n.deltaY);
1244
- e -= r * 2, e <= K && (e = K), e >= q && (e = q), t(e);
1245
- }, r = (e) => {
1246
- _.current = e.touches[0].clientY;
1247
- }, i = (n) => {
1248
- let r = n.touches[0].clientY, i = _.current - r;
1249
- Math.abs(i) < 10 || (e += Math.sign(i) * 2, e <= K && (e = K), e >= q && (e = q), t(e), _.current = r);
1250
- }, o = new AbortController(), { signal: s } = o;
1251
- return window.addEventListener("wheel", n, { signal: s }), window.addEventListener("touchstart", r, { signal: s }), window.addEventListener("touchmove", i, { signal: s }), () => o.abort();
1510
+ }, ft = () => {
1511
+ let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r, eventBus: a } = P(), { width: s, height: c } = e(), [d, f] = u(s), [p, h] = u(c), [g, _] = u(100), v = l(g), y = l(0), b = l(null), x = i((e) => {
1512
+ let t = dt(e, s, c);
1513
+ f(t.width), h(t.height), _(t.scale), v.current = t.scale, st(a, t.scale);
1252
1514
  }, [
1253
- l,
1254
1515
  c,
1255
- v,
1256
- u,
1516
+ s,
1257
1517
  a
1258
- ]), /* @__PURE__ */ (0, h.jsxs)("div", {
1259
- className: G.resize,
1260
- children: [/* @__PURE__ */ (0, h.jsx)(Se, {
1261
- min: K,
1262
- max: q,
1263
- value: m,
1264
- className: G.slider,
1265
- onChange: y
1266
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
1267
- className: G.tools,
1268
- children: [
1269
- /* @__PURE__ */ (0, h.jsx)(be, {
1270
- value: u,
1271
- name: "width",
1272
- label: "Width",
1273
- style: { width: "88px" },
1274
- onChange: (e) => d(Number(e.target.value)),
1275
- onBlur: b
1276
- }),
1277
- /* @__PURE__ */ (0, h.jsx)(ne, { className: G.toolsLock }),
1278
- /* @__PURE__ */ (0, h.jsx)(be, {
1279
- value: f,
1280
- name: "height",
1281
- label: "Height",
1282
- style: { width: "88px" },
1283
- onChange: (e) => p(Number(e.target.value)),
1284
- onBlur: x
1285
- }),
1286
- /* @__PURE__ */ (0, h.jsx)(L, {
1287
- onSave: () => w(),
1288
- onClose: C,
1289
- disabled: u === c
1518
+ ]), S = (e, t) => {
1519
+ let n = Number.parseInt(e, 10);
1520
+ if (!Number.isFinite(n)) {
1521
+ x(100);
1522
+ return;
1523
+ }
1524
+ x(n / t * 100);
1525
+ };
1526
+ return o(() => {
1527
+ let e = (e) => {
1528
+ let t = b.current?.parentElement;
1529
+ return e.target instanceof Node && !!t?.contains(e.target);
1530
+ }, t = (t) => {
1531
+ e(t) && x(v.current - Math.sign(t.deltaY) * ut);
1532
+ }, n = (t) => {
1533
+ e(t) && (y.current = t.touches[0].clientY);
1534
+ }, r = (t) => {
1535
+ if (!e(t)) return;
1536
+ let n = t.touches[0].clientY, r = y.current - n;
1537
+ Math.abs(r) < 10 || (x(v.current + Math.sign(r) * ut), y.current = n);
1538
+ }, i = new AbortController(), { signal: a } = i;
1539
+ return window.addEventListener("wheel", t, { signal: a }), window.addEventListener("touchstart", n, { signal: a }), window.addEventListener("touchmove", r, { signal: a }), () => i.abort();
1540
+ }, [x]), {
1541
+ resizeRef: b,
1542
+ width: d,
1543
+ height: p,
1544
+ scale: g,
1545
+ currentWidth: s,
1546
+ currentHeight: c,
1547
+ setWidth: f,
1548
+ setHeight: h,
1549
+ handleWidthBlur: (e) => {
1550
+ S(e.target.value, s);
1551
+ },
1552
+ handleHeightBlur: (e) => {
1553
+ S(e.target.value, c);
1554
+ },
1555
+ save: () => {
1556
+ n({
1557
+ width: d,
1558
+ height: p,
1559
+ action: {
1560
+ name: m.RESIZE,
1561
+ args: {
1562
+ width: d,
1563
+ height: p
1564
+ }
1565
+ }
1566
+ }), st(a, 100), r(!0);
1567
+ },
1568
+ close: () => {
1569
+ st(a, 100), t(null), r(!0);
1570
+ }
1571
+ };
1572
+ }, Y = {
1573
+ resize: "_resize_s127g_1",
1574
+ toolsLock: "_toolsLock_s127g_15",
1575
+ indicatorWrapper: "_indicatorWrapper_s127g_20",
1576
+ indicator: "_indicator_s127g_20"
1577
+ }, pt = () => {
1578
+ let { resizeRef: e, width: t, height: n, scale: r, currentWidth: i, currentHeight: a, setWidth: o, setHeight: s, handleWidthBlur: c, handleHeightBlur: l, save: u, close: d } = ft();
1579
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
1580
+ ref: e,
1581
+ className: Y.resize,
1582
+ children: [
1583
+ /* @__PURE__ */ (0, b.jsx)("div", {
1584
+ className: Y.indicatorWrapper,
1585
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
1586
+ className: Y.indicator,
1587
+ style: { width: `${r / 2}%` }
1290
1588
  })
1291
- ]
1292
- })]
1589
+ }),
1590
+ /* @__PURE__ */ (0, b.jsx)(we, {
1591
+ value: t,
1592
+ name: "width",
1593
+ label: "Width",
1594
+ style: { width: "88px" },
1595
+ onChange: (e) => o(Number(e.target.value)),
1596
+ onBlur: c
1597
+ }),
1598
+ /* @__PURE__ */ (0, b.jsx)(te, { className: Y.toolsLock }),
1599
+ /* @__PURE__ */ (0, b.jsx)(we, {
1600
+ value: n,
1601
+ name: "height",
1602
+ label: "Height",
1603
+ style: { width: "88px" },
1604
+ onChange: (e) => s(Number(e.target.value)),
1605
+ onBlur: l
1606
+ }),
1607
+ /* @__PURE__ */ (0, b.jsx)(z, {
1608
+ onSave: u,
1609
+ onClose: d,
1610
+ disabled: t === i && n === a
1611
+ })
1612
+ ]
1293
1613
  });
1294
- }, Y = {
1295
- preview: "_preview_dvanl_1",
1296
- rotate: "_rotate_dvanl_12",
1297
- flip: "_flip_dvanl_24",
1298
- image: "_image_dvanl_32"
1299
- }, Qe = ({ isClipped: e, style: t = {} }) => {
1300
- let { history: n, previewUrl: a, currentAction: s, getLastRotation: c, eventBus: l } = A(), u = o(null), d = o(s?.name), f = o(a);
1301
- i(() => {
1302
- let e = d.current, t = s?.name, n = f.current !== a;
1303
- if (d.current = t, f.current = a, !(e && t && e !== t) && !n) return;
1304
- let r = u.current;
1305
- if (!r) return;
1306
- let i = [r, ...r.querySelectorAll("*")];
1307
- i.forEach((e) => {
1614
+ }, mt = ({ isClipped: e }) => {
1615
+ let { history: t, previewUrl: n, currentAction: r, getLastRotation: i, eventBus: a } = P(), c = l(null), u = l(r?.name), d = l(n);
1616
+ s(() => {
1617
+ let e = u.current, t = r?.name, i = d.current !== n;
1618
+ if (u.current = t, d.current = n, !(e && t && e !== t) && !i) return;
1619
+ let a = c.current;
1620
+ if (!a) return;
1621
+ let o = [a, ...a.querySelectorAll("*")];
1622
+ o.forEach((e) => {
1308
1623
  e.style.transition = "none";
1309
- }), r.getBoundingClientRect();
1310
- let o = () => {
1311
- i.forEach((e) => {
1624
+ }), a.getBoundingClientRect();
1625
+ let s = () => {
1626
+ o.forEach((e) => {
1312
1627
  e.style.removeProperty("transition");
1313
1628
  });
1314
- }, c = requestAnimationFrame(o);
1629
+ }, l = requestAnimationFrame(s);
1315
1630
  return () => {
1316
- cancelAnimationFrame(c), o();
1631
+ cancelAnimationFrame(l), s();
1317
1632
  };
1318
- }, [s?.name, a]);
1319
- let p = [];
1320
- if (s) {
1321
- let { width: e, height: t } = n.items.at(n.pointer);
1322
- p.push({
1323
- ...s.name === w.ROTATE ? Pe(e, t, c(), s.args.degrees) : {
1633
+ }, [r?.name, n]);
1634
+ let f = t.items.slice(0, t.pointer + 1);
1635
+ if (r) {
1636
+ let { width: e, height: n } = t.items.at(t.pointer);
1637
+ f.push({
1638
+ ...r.name === m.ROTATE ? Le(e, n, i(), r.args.degrees) : {
1324
1639
  width: e,
1325
- height: t
1640
+ height: n
1326
1641
  },
1327
- action: s
1642
+ action: r
1328
1643
  });
1329
1644
  }
1330
- let { box: m, boxWidth: g, boxHeight: _, viewWidth: v, viewHeight: y, rotation: b, flipH: x, flipV: S } = Ge([...n.items.slice(0, n.pointer + 1), ...p]);
1331
- return r(() => {
1332
- e && u.current && (u.current.style.transition = "none"), s?.name !== w.RESIZE && u.current && (u.current.style.transform = "scale(1)");
1645
+ let p = Je(f);
1646
+ return o(() => {
1647
+ e && c.current && (c.current.style.transition = "none"), r?.name !== m.RESIZE && c.current && (c.current.style.transform = "scale(1)");
1333
1648
  let t = (e) => {
1334
1649
  let t = e.detail;
1335
- u.current && (u.current.style.transform = `scale(${t / 100})`);
1650
+ c.current && (c.current.style.transform = `scale(${t / 100})`);
1336
1651
  }, n = (t) => {
1337
1652
  if (!e) return;
1338
1653
  let { x: n, y: r, w: i, h: a } = t.detail;
1339
- u.current && (u.current.style.clipPath = `xywh(${n}% ${r}% ${i}% ${a}%)`);
1654
+ c.current && (c.current.style.clipPath = `xywh(${n}% ${r}% ${i}% ${a}%)`);
1340
1655
  };
1341
- return l.addEventListener("resize-update", t), l.addEventListener("clip-path-update", n), () => {
1342
- l.removeEventListener("resize-update", t), l.removeEventListener("clip-path-update", n);
1656
+ return a.addEventListener("resize-update", t), a.addEventListener("clip-path-update", n), () => {
1657
+ a.removeEventListener("resize-update", t), a.removeEventListener("clip-path-update", n);
1343
1658
  };
1344
1659
  }, [
1345
1660
  e,
1346
- s?.name,
1347
- l
1348
- ]), /* @__PURE__ */ (0, h.jsx)("div", {
1349
- ref: u,
1350
- className: Y.preview,
1661
+ r?.name,
1662
+ a
1663
+ ]), {
1664
+ previewRef: c,
1665
+ previewUrl: n,
1666
+ ...p
1667
+ };
1668
+ }, X = {
1669
+ preview: "_preview_dvanl_1",
1670
+ rotate: "_rotate_dvanl_12",
1671
+ flip: "_flip_dvanl_24",
1672
+ image: "_image_dvanl_32"
1673
+ }, ht = ({ isClipped: e, style: t = {} }) => {
1674
+ let { previewRef: n, previewUrl: r, box: i, boxWidth: a, boxHeight: o, viewWidth: s, viewHeight: c, rotation: l, flipH: u, flipV: d } = mt({ isClipped: e });
1675
+ return /* @__PURE__ */ (0, b.jsx)("div", {
1676
+ ref: n,
1677
+ className: X.preview,
1351
1678
  style: {
1352
- aspectRatio: `${v} / ${y}`,
1679
+ aspectRatio: `${s} / ${c}`,
1353
1680
  ...t
1354
1681
  },
1355
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1356
- className: Y.rotate,
1682
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
1683
+ className: X.rotate,
1357
1684
  style: {
1358
- width: `${g / v * 100}%`,
1359
- height: `${_ / y * 100}%`,
1360
- transform: `translate(-50%, -50%) rotate(${b}deg)`
1685
+ width: `${a / s * 100}%`,
1686
+ height: `${o / c * 100}%`,
1687
+ transform: `translate(-50%, -50%) rotate(${l}deg)`
1361
1688
  },
1362
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1363
- className: Y.flip,
1364
- style: { transform: `scale(${x ? -1 : 1}, ${S ? -1 : 1})` },
1365
- children: /* @__PURE__ */ (0, h.jsx)("img", {
1366
- className: Y.image,
1367
- src: a,
1689
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
1690
+ className: X.flip,
1691
+ style: { transform: `scale(${u ? -1 : 1}, ${d ? -1 : 1})` },
1692
+ children: /* @__PURE__ */ (0, b.jsx)("img", {
1693
+ className: X.image,
1694
+ src: r,
1368
1695
  alt: "Preview Image",
1369
1696
  style: {
1370
- width: `${1 / m.w * 100}%`,
1371
- height: `${1 / m.h * 100}%`,
1372
- left: `${-(m.x / m.w) * 100}%`,
1373
- top: `${-(m.y / m.h) * 100}%`
1697
+ width: `${1 / i.w * 100}%`,
1698
+ height: `${1 / i.h * 100}%`,
1699
+ left: `${-(i.x / i.w) * 100}%`,
1700
+ top: `${-(i.y / i.h) * 100}%`
1374
1701
  }
1375
1702
  })
1376
1703
  })
1377
1704
  })
1378
1705
  });
1379
- }, X = {
1380
- wrapper: "_wrapper_13nh3_1",
1381
- box: "_box_13nh3_9",
1382
- tools: "_tools_13nh3_18",
1383
- toolsInfo: "_toolsInfo_13nh3_34",
1384
- toolsInfoLabel: "_toolsInfoLabel_13nh3_41",
1385
- toolsInfoValue: "_toolsInfoValue_13nh3_46",
1386
- linesBox: "_linesBox_13nh3_51",
1387
- line: "_line_13nh3_51",
1388
- lineV: "_lineV_13nh3_61",
1389
- lineH: "_lineH_13nh3_69",
1390
- pointer: "_pointer_13nh3_77",
1391
- pointerTopLeft: "_pointerTopLeft_13nh3_83",
1392
- pointerTopRight: "_pointerTopRight_13nh3_90",
1393
- pointerBottomRight: "_pointerBottomRight_13nh3_97",
1394
- pointerBottomLeft: "_pointerBottomLeft_13nh3_104",
1395
- mobileBorder: "_mobileBorder_13nh3_111",
1396
- mobilePointer: "_mobilePointer_13nh3_117"
1397
- }, $e = () => {
1398
- let { getLastHistoryItem: e } = A(), t = S(), n = o(null), { handleCropStart: r, initialCrop: i } = ct({ boxRef: n }), { width: a, height: s } = e(), { x: c, y: l, w: u, h: d } = i;
1399
- return /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [/* @__PURE__ */ (0, h.jsx)(Qe, {
1706
+ }, Z = {
1707
+ wrapper: "_wrapper_1yhyo_1",
1708
+ box: "_box_1yhyo_9",
1709
+ tools: "_tools_1yhyo_18",
1710
+ toolsInfo: "_toolsInfo_1yhyo_35",
1711
+ toolsInfoLabel: "_toolsInfoLabel_1yhyo_42",
1712
+ toolsInfoValue: "_toolsInfoValue_1yhyo_47",
1713
+ linesBox: "_linesBox_1yhyo_52",
1714
+ line: "_line_1yhyo_52",
1715
+ lineV: "_lineV_1yhyo_62",
1716
+ lineH: "_lineH_1yhyo_70",
1717
+ pointer: "_pointer_1yhyo_78",
1718
+ pointerTopLeft: "_pointerTopLeft_1yhyo_84",
1719
+ pointerTopRight: "_pointerTopRight_1yhyo_91",
1720
+ pointerBottomRight: "_pointerBottomRight_1yhyo_98",
1721
+ pointerBottomLeft: "_pointerBottomLeft_1yhyo_105",
1722
+ mobileBorder: "_mobileBorder_1yhyo_112",
1723
+ mobilePointer: "_mobilePointer_1yhyo_118",
1724
+ info: "_info_1yhyo_129",
1725
+ infoX: "_infoX_1yhyo_146",
1726
+ infoY: "_infoY_1yhyo_151",
1727
+ infoW: "_infoW_1yhyo_158",
1728
+ infoH: "_infoH_1yhyo_163",
1729
+ group: "_group_1yhyo_170",
1730
+ active: "_active_1yhyo_179"
1731
+ }, gt = () => {
1732
+ let { getLastHistoryItem: e } = P(), t = D(), n = l(null), { handleCropStart: r, initialCrop: i } = Ot({ boxRef: n }), { width: a, height: o } = e(), { x: s, y: c, w: u, h: d } = i;
1733
+ return /* @__PURE__ */ (0, b.jsxs)(b.Fragment, { children: [/* @__PURE__ */ (0, b.jsx)(ht, {
1400
1734
  isClipped: !0,
1401
- style: { clipPath: `xywh(${c}% ${l}% ${u}% ${d}%)` }
1402
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1403
- className: X.wrapper,
1404
- style: { aspectRatio: `${a} / ${s}` },
1405
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1735
+ style: { clipPath: `xywh(${s}% ${c}% ${u}% ${d}%)` }
1736
+ }), /* @__PURE__ */ (0, b.jsx)("div", {
1737
+ className: Z.wrapper,
1738
+ style: { aspectRatio: `${a} / ${o}` },
1739
+ children: /* @__PURE__ */ (0, b.jsxs)("div", {
1406
1740
  ref: n,
1407
- className: X.box,
1741
+ className: Z.box,
1408
1742
  style: {
1409
1743
  width: `${u}%`,
1410
1744
  height: `${d}%`,
1411
- top: `${l}%`,
1412
- left: `${c}%`
1745
+ top: `${c}%`,
1746
+ left: `${s}%`
1413
1747
  },
1414
- children: [/* @__PURE__ */ (0, h.jsx)(tt, {}), t ? /* @__PURE__ */ (0, h.jsx)(lt, { onMouseDown: r }) : /* @__PURE__ */ (0, h.jsx)(nt, { onMouseDown: r })]
1748
+ children: [/* @__PURE__ */ (0, b.jsx)(xt, {}), t ? /* @__PURE__ */ (0, b.jsx)(kt, { onMouseDown: r }) : /* @__PURE__ */ (0, b.jsxs)(b.Fragment, { children: [/* @__PURE__ */ (0, b.jsx)(St, { onMouseDown: r }), /* @__PURE__ */ (0, b.jsx)(At, {})] })]
1415
1749
  })
1416
1750
  })] });
1417
- }, et = () => {
1418
- let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, addToHistory: i, setSidebar: a, eventBus: s } = A(), { width: c, height: l } = n(), u = o(null), d = o(null), f = o(null), p = o(null), m = o({
1751
+ }, _t = [
1752
+ {
1753
+ id: "freeform",
1754
+ icon: /* @__PURE__ */ (0, b.jsx)(N, {}),
1755
+ label: "Freeform"
1756
+ },
1757
+ {
1758
+ id: "origin",
1759
+ icon: /* @__PURE__ */ (0, b.jsx)(ie, {}),
1760
+ label: "Original"
1761
+ },
1762
+ {
1763
+ id: "1:1",
1764
+ icon: /* @__PURE__ */ (0, b.jsx)(ae, {}),
1765
+ label: "1 : 1"
1766
+ },
1767
+ {
1768
+ id: "4:3",
1769
+ icon: /* @__PURE__ */ (0, b.jsx)(se, {}),
1770
+ label: "4 : 3"
1771
+ },
1772
+ {
1773
+ id: "16:9",
1774
+ icon: /* @__PURE__ */ (0, b.jsx)(oe, {}),
1775
+ label: "16 : 9"
1776
+ }
1777
+ ], vt = ({ value: e, onChange: t }) => /* @__PURE__ */ (0, b.jsx)("div", {
1778
+ className: Z.group,
1779
+ children: /* @__PURE__ */ (0, b.jsx)(V, {
1780
+ orientation: "horizontal",
1781
+ className: Z.tooltip,
1782
+ children: _t.map((n) => /* @__PURE__ */ (0, b.jsx)(I, {
1783
+ variant: "outline",
1784
+ className: `${Z.groupBtn} ${e === n.id ? Z.active : ""}`,
1785
+ onClick: () => t(n.id),
1786
+ "aria-label": n.label,
1787
+ "data-tooltip": n.label,
1788
+ children: n.icon
1789
+ }, n.id))
1790
+ })
1791
+ }), yt = () => {
1792
+ let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, addToHistory: r, setSidebar: i, eventBus: a } = P(), { width: s, height: c } = n(), { name: u, args: d } = t || {}, f = u === m.CROP ? d?.id : "", p = s / c, h = l({
1419
1793
  x: 0,
1420
1794
  y: 0,
1421
1795
  w: 0,
1422
1796
  h: 0
1423
1797
  });
1424
- return r(() => {
1425
- if (t?.name !== "crop") return;
1426
- let e = Me(t.args.ratio, c, l), { x: n, y: r, w: i, h: a } = e, o = Math.round(n / 100 * c), h = Math.round(r / 100 * l), g = Math.round(i / 100 * c), _ = Math.round(a / 100 * l);
1427
- m.current = e, u.current && (u.current.textContent = o.toString()), d.current && (d.current.textContent = h.toString()), f.current && (f.current.textContent = g.toString()), p.current && (p.current.textContent = _.toString());
1428
- let v = (e) => {
1429
- let { x: t, y: n, w: r, h: i } = e.detail;
1430
- u.current && (u.current.textContent = t.toString()), d.current && (d.current.textContent = n.toString()), f.current && (f.current.textContent = r.toString()), p.current && (p.current.textContent = i.toString());
1431
- }, y = (e) => {
1432
- m.current = e.detail;
1798
+ return o(() => {
1799
+ if (t?.name !== m.CROP) return;
1800
+ let e = U(t.args.ratio, s, c);
1801
+ h.current = e;
1802
+ let n = (e) => {
1803
+ h.current = e.detail;
1433
1804
  };
1434
- return s.addEventListener("crop-update", v), s.addEventListener("clip-path-update", y), () => {
1435
- s.removeEventListener("crop-update", v), s.removeEventListener("clip-path-update", y);
1805
+ return a.addEventListener("clip-path-update", n), () => {
1806
+ a.removeEventListener("clip-path-update", n);
1436
1807
  };
1437
1808
  }, [
1438
1809
  t,
1810
+ s,
1439
1811
  c,
1440
- l,
1441
- s
1442
- ]), /* @__PURE__ */ (0, h.jsxs)("div", {
1443
- className: X.tools,
1444
- children: [
1445
- /* @__PURE__ */ (0, h.jsxs)("div", {
1446
- className: X.toolsInfo,
1447
- children: [/* @__PURE__ */ (0, h.jsx)("div", {
1448
- className: X.toolsInfoLabel,
1449
- children: "left"
1450
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1451
- className: `${X.toolsInfoValue} ${N.semibold}`,
1452
- ref: u
1453
- })]
1454
- }),
1455
- /* @__PURE__ */ (0, h.jsxs)("div", {
1456
- className: X.toolsInfo,
1457
- children: [/* @__PURE__ */ (0, h.jsx)("div", {
1458
- className: X.toolsInfoLabel,
1459
- children: "top"
1460
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1461
- className: `${X.toolsInfoValue} ${N.semibold}`,
1462
- ref: d
1463
- })]
1464
- }),
1465
- /* @__PURE__ */ (0, h.jsxs)("div", {
1466
- className: X.toolsInfo,
1467
- children: [/* @__PURE__ */ (0, h.jsx)("div", {
1468
- className: X.toolsInfoLabel,
1469
- children: "width"
1470
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1471
- className: `${X.toolsInfoValue} ${N.semibold}`,
1472
- ref: f
1473
- })]
1474
- }),
1475
- /* @__PURE__ */ (0, h.jsxs)("div", {
1476
- className: X.toolsInfo,
1477
- children: [/* @__PURE__ */ (0, h.jsx)("div", {
1478
- className: X.toolsInfoLabel,
1479
- children: "height"
1480
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1481
- className: `${X.toolsInfoValue} ${N.semibold}`,
1482
- ref: p
1483
- })]
1484
- }),
1485
- /* @__PURE__ */ (0, h.jsx)(L, {
1486
- onSave: async () => {
1487
- if (!t || t.name !== w.CROP) return;
1488
- let e = t.args?.preset?.width || Math.round(c * m.current.w / 100), n = t.args?.preset?.height || Math.round(l * m.current.h / 100);
1489
- i({
1490
- width: e,
1491
- height: n,
1492
- action: {
1493
- name: "crop",
1494
- args: {
1495
- ...t.args,
1496
- ...m.current
1497
- }
1498
- }
1499
- }), a(!0);
1500
- },
1501
- onClose: () => {
1502
- e(null), a(!0);
1812
+ a
1813
+ ]), {
1814
+ currentValue: f,
1815
+ handleChange: (t) => {
1816
+ t !== f && (e({
1817
+ name: m.CROP,
1818
+ args: {
1819
+ id: t,
1820
+ ratio: /^\d+:\d+$/.test(t) ? t.split(":").map(Number).reduce((e, t) => e / t) : p,
1821
+ isFree: t === "freeform"
1503
1822
  }
1504
- })
1505
- ]
1823
+ }), i(!0));
1824
+ },
1825
+ handleSave: () => {
1826
+ if (!t || t.name !== m.CROP) return;
1827
+ let e = t.args?.preset?.width || Math.round(s * h.current.w / 100), n = t.args?.preset?.height || Math.round(c * h.current.h / 100);
1828
+ r({
1829
+ width: e,
1830
+ height: n,
1831
+ action: {
1832
+ name: m.CROP,
1833
+ args: {
1834
+ ...t.args,
1835
+ ...h.current
1836
+ }
1837
+ }
1838
+ }), i(!0);
1839
+ },
1840
+ handleClose: () => {
1841
+ e(null), i(!0);
1842
+ }
1843
+ };
1844
+ }, bt = () => {
1845
+ let { currentValue: e, handleChange: t, handleSave: n, handleClose: r } = yt();
1846
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
1847
+ className: Z.tools,
1848
+ children: [/* @__PURE__ */ (0, b.jsx)(vt, {
1849
+ value: e,
1850
+ onChange: t
1851
+ }), /* @__PURE__ */ (0, b.jsx)(z, {
1852
+ onSave: n,
1853
+ onClose: r
1854
+ })]
1506
1855
  });
1507
- }, tt = () => /* @__PURE__ */ (0, h.jsxs)("div", {
1508
- className: X.linesBox,
1509
- children: [/* @__PURE__ */ (0, h.jsx)("span", { className: `${X.line} ${X.lineV}` }), /* @__PURE__ */ (0, h.jsx)("span", { className: `${X.line} ${X.lineH}` })]
1510
- }), nt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [
1511
- /* @__PURE__ */ (0, h.jsx)("div", {
1512
- className: `${X.pointer} ${X.pointerTopLeft}`,
1856
+ }, xt = () => /* @__PURE__ */ (0, b.jsxs)("div", {
1857
+ className: Z.linesBox,
1858
+ children: [/* @__PURE__ */ (0, b.jsx)("span", { className: `${Z.line} ${Z.lineV}` }), /* @__PURE__ */ (0, b.jsx)("span", { className: `${Z.line} ${Z.lineH}` })]
1859
+ }), St = ({ onMouseDown: e }) => /* @__PURE__ */ (0, b.jsxs)(b.Fragment, { children: [
1860
+ /* @__PURE__ */ (0, b.jsx)("div", {
1861
+ className: `${Z.pointer} ${Z.pointerTopLeft}`,
1513
1862
  onMouseDown: (t) => e(t, "tl", "nwse")
1514
1863
  }),
1515
- /* @__PURE__ */ (0, h.jsx)("div", {
1516
- className: `${X.pointer} ${X.pointerTopRight}`,
1864
+ /* @__PURE__ */ (0, b.jsx)("div", {
1865
+ className: `${Z.pointer} ${Z.pointerTopRight}`,
1517
1866
  onMouseDown: (t) => e(t, "tr", "nesw")
1518
1867
  }),
1519
- /* @__PURE__ */ (0, h.jsx)("div", {
1520
- className: `${X.pointer} ${X.pointerBottomRight}`,
1868
+ /* @__PURE__ */ (0, b.jsx)("div", {
1869
+ className: `${Z.pointer} ${Z.pointerBottomRight}`,
1521
1870
  onMouseDown: (t) => e(t, "br", "nwse")
1522
1871
  }),
1523
- /* @__PURE__ */ (0, h.jsx)("div", {
1524
- className: `${X.pointer} ${X.pointerBottomLeft}`,
1872
+ /* @__PURE__ */ (0, b.jsx)("div", {
1873
+ className: `${Z.pointer} ${Z.pointerBottomLeft}`,
1525
1874
  onMouseDown: (t) => e(t, "bl", "nesw")
1526
1875
  })
1527
1876
  ] });
1528
1877
  //#endregion
1529
1878
  //#region src/shared/components/Pixedi/crop/useCropInteraction.ts
1530
- function rt(e, t, n) {
1879
+ function Ct(e, t, n) {
1531
1880
  return Math.min(Math.max(e, t), n);
1532
1881
  }
1533
- function it(e, { x: t, y: n, w: r, h: i }) {
1882
+ function wt(e, { x: t, y: n, w: r, h: i }) {
1534
1883
  e.style.left = `${t}%`, e.style.top = `${n}%`, e.style.width = `${r}%`, e.style.height = `${i}%`;
1535
1884
  }
1536
- function at(e) {
1885
+ function Tt(e) {
1537
1886
  let { width: t, height: n } = e.getBoundingClientRect();
1538
1887
  return {
1539
1888
  frameW: t,
1540
1889
  frameH: n
1541
1890
  };
1542
1891
  }
1543
- function ot({ x: e, y: t, w: n, h: r }, i, a) {
1892
+ function Et({ x: e, y: t, w: n, h: r }, i, a) {
1544
1893
  return {
1545
1894
  x: e / 100 * i,
1546
1895
  y: t / 100 * a,
@@ -1548,7 +1897,7 @@ function ot({ x: e, y: t, w: n, h: r }, i, a) {
1548
1897
  h: r / 100 * a
1549
1898
  };
1550
1899
  }
1551
- function st({ x: e, y: t, w: n, h: r }, i, a) {
1900
+ function Dt({ x: e, y: t, w: n, h: r }, i, a) {
1552
1901
  return {
1553
1902
  x: e / i * 100,
1554
1903
  y: t / a * 100,
@@ -1556,427 +1905,412 @@ function st({ x: e, y: t, w: n, h: r }, i, a) {
1556
1905
  h: r / a * 100
1557
1906
  };
1558
1907
  }
1559
- var ct = ({ boxRef: e }) => {
1560
- let { currentAction: t, getLastHistoryItem: n, eventBus: i } = A(), s = S(), { width: c, height: l } = n(), u = t?.name === w.CROP, d = u ? t.args.ratio : 1, f = !u || t.args.isFree, p = a(() => Me(d, c, l), [
1908
+ var Ot = ({ boxRef: e }) => {
1909
+ let { currentAction: t, getLastHistoryItem: n, eventBus: r } = P(), i = D(), { width: a, height: s } = n(), u = t?.name === m.CROP || t?.name === m.PRESET_CROP, d = u ? t.args.ratio : 1, f = !u || t.args.isFree, p = c(() => U(d, a, s), [
1561
1910
  d,
1562
- c,
1563
- l
1564
- ]), m = o(null), h = o(""), g = o(p), _ = o(p);
1565
- return r(() => {
1566
- g.current = p, Xe(i, p);
1567
- }, [p, i]), r(() => {
1911
+ a,
1912
+ s
1913
+ ]), h = l(null), g = l(""), _ = l(p), v = l(p);
1914
+ return o(() => {
1915
+ _.current = p, ot(r, p);
1916
+ }, [p, r]), o(() => {
1568
1917
  let t = (e, t) => {
1569
- g.current = t, it(e, t), Ye(i, {
1570
- x: Math.round(t.x / 100 * c),
1571
- y: Math.round(t.y / 100 * l),
1572
- w: Math.round(t.w / 100 * c),
1573
- h: Math.round(t.h / 100 * l)
1574
- }), Xe(i, t);
1918
+ _.current = t, wt(e, t), at(r, {
1919
+ x: Math.round(t.x / 100 * a),
1920
+ y: Math.round(t.y / 100 * s),
1921
+ w: Math.round(t.w / 100 * a),
1922
+ h: Math.round(t.h / 100 * s)
1923
+ }), ot(r, t);
1575
1924
  }, n = (e) => {
1576
- e.preventDefault(), _.current = g.current;
1925
+ e.preventDefault(), v.current = _.current;
1577
1926
  let t = "clientX" in e ? e.clientX : e.touches[0].clientX, n = "clientY" in e ? e.clientY : e.touches[0].clientY;
1578
- m.current = {
1927
+ h.current = {
1579
1928
  x: t,
1580
1929
  y: n
1581
1930
  }, document.body.style.cursor = "move";
1582
- }, r = (t) => {
1583
- if (!e.current || !m.current) return;
1931
+ }, i = (t) => {
1932
+ if (!e.current || !h.current) return;
1584
1933
  t.preventDefault();
1585
1934
  let n = e.current, r = n.parentElement;
1586
1935
  if (!r) return;
1587
- let { frameW: i, frameH: s } = at(r);
1588
- if (h.current) {
1589
- a(t, n, i, s);
1936
+ let { frameW: i, frameH: a } = Tt(r);
1937
+ if (g.current) {
1938
+ o(t, n, i, a);
1590
1939
  return;
1591
1940
  }
1592
- o(t, n, i, s);
1593
- }, a = (e, n, r, i) => {
1594
- if (!m.current) return;
1595
- let a = "clientX" in e ? e.clientX : e.touches[0].clientX, o = "clientY" in e ? e.clientY : e.touches[0].clientY, s = st(je(h.current, f, d, m.current.x, m.current.y, a, o, r, i, ot(_.current, r, i), ot(g.current, r, i)), r, i);
1596
- t(n, f ? s : Ne(s, d, c, l));
1941
+ c(t, n, i, a);
1597
1942
  }, o = (e, n, r, i) => {
1598
- if (!m.current) return;
1599
- let { x: a, y: o, w: s, h: c } = _.current, l = "clientX" in e ? e.clientX : e.touches[0].clientX, u = "clientY" in e ? e.clientY : e.touches[0].clientY, d = (l - m.current.x) / r * 100, f = (u - m.current.y) / i * 100;
1943
+ if (!h.current) return;
1944
+ let o = "clientX" in e ? e.clientX : e.touches[0].clientX, c = "clientY" in e ? e.clientY : e.touches[0].clientY, l = Dt(Fe(g.current, f, d, h.current.x, h.current.y, o, c, r, i, Et(v.current, r, i), Et(_.current, r, i)), r, i);
1945
+ t(n, f ? l : Ie(l, d, a, s));
1946
+ }, c = (e, n, r, i) => {
1947
+ if (!h.current) return;
1948
+ let { x: a, y: o, w: s, h: c } = v.current, l = "clientX" in e ? e.clientX : e.touches[0].clientX, u = "clientY" in e ? e.clientY : e.touches[0].clientY, d = (l - h.current.x) / r * 100, f = (u - h.current.y) / i * 100;
1600
1949
  t(n, {
1601
- x: rt(a + d, 0, Math.max(0, 100 - s)),
1602
- y: rt(o + f, 0, Math.max(0, 100 - c)),
1950
+ x: Ct(a + d, 0, Math.max(0, 100 - s)),
1951
+ y: Ct(o + f, 0, Math.max(0, 100 - c)),
1603
1952
  w: s,
1604
1953
  h: c
1605
1954
  });
1606
- }, s = () => {
1607
- e.current && (m.current = null, h.current = "", e.current.style.cursor = "move", document.body.style.cursor = "auto");
1955
+ }, l = () => {
1956
+ e.current && (h.current = null, g.current = "", e.current.style.cursor = "move", document.body.style.cursor = "auto");
1608
1957
  };
1609
1958
  if (!e.current) return;
1610
1959
  let u = new AbortController(), { signal: p } = u;
1611
1960
  return e.current.addEventListener("mousedown", n, { signal: p }), e.current.addEventListener("touchstart", n, {
1612
1961
  signal: p,
1613
1962
  passive: !1
1614
- }), document.addEventListener("mousemove", r, { signal: p }), document.addEventListener("touchmove", r, {
1963
+ }), document.addEventListener("mousemove", i, { signal: p }), document.addEventListener("touchmove", i, {
1615
1964
  signal: p,
1616
1965
  passive: !1
1617
- }), document.addEventListener("mouseup", s, { signal: p }), document.addEventListener("touchend", s, { signal: p }), () => u.abort();
1966
+ }), document.addEventListener("mouseup", l, { signal: p }), document.addEventListener("touchend", l, { signal: p }), () => u.abort();
1618
1967
  }, [
1619
1968
  f,
1620
1969
  d,
1621
- c,
1622
- l,
1970
+ a,
1971
+ s,
1623
1972
  e,
1624
- i
1973
+ r
1625
1974
  ]), {
1626
1975
  handleCropStart: (t, n, r) => {
1627
1976
  if (!e.current) return;
1628
- t.stopPropagation(), t.preventDefault(), _.current = g.current;
1629
- let i = "clientX" in t ? t.clientX : t.touches[0].clientX, a = "clientY" in t ? t.clientY : t.touches[0].clientY;
1630
- m.current = {
1631
- x: i,
1632
- y: a
1633
- }, h.current = n, s || (e.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
1977
+ t.stopPropagation(), t.preventDefault(), v.current = _.current;
1978
+ let a = "clientX" in t ? t.clientX : t.touches[0].clientX, o = "clientY" in t ? t.clientY : t.touches[0].clientY;
1979
+ h.current = {
1980
+ x: a,
1981
+ y: o
1982
+ }, g.current = n, i || (e.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
1634
1983
  },
1635
1984
  initialCrop: p
1636
1985
  };
1637
- }, lt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, h.jsx)("div", {
1638
- className: X.mobileBorder,
1639
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1640
- className: X.mobilePointer,
1986
+ }, kt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, b.jsx)("div", {
1987
+ className: Z.mobileBorder,
1988
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
1989
+ className: Z.mobilePointer,
1641
1990
  onTouchStart: (t) => e(t, "br", "nwse")
1642
1991
  })
1643
- }), Z = {
1644
- flip: "_flip_17ic5_1",
1645
- btnH: "_btnH_17ic5_14",
1646
- btnV: "_btnV_17ic5_20"
1647
- }, ut = () => {
1648
- let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r } = A(), [i, a] = s(!1), [o, c] = s(!1), { width: l, height: u } = e();
1649
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1650
- className: Z.flip,
1651
- children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1652
- className: Z.scGroup,
1653
- children: [/* @__PURE__ */ (0, h.jsx)(M, {
1654
- variant: "outline",
1655
- className: `${Z.btnH}`,
1656
- onClick: () => {
1657
- a((e) => !e), t({
1658
- name: w.FLIP,
1659
- args: {
1660
- horizontal: !i,
1661
- vertical: o
1662
- }
1663
- });
1664
- },
1665
- children: /* @__PURE__ */ (0, h.jsx)(le, { style: { color: i ? "var(--accent-blue)" : "var(--foreground)" } })
1666
- }), /* @__PURE__ */ (0, h.jsx)(M, {
1667
- variant: "outline",
1668
- className: `${Z.btnV} `,
1669
- onClick: () => {
1670
- c((e) => !e), t({
1671
- name: w.FLIP,
1672
- args: {
1673
- horizontal: i,
1674
- vertical: !o
1675
- }
1676
- });
1677
- },
1678
- children: /* @__PURE__ */ (0, h.jsx)(ue, { style: { color: o ? "var(--accent-blue)" : "var(--foreground)" } })
1679
- })]
1680
- }), /* @__PURE__ */ (0, h.jsx)(L, {
1681
- disabled: !i && !o,
1682
- onSave: () => {
1683
- n({
1684
- width: l,
1685
- height: u,
1686
- action: {
1687
- name: w.FLIP,
1688
- args: {
1689
- horizontal: i,
1690
- vertical: o
1691
- }
1692
- }
1693
- }), r(!0);
1694
- },
1695
- onClose: () => {
1696
- t(null), r(!0);
1697
- }
1698
- })]
1992
+ }), At = () => {
1993
+ let e = l(null), t = l(null), n = l(null), r = l(null), { currentAction: i, getLastHistoryItem: a, eventBus: s } = P(), { width: c, height: u } = a();
1994
+ return o(() => {
1995
+ if (!(i?.name === m.CROP || i?.name === m.PRESET_CROP)) return;
1996
+ let { xP: a, yP: o, wP: l, hP: d } = U(i.args.ratio, c, u);
1997
+ e.current && (e.current.textContent = a.toString()), t.current && (t.current.textContent = o.toString()), n.current && (n.current.textContent = l.toString()), r.current && (r.current.textContent = d.toString());
1998
+ let f = (i) => {
1999
+ let { x: a, y: o, w: s, h: c } = i.detail;
2000
+ e.current && (e.current.textContent = a.toString()), t.current && (t.current.textContent = o.toString()), n.current && (n.current.textContent = s.toString()), r.current && (r.current.textContent = c.toString());
2001
+ };
2002
+ return s.addEventListener("crop-update", f), () => {
2003
+ s.removeEventListener("crop-update", f);
2004
+ };
2005
+ }, [
2006
+ i,
2007
+ u,
2008
+ c,
2009
+ s
2010
+ ]), /* @__PURE__ */ (0, b.jsxs)(b.Fragment, { children: [
2011
+ /* @__PURE__ */ (0, b.jsx)("div", {
2012
+ className: `${Z.info} ${Z.infoX}`,
2013
+ children: /* @__PURE__ */ (0, b.jsx)("b", { ref: e })
2014
+ }),
2015
+ /* @__PURE__ */ (0, b.jsx)("div", {
2016
+ className: `${Z.info} ${Z.infoY}`,
2017
+ children: /* @__PURE__ */ (0, b.jsx)("b", { ref: t })
2018
+ }),
2019
+ /* @__PURE__ */ (0, b.jsx)("div", {
2020
+ className: `${Z.info} ${Z.infoW}`,
2021
+ children: /* @__PURE__ */ (0, b.jsx)("b", { ref: n })
2022
+ }),
2023
+ /* @__PURE__ */ (0, b.jsx)("div", {
2024
+ className: `${Z.info} ${Z.infoH}`,
2025
+ children: /* @__PURE__ */ (0, b.jsx)("b", { ref: r })
2026
+ })
2027
+ ] });
2028
+ }, jt = ke.map((e) => e.options).flat(), Mt = () => jt, Nt = () => {
2029
+ let { currentAction: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i, eventBus: a } = P(), { width: s, height: c } = t(), u = e?.name === m.PRESET_CROP && jt.some((t) => t.value === e.args.id) ? e.args.id : "", d = l({
2030
+ x: 0,
2031
+ y: 0,
2032
+ w: 0,
2033
+ h: 0
1699
2034
  });
1700
- }, Q = {
1701
- rotate: "_rotate_gkt07_1",
1702
- btnH: "_btnH_gkt07_14",
1703
- btnV: "_btnV_gkt07_20"
1704
- }, dt = () => {
1705
- let { getLastRotation: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i } = A(), { width: a, height: s } = t(), c = e(), l = o(c), u = o(c), d = (e) => {
1706
- u.current += e, i({
1707
- name: "rotate",
1708
- args: { degrees: u.current }
1709
- });
1710
- };
1711
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1712
- className: Q.rotate,
1713
- children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1714
- className: Q.scGroup,
1715
- children: [/* @__PURE__ */ (0, h.jsx)(M, {
1716
- variant: "outline",
1717
- className: `${Q.btnH}`,
1718
- onClick: () => d(90),
1719
- children: /* @__PURE__ */ (0, h.jsx)(de, {})
1720
- }), /* @__PURE__ */ (0, h.jsx)(M, {
1721
- variant: "outline",
1722
- className: `${Q.btnV} `,
1723
- onClick: () => d(-90),
1724
- children: /* @__PURE__ */ (0, h.jsx)(fe, {})
1725
- })]
1726
- }), /* @__PURE__ */ (0, h.jsx)(L, {
1727
- onSave: async () => {
1728
- n({
1729
- ...Pe(a, s, l.current, u.current),
1730
- action: {
1731
- name: "rotate",
1732
- args: { degrees: u.current }
2035
+ return o(() => {
2036
+ if (e?.name !== m.PRESET_CROP) return;
2037
+ let t = U(e.args.ratio, s, c);
2038
+ d.current = t;
2039
+ let n = (e) => {
2040
+ d.current = e.detail;
2041
+ };
2042
+ return a.addEventListener("clip-path-update", n), () => {
2043
+ a.removeEventListener("clip-path-update", n);
2044
+ };
2045
+ }, [
2046
+ e,
2047
+ s,
2048
+ c,
2049
+ a
2050
+ ]), {
2051
+ currentValue: u,
2052
+ presetsData: ke,
2053
+ handleChange: (e) => {
2054
+ if (!e) return;
2055
+ let t = Mt().find((t) => t.value === e);
2056
+ if (!t) return;
2057
+ let n = {
2058
+ id: e,
2059
+ ratio: t.w / t.h,
2060
+ isFree: !1,
2061
+ preset: {
2062
+ width: t.w,
2063
+ height: t.h
2064
+ }
2065
+ };
2066
+ i({
2067
+ name: m.PRESET_CROP,
2068
+ args: n
2069
+ });
2070
+ },
2071
+ handleSave: () => {
2072
+ !e || e.name !== m.PRESET_CROP || (n({
2073
+ width: e.args?.preset?.width || 0,
2074
+ height: e.args?.preset?.height || 0,
2075
+ action: {
2076
+ name: m.CROP,
2077
+ args: {
2078
+ ...e.args,
2079
+ ...d.current
1733
2080
  }
1734
- }), r(!0);
1735
- },
1736
- onClose: () => {
1737
- i(null), r(!0);
1738
- }
1739
- })]
1740
- });
1741
- }, ft = { frame: "_frame_xffug_1" }, pt = () => {
1742
- let { currentAction: e } = A(), t = e?.name === w.CROP, n = e?.name === w.RESIZE, r = e?.name === w.FLIP, i = e?.name === w.ROTATE, a = t;
1743
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1744
- className: `${ft.frame} ${a ? N.mask : ""}`,
1745
- children: [
1746
- /* @__PURE__ */ (0, h.jsx)(Qe, { style: t ? { opacity: .4 } : {} }),
1747
- t && /* @__PURE__ */ (0, h.jsx)($e, {}, e?.args?.id),
1748
- n && /* @__PURE__ */ (0, h.jsx)(Ze, {}),
1749
- t && /* @__PURE__ */ (0, h.jsx)(et, {}),
1750
- r && /* @__PURE__ */ (0, h.jsx)(ut, {}),
1751
- i && /* @__PURE__ */ (0, h.jsx)(dt, {})
1752
- ]
1753
- });
1754
- }, $ = {
1755
- sidebar: "_sidebar_8qtha_1",
1756
- settings: "_settings_8qtha_11",
1757
- container: "_container_8qtha_25",
1758
- content: "_content_8qtha_31",
1759
- closeBtn: "_closeBtn_8qtha_47",
1760
- separator: "_separator_8qtha_52",
1761
- resize: "_resize_8qtha_56",
1762
- resizeIcon: "_resizeIcon_8qtha_61",
1763
- resizeSize: "_resizeSize_8qtha_66",
1764
- crop: "_crop_8qtha_70",
1765
- ratio: "_ratio_8qtha_75",
1766
- sidebarPreset: "_sidebarPreset_8qtha_80",
1767
- flipRotate: "_flipRotate_8qtha_85"
1768
- }, mt = () => {
1769
- let { getLastHistoryItem: e, setCurrentAction: t, setSidebar: n } = A(), { width: r, height: i } = e() ?? {
1770
- width: 0,
1771
- height: 0
1772
- };
1773
- return /* @__PURE__ */ (0, h.jsxs)(M, {
1774
- variant: "outline",
1775
- className: $.resize,
1776
- onClick: () => {
1777
- t({
1778
- name: w.RESIZE,
1779
- args: {
1780
- width: r,
1781
- height: i
1782
2081
  }
1783
- }), n(!1);
2082
+ }), r(!0));
1784
2083
  },
1785
- children: [/* @__PURE__ */ (0, h.jsxs)("div", {
1786
- className: $.resizeIcon,
1787
- children: [/* @__PURE__ */ (0, h.jsx)(ce, {}), "Resize"]
1788
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
1789
- className: $.resizeSize,
1790
- children: [
1791
- r,
1792
- " x ",
1793
- i
1794
- ]
2084
+ handleClose: () => {
2085
+ i(null), r(!0);
2086
+ }
2087
+ };
2088
+ }, Pt = {
2089
+ preset: "_preset_1rbuc_1",
2090
+ select: "_select_1rbuc_14"
2091
+ }, Ft = () => {
2092
+ let { currentValue: e, presetsData: t, handleChange: n, handleSave: r, handleClose: i } = Nt();
2093
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
2094
+ className: Pt.preset,
2095
+ children: [/* @__PURE__ */ (0, b.jsx)(be, {
2096
+ value: e,
2097
+ placeholder: "Select a preset",
2098
+ onChange: n,
2099
+ items: t,
2100
+ className: Pt.select
2101
+ }), /* @__PURE__ */ (0, b.jsx)(z, {
2102
+ onSave: r,
2103
+ onClose: i
1795
2104
  })]
1796
2105
  });
1797
- }, ht = () => {
1798
- let { currentAction: e, setCurrentAction: t, getLastHistoryItem: n, setSidebar: r } = A(), { name: i, args: a } = e || {}, o = i === "crop" ? a?.id : "", { width: s, height: c } = n(), l = s / c, u = (e) => {
1799
- e !== o && (t({
1800
- name: "crop",
2106
+ }, It = () => {
2107
+ let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r } = P(), { width: i, height: a } = e(), [o, s] = u(!1), [c, l] = u(!1), d = (e, n) => {
2108
+ t({
2109
+ name: m.FLIP,
1801
2110
  args: {
1802
- id: e,
1803
- ratio: e === "1:1" ? 1 : l,
1804
- isFree: e === "freeform"
2111
+ horizontal: e,
2112
+ vertical: n
1805
2113
  }
1806
- }), r(!1));
2114
+ });
1807
2115
  };
1808
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1809
- className: $.crop,
1810
- children: [/* @__PURE__ */ (0, h.jsx)("h4", { children: "Crop" }), /* @__PURE__ */ (0, h.jsxs)("div", {
1811
- className: $.ratio,
1812
- children: [
1813
- /* @__PURE__ */ (0, h.jsx)(P, {
1814
- label: "Freeform",
1815
- icon: /* @__PURE__ */ (0, h.jsx)(ae, {}),
1816
- active: o === "freeform",
1817
- onClick: () => u("freeform")
1818
- }),
1819
- /* @__PURE__ */ (0, h.jsx)(P, {
1820
- label: "Original",
1821
- icon: /* @__PURE__ */ (0, h.jsx)(oe, {}),
1822
- active: o === "original",
1823
- onClick: () => u("original")
1824
- }),
1825
- /* @__PURE__ */ (0, h.jsx)(P, {
1826
- label: "1:1",
1827
- icon: /* @__PURE__ */ (0, h.jsx)(se, {}),
1828
- active: o === "1:1",
1829
- onClick: () => u("1:1")
1830
- })
1831
- ]
1832
- })]
1833
- });
1834
- }, gt = Te.map((e) => e.options).flat(), _t = () => {
1835
- let { setCurrentAction: e, currentAction: t, setSidebar: n } = A(), r = t?.name === "crop" && gt.some((e) => e.value === t.args.id) ? t.args.id : "";
1836
- return /* @__PURE__ */ (0, h.jsxs)("div", {
1837
- className: $.sidebarPreset,
1838
- children: [/* @__PURE__ */ (0, h.jsx)("h4", { children: "Presets" }), /* @__PURE__ */ (0, h.jsx)("div", { children: /* @__PURE__ */ (0, h.jsx)(ge, {
1839
- value: r,
1840
- placeholder: "Select a preset",
1841
- onChange: (t) => {
1842
- if (!t) return;
1843
- let r = Te.map((e) => e.options).flat().find((e) => e.value === t);
1844
- if (!r) return;
1845
- let i = {
1846
- id: t,
1847
- ratio: r.w / r.h,
1848
- isFree: !1,
1849
- preset: {
1850
- width: r.w,
1851
- height: r.h
2116
+ return {
2117
+ flipHorizontal: o,
2118
+ flipVertical: c,
2119
+ handleFlipHorizontal: () => {
2120
+ let e = !o;
2121
+ s(e), d(e, c);
2122
+ },
2123
+ handleFlipVertical: () => {
2124
+ let e = !c;
2125
+ l(e), d(o, e);
2126
+ },
2127
+ handleSave: () => {
2128
+ n({
2129
+ width: i,
2130
+ height: a,
2131
+ action: {
2132
+ name: m.FLIP,
2133
+ args: {
2134
+ horizontal: o,
2135
+ vertical: c
1852
2136
  }
1853
- };
1854
- e({
1855
- name: "crop",
1856
- args: i
1857
- }), n(!1);
1858
- },
1859
- items: Te
1860
- }) })]
1861
- });
1862
- }, vt = () => {
1863
- let { setCurrentAction: e, setSidebar: t } = A();
1864
- return /* @__PURE__ */ (0, h.jsx)(M, {
1865
- variant: "outline",
1866
- className: $.resize,
1867
- onClick: () => {
1868
- e({
1869
- name: w.FLIP,
1870
- args: {
1871
- horizontal: !1,
1872
- vertical: !1
1873
2137
  }
1874
- }), t(!1);
2138
+ }), r(!0);
1875
2139
  },
1876
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1877
- className: $.resizeIcon,
1878
- children: [/* @__PURE__ */ (0, h.jsx)(le, {}), "Flip"]
1879
- })
2140
+ handleClose: () => {
2141
+ t(null), r(!0);
2142
+ }
2143
+ };
2144
+ }, Q = {
2145
+ flip: "_flip_17ic5_1",
2146
+ btnH: "_btnH_17ic5_14",
2147
+ btnV: "_btnV_17ic5_20"
2148
+ }, Lt = () => {
2149
+ let { flipHorizontal: e, flipVertical: t, handleFlipHorizontal: n, handleFlipVertical: r, handleSave: i, handleClose: a } = It();
2150
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
2151
+ className: Q.flip,
2152
+ children: [/* @__PURE__ */ (0, b.jsx)("div", {
2153
+ className: Q.scGroup,
2154
+ children: /* @__PURE__ */ (0, b.jsxs)(V, {
2155
+ orientation: "horizontal",
2156
+ className: Q.tooltip,
2157
+ children: [/* @__PURE__ */ (0, b.jsx)(I, {
2158
+ variant: "outline",
2159
+ className: Q.btnH,
2160
+ onClick: n,
2161
+ "aria-label": "Horizontal",
2162
+ "data-tooltip": "Horizontal",
2163
+ children: /* @__PURE__ */ (0, b.jsx)(le, { style: { color: e ? "var(--accent-blue)" : "var(--foreground)" } })
2164
+ }), /* @__PURE__ */ (0, b.jsx)(I, {
2165
+ variant: "outline",
2166
+ className: Q.btnV,
2167
+ onClick: r,
2168
+ "aria-label": "Vertical",
2169
+ "data-tooltip": "Vertical",
2170
+ children: /* @__PURE__ */ (0, b.jsx)(ue, { style: { color: t ? "var(--accent-blue)" : "var(--foreground)" } })
2171
+ })]
2172
+ })
2173
+ }), /* @__PURE__ */ (0, b.jsx)(z, {
2174
+ disabled: !e && !t,
2175
+ onSave: i,
2176
+ onClose: a
2177
+ })]
1880
2178
  });
1881
- }, yt = () => {
1882
- let { getLastRotation: e, setCurrentAction: t, setSidebar: n } = A();
1883
- return /* @__PURE__ */ (0, h.jsx)(M, {
1884
- variant: "outline",
1885
- className: $.resize,
1886
- onClick: () => {
1887
- t({
1888
- name: "rotate",
1889
- args: { degrees: e() }
1890
- }), n(!1);
2179
+ }, Rt = () => {
2180
+ let { getLastRotation: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i } = P(), { width: a, height: o } = t(), s = e(), c = l(s), u = l(s);
2181
+ return {
2182
+ handleRotate: (e) => {
2183
+ u.current += e, i({
2184
+ name: m.ROTATE,
2185
+ args: { degrees: u.current }
2186
+ });
1891
2187
  },
1892
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1893
- className: $.resizeIcon,
1894
- children: [/* @__PURE__ */ (0, h.jsx)(de, {}), "Rotate"]
1895
- })
2188
+ handleSave: () => {
2189
+ n({
2190
+ ...Le(a, o, c.current, u.current),
2191
+ action: {
2192
+ name: m.ROTATE,
2193
+ args: { degrees: u.current }
2194
+ }
2195
+ }), r(!0);
2196
+ },
2197
+ handleClose: () => {
2198
+ i(null), r(!0);
2199
+ }
2200
+ };
2201
+ }, $ = {
2202
+ rotate: "_rotate_gkt07_1",
2203
+ btnH: "_btnH_gkt07_14",
2204
+ btnV: "_btnV_gkt07_20"
2205
+ }, zt = () => {
2206
+ let { handleRotate: e, handleSave: t, handleClose: n } = Rt();
2207
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
2208
+ className: $.rotate,
2209
+ children: [/* @__PURE__ */ (0, b.jsx)("div", {
2210
+ className: $.scGroup,
2211
+ children: /* @__PURE__ */ (0, b.jsxs)(V, {
2212
+ orientation: "horizontal",
2213
+ className: $.tooltip,
2214
+ children: [/* @__PURE__ */ (0, b.jsx)(I, {
2215
+ variant: "outline",
2216
+ className: $.btnH,
2217
+ onClick: () => e(90),
2218
+ "aria-label": "+90°",
2219
+ "data-tooltip": "+90°",
2220
+ children: /* @__PURE__ */ (0, b.jsx)(de, {})
2221
+ }), /* @__PURE__ */ (0, b.jsx)(I, {
2222
+ variant: "outline",
2223
+ className: $.btnV,
2224
+ onClick: () => e(-90),
2225
+ "aria-label": "-90°",
2226
+ "data-tooltip": "-90°",
2227
+ children: /* @__PURE__ */ (0, b.jsx)(fe, {})
2228
+ })]
2229
+ })
2230
+ }), /* @__PURE__ */ (0, b.jsx)(z, {
2231
+ onSave: t,
2232
+ onClose: n
2233
+ })]
1896
2234
  });
1897
- }, bt = () => {
1898
- let { sidebar: e, setSidebar: t } = A(), n = ee("md");
1899
- return /* @__PURE__ */ (0, h.jsxs)(h.Fragment, { children: [/* @__PURE__ */ (0, h.jsx)(M, {
1900
- variant: "outline",
1901
- className: $.settings,
1902
- onClick: () => t(!0),
1903
- children: /* @__PURE__ */ (0, h.jsx)(ie, {})
1904
- }), /* @__PURE__ */ (0, h.jsx)("div", {
1905
- className: $.sidebar,
1906
- style: { transform: n && e ? "translateX(-320px)" : "translateX(0%)" },
1907
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1908
- className: $.container,
1909
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1910
- className: $.content,
1911
- children: [
1912
- n && /* @__PURE__ */ (0, h.jsx)(M, {
1913
- variant: "ghost",
1914
- className: `${$.closeBtn} ${j.rect}`,
1915
- onClick: () => t(!1),
1916
- children: /* @__PURE__ */ (0, h.jsx)(te, {})
1917
- }),
1918
- /* @__PURE__ */ (0, h.jsx)(mt, {}),
1919
- /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1920
- /* @__PURE__ */ (0, h.jsx)(ht, {}),
1921
- /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1922
- /* @__PURE__ */ (0, h.jsx)(_t, {}),
1923
- /* @__PURE__ */ (0, h.jsx)(F, { className: $.separator }),
1924
- /* @__PURE__ */ (0, h.jsxs)("div", {
1925
- className: $.flipRotate,
1926
- children: [/* @__PURE__ */ (0, h.jsx)(vt, {}), /* @__PURE__ */ (0, h.jsx)(yt, {})]
1927
- })
1928
- ]
2235
+ }, Bt = { frame: "_frame_15mog_1" }, Vt = () => {
2236
+ let { currentAction: e } = P(), t = e?.name === m.RESIZE, n = e?.name === m.CROP, r = e?.name === m.PRESET_CROP, i = e?.name === m.FLIP, a = e?.name === m.ROTATE, o = n || r;
2237
+ return /* @__PURE__ */ (0, b.jsxs)("div", {
2238
+ className: `${Bt.frame} ${o ? R.mask : ""}`,
2239
+ children: [
2240
+ /* @__PURE__ */ (0, b.jsx)(ht, { style: o ? { opacity: .4 } : {} }),
2241
+ t && /* @__PURE__ */ (0, b.jsx)(pt, {}),
2242
+ (n || r) && /* @__PURE__ */ (0, b.jsx)(gt, {}, e?.args?.id),
2243
+ n && /* @__PURE__ */ (0, b.jsx)(bt, {}),
2244
+ r && /* @__PURE__ */ (0, b.jsx)(Ft, {}),
2245
+ i && /* @__PURE__ */ (0, b.jsx)(Lt, {}),
2246
+ a && /* @__PURE__ */ (0, b.jsx)(zt, {})
2247
+ ]
2248
+ });
2249
+ }, Ht = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = h }) => {
2250
+ let [a, o] = u(null), s = O("sm", a), c = {
2251
+ ...h,
2252
+ ...i
2253
+ }, { loading: l, error: d, mimeType: f, width: p, height: m, originalBlob: g, previewUrl: _, isAlpha: v } = T({
2254
+ src: e,
2255
+ skip: c?.tools?.length === 0
2256
+ });
2257
+ return c?.tools?.length === 0 ? /* @__PURE__ */ (0, b.jsx)("div", {
2258
+ className: `${R.root} ${R.wrapper}`,
2259
+ "data-theme": r,
2260
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
2261
+ className: R.system,
2262
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
2263
+ className: R.textRed,
2264
+ children: "No tools selected."
1929
2265
  })
1930
2266
  })
1931
- })] });
1932
- }, xt = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = u }) => {
1933
- let { loading: a, error: o, mimeType: s, width: c, height: l, originalBlob: d, previewUrl: f, isAlpha: p } = b(e);
1934
- return a || o || !d || !s ? /* @__PURE__ */ (0, h.jsx)("div", {
1935
- className: `${N.root} ${N.wrapper}`,
2267
+ }) : l || d || !g || !f ? /* @__PURE__ */ (0, b.jsx)("div", {
2268
+ className: `${R.root} ${R.wrapper}`,
1936
2269
  "data-theme": r,
1937
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1938
- className: N.system,
2270
+ children: /* @__PURE__ */ (0, b.jsxs)("div", {
2271
+ className: R.system,
1939
2272
  children: [
1940
- a && /* @__PURE__ */ (0, h.jsx)(pe, { style: {
2273
+ l && /* @__PURE__ */ (0, b.jsx)(ge, { style: {
1941
2274
  width: 48,
1942
2275
  height: 48
1943
2276
  } }),
1944
- o && /* @__PURE__ */ (0, h.jsx)("div", {
1945
- className: N.textRed,
1946
- children: o
2277
+ d && /* @__PURE__ */ (0, b.jsx)("div", {
2278
+ className: R.textRed,
2279
+ children: d
1947
2280
  }),
1948
- !a && !o && (!d || !s) && /* @__PURE__ */ (0, h.jsx)("div", {
1949
- className: N.textRed,
2281
+ !l && !d && (!g || !f) && /* @__PURE__ */ (0, b.jsx)("div", {
2282
+ className: R.textRed,
1950
2283
  children: "Failed to load image."
1951
2284
  })
1952
2285
  ]
1953
2286
  })
1954
- }) : /* @__PURE__ */ (0, h.jsx)(g, {
1955
- mimeType: s,
1956
- width: c,
1957
- height: l,
1958
- originalBlob: d,
1959
- previewUrl: f,
1960
- isAlpha: p,
1961
- settings: {
1962
- ...u,
1963
- ...i
1964
- },
1965
- children: /* @__PURE__ */ (0, h.jsx)("div", {
1966
- className: `${N.root} ${N.wrapper}`,
2287
+ }) : /* @__PURE__ */ (0, b.jsx)(x, {
2288
+ mimeType: f,
2289
+ width: p,
2290
+ height: m,
2291
+ originalBlob: g,
2292
+ previewUrl: _,
2293
+ isAlpha: v,
2294
+ settings: c,
2295
+ children: /* @__PURE__ */ (0, b.jsx)("div", {
2296
+ ref: o,
2297
+ className: `${R.root} ${R.wrapper}`,
1967
2298
  "data-theme": r,
1968
- children: /* @__PURE__ */ (0, h.jsxs)("div", {
1969
- className: N.main,
1970
- children: [/* @__PURE__ */ (0, h.jsx)(Je, {
1971
- onSave: t,
1972
- onBack: n
1973
- }), /* @__PURE__ */ (0, h.jsxs)("div", {
1974
- className: N.grid,
1975
- children: [/* @__PURE__ */ (0, h.jsx)(pt, {}), /* @__PURE__ */ (0, h.jsx)(bt, {})]
1976
- })]
2299
+ children: /* @__PURE__ */ (0, b.jsxs)("div", {
2300
+ className: `${c?.infobar ? R.grid : R.gridNoInfobar} ${s ? R.mobile : ""}`,
2301
+ children: [
2302
+ /* @__PURE__ */ (0, b.jsx)(Ze, {
2303
+ onSave: t,
2304
+ onBack: n,
2305
+ isMobile: s
2306
+ }),
2307
+ /* @__PURE__ */ (0, b.jsx)(tt, { isMobile: s }),
2308
+ c?.infobar && /* @__PURE__ */ (0, b.jsx)(it, {}),
2309
+ /* @__PURE__ */ (0, b.jsx)(Vt, {})
2310
+ ]
1977
2311
  })
1978
2312
  })
1979
2313
  });
1980
2314
  };
1981
2315
  //#endregion
1982
- export { xt as Pixedi };
2316
+ export { Ht as Pixedi };