pixedi 1.7.1 → 1.9.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,56 +1,225 @@
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_1qifp_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) 65%, 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);--background-fade:color-mix(in srgb, var(--background) 65%, transparent);--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);--surface-border:solid 1px transparent;position:relative}._root_1qifp_8[data-theme=dark]{--color-white-fade:color-mix(in srgb, var(--color-white) 45%, transparent);--background:oklch(24.5% 0 0);--background-fade:color-mix(in srgb, var(--background) 70%, transparent);--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(29.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);--surface-border:solid 1px var(--border)}._root_1qifp_8 h1,._root_1qifp_8 h2,._root_1qifp_8 h3,._root_1qifp_8 h4,._root_1qifp_8 h5,._root_1qifp_8 h6{color:var(--foreground);margin:0;font-weight:600}._textRed_1qifp_78{color:var(--color-red)}._bgRed_1qifp_81{background-color:var(--color-red)}._bgGreen_1qifp_84{background-color:var(--color-green)}._textGreen_1qifp_87{color:var(--color-green)}._mask_1qifp_90{background-color:var(--overlay-bg)}._semibold_1qifp_93{letter-spacing:.4px;font-weight:600}._bold_1qifp_97{letter-spacing:.4px;font-weight:700}._system_1qifp_101{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_1qifp_111{width:100%;height:100%;min-height:480px;position:relative;overflow:hidden}._grid_1qifp_118{background:var(--background);grid-template:"header header"48px"sidebar frame"1fr"sidebar infobar"32px/48px 1fr;height:100%;display:grid;position:relative}._grid_1qifp_118._mobile_1qifp_130{grid-template-columns:0 1fr}._gridNoInfobar_1qifp_134{grid-template:"header header"48px"sidebar frame"1fr/48px 1fr;height:100%;display:grid;position:relative}._gridNoInfobar_1qifp_134._mobile_1qifp_130{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}._sliderContainer_1unyb_1{cursor:pointer;touch-action:none;--slider-progress:0%;align-items:center;width:100%;height:24px;display:flex;position:relative}._sliderContainer_1unyb_1._disabled_1unyb_11{pointer-events:none;cursor:not-allowed;opacity:.5}._sliderContainer_1unyb_1:not(._disabled_1unyb_11):hover ._sliderThumb_1unyb_17{transform:translate(-50%,-50%)scale(1.1)}._sliderTrack_1unyb_22{background-color:color-mix(in oklch, var(--muted-foreground) 65%, transparent);border-radius:2px;width:100%;height:2px;position:relative}._sliderRange_1unyb_34{background-color:var(--primary);height:100%;width:var(--slider-progress);border-radius:2px;position:absolute}._sliderThumb_1unyb_17{top:50%;left:var(--slider-progress);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;transform:translate(-50%,-50%)}._sliderTooltip_1unyb_58{top:-40px;left:var(--slider-progress);background-color:var(--foreground);color:var(--background,#000);white-space:nowrap;pointer-events:none;z-index:2;border-radius:4px;padding:7px 10px 8px;font-size:12px;line-height:1;position:absolute;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._sliderTooltip_1unyb_58:after{content:"";background-color:var(--foreground);width:6px;height:6px;position:absolute;bottom:-2px;left:50%;transform:translate(-50%)rotate(45deg)}._hiddenInput_1unyb_86{opacity:0;cursor:pointer;z-index:1;width:100%;height:100%;margin:0;position:absolute;top:0;left:0}._tooltip_1rdl9_1{position:relative}._container_1rdl9_5{gap:0;display:flex}._container_1rdl9_5[data-position=left],._container_1rdl9_5[data-position=right]{flex-direction:column}._container_1rdl9_5 [data-tooltip]{pointer-events:auto}._popup_1rdl9_19{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_1rdl9_19:before{content:"";background-color:inherit;width:10px;height:10px;position:absolute;bottom:-3px;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=top]{transform:translate(-50%,-100%)}._popup_1rdl9_19[data-position=top]:before{top:auto;bottom:-3px;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=bottom]{transform:translate(-50%)}._popup_1rdl9_19[data-position=bottom]:before{top:-3px;bottom:auto;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=left]{transform:translate(-100%,-50%)}._popup_1rdl9_19[data-position=left]:before{top:50%;left:auto;right:-3px;transform:translateY(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=right]{transform:translateY(-50%)}._popup_1rdl9_19[data-position=right]:before{top:50%;left:-3px;right:auto;transform:translateY(-50%)rotate(45deg)}._popup_1rdl9_19._animated_1rdl9_92{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_1rdl9_101{border-radius:inherit;width:100%;height:100%;overflow:hidden}._track_1rdl9_108{width:max-content;height:max-content;transform:translateX(calc(-1 * var(--tooltip-offset,0px)));display:flex}._track_1rdl9_108[data-position=left],._track_1rdl9_108[data-position=right]{transform:translateY(calc(-1 * var(--tooltip-offset,0px)));flex-direction:column}._animated_1rdl9_92 ._track_1rdl9_108{transition:transform var(--tooltip-slide,.4s)}._title_1rdl9_125{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}._surfaceTool_e739m_1{background-color:var(--background);border:var(--surface-border);color:var(--foreground);z-index:9;border-radius:4px;gap:4px;padding:4px;display:flex;position:absolute;bottom:16px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._header_m05h6_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_m05h6_12{align-items:center;gap:0;display:flex}._sidebarToggle_m05h6_17{border-right:solid 1px var(--border);width:48px;height:48px;color:var(--foreground);cursor:pointer;justify-content:center;align-items:center;transition:all .2s;display:none;position:relative;left:-8px}._sidebarToggle_m05h6_17._mobile_m05h6_30{display:flex}._sidebarIcon_m05h6_34{stroke-width:1.6px;width:18px;height:18px}._tools_m05h6_39{gap:8px;display:flex}._history_m05h6_43{align-items:center;gap:6px;display:flex}._historyText_m05h6_48{color:var(--muted-foreground);font-size:14px;font-family:var(--font-mono)}._tools_5caap_1{flex-direction:column}._row1_5caap_5{flex-direction:row;align-items:center;gap:4px;padding:4px;display:flex}._min_5caap_13{text-align:left;width:30px;font-size:14px}._slider_5caap_19{flex:1}._max_5caap_23{text-align:right;width:45px;font-size:14px}._row2_5caap_29{flex-direction:row;gap:4px;display:flex}._select_5caap_35{width:180px}._option_5caap_39{width:120px;height:32px}._option_5caap_39 img{object-fit:cover;width:100%;height:100%}._active_5caap_50{color:var(--accent-blue);background:var(--muted)}._filterInteract_5caap_55{max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._filterInteract_5caap_55>div:first-child{width:100%;max-width:100%;height:100%;max-height:100%}._compare_5caap_70{width:0;height:100%;position:absolute;top:0;transform:translate(-50%)}._compare_5caap_70:before{content:"";background:var(--accent-blue);width:1px;height:100%;position:absolute;top:0;left:-.5px}._compareThumb_5caap_88{background:var(--color-white);border:solid 1px var(--accent-blue);width:32px;height:32px;color:var(--accent-blue);cursor:pointer;border-radius:50%;justify-content:center;align-items:center;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._compareThumb_5caap_88 svg{width:20px;height:20px}._preview_t77n1_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;transition:all .2s linear,clip-path;position:absolute;inset:0;overflow:hidden}._preview_t77n1_1._faded_t77n1_13{opacity:.5;filter:blur(2px)}._rotate_t77n1_19{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_t77n1_31{box-sizing:border-box;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._image_t77n1_39{max-width:none;max-height:none;transition:all .2s linear,filter;display:block;position:absolute}._label_t77n1_49{background:var(--color-white-fade);box-sizing:border-box;text-transform:uppercase;letter-spacing:1px;width:80px;height:28px;color:var(--color-black);z-index:3;justify-content:center;align-items:center;font-size:12px;font-weight:600;display:flex;position:absolute;top:8px}._before_t77n1_67{left:8px}._after_t77n1_71{right:8px}._sidebar_1lx29_1{background:var(--background-fade);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);border-right:1px solid var(--border);z-index:10;grid-area:sidebar;width:48px;position:relative}._sidebar_1lx29_1._mobile_1lx29_10{transition:transform .2s ease-out;transform:translate(-110%);box-shadow:0 2px 8px #0000001a}._sidebar_1lx29_1._mobile_1lx29_10._open_1lx29_15{transform:translate(0%)}._wrapper_1lx29_20{flex-direction:column;display:flex}._item_1lx29_24{cursor:pointer;height:48px;color:var(--foreground);justify-content:center;align-items:center;transition:all .2s;display:flex;position:relative}._item_1lx29_24 svg{width:16px;height:16px}._item_1lx29_24:hover{background-color:var(--accent)}._item_1lx29_24._selected_1lx29_43{color:var(--accent-blue);background-color:var(--accent)}._item_1lx29_24._selected_1lx29_43:before{content:"";background-color:var(--accent-blue);width:2px;position:absolute;top:0;bottom:0;left:0}._infobar_895qe_1{background:var(--muted);font-family:var(--font-mono);color:var(--foreground);grid-area:infobar;justify-content:space-between;align-items:center;padding:0 16px;font-size:14px;display:flex}._resize_1sbig_1{align-items:center;padding-top:16px}._toolsLock_1sbig_5{width:12px;height:12px;color:var(--muted-foreground)}._indicatorWrapper_1sbig_10{justify-content:center;width:100%;height:2px;display:flex;position:absolute;top:0;left:0}._indicator_1sbig_10{background:var(--accent-blue);opacity:.6;border-radius:2px;width:30%;height:100%;transition:width .2s}._wrapper_1co2u_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._box_1co2u_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}._toolsInfo_1co2u_18{-webkit-user-select:none;user-select:none;min-width:54px;margin-top:-2px;display:inline-block}._toolsInfoLabel_1co2u_25{color:var(--muted-foreground);font-size:12px;line-height:12px}._toolsInfoValue_1co2u_30{color:var(--foreground);font-size:14px;line-height:14px}._linesBox_1co2u_35{pointer-events:none;position:absolute;inset:1px}._line_1co2u_35{border:1px dashed var(--color-white);opacity:.5;position:absolute}._lineV_1co2u_45{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._lineH_1co2u_53{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._pointer_1co2u_61{box-sizing:border-box;width:14px;height:14px;position:absolute}._pointerTopLeft_1co2u_67{border-top:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nwse-resize;top:-6px;left:-6px}._pointerTopRight_1co2u_74{border-top:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nesw-resize;top:-6px;right:-6px}._pointerBottomRight_1co2u_81{border-bottom:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nwse-resize;bottom:-6px;right:-6px}._pointerBottomLeft_1co2u_88{border-bottom:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nesw-resize;bottom:-6px;left:-6px}._mobileBorder_1co2u_95{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._mobilePointer_1co2u_101{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_1co2u_112{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_1co2u_112 b{font-weight:600;transform:translateY(1px)}._infoX_1co2u_129{border-left:solid 2px var(--accent-blue);top:-12px;left:16px}._infoY_1co2u_134{transform-origin:100%;border-right:solid 2px var(--accent-blue);top:8px;right:calc(100% + 4px);transform:rotate(-90deg)}._infoW_1co2u_141{border-right:solid 2px var(--accent-blue);bottom:-12px;right:16px}._infoH_1co2u_146{transform-origin:0%;border-left:solid 2px var(--accent-blue);bottom:8px;left:calc(100% + 4px);transform:rotate(-90deg)}._group_1co2u_153{flex-shrink:0;width:max-content;display:flex}._group_1co2u_153 button{color:var(--foreground);border-radius:0}._group_1co2u_153 button._active_1co2u_162{color:var(--accent-blue);background:var(--muted)}._group_1co2u_153 button:not(:first-child){margin-left:-1px}._group_1co2u_153 button:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._group_1co2u_153 button:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}._select_1ieak_1{width:220px}._btnH_15adi_1{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_15adi_7{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_1p6kh_1{box-sizing:border-box;background:var(--background);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)}})();
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_187c5_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) 65%, 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);--background-fade:color-mix(in srgb, var(--background) 65%, transparent);--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);--surface-border:solid 1px transparent;position:relative}._root_187c5_8[data-theme=dark]{--color-white-fade:color-mix(in srgb, var(--color-white) 45%, transparent);--background:oklch(24.5% 0 0);--background-fade:color-mix(in srgb, var(--background) 70%, transparent);--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(29.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);--surface-border:solid 1px var(--border)}._root_187c5_8 h1,._root_187c5_8 h2,._root_187c5_8 h3,._root_187c5_8 h4,._root_187c5_8 h5,._root_187c5_8 h6{color:var(--foreground);margin:0;font-weight:600}._textRed_187c5_78{color:var(--color-red)}._bgRed_187c5_81{background-color:var(--color-red)}._bgGreen_187c5_84{background-color:var(--color-green)}._textGreen_187c5_87{color:var(--color-green)}._mask_187c5_90{background-color:var(--overlay-bg)}._semibold_187c5_93{letter-spacing:.4px;font-weight:600}._bold_187c5_97{letter-spacing:.4px;font-weight:700}._system_187c5_101{color:var(--muted-foreground);background-color:var(--background);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._wrapper_187c5_111{width:100%;height:100%;min-height:480px;position:relative;overflow:hidden}._grid_187c5_118{background:var(--background);grid-template:"header header"48px"sidebar frame"1fr"sidebar infobar"32px/48px 1fr;height:100%;display:grid;position:relative}._grid_187c5_118._mobile_187c5_130{grid-template-columns:0 1fr}._gridNoInfobar_187c5_134{grid-template:"header header"48px"sidebar frame"1fr/48px 1fr;height:100%;display:grid;position:relative}._gridNoInfobar_187c5_134._mobile_187c5_130{grid-template-columns:0 1fr}._gridSingleTool_187c5_149{grid-template:"frame"1fr/1fr;height:100%;display:grid;position:relative}._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}._sliderContainer_1unyb_1{cursor:pointer;touch-action:none;--slider-progress:0%;align-items:center;width:100%;height:24px;display:flex;position:relative}._sliderContainer_1unyb_1._disabled_1unyb_11{pointer-events:none;cursor:not-allowed;opacity:.5}._sliderContainer_1unyb_1:not(._disabled_1unyb_11):hover ._sliderThumb_1unyb_17{transform:translate(-50%,-50%)scale(1.1)}._sliderTrack_1unyb_22{background-color:color-mix(in oklch, var(--muted-foreground) 65%, transparent);border-radius:2px;width:100%;height:2px;position:relative}._sliderRange_1unyb_34{background-color:var(--primary);height:100%;width:var(--slider-progress);border-radius:2px;position:absolute}._sliderThumb_1unyb_17{top:50%;left:var(--slider-progress);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;transform:translate(-50%,-50%)}._sliderTooltip_1unyb_58{top:-40px;left:var(--slider-progress);background-color:var(--foreground);color:var(--background,#000);white-space:nowrap;pointer-events:none;z-index:2;border-radius:4px;padding:7px 10px 8px;font-size:12px;line-height:1;position:absolute;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._sliderTooltip_1unyb_58:after{content:"";background-color:var(--foreground);width:6px;height:6px;position:absolute;bottom:-2px;left:50%;transform:translate(-50%)rotate(45deg)}._hiddenInput_1unyb_86{opacity:0;cursor:pointer;z-index:1;width:100%;height:100%;margin:0;position:absolute;top:0;left:0}._tooltip_1rdl9_1{position:relative}._container_1rdl9_5{gap:0;display:flex}._container_1rdl9_5[data-position=left],._container_1rdl9_5[data-position=right]{flex-direction:column}._container_1rdl9_5 [data-tooltip]{pointer-events:auto}._popup_1rdl9_19{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_1rdl9_19:before{content:"";background-color:inherit;width:10px;height:10px;position:absolute;bottom:-3px;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=top]{transform:translate(-50%,-100%)}._popup_1rdl9_19[data-position=top]:before{top:auto;bottom:-3px;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=bottom]{transform:translate(-50%)}._popup_1rdl9_19[data-position=bottom]:before{top:-3px;bottom:auto;left:50%;transform:translate(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=left]{transform:translate(-100%,-50%)}._popup_1rdl9_19[data-position=left]:before{top:50%;left:auto;right:-3px;transform:translateY(-50%)rotate(45deg)}._popup_1rdl9_19[data-position=right]{transform:translateY(-50%)}._popup_1rdl9_19[data-position=right]:before{top:50%;left:-3px;right:auto;transform:translateY(-50%)rotate(45deg)}._popup_1rdl9_19._animated_1rdl9_92{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_1rdl9_101{border-radius:inherit;width:100%;height:100%;overflow:hidden}._track_1rdl9_108{width:max-content;height:max-content;transform:translateX(calc(-1 * var(--tooltip-offset,0px)));display:flex}._track_1rdl9_108[data-position=left],._track_1rdl9_108[data-position=right]{transform:translateY(calc(-1 * var(--tooltip-offset,0px)));flex-direction:column}._animated_1rdl9_92 ._track_1rdl9_108{transition:transform var(--tooltip-slide,.4s)}._title_1rdl9_125{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}._surfaceTool_1skmt_1{background-color:var(--background);border:var(--surface-border);color:var(--foreground);z-index:9;border-radius:4px;align-items:center;gap:4px;padding:4px;display:flex;position:absolute;bottom:16px;left:50%;transform:translate(-50%);box-shadow:0 2px 8px #0000001a}._content_1skmt_18{display:flex}._drag_1skmt_22{cursor:move;touch-action:none;-webkit-user-select:none;user-select:none;width:16px;height:16px;padding:0 2px}._tools_4u8qe_1{flex-direction:column}._row1_4u8qe_5{flex-direction:row;align-items:center;gap:4px;padding:4px;display:flex}._min_4u8qe_13{text-align:left;width:30px;font-size:14px}._slider_4u8qe_19{flex:1}._max_4u8qe_23{text-align:right;width:45px;font-size:14px}._row2_4u8qe_29{flex-direction:row;gap:4px;display:flex}._select_4u8qe_35{width:160px}._option_4u8qe_39{width:120px;height:32px}._option_4u8qe_39 img{object-fit:cover;width:100%;height:100%}._active_4u8qe_50{color:var(--accent-blue);background:var(--muted)}._filterInteract_4u8qe_55{max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._filterInteract_4u8qe_55>div:first-child{width:100%;max-width:100%;height:100%;max-height:100%}._compare_4u8qe_70{width:0;height:100%;position:absolute;top:0;transform:translate(-50%)}._compare_4u8qe_70:before{content:"";background:var(--accent-blue);width:1px;height:100%;position:absolute;top:0;left:-.5px}._compareThumb_4u8qe_88{background:var(--color-white);border:solid 1px var(--accent-blue);width:32px;height:32px;color:var(--accent-blue);cursor:pointer;border-radius:50%;justify-content:center;align-items:center;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}._compareThumb_4u8qe_88 svg{width:20px;height:20px}._preview_t77n1_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;transition:all .2s linear,clip-path;position:absolute;inset:0;overflow:hidden}._preview_t77n1_1._faded_t77n1_13{opacity:.5;filter:blur(2px)}._rotate_t77n1_19{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_t77n1_31{box-sizing:border-box;transition:all .2s linear;position:absolute;inset:0;overflow:hidden}._image_t77n1_39{max-width:none;max-height:none;transition:all .2s linear,filter;display:block;position:absolute}._label_t77n1_49{background:var(--color-white-fade);box-sizing:border-box;text-transform:uppercase;letter-spacing:1px;width:80px;height:28px;color:var(--color-black);z-index:3;justify-content:center;align-items:center;font-size:12px;font-weight:600;display:flex;position:absolute;top:8px}._before_t77n1_67{left:8px}._after_t77n1_71{right:8px}._header_m05h6_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_m05h6_12{align-items:center;gap:0;display:flex}._sidebarToggle_m05h6_17{border-right:solid 1px var(--border);width:48px;height:48px;color:var(--foreground);cursor:pointer;justify-content:center;align-items:center;transition:all .2s;display:none;position:relative;left:-8px}._sidebarToggle_m05h6_17._mobile_m05h6_30{display:flex}._sidebarIcon_m05h6_34{stroke-width:1.6px;width:18px;height:18px}._tools_m05h6_39{gap:8px;display:flex}._history_m05h6_43{align-items:center;gap:6px;display:flex}._historyText_m05h6_48{color:var(--muted-foreground);font-size:14px;font-family:var(--font-mono)}._sidebar_1lx29_1{background:var(--background-fade);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);border-right:1px solid var(--border);z-index:10;grid-area:sidebar;width:48px;position:relative}._sidebar_1lx29_1._mobile_1lx29_10{transition:transform .2s ease-out;transform:translate(-110%);box-shadow:0 2px 8px #0000001a}._sidebar_1lx29_1._mobile_1lx29_10._open_1lx29_15{transform:translate(0%)}._wrapper_1lx29_20{flex-direction:column;display:flex}._item_1lx29_24{cursor:pointer;height:48px;color:var(--foreground);justify-content:center;align-items:center;transition:all .2s;display:flex;position:relative}._item_1lx29_24 svg{width:16px;height:16px}._item_1lx29_24:hover{background-color:var(--accent)}._item_1lx29_24._selected_1lx29_43{color:var(--accent-blue);background-color:var(--accent)}._item_1lx29_24._selected_1lx29_43:before{content:"";background-color:var(--accent-blue);width:2px;position:absolute;top:0;bottom:0;left:0}._infobar_895qe_1{background:var(--muted);font-family:var(--font-mono);color:var(--foreground);grid-area:infobar;justify-content:space-between;align-items:center;padding:0 16px;font-size:14px;display:flex}._resize_1sbig_1{align-items:center;padding-top:16px}._toolsLock_1sbig_5{width:12px;height:12px;color:var(--muted-foreground)}._indicatorWrapper_1sbig_10{justify-content:center;width:100%;height:2px;display:flex;position:absolute;top:0;left:0}._indicator_1sbig_10{background:var(--accent-blue);opacity:.6;border-radius:2px;width:30%;height:100%;transition:width .2s}._wrapper_1co2u_1{box-sizing:border-box;max-width:calc(100% - 32px);max-height:calc(100% - 32px);margin:auto;position:absolute;inset:0}._box_1co2u_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}._toolsInfo_1co2u_18{-webkit-user-select:none;user-select:none;min-width:54px;margin-top:-2px;display:inline-block}._toolsInfoLabel_1co2u_25{color:var(--muted-foreground);font-size:12px;line-height:12px}._toolsInfoValue_1co2u_30{color:var(--foreground);font-size:14px;line-height:14px}._linesBox_1co2u_35{pointer-events:none;position:absolute;inset:1px}._line_1co2u_35{border:1px dashed var(--color-white);opacity:.5;position:absolute}._lineV_1co2u_45{border-top:0;border-bottom:0;width:33%;height:100%;top:0;left:33%}._lineH_1co2u_53{border-left:0;border-right:0;width:100%;height:33%;top:33%;left:0}._pointer_1co2u_61{box-sizing:border-box;width:14px;height:14px;position:absolute}._pointerTopLeft_1co2u_67{border-top:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nwse-resize;top:-6px;left:-6px}._pointerTopRight_1co2u_74{border-top:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nesw-resize;top:-6px;right:-6px}._pointerBottomRight_1co2u_81{border-bottom:3px solid var(--accent-blue);border-right:3px solid var(--accent-blue);cursor:nwse-resize;bottom:-6px;right:-6px}._pointerBottomLeft_1co2u_88{border-bottom:3px solid var(--accent-blue);border-left:3px solid var(--accent-blue);cursor:nesw-resize;bottom:-6px;left:-6px}._mobileBorder_1co2u_95{box-sizing:border-box;border:2px solid var(--accent-blue);position:absolute;inset:0}._mobilePointer_1co2u_101{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_1co2u_112{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_1co2u_112 b{font-weight:600;transform:translateY(1px)}._infoX_1co2u_129{border-left:solid 2px var(--accent-blue);top:-12px;left:16px}._infoY_1co2u_134{transform-origin:100%;border-right:solid 2px var(--accent-blue);top:8px;right:calc(100% + 4px);transform:rotate(-90deg)}._infoW_1co2u_141{border-right:solid 2px var(--accent-blue);bottom:-12px;right:16px}._infoH_1co2u_146{transform-origin:0%;border-left:solid 2px var(--accent-blue);bottom:8px;left:calc(100% + 4px);transform:rotate(-90deg)}._group_1co2u_153{flex-shrink:0;width:max-content;display:flex}._group_1co2u_153 button{color:var(--foreground);border-radius:0}._group_1co2u_153 button._active_1co2u_162{color:var(--accent-blue);background:var(--muted)}._group_1co2u_153 button:not(:first-child){margin-left:-1px}._group_1co2u_153 button:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._group_1co2u_153 button:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}._select_1ieak_1{width:220px}._btnH_15adi_1{border-top-right-radius:0;border-bottom-right-radius:0;width:36px}._btnV_15adi_7{border-top-left-radius:0;border-bottom-left-radius:0;width:36px;margin-left:-1px}._frame_1p6kh_1{box-sizing:border-box;background:var(--background);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
2
  import { Children as e, createContext as t, forwardRef as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useImperativeHandle as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
3
  //#region \0rolldown/runtime.js
4
4
  var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), p = /* @__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
- }), m = {
8
- sm: 480,
9
- md: 768,
10
- lg: 1024,
11
- xl: 1280
12
- }, h = {
13
- INITIAL: "initial",
14
- RESIZE: "resize",
15
- CROP: "crop",
16
- PRESET_CROP: "presetCrop",
17
- FLIP: "flip",
18
- ROTATE: "rotate",
19
- FILTERS: "filters"
20
- }, g = {
21
- tools: [
22
- "resize",
23
- "crop",
24
- "presetCrop",
25
- "flip",
26
- "rotate",
27
- "filters"
28
- ],
29
- infobar: !0,
30
- quality: .85,
31
- saveAsWEBP: !1,
32
- exportAs: "blob"
33
- }, _ = (e, t, n, r, i, a, o) => ({
34
- history: {
35
- pointer: 0,
36
- items: [{
37
- width: t,
38
- height: n,
39
- action: {
40
- name: h.INITIAL,
41
- args: null
7
+ }), m = 1920, h = .85, g = [
8
+ {
9
+ label: "Facebook",
10
+ value: "facebook",
11
+ options: [
12
+ {
13
+ value: "facebook-post",
14
+ label: "Post",
15
+ w: 1200,
16
+ h: 630,
17
+ rightLabel: "1200 x 630"
18
+ },
19
+ {
20
+ value: "facebook-cover",
21
+ label: "Cover",
22
+ w: 851,
23
+ h: 315,
24
+ rightLabel: "851 x 315"
25
+ },
26
+ {
27
+ value: "facebook-profile",
28
+ label: "Profile",
29
+ w: 170,
30
+ h: 170,
31
+ rightLabel: "170 x 170"
32
+ },
33
+ {
34
+ value: "facebook-story",
35
+ label: "Story",
36
+ w: 1080,
37
+ h: 1920,
38
+ rightLabel: "1080 x 1920"
42
39
  }
43
- }]
40
+ ]
44
41
  },
45
- currentAction: null,
46
- previewUrl: i,
47
- originalBlob: r,
48
- mimeType: e,
49
- sidebar: !1,
50
- settings: o,
51
- isAlpha: a,
52
- showCompare: !1
53
- }), v = t(void 0), y = /* @__PURE__ */ f(((e) => {
42
+ {
43
+ label: "Instagram",
44
+ value: "instagram",
45
+ options: [
46
+ {
47
+ value: "instagram-landscape",
48
+ label: "Landscape",
49
+ w: 1080,
50
+ h: 566,
51
+ rightLabel: "1080 x 566"
52
+ },
53
+ {
54
+ value: "instagram-portait",
55
+ label: "Portait",
56
+ w: 1080,
57
+ h: 1350,
58
+ rightLabel: "1080 x 1350"
59
+ },
60
+ {
61
+ value: "instagram-square",
62
+ label: "Square",
63
+ w: 1080,
64
+ h: 1080,
65
+ rightLabel: "1080 x 1080"
66
+ },
67
+ {
68
+ value: "instagram-story",
69
+ label: "Story",
70
+ w: 1080,
71
+ h: 1920,
72
+ rightLabel: "1080 x 1920"
73
+ },
74
+ {
75
+ value: "instagram-thumbnail",
76
+ label: "Thumbnail",
77
+ w: 161,
78
+ h: 161,
79
+ rightLabel: "161 x 161"
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ label: "LinkedIn",
85
+ value: "linkedin",
86
+ options: [
87
+ {
88
+ value: "linkedin-blog-post",
89
+ label: "Blog Post",
90
+ w: 1200,
91
+ h: 627,
92
+ rightLabel: "1200 x 627"
93
+ },
94
+ {
95
+ value: "linkedin-cover",
96
+ label: "Cover",
97
+ w: 1128,
98
+ h: 191,
99
+ rightLabel: "1128 x 191"
100
+ },
101
+ {
102
+ value: "linkedin-profile",
103
+ label: "Profile",
104
+ w: 400,
105
+ h: 400,
106
+ rightLabel: "400 x 400"
107
+ }
108
+ ]
109
+ }
110
+ ], _ = [
111
+ {
112
+ value: "saturate",
113
+ label: "Saturate",
114
+ min: 0,
115
+ max: 200,
116
+ step: 1,
117
+ unit: "%",
118
+ sliderValue: 100,
119
+ rightLabel: "100%"
120
+ },
121
+ {
122
+ value: "grayscale",
123
+ label: "Grayscale",
124
+ min: 0,
125
+ max: 100,
126
+ step: 1,
127
+ unit: "%",
128
+ sliderValue: 0,
129
+ rightLabel: "0%"
130
+ },
131
+ {
132
+ value: "sepia",
133
+ label: "Sepia",
134
+ min: 0,
135
+ max: 100,
136
+ step: 1,
137
+ unit: "%",
138
+ sliderValue: 0,
139
+ rightLabel: "0%"
140
+ },
141
+ {
142
+ value: "invert",
143
+ label: "Invert",
144
+ min: 0,
145
+ max: 100,
146
+ step: 1,
147
+ unit: "%",
148
+ sliderValue: 0,
149
+ rightLabel: "0%"
150
+ },
151
+ {
152
+ value: "hueRotate",
153
+ label: "Hue Rotate",
154
+ min: 0,
155
+ max: 360,
156
+ step: 1,
157
+ unit: "°",
158
+ sliderValue: 0,
159
+ rightLabel: "0°"
160
+ },
161
+ {
162
+ value: "brightness",
163
+ label: "Brightness",
164
+ min: 0,
165
+ max: 200,
166
+ step: 1,
167
+ unit: "%",
168
+ sliderValue: 100,
169
+ rightLabel: "100%"
170
+ },
171
+ {
172
+ value: "contrast",
173
+ label: "Contrast",
174
+ min: 0,
175
+ max: 200,
176
+ step: 1,
177
+ unit: "%",
178
+ sliderValue: 100,
179
+ rightLabel: "100%"
180
+ }
181
+ ], v = [
182
+ {
183
+ value: "vintage",
184
+ label: "Vintage"
185
+ },
186
+ {
187
+ value: "olive-army",
188
+ label: "Olive Army"
189
+ },
190
+ {
191
+ value: "warm-sunset",
192
+ label: "Warm Sunset"
193
+ },
194
+ {
195
+ value: "sin-city-red",
196
+ label: "Sin City Red"
197
+ },
198
+ {
199
+ value: "plastic-wrap",
200
+ label: "Plastic Wrap"
201
+ },
202
+ {
203
+ value: "cross-process",
204
+ label: "Cross-Processing"
205
+ },
206
+ {
207
+ value: "crt-lines",
208
+ label: "CRT Monitor"
209
+ },
210
+ {
211
+ value: "grain",
212
+ label: "Grain / Noise"
213
+ },
214
+ {
215
+ value: "emboss",
216
+ label: "Emboss Effect"
217
+ },
218
+ {
219
+ value: "x-ray",
220
+ label: "X-Ray"
221
+ }
222
+ ], y = /* @__PURE__ */ f(((e) => {
54
223
  var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
55
224
  function r(e, n, r) {
56
225
  var i = null;
@@ -129,7 +298,7 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
129
298
  return Error("react-stack-top-frame");
130
299
  }
131
300
  function s(e) {
132
- if (j.call(e, "key")) {
301
+ if (ee.call(e, "key")) {
133
302
  var t = Object.getOwnPropertyDescriptor(e, "key").get;
134
303
  if (t && t.isReactWarning) return !1;
135
304
  }
@@ -137,7 +306,7 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
137
306
  }
138
307
  function c(e, t) {
139
308
  function n() {
140
- te || (te = !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));
309
+ ne || (ne = !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));
141
310
  }
142
311
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
143
312
  get: n,
@@ -146,7 +315,7 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
146
315
  }
147
316
  function l() {
148
317
  var e = t(this.type);
149
- 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;
318
+ return re[e] || (re[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;
150
319
  }
151
320
  function u(e, t, n, r, i, a) {
152
321
  var o = n.ref;
@@ -186,12 +355,12 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
186
355
  }
187
356
  function d(e, n, i, o, l, d) {
188
357
  var p = n.children;
189
- if (p !== void 0) if (o) if (ee(p)) {
358
+ if (p !== void 0) if (o) if (te(p)) {
190
359
  for (o = 0; o < p.length; o++) f(p[o]);
191
360
  Object.freeze && Object.freeze(p);
192
361
  } 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.");
193
362
  else f(p);
194
- if (j.call(n, "key")) {
363
+ if (ee.call(n, "key")) {
195
364
  p = t(e);
196
365
  var m = Object.keys(n).filter(function(e) {
197
366
  return e !== "key";
@@ -208,176 +377,24 @@ var f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t
208
377
  function m(e) {
209
378
  return typeof e == "object" && !!e && e.$$typeof === g;
210
379
  }
211
- var h = p("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, j = Object.prototype.hasOwnProperty, ee = Array.isArray, M = console.createTask ? console.createTask : function() {
380
+ var h = p("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() {
212
381
  return null;
213
382
  };
214
383
  h = { react_stack_bottom_frame: function(e) {
215
384
  return e();
216
385
  } };
217
- var te, ne = {}, re = h.react_stack_bottom_frame.bind(h, o)(), ie = M(i(o)), N = {};
386
+ var ne, re = {}, M = h.react_stack_bottom_frame.bind(h, o)(), ie = j(i(o)), N = {};
218
387
  e.Fragment = v, e.jsx = function(e, t, n) {
219
388
  var r = 1e4 > A.recentlyCreatedOwnerStacks++;
220
- return d(e, t, n, !1, r ? Error("react-stack-top-frame") : re, r ? M(i(e)) : ie);
389
+ return d(e, t, n, !1, r ? Error("react-stack-top-frame") : M, r ? j(i(e)) : ie);
221
390
  }, e.jsxs = function(e, t, n) {
222
391
  var r = 1e4 > A.recentlyCreatedOwnerStacks++;
223
- return d(e, t, n, !0, r ? Error("react-stack-top-frame") : re, r ? M(i(e)) : ie);
392
+ return d(e, t, n, !0, r ? Error("react-stack-top-frame") : M, r ? j(i(e)) : ie);
224
393
  };
225
394
  })();
226
395
  })), x = (/* @__PURE__ */ f(((e, t) => {
227
396
  process.env.NODE_ENV === "production" ? t.exports = y() : t.exports = b();
228
- })))(), S = ({ children: e, mimeType: t, width: n, height: r, originalBlob: i, previewUrl: a, isAlpha: s, settings: c }) => {
229
- let [f, p] = d(_(t, n, r, i, a, s, c)), m = u(null);
230
- o(() => () => {
231
- m.current &&= (URL.revokeObjectURL(m.current), null);
232
- }, []);
233
- let g = (e) => p((t) => ({
234
- ...t,
235
- currentAction: e
236
- })), y = (e) => p((t) => {
237
- let n = t.history.pointer + 1, r = [...t.history.items.slice(0, n), e];
238
- return {
239
- ...t,
240
- currentAction: null,
241
- history: {
242
- items: r,
243
- pointer: n
244
- }
245
- };
246
- }), b = () => p((e) => ({
247
- ...e,
248
- showCompare: !e.showCompare
249
- })), S = () => {
250
- let { items: e, pointer: t } = f.history;
251
- return e.at(t) ?? e.at(0) ?? {
252
- width: 0,
253
- height: 0,
254
- action: {
255
- name: h.INITIAL,
256
- args: null
257
- }
258
- };
259
- }, C = () => {
260
- let { items: e, pointer: t } = f.history;
261
- return e.filter((e, n) => n <= t && e.action.name === h.FILTERS).at(-1) ?? null;
262
- }, w = () => {
263
- let { items: e, pointer: t } = f.history;
264
- if (e.length === 0 || t < 0) return 0;
265
- let n = e.slice(0, t + 1).findLast((e) => e.action.name === h.ROTATE);
266
- return n?.action.name === h.ROTATE ? n.action.args.degrees : 0;
267
- }, T = () => p((e) => ({
268
- ...e,
269
- history: {
270
- items: [e.history.items[0]],
271
- pointer: 0
272
- }
273
- })), E = () => p((e) => e.history.pointer <= 0 ? e : {
274
- ...e,
275
- history: {
276
- ...e.history,
277
- pointer: e.history.pointer - 1
278
- }
279
- }), D = () => p((e) => e.history.pointer >= e.history.items.length - 1 ? e : {
280
- ...e,
281
- history: {
282
- ...e.history,
283
- pointer: e.history.pointer + 1
284
- }
285
- }), O = (e) => p((t) => ({
286
- ...t,
287
- sidebar: e
288
- })), k = l(() => new EventTarget(), []), A = (e) => {
289
- m.current && URL.revokeObjectURL(m.current), m.current = URL.createObjectURL(e.previewBlob), p(_(e.mimeType, e.width, e.height, e.newBlob, m.current, e.isAlpha, c));
290
- };
291
- return /* @__PURE__ */ (0, x.jsx)(v, {
292
- value: {
293
- ...f,
294
- setImage: A,
295
- setCurrentAction: g,
296
- toggleCompare: b,
297
- getLastHistoryItem: S,
298
- getLastRotation: w,
299
- getLastFilter: C,
300
- addToHistory: y,
301
- resetHistory: T,
302
- undo: E,
303
- redo: D,
304
- setSidebar: O,
305
- eventBus: k
306
- },
307
- children: e
308
- });
309
- }, C = "(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.`})}}})();", w = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", C], { type: "text/javascript;charset=utf-8" });
310
- function T(e) {
311
- let t;
312
- try {
313
- if (t = w && (self.URL || self.webkitURL).createObjectURL(w), !t) throw "";
314
- let n = new Worker(t, { name: e?.name });
315
- return n.addEventListener("error", () => {
316
- (self.URL || self.webkitURL).revokeObjectURL(t);
317
- }), n;
318
- } catch {
319
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(C), { name: e?.name });
320
- }
321
- }
322
- //#endregion
323
- //#region src/shared/components/Pixedi/hooks/useImageLoader.tsx
324
- var E = ({ src: e, skip: t = !1 }) => {
325
- let [n, r] = d({
326
- loading: !t,
327
- error: "",
328
- width: 0,
329
- height: 0,
330
- mimeType: "",
331
- originalBlob: null,
332
- previewUrl: "",
333
- isAlpha: !1
334
- }), i = u(null);
335
- return o(() => {
336
- if (!e || t) return;
337
- let n = new T();
338
- return n.postMessage(e), n.onmessage = (e) => {
339
- let t = e.data;
340
- t.success ? (i.current && URL.revokeObjectURL(i.current), i.current = URL.createObjectURL(t.previewBlob), r({
341
- loading: !1,
342
- error: "",
343
- mimeType: t.mimeType,
344
- width: t.width,
345
- height: t.height,
346
- originalBlob: t.originalBlob,
347
- previewUrl: i.current,
348
- isAlpha: t.isAlpha
349
- })) : r((e) => ({
350
- ...e,
351
- loading: !1,
352
- error: t.error || "Error processing image."
353
- }));
354
- }, () => {
355
- n.terminate(), i.current &&= (URL.revokeObjectURL(i.current), null);
356
- };
357
- }, [t, e]), n;
358
- }, D = () => {
359
- if (typeof window > "u" || !window.navigator) return null;
360
- let e = window.navigator.userAgent.toLowerCase();
361
- 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;
362
- }, O = () => {
363
- let [e] = d(() => D());
364
- return e;
365
- };
366
- //#endregion
367
- //#region src/shared/components/Pixedi/hooks/useBellow.tsx
368
- function k(e, t) {
369
- let [n, r] = d(!0);
370
- return o(() => {
371
- if (!t) return;
372
- let n = new ResizeObserver(([t]) => {
373
- t && r(t.contentRect.width < m[e]);
374
- });
375
- return n.observe(t), () => n.disconnect();
376
- }, [e, t]), n;
377
- }
378
- //#endregion
379
- //#region src/shared/components/Pixedi/assets/icons.tsx
380
- var A = {
397
+ })))(), S = {
381
398
  xmlns: "http://w3.org",
382
399
  width: "24",
383
400
  height: "24",
@@ -387,16 +404,16 @@ var A = {
387
404
  strokeWidth: "2",
388
405
  strokeLinecap: "round",
389
406
  strokeLinejoin: "round"
390
- }, j = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
391
- ...A,
407
+ }, C = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
408
+ ...S,
392
409
  ...e,
393
410
  children: /* @__PURE__ */ (0, x.jsx)("path", { d: "M20 6 9 17l-5-5" })
394
- }), ee = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
395
- ...A,
411
+ }), w = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
412
+ ...S,
396
413
  ...e,
397
414
  children: [/* @__PURE__ */ (0, x.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, x.jsx)("path", { d: "m6 6 12 12" })]
398
- }), M = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
399
- ...A,
415
+ }), T = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
416
+ ...S,
400
417
  ...e,
401
418
  children: [/* @__PURE__ */ (0, x.jsx)("rect", {
402
419
  width: "18",
@@ -406,28 +423,28 @@ var A = {
406
423
  rx: "2",
407
424
  ry: "2"
408
425
  }), /* @__PURE__ */ (0, x.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
409
- }), te = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
410
- ...A,
426
+ }), E = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
427
+ ...S,
411
428
  ...e,
412
429
  children: [/* @__PURE__ */ (0, x.jsx)("path", { d: "m12 19-7-7 7-7" }), /* @__PURE__ */ (0, x.jsx)("path", { d: "M19 12H5" })]
413
- }), ne = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
414
- ...A,
430
+ }), D = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
431
+ ...S,
415
432
  ...e,
416
433
  children: /* @__PURE__ */ (0, x.jsx)("path", { d: "m6 9 6 6 6-6" })
417
- }), re = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
418
- ...A,
434
+ }), O = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
435
+ ...S,
419
436
  ...e,
420
437
  children: [/* @__PURE__ */ (0, x.jsx)("path", { d: "M3 7v6h6" }), /* @__PURE__ */ (0, x.jsx)("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })]
421
- }), ie = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
422
- ...A,
438
+ }), k = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
439
+ ...S,
423
440
  ...e,
424
441
  children: [/* @__PURE__ */ (0, x.jsx)("path", { d: "M21 7v6h-6" }), /* @__PURE__ */ (0, x.jsx)("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })]
425
- }), N = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
426
- ...A,
442
+ }), A = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
443
+ ...S,
427
444
  ...e,
428
445
  children: [/* @__PURE__ */ (0, x.jsx)("path", { d: "M6 2v14a2 2 0 0 0 2 2h14" }), /* @__PURE__ */ (0, x.jsx)("path", { d: "M18 22V8a2 2 0 0 0-2-2H2" })]
429
- }), ae = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
430
- ...A,
446
+ }), ee = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
447
+ ...S,
431
448
  ...e,
432
449
  children: [
433
450
  /* @__PURE__ */ (0, x.jsx)("rect", {
@@ -445,8 +462,8 @@ var A = {
445
462
  }),
446
463
  /* @__PURE__ */ (0, x.jsx)("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
447
464
  ]
448
- }), oe = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
449
- ...A,
465
+ }), te = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
466
+ ...S,
450
467
  ...e,
451
468
  children: /* @__PURE__ */ (0, x.jsx)("rect", {
452
469
  width: "18",
@@ -455,8 +472,8 @@ var A = {
455
472
  y: "3",
456
473
  rx: "2"
457
474
  })
458
- }), se = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
459
- ...A,
475
+ }), j = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
476
+ ...S,
460
477
  ...e,
461
478
  children: /* @__PURE__ */ (0, x.jsx)("rect", {
462
479
  width: "20",
@@ -465,8 +482,8 @@ var A = {
465
482
  y: "6",
466
483
  rx: "2"
467
484
  })
468
- }), ce = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
469
- ...A,
485
+ }), ne = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
486
+ ...S,
470
487
  ...e,
471
488
  children: /* @__PURE__ */ (0, x.jsx)("rect", {
472
489
  width: "20",
@@ -475,8 +492,8 @@ var A = {
475
492
  y: "4.5",
476
493
  rx: "2"
477
494
  })
478
- }), le = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
479
- ...A,
495
+ }), re = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
496
+ ...S,
480
497
  ...e,
481
498
  children: [
482
499
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
@@ -491,8 +508,8 @@ var A = {
491
508
  rx: "1"
492
509
  })
493
510
  ]
494
- }), ue = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
495
- ...A,
511
+ }), M = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
512
+ ...S,
496
513
  ...e,
497
514
  children: [
498
515
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3" }),
@@ -502,8 +519,8 @@ var A = {
502
519
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M12 8v2" }),
503
520
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M12 2v2" })
504
521
  ]
505
- }), de = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
506
- ...A,
522
+ }), ie = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
523
+ ...S,
507
524
  ...e,
508
525
  children: [
509
526
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3" }),
@@ -513,16 +530,16 @@ var A = {
513
530
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M16 12h-2" }),
514
531
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M22 12h-2" })
515
532
  ]
516
- }), fe = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
517
- ...A,
533
+ }), N = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
534
+ ...S,
518
535
  ...e,
519
536
  children: [/* @__PURE__ */ (0, x.jsx)("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }), /* @__PURE__ */ (0, x.jsx)("path", { d: "M21 3v5h-5" })]
520
- }), pe = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
521
- ...A,
537
+ }), ae = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
538
+ ...S,
522
539
  ...e,
523
540
  children: [/* @__PURE__ */ (0, x.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, x.jsx)("path", { d: "M3 3v5h5" })]
524
- }), me = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
525
- ...A,
541
+ }), oe = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
542
+ ...S,
526
543
  ...e,
527
544
  children: [
528
545
  /* @__PURE__ */ (0, x.jsx)("rect", {
@@ -544,8 +561,8 @@ var A = {
544
561
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M14 15h7" }),
545
562
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M14 20h7" })
546
563
  ]
547
- }), he = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
548
- ...A,
564
+ }), se = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
565
+ ...S,
549
566
  ...e,
550
567
  children: [
551
568
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M10 5H3" }),
@@ -558,8 +575,8 @@ var A = {
558
575
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M8 10v4" }),
559
576
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M8 12H3" })
560
577
  ]
561
- }), ge = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
562
- ...A,
578
+ }), ce = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
579
+ ...S,
563
580
  ...e,
564
581
  children: [
565
582
  /* @__PURE__ */ (0, x.jsx)("rect", {
@@ -572,8 +589,8 @@ var A = {
572
589
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M9 3v18" }),
573
590
  /* @__PURE__ */ (0, x.jsx)("path", { d: "m14 9 3 3-3 3" })
574
591
  ]
575
- }), _e = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
576
- ...A,
592
+ }), le = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
593
+ ...S,
577
594
  ...e,
578
595
  children: [
579
596
  /* @__PURE__ */ (0, x.jsx)("rect", {
@@ -586,8 +603,8 @@ var A = {
586
603
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M9 3v18" }),
587
604
  /* @__PURE__ */ (0, x.jsx)("path", { d: "m16 15-3-3 3-3" })
588
605
  ]
589
- }), ve = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
590
- ...A,
606
+ }), ue = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
607
+ ...S,
591
608
  ...e,
592
609
  children: [
593
610
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M15 4V2" }),
@@ -600,16 +617,51 @@ var A = {
600
617
  /* @__PURE__ */ (0, x.jsx)("path", { d: "m3 21 9-9" }),
601
618
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M12.2 6.2 11 5" })
602
619
  ]
603
- }), ye = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
604
- ...A,
620
+ }), de = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
621
+ ...S,
605
622
  ...e,
606
623
  children: [
607
624
  /* @__PURE__ */ (0, x.jsx)("path", { d: "M12 3v18" }),
608
625
  /* @__PURE__ */ (0, x.jsx)("path", { d: "m16 16 4-4-4-4" }),
609
626
  /* @__PURE__ */ (0, x.jsx)("path", { d: "m8 8-4 4 4 4" })
610
627
  ]
611
- }), be = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
612
- ...A,
628
+ }), fe = (e) => /* @__PURE__ */ (0, x.jsxs)("svg", {
629
+ ...S,
630
+ ...e,
631
+ children: [
632
+ /* @__PURE__ */ (0, x.jsx)("circle", {
633
+ cx: "9",
634
+ cy: "12",
635
+ r: "1"
636
+ }),
637
+ /* @__PURE__ */ (0, x.jsx)("circle", {
638
+ cx: "9",
639
+ cy: "5",
640
+ r: "1"
641
+ }),
642
+ /* @__PURE__ */ (0, x.jsx)("circle", {
643
+ cx: "9",
644
+ cy: "19",
645
+ r: "1"
646
+ }),
647
+ /* @__PURE__ */ (0, x.jsx)("circle", {
648
+ cx: "15",
649
+ cy: "12",
650
+ r: "1"
651
+ }),
652
+ /* @__PURE__ */ (0, x.jsx)("circle", {
653
+ cx: "15",
654
+ cy: "5",
655
+ r: "1"
656
+ }),
657
+ /* @__PURE__ */ (0, x.jsx)("circle", {
658
+ cx: "15",
659
+ cy: "19",
660
+ r: "1"
661
+ })
662
+ ]
663
+ }), pe = (e) => /* @__PURE__ */ (0, x.jsx)("svg", {
664
+ ...S,
613
665
  ...e,
614
666
  children: /* @__PURE__ */ (0, x.jsx)("path", {
615
667
  d: "M21 12a9 9 0 1 1-6.219-8.56",
@@ -623,31 +675,27 @@ var A = {
623
675
  repeatCount: "indefinite"
624
676
  })
625
677
  })
626
- }), P = () => {
627
- let e = a(v);
628
- if (!e) throw Error("usePixediContext must be used within an PixediProvider");
629
- return e;
630
- }, F = {
678
+ }), P = {
631
679
  button: "_button_1vpzl_1",
632
680
  default: "_default_1vpzl_35",
633
681
  outline: "_outline_1vpzl_44",
634
682
  ghost: "_ghost_1vpzl_54",
635
683
  rect: "_rect_1vpzl_63"
636
- }, I = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, x.jsx)("button", {
684
+ }, F = ({ className: e = "", variant: t = "default", children: n, ref: r, ...i }) => /* @__PURE__ */ (0, x.jsx)("button", {
637
685
  ref: r,
638
- className: `${F.button} ${F[t]} ${e}`.trim(),
686
+ className: `${P.button} ${P[t]} ${e}`.trim(),
639
687
  ...i,
640
688
  children: n
641
- }), xe = { separator: "_separator_gp8ff_1" }, Se = n(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, x.jsx)("hr", {
689
+ }), me = { separator: "_separator_gp8ff_1" }, he = n(({ className: e = "", orientation: t = "horizontal", ...n }, r) => /* @__PURE__ */ (0, x.jsx)("hr", {
642
690
  ref: r,
643
691
  role: "separator",
644
692
  "aria-orientation": t,
645
693
  "data-orientation": t,
646
- className: `${xe.separator} ${e}`.trim(),
694
+ className: `${me.separator} ${e}`.trim(),
647
695
  ...n
648
696
  }));
649
- Se.displayName = "Separator";
650
- var L = {
697
+ he.displayName = "Separator";
698
+ var I = {
651
699
  wrapper: "_wrapper_1aw0m_1",
652
700
  trigger: "_trigger_1aw0m_6",
653
701
  triggerArrow: "_triggerArrow_1aw0m_31",
@@ -659,21 +707,22 @@ var L = {
659
707
  itemRightContainer: "_itemRightContainer_1aw0m_122",
660
708
  itemRight: "_itemRight_1aw0m_122",
661
709
  itemCheck: "_itemCheck_1aw0m_131"
662
- }, R = {
663
- root: "_root_1qifp_8",
664
- textRed: "_textRed_1qifp_78",
665
- bgRed: "_bgRed_1qifp_81",
666
- bgGreen: "_bgGreen_1qifp_84",
667
- textGreen: "_textGreen_1qifp_87",
668
- mask: "_mask_1qifp_90",
669
- semibold: "_semibold_1qifp_93",
670
- bold: "_bold_1qifp_97",
671
- system: "_system_1qifp_101",
672
- wrapper: "_wrapper_1qifp_111",
673
- grid: "_grid_1qifp_118",
674
- mobile: "_mobile_1qifp_130",
675
- gridNoInfobar: "_gridNoInfobar_1qifp_134"
676
- }, Ce = (e) => {
710
+ }, L = {
711
+ root: "_root_187c5_8",
712
+ textRed: "_textRed_187c5_78",
713
+ bgRed: "_bgRed_187c5_81",
714
+ bgGreen: "_bgGreen_187c5_84",
715
+ textGreen: "_textGreen_187c5_87",
716
+ mask: "_mask_187c5_90",
717
+ semibold: "_semibold_187c5_93",
718
+ bold: "_bold_187c5_97",
719
+ system: "_system_187c5_101",
720
+ wrapper: "_wrapper_187c5_111",
721
+ grid: "_grid_187c5_118",
722
+ mobile: "_mobile_187c5_130",
723
+ gridNoInfobar: "_gridNoInfobar_187c5_134",
724
+ gridSingleTool: "_gridSingleTool_187c5_149"
725
+ }, ge = (e) => {
677
726
  let t = 0, n = window.innerHeight;
678
727
  for (let r = e.parentElement; r; r = r.parentElement) {
679
728
  let { overflow: e, overflowY: i } = getComputedStyle(r);
@@ -685,7 +734,7 @@ var L = {
685
734
  top: t,
686
735
  bottom: n
687
736
  };
688
- }, we = ({ items: e, value: t, onChange: n }) => {
737
+ }, _e = ({ items: e, value: t, onChange: n }) => {
689
738
  let [r, i] = d(!1), a = u(null), s = u(null), f = u(null), p = l(() => {
690
739
  let t = (e) => e.reduce((e, n) => n.options ? [...e, ...t(n.options.map((e) => ({
691
740
  ...e,
@@ -702,7 +751,7 @@ var L = {
702
751
  let e = a.current, t = s.current, n = f.current;
703
752
  if (!r || !e || !t || !n) return;
704
753
  n.style.removeProperty("top"), n.style.removeProperty("max-height");
705
- let { top: i, bottom: o } = Ce(e), c = e.getBoundingClientRect().top, l = t.getBoundingClientRect(), u = n.offsetHeight, d = o - 8 - l.bottom - 4, p = l.top - 4 - i - 8, m = l.bottom + 4, h = 0;
754
+ let { top: i, bottom: o } = ge(e), c = e.getBoundingClientRect().top, l = t.getBoundingClientRect(), u = n.offsetHeight, d = o - 8 - l.bottom - 4, p = l.top - 4 - i - 8, m = l.bottom + 4, h = 0;
706
755
  u > d && (u <= p ? m = l.top - 4 - u : p > d ? (h = Math.max(p, 0), m = l.top - 4 - h) : h = Math.max(d, 0)), h && (n.style.maxHeight = `${h}px`), n.style.top = `${m - c}px`;
707
756
  }, [r, e]), {
708
757
  isOpen: r,
@@ -715,114 +764,114 @@ var L = {
715
764
  },
716
765
  toggleOpen: () => i((e) => !e)
717
766
  };
718
- }, Te = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option", className: i = "", renderOption: a }) => {
719
- let { isOpen: o, selectedLabel: s, containerRef: c, triggerRef: l, contentRef: u, handleSelectItem: d, toggleOpen: f } = we({
767
+ }, ve = ({ items: e, value: t, onChange: n, placeholder: r = "Select an option", className: i = "", renderOption: a }) => {
768
+ let { isOpen: o, selectedLabel: s, containerRef: c, triggerRef: l, contentRef: u, handleSelectItem: d, toggleOpen: f } = _e({
720
769
  items: e,
721
770
  value: t,
722
771
  onChange: n
723
772
  });
724
773
  return /* @__PURE__ */ (0, x.jsxs)("div", {
725
774
  ref: c,
726
- className: `${L.wrapper} ${i}`.trim(),
775
+ className: `${I.wrapper} ${i}`.trim(),
727
776
  "data-state": o ? "open" : "closed",
728
777
  children: [/* @__PURE__ */ (0, x.jsxs)("button", {
729
778
  ref: l,
730
779
  type: "button",
731
- className: L.trigger,
780
+ className: I.trigger,
732
781
  onClick: f,
733
- children: [/* @__PURE__ */ (0, x.jsx)("span", { children: s ?? r }), /* @__PURE__ */ (0, x.jsx)(ne, { className: L.triggerArrow })]
782
+ children: [/* @__PURE__ */ (0, x.jsx)("span", { children: s ?? r }), /* @__PURE__ */ (0, x.jsx)(D, { className: I.triggerArrow })]
734
783
  }), /* @__PURE__ */ (0, x.jsx)("div", {
735
784
  ref: u,
736
- className: L.content,
785
+ className: I.content,
737
786
  children: e.map((e, n) => e.options ? /* @__PURE__ */ (0, x.jsxs)("div", { children: [/* @__PURE__ */ (0, x.jsx)("div", {
738
- className: `${L.groupLabel} ${R.semibold}`,
787
+ className: `${I.groupLabel} ${L.semibold}`,
739
788
  children: e.label
740
789
  }), e.options.map((e) => /* @__PURE__ */ (0, x.jsxs)("div", {
741
- className: L.item,
790
+ className: I.item,
742
791
  onClick: () => d(e.value),
743
792
  children: [a ? a(e) : /* @__PURE__ */ (0, x.jsx)("span", {
744
- className: L.itemLeft,
793
+ className: I.itemLeft,
745
794
  children: e.label
746
795
  }), /* @__PURE__ */ (0, x.jsxs)("div", {
747
- className: L.itemAddon,
796
+ className: I.itemAddon,
748
797
  children: [
749
798
  e.rightLabel && /* @__PURE__ */ (0, x.jsx)("span", { children: e.rightLabel }),
750
- t === e.value && /* @__PURE__ */ (0, x.jsx)(j, { className: L.itemCheck }),
799
+ t === e.value && /* @__PURE__ */ (0, x.jsx)(C, { className: I.itemCheck }),
751
800
  t !== e.value && /* @__PURE__ */ (0, x.jsx)("b", {})
752
801
  ]
753
802
  })]
754
803
  }, e.value))] }, `group-${n}`) : /* @__PURE__ */ (0, x.jsxs)("div", {
755
- className: L.item,
804
+ className: I.item,
756
805
  onClick: () => d(e.value),
757
806
  children: [a ? a(e) : /* @__PURE__ */ (0, x.jsx)("span", {
758
- className: L.itemLeft,
807
+ className: I.itemLeft,
759
808
  children: e.label
760
809
  }), /* @__PURE__ */ (0, x.jsxs)("div", {
761
- className: L.itemAddon,
810
+ className: I.itemAddon,
762
811
  children: [
763
812
  e.rightLabel && /* @__PURE__ */ (0, x.jsx)("span", { children: e.rightLabel }),
764
- t === e.value && /* @__PURE__ */ (0, x.jsx)(j, { className: L.itemCheck }),
813
+ t === e.value && /* @__PURE__ */ (0, x.jsx)(C, { className: I.itemCheck }),
765
814
  t !== e.value && /* @__PURE__ */ (0, x.jsx)("b", {})
766
815
  ]
767
816
  })]
768
817
  }, e.value))
769
818
  })]
770
819
  });
771
- }, Ee = {
820
+ }, ye = {
772
821
  input: "_input_kyavx_1",
773
822
  numberClean: "_numberClean_kyavx_39"
774
- }, De = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
775
- let a = t === "number" && n ? Ee.numberClean : "";
823
+ }, be = ({ className: e = "", type: t = "text", hideArrows: n = !0, ref: r, ...i }) => {
824
+ let a = t === "number" && n ? ye.numberClean : "";
776
825
  return /* @__PURE__ */ (0, x.jsx)("input", {
777
826
  ref: r,
778
827
  type: t,
779
- className: `${Ee.input} ${a} ${e}`.trim(),
828
+ className: `${ye.input} ${a} ${e}`.trim(),
780
829
  ...i
781
830
  });
782
- }, Oe = {
831
+ }, xe = {
783
832
  container: "_container_14vsv_1",
784
833
  legend: "_legend_14vsv_4",
785
834
  suffix: "_suffix_14vsv_13"
786
- }, ke = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, x.jsxs)("div", {
787
- className: `${Oe.container} ${t}`.trim(),
835
+ }, Se = ({ label: e, className: t = "", style: n, ref: r, ...i }) => /* @__PURE__ */ (0, x.jsxs)("div", {
836
+ className: `${xe.container} ${t}`.trim(),
788
837
  style: n,
789
838
  children: [
790
839
  /* @__PURE__ */ (0, x.jsx)("span", {
791
- className: Oe.legend,
840
+ className: xe.legend,
792
841
  children: e
793
842
  }),
794
- /* @__PURE__ */ (0, x.jsx)(De, {
843
+ /* @__PURE__ */ (0, x.jsx)(be, {
795
844
  ref: r,
796
845
  type: "number",
797
846
  ...i
798
847
  }),
799
848
  /* @__PURE__ */ (0, x.jsx)("span", {
800
- className: Oe.suffix,
849
+ className: xe.suffix,
801
850
  children: "px"
802
851
  })
803
852
  ]
804
- }), Ae = {
853
+ }), Ce = {
805
854
  group: "_group_1e7jm_1",
806
855
  save: "_save_1e7jm_6",
807
856
  close: "_close_1e7jm_13"
808
- }, z = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, x.jsxs)("div", {
809
- className: Ae.group,
810
- children: [/* @__PURE__ */ (0, x.jsx)(I, {
857
+ }, R = ({ onSave: e, onClose: t, saving: n = !1, disabled: r = !1 }) => /* @__PURE__ */ (0, x.jsxs)("div", {
858
+ className: Ce.group,
859
+ children: [/* @__PURE__ */ (0, x.jsx)(F, {
811
860
  variant: "outline",
812
- className: Ae.save,
861
+ className: Ce.save,
813
862
  "aria-label": "Save",
814
863
  disabled: r || n,
815
864
  onClick: e,
816
- children: n ? /* @__PURE__ */ (0, x.jsx)(be, {}) : /* @__PURE__ */ (0, x.jsx)(j, {})
817
- }), /* @__PURE__ */ (0, x.jsx)(I, {
865
+ children: n ? /* @__PURE__ */ (0, x.jsx)(pe, {}) : /* @__PURE__ */ (0, x.jsx)(C, {})
866
+ }), /* @__PURE__ */ (0, x.jsx)(F, {
818
867
  variant: "outline",
819
- className: Ae.close,
868
+ className: Ce.close,
820
869
  "aria-label": "Close",
821
870
  disabled: n,
822
871
  onClick: t,
823
- children: /* @__PURE__ */ (0, x.jsx)(ee, {})
872
+ children: /* @__PURE__ */ (0, x.jsx)(w, {})
824
873
  })]
825
- }), B = {
874
+ }), z = {
826
875
  sliderContainer: "_sliderContainer_1unyb_1",
827
876
  disabled: "_disabled_1unyb_11",
828
877
  sliderThumb: "_sliderThumb_1unyb_17",
@@ -830,10 +879,10 @@ var L = {
830
879
  sliderRange: "_sliderRange_1unyb_34",
831
880
  sliderTooltip: "_sliderTooltip_1unyb_58",
832
881
  hiddenInput: "_hiddenInput_1unyb_86"
833
- }, je = (e, t, n) => {
882
+ }, we = (e, t, n) => {
834
883
  let r = n - t;
835
884
  return r <= 0 ? 0 : (e - t) / r * 100;
836
- }, Me = /* @__PURE__ */ new Set([
885
+ }, Te = /* @__PURE__ */ new Set([
837
886
  "ArrowDown",
838
887
  "ArrowLeft",
839
888
  "ArrowRight",
@@ -842,12 +891,12 @@ var L = {
842
891
  "Home",
843
892
  "PageDown",
844
893
  "PageUp"
845
- ]), Ne = ({ min: e, max: t, value: n, step: r = 1, disabled: i = !1, isTooltip: a = !1, unit: o = "", className: l, onChange: f, onInput: p, ref: m }) => {
894
+ ]), Ee = ({ min: e, max: t, value: n, step: r = 1, disabled: i = !1, isTooltip: a = !1, unit: o = "", className: l, onChange: f, onInput: p, ref: m }) => {
846
895
  let h = u(null), g = u(null), _ = n ?? e, [v, y] = d(_);
847
896
  s(m, () => ({ getValue: () => v }), [v]);
848
897
  let b = (n) => {
849
898
  y(n);
850
- let r = je(n, e, t);
899
+ let r = we(n, e, t);
851
900
  h.current?.style.setProperty("--slider-progress", `${r}%`);
852
901
  }, S = () => {
853
902
  !i && g.current && f?.(Number(g.current.value));
@@ -857,7 +906,7 @@ var L = {
857
906
  n !== void 0 && (g.current.value = String(n));
858
907
  let r = Number(g.current.value);
859
908
  y(r);
860
- let i = je(r, e, t);
909
+ let i = we(r, e, t);
861
910
  h.current?.style.setProperty("--slider-progress", `${i}%`);
862
911
  }, [
863
912
  n,
@@ -865,15 +914,15 @@ var L = {
865
914
  t
866
915
  ]), /* @__PURE__ */ (0, x.jsxs)("div", {
867
916
  ref: h,
868
- className: `${B.sliderContainer} ${i ? B.disabled : ""} ${l || ""}`,
869
- style: { "--slider-progress": `${je(_, e, t)}%` },
917
+ className: `${z.sliderContainer} ${i ? z.disabled : ""} ${l || ""}`,
918
+ style: { "--slider-progress": `${we(_, e, t)}%` },
870
919
  children: [/* @__PURE__ */ (0, x.jsxs)("div", {
871
- className: B.sliderTrack,
920
+ className: z.sliderTrack,
872
921
  children: [
873
- /* @__PURE__ */ (0, x.jsx)("div", { className: B.sliderRange }),
874
- /* @__PURE__ */ (0, x.jsx)("div", { className: B.sliderThumb }),
922
+ /* @__PURE__ */ (0, x.jsx)("div", { className: z.sliderRange }),
923
+ /* @__PURE__ */ (0, x.jsx)("div", { className: z.sliderThumb }),
875
924
  a && /* @__PURE__ */ (0, x.jsx)("div", {
876
- className: B.sliderTooltip,
925
+ className: z.sliderTooltip,
877
926
  children: `${v}${o}`
878
927
  })
879
928
  ]
@@ -893,12 +942,12 @@ var L = {
893
942
  S();
894
943
  },
895
944
  onKeyUp: (e) => {
896
- Me.has(e.key) && S();
945
+ Te.has(e.key) && S();
897
946
  },
898
- className: B.hiddenInput
947
+ className: z.hiddenInput
899
948
  })]
900
949
  });
901
- }, V = {
950
+ }, B = {
902
951
  tooltip: "_tooltip_1rdl9_1",
903
952
  container: "_container_1rdl9_5",
904
953
  popup: "_popup_1rdl9_19",
@@ -906,7 +955,7 @@ var L = {
906
955
  mask: "_mask_1rdl9_101",
907
956
  track: "_track_1rdl9_108",
908
957
  title: "_title_1rdl9_125"
909
- }, Pe = (t, n = "top") => {
958
+ }, De = (t, n = "top") => {
910
959
  let [i, a] = d(null), [s, f] = d(null), [p, m] = d(!1), [h, g] = d(!1), [_, v] = d([]), y = u(null), b = u(null), x = u([]), S = n === "left" || n === "right", C = l(() => {
911
960
  let n = [];
912
961
  return e.forEach(t, (e) => {
@@ -978,269 +1027,138 @@ var L = {
978
1027
  handleMouseMove: E,
979
1028
  handleMouseLeave: D
980
1029
  };
981
- }, H = ({ children: e, position: t = "top", className: n = "", classNameTitle: r = "", style: i }) => {
982
- let { containerRef: a, trackRef: o, titleRefs: s, titles: c, isAnimated: l, cssVars: u, handleMouseMove: d, handleMouseLeave: f } = Pe(e, t);
1030
+ }, V = ({ children: e, position: t = "top", className: n = "", classNameTitle: r = "", style: i }) => {
1031
+ let { containerRef: a, trackRef: o, titleRefs: s, titles: c, isAnimated: l, cssVars: u, handleMouseMove: d, handleMouseLeave: f } = De(e, t);
983
1032
  return /* @__PURE__ */ (0, x.jsxs)("div", {
984
1033
  ref: a,
985
1034
  onMouseMove: d,
986
1035
  onMouseLeave: f,
987
1036
  onBlur: f,
988
- className: V.tooltip,
1037
+ className: B.tooltip,
989
1038
  style: {
990
1039
  ...u,
991
1040
  ...i
992
1041
  },
993
1042
  children: [/* @__PURE__ */ (0, x.jsx)("div", {
994
1043
  "data-position": t,
995
- className: `${V.container} ${n}`,
1044
+ className: `${B.container} ${n}`,
996
1045
  children: e
997
1046
  }), /* @__PURE__ */ (0, x.jsx)("div", {
998
1047
  "aria-hidden": "true",
999
1048
  "data-position": t,
1000
- className: `${V.popup} ${l ? V.animated : ""}`,
1049
+ className: `${B.popup} ${l ? B.animated : ""}`,
1001
1050
  children: /* @__PURE__ */ (0, x.jsx)("div", {
1002
- className: V.mask,
1051
+ className: B.mask,
1003
1052
  children: /* @__PURE__ */ (0, x.jsx)("div", {
1004
1053
  ref: o,
1005
1054
  "data-position": t,
1006
- className: V.track,
1055
+ className: B.track,
1007
1056
  children: c.map((e, t) => /* @__PURE__ */ (0, x.jsx)("div", {
1008
1057
  ref: (e) => {
1009
1058
  s.current[t] = e;
1010
1059
  },
1011
- className: `${V.title} ${r}`,
1060
+ className: `${B.title} ${r}`,
1012
1061
  children: e
1013
1062
  }, t))
1014
1063
  })
1015
1064
  })
1016
1065
  })]
1017
1066
  });
1018
- }, Fe = { surfaceTool: "_surfaceTool_e739m_1" }, U = ({ children: e, className: t = "", ref: n }) => /* @__PURE__ */ (0, x.jsx)("div", {
1019
- ref: n,
1020
- className: `${Fe.surfaceTool} ${t}`,
1021
- children: e
1022
- }), Ie = 1920, Le = .85, Re = [
1023
- {
1024
- label: "Facebook",
1025
- value: "facebook",
1026
- options: [
1027
- {
1028
- value: "facebook-post",
1029
- label: "Post",
1030
- w: 1200,
1031
- h: 630,
1032
- rightLabel: "1200 x 630"
1033
- },
1034
- {
1035
- value: "facebook-cover",
1036
- label: "Cover",
1037
- w: 851,
1038
- h: 315,
1039
- rightLabel: "851 x 315"
1040
- },
1041
- {
1042
- value: "facebook-profile",
1043
- label: "Profile",
1044
- w: 170,
1045
- h: 170,
1046
- rightLabel: "170 x 170"
1047
- },
1048
- {
1049
- value: "facebook-story",
1050
- label: "Story",
1051
- w: 1080,
1052
- h: 1920,
1053
- rightLabel: "1080 x 1920"
1054
- }
1055
- ]
1056
- },
1057
- {
1058
- label: "Instagram",
1059
- value: "instagram",
1060
- options: [
1061
- {
1062
- value: "instagram-landscape",
1063
- label: "Landscape",
1064
- w: 1080,
1065
- h: 566,
1066
- rightLabel: "1080 x 566"
1067
- },
1068
- {
1069
- value: "instagram-portait",
1070
- label: "Portait",
1071
- w: 1080,
1072
- h: 1350,
1073
- rightLabel: "1080 x 1350"
1074
- },
1075
- {
1076
- value: "instagram-square",
1077
- label: "Square",
1078
- w: 1080,
1079
- h: 1080,
1080
- rightLabel: "1080 x 1080"
1081
- },
1082
- {
1083
- value: "instagram-story",
1084
- label: "Story",
1085
- w: 1080,
1086
- h: 1920,
1087
- rightLabel: "1080 x 1920"
1088
- },
1089
- {
1090
- value: "instagram-thumbnail",
1091
- label: "Thumbnail",
1092
- w: 161,
1093
- h: 161,
1094
- rightLabel: "161 x 161"
1095
- }
1096
- ]
1097
- },
1098
- {
1099
- label: "LinkedIn",
1100
- value: "linkedin",
1101
- options: [
1102
- {
1103
- value: "linkedin-blog-post",
1104
- label: "Blog Post",
1105
- w: 1200,
1106
- h: 627,
1107
- rightLabel: "1200 x 627"
1108
- },
1109
- {
1110
- value: "linkedin-cover",
1111
- label: "Cover",
1112
- w: 1128,
1113
- h: 191,
1114
- rightLabel: "1128 x 191"
1115
- },
1116
- {
1117
- value: "linkedin-profile",
1118
- label: "Profile",
1119
- w: 400,
1120
- h: 400,
1121
- rightLabel: "400 x 400"
1122
- }
1123
- ]
1124
- }
1125
- ], ze = [
1126
- {
1127
- value: "saturate",
1128
- label: "Saturate",
1129
- min: 0,
1130
- max: 200,
1131
- step: 1,
1132
- unit: "%",
1133
- sliderValue: 100,
1134
- rightLabel: "100%"
1135
- },
1136
- {
1137
- value: "grayscale",
1138
- label: "Grayscale",
1139
- min: 0,
1140
- max: 100,
1141
- step: 1,
1142
- unit: "%",
1143
- sliderValue: 0,
1144
- rightLabel: "0%"
1145
- },
1146
- {
1147
- value: "sepia",
1148
- label: "Sepia",
1149
- min: 0,
1150
- max: 100,
1151
- step: 1,
1152
- unit: "%",
1153
- sliderValue: 0,
1154
- rightLabel: "0%"
1155
- },
1156
- {
1157
- value: "invert",
1158
- label: "Invert",
1159
- min: 0,
1160
- max: 100,
1161
- step: 1,
1162
- unit: "%",
1163
- sliderValue: 0,
1164
- rightLabel: "0%"
1165
- },
1166
- {
1167
- value: "hueRotate",
1168
- label: "Hue Rotate",
1169
- min: 0,
1170
- max: 360,
1171
- step: 1,
1172
- unit: "°",
1173
- sliderValue: 0,
1174
- rightLabel: "0°"
1175
- },
1176
- {
1177
- value: "brightness",
1178
- label: "Brightness",
1179
- min: 0,
1180
- max: 200,
1181
- step: 1,
1182
- unit: "%",
1183
- sliderValue: 100,
1184
- rightLabel: "100%"
1185
- },
1186
- {
1187
- value: "contrast",
1188
- label: "Contrast",
1189
- min: 0,
1190
- max: 200,
1191
- step: 1,
1192
- unit: "%",
1193
- sliderValue: 100,
1194
- rightLabel: "100%"
1195
- }
1196
- ], Be = [
1197
- {
1198
- value: "vintage",
1199
- label: "Vintage"
1200
- },
1201
- {
1202
- value: "olive-army",
1203
- label: "Olive Army"
1204
- },
1205
- {
1206
- value: "warm-sunset",
1207
- label: "Warm Sunset"
1208
- },
1209
- {
1210
- value: "sin-city-red",
1211
- label: "Sin City Red"
1212
- },
1213
- {
1214
- value: "plastic-wrap",
1215
- label: "Plastic Wrap"
1216
- },
1217
- {
1218
- value: "cross-process",
1219
- label: "Cross-Processing"
1220
- },
1221
- {
1222
- value: "crt-lines",
1223
- label: "CRT Monitor"
1224
- },
1225
- {
1226
- value: "grain",
1227
- label: "Grain / Noise"
1228
- },
1229
- {
1230
- value: "emboss",
1231
- label: "Emboss Effect"
1232
- },
1233
- {
1234
- value: "x-ray",
1235
- label: "X-Ray"
1067
+ }, Oe = "(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.`})}}})();", ke = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", Oe], { type: "text/javascript;charset=utf-8" });
1068
+ function Ae(e) {
1069
+ let t;
1070
+ try {
1071
+ if (t = ke && (self.URL || self.webkitURL).createObjectURL(ke), !t) throw "";
1072
+ let n = new Worker(t, { name: e?.name });
1073
+ return n.addEventListener("error", () => {
1074
+ (self.URL || self.webkitURL).revokeObjectURL(t);
1075
+ }), n;
1076
+ } catch {
1077
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(Oe), { name: e?.name });
1236
1078
  }
1237
- ], W = 32, Ve = (e, t, n, r, i, a, o, s, c, l) => {
1079
+ }
1080
+ //#endregion
1081
+ //#region src/shared/components/Pixedi/hooks/useImageLoader.tsx
1082
+ var je = ({ src: e, skip: t = !1 }) => {
1083
+ let [n, r] = d({
1084
+ loading: !t,
1085
+ error: "",
1086
+ width: 0,
1087
+ height: 0,
1088
+ mimeType: "",
1089
+ originalBlob: null,
1090
+ previewUrl: "",
1091
+ isAlpha: !1
1092
+ }), i = u(null);
1093
+ return o(() => {
1094
+ if (!e || t) return;
1095
+ let n = new Ae();
1096
+ return n.postMessage(e), n.onmessage = (e) => {
1097
+ let t = e.data;
1098
+ t.success ? (i.current && URL.revokeObjectURL(i.current), i.current = URL.createObjectURL(t.previewBlob), r({
1099
+ loading: !1,
1100
+ error: "",
1101
+ mimeType: t.mimeType,
1102
+ width: t.width,
1103
+ height: t.height,
1104
+ originalBlob: t.originalBlob,
1105
+ previewUrl: i.current,
1106
+ isAlpha: t.isAlpha
1107
+ })) : r((e) => ({
1108
+ ...e,
1109
+ loading: !1,
1110
+ error: t.error || "Error processing image."
1111
+ }));
1112
+ }, () => {
1113
+ n.terminate(), i.current &&= (URL.revokeObjectURL(i.current), null);
1114
+ };
1115
+ }, [t, e]), n;
1116
+ }, Me = () => {
1117
+ if (typeof window > "u" || !window.navigator) return null;
1118
+ let e = window.navigator.userAgent.toLowerCase();
1119
+ 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;
1120
+ }, H = () => {
1121
+ let [e] = d(() => Me());
1122
+ return e;
1123
+ }, Ne = {
1124
+ sm: 480,
1125
+ md: 768,
1126
+ lg: 1024,
1127
+ xl: 1280
1128
+ }, U = {
1129
+ INITIAL: "initial",
1130
+ RESIZE: "resize",
1131
+ CROP: "crop",
1132
+ PRESET_CROP: "presetCrop",
1133
+ FLIP: "flip",
1134
+ ROTATE: "rotate",
1135
+ FILTERS: "filters"
1136
+ };
1137
+ //#endregion
1138
+ //#region src/shared/components/Pixedi/hooks/useBellow.tsx
1139
+ function Pe(e, t) {
1140
+ let [n, r] = d(!0);
1141
+ return o(() => {
1142
+ if (!t) return;
1143
+ let n = new ResizeObserver(([t]) => {
1144
+ t && r(t.contentRect.width < Ne[e]);
1145
+ });
1146
+ return n.observe(t), () => n.disconnect();
1147
+ }, [e, t]), n;
1148
+ }
1149
+ //#endregion
1150
+ //#region src/shared/components/Pixedi/provider/StoreContext.tsx
1151
+ var Fe = t(void 0), W = () => {
1152
+ let e = a(Fe);
1153
+ if (!e) throw Error("usePixediContext must be used within an PixediProvider");
1154
+ return e;
1155
+ }, G = 32, Ie = (e, t, n, r, i, a, o, s, c, l) => {
1238
1156
  let { x: u, y: d, w: f, h: p } = c;
1239
1157
  if (e) {
1240
1158
  let e = o - c.w - c.x;
1241
- u += i - n, u < 0 && (u = 0), f = o - u - e, f < W && (f = W, u = o - e - W);
1159
+ u += i - n, u < 0 && (u = 0), f = o - u - e, f < G && (f = G, u = o - e - G);
1242
1160
  let t = s - p - d;
1243
- d += a - r, d < 0 && (d = 0), p = s - d - t, p < W && (p = W, d = s - t - W);
1161
+ d += a - r, d < 0 && (d = 0), p = s - d - t, p < G && (p = G, d = s - t - G);
1244
1162
  } else {
1245
1163
  if (t >= 1) {
1246
1164
  let e = i - n, r = Math.round(e / t);
@@ -1249,7 +1167,7 @@ var L = {
1249
1167
  let e = a - r, n = Math.round(e * t);
1250
1168
  f -= n, p -= e, u += n, d += e;
1251
1169
  }
1252
- if (u < 0 || d < 0 || f < W || p < W) return l;
1170
+ if (u < 0 || d < 0 || f < G || p < G) return l;
1253
1171
  }
1254
1172
  return {
1255
1173
  x: u,
@@ -1257,12 +1175,12 @@ var L = {
1257
1175
  w: f,
1258
1176
  h: p
1259
1177
  };
1260
- }, He = (e, t, n, r, i, a, o, s, c, l) => {
1178
+ }, Le = (e, t, n, r, i, a, o, s, c, l) => {
1261
1179
  let { x: u } = c, { y: d, w: f, h: p } = c;
1262
1180
  if (e) {
1263
- f += i - n, f + u > o && (f = o - u), f < W && (f = W);
1181
+ f += i - n, f + u > o && (f = o - u), f < G && (f = G);
1264
1182
  let e = s - p - d;
1265
- d += a - r, d < 0 && (d = 0), p = s - d - e, p < W && (p = W, d = s - e - W);
1183
+ d += a - r, d < 0 && (d = 0), p = s - d - e, p < G && (p = G, d = s - e - G);
1266
1184
  } else {
1267
1185
  if (t > 1) {
1268
1186
  let e = i - n, r = Math.round(e / t);
@@ -1271,7 +1189,7 @@ var L = {
1271
1189
  let e = a - r, n = Math.round(e * t);
1272
1190
  f -= n, p -= e, d += e;
1273
1191
  }
1274
- if (f + u > o || d < 0 || f < W || p < W) return l;
1192
+ if (f + u > o || d < 0 || f < G || p < G) return l;
1275
1193
  }
1276
1194
  return {
1277
1195
  x: u,
@@ -1279,12 +1197,12 @@ var L = {
1279
1197
  w: f,
1280
1198
  h: p
1281
1199
  };
1282
- }, Ue = (e, t, n, r, i, a, o, s, c, l) => {
1200
+ }, Re = (e, t, n, r, i, a, o, s, c, l) => {
1283
1201
  let { y: u } = c, { x: d, w: f, h: p } = c;
1284
1202
  if (e) {
1285
- p += a - r, p + u > s && (p = s - u), p < W && (p = W);
1203
+ p += a - r, p + u > s && (p = s - u), p < G && (p = G);
1286
1204
  let e = o - c.w - c.x;
1287
- d += i - n, d < 0 && (d = 0), f = o - d - e, f < W && (f = W, d = o - e - W);
1205
+ d += i - n, d < 0 && (d = 0), f = o - d - e, f < G && (f = G, d = o - e - G);
1288
1206
  } else {
1289
1207
  if (t >= 1) {
1290
1208
  let e = i - n, r = Math.round(e / t);
@@ -1293,7 +1211,7 @@ var L = {
1293
1211
  let e = a - r, n = Math.round(e * t);
1294
1212
  f += n, p += e, d -= n;
1295
1213
  }
1296
- if (p + u > s || d < 0 || f < W || p < W) return l;
1214
+ if (p + u > s || d < 0 || f < G || p < G) return l;
1297
1215
  }
1298
1216
  return {
1299
1217
  x: d,
@@ -1301,9 +1219,9 @@ var L = {
1301
1219
  w: f,
1302
1220
  h: p
1303
1221
  };
1304
- }, We = (e, t, n, r, i, a, o, s, c, l) => {
1222
+ }, ze = (e, t, n, r, i, a, o, s, c, l) => {
1305
1223
  let { x: u, y: d } = c, { w: f, h: p } = c;
1306
- if (e) f += i - n, f + u > o && (f = o - u), f < W && (f = W), p += a - r, p + d > s && (p = s - d), p < W && (p = W);
1224
+ if (e) f += i - n, f + u > o && (f = o - u), f < G && (f = G), p += a - r, p + d > s && (p = s - d), p < G && (p = G);
1307
1225
  else {
1308
1226
  if (t >= 1) {
1309
1227
  let e = i - n, r = Math.round(e / t);
@@ -1312,7 +1230,7 @@ var L = {
1312
1230
  let e = a - r, n = Math.round(e * t);
1313
1231
  f += n, p += e;
1314
1232
  }
1315
- if (p + d > s || f + u > o || f < W || p < W) return l;
1233
+ if (p + d > s || f + u > o || f < G || p < G) return l;
1316
1234
  }
1317
1235
  return {
1318
1236
  x: u,
@@ -1320,20 +1238,20 @@ var L = {
1320
1238
  w: f,
1321
1239
  h: p
1322
1240
  };
1323
- }, Ge = (e, t, n, r, i, a, o, s, c) => {
1324
- 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(W, W * t), b = Math.min(Math.max(h, y), v), x = b / t;
1241
+ }, Be = (e, t, n, r, i, a, o, s, c) => {
1242
+ 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(G, G * t), b = Math.min(Math.max(h, y), v), x = b / t;
1325
1243
  return {
1326
1244
  x: l ? d - b : c.x,
1327
1245
  y: u ? f - x : c.y,
1328
1246
  w: b,
1329
1247
  h: x
1330
1248
  };
1331
- }, Ke = (e, t, n, r, i, a, o, s, c, l, u) => t ? e === "tl" ? Ve(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? He(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? Ue(t, n, r, i, a, o, s, c, l, u) : e === "br" ? We(t, n, r, i, a, o, s, c, l, u) : {
1249
+ }, Ve = (e, t, n, r, i, a, o, s, c, l, u) => t ? e === "tl" ? Ie(t, n, r, i, a, o, s, c, l, u) : e === "tr" ? Le(t, n, r, i, a, o, s, c, l, u) : e === "bl" ? Re(t, n, r, i, a, o, s, c, l, u) : e === "br" ? ze(t, n, r, i, a, o, s, c, l, u) : {
1332
1250
  x: 0,
1333
1251
  y: 0,
1334
1252
  w: 0,
1335
1253
  h: 0
1336
- } : Ge(e, n, r, i, a, o, s, c, l), G = (e, t, n) => {
1254
+ } : Be(e, n, r, i, a, o, s, c, l), K = (e, t, n) => {
1337
1255
  let r = .12, i = t / n, a = 0, o = 0;
1338
1256
  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));
1339
1257
  let s = a / t * 100, c = o / n * 100, l = (t - a) / 2 / t * 100, u = (n - o) / 2 / n * 100;
@@ -1347,7 +1265,7 @@ var L = {
1347
1265
  wP: Math.round(s / 100 * t),
1348
1266
  hP: Math.round(c / 100 * n)
1349
1267
  };
1350
- }, qe = (e, t, n, r) => {
1268
+ }, He = (e, t, n, r) => {
1351
1269
  let i = e.w / 100 * n, a = e.h / 100 * r;
1352
1270
  t >= 1 ? a = i / t : i = a * t;
1353
1271
  let o = i / n * 100, s = a / r * 100, c = Math.max(o / (100 - e.x), s / (100 - e.y), 1);
@@ -1356,21 +1274,21 @@ var L = {
1356
1274
  w: o,
1357
1275
  h: s
1358
1276
  };
1359
- }, K = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, Je = (e, t, n, r) => K(n) === K(r) ? {
1277
+ }, Ue = (e) => Math.abs(Math.round(e / 90)) % 2 == 1, We = (e, t, n, r) => Ue(n) === Ue(r) ? {
1360
1278
  width: e,
1361
1279
  height: t
1362
1280
  } : {
1363
1281
  width: t,
1364
1282
  height: e
1365
- }, Ye = async (e) => {
1366
- let { width: t, height: n } = e, r = Math.min(1, Ie / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
1283
+ }, Ge = async (e) => {
1284
+ let { width: t, height: n } = e, r = Math.min(1, m / Math.max(t, n)), i = Math.round(t * r), a = Math.round(n * r), o = new OffscreenCanvas(i, a), s = o.getContext("2d");
1367
1285
  if (!s) throw Error("Failed to get 2D context for preview canvas");
1368
1286
  return s.drawImage(e, 0, 0, i, a), o.convertToBlob({
1369
1287
  type: "image/webp",
1370
- quality: Le
1288
+ quality: h
1371
1289
  });
1372
1290
  };
1373
- function Xe(e) {
1291
+ function Ke(e) {
1374
1292
  let t = new OffscreenCanvas(e.width, e.height), n = t.getContext("2d");
1375
1293
  if (!n) throw Error("Failed to create 2D context for canvas.");
1376
1294
  n.drawImage(e, 0, 0);
@@ -1384,14 +1302,14 @@ function Xe(e) {
1384
1302
  }
1385
1303
  //#endregion
1386
1304
  //#region src/shared/components/Pixedi/utils/imageProcessor.ts
1387
- var Ze = (e) => new Promise((t, n) => {
1305
+ var qe = (e) => new Promise((t, n) => {
1388
1306
  let r = new FileReader();
1389
1307
  r.onloadend = () => {
1390
1308
  let e = r.result;
1391
1309
  typeof e == "string" ? t(e) : n(/* @__PURE__ */ Error("Failed to read blob as base64"));
1392
1310
  }, r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("FileReader error")), r.readAsDataURL(e);
1393
1311
  });
1394
- async function Qe(e) {
1312
+ async function Je(e) {
1395
1313
  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 });
1396
1314
  i.width = t.width, i.height = t.height, a?.drawImage(t, 0, 0), t.close();
1397
1315
  let o = () => {
@@ -1431,7 +1349,7 @@ async function Qe(e) {
1431
1349
  }, a, t) : i.toBlob((t) => {
1432
1350
  t ? e(t) : o(/* @__PURE__ */ Error("Failed to encode image as image/png"));
1433
1351
  }, "image/png");
1434
- }), s = await createImageBitmap(o), c = await Ye(s), { width: l, height: u } = s, d = Xe(s);
1352
+ }), s = await createImageBitmap(o), c = await Ge(s), { width: l, height: u } = s, d = Ke(s);
1435
1353
  return s.close(), {
1436
1354
  newBlob: o,
1437
1355
  previewBlob: c,
@@ -1445,17 +1363,17 @@ async function Qe(e) {
1445
1363
  }
1446
1364
  //#endregion
1447
1365
  //#region src/shared/components/Pixedi/utils/preview.ts
1448
- var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (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]]], et = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, tt = (e) => {
1449
- switch (et(e)) {
1366
+ var Ye = (e, t, n) => Math.max(t, Math.min(n, e)), Xe = (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]]], Ze = (e) => (Math.round(e / 90) % 4 + 4) % 4 * 90, Qe = (e) => {
1367
+ switch (Ze(e)) {
1450
1368
  case 90: return [[0, -1], [1, 0]];
1451
1369
  case 180: return [[-1, 0], [0, -1]];
1452
1370
  case 270: return [[0, 1], [-1, 0]];
1453
1371
  default: return [[1, 0], [0, 1]];
1454
1372
  }
1455
- }, nt = (e, t) => [[e ? -1 : 1, 0], [0, t ? -1 : 1]], rt = (e, t, n) => $e(nt(t, n), tt(-e)), it = (e) => [+(e[0][0] < 0 || e[0][1] < 0), +(e[1][0] < 0 || e[1][1] < 0)], at = (e, t, n) => {
1456
- let r = it(e);
1373
+ }, $e = (e, t) => [[e ? -1 : 1, 0], [0, t ? -1 : 1]], et = (e, t, n) => Xe($e(t, n), Qe(-e)), tt = (e) => [+(e[0][0] < 0 || e[0][1] < 0), +(e[1][0] < 0 || e[1][1] < 0)], nt = (e, t, n) => {
1374
+ let r = tt(e);
1457
1375
  return [e[0][0] * t + e[0][1] * n + r[0], e[1][0] * t + e[1][1] * n + r[1]];
1458
- }, ot = (e) => {
1376
+ }, rt = (e) => {
1459
1377
  let t = 1, n = 1, r = {
1460
1378
  x: 0,
1461
1379
  y: 0,
@@ -1464,18 +1382,18 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1464
1382
  }, i = 0, a = !1, o = !1;
1465
1383
  for (let s = 0; s < e.length; s++) {
1466
1384
  let c = e[s];
1467
- if (c.action.name === h.INITIAL) t = c.width, n = c.height, r = {
1385
+ if (c.action.name === U.INITIAL) t = c.width, n = c.height, r = {
1468
1386
  x: 0,
1469
1387
  y: 0,
1470
1388
  w: 1,
1471
1389
  h: 1
1472
1390
  }, i = 0, a = !1, o = !1;
1473
- else if (c.action.name === h.CROP) {
1474
- 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 = rt(i, a, o), u = [
1475
- at(l, e, t),
1476
- at(l, e + n, t),
1477
- at(l, e, t + s),
1478
- at(l, e + n, t + s)
1391
+ else if (c.action.name === U.CROP) {
1392
+ 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 = et(i, a, o), u = [
1393
+ nt(l, e, t),
1394
+ nt(l, e + n, t),
1395
+ nt(l, e, t + s),
1396
+ nt(l, e + n, t + s)
1479
1397
  ], 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]));
1480
1398
  r = {
1481
1399
  x: r.x + d * r.w,
@@ -1483,12 +1401,12 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1483
1401
  w: r.w * (f - d),
1484
1402
  h: r.h * (m - p)
1485
1403
  };
1486
- } else if (c.action.name === h.FLIP) {
1487
- let e = K(i), t = e ? c.action.args.vertical : c.action.args.horizontal, n = e ? c.action.args.horizontal : c.action.args.vertical;
1404
+ } else if (c.action.name === U.FLIP) {
1405
+ let e = Ue(i), t = e ? c.action.args.vertical : c.action.args.horizontal, n = e ? c.action.args.horizontal : c.action.args.vertical;
1488
1406
  t && (a = !a), n && (o = !o);
1489
- } else c.action.name === h.ROTATE && (i = c.action.args.degrees);
1407
+ } else c.action.name === U.ROTATE && (i = c.action.args.degrees);
1490
1408
  }
1491
- let s = r.w * t, c = r.h * n, l = K(i), u = l ? c : s, d = l ? s : c, f = e.at(-1)?.width || 0, p = e.at(-1)?.height || 0, m = e.filter((e) => e.action.name === h.FILTERS).at(-1), g = Object.entries(m?.action.args || {}).map(([e, t]) => e === "url" ? `url(#${t})` : e === "hueRotate" ? `hue-rotate(${t}deg)` : `${e}(${t}%)`);
1409
+ let s = r.w * t, c = r.h * n, l = Ue(i), u = l ? c : s, d = l ? s : c, f = e.at(-1)?.width || 0, p = e.at(-1)?.height || 0, m = e.filter((e) => e.action.name === U.FILTERS).at(-1), h = Object.entries(m?.action.args || {}).map(([e, t]) => e === "url" ? `url(#${t})` : e === "hueRotate" ? `hue-rotate(${t}deg)` : `${e}(${t}%)`);
1492
1410
  return {
1493
1411
  box: r,
1494
1412
  boxWidth: s,
@@ -1502,15 +1420,15 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1502
1420
  rotation: i,
1503
1421
  flipH: a,
1504
1422
  flipV: o,
1505
- filters: g
1423
+ filters: h
1506
1424
  };
1507
- }, st = (e) => {
1508
- let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = ot(e), d = e.filter((e) => e.action.name === h.FILTERS).at(-1)?.action.args, f = q(t.x, 0, 1), p = q(t.y, 0, 1), m = {
1425
+ }, it = (e) => {
1426
+ let { box: t, flipH: n, flipV: r, rotation: i, newWidth: a, newHeight: o, initWidth: s, initHeight: c, viewWidth: l, viewHeight: u } = rt(e), d = e.filter((e) => e.action.name === U.FILTERS).at(-1)?.action.args, f = Ye(t.x, 0, 1), p = Ye(t.y, 0, 1), m = {
1509
1427
  x: f,
1510
1428
  y: p,
1511
- w: q(t.w, 0, 1 - f),
1512
- h: q(t.h, 0, 1 - p)
1513
- }, g = et(i);
1429
+ w: Ye(t.w, 0, 1 - f),
1430
+ h: Ye(t.h, 0, 1 - p)
1431
+ }, h = Ze(i);
1514
1432
  return {
1515
1433
  ...m.x === 0 && m.y === 0 && m.w === 1 && m.h === 1 ? {} : { crop: {
1516
1434
  x: Math.round(s * t.x),
@@ -1518,7 +1436,7 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1518
1436
  w: Math.round(s * t.w),
1519
1437
  h: Math.round(c * t.h)
1520
1438
  } },
1521
- ...g === 0 ? {} : { rotate: { degrees: g } },
1439
+ ...h === 0 ? {} : { rotate: { degrees: h } },
1522
1440
  ...n || r ? { flip: {
1523
1441
  horizontal: n,
1524
1442
  vertical: r
@@ -1529,21 +1447,21 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1529
1447
  } } : {},
1530
1448
  ...d ? { filters: d } : {}
1531
1449
  };
1532
- }, ct = (e) => {
1533
- let [t, n] = d(!1), { setImage: r, settings: i, history: a, originalBlob: o, setCurrentAction: s, resetHistory: c } = P();
1450
+ }, at = () => {
1451
+ let [e, t] = d(!1), { setImage: n, settings: r, history: i, originalBlob: a, setCurrentAction: o, resetHistory: s, onSave: c } = W();
1534
1452
  return {
1535
- save: async () => {
1536
- if (!o) return;
1537
- n(!0);
1538
- let t = st(a.items.slice(0, a.pointer + 1));
1453
+ save: async (o) => {
1454
+ if (!a || e) return;
1455
+ t(!0);
1456
+ let s = it([...i.items.slice(0, i.pointer + 1), ...o ? [o] : []]);
1539
1457
  try {
1540
- let n = await Qe(o);
1541
- 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), t.filters && n.filters(t.filters);
1542
- let { newBlob: a, previewBlob: s, mimeType: c, width: l, height: u, isAlpha: d } = await n.get(i), f = "";
1543
- i.exportAs === "base64" && (f = await Ze(a)), await e(f || a), r({
1544
- newBlob: a,
1545
- previewBlob: s,
1546
- mimeType: c,
1458
+ let e = await Je(a);
1459
+ s.crop && e.crop(s.crop.x, s.crop.y, s.crop.w, s.crop.h), s.flip && e.flip(s.flip.horizontal, s.flip.vertical), s.rotate && e.rotate(s.rotate.degrees), s.resize && e.resize(s.resize.width, s.resize.height), s.filters && e.filters(s.filters);
1460
+ let { newBlob: t, previewBlob: i, mimeType: o, width: l, height: u, isAlpha: d } = await e.get(r), f = "";
1461
+ r.exportAs === "base64" && (f = await qe(t)), await c(f || t), n({
1462
+ newBlob: t,
1463
+ previewBlob: i,
1464
+ mimeType: o,
1547
1465
  width: l,
1548
1466
  height: u,
1549
1467
  isAlpha: d
@@ -1551,119 +1469,163 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1551
1469
  } catch (e) {
1552
1470
  throw Error(`Error saving image: ${e}`, { cause: e });
1553
1471
  } finally {
1554
- n(!1);
1472
+ t(!1);
1555
1473
  }
1556
1474
  },
1557
1475
  reset: () => {
1558
- s(null), c();
1476
+ o(null), s();
1559
1477
  },
1560
- isSaving: t
1478
+ isSaving: e
1561
1479
  };
1562
- }, J = {
1563
- header: "_header_m05h6_1",
1564
- left: "_left_m05h6_12",
1565
- sidebarToggle: "_sidebarToggle_m05h6_17",
1566
- mobile: "_mobile_m05h6_30",
1567
- sidebarIcon: "_sidebarIcon_m05h6_34",
1568
- tools: "_tools_m05h6_39",
1569
- history: "_history_m05h6_43",
1570
- historyText: "_historyText_m05h6_48"
1571
- }, lt = ({ onBack: e, onSave: t, isMobile: n }) => {
1572
- let { save: r, reset: i, isSaving: a } = ct(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;
1480
+ }, q = () => {
1481
+ let { singleToolUI: e, addToHistory: t, setCurrentAction: n, setSidebar: r, onBack: i } = W(), { save: a, isSaving: o } = at();
1482
+ return {
1483
+ commit: (n) => {
1484
+ if (e) return a(n);
1485
+ t(n), r(!0);
1486
+ },
1487
+ close: () => {
1488
+ if (e) {
1489
+ i();
1490
+ return;
1491
+ }
1492
+ n(null), r(!0);
1493
+ },
1494
+ isSaving: o,
1495
+ singleToolUI: e
1496
+ };
1497
+ }, ot = t(void 0), st = () => {
1498
+ let e = a(ot), t = u({
1499
+ dx: 0,
1500
+ dy: 0
1501
+ });
1502
+ return e ?? t;
1503
+ };
1504
+ //#endregion
1505
+ //#region src/shared/components/Pixedi/ui/surface-tool/useSurfaceTool.tsx
1506
+ function ct(e, t, n) {
1507
+ return Math.min(Math.max(e, t), n);
1508
+ }
1509
+ function lt(e, { dx: t, dy: n }) {
1510
+ e.style.transform = `translate(calc(-50% + ${t}px), ${n}px)`;
1511
+ }
1512
+ function ut(e, t) {
1513
+ let n = e.parentElement;
1514
+ if (!n) return null;
1515
+ let r = e.getBoundingClientRect(), i = n.getBoundingClientRect(), a = r.left - i.left - t.dx, o = r.top - i.top - t.dy;
1516
+ return {
1517
+ minDx: -a,
1518
+ maxDx: Math.max(-a, i.width - r.width - a),
1519
+ minDy: -o,
1520
+ maxDy: Math.max(-o, i.height - r.height - o)
1521
+ };
1522
+ }
1523
+ var dt = ({ surfaceRef: e }) => {
1524
+ let t = H(), n = st(), r = u(null), i = u({
1525
+ dx: 0,
1526
+ dy: 0
1527
+ }), a = u(null);
1528
+ return o(() => {
1529
+ let o = e.current;
1530
+ if (!o) return;
1531
+ let s = (e) => {
1532
+ n.current = e, lt(o, e);
1533
+ }, c = () => {
1534
+ let e = ut(o, n.current);
1535
+ if (!e) return;
1536
+ let { dx: t, dy: r } = n.current;
1537
+ s({
1538
+ dx: ct(t, e.minDx, e.maxDx),
1539
+ dy: ct(r, e.minDy, e.maxDy)
1540
+ });
1541
+ }, l = (e) => {
1542
+ let t = r.current, n = a.current;
1543
+ if (!t || !n) return;
1544
+ e.preventDefault();
1545
+ let o = "clientX" in e ? e.clientX : e.touches[0].clientX, c = "clientY" in e ? e.clientY : e.touches[0].clientY;
1546
+ s({
1547
+ dx: ct(i.current.dx + (o - t.x), n.minDx, n.maxDx),
1548
+ dy: ct(i.current.dy + (c - t.y), n.minDy, n.maxDy)
1549
+ });
1550
+ }, u = () => {
1551
+ r.current && (r.current = null, a.current = null, t || (document.body.style.cursor = ""));
1552
+ };
1553
+ c();
1554
+ let d = new AbortController(), { signal: f } = d;
1555
+ if (document.addEventListener("mousemove", l, { signal: f }), document.addEventListener("touchmove", l, {
1556
+ signal: f,
1557
+ passive: !1
1558
+ }), document.addEventListener("mouseup", u, { signal: f }), document.addEventListener("touchend", u, { signal: f }), typeof ResizeObserver < "u" && o.parentElement) {
1559
+ let e = new ResizeObserver(c);
1560
+ e.observe(o.parentElement), f.addEventListener("abort", () => e.disconnect());
1561
+ }
1562
+ return () => d.abort();
1563
+ }, [
1564
+ e,
1565
+ n,
1566
+ t
1567
+ ]), { handleDragStart: (o) => {
1568
+ let s = e.current;
1569
+ if (!s) return;
1570
+ o.stopPropagation();
1571
+ let c = ut(s, n.current);
1572
+ if (!c) return;
1573
+ let l = "clientX" in o ? o.clientX : o.touches[0].clientX, u = "clientY" in o ? o.clientY : o.touches[0].clientY;
1574
+ r.current = {
1575
+ x: l,
1576
+ y: u
1577
+ }, i.current = { ...n.current }, a.current = c, t || (document.body.style.cursor = "move");
1578
+ } };
1579
+ }, ft = {
1580
+ surfaceTool: "_surfaceTool_1skmt_1",
1581
+ content: "_content_1skmt_18",
1582
+ drag: "_drag_1skmt_22"
1583
+ }, J = ({ children: e, className: t = "", ref: n }) => {
1584
+ let r = u(null), { handleDragStart: i } = dt({ surfaceRef: r });
1573
1585
  return /* @__PURE__ */ (0, x.jsxs)("div", {
1574
- className: J.header,
1575
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
1576
- className: J.left,
1577
- children: [/* @__PURE__ */ (0, x.jsx)("div", {
1578
- className: `${J.sidebarToggle} ${n ? J.mobile : ""}`,
1579
- onClick: () => {
1580
- u(!o);
1581
- },
1582
- children: o ? /* @__PURE__ */ (0, x.jsx)(_e, { className: J.sidebarIcon }) : /* @__PURE__ */ (0, x.jsx)(ge, { className: J.sidebarIcon })
1583
- }), /* @__PURE__ */ (0, x.jsx)(I, {
1584
- variant: "ghost",
1585
- className: F.rect,
1586
- onClick: e,
1587
- children: /* @__PURE__ */ (0, x.jsx)(te, {})
1588
- })]
1589
- }), /* @__PURE__ */ (0, x.jsxs)("div", {
1590
- className: J.tools,
1591
- children: [
1592
- f && /* @__PURE__ */ (0, x.jsxs)("div", {
1593
- className: J.history,
1594
- children: [
1595
- /* @__PURE__ */ (0, x.jsx)(I, {
1596
- variant: "outline",
1597
- disabled: p,
1598
- className: F.rect,
1599
- onClick: () => {
1600
- c(), d(null);
1601
- },
1602
- children: /* @__PURE__ */ (0, x.jsx)(re, {})
1603
- }),
1604
- /* @__PURE__ */ (0, x.jsxs)("div", {
1605
- className: J.historyText,
1606
- children: [
1607
- s.pointer + 1,
1608
- "/",
1609
- s.items.length
1610
- ]
1611
- }),
1612
- /* @__PURE__ */ (0, x.jsx)(I, {
1613
- variant: "outline",
1614
- disabled: m,
1615
- className: F.rect,
1616
- onClick: () => {
1617
- l(), d(null);
1618
- },
1619
- children: /* @__PURE__ */ (0, x.jsx)(ie, {})
1620
- })
1621
- ]
1622
- }),
1623
- /* @__PURE__ */ (0, x.jsx)(I, {
1624
- variant: "outline",
1625
- disabled: h,
1626
- onClick: i,
1627
- children: "Reset"
1628
- }),
1629
- /* @__PURE__ */ (0, x.jsxs)(I, {
1630
- disabled: g,
1631
- onClick: r,
1632
- children: [a ? /* @__PURE__ */ (0, x.jsx)(be, {}) : /* @__PURE__ */ (0, x.jsx)(j, {}), "Save"]
1633
- })
1634
- ]
1586
+ ref: (e) => {
1587
+ r.current = e, n && (n.current = e);
1588
+ },
1589
+ className: ft.surfaceTool,
1590
+ children: [/* @__PURE__ */ (0, x.jsx)(fe, {
1591
+ className: ft.drag,
1592
+ onMouseDown: i,
1593
+ onTouchStart: i
1594
+ }), /* @__PURE__ */ (0, x.jsx)("div", {
1595
+ className: `${ft.content} ${t}`,
1596
+ children: e
1635
1597
  })]
1636
1598
  });
1637
- }, ut = (e, t) => {
1599
+ }, pt = (e, t) => {
1638
1600
  let n = new CustomEvent("crop-update", { detail: t });
1639
1601
  e.dispatchEvent(n);
1640
- }, dt = (e, t) => {
1602
+ }, mt = (e, t) => {
1641
1603
  let n = new CustomEvent("clip-path-update", { detail: t });
1642
1604
  e.dispatchEvent(n);
1643
- }, ft = (e, t) => {
1605
+ }, ht = (e, t) => {
1644
1606
  let n = new CustomEvent("resize-update", { detail: t });
1645
1607
  e.dispatchEvent(n);
1646
- }, pt = (e, t) => {
1608
+ }, gt = (e, t) => {
1647
1609
  let n = new CustomEvent("filter-update", { detail: t });
1648
1610
  e.dispatchEvent(n);
1649
- }, mt = (e, t) => {
1611
+ }, _t = (e, t) => {
1650
1612
  let n = new CustomEvent("compare-update", { detail: t });
1651
1613
  e.dispatchEvent(n);
1652
- }, ht = () => {
1653
- let { showCompare: e, previewUrl: t, getLastFilter: n, getLastHistoryItem: r, setCurrentAction: i, setSidebar: a, toggleCompare: s, addToHistory: c, eventBus: u } = P(), { width: f, height: p } = r(), { action: m } = n() || {}, g = m?.args || {}, _ = g?.url, v = ze.map((e) => ({
1614
+ }, vt = () => {
1615
+ let { showCompare: e, previewUrl: t, getLastFilter: n, getLastHistoryItem: r, toggleCompare: i, eventBus: a } = W(), { commit: s, close: c, isSaving: u } = q(), { width: f, height: p } = r(), { action: m } = n() || {}, h = m?.args || {}, g = h?.url, v = _.map((e) => ({
1654
1616
  ...e,
1655
- sliderValue: g[e.value] ?? e.sliderValue,
1656
- rightLabel: `${g[e.value] ?? e.sliderValue}${e.unit}`
1657
- })), y = v.find((e) => e.value === "saturate")?.sliderValue, [b, x] = d("saturate"), [S, C] = d(_ ?? "vintage"), [w, T] = d(v), [E, D] = d(y ?? 0), [O, k] = d(!!_), A = l(() => Object.fromEntries(w.map((e) => [e.value, e.sliderValue])), [w]), j = () => {
1658
- s(), mt(u, 50);
1659
- }, ee = (e) => {
1660
- pt(u, {
1617
+ sliderValue: h[e.value] ?? e.sliderValue,
1618
+ rightLabel: `${h[e.value] ?? e.sliderValue}${e.unit}`
1619
+ })), y = v.find((e) => e.value === "saturate")?.sliderValue, [b, x] = d("saturate"), [S, C] = d(g ?? "vintage"), [w, T] = d(v), [E, D] = d(y ?? 0), [O, k] = d(!!g), A = l(() => Object.fromEntries(w.map((e) => [e.value, e.sliderValue])), [w]), ee = () => {
1620
+ i(), _t(a, 50);
1621
+ }, te = (e) => {
1622
+ gt(a, {
1661
1623
  ...A,
1662
1624
  [b]: e
1663
1625
  });
1664
- }, M = w.find((e) => e.value === b);
1626
+ }, j = w.find((e) => e.value === b);
1665
1627
  return o(() => {
1666
- O ? pt(u, { url: S }) : pt(u, {
1628
+ O ? gt(a, { url: S }) : gt(a, {
1667
1629
  ...A,
1668
1630
  [b]: E
1669
1631
  });
@@ -1673,7 +1635,7 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1673
1635
  E,
1674
1636
  A,
1675
1637
  b,
1676
- u
1638
+ a
1677
1639
  ]), {
1678
1640
  showCompare: e,
1679
1641
  previewUrl: t,
@@ -1681,11 +1643,11 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1681
1643
  toggleIsUrl: () => k(!O),
1682
1644
  filters: w,
1683
1645
  selectedFilter: b,
1684
- selectedFilterItem: M,
1646
+ selectedFilterItem: j,
1685
1647
  selectedUrl: S,
1686
1648
  sliderValue: E,
1687
- handleToggleCompare: j,
1688
- handleSliderInput: ee,
1649
+ handleToggleCompare: ee,
1650
+ handleSliderInput: te,
1689
1651
  handleSliderChange: (e) => {
1690
1652
  D(e), T((t) => t.map((t) => t.value === b ? {
1691
1653
  ...t,
@@ -1697,38 +1659,39 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1697
1659
  x(e), D(w.find((t) => t.value === e)?.sliderValue || 0);
1698
1660
  },
1699
1661
  handleChangeWhenUrl: (e) => {
1700
- C(e), pt(u, { url: e });
1662
+ C(e), gt(a, { url: e });
1701
1663
  },
1702
1664
  handleSave: () => {
1703
- c({
1665
+ e && i(), s({
1704
1666
  width: f,
1705
1667
  height: p,
1706
1668
  action: {
1707
- name: h.FILTERS,
1669
+ name: U.FILTERS,
1708
1670
  args: { ...O ? { url: S } : Object.fromEntries(w.map((e) => [e.value, e.sliderValue])) }
1709
1671
  }
1710
- }), e && s(), a(!0);
1672
+ });
1711
1673
  },
1712
1674
  handleClose: () => {
1713
- e && s(), i(null), a(!0);
1714
- }
1675
+ e && i(), c();
1676
+ },
1677
+ isSaving: u
1715
1678
  };
1716
1679
  }, Y = {
1717
- tools: "_tools_5caap_1",
1718
- row1: "_row1_5caap_5",
1719
- min: "_min_5caap_13",
1720
- slider: "_slider_5caap_19",
1721
- max: "_max_5caap_23",
1722
- row2: "_row2_5caap_29",
1723
- select: "_select_5caap_35",
1724
- option: "_option_5caap_39",
1725
- active: "_active_5caap_50",
1726
- filterInteract: "_filterInteract_5caap_55",
1727
- compare: "_compare_5caap_70",
1728
- compareThumb: "_compareThumb_5caap_88"
1729
- }, gt = () => {
1730
- let { showCompare: e, previewUrl: t, isUrl: n, toggleIsUrl: r, filters: i, selectedFilter: a, selectedFilterItem: o, selectedUrl: s, sliderValue: c, handleToggleCompare: l, handleSliderInput: u, handleSliderChange: d, handleChange: f, handleChangeWhenUrl: p, handleSave: m, handleClose: h } = ht();
1731
- return /* @__PURE__ */ (0, x.jsxs)(U, {
1680
+ tools: "_tools_4u8qe_1",
1681
+ row1: "_row1_4u8qe_5",
1682
+ min: "_min_4u8qe_13",
1683
+ slider: "_slider_4u8qe_19",
1684
+ max: "_max_4u8qe_23",
1685
+ row2: "_row2_4u8qe_29",
1686
+ select: "_select_4u8qe_35",
1687
+ option: "_option_4u8qe_39",
1688
+ active: "_active_4u8qe_50",
1689
+ filterInteract: "_filterInteract_4u8qe_55",
1690
+ compare: "_compare_4u8qe_70",
1691
+ compareThumb: "_compareThumb_4u8qe_88"
1692
+ }, yt = () => {
1693
+ let { showCompare: e, previewUrl: t, isUrl: n, toggleIsUrl: r, filters: i, selectedFilter: a, selectedFilterItem: o, selectedUrl: s, sliderValue: c, handleToggleCompare: l, handleSliderInput: u, handleSliderChange: d, handleChange: f, handleChangeWhenUrl: p, handleSave: m, handleClose: h, isSaving: g } = vt();
1694
+ return /* @__PURE__ */ (0, x.jsxs)(J, {
1732
1695
  className: Y.tools,
1733
1696
  children: [!n && o && /* @__PURE__ */ (0, x.jsxs)("div", {
1734
1697
  className: Y.row1,
@@ -1737,7 +1700,7 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1737
1700
  className: Y.min,
1738
1701
  children: [o.min, o.unit]
1739
1702
  }),
1740
- /* @__PURE__ */ (0, x.jsx)(Ne, {
1703
+ /* @__PURE__ */ (0, x.jsx)(Ee, {
1741
1704
  className: Y.slider,
1742
1705
  min: o.min,
1743
1706
  max: o.max,
@@ -1756,29 +1719,29 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1756
1719
  }), /* @__PURE__ */ (0, x.jsxs)("div", {
1757
1720
  className: Y.row2,
1758
1721
  children: [
1759
- /* @__PURE__ */ (0, x.jsx)(H, {
1722
+ /* @__PURE__ */ (0, x.jsx)(V, {
1760
1723
  position: "top",
1761
- children: /* @__PURE__ */ (0, x.jsx)(I, {
1724
+ children: /* @__PURE__ */ (0, x.jsx)(F, {
1762
1725
  variant: "outline",
1763
1726
  "aria-label": "Compare",
1764
1727
  "data-tooltip": "Compare",
1765
1728
  onClick: l,
1766
1729
  className: e ? Y.active : "",
1767
- children: /* @__PURE__ */ (0, x.jsx)(ye, {})
1730
+ children: /* @__PURE__ */ (0, x.jsx)(de, {})
1768
1731
  })
1769
1732
  }),
1770
- /* @__PURE__ */ (0, x.jsx)(H, {
1733
+ /* @__PURE__ */ (0, x.jsx)(V, {
1771
1734
  position: "top",
1772
- children: /* @__PURE__ */ (0, x.jsx)(I, {
1735
+ children: /* @__PURE__ */ (0, x.jsx)(F, {
1773
1736
  variant: "outline",
1774
1737
  "aria-label": n ? "Filters" : "Predefined Filters",
1775
1738
  "data-tooltip": n ? "Filters" : "Predefined Filters",
1776
1739
  onClick: r,
1777
- children: n ? /* @__PURE__ */ (0, x.jsx)(he, {}) : /* @__PURE__ */ (0, x.jsx)(ve, {})
1740
+ children: n ? /* @__PURE__ */ (0, x.jsx)(se, {}) : /* @__PURE__ */ (0, x.jsx)(ue, {})
1778
1741
  })
1779
1742
  }),
1780
- /* @__PURE__ */ (0, x.jsx)(Te, {
1781
- items: n ? Be : i,
1743
+ /* @__PURE__ */ (0, x.jsx)(ve, {
1744
+ items: n ? v : i,
1782
1745
  value: n ? s : a,
1783
1746
  placeholder: "Select filter",
1784
1747
  className: Y.select,
@@ -1792,15 +1755,16 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1792
1755
  }) : void 0,
1793
1756
  onChange: n ? p : f
1794
1757
  }),
1795
- /* @__PURE__ */ (0, x.jsx)(z, {
1758
+ /* @__PURE__ */ (0, x.jsx)(R, {
1796
1759
  onSave: m,
1797
- onClose: h
1760
+ onClose: h,
1761
+ saving: g
1798
1762
  })
1799
1763
  ]
1800
1764
  })]
1801
1765
  });
1802
- }, _t = ({ isClipped: e, isFilter: t }) => {
1803
- let { history: n, previewUrl: r, currentAction: i, getLastRotation: a, eventBus: s } = P(), l = u(null), d = u(null), f = u(i?.name), p = u(r);
1766
+ }, bt = ({ isClipped: e, isFilter: t }) => {
1767
+ let { history: n, previewUrl: r, currentAction: i, getLastRotation: a, eventBus: s } = W(), l = u(null), d = u(null), f = u(i?.name), p = u(r);
1804
1768
  c(() => {
1805
1769
  let e = f.current, t = i?.name, n = p.current !== r;
1806
1770
  if (f.current = t, p.current = r, !(e && t && e !== t) && !n) return;
@@ -1823,16 +1787,16 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1823
1787
  if (i) {
1824
1788
  let { width: e, height: t } = n.items.at(n.pointer);
1825
1789
  m.push({
1826
- ...i.name === h.ROTATE ? Je(e, t, a(), i.args.degrees) : {
1790
+ ...i.name === U.ROTATE ? We(e, t, a(), i.args.degrees) : {
1827
1791
  width: e,
1828
1792
  height: t
1829
1793
  },
1830
1794
  action: i
1831
1795
  });
1832
1796
  }
1833
- let g = ot(m);
1797
+ let h = rt(m);
1834
1798
  return o(() => {
1835
- e && l.current && (l.current.style.transition = "none"), i?.name !== h.RESIZE && l.current && (l.current.style.transform = "scale(1)");
1799
+ e && l.current && (l.current.style.transition = "none"), i?.name !== U.RESIZE && l.current && (l.current.style.transform = "scale(1)");
1836
1800
  let n = (e) => {
1837
1801
  let t = e.detail;
1838
1802
  l.current && (l.current.style.transform = `scale(${t / 100})`);
@@ -1863,7 +1827,7 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1863
1827
  previewRef: l,
1864
1828
  imageRef: d,
1865
1829
  previewUrl: r,
1866
- ...g
1830
+ ...h
1867
1831
  };
1868
1832
  }, X = {
1869
1833
  preview: "_preview_t77n1_1",
@@ -1874,8 +1838,8 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1874
1838
  label: "_label_t77n1_49",
1875
1839
  before: "_before_t77n1_67",
1876
1840
  after: "_after_t77n1_71"
1877
- }, vt = ({ isClipped: e, isFilter: t, faded: n, style: r = {} }) => {
1878
- let { showCompare: i } = P(), { previewRef: a, imageRef: o, previewUrl: s, box: c, boxWidth: l, boxHeight: u, viewWidth: d, viewHeight: f, rotation: p, flipH: m, flipV: h, filters: g } = _t({
1841
+ }, xt = ({ isClipped: e, isFilter: t, faded: n, style: r = {} }) => {
1842
+ let { showCompare: i } = W(), { previewRef: a, imageRef: o, previewUrl: s, box: c, boxWidth: l, boxHeight: u, viewWidth: d, viewHeight: f, rotation: p, flipH: m, flipV: h, filters: g } = bt({
1879
1843
  isClipped: e,
1880
1844
  isFilter: t
1881
1845
  });
@@ -1922,10 +1886,10 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1922
1886
  })
1923
1887
  ]
1924
1888
  });
1925
- }, yt = ({ compareRef: e }) => {
1926
- let { eventBus: t } = P(), n = O(), r = u(null), i = u(null);
1889
+ }, St = ({ compareRef: e }) => {
1890
+ let { eventBus: t } = W(), n = H(), r = u(null), i = u(null);
1927
1891
  return o(() => {
1928
- i.current = 0, mt(t, 0);
1892
+ i.current = 0, _t(t, 0);
1929
1893
  }, [t]), o(() => {
1930
1894
  let n = (n) => {
1931
1895
  if (!e.current || !r.current) return;
@@ -1933,7 +1897,7 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1933
1897
  let a = e.current.parentElement;
1934
1898
  if (!a) return;
1935
1899
  let o = "clientX" in n ? n.clientX : n.touches[0].clientX, { width: s, left: c } = a.getBoundingClientRect(), l = Math.min(Math.max(o - c, 0), s) / s * 100;
1936
- i.current = l, e.current.style.left = `${l}%`, mt(t, l);
1900
+ i.current = l, e.current.style.left = `${l}%`, _t(t, l);
1937
1901
  }, a = () => {
1938
1902
  e.current && (r.current = null, document.body.style.cursor = "auto");
1939
1903
  }, o = new AbortController(), { signal: s } = o;
@@ -1947,12 +1911,12 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1947
1911
  let a = "clientX" in t ? t.clientX : t.touches[0].clientX;
1948
1912
  r.current = a, n || (document.body.style.cursor = "pointer");
1949
1913
  } };
1950
- }, bt = () => {
1951
- let { showCompare: e, getLastHistoryItem: t } = P(), { width: n, height: r } = t(), i = u(null), { handleDragStart: a } = yt({ compareRef: i });
1914
+ }, Ct = () => {
1915
+ let { showCompare: e, getLastHistoryItem: t } = W(), { width: n, height: r } = t(), i = u(null), { handleDragStart: a } = St({ compareRef: i });
1952
1916
  return /* @__PURE__ */ (0, x.jsxs)("div", {
1953
1917
  className: Y.filterInteract,
1954
1918
  style: { aspectRatio: `${n} / ${r}` },
1955
- children: [/* @__PURE__ */ (0, x.jsx)(vt, { isFilter: !0 }), e && /* @__PURE__ */ (0, x.jsx)(x.Fragment, { children: /* @__PURE__ */ (0, x.jsx)("div", {
1919
+ children: [/* @__PURE__ */ (0, x.jsx)(xt, { isFilter: !0 }), e && /* @__PURE__ */ (0, x.jsx)(x.Fragment, { children: /* @__PURE__ */ (0, x.jsx)("div", {
1956
1920
  ref: i,
1957
1921
  className: Y.compare,
1958
1922
  style: { left: "50%" },
@@ -1960,11 +1924,11 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1960
1924
  className: Y.compareThumb,
1961
1925
  onMouseDown: a,
1962
1926
  onTouchStart: a,
1963
- children: /* @__PURE__ */ (0, x.jsx)(ye, {})
1927
+ children: /* @__PURE__ */ (0, x.jsx)(de, {})
1964
1928
  })
1965
1929
  }) })]
1966
1930
  });
1967
- }, xt = () => ({
1931
+ }, wt = () => ({
1968
1932
  saturate: 100,
1969
1933
  grayscale: 0,
1970
1934
  sepia: 0,
@@ -1972,51 +1936,290 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
1972
1936
  hueRotate: 0,
1973
1937
  brightness: 100,
1974
1938
  contrast: 100
1975
- }), St = {
1976
- [h.RESIZE]: {
1977
- icon: /* @__PURE__ */ (0, x.jsx)(le, {}),
1939
+ }), Tt = (e, t, n) => {
1940
+ if (e.length === 1) switch (e[0]) {
1941
+ case "resize": return {
1942
+ name: U.RESIZE,
1943
+ args: {
1944
+ width: t,
1945
+ height: n
1946
+ }
1947
+ };
1948
+ case "crop": return {
1949
+ name: U.CROP,
1950
+ args: {
1951
+ id: "freeform",
1952
+ ratio: t / n,
1953
+ isFree: !0
1954
+ }
1955
+ };
1956
+ case "presetCrop": return {
1957
+ name: U.PRESET_CROP,
1958
+ args: {
1959
+ id: "facebook-post",
1960
+ ratio: 1200 / 630,
1961
+ isFree: !1,
1962
+ preset: {
1963
+ width: 1200,
1964
+ height: 630
1965
+ }
1966
+ }
1967
+ };
1968
+ case "flip": return {
1969
+ name: U.FLIP,
1970
+ args: {
1971
+ horizontal: !1,
1972
+ vertical: !1
1973
+ }
1974
+ };
1975
+ case "rotate": return {
1976
+ name: U.ROTATE,
1977
+ args: { degrees: 0 }
1978
+ };
1979
+ case "filters": return {
1980
+ name: U.FILTERS,
1981
+ args: wt()
1982
+ };
1983
+ default: return null;
1984
+ }
1985
+ return null;
1986
+ }, Et = {
1987
+ tools: [
1988
+ "resize",
1989
+ "crop",
1990
+ "presetCrop",
1991
+ "flip",
1992
+ "rotate",
1993
+ "filters"
1994
+ ],
1995
+ infobar: !0,
1996
+ quality: .85,
1997
+ saveAsWEBP: !1,
1998
+ exportAs: "blob"
1999
+ }, Dt = (e, t, n, r, i, a, o) => ({
2000
+ history: {
2001
+ pointer: 0,
2002
+ items: [{
2003
+ width: t,
2004
+ height: n,
2005
+ action: {
2006
+ name: U.INITIAL,
2007
+ args: null
2008
+ }
2009
+ }]
2010
+ },
2011
+ currentAction: Tt(o?.tools || [], t, n),
2012
+ previewUrl: i,
2013
+ originalBlob: r,
2014
+ mimeType: e,
2015
+ sidebar: !1,
2016
+ settings: o,
2017
+ isAlpha: a,
2018
+ showCompare: !1,
2019
+ singleToolUI: o?.tools?.length === 1
2020
+ }), Ot = () => {}, kt = ({ children: e, mimeType: t, width: n, height: r, originalBlob: i, previewUrl: a, isAlpha: s, settings: c, onSave: f = Ot, onBack: p = Ot }) => {
2021
+ let [m, h] = d(Dt(t, n, r, i, a, s, c)), g = u(null);
2022
+ o(() => () => {
2023
+ g.current &&= (URL.revokeObjectURL(g.current), null);
2024
+ }, []);
2025
+ let _ = (e) => h((t) => ({
2026
+ ...t,
2027
+ currentAction: e
2028
+ })), v = (e) => h((t) => {
2029
+ let n = t.history.pointer + 1, r = [...t.history.items.slice(0, n), e];
2030
+ return {
2031
+ ...t,
2032
+ currentAction: null,
2033
+ history: {
2034
+ items: r,
2035
+ pointer: n
2036
+ }
2037
+ };
2038
+ }), y = () => h((e) => ({
2039
+ ...e,
2040
+ showCompare: !e.showCompare
2041
+ })), b = () => {
2042
+ let { items: e, pointer: t } = m.history;
2043
+ return e.at(t) ?? e.at(0) ?? {
2044
+ width: 0,
2045
+ height: 0,
2046
+ action: {
2047
+ name: U.INITIAL,
2048
+ args: null
2049
+ }
2050
+ };
2051
+ }, S = () => {
2052
+ let { items: e, pointer: t } = m.history;
2053
+ return e.filter((e, n) => n <= t && e.action.name === U.FILTERS).at(-1) ?? null;
2054
+ }, C = () => {
2055
+ let { items: e, pointer: t } = m.history;
2056
+ if (e.length === 0 || t < 0) return 0;
2057
+ let n = e.slice(0, t + 1).findLast((e) => e.action.name === U.ROTATE);
2058
+ return n?.action.name === U.ROTATE ? n.action.args.degrees : 0;
2059
+ }, w = () => h((e) => ({
2060
+ ...e,
2061
+ history: {
2062
+ items: [e.history.items[0]],
2063
+ pointer: 0
2064
+ }
2065
+ })), T = () => h((e) => e.history.pointer <= 0 ? e : {
2066
+ ...e,
2067
+ history: {
2068
+ ...e.history,
2069
+ pointer: e.history.pointer - 1
2070
+ }
2071
+ }), E = () => h((e) => e.history.pointer >= e.history.items.length - 1 ? e : {
2072
+ ...e,
2073
+ history: {
2074
+ ...e.history,
2075
+ pointer: e.history.pointer + 1
2076
+ }
2077
+ }), D = (e) => h((t) => ({
2078
+ ...t,
2079
+ sidebar: e
2080
+ })), O = l(() => new EventTarget(), []), k = (e) => {
2081
+ g.current && URL.revokeObjectURL(g.current), g.current = URL.createObjectURL(e.previewBlob), h(Dt(e.mimeType, e.width, e.height, e.newBlob, g.current, e.isAlpha, c));
2082
+ };
2083
+ return /* @__PURE__ */ (0, x.jsx)(Fe, {
2084
+ value: {
2085
+ ...m,
2086
+ setImage: k,
2087
+ setCurrentAction: _,
2088
+ toggleCompare: y,
2089
+ getLastHistoryItem: b,
2090
+ getLastRotation: C,
2091
+ getLastFilter: S,
2092
+ addToHistory: v,
2093
+ resetHistory: w,
2094
+ undo: T,
2095
+ redo: E,
2096
+ setSidebar: D,
2097
+ eventBus: O,
2098
+ onSave: f,
2099
+ onBack: p
2100
+ },
2101
+ children: e
2102
+ });
2103
+ }, Z = {
2104
+ header: "_header_m05h6_1",
2105
+ left: "_left_m05h6_12",
2106
+ sidebarToggle: "_sidebarToggle_m05h6_17",
2107
+ mobile: "_mobile_m05h6_30",
2108
+ sidebarIcon: "_sidebarIcon_m05h6_34",
2109
+ tools: "_tools_m05h6_39",
2110
+ history: "_history_m05h6_43",
2111
+ historyText: "_historyText_m05h6_48"
2112
+ }, At = ({ isMobile: e }) => {
2113
+ let { save: t, reset: n, isSaving: r } = at(), { sidebar: i, history: a, undo: o, redo: s, setSidebar: c, setCurrentAction: l, onBack: u } = W(), d = a.items.length > 1 && !r, f = a.pointer === 0, p = a.pointer === a.items.length - 1, m = a.items.length < 2 || r, h = m || a.pointer === 0;
2114
+ return /* @__PURE__ */ (0, x.jsxs)("div", {
2115
+ className: Z.header,
2116
+ children: [/* @__PURE__ */ (0, x.jsxs)("div", {
2117
+ className: Z.left,
2118
+ children: [/* @__PURE__ */ (0, x.jsx)("div", {
2119
+ className: `${Z.sidebarToggle} ${e ? Z.mobile : ""}`,
2120
+ onClick: () => {
2121
+ c(!i);
2122
+ },
2123
+ children: i ? /* @__PURE__ */ (0, x.jsx)(le, { className: Z.sidebarIcon }) : /* @__PURE__ */ (0, x.jsx)(ce, { className: Z.sidebarIcon })
2124
+ }), /* @__PURE__ */ (0, x.jsx)(F, {
2125
+ variant: "ghost",
2126
+ className: P.rect,
2127
+ onClick: () => u(),
2128
+ children: /* @__PURE__ */ (0, x.jsx)(E, {})
2129
+ })]
2130
+ }), /* @__PURE__ */ (0, x.jsxs)("div", {
2131
+ className: Z.tools,
2132
+ children: [
2133
+ d && /* @__PURE__ */ (0, x.jsxs)("div", {
2134
+ className: Z.history,
2135
+ children: [
2136
+ /* @__PURE__ */ (0, x.jsx)(F, {
2137
+ variant: "outline",
2138
+ disabled: f,
2139
+ className: P.rect,
2140
+ onClick: () => {
2141
+ o(), l(null);
2142
+ },
2143
+ children: /* @__PURE__ */ (0, x.jsx)(O, {})
2144
+ }),
2145
+ /* @__PURE__ */ (0, x.jsxs)("div", {
2146
+ className: Z.historyText,
2147
+ children: [
2148
+ a.pointer + 1,
2149
+ "/",
2150
+ a.items.length
2151
+ ]
2152
+ }),
2153
+ /* @__PURE__ */ (0, x.jsx)(F, {
2154
+ variant: "outline",
2155
+ disabled: p,
2156
+ className: P.rect,
2157
+ onClick: () => {
2158
+ s(), l(null);
2159
+ },
2160
+ children: /* @__PURE__ */ (0, x.jsx)(k, {})
2161
+ })
2162
+ ]
2163
+ }),
2164
+ /* @__PURE__ */ (0, x.jsx)(F, {
2165
+ variant: "outline",
2166
+ disabled: m,
2167
+ onClick: n,
2168
+ children: "Reset"
2169
+ }),
2170
+ /* @__PURE__ */ (0, x.jsxs)(F, {
2171
+ disabled: h,
2172
+ onClick: () => t(),
2173
+ children: [r ? /* @__PURE__ */ (0, x.jsx)(pe, {}) : /* @__PURE__ */ (0, x.jsx)(C, {}), "Save"]
2174
+ })
2175
+ ]
2176
+ })]
2177
+ });
2178
+ }, jt = {
2179
+ [U.RESIZE]: {
2180
+ icon: /* @__PURE__ */ (0, x.jsx)(re, {}),
1978
2181
  label: "Resize"
1979
2182
  },
1980
- [h.CROP]: {
1981
- icon: /* @__PURE__ */ (0, x.jsx)(N, {}),
2183
+ [U.CROP]: {
2184
+ icon: /* @__PURE__ */ (0, x.jsx)(A, {}),
1982
2185
  label: "Crop"
1983
2186
  },
1984
- [h.PRESET_CROP]: {
1985
- icon: /* @__PURE__ */ (0, x.jsx)(me, {}),
2187
+ [U.PRESET_CROP]: {
2188
+ icon: /* @__PURE__ */ (0, x.jsx)(oe, {}),
1986
2189
  label: "Presets"
1987
2190
  },
1988
- [h.FLIP]: {
1989
- icon: /* @__PURE__ */ (0, x.jsx)(ue, {}),
2191
+ [U.FLIP]: {
2192
+ icon: /* @__PURE__ */ (0, x.jsx)(M, {}),
1990
2193
  label: "Flip"
1991
2194
  },
1992
- [h.ROTATE]: {
1993
- icon: /* @__PURE__ */ (0, x.jsx)(fe, {}),
2195
+ [U.ROTATE]: {
2196
+ icon: /* @__PURE__ */ (0, x.jsx)(N, {}),
1994
2197
  label: "Rotate"
1995
2198
  },
1996
- [h.FILTERS]: {
1997
- icon: /* @__PURE__ */ (0, x.jsx)(he, {}),
2199
+ [U.FILTERS]: {
2200
+ icon: /* @__PURE__ */ (0, x.jsx)(se, {}),
1998
2201
  label: "Filters"
1999
2202
  }
2000
- }, Ct = (e) => St[e] ?? null, wt = () => {
2001
- let { settings: e, currentAction: t, showCompare: n, toggleCompare: r, getLastRotation: i, getLastHistoryItem: a, setCurrentAction: o, setSidebar: s } = P(), c = e?.tools || [], l = t?.name, { width: u, height: d } = a();
2203
+ }, Mt = (e) => jt[e] ?? null, Nt = () => {
2204
+ let { settings: e, currentAction: t, showCompare: n, toggleCompare: r, getLastRotation: i, getLastHistoryItem: a, setCurrentAction: o, setSidebar: s } = W(), c = e?.tools || [], l = t?.name, { width: u, height: d } = a();
2002
2205
  return { click: (e) => {
2003
2206
  if (c.includes(e) && l === e) {
2004
2207
  o(null);
2005
2208
  return;
2006
2209
  }
2007
2210
  switch (e) {
2008
- case h.RESIZE:
2211
+ case U.RESIZE:
2009
2212
  o({
2010
- name: h.RESIZE,
2213
+ name: U.RESIZE,
2011
2214
  args: {
2012
2215
  width: u,
2013
2216
  height: d
2014
2217
  }
2015
2218
  });
2016
2219
  break;
2017
- case h.CROP:
2220
+ case U.CROP:
2018
2221
  o({
2019
- name: h.CROP,
2222
+ name: U.CROP,
2020
2223
  args: {
2021
2224
  id: "freeform",
2022
2225
  ratio: u / d,
@@ -2024,9 +2227,9 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2024
2227
  }
2025
2228
  });
2026
2229
  break;
2027
- case h.PRESET_CROP:
2230
+ case U.PRESET_CROP:
2028
2231
  o({
2029
- name: h.PRESET_CROP,
2232
+ name: U.PRESET_CROP,
2030
2233
  args: {
2031
2234
  id: "facebook-post",
2032
2235
  ratio: 1200 / 630,
@@ -2038,50 +2241,50 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2038
2241
  }
2039
2242
  });
2040
2243
  break;
2041
- case h.FLIP:
2244
+ case U.FLIP:
2042
2245
  o({
2043
- name: h.FLIP,
2246
+ name: U.FLIP,
2044
2247
  args: {
2045
2248
  horizontal: !1,
2046
2249
  vertical: !1
2047
2250
  }
2048
2251
  });
2049
2252
  break;
2050
- case h.ROTATE:
2253
+ case U.ROTATE:
2051
2254
  o({
2052
- name: h.ROTATE,
2255
+ name: U.ROTATE,
2053
2256
  args: { degrees: i() }
2054
2257
  });
2055
2258
  break;
2056
- case h.FILTERS:
2259
+ case U.FILTERS:
2057
2260
  o({
2058
- name: h.FILTERS,
2059
- args: xt()
2261
+ name: U.FILTERS,
2262
+ args: wt()
2060
2263
  });
2061
2264
  break;
2062
2265
  }
2063
2266
  n && r(), s(!1);
2064
2267
  } };
2065
- }, Z = {
2268
+ }, Q = {
2066
2269
  sidebar: "_sidebar_1lx29_1",
2067
2270
  mobile: "_mobile_1lx29_10",
2068
2271
  open: "_open_1lx29_15",
2069
2272
  wrapper: "_wrapper_1lx29_20",
2070
2273
  item: "_item_1lx29_24",
2071
2274
  selected: "_selected_1lx29_43"
2072
- }, Tt = ({ isMobile: e }) => {
2073
- let { settings: t, sidebar: n, currentAction: r } = P(), i = t?.tools || [], a = r?.name, { click: o } = wt();
2275
+ }, Pt = ({ isMobile: e }) => {
2276
+ let { settings: t, sidebar: n, currentAction: r } = W(), i = t?.tools || [], a = r?.name, { click: o } = Nt();
2074
2277
  return /* @__PURE__ */ (0, x.jsx)("nav", {
2075
- className: `${Z.sidebar} ${e ? Z.mobile : ""} ${e && n ? Z.open : ""}`,
2076
- children: /* @__PURE__ */ (0, x.jsx)(H, {
2278
+ className: `${Q.sidebar} ${e ? Q.mobile : ""} ${e && n ? Q.open : ""}`,
2279
+ children: /* @__PURE__ */ (0, x.jsx)(V, {
2077
2280
  position: "right",
2078
- className: Z.tooltip,
2281
+ className: Q.tooltip,
2079
2282
  children: i.map((e) => {
2080
- let t = Ct(e);
2283
+ let t = Mt(e);
2081
2284
  if (!t) return null;
2082
2285
  let { icon: n, label: r } = t;
2083
2286
  return /* @__PURE__ */ (0, x.jsx)("div", {
2084
- className: `${Z.item} ${a === e ? Z.selected : ""}`,
2287
+ className: `${Q.item} ${a === e ? Q.selected : ""}`,
2085
2288
  onClick: () => o(e),
2086
2289
  "data-tooltip": r,
2087
2290
  "aria-label": r,
@@ -2090,15 +2293,15 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2090
2293
  })
2091
2294
  })
2092
2295
  });
2093
- }, Et = { infobar: "_infobar_895qe_1" }, Dt = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(2)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`, Ot = () => {
2094
- let { originalBlob: e, getLastHistoryItem: t } = P(), { width: n, height: r } = t();
2296
+ }, Ft = { infobar: "_infobar_895qe_1" }, It = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(2)} KB` : `${(e / 1024 / 1024).toFixed(2)} MB`, Lt = () => {
2297
+ let { originalBlob: e, getLastHistoryItem: t } = W(), { width: n, height: r } = t();
2095
2298
  return /* @__PURE__ */ (0, x.jsxs)("div", {
2096
- className: Et.infobar,
2299
+ className: Ft.infobar,
2097
2300
  children: [/* @__PURE__ */ (0, x.jsx)("div", {
2098
- className: Et.filesize,
2099
- children: e ? Dt(e.size) : "0 B"
2301
+ className: Ft.filesize,
2302
+ children: e ? It(e.size) : "0 B"
2100
2303
  }), /* @__PURE__ */ (0, x.jsxs)("div", {
2101
- className: Et.sizes,
2304
+ className: Ft.sizes,
2102
2305
  children: [
2103
2306
  n,
2104
2307
  " / ",
@@ -2106,94 +2309,95 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2106
2309
  ]
2107
2310
  })]
2108
2311
  });
2109
- }, kt = 15, At = 200, jt = 2, Mt = (e, t, n) => {
2110
- let r = Math.min(At, Math.max(kt, e));
2312
+ }, Rt = 15, zt = 200, Bt = 2, Vt = (e, t, n) => {
2313
+ let r = Math.min(zt, Math.max(Rt, e));
2111
2314
  return {
2112
2315
  scale: r,
2113
2316
  width: Math.round(r / 100 * t),
2114
2317
  height: Math.round(r / 100 * n)
2115
2318
  };
2116
- }, Nt = () => {
2117
- let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r, eventBus: a } = P(), { width: s, height: c } = e(), [l, f] = d(s), [p, m] = d(c), [g, _] = d(100), v = u(g), y = u(0), b = u(null), x = i((e) => {
2118
- let t = Mt(e, s, c);
2119
- f(t.width), m(t.height), _(t.scale), v.current = t.scale, ft(a, t.scale);
2319
+ }, Ht = () => {
2320
+ let { getLastHistoryItem: e, eventBus: t } = W(), { commit: n, close: r, isSaving: a } = q(), { width: s, height: c } = e(), [l, f] = d(s), [p, m] = d(c), [h, g] = d(100), _ = u(h), v = u(0), y = u(null), b = i((e) => {
2321
+ let n = Vt(e, s, c);
2322
+ f(n.width), m(n.height), g(n.scale), _.current = n.scale, ht(t, n.scale);
2120
2323
  }, [
2121
2324
  c,
2122
2325
  s,
2123
- a
2124
- ]), S = (e, t) => {
2326
+ t
2327
+ ]), x = (e, t) => {
2125
2328
  let n = Number.parseInt(e, 10);
2126
2329
  if (!Number.isFinite(n)) {
2127
- x(100);
2330
+ b(100);
2128
2331
  return;
2129
2332
  }
2130
- x(n / t * 100);
2333
+ b(n / t * 100);
2131
2334
  };
2132
2335
  return o(() => {
2133
2336
  let e = (e) => {
2134
- let t = b.current?.parentElement, n = e.composedPath?.()[0] ?? e.target;
2337
+ let t = y.current?.parentElement, n = e.composedPath?.()[0] ?? e.target;
2135
2338
  return n instanceof Node && !!t?.contains(n);
2136
2339
  }, t = (t) => {
2137
- e(t) && x(v.current - Math.sign(t.deltaY) * jt);
2340
+ e(t) && b(_.current - Math.sign(t.deltaY) * Bt);
2138
2341
  }, n = (t) => {
2139
- e(t) && (y.current = t.touches[0].clientY);
2342
+ e(t) && (v.current = t.touches[0].clientY);
2140
2343
  }, r = (t) => {
2141
2344
  if (!e(t)) return;
2142
- let n = t.touches[0].clientY, r = y.current - n;
2143
- Math.abs(r) < 10 || (x(v.current + Math.sign(r) * jt), y.current = n);
2345
+ let n = t.touches[0].clientY, r = v.current - n;
2346
+ Math.abs(r) < 10 || (b(_.current + Math.sign(r) * Bt), v.current = n);
2144
2347
  }, i = new AbortController(), { signal: a } = i;
2145
2348
  return window.addEventListener("wheel", t, { signal: a }), window.addEventListener("touchstart", n, { signal: a }), window.addEventListener("touchmove", r, { signal: a }), () => i.abort();
2146
- }, [x]), {
2147
- resizeRef: b,
2349
+ }, [b]), {
2350
+ resizeRef: y,
2148
2351
  width: l,
2149
2352
  height: p,
2150
- scale: g,
2353
+ scale: h,
2151
2354
  currentWidth: s,
2152
2355
  currentHeight: c,
2153
2356
  setWidth: f,
2154
2357
  setHeight: m,
2155
2358
  handleWidthBlur: (e) => {
2156
- S(e.target.value, s);
2359
+ x(e.target.value, s);
2157
2360
  },
2158
2361
  handleHeightBlur: (e) => {
2159
- S(e.target.value, c);
2362
+ x(e.target.value, c);
2160
2363
  },
2161
2364
  save: () => {
2162
2365
  n({
2163
2366
  width: l,
2164
2367
  height: p,
2165
2368
  action: {
2166
- name: h.RESIZE,
2369
+ name: U.RESIZE,
2167
2370
  args: {
2168
2371
  width: l,
2169
2372
  height: p
2170
2373
  }
2171
2374
  }
2172
- }), ft(a, 100), r(!0);
2375
+ }), ht(t, 100);
2173
2376
  },
2174
2377
  close: () => {
2175
- ft(a, 100), t(null), r(!0);
2176
- }
2378
+ ht(t, 100), r();
2379
+ },
2380
+ isSaving: a
2177
2381
  };
2178
- }, Q = {
2382
+ }, Ut = {
2179
2383
  resize: "_resize_1sbig_1",
2180
2384
  toolsLock: "_toolsLock_1sbig_5",
2181
2385
  indicatorWrapper: "_indicatorWrapper_1sbig_10",
2182
2386
  indicator: "_indicator_1sbig_10"
2183
- }, Pt = () => {
2184
- 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 } = Nt();
2185
- return /* @__PURE__ */ (0, x.jsxs)(U, {
2387
+ }, Wt = () => {
2388
+ 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, isSaving: f } = Ht();
2389
+ return /* @__PURE__ */ (0, x.jsxs)(J, {
2186
2390
  ref: e,
2187
- className: Q.resize,
2391
+ className: Ut.resize,
2188
2392
  children: [
2189
2393
  /* @__PURE__ */ (0, x.jsx)("div", {
2190
- className: Q.indicatorWrapper,
2394
+ className: Ut.indicatorWrapper,
2191
2395
  children: /* @__PURE__ */ (0, x.jsx)("div", {
2192
- className: Q.indicator,
2396
+ className: Ut.indicator,
2193
2397
  style: { width: `${r / 2}%` }
2194
2398
  })
2195
2399
  }),
2196
- /* @__PURE__ */ (0, x.jsx)(ke, {
2400
+ /* @__PURE__ */ (0, x.jsx)(Se, {
2197
2401
  value: t,
2198
2402
  name: "width",
2199
2403
  label: "Width",
@@ -2201,8 +2405,8 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2201
2405
  onChange: (e) => o(Number(e.target.value)),
2202
2406
  onBlur: c
2203
2407
  }),
2204
- /* @__PURE__ */ (0, x.jsx)(M, { className: Q.toolsLock }),
2205
- /* @__PURE__ */ (0, x.jsx)(ke, {
2408
+ /* @__PURE__ */ (0, x.jsx)(T, { className: Ut.toolsLock }),
2409
+ /* @__PURE__ */ (0, x.jsx)(Se, {
2206
2410
  value: n,
2207
2411
  name: "height",
2208
2412
  label: "Height",
@@ -2210,9 +2414,10 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2210
2414
  onChange: (e) => s(Number(e.target.value)),
2211
2415
  onBlur: l
2212
2416
  }),
2213
- /* @__PURE__ */ (0, x.jsx)(z, {
2417
+ /* @__PURE__ */ (0, x.jsx)(R, {
2214
2418
  onSave: u,
2215
2419
  onClose: d,
2420
+ saving: f,
2216
2421
  disabled: t === i && n === a
2217
2422
  })
2218
2423
  ]
@@ -2241,9 +2446,9 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2241
2446
  infoH: "_infoH_1co2u_146",
2242
2447
  group: "_group_1co2u_153",
2243
2448
  active: "_active_1co2u_162"
2244
- }, Ft = () => {
2245
- let { getLastHistoryItem: e } = P(), t = O(), n = u(null), { handleCropStart: r, initialCrop: i } = qt({ boxRef: n }), { width: a, height: o } = e(), { x: s, y: c, w: l, h: d } = i;
2246
- return /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsx)(vt, {
2449
+ }, Gt = () => {
2450
+ let { getLastHistoryItem: e } = W(), t = H(), n = u(null), { handleCropStart: r, initialCrop: i } = rn({ boxRef: n }), { width: a, height: o } = e(), { x: s, y: c, w: l, h: d } = i;
2451
+ return /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsx)(xt, {
2247
2452
  isClipped: !0,
2248
2453
  style: { clipPath: `xywh(${s}% ${c}% ${l}% ${d}%)` }
2249
2454
  }), /* @__PURE__ */ (0, x.jsx)("div", {
@@ -2258,40 +2463,40 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2258
2463
  top: `${c}%`,
2259
2464
  left: `${s}%`
2260
2465
  },
2261
- children: [/* @__PURE__ */ (0, x.jsx)(Bt, {}), t ? /* @__PURE__ */ (0, x.jsx)(Jt, { onMouseDown: r }) : /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsx)(Vt, { onMouseDown: r }), /* @__PURE__ */ (0, x.jsx)(Yt, {})] })]
2466
+ children: [/* @__PURE__ */ (0, x.jsx)(Xt, {}), t ? /* @__PURE__ */ (0, x.jsx)(an, { onMouseDown: r }) : /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsx)(Zt, { onMouseDown: r }), /* @__PURE__ */ (0, x.jsx)(on, {})] })]
2262
2467
  })
2263
2468
  })] });
2264
- }, It = [
2469
+ }, Kt = [
2265
2470
  {
2266
2471
  id: "freeform",
2267
- icon: /* @__PURE__ */ (0, x.jsx)(N, {}),
2472
+ icon: /* @__PURE__ */ (0, x.jsx)(A, {}),
2268
2473
  label: "Freeform"
2269
2474
  },
2270
2475
  {
2271
2476
  id: "origin",
2272
- icon: /* @__PURE__ */ (0, x.jsx)(ae, {}),
2477
+ icon: /* @__PURE__ */ (0, x.jsx)(ee, {}),
2273
2478
  label: "Original"
2274
2479
  },
2275
2480
  {
2276
2481
  id: "1:1",
2277
- icon: /* @__PURE__ */ (0, x.jsx)(oe, {}),
2482
+ icon: /* @__PURE__ */ (0, x.jsx)(te, {}),
2278
2483
  label: "1 : 1"
2279
2484
  },
2280
2485
  {
2281
2486
  id: "4:3",
2282
- icon: /* @__PURE__ */ (0, x.jsx)(ce, {}),
2487
+ icon: /* @__PURE__ */ (0, x.jsx)(ne, {}),
2283
2488
  label: "4 : 3"
2284
2489
  },
2285
2490
  {
2286
2491
  id: "16:9",
2287
- icon: /* @__PURE__ */ (0, x.jsx)(se, {}),
2492
+ icon: /* @__PURE__ */ (0, x.jsx)(j, {}),
2288
2493
  label: "16 : 9"
2289
2494
  }
2290
- ], Lt = ({ value: e, onChange: t }) => /* @__PURE__ */ (0, x.jsx)("div", {
2495
+ ], qt = ({ value: e, onChange: t }) => /* @__PURE__ */ (0, x.jsx)("div", {
2291
2496
  className: $.group,
2292
- children: /* @__PURE__ */ (0, x.jsx)(H, {
2497
+ children: /* @__PURE__ */ (0, x.jsx)(V, {
2293
2498
  position: "top",
2294
- children: It.map((n) => /* @__PURE__ */ (0, x.jsx)(I, {
2499
+ children: Kt.map((n) => /* @__PURE__ */ (0, x.jsx)(F, {
2295
2500
  variant: "outline",
2296
2501
  className: `${$.groupBtn} ${e === n.id ? $.active : ""}`,
2297
2502
  onClick: () => t(n.id),
@@ -2300,72 +2505,72 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2300
2505
  children: n.icon
2301
2506
  }, n.id))
2302
2507
  })
2303
- }), Rt = () => {
2304
- let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, addToHistory: r, setSidebar: i, eventBus: a } = P(), { width: s, height: c } = n(), { name: l, args: d } = t || {}, f = l === h.CROP ? d?.id : "", p = s / c, m = u({
2508
+ }), Jt = () => {
2509
+ let { setCurrentAction: e, currentAction: t, getLastHistoryItem: n, eventBus: r } = W(), { commit: i, close: a, isSaving: s } = q(), { width: c, height: l } = n(), { name: d, args: f } = t || {}, p = d === U.CROP ? f?.id : "", m = c / l, h = u({
2305
2510
  x: 0,
2306
2511
  y: 0,
2307
2512
  w: 0,
2308
2513
  h: 0
2309
2514
  });
2310
2515
  return o(() => {
2311
- if (t?.name !== h.CROP) return;
2312
- let e = G(t.args.ratio, s, c);
2313
- m.current = e;
2516
+ if (t?.name !== U.CROP) return;
2517
+ let e = K(t.args.ratio, c, l);
2518
+ h.current = e;
2314
2519
  let n = (e) => {
2315
- m.current = e.detail;
2520
+ h.current = e.detail;
2316
2521
  };
2317
- return a.addEventListener("clip-path-update", n), () => {
2318
- a.removeEventListener("clip-path-update", n);
2522
+ return r.addEventListener("clip-path-update", n), () => {
2523
+ r.removeEventListener("clip-path-update", n);
2319
2524
  };
2320
2525
  }, [
2321
2526
  t,
2322
- s,
2323
2527
  c,
2324
- a
2528
+ l,
2529
+ r
2325
2530
  ]), {
2326
- currentValue: f,
2531
+ currentValue: p,
2327
2532
  handleChange: (t) => {
2328
- t !== f && e({
2329
- name: h.CROP,
2533
+ t !== p && e({
2534
+ name: U.CROP,
2330
2535
  args: {
2331
2536
  id: t,
2332
- ratio: /^\d+:\d+$/.test(t) ? t.split(":").map(Number).reduce((e, t) => e / t) : p,
2537
+ ratio: /^\d+:\d+$/.test(t) ? t.split(":").map(Number).reduce((e, t) => e / t) : m,
2333
2538
  isFree: t === "freeform"
2334
2539
  }
2335
2540
  });
2336
2541
  },
2337
2542
  handleSave: () => {
2338
- if (!t || t.name !== h.CROP) return;
2339
- let e = t.args?.preset?.width || Math.round(s * m.current.w / 100), n = t.args?.preset?.height || Math.round(c * m.current.h / 100);
2340
- r({
2543
+ if (!t || t.name !== U.CROP) return;
2544
+ let e = t.args?.preset?.width || Math.round(c * h.current.w / 100), n = t.args?.preset?.height || Math.round(l * h.current.h / 100);
2545
+ i({
2341
2546
  width: e,
2342
2547
  height: n,
2343
2548
  action: {
2344
- name: h.CROP,
2549
+ name: U.CROP,
2345
2550
  args: {
2346
2551
  ...t.args,
2347
- ...m.current
2552
+ ...h.current
2348
2553
  }
2349
2554
  }
2350
- }), i(!0);
2555
+ });
2351
2556
  },
2352
- handleClose: () => {
2353
- e(null), i(!0);
2354
- }
2557
+ handleClose: a,
2558
+ isSaving: s
2355
2559
  };
2356
- }, zt = () => {
2357
- let { currentValue: e, handleChange: t, handleSave: n, handleClose: r } = Rt();
2358
- return /* @__PURE__ */ (0, x.jsxs)(U, { children: [/* @__PURE__ */ (0, x.jsx)(Lt, {
2560
+ }, Yt = () => {
2561
+ let { currentValue: e, handleChange: t, handleSave: n, handleClose: r, isSaving: i } = Jt();
2562
+ return /* @__PURE__ */ (0, x.jsxs)(J, { children: [/* @__PURE__ */ (0, x.jsx)(qt, {
2359
2563
  value: e,
2360
2564
  onChange: t
2361
- }), /* @__PURE__ */ (0, x.jsx)(z, {
2565
+ }), /* @__PURE__ */ (0, x.jsx)(R, {
2362
2566
  onSave: n,
2363
- onClose: r
2567
+ onClose: r,
2568
+ saving: i
2364
2569
  })] });
2365
- }, Bt = () => /* @__PURE__ */ (0, x.jsxs)("div", {
2570
+ }, Xt = () => /* @__PURE__ */ (0, x.jsxs)("div", {
2366
2571
  className: $.linesBox,
2367
2572
  children: [/* @__PURE__ */ (0, x.jsx)("span", { className: `${$.line} ${$.lineV}` }), /* @__PURE__ */ (0, x.jsx)("span", { className: `${$.line} ${$.lineH}` })]
2368
- }), Vt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [
2573
+ }), Zt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [
2369
2574
  /* @__PURE__ */ (0, x.jsx)("div", {
2370
2575
  className: `${$.pointer} ${$.pointerTopLeft}`,
2371
2576
  onMouseDown: (t) => e(t, "tl", "nwse")
@@ -2385,20 +2590,20 @@ var q = (e, t, n) => Math.max(t, Math.min(n, e)), $e = (e, t) => [[e[0][0] * t[0
2385
2590
  ] });
2386
2591
  //#endregion
2387
2592
  //#region src/shared/components/Pixedi/crop/useCropInteraction.ts
2388
- function Ht(e, t, n) {
2593
+ function Qt(e, t, n) {
2389
2594
  return Math.min(Math.max(e, t), n);
2390
2595
  }
2391
- function Ut(e, { x: t, y: n, w: r, h: i }) {
2596
+ function $t(e, { x: t, y: n, w: r, h: i }) {
2392
2597
  e.style.left = `${t}%`, e.style.top = `${n}%`, e.style.width = `${r}%`, e.style.height = `${i}%`;
2393
2598
  }
2394
- function Wt(e) {
2599
+ function en(e) {
2395
2600
  let { width: t, height: n } = e.getBoundingClientRect();
2396
2601
  return {
2397
2602
  frameW: t,
2398
2603
  frameH: n
2399
2604
  };
2400
2605
  }
2401
- function Gt({ x: e, y: t, w: n, h: r }, i, a) {
2606
+ function tn({ x: e, y: t, w: n, h: r }, i, a) {
2402
2607
  return {
2403
2608
  x: e / 100 * i,
2404
2609
  y: t / 100 * a,
@@ -2406,7 +2611,7 @@ function Gt({ x: e, y: t, w: n, h: r }, i, a) {
2406
2611
  h: r / 100 * a
2407
2612
  };
2408
2613
  }
2409
- function Kt({ x: e, y: t, w: n, h: r }, i, a) {
2614
+ function nn({ x: e, y: t, w: n, h: r }, i, a) {
2410
2615
  return {
2411
2616
  x: e / i * 100,
2412
2617
  y: t / a * 100,
@@ -2414,24 +2619,24 @@ function Kt({ x: e, y: t, w: n, h: r }, i, a) {
2414
2619
  h: r / a * 100
2415
2620
  };
2416
2621
  }
2417
- var qt = ({ boxRef: e }) => {
2418
- let { currentAction: t, getLastHistoryItem: n, eventBus: r } = P(), i = O(), { width: a, height: s } = n(), c = t?.name === h.CROP || t?.name === h.PRESET_CROP, d = c ? t.args.ratio : 1, f = !c || t.args.isFree, p = l(() => G(d, a, s), [
2622
+ var rn = ({ boxRef: e }) => {
2623
+ let { currentAction: t, getLastHistoryItem: n, eventBus: r } = W(), i = H(), { width: a, height: s } = n(), c = t?.name === U.CROP || t?.name === U.PRESET_CROP, d = c ? t.args.ratio : 1, f = !c || t.args.isFree, p = l(() => K(d, a, s), [
2419
2624
  d,
2420
2625
  a,
2421
2626
  s
2422
- ]), m = u(null), g = u(""), _ = u(p), v = u(p);
2627
+ ]), m = u(null), h = u(""), g = u(p), _ = u(p);
2423
2628
  return o(() => {
2424
- _.current = p, dt(r, p);
2629
+ g.current = p, mt(r, p);
2425
2630
  }, [p, r]), o(() => {
2426
2631
  let t = (e, t) => {
2427
- _.current = t, Ut(e, t), ut(r, {
2632
+ g.current = t, $t(e, t), pt(r, {
2428
2633
  x: Math.round(t.x / 100 * a),
2429
2634
  y: Math.round(t.y / 100 * s),
2430
2635
  w: Math.round(t.w / 100 * a),
2431
2636
  h: Math.round(t.h / 100 * s)
2432
- }), dt(r, t);
2637
+ }), mt(r, t);
2433
2638
  }, n = (e) => {
2434
- e.preventDefault(), v.current = _.current;
2639
+ e.preventDefault(), _.current = g.current;
2435
2640
  let t = "clientX" in e ? e.clientX : e.touches[0].clientX, n = "clientY" in e ? e.clientY : e.touches[0].clientY;
2436
2641
  m.current = {
2437
2642
  x: t,
@@ -2442,27 +2647,27 @@ var qt = ({ boxRef: e }) => {
2442
2647
  t.preventDefault();
2443
2648
  let n = e.current, r = n.parentElement;
2444
2649
  if (!r) return;
2445
- let { frameW: i, frameH: a } = Wt(r);
2446
- if (g.current) {
2650
+ let { frameW: i, frameH: a } = en(r);
2651
+ if (h.current) {
2447
2652
  o(t, n, i, a);
2448
2653
  return;
2449
2654
  }
2450
2655
  c(t, n, i, a);
2451
2656
  }, o = (e, n, r, i) => {
2452
2657
  if (!m.current) return;
2453
- let o = "clientX" in e ? e.clientX : e.touches[0].clientX, c = "clientY" in e ? e.clientY : e.touches[0].clientY, l = Kt(Ke(g.current, f, d, m.current.x, m.current.y, o, c, r, i, Gt(v.current, r, i), Gt(_.current, r, i)), r, i);
2454
- t(n, f ? l : qe(l, d, a, s));
2658
+ let o = "clientX" in e ? e.clientX : e.touches[0].clientX, c = "clientY" in e ? e.clientY : e.touches[0].clientY, l = nn(Ve(h.current, f, d, m.current.x, m.current.y, o, c, r, i, tn(_.current, r, i), tn(g.current, r, i)), r, i);
2659
+ t(n, f ? l : He(l, d, a, s));
2455
2660
  }, c = (e, n, r, i) => {
2456
2661
  if (!m.current) return;
2457
- 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 - m.current.x) / r * 100, f = (u - m.current.y) / i * 100;
2662
+ 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;
2458
2663
  t(n, {
2459
- x: Ht(a + d, 0, Math.max(0, 100 - s)),
2460
- y: Ht(o + f, 0, Math.max(0, 100 - c)),
2664
+ x: Qt(a + d, 0, Math.max(0, 100 - s)),
2665
+ y: Qt(o + f, 0, Math.max(0, 100 - c)),
2461
2666
  w: s,
2462
2667
  h: c
2463
2668
  });
2464
2669
  }, l = () => {
2465
- e.current && (m.current = null, g.current = "", e.current.style.cursor = "move", document.body.style.cursor = "auto");
2670
+ e.current && (m.current = null, h.current = "", e.current.style.cursor = "move", document.body.style.cursor = "auto");
2466
2671
  };
2467
2672
  if (!e.current) return;
2468
2673
  let u = new AbortController(), { signal: p } = u;
@@ -2483,26 +2688,26 @@ var qt = ({ boxRef: e }) => {
2483
2688
  ]), {
2484
2689
  handleCropStart: (t, n, r) => {
2485
2690
  if (!e.current) return;
2486
- t.stopPropagation(), t.preventDefault(), v.current = _.current;
2691
+ t.stopPropagation(), t.preventDefault(), _.current = g.current;
2487
2692
  let a = "clientX" in t ? t.clientX : t.touches[0].clientX, o = "clientY" in t ? t.clientY : t.touches[0].clientY;
2488
2693
  m.current = {
2489
2694
  x: a,
2490
2695
  y: o
2491
- }, g.current = n, i || (e.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
2696
+ }, h.current = n, i || (e.current.style.cursor = `${r}-resize`, document.body.style.cursor = `${r}-resize`);
2492
2697
  },
2493
2698
  initialCrop: p
2494
2699
  };
2495
- }, Jt = ({ onMouseDown: e }) => /* @__PURE__ */ (0, x.jsx)("div", {
2700
+ }, an = ({ onMouseDown: e }) => /* @__PURE__ */ (0, x.jsx)("div", {
2496
2701
  className: $.mobileBorder,
2497
2702
  children: /* @__PURE__ */ (0, x.jsx)("div", {
2498
2703
  className: $.mobilePointer,
2499
2704
  onTouchStart: (t) => e(t, "br", "nwse")
2500
2705
  })
2501
- }), Yt = () => {
2502
- let e = u(null), t = u(null), n = u(null), r = u(null), { currentAction: i, getLastHistoryItem: a, eventBus: s } = P(), { width: c, height: l } = a();
2706
+ }), on = () => {
2707
+ let e = u(null), t = u(null), n = u(null), r = u(null), { currentAction: i, getLastHistoryItem: a, eventBus: s } = W(), { width: c, height: l } = a();
2503
2708
  return o(() => {
2504
- if (!(i?.name === h.CROP || i?.name === h.PRESET_CROP)) return;
2505
- let { xP: a, yP: o, wP: u, hP: d } = G(i.args.ratio, c, l);
2709
+ if (!(i?.name === U.CROP || i?.name === U.PRESET_CROP)) return;
2710
+ let { xP: a, yP: o, wP: u, hP: d } = K(i.args.ratio, c, l);
2506
2711
  e.current && (e.current.textContent = a.toString()), t.current && (t.current.textContent = o.toString()), n.current && (n.current.textContent = u.toString()), r.current && (r.current.textContent = d.toString());
2507
2712
  let f = (i) => {
2508
2713
  let { x: a, y: o, w: s, h: c } = i.detail;
@@ -2534,36 +2739,36 @@ var qt = ({ boxRef: e }) => {
2534
2739
  children: /* @__PURE__ */ (0, x.jsx)("b", { ref: r })
2535
2740
  })
2536
2741
  ] });
2537
- }, Xt = Re.map((e) => e.options).flat(), Zt = () => Xt, Qt = () => {
2538
- let { currentAction: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i, eventBus: a } = P(), { width: s, height: c } = t(), l = e?.name === h.PRESET_CROP && Xt.some((t) => t.value === e.args.id) ? e.args.id : "", d = u({
2742
+ }, sn = g.map((e) => e.options).flat(), cn = () => sn, ln = () => {
2743
+ let { currentAction: e, getLastHistoryItem: t, setCurrentAction: n, eventBus: r } = W(), { commit: i, close: a, isSaving: s } = q(), { width: c, height: l } = t(), d = e?.name === U.PRESET_CROP && sn.some((t) => t.value === e.args.id) ? e.args.id : "", f = u({
2539
2744
  x: 0,
2540
2745
  y: 0,
2541
2746
  w: 0,
2542
2747
  h: 0
2543
2748
  });
2544
2749
  return o(() => {
2545
- if (e?.name !== h.PRESET_CROP) return;
2546
- let t = G(e.args.ratio, s, c);
2547
- d.current = t;
2750
+ if (e?.name !== U.PRESET_CROP) return;
2751
+ let t = K(e.args.ratio, c, l);
2752
+ f.current = t;
2548
2753
  let n = (e) => {
2549
- d.current = e.detail;
2754
+ f.current = e.detail;
2550
2755
  };
2551
- return a.addEventListener("clip-path-update", n), () => {
2552
- a.removeEventListener("clip-path-update", n);
2756
+ return r.addEventListener("clip-path-update", n), () => {
2757
+ r.removeEventListener("clip-path-update", n);
2553
2758
  };
2554
2759
  }, [
2555
2760
  e,
2556
- s,
2557
2761
  c,
2558
- a
2762
+ l,
2763
+ r
2559
2764
  ]), {
2560
- currentValue: l,
2561
- presetsData: Re,
2765
+ currentValue: d,
2766
+ presetsData: g,
2562
2767
  handleChange: (e) => {
2563
2768
  if (!e) return;
2564
- let t = Zt().find((t) => t.value === e);
2769
+ let t = cn().find((t) => t.value === e);
2565
2770
  if (!t) return;
2566
- let n = {
2771
+ let r = {
2567
2772
  id: e,
2568
2773
  ratio: t.w / t.h,
2569
2774
  isFree: !1,
@@ -2572,44 +2777,44 @@ var qt = ({ boxRef: e }) => {
2572
2777
  height: t.h
2573
2778
  }
2574
2779
  };
2575
- i({
2576
- name: h.PRESET_CROP,
2577
- args: n
2780
+ n({
2781
+ name: U.PRESET_CROP,
2782
+ args: r
2578
2783
  });
2579
2784
  },
2580
2785
  handleSave: () => {
2581
- !e || e.name !== h.PRESET_CROP || (n({
2786
+ !e || e.name !== U.PRESET_CROP || i({
2582
2787
  width: e.args?.preset?.width || 0,
2583
2788
  height: e.args?.preset?.height || 0,
2584
2789
  action: {
2585
- name: h.CROP,
2790
+ name: U.CROP,
2586
2791
  args: {
2587
2792
  ...e.args,
2588
- ...d.current
2793
+ ...f.current
2589
2794
  }
2590
2795
  }
2591
- }), r(!0));
2796
+ });
2592
2797
  },
2593
- handleClose: () => {
2594
- i(null), r(!0);
2595
- }
2798
+ handleClose: a,
2799
+ isSaving: s
2596
2800
  };
2597
- }, $t = { select: "_select_1ieak_1" }, en = () => {
2598
- let { currentValue: e, presetsData: t, handleChange: n, handleSave: r, handleClose: i } = Qt();
2599
- return /* @__PURE__ */ (0, x.jsxs)(U, { children: [/* @__PURE__ */ (0, x.jsx)(Te, {
2801
+ }, un = { select: "_select_1ieak_1" }, dn = () => {
2802
+ let { currentValue: e, presetsData: t, handleChange: n, handleSave: r, handleClose: i, isSaving: a } = ln();
2803
+ return /* @__PURE__ */ (0, x.jsxs)(J, { children: [/* @__PURE__ */ (0, x.jsx)(ve, {
2600
2804
  value: e,
2601
2805
  placeholder: "Select preset",
2602
2806
  onChange: n,
2603
2807
  items: t,
2604
- className: $t.select
2605
- }), /* @__PURE__ */ (0, x.jsx)(z, {
2808
+ className: un.select
2809
+ }), /* @__PURE__ */ (0, x.jsx)(R, {
2606
2810
  onSave: r,
2607
- onClose: i
2811
+ onClose: i,
2812
+ saving: a
2608
2813
  })] });
2609
- }, tn = () => {
2610
- let { getLastHistoryItem: e, setCurrentAction: t, addToHistory: n, setSidebar: r } = P(), { width: i, height: a } = e(), [o, s] = d(!1), [c, l] = d(!1), u = (e, n) => {
2814
+ }, fn = () => {
2815
+ let { getLastHistoryItem: e, setCurrentAction: t } = W(), { commit: n, close: r, isSaving: i } = q(), { width: a, height: o } = e(), [s, c] = d(!1), [l, u] = d(!1), f = (e, n) => {
2611
2816
  t({
2612
- name: h.FLIP,
2817
+ name: U.FLIP,
2613
2818
  args: {
2614
2819
  horizontal: e,
2615
2820
  vertical: n
@@ -2617,131 +2822,131 @@ var qt = ({ boxRef: e }) => {
2617
2822
  });
2618
2823
  };
2619
2824
  return {
2620
- flipHorizontal: o,
2621
- flipVertical: c,
2825
+ flipHorizontal: s,
2826
+ flipVertical: l,
2622
2827
  handleFlipHorizontal: () => {
2623
- let e = !o;
2624
- s(e), u(e, c);
2828
+ let e = !s;
2829
+ c(e), f(e, l);
2625
2830
  },
2626
2831
  handleFlipVertical: () => {
2627
- let e = !c;
2628
- l(e), u(o, e);
2832
+ let e = !l;
2833
+ u(e), f(s, e);
2629
2834
  },
2630
2835
  handleSave: () => {
2631
2836
  n({
2632
- width: i,
2633
- height: a,
2837
+ width: a,
2838
+ height: o,
2634
2839
  action: {
2635
- name: h.FLIP,
2840
+ name: U.FLIP,
2636
2841
  args: {
2637
- horizontal: o,
2638
- vertical: c
2842
+ horizontal: s,
2843
+ vertical: l
2639
2844
  }
2640
2845
  }
2641
- }), r(!0);
2846
+ });
2642
2847
  },
2643
- handleClose: () => {
2644
- t(null), r(!0);
2645
- }
2848
+ handleClose: r,
2849
+ isSaving: i
2646
2850
  };
2647
- }, nn = {
2851
+ }, pn = {
2648
2852
  btnH: "_btnH_15adi_1",
2649
2853
  btnV: "_btnV_15adi_7"
2650
- }, rn = () => {
2651
- let { flipHorizontal: e, flipVertical: t, handleFlipHorizontal: n, handleFlipVertical: r, handleSave: i, handleClose: a } = tn();
2652
- return /* @__PURE__ */ (0, x.jsxs)(U, { children: [/* @__PURE__ */ (0, x.jsx)("div", {
2653
- className: nn.scGroup,
2654
- children: /* @__PURE__ */ (0, x.jsxs)(H, {
2854
+ }, mn = () => {
2855
+ let { flipHorizontal: e, flipVertical: t, handleFlipHorizontal: n, handleFlipVertical: r, handleSave: i, handleClose: a, isSaving: o } = fn();
2856
+ return /* @__PURE__ */ (0, x.jsxs)(J, { children: [/* @__PURE__ */ (0, x.jsx)("div", {
2857
+ className: pn.scGroup,
2858
+ children: /* @__PURE__ */ (0, x.jsxs)(V, {
2655
2859
  position: "top",
2656
- children: [/* @__PURE__ */ (0, x.jsx)(I, {
2860
+ children: [/* @__PURE__ */ (0, x.jsx)(F, {
2657
2861
  variant: "outline",
2658
- className: nn.btnH,
2862
+ className: pn.btnH,
2659
2863
  onClick: n,
2660
2864
  "aria-label": "Horizontal",
2661
2865
  "data-tooltip": "Horizontal",
2662
- children: /* @__PURE__ */ (0, x.jsx)(ue, { style: { color: e ? "var(--accent-blue)" : "var(--foreground)" } })
2663
- }), /* @__PURE__ */ (0, x.jsx)(I, {
2866
+ children: /* @__PURE__ */ (0, x.jsx)(M, { style: { color: e ? "var(--accent-blue)" : "var(--foreground)" } })
2867
+ }), /* @__PURE__ */ (0, x.jsx)(F, {
2664
2868
  variant: "outline",
2665
- className: nn.btnV,
2869
+ className: pn.btnV,
2666
2870
  onClick: r,
2667
2871
  "aria-label": "Vertical",
2668
2872
  "data-tooltip": "Vertical",
2669
- children: /* @__PURE__ */ (0, x.jsx)(de, { style: { color: t ? "var(--accent-blue)" : "var(--foreground)" } })
2873
+ children: /* @__PURE__ */ (0, x.jsx)(ie, { style: { color: t ? "var(--accent-blue)" : "var(--foreground)" } })
2670
2874
  })]
2671
2875
  })
2672
- }), /* @__PURE__ */ (0, x.jsx)(z, {
2876
+ }), /* @__PURE__ */ (0, x.jsx)(R, {
2673
2877
  disabled: !e && !t,
2878
+ saving: o,
2674
2879
  onSave: i,
2675
2880
  onClose: a
2676
2881
  })] });
2677
- }, an = () => {
2678
- let { getLastRotation: e, getLastHistoryItem: t, addToHistory: n, setSidebar: r, setCurrentAction: i } = P(), { width: a, height: o } = t(), s = e(), c = u(s), l = u(s);
2882
+ }, hn = () => {
2883
+ let { getLastRotation: e, getLastHistoryItem: t, setCurrentAction: n } = W(), { commit: r, close: i, isSaving: a } = q(), { width: o, height: s } = t(), c = e(), l = u(c), d = u(c);
2679
2884
  return {
2680
2885
  handleRotate: (e) => {
2681
- l.current += e, i({
2682
- name: h.ROTATE,
2683
- args: { degrees: l.current }
2886
+ d.current += e, n({
2887
+ name: U.ROTATE,
2888
+ args: { degrees: d.current }
2684
2889
  });
2685
2890
  },
2686
2891
  handleSave: () => {
2687
- n({
2688
- ...Je(a, o, c.current, l.current),
2892
+ r({
2893
+ ...We(o, s, l.current, d.current),
2689
2894
  action: {
2690
- name: h.ROTATE,
2691
- args: { degrees: l.current }
2895
+ name: U.ROTATE,
2896
+ args: { degrees: d.current }
2692
2897
  }
2693
- }), r(!0);
2898
+ });
2694
2899
  },
2695
- handleClose: () => {
2696
- i(null), r(!0);
2697
- }
2900
+ handleClose: i,
2901
+ isSaving: a
2698
2902
  };
2699
- }, on = {
2903
+ }, gn = {
2700
2904
  btnH: "_btnH_15adi_1",
2701
2905
  btnV: "_btnV_15adi_7"
2702
- }, sn = () => {
2703
- let { handleRotate: e, handleSave: t, handleClose: n } = an();
2704
- return /* @__PURE__ */ (0, x.jsxs)(U, { children: [/* @__PURE__ */ (0, x.jsx)("div", {
2705
- className: on.scGroup,
2706
- children: /* @__PURE__ */ (0, x.jsxs)(H, {
2906
+ }, _n = () => {
2907
+ let { handleRotate: e, handleSave: t, handleClose: n, isSaving: r } = hn();
2908
+ return /* @__PURE__ */ (0, x.jsxs)(J, { children: [/* @__PURE__ */ (0, x.jsx)("div", {
2909
+ className: gn.scGroup,
2910
+ children: /* @__PURE__ */ (0, x.jsxs)(V, {
2707
2911
  position: "top",
2708
- children: [/* @__PURE__ */ (0, x.jsx)(I, {
2912
+ children: [/* @__PURE__ */ (0, x.jsx)(F, {
2709
2913
  variant: "outline",
2710
- className: on.btnH,
2914
+ className: gn.btnH,
2711
2915
  onClick: () => e(90),
2712
2916
  "aria-label": "+90°",
2713
2917
  "data-tooltip": "+90°",
2714
- children: /* @__PURE__ */ (0, x.jsx)(fe, {})
2715
- }), /* @__PURE__ */ (0, x.jsx)(I, {
2918
+ children: /* @__PURE__ */ (0, x.jsx)(N, {})
2919
+ }), /* @__PURE__ */ (0, x.jsx)(F, {
2716
2920
  variant: "outline",
2717
- className: on.btnV,
2921
+ className: gn.btnV,
2718
2922
  onClick: () => e(-90),
2719
2923
  "aria-label": "-90°",
2720
2924
  "data-tooltip": "-90°",
2721
- children: /* @__PURE__ */ (0, x.jsx)(pe, {})
2925
+ children: /* @__PURE__ */ (0, x.jsx)(ae, {})
2722
2926
  })]
2723
2927
  })
2724
- }), /* @__PURE__ */ (0, x.jsx)(z, {
2928
+ }), /* @__PURE__ */ (0, x.jsx)(R, {
2725
2929
  onSave: t,
2726
- onClose: n
2930
+ onClose: n,
2931
+ saving: r
2727
2932
  })] });
2728
- }, cn = { frame: "_frame_1p6kh_1" }, ln = () => {
2729
- let { currentAction: e } = P(), t = e?.name === h.RESIZE, n = e?.name === h.CROP, r = e?.name === h.PRESET_CROP, i = e?.name === h.FLIP, a = e?.name === h.ROTATE, o = e?.name === h.FILTERS, s = n || r;
2933
+ }, vn = { frame: "_frame_1p6kh_1" }, yn = () => {
2934
+ let { currentAction: e } = W(), t = e?.name === U.RESIZE, n = e?.name === U.CROP, r = e?.name === U.PRESET_CROP, i = e?.name === U.FLIP, a = e?.name === U.ROTATE, o = e?.name === U.FILTERS, s = n || r;
2730
2935
  return /* @__PURE__ */ (0, x.jsxs)("div", {
2731
- className: `${cn.frame} ${s ? R.mask : ""}`,
2936
+ className: `${vn.frame} ${s ? L.mask : ""}`,
2732
2937
  children: [
2733
- /* @__PURE__ */ (0, x.jsx)(vt, { faded: s }),
2734
- t && /* @__PURE__ */ (0, x.jsx)(Pt, {}),
2735
- n && /* @__PURE__ */ (0, x.jsx)(zt, {}),
2736
- r && /* @__PURE__ */ (0, x.jsx)(en, {}),
2737
- i && /* @__PURE__ */ (0, x.jsx)(rn, {}),
2738
- a && /* @__PURE__ */ (0, x.jsx)(sn, {}),
2739
- o && /* @__PURE__ */ (0, x.jsx)(gt, {}),
2740
- (n || r) && /* @__PURE__ */ (0, x.jsx)(Ft, {}, e?.args?.id),
2741
- o && /* @__PURE__ */ (0, x.jsx)(bt, {})
2938
+ /* @__PURE__ */ (0, x.jsx)(xt, { faded: s }),
2939
+ t && /* @__PURE__ */ (0, x.jsx)(Wt, {}),
2940
+ n && /* @__PURE__ */ (0, x.jsx)(Yt, {}),
2941
+ r && /* @__PURE__ */ (0, x.jsx)(dn, {}),
2942
+ i && /* @__PURE__ */ (0, x.jsx)(mn, {}),
2943
+ a && /* @__PURE__ */ (0, x.jsx)(_n, {}),
2944
+ o && /* @__PURE__ */ (0, x.jsx)(yt, {}),
2945
+ (n || r) && /* @__PURE__ */ (0, x.jsx)(Gt, {}, e?.args?.id),
2946
+ o && /* @__PURE__ */ (0, x.jsx)(Ct, {})
2742
2947
  ]
2743
2948
  });
2744
- }, un = () => /* @__PURE__ */ (0, x.jsx)("svg", {
2949
+ }, bn = () => /* @__PURE__ */ (0, x.jsx)("svg", {
2745
2950
  style: {
2746
2951
  position: "absolute",
2747
2952
  width: 0,
@@ -2883,71 +3088,72 @@ var qt = ({ boxRef: e }) => {
2883
3088
  })]
2884
3089
  })
2885
3090
  ] })
2886
- }), dn = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = g }) => {
2887
- let [a, o] = d(null), s = k("sm", a), c = {
2888
- ...g,
3091
+ }), xn = ({ image: e, onSave: t, onBack: n, theme: r = "light", settings: i = Et }) => {
3092
+ let [a, o] = d(null), s = Pe("sm", a), c = {
3093
+ ...Et,
2889
3094
  ...i
2890
- }, { loading: l, error: u, mimeType: f, width: p, height: m, originalBlob: h, previewUrl: _, isAlpha: v } = E({
3095
+ }, { loading: l, error: u, mimeType: f, width: p, height: m, originalBlob: h, previewUrl: g, isAlpha: _ } = je({
2891
3096
  src: e,
2892
3097
  skip: c?.tools?.length === 0
2893
3098
  });
2894
3099
  return c?.tools?.length === 0 ? /* @__PURE__ */ (0, x.jsx)("div", {
2895
- className: `${R.root} ${R.wrapper}`,
3100
+ className: `${L.root} ${L.wrapper}`,
2896
3101
  "data-theme": r,
2897
3102
  children: /* @__PURE__ */ (0, x.jsx)("div", {
2898
- className: R.system,
3103
+ className: L.system,
2899
3104
  children: /* @__PURE__ */ (0, x.jsx)("div", {
2900
- className: R.textRed,
3105
+ className: L.textRed,
2901
3106
  children: "No tools selected."
2902
3107
  })
2903
3108
  })
2904
3109
  }) : l || u || !h || !f ? /* @__PURE__ */ (0, x.jsx)("div", {
2905
- className: `${R.root} ${R.wrapper}`,
3110
+ className: `${L.root} ${L.wrapper}`,
2906
3111
  "data-theme": r,
2907
3112
  children: /* @__PURE__ */ (0, x.jsxs)("div", {
2908
- className: R.system,
3113
+ className: L.system,
2909
3114
  children: [
2910
- l && /* @__PURE__ */ (0, x.jsx)(be, { style: {
3115
+ l && /* @__PURE__ */ (0, x.jsx)(pe, { style: {
2911
3116
  width: 48,
2912
3117
  height: 48
2913
3118
  } }),
2914
3119
  u && /* @__PURE__ */ (0, x.jsx)("div", {
2915
- className: R.textRed,
3120
+ className: L.textRed,
2916
3121
  children: u
2917
3122
  }),
2918
3123
  !l && !u && (!h || !f) && /* @__PURE__ */ (0, x.jsx)("div", {
2919
- className: R.textRed,
3124
+ className: L.textRed,
2920
3125
  children: "Failed to load image."
2921
3126
  })
2922
3127
  ]
2923
3128
  })
2924
- }) : /* @__PURE__ */ (0, x.jsx)(S, {
3129
+ }) : /* @__PURE__ */ (0, x.jsx)(kt, {
2925
3130
  mimeType: f,
2926
3131
  width: p,
2927
3132
  height: m,
2928
3133
  originalBlob: h,
2929
- previewUrl: _,
2930
- isAlpha: v,
3134
+ previewUrl: g,
3135
+ isAlpha: _,
2931
3136
  settings: c,
3137
+ onSave: t,
3138
+ onBack: n,
2932
3139
  children: /* @__PURE__ */ (0, x.jsxs)("div", {
2933
3140
  ref: o,
2934
- className: `${R.root} ${R.wrapper}`,
3141
+ className: `${L.root} ${L.wrapper}`,
2935
3142
  "data-theme": r,
2936
- children: [/* @__PURE__ */ (0, x.jsx)(un, {}), /* @__PURE__ */ (0, x.jsxs)("div", {
2937
- className: `${c?.infobar ? R.grid : R.gridNoInfobar} ${s ? R.mobile : ""}`,
3143
+ children: [c?.tools?.includes(U.FILTERS) && /* @__PURE__ */ (0, x.jsx)(bn, {}), c?.tools?.length === 1 ? /* @__PURE__ */ (0, x.jsx)("div", {
3144
+ className: L.gridSingleTool,
3145
+ children: /* @__PURE__ */ (0, x.jsx)(yn, {})
3146
+ }) : /* @__PURE__ */ (0, x.jsxs)("div", {
3147
+ className: `${c?.infobar ? L.grid : L.gridNoInfobar} ${s ? L.mobile : ""}`,
2938
3148
  children: [
2939
- /* @__PURE__ */ (0, x.jsx)(lt, {
2940
- onSave: t,
2941
- onBack: n,
2942
- isMobile: s
2943
- }),
2944
- /* @__PURE__ */ (0, x.jsx)(Tt, { isMobile: s }),
2945
- /* @__PURE__ */ (0, x.jsx)(ln, {}),
2946
- c?.infobar && /* @__PURE__ */ (0, x.jsx)(Ot, {})
3149
+ /* @__PURE__ */ (0, x.jsx)(At, { isMobile: s }),
3150
+ /* @__PURE__ */ (0, x.jsx)(Pt, { isMobile: s }),
3151
+ /* @__PURE__ */ (0, x.jsx)(yn, {}),
3152
+ c?.infobar && /* @__PURE__ */ (0, x.jsx)(Lt, {})
2947
3153
  ]
2948
3154
  })]
2949
3155
  })
2950
3156
  });
2951
3157
  };
2952
3158
  //#endregion
2953
- export { dn as Pixedi };
3159
+ export { xn as Pixedi };