mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
189 lines
590 KiB
JavaScript
189 lines
590 KiB
JavaScript
|
import{r as y,f as fe,j as l,u as NS,c as ne,a as Ae,b as Ee,w as ns,d as un,o as At,S as yc,e as yo,g as qe,h as Nr,k as ei,i as xc,_ as Xd,l as FS,m as LS,R as Me,n as Ev,p as BS,q as Qd,s as ta,t as x1,v as b1,x as HS,y as WS,z as ee,A as S1,B as C1,C as bc,D as rs,F as L,E as K,G as VS,H as dd,T as Ce,I as w1,J as US,K as os,L as Pv,M as $S,N as GS,O as qS,P as Di,Q as j1,U as Iv,V as YS,W as k1,X as KS,Y as XS,Z as QS,$ as E1,a0 as ZS,a1 as JS,a2 as e3,a3 as t3,a4 as n3,a5 as r3,a6 as o3,a7 as P1,a8 as i3,a9 as a3,aa as ql,ab as s3,ac as l3,ad as Nl,ae as Yl,af as Zd,ag as Jd,ah as ef,ai as c3,aj as I1,ak as u3,al as M1,am as d3,an as T1,ao as _1,ap as Uo,aq as kn,ar as D1,as as is,at as f3,au as h3,av as A1,aw as tf,ax as nf,ay as O1,az as rf,aA as of,aB as Mv,aC as z1,aD as R1,aE as N1,aF as Fl,aG as Ll,aH as p3,aI as af,aJ as F1,aK as L1,aL as B1,aM as m3,aN as v3,aO as Tv,aP as _v,aQ as g3,aR as y3,aS as x3,aT as H1,aU as W1,aV as b3,aW as S3,aX as V1,aY as Dv,aZ as C3,a_ as Av,a$ as w3,b0 as j3,b1 as U1,b2 as k3,b3 as E3,b4 as P3,b5 as fd,b6 as Ov,b7 as $1,b8 as sf,b9 as I3,ba as zv,bb as Bl,bc as M3,bd as T3,be as Ua,bf as Kl,bg as G1,bh as Xl,bi as _3,bj as D3,bk as Sr,bl as q1,bm as Zf,bn as as,bo as A3,bp as O3,bq as z3,br as jr,bs as Y1,bt as R3,bu as N3,bv as K1,bw as F3,bx as L3,by as B3,bz as H3,bA as W3,bB as V3,bC as U3,bD as $3,bE as G3,bF as Rv,bG as q3,bH as Y3,bI as K3,bJ as X3,bK as Q3,bL as Z3,bM as hd,bN as za,bO as ml,bP as Nv,bQ as pd,bR as md,bS as vl,bT as Fv,bU as lf,bV as J3,bW as eC,bX as tC,bY as Sc,bZ as nC,b_ as rC,b$ as oC,c0 as iC,c1 as gl,c2 as vd,c3 as yl,c4 as Ma,c5 as aC,c6 as sC,c7 as X1,c8 as Ql,c9 as Jf,ca as Q1,cb as Z1,cc as J1,cd as lC,ce as e2,cf as t2,cg as n2,ch as r2,ci as o2,cj as Li,ck as Bi,cl as i2,cm as a2,cn as s2,co as l2,cp as c2,cq as cC,cr as uC,cs as Lv,ct as xl,cu as dC,cv as Bv,cw as Hv,cx as Wv,cy as Vv,cz as fC,cA as hC,cB as cf,cC as pC,cD as Uv,cE as bl,cF as Zl,cG as mC,cH as vC,cI as gC,cJ as yC,cK as u2,cL as xC,cM as bC}from"./index-f7f41e1f.js";import{I as tn,u as SC,c as CC,a as kt,b as Wt,A as xo,m as ar,d as Hi,e as ti,P as $a,f as wC,C as jC,g as Y,h as A}from"./storeHooks-eaf47ae3.js";function kC(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Jl="NOT_FOUND";function EC(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Jl},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function PC(e,t){var n=[];function r(u){var f=n.findIndex(function(m){return t(u,m.key)});if(f>-1){var h=n[f];return f>0&&(n.splice(f,1),n.unshift(h)),h.value}return Jl}function o(u,f){r(u)===Jl&&(n.unshift({key:u,value:f}),n.length>e&&n.pop())}function s(){return n}function c(){n=[]}return{get:r,put:o,getEntries:s,clear:c}}var IC=function(t,n){return t===n};function MC(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function TC(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?IC:r,s=n.maxSize,c=s===void 0?1:s,u=n.resultEqualityCheck,f=MC(o),h=c===1?EC(f):PC(c,f);function m(){var v=h.get(arguments);if(v===Jl){if(v=e.apply(null,arguments),u){var x=h.getEntries(),S=x.find(function(C){return u(C.value,v)});S&&(v=S.value)}h.put(arguments,v)}return v}return m.clearCache=function(){return h.clear()},m}function _C(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function DC(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];var h=0,m,v={memoizeOptions:void 0},x=u.pop();if(typeof x=="object"&&(v=x,x=u.pop()),typeof
|
||
|
`})}function cw(e){ns({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Oi(e){const{isOpen:t,isDisabled:n}=nh(),{reduceMotion:r}=oh(),o=Ae("chakra-accordion__icon",e.className),s=wc(),c={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return l.jsx(tn,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:c,...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Oi.displayName="AccordionIcon";var zi=fe(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...c}=iw(t),f={...wc().container,overflowAnchor:"none"},h=y.useMemo(()=>c,[c]);return l.jsx(JC,{value:h,children:l.jsx(ne.div,{ref:n,...s,className:Ae("chakra-accordion__item",o),__css:f,children:typeof r=="function"?r({isExpanded:!!c.isOpen,isDisabled:!!c.isDisabled}):r})})});zi.displayName="AccordionItem";var Wo={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ta={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function hf(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Ta.slideRight;case"left":return Ta.slideLeft;case"bottom":return Ta.slideDown;case"top":return Ta.slideUp;default:return Ta.slideRight}}var $o={enter:{duration:.2,ease:Wo.easeOut},exit:{duration:.1,ease:Wo.easeIn}},rr={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},uw=e=>e!=null&&parseInt(e.toString(),10)>0,Kv={exit:{height:{duration:.2,ease:Wo.ease},opacity:{duration:.3,ease:Wo.ease}},enter:{height:{duration:.3,ease:Wo.ease},opacity:{duration:.4,ease:Wo.ease}}},dw={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:uw(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:rr.exit(Kv.exit,o)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(s=n==null?void 0:n.enter)!=null?s:rr.enter(Kv.enter,o)}}},v2=y.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:c="auto",style:u,className:f,transition:h,transitionEnd:m,...v}=e,[x,S]=y.useState(!1);y.useEffect(()=>{const M=setTimeout(()=>{S(!0)});return()=>clearTimeout(M)},[]),ns({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const C=parseFloat(s.toString())>0,j={startingHeight:s,endingHeight:c,animateOpacity:o,transition:x?h:{enter:{duration:0}},transitionEnd:{enter:m==null?void 0:m.enter,exit:r?m==null?void 0:m.exit:{...m==null?void 0:m.exit,display:C?"block":"none"}}},w=r?n:!0,k=n||r?"enter":"exit";return l.jsx(xo,{initial:!1,custom:j,children:w&&l.jsx(ar.div,{ref:t,...v,className:Ae("chakra-collapse",f),style:{overflow:"hidden",display:"block",...u},custom:j,variants:dw,initial:r?"exit":!1,animate:k,exit:"exit"})})});v2.displayName="Collapse";var fw={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:rr.enter($o.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:rr.exit($o.exit,n),transitionEnd:t==null?void 0:t.exit
|
||
|
.`.concat(Gk,` {
|
||
|
overflow: hidden `).concat(r,`;
|
||
|
padding-right: `).concat(u,"px ").concat(r,`;
|
||
|
}
|
||
|
body {
|
||
|
overflow: hidden `).concat(r,`;
|
||
|
overscroll-behavior: contain;
|
||
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
|
padding-left: `.concat(o,`px;
|
||
|
padding-top: `).concat(s,`px;
|
||
|
padding-right: `).concat(c,`px;
|
||
|
margin-left:0;
|
||
|
margin-top:0;
|
||
|
margin-right: `).concat(u,"px ").concat(r,`;
|
||
|
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
|
}
|
||
|
|
||
|
.`).concat(Vl,` {
|
||
|
right: `).concat(u,"px ").concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(Ul,` {
|
||
|
margin-right: `).concat(u,"px ").concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(Vl," .").concat(Vl,` {
|
||
|
right: 0 `).concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(Ul," .").concat(Ul,` {
|
||
|
margin-right: 0 `).concat(r,`;
|
||
|
}
|
||
|
|
||
|
body {
|
||
|
`).concat(qk,": ").concat(u,`px;
|
||
|
}
|
||
|
`)},i7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=y.useMemo(function(){return n7(o)},[o]);return y.createElement(r7,{styles:o7(s,!t,o,n?"":"!important")})},Mf=!1;if(typeof window<"u")try{var jl=Object.defineProperty({},"passive",{get:function(){return Mf=!0,!0}});window.addEventListener("test",jl,jl),window.removeEventListener("test",jl,jl)}catch{Mf=!1}var Ei=Mf?{passive:!1}:!1,a7=function(e){return e.tagName==="TEXTAREA"},Vy=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!a7(e)&&n[t]==="visible")},s7=function(e){return Vy(e,"overflowY")},l7=function(e){return Vy(e,"overflowX")},Eg=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Uy(e,n);if(r){var o=$y(e,n),s=o[1],c=o[2];if(s>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},c7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},u7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Uy=function(e,t){return e==="v"?s7(t):l7(t)},$y=function(e,t){return e==="v"?c7(t):u7(t)},d7=function(e,t){return e==="h"&&t==="rtl"?-1:1},f7=function(e,t,n,r,o){var s=d7(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),h=!1,m=c>0,v=0,x=0;do{var S=$y(e,u),C=S[0],j=S[1],w=S[2],k=j-w-s*C;(C||k)&&Uy(e,u)&&(v+=k,x+=C),u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&(o&&v===0||!o&&c>v)||!m&&(o&&x===0||!o&&-c>x))&&(h=!0),h},kl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pg=function(e){return[e.deltaX,e.deltaY]},Ig=function(e){return e&&"current"in e?e.current:e},h7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},p7=function(e){return`
|
||
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
|
`)},m7=0,Pi=[];function v7(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(m7++)[0],s=y.useState(function(){return Wy()})[0],c=y.useRef(e);y.useEffect(function(){c.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var j=Sf([e.lockRef.current],(e.shards||[]).map(Ig),!0).filter(Boolean);return j.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),j.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(j,w){if("touches"in j&&j.touches.length===2)return!c.current.allowPinchZoom;var k=kl(j),M=n.current,P="deltaX"in j?j.deltaX:M[0]-k[0],I="deltaY"in j?j.deltaY:M[1]-k[1],T,_=j.target,D=Math.abs(P)>Math.abs(I)?"h":"v";if("touches"in j&&D==="h"&&_.type==="range")return!1;var z=Eg(D,_);if(!z)return!0;if(z?T=D:(T=D==="v"?"h":"v",z=Eg(D,_)),!z)return!1;if(!r.current&&"changedTouches"in j&&(P||I)&&(r.current=T),!T)return!0;var W=r.current||T;return f7(W,w,j,W==="h"?P:I,!0)},[]),f=y.useCallback(function(j){var w=j;if(!(!Pi.length||Pi[Pi.length-1]!==s)){var k="deltaY"in w?Pg(w):kl(w),M=t.current.filter(function(T){return T.name===w.type&&T.target===w.target&&h7(T.delta,k)})[0];if(M&&M.should){w.cancelable&&w.preventDefault();return}if(!M){var P=(c.current.shards||[]).map(Ig).filter(Boolean).filter(function(T){return T.contains(w.target)}),I=P.length>0?u(w,P[0]):!c.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),h=y.useCallback(function(j,w,k,M){var P={name:j,delta:w,target:k,should:M};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(I){return I!==P})},1)},[]),m=y.useCallback(function(j){n.current=kl(j),r.current=void 0},[]),v=y.useCallback(function(j){h(j.type,Pg(j),j.target,u(j,e.lockRef.current))},[]),x=y.useCallback(function(j){h(j.type,kl(j),j.target,u(j,e.lockRef.current))},[]);y.useEffect(function(){return Pi.push(s),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Ei),document.addEventListener("touchmove",f,Ei),document.addEventListener("touchstart",m,Ei),function(){Pi=Pi.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,Ei),document.removeEventListener("touchmove",f,Ei),document.removeEventListener("touchstart",m,Ei)}},[]);var S=e.removeScrollBar,C=e.inert;return y.createElement(y.Fragment,null,C?y.createElement(s,{styles:p7(o)}):null,S?y.createElement(i7,{gapMode:"margin"}):null)}const g7=g5(Hy,v7);var Gy=y.forwardRef(function(e,t){return y.createElement(Ic,xr({},e,{ref:t,sideCar:g7}))});Gy.classNames=Ic.classNames;const y7=Gy;function x7(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:c,finalFocusRef:u,returnFocusOnClose:f,preserveScrollBarGap:h,lockFocusAcrossFrames:m,isOpen:v}=Zo(),[x,S]=wC();y.useEffect(()=>{!x&&S&&setTimeout(S)},[x,S]);const C=Ly(r,v);return l.jsx(hy,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:m,children:l.jsx(y7,{removeScrollBar:!h,allowPinchZoom:c,enabled:C===1&&s,forwardProps:!0,children:e.children})})}var vo=fe((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...c}=e,{getDialogProps:u,getDialogContainerProps:f}=Zo(),h=u(c,t),m=f(o),v=Ae("chakra-modal__content",n),x=ia(),S={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...x.dialog},C={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...x.dialogContainer},{motionPreset:j}=Zo();return l.jsx(x7,{children:l.jsx(ne.div,{...m,className:"chakra-modal__content-container",tabIndex:-1,__css:C,children:l.jsx(Fy,{preset:j,motionProps:s,className:v,...h,__css:S,children:r})})})});vo.displayName="ModalContent";function qy(e){const{leastDestructiveRef:t,...n}=e;return l.jsx(mo,{...n,initialFocusRef:t})}var Yy=fe((e,t)=>l.jsx(vo,{ref:t,role:"alertdialog",...e})),Lr=fe((e,t
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fE(e){if(Array.isArray(e))return Af(e)}function Bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Hg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bg(Object(n),!0).forEach(function(r){bx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Za(e,t){return mE(e)||pE(e,t)||Sx(e,t)||hE()}function hE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sx(e,t){if(e){if(typeof e=="string")return Af(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Af(e,t)}}function Af(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function mE(e){if(Array.isArray(e))return e}var vE="file-invalid-type",gE="file-too-large",yE="file-too-small",xE="too-many-files",bE=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:vE,message:"File type must be ".concat(n)}},Wg=function(t){return{code:gE,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Vg=function(t){return{code:yE,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},SE={code:xE,message:"Too many files"};function Cx(e,t){var n=e.type==="application/x-moz-file"||cE(e,t);return[n,n?null:bE(t)]}function wx(e,t,n){if(Ho(e.size))if(Ho(t)&&Ho(n)){if(e.size>n)return[!1,Wg(n)];if(e.size<t)return[!1,Vg(t)]}else{if(Ho(t)&&e.size<t)return[!1,Vg(t)];if(Ho(n)&&e.size>n)return[!1,Wg(n)]}return[!0,null]}function Ho(e){return e!=null}function CE(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=Cx(f,n),m=Za(h,1),v=m[0],x=wx(f,r,o),S=Za(x,1),C=S[0],j=u?u(f):null;return v&&C&&!j})}function cc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Il(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Ug(e){e.preventDefault()}function wE(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function jE(e){return e.indexOf("Edge/")!==-1}function kE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return wE(e)||jE(e)}function vr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(u){return!cc(r)&&u&&u.apply(void 0,[r].concat(s)),cc(r)})}}function EE(){return"showOpenFilePicker"in window}function PE(e){if(Ho(e)){var t=Object.entries(e).filter(function(n){var r=Za(n,2),o=r[0],s=r[1],c=!0;return jx(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(s)||!s.every(kx))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Za(r,2),s=o[0],c=o[1];return Hg(Hg({},n),{},bx({},s,c))},{});return[{description:"Files",accept:t}]}return e}function IE(e){if(Ho(e))return Object.entries(e).reduce(function(t,n){var r=Za(n,2),o=r[0],s=r[1];return[].concat(Lg(t),[o],Lg(s))},[]).filter(function(t){return jx(t)||kx(t)}).join(",")}function ME(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function TE(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function jx(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function kx(e){return/^.*\.[\w]+$/.test(e)}var _E=["children"],DE=["open"],AE=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDr
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FE(e){if(Array.isArray(e))return Of(e)}function Od(e,t){return HE(e)||BE(e,t)||Ex(e,t)||LE()}function LE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ex(e,t){if(e){if(typeof e=="string")return Of(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Of(e,t)}}function Of(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function HE(e){if(Array.isArray(e))return e}function $g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$g(Object(n),!0).forEach(function(r){zf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uc(e,t){if(e==null)return{};var n=WE(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WE(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Xh=y.forwardRef(function(e,t){var n=e.children,r=uc(e,_E),o=Ix(r),s=o.open,c=uc(o,DE);return y.useImperativeHandle(t,function(){return{open:s}},[s]),Me.createElement(y.Fragment,null,n(Dt(Dt({},c),{},{open:s})))});Xh.displayName="Dropzone";var Px={disabled:!1,getFilesFromEvent:eE,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Xh.defaultProps=Px;Xh.propTypes={children:lt.func,accept:lt.objectOf(lt.arrayOf(lt.string)),multiple:lt.bool,preventDropOnDocument:lt.bool,noClick:lt.bool,noKeyboard:lt.bool,noDrag:lt.bool,noDragEventsBubbling:lt.bool,minSize:lt.number,maxSize:lt.number,maxFiles:lt.number,disabled:lt.bool,getFilesFromEvent:lt.func,onFileDialogCancel:lt.func,onFileDialogOpen:lt.func,useFsAccessApi:lt.bool,autoFocus:lt.bool,onDragEnter:lt.func,onDragLeave:lt.func,onDragOver:lt.func,onDrop:lt.func,onDropAccepted:lt.func,onDropRejected:lt.func,onError:lt.func,validator:lt.func};var Rf={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Ix(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Dt(Dt({},Px),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,m=t.onDragLeave,v=t.onDragOver,x=t.onDrop,S=t.onDropAccepted,C=t.onDropRejected,j=t.onFileDialogCancel,w=t.onFileDialogOpen,k=t.useFsAccessApi,M=t.autoFocus,P=t.preventDropOnDocument,I=t.noClick,T=t.noKeyboard,_=t.noDrag,D=t.noDragEventsBubbling,z=t.onError,W=t.validator,F=y.useMemo(function(){return IE(n)},[n]),B=y.useMemo(function(){return PE(n)},[n]),Q=y.useMemo(function(){return typeof w=="function"?w:Gg},[w]),U=y.useMemo(function(){return typeof j=="function"?j:Gg},[j]),X=y.useRef(null),te=y.useRef(null),re=y.useReducer(VE,Rf),$=Od(re,2),Z=$[0],oe=$[1],le=Z.isFocused,ze=Z.isFileDialogActive,Re=y.useRef(typeof window<"u"&&window.isSecureContext&&k&&EE()),Ie=function(){!Re.current&&ze&&setTimeout(function(){if(te.current){var ae=te.current.files;ae.length||(oe({type:"closeDialog"}),U())}},300)};y.useEffe
|
||
|
${_.message}`,"");o({title:s("toast.uploadFailed"),description:I,status:"error",isClosable:!0})},[s,o]),m=y.useCallback(async P=>{n(Rg({imageFile:P}))},[n]),v=y.useCallback((P,I)=>{I.forEach(T=>{h(T)}),P.forEach(T=>{m(T)})},[m,h]),{getRootProps:x,getInputProps:S,isDragAccept:C,isDragReject:j,isDragActive:w,open:k}=Ix({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>u(!0),maxFiles:1});f(k),y.useEffect(()=>{const P=I=>{var z;const T=(z=I.clipboardData)==null?void 0:z.items;if(!T)return;const _=[];for(const W of T)W.kind==="file"&&["image/png","image/jpg"].includes(W.type)&&_.push(W);if(!_.length)return;if(I.stopImmediatePropagation(),_.length>1){o({description:s("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=_[0].getAsFile();if(!D){o({description:s("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(Rg({imageFile:D}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[s,n,o,r]);const M=["img2img","unifiedCanvas"].includes(r)?` to ${String(s(`common.${r}`))}`:"";return l.jsx(Yh.Provider,{value:k,children:l.jsxs(Ye,{...x({style:{}}),onKeyDown:P=>{P.key},children:[l.jsx("input",{...S()}),t,w&&c&&l.jsx(o9,{isDragAccept:C,isDragReject:j,overlaySecondaryText:M,setIsHandlingUpload:u})]})})},a9=y.memo(i9),Ox=fe((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...c}=e;return l.jsx(Gt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:l.jsx(ho,{ref:t,role:n,"aria-checked":s!==void 0?s:void 0,...c})})});Ox.displayName="IAIIconButton";const se=y.memo(Ox);var s9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bt=globalThis&&globalThis.__assign||function(){return Bt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Bt.apply(this,arguments)},Yg={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Kg={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Ml={width:"20px",height:"20px",position:"absolute"},l9={top:Bt(Bt({},Yg),{top:"-5px"}),right:Bt(Bt({},Kg),{left:void 0,right:"-5px"}),bottom:Bt(Bt({},Yg),{top:void 0,bottom:"-5px"}),left:Bt(Bt({},Kg),{left:"-5px"}),topRight:Bt(Bt({},Ml),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Bt(Bt({},Ml),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Bt(Bt({},Ml),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Bt(Bt({},Ml),{left:"-10px",top:"-10px",cursor:"nw-resize"})},c9=function(e){s9(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(r){n.props.onResizeStart(r,n.props.direction)},n.onTouchStart=function(r){n.props.onResizeStart(r,n.props.direction)},n}return t.prototype.render=function(){return y.createElement("div",{className:this.props.className||"",style:Bt(Bt({position:"absolute",userSelect:"none"},l9[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(y.PureComponent),u9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=globalThis&&globalThis.__assign||function(){return yr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProp
|
||
|
* @license React
|
||
|
* react-reconciler.production.min.js
|
||
|
*
|
||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/var mO=function(t){var n={},r=y,o=Bl,s=Object.assign;function c(i){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),h=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),T=Symbol.iterator;function _(i){return i===null||typeof i!="object"?null:(i=T&&i[T]||i["@@iterator"],typeof i=="function"?i:null)}function D(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case m:return"Fragment";case h:return"Portal";case x:return"Profiler";case v:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case C:return(i.displayName||"Context")+".Consumer";case S:return(i._context.displayName||"Context")+".Provider";case j:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return a=i.displayName||null,a!==null?a:D(i.type)||"Memo";case P:a=i._payload,i=i._init;try{return D(i(a))}catch{}}return null}function z(i){var a=i.type;switch(i.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=a.render,i=i.displayName||i.name||"",a.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return D(a);case 8:return a===v?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function W(i){var a=i,d=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,a.flags&4098&&(d=a.return),i=a.return;while(i)}return a.tag===3?d:null}function F(i){if(W(i)!==i)throw Error(c(188))}function B(i){var a=i.alternate;if(!a){if(a=W(i),a===null)throw Error(c(188));return a!==i?null:i}for(var d=i,p=a;;){var g=d.return;if(g===null)break;var b=g.alternate;if(b===null){if(p=g.return,p!==null){d=p;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===d)return F(g),i;if(b===p)return F(g),a;b=b.sibling}throw Error(c(188))}if(d.return!==p.return)d=g,p=b;else{for(var E=!1,O=g.child;O;){if(O===d){E=!0,d=g,p=b;break}if(O===p){E=!0,p=g,d=b;break}O=O.sibling}if(!E){for(O=b.child;O;){if(O===d){E=!0,d=b,p=g;break}if(O===p){E=!0,p=b,d=g;break}O=O.sibling}if(!E)throw Error(c(189))}}if(d.alternate!==p)throw Error(c(190))}if(d.tag!==3)throw Error(c(188));return d.stateNode.current===d?i:a}function Q(i){return i=B(i),i!==null?U(i):null}function U(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var a=U(i);if(a!==null)return a;i=i.sibling}return null}function X(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){if(i.tag!==4){var a=X(i);if(a!==null)return a}i=i.sibling}return null}var te=Array.isArray,re=t.getPublicInstance,$=t.getRootHostContext,Z=t.getChildHostContext,oe=t.prepareForCommit,le=t.resetAfterCommit,ze=t.createInstance,Re=t.appendInitialChild,Ie=t.finalizeInitialChildren,pe=t.prepareUpdate,ce=t.shouldSetTextContent,Ne=t.createTextInstance,Ve=t.scheduleTimeout,Ue=t.cancelTimeout,$e=t.noTimeout,Qe=t.isPrimaryRenderer,ve=t.supportsMutation,Te=t.supportsPersistence,Ge=t.supportsHydration,y
|
||
|
`+Jc+i}var eu=!1;function tu(i,a){if(!i||eu)return"";eu=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ie){var p=ie}Reflect.construct(i,[],a)}else{try{a.call()}catch(ie){p=ie}i.call(a.prototype)}else{try{throw Error()}catch(ie){p=ie}i()}}catch(ie){if(ie&&p&&typeof ie.stack=="string"){for(var g=ie.stack.split(`
|
||
|
`),b=p.stack.split(`
|
||
|
`),E=g.length-1,O=b.length-1;1<=E&&0<=O&&g[E]!==b[O];)O--;for(;1<=E&&0<=O;E--,O--)if(g[E]!==b[O]){if(E!==1||O!==1)do if(E--,O--,0>O||g[E]!==b[O]){var V=`
|
||
|
`+g[E].replace(" at new "," at ");return i.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",i.displayName)),V}while(1<=E&&0<=O);break}}}finally{eu=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ua(i):""}var $4=Object.prototype.hasOwnProperty,nu=[],ci=-1;function Yr(i){return{current:i}}function St(i){0>ci||(i.current=nu[ci],nu[ci]=null,ci--)}function gt(i,a){ci++,nu[ci]=i.current,i.current=a}var Kr={},nn=Yr(Kr),yn=Yr(!1),Po=Kr;function ui(i,a){var d=i.type.contextTypes;if(!d)return Kr;var p=i.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===a)return p.__reactInternalMemoizedMaskedChildContext;var g={},b;for(b in d)g[b]=a[b];return p&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=g),g}function xn(i){return i=i.childContextTypes,i!=null}function js(){St(yn),St(nn)}function Up(i,a,d){if(nn.current!==Kr)throw Error(c(168));gt(nn,a),gt(yn,d)}function $p(i,a,d){var p=i.stateNode;if(a=a.childContextTypes,typeof p.getChildContext!="function")return d;p=p.getChildContext();for(var g in p)if(!(g in a))throw Error(c(108,z(i)||"Unknown",g));return s({},d,p)}function ks(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Kr,Po=nn.current,gt(nn,i),gt(yn,yn.current),!0}function Gp(i,a,d){var p=i.stateNode;if(!p)throw Error(c(169));d?(i=$p(i,a,Po),p.__reactInternalMemoizedMergedChildContext=i,St(yn),St(nn),gt(nn,i)):St(yn),gt(yn,d)}var qn=Math.clz32?Math.clz32:Y4,G4=Math.log,q4=Math.LN2;function Y4(i){return i>>>=0,i===0?32:31-(G4(i)/q4|0)|0}var Es=64,Ps=4194304;function da(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Is(i,a){var d=i.pendingLanes;if(d===0)return 0;var p=0,g=i.suspendedLanes,b=i.pingedLanes,E=d&268435455;if(E!==0){var O=E&~g;O!==0?p=da(O):(b&=E,b!==0&&(p=da(b)))}else E=d&~g,E!==0?p=da(E):b!==0&&(p=da(b));if(p===0)return 0;if(a!==0&&a!==p&&!(a&g)&&(g=p&-p,b=a&-a,g>=b||g===16&&(b&4194240)!==0))return a;if(p&4&&(p|=d&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=p;0<a;)d=31-qn(a),g=1<<d,p|=i[d],a&=~g;return p}function K4(i,a){switch(i){case 1:case 2:case 4:return a+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function X4(i,a){for(var d=i.suspendedLanes,p=i.pingedLanes,g=i.expirationTimes,b=i.pendingLanes;0<b;){var E=31-qn(b),O=1<<E,V=g[E];V===-1?(!(O&d)||O&p)&&(g[E]=K4(O,a)):V<=a&&(i.expiredLanes|=O),b&=~O}}function ru(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function qp(){var i=Es;return Es<<=1,!(Es&4194240)&&(Es=64),i}function ou(i){for(var a=[],d=0;31>d;d++)a.push(i);return a}function fa(i,a,d){i.pendingLanes|=a,a!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,a=31-qn(a),i[a]=d}function Q4(i,a){var d=i.pendingLanes&~a;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=a,i.mutableReadLanes&=a,i.entangledLanes&=a,a=i.entanglements;var p=i.eventTimes;for(i=i.expirationTimes;0<d;){var g=31-qn(d),b=1<<g;a[g]=0,p[g]=-1,i[g]=-1,d&=~b}}function iu(i,a){var d=i.entangledLanes|=a;for(i=i.entanglements;d;){var p=31-qn(d),g=1<<p;g&a|i[p]&a&&(i[p]|=a),d&=~g}}var ot=0;function Yp(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var au=o.unstable_scheduleCallback,Kp=o.unstable_cancelCallback,Z4=o.unstable_sho
|
||
|
Error generating stack: `+b.message+`
|
||
|
`+b.stack}return{value:i,source:a,stack:g,digest:null}}function zu(i,a,d){return{value:i,source:null,stack:d??null,digest:a??null}}function Ru(i,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var pS=typeof WeakMap=="function"?WeakMap:Map;function Rm(i,a,d){d=Dr(-1,d),d.tag=3,d.payload={element:null};var p=a.value;return d.callback=function(){al||(al=!0,nd=p),Ru(i,a)},d}function Nm(i,a,d){d=Dr(-1,d),d.tag=3;var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var g=a.value;d.payload=function(){return p(g)},d.callback=function(){Ru(i,a)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(d.callback=function(){Ru(i,a),typeof p!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var E=a.stack;this.componentDidCatch(a.value,{componentStack:E!==null?E:""})}),d}function Fm(i,a,d){var p=i.pingCache;if(p===null){p=i.pingCache=new pS;var g=new Set;p.set(a,g)}else g=p.get(a),g===void 0&&(g=new Set,p.set(a,g));g.has(d)||(g.add(d),i=IS.bind(null,i,a,d),a.then(i,i))}function Lm(i){do{var a;if((a=i.tag===13)&&(a=i.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return i;i=i.return}while(i!==null);return null}function Bm(i,a,d,p,g){return i.mode&1?(i.flags|=65536,i.lanes=g,i):(i===a?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=Dr(-1,1),a.tag=2,Qr(d,a,1))),d.lanes|=1),i)}var mS=u.ReactCurrentOwner,bn=!1;function hn(i,a,d,p){a.child=i===null?hm(a,null,d,p):vi(a,i.child,d,p)}function Hm(i,a,d,p,g){d=d.render;var b=a.ref;return mi(a,g),p=Mu(i,a,d,p,b,g),d=Tu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~g,Ar(i,a,g)):(Pt&&d&&uu(a),a.flags|=1,hn(i,a,p,g),a.child)}function Wm(i,a,d,p,g){if(i===null){var b=d.type;return typeof b=="function"&&!ld(b)&&b.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=b,Vm(i,a,b,p,g)):(i=fl(d.type,null,p,a,a.mode,g),i.ref=a.ref,i.return=a,a.child=i)}if(b=i.child,!(i.lanes&g)){var E=b.memoizedProps;if(d=d.compare,d=d!==null?d:Os,d(E,p)&&i.ref===a.ref)return Ar(i,a,g)}return a.flags|=1,i=no(b,p),i.ref=a.ref,i.return=a,a.child=i}function Vm(i,a,d,p,g){if(i!==null){var b=i.memoizedProps;if(Os(b,p)&&i.ref===a.ref)if(bn=!1,a.pendingProps=p=b,(i.lanes&g)!==0)i.flags&131072&&(bn=!0);else return a.lanes=i.lanes,Ar(i,a,g)}return Nu(i,a,d,p,g)}function Um(i,a,d){var p=a.pendingProps,g=p.children,b=i!==null?i.memoizedState:null;if(p.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(Si,_n),_n|=d;else{if(!(d&1073741824))return i=b!==null?b.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:i,cachePool:null,transitions:null},a.updateQueue=null,gt(Si,_n),_n|=i,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=b!==null?b.baseLanes:d,gt(Si,_n),_n|=p}else b!==null?(p=b.baseLanes|d,a.memoizedState=null):p=d,gt(Si,_n),_n|=p;return hn(i,a,g,d),a.child}function $m(i,a){var d=a.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function Nu(i,a,d,p,g){var b=xn(d)?Po:nn.current;return b=ui(a,b),mi(a,g),d=Mu(i,a,d,p,b,g),p=Tu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~g,Ar(i,a,g)):(Pt&&p&&uu(a),a.flags|=1,hn(i,a,d,g),a.child)}function Gm(i,a,d,p,g){if(xn(d)){var b=!0;ks(a)}else b=!1;if(mi(a,g),a.stateNode===null)Ys(i,a),cm(a,d,p),Cu(a,d,p,g),p=!0;else if(i===null){var E=a.stateNode,O=a.memoizedProps;E.props=O;var V=E.context,ie=d.contextType;typeof ie=="object"&&ie!==null?ie=zn(ie):(ie=xn(d)?Po:nn.current,ie=ui(a,ie));var ke=d.getDerivedStateFromProps,He=typeof ke=="function"||typeof E.getSnapshotBeforeUpdate=="function";He||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==p||V!==ie)&&um(a,E,p,ie),Xr=!1;var be=a.memoizedState;E.state=be,Fs(a,p,E,g),V=a.memoizedState,O!==p||be!==V||yn.current||Xr?(typeof ke=="function"&&(Su(a,d,ke,p),V=a.memoizedState),(O=Xr||lm(a,d,O,p,be,V,ie))?(He||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="
|
||
|
`+(p.join(" > ")+`
|
||
|
|
||
|
No matching component was found for:
|
||
|
`)+i.join(" > ")}return null},n.getPublicRootInstance=function(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return re(i.child.stateNode);default:return i.child.stateNode}},n.injectIntoDevTools=function(i){if(i={bundleType:i.bundleType,version:i.version,rendererPackageName:i.rendererPackageName,rendererConfig:i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:OS,findFiberByHostInstance:i.findFiberByHostInstance||zS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")i=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)i=!0;else{try{Ms=a.inject(i),lr=a}catch{}i=!!a.checkDCE}}return i},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(i,a,d,p){if(!N)throw Error(c(363));i=Qu(i,a);var g=Ze(i,d,p).disconnect;return{disconnect:function(){g()}}},n.registerMutableSourceForHydration=function(i,a){var d=a._getVersion;d=d(a._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[a,d]:i.mutableSourceEagerHydrationData.push(a,d)},n.runWithPriority=function(i,a){var d=ot;try{return ot=i,a()}finally{ot=d}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(i,a,d,p){var g=a.current,b=sn(),E=eo(g);return d=wv(d),a.context===null?a.context=d:a.pendingContext=d,a=Dr(b,E),a.payload={element:i},p=p===void 0?null:p,p!==null&&(a.callback=p),i=Qr(g,a,E),i!==null&&(Fn(i,g,E,b),Ns(i,g,E)),E},n};(function(e){e.exports=mO})(pO);const vO=M3($f);var pc={},gO={get exports(){return pc},set exports(e){pc=e}},li={};/**
|
||
|
* @license React
|
||
|
* react-reconciler-constants.production.min.js
|
||
|
*
|
||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/li.ConcurrentRoot=1;li.ContinuousEventPriority=4;li.DefaultEventPriority=16;li.DiscreteEventPriority=1;li.IdleEventPriority=536870912;li.LegacyRoot=0;(function(e){e.exports=li})(gO);const J0={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let e1=!1,t1=!1;const Dp=".react-konva-event",yO=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
||
|
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
||
|
Consider to add onDragMove or onDragEnd events.
|
||
|
For more info see: https://github.com/konvajs/react-konva/issues/256
|
||
|
`,xO=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
||
|
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
||
|
For more info see: https://github.com/konvajs/react-konva/issues/194
|
||
|
`,bO={};function Vc(e,t,n=bO){if(!e1&&"zIndex"in t&&(console.warn(xO),e1=!0),!t1&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(yO),t1=!0)}for(var s in n)if(!J0[s]){var c=s.slice(0,2)==="on",u=n[s]!==t[s];if(c&&u){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var h=!t.hasOwnProperty(s);h&&e.setAttr(s,void 0)}var m=t._useStrictMode,v={},x=!1;const S={};for(var s in t)if(!J0[s]){var c=s.slice(0,2)==="on",C=n[s]!==t[s];if(c&&C){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(S[f]=t[s])}!c&&(t[s]!==n[s]||m&&t[s]!==e.getAttr(s))&&(x=!0,v[s]=t[s])}x&&(e.setAttrs(v),wo(e));for(var f in S)e.on(f+Dp,S[f])}function wo(e){if(!T3.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const Vb={},SO={};Ua.Node.prototype._applyProps=Vc;function CO(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),wo(e)}function wO(e,t,n){let r=Ua[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=Ua.Group);const o={},s={};for(var c in t){var u=c.slice(0,2)==="on";u?s[c]=t[c]:o[c]=t[c]}const f=new r(o);return Vc(f,s),f}function jO(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function kO(e,t,n){return!1}function EO(e){return e}function PO(){return null}function IO(){return null}function MO(e,t,n,r){return SO}function TO(){}function _O(e){}function DO(e,t){return!1}function AO(){return Vb}function OO(){return Vb}const zO=setTimeout,RO=clearTimeout,NO=-1;function FO(e,t){return!1}const LO=!1,BO=!0,HO=!0;function WO(e,t){t.parent===e?t.moveToTop():e.add(t),wo(e)}function VO(e,t){t.parent===e?t.moveToTop():e.add(t),wo(e)}function Ub(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),wo(e)}function UO(e,t,n){Ub(e,t,n)}function $O(e,t){t.destroy(),t.off(Dp),wo(e)}function GO(e,t){t.destroy(),t.off(Dp),wo(e)}function qO(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function YO(e,t,n){}function KO(e,t,n,r,o){Vc(e,o,r)}function XO(e){e.hide(),wo(e)}function QO(e){}function ZO(e,t){(t.visible==null||t.visible)&&e.show()}function JO(e,t){}function ez(e){}function tz(){}const nz=()=>pc.DefaultEventPriority,rz=Object.freeze(Object.defineProperty({__proto__:null,appendChild:WO,appendChildToContainer:VO,appendInitialChild:CO,cancelTimeout:RO,clearContainer:ez,commitMount:YO,commitTextUpdate:qO,commitUpdate:KO,createInstance:wO,createTextInstance:jO,detachDeletedInstance:tz,finalizeInitialChildren:kO,getChildHostContext:OO,getCurrentEventPriority:nz,getPublicInstance:EO,getRootHostContext:AO,hideInstance:XO,hideTextInstance:QO,idlePriority:Bl.unstable_IdlePriority,insertBefore:Ub,insertInContainerBefore:UO,isPrimaryRenderer:LO,noTimeout:NO,now:Bl.unstable_now,prepareForCommit:PO,preparePortalMount:IO,prepareUpdate:MO,removeChild:$O,removeChildFromContainer:GO,resetAfterCommit:TO,resetTextContent:_O,run:Bl.unstable_runWithPriority,scheduleTimeout:zO,shouldDeprioritizeSubtree:DO,shouldSetTextContent:FO,supportsMutation:HO,unhideInstance:ZO,unhideTextInstance:JO,warnsIfNotActing:BO},Symbol.toStringTag,{value:"Module"}));var oz=Object.defineProperty,iz=Object.defineProperties,az=Object.getOwnPropertyDescriptors,n1=Object.getOwnPropertySymbols,sz=Object.prototype.hasOwnProperty,lz=Object.prototype.propertyIsEnumerable,r1=(e,t,n)=>t in e?oz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o1=(e,t)=>{for(var n in t||(t={}))sz.call(t,n)&&r1(e,n,t[n]);if(n1)for(var n of n1(t))lz.call(t,n)&&r1(e,n,t[n]);return e},cz=(e,t)=>iz(e,az(t));function $b(e,t,n){if(!e)return;if(n(e
|
||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||
|
<svg width="60px" height="60px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,0)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,2.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,7.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,10)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,12.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,15)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,17.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,20)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,22.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,25)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,27.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,30)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-2.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-7.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-10)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-12.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-15)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-17.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-20)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-22.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-25)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-27.5)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
<g transform="matrix(0.5,0,0,0.5,0,-30)">
|
||
|
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
|
</g>
|
||
|
</svg>`.replaceAll("black",e),Fz=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=A(Nz),[c,u]=y.useState(null),[f,h]=y.useState(0),m=y.useRef(null),v=y.useCallback(()=>{h(f+1),setTimeout(v,500)},[f]);return y.useEffect(()=>{if(c)return;const x=new Image;x.onload=()=>{u(x)},x.src=i1(n)},[c,n]),y.useEffect(()=>{c&&(c.src=i1(n))},[c,n]),y.useEffect(()=>{const x=setInterval(()=>h(S=>(S+1)%5),50);return()=>clearInterval(x)},[]),!c||!ee.isNumber(r.x)||!ee.isNumber(r.y)||!ee.isNumber(s)||!ee.isNumber(o.width)||!ee.isNumber(o.height)?null:l.jsx($r,{ref:m,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:c,fillPatternOffsetY:ee.isNumber(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Lz=me([tt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Bz=e=>{const{...t}=e,{objects:n}=A(Lz);return l.jsx(Ur,{listening:!1,...t,children:n.filter(V3).map((r,o)=>l.jsx(mc,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})};var Lo=y,Hz=function(t,n,r){const o=Lo.useRef("loading"),s=Lo.useRef(),[c,u]=Lo.useState(0),f=Lo.useRef(),h=Lo.useRef(),m=Lo.useRef();return(f.current!==t||h.current!==n||m.current!==r)&&(o.current="loading",s.current=void 0,f.current=t,h.current=n,m.current=r),Lo.useLayoutEffect(function(){if(!t)return;var v=document.createElement("img");function x(){o.current="loaded",s.current=v,u(Math.random())}function S(){o.current="failed",s.current=void 0,u(Math.random())}return v.addEventListener("load",x),v.addEventListener("error",S),n&&(v.crossOrigin=n),r&&(v.referrerpolicy=r),v.src=t,function(){v.removeEventListener("load",x),v.removeEventListener("error",S)}},[t,n,r]),[s.current,o.current]};const Xb=e=>{const{url:t,x:n,y:r}=e,[o]=Hz(t);return l.jsx(Yb,{x:n,y:r,image:o,listening:!1})},Wz=me([tt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Vz=()=>{const{objects:e}=A(Wz);return e?l.jsx(Ur,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if($1(t))return l.jsx(Xb,{x:t.x,y:t.y,url:t.image.url},n);if(U3(t)){const r=l.jsx(mc,{points:t.points,stroke:t.color?Ko(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?l.jsx(Ur,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if($3(t))return l.jsx($r,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Ko(t.color)},n);if(G3(t))return l.jsx($r,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Uz=me([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:o,boundingBoxCoordinates:{x:s,y:c},boundingBoxDimensions:{width:u,height:f}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),$z=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}=A(Uz);return l.jsxs(Ur,{...t,children:[r&&n&&l.jsx(Xb,{url:n.image.url,x:s,y:c}),o&&l.jsxs(Ur,{children:[l.jsx($r,{x:s,y:c,width:u,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),l.jsx($r,{x:s,y:c,width:u,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},Gz=me([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shoul
|
||
|
position: relative;
|
||
|
width: -moz-fit-content;
|
||
|
width: fit-content;
|
||
|
height: -moz-fit-content;
|
||
|
height: fit-content;
|
||
|
overflow: hidden;
|
||
|
-webkit-touch-callout: none; /* iOS Safari */
|
||
|
-webkit-user-select: none; /* Safari */
|
||
|
-khtml-user-select: none; /* Konqueror HTML */
|
||
|
-moz-user-select: none; /* Firefox */
|
||
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
||
|
user-select: none;
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
}
|
||
|
.transform-component-module_content__uCDPE {
|
||
|
display: flex;
|
||
|
flex-wrap: wrap;
|
||
|
width: -moz-fit-content;
|
||
|
width: fit-content;
|
||
|
height: -moz-fit-content;
|
||
|
height: fit-content;
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
transform-origin: 0% 0%;
|
||
|
}
|
||
|
.transform-component-module_content__uCDPE img {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
`,y1={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};GF(qF);var YF=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,s=o===void 0?"":o,c=e.wrapperStyle,u=e.contentStyle,f=e.wrapperProps,h=f===void 0?{}:f,m=e.contentProps,v=m===void 0?{}:m,x=y.useContext(Kc).init,S=y.useRef(null),C=y.useRef(null);return y.useEffect(function(){var j=S.current,w=C.current;j!==null&&w!==null&&x&&x(j,w)},[]),Me.createElement("div",fo({},h,{ref:S,className:"react-transform-wrapper ".concat(y1.wrapper," ").concat(r),style:c}),Me.createElement("div",fo({},v,{ref:C,className:"react-transform-component ".concat(y1.content," ").concat(s),style:u}),t))},w4=function(){var e=y.useContext(Kc),t=y.useState(dt(e||{})),n=t[0],r=t[1];if(!e)throw new Error("Transform context mus be placed inside TransformWrapper");return y.useEffect(function(){e.onChange(function(o){r(o)})},[e]),n};Me.forwardRef(function(e,t){var n=y.useRef(null),r=y.useContext(Kc);return y.useEffect(function(){return r.onChange(function(o){if(n.current){var s=0,c=0;n.current.style.transform=r.handleTransformStyles(s,c,1/o.state.scale)}})},[r]),Me.createElement("div",fo({},e,{ref:CF([n,t])}))});const KF=()=>{const[e,t]=y.useState(0),[n,r]=y.useState(1),[o,s]=y.useState(1);return{rotation:e,scaleX:n,scaleY:o,flipHorizontally:()=>{r(n*-1)},flipVertically:()=>{s(o*-1)},rotateCounterClockwise:()=>{t(e===-270?0:e-90)},rotateClockwise:()=>{t(e===270?0:e+90)},reset:()=>{t(0),r(1),s(1)}}},XF=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:c,resetTransform:u}=w4(),{t:f}=K();return l.jsxs(Qt,{isAttached:!0,orientation:"vertical",children:[l.jsx(se,{icon:l.jsx(yD,{}),"aria-label":f("accessibility.zoomIn"),tooltip:"Zoom In",onClick:()=>s(),fontSize:20}),l.jsx(se,{icon:l.jsx(xD,{}),"aria-label":f("accessibility.zoomOut"),tooltip:"Zoom Out",onClick:()=>c(),fontSize:20}),l.jsx(se,{icon:l.jsx(vD,{}),"aria-label":f("accessibility.rotateCounterClockwise"),tooltip:"Rotate Counter-Clockwise",onClick:n,fontSize:20}),l.jsx(se,{icon:l.jsx(gD,{}),"aria-label":f("accessibility.rotateClockwise"),tooltip:"Rotate Clockwise",onClick:r,fontSize:20}),l.jsx(se,{icon:l.jsx(H0,{}),"aria-label":f("accessibility.flipHorizontally"),tooltip:"Flip Horizontally",onClick:e,fontSize:20}),l.jsx(se,{icon:l.jsx(H0,{style:{transform:"rotate(90deg)"}}),"aria-label":f("accessibility.flipVertically"),tooltip:"Flip Vertically",onClick:t,fontSize:20}),l.jsx(se,{icon:l.jsx(Pb,{}),"aria-label":f("accessibility.reset"),tooltip:"Reset",onClick:()=>{u(),o()},fontSize:20})]})};function QF({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:c}){const{centerView:u}=w4();return l.jsx(YF,{wrapperStyle:{width:"100%",height:"100%"},children:l.jsx("img",{style:{transform:`rotate(${o}deg) scaleX(${s}) scaleY(${c})`,width:"100%"},src:e.url,alt:t,ref:n,className:r||"",onLoad:()=>u(1,0,"easeOut")})})}const ZF=me([qr,Pr],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function JF(){const e=Y(),t=A(x=>x.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h}=KF(),{viewerImageToDisplay:m,shouldShowImageDetails:v}=A(ZF);return de("Esc",()=>{t&&e(Uo(!1))},[t]),l.jsx(xo,{children:t&&l.jsx(ar.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},style:{display:"flex",width:"100vw",height:`calc(100vh - ${dc*4}px)`,position:"fixed",top:`${dc*4}px`,background:"var(--invokeai-colors-base-900)",zIndex:99},children:l.jsxs($F,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:[l.jsxs(L,{sx:{flexDir:"column",position:"absolute",insetInlineStart:4,gap:4,zIndex:3,top:4},children:[l.jsx(se,{icon:l.jsx(mD,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Uo(!1))},fontSize:20}),l.jsx(XF,{flipHorizontally:
|