mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
170 lines
958 KiB
JavaScript
170 lines
958 KiB
JavaScript
import{a as Dc,b as U_,S as G_,c as K_,d as q_,e as o1,f as X_,i as s1,g as gR,h as vR,j as xR,k as bR,l as Q_,m as yR,n as JC,o as Y_,t as CR,p as wR,q as SR,r as kR,s as jR,u as d,v as a,w as $x,x as qp,y as _R,z as IR,A as PR,B as ER,P as MR,C as Lx,D as OR,E as RR,F as DR,G as AR,H as Z_,I as je,J as Nn,K as TR,L as NR,M as $R,N as Wt,O as we,Q as Ye,R as dn,T as He,U as vd,V as dr,W as In,X as Un,Y as on,Z as fa,_ as oi,$ as dt,a0 as Co,a1 as rc,a2 as pa,a3 as ma,a4 as ph,a5 as zx,a6 as xd,a7 as mn,a8 as LR,a9 as H,aa as ew,ab as zR,ac as J_,ad as a1,ae as bd,af as Ac,ag as FR,ah as eI,ai as tI,aj as nI,ak as Ho,al as BR,am as le,an as xe,ao as Bt,ap as W,aq as HR,ar as tw,as as VR,at as WR,au as UR,av as si,aw as te,ax as GR,ay as ct,az as Qt,aA as Ie,aB as L,aC as cr,aD as Jn,aE as Se,aF as Z,aG as rI,aH as KR,aI as qR,aJ as XR,aK as QR,aL as qr,aM as Fx,aN as ha,aO as Nr,aP as yd,aQ as YR,aR as ZR,aS as nw,aT as Bx,aU as ve,aV as Xr,aW as JR,aX as oI,aY as sI,aZ as rw,a_ as eD,a$ as tD,b0 as nD,b1 as ga,b2 as Hx,b3 as yt,b4 as rD,b5 as oD,b6 as aI,b7 as iI,b8 as mh,b9 as sD,ba as ow,bb as lI,bc as aD,bd as iD,be as lD,bf as cD,bg as uD,bh as dD,bi as fD,bj as cI,bk as pD,bl as mD,bm as hD,bn as gD,bo as vD,bp as va,bq as vc,br as xD,bs as $r,bt as bD,bu as yD,bv as CD,bw as sw,bx as wD,by as SD,bz as Zs,bA as hh,bB as Vx,bC as Wx,bD as to,bE as uI,bF as kD,bG as Bi,bH as Mu,bI as aw,bJ as jD,bK as _D,bL as ID,bM as qf,bN as Xf,bO as bu,bP as Q0,bQ as Nu,bR as $u,bS as Lu,bT as zu,bU as iw,bV as Xp,bW as Y0,bX as Qp,bY as lw,bZ as i1,b_ as Z0,b$ as l1,c0 as J0,c1 as Yp,c2 as cw,c3 as Hi,c4 as uw,c5 as Vi,c6 as dw,c7 as Zp,c8 as Cd,c9 as PD,ca as dI,cb as fw,cc as gh,cd as ED,ce as c1,cf as pw,cg as Fr,ch as Ta,ci as mw,cj as Ux,ck as MD,cl as OD,cm as ev,cn as hw,co as u1,cp as vh,cq as RD,cr as fI,cs as d1,ct as f1,cu as pI,cv as DD,cw as p1,cx as AD,cy as m1,cz as TD,cA as h1,cB as ND,cC as $D,cD as LD,cE as Gx,cF as Kx,cG as qx,cH as Xx,cI as Qx,cJ as xh,cK as Yx,cL as Xs,cM as mI,cN as hI,cO as Zx,cP as gI,cQ as zD,cR as yu,cS as sa,cT as vI,cU as xI,cV as gw,cW as Jx,cX as bI,cY as eb,cZ as tb,c_ as yI,c$ as On,d0 as FD,d1 as Rn,d2 as bh,d3 as nb,d4 as CI,d5 as wI,d6 as BD,d7 as HD,d8 as VD,d9 as WD,da as UD,db as GD,dc as KD,dd as qD,de as XD,df as QD,dg as vw,dh as rb,di as YD,dj as ZD,dk as wd,dl as JD,dm as eA,dn as yh,dp as tA,dq as nA,dr as rA,ds as oA,dt as an,du as sA,dv as aA,dw as iA,dx as lA,dy as cA,dz as uA,dA as Ku,dB as xw,dC as Xo,dD as SI,dE as dA,dF as ob,dG as fA,dH as bw,dI as pA,dJ as mA,dK as hA,dL as kI,dM as gA,dN as vA,dO as xA,dP as bA,dQ as yA,dR as CA,dS as wA,dT as jI,dU as SA,dV as kA,dW as yw,dX as jA,dY as _A,dZ as IA,d_ as PA,d$ as EA,e0 as MA,e1 as OA,e2 as _I,e3 as RA,e4 as DA,e5 as AA,e6 as Cw,e7 as Qf,e8 as II,e9 as TA,ea as NA,eb as $A,ec as LA,ed as zA,ee as Vo,ef as FA,eg as BA,eh as HA,ei as VA,ej as WA,ek as UA,el as GA,em as KA,en as qA,eo as XA,ep as QA,eq as YA,er as ZA,es as JA,et as eT,eu as tT,ev as ww,ew as nT,ex as rT,ey as oT,ez as sT,eA as aT,eB as iT,eC as lT,eD as Sw,eE as kw,eF as PI,eG as cT,eH as zo,eI as qu,eJ as wr,eK as uT,eL as dT,eM as EI,eN as MI,eO as fT,eP as jw,eQ as pT,eR as _w,eS as Iw,eT as Pw,eU as mT,eV as hT,eW as Ew,eX as Mw,eY as gT,eZ as vT,e_ as Jp,e$ as xT,f0 as Ow,f1 as Rw,f2 as bT,f3 as yT,f4 as CT,f5 as OI,f6 as wT,f7 as ST,f8 as RI,f9 as kT,fa as jT,fb as Dw,fc as _T,fd as Aw,fe as IT,ff as DI,fg as AI,fh as Sd,fi as TI,fj as Ei,fk as NI,fl as Tw,fm as PT,fn as ET,fo as $I,fp as MT,fq as OT,fr as RT,fs as DT,ft as AT,fu as sb,fv as g1,fw as Nw,fx as tl,fy as TT,fz as NT,fA as $T,fB as LI,fC as ab,fD as zI,fE as ib,fF as FI,fG as LT,fH as Ys,fI as zT,fJ as BI,fK as FT,fL as lb,fM as HI,fN as BT,fO as HT,fP as VT,fQ as WT,fR as UT,fS as GT,fT as KT,fU as em,fV as Ou,fW as Ql,fX as qT,fY as XT,fZ as QT,f_ as YT,f$ as ZT,g0 as JT,g1 as eN,g2 as tN,g3 as $w,g4 as nN,g5 as rN,g6 as oN,g7 as sN,g8 as aN,g9 as iN,ga as Lw,gb as lN,gc as cN,gd as uN,ge as dN,gf as fN,gg as pN,gh as mN,gi as zw,gj as hN,gk as gN,gl as vN,gm as xN,gn as bN,go as yN,gp as CN,gq as wN,gr as SN,gs as kN,gt as jN,gu as _N,gv as IN,gw as PN,gx as kd,gy as EN,gz as MN,gA as ON,gB as RN,gC as DN,gD as AN,gE as TN,gF as NN,gG as Fw,gH as Tp,gI as $N,gJ as tm,gK as VI,gL as nm,gM as LN,gN as zN,gO as oc,gP as WI,gQ as UI,gR as cb,gS as FN,gT as BN,gU as HN,gV as v1,gW as GI,gX as VN,gY as WN,gZ as KI,g_ as UN,g$ as GN,h0 as KN,h1 as qN,h2 as XN,h3 as Bw,h4 as Ml,h5 as QN,h6 as YN,h7 as ZN,h8 as JN,h9 as e9,ha as t9,hb as Hw,hc as n9,hd as r9,he as o9,hf as s9,hg as a9,hh as i9,hi as l9,hj as c9,hk as tv,hl as nv,hm as rv,hn as Yf,ho as Vw,hp as x1,hq as Ww,hr as u9,hs as d9,ht as f9,hu as p9,hv as qI,hw as m9,hx as h9,hy as g9,hz as v9,hA as x9,hB as b9,hC as y9,hD as C9,hE as w9,hF as S9,hG as k9,hH as Zf,hI as ov,hJ as j9,hK as _9,hL as I9,hM as P9,hN as E9,hO as M9,hP as O9,hQ as R9,hR as D9,hS as A9,hT as Uw,hU as Gw,hV as T9,hW as N9,hX as $9,hY as L9,hZ as z9}from"./index-a24a7159.js";import{u as XI,a as xa,b as F9,r as Re,f as B9,g as Kw,c as mt,d as Dn}from"./MantineProvider-2b56c833.js";var H9=200;function V9(e,t,n,r){var o=-1,s=K_,i=!0,l=e.length,u=[],p=t.length;if(!l)return u;n&&(t=Dc(t,U_(n))),r?(s=q_,i=!1):t.length>=H9&&(s=o1,i=!1,t=new G_(t));e:for(;++o<l;){var m=e[o],h=n==null?m:n(m);if(m=r||m!==0?m:0,i&&h===h){for(var g=p;g--;)if(t[g]===h)continue e;u.push(m)}else s(t,h,r)||u.push(m)}return u}var W9=X_(function(e,t){return s1(e)?V9(e,gR(t,1,s1,!0)):[]});const U9=W9;function G9(e,t){var n=-1,r=vR(e)?Array(e.length):[];return xR(e,function(o,s,i){r[++n]=t(o,s,i)}),r}function nr(e,t){var n=bR(e)?Dc:G9;return n(e,Q_(t))}function K9(e,t){return Dc(t,function(n){return e[n]})}function q9(e){return e==null?[]:K9(e,yR(e))}var X9=Math.min;function Q9(e,t,n){for(var r=n?q_:K_,o=e[0].length,s=e.length,i=s,l=Array(s),u=1/0,p=[];i--;){var m=e[i];i&&t&&(m=Dc(m,U_(t))),u=X9(m.length,u),l[i]=!n&&(t||o>=120&&m.length>=120)?new G_(i&&m):void 0}m=e[0];var h=-1,g=l[0];e:for(;++h<o&&p.length<u;){var x=m[h],y=t?t(x):x;if(x=n||x!==0?x:0,!(g?o1(g,y):r(p,y,n))){for(i=s;--i;){var b=l[i];if(!(b?o1(b,y):r(e[i],y,n)))continue e}g&&g.push(y),p.push(x)}}return p}function Y9(e){return s1(e)?e:[]}var Z9=X_(function(e){var t=Dc(e,Y9);return t.length&&t[0]===e[0]?Q9(t):[]});const J9=Z9;function e$(e){return e==null}function t$(e,t,n,r){if(!JC(e))return e;t=Y_(t,e);for(var o=-1,s=t.length,i=s-1,l=e;l!=null&&++o<s;){var u=CR(t[o]),p=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(o!=i){var m=l[u];p=r?r(m,u,l):void 0,p===void 0&&(p=JC(m)?m:wR(t[o+1])?[]:{})}SR(l,u,p),l=l[u]}return e}function n$(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var i=t[r],l=kR(e,i);n(l,i)&&t$(s,Y_(i,e),l)}return s}function qw(e,t){if(e==null)return{};var n=Dc(jR(e),function(r){return[r]});return t=Q_(t),n$(e,n,function(r,o){return t(r,o[0])})}function r$(e,t,n){let r=new Set([...t,void 0]);return e.listen((o,s)=>{r.has(s)&&n(o,s)})}function o$(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}const QI=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:l,strokeWidth:u,className:p,borderRadius:m,shapeRendering:h,onClick:g,selected:x})=>{const{background:y,backgroundColor:b}=s||{},w=i||y||b;return a.jsx("rect",{className:$x(["react-flow__minimap-node",{selected:x},p]),x:t,y:n,rx:m,ry:m,width:r,height:o,fill:w,stroke:l,strokeWidth:u,shapeRendering:h,onClick:g?S=>g(S,e):void 0})};QI.displayName="MiniMapNode";var s$=d.memo(QI);const a$=e=>e.nodeOrigin,i$=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),sv=e=>e instanceof Function?e:()=>e;function l$({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=s$,onClick:i}){const l=qp(i$,Lx),u=qp(a$),p=sv(t),m=sv(e),h=sv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(x=>{const{x:y,y:b}=_R(x,u).positionAbsolute;return a.jsx(s,{x:y,y:b,width:x.width,height:x.height,style:x.style,selected:x.selected,className:h(x),color:p(x),borderRadius:r,strokeColor:m(x),strokeWidth:o,shapeRendering:g,onClick:i,id:x.id},x.id)})})}var c$=d.memo(l$);const u$=200,d$=150,f$=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?DR(AR(t,e.nodeOrigin),n):n,rfId:e.rfId}},p$="react-flow__minimap-desc";function YI({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:l,maskColor:u="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:m=1,position:h="bottom-right",onClick:g,onNodeClick:x,pannable:y=!1,zoomable:b=!1,ariaLabel:w="React Flow mini map",inversePan:S=!1,zoomStep:j=10,offsetScale:_=5}){const E=IR(),I=d.useRef(null),{boundingRect:M,viewBB:R,rfId:D}=qp(f$,Lx),A=(e==null?void 0:e.width)??u$,O=(e==null?void 0:e.height)??d$,T=M.width/A,X=M.height/O,B=Math.max(T,X),V=B*A,U=B*O,N=_*B,$=M.x-(V-M.width)/2-N,q=M.y-(U-M.height)/2-N,F=V+N*2,Q=U+N*2,Y=`${p$}-${D}`,se=d.useRef(0);se.current=B,d.useEffect(()=>{if(I.current){const G=PR(I.current),K=J=>{const{transform:ie,d3Selection:de,d3Zoom:ge}=E.getState();if(J.sourceEvent.type!=="wheel"||!de||!ge)return;const Ce=-J.sourceEvent.deltaY*(J.sourceEvent.deltaMode===1?.05:J.sourceEvent.deltaMode?1:.002)*j,he=ie[2]*Math.pow(2,Ce);ge.scaleTo(de,he)},ee=J=>{const{transform:ie,d3Selection:de,d3Zoom:ge,translateExtent:Ce,width:he,height:fe}=E.getState();if(J.sourceEvent.type!=="mousemove"||!de||!ge)return;const Oe=se.current*Math.max(1,ie[2])*(S?-1:1),_e={x:ie[0]-J.sourceEvent.movementX*Oe,y:ie[1]-J.sourceEvent.movementY*Oe},Ne=[[0,0],[he,fe]],nt=OR.translate(_e.x,_e.y).scale(ie[2]),$e=ge.constrain()(nt,Ne,Ce);ge.transform(de,$e)},ce=ER().on("zoom",y?ee:null).on("zoom.wheel",b?K:null);return G.call(ce),()=>{G.on("zoom",null)}}},[y,b,S,j]);const ae=g?G=>{const K=RR(G);g(G,{x:K[0],y:K[1]})}:void 0,re=x?(G,K)=>{const ee=E.getState().nodeInternals.get(K);x(G,ee)}:void 0;return a.jsx(MR,{position:h,style:e,className:$x(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:O,viewBox:`${$} ${q} ${F} ${Q}`,role:"img","aria-labelledby":Y,ref:I,onClick:ae,children:[w&&a.jsx("title",{id:Y,children:w}),a.jsx(c$,{onClick:re,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${$-N},${q-N}h${F+N*2}v${Q+N*2}h${-F-N*2}z
|
||
M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fill:u,fillRule:"evenodd",stroke:p,strokeWidth:m,pointerEvents:"none"})]})})}YI.displayName="MiniMap";var m$=d.memo(YI),Wo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Wo||(Wo={}));function h$({color:e,dimensions:t,lineWidth:n}){return a.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function g$({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const v$={[Wo.Dots]:"#91919a",[Wo.Lines]:"#eee",[Wo.Cross]:"#e2e2e2"},x$={[Wo.Dots]:1,[Wo.Lines]:1,[Wo.Cross]:6},b$=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ZI({id:e,variant:t=Wo.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:l,className:u}){const p=d.useRef(null),{transform:m,patternId:h}=qp(b$,Lx),g=i||v$[t],x=r||x$[t],y=t===Wo.Dots,b=t===Wo.Cross,w=Array.isArray(n)?n:[n,n],S=[w[0]*m[2]||1,w[1]*m[2]||1],j=x*m[2],_=b?[j,j]:S,E=y?[j/s,j/s]:[_[0]/s,_[1]/s];return a.jsxs("svg",{className:$x(["react-flow__background",u]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background",children:[a.jsx("pattern",{id:h+e,x:m[0]%S[0],y:m[1]%S[1],width:S[0],height:S[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:y?a.jsx(g$,{color:g,radius:j/s}):a.jsx(h$,{dimensions:_,color:g,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${h+e})`})]})}ZI.displayName="Background";var y$=d.memo(ZI);const Xw=(e,t,n)=>{C$(n);const r=Z_(e,t);return JI[n].includes(r)},JI={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Qw=Object.keys(JI),C$=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Qw.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Qw.join("|")}`)};function w$(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var S$=w$();const e5=1/60*1e3,k$=typeof performance<"u"?()=>performance.now():()=>Date.now(),t5=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(k$()),e5);function j$(e){let t=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,l={schedule:(u,p=!1,m=!1)=>{const h=m&&o,g=h?t:n;return p&&i.add(u),g.indexOf(u)===-1&&(g.push(u),h&&o&&(r=t.length)),u},cancel:u=>{const p=n.indexOf(u);p!==-1&&n.splice(p,1),i.delete(u)},process:u=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let p=0;p<r;p++){const m=t[p];m(u),i.has(m)&&(l.schedule(m),e())}o=!1,s&&(s=!1,l.process(u))}};return l}const _$=40;let b1=!0,Xu=!1,y1=!1;const sc={delta:0,timestamp:0},jd=["read","update","preRender","render","postRender"],Ch=jd.reduce((e,t)=>(e[t]=j$(()=>Xu=!0),e),{}),I$=jd.reduce((e,t)=>{const n=Ch[t];return e[t]=(r,o=!1,s=!1)=>(Xu||M$(),n.schedule(r,o,s)),e},{}),P$=jd.reduce((e,t)=>(e[t]=Ch[t].cancel,e),{});jd.reduce((e,t)=>(e[t]=()=>Ch[t].process(sc),e),{});const E$=e=>Ch[e].process(sc),n5=e=>{Xu=!1,sc.delta=b1?e5:Math.max(Math.min(e-sc.timestamp,_$),1),sc.timestamp=e,y1=!0,jd.forEach(E$),y1=!1,Xu&&(b1=!1,t5(n5))},M$=()=>{Xu=!0,b1=!0,y1||t5(n5)},Yw=()=>sc;function wh(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=d.Children.toArray(e.path),i=je((l,u)=>a.jsx(Nn,{ref:u,viewBox:t,...o,...l,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}function r5(e){const{theme:t}=TR(),n=NR();return d.useMemo(()=>$R(t.direction,{...n,...e}),[e,t.direction,n])}var O$=Object.defineProperty,R$=(e,t,n)=>t in e?O$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jn=(e,t,n)=>(R$(e,typeof t!="symbol"?t+"":t,n),n);function Zw(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var D$=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Jw(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function eS(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var C1=typeof window<"u"?d.useLayoutEffect:d.useEffect,rm=e=>e,A$=class{constructor(){jn(this,"descendants",new Map),jn(this,"register",e=>{if(e!=null)return D$(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),jn(this,"unregister",e=>{this.descendants.delete(e);const t=Zw(Array.from(this.descendants.keys()));this.assignIndex(t)}),jn(this,"destroy",()=>{this.descendants.clear()}),jn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),jn(this,"count",()=>this.descendants.size),jn(this,"enabledCount",()=>this.enabledValues().length),jn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),jn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),jn(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),jn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),jn(this,"first",()=>this.item(0)),jn(this,"firstEnabled",()=>this.enabledItem(0)),jn(this,"last",()=>this.item(this.descendants.size-1)),jn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),jn(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),jn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),jn(this,"next",(e,t=!0)=>{const n=Jw(e,this.count(),t);return this.item(n)}),jn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Jw(r,this.enabledCount(),t);return this.enabledItem(o)}),jn(this,"prev",(e,t=!0)=>{const n=eS(e,this.count()-1,t);return this.item(n)}),jn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=eS(r,this.enabledCount()-1,t);return this.enabledItem(o)}),jn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Zw(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function T$(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function It(...e){return t=>{e.forEach(n=>{T$(n,t)})}}function N$(...e){return d.useMemo(()=>It(...e),e)}function $$(){const e=d.useRef(new A$);return C1(()=>()=>e.current.destroy()),e.current}var[L$,o5]=Wt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function z$(e){const t=o5(),[n,r]=d.useState(-1),o=d.useRef(null);C1(()=>()=>{o.current&&t.unregister(o.current)},[]),C1(()=>{if(!o.current)return;const i=Number(o.current.dataset.index);n!=i&&!Number.isNaN(i)&&r(i)});const s=rm(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:It(s,o)}}function ub(){return[rm(L$),()=>rm(o5()),()=>$$(),o=>z$(o)]}var[F$,Sh]=Wt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[B$,db]=Wt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[H$,R1e,V$,W$]=ub(),Bl=je(function(t,n){const{getButtonProps:r}=db(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...Sh().button};return a.jsx(we.button,{...o,className:Ye("chakra-accordion__button",t.className),__css:i})});Bl.displayName="AccordionButton";function _d(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(g,x)=>g!==x}=e,s=dn(r),i=dn(o),[l,u]=d.useState(n),p=t!==void 0,m=p?t:l,h=dn(g=>{const y=typeof g=="function"?g(m):g;i(m,y)&&(p||u(y),s(y))},[p,s,m,i]);return[m,h]}function U$(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;q$(e),X$(e);const l=V$(),[u,p]=d.useState(-1);d.useEffect(()=>()=>{p(-1)},[]);const[m,h]=_d({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:m,setIndex:h,htmlProps:i,getAccordionItemProps:x=>{let y=!1;return x!==null&&(y=Array.isArray(m)?m.includes(x):m===x),{isOpen:y,onChange:w=>{if(x!==null)if(o&&Array.isArray(m)){const S=w?m.concat(x):m.filter(j=>j!==x);h(S)}else w?h(x):s&&h(-1)}}},focusedIndex:u,setFocusedIndex:p,descendants:l}}var[G$,fb]=Wt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function K$(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=fb(),l=d.useRef(null),u=d.useId(),p=r??u,m=`accordion-button-${p}`,h=`accordion-panel-${p}`;Q$(e);const{register:g,index:x,descendants:y}=W$({disabled:t&&!n}),{isOpen:b,onChange:w}=s(x===-1?null:x);Y$({isOpen:b,isDisabled:t});const S=()=>{w==null||w(!0)},j=()=>{w==null||w(!1)},_=d.useCallback(()=>{w==null||w(!b),i(x)},[x,i,b,w]),E=d.useCallback(D=>{const O={ArrowDown:()=>{const T=y.nextEnabled(x);T==null||T.node.focus()},ArrowUp:()=>{const T=y.prevEnabled(x);T==null||T.node.focus()},Home:()=>{const T=y.firstEnabled();T==null||T.node.focus()},End:()=>{const T=y.lastEnabled();T==null||T.node.focus()}}[D.key];O&&(D.preventDefault(),O(D))},[y,x]),I=d.useCallback(()=>{i(x)},[i,x]),M=d.useCallback(function(A={},O=null){return{...A,type:"button",ref:It(g,l,O),id:m,disabled:!!t,"aria-expanded":!!b,"aria-controls":h,onClick:He(A.onClick,_),onFocus:He(A.onFocus,I),onKeyDown:He(A.onKeyDown,E)}},[m,t,b,_,I,E,h,g]),R=d.useCallback(function(A={},O=null){return{...A,ref:O,role:"region",id:h,"aria-labelledby":m,hidden:!b}},[m,b,h]);return{isOpen:b,isDisabled:t,isFocusable:n,onOpen:S,onClose:j,getButtonProps:M,getPanelProps:R,htmlProps:o}}function q$(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;vd({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function X$(e){vd({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function Q$(e){vd({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.
|
||
`})}function Y$(e){vd({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Hl(e){const{isOpen:t,isDisabled:n}=db(),{reduceMotion:r}=fb(),o=Ye("chakra-accordion__icon",e.className),s=Sh(),i={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return a.jsx(Nn,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:i,...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Hl.displayName="AccordionIcon";var Vl=je(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=K$(t),u={...Sh().container,overflowAnchor:"none"},p=d.useMemo(()=>i,[i]);return a.jsx(B$,{value:p,children:a.jsx(we.div,{ref:n,...s,className:Ye("chakra-accordion__item",o),__css:u,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});Vl.displayName="AccordionItem";var Yl={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ri={enter:{duration:.2,ease:Yl.easeOut},exit:{duration:.1,ease:Yl.easeIn}},Js={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})},Z$=e=>e!=null&&parseInt(e.toString(),10)>0,tS={exit:{height:{duration:.2,ease:Yl.ease},opacity:{duration:.3,ease:Yl.ease}},enter:{height:{duration:.3,ease:Yl.ease},opacity:{duration:.4,ease:Yl.ease}}},J$={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:Z$(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Js.exit(tS.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:Js.enter(tS.enter,o)}}},Id=d.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:l,className:u,transition:p,transitionEnd:m,...h}=e,[g,x]=d.useState(!1);d.useEffect(()=>{const j=setTimeout(()=>{x(!0)});return()=>clearTimeout(j)},[]),vd({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const y=parseFloat(s.toString())>0,b={startingHeight:s,endingHeight:i,animateOpacity:o,transition:g?p:{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:y?"block":"none"}}},w=r?n:!0,S=n||r?"enter":"exit";return a.jsx(dr,{initial:!1,custom:b,children:w&&a.jsx(In.div,{ref:t,...h,className:Ye("chakra-collapse",u),style:{overflow:"hidden",display:"block",...l},custom:b,variants:J$,initial:r?"exit":!1,animate:S,exit:"exit"})})});Id.displayName="Collapse";var eL={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Js.enter(Ri.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:Js.exit(Ri.exit,n),transitionEnd:t==null?void 0:t.exit}}},s5={initial:"exit",animate:"enter",exit:"exit",variants:eL},tL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:l,delay:u,...p}=t,m=o||r?"enter":"exit",h=r?o&&r:!0,g={transition:i,transitionEnd:l,delay:u};return a.jsx(dr,{custom:g,children:h&&a.jsx(In.div,{ref:n,className:Ye("chakra-fade",s),custom:g,...s5,animate:m,...p})})});tL.displayName="Fade";var nL={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(s=n==null?void 0:n.exit)!=null?s:Js.exit(Ri.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Js.enter(Ri.enter,n),transitionEnd:e==null?void 0:e.enter}}},a5={initial:"exit",animate:"enter",exit:"exit",variants:nL},rL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:l,transition:u,transitionEnd:p,delay:m,...h}=t,g=r?o&&r:!0,x=o||r?"enter":"exit",y={initialScale:i,reverse:s,transition:u,transitionEnd:p,delay:m};return a.jsx(dr,{custom:y,children:g&&a.jsx(In.div,{ref:n,className:Ye("chakra-offset-slide",l),...a5,animate:x,custom:y,...h})})});rL.displayName="ScaleFade";var oL={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,x:e,y:t,transition:(s=n==null?void 0:n.exit)!=null?s:Js.exit(Ri.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Js.enter(Ri.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var i;const l={x:t,y:e};return{opacity:0,transition:(i=n==null?void 0:n.exit)!=null?i:Js.exit(Ri.exit,s),...o?{...l,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...l,...r==null?void 0:r.exit}}}}},w1={initial:"initial",animate:"enter",exit:"exit",variants:oL},sL=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:l=0,offsetY:u=8,transition:p,transitionEnd:m,delay:h,...g}=t,x=r?o&&r:!0,y=o||r?"enter":"exit",b={offsetX:l,offsetY:u,reverse:s,transition:p,transitionEnd:m,delay:h};return a.jsx(dr,{custom:b,children:x&&a.jsx(In.div,{ref:n,className:Ye("chakra-offset-slide",i),custom:b,...w1,animate:y,...g})})});sL.displayName="SlideFade";var Wl=je(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=fb(),{getPanelProps:l,isOpen:u}=db(),p=l(s,n),m=Ye("chakra-accordion__panel",r),h=Sh();i||delete p.hidden;const g=a.jsx(we.div,{...p,__css:h.panel,className:m});return i?g:a.jsx(Id,{in:u,...o,children:g})});Wl.displayName="AccordionPanel";var i5=je(function({children:t,reduceMotion:n,...r},o){const s=Un("Accordion",r),i=on(r),{htmlProps:l,descendants:u,...p}=U$(i),m=d.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(H$,{value:u,children:a.jsx(G$,{value:m,children:a.jsx(F$,{value:s,children:a.jsx(we.div,{ref:o,...l,className:Ye("chakra-accordion",r.className),__css:s.root,children:t})})})})});i5.displayName="Accordion";function kh(e){return d.Children.toArray(e).filter(t=>d.isValidElement(t))}var[aL,iL]=Wt({strict:!1,name:"ButtonGroupContext"}),lL={horizontal:{"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},cL={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Vt=je(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:l="0.5rem",isAttached:u,isDisabled:p,orientation:m="horizontal",...h}=t,g=Ye("chakra-button__group",i),x=d.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let y={display:"inline-flex",...u?lL[m]:cL[m](l)};const b=m==="vertical";return a.jsx(aL,{value:x,children:a.jsx(we.div,{ref:n,role:"group",__css:y,className:g,"data-attached":u?"":void 0,"data-orientation":m,flexDir:b?"column":void 0,...h})})});Vt.displayName="ButtonGroup";function uL(e){const[t,n]=d.useState(!e);return{ref:d.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function S1(e){const{children:t,className:n,...r}=e,o=d.isValidElement(t)?d.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=Ye("chakra-button__icon",n);return a.jsx(we.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}S1.displayName="ButtonIcon";function k1(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(fa,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:i,...l}=e,u=Ye("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",m=d.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[p]:t?r:0,fontSize:"1em",lineHeight:"normal",...i}),[i,t,p,r]);return a.jsx(we.div,{className:u,...l,__css:m,children:o})}k1.displayName="ButtonSpinner";var Za=je((e,t)=>{const n=iL(),r=oi("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:i,children:l,leftIcon:u,rightIcon:p,loadingText:m,iconSpacing:h="0.5rem",type:g,spinner:x,spinnerPlacement:y="start",className:b,as:w,...S}=on(e),j=d.useMemo(()=>{const M={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:M}}},[r,n]),{ref:_,type:E}=uL(w),I={rightIcon:p,leftIcon:u,iconSpacing:h,children:l};return a.jsxs(we.button,{ref:N$(t,_),as:w,type:g??E,"data-active":dt(i),"data-loading":dt(s),__css:j,className:Ye("chakra-button",b),...S,disabled:o||s,children:[s&&y==="start"&&a.jsx(k1,{className:"chakra-button__spinner--start",label:m,placement:"start",spacing:h,children:x}),s?m||a.jsx(we.span,{opacity:0,children:a.jsx(nS,{...I})}):a.jsx(nS,{...I}),s&&y==="end"&&a.jsx(k1,{className:"chakra-button__spinner--end",label:m,placement:"end",spacing:h,children:x})]})});Za.displayName="Button";function nS(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return a.jsxs(a.Fragment,{children:[t&&a.jsx(S1,{marginEnd:o,children:t}),r,n&&a.jsx(S1,{marginStart:o,children:n})]})}var ys=je((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...i}=e,l=n||r,u=d.isValidElement(l)?d.cloneElement(l,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(Za,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...i,children:u})});ys.displayName="IconButton";var[D1e,dL]=Wt({name:"CheckboxGroupContext",strict:!1});function fL(e){const[t,n]=d.useState(e),[r,o]=d.useState(!1);return e!==t&&(o(!0),n(e)),r}function pL(e){return a.jsx(we.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:a.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function mL(e){return a.jsx(we.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:a.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function hL(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?mL:pL;return n||t?a.jsx(we.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[gL,l5]=Wt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[vL,Pd]=Wt({strict:!1,name:"FormControlContext"});function xL(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...i}=e,l=d.useId(),u=t||`field-${l}`,p=`${u}-label`,m=`${u}-feedback`,h=`${u}-helptext`,[g,x]=d.useState(!1),[y,b]=d.useState(!1),[w,S]=d.useState(!1),j=d.useCallback((R={},D=null)=>({id:h,...R,ref:It(D,A=>{A&&b(!0)})}),[h]),_=d.useCallback((R={},D=null)=>({...R,ref:D,"data-focus":dt(w),"data-disabled":dt(o),"data-invalid":dt(r),"data-readonly":dt(s),id:R.id!==void 0?R.id:p,htmlFor:R.htmlFor!==void 0?R.htmlFor:u}),[u,o,w,r,s,p]),E=d.useCallback((R={},D=null)=>({id:m,...R,ref:It(D,A=>{A&&x(!0)}),"aria-live":"polite"}),[m]),I=d.useCallback((R={},D=null)=>({...R,...i,ref:D,role:"group"}),[i]),M=d.useCallback((R={},D=null)=>({...R,ref:D,role:"presentation","aria-hidden":!0,children:R.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>S(!0),onBlur:()=>S(!1),hasFeedbackText:g,setHasFeedbackText:x,hasHelpText:y,setHasHelpText:b,id:u,labelId:p,feedbackId:m,helpTextId:h,htmlProps:i,getHelpTextProps:j,getErrorMessageProps:E,getRootProps:I,getLabelProps:_,getRequiredIndicatorProps:M}}var Kt=je(function(t,n){const r=Un("Form",t),o=on(t),{getRootProps:s,htmlProps:i,...l}=xL(o),u=Ye("chakra-form-control",t.className);return a.jsx(vL,{value:l,children:a.jsx(gL,{value:r,children:a.jsx(we.div,{...s({},n),className:u,__css:r.container})})})});Kt.displayName="FormControl";var c5=je(function(t,n){const r=Pd(),o=l5(),s=Ye("chakra-form__helper-text",t.className);return a.jsx(we.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});c5.displayName="FormHelperText";var wn=je(function(t,n){var r;const o=oi("FormLabel",t),s=on(t),{className:i,children:l,requiredIndicator:u=a.jsx(u5,{}),optionalIndicator:p=null,...m}=s,h=Pd(),g=(r=h==null?void 0:h.getLabelProps(m,n))!=null?r:{ref:n,...m};return a.jsxs(we.label,{...g,className:Ye("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[l,h!=null&&h.isRequired?u:p]})});wn.displayName="FormLabel";var u5=je(function(t,n){const r=Pd(),o=l5();if(!(r!=null&&r.isRequired))return null;const s=Ye("chakra-form__required-indicator",t.className);return a.jsx(we.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});u5.displayName="RequiredIndicator";function pb(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=mb(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":Co(n),"aria-required":Co(o),"aria-readonly":Co(r)}}function mb(e){var t,n,r;const o=Pd(),{id:s,disabled:i,readOnly:l,required:u,isRequired:p,isInvalid:m,isReadOnly:h,isDisabled:g,onFocus:x,onBlur:y,...b}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...b,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=i??g)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=l??h)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=u??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:m??(o==null?void 0:o.isInvalid),onFocus:He(o==null?void 0:o.onFocus,x),onBlur:He(o==null?void 0:o.onBlur,y)}}var hb={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},d5=we("span",{baseStyle:hb});d5.displayName="VisuallyHidden";var bL=we("input",{baseStyle:hb});bL.displayName="VisuallyHiddenInput";const yL=()=>typeof document<"u";let rS=!1,Ed=null,Wi=!1,j1=!1;const _1=new Set;function gb(e,t){_1.forEach(n=>n(e,t))}const CL=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function wL(e){return!(e.metaKey||!CL&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function oS(e){Wi=!0,wL(e)&&(Ed="keyboard",gb("keyboard",e))}function Ol(e){if(Ed="pointer",e.type==="mousedown"||e.type==="pointerdown"){Wi=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;gb("pointer",e)}}function SL(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function kL(e){SL(e)&&(Wi=!0,Ed="virtual")}function jL(e){e.target===window||e.target===document||(!Wi&&!j1&&(Ed="virtual",gb("virtual",e)),Wi=!1,j1=!1)}function _L(){Wi=!1,j1=!0}function sS(){return Ed!=="pointer"}function IL(){if(!yL()||rS)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Wi=!0,e.apply(this,n)},document.addEventListener("keydown",oS,!0),document.addEventListener("keyup",oS,!0),document.addEventListener("click",kL,!0),window.addEventListener("focus",jL,!0),window.addEventListener("blur",_L,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Ol,!0),document.addEventListener("pointermove",Ol,!0),document.addEventListener("pointerup",Ol,!0)):(document.addEventListener("mousedown",Ol,!0),document.addEventListener("mousemove",Ol,!0),document.addEventListener("mouseup",Ol,!0)),rS=!0}function f5(e){IL(),e(sS());const t=()=>e(sS());return _1.add(t),()=>{_1.delete(t)}}function PL(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function p5(e={}){const t=mb(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:l,onFocus:u,"aria-describedby":p}=t,{defaultChecked:m,isChecked:h,isFocusable:g,onChange:x,isIndeterminate:y,name:b,value:w,tabIndex:S=void 0,"aria-label":j,"aria-labelledby":_,"aria-invalid":E,...I}=e,M=PL(I,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),R=dn(x),D=dn(l),A=dn(u),[O,T]=d.useState(!1),[X,B]=d.useState(!1),[V,U]=d.useState(!1),[N,$]=d.useState(!1);d.useEffect(()=>f5(T),[]);const q=d.useRef(null),[F,Q]=d.useState(!0),[Y,se]=d.useState(!!m),ae=h!==void 0,re=ae?h:Y,G=d.useCallback(fe=>{if(r||n){fe.preventDefault();return}ae||se(re?fe.target.checked:y?!0:fe.target.checked),R==null||R(fe)},[r,n,re,ae,y,R]);rc(()=>{q.current&&(q.current.indeterminate=!!y)},[y]),pa(()=>{n&&B(!1)},[n,B]),rc(()=>{const fe=q.current;if(!(fe!=null&&fe.form))return;const Oe=()=>{se(!!m)};return fe.form.addEventListener("reset",Oe),()=>{var _e;return(_e=fe.form)==null?void 0:_e.removeEventListener("reset",Oe)}},[]);const K=n&&!g,ee=d.useCallback(fe=>{fe.key===" "&&$(!0)},[$]),ce=d.useCallback(fe=>{fe.key===" "&&$(!1)},[$]);rc(()=>{if(!q.current)return;q.current.checked!==re&&se(q.current.checked)},[q.current]);const J=d.useCallback((fe={},Oe=null)=>{const _e=Ne=>{X&&Ne.preventDefault(),$(!0)};return{...fe,ref:Oe,"data-active":dt(N),"data-hover":dt(V),"data-checked":dt(re),"data-focus":dt(X),"data-focus-visible":dt(X&&O),"data-indeterminate":dt(y),"data-disabled":dt(n),"data-invalid":dt(s),"data-readonly":dt(r),"aria-hidden":!0,onMouseDown:He(fe.onMouseDown,_e),onMouseUp:He(fe.onMouseUp,()=>$(!1)),onMouseEnter:He(fe.onMouseEnter,()=>U(!0)),onMouseLeave:He(fe.onMouseLeave,()=>U(!1))}},[N,re,n,X,O,V,y,s,r]),ie=d.useCallback((fe={},Oe=null)=>({...fe,ref:Oe,"data-active":dt(N),"data-hover":dt(V),"data-checked":dt(re),"data-focus":dt(X),"data-focus-visible":dt(X&&O),"data-indeterminate":dt(y),"data-disabled":dt(n),"data-invalid":dt(s),"data-readonly":dt(r)}),[N,re,n,X,O,V,y,s,r]),de=d.useCallback((fe={},Oe=null)=>({...M,...fe,ref:It(Oe,_e=>{_e&&Q(_e.tagName==="LABEL")}),onClick:He(fe.onClick,()=>{var _e;F||((_e=q.current)==null||_e.click(),requestAnimationFrame(()=>{var Ne;(Ne=q.current)==null||Ne.focus({preventScroll:!0})}))}),"data-disabled":dt(n),"data-checked":dt(re),"data-invalid":dt(s)}),[M,n,re,s,F]),ge=d.useCallback((fe={},Oe=null)=>({...fe,ref:It(q,Oe),type:"checkbox",name:b,value:w,id:i,tabIndex:S,onChange:He(fe.onChange,G),onBlur:He(fe.onBlur,D,()=>B(!1)),onFocus:He(fe.onFocus,A,()=>B(!0)),onKeyDown:He(fe.onKeyDown,ee),onKeyUp:He(fe.onKeyUp,ce),required:o,checked:re,disabled:K,readOnly:r,"aria-label":j,"aria-labelledby":_,"aria-invalid":E?!!E:s,"aria-describedby":p,"aria-disabled":n,style:hb}),[b,w,i,G,D,A,ee,ce,o,re,K,r,j,_,E,s,p,n,S]),Ce=d.useCallback((fe={},Oe=null)=>({...fe,ref:Oe,onMouseDown:He(fe.onMouseDown,EL),"data-disabled":dt(n),"data-checked":dt(re),"data-invalid":dt(s)}),[re,n,s]);return{state:{isInvalid:s,isFocused:X,isChecked:re,isActive:N,isHovered:V,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:de,getCheckboxProps:J,getIndicatorProps:ie,getInputProps:ge,getLabelProps:Ce,htmlProps:M}}function EL(e){e.preventDefault(),e.stopPropagation()}var ML={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},OL={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},RL=ma({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),DL=ma({from:{opacity:0},to:{opacity:1}}),AL=ma({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Md=je(function(t,n){const r=dL(),o={...r,...t},s=Un("Checkbox",o),i=on(t),{spacing:l="0.5rem",className:u,children:p,iconColor:m,iconSize:h,icon:g=a.jsx(hL,{}),isChecked:x,isDisabled:y=r==null?void 0:r.isDisabled,onChange:b,inputProps:w,...S}=i;let j=x;r!=null&&r.value&&i.value&&(j=r.value.includes(i.value));let _=b;r!=null&&r.onChange&&i.value&&(_=ph(r.onChange,b));const{state:E,getInputProps:I,getCheckboxProps:M,getLabelProps:R,getRootProps:D}=p5({...S,isDisabled:y,isChecked:j,onChange:_}),A=fL(E.isChecked),O=d.useMemo(()=>({animation:A?E.isIndeterminate?`${DL} 20ms linear, ${AL} 200ms linear`:`${RL} 200ms linear`:void 0,fontSize:h,color:m,...s.icon}),[m,h,A,E.isIndeterminate,s.icon]),T=d.cloneElement(g,{__css:O,isIndeterminate:E.isIndeterminate,isChecked:E.isChecked});return a.jsxs(we.label,{__css:{...OL,...s.container},className:Ye("chakra-checkbox",u),...D(),children:[a.jsx("input",{className:"chakra-checkbox__input",...I(w,n)}),a.jsx(we.span,{__css:{...ML,...s.control},className:"chakra-checkbox__control",...M(),children:T}),p&&a.jsx(we.span,{className:"chakra-checkbox__label",...R(),__css:{marginStart:l,...s.label},children:p})]})});Md.displayName="Checkbox";function TL(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function vb(e,t){let n=TL(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function I1(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function om(e,t,n){return(e-t)*100/(n-t)}function m5(e,t,n){return(n-t)*e+t}function P1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=I1(n);return vb(r,o)}function ac(e,t,n){return e==null?e:(n<t&&console.warn("clamp: max cannot be less than min"),Math.min(Math.max(e,t),n))}function NL(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:i=Number.MIN_SAFE_INTEGER,max:l=Number.MAX_SAFE_INTEGER,keepWithinRange:u=!0}=e,p=dn(t),[m,h]=d.useState(()=>{var O;return r==null?"":(O=av(r,s,n))!=null?O:""}),g=typeof o<"u",x=g?o:m,y=h5(za(x),s),b=n??y,w=d.useCallback(O=>{O!==x&&(g||h(O.toString()),p==null||p(O.toString(),za(O)))},[p,g,x]),S=d.useCallback(O=>{let T=O;return u&&(T=ac(T,i,l)),vb(T,b)},[b,u,l,i]),j=d.useCallback((O=s)=>{let T;x===""?T=za(O):T=za(x)+O,T=S(T),w(T)},[S,s,w,x]),_=d.useCallback((O=s)=>{let T;x===""?T=za(-O):T=za(x)-O,T=S(T),w(T)},[S,s,w,x]),E=d.useCallback(()=>{var O;let T;r==null?T="":T=(O=av(r,s,n))!=null?O:i,w(T)},[r,n,s,w,i]),I=d.useCallback(O=>{var T;const X=(T=av(O,s,b))!=null?T:i;w(X)},[b,s,w,i]),M=za(x);return{isOutOfRange:M>l||M<i,isAtMax:M===l,isAtMin:M===i,precision:b,value:x,valueAsNumber:M,update:w,reset:E,increment:j,decrement:_,clamp:S,cast:I,setValue:h}}function za(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function h5(e,t){return Math.max(I1(t),I1(e))}function av(e,t,n){const r=za(e);if(Number.isNaN(r))return;const o=h5(r,t);return vb(r,n??o)}var[$L,g5]=Wt({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[LL,xb]=Wt({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),v5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},jh=je(function(t,n){const{getInputProps:r}=xb(),o=g5(),s=r(t,n),i=Ye("chakra-editable__input",t.className);return a.jsx(we.input,{...s,__css:{outline:0,...v5,...o.input},className:i})});jh.displayName="EditableInput";var _h=je(function(t,n){const{getPreviewProps:r}=xb(),o=g5(),s=r(t,n),i=Ye("chakra-editable__preview",t.className);return a.jsx(we.span,{...s,__css:{cursor:"text",display:"inline-block",...v5,...o.preview},className:i})});_h.displayName="EditablePreview";function Di(e,t,n,r){const o=dn(n);return d.useEffect(()=>{const s=typeof e=="function"?e():e??document;if(!(!n||!s))return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const s=typeof e=="function"?e():e??document;s==null||s.removeEventListener(t,o,r)}}function zL(e){return"current"in e}var x5=()=>typeof window<"u";function FL(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var BL=e=>x5()&&e.test(navigator.vendor),HL=e=>x5()&&e.test(FL()),VL=()=>HL(/mac|iphone|ipad|ipod/i),WL=()=>VL()&&BL(/apple/i);function b5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,i;return(i=(s=t.current)==null?void 0:s.ownerDocument)!=null?i:document};Di(o,"pointerdown",s=>{if(!WL()||!r)return;const i=s.target,u=(n??[t]).some(p=>{const m=zL(p)?p.current:p;return(m==null?void 0:m.contains(i))||m===i});o().activeElement!==i&&u&&(s.preventDefault(),i.focus())})}function aS(e,t){return e?e===t||e.contains(t):!1}function UL(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:l,startWithEditView:u,isPreviewFocusable:p=!0,submitOnBlur:m=!0,selectAllOnFocus:h=!0,placeholder:g,onEdit:x,finalFocusRef:y,...b}=e,w=dn(x),S=!!(u&&!i),[j,_]=d.useState(S),[E,I]=_d({defaultValue:l||"",value:s,onChange:t}),[M,R]=d.useState(E),D=d.useRef(null),A=d.useRef(null),O=d.useRef(null),T=d.useRef(null),X=d.useRef(null);b5({ref:D,enabled:j,elements:[T,X]});const B=!j&&!i;rc(()=>{var J,ie;j&&((J=D.current)==null||J.focus(),h&&((ie=D.current)==null||ie.select()))},[]),pa(()=>{var J,ie,de,ge;if(!j){y?(J=y.current)==null||J.focus():(ie=O.current)==null||ie.focus();return}(de=D.current)==null||de.focus(),h&&((ge=D.current)==null||ge.select()),w==null||w()},[j,w,h]);const V=d.useCallback(()=>{B&&_(!0)},[B]),U=d.useCallback(()=>{R(E)},[E]),N=d.useCallback(()=>{_(!1),I(M),n==null||n(M),o==null||o(M)},[n,o,I,M]),$=d.useCallback(()=>{_(!1),R(E),r==null||r(E),o==null||o(M)},[E,r,o,M]);d.useEffect(()=>{if(j)return;const J=D.current;(J==null?void 0:J.ownerDocument.activeElement)===J&&(J==null||J.blur())},[j]);const q=d.useCallback(J=>{I(J.currentTarget.value)},[I]),F=d.useCallback(J=>{const ie=J.key,ge={Escape:N,Enter:Ce=>{!Ce.shiftKey&&!Ce.metaKey&&$()}}[ie];ge&&(J.preventDefault(),ge(J))},[N,$]),Q=d.useCallback(J=>{const ie=J.key,ge={Escape:N}[ie];ge&&(J.preventDefault(),ge(J))},[N]),Y=E.length===0,se=d.useCallback(J=>{var ie;if(!j)return;const de=J.currentTarget.ownerDocument,ge=(ie=J.relatedTarget)!=null?ie:de.activeElement,Ce=aS(T.current,ge),he=aS(X.current,ge);!Ce&&!he&&(m?$():N())},[m,$,N,j]),ae=d.useCallback((J={},ie=null)=>{const de=B&&p?0:void 0;return{...J,ref:It(ie,A),children:Y?g:E,hidden:j,"aria-disabled":Co(i),tabIndex:de,onFocus:He(J.onFocus,V,U)}},[i,j,B,p,Y,V,U,g,E]),re=d.useCallback((J={},ie=null)=>({...J,hidden:!j,placeholder:g,ref:It(ie,D),disabled:i,"aria-disabled":Co(i),value:E,onBlur:He(J.onBlur,se),onChange:He(J.onChange,q),onKeyDown:He(J.onKeyDown,F),onFocus:He(J.onFocus,U)}),[i,j,se,q,F,U,g,E]),G=d.useCallback((J={},ie=null)=>({...J,hidden:!j,placeholder:g,ref:It(ie,D),disabled:i,"aria-disabled":Co(i),value:E,onBlur:He(J.onBlur,se),onChange:He(J.onChange,q),onKeyDown:He(J.onKeyDown,Q),onFocus:He(J.onFocus,U)}),[i,j,se,q,Q,U,g,E]),K=d.useCallback((J={},ie=null)=>({"aria-label":"Edit",...J,type:"button",onClick:He(J.onClick,V),ref:It(ie,O),disabled:i}),[V,i]),ee=d.useCallback((J={},ie=null)=>({...J,"aria-label":"Submit",ref:It(X,ie),type:"button",onClick:He(J.onClick,$),disabled:i}),[$,i]),ce=d.useCallback((J={},ie=null)=>({"aria-label":"Cancel",id:"cancel",...J,ref:It(T,ie),type:"button",onClick:He(J.onClick,N),disabled:i}),[N,i]);return{isEditing:j,isDisabled:i,isValueEmpty:Y,value:E,onEdit:V,onCancel:N,onSubmit:$,getPreviewProps:ae,getInputProps:re,getTextareaProps:G,getEditButtonProps:K,getSubmitButtonProps:ee,getCancelButtonProps:ce,htmlProps:b}}var Ih=je(function(t,n){const r=Un("Editable",t),o=on(t),{htmlProps:s,...i}=UL(o),{isEditing:l,onSubmit:u,onCancel:p,onEdit:m}=i,h=Ye("chakra-editable",t.className),g=zx(t.children,{isEditing:l,onSubmit:u,onCancel:p,onEdit:m});return a.jsx(LL,{value:i,children:a.jsx($L,{value:r,children:a.jsx(we.div,{ref:n,...s,className:h,children:g})})})});Ih.displayName="Editable";function y5(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=xb();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var C5={exports:{}},GL="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",KL=GL,qL=KL;function w5(){}function S5(){}S5.resetWarningCache=w5;var XL=function(){function e(r,o,s,i,l,u){if(u!==qL){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:S5,resetWarningCache:w5};return n.PropTypes=n,n};C5.exports=XL();var QL=C5.exports;const Jt=xd(QL);var E1="data-focus-lock",k5="data-focus-lock-disabled",YL="data-no-focus-lock",ZL="data-autofocus-inside",JL="data-no-autofocus";function ez(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tz(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function j5(e,t){return tz(t||null,function(n){return e.forEach(function(r){return ez(r,n)})})}var iv={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},gs=function(){return gs=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},gs.apply(this,arguments)};function _5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Tc(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function l(m){try{p(r.next(m))}catch(h){i(h)}}function u(m){try{p(r.throw(m))}catch(h){i(h)}}function p(m){m.done?s(m.value):o(m.value).then(l,u)}p((r=r.apply(e,t||[])).next())})}function Nc(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(p){return function(m){return u([p,m])}}function u(p){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,p[0]&&(n=0)),n;)try{if(r=1,o&&(s=p[0]&2?o.return:p[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,p[1])).done)return s;switch(o=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){n.label=p[1];break}if(p[0]===6&&n.label<s[1]){n.label=s[1],s=p;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(p);break}s[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(m){p=[6,m],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function iS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(l){i={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function M1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function I5(e){return e}function P5(e,t){t===void 0&&(t=I5);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var u=function(){var m=i;i=[],m.forEach(s)},p=function(){return Promise.resolve().then(u)};p(),n={push:function(m){i.push(m),p()},filter:function(m){return i=i.filter(m),n}}}};return o}function bb(e,t){return t===void 0&&(t=I5),P5(e,t)}function E5(e){e===void 0&&(e={});var t=P5(null);return t.options=gs({async:!0,ssr:!1},e),t}var M5=function(e){var t=e.sideCar,n=_5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return d.createElement(r,gs({},n))};M5.isSideCarExport=!0;function nz(e,t){return e.useMedium(t),M5}var O5=bb({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),R5=bb(),rz=bb(),oz=E5({async:!0}),sz=[],yb=d.forwardRef(function(t,n){var r,o=d.useState(),s=o[0],i=o[1],l=d.useRef(),u=d.useRef(!1),p=d.useRef(null),m=t.children,h=t.disabled,g=t.noFocusGuards,x=t.persistentFocus,y=t.crossFrame,b=t.autoFocus;t.allowTextSelection;var w=t.group,S=t.className,j=t.whiteList,_=t.hasPositiveIndices,E=t.shards,I=E===void 0?sz:E,M=t.as,R=M===void 0?"div":M,D=t.lockProps,A=D===void 0?{}:D,O=t.sideCar,T=t.returnFocus,X=t.focusOptions,B=t.onActivation,V=t.onDeactivation,U=d.useState({}),N=U[0],$=d.useCallback(function(){p.current=p.current||document&&document.activeElement,l.current&&B&&B(l.current),u.current=!0},[B]),q=d.useCallback(function(){u.current=!1,V&&V(l.current)},[V]);d.useEffect(function(){h||(p.current=null)},[]);var F=d.useCallback(function(ee){var ce=p.current;if(ce&&ce.focus){var J=typeof T=="function"?T(ce):T;if(J){var ie=typeof J=="object"?J:void 0;p.current=null,ee?Promise.resolve().then(function(){return ce.focus(ie)}):ce.focus(ie)}}},[T]),Q=d.useCallback(function(ee){u.current&&O5.useMedium(ee)},[]),Y=R5.useMedium,se=d.useCallback(function(ee){l.current!==ee&&(l.current=ee,i(ee))},[]),ae=mn((r={},r[k5]=h&&"disabled",r[E1]=w,r),A),re=g!==!0,G=re&&g!=="tail",K=j5([n,se]);return d.createElement(d.Fragment,null,re&&[d.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:iv}),_?d.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:iv}):null],!h&&d.createElement(O,{id:N,sideCar:oz,observed:s,disabled:h,persistentFocus:x,crossFrame:y,autoFocus:b,whiteList:j,shards:I,onActivation:$,onDeactivation:q,returnFocus:F,focusOptions:X}),d.createElement(R,mn({ref:K},ae,{className:S,onBlur:Y,onFocus:Q}),m),G&&d.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:iv}))});yb.propTypes={};yb.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const D5=yb;function O1(e,t){return O1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},O1(e,t)}function az(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,O1(e,t)}function iz(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],i;function l(){i=e(s.map(function(p){return p.props})),t(i)}var u=function(p){az(m,p);function m(){return p.apply(this,arguments)||this}m.peek=function(){return i};var h=m.prototype;return h.componentDidMount=function(){s.push(this),l()},h.componentDidUpdate=function(){l()},h.componentWillUnmount=function(){var x=s.indexOf(this);s.splice(x,1),l()},h.render=function(){return H.createElement(o,this.props)},m}(d.PureComponent);return LR(u,"displayName","SideEffect("+n(o)+")"),u}}var Rs=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},sm=function(e){return Array.isArray(e)?e:[e]},A5=function(e){return Array.isArray(e)?e[0]:e},lz=function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!t||!t.getPropertyValue?!1:t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"},T5=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},N5=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},cz=function(e,t){return!e||N5(e)||!lz(e)&&t(T5(e))},$5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=cz(t,$5.bind(void 0,e));return e.set(t,r),r},uz=function(e,t){return e&&!N5(e)?pz(e)?t(T5(e)):!1:!0},L5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=uz(t,L5.bind(void 0,e));return e.set(t,r),r},z5=function(e){return e.dataset},dz=function(e){return e.tagName==="BUTTON"},F5=function(e){return e.tagName==="INPUT"},B5=function(e){return F5(e)&&e.type==="radio"},fz=function(e){return!((F5(e)||dz(e))&&(e.type==="hidden"||e.disabled))},pz=function(e){var t=e.getAttribute(JL);return![!0,"true",""].includes(t)},Cb=function(e){var t;return!!(e&&(!((t=z5(e))===null||t===void 0)&&t.focusGuard))},am=function(e){return!Cb(e)},mz=function(e){return!!e},hz=function(e,t){var n=e.tabIndex-t.tabIndex,r=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||r},H5=function(e,t,n){return Rs(e).map(function(r,o){return{node:r,index:o,tabIndex:n&&r.tabIndex===-1?(r.dataset||{}).focusGuard?0:-1:r.tabIndex}}).filter(function(r){return!t||r.tabIndex>=0}).sort(hz)},gz=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],wb=gz.join(","),vz="".concat(wb,", [data-focus-guard]"),V5=function(e,t){return Rs((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?vz:wb)?[r]:[],V5(r))},[])},xz=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?Ph([e.contentDocument.body],t):[e]},Ph=function(e,t){return e.reduce(function(n,r){var o,s=V5(r,t),i=(o=[]).concat.apply(o,s.map(function(l){return xz(l,t)}));return n.concat(i,r.parentNode?Rs(r.parentNode.querySelectorAll(wb)).filter(function(l){return l===r}):[])},[])},bz=function(e){var t=e.querySelectorAll("[".concat(ZL,"]"));return Rs(t).map(function(n){return Ph([n])}).reduce(function(n,r){return n.concat(r)},[])},Sb=function(e,t){return Rs(e).filter(function(n){return $5(t,n)}).filter(function(n){return fz(n)})},lS=function(e,t){return t===void 0&&(t=new Map),Rs(e).filter(function(n){return L5(t,n)})},R1=function(e,t,n){return H5(Sb(Ph(e,n),t),!0,n)},cS=function(e,t){return H5(Sb(Ph(e),t),!1)},yz=function(e,t){return Sb(bz(e),t)},ic=function(e,t){return e.shadowRoot?ic(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Rs(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?ic(o,t):!1}return ic(n,t)})},Cz=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(i,l){return!t.has(l)})},W5=function(e){return e.parentNode?W5(e.parentNode):e},kb=function(e){var t=sm(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(E1);return n.push.apply(n,o?Cz(Rs(W5(r).querySelectorAll("[".concat(E1,'="').concat(o,'"]:not([').concat(k5,'="disabled"])')))):[r]),n},[])},wz=function(e){try{return e()}catch{return}},Qu=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Qu(t.shadowRoot):t instanceof HTMLIFrameElement&&wz(function(){return t.contentWindow.document})?Qu(t.contentWindow.document):t}},Sz=function(e,t){return e===t},kz=function(e,t){return!!Rs(e.querySelectorAll("iframe")).some(function(n){return Sz(n,t)})},U5=function(e,t){return t===void 0&&(t=Qu(A5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:kb(e).some(function(n){return ic(n,t)||kz(n,t)})},jz=function(e){e===void 0&&(e=document);var t=Qu(e);return t?Rs(e.querySelectorAll("[".concat(YL,"]"))).some(function(n){return ic(n,t)}):!1},_z=function(e,t){return t.filter(B5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},jb=function(e,t){return B5(e)&&e.name?_z(e,t):e},Iz=function(e){var t=new Set;return e.forEach(function(n){return t.add(jb(n,e))}),e.filter(function(n){return t.has(n)})},uS=function(e){return e[0]&&e.length>1?jb(e[0],e):e[0]},dS=function(e,t){return e.length>1?e.indexOf(jb(e[t],e)):t},G5="NEW_FOCUS",Pz=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],l=Cb(n);if(!(n&&e.indexOf(n)>=0)){var u=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):u,m=r?e.indexOf(r):-1,h=u-p,g=t.indexOf(s),x=t.indexOf(i),y=Iz(t),b=n!==void 0?y.indexOf(n):-1,w=b-(r?y.indexOf(r):u),S=dS(e,0),j=dS(e,o-1);if(u===-1||m===-1)return G5;if(!h&&m>=0)return m;if(u<=g&&l&&Math.abs(h)>1)return j;if(u>=x&&l&&Math.abs(h)>1)return S;if(h&&Math.abs(w)>1)return m;if(u<=g)return j;if(u>x)return S;if(h)return Math.abs(h)>1?m:(o+m+h)%o}},Ez=function(e){return function(t){var n,r=(n=z5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},Mz=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=lS(r.filter(Ez(n)));return o&&o.length?uS(o):uS(lS(t))},D1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&D1(e.parentNode.host||e.parentNode,t),t},lv=function(e,t){for(var n=D1(e),r=D1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},K5=function(e,t,n){var r=sm(e),o=sm(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(l){i=lv(i||l,l)||i,n.filter(Boolean).forEach(function(u){var p=lv(s,u);p&&(!i||ic(p,i)?i=p:i=lv(p,i))})}),i},Oz=function(e,t){return e.reduce(function(n,r){return n.concat(yz(r,t))},[])},Rz=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(mz)},Dz=function(e,t){var n=Qu(sm(e).length>0?document:A5(e).ownerDocument),r=kb(e).filter(am),o=K5(n||e,e,r),s=new Map,i=cS(r,s),l=R1(r,s).filter(function(x){var y=x.node;return am(y)});if(!(!l[0]&&(l=i,!l[0]))){var u=cS([o],s).map(function(x){var y=x.node;return y}),p=Rz(u,l),m=p.map(function(x){var y=x.node;return y}),h=Pz(m,u,n,t);if(h===G5){var g=Mz(i,m,Oz(r,s));if(g)return{node:g};console.warn("focus-lock: cannot find any node to move focus into");return}return h===void 0?h:p[h]}},Az=function(e){var t=kb(e).filter(am),n=K5(e,e,t),r=new Map,o=R1([n],r,!0),s=R1(t,r).filter(function(i){var l=i.node;return am(l)}).map(function(i){var l=i.node;return l});return o.map(function(i){var l=i.node,u=i.index;return{node:l,index:u,lockItem:s.indexOf(l)>=0,guard:Cb(l)}})},Tz=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},cv=0,uv=!1,q5=function(e,t,n){n===void 0&&(n={});var r=Dz(e,t);if(!uv&&r){if(cv>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),uv=!0,setTimeout(function(){uv=!1},1);return}cv++,Tz(r.node,n.focusOptions),cv--}};function _b(e){setTimeout(e,1)}var Nz=function(){return document&&document.activeElement===document.body},$z=function(){return Nz()||jz()},lc=null,Zl=null,cc=null,Yu=!1,Lz=function(){return!0},zz=function(t){return(lc.whiteList||Lz)(t)},Fz=function(t,n){cc={observerNode:t,portaledElement:n}},Bz=function(t){return cc&&cc.portaledElement===t};function fS(e,t,n,r){var o=null,s=e;do{var i=r[s];if(i.guard)i.node.dataset.focusAutoGuard&&(o=i);else if(i.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var Hz=function(t){return t&&"current"in t?t.current:t},Vz=function(t){return t?!!Yu:Yu==="meanwhile"},Wz=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},Uz=function(t,n){return n.some(function(r){return Wz(t,r,r)})},im=function(){var t=!1;if(lc){var n=lc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,l=n.crossFrame,u=n.focusOptions,p=r||cc&&cc.portaledElement,m=document&&document.activeElement;if(p){var h=[p].concat(i.map(Hz).filter(Boolean));if((!m||zz(m))&&(o||Vz(l)||!$z()||!Zl&&s)&&(p&&!(U5(h)||m&&Uz(m,h)||Bz(m))&&(document&&!Zl&&m&&!s?(m.blur&&m.blur(),document.body.focus()):(t=q5(h,Zl,{focusOptions:u}),cc={})),Yu=!1,Zl=document&&document.activeElement),document){var g=document&&document.activeElement,x=Az(h),y=x.map(function(b){var w=b.node;return w}).indexOf(g);y>-1&&(x.filter(function(b){var w=b.guard,S=b.node;return w&&S.dataset.focusAutoGuard}).forEach(function(b){var w=b.node;return w.removeAttribute("tabIndex")}),fS(y,x.length,1,x),fS(y,-1,-1,x))}}}return t},X5=function(t){im()&&t&&(t.stopPropagation(),t.preventDefault())},Ib=function(){return _b(im)},Gz=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Fz(r,n)},Kz=function(){return null},Q5=function(){Yu="just",_b(function(){Yu="meanwhile"})},qz=function(){document.addEventListener("focusin",X5),document.addEventListener("focusout",Ib),window.addEventListener("blur",Q5)},Xz=function(){document.removeEventListener("focusin",X5),document.removeEventListener("focusout",Ib),window.removeEventListener("blur",Q5)};function Qz(e){return e.filter(function(t){var n=t.disabled;return!n})}function Yz(e){var t=e.slice(-1)[0];t&&!lc&&qz();var n=lc,r=n&&t&&t.id===n.id;lc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Zl=null,(!r||n.observed!==t.observed)&&t.onActivation(),im(),_b(im)):(Xz(),Zl=null)}O5.assignSyncMedium(Gz);R5.assignMedium(Ib);rz.assignMedium(function(e){return e({moveFocusInside:q5,focusInside:U5})});const Zz=iz(Qz,Yz)(Kz);var Y5=d.forwardRef(function(t,n){return d.createElement(D5,mn({sideCar:Zz,ref:n},t))}),Z5=D5.propTypes||{};Z5.sideCar;o$(Z5,["sideCar"]);Y5.propTypes={};const pS=Y5;function J5(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Pb(e){var t;if(!J5(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function Jz(e){var t,n;return(n=(t=e3(e))==null?void 0:t.defaultView)!=null?n:window}function e3(e){return J5(e)?e.ownerDocument:document}function eF(e){return e3(e).activeElement}function tF(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function nF(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function t3(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Pb(e)&&tF(e)?e:t3(nF(e))}var n3=e=>e.hasAttribute("tabindex"),rF=e=>n3(e)&&e.tabIndex===-1;function oF(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function r3(e){return e.parentElement&&r3(e.parentElement)?!0:e.hidden}function sF(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function o3(e){if(!Pb(e)||r3(e)||oF(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():sF(e)?!0:n3(e)}function aF(e){return e?Pb(e)&&o3(e)&&!rF(e):!1}var iF=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],lF=iF.join(),cF=e=>e.offsetWidth>0&&e.offsetHeight>0;function s3(e){const t=Array.from(e.querySelectorAll(lF));return t.unshift(e),t.filter(n=>o3(n)&&cF(n))}var mS,uF=(mS=pS.default)!=null?mS:pS,a3=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:l,persistentFocus:u,lockFocusAcrossFrames:p}=e,m=d.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&s3(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),h=d.useCallback(()=>{var x;(x=n==null?void 0:n.current)==null||x.focus()},[n]),g=o&&!n;return a.jsx(uF,{crossFrame:p,persistentFocus:u,autoFocus:l,disabled:i,onActivation:m,onDeactivation:h,returnFocus:g,children:s})};a3.displayName="FocusLock";var dF=S$?d.useLayoutEffect:d.useEffect;function A1(e,t=[]){const n=d.useRef(e);return dF(()=>{n.current=e}),d.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function fF(e,t,n,r){const o=A1(t);return d.useEffect(()=>{var s;const i=(s=ew(n))!=null?s:document;if(t)return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=ew(n))!=null?s:document).removeEventListener(e,o,r)}}function pF(e,t){const n=d.useId();return d.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function mF(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Lr(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=A1(n),i=A1(t),[l,u]=d.useState(e.defaultIsOpen||!1),[p,m]=mF(r,l),h=pF(o,"disclosure"),g=d.useCallback(()=>{p||u(!1),i==null||i()},[p,i]),x=d.useCallback(()=>{p||u(!0),s==null||s()},[p,s]),y=d.useCallback(()=>{(m?g:x)()},[m,x,g]);return{isOpen:!!m,onOpen:x,onClose:g,onToggle:y,isControlled:p,getButtonProps:(b={})=>({...b,"aria-expanded":m,"aria-controls":h,onClick:zR(b.onClick,y)}),getDisclosureProps:(b={})=>({...b,hidden:!m,id:h})}}var[hF,gF]=Wt({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),i3=je(function(t,n){const r=Un("Input",t),{children:o,className:s,...i}=on(t),l=Ye("chakra-input__group",s),u={},p=kh(o),m=r.field;p.forEach(g=>{var x,y;r&&(m&&g.type.id==="InputLeftElement"&&(u.paddingStart=(x=m.height)!=null?x:m.h),m&&g.type.id==="InputRightElement"&&(u.paddingEnd=(y=m.height)!=null?y:m.h),g.type.id==="InputRightAddon"&&(u.borderEndRadius=0),g.type.id==="InputLeftAddon"&&(u.borderStartRadius=0))});const h=p.map(g=>{var x,y;const b=J_({size:((x=g.props)==null?void 0:x.size)||t.size,variant:((y=g.props)==null?void 0:y.variant)||t.variant});return g.type.id!=="Input"?d.cloneElement(g,b):d.cloneElement(g,Object.assign(b,u,g.props))});return a.jsx(we.div,{className:l,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...i,children:a.jsx(hF,{value:r,children:h})})});i3.displayName="InputGroup";var vF=we("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),Eh=je(function(t,n){var r,o;const{placement:s="left",...i}=t,l=gF(),u=l.field,m={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=u==null?void 0:u.height)!=null?r:u==null?void 0:u.h,height:(o=u==null?void 0:u.height)!=null?o:u==null?void 0:u.h,fontSize:u==null?void 0:u.fontSize,...l.element};return a.jsx(vF,{ref:n,__css:m,...i})});Eh.id="InputElement";Eh.displayName="InputElement";var l3=je(function(t,n){const{className:r,...o}=t,s=Ye("chakra-input__left-element",r);return a.jsx(Eh,{ref:n,placement:"left",className:s,...o})});l3.id="InputLeftElement";l3.displayName="InputLeftElement";var Eb=je(function(t,n){const{className:r,...o}=t,s=Ye("chakra-input__right-element",r);return a.jsx(Eh,{ref:n,placement:"right",className:s,...o})});Eb.id="InputRightElement";Eb.displayName="InputRightElement";var Mh=je(function(t,n){const{htmlSize:r,...o}=t,s=Un("Input",o),i=on(o),l=pb(i),u=Ye("chakra-input",t.className);return a.jsx(we.input,{size:r,...l,__css:s.field,ref:n,className:u})});Mh.displayName="Input";Mh.id="Input";var Oh=je(function(t,n){const r=oi("Link",t),{className:o,isExternal:s,...i}=on(t);return a.jsx(we.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Ye("chakra-link",o),...i,__css:r})});Oh.displayName="Link";var[xF,c3]=Wt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),Mb=je(function(t,n){const r=Un("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:l,...u}=on(t),p=kh(o),h=l?{["& > *:not(style) ~ *:not(style)"]:{mt:l}}:{};return a.jsx(xF,{value:r,children:a.jsx(we.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...h},...u,children:p})})});Mb.displayName="List";var u3=je((e,t)=>{const{as:n,...r}=e;return a.jsx(Mb,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});u3.displayName="OrderedList";var Od=je(function(t,n){const{as:r,...o}=t;return a.jsx(Mb,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Od.displayName="UnorderedList";var Qr=je(function(t,n){const r=c3();return a.jsx(we.li,{ref:n,...t,__css:r.item})});Qr.displayName="ListItem";var bF=je(function(t,n){const r=c3();return a.jsx(Nn,{ref:n,role:"presentation",...t,__css:r.icon})});bF.displayName="ListIcon";var Ja=je(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:l,row:u,autoFlow:p,autoRows:m,templateRows:h,autoColumns:g,templateColumns:x,...y}=t,b={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:i,gridAutoColumns:g,gridColumn:l,gridRow:u,gridAutoFlow:p,gridAutoRows:m,gridTemplateRows:h,gridTemplateColumns:x};return a.jsx(we.div,{ref:n,__css:b,...y})});Ja.displayName="Grid";function d3(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):a1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var ba=we("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});ba.displayName="Spacer";var f3=e=>a.jsx(we.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});f3.displayName="StackItem";function yF(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":d3(n,o=>r[o])}}var Ob=je((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:i="0.5rem",wrap:l,children:u,divider:p,className:m,shouldWrapChildren:h,...g}=e,x=n?"row":r??"column",y=d.useMemo(()=>yF({spacing:i,direction:x}),[i,x]),b=!!p,w=!h&&!b,S=d.useMemo(()=>{const _=kh(u);return w?_:_.map((E,I)=>{const M=typeof E.key<"u"?E.key:I,R=I+1===_.length,A=h?a.jsx(f3,{children:E},M):E;if(!b)return A;const O=d.cloneElement(p,{__css:y}),T=R?null:O;return a.jsxs(d.Fragment,{children:[A,T]},M)})},[p,y,b,w,h,u]),j=Ye("chakra-stack",m);return a.jsx(we.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:x,flexWrap:l,gap:b?void 0:i,className:j,...g,children:S})});Ob.displayName="Stack";var p3=je((e,t)=>a.jsx(Ob,{align:"center",...e,direction:"column",ref:t}));p3.displayName="VStack";var Rh=je((e,t)=>a.jsx(Ob,{align:"center",...e,direction:"row",ref:t}));Rh.displayName="HStack";function hS(e){return d3(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Zu=je(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:i,rowEnd:l,rowSpan:u,rowStart:p,...m}=t,h=J_({gridArea:r,gridColumn:hS(o),gridRow:hS(u),gridColumnStart:s,gridColumnEnd:i,gridRowStart:p,gridRowEnd:l});return a.jsx(we.div,{ref:n,__css:h,...m})});Zu.displayName="GridItem";var Ds=je(function(t,n){const r=oi("Badge",t),{className:o,...s}=on(t);return a.jsx(we.span,{ref:n,className:Ye("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Ds.displayName="Badge";var Yn=je(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:l,borderStyle:u,borderColor:p,...m}=oi("Divider",t),{className:h,orientation:g="horizontal",__css:x,...y}=on(t),b={vertical:{borderLeftWidth:r||i||l||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||l||"1px",width:"100%"}};return a.jsx(we.hr,{ref:n,"aria-orientation":g,...y,__css:{...m,border:"0",borderColor:p,borderStyle:u,...b[g],...x},className:Ye("chakra-divider",h)})});Yn.displayName="Divider";function CF(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function wF(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=d.useState([]),s=d.useRef(),i=()=>{s.current&&(clearTimeout(s.current),s.current=null)},l=()=>{i(),s.current=setTimeout(()=>{o([]),s.current=null},t)};d.useEffect(()=>i,[]);function u(p){return m=>{if(m.key==="Backspace"){const h=[...r];h.pop(),o(h);return}if(CF(m)){const h=r.concat(m.key);n(m)&&(m.preventDefault(),m.stopPropagation()),o(h),p(h.join("")),l()}}}return u}function SF(e,t,n,r){if(t==null)return r;if(!r)return e.find(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function kF(){const e=d.useRef(new Map),t=e.current,n=d.useCallback((o,s,i,l)=>{e.current.set(i,{type:s,el:o,options:l}),o.addEventListener(s,i,l)},[]),r=d.useCallback((o,s,i,l)=>{o.removeEventListener(s,i,l),e.current.delete(i)},[]);return d.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function dv(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function m3(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:l,onClick:u,onKeyDown:p,onKeyUp:m,tabIndex:h,onMouseOver:g,onMouseLeave:x,...y}=e,[b,w]=d.useState(!0),[S,j]=d.useState(!1),_=kF(),E=$=>{$&&$.tagName!=="BUTTON"&&w(!1)},I=b?h:h||0,M=n&&!r,R=d.useCallback($=>{if(n){$.stopPropagation(),$.preventDefault();return}$.currentTarget.focus(),u==null||u($)},[n,u]),D=d.useCallback($=>{S&&dv($)&&($.preventDefault(),$.stopPropagation(),j(!1),_.remove(document,"keyup",D,!1))},[S,_]),A=d.useCallback($=>{if(p==null||p($),n||$.defaultPrevented||$.metaKey||!dv($.nativeEvent)||b)return;const q=o&&$.key==="Enter";s&&$.key===" "&&($.preventDefault(),j(!0)),q&&($.preventDefault(),$.currentTarget.click()),_.add(document,"keyup",D,!1)},[n,b,p,o,s,_,D]),O=d.useCallback($=>{if(m==null||m($),n||$.defaultPrevented||$.metaKey||!dv($.nativeEvent)||b)return;s&&$.key===" "&&($.preventDefault(),j(!1),$.currentTarget.click())},[s,b,n,m]),T=d.useCallback($=>{$.button===0&&(j(!1),_.remove(document,"mouseup",T,!1))},[_]),X=d.useCallback($=>{if($.button!==0)return;if(n){$.stopPropagation(),$.preventDefault();return}b||j(!0),$.currentTarget.focus({preventScroll:!0}),_.add(document,"mouseup",T,!1),i==null||i($)},[n,b,i,_,T]),B=d.useCallback($=>{$.button===0&&(b||j(!1),l==null||l($))},[l,b]),V=d.useCallback($=>{if(n){$.preventDefault();return}g==null||g($)},[n,g]),U=d.useCallback($=>{S&&($.preventDefault(),j(!1)),x==null||x($)},[S,x]),N=It(t,E);return b?{...y,ref:N,type:"button","aria-disabled":M?void 0:n,disabled:M,onClick:R,onMouseDown:i,onMouseUp:l,onKeyUp:m,onKeyDown:p,onMouseOver:g,onMouseLeave:x}:{...y,ref:N,role:"button","data-active":dt(S),"aria-disabled":n?"true":void 0,tabIndex:M?void 0:I,onClick:R,onMouseDown:X,onMouseUp:B,onKeyUp:O,onKeyDown:A,onMouseOver:V,onMouseLeave:U}}function jF(e){const t=e.current;if(!t)return!1;const n=eF(t);return!n||t.contains(n)?!1:!!aF(n)}function h3(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;pa(()=>{if(!s||jF(e))return;const i=(o==null?void 0:o.current)||e.current;let l;if(i)return l=requestAnimationFrame(()=>{i.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(l)}},[s,e,o])}var _F={preventScroll:!0,shouldFocus:!1};function IF(e,t=_F){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=PF(e)?e.current:e,l=o&&s,u=d.useRef(l),p=d.useRef(s);rc(()=>{!p.current&&s&&(u.current=l),p.current=s},[s,l]);const m=d.useCallback(()=>{if(!(!s||!i||!u.current)&&(u.current=!1,!i.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=s3(i);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[s,r,i,n]);pa(()=>{m()},[m]),Di(i,"transitionend",m)}function PF(e){return"current"in e}var Rl=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),$n={arrowShadowColor:Rl("--popper-arrow-shadow-color"),arrowSize:Rl("--popper-arrow-size","8px"),arrowSizeHalf:Rl("--popper-arrow-size-half"),arrowBg:Rl("--popper-arrow-bg"),transformOrigin:Rl("--popper-transform-origin"),arrowOffset:Rl("--popper-arrow-offset")};function EF(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var MF={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},OF=e=>MF[e],gS={scroll:!0,resize:!0};function RF(e){let t;return typeof e=="object"?t={enabled:!0,options:{...gS,...e}}:t={enabled:e,options:gS},t}var DF={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},AF={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{vS(e)},effect:({state:e})=>()=>{vS(e)}},vS=e=>{e.elements.popper.style.setProperty($n.transformOrigin.var,OF(e.placement))},TF={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{NF(e)}},NF=e=>{var t;if(!e.placement)return;const n=$F(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:$n.arrowSize.varRef,height:$n.arrowSize.varRef,zIndex:-1});const r={[$n.arrowSizeHalf.var]:`calc(${$n.arrowSize.varRef} / 2 - 1px)`,[$n.arrowOffset.var]:`calc(${$n.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},$F=e=>{if(e.startsWith("top"))return{property:"bottom",value:$n.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:$n.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:$n.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:$n.arrowOffset.varRef}},LF={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{xS(e)},effect:({state:e})=>()=>{xS(e)}},xS=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=EF(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:$n.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},zF={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},FF={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function BF(e,t="ltr"){var n,r;const o=((n=zF[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=FF[e])!=null?r:o}var Dr="top",ko="bottom",jo="right",Ar="left",Rb="auto",Rd=[Dr,ko,jo,Ar],xc="start",Ju="end",HF="clippingParents",g3="viewport",Cu="popper",VF="reference",bS=Rd.reduce(function(e,t){return e.concat([t+"-"+xc,t+"-"+Ju])},[]),v3=[].concat(Rd,[Rb]).reduce(function(e,t){return e.concat([t,t+"-"+xc,t+"-"+Ju])},[]),WF="beforeRead",UF="read",GF="afterRead",KF="beforeMain",qF="main",XF="afterMain",QF="beforeWrite",YF="write",ZF="afterWrite",JF=[WF,UF,GF,KF,qF,XF,QF,YF,ZF];function ws(e){return e?(e.nodeName||"").toLowerCase():null}function no(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ui(e){var t=no(e).Element;return e instanceof t||e instanceof Element}function wo(e){var t=no(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Db(e){if(typeof ShadowRoot>"u")return!1;var t=no(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function eB(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!wo(s)||!ws(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function tB(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(u,p){return u[p]="",u},{});!wo(o)||!ws(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const nB={name:"applyStyles",enabled:!0,phase:"write",fn:eB,effect:tB,requires:["computeStyles"]};function Cs(e){return e.split("-")[0]}var Ai=Math.max,lm=Math.min,bc=Math.round;function T1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function x3(){return!/^((?!chrome|android).)*safari/i.test(T1())}function yc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&wo(e)&&(o=e.offsetWidth>0&&bc(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&bc(r.height)/e.offsetHeight||1);var i=Ui(e)?no(e):window,l=i.visualViewport,u=!x3()&&n,p=(r.left+(u&&l?l.offsetLeft:0))/o,m=(r.top+(u&&l?l.offsetTop:0))/s,h=r.width/o,g=r.height/s;return{width:h,height:g,top:m,right:p+h,bottom:m+g,left:p,x:p,y:m}}function Ab(e){var t=yc(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Db(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function aa(e){return no(e).getComputedStyle(e)}function rB(e){return["table","td","th"].indexOf(ws(e))>=0}function ai(e){return((Ui(e)?e.ownerDocument:e.document)||window.document).documentElement}function Dh(e){return ws(e)==="html"?e:e.assignedSlot||e.parentNode||(Db(e)?e.host:null)||ai(e)}function yS(e){return!wo(e)||aa(e).position==="fixed"?null:e.offsetParent}function oB(e){var t=/firefox/i.test(T1()),n=/Trident/i.test(T1());if(n&&wo(e)){var r=aa(e);if(r.position==="fixed")return null}var o=Dh(e);for(Db(o)&&(o=o.host);wo(o)&&["html","body"].indexOf(ws(o))<0;){var s=aa(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Dd(e){for(var t=no(e),n=yS(e);n&&rB(n)&&aa(n).position==="static";)n=yS(n);return n&&(ws(n)==="html"||ws(n)==="body"&&aa(n).position==="static")?t:n||oB(e)||t}function Tb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Fu(e,t,n){return Ai(e,lm(t,n))}function sB(e,t,n){var r=Fu(e,t,n);return r>n?n:r}function y3(){return{top:0,right:0,bottom:0,left:0}}function C3(e){return Object.assign({},y3(),e)}function w3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var aB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,C3(typeof t!="number"?t:w3(t,Rd))};function iB(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=Cs(n.placement),u=Tb(l),p=[Ar,jo].indexOf(l)>=0,m=p?"height":"width";if(!(!s||!i)){var h=aB(o.padding,n),g=Ab(s),x=u==="y"?Dr:Ar,y=u==="y"?ko:jo,b=n.rects.reference[m]+n.rects.reference[u]-i[u]-n.rects.popper[m],w=i[u]-n.rects.reference[u],S=Dd(s),j=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,_=b/2-w/2,E=h[x],I=j-g[m]-h[y],M=j/2-g[m]/2+_,R=Fu(E,M,I),D=u;n.modifiersData[r]=(t={},t[D]=R,t.centerOffset=R-M,t)}}function lB(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||b3(t.elements.popper,o)&&(t.elements.arrow=o))}const cB={name:"arrow",enabled:!0,phase:"main",fn:iB,effect:lB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Cc(e){return e.split("-")[1]}var uB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dB(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bc(n*o)/o||0,y:bc(r*o)/o||0}}function CS(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,l=e.position,u=e.gpuAcceleration,p=e.adaptive,m=e.roundOffsets,h=e.isFixed,g=i.x,x=g===void 0?0:g,y=i.y,b=y===void 0?0:y,w=typeof m=="function"?m({x,y:b}):{x,y:b};x=w.x,b=w.y;var S=i.hasOwnProperty("x"),j=i.hasOwnProperty("y"),_=Ar,E=Dr,I=window;if(p){var M=Dd(n),R="clientHeight",D="clientWidth";if(M===no(n)&&(M=ai(n),aa(M).position!=="static"&&l==="absolute"&&(R="scrollHeight",D="scrollWidth")),M=M,o===Dr||(o===Ar||o===jo)&&s===Ju){E=ko;var A=h&&M===I&&I.visualViewport?I.visualViewport.height:M[R];b-=A-r.height,b*=u?1:-1}if(o===Ar||(o===Dr||o===ko)&&s===Ju){_=jo;var O=h&&M===I&&I.visualViewport?I.visualViewport.width:M[D];x-=O-r.width,x*=u?1:-1}}var T=Object.assign({position:l},p&&uB),X=m===!0?dB({x,y:b},no(n)):{x,y:b};if(x=X.x,b=X.y,u){var B;return Object.assign({},T,(B={},B[E]=j?"0":"",B[_]=S?"0":"",B.transform=(I.devicePixelRatio||1)<=1?"translate("+x+"px, "+b+"px)":"translate3d("+x+"px, "+b+"px, 0)",B))}return Object.assign({},T,(t={},t[E]=j?b+"px":"",t[_]=S?x+"px":"",t.transform="",t))}function fB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,p={placement:Cs(t.placement),variation:Cc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,CS(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,CS(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const pB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fB,data:{}};var Jf={passive:!0};function mB(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,u=no(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(m){m.addEventListener("scroll",n.update,Jf)}),l&&u.addEventListener("resize",n.update,Jf),function(){s&&p.forEach(function(m){m.removeEventListener("scroll",n.update,Jf)}),l&&u.removeEventListener("resize",n.update,Jf)}}const hB={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:mB,data:{}};var gB={left:"right",right:"left",bottom:"top",top:"bottom"};function Np(e){return e.replace(/left|right|bottom|top/g,function(t){return gB[t]})}var vB={start:"end",end:"start"};function wS(e){return e.replace(/start|end/g,function(t){return vB[t]})}function Nb(e){var t=no(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function $b(e){return yc(ai(e)).left+Nb(e).scrollLeft}function xB(e,t){var n=no(e),r=ai(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;var p=x3();(p||!p&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:l+$b(e),y:u}}function bB(e){var t,n=ai(e),r=Nb(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Ai(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Ai(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+$b(e),u=-r.scrollTop;return aa(o||n).direction==="rtl"&&(l+=Ai(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:u}}function Lb(e){var t=aa(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function S3(e){return["html","body","#document"].indexOf(ws(e))>=0?e.ownerDocument.body:wo(e)&&Lb(e)?e:S3(Dh(e))}function Bu(e,t){var n;t===void 0&&(t=[]);var r=S3(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=no(r),i=o?[s].concat(s.visualViewport||[],Lb(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(Bu(Dh(i)))}function N1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function yB(e,t){var n=yc(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function SS(e,t,n){return t===g3?N1(xB(e,n)):Ui(t)?yB(t,n):N1(bB(ai(e)))}function CB(e){var t=Bu(Dh(e)),n=["absolute","fixed"].indexOf(aa(e).position)>=0,r=n&&wo(e)?Dd(e):e;return Ui(r)?t.filter(function(o){return Ui(o)&&b3(o,r)&&ws(o)!=="body"}):[]}function wB(e,t,n,r){var o=t==="clippingParents"?CB(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(u,p){var m=SS(e,p,r);return u.top=Ai(m.top,u.top),u.right=lm(m.right,u.right),u.bottom=lm(m.bottom,u.bottom),u.left=Ai(m.left,u.left),u},SS(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function k3(e){var t=e.reference,n=e.element,r=e.placement,o=r?Cs(r):null,s=r?Cc(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(o){case Dr:u={x:i,y:t.y-n.height};break;case ko:u={x:i,y:t.y+t.height};break;case jo:u={x:t.x+t.width,y:l};break;case Ar:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var p=o?Tb(o):null;if(p!=null){var m=p==="y"?"height":"width";switch(s){case xc:u[p]=u[p]-(t[m]/2-n[m]/2);break;case Ju:u[p]=u[p]+(t[m]/2-n[m]/2);break}}return u}function ed(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,i=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?HF:l,p=n.rootBoundary,m=p===void 0?g3:p,h=n.elementContext,g=h===void 0?Cu:h,x=n.altBoundary,y=x===void 0?!1:x,b=n.padding,w=b===void 0?0:b,S=C3(typeof w!="number"?w:w3(w,Rd)),j=g===Cu?VF:Cu,_=e.rects.popper,E=e.elements[y?j:g],I=wB(Ui(E)?E:E.contextElement||ai(e.elements.popper),u,m,i),M=yc(e.elements.reference),R=k3({reference:M,element:_,strategy:"absolute",placement:o}),D=N1(Object.assign({},_,R)),A=g===Cu?D:M,O={top:I.top-A.top+S.top,bottom:A.bottom-I.bottom+S.bottom,left:I.left-A.left+S.left,right:A.right-I.right+S.right},T=e.modifiersData.offset;if(g===Cu&&T){var X=T[o];Object.keys(O).forEach(function(B){var V=[jo,ko].indexOf(B)>=0?1:-1,U=[Dr,ko].indexOf(B)>=0?"y":"x";O[B]+=X[U]*V})}return O}function SB(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,p=u===void 0?v3:u,m=Cc(r),h=m?l?bS:bS.filter(function(y){return Cc(y)===m}):Rd,g=h.filter(function(y){return p.indexOf(y)>=0});g.length===0&&(g=h);var x=g.reduce(function(y,b){return y[b]=ed(e,{placement:b,boundary:o,rootBoundary:s,padding:i})[Cs(b)],y},{});return Object.keys(x).sort(function(y,b){return x[y]-x[b]})}function kB(e){if(Cs(e)===Rb)return[];var t=Np(e);return[wS(e),t,wS(t)]}function jB(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!0:i,u=n.fallbackPlacements,p=n.padding,m=n.boundary,h=n.rootBoundary,g=n.altBoundary,x=n.flipVariations,y=x===void 0?!0:x,b=n.allowedAutoPlacements,w=t.options.placement,S=Cs(w),j=S===w,_=u||(j||!y?[Np(w)]:kB(w)),E=[w].concat(_).reduce(function(re,G){return re.concat(Cs(G)===Rb?SB(t,{placement:G,boundary:m,rootBoundary:h,padding:p,flipVariations:y,allowedAutoPlacements:b}):G)},[]),I=t.rects.reference,M=t.rects.popper,R=new Map,D=!0,A=E[0],O=0;O<E.length;O++){var T=E[O],X=Cs(T),B=Cc(T)===xc,V=[Dr,ko].indexOf(X)>=0,U=V?"width":"height",N=ed(t,{placement:T,boundary:m,rootBoundary:h,altBoundary:g,padding:p}),$=V?B?jo:Ar:B?ko:Dr;I[U]>M[U]&&($=Np($));var q=Np($),F=[];if(s&&F.push(N[X]<=0),l&&F.push(N[$]<=0,N[q]<=0),F.every(function(re){return re})){A=T,D=!1;break}R.set(T,F)}if(D)for(var Q=y?3:1,Y=function(G){var K=E.find(function(ee){var ce=R.get(ee);if(ce)return ce.slice(0,G).every(function(J){return J})});if(K)return A=K,"break"},se=Q;se>0;se--){var ae=Y(se);if(ae==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const _B={name:"flip",enabled:!0,phase:"main",fn:jB,requiresIfExists:["offset"],data:{_skip:!1}};function kS(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function jS(e){return[Dr,jo,ko,Ar].some(function(t){return e[t]>=0})}function IB(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=ed(t,{elementContext:"reference"}),l=ed(t,{altBoundary:!0}),u=kS(i,r),p=kS(l,o,s),m=jS(u),h=jS(p);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:p,isReferenceHidden:m,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":h})}const PB={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:IB};function EB(e,t,n){var r=Cs(e),o=[Ar,Dr].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[Ar,jo].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function MB(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=v3.reduce(function(m,h){return m[h]=EB(h,t.rects,s),m},{}),l=i[t.placement],u=l.x,p=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=i}const OB={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:MB};function RB(e){var t=e.state,n=e.name;t.modifiersData[n]=k3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const DB={name:"popperOffsets",enabled:!0,phase:"read",fn:RB,data:{}};function AB(e){return e==="x"?"y":"x"}function TB(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,u=n.boundary,p=n.rootBoundary,m=n.altBoundary,h=n.padding,g=n.tether,x=g===void 0?!0:g,y=n.tetherOffset,b=y===void 0?0:y,w=ed(t,{boundary:u,rootBoundary:p,padding:h,altBoundary:m}),S=Cs(t.placement),j=Cc(t.placement),_=!j,E=Tb(S),I=AB(E),M=t.modifiersData.popperOffsets,R=t.rects.reference,D=t.rects.popper,A=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,O=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(M){if(s){var B,V=E==="y"?Dr:Ar,U=E==="y"?ko:jo,N=E==="y"?"height":"width",$=M[E],q=$+w[V],F=$-w[U],Q=x?-D[N]/2:0,Y=j===xc?R[N]:D[N],se=j===xc?-D[N]:-R[N],ae=t.elements.arrow,re=x&&ae?Ab(ae):{width:0,height:0},G=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:y3(),K=G[V],ee=G[U],ce=Fu(0,R[N],re[N]),J=_?R[N]/2-Q-ce-K-O.mainAxis:Y-ce-K-O.mainAxis,ie=_?-R[N]/2+Q+ce+ee+O.mainAxis:se+ce+ee+O.mainAxis,de=t.elements.arrow&&Dd(t.elements.arrow),ge=de?E==="y"?de.clientTop||0:de.clientLeft||0:0,Ce=(B=T==null?void 0:T[E])!=null?B:0,he=$+J-Ce-ge,fe=$+ie-Ce,Oe=Fu(x?lm(q,he):q,$,x?Ai(F,fe):F);M[E]=Oe,X[E]=Oe-$}if(l){var _e,Ne=E==="x"?Dr:Ar,nt=E==="x"?ko:jo,$e=M[I],Pt=I==="y"?"height":"width",Ze=$e+w[Ne],ot=$e-w[nt],ye=[Dr,Ar].indexOf(S)!==-1,De=(_e=T==null?void 0:T[I])!=null?_e:0,ut=ye?Ze:$e-R[Pt]-D[Pt]-De+O.altAxis,bt=ye?$e+R[Pt]+D[Pt]-De-O.altAxis:ot,be=x&&ye?sB(ut,$e,bt):Fu(x?ut:Ze,$e,x?bt:ot);M[I]=be,X[I]=be-$e}t.modifiersData[r]=X}}const NB={name:"preventOverflow",enabled:!0,phase:"main",fn:TB,requiresIfExists:["offset"]};function $B(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function LB(e){return e===no(e)||!wo(e)?Nb(e):$B(e)}function zB(e){var t=e.getBoundingClientRect(),n=bc(t.width)/e.offsetWidth||1,r=bc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function FB(e,t,n){n===void 0&&(n=!1);var r=wo(t),o=wo(t)&&zB(t),s=ai(t),i=yc(e,o,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((ws(t)!=="body"||Lb(s))&&(l=LB(t)),wo(t)?(u=yc(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=$b(s))),{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function BB(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function HB(e){var t=BB(e);return JF.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function VB(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function WB(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var _S={placement:"bottom",modifiers:[],strategy:"absolute"};function IS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function UB(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?_S:o;return function(l,u,p){p===void 0&&(p=s);var m={placement:"bottom",orderedModifiers:[],options:Object.assign({},_S,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},h=[],g=!1,x={state:m,setOptions:function(S){var j=typeof S=="function"?S(m.options):S;b(),m.options=Object.assign({},s,m.options,j),m.scrollParents={reference:Ui(l)?Bu(l):l.contextElement?Bu(l.contextElement):[],popper:Bu(u)};var _=HB(WB([].concat(r,m.options.modifiers)));return m.orderedModifiers=_.filter(function(E){return E.enabled}),y(),x.update()},forceUpdate:function(){if(!g){var S=m.elements,j=S.reference,_=S.popper;if(IS(j,_)){m.rects={reference:FB(j,Dd(_),m.options.strategy==="fixed"),popper:Ab(_)},m.reset=!1,m.placement=m.options.placement,m.orderedModifiers.forEach(function(O){return m.modifiersData[O.name]=Object.assign({},O.data)});for(var E=0;E<m.orderedModifiers.length;E++){if(m.reset===!0){m.reset=!1,E=-1;continue}var I=m.orderedModifiers[E],M=I.fn,R=I.options,D=R===void 0?{}:R,A=I.name;typeof M=="function"&&(m=M({state:m,options:D,name:A,instance:x})||m)}}}},update:VB(function(){return new Promise(function(w){x.forceUpdate(),w(m)})}),destroy:function(){b(),g=!0}};if(!IS(l,u))return x;x.setOptions(p).then(function(w){!g&&p.onFirstUpdate&&p.onFirstUpdate(w)});function y(){m.orderedModifiers.forEach(function(w){var S=w.name,j=w.options,_=j===void 0?{}:j,E=w.effect;if(typeof E=="function"){var I=E({state:m,name:S,instance:x,options:_}),M=function(){};h.push(I||M)}})}function b(){h.forEach(function(w){return w()}),h=[]}return x}}var GB=[hB,DB,pB,nB,OB,_B,NB,cB,PB],KB=UB({defaultModifiers:GB});function zb(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:i=!0,offset:l,gutter:u=8,flip:p=!0,boundary:m="clippingParents",preventOverflow:h=!0,matchWidth:g,direction:x="ltr"}=e,y=d.useRef(null),b=d.useRef(null),w=d.useRef(null),S=BF(r,x),j=d.useRef(()=>{}),_=d.useCallback(()=>{var O;!t||!y.current||!b.current||((O=j.current)==null||O.call(j),w.current=KB(y.current,b.current,{placement:S,modifiers:[LF,TF,AF,{...DF,enabled:!!g},{name:"eventListeners",...RF(i)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:l??[0,u]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:m}},...n??[]],strategy:o}),w.current.forceUpdate(),j.current=w.current.destroy)},[S,t,n,g,i,s,l,u,p,h,m,o]);d.useEffect(()=>()=>{var O;!y.current&&!b.current&&((O=w.current)==null||O.destroy(),w.current=null)},[]);const E=d.useCallback(O=>{y.current=O,_()},[_]),I=d.useCallback((O={},T=null)=>({...O,ref:It(E,T)}),[E]),M=d.useCallback(O=>{b.current=O,_()},[_]),R=d.useCallback((O={},T=null)=>({...O,ref:It(M,T),style:{...O.style,position:o,minWidth:g?void 0:"max-content",inset:"0 auto auto 0"}}),[o,M,g]),D=d.useCallback((O={},T=null)=>{const{size:X,shadowColor:B,bg:V,style:U,...N}=O;return{...N,ref:T,"data-popper-arrow":"",style:qB(O)}},[]),A=d.useCallback((O={},T=null)=>({...O,ref:T,"data-popper-arrow-inner":""}),[]);return{update(){var O;(O=w.current)==null||O.update()},forceUpdate(){var O;(O=w.current)==null||O.forceUpdate()},transformOrigin:$n.transformOrigin.varRef,referenceRef:E,popperRef:M,getPopperProps:R,getArrowProps:D,getArrowInnerProps:A,getReferenceProps:I}}function qB(e){const{size:t,shadowColor:n,bg:r,style:o}=e,s={...o,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),n&&(s["--popper-arrow-shadow-color"]=n),r&&(s["--popper-arrow-bg"]=r),s}function Fb(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=dn(n),i=dn(t),[l,u]=d.useState(e.defaultIsOpen||!1),p=r!==void 0?r:l,m=r!==void 0,h=d.useId(),g=o??`disclosure-${h}`,x=d.useCallback(()=>{m||u(!1),i==null||i()},[m,i]),y=d.useCallback(()=>{m||u(!0),s==null||s()},[m,s]),b=d.useCallback(()=>{p?x():y()},[p,y,x]);function w(j={}){return{...j,"aria-expanded":p,"aria-controls":g,onClick(_){var E;(E=j.onClick)==null||E.call(j,_),b()}}}function S(j={}){return{...j,hidden:!p,id:g}}return{isOpen:p,onOpen:y,onClose:x,onToggle:b,isControlled:m,getButtonProps:w,getDisclosureProps:S}}function XB(e){const{ref:t,handler:n,enabled:r=!0}=e,o=dn(n),i=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;d.useEffect(()=>{if(!r)return;const l=h=>{fv(h,t)&&(i.isPointerDown=!0)},u=h=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&fv(h,t)&&(i.isPointerDown=!1,o(h))},p=h=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&fv(h,t)&&(i.isPointerDown=!1,o(h))},m=j3(t.current);return m.addEventListener("mousedown",l,!0),m.addEventListener("mouseup",u,!0),m.addEventListener("touchstart",l,!0),m.addEventListener("touchend",p,!0),()=>{m.removeEventListener("mousedown",l,!0),m.removeEventListener("mouseup",u,!0),m.removeEventListener("touchstart",l,!0),m.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function fv(e,t){var n;const r=e.target;return r&&!j3(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function j3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function _3(e){const{isOpen:t,ref:n}=e,[r,o]=d.useState(t),[s,i]=d.useState(!1);return d.useEffect(()=>{s||(o(t),i(!0))},[t,s,r]),Di(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var u;const p=Jz(n.current),m=new p.CustomEvent("animationend",{bubbles:!0});(u=n.current)==null||u.dispatchEvent(m)}}}function Bb(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[QB,YB,ZB,JB]=ub(),[eH,Ad]=Wt({strict:!1,name:"MenuContext"});function tH(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function I3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function PS(e){return I3(e).activeElement===e}function nH(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:l,defaultIsOpen:u,onClose:p,onOpen:m,placement:h="bottom-start",lazyBehavior:g="unmount",direction:x,computePositionOnMount:y=!1,...b}=e,w=d.useRef(null),S=d.useRef(null),j=ZB(),_=d.useCallback(()=>{requestAnimationFrame(()=>{var ae;(ae=w.current)==null||ae.focus({preventScroll:!1})})},[]),E=d.useCallback(()=>{const ae=setTimeout(()=>{var re;if(o)(re=o.current)==null||re.focus();else{const G=j.firstEnabled();G&&B(G.index)}});q.current.add(ae)},[j,o]),I=d.useCallback(()=>{const ae=setTimeout(()=>{const re=j.lastEnabled();re&&B(re.index)});q.current.add(ae)},[j]),M=d.useCallback(()=>{m==null||m(),s?E():_()},[s,E,_,m]),{isOpen:R,onOpen:D,onClose:A,onToggle:O}=Fb({isOpen:l,defaultIsOpen:u,onClose:p,onOpen:M});XB({enabled:R&&r,ref:w,handler:ae=>{var re;(re=S.current)!=null&&re.contains(ae.target)||A()}});const T=zb({...b,enabled:R||y,placement:h,direction:x}),[X,B]=d.useState(-1);pa(()=>{R||B(-1)},[R]),h3(w,{focusRef:S,visible:R,shouldFocus:!0});const V=_3({isOpen:R,ref:w}),[U,N]=tH(t,"menu-button","menu-list"),$=d.useCallback(()=>{D(),_()},[D,_]),q=d.useRef(new Set([]));cH(()=>{q.current.forEach(ae=>clearTimeout(ae)),q.current.clear()});const F=d.useCallback(()=>{D(),E()},[E,D]),Q=d.useCallback(()=>{D(),I()},[D,I]),Y=d.useCallback(()=>{var ae,re;const G=I3(w.current),K=(ae=w.current)==null?void 0:ae.contains(G.activeElement);if(!(R&&!K))return;const ce=(re=j.item(X))==null?void 0:re.node;ce==null||ce.focus()},[R,X,j]),se=d.useRef(null);return{openAndFocusMenu:$,openAndFocusFirstItem:F,openAndFocusLastItem:Q,onTransitionEnd:Y,unstable__animationState:V,descendants:j,popper:T,buttonId:U,menuId:N,forceUpdate:T.forceUpdate,orientation:"vertical",isOpen:R,onToggle:O,onOpen:D,onClose:A,menuRef:w,buttonRef:S,focusedIndex:X,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:B,isLazy:i,lazyBehavior:g,initialFocusRef:o,rafId:se}}function rH(e={},t=null){const n=Ad(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,l=d.useCallback(u=>{const p=u.key,h={Enter:s,ArrowDown:s,ArrowUp:i}[p];h&&(u.preventDefault(),u.stopPropagation(),h(u))},[s,i]);return{...e,ref:It(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":dt(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:He(e.onClick,r),onKeyDown:He(e.onKeyDown,l)}}function $1(e){var t;return iH(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function oH(e={},t=null){const n=Ad();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:i,onClose:l,menuId:u,isLazy:p,lazyBehavior:m,unstable__animationState:h}=n,g=YB(),x=wF({preventDefault:S=>S.key!==" "&&$1(S.target)}),y=d.useCallback(S=>{if(!S.currentTarget.contains(S.target))return;const j=S.key,E={Tab:M=>M.preventDefault(),Escape:l,ArrowDown:()=>{const M=g.nextEnabled(r);M&&o(M.index)},ArrowUp:()=>{const M=g.prevEnabled(r);M&&o(M.index)}}[j];if(E){S.preventDefault(),E(S);return}const I=x(M=>{const R=SF(g.values(),M,D=>{var A,O;return(O=(A=D==null?void 0:D.node)==null?void 0:A.textContent)!=null?O:""},g.item(r));if(R){const D=g.indexOf(R.node);o(D)}});$1(S.target)&&I(S)},[g,r,x,l,o]),b=d.useRef(!1);i&&(b.current=!0);const w=Bb({wasSelected:b.current,enabled:p,mode:m,isSelected:h.present});return{...e,ref:It(s,t),children:w?e.children:null,tabIndex:-1,role:"menu",id:u,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:He(e.onKeyDown,y)}}function sH(e={}){const{popper:t,isOpen:n}=Ad();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function aH(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:i,isDisabled:l,isFocusable:u,closeOnSelect:p,type:m,...h}=e,g=Ad(),{setFocusedIndex:x,focusedIndex:y,closeOnSelect:b,onClose:w,menuRef:S,isOpen:j,menuId:_,rafId:E}=g,I=d.useRef(null),M=`${_}-menuitem-${d.useId()}`,{index:R,register:D}=JB({disabled:l&&!u}),A=d.useCallback($=>{n==null||n($),!l&&x(R)},[x,R,l,n]),O=d.useCallback($=>{r==null||r($),I.current&&!PS(I.current)&&A($)},[A,r]),T=d.useCallback($=>{o==null||o($),!l&&x(-1)},[x,l,o]),X=d.useCallback($=>{s==null||s($),$1($.currentTarget)&&(p??b)&&w()},[w,s,b,p]),B=d.useCallback($=>{i==null||i($),x(R)},[x,i,R]),V=R===y,U=l&&!u;pa(()=>{j&&(V&&!U&&I.current?(E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame(()=>{var $;($=I.current)==null||$.focus(),E.current=null})):S.current&&!PS(S.current)&&S.current.focus({preventScroll:!0}))},[V,U,S,j]);const N=m3({onClick:X,onFocus:B,onMouseEnter:A,onMouseMove:O,onMouseLeave:T,ref:It(D,I,t),isDisabled:l,isFocusable:u});return{...h,...N,type:m??N.type,id:M,role:"menuitem",tabIndex:V?0:-1}}function iH(e){var t;if(!lH(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function lH(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function cH(e,t=[]){return d.useEffect(()=>()=>e(),t)}var[uH,$c]=Wt({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Ah=e=>{const{children:t}=e,n=Un("Menu",e),r=on(e),{direction:o}=bd(),{descendants:s,...i}=nH({...r,direction:o}),l=d.useMemo(()=>i,[i]),{isOpen:u,onClose:p,forceUpdate:m}=l;return a.jsx(QB,{value:s,children:a.jsx(eH,{value:l,children:a.jsx(uH,{value:n,children:zx(t,{isOpen:u,onClose:p,forceUpdate:m})})})})};Ah.displayName="Menu";var P3=je((e,t)=>{const n=$c();return a.jsx(we.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});P3.displayName="MenuCommand";var dH=je((e,t)=>{const{type:n,...r}=e,o=$c(),s=r.as||n?n??void 0:"button",i=d.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return a.jsx(we.button,{ref:t,type:s,...r,__css:i})}),E3=e=>{const{className:t,children:n,...r}=e,o=$c(),s=d.Children.only(n),i=d.isValidElement(s)?d.cloneElement(s,{focusable:"false","aria-hidden":!0,className:Ye("chakra-menu__icon",s.props.className)}):null,l=Ye("chakra-menu__icon-wrapper",t);return a.jsx(we.span,{className:l,...r,__css:o.icon,children:i})};E3.displayName="MenuIcon";var en=je((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...l}=e,u=aH(l,t),m=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(dH,{...u,className:Ye("chakra-menu__menuitem",u.className),children:[n&&a.jsx(E3,{fontSize:"0.8em",marginEnd:r,children:n}),m,o&&a.jsx(P3,{marginStart:s,children:o})]})});en.displayName="MenuItem";var fH={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},pH=we(In.div),Gi=je(function(t,n){var r,o;const{rootProps:s,motionProps:i,...l}=t,{isOpen:u,onTransitionEnd:p,unstable__animationState:m}=Ad(),h=oH(l,n),g=sH(s),x=$c();return a.jsx(we.div,{...g,__css:{zIndex:(o=t.zIndex)!=null?o:(r=x.list)==null?void 0:r.zIndex},children:a.jsx(pH,{variants:fH,initial:!1,animate:u?"enter":"exit",__css:{outline:0,...x.list},...i,className:Ye("chakra-menu__menu-list",h.className),...h,onUpdate:p,onAnimationComplete:ph(m.onComplete,h.onAnimationComplete)})})});Gi.displayName="MenuList";var td=je((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=Ye("chakra-menu__group__title",o),l=$c();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(we.p,{className:i,...s,__css:l.groupTitle,children:n}),r]})});td.displayName="MenuGroup";var mH=je((e,t)=>{const n=$c();return a.jsx(we.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Th=je((e,t)=>{const{children:n,as:r,...o}=e,s=rH(o,t),i=r||mH;return a.jsx(i,{...s,className:Ye("chakra-menu__menu-button",e.className),children:a.jsx(we.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Th.displayName="MenuButton";var hH={slideInBottom:{...w1,custom:{offsetY:16,reverse:!0}},slideInRight:{...w1,custom:{offsetX:16,reverse:!0}},scale:{...a5,custom:{initialScale:.95,reverse:!0}},none:{}},gH=we(In.section),vH=e=>hH[e||"none"],M3=d.forwardRef((e,t)=>{const{preset:n,motionProps:r=vH(n),...o}=e;return a.jsx(gH,{ref:t,...r,...o})});M3.displayName="ModalTransition";var xH=Object.defineProperty,bH=(e,t,n)=>t in e?xH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yH=(e,t,n)=>(bH(e,typeof t!="symbol"?t+"":t,n),n),CH=class{constructor(){yH(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},L1=new CH;function O3(e,t){const[n,r]=d.useState(0);return d.useEffect(()=>{const o=e.current;if(o){if(t){const s=L1.add(o);r(s)}return()=>{L1.remove(o),r(0)}}},[t,e]),n}var wH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dl=new WeakMap,ep=new WeakMap,tp={},pv=0,R3=function(e){return e&&(e.host||R3(e.parentNode))},SH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=R3(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kH=function(e,t,n,r){var o=SH(t,Array.isArray(e)?e:[e]);tp[n]||(tp[n]=new WeakMap);var s=tp[n],i=[],l=new Set,u=new Set(o),p=function(h){!h||l.has(h)||(l.add(h),p(h.parentNode))};o.forEach(p);var m=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(g){if(l.has(g))m(g);else{var x=g.getAttribute(r),y=x!==null&&x!=="false",b=(Dl.get(g)||0)+1,w=(s.get(g)||0)+1;Dl.set(g,b),s.set(g,w),i.push(g),b===1&&y&&ep.set(g,!0),w===1&&g.setAttribute(n,"true"),y||g.setAttribute(r,"true")}})};return m(t),l.clear(),pv++,function(){i.forEach(function(h){var g=Dl.get(h)-1,x=s.get(h)-1;Dl.set(h,g),s.set(h,x),g||(ep.has(h)||h.removeAttribute(r),ep.delete(h)),x||h.removeAttribute(n)}),pv--,pv||(Dl=new WeakMap,Dl=new WeakMap,ep=new WeakMap,tp={})}},jH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||wH(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),kH(r,o,n,"aria-hidden")):function(){return null}};function _H(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:i=!0,onOverlayClick:l,onEsc:u}=e,p=d.useRef(null),m=d.useRef(null),[h,g,x]=PH(r,"chakra-modal","chakra-modal--header","chakra-modal--body");IH(p,t&&i);const y=O3(p,t),b=d.useRef(null),w=d.useCallback(A=>{b.current=A.target},[]),S=d.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),u==null||u())},[s,n,u]),[j,_]=d.useState(!1),[E,I]=d.useState(!1),M=d.useCallback((A={},O=null)=>({role:"dialog",...A,ref:It(O,p),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":j?g:void 0,"aria-describedby":E?x:void 0,onClick:He(A.onClick,T=>T.stopPropagation())}),[x,E,h,g,j]),R=d.useCallback(A=>{A.stopPropagation(),b.current===A.target&&L1.isTopModal(p.current)&&(o&&(n==null||n()),l==null||l())},[n,o,l]),D=d.useCallback((A={},O=null)=>({...A,ref:It(O,m),onClick:He(A.onClick,R),onKeyDown:He(A.onKeyDown,S),onMouseDown:He(A.onMouseDown,w)}),[S,w,R]);return{isOpen:t,onClose:n,headerId:g,bodyId:x,setBodyMounted:I,setHeaderMounted:_,dialogRef:p,overlayRef:m,getDialogProps:M,getDialogContainerProps:D,index:y}}function IH(e,t){const n=e.current;d.useEffect(()=>{if(!(!e.current||!t))return jH(e.current)},[t,e,n])}function PH(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[EH,Lc]=Wt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[MH,Ki]=Wt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),qi=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:x,onCloseComplete:y}=t,b=Un("Modal",t),S={..._H(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:m,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:x};return a.jsx(MH,{value:S,children:a.jsx(EH,{value:b,children:a.jsx(dr,{onExitComplete:y,children:S.isOpen&&a.jsx(Ac,{...n,children:r})})})})};qi.displayName="Modal";var $p="right-scroll-bar-position",Lp="width-before-scroll-bar",OH="with-scroll-bars-hidden",RH="--removed-body-scroll-bar-size",D3=E5(),mv=function(){},Nh=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:mv,onWheelCapture:mv,onTouchMoveCapture:mv}),o=r[0],s=r[1],i=e.forwardProps,l=e.children,u=e.className,p=e.removeScrollBar,m=e.enabled,h=e.shards,g=e.sideCar,x=e.noIsolation,y=e.inert,b=e.allowPinchZoom,w=e.as,S=w===void 0?"div":w,j=e.gapMode,_=_5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,I=j5([n,t]),M=gs(gs({},_),o);return d.createElement(d.Fragment,null,m&&d.createElement(E,{sideCar:D3,removeScrollBar:p,shards:h,noIsolation:x,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:j}),i?d.cloneElement(d.Children.only(l),gs(gs({},M),{ref:I})):d.createElement(S,gs({},M,{className:u,ref:I}),l))});Nh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nh.classNames={fullWidth:Lp,zeroRight:$p};var ES,DH=function(){if(ES)return ES;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DH();return t&&e.setAttribute("nonce",t),e}function TH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function NH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $H=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AH())&&(TH(t,n),NH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LH=function(){var e=$H();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},A3=function(){var e=LH(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},zH={left:0,top:0,right:0,gap:0},hv=function(e){return parseInt(e||"",10)||0},FH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[hv(n),hv(r),hv(o)]},BH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zH;var t=FH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},HH=A3(),VH=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(OH,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(l,"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(i,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(l,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat($p,` {
|
||
right: `).concat(l,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Lp,` {
|
||
margin-right: `).concat(l,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat($p," .").concat($p,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Lp," .").concat(Lp,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat(RH,": ").concat(l,`px;
|
||
}
|
||
`)},WH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=d.useMemo(function(){return BH(o)},[o]);return d.createElement(HH,{styles:VH(s,!t,o,n?"":"!important")})},z1=!1;if(typeof window<"u")try{var np=Object.defineProperty({},"passive",{get:function(){return z1=!0,!0}});window.addEventListener("test",np,np),window.removeEventListener("test",np,np)}catch{z1=!1}var Al=z1?{passive:!1}:!1,UH=function(e){return e.tagName==="TEXTAREA"},T3=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!UH(e)&&n[t]==="visible")},GH=function(e){return T3(e,"overflowY")},KH=function(e){return T3(e,"overflowX")},MS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=N3(e,r);if(o){var s=$3(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},XH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},N3=function(e,t){return e==="v"?GH(t):KH(t)},$3=function(e,t){return e==="v"?qH(t):XH(t)},QH=function(e,t){return e==="h"&&t==="rtl"?-1:1},YH=function(e,t,n,r,o){var s=QH(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,u=t.contains(l),p=!1,m=i>0,h=0,g=0;do{var x=$3(e,l),y=x[0],b=x[1],w=x[2],S=b-w-s*y;(y||S)&&N3(e,l)&&(h+=S,g+=y),l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(m&&(o&&h===0||!o&&i>h)||!m&&(o&&g===0||!o&&-i>g))&&(p=!0),p},rp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},OS=function(e){return[e.deltaX,e.deltaY]},RS=function(e){return e&&"current"in e?e.current:e},ZH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},JH=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},eV=0,Tl=[];function tV(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(eV++)[0],s=d.useState(A3)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=M1([e.lockRef.current],(e.shards||[]).map(RS),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!i.current.allowPinchZoom;var S=rp(b),j=n.current,_="deltaX"in b?b.deltaX:j[0]-S[0],E="deltaY"in b?b.deltaY:j[1]-S[1],I,M=b.target,R=Math.abs(_)>Math.abs(E)?"h":"v";if("touches"in b&&R==="h"&&M.type==="range")return!1;var D=MS(R,M);if(!D)return!0;if(D?I=R:(I=R==="v"?"h":"v",D=MS(R,M)),!D)return!1;if(!r.current&&"changedTouches"in b&&(_||E)&&(r.current=I),!I)return!0;var A=r.current||I;return YH(A,w,b,A==="h"?_:E,!0)},[]),u=d.useCallback(function(b){var w=b;if(!(!Tl.length||Tl[Tl.length-1]!==s)){var S="deltaY"in w?OS(w):rp(w),j=t.current.filter(function(I){return I.name===w.type&&I.target===w.target&&ZH(I.delta,S)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var _=(i.current.shards||[]).map(RS).filter(Boolean).filter(function(I){return I.contains(w.target)}),E=_.length>0?l(w,_[0]):!i.current.noIsolation;E&&w.cancelable&&w.preventDefault()}}},[]),p=d.useCallback(function(b,w,S,j){var _={name:b,delta:w,target:S,should:j};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(E){return E!==_})},1)},[]),m=d.useCallback(function(b){n.current=rp(b),r.current=void 0},[]),h=d.useCallback(function(b){p(b.type,OS(b),b.target,l(b,e.lockRef.current))},[]),g=d.useCallback(function(b){p(b.type,rp(b),b.target,l(b,e.lockRef.current))},[]);d.useEffect(function(){return Tl.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",u,Al),document.addEventListener("touchmove",u,Al),document.addEventListener("touchstart",m,Al),function(){Tl=Tl.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,Al),document.removeEventListener("touchmove",u,Al),document.removeEventListener("touchstart",m,Al)}},[]);var x=e.removeScrollBar,y=e.inert;return d.createElement(d.Fragment,null,y?d.createElement(s,{styles:JH(o)}):null,x?d.createElement(WH,{gapMode:e.gapMode}):null)}const nV=nz(D3,tV);var L3=d.forwardRef(function(e,t){return d.createElement(Nh,gs({},e,{ref:t,sideCar:nV}))});L3.classNames=Nh.classNames;const rV=L3;function oV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:l,returnFocusOnClose:u,preserveScrollBarGap:p,lockFocusAcrossFrames:m,isOpen:h}=Ki(),[g,x]=FR();d.useEffect(()=>{!g&&x&&setTimeout(x)},[g,x]);const y=O3(r,h);return a.jsx(a3,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:l,restoreFocus:u,contentRef:r,lockFocusAcrossFrames:m,children:a.jsx(rV,{removeScrollBar:!p,allowPinchZoom:i,enabled:y===1&&s,forwardProps:!0,children:e.children})})}var Xi=je((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:l,getDialogContainerProps:u}=Ki(),p=l(i,t),m=u(o),h=Ye("chakra-modal__content",n),g=Lc(),x={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...g.dialog},y={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...g.dialogContainer},{motionPreset:b}=Ki();return a.jsx(oV,{children:a.jsx(we.div,{...m,className:"chakra-modal__content-container",tabIndex:-1,__css:y,children:a.jsx(M3,{preset:b,motionProps:s,className:h,...p,__css:x,children:r})})})});Xi.displayName="ModalContent";function Td(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(qi,{...n,initialFocusRef:t})}var Nd=je((e,t)=>a.jsx(Xi,{ref:t,role:"alertdialog",...e})),Ss=je((e,t)=>{const{className:n,...r}=e,o=Ye("chakra-modal__footer",n),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...Lc().footer};return a.jsx(we.footer,{ref:t,...r,__css:i,className:o})});Ss.displayName="ModalFooter";var Qo=je((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Ki();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=Ye("chakra-modal__header",n),u={flex:0,...Lc().header};return a.jsx(we.header,{ref:t,className:i,id:o,...r,__css:u})});Qo.displayName="ModalHeader";var sV=we(In.div),Yo=je((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,i=Ye("chakra-modal__overlay",n),u={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Lc().overlay},{motionPreset:p}=Ki(),h=o||(p==="none"?{}:s5);return a.jsx(sV,{...h,__css:u,ref:t,className:i,...s})});Yo.displayName="ModalOverlay";var Zo=je((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Ki();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=Ye("chakra-modal__body",n),l=Lc();return a.jsx(we.div,{ref:t,className:i,id:o,...r,__css:l.body})});Zo.displayName="ModalBody";var $d=je((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Ki(),i=Ye("chakra-modal__close-btn",r),l=Lc();return a.jsx(eI,{ref:t,__css:l.closeButton,className:i,onClick:He(n,u=>{u.stopPropagation(),s()}),...o})});$d.displayName="ModalCloseButton";var aV=e=>a.jsx(Nn,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),iV=e=>a.jsx(Nn,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function DS(e,t,n,r){d.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,i=Array.isArray(t)?t:[t],l=new s.MutationObserver(u=>{for(const p of u)p.type==="attributes"&&p.attributeName&&i.includes(p.attributeName)&&n(p)});return l.observe(e.current,{attributes:!0,attributeFilter:i}),()=>l.disconnect()})}function lV(e,t){const n=dn(e);d.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var cV=50,AS=300;function uV(e,t){const[n,r]=d.useState(!1),[o,s]=d.useState(null),[i,l]=d.useState(!0),u=d.useRef(null),p=()=>clearTimeout(u.current);lV(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?cV:null);const m=d.useCallback(()=>{i&&e(),u.current=setTimeout(()=>{l(!1),r(!0),s("increment")},AS)},[e,i]),h=d.useCallback(()=>{i&&t(),u.current=setTimeout(()=>{l(!1),r(!0),s("decrement")},AS)},[t,i]),g=d.useCallback(()=>{l(!0),r(!1),p()},[]);return d.useEffect(()=>()=>p(),[]),{up:m,down:h,stop:g,isSpinning:n}}var dV=/^[Ee0-9+\-.]$/;function fV(e){return dV.test(e)}function pV(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function mV(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:i=1,isReadOnly:l,isDisabled:u,isRequired:p,isInvalid:m,pattern:h="[0-9]*(.[0-9]+)?",inputMode:g="decimal",allowMouseWheel:x,id:y,onChange:b,precision:w,name:S,"aria-describedby":j,"aria-label":_,"aria-labelledby":E,onFocus:I,onBlur:M,onInvalid:R,getAriaValueText:D,isValidCharacter:A,format:O,parse:T,...X}=e,B=dn(I),V=dn(M),U=dn(R),N=dn(A??fV),$=dn(D),q=NL(e),{update:F,increment:Q,decrement:Y}=q,[se,ae]=d.useState(!1),re=!(l||u),G=d.useRef(null),K=d.useRef(null),ee=d.useRef(null),ce=d.useRef(null),J=d.useCallback(be=>be.split("").filter(N).join(""),[N]),ie=d.useCallback(be=>{var Je;return(Je=T==null?void 0:T(be))!=null?Je:be},[T]),de=d.useCallback(be=>{var Je;return((Je=O==null?void 0:O(be))!=null?Je:be).toString()},[O]);pa(()=>{(q.valueAsNumber>s||q.valueAsNumber<o)&&(U==null||U("rangeOverflow",de(q.value),q.valueAsNumber))},[q.valueAsNumber,q.value,de,U]),rc(()=>{if(!G.current)return;if(G.current.value!=q.value){const Je=ie(G.current.value);q.setValue(J(Je))}},[ie,J]);const ge=d.useCallback((be=i)=>{re&&Q(be)},[Q,re,i]),Ce=d.useCallback((be=i)=>{re&&Y(be)},[Y,re,i]),he=uV(ge,Ce);DS(ee,"disabled",he.stop,he.isSpinning),DS(ce,"disabled",he.stop,he.isSpinning);const fe=d.useCallback(be=>{if(be.nativeEvent.isComposing)return;const lt=ie(be.currentTarget.value);F(J(lt)),K.current={start:be.currentTarget.selectionStart,end:be.currentTarget.selectionEnd}},[F,J,ie]),Oe=d.useCallback(be=>{var Je,lt,ft;B==null||B(be),K.current&&(be.target.selectionStart=(lt=K.current.start)!=null?lt:(Je=be.currentTarget.value)==null?void 0:Je.length,be.currentTarget.selectionEnd=(ft=K.current.end)!=null?ft:be.currentTarget.selectionStart)},[B]),_e=d.useCallback(be=>{if(be.nativeEvent.isComposing)return;pV(be,N)||be.preventDefault();const Je=Ne(be)*i,lt=be.key,Me={ArrowUp:()=>ge(Je),ArrowDown:()=>Ce(Je),Home:()=>F(o),End:()=>F(s)}[lt];Me&&(be.preventDefault(),Me(be))},[N,i,ge,Ce,F,o,s]),Ne=be=>{let Je=1;return(be.metaKey||be.ctrlKey)&&(Je=.1),be.shiftKey&&(Je=10),Je},nt=d.useMemo(()=>{const be=$==null?void 0:$(q.value);if(be!=null)return be;const Je=q.value.toString();return Je||void 0},[q.value,$]),$e=d.useCallback(()=>{let be=q.value;if(q.value==="")return;/^[eE]/.test(q.value.toString())?q.setValue(""):(q.valueAsNumber<o&&(be=o),q.valueAsNumber>s&&(be=s),q.cast(be))},[q,s,o]),Pt=d.useCallback(()=>{ae(!1),n&&$e()},[n,ae,$e]),Ze=d.useCallback(()=>{t&&requestAnimationFrame(()=>{var be;(be=G.current)==null||be.focus()})},[t]),ot=d.useCallback(be=>{be.preventDefault(),he.up(),Ze()},[Ze,he]),ye=d.useCallback(be=>{be.preventDefault(),he.down(),Ze()},[Ze,he]);Di(()=>G.current,"wheel",be=>{var Je,lt;const Me=((lt=(Je=G.current)==null?void 0:Je.ownerDocument)!=null?lt:document).activeElement===G.current;if(!x||!Me)return;be.preventDefault();const Le=Ne(be)*i,Ut=Math.sign(be.deltaY);Ut===-1?ge(Le):Ut===1&&Ce(Le)},{passive:!1});const De=d.useCallback((be={},Je=null)=>{const lt=u||r&&q.isAtMax;return{...be,ref:It(Je,ee),role:"button",tabIndex:-1,onPointerDown:He(be.onPointerDown,ft=>{ft.button!==0||lt||ot(ft)}),onPointerLeave:He(be.onPointerLeave,he.stop),onPointerUp:He(be.onPointerUp,he.stop),disabled:lt,"aria-disabled":Co(lt)}},[q.isAtMax,r,ot,he.stop,u]),ut=d.useCallback((be={},Je=null)=>{const lt=u||r&&q.isAtMin;return{...be,ref:It(Je,ce),role:"button",tabIndex:-1,onPointerDown:He(be.onPointerDown,ft=>{ft.button!==0||lt||ye(ft)}),onPointerLeave:He(be.onPointerLeave,he.stop),onPointerUp:He(be.onPointerUp,he.stop),disabled:lt,"aria-disabled":Co(lt)}},[q.isAtMin,r,ye,he.stop,u]),bt=d.useCallback((be={},Je=null)=>{var lt,ft,Me,Le;return{name:S,inputMode:g,type:"text",pattern:h,"aria-labelledby":E,"aria-label":_,"aria-describedby":j,id:y,disabled:u,...be,readOnly:(lt=be.readOnly)!=null?lt:l,"aria-readonly":(ft=be.readOnly)!=null?ft:l,"aria-required":(Me=be.required)!=null?Me:p,required:(Le=be.required)!=null?Le:p,ref:It(G,Je),value:de(q.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(q.valueAsNumber)?void 0:q.valueAsNumber,"aria-invalid":Co(m??q.isOutOfRange),"aria-valuetext":nt,autoComplete:"off",autoCorrect:"off",onChange:He(be.onChange,fe),onKeyDown:He(be.onKeyDown,_e),onFocus:He(be.onFocus,Oe,()=>ae(!0)),onBlur:He(be.onBlur,V,Pt)}},[S,g,h,E,_,de,j,y,u,p,l,m,q.value,q.valueAsNumber,q.isOutOfRange,o,s,nt,fe,_e,Oe,V,Pt]);return{value:de(q.value),valueAsNumber:q.valueAsNumber,isFocused:se,isDisabled:u,isReadOnly:l,getIncrementButtonProps:De,getDecrementButtonProps:ut,getInputProps:bt,htmlProps:X}}var[hV,$h]=Wt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[gV,Hb]=Wt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Lh=je(function(t,n){const r=Un("NumberInput",t),o=on(t),s=mb(o),{htmlProps:i,...l}=mV(s),u=d.useMemo(()=>l,[l]);return a.jsx(gV,{value:u,children:a.jsx(hV,{value:r,children:a.jsx(we.div,{...i,ref:n,className:Ye("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Lh.displayName="NumberInput";var zh=je(function(t,n){const r=$h();return a.jsx(we.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});zh.displayName="NumberInputStepper";var Fh=je(function(t,n){const{getInputProps:r}=Hb(),o=r(t,n),s=$h();return a.jsx(we.input,{...o,className:Ye("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Fh.displayName="NumberInputField";var z3=we("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Bh=je(function(t,n){var r;const o=$h(),{getDecrementButtonProps:s}=Hb(),i=s(t,n);return a.jsx(z3,{...i,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(aV,{})})});Bh.displayName="NumberDecrementStepper";var Hh=je(function(t,n){var r;const{getIncrementButtonProps:o}=Hb(),s=o(t,n),i=$h();return a.jsx(z3,{...s,__css:i.stepper,children:(r=t.children)!=null?r:a.jsx(iV,{})})});Hh.displayName="NumberIncrementStepper";var[vV,nl]=Wt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[xV,Vh]=Wt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Wh(e){const t=d.Children.only(e.children),{getTriggerProps:n}=nl();return d.cloneElement(t,n(t.props,t.ref))}Wh.displayName="PopoverTrigger";var Nl={click:"click",hover:"hover"};function bV(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:l,arrowShadowColor:u,trigger:p=Nl.click,openDelay:m=200,closeDelay:h=200,isLazy:g,lazyBehavior:x="unmount",computePositionOnMount:y,...b}=e,{isOpen:w,onClose:S,onOpen:j,onToggle:_}=Fb(e),E=d.useRef(null),I=d.useRef(null),M=d.useRef(null),R=d.useRef(!1),D=d.useRef(!1);w&&(D.current=!0);const[A,O]=d.useState(!1),[T,X]=d.useState(!1),B=d.useId(),V=o??B,[U,N,$,q]=["popover-trigger","popover-content","popover-header","popover-body"].map(fe=>`${fe}-${V}`),{referenceRef:F,getArrowProps:Q,getPopperProps:Y,getArrowInnerProps:se,forceUpdate:ae}=zb({...b,enabled:w||!!y}),re=_3({isOpen:w,ref:M});b5({enabled:w,ref:I}),h3(M,{focusRef:I,visible:w,shouldFocus:s&&p===Nl.click}),IF(M,{focusRef:r,visible:w,shouldFocus:i&&p===Nl.click});const G=Bb({wasSelected:D.current,enabled:g,mode:x,isSelected:re.present}),K=d.useCallback((fe={},Oe=null)=>{const _e={...fe,style:{...fe.style,transformOrigin:$n.transformOrigin.varRef,[$n.arrowSize.var]:l?`${l}px`:void 0,[$n.arrowShadowColor.var]:u},ref:It(M,Oe),children:G?fe.children:null,id:N,tabIndex:-1,role:"dialog",onKeyDown:He(fe.onKeyDown,Ne=>{n&&Ne.key==="Escape"&&S()}),onBlur:He(fe.onBlur,Ne=>{const nt=TS(Ne),$e=gv(M.current,nt),Pt=gv(I.current,nt);w&&t&&(!$e&&!Pt)&&S()}),"aria-labelledby":A?$:void 0,"aria-describedby":T?q:void 0};return p===Nl.hover&&(_e.role="tooltip",_e.onMouseEnter=He(fe.onMouseEnter,()=>{R.current=!0}),_e.onMouseLeave=He(fe.onMouseLeave,Ne=>{Ne.nativeEvent.relatedTarget!==null&&(R.current=!1,setTimeout(()=>S(),h))})),_e},[G,N,A,$,T,q,p,n,S,w,t,h,u,l]),ee=d.useCallback((fe={},Oe=null)=>Y({...fe,style:{visibility:w?"visible":"hidden",...fe.style}},Oe),[w,Y]),ce=d.useCallback((fe,Oe=null)=>({...fe,ref:It(Oe,E,F)}),[E,F]),J=d.useRef(),ie=d.useRef(),de=d.useCallback(fe=>{E.current==null&&F(fe)},[F]),ge=d.useCallback((fe={},Oe=null)=>{const _e={...fe,ref:It(I,Oe,de),id:U,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":N};return p===Nl.click&&(_e.onClick=He(fe.onClick,_)),p===Nl.hover&&(_e.onFocus=He(fe.onFocus,()=>{J.current===void 0&&j()}),_e.onBlur=He(fe.onBlur,Ne=>{const nt=TS(Ne),$e=!gv(M.current,nt);w&&t&&$e&&S()}),_e.onKeyDown=He(fe.onKeyDown,Ne=>{Ne.key==="Escape"&&S()}),_e.onMouseEnter=He(fe.onMouseEnter,()=>{R.current=!0,J.current=window.setTimeout(()=>j(),m)}),_e.onMouseLeave=He(fe.onMouseLeave,()=>{R.current=!1,J.current&&(clearTimeout(J.current),J.current=void 0),ie.current=window.setTimeout(()=>{R.current===!1&&S()},h)})),_e},[U,w,N,p,de,_,j,t,S,m,h]);d.useEffect(()=>()=>{J.current&&clearTimeout(J.current),ie.current&&clearTimeout(ie.current)},[]);const Ce=d.useCallback((fe={},Oe=null)=>({...fe,id:$,ref:It(Oe,_e=>{O(!!_e)})}),[$]),he=d.useCallback((fe={},Oe=null)=>({...fe,id:q,ref:It(Oe,_e=>{X(!!_e)})}),[q]);return{forceUpdate:ae,isOpen:w,onAnimationComplete:re.onComplete,onClose:S,getAnchorProps:ce,getArrowProps:Q,getArrowInnerProps:se,getPopoverPositionerProps:ee,getPopoverProps:K,getTriggerProps:ge,getHeaderProps:Ce,getBodyProps:he}}function gv(e,t){return e===t||(e==null?void 0:e.contains(t))}function TS(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function Ld(e){const t=Un("Popover",e),{children:n,...r}=on(e),o=bd(),s=bV({...r,direction:o.direction});return a.jsx(vV,{value:s,children:a.jsx(xV,{value:t,children:zx(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}Ld.displayName="Popover";function F3(e){const t=d.Children.only(e.children),{getAnchorProps:n}=nl();return d.cloneElement(t,n(t.props,t.ref))}F3.displayName="PopoverAnchor";var vv=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function B3(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:i,shadowColor:l}=e,{getArrowProps:u,getArrowInnerProps:p}=nl(),m=Vh(),h=(t=n??r)!=null?t:o,g=s??i;return a.jsx(we.div,{...u(),className:"chakra-popover__arrow-positioner",children:a.jsx(we.div,{className:Ye("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":vv("colors",l),"--popper-arrow-bg":vv("colors",h),"--popper-arrow-shadow":vv("shadows",g),...m.arrow}})})}B3.displayName="PopoverArrow";var Uh=je(function(t,n){const{getBodyProps:r}=nl(),o=Vh();return a.jsx(we.div,{...r(t,n),className:Ye("chakra-popover__body",t.className),__css:o.body})});Uh.displayName="PopoverBody";var H3=je(function(t,n){const{onClose:r}=nl(),o=Vh();return a.jsx(eI,{size:"sm",onClick:r,className:Ye("chakra-popover__close-btn",t.className),__css:o.closeButton,ref:n,...t})});H3.displayName="PopoverCloseButton";function yV(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var CV={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},wV=we(In.section),V3=je(function(t,n){const{variants:r=CV,...o}=t,{isOpen:s}=nl();return a.jsx(wV,{ref:n,variants:yV(r),initial:!1,animate:s?"enter":"exit",...o})});V3.displayName="PopoverTransition";var zd=je(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:l,onAnimationComplete:u}=nl(),p=Vh(),m={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(we.div,{...l(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(V3,{...o,...i(s,n),onAnimationComplete:ph(u,s.onAnimationComplete),className:Ye("chakra-popover__content",t.className),__css:m})})});zd.displayName="PopoverContent";var F1=e=>a.jsx(we.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});F1.displayName="Circle";function SV(e,t,n){return(e-t)*100/(n-t)}var kV=ma({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),jV=ma({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),_V=ma({"0%":{left:"-40%"},"100%":{left:"100%"}}),IV=ma({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function W3(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:l="progressbar"}=e,u=SV(t,n,r);return{bind:{"data-indeterminate":i?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":i?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,u):o})(),role:l},percent:u,value:t}}var U3=e=>{const{size:t,isIndeterminate:n,...r}=e;return a.jsx(we.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${jV} 2s linear infinite`:void 0},...r})};U3.displayName="Shape";var B1=je((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:i,getValueText:l,value:u,capIsRound:p,children:m,thickness:h="10px",color:g="#0078d4",trackColor:x="#edebe9",isIndeterminate:y,...b}=e,w=W3({min:s,max:o,value:u,valueText:i,getValueText:l,isIndeterminate:y}),S=y?void 0:((n=w.percent)!=null?n:0)*2.64,j=S==null?void 0:`${S} ${264-S}`,_=y?{css:{animation:`${kV} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:j,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},E={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:r};return a.jsxs(we.div,{ref:t,className:"chakra-progress",...w.bind,...b,__css:E,children:[a.jsxs(U3,{size:r,isIndeterminate:y,children:[a.jsx(F1,{stroke:x,strokeWidth:h,className:"chakra-progress__track"}),a.jsx(F1,{stroke:g,strokeWidth:h,className:"chakra-progress__indicator",strokeLinecap:p?"round":void 0,opacity:w.value===0&&!y?0:void 0,..._})]}),m]})});B1.displayName="CircularProgress";var[PV,EV]=Wt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),MV=je((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...l}=e,u=W3({value:o,min:n,max:r,isIndeterminate:s,role:i}),m={height:"100%",...EV().filledTrack};return a.jsx(we.div,{ref:t,style:{width:`${u.percent}%`,...l.style},...u.bind,...l,__css:m})}),G3=je((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:l,children:u,borderRadius:p,isIndeterminate:m,"aria-label":h,"aria-labelledby":g,"aria-valuetext":x,title:y,role:b,...w}=on(e),S=Un("Progress",e),j=p??((n=S.track)==null?void 0:n.borderRadius),_={animation:`${IV} 1s linear infinite`},M={...!m&&i&&l&&_,...m&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${_V} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...S.track};return a.jsx(we.div,{ref:t,borderRadius:j,__css:R,...w,children:a.jsxs(PV,{value:S,children:[a.jsx(MV,{"aria-label":h,"aria-labelledby":g,"aria-valuetext":x,min:o,max:s,value:r,isIndeterminate:m,css:M,borderRadius:j,title:y,role:b}),u]})})});G3.displayName="Progress";function OV(e){return e&&a1(e)&&a1(e.target)}function RV(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:l,...u}=e,[p,m]=d.useState(r||""),h=typeof n<"u",g=h?n:p,x=d.useRef(null),y=d.useCallback(()=>{const I=x.current;if(!I)return;let M="input:not(:disabled):checked";const R=I.querySelector(M);if(R){R.focus();return}M="input:not(:disabled)";const D=I.querySelector(M);D==null||D.focus()},[]),w=`radio-${d.useId()}`,S=o||w,j=d.useCallback(I=>{const M=OV(I)?I.target.value:I;h||m(M),t==null||t(String(M))},[t,h]),_=d.useCallback((I={},M=null)=>({...I,ref:It(M,x),role:"radiogroup"}),[]),E=d.useCallback((I={},M=null)=>({...I,ref:M,name:S,[l?"checked":"isChecked"]:g!=null?I.value===g:void 0,onChange(D){j(D)},"data-radiogroup":!0}),[l,S,j,g]);return{getRootProps:_,getRadioProps:E,name:S,ref:x,focus:y,setValue:m,value:g,onChange:j,isDisabled:s,isFocusable:i,htmlProps:u}}var[DV,K3]=Wt({name:"RadioGroupContext",strict:!1}),cm=je((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:l,isFocusable:u,...p}=e,{value:m,onChange:h,getRootProps:g,name:x,htmlProps:y}=RV(p),b=d.useMemo(()=>({name:x,size:r,onChange:h,colorScheme:n,value:m,variant:o,isDisabled:l,isFocusable:u}),[x,r,h,n,m,o,l,u]);return a.jsx(DV,{value:b,children:a.jsx(we.div,{...g(y,t),className:Ye("chakra-radio-group",i),children:s})})});cm.displayName="RadioGroup";var AV={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function TV(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:l,isInvalid:u,name:p,value:m,id:h,"data-radiogroup":g,"aria-describedby":x,...y}=e,b=`radio-${d.useId()}`,w=Pd(),j=!!K3()||!!g;let E=!!w&&!j?w.id:b;E=h??E;const I=o??(w==null?void 0:w.isDisabled),M=s??(w==null?void 0:w.isReadOnly),R=i??(w==null?void 0:w.isRequired),D=u??(w==null?void 0:w.isInvalid),[A,O]=d.useState(!1),[T,X]=d.useState(!1),[B,V]=d.useState(!1),[U,N]=d.useState(!1),[$,q]=d.useState(!!t),F=typeof n<"u",Q=F?n:$;d.useEffect(()=>f5(O),[]);const Y=d.useCallback(de=>{if(M||I){de.preventDefault();return}F||q(de.target.checked),l==null||l(de)},[F,I,M,l]),se=d.useCallback(de=>{de.key===" "&&N(!0)},[N]),ae=d.useCallback(de=>{de.key===" "&&N(!1)},[N]),re=d.useCallback((de={},ge=null)=>({...de,ref:ge,"data-active":dt(U),"data-hover":dt(B),"data-disabled":dt(I),"data-invalid":dt(D),"data-checked":dt(Q),"data-focus":dt(T),"data-focus-visible":dt(T&&A),"data-readonly":dt(M),"aria-hidden":!0,onMouseDown:He(de.onMouseDown,()=>N(!0)),onMouseUp:He(de.onMouseUp,()=>N(!1)),onMouseEnter:He(de.onMouseEnter,()=>V(!0)),onMouseLeave:He(de.onMouseLeave,()=>V(!1))}),[U,B,I,D,Q,T,M,A]),{onFocus:G,onBlur:K}=w??{},ee=d.useCallback((de={},ge=null)=>{const Ce=I&&!r;return{...de,id:E,ref:ge,type:"radio",name:p,value:m,onChange:He(de.onChange,Y),onBlur:He(K,de.onBlur,()=>X(!1)),onFocus:He(G,de.onFocus,()=>X(!0)),onKeyDown:He(de.onKeyDown,se),onKeyUp:He(de.onKeyUp,ae),checked:Q,disabled:Ce,readOnly:M,required:R,"aria-invalid":Co(D),"aria-disabled":Co(Ce),"aria-required":Co(R),"data-readonly":dt(M),"aria-describedby":x,style:AV}},[I,r,E,p,m,Y,K,G,se,ae,Q,M,R,D,x]);return{state:{isInvalid:D,isFocused:T,isChecked:Q,isActive:U,isHovered:B,isDisabled:I,isReadOnly:M,isRequired:R},getCheckboxProps:re,getRadioProps:re,getInputProps:ee,getLabelProps:(de={},ge=null)=>({...de,ref:ge,onMouseDown:He(de.onMouseDown,NV),"data-disabled":dt(I),"data-checked":dt(Q),"data-invalid":dt(D)}),getRootProps:(de,ge=null)=>({...de,ref:ge,"data-disabled":dt(I),"data-checked":dt(Q),"data-invalid":dt(D)}),htmlProps:y}}function NV(e){e.preventDefault(),e.stopPropagation()}function $V(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var Ks=je((e,t)=>{var n;const r=K3(),{onChange:o,value:s}=e,i=Un("Radio",{...r,...e}),l=on(e),{spacing:u="0.5rem",children:p,isDisabled:m=r==null?void 0:r.isDisabled,isFocusable:h=r==null?void 0:r.isFocusable,inputProps:g,...x}=l;let y=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(y=r.value===s);let b=o;r!=null&&r.onChange&&s!=null&&(b=ph(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:S,getCheckboxProps:j,getLabelProps:_,getRootProps:E,htmlProps:I}=TV({...x,isChecked:y,isFocusable:h,isDisabled:m,onChange:b,name:w}),[M,R]=$V(I,tI),D=j(R),A=S(g,t),O=_(),T=Object.assign({},M,E()),X={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...i.container},B={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.control},V={userSelect:"none",marginStart:u,...i.label};return a.jsxs(we.label,{className:"chakra-radio",...T,__css:X,children:[a.jsx("input",{className:"chakra-radio__input",...A}),a.jsx(we.span,{className:"chakra-radio__control",...D,__css:B}),p&&a.jsx(we.span,{className:"chakra-radio__label",...O,__css:V,children:p})]})});Ks.displayName="Radio";var q3=je(function(t,n){const{children:r,placeholder:o,className:s,...i}=t;return a.jsxs(we.select,{...i,ref:n,className:Ye("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});q3.displayName="SelectField";function LV(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var X3=je((e,t)=>{var n;const r=Un("Select",e),{rootProps:o,placeholder:s,icon:i,color:l,height:u,h:p,minH:m,minHeight:h,iconColor:g,iconSize:x,...y}=on(e),[b,w]=LV(y,tI),S=pb(w),j={width:"100%",height:"fit-content",position:"relative",color:l},_={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(we.div,{className:"chakra-select__wrapper",__css:j,...b,...o,children:[a.jsx(q3,{ref:t,height:p??u,minH:m??h,placeholder:s,...S,__css:_,children:e.children}),a.jsx(Q3,{"data-disabled":dt(S.disabled),...(g||l)&&{color:g||l},__css:r.icon,...x&&{fontSize:x},children:i})]})});X3.displayName="Select";var zV=e=>a.jsx("svg",{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),FV=we("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Q3=e=>{const{children:t=a.jsx(zV,{}),...n}=e,r=d.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return a.jsx(FV,{...n,className:"chakra-select__icon-wrapper",children:d.isValidElement(t)?r:null})};Q3.displayName="SelectIcon";function BV(){const e=d.useRef(!0);return d.useEffect(()=>{e.current=!1},[]),e.current}function HV(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var VV=we("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),H1=nI("skeleton-start-color"),V1=nI("skeleton-end-color"),WV=ma({from:{opacity:0},to:{opacity:1}}),UV=ma({from:{borderColor:H1.reference,background:H1.reference},to:{borderColor:V1.reference,background:V1.reference}}),Gh=je((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=oi("Skeleton",n),o=BV(),{startColor:s="",endColor:i="",isLoaded:l,fadeDuration:u,speed:p,className:m,fitContent:h,...g}=on(n),[x,y]=Ho("colors",[s,i]),b=HV(l),w=Ye("chakra-skeleton",m),S={...x&&{[H1.variable]:x},...y&&{[V1.variable]:y}};if(l){const j=o||b?"none":`${WV} ${u}s`;return a.jsx(we.div,{ref:t,className:w,__css:{animation:j},...g})}return a.jsx(VV,{ref:t,className:w,...g,__css:{width:h?"fit-content":void 0,...r,...S,_dark:{...r._dark,...S},animation:`${p}s linear infinite alternate ${UV}`}})});Gh.displayName="Skeleton";var ho=e=>e?"":void 0,uc=e=>e?!0:void 0,ii=(...e)=>e.filter(Boolean).join(" ");function dc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function GV(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Ru(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var zp={width:0,height:0},op=e=>e||zp;function Y3(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=b=>{var w;const S=(w=r[b])!=null?w:zp;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Ru({orientation:t,vertical:{bottom:`calc(${n[b]}% - ${S.height/2}px)`},horizontal:{left:`calc(${n[b]}% - ${S.width/2}px)`}})}},i=t==="vertical"?r.reduce((b,w)=>op(b).height>op(w).height?b:w,zp):r.reduce((b,w)=>op(b).width>op(w).width?b:w,zp),l={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Ru({orientation:t,vertical:i?{paddingLeft:i.width/2,paddingRight:i.width/2}:{},horizontal:i?{paddingTop:i.height/2,paddingBottom:i.height/2}:{}})},u={position:"absolute",...Ru({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},p=n.length===1,m=[0,o?100-n[0]:n[0]],h=p?m:n;let g=h[0];!p&&o&&(g=100-g);const x=Math.abs(h[h.length-1]-h[0]),y={...u,...Ru({orientation:t,vertical:o?{height:`${x}%`,top:`${g}%`}:{height:`${x}%`,bottom:`${g}%`},horizontal:o?{width:`${x}%`,right:`${g}%`}:{width:`${x}%`,left:`${g}%`}})};return{trackStyle:u,innerTrackStyle:y,rootStyle:l,getThumbStyle:s}}function Z3(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function KV(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function qV(e){const t=QV(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function J3(e){return!!e.touches}function XV(e){return J3(e)&&e.touches.length>1}function QV(e){var t;return(t=e.view)!=null?t:window}function YV(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function ZV(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function eP(e,t="page"){return J3(e)?YV(e,t):ZV(e,t)}function JV(e){return t=>{const n=qV(t);(!n||n&&t.button===0)&&e(t)}}function eW(e,t=!1){function n(o){e(o,{point:eP(o)})}return t?JV(n):n}function Fp(e,t,n,r){return KV(e,t,eW(n,t==="pointerdown"),r)}var tW=Object.defineProperty,nW=(e,t,n)=>t in e?tW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$o=(e,t,n)=>(nW(e,typeof t!="symbol"?t+"":t,n),n),rW=class{constructor(e,t,n){$o(this,"history",[]),$o(this,"startEvent",null),$o(this,"lastEvent",null),$o(this,"lastEventInfo",null),$o(this,"handlers",{}),$o(this,"removeListeners",()=>{}),$o(this,"threshold",3),$o(this,"win"),$o(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const l=xv(this.lastEventInfo,this.history),u=this.startEvent!==null,p=iW(l.offset,{x:0,y:0})>=this.threshold;if(!u&&!p)return;const{timestamp:m}=Yw();this.history.push({...l.point,timestamp:m});const{onStart:h,onMove:g}=this.handlers;u||(h==null||h(this.lastEvent,l),this.startEvent=this.lastEvent),g==null||g(this.lastEvent,l)}),$o(this,"onPointerMove",(l,u)=>{this.lastEvent=l,this.lastEventInfo=u,I$.update(this.updatePoint,!0)}),$o(this,"onPointerUp",(l,u)=>{const p=xv(u,this.history),{onEnd:m,onSessionEnd:h}=this.handlers;h==null||h(l,p),this.end(),!(!m||!this.startEvent)&&(m==null||m(l,p))});var r;if(this.win=(r=e.view)!=null?r:window,XV(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:eP(e)},{timestamp:s}=Yw();this.history=[{...o.point,timestamp:s}];const{onSessionStart:i}=t;i==null||i(e,xv(o,this.history)),this.removeListeners=aW(Fp(this.win,"pointermove",this.onPointerMove),Fp(this.win,"pointerup",this.onPointerUp),Fp(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),P$.update(this.updatePoint)}};function NS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xv(e,t){return{point:e.point,delta:NS(e.point,t[t.length-1]),offset:NS(e.point,t[0]),velocity:sW(t,.1)}}var oW=e=>e*1e3;function sW(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=e[e.length-1];for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>oW(t)));)n--;if(!r)return{x:0,y:0};const s=(o.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function aW(...e){return t=>e.reduce((n,r)=>r(n),t)}function bv(e,t){return Math.abs(e-t)}function $S(e){return"x"in e&&"y"in e}function iW(e,t){if(typeof e=="number"&&typeof t=="number")return bv(e,t);if($S(e)&&$S(t)){const n=bv(e.x,t.x),r=bv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function tP(e){const t=d.useRef(null);return t.current=e,t}function nP(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:i,threshold:l}=t,u=!!(n||r||o||s||i),p=d.useRef(null),m=tP({onSessionStart:s,onSessionEnd:i,onStart:r,onMove:n,onEnd(h,g){p.current=null,o==null||o(h,g)}});d.useEffect(()=>{var h;(h=p.current)==null||h.updateHandlers(m.current)}),d.useEffect(()=>{const h=e.current;if(!h||!u)return;function g(x){p.current=new rW(x,m.current,l)}return Fp(h,"pointerdown",g)},[e,u,m,l]),d.useEffect(()=>()=>{var h;(h=p.current)==null||h.end(),p.current=null},[])}function lW(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[s]=o;let i,l;if("borderBoxSize"in s){const u=s.borderBoxSize,p=Array.isArray(u)?u[0]:u;i=p.inlineSize,l=p.blockSize}else i=e.offsetWidth,l=e.offsetHeight;t({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var cW=globalThis!=null&&globalThis.document?d.useLayoutEffect:d.useEffect;function uW(e,t){var n,r;if(!e||!e.parentElement)return;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new o.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function rP({getNodes:e,observeMutation:t=!0}){const[n,r]=d.useState([]),[o,s]=d.useState(0);return cW(()=>{const i=e(),l=i.map((u,p)=>lW(u,m=>{r(h=>[...h.slice(0,p),m,...h.slice(p+1)])}));if(t){const u=i[0];l.push(uW(u,()=>{s(p=>p+1)}))}return()=>{l.forEach(u=>{u==null||u()})}},[o]),n}function dW(e){return typeof e=="object"&&e!==null&&"current"in e}function fW(e){const[t]=rP({observeMutation:!1,getNodes(){return[dW(e)?e.current:e]}});return t}function pW(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:i,direction:l="ltr",orientation:u="horizontal",id:p,isDisabled:m,isReadOnly:h,onChangeStart:g,onChangeEnd:x,step:y=1,getAriaValueText:b,"aria-valuetext":w,"aria-label":S,"aria-labelledby":j,name:_,focusThumbOnChange:E=!0,minStepsBetweenThumbs:I=0,...M}=e,R=dn(g),D=dn(x),A=dn(b),O=Z3({isReversed:i,direction:l,orientation:u}),[T,X]=_d({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray(T))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof T}\``);const[B,V]=d.useState(!1),[U,N]=d.useState(!1),[$,q]=d.useState(-1),F=!(m||h),Q=d.useRef(T),Y=T.map(ke=>ac(ke,t,n)),se=I*y,ae=mW(Y,t,n,se),re=d.useRef({eventSource:null,value:[],valueBounds:[]});re.current.value=Y,re.current.valueBounds=ae;const G=Y.map(ke=>n-ke+t),ee=(O?G:Y).map(ke=>om(ke,t,n)),ce=u==="vertical",J=d.useRef(null),ie=d.useRef(null),de=rP({getNodes(){const ke=ie.current,Be=ke==null?void 0:ke.querySelectorAll("[role=slider]");return Be?Array.from(Be):[]}}),ge=d.useId(),he=GV(p??ge),fe=d.useCallback(ke=>{var Be,ze;if(!J.current)return;re.current.eventSource="pointer";const Ge=J.current.getBoundingClientRect(),{clientX:pt,clientY:En}=(ze=(Be=ke.touches)==null?void 0:Be[0])!=null?ze:ke,Dt=ce?Ge.bottom-En:pt-Ge.left,At=ce?Ge.height:Ge.width;let pr=Dt/At;return O&&(pr=1-pr),m5(pr,t,n)},[ce,O,n,t]),Oe=(n-t)/10,_e=y||(n-t)/100,Ne=d.useMemo(()=>({setValueAtIndex(ke,Be){if(!F)return;const ze=re.current.valueBounds[ke];Be=parseFloat(P1(Be,ze.min,_e)),Be=ac(Be,ze.min,ze.max);const Ge=[...re.current.value];Ge[ke]=Be,X(Ge)},setActiveIndex:q,stepUp(ke,Be=_e){const ze=re.current.value[ke],Ge=O?ze-Be:ze+Be;Ne.setValueAtIndex(ke,Ge)},stepDown(ke,Be=_e){const ze=re.current.value[ke],Ge=O?ze+Be:ze-Be;Ne.setValueAtIndex(ke,Ge)},reset(){X(Q.current)}}),[_e,O,X,F]),nt=d.useCallback(ke=>{const Be=ke.key,Ge={ArrowRight:()=>Ne.stepUp($),ArrowUp:()=>Ne.stepUp($),ArrowLeft:()=>Ne.stepDown($),ArrowDown:()=>Ne.stepDown($),PageUp:()=>Ne.stepUp($,Oe),PageDown:()=>Ne.stepDown($,Oe),Home:()=>{const{min:pt}=ae[$];Ne.setValueAtIndex($,pt)},End:()=>{const{max:pt}=ae[$];Ne.setValueAtIndex($,pt)}}[Be];Ge&&(ke.preventDefault(),ke.stopPropagation(),Ge(ke),re.current.eventSource="keyboard")},[Ne,$,Oe,ae]),{getThumbStyle:$e,rootStyle:Pt,trackStyle:Ze,innerTrackStyle:ot}=d.useMemo(()=>Y3({isReversed:O,orientation:u,thumbRects:de,thumbPercents:ee}),[O,u,ee,de]),ye=d.useCallback(ke=>{var Be;const ze=ke??$;if(ze!==-1&&E){const Ge=he.getThumb(ze),pt=(Be=ie.current)==null?void 0:Be.ownerDocument.getElementById(Ge);pt&&setTimeout(()=>pt.focus())}},[E,$,he]);pa(()=>{re.current.eventSource==="keyboard"&&(D==null||D(re.current.value))},[Y,D]);const De=ke=>{const Be=fe(ke)||0,ze=re.current.value.map(At=>Math.abs(At-Be)),Ge=Math.min(...ze);let pt=ze.indexOf(Ge);const En=ze.filter(At=>At===Ge);En.length>1&&Be>re.current.value[pt]&&(pt=pt+En.length-1),q(pt),Ne.setValueAtIndex(pt,Be),ye(pt)},ut=ke=>{if($==-1)return;const Be=fe(ke)||0;q($),Ne.setValueAtIndex($,Be),ye($)};nP(ie,{onPanSessionStart(ke){F&&(V(!0),De(ke),R==null||R(re.current.value))},onPanSessionEnd(){F&&(V(!1),D==null||D(re.current.value))},onPan(ke){F&&ut(ke)}});const bt=d.useCallback((ke={},Be=null)=>({...ke,...M,id:he.root,ref:It(Be,ie),tabIndex:-1,"aria-disabled":uc(m),"data-focused":ho(U),style:{...ke.style,...Pt}}),[M,m,U,Pt,he]),be=d.useCallback((ke={},Be=null)=>({...ke,ref:It(Be,J),id:he.track,"data-disabled":ho(m),style:{...ke.style,...Ze}}),[m,Ze,he]),Je=d.useCallback((ke={},Be=null)=>({...ke,ref:Be,id:he.innerTrack,style:{...ke.style,...ot}}),[ot,he]),lt=d.useCallback((ke,Be=null)=>{var ze;const{index:Ge,...pt}=ke,En=Y[Ge];if(En==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${Ge}\`. The \`value\` or \`defaultValue\` length is : ${Y.length}`);const Dt=ae[Ge];return{...pt,ref:Be,role:"slider",tabIndex:F?0:void 0,id:he.getThumb(Ge),"data-active":ho(B&&$===Ge),"aria-valuetext":(ze=A==null?void 0:A(En))!=null?ze:w==null?void 0:w[Ge],"aria-valuemin":Dt.min,"aria-valuemax":Dt.max,"aria-valuenow":En,"aria-orientation":u,"aria-disabled":uc(m),"aria-readonly":uc(h),"aria-label":S==null?void 0:S[Ge],"aria-labelledby":S!=null&&S[Ge]||j==null?void 0:j[Ge],style:{...ke.style,...$e(Ge)},onKeyDown:dc(ke.onKeyDown,nt),onFocus:dc(ke.onFocus,()=>{N(!0),q(Ge)}),onBlur:dc(ke.onBlur,()=>{N(!1),q(-1)})}},[he,Y,ae,F,B,$,A,w,u,m,h,S,j,$e,nt,N]),ft=d.useCallback((ke={},Be=null)=>({...ke,ref:Be,id:he.output,htmlFor:Y.map((ze,Ge)=>he.getThumb(Ge)).join(" "),"aria-live":"off"}),[he,Y]),Me=d.useCallback((ke,Be=null)=>{const{value:ze,...Ge}=ke,pt=!(ze<t||ze>n),En=ze>=Y[0]&&ze<=Y[Y.length-1];let Dt=om(ze,t,n);Dt=O?100-Dt:Dt;const At={position:"absolute",pointerEvents:"none",...Ru({orientation:u,vertical:{bottom:`${Dt}%`},horizontal:{left:`${Dt}%`}})};return{...Ge,ref:Be,id:he.getMarker(ke.value),role:"presentation","aria-hidden":!0,"data-disabled":ho(m),"data-invalid":ho(!pt),"data-highlighted":ho(En),style:{...ke.style,...At}}},[m,O,n,t,u,Y,he]),Le=d.useCallback((ke,Be=null)=>{const{index:ze,...Ge}=ke;return{...Ge,ref:Be,id:he.getInput(ze),type:"hidden",value:Y[ze],name:Array.isArray(_)?_[ze]:`${_}-${ze}`}},[_,Y,he]);return{state:{value:Y,isFocused:U,isDragging:B,getThumbPercent:ke=>ee[ke],getThumbMinValue:ke=>ae[ke].min,getThumbMaxValue:ke=>ae[ke].max},actions:Ne,getRootProps:bt,getTrackProps:be,getInnerTrackProps:Je,getThumbProps:lt,getMarkerProps:Me,getInputProps:Le,getOutputProps:ft}}function mW(e,t,n,r){return e.map((o,s)=>{const i=s===0?t:e[s-1]+r,l=s===e.length-1?n:e[s+1]-r;return{min:i,max:l}})}var[hW,Kh]=Wt({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[gW,qh]=Wt({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),Vb=je(function(t,n){const r={orientation:"horizontal",...t},o=Un("Slider",r),s=on(r),{direction:i}=bd();s.direction=i;const{getRootProps:l,...u}=pW(s),p=d.useMemo(()=>({...u,name:r.name}),[u,r.name]);return a.jsx(hW,{value:p,children:a.jsx(gW,{value:o,children:a.jsx(we.div,{...l({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});Vb.displayName="RangeSlider";var nd=je(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Kh(),i=qh(),l=r(t,n);return a.jsxs(we.div,{...l,className:ii("chakra-slider__thumb",t.className),__css:i.thumb,children:[l.children,s&&a.jsx("input",{...o({index:t.index})})]})});nd.displayName="RangeSliderThumb";var Wb=je(function(t,n){const{getTrackProps:r}=Kh(),o=qh(),s=r(t,n);return a.jsx(we.div,{...s,className:ii("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});Wb.displayName="RangeSliderTrack";var Ub=je(function(t,n){const{getInnerTrackProps:r}=Kh(),o=qh(),s=r(t,n);return a.jsx(we.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});Ub.displayName="RangeSliderFilledTrack";var Ti=je(function(t,n){const{getMarkerProps:r}=Kh(),o=qh(),s=r(t,n);return a.jsx(we.div,{...s,className:ii("chakra-slider__marker",t.className),__css:o.mark})});Ti.displayName="RangeSliderMark";function vW(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:i,isReversed:l,direction:u="ltr",orientation:p="horizontal",id:m,isDisabled:h,isReadOnly:g,onChangeStart:x,onChangeEnd:y,step:b=1,getAriaValueText:w,"aria-valuetext":S,"aria-label":j,"aria-labelledby":_,name:E,focusThumbOnChange:I=!0,...M}=e,R=dn(x),D=dn(y),A=dn(w),O=Z3({isReversed:l,direction:u,orientation:p}),[T,X]=_d({value:s,defaultValue:i??bW(n,r),onChange:o}),[B,V]=d.useState(!1),[U,N]=d.useState(!1),$=!(h||g),q=(r-n)/10,F=b||(r-n)/100,Q=ac(T,n,r),Y=r-Q+n,ae=om(O?Y:Q,n,r),re=p==="vertical",G=tP({min:n,max:r,step:b,isDisabled:h,value:Q,isInteractive:$,isReversed:O,isVertical:re,eventSource:null,focusThumbOnChange:I,orientation:p}),K=d.useRef(null),ee=d.useRef(null),ce=d.useRef(null),J=d.useId(),ie=m??J,[de,ge]=[`slider-thumb-${ie}`,`slider-track-${ie}`],Ce=d.useCallback(Me=>{var Le,Ut;if(!K.current)return;const ke=G.current;ke.eventSource="pointer";const Be=K.current.getBoundingClientRect(),{clientX:ze,clientY:Ge}=(Ut=(Le=Me.touches)==null?void 0:Le[0])!=null?Ut:Me,pt=re?Be.bottom-Ge:ze-Be.left,En=re?Be.height:Be.width;let Dt=pt/En;O&&(Dt=1-Dt);let At=m5(Dt,ke.min,ke.max);return ke.step&&(At=parseFloat(P1(At,ke.min,ke.step))),At=ac(At,ke.min,ke.max),At},[re,O,G]),he=d.useCallback(Me=>{const Le=G.current;Le.isInteractive&&(Me=parseFloat(P1(Me,Le.min,F)),Me=ac(Me,Le.min,Le.max),X(Me))},[F,X,G]),fe=d.useMemo(()=>({stepUp(Me=F){const Le=O?Q-Me:Q+Me;he(Le)},stepDown(Me=F){const Le=O?Q+Me:Q-Me;he(Le)},reset(){he(i||0)},stepTo(Me){he(Me)}}),[he,O,Q,F,i]),Oe=d.useCallback(Me=>{const Le=G.current,ke={ArrowRight:()=>fe.stepUp(),ArrowUp:()=>fe.stepUp(),ArrowLeft:()=>fe.stepDown(),ArrowDown:()=>fe.stepDown(),PageUp:()=>fe.stepUp(q),PageDown:()=>fe.stepDown(q),Home:()=>he(Le.min),End:()=>he(Le.max)}[Me.key];ke&&(Me.preventDefault(),Me.stopPropagation(),ke(Me),Le.eventSource="keyboard")},[fe,he,q,G]),_e=(t=A==null?void 0:A(Q))!=null?t:S,Ne=fW(ee),{getThumbStyle:nt,rootStyle:$e,trackStyle:Pt,innerTrackStyle:Ze}=d.useMemo(()=>{const Me=G.current,Le=Ne??{width:0,height:0};return Y3({isReversed:O,orientation:Me.orientation,thumbRects:[Le],thumbPercents:[ae]})},[O,Ne,ae,G]),ot=d.useCallback(()=>{G.current.focusThumbOnChange&&setTimeout(()=>{var Le;return(Le=ee.current)==null?void 0:Le.focus()})},[G]);pa(()=>{const Me=G.current;ot(),Me.eventSource==="keyboard"&&(D==null||D(Me.value))},[Q,D]);function ye(Me){const Le=Ce(Me);Le!=null&&Le!==G.current.value&&X(Le)}nP(ce,{onPanSessionStart(Me){const Le=G.current;Le.isInteractive&&(V(!0),ot(),ye(Me),R==null||R(Le.value))},onPanSessionEnd(){const Me=G.current;Me.isInteractive&&(V(!1),D==null||D(Me.value))},onPan(Me){G.current.isInteractive&&ye(Me)}});const De=d.useCallback((Me={},Le=null)=>({...Me,...M,ref:It(Le,ce),tabIndex:-1,"aria-disabled":uc(h),"data-focused":ho(U),style:{...Me.style,...$e}}),[M,h,U,$e]),ut=d.useCallback((Me={},Le=null)=>({...Me,ref:It(Le,K),id:ge,"data-disabled":ho(h),style:{...Me.style,...Pt}}),[h,ge,Pt]),bt=d.useCallback((Me={},Le=null)=>({...Me,ref:Le,style:{...Me.style,...Ze}}),[Ze]),be=d.useCallback((Me={},Le=null)=>({...Me,ref:It(Le,ee),role:"slider",tabIndex:$?0:void 0,id:de,"data-active":ho(B),"aria-valuetext":_e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":Q,"aria-orientation":p,"aria-disabled":uc(h),"aria-readonly":uc(g),"aria-label":j,"aria-labelledby":j?void 0:_,style:{...Me.style,...nt(0)},onKeyDown:dc(Me.onKeyDown,Oe),onFocus:dc(Me.onFocus,()=>N(!0)),onBlur:dc(Me.onBlur,()=>N(!1))}),[$,de,B,_e,n,r,Q,p,h,g,j,_,nt,Oe]),Je=d.useCallback((Me,Le=null)=>{const Ut=!(Me.value<n||Me.value>r),ke=Q>=Me.value,Be=om(Me.value,n,r),ze={position:"absolute",pointerEvents:"none",...xW({orientation:p,vertical:{bottom:O?`${100-Be}%`:`${Be}%`},horizontal:{left:O?`${100-Be}%`:`${Be}%`}})};return{...Me,ref:Le,role:"presentation","aria-hidden":!0,"data-disabled":ho(h),"data-invalid":ho(!Ut),"data-highlighted":ho(ke),style:{...Me.style,...ze}}},[h,O,r,n,p,Q]),lt=d.useCallback((Me={},Le=null)=>({...Me,ref:Le,type:"hidden",value:Q,name:E}),[E,Q]);return{state:{value:Q,isFocused:U,isDragging:B},actions:fe,getRootProps:De,getTrackProps:ut,getInnerTrackProps:bt,getThumbProps:be,getMarkerProps:Je,getInputProps:lt}}function xW(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function bW(e,t){return t<e?e:e+(t-e)/2}var[yW,Xh]=Wt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[CW,Qh]=Wt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),Gb=je((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Un("Slider",r),s=on(r),{direction:i}=bd();s.direction=i;const{getInputProps:l,getRootProps:u,...p}=vW(s),m=u(),h=l({},t);return a.jsx(yW,{value:p,children:a.jsx(CW,{value:o,children:a.jsxs(we.div,{...m,className:ii("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...h})]})})})});Gb.displayName="Slider";var Kb=je((e,t)=>{const{getThumbProps:n}=Xh(),r=Qh(),o=n(e,t);return a.jsx(we.div,{...o,className:ii("chakra-slider__thumb",e.className),__css:r.thumb})});Kb.displayName="SliderThumb";var qb=je((e,t)=>{const{getTrackProps:n}=Xh(),r=Qh(),o=n(e,t);return a.jsx(we.div,{...o,className:ii("chakra-slider__track",e.className),__css:r.track})});qb.displayName="SliderTrack";var Xb=je((e,t)=>{const{getInnerTrackProps:n}=Xh(),r=Qh(),o=n(e,t);return a.jsx(we.div,{...o,className:ii("chakra-slider__filled-track",e.className),__css:r.filledTrack})});Xb.displayName="SliderFilledTrack";var Ul=je((e,t)=>{const{getMarkerProps:n}=Xh(),r=Qh(),o=n(e,t);return a.jsx(we.div,{...o,className:ii("chakra-slider__marker",e.className),__css:r.mark})});Ul.displayName="SliderMark";var[wW,oP]=Wt({name:"StatStylesContext",errorMessage:`useStatStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Stat />" `}),sP=je(function(t,n){const r=Un("Stat",t),o={position:"relative",flex:"1 1 0%",...r.container},{className:s,children:i,...l}=on(t);return a.jsx(wW,{value:r,children:a.jsx(we.div,{ref:n,...l,className:Ye("chakra-stat",s),__css:o,children:a.jsx("dl",{children:i})})})});sP.displayName="Stat";var aP=je(function(t,n){return a.jsx(we.div,{...t,ref:n,role:"group",className:Ye("chakra-stat__group",t.className),__css:{display:"flex",flexWrap:"wrap",justifyContent:"space-around",alignItems:"flex-start"}})});aP.displayName="StatGroup";var iP=je(function(t,n){const r=oP();return a.jsx(we.dt,{ref:n,...t,className:Ye("chakra-stat__label",t.className),__css:r.label})});iP.displayName="StatLabel";var lP=je(function(t,n){const r=oP();return a.jsx(we.dd,{ref:n,...t,className:Ye("chakra-stat__number",t.className),__css:{...r.number,fontFeatureSettings:"pnum",fontVariantNumeric:"proportional-nums"}})});lP.displayName="StatNumber";var Qb=je(function(t,n){const r=Un("Switch",t),{spacing:o="0.5rem",children:s,...i}=on(t),{getIndicatorProps:l,getInputProps:u,getCheckboxProps:p,getRootProps:m,getLabelProps:h}=p5(i),g=d.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),x=d.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),y=d.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return a.jsxs(we.label,{...m(),className:Ye("chakra-switch",t.className),__css:g,children:[a.jsx("input",{className:"chakra-switch__input",...u({},n)}),a.jsx(we.span,{...p(),className:"chakra-switch__track",__css:x,children:a.jsx(we.span,{__css:r.thumb,className:"chakra-switch__thumb",...l()})}),s&&a.jsx(we.span,{className:"chakra-switch__label",...h(),__css:y,children:s})]})});Qb.displayName="Switch";var[SW,kW,jW,_W]=ub();function IW(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:l="unmount",orientation:u="horizontal",direction:p="ltr",...m}=e,[h,g]=d.useState(n??0),[x,y]=_d({defaultValue:n??0,value:o,onChange:r});d.useEffect(()=>{o!=null&&g(o)},[o]);const b=jW(),w=d.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:x,focusedIndex:h,setSelectedIndex:y,setFocusedIndex:g,isManual:s,isLazy:i,lazyBehavior:l,orientation:u,descendants:b,direction:p,htmlProps:m}}var[PW,Yh]=Wt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function EW(e){const{focusedIndex:t,orientation:n,direction:r}=Yh(),o=kW(),s=d.useCallback(i=>{const l=()=>{var j;const _=o.nextEnabled(t);_&&((j=_.node)==null||j.focus())},u=()=>{var j;const _=o.prevEnabled(t);_&&((j=_.node)==null||j.focus())},p=()=>{var j;const _=o.firstEnabled();_&&((j=_.node)==null||j.focus())},m=()=>{var j;const _=o.lastEnabled();_&&((j=_.node)==null||j.focus())},h=n==="horizontal",g=n==="vertical",x=i.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",b=r==="ltr"?"ArrowRight":"ArrowLeft",S={[y]:()=>h&&u(),[b]:()=>h&&l(),ArrowDown:()=>g&&l(),ArrowUp:()=>g&&u(),Home:p,End:m}[x];S&&(i.preventDefault(),S(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:He(e.onKeyDown,s)}}function MW(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:l,selectedIndex:u}=Yh(),{index:p,register:m}=_W({disabled:t&&!n}),h=p===u,g=()=>{o(p)},x=()=>{l(p),!s&&!(t&&n)&&o(p)},y=m3({...r,ref:It(m,e.ref),isDisabled:t,isFocusable:n,onClick:He(e.onClick,g)}),b="button";return{...y,id:cP(i,p),role:"tab",tabIndex:h?0:-1,type:b,"aria-selected":h,"aria-controls":uP(i,p),onFocus:t?void 0:He(e.onFocus,x)}}var[OW,RW]=Wt({});function DW(e){const t=Yh(),{id:n,selectedIndex:r}=t,s=kh(e.children).map((i,l)=>d.createElement(OW,{key:l,value:{isSelected:l===r,id:uP(n,l),tabId:cP(n,l),selectedIndex:r}},i));return{...e,children:s}}function AW(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Yh(),{isSelected:s,id:i,tabId:l}=RW(),u=d.useRef(!1);s&&(u.current=!0);const p=Bb({wasSelected:u.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":l,hidden:!s,id:i}}function cP(e,t){return`${e}--tab-${t}`}function uP(e,t){return`${e}--tabpanel-${t}`}var[TW,Zh]=Wt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),rl=je(function(t,n){const r=Un("Tabs",t),{children:o,className:s,...i}=on(t),{htmlProps:l,descendants:u,...p}=IW(i),m=d.useMemo(()=>p,[p]),{isFitted:h,...g}=l;return a.jsx(SW,{value:u,children:a.jsx(PW,{value:m,children:a.jsx(TW,{value:r,children:a.jsx(we.div,{className:Ye("chakra-tabs",s),ref:n,...g,__css:r.root,children:o})})})})});rl.displayName="Tabs";var ol=je(function(t,n){const r=EW({...t,ref:n}),s={display:"flex",...Zh().tablist};return a.jsx(we.div,{...r,className:Ye("chakra-tabs__tablist",t.className),__css:s})});ol.displayName="TabList";var So=je(function(t,n){const r=AW({...t,ref:n}),o=Zh();return a.jsx(we.div,{outline:"0",...r,className:Ye("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});So.displayName="TabPanel";var zc=je(function(t,n){const r=DW(t),o=Zh();return a.jsx(we.div,{...r,width:"100%",ref:n,className:Ye("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});zc.displayName="TabPanels";var Tr=je(function(t,n){const r=Zh(),o=MW({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(we.button,{...o,className:Ye("chakra-tabs__tab",t.className),__css:s})});Tr.displayName="Tab";function NW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var $W=["h","minH","height","minHeight"],dP=je((e,t)=>{const n=oi("Textarea",e),{className:r,rows:o,...s}=on(e),i=pb(s),l=o?NW(n,$W):n;return a.jsx(we.textarea,{ref:t,rows:o,...i,className:Ye("chakra-textarea",r),__css:l})});dP.displayName="Textarea";var LW={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},W1=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Bp=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function zW(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:i=o,closeOnEsc:l=!0,onOpen:u,onClose:p,placement:m,id:h,isOpen:g,defaultIsOpen:x,arrowSize:y=10,arrowShadowColor:b,arrowPadding:w,modifiers:S,isDisabled:j,gutter:_,offset:E,direction:I,...M}=e,{isOpen:R,onOpen:D,onClose:A}=Fb({isOpen:g,defaultIsOpen:x,onOpen:u,onClose:p}),{referenceRef:O,getPopperProps:T,getArrowInnerProps:X,getArrowProps:B}=zb({enabled:R,placement:m,arrowPadding:w,modifiers:S,gutter:_,offset:E,direction:I}),V=d.useId(),N=`tooltip-${h??V}`,$=d.useRef(null),q=d.useRef(),F=d.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=void 0)},[]),Q=d.useRef(),Y=d.useCallback(()=>{Q.current&&(clearTimeout(Q.current),Q.current=void 0)},[]),se=d.useCallback(()=>{Y(),A()},[A,Y]),ae=FW($,se),re=d.useCallback(()=>{if(!j&&!q.current){R&&ae();const ge=Bp($);q.current=ge.setTimeout(D,t)}},[ae,j,R,D,t]),G=d.useCallback(()=>{F();const ge=Bp($);Q.current=ge.setTimeout(se,n)},[n,se,F]),K=d.useCallback(()=>{R&&r&&G()},[r,G,R]),ee=d.useCallback(()=>{R&&i&&G()},[i,G,R]),ce=d.useCallback(ge=>{R&&ge.key==="Escape"&&G()},[R,G]);Di(()=>W1($),"keydown",l?ce:void 0),Di(()=>{const ge=$.current;if(!ge)return null;const Ce=t3(ge);return Ce.localName==="body"?Bp($):Ce},"scroll",()=>{R&&s&&se()},{passive:!0,capture:!0}),d.useEffect(()=>{j&&(F(),R&&A())},[j,R,A,F]),d.useEffect(()=>()=>{F(),Y()},[F,Y]),Di(()=>$.current,"pointerleave",G);const J=d.useCallback((ge={},Ce=null)=>({...ge,ref:It($,Ce,O),onPointerEnter:He(ge.onPointerEnter,fe=>{fe.pointerType!=="touch"&&re()}),onClick:He(ge.onClick,K),onPointerDown:He(ge.onPointerDown,ee),onFocus:He(ge.onFocus,re),onBlur:He(ge.onBlur,G),"aria-describedby":R?N:void 0}),[re,G,ee,R,N,K,O]),ie=d.useCallback((ge={},Ce=null)=>T({...ge,style:{...ge.style,[$n.arrowSize.var]:y?`${y}px`:void 0,[$n.arrowShadowColor.var]:b}},Ce),[T,y,b]),de=d.useCallback((ge={},Ce=null)=>{const he={...ge.style,position:"relative",transformOrigin:$n.transformOrigin.varRef};return{ref:Ce,...M,...ge,id:N,role:"tooltip",style:he}},[M,N]);return{isOpen:R,show:re,hide:G,getTriggerProps:J,getTooltipProps:de,getTooltipPositionerProps:ie,getArrowProps:B,getArrowInnerProps:X}}var yv="chakra-ui:close-tooltip";function FW(e,t){return d.useEffect(()=>{const n=W1(e);return n.addEventListener(yv,t),()=>n.removeEventListener(yv,t)},[t,e]),()=>{const n=W1(e),r=Bp(e);n.dispatchEvent(new r.CustomEvent(yv))}}function BW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function HW(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var VW=we(In.div),Ft=je((e,t)=>{var n,r;const o=oi("Tooltip",e),s=on(e),i=bd(),{children:l,label:u,shouldWrapChildren:p,"aria-label":m,hasArrow:h,bg:g,portalProps:x,background:y,backgroundColor:b,bgColor:w,motionProps:S,...j}=s,_=(r=(n=y??b)!=null?n:g)!=null?r:w;if(_){o.bg=_;const T=BR(i,"colors",_);o[$n.arrowBg.var]=T}const E=zW({...j,direction:i.direction}),I=typeof l=="string"||p;let M;if(I)M=a.jsx(we.span,{display:"inline-block",tabIndex:0,...E.getTriggerProps(),children:l});else{const T=d.Children.only(l);M=d.cloneElement(T,E.getTriggerProps(T.props,T.ref))}const R=!!m,D=E.getTooltipProps({},t),A=R?BW(D,["role","id"]):D,O=HW(D,["role","id"]);return u?a.jsxs(a.Fragment,{children:[M,a.jsx(dr,{children:E.isOpen&&a.jsx(Ac,{...x,children:a.jsx(we.div,{...E.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(VW,{variants:LW,initial:"exit",animate:"enter",exit:"exit",...S,...A,__css:o,children:[u,R&&a.jsx(we.span,{srOnly:!0,...O,children:m}),h&&a.jsx(we.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(we.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:l})});Ft.displayName="Tooltip";function Jh(e,t={}){let n=d.useCallback(o=>t.keys?r$(e,t.keys,o):e.listen(o),[t.keys,e]),r=e.get.bind(e);return d.useSyncExternalStore(n,r,r)}const WW=le(xe,({system:e})=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),fP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=W(WW);return d.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${HR[t]}`)):localStorage.setItem("ROARR_LOG","false"),tw.ROARR.write=VR.createLogWriter()},[t,n]),d.useEffect(()=>{const o={...WR};UR.set(tw.Roarr.child(o))},[]),d.useMemo(()=>si(e),[e])},UW=()=>{const e=te(),t=W(r=>r.system.toastQueue),n=r5();return d.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(GR())},[e,n,t]),null},sl=()=>{const e=te();return d.useCallback(n=>e(ct(Qt(n))),[e])},GW=d.memo(UW);var KW=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Fd(e,t){var n=qW(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function qW(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=KW.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var XW=[".DS_Store","Thumbs.db"];function QW(e){return Tc(this,void 0,void 0,function(){return Nc(this,function(t){return um(e)&&YW(e.dataTransfer)?[2,tU(e.dataTransfer,e.type)]:ZW(e)?[2,JW(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,eU(e)]:[2,[]]})})}function YW(e){return um(e)}function ZW(e){return um(e)&&um(e.target)}function um(e){return typeof e=="object"&&e!==null}function JW(e){return U1(e.target.files).map(function(t){return Fd(t)})}function eU(e){return Tc(this,void 0,void 0,function(){var t;return Nc(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Fd(r)})]}})})}function tU(e,t){return Tc(this,void 0,void 0,function(){var n,r;return Nc(this,function(o){switch(o.label){case 0:return e.items?(n=U1(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(nU))]):[3,2];case 1:return r=o.sent(),[2,LS(pP(r))];case 2:return[2,LS(U1(e.files).map(function(s){return Fd(s)}))]}})})}function LS(e){return e.filter(function(t){return XW.indexOf(t.name)===-1})}function U1(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function nU(e){if(typeof e.webkitGetAsEntry!="function")return zS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?mP(t):zS(e)}function pP(e){return e.reduce(function(t,n){return M1(M1([],iS(t),!1),iS(Array.isArray(n)?pP(n):[n]),!1)},[])}function zS(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=Fd(t);return Promise.resolve(n)}function rU(e){return Tc(this,void 0,void 0,function(){return Nc(this,function(t){return[2,e.isDirectory?mP(e):oU(e)]})})}function mP(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(l){return Tc(i,void 0,void 0,function(){var u,p,m;return Nc(this,function(h){switch(h.label){case 0:if(l.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return u=h.sent(),n(u),[3,4];case 3:return p=h.sent(),r(p),[3,4];case 4:return[3,6];case 5:m=Promise.all(l.map(rU)),o.push(m),s(),h.label=6;case 6:return[2]}})})},function(l){r(l)})}s()})}function oU(e){return Tc(this,void 0,void 0,function(){return Nc(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=Fd(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var sU=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(i){var l=i.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?s===l.replace(/\/.*$/,""):o===l})}return!0};function FS(e){return lU(e)||iU(e)||gP(e)||aU()}function aU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lU(e){if(Array.isArray(e))return G1(e)}function BS(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 HS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BS(Object(n),!0).forEach(function(r){hP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rd(e,t){return dU(e)||uU(e,t)||gP(e,t)||cU()}function cU(){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 gP(e,t){if(e){if(typeof e=="string")return G1(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 G1(e,t)}}function G1(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 uU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,l;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function dU(e){if(Array.isArray(e))return e}var fU="file-invalid-type",pU="file-too-large",mU="file-too-small",hU="too-many-files",gU=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:fU,message:"File type must be ".concat(n)}},VS=function(t){return{code:pU,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},WS=function(t){return{code:mU,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},vU={code:hU,message:"Too many files"};function vP(e,t){var n=e.type==="application/x-moz-file"||sU(e,t);return[n,n?null:gU(t)]}function xP(e,t,n){if(Ii(e.size))if(Ii(t)&&Ii(n)){if(e.size>n)return[!1,VS(n)];if(e.size<t)return[!1,WS(t)]}else{if(Ii(t)&&e.size<t)return[!1,WS(t)];if(Ii(n)&&e.size>n)return[!1,VS(n)]}return[!0,null]}function Ii(e){return e!=null}function xU(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,l=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(u){var p=vP(u,n),m=rd(p,1),h=m[0],g=xP(u,r,o),x=rd(g,1),y=x[0],b=l?l(u):null;return h&&y&&!b})}function dm(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function sp(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 US(e){e.preventDefault()}function bU(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yU(e){return e.indexOf("Edge/")!==-1}function CU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return bU(e)||yU(e)}function ps(){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),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(l){return!dm(r)&&l&&l.apply(void 0,[r].concat(s)),dm(r)})}}function wU(){return"showOpenFilePicker"in window}function SU(e){if(Ii(e)){var t=Object.entries(e).filter(function(n){var r=rd(n,2),o=r[0],s=r[1],i=!0;return bP(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.')),i=!1),(!Array.isArray(s)||!s.every(yP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=rd(r,2),s=o[0],i=o[1];return HS(HS({},n),{},hP({},s,i))},{});return[{description:"Files",accept:t}]}return e}function kU(e){if(Ii(e))return Object.entries(e).reduce(function(t,n){var r=rd(n,2),o=r[0],s=r[1];return[].concat(FS(t),[o],FS(s))},[]).filter(function(t){return bP(t)||yP(t)}).join(",")}function jU(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function _U(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function bP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function yP(e){return/^.*\.[\w]+$/.test(e)}var IU=["children"],PU=["open"],EU=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],MU=["refKey","onChange","onClick"];function OU(e){return AU(e)||DU(e)||CP(e)||RU()}function RU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AU(e){if(Array.isArray(e))return K1(e)}function Cv(e,t){return $U(e)||NU(e,t)||CP(e,t)||TU()}function TU(){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 CP(e,t){if(e){if(typeof e=="string")return K1(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 K1(e,t)}}function K1(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 NU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,l;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function $U(e){if(Array.isArray(e))return e}function GS(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 bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GS(Object(n),!0).forEach(function(r){q1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fm(e,t){if(e==null)return{};var n=LU(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 LU(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 Yb=d.forwardRef(function(e,t){var n=e.children,r=fm(e,IU),o=Zb(r),s=o.open,i=fm(o,PU);return d.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(d.Fragment,null,n(bn(bn({},i),{},{open:s})))});Yb.displayName="Dropzone";var wP={disabled:!1,getFilesFromEvent:QW,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};Yb.defaultProps=wP;Yb.propTypes={children:Jt.func,accept:Jt.objectOf(Jt.arrayOf(Jt.string)),multiple:Jt.bool,preventDropOnDocument:Jt.bool,noClick:Jt.bool,noKeyboard:Jt.bool,noDrag:Jt.bool,noDragEventsBubbling:Jt.bool,minSize:Jt.number,maxSize:Jt.number,maxFiles:Jt.number,disabled:Jt.bool,getFilesFromEvent:Jt.func,onFileDialogCancel:Jt.func,onFileDialogOpen:Jt.func,useFsAccessApi:Jt.bool,autoFocus:Jt.bool,onDragEnter:Jt.func,onDragLeave:Jt.func,onDragOver:Jt.func,onDrop:Jt.func,onDropAccepted:Jt.func,onDropRejected:Jt.func,onError:Jt.func,validator:Jt.func};var X1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Zb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=bn(bn({},wP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,l=t.multiple,u=t.maxFiles,p=t.onDragEnter,m=t.onDragLeave,h=t.onDragOver,g=t.onDrop,x=t.onDropAccepted,y=t.onDropRejected,b=t.onFileDialogCancel,w=t.onFileDialogOpen,S=t.useFsAccessApi,j=t.autoFocus,_=t.preventDropOnDocument,E=t.noClick,I=t.noKeyboard,M=t.noDrag,R=t.noDragEventsBubbling,D=t.onError,A=t.validator,O=d.useMemo(function(){return kU(n)},[n]),T=d.useMemo(function(){return SU(n)},[n]),X=d.useMemo(function(){return typeof w=="function"?w:KS},[w]),B=d.useMemo(function(){return typeof b=="function"?b:KS},[b]),V=d.useRef(null),U=d.useRef(null),N=d.useReducer(zU,X1),$=Cv(N,2),q=$[0],F=$[1],Q=q.isFocused,Y=q.isFileDialogActive,se=d.useRef(typeof window<"u"&&window.isSecureContext&&S&&wU()),ae=function(){!se.current&&Y&&setTimeout(function(){if(U.current){var De=U.current.files;De.length||(F({type:"closeDialog"}),B())}},300)};d.useEffect(function(){return window.addEventListener("focus",ae,!1),function(){window.removeEventListener("focus",ae,!1)}},[U,Y,B,se]);var re=d.useRef([]),G=function(De){V.current&&V.current.contains(De.target)||(De.preventDefault(),re.current=[])};d.useEffect(function(){return _&&(document.addEventListener("dragover",US,!1),document.addEventListener("drop",G,!1)),function(){_&&(document.removeEventListener("dragover",US),document.removeEventListener("drop",G))}},[V,_]),d.useEffect(function(){return!r&&j&&V.current&&V.current.focus(),function(){}},[V,j,r]);var K=d.useCallback(function(ye){D?D(ye):console.error(ye)},[D]),ee=d.useCallback(function(ye){ye.preventDefault(),ye.persist(),$e(ye),re.current=[].concat(OU(re.current),[ye.target]),sp(ye)&&Promise.resolve(o(ye)).then(function(De){if(!(dm(ye)&&!R)){var ut=De.length,bt=ut>0&&xU({files:De,accept:O,minSize:i,maxSize:s,multiple:l,maxFiles:u,validator:A}),be=ut>0&&!bt;F({isDragAccept:bt,isDragReject:be,isDragActive:!0,type:"setDraggedFiles"}),p&&p(ye)}}).catch(function(De){return K(De)})},[o,p,K,R,O,i,s,l,u,A]),ce=d.useCallback(function(ye){ye.preventDefault(),ye.persist(),$e(ye);var De=sp(ye);if(De&&ye.dataTransfer)try{ye.dataTransfer.dropEffect="copy"}catch{}return De&&h&&h(ye),!1},[h,R]),J=d.useCallback(function(ye){ye.preventDefault(),ye.persist(),$e(ye);var De=re.current.filter(function(bt){return V.current&&V.current.contains(bt)}),ut=De.indexOf(ye.target);ut!==-1&&De.splice(ut,1),re.current=De,!(De.length>0)&&(F({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),sp(ye)&&m&&m(ye))},[V,m,R]),ie=d.useCallback(function(ye,De){var ut=[],bt=[];ye.forEach(function(be){var Je=vP(be,O),lt=Cv(Je,2),ft=lt[0],Me=lt[1],Le=xP(be,i,s),Ut=Cv(Le,2),ke=Ut[0],Be=Ut[1],ze=A?A(be):null;if(ft&&ke&&!ze)ut.push(be);else{var Ge=[Me,Be];ze&&(Ge=Ge.concat(ze)),bt.push({file:be,errors:Ge.filter(function(pt){return pt})})}}),(!l&&ut.length>1||l&&u>=1&&ut.length>u)&&(ut.forEach(function(be){bt.push({file:be,errors:[vU]})}),ut.splice(0)),F({acceptedFiles:ut,fileRejections:bt,type:"setFiles"}),g&&g(ut,bt,De),bt.length>0&&y&&y(bt,De),ut.length>0&&x&&x(ut,De)},[F,l,O,i,s,u,g,x,y,A]),de=d.useCallback(function(ye){ye.preventDefault(),ye.persist(),$e(ye),re.current=[],sp(ye)&&Promise.resolve(o(ye)).then(function(De){dm(ye)&&!R||ie(De,ye)}).catch(function(De){return K(De)}),F({type:"reset"})},[o,ie,K,R]),ge=d.useCallback(function(){if(se.current){F({type:"openDialog"}),X();var ye={multiple:l,types:T};window.showOpenFilePicker(ye).then(function(De){return o(De)}).then(function(De){ie(De,null),F({type:"closeDialog"})}).catch(function(De){jU(De)?(B(De),F({type:"closeDialog"})):_U(De)?(se.current=!1,U.current?(U.current.value=null,U.current.click()):K(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):K(De)});return}U.current&&(F({type:"openDialog"}),X(),U.current.value=null,U.current.click())},[F,X,B,S,ie,K,T,l]),Ce=d.useCallback(function(ye){!V.current||!V.current.isEqualNode(ye.target)||(ye.key===" "||ye.key==="Enter"||ye.keyCode===32||ye.keyCode===13)&&(ye.preventDefault(),ge())},[V,ge]),he=d.useCallback(function(){F({type:"focus"})},[]),fe=d.useCallback(function(){F({type:"blur"})},[]),Oe=d.useCallback(function(){E||(CU()?setTimeout(ge,0):ge())},[E,ge]),_e=function(De){return r?null:De},Ne=function(De){return I?null:_e(De)},nt=function(De){return M?null:_e(De)},$e=function(De){R&&De.stopPropagation()},Pt=d.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},De=ye.refKey,ut=De===void 0?"ref":De,bt=ye.role,be=ye.onKeyDown,Je=ye.onFocus,lt=ye.onBlur,ft=ye.onClick,Me=ye.onDragEnter,Le=ye.onDragOver,Ut=ye.onDragLeave,ke=ye.onDrop,Be=fm(ye,EU);return bn(bn(q1({onKeyDown:Ne(ps(be,Ce)),onFocus:Ne(ps(Je,he)),onBlur:Ne(ps(lt,fe)),onClick:_e(ps(ft,Oe)),onDragEnter:nt(ps(Me,ee)),onDragOver:nt(ps(Le,ce)),onDragLeave:nt(ps(Ut,J)),onDrop:nt(ps(ke,de)),role:typeof bt=="string"&&bt!==""?bt:"presentation"},ut,V),!r&&!I?{tabIndex:0}:{}),Be)}},[V,Ce,he,fe,Oe,ee,ce,J,de,I,M,r]),Ze=d.useCallback(function(ye){ye.stopPropagation()},[]),ot=d.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},De=ye.refKey,ut=De===void 0?"ref":De,bt=ye.onChange,be=ye.onClick,Je=fm(ye,MU),lt=q1({accept:O,multiple:l,type:"file",style:{display:"none"},onChange:_e(ps(bt,de)),onClick:_e(ps(be,Ze)),tabIndex:-1},ut,U);return bn(bn({},lt),Je)}},[U,n,l,de,r]);return bn(bn({},q),{},{isFocused:Q&&!r,getRootProps:Pt,getInputProps:ot,rootRef:V,inputRef:U,open:_e(ge)})}function zU(e,t){switch(t.type){case"focus":return bn(bn({},e),{},{isFocused:!0});case"blur":return bn(bn({},e),{},{isFocused:!1});case"openDialog":return bn(bn({},X1),{},{isFileDialogActive:!0});case"closeDialog":return bn(bn({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return bn(bn({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return bn(bn({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return bn({},X1);default:return e}}function KS(){}function Q1(){return Q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q1.apply(this,arguments)}var SP=["shift","alt","meta","mod","ctrl"],FU={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Va(e){return(FU[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function BU(e){return SP.includes(e)}function wv(e,t){return t===void 0&&(t=","),e.split(t)}function Sv(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return Va(i)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(i){return!SP.includes(i)});return Q1({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&kP([Va(e.key),Va(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&jP([Va(e.key),Va(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Wa.clear()})})();var Wa=new Set;function Jb(e){return Array.isArray(e)}function Hp(e,t){t===void 0&&(t=",");var n=Jb(e)?e:e.split(t);return n.every(function(r){return Wa.has(r.trim().toLowerCase())})}function kP(e){var t=Array.isArray(e)?e:[e];Wa.has("meta")&&Wa.forEach(function(n){return!BU(n)&&Wa.delete(n.toLowerCase())}),t.forEach(function(n){return Wa.add(n.toLowerCase())})}function jP(e){var t=Array.isArray(e)?e:[e];e==="meta"?Wa.clear():t.forEach(function(n){return Wa.delete(n.toLowerCase())})}function HU(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function VU(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function WU(e){return _P(e,["input","textarea","select"])}function _P(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return Jb(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function UU(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var GU=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,l=n.shift,u=n.ctrl,p=n.keys,m=t.key,h=t.code,g=t.ctrlKey,x=t.metaKey,y=t.shiftKey,b=t.altKey,w=Va(h),S=m.toLowerCase();if(!r){if(o===!b&&S!=="alt"||l===!y&&S!=="shift")return!1;if(i){if(!x&&!g)return!1}else if(s===!x&&S!=="meta"&&S!=="os"||u===!g&&S!=="ctrl"&&S!=="control")return!1}return p&&p.length===1&&(p.includes(S)||p.includes(w))?!0:p?Hp(p):!p},KU=d.createContext(void 0),qU=function(){return d.useContext(KU)};function IP(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&IP(e[r],t[r])},!0):e===t}var XU=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),QU=function(){return d.useContext(XU)};function YU(e){var t=d.useRef(void 0);return IP(t.current,e)||(t.current=e),t.current}var qS=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},ZU=typeof window<"u"?d.useLayoutEffect:d.useEffect;function et(e,t,n,r){var o=d.useRef(null),s=d.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,l=Jb(e)?e.join(i==null?void 0:i.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,p=d.useCallback(t,u??[]),m=d.useRef(p);u?m.current=p:m.current=t;var h=YU(i),g=QU(),x=g.enabledScopes,y=qU();return ZU(function(){if(!((h==null?void 0:h.enabled)===!1||!UU(x,h==null?void 0:h.scopes))){var b=function(E,I){var M;if(I===void 0&&(I=!1),!(WU(E)&&!_P(E,h==null?void 0:h.enableOnFormTags))&&!(h!=null&&h.ignoreEventWhen!=null&&h.ignoreEventWhen(E))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){qS(E);return}(M=E.target)!=null&&M.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||wv(l,h==null?void 0:h.splitKey).forEach(function(R){var D,A=Sv(R,h==null?void 0:h.combinationKey);if(GU(E,A,h==null?void 0:h.ignoreModifiers)||(D=A.keys)!=null&&D.includes("*")){if(I&&s.current)return;if(HU(E,A,h==null?void 0:h.preventDefault),!VU(E,A,h==null?void 0:h.enabled)){qS(E);return}m.current(E,A),I||(s.current=!0)}})}},w=function(E){E.key!==void 0&&(kP(Va(E.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&b(E))},S=function(E){E.key!==void 0&&(jP(Va(E.code)),s.current=!1,h!=null&&h.keyup&&b(E,!0))},j=o.current||(i==null?void 0:i.document)||document;return j.addEventListener("keyup",S),j.addEventListener("keydown",w),y&&wv(l,h==null?void 0:h.splitKey).forEach(function(_){return y.addHotkey(Sv(_,h==null?void 0:h.combinationKey,h==null?void 0:h.description))}),function(){j.removeEventListener("keyup",S),j.removeEventListener("keydown",w),y&&wv(l,h==null?void 0:h.splitKey).forEach(function(_){return y.removeHotkey(Sv(_,h==null?void 0:h.combinationKey,h==null?void 0:h.description))})}}},[l,h,x]),o}const JU=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return et("esc",()=>{r(!1)}),a.jsxs(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:[a.jsx(L,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:"base.700",_dark:{bg:"base.900"},opacity:.7,alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(L,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"full",height:"full",alignItems:"center",justifyContent:"center",p:4},children:a.jsx(L,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",flexDir:"column",gap:4,borderWidth:3,borderRadius:"xl",borderStyle:"dashed",color:"base.100",borderColor:"base.100",_dark:{borderColor:"base.200"}},children:t?a.jsx(cr,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(cr,{size:"lg",children:"Invalid Upload"}),a.jsx(cr,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},eG=d.memo(JU),tG=le([xe,Jn],({gallery:e},t)=>{let n={type:"TOAST"};t==="unifiedCanvas"&&(n={type:"SET_CANVAS_INITIAL_IMAGE"}),t==="img2img"&&(n={type:"SET_INITIAL_IMAGE"});const{autoAddBoardId:r}=e;return{autoAddBoardId:r,postUploadAction:n}},Se),nG=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=W(tG),o=sl(),{t:s}=Z(),[i,l]=d.useState(!1),[u]=rI(),p=d.useCallback(_=>{l(!0),o({title:s("toast.uploadFailed"),description:_.errors.map(E=>E.message).join(`
|
||
`),status:"error"})},[s,o]),m=d.useCallback(async _=>{u({file:_,image_category:"user",is_intermediate:!1,postUploadAction:r,board_id:n==="none"?void 0:n})},[n,r,u]),h=d.useCallback((_,E)=>{if(E.length>1){o({title:s("toast.uploadFailed"),description:s("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}E.forEach(I=>{p(I)}),_.forEach(I=>{m(I)})},[s,o,m,p]),g=d.useCallback(()=>{l(!0)},[]),{getRootProps:x,getInputProps:y,isDragAccept:b,isDragReject:w,isDragActive:S,inputRef:j}=Zb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:g,multiple:!1});return d.useEffect(()=>{const _=async E=>{var I,M;j.current&&(I=E.clipboardData)!=null&&I.files&&(j.current.files=E.clipboardData.files,(M=j.current)==null||M.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",_),()=>{document.removeEventListener("paste",_)}},[j]),a.jsxs(Ie,{...x({style:{}}),onKeyDown:_=>{_.key},children:[a.jsx("input",{...y()}),t,a.jsx(dr,{children:S&&i&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(eG,{isDragAccept:b,isDragReject:w,setIsHandlingUpload:l})},"image-upload-overlay")})]})},rG=d.memo(nG),oG=je((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:l,...u}=e;return a.jsx(Ft,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(Za,{ref:t,colorScheme:l?"accent":"base",...u,children:n})})}),at=d.memo(oG);function sG(e){const t=d.createContext(null);return[({children:o,value:s})=>H.createElement(t.Provider,{value:s},o),()=>{const o=d.useContext(t);if(o===null)throw new Error(e);return o}]}function PP(e){return Array.isArray(e)?e:[e]}const aG=()=>{};function iG(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||aG:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function EP({data:e}){const t=[],n=[],r=e.reduce((o,s,i)=>(s.group?o[s.group]?o[s.group].push(i):o[s.group]=[i]:n.push(i),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function MP(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function OP(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=OP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function RP(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=OP(t))&&(r&&(r+=" "),r+=n);return r}const lG={app:100,modal:200,popover:300,overlay:400,max:9999};function ey(e){return lG[e]}function cG(e,t){const n=d.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const uG=KR({key:"mantine",prepend:!0});function dG(){return XI()||uG}var fG=Object.defineProperty,XS=Object.getOwnPropertySymbols,pG=Object.prototype.hasOwnProperty,mG=Object.prototype.propertyIsEnumerable,QS=(e,t,n)=>t in e?fG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hG=(e,t)=>{for(var n in t||(t={}))pG.call(t,n)&&QS(e,n,t[n]);if(XS)for(var n of XS(t))mG.call(t,n)&&QS(e,n,t[n]);return e};const kv="ref";function gG(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(kv in n))return{args:e,ref:t};t=n[kv];const r=hG({},n);return delete r[kv],{args:[r],ref:t}}const{cssFactory:vG}=(()=>{function e(n,r,o){const s=[],i=QR(n,s,o);return s.length<2?o:i+r(s)}function t(n){const{cache:r}=n,o=(...i)=>{const{ref:l,args:u}=gG(i),p=qR(u,r.registered);return XR(r,p,!1),`${r.key}-${p.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...i)=>e(r.registered,o,RP(i))}}return{cssFactory:t}})();function DP(){const e=dG();return cG(()=>vG({cache:e}),[e])}function xG({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const i=n.reduce((l,u)=>(Object.keys(u.classNames).forEach(p=>{typeof l[p]!="string"?l[p]=`${u.classNames[p]}`:l[p]=`${l[p]} ${u.classNames[p]}`}),l),{});return Object.keys(t).reduce((l,u)=>(l[u]=e(t[u],i[u],r!=null&&r[u],Array.isArray(o)?o.filter(Boolean).map(p=>`${(s==null?void 0:s.key)||"mantine"}-${p}-${u}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${u}`:null),l),{})}var bG=Object.defineProperty,YS=Object.getOwnPropertySymbols,yG=Object.prototype.hasOwnProperty,CG=Object.prototype.propertyIsEnumerable,ZS=(e,t,n)=>t in e?bG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jv=(e,t)=>{for(var n in t||(t={}))yG.call(t,n)&&ZS(e,n,t[n]);if(YS)for(var n of YS(t))CG.call(t,n)&&ZS(e,n,t[n]);return e};function Y1(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=jv(jv({},e[n]),t[n]):e[n]=jv({},t[n])}),e}function JS(e,t,n,r){const o=s=>typeof s=="function"?s(t,n||{},r):s||{};return Array.isArray(e)?e.map(s=>o(s.styles)).reduce((s,i)=>Y1(s,i),{}):o(e)}function wG({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&Y1(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&Y1(s,i.sizes[o](t,n,{variant:r,size:o})),s),{})}function fr(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=xa(),i=F9(o==null?void 0:o.name),l=XI(),u={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:m}=DP(),h=t(s,r,u),g=JS(o==null?void 0:o.styles,s,r,u),x=JS(i,s,r,u),y=wG({ctx:i,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),b=Object.fromEntries(Object.keys(h).map(w=>{const S=m({[p(h[w])]:!(o!=null&&o.unstyled)},p(y[w]),p(x[w]),p(g[w]));return[w,S]}));return{classes:xG({cx:m,classes:b,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:m,theme:s}}return n}function e4(e){return`___ref-${e||""}`}var SG=Object.defineProperty,kG=Object.defineProperties,jG=Object.getOwnPropertyDescriptors,t4=Object.getOwnPropertySymbols,_G=Object.prototype.hasOwnProperty,IG=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?SG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wu=(e,t)=>{for(var n in t||(t={}))_G.call(t,n)&&n4(e,n,t[n]);if(t4)for(var n of t4(t))IG.call(t,n)&&n4(e,n,t[n]);return e},Su=(e,t)=>kG(e,jG(t));const ku={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Re(10)})`},transitionProperty:"transform, opacity"},ap={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${Re(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${Re(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Re(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Re(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Su(wu({},ku),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Su(wu({},ku),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Su(wu({},ku),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Su(wu({},ku),{common:{transformOrigin:"top left"}}),"pop-top-right":Su(wu({},ku),{common:{transformOrigin:"top right"}})},r4=["mousedown","touchstart"];function PG(e,t,n){const r=d.useRef();return d.useEffect(()=>{const o=s=>{const{target:i}=s??{};if(Array.isArray(n)){const l=(i==null?void 0:i.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(i)&&i.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!l&&e()}else r.current&&!r.current.contains(i)&&e()};return(t||r4).forEach(s=>document.addEventListener(s,o)),()=>{(t||r4).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function EG(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function MG(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function OG(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=d.useState(n?t:MG(e,t)),s=d.useRef();return d.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),EG(s.current,i=>o(i.matches))},[e]),r}const AP=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Uo(e,t){const n=d.useRef(!1);d.useEffect(()=>()=>{n.current=!1},[]),d.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function RG({opened:e,shouldReturnFocus:t=!0}){const n=d.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Uo(()=>{let o=-1;const s=i=>{i.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const DG=/input|select|textarea|button|object/,TP="a, input, select, textarea, button, object, [tabindex]";function AG(e){return e.style.display==="none"}function TG(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(AG(n))return!1;n=n.parentNode}return!0}function NP(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Z1(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(NP(e));return(DG.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&TG(e)}function $P(e){const t=NP(e);return(Number.isNaN(t)||t>=0)&&Z1(e)}function NG(e){return Array.from(e.querySelectorAll(TP)).filter($P)}function $G(e,t){const n=NG(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const i=n[t.shiftKey?n.length-1:0];i&&i.focus()}function ty(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function LG(e,t="body > :not(script)"){const n=ty(),r=Array.from(document.querySelectorAll(t)).map(o=>{var s;if((s=o==null?void 0:o.shadowRoot)!=null&&s.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),u=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!l&&!u&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:l||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function zG(e=!0){const t=d.useRef(),n=d.useRef(null),r=s=>{let i=s.querySelector("[data-autofocus]");if(!i){const l=Array.from(s.querySelectorAll(TP));i=l.find($P)||l.find(Z1)||null,!i&&Z1(s)&&(i=s)}i&&i.focus({preventScroll:!0})},o=d.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=LG(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return d.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=i=>{i.key==="Tab"&&t.current&&$G(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const FG=H["useId".toString()]||(()=>{});function BG(){const e=FG();return e?`mantine-${e.replace(/:/g,"")}`:""}function ny(e){const t=BG(),[n,r]=d.useState(t);return AP(()=>{r(ty())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function o4(e,t,n){d.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function LP(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function HG(...e){return t=>{e.forEach(n=>LP(n,t))}}function Bd(...e){return d.useCallback(HG(...e),e)}function od({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=d.useState(t!==void 0?t:n),i=l=>{s(l),r==null||r(l)};return e!==void 0?[e,r,!0]:[o,i,!1]}function zP(e,t){return OG("(prefers-reduced-motion: reduce)",e,t)}const VG=e=>e<.5?2*e*e:-1+(4-2*e)*e,WG=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const i=!!n,u=(n||document.body).getBoundingClientRect(),p=t.getBoundingClientRect(),m=h=>p[h]-u[h];if(e==="y"){const h=m("top");if(h===0)return 0;if(r==="start"){const x=h-o;return x<=p.height*(s?0:1)||!s?x:0}const g=i?u.height:window.innerHeight;if(r==="end"){const x=h+o-g+p.height;return x>=-p.height*(s?0:1)||!s?x:0}return r==="center"?h-g/2+p.height/2:0}if(e==="x"){const h=m("left");if(h===0)return 0;if(r==="start"){const x=h-o;return x<=p.width||!s?x:0}const g=i?u.width:window.innerWidth;if(r==="end"){const x=h+o-g+p.width;return x>=-p.width||!s?x:0}return r==="center"?h-g/2+p.width/2:0}return 0},UG=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:o}=document;return r[n]+o[n]},GG=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:o,documentElement:s}=document;o[r]=n,s[r]=n}};function FP({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=VG,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const l=d.useRef(0),u=d.useRef(0),p=d.useRef(!1),m=d.useRef(null),h=d.useRef(null),g=zP(),x=()=>{l.current&&cancelAnimationFrame(l.current)},y=d.useCallback(({alignment:w="start"}={})=>{var S;p.current=!1,l.current&&x();const j=(S=UG({parent:m.current,axis:t}))!=null?S:0,_=WG({parent:m.current,target:h.current,axis:t,alignment:w,offset:o,isList:i})-(m.current?0:j);function E(){u.current===0&&(u.current=performance.now());const M=performance.now()-u.current,R=g||e===0?1:M/e,D=j+_*r(R);GG({parent:m.current,axis:t,distance:D}),!p.current&&R<1?l.current=requestAnimationFrame(E):(typeof n=="function"&&n(),u.current=0,l.current=0,x())}E()},[t,e,r,i,o,n,g]),b=()=>{s&&(p.current=!0)};return o4("wheel",b,{passive:!0}),o4("touchmove",b,{passive:!0}),d.useEffect(()=>x,[]),{scrollableRef:m,targetRef:h,scrollIntoView:y,cancel:x}}var s4=Object.getOwnPropertySymbols,KG=Object.prototype.hasOwnProperty,qG=Object.prototype.propertyIsEnumerable,XG=(e,t)=>{var n={};for(var r in e)KG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&s4)for(var r of s4(e))t.indexOf(r)<0&&qG.call(e,r)&&(n[r]=e[r]);return n};function eg(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:u,p,px:m,py:h,pt:g,pb:x,pl:y,pr:b,bg:w,c:S,opacity:j,ff:_,fz:E,fw:I,lts:M,ta:R,lh:D,fs:A,tt:O,td:T,w:X,miw:B,maw:V,h:U,mih:N,mah:$,bgsz:q,bgp:F,bgr:Q,bga:Y,pos:se,top:ae,left:re,bottom:G,right:K,inset:ee,display:ce}=t,J=XG(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:B9({m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:u,p,px:m,py:h,pt:g,pb:x,pl:y,pr:b,bg:w,c:S,opacity:j,ff:_,fz:E,fw:I,lts:M,ta:R,lh:D,fs:A,tt:O,td:T,w:X,miw:B,maw:V,h:U,mih:N,mah:$,bgsz:q,bgp:F,bgr:Q,bga:Y,pos:se,top:ae,left:re,bottom:G,right:K,inset:ee,display:ce}),rest:J}}function QG(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>Kw(mt({size:r,sizes:t.breakpoints}))-Kw(mt({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function YG({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return QG(e,t).reduce((i,l)=>{if(l==="base"&&e.base!==void 0){const p=n(e.base,t);return Array.isArray(r)?(r.forEach(m=>{i[m]=p}),i):(i[r]=p,i)}const u=n(e[l],t);return Array.isArray(r)?(i[t.fn.largerThan(l)]={},r.forEach(p=>{i[t.fn.largerThan(l)][p]=u}),i):(i[t.fn.largerThan(l)]={[r]:u},i)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,i)=>(s[i]=o,s),{}):{[r]:o}}function ZG(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function JG(e){return Re(e)}function eK(e){return e}function tK(e,t){return mt({size:e,sizes:t.fontSizes})}const nK=["-xs","-sm","-md","-lg","-xl"];function rK(e,t){return nK.includes(e)?`calc(${mt({size:e.replace("-",""),sizes:t.spacing})} * -1)`:mt({size:e,sizes:t.spacing})}const oK={identity:eK,color:ZG,size:JG,fontSize:tK,spacing:rK},sK={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var aK=Object.defineProperty,a4=Object.getOwnPropertySymbols,iK=Object.prototype.hasOwnProperty,lK=Object.prototype.propertyIsEnumerable,i4=(e,t,n)=>t in e?aK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l4=(e,t)=>{for(var n in t||(t={}))iK.call(t,n)&&i4(e,n,t[n]);if(a4)for(var n of a4(t))lK.call(t,n)&&i4(e,n,t[n]);return e};function c4(e,t,n=sK){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(YG({value:e[s],getValue:oK[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(i=>{typeof s[i]=="object"&&s[i]!==null&&i in o?o[i]=l4(l4({},o[i]),s[i]):o[i]=s[i]}),o),{})}function u4(e,t){return typeof e=="function"?e(t):e}function cK(e,t,n){const r=xa(),{css:o,cx:s}=DP();return Array.isArray(e)?s(n,o(c4(t,r)),e.map(i=>o(u4(i,r)))):s(n,o(u4(e,r)),o(c4(t,r)))}var uK=Object.defineProperty,pm=Object.getOwnPropertySymbols,BP=Object.prototype.hasOwnProperty,HP=Object.prototype.propertyIsEnumerable,d4=(e,t,n)=>t in e?uK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dK=(e,t)=>{for(var n in t||(t={}))BP.call(t,n)&&d4(e,n,t[n]);if(pm)for(var n of pm(t))HP.call(t,n)&&d4(e,n,t[n]);return e},fK=(e,t)=>{var n={};for(var r in e)BP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pm)for(var r of pm(e))t.indexOf(r)<0&&HP.call(e,r)&&(n[r]=e[r]);return n};const VP=d.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,l=fK(n,["className","component","style","sx"]);const{systemStyles:u,rest:p}=eg(l),m=o||"div";return H.createElement(m,dK({ref:t,className:cK(i,u,r),style:s},p))});VP.displayName="@mantine/core/Box";const zr=VP;var pK=Object.defineProperty,mK=Object.defineProperties,hK=Object.getOwnPropertyDescriptors,f4=Object.getOwnPropertySymbols,gK=Object.prototype.hasOwnProperty,vK=Object.prototype.propertyIsEnumerable,p4=(e,t,n)=>t in e?pK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m4=(e,t)=>{for(var n in t||(t={}))gK.call(t,n)&&p4(e,n,t[n]);if(f4)for(var n of f4(t))vK.call(t,n)&&p4(e,n,t[n]);return e},xK=(e,t)=>mK(e,hK(t)),bK=fr(e=>({root:xK(m4(m4({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const yK=bK;var CK=Object.defineProperty,mm=Object.getOwnPropertySymbols,WP=Object.prototype.hasOwnProperty,UP=Object.prototype.propertyIsEnumerable,h4=(e,t,n)=>t in e?CK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wK=(e,t)=>{for(var n in t||(t={}))WP.call(t,n)&&h4(e,n,t[n]);if(mm)for(var n of mm(t))UP.call(t,n)&&h4(e,n,t[n]);return e},SK=(e,t)=>{var n={};for(var r in e)WP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mm)for(var r of mm(e))t.indexOf(r)<0&&UP.call(e,r)&&(n[r]=e[r]);return n};const GP=d.forwardRef((e,t)=>{const n=Dn("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,l=SK(n,["className","component","unstyled","variant"]),{classes:u,cx:p}=yK(null,{name:"UnstyledButton",unstyled:s,variant:i});return H.createElement(zr,wK({component:o,ref:t,className:p(u.root,r),type:o==="button"?"button":void 0},l))});GP.displayName="@mantine/core/UnstyledButton";const kK=GP;var jK=Object.defineProperty,_K=Object.defineProperties,IK=Object.getOwnPropertyDescriptors,g4=Object.getOwnPropertySymbols,PK=Object.prototype.hasOwnProperty,EK=Object.prototype.propertyIsEnumerable,v4=(e,t,n)=>t in e?jK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J1=(e,t)=>{for(var n in t||(t={}))PK.call(t,n)&&v4(e,n,t[n]);if(g4)for(var n of g4(t))EK.call(t,n)&&v4(e,n,t[n]);return e},x4=(e,t)=>_K(e,IK(t));const MK=["subtle","filled","outline","light","default","transparent","gradient"],ip={xs:Re(18),sm:Re(22),md:Re(28),lg:Re(34),xl:Re(44)};function OK({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:MK.includes(e)?J1({border:`${Re(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var RK=fr((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:x4(J1({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:mt({size:s,sizes:ip}),minHeight:mt({size:s,sizes:ip}),width:mt({size:s,sizes:ip}),minWidth:mt({size:s,sizes:ip})},OK({variant:o,theme:e,color:n,gradient:r})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":x4(J1({content:'""'},e.fn.cover(Re(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const DK=RK;var AK=Object.defineProperty,hm=Object.getOwnPropertySymbols,KP=Object.prototype.hasOwnProperty,qP=Object.prototype.propertyIsEnumerable,b4=(e,t,n)=>t in e?AK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y4=(e,t)=>{for(var n in t||(t={}))KP.call(t,n)&&b4(e,n,t[n]);if(hm)for(var n of hm(t))qP.call(t,n)&&b4(e,n,t[n]);return e},C4=(e,t)=>{var n={};for(var r in e)KP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hm)for(var r of hm(e))t.indexOf(r)<0&&qP.call(e,r)&&(n[r]=e[r]);return n};function TK(e){var t=e,{size:n,color:r}=t,o=C4(t,["size","color"]);const s=o,{style:i}=s,l=C4(s,["style"]);return H.createElement("svg",y4({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:y4({width:n},i)},l),H.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var NK=Object.defineProperty,gm=Object.getOwnPropertySymbols,XP=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable,w4=(e,t,n)=>t in e?NK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S4=(e,t)=>{for(var n in t||(t={}))XP.call(t,n)&&w4(e,n,t[n]);if(gm)for(var n of gm(t))QP.call(t,n)&&w4(e,n,t[n]);return e},k4=(e,t)=>{var n={};for(var r in e)XP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gm)for(var r of gm(e))t.indexOf(r)<0&&QP.call(e,r)&&(n[r]=e[r]);return n};function $K(e){var t=e,{size:n,color:r}=t,o=k4(t,["size","color"]);const s=o,{style:i}=s,l=k4(s,["style"]);return H.createElement("svg",S4({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:S4({width:n,height:n},i)},l),H.createElement("g",{fill:"none",fillRule:"evenodd"},H.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},H.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),H.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},H.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var LK=Object.defineProperty,vm=Object.getOwnPropertySymbols,YP=Object.prototype.hasOwnProperty,ZP=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?LK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_4=(e,t)=>{for(var n in t||(t={}))YP.call(t,n)&&j4(e,n,t[n]);if(vm)for(var n of vm(t))ZP.call(t,n)&&j4(e,n,t[n]);return e},I4=(e,t)=>{var n={};for(var r in e)YP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vm)for(var r of vm(e))t.indexOf(r)<0&&ZP.call(e,r)&&(n[r]=e[r]);return n};function zK(e){var t=e,{size:n,color:r}=t,o=I4(t,["size","color"]);const s=o,{style:i}=s,l=I4(s,["style"]);return H.createElement("svg",_4({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:_4({width:n},i)},l),H.createElement("circle",{cx:"15",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},H.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"105",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var FK=Object.defineProperty,xm=Object.getOwnPropertySymbols,JP=Object.prototype.hasOwnProperty,e6=Object.prototype.propertyIsEnumerable,P4=(e,t,n)=>t in e?FK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BK=(e,t)=>{for(var n in t||(t={}))JP.call(t,n)&&P4(e,n,t[n]);if(xm)for(var n of xm(t))e6.call(t,n)&&P4(e,n,t[n]);return e},HK=(e,t)=>{var n={};for(var r in e)JP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xm)for(var r of xm(e))t.indexOf(r)<0&&e6.call(e,r)&&(n[r]=e[r]);return n};const _v={bars:TK,oval:$K,dots:zK},VK={xs:Re(18),sm:Re(22),md:Re(36),lg:Re(44),xl:Re(58)},WK={size:"md"};function t6(e){const t=Dn("Loader",WK,e),{size:n,color:r,variant:o}=t,s=HK(t,["size","color","variant"]),i=xa(),l=o in _v?o:i.loader;return H.createElement(zr,BK({role:"presentation",component:_v[l]||_v.bars,size:mt({size:n,sizes:VK}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}t6.displayName="@mantine/core/Loader";var UK=Object.defineProperty,bm=Object.getOwnPropertySymbols,n6=Object.prototype.hasOwnProperty,r6=Object.prototype.propertyIsEnumerable,E4=(e,t,n)=>t in e?UK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M4=(e,t)=>{for(var n in t||(t={}))n6.call(t,n)&&E4(e,n,t[n]);if(bm)for(var n of bm(t))r6.call(t,n)&&E4(e,n,t[n]);return e},GK=(e,t)=>{var n={};for(var r in e)n6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bm)for(var r of bm(e))t.indexOf(r)<0&&r6.call(e,r)&&(n[r]=e[r]);return n};const KK={color:"gray",size:"md",variant:"subtle"},o6=d.forwardRef((e,t)=>{const n=Dn("ActionIcon",KK,e),{className:r,color:o,children:s,radius:i,size:l,variant:u,gradient:p,disabled:m,loaderProps:h,loading:g,unstyled:x,__staticSelector:y}=n,b=GK(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:w,cx:S,theme:j}=DK({radius:i,color:o,gradient:p},{name:["ActionIcon",y],unstyled:x,size:l,variant:u}),_=H.createElement(t6,M4({color:j.fn.variant({color:o,variant:u}).color,size:"100%","data-action-icon-loader":!0},h));return H.createElement(kK,M4({className:S(w.root,r),ref:t,disabled:m,"data-disabled":m||void 0,"data-loading":g||void 0,unstyled:x},b),g?_:s)});o6.displayName="@mantine/core/ActionIcon";const qK=o6;var XK=Object.defineProperty,QK=Object.defineProperties,YK=Object.getOwnPropertyDescriptors,ym=Object.getOwnPropertySymbols,s6=Object.prototype.hasOwnProperty,a6=Object.prototype.propertyIsEnumerable,O4=(e,t,n)=>t in e?XK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZK=(e,t)=>{for(var n in t||(t={}))s6.call(t,n)&&O4(e,n,t[n]);if(ym)for(var n of ym(t))a6.call(t,n)&&O4(e,n,t[n]);return e},JK=(e,t)=>QK(e,YK(t)),eq=(e,t)=>{var n={};for(var r in e)s6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ym)for(var r of ym(e))t.indexOf(r)<0&&a6.call(e,r)&&(n[r]=e[r]);return n};function i6(e){const t=Dn("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=eq(t,["children","target","className","innerRef"]),l=xa(),[u,p]=d.useState(!1),m=d.useRef();return AP(()=>(p(!0),m.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(m.current),()=>{!r&&document.body.removeChild(m.current)}),[r]),u?qr.createPortal(H.createElement("div",JK(ZK({className:o,dir:l.dir},i),{ref:s}),n),m.current):null}i6.displayName="@mantine/core/Portal";var tq=Object.defineProperty,Cm=Object.getOwnPropertySymbols,l6=Object.prototype.hasOwnProperty,c6=Object.prototype.propertyIsEnumerable,R4=(e,t,n)=>t in e?tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nq=(e,t)=>{for(var n in t||(t={}))l6.call(t,n)&&R4(e,n,t[n]);if(Cm)for(var n of Cm(t))c6.call(t,n)&&R4(e,n,t[n]);return e},rq=(e,t)=>{var n={};for(var r in e)l6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cm)for(var r of Cm(e))t.indexOf(r)<0&&c6.call(e,r)&&(n[r]=e[r]);return n};function u6(e){var t=e,{withinPortal:n=!0,children:r}=t,o=rq(t,["withinPortal","children"]);return n?H.createElement(i6,nq({},o),r):H.createElement(H.Fragment,null,r)}u6.displayName="@mantine/core/OptionalPortal";var oq=Object.defineProperty,wm=Object.getOwnPropertySymbols,d6=Object.prototype.hasOwnProperty,f6=Object.prototype.propertyIsEnumerable,D4=(e,t,n)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A4=(e,t)=>{for(var n in t||(t={}))d6.call(t,n)&&D4(e,n,t[n]);if(wm)for(var n of wm(t))f6.call(t,n)&&D4(e,n,t[n]);return e},sq=(e,t)=>{var n={};for(var r in e)d6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wm)for(var r of wm(e))t.indexOf(r)<0&&f6.call(e,r)&&(n[r]=e[r]);return n};function p6(e){const t=e,{width:n,height:r,style:o}=t,s=sq(t,["width","height","style"]);return H.createElement("svg",A4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:A4({width:n,height:r},o)},s),H.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}p6.displayName="@mantine/core/CloseIcon";var aq=Object.defineProperty,Sm=Object.getOwnPropertySymbols,m6=Object.prototype.hasOwnProperty,h6=Object.prototype.propertyIsEnumerable,T4=(e,t,n)=>t in e?aq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iq=(e,t)=>{for(var n in t||(t={}))m6.call(t,n)&&T4(e,n,t[n]);if(Sm)for(var n of Sm(t))h6.call(t,n)&&T4(e,n,t[n]);return e},lq=(e,t)=>{var n={};for(var r in e)m6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sm)for(var r of Sm(e))t.indexOf(r)<0&&h6.call(e,r)&&(n[r]=e[r]);return n};const cq={xs:Re(12),sm:Re(16),md:Re(20),lg:Re(28),xl:Re(34)},uq={size:"sm"},g6=d.forwardRef((e,t)=>{const n=Dn("CloseButton",uq,e),{iconSize:r,size:o,children:s}=n,i=lq(n,["iconSize","size","children"]),l=Re(r||cq[o]);return H.createElement(qK,iq({ref:t,__staticSelector:"CloseButton",size:o},i),s||H.createElement(p6,{width:l,height:l}))});g6.displayName="@mantine/core/CloseButton";const v6=g6;var dq=Object.defineProperty,fq=Object.defineProperties,pq=Object.getOwnPropertyDescriptors,N4=Object.getOwnPropertySymbols,mq=Object.prototype.hasOwnProperty,hq=Object.prototype.propertyIsEnumerable,$4=(e,t,n)=>t in e?dq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lp=(e,t)=>{for(var n in t||(t={}))mq.call(t,n)&&$4(e,n,t[n]);if(N4)for(var n of N4(t))hq.call(t,n)&&$4(e,n,t[n]);return e},gq=(e,t)=>fq(e,pq(t));function vq({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function xq({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function bq(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function yq({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var Cq=fr((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:l,weight:u,transform:p,align:m,strikethrough:h,italic:g},{size:x})=>{const y=e.fn.variant({variant:"gradient",gradient:l});return{root:gq(lp(lp(lp(lp({},e.fn.fontStyles()),e.fn.focusStyles()),bq(n)),yq({theme:e,truncate:r})),{color:xq({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||x===void 0?"inherit":mt({size:x,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:vq({underline:i,strikethrough:h}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":u,textTransform:p,textAlign:m,fontStyle:g?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const wq=Cq;var Sq=Object.defineProperty,km=Object.getOwnPropertySymbols,x6=Object.prototype.hasOwnProperty,b6=Object.prototype.propertyIsEnumerable,L4=(e,t,n)=>t in e?Sq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kq=(e,t)=>{for(var n in t||(t={}))x6.call(t,n)&&L4(e,n,t[n]);if(km)for(var n of km(t))b6.call(t,n)&&L4(e,n,t[n]);return e},jq=(e,t)=>{var n={};for(var r in e)x6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&km)for(var r of km(e))t.indexOf(r)<0&&b6.call(e,r)&&(n[r]=e[r]);return n};const _q={variant:"text"},y6=d.forwardRef((e,t)=>{const n=Dn("Text",_q,e),{className:r,size:o,weight:s,transform:i,color:l,align:u,variant:p,lineClamp:m,truncate:h,gradient:g,inline:x,inherit:y,underline:b,strikethrough:w,italic:S,classNames:j,styles:_,unstyled:E,span:I,__staticSelector:M}=n,R=jq(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:D,cx:A}=wq({color:l,lineClamp:m,truncate:h,inline:x,inherit:y,underline:b,strikethrough:w,italic:S,weight:s,transform:i,align:u,gradient:g},{unstyled:E,name:M||"Text",variant:p,size:o});return H.createElement(zr,kq({ref:t,className:A(D.root,{[D.gradient]:p==="gradient"},r),component:I?"span":"div"},R))});y6.displayName="@mantine/core/Text";const wc=y6,cp={xs:Re(1),sm:Re(2),md:Re(3),lg:Re(4),xl:Re(5)};function up(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var Iq=fr((e,{color:t},{size:n,variant:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:Re(1),borderTop:`${mt({size:n,sizes:cp})} ${r} ${up(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${mt({size:n,sizes:cp})} ${r} ${up(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:Re(mt({size:n,sizes:cp})),borderTopColor:up(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Re(mt({size:n,sizes:cp})),borderLeftColor:up(e,t),borderLeftStyle:r}}));const Pq=Iq;var Eq=Object.defineProperty,Mq=Object.defineProperties,Oq=Object.getOwnPropertyDescriptors,jm=Object.getOwnPropertySymbols,C6=Object.prototype.hasOwnProperty,w6=Object.prototype.propertyIsEnumerable,z4=(e,t,n)=>t in e?Eq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F4=(e,t)=>{for(var n in t||(t={}))C6.call(t,n)&&z4(e,n,t[n]);if(jm)for(var n of jm(t))w6.call(t,n)&&z4(e,n,t[n]);return e},Rq=(e,t)=>Mq(e,Oq(t)),Dq=(e,t)=>{var n={};for(var r in e)C6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jm)for(var r of jm(e))t.indexOf(r)<0&&w6.call(e,r)&&(n[r]=e[r]);return n};const Aq={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},ex=d.forwardRef((e,t)=>{const n=Dn("Divider",Aq,e),{className:r,color:o,orientation:s,size:i,label:l,labelPosition:u,labelProps:p,variant:m,styles:h,classNames:g,unstyled:x}=n,y=Dq(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:b,cx:w}=Pq({color:o},{classNames:g,styles:h,unstyled:x,name:"Divider",variant:m,size:i}),S=s==="vertical",j=s==="horizontal",_=!!l&&j,E=!(p!=null&&p.color);return H.createElement(zr,F4({ref:t,className:w(b.root,{[b.vertical]:S,[b.horizontal]:j,[b.withLabel]:_},r),role:"separator"},y),_&&H.createElement(wc,Rq(F4({},p),{size:(p==null?void 0:p.size)||"xs",mt:Re(2),className:w(b.label,b[u],{[b.labelDefaultStyles]:E})}),l))});ex.displayName="@mantine/core/Divider";var Tq=Object.defineProperty,Nq=Object.defineProperties,$q=Object.getOwnPropertyDescriptors,B4=Object.getOwnPropertySymbols,Lq=Object.prototype.hasOwnProperty,zq=Object.prototype.propertyIsEnumerable,H4=(e,t,n)=>t in e?Tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V4=(e,t)=>{for(var n in t||(t={}))Lq.call(t,n)&&H4(e,n,t[n]);if(B4)for(var n of B4(t))zq.call(t,n)&&H4(e,n,t[n]);return e},Fq=(e,t)=>Nq(e,$q(t)),Bq=fr((e,t,{size:n})=>({item:Fq(V4({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${mt({size:n,sizes:e.spacing})} / 1.5) ${mt({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:mt({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":V4({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${mt({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${mt({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${mt({size:n,sizes:e.spacing})} / 1.5) ${mt({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const Hq=Bq;var Vq=Object.defineProperty,W4=Object.getOwnPropertySymbols,Wq=Object.prototype.hasOwnProperty,Uq=Object.prototype.propertyIsEnumerable,U4=(e,t,n)=>t in e?Vq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gq=(e,t)=>{for(var n in t||(t={}))Wq.call(t,n)&&U4(e,n,t[n]);if(W4)for(var n of W4(t))Uq.call(t,n)&&U4(e,n,t[n]);return e};function ry({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:l,onItemSelect:u,itemsRefs:p,itemComponent:m,size:h,nothingFound:g,creatable:x,createLabel:y,unstyled:b,variant:w}){const{classes:S}=Hq(null,{classNames:n,styles:r,unstyled:b,name:i,variant:w,size:h}),j=[],_=[];let E=null;const I=(R,D)=>{const A=typeof o=="function"?o(R.value):!1;return H.createElement(m,Gq({key:R.value,className:S.item,"data-disabled":R.disabled||void 0,"data-hovered":!R.disabled&&t===D||void 0,"data-selected":!R.disabled&&A||void 0,selected:A,onMouseEnter:()=>l(D),id:`${s}-${D}`,role:"option",tabIndex:-1,"aria-selected":t===D,ref:O=>{p&&p.current&&(p.current[R.value]=O)},onMouseDown:R.disabled?null:O=>{O.preventDefault(),u(R)},disabled:R.disabled,variant:w},R))};let M=null;if(e.forEach((R,D)=>{R.creatable?E=D:R.group?(M!==R.group&&(M=R.group,_.push(H.createElement("div",{className:S.separator,key:`__mantine-divider-${D}`},H.createElement(ex,{classNames:{label:S.separatorLabel},label:R.group})))),_.push(I(R,D))):j.push(I(R,D))}),x){const R=e[E];j.push(H.createElement("div",{key:ty(),className:S.item,"data-hovered":t===E||void 0,onMouseEnter:()=>l(E),onMouseDown:D=>{D.preventDefault(),u(R)},tabIndex:-1,ref:D=>{p&&p.current&&(p.current[R.value]=D)}},y))}return _.length>0&&j.length>0&&j.unshift(H.createElement("div",{className:S.separator,key:"empty-group-separator"},H.createElement(ex,null))),_.length>0||j.length>0?H.createElement(H.Fragment,null,_,j):H.createElement(wc,{size:h,unstyled:b,className:S.nothingFound},g)}ry.displayName="@mantine/core/SelectItems";var Kq=Object.defineProperty,_m=Object.getOwnPropertySymbols,S6=Object.prototype.hasOwnProperty,k6=Object.prototype.propertyIsEnumerable,G4=(e,t,n)=>t in e?Kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qq=(e,t)=>{for(var n in t||(t={}))S6.call(t,n)&&G4(e,n,t[n]);if(_m)for(var n of _m(t))k6.call(t,n)&&G4(e,n,t[n]);return e},Xq=(e,t)=>{var n={};for(var r in e)S6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_m)for(var r of _m(e))t.indexOf(r)<0&&k6.call(e,r)&&(n[r]=e[r]);return n};const oy=d.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=Xq(n,["label","value"]);return H.createElement("div",qq({ref:t},s),r||o)});oy.displayName="@mantine/core/DefaultItem";function Qq(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function j6(...e){return t=>e.forEach(n=>Qq(n,t))}function al(...e){return d.useCallback(j6(...e),e)}const _6=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(Zq);if(s){const i=s.props.children,l=o.map(u=>u===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:u);return d.createElement(tx,mn({},r,{ref:t}),d.isValidElement(i)?d.cloneElement(i,void 0,l):null)}return d.createElement(tx,mn({},r,{ref:t}),n)});_6.displayName="Slot";const tx=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{...Jq(r,n.props),ref:j6(t,n.ref)}):d.Children.count(n)>1?d.Children.only(null):null});tx.displayName="SlotClone";const Yq=({children:e})=>d.createElement(d.Fragment,null,e);function Zq(e){return d.isValidElement(e)&&e.type===Yq}function Jq(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{s(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const eX=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Hd=eX.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,l=s?_6:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(l,mn({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),nx=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function tX(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Vd=e=>{const{present:t,children:n}=e,r=nX(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=al(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Vd.displayName="Presence";function nX(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[l,u]=tX(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const p=dp(r.current);s.current=l==="mounted"?p:"none"},[l]),nx(()=>{const p=r.current,m=o.current;if(m!==e){const g=s.current,x=dp(p);e?u("MOUNT"):x==="none"||(p==null?void 0:p.display)==="none"?u("UNMOUNT"):u(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),nx(()=>{if(t){const p=h=>{const x=dp(r.current).includes(h.animationName);h.target===t&&x&&qr.flushSync(()=>u("ANIMATION_END"))},m=h=>{h.target===t&&(s.current=dp(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function dp(e){return(e==null?void 0:e.animationName)||"none"}function rX(e,t=[]){let n=[];function r(s,i){const l=d.createContext(i),u=n.length;n=[...n,i];function p(h){const{scope:g,children:x,...y}=h,b=(g==null?void 0:g[e][u])||l,w=d.useMemo(()=>y,Object.values(y));return d.createElement(b.Provider,{value:w},x)}function m(h,g){const x=(g==null?void 0:g[e][u])||l,y=d.useContext(x);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${s}\``)}return p.displayName=s+"Provider",[p,m]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(l){const u=(l==null?void 0:l[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return o.scopeName=e,[r,oX(o,...t)]}function oX(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:u,scopeName:p})=>{const h=u(s)[`__scope${p}`];return{...l,...h}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Pi(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const sX=d.createContext(void 0);function aX(e){const t=d.useContext(sX);return e||t||"ltr"}function iX(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ni(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function lX(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const I6="ScrollArea",[P6,A1e]=rX(I6),[cX,_o]=P6(I6),uX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[l,u]=d.useState(null),[p,m]=d.useState(null),[h,g]=d.useState(null),[x,y]=d.useState(null),[b,w]=d.useState(null),[S,j]=d.useState(0),[_,E]=d.useState(0),[I,M]=d.useState(!1),[R,D]=d.useState(!1),A=al(t,T=>u(T)),O=aX(o);return d.createElement(cX,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:l,viewport:p,onViewportChange:m,content:h,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:I,onScrollbarXEnabledChange:M,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:R,onScrollbarYEnabledChange:D,onCornerWidthChange:j,onCornerHeightChange:E},d.createElement(Hd.div,mn({dir:O},i,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})))}),dX="ScrollAreaViewport",fX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=_o(dX,n),i=d.useRef(null),l=al(t,i,s.onViewportChange);return d.createElement(d.Fragment,null,d.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),d.createElement(Hd.div,mn({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),d.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),ya="ScrollAreaScrollbar",pX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_o(ya,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,l=e.orientation==="horizontal";return d.useEffect(()=>(l?s(!0):i(!0),()=>{l?s(!1):i(!1)}),[l,s,i]),o.type==="hover"?d.createElement(mX,mn({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(hX,mn({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(E6,mn({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(sy,mn({},r,{ref:t})):null}),mX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_o(ya,e.__scopeScrollArea),[s,i]=d.useState(!1);return d.useEffect(()=>{const l=o.scrollArea;let u=0;if(l){const p=()=>{window.clearTimeout(u),i(!0)},m=()=>{u=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",p),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",p),l.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(Vd,{present:n||s},d.createElement(E6,mn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),hX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_o(ya,e.__scopeScrollArea),s=e.orientation==="horizontal",i=ng(()=>u("SCROLL_END"),100),[l,u]=lX("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(l==="idle"){const p=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[l,o.scrollHideDelay,u]),d.useEffect(()=>{const p=o.viewport,m=s?"scrollLeft":"scrollTop";if(p){let h=p[m];const g=()=>{const x=p[m];h!==x&&(u("SCROLL"),i()),h=x};return p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,s,u,i]),d.createElement(Vd,{present:n||l!=="hidden"},d.createElement(sy,mn({"data-state":l==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Ni(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ni(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),E6=d.forwardRef((e,t)=>{const n=_o(ya,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=d.useState(!1),l=e.orientation==="horizontal",u=ng(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?p:m)}},10);return Sc(n.viewport,u),Sc(n.content,u),d.createElement(Vd,{present:r||s},d.createElement(sy,mn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),sy=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=_o(ya,e.__scopeScrollArea),s=d.useRef(null),i=d.useRef(0),[l,u]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=D6(l.viewport,l.content),m={...r,sizes:l,onSizesChange:u,hasThumb:p>0&&p<1,onThumbChange:g=>s.current=g,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:g=>i.current=g};function h(g,x){return SX(g,i.current,l,x)}return n==="horizontal"?d.createElement(gX,mn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const g=o.viewport.scrollLeft,x=K4(g,l,o.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=h(g,o.dir))}})):n==="vertical"?d.createElement(vX,mn({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const g=o.viewport.scrollTop,x=K4(g,l);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=h(g))}})):null}),gX=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=_o(ya,e.__scopeScrollArea),[i,l]=d.useState(),u=d.useRef(null),p=al(t,u,s.onScrollbarXChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(O6,mn({"data-orientation":"horizontal"},o,{ref:p,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":tg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,h)=>{if(s.viewport){const g=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),T6(g,h)&&m.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Im(i.paddingLeft),paddingEnd:Im(i.paddingRight)}})}}))}),vX=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=_o(ya,e.__scopeScrollArea),[i,l]=d.useState(),u=d.useRef(null),p=al(t,u,s.onScrollbarYChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(O6,mn({"data-orientation":"vertical"},o,{ref:p,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":tg(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,h)=>{if(s.viewport){const g=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),T6(g,h)&&m.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Im(i.paddingTop),paddingEnd:Im(i.paddingBottom)}})}}))}),[xX,M6]=P6(ya),O6=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:p,onWheelScroll:m,onResize:h,...g}=e,x=_o(ya,n),[y,b]=d.useState(null),w=al(t,A=>b(A)),S=d.useRef(null),j=d.useRef(""),_=x.viewport,E=r.content-r.viewport,I=Pi(m),M=Pi(u),R=ng(h,10);function D(A){if(S.current){const O=A.clientX-S.current.left,T=A.clientY-S.current.top;p({x:O,y:T})}}return d.useEffect(()=>{const A=O=>{const T=O.target;(y==null?void 0:y.contains(T))&&I(O,E)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[_,y,E,I]),d.useEffect(M,[r,M]),Sc(y,R),Sc(x.content,R),d.createElement(xX,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:Pi(s),onThumbPointerUp:Pi(i),onThumbPositionChange:M,onThumbPointerDown:Pi(l)},d.createElement(Hd.div,mn({},g,{ref:w,style:{position:"absolute",...g.style},onPointerDown:Ni(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),S.current=y.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",D(A))}),onPointerMove:Ni(e.onPointerMove,D),onPointerUp:Ni(e.onPointerUp,A=>{const O=A.target;O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=j.current,S.current=null})})))}),rx="ScrollAreaThumb",bX=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=M6(rx,e.__scopeScrollArea);return d.createElement(Vd,{present:n||o.hasThumb},d.createElement(yX,mn({ref:t},r)))}),yX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=_o(rx,n),i=M6(rx,n),{onThumbPositionChange:l}=i,u=al(t,h=>i.onThumbChange(h)),p=d.useRef(),m=ng(()=>{p.current&&(p.current(),p.current=void 0)},100);return d.useEffect(()=>{const h=s.viewport;if(h){const g=()=>{if(m(),!p.current){const x=kX(h,l);p.current=x,l()}};return l(),h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[s.viewport,m,l]),d.createElement(Hd.div,mn({"data-state":i.hasThumb?"visible":"hidden"},o,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ni(e.onPointerDownCapture,h=>{const x=h.target.getBoundingClientRect(),y=h.clientX-x.left,b=h.clientY-x.top;i.onThumbPointerDown({x:y,y:b})}),onPointerUp:Ni(e.onPointerUp,i.onThumbPointerUp)}))}),R6="ScrollAreaCorner",CX=d.forwardRef((e,t)=>{const n=_o(R6,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(wX,mn({},e,{ref:t})):null}),wX=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=_o(R6,n),[s,i]=d.useState(0),[l,u]=d.useState(0),p=!!(s&&l);return Sc(o.scrollbarX,()=>{var m;const h=((m=o.scrollbarX)===null||m===void 0?void 0:m.offsetHeight)||0;o.onCornerHeightChange(h),u(h)}),Sc(o.scrollbarY,()=>{var m;const h=((m=o.scrollbarY)===null||m===void 0?void 0:m.offsetWidth)||0;o.onCornerWidthChange(h),i(h)}),p?d.createElement(Hd.div,mn({},r,{ref:t,style:{width:s,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Im(e){return e?parseInt(e,10):0}function D6(e,t){const n=e/t;return isNaN(n)?0:n}function tg(e){const t=D6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function SX(e,t,n,r="ltr"){const o=tg(n),s=o/2,i=t||s,l=o-i,u=n.scrollbar.paddingStart+i,p=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,h=r==="ltr"?[0,m]:[m*-1,0];return A6([u,p],h)(e)}function K4(e,t,n="ltr"){const r=tg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,l=s-r,u=n==="ltr"?[0,i]:[i*-1,0],p=iX(e,u);return A6([0,i],[0,l])(p)}function A6(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function T6(e,t){return e>0&&e<t}const kX=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,l=n.top!==s.top;(i||l)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function ng(e,t){const n=Pi(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Sc(e,t){const n=Pi(t);nx(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const jX=uX,_X=fX,q4=pX,X4=bX,IX=CX;var PX=fr((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Re(t):void 0,paddingBottom:n?Re(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Re(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${e4("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Re(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Re(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:e4("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Re(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:Re(44),minHeight:Re(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:o?"none":void 0}}));const EX=PX;var MX=Object.defineProperty,OX=Object.defineProperties,RX=Object.getOwnPropertyDescriptors,Pm=Object.getOwnPropertySymbols,N6=Object.prototype.hasOwnProperty,$6=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?MX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ox=(e,t)=>{for(var n in t||(t={}))N6.call(t,n)&&Q4(e,n,t[n]);if(Pm)for(var n of Pm(t))$6.call(t,n)&&Q4(e,n,t[n]);return e},L6=(e,t)=>OX(e,RX(t)),z6=(e,t)=>{var n={};for(var r in e)N6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pm)for(var r of Pm(e))t.indexOf(r)<0&&$6.call(e,r)&&(n[r]=e[r]);return n};const F6={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},rg=d.forwardRef((e,t)=>{const n=Dn("ScrollArea",F6,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:l,scrollHideDelay:u,type:p,dir:m,offsetScrollbars:h,viewportRef:g,onScrollPositionChange:x,unstyled:y,variant:b,viewportProps:w}=n,S=z6(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[j,_]=d.useState(!1),E=xa(),{classes:I,cx:M}=EX({scrollbarSize:l,offsetScrollbars:h,scrollbarHovered:j,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:y,variant:b});return H.createElement(jX,{type:p==="never"?"always":p,scrollHideDelay:u,dir:m||E.dir,ref:t,asChild:!0},H.createElement(zr,ox({className:M(I.root,o)},S),H.createElement(_X,L6(ox({},w),{className:I.viewport,ref:g,onScroll:typeof x=="function"?({currentTarget:R})=>x({x:R.scrollLeft,y:R.scrollTop}):void 0}),r),H.createElement(q4,{orientation:"horizontal",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},H.createElement(X4,{className:I.thumb})),H.createElement(q4,{orientation:"vertical",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},H.createElement(X4,{className:I.thumb})),H.createElement(IX,{className:I.corner})))}),B6=d.forwardRef((e,t)=>{const n=Dn("ScrollAreaAutosize",F6,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:l,type:u,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:g,unstyled:x,sx:y,variant:b,viewportProps:w}=n,S=z6(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(zr,L6(ox({},S),{ref:t,sx:[{display:"flex"},...PP(y)]}),H.createElement(zr,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(rg,{classNames:o,styles:s,scrollHideDelay:l,scrollbarSize:i,type:u,dir:p,offsetScrollbars:m,viewportRef:h,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:w},r)))});B6.displayName="@mantine/core/ScrollAreaAutosize";rg.displayName="@mantine/core/ScrollArea";rg.Autosize=B6;const H6=rg;var DX=Object.defineProperty,AX=Object.defineProperties,TX=Object.getOwnPropertyDescriptors,Em=Object.getOwnPropertySymbols,V6=Object.prototype.hasOwnProperty,W6=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?DX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z4=(e,t)=>{for(var n in t||(t={}))V6.call(t,n)&&Y4(e,n,t[n]);if(Em)for(var n of Em(t))W6.call(t,n)&&Y4(e,n,t[n]);return e},NX=(e,t)=>AX(e,TX(t)),$X=(e,t)=>{var n={};for(var r in e)V6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Em)for(var r of Em(e))t.indexOf(r)<0&&W6.call(e,r)&&(n[r]=e[r]);return n};const og=d.forwardRef((e,t)=>{var n=e,{style:r}=n,o=$X(n,["style"]);return H.createElement(H6,NX(Z4({},o),{style:Z4({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});og.displayName="@mantine/core/SelectScrollArea";var LX=fr(()=>({dropdown:{},itemsWrapper:{padding:Re(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const zX=LX;function Fc(e){return e.split("-")[1]}function ay(e){return e==="y"?"height":"width"}function Go(e){return e.split("-")[0]}function li(e){return["top","bottom"].includes(Go(e))?"x":"y"}function J4(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,i=r.y+r.height/2-o.height/2,l=li(t),u=ay(l),p=r[u]/2-o[u]/2,m=l==="x";let h;switch(Go(t)){case"top":h={x:s,y:r.y-o.height};break;case"bottom":h={x:s,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:i};break;case"left":h={x:r.x-o.width,y:i};break;default:h={x:r.x,y:r.y}}switch(Fc(t)){case"start":h[l]-=p*(n&&m?-1:1);break;case"end":h[l]+=p*(n&&m?-1:1)}return h}const FX=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let p=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=J4(p,r,u),g=r,x={},y=0;for(let b=0;b<l.length;b++){const{name:w,fn:S}=l[b],{x:j,y:_,data:E,reset:I}=await S({x:m,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:x,rects:p,platform:i,elements:{reference:e,floating:t}});m=j??m,h=_??h,x={...x,[w]:{...x[w],...E}},I&&y<=50&&(y++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(p=I.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:m,y:h}=J4(p,g,u)),b=-1)}return{x:m,y:h,placement:g,strategy:o,middlewareData:x}};function ia(e,t){return typeof e=="function"?e(t):e}function iy(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function kc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function ly(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:u}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:g=!1,padding:x=0}=ia(t,e),y=iy(x),b=l[g?h==="floating"?"reference":"floating":h],w=kc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:p,rootBoundary:m,strategy:u})),S=h==="floating"?{...i.floating,x:r,y:o}:i.reference,j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),_=await(s.isElement==null?void 0:s.isElement(j))&&await(s.getScale==null?void 0:s.getScale(j))||{x:1,y:1},E=kc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:j,strategy:u}):S);return{top:(w.top-E.top+y.top)/_.y,bottom:(E.bottom-w.bottom+y.bottom)/_.y,left:(w.left-E.left+y.left)/_.x,right:(E.right-w.right+y.right)/_.x}}const ei=Math.min,ms=Math.max;function sx(e,t,n){return ms(e,ei(t,n))}const ek=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l}=t,{element:u,padding:p=0}=ia(e,t)||{};if(u==null)return{};const m=iy(p),h={x:n,y:r},g=li(o),x=ay(g),y=await i.getDimensions(u),b=g==="y",w=b?"top":"left",S=b?"bottom":"right",j=b?"clientHeight":"clientWidth",_=s.reference[x]+s.reference[g]-h[g]-s.floating[x],E=h[g]-s.reference[g],I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=I?I[j]:0;M&&await(i.isElement==null?void 0:i.isElement(I))||(M=l.floating[j]||s.floating[x]);const R=_/2-E/2,D=M/2-y[x]/2-1,A=ei(m[w],D),O=ei(m[S],D),T=A,X=M-y[x]-O,B=M/2-y[x]/2+R,V=sx(T,B,X),U=Fc(o)!=null&&B!=V&&s.reference[x]/2-(B<T?A:O)-y[x]/2<0?B<T?T-B:X-B:0;return{[g]:h[g]-U,data:{[g]:V,centerOffset:B-V+U}}}}),BX=["top","right","bottom","left"];BX.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const HX={left:"right",right:"left",bottom:"top",top:"bottom"};function Mm(e){return e.replace(/left|right|bottom|top/g,t=>HX[t])}function VX(e,t,n){n===void 0&&(n=!1);const r=Fc(e),o=li(e),s=ay(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Mm(i)),{main:i,cross:Mm(i)}}const WX={start:"end",end:"start"};function Iv(e){return e.replace(/start|end/g,t=>WX[t])}const UX=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...b}=ia(e,t),w=Go(r),S=Go(i)===i,j=await(l.isRTL==null?void 0:l.isRTL(u.floating)),_=h||(S||!y?[Mm(i)]:function(T){const X=Mm(T);return[Iv(T),X,Iv(X)]}(i));h||x==="none"||_.push(...function(T,X,B,V){const U=Fc(T);let N=function($,q,F){const Q=["left","right"],Y=["right","left"],se=["top","bottom"],ae=["bottom","top"];switch($){case"top":case"bottom":return F?q?Y:Q:q?Q:Y;case"left":case"right":return q?se:ae;default:return[]}}(Go(T),B==="start",V);return U&&(N=N.map($=>$+"-"+U),X&&(N=N.concat(N.map(Iv)))),N}(i,y,x,j));const E=[i,..._],I=await ly(t,b),M=[];let R=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&M.push(I[w]),m){const{main:T,cross:X}=VX(r,s,j);M.push(I[T],I[X])}if(R=[...R,{placement:r,overflows:M}],!M.every(T=>T<=0)){var D,A;const T=(((D=o.flip)==null?void 0:D.index)||0)+1,X=E[T];if(X)return{data:{index:T,overflows:R},reset:{placement:X}};let B=(A=R.filter(V=>V.overflows[0]<=0).sort((V,U)=>V.overflows[1]-U.overflows[1])[0])==null?void 0:A.placement;if(!B)switch(g){case"bestFit":{var O;const V=(O=R.map(U=>[U.placement,U.overflows.filter(N=>N>0).reduce((N,$)=>N+$,0)]).sort((U,N)=>U[1]-N[1])[0])==null?void 0:O[0];V&&(B=V);break}case"initialPlacement":B=i}if(r!==B)return{reset:{placement:B}}}return{}}}};function tk(e){const t=ei(...e.map(r=>r.left)),n=ei(...e.map(r=>r.top));return{x:t,y:n,width:ms(...e.map(r=>r.right))-t,height:ms(...e.map(r=>r.bottom))-n}}const GX=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:i}=t,{padding:l=2,x:u,y:p}=ia(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),h=function(b){const w=b.slice().sort((_,E)=>_.y-E.y),S=[];let j=null;for(let _=0;_<w.length;_++){const E=w[_];!j||E.y-j.y>j.height/2?S.push([E]):S[S.length-1].push(E),j=E}return S.map(_=>kc(tk(_)))}(m),g=kc(tk(m)),x=iy(l),y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(h.length===2&&h[0].left>h[1].right&&u!=null&&p!=null)return h.find(b=>u>b.left-x.left&&u<b.right+x.right&&p>b.top-x.top&&p<b.bottom+x.bottom)||g;if(h.length>=2){if(li(n)==="x"){const I=h[0],M=h[h.length-1],R=Go(n)==="top",D=I.top,A=M.bottom,O=R?I.left:M.left,T=R?I.right:M.right;return{top:D,bottom:A,left:O,right:T,width:T-O,height:A-D,x:O,y:D}}const b=Go(n)==="left",w=ms(...h.map(I=>I.right)),S=ei(...h.map(I=>I.left)),j=h.filter(I=>b?I.left===S:I.right===w),_=j[0].top,E=j[j.length-1].bottom;return{top:_,bottom:E,left:S,right:w,width:w-S,height:E-_,x:S,y:_}}return g}},floating:r.floating,strategy:i});return o.reference.x!==y.reference.x||o.reference.y!==y.reference.y||o.reference.width!==y.reference.width||o.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},KX=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(s,i){const{placement:l,platform:u,elements:p}=s,m=await(u.isRTL==null?void 0:u.isRTL(p.floating)),h=Go(l),g=Fc(l),x=li(l)==="x",y=["left","top"].includes(h)?-1:1,b=m&&x?-1:1,w=ia(i,s);let{mainAxis:S,crossAxis:j,alignmentAxis:_}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return g&&typeof _=="number"&&(j=g==="end"?-1*_:_),x?{x:j*b,y:S*y}:{x:S*y,y:j*b}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function U6(e){return e==="x"?"y":"x"}const qX=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:w=>{let{x:S,y:j}=w;return{x:S,y:j}}},...u}=ia(e,t),p={x:n,y:r},m=await ly(t,u),h=li(Go(o)),g=U6(h);let x=p[h],y=p[g];if(s){const w=h==="y"?"bottom":"right";x=sx(x+m[h==="y"?"top":"left"],x,x-m[w])}if(i){const w=g==="y"?"bottom":"right";y=sx(y+m[g==="y"?"top":"left"],y,y-m[w])}const b=l.fn({...t,[h]:x,[g]:y});return{...b,data:{x:b.x-n,y:b.y-r}}}}},XX=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:u=!0,crossAxis:p=!0}=ia(e,t),m={x:n,y:r},h=li(o),g=U6(h);let x=m[h],y=m[g];const b=ia(l,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const _=h==="y"?"height":"width",E=s.reference[h]-s.floating[_]+w.mainAxis,I=s.reference[h]+s.reference[_]-w.mainAxis;x<E?x=E:x>I&&(x=I)}if(p){var S,j;const _=h==="y"?"width":"height",E=["top","left"].includes(Go(o)),I=s.reference[g]-s.floating[_]+(E&&((S=i.offset)==null?void 0:S[g])||0)+(E?0:w.crossAxis),M=s.reference[g]+s.reference[_]+(E?0:((j=i.offset)==null?void 0:j[g])||0)-(E?w.crossAxis:0);y<I?y=I:y>M&&(y=M)}return{[h]:x,[g]:y}}}},QX=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...l}=ia(e,t),u=await ly(t,l),p=Go(n),m=Fc(n),h=li(n)==="x",{width:g,height:x}=r.floating;let y,b;p==="top"||p==="bottom"?(y=p,b=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=p,y=m==="end"?"top":"bottom");const w=x-u[y],S=g-u[b],j=!t.middlewareData.shift;let _=w,E=S;if(h){const M=g-u.left-u.right;E=m||j?ei(S,M):M}else{const M=x-u.top-u.bottom;_=m||j?ei(w,M):M}if(j&&!m){const M=ms(u.left,0),R=ms(u.right,0),D=ms(u.top,0),A=ms(u.bottom,0);h?E=g-2*(M!==0||R!==0?M+R:ms(u.left,u.right)):_=x-2*(D!==0||A!==0?D+A:ms(u.top,u.bottom))}await i({...t,availableWidth:E,availableHeight:_});const I=await o.getDimensions(s.floating);return g!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function Zr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ks(e){return Zr(e).getComputedStyle(e)}function G6(e){return e instanceof Zr(e).Node}function ti(e){return G6(e)?(e.nodeName||"").toLowerCase():"#document"}function Jo(e){return e instanceof HTMLElement||e instanceof Zr(e).HTMLElement}function nk(e){return typeof ShadowRoot<"u"&&(e instanceof Zr(e).ShadowRoot||e instanceof ShadowRoot)}function sd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ks(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function YX(e){return["table","td","th"].includes(ti(e))}function ax(e){const t=cy(),n=ks(e);return n.transform!=="none"||n.perspective!=="none"||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function cy(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function sg(e){return["html","body","#document"].includes(ti(e))}const ix=Math.min,fc=Math.max,Om=Math.round,fp=Math.floor,ni=e=>({x:e,y:e});function K6(e){const t=ks(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jo(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=Om(n)!==s||Om(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function ea(e){return e instanceof Element||e instanceof Zr(e).Element}function uy(e){return ea(e)?e:e.contextElement}function pc(e){const t=uy(e);if(!Jo(t))return ni(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=K6(t);let i=(s?Om(n.width):n.width)/r,l=(s?Om(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}const ZX=ni(0);function q6(e){const t=Zr(e);return cy()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ZX}function Qi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=uy(e);let i=ni(1);t&&(r?ea(r)&&(i=pc(r)):i=pc(e));const l=function(g,x,y){return x===void 0&&(x=!1),!(!y||x&&y!==Zr(g))&&x}(s,n,r)?q6(s):ni(0);let u=(o.left+l.x)/i.x,p=(o.top+l.y)/i.y,m=o.width/i.x,h=o.height/i.y;if(s){const g=Zr(s),x=r&&ea(r)?Zr(r):r;let y=g.frameElement;for(;y&&r&&x!==g;){const b=pc(y),w=y.getBoundingClientRect(),S=getComputedStyle(y),j=w.left+(y.clientLeft+parseFloat(S.paddingLeft))*b.x,_=w.top+(y.clientTop+parseFloat(S.paddingTop))*b.y;u*=b.x,p*=b.y,m*=b.x,h*=b.y,u+=j,p+=_,y=Zr(y).frameElement}}return kc({width:m,height:h,x:u,y:p})}function ag(e){return ea(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ta(e){var t;return(t=(G6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function X6(e){return Qi(ta(e)).left+ag(e).scrollLeft}function jc(e){if(ti(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nk(e)&&e.host||ta(e);return nk(t)?t.host:t}function Q6(e){const t=jc(e);return sg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&sd(t)?t:Q6(t)}function Rm(e,t){var n;t===void 0&&(t=[]);const r=Q6(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Zr(r);return o?t.concat(s,s.visualViewport||[],sd(r)?r:[]):t.concat(r,Rm(r))}function rk(e,t,n){let r;if(t==="viewport")r=function(o,s){const i=Zr(o),l=ta(o),u=i.visualViewport;let p=l.clientWidth,m=l.clientHeight,h=0,g=0;if(u){p=u.width,m=u.height;const x=cy();(!x||x&&s==="fixed")&&(h=u.offsetLeft,g=u.offsetTop)}return{width:p,height:m,x:h,y:g}}(e,n);else if(t==="document")r=function(o){const s=ta(o),i=ag(o),l=o.ownerDocument.body,u=fc(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),p=fc(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let m=-i.scrollLeft+X6(o);const h=-i.scrollTop;return ks(l).direction==="rtl"&&(m+=fc(s.clientWidth,l.clientWidth)-u),{width:u,height:p,x:m,y:h}}(ta(e));else if(ea(t))r=function(o,s){const i=Qi(o,!0,s==="fixed"),l=i.top+o.clientTop,u=i.left+o.clientLeft,p=Jo(o)?pc(o):ni(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:u*p.x,y:l*p.y}}(t,n);else{const o=q6(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return kc(r)}function Y6(e,t){const n=jc(e);return!(n===t||!ea(n)||sg(n))&&(ks(n).position==="fixed"||Y6(n,t))}function JX(e,t,n){const r=Jo(t),o=ta(t),s=n==="fixed",i=Qi(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=ni(0);if(r||!r&&!s)if((ti(t)!=="body"||sd(o))&&(l=ag(t)),Jo(t)){const p=Qi(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else o&&(u.x=X6(o));return{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function ok(e,t){return Jo(e)&&ks(e).position!=="fixed"?t?t(e):e.offsetParent:null}function sk(e,t){const n=Zr(e);if(!Jo(e))return n;let r=ok(e,t);for(;r&&YX(r)&&ks(r).position==="static";)r=ok(r,t);return r&&(ti(r)==="html"||ti(r)==="body"&&ks(r).position==="static"&&!ax(r))?n:r||function(o){let s=jc(o);for(;Jo(s)&&!sg(s);){if(ax(s))return s;s=jc(s)}return null}(e)||n}const eQ={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Jo(n),s=ta(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},l=ni(1);const u=ni(0);if((o||!o&&r!=="fixed")&&((ti(n)!=="body"||sd(s))&&(i=ag(n)),Jo(n))){const p=Qi(n);l=pc(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-i.scrollLeft*l.x+u.x,y:t.y*l.y-i.scrollTop*l.y+u.y}},getDocumentElement:ta,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?function(u,p){const m=p.get(u);if(m)return m;let h=Rm(u).filter(b=>ea(b)&&ti(b)!=="body"),g=null;const x=ks(u).position==="fixed";let y=x?jc(u):u;for(;ea(y)&&!sg(y);){const b=ks(y),w=ax(y);w||b.position!=="fixed"||(g=null),(x?!w&&!g:!w&&b.position==="static"&&g&&["absolute","fixed"].includes(g.position)||sd(y)&&!w&&Y6(u,y))?h=h.filter(S=>S!==y):g=b,y=jc(y)}return p.set(u,h),h}(t,this._c):[].concat(n),r],i=s[0],l=s.reduce((u,p)=>{const m=rk(t,p,o);return u.top=fc(m.top,u.top),u.right=ix(m.right,u.right),u.bottom=ix(m.bottom,u.bottom),u.left=fc(m.left,u.left),u},rk(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:sk,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||sk,s=this.getDimensions;return{reference:JX(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return K6(e)},getScale:pc,isElement:ea,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function tQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,p=uy(e),m=o||s?[...p?Rm(p):[],...Rm(t)]:[];m.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const h=p&&l?function(w,S){let j,_=null;const E=ta(w);function I(){clearTimeout(j),_&&_.disconnect(),_=null}return function M(R,D){R===void 0&&(R=!1),D===void 0&&(D=1),I();const{left:A,top:O,width:T,height:X}=w.getBoundingClientRect();if(R||S(),!T||!X)return;const B={rootMargin:-fp(O)+"px "+-fp(E.clientWidth-(A+T))+"px "+-fp(E.clientHeight-(O+X))+"px "+-fp(A)+"px",threshold:fc(0,ix(1,D))||1};let V=!0;function U(N){const $=N[0].intersectionRatio;if($!==D){if(!V)return M();$?M(!1,$):j=setTimeout(()=>{M(!1,1e-7)},100)}V=!1}try{_=new IntersectionObserver(U,{...B,root:E.ownerDocument})}catch{_=new IntersectionObserver(U,B)}_.observe(w)}(!0),I}(p,n):null;let g,x=-1,y=null;i&&(y=new ResizeObserver(w=>{let[S]=w;S&&S.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!u&&y.observe(p),y.observe(t));let b=u?Qi(e):null;return u&&function w(){const S=Qi(e);!b||S.x===b.x&&S.y===b.y&&S.width===b.width&&S.height===b.height||n(),b=S,g=requestAnimationFrame(w)}(),n(),()=>{m.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),h&&h(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(g)}}const nQ=(e,t,n)=>{const r=new Map,o={platform:eQ,...n},s={...o.platform,_c:r};return FX(e,t,{...o,platform:s})},rQ=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?ek({element:t.current,padding:n}).fn(o):{}:t?ek({element:t,padding:n}).fn(o):{}}}};var Vp=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Dm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Dm(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Dm(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ak(e){const t=d.useRef(e);return Vp(()=>{t.current=e}),t}function oQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:i}=e,[l,u]=d.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);Dm(p,r)||m(r);const h=d.useRef(null),g=d.useRef(null),x=d.useRef(l),y=ak(s),b=ak(o),[w,S]=d.useState(null),[j,_]=d.useState(null),E=d.useCallback(O=>{h.current!==O&&(h.current=O,S(O))},[]),I=d.useCallback(O=>{g.current!==O&&(g.current=O,_(O))},[]),M=d.useCallback(()=>{if(!h.current||!g.current)return;const O={placement:t,strategy:n,middleware:p};b.current&&(O.platform=b.current),nQ(h.current,g.current,O).then(T=>{const X={...T,isPositioned:!0};R.current&&!Dm(x.current,X)&&(x.current=X,qr.flushSync(()=>{u(X)}))})},[p,t,n,b]);Vp(()=>{i===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,u(O=>({...O,isPositioned:!1})))},[i]);const R=d.useRef(!1);Vp(()=>(R.current=!0,()=>{R.current=!1}),[]),Vp(()=>{if(w&&j){if(y.current)return y.current(w,j,M);M()}},[w,j,M,y]);const D=d.useMemo(()=>({reference:h,floating:g,setReference:E,setFloating:I}),[E,I]),A=d.useMemo(()=>({reference:w,floating:j}),[w,j]);return d.useMemo(()=>({...l,update:M,refs:D,elements:A,reference:E,floating:I}),[l,M,D,A,E,I])}var sQ=typeof document<"u"?d.useLayoutEffect:d.useEffect;function aQ(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const iQ=d.createContext(null),lQ=()=>d.useContext(iQ);function cQ(e){return(e==null?void 0:e.ownerDocument)||document}function uQ(e){return cQ(e).defaultView||window}function pp(e){return e?e instanceof uQ(e).Element:!1}const dQ=Fx["useInsertionEffect".toString()],fQ=dQ||(e=>e());function pQ(e){const t=d.useRef(()=>{});return fQ(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function mQ(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=oQ(e),s=lQ(),i=d.useRef(null),l=d.useRef({}),u=d.useState(()=>aQ())[0],[p,m]=d.useState(null),h=d.useCallback(S=>{const j=pp(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;o.refs.setReference(j)},[o.refs]),g=d.useCallback(S=>{(pp(S)||S===null)&&(i.current=S,m(S)),(pp(o.refs.reference.current)||o.refs.reference.current===null||S!==null&&!pp(S))&&o.refs.setReference(S)},[o.refs]),x=d.useMemo(()=>({...o.refs,setReference:g,setPositionReference:h,domReference:i}),[o.refs,g,h]),y=d.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),b=pQ(n),w=d.useMemo(()=>({...o,refs:x,elements:y,dataRef:l,nodeId:r,events:u,open:t,onOpenChange:b}),[o,r,u,t,b,x,y]);return sQ(()=>{const S=s==null?void 0:s.nodesRef.current.find(j=>j.id===r);S&&(S.context=w)}),d.useMemo(()=>({...o,context:w,refs:x,reference:g,positionReference:h}),[o,x,w,g,h])}function hQ({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=d.useState(0);d.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return tQ(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Uo(()=>{t.update()},r),Uo(()=>{s(i=>i+1)},[e])}function gQ(e){const t=[KX(e.offset)];return e.middlewares.shift&&t.push(qX({limiter:XX()})),e.middlewares.flip&&t.push(UX()),e.middlewares.inline&&t.push(GX()),t.push(rQ({element:e.arrowRef,padding:e.arrowOffset})),t}function vQ(e){const[t,n]=od({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var i;(i=e.onClose)==null||i.call(e),n(!1)},o=()=>{var i,l;t?((i=e.onClose)==null||i.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},s=mQ({placement:e.position,middleware:[...gQ(e),...e.width==="target"?[QX({apply({rects:i}){var l,u;Object.assign((u=(l=s.refs.floating.current)==null?void 0:l.style)!=null?u:{},{width:`${i.reference.width}px`})}})]:[]]});return hQ({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),Uo(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),Uo(()=>{var i,l;e.opened?(l=e.onOpen)==null||l.call(e):(i=e.onClose)==null||i.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const Z6={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[xQ,J6]=sG(Z6.context);var bQ=Object.defineProperty,yQ=Object.defineProperties,CQ=Object.getOwnPropertyDescriptors,Am=Object.getOwnPropertySymbols,eE=Object.prototype.hasOwnProperty,tE=Object.prototype.propertyIsEnumerable,ik=(e,t,n)=>t in e?bQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mp=(e,t)=>{for(var n in t||(t={}))eE.call(t,n)&&ik(e,n,t[n]);if(Am)for(var n of Am(t))tE.call(t,n)&&ik(e,n,t[n]);return e},wQ=(e,t)=>yQ(e,CQ(t)),SQ=(e,t)=>{var n={};for(var r in e)eE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Am)for(var r of Am(e))t.indexOf(r)<0&&tE.call(e,r)&&(n[r]=e[r]);return n};const kQ={refProp:"ref",popupType:"dialog"},nE=d.forwardRef((e,t)=>{const n=Dn("PopoverTarget",kQ,e),{children:r,refProp:o,popupType:s}=n,i=SQ(n,["children","refProp","popupType"]);if(!MP(r))throw new Error(Z6.children);const l=i,u=J6(),p=Bd(u.reference,r.ref,t),m=u.withRoles?{"aria-haspopup":s,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return d.cloneElement(r,mp(wQ(mp(mp(mp({},l),m),u.targetProps),{className:RP(u.targetProps.className,l.className,r.props.className),[o]:p}),u.controlled?null:{onClick:u.onToggle}))});nE.displayName="@mantine/core/PopoverTarget";var jQ=fr((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Re(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${Re(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const _Q=jQ;var IQ=Object.defineProperty,lk=Object.getOwnPropertySymbols,PQ=Object.prototype.hasOwnProperty,EQ=Object.prototype.propertyIsEnumerable,ck=(e,t,n)=>t in e?IQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$l=(e,t)=>{for(var n in t||(t={}))PQ.call(t,n)&&ck(e,n,t[n]);if(lk)for(var n of lk(t))EQ.call(t,n)&&ck(e,n,t[n]);return e};const uk={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function MQ({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ap?$l($l($l({transitionProperty:ap[e].transitionProperty},o),ap[e].common),ap[e][uk[t]]):null:$l($l($l({transitionProperty:e.transitionProperty},o),e.common),e[uk[t]])}function OQ({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:l}){const u=xa(),p=zP(),m=u.respectReducedMotion?p:!1,[h,g]=d.useState(m?0:e),[x,y]=d.useState(r?"entered":"exited"),b=d.useRef(-1),w=S=>{const j=S?o:s,_=S?i:l;y(S?"pre-entering":"pre-exiting"),window.clearTimeout(b.current);const E=m?0:S?e:t;if(g(E),E===0)typeof j=="function"&&j(),typeof _=="function"&&_(),y(S?"entered":"exited");else{const I=window.setTimeout(()=>{typeof j=="function"&&j(),y(S?"entering":"exiting")},10);b.current=window.setTimeout(()=>{window.clearTimeout(I),typeof _=="function"&&_(),y(S?"entered":"exited")},E)}};return Uo(()=>{w(r)},[r]),d.useEffect(()=>()=>window.clearTimeout(b.current),[]),{transitionDuration:h,transitionStatus:x,transitionTimingFunction:n||u.transitionTimingFunction}}function rE({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:l,onEntered:u,onEnter:p,onExited:m}){const{transitionDuration:h,transitionStatus:g,transitionTimingFunction:x}=OQ({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:l,onEntered:u,onEnter:p,onExited:m});return h===0?o?H.createElement(H.Fragment,null,s({})):e?s({display:"none"}):null:g==="exited"?e?s({display:"none"}):null:H.createElement(H.Fragment,null,s(MQ({transition:t,duration:h,state:g,timingFunction:x})))}rE.displayName="@mantine/core/Transition";function oE({children:e,active:t=!0,refProp:n="ref"}){const r=zG(t),o=Bd(r,e==null?void 0:e.ref);return MP(e)?d.cloneElement(e,{[n]:o}):e}oE.displayName="@mantine/core/FocusTrap";var RQ=Object.defineProperty,DQ=Object.defineProperties,AQ=Object.getOwnPropertyDescriptors,dk=Object.getOwnPropertySymbols,TQ=Object.prototype.hasOwnProperty,NQ=Object.prototype.propertyIsEnumerable,fk=(e,t,n)=>t in e?RQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Na=(e,t)=>{for(var n in t||(t={}))TQ.call(t,n)&&fk(e,n,t[n]);if(dk)for(var n of dk(t))NQ.call(t,n)&&fk(e,n,t[n]);return e},hp=(e,t)=>DQ(e,AQ(t));function pk(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function mk(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const $Q={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function LQ({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:l}){const[u,p="center"]=e.split("-"),m={width:Re(t),height:Re(t),transform:"rotate(45deg)",position:"absolute",[$Q[u]]:Re(r)},h=Re(-t/2);return u==="left"?hp(Na(Na({},m),pk(p,i,n,o)),{right:h,borderLeftColor:"transparent",borderBottomColor:"transparent"}):u==="right"?hp(Na(Na({},m),pk(p,i,n,o)),{left:h,borderRightColor:"transparent",borderTopColor:"transparent"}):u==="top"?hp(Na(Na({},m),mk(p,s,n,o,l)),{bottom:h,borderTopColor:"transparent",borderLeftColor:"transparent"}):u==="bottom"?hp(Na(Na({},m),mk(p,s,n,o,l)),{top:h,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var zQ=Object.defineProperty,FQ=Object.defineProperties,BQ=Object.getOwnPropertyDescriptors,Tm=Object.getOwnPropertySymbols,sE=Object.prototype.hasOwnProperty,aE=Object.prototype.propertyIsEnumerable,hk=(e,t,n)=>t in e?zQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HQ=(e,t)=>{for(var n in t||(t={}))sE.call(t,n)&&hk(e,n,t[n]);if(Tm)for(var n of Tm(t))aE.call(t,n)&&hk(e,n,t[n]);return e},VQ=(e,t)=>FQ(e,BQ(t)),WQ=(e,t)=>{var n={};for(var r in e)sE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tm)for(var r of Tm(e))t.indexOf(r)<0&&aE.call(e,r)&&(n[r]=e[r]);return n};const iE=d.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,visible:u,arrowX:p,arrowY:m}=n,h=WQ(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const g=xa();return u?H.createElement("div",VQ(HQ({},h),{ref:t,style:LQ({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,dir:g.dir,arrowX:p,arrowY:m})})):null});iE.displayName="@mantine/core/FloatingArrow";var UQ=Object.defineProperty,GQ=Object.defineProperties,KQ=Object.getOwnPropertyDescriptors,Nm=Object.getOwnPropertySymbols,lE=Object.prototype.hasOwnProperty,cE=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?UQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ll=(e,t)=>{for(var n in t||(t={}))lE.call(t,n)&&gk(e,n,t[n]);if(Nm)for(var n of Nm(t))cE.call(t,n)&&gk(e,n,t[n]);return e},gp=(e,t)=>GQ(e,KQ(t)),qQ=(e,t)=>{var n={};for(var r in e)lE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nm)for(var r of Nm(e))t.indexOf(r)<0&&cE.call(e,r)&&(n[r]=e[r]);return n};const XQ={};function uE(e){var t;const n=Dn("PopoverDropdown",XQ,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,l=qQ(n,["style","className","children","onKeyDownCapture"]),u=J6(),{classes:p,cx:m}=_Q({radius:u.radius,shadow:u.shadow},{name:u.__staticSelector,classNames:u.classNames,styles:u.styles,unstyled:u.unstyled,variant:u.variant}),h=RG({opened:u.opened,shouldReturnFocus:u.returnFocus}),g=u.withRoles?{"aria-labelledby":u.getTargetId(),id:u.getDropdownId(),role:"dialog"}:{};return u.disabled?null:H.createElement(u6,gp(Ll({},u.portalProps),{withinPortal:u.withinPortal}),H.createElement(rE,gp(Ll({mounted:u.opened},u.transitionProps),{transition:u.transitionProps.transition||"fade",duration:(t=u.transitionProps.duration)!=null?t:150,keepMounted:u.keepMounted,exitDuration:typeof u.transitionProps.exitDuration=="number"?u.transitionProps.exitDuration:u.transitionProps.duration}),x=>{var y,b;return H.createElement(oE,{active:u.trapFocus},H.createElement(zr,Ll(gp(Ll({},g),{tabIndex:-1,ref:u.floating,style:gp(Ll(Ll({},r),x),{zIndex:u.zIndex,top:(y=u.y)!=null?y:0,left:(b=u.x)!=null?b:0,width:u.width==="target"?void 0:Re(u.width)}),className:m(p.dropdown,o),onKeyDownCapture:iG(u.onClose,{active:u.closeOnEscape,onTrigger:h,onKeyDown:i}),"data-position":u.placement}),l),s,H.createElement(iE,{ref:u.arrowRef,arrowX:u.arrowX,arrowY:u.arrowY,visible:u.withArrow,position:u.placement,arrowSize:u.arrowSize,arrowRadius:u.arrowRadius,arrowOffset:u.arrowOffset,arrowPosition:u.arrowPosition,className:p.arrow})))}))}uE.displayName="@mantine/core/PopoverDropdown";function QQ(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var vk=Object.getOwnPropertySymbols,YQ=Object.prototype.hasOwnProperty,ZQ=Object.prototype.propertyIsEnumerable,JQ=(e,t)=>{var n={};for(var r in e)YQ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vk)for(var r of vk(e))t.indexOf(r)<0&&ZQ.call(e,r)&&(n[r]=e[r]);return n};const eY={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:ey("popover"),__staticSelector:"Popover",width:"max-content"};function Bc(e){var t,n,r,o,s,i;const l=d.useRef(null),u=Dn("Popover",eY,e),{children:p,position:m,offset:h,onPositionChange:g,positionDependencies:x,opened:y,transitionProps:b,width:w,middlewares:S,withArrow:j,arrowSize:_,arrowOffset:E,arrowRadius:I,arrowPosition:M,unstyled:R,classNames:D,styles:A,closeOnClickOutside:O,withinPortal:T,portalProps:X,closeOnEscape:B,clickOutsideEvents:V,trapFocus:U,onClose:N,onOpen:$,onChange:q,zIndex:F,radius:Q,shadow:Y,id:se,defaultOpened:ae,__staticSelector:re,withRoles:G,disabled:K,returnFocus:ee,variant:ce,keepMounted:J}=u,ie=JQ(u,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[de,ge]=d.useState(null),[Ce,he]=d.useState(null),fe=ny(se),Oe=xa(),_e=vQ({middlewares:S,width:w,position:QQ(Oe.dir,m),offset:typeof h=="number"?h+(j?_/2:0):h,arrowRef:l,arrowOffset:E,onPositionChange:g,positionDependencies:x,opened:y,defaultOpened:ae,onChange:q,onOpen:$,onClose:N});PG(()=>_e.opened&&O&&_e.onClose(),V,[de,Ce]);const Ne=d.useCallback($e=>{ge($e),_e.floating.reference($e)},[_e.floating.reference]),nt=d.useCallback($e=>{he($e),_e.floating.floating($e)},[_e.floating.floating]);return H.createElement(xQ,{value:{returnFocus:ee,disabled:K,controlled:_e.controlled,reference:Ne,floating:nt,x:_e.floating.x,y:_e.floating.y,arrowX:(r=(n=(t=_e.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(i=(s=(o=_e.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:i.y,opened:_e.opened,arrowRef:l,transitionProps:b,width:w,withArrow:j,arrowSize:_,arrowOffset:E,arrowRadius:I,arrowPosition:M,placement:_e.floating.placement,trapFocus:U,withinPortal:T,portalProps:X,zIndex:F,radius:Q,shadow:Y,closeOnEscape:B,onClose:_e.onClose,onToggle:_e.onToggle,getTargetId:()=>`${fe}-target`,getDropdownId:()=>`${fe}-dropdown`,withRoles:G,targetProps:ie,__staticSelector:re,classNames:D,styles:A,unstyled:R,variant:ce,keepMounted:J}},p)}Bc.Target=nE;Bc.Dropdown=uE;Bc.displayName="@mantine/core/Popover";var tY=Object.defineProperty,$m=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,xk=(e,t,n)=>t in e?tY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nY=(e,t)=>{for(var n in t||(t={}))dE.call(t,n)&&xk(e,n,t[n]);if($m)for(var n of $m(t))fE.call(t,n)&&xk(e,n,t[n]);return e},rY=(e,t)=>{var n={};for(var r in e)dE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$m)for(var r of $m(e))t.indexOf(r)<0&&fE.call(e,r)&&(n[r]=e[r]);return n};function oY(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:l,__staticSelector:u,styles:p,classNames:m,unstyled:h}=t,g=rY(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:x}=zX(null,{name:u,styles:p,classNames:m,unstyled:h});return H.createElement(Bc.Dropdown,nY({p:0,onMouseDown:y=>y.preventDefault()},g),H.createElement("div",{style:{maxHeight:Re(o),display:"flex"}},H.createElement(zr,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==og?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},H.createElement("div",{className:x.itemsWrapper,style:{flexDirection:s}},n))))}function Ka({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:i,onDirectionChange:l,switchDirectionOnFlip:u,zIndex:p,dropdownPosition:m,positionDependencies:h=[],classNames:g,styles:x,unstyled:y,readOnly:b,variant:w}){return H.createElement(Bc,{unstyled:y,classNames:g,styles:x,width:"target",withRoles:!1,opened:e,middlewares:{flip:m==="flip",shift:!1},position:m==="flip"?"bottom":m,positionDependencies:h,zIndex:p,__staticSelector:i,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:b,onPositionChange:S=>u&&(l==null?void 0:l(S==="top"?"column-reverse":"column")),variant:w},s)}Ka.Target=Bc.Target;Ka.Dropdown=oY;var sY=Object.defineProperty,aY=Object.defineProperties,iY=Object.getOwnPropertyDescriptors,Lm=Object.getOwnPropertySymbols,pE=Object.prototype.hasOwnProperty,mE=Object.prototype.propertyIsEnumerable,bk=(e,t,n)=>t in e?sY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vp=(e,t)=>{for(var n in t||(t={}))pE.call(t,n)&&bk(e,n,t[n]);if(Lm)for(var n of Lm(t))mE.call(t,n)&&bk(e,n,t[n]);return e},lY=(e,t)=>aY(e,iY(t)),cY=(e,t)=>{var n={};for(var r in e)pE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lm)for(var r of Lm(e))t.indexOf(r)<0&&mE.call(e,r)&&(n[r]=e[r]);return n};function hE(e,t,n){const r=Dn(e,t,n),{label:o,description:s,error:i,required:l,classNames:u,styles:p,className:m,unstyled:h,__staticSelector:g,sx:x,errorProps:y,labelProps:b,descriptionProps:w,wrapperProps:S,id:j,size:_,style:E,inputContainer:I,inputWrapperOrder:M,withAsterisk:R,variant:D}=r,A=cY(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),O=ny(j),{systemStyles:T,rest:X}=eg(A),B=vp({label:o,description:s,error:i,required:l,classNames:u,className:m,__staticSelector:g,sx:x,errorProps:y,labelProps:b,descriptionProps:w,unstyled:h,styles:p,id:O,size:_,style:E,inputContainer:I,inputWrapperOrder:M,withAsterisk:R,variant:D},S);return lY(vp({},X),{classNames:u,styles:p,unstyled:h,wrapperProps:vp(vp({},B),T),inputProps:{required:l,classNames:u,styles:p,unstyled:h,id:O,size:_,__staticSelector:g,error:i,variant:D}})}var uY=fr((e,t,{size:n})=>({label:{display:"inline-block",fontSize:mt({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const dY=uY;var fY=Object.defineProperty,zm=Object.getOwnPropertySymbols,gE=Object.prototype.hasOwnProperty,vE=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?fY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pY=(e,t)=>{for(var n in t||(t={}))gE.call(t,n)&&yk(e,n,t[n]);if(zm)for(var n of zm(t))vE.call(t,n)&&yk(e,n,t[n]);return e},mY=(e,t)=>{var n={};for(var r in e)gE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zm)for(var r of zm(e))t.indexOf(r)<0&&vE.call(e,r)&&(n[r]=e[r]);return n};const hY={labelElement:"label",size:"sm"},dy=d.forwardRef((e,t)=>{const n=Dn("InputLabel",hY,e),{labelElement:r,children:o,required:s,size:i,classNames:l,styles:u,unstyled:p,className:m,htmlFor:h,__staticSelector:g,variant:x,onMouseDown:y}=n,b=mY(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:w,cx:S}=dY(null,{name:["InputWrapper",g],classNames:l,styles:u,unstyled:p,variant:x,size:i});return H.createElement(zr,pY({component:r,ref:t,className:S(w.label,m),htmlFor:r==="label"?h:void 0,onMouseDown:j=>{y==null||y(j),!j.defaultPrevented&&j.detail>1&&j.preventDefault()}},b),o,s&&H.createElement("span",{className:w.required,"aria-hidden":!0}," *"))});dy.displayName="@mantine/core/InputLabel";var gY=fr((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${mt({size:n,sizes:e.fontSizes})} - ${Re(2)})`,lineHeight:1.2,display:"block"}}));const vY=gY;var xY=Object.defineProperty,Fm=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,Ck=(e,t,n)=>t in e?xY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bY=(e,t)=>{for(var n in t||(t={}))xE.call(t,n)&&Ck(e,n,t[n]);if(Fm)for(var n of Fm(t))bE.call(t,n)&&Ck(e,n,t[n]);return e},yY=(e,t)=>{var n={};for(var r in e)xE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fm)for(var r of Fm(e))t.indexOf(r)<0&&bE.call(e,r)&&(n[r]=e[r]);return n};const CY={size:"sm"},fy=d.forwardRef((e,t)=>{const n=Dn("InputError",CY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:u,__staticSelector:p,variant:m}=n,h=yY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:g,cx:x}=vY(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:m,size:u});return H.createElement(wc,bY({className:x(g.error,o),ref:t},h),r)});fy.displayName="@mantine/core/InputError";var wY=fr((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${mt({size:n,sizes:e.fontSizes})} - ${Re(2)})`,lineHeight:1.2,display:"block"}}));const SY=wY;var kY=Object.defineProperty,Bm=Object.getOwnPropertySymbols,yE=Object.prototype.hasOwnProperty,CE=Object.prototype.propertyIsEnumerable,wk=(e,t,n)=>t in e?kY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jY=(e,t)=>{for(var n in t||(t={}))yE.call(t,n)&&wk(e,n,t[n]);if(Bm)for(var n of Bm(t))CE.call(t,n)&&wk(e,n,t[n]);return e},_Y=(e,t)=>{var n={};for(var r in e)yE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bm)for(var r of Bm(e))t.indexOf(r)<0&&CE.call(e,r)&&(n[r]=e[r]);return n};const IY={size:"sm"},py=d.forwardRef((e,t)=>{const n=Dn("InputDescription",IY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:u,__staticSelector:p,variant:m}=n,h=_Y(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:g,cx:x}=SY(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:m,size:u});return H.createElement(wc,jY({color:"dimmed",className:x(g.description,o),ref:t,unstyled:l},h),r)});py.displayName="@mantine/core/InputDescription";const wE=d.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),PY=wE.Provider,EY=()=>d.useContext(wE);function MY(e,{hasDescription:t,hasError:n}){const r=e.findIndex(u=>u==="input"),o=e[r-1],s=e[r+1];return{offsetBottom:t&&s==="description"||n&&s==="error",offsetTop:t&&o==="description"||n&&o==="error"}}var OY=Object.defineProperty,RY=Object.defineProperties,DY=Object.getOwnPropertyDescriptors,Sk=Object.getOwnPropertySymbols,AY=Object.prototype.hasOwnProperty,TY=Object.prototype.propertyIsEnumerable,kk=(e,t,n)=>t in e?OY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NY=(e,t)=>{for(var n in t||(t={}))AY.call(t,n)&&kk(e,n,t[n]);if(Sk)for(var n of Sk(t))TY.call(t,n)&&kk(e,n,t[n]);return e},$Y=(e,t)=>RY(e,DY(t)),LY=fr(e=>({root:$Y(NY({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const zY=LY;var FY=Object.defineProperty,BY=Object.defineProperties,HY=Object.getOwnPropertyDescriptors,Hm=Object.getOwnPropertySymbols,SE=Object.prototype.hasOwnProperty,kE=Object.prototype.propertyIsEnumerable,jk=(e,t,n)=>t in e?FY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$a=(e,t)=>{for(var n in t||(t={}))SE.call(t,n)&&jk(e,n,t[n]);if(Hm)for(var n of Hm(t))kE.call(t,n)&&jk(e,n,t[n]);return e},_k=(e,t)=>BY(e,HY(t)),VY=(e,t)=>{var n={};for(var r in e)SE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hm)for(var r of Hm(e))t.indexOf(r)<0&&kE.call(e,r)&&(n[r]=e[r]);return n};const WY={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},jE=d.forwardRef((e,t)=>{const n=Dn("InputWrapper",WY,e),{className:r,label:o,children:s,required:i,id:l,error:u,description:p,labelElement:m,labelProps:h,descriptionProps:g,errorProps:x,classNames:y,styles:b,size:w,inputContainer:S,__staticSelector:j,unstyled:_,inputWrapperOrder:E,withAsterisk:I,variant:M}=n,R=VY(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:D,cx:A}=zY(null,{classNames:y,styles:b,name:["InputWrapper",j],unstyled:_,variant:M,size:w}),O={classNames:y,styles:b,unstyled:_,size:w,variant:M,__staticSelector:j},T=typeof I=="boolean"?I:i,X=l?`${l}-error`:x==null?void 0:x.id,B=l?`${l}-description`:g==null?void 0:g.id,U=`${!!u&&typeof u!="boolean"?X:""} ${p?B:""}`,N=U.trim().length>0?U.trim():void 0,$=o&&H.createElement(dy,$a($a({key:"label",labelElement:m,id:l?`${l}-label`:void 0,htmlFor:l,required:T},O),h),o),q=p&&H.createElement(py,_k($a($a({key:"description"},g),O),{size:(g==null?void 0:g.size)||O.size,id:(g==null?void 0:g.id)||B}),p),F=H.createElement(d.Fragment,{key:"input"},S(s)),Q=typeof u!="boolean"&&u&&H.createElement(fy,_k($a($a({},x),O),{size:(x==null?void 0:x.size)||O.size,key:"error",id:(x==null?void 0:x.id)||X}),u),Y=E.map(se=>{switch(se){case"label":return $;case"input":return F;case"description":return q;case"error":return Q;default:return null}});return H.createElement(PY,{value:$a({describedBy:N},MY(E,{hasDescription:!!q,hasError:!!Q}))},H.createElement(zr,$a({className:A(D.root,r),ref:t},R),Y))});jE.displayName="@mantine/core/InputWrapper";var UY=Object.defineProperty,Vm=Object.getOwnPropertySymbols,_E=Object.prototype.hasOwnProperty,IE=Object.prototype.propertyIsEnumerable,Ik=(e,t,n)=>t in e?UY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GY=(e,t)=>{for(var n in t||(t={}))_E.call(t,n)&&Ik(e,n,t[n]);if(Vm)for(var n of Vm(t))IE.call(t,n)&&Ik(e,n,t[n]);return e},KY=(e,t)=>{var n={};for(var r in e)_E.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vm)for(var r of Vm(e))t.indexOf(r)<0&&IE.call(e,r)&&(n[r]=e[r]);return n};const qY={},PE=d.forwardRef((e,t)=>{const n=Dn("InputPlaceholder",qY,e),{sx:r}=n,o=KY(n,["sx"]);return H.createElement(zr,GY({component:"span",sx:[s=>s.fn.placeholderStyles(),...PP(r)],ref:t},o))});PE.displayName="@mantine/core/InputPlaceholder";var XY=Object.defineProperty,QY=Object.defineProperties,YY=Object.getOwnPropertyDescriptors,Pk=Object.getOwnPropertySymbols,ZY=Object.prototype.hasOwnProperty,JY=Object.prototype.propertyIsEnumerable,Ek=(e,t,n)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xp=(e,t)=>{for(var n in t||(t={}))ZY.call(t,n)&&Ek(e,n,t[n]);if(Pk)for(var n of Pk(t))JY.call(t,n)&&Ek(e,n,t[n]);return e},Pv=(e,t)=>QY(e,YY(t));const mo={xs:Re(30),sm:Re(36),md:Re(42),lg:Re(50),xl:Re(60)},eZ=["default","filled","unstyled"];function tZ({theme:e,variant:t}){return eZ.includes(t)?t==="default"?{border:`${Re(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${Re(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:Re(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var nZ=fr((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:l,offsetTop:u,pointer:p},{variant:m,size:h})=>{const g=e.fn.variant({variant:"filled",color:"red"}).background,x=m==="default"||m==="filled"?{minHeight:mt({size:h,sizes:mo}),paddingLeft:`calc(${mt({size:h,sizes:mo})} / 3)`,paddingRight:s?o||mt({size:h,sizes:mo}):`calc(${mt({size:h,sizes:mo})} / 3)`,borderRadius:e.fn.radius(n)}:m==="unstyled"&&s?{paddingRight:o||mt({size:h,sizes:mo})}:null;return{wrapper:{position:"relative",marginTop:u?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:Pv(xp(xp(Pv(xp({},e.fn.fontStyles()),{height:t?m==="unstyled"?void 0:"auto":mt({size:h,sizes:mo}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${mt({size:h,sizes:mo})} - ${Re(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:mt({size:h,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:p?"pointer":void 0}),tZ({theme:e,variant:m})),x),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:g,borderColor:g,"&::placeholder":{opacity:1,color:g}},"&[data-with-icon]":{paddingLeft:typeof i=="number"?Re(i):mt({size:h,sizes:mo})},"&::placeholder":Pv(xp({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:i?Re(i):mt({size:h,sizes:mo}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||mt({size:h,sizes:mo})}}});const rZ=nZ;var oZ=Object.defineProperty,sZ=Object.defineProperties,aZ=Object.getOwnPropertyDescriptors,Wm=Object.getOwnPropertySymbols,EE=Object.prototype.hasOwnProperty,ME=Object.prototype.propertyIsEnumerable,Mk=(e,t,n)=>t in e?oZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bp=(e,t)=>{for(var n in t||(t={}))EE.call(t,n)&&Mk(e,n,t[n]);if(Wm)for(var n of Wm(t))ME.call(t,n)&&Mk(e,n,t[n]);return e},Ok=(e,t)=>sZ(e,aZ(t)),iZ=(e,t)=>{var n={};for(var r in e)EE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wm)for(var r of Wm(e))t.indexOf(r)<0&&ME.call(e,r)&&(n[r]=e[r]);return n};const lZ={size:"sm",variant:"default"},il=d.forwardRef((e,t)=>{const n=Dn("Input",lZ,e),{className:r,error:o,required:s,disabled:i,variant:l,icon:u,style:p,rightSectionWidth:m,iconWidth:h,rightSection:g,rightSectionProps:x,radius:y,size:b,wrapperProps:w,classNames:S,styles:j,__staticSelector:_,multiline:E,sx:I,unstyled:M,pointer:R}=n,D=iZ(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:A,offsetTop:O,describedBy:T}=EY(),{classes:X,cx:B}=rZ({radius:y,multiline:E,invalid:!!o,rightSectionWidth:m?Re(m):void 0,iconWidth:h,withRightSection:!!g,offsetBottom:A,offsetTop:O,pointer:R},{classNames:S,styles:j,name:["Input",_],unstyled:M,variant:l,size:b}),{systemStyles:V,rest:U}=eg(D);return H.createElement(zr,bp(bp({className:B(X.wrapper,r),sx:I,style:p},V),w),u&&H.createElement("div",{className:X.icon},u),H.createElement(zr,Ok(bp({component:"input"},U),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":T,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!u||void 0,"data-invalid":!!o||void 0,className:X.input})),g&&H.createElement("div",Ok(bp({},x),{className:X.rightSection}),g))});il.displayName="@mantine/core/Input";il.Wrapper=jE;il.Label=dy;il.Description=py;il.Error=fy;il.Placeholder=PE;const _c=il;var cZ=Object.defineProperty,Um=Object.getOwnPropertySymbols,OE=Object.prototype.hasOwnProperty,RE=Object.prototype.propertyIsEnumerable,Rk=(e,t,n)=>t in e?cZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dk=(e,t)=>{for(var n in t||(t={}))OE.call(t,n)&&Rk(e,n,t[n]);if(Um)for(var n of Um(t))RE.call(t,n)&&Rk(e,n,t[n]);return e},uZ=(e,t)=>{var n={};for(var r in e)OE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Um)for(var r of Um(e))t.indexOf(r)<0&&RE.call(e,r)&&(n[r]=e[r]);return n};const dZ={multiple:!1},DE=d.forwardRef((e,t)=>{const n=Dn("FileButton",dZ,e),{onChange:r,children:o,multiple:s,accept:i,name:l,form:u,resetRef:p,disabled:m,capture:h,inputProps:g}=n,x=uZ(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),y=d.useRef(),b=()=>{!m&&y.current.click()},w=j=>{r(s?Array.from(j.currentTarget.files):j.currentTarget.files[0]||null)};return LP(p,()=>{y.current.value=""}),H.createElement(H.Fragment,null,o(Dk({onClick:b},x)),H.createElement("input",Dk({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:w,ref:Bd(t,y),name:l,form:u,capture:h},g)))});DE.displayName="@mantine/core/FileButton";const AE={xs:Re(16),sm:Re(22),md:Re(26),lg:Re(30),xl:Re(36)},fZ={xs:Re(10),sm:Re(12),md:Re(14),lg:Re(16),xl:Re(18)};var pZ=fr((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:mt({size:o,sizes:AE}),paddingLeft:`calc(${mt({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?mt({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:mt({size:o,sizes:fZ}),borderRadius:mt({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Re(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${mt({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const mZ=pZ;var hZ=Object.defineProperty,Gm=Object.getOwnPropertySymbols,TE=Object.prototype.hasOwnProperty,NE=Object.prototype.propertyIsEnumerable,Ak=(e,t,n)=>t in e?hZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gZ=(e,t)=>{for(var n in t||(t={}))TE.call(t,n)&&Ak(e,n,t[n]);if(Gm)for(var n of Gm(t))NE.call(t,n)&&Ak(e,n,t[n]);return e},vZ=(e,t)=>{var n={};for(var r in e)TE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gm)for(var r of Gm(e))t.indexOf(r)<0&&NE.call(e,r)&&(n[r]=e[r]);return n};const xZ={xs:16,sm:22,md:24,lg:26,xl:30};function $E(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:l,readOnly:u,size:p,radius:m="sm",variant:h,unstyled:g}=t,x=vZ(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:b}=mZ({disabled:l,readOnly:u,radius:m},{name:"MultiSelect",classNames:r,styles:o,unstyled:g,size:p,variant:h});return H.createElement("div",gZ({className:b(y.defaultValue,s)},x),H.createElement("span",{className:y.defaultValueLabel},n),!l&&!u&&H.createElement(v6,{"aria-hidden":!0,onMouseDown:i,size:xZ[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:g}))}$E.displayName="@mantine/core/MultiSelect/DefaultValue";function bZ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:i}){if(!t&&s.length===0)return e;if(!t){const u=[];for(let p=0;p<e.length;p+=1)(i||!s.some(m=>m===e[p].value&&!e[p].disabled))&&u.push(e[p]);return u}const l=[];for(let u=0;u<e.length&&(o(r,!i&&s.some(p=>p===e[u].value&&!e[u].disabled),e[u])&&l.push(e[u]),!(l.length>=n));u+=1);return l}var yZ=Object.defineProperty,Km=Object.getOwnPropertySymbols,LE=Object.prototype.hasOwnProperty,zE=Object.prototype.propertyIsEnumerable,Tk=(e,t,n)=>t in e?yZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nk=(e,t)=>{for(var n in t||(t={}))LE.call(t,n)&&Tk(e,n,t[n]);if(Km)for(var n of Km(t))zE.call(t,n)&&Tk(e,n,t[n]);return e},CZ=(e,t)=>{var n={};for(var r in e)LE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Km)for(var r of Km(e))t.indexOf(r)<0&&zE.call(e,r)&&(n[r]=e[r]);return n};const wZ={xs:Re(14),sm:Re(18),md:Re(20),lg:Re(24),xl:Re(28)};function SZ(e){var t=e,{size:n,error:r,style:o}=t,s=CZ(t,["size","error","style"]);const i=xa(),l=mt({size:n,sizes:wZ});return H.createElement("svg",Nk({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Nk({color:r?i.colors.red[6]:i.colors.gray[6],width:l,height:l},o),"data-chevron":!0},s),H.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var kZ=Object.defineProperty,jZ=Object.defineProperties,_Z=Object.getOwnPropertyDescriptors,$k=Object.getOwnPropertySymbols,IZ=Object.prototype.hasOwnProperty,PZ=Object.prototype.propertyIsEnumerable,Lk=(e,t,n)=>t in e?kZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EZ=(e,t)=>{for(var n in t||(t={}))IZ.call(t,n)&&Lk(e,n,t[n]);if($k)for(var n of $k(t))PZ.call(t,n)&&Lk(e,n,t[n]);return e},MZ=(e,t)=>jZ(e,_Z(t));function FE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement(v6,MZ(EZ({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement(SZ,{error:o,size:r})}FE.displayName="@mantine/core/SelectRightSection";var OZ=Object.defineProperty,RZ=Object.defineProperties,DZ=Object.getOwnPropertyDescriptors,qm=Object.getOwnPropertySymbols,BE=Object.prototype.hasOwnProperty,HE=Object.prototype.propertyIsEnumerable,zk=(e,t,n)=>t in e?OZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ev=(e,t)=>{for(var n in t||(t={}))BE.call(t,n)&&zk(e,n,t[n]);if(qm)for(var n of qm(t))HE.call(t,n)&&zk(e,n,t[n]);return e},Fk=(e,t)=>RZ(e,DZ(t)),AZ=(e,t)=>{var n={};for(var r in e)BE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qm)for(var r of qm(e))t.indexOf(r)<0&&HE.call(e,r)&&(n[r]=e[r]);return n};function VE(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=AZ(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const l=typeof n=="function"?n(s):n;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&H.createElement(FE,Ev({},i)),styles:Fk(Ev({},l),{rightSection:Fk(Ev({},l==null?void 0:l.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var TZ=Object.defineProperty,NZ=Object.defineProperties,$Z=Object.getOwnPropertyDescriptors,Bk=Object.getOwnPropertySymbols,LZ=Object.prototype.hasOwnProperty,zZ=Object.prototype.propertyIsEnumerable,Hk=(e,t,n)=>t in e?TZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FZ=(e,t)=>{for(var n in t||(t={}))LZ.call(t,n)&&Hk(e,n,t[n]);if(Bk)for(var n of Bk(t))zZ.call(t,n)&&Hk(e,n,t[n]);return e},BZ=(e,t)=>NZ(e,$Z(t)),HZ=fr((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${mt({size:n,sizes:mo})} - ${Re(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:mt({size:n,sizes:mo})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Re(2)}) calc(${e.spacing.xs} / 2)`},searchInput:BZ(FZ({},e.fn.fontStyles()),{flex:1,minWidth:Re(60),backgroundColor:"transparent",border:0,outline:0,fontSize:mt({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:mt({size:n,sizes:AE}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const VZ=HZ;var WZ=Object.defineProperty,UZ=Object.defineProperties,GZ=Object.getOwnPropertyDescriptors,Xm=Object.getOwnPropertySymbols,WE=Object.prototype.hasOwnProperty,UE=Object.prototype.propertyIsEnumerable,Vk=(e,t,n)=>t in e?WZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zl=(e,t)=>{for(var n in t||(t={}))WE.call(t,n)&&Vk(e,n,t[n]);if(Xm)for(var n of Xm(t))UE.call(t,n)&&Vk(e,n,t[n]);return e},Wk=(e,t)=>UZ(e,GZ(t)),KZ=(e,t)=>{var n={};for(var r in e)WE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xm)for(var r of Xm(e))t.indexOf(r)<0&&UE.call(e,r)&&(n[r]=e[r]);return n};function qZ(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function XZ(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function Uk(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=t.map(r=>typeof r=="object"?r.value:r);return e.filter(r=>n.includes(r))}const QZ={size:"sm",valueComponent:$E,itemComponent:oy,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:qZ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:XZ,switchDirectionOnFlip:!1,zIndex:ey("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},GE=d.forwardRef((e,t)=>{const n=Dn("MultiSelect",QZ,e),{className:r,style:o,required:s,label:i,description:l,size:u,error:p,classNames:m,styles:h,wrapperProps:g,value:x,defaultValue:y,data:b,onChange:w,valueComponent:S,itemComponent:j,id:_,transitionProps:E,maxDropdownHeight:I,shadow:M,nothingFound:R,onFocus:D,onBlur:A,searchable:O,placeholder:T,filter:X,limit:B,clearSearchOnChange:V,clearable:U,clearSearchOnBlur:N,variant:$,onSearchChange:q,searchValue:F,disabled:Q,initiallyOpened:Y,radius:se,icon:ae,rightSection:re,rightSectionWidth:G,creatable:K,getCreateLabel:ee,shouldCreate:ce,onCreate:J,sx:ie,dropdownComponent:de,onDropdownClose:ge,onDropdownOpen:Ce,maxSelectedValues:he,withinPortal:fe,portalProps:Oe,switchDirectionOnFlip:_e,zIndex:Ne,selectOnBlur:nt,name:$e,dropdownPosition:Pt,errorProps:Ze,labelProps:ot,descriptionProps:ye,form:De,positionDependencies:ut,onKeyDown:bt,unstyled:be,inputContainer:Je,inputWrapperOrder:lt,readOnly:ft,withAsterisk:Me,clearButtonProps:Le,hoverOnSearchChange:Ut,disableSelectedItemFiltering:ke}=n,Be=KZ(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:ze,cx:Ge,theme:pt}=VZ({invalid:!!p},{name:"MultiSelect",classNames:m,styles:h,unstyled:be,size:u,variant:$}),{systemStyles:En,rest:Dt}=eg(Be),At=d.useRef(),pr=d.useRef({}),Ln=ny(_),[kn,gn]=d.useState(Y),[ln,kr]=d.useState(-1),[Mo,mr]=d.useState("column"),[hr,Ns]=od({value:F,defaultValue:"",finalValue:void 0,onChange:q}),[$s,wa]=d.useState(!1),{scrollIntoView:Sa,targetRef:ml,scrollableRef:ka}=FP({duration:0,offset:5,cancelable:!1,isList:!0}),hl=K&&typeof ee=="function";let Qe=null;const Gt=b.map(rt=>typeof rt=="string"?{label:rt,value:rt}:rt),zn=EP({data:Gt}),[St,ja]=od({value:Uk(x,b),defaultValue:Uk(y,b),finalValue:[],onChange:w}),Wr=d.useRef(!!he&&he<St.length),ef=rt=>{if(!ft){const Mt=St.filter(kt=>kt!==rt);ja(Mt),he&&Mt.length<he&&(Wr.current=!1)}},zg=rt=>{Ns(rt.currentTarget.value),!Q&&!Wr.current&&O&&gn(!0)},Fg=rt=>{typeof D=="function"&&D(rt),!Q&&!Wr.current&&O&&gn(!0)},Fn=bZ({data:zn,searchable:O,searchValue:hr,limit:B,filter:X,value:St,disableSelectedItemFiltering:ke});hl&&ce(hr,zn)&&(Qe=ee(hr),Fn.push({label:hr,value:hr,creatable:!0}));const Ls=Math.min(ln,Fn.length-1),tf=(rt,Mt,kt)=>{let Ot=rt;for(;kt(Ot);)if(Ot=Mt(Ot),!Fn[Ot].disabled)return Ot;return rt};Uo(()=>{kr(Ut&&hr?0:-1)},[hr,Ut]),Uo(()=>{!Q&&St.length>b.length&&gn(!1),he&&St.length<he&&(Wr.current=!1),he&&St.length>=he&&(Wr.current=!0,gn(!1))},[St]);const gl=rt=>{if(!ft)if(V&&Ns(""),St.includes(rt.value))ef(rt.value);else{if(rt.creatable&&typeof J=="function"){const Mt=J(rt.value);typeof Mt<"u"&&Mt!==null&&ja(typeof Mt=="string"?[...St,Mt]:[...St,Mt.value])}else ja([...St,rt.value]);St.length===he-1&&(Wr.current=!0,gn(!1)),Fn.length===1&&gn(!1)}},Zc=rt=>{typeof A=="function"&&A(rt),nt&&Fn[Ls]&&kn&&gl(Fn[Ls]),N&&Ns(""),gn(!1)},hi=rt=>{if($s||(bt==null||bt(rt),ft)||rt.key!=="Backspace"&&he&&Wr.current)return;const Mt=Mo==="column",kt=()=>{kr(rr=>{var rn;const An=tf(rr,gr=>gr+1,gr=>gr<Fn.length-1);return kn&&(ml.current=pr.current[(rn=Fn[An])==null?void 0:rn.value],Sa({alignment:Mt?"end":"start"})),An})},Ot=()=>{kr(rr=>{var rn;const An=tf(rr,gr=>gr-1,gr=>gr>0);return kn&&(ml.current=pr.current[(rn=Fn[An])==null?void 0:rn.value],Sa({alignment:Mt?"start":"end"})),An})};switch(rt.key){case"ArrowUp":{rt.preventDefault(),gn(!0),Mt?Ot():kt();break}case"ArrowDown":{rt.preventDefault(),gn(!0),Mt?kt():Ot();break}case"Enter":{rt.preventDefault(),Fn[Ls]&&kn?gl(Fn[Ls]):gn(!0);break}case" ":{O||(rt.preventDefault(),Fn[Ls]&&kn?gl(Fn[Ls]):gn(!0));break}case"Backspace":{St.length>0&&hr.length===0&&(ja(St.slice(0,-1)),gn(!0),he&&(Wr.current=!1));break}case"Home":{if(!O){rt.preventDefault(),kn||gn(!0);const rr=Fn.findIndex(rn=>!rn.disabled);kr(rr),Sa({alignment:Mt?"end":"start"})}break}case"End":{if(!O){rt.preventDefault(),kn||gn(!0);const rr=Fn.map(rn=>!!rn.disabled).lastIndexOf(!1);kr(rr),Sa({alignment:Mt?"end":"start"})}break}case"Escape":gn(!1)}},Jc=St.map(rt=>{let Mt=zn.find(kt=>kt.value===rt&&!kt.disabled);return!Mt&&hl&&(Mt={value:rt,label:rt}),Mt}).filter(rt=>!!rt).map((rt,Mt)=>H.createElement(S,Wk(zl({},rt),{variant:$,disabled:Q,className:ze.value,readOnly:ft,onRemove:kt=>{kt.preventDefault(),kt.stopPropagation(),ef(rt.value)},key:rt.value,size:u,styles:h,classNames:m,radius:se,index:Mt}))),eu=rt=>St.includes(rt),Bg=()=>{var rt;Ns(""),ja([]),(rt=At.current)==null||rt.focus(),he&&(Wr.current=!1)},_a=!ft&&(Fn.length>0?kn:kn&&!!R);return Uo(()=>{const rt=_a?Ce:ge;typeof rt=="function"&&rt()},[_a]),H.createElement(_c.Wrapper,zl(zl({required:s,id:Ln,label:i,error:p,description:l,size:u,className:r,style:o,classNames:m,styles:h,__staticSelector:"MultiSelect",sx:ie,errorProps:Ze,descriptionProps:ye,labelProps:ot,inputContainer:Je,inputWrapperOrder:lt,unstyled:be,withAsterisk:Me,variant:$},En),g),H.createElement(Ka,{opened:_a,transitionProps:E,shadow:"sm",withinPortal:fe,portalProps:Oe,__staticSelector:"MultiSelect",onDirectionChange:mr,switchDirectionOnFlip:_e,zIndex:Ne,dropdownPosition:Pt,positionDependencies:[...ut,hr],classNames:m,styles:h,unstyled:be,variant:$},H.createElement(Ka.Target,null,H.createElement("div",{className:ze.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":kn&&_a?`${Ln}-items`:null,"aria-controls":Ln,"aria-expanded":kn,onMouseLeave:()=>kr(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:$e,value:St.join(","),form:De,disabled:Q}),H.createElement(_c,zl({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:u,variant:$,disabled:Q,error:p,required:s,radius:se,icon:ae,unstyled:be,onMouseDown:rt=>{var Mt;rt.preventDefault(),!Q&&!Wr.current&&gn(!kn),(Mt=At.current)==null||Mt.focus()},classNames:Wk(zl({},m),{input:Ge({[ze.input]:!O},m==null?void 0:m.input)})},VE({theme:pt,rightSection:re,rightSectionWidth:G,styles:h,size:u,shouldClear:U&&St.length>0,onClear:Bg,error:p,disabled:Q,clearButtonProps:Le,readOnly:ft})),H.createElement("div",{className:ze.values,"data-clearable":U||void 0},Jc,H.createElement("input",zl({ref:Bd(t,At),type:"search",id:Ln,className:Ge(ze.searchInput,{[ze.searchInputPointer]:!O,[ze.searchInputInputHidden]:!kn&&St.length>0||!O&&St.length>0,[ze.searchInputEmpty]:St.length===0}),onKeyDown:hi,value:hr,onChange:zg,onFocus:Fg,onBlur:Zc,readOnly:!O||Wr.current||ft,placeholder:St.length===0?T:void 0,disabled:Q,"data-mantine-stop-propagation":kn,autoComplete:"off",onCompositionStart:()=>wa(!0),onCompositionEnd:()=>wa(!1)},Dt)))))),H.createElement(Ka.Dropdown,{component:de||og,maxHeight:I,direction:Mo,id:Ln,innerRef:ka,__staticSelector:"MultiSelect",classNames:m,styles:h},H.createElement(ry,{data:Fn,hovered:Ls,classNames:m,styles:h,uuid:Ln,__staticSelector:"MultiSelect",onItemHover:kr,onItemSelect:gl,itemsRefs:pr,itemComponent:j,size:u,nothingFound:R,isItemSelected:eu,creatable:K&&!!Qe,createLabel:Qe,unstyled:be,variant:$}))))});GE.displayName="@mantine/core/MultiSelect";var YZ=Object.defineProperty,ZZ=Object.defineProperties,JZ=Object.getOwnPropertyDescriptors,Qm=Object.getOwnPropertySymbols,KE=Object.prototype.hasOwnProperty,qE=Object.prototype.propertyIsEnumerable,Gk=(e,t,n)=>t in e?YZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mv=(e,t)=>{for(var n in t||(t={}))KE.call(t,n)&&Gk(e,n,t[n]);if(Qm)for(var n of Qm(t))qE.call(t,n)&&Gk(e,n,t[n]);return e},eJ=(e,t)=>ZZ(e,JZ(t)),tJ=(e,t)=>{var n={};for(var r in e)KE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qm)for(var r of Qm(e))t.indexOf(r)<0&&qE.call(e,r)&&(n[r]=e[r]);return n};const nJ={type:"text",size:"sm",__staticSelector:"TextInput"},XE=d.forwardRef((e,t)=>{const n=hE("TextInput",nJ,e),{inputProps:r,wrapperProps:o}=n,s=tJ(n,["inputProps","wrapperProps"]);return H.createElement(_c.Wrapper,Mv({},o),H.createElement(_c,eJ(Mv(Mv({},r),s),{ref:t})))});XE.displayName="@mantine/core/TextInput";function rJ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:i}){if(!t)return e;const l=s!=null&&e.find(p=>p.value===s)||null;if(l&&!i&&(l==null?void 0:l.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(l),m=p+n,h=m-e.length;return h>0?e.slice(p-h):e.slice(p,m)}return e}const u=[];for(let p=0;p<e.length&&(o(r,e[p])&&u.push(e[p]),!(u.length>=n));p+=1);return u}var oJ=fr(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const sJ=oJ;var aJ=Object.defineProperty,iJ=Object.defineProperties,lJ=Object.getOwnPropertyDescriptors,Ym=Object.getOwnPropertySymbols,QE=Object.prototype.hasOwnProperty,YE=Object.prototype.propertyIsEnumerable,Kk=(e,t,n)=>t in e?aJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ju=(e,t)=>{for(var n in t||(t={}))QE.call(t,n)&&Kk(e,n,t[n]);if(Ym)for(var n of Ym(t))YE.call(t,n)&&Kk(e,n,t[n]);return e},Ov=(e,t)=>iJ(e,lJ(t)),cJ=(e,t)=>{var n={};for(var r in e)QE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ym)for(var r of Ym(e))t.indexOf(r)<0&&YE.call(e,r)&&(n[r]=e[r]);return n};function uJ(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function dJ(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const fJ={required:!1,size:"sm",shadow:"sm",itemComponent:oy,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:uJ,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:dJ,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:ey("popover"),positionDependencies:[],dropdownPosition:"flip"},my=d.forwardRef((e,t)=>{const n=hE("Select",fJ,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:l,defaultValue:u,onChange:p,itemComponent:m,onKeyDown:h,onBlur:g,onFocus:x,transitionProps:y,initiallyOpened:b,unstyled:w,classNames:S,styles:j,filter:_,maxDropdownHeight:E,searchable:I,clearable:M,nothingFound:R,limit:D,disabled:A,onSearchChange:O,searchValue:T,rightSection:X,rightSectionWidth:B,creatable:V,getCreateLabel:U,shouldCreate:N,selectOnBlur:$,onCreate:q,dropdownComponent:F,onDropdownClose:Q,onDropdownOpen:Y,withinPortal:se,portalProps:ae,switchDirectionOnFlip:re,zIndex:G,name:K,dropdownPosition:ee,allowDeselect:ce,placeholder:J,filterDataOnExactSearchMatch:ie,form:de,positionDependencies:ge,readOnly:Ce,clearButtonProps:he,hoverOnSearchChange:fe}=n,Oe=cJ(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transitionProps","initiallyOpened","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","portalProps","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","form","positionDependencies","readOnly","clearButtonProps","hoverOnSearchChange"]),{classes:_e,cx:Ne,theme:nt}=sJ(),[$e,Pt]=d.useState(b),[Ze,ot]=d.useState(-1),ye=d.useRef(),De=d.useRef({}),[ut,bt]=d.useState("column"),be=ut==="column",{scrollIntoView:Je,targetRef:lt,scrollableRef:ft}=FP({duration:0,offset:5,cancelable:!1,isList:!0}),Me=ce===void 0?M:ce,Le=Qe=>{if($e!==Qe){Pt(Qe);const Gt=Qe?Y:Q;typeof Gt=="function"&&Gt()}},Ut=V&&typeof U=="function";let ke=null;const Be=i.map(Qe=>typeof Qe=="string"?{label:Qe,value:Qe}:Qe),ze=EP({data:Be}),[Ge,pt,En]=od({value:l,defaultValue:u,finalValue:null,onChange:p}),Dt=ze.find(Qe=>Qe.value===Ge),[At,pr]=od({value:T,defaultValue:(Dt==null?void 0:Dt.label)||"",finalValue:void 0,onChange:O}),Ln=Qe=>{pr(Qe),I&&typeof O=="function"&&O(Qe)},kn=()=>{var Qe;Ce||(pt(null),En||Ln(""),(Qe=ye.current)==null||Qe.focus())};d.useEffect(()=>{const Qe=ze.find(Gt=>Gt.value===Ge);Qe?Ln(Qe.label):(!Ut||!Ge)&&Ln("")},[Ge]),d.useEffect(()=>{Dt&&(!I||!$e)&&Ln(Dt.label)},[Dt==null?void 0:Dt.label]);const gn=Qe=>{if(!Ce)if(Me&&(Dt==null?void 0:Dt.value)===Qe.value)pt(null),Le(!1);else{if(Qe.creatable&&typeof q=="function"){const Gt=q(Qe.value);typeof Gt<"u"&&Gt!==null&&pt(typeof Gt=="string"?Gt:Gt.value)}else pt(Qe.value);En||Ln(Qe.label),ot(-1),Le(!1),ye.current.focus()}},ln=rJ({data:ze,searchable:I,limit:D,searchValue:At,filter:_,filterDataOnExactSearchMatch:ie,value:Ge});Ut&&N(At,ln)&&(ke=U(At),ln.push({label:At,value:At,creatable:!0}));const kr=(Qe,Gt,zn)=>{let St=Qe;for(;zn(St);)if(St=Gt(St),!ln[St].disabled)return St;return Qe};Uo(()=>{ot(fe&&At?0:-1)},[At,fe]);const Mo=Ge?ln.findIndex(Qe=>Qe.value===Ge):0,mr=!Ce&&(ln.length>0?$e:$e&&!!R),hr=()=>{ot(Qe=>{var Gt;const zn=kr(Qe,St=>St-1,St=>St>0);return lt.current=De.current[(Gt=ln[zn])==null?void 0:Gt.value],mr&&Je({alignment:be?"start":"end"}),zn})},Ns=()=>{ot(Qe=>{var Gt;const zn=kr(Qe,St=>St+1,St=>St<ln.length-1);return lt.current=De.current[(Gt=ln[zn])==null?void 0:Gt.value],mr&&Je({alignment:be?"end":"start"}),zn})},$s=()=>window.setTimeout(()=>{var Qe;lt.current=De.current[(Qe=ln[Mo])==null?void 0:Qe.value],Je({alignment:be?"end":"start"})},50);Uo(()=>{mr&&$s()},[mr]);const wa=Qe=>{switch(typeof h=="function"&&h(Qe),Qe.key){case"ArrowUp":{Qe.preventDefault(),$e?be?hr():Ns():(ot(Mo),Le(!0),$s());break}case"ArrowDown":{Qe.preventDefault(),$e?be?Ns():hr():(ot(Mo),Le(!0),$s());break}case"Home":{if(!I){Qe.preventDefault(),$e||Le(!0);const Gt=ln.findIndex(zn=>!zn.disabled);ot(Gt),mr&&Je({alignment:be?"end":"start"})}break}case"End":{if(!I){Qe.preventDefault(),$e||Le(!0);const Gt=ln.map(zn=>!!zn.disabled).lastIndexOf(!1);ot(Gt),mr&&Je({alignment:be?"end":"start"})}break}case"Escape":{Qe.preventDefault(),Le(!1),ot(-1);break}case" ":{I||(Qe.preventDefault(),ln[Ze]&&$e?gn(ln[Ze]):(Le(!0),ot(Mo),$s()));break}case"Enter":I||Qe.preventDefault(),ln[Ze]&&$e&&(Qe.preventDefault(),gn(ln[Ze]))}},Sa=Qe=>{typeof g=="function"&&g(Qe);const Gt=ze.find(zn=>zn.value===Ge);$&&ln[Ze]&&$e&&gn(ln[Ze]),Ln((Gt==null?void 0:Gt.label)||""),Le(!1)},ml=Qe=>{typeof x=="function"&&x(Qe),I&&Le(!0)},ka=Qe=>{Ce||(Ln(Qe.currentTarget.value),M&&Qe.currentTarget.value===""&&pt(null),ot(-1),Le(!0))},hl=()=>{Ce||(Le(!$e),Ge&&!$e&&ot(Mo))};return H.createElement(_c.Wrapper,Ov(ju({},o),{__staticSelector:"Select"}),H.createElement(Ka,{opened:mr,transitionProps:y,shadow:s,withinPortal:se,portalProps:ae,__staticSelector:"Select",onDirectionChange:bt,switchDirectionOnFlip:re,zIndex:G,dropdownPosition:ee,positionDependencies:[...ge,At],classNames:S,styles:j,unstyled:w,variant:r.variant},H.createElement(Ka.Target,null,H.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":mr?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":mr,onMouseLeave:()=>ot(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:K,value:Ge||"",form:de,disabled:A}),H.createElement(_c,ju(Ov(ju(ju({autoComplete:"off",type:"search"},r),Oe),{ref:Bd(t,ye),onKeyDown:wa,__staticSelector:"Select",value:At,placeholder:J,onChange:ka,"aria-autocomplete":"list","aria-controls":mr?`${r.id}-items`:null,"aria-activedescendant":Ze>=0?`${r.id}-${Ze}`:null,onMouseDown:hl,onBlur:Sa,onFocus:ml,readOnly:!I||Ce,disabled:A,"data-mantine-stop-propagation":mr,name:null,classNames:Ov(ju({},S),{input:Ne({[_e.input]:!I},S==null?void 0:S.input)})}),VE({theme:nt,rightSection:X,rightSectionWidth:B,styles:j,size:r.size,shouldClear:M&&!!Dt,onClear:kn,error:o.error,clearButtonProps:he,disabled:A,readOnly:Ce}))))),H.createElement(Ka.Dropdown,{component:F||og,maxHeight:E,direction:ut,id:r.id,innerRef:ft,__staticSelector:"Select",classNames:S,styles:j},H.createElement(ry,{data:ln,hovered:Ze,classNames:S,styles:j,isItemSelected:Qe=>Qe===Ge,uuid:r.id,__staticSelector:"Select",onItemHover:ot,onItemSelect:gn,itemsRefs:De,itemComponent:m,size:r.size,nothingFound:R,creatable:Ut&&!!ke,createLabel:ke,"aria-label":o.label,unstyled:w,variant:r.variant}))))});my.displayName="@mantine/core/Select";const Wd=()=>{const[e,t,n,r,o,s,i,l,u,p,m,h,g,x,y,b,w,S,j,_,E,I,M,R,D,A,O,T,X,B,V,U,N,$,q,F,Q,Y,se,ae,re,G,K,ee,ce,J,ie,de,ge,Ce,he,fe,Oe,_e,Ne,nt,$e,Pt,Ze,ot,ye,De,ut,bt,be,Je,lt,ft,Me,Le,Ut,ke,Be,ze,Ge,pt]=Ho("colors",["base.50","base.100","base.150","base.200","base.250","base.300","base.350","base.400","base.450","base.500","base.550","base.600","base.650","base.700","base.750","base.800","base.850","base.900","base.950","accent.50","accent.100","accent.150","accent.200","accent.250","accent.300","accent.350","accent.400","accent.450","accent.500","accent.550","accent.600","accent.650","accent.700","accent.750","accent.800","accent.850","accent.900","accent.950","baseAlpha.50","baseAlpha.100","baseAlpha.150","baseAlpha.200","baseAlpha.250","baseAlpha.300","baseAlpha.350","baseAlpha.400","baseAlpha.450","baseAlpha.500","baseAlpha.550","baseAlpha.600","baseAlpha.650","baseAlpha.700","baseAlpha.750","baseAlpha.800","baseAlpha.850","baseAlpha.900","baseAlpha.950","accentAlpha.50","accentAlpha.100","accentAlpha.150","accentAlpha.200","accentAlpha.250","accentAlpha.300","accentAlpha.350","accentAlpha.400","accentAlpha.450","accentAlpha.500","accentAlpha.550","accentAlpha.600","accentAlpha.650","accentAlpha.700","accentAlpha.750","accentAlpha.800","accentAlpha.850","accentAlpha.900","accentAlpha.950"]);return{base50:e,base100:t,base150:n,base200:r,base250:o,base300:s,base350:i,base400:l,base450:u,base500:p,base550:m,base600:h,base650:g,base700:x,base750:y,base800:b,base850:w,base900:S,base950:j,accent50:_,accent100:E,accent150:I,accent200:M,accent250:R,accent300:D,accent350:A,accent400:O,accent450:T,accent500:X,accent550:B,accent600:V,accent650:U,accent700:N,accent750:$,accent800:q,accent850:F,accent900:Q,accent950:Y,baseAlpha50:se,baseAlpha100:ae,baseAlpha150:re,baseAlpha200:G,baseAlpha250:K,baseAlpha300:ee,baseAlpha350:ce,baseAlpha400:J,baseAlpha450:ie,baseAlpha500:de,baseAlpha550:ge,baseAlpha600:Ce,baseAlpha650:he,baseAlpha700:fe,baseAlpha750:Oe,baseAlpha800:_e,baseAlpha850:Ne,baseAlpha900:nt,baseAlpha950:$e,accentAlpha50:Pt,accentAlpha100:Ze,accentAlpha150:ot,accentAlpha200:ye,accentAlpha250:De,accentAlpha300:ut,accentAlpha350:bt,accentAlpha400:be,accentAlpha450:Je,accentAlpha500:lt,accentAlpha550:ft,accentAlpha600:Me,accentAlpha650:Le,accentAlpha700:Ut,accentAlpha750:ke,accentAlpha800:Be,accentAlpha850:ze,accentAlpha900:Ge,accentAlpha950:pt}},Ae=(e,t)=>n=>n==="light"?e:t,ZE=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:u,base900:p,accent200:m,accent300:h,accent400:g,accent500:x,accent600:y}=Wd(),{colorMode:b}=ha(),[w]=Ho("shadows",["dark-lg"]),[S,j,_]=Ho("space",[1,2,6]),[E]=Ho("radii",["base"]),[I]=Ho("lineHeights",["base"]);return d.useCallback(()=>({label:{color:Ae(l,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,l)(b)}},input:{border:"unset",backgroundColor:Ae(e,p)(b),borderRadius:E,borderStyle:"solid",borderWidth:"2px",borderColor:Ae(n,u)(b),color:Ae(p,t)(b),minHeight:"unset",lineHeight:I,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:j,paddingInlineEnd:_,paddingTop:S,paddingBottom:S,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(b)},"&:focus":{borderColor:Ae(h,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(m,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,l)(b),color:Ae(i,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(t,p)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,l)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(b),borderColor:Ae(n,u)(b),boxShadow:w},item:{backgroundColor:Ae(n,u)(b),color:Ae(u,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)},"&[data-active]":{backgroundColor:Ae(r,l)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)}},"&[data-selected]":{backgroundColor:Ae(g,y)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,i)(b),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Ae(p,t)(b)}}}),[m,h,g,x,y,t,n,r,o,e,s,i,l,u,p,w,b,I,E,S,j,_])},JE=je((e,t)=>{const{searchable:n=!0,tooltip:r,inputRef:o,onChange:s,label:i,disabled:l,...u}=e,p=te(),[m,h]=d.useState(""),g=d.useCallback(w=>{w.shiftKey&&p(Nr(!0))},[p]),x=d.useCallback(w=>{w.shiftKey||p(Nr(!1))},[p]),y=d.useCallback(w=>{s&&s(w)},[s]),b=ZE();return a.jsx(Ft,{label:r,placement:"top",hasArrow:!0,children:a.jsxs(Kt,{ref:t,isDisabled:l,position:"static","data-testid":`select-${i||e.placeholder}`,children:[i&&a.jsx(wn,{children:i}),a.jsx(my,{ref:o,disabled:l,searchValue:m,onSearchChange:h,onChange:y,onKeyDown:g,onKeyUp:x,searchable:n,maxDropdownHeight:300,styles:b,...u})]})})});JE.displayName="IAIMantineSearchableSelect";const nn=d.memo(JE),pJ=le([xe],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},Se),mJ=()=>{const e=te(),[t,n]=d.useState(),{data:r,isFetching:o}=yd(),{imagesToChange:s,isModalOpen:i}=W(pJ),[l]=YR(),[u]=ZR(),{t:p}=Z(),m=d.useMemo(()=>{const y=[{label:p("boards.uncategorized"),value:"none"}];return(r??[]).forEach(b=>y.push({label:b.board_name,value:b.board_id})),y},[r,p]),h=d.useCallback(()=>{e(nw()),e(Bx(!1))},[e]),g=d.useCallback(()=>{!s.length||!t||(t==="none"?u({imageDTOs:s}):l({imageDTOs:s,board_id:t}),n(null),e(nw()))},[l,e,s,u,t]),x=d.useRef(null);return a.jsx(Td,{isOpen:i,onClose:h,leastDestructiveRef:x,isCentered:!0,children:a.jsx(Yo,{children:a.jsxs(Nd,{children:[a.jsx(Qo,{fontSize:"lg",fontWeight:"bold",children:p("boards.changeBoard")}),a.jsx(Zo,{children:a.jsxs(L,{sx:{flexDir:"column",gap:4},children:[a.jsxs(ve,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(nn,{placeholder:p(o?"boards.loading":"boards.selectBoard"),disabled:o,onChange:y=>n(y),value:t,data:m})]})}),a.jsxs(Ss,{children:[a.jsx(at,{ref:x,onClick:h,children:p("boards.cancel")}),a.jsx(at,{colorScheme:"accent",onClick:g,ml:3,children:p("boards.move")})]})]})})})},hJ=d.memo(mJ),eM=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,helperText:l,...u}=e;return a.jsx(Ft,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsx(Kt,{isDisabled:n,width:r,alignItems:"center",...o,children:a.jsxs(L,{sx:{flexDir:"column",w:"full"},children:[a.jsxs(L,{sx:{alignItems:"center",w:"full"},children:[t&&a.jsx(wn,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(Qb,{...u})]}),l&&a.jsx(c5,{children:a.jsx(ve,{variant:"subtext",children:l})})]})})})};eM.displayName="IAISwitch";const fn=d.memo(eM),gJ=e=>{const{t}=Z(),{imageUsage:n,topMessage:r=t("gallery.currentlyInUse"),bottomMessage:o=t("gallery.featuresWillReset")}=e;return!n||!Xr(n)?null:a.jsxs(a.Fragment,{children:[a.jsx(ve,{children:r}),a.jsxs(Od,{sx:{paddingInlineStart:6},children:[n.isInitialImage&&a.jsx(Qr,{children:t("common.img2img")}),n.isCanvasImage&&a.jsx(Qr,{children:t("common.unifiedCanvas")}),n.isControlNetImage&&a.jsx(Qr,{children:t("common.controlNet")}),n.isIPAdapterImage&&a.jsx(Qr,{children:t("common.ipAdapter")}),n.isNodesImage&&a.jsx(Qr,{children:t("common.nodeEditor")})]}),a.jsx(ve,{children:o})]})},tM=d.memo(gJ),vJ=le([xe,JR],(e,t)=>{const{system:n,config:r,deleteImageModal:o}=e,{shouldConfirmOnDelete:s}=n,{canRestoreDeletedImagesFromBin:i}=r,{imagesToDelete:l,isModalOpen:u}=o,p=(l??[]).map(({image_name:h})=>oI(e,h)),m={isInitialImage:Xr(p,h=>h.isInitialImage),isCanvasImage:Xr(p,h=>h.isCanvasImage),isNodesImage:Xr(p,h=>h.isNodesImage),isControlNetImage:Xr(p,h=>h.isControlNetImage),isIPAdapterImage:Xr(p,h=>h.isIPAdapterImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:i,imagesToDelete:l,imagesUsage:t,isModalOpen:u,imageUsageSummary:m}},Se),xJ=()=>{const e=te(),{t}=Z(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:i,imageUsageSummary:l}=W(vJ),u=d.useCallback(g=>e(sI(!g.target.checked)),[e]),p=d.useCallback(()=>{e(rw()),e(eD(!1))},[e]),m=d.useCallback(()=>{!o.length||!s.length||(e(rw()),e(tD({imageDTOs:o,imagesUsage:s})))},[e,o,s]),h=d.useRef(null);return a.jsx(Td,{isOpen:i,onClose:p,leastDestructiveRef:h,isCentered:!0,children:a.jsx(Yo,{children:a.jsxs(Nd,{children:[a.jsx(Qo,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Zo,{children:a.jsxs(L,{direction:"column",gap:3,children:[a.jsx(tM,{imageUsage:l}),a.jsx(Yn,{}),a.jsx(ve,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(ve,{children:t("common.areYouSure")}),a.jsx(fn,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:u})]})}),a.jsxs(Ss,{children:[a.jsx(at,{ref:h,onClick:p,children:"Cancel"}),a.jsx(at,{colorScheme:"error",onClick:m,ml:3,children:"Delete"})]})]})})})},bJ=d.memo(xJ),nM=je((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...i}=e;return a.jsx(Ft,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:a.jsx(ys,{ref:t,role:n,colorScheme:s?"accent":"base","data-testid":r,...i})})});nM.displayName="IAIIconButton";const Fe=d.memo(nM);var rM={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},qk=H.createContext&&H.createContext(rM),qa=globalThis&&globalThis.__assign||function(){return qa=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},qa.apply(this,arguments)},yJ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function oM(e){return e&&e.map(function(t,n){return H.createElement(t.tag,qa({key:n},t.attr),oM(t.child))})}function Te(e){return function(t){return H.createElement(CJ,qa({attr:qa({},e.attr)},t),oM(e.child))}}function CJ(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,i=yJ(e,["attr","size","title"]),l=o||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),H.createElement("svg",qa({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,i,{className:u,style:qa(qa({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&H.createElement("title",null,s),e.children)};return qk!==void 0?H.createElement(qk.Consumer,null,function(n){return t(n)}):t(rM)}function wJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function SJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function kJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"}}]})(e)}function jJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function _J(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function IJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function PJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function EJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function sM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function MJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"}}]})(e)}function OJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function aM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function RJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"}}]})(e)}function iM(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function lM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"}}]})(e)}function Hc(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function DJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function AJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function ig(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function TJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"}}]})(e)}function NJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function $J(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}}]})(e)}function LJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.199l13.6 272C39.499 309.972 50.041 320 62.83 320h66.34c12.789 0 23.331-10.028 23.97-22.801l13.6-272C167.425 11.49 156.496 0 142.77 0H49.23C35.504 0 24.575 11.49 25.26 25.199z"}}]})(e)}function cM(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function hy(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"}}]})(e)}function zJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function FJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function BJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function HJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function uM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"}}]})(e)}function VJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"}}]})(e)}function WJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M360 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24 0 90.965 51.016 167.734 120.842 192C75.016 280.266 24 357.035 24 448c-13.255 0-24 10.745-24 24v16c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24 0-90.965-51.016-167.734-120.842-192C308.984 231.734 360 154.965 360 64c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24zm-75.078 384H99.08c17.059-46.797 52.096-80 92.92-80 40.821 0 75.862 33.196 92.922 80zm.019-256H99.078C91.988 108.548 88 86.748 88 64h208c0 22.805-3.987 44.587-11.059 64z"}}]})(e)}function Yi(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function UJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"}}]})(e)}function dM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"}}]})(e)}function GJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function KJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function fM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"}}]})(e)}function pM(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"}}]})(e)}function qJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"}}]})(e)}function mM(e){return Te({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function XJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function QJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function YJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}}]})(e)}function ZJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function Vc(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function hM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function JJ(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504.971 359.029c9.373 9.373 9.373 24.569 0 33.941l-80 79.984c-15.01 15.01-40.971 4.49-40.971-16.971V416h-58.785a12.004 12.004 0 0 1-8.773-3.812l-70.556-75.596 53.333-57.143L352 336h32v-39.981c0-21.438 25.943-31.998 40.971-16.971l80 79.981zM12 176h84l52.781 56.551 53.333-57.143-70.556-75.596A11.999 11.999 0 0 0 122.785 96H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12zm372 0v39.984c0 21.46 25.961 31.98 40.971 16.971l80-79.984c9.373-9.373 9.373-24.569 0-33.941l-80-79.981C409.943 24.021 384 34.582 384 56.019V96h-58.785a12.004 12.004 0 0 0-8.773 3.812L96 336H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h110.785c3.326 0 6.503-1.381 8.773-3.812L352 176h32z"}}]})(e)}function eee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function tee(e){return Te({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z"}}]})(e)}function lg(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function nee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function gM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function ree(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z"}}]})(e)}function Xk(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function vM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function oee(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M16 128h416c8.84 0 16-7.16 16-16V48c0-8.84-7.16-16-16-16H16C7.16 32 0 39.16 0 48v64c0 8.84 7.16 16 16 16zm480 80H80c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16zm-64 176H16c-8.84 0-16 7.16-16 16v64c0 8.84 7.16 16 16 16h416c8.84 0 16-7.16 16-16v-64c0-8.84-7.16-16-16-16z"}}]})(e)}function see(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"}}]})(e)}function xM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z"}}]})(e)}function Ic(e){return Te({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function Br(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function Ud(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function cg(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function aee(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function bM(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const Ht=e=>{const t=W(i=>i.config.disabledTabs),n=W(i=>i.config.disabledFeatures),r=W(i=>i.config.disabledSDFeatures),o=d.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=d.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};function iee(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(Ja,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(Ja,{children:[a.jsx(ve,{fontWeight:600,children:t}),r&&a.jsx(ve,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ie,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function lee({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Lr(),{t:o}=Z(),s=[{title:o("hotkeys.invoke.title"),desc:o("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys.cancel.title"),desc:o("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys.focusPrompt.title"),desc:o("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys.toggleOptions.title"),desc:o("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys.toggleGallery.title"),desc:o("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys.maximizeWorkSpace.title"),desc:o("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys.changeTabs.title"),desc:o("hotkeys.changeTabs.desc"),hotkey:"1-5"}],i=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.upscale.title"),desc:o("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys.showInfo.title"),desc:o("hotkeys.showInfo.desc"),hotkey:"I"},{title:o("hotkeys.sendToImageToImage.title"),desc:o("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys.deleteImage.title"),desc:o("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys.closePanels.title"),desc:o("hotkeys.closePanels.desc"),hotkey:"Esc"}],l=[{title:o("hotkeys.previousImage.title"),desc:o("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextImage.title"),desc:o("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.increaseGalleryThumbSize.title"),desc:o("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys.decreaseGalleryThumbSize.title"),desc:o("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],u=[{title:o("hotkeys.selectBrush.title"),desc:o("hotkeys.selectBrush.desc"),hotkey:"B"},{title:o("hotkeys.selectEraser.title"),desc:o("hotkeys.selectEraser.desc"),hotkey:"E"},{title:o("hotkeys.decreaseBrushSize.title"),desc:o("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys.increaseBrushSize.title"),desc:o("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys.decreaseBrushOpacity.title"),desc:o("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys.increaseBrushOpacity.title"),desc:o("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys.moveTool.title"),desc:o("hotkeys.moveTool.desc"),hotkey:"V"},{title:o("hotkeys.fillBoundingBox.title"),desc:o("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys.eraseBoundingBox.title"),desc:o("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys.colorPicker.title"),desc:o("hotkeys.colorPicker.desc"),hotkey:"C"},{title:o("hotkeys.toggleSnap.title"),desc:o("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys.quickToggleMove.title"),desc:o("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys.toggleLayer.title"),desc:o("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys.clearMask.title"),desc:o("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys.hideMask.title"),desc:o("hotkeys.hideMask.desc"),hotkey:"H"},{title:o("hotkeys.showHideBoundingBox.title"),desc:o("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys.mergeVisible.title"),desc:o("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys.saveToGallery.title"),desc:o("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys.copyToClipboard.title"),desc:o("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys.downloadImage.title"),desc:o("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys.undoStroke.title"),desc:o("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys.redoStroke.title"),desc:o("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys.resetView.title"),desc:o("hotkeys.resetView.desc"),hotkey:"R"},{title:o("hotkeys.previousStagingImage.title"),desc:o("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextStagingImage.title"),desc:o("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.acceptStagingImage.title"),desc:o("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],p=[{title:o("hotkeys.addNodes.title"),desc:o("hotkeys.addNodes.desc"),hotkey:"Shift + A / Space"}],m=h=>a.jsx(L,{flexDir:"column",gap:4,children:h.map((g,x)=>a.jsxs(L,{flexDir:"column",px:2,gap:4,children:[a.jsx(iee,{title:g.title,description:g.desc,hotkey:g.hotkey}),x<h.length-1&&a.jsx(Yn,{})]},x))});return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:n}),a.jsxs(qi,{isOpen:t,onClose:r,children:[a.jsx(Yo,{}),a.jsxs(Xi,{children:[a.jsx(Qo,{children:o("hotkeys.keyboardShortcuts")}),a.jsx($d,{}),a.jsx(Zo,{children:a.jsx(i5,{allowMultiple:!0,children:a.jsxs(L,{flexDir:"column",gap:2,children:[a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(s)})]}),a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(i)})]}),a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(l)})]}),a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(u)})]}),a.jsxs(Vl,{children:[a.jsx(Bl,{children:a.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx(Hl,{})]})}),a.jsx(Wl,{children:m(p)})]})]})})}),a.jsx(Ss,{})]})]})]})}function Qk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Yk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var cee=function(e,t){return typeof t=="boolean"?t:!e},uee=function(e){return d.useReducer(cee,e)};const dee=uee;function fee(e,t){t===void 0&&(t=0);var n=d.useRef(!1),r=d.useRef(),o=d.useRef(e),s=d.useCallback(function(){return n.current},[]),i=d.useCallback(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},t)},[t]),l=d.useCallback(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){return i(),l},[t]),[s,l,i]}function pee(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=fee(e,t),o=r[0],s=r[1],i=r[2];return d.useEffect(i,n),[o,s]}var mee=function(e,t){t===void 0&&(t=!0);var n=d.useState(!1),r=n[0],o=n[1];return d.useEffect(function(){var s=function(){return o(!0)},i=function(){return o(!1)};t&&e&&e.current&&(Qk(e.current,"mouseover",s),Qk(e.current,"mouseout",i));var l=e.current;return function(){t&&l&&(Yk(l,"mouseover",s),Yk(l,"mouseout",i))}},[t,e]),r};const yM=mee,hee=({showVersion:e=!0})=>{const{data:t}=nD(),n=d.useRef(null),r=yM(n);return a.jsxs(L,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(ga,{src:Hx,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs(L,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(ve,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(dr,{children:e&&r&&t&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(ve,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},gee=d.memo(hee),CM=je((e,t)=>{const{tooltip:n,inputRef:r,label:o,disabled:s,required:i,...l}=e,u=ZE();return a.jsx(Ft,{label:n,placement:"top",hasArrow:!0,children:a.jsxs(Kt,{ref:t,isRequired:i,isDisabled:s,position:"static","data-testid":`select-${o||e.placeholder}`,children:[a.jsx(wn,{children:o}),a.jsx(my,{disabled:s,ref:r,styles:u,...l})]})})});CM.displayName="IAIMantineSelect";const Pn=d.memo(CM),vee={ar:yt.t("common.langArabic",{lng:"ar"}),nl:yt.t("common.langDutch",{lng:"nl"}),en:yt.t("common.langEnglish",{lng:"en"}),fr:yt.t("common.langFrench",{lng:"fr"}),de:yt.t("common.langGerman",{lng:"de"}),he:yt.t("common.langHebrew",{lng:"he"}),it:yt.t("common.langItalian",{lng:"it"}),ja:yt.t("common.langJapanese",{lng:"ja"}),ko:yt.t("common.langKorean",{lng:"ko"}),pl:yt.t("common.langPolish",{lng:"pl"}),pt_BR:yt.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:yt.t("common.langPortuguese",{lng:"pt"}),ru:yt.t("common.langRussian",{lng:"ru"}),zh_CN:yt.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:yt.t("common.langSpanish",{lng:"es"}),uk:yt.t("common.langUkranian",{lng:"ua"})},xee={CONNECTED:"common.statusConnected",DISCONNECTED:"common.statusDisconnected",PROCESSING:"common.statusProcessing",ERROR:"common.statusError",LOADING_MODEL:"common.statusLoadingModel"},wM=le(xe,({system:e})=>e.language,Se);function Lo(e){const{t}=Z(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:i,...l}=e;return a.jsxs(L,{justifyContent:"space-between",py:1,children:[a.jsxs(L,{gap:2,alignItems:"center",children:[a.jsx(ve,{sx:{fontSize:14,_dark:{color:"base.300"}},...r,children:n}),o&&a.jsx(Ds,{size:"xs",sx:{px:2,color:"base.700",bg:"accent.200",_dark:{bg:"accent.500",color:"base.200"}},...i,children:s})]}),a.jsx(fn,{...l})]})}const bee=e=>a.jsx(L,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),Gl=d.memo(bee);function yee(){const e=te(),{data:t,refetch:n}=rD(),[r,{isLoading:o}]=oD(),s=d.useCallback(()=>{r().unwrap().then(l=>{e(aI()),e(iI()),e(ct({title:`Cleared ${l} intermediates`,status:"info"}))})},[r,e]);d.useEffect(()=>{n()},[n]);const i=t?`Clear ${t} Intermediate${t>1?"s":""}`:"No Intermediates to Clear";return a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:"Clear Intermediates"}),a.jsx(at,{colorScheme:"warning",onClick:s,isLoading:o,isDisabled:!t,children:i}),a.jsx(ve,{fontWeight:"bold",children:"Clearing intermediates will reset your Canvas and ControlNet state."}),a.jsx(ve,{variant:"subtext",children:"Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space."}),a.jsx(ve,{variant:"subtext",children:"Your gallery images will not be deleted."})]})}const Cee=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:u,base900:p,accent200:m,accent300:h,accent400:g,accent500:x,accent600:y}=Wd(),{colorMode:b}=ha(),[w]=Ho("shadows",["dark-lg"]);return d.useCallback(()=>({label:{color:Ae(l,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,l)(b)}},searchInput:{":placeholder":{color:Ae(r,l)(b)}},input:{backgroundColor:Ae(e,p)(b),borderWidth:"2px",borderColor:Ae(n,u)(b),color:Ae(p,t)(b),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(b)},"&:focus":{borderColor:Ae(h,y)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(m,y)(b)},"&[data-disabled]":{backgroundColor:Ae(r,l)(b),color:Ae(i,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(n,u)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,l)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(b),borderColor:Ae(n,u)(b),boxShadow:w},item:{backgroundColor:Ae(n,u)(b),color:Ae(u,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)},"&[data-active]":{backgroundColor:Ae(r,l)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)}},"&[data-selected]":{backgroundColor:Ae(g,y)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,i)(b),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Ae(p,t)(b)}}}),[m,h,g,x,y,t,n,r,o,e,s,i,l,u,p,w,b])},SM=je((e,t)=>{const{searchable:n=!0,tooltip:r,inputRef:o,label:s,disabled:i,...l}=e,u=te(),p=d.useCallback(g=>{g.shiftKey&&u(Nr(!0))},[u]),m=d.useCallback(g=>{g.shiftKey||u(Nr(!1))},[u]),h=Cee();return a.jsx(Ft,{label:r,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsxs(Kt,{ref:t,isDisabled:i,position:"static",children:[s&&a.jsx(wn,{children:s}),a.jsx(GE,{ref:o,disabled:i,onKeyDown:p,onKeyUp:m,searchable:n,maxDropdownHeight:300,styles:h,...l})]})})});SM.displayName="IAIMantineMultiSelect";const wee=d.memo(SM),See=nr(mh,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function kee(){const e=te(),{t}=Z(),n=W(o=>o.ui.favoriteSchedulers),r=d.useCallback(o=>{e(sD(o))},[e]);return a.jsx(wee,{label:t("settings.favoriteSchedulers"),value:n,data:See,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const jee=le([xe],({system:e,ui:t})=>{const{shouldConfirmOnDelete:n,enableImageDebugging:r,consoleLogLevel:o,shouldLogToConsole:s,shouldAntialiasProgressImage:i,shouldUseNSFWChecker:l,shouldUseWatermarker:u,shouldEnableInformationalPopovers:p}=e,{shouldUseSliders:m,shouldShowProgressInViewer:h,shouldAutoChangeDimensions:g}=t;return{shouldConfirmOnDelete:n,enableImageDebugging:r,shouldUseSliders:m,shouldShowProgressInViewer:h,consoleLogLevel:o,shouldLogToConsole:s,shouldAntialiasProgressImage:i,shouldUseNSFWChecker:l,shouldUseWatermarker:u,shouldAutoChangeDimensions:g,shouldEnableInformationalPopovers:p}},{memoizeOptions:{resultEqualityCheck:Bt}}),_ee=({children:e,config:t})=>{const n=te(),{t:r}=Z(),[o,s]=d.useState(3),i=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,l=(t==null?void 0:t.shouldShowResetWebUiText)??!0,u=(t==null?void 0:t.shouldShowClearIntermediates)??!0,p=(t==null?void 0:t.shouldShowLocalizationToggle)??!0;d.useEffect(()=>{i||n(ow(!1))},[i,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:h}=lI(void 0,{selectFromResult:({data:Y})=>({isNSFWCheckerAvailable:(Y==null?void 0:Y.nsfw_methods.includes("nsfw_checker"))??!1,isWatermarkerAvailable:(Y==null?void 0:Y.watermarking_methods.includes("invisible_watermark"))??!1})}),{isOpen:g,onOpen:x,onClose:y}=Lr(),{isOpen:b,onOpen:w,onClose:S}=Lr(),{shouldConfirmOnDelete:j,enableImageDebugging:_,shouldUseSliders:E,shouldShowProgressInViewer:I,consoleLogLevel:M,shouldLogToConsole:R,shouldAntialiasProgressImage:D,shouldUseNSFWChecker:A,shouldUseWatermarker:O,shouldAutoChangeDimensions:T,shouldEnableInformationalPopovers:X}=W(jee),B=d.useCallback(()=>{Object.keys(window.localStorage).forEach(Y=>{(aD.includes(Y)||Y.startsWith(iD))&&localStorage.removeItem(Y)}),y(),w(),setInterval(()=>s(Y=>Y-1),1e3)},[y,w]);d.useEffect(()=>{o<=0&&window.location.reload()},[o]);const V=d.useCallback(Y=>{n(lD(Y))},[n]),U=d.useCallback(Y=>{n(cD(Y))},[n]),N=d.useCallback(Y=>{n(ow(Y.target.checked))},[n]),{colorMode:$,toggleColorMode:q}=ha(),F=Ht("localization").isFeatureEnabled,Q=W(wM);return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:x}),a.jsxs(qi,{isOpen:g,onClose:y,size:"2xl",isCentered:!0,children:[a.jsx(Yo,{}),a.jsxs(Xi,{children:[a.jsx(Qo,{bg:"none",children:r("common.settingsLabel")}),a.jsx($d,{}),a.jsx(Zo,{children:a.jsxs(L,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.general")}),a.jsx(Lo,{label:r("settings.confirmOnDelete"),isChecked:j,onChange:Y=>n(sI(Y.target.checked))})]}),a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.generation")}),a.jsx(kee,{}),a.jsx(Lo,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:A,onChange:Y=>n(uD(Y.target.checked))}),a.jsx(Lo,{label:"Enable Invisible Watermark",isDisabled:!h,isChecked:O,onChange:Y=>n(dD(Y.target.checked))})]}),a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.ui")}),a.jsx(Lo,{label:r("common.darkMode"),isChecked:$==="dark",onChange:q}),a.jsx(Lo,{label:r("settings.useSlidersForAll"),isChecked:E,onChange:Y=>n(fD(Y.target.checked))}),a.jsx(Lo,{label:r("settings.showProgressInViewer"),isChecked:I,onChange:Y=>n(cI(Y.target.checked))}),a.jsx(Lo,{label:r("settings.antialiasProgressImages"),isChecked:D,onChange:Y=>n(pD(Y.target.checked))}),a.jsx(Lo,{label:r("settings.autoChangeDimensions"),isChecked:T,onChange:Y=>n(mD(Y.target.checked))}),p&&a.jsx(Pn,{disabled:!F,label:r("common.languagePickerLabel"),value:Q,data:Object.entries(vee).map(([Y,se])=>({value:Y,label:se})),onChange:U}),a.jsx(Lo,{label:"Enable informational popovers",isChecked:X,onChange:Y=>n(hD(Y.target.checked))})]}),i&&a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.developer")}),a.jsx(Lo,{label:r("settings.shouldLogToConsole"),isChecked:R,onChange:N}),a.jsx(Pn,{disabled:!R,label:r("settings.consoleLogLevel"),onChange:V,value:M,data:gD.concat()}),a.jsx(Lo,{label:r("settings.enableImageDebugging"),isChecked:_,onChange:Y=>n(vD(Y.target.checked))})]}),u&&a.jsx(yee,{}),a.jsxs(Gl,{children:[a.jsx(cr,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(at,{colorScheme:"error",onClick:B,children:r("settings.resetWebUI")}),l&&a.jsxs(a.Fragment,{children:[a.jsx(ve,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(ve,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(Ss,{children:a.jsx(at,{onClick:y,children:r("common.close")})})]})]}),a.jsxs(qi,{closeOnOverlayClick:!1,isOpen:b,onClose:S,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Yo,{backdropFilter:"blur(40px)"}),a.jsxs(Xi,{children:[a.jsx(Qo,{}),a.jsx(Zo,{children:a.jsx(L,{justifyContent:"center",children:a.jsx(ve,{fontSize:"lg",children:a.jsxs(ve,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(Ss,{})]})]})]})},Iee=d.memo(_ee),Pee=le(xe,({system:e})=>{const{isConnected:t,status:n}=e;return{isConnected:t,statusTranslationKey:xee[n]}},Se),Zk={ok:"green.400",working:"yellow.400",error:"red.400"},Jk={ok:"green.600",working:"yellow.500",error:"red.500"},Eee=()=>{const{isConnected:e,statusTranslationKey:t}=W(Pee),{t:n}=Z(),r=d.useRef(null),{data:o}=va(),s=d.useMemo(()=>e?o!=null&&o.queue.in_progress?"working":"ok":"error",[o==null?void 0:o.queue.in_progress,e]),i=yM(r);return a.jsxs(L,{ref:r,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(dr,{children:i&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(ve,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:Jk[s],_dark:{color:Zk[s]}},children:n(t)})},"statusText")}),a.jsx(Nn,{as:RJ,sx:{boxSize:"0.5rem",color:Jk[s],_dark:{color:Zk[s]}}})]})},Mee=d.memo(Eee),Oee=()=>{const{t:e}=Z(),t=Ht("bugLink").isFeatureEnabled,n=Ht("discordLink").isFeatureEnabled,r=Ht("githubLink").isFeatureEnabled,o="http://github.com/invoke-ai/InvokeAI",s="https://discord.gg/ZmtBAhwWhy";return a.jsxs(L,{sx:{gap:2,alignItems:"center"},children:[a.jsx(gee,{}),a.jsx(ba,{}),a.jsx(Mee,{}),a.jsxs(Ah,{children:[a.jsx(Th,{as:Fe,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(MJ,{}),sx:{boxSize:8}}),a.jsxs(Gi,{motionProps:vc,children:[a.jsxs(td,{title:e("common.communityLabel"),children:[r&&a.jsx(en,{as:"a",href:o,target:"_blank",icon:a.jsx(SJ,{}),children:e("common.githubLabel")}),t&&a.jsx(en,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(OJ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(en,{as:"a",href:s,target:"_blank",icon:a.jsx(wJ,{}),children:e("common.discordLabel")})]}),a.jsxs(td,{title:e("common.settingsLabel"),children:[a.jsx(lee,{children:a.jsx(en,{as:"button",icon:a.jsx(GJ,{}),children:e("common.hotkeysLabel")})}),a.jsx(Iee,{children:a.jsx(en,{as:"button",icon:a.jsx(lM,{}),children:e("common.settingsLabel")})})]})]})]})]})},Ree=d.memo(Oee);/*!
|
||
* OverlayScrollbars
|
||
* Version: 2.2.1
|
||
*
|
||
* Copyright (c) Rene Haas | KingSora.
|
||
* https://github.com/KingSora
|
||
*
|
||
* Released under the MIT license.
|
||
*/function zt(e,t){if(dg(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&zt(Object.keys(e),n=>t(e[n],n,e));return e}function ur(e,t){const n=ci(t);if(ts(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?rj(e,s,t):t.reduce((i,l)=>(i[l]=rj(e,s,l),i),o)}return o}e&&zt(ro(t),o=>qee(e,o,t[o]))}const Fo=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const l=(m,h)=>{const g=s,x=m,y=h||(r?!r(g,x):g!==x);return(y||o)&&(s=x,i=g),[s,y,i]};return[t?m=>l(t(s,i),m):l,m=>[s,!!m,i]]},Gd=()=>typeof window<"u",kM=Gd()&&Node.ELEMENT_NODE,{toString:Dee,hasOwnProperty:Rv}=Object.prototype,Ca=e=>e===void 0,ug=e=>e===null,Aee=e=>Ca(e)||ug(e)?`${e}`:Dee.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Xa=e=>typeof e=="number",ci=e=>typeof e=="string",gy=e=>typeof e=="boolean",es=e=>typeof e=="function",ts=e=>Array.isArray(e),ad=e=>typeof e=="object"&&!ts(e)&&!ug(e),dg=e=>{const t=!!e&&e.length,n=Xa(t)&&t>-1&&t%1==0;return ts(e)||!es(e)&&n?t>0&&ad(e)?t-1 in e:!0:!1},lx=e=>{if(!e||!ad(e)||Aee(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=Rv.call(e,n),i=o&&Rv.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return Ca(t)||Rv.call(e,t)},Zm=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===kM:!1},fg=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===kM:!1},vy=(e,t,n)=>e.indexOf(t,n),Xt=(e,t,n)=>(!n&&!ci(t)&&dg(t)?Array.prototype.push.apply(e,t):e.push(t),e),Zi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Xt(n,r)}):zt(e,r=>{Xt(n,r)}),n)},xy=e=>!!e&&e.length===0,As=(e,t,n)=>{zt(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},pg=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ro=e=>e?Object.keys(e):[],Cn=(e,t,n,r,o,s,i)=>{const l=[t,n,r,o,s,i];return(typeof e!="object"||ug(e))&&!es(e)&&(e={}),zt(l,u=>{zt(ro(u),p=>{const m=u[p];if(e===m)return!0;const h=ts(m);if(m&&(lx(m)||h)){const g=e[p];let x=g;h&&!ts(g)?x=[]:!h&&!lx(g)&&(x={}),e[p]=Cn(x,m)}else e[p]=m})}),e},by=e=>{for(const t in e)return!1;return!0},jM=(e,t,n,r)=>{if(Ca(r))return n?n[e]:t;n&&(ci(r)||Xa(r))&&(n[e]=r)},lr=(e,t,n)=>{if(Ca(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Mr=(e,t)=>{e&&e.removeAttribute(t)},$i=(e,t,n,r)=>{if(n){const o=lr(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Zi(s).join(" ").trim();lr(e,t,i)}},Tee=(e,t,n)=>{const r=lr(e,t)||"";return new Set(r.split(" ")).has(n)},Ko=(e,t)=>jM("scrollLeft",0,e,t),na=(e,t)=>jM("scrollTop",0,e,t),cx=Gd()&&Element.prototype,_M=(e,t)=>{const n=[],r=t?fg(t)?t:null:document;return r?Xt(n,r.querySelectorAll(e)):n},Nee=(e,t)=>{const n=t?fg(t)?t:null:document;return n?n.querySelector(e):null},Jm=(e,t)=>fg(e)?(cx.matches||cx.msMatchesSelector).call(e,t):!1,yy=e=>e?Zi(e.childNodes):[],la=e=>e?e.parentElement:null,Jl=(e,t)=>{if(fg(e)){const n=cx.closest;if(n)return n.call(e,t);do{if(Jm(e,t))return e;e=la(e)}while(e)}return null},$ee=(e,t,n)=>{const r=e&&Jl(e,t),o=e&&Nee(n,r),s=Jl(o,t)===r;return r&&o?r===e||o===e||s&&Jl(Jl(e,n),t)!==r:!1},Cy=(e,t,n)=>{if(n&&e){let r=t,o;dg(n)?(o=document.createDocumentFragment(),zt(n,s=>{s===r&&(r=s.previousSibling),o.appendChild(s)})):o=n,t&&(r?r!==t&&(r=r.nextSibling):r=e.firstChild),e.insertBefore(o,r||null)}},xo=(e,t)=>{Cy(e,null,t)},Lee=(e,t)=>{Cy(la(e),e,t)},ej=(e,t)=>{Cy(la(e),e&&e.nextSibling,t)},js=e=>{if(dg(e))zt(Zi(e),t=>js(t));else if(e){const t=la(e);t&&t.removeChild(e)}},Li=e=>{const t=document.createElement("div");return e&&lr(t,"class",e),t},IM=e=>{const t=Li();return t.innerHTML=e.trim(),zt(yy(t),n=>js(n))},ux=e=>e.charAt(0).toUpperCase()+e.slice(1),zee=()=>Li().style,Fee=["-webkit-","-moz-","-o-","-ms-"],Bee=["WebKit","Moz","O","MS","webkit","moz","o","ms"],Dv={},Av={},Hee=e=>{let t=Av[e];if(pg(Av,e))return t;const n=ux(e),r=zee();return zt(Fee,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,ux(s)+n].find(l=>r[l]!==void 0))}),Av[e]=t||""},Kd=e=>{if(Gd()){let t=Dv[e]||window[e];return pg(Dv,e)||(zt(Bee,n=>(t=t||window[n+ux(e)],!t)),Dv[e]=t),t}},Vee=Kd("MutationObserver"),tj=Kd("IntersectionObserver"),ec=Kd("ResizeObserver"),PM=Kd("cancelAnimationFrame"),EM=Kd("requestAnimationFrame"),eh=Gd()&&window.setTimeout,dx=Gd()&&window.clearTimeout,Wee=/[^\x20\t\r\n\f]+/g,MM=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&ci(t)){const l=t.match(Wee)||[];for(i=l.length>0;o=l[s++];)i=!!n(r,o)&&i}return i},wy=(e,t)=>{MM(e,t,(n,r)=>n.remove(r))},ra=(e,t)=>(MM(e,t,(n,r)=>n.add(r)),wy.bind(0,e,t)),mg=(e,t,n,r)=>{if(e&&t){let o=!0;return zt(n,s=>{const i=r?r(e[s]):e[s],l=r?r(t[s]):t[s];i!==l&&(o=!1)}),o}return!1},OM=(e,t)=>mg(e,t,["w","h"]),RM=(e,t)=>mg(e,t,["x","y"]),Uee=(e,t)=>mg(e,t,["t","r","b","l"]),nj=(e,t,n)=>mg(e,t,["width","height"],n&&(r=>Math.round(r))),go=()=>{},Kl=e=>{let t;const n=e?eh:EM,r=e?dx:PM;return[o=>{r(t),t=n(o,es(e)?e():e)},()=>r(t)]},Sy=(e,t)=>{let n,r,o,s=go;const{v:i,g:l,p:u}=t||{},p=function(y){s(),dx(n),n=r=void 0,s=go,e.apply(this,y)},m=x=>u&&r?u(r,x):x,h=()=>{s!==go&&p(m(o)||o)},g=function(){const y=Zi(arguments),b=es(i)?i():i;if(Xa(b)&&b>=0){const S=es(l)?l():l,j=Xa(S)&&S>=0,_=b>0?eh:EM,E=b>0?dx:PM,M=m(y)||y,R=p.bind(0,M);s();const D=_(R,b);s=()=>E(D),j&&!n&&(n=eh(h,S)),r=o=M}else p(y)};return g.m=h,g},Gee={opacity:1,zindex:1},yp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},Kee=(e,t)=>!Gee[e.toLowerCase()]&&Xa(t)?`${t}px`:t,rj=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],qee=(e,t,n)=>{try{const{style:r}=e;Ca(r[t])?r.setProperty(t,n):r[t]=Kee(t,n)}catch{}},id=e=>ur(e,"direction")==="rtl",oj=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,l=`${r}bottom${o}`,u=`${r}left${o}`,p=ur(e,[s,i,l,u]);return{t:yp(p[s],!0),r:yp(p[i],!0),b:yp(p[l],!0),l:yp(p[u],!0)}},{round:sj}=Math,ky={w:0,h:0},ld=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:ky,Wp=e=>e?{w:e.clientWidth,h:e.clientHeight}:ky,th=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:ky,nh=e=>{const t=parseFloat(ur(e,"height"))||0,n=parseFloat(ur(e,"width"))||0;return{w:n-sj(n),h:t-sj(t)}},xs=e=>e.getBoundingClientRect();let Cp;const Xee=()=>{if(Ca(Cp)){Cp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){Cp=!0}}))}catch{}}return Cp},DM=e=>e.split(" "),Qee=(e,t,n,r)=>{zt(DM(t),o=>{e.removeEventListener(o,n,r)})},Wn=(e,t,n,r)=>{var o;const s=Xee(),i=(o=s&&r&&r.S)!=null?o:s,l=r&&r.$||!1,u=r&&r.C||!1,p=[],m=s?{passive:i,capture:l}:l;return zt(DM(t),h=>{const g=u?x=>{e.removeEventListener(h,g,l),n&&n(x)}:n;Xt(p,Qee.bind(null,e,h,g,l)),e.addEventListener(h,g,m)}),As.bind(0,p)},AM=e=>e.stopPropagation(),TM=e=>e.preventDefault(),Yee={x:0,y:0},Tv=e=>{const t=e?xs(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:Yee},aj=(e,t)=>{zt(ts(t)?t:[t],e)},jy=e=>{const t=new Map,n=(s,i)=>{if(s){const l=t.get(s);aj(u=>{l&&l[u?"delete":"clear"](u)},i)}else t.forEach(l=>{l.clear()}),t.clear()},r=(s,i)=>{if(ci(s)){const p=t.get(s)||new Set;return t.set(s,p),aj(m=>{es(m)&&p.add(m)},i),n.bind(0,s,i)}gy(i)&&i&&n();const l=ro(s),u=[];return zt(l,p=>{const m=s[p];m&&Xt(u,r(p,m))}),As.bind(0,u)},o=(s,i)=>{const l=t.get(s);zt(Zi(l),u=>{i&&!xy(i)?u.apply(0,i):u()})};return r(e||{}),[r,n,o]},ij=e=>JSON.stringify(e,(t,n)=>{if(es(n))throw new Error;return n}),Zee={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},NM=(e,t)=>{const n={},r=ro(t).concat(ro(e));return zt(r,o=>{const s=e[o],i=t[o];if(ad(s)&&ad(i))Cn(n[o]={},NM(s,i)),by(n[o])&&delete n[o];else if(pg(t,o)&&i!==s){let l=!0;if(ts(s)||ts(i))try{ij(s)===ij(i)&&(l=!1)}catch{}l&&(n[o]=i)}}),n},$M="os-environment",LM=`${$M}-flexbox-glue`,Jee=`${LM}-max`,zM="os-scrollbar-hidden",Nv="data-overlayscrollbars-initialize",Bo="data-overlayscrollbars",FM=`${Bo}-overflow-x`,BM=`${Bo}-overflow-y`,mc="overflowVisible",ete="scrollbarHidden",lj="scrollbarPressed",rh="updating",Fa="data-overlayscrollbars-viewport",$v="arrange",HM="scrollbarHidden",hc=mc,fx="data-overlayscrollbars-padding",tte=hc,cj="data-overlayscrollbars-content",_y="os-size-observer",nte=`${_y}-appear`,rte=`${_y}-listener`,ote="os-trinsic-observer",ste="os-no-css-vars",ate="os-theme-none",Hr="os-scrollbar",ite=`${Hr}-rtl`,lte=`${Hr}-horizontal`,cte=`${Hr}-vertical`,VM=`${Hr}-track`,Iy=`${Hr}-handle`,ute=`${Hr}-visible`,dte=`${Hr}-cornerless`,uj=`${Hr}-transitionless`,dj=`${Hr}-interaction`,fj=`${Hr}-unusable`,pj=`${Hr}-auto-hidden`,mj=`${Hr}-wheel`,fte=`${VM}-interactive`,pte=`${Iy}-interactive`,WM={},Ji=()=>WM,mte=e=>{const t=[];return zt(ts(e)?e:[e],n=>{const r=ro(n);zt(r,o=>{Xt(t,WM[o]=n[o])})}),t},hte="__osOptionsValidationPlugin",gte="__osSizeObserverPlugin",Py="__osScrollbarsHidingPlugin",vte="__osClickScrollPlugin";let Lv;const hj=(e,t,n,r)=>{xo(e,t);const o=Wp(t),s=ld(t),i=nh(n);return r&&js(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},xte=e=>{let t=!1;const n=ra(e,zM);try{t=ur(e,Hee("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},bte=(e,t)=>{const n="hidden";ur(e,{overflowX:n,overflowY:n,direction:"rtl"}),Ko(e,0);const r=Tv(e),o=Tv(t);Ko(e,-999);const s=Tv(t);return{i:r.x===o.x,n:o.x!==s.x}},yte=(e,t)=>{const n=ra(e,LM),r=xs(e),o=xs(t),s=nj(o,r,!0),i=ra(e,Jee),l=xs(e),u=xs(t),p=nj(u,l,!0);return n(),i(),s&&p},Cte=()=>{const{body:e}=document,n=IM(`<div class="${$M}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=jy(),[i,l]=Fo({o:hj(e,n,r),u:RM},hj.bind(0,e,n,r,!0)),[u]=l(),p=xte(n),m={x:u.x===0,y:u.y===0},h={elements:{host:null,padding:!p,viewport:j=>p&&j===j.ownerDocument.body&&j,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},g=Cn({},Zee),x=Cn.bind(0,{},g),y=Cn.bind(0,{},h),b={k:u,A:m,I:p,L:ur(n,"zIndex")==="-1",B:bte(n,r),V:yte(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:y,q:j=>Cn(h,j)&&y(),F:x,G:j=>Cn(g,j)&&x(),X:Cn({},h),U:Cn({},g)},w=window.addEventListener,S=Sy(j=>s(j?"z":"r"),{v:33,g:99});if(Mr(n,"style"),js(n),w("resize",S.bind(0,!1)),!p&&(!m.x||!m.y)){let j;w("resize",()=>{const _=Ji()[Py];j=j||_&&_.R(),j&&j(b,i,S.bind(0,!0))})}return b},Vr=()=>(Lv||(Lv=Cte()),Lv),Ey=(e,t)=>es(t)?t.apply(0,e):t,wte=(e,t,n,r)=>{const o=Ca(r)?n:r;return Ey(e,o)||t.apply(0,e)},UM=(e,t,n,r)=>{const o=Ca(r)?n:r,s=Ey(e,o);return!!s&&(Zm(s)?s:t.apply(0,e))},Ste=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=Vr(),{nativeScrollbarsOverlaid:l,body:u}=t,p=r??l,m=Ca(o)?u:o,h=(s.x||s.y)&&p,g=e&&(ug(m)?!i:m);return!!h||!!g},My=new WeakMap,kte=(e,t)=>{My.set(e,t)},jte=e=>{My.delete(e)},GM=e=>My.get(e),gj=(e,t)=>e?t.split(".").reduce((n,r)=>n&&pg(n,r)?n[r]:void 0,e):void 0,px=(e,t,n)=>r=>[gj(e,r),n||gj(t,r)!==void 0],KM=e=>{let t=e;return[()=>t,n=>{t=Cn({},t,n)}]},wp="tabindex",Sp=Li.bind(0,""),zv=e=>{xo(la(e),yy(e)),js(e)},_te=e=>{const t=Vr(),{N:n,I:r}=t,o=Ji()[Py],s=o&&o.T,{elements:i}=n(),{host:l,padding:u,viewport:p,content:m}=i,h=Zm(e),g=h?{}:e,{elements:x}=g,{host:y,padding:b,viewport:w,content:S}=x||{},j=h?e:g.target,_=Jm(j,"textarea"),E=j.ownerDocument,I=E.documentElement,M=j===E.body,R=E.defaultView,D=wte.bind(0,[j]),A=UM.bind(0,[j]),O=Ey.bind(0,[j]),T=D.bind(0,Sp,p),X=A.bind(0,Sp,m),B=T(w),V=B===j,U=V&&M,N=!V&&X(S),$=!V&&Zm(B)&&B===N,q=$&&!!O(m),F=q?T():B,Q=q?N:X(),se=U?I:$?F:B,ae=_?D(Sp,l,y):j,re=U?se:ae,G=$?Q:N,K=E.activeElement,ee=!V&&R.top===R&&K===j,ce={W:j,Z:re,J:se,K:!V&&A(Sp,u,b),tt:G,nt:!V&&!r&&s&&s(t),ot:U?I:se,st:U?E:se,et:R,ct:E,rt:_,it:M,lt:h,ut:V,dt:$,ft:(Ze,ot)=>Tee(se,V?Bo:Fa,V?ot:Ze),_t:(Ze,ot,ye)=>$i(se,V?Bo:Fa,V?ot:Ze,ye)},J=ro(ce).reduce((Ze,ot)=>{const ye=ce[ot];return Xt(Ze,ye&&!la(ye)?ye:!1)},[]),ie=Ze=>Ze?vy(J,Ze)>-1:null,{W:de,Z:ge,K:Ce,J:he,tt:fe,nt:Oe}=ce,_e=[()=>{Mr(ge,Bo),Mr(ge,Nv),Mr(de,Nv),M&&(Mr(I,Bo),Mr(I,Nv))}],Ne=_&&ie(ge);let nt=_?de:yy([fe,he,Ce,ge,de].find(Ze=>ie(Ze)===!1));const $e=U?de:fe||he;return[ce,()=>{lr(ge,Bo,V?"viewport":"host"),lr(Ce,fx,""),lr(fe,cj,""),V||lr(he,Fa,"");const Ze=M&&!V?ra(la(j),zM):go;if(Ne&&(ej(de,ge),Xt(_e,()=>{ej(ge,de),js(ge)})),xo($e,nt),xo(ge,Ce),xo(Ce||ge,!V&&he),xo(he,fe),Xt(_e,()=>{Ze(),Mr(Ce,fx),Mr(fe,cj),Mr(he,FM),Mr(he,BM),Mr(he,Fa),ie(fe)&&zv(fe),ie(he)&&zv(he),ie(Ce)&&zv(Ce)}),r&&!V&&($i(he,Fa,HM,!0),Xt(_e,Mr.bind(0,he,Fa))),Oe&&(Lee(he,Oe),Xt(_e,js.bind(0,Oe))),ee){const ot=lr(he,wp);lr(he,wp,"-1"),he.focus();const ye=()=>ot?lr(he,wp,ot):Mr(he,wp),De=Wn(E,"pointerdown keydown",()=>{ye(),De()});Xt(_e,[ye,De])}else K&&K.focus&&K.focus();nt=0},As.bind(0,_e)]},Ite=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Vr(),{ht:i}=r(),{vt:l}=o,u=(n||!s)&&l;return u&&ur(n,{height:i?"":"100%"}),{gt:u,wt:u}}},Pte=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:l}=e,[u,p]=Fo({u:Uee,o:oj()},oj.bind(0,o,"padding",""));return(m,h,g)=>{let[x,y]=p(g);const{I:b,V:w}=Vr(),{bt:S}=n(),{gt:j,wt:_,yt:E}=m,[I,M]=h("paddingAbsolute");(j||y||!w&&_)&&([x,y]=u(g));const D=!l&&(M||E||y);if(D){const A=!I||!s&&!b,O=x.r+x.l,T=x.t+x.b,X={marginRight:A&&!S?-O:0,marginBottom:A?-T:0,marginLeft:A&&S?-O:0,top:A?-x.t:0,right:A?S?-x.r:"auto":0,left:A?S?"auto":-x.l:0,width:A?`calc(100% + ${O}px)`:""},B={paddingTop:A?x.t:0,paddingRight:A?x.r:0,paddingBottom:A?x.b:0,paddingLeft:A?x.l:0};ur(s||i,X),ur(i,B),r({K:x,St:!A,P:s?B:Cn({},X,B)})}return{xt:D}}},{max:mx}=Math,Ba=mx.bind(0,0),qM="visible",vj="hidden",Ete=42,kp={u:OM,o:{w:0,h:0}},Mte={u:RM,o:{x:vj,y:vj}},Ote=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Ba(e.w-t.w),h:Ba(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},jp=e=>e.indexOf(qM)===0,Rte=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:l,ut:u,_t:p,it:m,et:h}=e,{k:g,V:x,I:y,A:b}=Vr(),w=Ji()[Py],S=!u&&!y&&(b.x||b.y),j=m&&u,[_,E]=Fo(kp,nh.bind(0,i)),[I,M]=Fo(kp,th.bind(0,i)),[R,D]=Fo(kp),[A,O]=Fo(kp),[T]=Fo(Mte),X=(q,F)=>{if(ur(i,{height:""}),F){const{St:Q,K:Y}=n(),{$t:se,D:ae}=q,re=nh(o),G=Wp(o),K=ur(i,"boxSizing")==="content-box",ee=Q||K?Y.b+Y.t:0,ce=!(b.x&&K);ur(i,{height:G.h+re.h+(se.x&&ce?ae.x:0)-ee})}},B=(q,F)=>{const Q=!y&&!q?Ete:0,Y=(ie,de,ge)=>{const Ce=ur(i,ie),fe=(F?F[ie]:Ce)==="scroll";return[Ce,fe,fe&&!y?de?Q:ge:0,de&&!!Q]},[se,ae,re,G]=Y("overflowX",b.x,g.x),[K,ee,ce,J]=Y("overflowY",b.y,g.y);return{Ct:{x:se,y:K},$t:{x:ae,y:ee},D:{x:re,y:ce},M:{x:G,y:J}}},V=(q,F,Q,Y)=>{const se=(ee,ce)=>{const J=jp(ee),ie=ce&&J&&ee.replace(`${qM}-`,"")||"";return[ce&&!J?ee:"",jp(ie)?"hidden":ie]},[ae,re]=se(Q.x,F.x),[G,K]=se(Q.y,F.y);return Y.overflowX=re&&G?re:ae,Y.overflowY=K&&ae?K:G,B(q,Y)},U=(q,F,Q,Y)=>{const{D:se,M:ae}=q,{x:re,y:G}=ae,{x:K,y:ee}=se,{P:ce}=n(),J=F?"marginLeft":"marginRight",ie=F?"paddingLeft":"paddingRight",de=ce[J],ge=ce.marginBottom,Ce=ce[ie],he=ce.paddingBottom;Y.width=`calc(100% + ${ee+-1*de}px)`,Y[J]=-ee+de,Y.marginBottom=-K+ge,Q&&(Y[ie]=Ce+(G?ee:0),Y.paddingBottom=he+(re?K:0))},[N,$]=w?w.H(S,x,i,l,n,B,U):[()=>S,()=>[go]];return(q,F,Q)=>{const{gt:Y,Ot:se,wt:ae,xt:re,vt:G,yt:K}=q,{ht:ee,bt:ce}=n(),[J,ie]=F("showNativeOverlaidScrollbars"),[de,ge]=F("overflow"),Ce=J&&b.x&&b.y,he=!u&&!x&&(Y||ae||se||ie||G),fe=jp(de.x),Oe=jp(de.y),_e=fe||Oe;let Ne=E(Q),nt=M(Q),$e=D(Q),Pt=O(Q),Ze;if(ie&&y&&p(HM,ete,!Ce),he&&(Ze=B(Ce),X(Ze,ee)),Y||re||ae||K||ie){_e&&p(hc,mc,!1);const[ke,Be]=$(Ce,ce,Ze),[ze,Ge]=Ne=_(Q),[pt,En]=nt=I(Q),Dt=Wp(i);let At=pt,pr=Dt;ke(),(En||Ge||ie)&&Be&&!Ce&&N(Be,pt,ze,ce)&&(pr=Wp(i),At=th(i));const Ln={w:Ba(mx(pt.w,At.w)+ze.w),h:Ba(mx(pt.h,At.h)+ze.h)},kn={w:Ba((j?h.innerWidth:pr.w+Ba(Dt.w-pt.w))+ze.w),h:Ba((j?h.innerHeight+ze.h:pr.h+Ba(Dt.h-pt.h))+ze.h)};Pt=A(kn),$e=R(Ote(Ln,kn),Q)}const[ot,ye]=Pt,[De,ut]=$e,[bt,be]=nt,[Je,lt]=Ne,ft={x:De.w>0,y:De.h>0},Me=fe&&Oe&&(ft.x||ft.y)||fe&&ft.x&&!ft.y||Oe&&ft.y&&!ft.x;if(re||K||lt||be||ye||ut||ge||ie||he){const ke={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},Be=V(Ce,ft,de,ke),ze=N(Be,bt,Je,ce);u||U(Be,ce,ze,ke),he&&X(Be,ee),u?(lr(o,FM,ke.overflowX),lr(o,BM,ke.overflowY)):ur(i,ke)}$i(o,Bo,mc,Me),$i(s,fx,tte,Me),u||$i(i,Fa,hc,_e);const[Le,Ut]=T(B(Ce).Ct);return r({Ct:Le,zt:{x:ot.w,y:ot.h},Tt:{x:De.w,y:De.h},Et:ft}),{It:Ut,At:ye,Lt:ut}}},xj=(e,t,n)=>{const r={},o=t||{},s=ro(e).concat(ro(o));return zt(s,i=>{const l=e[i],u=o[i];r[i]=!!(n||l||u)}),r},Dte=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:l,V:u}=Vr(),p=!i&&(l.x||l.y),m=[Ite(e,t),Pte(e,t),Rte(e,t)];return(h,g,x)=>{const y=xj(Cn({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},g),{},x),b=p||!u,w=b&&Ko(r),S=b&&na(r);o("",rh,!0);let j=y;return zt(m,_=>{j=xj(j,_(j,h,!!x)||{},x)}),Ko(r,w),na(r,S),o("",rh),s||(Ko(n,0),na(n,0)),j}},Ate=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=l=>{if(n){const u=n.reduce((p,m)=>{if(m){const[h,g]=m,x=g&&h&&(l?l(h):_M(h,e));x&&x.length&&g&&ci(g)&&Xt(p,[x,g.trim()],!0)}return p},[]);zt(u,p=>zt(p[0],m=>{const h=p[1],g=r.get(m)||[];if(e.contains(m)){const y=Wn(m,h,b=>{o?(y(),r.delete(m)):t(b)});r.set(m,Xt(g,y))}else As(g),r.delete(m)}))}};return n&&(r=new WeakMap,i()),[s,i]},bj=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:l,Mt:u,Rt:p,kt:m}=r||{},h=Sy(()=>{o&&n(!0)},{v:33,g:99}),[g,x]=Ate(e,h,l),y=s||[],b=i||[],w=y.concat(b),S=(_,E)=>{const I=p||go,M=m||go,R=new Set,D=new Set;let A=!1,O=!1;if(zt(_,T=>{const{attributeName:X,target:B,type:V,oldValue:U,addedNodes:N,removedNodes:$}=T,q=V==="attributes",F=V==="childList",Q=e===B,Y=q&&ci(X)?lr(B,X):0,se=Y!==0&&U!==Y,ae=vy(b,X)>-1&&se;if(t&&(F||!Q)){const re=!q,G=q&&se,K=G&&u&&Jm(B,u),ce=(K?!I(B,X,U,Y):re||G)&&!M(T,!!K,e,r);zt(N,J=>R.add(J)),zt($,J=>R.add(J)),O=O||ce}!t&&Q&&se&&!I(B,X,U,Y)&&(D.add(X),A=A||ae)}),R.size>0&&x(T=>Zi(R).reduce((X,B)=>(Xt(X,_M(T,B)),Jm(B,T)?Xt(X,B):X),[])),t)return!E&&O&&n(!1),[!1];if(D.size>0||A){const T=[Zi(D),A];return!E&&n.apply(0,T),T}},j=new Vee(_=>S(_));return j.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:w,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(g(),j.disconnect(),o=!1)},()=>{if(o){h.m();const _=j.takeRecords();return!xy(_)&&S(_,!0)}}]},_p=3333333,Ip=e=>e&&(e.height||e.width),XM=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Ji()[gte],{B:i}=Vr(),u=IM(`<div class="${_y}"><div class="${rte}"></div></div>`)[0],p=u.firstChild,m=id.bind(0,e),[h]=Fo({o:void 0,_:!0,u:(b,w)=>!(!b||!Ip(b)&&Ip(w))}),g=b=>{const w=ts(b)&&b.length>0&&ad(b[0]),S=!w&&gy(b[0]);let j=!1,_=!1,E=!0;if(w){const[I,,M]=h(b.pop().contentRect),R=Ip(I),D=Ip(M);j=!M||!R,_=!D&&R,E=!j}else S?[,E]=b:_=b===!0;if(r&&E){const I=S?b[0]:id(u);Ko(u,I?i.n?-_p:i.i?0:_p:_p),na(u,_p)}j||t({gt:!S,Yt:S?b:void 0,Vt:!!_})},x=[];let y=o?g:!1;return[()=>{As(x),js(u)},()=>{if(ec){const b=new ec(g);b.observe(p),Xt(x,()=>{b.disconnect()})}else if(s){const[b,w]=s.O(p,g,o);y=b,Xt(x,w)}if(r){const[b]=Fo({o:void 0},m);Xt(x,Wn(u,"scroll",w=>{const S=b(),[j,_,E]=S;_&&(wy(p,"ltr rtl"),j?ra(p,"rtl"):ra(p,"ltr"),g([!!j,_,E])),AM(w)}))}y&&(ra(u,nte),Xt(x,Wn(u,"animationstart",y,{C:!!ec}))),(ec||s)&&xo(e,u)}]},Tte=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,Nte=(e,t)=>{let n;const r=Li(ote),o=[],[s]=Fo({o:!1}),i=(u,p)=>{if(u){const m=s(Tte(u)),[,h]=m;if(h)return!p&&t(m),[m]}},l=(u,p)=>{if(u&&u.length>0)return i(u.pop(),p)};return[()=>{As(o),js(r)},()=>{if(tj)n=new tj(u=>l(u),{root:e}),n.observe(r),Xt(o,()=>{n.disconnect()});else{const u=()=>{const h=ld(r);i(h)},[p,m]=XM(r,u);Xt(o,p),m(),u()}xo(e,r)},()=>{if(n)return l(n.takeRecords(),!0)}]},yj=`[${Bo}]`,$te=`[${Fa}]`,Fv=["tabindex"],Cj=["wrap","cols","rows"],Bv=["id","class","style","open"],Lte=(e,t,n)=>{let r,o,s;const{Z:i,J:l,tt:u,rt:p,ut:m,ft:h,_t:g}=e,{V:x}=Vr(),[y]=Fo({u:OM,o:{w:0,h:0}},()=>{const V=h(hc,mc),U=h($v,""),N=U&&Ko(l),$=U&&na(l);g(hc,mc),g($v,""),g("",rh,!0);const q=th(u),F=th(l),Q=nh(l);return g(hc,mc,V),g($v,"",U),g("",rh),Ko(l,N),na(l,$),{w:F.w+q.w+Q.w,h:F.h+q.h+Q.h}}),b=p?Cj:Bv.concat(Cj),w=Sy(n,{v:()=>r,g:()=>o,p(V,U){const[N]=V,[$]=U;return[ro(N).concat(ro($)).reduce((q,F)=>(q[F]=N[F]||$[F],q),{})]}}),S=V=>{zt(V||Fv,U=>{if(vy(Fv,U)>-1){const N=lr(i,U);ci(N)?lr(l,U,N):Mr(l,U)}})},j=(V,U)=>{const[N,$]=V,q={vt:$};return t({ht:N}),!U&&n(q),q},_=({gt:V,Yt:U,Vt:N})=>{const $=!V||N?n:w;let q=!1;if(U){const[F,Q]=U;q=Q,t({bt:F})}$({gt:V,yt:q})},E=(V,U)=>{const[,N]=y(),$={wt:N};return N&&!U&&(V?n:w)($),$},I=(V,U,N)=>{const $={Ot:U};return U?!N&&w($):m||S(V),$},[M,R,D]=u||!x?Nte(i,j):[go,go,go],[A,O]=m?[go,go]:XM(i,_,{Vt:!0,Bt:!0}),[T,X]=bj(i,!1,I,{Pt:Bv,Ht:Bv.concat(Fv)}),B=m&&ec&&new ec(_.bind(0,{gt:!0}));return B&&B.observe(i),S(),[()=>{M(),A(),s&&s[0](),B&&B.disconnect(),T()},()=>{O(),R()},()=>{const V={},U=X(),N=D(),$=s&&s[1]();return U&&Cn(V,I.apply(0,Xt(U,!0))),N&&Cn(V,j.apply(0,Xt(N,!0))),$&&Cn(V,E.apply(0,Xt($,!0))),V},V=>{const[U]=V("update.ignoreMutation"),[N,$]=V("update.attributes"),[q,F]=V("update.elementEvents"),[Q,Y]=V("update.debounce"),se=F||$,ae=re=>es(U)&&U(re);if(se&&(s&&(s[1](),s[0]()),s=bj(u||l,!0,E,{Ht:b.concat(N||[]),Dt:q,Mt:yj,kt:(re,G)=>{const{target:K,attributeName:ee}=re;return(!G&&ee&&!m?$ee(K,yj,$te):!1)||!!Jl(K,`.${Hr}`)||!!ae(re)}})),Y)if(w.m(),ts(Q)){const re=Q[0],G=Q[1];r=Xa(re)&&re,o=Xa(G)&&G}else Xa(Q)?(r=Q,o=!1):(r=!1,o=!1)}]},wj={x:0,y:0},zte=e=>({K:{t:0,r:0,b:0,l:0},St:!1,P:{marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},zt:wj,Tt:wj,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:id(e.Z)}),Fte=(e,t)=>{const n=px(t,{}),[r,o,s]=jy(),[i,l,u]=_te(e),p=KM(zte(i)),[m,h]=p,g=Dte(i,p),x=(_,E,I)=>{const R=ro(_).some(D=>_[D])||!by(E)||I;return R&&s("u",[_,E,I]),R},[y,b,w,S]=Lte(i,h,_=>x(g(n,_),{},!1)),j=m.bind(0);return j.jt=_=>r("u",_),j.Nt=()=>{const{W:_,J:E}=i,I=Ko(_),M=na(_);b(),l(),Ko(E,I),na(E,M)},j.qt=i,[(_,E)=>{const I=px(t,_,E);return S(I),x(g(I,w(),E),_,!!E)},j,()=>{o(),y(),u()}]},{round:Sj}=Math,Bte=e=>{const{width:t,height:n}=xs(e),{w:r,h:o}=ld(e);return{x:Sj(t)/r||1,y:Sj(n)/o||1}},Hte=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:i}=e,{pointers:l}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(l||[]).includes(i)},Vte=(e,t)=>Wn(e,"mousedown",Wn.bind(0,t,"click",AM,{C:!0,$:!0}),{$:!0}),kj="pointerup pointerleave pointercancel lostpointercapture",Wte=(e,t,n,r,o,s,i)=>{const{B:l}=Vr(),{Ft:u,Gt:p,Xt:m}=r,h=`scroll${i?"Left":"Top"}`,g=`client${i?"X":"Y"}`,x=i?"width":"height",y=i?"left":"top",b=i?"w":"h",w=i?"x":"y",S=(j,_)=>E=>{const{Tt:I}=s(),M=ld(p)[b]-ld(u)[b],D=_*E/M*I[w],O=id(m)&&i?l.n||l.i?1:-1:1;o[h]=j+D*O};return Wn(p,"pointerdown",j=>{const _=Jl(j.target,`.${Iy}`)===u,E=_?u:p;if($i(t,Bo,lj,!0),Hte(j,e,_)){const I=!_&&j.shiftKey,M=()=>xs(u),R=()=>xs(p),D=(F,Q)=>(F||M())[y]-(Q||R())[y],A=S(o[h]||0,1/Bte(o)[w]),O=j[g],T=M(),X=R(),B=T[x],V=D(T,X)+B/2,U=O-X[y],N=_?0:U-V,$=F=>{As(q),E.releasePointerCapture(F.pointerId)},q=[$i.bind(0,t,Bo,lj),Wn(n,kj,$),Wn(n,"selectstart",F=>TM(F),{S:!1}),Wn(p,kj,$),Wn(p,"pointermove",F=>{const Q=F[g]-O;(_||I)&&A(N+Q)})];if(I)A(N);else if(!_){const F=Ji()[vte];F&&Xt(q,F.O(A,D,N,B,U))}E.setPointerCapture(j.pointerId)}})},Ute=(e,t)=>(n,r,o,s,i,l)=>{const{Xt:u}=n,[p,m]=Kl(333),h=!!i.scrollBy;let g=!0;return As.bind(0,[Wn(u,"pointerenter",()=>{r(dj,!0)}),Wn(u,"pointerleave pointercancel",()=>{r(dj)}),Wn(u,"wheel",x=>{const{deltaX:y,deltaY:b,deltaMode:w}=x;h&&g&&w===0&&la(u)===s&&i.scrollBy({left:y,top:b,behavior:"smooth"}),g=!1,r(mj,!0),p(()=>{g=!0,r(mj)}),TM(x)},{S:!1,$:!0}),Vte(u,o),Wte(e,s,o,n,i,t,l),m])},{min:hx,max:jj,abs:Gte,round:Kte}=Math,QM=(e,t,n,r)=>{if(r){const l=n?"x":"y",{Tt:u,zt:p}=r,m=p[l],h=u[l];return jj(0,hx(1,m/(m+h)))}const o=n?"width":"height",s=xs(e)[o],i=xs(t)[o];return jj(0,hx(1,s/i))},qte=(e,t,n,r,o,s)=>{const{B:i}=Vr(),l=s?"x":"y",u=s?"Left":"Top",{Tt:p}=r,m=Kte(p[l]),h=Gte(n[`scroll${u}`]),g=s&&o,x=i.i?h:m-h,b=hx(1,(g?x:h)/m),w=QM(e,t,s);return 1/w*(1-w)*b},Xte=(e,t,n)=>{const{N:r,L:o}=Vr(),{scrollbars:s}=r(),{slot:i}=s,{ct:l,W:u,Z:p,J:m,lt:h,ot:g,it:x,ut:y}=t,{scrollbars:b}=h?{}:e,{slot:w}=b||{},S=UM([u,p,m],()=>y&&x?u:p,i,w),j=(N,$,q)=>{const F=q?ra:wy;zt(N,Q=>{F(Q.Xt,$)})},_=(N,$)=>{zt(N,q=>{const[F,Q]=$(q);ur(F,Q)})},E=(N,$,q)=>{_(N,F=>{const{Ft:Q,Gt:Y}=F;return[Q,{[q?"width":"height"]:`${(100*QM(Q,Y,q,$)).toFixed(3)}%`}]})},I=(N,$,q)=>{const F=q?"X":"Y";_(N,Q=>{const{Ft:Y,Gt:se,Xt:ae}=Q,re=qte(Y,se,g,$,id(ae),q);return[Y,{transform:re===re?`translate${F}(${(100*re).toFixed(3)}%)`:""}]})},M=[],R=[],D=[],A=(N,$,q)=>{const F=gy(q),Q=F?q:!0,Y=F?!q:!0;Q&&j(R,N,$),Y&&j(D,N,$)},O=N=>{E(R,N,!0),E(D,N)},T=N=>{I(R,N,!0),I(D,N)},X=N=>{const $=N?lte:cte,q=N?R:D,F=xy(q)?uj:"",Q=Li(`${Hr} ${$} ${F}`),Y=Li(VM),se=Li(Iy),ae={Xt:Q,Gt:Y,Ft:se};return o||ra(Q,ste),xo(Q,Y),xo(Y,se),Xt(q,ae),Xt(M,[js.bind(0,Q),n(ae,A,l,p,g,N)]),ae},B=X.bind(0,!0),V=X.bind(0,!1),U=()=>{xo(S,R[0].Xt),xo(S,D[0].Xt),eh(()=>{A(uj)},300)};return B(),V(),[{Ut:O,Wt:T,Zt:A,Jt:{Kt:R,Qt:B,tn:_.bind(0,R)},nn:{Kt:D,Qt:V,tn:_.bind(0,D)}},U,As.bind(0,M)]},Qte=(e,t,n,r)=>{let o,s,i,l,u,p=0;const m=KM({}),[h]=m,[g,x]=Kl(),[y,b]=Kl(),[w,S]=Kl(100),[j,_]=Kl(100),[E,I]=Kl(()=>p),[M,R,D]=Xte(e,n.qt,Ute(t,n)),{Z:A,J:O,ot:T,st:X,ut:B,it:V}=n.qt,{Jt:U,nn:N,Zt:$,Ut:q,Wt:F}=M,{tn:Q}=U,{tn:Y}=N,se=ee=>{const{Xt:ce}=ee,J=B&&!V&&la(ce)===O&&ce;return[J,{transform:J?`translate(${Ko(T)}px, ${na(T)}px)`:""}]},ae=(ee,ce)=>{if(I(),ee)$(pj);else{const J=()=>$(pj,!0);p>0&&!ce?E(J):J()}},re=()=>{l=s,l&&ae(!0)},G=[S,I,_,b,x,D,Wn(A,"pointerover",re,{C:!0}),Wn(A,"pointerenter",re),Wn(A,"pointerleave",()=>{l=!1,s&&ae(!1)}),Wn(A,"pointermove",()=>{o&&g(()=>{S(),ae(!0),j(()=>{o&&ae(!1)})})}),Wn(X,"scroll",ee=>{y(()=>{F(n()),i&&ae(!0),w(()=>{i&&!l&&ae(!1)})}),r(ee),B&&Q(se),B&&Y(se)})],K=h.bind(0);return K.qt=M,K.Nt=R,[(ee,ce,J)=>{const{At:ie,Lt:de,It:ge,yt:Ce}=J,{A:he}=Vr(),fe=px(t,ee,ce),Oe=n(),{Tt:_e,Ct:Ne,bt:nt}=Oe,[$e,Pt]=fe("showNativeOverlaidScrollbars"),[Ze,ot]=fe("scrollbars.theme"),[ye,De]=fe("scrollbars.visibility"),[ut,bt]=fe("scrollbars.autoHide"),[be]=fe("scrollbars.autoHideDelay"),[Je,lt]=fe("scrollbars.dragScroll"),[ft,Me]=fe("scrollbars.clickScroll"),Le=ie||de||Ce,Ut=ge||De,ke=$e&&he.x&&he.y,Be=(ze,Ge)=>{const pt=ye==="visible"||ye==="auto"&&ze==="scroll";return $(ute,pt,Ge),pt};if(p=be,Pt&&$(ate,ke),ot&&($(u),$(Ze,!0),u=Ze),bt&&(o=ut==="move",s=ut==="leave",i=ut!=="never",ae(!i,!0)),lt&&$(pte,Je),Me&&$(fte,ft),Ut){const ze=Be(Ne.x,!0),Ge=Be(Ne.y,!1);$(dte,!(ze&&Ge))}Le&&(q(Oe),F(Oe),$(fj,!_e.x,!0),$(fj,!_e.y,!1),$(ite,nt&&!V))},K,As.bind(0,G)]},YM=(e,t,n)=>{es(e)&&e(t||void 0,n||void 0)},Ua=(e,t,n)=>{const{F:r,N:o,Y:s,j:i}=Vr(),l=Ji(),u=Zm(e),p=u?e:e.target,m=GM(p);if(t&&!m){let h=!1;const g=B=>{const V=Ji()[hte],U=V&&V.O;return U?U(B,!0):B},x=Cn({},r(),g(t)),[y,b,w]=jy(n),[S,j,_]=Fte(e,x),[E,I,M]=Qte(e,x,j,B=>w("scroll",[X,B])),R=(B,V)=>S(B,!!V),D=R.bind(0,{},!0),A=s(D),O=i(D),T=B=>{jte(p),A(),O(),M(),_(),h=!0,w("destroyed",[X,!!B]),b()},X={options(B,V){if(B){const U=V?r():{},N=NM(x,Cn(U,g(B)));by(N)||(Cn(x,N),R(N))}return Cn({},x)},on:y,off:(B,V)=>{B&&V&&b(B,V)},state(){const{zt:B,Tt:V,Ct:U,Et:N,K:$,St:q,bt:F}=j();return Cn({},{overflowEdge:B,overflowAmount:V,overflowStyle:U,hasOverflow:N,padding:$,paddingAbsolute:q,directionRTL:F,destroyed:h})},elements(){const{W:B,Z:V,K:U,J:N,tt:$,ot:q,st:F}=j.qt,{Jt:Q,nn:Y}=I.qt,se=re=>{const{Ft:G,Gt:K,Xt:ee}=re;return{scrollbar:ee,track:K,handle:G}},ae=re=>{const{Kt:G,Qt:K}=re,ee=se(G[0]);return Cn({},ee,{clone:()=>{const ce=se(K());return E({},!0,{}),ce}})};return Cn({},{target:B,host:V,padding:U||N,viewport:N,content:$||N,scrollOffsetElement:q,scrollEventElement:F,scrollbarHorizontal:ae(Q),scrollbarVertical:ae(Y)})},update:B=>R({},B),destroy:T.bind(0)};return j.jt((B,V,U)=>{E(V,U,B)}),kte(p,X),zt(ro(l),B=>YM(l[B],0,X)),Ste(j.qt.it,o().cancel,!u&&e.cancel)?(T(!0),X):(j.Nt(),I.Nt(),w("initialized",[X]),j.jt((B,V,U)=>{const{gt:N,yt:$,vt:q,At:F,Lt:Q,It:Y,wt:se,Ot:ae}=B;w("updated",[X,{updateHints:{sizeChanged:N,directionChanged:$,heightIntrinsicChanged:q,overflowEdgeChanged:F,overflowAmountChanged:Q,overflowStyleChanged:Y,contentMutation:se,hostMutation:ae},changedOptions:V,force:U}])}),X.update(!0),X)}return m};Ua.plugin=e=>{zt(mte(e),t=>YM(t,Ua))};Ua.valid=e=>{const t=e&&e.elements,n=es(t)&&t();return lx(n)&&!!GM(n.target)};Ua.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:l,N:u,q:p,F:m,G:h}=Vr();return Cn({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:l,getDefaultInitialization:u,setDefaultInitialization:p,getDefaultOptions:m,setDefaultOptions:h})};const Yte=()=>{if(typeof window>"u"){const p=()=>{};return[p,p]}let e,t;const n=window,r=typeof n.requestIdleCallback=="function",o=n.requestAnimationFrame,s=n.cancelAnimationFrame,i=r?n.requestIdleCallback:o,l=r?n.cancelIdleCallback:s,u=()=>{l(e),s(t)};return[(p,m)=>{u(),e=i(r?()=>{u(),t=o(p)}:p,typeof m=="object"?m:{timeout:2233})},u]},Oy=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=d.useMemo(Yte,[]),i=d.useRef(null),l=d.useRef(r),u=d.useRef(t),p=d.useRef(n);return d.useEffect(()=>{l.current=r},[r]),d.useEffect(()=>{const{current:m}=i;u.current=t,Ua.valid(m)&&m.options(t||{},!0)},[t]),d.useEffect(()=>{const{current:m}=i;p.current=n,Ua.valid(m)&&m.on(n||{},!0)},[n]),d.useEffect(()=>()=>{var m;s(),(m=i.current)==null||m.destroy()},[]),d.useMemo(()=>[m=>{const h=i.current;if(Ua.valid(h))return;const g=l.current,x=u.current||{},y=p.current||{},b=()=>i.current=Ua(m,x,y);g?o(b,g):b()},()=>i.current],[])},Zte=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...l}=e,u=n,p=d.useRef(null),m=d.useRef(null),[h,g]=Oy({options:r,events:o,defer:s});return d.useEffect(()=>{const{current:x}=p,{current:y}=m;return x&&y&&h({target:x,elements:{viewport:y,content:y}}),()=>{var b;return(b=g())==null?void 0:b.destroy()}},[h,n]),d.useImperativeHandle(t,()=>({osInstance:g,getElement:()=>p.current}),[]),H.createElement(u,{"data-overlayscrollbars-initialize":"",ref:p,...l},H.createElement("div",{ref:m},i))},hg=d.forwardRef(Zte),Jte=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=Z(),o=W(j=>j.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:i}=xD((t==null?void 0:t.board_id)??$r.skipToken),l=d.useMemo(()=>le([xe],j=>{const _=(s??[]).map(I=>oI(j,I));return{imageUsageSummary:{isInitialImage:Xr(_,I=>I.isInitialImage),isCanvasImage:Xr(_,I=>I.isCanvasImage),isNodesImage:Xr(_,I=>I.isNodesImage),isControlNetImage:Xr(_,I=>I.isControlNetImage),isIPAdapterImage:Xr(_,I=>I.isIPAdapterImage)}}}),[s]),[u,{isLoading:p}]=bD(),[m,{isLoading:h}]=yD(),{imageUsageSummary:g}=W(l),x=d.useCallback(()=>{t&&(u(t.board_id),n(void 0))},[t,u,n]),y=d.useCallback(()=>{t&&(m(t.board_id),n(void 0))},[t,m,n]),b=d.useCallback(()=>{n(void 0)},[n]),w=d.useRef(null),S=d.useMemo(()=>h||p||i,[h,p,i]);return t?a.jsx(Td,{isOpen:!!t,onClose:b,leastDestructiveRef:w,isCentered:!0,children:a.jsx(Yo,{children:a.jsxs(Nd,{children:[a.jsxs(Qo,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Zo,{children:a.jsxs(L,{direction:"column",gap:3,children:[i?a.jsx(Gh,{children:a.jsx(L,{sx:{w:"full",h:32}})}):a.jsx(tM,{imageUsage:g,topMessage:r("boards.topMessage"),bottomMessage:r("boards.bottomMessage")}),a.jsx(ve,{children:"Deleted boards cannot be restored."}),a.jsx(ve,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(Ss,{children:a.jsxs(L,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(at,{ref:w,onClick:b,children:"Cancel"}),a.jsx(at,{colorScheme:"warning",isLoading:S,onClick:x,children:"Delete Board Only"}),a.jsx(at,{colorScheme:"error",isLoading:S,onClick:y,children:"Delete Board and Images"})]})})]})})}):null},ene=d.memo(Jte),tne=()=>{const{t:e}=Z(),[t,{isLoading:n}]=CD(),r=e("boards.myBoard"),o=d.useCallback(()=>{t(r)},[t,r]);return a.jsx(Fe,{icon:a.jsx(Vc,{}),isLoading:n,tooltip:e("boards.addBoard"),"aria-label":e("boards.addBoard"),onClick:o,size:"sm","data-testid":"add-board-button"})},nne=d.memo(tne);var ZM=wh({displayName:"ExternalLinkIcon",path:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("path",{d:"M15 3h6v6"}),a.jsx("path",{d:"M10 14L21 3"})]})}),gg=wh({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),rne=wh({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),one=wh({displayName:"DeleteIcon",path:a.jsx("g",{fill:"currentColor",children:a.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})});const sne=le([xe],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},Se),ane=()=>{const e=te(),{boardSearchText:t}=W(sne),n=d.useRef(null),{t:r}=Z(),o=d.useCallback(u=>{e(sw(u))},[e]),s=d.useCallback(()=>{e(sw(""))},[e]),i=d.useCallback(u=>{u.key==="Escape"&&s()},[s]),l=d.useCallback(u=>{o(u.target.value)},[o]);return d.useEffect(()=>{n.current&&n.current.focus()},[]),a.jsxs(i3,{children:[a.jsx(Mh,{ref:n,placeholder:r("boards.searchBoard"),value:t,onKeyDown:i,onChange:l,"data-testid":"board-search-input"}),t&&t.length&&a.jsx(Eb,{children:a.jsx(ys,{onClick:s,size:"xs",variant:"ghost","aria-label":r("boards.clearSearch"),opacity:.5,icon:a.jsx(rne,{boxSize:2})})})]})},ine=d.memo(ane);function JM(e){return wD(e)}function lne(e){return SD(e)}const e8=(e,t)=>{var o,s;if(!e||!(t!=null&&t.data.current))return!1;const{actionType:n}=e,{payloadType:r}=t.data.current;if(e.id===t.data.current.id)return!1;switch(n){case"ADD_FIELD_TO_LINEAR":return r==="NODE_FIELD";case"SET_CURRENT_IMAGE":return r==="IMAGE_DTO";case"SET_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_CONTROLNET_IMAGE":return r==="IMAGE_DTO";case"SET_IP_ADAPTER_IMAGE":return r==="IMAGE_DTO";case"SET_CANVAS_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_NODES_IMAGE":return r==="IMAGE_DTO";case"SET_MULTI_NODES_IMAGE":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BATCH":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:l}=t.data.current.payload,u=l.board_id??"none",p=e.context.boardId;return u!==p}if(r==="IMAGE_DTOS"){const{imageDTOs:l}=t.data.current.payload,u=((o=l[0])==null?void 0:o.board_id)??"none",p=e.context.boardId;return u!==p}return!1}case"REMOVE_FROM_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:l}=t.data.current.payload;return(l.board_id??"none")!=="none"}if(r==="IMAGE_DTOS"){const{imageDTOs:l}=t.data.current.payload;return(((s=l[0])==null?void 0:s.board_id)??"none")!=="none"}return!1}default:return!1}},cne=e=>{const{isOver:t,label:n="Drop"}=e,r=d.useRef(Zs()),{colorMode:o}=ha();return a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs(L,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx(L,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Ae("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(L,{sx:{position:"absolute",top:.5,insetInlineStart:.5,insetInlineEnd:.5,bottom:.5,opacity:1,borderWidth:2,borderColor:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),borderRadius:"lg",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:a.jsx(Ie,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.1)":"scale(1)",color:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},t8=d.memo(cne),une=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=d.useRef(Zs()),{isOver:s,setNodeRef:i,active:l}=JM({id:o.current,disabled:r,data:n});return a.jsx(Ie,{ref:i,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:l?"auto":"none",children:a.jsx(dr,{children:e8(n,l)&&a.jsx(t8,{isOver:s,label:t})})})},Ry=d.memo(une),dne=({isSelected:e,isHovered:t})=>a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e?1:.7,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:e?t?"hoverSelected.light":"selected.light":t?"hoverUnselected.light":void 0,_dark:{shadow:e?t?"hoverSelected.dark":"selected.dark":t?"hoverUnselected.dark":void 0}}}),Dy=d.memo(dne),fne=()=>a.jsx(L,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(Ds,{variant:"solid",sx:{bg:"accent.400",_dark:{bg:"accent.500"}},children:"auto"})}),n8=d.memo(fne);function Ay(e){const[t,n]=d.useState(!1),[r,o]=d.useState(!1),[s,i]=d.useState(!1),[l,u]=d.useState([0,0]),p=d.useRef(null),m=W(g=>g.ui.globalContextMenuCloseTrigger);d.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{i(!0)})});else{i(!1);const g=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(g)}},[t]),d.useEffect(()=>{n(!1),i(!1),o(!1)},[m]),fF("contextmenu",g=>{var x;(x=p.current)!=null&&x.contains(g.target)||g.target===p.current?(g.preventDefault(),n(!0),u([g.pageX,g.pageY])):n(!1)});const h=d.useCallback(()=>{var g,x;(x=(g=e.menuProps)==null?void 0:g.onClose)==null||x.call(g),n(!1)},[e.menuProps]);return a.jsxs(a.Fragment,{children:[e.children(p),r&&a.jsx(Ac,{...e.portalProps,children:a.jsxs(Ah,{isOpen:s,gutter:0,...e.menuProps,onClose:h,children:[a.jsx(Th,{"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:l[0],top:l[1],cursor:"default"},...e.menuButtonProps}),e.renderMenu()]})})]})}const vg=e=>{const{boardName:t}=yd(void 0,{selectFromResult:({data:n})=>{const r=n==null?void 0:n.find(s=>s.board_id===e);return{boardName:(r==null?void 0:r.board_name)||"Uncategorized"}}});return t},pne=({board:e,setBoardToDelete:t})=>{const n=d.useCallback(()=>{t&&t(e)},[e,t]);return a.jsxs(a.Fragment,{children:[e.image_count>0&&a.jsx(a.Fragment,{}),a.jsx(en,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Br,{}),onClick:n,children:"Delete Board"})]})},mne=d.memo(pne),hne=()=>a.jsx(a.Fragment,{}),gne=d.memo(hne),vne=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const o=te(),s=d.useMemo(()=>le(xe,({gallery:g})=>{const x=g.autoAddBoardId===t,y=g.autoAssignBoardOnClick;return{isAutoAdd:x,autoAssignBoardOnClick:y}},Se),[t]),{isAutoAdd:i,autoAssignBoardOnClick:l}=W(s),u=vg(t),p=d.useCallback(()=>{o(hh(t))},[t,o]),m=d.useCallback(g=>{g.preventDefault()},[]),{t:h}=Z();return a.jsx(Ay,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsx(Gi,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:m,children:a.jsxs(td,{title:u,children:[a.jsx(en,{icon:a.jsx(Vc,{}),isDisabled:i||l,onClick:p,children:h("boards.menuItemAutoAdd")}),!e&&a.jsx(gne,{}),e&&a.jsx(mne,{board:e,setBoardToDelete:n})]})}),children:r})},r8=d.memo(vne),xne=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=te(),o=d.useMemo(()=>le(xe,({gallery:A})=>{const O=e.board_id===A.autoAddBoardId,T=A.autoAssignBoardOnClick;return{isSelectedForAutoAdd:O,autoAssignBoardOnClick:T}},Se),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:i}=W(o),[l,u]=d.useState(!1),p=d.useCallback(()=>{u(!0)},[]),m=d.useCallback(()=>{u(!1)},[]),{data:h}=Vx(e.board_id),{data:g}=Wx(e.board_id),x=d.useMemo(()=>{if(!((h==null?void 0:h.total)===void 0||(g==null?void 0:g.total)===void 0))return`${h.total} image${h.total===1?"":"s"}, ${g.total} asset${g.total===1?"":"s"}`},[g,h]),{currentData:y}=to(e.cover_image_name??$r.skipToken),{board_name:b,board_id:w}=e,[S,j]=d.useState(b),_=d.useCallback(()=>{r(uI({boardId:w})),i&&r(hh(w))},[w,i,r]),[E,{isLoading:I}]=kD(),M=d.useMemo(()=>({id:w,actionType:"ADD_TO_BOARD",context:{boardId:w}}),[w]),R=d.useCallback(async A=>{if(!A.trim()){j(b);return}if(A!==b)try{const{board_name:O}=await E({board_id:w,changes:{board_name:A}}).unwrap();j(O)}catch{j(b)}},[w,b,E]),D=d.useCallback(A=>{j(A)},[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(L,{onMouseOver:p,onMouseOut:m,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",w:"full",h:"full"},children:a.jsx(r8,{board:e,board_id:w,setBoardToDelete:n,children:A=>a.jsx(Ft,{label:x,openDelay:1e3,hasArrow:!0,children:a.jsxs(L,{ref:A,onClick:_,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[y!=null&&y.thumbnail_url?a.jsx(ga,{src:y==null?void 0:y.thumbnail_url,draggable:!1,sx:{objectFit:"cover",w:"full",h:"full",maxH:"full",borderRadius:"base",borderBottomRadius:"lg"}}):a.jsx(L,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(Nn,{boxSize:12,as:aee,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(n8,{}),a.jsx(Dy,{isSelected:t,isHovered:l}),a.jsx(L,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:t?"accent.400":"base.500",color:t?"base.50":"base.100",_dark:{bg:t?"accent.500":"base.600",color:t?"base.50":"base.100"},lineHeight:"short",fontSize:"xs"},children:a.jsxs(Ih,{value:S,isDisabled:I,submitOnBlur:!0,onChange:D,onSubmit:R,sx:{w:"full"},children:[a.jsx(_h,{sx:{p:0,fontWeight:t?700:500,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},noOfLines:1}),a.jsx(jh,{sx:{p:0,_focusVisible:{p:0,textAlign:"center",boxShadow:"none"}}})]})}),a.jsx(Ry,{data:M,dropLabel:a.jsx(ve,{fontSize:"md",children:"Move"})})]})})})})})},bne=d.memo(xne),yne=le(xe,({gallery:e})=>{const{autoAddBoardId:t,autoAssignBoardOnClick:n}=e;return{autoAddBoardId:t,autoAssignBoardOnClick:n}},Se),o8=d.memo(({isSelected:e})=>{const t=te(),{autoAddBoardId:n,autoAssignBoardOnClick:r}=W(yne),o=vg("none"),s=d.useCallback(()=>{t(uI({boardId:"none"})),r&&t(hh("none"))},[t,r]),[i,l]=d.useState(!1),{data:u}=Vx("none"),{data:p}=Wx("none"),m=d.useMemo(()=>{if(!((u==null?void 0:u.total)===void 0||(p==null?void 0:p.total)===void 0))return`${u.total} image${u.total===1?"":"s"}, ${p.total} asset${p.total===1?"":"s"}`},[p,u]),h=d.useCallback(()=>{l(!0)},[]),g=d.useCallback(()=>{l(!1)},[]),x=d.useMemo(()=>({id:"no_board",actionType:"REMOVE_FROM_BOARD"}),[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(L,{onMouseOver:h,onMouseOut:g,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"base",w:"full",h:"full"},children:a.jsx(r8,{board_id:"none",children:y=>a.jsx(Ft,{label:m,openDelay:1e3,hasArrow:!0,children:a.jsxs(L,{ref:y,onClick:s,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(L,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(ga,{src:Hx,alt:"invoke-ai-logo",sx:{opacity:.4,filter:"grayscale(1)",mt:-6,w:16,h:16,minW:16,minH:16,userSelect:"none"}})}),n==="none"&&a.jsx(n8,{}),a.jsx(L,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:e?"accent.400":"base.500",color:e?"base.50":"base.100",_dark:{bg:e?"accent.500":"base.600",color:e?"base.50":"base.100"},lineHeight:"short",fontSize:"xs",fontWeight:e?700:500},children:o}),a.jsx(Dy,{isSelected:e,isHovered:i}),a.jsx(Ry,{data:x,dropLabel:a.jsx(ve,{fontSize:"md",children:"Move"})})]})})})})})});o8.displayName="HoverableBoard";const Cne=d.memo(o8),wne=le([xe],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},Se),Sne=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=W(wne),{data:o}=yd(),s=r?o==null?void 0:o.filter(u=>u.board_name.toLowerCase().includes(r.toLowerCase())):o,[i,l]=d.useState();return a.jsxs(a.Fragment,{children:[a.jsx(Id,{in:t,animateOpacity:!0,children:a.jsxs(L,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs(L,{sx:{gap:2,alignItems:"center"},children:[a.jsx(ine,{}),a.jsx(nne,{})]}),a.jsx(hg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(Ja,{className:"list-container","data-testid":"boards-list",sx:{gridTemplateColumns:"repeat(auto-fill, minmax(108px, 1fr));",maxH:346},children:[a.jsx(Zu,{sx:{p:1.5},"data-testid":"no-board",children:a.jsx(Cne,{isSelected:n==="none"})}),s&&s.map((u,p)=>a.jsx(Zu,{sx:{p:1.5},"data-testid":`board-${p}`,children:a.jsx(bne,{board:u,isSelected:n===u.board_id,setBoardToDelete:l})},u.board_id))]})})]})}),a.jsx(ene,{boardToDelete:i,setBoardToDelete:l})]})},kne=d.memo(Sne),jne=le([xe],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},Se),_ne=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=W(jne),o=vg(r),s=d.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs(L,{as:Za,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(ve,{noOfLines:1,sx:{fontWeight:600,w:"100%",textAlign:"center",color:"base.800",_dark:{color:"base.200"}},children:s}),a.jsx(gg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]})},Ine=d.memo(_ne),Pne=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs(Ld,{isLazy:o,...s,children:[a.jsx(Wh,{children:t}),a.jsxs(zd,{shadow:"dark-lg",children:[r&&a.jsx(B3,{}),n]})]})},qd=d.memo(Pne);function Ene(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}},{tag:"path",attr:{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"}}]})(e)}const s8=je((e,t)=>{const[n,r]=d.useState(!1),{label:o,value:s,min:i=1,max:l=100,step:u=1,onChange:p,tooltipSuffix:m="",withSliderMarks:h=!1,withInput:g=!1,isInteger:x=!1,inputWidth:y=16,withReset:b=!1,hideTooltip:w=!1,isCompact:S=!1,isDisabled:j=!1,sliderMarks:_,handleReset:E,sliderFormControlProps:I,sliderFormLabelProps:M,sliderMarkProps:R,sliderTrackProps:D,sliderThumbProps:A,sliderNumberInputProps:O,sliderNumberInputFieldProps:T,sliderNumberInputStepperProps:X,sliderTooltipProps:B,sliderIAIIconButtonProps:V,...U}=e,N=te(),{t:$}=Z(),[q,F]=d.useState(String(s));d.useEffect(()=>{F(s)},[s]);const Q=d.useMemo(()=>O!=null&&O.min?O.min:i,[i,O==null?void 0:O.min]),Y=d.useMemo(()=>O!=null&&O.max?O.max:l,[l,O==null?void 0:O.max]),se=d.useCallback(J=>{p(J)},[p]),ae=d.useCallback(J=>{J.target.value===""&&(J.target.value=String(Q));const ie=Bi(x?Math.floor(Number(J.target.value)):Number(q),Q,Y),de=Mu(ie,u);p(de),F(de)},[x,q,Q,Y,p,u]),re=d.useCallback(J=>{F(J)},[]),G=d.useCallback(()=>{E&&E()},[E]),K=d.useCallback(J=>{J.target instanceof HTMLDivElement&&J.target.focus()},[]),ee=d.useCallback(J=>{J.shiftKey&&N(Nr(!0))},[N]),ce=d.useCallback(J=>{J.shiftKey||N(Nr(!1))},[N]);return a.jsxs(Kt,{ref:t,onClick:K,sx:S?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:j,...I,children:[o&&a.jsx(wn,{sx:g?{mb:-1.5}:{},...M,children:o}),a.jsxs(Rh,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(Gb,{"aria-label":o,value:s,min:i,max:l,step:u,onChange:se,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),focusThumbOnChange:!1,isDisabled:j,...U,children:[h&&!_&&a.jsxs(a.Fragment,{children:[a.jsx(Ul,{value:i,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...R,children:i}),a.jsx(Ul,{value:l,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...R,children:l})]}),h&&_&&a.jsx(a.Fragment,{children:_.map((J,ie)=>ie===0?a.jsx(Ul,{value:J,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...R,children:J},J):ie===_.length-1?a.jsx(Ul,{value:J,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...R,children:J},J):a.jsx(Ul,{value:J,sx:{transform:"translateX(-50%)"},...R,children:J},J))}),a.jsx(qb,{...D,children:a.jsx(Xb,{})}),a.jsx(Ft,{hasArrow:!0,placement:"top",isOpen:n,label:`${s}${m}`,hidden:w,...B,children:a.jsx(Kb,{...A,zIndex:0})})]}),g&&a.jsxs(Lh,{min:Q,max:Y,step:u,value:q,onChange:re,onBlur:ae,focusInputOnChange:!1,...O,children:[a.jsx(Fh,{onKeyDown:ee,onKeyUp:ce,minWidth:y,...T}),a.jsxs(zh,{...X,children:[a.jsx(Hh,{onClick:()=>p(Number(q))}),a.jsx(Bh,{onClick:()=>p(Number(q))})]})]}),b&&a.jsx(Fe,{size:"sm","aria-label":$("accessibility.reset"),tooltip:$("accessibility.reset"),icon:a.jsx(Ene,{}),isDisabled:j,onClick:G,...V})]})]})});s8.displayName="IAISlider";const tt=d.memo(s8),a8=d.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(Ft,{label:t,placement:"top",hasArrow:!0,openDelay:500,children:a.jsx(Ie,{ref:s,...o,children:a.jsxs(Ie,{children:[a.jsx(wc,{children:e}),n&&a.jsx(wc,{size:"xs",color:"base.600",children:n})]})})}));a8.displayName="IAIMantineSelectItemWithTooltip";const ui=d.memo(a8),Mne=le([xe],({gallery:e})=>{const{autoAddBoardId:t,autoAssignBoardOnClick:n}=e;return{autoAddBoardId:t,autoAssignBoardOnClick:n}},Se),One=()=>{const e=te(),{t}=Z(),{autoAddBoardId:n,autoAssignBoardOnClick:r}=W(Mne),o=d.useRef(null),{boards:s,hasBoards:i}=yd(void 0,{selectFromResult:({data:u})=>{const p=[{label:"None",value:"none"}];return u==null||u.forEach(({board_id:m,board_name:h})=>{p.push({label:h,value:m})}),{boards:p,hasBoards:p.length>1}}}),l=d.useCallback(u=>{u&&e(hh(u))},[e]);return a.jsx(nn,{label:t("boards.autoAddBoard"),inputRef:o,autoFocus:!0,placeholder:t("boards.selectBoard"),value:n,data:s,nothingFound:t("boards.noMatching"),itemComponent:ui,disabled:!i||r,filter:(u,p)=>{var m;return((m=p.label)==null?void 0:m.toLowerCase().includes(u.toLowerCase().trim()))||p.value.toLowerCase().includes(u.toLowerCase().trim())},onChange:l})},Rne=d.memo(One),Dne=e=>{const{label:t,...n}=e,{colorMode:r}=ha();return a.jsx(Md,{colorScheme:"accent",...n,children:a.jsx(ve,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},br=d.memo(Dne),Ane=le([xe],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},Se),Tne=()=>{const e=te(),{t}=Z(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=W(Ane),s=d.useCallback(u=>{e(aw(u))},[e]),i=d.useCallback(()=>{e(aw(64))},[e]),l=d.useCallback(u=>{e(jD(u.target.checked))},[e]);return a.jsx(qd,{triggerComponent:a.jsx(Fe,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(bM,{})}),children:a.jsxs(L,{direction:"column",gap:2,children:[a.jsx(tt,{value:n,onChange:s,min:45,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:i}),a.jsx(fn,{label:t("gallery.autoSwitchNewImages"),isChecked:r,onChange:l}),a.jsx(br,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:u=>e(_D(u.target.checked))}),a.jsx(Rne,{})]})})},Nne=d.memo(Tne),$ne=e=>e.image?a.jsx(Gh,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):a.jsx(L,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(fa,{size:"xl"})}),Zn=e=>{const{icon:t=Yi,boxSize:n=16,sx:r,...o}=e;return a.jsxs(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...r},...o,children:[t&&a.jsx(Nn,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(ve,{textAlign:"center",children:e.label})]})},Lne=e=>{const{sx:t,...n}=e;return a.jsxs(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...t},...n,children:[a.jsx(fa,{size:"xl"}),e.label&&a.jsx(ve,{textAlign:"center",children:e.label})]})},xg=0,di=1,Wc=2,i8=4;function l8(e,t){return n=>e(t(n))}function zne(e,t){return t(e)}function c8(e,t){return n=>e(t,n)}function _j(e,t){return()=>e(t)}function bg(e,t){return t(e),e}function hn(...e){return e}function Fne(e){e()}function Ij(e){return()=>e}function Bne(...e){return()=>{e.map(Fne)}}function Ty(e){return e!==void 0}function Uc(){}function Yt(e,t){return e(di,t)}function wt(e,t){e(xg,t)}function Ny(e){e(Wc)}function bo(e){return e(i8)}function st(e,t){return Yt(e,c8(t,xg))}function ca(e,t){const n=e(di,r=>{n(),t(r)});return n}function Tt(){const e=[];return(t,n)=>{switch(t){case Wc:e.splice(0,e.length);return;case di:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case xg:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function Ve(e){let t=e;const n=Tt();return(r,o)=>{switch(r){case di:o(t);break;case xg:t=o;break;case i8:return t}return n(r,o)}}function Hne(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case di:return s?n===s?void 0:(r(),n=s,t=Yt(e,s),t):(r(),Uc);case Wc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Jr(e){return bg(Tt(),t=>st(e,t))}function yr(e,t){return bg(Ve(t),n=>st(e,n))}function Vne(...e){return t=>e.reduceRight(zne,t)}function Pe(e,...t){const n=Vne(...t);return(r,o)=>{switch(r){case di:return Yt(e,n(o));case Wc:Ny(e);return}}}function u8(e,t){return e===t}function pn(e=u8){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function gt(e){return t=>n=>{e(n)&&t(n)}}function Xe(e){return t=>l8(t,e)}function qs(e){return t=>()=>t(e)}function bs(e,t){return n=>r=>n(t=e(t,r))}function Pc(e){return t=>n=>{e>0?e--:t(n)}}function Ga(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Pj(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function _t(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const l=Math.pow(2,i);Yt(s,u=>{const p=n;n=n|l,t[i]=u,p!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const l=()=>s([i].concat(t));n===o?l():r=l}}function Ej(...e){return function(t,n){switch(t){case di:return Bne(...e.map(r=>Yt(r,n)));case Wc:return;default:throw new Error(`unrecognized action ${t}`)}}}function ht(e,t=u8){return Pe(e,pn(t))}function Qn(...e){const t=Tt(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const l=Math.pow(2,i);Yt(s,u=>{n[i]=u,r=r|l,r===o&&wt(t,n)})}),function(s,i){switch(s){case di:return r===o&&i(n),Yt(t,i);case Wc:return Ny(t);default:throw new Error(`unrecognized action ${s}`)}}}function qt(e,t=[],{singleton:n}={singleton:!0}){return{id:Wne(),constructor:e,dependencies:t,singleton:n}}const Wne=()=>Symbol();function Une(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const l=o(s.map(u=>n(u)));return i&&t.set(r,l),l};return n(e)}function Gne(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const Pp=typeof document<"u"?H.useLayoutEffect:H.useEffect;function d8(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),l=H.createContext({});function u(b,w){b.propsReady&&wt(b.propsReady,!1);for(const S of r){const j=b[t.required[S]];wt(j,w[S])}for(const S of o)if(S in w){const j=b[t.optional[S]];wt(j,w[S])}b.propsReady&&wt(b.propsReady,!0)}function p(b){return s.reduce((w,S)=>(w[S]=j=>{const _=b[t.methods[S]];wt(_,j)},w),{})}function m(b){return i.reduce((w,S)=>(w[S]=Hne(b[t.events[S]]),w),{})}return{Component:H.forwardRef((b,w)=>{const{children:S,...j}=b,[_]=H.useState(()=>bg(Une(e),I=>u(I,j))),[E]=H.useState(_j(m,_));return Pp(()=>{for(const I of i)I in j&&Yt(E[I],j[I]);return()=>{Object.values(E).map(Ny)}},[j,E,_]),Pp(()=>{u(_,j)}),H.useImperativeHandle(w,Ij(p(_))),H.createElement(l.Provider,{value:_},n?H.createElement(n,Gne([...r,...o,...i],j),S):S)}),usePublisher:b=>H.useCallback(c8(wt,H.useContext(l)[b]),[b]),useEmitterValue:b=>{const S=H.useContext(l)[b],[j,_]=H.useState(_j(bo,S));return Pp(()=>Yt(S,E=>{E!==j&&_(Ij(E))}),[S,j]),j},useEmitter:(b,w)=>{const j=H.useContext(l)[b];Pp(()=>Yt(j,w),[w,j])}}}const Kne=typeof document<"u"?H.useLayoutEffect:H.useEffect,qne=Kne;var eo=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(eo||{});const Xne={0:"debug",1:"log",2:"warn",3:"error"},Qne=()=>typeof globalThis>"u"?window:globalThis,fi=qt(()=>{const e=Ve(3);return{log:Ve((n,r,o=1)=>{var s;const i=(s=Qne().VIRTUOSO_LOG_LEVEL)!=null?s:bo(e);o>=i&&console[Xne[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function $y(e,t=!0){const n=H.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=H.useMemo(()=>new ResizeObserver(s=>{const i=s[0].target;i.offsetParent!==null&&e(i)}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function ll(e,t=!0){return $y(e,t).callbackRef}function Yne(e,t,n,r,o,s,i){const l=H.useCallback(u=>{const p=Zne(u.children,t,"offsetHeight",o);let m=u.parentElement;for(;!m.dataset.virtuosoScroller;)m=m.parentElement;const h=m.lastElementChild.dataset.viewportType==="window",g=i?i.scrollTop:h?window.pageYOffset||document.documentElement.scrollTop:m.scrollTop,x=i?i.scrollHeight:h?document.documentElement.scrollHeight:m.scrollHeight,y=i?i.offsetHeight:h?window.innerHeight:m.offsetHeight;r({scrollTop:Math.max(g,0),scrollHeight:x,viewportHeight:y}),s==null||s(Jne("row-gap",getComputedStyle(u).rowGap,o)),p!==null&&e(p)},[e,t,o,s,i,r]);return $y(l,n)}function Zne(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let i=0;i<o;i++){const l=e.item(i);if(!l||l.dataset.index===void 0)continue;const u=parseInt(l.dataset.index),p=parseFloat(l.dataset.knownSize),m=t(l,n);if(m===0&&r("Zero-sized element, this should not happen",{child:l},eo.ERROR),m===p)continue;const h=s[s.length-1];s.length===0||h.size!==m||h.endIndex!==u-1?s.push({startIndex:u,endIndex:u,size:m}):s[s.length-1].endIndex++}return s}function Jne(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,eo.WARN),t==="normal"?0:parseInt(t??"0",10)}function ri(e,t){return Math.round(e.getBoundingClientRect()[t])}function f8(e,t){return Math.abs(e-t)<1.01}function p8(e,t,n,r=Uc,o){const s=H.useRef(null),i=H.useRef(null),l=H.useRef(null),u=H.useCallback(h=>{const g=h.target,x=g===window||g===document,y=x?window.pageYOffset||document.documentElement.scrollTop:g.scrollTop,b=x?document.documentElement.scrollHeight:g.scrollHeight,w=x?window.innerHeight:g.offsetHeight,S=()=>{e({scrollTop:Math.max(y,0),scrollHeight:b,viewportHeight:w})};h.suppressFlushSync?S():ID.flushSync(S),i.current!==null&&(y===i.current||y<=0||y===b-w)&&(i.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);H.useEffect(()=>{const h=o||s.current;return r(o||s.current),u({target:h,suppressFlushSync:!0}),h.addEventListener("scroll",u,{passive:!0}),()=>{r(null),h.removeEventListener("scroll",u)}},[s,u,n,r,o]);function p(h){const g=s.current;if(!g||"offsetHeight"in g&&g.offsetHeight===0)return;const x=h.behavior==="smooth";let y,b,w;g===window?(b=Math.max(ri(document.documentElement,"height"),document.documentElement.scrollHeight),y=window.innerHeight,w=document.documentElement.scrollTop):(b=g.scrollHeight,y=ri(g,"height"),w=g.scrollTop);const S=b-y;if(h.top=Math.ceil(Math.max(Math.min(S,h.top),0)),f8(y,b)||h.top===w){e({scrollTop:w,scrollHeight:b,viewportHeight:y}),x&&t(!0);return}x?(i.current=h.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,i.current=null,t(!0)},1e3)):i.current=null,g.scrollTo(h)}function m(h){s.current.scrollBy(h)}return{scrollerRef:s,scrollByCallback:m,scrollToCallback:p}}const Sr=qt(()=>{const e=Tt(),t=Tt(),n=Ve(0),r=Tt(),o=Ve(0),s=Tt(),i=Tt(),l=Ve(0),u=Ve(0),p=Ve(0),m=Ve(0),h=Tt(),g=Tt(),x=Ve(!1);return st(Pe(e,Xe(({scrollTop:y})=>y)),t),st(Pe(e,Xe(({scrollHeight:y})=>y)),i),st(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:l,fixedHeaderHeight:u,fixedFooterHeight:p,footerHeight:m,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:h,scrollBy:g,statefulScrollTop:o,deviation:n,scrollingInProgress:x}},[],{singleton:!0}),cd={lvl:0};function m8(e,t,n,r=cd,o=cd){return{k:e,v:t,lvl:n,l:r,r:o}}function tn(e){return e===cd}function gc(){return cd}function gx(e,t){if(tn(e))return cd;const{k:n,l:r,r:o}=e;if(t===n){if(tn(r))return o;if(tn(o))return r;{const[s,i]=h8(r);return Up(Vn(e,{k:s,v:i,l:g8(r)}))}}else return t<n?Up(Vn(e,{l:gx(r,t)})):Up(Vn(e,{r:gx(o,t)}))}function ud(e,t){if(!tn(e))return t===e.k?e.v:t<e.k?ud(e.l,t):ud(e.r,t)}function ns(e,t,n="k"){if(tn(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=ns(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return ns(e.l,t,n)}function Yr(e,t,n){return tn(e)?m8(t,n,1):t===e.k?Vn(e,{k:t,v:n}):t<e.k?Mj(Vn(e,{l:Yr(e.l,t,n)})):Mj(Vn(e,{r:Yr(e.r,t,n)}))}function vx(e,t,n){if(tn(e))return[];const{k:r,v:o,l:s,r:i}=e;let l=[];return r>t&&(l=l.concat(vx(s,t,n))),r>=t&&r<=n&&l.push({k:r,v:o}),r<=n&&(l=l.concat(vx(i,t,n))),l}function Mi(e){return tn(e)?[]:[...Mi(e.l),{k:e.k,v:e.v},...Mi(e.r)]}function h8(e){return tn(e.r)?[e.k,e.v]:h8(e.r)}function g8(e){return tn(e.r)?e.l:Up(Vn(e,{r:g8(e.r)}))}function Vn(e,t){return m8(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Hv(e){return tn(e)||e.lvl>e.r.lvl}function Mj(e){return xx(x8(e))}function Up(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(Hv(t))return x8(Vn(e,{lvl:r-1}));if(!tn(t)&&!tn(t.r))return Vn(t.r,{l:Vn(t,{r:t.r.l}),r:Vn(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(Hv(e))return xx(Vn(e,{lvl:r-1}));if(!tn(n)&&!tn(n.l)){const o=n.l,s=Hv(o)?n.lvl-1:n.lvl;return Vn(o,{l:Vn(e,{r:o.l,lvl:r-1}),r:xx(Vn(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function yg(e,t,n){if(tn(e))return[];const r=ns(e,t)[0];return ere(vx(e,r,n))}function v8(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let i=1;i<n;i++){const{index:l,value:u}=t(e[i]);s.push({start:r,end:l-1,value:o}),r=l,o=u}return s.push({start:r,end:1/0,value:o}),s}function ere(e){return v8(e,({k:t,v:n})=>({index:t,value:n}))}function xx(e){const{r:t,lvl:n}=e;return!tn(t)&&!tn(t.r)&&t.lvl===n&&t.r.lvl===n?Vn(t,{l:Vn(e,{r:t.l}),lvl:n+1}):e}function x8(e){const{l:t}=e;return!tn(t)&&t.lvl===e.lvl?Vn(t,{r:Vn(e,{l:t.r})}):e}function oh(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),i=e[s],l=n(i,t);if(l===0)return s;if(l===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function b8(e,t,n){return e[oh(e,t,n)]}function tre(e,t,n,r){const o=oh(e,t,r),s=oh(e,n,r,o);return e.slice(o,s+1)}const Ly=qt(()=>({recalcInProgress:Ve(!1)}),[],{singleton:!0});function nre(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function Oj(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function rre(e,t){let n=tn(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:i}=r;if(n=Math.min(n,s),tn(e)){e=Yr(e,0,o);continue}const l=yg(e,s-1,i+1);if(l.some(nre(r)))continue;let u=!1,p=!1;for(const{start:m,end:h,value:g}of l)u?(i>=m||o===g)&&(e=gx(e,m)):(p=g!==o,u=!0),h>i&&i>=m&&g!==o&&(e=Yr(e,i+1,g));p&&(e=Yr(e,s,o))}return[e,n]}function ore(){return{offsetTree:[],sizeTree:gc(),groupOffsetTree:gc(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function zy({index:e},t){return t===e?0:t<e?-1:1}function sre({offset:e},t){return t===e?0:t<e?-1:1}function are(e){return{index:e.index,value:e}}function ire(e,t,n,r=0){return r>0&&(t=Math.max(t,b8(e,r,zy).offset)),v8(tre(e,t,n,sre),are)}function bx(e,t,n,r){let o=e,s=0,i=0,l=0,u=0;if(t!==0){u=oh(o,t-1,zy),l=o[u].offset;const m=ns(n,t-1);s=m[0],i=m[1],o.length&&o[u].size===ns(n,t)[1]&&(u-=1),o=o.slice(0,u+1)}else o=[];for(const{start:p,value:m}of yg(n,t,1/0)){const h=p-s,g=h*i+l+h*r;o.push({offset:g,size:m,index:p}),s=p,l=g,i=m}return{offsetTree:o,lastIndex:s,lastOffset:l,lastSize:i}}function lre(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,eo.DEBUG);const s=e.sizeTree;let i=s,l=0;if(n.length>0&&tn(s)&&t.length===2){const g=t[0].size,x=t[1].size;i=n.reduce((y,b)=>Yr(Yr(y,b,g),b+1,x),i)}else[i,l]=rre(i,t);if(i===s)return e;const{offsetTree:u,lastIndex:p,lastSize:m,lastOffset:h}=bx(e.offsetTree,l,i,o);return{sizeTree:i,offsetTree:u,lastIndex:p,lastOffset:h,lastSize:m,groupOffsetTree:n.reduce((g,x)=>Yr(g,x,dd(x,u,o)),gc()),groupIndices:n}}function dd(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=b8(t,e,zy),i=e-o,l=s*i+(i-1)*n+r;return l>0?l+n:l}function cre(e){return typeof e.groupIndex<"u"}function y8(e,t,n){if(cre(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=C8(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function C8(e,t){if(!Cg(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Cg(e){return!tn(e.groupOffsetTree)}function ure(e){return Mi(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],i=s?s.k-1:1/0;return{startIndex:t,endIndex:i,size:n}})}const dre={offsetHeight:"height",offsetWidth:"width"},Ts=qt(([{log:e},{recalcInProgress:t}])=>{const n=Tt(),r=Tt(),o=yr(r,0),s=Tt(),i=Tt(),l=Ve(0),u=Ve([]),p=Ve(void 0),m=Ve(void 0),h=Ve((I,M)=>ri(I,dre[M])),g=Ve(void 0),x=Ve(0),y=ore(),b=yr(Pe(n,_t(u,e,x),bs(lre,y),pn()),y),w=yr(Pe(u,pn(),bs((I,M)=>({prev:I.current,current:M}),{prev:[],current:[]}),Xe(({prev:I})=>I)),[]);st(Pe(u,gt(I=>I.length>0),_t(b,x),Xe(([I,M,R])=>{const D=I.reduce((A,O,T)=>Yr(A,O,dd(O,M.offsetTree,R)||T),gc());return{...M,groupIndices:I,groupOffsetTree:D}})),b),st(Pe(r,_t(b),gt(([I,{lastIndex:M}])=>I<M),Xe(([I,{lastIndex:M,lastSize:R}])=>[{startIndex:I,endIndex:M,size:R}])),n),st(p,m);const S=yr(Pe(p,Xe(I=>I===void 0)),!0);st(Pe(m,gt(I=>I!==void 0&&tn(bo(b).sizeTree)),Xe(I=>[{startIndex:0,endIndex:0,size:I}])),n);const j=Jr(Pe(n,_t(b),bs(({sizes:I},[M,R])=>({changed:R!==I,sizes:R}),{changed:!1,sizes:y}),Xe(I=>I.changed)));Yt(Pe(l,bs((I,M)=>({diff:I.prev-M,prev:M}),{diff:0,prev:0}),Xe(I=>I.diff)),I=>{const{groupIndices:M}=bo(b);if(I>0)wt(t,!0),wt(s,I+Oj(I,M));else if(I<0){const R=bo(w);R.length>0&&(I-=Oj(-I,R)),wt(i,I)}}),Yt(Pe(l,_t(e)),([I,M])=>{I<0&&M("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},eo.ERROR)});const _=Jr(s);st(Pe(s,_t(b),Xe(([I,M])=>{const R=M.groupIndices.length>0,D=[],A=M.lastSize;if(R){const O=ud(M.sizeTree,0);let T=0,X=0;for(;T<I;){const U=M.groupIndices[X],N=M.groupIndices.length===X+1?1/0:M.groupIndices[X+1]-U-1;D.push({startIndex:U,endIndex:U,size:O}),D.push({startIndex:U+1,endIndex:U+1+N-1,size:A}),X++,T+=N+1}const B=Mi(M.sizeTree);return T!==I&&B.shift(),B.reduce((U,{k:N,v:$})=>{let q=U.ranges;return U.prevSize!==0&&(q=[...U.ranges,{startIndex:U.prevIndex,endIndex:N+I-1,size:U.prevSize}]),{ranges:q,prevIndex:N+I,prevSize:$}},{ranges:D,prevIndex:I,prevSize:0}).ranges}return Mi(M.sizeTree).reduce((O,{k:T,v:X})=>({ranges:[...O.ranges,{startIndex:O.prevIndex,endIndex:T+I-1,size:O.prevSize}],prevIndex:T+I,prevSize:X}),{ranges:[],prevIndex:0,prevSize:A}).ranges})),n);const E=Jr(Pe(i,_t(b,x),Xe(([I,{offsetTree:M},R])=>{const D=-I;return dd(D,M,R)})));return st(Pe(i,_t(b,x),Xe(([I,M,R])=>{if(M.groupIndices.length>0){if(tn(M.sizeTree))return M;let A=gc();const O=bo(w);let T=0,X=0,B=0;for(;T<-I;){B=O[X];const U=O[X+1]-B-1;X++,T+=U+1}if(A=Mi(M.sizeTree).reduce((U,{k:N,v:$})=>Yr(U,Math.max(0,N+I),$),A),T!==-I){const U=ud(M.sizeTree,B);A=Yr(A,0,U);const N=ns(M.sizeTree,-I+1)[1];A=Yr(A,1,N)}return{...M,sizeTree:A,...bx(M.offsetTree,0,A,R)}}else{const A=Mi(M.sizeTree).reduce((O,{k:T,v:X})=>Yr(O,Math.max(0,T+I),X),gc());return{...M,sizeTree:A,...bx(M.offsetTree,0,A,R)}}})),b),{data:g,totalCount:r,sizeRanges:n,groupIndices:u,defaultItemSize:m,fixedItemSize:p,unshiftWith:s,shiftWith:i,shiftWithOffset:E,beforeUnshiftWith:_,firstItemIndex:l,gap:x,sizes:b,listRefresh:j,statefulTotalCount:o,trackItemSizes:S,itemSize:h}},hn(fi,Ly),{singleton:!0}),fre=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function w8(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!fre)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Xd=qt(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:i,smoothScrollTargetReached:l,headerHeight:u,footerHeight:p,fixedHeaderHeight:m,fixedFooterHeight:h},{log:g}])=>{const x=Tt(),y=Ve(0);let b=null,w=null,S=null;function j(){b&&(b(),b=null),S&&(S(),S=null),w&&(clearTimeout(w),w=null),wt(o,!1)}return st(Pe(x,_t(e,s,t,y,u,p,g),_t(r,m,h),Xe(([[_,E,I,M,R,D,A,O],T,X,B])=>{const V=w8(_),{align:U,behavior:N,offset:$}=V,q=M-1,F=y8(V,E,q);let Q=dd(F,E.offsetTree,T)+D;U==="end"?(Q+=X+ns(E.sizeTree,F)[1]-I+B,F===q&&(Q+=A)):U==="center"?Q+=(X+ns(E.sizeTree,F)[1]-I+B)/2:Q-=R,$&&(Q+=$);const Y=se=>{j(),se?(O("retrying to scroll to",{location:_},eo.DEBUG),wt(x,_)):O("list did not change, scroll successful",{},eo.DEBUG)};if(j(),N==="smooth"){let se=!1;S=Yt(n,ae=>{se=se||ae}),b=ca(l,()=>{Y(se)})}else b=ca(Pe(n,pre(150)),Y);return w=setTimeout(()=>{j()},1200),wt(o,!0),O("scrolling from index to",{index:F,top:Q,behavior:N},eo.DEBUG),{top:Q,behavior:N}})),i),{scrollToIndex:x,topListHeight:y}},hn(Ts,Sr,fi),{singleton:!0});function pre(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const fd="up",Hu="down",mre="none",hre={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},gre=0,Qd=qt(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=Ve(!1),l=Ve(!0),u=Tt(),p=Tt(),m=Ve(4),h=Ve(gre),g=yr(Pe(Ej(Pe(ht(t),Pc(1),qs(!0)),Pe(ht(t),Pc(1),qs(!1),Pj(100))),pn()),!1),x=yr(Pe(Ej(Pe(s,qs(!0)),Pe(s,qs(!1),Pj(200))),pn()),!1);st(Pe(Qn(ht(t),ht(h)),Xe(([j,_])=>j<=_),pn()),l),st(Pe(l,Ga(50)),p);const y=Jr(Pe(Qn(e,ht(n),ht(r),ht(o),ht(m)),bs((j,[{scrollTop:_,scrollHeight:E},I,M,R,D])=>{const A=_+I-E>-D,O={viewportHeight:I,scrollTop:_,scrollHeight:E};if(A){let X,B;return _>j.state.scrollTop?(X="SCROLLED_DOWN",B=j.state.scrollTop-_):(X="SIZE_DECREASED",B=j.state.scrollTop-_||j.scrollTopDelta),{atBottom:!0,state:O,atBottomBecause:X,scrollTopDelta:B}}let T;return O.scrollHeight>j.state.scrollHeight?T="SIZE_INCREASED":I<j.state.viewportHeight?T="VIEWPORT_HEIGHT_DECREASING":_<j.state.scrollTop?T="SCROLLING_UPWARDS":T="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:T,state:O}},hre),pn((j,_)=>j&&j.atBottom===_.atBottom))),b=yr(Pe(e,bs((j,{scrollTop:_,scrollHeight:E,viewportHeight:I})=>{if(f8(j.scrollHeight,E))return{scrollTop:_,scrollHeight:E,jump:0,changed:!1};{const M=E-(_+I)<1;return j.scrollTop!==_&&M?{scrollHeight:E,scrollTop:_,jump:j.scrollTop-_,changed:!0}:{scrollHeight:E,scrollTop:_,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),gt(j=>j.changed),Xe(j=>j.jump)),0);st(Pe(y,Xe(j=>j.atBottom)),i),st(Pe(i,Ga(50)),u);const w=Ve(Hu);st(Pe(e,Xe(({scrollTop:j})=>j),pn(),bs((j,_)=>bo(x)?{direction:j.direction,prevScrollTop:_}:{direction:_<j.prevScrollTop?fd:Hu,prevScrollTop:_},{direction:Hu,prevScrollTop:0}),Xe(j=>j.direction)),w),st(Pe(e,Ga(50),qs(mre)),w);const S=Ve(0);return st(Pe(g,gt(j=>!j),qs(0)),S),st(Pe(t,Ga(100),_t(g),gt(([j,_])=>!!_),bs(([j,_],[E])=>[_,E],[0,0]),Xe(([j,_])=>_-j)),S),{isScrolling:g,isAtTop:l,isAtBottom:i,atBottomState:y,atTopStateChange:p,atBottomStateChange:u,scrollDirection:w,atBottomThreshold:m,atTopThreshold:h,scrollVelocity:S,lastJumpDueToItemResize:b}},hn(Sr)),pi=qt(([{log:e}])=>{const t=Ve(!1),n=Jr(Pe(t,gt(r=>r),pn()));return Yt(t,r=>{r&&bo(e)("props updated",{},eo.DEBUG)}),{propsReady:t,didMount:n}},hn(fi),{singleton:!0});function Fy(e,t){e==0?t():requestAnimationFrame(()=>Fy(e-1,t))}function By(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const Yd=qt(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:s}])=>{const i=Ve(!0),l=Ve(0),u=Ve(!1);return st(Pe(s,_t(l),gt(([p,m])=>!!m),qs(!1)),i),Yt(Pe(Qn(t,s),_t(i,e,n,u),gt(([[,p],m,{sizeTree:h},g,x])=>p&&(!tn(h)||Ty(g))&&!m&&!x),_t(l)),([,p])=>{wt(u,!0),Fy(3,()=>{ca(r,()=>wt(i,!0)),wt(o,p)})}),{scrolledToInitialItem:i,initialTopMostItemIndex:l}},hn(Ts,Sr,Xd,pi),{singleton:!0});function Rj(e){return e?e==="smooth"?"smooth":"auto":!1}const vre=(e,t)=>typeof e=="function"?Rj(e(t)):t&&Rj(e),xre=qt(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:i,didMount:l},{log:u},{scrollingInProgress:p}])=>{const m=Ve(!1),h=Tt();let g=null;function x(b){wt(o,{index:"LAST",align:"end",behavior:b})}Yt(Pe(Qn(Pe(ht(e),Pc(1)),l),_t(ht(m),n,s,p),Xe(([[b,w],S,j,_,E])=>{let I=w&&_,M="auto";return I&&(M=vre(S,j||E),I=I&&!!M),{totalCount:b,shouldFollow:I,followOutputBehavior:M}}),gt(({shouldFollow:b})=>b)),({totalCount:b,followOutputBehavior:w})=>{g&&(g(),g=null),g=ca(t,()=>{bo(u)("following output to ",{totalCount:b},eo.DEBUG),x(w),g=null})});function y(b){const w=ca(r,S=>{b&&!S.atBottom&&S.notAtBottomBecause==="SIZE_INCREASED"&&!g&&(bo(u)("scrolling to bottom due to increased size",{},eo.DEBUG),x("auto"))});setTimeout(w,100)}return Yt(Pe(Qn(ht(m),e,i),gt(([b,,w])=>b&&w),bs(({value:b},[,w])=>({refreshed:b===w,value:w}),{refreshed:!1,value:0}),gt(({refreshed:b})=>b),_t(m,e)),([,b])=>{y(b!==!1)}),Yt(h,()=>{y(bo(m)!==!1)}),Yt(Qn(ht(m),r),([b,w])=>{b&&!w.atBottom&&w.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&x("auto")}),{followOutput:m,autoscrollToBottom:h}},hn(Ts,Qd,Xd,Yd,pi,fi,Sr));function bre(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const S8=qt(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=Tt(),i=Tt(),l=Jr(Pe(s,Xe(bre)));return st(Pe(l,Xe(u=>u.totalCount)),e),st(Pe(l,Xe(u=>u.groupIndices)),t),st(Pe(Qn(r,n,o),gt(([u,p])=>Cg(p)),Xe(([u,p,m])=>ns(p.groupOffsetTree,Math.max(u-m,0),"v")[0]),pn(),Xe(u=>[u])),i),{groupCounts:s,topItemsIndexes:i}},hn(Ts,Sr));function pd(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function k8(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const sh="top",ah="bottom",Dj="none";function Aj(e,t,n){return typeof e=="number"?n===fd&&t===sh||n===Hu&&t===ah?e:0:n===fd?t===sh?e.main:e.reverse:t===ah?e.main:e.reverse}function Tj(e,t){return typeof e=="number"?e:e[t]||0}const Hy=qt(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Tt(),i=Ve(0),l=Ve(0),u=Ve(0),p=yr(Pe(Qn(ht(e),ht(t),ht(r),ht(s,pd),ht(u),ht(i),ht(o),ht(n),ht(l)),Xe(([m,h,g,[x,y],b,w,S,j,_])=>{const E=m-j,I=w+S,M=Math.max(g-E,0);let R=Dj;const D=Tj(_,sh),A=Tj(_,ah);return x-=j,x+=g+S,y+=g+S,y-=j,x>m+I-D&&(R=fd),y<m-M+h+A&&(R=Hu),R!==Dj?[Math.max(E-g-Aj(b,sh,R)-D,0),E-M-S+h+Aj(b,ah,R)+A]:null}),gt(m=>m!=null),pn(pd)),[0,0]);return{listBoundary:s,overscan:u,topListHeight:i,increaseViewportBy:l,visibleRange:p}},hn(Sr),{singleton:!0});function yre(e,t,n){if(Cg(t)){const r=C8(e,t);return[{index:ns(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const Nj={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function $j(e,t,n){if(e.length===0)return[];if(!Cg(t))return e.map(p=>({...p,index:p.index+n,originalIndex:p.index}));const r=e[0].index,o=e[e.length-1].index,s=[],i=yg(t.groupOffsetTree,r,o);let l,u=0;for(const p of e){(!l||l.end<p.index)&&(l=i.shift(),u=t.groupIndices.indexOf(l.start));let m;p.index===l.start?m={type:"group",index:u}:m={index:p.index-(u+1)+n,groupIndex:u},s.push({...m,size:p.size,offset:p.offset,originalIndex:p.index,data:p.data})}return s}function Gp(e,t,n,r,o,s){const{lastSize:i,lastOffset:l,lastIndex:u}=o;let p=0,m=0;if(e.length>0){p=e[0].offset;const b=e[e.length-1];m=b.offset+b.size}const h=n-u,g=l+h*i+(h-1)*r,x=p,y=g-m;return{items:$j(e,o,s),topItems:$j(t,o,s),topListHeight:t.reduce((b,w)=>w.size+b,0),offsetTop:p,offsetBottom:y,top:x,bottom:m,totalCount:n,firstItemIndex:s}}const cl=qt(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:i,listBoundary:l,topListHeight:u},{scrolledToInitialItem:p,initialTopMostItemIndex:m},{topListHeight:h},g,{didMount:x},{recalcInProgress:y}])=>{const b=Ve([]),w=Tt();st(s.topItemsIndexes,b);const S=yr(Pe(Qn(x,y,ht(i,pd),ht(t),ht(e),ht(m),p,ht(b),ht(r),ht(o),n),gt(([I,M,,R,,,,,,,D])=>{const A=D&&D.length!==R;return I&&!M&&!A}),Xe(([,,[I,M],R,D,A,O,T,X,B,V])=>{const U=D,{sizeTree:N,offsetTree:$}=U;if(R===0||I===0&&M===0)return{...Nj,totalCount:R};if(tn(N))return Gp(yre(By(A,R),U,V),[],R,B,U,X);const q=[];if(T.length>0){const ae=T[0],re=T[T.length-1];let G=0;for(const K of yg(N,ae,re)){const ee=K.value,ce=Math.max(K.start,ae),J=Math.min(K.end,re);for(let ie=ce;ie<=J;ie++)q.push({index:ie,size:ee,offset:G,data:V&&V[ie]}),G+=ee}}if(!O)return Gp([],q,R,B,U,X);const F=T.length>0?T[T.length-1]+1:0,Q=ire($,I,M,F);if(Q.length===0)return null;const Y=R-1,se=bg([],ae=>{for(const re of Q){const G=re.value;let K=G.offset,ee=re.start;const ce=G.size;if(G.offset<I){ee+=Math.floor((I-G.offset+B)/(ce+B));const ie=ee-re.start;K+=ie*ce+ie*B}ee<F&&(K+=(F-ee)*ce,ee=F);const J=Math.min(re.end,Y);for(let ie=ee;ie<=J&&!(K>=M);ie++)ae.push({index:ie,size:ce,offset:K,data:V&&V[ie]}),K+=ce+B}});return Gp(se,q,R,B,U,X)}),gt(I=>I!==null),pn()),Nj);st(Pe(n,gt(Ty),Xe(I=>I==null?void 0:I.length)),t),st(Pe(S,Xe(I=>I.topListHeight)),h),st(h,u),st(Pe(S,Xe(I=>[I.top,I.bottom])),l),st(Pe(S,Xe(I=>I.items)),w);const j=Jr(Pe(S,gt(({items:I})=>I.length>0),_t(t,n),gt(([{items:I},M])=>I[I.length-1].originalIndex===M-1),Xe(([,I,M])=>[I-1,M]),pn(pd),Xe(([I])=>I))),_=Jr(Pe(S,Ga(200),gt(({items:I,topItems:M})=>I.length>0&&I[0].originalIndex===M.length),Xe(({items:I})=>I[0].index),pn())),E=Jr(Pe(S,gt(({items:I})=>I.length>0),Xe(({items:I})=>{let M=0,R=I.length-1;for(;I[M].type==="group"&&M<R;)M++;for(;I[R].type==="group"&&R>M;)R--;return{startIndex:I[M].index,endIndex:I[R].index}}),pn(k8)));return{listState:S,topItemsIndexes:b,endReached:j,startReached:_,rangeChanged:E,itemsRendered:w,...g}},hn(Ts,S8,Hy,Yd,Xd,Qd,pi,Ly),{singleton:!0}),Cre=qt(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{listState:s},{didMount:i}])=>{const l=Ve(0);return st(Pe(i,_t(l),gt(([,u])=>u!==0),_t(o,e,t,r,n),Xe(([[,u],p,m,h,g,x=[]])=>{let y=0;if(m.groupIndices.length>0)for(const j of m.groupIndices){if(j-y>=u)break;y++}const b=u+y,w=By(p,b),S=Array.from({length:b}).map((j,_)=>({index:_+w,size:0,offset:0,data:x[_+w]}));return Gp(S,[],b,g,m,h)})),s),{initialItemCount:l}},hn(Ts,Yd,cl,pi),{singleton:!0}),j8=qt(([{scrollVelocity:e}])=>{const t=Ve(!1),n=Tt(),r=Ve(!1);return st(Pe(e,_t(r,t,n),gt(([o,s])=>!!s),Xe(([o,s,i,l])=>{const{exit:u,enter:p}=s;if(i){if(u(o,l))return!1}else if(p(o,l))return!0;return i}),pn()),t),Yt(Pe(Qn(t,e,n),_t(r)),([[o,s,i],l])=>o&&l&&l.change&&l.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},hn(Qd),{singleton:!0}),wre=qt(([{topItemsIndexes:e}])=>{const t=Ve(0);return st(Pe(t,gt(n=>n>0),Xe(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},hn(cl)),_8=qt(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=Tt(),i=yr(Pe(Qn(e,r,t,n,o),Xe(([l,u,p,m,h])=>l+u+p+m+h.offsetBottom+h.bottom)),0);return st(ht(i),s),{totalListHeight:i,totalListHeightChanged:s}},hn(Sr,cl),{singleton:!0});function I8(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Sre=I8(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),kre=qt(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:i,lastJumpDueToItemResize:l},{listState:u},{beforeUnshiftWith:p,shiftWithOffset:m,sizes:h,gap:g},{log:x},{recalcInProgress:y}])=>{const b=Jr(Pe(u,_t(l),bs(([,S,j,_],[{items:E,totalCount:I,bottom:M,offsetBottom:R},D])=>{const A=M+R;let O=0;return j===I&&S.length>0&&E.length>0&&(E[0].originalIndex===0&&S[0].originalIndex===0||(O=A-_,O!==0&&(O+=D))),[O,E,I,A]},[0,[],0,0]),gt(([S])=>S!==0),_t(t,i,r,s,x,y),gt(([,S,j,_,,,E])=>!E&&!_&&S!==0&&j===fd),Xe(([[S],,,,,j])=>(j("Upward scrolling compensation",{amount:S},eo.DEBUG),S))));function w(S){S>0?(wt(e,{top:-S,behavior:"auto"}),wt(n,0)):(wt(n,0),wt(e,{top:-S,behavior:"auto"}))}return Yt(Pe(b,_t(n,o)),([S,j,_])=>{_&&Sre()?wt(n,j-S):w(-S)}),Yt(Pe(Qn(yr(o,!1),n,y),gt(([S,j,_])=>!S&&!_&&j!==0),Xe(([S,j])=>j),Ga(1)),w),st(Pe(m,Xe(S=>({top:-S}))),e),Yt(Pe(p,_t(h,g),Xe(([S,{lastSize:j,groupIndices:_,sizeTree:E},I])=>{function M(R){return R*(j+I)}if(_.length===0)return M(S);{let R=0;const D=ud(E,0);let A=0,O=0;for(;A<S;){A++,R+=D;let T=_.length===O+1?1/0:_[O+1]-_[O]-1;A+T>S&&(R-=D,T=S-A+1),A+=T,R+=M(T),O++}return R}})),S=>{wt(n,S),requestAnimationFrame(()=>{wt(e,{top:S}),requestAnimationFrame(()=>{wt(n,0),wt(y,!1)})})}),{deviation:n}},hn(Sr,Qd,cl,Ts,fi,Ly)),jre=qt(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=Ve(0);return Yt(Pe(e,_t(r),gt(([,o])=>o!==0),Xe(([,o])=>({top:o}))),o=>{ca(Pe(n,Pc(1),gt(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{wt(t,o)})})}),{initialScrollTop:r}},hn(pi,Sr,cl),{singleton:!0}),_re=qt(([{viewportHeight:e},{totalListHeight:t}])=>{const n=Ve(!1),r=yr(Pe(Qn(n,e,t),gt(([o])=>o),Xe(([,o,s])=>Math.max(0,o-s)),Ga(0),pn()),0);return{alignToBottom:n,paddingTopAddition:r}},hn(Sr,_8),{singleton:!0}),Vy=qt(([{scrollTo:e,scrollContainerState:t}])=>{const n=Tt(),r=Tt(),o=Tt(),s=Ve(!1),i=Ve(void 0);return st(Pe(Qn(n,r),Xe(([{viewportHeight:l,scrollTop:u,scrollHeight:p},{offsetTop:m}])=>({scrollTop:Math.max(0,u-m),scrollHeight:p,viewportHeight:l}))),t),st(Pe(e,_t(r),Xe(([l,{offsetTop:u}])=>({...l,top:l.top+u}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},hn(Sr)),Ire=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...i}})=>e<n?{...i,behavior:o,align:s??"start"}:t>r?{...i,behavior:o,align:s??"end"}:null,Pre=qt(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:i,fixedFooterHeight:l,scrollingInProgress:u},{scrollToIndex:p}])=>{const m=Tt();return st(Pe(m,_t(e,o,t,s,i,l,r),_t(n),Xe(([[h,g,x,y,b,w,S,j],_])=>{const{done:E,behavior:I,align:M,calculateViewLocation:R=Ire,...D}=h,A=y8(h,g,y-1),O=dd(A,g.offsetTree,_)+b+w,T=O+ns(g.sizeTree,A)[1],X=j+w,B=j+x-S,V=R({itemTop:O,itemBottom:T,viewportTop:X,viewportBottom:B,locationParams:{behavior:I,align:M,...D}});return V?E&&ca(Pe(u,gt(U=>U===!1),Pc(bo(u)?1:2)),E):E&&E(),V}),gt(h=>h!==null)),p),{scrollIntoView:m}},hn(Ts,Sr,Xd,cl,fi),{singleton:!0}),Ere=qt(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:s,windowScrollContainerState:i,windowViewportRect:l}])=>{const u=Tt(),p=Ve(void 0),m=Ve(null),h=Ve(null);return st(i,m),st(l,h),Yt(Pe(u,_t(e,n,s,m,h)),([g,x,y,b,w,S])=>{const j=ure(x.sizeTree);b&&w!==null&&S!==null&&(y=w.scrollTop-S.offsetTop),g({ranges:j,scrollTop:y})}),st(Pe(p,gt(Ty),Xe(Mre)),r),st(Pe(o,_t(p),gt(([,g])=>g!==void 0),pn(),Xe(([,g])=>g.ranges)),t),{getState:u,restoreStateFrom:p}},hn(Ts,Sr,Yd,pi,Vy));function Mre(e){return{offset:e.scrollTop,index:0,align:"start"}}const Ore=qt(([e,t,n,r,o,s,i,l,u,p])=>({...e,...t,...n,...r,...o,...s,...i,...l,...u,...p}),hn(Hy,Cre,pi,j8,_8,jre,_re,Vy,Pre,fi)),Rre=qt(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:i,firstItemIndex:l,groupIndices:u,statefulTotalCount:p,gap:m,sizes:h},{initialTopMostItemIndex:g,scrolledToInitialItem:x},y,b,w,{listState:S,topItemsIndexes:j,..._},{scrollToIndex:E},I,{topItemCount:M},{groupCounts:R},D])=>(st(_.rangeChanged,D.scrollSeekRangeChanged),st(Pe(D.windowViewportRect,Xe(A=>A.visibleHeight)),y.viewportHeight),{totalCount:e,data:i,firstItemIndex:l,sizeRanges:t,initialTopMostItemIndex:g,scrolledToInitialItem:x,topItemsIndexes:j,topItemCount:M,groupCounts:R,fixedItemHeight:n,defaultItemHeight:r,gap:m,...w,statefulTotalCount:p,listState:S,scrollToIndex:E,trackItemSizes:o,itemSize:s,groupIndices:u,..._,...D,...y,sizes:h,...b}),hn(Ts,Yd,Sr,Ere,xre,cl,Xd,kre,wre,S8,Ore)),Vv="-webkit-sticky",Lj="sticky",P8=I8(()=>{if(typeof document>"u")return Lj;const e=document.createElement("div");return e.style.position=Vv,e.style.position===Vv?Vv:Lj});function E8(e,t){const n=H.useRef(null),r=H.useCallback(l=>{if(l===null||!l.offsetParent)return;const u=l.getBoundingClientRect(),p=u.width;let m,h;if(t){const g=t.getBoundingClientRect(),x=u.top-g.top;m=g.height-Math.max(0,x),h=x+t.scrollTop}else m=window.innerHeight-Math.max(0,u.top),h=u.top+window.pageYOffset;n.current={offsetTop:h,visibleHeight:m,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=$y(r),i=H.useCallback(()=>{r(s.current)},[r,s]);return H.useEffect(()=>{if(t){t.addEventListener("scroll",i);const l=new ResizeObserver(i);return l.observe(t),()=>{t.removeEventListener("scroll",i),l.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}const M8=H.createContext(void 0),O8=H.createContext(void 0);function R8(e){return e}const Dre=qt(()=>{const e=Ve(u=>`Item ${u}`),t=Ve(null),n=Ve(u=>`Group ${u}`),r=Ve({}),o=Ve(R8),s=Ve("div"),i=Ve(Uc),l=(u,p=null)=>yr(Pe(r,Xe(m=>m[u]),pn()),p);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:i,FooterComponent:l("Footer"),HeaderComponent:l("Header"),TopItemListComponent:l("TopItemList"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),GroupComponent:l("Group","div"),ScrollerComponent:l("Scroller","div"),EmptyPlaceholder:l("EmptyPlaceholder"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder")}}),Are=qt(([e,t])=>({...e,...t}),hn(Rre,Dre)),Tre=({height:e})=>H.createElement("div",{style:{height:e}}),Nre={position:P8(),zIndex:1,overflowAnchor:"none"},$re={overflowAnchor:"none"},zj=H.memo(function({showTopList:t=!1}){const n=Rt("listState"),r=yo("sizeRanges"),o=Rt("useWindowScroll"),s=Rt("customScrollParent"),i=yo("windowScrollContainerState"),l=yo("scrollContainerState"),u=s||o?i:l,p=Rt("itemContent"),m=Rt("context"),h=Rt("groupContent"),g=Rt("trackItemSizes"),x=Rt("itemSize"),y=Rt("log"),b=yo("gap"),{callbackRef:w}=Yne(r,x,g,t?Uc:u,y,b,s),[S,j]=H.useState(0);Wy("deviation",V=>{S!==V&&j(V)});const _=Rt("EmptyPlaceholder"),E=Rt("ScrollSeekPlaceholder")||Tre,I=Rt("ListComponent"),M=Rt("ItemComponent"),R=Rt("GroupComponent"),D=Rt("computeItemKey"),A=Rt("isSeeking"),O=Rt("groupIndices").length>0,T=Rt("paddingTopAddition"),X=Rt("scrolledToInitialItem"),B=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+T,paddingBottom:n.offsetBottom,marginTop:S,...X?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&_?H.createElement(_,Rr(_,m)):H.createElement(I,{...Rr(I,m),ref:w,style:B,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(V=>{const U=V.originalIndex,N=D(U+n.firstItemIndex,V.data,m);return A?H.createElement(E,{...Rr(E,m),key:N,index:V.index,height:V.size,type:V.type||"item",...V.type==="group"?{}:{groupIndex:V.groupIndex}}):V.type==="group"?H.createElement(R,{...Rr(R,m),key:N,"data-index":U,"data-known-size":V.size,"data-item-index":V.index,style:Nre},h(V.index,m)):H.createElement(M,{...Rr(M,m),key:N,"data-index":U,"data-known-size":V.size,"data-item-index":V.index,"data-item-group-index":V.groupIndex,item:V.data,style:$re},O?p(V.index,V.groupIndex,V.data,m):p(V.index,V.data,m))}))}),Lre={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},wg={width:"100%",height:"100%",position:"absolute",top:0},zre={width:"100%",position:P8(),top:0,zIndex:1};function Rr(e,t){if(typeof e!="string")return{context:t}}const Fre=H.memo(function(){const t=Rt("HeaderComponent"),n=yo("headerHeight"),r=Rt("headerFooterTag"),o=ll(i=>n(ri(i,"height"))),s=Rt("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),Bre=H.memo(function(){const t=Rt("FooterComponent"),n=yo("footerHeight"),r=Rt("headerFooterTag"),o=ll(i=>n(ri(i,"height"))),s=Rt("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null});function D8({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const u=e("scrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("scrollerRef"),g=n("context"),{scrollerRef:x,scrollByCallback:y,scrollToCallback:b}=p8(u,m,p,h);return t("scrollTo",b),t("scrollBy",y),H.createElement(p,{ref:x,style:{...Lre,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,...Rr(p,g)},i)})}function A8({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const u=e("windowScrollContainerState"),p=n("ScrollerComponent"),m=e("smoothScrollTargetReached"),h=n("totalListHeight"),g=n("deviation"),x=n("customScrollParent"),y=n("context"),{scrollerRef:b,scrollByCallback:w,scrollToCallback:S}=p8(u,m,p,Uc,x);return qne(()=>(b.current=x||window,()=>{b.current=null}),[b,x]),t("windowScrollTo",S),t("scrollBy",w),H.createElement(p,{style:{position:"relative",...s,...h!==0?{height:h+g}:{}},"data-virtuoso-scroller":!0,...l,...Rr(p,y)},i)})}const Hre=({children:e})=>{const t=H.useContext(M8),n=yo("viewportHeight"),r=yo("fixedItemHeight"),o=ll(l8(n,s=>ri(s,"height")));return H.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),H.createElement("div",{style:wg,ref:o,"data-viewport-type":"element"},e)},Vre=({children:e})=>{const t=H.useContext(M8),n=yo("windowViewportRect"),r=yo("fixedItemHeight"),o=Rt("customScrollParent"),s=E8(n,o);return H.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),H.createElement("div",{ref:s,style:wg,"data-viewport-type":"window"},e)},Wre=({children:e})=>{const t=Rt("TopItemListComponent"),n=Rt("headerHeight"),r={...zre,marginTop:`${n}px`},o=Rt("context");return H.createElement(t||"div",{style:r,context:o},e)},Ure=H.memo(function(t){const n=Rt("useWindowScroll"),r=Rt("topItemsIndexes").length>0,o=Rt("customScrollParent"),s=o||n?qre:Kre,i=o||n?Vre:Hre;return H.createElement(s,{...t},r&&H.createElement(Wre,null,H.createElement(zj,{showTopList:!0})),H.createElement(i,null,H.createElement(Fre,null),H.createElement(zj,null),H.createElement(Bre,null)))}),{Component:Gre,usePublisher:yo,useEmitterValue:Rt,useEmitter:Wy}=d8(Are,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Ure),Kre=D8({usePublisher:yo,useEmitterValue:Rt,useEmitter:Wy}),qre=A8({usePublisher:yo,useEmitterValue:Rt,useEmitter:Wy}),Xre=Gre,Fj={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Qre={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Bj,ceil:Hj,floor:ih,min:Wv,max:Vu}=Math;function Yre(e){return{...Qre,items:e}}function Vj(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function Zre(e,t){return e&&e.column===t.column&&e.row===t.row}function Ep(e,t){return e&&e.width===t.width&&e.height===t.height}const Jre=qt(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:l,scrollContainerState:u,footerHeight:p,headerHeight:m},h,g,{propsReady:x,didMount:y},{windowViewportRect:b,useWindowScroll:w,customScrollParent:S,windowScrollContainerState:j,windowScrollTo:_},E])=>{const I=Ve(0),M=Ve(0),R=Ve(Fj),D=Ve({height:0,width:0}),A=Ve({height:0,width:0}),O=Tt(),T=Tt(),X=Ve(0),B=Ve(null),V=Ve({row:0,column:0}),U=Tt(),N=Tt(),$=Ve(!1),q=Ve(0),F=Ve(!0),Q=Ve(!1);Yt(Pe(y,_t(q),gt(([K,ee])=>!!ee)),()=>{wt(F,!1),wt(M,0)}),Yt(Pe(Qn(y,F,A,D,q,Q),gt(([K,ee,ce,J,,ie])=>K&&!ee&&ce.height!==0&&J.height!==0&&!ie)),([,,,,K])=>{wt(Q,!0),Fy(1,()=>{wt(O,K)}),ca(Pe(r),()=>{wt(n,[0,0]),wt(F,!0)})}),st(Pe(N,gt(K=>K!=null&&K.scrollTop>0),qs(0)),M),Yt(Pe(y,_t(N),gt(([,K])=>K!=null)),([,K])=>{K&&(wt(D,K.viewport),wt(A,K==null?void 0:K.item),wt(V,K.gap),K.scrollTop>0&&(wt($,!0),ca(Pe(r,Pc(1)),ee=>{wt($,!1)}),wt(i,{top:K.scrollTop})))}),st(Pe(D,Xe(({height:K})=>K)),o),st(Pe(Qn(ht(D,Ep),ht(A,Ep),ht(V,(K,ee)=>K&&K.column===ee.column&&K.row===ee.row),ht(r)),Xe(([K,ee,ce,J])=>({viewport:K,item:ee,gap:ce,scrollTop:J}))),U),st(Pe(Qn(ht(I),t,ht(V,Zre),ht(A,Ep),ht(D,Ep),ht(B),ht(M),ht($),ht(F),ht(q)),gt(([,,,,,,,K])=>!K),Xe(([K,[ee,ce],J,ie,de,ge,Ce,,he,fe])=>{const{row:Oe,column:_e}=J,{height:Ne,width:nt}=ie,{width:$e}=de;if(Ce===0&&(K===0||$e===0))return Fj;if(nt===0){const lt=By(fe,K),ft=lt===0?Math.max(Ce-1,0):lt;return Yre(Vj(lt,ft,ge))}const Pt=T8($e,nt,_e);let Ze,ot;he?ee===0&&ce===0&&Ce>0?(Ze=0,ot=Ce-1):(Ze=Pt*ih((ee+Oe)/(Ne+Oe)),ot=Pt*Hj((ce+Oe)/(Ne+Oe))-1,ot=Wv(K-1,Vu(ot,Pt-1)),Ze=Wv(ot,Vu(0,Ze))):(Ze=0,ot=-1);const ye=Vj(Ze,ot,ge),{top:De,bottom:ut}=Wj(de,J,ie,ye),bt=Hj(K/Pt),Je=bt*Ne+(bt-1)*Oe-ut;return{items:ye,offsetTop:De,offsetBottom:Je,top:De,bottom:ut,itemHeight:Ne,itemWidth:nt}})),R),st(Pe(B,gt(K=>K!==null),Xe(K=>K.length)),I),st(Pe(Qn(D,A,R,V),gt(([K,ee,{items:ce}])=>ce.length>0&&ee.height!==0&&K.height!==0),Xe(([K,ee,{items:ce},J])=>{const{top:ie,bottom:de}=Wj(K,J,ee,ce);return[ie,de]}),pn(pd)),n);const Y=Ve(!1);st(Pe(r,_t(Y),Xe(([K,ee])=>ee||K!==0)),Y);const se=Jr(Pe(ht(R),gt(({items:K})=>K.length>0),_t(I,Y),gt(([{items:K},ee,ce])=>ce&&K[K.length-1].index===ee-1),Xe(([,K])=>K-1),pn())),ae=Jr(Pe(ht(R),gt(({items:K})=>K.length>0&&K[0].index===0),qs(0),pn())),re=Jr(Pe(ht(R),_t($),gt(([{items:K},ee])=>K.length>0&&!ee),Xe(([{items:K}])=>({startIndex:K[0].index,endIndex:K[K.length-1].index})),pn(k8),Ga(0)));st(re,g.scrollSeekRangeChanged),st(Pe(O,_t(D,A,I,V),Xe(([K,ee,ce,J,ie])=>{const de=w8(K),{align:ge,behavior:Ce,offset:he}=de;let fe=de.index;fe==="LAST"&&(fe=J-1),fe=Vu(0,fe,Wv(J-1,fe));let Oe=yx(ee,ie,ce,fe);return ge==="end"?Oe=Bj(Oe-ee.height+ce.height):ge==="center"&&(Oe=Bj(Oe-ee.height/2+ce.height/2)),he&&(Oe+=he),{top:Oe,behavior:Ce}})),i);const G=yr(Pe(R,Xe(K=>K.offsetBottom+K.bottom)),0);return st(Pe(b,Xe(K=>({width:K.visibleWidth,height:K.visibleHeight}))),D),{data:B,totalCount:I,viewportDimensions:D,itemDimensions:A,scrollTop:r,scrollHeight:T,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:O,smoothScrollTargetReached:l,windowViewportRect:b,windowScrollTo:_,useWindowScroll:w,customScrollParent:S,windowScrollContainerState:j,deviation:X,scrollContainerState:u,footerHeight:p,headerHeight:m,initialItemCount:M,gap:V,restoreStateFrom:N,...g,initialTopMostItemIndex:q,gridState:R,totalListHeight:G,...h,startReached:ae,endReached:se,rangeChanged:re,stateChanged:U,propsReady:x,stateRestoreInProgress:$,...E}},hn(Hy,Sr,Qd,j8,pi,Vy,fi));function Wj(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=yx(e,t,n,r[0].index),i=yx(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function yx(e,t,n,r){const o=T8(e.width,n.width,t.column),s=ih(r/o),i=s*n.height+Vu(0,s-1)*t.row;return i>0?i+t.row:i}function T8(e,t,n){return Vu(1,ih((e+n)/(ih(t)+n)))}const eoe=qt(()=>{const e=Ve(p=>`Item ${p}`),t=Ve({}),n=Ve(null),r=Ve("virtuoso-grid-item"),o=Ve("virtuoso-grid-list"),s=Ve(R8),i=Ve("div"),l=Ve(Uc),u=(p,m=null)=>yr(Pe(t,Xe(h=>h[p]),pn()),m);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:l,FooterComponent:u("Footer"),HeaderComponent:u("Header"),ListComponent:u("List","div"),ItemComponent:u("Item","div"),ScrollerComponent:u("Scroller","div"),ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),toe=qt(([e,t])=>({...e,...t}),hn(Jre,eoe)),noe=H.memo(function(){const t=yn("gridState"),n=yn("listClassName"),r=yn("itemClassName"),o=yn("itemContent"),s=yn("computeItemKey"),i=yn("isSeeking"),l=qo("scrollHeight"),u=yn("ItemComponent"),p=yn("ListComponent"),m=yn("ScrollSeekPlaceholder"),h=yn("context"),g=qo("itemDimensions"),x=qo("gap"),y=yn("log"),b=yn("stateRestoreInProgress"),w=ll(S=>{const j=S.parentElement.parentElement.scrollHeight;l(j);const _=S.firstChild;if(_){const{width:E,height:I}=_.getBoundingClientRect();g({width:E,height:I})}x({row:Uj("row-gap",getComputedStyle(S).rowGap,y),column:Uj("column-gap",getComputedStyle(S).columnGap,y)})});return b?null:H.createElement(p,{ref:w,className:n,...Rr(p,h),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(S=>{const j=s(S.index,S.data,h);return i?H.createElement(m,{key:j,...Rr(m,h),index:S.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(u,{...Rr(u,h),className:r,"data-index":S.index,key:j},o(S.index,S.data,h))}))}),roe=H.memo(function(){const t=yn("HeaderComponent"),n=qo("headerHeight"),r=yn("headerFooterTag"),o=ll(i=>n(ri(i,"height"))),s=yn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),ooe=H.memo(function(){const t=yn("FooterComponent"),n=qo("footerHeight"),r=yn("headerFooterTag"),o=ll(i=>n(ri(i,"height"))),s=yn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Rr(t,s))):null}),soe=({children:e})=>{const t=H.useContext(O8),n=qo("itemDimensions"),r=qo("viewportDimensions"),o=ll(s=>{r(s.getBoundingClientRect())});return H.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),H.createElement("div",{style:wg,ref:o},e)},aoe=({children:e})=>{const t=H.useContext(O8),n=qo("windowViewportRect"),r=qo("itemDimensions"),o=yn("customScrollParent"),s=E8(n,o);return H.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),H.createElement("div",{ref:s,style:wg},e)},ioe=H.memo(function({...t}){const n=yn("useWindowScroll"),r=yn("customScrollParent"),o=r||n?uoe:coe,s=r||n?aoe:soe;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(roe,null),H.createElement(noe,null),H.createElement(ooe,null)))}),{Component:loe,usePublisher:qo,useEmitterValue:yn,useEmitter:N8}=d8(toe,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},ioe),coe=D8({usePublisher:qo,useEmitterValue:yn,useEmitter:N8}),uoe=A8({usePublisher:qo,useEmitterValue:yn,useEmitter:N8});function Uj(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,eo.WARN),t==="normal"?0:parseInt(t??"0",10)}const doe=loe,foe=e=>{const t=W(s=>s.gallery.galleryView),{data:n}=Vx(e),{data:r}=Wx(e),o=d.useMemo(()=>t==="images"?n==null?void 0:n.total:r==null?void 0:r.total,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}},poe=({imageDTO:e})=>a.jsx(L,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:a.jsxs(Ds,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]})}),moe=d.memo(poe),Uy=({postUploadAction:e,isDisabled:t})=>{const n=W(u=>u.gallery.autoAddBoardId),[r]=rI(),o=d.useCallback(u=>{const p=u[0];p&&r({file:p,image_category:"user",is_intermediate:!1,postUploadAction:e??{type:"TOAST"},board_id:n==="none"?void 0:n})},[n,e,r]),{getRootProps:s,getInputProps:i,open:l}=Zb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:i,openUploader:l}},hoe=le(xe,({generation:e})=>{const{model:t}=e;return{model:t}}),Sg=()=>{const e=te(),t=sl(),{t:n}=Z(),{model:r}=W(hoe),o=d.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),s=d.useCallback(N=>{t({title:n("toast.parameterNotSet"),description:N,status:"warning",duration:2500,isClosable:!0})},[n,t]),i=d.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),l=d.useCallback(N=>{t({title:n("toast.parametersNotSet"),status:"warning",description:N,duration:2500,isClosable:!0})},[n,t]),u=d.useCallback((N,$,q,F)=>{if(qf(N)||Xf($)||bu(q)||Q0(F)){qf(N)&&e(Nu(N)),Xf($)&&e($u($)),bu(q)&&e(Lu(q)),bu(F)&&e(zu(F)),o();return}s()},[e,o,s]),p=d.useCallback(N=>{if(!qf(N)){s();return}e(Nu(N)),o()},[e,o,s]),m=d.useCallback(N=>{if(!Xf(N)){s();return}e($u(N)),o()},[e,o,s]),h=d.useCallback(N=>{if(!bu(N)){s();return}e(Lu(N)),o()},[e,o,s]),g=d.useCallback(N=>{if(!Q0(N)){s();return}e(zu(N)),o()},[e,o,s]),x=d.useCallback(N=>{if(!iw(N)){s();return}e(Xp(N)),o()},[e,o,s]),y=d.useCallback(N=>{if(!Y0(N)){s();return}e(Qp(N)),o()},[e,o,s]),b=d.useCallback(N=>{if(!lw(N)){s();return}e(i1(N)),o()},[e,o,s]),w=d.useCallback(N=>{if(!Z0(N)){s();return}e(l1(N)),o()},[e,o,s]),S=d.useCallback(N=>{if(!J0(N)){s();return}e(Yp(N)),o()},[e,o,s]),j=d.useCallback(N=>{if(!cw(N)){s();return}e(Hi(N)),o()},[e,o,s]),_=d.useCallback(N=>{if(!uw(N)){s();return}e(Vi(N)),o()},[e,o,s]),E=d.useCallback(N=>{if(!dw(N)){s();return}e(Zp(N)),o()},[e,o,s]),{loras:I}=Cd(void 0,{selectFromResult:N=>({loras:N.data?PD.getSelectors().selectAll(N.data):[]})}),M=d.useCallback(N=>{if(!dI(N.lora))return{lora:null,error:"Invalid LoRA model"};const{base_model:$,model_name:q}=N.lora,F=I.find(Y=>Y.base_model===$&&Y.model_name===q);return F?(F==null?void 0:F.base_model)===(r==null?void 0:r.base_model)?{lora:F,error:null}:{lora:null,error:"LoRA incompatible with currently-selected model"}:{lora:null,error:"LoRA model is not installed"}},[I,r==null?void 0:r.base_model]),R=d.useCallback(N=>{const $=M(N);if(!$.lora){s($.error);return}e(fw({...$.lora,weight:N.weight})),o()},[M,e,o,s]),{controlnets:D}=gh(void 0,{selectFromResult:N=>({controlnets:N.data?ED.getSelectors().selectAll(N.data):[]})}),A=d.useCallback(N=>{if(!c1(N.control_model))return{controlnet:null,error:"Invalid ControlNet model"};const{image:$,control_model:q,control_weight:F,begin_step_percent:Q,end_step_percent:Y,control_mode:se,resize_mode:ae}=N,re=D.find(ie=>ie.base_model===q.base_model&&ie.model_name===q.model_name);if(!re)return{controlnet:null,error:"ControlNet model is not installed"};if(!((re==null?void 0:re.base_model)===(r==null?void 0:r.base_model)))return{controlnet:null,error:"ControlNet incompatible with currently-selected model"};const K=Zs();let ee=Ta.processorType;for(const ie in pw)if(re.model_name.includes(ie)){ee=pw[ie]||Ta.processorType;break}const ce=Fr[ee].default;return{controlnet:{isEnabled:!0,model:re,weight:typeof F=="number"?F:Ta.weight,beginStepPct:Q||Ta.beginStepPct,endStepPct:Y||Ta.endStepPct,controlMode:se||Ta.controlMode,resizeMode:ae||Ta.resizeMode,controlImage:($==null?void 0:$.image_name)||null,processedControlImage:($==null?void 0:$.image_name)||null,processorType:ee,processorNode:ce.type!=="none"?ce:Ta.processorNode,shouldAutoConfig:!0,controlNetId:K},error:null}},[D,r==null?void 0:r.base_model]),O=d.useCallback(N=>{const $=A(N);if(!$.controlnet){s($.error);return}e(mw({...$.controlnet})),o()},[A,e,o,s]),{ipAdapters:T}=Ux(void 0,{selectFromResult:N=>({ipAdapters:N.data?MD.getSelectors().selectAll(N.data):[]})}),X=d.useCallback(N=>{if(!OD(N==null?void 0:N.ip_adapter_model))return{ipAdapter:null,error:"Invalid IP Adapter model"};const{image:$,ip_adapter_model:q,weight:F,begin_step_percent:Q,end_step_percent:Y}=N,se=T.find(G=>G.base_model===(q==null?void 0:q.base_model)&&G.model_name===(q==null?void 0:q.model_name));return se?(se==null?void 0:se.base_model)===(r==null?void 0:r.base_model)?{ipAdapter:{adapterImage:($==null?void 0:$.image_name)??null,model:se,weight:F??ev.weight,beginStepPct:Q??ev.beginStepPct,endStepPct:Y??ev.endStepPct},error:null}:{ipAdapter:null,error:"IP Adapter incompatible with currently-selected model"}:{ipAdapter:null,error:"IP Adapter model is not installed"}},[T,r==null?void 0:r.base_model]),B=d.useCallback(N=>{const $=X(N);if(!$.ipAdapter){s($.error);return}e(hw({...$.ipAdapter})),e(u1(!0)),o()},[X,e,o,s]),V=d.useCallback(N=>{e(vh(N))},[e]),U=d.useCallback(N=>{if(!N){l();return}const{cfg_scale:$,height:q,model:F,positive_prompt:Q,negative_prompt:Y,scheduler:se,seed:ae,steps:re,width:G,strength:K,positive_style_prompt:ee,negative_style_prompt:ce,refiner_model:J,refiner_cfg_scale:ie,refiner_steps:de,refiner_scheduler:ge,refiner_positive_aesthetic_score:Ce,refiner_negative_aesthetic_score:he,refiner_start:fe,loras:Oe,controlnets:_e,ipAdapters:Ne}=N;Y0($)&&e(Qp($)),lw(F)&&e(i1(F)),qf(Q)&&e(Nu(Q)),Xf(Y)&&e($u(Y)),Z0(se)&&e(l1(se)),iw(ae)&&e(Xp(ae)),J0(re)&&e(Yp(re)),cw(G)&&e(Hi(G)),uw(q)&&e(Vi(q)),dw(K)&&e(Zp(K)),bu(ee)&&e(Lu(ee)),Q0(ce)&&e(zu(ce)),RD(J)&&e(fI(J)),J0(de)&&e(d1(de)),Y0(ie)&&e(f1(ie)),Z0(ge)&&e(pI(ge)),DD(Ce)&&e(p1(Ce)),AD(he)&&e(m1(he)),TD(fe)&&e(h1(fe)),e(ND()),Oe==null||Oe.forEach(nt=>{const $e=M(nt);$e.lora&&e(fw({...$e.lora,weight:nt.weight}))}),e(aI()),_e!=null&&_e.length&&e($D()),_e==null||_e.forEach(nt=>{const $e=A(nt);$e.controlnet&&e(mw($e.controlnet))}),Ne!=null&&Ne.length&&e(u1(!0)),Ne==null||Ne.forEach(nt=>{const $e=X(nt);$e.ipAdapter&&e(hw($e.ipAdapter))}),i()},[l,i,e,M,A,X]);return{recallBothPrompts:u,recallPositivePrompt:p,recallNegativePrompt:m,recallSDXLPositiveStylePrompt:h,recallSDXLNegativeStylePrompt:g,recallSeed:x,recallCfgScale:y,recallModel:b,recallScheduler:w,recallSteps:S,recallWidth:j,recallHeight:_,recallStrength:E,recallLoRA:R,recallControlNet:O,recallIPAdapter:B,recallAllParameters:U,sendToImageToImage:V}},$8=()=>{const e=sl(),{t}=Z(),n=d.useMemo(()=>!!navigator.clipboard&&!!window.ClipboardItem,[]),r=d.useCallback(async o=>{n||e({title:t("toast.problemCopyingImage"),description:"Your browser doesn't support the Clipboard API.",status:"error",duration:2500,isClosable:!0});try{LD((async()=>{const i=await fetch(o);if(!i.ok)throw new Error("Problem retrieving image data");return await i.blob()})()),e({title:t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})}catch(s){e({title:t("toast.problemCopyingImage"),description:String(s),status:"error",duration:2500,isClosable:!0})}},[n,t,e]);return{isClipboardAPIAvailable:n,copyImageToClipboard:r}};function goe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"}}]})(e)}function voe(e){return Te({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 256L28.5 28c2-16 15.6-28 31.8-28H228.9c15 0 27.1 12.1 27.1 27.1c0 3.2-.6 6.5-1.7 9.5L208 160H347.3c20.2 0 36.7 16.4 36.7 36.7c0 7.4-2.2 14.6-6.4 20.7l-192.2 281c-5.9 8.6-15.6 13.7-25.9 13.7h-2.9c-15.7 0-28.5-12.8-28.5-28.5c0-2.3 .3-4.6 .9-6.9L176 288H32c-17.7 0-32-14.3-32-32z"}}]})(e)}function xoe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"}}]})(e)}function Gy(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.4 157.9c35.3-8.3 61.6-40 61.6-77.9c0-44.2-35.8-80-80-80c-43.4 0-78.7 34.5-80 77.5L136.2 151.1C121.7 136.8 101.9 128 80 128c-44.2 0-80 35.8-80 80s35.8 80 80 80c12.2 0 23.8-2.7 34.1-7.6L259.7 407.8c-2.4 7.6-3.7 15.8-3.7 24.2c0 44.2 35.8 80 80 80s80-35.8 80-80c0-27.7-14-52.1-35.4-66.4l37.8-207.7zM156.3 232.2c2.2-6.9 3.5-14.2 3.7-21.7l183.8-73.5c3.6 3.5 7.4 6.7 11.6 9.5L317.6 354.1c-5.5 1.3-10.8 3.1-15.8 5.5L156.3 232.2z"}}]})(e)}function boe(e){return Te({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"}}]})(e)}function yoe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24H280c13.3 0 24-10.7 24-24s-10.7-24-24-24H136z"}}]})(e)}function Coe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM184 296c0 13.3 10.7 24 24 24s24-10.7 24-24V232h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H232V120c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"}}]})(e)}function woe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M17 16l-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5h-4z"}}]})(e)}function Soe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"}}]})(e)}function koe(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function Ky(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}}]})(e)}function qy(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}]})(e)}function L8(e){return Te({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"}}]})(e)}const Xy=e=>e.config;Gx("gallery/requestedBoardImagesDeletion");const joe=Gx("gallery/sentImageToCanvas"),z8=Gx("gallery/sentImageToImg2Img"),_oe=e=>{const{imageDTO:t}=e,n=te(),{t:r}=Z(),o=sl(),s=Ht("unifiedCanvas").isFeatureEnabled,{shouldFetchMetadataFromApi:i}=W(Xy),l=Jh(Kx),{metadata:u,workflow:p,isLoading:m}=qx({image:t,shouldFetchMetadataFromApi:i},{selectFromResult:B=>{var V,U;return{isLoading:B.isFetching,metadata:(V=B==null?void 0:B.currentData)==null?void 0:V.metadata,workflow:(U=B==null?void 0:B.currentData)==null?void 0:U.workflow}}}),[h]=Xx(),[g]=Qx(),{isClipboardAPIAvailable:x,copyImageToClipboard:y}=$8(),b=d.useCallback(()=>{t&&n(xh([t]))},[n,t]),{recallBothPrompts:w,recallSeed:S,recallAllParameters:j}=Sg(),_=d.useCallback(()=>{w(u==null?void 0:u.positive_prompt,u==null?void 0:u.negative_prompt,u==null?void 0:u.positive_style_prompt,u==null?void 0:u.negative_style_prompt)},[u==null?void 0:u.negative_prompt,u==null?void 0:u.positive_prompt,u==null?void 0:u.positive_style_prompt,u==null?void 0:u.negative_style_prompt,w]),E=d.useCallback(()=>{S(u==null?void 0:u.seed)},[u==null?void 0:u.seed,S]),I=d.useCallback(()=>{p&&n(Yx(p))},[n,p]),M=d.useCallback(()=>{n(z8()),n(vh(t))},[n,t]),R=d.useCallback(()=>{n(joe()),qr.flushSync(()=>{n(Xs("unifiedCanvas"))}),n(mI(t)),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),D=d.useCallback(()=>{j(u)},[u,j]),A=d.useCallback(()=>{n(hI([t])),n(Bx(!0))},[n,t]),O=d.useCallback(()=>{y(t.image_url)},[y,t.image_url]),T=d.useCallback(()=>{t&&h({imageDTOs:[t]})},[h,t]),X=d.useCallback(()=>{t&&g({imageDTOs:[t]})},[g,t]);return a.jsxs(a.Fragment,{children:[a.jsx(en,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx(hy,{}),children:r("common.openInNewTab")}),x&&a.jsx(en,{icon:a.jsx(Hc,{}),onClickCapture:O,children:r("parameters.copyImage")}),a.jsx(en,{as:"a",download:!0,href:t.image_url,target:"_blank",icon:a.jsx(ig,{}),w:"100%",children:r("parameters.downloadImage")}),a.jsx(en,{icon:m?a.jsx(Mp,{}):a.jsx(Gy,{}),onClickCapture:I,isDisabled:m||!p,children:r("nodes.loadWorkflow")}),a.jsx(en,{icon:m?a.jsx(Mp,{}):a.jsx(hM,{}),onClickCapture:_,isDisabled:m||(u==null?void 0:u.positive_prompt)===void 0&&(u==null?void 0:u.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(en,{icon:m?a.jsx(Mp,{}):a.jsx(gM,{}),onClickCapture:E,isDisabled:m||(u==null?void 0:u.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(en,{icon:m?a.jsx(Mp,{}):a.jsx(sM,{}),onClickCapture:D,isDisabled:m||!u,children:r("parameters.useAll")}),a.jsx(en,{icon:a.jsx(Xk,{}),onClickCapture:M,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(en,{icon:a.jsx(Xk,{}),onClickCapture:R,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(en,{icon:a.jsx(uM,{}),onClickCapture:A,children:"Change Board"}),t.starred?a.jsx(en,{icon:l?l.off.icon:a.jsx(qy,{}),onClickCapture:X,children:l?l.off.text:"Unstar Image"}):a.jsx(en,{icon:l?l.on.icon:a.jsx(Ky,{}),onClickCapture:T,children:l?l.on.text:"Star Image"}),a.jsx(en,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Br,{}),onClickCapture:b,children:r("gallery.deleteImage")})]})},F8=d.memo(_oe),Mp=()=>a.jsx(L,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(fa,{size:"xs"})}),Ioe=()=>{const e=te(),t=W(h=>h.gallery.selection),n=Jh(Kx),[r]=Xx(),[o]=Qx(),s=d.useCallback(()=>{e(hI(t)),e(Bx(!0))},[e,t]),i=d.useCallback(()=>{e(xh(t))},[e,t]),l=d.useCallback(()=>{r({imageDTOs:t})},[r,t]),u=d.useCallback(()=>{o({imageDTOs:t})},[o,t]),p=d.useMemo(()=>t.every(h=>h.starred),[t]),m=d.useMemo(()=>t.every(h=>!h.starred),[t]);return a.jsxs(a.Fragment,{children:[p&&a.jsx(en,{icon:n?n.on.icon:a.jsx(Ky,{}),onClickCapture:u,children:n?n.off.text:"Unstar All"}),(m||!p&&!m)&&a.jsx(en,{icon:n?n.on.icon:a.jsx(qy,{}),onClickCapture:l,children:n?n.on.text:"Star All"}),a.jsx(en,{icon:a.jsx(uM,{}),onClickCapture:s,children:"Change Board"}),a.jsx(en,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Br,{}),onClickCapture:i,children:"Delete Selection"})]})},Poe=d.memo(Ioe),Eoe=le([xe],({gallery:e})=>({selectionCount:e.selection.length}),Se),Moe=({imageDTO:e,children:t})=>{const{selectionCount:n}=W(Eoe),r=d.useCallback(o=>{o.preventDefault()},[]);return a.jsx(Ay,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>e?n>1?a.jsx(Gi,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:r,children:a.jsx(Poe,{})}):a.jsx(Gi,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:r,children:a.jsx(F8,{imageDTO:e})}):null,children:t})},Ooe=d.memo(Moe),Roe=e=>{const{data:t,disabled:n,...r}=e,o=d.useRef(Zs()),{attributes:s,listeners:i,setNodeRef:l}=lne({id:o.current,disabled:n,data:t});return a.jsx(Ie,{ref:l,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...i,...r})},Doe=d.memo(Roe),Aoe=a.jsx(Nn,{as:cg,sx:{boxSize:16}}),Toe=a.jsx(Zn,{icon:Yi}),Noe=e=>{const{imageDTO:t,onError:n,onClick:r,withMetadataOverlay:o=!1,isDropDisabled:s=!1,isDragDisabled:i=!1,isUploadDisabled:l=!1,minSize:u=24,postUploadAction:p,imageSx:m,fitContainer:h=!1,droppableData:g,draggableData:x,dropLabel:y,isSelected:b=!1,thumbnail:w=!1,noContentFallback:S=Toe,uploadElement:j=Aoe,useThumbailFallback:_,withHoverOverlay:E=!1,children:I,onMouseOver:M,onMouseOut:R,dataTestId:D}=e,{colorMode:A}=ha(),[O,T]=d.useState(!1),X=d.useCallback($=>{M&&M($),T(!0)},[M]),B=d.useCallback($=>{R&&R($),T(!1)},[R]),{getUploadButtonProps:V,getUploadInputProps:U}=Uy({postUploadAction:p,isDisabled:l}),N=l?{}:{cursor:"pointer",bg:Ae("base.200","base.700")(A),_hover:{bg:Ae("base.300","base.650")(A),color:Ae("base.500","base.300")(A)}};return a.jsx(Ooe,{imageDTO:t,children:$=>a.jsxs(L,{ref:$,onMouseOver:X,onMouseOut:B,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:u||void 0,minH:u||void 0,userSelect:"none",cursor:i||!t?"default":"pointer"},children:[t&&a.jsxs(L,{sx:{w:"full",h:"full",position:h?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(ga,{src:w?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:_?t.thumbnail_url:void 0,fallback:_?void 0:a.jsx($ne,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...m},"data-testid":D}),o&&a.jsx(moe,{imageDTO:t}),a.jsx(Dy,{isSelected:b,isHovered:E?O:!1})]}),!t&&!l&&a.jsx(a.Fragment,{children:a.jsxs(L,{sx:{minH:u,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Ae("base.500","base.500")(A),...N},...V(),children:[a.jsx("input",{...U()}),j]})}),!t&&l&&S,t&&!i&&a.jsx(Doe,{data:x,disabled:i||!t,onClick:r}),I,!s&&a.jsx(Ry,{data:g,disabled:s,dropLabel:y})]})})},ua=d.memo(Noe),$oe=()=>a.jsx(Gh,{sx:{position:"relative",height:"full",width:"full","::before":{content:"''",display:"block",pt:"100%"}},children:a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,height:"full",width:"full"}})}),Loe=d.memo($oe),zoe=le([xe,Zx],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},Se),Foe=e=>{const t=te(),{queryArgs:n,selection:r}=W(zoe),{imageDTOs:o}=gI(n,{selectFromResult:p=>({imageDTOs:p.data?zD.selectAll(p.data):[]})}),s=Ht("multiselect").isFeatureEnabled,i=d.useCallback(p=>{var m;if(e){if(!s){t(yu([e]));return}if(p.shiftKey){const h=e.image_name,g=(m=r[r.length-1])==null?void 0:m.image_name,x=o.findIndex(b=>b.image_name===g),y=o.findIndex(b=>b.image_name===h);if(x>-1&&y>-1){const b=Math.min(x,y),w=Math.max(x,y),S=o.slice(b,w+1);t(yu(r.concat(S)))}}else p.ctrlKey||p.metaKey?r.some(h=>h.image_name===e.image_name)&&r.length>1?t(yu(r.filter(h=>h.image_name!==e.image_name))):t(yu(r.concat(e))):t(yu([e]))}},[t,e,o,r,s]),l=d.useMemo(()=>e?r.some(p=>p.image_name===e.image_name):!1,[e,r]),u=d.useMemo(()=>r.length,[r.length]);return{selection:r,selectionCount:u,isSelected:l,handleClick:i}},Boe=e=>{const{onClick:t,tooltip:n,icon:r,styleOverrides:o}=e,s=sa("drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-600))","drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))");return a.jsx(Fe,{onClick:t,"aria-label":n,tooltip:n,icon:r,size:"sm",variant:"link",sx:{position:"absolute",top:1,insetInlineEnd:1,p:0,minW:0,svg:{transitionProperty:"common",transitionDuration:"normal",fill:"base.100",_hover:{fill:"base.50"},filter:s},...o},"data-testid":n})},zi=d.memo(Boe),Hoe=e=>{const t=te(),{imageName:n}=e,{currentData:r}=to(n),o=W(M=>M.hotkeys.shift),{t:s}=Z(),{handleClick:i,isSelected:l,selection:u,selectionCount:p}=Foe(r),m=Jh(Kx),h=d.useCallback(M=>{M.stopPropagation(),r&&t(xh([r]))},[t,r]),g=d.useMemo(()=>{if(p>1)return{id:"gallery-image",payloadType:"IMAGE_DTOS",payload:{imageDTOs:u}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,u,p]),[x]=Xx(),[y]=Qx(),b=d.useCallback(()=>{r&&(r.starred&&y({imageDTOs:[r]}),r.starred||x({imageDTOs:[r]}))},[x,y,r]),[w,S]=d.useState(!1),j=d.useCallback(()=>{S(!0)},[]),_=d.useCallback(()=>{S(!1)},[]),E=d.useMemo(()=>{if(r!=null&&r.starred)return m?m.on.icon:a.jsx(qy,{size:"20"});if(!(r!=null&&r.starred)&&w)return m?m.off.icon:a.jsx(Ky,{size:"20"})},[r==null?void 0:r.starred,w,m]),I=d.useMemo(()=>r!=null&&r.starred?m?m.off.text:"Unstar":r!=null&&r.starred?"":m?m.on.text:"Star",[r==null?void 0:r.starred,m]);return r?a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none"},"data-testid":`image-${r.image_name}`,children:a.jsx(L,{userSelect:"none",sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(ua,{onClick:i,imageDTO:r,draggableData:g,isSelected:l,minSize:0,imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0,withHoverOverlay:!0,onMouseOver:j,onMouseOut:_,children:a.jsxs(a.Fragment,{children:[a.jsx(zi,{onClick:b,icon:E,tooltip:I}),w&&o&&a.jsx(zi,{onClick:h,icon:a.jsx(Br,{}),tooltip:s("gallery.deleteImage"),styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx(Loe,{})},Voe=d.memo(Hoe),Woe=je((e,t)=>a.jsx(Ie,{className:"item-container",ref:t,p:1.5,"data-testid":"image-item-container",children:e.children})),Uoe=d.memo(Woe),Goe=je((e,t)=>{const n=W(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(Ja,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},"data-testid":"image-list-container",children:e.children})}),Koe=d.memo(Goe),qoe={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},Xoe=()=>{const{t:e}=Z(),t=d.useRef(null),[n,r]=d.useState(null),[o,s]=Oy(qoe),i=W(w=>w.gallery.selectedBoardId),{currentViewTotal:l}=foe(i),u=W(Zx),{currentData:p,isFetching:m,isSuccess:h,isError:g}=gI(u),[x]=vI(),y=d.useMemo(()=>!p||!l?!1:p.ids.length<l,[p,l]),b=d.useCallback(()=>{y&&x({...u,offset:(p==null?void 0:p.ids.length)??0,limit:xI})},[y,x,u,p==null?void 0:p.ids.length]);return d.useEffect(()=>{const{current:w}=t;return n&&w&&o({target:w,elements:{viewport:n}}),()=>{var S;return(S=s())==null?void 0:S.destroy()}},[n,o,s]),p?h&&(p==null?void 0:p.ids.length)===0?a.jsx(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Zn,{label:e("gallery.noImagesInGallery"),icon:Yi})}):h&&p?a.jsxs(a.Fragment,{children:[a.jsx(Ie,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(doe,{style:{height:"100%"},data:p.ids,endReached:b,components:{Item:Uoe,List:Koe},scrollerRef:r,itemContent:(w,S)=>a.jsx(Voe,{imageName:S},S)})}),a.jsx(at,{onClick:b,isDisabled:!y,isLoading:m,loadingText:e("gallery.loading"),flexShrink:0,children:`Load More (${p.ids.length} of ${l})`})]}):g?a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsx(Zn,{label:e("gallery.unableToLoad"),icon:$J})}):null:a.jsx(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Zn,{label:e("gallery.loading"),icon:Yi})})},Qoe=d.memo(Xoe),Yoe=le([xe],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},Se),Zoe=()=>{const e=d.useRef(null),t=d.useRef(null),{galleryView:n}=W(Yoe),r=te(),{isOpen:o,onToggle:s}=Lr({defaultIsOpen:!0}),i=d.useCallback(()=>{r(gw("images"))},[r]),l=d.useCallback(()=>{r(gw("assets"))},[r]);return a.jsxs(p3,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Ie,{sx:{w:"full"},children:[a.jsxs(L,{ref:e,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx(Ine,{isOpen:o,onToggle:s}),a.jsx(Nne,{})]}),a.jsx(Ie,{children:a.jsx(kne,{isOpen:o})})]}),a.jsxs(L,{ref:t,direction:"column",gap:2,h:"full",w:"full",children:[a.jsx(L,{sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:a.jsx(rl,{index:n==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(ol,{children:a.jsxs(Vt,{isAttached:!0,sx:{w:"full"},children:[a.jsx(Tr,{as:at,size:"sm",isChecked:n==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(UJ,{}),"data-testid":"images-tab",children:"Images"}),a.jsx(Tr,{as:at,size:"sm",isChecked:n==="assets",onClick:l,sx:{w:"full"},leftIcon:a.jsx(ree,{}),"data-testid":"assets-tab",children:"Assets"})]})})})}),a.jsx(Qoe,{})]})]})},Joe=d.memo(Zoe),ese=()=>{const e=W(p=>p.system.isConnected),{data:t}=va(),[n,{isLoading:r}]=Jx(),o=te(),{t:s}=Z(),i=d.useMemo(()=>t==null?void 0:t.queue.item_id,[t==null?void 0:t.queue.item_id]),l=d.useCallback(async()=>{if(i)try{await n(i).unwrap(),o(ct({title:s("queue.cancelSucceeded"),status:"success"}))}catch{o(ct({title:s("queue.cancelFailed"),status:"error"}))}},[i,o,s,n]),u=d.useMemo(()=>!e||e$(i),[e,i]);return{cancelQueueItem:l,isLoading:r,currentQueueItemId:i,isDisabled:u}},tse=({label:e,tooltip:t,icon:n,onClick:r,isDisabled:o,colorScheme:s,asIconButton:i,isLoading:l,loadingText:u,sx:p})=>i?a.jsx(Fe,{"aria-label":e,tooltip:t,icon:n,onClick:r,isDisabled:o,colorScheme:s,isLoading:l,sx:p,"data-testid":e}):a.jsx(at,{"aria-label":e,tooltip:t,leftIcon:n,onClick:r,isDisabled:o,colorScheme:s,isLoading:l,loadingText:u??e,flexGrow:1,sx:p,"data-testid":e,children:e}),ul=d.memo(tse),nse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{cancelQueueItem:r,isLoading:o,isDisabled:s}=ese();return a.jsx(ul,{isDisabled:s,isLoading:o,asIconButton:e,label:n("queue.cancel"),tooltip:n("queue.cancelTooltip"),icon:a.jsx(Ic,{}),onClick:r,colorScheme:"error",sx:t})},B8=d.memo(nse),rse=()=>{const{t:e}=Z(),t=te(),{data:n}=va(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=bI({fixedCacheKey:"clearQueue"}),i=d.useCallback(async()=>{if(n!=null&&n.queue.total)try{await o().unwrap(),t(ct({title:e("queue.clearSucceeded"),status:"success"})),t(eb(void 0)),t(tb(void 0))}catch{t(ct({title:e("queue.clearFailed"),status:"error"}))}},[n==null?void 0:n.queue.total,o,t,e]),l=d.useMemo(()=>!r||!(n!=null&&n.queue.total),[r,n==null?void 0:n.queue.total]);return{clearQueue:i,isLoading:s,queueStatus:n,isDisabled:l}},ose=je((e,t)=>{const{t:n}=Z(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:i,children:l,title:u,triggerComponent:p}=e,{isOpen:m,onOpen:h,onClose:g}=Lr(),x=d.useRef(null),y=()=>{o(),g()},b=()=>{i&&i(),g()};return a.jsxs(a.Fragment,{children:[d.cloneElement(p,{onClick:h,ref:t}),a.jsx(Td,{isOpen:m,leastDestructiveRef:x,onClose:g,isCentered:!0,children:a.jsx(Yo,{children:a.jsxs(Nd,{children:[a.jsx(Qo,{fontSize:"lg",fontWeight:"bold",children:u}),a.jsx(Zo,{children:l}),a.jsxs(Ss,{children:[a.jsx(at,{ref:x,onClick:b,children:s}),a.jsx(at,{colorScheme:"error",onClick:y,ml:3,children:r})]})]})})})]})}),kg=d.memo(ose),sse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{clearQueue:r,isLoading:o,isDisabled:s}=rse();return a.jsxs(kg,{title:n("queue.clearTooltip"),acceptCallback:r,acceptButtonText:n("queue.clear"),triggerComponent:a.jsx(ul,{isDisabled:s,isLoading:o,asIconButton:e,label:n("queue.clear"),tooltip:n("queue.clearTooltip"),icon:a.jsx(Br,{}),colorScheme:"error",sx:t}),children:[a.jsx(ve,{children:n("queue.clearQueueAlertDialog")}),a.jsx("br",{}),a.jsx(ve,{children:n("queue.clearQueueAlertDialog2")})]})},Qy=d.memo(sse),ase=()=>{const e=te(),{t}=Z(),n=W(p=>p.system.isConnected),{data:r}=va(),[o,{isLoading:s}]=yI({fixedCacheKey:"pauseProcessor"}),i=d.useMemo(()=>!!(r!=null&&r.processor.is_started),[r==null?void 0:r.processor.is_started]),l=d.useCallback(async()=>{if(i)try{await o().unwrap(),e(ct({title:t("queue.pauseSucceeded"),status:"success"}))}catch{e(ct({title:t("queue.pauseFailed"),status:"error"}))}},[i,o,e,t]),u=d.useMemo(()=>!n||!i,[n,i]);return{pauseProcessor:l,isLoading:s,isStarted:i,isDisabled:u}},ise=({asIconButton:e})=>{const{t}=Z(),{pauseProcessor:n,isLoading:r,isDisabled:o}=ase();return a.jsx(ul,{asIconButton:e,label:t("queue.pause"),tooltip:t("queue.pauseTooltip"),isDisabled:o,isLoading:r,icon:a.jsx(YJ,{}),onClick:n,colorScheme:"gold"})},H8=d.memo(ise),lse=le([xe,Jn],({controlNet:e,generation:t,system:n,nodes:r,dynamicPrompts:o},s)=>{const{initialImage:i,model:l}=t,{isConnected:u}=n,p=[];return u||p.push(yt.t("parameters.invoke.systemDisconnected")),s==="img2img"&&!i&&p.push(yt.t("parameters.invoke.noInitialImageSelected")),s==="nodes"?r.shouldValidateGraph&&(r.nodes.length||p.push(yt.t("parameters.invoke.noNodesInGraph")),r.nodes.forEach(m=>{if(!On(m))return;const h=r.nodeTemplates[m.data.type];if(!h){p.push(yt.t("parameters.invoke.missingNodeTemplate"));return}const g=FD([m],r.edges);Rn(m.data.inputs,x=>{const y=h.inputs[x.name],b=g.some(w=>w.target===m.id&&w.targetHandle===x.name);if(!y){p.push(yt.t("parameters.invoke.missingFieldTemplate"));return}if(y.required&&x.value===void 0&&!b){p.push(yt.t("parameters.invoke.missingInputForField",{nodeLabel:m.data.label||h.title,fieldLabel:x.label||y.title}));return}})})):(o.prompts.length===0&&p.push(yt.t("parameters.invoke.noPrompts")),l||p.push(yt.t("parameters.invoke.noModelSelected")),e.isEnabled&&nr(e.controlNets).forEach((m,h)=>{m.isEnabled&&(m.model||p.push(yt.t("parameters.invoke.noModelForControlNet",{index:h+1})),(!m.controlImage||!m.processedControlImage&&m.processorType!=="none")&&p.push(yt.t("parameters.invoke.noControlImageForControlNet",{index:h+1})))})),{isReady:!p.length,reasons:p}},Se),Yy=()=>{const{isReady:e,reasons:t}=W(lse);return{isReady:e,reasons:t}},V8=()=>{const e=te(),t=W(Jn),{isReady:n}=Yy(),[r,{isLoading:o}]=bh({fixedCacheKey:"enqueueBatch"}),s=d.useMemo(()=>!n,[n]);return{queueBack:d.useCallback(()=>{s||(e(nb()),e(CI({tabName:t,prepend:!1})))},[e,s,t]),isLoading:o,isDisabled:s}},cse=le([xe],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},Se),use=({prepend:e=!1})=>{const{t}=Z(),{isReady:n,reasons:r}=Yy(),{autoAddBoardId:o}=W(cse),s=vg(o),[i,{isLoading:l}]=bh({fixedCacheKey:"enqueueBatch"}),u=d.useMemo(()=>t(l?"queue.enqueueing":n?e?"queue.queueFront":"queue.queueBack":"queue.notReady"),[l,n,e,t]);return a.jsxs(L,{flexDir:"column",gap:1,children:[a.jsx(ve,{fontWeight:600,children:u}),r.length>0&&a.jsx(Od,{children:r.map((p,m)=>a.jsx(Qr,{children:a.jsx(ve,{fontWeight:400,children:p})},`${p}.${m}`))}),a.jsx(U8,{}),a.jsxs(ve,{fontWeight:400,fontStyle:"oblique 10deg",children:["Adding images to"," ",a.jsx(ve,{as:"span",fontWeight:600,children:s||"Uncategorized"})]})]})},W8=d.memo(use),U8=d.memo(()=>a.jsx(Yn,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}));U8.displayName="StyledDivider";const dse=()=>a.jsx(Ie,{pos:"relative",w:4,h:4,children:a.jsx(ga,{src:Hx,alt:"invoke-ai-logo",pos:"absolute",top:-.5,insetInlineStart:-.5,w:5,h:5,minW:5,minH:5,filter:"saturate(0)"})}),fse=d.memo(dse),pse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{queueBack:r,isLoading:o,isDisabled:s}=V8();return a.jsx(ul,{asIconButton:e,colorScheme:"accent",label:n("parameters.invoke.invoke"),isDisabled:s,isLoading:o,onClick:r,tooltip:a.jsx(W8,{}),sx:t,icon:e?a.jsx(fse,{}):void 0})},G8=d.memo(pse),K8=()=>{const e=te(),t=W(Jn),{isReady:n}=Yy(),[r,{isLoading:o}]=bh({fixedCacheKey:"enqueueBatch"}),s=Ht("prependQueue").isFeatureEnabled,i=d.useMemo(()=>!n||!s,[n,s]);return{queueFront:d.useCallback(()=>{i||(e(nb()),e(CI({tabName:t,prepend:!0})))},[e,i,t]),isLoading:o,isDisabled:i}},mse=({asIconButton:e,sx:t})=>{const{t:n}=Z(),{queueFront:r,isLoading:o,isDisabled:s}=K8();return a.jsx(ul,{asIconButton:e,colorScheme:"base",label:n("queue.queueFront"),isDisabled:s,isLoading:o,onClick:r,tooltip:a.jsx(W8,{prepend:!0}),icon:a.jsx(voe,{}),sx:t})},hse=d.memo(mse),gse=()=>{const e=te(),t=W(p=>p.system.isConnected),{data:n}=va(),{t:r}=Z(),[o,{isLoading:s}]=wI({fixedCacheKey:"resumeProcessor"}),i=d.useMemo(()=>!!(n!=null&&n.processor.is_started),[n==null?void 0:n.processor.is_started]),l=d.useCallback(async()=>{if(!i)try{await o().unwrap(),e(ct({title:r("queue.resumeSucceeded"),status:"success"}))}catch{e(ct({title:r("queue.resumeFailed"),status:"error"}))}},[i,o,e,r]),u=d.useMemo(()=>!t||i,[t,i]);return{resumeProcessor:l,isLoading:s,isStarted:i,isDisabled:u}},vse=({asIconButton:e})=>{const{t}=Z(),{resumeProcessor:n,isLoading:r,isDisabled:o}=gse();return a.jsx(ul,{asIconButton:e,label:t("queue.resume"),tooltip:t("queue.resumeTooltip"),isDisabled:o,isLoading:r,icon:a.jsx(ZJ,{}),onClick:n,colorScheme:"green"})},q8=d.memo(vse),xse=le(xe,({system:e})=>{var t;return{isConnected:e.isConnected,hasSteps:!!e.denoiseProgress,value:(((t=e.denoiseProgress)==null?void 0:t.percentage)??0)*100}},Se),bse=()=>{const{t:e}=Z(),{data:t}=va(),{hasSteps:n,value:r,isConnected:o}=W(xse);return a.jsx(G3,{value:r,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:o&&!!(t!=null&&t.queue.in_progress)&&!n,h:"full",w:"full",borderRadius:2,colorScheme:"accent"})},yse=d.memo(bse),Cse=()=>{const e=Ht("pauseQueue").isFeatureEnabled,t=Ht("resumeQueue").isFeatureEnabled,n=Ht("prependQueue").isFeatureEnabled;return a.jsxs(L,{layerStyle:"first",sx:{w:"full",position:"relative",borderRadius:"base",p:2,gap:2,flexDir:"column"},children:[a.jsxs(L,{gap:2,w:"full",children:[a.jsxs(Vt,{isAttached:!0,flexGrow:2,children:[a.jsx(G8,{}),n?a.jsx(hse,{asIconButton:!0}):a.jsx(a.Fragment,{}),a.jsx(B8,{asIconButton:!0})]}),a.jsxs(Vt,{isAttached:!0,children:[t?a.jsx(q8,{asIconButton:!0}):a.jsx(a.Fragment,{}),e?a.jsx(H8,{asIconButton:!0}):a.jsx(a.Fragment,{})]}),a.jsx(Qy,{asIconButton:!0})]}),a.jsx(L,{h:3,w:"full",children:a.jsx(yse,{})}),a.jsx(Q8,{})]})},X8=d.memo(Cse),Q8=d.memo(()=>{const{t:e}=Z(),t=te(),{hasItems:n,pending:r}=va(void 0,{selectFromResult:({data:s})=>{if(!s)return{hasItems:!1,pending:0};const{pending:i,in_progress:l}=s.queue;return{hasItems:i+l>0,pending:i}}}),o=d.useCallback(()=>{t(Xs("queue"))},[t]);return a.jsxs(L,{justifyContent:"space-between",alignItems:"center",pe:1,"data-testid":"queue-count",children:[a.jsx(ba,{}),a.jsx(Za,{onClick:o,size:"sm",variant:"link",fontWeight:400,opacity:.7,fontStyle:"oblique 10deg",children:n?e("queue.queuedCount",{pending:r}):e("queue.queueEmpty")})]})});Q8.displayName="QueueCounts";const{createElement:Ec,createContext:wse,forwardRef:Y8,useCallback:Gs,useContext:Z8,useEffect:oa,useImperativeHandle:J8,useLayoutEffect:Sse,useMemo:kse,useRef:Kr,useState:Wu}=Fx,Gj=Fx["useId".toString()],Uu=Sse,jse=typeof Gj=="function"?Gj:()=>null;let _se=0;function Zy(e=null){const t=jse(),n=Kr(e||t||null);return n.current===null&&(n.current=""+_se++),n.current}const jg=wse(null);jg.displayName="PanelGroupContext";function eO({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:i=null,maxSize:l=null,minSize:u,onCollapse:p=null,onResize:m=null,order:h=null,style:g={},tagName:x="div"}){const y=Z8(jg);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const b=Zy(i),{collapsePanel:w,expandPanel:S,getPanelSize:j,getPanelStyle:_,registerPanel:E,resizePanel:I,units:M,unregisterPanel:R}=y;u==null&&(M==="percentages"?u=10:u=0);const D=Kr({onCollapse:p,onResize:m});oa(()=>{D.current.onCollapse=p,D.current.onResize=m});const A=_(b,o),O=Kr({size:Kj(A)}),T=Kr({callbacksRef:D,collapsedSize:n,collapsible:r,defaultSize:o,id:b,idWasAutoGenerated:i==null,maxSize:l,minSize:u,order:h});return Uu(()=>{O.current.size=Kj(A),T.current.callbacksRef=D,T.current.collapsedSize=n,T.current.collapsible=r,T.current.defaultSize=o,T.current.id=b,T.current.idWasAutoGenerated=i==null,T.current.maxSize=l,T.current.minSize=u,T.current.order=h}),Uu(()=>(E(b,T),()=>{R(b)}),[h,b,E,R]),J8(s,()=>({collapse:()=>w(b),expand:()=>S(b),getCollapsed(){return O.current.size===0},getId(){return b},getSize(X){return j(b,X)},resize:(X,B)=>I(b,X,B)}),[w,S,j,b,I]),Ec(x,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":b,"data-panel-size":parseFloat(""+A.flexGrow).toFixed(1),id:`data-panel-id-${b}`,style:{...A,...g}})}const Qa=Y8((e,t)=>Ec(eO,{...e,forwardedRef:t}));eO.displayName="Panel";Qa.displayName="forwardRef(Panel)";function Kj(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const el=10;function Du(e,t,n,r,o,s,i,l){const{id:u,panels:p,units:m}=t,h=m==="pixels"?Ha(u):NaN,{sizes:g}=l||{},x=g||s,y=Or(p),b=x.concat();let w=0;{const _=o<0?r:n,E=y.findIndex(D=>D.current.id===_),I=y[E],M=x[E],R=Cx(m,h,I,M,M+Math.abs(o),e);if(M===R)return x;R===0&&M>0&&i.set(_,M),o=o<0?M-R:R-M}let S=o<0?n:r,j=y.findIndex(_=>_.current.id===S);for(;;){const _=y[j],E=x[j],I=Math.abs(o)-Math.abs(w),M=Cx(m,h,_,E,E-I,e);if(E!==M&&(M===0&&E>0&&i.set(_.current.id,E),w+=E-M,b[j]=M,w.toPrecision(el).localeCompare(Math.abs(o).toPrecision(el),void 0,{numeric:!0})>=0))break;if(o<0){if(--j<0)break}else if(++j>=y.length)break}return w===0?x:(S=o<0?r:n,j=y.findIndex(_=>_.current.id===S),b[j]=x[j]+w,b)}function Fl(e,t,n){t.forEach((r,o)=>{const s=e[o];if(!s)return;const{callbacksRef:i,collapsedSize:l,collapsible:u,id:p}=s.current,m=n[p];if(m!==r){n[p]=r;const{onCollapse:h,onResize:g}=i.current;g&&g(r,m),u&&h&&((m==null||m===l)&&r!==l?h(!1):m!==l&&r===l&&h(!0))}})}function Ise({groupId:e,panels:t,units:n}){const r=n==="pixels"?Ha(e):NaN,o=Or(t),s=Array(o.length);let i=0,l=100;for(let u=0;u<o.length;u++){const p=o[u],{defaultSize:m}=p.current;m!=null&&(i++,s[u]=n==="pixels"?m/r*100:m,l-=s[u])}for(let u=0;u<o.length;u++){const p=o[u];let{defaultSize:m,id:h,maxSize:g,minSize:x}=p.current;if(m!=null)continue;n==="pixels"&&(x=x/r*100,g!=null&&(g=g/r*100));const y=o.length-i,b=Math.min(g??100,Math.max(x,l/y));s[u]=b,i++,l-=b}if(l!==0)for(let u=0;u<o.length;u++){const p=o[u];let{maxSize:m,minSize:h}=p.current;n==="pixels"&&(h=h/r*100,m!=null&&(m=m/r*100));const g=Math.min(m??100,Math.max(h,s[u]+l));if(g!==s[u]&&(l-=g-s[u],s[u]=g,Math.abs(l).toFixed(3)==="0.000"))break}return Math.abs(l).toFixed(3),s}function Uv(e,t){if(t.length<2)return[null,null];const n=t.findIndex(i=>i.current.id===e);if(n<0)return[null,null];const r=n===t.length-1,o=r?t[n-1].current.id:e,s=r?e:t[n+1].current.id;return[o,s]}function Ha(e){const t=md(e);if(t==null)return NaN;const n=t.getAttribute("data-panel-group-direction"),r=Jy(e);return n==="horizontal"?t.offsetWidth-r.reduce((o,s)=>o+s.offsetWidth,0):t.offsetHeight-r.reduce((o,s)=>o+s.offsetHeight,0)}function tO(e,t,n){if(e.size===1)return"100";const o=Or(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(el)}function Pse(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function md(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function _g(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Ese(e){return nO().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function nO(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function Jy(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function e2(e,t,n){var u,p,m,h;const r=_g(t),o=Jy(e),s=r?o.indexOf(r):-1,i=((p=(u=n[s])==null?void 0:u.current)==null?void 0:p.id)??null,l=((h=(m=n[s+1])==null?void 0:m.current)==null?void 0:h.id)??null;return[i,l]}function Or(e){return Array.from(e.values()).sort((t,n)=>{const r=t.current.order,o=n.current.order;return r==null&&o==null?0:r==null?-1:o==null?1:r-o})}function Cx(e,t,n,r,o,s=null){var m;let{collapsedSize:i,collapsible:l,maxSize:u,minSize:p}=n.current;if(e==="pixels"&&(i=i/t*100,u!=null&&(u=u/t*100),p=p/t*100),l){if(r>i){if(o<=p/2+i)return i}else if(!((m=s==null?void 0:s.type)==null?void 0:m.startsWith("key"))&&o<p)return i}return Math.min(u??100,Math.max(p,o))}function Mse(e,t){const{collapsible:n,defaultSize:r,maxSize:o,minSize:s}=t.current;(s<0||e==="percentages"&&s>100)&&(t.current.minSize=0),o!=null&&(o<0||e==="percentages"&&o>100)&&(t.current.maxSize=null),r!==null&&(r<0||e==="percentages"&&r>100?t.current.defaultSize=null:r<s&&!n?t.current.defaultSize=s:o!=null&&r>o&&(t.current.defaultSize=o))}function Gv({groupId:e,panels:t,nextSizes:n,prevSizes:r,units:o}){n=[...n];const s=Or(t),i=o==="pixels"?Ha(e):NaN;let l=0;for(let u=0;u<s.length;u++){const p=s[u],m=r[u],h=n[u],g=Cx(o,i,p,m,h);h!=g&&(l+=h-g,n[u]=g)}if(l.toFixed(3)!=="0.000")for(let u=0;u<s.length;u++){const p=s[u];let{maxSize:m,minSize:h}=p.current;o==="pixels"&&(h=h/i*100,m!=null&&(m=m/i*100));const g=Math.min(m??100,Math.max(h,n[u]+l));if(g!==n[u]&&(l-=g-n[u],n[u]=g,Math.abs(l).toFixed(3)==="0.000"))break}return l.toFixed(3),n}function rO(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function Ose({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){oa(()=>{const{direction:i,panels:l}=e.current,u=md(t);rO(u!=null,`No group found for id "${t}"`);const{height:p,width:m}=u.getBoundingClientRect(),g=Jy(t).map(x=>{const y=x.getAttribute("data-panel-resize-handle-id"),b=Or(l),[w,S]=e2(t,y,b);if(w==null||S==null)return()=>{};let j=0,_=100,E=0,I=0;b.forEach(T=>{const{id:X,maxSize:B,minSize:V}=T.current;X===w?(j=V,_=B??100):(E+=V,I+=B??100)});const M=Math.min(_,100-E),R=Math.max(j,(b.length-1)*100-I),D=tO(l,w,o);x.setAttribute("aria-valuemax",""+Math.round(M)),x.setAttribute("aria-valuemin",""+Math.round(R)),x.setAttribute("aria-valuenow",""+Math.round(parseInt(D)));const A=T=>{if(!T.defaultPrevented)switch(T.key){case"Enter":{T.preventDefault();const X=b.findIndex(B=>B.current.id===w);if(X>=0){const B=b[X],V=o[X];if(V!=null){let U=0;V.toPrecision(el)<=B.current.minSize.toPrecision(el)?U=i==="horizontal"?m:p:U=-(i==="horizontal"?m:p);const N=Du(T,e.current,w,S,U,o,s.current,null);o!==N&&r(N)}}break}}};x.addEventListener("keydown",A);const O=Pse(w);return O!=null&&x.setAttribute("aria-controls",O.id),()=>{x.removeAttribute("aria-valuemax"),x.removeAttribute("aria-valuemin"),x.removeAttribute("aria-valuenow"),x.removeEventListener("keydown",A),O!=null&&x.removeAttribute("aria-controls")}});return()=>{g.forEach(x=>x())}},[e,t,n,s,r,o])}function Rse({disabled:e,handleId:t,resizeHandler:n}){oa(()=>{if(e||n==null)return;const r=_g(t);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=nO(),l=Ese(t);rO(l!==null);const u=s.shiftKey?l>0?l-1:i.length-1:l+1<i.length?l+1:0;i[u].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function Kv(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oO(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(wx(e))i=s?e.clientX:e.clientY;else if(Sx(e)){const m=e.touches[0];i=s?m.screenX:m.screenY}else return 0;const l=_g(t),u=o||l.getBoundingClientRect(),p=s?u.left:u.top;return i-p-r}function Dse(e,t,n,r,o,s,i){const{dragOffset:l=0,dragHandleRect:u,sizes:p}=i||{},m=p||s;if(Ase(e)){const h=o==="horizontal",x=md(t).getBoundingClientRect(),y=h?x.width:x.height,b=e.shiftKey?10:100,w=y/b;let S=0;switch(e.key){case"ArrowDown":S=h?0:w;break;case"ArrowLeft":S=h?-w:0;break;case"ArrowRight":S=h?w:0;break;case"ArrowUp":S=h?0:-w;break;case"End":S=y;break;case"Home":S=-y;break}const[j,_]=e2(t,n,r),E=S<0?j:_,I=r.findIndex(R=>R.current.id===E),M=r[I];if(M.current.collapsible){const R=m[I];(R===0||R.toPrecision(el)===M.current.minSize.toPrecision(el))&&(S=S<0?-M.current.minSize*y:M.current.minSize*y)}return S}else return oO(e,n,o,l,u)}function Ase(e){return e.type==="keydown"}function wx(e){return e.type.startsWith("mouse")}function Sx(e){return e.type.startsWith("touch")}let kx=null,Oi=null;function sO(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function Tse(){Oi!==null&&(document.head.removeChild(Oi),kx=null,Oi=null)}function qv(e){if(kx===e)return;kx=e;const t=sO(e);Oi===null&&(Oi=document.createElement("style"),document.head.appendChild(Oi)),Oi.innerHTML=`*{cursor: ${t}!important;}`}function Nse(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function aO(e){return e.map(t=>{const{minSize:n,order:r}=t.current;return r?`${r}:${n}`:`${n}`}).sort((t,n)=>t.localeCompare(n)).join(",")}function iO(e,t){try{const n=t.getItem(`PanelGroup:sizes:${e}`);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function $se(e,t,n){const r=iO(e,n);if(r){const o=aO(t);return r[o]??null}return null}function Lse(e,t,n,r){const o=aO(t),s=iO(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const Xv={};function qj(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}const Au={getItem:e=>(qj(Au),Au.getItem(e)),setItem:(e,t)=>{qj(Au),Au.setItem(e,t)}};function lO({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:l,storage:u=Au,style:p={},tagName:m="div",units:h="percentages"}){const g=Zy(i),[x,y]=Wu(null),[b,w]=Wu(new Map),S=Kr(null);Kr({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const j=Kr({onLayout:l});oa(()=>{j.current.onLayout=l});const _=Kr({}),[E,I]=Wu([]),M=Kr(new Map),R=Kr(0),D=Kr({direction:r,id:g,panels:b,sizes:E,units:h});J8(s,()=>({getId:()=>g,getLayout:F=>{const{sizes:Q,units:Y}=D.current;if((F??Y)==="pixels"){const ae=Ha(g);return Q.map(re=>re/100*ae)}else return Q},setLayout:(F,Q)=>{const{id:Y,panels:se,sizes:ae,units:re}=D.current;if((Q||re)==="pixels"){const ce=Ha(Y);F=F.map(J=>J/ce*100)}const G=_.current,K=Or(se),ee=Gv({groupId:Y,panels:se,nextSizes:F,prevSizes:ae,units:re});Kv(ae,ee)||(I(ee),Fl(K,ee,G))}}),[g]),Uu(()=>{D.current.direction=r,D.current.id=g,D.current.panels=b,D.current.sizes=E,D.current.units=h}),Ose({committedValuesRef:D,groupId:g,panels:b,setSizes:I,sizes:E,panelSizeBeforeCollapse:M}),oa(()=>{const{onLayout:F}=j.current,{panels:Q,sizes:Y}=D.current;if(Y.length>0){F&&F(Y);const se=_.current,ae=Or(Q);Fl(ae,Y,se)}},[E]),Uu(()=>{const{id:F,sizes:Q,units:Y}=D.current;if(Q.length===b.size)return;let se=null;if(e){const ae=Or(b);se=$se(e,ae,u)}if(se!=null){const ae=Gv({groupId:F,panels:b,nextSizes:se,prevSizes:se,units:Y});I(ae)}else{const ae=Ise({groupId:F,panels:b,units:Y});I(ae)}},[e,b,u]),oa(()=>{if(e){if(E.length===0||E.length!==b.size)return;const F=Or(b);Xv[e]||(Xv[e]=Nse(Lse,100)),Xv[e](e,F,E,u)}},[e,b,E,u]),Uu(()=>{if(h==="pixels"){const F=new ResizeObserver(()=>{const{panels:Q,sizes:Y}=D.current,se=Gv({groupId:g,panels:Q,nextSizes:Y,prevSizes:Y,units:h});Kv(Y,se)||I(se)});return F.observe(md(g)),()=>{F.disconnect()}}},[g,h]);const A=Gs((F,Q)=>{const{panels:Y,units:se}=D.current,re=Or(Y).findIndex(ee=>ee.current.id===F),G=E[re];if((Q??se)==="pixels"){const ee=Ha(g);return G/100*ee}else return G},[g,E]),O=Gs((F,Q)=>{const{panels:Y}=D.current;return Y.size===0?{flexBasis:0,flexGrow:Q??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:tO(Y,F,E),flexShrink:1,overflow:"hidden",pointerEvents:o&&x!==null?"none":void 0}},[x,o,E]),T=Gs((F,Q)=>{const{units:Y}=D.current;Mse(Y,Q),w(se=>{if(se.has(F))return se;const ae=new Map(se);return ae.set(F,Q),ae})},[]),X=Gs(F=>Y=>{Y.preventDefault();const{direction:se,panels:ae,sizes:re}=D.current,G=Or(ae),[K,ee]=e2(g,F,G);if(K==null||ee==null)return;let ce=Dse(Y,g,F,G,se,re,S.current);if(ce===0)return;const ie=md(g).getBoundingClientRect(),de=se==="horizontal";document.dir==="rtl"&&de&&(ce=-ce);const ge=de?ie.width:ie.height,Ce=ce/ge*100,he=Du(Y,D.current,K,ee,Ce,re,M.current,S.current),fe=!Kv(re,he);if((wx(Y)||Sx(Y))&&R.current!=Ce&&qv(fe?de?"horizontal":"vertical":de?ce<0?"horizontal-min":"horizontal-max":ce<0?"vertical-min":"vertical-max"),fe){const Oe=_.current;I(he),Fl(G,he,Oe)}R.current=Ce},[g]),B=Gs(F=>{w(Q=>{if(!Q.has(F))return Q;const Y=new Map(Q);return Y.delete(F),Y})},[]),V=Gs(F=>{const{panels:Q,sizes:Y}=D.current,se=Q.get(F);if(se==null)return;const{collapsedSize:ae,collapsible:re}=se.current;if(!re)return;const G=Or(Q),K=G.indexOf(se);if(K<0)return;const ee=Y[K];if(ee===ae)return;M.current.set(F,ee);const[ce,J]=Uv(F,G);if(ce==null||J==null)return;const de=K===G.length-1?ee:ae-ee,ge=Du(null,D.current,ce,J,de,Y,M.current,null);if(Y!==ge){const Ce=_.current;I(ge),Fl(G,ge,Ce)}},[]),U=Gs(F=>{const{panels:Q,sizes:Y}=D.current,se=Q.get(F);if(se==null)return;const{collapsedSize:ae,minSize:re}=se.current,G=M.current.get(F)||re;if(!G)return;const K=Or(Q),ee=K.indexOf(se);if(ee<0||Y[ee]!==ae)return;const[J,ie]=Uv(F,K);if(J==null||ie==null)return;const ge=ee===K.length-1?ae-G:G,Ce=Du(null,D.current,J,ie,ge,Y,M.current,null);if(Y!==Ce){const he=_.current;I(Ce),Fl(K,Ce,he)}},[]),N=Gs((F,Q,Y)=>{const{id:se,panels:ae,sizes:re,units:G}=D.current;if((Y||G)==="pixels"){const nt=Ha(se);Q=Q/nt*100}const K=ae.get(F);if(K==null)return;let{collapsedSize:ee,collapsible:ce,maxSize:J,minSize:ie}=K.current;if(G==="pixels"){const nt=Ha(se);ie=ie/nt*100,J!=null&&(J=J/nt*100)}const de=Or(ae),ge=de.indexOf(K);if(ge<0)return;const Ce=re[ge];if(Ce===Q)return;ce&&Q===ee||(Q=Math.min(J??100,Math.max(ie,Q)));const[he,fe]=Uv(F,de);if(he==null||fe==null)return;const _e=ge===de.length-1?Ce-Q:Q-Ce,Ne=Du(null,D.current,he,fe,_e,re,M.current,null);if(re!==Ne){const nt=_.current;I(Ne),Fl(de,Ne,nt)}},[]),$=kse(()=>({activeHandleId:x,collapsePanel:V,direction:r,expandPanel:U,getPanelSize:A,getPanelStyle:O,groupId:g,registerPanel:T,registerResizeHandle:X,resizePanel:N,startDragging:(F,Q)=>{if(y(F),wx(Q)||Sx(Q)){const Y=_g(F);S.current={dragHandleRect:Y.getBoundingClientRect(),dragOffset:oO(Q,F,r),sizes:D.current.sizes}}},stopDragging:()=>{Tse(),y(null),S.current=null},units:h,unregisterPanel:B}),[x,V,r,U,A,O,g,T,X,N,h,B]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ec(jg.Provider,{children:Ec(m,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g,"data-panel-group-units":h,style:{...q,...p}}),value:$})}const Ig=Y8((e,t)=>Ec(lO,{...e,forwardedRef:t}));lO.displayName="PanelGroup";Ig.displayName="forwardRef(PanelGroup)";function jx({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const l=Kr(null),u=Kr({onDragging:o});oa(()=>{u.current.onDragging=o});const p=Z8(jg);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:m,direction:h,groupId:g,registerResizeHandle:x,startDragging:y,stopDragging:b}=p,w=Zy(r),S=m===w,[j,_]=Wu(!1),[E,I]=Wu(null),M=Gs(()=>{l.current.blur(),b();const{onDragging:A}=u.current;A&&A(!1)},[b]);oa(()=>{if(n)I(null);else{const D=x(w);I(()=>D)}},[n,w,x]),oa(()=>{if(n||E==null||!S)return;const D=X=>{E(X)},A=X=>{E(X)},T=l.current.ownerDocument;return T.body.addEventListener("contextmenu",M),T.body.addEventListener("mousemove",D),T.body.addEventListener("touchmove",D),T.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",M),window.addEventListener("touchend",M),()=>{T.body.removeEventListener("contextmenu",M),T.body.removeEventListener("mousemove",D),T.body.removeEventListener("touchmove",D),T.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",M),window.removeEventListener("touchend",M)}},[h,n,S,E,M]),Rse({disabled:n,handleId:w,resizeHandler:E});const R={cursor:sO(h),touchAction:"none",userSelect:"none"};return Ec(i,{children:e,className:t,"data-resize-handle-active":S?"pointer":j?"keyboard":void 0,"data-panel-group-direction":h,"data-panel-group-id":g,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w,onBlur:()=>_(!1),onFocus:()=>_(!0),onMouseDown:D=>{y(w,D.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},onMouseUp:M,onTouchCancel:M,onTouchEnd:M,onTouchStart:D=>{y(w,D.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},ref:l,role:"separator",style:{...R,...s},tabIndex:0})}jx.displayName="PanelResizeHandle";const zse=e=>{const{direction:t="horizontal",collapsedDirection:n,isCollapsed:r=!1,...o}=e,s=sa("base.100","base.850"),i=sa("base.300","base.700");return t==="horizontal"?a.jsx(jx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(L,{className:"resize-handle-horizontal",sx:{w:n?2.5:4,h:"full",justifyContent:n?n==="left"?"flex-start":"flex-end":"center",alignItems:"center",div:{bg:s},_hover:{div:{bg:i}}},...o,children:a.jsx(Ie,{sx:{w:1,h:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})}):a.jsx(jx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(L,{className:"resize-handle-vertical",sx:{w:"full",h:n?2.5:4,alignItems:n?n==="top"?"flex-start":"flex-end":"center",justifyContent:"center",div:{bg:s},_hover:{div:{bg:i}}},...o,children:a.jsx(Ie,{sx:{h:1,w:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})})},lh=d.memo(zse),t2=()=>{const e=te(),t=W(o=>o.ui.panels),n=d.useCallback(o=>t[o]??"",[t]),r=d.useCallback((o,s)=>{e(BD({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const Fse=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,i=d.useMemo(()=>HD(n)?n:JSON.stringify(n,null,2),[n]),l=d.useCallback(()=>{navigator.clipboard.writeText(i)},[i]),u=d.useCallback(()=>{const m=new Blob([i]),h=document.createElement("a");h.href=URL.createObjectURL(m),h.download=`${r||t}.json`,document.body.appendChild(h),h.click(),h.remove()},[i,t,r]),{t:p}=Z();return a.jsxs(L,{layerStyle:"second",sx:{borderRadius:"base",flexGrow:1,w:"full",h:"full",position:"relative"},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"auto",p:4,fontSize:"sm"},children:a.jsx(hg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsx("pre",{children:i})})}),a.jsxs(L,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:[o&&a.jsx(Ft,{label:`${p("gallery.download")} ${t} JSON`,children:a.jsx(ys,{"aria-label":`${p("gallery.download")} ${t} JSON`,icon:a.jsx(ig,{}),variant:"ghost",opacity:.7,onClick:u})}),s&&a.jsx(Ft,{label:`${p("gallery.copy")} ${t} JSON`,children:a.jsx(ys,{"aria-label":`${p("gallery.copy")} ${t} JSON`,icon:a.jsx(Hc,{}),variant:"ghost",opacity:.7,onClick:l})})]})]})},Ya=d.memo(Fse),Bse=le(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(r=>r.id===t);return{data:n==null?void 0:n.data}},Se),Hse=()=>{const{data:e}=W(Bse);return e?a.jsx(Ya,{data:e,label:"Node Data"}):a.jsx(Zn,{label:"No node selected",icon:null})},Vse=d.memo(Hse),Wse=({children:e,maxHeight:t})=>a.jsx(L,{sx:{w:"full",h:"full",maxHeight:t,position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(hg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:e})})}),Zd=d.memo(Wse),Use=({output:e})=>{const{image:t}=e,{data:n}=to(t.image_name);return a.jsx(ua,{imageDTO:n})},Gse=d.memo(Use),Kse=le(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(s=>s.id===t),r=n?e.nodeTemplates[n.data.type]:void 0,o=e.nodeExecutionStates[t??"__UNKNOWN_NODE__"];return{node:n,template:r,nes:o}},Se),qse=()=>{const{node:e,template:t,nes:n}=W(Kse),{t:r}=Z();return!e||!n||!On(e)?a.jsx(Zn,{label:r("nodes.noNodeSelected"),icon:null}):n.outputs.length===0?a.jsx(Zn,{label:r("nodes.noOutputRecorded"),icon:null}):a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Zd,{children:a.jsx(L,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:(t==null?void 0:t.outputType)==="image_output"?n.outputs.map((o,s)=>a.jsx(Gse,{output:o},Qse(o,s))):a.jsx(Ya,{data:n.outputs,label:r("nodes.nodeOutputs")})})})})},Xse=d.memo(qse),Qse=(e,t)=>`${e.type}-${t}`,Yse=le(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(o=>o.id===t);return{template:n?e.nodeTemplates[n.data.type]:void 0}},Se),Zse=()=>{const{template:e}=W(Yse),{t}=Z();return e?a.jsx(Ya,{data:e,label:t("nodes.nodeTemplate")}):a.jsx(Zn,{label:t("nodes.noNodeSelected"),icon:null})},Jse=d.memo(Zse),eae=()=>a.jsx(L,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(rl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ol,{children:[a.jsx(Tr,{children:"Outputs"}),a.jsx(Tr,{children:"Data"}),a.jsx(Tr,{children:"Template"})]}),a.jsxs(zc,{children:[a.jsx(So,{children:a.jsx(Xse,{})}),a.jsx(So,{children:a.jsx(Vse,{})}),a.jsx(So,{children:a.jsx(Jse,{})})]})]})}),tae=d.memo(eae),n2=e=>{e.stopPropagation()},nae={display:"flex",flexDirection:"row",alignItems:"center",gap:10},rae=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...i}=e,l=te(),u=d.useCallback(m=>{m.shiftKey&&l(Nr(!0))},[l]),p=d.useCallback(m=>{m.shiftKey||l(Nr(!1))},[l]);return a.jsxs(Kt,{isInvalid:o,isDisabled:r,...s,style:n==="side"?nae:void 0,children:[t!==""&&a.jsx(wn,{children:t}),a.jsx(Mh,{...i,onPaste:n2,onKeyDown:u,onKeyUp:p})]})},vo=d.memo(rae),oae=je((e,t)=>{const n=te(),r=d.useCallback(s=>{s.shiftKey&&n(Nr(!0))},[n]),o=d.useCallback(s=>{s.shiftKey||n(Nr(!1))},[n]);return a.jsx(dP,{ref:t,onPaste:n2,onKeyDown:r,onKeyUp:o,...e})}),da=d.memo(oae),sae=le(xe,({nodes:e})=>{const{author:t,name:n,description:r,tags:o,version:s,contact:i,notes:l}=e.workflow;return{name:n,author:t,description:r,tags:o,version:s,contact:i,notes:l}},Se),aae=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:i}=W(sae),l=te(),u=d.useCallback(w=>{l(VD(w.target.value))},[l]),p=d.useCallback(w=>{l(WD(w.target.value))},[l]),m=d.useCallback(w=>{l(UD(w.target.value))},[l]),h=d.useCallback(w=>{l(GD(w.target.value))},[l]),g=d.useCallback(w=>{l(KD(w.target.value))},[l]),x=d.useCallback(w=>{l(qD(w.target.value))},[l]),y=d.useCallback(w=>{l(XD(w.target.value))},[l]),{t:b}=Z();return a.jsx(Zd,{children:a.jsxs(L,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs(L,{sx:{gap:2,w:"full"},children:[a.jsx(vo,{label:b("nodes.workflowName"),value:t,onChange:u}),a.jsx(vo,{label:b("nodes.workflowVersion"),value:o,onChange:h})]}),a.jsxs(L,{sx:{gap:2,w:"full"},children:[a.jsx(vo,{label:b("nodes.workflowAuthor"),value:e,onChange:p}),a.jsx(vo,{label:b("nodes.workflowContact"),value:s,onChange:m})]}),a.jsx(vo,{label:b("nodes.workflowTags"),value:r,onChange:x}),a.jsxs(Kt,{as:L,sx:{flexDir:"column"},children:[a.jsx(wn,{children:b("nodes.workflowDescription")}),a.jsx(da,{onChange:g,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(Kt,{as:L,sx:{flexDir:"column",h:"full"},children:[a.jsx(wn,{children:b("nodes.workflowNotes")}),a.jsx(da,{onChange:y,value:i,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},iae=d.memo(aae);function lae(e,t,n){var r=this,o=d.useRef(null),s=d.useRef(0),i=d.useRef(null),l=d.useRef([]),u=d.useRef(),p=d.useRef(),m=d.useRef(e),h=d.useRef(!0);d.useEffect(function(){m.current=e},[e]);var g=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,b="maxWait"in n,w=b?Math.max(+n.maxWait||0,t):null;d.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var S=d.useMemo(function(){var j=function(D){var A=l.current,O=u.current;return l.current=u.current=null,s.current=D,p.current=m.current.apply(O,A)},_=function(D,A){g&&cancelAnimationFrame(i.current),i.current=g?requestAnimationFrame(D):setTimeout(D,A)},E=function(D){if(!h.current)return!1;var A=D-o.current;return!o.current||A>=t||A<0||b&&D-s.current>=w},I=function(D){return i.current=null,y&&l.current?j(D):(l.current=u.current=null,p.current)},M=function D(){var A=Date.now();if(E(A))return I(A);if(h.current){var O=t-(A-o.current),T=b?Math.min(O,w-(A-s.current)):O;_(D,T)}},R=function(){var D=Date.now(),A=E(D);if(l.current=[].slice.call(arguments),u.current=r,o.current=D,A){if(!i.current&&h.current)return s.current=o.current,_(M,t),x?j(o.current):p.current;if(b)return _(M,t),j(o.current)}return i.current||_(M,t),p.current};return R.cancel=function(){i.current&&(g?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,l.current=o.current=u.current=i.current=null},R.isPending=function(){return!!i.current},R.flush=function(){return i.current?I(Date.now()):p.current},R},[x,b,t,w,y,g]);return S}function cae(e,t){return e===t}function Xj(e){return typeof e=="function"?function(){return e}:e}function uae(e,t,n){var r,o,s=n&&n.equalityFn||cae,i=(r=d.useState(Xj(e)),o=r[1],[r[0],d.useCallback(function(h){return o(Xj(h))},[])]),l=i[0],u=i[1],p=lae(d.useCallback(function(h){return u(h)},[u]),t,n),m=d.useRef(e);return s(m.current,e)||(p(e),m.current=e),[l,p]}const cO=()=>{const e=W(r=>r.nodes),[t]=uae(e,300);return d.useMemo(()=>QD(t),[t])},dae=()=>{const e=cO(),{t}=Z();return a.jsx(L,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Ya,{data:e,label:t("nodes.workflow")})})},fae=d.memo(dae),pae=({isSelected:e,isHovered:t})=>{const n=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.light";if(e)return"nodeSelected.light";if(t)return"nodeHovered.light"},[t,e]),r=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.dark";if(e)return"nodeSelected.dark";if(t)return"nodeHovered.dark"},[t,e]);return a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e||t?1:.5,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:n,_dark:{shadow:r}}})},uO=d.memo(pae),dO=e=>{const t=te(),n=d.useMemo(()=>le(xe,({nodes:i})=>i.mouseOverNode===e,Se),[e]),r=W(n),o=d.useCallback(()=>{!r&&t(vw(e))},[t,e,r]),s=d.useCallback(()=>{r&&t(vw(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},fO=(e,t)=>{const n=d.useMemo(()=>le(xe,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(On(s))return(i=s==null?void 0:s.data.inputs[t])==null?void 0:i.label},Se),[t,e]);return W(n)},pO=(e,t,n)=>{const r=d.useMemo(()=>le(xe,({nodes:s})=>{var u;const i=s.nodes.find(p=>p.id===e);if(!On(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return(u=l==null?void 0:l[rb[n]][t])==null?void 0:u.title},Se),[t,n,e]);return W(r)},mO=(e,t)=>{const n=d.useMemo(()=>le(xe,({nodes:o})=>{const s=o.nodes.find(i=>i.id===e);if(On(s))return s==null?void 0:s.data.inputs[t]},Se),[t,e]);return W(n)},Pg=(e,t,n)=>{const r=d.useMemo(()=>le(xe,({nodes:s})=>{const i=s.nodes.find(u=>u.id===e);if(!On(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return l==null?void 0:l[rb[n]][t]},Se),[t,n,e]);return W(r)},mae=({nodeId:e,fieldName:t,kind:n})=>{const r=mO(e,t),o=Pg(e,t,n),s=YD(o),{t:i}=Z(),l=d.useMemo(()=>ZD(r)?r.label&&(o!=null&&o.title)?`${r.label} (${o.title})`:r.label&&!o?r.label:!r.label&&o?o.title:i("nodes.unknownField"):(o==null?void 0:o.title)||i("nodes.unknownField"),[r,o,i]);return a.jsxs(L,{sx:{flexDir:"column"},children:[a.jsx(ve,{sx:{fontWeight:600},children:l}),o&&a.jsx(ve,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(ve,{children:["Type: ",wd[o.type].title]}),s&&a.jsxs(ve,{children:["Input: ",JD(o.input)]})]})},r2=d.memo(mae),hae=je((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:i=!1}=e,l=fO(n,r),u=pO(n,r,o),{t:p}=Z(),m=te(),[h,g]=d.useState(l||u||p("nodes.unknownField")),x=d.useCallback(async b=>{b&&(b===l||b===u)||(g(b||u||p("nodes.unknownField")),m(eA({nodeId:n,fieldName:r,label:b})))},[l,u,m,n,r,p]),y=d.useCallback(b=>{g(b)},[]);return d.useEffect(()=>{g(l||u||p("nodes.unknownField"))},[l,u,p]),a.jsx(Ft,{label:i?a.jsx(r2,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:yh,placement:"top",hasArrow:!0,children:a.jsx(L,{ref:t,sx:{position:"relative",overflow:"hidden",alignItems:"center",justifyContent:"flex-start",gap:1,h:"full"},children:a.jsxs(Ih,{value:h,onChange:y,onSubmit:x,as:L,sx:{position:"relative",alignItems:"center",h:"full"},children:[a.jsx(_h,{sx:{p:0,fontWeight:s?600:400,textAlign:"left",_hover:{fontWeight:"600 !important"}},noOfLines:1}),a.jsx(jh,{className:"nodrag",sx:{p:0,w:"full",fontWeight:600,color:"base.900",_dark:{color:"base.100"},_focusVisible:{p:0,textAlign:"left",boxShadow:"none"}}}),a.jsx(gO,{})]})})})}),hO=d.memo(hae),gO=d.memo(()=>{const{isEditing:e,getEditButtonProps:t}=y5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&(o(r),r.preventDefault())},[t]);return e?null:a.jsx(L,{onClick:n,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,cursor:"text"})});gO.displayName="EditableControls";const gae=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(tA({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(Qb,{className:"nodrag",onChange:o,isChecked:n.value})},vae=d.memo(gae);function Eg(){return(Eg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vO(e,t){if(e==null)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(o[n]=e[n]);return o}function _x(e){var t=d.useRef(e),n=d.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Mc=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Gu=function(e){return"touches"in e},Ix=function(e){return e&&e.ownerDocument.defaultView||self},Qj=function(e,t,n){var r=e.getBoundingClientRect(),o=Gu(t)?function(s,i){for(var l=0;l<s.length;l++)if(s[l].identifier===i)return s[l];return s[0]}(t.touches,n):t;return{left:Mc((o.pageX-(r.left+Ix(e).pageXOffset))/r.width),top:Mc((o.pageY-(r.top+Ix(e).pageYOffset))/r.height)}},Yj=function(e){!Gu(e)&&e.preventDefault()},o2=H.memo(function(e){var t=e.onMove,n=e.onKey,r=vO(e,["onMove","onKey"]),o=d.useRef(null),s=_x(t),i=_x(n),l=d.useRef(null),u=d.useRef(!1),p=d.useMemo(function(){var x=function(w){Yj(w),(Gu(w)?w.touches.length>0:w.buttons>0)&&o.current?s(Qj(o.current,w,l.current)):b(!1)},y=function(){return b(!1)};function b(w){var S=u.current,j=Ix(o.current),_=w?j.addEventListener:j.removeEventListener;_(S?"touchmove":"mousemove",x),_(S?"touchend":"mouseup",y)}return[function(w){var S=w.nativeEvent,j=o.current;if(j&&(Yj(S),!function(E,I){return I&&!Gu(E)}(S,u.current)&&j)){if(Gu(S)){u.current=!0;var _=S.changedTouches||[];_.length&&(l.current=_[0].identifier)}j.focus(),s(Qj(j,S,l.current)),b(!0)}},function(w){var S=w.which||w.keyCode;S<37||S>40||(w.preventDefault(),i({left:S===39?.05:S===37?-.05:0,top:S===40?.05:S===38?-.05:0}))},b]},[i,s]),m=p[0],h=p[1],g=p[2];return d.useEffect(function(){return g},[g]),H.createElement("div",Eg({},r,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),Mg=function(e){return e.filter(Boolean).join(" ")},s2=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=Mg(["react-colorful__pointer",e.className]);return H.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},H.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Cr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},xO=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:Cr(e.h),s:Cr(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:Cr(o/2),a:Cr(r,2)}},Px=function(e){var t=xO(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Qv=function(e){var t=xO(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},xae=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),i=r*(1-n),l=r*(1-(t-s)*n),u=r*(1-(1-t+s)*n),p=s%6;return{r:Cr(255*[r,l,i,i,u,r][p]),g:Cr(255*[u,r,r,l,i,i][p]),b:Cr(255*[i,i,u,r,r,l][p]),a:Cr(o,2)}},bae=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),i=s-Math.min(t,n,r),l=i?s===t?(n-r)/i:s===n?2+(r-t)/i:4+(t-n)/i:0;return{h:Cr(60*(l<0?l+6:l)),s:Cr(s?i/s*100:0),v:Cr(s/255*100),a:o}},yae=H.memo(function(e){var t=e.hue,n=e.onChange,r=Mg(["react-colorful__hue",e.className]);return H.createElement("div",{className:r},H.createElement(o2,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Mc(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":Cr(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement(s2,{className:"react-colorful__hue-pointer",left:t/360,color:Px({h:t,s:100,v:100,a:1})})))}),Cae=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Px({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(o2,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Mc(t.s+100*o.left,0,100),v:Mc(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Cr(t.s)+"%, Brightness "+Cr(t.v)+"%"},H.createElement(s2,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Px(t)})))}),bO=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function wae(e,t,n){var r=_x(n),o=d.useState(function(){return e.toHsva(t)}),s=o[0],i=o[1],l=d.useRef({color:t,hsva:s});d.useEffect(function(){if(!e.equal(t,l.current.color)){var p=e.toHsva(t);l.current={hsva:p,color:t},i(p)}},[t,e]),d.useEffect(function(){var p;bO(s,l.current.hsva)||e.equal(p=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:p},r(p))},[s,e,r]);var u=d.useCallback(function(p){i(function(m){return Object.assign({},m,p)})},[]);return[s,u]}var Sae=typeof window<"u"?d.useLayoutEffect:d.useEffect,kae=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Zj=new Map,jae=function(e){Sae(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Zj.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Zj.set(t,n);var r=kae();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},_ae=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Qv(Object.assign({},n,{a:0}))+", "+Qv(Object.assign({},n,{a:1}))+")"},s=Mg(["react-colorful__alpha",t]),i=Cr(100*n.a);return H.createElement("div",{className:s},H.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),H.createElement(o2,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:Mc(n.a+l.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},H.createElement(s2,{className:"react-colorful__alpha-pointer",left:n.a,color:Qv(n)})))},Iae=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=vO(e,["className","colorModel","color","onChange"]),l=d.useRef(null);jae(l);var u=wae(n,o,s),p=u[0],m=u[1],h=Mg(["react-colorful",t]);return H.createElement("div",Eg({},i,{ref:l,className:h}),H.createElement(Cae,{hsva:p,onChange:m}),H.createElement(yae,{hue:p.h,onChange:m}),H.createElement(_ae,{hsva:p,onChange:m,className:"react-colorful__last-control"}))},Pae={defaultColor:{r:0,g:0,b:0,a:1},toHsva:bae,fromHsva:xae,equal:bO},yO=function(e){return H.createElement(Iae,Eg({},e,{colorModel:Pae}))};const Eae=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(nA({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(yO,{className:"nodrag",color:n.value,onChange:o})},Mae=d.memo(Eae),CO=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=rA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({controlNetModelId:e,errors:s.error.format()},"Failed to parse ControlNet model id");return}return s.data},Oae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=gh(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/controlnet/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Rn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=CO(p);m&&o(oA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(Pn,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:u,sx:{width:"100%"}})},Rae=d.memo(Oae),Dae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(i=>{o(sA({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return a.jsx(X3,{className:"nowheel nodrag",onChange:s,value:n.value,children:r.options.map(i=>a.jsx("option",{value:i,children:r.ui_choice_labels?r.ui_choice_labels[i]:i},i))})},Aae=d.memo(Dae),Tae=e=>{var p;const{nodeId:t,field:n}=e,r=te(),{currentData:o}=to(((p=n.value)==null?void 0:p.image_name)??$r.skipToken),s=d.useCallback(()=>{r(aA({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),i=d.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),l=d.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),u=d.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return a.jsx(L,{className:"nodrag",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(ua,{imageDTO:o,droppableData:l,draggableData:i,postUploadAction:u,useThumbailFallback:!0,uploadElement:a.jsx(wO,{}),dropLabel:a.jsx(SO,{}),minSize:8,children:a.jsx(zi,{onClick:s,icon:o?a.jsx(Ud,{}):void 0,tooltip:"Reset Image"})})})},Nae=d.memo(Tae),wO=d.memo(()=>a.jsx(ve,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));wO.displayName="UploadElement";const SO=d.memo(()=>a.jsx(ve,{fontSize:16,fontWeight:600,children:"Drop"}));SO.displayName="DropLabel";const $ae=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=iA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({loraModelId:e,errors:s.error.format()},"Failed to parse LoRA model id");return}return s.data},Lae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Cd(),{t:i}=Z(),l=d.useMemo(()=>{if(!s)return[];const m=[];return Rn(s.entities,(h,g)=>{h&&m.push({value:g,label:h.model_name,group:an[h.base_model]})}),m.sort((h,g)=>h.disabled&&!g.disabled?1:-1)},[s]),u=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/lora/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r==null?void 0:r.base_model,r==null?void 0:r.model_name]),p=d.useCallback(m=>{if(!m)return;const h=$ae(m);h&&o(lA({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx(L,{sx:{justifyContent:"center",p:2},children:a.jsx(ve,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(nn,{className:"nowheel nodrag",value:(u==null?void 0:u.id)??null,placeholder:l.length>0?i("models.selectLoRA"):i("models.noLoRAsAvailable"),data:l,nothingFound:i("models.noMatchingLoRAs"),itemComponent:ui,disabled:l.length===0,filter:(m,h)=>{var g;return((g=h.label)==null?void 0:g.toLowerCase().includes(m.toLowerCase().trim()))||h.value.toLowerCase().includes(m.toLowerCase().trim())},error:!u,onChange:p,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},zae=d.memo(Lae),Og=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=cA.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data};function Gc(e){const{iconMode:t=!1,...n}=e,r=te(),{t:o}=Z(),[s,{isLoading:i}]=uA(),l=()=>{s().unwrap().then(u=>{r(ct(Qt({title:`${o("modelManager.modelsSynced")}`,status:"success"})))}).catch(u=>{u&&r(ct(Qt({title:`${o("modelManager.modelSyncFailed")}`,status:"error"})))})};return t?a.jsx(Fe,{icon:a.jsx(xM,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:i,onClick:l,size:"sm",...n}):a.jsx(at,{isLoading:i,onClick:l,minW:"max-content",...n,children:"Sync Models"})}const Fae=e=>{var y,b;const{nodeId:t,field:n}=e,r=te(),o=Ht("syncModels").isFeatureEnabled,{t:s}=Z(),{data:i,isLoading:l}=Ku(xw),{data:u,isLoading:p}=Xo(xw),m=d.useMemo(()=>l||p,[l,p]),h=d.useMemo(()=>{if(!u)return[];const w=[];return Rn(u.entities,(S,j)=>{S&&w.push({value:j,label:S.model_name,group:an[S.base_model]})}),i&&Rn(i.entities,(S,j)=>{S&&w.push({value:j,label:S.model_name,group:an[S.base_model]})}),w},[u,i]),g=d.useMemo(()=>{var w,S,j,_;return((u==null?void 0:u.entities[`${(w=n.value)==null?void 0:w.base_model}/main/${(S=n.value)==null?void 0:S.model_name}`])||(i==null?void 0:i.entities[`${(j=n.value)==null?void 0:j.base_model}/onnx/${(_=n.value)==null?void 0:_.model_name}`]))??null},[(y=n.value)==null?void 0:y.base_model,(b=n.value)==null?void 0:b.model_name,u==null?void 0:u.entities,i==null?void 0:i.entities]),x=d.useCallback(w=>{if(!w)return;const S=Og(w);S&&r(SI({nodeId:t,fieldName:n.name,value:S}))},[r,n.name,t]);return a.jsxs(L,{sx:{w:"full",alignItems:"center",gap:2},children:[m?a.jsx(ve,{variant:"subtext",children:"Loading..."}):a.jsx(nn,{className:"nowheel nodrag",tooltip:g==null?void 0:g.description,value:g==null?void 0:g.id,placeholder:h.length>0?s("models.selectModel"):s("models.noModelsAvailable"),data:h,error:!g,disabled:h.length===0,onChange:x,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),o&&a.jsx(Gc,{className:"nodrag",iconMode:!0})]})},Bae=d.memo(Fae),ch=/^-?(0\.)?\.?$/,kO=je((e,t)=>{const{label:n,isDisabled:r=!1,showStepper:o=!0,isInvalid:s,value:i,onChange:l,min:u,max:p,isInteger:m=!0,formControlProps:h,formLabelProps:g,numberInputFieldProps:x,numberInputStepperProps:y,tooltipProps:b,...w}=e,S=te(),[j,_]=d.useState(String(i));d.useEffect(()=>{!j.match(ch)&&i!==Number(j)&&_(String(i))},[i,j]);const E=D=>{_(D),D.match(ch)||l(m?Math.floor(Number(D)):Number(D))},I=D=>{const A=Bi(m?Math.floor(Number(D.target.value)):Number(D.target.value),u,p);_(String(A)),l(A)},M=d.useCallback(D=>{D.shiftKey&&S(Nr(!0))},[S]),R=d.useCallback(D=>{D.shiftKey||S(Nr(!1))},[S]);return a.jsx(Ft,{...b,children:a.jsxs(Kt,{ref:t,isDisabled:r,isInvalid:s,...h,children:[n&&a.jsx(wn,{...g,children:n}),a.jsxs(Lh,{value:j,min:u,max:p,keepWithinRange:!0,clampValueOnBlur:!1,onChange:E,onBlur:I,...w,onPaste:n2,children:[a.jsx(Fh,{...x,onKeyDown:M,onKeyUp:R}),o&&a.jsxs(zh,{children:[a.jsx(Hh,{...y}),a.jsx(Bh,{...y})]})]})]})})});kO.displayName="IAINumberInput";const Kc=d.memo(kO),Hae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),[s,i]=d.useState(String(n.value)),l=d.useMemo(()=>r.type==="integer",[r.type]),u=p=>{i(p),p.match(ch)||o(dA({nodeId:t,fieldName:n.name,value:l?Math.floor(Number(p)):Number(p)}))};return d.useEffect(()=>{!s.match(ch)&&n.value!==Number(s)&&i(String(n.value))},[n.value,s]),a.jsxs(Lh,{onChange:u,value:s,step:l?1:.1,precision:l?0:3,children:[a.jsx(Fh,{className:"nodrag"}),a.jsxs(zh,{children:[a.jsx(Hh,{}),a.jsx(Bh,{})]})]})},Vae=d.memo(Hae),Wae=e=>{var h,g;const{nodeId:t,field:n}=e,r=te(),{t:o}=Z(),s=Ht("syncModels").isFeatureEnabled,{data:i,isLoading:l}=Xo(ob),u=d.useMemo(()=>{if(!i)return[];const x=[];return Rn(i.entities,(y,b)=>{y&&x.push({value:b,label:y.model_name,group:an[y.base_model]})}),x},[i]),p=d.useMemo(()=>{var x,y;return(i==null?void 0:i.entities[`${(x=n.value)==null?void 0:x.base_model}/main/${(y=n.value)==null?void 0:y.model_name}`])??null},[(h=n.value)==null?void 0:h.base_model,(g=n.value)==null?void 0:g.model_name,i==null?void 0:i.entities]),m=d.useCallback(x=>{if(!x)return;const y=Og(x);y&&r(fA({nodeId:t,fieldName:n.name,value:y}))},[r,n.name,t]);return l?a.jsx(nn,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs(L,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{className:"nowheel nodrag",tooltip:p==null?void 0:p.description,value:p==null?void 0:p.id,placeholder:u.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:u,error:!p,disabled:u.length===0,onChange:m,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Gc,{className:"nodrag",iconMode:!0})]})},Uae=d.memo(Wae),Gae=e=>{var g,x;const{nodeId:t,field:n}=e,r=te(),{t:o}=Z(),s=Ht("syncModels").isFeatureEnabled,{data:i}=Ku(bw),{data:l,isLoading:u}=Xo(bw),p=d.useMemo(()=>{if(!l)return[];const y=[];return Rn(l.entities,(b,w)=>{!b||b.base_model!=="sdxl"||y.push({value:w,label:b.model_name,group:an[b.base_model]})}),i&&Rn(i.entities,(b,w)=>{!b||b.base_model!=="sdxl"||y.push({value:w,label:b.model_name,group:an[b.base_model]})}),y},[l,i]),m=d.useMemo(()=>{var y,b,w,S;return((l==null?void 0:l.entities[`${(y=n.value)==null?void 0:y.base_model}/main/${(b=n.value)==null?void 0:b.model_name}`])||(i==null?void 0:i.entities[`${(w=n.value)==null?void 0:w.base_model}/onnx/${(S=n.value)==null?void 0:S.model_name}`]))??null},[(g=n.value)==null?void 0:g.base_model,(x=n.value)==null?void 0:x.model_name,l==null?void 0:l.entities,i==null?void 0:i.entities]),h=d.useCallback(y=>{if(!y)return;const b=Og(y);b&&r(SI({nodeId:t,fieldName:n.name,value:b}))},[r,n.name,t]);return u?a.jsx(nn,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs(L,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{className:"nowheel nodrag",tooltip:m==null?void 0:m.description,value:m==null?void 0:m.id,placeholder:p.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:p,error:!m,disabled:p.length===0,onChange:h,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Gc,{className:"nodrag",iconMode:!0})]})},Kae=d.memo(Gae),qae=le([xe],({ui:e})=>{const{favoriteSchedulers:t}=e;return{data:nr(mh,(r,o)=>({value:o,label:r,group:t.includes(o)?"Favorites":void 0})).sort((r,o)=>r.label.localeCompare(o.label))}},Se),Xae=e=>{const{nodeId:t,field:n}=e,r=te(),{data:o}=W(qae),s=d.useCallback(i=>{i&&r(pA({nodeId:t,fieldName:n.name,value:i}))},[r,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",value:n.value,data:o,onChange:s})},Qae=d.memo(Xae),Yae=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(i=>{o(mA({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return r.ui_component==="textarea"?a.jsx(da,{className:"nodrag",onChange:s,value:n.value,rows:5,resize:"none"}):a.jsx(vo,{onChange:s,value:n.value})},Zae=d.memo(Yae),jO=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=hA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({vaeModelId:e,errors:s.error.format()},"Failed to parse VAE model id");return}return s.data},Jae=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=kI(),i=d.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Rn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p.sort((m,h)=>m.disabled&&!h.disabled?1:-1)},[s]),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r]),u=d.useCallback(p=>{if(!p)return;const m=jO(p);m&&o(gA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",itemComponent:ui,tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??"default",placeholder:"Default",data:i,onChange:u,disabled:i.length===0,error:!l,clearable:!0,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},eie=d.memo(Jae),_O=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=vA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({ipAdapterModelId:e,errors:s.error.format()},"Failed to parse IP-Adapter model id");return}return s.data},tie=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Ux(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/ip_adapter/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Rn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=_O(p);m&&o(xA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(Pn,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:u,sx:{width:"100%"}})},nie=d.memo(tie),rie=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=bA.safeParse({base_model:n,model_name:o});if(!s.success){t.error({t2iAdapterModelId:e,errors:s.error.format()},"Failed to parse T2I-Adapter model id");return}return s.data},oie=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=yA(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/t2i_adapter/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Rn(s.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const m=rie(p);m&&o(CA({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return a.jsx(Pn,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:u,sx:{width:"100%"}})},sie=d.memo(oie),aie=e=>{var l;const{nodeId:t,field:n}=e,r=te(),{data:o,hasBoards:s}=yd(void 0,{selectFromResult:({data:u})=>{const p=[{label:"None",value:"none"}];return u==null||u.forEach(({board_id:m,board_name:h})=>{p.push({label:h,value:m})}),{data:p,hasBoards:p.length>1}}}),i=d.useCallback(u=>{r(wA({nodeId:t,fieldName:n.name,value:u&&u!=="none"?{board_id:u}:void 0}))},[r,n.name,t]);return a.jsx(nn,{className:"nowheel nodrag",value:((l=n.value)==null?void 0:l.board_id)??"none",data:o,onChange:i,disabled:!s})},iie=d.memo(aie),lie=({nodeId:e,fieldName:t})=>{const n=mO(e,t),r=Pg(e,t,"input");return(r==null?void 0:r.fieldKind)==="output"?a.jsxs(Ie,{p:2,children:["Output field in input: ",n==null?void 0:n.type]}):(n==null?void 0:n.type)==="string"&&(r==null?void 0:r.type)==="string"||(n==null?void 0:n.type)==="StringPolymorphic"&&(r==null?void 0:r.type)==="StringPolymorphic"?a.jsx(Zae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"||(n==null?void 0:n.type)==="BooleanPolymorphic"&&(r==null?void 0:r.type)==="BooleanPolymorphic"?a.jsx(vae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="integer"&&(r==null?void 0:r.type)==="integer"||(n==null?void 0:n.type)==="float"&&(r==null?void 0:r.type)==="float"||(n==null?void 0:n.type)==="FloatPolymorphic"&&(r==null?void 0:r.type)==="FloatPolymorphic"||(n==null?void 0:n.type)==="IntegerPolymorphic"&&(r==null?void 0:r.type)==="IntegerPolymorphic"?a.jsx(Vae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="enum"&&(r==null?void 0:r.type)==="enum"?a.jsx(Aae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"||(n==null?void 0:n.type)==="ImagePolymorphic"&&(r==null?void 0:r.type)==="ImagePolymorphic"?a.jsx(Nae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="BoardField"&&(r==null?void 0:r.type)==="BoardField"?a.jsx(iie,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="MainModelField"&&(r==null?void 0:r.type)==="MainModelField"?a.jsx(Bae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLRefinerModelField"&&(r==null?void 0:r.type)==="SDXLRefinerModelField"?a.jsx(Uae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeModelField"&&(r==null?void 0:r.type)==="VaeModelField"?a.jsx(eie,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(zae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(Rae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="IPAdapterModelField"&&(r==null?void 0:r.type)==="IPAdapterModelField"?a.jsx(nie,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="T2IAdapterModelField"&&(r==null?void 0:r.type)==="T2IAdapterModelField"?a.jsx(sie,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(Mae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLMainModelField"&&(r==null?void 0:r.type)==="SDXLMainModelField"?a.jsx(Kae,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(Qae,{nodeId:e,field:n,fieldTemplate:r}):n&&r?null:a.jsx(Ie,{p:1,children:a.jsxs(ve,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},IO=d.memo(lie),cie=({nodeId:e,fieldName:t})=>{const n=te(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=dO(e),{t:i}=Z(),l=d.useCallback(()=>{n(jI({nodeId:e,fieldName:t}))},[n,t,e]);return a.jsxs(L,{onMouseEnter:s,onMouseLeave:o,layerStyle:"second",sx:{position:"relative",borderRadius:"base",w:"full",p:2},children:[a.jsxs(Kt,{as:L,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(wn,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(hO,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(ba,{}),a.jsx(Ft,{label:a.jsx(r2,{nodeId:e,fieldName:t,kind:"input"}),openDelay:yh,placement:"top",hasArrow:!0,children:a.jsx(L,{h:"full",alignItems:"center",children:a.jsx(Nn,{as:dM})})}),a.jsx(Fe,{"aria-label":i("nodes.removeLinearView"),tooltip:i("nodes.removeLinearView"),variant:"ghost",size:"sm",onClick:l,icon:a.jsx(Br,{})})]}),a.jsx(IO,{nodeId:e,fieldName:t})]}),a.jsx(uO,{isSelected:!1,isHovered:r})]})},uie=d.memo(cie),die=le(xe,({nodes:e})=>({fields:e.workflow.exposedFields}),Se),fie=()=>{const{fields:e}=W(die),{t}=Z();return a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Zd,{children:a.jsx(L,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:e.length?e.map(({nodeId:n,fieldName:r})=>a.jsx(uie,{nodeId:n,fieldName:r},`${n}.${r}`)):a.jsx(Zn,{label:t("nodes.noFieldsLinearview"),icon:null})})})})},pie=d.memo(fie),mie=()=>a.jsx(L,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(rl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ol,{children:[a.jsx(Tr,{children:"Linear"}),a.jsx(Tr,{children:"Details"}),a.jsx(Tr,{children:"JSON"})]}),a.jsxs(zc,{children:[a.jsx(So,{children:a.jsx(pie,{})}),a.jsx(So,{children:a.jsx(iae,{})}),a.jsx(So,{children:a.jsx(fae,{})})]})]})}),hie=d.memo(mie),gie={paramNegativeConditioning:{placement:"right"},controlNet:{href:"https://support.invoke.ai/support/solutions/articles/151000105880"},lora:{href:"https://support.invoke.ai/support/solutions/articles/151000159072"},compositingCoherenceMode:{href:"https://support.invoke.ai/support/solutions/articles/151000158838"},infillMethod:{href:"https://support.invoke.ai/support/solutions/articles/151000158841"},scaleBeforeProcessing:{href:"https://support.invoke.ai/support/solutions/articles/151000158841"},paramIterations:{href:"https://support.invoke.ai/support/solutions/articles/151000159073"},paramPositiveConditioning:{href:"https://support.invoke.ai/support/solutions/articles/151000096606-tips-on-crafting-prompts",placement:"right"},paramScheduler:{placement:"right",href:"https://support.invoke.ai/support/solutions/articles/151000159073"},paramModel:{placement:"right",href:"https://support.invoke.ai/support/solutions/articles/151000096601-what-is-a-model-which-should-i-use-"},paramRatio:{gutter:16},controlNetControlMode:{placement:"right"},controlNetResizeMode:{placement:"right"},paramVAE:{placement:"right"},paramVAEPrecision:{placement:"right"}},vie=1e3,xie=[{name:"preventOverflow",options:{padding:10}}],PO=je(({feature:e,children:t,wrapperProps:n,...r},o)=>{const{t:s}=Z(),i=W(g=>g.system.shouldEnableInformationalPopovers),l=d.useMemo(()=>gie[e],[e]),u=d.useMemo(()=>SA(kA(l,["image","href","buttonLabel"]),r),[l,r]),p=d.useMemo(()=>s(`popovers.${e}.heading`),[e,s]),m=d.useMemo(()=>s(`popovers.${e}.paragraphs`,{returnObjects:!0})??[],[e,s]),h=d.useCallback(()=>{l!=null&&l.href&&window.open(l.href)},[l==null?void 0:l.href]);return i?a.jsxs(Ld,{isLazy:!0,closeOnBlur:!1,trigger:"hover",variant:"informational",openDelay:vie,modifiers:xie,placement:"top",...u,children:[a.jsx(Wh,{children:a.jsx(Ie,{ref:o,w:"full",...n,children:t})}),a.jsx(Ac,{children:a.jsxs(zd,{w:96,children:[a.jsx(H3,{}),a.jsx(Uh,{children:a.jsxs(L,{sx:{gap:2,flexDirection:"column",alignItems:"flex-start"},children:[p&&a.jsxs(a.Fragment,{children:[a.jsx(cr,{size:"sm",children:p}),a.jsx(Yn,{})]}),(l==null?void 0:l.image)&&a.jsxs(a.Fragment,{children:[a.jsx(ga,{sx:{objectFit:"contain",maxW:"60%",maxH:"60%",backgroundColor:"white"},src:l.image,alt:"Optional Image"}),a.jsx(Yn,{})]}),m.map(g=>a.jsx(ve,{children:g},g)),(l==null?void 0:l.href)&&a.jsxs(a.Fragment,{children:[a.jsx(Yn,{}),a.jsx(Za,{pt:1,onClick:h,leftIcon:a.jsx(hy,{}),alignSelf:"flex-end",variant:"link",children:s("common.learnMore")??p})]})]})})]})})]}):a.jsx(Ie,{ref:o,w:"full",...n,children:t})});PO.displayName="IAIInformationalPopover";const Et=d.memo(PO),bie=le([xe],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:i}=e.config.sd.iterations,{iterations:l}=e.generation,{shouldUseSliders:u}=e.ui,p=e.hotkeys.shift?s:i;return{iterations:l,initial:t,min:n,sliderMax:r,inputMax:o,step:p,shouldUseSliders:u}},Se),yie=({asSlider:e})=>{const{iterations:t,initial:n,min:r,sliderMax:o,inputMax:s,step:i,shouldUseSliders:l}=W(bie),u=te(),{t:p}=Z(),m=d.useCallback(g=>{u(yw(g))},[u]),h=d.useCallback(()=>{u(yw(n))},[u,n]);return e||l?a.jsx(Et,{feature:"paramIterations",children:a.jsx(tt,{label:p("parameters.iterations"),step:i,min:r,max:o,onChange:m,handleReset:h,value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s}})}):a.jsx(Et,{feature:"paramIterations",children:a.jsx(Kc,{label:p("parameters.iterations"),step:i,min:r,max:s,onChange:m,value:t,numberInputFieldProps:{textAlign:"center"}})})},rs=d.memo(yie),Cie=()=>{const[e,t]=d.useState(!1),[n,r]=d.useState(!1),o=d.useRef(null),s=t2(),i=d.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs(L,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(X8,{}),a.jsx(L,{layerStyle:"first",sx:{w:"full",position:"relative",borderRadius:"base",p:2,pb:3,gap:2,flexDir:"column"},children:a.jsx(rs,{asSlider:!0})}),a.jsxs(Ig,{ref:o,id:"workflow-panel-group",autoSaveId:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Qa,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(hie,{})}),a.jsx(lh,{direction:"vertical",onDoubleClick:i,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Qa,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(tae,{})})]})]})},wie=d.memo(Cie),Jj=(e,t)=>{const n=d.useRef(null),[r,o]=d.useState(()=>{var p;return!!((p=n.current)!=null&&p.getCollapsed())}),s=d.useCallback(()=>{var p;(p=n.current)!=null&&p.getCollapsed()?qr.flushSync(()=>{var m;(m=n.current)==null||m.expand()}):qr.flushSync(()=>{var m;(m=n.current)==null||m.collapse()})},[]),i=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),l=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),u=d.useCallback(()=>{qr.flushSync(()=>{var p;(p=n.current)==null||p.resize(e,t)})},[e,t]);return{ref:n,minSize:e,isCollapsed:r,setIsCollapsed:o,reset:u,toggle:s,expand:i,collapse:l}},Sie=({isGalleryCollapsed:e,galleryPanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(Ac,{children:a.jsx(L,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineEnd:"1.63rem",children:a.jsx(Fe,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":n("accessibility.showGalleryPanel"),onClick:r,icon:a.jsx(koe,{}),sx:{p:0,px:3,h:48,borderEndRadius:0}})})}):null},kie=d.memo(Sie),Op={borderStartRadius:0,flexGrow:1},jie=({isSidePanelCollapsed:e,sidePanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(Ac,{children:a.jsxs(L,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"5.13rem",direction:"column",gap:2,h:48,children:[a.jsxs(Vt,{isAttached:!0,orientation:"vertical",flexGrow:3,children:[a.jsx(Fe,{tooltip:n("parameters.showOptionsPanel"),"aria-label":n("parameters.showOptionsPanel"),onClick:r,sx:Op,icon:a.jsx(vM,{})}),a.jsx(G8,{asIconButton:!0,sx:Op}),a.jsx(B8,{asIconButton:!0,sx:Op})]}),a.jsx(Qy,{asIconButton:!0,sx:Op})]})}):null},_ie=d.memo(jie),Iie=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=Lr({defaultIsOpen:o}),{colorMode:l}=ha();return a.jsxs(Ie,{children:[a.jsxs(L,{onClick:i,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:Ae("base.250","base.750")(l),color:Ae("base.900","base.100")(l),_hover:{bg:Ae("base.300","base.700")(l)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},"data-testid":`${t} collapsible`,children:[t,a.jsx(dr,{children:n&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(ve,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(ba,{}),a.jsx(gg,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(Id,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:a.jsx(Ie,{sx:{p:4,pb:4,borderBottomRadius:"base",bg:"base.150",_dark:{bg:"base.800"}},children:r})})]})},oo=d.memo(Iie),Pie=le(xe,e=>{const{maxPrompts:t,combinatorial:n}=e.dynamicPrompts,{min:r,sliderMax:o,inputMax:s}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:r,sliderMax:o,inputMax:s,isDisabled:!n}},Se),Eie=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=W(Pie),s=te(),{t:i}=Z(),l=d.useCallback(p=>{s(jA(p))},[s]),u=d.useCallback(()=>{s(_A())},[s]);return a.jsx(Et,{feature:"dynamicPromptsMaxPrompts",children:a.jsx(tt,{label:i("dynamicPrompts.maxPrompts"),isDisabled:o,min:t,max:n,value:e,onChange:l,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})})},Mie=d.memo(Eie),Oie=le(xe,e=>{const{isLoading:t,isError:n,prompts:r,parsingError:o}=e.dynamicPrompts;return{prompts:r,parsingError:o,isError:n,isLoading:t}},Se),Rie={"&::marker":{color:"base.500",_dark:{color:"base.500"}}},Die=()=>{const{prompts:e,parsingError:t,isLoading:n,isError:r}=W(Oie);return r?a.jsx(Et,{feature:"dynamicPrompts",children:a.jsx(L,{w:"full",h:"full",layerStyle:"second",alignItems:"center",justifyContent:"center",p:8,children:a.jsx(Zn,{icon:xoe,label:"Problem generating prompts"})})}):a.jsx(Et,{feature:"dynamicPrompts",children:a.jsxs(Kt,{isInvalid:!!t,children:[a.jsxs(wn,{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",children:["Prompts Preview (",e.length,")",t&&` - ${t}`]}),a.jsxs(L,{h:64,pos:"relative",layerStyle:"third",borderRadius:"base",p:2,children:[a.jsx(Zd,{children:a.jsx(u3,{stylePosition:"inside",ms:0,children:e.map((o,s)=>a.jsx(Qr,{fontSize:"sm",sx:Rie,children:a.jsx(ve,{as:"span",children:o})},`${o}.${s}`))})}),n&&a.jsx(L,{pos:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,layerStyle:"second",opacity:.7,alignItems:"center",justifyContent:"center",children:a.jsx(fa,{})})]})]})})},Aie=d.memo(Die),EO=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx(Ie,{ref:r,...n,children:a.jsxs(Ie,{children:[a.jsx(ve,{fontWeight:600,children:e}),t&&a.jsx(ve,{size:"xs",variant:"subtext",children:t})]})}));EO.displayName="IAIMantineSelectItemWithDescription";const Tie=d.memo(EO),Nie=()=>{const e=te(),{t}=Z(),n=W(s=>s.dynamicPrompts.seedBehaviour),r=d.useMemo(()=>[{value:"PER_ITERATION",label:t("dynamicPrompts.seedBehaviour.perIterationLabel"),description:t("dynamicPrompts.seedBehaviour.perIterationDesc")},{value:"PER_PROMPT",label:t("dynamicPrompts.seedBehaviour.perPromptLabel"),description:t("dynamicPrompts.seedBehaviour.perPromptDesc")}],[t]),o=d.useCallback(s=>{s&&e(IA(s))},[e]);return a.jsx(Et,{feature:"dynamicPromptsSeedBehaviour",children:a.jsx(Pn,{label:t("dynamicPrompts.seedBehaviour.label"),value:n,data:r,itemComponent:Tie,onChange:o})})},$ie=d.memo(Nie),Lie=()=>{const{t:e}=Z(),t=d.useMemo(()=>le(xe,({dynamicPrompts:o})=>{const s=o.prompts.length;return s===1?e("dynamicPrompts.promptsWithCount_one",{count:s}):e("dynamicPrompts.promptsWithCount_other",{count:s})}),[e]),n=W(t);return Ht("dynamicPrompting").isFeatureEnabled?a.jsx(oo,{label:e("dynamicPrompts.dynamicPrompts"),activeLabel:n,children:a.jsxs(L,{sx:{gap:2,flexDir:"column"},children:[a.jsx(Aie,{}),a.jsx($ie,{}),a.jsx(Mie,{})]})}):null},qc=d.memo(Lie),zie=e=>{const t=te(),{lora:n}=e,r=d.useCallback(i=>{t(PA({id:n.id,weight:i}))},[t,n.id]),o=d.useCallback(()=>{t(EA(n.id))},[t,n.id]),s=d.useCallback(()=>{t(MA(n.id))},[t,n.id]);return a.jsx(Et,{feature:"lora",children:a.jsxs(L,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(tt,{label:n.model_name,value:n.weight,onChange:r,min:-1,max:2,step:.01,withInput:!0,withReset:!0,handleReset:o,withSliderMarks:!0,sliderMarks:[-1,0,1,2],sliderNumberInputProps:{min:-50,max:50}}),a.jsx(Fe,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(Br,{}),colorScheme:"error"})]})})},Fie=d.memo(zie),Bie=le(xe,({lora:e})=>({lorasArray:nr(e.loras)}),Se),Hie=()=>{const{lorasArray:e}=W(Bie);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(Yn,{pt:1}),a.jsx(Fie,{lora:t})]},t.model_name))})},Vie=d.memo(Hie),Wie=le(xe,({lora:e})=>({loras:e.loras}),Se),Uie=()=>{const e=te(),{loras:t}=W(Wie),{data:n}=Cd(),r=W(i=>i.generation.model),o=d.useMemo(()=>{if(!n)return[];const i=[];return Rn(n.entities,(l,u)=>{if(!l||u in t)return;const p=(r==null?void 0:r.base_model)!==l.base_model;i.push({value:u,label:l.model_name,disabled:p,group:an[l.base_model],tooltip:p?`Incompatible base model: ${l.base_model}`:void 0})}),i.sort((l,u)=>l.label&&!u.label?1:-1),i.sort((l,u)=>l.disabled&&!u.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=d.useCallback(i=>{if(!i)return;const l=n==null?void 0:n.entities[i];l&&e(OA(l))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx(L,{sx:{justifyContent:"center",p:2},children:a.jsx(ve,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(nn,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:ui,disabled:o.length===0,filter:(i,l)=>{var u;return((u=l.label)==null?void 0:u.toLowerCase().includes(i.toLowerCase().trim()))||l.value.toLowerCase().includes(i.toLowerCase().trim())},onChange:s,"data-testid":"add-lora"})},Gie=d.memo(Uie),Kie=le(xe,e=>{const t=_I(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Se),qie=()=>{const{activeLabel:e}=W(Kie);return Ht("lora").isFeatureEnabled?a.jsx(oo,{label:"LoRA",activeLabel:e,children:a.jsxs(L,{sx:{flexDir:"column",gap:2},children:[a.jsx(Gie,{}),a.jsx(Vie,{})]})}):null},Xc=d.memo(qie),Xie=()=>{const e=te(),t=W(o=>o.generation.shouldUseCpuNoise),{t:n}=Z(),r=d.useCallback(o=>{e(RA(o.target.checked))},[e]);return a.jsx(Et,{feature:"noiseUseCPU",children:a.jsx(fn,{label:n("parameters.useCpuNoise"),isChecked:t,onChange:r})})},os=e=>e.generation,Qie=le(os,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Se),Yie=()=>{const{t:e}=Z(),{seamlessXAxis:t}=W(Qie),n=te(),r=d.useCallback(o=>{n(DA(o.target.checked))},[n]);return a.jsx(fn,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},Zie=d.memo(Yie),Jie=le(os,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Se),ele=()=>{const{t:e}=Z(),{seamlessYAxis:t}=W(Jie),n=te(),r=d.useCallback(o=>{n(AA(o.target.checked))},[n]);return a.jsx(fn,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},tle=d.memo(ele),nle=()=>{const{t:e}=Z();return Ht("seamless").isFeatureEnabled?a.jsxs(Kt,{children:[a.jsx(wn,{children:e("parameters.seamlessTiling")})," ",a.jsxs(L,{sx:{gap:5},children:[a.jsx(Ie,{flexGrow:1,children:a.jsx(Zie,{})}),a.jsx(Ie,{flexGrow:1,children:a.jsx(tle,{})})]})]}):null},rle=d.memo(nle);function ole(){const e=W(u=>u.generation.clipSkip),{model:t}=W(u=>u.generation),n=te(),{t:r}=Z(),o=d.useCallback(u=>{n(Cw(u))},[n]),s=d.useCallback(()=>{n(Cw(0))},[n]),i=d.useMemo(()=>t?Qf[t.base_model].maxClip:Qf["sd-1"].maxClip,[t]),l=d.useMemo(()=>t?Qf[t.base_model].markers:Qf["sd-1"].markers,[t]);return(t==null?void 0:t.base_model)==="sdxl"?null:a.jsx(Et,{feature:"clipSkip",placement:"top",children:a.jsx(tt,{label:r("parameters.clipSkip"),"aria-label":r("parameters.clipSkip"),min:0,max:i,step:1,value:e,onChange:o,withSliderMarks:!0,sliderMarks:l,withInput:!0,withReset:!0,handleReset:s})})}const sle=le(xe,e=>{const{clipSkip:t,model:n,seamlessXAxis:r,seamlessYAxis:o,shouldUseCpuNoise:s}=e.generation;return{clipSkip:t,model:n,seamlessXAxis:r,seamlessYAxis:o,shouldUseCpuNoise:s}},Se);function Qc(){const{clipSkip:e,model:t,seamlessXAxis:n,seamlessYAxis:r,shouldUseCpuNoise:o}=W(sle),{t:s}=Z(),i=d.useMemo(()=>{const l=[];return o?l.push(s("parameters.cpuNoise")):l.push(s("parameters.gpuNoise")),e>0&&t&&t.base_model!=="sdxl"&&l.push(s("parameters.clipSkipWithLayerCount",{layerCount:e})),n&&r?l.push(s("parameters.seamlessX&Y")):n?l.push(s("parameters.seamlessX")):r&&l.push(s("parameters.seamlessY")),l.join(", ")},[e,t,n,r,o,s]);return a.jsx(oo,{label:s("common.advanced"),activeLabel:i,children:a.jsxs(L,{sx:{flexDir:"column",gap:2},children:[a.jsx(rle,{}),a.jsx(Yn,{}),t&&(t==null?void 0:t.base_model)!=="sdxl"&&a.jsxs(a.Fragment,{children:[a.jsx(ole,{}),a.jsx(Yn,{pt:2})]}),a.jsx(Xie,{})]})})}const ale=le(xe,({generation:e})=>{const{model:t}=e;return{mainModel:t}},Se),ile=e=>{const{controlNetId:t,model:n,isEnabled:r}=e.controlNet,o=te(),{mainModel:s}=W(ale),{t:i}=Z(),{data:l}=gh(),u=d.useMemo(()=>{if(!l)return[];const h=[];return Rn(l.entities,(g,x)=>{if(!g)return;const y=(g==null?void 0:g.base_model)!==(s==null?void 0:s.base_model);h.push({value:x,label:g.model_name,group:an[g.base_model],disabled:y,tooltip:y?`${i("controlnet.incompatibleBaseModel")} ${g.base_model}`:void 0})}),h},[l,s==null?void 0:s.base_model,i]),p=d.useMemo(()=>(l==null?void 0:l.entities[`${n==null?void 0:n.base_model}/controlnet/${n==null?void 0:n.model_name}`])??null,[n==null?void 0:n.base_model,n==null?void 0:n.model_name,l==null?void 0:l.entities]),m=d.useCallback(h=>{if(!h)return;const g=CO(h);g&&o(II({controlNetId:t,model:g}))},[t,o]);return a.jsx(nn,{itemComponent:ui,data:u,error:!p||(s==null?void 0:s.base_model)!==p.base_model,placeholder:i("controlnet.selectModel"),value:(p==null?void 0:p.id)??null,onChange:m,disabled:!r,tooltip:p==null?void 0:p.description})},lle=d.memo(ile),cle=e=>{const{weight:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),{t:s}=Z(),i=d.useCallback(l=>{o(TA({controlNetId:r,weight:l}))},[r,o]);return a.jsx(Et,{feature:"controlNetWeight",children:a.jsx(tt,{isDisabled:!n,label:s("controlnet.weight"),value:t,onChange:i,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})})},ule=d.memo(cle),dle=le(xe,({controlNet:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},Se),fle=({isSmall:e,controlNet:t})=>{const{controlImage:n,processedControlImage:r,processorType:o,controlNetId:s}=t,i=te(),{t:l}=Z(),{pendingControlImages:u,autoAddBoardId:p}=W(dle),m=W(Jn),[h,g]=d.useState(!1),{currentData:x}=to(n??$r.skipToken),{currentData:y}=to(r??$r.skipToken),[b]=NA(),[w]=$A(),[S]=LA(),j=d.useCallback(()=>{i(zA({controlNetId:s,controlImage:null}))},[s,i]),_=d.useCallback(async()=>{y&&(await b({imageDTO:y,is_intermediate:!1}).unwrap(),p!=="none"?w({imageDTO:y,board_id:p}):S({imageDTO:y}))},[y,b,p,w,S]),E=d.useCallback(()=>{x&&(m==="unifiedCanvas"?i(Vo({width:x.width,height:x.height})):(i(Hi(x.width)),i(Vi(x.height))))},[x,m,i]),I=d.useCallback(()=>{g(!0)},[]),M=d.useCallback(()=>{g(!1)},[]),R=d.useMemo(()=>{if(x)return{id:s,payloadType:"IMAGE_DTO",payload:{imageDTO:x}}},[x,s]),D=d.useMemo(()=>({id:s,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:s}}),[s]),A=d.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:s}),[s]),O=x&&y&&!h&&!u.includes(s)&&o!=="none";return a.jsxs(L,{onMouseEnter:I,onMouseLeave:M,sx:{position:"relative",w:"full",h:e?28:366,alignItems:"center",justifyContent:"center"},children:[a.jsx(ua,{draggableData:R,droppableData:D,imageDTO:x,isDropDisabled:O,postUploadAction:A}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:O?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(ua,{draggableData:R,droppableData:D,imageDTO:y,isUploadDisabled:!0})}),a.jsxs(a.Fragment,{children:[a.jsx(zi,{onClick:j,icon:x?a.jsx(Ud,{}):void 0,tooltip:l("controlnet.resetControlImage")}),a.jsx(zi,{onClick:_,icon:x?a.jsx(lg,{size:16}):void 0,tooltip:l("controlnet.saveControlImage"),styleOverrides:{marginTop:6}}),a.jsx(zi,{onClick:E,icon:x?a.jsx(tee,{size:16}):void 0,tooltip:l("controlnet.setControlImageDimensions"),styleOverrides:{marginTop:12}})]}),u.includes(s)&&a.jsx(L,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",alignItems:"center",justifyContent:"center",opacity:.8,borderRadius:"base",bg:"base.400",_dark:{bg:"base.900"}},children:a.jsx(fa,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},e_=d.memo(fle),Io=()=>{const e=te();return d.useCallback((n,r)=>{e(FA({controlNetId:n,changes:r}))},[e])};function Po(e){return a.jsx(L,{sx:{flexDirection:"column",gap:2,pb:2},children:e.children})}const t_=Fr.canny_image_processor.default,ple=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{low_threshold:g})},[t,i]),p=d.useCallback(()=>{i(t,{low_threshold:t_.low_threshold})},[t,i]),m=d.useCallback(g=>{i(t,{high_threshold:g})},[t,i]),h=d.useCallback(()=>{i(t,{high_threshold:t_.high_threshold})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{isDisabled:!r,label:l("controlnet.lowThreshold"),value:o,onChange:u,handleReset:p,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(tt,{isDisabled:!r,label:l("controlnet.highThreshold"),value:s,onChange:m,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},mle=d.memo(ple),hle=Fr.color_map_image_processor.default,gle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{color_map_tile_size:o}=n,s=Io(),{t:i}=Z(),l=d.useCallback(p=>{s(t,{color_map_tile_size:p})},[t,s]),u=d.useCallback(()=>{s(t,{color_map_tile_size:hle.color_map_tile_size})},[t,s]);return a.jsx(Po,{children:a.jsx(tt,{isDisabled:!r,label:i("controlnet.colorMapTileSize"),value:o,onChange:l,handleReset:u,withReset:!0,min:1,max:256,step:1,withInput:!0,withSliderMarks:!0,sliderNumberInputProps:{max:4096}})})},vle=d.memo(gle),_u=Fr.content_shuffle_image_processor.default,xle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:i,h:l,f:u}=n,p=Io(),{t:m}=Z(),h=d.useCallback(I=>{p(t,{detect_resolution:I})},[t,p]),g=d.useCallback(()=>{p(t,{detect_resolution:_u.detect_resolution})},[t,p]),x=d.useCallback(I=>{p(t,{image_resolution:I})},[t,p]),y=d.useCallback(()=>{p(t,{image_resolution:_u.image_resolution})},[t,p]),b=d.useCallback(I=>{p(t,{w:I})},[t,p]),w=d.useCallback(()=>{p(t,{w:_u.w})},[t,p]),S=d.useCallback(I=>{p(t,{h:I})},[t,p]),j=d.useCallback(()=>{p(t,{h:_u.h})},[t,p]),_=d.useCallback(I=>{p(t,{f:I})},[t,p]),E=d.useCallback(()=>{p(t,{f:_u.f})},[t,p]);return a.jsxs(Po,{children:[a.jsx(tt,{label:m("controlnet.detectResolution"),value:s,onChange:h,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:m("controlnet.imageResolution"),value:o,onChange:x,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:m("controlnet.w"),value:i,onChange:b,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:m("controlnet.h"),value:l,onChange:S,handleReset:j,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:m("controlnet.f"),value:u,onChange:_,handleReset:E,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},ble=d.memo(xle),n_=Fr.hed_image_processor.default,yle=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,i=Io(),{t:l}=Z(),u=d.useCallback(x=>{i(t,{detect_resolution:x})},[t,i]),p=d.useCallback(x=>{i(t,{image_resolution:x})},[t,i]),m=d.useCallback(x=>{i(t,{scribble:x.target.checked})},[t,i]),h=d.useCallback(()=>{i(t,{detect_resolution:n_.detect_resolution})},[t,i]),g=d.useCallback(()=>{i(t,{image_resolution:n_.image_resolution})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.detectResolution"),value:n,onChange:u,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(tt,{label:l("controlnet.imageResolution"),value:r,onChange:p,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(fn,{label:l("controlnet.scribble"),isChecked:o,onChange:m,isDisabled:!s})]})},Cle=d.memo(yle),r_=Fr.lineart_anime_image_processor.default,wle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{detect_resolution:g})},[t,i]),p=d.useCallback(g=>{i(t,{image_resolution:g})},[t,i]),m=d.useCallback(()=>{i(t,{detect_resolution:r_.detect_resolution})},[t,i]),h=d.useCallback(()=>{i(t,{image_resolution:r_.image_resolution})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.detectResolution"),value:s,onChange:u,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:l("controlnet.imageResolution"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Sle=d.memo(wle),o_=Fr.lineart_image_processor.default,kle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:i}=n,l=Io(),{t:u}=Z(),p=d.useCallback(y=>{l(t,{detect_resolution:y})},[t,l]),m=d.useCallback(y=>{l(t,{image_resolution:y})},[t,l]),h=d.useCallback(()=>{l(t,{detect_resolution:o_.detect_resolution})},[t,l]),g=d.useCallback(()=>{l(t,{image_resolution:o_.image_resolution})},[t,l]),x=d.useCallback(y=>{l(t,{coarse:y.target.checked})},[t,l]);return a.jsxs(Po,{children:[a.jsx(tt,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:u("controlnet.imageResolution"),value:o,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(fn,{label:u("controlnet.coarse"),isChecked:i,onChange:x,isDisabled:!r})]})},jle=d.memo(kle),s_=Fr.mediapipe_face_processor.default,_le=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{max_faces:g})},[t,i]),p=d.useCallback(g=>{i(t,{min_confidence:g})},[t,i]),m=d.useCallback(()=>{i(t,{max_faces:s_.max_faces})},[t,i]),h=d.useCallback(()=>{i(t,{min_confidence:s_.min_confidence})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.maxFaces"),value:o,onChange:u,handleReset:m,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:l("controlnet.minConfidence"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Ile=d.memo(_le),a_=Fr.midas_depth_image_processor.default,Ple=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{a_mult:g})},[t,i]),p=d.useCallback(g=>{i(t,{bg_th:g})},[t,i]),m=d.useCallback(()=>{i(t,{a_mult:a_.a_mult})},[t,i]),h=d.useCallback(()=>{i(t,{bg_th:a_.bg_th})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.amult"),value:o,onChange:u,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:l("controlnet.bgth"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Ele=d.memo(Ple),Rp=Fr.mlsd_image_processor.default,Mle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:i,thr_v:l}=n,u=Io(),{t:p}=Z(),m=d.useCallback(j=>{u(t,{detect_resolution:j})},[t,u]),h=d.useCallback(j=>{u(t,{image_resolution:j})},[t,u]),g=d.useCallback(j=>{u(t,{thr_d:j})},[t,u]),x=d.useCallback(j=>{u(t,{thr_v:j})},[t,u]),y=d.useCallback(()=>{u(t,{detect_resolution:Rp.detect_resolution})},[t,u]),b=d.useCallback(()=>{u(t,{image_resolution:Rp.image_resolution})},[t,u]),w=d.useCallback(()=>{u(t,{thr_d:Rp.thr_d})},[t,u]),S=d.useCallback(()=>{u(t,{thr_v:Rp.thr_v})},[t,u]);return a.jsxs(Po,{children:[a.jsx(tt,{label:p("controlnet.detectResolution"),value:s,onChange:m,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:p("controlnet.imageResolution"),value:o,onChange:h,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:p("controlnet.w"),value:i,onChange:g,handleReset:w,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:p("controlnet.h"),value:l,onChange:x,handleReset:S,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Ole=d.memo(Mle),i_=Fr.normalbae_image_processor.default,Rle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=Io(),{t:l}=Z(),u=d.useCallback(g=>{i(t,{detect_resolution:g})},[t,i]),p=d.useCallback(g=>{i(t,{image_resolution:g})},[t,i]),m=d.useCallback(()=>{i(t,{detect_resolution:i_.detect_resolution})},[t,i]),h=d.useCallback(()=>{i(t,{image_resolution:i_.image_resolution})},[t,i]);return a.jsxs(Po,{children:[a.jsx(tt,{label:l("controlnet.detectResolution"),value:s,onChange:u,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:l("controlnet.imageResolution"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r})]})},Dle=d.memo(Rle),l_=Fr.openpose_image_processor.default,Ale=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:i}=n,l=Io(),{t:u}=Z(),p=d.useCallback(y=>{l(t,{detect_resolution:y})},[t,l]),m=d.useCallback(y=>{l(t,{image_resolution:y})},[t,l]),h=d.useCallback(()=>{l(t,{detect_resolution:l_.detect_resolution})},[t,l]),g=d.useCallback(()=>{l(t,{image_resolution:l_.image_resolution})},[t,l]),x=d.useCallback(y=>{l(t,{hand_and_face:y.target.checked})},[t,l]);return a.jsxs(Po,{children:[a.jsx(tt,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:u("controlnet.imageResolution"),value:o,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(fn,{label:u("controlnet.handAndFace"),isChecked:i,onChange:x,isDisabled:!r})]})},Tle=d.memo(Ale),c_=Fr.pidi_image_processor.default,Nle=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:i,safe:l}=n,u=Io(),{t:p}=Z(),m=d.useCallback(w=>{u(t,{detect_resolution:w})},[t,u]),h=d.useCallback(w=>{u(t,{image_resolution:w})},[t,u]),g=d.useCallback(()=>{u(t,{detect_resolution:c_.detect_resolution})},[t,u]),x=d.useCallback(()=>{u(t,{image_resolution:c_.image_resolution})},[t,u]),y=d.useCallback(w=>{u(t,{scribble:w.target.checked})},[t,u]),b=d.useCallback(w=>{u(t,{safe:w.target.checked})},[t,u]);return a.jsxs(Po,{children:[a.jsx(tt,{label:p("controlnet.detectResolution"),value:s,onChange:m,handleReset:g,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(tt,{label:p("controlnet.imageResolution"),value:o,onChange:h,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!r}),a.jsx(fn,{label:p("controlnet.scribble"),isChecked:i,onChange:y}),a.jsx(fn,{label:p("controlnet.safe"),isChecked:l,onChange:b,isDisabled:!r})]})},$le=d.memo(Nle),Lle=e=>null,zle=d.memo(Lle),Fle=e=>{const{controlNetId:t,isEnabled:n,processorNode:r}=e.controlNet;return r.type==="canny_image_processor"?a.jsx(mle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="color_map_image_processor"?a.jsx(vle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="hed_image_processor"?a.jsx(Cle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_image_processor"?a.jsx(jle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="content_shuffle_image_processor"?a.jsx(ble,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_anime_image_processor"?a.jsx(Sle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mediapipe_face_processor"?a.jsx(Ile,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="midas_depth_image_processor"?a.jsx(Ele,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mlsd_image_processor"?a.jsx(Ole,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="normalbae_image_processor"?a.jsx(Dle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="openpose_image_processor"?a.jsx(Tle,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="pidi_image_processor"?a.jsx($le,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="zoe_depth_image_processor"?a.jsx(zle,{controlNetId:t,processorNode:r,isEnabled:n}):null},Ble=d.memo(Fle),Hle=e=>{const{controlNetId:t,isEnabled:n,shouldAutoConfig:r}=e.controlNet,o=te(),{t:s}=Z(),i=d.useCallback(()=>{o(BA({controlNetId:t}))},[t,o]);return a.jsx(fn,{label:s("controlnet.autoConfigure"),"aria-label":s("controlnet.autoConfigure"),isChecked:r,onChange:i,isDisabled:!n})},Vle=d.memo(Hle),Wle=e=>{const{controlNet:t}=e,n=te(),{t:r}=Z(),o=d.useCallback(()=>{n(HA({controlNet:t}))},[t,n]),s=d.useCallback(()=>{n(VA({controlNet:t}))},[t,n]);return a.jsxs(L,{sx:{gap:2},children:[a.jsx(Fe,{size:"sm",icon:a.jsx(Yi,{}),tooltip:r("controlnet.importImageFromCanvas"),"aria-label":r("controlnet.importImageFromCanvas"),onClick:o}),a.jsx(Fe,{size:"sm",icon:a.jsx(mM,{}),tooltip:r("controlnet.importMaskFromCanvas"),"aria-label":r("controlnet.importMaskFromCanvas"),onClick:s})]})},Ule=d.memo(Wle),u_=e=>`${Math.round(e*100)}%`,Gle=e=>{const{beginStepPct:t,endStepPct:n,isEnabled:r,controlNetId:o}=e.controlNet,s=te(),{t:i}=Z(),l=d.useCallback(u=>{s(WA({controlNetId:o,beginStepPct:u[0]})),s(UA({controlNetId:o,endStepPct:u[1]}))},[o,s]);return a.jsx(Et,{feature:"controlNetBeginEnd",children:a.jsxs(Kt,{isDisabled:!r,children:[a.jsx(wn,{children:i("controlnet.beginEndStepPercent")}),a.jsx(Rh,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(Vb,{"aria-label":["Begin Step %","End Step %!"],value:[t,n],onChange:l,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!r,children:[a.jsx(Wb,{children:a.jsx(Ub,{})}),a.jsx(Ft,{label:u_(t),placement:"top",hasArrow:!0,children:a.jsx(nd,{index:0})}),a.jsx(Ft,{label:u_(n),placement:"top",hasArrow:!0,children:a.jsx(nd,{index:1})}),a.jsx(Ti,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Ti,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Ti,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})})},Kle=d.memo(Gle);function qle(e){const{controlMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),{t:s}=Z(),i=[{label:s("controlnet.balanced"),value:"balanced"},{label:s("controlnet.prompt"),value:"more_prompt"},{label:s("controlnet.control"),value:"more_control"},{label:s("controlnet.megaControl"),value:"unbalanced"}],l=d.useCallback(u=>{o(GA({controlNetId:r,controlMode:u}))},[r,o]);return a.jsx(Et,{feature:"controlNetControlMode",children:a.jsx(Pn,{disabled:!n,label:s("controlnet.controlMode"),data:i,value:String(t),onChange:l})})}const Xle=le(Xy,e=>nr(Fr,n=>({value:n.type,label:n.label})).sort((n,r)=>n.value==="none"?-1:r.value==="none"?1:n.label.localeCompare(r.label)).filter(n=>!e.sd.disabledControlNetProcessors.includes(n.value)),Se),Qle=e=>{const t=te(),{controlNetId:n,isEnabled:r,processorNode:o}=e.controlNet,s=W(Xle),{t:i}=Z(),l=d.useCallback(u=>{t(KA({controlNetId:n,processorType:u}))},[n,t]);return a.jsx(nn,{label:i("controlnet.processor"),value:o.type??"canny_image_processor",data:s,onChange:l,disabled:!r})},Yle=d.memo(Qle);function Zle(e){const{resizeMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),{t:s}=Z(),i=[{label:s("controlnet.resize"),value:"just_resize"},{label:s("controlnet.crop"),value:"crop_resize"},{label:s("controlnet.fill"),value:"fill_resize"}],l=d.useCallback(u=>{o(qA({controlNetId:r,resizeMode:u}))},[r,o]);return a.jsx(Et,{feature:"controlNetResizeMode",children:a.jsx(Pn,{disabled:!n,label:s("controlnet.resizeMode"),data:i,value:String(t),onChange:l})})}const Jle=e=>{const{controlNet:t}=e,{controlNetId:n}=t,r=te(),{t:o}=Z(),s=W(Jn),i=le(xe,({controlNet:y})=>{const b=y.controlNets[n];if(!b)return{isEnabled:!1,shouldAutoConfig:!1};const{isEnabled:w,shouldAutoConfig:S}=b;return{isEnabled:w,shouldAutoConfig:S}},Se),{isEnabled:l,shouldAutoConfig:u}=W(i),[p,m]=dee(!1),h=d.useCallback(()=>{r(XA({controlNetId:n}))},[n,r]),g=d.useCallback(()=>{r(QA({sourceControlNetId:n,newControlNetId:Zs()}))},[n,r]),x=d.useCallback(y=>{r(YA({controlNetId:n,isEnabled:y.target.checked}))},[n,r]);return a.jsxs(L,{sx:{flexDir:"column",gap:3,p:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsxs(L,{sx:{gap:2,alignItems:"center"},children:[a.jsx(fn,{tooltip:o("controlnet.toggleControlNet"),"aria-label":o("controlnet.toggleControlNet"),isChecked:l,onChange:x}),a.jsx(Ie,{sx:{w:"full",minW:0,transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(lle,{controlNet:t})}),s==="unifiedCanvas"&&a.jsx(Ule,{controlNet:t}),a.jsx(Fe,{size:"sm",tooltip:o("controlnet.duplicate"),"aria-label":o("controlnet.duplicate"),onClick:g,icon:a.jsx(Hc,{})}),a.jsx(Fe,{size:"sm",tooltip:o("controlnet.delete"),"aria-label":o("controlnet.delete"),colorScheme:"error",onClick:h,icon:a.jsx(Br,{})}),a.jsx(Fe,{size:"sm",tooltip:o(p?"controlnet.hideAdvanced":"controlnet.showAdvanced"),"aria-label":o(p?"controlnet.hideAdvanced":"controlnet.showAdvanced"),onClick:m,variant:"ghost",sx:{_hover:{bg:"none"}},icon:a.jsx(gg,{sx:{boxSize:4,color:"base.700",transform:p?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal",_dark:{color:"base.300"}}})}),!u&&a.jsx(Ie,{sx:{position:"absolute",w:1.5,h:1.5,borderRadius:"full",top:4,insetInlineEnd:4,bg:"accent.700",_dark:{bg:"accent.400"}}})]}),a.jsxs(L,{sx:{w:"full",flexDirection:"column",gap:3},children:[a.jsxs(L,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs(L,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:p?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(ule,{controlNet:t}),a.jsx(Kle,{controlNet:t})]}),!p&&a.jsx(L,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(e_,{controlNet:t,isSmall:!0})})]}),a.jsxs(L,{sx:{gap:2},children:[a.jsx(qle,{controlNet:t}),a.jsx(Zle,{controlNet:t})]}),a.jsx(Yle,{controlNet:t})]}),p&&a.jsxs(a.Fragment,{children:[a.jsx(e_,{controlNet:t}),a.jsx(Vle,{controlNet:t}),a.jsx(Ble,{controlNet:t})]})]})},ece=d.memo(Jle),d_=e=>`${Math.round(e*100)}%`,tce=()=>{const e=W(i=>i.controlNet.isIPAdapterEnabled),t=W(i=>i.controlNet.ipAdapterInfo.beginStepPct),n=W(i=>i.controlNet.ipAdapterInfo.endStepPct),r=te(),{t:o}=Z(),s=d.useCallback(i=>{r(ZA(i[0])),r(JA(i[1]))},[r]);return a.jsxs(Kt,{isDisabled:!e,children:[a.jsx(wn,{children:o("controlnet.beginEndStepPercent")}),a.jsx(Rh,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(Vb,{"aria-label":["Begin Step %","End Step %!"],value:[t,n],onChange:s,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!e,children:[a.jsx(Wb,{children:a.jsx(Ub,{})}),a.jsx(Ft,{label:d_(t),placement:"top",hasArrow:!0,children:a.jsx(nd,{index:0})}),a.jsx(Ft,{label:d_(n),placement:"top",hasArrow:!0,children:a.jsx(nd,{index:1})}),a.jsx(Ti,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Ti,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Ti,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})},nce=d.memo(tce),rce=le(xe,e=>{const{isIPAdapterEnabled:t}=e.controlNet;return{isIPAdapterEnabled:t}},Se),oce=()=>{const{isIPAdapterEnabled:e}=W(rce),t=te(),{t:n}=Z(),r=d.useCallback(o=>{t(u1(o.target.checked))},[t]);return a.jsx(fn,{label:n("controlnet.enableIPAdapter"),isChecked:e,onChange:r,formControlProps:{width:"100%"}})},sce=d.memo(oce),ace=le(xe,({controlNet:e})=>{const{ipAdapterInfo:t}=e;return{ipAdapterInfo:t}},Se),ice=()=>{const{ipAdapterInfo:e}=W(ace),t=te(),{t:n}=Z(),{currentData:r}=to(e.adapterImage??$r.skipToken),o=d.useMemo(()=>{if(r)return{id:"ip-adapter-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r]),s=d.useMemo(()=>({id:"ip-adapter-image",actionType:"SET_IP_ADAPTER_IMAGE"}),[]),i=d.useMemo(()=>({type:"SET_IP_ADAPTER_IMAGE"}),[]);return a.jsxs(L,{layerStyle:"second",sx:{position:"relative",h:28,w:28,alignItems:"center",justifyContent:"center",aspectRatio:"1/1",borderRadius:"base"},children:[a.jsx(ua,{imageDTO:r,droppableData:s,draggableData:o,postUploadAction:i,dropLabel:n("toast.setIPAdapterImage"),noContentFallback:a.jsx(Zn,{label:n("controlnet.ipAdapterImageFallback")})}),a.jsx(zi,{onClick:()=>t(eT(null)),icon:e.adapterImage?a.jsx(Ud,{}):void 0,tooltip:n("controlnet.resetIPAdapterImage")})]})},lce=d.memo(ice),cce=()=>{const e=W(p=>p.controlNet.isIPAdapterEnabled),t=W(p=>p.controlNet.ipAdapterInfo.model),n=W(p=>p.generation.model),r=te(),{t:o}=Z(),{data:s}=Ux(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${t==null?void 0:t.base_model}/ip_adapter/${t==null?void 0:t.model_name}`])??null,[t==null?void 0:t.base_model,t==null?void 0:t.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Rn(s.entities,(m,h)=>{if(!m)return;const g=(n==null?void 0:n.base_model)!==m.base_model;p.push({value:h,label:m.model_name,group:an[m.base_model],disabled:g,tooltip:g?`Incompatible base model: ${m.base_model}`:void 0})}),p.sort((m,h)=>m.disabled&&!h.disabled?1:-1)},[s,n==null?void 0:n.base_model]),u=d.useCallback(p=>{if(!p)return;const m=_O(p);m&&r(tT(m))},[r]);return a.jsx(Pn,{label:o("controlnet.ipAdapterModel"),className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:l.length>0?o("models.selectModel"):o("models.noModelsAvailable"),error:!i&&l.length>0,data:l,onChange:u,sx:{width:"100%"},disabled:!e||l.length===0})},uce=d.memo(cce),dce=()=>{const e=W(i=>i.controlNet.isIPAdapterEnabled),t=W(i=>i.controlNet.ipAdapterInfo.weight),n=te(),{t:r}=Z(),o=d.useCallback(i=>{n(ww(i))},[n]),s=d.useCallback(()=>{n(ww(1))},[n]);return a.jsx(tt,{isDisabled:!e,label:r("controlnet.weight"),value:t,onChange:o,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2],withReset:!0,handleReset:s})},fce=d.memo(dce),pce=le(xe,e=>{const{isIPAdapterEnabled:t}=e.controlNet;return{isIPAdapterEnabled:t}},Se),mce=()=>{const{isIPAdapterEnabled:e}=W(pce);return a.jsxs(L,{sx:{flexDir:"column",gap:3,paddingInline:3,paddingBlock:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(sce,{}),e&&a.jsxs(a.Fragment,{children:[a.jsx(uce,{}),a.jsxs(L,{gap:"3",children:[a.jsxs(L,{flexDirection:"column",sx:{h:28,w:"full",gap:4,mb:4},children:[a.jsx(fce,{}),a.jsx(nce,{})]}),a.jsx(lce,{})]})]})]})},hce=d.memo(mce),gce=le(xe,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},Se),vce=()=>{const{isEnabled:e}=W(gce),t=te(),n=d.useCallback(()=>{t(nT())},[t]);return a.jsx(Ie,{width:"100%",children:a.jsx(Et,{feature:"controlNet",children:a.jsx(fn,{label:"Enable ControlNet",isChecked:e,onChange:n})})})},xce=d.memo(vce),bce=le([xe],({controlNet:e})=>{const{controlNets:t,isEnabled:n,isIPAdapterEnabled:r,ipAdapterInfo:o}=e,s=rT(t),i=o.model&&o.adapterImage;let l;return n&&s.length>0&&(l=`${s.length} ControlNet`),r&&i&&(l?l=`${l}, IP Adapter`:l="IP Adapter"),{controlNetsArray:nr(t),activeLabel:l}},Se),yce=()=>{const{controlNetsArray:e,activeLabel:t}=W(bce),n=Ht("controlNet").isFeatureDisabled,r=te(),{data:o}=gh(),s=d.useMemo(()=>{if(!o||!Object.keys(o.entities).length)return;const l=Object.keys(o.entities)[0];if(!l)return;const u=o.entities[l];return u||void 0},[o]),i=d.useCallback(()=>{if(!s)return;const l=Zs();r(oT({controlNetId:l})),r(II({controlNetId:l,model:s}))},[r,s]);return n?null:a.jsx(oo,{label:"Control Adapters",activeLabel:t,children:a.jsxs(L,{sx:{flexDir:"column",gap:2},children:[a.jsxs(L,{sx:{w:"100%",gap:2,p:2,ps:3,borderRadius:"base",alignItems:"center",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(xce,{}),a.jsx(Fe,{tooltip:"Add ControlNet","aria-label":"Add ControlNet",icon:a.jsx(Vc,{}),isDisabled:!s,flexGrow:1,size:"sm",onClick:i,"data-testid":"add controlnet"})]}),e.map((l,u)=>a.jsxs(d.Fragment,{children:[u>0&&a.jsx(Yn,{}),a.jsx(ece,{controlNet:l})]},l.controlNetId)),a.jsx(hce,{})]})})},Yc=d.memo(yce),Cce=e=>{const{onClick:t}=e,{t:n}=Z();return a.jsx(Fe,{size:"sm","aria-label":n("embedding.addEmbedding"),tooltip:n("embedding.addEmbedding"),icon:a.jsx(iM,{}),sx:{p:2,color:"base.500",_hover:{color:"base.600"},_active:{color:"base.700"},_dark:{color:"base.500",_hover:{color:"base.400"},_active:{color:"base.300"}}},variant:"link",onClick:t})},Rg=d.memo(Cce),wce="28rem",Sce=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=sT(),i=d.useRef(null),{t:l}=Z(),u=W(h=>h.generation.model),p=d.useMemo(()=>{if(!s)return[];const h=[];return Rn(s.entities,(g,x)=>{if(!g)return;const y=(u==null?void 0:u.base_model)!==g.base_model;h.push({value:g.model_name,label:g.model_name,group:an[g.base_model],disabled:y,tooltip:y?`${l("embedding.incompatibleModel")} ${g.base_model}`:void 0})}),h.sort((g,x)=>{var y;return g.label&&x.label?(y=g.label)!=null&&y.localeCompare(x.label)?-1:1:-1}),h.sort((g,x)=>g.disabled&&!x.disabled?1:-1)},[s,u==null?void 0:u.base_model,l]),m=d.useCallback(h=>{h&&t(h)},[t]);return a.jsxs(Ld,{initialFocusRef:i,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(Wh,{children:o}),a.jsx(zd,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Uh,{sx:{p:0,w:`calc(${wce} - 2rem )`},children:p.length===0?a.jsx(L,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(ve,{children:"No Embeddings Loaded"})}):a.jsx(nn,{inputRef:i,autoFocus:!0,placeholder:l("embedding.addEmbedding"),value:null,data:p,nothingFound:l("embedding.noMatchingEmbedding"),itemComponent:ui,disabled:p.length===0,onDropdownClose:r,filter:(h,g)=>{var x;return((x=g.label)==null?void 0:x.toLowerCase().includes(h.toLowerCase().trim()))||g.value.toLowerCase().includes(h.toLowerCase().trim())},onChange:m})})})]})},Dg=d.memo(Sce),kce=()=>{const e=W(h=>h.generation.negativePrompt),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),s=te(),{t:i}=Z(),l=d.useCallback(h=>{s($u(h.target.value))},[s]),u=d.useCallback(h=>{h.key==="<"&&o()},[o]),p=d.useCallback(h=>{if(!t.current)return;const g=t.current.selectionStart;if(g===void 0)return;let x=e.slice(0,g);x[x.length-1]!=="<"&&(x+="<"),x+=`${h}>`;const y=x.length;x+=e.slice(g),qr.flushSync(()=>{s($u(x))}),t.current.selectionEnd=y,r()},[s,r,e]),m=Ht("embedding").isFeatureEnabled;return a.jsxs(Kt,{children:[a.jsx(Dg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(Et,{feature:"paramNegativeConditioning",placement:"right",children:a.jsx(da,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:i("parameters.negativePromptPlaceholder"),onChange:l,resize:"vertical",fontSize:"sm",minH:16,...m&&{onKeyDown:u}})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Rg,{onClick:o})})]})},MO=d.memo(kce),jce=le([xe],({generation:e})=>({prompt:e.positivePrompt}),{memoizeOptions:{resultEqualityCheck:Bt}}),_ce=()=>{const e=te(),{prompt:t}=W(jce),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Lr(),{t:i}=Z(),l=d.useCallback(h=>{e(Nu(h.target.value))},[e]);et("alt+a",()=>{var h;(h=n.current)==null||h.focus()},[]);const u=d.useCallback(h=>{if(!n.current)return;const g=n.current.selectionStart;if(g===void 0)return;let x=t.slice(0,g);x[x.length-1]!=="<"&&(x+="<"),x+=`${h}>`;const y=x.length;x+=t.slice(g),qr.flushSync(()=>{e(Nu(x))}),n.current.selectionStart=y,n.current.selectionEnd=y,o()},[e,o,t]),p=Ht("embedding").isFeatureEnabled,m=d.useCallback(h=>{p&&h.key==="<"&&s()},[s,p]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(Kt,{children:a.jsx(Dg,{isOpen:r,onClose:o,onSelect:u,children:a.jsx(Et,{feature:"paramPositiveConditioning",placement:"right",children:a.jsx(da,{id:"prompt",name:"prompt",ref:n,value:t,placeholder:i("parameters.positivePromptPlaceholder"),onChange:l,onKeyDown:m,resize:"vertical",minH:32})})})}),!r&&p&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Rg,{onClick:s})})]})},OO=d.memo(_ce);function Ice(){const e=W(o=>o.sdxl.shouldConcatSDXLStylePrompt),t=te(),{t:n}=Z(),r=()=>{t(aT(!e))};return a.jsx(Fe,{"aria-label":n("sdxl.concatPromptStyle"),tooltip:n("sdxl.concatPromptStyle"),variant:"outline",isChecked:e,onClick:r,icon:a.jsx(fM,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const f_={position:"absolute",bg:"none",w:"full",minH:2,borderRadius:0,borderLeft:"none",borderRight:"none",zIndex:2,maskImage:"radial-gradient(circle at center, black, black 65%, black 30%, black 15%, transparent)"};function RO(){return a.jsxs(L,{children:[a.jsx(Ie,{as:In.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"1px",borderTop:"none",borderColor:"base.400",...f_,_dark:{borderColor:"accent.500"}}}),a.jsx(Ie,{as:In.div,initial:{opacity:0,scale:0},animate:{opacity:[0,1,1,1],scale:[0,.75,1.5,1],transition:{duration:.42,times:[0,.25,.5,1]}},exit:{opacity:0,scale:0},sx:{zIndex:3,position:"absolute",left:"48%",top:"3px",p:1,borderRadius:4,bg:"accent.400",color:"base.50",_dark:{bg:"accent.500"}},children:a.jsx(fM,{size:12})}),a.jsx(Ie,{as:In.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"17px",borderBottom:"none",borderColor:"base.400",...f_,_dark:{borderColor:"accent.500"}}})]})}const Pce=le([xe],({sdxl:e})=>{const{negativeStylePrompt:t,shouldConcatSDXLStylePrompt:n}=e;return{prompt:t,shouldConcatSDXLStylePrompt:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Ece=()=>{const e=te(),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),{t:s}=Z(),{prompt:i,shouldConcatSDXLStylePrompt:l}=W(Pce),u=d.useCallback(g=>{e(zu(g.target.value))},[e]),p=d.useCallback(g=>{if(!t.current)return;const x=t.current.selectionStart;if(x===void 0)return;let y=i.slice(0,x);y[y.length-1]!=="<"&&(y+="<"),y+=`${g}>`;const b=y.length;y+=i.slice(x),qr.flushSync(()=>{e(zu(y))}),t.current.selectionStart=b,t.current.selectionEnd=b,r()},[e,r,i]),m=Ht("embedding").isFeatureEnabled,h=d.useCallback(g=>{m&&g.key==="<"&&o()},[o,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(dr,{children:l&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(RO,{})})}),a.jsx(Kt,{children:a.jsx(Dg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(da,{id:"prompt",name:"prompt",ref:t,value:i,placeholder:s("sdxl.negStylePrompt"),onChange:u,onKeyDown:h,resize:"vertical",fontSize:"sm",minH:16})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Rg,{onClick:o})})]})},Mce=d.memo(Ece),Oce=le([xe],({sdxl:e})=>{const{positiveStylePrompt:t,shouldConcatSDXLStylePrompt:n}=e;return{prompt:t,shouldConcatSDXLStylePrompt:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),Rce=()=>{const e=te(),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Lr(),{t:s}=Z(),{prompt:i,shouldConcatSDXLStylePrompt:l}=W(Oce),u=d.useCallback(g=>{e(Lu(g.target.value))},[e]),p=d.useCallback(g=>{if(!t.current)return;const x=t.current.selectionStart;if(x===void 0)return;let y=i.slice(0,x);y[y.length-1]!=="<"&&(y+="<"),y+=`${g}>`;const b=y.length;y+=i.slice(x),qr.flushSync(()=>{e(Lu(y))}),t.current.selectionStart=b,t.current.selectionEnd=b,r()},[e,r,i]),m=Ht("embedding").isFeatureEnabled,h=d.useCallback(g=>{m&&g.key==="<"&&o()},[o,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(dr,{children:l&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(RO,{})})}),a.jsx(Kt,{children:a.jsx(Dg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(da,{id:"prompt",name:"prompt",ref:t,value:i,placeholder:s("sdxl.posStylePrompt"),onChange:u,onKeyDown:h,resize:"vertical",minH:16})})}),!n&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Rg,{onClick:o})})]})},Dce=d.memo(Rce);function a2(){return a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[a.jsx(OO,{}),a.jsx(Ice,{}),a.jsx(Dce,{}),a.jsx(MO,{}),a.jsx(Mce,{})]})}const dl=()=>{const{isRefinerAvailable:e}=Xo(ob,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},Ace=le([xe],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},Se),Tce=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=W(Ace),r=dl(),o=te(),{t:s}=Z(),i=d.useCallback(u=>o(f1(u)),[o]),l=d.useCallback(()=>o(f1(7)),[o]);return t?a.jsx(tt,{label:s("sdxl.cfgScale"),step:n?.1:.5,min:1,max:20,onChange:i,handleReset:l,value:e,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!r}):a.jsx(Kc,{label:s("sdxl.cfgScale"),step:.5,min:1,max:200,onChange:i,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"},isDisabled:!r})},Nce=d.memo(Tce),$ce=e=>{const t=si("models"),[n,r,o]=e.split("/"),s=iT.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data},Lce=le(xe,e=>({model:e.sdxl.refinerModel}),Se),zce=()=>{const e=te(),t=Ht("syncModels").isFeatureEnabled,{model:n}=W(Lce),{t:r}=Z(),{data:o,isLoading:s}=Xo(ob),i=d.useMemo(()=>{if(!o)return[];const p=[];return Rn(o.entities,(m,h)=>{m&&p.push({value:h,label:m.model_name,group:an[m.base_model]})}),p},[o]),l=d.useMemo(()=>(o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])??null,[o==null?void 0:o.entities,n]),u=d.useCallback(p=>{if(!p)return;const m=$ce(p);m&&e(fI(m))},[e]);return s?a.jsx(nn,{label:r("sdxl.refinermodel"),placeholder:r("sdxl.loading"),disabled:!0,data:[]}):a.jsxs(L,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(nn,{tooltip:l==null?void 0:l.description,label:r("sdxl.refinermodel"),value:l==null?void 0:l.id,placeholder:i.length>0?r("sdxl.selectAModel"):r("sdxl.noModelsAvailable"),data:i,error:i.length===0,disabled:i.length===0,onChange:u,w:"100%"}),t&&a.jsx(Ie,{mt:7,children:a.jsx(Gc,{iconMode:!0})})]})},Fce=d.memo(zce),Bce=le([xe],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},Se),Hce=()=>{const{refinerNegativeAestheticScore:e,shift:t}=W(Bce),n=dl(),r=te(),{t:o}=Z(),s=d.useCallback(l=>r(m1(l)),[r]),i=d.useCallback(()=>r(m1(2.5)),[r]);return a.jsx(tt,{label:o("sdxl.negAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:i,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Vce=d.memo(Hce),Wce=le([xe],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},Se),Uce=()=>{const{refinerPositiveAestheticScore:e,shift:t}=W(Wce),n=dl(),r=te(),{t:o}=Z(),s=d.useCallback(l=>r(p1(l)),[r]),i=d.useCallback(()=>r(p1(6)),[r]);return a.jsx(tt,{label:o("sdxl.posAestheticScore"),step:t?.1:.5,min:1,max:10,onChange:s,handleReset:i,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Gce=d.memo(Uce),Kce=le(xe,({ui:e,sdxl:t})=>{const{refinerScheduler:n}=t,{favoriteSchedulers:r}=e,o=nr(mh,(s,i)=>({value:i,label:s,group:r.includes(i)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{refinerScheduler:n,data:o}},Se),qce=()=>{const e=te(),{t}=Z(),{refinerScheduler:n,data:r}=W(Kce),o=dl(),s=d.useCallback(i=>{i&&e(pI(i))},[e]);return a.jsx(nn,{w:"100%",label:t("sdxl.scheduler"),value:n,data:r,onChange:s,disabled:!o})},Xce=d.memo(qce),Qce=le([xe],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},Se),Yce=()=>{const{refinerStart:e}=W(Qce),t=te(),n=dl(),r=d.useCallback(i=>t(h1(i)),[t]),{t:o}=Z(),s=d.useCallback(()=>t(h1(.8)),[t]);return a.jsx(tt,{label:o("sdxl.refinerStart"),step:.01,min:0,max:1,onChange:r,handleReset:s,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Zce=d.memo(Yce),Jce=le([xe],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},Se),eue=()=>{const{refinerSteps:e,shouldUseSliders:t}=W(Jce),n=dl(),r=te(),{t:o}=Z(),s=d.useCallback(l=>{r(d1(l))},[r]),i=d.useCallback(()=>{r(d1(20))},[r]);return t?a.jsx(tt,{label:o("sdxl.steps"),min:1,max:100,step:1,onChange:s,handleReset:i,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:500},isDisabled:!n}):a.jsx(Kc,{label:o("sdxl.steps"),min:1,max:500,step:1,onChange:s,value:e,numberInputFieldProps:{textAlign:"center"},isDisabled:!n})},tue=d.memo(eue);function nue(){const e=W(s=>s.sdxl.shouldUseSDXLRefiner),t=dl(),n=te(),{t:r}=Z(),o=s=>{n(lT(s.target.checked))};return a.jsx(fn,{label:r("sdxl.useRefiner"),isChecked:e,onChange:o,isDisabled:!t})}const rue=le(xe,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},Se),oue=()=>{const{activeLabel:e,shouldUseSliders:t}=W(rue),{t:n}=Z();return a.jsx(oo,{label:n("sdxl.refiner"),activeLabel:e,children:a.jsxs(L,{sx:{gap:2,flexDir:"column"},children:[a.jsx(nue,{}),a.jsx(Fce,{}),a.jsxs(L,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(tue,{}),a.jsx(Nce,{})]}),a.jsx(Xce,{}),a.jsx(Gce,{}),a.jsx(Vce,{}),a.jsx(Zce,{})]})})},i2=d.memo(oue),sue=le([xe],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:l}=t.sd.guidance,{cfgScale:u}=e,{shouldUseSliders:p}=n,{shift:m}=r;return{cfgScale:u,initial:o,min:s,sliderMax:i,inputMax:l,shouldUseSliders:p,shift:m}},Se),aue=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=W(sue),l=te(),{t:u}=Z(),p=d.useCallback(h=>l(Qp(h)),[l]),m=d.useCallback(()=>l(Qp(t)),[l,t]);return s?a.jsx(Et,{feature:"paramCFGScale",children:a.jsx(tt,{label:u("parameters.cfgScale"),step:i?.1:.5,min:n,max:r,onChange:p,handleReset:m,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1})}):a.jsx(Et,{feature:"paramCFGScale",children:a.jsx(Kc,{label:u("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})})},_s=d.memo(aue),iue=le(xe,e=>({model:e.generation.model}),Se),lue=()=>{const e=te(),{t}=Z(),{model:n}=W(iue),r=Ht("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Xo(Sw),{data:i,isLoading:l}=Ku(Sw),u=W(Jn),p=d.useMemo(()=>{if(!o)return[];const g=[];return Rn(o.entities,(x,y)=>{x&&g.push({value:y,label:x.model_name,group:an[x.base_model]})}),Rn(i==null?void 0:i.entities,(x,y)=>{!x||u==="unifiedCanvas"||u==="img2img"||g.push({value:y,label:x.model_name,group:an[x.base_model]})}),g},[o,i,u]),m=d.useMemo(()=>((o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])||(i==null?void 0:i.entities[`${n==null?void 0:n.base_model}/onnx/${n==null?void 0:n.model_name}`]))??null,[o==null?void 0:o.entities,n,i==null?void 0:i.entities]),h=d.useCallback(g=>{if(!g)return;const x=Og(g);x&&e(i1(x))},[e]);return s||l?a.jsx(nn,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs(L,{w:"100%",alignItems:"center",gap:3,children:[a.jsx(Et,{feature:"paramModel",children:a.jsx(nn,{tooltip:m==null?void 0:m.description,label:t("modelManager.model"),value:m==null?void 0:m.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:p.length===0,disabled:p.length===0,onChange:h,w:"100%"})}),r&&a.jsx(Ie,{mt:6,children:a.jsx(Gc,{iconMode:!0})})]})},cue=d.memo(lue),uue=le(xe,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},Se),due=()=>{const e=te(),{t}=Z(),{model:n,vae:r}=W(uue),{data:o}=kI(),s=d.useMemo(()=>{if(!o)return[];const u=[{value:"default",label:"Default",group:"Default"}];return Rn(o.entities,(p,m)=>{if(!p)return;const h=(n==null?void 0:n.base_model)!==p.base_model;u.push({value:m,label:p.model_name,group:an[p.base_model],disabled:h,tooltip:h?`Incompatible base model: ${p.base_model}`:void 0})}),u.sort((p,m)=>p.disabled&&!m.disabled?1:-1)},[o,n==null?void 0:n.base_model]),i=d.useMemo(()=>(o==null?void 0:o.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[o==null?void 0:o.entities,r]),l=d.useCallback(u=>{if(!u||u==="default"){e(kw(null));return}const p=jO(u);p&&e(kw(p))},[e]);return a.jsx(Et,{feature:"paramVAE",children:a.jsx(nn,{itemComponent:ui,tooltip:i==null?void 0:i.description,label:t("modelManager.vae"),value:(i==null?void 0:i.id)??"default",placeholder:"Default",data:s,onChange:l,disabled:s.length===0,clearable:!0})})},fue=d.memo(due),pue=le([PI,os],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=nr(mh,(s,i)=>({value:i,label:s,group:r.includes(i)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{scheduler:n,data:o}},Se),mue=()=>{const e=te(),{t}=Z(),{scheduler:n,data:r}=W(pue),o=d.useCallback(s=>{s&&e(l1(s))},[e]);return a.jsx(Et,{feature:"paramScheduler",children:a.jsx(nn,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})})},hue=d.memo(mue),gue=le(xe,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},Se),vue=["fp16","fp32"],xue=()=>{const e=te(),{vaePrecision:t}=W(gue),n=d.useCallback(r=>{r&&e(cT(r))},[e]);return a.jsx(Et,{feature:"paramVAEPrecision",children:a.jsx(Pn,{label:"VAE Precision",value:t,data:vue,onChange:n})})},bue=d.memo(xue),yue=()=>{const e=Ht("vae").isFeatureEnabled;return a.jsxs(L,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ie,{w:"full",children:a.jsx(cue,{})}),a.jsx(Ie,{w:"full",children:a.jsx(hue,{})}),e&&a.jsxs(L,{w:"full",gap:3,children:[a.jsx(fue,{}),a.jsx(bue,{})]})]})},Is=d.memo(yue),DO=[{name:"Free",value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],AO=DO.map(e=>e.value);function TO(){const e=W(o=>o.generation.aspectRatio),t=te(),n=W(o=>o.generation.shouldFitToWidthHeight),r=W(Jn);return a.jsx(Vt,{isAttached:!0,children:DO.map(o=>a.jsx(at,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(zo(o.value)),t(qu(!1))},children:o.name},o.name))})}const Cue=le([xe],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:l}=n.sd.height,{model:u,height:p}=e,{aspectRatio:m}=e,h=t.shift?i:l;return{model:u,height:p,min:r,sliderMax:o,inputMax:s,step:h,aspectRatio:m}},Se),wue=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=W(Cue),u=te(),{t:p}=Z(),m=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,h=d.useCallback(x=>{if(u(Vi(x)),l){const y=wr(x*l,8);u(Hi(y))}},[u,l]),g=d.useCallback(()=>{if(u(Vi(m)),l){const x=wr(m*l,8);u(Hi(x))}},[u,m,l]);return a.jsx(tt,{label:p("parameters.height"),value:n,min:r,step:i,max:o,onChange:h,handleReset:g,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Sue=d.memo(wue),kue=le([xe],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:l}=n.sd.width,{model:u,width:p,aspectRatio:m}=e,h=t.shift?i:l;return{model:u,width:p,min:r,sliderMax:o,inputMax:s,step:h,aspectRatio:m}},Se),jue=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=W(kue),u=te(),{t:p}=Z(),m=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,h=d.useCallback(x=>{if(u(Hi(x)),l){const y=wr(x/l,8);u(Vi(y))}},[u,l]),g=d.useCallback(()=>{if(u(Hi(m)),l){const x=wr(m/l,8);u(Vi(x))}},[u,m,l]);return a.jsx(tt,{label:p("parameters.width"),value:n,min:r,step:i,max:o,onChange:h,handleReset:g,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},_ue=d.memo(jue),Iue=le([os,Jn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}=e;return{activeTabName:t,shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}},Se);function Oc(){const{t:e}=Z(),t=te(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:i}=W(Iue),l=d.useCallback(()=>{o?(t(qu(!1)),AO.includes(s/i)?t(zo(s/i)):t(zo(null))):(t(qu(!0)),t(zo(s/i)))},[o,s,i,t]),u=d.useCallback(()=>{t(uT()),t(zo(null)),o&&t(zo(i/s))},[t,o,s,i]);return a.jsxs(L,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsx(Et,{feature:"paramRatio",children:a.jsxs(Kt,{as:L,flexDir:"row",alignItems:"center",gap:2,children:[a.jsx(wn,{children:e("parameters.aspectRatio")}),a.jsx(ba,{}),a.jsx(TO,{}),a.jsx(Fe,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(L8,{}),fontSize:20,isDisabled:n==="img2img"?!r:!1,onClick:u}),a.jsx(Fe,{tooltip:e("ui.lockRatio"),"aria-label":e("ui.lockRatio"),size:"sm",icon:a.jsx(pM,{}),isChecked:o,isDisabled:n==="img2img"?!r:!1,onClick:l})]})}),a.jsx(L,{gap:2,alignItems:"center",children:a.jsxs(L,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(_ue,{isDisabled:n==="img2img"?!r:!1}),a.jsx(Sue,{isDisabled:n==="img2img"?!r:!1})]})})]})}const Pue=le([xe],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:l,fineStep:u,coarseStep:p}=t.sd.steps,{steps:m}=e,{shouldUseSliders:h}=n,g=r.shift?u:p;return{steps:m,initial:o,min:s,sliderMax:i,inputMax:l,step:g,shouldUseSliders:h}},Se),Eue=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=W(Pue),l=te(),{t:u}=Z(),p=d.useCallback(g=>{l(Yp(g))},[l]),m=d.useCallback(()=>{l(Yp(t))},[l,t]),h=d.useCallback(()=>{l(nb())},[l]);return i?a.jsx(Et,{feature:"paramSteps",children:a.jsx(tt,{label:u("parameters.steps"),min:n,max:r,step:s,onChange:p,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}})}):a.jsx(Et,{feature:"paramSteps",children:a.jsx(Kc,{label:u("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:h})})},Ps=d.memo(Eue);function NO(){const e=te(),t=W(o=>o.generation.shouldFitToWidthHeight),n=o=>e(dT(o.target.checked)),{t:r}=Z();return a.jsx(fn,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function Mue(){const e=W(i=>i.generation.seed),t=W(i=>i.generation.shouldRandomizeSeed),n=W(i=>i.generation.shouldGenerateVariations),{t:r}=Z(),o=te(),s=i=>o(Xp(i));return a.jsx(Kc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:EI,max:MI,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const Oue=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function Rue(){const e=te(),t=W(o=>o.generation.shouldRandomizeSeed),{t:n}=Z(),r=()=>e(Xp(Oue(EI,MI)));return a.jsx(Fe,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(JJ,{})})}const Due=()=>{const e=te(),{t}=Z(),n=W(o=>o.generation.shouldRandomizeSeed),r=o=>e(fT(o.target.checked));return a.jsx(fn,{label:t("common.random"),isChecked:n,onChange:r})},Aue=d.memo(Due),Tue=()=>a.jsx(Et,{feature:"paramSeed",children:a.jsxs(L,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(Mue,{}),a.jsx(Rue,{}),a.jsx(Aue,{})]})}),Es=d.memo(Tue),$O=je((e,t)=>a.jsxs(L,{ref:t,sx:{flexDir:"column",gap:2,bg:"base.100",px:4,pt:2,pb:4,borderRadius:"base",_dark:{bg:"base.750"}},children:[a.jsx(ve,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]}));$O.displayName="SubSettingsWrapper";const Rc=d.memo($O),Nue=le([xe],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},Se),$ue=()=>{const{sdxlImg2ImgDenoisingStrength:e}=W(Nue),t=te(),{t:n}=Z(),r=d.useCallback(s=>t(jw(s)),[t]),o=d.useCallback(()=>{t(jw(.7))},[t]);return a.jsx(Et,{feature:"paramDenoisingStrength",children:a.jsx(Rc,{children:a.jsx(tt,{label:n("sdxl.denoisingStrength"),step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0})})})},LO=d.memo($ue),Lue=le([PI,os],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Se),zue=()=>{const{shouldUseSliders:e,activeLabel:t}=W(Lue);return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(L,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}),a.jsx(LO,{}),a.jsx(NO,{})]})})},Fue=d.memo(zue),Bue=()=>a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(Fue,{}),a.jsx(i2,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Qc,{})]}),Hue=d.memo(Bue),l2=()=>{const{t:e}=Z(),t=W(i=>i.generation.shouldRandomizeSeed),n=W(i=>i.generation.iterations),r=d.useMemo(()=>n===1?e("parameters.iterationsWithCount_one",{count:1}):e("parameters.iterationsWithCount_other",{count:n}),[n,e]),o=d.useMemo(()=>e(t?"parameters.randomSeed":"parameters.manualSeed"),[t,e]);return{iterationsAndSeedLabel:d.useMemo(()=>[r,o].join(", "),[r,o]),iterationsLabel:r,seedLabel:o}},Vue=()=>{const e=W(n=>n.ui.shouldUseSliders),{iterationsAndSeedLabel:t}=l2();return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx(L,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]})})})},zO=d.memo(Vue),Wue=()=>a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(zO,{}),a.jsx(i2,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Qc,{})]}),Uue=d.memo(Wue),Gue=[{label:"Unmasked",value:"unmasked"},{label:"Mask",value:"mask"},{label:"Mask Edge",value:"edge"}],Kue=()=>{const e=te(),t=W(o=>o.generation.canvasCoherenceMode),{t:n}=Z(),r=o=>{o&&e(pT(o))};return a.jsx(Et,{feature:"compositingCoherenceMode",children:a.jsx(Pn,{label:n("parameters.coherenceMode"),data:Gue,value:t,onChange:r})})},que=d.memo(Kue),Xue=()=>{const e=te(),t=W(r=>r.generation.canvasCoherenceSteps),{t:n}=Z();return a.jsx(Et,{feature:"compositingCoherenceSteps",children:a.jsx(tt,{label:n("parameters.coherenceSteps"),min:1,max:100,step:1,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(_w(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(_w(20))}})})},Que=d.memo(Xue),Yue=()=>{const e=te(),t=W(r=>r.generation.canvasCoherenceStrength),{t:n}=Z();return a.jsx(Et,{feature:"compositingStrength",children:a.jsx(tt,{label:n("parameters.coherenceStrength"),min:0,max:1,step:.01,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(Iw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Iw(.3))}})})},Zue=d.memo(Yue);function Jue(){const e=te(),t=W(r=>r.generation.maskBlur),{t:n}=Z();return a.jsx(Et,{feature:"compositingBlur",children:a.jsx(tt,{label:n("parameters.maskBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(Pw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Pw(16))}})})}const ede=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function tde(){const e=W(o=>o.generation.maskBlurMethod),t=te(),{t:n}=Z(),r=o=>{o&&t(mT(o))};return a.jsx(Et,{feature:"compositingBlurMethod",children:a.jsx(Pn,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:ede})})}const nde=()=>{const{t:e}=Z();return a.jsx(oo,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(Rc,{label:e("parameters.coherencePassHeader"),children:[a.jsx(que,{}),a.jsx(Que,{}),a.jsx(Zue,{})]}),a.jsx(Yn,{}),a.jsxs(Rc,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(Jue,{}),a.jsx(tde,{})]})]})})},FO=d.memo(nde),rde=le([xe],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},Se),ode=()=>{const e=te(),{infillMethod:t}=W(rde),{data:n,isLoading:r}=lI(),o=n==null?void 0:n.infill_methods,{t:s}=Z(),i=d.useCallback(l=>{e(hT(l))},[e]);return a.jsx(Et,{feature:"infillMethod",children:a.jsx(Pn,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})})},sde=d.memo(ode),ade=le([os],e=>{const{infillPatchmatchDownscaleSize:t,infillMethod:n}=e;return{infillPatchmatchDownscaleSize:t,infillMethod:n}},Se),ide=()=>{const e=te(),{infillPatchmatchDownscaleSize:t,infillMethod:n}=W(ade),{t:r}=Z(),o=d.useCallback(i=>{e(Ew(i))},[e]),s=d.useCallback(()=>{e(Ew(2))},[e]);return a.jsx(tt,{isDisabled:n!=="patchmatch",label:r("parameters.patchmatchDownScaleSize"),min:1,max:10,value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},lde=d.memo(ide),cde=le([os],e=>{const{infillTileSize:t,infillMethod:n}=e;return{infillTileSize:t,infillMethod:n}},Se),ude=()=>{const e=te(),{infillTileSize:t,infillMethod:n}=W(cde),{t:r}=Z(),o=d.useCallback(i=>{e(Mw(i))},[e]),s=d.useCallback(()=>{e(Mw(32))},[e]);return a.jsx(tt,{isDisabled:n!=="tile",label:r("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},dde=d.memo(ude),fde=le([os],e=>{const{infillMethod:t}=e;return{infillMethod:t}},Se);function pde(){const{infillMethod:e}=W(fde);return a.jsxs(L,{children:[e==="tile"&&a.jsx(dde,{}),e==="patchmatch"&&a.jsx(lde,{})]})}const Sn=e=>e.canvas,Eo=le([xe],({canvas:e})=>e.batchIds.length>0||e.layerState.stagingArea.images.length>0),mde=le([Sn],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Se),hde=()=>{const e=te(),{boundingBoxScale:t}=W(mde),{t:n}=Z(),r=o=>{e(vT(o))};return a.jsx(Et,{feature:"scaleBeforeProcessing",children:a.jsx(nn,{label:n("parameters.scaleBeforeProcessing"),data:gT,value:t,onChange:r})})},gde=d.memo(hde),vde=le([os,Sn],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o,aspectRatio:s}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual",aspectRatio:s}},Se),xde=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=W(vde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{let m=r.width;const h=Math.floor(p);o&&(m=wr(h*o,64)),e(Jp({width:m,height:h}))},u=()=>{let p=r.width;const m=Math.floor(s);o&&(p=wr(m*o,64)),e(Jp({width:p,height:m}))};return a.jsx(tt,{isDisabled:!n,label:i("parameters.scaledHeight"),min:64,max:1536,step:64,value:r.height,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},bde=d.memo(xde),yde=le([Sn,os],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,scaledBoundingBoxDimensions:r,aspectRatio:s,isManual:n==="manual"}},Se),Cde=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=W(yde),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{const m=Math.floor(p);let h=r.height;o&&(h=wr(m/o,64)),e(Jp({width:m,height:h}))},u=()=>{const p=Math.floor(s);let m=r.height;o&&(m=wr(p/o,64)),e(Jp({width:p,height:m}))};return a.jsx(tt,{isDisabled:!n,label:i("parameters.scaledWidth"),min:64,max:1536,step:64,value:r.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},wde=d.memo(Cde),Sde=()=>{const{t:e}=Z();return a.jsx(oo,{label:e("parameters.infillScalingHeader"),children:a.jsxs(L,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(Rc,{children:[a.jsx(sde,{}),a.jsx(pde,{})]}),a.jsx(Yn,{}),a.jsxs(Rc,{children:[a.jsx(gde,{}),a.jsx(wde,{}),a.jsx(bde,{})]})]})})},BO=d.memo(Sde),kde=le([xe,Eo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Se),jde=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=W(kde),{t:s}=Z(),i=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,l=p=>{if(e(Vo({...n,height:Math.floor(p)})),o){const m=wr(p*o,64);e(Vo({width:m,height:Math.floor(p)}))}},u=()=>{if(e(Vo({...n,height:Math.floor(i)})),o){const p=wr(i*o,64);e(Vo({width:p,height:Math.floor(i)}))}};return a.jsx(tt,{label:s("parameters.boundingBoxHeight"),min:64,max:1536,step:64,value:n.height,onChange:l,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},_de=d.memo(jde),Ide=le([xe,Eo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Se),Pde=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=W(Ide),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{if(e(Vo({...n,width:Math.floor(p)})),o){const m=wr(p/o,64);e(Vo({width:Math.floor(p),height:m}))}},u=()=>{if(e(Vo({...n,width:Math.floor(s)})),o){const p=wr(s/o,64);e(Vo({width:Math.floor(s),height:p}))}};return a.jsx(tt,{label:i("parameters.boundingBoxWidth"),min:64,max:1536,step:64,value:n.width,onChange:l,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},Ede=d.memo(Pde),Mde=le([os,Sn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r}=e,{boundingBoxDimensions:o}=t;return{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,boundingBoxDimensions:o}});function uh(){const e=te(),{t}=Z(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=W(Mde),o=d.useCallback(()=>{n?(e(qu(!1)),AO.includes(r.width/r.height)?e(zo(r.width/r.height)):e(zo(null))):(e(qu(!0)),e(zo(r.width/r.height)))},[n,r,e]),s=d.useCallback(()=>{e(xT()),e(zo(null)),n&&e(zo(r.height/r.width))},[e,n,r]);return a.jsxs(L,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsx(Et,{feature:"paramRatio",children:a.jsxs(Kt,{as:L,flexDir:"row",alignItems:"center",gap:2,children:[a.jsx(wn,{children:t("parameters.aspectRatio")}),a.jsx(ba,{}),a.jsx(TO,{}),a.jsx(Fe,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(L8,{}),fontSize:20,onClick:s}),a.jsx(Fe,{tooltip:t("ui.lockRatio"),"aria-label":t("ui.lockRatio"),size:"sm",icon:a.jsx(pM,{}),isChecked:n,onClick:o})]})}),a.jsx(Ede,{}),a.jsx(_de,{})]})}const Ode=le(xe,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Se),Rde=()=>{const{shouldUseSliders:e,activeLabel:t}=W(Ode);return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(L,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(uh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(uh,{})]}),a.jsx(LO,{})]})})},Dde=d.memo(Rde);function Ade(){return a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(Dde,{}),a.jsx(i2,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(BO,{}),a.jsx(FO,{}),a.jsx(Qc,{})]})}function c2(){return a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[a.jsx(OO,{}),a.jsx(MO,{})]})}function Tde(){const e=W(o=>o.generation.horizontalSymmetrySteps),t=W(o=>o.generation.steps),n=te(),{t:r}=Z();return a.jsx(tt,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(Ow(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Ow(0))})}function Nde(){const e=W(o=>o.generation.verticalSymmetrySteps),t=W(o=>o.generation.steps),n=te(),{t:r}=Z();return a.jsx(tt,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(Rw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Rw(0))})}function $de(){const e=W(n=>n.generation.shouldUseSymmetry),t=te();return a.jsx(fn,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(bT(n.target.checked))})}const Lde=le(xe,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Se),zde=()=>{const{t:e}=Z(),{activeLabel:t}=W(Lde);return Ht("symmetry").isFeatureEnabled?a.jsx(oo,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs(L,{sx:{gap:2,flexDirection:"column"},children:[a.jsx($de,{}),a.jsx(Tde,{}),a.jsx(Nde,{})]})}):null},u2=d.memo(zde),Fde=le([xe],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:i,fineStep:l,coarseStep:u}=n.sd.img2imgStrength,{img2imgStrength:p}=e,m=t.shift?l:u;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:i,step:m}},Se),Bde=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=W(Fde),i=te(),{t:l}=Z(),u=d.useCallback(m=>i(Zp(m)),[i]),p=d.useCallback(()=>{i(Zp(t))},[i,t]);return a.jsx(Et,{feature:"paramDenoisingStrength",children:a.jsx(Rc,{children:a.jsx(tt,{label:`${l("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:u,handleReset:p,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})})})},HO=d.memo(Bde),Hde=()=>{const e=W(n=>n.ui.shouldUseSliders),{iterationsAndSeedLabel:t}=l2();return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(L,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(Oc,{})]}),a.jsx(HO,{}),a.jsx(NO,{})]})})},Vde=d.memo(Hde),Wde=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(Vde,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(u2,{}),a.jsx(Qc,{})]}),Ude=d.memo(Wde),Gde=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(zO,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(u2,{}),a.jsx(Qc,{})]}),Kde=d.memo(Gde),qde=()=>{const e=W(n=>n.ui.shouldUseSliders),{iterationsAndSeedLabel:t}=l2();return a.jsx(oo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(L,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(uh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(L,{gap:3,children:[a.jsx(rs,{}),a.jsx(Ps,{}),a.jsx(_s,{})]}),a.jsx(Is,{}),a.jsx(Ie,{pt:2,children:a.jsx(Es,{})}),a.jsx(uh,{})]}),a.jsx(HO,{})]})})},Xde=d.memo(qde),Qde=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(Xde,{}),a.jsx(Yc,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(u2,{}),a.jsx(BO,{}),a.jsx(FO,{}),a.jsx(Qc,{})]}),Yde=d.memo(Qde),Zde=()=>{const e=W(Jn),t=W(n=>n.generation.model);return e==="txt2img"?a.jsx(Kp,{children:t&&t.base_model==="sdxl"?a.jsx(Uue,{}):a.jsx(Kde,{})}):e==="img2img"?a.jsx(Kp,{children:t&&t.base_model==="sdxl"?a.jsx(Hue,{}):a.jsx(Ude,{})}):e==="unifiedCanvas"?a.jsx(Kp,{children:t&&t.base_model==="sdxl"?a.jsx(Ade,{}):a.jsx(Yde,{})}):null},Jde=d.memo(Zde),Kp=d.memo(e=>a.jsxs(L,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(X8,{}),a.jsx(L,{layerStyle:"first",sx:{w:"full",h:"full",position:"relative",borderRadius:"base",p:2},children:a.jsx(L,{sx:{w:"full",h:"full",position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(hg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:800,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:a.jsx(L,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:e.children})})})})})]}));Kp.displayName="ParametersPanelWrapper";const efe=le([xe],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},Se),tfe=()=>{const{initialImage:e}=W(efe),{currentData:t}=to((e==null?void 0:e.imageName)??$r.skipToken),n=d.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),r=d.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return a.jsx(ua,{imageDTO:t,droppableData:r,draggableData:n,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(Zn,{label:"No initial image selected"}),dataTestId:"initial-image"})},nfe=d.memo(tfe),rfe=le([xe],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},Se),ofe={type:"SET_INITIAL_IMAGE"},sfe=()=>{const{isResetButtonDisabled:e}=W(rfe),t=te(),{getUploadButtonProps:n,getUploadInputProps:r}=Uy({postUploadAction:ofe}),o=d.useCallback(()=>{t(yT())},[t]);return a.jsxs(L,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:2,gap:4},children:[a.jsxs(L,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(ve,{sx:{ps:2,fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(ba,{}),a.jsx(Fe,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(cg,{}),...n()}),a.jsx(Fe,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(Ud,{}),onClick:o,isDisabled:e})]}),a.jsx(nfe,{}),a.jsx("input",{...r()})]})},afe=d.memo(sfe),ife=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=Z(),o=W(s=>s.system.isConnected);return a.jsx(Fe,{onClick:t,icon:a.jsx(Br,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},VO=()=>{const[e,{isLoading:t}]=bh({fixedCacheKey:"enqueueBatch"}),[n,{isLoading:r}]=CT({fixedCacheKey:"enqueueGraph"}),[o,{isLoading:s}]=wI({fixedCacheKey:"resumeProcessor"}),[i,{isLoading:l}]=yI({fixedCacheKey:"pauseProcessor"}),[u,{isLoading:p}]=Jx({fixedCacheKey:"cancelQueueItem"}),[m,{isLoading:h}]=bI({fixedCacheKey:"clearQueue"}),[g,{isLoading:x}]=OI({fixedCacheKey:"pruneQueue"});return t||r||s||l||p||h||x},lfe=[{label:"RealESRGAN x2 Plus",value:"RealESRGAN_x2plus.pth",tooltip:"Attempts to retain sharpness, low smoothing",group:"x2 Upscalers"},{label:"RealESRGAN x4 Plus",value:"RealESRGAN_x4plus.pth",tooltip:"Best for photos and highly detailed images, medium smoothing",group:"x4 Upscalers"},{label:"RealESRGAN x4 Plus (anime 6B)",value:"RealESRGAN_x4plus_anime_6B.pth",tooltip:"Best for anime/manga, high smoothing",group:"x4 Upscalers"},{label:"ESRGAN SRx4",value:"ESRGAN_SRx4_DF2KOST_official-ff704c30.pth",tooltip:"Retains sharpness, low smoothing",group:"x4 Upscalers"}];function cfe(){const e=W(r=>r.postprocessing.esrganModelName),t=te(),n=r=>t(wT(r));return a.jsx(Pn,{label:"ESRGAN Model",value:e,itemComponent:ui,onChange:n,data:lfe})}const ufe=e=>{const{imageDTO:t}=e,n=te(),r=VO(),{t:o}=Z(),{isOpen:s,onOpen:i,onClose:l}=Lr(),{isAllowedToUpscale:u,detail:p}=ST(t),m=d.useCallback(()=>{l(),!(!t||!u)&&n(RI({imageDTO:t}))},[n,t,u,l]);return a.jsx(qd,{isOpen:s,onClose:l,triggerComponent:a.jsx(Fe,{tooltip:o("parameters.upscale"),onClick:i,icon:a.jsx(cM,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs(L,{sx:{flexDirection:"column",gap:4},children:[a.jsx(cfe,{}),a.jsx(at,{tooltip:p,size:"sm",isDisabled:!t||r||!u,onClick:m,children:o("parameters.upscaleImage")})]})})},dfe=d.memo(ufe),ffe=le([xe,Jn],({gallery:e,system:t,ui:n,config:r},o)=>{const{isConnected:s,shouldConfirmOnDelete:i,denoiseProgress:l}=t,{shouldShowImageDetails:u,shouldHidePreview:p,shouldShowProgressInViewer:m}=n,{shouldFetchMetadataFromApi:h}=r,g=e.selection[e.selection.length-1];return{shouldConfirmOnDelete:i,isConnected:s,shouldDisableToolbarButtons:!!(l!=null&&l.progress_image)||!g,shouldShowImageDetails:u,activeTabName:o,shouldHidePreview:p,shouldShowProgressInViewer:m,lastSelectedImage:g,shouldFetchMetadataFromApi:h}},{memoizeOptions:{resultEqualityCheck:Bt}}),pfe=e=>{const t=te(),{isConnected:n,shouldDisableToolbarButtons:r,shouldShowImageDetails:o,lastSelectedImage:s,shouldShowProgressInViewer:i,shouldFetchMetadataFromApi:l}=W(ffe),u=Ht("upscaling").isFeatureEnabled,p=VO(),m=sl(),{t:h}=Z(),{recallBothPrompts:g,recallSeed:x,recallAllParameters:y}=Sg(),{currentData:b}=to((s==null?void 0:s.image_name)??$r.skipToken),w=d.useMemo(()=>s?{image:s,shouldFetchMetadataFromApi:l}:$r.skipToken,[s,l]),{metadata:S,workflow:j,isLoading:_}=qx(w,{selectFromResult:B=>{var V,U;return{isLoading:B.isFetching,metadata:(V=B==null?void 0:B.currentData)==null?void 0:V.metadata,workflow:(U=B==null?void 0:B.currentData)==null?void 0:U.workflow}}}),E=d.useCallback(()=>{j&&t(Yx(j))},[t,j]),I=d.useCallback(()=>{y(S)},[S,y]);et("a",()=>{},[S,y]);const M=d.useCallback(()=>{x(S==null?void 0:S.seed)},[S==null?void 0:S.seed,x]);et("s",M,[b]);const R=d.useCallback(()=>{g(S==null?void 0:S.positive_prompt,S==null?void 0:S.negative_prompt,S==null?void 0:S.positive_style_prompt,S==null?void 0:S.negative_style_prompt)},[S==null?void 0:S.negative_prompt,S==null?void 0:S.positive_prompt,S==null?void 0:S.positive_style_prompt,S==null?void 0:S.negative_style_prompt,g]);et("p",R,[b]),et("w",E,[j]);const D=d.useCallback(()=>{t(z8()),t(vh(b))},[t,b]);et("shift+i",D,[b]);const A=d.useCallback(()=>{b&&t(RI({imageDTO:b}))},[t,b]),O=d.useCallback(()=>{b&&t(xh([b]))},[t,b]);et("Shift+U",()=>{A()},{enabled:()=>!!(u&&!r&&n)},[u,b,r,n]);const T=d.useCallback(()=>t(kT(!o)),[t,o]);et("i",()=>{b?T():m({title:h("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[b,o,m]),et("delete",()=>{O()},[t,b]);const X=d.useCallback(()=>{t(cI(!i))},[t,i]);return a.jsx(a.Fragment,{children:a.jsxs(L,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsx(Vt,{isAttached:!0,isDisabled:r,children:a.jsxs(Ah,{children:[a.jsx(Th,{as:Fe,"aria-label":h("parameters.imageActions"),tooltip:h("parameters.imageActions"),isDisabled:!b,icon:a.jsx(boe,{})}),a.jsx(Gi,{motionProps:vc,children:b&&a.jsx(F8,{imageDTO:b})})]})}),a.jsxs(Vt,{isAttached:!0,isDisabled:r,children:[a.jsx(Fe,{isLoading:_,icon:a.jsx(Gy,{}),tooltip:`${h("nodes.loadWorkflow")} (W)`,"aria-label":`${h("nodes.loadWorkflow")} (W)`,isDisabled:!j,onClick:E}),a.jsx(Fe,{isLoading:_,icon:a.jsx(hM,{}),tooltip:`${h("parameters.usePrompt")} (P)`,"aria-label":`${h("parameters.usePrompt")} (P)`,isDisabled:!(S!=null&&S.positive_prompt),onClick:R}),a.jsx(Fe,{isLoading:_,icon:a.jsx(gM,{}),tooltip:`${h("parameters.useSeed")} (S)`,"aria-label":`${h("parameters.useSeed")} (S)`,isDisabled:(S==null?void 0:S.seed)===null||(S==null?void 0:S.seed)===void 0,onClick:M}),a.jsx(Fe,{isLoading:_,icon:a.jsx(sM,{}),tooltip:`${h("parameters.useAll")} (A)`,"aria-label":`${h("parameters.useAll")} (A)`,isDisabled:!S,onClick:I})]}),u&&a.jsx(Vt,{isAttached:!0,isDisabled:p,children:u&&a.jsx(dfe,{imageDTO:b})}),a.jsx(Vt,{isAttached:!0,children:a.jsx(Fe,{icon:a.jsx(iM,{}),tooltip:`${h("parameters.info")} (I)`,"aria-label":`${h("parameters.info")} (I)`,isChecked:o,onClick:T})}),a.jsx(Vt,{isAttached:!0,children:a.jsx(Fe,{"aria-label":h("settings.displayInProgress"),tooltip:h("settings.displayInProgress"),icon:a.jsx(WJ,{}),isChecked:i,onClick:X})}),a.jsx(Vt,{isAttached:!0,children:a.jsx(ife,{onClick:O})})]})})},mfe=d.memo(pfe),hfe=le([xe,Zx],(e,t)=>{var j,_;const{data:n,status:r}=jT.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?Dw.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):Dw.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(e),s=e.gallery.selection[e.gallery.selection.length-1],i=r==="pending";if(!n||!s||(o==null?void 0:o.total)===0)return{isFetching:i,queryArgs:t,isOnFirstImage:!0,isOnLastImage:!0};const l={...t,offset:n.ids.length,limit:xI},u=_T.getSelectors(),p=u.selectAll(n),m=p.findIndex(E=>E.image_name===s.image_name),h=Bi(m+1,0,p.length-1),g=Bi(m-1,0,p.length-1),x=(j=p[h])==null?void 0:j.image_name,y=(_=p[g])==null?void 0:_.image_name,b=x?u.selectById(n,x):void 0,w=y?u.selectById(n,y):void 0,S=p.length;return{loadedImagesCount:p.length,currentImageIndex:m,areMoreImagesAvailable:((o==null?void 0:o.total)??0)>S,isFetching:r==="pending",nextImage:b,prevImage:w,queryArgs:l}},{memoizeOptions:{resultEqualityCheck:Bt}}),WO=()=>{const e=te(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:i,currentImageIndex:l}=W(hfe),u=d.useCallback(()=>{n&&e(Aw(n))},[e,n]),p=d.useCallback(()=>{t&&e(Aw(t))},[e,t]),[m]=vI(),h=d.useCallback(()=>{m(s)},[m,s]);return{handlePrevImage:u,handleNextImage:p,isOnFirstImage:l===0,isOnLastImage:l!==void 0&&l===i-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:h,isFetching:o}};function gfe(e){return Te({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const vfe=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=Z();return t?a.jsxs(L,{gap:2,children:[n&&a.jsx(Ft,{label:`Recall ${e}`,children:a.jsx(ys,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(gfe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(Ft,{label:`Copy ${e}`,children:a.jsx(ys,{"aria-label":`Copy ${e}`,icon:a.jsx(Hc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs(L,{direction:o?"column":"row",children:[a.jsxs(ve,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(Oh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(ZM,{mx:"2px"})]}):a.jsx(ve,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},xr=d.memo(vfe),xfe=e=>{const{metadata:t}=e,{t:n}=Z(),{recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallCfgScale:i,recallModel:l,recallScheduler:u,recallSteps:p,recallWidth:m,recallHeight:h,recallStrength:g,recallLoRA:x,recallControlNet:y,recallIPAdapter:b}=Sg(),w=d.useCallback(()=>{r(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,r]),S=d.useCallback(()=>{o(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,o]),j=d.useCallback(()=>{s(t==null?void 0:t.seed)},[t==null?void 0:t.seed,s]),_=d.useCallback(()=>{l(t==null?void 0:t.model)},[t==null?void 0:t.model,l]),E=d.useCallback(()=>{m(t==null?void 0:t.width)},[t==null?void 0:t.width,m]),I=d.useCallback(()=>{h(t==null?void 0:t.height)},[t==null?void 0:t.height,h]),M=d.useCallback(()=>{u(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,u]),R=d.useCallback(()=>{p(t==null?void 0:t.steps)},[t==null?void 0:t.steps,p]),D=d.useCallback(()=>{i(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,i]),A=d.useCallback(()=>{g(t==null?void 0:t.strength)},[t==null?void 0:t.strength,g]),O=d.useCallback(U=>{x(U)},[x]),T=d.useCallback(U=>{y(U)},[y]),X=d.useCallback(U=>{b(U)},[b]),B=d.useMemo(()=>t!=null&&t.controlnets?t.controlnets.filter(U=>c1(U.control_model)):[],[t==null?void 0:t.controlnets]),V=d.useMemo(()=>t!=null&&t.ipAdapters?t.ipAdapters.filter(U=>c1(U.ip_adapter_model)):[],[t==null?void 0:t.ipAdapters]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.created_by&&a.jsx(xr,{label:n("metadata.createdBy"),value:t.created_by}),t.generation_mode&&a.jsx(xr,{label:n("metadata.generationMode"),value:t.generation_mode}),t.positive_prompt&&a.jsx(xr,{label:n("metadata.positivePrompt"),labelPosition:"top",value:t.positive_prompt,onClick:w}),t.negative_prompt&&a.jsx(xr,{label:n("metadata.negativePrompt"),labelPosition:"top",value:t.negative_prompt,onClick:S}),t.seed!==void 0&&t.seed!==null&&a.jsx(xr,{label:n("metadata.seed"),value:t.seed,onClick:j}),t.model!==void 0&&t.model!==null&&t.model.model_name&&a.jsx(xr,{label:n("metadata.model"),value:t.model.model_name,onClick:_}),t.width&&a.jsx(xr,{label:n("metadata.width"),value:t.width,onClick:E}),t.height&&a.jsx(xr,{label:n("metadata.height"),value:t.height,onClick:I}),t.scheduler&&a.jsx(xr,{label:n("metadata.scheduler"),value:t.scheduler,onClick:M}),t.steps&&a.jsx(xr,{label:n("metadata.steps"),value:t.steps,onClick:R}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx(xr,{label:n("metadata.cfgScale"),value:t.cfg_scale,onClick:D}),t.strength&&a.jsx(xr,{label:n("metadata.strength"),value:t.strength,onClick:A}),t.loras&&t.loras.map((U,N)=>{if(dI(U.lora))return a.jsx(xr,{label:"LoRA",value:`${U.lora.model_name} - ${U.weight}`,onClick:()=>O(U)},N)}),B.map((U,N)=>{var $;return a.jsx(xr,{label:"ControlNet",value:`${($=U.control_model)==null?void 0:$.model_name} - ${U.control_weight}`,onClick:()=>T(U)},N)}),V.map((U,N)=>{var $;return a.jsx(xr,{label:"IP Adapter",value:`${($=U.ip_adapter_model)==null?void 0:$.model_name} - ${U.weight}`,onClick:()=>X(U)},N)})]})},bfe=d.memo(xfe),yfe=({image:e})=>{const{t}=Z(),{shouldFetchMetadataFromApi:n}=W(Xy),{metadata:r,workflow:o}=qx({image:e,shouldFetchMetadataFromApi:n},{selectFromResult:s=>{var i,l;return{metadata:(i=s==null?void 0:s.currentData)==null?void 0:i.metadata,workflow:(l=s==null?void 0:s.currentData)==null?void 0:l.workflow}}});return a.jsxs(L,{layerStyle:"first",sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs(L,{gap:2,children:[a.jsx(ve,{fontWeight:"semibold",children:"File:"}),a.jsxs(Oh,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(ZM,{mx:"2px"})]})]}),a.jsx(bfe,{metadata:r}),a.jsxs(rl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ol,{children:[a.jsx(Tr,{children:t("metadata.metadata")}),a.jsx(Tr,{children:t("metadata.imageDetails")}),a.jsx(Tr,{children:t("metadata.workflow")})]}),a.jsxs(zc,{children:[a.jsx(So,{children:r?a.jsx(Ya,{data:r,label:t("metadata.metadata")}):a.jsx(Zn,{label:t("metadata.noMetaData")})}),a.jsx(So,{children:e?a.jsx(Ya,{data:e,label:t("metadata.imageDetails")}):a.jsx(Zn,{label:t("metadata.noImageDetails")})}),a.jsx(So,{children:o?a.jsx(Ya,{data:o,label:t("metadata.workflow")}):a.jsx(Zn,{label:t("nodes.noWorkflow")})})]})]})]})},Cfe=d.memo(yfe),Yv={color:"base.100",pointerEvents:"auto"},wfe=()=>{const{t:e}=Z(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:l}=WO();return a.jsxs(Ie,{sx:{position:"relative",height:"100%",width:"100%"},children:[a.jsx(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineStart:0},children:!r&&a.jsx(ys,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(jJ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:Yv})}),a.jsxs(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(ys,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(_J,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:Yv}),o&&i&&!l&&a.jsx(ys,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(kJ,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:Yv}),o&&i&&l&&a.jsx(L,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(fa,{opacity:.5,size:"xl"})})]})]})},UO=d.memo(wfe),Sfe=le([xe,IT],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{denoiseProgress:i,shouldAntialiasProgressImage:l}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,denoiseProgress:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:l}},{memoizeOptions:{resultEqualityCheck:Bt}}),kfe=()=>{const{shouldShowImageDetails:e,imageName:t,denoiseProgress:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=W(Sfe),{handlePrevImage:s,handleNextImage:i,isOnLastImage:l,handleLoadMoreImages:u,areMoreImagesAvailable:p,isFetching:m}=WO();et("left",()=>{s()},[s]),et("right",()=>{if(l&&p&&!m){u();return}l||i()},[l,p,u,m,i]);const{currentData:h}=to(t??$r.skipToken),g=d.useMemo(()=>{if(h)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:h}}},[h]),x=d.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[y,b]=d.useState(!1),w=d.useRef(0),{t:S}=Z(),j=d.useCallback(()=>{b(!0),window.clearTimeout(w.current)},[]),_=d.useCallback(()=>{w.current=window.setTimeout(()=>{b(!1)},500)},[]);return a.jsxs(L,{onMouseOver:j,onMouseOut:_,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n!=null&&n.progress_image&&r?a.jsx(ga,{src:n.progress_image.dataURL,width:n.progress_image.width,height:n.progress_image.height,draggable:!1,"data-testid":"progress-image",sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(ua,{imageDTO:h,droppableData:x,draggableData:g,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:S("gallery.setCurrentImage"),noContentFallback:a.jsx(Zn,{icon:Yi,label:"No image selected"}),dataTestId:"image-preview"}),e&&h&&a.jsx(Ie,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(Cfe,{image:h})}),a.jsx(dr,{children:!e&&h&&y&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:"0",width:"100%",height:"100%",pointerEvents:"none"},children:a.jsx(UO,{})},"nextPrevButtons")})]})},jfe=d.memo(kfe),_fe=()=>a.jsxs(L,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(mfe,{}),a.jsx(jfe,{})]}),Ife=d.memo(_fe),Pfe=()=>a.jsx(Ie,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx(L,{sx:{width:"100%",height:"100%"},children:a.jsx(Ife,{})})}),GO=d.memo(Pfe),Efe=()=>{const e=d.useRef(null),t=d.useCallback(()=>{e.current&&e.current.setLayout([50,50])},[]),n=t2();return a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsxs(Ig,{ref:e,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},storage:n,units:"percentages",children:[a.jsx(Qa,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(afe,{})}),a.jsx(lh,{onDoubleClick:t}),a.jsx(Qa,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(GO,{})})]})})},Mfe=d.memo(Efe);var Ofe=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n};const p_=xd(Ofe);function Ex(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var Rfe=Object.defineProperty,m_=Object.getOwnPropertySymbols,Dfe=Object.prototype.hasOwnProperty,Afe=Object.prototype.propertyIsEnumerable,h_=(e,t,n)=>t in e?Rfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tfe=(e,t)=>{for(var n in t||(t={}))Dfe.call(t,n)&&h_(e,n,t[n]);if(m_)for(var n of m_(t))Afe.call(t,n)&&h_(e,n,t[n]);return e};function KO(e,t){if(t===null||typeof t!="object")return{};const n=Tfe({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const Nfe="__MANTINE_FORM_INDEX__";function g_(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${Nfe}`)):!1:!1}function v_(e,t,n){typeof n.value=="object"&&(n.value=tc(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function tc(e){if(typeof e!="object")return e;var t=0,n,r,o,s=Object.prototype.toString.call(e);if(s==="[object Object]"?o=Object.create(e.__proto__||null):s==="[object Array]"?o=Array(e.length):s==="[object Set]"?(o=new Set,e.forEach(function(i){o.add(tc(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,l){o.set(tc(l),tc(i))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(tc(e.buffer)):s==="[object ArrayBuffer]"?o=e.slice(0):s.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)v_(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||v_(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function qO(e){return typeof e!="string"?[]:e.split(".")}function Ag(e,t,n){const r=qO(e);if(r.length===0)return n;const o=tc(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let i=1;i<r.length-1;i+=1){if(s===void 0)return o;s=s[r[i]]}return s[r[r.length-1]]=t,o}function Qs(e,t){const n=qO(e);if(n.length===0||typeof t!="object"||t===null)return;let r=t[n[0]];for(let o=1;o<n.length&&r!==void 0;o+=1)r=r[n[o]];return r}function x_(e){const t=Ex(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Mx(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const i=e[s],l=`${n===""?"":`${n}.`}${s}`,u=Qs(l,t);let p=!1;return typeof i=="function"&&(o[l]=i(u,t,l)),typeof i=="object"&&Array.isArray(u)&&(p=!0,u.forEach((m,h)=>Mx(i,t,`${l}.${h}`,o))),typeof i=="object"&&typeof u=="object"&&u!==null&&(p||Mx(i,t,l,o)),o},r)}function Ox(e,t){return x_(typeof e=="function"?e(t):Mx(e,t))}function Dp(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Ox(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((i,l)=>i===s.split(".")[l]));return{hasError:!!o,error:o?r.errors[o]:null}}function $fe(e,{from:t,to:n},r){const o=Qs(e,r);if(!Array.isArray(o))return r;const s=[...o],i=o[t];return s.splice(t,1),s.splice(n,0,i),Ag(e,s,r)}var Lfe=Object.defineProperty,b_=Object.getOwnPropertySymbols,zfe=Object.prototype.hasOwnProperty,Ffe=Object.prototype.propertyIsEnumerable,y_=(e,t,n)=>t in e?Lfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bfe=(e,t)=>{for(var n in t||(t={}))zfe.call(t,n)&&y_(e,n,t[n]);if(b_)for(var n of b_(t))Ffe.call(t,n)&&y_(e,n,t[n]);return e};function Hfe(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=Bfe({},r);return Object.keys(r).every(l=>{let u,p;if(l.startsWith(o)&&(u=l,p=l.replace(o,s)),l.startsWith(s)&&(u=l.replace(s,o),p=l),u&&p){const m=i[u],h=i[p];return h===void 0?delete i[u]:i[u]=h,m===void 0?delete i[p]:i[p]=m,!1}return!0}),i}function Vfe(e,t,n){const r=Qs(e,n);return Array.isArray(r)?Ag(e,r.filter((o,s)=>s!==t),n):n}var Wfe=Object.defineProperty,C_=Object.getOwnPropertySymbols,Ufe=Object.prototype.hasOwnProperty,Gfe=Object.prototype.propertyIsEnumerable,w_=(e,t,n)=>t in e?Wfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kfe=(e,t)=>{for(var n in t||(t={}))Ufe.call(t,n)&&w_(e,n,t[n]);if(C_)for(var n of C_(t))Gfe.call(t,n)&&w_(e,n,t[n]);return e};function S_(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function k_(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=KO(`${o}.${t}`,s));const i=Kfe({},s),l=new Set;return Object.entries(s).filter(([u])=>{if(!u.startsWith(`${o}.`))return!1;const p=S_(u,o);return Number.isNaN(p)?!1:p>=t}).forEach(([u,p])=>{const m=S_(u,o),h=u.replace(`${o}.${m}`,`${o}.${m+r}`);i[h]=p,l.add(h),l.has(u)||delete i[u]}),i}function qfe(e,t,n,r){const o=Qs(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),Ag(e,s,r)}function j_(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(o=>o.startsWith(`${t}.`));return e[t]||r.some(o=>e[o])||!1}return n.some(r=>e[r])}function Xfe(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var Qfe=Object.defineProperty,Yfe=Object.defineProperties,Zfe=Object.getOwnPropertyDescriptors,__=Object.getOwnPropertySymbols,Jfe=Object.prototype.hasOwnProperty,epe=Object.prototype.propertyIsEnumerable,I_=(e,t,n)=>t in e?Qfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,La=(e,t)=>{for(var n in t||(t={}))Jfe.call(t,n)&&I_(e,n,t[n]);if(__)for(var n of __(t))epe.call(t,n)&&I_(e,n,t[n]);return e},Zv=(e,t)=>Yfe(e,Zfe(t));function fl({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:i=!1,transformValues:l=p=>p,validate:u}={}){const[p,m]=d.useState(r),[h,g]=d.useState(n),[x,y]=d.useState(e),[b,w]=d.useState(Ex(t)),S=d.useRef(e),j=G=>{S.current=G},_=d.useCallback(()=>m({}),[]),E=G=>{const K=G?La(La({},x),G):x;j(K),g({})},I=d.useCallback(G=>w(K=>Ex(typeof G=="function"?G(K):G)),[]),M=d.useCallback(()=>w({}),[]),R=d.useCallback(()=>{y(e),M(),j(e),g({}),_()},[]),D=d.useCallback((G,K)=>I(ee=>Zv(La({},ee),{[G]:K})),[]),A=d.useCallback(G=>I(K=>{if(typeof G!="string")return K;const ee=La({},K);return delete ee[G],ee}),[]),O=d.useCallback(G=>g(K=>{if(typeof G!="string")return K;const ee=KO(G,K);return delete ee[G],ee}),[]),T=d.useCallback((G,K)=>{const ee=g_(G,s);O(G),m(ce=>Zv(La({},ce),{[G]:!0})),y(ce=>{const J=Ag(G,K,ce);if(ee){const ie=Dp(G,u,J);ie.hasError?D(G,ie.error):A(G)}return J}),!ee&&o&&D(G,null)},[]),X=d.useCallback(G=>{y(K=>{const ee=typeof G=="function"?G(K):G;return La(La({},K),ee)}),o&&M()},[]),B=d.useCallback((G,K)=>{O(G),y(ee=>$fe(G,K,ee)),w(ee=>Hfe(G,K,ee))},[]),V=d.useCallback((G,K)=>{O(G),y(ee=>Vfe(G,K,ee)),w(ee=>k_(G,K,ee,-1))},[]),U=d.useCallback((G,K,ee)=>{O(G),y(ce=>qfe(G,K,ee,ce)),w(ce=>k_(G,ee,ce,1))},[]),N=d.useCallback(()=>{const G=Ox(u,x);return w(G.errors),G},[x,u]),$=d.useCallback(G=>{const K=Dp(G,u,x);return K.hasError?D(G,K.error):A(G),K},[x,u]),q=(G,{type:K="input",withError:ee=!0,withFocus:ce=!0}={})=>{const ie={onChange:Xfe(de=>T(G,de))};return ee&&(ie.error=b[G]),K==="checkbox"?ie.checked=Qs(G,x):ie.value=Qs(G,x),ce&&(ie.onFocus=()=>m(de=>Zv(La({},de),{[G]:!0})),ie.onBlur=()=>{if(g_(G,i)){const de=Dp(G,u,x);de.hasError?D(G,de.error):A(G)}}),ie},F=(G,K)=>ee=>{ee==null||ee.preventDefault();const ce=N();ce.hasErrors?K==null||K(ce.errors,x,ee):G==null||G(l(x),ee)},Q=G=>l(G||x),Y=d.useCallback(G=>{G.preventDefault(),R()},[]),se=G=>{if(G){const ee=Qs(G,h);if(typeof ee=="boolean")return ee;const ce=Qs(G,x),J=Qs(G,S.current);return!p_(ce,J)}return Object.keys(h).length>0?j_(h):!p_(x,S.current)},ae=d.useCallback(G=>j_(p,G),[p]),re=d.useCallback(G=>G?!Dp(G,u,x).hasError:!Ox(u,x).hasErrors,[x,u]);return{values:x,errors:b,setValues:X,setErrors:I,setFieldValue:T,setFieldError:D,clearFieldError:A,clearErrors:M,reset:R,validate:N,validateField:$,reorderListItem:B,removeListItem:V,insertListItem:U,getInputProps:q,onSubmit:F,onReset:Y,isDirty:se,isTouched:ae,setTouched:m,setDirty:g,resetTouched:_,resetDirty:E,isValid:re,getTransformedValues:Q}}function _n(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:i,base700:l,base900:u,accent500:p,accent300:m}=Wd(),{colorMode:h}=ha();return a.jsx(XE,{styles:()=>({input:{color:Ae(u,r)(h),backgroundColor:Ae(n,u)(h),borderColor:Ae(o,i)(h),borderWidth:2,outline:"none",":focus":{borderColor:Ae(m,p)(h)}},label:{color:Ae(l,s)(h),fontWeight:"normal",marginBottom:4}}),...t})}const tpe=[{value:"sd-1",label:an["sd-1"]},{value:"sd-2",label:an["sd-2"]},{value:"sdxl",label:an.sdxl},{value:"sdxl-refiner",label:an["sdxl-refiner"]}];function Jd(e){const{...t}=e,{t:n}=Z();return a.jsx(Pn,{label:n("modelManager.baseModel"),data:tpe,...t})}function XO(e){const{data:t}=DI(),{...n}=e;return a.jsx(Pn,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const npe=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Tg(e){const{...t}=e,{t:n}=Z();return a.jsx(Pn,{label:n("modelManager.variant"),data:npe,...t})}function dh(e,t=!0){let n;t?n=new RegExp("[^\\\\/]+(?=\\.)"):n=new RegExp("[^\\\\/]+(?=[\\\\/]?$)");const r=e.match(n);return r?r[0]:""}function QO(e){const{t}=Z(),n=te(),{model_path:r}=e,o=fl({initialValues:{model_name:r?dh(r):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"checkpoint",error:void 0,vae:"",variant:"normal",config:"configs\\stable-diffusion\\v1-inference.yaml"}}),[s]=AI(),[i,l]=d.useState(!1),u=p=>{s({body:p}).unwrap().then(m=>{n(ct(Qt({title:t("modelManager.modelAdded",{modelName:p.model_name}),status:"success"}))),o.reset(),r&&n(Sd(null))}).catch(m=>{m&&n(ct(Qt({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(p=>u(p)),style:{width:"100%"},children:a.jsxs(L,{flexDirection:"column",gap:2,children:[a.jsx(_n,{label:t("modelManager.model"),required:!0,...o.getInputProps("model_name")}),a.jsx(Jd,{label:t("modelManager.baseModel"),...o.getInputProps("base_model")}),a.jsx(_n,{label:t("modelManager.modelLocation"),required:!0,...o.getInputProps("path"),onBlur:p=>{if(o.values.model_name===""){const m=dh(p.currentTarget.value);m&&o.setFieldValue("model_name",m)}}}),a.jsx(_n,{label:t("modelManager.description"),...o.getInputProps("description")}),a.jsx(_n,{label:t("modelManager.vaeLocation"),...o.getInputProps("vae")}),a.jsx(Tg,{label:t("modelManager.variant"),...o.getInputProps("variant")}),a.jsxs(L,{flexDirection:"column",width:"100%",gap:2,children:[i?a.jsx(_n,{required:!0,label:t("modelManager.customConfigFileLocation"),...o.getInputProps("config")}):a.jsx(XO,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(br,{isChecked:i,onChange:()=>l(!i),label:t("modelManager.useCustomConfig")}),a.jsx(at,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function YO(e){const{t}=Z(),n=te(),{model_path:r}=e,[o]=AI(),s=fl({initialValues:{model_name:r?dh(r,!1):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"diffusers",error:void 0,vae:"",variant:"normal"}}),i=l=>{o({body:l}).unwrap().then(u=>{n(ct(Qt({title:t("modelManager.modelAdded",{modelName:l.model_name}),status:"success"}))),s.reset(),r&&n(Sd(null))}).catch(u=>{u&&n(ct(Qt({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:s.onSubmit(l=>i(l)),style:{width:"100%"},children:a.jsxs(L,{flexDirection:"column",gap:2,children:[a.jsx(_n,{required:!0,label:t("modelManager.model"),...s.getInputProps("model_name")}),a.jsx(Jd,{label:t("modelManager.baseModel"),...s.getInputProps("base_model")}),a.jsx(_n,{required:!0,label:t("modelManager.modelLocation"),placeholder:t("modelManager.modelLocationValidationMsg"),...s.getInputProps("path"),onBlur:l=>{if(s.values.model_name===""){const u=dh(l.currentTarget.value,!1);u&&s.setFieldValue("model_name",u)}}}),a.jsx(_n,{label:t("modelManager.description"),...s.getInputProps("description")}),a.jsx(_n,{label:t("modelManager.vaeLocation"),...s.getInputProps("vae")}),a.jsx(Tg,{label:t("modelManager.variant"),...s.getInputProps("variant")}),a.jsx(at,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const ZO=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function rpe(){const[e,t]=d.useState("diffusers"),{t:n}=Z();return a.jsxs(L,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx(Pn,{label:n("modelManager.modelType"),value:e,data:ZO,onChange:r=>{r&&t(r)}}),a.jsxs(L,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx(YO,{}),e==="checkpoint"&&a.jsx(QO,{})]})]})}const ope=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function spe(){const e=te(),{t}=Z(),[n,{isLoading:r}]=TI(),o=fl({initialValues:{location:"",prediction_type:void 0}}),s=i=>{const l={location:i.location,prediction_type:i.prediction_type==="none"?void 0:i.prediction_type};n({body:l}).unwrap().then(u=>{e(ct(Qt({title:t("toast.modelAddedSimple"),status:"success"}))),o.reset()}).catch(u=>{u&&e(ct(Qt({title:`${u.data.detail} `,status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(i=>s(i)),style:{width:"100%"},children:a.jsxs(L,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(_n,{label:t("modelManager.modelLocation"),placeholder:t("modelManager.simpleModelDesc"),w:"100%",...o.getInputProps("location")}),a.jsx(Pn,{label:t("modelManager.predictionType"),data:ope,defaultValue:"none",...o.getInputProps("prediction_type")}),a.jsx(at,{type:"submit",isLoading:r,children:t("modelManager.addModel")})]})})}function ape(){const[e,t]=d.useState("simple");return a.jsxs(L,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(Vt,{isAttached:!0,children:[a.jsx(at,{size:"sm",isChecked:e=="simple",onClick:()=>t("simple"),children:"Simple"}),a.jsx(at,{size:"sm",isChecked:e=="advanced",onClick:()=>t("advanced"),children:"Advanced"})]}),a.jsxs(L,{sx:{p:4,borderRadius:4,background:"base.200",_dark:{background:"base.800"}},children:[e==="simple"&&a.jsx(spe,{}),e==="advanced"&&a.jsx(rpe,{})]})]})}function ipe(e){const{...t}=e;return a.jsx(H6,{w:"100%",...t,children:e.children})}function lpe(){const e=W(b=>b.modelmanager.searchFolder),[t,n]=d.useState(""),{data:r}=Xo(Ei),{foundModels:o,alreadyInstalled:s,filteredModels:i}=NI({search_path:e||""},{selectFromResult:({data:b})=>{const w=q9(r==null?void 0:r.entities),S=nr(w,"path"),j=U9(b,S),_=J9(b,S);return{foundModels:b,alreadyInstalled:P_(_,t),filteredModels:P_(j,t)}}}),[l,{isLoading:u}]=TI(),p=te(),{t:m}=Z(),h=d.useCallback(b=>{const w=b.currentTarget.id.split("\\").splice(-1)[0];l({body:{location:b.currentTarget.id}}).unwrap().then(S=>{p(ct(Qt({title:`Added Model: ${w}`,status:"success"})))}).catch(S=>{S&&p(ct(Qt({title:m("toast.modelAddFailed"),status:"error"})))})},[p,l,m]),g=d.useCallback(b=>{n(b.target.value)},[]),x=({models:b,showActions:w=!0})=>b.map(S=>a.jsxs(L,{sx:{p:4,gap:4,alignItems:"center",borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(L,{w:"100%",sx:{flexDirection:"column",minW:"25%"},children:[a.jsx(ve,{sx:{fontWeight:600},children:S.split("\\").slice(-1)[0]}),a.jsx(ve,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:S})]}),w?a.jsxs(L,{gap:2,children:[a.jsx(at,{id:S,onClick:h,isLoading:u,children:m("modelManager.quickAdd")}),a.jsx(at,{onClick:()=>p(Sd(S)),isLoading:u,children:m("modelManager.advanced")})]}):a.jsx(ve,{sx:{fontWeight:600,p:2,borderRadius:4,color:"accent.50",bg:"accent.400",_dark:{color:"accent.100",bg:"accent.600"}},children:"Installed"})]},S));return(()=>e?!o||o.length===0?a.jsx(L,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",height:96,userSelect:"none",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(ve,{variant:"subtext",children:m("modelManager.noModels")})}):a.jsxs(L,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(vo,{onChange:g,label:m("modelManager.search"),labelPos:"side"}),a.jsxs(L,{p:2,gap:2,children:[a.jsxs(ve,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(ve,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",i.length]})]}),a.jsx(ipe,{offsetScrollbars:!0,children:a.jsxs(L,{gap:2,flexDirection:"column",children:[x({models:i}),x({models:s,showActions:!1})]})})]}):null)()}const P_=(e,t)=>{const n=[];return Rn(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function cpe(){const e=W(l=>l.modelmanager.advancedAddScanModel),{t}=Z(),[n,r]=d.useState("diffusers"),[o,s]=d.useState(!0);d.useEffect(()=>{e&&[".ckpt",".safetensors",".pth",".pt"].some(l=>e.endsWith(l))?r("checkpoint"):r("diffusers")},[e,r,o]);const i=te();return e?a.jsxs(Ie,{as:In.div,initial:{x:-100,opacity:0},animate:{x:0,opacity:1,transition:{duration:.2}},sx:{display:"flex",flexDirection:"column",minWidth:"40%",maxHeight:window.innerHeight-300,overflow:"scroll",p:4,gap:4,borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(L,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(ve,{size:"xl",fontWeight:600,children:o||n==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(Fe,{icon:a.jsx(Ic,{}),"aria-label":t("modelManager.closeAdvanced"),onClick:()=>i(Sd(null)),size:"sm"})]}),a.jsx(Pn,{label:t("modelManager.modelType"),value:n,data:ZO,onChange:l=>{l&&(r(l),s(l==="checkpoint"))}}),o?a.jsx(QO,{model_path:e},e):a.jsx(YO,{model_path:e},e)]}):null}function upe(){const e=te(),{t}=Z(),n=W(l=>l.modelmanager.searchFolder),{refetch:r}=NI({search_path:n||""}),o=fl({initialValues:{folder:""}}),s=d.useCallback(l=>{e(Tw(l.folder))},[e]),i=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(l=>s(l)),style:{width:"100%"},children:a.jsxs(L,{sx:{w:"100%",gap:2,borderRadius:4,alignItems:"center"},children:[a.jsxs(L,{w:"100%",alignItems:"center",gap:4,minH:12,children:[a.jsx(ve,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",minW:"max-content",_dark:{color:"base.300"}},children:"Folder"}),n?a.jsx(L,{sx:{w:"100%",p:2,px:4,bg:"base.300",borderRadius:4,fontSize:"sm",fontWeight:"bold",_dark:{bg:"base.700"}},children:n}):a.jsx(vo,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs(L,{gap:2,children:[n?a.jsx(Fe,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(xM,{}),onClick:i,fontSize:18,size:"sm"}):a.jsx(Fe,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(nee,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(Fe,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Br,{}),size:"sm",onClick:()=>{e(Tw(null)),e(Sd(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const dpe=d.memo(upe);function fpe(){return a.jsxs(L,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(dpe,{}),a.jsxs(L,{gap:4,children:[a.jsx(L,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(lpe,{})}),a.jsx(cpe,{})]})]})}function ppe(){const[e,t]=d.useState("add"),{t:n}=Z();return a.jsxs(L,{flexDirection:"column",gap:4,children:[a.jsxs(Vt,{isAttached:!0,children:[a.jsx(at,{onClick:()=>t("add"),isChecked:e=="add",size:"sm",width:"100%",children:n("modelManager.addModel")}),a.jsx(at,{onClick:()=>t("scan"),isChecked:e=="scan",size:"sm",width:"100%",children:n("modelManager.scanForModels")})]}),e=="add"&&a.jsx(ape,{}),e=="scan"&&a.jsx(fpe,{})]})}const mpe=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function hpe(){var $,q;const{t:e}=Z(),t=te(),{data:n}=Xo(Ei),[r,{isLoading:o}]=PT(),[s,i]=d.useState("sd-1"),l=qw(n==null?void 0:n.entities,(F,Q)=>(F==null?void 0:F.model_format)==="diffusers"&&(F==null?void 0:F.base_model)==="sd-1"),u=qw(n==null?void 0:n.entities,(F,Q)=>(F==null?void 0:F.model_format)==="diffusers"&&(F==null?void 0:F.base_model)==="sd-2"),p=d.useMemo(()=>({"sd-1":l,"sd-2":u}),[l,u]),[m,h]=d.useState((($=Object.keys(p[s]))==null?void 0:$[0])??null),[g,x]=d.useState(((q=Object.keys(p[s]))==null?void 0:q[1])??null),[y,b]=d.useState(null),[w,S]=d.useState(""),[j,_]=d.useState(.5),[E,I]=d.useState("weighted_sum"),[M,R]=d.useState("root"),[D,A]=d.useState(""),[O,T]=d.useState(!1),X=Object.keys(p[s]).filter(F=>F!==g&&F!==y),B=Object.keys(p[s]).filter(F=>F!==m&&F!==y),V=Object.keys(p[s]).filter(F=>F!==m&&F!==g),U=F=>{i(F),h(null),x(null)},N=()=>{const F=[];let Q=[m,g,y];Q=Q.filter(se=>se!==null),Q.forEach(se=>{var re;const ae=(re=se==null?void 0:se.split("/"))==null?void 0:re[2];ae&&F.push(ae)});const Y={model_names:F,merged_model_name:w!==""?w:F.join("-"),alpha:j,interp:E,force:O,merge_dest_directory:M==="root"?void 0:D};r({base_model:s,body:Y}).unwrap().then(se=>{t(ct(Qt({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(se=>{se&&t(ct(Qt({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs(L,{flexDirection:"column",rowGap:4,children:[a.jsxs(L,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(ve,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(ve,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs(L,{columnGap:4,children:[a.jsx(Pn,{label:"Model Type",w:"100%",data:mpe,value:s,onChange:U}),a.jsx(nn,{label:e("modelManager.modelOne"),w:"100%",value:m,placeholder:e("modelManager.selectModel"),data:X,onChange:F=>h(F)}),a.jsx(nn,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:g,data:B,onChange:F=>x(F)}),a.jsx(nn,{label:e("modelManager.modelThree"),data:V,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:F=>{F?(b(F),I("weighted_sum")):(b(null),I("add_difference"))}})]}),a.jsx(vo,{label:e("modelManager.mergedModelName"),value:w,onChange:F=>S(F.target.value)}),a.jsxs(L,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(tt,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:j,onChange:F=>_(F),withInput:!0,withReset:!0,handleReset:()=>_(.5),withSliderMarks:!0}),a.jsx(ve,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs(L,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(ve,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(cm,{value:E,onChange:F=>I(F),children:a.jsx(L,{columnGap:4,children:y===null?a.jsxs(a.Fragment,{children:[a.jsx(Ks,{value:"weighted_sum",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(Ks,{value:"sigmoid",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(Ks,{value:"inv_sigmoid",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(Ks,{value:"add_difference",children:a.jsx(Ft,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs(L,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.900"}},children:[a.jsxs(L,{columnGap:4,children:[a.jsx(ve,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(cm,{value:M,onChange:F=>R(F),children:a.jsxs(L,{columnGap:4,children:[a.jsx(Ks,{value:"root",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(Ks,{value:"custom",children:a.jsx(ve,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),M==="custom"&&a.jsx(vo,{label:e("modelManager.mergedModelCustomSaveLocation"),value:D,onChange:F=>A(F.target.value)})]}),a.jsx(br,{label:e("modelManager.ignoreMismatch"),isChecked:O,onChange:F=>T(F.target.checked),fontWeight:"500"}),a.jsx(at,{onClick:N,isLoading:o,isDisabled:m===null||g===null,children:e("modelManager.merge")})]})}function gpe(e){const{model:t}=e,n=te(),{t:r}=Z(),[o,{isLoading:s}]=ET(),[i,l]=d.useState("InvokeAIRoot"),[u,p]=d.useState("");d.useEffect(()=>{l("InvokeAIRoot")},[t]);const m=()=>{l("InvokeAIRoot")},h=()=>{const g={base_model:t.base_model,model_name:t.model_name,convert_dest_directory:i==="Custom"?u:void 0};if(i==="Custom"&&u===""){n(ct(Qt({title:r("modelManager.noCustomLocationProvided"),status:"error"})));return}n(ct(Qt({title:`${r("modelManager.convertingModelBegin")}: ${t.model_name}`,status:"info"}))),o(g).unwrap().then(()=>{n(ct(Qt({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(()=>{n(ct(Qt({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsxs(kg,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:h,cancelCallback:m,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(at,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",isLoading:s,children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[a.jsxs(L,{flexDirection:"column",rowGap:4,children:[a.jsx(ve,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(Od,{children:[a.jsx(Qr,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(Qr,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(Qr,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(Qr,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(ve,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs(L,{flexDir:"column",gap:2,children:[a.jsxs(L,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(ve,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(cm,{value:i,onChange:g=>l(g),children:a.jsxs(L,{gap:4,children:[a.jsx(Ks,{value:"InvokeAIRoot",children:a.jsx(Ft,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(Ks,{value:"Custom",children:a.jsx(Ft,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),i==="Custom"&&a.jsxs(L,{flexDirection:"column",rowGap:2,children:[a.jsx(ve,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(vo,{value:u,onChange:g=>{p(g.target.value)},width:"full"})]})]})]})}function vpe(e){const{model:t}=e,[n,{isLoading:r}]=$I(),{data:o}=DI(),[s,i]=d.useState(!1);d.useEffect(()=>{o!=null&&o.includes(t.config)||i(!0)},[o,t.config]);const l=te(),{t:u}=Z(),p=fl({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"main",path:t.path?t.path:"",description:t.description?t.description:"",model_format:"checkpoint",vae:t.vae?t.vae:"",config:t.config?t.config:"",variant:t.variant},validate:{path:h=>h.trim().length===0?"Must provide a path":null}}),m=d.useCallback(h=>{const g={base_model:t.base_model,model_name:t.model_name,body:h};n(g).unwrap().then(x=>{p.setValues(x),l(ct(Qt({title:u("modelManager.modelUpdated"),status:"success"})))}).catch(x=>{p.reset(),l(ct(Qt({title:u("modelManager.modelUpdateFailed"),status:"error"})))})},[p,l,t.base_model,t.model_name,u,n]);return a.jsxs(L,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(L,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs(L,{flexDirection:"column",children:[a.jsx(ve,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(ve,{fontSize:"sm",color:"base.400",children:[an[t.base_model]," Model"]})]}),[""].includes(t.base_model)?a.jsx(Ds,{sx:{p:2,borderRadius:4,bg:"error.200",_dark:{bg:"error.400"}},children:"Conversion Not Supported"}):a.jsx(gpe,{model:t})]}),a.jsx(Yn,{}),a.jsx(L,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:p.onSubmit(h=>m(h)),children:a.jsxs(L,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:u("modelManager.name"),...p.getInputProps("model_name")}),a.jsx(_n,{label:u("modelManager.description"),...p.getInputProps("description")}),a.jsx(Jd,{required:!0,...p.getInputProps("base_model")}),a.jsx(Tg,{required:!0,...p.getInputProps("variant")}),a.jsx(_n,{required:!0,label:u("modelManager.modelLocation"),...p.getInputProps("path")}),a.jsx(_n,{label:u("modelManager.vaeLocation"),...p.getInputProps("vae")}),a.jsxs(L,{flexDirection:"column",gap:2,children:[s?a.jsx(_n,{required:!0,label:u("modelManager.config"),...p.getInputProps("config")}):a.jsx(XO,{required:!0,...p.getInputProps("config")}),a.jsx(br,{isChecked:s,onChange:()=>i(!s),label:"Use Custom Config"})]}),a.jsx(at,{type:"submit",isLoading:r,children:u("modelManager.updateModel")})]})})})]})}function xpe(e){const{model:t}=e,[n,{isLoading:r}]=$I(),o=te(),{t:s}=Z(),i=fl({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"main",path:t.path?t.path:"",description:t.description?t.description:"",model_format:"diffusers",vae:t.vae?t.vae:"",variant:t.variant},validate:{path:u=>u.trim().length===0?"Must provide a path":null}}),l=d.useCallback(u=>{const p={base_model:t.base_model,model_name:t.model_name,body:u};n(p).unwrap().then(m=>{i.setValues(m),o(ct(Qt({title:s("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{i.reset(),o(ct(Qt({title:s("modelManager.modelUpdateFailed"),status:"error"})))})},[i,o,t.base_model,t.model_name,s,n]);return a.jsxs(L,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(L,{flexDirection:"column",children:[a.jsx(ve,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(ve,{fontSize:"sm",color:"base.400",children:[an[t.base_model]," Model"]})]}),a.jsx(Yn,{}),a.jsx("form",{onSubmit:i.onSubmit(u=>l(u)),children:a.jsxs(L,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:s("modelManager.name"),...i.getInputProps("model_name")}),a.jsx(_n,{label:s("modelManager.description"),...i.getInputProps("description")}),a.jsx(Jd,{required:!0,...i.getInputProps("base_model")}),a.jsx(Tg,{required:!0,...i.getInputProps("variant")}),a.jsx(_n,{required:!0,label:s("modelManager.modelLocation"),...i.getInputProps("path")}),a.jsx(_n,{label:s("modelManager.vaeLocation"),...i.getInputProps("vae")}),a.jsx(at,{type:"submit",isLoading:r,children:s("modelManager.updateModel")})]})})]})}function bpe(e){const{model:t}=e,[n,{isLoading:r}]=MT(),o=te(),{t:s}=Z(),i=fl({initialValues:{model_name:t.model_name?t.model_name:"",base_model:t.base_model,model_type:"lora",path:t.path?t.path:"",description:t.description?t.description:"",model_format:t.model_format},validate:{path:u=>u.trim().length===0?"Must provide a path":null}}),l=d.useCallback(u=>{const p={base_model:t.base_model,model_name:t.model_name,body:u};n(p).unwrap().then(m=>{i.setValues(m),o(ct(Qt({title:s("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{i.reset(),o(ct(Qt({title:s("modelManager.modelUpdateFailed"),status:"error"})))})},[o,i,t.base_model,t.model_name,s,n]);return a.jsxs(L,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(L,{flexDirection:"column",children:[a.jsx(ve,{fontSize:"lg",fontWeight:"bold",children:t.model_name}),a.jsxs(ve,{fontSize:"sm",color:"base.400",children:[an[t.base_model]," Model ⋅"," ",OT[t.model_format]," format"]})]}),a.jsx(Yn,{}),a.jsx("form",{onSubmit:i.onSubmit(u=>l(u)),children:a.jsxs(L,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(_n,{label:s("modelManager.name"),...i.getInputProps("model_name")}),a.jsx(_n,{label:s("modelManager.description"),...i.getInputProps("description")}),a.jsx(Jd,{...i.getInputProps("base_model")}),a.jsx(_n,{label:s("modelManager.modelLocation"),...i.getInputProps("path")}),a.jsx(at,{type:"submit",isLoading:r,children:s("modelManager.updateModel")})]})})]})}function ype(e){const{t}=Z(),n=te(),[r]=RT(),[o]=DT(),{model:s,isSelected:i,setSelectedModelId:l}=e,u=d.useCallback(()=>{l(s.id)},[s.id,l]),p=d.useCallback(()=>{const m={main:r,lora:o,onnx:r}[s.model_type];m(s).unwrap().then(h=>{n(ct(Qt({title:`${t("modelManager.modelDeleted")}: ${s.model_name}`,status:"success"})))}).catch(h=>{h&&n(ct(Qt({title:`${t("modelManager.modelDeleteFailed")}: ${s.model_name}`,status:"error"})))}),l(void 0)},[r,o,s,l,n,t]);return a.jsxs(L,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx(L,{as:at,isChecked:i,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:i?"accent.400":"base.100",color:i?"base.50":"base.800",_hover:{bg:i?"accent.500":"base.300",color:i?"base.50":"base.800"},_dark:{color:i?"base.50":"base.100",bg:i?"accent.600":"base.850",_hover:{color:i?"base.50":"base.100",bg:i?"accent.550":"base.700"}}},onClick:u,children:a.jsxs(L,{gap:4,alignItems:"center",children:[a.jsx(Ds,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:AT[s.base_model]}),a.jsx(Ft,{label:s.description,hasArrow:!0,placement:"bottom",children:a.jsx(ve,{sx:{fontWeight:500},children:s.model_name})})]})}),a.jsx(kg,{title:t("modelManager.deleteModel"),acceptCallback:p,acceptButtonText:t("modelManager.delete"),triggerComponent:a.jsx(Fe,{icon:a.jsx(one,{}),"aria-label":t("modelManager.deleteConfig"),colorScheme:"error"}),children:a.jsxs(L,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:t("modelManager.deleteMsg1")}),a.jsx("p",{children:t("modelManager.deleteMsg2")})]})})]})}const Cpe=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=Z(),[o,s]=d.useState(""),[i,l]=d.useState("all"),{filteredDiffusersModels:u,isLoadingDiffusersModels:p}=Xo(Ei,{selectFromResult:({data:_,isLoading:E})=>({filteredDiffusersModels:Iu(_,"main","diffusers",o),isLoadingDiffusersModels:E})}),{filteredCheckpointModels:m,isLoadingCheckpointModels:h}=Xo(Ei,{selectFromResult:({data:_,isLoading:E})=>({filteredCheckpointModels:Iu(_,"main","checkpoint",o),isLoadingCheckpointModels:E})}),{filteredLoraModels:g,isLoadingLoraModels:x}=Cd(void 0,{selectFromResult:({data:_,isLoading:E})=>({filteredLoraModels:Iu(_,"lora",void 0,o),isLoadingLoraModels:E})}),{filteredOnnxModels:y,isLoadingOnnxModels:b}=Ku(Ei,{selectFromResult:({data:_,isLoading:E})=>({filteredOnnxModels:Iu(_,"onnx","onnx",o),isLoadingOnnxModels:E})}),{filteredOliveModels:w,isLoadingOliveModels:S}=Ku(Ei,{selectFromResult:({data:_,isLoading:E})=>({filteredOliveModels:Iu(_,"onnx","olive",o),isLoadingOliveModels:E})}),j=d.useCallback(_=>{s(_.target.value)},[]);return a.jsx(L,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:a.jsxs(L,{flexDirection:"column",gap:4,paddingInlineEnd:4,children:[a.jsxs(Vt,{isAttached:!0,children:[a.jsx(at,{onClick:()=>l("all"),isChecked:i==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(at,{size:"sm",onClick:()=>l("diffusers"),isChecked:i==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(at,{size:"sm",onClick:()=>l("checkpoint"),isChecked:i==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(at,{size:"sm",onClick:()=>l("onnx"),isChecked:i==="onnx",children:r("modelManager.onnxModels")}),a.jsx(at,{size:"sm",onClick:()=>l("olive"),isChecked:i==="olive",children:r("modelManager.oliveModels")}),a.jsx(at,{size:"sm",onClick:()=>l("lora"),isChecked:i==="lora",children:r("modelManager.loraModels")})]}),a.jsx(vo,{onChange:j,label:r("modelManager.search"),labelPos:"side"}),a.jsxs(L,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Xl,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(i)&&!p&&u.length>0&&a.jsx(ql,{title:"Diffusers",modelList:u,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),h&&a.jsx(Xl,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(i)&&!h&&m.length>0&&a.jsx(ql,{title:"Checkpoints",modelList:m,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),x&&a.jsx(Xl,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(i)&&!x&&g.length>0&&a.jsx(ql,{title:"LoRAs",modelList:g,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),S&&a.jsx(Xl,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(i)&&!S&&w.length>0&&a.jsx(ql,{title:"Olives",modelList:w,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),b&&a.jsx(Xl,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(i)&&!b&&y.length>0&&a.jsx(ql,{title:"ONNX",modelList:y,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},wpe=d.memo(Cpe),Iu=(e,t,n,r)=>{const o=[];return Rn(e==null?void 0:e.entities,s=>{if(!s)return;const i=s.model_name.toLowerCase().includes(r.toLowerCase()),l=n===void 0||s.model_format===n,u=s.model_type===t;i&&l&&u&&o.push(s)}),o},d2=d.memo(e=>a.jsx(L,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));d2.displayName="StyledModelContainer";const ql=d.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(d2,{children:a.jsxs(L,{sx:{gap:2,flexDir:"column"},children:[a.jsx(ve,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(ype,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});ql.displayName="ModelListWrapper";const Xl=d.memo(({loadingMessage:e})=>a.jsx(d2,{children:a.jsxs(L,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(fa,{}),a.jsx(ve,{variant:"subtext",children:e||"Fetching..."})]})}));Xl.displayName="FetchingModelsLoader";function Spe(){const[e,t]=d.useState(),{mainModel:n}=Xo(Ei,{selectFromResult:({data:s})=>({mainModel:e?s==null?void 0:s.entities[e]:void 0})}),{loraModel:r}=Cd(void 0,{selectFromResult:({data:s})=>({loraModel:e?s==null?void 0:s.entities[e]:void 0})}),o=n||r;return a.jsxs(L,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(wpe,{selectedModelId:e,setSelectedModelId:t}),a.jsx(kpe,{model:o})]})}const kpe=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(vpe,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(xpe,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(bpe,{model:t},t.id):a.jsx(L,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(ve,{variant:"subtext",children:"No Model Selected"})})};function jpe(){const{t:e}=Z();return a.jsxs(L,{sx:{w:"full",p:4,borderRadius:4,gap:4,justifyContent:"space-between",alignItems:"center",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(L,{sx:{flexDirection:"column",gap:2},children:[a.jsx(ve,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(ve,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Gc,{})]})}function _pe(){return a.jsx(L,{children:a.jsx(jpe,{})})}const E_=[{id:"modelManager",label:yt.t("modelManager.modelManager"),content:a.jsx(Spe,{})},{id:"importModels",label:yt.t("modelManager.importModels"),content:a.jsx(ppe,{})},{id:"mergeModels",label:yt.t("modelManager.mergeModels"),content:a.jsx(hpe,{})},{id:"settings",label:yt.t("modelManager.settings"),content:a.jsx(_pe,{})}],Ipe=()=>a.jsxs(rl,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(ol,{children:E_.map(e=>a.jsx(Tr,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(zc,{sx:{w:"full",h:"full"},children:E_.map(e=>a.jsx(So,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),Ppe=d.memo(Ipe),Epe={enum:"",BoardField:void 0,boolean:!1,BooleanCollection:[],BooleanPolymorphic:!1,ClipField:void 0,Collection:[],CollectionItem:void 0,ColorCollection:[],ColorField:void 0,ColorPolymorphic:void 0,ConditioningCollection:[],ConditioningField:void 0,ConditioningPolymorphic:void 0,ControlCollection:[],ControlField:void 0,ControlNetModelField:void 0,ControlPolymorphic:void 0,DenoiseMaskField:void 0,float:0,FloatCollection:[],FloatPolymorphic:0,ImageCollection:[],ImageField:void 0,ImagePolymorphic:void 0,integer:0,IntegerCollection:[],IntegerPolymorphic:0,IPAdapterCollection:[],IPAdapterField:void 0,IPAdapterModelField:void 0,IPAdapterPolymorphic:void 0,LatentsCollection:[],LatentsField:void 0,LatentsPolymorphic:void 0,LoRAModelField:void 0,MainModelField:void 0,ONNXModelField:void 0,Scheduler:"euler",SDXLMainModelField:void 0,SDXLRefinerModelField:void 0,string:"",StringCollection:[],StringPolymorphic:"",T2IAdapterCollection:[],T2IAdapterField:void 0,T2IAdapterModelField:void 0,T2IAdapterPolymorphic:void 0,UNetField:void 0,VaeField:void 0,VaeModelField:void 0},Mpe=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return n.value=t.default??Epe[t.type],n},Ope=le([e=>e.nodes],e=>e.nodeTemplates),Jv={dragHandle:`.${tl}`},Rpe=()=>{const e=W(Ope),t=sb();return d.useCallback(n=>{var x;const r=Zs();let o=window.innerWidth/2,s=window.innerHeight/2;const i=(x=document.querySelector("#workflow-editor"))==null?void 0:x.getBoundingClientRect();i&&(o=i.width/2-g1/2,s=i.height/2-g1/2);const{x:l,y:u}=t.project({x:o,y:s});if(n==="current_image")return{...Jv,id:r,type:"current_image",position:{x:l,y:u},data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(n==="notes")return{...Jv,id:r,type:"notes",position:{x:l,y:u},data:{id:r,isOpen:!0,label:"Notes",notes:"",type:"notes"}};const p=e[n];if(p===void 0){console.error(`Unable to find template ${n}.`);return}const m=Nw(p.inputs,(y,b,w)=>{const S=Zs(),j=Mpe(S,b);return y[w]=j,y},{}),h=Nw(p.outputs,(y,b,w)=>{const j={id:Zs(),name:w,type:b.type,fieldKind:"output"};return y[w]=j,y},{});return{...Jv,id:r,type:"invocation",position:{x:l,y:u},data:{id:r,type:n,version:p.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:n!=="save_image",inputs:m,outputs:h,useCache:p.useCache}}},[e,t])},JO=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(ve,{fontWeight:600,children:e}),a.jsx(ve,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));JO.displayName="AddNodePopoverSelectItem";const Dpe=(e,t)=>{const n=new RegExp(e.trim().replace(/[-[\]{}()*+!<=:?./\\^$|#,]/g,"").split(" ").join(".*"),"gi");return n.test(t.label)||n.test(t.description)||t.tags.some(r=>n.test(r))},Ape=()=>{const e=te(),t=Rpe(),n=sl(),{t:r}=Z(),o=W(w=>w.nodes.currentConnectionFieldType),s=W(w=>{var S;return(S=w.nodes.connectionStartParams)==null?void 0:S.handleType}),i=le([xe],({nodes:w})=>{const S=o?TT(w.nodeTemplates,_=>{const E=s=="source"?_.inputs:_.outputs;return Xr(E,I=>{const M=s=="source"?o:I.type,R=s=="target"?o:I.type;return ab(M,R)})}):nr(w.nodeTemplates),j=nr(S,_=>({label:_.title,value:_.type,description:_.description,tags:_.tags}));return o===null&&(j.push({label:r("nodes.currentImage"),value:"current_image",description:r("nodes.currentImageDescription"),tags:["progress"]}),j.push({label:r("nodes.notes"),value:"notes",description:r("nodes.notesDescription"),tags:["notes"]})),j.sort((_,E)=>_.label.localeCompare(E.label)),{data:j,t:r}},Se),{data:l}=W(i),u=W(w=>w.nodes.isAddNodePopoverOpen),p=d.useRef(null),m=d.useCallback(w=>{const S=t(w);if(!S){const j=r("nodes.unknownNode",{nodeType:w});n({status:"error",title:j});return}e(NT(S))},[e,t,n,r]),h=d.useCallback(w=>{w&&m(w)},[m]),g=d.useCallback(()=>{e($T())},[e]),x=d.useCallback(()=>{e(LI())},[e]),y=d.useCallback(w=>{w.preventDefault(),x(),setTimeout(()=>{var S;(S=p.current)==null||S.focus()},0)},[x]),b=d.useCallback(()=>{g()},[g]);return et(["shift+a","space"],y),et(["escape"],b),a.jsxs(Ld,{initialFocusRef:p,isOpen:u,onClose:g,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(F3,{children:a.jsx(L,{sx:{position:"absolute",top:"15%",insetInlineStart:"50%",pointerEvents:"none"}})}),a.jsx(zd,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Uh,{sx:{p:0},children:a.jsx(nn,{inputRef:p,selectOnBlur:!1,placeholder:r("nodes.nodeSearch"),value:null,data:l,maxDropdownHeight:400,nothingFound:r("nodes.noMatchingNodes"),itemComponent:JO,filter:Dpe,onChange:h,hoverOnSearchChange:!0,onDropdownClose:g,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},Tpe=d.memo(Ape),Npe=()=>{const e=sb(),t=W(r=>r.nodes.shouldValidateGraph);return d.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:i})=>{var x,y;const l=e.getEdges(),u=e.getNodes();if(!(r&&o&&s&&i))return!1;const p=e.getNode(r),m=e.getNode(s);if(!(p&&m&&p.data&&m.data))return!1;const h=(x=p.data.outputs[o])==null?void 0:x.type,g=(y=m.data.inputs[i])==null?void 0:y.type;return!h||!g||r===s?!1:t?l.find(b=>{b.target===s&&b.targetHandle===i&&b.source===r&&b.sourceHandle})||l.find(b=>b.target===s&&b.targetHandle===i)&&g!=="CollectionItem"||!ab(h,g)?!1:zI(r,s,u,l):!0},[e,t])},hd=e=>`var(--invokeai-colors-${e.split(".").join("-")})`,$pe=le(xe,({nodes:e})=>{const{shouldAnimateEdges:t,currentConnectionFieldType:n,shouldColorEdges:r}=e,o=hd(n&&r?wd[n].color:"base.500");let s="react-flow__custom_connection-path";return t&&(s=s.concat(" animated")),{stroke:o,className:s}}),Lpe=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:i,className:l}=W($pe),u={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=ib(u);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:i,strokeWidth:2,className:l,d:p,style:{opacity:.8}})})},zpe=d.memo(Lpe),e7=(e,t,n,r,o)=>le(xe,({nodes:s})=>{var g,x;const i=s.nodes.find(y=>y.id===e),l=s.nodes.find(y=>y.id===n),u=On(i)&&On(l),p=(i==null?void 0:i.selected)||(l==null?void 0:l.selected)||o,m=u?(x=(g=i==null?void 0:i.data)==null?void 0:g.outputs[t||""])==null?void 0:x.type:void 0,h=m&&s.shouldColorEdges?hd(wd[m].color):hd("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:h}},Se),Fpe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,data:l,selected:u,source:p,target:m,sourceHandleId:h,targetHandleId:g})=>{const x=d.useMemo(()=>e7(p,h,m,g,u),[u,p,h,m,g]),{isSelected:y,shouldAnimate:b}=W(x),[w,S,j]=ib({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:_}=Wd();return a.jsxs(a.Fragment,{children:[a.jsx(FI,{path:w,markerEnd:i,style:{strokeWidth:y?3:2,stroke:_,opacity:y?.8:.5,animation:b?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:b?5:"none"}}),(l==null?void 0:l.count)&&l.count>1&&a.jsx(LT,{children:a.jsx(L,{sx:{position:"absolute",transform:`translate(-50%, -50%) translate(${S}px,${j}px)`},className:"nodrag nopan",children:a.jsx(Ds,{variant:"solid",sx:{bg:"base.500",opacity:y?.8:.5,boxShadow:"base"},children:l.count})})})]})},Bpe=d.memo(Fpe),Hpe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,selected:l,source:u,target:p,sourceHandleId:m,targetHandleId:h})=>{const g=d.useMemo(()=>e7(u,m,p,h,l),[u,m,p,h,l]),{isSelected:x,shouldAnimate:y,stroke:b}=W(g),[w]=ib({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(FI,{path:w,markerEnd:i,style:{strokeWidth:x?3:2,stroke:b,opacity:x?.8:.5,animation:y?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:y?5:"none"}})},Vpe=d.memo(Hpe),Wpe=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:i,handleMouseOver:l}=dO(t),u=d.useMemo(()=>le(xe,({nodes:j})=>{var _;return((_=j.nodeExecutionStates[t])==null?void 0:_.status)===Ys.IN_PROGRESS}),[t]),p=W(u),[m,h,g,x]=Ho("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),y=te(),b=sa(m,h),w=W(j=>j.nodes.nodeOpacity),S=d.useCallback(j=>{!j.ctrlKey&&!j.altKey&&!j.metaKey&&!j.shiftKey&&y(zT(t)),y(BI())},[y,t]);return a.jsxs(Ie,{onClick:S,onMouseEnter:l,onMouseLeave:i,className:tl,sx:{h:"full",position:"relative",borderRadius:"base",w:n??g1,transitionProperty:"common",transitionDuration:"0.1s",cursor:"grab",opacity:w},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",pointerEvents:"none",shadow:`${g}, ${x}, ${x}`,zIndex:-1}}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"md",pointerEvents:"none",transitionProperty:"common",transitionDuration:"0.1s",opacity:.7,shadow:p?b:void 0,zIndex:-1}}),r,a.jsx(uO,{isSelected:o,isHovered:s})]})},Ng=d.memo(Wpe),Upe=le(xe,({system:e,gallery:t})=>{var r;return{imageDTO:t.selection[t.selection.length-1],progressImage:(r=e.denoiseProgress)==null?void 0:r.progress_image}}),Gpe=e=>{const{progressImage:t,imageDTO:n}=FT(Upe);return t?a.jsx(e1,{nodeProps:e,children:a.jsx(ga,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain",borderRadius:"base"}})}):n?a.jsx(e1,{nodeProps:e,children:a.jsx(ua,{imageDTO:n,isDragDisabled:!0,useThumbailFallback:!0})}):a.jsx(e1,{nodeProps:e,children:a.jsx(Zn,{})})},Kpe=d.memo(Gpe),e1=e=>{const[t,n]=d.useState(!1),r=()=>{n(!0)},o=()=>{n(!1)};return a.jsx(Ng,{nodeId:e.nodeProps.id,selected:e.nodeProps.selected,width:384,children:a.jsxs(L,{onMouseEnter:r,onMouseLeave:o,className:tl,sx:{position:"relative",flexDirection:"column"},children:[a.jsx(L,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(ve,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",_dark:{color:"base.200"}},children:"Current Image"})}),a.jsxs(L,{layerStyle:"nodeBody",sx:{w:"full",h:"full",borderBottomRadius:"base",p:2},children:[e.children,t&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:40,left:-2,right:-2,bottom:0,pointerEvents:"none"},children:a.jsx(UO,{})},"nextPrevButtons")]})]})})},qpe=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!On(o))return[];const s=r.nodeTemplates[o.data.type];return s?nr(s.inputs).filter(i=>(["any","direct"].includes(i.input)||lb.includes(i.type))&&HI.includes(i.type)).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Se),[e]);return W(t)},Xpe=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!On(o))return[];const s=r.nodeTemplates[o.data.type];return s?nr(s.inputs).filter(i=>i.input==="connection"&&!lb.includes(i.type)||!HI.includes(i.type)).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Se),[e]);return W(t)},Qpe=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!On(o))return[];const s=r.nodeTemplates[o.data.type];return s?nr(s.outputs).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Se),[e]);return W(t)},Ype=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?o.data.embedWorkflow:!1},Se),[e]);return W(t)},$g=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?Xr(o.data.outputs,s=>BT.includes(s.type)&&o.data.type!=="image"):!1},Se),[e]);return W(t)},Zpe=({nodeId:e})=>{const t=te(),n=$g(e),r=Ype(e),o=d.useCallback(s=>{t(HT({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(Kt,{as:L,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(wn,{sx:{fontSize:"xs",mb:"1px"},children:"Workflow"}),a.jsx(Md,{className:"nopan",size:"sm",onChange:o,isChecked:r})]}):null},Jpe=d.memo(Zpe),eme=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?o.data.isIntermediate:!1},Se),[e]);return W(t)},tme=({nodeId:e})=>{const t=te(),n=$g(e),r=eme(e),o=d.useCallback(s=>{t(VT({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(Kt,{as:L,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(wn,{sx:{fontSize:"xs",mb:"1px"},children:"Save to Gallery"}),a.jsx(Md,{className:"nopan",size:"sm",onChange:o,isChecked:!r})]}):null},nme=d.memo(tme),rme=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?o.data.useCache:!1},Se),[e]);return W(t)},ome=({nodeId:e})=>{const t=te(),n=rme(e),r=d.useCallback(o=>{t(WT({nodeId:e,useCache:o.target.checked}))},[t,e]);return a.jsxs(Kt,{as:L,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(wn,{sx:{fontSize:"xs",mb:"1px"},children:"Use Cache"}),a.jsx(Md,{className:"nopan",size:"sm",onChange:r,isChecked:n})]})},sme=d.memo(ome),ame=({nodeId:e})=>{const t=$g(e),n=Ht("invocationCache").isFeatureEnabled;return a.jsxs(L,{className:tl,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[n&&a.jsx(sme,{nodeId:e}),t&&a.jsx(Jpe,{nodeId:e}),t&&a.jsx(nme,{nodeId:e})]})},ime=d.memo(ame),lme=({nodeId:e,isOpen:t})=>{const n=te(),r=UT(),o=d.useCallback(()=>{n(GT({nodeId:e,isOpen:!t})),r(e)},[n,t,e,r]);return a.jsx(Fe,{className:"nodrag",onClick:o,"aria-label":"Minimize",sx:{minW:8,w:8,h:8,color:"base.500",_dark:{color:"base.500"},_hover:{color:"base.700",_dark:{color:"base.300"}}},variant:"link",icon:a.jsx(gg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})})},f2=d.memo(lme),t7=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return On(o)?o.data.label:!1},Se),[e]);return W(t)},n7=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!On(o))return!1;const s=o?r.nodeTemplates[o.data.type]:void 0;return s==null?void 0:s.title},Se),[e]);return W(t)},cme=({nodeId:e,title:t})=>{const n=te(),r=t7(e),o=n7(e),{t:s}=Z(),[i,l]=d.useState(""),u=d.useCallback(async m=>{n(KT({nodeId:e,label:m})),l(r||t||o||s("nodes.problemSettingTitle"))},[n,e,t,o,r,s]),p=d.useCallback(m=>{l(m)},[]);return d.useEffect(()=>{l(r||t||o||s("nodes.problemSettingTitle"))},[r,o,t,s]),a.jsx(L,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(Ih,{as:L,value:i,onChange:p,onSubmit:u,sx:{alignItems:"center",position:"relative",w:"full",h:"full"},children:[a.jsx(_h,{fontSize:"sm",sx:{p:0,w:"full"},noOfLines:1}),a.jsx(jh,{className:"nodrag",fontSize:"sm",sx:{p:0,fontWeight:700,_focusVisible:{p:0,boxShadow:"none"}}}),a.jsx(ume,{})]})})},r7=d.memo(cme);function ume(){const{isEditing:e,getEditButtonProps:t}=y5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Ie,{className:tl,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const p2=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},Se),[e]);return W(t)},dme=({nodeId:e})=>{const t=p2(e),{base400:n,base600:r}=Wd(),o=sa(n,r),s=d.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return em(t)?a.jsxs(a.Fragment,{children:[a.jsx(Ou,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Ql.Left,style:{...s,left:"-0.5rem"}}),nr(t.inputs,i=>a.jsx(Ou,{type:"target",id:i.name,isConnectable:!1,position:Ql.Left,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-input-handle`)),a.jsx(Ou,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Ql.Right,style:{...s,right:"-0.5rem"}}),nr(t.outputs,i=>a.jsx(Ou,{type:"source",id:i.name,isConnectable:!1,position:Ql.Right,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-output-handle`))]}):null},fme=d.memo(dme),pme=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);return r.nodeTemplates[(o==null?void 0:o.data.type)??""]},Se),[e]);return W(t)},mme=({nodeId:e})=>{const t=te(),n=p2(e),{t:r}=Z(),o=d.useCallback(s=>{t(qT({nodeId:e,notes:s.target.value}))},[t,e]);return em(n)?a.jsxs(Kt,{children:[a.jsx(wn,{children:r("nodes.notes")}),a.jsx(da,{value:n==null?void 0:n.notes,onChange:o,rows:10})]}):null},hme=d.memo(mme),gme=e=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>{var i;const o=r.nodes.find(l=>l.id===e);if(!On(o))return!1;const s=r.nodeTemplates[(o==null?void 0:o.data.type)??""];return!(s!=null&&s.version)||!((i=o.data)!=null&&i.version)?!1:Z_(s.version,o.data.version)===0},Se),[e]);return W(t)},vme=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Lr(),o=t7(e),s=n7(e),i=gme(e),{t:l}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Ft,{label:a.jsx(o7,{nodeId:e}),placement:"top",shouldWrapChildren:!0,children:a.jsx(L,{className:"nodrag",onClick:n,sx:{alignItems:"center",justifyContent:"center",w:8,h:8,cursor:"pointer"},children:a.jsx(Nn,{as:dM,sx:{boxSize:4,w:8,color:i?"base.400":"error.400"}})})}),a.jsxs(qi,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Yo,{}),a.jsxs(Xi,{children:[a.jsx(Qo,{children:o||s||l("nodes.unknownNode")}),a.jsx($d,{}),a.jsx(Zo,{children:a.jsx(hme,{nodeId:e})}),a.jsx(Ss,{})]})]})]})},xme=d.memo(vme),o7=d.memo(({nodeId:e})=>{const t=p2(e),n=pme(e),{t:r}=Z(),o=d.useMemo(()=>t!=null&&t.label&&(n!=null&&n.title)?`${t.label} (${n.title})`:t!=null&&t.label&&!n?t.label:!(t!=null&&t.label)&&n?n.title:r("nodes.unknownNode"),[t,n,r]),s=d.useMemo(()=>!em(t)||!n?null:t.version?n.version?Xw(t.version,n.version,"<")?a.jsxs(ve,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateNode"),")"]}):Xw(t.version,n.version,">")?a.jsxs(ve,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateApp"),")"]}):a.jsxs(ve,{as:"span",children:[r("nodes.version")," ",t.version]}):a.jsxs(ve,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.unknownTemplate"),")"]}):a.jsx(ve,{as:"span",sx:{color:"error.500"},children:r("nodes.versionUnknown")}),[t,n,r]);return em(t)?a.jsxs(L,{sx:{flexDir:"column"},children:[a.jsx(ve,{as:"span",sx:{fontWeight:600},children:o}),a.jsx(ve,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),s,(t==null?void 0:t.notes)&&a.jsx(ve,{children:t.notes})]}):a.jsx(ve,{sx:{fontWeight:600},children:r("nodes.unknownNode")})});o7.displayName="TooltipContent";const t1=3,M_={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},bme=({nodeId:e})=>{const t=d.useMemo(()=>le(xe,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=W(t);return n?a.jsx(Ft,{label:a.jsx(s7,{nodeExecutionState:n}),placement:"top",children:a.jsx(L,{className:tl,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(a7,{nodeExecutionState:n})})}):null},yme=d.memo(bme),s7=d.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e,{t:o}=Z();return t===Ys.PENDING?a.jsx(ve,{children:"Pending"}):t===Ys.IN_PROGRESS?r?a.jsxs(L,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(ga,{src:r.dataURL,sx:{w:32,h:32,borderRadius:"base",objectFit:"contain"}}),n!==null&&a.jsxs(Ds,{variant:"solid",sx:{pos:"absolute",top:2.5,insetInlineEnd:1},children:[Math.round(n*100),"%"]})]}):n!==null?a.jsxs(ve,{children:[o("nodes.executionStateInProgress")," (",Math.round(n*100),"%)"]}):a.jsx(ve,{children:o("nodes.executionStateInProgress")}):t===Ys.COMPLETED?a.jsx(ve,{children:o("nodes.executionStateCompleted")}):t===Ys.FAILED?a.jsx(ve,{children:o("nodes.executionStateError")}):null});s7.displayName="TooltipLabel";const a7=d.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Ys.PENDING?a.jsx(Nn,{as:TJ,sx:{boxSize:t1,color:"base.600",_dark:{color:"base.300"}}}):n===Ys.IN_PROGRESS?t===null?a.jsx(B1,{isIndeterminate:!0,size:"14px",color:"base.500",thickness:14,sx:M_}):a.jsx(B1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:M_}):n===Ys.COMPLETED?a.jsx(Nn,{as:aM,sx:{boxSize:t1,color:"ok.600",_dark:{color:"ok.300"}}}):n===Ys.FAILED?a.jsx(Nn,{as:LJ,sx:{boxSize:t1,color:"error.600",_dark:{color:"error.300"}}}):null});a7.displayName="StatusIcon";const Cme=({nodeId:e,isOpen:t})=>a.jsxs(L,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",justifyContent:"space-between",h:8,textAlign:"center",fontWeight:500,color:"base.700",_dark:{color:"base.200"}},children:[a.jsx(f2,{nodeId:e,isOpen:t}),a.jsx(r7,{nodeId:e}),a.jsxs(L,{alignItems:"center",children:[a.jsx(yme,{nodeId:e}),a.jsx(xme,{nodeId:e})]}),!t&&a.jsx(fme,{nodeId:e})]}),wme=d.memo(Cme),Sme=(e,t,n,r)=>le(xe,o=>{if(!r)return yt.t("nodes.noFieldType");const{currentConnectionFieldType:s,connectionStartParams:i,nodes:l,edges:u}=o.nodes;if(!i||!s)return yt.t("nodes.noConnectionInProgress");const{handleType:p,nodeId:m,handleId:h}=i;if(!p||!m||!h)return yt.t("nodes.noConnectionData");const g=n==="target"?r:s,x=n==="source"?r:s;if(e===m)return yt.t("nodes.cannotConnectToSelf");if(n===p)return n==="source"?yt.t("nodes.cannotConnectOutputToOutput"):yt.t("nodes.cannotConnectInputToInput");const y=n==="target"?e:m,b=n==="target"?t:h,w=n==="source"?e:m,S=n==="source"?t:h;return u.find(_=>{_.target===y&&_.targetHandle===b&&_.source===w&&_.sourceHandle})?yt.t("nodes.cannotDuplicateConnection"):u.find(_=>_.target===y&&_.targetHandle===b)&&g!=="CollectionItem"?yt.t("nodes.inputMayOnlyHaveOneConnection"):ab(x,g)?zI(p==="source"?m:e,p==="source"?e:m,l,u)?null:yt.t("nodes.connectionWouldCreateCycle"):yt.t("nodes.fieldTypesMustMatch")}),kme=(e,t,n)=>{const r=d.useMemo(()=>le(xe,({nodes:s})=>{var l;const i=s.nodes.find(u=>u.id===e);if(On(i))return(l=i==null?void 0:i.data[rb[n]][t])==null?void 0:l.type},Se),[t,n,e]);return W(r)},jme=le(xe,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),i7=({nodeId:e,fieldName:t,kind:n})=>{const r=kme(e,t,n),o=d.useMemo(()=>le(xe,({nodes:g})=>!!g.edges.filter(x=>(n==="input"?x.target:x.source)===e&&(n==="input"?x.targetHandle:x.sourceHandle)===t).length),[t,n,e]),s=d.useMemo(()=>Sme(e,t,n==="input"?"target":"source",r),[e,t,n,r]),i=d.useMemo(()=>le(xe,({nodes:g})=>{var x,y,b;return((x=g.connectionStartParams)==null?void 0:x.nodeId)===e&&((y=g.connectionStartParams)==null?void 0:y.handleId)===t&&((b=g.connectionStartParams)==null?void 0:b.handleType)==={input:"target",output:"source"}[n]}),[t,n,e]),l=W(o),u=W(jme),p=W(i),m=W(s),h=d.useMemo(()=>!!(u&&m&&!p),[m,u,p]);return{isConnected:l,isConnectionInProgress:u,isConnectionStartField:p,connectionError:m,shouldDim:h}},_me=(e,t)=>{const n=d.useMemo(()=>le(xe,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(On(s))return((i=s==null?void 0:s.data.inputs[t])==null?void 0:i.value)!==void 0},Se),[t,e]);return W(n)},Ime=(e,t)=>{const n=d.useMemo(()=>le(xe,({nodes:o})=>{const s=o.nodes.find(u=>u.id===e);if(!On(s))return;const i=o.nodeTemplates[(s==null?void 0:s.data.type)??""],l=i==null?void 0:i.inputs[t];return l==null?void 0:l.input},Se),[t,e]);return W(n)},Pme=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=te(),s=fO(e,t),i=pO(e,t,n),l=Ime(e,t),{t:u}=Z(),p=d.useCallback(w=>{w.preventDefault()},[]),m=d.useMemo(()=>le(xe,({nodes:w})=>({isExposed:!!w.workflow.exposedFields.find(j=>j.nodeId===e&&j.fieldName===t)}),Se),[t,e]),h=d.useMemo(()=>["any","direct"].includes(l??"__UNKNOWN_INPUT__"),[l]),{isExposed:g}=W(m),x=d.useCallback(()=>{o(XT({nodeId:e,fieldName:t}))},[o,t,e]),y=d.useCallback(()=>{o(jI({nodeId:e,fieldName:t}))},[o,t,e]),b=d.useMemo(()=>{const w=[];return h&&!g&&w.push(a.jsx(en,{icon:a.jsx(Vc,{}),onClick:x,children:"Add to Linear View"},`${e}.${t}.expose-field`)),h&&g&&w.push(a.jsx(en,{icon:a.jsx(XJ,{}),onClick:y,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),w},[t,x,y,g,h,e]);return a.jsx(Ay,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>b.length?a.jsx(Gi,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:p,children:a.jsx(td,{title:s||i||u("nodes.unknownField"),children:b})}):null,children:r})},Eme=d.memo(Pme),Mme=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:i,type:l}=t,{color:u,title:p}=wd[l],m=d.useMemo(()=>{const g=QT.includes(l),x=lb.includes(l),y=YT.includes(l),b=hd(u),w={backgroundColor:g||x?"var(--invokeai-colors-base-900)":b,position:"absolute",width:"1rem",height:"1rem",borderWidth:g||x?4:0,borderStyle:"solid",borderColor:b,borderRadius:y?4:"100%",zIndex:1};return n==="target"?w.insetInlineStart="-1rem":w.insetInlineEnd="-1rem",r&&!o&&s&&(w.filter="opacity(0.4) grayscale(0.7)"),r&&s?o?w.cursor="grab":w.cursor="not-allowed":w.cursor="crosshair",w},[s,n,r,o,l,u]),h=d.useMemo(()=>r&&o?p:r&&s?s??p:p,[s,r,o,p]);return a.jsx(Ft,{label:h,placement:n==="target"?"start":"end",hasArrow:!0,openDelay:yh,children:a.jsx(Ou,{type:n,id:i,position:n==="target"?Ql.Left:Ql.Right,style:m})})},l7=d.memo(Mme),Ome=({nodeId:e,fieldName:t})=>{const n=Pg(e,t,"input"),r=_me(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:i,connectionError:l,shouldDim:u}=i7({nodeId:e,fieldName:t,kind:"input"}),p=d.useMemo(()=>{if((n==null?void 0:n.fieldKind)!=="input"||!n.required)return!1;if(!o&&n.input==="connection"||!r&&!o&&n.input==="any")return!0},[n,o,r]);return(n==null?void 0:n.fieldKind)!=="input"?a.jsx(Rx,{shouldDim:u,children:a.jsxs(Kt,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Rx,{shouldDim:u,children:[a.jsxs(Kt,{isInvalid:p,isDisabled:o,sx:{alignItems:"stretch",justifyContent:"space-between",ps:n.input==="direct"?0:2,gap:2,h:"full",w:"full"},children:[a.jsx(Eme,{nodeId:e,fieldName:t,kind:"input",children:m=>a.jsx(wn,{sx:{display:"flex",alignItems:"center",h:"full",mb:0,px:1,gap:2},children:a.jsx(hO,{ref:m,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Ie,{children:a.jsx(IO,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(l7,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:i,connectionError:l})]})},O_=d.memo(Ome),Rx=d.memo(({shouldDim:e,children:t})=>a.jsx(L,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",w:"full",h:"full"},children:t}));Rx.displayName="InputFieldWrapper";const Rme=({nodeId:e,fieldName:t})=>{const n=Pg(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:i,shouldDim:l}=i7({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx(Dx,{shouldDim:l,children:a.jsxs(Kt,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs(Dx,{shouldDim:l,children:[a.jsx(Ft,{label:a.jsx(r2,{nodeId:e,fieldName:t,kind:"output"}),openDelay:yh,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(Kt,{isDisabled:r,pe:2,children:a.jsx(wn,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(l7,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:i})]})},Dme=d.memo(Rme),Dx=d.memo(({shouldDim:e,children:t})=>a.jsx(L,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",justifyContent:"flex-end"},children:t}));Dx.displayName="OutputFieldWrapper";const Ame=e=>{const t=$g(e),n=Ht("invocationCache").isFeatureEnabled;return d.useMemo(()=>t||n,[t,n])},Tme=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=Xpe(e),i=qpe(e),l=Ame(e),u=Qpe(e);return a.jsxs(Ng,{nodeId:e,selected:o,children:[a.jsx(wme,{nodeId:e,isOpen:t,label:n,selected:o,type:r}),t&&a.jsxs(a.Fragment,{children:[a.jsx(L,{layerStyle:"nodeBody",sx:{flexDirection:"column",w:"full",h:"full",py:2,gap:1,borderBottomRadius:l?0:"base"},children:a.jsxs(L,{sx:{flexDir:"column",px:2,w:"full",h:"full"},children:[a.jsxs(Ja,{gridTemplateColumns:"1fr auto",gridAutoRows:"1fr",children:[s.map((p,m)=>a.jsx(Zu,{gridColumnStart:1,gridRowStart:m+1,children:a.jsx(O_,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),u.map((p,m)=>a.jsx(Zu,{gridColumnStart:2,gridRowStart:m+1,children:a.jsx(Dme,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),i.map(p=>a.jsx(O_,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),l&&a.jsx(ime,{nodeId:e})]})]})},Nme=d.memo(Tme),$me=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(Ng,{nodeId:e,selected:o,children:[a.jsxs(L,{className:tl,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(f2,{nodeId:e,isOpen:t}),a.jsx(ve,{sx:{w:"full",textAlign:"center",pe:8,color:"error.500",_dark:{color:"error.300"}},children:n?`${n} (${r})`:r})]}),t&&a.jsx(L,{layerStyle:"nodeBody",sx:{userSelect:"auto",flexDirection:"column",w:"full",h:"full",p:4,gap:1,borderBottomRadius:"base",fontSize:"sm"},children:a.jsxs(Ie,{children:[a.jsx(ve,{as:"span",children:"Unknown node type: "}),a.jsx(ve,{as:"span",fontWeight:600,children:r})]})})]}),Lme=d.memo($me),zme=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:i}=t,l=d.useMemo(()=>le(xe,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return W(l)?a.jsx(Nme,{nodeId:r,isOpen:s,label:i,type:o,selected:n}):a.jsx(Lme,{nodeId:r,isOpen:s,label:i,type:o,selected:n})},Fme=d.memo(zme),Bme=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,i=te(),l=d.useCallback(u=>{i(ZT({nodeId:t,value:u.target.value}))},[i,t]);return a.jsxs(Ng,{nodeId:t,selected:r,children:[a.jsxs(L,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:s?0:"base",alignItems:"center",justifyContent:"space-between",h:8},children:[a.jsx(f2,{nodeId:t,isOpen:s}),a.jsx(r7,{nodeId:t,title:"Notes"}),a.jsx(Ie,{minW:8})]}),s&&a.jsx(a.Fragment,{children:a.jsx(L,{layerStyle:"nodeBody",className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"base",w:"full",h:"full",p:2,gap:1},children:a.jsx(L,{className:"nopan",sx:{flexDir:"column",w:"full",h:"full"},children:a.jsx(da,{value:o,onChange:l,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},Hme=d.memo(Bme),Vme=["Delete","Backspace"],Wme={collapsed:Bpe,default:Vpe},Ume={invocation:Fme,current_image:Kpe,notes:Hme},Gme={hideAttribution:!0},Kme=le(xe,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},Se),qme=()=>{const e=te(),t=W(O=>O.nodes.nodes),n=W(O=>O.nodes.edges),r=W(O=>O.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=W(Kme),i=d.useRef(null),l=d.useRef(),u=Npe(),[p]=Ho("radii",["base"]),m=d.useCallback(O=>{e(JT(O))},[e]),h=d.useCallback(O=>{e(eN(O))},[e]),g=d.useCallback((O,T)=>{e(tN(T))},[e]),x=d.useCallback(O=>{e($w(O))},[e]),y=d.useCallback(()=>{e(nN({cursorPosition:l.current}))},[e]),b=d.useCallback(O=>{e(rN(O))},[e]),w=d.useCallback(O=>{e(oN(O))},[e]),S=d.useCallback(({nodes:O,edges:T})=>{e(sN(O?O.map(X=>X.id):[])),e(aN(T?T.map(X=>X.id):[]))},[e]),j=d.useCallback((O,T)=>{e(iN(T))},[e]),_=d.useCallback(()=>{e(BI())},[e]),E=d.useCallback(O=>{Lw.set(O),O.fitView()},[]),I=d.useCallback(O=>{var X,B;const T=(X=i.current)==null?void 0:X.getBoundingClientRect();if(T){const V=(B=Lw.get())==null?void 0:B.project({x:O.clientX-T.left,y:O.clientY-T.top});l.current=V}},[]),M=d.useRef(),R=d.useCallback((O,T,X)=>{M.current=O,e(lN(T.id)),e(cN())},[e]),D=d.useCallback((O,T)=>{e($w(T))},[e]),A=d.useCallback((O,T,X)=>{var B,V;!("touches"in O)&&((B=M.current)==null?void 0:B.clientX)===O.clientX&&((V=M.current)==null?void 0:V.clientY)===O.clientY&&e(uN(T)),M.current=void 0},[e]);return et(["Ctrl+c","Meta+c"],O=>{O.preventDefault(),e(dN())}),et(["Ctrl+a","Meta+a"],O=>{O.preventDefault(),e(fN())}),et(["Ctrl+v","Meta+v"],O=>{O.preventDefault(),e(pN({cursorPosition:l.current}))}),a.jsx(mN,{id:"workflow-editor",ref:i,defaultViewport:r,nodeTypes:Ume,edgeTypes:Wme,nodes:t,edges:n,onInit:E,onMouseMove:I,onNodesChange:m,onEdgesChange:h,onEdgesDelete:b,onEdgeUpdate:D,onEdgeUpdateStart:R,onEdgeUpdateEnd:A,onNodesDelete:w,onConnectStart:g,onConnect:x,onConnectEnd:y,onMoveEnd:j,connectionLineComponent:zpe,onSelectionChange:S,isValidConnection:u,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:Gme,style:{borderRadius:p},onPaneClick:_,deleteKeyCode:Vme,selectionMode:s,children:a.jsx(y$,{})})},Xme=()=>{const e=te(),{t}=Z(),n=d.useCallback(()=>{e(LI())},[e]);return a.jsx(L,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:2},children:a.jsx(Fe,{tooltip:t("nodes.addNodeToolTip"),"aria-label":t("nodes.addNode"),icon:a.jsx(Vc,{}),onClick:n})})},Qme=d.memo(Xme),Yme=()=>{const e=te(),t=fP("nodes"),{t:n}=Z();return d.useCallback(o=>{if(!o)return;const s=new FileReader;s.onload=async()=>{const i=s.result;try{const l=JSON.parse(String(i)),u=hN.safeParse(l);if(!u.success){const{message:p}=gN(u.error,{prefix:n("nodes.workflowValidation")});t.error({error:vN(u.error)},p),e(ct(Qt({title:n("nodes.unableToValidateWorkflow"),status:"error",duration:5e3}))),s.abort();return}e(Yx(u.data)),s.abort()}catch{e(ct(Qt({title:n("nodes.unableToLoadWorkflow"),status:"error"})))}},s.readAsText(o)},[e,t,n])},Zme=d.memo(e=>e.error.issues[0]?a.jsx(ve,{children:zw(e.error.issues[0],{prefix:null}).toString()}):a.jsx(Od,{children:e.error.issues.map((t,n)=>a.jsx(Qr,{children:a.jsx(ve,{children:zw(t,{prefix:null}).toString()})},n))}));Zme.displayName="WorkflowValidationErrorContent";const Jme=()=>{const{t:e}=Z(),t=d.useRef(null),n=Yme();return a.jsx(DE,{resetRef:t,accept:"application/json",onChange:n,children:r=>a.jsx(Fe,{icon:a.jsx(cg,{}),tooltip:e("nodes.loadWorkflow"),"aria-label":e("nodes.loadWorkflow"),...r})})},ehe=d.memo(Jme),the=()=>{const{t:e}=Z(),t=te(),{isOpen:n,onOpen:r,onClose:o}=Lr(),s=d.useRef(null),i=W(u=>u.nodes.nodes.length),l=d.useCallback(()=>{t(xN()),t(ct(Qt({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(Fe,{icon:a.jsx(Br,{}),tooltip:e("nodes.resetWorkflow"),"aria-label":e("nodes.resetWorkflow"),onClick:r,isDisabled:!i,colorScheme:"error"}),a.jsxs(Td,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Yo,{}),a.jsxs(Nd,{children:[a.jsx(Qo,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Zo,{py:4,children:a.jsxs(L,{flexDir:"column",gap:2,children:[a.jsx(ve,{children:e("nodes.resetWorkflowDesc")}),a.jsx(ve,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(Ss,{children:[a.jsx(Za,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(Za,{colorScheme:"error",ml:3,onClick:l,children:e("common.accept")})]})]})]})]})},nhe=d.memo(the),rhe=()=>{const{t:e}=Z(),t=cO(),n=d.useCallback(()=>{const r=new Blob([JSON.stringify(t,null,2)]),o=document.createElement("a");o.href=URL.createObjectURL(r),o.download=`${t.name||"My Workflow"}.json`,document.body.appendChild(o),o.click(),o.remove()},[t]);return a.jsx(Fe,{icon:a.jsx(ig,{}),tooltip:e("nodes.downloadWorkflow"),"aria-label":e("nodes.downloadWorkflow"),onClick:n})},ohe=d.memo(rhe),she=()=>a.jsxs(L,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(ohe,{}),a.jsx(ehe,{}),a.jsx(nhe,{})]}),ahe=d.memo(she),ihe=()=>a.jsx(L,{sx:{gap:2,flexDir:"column"},children:nr(wd,({title:e,description:t,color:n},r)=>a.jsx(Ft,{label:t,children:a.jsx(Ds,{sx:{userSelect:"none",color:parseInt(n.split(".")[1]??"0",10)<500?"base.800":"base.50",bg:n},textAlign:"center",children:e})},r))}),lhe=d.memo(ihe),che=()=>{const{t:e}=Z(),t=te(),n=d.useCallback(()=>{t(bN())},[t]);return a.jsx(at,{leftIcon:a.jsx(see,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},uhe=d.memo(che),Pu={fontWeight:600},dhe=le(xe,({nodes:e})=>{const{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionMode:s}=e;return{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionModeIsChecked:s===yN.Full}},Se),fhe=je((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Lr(),s=te(),{shouldAnimateEdges:i,shouldValidateGraph:l,shouldSnapToGrid:u,shouldColorEdges:p,selectionModeIsChecked:m}=W(dhe),h=d.useCallback(S=>{s(CN(S.target.checked))},[s]),g=d.useCallback(S=>{s(wN(S.target.checked))},[s]),x=d.useCallback(S=>{s(SN(S.target.checked))},[s]),y=d.useCallback(S=>{s(kN(S.target.checked))},[s]),b=d.useCallback(S=>{s(jN(S.target.checked))},[s]),{t:w}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Fe,{ref:t,"aria-label":w("nodes.workflowSettings"),tooltip:w("nodes.workflowSettings"),icon:a.jsx(lM,{}),onClick:r}),a.jsxs(qi,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Yo,{}),a.jsxs(Xi,{children:[a.jsx(Qo,{children:w("nodes.workflowSettings")}),a.jsx($d,{}),a.jsx(Zo,{children:a.jsxs(L,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(cr,{size:"sm",children:"General"}),a.jsx(fn,{formLabelProps:Pu,onChange:g,isChecked:i,label:w("nodes.animatedEdges"),helperText:w("nodes.animatedEdgesHelp")}),a.jsx(Yn,{}),a.jsx(fn,{formLabelProps:Pu,isChecked:u,onChange:x,label:w("nodes.snapToGrid"),helperText:w("nodes.snapToGridHelp")}),a.jsx(Yn,{}),a.jsx(fn,{formLabelProps:Pu,isChecked:p,onChange:y,label:w("nodes.colorCodeEdges"),helperText:w("nodes.colorCodeEdgesHelp")}),a.jsx(fn,{formLabelProps:Pu,isChecked:m,onChange:b,label:w("nodes.fullyContainNodes"),helperText:w("nodes.fullyContainNodesHelp")}),a.jsx(cr,{size:"sm",pt:4,children:"Advanced"}),a.jsx(fn,{formLabelProps:Pu,isChecked:l,onChange:h,label:w("nodes.validateConnections"),helperText:w("nodes.validateConnectionsHelp")}),a.jsx(uhe,{})]})})]})]})]})}),phe=d.memo(fhe),mhe=()=>{const e=W(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs(L,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(phe,{}),e&&a.jsx(lhe,{})]})},hhe=d.memo(mhe);function ghe(){const e=te(),t=W(o=>o.nodes.nodeOpacity),{t:n}=Z(),r=d.useCallback(o=>{e(_N(o))},[e]);return a.jsx(L,{alignItems:"center",children:a.jsxs(Gb,{"aria-label":n("nodes.nodeOpacity"),value:t,min:.5,max:1,step:.01,onChange:r,orientation:"vertical",defaultValue:30,h:"calc(100% - 0.5rem)",children:[a.jsx(qb,{children:a.jsx(Xb,{})}),a.jsx(Kb,{})]})})}const vhe=()=>{const{t:e}=Z(),{zoomIn:t,zoomOut:n,fitView:r}=sb(),o=te(),s=W(m=>m.nodes.shouldShowMinimapPanel),i=d.useCallback(()=>{t()},[t]),l=d.useCallback(()=>{n()},[n]),u=d.useCallback(()=>{r()},[r]),p=d.useCallback(()=>{o(IN(!s))},[s,o]);return a.jsxs(Vt,{isAttached:!0,orientation:"vertical",children:[a.jsx(Fe,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:i,icon:a.jsx(Coe,{})}),a.jsx(Fe,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:l,icon:a.jsx(yoe,{})}),a.jsx(Fe,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:u,icon:a.jsx(cM,{})}),a.jsx(Fe,{tooltip:e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),"aria-label":e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),isChecked:s,onClick:p,icon:a.jsx(qJ,{})})]})},xhe=d.memo(vhe),bhe=()=>a.jsxs(L,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(xhe,{}),a.jsx(ghe,{})]}),yhe=d.memo(bhe),Che=we(m$),whe=()=>{const e=W(r=>r.nodes.shouldShowMinimapPanel),t=sa("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-600)"),n=sa("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx(L,{sx:{gap:2,position:"absolute",bottom:2,insetInlineEnd:2},children:e&&a.jsx(Che,{pannable:!0,zoomable:!0,nodeBorderRadius:15,sx:{m:"0 !important",backgroundColor:"base.200 !important",borderRadius:"base",_dark:{backgroundColor:"base.500 !important"},svg:{borderRadius:"inherit"}},nodeColor:t,maskColor:n})})},She=d.memo(whe),khe=()=>{const e=W(n=>n.nodes.isReady),{t}=Z();return a.jsxs(L,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center"},children:[a.jsx(dr,{children:e&&a.jsxs(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"relative",width:"100%",height:"100%"},children:[a.jsx(qme,{}),a.jsx(Tpe,{}),a.jsx(Qme,{}),a.jsx(ahe,{}),a.jsx(hhe,{}),a.jsx(yhe,{}),a.jsx(She,{})]})}),a.jsx(dr,{children:!e&&a.jsx(In.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"absolute",width:"100%",height:"100%"},children:a.jsx(L,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(Zn,{label:t("nodes.loadingNodes"),icon:woe})})})})]})},jhe=d.memo(khe),_he=()=>a.jsx(PN,{children:a.jsx(jhe,{})}),Ihe=d.memo(_he),Phe=()=>{const{t:e}=Z(),t=te(),{data:n}=kd(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=EN({fixedCacheKey:"clearInvocationCache"}),i=d.useMemo(()=>!(n!=null&&n.size)||!r,[n==null?void 0:n.size,r]);return{clearInvocationCache:d.useCallback(async()=>{if(!i)try{await o().unwrap(),t(ct({title:e("invocationCache.clearSucceeded"),status:"success"}))}catch{t(ct({title:e("invocationCache.clearFailed"),status:"error"}))}},[i,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:i}},Ehe=()=>{const{t:e}=Z(),{clearInvocationCache:t,isDisabled:n,isLoading:r}=Phe();return a.jsx(at,{isDisabled:n,isLoading:r,onClick:t,children:e("invocationCache.clear")})},Mhe=d.memo(Ehe),Ohe=()=>{const{t:e}=Z(),t=te(),{data:n}=kd(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=MN({fixedCacheKey:"disableInvocationCache"}),i=d.useMemo(()=>!(n!=null&&n.enabled)||!r||(n==null?void 0:n.max_size)===0,[n==null?void 0:n.enabled,n==null?void 0:n.max_size,r]);return{disableInvocationCache:d.useCallback(async()=>{if(!i)try{await o().unwrap(),t(ct({title:e("invocationCache.disableSucceeded"),status:"success"}))}catch{t(ct({title:e("invocationCache.disableFailed"),status:"error"}))}},[i,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:i}},Rhe=()=>{const{t:e}=Z(),t=te(),{data:n}=kd(),r=W(u=>u.system.isConnected),[o,{isLoading:s}]=ON({fixedCacheKey:"enableInvocationCache"}),i=d.useMemo(()=>(n==null?void 0:n.enabled)||!r||(n==null?void 0:n.max_size)===0,[n==null?void 0:n.enabled,n==null?void 0:n.max_size,r]);return{enableInvocationCache:d.useCallback(async()=>{if(!i)try{await o().unwrap(),t(ct({title:e("invocationCache.enableSucceeded"),status:"success"}))}catch{t(ct({title:e("invocationCache.enableFailed"),status:"error"}))}},[i,o,t,e]),isLoading:s,cacheStatus:n,isDisabled:i}},Dhe=()=>{const{t:e}=Z(),{data:t}=kd(),{enableInvocationCache:n,isDisabled:r,isLoading:o}=Rhe(),{disableInvocationCache:s,isDisabled:i,isLoading:l}=Ohe();return t!=null&&t.enabled?a.jsx(at,{isDisabled:i,isLoading:l,onClick:s,children:e("invocationCache.disable")}):a.jsx(at,{isDisabled:r,isLoading:o,onClick:n,children:e("invocationCache.enable")})},Ahe=d.memo(Dhe),The=({children:e,...t})=>a.jsx(aP,{alignItems:"center",justifyContent:"center",w:"full",h:"full",layerStyle:"second",borderRadius:"base",py:2,px:3,gap:6,flexWrap:"nowrap",...t,children:e}),c7=d.memo(The),Nhe={'&[aria-disabled="true"]':{color:"base.400",_dark:{color:"base.500"}}},$he=({label:e,value:t,isDisabled:n=!1,...r})=>a.jsxs(sP,{flexGrow:1,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","aria-disabled":n,sx:Nhe,...r,children:[a.jsx(iP,{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",children:e}),a.jsx(lP,{children:t})]}),hs=d.memo($he),Lhe=()=>{const{t:e}=Z(),{data:t}=kd(void 0);return a.jsxs(c7,{children:[a.jsx(hs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.cacheSize"),value:(t==null?void 0:t.size)??0}),a.jsx(hs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.hits"),value:(t==null?void 0:t.hits)??0}),a.jsx(hs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.misses"),value:(t==null?void 0:t.misses)??0}),a.jsx(hs,{isDisabled:!(t!=null&&t.enabled),label:e("invocationCache.maxCacheSize"),value:(t==null?void 0:t.max_size)??0}),a.jsxs(Vt,{w:24,orientation:"vertical",size:"xs",children:[a.jsx(Mhe,{}),a.jsx(Ahe,{})]})]})},zhe=d.memo(Lhe),u7=e=>{const t=W(l=>l.system.isConnected),[n,{isLoading:r}]=Jx(),o=te(),{t:s}=Z();return{cancelQueueItem:d.useCallback(async()=>{try{await n(e).unwrap(),o(ct({title:s("queue.cancelSucceeded"),status:"success"}))}catch{o(ct({title:s("queue.cancelFailed"),status:"error"}))}},[o,e,s,n]),isLoading:r,isDisabled:!t}},d7=(e,t)=>Number(((Date.parse(t)-Date.parse(e))/1e3).toFixed(2)),R_={pending:{colorScheme:"cyan",translationKey:"queue.pending"},in_progress:{colorScheme:"yellow",translationKey:"queue.in_progress"},completed:{colorScheme:"green",translationKey:"queue.completed"},failed:{colorScheme:"red",translationKey:"queue.failed"},canceled:{colorScheme:"orange",translationKey:"queue.canceled"}},Fhe=({status:e})=>{const{t}=Z();return a.jsx(Ds,{colorScheme:R_[e].colorScheme,children:t(R_[e].translationKey)})},Bhe=d.memo(Fhe),Hhe=e=>{const t=W(u=>u.system.isConnected),{isCanceled:n}=RN({batch_id:e},{selectFromResult:({data:u})=>u?{isCanceled:(u==null?void 0:u.in_progress)===0&&(u==null?void 0:u.pending)===0}:{isCanceled:!0}}),[r,{isLoading:o}]=DN({fixedCacheKey:"cancelByBatchIds"}),s=te(),{t:i}=Z();return{cancelBatch:d.useCallback(async()=>{if(!n)try{await r({batch_ids:[e]}).unwrap(),s(ct({title:i("queue.cancelBatchSucceeded"),status:"success"}))}catch{s(ct({title:i("queue.cancelBatchFailed"),status:"error"}))}},[e,s,n,i,r]),isLoading:o,isCanceled:n,isDisabled:!t}},Vhe=({queueItemDTO:e})=>{const{session_id:t,batch_id:n,item_id:r}=e,{t:o}=Z(),{cancelBatch:s,isLoading:i,isCanceled:l}=Hhe(n),{cancelQueueItem:u,isLoading:p}=u7(r),{data:m}=AN(r),h=d.useMemo(()=>{if(!m)return o("common.loading");if(!m.completed_at||!m.started_at)return o(`queue.${m.status}`);const g=d7(m.started_at,m.completed_at);return m.status==="completed"?`${o("queue.completedIn")} ${g}${g===1?"":"s"}`:`${g}s`},[m,o]);return a.jsxs(L,{layerStyle:"third",flexDir:"column",p:2,pt:0,borderRadius:"base",gap:2,children:[a.jsxs(L,{layerStyle:"second",p:2,gap:2,justifyContent:"space-between",alignItems:"center",borderRadius:"base",h:20,children:[a.jsx(Ap,{label:o("queue.status"),data:h}),a.jsx(Ap,{label:o("queue.item"),data:r}),a.jsx(Ap,{label:o("queue.batch"),data:n}),a.jsx(Ap,{label:o("queue.session"),data:t}),a.jsxs(Vt,{size:"xs",orientation:"vertical",children:[a.jsx(at,{onClick:u,isLoading:p,isDisabled:m?["canceled","completed","failed"].includes(m.status):!0,"aria-label":o("queue.cancelItem"),icon:a.jsx(Ic,{}),colorScheme:"error",children:o("queue.cancelItem")}),a.jsx(at,{onClick:s,isLoading:i,isDisabled:l,"aria-label":o("queue.cancelBatch"),icon:a.jsx(Ic,{}),colorScheme:"error",children:o("queue.cancelBatch")})]})]}),(m==null?void 0:m.error)&&a.jsxs(L,{layerStyle:"second",p:3,gap:1,justifyContent:"space-between",alignItems:"flex-start",borderRadius:"base",flexDir:"column",children:[a.jsx(cr,{size:"sm",color:"error.500",_dark:{color:"error.400"},children:"Error"}),a.jsx("pre",{children:m.error})]}),a.jsx(L,{layerStyle:"second",h:512,w:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",children:m?a.jsx(Zd,{children:a.jsx(Ya,{label:"Queue Item",data:m})}):a.jsx(fa,{opacity:.5})})]})},Whe=d.memo(Vhe),Ap=({label:e,data:t})=>a.jsxs(L,{flexDir:"column",justifyContent:"flex-start",p:1,gap:1,overflow:"hidden",h:"full",w:"full",children:[a.jsx(cr,{size:"md",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e}),a.jsx(ve,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t})]}),vs={number:"3rem",statusBadge:"5.7rem",statusDot:2,time:"4rem",batchId:"5rem",fieldValues:"auto",actions:"auto"},D_={bg:"base.300",_dark:{bg:"base.750"}},Uhe={_hover:D_,"&[aria-selected='true']":D_},Ghe=({index:e,item:t,context:n})=>{const{t:r}=Z(),o=d.useCallback(()=>{n.toggleQueueItem(t.item_id)},[n,t.item_id]),{cancelQueueItem:s,isLoading:i}=u7(t.item_id),l=d.useCallback(h=>{h.stopPropagation(),s()},[s]),u=d.useMemo(()=>n.openQueueItems.includes(t.item_id),[n.openQueueItems,t.item_id]),p=d.useMemo(()=>!t.completed_at||!t.started_at?void 0:`${d7(t.started_at,t.completed_at)}s`,[t]),m=d.useMemo(()=>["canceled","completed","failed"].includes(t.status),[t.status]);return a.jsxs(L,{flexDir:"column","aria-selected":u,fontSize:"sm",borderRadius:"base",justifyContent:"center",sx:Uhe,"data-testid":"queue-item",children:[a.jsxs(L,{minH:9,alignItems:"center",gap:4,p:1.5,cursor:"pointer",onClick:o,children:[a.jsx(L,{w:vs.number,justifyContent:"flex-end",alignItems:"center",flexShrink:0,children:a.jsx(ve,{variant:"subtext",children:e+1})}),a.jsx(L,{w:vs.statusBadge,alignItems:"center",flexShrink:0,children:a.jsx(Bhe,{status:t.status})}),a.jsx(L,{w:vs.time,alignItems:"center",flexShrink:0,children:p||"-"}),a.jsx(L,{w:vs.batchId,flexShrink:0,children:a.jsx(ve,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",alignItems:"center",children:t.batch_id})}),a.jsx(L,{alignItems:"center",overflow:"hidden",flexGrow:1,children:t.field_values&&a.jsx(L,{gap:2,w:"full",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:t.field_values.filter(h=>h.node_path!=="metadata_accumulator").map(({node_path:h,field_name:g,value:x})=>a.jsxs(ve,{as:"span",children:[a.jsxs(ve,{as:"span",fontWeight:600,children:[h,".",g]}),": ",x]},`${t.item_id}.${h}.${g}.${x}`))})}),a.jsx(L,{alignItems:"center",w:vs.actions,pe:3,children:a.jsx(Vt,{size:"xs",variant:"ghost",children:a.jsx(Fe,{onClick:l,isDisabled:m,isLoading:i,"aria-label":r("queue.cancelItem"),icon:a.jsx(Ic,{})})})})]}),a.jsx(Id,{in:u,transition:{enter:{duration:.1},exit:{duration:.1}},unmountOnExit:!0,children:a.jsx(Whe,{queueItemDTO:t})})]})},Khe=d.memo(Ghe),qhe=d.memo(je((e,t)=>a.jsx(L,{...e,ref:t,flexDirection:"column",gap:.5,children:e.children}))),Xhe=d.memo(qhe),Qhe=()=>a.jsxs(L,{alignItems:"center",gap:4,p:1,pb:2,textTransform:"uppercase",fontWeight:700,fontSize:"xs",letterSpacing:1,children:[a.jsx(L,{w:vs.number,justifyContent:"flex-end",alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"#"})}),a.jsx(L,{ps:.5,w:vs.statusBadge,alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"status"})}),a.jsx(L,{ps:.5,w:vs.time,alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"time"})}),a.jsx(L,{ps:.5,w:vs.batchId,alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"batch"})}),a.jsx(L,{ps:.5,w:vs.fieldValues,alignItems:"center",children:a.jsx(ve,{variant:"subtext",children:"batch field values"})})]}),Yhe=d.memo(Qhe),Zhe={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},Jhe=le(xe,({queue:e})=>{const{listCursor:t,listPriority:n}=e;return{listCursor:t,listPriority:n}},Se),ege=(e,t)=>t.item_id,tge={List:Xhe},nge=(e,t,n)=>a.jsx(Khe,{index:e,item:t,context:n}),rge=()=>{const{listCursor:e,listPriority:t}=W(Jhe),n=te(),r=d.useRef(null),[o,s]=d.useState(null),[i,l]=Oy(Zhe),{t:u}=Z();d.useEffect(()=>{const{current:S}=r;return o&&S&&i({target:S,elements:{viewport:o}}),()=>{var j;return(j=l())==null?void 0:j.destroy()}},[o,i,l]);const{data:p,isLoading:m}=TN({cursor:e,priority:t}),h=d.useMemo(()=>p?NN.getSelectors().selectAll(p):[],[p]),g=d.useCallback(()=>{if(!(p!=null&&p.has_more))return;const S=h[h.length-1];S&&(n(eb(S.item_id)),n(tb(S.priority)))},[n,p==null?void 0:p.has_more,h]),[x,y]=d.useState([]),b=d.useCallback(S=>{y(j=>j.includes(S)?j.filter(_=>_!==S):[...j,S])},[]),w=d.useMemo(()=>({openQueueItems:x,toggleQueueItem:b}),[x,b]);return m?a.jsx(Lne,{}):h.length?a.jsxs(L,{w:"full",h:"full",flexDir:"column",children:[a.jsx(Yhe,{}),a.jsx(L,{ref:r,w:"full",h:"full",alignItems:"center",justifyContent:"center",children:a.jsx(Xre,{data:h,endReached:g,scrollerRef:s,itemContent:nge,computeItemKey:ege,components:tge,context:w})})]}):a.jsx(L,{w:"full",h:"full",alignItems:"center",justifyContent:"center",children:a.jsx(cr,{color:"base.400",_dark:{color:"base.500"},children:u("queue.queueEmpty")})})},oge=d.memo(rge),sge=()=>{const{data:e}=va(),{t}=Z();return a.jsxs(c7,{"data-testid":"queue-status",children:[a.jsx(hs,{label:t("queue.in_progress"),value:(e==null?void 0:e.queue.in_progress)??0}),a.jsx(hs,{label:t("queue.pending"),value:(e==null?void 0:e.queue.pending)??0}),a.jsx(hs,{label:t("queue.completed"),value:(e==null?void 0:e.queue.completed)??0}),a.jsx(hs,{label:t("queue.failed"),value:(e==null?void 0:e.queue.failed)??0}),a.jsx(hs,{label:t("queue.canceled"),value:(e==null?void 0:e.queue.canceled)??0}),a.jsx(hs,{label:t("queue.total"),value:(e==null?void 0:e.queue.total)??0})]})},age=d.memo(sge);function ige(e){return Te({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828l.645-1.937zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.734 1.734 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.734 1.734 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.734 1.734 0 0 0 3.407 2.31l.387-1.162zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L10.863.1z"}}]})(e)}const lge=()=>{const e=te(),{t}=Z(),n=W(u=>u.system.isConnected),[r,{isLoading:o}]=OI({fixedCacheKey:"pruneQueue"}),{finishedCount:s}=va(void 0,{selectFromResult:({data:u})=>u?{finishedCount:u.queue.completed+u.queue.canceled+u.queue.failed}:{finishedCount:0}}),i=d.useCallback(async()=>{if(s)try{const u=await r().unwrap();e(ct({title:t("queue.pruneSucceeded",{item_count:u.deleted}),status:"success"})),e(eb(void 0)),e(tb(void 0))}catch{e(ct({title:t("queue.pruneFailed"),status:"error"}))}},[s,r,e,t]),l=d.useMemo(()=>!n||!s,[s,n]);return{pruneQueue:i,isLoading:o,finishedCount:s,isDisabled:l}},cge=({asIconButton:e})=>{const{t}=Z(),{pruneQueue:n,isLoading:r,finishedCount:o,isDisabled:s}=lge();return a.jsx(ul,{isDisabled:s,isLoading:r,asIconButton:e,label:t("queue.prune"),tooltip:t("queue.pruneTooltip",{item_count:o}),icon:a.jsx(ige,{}),onClick:n,colorScheme:"blue"})},uge=d.memo(cge),dge=()=>{const e=Ht("pauseQueue").isFeatureEnabled,t=Ht("resumeQueue").isFeatureEnabled;return a.jsxs(L,{layerStyle:"second",borderRadius:"base",p:2,gap:2,children:[e||t?a.jsxs(Vt,{w:28,orientation:"vertical",isAttached:!0,size:"sm",children:[t?a.jsx(q8,{}):a.jsx(a.Fragment,{}),e?a.jsx(H8,{}):a.jsx(a.Fragment,{})]}):a.jsx(a.Fragment,{}),a.jsxs(Vt,{w:28,orientation:"vertical",isAttached:!0,size:"sm",children:[a.jsx(uge,{}),a.jsx(Qy,{})]})]})},fge=d.memo(dge),pge=()=>{const e=Ht("invocationCache").isFeatureEnabled;return a.jsxs(L,{layerStyle:"first",borderRadius:"base",w:"full",h:"full",p:2,flexDir:"column",gap:2,children:[a.jsxs(L,{gap:2,w:"full",children:[a.jsx(fge,{}),a.jsx(age,{}),e&&a.jsx(zhe,{})]}),a.jsx(Ie,{layerStyle:"second",p:2,borderRadius:"base",w:"full",h:"full",children:a.jsx(oge,{})})]})},mge=d.memo(pge),hge=()=>a.jsx(mge,{}),gge=d.memo(hge),vge=()=>a.jsx(GO,{}),xge=d.memo(vge);var Ax={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=Fw;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=Fw;e.exports=r.Konva})(Ax,Ax.exports);var bge=Ax.exports;const gd=xd(bge);var f7={exports:{}};/**
|
||
* @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 yge=function(t){var n={},r=d,o=Tp,s=Object.assign;function i(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,v=1;v<arguments.length;v++)f+="&args[]="+encodeURIComponent(arguments[v]);return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),y=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),I=Symbol.iterator;function M(c){return c===null||typeof c!="object"?null:(c=I&&c[I]||c["@@iterator"],typeof c=="function"?c:null)}function R(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case m:return"Fragment";case p:return"Portal";case g:return"Profiler";case h:return"StrictMode";case w:return"Suspense";case S:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case y:return(c.displayName||"Context")+".Consumer";case x:return(c._context.displayName||"Context")+".Provider";case b:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case j:return f=c.displayName||null,f!==null?f:R(c.type)||"Memo";case _:f=c._payload,c=c._init;try{return R(c(f))}catch{}}return null}function D(c){var f=c.type;switch(c.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=f.render,c=c.displayName||c.name||"",f.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(f);case 8:return f===h?"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 f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function A(c){var f=c,v=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,f.flags&4098&&(v=f.return),c=f.return;while(c)}return f.tag===3?v:null}function O(c){if(A(c)!==c)throw Error(i(188))}function T(c){var f=c.alternate;if(!f){if(f=A(c),f===null)throw Error(i(188));return f!==c?null:c}for(var v=c,C=f;;){var k=v.return;if(k===null)break;var P=k.alternate;if(P===null){if(C=k.return,C!==null){v=C;continue}break}if(k.child===P.child){for(P=k.child;P;){if(P===v)return O(k),c;if(P===C)return O(k),f;P=P.sibling}throw Error(i(188))}if(v.return!==C.return)v=k,C=P;else{for(var z=!1,ne=k.child;ne;){if(ne===v){z=!0,v=k,C=P;break}if(ne===C){z=!0,C=k,v=P;break}ne=ne.sibling}if(!z){for(ne=P.child;ne;){if(ne===v){z=!0,v=P,C=k;break}if(ne===C){z=!0,C=P,v=k;break}ne=ne.sibling}if(!z)throw Error(i(189))}}if(v.alternate!==C)throw Error(i(190))}if(v.tag!==3)throw Error(i(188));return v.stateNode.current===v?c:f}function X(c){return c=T(c),c!==null?B(c):null}function B(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=B(c);if(f!==null)return f;c=c.sibling}return null}function V(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var f=V(c);if(f!==null)return f}c=c.sibling}return null}var U=Array.isArray,N=t.getPublicInstance,$=t.getRootHostContext,q=t.getChildHostContext,F=t.prepareForCommit,Q=t.resetAfterCommit,Y=t.createInstance,se=t.appendInitialChild,ae=t.finalizeInitialChildren,re=t.prepareUpdate,G=t.shouldSetTextContent,K=t.createTextInstance,ee=t.scheduleTimeout,ce=t.cancelTimeout,J=t.noTimeout,ie=t.isPrimaryRenderer,de=t.supportsMutation,ge=t.supportsPersistence,Ce=t.supportsHydration,he=t.getInstanceFromNode,fe=t.preparePortalMount,Oe=t.getCurrentEventPriority,_e=t.detachDeletedInstance,Ne=t.supportsMicrotasks,nt=t.scheduleMicrotask,$e=t.supportsTestSelectors,Pt=t.findFiberRoot,Ze=t.getBoundingRect,ot=t.getTextContent,ye=t.isHiddenSubtree,De=t.matchAccessibilityRole,ut=t.setFocusIfFocusable,bt=t.setupIntersectionObserver,be=t.appendChild,Je=t.appendChildToContainer,lt=t.commitTextUpdate,ft=t.commitMount,Me=t.commitUpdate,Le=t.insertBefore,Ut=t.insertInContainerBefore,ke=t.removeChild,Be=t.removeChildFromContainer,ze=t.resetTextContent,Ge=t.hideInstance,pt=t.hideTextInstance,En=t.unhideInstance,Dt=t.unhideTextInstance,At=t.clearContainer,pr=t.cloneInstance,Ln=t.createContainerChildSet,kn=t.appendChildToContainerChildSet,gn=t.finalizeContainerChildren,ln=t.replaceContainerChildren,kr=t.cloneHiddenInstance,Mo=t.cloneHiddenTextInstance,mr=t.canHydrateInstance,hr=t.canHydrateTextInstance,Ns=t.canHydrateSuspenseInstance,$s=t.isSuspenseInstancePending,wa=t.isSuspenseInstanceFallback,Sa=t.getSuspenseInstanceFallbackErrorDetails,ml=t.registerSuspenseInstanceRetry,ka=t.getNextHydratableSibling,hl=t.getFirstHydratableChild,Qe=t.getFirstHydratableChildWithinContainer,Gt=t.getFirstHydratableChildWithinSuspenseInstance,zn=t.hydrateInstance,St=t.hydrateTextInstance,ja=t.hydrateSuspenseInstance,Wr=t.getNextHydratableInstanceAfterSuspenseInstance,ef=t.commitHydratedContainer,zg=t.commitHydratedSuspenseInstance,Fg=t.clearSuspenseBoundary,Fn=t.clearSuspenseBoundaryFromContainer,Ls=t.shouldDeleteUnhydratedTailInstances,tf=t.didNotMatchHydratedContainerTextInstance,gl=t.didNotMatchHydratedTextInstance,Zc;function hi(c){if(Zc===void 0)try{throw Error()}catch(v){var f=v.stack.trim().match(/\n( *(at )?)/);Zc=f&&f[1]||""}return`
|
||
`+Zc+c}var Jc=!1;function eu(c,f){if(!c||Jc)return"";Jc=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(Ee){var C=Ee}Reflect.construct(c,[],f)}else{try{f.call()}catch(Ee){C=Ee}c.call(f.prototype)}else{try{throw Error()}catch(Ee){C=Ee}c()}}catch(Ee){if(Ee&&C&&typeof Ee.stack=="string"){for(var k=Ee.stack.split(`
|
||
`),P=C.stack.split(`
|
||
`),z=k.length-1,ne=P.length-1;1<=z&&0<=ne&&k[z]!==P[ne];)ne--;for(;1<=z&&0<=ne;z--,ne--)if(k[z]!==P[ne]){if(z!==1||ne!==1)do if(z--,ne--,0>ne||k[z]!==P[ne]){var pe=`
|
||
`+k[z].replace(" at new "," at ");return c.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",c.displayName)),pe}while(1<=z&&0<=ne);break}}}finally{Jc=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?hi(c):""}var Bg=Object.prototype.hasOwnProperty,_a=[],rt=-1;function Mt(c){return{current:c}}function kt(c){0>rt||(c.current=_a[rt],_a[rt]=null,rt--)}function Ot(c,f){rt++,_a[rt]=c.current,c.current=f}var rr={},rn=Mt(rr),An=Mt(!1),gr=rr;function vl(c,f){var v=c.type.contextTypes;if(!v)return rr;var C=c.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===f)return C.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in v)k[P]=f[P];return C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=k),k}function jr(c){return c=c.childContextTypes,c!=null}function nf(){kt(An),kt(rn)}function v2(c,f,v){if(rn.current!==rr)throw Error(i(168));Ot(rn,f),Ot(An,v)}function x2(c,f,v){var C=c.stateNode;if(f=f.childContextTypes,typeof C.getChildContext!="function")return v;C=C.getChildContext();for(var k in C)if(!(k in f))throw Error(i(108,D(c)||"Unknown",k));return s({},v,C)}function rf(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||rr,gr=rn.current,Ot(rn,c),Ot(An,An.current),!0}function b2(c,f,v){var C=c.stateNode;if(!C)throw Error(i(169));v?(c=x2(c,f,gr),C.__reactInternalMemoizedMergedChildContext=c,kt(An),kt(rn),Ot(rn,c)):kt(An),Ot(An,v)}var Oo=Math.clz32?Math.clz32:I7,j7=Math.log,_7=Math.LN2;function I7(c){return c>>>=0,c===0?32:31-(j7(c)/_7|0)|0}var of=64,sf=4194304;function tu(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function af(c,f){var v=c.pendingLanes;if(v===0)return 0;var C=0,k=c.suspendedLanes,P=c.pingedLanes,z=v&268435455;if(z!==0){var ne=z&~k;ne!==0?C=tu(ne):(P&=z,P!==0&&(C=tu(P)))}else z=v&~k,z!==0?C=tu(z):P!==0&&(C=tu(P));if(C===0)return 0;if(f!==0&&f!==C&&!(f&k)&&(k=C&-C,P=f&-f,k>=P||k===16&&(P&4194240)!==0))return f;if(C&4&&(C|=v&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=C;0<f;)v=31-Oo(f),k=1<<v,C|=c[v],f&=~k;return C}function P7(c,f){switch(c){case 1:case 2:case 4:return f+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 f+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 E7(c,f){for(var v=c.suspendedLanes,C=c.pingedLanes,k=c.expirationTimes,P=c.pendingLanes;0<P;){var z=31-Oo(P),ne=1<<z,pe=k[z];pe===-1?(!(ne&v)||ne&C)&&(k[z]=P7(ne,f)):pe<=f&&(c.expiredLanes|=ne),P&=~ne}}function Hg(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function y2(){var c=of;return of<<=1,!(of&4194240)&&(of=64),c}function Vg(c){for(var f=[],v=0;31>v;v++)f.push(c);return f}function nu(c,f,v){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Oo(f),c[f]=v}function M7(c,f){var v=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var C=c.eventTimes;for(c=c.expirationTimes;0<v;){var k=31-Oo(v),P=1<<k;f[k]=0,C[k]=-1,c[k]=-1,v&=~P}}function Wg(c,f){var v=c.entangledLanes|=f;for(c=c.entanglements;v;){var C=31-Oo(v),k=1<<C;k&f|c[C]&f&&(c[C]|=f),v&=~k}}var Nt=0;function C2(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var Ug=o.unstable_scheduleCallback,w2=o.unstable_cancelCallback,O7=o.unstable_shouldYield,R7=o.unstable_requestPaint,Gn=o.unstable_now,Gg=o.unstable_ImmediatePriority,D7=o.unstable_UserBlockingPriority,Kg=o.unstable_NormalPriority,A7=o.unstable_IdlePriority,lf=null,ss=null;function T7(c){if(ss&&typeof ss.onCommitFiberRoot=="function")try{ss.onCommitFiberRoot(lf,c,void 0,(c.current.flags&128)===128)}catch{}}function N7(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var Ro=typeof Object.is=="function"?Object.is:N7,zs=null,cf=!1,qg=!1;function S2(c){zs===null?zs=[c]:zs.push(c)}function $7(c){cf=!0,S2(c)}function as(){if(!qg&&zs!==null){qg=!0;var c=0,f=Nt;try{var v=zs;for(Nt=1;c<v.length;c++){var C=v[c];do C=C(!0);while(C!==null)}zs=null,cf=!1}catch(k){throw zs!==null&&(zs=zs.slice(c+1)),Ug(Gg,as),k}finally{Nt=f,qg=!1}}return null}var xl=[],bl=0,uf=null,df=0,so=[],ao=0,gi=null,Fs=1,Bs="";function vi(c,f){xl[bl++]=df,xl[bl++]=uf,uf=c,df=f}function k2(c,f,v){so[ao++]=Fs,so[ao++]=Bs,so[ao++]=gi,gi=c;var C=Fs;c=Bs;var k=32-Oo(C)-1;C&=~(1<<k),v+=1;var P=32-Oo(f)+k;if(30<P){var z=k-k%5;P=(C&(1<<z)-1).toString(32),C>>=z,k-=z,Fs=1<<32-Oo(f)+k|v<<k|C,Bs=P+c}else Fs=1<<P|v<<k|C,Bs=c}function Xg(c){c.return!==null&&(vi(c,1),k2(c,1,0))}function Qg(c){for(;c===uf;)uf=xl[--bl],xl[bl]=null,df=xl[--bl],xl[bl]=null;for(;c===gi;)gi=so[--ao],so[ao]=null,Bs=so[--ao],so[ao]=null,Fs=so[--ao],so[ao]=null}var Ur=null,io=null,cn=!1,ru=!1,Do=null;function j2(c,f){var v=po(5,null,null,0);v.elementType="DELETED",v.stateNode=f,v.return=c,f=c.deletions,f===null?(c.deletions=[v],c.flags|=16):f.push(v)}function _2(c,f){switch(c.tag){case 5:return f=mr(f,c.type,c.pendingProps),f!==null?(c.stateNode=f,Ur=c,io=hl(f),!0):!1;case 6:return f=hr(f,c.pendingProps),f!==null?(c.stateNode=f,Ur=c,io=null,!0):!1;case 13:if(f=Ns(f),f!==null){var v=gi!==null?{id:Fs,overflow:Bs}:null;return c.memoizedState={dehydrated:f,treeContext:v,retryLane:1073741824},v=po(18,null,null,0),v.stateNode=f,v.return=c,c.child=v,Ur=c,io=null,!0}return!1;default:return!1}}function Yg(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Zg(c){if(cn){var f=io;if(f){var v=f;if(!_2(c,f)){if(Yg(c))throw Error(i(418));f=ka(v);var C=Ur;f&&_2(c,f)?j2(C,v):(c.flags=c.flags&-4097|2,cn=!1,Ur=c)}}else{if(Yg(c))throw Error(i(418));c.flags=c.flags&-4097|2,cn=!1,Ur=c}}}function I2(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Ur=c}function ff(c){if(!Ce||c!==Ur)return!1;if(!cn)return I2(c),cn=!0,!1;if(c.tag!==3&&(c.tag!==5||Ls(c.type)&&!G(c.type,c.memoizedProps))){var f=io;if(f){if(Yg(c))throw P2(),Error(i(418));for(;f;)j2(c,f),f=ka(f)}}if(I2(c),c.tag===13){if(!Ce)throw Error(i(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));io=Wr(c)}else io=Ur?ka(c.stateNode):null;return!0}function P2(){for(var c=io;c;)c=ka(c)}function yl(){Ce&&(io=Ur=null,ru=cn=!1)}function Jg(c){Do===null?Do=[c]:Do.push(c)}var L7=l.ReactCurrentBatchConfig;function pf(c,f){if(Ro(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var v=Object.keys(c),C=Object.keys(f);if(v.length!==C.length)return!1;for(C=0;C<v.length;C++){var k=v[C];if(!Bg.call(f,k)||!Ro(c[k],f[k]))return!1}return!0}function z7(c){switch(c.tag){case 5:return hi(c.type);case 16:return hi("Lazy");case 13:return hi("Suspense");case 19:return hi("SuspenseList");case 0:case 2:case 15:return c=eu(c.type,!1),c;case 11:return c=eu(c.type.render,!1),c;case 1:return c=eu(c.type,!0),c;default:return""}}function Ao(c,f){if(c&&c.defaultProps){f=s({},f),c=c.defaultProps;for(var v in c)f[v]===void 0&&(f[v]=c[v]);return f}return f}var mf=Mt(null),hf=null,Cl=null,e0=null;function t0(){e0=Cl=hf=null}function E2(c,f,v){ie?(Ot(mf,f._currentValue),f._currentValue=v):(Ot(mf,f._currentValue2),f._currentValue2=v)}function n0(c){var f=mf.current;kt(mf),ie?c._currentValue=f:c._currentValue2=f}function r0(c,f,v){for(;c!==null;){var C=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,C!==null&&(C.childLanes|=f)):C!==null&&(C.childLanes&f)!==f&&(C.childLanes|=f),c===v)break;c=c.return}}function wl(c,f){hf=c,e0=Cl=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&f&&(_r=!0),c.firstContext=null)}function lo(c){var f=ie?c._currentValue:c._currentValue2;if(e0!==c)if(c={context:c,memoizedValue:f,next:null},Cl===null){if(hf===null)throw Error(i(308));Cl=c,hf.dependencies={lanes:0,firstContext:c}}else Cl=Cl.next=c;return f}var xi=null;function o0(c){xi===null?xi=[c]:xi.push(c)}function M2(c,f,v,C){var k=f.interleaved;return k===null?(v.next=v,o0(f)):(v.next=k.next,k.next=v),f.interleaved=v,is(c,C)}function is(c,f){c.lanes|=f;var v=c.alternate;for(v!==null&&(v.lanes|=f),v=c,c=c.return;c!==null;)c.childLanes|=f,v=c.alternate,v!==null&&(v.childLanes|=f),v=c,c=c.return;return v.tag===3?v.stateNode:null}var Ia=!1;function s0(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function O2(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Hs(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function Pa(c,f,v){var C=c.updateQueue;if(C===null)return null;if(C=C.shared,jt&2){var k=C.pending;return k===null?f.next=f:(f.next=k.next,k.next=f),C.pending=f,is(c,v)}return k=C.interleaved,k===null?(f.next=f,o0(C)):(f.next=k.next,k.next=f),C.interleaved=f,is(c,v)}function gf(c,f,v){if(f=f.updateQueue,f!==null&&(f=f.shared,(v&4194240)!==0)){var C=f.lanes;C&=c.pendingLanes,v|=C,f.lanes=v,Wg(c,v)}}function R2(c,f){var v=c.updateQueue,C=c.alternate;if(C!==null&&(C=C.updateQueue,v===C)){var k=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var z={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?k=P=z:P=P.next=z,v=v.next}while(v!==null);P===null?k=P=f:P=P.next=f}else k=P=f;v={baseState:C.baseState,firstBaseUpdate:k,lastBaseUpdate:P,shared:C.shared,effects:C.effects},c.updateQueue=v;return}c=v.lastBaseUpdate,c===null?v.firstBaseUpdate=f:c.next=f,v.lastBaseUpdate=f}function vf(c,f,v,C){var k=c.updateQueue;Ia=!1;var P=k.firstBaseUpdate,z=k.lastBaseUpdate,ne=k.shared.pending;if(ne!==null){k.shared.pending=null;var pe=ne,Ee=pe.next;pe.next=null,z===null?P=Ee:z.next=Ee,z=pe;var qe=c.alternate;qe!==null&&(qe=qe.updateQueue,ne=qe.lastBaseUpdate,ne!==z&&(ne===null?qe.firstBaseUpdate=Ee:ne.next=Ee,qe.lastBaseUpdate=pe))}if(P!==null){var vt=k.baseState;z=0,qe=Ee=pe=null,ne=P;do{var We=ne.lane,sn=ne.eventTime;if((C&We)===We){qe!==null&&(qe=qe.next={eventTime:sn,lane:0,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null});e:{var Zt=c,Er=ne;switch(We=f,sn=v,Er.tag){case 1:if(Zt=Er.payload,typeof Zt=="function"){vt=Zt.call(sn,vt,We);break e}vt=Zt;break e;case 3:Zt.flags=Zt.flags&-65537|128;case 0:if(Zt=Er.payload,We=typeof Zt=="function"?Zt.call(sn,vt,We):Zt,We==null)break e;vt=s({},vt,We);break e;case 2:Ia=!0}}ne.callback!==null&&ne.lane!==0&&(c.flags|=64,We=k.effects,We===null?k.effects=[ne]:We.push(ne))}else sn={eventTime:sn,lane:We,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},qe===null?(Ee=qe=sn,pe=vt):qe=qe.next=sn,z|=We;if(ne=ne.next,ne===null){if(ne=k.shared.pending,ne===null)break;We=ne,ne=We.next,We.next=null,k.lastBaseUpdate=We,k.shared.pending=null}}while(1);if(qe===null&&(pe=vt),k.baseState=pe,k.firstBaseUpdate=Ee,k.lastBaseUpdate=qe,f=k.shared.interleaved,f!==null){k=f;do z|=k.lane,k=k.next;while(k!==f)}else P===null&&(k.shared.lanes=0);yi|=z,c.lanes=z,c.memoizedState=vt}}function D2(c,f,v){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var C=c[f],k=C.callback;if(k!==null){if(C.callback=null,C=v,typeof k!="function")throw Error(i(191,k));k.call(C)}}}var A2=new r.Component().refs;function a0(c,f,v,C){f=c.memoizedState,v=v(C,f),v=v==null?f:s({},f,v),c.memoizedState=v,c.lanes===0&&(c.updateQueue.baseState=v)}var xf={isMounted:function(c){return(c=c._reactInternals)?A(c)===c:!1},enqueueSetState:function(c,f,v){c=c._reactInternals;var C=ir(),k=Oa(c),P=Hs(C,k);P.payload=f,v!=null&&(P.callback=v),f=Pa(c,P,k),f!==null&&(fo(f,c,k,C),gf(f,c,k))},enqueueReplaceState:function(c,f,v){c=c._reactInternals;var C=ir(),k=Oa(c),P=Hs(C,k);P.tag=1,P.payload=f,v!=null&&(P.callback=v),f=Pa(c,P,k),f!==null&&(fo(f,c,k,C),gf(f,c,k))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var v=ir(),C=Oa(c),k=Hs(v,C);k.tag=2,f!=null&&(k.callback=f),f=Pa(c,k,C),f!==null&&(fo(f,c,C,v),gf(f,c,C))}};function T2(c,f,v,C,k,P,z){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(C,P,z):f.prototype&&f.prototype.isPureReactComponent?!pf(v,C)||!pf(k,P):!0}function N2(c,f,v){var C=!1,k=rr,P=f.contextType;return typeof P=="object"&&P!==null?P=lo(P):(k=jr(f)?gr:rn.current,C=f.contextTypes,P=(C=C!=null)?vl(c,k):rr),f=new f(v,P),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=xf,c.stateNode=f,f._reactInternals=c,C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=k,c.__reactInternalMemoizedMaskedChildContext=P),f}function $2(c,f,v,C){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(v,C),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(v,C),f.state!==c&&xf.enqueueReplaceState(f,f.state,null)}function i0(c,f,v,C){var k=c.stateNode;k.props=v,k.state=c.memoizedState,k.refs=A2,s0(c);var P=f.contextType;typeof P=="object"&&P!==null?k.context=lo(P):(P=jr(f)?gr:rn.current,k.context=vl(c,P)),k.state=c.memoizedState,P=f.getDerivedStateFromProps,typeof P=="function"&&(a0(c,f,P,v),k.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(f=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),f!==k.state&&xf.enqueueReplaceState(k,k.state,null),vf(c,v,k,C),k.state=c.memoizedState),typeof k.componentDidMount=="function"&&(c.flags|=4194308)}function ou(c,f,v){if(c=v.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(i(309));var C=v.stateNode}if(!C)throw Error(i(147,c));var k=C,P=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===P?f.ref:(f=function(z){var ne=k.refs;ne===A2&&(ne=k.refs={}),z===null?delete ne[P]:ne[P]=z},f._stringRef=P,f)}if(typeof c!="string")throw Error(i(284));if(!v._owner)throw Error(i(290,c))}return c}function bf(c,f){throw c=Object.prototype.toString.call(f),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function L2(c){var f=c._init;return f(c._payload)}function z2(c){function f(ue,oe){if(c){var me=ue.deletions;me===null?(ue.deletions=[oe],ue.flags|=16):me.push(oe)}}function v(ue,oe){if(!c)return null;for(;oe!==null;)f(ue,oe),oe=oe.sibling;return null}function C(ue,oe){for(ue=new Map;oe!==null;)oe.key!==null?ue.set(oe.key,oe):ue.set(oe.index,oe),oe=oe.sibling;return ue}function k(ue,oe){return ue=Da(ue,oe),ue.index=0,ue.sibling=null,ue}function P(ue,oe,me){return ue.index=me,c?(me=ue.alternate,me!==null?(me=me.index,me<oe?(ue.flags|=2,oe):me):(ue.flags|=2,oe)):(ue.flags|=1048576,oe)}function z(ue){return c&&ue.alternate===null&&(ue.flags|=2),ue}function ne(ue,oe,me,Ue){return oe===null||oe.tag!==6?(oe=q0(me,ue.mode,Ue),oe.return=ue,oe):(oe=k(oe,me),oe.return=ue,oe)}function pe(ue,oe,me,Ue){var it=me.type;return it===m?qe(ue,oe,me.props.children,Ue,me.key):oe!==null&&(oe.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===_&&L2(it)===oe.type)?(Ue=k(oe,me.props),Ue.ref=ou(ue,oe,me),Ue.return=ue,Ue):(Ue=Uf(me.type,me.key,me.props,null,ue.mode,Ue),Ue.ref=ou(ue,oe,me),Ue.return=ue,Ue)}function Ee(ue,oe,me,Ue){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==me.containerInfo||oe.stateNode.implementation!==me.implementation?(oe=X0(me,ue.mode,Ue),oe.return=ue,oe):(oe=k(oe,me.children||[]),oe.return=ue,oe)}function qe(ue,oe,me,Ue,it){return oe===null||oe.tag!==7?(oe=ki(me,ue.mode,Ue,it),oe.return=ue,oe):(oe=k(oe,me),oe.return=ue,oe)}function vt(ue,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return oe=q0(""+oe,ue.mode,me),oe.return=ue,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case u:return me=Uf(oe.type,oe.key,oe.props,null,ue.mode,me),me.ref=ou(ue,null,oe),me.return=ue,me;case p:return oe=X0(oe,ue.mode,me),oe.return=ue,oe;case _:var Ue=oe._init;return vt(ue,Ue(oe._payload),me)}if(U(oe)||M(oe))return oe=ki(oe,ue.mode,me,null),oe.return=ue,oe;bf(ue,oe)}return null}function We(ue,oe,me,Ue){var it=oe!==null?oe.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return it!==null?null:ne(ue,oe,""+me,Ue);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case u:return me.key===it?pe(ue,oe,me,Ue):null;case p:return me.key===it?Ee(ue,oe,me,Ue):null;case _:return it=me._init,We(ue,oe,it(me._payload),Ue)}if(U(me)||M(me))return it!==null?null:qe(ue,oe,me,Ue,null);bf(ue,me)}return null}function sn(ue,oe,me,Ue,it){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number")return ue=ue.get(me)||null,ne(oe,ue,""+Ue,it);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case u:return ue=ue.get(Ue.key===null?me:Ue.key)||null,pe(oe,ue,Ue,it);case p:return ue=ue.get(Ue.key===null?me:Ue.key)||null,Ee(oe,ue,Ue,it);case _:var Ct=Ue._init;return sn(ue,oe,me,Ct(Ue._payload),it)}if(U(Ue)||M(Ue))return ue=ue.get(me)||null,qe(oe,ue,Ue,it,null);bf(oe,Ue)}return null}function Zt(ue,oe,me,Ue){for(var it=null,Ct=null,xt=oe,$t=oe=0,Xn=null;xt!==null&&$t<me.length;$t++){xt.index>$t?(Xn=xt,xt=null):Xn=xt.sibling;var Lt=We(ue,xt,me[$t],Ue);if(Lt===null){xt===null&&(xt=Xn);break}c&&xt&&Lt.alternate===null&&f(ue,xt),oe=P(Lt,oe,$t),Ct===null?it=Lt:Ct.sibling=Lt,Ct=Lt,xt=Xn}if($t===me.length)return v(ue,xt),cn&&vi(ue,$t),it;if(xt===null){for(;$t<me.length;$t++)xt=vt(ue,me[$t],Ue),xt!==null&&(oe=P(xt,oe,$t),Ct===null?it=xt:Ct.sibling=xt,Ct=xt);return cn&&vi(ue,$t),it}for(xt=C(ue,xt);$t<me.length;$t++)Xn=sn(xt,ue,$t,me[$t],Ue),Xn!==null&&(c&&Xn.alternate!==null&&xt.delete(Xn.key===null?$t:Xn.key),oe=P(Xn,oe,$t),Ct===null?it=Xn:Ct.sibling=Xn,Ct=Xn);return c&&xt.forEach(function(Aa){return f(ue,Aa)}),cn&&vi(ue,$t),it}function Er(ue,oe,me,Ue){var it=M(me);if(typeof it!="function")throw Error(i(150));if(me=it.call(me),me==null)throw Error(i(151));for(var Ct=it=null,xt=oe,$t=oe=0,Xn=null,Lt=me.next();xt!==null&&!Lt.done;$t++,Lt=me.next()){xt.index>$t?(Xn=xt,xt=null):Xn=xt.sibling;var Aa=We(ue,xt,Lt.value,Ue);if(Aa===null){xt===null&&(xt=Xn);break}c&&xt&&Aa.alternate===null&&f(ue,xt),oe=P(Aa,oe,$t),Ct===null?it=Aa:Ct.sibling=Aa,Ct=Aa,xt=Xn}if(Lt.done)return v(ue,xt),cn&&vi(ue,$t),it;if(xt===null){for(;!Lt.done;$t++,Lt=me.next())Lt=vt(ue,Lt.value,Ue),Lt!==null&&(oe=P(Lt,oe,$t),Ct===null?it=Lt:Ct.sibling=Lt,Ct=Lt);return cn&&vi(ue,$t),it}for(xt=C(ue,xt);!Lt.done;$t++,Lt=me.next())Lt=sn(xt,ue,$t,Lt.value,Ue),Lt!==null&&(c&&Lt.alternate!==null&&xt.delete(Lt.key===null?$t:Lt.key),oe=P(Lt,oe,$t),Ct===null?it=Lt:Ct.sibling=Lt,Ct=Lt);return c&&xt.forEach(function(hR){return f(ue,hR)}),cn&&vi(ue,$t),it}function Us(ue,oe,me,Ue){if(typeof me=="object"&&me!==null&&me.type===m&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case u:e:{for(var it=me.key,Ct=oe;Ct!==null;){if(Ct.key===it){if(it=me.type,it===m){if(Ct.tag===7){v(ue,Ct.sibling),oe=k(Ct,me.props.children),oe.return=ue,ue=oe;break e}}else if(Ct.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===_&&L2(it)===Ct.type){v(ue,Ct.sibling),oe=k(Ct,me.props),oe.ref=ou(ue,Ct,me),oe.return=ue,ue=oe;break e}v(ue,Ct);break}else f(ue,Ct);Ct=Ct.sibling}me.type===m?(oe=ki(me.props.children,ue.mode,Ue,me.key),oe.return=ue,ue=oe):(Ue=Uf(me.type,me.key,me.props,null,ue.mode,Ue),Ue.ref=ou(ue,oe,me),Ue.return=ue,ue=Ue)}return z(ue);case p:e:{for(Ct=me.key;oe!==null;){if(oe.key===Ct)if(oe.tag===4&&oe.stateNode.containerInfo===me.containerInfo&&oe.stateNode.implementation===me.implementation){v(ue,oe.sibling),oe=k(oe,me.children||[]),oe.return=ue,ue=oe;break e}else{v(ue,oe);break}else f(ue,oe);oe=oe.sibling}oe=X0(me,ue.mode,Ue),oe.return=ue,ue=oe}return z(ue);case _:return Ct=me._init,Us(ue,oe,Ct(me._payload),Ue)}if(U(me))return Zt(ue,oe,me,Ue);if(M(me))return Er(ue,oe,me,Ue);bf(ue,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,oe!==null&&oe.tag===6?(v(ue,oe.sibling),oe=k(oe,me),oe.return=ue,ue=oe):(v(ue,oe),oe=q0(me,ue.mode,Ue),oe.return=ue,ue=oe),z(ue)):v(ue,oe)}return Us}var Sl=z2(!0),F2=z2(!1),su={},co=Mt(su),au=Mt(su),kl=Mt(su);function ls(c){if(c===su)throw Error(i(174));return c}function l0(c,f){Ot(kl,f),Ot(au,c),Ot(co,su),c=$(f),kt(co),Ot(co,c)}function jl(){kt(co),kt(au),kt(kl)}function B2(c){var f=ls(kl.current),v=ls(co.current);f=q(v,c.type,f),v!==f&&(Ot(au,c),Ot(co,f))}function c0(c){au.current===c&&(kt(co),kt(au))}var vn=Mt(0);function yf(c){for(var f=c;f!==null;){if(f.tag===13){var v=f.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||$s(v)||wa(v)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var u0=[];function d0(){for(var c=0;c<u0.length;c++){var f=u0[c];ie?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}u0.length=0}var Cf=l.ReactCurrentDispatcher,f0=l.ReactCurrentBatchConfig,bi=0,xn=null,Bn=null,Kn=null,wf=!1,iu=!1,lu=0,F7=0;function or(){throw Error(i(321))}function p0(c,f){if(f===null)return!1;for(var v=0;v<f.length&&v<c.length;v++)if(!Ro(c[v],f[v]))return!1;return!0}function m0(c,f,v,C,k,P){if(bi=P,xn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Cf.current=c===null||c.memoizedState===null?W7:U7,c=v(C,k),iu){P=0;do{if(iu=!1,lu=0,25<=P)throw Error(i(301));P+=1,Kn=Bn=null,f.updateQueue=null,Cf.current=G7,c=v(C,k)}while(iu)}if(Cf.current=jf,f=Bn!==null&&Bn.next!==null,bi=0,Kn=Bn=xn=null,wf=!1,f)throw Error(i(300));return c}function h0(){var c=lu!==0;return lu=0,c}function cs(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?xn.memoizedState=Kn=c:Kn=Kn.next=c,Kn}function uo(){if(Bn===null){var c=xn.alternate;c=c!==null?c.memoizedState:null}else c=Bn.next;var f=Kn===null?xn.memoizedState:Kn.next;if(f!==null)Kn=f,Bn=c;else{if(c===null)throw Error(i(310));Bn=c,c={memoizedState:Bn.memoizedState,baseState:Bn.baseState,baseQueue:Bn.baseQueue,queue:Bn.queue,next:null},Kn===null?xn.memoizedState=Kn=c:Kn=Kn.next=c}return Kn}function cu(c,f){return typeof f=="function"?f(c):f}function g0(c){var f=uo(),v=f.queue;if(v===null)throw Error(i(311));v.lastRenderedReducer=c;var C=Bn,k=C.baseQueue,P=v.pending;if(P!==null){if(k!==null){var z=k.next;k.next=P.next,P.next=z}C.baseQueue=k=P,v.pending=null}if(k!==null){P=k.next,C=C.baseState;var ne=z=null,pe=null,Ee=P;do{var qe=Ee.lane;if((bi&qe)===qe)pe!==null&&(pe=pe.next={lane:0,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),C=Ee.hasEagerState?Ee.eagerState:c(C,Ee.action);else{var vt={lane:qe,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null};pe===null?(ne=pe=vt,z=C):pe=pe.next=vt,xn.lanes|=qe,yi|=qe}Ee=Ee.next}while(Ee!==null&&Ee!==P);pe===null?z=C:pe.next=ne,Ro(C,f.memoizedState)||(_r=!0),f.memoizedState=C,f.baseState=z,f.baseQueue=pe,v.lastRenderedState=C}if(c=v.interleaved,c!==null){k=c;do P=k.lane,xn.lanes|=P,yi|=P,k=k.next;while(k!==c)}else k===null&&(v.lanes=0);return[f.memoizedState,v.dispatch]}function v0(c){var f=uo(),v=f.queue;if(v===null)throw Error(i(311));v.lastRenderedReducer=c;var C=v.dispatch,k=v.pending,P=f.memoizedState;if(k!==null){v.pending=null;var z=k=k.next;do P=c(P,z.action),z=z.next;while(z!==k);Ro(P,f.memoizedState)||(_r=!0),f.memoizedState=P,f.baseQueue===null&&(f.baseState=P),v.lastRenderedState=P}return[P,C]}function H2(){}function V2(c,f){var v=xn,C=uo(),k=f(),P=!Ro(C.memoizedState,k);if(P&&(C.memoizedState=k,_r=!0),C=C.queue,x0(G2.bind(null,v,C,c),[c]),C.getSnapshot!==f||P||Kn!==null&&Kn.memoizedState.tag&1){if(v.flags|=2048,uu(9,U2.bind(null,v,C,k,f),void 0,null),qn===null)throw Error(i(349));bi&30||W2(v,f,k)}return k}function W2(c,f,v){c.flags|=16384,c={getSnapshot:f,value:v},f=xn.updateQueue,f===null?(f={lastEffect:null,stores:null},xn.updateQueue=f,f.stores=[c]):(v=f.stores,v===null?f.stores=[c]:v.push(c))}function U2(c,f,v,C){f.value=v,f.getSnapshot=C,K2(f)&&q2(c)}function G2(c,f,v){return v(function(){K2(f)&&q2(c)})}function K2(c){var f=c.getSnapshot;c=c.value;try{var v=f();return!Ro(c,v)}catch{return!0}}function q2(c){var f=is(c,1);f!==null&&fo(f,c,1,-1)}function X2(c){var f=cs();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:cu,lastRenderedState:c},f.queue=c,c=c.dispatch=V7.bind(null,xn,c),[f.memoizedState,c]}function uu(c,f,v,C){return c={tag:c,create:f,destroy:v,deps:C,next:null},f=xn.updateQueue,f===null?(f={lastEffect:null,stores:null},xn.updateQueue=f,f.lastEffect=c.next=c):(v=f.lastEffect,v===null?f.lastEffect=c.next=c:(C=v.next,v.next=c,c.next=C,f.lastEffect=c)),c}function Q2(){return uo().memoizedState}function Sf(c,f,v,C){var k=cs();xn.flags|=c,k.memoizedState=uu(1|f,v,void 0,C===void 0?null:C)}function kf(c,f,v,C){var k=uo();C=C===void 0?null:C;var P=void 0;if(Bn!==null){var z=Bn.memoizedState;if(P=z.destroy,C!==null&&p0(C,z.deps)){k.memoizedState=uu(f,v,P,C);return}}xn.flags|=c,k.memoizedState=uu(1|f,v,P,C)}function Y2(c,f){return Sf(8390656,8,c,f)}function x0(c,f){return kf(2048,8,c,f)}function Z2(c,f){return kf(4,2,c,f)}function J2(c,f){return kf(4,4,c,f)}function eC(c,f){if(typeof f=="function")return c=c(),f(c),function(){f(null)};if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function tC(c,f,v){return v=v!=null?v.concat([c]):null,kf(4,4,eC.bind(null,f,c),v)}function b0(){}function nC(c,f){var v=uo();f=f===void 0?null:f;var C=v.memoizedState;return C!==null&&f!==null&&p0(f,C[1])?C[0]:(v.memoizedState=[c,f],c)}function rC(c,f){var v=uo();f=f===void 0?null:f;var C=v.memoizedState;return C!==null&&f!==null&&p0(f,C[1])?C[0]:(c=c(),v.memoizedState=[c,f],c)}function oC(c,f,v){return bi&21?(Ro(v,f)||(v=y2(),xn.lanes|=v,yi|=v,c.baseState=!0),f):(c.baseState&&(c.baseState=!1,_r=!0),c.memoizedState=v)}function B7(c,f){var v=Nt;Nt=v!==0&&4>v?v:4,c(!0);var C=f0.transition;f0.transition={};try{c(!1),f()}finally{Nt=v,f0.transition=C}}function sC(){return uo().memoizedState}function H7(c,f,v){var C=Oa(c);if(v={lane:C,action:v,hasEagerState:!1,eagerState:null,next:null},aC(c))iC(f,v);else if(v=M2(c,f,v,C),v!==null){var k=ir();fo(v,c,C,k),lC(v,f,C)}}function V7(c,f,v){var C=Oa(c),k={lane:C,action:v,hasEagerState:!1,eagerState:null,next:null};if(aC(c))iC(f,k);else{var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var z=f.lastRenderedState,ne=P(z,v);if(k.hasEagerState=!0,k.eagerState=ne,Ro(ne,z)){var pe=f.interleaved;pe===null?(k.next=k,o0(f)):(k.next=pe.next,pe.next=k),f.interleaved=k;return}}catch{}finally{}v=M2(c,f,k,C),v!==null&&(k=ir(),fo(v,c,C,k),lC(v,f,C))}}function aC(c){var f=c.alternate;return c===xn||f!==null&&f===xn}function iC(c,f){iu=wf=!0;var v=c.pending;v===null?f.next=f:(f.next=v.next,v.next=f),c.pending=f}function lC(c,f,v){if(v&4194240){var C=f.lanes;C&=c.pendingLanes,v|=C,f.lanes=v,Wg(c,v)}}var jf={readContext:lo,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},W7={readContext:lo,useCallback:function(c,f){return cs().memoizedState=[c,f===void 0?null:f],c},useContext:lo,useEffect:Y2,useImperativeHandle:function(c,f,v){return v=v!=null?v.concat([c]):null,Sf(4194308,4,eC.bind(null,f,c),v)},useLayoutEffect:function(c,f){return Sf(4194308,4,c,f)},useInsertionEffect:function(c,f){return Sf(4,2,c,f)},useMemo:function(c,f){var v=cs();return f=f===void 0?null:f,c=c(),v.memoizedState=[c,f],c},useReducer:function(c,f,v){var C=cs();return f=v!==void 0?v(f):f,C.memoizedState=C.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},C.queue=c,c=c.dispatch=H7.bind(null,xn,c),[C.memoizedState,c]},useRef:function(c){var f=cs();return c={current:c},f.memoizedState=c},useState:X2,useDebugValue:b0,useDeferredValue:function(c){return cs().memoizedState=c},useTransition:function(){var c=X2(!1),f=c[0];return c=B7.bind(null,c[1]),cs().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,v){var C=xn,k=cs();if(cn){if(v===void 0)throw Error(i(407));v=v()}else{if(v=f(),qn===null)throw Error(i(349));bi&30||W2(C,f,v)}k.memoizedState=v;var P={value:v,getSnapshot:f};return k.queue=P,Y2(G2.bind(null,C,P,c),[c]),C.flags|=2048,uu(9,U2.bind(null,C,P,v,f),void 0,null),v},useId:function(){var c=cs(),f=qn.identifierPrefix;if(cn){var v=Bs,C=Fs;v=(C&~(1<<32-Oo(C)-1)).toString(32)+v,f=":"+f+"R"+v,v=lu++,0<v&&(f+="H"+v.toString(32)),f+=":"}else v=F7++,f=":"+f+"r"+v.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},U7={readContext:lo,useCallback:nC,useContext:lo,useEffect:x0,useImperativeHandle:tC,useInsertionEffect:Z2,useLayoutEffect:J2,useMemo:rC,useReducer:g0,useRef:Q2,useState:function(){return g0(cu)},useDebugValue:b0,useDeferredValue:function(c){var f=uo();return oC(f,Bn.memoizedState,c)},useTransition:function(){var c=g0(cu)[0],f=uo().memoizedState;return[c,f]},useMutableSource:H2,useSyncExternalStore:V2,useId:sC,unstable_isNewReconciler:!1},G7={readContext:lo,useCallback:nC,useContext:lo,useEffect:x0,useImperativeHandle:tC,useInsertionEffect:Z2,useLayoutEffect:J2,useMemo:rC,useReducer:v0,useRef:Q2,useState:function(){return v0(cu)},useDebugValue:b0,useDeferredValue:function(c){var f=uo();return Bn===null?f.memoizedState=c:oC(f,Bn.memoizedState,c)},useTransition:function(){var c=v0(cu)[0],f=uo().memoizedState;return[c,f]},useMutableSource:H2,useSyncExternalStore:V2,useId:sC,unstable_isNewReconciler:!1};function _l(c,f){try{var v="",C=f;do v+=z7(C),C=C.return;while(C);var k=v}catch(P){k=`
|
||
Error generating stack: `+P.message+`
|
||
`+P.stack}return{value:c,source:f,stack:k,digest:null}}function y0(c,f,v){return{value:c,source:null,stack:v??null,digest:f??null}}function C0(c,f){try{console.error(f.value)}catch(v){setTimeout(function(){throw v})}}var K7=typeof WeakMap=="function"?WeakMap:Map;function cC(c,f,v){v=Hs(-1,v),v.tag=3,v.payload={element:null};var C=f.value;return v.callback=function(){zf||(zf=!0,B0=C),C0(c,f)},v}function uC(c,f,v){v=Hs(-1,v),v.tag=3;var C=c.type.getDerivedStateFromError;if(typeof C=="function"){var k=f.value;v.payload=function(){return C(k)},v.callback=function(){C0(c,f)}}var P=c.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(v.callback=function(){C0(c,f),typeof C!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var z=f.stack;this.componentDidCatch(f.value,{componentStack:z!==null?z:""})}),v}function dC(c,f,v){var C=c.pingCache;if(C===null){C=c.pingCache=new K7;var k=new Set;C.set(f,k)}else k=C.get(f),k===void 0&&(k=new Set,C.set(f,k));k.has(v)||(k.add(v),c=iR.bind(null,c,f,v),f.then(c,c))}function fC(c){do{var f;if((f=c.tag===13)&&(f=c.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return c;c=c.return}while(c!==null);return null}function pC(c,f,v,C,k){return c.mode&1?(c.flags|=65536,c.lanes=k,c):(c===f?c.flags|=65536:(c.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(f=Hs(-1,1),f.tag=2,Pa(v,f,1))),v.lanes|=1),c)}var q7=l.ReactCurrentOwner,_r=!1;function vr(c,f,v,C){f.child=c===null?F2(f,null,v,C):Sl(f,c.child,v,C)}function mC(c,f,v,C,k){v=v.render;var P=f.ref;return wl(f,k),C=m0(c,f,v,C,P,k),v=h0(),c!==null&&!_r?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~k,Vs(c,f,k)):(cn&&v&&Xg(f),f.flags|=1,vr(c,f,C,k),f.child)}function hC(c,f,v,C,k){if(c===null){var P=v.type;return typeof P=="function"&&!K0(P)&&P.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(f.tag=15,f.type=P,gC(c,f,P,C,k)):(c=Uf(v.type,null,C,f,f.mode,k),c.ref=f.ref,c.return=f,f.child=c)}if(P=c.child,!(c.lanes&k)){var z=P.memoizedProps;if(v=v.compare,v=v!==null?v:pf,v(z,C)&&c.ref===f.ref)return Vs(c,f,k)}return f.flags|=1,c=Da(P,C),c.ref=f.ref,c.return=f,f.child=c}function gC(c,f,v,C,k){if(c!==null){var P=c.memoizedProps;if(pf(P,C)&&c.ref===f.ref)if(_r=!1,f.pendingProps=C=P,(c.lanes&k)!==0)c.flags&131072&&(_r=!0);else return f.lanes=c.lanes,Vs(c,f,k)}return w0(c,f,v,C,k)}function vC(c,f,v){var C=f.pendingProps,k=C.children,P=c!==null?c.memoizedState:null;if(C.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ot(Pl,Gr),Gr|=v;else{if(!(v&1073741824))return c=P!==null?P.baseLanes|v:v,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null,transitions:null},f.updateQueue=null,Ot(Pl,Gr),Gr|=c,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=P!==null?P.baseLanes:v,Ot(Pl,Gr),Gr|=C}else P!==null?(C=P.baseLanes|v,f.memoizedState=null):C=v,Ot(Pl,Gr),Gr|=C;return vr(c,f,k,v),f.child}function xC(c,f){var v=f.ref;(c===null&&v!==null||c!==null&&c.ref!==v)&&(f.flags|=512,f.flags|=2097152)}function w0(c,f,v,C,k){var P=jr(v)?gr:rn.current;return P=vl(f,P),wl(f,k),v=m0(c,f,v,C,P,k),C=h0(),c!==null&&!_r?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~k,Vs(c,f,k)):(cn&&C&&Xg(f),f.flags|=1,vr(c,f,v,k),f.child)}function bC(c,f,v,C,k){if(jr(v)){var P=!0;rf(f)}else P=!1;if(wl(f,k),f.stateNode===null)If(c,f),N2(f,v,C),i0(f,v,C,k),C=!0;else if(c===null){var z=f.stateNode,ne=f.memoizedProps;z.props=ne;var pe=z.context,Ee=v.contextType;typeof Ee=="object"&&Ee!==null?Ee=lo(Ee):(Ee=jr(v)?gr:rn.current,Ee=vl(f,Ee));var qe=v.getDerivedStateFromProps,vt=typeof qe=="function"||typeof z.getSnapshotBeforeUpdate=="function";vt||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(ne!==C||pe!==Ee)&&$2(f,z,C,Ee),Ia=!1;var We=f.memoizedState;z.state=We,vf(f,C,z,k),pe=f.memoizedState,ne!==C||We!==pe||An.current||Ia?(typeof qe=="function"&&(a0(f,v,qe,C),pe=f.memoizedState),(ne=Ia||T2(f,v,ne,C,We,pe,Ee))?(vt||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(f.flags|=4194308)):(typeof z.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=C,f.memoizedState=pe),z.props=C,z.state=pe,z.context=Ee,C=ne):(typeof z.componentDidMount=="function"&&(f.flags|=4194308),C=!1)}else{z=f.stateNode,O2(c,f),ne=f.memoizedProps,Ee=f.type===f.elementType?ne:Ao(f.type,ne),z.props=Ee,vt=f.pendingProps,We=z.context,pe=v.contextType,typeof pe=="object"&&pe!==null?pe=lo(pe):(pe=jr(v)?gr:rn.current,pe=vl(f,pe));var sn=v.getDerivedStateFromProps;(qe=typeof sn=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(ne!==vt||We!==pe)&&$2(f,z,C,pe),Ia=!1,We=f.memoizedState,z.state=We,vf(f,C,z,k);var Zt=f.memoizedState;ne!==vt||We!==Zt||An.current||Ia?(typeof sn=="function"&&(a0(f,v,sn,C),Zt=f.memoizedState),(Ee=Ia||T2(f,v,Ee,C,We,Zt,pe)||!1)?(qe||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(C,Zt,pe),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(C,Zt,pe)),typeof z.componentDidUpdate=="function"&&(f.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof z.componentDidUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=1024),f.memoizedProps=C,f.memoizedState=Zt),z.props=C,z.state=Zt,z.context=pe,C=Ee):(typeof z.componentDidUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||ne===c.memoizedProps&&We===c.memoizedState||(f.flags|=1024),C=!1)}return S0(c,f,v,C,P,k)}function S0(c,f,v,C,k,P){xC(c,f);var z=(f.flags&128)!==0;if(!C&&!z)return k&&b2(f,v,!1),Vs(c,f,P);C=f.stateNode,q7.current=f;var ne=z&&typeof v.getDerivedStateFromError!="function"?null:C.render();return f.flags|=1,c!==null&&z?(f.child=Sl(f,c.child,null,P),f.child=Sl(f,null,ne,P)):vr(c,f,ne,P),f.memoizedState=C.state,k&&b2(f,v,!0),f.child}function yC(c){var f=c.stateNode;f.pendingContext?v2(c,f.pendingContext,f.pendingContext!==f.context):f.context&&v2(c,f.context,!1),l0(c,f.containerInfo)}function CC(c,f,v,C,k){return yl(),Jg(k),f.flags|=256,vr(c,f,v,C),f.child}var k0={dehydrated:null,treeContext:null,retryLane:0};function j0(c){return{baseLanes:c,cachePool:null,transitions:null}}function wC(c,f,v){var C=f.pendingProps,k=vn.current,P=!1,z=(f.flags&128)!==0,ne;if((ne=z)||(ne=c!==null&&c.memoizedState===null?!1:(k&2)!==0),ne?(P=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(k|=1),Ot(vn,k&1),c===null)return Zg(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?wa(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(z=C.children,c=C.fallback,P?(C=f.mode,P=f.child,z={mode:"hidden",children:z},!(C&1)&&P!==null?(P.childLanes=0,P.pendingProps=z):P=Gf(z,C,0,null),c=ki(c,C,v,null),P.return=f,c.return=f,P.sibling=c,f.child=P,f.child.memoizedState=j0(v),f.memoizedState=k0,c):_0(f,z));if(k=c.memoizedState,k!==null&&(ne=k.dehydrated,ne!==null))return X7(c,f,z,C,ne,k,v);if(P){P=C.fallback,z=f.mode,k=c.child,ne=k.sibling;var pe={mode:"hidden",children:C.children};return!(z&1)&&f.child!==k?(C=f.child,C.childLanes=0,C.pendingProps=pe,f.deletions=null):(C=Da(k,pe),C.subtreeFlags=k.subtreeFlags&14680064),ne!==null?P=Da(ne,P):(P=ki(P,z,v,null),P.flags|=2),P.return=f,C.return=f,C.sibling=P,f.child=C,C=P,P=f.child,z=c.child.memoizedState,z=z===null?j0(v):{baseLanes:z.baseLanes|v,cachePool:null,transitions:z.transitions},P.memoizedState=z,P.childLanes=c.childLanes&~v,f.memoizedState=k0,C}return P=c.child,c=P.sibling,C=Da(P,{mode:"visible",children:C.children}),!(f.mode&1)&&(C.lanes=v),C.return=f,C.sibling=null,c!==null&&(v=f.deletions,v===null?(f.deletions=[c],f.flags|=16):v.push(c)),f.child=C,f.memoizedState=null,C}function _0(c,f){return f=Gf({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function _f(c,f,v,C){return C!==null&&Jg(C),Sl(f,c.child,null,v),c=_0(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function X7(c,f,v,C,k,P,z){if(v)return f.flags&256?(f.flags&=-257,C=y0(Error(i(422))),_f(c,f,z,C)):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(P=C.fallback,k=f.mode,C=Gf({mode:"visible",children:C.children},k,0,null),P=ki(P,k,z,null),P.flags|=2,C.return=f,P.return=f,C.sibling=P,f.child=C,f.mode&1&&Sl(f,c.child,null,z),f.child.memoizedState=j0(z),f.memoizedState=k0,P);if(!(f.mode&1))return _f(c,f,z,null);if(wa(k))return C=Sa(k).digest,P=Error(i(419)),C=y0(P,C,void 0),_f(c,f,z,C);if(v=(z&c.childLanes)!==0,_r||v){if(C=qn,C!==null){switch(z&-z){case 4:k=2;break;case 16:k=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:k=32;break;case 536870912:k=268435456;break;default:k=0}k=k&(C.suspendedLanes|z)?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,is(c,k),fo(C,c,k,-1))}return G0(),C=y0(Error(i(421))),_f(c,f,z,C)}return $s(k)?(f.flags|=128,f.child=c.child,f=lR.bind(null,c),ml(k,f),null):(c=P.treeContext,Ce&&(io=Gt(k),Ur=f,cn=!0,Do=null,ru=!1,c!==null&&(so[ao++]=Fs,so[ao++]=Bs,so[ao++]=gi,Fs=c.id,Bs=c.overflow,gi=f)),f=_0(f,C.children),f.flags|=4096,f)}function SC(c,f,v){c.lanes|=f;var C=c.alternate;C!==null&&(C.lanes|=f),r0(c.return,f,v)}function I0(c,f,v,C,k){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:C,tail:v,tailMode:k}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=C,P.tail=v,P.tailMode=k)}function kC(c,f,v){var C=f.pendingProps,k=C.revealOrder,P=C.tail;if(vr(c,f,C.children,v),C=vn.current,C&2)C=C&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&SC(c,v,f);else if(c.tag===19)SC(c,v,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}C&=1}if(Ot(vn,C),!(f.mode&1))f.memoizedState=null;else switch(k){case"forwards":for(v=f.child,k=null;v!==null;)c=v.alternate,c!==null&&yf(c)===null&&(k=v),v=v.sibling;v=k,v===null?(k=f.child,f.child=null):(k=v.sibling,v.sibling=null),I0(f,!1,k,v,P);break;case"backwards":for(v=null,k=f.child,f.child=null;k!==null;){if(c=k.alternate,c!==null&&yf(c)===null){f.child=k;break}c=k.sibling,k.sibling=v,v=k,k=c}I0(f,!0,v,null,P);break;case"together":I0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function If(c,f){!(f.mode&1)&&c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2)}function Vs(c,f,v){if(c!==null&&(f.dependencies=c.dependencies),yi|=f.lanes,!(v&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(i(153));if(f.child!==null){for(c=f.child,v=Da(c,c.pendingProps),f.child=v,v.return=f;c.sibling!==null;)c=c.sibling,v=v.sibling=Da(c,c.pendingProps),v.return=f;v.sibling=null}return f.child}function Q7(c,f,v){switch(f.tag){case 3:yC(f),yl();break;case 5:B2(f);break;case 1:jr(f.type)&&rf(f);break;case 4:l0(f,f.stateNode.containerInfo);break;case 10:E2(f,f.type._context,f.memoizedProps.value);break;case 13:var C=f.memoizedState;if(C!==null)return C.dehydrated!==null?(Ot(vn,vn.current&1),f.flags|=128,null):v&f.child.childLanes?wC(c,f,v):(Ot(vn,vn.current&1),c=Vs(c,f,v),c!==null?c.sibling:null);Ot(vn,vn.current&1);break;case 19:if(C=(v&f.childLanes)!==0,c.flags&128){if(C)return kC(c,f,v);f.flags|=128}var k=f.memoizedState;if(k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Ot(vn,vn.current),C)break;return null;case 22:case 23:return f.lanes=0,vC(c,f,v)}return Vs(c,f,v)}function us(c){c.flags|=4}function jC(c,f){if(c!==null&&c.child===f.child)return!0;if(f.flags&16)return!1;for(c=f.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var du,fu,Pf,Ef;if(de)du=function(c,f){for(var v=f.child;v!==null;){if(v.tag===5||v.tag===6)se(c,v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},fu=function(){},Pf=function(c,f,v,C,k){if(c=c.memoizedProps,c!==C){var P=f.stateNode,z=ls(co.current);v=re(P,v,c,C,k,z),(f.updateQueue=v)&&us(f)}},Ef=function(c,f,v,C){v!==C&&us(f)};else if(ge){du=function(c,f,v,C){for(var k=f.child;k!==null;){if(k.tag===5){var P=k.stateNode;v&&C&&(P=kr(P,k.type,k.memoizedProps,k)),se(c,P)}else if(k.tag===6)P=k.stateNode,v&&C&&(P=Mo(P,k.memoizedProps,k)),se(c,P);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)P=k.child,P!==null&&(P.return=k),du(c,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};var _C=function(c,f,v,C){for(var k=f.child;k!==null;){if(k.tag===5){var P=k.stateNode;v&&C&&(P=kr(P,k.type,k.memoizedProps,k)),kn(c,P)}else if(k.tag===6)P=k.stateNode,v&&C&&(P=Mo(P,k.memoizedProps,k)),kn(c,P);else if(k.tag!==4){if(k.tag===22&&k.memoizedState!==null)P=k.child,P!==null&&(P.return=k),_C(c,k,!0,!0);else if(k.child!==null){k.child.return=k,k=k.child;continue}}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};fu=function(c,f){var v=f.stateNode;if(!jC(c,f)){c=v.containerInfo;var C=Ln(c);_C(C,f,!1,!1),v.pendingChildren=C,us(f),gn(c,C)}},Pf=function(c,f,v,C,k){var P=c.stateNode,z=c.memoizedProps;if((c=jC(c,f))&&z===C)f.stateNode=P;else{var ne=f.stateNode,pe=ls(co.current),Ee=null;z!==C&&(Ee=re(ne,v,z,C,k,pe)),c&&Ee===null?f.stateNode=P:(P=pr(P,Ee,v,z,C,f,c,ne),ae(P,v,C,k,pe)&&us(f),f.stateNode=P,c?us(f):du(P,f,!1,!1))}},Ef=function(c,f,v,C){v!==C?(c=ls(kl.current),v=ls(co.current),f.stateNode=K(C,c,v,f),us(f)):f.stateNode=c.stateNode}}else fu=function(){},Pf=function(){},Ef=function(){};function pu(c,f){if(!cn)switch(c.tailMode){case"hidden":f=c.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?c.tail=null:v.sibling=null;break;case"collapsed":v=c.tail;for(var C=null;v!==null;)v.alternate!==null&&(C=v),v=v.sibling;C===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:C.sibling=null}}function sr(c){var f=c.alternate!==null&&c.alternate.child===c.child,v=0,C=0;if(f)for(var k=c.child;k!==null;)v|=k.lanes|k.childLanes,C|=k.subtreeFlags&14680064,C|=k.flags&14680064,k.return=c,k=k.sibling;else for(k=c.child;k!==null;)v|=k.lanes|k.childLanes,C|=k.subtreeFlags,C|=k.flags,k.return=c,k=k.sibling;return c.subtreeFlags|=C,c.childLanes=v,f}function Y7(c,f,v){var C=f.pendingProps;switch(Qg(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sr(f),null;case 1:return jr(f.type)&&nf(),sr(f),null;case 3:return v=f.stateNode,jl(),kt(An),kt(rn),d0(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(c===null||c.child===null)&&(ff(f)?us(f):c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Do!==null&&(W0(Do),Do=null))),fu(c,f),sr(f),null;case 5:c0(f),v=ls(kl.current);var k=f.type;if(c!==null&&f.stateNode!=null)Pf(c,f,k,C,v),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!C){if(f.stateNode===null)throw Error(i(166));return sr(f),null}if(c=ls(co.current),ff(f)){if(!Ce)throw Error(i(175));c=zn(f.stateNode,f.type,f.memoizedProps,v,c,f,!ru),f.updateQueue=c,c!==null&&us(f)}else{var P=Y(k,C,v,c,f);du(P,f,!1,!1),f.stateNode=P,ae(P,k,C,v,c)&&us(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return sr(f),null;case 6:if(c&&f.stateNode!=null)Ef(c,f,c.memoizedProps,C);else{if(typeof C!="string"&&f.stateNode===null)throw Error(i(166));if(c=ls(kl.current),v=ls(co.current),ff(f)){if(!Ce)throw Error(i(176));if(c=f.stateNode,v=f.memoizedProps,(C=St(c,v,f,!ru))&&(k=Ur,k!==null))switch(k.tag){case 3:tf(k.stateNode.containerInfo,c,v,(k.mode&1)!==0);break;case 5:gl(k.type,k.memoizedProps,k.stateNode,c,v,(k.mode&1)!==0)}C&&us(f)}else f.stateNode=K(C,c,v,f)}return sr(f),null;case 13:if(kt(vn),C=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(cn&&io!==null&&f.mode&1&&!(f.flags&128))P2(),yl(),f.flags|=98560,k=!1;else if(k=ff(f),C!==null&&C.dehydrated!==null){if(c===null){if(!k)throw Error(i(318));if(!Ce)throw Error(i(344));if(k=f.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(i(317));ja(k,f)}else yl(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;sr(f),k=!1}else Do!==null&&(W0(Do),Do=null),k=!0;if(!k)return f.flags&65536?f:null}return f.flags&128?(f.lanes=v,f):(v=C!==null,v!==(c!==null&&c.memoizedState!==null)&&v&&(f.child.flags|=8192,f.mode&1&&(c===null||vn.current&1?Hn===0&&(Hn=3):G0())),f.updateQueue!==null&&(f.flags|=4),sr(f),null);case 4:return jl(),fu(c,f),c===null&&fe(f.stateNode.containerInfo),sr(f),null;case 10:return n0(f.type._context),sr(f),null;case 17:return jr(f.type)&&nf(),sr(f),null;case 19:if(kt(vn),k=f.memoizedState,k===null)return sr(f),null;if(C=(f.flags&128)!==0,P=k.rendering,P===null)if(C)pu(k,!1);else{if(Hn!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(P=yf(c),P!==null){for(f.flags|=128,pu(k,!1),c=P.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),f.subtreeFlags=0,c=v,v=f.child;v!==null;)C=v,k=c,C.flags&=14680066,P=C.alternate,P===null?(C.childLanes=0,C.lanes=k,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=P.childLanes,C.lanes=P.lanes,C.child=P.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=P.memoizedProps,C.memoizedState=P.memoizedState,C.updateQueue=P.updateQueue,C.type=P.type,k=P.dependencies,C.dependencies=k===null?null:{lanes:k.lanes,firstContext:k.firstContext}),v=v.sibling;return Ot(vn,vn.current&1|2),f.child}c=c.sibling}k.tail!==null&&Gn()>F0&&(f.flags|=128,C=!0,pu(k,!1),f.lanes=4194304)}else{if(!C)if(c=yf(P),c!==null){if(f.flags|=128,C=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),pu(k,!0),k.tail===null&&k.tailMode==="hidden"&&!P.alternate&&!cn)return sr(f),null}else 2*Gn()-k.renderingStartTime>F0&&v!==1073741824&&(f.flags|=128,C=!0,pu(k,!1),f.lanes=4194304);k.isBackwards?(P.sibling=f.child,f.child=P):(c=k.last,c!==null?c.sibling=P:f.child=P,k.last=P)}return k.tail!==null?(f=k.tail,k.rendering=f,k.tail=f.sibling,k.renderingStartTime=Gn(),f.sibling=null,c=vn.current,Ot(vn,C?c&1|2:c&1),f):(sr(f),null);case 22:case 23:return U0(),v=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==v&&(f.flags|=8192),v&&f.mode&1?Gr&1073741824&&(sr(f),de&&f.subtreeFlags&6&&(f.flags|=8192)):sr(f),null;case 24:return null;case 25:return null}throw Error(i(156,f.tag))}function Z7(c,f){switch(Qg(f),f.tag){case 1:return jr(f.type)&&nf(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return jl(),kt(An),kt(rn),d0(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return c0(f),null;case 13:if(kt(vn),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(i(340));yl()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return kt(vn),null;case 4:return jl(),null;case 10:return n0(f.type._context),null;case 22:case 23:return U0(),null;case 24:return null;default:return null}}var Mf=!1,ar=!1,J7=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function Il(c,f){var v=c.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(C){un(c,f,C)}else v.current=null}function P0(c,f,v){try{v()}catch(C){un(c,f,C)}}var IC=!1;function eR(c,f){for(F(c.containerInfo),Ke=f;Ke!==null;)if(c=Ke,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,Ke=f;else for(;Ke!==null;){c=Ke;try{var v=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var C=v.memoizedProps,k=v.memoizedState,P=c.stateNode,z=P.getSnapshotBeforeUpdate(c.elementType===c.type?C:Ao(c.type,C),k);P.__reactInternalSnapshotBeforeUpdate=z}break;case 3:de&&At(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(ne){un(c,c.return,ne)}if(f=c.sibling,f!==null){f.return=c.return,Ke=f;break}Ke=c.return}return v=IC,IC=!1,v}function mu(c,f,v){var C=f.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var k=C=C.next;do{if((k.tag&c)===c){var P=k.destroy;k.destroy=void 0,P!==void 0&&P0(f,v,P)}k=k.next}while(k!==C)}}function Of(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var v=f=f.next;do{if((v.tag&c)===c){var C=v.create;v.destroy=C()}v=v.next}while(v!==f)}}function E0(c){var f=c.ref;if(f!==null){var v=c.stateNode;switch(c.tag){case 5:c=N(v);break;default:c=v}typeof f=="function"?f(c):f.current=c}}function PC(c){var f=c.alternate;f!==null&&(c.alternate=null,PC(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&_e(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function EC(c){return c.tag===5||c.tag===3||c.tag===4}function MC(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||EC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function M0(c,f,v){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?Ut(v,c,f):Je(v,c);else if(C!==4&&(c=c.child,c!==null))for(M0(c,f,v),c=c.sibling;c!==null;)M0(c,f,v),c=c.sibling}function O0(c,f,v){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?Le(v,c,f):be(v,c);else if(C!==4&&(c=c.child,c!==null))for(O0(c,f,v),c=c.sibling;c!==null;)O0(c,f,v),c=c.sibling}var er=null,To=!1;function ds(c,f,v){for(v=v.child;v!==null;)R0(c,f,v),v=v.sibling}function R0(c,f,v){if(ss&&typeof ss.onCommitFiberUnmount=="function")try{ss.onCommitFiberUnmount(lf,v)}catch{}switch(v.tag){case 5:ar||Il(v,f);case 6:if(de){var C=er,k=To;er=null,ds(c,f,v),er=C,To=k,er!==null&&(To?Be(er,v.stateNode):ke(er,v.stateNode))}else ds(c,f,v);break;case 18:de&&er!==null&&(To?Fn(er,v.stateNode):Fg(er,v.stateNode));break;case 4:de?(C=er,k=To,er=v.stateNode.containerInfo,To=!0,ds(c,f,v),er=C,To=k):(ge&&(C=v.stateNode.containerInfo,k=Ln(C),ln(C,k)),ds(c,f,v));break;case 0:case 11:case 14:case 15:if(!ar&&(C=v.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){k=C=C.next;do{var P=k,z=P.destroy;P=P.tag,z!==void 0&&(P&2||P&4)&&P0(v,f,z),k=k.next}while(k!==C)}ds(c,f,v);break;case 1:if(!ar&&(Il(v,f),C=v.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=v.memoizedProps,C.state=v.memoizedState,C.componentWillUnmount()}catch(ne){un(v,f,ne)}ds(c,f,v);break;case 21:ds(c,f,v);break;case 22:v.mode&1?(ar=(C=ar)||v.memoizedState!==null,ds(c,f,v),ar=C):ds(c,f,v);break;default:ds(c,f,v)}}function OC(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var v=c.stateNode;v===null&&(v=c.stateNode=new J7),f.forEach(function(C){var k=cR.bind(null,c,C);v.has(C)||(v.add(C),C.then(k,k))})}}function No(c,f){var v=f.deletions;if(v!==null)for(var C=0;C<v.length;C++){var k=v[C];try{var P=c,z=f;if(de){var ne=z;e:for(;ne!==null;){switch(ne.tag){case 5:er=ne.stateNode,To=!1;break e;case 3:er=ne.stateNode.containerInfo,To=!0;break e;case 4:er=ne.stateNode.containerInfo,To=!0;break e}ne=ne.return}if(er===null)throw Error(i(160));R0(P,z,k),er=null,To=!1}else R0(P,z,k);var pe=k.alternate;pe!==null&&(pe.return=null),k.return=null}catch(Ee){un(k,f,Ee)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)RC(f,c),f=f.sibling}function RC(c,f){var v=c.alternate,C=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(No(f,c),fs(c),C&4){try{mu(3,c,c.return),Of(3,c)}catch(We){un(c,c.return,We)}try{mu(5,c,c.return)}catch(We){un(c,c.return,We)}}break;case 1:No(f,c),fs(c),C&512&&v!==null&&Il(v,v.return);break;case 5:if(No(f,c),fs(c),C&512&&v!==null&&Il(v,v.return),de){if(c.flags&32){var k=c.stateNode;try{ze(k)}catch(We){un(c,c.return,We)}}if(C&4&&(k=c.stateNode,k!=null)){var P=c.memoizedProps;if(v=v!==null?v.memoizedProps:P,C=c.type,f=c.updateQueue,c.updateQueue=null,f!==null)try{Me(k,f,C,v,P,c)}catch(We){un(c,c.return,We)}}}break;case 6:if(No(f,c),fs(c),C&4&&de){if(c.stateNode===null)throw Error(i(162));k=c.stateNode,P=c.memoizedProps,v=v!==null?v.memoizedProps:P;try{lt(k,v,P)}catch(We){un(c,c.return,We)}}break;case 3:if(No(f,c),fs(c),C&4){if(de&&Ce&&v!==null&&v.memoizedState.isDehydrated)try{ef(f.containerInfo)}catch(We){un(c,c.return,We)}if(ge){k=f.containerInfo,P=f.pendingChildren;try{ln(k,P)}catch(We){un(c,c.return,We)}}}break;case 4:if(No(f,c),fs(c),C&4&&ge){P=c.stateNode,k=P.containerInfo,P=P.pendingChildren;try{ln(k,P)}catch(We){un(c,c.return,We)}}break;case 13:No(f,c),fs(c),k=c.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(z0=Gn())),C&4&&OC(c);break;case 22:var z=v!==null&&v.memoizedState!==null;if(c.mode&1?(ar=(v=ar)||z,No(f,c),ar=v):No(f,c),fs(c),C&8192){if(v=c.memoizedState!==null,(c.stateNode.isHidden=v)&&!z&&c.mode&1)for(Ke=c,C=c.child;C!==null;){for(f=Ke=C;Ke!==null;){z=Ke;var ne=z.child;switch(z.tag){case 0:case 11:case 14:case 15:mu(4,z,z.return);break;case 1:Il(z,z.return);var pe=z.stateNode;if(typeof pe.componentWillUnmount=="function"){var Ee=z,qe=z.return;try{var vt=Ee;pe.props=vt.memoizedProps,pe.state=vt.memoizedState,pe.componentWillUnmount()}catch(We){un(Ee,qe,We)}}break;case 5:Il(z,z.return);break;case 22:if(z.memoizedState!==null){TC(f);continue}}ne!==null?(ne.return=z,Ke=ne):TC(f)}C=C.sibling}if(de){e:if(C=null,de)for(f=c;;){if(f.tag===5){if(C===null){C=f;try{k=f.stateNode,v?Ge(k):En(f.stateNode,f.memoizedProps)}catch(We){un(c,c.return,We)}}}else if(f.tag===6){if(C===null)try{P=f.stateNode,v?pt(P):Dt(P,f.memoizedProps)}catch(We){un(c,c.return,We)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===c)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break e;for(;f.sibling===null;){if(f.return===null||f.return===c)break e;C===f&&(C=null),f=f.return}C===f&&(C=null),f.sibling.return=f.return,f=f.sibling}}}break;case 19:No(f,c),fs(c),C&4&&OC(c);break;case 21:break;default:No(f,c),fs(c)}}function fs(c){var f=c.flags;if(f&2){try{if(de){e:{for(var v=c.return;v!==null;){if(EC(v)){var C=v;break e}v=v.return}throw Error(i(160))}switch(C.tag){case 5:var k=C.stateNode;C.flags&32&&(ze(k),C.flags&=-33);var P=MC(c);O0(c,P,k);break;case 3:case 4:var z=C.stateNode.containerInfo,ne=MC(c);M0(c,ne,z);break;default:throw Error(i(161))}}}catch(pe){un(c,c.return,pe)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function tR(c,f,v){Ke=c,DC(c)}function DC(c,f,v){for(var C=(c.mode&1)!==0;Ke!==null;){var k=Ke,P=k.child;if(k.tag===22&&C){var z=k.memoizedState!==null||Mf;if(!z){var ne=k.alternate,pe=ne!==null&&ne.memoizedState!==null||ar;ne=Mf;var Ee=ar;if(Mf=z,(ar=pe)&&!Ee)for(Ke=k;Ke!==null;)z=Ke,pe=z.child,z.tag===22&&z.memoizedState!==null?NC(k):pe!==null?(pe.return=z,Ke=pe):NC(k);for(;P!==null;)Ke=P,DC(P),P=P.sibling;Ke=k,Mf=ne,ar=Ee}AC(c)}else k.subtreeFlags&8772&&P!==null?(P.return=k,Ke=P):AC(c)}}function AC(c){for(;Ke!==null;){var f=Ke;if(f.flags&8772){var v=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:ar||Of(5,f);break;case 1:var C=f.stateNode;if(f.flags&4&&!ar)if(v===null)C.componentDidMount();else{var k=f.elementType===f.type?v.memoizedProps:Ao(f.type,v.memoizedProps);C.componentDidUpdate(k,v.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&D2(f,P,C);break;case 3:var z=f.updateQueue;if(z!==null){if(v=null,f.child!==null)switch(f.child.tag){case 5:v=N(f.child.stateNode);break;case 1:v=f.child.stateNode}D2(f,z,v)}break;case 5:var ne=f.stateNode;v===null&&f.flags&4&&ft(ne,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(Ce&&f.memoizedState===null){var pe=f.alternate;if(pe!==null){var Ee=pe.memoizedState;if(Ee!==null){var qe=Ee.dehydrated;qe!==null&&zg(qe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}ar||f.flags&512&&E0(f)}catch(vt){un(f,f.return,vt)}}if(f===c){Ke=null;break}if(v=f.sibling,v!==null){v.return=f.return,Ke=v;break}Ke=f.return}}function TC(c){for(;Ke!==null;){var f=Ke;if(f===c){Ke=null;break}var v=f.sibling;if(v!==null){v.return=f.return,Ke=v;break}Ke=f.return}}function NC(c){for(;Ke!==null;){var f=Ke;try{switch(f.tag){case 0:case 11:case 15:var v=f.return;try{Of(4,f)}catch(pe){un(f,v,pe)}break;case 1:var C=f.stateNode;if(typeof C.componentDidMount=="function"){var k=f.return;try{C.componentDidMount()}catch(pe){un(f,k,pe)}}var P=f.return;try{E0(f)}catch(pe){un(f,P,pe)}break;case 5:var z=f.return;try{E0(f)}catch(pe){un(f,z,pe)}}}catch(pe){un(f,f.return,pe)}if(f===c){Ke=null;break}var ne=f.sibling;if(ne!==null){ne.return=f.return,Ke=ne;break}Ke=f.return}}var Rf=0,Df=1,Af=2,Tf=3,Nf=4;if(typeof Symbol=="function"&&Symbol.for){var hu=Symbol.for;Rf=hu("selector.component"),Df=hu("selector.has_pseudo_class"),Af=hu("selector.role"),Tf=hu("selector.test_id"),Nf=hu("selector.text")}function D0(c){var f=he(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(i(364));return f}if(c=Pt(c),c===null)throw Error(i(362));return c.stateNode.current}function A0(c,f){switch(f.$$typeof){case Rf:if(c.type===f.value)return!0;break;case Df:e:{f=f.value,c=[c,0];for(var v=0;v<c.length;){var C=c[v++],k=c[v++],P=f[k];if(C.tag!==5||!ye(C)){for(;P!=null&&A0(C,P);)k++,P=f[k];if(k===f.length){f=!0;break e}else for(C=C.child;C!==null;)c.push(C,k),C=C.sibling}}f=!1}return f;case Af:if(c.tag===5&&De(c.stateNode,f.value))return!0;break;case Nf:if((c.tag===5||c.tag===6)&&(c=ot(c),c!==null&&0<=c.indexOf(f.value)))return!0;break;case Tf:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function T0(c){switch(c.$$typeof){case Rf:return"<"+(R(c.value)||"Unknown")+">";case Df:return":has("+(T0(c)||"")+")";case Af:return'[role="'+c.value+'"]';case Nf:return'"'+c.value+'"';case Tf:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function $C(c,f){var v=[];c=[c,0];for(var C=0;C<c.length;){var k=c[C++],P=c[C++],z=f[P];if(k.tag!==5||!ye(k)){for(;z!=null&&A0(k,z);)P++,z=f[P];if(P===f.length)v.push(k);else for(k=k.child;k!==null;)c.push(k,P),k=k.sibling}}return v}function N0(c,f){if(!$e)throw Error(i(363));c=D0(c),c=$C(c,f),f=[],c=Array.from(c);for(var v=0;v<c.length;){var C=c[v++];if(C.tag===5)ye(C)||f.push(C.stateNode);else for(C=C.child;C!==null;)c.push(C),C=C.sibling}return f}var nR=Math.ceil,$f=l.ReactCurrentDispatcher,$0=l.ReactCurrentOwner,Mn=l.ReactCurrentBatchConfig,jt=0,qn=null,Tn=null,tr=0,Gr=0,Pl=Mt(0),Hn=0,gu=null,yi=0,Lf=0,L0=0,vu=null,Ir=null,z0=0,F0=1/0,Ws=null;function El(){F0=Gn()+500}var zf=!1,B0=null,Ea=null,Ff=!1,Ma=null,Bf=0,xu=0,H0=null,Hf=-1,Vf=0;function ir(){return jt&6?Gn():Hf!==-1?Hf:Hf=Gn()}function Oa(c){return c.mode&1?jt&2&&tr!==0?tr&-tr:L7.transition!==null?(Vf===0&&(Vf=y2()),Vf):(c=Nt,c!==0?c:Oe()):1}function fo(c,f,v,C){if(50<xu)throw xu=0,H0=null,Error(i(185));nu(c,v,C),(!(jt&2)||c!==qn)&&(c===qn&&(!(jt&2)&&(Lf|=v),Hn===4&&Ra(c,tr)),Pr(c,C),v===1&&jt===0&&!(f.mode&1)&&(El(),cf&&as()))}function Pr(c,f){var v=c.callbackNode;E7(c,f);var C=af(c,c===qn?tr:0);if(C===0)v!==null&&w2(v),c.callbackNode=null,c.callbackPriority=0;else if(f=C&-C,c.callbackPriority!==f){if(v!=null&&w2(v),f===1)c.tag===0?$7(zC.bind(null,c)):S2(zC.bind(null,c)),Ne?nt(function(){!(jt&6)&&as()}):Ug(Gg,as),v=null;else{switch(C2(C)){case 1:v=Gg;break;case 4:v=D7;break;case 16:v=Kg;break;case 536870912:v=A7;break;default:v=Kg}v=qC(v,LC.bind(null,c))}c.callbackPriority=f,c.callbackNode=v}}function LC(c,f){if(Hf=-1,Vf=0,jt&6)throw Error(i(327));var v=c.callbackNode;if(Si()&&c.callbackNode!==v)return null;var C=af(c,c===qn?tr:0);if(C===0)return null;if(C&30||C&c.expiredLanes||f)f=Wf(c,C);else{f=C;var k=jt;jt|=2;var P=HC();(qn!==c||tr!==f)&&(Ws=null,El(),Ci(c,f));do try{sR();break}catch(ne){BC(c,ne)}while(1);t0(),$f.current=P,jt=k,Tn!==null?f=0:(qn=null,tr=0,f=Hn)}if(f!==0){if(f===2&&(k=Hg(c),k!==0&&(C=k,f=V0(c,k))),f===1)throw v=gu,Ci(c,0),Ra(c,C),Pr(c,Gn()),v;if(f===6)Ra(c,C);else{if(k=c.current.alternate,!(C&30)&&!rR(k)&&(f=Wf(c,C),f===2&&(P=Hg(c),P!==0&&(C=P,f=V0(c,P))),f===1))throw v=gu,Ci(c,0),Ra(c,C),Pr(c,Gn()),v;switch(c.finishedWork=k,c.finishedLanes=C,f){case 0:case 1:throw Error(i(345));case 2:wi(c,Ir,Ws);break;case 3:if(Ra(c,C),(C&130023424)===C&&(f=z0+500-Gn(),10<f)){if(af(c,0)!==0)break;if(k=c.suspendedLanes,(k&C)!==C){ir(),c.pingedLanes|=c.suspendedLanes&k;break}c.timeoutHandle=ee(wi.bind(null,c,Ir,Ws),f);break}wi(c,Ir,Ws);break;case 4:if(Ra(c,C),(C&4194240)===C)break;for(f=c.eventTimes,k=-1;0<C;){var z=31-Oo(C);P=1<<z,z=f[z],z>k&&(k=z),C&=~P}if(C=k,C=Gn()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*nR(C/1960))-C,10<C){c.timeoutHandle=ee(wi.bind(null,c,Ir,Ws),C);break}wi(c,Ir,Ws);break;case 5:wi(c,Ir,Ws);break;default:throw Error(i(329))}}}return Pr(c,Gn()),c.callbackNode===v?LC.bind(null,c):null}function V0(c,f){var v=vu;return c.current.memoizedState.isDehydrated&&(Ci(c,f).flags|=256),c=Wf(c,f),c!==2&&(f=Ir,Ir=v,f!==null&&W0(f)),c}function W0(c){Ir===null?Ir=c:Ir.push.apply(Ir,c)}function rR(c){for(var f=c;;){if(f.flags&16384){var v=f.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var C=0;C<v.length;C++){var k=v[C],P=k.getSnapshot;k=k.value;try{if(!Ro(P(),k))return!1}catch{return!1}}}if(v=f.child,f.subtreeFlags&16384&&v!==null)v.return=f,f=v;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Ra(c,f){for(f&=~L0,f&=~Lf,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var v=31-Oo(f),C=1<<v;c[v]=-1,f&=~C}}function zC(c){if(jt&6)throw Error(i(327));Si();var f=af(c,0);if(!(f&1))return Pr(c,Gn()),null;var v=Wf(c,f);if(c.tag!==0&&v===2){var C=Hg(c);C!==0&&(f=C,v=V0(c,C))}if(v===1)throw v=gu,Ci(c,0),Ra(c,f),Pr(c,Gn()),v;if(v===6)throw Error(i(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,wi(c,Ir,Ws),Pr(c,Gn()),null}function FC(c){Ma!==null&&Ma.tag===0&&!(jt&6)&&Si();var f=jt;jt|=1;var v=Mn.transition,C=Nt;try{if(Mn.transition=null,Nt=1,c)return c()}finally{Nt=C,Mn.transition=v,jt=f,!(jt&6)&&as()}}function U0(){Gr=Pl.current,kt(Pl)}function Ci(c,f){c.finishedWork=null,c.finishedLanes=0;var v=c.timeoutHandle;if(v!==J&&(c.timeoutHandle=J,ce(v)),Tn!==null)for(v=Tn.return;v!==null;){var C=v;switch(Qg(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&nf();break;case 3:jl(),kt(An),kt(rn),d0();break;case 5:c0(C);break;case 4:jl();break;case 13:kt(vn);break;case 19:kt(vn);break;case 10:n0(C.type._context);break;case 22:case 23:U0()}v=v.return}if(qn=c,Tn=c=Da(c.current,null),tr=Gr=f,Hn=0,gu=null,L0=Lf=yi=0,Ir=vu=null,xi!==null){for(f=0;f<xi.length;f++)if(v=xi[f],C=v.interleaved,C!==null){v.interleaved=null;var k=C.next,P=v.pending;if(P!==null){var z=P.next;P.next=k,C.next=z}v.pending=C}xi=null}return c}function BC(c,f){do{var v=Tn;try{if(t0(),Cf.current=jf,wf){for(var C=xn.memoizedState;C!==null;){var k=C.queue;k!==null&&(k.pending=null),C=C.next}wf=!1}if(bi=0,Kn=Bn=xn=null,iu=!1,lu=0,$0.current=null,v===null||v.return===null){Hn=1,gu=f,Tn=null;break}e:{var P=c,z=v.return,ne=v,pe=f;if(f=tr,ne.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Ee=pe,qe=ne,vt=qe.tag;if(!(qe.mode&1)&&(vt===0||vt===11||vt===15)){var We=qe.alternate;We?(qe.updateQueue=We.updateQueue,qe.memoizedState=We.memoizedState,qe.lanes=We.lanes):(qe.updateQueue=null,qe.memoizedState=null)}var sn=fC(z);if(sn!==null){sn.flags&=-257,pC(sn,z,ne,P,f),sn.mode&1&&dC(P,Ee,f),f=sn,pe=Ee;var Zt=f.updateQueue;if(Zt===null){var Er=new Set;Er.add(pe),f.updateQueue=Er}else Zt.add(pe);break e}else{if(!(f&1)){dC(P,Ee,f),G0();break e}pe=Error(i(426))}}else if(cn&&ne.mode&1){var Us=fC(z);if(Us!==null){!(Us.flags&65536)&&(Us.flags|=256),pC(Us,z,ne,P,f),Jg(_l(pe,ne));break e}}P=pe=_l(pe,ne),Hn!==4&&(Hn=2),vu===null?vu=[P]:vu.push(P),P=z;do{switch(P.tag){case 3:P.flags|=65536,f&=-f,P.lanes|=f;var ue=cC(P,pe,f);R2(P,ue);break e;case 1:ne=pe;var oe=P.type,me=P.stateNode;if(!(P.flags&128)&&(typeof oe.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(Ea===null||!Ea.has(me)))){P.flags|=65536,f&=-f,P.lanes|=f;var Ue=uC(P,ne,f);R2(P,Ue);break e}}P=P.return}while(P!==null)}WC(v)}catch(it){f=it,Tn===v&&v!==null&&(Tn=v=v.return);continue}break}while(1)}function HC(){var c=$f.current;return $f.current=jf,c===null?jf:c}function G0(){(Hn===0||Hn===3||Hn===2)&&(Hn=4),qn===null||!(yi&268435455)&&!(Lf&268435455)||Ra(qn,tr)}function Wf(c,f){var v=jt;jt|=2;var C=HC();(qn!==c||tr!==f)&&(Ws=null,Ci(c,f));do try{oR();break}catch(k){BC(c,k)}while(1);if(t0(),jt=v,$f.current=C,Tn!==null)throw Error(i(261));return qn=null,tr=0,Hn}function oR(){for(;Tn!==null;)VC(Tn)}function sR(){for(;Tn!==null&&!O7();)VC(Tn)}function VC(c){var f=KC(c.alternate,c,Gr);c.memoizedProps=c.pendingProps,f===null?WC(c):Tn=f,$0.current=null}function WC(c){var f=c;do{var v=f.alternate;if(c=f.return,f.flags&32768){if(v=Z7(v,f),v!==null){v.flags&=32767,Tn=v;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Hn=6,Tn=null;return}}else if(v=Y7(v,f,Gr),v!==null){Tn=v;return}if(f=f.sibling,f!==null){Tn=f;return}Tn=f=c}while(f!==null);Hn===0&&(Hn=5)}function wi(c,f,v){var C=Nt,k=Mn.transition;try{Mn.transition=null,Nt=1,aR(c,f,v,C)}finally{Mn.transition=k,Nt=C}return null}function aR(c,f,v,C){do Si();while(Ma!==null);if(jt&6)throw Error(i(327));v=c.finishedWork;var k=c.finishedLanes;if(v===null)return null;if(c.finishedWork=null,c.finishedLanes=0,v===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0;var P=v.lanes|v.childLanes;if(M7(c,P),c===qn&&(Tn=qn=null,tr=0),!(v.subtreeFlags&2064)&&!(v.flags&2064)||Ff||(Ff=!0,qC(Kg,function(){return Si(),null})),P=(v.flags&15990)!==0,v.subtreeFlags&15990||P){P=Mn.transition,Mn.transition=null;var z=Nt;Nt=1;var ne=jt;jt|=4,$0.current=null,eR(c,v),RC(v,c),Q(c.containerInfo),c.current=v,tR(v),R7(),jt=ne,Nt=z,Mn.transition=P}else c.current=v;if(Ff&&(Ff=!1,Ma=c,Bf=k),P=c.pendingLanes,P===0&&(Ea=null),T7(v.stateNode),Pr(c,Gn()),f!==null)for(C=c.onRecoverableError,v=0;v<f.length;v++)k=f[v],C(k.value,{componentStack:k.stack,digest:k.digest});if(zf)throw zf=!1,c=B0,B0=null,c;return Bf&1&&c.tag!==0&&Si(),P=c.pendingLanes,P&1?c===H0?xu++:(xu=0,H0=c):xu=0,as(),null}function Si(){if(Ma!==null){var c=C2(Bf),f=Mn.transition,v=Nt;try{if(Mn.transition=null,Nt=16>c?16:c,Ma===null)var C=!1;else{if(c=Ma,Ma=null,Bf=0,jt&6)throw Error(i(331));var k=jt;for(jt|=4,Ke=c.current;Ke!==null;){var P=Ke,z=P.child;if(Ke.flags&16){var ne=P.deletions;if(ne!==null){for(var pe=0;pe<ne.length;pe++){var Ee=ne[pe];for(Ke=Ee;Ke!==null;){var qe=Ke;switch(qe.tag){case 0:case 11:case 15:mu(8,qe,P)}var vt=qe.child;if(vt!==null)vt.return=qe,Ke=vt;else for(;Ke!==null;){qe=Ke;var We=qe.sibling,sn=qe.return;if(PC(qe),qe===Ee){Ke=null;break}if(We!==null){We.return=sn,Ke=We;break}Ke=sn}}}var Zt=P.alternate;if(Zt!==null){var Er=Zt.child;if(Er!==null){Zt.child=null;do{var Us=Er.sibling;Er.sibling=null,Er=Us}while(Er!==null)}}Ke=P}}if(P.subtreeFlags&2064&&z!==null)z.return=P,Ke=z;else e:for(;Ke!==null;){if(P=Ke,P.flags&2048)switch(P.tag){case 0:case 11:case 15:mu(9,P,P.return)}var ue=P.sibling;if(ue!==null){ue.return=P.return,Ke=ue;break e}Ke=P.return}}var oe=c.current;for(Ke=oe;Ke!==null;){z=Ke;var me=z.child;if(z.subtreeFlags&2064&&me!==null)me.return=z,Ke=me;else e:for(z=oe;Ke!==null;){if(ne=Ke,ne.flags&2048)try{switch(ne.tag){case 0:case 11:case 15:Of(9,ne)}}catch(it){un(ne,ne.return,it)}if(ne===z){Ke=null;break e}var Ue=ne.sibling;if(Ue!==null){Ue.return=ne.return,Ke=Ue;break e}Ke=ne.return}}if(jt=k,as(),ss&&typeof ss.onPostCommitFiberRoot=="function")try{ss.onPostCommitFiberRoot(lf,c)}catch{}C=!0}return C}finally{Nt=v,Mn.transition=f}}return!1}function UC(c,f,v){f=_l(v,f),f=cC(c,f,1),c=Pa(c,f,1),f=ir(),c!==null&&(nu(c,1,f),Pr(c,f))}function un(c,f,v){if(c.tag===3)UC(c,c,v);else for(;f!==null;){if(f.tag===3){UC(f,c,v);break}else if(f.tag===1){var C=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(Ea===null||!Ea.has(C))){c=_l(v,c),c=uC(f,c,1),f=Pa(f,c,1),c=ir(),f!==null&&(nu(f,1,c),Pr(f,c));break}}f=f.return}}function iR(c,f,v){var C=c.pingCache;C!==null&&C.delete(f),f=ir(),c.pingedLanes|=c.suspendedLanes&v,qn===c&&(tr&v)===v&&(Hn===4||Hn===3&&(tr&130023424)===tr&&500>Gn()-z0?Ci(c,0):L0|=v),Pr(c,f)}function GC(c,f){f===0&&(c.mode&1?(f=sf,sf<<=1,!(sf&130023424)&&(sf=4194304)):f=1);var v=ir();c=is(c,f),c!==null&&(nu(c,f,v),Pr(c,v))}function lR(c){var f=c.memoizedState,v=0;f!==null&&(v=f.retryLane),GC(c,v)}function cR(c,f){var v=0;switch(c.tag){case 13:var C=c.stateNode,k=c.memoizedState;k!==null&&(v=k.retryLane);break;case 19:C=c.stateNode;break;default:throw Error(i(314))}C!==null&&C.delete(f),GC(c,v)}var KC;KC=function(c,f,v){if(c!==null)if(c.memoizedProps!==f.pendingProps||An.current)_r=!0;else{if(!(c.lanes&v)&&!(f.flags&128))return _r=!1,Q7(c,f,v);_r=!!(c.flags&131072)}else _r=!1,cn&&f.flags&1048576&&k2(f,df,f.index);switch(f.lanes=0,f.tag){case 2:var C=f.type;If(c,f),c=f.pendingProps;var k=vl(f,rn.current);wl(f,v),k=m0(null,f,C,c,k,v);var P=h0();return f.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,jr(C)?(P=!0,rf(f)):P=!1,f.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,s0(f),k.updater=xf,f.stateNode=k,k._reactInternals=f,i0(f,C,c,v),f=S0(null,f,C,!0,P,v)):(f.tag=0,cn&&P&&Xg(f),vr(null,f,k,v),f=f.child),f;case 16:C=f.elementType;e:{switch(If(c,f),c=f.pendingProps,k=C._init,C=k(C._payload),f.type=C,k=f.tag=dR(C),c=Ao(C,c),k){case 0:f=w0(null,f,C,c,v);break e;case 1:f=bC(null,f,C,c,v);break e;case 11:f=mC(null,f,C,c,v);break e;case 14:f=hC(null,f,C,Ao(C.type,c),v);break e}throw Error(i(306,C,""))}return f;case 0:return C=f.type,k=f.pendingProps,k=f.elementType===C?k:Ao(C,k),w0(c,f,C,k,v);case 1:return C=f.type,k=f.pendingProps,k=f.elementType===C?k:Ao(C,k),bC(c,f,C,k,v);case 3:e:{if(yC(f),c===null)throw Error(i(387));C=f.pendingProps,P=f.memoizedState,k=P.element,O2(c,f),vf(f,C,null,v);var z=f.memoizedState;if(C=z.element,Ce&&P.isDehydrated)if(P={element:C,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){k=_l(Error(i(423)),f),f=CC(c,f,C,v,k);break e}else if(C!==k){k=_l(Error(i(424)),f),f=CC(c,f,C,v,k);break e}else for(Ce&&(io=Qe(f.stateNode.containerInfo),Ur=f,cn=!0,Do=null,ru=!1),v=F2(f,null,C,v),f.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(yl(),C===k){f=Vs(c,f,v);break e}vr(c,f,C,v)}f=f.child}return f;case 5:return B2(f),c===null&&Zg(f),C=f.type,k=f.pendingProps,P=c!==null?c.memoizedProps:null,z=k.children,G(C,k)?z=null:P!==null&&G(C,P)&&(f.flags|=32),xC(c,f),vr(c,f,z,v),f.child;case 6:return c===null&&Zg(f),null;case 13:return wC(c,f,v);case 4:return l0(f,f.stateNode.containerInfo),C=f.pendingProps,c===null?f.child=Sl(f,null,C,v):vr(c,f,C,v),f.child;case 11:return C=f.type,k=f.pendingProps,k=f.elementType===C?k:Ao(C,k),mC(c,f,C,k,v);case 7:return vr(c,f,f.pendingProps,v),f.child;case 8:return vr(c,f,f.pendingProps.children,v),f.child;case 12:return vr(c,f,f.pendingProps.children,v),f.child;case 10:e:{if(C=f.type._context,k=f.pendingProps,P=f.memoizedProps,z=k.value,E2(f,C,z),P!==null)if(Ro(P.value,z)){if(P.children===k.children&&!An.current){f=Vs(c,f,v);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var ne=P.dependencies;if(ne!==null){z=P.child;for(var pe=ne.firstContext;pe!==null;){if(pe.context===C){if(P.tag===1){pe=Hs(-1,v&-v),pe.tag=2;var Ee=P.updateQueue;if(Ee!==null){Ee=Ee.shared;var qe=Ee.pending;qe===null?pe.next=pe:(pe.next=qe.next,qe.next=pe),Ee.pending=pe}}P.lanes|=v,pe=P.alternate,pe!==null&&(pe.lanes|=v),r0(P.return,v,f),ne.lanes|=v;break}pe=pe.next}}else if(P.tag===10)z=P.type===f.type?null:P.child;else if(P.tag===18){if(z=P.return,z===null)throw Error(i(341));z.lanes|=v,ne=z.alternate,ne!==null&&(ne.lanes|=v),r0(z,v,f),z=P.sibling}else z=P.child;if(z!==null)z.return=P;else for(z=P;z!==null;){if(z===f){z=null;break}if(P=z.sibling,P!==null){P.return=z.return,z=P;break}z=z.return}P=z}vr(c,f,k.children,v),f=f.child}return f;case 9:return k=f.type,C=f.pendingProps.children,wl(f,v),k=lo(k),C=C(k),f.flags|=1,vr(c,f,C,v),f.child;case 14:return C=f.type,k=Ao(C,f.pendingProps),k=Ao(C.type,k),hC(c,f,C,k,v);case 15:return gC(c,f,f.type,f.pendingProps,v);case 17:return C=f.type,k=f.pendingProps,k=f.elementType===C?k:Ao(C,k),If(c,f),f.tag=1,jr(C)?(c=!0,rf(f)):c=!1,wl(f,v),N2(f,C,k),i0(f,C,k,v),S0(null,f,C,!0,c,v);case 19:return kC(c,f,v);case 22:return vC(c,f,v)}throw Error(i(156,f.tag))};function qC(c,f){return Ug(c,f)}function uR(c,f,v,C){this.tag=c,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function po(c,f,v,C){return new uR(c,f,v,C)}function K0(c){return c=c.prototype,!(!c||!c.isReactComponent)}function dR(c){if(typeof c=="function")return K0(c)?1:0;if(c!=null){if(c=c.$$typeof,c===b)return 11;if(c===j)return 14}return 2}function Da(c,f){var v=c.alternate;return v===null?(v=po(c.tag,f,c.key,c.mode),v.elementType=c.elementType,v.type=c.type,v.stateNode=c.stateNode,v.alternate=c,c.alternate=v):(v.pendingProps=f,v.type=c.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=c.flags&14680064,v.childLanes=c.childLanes,v.lanes=c.lanes,v.child=c.child,v.memoizedProps=c.memoizedProps,v.memoizedState=c.memoizedState,v.updateQueue=c.updateQueue,f=c.dependencies,v.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},v.sibling=c.sibling,v.index=c.index,v.ref=c.ref,v}function Uf(c,f,v,C,k,P){var z=2;if(C=c,typeof c=="function")K0(c)&&(z=1);else if(typeof c=="string")z=5;else e:switch(c){case m:return ki(v.children,k,P,f);case h:z=8,k|=8;break;case g:return c=po(12,v,f,k|2),c.elementType=g,c.lanes=P,c;case w:return c=po(13,v,f,k),c.elementType=w,c.lanes=P,c;case S:return c=po(19,v,f,k),c.elementType=S,c.lanes=P,c;case E:return Gf(v,k,P,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case x:z=10;break e;case y:z=9;break e;case b:z=11;break e;case j:z=14;break e;case _:z=16,C=null;break e}throw Error(i(130,c==null?c:typeof c,""))}return f=po(z,v,f,k),f.elementType=c,f.type=C,f.lanes=P,f}function ki(c,f,v,C){return c=po(7,c,C,f),c.lanes=v,c}function Gf(c,f,v,C){return c=po(22,c,C,f),c.elementType=E,c.lanes=v,c.stateNode={isHidden:!1},c}function q0(c,f,v){return c=po(6,c,null,f),c.lanes=v,c}function X0(c,f,v){return f=po(4,c.children!==null?c.children:[],c.key,f),f.lanes=v,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function fR(c,f,v,C,k){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=J,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vg(0),this.expirationTimes=Vg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vg(0),this.identifierPrefix=C,this.onRecoverableError=k,Ce&&(this.mutableSourceEagerHydrationData=null)}function XC(c,f,v,C,k,P,z,ne,pe){return c=new fR(c,f,v,ne,pe),f===1?(f=1,P===!0&&(f|=8)):f=0,P=po(3,null,null,f),c.current=P,P.stateNode=c,P.memoizedState={element:C,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},s0(P),c}function QC(c){if(!c)return rr;c=c._reactInternals;e:{if(A(c)!==c||c.tag!==1)throw Error(i(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(jr(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(i(171))}if(c.tag===1){var v=c.type;if(jr(v))return x2(c,v,f)}return f}function YC(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=X(f),c===null?null:c.stateNode}function ZC(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v<f?v:f}}function Kf(c,f){ZC(c,f),(c=c.alternate)&&ZC(c,f)}function pR(c){return c=X(c),c===null?null:c.stateNode}function mR(){return null}return n.attemptContinuousHydration=function(c){if(c.tag===13){var f=is(c,134217728);if(f!==null){var v=ir();fo(f,c,134217728,v)}Kf(c,134217728)}},n.attemptDiscreteHydration=function(c){if(c.tag===13){var f=is(c,1);if(f!==null){var v=ir();fo(f,c,1,v)}Kf(c,1)}},n.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var f=Oa(c),v=is(c,f);if(v!==null){var C=ir();fo(v,c,f,C)}Kf(c,f)}},n.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var v=tu(f.pendingLanes);v!==0&&(Wg(f,v|1),Pr(f,Gn()),!(jt&6)&&(El(),as()))}break;case 13:FC(function(){var C=is(c,1);if(C!==null){var k=ir();fo(C,c,1,k)}}),Kf(c,1)}},n.batchedUpdates=function(c,f){var v=jt;jt|=1;try{return c(f)}finally{jt=v,jt===0&&(El(),cf&&as())}},n.createComponentSelector=function(c){return{$$typeof:Rf,value:c}},n.createContainer=function(c,f,v,C,k,P,z){return XC(c,f,!1,null,v,C,k,P,z)},n.createHasPseudoClassSelector=function(c){return{$$typeof:Df,value:c}},n.createHydrationContainer=function(c,f,v,C,k,P,z,ne,pe){return c=XC(v,C,!0,c,k,P,z,ne,pe),c.context=QC(null),v=c.current,C=ir(),k=Oa(v),P=Hs(C,k),P.callback=f??null,Pa(v,P,k),c.current.lanes=k,nu(c,k,C),Pr(c,C),c},n.createPortal=function(c,f,v){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:C==null?null:""+C,children:c,containerInfo:f,implementation:v}},n.createRoleSelector=function(c){return{$$typeof:Af,value:c}},n.createTestNameSelector=function(c){return{$$typeof:Tf,value:c}},n.createTextSelector=function(c){return{$$typeof:Nf,value:c}},n.deferredUpdates=function(c){var f=Nt,v=Mn.transition;try{return Mn.transition=null,Nt=16,c()}finally{Nt=f,Mn.transition=v}},n.discreteUpdates=function(c,f,v,C,k){var P=Nt,z=Mn.transition;try{return Mn.transition=null,Nt=1,c(f,v,C,k)}finally{Nt=P,Mn.transition=z,jt===0&&El()}},n.findAllNodes=N0,n.findBoundingRects=function(c,f){if(!$e)throw Error(i(363));f=N0(c,f),c=[];for(var v=0;v<f.length;v++)c.push(Ze(f[v]));for(f=c.length-1;0<f;f--){v=c[f];for(var C=v.x,k=C+v.width,P=v.y,z=P+v.height,ne=f-1;0<=ne;ne--)if(f!==ne){var pe=c[ne],Ee=pe.x,qe=Ee+pe.width,vt=pe.y,We=vt+pe.height;if(C>=Ee&&P>=vt&&k<=qe&&z<=We){c.splice(f,1);break}else if(C!==Ee||v.width!==pe.width||We<P||vt>z){if(!(P!==vt||v.height!==pe.height||qe<C||Ee>k)){Ee>C&&(pe.width+=Ee-C,pe.x=C),qe<k&&(pe.width=k-Ee),c.splice(f,1);break}}else{vt>P&&(pe.height+=vt-P,pe.y=P),We<z&&(pe.height=z-vt),c.splice(f,1);break}}}return c},n.findHostInstance=YC,n.findHostInstanceWithNoPortals=function(c){return c=T(c),c=c!==null?V(c):null,c===null?null:c.stateNode},n.findHostInstanceWithWarning=function(c){return YC(c)},n.flushControlled=function(c){var f=jt;jt|=1;var v=Mn.transition,C=Nt;try{Mn.transition=null,Nt=1,c()}finally{Nt=C,Mn.transition=v,jt=f,jt===0&&(El(),as())}},n.flushPassiveEffects=Si,n.flushSync=FC,n.focusWithin=function(c,f){if(!$e)throw Error(i(363));for(c=D0(c),f=$C(c,f),f=Array.from(f),c=0;c<f.length;){var v=f[c++];if(!ye(v)){if(v.tag===5&&ut(v.stateNode))return!0;for(v=v.child;v!==null;)f.push(v),v=v.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Nt},n.getFindAllNodesFailureDescription=function(c,f){if(!$e)throw Error(i(363));var v=0,C=[];c=[D0(c),0];for(var k=0;k<c.length;){var P=c[k++],z=c[k++],ne=f[z];if((P.tag!==5||!ye(P))&&(A0(P,ne)&&(C.push(T0(ne)),z++,z>v&&(v=z)),z<f.length))for(P=P.child;P!==null;)c.push(P,z),P=P.sibling}if(v<f.length){for(c=[];v<f.length;v++)c.push(T0(f[v]));return`findAllNodes was able to match part of the selector:
|
||
`+(C.join(" > ")+`
|
||
|
||
No matching component was found for:
|
||
`)+c.join(" > ")}return null},n.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return N(c.child.stateNode);default:return c.child.stateNode}},n.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:pR,findFiberByHostInstance:c.findFiberByHostInstance||mR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{lf=f.inject(c),ss=f}catch{}c=!!f.checkDCE}}return c},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(c,f,v,C){if(!$e)throw Error(i(363));c=N0(c,f);var k=bt(c,v,C).disconnect;return{disconnect:function(){k()}}},n.registerMutableSourceForHydration=function(c,f){var v=f._getVersion;v=v(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,v]:c.mutableSourceEagerHydrationData.push(f,v)},n.runWithPriority=function(c,f){var v=Nt;try{return Nt=c,f()}finally{Nt=v}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(c,f,v,C){var k=f.current,P=ir(),z=Oa(k);return v=QC(v),f.context===null?f.context=v:f.pendingContext=v,f=Hs(P,z),f.payload={element:c},C=C===void 0?null:C,C!==null&&(f.callback=C),c=Pa(k,f,z),c!==null&&(fo(c,k,z,P),gf(c,k,z)),z},n};f7.exports=yge;var Cge=f7.exports;const wge=xd(Cge);var p7={exports:{}},pl={};/**
|
||
* @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.
|
||
*/pl.ConcurrentRoot=1;pl.ContinuousEventPriority=4;pl.DefaultEventPriority=16;pl.DiscreteEventPriority=1;pl.IdleEventPriority=536870912;pl.LegacyRoot=0;p7.exports=pl;var m7=p7.exports;const A_={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let T_=!1,N_=!1;const m2=".react-konva-event",Sge=`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
|
||
`,kge=`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
|
||
`,jge={};function Lg(e,t,n=jge){if(!T_&&"zIndex"in t&&(console.warn(kge),T_=!0),!N_&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(Sge),N_=!0)}for(var s in n)if(!A_[s]){var i=s.slice(0,2)==="on",l=n[s]!==t[s];if(i&&l){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var m=t._useStrictMode,h={},g=!1;const x={};for(var s in t)if(!A_[s]){var i=s.slice(0,2)==="on",y=n[s]!==t[s];if(i&&y){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[s]&&(x[u]=t[s])}!i&&(t[s]!==n[s]||m&&t[s]!==e.getAttr(s))&&(g=!0,h[s]=t[s])}g&&(e.setAttrs(h),mi(e));for(var u in x)e.on(u+m2,x[u])}function mi(e){if(!$N.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const h7={},_ge={};gd.Node.prototype._applyProps=Lg;function Ige(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),mi(e)}function Pge(e,t,n){let r=gd[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=gd.Group);const o={},s={};for(var i in t){var l=i.slice(0,2)==="on";l?s[i]=t[i]:o[i]=t[i]}const u=new r(o);return Lg(u,s),u}function Ege(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Mge(e,t,n){return!1}function Oge(e){return e}function Rge(){return null}function Dge(){return null}function Age(e,t,n,r){return _ge}function Tge(){}function Nge(e){}function $ge(e,t){return!1}function Lge(){return h7}function zge(){return h7}const Fge=setTimeout,Bge=clearTimeout,Hge=-1;function Vge(e,t){return!1}const Wge=!1,Uge=!0,Gge=!0;function Kge(e,t){t.parent===e?t.moveToTop():e.add(t),mi(e)}function qge(e,t){t.parent===e?t.moveToTop():e.add(t),mi(e)}function g7(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),mi(e)}function Xge(e,t,n){g7(e,t,n)}function Qge(e,t){t.destroy(),t.off(m2),mi(e)}function Yge(e,t){t.destroy(),t.off(m2),mi(e)}function Zge(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Jge(e,t,n){}function e0e(e,t,n,r,o){Lg(e,o,r)}function t0e(e){e.hide(),mi(e)}function n0e(e){}function r0e(e,t){(t.visible==null||t.visible)&&e.show()}function o0e(e,t){}function s0e(e){}function a0e(){}const i0e=()=>m7.DefaultEventPriority,l0e=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Kge,appendChildToContainer:qge,appendInitialChild:Ige,cancelTimeout:Bge,clearContainer:s0e,commitMount:Jge,commitTextUpdate:Zge,commitUpdate:e0e,createInstance:Pge,createTextInstance:Ege,detachDeletedInstance:a0e,finalizeInitialChildren:Mge,getChildHostContext:zge,getCurrentEventPriority:i0e,getPublicInstance:Oge,getRootHostContext:Lge,hideInstance:t0e,hideTextInstance:n0e,idlePriority:Tp.unstable_IdlePriority,insertBefore:g7,insertInContainerBefore:Xge,isPrimaryRenderer:Wge,noTimeout:Hge,now:Tp.unstable_now,prepareForCommit:Rge,preparePortalMount:Dge,prepareUpdate:Age,removeChild:Qge,removeChildFromContainer:Yge,resetAfterCommit:Tge,resetTextContent:Nge,run:Tp.unstable_runWithPriority,scheduleTimeout:Fge,shouldDeprioritizeSubtree:$ge,shouldSetTextContent:Vge,supportsMutation:Gge,unhideInstance:r0e,unhideTextInstance:o0e,warnsIfNotActing:Uge},Symbol.toStringTag,{value:"Module"}));var c0e=Object.defineProperty,u0e=Object.defineProperties,d0e=Object.getOwnPropertyDescriptors,$_=Object.getOwnPropertySymbols,f0e=Object.prototype.hasOwnProperty,p0e=Object.prototype.propertyIsEnumerable,L_=(e,t,n)=>t in e?c0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z_=(e,t)=>{for(var n in t||(t={}))f0e.call(t,n)&&L_(e,n,t[n]);if($_)for(var n of $_(t))p0e.call(t,n)&&L_(e,n,t[n]);return e},m0e=(e,t)=>u0e(e,d0e(t));function v7(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=v7(r,t,n);if(o)return o;r=t?null:r.sibling}}function x7(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const h2=x7(d.createContext(null));class b7 extends d.Component{render(){return d.createElement(h2.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:F_,ReactCurrentDispatcher:B_}=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h0e(){const e=d.useContext(h2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=d.useId();return d.useMemo(()=>{for(const r of[F_==null?void 0:F_.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=v7(r,!1,s=>{let i=s.memoizedState;for(;i;){if(i.memoizedState===t)return!0;i=i.next}});if(o)return o}},[e,t])}function g0e(){var e,t;const n=h0e(),[r]=d.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==h2&&!r.has(s)&&r.set(s,(t=B_==null?void 0:B_.current)==null?void 0:t.readContext(x7(s))),o=o.return}return r}function v0e(){const e=g0e();return d.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>d.createElement(t,null,d.createElement(n.Provider,m0e(z_({},r),{value:e.get(n)}))),t=>d.createElement(b7,z_({},t))),[e])}function x0e(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const b0e=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=x0e(e),s=v0e(),i=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return H.useLayoutEffect(()=>(n.current=new gd.Stage({width:e.width,height:e.height,container:t.current}),i(n.current),r.current=Tu.createContainer(n.current,m7.LegacyRoot,!1,null),Tu.updateContainer(H.createElement(s,{},e.children),r.current),()=>{gd.isBrowser&&(i(null),Tu.updateContainer(null,r.current,null),n.current.destroy())}),[]),H.useLayoutEffect(()=>{i(n.current),Lg(n.current,e,o),Tu.updateContainer(H.createElement(s,{},e.children),r.current,null)}),H.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Eu="Layer",Ms="Group",Os="Rect",ji="Circle",fh="Line",y7="Image",y0e="Text",C0e="Transformer",Tu=wge(l0e);Tu.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const w0e=H.forwardRef((e,t)=>H.createElement(b7,{},H.createElement(b0e,{...e,forwardedRef:t}))),S0e=le([Sn,Eo],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),k0e=()=>{const e=te(),{tool:t,isStaging:n,isMovingBoundingBox:r}=W(S0e);return{handleDragStart:d.useCallback(()=>{(t==="move"||n)&&!r&&e(tm(!0))},[e,r,n,t]),handleDragMove:d.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(VI(s))},[e,r,n,t]),handleDragEnd:d.useCallback(()=>{(t==="move"||n)&&!r&&e(tm(!1))},[e,r,n,t])}},j0e=le([Sn,Jn,Eo],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isMaskEnabled:l,shouldSnapToGrid:u}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isStaging:n,isMaskEnabled:l,shouldSnapToGrid:u}},{memoizeOptions:{resultEqualityCheck:Bt}}),_0e=()=>{const e=te(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=W(j0e),l=d.useRef(null),u=WI(),p=()=>e(UI());et(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const m=()=>e(cb(!s));et(["h"],()=>{m()},{enabled:()=>!o,preventDefault:!0},[s]),et(["n"],()=>{e(nm(!i))},{enabled:!0,preventDefault:!0},[i]),et("esc",()=>{e(LN())},{enabled:()=>!0,preventDefault:!0}),et("shift+h",()=>{e(zN(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),et(["space"],h=>{h.repeat||(u==null||u.container().focus(),r!=="move"&&(l.current=r,e(oc("move"))),r==="move"&&l.current&&l.current!=="move"&&(e(oc(l.current)),l.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,l])},g2=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},C7=()=>{const e=te(),t=v1(),n=WI();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=FN.pixelRatio,[s,i,l,u]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;u&&s&&i&&l&&e(BN({r:s,g:i,b:l,a:u}))},commitColorUnderCursor:()=>{e(HN())}}},I0e=le([Jn,Sn,Eo],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),P0e=e=>{const t=te(),{tool:n,isStaging:r}=W(I0e),{commitColorUnderCursor:o}=C7();return d.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(tm(!0));return}if(n==="colorPicker"){o();return}const i=g2(e.current);i&&(s.evt.preventDefault(),t(GI(!0)),t(VN([i.x,i.y])))},[e,n,r,t,o])},E0e=le([Jn,Sn,Eo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),M0e=(e,t,n)=>{const r=te(),{isDrawing:o,tool:s,isStaging:i}=W(E0e),{updateColorUnderCursor:l}=C7();return d.useCallback(()=>{if(!e.current)return;const u=g2(e.current);if(u){if(r(WN(u)),n.current=u,s==="colorPicker"){l();return}!o||s==="move"||i||(t.current=!0,r(KI([u.x,u.y])))}},[t,r,o,i,n,e,s,l])},O0e=()=>{const e=te();return d.useCallback(()=>{e(UN())},[e])},R0e=le([Jn,Sn,Eo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),D0e=(e,t)=>{const n=te(),{tool:r,isDrawing:o,isStaging:s}=W(R0e);return d.useCallback(()=>{if(r==="move"||s){n(tm(!1));return}if(!t.current&&o&&e.current){const i=g2(e.current);if(!i)return;n(KI([i.x,i.y]))}else t.current=!1;n(GI(!1))},[t,n,o,s,e,r])},A0e=le([Sn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Bt}}),T0e=e=>{const t=te(),{isMoveStageKeyHeld:n,stageScale:r}=W(A0e);return d.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const i={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let l=o.evt.deltaY;o.evt.ctrlKey&&(l=-l);const u=Bi(r*qN**l,KN,GN),p={x:s.x-i.x*u,y:s.y-i.y*u};t(XN(u)),t(VI(p))},[e,n,r,t])},N0e=le(Sn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:Bt}}),$0e=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=W(N0e);return a.jsxs(Ms,{children:[a.jsx(Os,{offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),a.jsx(Os,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},L0e=d.memo($0e),z0e=le([Sn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),F0e=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=W(z0e),{colorMode:r}=ha(),[o,s]=d.useState([]),[i,l]=Ho("colors",["base.800","base.200"]),u=d.useCallback(p=>p/e,[e]);return d.useLayoutEffect(()=>{const{width:p,height:m}=n,{x:h,y:g}=t,x={x1:0,y1:0,x2:p,y2:m,offset:{x:u(h),y:u(g)}},y={x:Math.ceil(u(h)/64)*64,y:Math.ceil(u(g)/64)*64},b={x1:-y.x,y1:-y.y,x2:u(p)-y.x+64,y2:u(m)-y.y+64},S={x1:Math.min(x.x1,b.x1),y1:Math.min(x.y1,b.y1),x2:Math.max(x.x2,b.x2),y2:Math.max(x.y2,b.y2)},j=S.x2-S.x1,_=S.y2-S.y1,E=Math.round(j/64)+1,I=Math.round(_/64)+1,M=Bw(0,E).map(D=>a.jsx(fh,{x:S.x1+D*64,y:S.y1,points:[0,0,0,_],stroke:r==="dark"?i:l,strokeWidth:1},`x_${D}`)),R=Bw(0,I).map(D=>a.jsx(fh,{x:S.x1,y:S.y1+D*64,points:[0,0,j,0],stroke:r==="dark"?i:l,strokeWidth:1},`y_${D}`));s(M.concat(R))},[e,t,n,u,r,i,l]),a.jsx(Ms,{children:o})},B0e=d.memo(F0e),H0e=le([xe],({system:e,canvas:t})=>{const{denoiseProgress:n}=e,{boundingBox:r}=t.layerState.stagingArea,{batchIds:o}=t;return{boundingBox:r,progressImage:n&&o.includes(n.batch_id)?n.progress_image:void 0}},{memoizeOptions:{resultEqualityCheck:Bt}}),V0e=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=W(H0e),[o,s]=d.useState(null);return d.useEffect(()=>{if(!n)return;const i=new Image;i.onload=()=>{s(i)},i.src=n.dataURL},[n]),n&&r&&o?a.jsx(y7,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},W0e=d.memo(V0e),Fi=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},U0e=le(Sn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Fi(t)}}),H_=e=>`data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!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),G0e=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=W(U0e),[i,l]=d.useState(null),[u,p]=d.useState(0),m=d.useRef(null),h=d.useCallback(()=>{p(u+1),setTimeout(h,500)},[u]);return d.useEffect(()=>{if(i)return;const g=new Image;g.onload=()=>{l(g)},g.src=H_(n)},[i,n]),d.useEffect(()=>{i&&(i.src=H_(n))},[i,n]),d.useEffect(()=>{const g=setInterval(()=>p(x=>(x+1)%5),50);return()=>clearInterval(g)},[]),!i||!Ml(r.x)||!Ml(r.y)||!Ml(s)||!Ml(o.width)||!Ml(o.height)?null:a.jsx(Os,{ref:m,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:Ml(u)?u:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},K0e=d.memo(G0e),q0e=le([Sn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Bt}}),X0e=e=>{const{...t}=e,{objects:n}=W(q0e);return a.jsx(Ms,{listening:!1,...t,children:n.filter(QN).map((r,o)=>a.jsx(fh,{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))})},Q0e=d.memo(X0e);var _i=d,Y0e=function(t,n,r){const o=_i.useRef("loading"),s=_i.useRef(),[i,l]=_i.useState(0),u=_i.useRef(),p=_i.useRef(),m=_i.useRef();return(u.current!==t||p.current!==n||m.current!==r)&&(o.current="loading",s.current=void 0,u.current=t,p.current=n,m.current=r),_i.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function g(){o.current="loaded",s.current=h,l(Math.random())}function x(){o.current="failed",s.current=void 0,l(Math.random())}return h.addEventListener("load",g),h.addEventListener("error",x),n&&(h.crossOrigin=n),r&&(h.referrerPolicy=r),h.src=t,function(){h.removeEventListener("load",g),h.removeEventListener("error",x)}},[t,n,r]),[s.current,o.current]};const Z0e=xd(Y0e),J0e=({canvasImage:e})=>{const[t,n,r,o]=Ho("colors",["base.400","base.500","base.700","base.900"]),s=sa(t,n),i=sa(r,o),{t:l}=Z();return a.jsxs(Ms,{children:[a.jsx(Os,{x:e.x,y:e.y,width:e.width,height:e.height,fill:s}),a.jsx(y0e,{x:e.x,y:e.y,width:e.width,height:e.height,align:"center",verticalAlign:"middle",fontFamily:'"Inter Variable", sans-serif',fontSize:e.width/16,fontStyle:"600",text:l("common.imageFailedToLoad"),fill:i})]})},eve=d.memo(J0e),tve=e=>{const{x:t,y:n,imageName:r}=e.canvasImage,{currentData:o,isError:s}=to(r??$r.skipToken),[i,l]=Z0e((o==null?void 0:o.image_url)??"",YN.get()?"use-credentials":"anonymous");return s||l==="failed"?a.jsx(eve,{canvasImage:e.canvasImage}):a.jsx(y7,{x:t,y:n,image:i,listening:!1})},w7=d.memo(tve),nve=le([Sn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Bt}}),rve=()=>{const{objects:e}=W(nve);return e?a.jsx(Ms,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(ZN(t))return a.jsx(w7,{canvasImage:t},n);if(JN(t)){const r=a.jsx(fh,{points:t.points,stroke:t.color?Fi(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?a.jsx(Ms,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(e9(t))return a.jsx(Os,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Fi(t.color)},n);if(t9(t))return a.jsx(Os,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},ove=d.memo(rve),sve=le([Sn],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:o,boundingBoxDimensions:s}=e,{selectedImageIndex:i,images:l,boundingBox:u}=t.stagingArea;return{currentStagingAreaImage:l.length>0&&i!==void 0?l[i]:void 0,isOnFirstImage:i===0,isOnLastImage:i===l.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:(u==null?void 0:u.x)??o.x,y:(u==null?void 0:u.y)??o.y,width:(u==null?void 0:u.width)??s.width,height:(u==null?void 0:u.height)??s.height}},{memoizeOptions:{resultEqualityCheck:Bt}}),ave=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:l,height:u}=W(sve);return a.jsxs(Ms,{...t,children:[r&&n&&a.jsx(w7,{canvasImage:n}),o&&a.jsxs(Ms,{children:[a.jsx(Os,{x:s,y:i,width:l,height:u,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(Os,{x:s,y:i,width:l,height:u,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},ive=d.memo(ave),lve=le([Sn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentIndex:n,total:t.length,currentStagingAreaImage:t.length>0?t[n]:void 0,shouldShowStagingImage:o,shouldShowStagingOutline:r}},Se),cve=()=>{const e=te(),{currentStagingAreaImage:t,shouldShowStagingImage:n,currentIndex:r,total:o}=W(lve),{t:s}=Z(),i=d.useCallback(()=>{e(Hw(!0))},[e]),l=d.useCallback(()=>{e(Hw(!1))},[e]),u=d.useCallback(()=>e(n9()),[e]),p=d.useCallback(()=>e(r9()),[e]),m=d.useCallback(()=>e(o9()),[e]);et(["left"],u,{enabled:()=>!0,preventDefault:!0}),et(["right"],p,{enabled:()=>!0,preventDefault:!0}),et(["enter"],()=>m,{enabled:()=>!0,preventDefault:!0});const{data:h}=to((t==null?void 0:t.imageName)??$r.skipToken),g=d.useCallback(()=>{e(s9(!n))},[e,n]),x=d.useCallback(()=>{h&&e(a9({imageDTO:h}))},[e,h]),y=d.useCallback(()=>{e(i9())},[e]);return t?a.jsxs(L,{pos:"absolute",bottom:4,gap:2,w:"100%",align:"center",justify:"center",onMouseEnter:i,onMouseLeave:l,children:[a.jsxs(Vt,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Fe,{tooltip:`${s("unifiedCanvas.previous")} (Left)`,"aria-label":`${s("unifiedCanvas.previous")} (Left)`,icon:a.jsx(IJ,{}),onClick:u,colorScheme:"accent",isDisabled:!n}),a.jsx(at,{colorScheme:"base",pointerEvents:"none",isDisabled:!n,minW:20,children:`${r+1}/${o}`}),a.jsx(Fe,{tooltip:`${s("unifiedCanvas.next")} (Right)`,"aria-label":`${s("unifiedCanvas.next")} (Right)`,icon:a.jsx(PJ,{}),onClick:p,colorScheme:"accent",isDisabled:!n})]}),a.jsxs(Vt,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Fe,{tooltip:`${s("unifiedCanvas.accept")} (Enter)`,"aria-label":`${s("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(aM,{}),onClick:m,colorScheme:"accent"}),a.jsx(Fe,{tooltip:s(n?"unifiedCanvas.showResultsOn":"unifiedCanvas.showResultsOff"),"aria-label":s(n?"unifiedCanvas.showResultsOn":"unifiedCanvas.showResultsOff"),"data-alert":!n,icon:n?a.jsx(BJ,{}):a.jsx(FJ,{}),onClick:g,colorScheme:"accent"}),a.jsx(Fe,{tooltip:s("unifiedCanvas.saveToGallery"),"aria-label":s("unifiedCanvas.saveToGallery"),isDisabled:!h||!h.is_intermediate,icon:a.jsx(lg,{}),onClick:x,colorScheme:"accent"}),a.jsx(Fe,{tooltip:s("unifiedCanvas.discardAll"),"aria-label":s("unifiedCanvas.discardAll"),icon:a.jsx(Ic,{}),onClick:y,colorScheme:"error",fontSize:20})]})]}):null},uve=d.memo(cve),dve=()=>{const e=W(l=>l.canvas.layerState),t=W(l=>l.canvas.boundingBoxCoordinates),n=W(l=>l.canvas.boundingBoxDimensions),r=W(l=>l.canvas.isMaskEnabled),o=W(l=>l.canvas.shouldPreserveMaskedArea),[s,i]=d.useState();return d.useEffect(()=>{i(void 0)},[e,t,n,r,o]),pee(async()=>{const l=await l9(e,t,n,r,o);if(!l)return;const{baseImageData:u,maskImageData:p}=l,m=c9(u,p);i(m)},1e3,[e,t,n,r,o]),s},fve={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},pve=()=>{const e=dve();return a.jsxs(Ie,{children:["Mode: ",e?fve[e]:"..."]})},mve=d.memo(pve),nc=e=>Math.round(e*100)/100,hve=le([Sn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${nc(n)}, ${nc(r)})`}},{memoizeOptions:{resultEqualityCheck:Bt}});function gve(){const{cursorCoordinatesString:e}=W(hve),{t}=Z();return a.jsx(Ie,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Tx="var(--invokeai-colors-warning-500)",vve=le([Sn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:i},scaledBoundingBoxDimensions:{width:l,height:u},boundingBoxCoordinates:{x:p,y:m},stageScale:h,shouldShowCanvasDebugInfo:g,layer:x,boundingBoxScaleMethod:y,shouldPreserveMaskedArea:b}=e;let w="inherit";return(y==="none"&&(s<512||i<512)||y==="manual"&&l*u<512*512)&&(w=Tx),{activeLayerColor:x==="mask"?Tx:"inherit",activeLayerString:x.charAt(0).toUpperCase()+x.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${nc(p)}, ${nc(m)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${l}×${u}`,canvasCoordinatesString:`${nc(r)}×${nc(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:g,shouldShowBoundingBox:y!=="auto",shouldShowScaledBoundingBox:y!=="none",shouldPreserveMaskedArea:b}},{memoizeOptions:{resultEqualityCheck:Bt}}),xve=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:l,canvasDimensionsString:u,canvasScaleString:p,shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:h,shouldPreserveMaskedArea:g}=W(vve),{t:x}=Z();return a.jsxs(L,{sx:{flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,opacity:.65,display:"flex",fontSize:"sm",padding:1,px:2,minWidth:48,margin:1,borderRadius:"base",pointerEvents:"none",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(mve,{}),a.jsx(Ie,{style:{color:e},children:`${x("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasScale")}: ${p}%`}),g&&a.jsx(Ie,{style:{color:Tx},children:"Preserve Masked Area: On"}),h&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.scaledBoundingBox")}: ${s}`}),m&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:`${x("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasDimensions")}: ${u}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasPosition")}: ${l}`}),a.jsx(gve,{})]})]})},bve=d.memo(xve),yve=le([xe],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:l,tool:u,shouldSnapToGrid:p}=e,{aspectRatio:m}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:l,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:p,tool:u,hitStrokeWidth:20/o,aspectRatio:m}},{memoizeOptions:{resultEqualityCheck:Bt}}),Cve=e=>{const{...t}=e,n=te(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:l,stageScale:u,shouldSnapToGrid:p,tool:m,hitStrokeWidth:h,aspectRatio:g}=W(yve),x=d.useRef(null),y=d.useRef(null),[b,w]=d.useState(!1);d.useEffect(()=>{var B;!x.current||!y.current||(x.current.nodes([y.current]),(B=x.current.getLayer())==null||B.batchDraw())},[]);const S=64*u;et("N",()=>{n(nm(!p))});const j=d.useCallback(B=>{if(!p){n(tv({x:Math.floor(B.target.x()),y:Math.floor(B.target.y())}));return}const V=B.target.x(),U=B.target.y(),N=wr(V,64),$=wr(U,64);B.target.x(N),B.target.y($),n(tv({x:N,y:$}))},[n,p]),_=d.useCallback(()=>{if(!y.current)return;const B=y.current,V=B.scaleX(),U=B.scaleY(),N=Math.round(B.width()*V),$=Math.round(B.height()*U),q=Math.round(B.x()),F=Math.round(B.y());if(g){const Q=wr(N/g,64);n(Vo({width:N,height:Q}))}else n(Vo({width:N,height:$}));n(tv({x:p?Mu(q,64):q,y:p?Mu(F,64):F})),B.scaleX(1),B.scaleY(1)},[n,p,g]),E=d.useCallback((B,V,U)=>{const N=B.x%S,$=B.y%S;return{x:Mu(V.x,S)+N,y:Mu(V.y,S)+$}},[S]),I=d.useCallback(()=>{n(nv(!0))},[n]),M=d.useCallback(()=>{n(nv(!1)),n(rv(!1)),n(Yf(!1)),w(!1)},[n]),R=d.useCallback(()=>{n(rv(!0))},[n]),D=d.useCallback(()=>{n(nv(!1)),n(rv(!1)),n(Yf(!1)),w(!1)},[n]),A=d.useCallback(()=>{w(!0)},[]),O=d.useCallback(()=>{!l&&!i&&w(!1)},[i,l]),T=d.useCallback(()=>{n(Yf(!0))},[n]),X=d.useCallback(()=>{n(Yf(!1))},[n]);return a.jsxs(Ms,{...t,children:[a.jsx(Os,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:T,onMouseOver:T,onMouseLeave:X,onMouseOut:X}),a.jsx(Os,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:h,listening:!s&&m==="move",onDragStart:R,onDragEnd:D,onDragMove:j,onMouseDown:R,onMouseOut:O,onMouseOver:A,onMouseEnter:A,onMouseUp:D,onTransform:_,onTransformEnd:M,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/u,width:o.width,x:r.x,y:r.y}),a.jsx(C0e,{anchorCornerRadius:3,anchorDragBoundFunc:E,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:m==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&m==="move",onDragStart:R,onDragEnd:D,onMouseDown:I,onMouseUp:M,onTransformEnd:M,ref:x,rotateEnabled:!1})]})},wve=d.memo(Cve),Sve=le(Sn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:l,shouldShowBrush:u,isMovingBoundingBox:p,isTransformingBoundingBox:m,stageScale:h,stageDimensions:g,boundingBoxCoordinates:x,boundingBoxDimensions:y,shouldRestrictStrokesToBox:b}=e,w=b?{clipX:x.x,clipY:x.y,clipWidth:y.width,clipHeight:y.height}:{};return{cursorPosition:t,brushX:t?t.x:g.width/2,brushY:t?t.y:g.height/2,radius:n/2,colorPickerOuterRadius:Vw/h,colorPickerInnerRadius:(Vw-x1+1)/h,maskColorString:Fi({...o,a:.5}),brushColorString:Fi(s),colorPickerColorString:Fi(r),tool:i,layer:l,shouldShowBrush:u,shouldDrawBrushPreview:!(p||m||!t)&&u,strokeWidth:1.5/h,dotRadius:1.5/h,clip:w}},{memoizeOptions:{resultEqualityCheck:Bt}}),kve=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:l,shouldDrawBrushPreview:u,dotRadius:p,strokeWidth:m,brushColorString:h,colorPickerColorString:g,colorPickerInnerRadius:x,colorPickerOuterRadius:y,clip:b}=W(Sve);return u?a.jsxs(Ms,{listening:!1,...b,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(ji,{x:n,y:r,radius:y,stroke:h,strokeWidth:x1,strokeScaleEnabled:!1}),a.jsx(ji,{x:n,y:r,radius:x,stroke:g,strokeWidth:x1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(ji,{x:n,y:r,radius:o,fill:l==="mask"?s:h,globalCompositeOperation:i==="eraser"?"destination-out":"source-out"}),a.jsx(ji,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:m*2,strokeEnabled:!0,listening:!1}),a.jsx(ji,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:m,strokeEnabled:!0,listening:!1})]}),a.jsx(ji,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(ji,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},jve=d.memo(kve),_ve=le([Sn,Eo],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:l,stageDimensions:u,stageCoordinates:p,tool:m,isMovingStage:h,shouldShowIntermediates:g,shouldShowGrid:x,shouldRestrictStrokesToBox:y,shouldAntialias:b}=e;let w="none";return m==="move"||t?h?w="grabbing":w="grab":s?w=void 0:y&&!i&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||l,shouldShowBoundingBox:o,shouldShowGrid:x,stageCoordinates:p,stageCursor:w,stageDimensions:u,stageScale:r,tool:m,isStaging:t,shouldShowIntermediates:g,shouldAntialias:b}},Se),Ive=we(w0e,{shouldForwardProp:e=>!["sx"].includes(e)}),Pve=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:l,tool:u,isStaging:p,shouldShowIntermediates:m,shouldAntialias:h}=W(_ve);_0e();const g=te(),x=d.useRef(null),y=d.useRef(null),b=d.useRef(null),w=d.useCallback(B=>{u9(B),y.current=B},[]),S=d.useCallback(B=>{d9(B),b.current=B},[]),j=d.useRef({x:0,y:0}),_=d.useRef(!1),E=T0e(y),I=P0e(y),M=D0e(y,_),R=M0e(y,_,j),D=O0e(),{handleDragStart:A,handleDragMove:O,handleDragEnd:T}=k0e(),X=d.useCallback(B=>B.evt.preventDefault(),[]);return d.useEffect(()=>{if(!x.current)return;const B=new ResizeObserver(N=>{for(const $ of N)if($.contentBoxSize){const{width:q,height:F}=$.contentRect;g(Ww({width:q,height:F}))}});B.observe(x.current);const{width:V,height:U}=x.current.getBoundingClientRect();return g(Ww({width:V,height:U})),()=>{B.disconnect()}},[g]),a.jsxs(L,{id:"canvas-container",ref:x,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Ie,{sx:{position:"absolute"},children:a.jsxs(Ive,{tabIndex:-1,ref:w,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:i.width,height:i.height,scale:{x:l,y:l},onTouchStart:I,onTouchMove:R,onTouchEnd:M,onMouseDown:I,onMouseLeave:D,onMouseMove:R,onMouseUp:M,onDragStart:A,onDragMove:O,onDragEnd:T,onContextMenu:X,onWheel:E,draggable:(u==="move"||p)&&!t,children:[a.jsx(Eu,{id:"grid",visible:r,children:a.jsx(B0e,{})}),a.jsx(Eu,{id:"base",ref:S,listening:!1,imageSmoothingEnabled:h,children:a.jsx(ove,{})}),a.jsxs(Eu,{id:"mask",visible:e&&!p,listening:!1,children:[a.jsx(Q0e,{visible:!0,listening:!1}),a.jsx(K0e,{listening:!1})]}),a.jsx(Eu,{children:a.jsx(L0e,{})}),a.jsxs(Eu,{id:"preview",imageSmoothingEnabled:h,children:[!p&&a.jsx(jve,{visible:u!=="move",listening:!1}),a.jsx(ive,{visible:p}),m&&a.jsx(W0e,{}),a.jsx(wve,{visible:n&&!p})]})]})}),a.jsx(bve,{}),a.jsx(uve,{})]})},Eve=d.memo(Pve);function Mve(e,t,n=250){const[r,o]=d.useState(0);return d.useEffect(()=>{const s=setTimeout(()=>{r===1&&e(),o(0)},n);return r===2&&t(),()=>clearTimeout(s)},[r,e,t,n]),()=>o(s=>s+1)}const n1={width:6,height:6,borderColor:"base.100"},Ove={".react-colorful__hue-pointer":n1,".react-colorful__saturation-pointer":n1,".react-colorful__alpha-pointer":n1},Rve=e=>a.jsx(Ie,{sx:Ove,children:a.jsx(yO,{...e})}),S7=d.memo(Rve),Dve=le([Sn,Eo],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Fi(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Bt}}),Ave=()=>{const e=te(),{t}=Z(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=W(Dve);et(["q"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[n]),et(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]),et(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[o]);const l=()=>{e(qI(n==="mask"?"base":"mask"))},u=()=>e(UI()),p=()=>e(cb(!o)),m=async()=>{e(m9())};return a.jsx(qd,{triggerComponent:a.jsx(Vt,{children:a.jsx(Fe,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(mM,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs(L,{direction:"column",gap:2,children:[a.jsx(br,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(br,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:h=>e(f9(h.target.checked))}),a.jsx(Ie,{sx:{paddingTop:2,paddingBottom:2},children:a.jsx(S7,{color:r,onChange:h=>e(p9(h))})}),a.jsx(at,{size:"sm",leftIcon:a.jsx(lg,{}),onClick:m,children:"Save Mask"}),a.jsxs(at,{size:"sm",leftIcon:a.jsx(Br,{}),onClick:u,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},Tve=d.memo(Ave),Nve=le([xe,Jn],({canvas:e},t)=>{const{futureLayerStates:n}=e;return{canRedo:n.length>0,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Bt}});function $ve(){const e=te(),{canRedo:t,activeTabName:n}=W(Nve),{t:r}=Z(),o=()=>{e(h9())};return et(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(Fe,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(eee,{}),onClick:o,isDisabled:!t})}const Lve=()=>{const e=W(Eo),t=te(),{t:n}=Z();return a.jsxs(kg,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(g9()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(at,{size:"sm",leftIcon:a.jsx(Br,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},zve=d.memo(Lve),Fve=le([Sn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:Bt}}),Bve=()=>{const e=te(),{t}=Z(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:l,shouldSnapToGrid:u,shouldRestrictStrokesToBox:p,shouldAntialias:m}=W(Fve);et(["n"],()=>{e(nm(!u))},{enabled:!0,preventDefault:!0},[u]);const h=g=>e(nm(g.target.checked));return a.jsx(qd,{isLazy:!1,triggerComponent:a.jsx(Fe,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(bM,{})}),children:a.jsxs(L,{direction:"column",gap:2,children:[a.jsx(br,{label:t("unifiedCanvas.showIntermediates"),isChecked:l,onChange:g=>e(v9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:g=>e(x9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.snapToGrid"),isChecked:u,onChange:h}),a.jsx(br,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:g=>e(b9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:g=>e(y9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:g=>e(C9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:g=>e(w9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:g=>e(S9(g.target.checked))}),a.jsx(br,{label:t("unifiedCanvas.antialiasing"),isChecked:m,onChange:g=>e(k9(g.target.checked))}),a.jsx(zve,{})]})})},Hve=d.memo(Bve),Vve=le([xe,Eo],({canvas:e},t)=>{const{tool:n,brushColor:r,brushSize:o}=e;return{tool:n,isStaging:t,brushColor:r,brushSize:o}},{memoizeOptions:{resultEqualityCheck:Bt}}),Wve=()=>{const e=te(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=W(Vve),{t:s}=Z();et(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),et(["e"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[t]),et(["c"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),et(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),et(["delete","backspace"],()=>{m()},{enabled:()=>!o,preventDefault:!0}),et(["BracketLeft"],()=>{r-5<=5?e(Zf(Math.max(r-1,1))):e(Zf(Math.max(r-5,1)))},{enabled:()=>!o,preventDefault:!0},[r]),et(["BracketRight"],()=>{e(Zf(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),et(["Shift+BracketLeft"],()=>{e(ov({...n,a:Bi(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),et(["Shift+BracketRight"],()=>{e(ov({...n,a:Bi(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(oc("brush")),l=()=>e(oc("eraser")),u=()=>e(oc("colorPicker")),p=()=>e(j9()),m=()=>e(_9());return a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(QJ,{}),isChecked:t==="brush"&&!o,onClick:i,isDisabled:o}),a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(NJ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:l}),a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(HJ,{}),isDisabled:o,onClick:p}),a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(Vc,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:m}),a.jsx(Fe,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(zJ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:u}),a.jsx(qd,{triggerComponent:a.jsx(Fe,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(vM,{})}),children:a.jsxs(L,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx(L,{gap:4,justifyContent:"space-between",children:a.jsx(tt,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:h=>e(Zf(h)),sliderNumberInputProps:{max:500}})}),a.jsx(Ie,{sx:{width:"100%",paddingTop:2,paddingBottom:2},children:a.jsx(S7,{color:n,onChange:h=>e(ov(h))})})]})})]})},Uve=d.memo(Wve),Gve=le([xe,Jn],({canvas:e},t)=>{const{pastLayerStates:n}=e;return{canUndo:n.length>0,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Bt}});function Kve(){const e=te(),{t}=Z(),{canUndo:n,activeTabName:r}=W(Gve),o=()=>{e(I9())};return et(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(Fe,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(Ud,{}),onClick:o,isDisabled:!n})}const qve=le([xe,Eo],({canvas:e},t)=>{const{tool:n,shouldCropToBoundingBoxOnSave:r,layer:o,isMaskEnabled:s}=e;return{isStaging:t,isMaskEnabled:s,tool:n,layer:o,shouldCropToBoundingBoxOnSave:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),Xve=()=>{const e=te(),{isStaging:t,isMaskEnabled:n,layer:r,tool:o}=W(qve),s=v1(),{t:i}=Z(),{isClipboardAPIAvailable:l}=$8(),{getUploadButtonProps:u,getUploadInputProps:p}=Uy({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});et(["v"],()=>{m()},{enabled:()=>!t,preventDefault:!0},[]),et(["r"],()=>{g()},{enabled:()=>!0,preventDefault:!0},[s]),et(["shift+m"],()=>{y()},{enabled:()=>!t,preventDefault:!0},[s]),et(["shift+s"],()=>{b()},{enabled:()=>!t,preventDefault:!0},[s]),et(["meta+c","ctrl+c"],()=>{w()},{enabled:()=>!t&&l,preventDefault:!0},[s,l]),et(["shift+d"],()=>{S()},{enabled:()=>!t,preventDefault:!0},[s]);const m=()=>e(oc("move")),h=Mve(()=>g(!1),()=>g(!0)),g=(_=!1)=>{const E=v1();if(!E)return;const I=E.getClientRect({skipTransform:!0});e(E9({contentRect:I,shouldScaleTo1:_}))},x=()=>{e(iI())},y=()=>{e(M9())},b=()=>{e(O9())},w=()=>{l&&e(R9())},S=()=>{e(D9())},j=_=>{const E=_;e(qI(E)),E==="mask"&&!n&&e(cb(!0))};return a.jsxs(L,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ie,{w:24,children:a.jsx(Pn,{tooltip:`${i("unifiedCanvas.layer")} (Q)`,value:r,data:P9,onChange:j,disabled:t})}),a.jsx(Tve,{}),a.jsx(Uve,{}),a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.move")} (V)`,tooltip:`${i("unifiedCanvas.move")} (V)`,icon:a.jsx(EJ,{}),isChecked:o==="move"||t,onClick:m}),a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.resetView")} (R)`,tooltip:`${i("unifiedCanvas.resetView")} (R)`,icon:a.jsx(DJ,{}),onClick:h})]}),a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${i("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(KJ,{}),onClick:y,isDisabled:t}),a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${i("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(lg,{}),onClick:b,isDisabled:t}),l&&a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${i("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Hc,{}),onClick:w,isDisabled:t}),a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${i("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(ig,{}),onClick:S,isDisabled:t})]}),a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Kve,{}),a.jsx($ve,{})]}),a.jsxs(Vt,{isAttached:!0,children:[a.jsx(Fe,{"aria-label":`${i("common.upload")}`,tooltip:`${i("common.upload")}`,icon:a.jsx(cg,{}),isDisabled:t,...u()}),a.jsx("input",{...p()}),a.jsx(Fe,{"aria-label":`${i("unifiedCanvas.clearCanvas")}`,tooltip:`${i("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Br,{}),onClick:x,colorScheme:"error",isDisabled:t})]}),a.jsx(Vt,{isAttached:!0,children:a.jsx(Hve,{})})]})},Qve=d.memo(Xve),V_={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Yve=()=>{const{isOver:e,setNodeRef:t,active:n}=JM({id:"unifiedCanvas",data:V_});return a.jsxs(L,{layerStyle:"first",ref:t,tabIndex:-1,sx:{flexDirection:"column",alignItems:"center",gap:4,p:2,borderRadius:"base",w:"full",h:"full"},children:[a.jsx(Qve,{}),a.jsx(Eve,{}),e8(V_,n)&&a.jsx(t8,{isOver:e,label:"Set Canvas Initial Image"})]})},Zve=d.memo(Yve),Jve=()=>a.jsx(Zve,{}),e1e=d.memo(Jve),t1e=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(Nn,{as:VJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(xge,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(Nn,{as:Yi,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Mfe,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(Nn,{as:Soe,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(e1e,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(Nn,{as:Gy,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Ihe,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(Nn,{as:AJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Ppe,{})},{id:"queue",translationKey:"queue.queue",icon:a.jsx(Nn,{as:oee,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(gge,{})}],n1e=le([xe],({config:e})=>{const{disabledTabs:t}=e;return t1e.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:Bt}}),r1e=448,o1e=448,s1e=360,a1e=["modelManager","queue"],i1e=["modelManager","queue"],l1e=()=>{const e=W(A9),t=W(Jn),n=W(n1e),{t:r}=Z(),o=te(),s=d.useCallback(O=>{O.target instanceof HTMLElement&&O.target.blur()},[]),i=d.useMemo(()=>n.map(O=>a.jsx(Ft,{hasArrow:!0,label:String(r(O.translationKey)),placement:"end",children:a.jsxs(Tr,{onClick:s,children:[a.jsx(d5,{children:String(r(O.translationKey))}),O.icon]})},O.id)),[n,r,s]),l=d.useMemo(()=>n.map(O=>a.jsx(So,{children:O.content},O.id)),[n]),u=d.useCallback(O=>{const T=n[O];T&&o(Xs(T.id))},[o,n]),{minSize:p,isCollapsed:m,setIsCollapsed:h,ref:g,reset:x,expand:y,collapse:b,toggle:w}=Jj(r1e,"pixels"),{ref:S,minSize:j,isCollapsed:_,setIsCollapsed:E,reset:I,expand:M,collapse:R,toggle:D}=Jj(s1e,"pixels");et("f",()=>{_||m?(M(),y()):(b(),R())},[o,_,m]),et(["t","o"],()=>{w()},[o]),et("g",()=>{D()},[o]);const A=t2();return a.jsxs(rl,{variant:"appTabs",defaultIndex:e,index:e,onChange:u,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(ol,{sx:{pt:2,gap:4,flexDir:"column"},children:[i,a.jsx(ba,{})]}),a.jsxs(Ig,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!i1e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Qa,{order:0,id:"side",ref:g,defaultSize:p,minSize:p,onCollapse:h,collapsible:!0,children:t==="nodes"?a.jsx(wie,{}):a.jsx(Jde,{})}),a.jsx(lh,{onDoubleClick:x,collapsedDirection:m?"left":void 0}),a.jsx(_ie,{isSidePanelCollapsed:m,sidePanelRef:g})]}),a.jsx(Qa,{id:"main",order:1,minSize:o1e,children:a.jsx(zc,{style:{height:"100%",width:"100%"},children:l})}),!a1e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(lh,{onDoubleClick:I,collapsedDirection:_?"right":void 0}),a.jsx(Qa,{id:"gallery",ref:S,order:2,defaultSize:j,minSize:j,onCollapse:E,collapsible:!0,children:a.jsx(Joe,{})}),a.jsx(kie,{isGalleryCollapsed:_,galleryPanelRef:S})]})]})]})},c1e=d.memo(l1e),u1e=d.createContext(null),r1={didCatch:!1,error:null};class d1e extends d.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=r1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(r1)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&f1e(t.resetKeys,o)){var s,i;(s=(i=this.props).onReset)===null||s===void 0||s.call(i,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(r1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:s,error:i}=this.state;let l=t;if(s){const u={error:i,resetErrorBoundary:this.resetErrorBoundary};if(d.isValidElement(o))l=o;else if(typeof n=="function")l=n(u);else if(r)l=d.createElement(r,u);else throw i}return d.createElement(u1e.Provider,{value:{didCatch:s,error:i,resetErrorBoundary:this.resetErrorBoundary}},l)}}function f1e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function p1e(e={}){let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");const n=new URL(`${t}/issues/new`),r=["body","title","labels","template","milestone","assignee","projects"];for(const o of r){let s=e[o];if(s!==void 0){if(o==="labels"||o==="projects"){if(!Array.isArray(s))throw new TypeError(`The \`${o}\` option should be an array`);s=s.join(",")}n.searchParams.set(o,s)}}return n.toString()}const m1e=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(e=>[e.name,e]),h1e=new Map(m1e),g1e=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],Nx=new WeakSet,v1e=e=>{Nx.add(e);const t=e.toJSON();return Nx.delete(e),t},x1e=e=>h1e.get(e)??Error,k7=({from:e,seen:t,to:n,forceEnumerable:r,maxDepth:o,depth:s,useToJSON:i,serialize:l})=>{if(!n)if(Array.isArray(e))n=[];else if(!l&&W_(e)){const p=x1e(e.name);n=new p}else n={};if(t.push(e),s>=o)return n;if(i&&typeof e.toJSON=="function"&&!Nx.has(e))return v1e(e);const u=p=>k7({from:p,seen:[...t],forceEnumerable:r,maxDepth:o,depth:s,useToJSON:i,serialize:l});for(const[p,m]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(m)){n[p]="[object Buffer]";continue}if(m!==null&&typeof m=="object"&&typeof m.pipe=="function"){n[p]="[object Stream]";continue}if(typeof m!="function"){if(!m||typeof m!="object"){n[p]=m;continue}if(!t.includes(e[p])){s++,n[p]=u(e[p]);continue}n[p]="[Circular]"}}for(const{property:p,enumerable:m}of g1e)typeof e[p]<"u"&&e[p]!==null&&Object.defineProperty(n,p,{value:W_(e[p])?u(e[p]):e[p],enumerable:r?!0:m,configurable:!0,writable:!0});return n};function b1e(e,t={}){const{maxDepth:n=Number.POSITIVE_INFINITY,useToJSON:r=!0}=t;return typeof e=="object"&&e!==null?k7({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0,useToJSON:r,serialize:!0}):typeof e=="function"?`[Function: ${e.name??"anonymous"}]`:e}function W_(e){return!!e&&typeof e=="object"&&"name"in e&&"message"in e&&"stack"in e}const y1e=({error:e,resetErrorBoundary:t})=>{const n=r5(),r=d.useCallback(()=>{const s=JSON.stringify(b1e(e),null,2);navigator.clipboard.writeText(`\`\`\`
|
||
${s}
|
||
\`\`\``),n({title:"Error Copied"})},[e,n]),o=d.useMemo(()=>p1e({user:"invoke-ai",repo:"InvokeAI",template:"BUG_REPORT.yml",title:`[bug]: ${e.name}: ${e.message}`}),[e.message,e.name]);return a.jsx(L,{layerStyle:"body",sx:{w:"100vw",h:"100vh",alignItems:"center",justifyContent:"center",p:4},children:a.jsxs(L,{layerStyle:"first",sx:{flexDir:"column",borderRadius:"base",justifyContent:"center",gap:8,p:16},children:[a.jsx(cr,{children:"Something went wrong"}),a.jsx(L,{layerStyle:"second",sx:{px:8,py:4,borderRadius:"base",gap:4,justifyContent:"space-between",alignItems:"center"},children:a.jsxs(ve,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs(L,{sx:{gap:4},children:[a.jsx(at,{leftIcon:a.jsx(goe,{}),onClick:t,children:"Reset UI"}),a.jsx(at,{leftIcon:a.jsx(Hc,{}),onClick:r,children:"Copy Error"}),a.jsx(Oh,{href:o,isExternal:!0,children:a.jsx(at,{leftIcon:a.jsx(hy,{}),children:"Create Issue"})})]})]})})},C1e=d.memo(y1e),w1e=le([xe],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:Bt}}),S1e=()=>{const e=te(),{shift:t,ctrl:n,meta:r}=W(w1e),{queueBack:o,isDisabled:s,isLoading:i}=V8();et(["ctrl+enter","meta+enter"],o,{enabled:()=>!s&&!i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s,i]);const{queueFront:l,isDisabled:u,isLoading:p}=K8();return et(["ctrl+shift+enter","meta+shift+enter"],l,{enabled:()=>!u&&!p,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[l,u,p]),et("*",()=>{Hp("shift")?!t&&e(Nr(!0)):t&&e(Nr(!1)),Hp("ctrl")?!n&&e(Uw(!0)):n&&e(Uw(!1)),Hp("meta")?!r&&e(Gw(!0)):r&&e(Gw(!1))},{keyup:!0,keydown:!0},[t,n,r]),et("1",()=>{e(Xs("txt2img"))}),et("2",()=>{e(Xs("img2img"))}),et("3",()=>{e(Xs("unifiedCanvas"))}),et("4",()=>{e(Xs("nodes"))}),et("5",()=>{e(Xs("modelManager"))}),null},k1e=d.memo(S1e),j1e=e=>{const t=te(),{recallAllParameters:n}=Sg(),r=sl(),{currentData:o}=to((e==null?void 0:e.imageName)??$r.skipToken),{currentData:s}=T9((e==null?void 0:e.imageName)??$r.skipToken),i=d.useCallback(()=>{o&&(t(mI(o)),t(Xs("unifiedCanvas")),r({title:N9("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))},[t,r,o]),l=d.useCallback(()=>{o&&t(vh(o))},[t,o]),u=d.useCallback(()=>{s&&n(s.metadata)},[s]);return d.useEffect(()=>{e&&e.action==="sendToCanvas"&&i()},[e,i]),d.useEffect(()=>{e&&e.action==="sendToImg2Img"&&l()},[e,l]),d.useEffect(()=>{e&&e.action==="useAllParameters"&&u()},[e,u]),{handleSendToCanvas:i,handleSendToImg2Img:l,handleUseAllMetadata:u}},_1e=e=>(j1e(e.selectedImage),null),I1e=d.memo(_1e),P1e={},E1e=({config:e=P1e,selectedImage:t})=>{const n=W(wM),r=fP("system"),o=te(),s=d.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);d.useEffect(()=>{yt.changeLanguage(n)},[n]),d.useEffect(()=>{_I(e)&&(r.info({config:e},"Received config"),o($9(e)))},[o,e,r]),d.useEffect(()=>{o(L9())},[o]);const i=Jh(z9);return a.jsxs(d1e,{onReset:s,FallbackComponent:C1e,children:[a.jsx(Ja,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx(rG,{children:a.jsxs(Ja,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[i||a.jsx(Ree,{}),a.jsx(L,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(c1e,{})})]})})}),a.jsx(bJ,{}),a.jsx(hJ,{}),a.jsx(GW,{}),a.jsx(k1e,{}),a.jsx(I1e,{selectedImage:t})]})},T1e=d.memo(E1e);export{T1e as default};
|